@univerjs/sheets-formula-ui 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -1,23 +1,23 @@
1
1
  var to = Object.defineProperty;
2
2
  var no = (r, e, t) => e in r ? to(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var j = (r, e, t) => no(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { CommandType as Me, ICommandService as Ee, createIdentifier as ro, IContextService as Lt, IUniverInstanceService as be, Rectangle as ir, DEFAULT_EMPTY_DOCUMENT_VALUE as cr, isRealNum as oo, CellValueType as On, getCellValueType as so, toDisposable as lr, DisposableCollection as ze, RANGE_TYPE as ge, Inject as V, Injector as Dt, ThemeService as _t, useDependency as A, ColorKit as ar, EDITOR_ACTIVATED as An, UniverInstanceType as X, debounce as io, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as $t, LocaleService as Ye, createInternalEditorID as ur, generateRandomId as hr, useObservable as dn, isFormulaString as ke, isFormulaId as rt, FOCUSING_DOC as co, FOCUSING_UNIVER_EDITOR as lo, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as ao, Disposable as it, isICellData as uo, Tools as $e, Direction as te, ObjectMatrix as vt, ILogService as ho, RxDisposable as fo, InterceptorEffectEnum as mo, useInjector as go, connectInjector as Pn, FORMULA_EDITOR_ACTIVATED as wn, DOCS_ZEN_EDITOR_UNIT_ID_KEY as So, FOCUSING_EDITOR_INPUT_FORMULA as Rt, AbsoluteRefType as ee, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as po, Plugin as _o, merge as vo, touchDependencies as Co, DependentOn as Ro, IConfigService as Io } from "@univerjs/core";
5
- import { SheetPasteCommand as Eo, PREDEFINED_HOOK_NAME as Je, BaseSelectionRenderService as bo, getCoordByOffset as Ln, checkInHeaderRanges as Dn, getAllSelection as No, genNormalSelectionStyle as fr, getSheetObject as yo, attachSelectionWithCoord as on, SelectionControl as dr, SheetSkeletonManagerService as kt, RANGE_SELECTOR_SYMBOLS as xo, SetCellEditVisibleOperation as To, EMBEDDING_FORMULA_EDITOR as Fo, CellAlertType as Mo, HoverManagerService as Oo, CellAlertManagerService as Ao, DATA_TYPE as $n, APPLY_TYPE as Po, IAutoFillService as wo, COPY_TYPE as Lo, ISheetClipboardService as Do, SELECTION_SHAPE_DEPTH as $o, useActiveWorkbook as ko, getCurrentRangeDisable$ as mr, PASTE_SPECIAL_MENU_ID as Uo, whenFormulaEditorActivated as Ct, SheetsUIPart as jo, isRangeSelector as Ve, isEmbeddingFormulaEditor as Be, SheetCellEditorResizeService as Ho, getEditorObject as Wo, MoveSelectionCommand as kn, JumpOver as Un, ExpandSelectionCommand as jn, IEditorBridgeService as Vo, RANGE_SELECTOR_COMPONENT_KEY as Bo, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as qo } from "@univerjs/sheets-ui";
6
- import { sequenceNodeType as Y, serializeRange as Ie, matchToken as G, LexerTreeBuilder as je, deserializeRangeWithSheet as he, serializeRangeWithSheet as Nt, compareToken as xe, operatorToken as Te, ERROR_TYPE_SET as Ko, ErrorType as ue, FormulaDataModel as Ut, SetFormulaCalculationResultMutation as zo, SetArrayFormulaDataMutation as Yo, SetFormulaCalculationStopMutation as Go, FunctionType as Zo, matchRefDrawToken as Hn, normalizeSheetName as Xo, serializeRangeToRefString as Qo, generateStringWithSequence as Jo, getAbsoluteRefTypeWitString as es, UniverFormulaEnginePlugin as ts } from "@univerjs/engine-formula";
7
- import { Subject as ut, merge as et, map as mn, distinctUntilChanged as gn, throttleTime as Sn, filter as tt, noop as Wn, debounceTime as jt, combineLatestWith as ns, switchMap as rs, of as Vn, Observable as os, distinctUntilKeyChanged as ss } from "rxjs";
8
- import { IEditorService as ve, VIEWPORT_KEY as is, DocBackScrollRenderController as gr, DocSelectionRenderService as cs, ReplaceContentCommand as ls, MoveCursorOperation as as } from "@univerjs/docs-ui";
9
- import { SheetsSelectionsService as pn, getSheetCommandTarget as us, getCellAtRowCol as hs, SetSelectionsOperation as fs, SelectionMoveType as It, convertSelectionDataToRange as Et, IRefSelectionsService as Ht, setEndForRange as Sr, REF_SELECTIONS_ENABLED as pt, SetWorksheetActiveOperation as Bn, SetRangeValuesMutation as qn, SetRangeValuesUndoMutationFactory as ds, SheetInterceptorService as pr, BEFORE_CELL_EDIT as ms, SetWorksheetRowAutoHeightMutation as gs, INTERCEPTOR_POINT as Ss, WorkbookEditablePermission as _r, WorksheetEditPermission as vr, WorksheetSetCellValuePermission as Cr, RangeProtectionPermissionEditPoint as Rr, getPrimaryForRange as ps } from "@univerjs/sheets";
3
+ var W = (r, e, t) => no(r, typeof e != "symbol" ? e + "" : e, t);
4
+ import { CommandType as Me, ICommandService as Ne, createIdentifier as ro, IContextService as Lt, IUniverInstanceService as ye, Rectangle as ir, DEFAULT_EMPTY_DOCUMENT_VALUE as cr, isRealNum as oo, CellValueType as On, getCellValueType as so, toDisposable as lr, DisposableCollection as ze, RANGE_TYPE as Se, Inject as q, Injector as Dt, ThemeService as _t, useDependency as A, ColorKit as ar, EDITOR_ACTIVATED as An, UniverInstanceType as X, debounce as io, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as $t, LocaleService as Ye, createInternalEditorID as ur, generateRandomId as hr, useObservable as mn, isFormulaString as Ue, isFormulaId as rt, FOCUSING_DOC as co, FOCUSING_UNIVER_EDITOR as lo, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as ao, Disposable as it, isICellData as uo, Tools as ke, Direction as ne, ObjectMatrix as vt, ILogService as ho, RxDisposable as fo, InterceptorEffectEnum as mo, useInjector as go, connectInjector as Pn, FORMULA_EDITOR_ACTIVATED as wn, DOCS_ZEN_EDITOR_UNIT_ID_KEY as So, FOCUSING_EDITOR_INPUT_FORMULA as Rt, AbsoluteRefType as te, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as po, Plugin as _o, merge as vo, touchDependencies as Co, DependentOn as Ro, IConfigService as Io } from "@univerjs/core";
5
+ import { SheetPasteCommand as Eo, PREDEFINED_HOOK_NAME as Je, BaseSelectionRenderService as bo, getCoordByOffset as Ln, checkInHeaderRanges as Dn, getAllSelection as No, genNormalSelectionStyle as fr, getSheetObject as yo, attachSelectionWithCoord as sn, SelectionControl as dr, SheetSkeletonManagerService as kt, RANGE_SELECTOR_SYMBOLS as xo, SetCellEditVisibleOperation as To, EMBEDDING_FORMULA_EDITOR as Fo, CellAlertType as Mo, HoverManagerService as Oo, CellAlertManagerService as Ao, DATA_TYPE as $n, APPLY_TYPE as Po, IAutoFillService as wo, COPY_TYPE as Lo, ISheetClipboardService as Do, SELECTION_SHAPE_DEPTH as $o, useActiveWorkbook as ko, getCurrentRangeDisable$ as mr, PASTE_SPECIAL_MENU_ID as Uo, whenFormulaEditorActivated as Ct, SheetsUIPart as jo, isRangeSelector as Be, isEmbeddingFormulaEditor as Ve, SheetCellEditorResizeService as Ho, getEditorObject as Wo, MoveSelectionCommand as kn, JumpOver as Un, ExpandSelectionCommand as jn, IEditorBridgeService as Bo, RANGE_SELECTOR_COMPONENT_KEY as Vo, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as qo } from "@univerjs/sheets-ui";
6
+ import { sequenceNodeType as z, serializeRange as Ee, matchToken as G, LexerTreeBuilder as Oe, deserializeRangeWithSheet as ae, serializeRangeWithSheet as Nt, compareToken as Te, operatorToken as Fe, ERROR_TYPE_SET as Ko, ErrorType as fe, FormulaDataModel as Ut, SetFormulaCalculationResultMutation as zo, SetArrayFormulaDataMutation as Yo, SetFormulaCalculationStopMutation as Go, FunctionType as Zo, matchRefDrawToken as Hn, normalizeSheetName as Xo, serializeRangeToRefString as Qo, generateStringWithSequence as Jo, getAbsoluteRefTypeWitString as es, UniverFormulaEnginePlugin as ts } from "@univerjs/engine-formula";
7
+ import { Subject as ut, merge as et, map as gn, distinctUntilChanged as Sn, throttleTime as pn, filter as tt, noop as Wn, debounceTime as jt, combineLatestWith as ns, switchMap as rs, of as Bn, Observable as os, distinctUntilKeyChanged as ss } from "rxjs";
8
+ import { IEditorService as Re, VIEWPORT_KEY as is, DocBackScrollRenderController as gr, DocSelectionRenderService as cs, ReplaceContentCommand as ls, MoveCursorOperation as as } from "@univerjs/docs-ui";
9
+ import { SheetsSelectionsService as _n, getSheetCommandTarget as us, getCellAtRowCol as hs, SetSelectionsOperation as fs, SelectionMoveType as It, convertSelectionDataToRange as Et, IRefSelectionsService as Ht, setEndForRange as Sr, REF_SELECTIONS_ENABLED as pt, SetWorksheetActiveOperation as Vn, SetRangeValuesMutation as qn, SetRangeValuesUndoMutationFactory as ds, SheetInterceptorService as pr, BEFORE_CELL_EDIT as ms, SetWorksheetRowAutoHeightMutation as gs, INTERCEPTOR_POINT as Ss, WorkbookEditablePermission as _r, WorksheetEditPermission as vr, WorksheetSetCellValuePermission as Cr, RangeProtectionPermissionEditPoint as Rr, getPrimaryForRange as ps } from "@univerjs/sheets";
10
10
  import { InsertFunctionCommand as _s, IDescriptionService as ct, TriggerCalculationController as vs, UniverSheetsFormulaPlugin as Cs } from "@univerjs/sheets-formula";
11
- import { ISidebarService as Wt, IShortcutService as Vt, KeyCode as L, IContextMenuService as Ir, IZenZoneService as Rs, ProgressBar as Is, ILayoutService as Er, MenuItemType as _n, getMenuHiddenObservable as Es, IClipboardInterfaceService as Kn, RibbonStartGroup as bs, MetaKeys as Ue, BuiltInUIPart as Ns, ComponentManager as br, IMenuManagerService as ys, IUIPartsService as xs, UNI_DISABLE_CHANGING_FOCUS_KEY as Yt } from "@univerjs/ui";
12
- import Ts, { forwardRef as Oe, useRef as Z, createElement as He, useEffect as D, useMemo as z, useLayoutEffect as ot, useState as $, useCallback as sn } from "react";
13
- import { Tooltip as Fs, Dialog as Ms, Button as nt, Input as Nr, Popup as Bt, Select as Os } from "@univerjs/design";
14
- import { ScrollTimerType as Gt, SHEET_VIEWPORT_KEY as zn, Vector2 as Yn, IRenderManagerService as fe, DeviceInputEventType as pe, ScrollBar as As } from "@univerjs/engine-render";
15
- import { DocSkeletonManagerService as cn, DocSelectionManagerService as Ps } from "@univerjs/docs";
11
+ import { ISidebarService as Wt, IShortcutService as Bt, KeyCode as L, IContextMenuService as Ir, IZenZoneService as Rs, ProgressBar as Is, ILayoutService as Er, MenuItemType as vn, getMenuHiddenObservable as Es, IClipboardInterfaceService as Kn, RibbonStartGroup as bs, MetaKeys as je, BuiltInUIPart as Ns, ComponentManager as br, IMenuManagerService as ys, IUIPartsService as xs, UNI_DISABLE_CHANGING_FOCUS_KEY as Gt } from "@univerjs/ui";
12
+ import Ts, { forwardRef as Ae, useRef as Z, createElement as He, useEffect as D, useMemo as K, useLayoutEffect as ot, useState as $, useCallback as cn } from "react";
13
+ import { Tooltip as Fs, Dialog as Ms, Button as nt, Input as Nr, Popup as Vt, Select as Os } from "@univerjs/design";
14
+ import { ScrollTimerType as Zt, SHEET_VIEWPORT_KEY as zn, Vector2 as Yn, IRenderManagerService as de, DeviceInputEventType as _e, ScrollBar as As } from "@univerjs/engine-render";
15
+ import { DocSkeletonManagerService as ln, DocSelectionManagerService as Ps } from "@univerjs/docs";
16
16
  import { throttleTime as ws, debounceTime as Ls, map as Ds, distinctUntilChanged as $s } from "rxjs/operators";
17
- const vn = {
17
+ const Cn = {
18
18
  id: "sheet.command.paste-formula",
19
19
  type: Me.COMMAND,
20
- handler: async (r) => r.get(Ee).executeCommand(Eo.id, {
20
+ handler: async (r) => r.get(Ne).executeCommand(Eo.id, {
21
21
  value: Je.SPECIAL_PASTE_FORMULA
22
22
  })
23
23
  }, Ge = {
@@ -31,23 +31,23 @@ var ks = Object.defineProperty, Us = Object.getOwnPropertyDescriptor, js = (r, e
31
31
  return n && o && ks(e, t, o), o;
32
32
  }, Hs = (r, e) => (t, n) => e(t, n, r);
33
33
  const Ws = "FORMULA_PROMPT_ACTIVATED", lt = ro("formula-ui.prompt-service");
34
- let ln = class {
34
+ let an = class {
35
35
  constructor(r) {
36
- j(this, "_search$", new ut());
37
- j(this, "_help$", new ut());
38
- j(this, "_navigate$", new ut());
39
- j(this, "_accept$", new ut());
40
- j(this, "_acceptFormulaName$", new ut());
41
- j(this, "search$", this._search$.asObservable());
42
- j(this, "help$", this._help$.asObservable());
43
- j(this, "navigate$", this._navigate$.asObservable());
44
- j(this, "accept$", this._accept$.asObservable());
45
- j(this, "acceptFormulaName$", this._acceptFormulaName$.asObservable());
46
- j(this, "_searching", !1);
47
- j(this, "_helping", !1);
48
- j(this, "_sequenceNodes", []);
49
- j(this, "_isLockedOnSelectionChangeRefString", !1);
50
- j(this, "_isLockedOnSelectionInsertRefString", !1);
36
+ W(this, "_search$", new ut());
37
+ W(this, "_help$", new ut());
38
+ W(this, "_navigate$", new ut());
39
+ W(this, "_accept$", new ut());
40
+ W(this, "_acceptFormulaName$", new ut());
41
+ W(this, "search$", this._search$.asObservable());
42
+ W(this, "help$", this._help$.asObservable());
43
+ W(this, "navigate$", this._navigate$.asObservable());
44
+ W(this, "accept$", this._accept$.asObservable());
45
+ W(this, "acceptFormulaName$", this._acceptFormulaName$.asObservable());
46
+ W(this, "_searching", !1);
47
+ W(this, "_helping", !1);
48
+ W(this, "_sequenceNodes", []);
49
+ W(this, "_isLockedOnSelectionChangeRefString", !1);
50
+ W(this, "_isLockedOnSelectionInsertRefString", !1);
51
51
  this._contextService = r;
52
52
  }
53
53
  dispose() {
@@ -116,7 +116,7 @@ let ln = class {
116
116
  */
117
117
  updateSequenceRef(r, e) {
118
118
  const t = this._sequenceNodes[r];
119
- if (typeof t == "string" || t.nodeType !== Y.REFERENCE)
119
+ if (typeof t == "string" || t.nodeType !== z.REFERENCE)
120
120
  return;
121
121
  const n = e.length - t.token.length, o = { ...t };
122
122
  o.token = e, o.endIndex += n, this._sequenceNodes[r] = o;
@@ -140,7 +140,7 @@ let ln = class {
140
140
  token: e,
141
141
  startIndex: r,
142
142
  endIndex: r + t - 1,
143
- nodeType: Y.REFERENCE
143
+ nodeType: z.REFERENCE
144
144
  });
145
145
  for (let o = n + 1, s = this._sequenceNodes.length; o < s; o++) {
146
146
  const i = this._sequenceNodes[o];
@@ -186,66 +186,66 @@ let ln = class {
186
186
  return this._isLockedOnSelectionInsertRefString;
187
187
  }
188
188
  };
189
- ln = js([
189
+ an = js([
190
190
  Hs(0, Lt)
191
- ], ln);
192
- const an = {
191
+ ], an);
192
+ const un = {
193
193
  id: "formula-ui.operation.help-function",
194
194
  type: Me.OPERATION,
195
195
  handler: async (r, e) => (r.get(lt).help(e), !0)
196
- }, Cn = {
196
+ }, Rn = {
197
197
  id: "formula-ui.operation.insert-function",
198
198
  type: Me.OPERATION,
199
199
  handler: async (r, e) => {
200
- var v, d;
201
- const t = r.get(pn), n = r.get(ve), o = t.getCurrentSelections();
200
+ var C, v;
201
+ const t = r.get(_n), n = r.get(Re), o = t.getCurrentSelections();
202
202
  if (!o || !o.length)
203
203
  return !1;
204
- const s = us(r.get(be));
204
+ const s = us(r.get(ye));
205
205
  if (!s) return !1;
206
- const { worksheet: i, unitId: c, subUnitId: l } = s, h = i.getCellMatrix(), { value: f } = e, u = r.get(Ee), a = [];
207
- let m = null, S = 0, _ = 0, g = "";
206
+ const { worksheet: i, unitId: c, subUnitId: l } = s, h = i.getCellMatrix(), { value: f } = e, u = r.get(Ne), a = [];
207
+ let d = null, S = 0, p = 0, m = "";
208
208
  if (o.length === 1 && (qs(o[0].range) || Ks(o[0].range))) {
209
- const { range: C, primary: R } = o[0], E = (v = R == null ? void 0 : R.actualRow) != null ? v : C.startRow, N = (d = R == null ? void 0 : R.actualColumn) != null ? d : C.startColumn;
210
- m = C, S = E, _ = N;
211
- const I = Gn(h, E, N);
212
- I && (g = Ie(I));
209
+ const { range: g, primary: I } = o[0], R = (C = I == null ? void 0 : I.actualRow) != null ? C : g.startRow, N = (v = I == null ? void 0 : I.actualColumn) != null ? v : g.startColumn;
210
+ d = g, S = R, p = N;
211
+ const E = Gn(h, R, N);
212
+ E && (m = Ee(E));
213
213
  } else
214
- o.some((C) => {
215
- var y, P;
216
- const { range: R, primary: E } = C, N = (y = E == null ? void 0 : E.actualRow) != null ? y : R.startRow, I = (P = E == null ? void 0 : E.actualColumn) != null ? P : R.startColumn, x = Gn(h, N, I);
217
- if (!x)
218
- return m = R, S = N, _ = I, !0;
219
- const b = Ie(x), M = `=${f}(${b})`;
214
+ o.some((g) => {
215
+ var x, P;
216
+ const { range: I, primary: R } = g, N = (x = R == null ? void 0 : R.actualRow) != null ? x : I.startRow, E = (P = R == null ? void 0 : R.actualColumn) != null ? P : I.startColumn, y = Gn(h, N, E);
217
+ if (!y)
218
+ return d = I, S = N, p = E, !0;
219
+ const b = Ee(y), O = `=${f}(${b})`;
220
220
  return a.push({
221
- range: R,
221
+ range: I,
222
222
  primary: {
223
223
  row: N,
224
- column: I
224
+ column: E
225
225
  },
226
- formula: M
226
+ formula: O
227
227
  }), !1;
228
228
  });
229
- if (m) {
230
- const C = hs(S, _, i), R = {
231
- range: ir.clone(m),
229
+ if (d) {
230
+ const g = hs(S, p, i), I = {
231
+ range: ir.clone(d),
232
232
  primary: {
233
- startRow: C.startRow,
234
- startColumn: C.startColumn,
235
- endRow: C.endRow,
236
- endColumn: C.endColumn,
233
+ startRow: g.startRow,
234
+ startColumn: g.startColumn,
235
+ endRow: g.endRow,
236
+ endColumn: g.endColumn,
237
237
  actualRow: S,
238
- actualColumn: _,
239
- isMerged: C.isMerged,
240
- isMergedMainCell: C.startRow === S && C.startColumn === _
238
+ actualColumn: p,
239
+ isMerged: g.isMerged,
240
+ isMergedMainCell: g.startRow === S && g.startColumn === p
241
241
  }
242
- }, E = {
242
+ }, R = {
243
243
  unitId: c,
244
244
  subUnitId: l,
245
- selections: [R]
245
+ selections: [I]
246
246
  };
247
- await u.executeCommand(fs.id, E), setTimeout(() => {
248
- n.setFormula(`=${f}(${g}`);
247
+ await u.executeCommand(fs.id, R), setTimeout(() => {
248
+ n.setFormula(`=${f}(${m}`);
249
249
  }, 0);
250
250
  }
251
251
  return a.length === 0 ? !1 : u.executeCommand(_s.id, {
@@ -254,7 +254,7 @@ const an = {
254
254
  }
255
255
  };
256
256
  function Gn(r, e, t) {
257
- const n = Vs(r, e, t);
257
+ const n = Bs(r, e, t);
258
258
  if (n !== e)
259
259
  return {
260
260
  startRow: n,
@@ -262,7 +262,7 @@ function Gn(r, e, t) {
262
262
  startColumn: t,
263
263
  endColumn: t
264
264
  };
265
- const o = Bs(r, e, t);
265
+ const o = Vs(r, e, t);
266
266
  return o !== t ? {
267
267
  startRow: e,
268
268
  endRow: e,
@@ -270,7 +270,7 @@ function Gn(r, e, t) {
270
270
  endColumn: t - 1
271
271
  } : null;
272
272
  }
273
- function Vs(r, e, t) {
273
+ function Bs(r, e, t) {
274
274
  let n = !1;
275
275
  if (e === 0) return e;
276
276
  for (let o = e - 1; o >= 0; o--) {
@@ -287,7 +287,7 @@ function Vs(r, e, t) {
287
287
  }
288
288
  return e;
289
289
  }
290
- function Bs(r, e, t) {
290
+ function Vs(r, e, t) {
291
291
  let n = !1;
292
292
  if (t === 0) return t;
293
293
  for (let o = t - 1; o >= 0; o--) {
@@ -320,23 +320,23 @@ function qs(r) {
320
320
  function Ks(r) {
321
321
  return r.startRow !== r.endRow && r.startColumn !== r.endColumn;
322
322
  }
323
- const yr = "SHEET_FORMULA_UI_PLUGIN", xr = `${yr}_MORE_FUNCTIONS_COMPONENT`, Rn = {
323
+ const yr = "SHEET_FORMULA_UI_PLUGIN", xr = `${yr}_MORE_FUNCTIONS_COMPONENT`, In = {
324
324
  id: "formula-ui.operation.more-functions",
325
325
  type: Me.OPERATION,
326
326
  handler: async (r) => (r.get(Wt).open({
327
327
  header: { title: "formula.insert.tooltip" },
328
328
  children: { label: xr }
329
329
  }), !0)
330
- }, In = {
330
+ }, En = {
331
331
  id: "formula-ui.operation.change-ref-to-absolute",
332
332
  type: Me.OPERATION,
333
333
  handler: async (r) => !0
334
- }, un = {
334
+ }, hn = {
335
335
  id: "formula-ui.operation.search-function",
336
336
  type: Me.OPERATION,
337
337
  handler: async (r, e) => (r.get(lt).search(e), !0)
338
338
  };
339
- var Zt = { exports: {} }, ht = {};
339
+ var Xt = { exports: {} }, ht = {};
340
340
  /**
341
341
  * @license React
342
342
  * react-jsx-runtime.production.min.js
@@ -352,26 +352,26 @@ function zs() {
352
352
  Zn = 1;
353
353
  var r = Ts, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, o = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
354
354
  function i(c, l, h) {
355
- var f, u = {}, a = null, m = null;
356
- h !== void 0 && (a = "" + h), l.key !== void 0 && (a = "" + l.key), l.ref !== void 0 && (m = l.ref);
355
+ var f, u = {}, a = null, d = null;
356
+ h !== void 0 && (a = "" + h), l.key !== void 0 && (a = "" + l.key), l.ref !== void 0 && (d = l.ref);
357
357
  for (f in l) n.call(l, f) && !s.hasOwnProperty(f) && (u[f] = l[f]);
358
358
  if (c && c.defaultProps) for (f in l = c.defaultProps, l) u[f] === void 0 && (u[f] = l[f]);
359
- return { $$typeof: e, type: c, key: a, ref: m, props: u, _owner: o.current };
359
+ return { $$typeof: e, type: c, key: a, ref: d, props: u, _owner: o.current };
360
360
  }
361
361
  return ht.Fragment = t, ht.jsx = i, ht.jsxs = i, ht;
362
362
  }
363
363
  var Xn;
364
364
  function Ys() {
365
- return Xn || (Xn = 1, Zt.exports = zs()), Zt.exports;
365
+ return Xn || (Xn = 1, Xt.exports = zs()), Xt.exports;
366
366
  }
367
- var p = Ys(), Se = function() {
368
- return Se = Object.assign || function(r) {
367
+ var _ = Ys(), pe = function() {
368
+ return pe = Object.assign || function(r) {
369
369
  for (var e, t = 1, n = arguments.length; t < n; t++) {
370
370
  e = arguments[t];
371
371
  for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (r[o] = e[o]);
372
372
  }
373
373
  return r;
374
- }, Se.apply(this, arguments);
374
+ }, pe.apply(this, arguments);
375
375
  }, Gs = function(r, e) {
376
376
  var t = {};
377
377
  for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && e.indexOf(n) < 0 && (t[n] = r[n]);
@@ -379,17 +379,17 @@ var p = Ys(), Se = function() {
379
379
  for (var o = 0, n = Object.getOwnPropertySymbols(r); o < n.length; o++)
380
380
  e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(r, n[o]) && (t[n[o]] = r[n[o]]);
381
381
  return t;
382
- }, We = Oe(function(r, e) {
382
+ }, We = Ae(function(r, e) {
383
383
  var t = r.icon, n = r.id, o = r.className, s = r.extend, i = Gs(r, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(n, " ").concat(o || "").trim(), l = Z("_".concat(Qs()));
384
- return Tr(t, "".concat(n), { defIds: t.defIds, idSuffix: l.current }, Se({ ref: e, className: c }, i), s);
384
+ return Tr(t, "".concat(n), { defIds: t.defIds, idSuffix: l.current }, pe({ ref: e, className: c }, i), s);
385
385
  });
386
386
  function Tr(r, e, t, n, o) {
387
- return He(r.tag, Se(Se({ key: e }, Zs(r, t, o)), n), (Xs(r, t).children || []).map(function(s, i) {
387
+ return He(r.tag, pe(pe({ key: e }, Zs(r, t, o)), n), (Xs(r, t).children || []).map(function(s, i) {
388
388
  return Tr(s, "".concat(e, "-").concat(r.tag, "-").concat(i), t, void 0, o);
389
389
  }));
390
390
  }
391
391
  function Zs(r, e, t) {
392
- var n = Se({}, r.attrs);
392
+ var n = pe({}, r.attrs);
393
393
  t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1);
394
394
  var o = e.defIds;
395
395
  return !o || o.length === 0 || (r.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(s) {
@@ -399,15 +399,15 @@ function Zs(r, e, t) {
399
399
  }
400
400
  function Xs(r, e) {
401
401
  var t, n = e.defIds;
402
- return !n || n.length === 0 ? r : r.tag === "defs" && (!((t = r.children) === null || t === void 0) && t.length) ? Se(Se({}, r), { children: r.children.map(function(o) {
403
- return typeof o.attrs.id == "string" && n && n.indexOf(o.attrs.id) > -1 ? Se(Se({}, o), { attrs: Se(Se({}, o.attrs), { id: o.attrs.id + e.idSuffix }) }) : o;
402
+ return !n || n.length === 0 ? r : r.tag === "defs" && (!((t = r.children) === null || t === void 0) && t.length) ? pe(pe({}, r), { children: r.children.map(function(o) {
403
+ return typeof o.attrs.id == "string" && n && n.indexOf(o.attrs.id) > -1 ? pe(pe({}, o), { attrs: pe(pe({}, o.attrs), { id: o.attrs.id + e.idSuffix }) }) : o;
404
404
  }) }) : r;
405
405
  }
406
406
  function Qs() {
407
407
  return Math.random().toString(36).substring(2, 8);
408
408
  }
409
409
  We.displayName = "UniverIcon";
410
- var Js = { tag: "svg", attrs: { 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" } }] }, Fr = Oe(function(r, e) {
410
+ var Js = { tag: "svg", attrs: { 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" } }] }, Fr = Ae(function(r, e) {
411
411
  return He(We, Object.assign({}, r, {
412
412
  id: "check-mark-single",
413
413
  ref: e,
@@ -415,7 +415,7 @@ var Js = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
415
415
  }));
416
416
  });
417
417
  Fr.displayName = "CheckMarkSingle";
418
- var ei = { tag: "svg", attrs: { 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" } }] }, qt = Oe(function(r, e) {
418
+ var ei = { tag: "svg", attrs: { 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" } }] }, qt = Ae(function(r, e) {
419
419
  return He(We, Object.assign({}, r, {
420
420
  id: "close-single",
421
421
  ref: e,
@@ -423,7 +423,7 @@ var ei = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
423
423
  }));
424
424
  });
425
425
  qt.displayName = "CloseSingle";
426
- var ti = { tag: "svg", attrs: { 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.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.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.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.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" } }] }, Mr = Oe(function(r, e) {
426
+ var ti = { tag: "svg", attrs: { 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.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.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.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.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" } }] }, Mr = Ae(function(r, e) {
427
427
  return He(We, Object.assign({}, r, {
428
428
  id: "delete-single",
429
429
  ref: e,
@@ -431,7 +431,7 @@ var ti = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
431
431
  }));
432
432
  });
433
433
  Mr.displayName = "DeleteSingle";
434
- var ni = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.75 5.32495C8.75 5.73916 8.41421 6.07495 8 6.07495 7.58579 6.07495 7.25 5.73916 7.25 5.32495 7.25 4.91074 7.58579 4.57495 8 4.57495 8.41421 4.57495 8.75 4.91074 8.75 5.32495zM8.5999 7.52505C8.5999 7.19368 8.33127 6.92505 7.9999 6.92505 7.66853 6.92505 7.3999 7.19368 7.3999 7.52505V11.425C7.3999 11.7564 7.66853 12.025 7.9999 12.025 8.33127 12.025 8.5999 11.7564 8.5999 11.425V7.52505z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M0.899902 8.00002C0.899902 4.0788 4.07868 0.900024 7.9999 0.900024C11.9211 0.900024 15.0999 4.0788 15.0999 8.00002C15.0999 11.9212 11.9211 15.1 7.9999 15.1C4.07868 15.1 0.899902 11.9212 0.899902 8.00002ZM7.9999 2.10002C4.74142 2.10002 2.0999 4.74154 2.0999 8.00002C2.0999 11.2585 4.74142 13.9 7.9999 13.9C11.2584 13.9 13.8999 11.2585 13.8999 8.00002C13.8999 4.74154 11.2584 2.10002 7.9999 2.10002Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Or = Oe(function(r, e) {
434
+ var ni = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.75 5.32495C8.75 5.73916 8.41421 6.07495 8 6.07495 7.58579 6.07495 7.25 5.73916 7.25 5.32495 7.25 4.91074 7.58579 4.57495 8 4.57495 8.41421 4.57495 8.75 4.91074 8.75 5.32495zM8.5999 7.52505C8.5999 7.19368 8.33127 6.92505 7.9999 6.92505 7.66853 6.92505 7.3999 7.19368 7.3999 7.52505V11.425C7.3999 11.7564 7.66853 12.025 7.9999 12.025 8.33127 12.025 8.5999 11.7564 8.5999 11.425V7.52505z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M0.899902 8.00002C0.899902 4.0788 4.07868 0.900024 7.9999 0.900024C11.9211 0.900024 15.0999 4.0788 15.0999 8.00002C15.0999 11.9212 11.9211 15.1 7.9999 15.1C4.07868 15.1 0.899902 11.9212 0.899902 8.00002ZM7.9999 2.10002C4.74142 2.10002 2.0999 4.74154 2.0999 8.00002C2.0999 11.2585 4.74142 13.9 7.9999 13.9C11.2584 13.9 13.8999 11.2585 13.8999 8.00002C13.8999 4.74154 11.2584 2.10002 7.9999 2.10002Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Or = Ae(function(r, e) {
435
435
  return He(We, Object.assign({}, r, {
436
436
  id: "details-single",
437
437
  ref: e,
@@ -439,7 +439,7 @@ var ni = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
439
439
  }));
440
440
  });
441
441
  Or.displayName = "DetailsSingle";
442
- var ri = { tag: "svg", attrs: { 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" } }] }, Ar = Oe(function(r, e) {
442
+ var ri = { tag: "svg", attrs: { 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" } }] }, Ar = Ae(function(r, e) {
443
443
  return He(We, Object.assign({}, r, {
444
444
  id: "increase-single",
445
445
  ref: e,
@@ -447,15 +447,15 @@ var ri = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
447
447
  }));
448
448
  });
449
449
  Ar.displayName = "IncreaseSingle";
450
- var oi = { tag: "svg", attrs: { 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" } }] }, En = Oe(function(r, e) {
450
+ var oi = { tag: "svg", attrs: { 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" } }] }, bn = Ae(function(r, e) {
451
451
  return He(We, Object.assign({}, r, {
452
452
  id: "more-single",
453
453
  ref: e,
454
454
  icon: oi
455
455
  }));
456
456
  });
457
- En.displayName = "MoreSingle";
458
- var si = { tag: "svg", attrs: { 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" } }] }, Pr = Oe(function(r, e) {
457
+ bn.displayName = "MoreSingle";
458
+ var si = { tag: "svg", attrs: { 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" } }] }, Pr = Ae(function(r, e) {
459
459
  return He(We, Object.assign({}, r, {
460
460
  id: "select-range-single",
461
461
  ref: e,
@@ -481,7 +481,7 @@ var ii = Object.defineProperty, ci = Object.getOwnPropertyDescriptor, li = (r, e
481
481
  (i = r[s]) && (o = (n ? i(e, t, o) : i(o)) || o);
482
482
  return n && o && ii(e, t, o), o;
483
483
  }, Xe = (r, e) => (t, n) => e(t, n, r);
484
- let le = class extends bo {
484
+ let ue = class extends bo {
485
485
  constructor(e, t, n, o, s, i, c) {
486
486
  super(
487
487
  t,
@@ -490,8 +490,8 @@ let le = class extends bo {
490
490
  s,
491
491
  i
492
492
  );
493
- j(this, "_workbookSelections");
494
- j(this, "_eventDisposables");
493
+ W(this, "_workbookSelections");
494
+ W(this, "_eventDisposables");
495
495
  this._context = e, this._contextService = i, this._refSelectionsService = c, this._workbookSelections = this._refSelectionsService.getWorkbookSelections(this._context.unitId), this._initSelectionChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(), this._setSelectionStyle(ai(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
496
496
  }
497
497
  getLocation() {
@@ -525,17 +525,17 @@ let le = class extends bo {
525
525
  _initCanvasEventListeners() {
526
526
  const e = this._getSheetObject(), { spreadsheetRowHeader: t, spreadsheetColumnHeader: n, spreadsheet: o, spreadsheetLeftTopPlaceholder: s } = e, { scene: i } = this._context, c = new ze();
527
527
  return c.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((l, h) => {
528
- this.inRefSelectionMode() && (this._onPointerDown(l, o.zIndex + 1, ge.NORMAL, this._getActiveViewport(l)), l.button !== 2 && h.stopPropagation());
528
+ this.inRefSelectionMode() && (this._onPointerDown(l, o.zIndex + 1, Se.NORMAL, this._getActiveViewport(l)), l.button !== 2 && h.stopPropagation());
529
529
  })), c.add(
530
530
  t == null ? void 0 : t.onPointerDown$.subscribeEvent((l, h) => {
531
531
  if (!this.inRefSelectionMode()) return;
532
532
  const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: u } = Ln(l.offsetX, l.offsetY, i, f);
533
- Dn(this._workbookSelections.getCurrentSelections(), u, ge.ROW) || (this._onPointerDown(l, (o.zIndex || 1) + 1, ge.ROW, this._getActiveViewport(l), Gt.Y), l.button !== 2 && h.stopPropagation());
533
+ Dn(this._workbookSelections.getCurrentSelections(), u, Se.ROW) || (this._onPointerDown(l, (o.zIndex || 1) + 1, Se.ROW, this._getActiveViewport(l), Zt.Y), l.button !== 2 && h.stopPropagation());
534
534
  })
535
535
  ), c.add(n == null ? void 0 : n.onPointerDown$.subscribeEvent((l, h) => {
536
536
  if (!this.inRefSelectionMode()) return;
537
537
  const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: u } = Ln(l.offsetX, l.offsetY, i, f);
538
- Dn(this._workbookSelections.getCurrentSelections(), u, ge.COLUMN) || (this._onPointerDown(l, (o.zIndex || 1) + 1, ge.COLUMN, this._getActiveViewport(l), Gt.X), l.button !== 2 && h.stopPropagation());
538
+ Dn(this._workbookSelections.getCurrentSelections(), u, Se.COLUMN) || (this._onPointerDown(l, (o.zIndex || 1) + 1, Se.COLUMN, this._getActiveViewport(l), Zt.X), l.button !== 2 && h.stopPropagation());
539
539
  })), c.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((l, h) => {
540
540
  if (this._reset(), !this.inRefSelectionMode()) return;
541
541
  const f = this._sheetSkeletonManagerService.getCurrent().skeleton, u = No(f);
@@ -609,8 +609,8 @@ let le = class extends bo {
609
609
  * @param scrollTimerType
610
610
  */
611
611
  // eslint-disable-next-line complexity
612
- _onPointerDown(e, t = 0, n = ge.NORMAL, o, s = Gt.ALL) {
613
- var M;
612
+ _onPointerDown(e, t = 0, n = Se.NORMAL, o, s = Zt.ALL) {
613
+ var O;
614
614
  this._rangeType = n;
615
615
  const i = this._skeleton, c = this._scene;
616
616
  if (!c || !i)
@@ -618,54 +618,54 @@ let le = class extends bo {
618
618
  o && (this._activeViewport = o);
619
619
  const { offsetX: l, offsetY: h } = e, f = c.getViewport(zn.VIEW_MAIN);
620
620
  if (!f) return;
621
- const u = c.getCoordRelativeToViewport(Yn.FromArray([l, h])), { x: a, y: m } = u;
622
- this._startViewportPosX = a, this._startViewportPosY = m;
623
- const S = c.getScrollXYInfoByViewport(u), { scaleX: _, scaleY: g } = c.getAncestorScale(), v = this._skeleton.getCellByOffset(a, m, _, g, S);
624
- if (!v) return;
621
+ const u = c.getCoordRelativeToViewport(Yn.FromArray([l, h])), { x: a, y: d } = u;
622
+ this._startViewportPosX = a, this._startViewportPosY = d;
623
+ const S = c.getScrollXYInfoByViewport(u), { scaleX: p, scaleY: m } = c.getAncestorScale(), C = this._skeleton.getCellByOffset(a, d, p, m, S);
624
+ if (!C) return;
625
625
  switch (n) {
626
- case ge.NORMAL:
626
+ case Se.NORMAL:
627
627
  break;
628
- case ge.ROW:
629
- v.startColumn = 0, v.endColumn = this._skeleton.getColumnCount() - 1;
628
+ case Se.ROW:
629
+ C.startColumn = 0, C.endColumn = this._skeleton.getColumnCount() - 1;
630
630
  break;
631
- case ge.COLUMN:
632
- v.startRow = 0, v.endRow = this._skeleton.getRowCount() - 1;
631
+ case Se.COLUMN:
632
+ C.startRow = 0, C.endRow = this._skeleton.getRowCount() - 1;
633
633
  break;
634
- case ge.ALL:
635
- v.startRow = 0, v.startColumn = 0, v.endRow = this._skeleton.getRowCount() - 1, v.endColumn = this._skeleton.getColumnCount() - 1;
634
+ case Se.ALL:
635
+ C.startRow = 0, C.startColumn = 0, C.endRow = this._skeleton.getRowCount() - 1, C.endColumn = this._skeleton.getColumnCount() - 1;
636
636
  }
637
- const d = { range: v, primary: v, style: null };
638
- d.range.rangeType = n;
639
- const C = on(d, this._skeleton);
640
- this._startRangeWhenPointerDown = { ...C.rangeWithCoord };
641
- const R = { ...C.rangeWithCoord, rangeType: n };
642
- let E = this.getActiveSelectionControl();
637
+ const v = { range: C, primary: C, style: null };
638
+ v.range.rangeType = n;
639
+ const g = sn(v, this._skeleton);
640
+ this._startRangeWhenPointerDown = { ...g.rangeWithCoord };
641
+ const I = { ...g.rangeWithCoord, rangeType: n };
642
+ let R = this.getActiveSelectionControl();
643
643
  const N = this.getSelectionControls();
644
- for (const y of N) {
645
- if (e.button === 2 && y.model.isInclude(R)) {
646
- E = y;
644
+ for (const x of N) {
645
+ if (e.button === 2 && x.model.isInclude(I)) {
646
+ R = x;
647
647
  return;
648
648
  }
649
- if (y.model.isEqual(R)) {
650
- E = y;
649
+ if (x.model.isEqual(I)) {
650
+ R = x;
651
651
  break;
652
652
  }
653
653
  }
654
654
  this._checkClearPreviousControls(e);
655
- const I = E == null ? void 0 : E.model.currentCell, x = e.shiftKey && I, b = this._remainLastEnabled && !e.ctrlKey && !e.shiftKey && !this._skipLastEnabled && !this._singleSelectionEnabled;
656
- x && I ? this._makeSelectionByTwoCells(
655
+ const E = R == null ? void 0 : R.model.currentCell, y = e.shiftKey && E, b = this._remainLastEnabled && !e.ctrlKey && !e.shiftKey && !this._skipLastEnabled && !this._singleSelectionEnabled;
656
+ y && E ? this._makeSelectionByTwoCells(
657
+ E,
657
658
  I,
658
- R,
659
659
  i,
660
660
  n,
661
- E
661
+ R
662
662
  // Get updated in this method
663
- ) : b && E ? E.updateRangeBySelectionWithCoord(C) : E = this.newSelectionControl(c, i, d);
664
- for (let y = 0; y < this.getSelectionControls().length - 1; y++)
665
- this.getSelectionControls()[y].clearHighlight();
666
- this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), c.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (M = c.getTransformer()) == null || M.clearSelectedObjects(), this._setupPointerMoveListener(f, E, n, s, a, m), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = c.onPointerUp$.subscribeEvent(() => {
667
- var y;
668
- this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (y = this._escapeShortcutDisposable) == null || y.dispose(), this._escapeShortcutDisposable = null;
663
+ ) : b && R ? R.updateRangeBySelectionWithCoord(g) : R = this.newSelectionControl(c, i, v);
664
+ for (let x = 0; x < this.getSelectionControls().length - 1; x++)
665
+ this.getSelectionControls()[x].clearHighlight();
666
+ this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), c.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (O = c.getTransformer()) == null || O.clearSelectedObjects(), this._setupPointerMoveListener(f, R, n, s, a, d), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = c.onPointerUp$.subscribeEvent(() => {
667
+ var x;
668
+ this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (x = this._escapeShortcutDisposable) == null || x.dispose(), this._escapeShortcutDisposable = null;
669
669
  });
670
670
  }
671
671
  /**
@@ -681,7 +681,7 @@ let le = class extends bo {
681
681
  enableAutoFill: !1,
682
682
  rowHeaderWidth: s,
683
683
  columnHeaderHeight: i
684
- }), l = on(n, t);
684
+ }), l = sn(n, t);
685
685
  return c.updateRangeBySelectionWithCoord(l), this._selectionControls.push(c), c.setControlExtension({
686
686
  skeleton: t,
687
687
  scene: e,
@@ -695,20 +695,20 @@ let le = class extends bo {
695
695
  }), c;
696
696
  }
697
697
  };
698
- le = li([
699
- Xe(1, V(Dt)),
700
- Xe(2, V(_t)),
701
- Xe(3, Vt),
702
- Xe(4, V(kt)),
698
+ ue = li([
699
+ Xe(1, q(Dt)),
700
+ Xe(2, q(_t)),
701
+ Xe(3, Bt),
702
+ Xe(4, q(kt)),
703
703
  Xe(5, Lt),
704
704
  Xe(6, Ht)
705
- ], le);
705
+ ], ue);
706
706
  function ai(r) {
707
707
  const e = fr(r);
708
708
  return e.widgets = { tl: !0, tc: !0, tr: !0, ml: !0, mr: !0, bl: !0, bc: !0, br: !0 }, e;
709
709
  }
710
710
  const ui = (r, e, t) => {
711
- const o = A(fe).getRenderById(r), s = o == null ? void 0 : o.with(le);
711
+ const o = A(de).getRenderById(r), s = o == null ? void 0 : o.with(ue);
712
712
  D(() => {
713
713
  if (t && s) {
714
714
  const i = t.input$.subscribe((c) => {
@@ -721,7 +721,7 @@ const ui = (r, e, t) => {
721
721
  }, [t, s]), D(() => {
722
722
  s && (e.endsWith(G.COMMA) || s.setSkipLastEnabled(!1));
723
723
  }, [e, s]);
724
- }, Fe = (r) => r.map((e) => typeof e == "string" ? e : e.token).join(""), Dr = (r, e, t) => {
724
+ }, be = (r) => r.map((e) => typeof e == "string" ? e : e.token).join(""), Dr = (r, e, t) => {
725
725
  const n = Z(!1);
726
726
  return D(() => {
727
727
  if (t) {
@@ -735,12 +735,12 @@ const ui = (r, e, t) => {
735
735
  }, [t]), D(() => {
736
736
  if (n.current && r) {
737
737
  n.current = !1;
738
- const s = Fe(r);
738
+ const s = be(r);
739
739
  e(s);
740
740
  }
741
741
  }, [r]), () => n.current = !0;
742
742
  }, Kt = () => {
743
- const r = A(je);
743
+ const r = A(Oe);
744
744
  return (t) => r.sequenceNodesBuilder(t) || [];
745
745
  }, $r = (r, e, t, n, o, s) => {
746
746
  const i = Kt(), c = Z(!0);
@@ -753,9 +753,9 @@ const ui = (r, e, t) => {
753
753
  const u = n(s, f);
754
754
  t && o(u);
755
755
  } else {
756
- const u = s.getDocumentData(), m = { dataStream: (h = (l = u.body) == null ? void 0 : l.dataStream) != null ? h : `${e}\r
756
+ const u = s.getDocumentData(), d = { dataStream: (h = (l = u.body) == null ? void 0 : l.dataStream) != null ? h : `${e}\r
757
757
  `, ...u.body };
758
- s.setDocumentData({ ...u, body: m });
758
+ s.setDocumentData({ ...u, body: d });
759
759
  }
760
760
  c.current = !1;
761
761
  } else if (t) {
@@ -764,7 +764,7 @@ const ui = (r, e, t) => {
764
764
  }
765
765
  }
766
766
  }, [s, t]);
767
- }, kr = (r) => z(() => () => {
767
+ }, kr = (r) => K(() => () => {
768
768
  var t, n;
769
769
  if (r) {
770
770
  r.focus();
@@ -789,39 +789,39 @@ function bt(r, e, t) {
789
789
  widgetStroke: n.colorWhite
790
790
  };
791
791
  }
792
- function bn(r) {
793
- const e = A(be), t = A(_t), n = A(Ht), s = A(fe).getRenderById(r), i = s == null ? void 0 : s.with(le), c = s == null ? void 0 : s.with(kt);
792
+ function Nn(r) {
793
+ const e = A(ye), t = A(_t), n = A(Ht), s = A(de).getRenderById(r), i = s == null ? void 0 : s.with(ue), c = s == null ? void 0 : s.with(kt);
794
794
  return (h) => {
795
- var v;
795
+ var C;
796
796
  const f = e.getUnit(r), u = f == null ? void 0 : f.getActiveSheet(), a = [];
797
797
  if (!f || !u) {
798
798
  n.setSelections(a);
799
799
  return;
800
800
  }
801
- const m = u.getSheetId(), S = (d) => {
802
- var C;
803
- return (C = f == null ? void 0 : f.getSheetBySheetName(d)) == null ? void 0 : C.getSheetId();
801
+ const d = u.getSheetId(), S = (v) => {
802
+ var g;
803
+ return (g = f == null ? void 0 : f.getSheetBySheetName(v)) == null ? void 0 : g.getSheetId();
804
804
  };
805
- if (!((v = c == null ? void 0 : c.getWorksheetSkeleton(m)) == null ? void 0 : v.skeleton)) return;
806
- for (let d = 0, C = h.length; d < C; d++) {
807
- const R = h[d], { themeColor: E, token: N, refIndex: I } = R, x = he(N), { unitId: b, sheetName: M, range: y } = x;
805
+ if (!((C = c == null ? void 0 : c.getWorksheetSkeleton(d)) == null ? void 0 : C.skeleton)) return;
806
+ for (let v = 0, g = h.length; v < g; v++) {
807
+ const I = h[v], { themeColor: R, token: N, refIndex: E } = I, y = ae(N), { unitId: b, sheetName: O, range: x } = y;
808
808
  if (b && r !== b)
809
809
  continue;
810
- const P = S(M);
811
- if (P && P !== m)
810
+ const P = S(O);
811
+ if (P && P !== d)
812
812
  continue;
813
- const F = Sr(y, u.getRowCount(), u.getColumnCount());
813
+ const F = Sr(x, u.getRowCount(), u.getColumnCount());
814
814
  a.push({
815
815
  range: F,
816
816
  primary: null,
817
- style: bt(t, E, I.toString())
817
+ style: bt(t, R, E.toString())
818
818
  });
819
819
  }
820
820
  ((i == null ? void 0 : i.getSelectionControls()) || []).length === a.length ? i == null || i.resetSelectionsByModelData(a) : n.setSelections(a);
821
821
  };
822
822
  }
823
823
  function Ur(r = "") {
824
- const e = A(ct), t = jr(), n = z(() => r.length, [r]);
824
+ const e = A(ct), t = jr(), n = K(() => r.length, [r]);
825
825
  return (s, i, c = !0) => {
826
826
  const l = s.getDocumentData();
827
827
  if (!l)
@@ -835,28 +835,28 @@ function Ur(r = "") {
835
835
  return s.setDocumentData(u), [];
836
836
  } else {
837
837
  const { textRuns: u, refSelections: a } = Hr(e, t, i);
838
- n && u.forEach((g) => {
839
- g.ed = g.ed + n, g.st = g.st + n;
838
+ n && u.forEach((m) => {
839
+ m.ed = m.ed + n, m.st = m.st + n;
840
840
  }), f.textRuns = u;
841
- const m = i.reduce((g, v) => typeof v == "string" ? `${g}${v}` : `${g}${v.token}`, "");
842
- f.dataStream = `${r}${m}\r
841
+ const d = i.reduce((m, C) => typeof C == "string" ? `${m}${C}` : `${m}${C.token}`, "");
842
+ f.dataStream = `${r}${d}\r
843
843
  `;
844
844
  let S;
845
845
  if (c) {
846
846
  S = s.getSelectionRanges();
847
- const g = f.dataStream.length - 2 + n;
848
- S.forEach((v) => {
849
- v.startOffset = Math.max(0, Math.min(v.startOffset, g)), v.endOffset = Math.max(0, Math.min(v.endOffset, g));
847
+ const m = f.dataStream.length - 2 + n;
848
+ S.forEach((C) => {
849
+ C.startOffset = Math.max(0, Math.min(C.startOffset, m)), C.endOffset = Math.max(0, Math.min(C.endOffset, m));
850
850
  });
851
851
  }
852
- const _ = { ...l, body: f };
853
- return s.setDocumentData(_, S), a;
852
+ const p = { ...l, body: f };
853
+ return s.setDocumentData(p, S), a;
854
854
  }
855
855
  };
856
856
  }
857
857
  function jr() {
858
858
  const e = A(_t).getCurrentTheme();
859
- return z(() => {
859
+ return K(() => {
860
860
  const n = [
861
861
  e.loopColor1,
862
862
  e.loopColor2,
@@ -880,36 +880,36 @@ function Hr(r, e, t) {
880
880
  for (let f = 0, u = t.length; f < u; f++) {
881
881
  const a = t[f];
882
882
  if (typeof a == "string") {
883
- const d = i[i.length - 1], C = d ? d.ed : 0, R = C + a.length;
883
+ const v = i[i.length - 1], g = v ? v.ed : 0, I = g + a.length;
884
884
  i.push({
885
- st: C,
886
- ed: R
885
+ st: g,
886
+ ed: I
887
887
  });
888
888
  continue;
889
889
  }
890
890
  if (r.hasDefinedNameDescription(a.token.trim()))
891
891
  continue;
892
- const { startIndex: m, endIndex: S, nodeType: _, token: g } = a;
893
- let v = "";
894
- if (_ === Y.REFERENCE) {
895
- if (l.has(g))
896
- v = l.get(g);
892
+ const { startIndex: d, endIndex: S, nodeType: p, token: m } = a;
893
+ let C = "";
894
+ if (p === z.REFERENCE) {
895
+ if (l.has(m))
896
+ C = l.get(m);
897
897
  else {
898
- const d = h % n.length;
899
- v = n[d], l.set(g, v), h++;
898
+ const v = h % n.length;
899
+ C = n[v], l.set(m, C), h++;
900
900
  }
901
901
  c.push({
902
902
  refIndex: f,
903
- themeColor: v,
904
- token: g
903
+ themeColor: C,
904
+ token: m
905
905
  });
906
- } else _ === Y.NUMBER ? v = o : (_ === Y.STRING || _ === Y.ARRAY) && (v = s);
907
- v && v.length > 0 && i.push({
908
- st: m,
906
+ } else p === z.NUMBER ? C = o : (p === z.STRING || p === z.ARRAY) && (C = s);
907
+ C && C.length > 0 && i.push({
908
+ st: d,
909
909
  ed: S + 1,
910
910
  ts: {
911
911
  cl: {
912
- rgb: v
912
+ rgb: C
913
913
  }
914
914
  }
915
915
  });
@@ -917,7 +917,7 @@ function Hr(r, e, t) {
917
917
  return { textRuns: i, refSelections: c };
918
918
  }
919
919
  const Wr = (r, e) => {
920
- const t = A(Ee), n = A(Vt);
920
+ const t = A(Ne), n = A(Bt);
921
921
  D(() => {
922
922
  if (!e || !r)
923
923
  return;
@@ -933,8 +933,8 @@ const Wr = (r, e) => {
933
933
  break;
934
934
  }
935
935
  case L.ARROW_RIGHT: {
936
- const a = (((f = e.getDocumentData().body) == null ? void 0 : f.dataStream) || ",,").length - 2, m = Math.min(u.endOffset + 1, a);
937
- e.setSelectionRanges([{ startOffset: m, endOffset: m }]);
936
+ const a = (((f = e.getDocumentData().body) == null ? void 0 : f.dataStream) || ",,").length - 2, d = Math.min(u.endOffset + 1, a);
937
+ e.setSelectionRanges([{ startOffset: d, endOffset: d }]);
938
938
  break;
939
939
  }
940
940
  }
@@ -953,7 +953,7 @@ const Wr = (r, e) => {
953
953
  preconditions: () => !0,
954
954
  priority: 900,
955
955
  staticParameters: {
956
- eventType: pe.Keyboard,
956
+ eventType: _e.Keyboard,
957
957
  keyCode: l
958
958
  }
959
959
  })).forEach((l) => {
@@ -962,13 +962,13 @@ const Wr = (r, e) => {
962
962
  i.dispose();
963
963
  };
964
964
  }, [e, r]);
965
- }, Vr = (r, e) => {
966
- const n = A(fe).getRenderById(r), o = n == null ? void 0 : n.with(le);
965
+ }, Br = (r, e) => {
966
+ const n = A(de).getRenderById(r), o = n == null ? void 0 : n.with(ue);
967
967
  D(() => {
968
968
  o && (e ? o == null || o.setRemainLastEnabled(!1) : o == null || o.setRemainLastEnabled(!0));
969
969
  }, [e, o]);
970
- }, Nn = (r, e) => {
971
- const t = A(fe), n = A(Lt), o = A(Ir), s = A(Ht), i = t.getRenderById(e), c = i == null ? void 0 : i.with(le);
970
+ }, yn = (r, e) => {
971
+ const t = A(de), n = A(Lt), o = A(Ir), s = A(Ht), i = t.getRenderById(e), c = i == null ? void 0 : i.with(ue);
972
972
  ot(() => {
973
973
  if (r) {
974
974
  const l = c == null ? void 0 : c.enableSelectionChanging();
@@ -989,12 +989,12 @@ const Wr = (r, e) => {
989
989
  }, [r]), D(() => {
990
990
  r && (c == null || c.setSkipLastEnabled(!1));
991
991
  }, [r]);
992
- }, Br = () => {
992
+ }, Vr = () => {
993
993
  D(() => () => {
994
994
  }, []);
995
995
  }, qr = (r) => {
996
- const e = A(be), t = A(pn);
997
- return z(() => {
996
+ const e = A(ye), t = A(_n);
997
+ return K(() => {
998
998
  if (r) {
999
999
  const o = e.getCurrentUnitForType(X.UNIVER_SHEET), s = o == null ? void 0 : o.getActiveSheet(), i = [...t.getCurrentSelections()];
1000
1000
  return () => {
@@ -1008,23 +1008,23 @@ const Wr = (r, e) => {
1008
1008
  }, Kr = (r) => {
1009
1009
  const e = () => {
1010
1010
  if (r) {
1011
- const { scene: n, mainComponent: o } = r.render, s = r.render.with(cn), { width: i, height: c } = r.getBoundingClientRect();
1011
+ const { scene: n, mainComponent: o } = r.render, s = r.render.with(ln), { width: i, height: c } = r.getBoundingClientRect();
1012
1012
  s.getViewModel().getDataModel().updateDocumentDataPageSize(1 / 0), n.transformByState({
1013
1013
  width: i,
1014
1014
  height: c
1015
1015
  }), o == null || o.resize(i, c);
1016
1016
  }
1017
- }, t = z(() => io(() => {
1017
+ }, t = K(() => io(() => {
1018
1018
  var S;
1019
1019
  if (!r)
1020
1020
  return;
1021
- const o = r.render.with(cn).getSkeleton(), { scene: s, mainComponent: i } = r.render, c = s.getViewport(is.VIEW_MAIN), { actualWidth: l } = o.getActualSize(), { width: h, height: f } = r.getBoundingClientRect();
1021
+ const o = r.render.with(ln).getSkeleton(), { scene: s, mainComponent: i } = r.render, c = s.getViewport(is.VIEW_MAIN), { actualWidth: l } = o.getActualSize(), { width: h, height: f } = r.getBoundingClientRect();
1022
1022
  let u = c == null ? void 0 : c.getScrollBar();
1023
- const a = Math.max(l, h), m = f;
1023
+ const a = Math.max(l, h), d = f;
1024
1024
  s.transformByState({
1025
1025
  width: a,
1026
- height: m
1027
- }), i == null || i.resize(a, m), l > h ? u == null ? c && new As(c, { barSize: 8, enableVertical: !1 }) : c == null || c.resetCanvasSizeAndUpdateScroll() : (u = null, c == null || c.scrollToBarPos({ x: 0, y: 0 }), (S = c == null ? void 0 : c.getScrollBar()) == null || S.dispose());
1026
+ height: d
1027
+ }), i == null || i.resize(a, d), l > h ? u == null ? c && new As(c, { barSize: 8, enableVertical: !1 }) : c == null || c.resetCanvasSizeAndUpdateScroll() : (u = null, c == null || c.scrollToBarPos({ x: 0, y: 0 }), (S = c == null ? void 0 : c.getScrollBar()) == null || S.dispose());
1028
1028
  }, 30), [r]);
1029
1029
  return D(() => {
1030
1030
  if (r) {
@@ -1045,10 +1045,10 @@ const Wr = (r, e) => {
1045
1045
  };
1046
1046
  }
1047
1047
  }, [r]), { resize: e, checkScrollBar: t };
1048
- }, hn = (r) => typeof r == "string" ? r === G.COMMA : !1, hi = (r) => {
1048
+ }, fn = (r) => typeof r == "string" ? r === G.COMMA : !1, hi = (r) => {
1049
1049
  if (typeof r == "object")
1050
- return r.nodeType === Y.REFERENCE;
1051
- }, fi = (r) => r.filter((e) => hn(e) || hi(e)), yn = (r) => {
1050
+ return r.nodeType === z.REFERENCE;
1051
+ }, fi = (r) => r.filter((e) => fn(e) || hi(e)), zt = (r) => {
1052
1052
  if (r.endColumn < r.startColumn) {
1053
1053
  const e = r.endColumn;
1054
1054
  r.endColumn = r.startColumn, r.startColumn = e;
@@ -1063,116 +1063,116 @@ function Qn(r, e, t) {
1063
1063
  var n, o;
1064
1064
  return ((o = (n = r.getUnit(e)) == null ? void 0 : n.getSheetBySheetId(t)) == null ? void 0 : o.getName()) || "";
1065
1065
  }
1066
- const Re = (r, e = !1) => e ? r.map((t) => t.sheetName !== "" ? Nt(t.sheetName, t.range) : Ie(t.range)) : r.map((t) => Ie(t.range)), zr = (r, e, t, n, o, s, i) => {
1067
- const c = A(fe), l = A(be), h = Z(!1), f = c.getRenderById(e), u = f == null ? void 0 : f.with(le), a = Z([]), m = z(() => {
1068
- const _ = fi(n), g = a.current;
1069
- return _.length === g.length ? (g.splice(0), g.push(..._), g) : _;
1066
+ const Ce = (r, e = !1) => e ? r.map((t) => t.sheetName !== "" ? Nt(t.sheetName, t.range) : Ee(t.range)) : r.map((t) => Ee(t.range)), zr = (r, e, t, n, o, s, i) => {
1067
+ const c = A(de), l = A(ye), h = Z(!1), f = c.getRenderById(e), u = f == null ? void 0 : f.with(ue), a = Z([]), d = K(() => {
1068
+ const p = fi(n), m = a.current;
1069
+ return p.length === m.length ? (m.splice(0), m.push(...p), m) : p;
1070
1070
  }, [n]);
1071
- a.current = m;
1071
+ a.current = d;
1072
1072
  const S = Z();
1073
1073
  D(() => {
1074
1074
  if (r && u) {
1075
- let _ = !0;
1076
- const g = (C, R) => {
1075
+ let p = !0;
1076
+ const m = (g, I) => {
1077
1077
  var F;
1078
- if (_ || h.current) {
1079
- _ = !1;
1078
+ if (p || h.current) {
1079
+ p = !1;
1080
1080
  return;
1081
1081
  }
1082
- const E = [...C], N = l.getUnit(e), I = ((F = N == null ? void 0 : N.getActiveSheet()) == null ? void 0 : F.getName()) || "", x = m.map((T, H) => {
1082
+ const R = [...g], N = l.getUnit(e), E = ((F = N == null ? void 0 : N.getActiveSheet()) == null ? void 0 : F.getName()) || "", y = d.map((T, B) => {
1083
1083
  if (typeof T == "string") {
1084
- if (!m[H - 1])
1084
+ if (!d[B - 1])
1085
1085
  return null;
1086
- const w = m[H + 1];
1087
- return hn(T) && (hn(w) || H === m.length - 1) ? null : T;
1088
- } else if (T.nodeType === Y.REFERENCE) {
1089
- const O = he(T.token);
1090
- O.unitId = O.unitId === "" ? e : O.unitId, O.sheetName = O.sheetName === "" ? I : O.sheetName;
1091
- const { unitId: w, sheetName: U } = O;
1092
- if (s && (w !== e || I !== U))
1086
+ const w = d[B + 1];
1087
+ return fn(T) && (fn(w) || B === d.length - 1) ? null : T;
1088
+ } else if (T.nodeType === z.REFERENCE) {
1089
+ const M = ae(T.token);
1090
+ M.unitId = M.unitId === "" ? e : M.unitId, M.sheetName = M.sheetName === "" ? E : M.sheetName;
1091
+ const { unitId: w, sheetName: k } = M;
1092
+ if (s && (w !== e || E !== k))
1093
1093
  return null;
1094
- if (w === e && I === U) {
1095
- const k = E.shift();
1096
- if (k && Qn(l, e, k.rangeWithCoord.sheetId || "") === U) {
1094
+ if (w === e && E === k) {
1095
+ const H = R.shift();
1096
+ if (H && Qn(l, e, H.rangeWithCoord.sheetId || "") === k) {
1097
1097
  const Q = { ...T };
1098
- return yn(k.rangeWithCoord), o ? Q.token = Nt(I, k.rangeWithCoord) : Q.token = Ie(k.rangeWithCoord), Q;
1098
+ return zt(H.rangeWithCoord), o ? Q.token = Nt(E, H.rangeWithCoord) : Q.token = Ee(H.rangeWithCoord), Q;
1099
1099
  }
1100
1100
  }
1101
1101
  return T;
1102
1102
  }
1103
1103
  return null;
1104
- }).filter((T) => !!T), b = Re(
1105
- E.map((T) => {
1106
- var H, O, w;
1104
+ }).filter((T) => !!T), b = Ce(
1105
+ R.map((T) => {
1106
+ var B, M, w;
1107
1107
  return {
1108
1108
  range: T.rangeWithCoord,
1109
- unitId: (H = T.rangeWithCoord.unitId) != null ? H : "",
1110
- sheetName: Qn(l, (O = T.rangeWithCoord.unitId) != null ? O : "", (w = T.rangeWithCoord.sheetId) != null ? w : "")
1109
+ unitId: (B = T.rangeWithCoord.unitId) != null ? B : "",
1110
+ sheetName: Qn(l, (M = T.rangeWithCoord.unitId) != null ? M : "", (w = T.rangeWithCoord.sheetId) != null ? w : "")
1111
1111
  };
1112
1112
  }),
1113
1113
  o
1114
- ).join(G.COMMA), M = Fe(x), y = `${M}${M && b ? G.COMMA : ""}${b}`, P = h.current;
1115
- i(y, P ? -1 : y.length, R);
1116
- }, v = u.selectionMoveEnd$.subscribe((C) => {
1117
- if (g(C, !0), h.current = !1, S.current) {
1118
- const { result: R, offset: E } = S.current;
1119
- i(R, E, !0), S.current = void 0;
1114
+ ).join(G.COMMA), O = be(y), x = `${O}${O && b ? G.COMMA : ""}${b}`, P = h.current;
1115
+ i(x, P ? -1 : x.length, I);
1116
+ }, C = u.selectionMoveEnd$.subscribe((g) => {
1117
+ if (m(g, !0), h.current = !1, S.current) {
1118
+ const { result: I, offset: R } = S.current;
1119
+ i(I, R, !0), S.current = void 0;
1120
1120
  }
1121
- }), d = u.selectionMoving$.pipe(ws(50)).subscribe((C) => {
1122
- g(C, !1);
1121
+ }), v = u.selectionMoving$.pipe(ws(50)).subscribe((g) => {
1122
+ m(g, !1);
1123
1123
  });
1124
1124
  return () => {
1125
- v.unsubscribe(), d.unsubscribe();
1125
+ C.unsubscribe(), v.unsubscribe();
1126
1126
  };
1127
1127
  }
1128
- }, [r, m, u, o, s, i]), D(() => {
1128
+ }, [r, d, u, o, s, i]), D(() => {
1129
1129
  if (r && u) {
1130
- const _ = new ze(), g = (C, R) => {
1130
+ const p = new ze(), m = (g, I) => {
1131
1131
  var P;
1132
- let E = 0, N = 0, I = !1;
1133
- const x = l.getUnit(e), b = ((P = x == null ? void 0 : x.getActiveSheet()) == null ? void 0 : P.getName()) || "", M = m.map((F) => {
1132
+ let R = 0, N = 0, E = !1;
1133
+ const y = l.getUnit(e), b = ((P = y == null ? void 0 : y.getActiveSheet()) == null ? void 0 : P.getName()) || "", O = d.map((F) => {
1134
1134
  if (typeof F == "string")
1135
- return I || (N += F.length), F;
1136
- if (F.nodeType === Y.REFERENCE) {
1137
- const T = he(C);
1138
- if (T.unitId = T.unitId === "" ? e : T.unitId, T.sheetName = T.sheetName === "" ? b : T.sheetName, E === R) {
1139
- I = !0;
1140
- const H = { ...F, token: C };
1141
- return o ? H.token = Nt(T.sheetName, T.range) : H.token = Ie(T.range), E++, N += H.token.length, H;
1135
+ return E || (N += F.length), F;
1136
+ if (F.nodeType === z.REFERENCE) {
1137
+ const T = ae(g);
1138
+ if (T.unitId = T.unitId === "" ? e : T.unitId, T.sheetName = T.sheetName === "" ? b : T.sheetName, R === I) {
1139
+ E = !0;
1140
+ const B = { ...F, token: g };
1141
+ return o ? B.token = Nt(T.sheetName, T.range) : B.token = Ee(T.range), R++, N += B.token.length, B;
1142
1142
  }
1143
- return E++, I || (N += F.token.length), F;
1143
+ return R++, E || (N += F.token.length), F;
1144
1144
  }
1145
1145
  return F;
1146
- }), y = Fe(M);
1147
- S.current = { result: y, offset: N }, i(y, -1, !1);
1146
+ }), x = be(O);
1147
+ S.current = { result: x, offset: N }, i(x, -1, !1);
1148
1148
  };
1149
- let v = 0;
1150
- const d = u.selectionMoveEnd$.subscribe(() => {
1151
- v = setTimeout(() => {
1152
- _.dispose(), u.getSelectionControls().forEach((R, E) => {
1153
- _.add(et(R.selectionMoving$, R.selectionScaling$).pipe(
1154
- mn((N) => Ie(N)),
1155
- gn()
1149
+ let C = 0;
1150
+ const v = u.selectionMoveEnd$.subscribe(() => {
1151
+ C = setTimeout(() => {
1152
+ p.dispose(), u.getSelectionControls().forEach((I, R) => {
1153
+ p.add(et(I.selectionMoving$, I.selectionScaling$).pipe(
1154
+ gn((N) => Ee(N)),
1155
+ Sn()
1156
1156
  ).subscribe((N) => {
1157
- h.current = !0, g(N, E);
1157
+ h.current = !0, m(N, R);
1158
1158
  }));
1159
1159
  });
1160
1160
  }, 30);
1161
1161
  });
1162
1162
  return () => {
1163
- d.unsubscribe(), _.dispose(), clearTimeout(v);
1163
+ v.unsubscribe(), p.dispose(), clearTimeout(C);
1164
1164
  };
1165
1165
  }
1166
- }, [r, u, m, i]);
1166
+ }, [r, u, d, i]);
1167
1167
  }, xn = (r, e, t, n, o, s) => {
1168
- const i = A(Ee), c = A(ve), h = A(fe).getRenderById(e), f = h == null ? void 0 : h.with(le);
1168
+ const i = A(Ne), c = A(Re), h = A(de).getRenderById(e), f = h == null ? void 0 : h.with(ue);
1169
1169
  D(() => {
1170
1170
  if (r && f)
1171
1171
  if (t) {
1172
1172
  const u = i.onCommandExecuted((a) => {
1173
- if (a.id === Bn.id) {
1174
- const m = f.getSelectionControls().length;
1175
- for (let S = 1; S <= m; S++)
1173
+ if (a.id === Vn.id) {
1174
+ const d = f.getSelectionControls().length;
1175
+ for (let S = 1; S <= d; S++)
1176
1176
  f.clearLastSelection();
1177
1177
  setTimeout(() => {
1178
1178
  s();
@@ -1184,10 +1184,10 @@ const Re = (r, e = !1) => e ? r.map((t) => t.sheetName !== "" ? Nt(t.sheetName,
1184
1184
  };
1185
1185
  } else {
1186
1186
  const u = i.beforeCommandExecuted((a) => {
1187
- if (a.id === Bn.id) {
1187
+ if (a.id === Vn.id) {
1188
1188
  n(!1), o(), s();
1189
- const m = c.getEditor($t);
1190
- m == null || m.focus();
1189
+ const d = c.getEditor($t);
1190
+ d == null || d.focus();
1191
1191
  }
1192
1192
  });
1193
1193
  return () => {
@@ -1199,7 +1199,7 @@ const Re = (r, e = !1) => e ? r.map((t) => t.sheetName !== "" ? Nt(t.sheetName,
1199
1199
  if (typeof t == "string") {
1200
1200
  if (t !== G.COMMA)
1201
1201
  return !0;
1202
- } else if (t.nodeType !== Y.REFERENCE)
1202
+ } else if (t.nodeType !== z.REFERENCE)
1203
1203
  return !0;
1204
1204
  return !1;
1205
1205
  }), di = (r, e, t) => {
@@ -1216,10 +1216,10 @@ const Re = (r, e = !1) => e ? r.map((t) => t.sheetName !== "" ? Nt(t.sheetName,
1216
1216
  }, [r]), D(() => {
1217
1217
  if (!n.current && e) {
1218
1218
  const o = Yr(t);
1219
- e(o, Fe(t));
1219
+ e(o, be(t));
1220
1220
  }
1221
1221
  }, [t, e]);
1222
- }, mi = "univer-sheet-range-selector-text-wrap", gi = "univer-sheet-range-selector-placeholder", Si = "univer-sheet-range-selector-error", pi = "univer-sheet-range-selector-error-wrap", _i = "univer-sheet-range-selector-text", vi = "univer-sheet-range-selector-active", Ci = "univer-sheet-range-selector-icon", Ri = "univer-sheet-range-selector-dialog-item", Ii = "univer-sheet-range-selector-dialog-item-delete", _e = {
1222
+ }, mi = "univer-sheet-range-selector-text-wrap", gi = "univer-sheet-range-selector-placeholder", Si = "univer-sheet-range-selector-error", pi = "univer-sheet-range-selector-error-wrap", _i = "univer-sheet-range-selector-text", vi = "univer-sheet-range-selector-active", Ci = "univer-sheet-range-selector-icon", Ri = "univer-sheet-range-selector-dialog-item", Ii = "univer-sheet-range-selector-dialog-item-delete", ve = {
1223
1223
  sheetRangeSelectorTextWrap: mi,
1224
1224
  sheetRangeSelectorPlaceholder: gi,
1225
1225
  sheetRangeSelectorError: Si,
@@ -1245,233 +1245,234 @@ function Ei(r) {
1245
1245
  onBlur: f = ft,
1246
1246
  onFocus: u = ft,
1247
1247
  isFocus: a = !0,
1248
- isOnlyOneRange: m = !1,
1248
+ isOnlyOneRange: d = !1,
1249
1249
  isSupportAcrossSheet: S = !1
1250
- } = r, _ = A(ve), g = A(Ye), v = A(Ee), d = A(je), C = Z(null), [R, E] = $(!1), [N, I] = $(a), x = z(() => ur(`${xo}-${hr(4)}`), []), [b, M] = $(), y = Z(null), P = z(() => !R && N, [R, N]), [F, T] = $(() => typeof e == "string" ? e : Re(e, S).join(G.COMMA));
1251
- i && (i.handleOutClick = (W, q) => {
1252
- C.current && !R && !C.current.contains(W.target) && q();
1250
+ } = r, p = A(Re), m = A(Ye), C = A(Ne), v = A(Oe), g = Z(null), [I, R] = $(!1), [N, E] = $(a), y = K(() => ur(`${xo}-${hr(4)}`), []), [b, O] = $(), x = Z(null), P = K(() => !I && N, [I, N]), [F, T] = $(() => typeof e == "string" ? e : Ce(e, S).join(G.COMMA));
1251
+ i && (i.handleOutClick = (U, j) => {
1252
+ g.current && !I && !g.current.contains(U.target) && j();
1253
1253
  });
1254
- const H = z(() => F.split(G.COMMA).filter((W) => !!W).map((W) => he(W)), [F]), O = z(() => o !== void 0, [o]), w = qr(!R && N), U = z(() => (W) => {
1255
- const q = d.sequenceNodesBuilder(W);
1256
- if (q) {
1257
- if (Yr(q)) {
1258
- const Ne = q.map((Ze) => {
1254
+ const B = K(() => F.split(G.COMMA).filter((U) => !!U).map((U) => ae(U)), [F]), M = K(() => o !== void 0, [o]), w = qr(!I && N), k = K(() => (U) => {
1255
+ const j = v.sequenceNodesBuilder(U);
1256
+ if (j) {
1257
+ if (Yr(j)) {
1258
+ const ce = j.map((Ze) => {
1259
1259
  if (typeof Ze == "string")
1260
1260
  return Ze;
1261
- if (Ze.nodeType === Y.REFERENCE) {
1262
- const Mn = { ...Ze }, at = he(Ze.token);
1263
- return at.range = yn(at.range), S || (at.sheetName = "", at.unitId = ""), Mn.token = Re([at], S)[0], Mn;
1261
+ if (Ze.nodeType === z.REFERENCE) {
1262
+ const Mn = { ...Ze }, at = ae(Ze.token);
1263
+ return at.range = zt(at.range), S || (at.sheetName = "", at.unitId = ""), Mn.token = Ce([at], S)[0], Mn;
1264
1264
  }
1265
1265
  return Ze;
1266
- }), we = Fe(Ne);
1267
- c(we);
1266
+ }), Le = be(ce);
1267
+ c(Le);
1268
1268
  }
1269
1269
  } else
1270
1270
  T("");
1271
- }, [S]), k = kr(b);
1271
+ }, [S]), H = kr(b);
1272
1272
  ot(() => {
1273
1273
  if (a) {
1274
- const W = setTimeout(() => {
1275
- I(a), a && k();
1274
+ const U = setTimeout(() => {
1275
+ E(a), a && H();
1276
1276
  }, 30);
1277
1277
  return () => {
1278
- clearTimeout(W);
1278
+ clearTimeout(U);
1279
1279
  };
1280
1280
  } else
1281
- w(), I(a), b == null || b.blur();
1282
- }, [a, k]);
1283
- const { checkScrollBar: Q } = Kr(b), de = Kt(), me = z(() => de(F), [F]), Ce = Ur(), J = bn(t), oe = (W, q = !0) => {
1281
+ w(), E(a), b == null || b.blur();
1282
+ }, [a, H]);
1283
+ const { checkScrollBar: Q } = Kr(b), me = Kt(), ge = K(() => me(F), [F]), Ie = Ur(), J = Nn(t), se = (U, j = !0) => {
1284
1284
  if (!b)
1285
1285
  return;
1286
- const Pe = de(W), Ne = Ce(b, Pe, q);
1287
- J(Ne);
1288
- }, ae = Dr(me, U, b), Ae = z(() => (W, q, Pe) => {
1289
- oe(W), T(W), ae(), Pe && (k(), q !== -1 && setTimeout(() => {
1290
- const Ne = { startOffset: q, endOffset: q };
1291
- b == null || b.setSelectionRanges([Ne]);
1292
- const we = b == null ? void 0 : b.render.with(gr);
1293
- we == null || we.scrollToRange({ ...Ne, collapsed: !0 });
1286
+ const ie = me(U), ce = Ie(b, ie, j);
1287
+ J(ce);
1288
+ }, he = Dr(ge, k, b), Pe = K(() => (U, j, ie) => {
1289
+ se(U), T(U), he(), ie && (H(), j !== -1 && setTimeout(() => {
1290
+ const ce = { startOffset: j, endOffset: j };
1291
+ b == null || b.setSelectionRanges([ce]);
1292
+ const Le = b == null ? void 0 : b.render.with(gr);
1293
+ Le == null || Le.scrollToRange({ ...ce, collapsed: !0 });
1294
1294
  }, 50), Q());
1295
1295
  }, [b]);
1296
- zr(P, t, n, me, S, m, Ae), Nn(P, t), Vr(t, m), ui(t, F, b), di(P, l, me), Wr(P, b), Br(), xn(P, t, S, I, f, () => {
1297
- P && oe(F);
1296
+ zr(P, t, n, ge, S, d, Pe), yn(P, t), Br(t, d), ui(t, F, b), di(P, l, ge), Wr(P, b), Vr(), xn(P, t, S, E, f, () => {
1297
+ P && se(F);
1298
1298
  }), D(() => {
1299
1299
  if (b) {
1300
- const W = b.input$.pipe(Sn(100)).subscribe((q) => {
1301
- var Ne, we;
1302
- const Pe = ((we = (Ne = q.data.body) == null ? void 0 : Ne.dataStream) != null ? we : "").replaceAll(/\n|\r/g, "").replaceAll(/,{2,}/g, ",").replaceAll(/(^,)/g, "");
1303
- oe(Pe, !1), T(Pe), ae();
1300
+ const U = b.input$.pipe(pn(100)).subscribe((j) => {
1301
+ var ce, Le;
1302
+ const ie = ((Le = (ce = j.data.body) == null ? void 0 : ce.dataStream) != null ? Le : "").replaceAll(/\n|\r/g, "").replaceAll(/,{2,}/g, ",").replaceAll(/(^,)/g, "");
1303
+ se(ie, !1), T(ie), he();
1304
1304
  });
1305
1305
  return () => {
1306
- W.unsubscribe();
1306
+ U.unsubscribe();
1307
1307
  };
1308
1308
  }
1309
1309
  }, [b]), D(() => {
1310
- const W = v.onCommandExecuted((q) => {
1311
- q.id === To.id && (E(!1), h(!1), I(!1), f());
1310
+ const U = C.onCommandExecuted((j) => {
1311
+ j.id === To.id && (R(!1), h(!1), E(!1), f());
1312
1312
  });
1313
1313
  return () => {
1314
- W.dispose();
1314
+ U.dispose();
1315
1315
  };
1316
1316
  }, [S]), ot(() => {
1317
- let W;
1318
- if (y.current) {
1319
- W = _.register({
1317
+ let U;
1318
+ if (x.current) {
1319
+ U = p.register({
1320
1320
  autofocus: !0,
1321
- editorUnitId: x,
1321
+ editorUnitId: y,
1322
1322
  isSingle: !0,
1323
1323
  initialSnapshot: {
1324
- id: x,
1324
+ id: y,
1325
1325
  body: { dataStream: `\r
1326
1326
  ` },
1327
1327
  documentStyle: {}
1328
1328
  }
1329
- }, y.current);
1330
- const q = _.getEditor(x);
1331
- M(q);
1329
+ }, x.current);
1330
+ const j = p.getEditor(y);
1331
+ O(j);
1332
1332
  }
1333
1333
  return () => {
1334
- W == null || W.dispose();
1334
+ U == null || U.dispose();
1335
1335
  };
1336
- }, []), $r(F, "", N, Ce, J, b);
1337
- const B = () => {
1336
+ }, []), $r(F, "", N, Ie, J, b);
1337
+ const we = () => {
1338
1338
  setTimeout(() => {
1339
- u(), k(), I(!0);
1339
+ u(), H(), E(!0);
1340
1340
  }, 30);
1341
- }, K = (W) => {
1342
- const q = Re(W, S).join(G.COMMA);
1343
- oe(q), ae(), T(q), E(!1), h(!1), setTimeout(() => {
1344
- I(!0), b == null || b.setSelectionRanges([{ startOffset: q.length, endOffset: q.length }]), k();
1341
+ }, V = (U) => {
1342
+ const j = Ce(U, S).join(G.COMMA);
1343
+ j || b == null || b.setDocumentData({ ...b.getDocumentData(), body: { dataStream: `\r
1344
+ `, textRuns: [] } }), se(j), he(), T(j), R(!1), h(!1), setTimeout(() => {
1345
+ E(!0), b == null || b.setSelectionRanges([{ startOffset: j.length, endOffset: j.length }]), H();
1345
1346
  }, 30);
1346
- }, se = () => {
1347
- E(!1), h(!1), setTimeout(() => {
1348
- I(!0), k();
1347
+ }, Y = () => {
1348
+ R(!1), h(!1), setTimeout(() => {
1349
+ E(!0), H();
1349
1350
  }, 30);
1350
- }, ce = () => {
1351
- O || (k(), setTimeout(() => {
1352
- E(!0), h(!0), I(!1);
1351
+ }, ee = () => {
1352
+ M || (H(), setTimeout(() => {
1353
+ R(!0), h(!0), E(!1);
1353
1354
  }, 30));
1354
1355
  };
1355
- return /* @__PURE__ */ p.jsxs("div", { className: _e.sheetRangeSelector, ref: C, children: [
1356
- /* @__PURE__ */ p.jsxs(
1356
+ return /* @__PURE__ */ _.jsxs("div", { className: ve.sheetRangeSelector, ref: g, children: [
1357
+ /* @__PURE__ */ _.jsxs(
1357
1358
  "div",
1358
1359
  {
1359
- className: Lr(_e.sheetRangeSelectorTextWrap, {
1360
- [_e.sheetRangeSelectorActive]: N && !O,
1361
- [_e.sheetRangeSelectorError]: O
1360
+ className: Lr(ve.sheetRangeSelectorTextWrap, {
1361
+ [ve.sheetRangeSelectorActive]: N && !M,
1362
+ [ve.sheetRangeSelectorError]: M
1362
1363
  }),
1363
1364
  children: [
1364
- /* @__PURE__ */ p.jsx("div", { className: _e.sheetRangeSelectorText, ref: y, onMouseUp: B }),
1365
- /* @__PURE__ */ p.jsx(Fs, { title: g.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ p.jsx(Pr, { className: _e.sheetRangeSelectorIcon, onClick: ce }) }),
1366
- o !== void 0 ? /* @__PURE__ */ p.jsx("div", { className: _e.sheetRangeSelectorErrorWrap, children: o }) : null,
1367
- s !== void 0 && !F ? /* @__PURE__ */ p.jsx("div", { className: _e.sheetRangeSelectorPlaceholder, children: s }) : null
1365
+ /* @__PURE__ */ _.jsx("div", { className: ve.sheetRangeSelectorText, ref: x, onMouseUp: we }),
1366
+ /* @__PURE__ */ _.jsx(Fs, { title: m.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ _.jsx(Pr, { className: ve.sheetRangeSelectorIcon, onClick: ee }) }),
1367
+ o !== void 0 ? /* @__PURE__ */ _.jsx("div", { className: ve.sheetRangeSelectorErrorWrap, children: o }) : null,
1368
+ s !== void 0 && !F ? /* @__PURE__ */ _.jsx("div", { className: ve.sheetRangeSelectorPlaceholder, children: s }) : null
1368
1369
  ]
1369
1370
  }
1370
1371
  ),
1371
- R && /* @__PURE__ */ p.jsx(
1372
+ I && /* @__PURE__ */ _.jsx(
1372
1373
  bi,
1373
1374
  {
1374
- editorId: x,
1375
- handleConfirm: K,
1376
- handleClose: se,
1375
+ editorId: y,
1376
+ handleConfirm: V,
1377
+ handleClose: Y,
1377
1378
  unitId: t,
1378
1379
  subUnitId: n,
1379
- initValue: H,
1380
- visible: R,
1381
- isOnlyOneRange: m,
1380
+ initValue: B,
1381
+ visible: I,
1382
+ isOnlyOneRange: d,
1382
1383
  isSupportAcrossSheet: S
1383
1384
  }
1384
1385
  )
1385
1386
  ] });
1386
1387
  }
1387
1388
  function bi(r) {
1388
- const { editorId: e, handleConfirm: t, handleClose: n, visible: o, initValue: s, unitId: i, subUnitId: c, isOnlyOneRange: l, isSupportAcrossSheet: h } = r, f = A(Ye), u = A(ve), a = A(ct), m = A(je), _ = A(fe).getRenderById(i), g = _ == null ? void 0 : _.with(le), [v, d] = $(() => {
1389
+ const { editorId: e, handleConfirm: t, handleClose: n, visible: o, initValue: s, unitId: i, subUnitId: c, isOnlyOneRange: l, isSupportAcrossSheet: h } = r, f = A(Ye), u = A(Re), a = A(ct), d = A(Oe), p = A(de).getRenderById(i), m = p == null ? void 0 : p.with(ue), [C, v] = $(() => {
1389
1390
  if (l) {
1390
- const O = s[0];
1391
- return O ? Re([O], h) : [""];
1391
+ const M = s[0];
1392
+ return M ? Ce([M], h) : [""];
1392
1393
  }
1393
- return Re(s, h);
1394
- }), [C, R] = $(() => v.length - 1), E = jr(), N = z(() => v.join(G.COMMA), [v]), I = Kt(), x = z(() => I(N), [N]), b = z(() => Hr(a, E, x).refSelections, [x]), M = () => {
1395
- d([]), setTimeout(() => {
1394
+ return Ce(s, h);
1395
+ }), [g, I] = $(() => C.length - 1), R = jr(), N = K(() => C.join(G.COMMA), [C]), E = Kt(), y = K(() => E(N), [N]), b = K(() => Hr(a, R, y).refSelections, [y]), O = () => {
1396
+ v([]), setTimeout(() => {
1396
1397
  n();
1397
1398
  }, 30);
1398
- }, y = (O, w) => {
1399
- w ? g == null || g.setSkipLastEnabled(!1) : g == null || g.setSkipLastEnabled(!0), d((U) => {
1400
- const k = [...U];
1401
- return k[O] = w, k;
1399
+ }, x = (M, w) => {
1400
+ w ? m == null || m.setSkipLastEnabled(!1) : m == null || m.setSkipLastEnabled(!0), v((k) => {
1401
+ const H = [...k];
1402
+ return H[M] = w, H;
1402
1403
  });
1403
- }, P = (O) => {
1404
- g == null || g.setSkipLastEnabled(!1), d((w) => {
1404
+ }, P = (M) => {
1405
+ m == null || m.setSkipLastEnabled(!1), v((w) => {
1405
1406
  if (w.length === 1)
1406
1407
  return w;
1407
- const U = [];
1408
- return w.forEach((k, Q) => {
1409
- O !== Q && U.push(k);
1410
- }), U;
1408
+ const k = [];
1409
+ return w.forEach((H, Q) => {
1410
+ M !== Q && k.push(H);
1411
+ }), k;
1411
1412
  });
1412
1413
  }, F = () => {
1413
- g == null || g.setSkipLastEnabled(!0), d((O) => (O.push(""), R(O.length - 1), [...O]));
1414
- }, T = sn((O) => {
1415
- var U;
1416
- g == null || g.setSkipLastEnabled(!1);
1417
- const w = O.split(G.COMMA).filter((k) => !!k);
1418
- d(l ? [(U = w[0]) != null ? U : ""] : w);
1419
- }, [C, l]), H = bn(i);
1420
- return zr(C >= 0, i, c, x, h, l, T), Nn(C >= 0, i), Vr(i, l), xn(C >= 0, i, h, Wn, Wn, () => H(b)), D(() => {
1421
- H(b);
1414
+ m == null || m.setSkipLastEnabled(!0), v((M) => (M.push(""), I(M.length - 1), [...M]));
1415
+ }, T = cn((M) => {
1416
+ var k;
1417
+ m == null || m.setSkipLastEnabled(!1);
1418
+ const w = M.split(G.COMMA).filter((H) => !!H);
1419
+ v(l ? [(k = w[0]) != null ? k : ""] : w);
1420
+ }, [g, l]), B = Nn(i);
1421
+ return zr(g >= 0, i, c, y, h, l, T), yn(g >= 0, i), Br(i, l), xn(g >= 0, i, h, Wn, Wn, () => B(b)), D(() => {
1422
+ B(b);
1422
1423
  }, [b]), D(() => {
1423
- (v.length === 0 || v.length === 1 && !v[0]) && (g == null || g.setSkipLastEnabled(!0));
1424
- }, [v]), D(() => {
1425
- const O = u.focusStyle$.pipe(
1424
+ (C.length === 0 || C.length === 1 && !C[0]) && (m == null || m.setSkipLastEnabled(!0));
1425
+ }, [C]), D(() => {
1426
+ const M = u.focusStyle$.pipe(
1426
1427
  tt((w) => !!w && $t !== w)
1427
1428
  ).subscribe((w) => {
1428
- w !== e && M();
1429
+ w !== e && O();
1429
1430
  });
1430
1431
  return () => {
1431
- O.unsubscribe();
1432
+ M.unsubscribe();
1432
1433
  };
1433
- }, [u, e]), /* @__PURE__ */ p.jsx(
1434
+ }, [u, e]), /* @__PURE__ */ _.jsx(
1434
1435
  Ms,
1435
1436
  {
1436
1437
  width: "328px",
1437
1438
  visible: o,
1438
1439
  title: f.t("rangeSelector.title"),
1439
1440
  draggable: !0,
1440
- closeIcon: /* @__PURE__ */ p.jsx(qt, {}),
1441
- footer: /* @__PURE__ */ p.jsxs("footer", { children: [
1442
- /* @__PURE__ */ p.jsx(nt, { onClick: M, children: f.t("rangeSelector.cancel") }),
1443
- /* @__PURE__ */ p.jsx(
1441
+ closeIcon: /* @__PURE__ */ _.jsx(qt, {}),
1442
+ footer: /* @__PURE__ */ _.jsxs("footer", { children: [
1443
+ /* @__PURE__ */ _.jsx(nt, { onClick: O, children: f.t("rangeSelector.cancel") }),
1444
+ /* @__PURE__ */ _.jsx(
1444
1445
  nt,
1445
1446
  {
1446
1447
  style: { marginLeft: 10 },
1447
- onClick: () => t(v.filter((O) => {
1448
- const w = m.sequenceNodesBuilder(O);
1449
- return w && w.length === 1 && typeof w[0] != "string" && w[0].nodeType === Y.REFERENCE;
1450
- }).map((O) => he(O)).map((O) => ({ ...O, range: yn(O.range) }))),
1448
+ onClick: () => t(C.filter((M) => {
1449
+ const w = d.sequenceNodesBuilder(M);
1450
+ return w && w.length === 1 && typeof w[0] != "string" && w[0].nodeType === z.REFERENCE;
1451
+ }).map((M) => ae(M)).map((M) => ({ ...M, range: zt(M.range) }))),
1451
1452
  type: "primary",
1452
1453
  children: f.t("rangeSelector.confirm")
1453
1454
  }
1454
1455
  )
1455
1456
  ] }),
1456
- onClose: M,
1457
- children: /* @__PURE__ */ p.jsxs("div", { className: _e.sheetRangeSelectorDialog, children: [
1458
- v.map((O, w) => /* @__PURE__ */ p.jsxs("div", { className: _e.sheetRangeSelectorDialogItem, children: [
1459
- /* @__PURE__ */ p.jsx(
1457
+ onClose: O,
1458
+ children: /* @__PURE__ */ _.jsxs("div", { className: ve.sheetRangeSelectorDialog, children: [
1459
+ C.map((M, w) => /* @__PURE__ */ _.jsxs("div", { className: ve.sheetRangeSelectorDialogItem, children: [
1460
+ /* @__PURE__ */ _.jsx(
1460
1461
  Nr,
1461
1462
  {
1462
1463
  affixWrapperStyle: { width: "100%" },
1463
1464
  placeholder: f.t("rangeSelector.placeHolder"),
1464
- onFocus: () => R(w),
1465
- value: O,
1466
- onChange: (U) => y(w, U)
1465
+ onFocus: () => I(w),
1466
+ value: M,
1467
+ onChange: (k) => x(w, k)
1467
1468
  },
1468
1469
  `input_${w}`
1469
1470
  ),
1470
- v.length > 1 && !l && /* @__PURE__ */ p.jsx(Mr, { className: _e.sheetRangeSelectorDialogItemDelete, onClick: () => P(w) })
1471
+ C.length > 1 && !l && /* @__PURE__ */ _.jsx(Mr, { className: ve.sheetRangeSelectorDialogItemDelete, onClick: () => P(w) })
1471
1472
  ] }, w)),
1472
- !l && /* @__PURE__ */ p.jsx("div", { children: /* @__PURE__ */ p.jsxs(nt, { type: "link", size: "small", onClick: F, children: [
1473
- /* @__PURE__ */ p.jsx(Ar, {}),
1474
- /* @__PURE__ */ p.jsx("span", { children: f.t("rangeSelector.addAnotherRange") })
1473
+ !l && /* @__PURE__ */ _.jsx("div", { children: /* @__PURE__ */ _.jsxs(nt, { type: "link", size: "small", onClick: F, children: [
1474
+ /* @__PURE__ */ _.jsx(Ar, {}),
1475
+ /* @__PURE__ */ _.jsx("span", { children: f.t("rangeSelector.addAnotherRange") })
1475
1476
  ] }) })
1476
1477
  ] })
1477
1478
  }
@@ -1505,7 +1506,7 @@ const yi = (r, e = 100) => {
1505
1506
  t !== null && clearTimeout(t), window.removeEventListener("scroll", n), window.removeEventListener("resize", n);
1506
1507
  };
1507
1508
  }, [r, e]);
1508
- }, xi = "univer-formula-help-function", Ti = "univer-formula-help-function-title", Fi = "univer-formula-help-function-title-icons", Mi = "univer-formula-help-function-title-icon", Oi = "univer-formula-help-function-content", Ai = "univer-formula-help-function-content-inner", Pi = "univer-formula-help-function-content-params", wi = "univer-formula-help-function-content-params-title", Li = "univer-formula-help-function-content-params-detail", Di = "univer-formula-help-function-active", $i = "univer-formula-help-decorator", ki = "univer-formula-help-param", Ui = "univer-formula-help-param-prefix", ji = "univer-formula-help-param-item", Hi = "univer-formula-help-param-active", re = {
1509
+ }, xi = "univer-formula-help-function", Ti = "univer-formula-help-function-title", Fi = "univer-formula-help-function-title-icons", Mi = "univer-formula-help-function-title-icon", Oi = "univer-formula-help-function-content", Ai = "univer-formula-help-function-content-inner", Pi = "univer-formula-help-function-content-params", wi = "univer-formula-help-function-content-params-title", Li = "univer-formula-help-function-content-params-detail", Di = "univer-formula-help-function-active", $i = "univer-formula-help-decorator", ki = "univer-formula-help-param", Ui = "univer-formula-help-param-prefix", ji = "univer-formula-help-param-item", Hi = "univer-formula-help-param-active", oe = {
1509
1510
  formulaHelpFunction: xi,
1510
1511
  formulaHelpFunctionTitle: Ti,
1511
1512
  formulaHelpFunctionTitleIcons: Fi,
@@ -1524,123 +1525,123 @@ const yi = (r, e = 100) => {
1524
1525
  }, Jn = () => {
1525
1526
  };
1526
1527
  function Wi(r) {
1527
- const { functionInfo: e, paramIndex: t, editorId: n, onParamsSwitch: o = Jn, onClose: s = Jn } = r, i = A(ve), c = A(Wt), l = z(() => !!e && t >= 0, [e, t]), [h, f] = $(!0), [u, a] = $([0, 0]), m = A(Ye), S = m.t("formula.prompt.required"), _ = m.t("formula.prompt.optional");
1528
- yi(g), D(() => {
1529
- const d = c.scrollEvent$.pipe(Sn(100)).subscribe(g);
1528
+ const { functionInfo: e, paramIndex: t, editorId: n, onParamsSwitch: o = Jn, onClose: s = Jn } = r, i = A(Re), c = A(Wt), l = K(() => !!e && t >= 0, [e, t]), [h, f] = $(!0), [u, a] = $([0, 0]), d = A(Ye), S = d.t("formula.prompt.required"), p = d.t("formula.prompt.optional");
1529
+ yi(m), D(() => {
1530
+ const v = c.scrollEvent$.pipe(pn(100)).subscribe(m);
1530
1531
  return () => {
1531
- d.unsubscribe();
1532
+ v.unsubscribe();
1532
1533
  };
1533
1534
  }, []), D(() => {
1534
- const d = i.getEditor(n);
1535
- if (!d)
1535
+ const v = i.getEditor(n);
1536
+ if (!v)
1536
1537
  return;
1537
- const C = d.getBoundingClientRect(), { left: R, top: E, height: N } = C;
1538
- a([R, E + N]);
1538
+ const g = v.getBoundingClientRect(), { left: I, top: R, height: N } = g;
1539
+ a([I, R + N]);
1539
1540
  }, [e, t, n]);
1540
- function g() {
1541
- const d = i.getEditor(n);
1542
- if (!d)
1541
+ function m() {
1542
+ const v = i.getEditor(n);
1543
+ if (!v)
1543
1544
  return;
1544
- const C = d.getBoundingClientRect(), { left: R, top: E, height: N } = C;
1545
- return a([R, E + N]), C;
1545
+ const g = v.getBoundingClientRect(), { left: I, top: R, height: N } = g;
1546
+ return a([I, R + N]), g;
1546
1547
  }
1547
- function v(d) {
1548
- o && o(d);
1548
+ function C(v) {
1549
+ o && o(v);
1549
1550
  }
1550
- return /* @__PURE__ */ p.jsx(Bt, { visible: l, offset: u, children: e ? /* @__PURE__ */ p.jsxs("div", { className: re.formulaHelpFunction, children: [
1551
- /* @__PURE__ */ p.jsxs("div", { className: re.formulaHelpFunctionTitle, children: [
1552
- /* @__PURE__ */ p.jsx(
1553
- Vi,
1551
+ return /* @__PURE__ */ _.jsx(Vt, { visible: l, offset: u, children: e ? /* @__PURE__ */ _.jsxs("div", { className: oe.formulaHelpFunction, children: [
1552
+ /* @__PURE__ */ _.jsxs("div", { className: oe.formulaHelpFunctionTitle, children: [
1553
+ /* @__PURE__ */ _.jsx(
1554
+ Bi,
1554
1555
  {
1555
1556
  prefix: e.functionName,
1556
1557
  value: e.functionParameter,
1557
1558
  active: t,
1558
- onClick: v
1559
+ onClick: C
1559
1560
  }
1560
1561
  ),
1561
- /* @__PURE__ */ p.jsxs("div", { className: re.formulaHelpFunctionTitleIcons, children: [
1562
- /* @__PURE__ */ p.jsx(
1562
+ /* @__PURE__ */ _.jsxs("div", { className: oe.formulaHelpFunctionTitleIcons, children: [
1563
+ /* @__PURE__ */ _.jsx(
1563
1564
  "div",
1564
1565
  {
1565
- className: re.formulaHelpFunctionTitleIcon,
1566
+ className: oe.formulaHelpFunctionTitleIcon,
1566
1567
  style: { transform: h ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
1567
1568
  onClick: () => f(!h),
1568
- children: /* @__PURE__ */ p.jsx(En, {})
1569
+ children: /* @__PURE__ */ _.jsx(bn, {})
1569
1570
  }
1570
1571
  ),
1571
- /* @__PURE__ */ p.jsx(
1572
+ /* @__PURE__ */ _.jsx(
1572
1573
  "div",
1573
1574
  {
1574
- className: re.formulaHelpFunctionTitleIcon,
1575
+ className: oe.formulaHelpFunctionTitleIcon,
1575
1576
  onClick: s,
1576
- children: /* @__PURE__ */ p.jsx(qt, {})
1577
+ children: /* @__PURE__ */ _.jsx(qt, {})
1577
1578
  }
1578
1579
  )
1579
1580
  ] })
1580
1581
  ] }),
1581
- /* @__PURE__ */ p.jsx(
1582
+ /* @__PURE__ */ _.jsx(
1582
1583
  "div",
1583
1584
  {
1584
- className: re.formulaHelpFunctionContent,
1585
+ className: oe.formulaHelpFunctionContent,
1585
1586
  style: {
1586
1587
  height: h ? "unset" : 0,
1587
1588
  padding: h ? "revert-layer" : 0
1588
1589
  },
1589
- children: /* @__PURE__ */ p.jsxs("div", { className: re.formulaHelpFunctionContentInner, children: [
1590
- /* @__PURE__ */ p.jsx(
1591
- Xt,
1590
+ children: /* @__PURE__ */ _.jsxs("div", { className: oe.formulaHelpFunctionContentInner, children: [
1591
+ /* @__PURE__ */ _.jsx(
1592
+ Qt,
1592
1593
  {
1593
- title: m.t("formula.prompt.helpExample"),
1594
- value: `${e.functionName}(${e.functionParameter.map((d) => d.example).join(",")})`
1594
+ title: d.t("formula.prompt.helpExample"),
1595
+ value: `${e.functionName}(${e.functionParameter.map((v) => v.example).join(",")})`
1595
1596
  }
1596
1597
  ),
1597
- /* @__PURE__ */ p.jsx(
1598
- Xt,
1598
+ /* @__PURE__ */ _.jsx(
1599
+ Qt,
1599
1600
  {
1600
- title: m.t("formula.prompt.helpAbstract"),
1601
+ title: d.t("formula.prompt.helpAbstract"),
1601
1602
  value: e.description
1602
1603
  }
1603
1604
  ),
1604
- e && e.functionParameter && e.functionParameter.map((d, C) => /* @__PURE__ */ p.jsx(
1605
- Xt,
1605
+ e && e.functionParameter && e.functionParameter.map((v, g) => /* @__PURE__ */ _.jsx(
1606
+ Qt,
1606
1607
  {
1607
- className: t === C ? re.formulaHelpFunctionActive : "",
1608
- title: d.name,
1609
- value: `${d.require ? S : _} ${d.detail}`
1608
+ className: t === g ? oe.formulaHelpFunctionActive : "",
1609
+ title: v.name,
1610
+ value: `${v.require ? S : p} ${v.detail}`
1610
1611
  },
1611
- C
1612
+ g
1612
1613
  ))
1613
1614
  ] })
1614
1615
  }
1615
1616
  )
1616
- ] }) : /* @__PURE__ */ p.jsx(p.Fragment, {}) });
1617
+ ] }) : /* @__PURE__ */ _.jsx(_.Fragment, {}) });
1617
1618
  }
1618
- const Xt = (r) => /* @__PURE__ */ p.jsxs("div", { className: re.formulaHelpFunctionContentParams, children: [
1619
- /* @__PURE__ */ p.jsx(
1619
+ const Qt = (r) => /* @__PURE__ */ _.jsxs("div", { className: oe.formulaHelpFunctionContentParams, children: [
1620
+ /* @__PURE__ */ _.jsx(
1620
1621
  "div",
1621
1622
  {
1622
1623
  className: `
1623
- ${re.formulaHelpFunctionContentParamsTitle}
1624
+ ${oe.formulaHelpFunctionContentParamsTitle}
1624
1625
  ${r.className}
1625
1626
  `,
1626
1627
  children: r.title
1627
1628
  }
1628
1629
  ),
1629
- /* @__PURE__ */ p.jsx("div", { className: re.formulaHelpFunctionContentParamsDetail, children: r.value })
1630
- ] }), Vi = (r) => {
1630
+ /* @__PURE__ */ _.jsx("div", { className: oe.formulaHelpFunctionContentParamsDetail, children: r.value })
1631
+ ] }), Bi = (r) => {
1631
1632
  const { prefix: e, value: t, active: n, onClick: o } = r;
1632
- return /* @__PURE__ */ p.jsxs("div", { className: re.formulaHelpParam, children: [
1633
- /* @__PURE__ */ p.jsxs("span", { className: re.formulaHelpParamPrefix, children: [
1633
+ return /* @__PURE__ */ _.jsxs("div", { className: oe.formulaHelpParam, children: [
1634
+ /* @__PURE__ */ _.jsxs("span", { className: oe.formulaHelpParamPrefix, children: [
1634
1635
  e,
1635
1636
  "("
1636
1637
  ] }),
1637
1638
  t && t.map((s, i) => (
1638
1639
  // TODO@Dushusir: more params needs to be active
1639
- /* @__PURE__ */ p.jsxs("span", { className: re.formulaHelpParamItem, children: [
1640
- /* @__PURE__ */ p.jsx(
1640
+ /* @__PURE__ */ _.jsxs("span", { className: oe.formulaHelpParamItem, children: [
1641
+ /* @__PURE__ */ _.jsx(
1641
1642
  "span",
1642
1643
  {
1643
- className: n === i ? re.formulaHelpFunctionActive : re.formulaHelpParamActive,
1644
+ className: n === i ? oe.formulaHelpFunctionActive : oe.formulaHelpParamActive,
1644
1645
  onClick: () => o(i),
1645
1646
  children: Tn(s)
1646
1647
  }
@@ -1653,45 +1654,45 @@ const Xt = (r) => /* @__PURE__ */ p.jsxs("div", { className: re.formulaHelpFunct
1653
1654
  }, st = (r) => {
1654
1655
  const e = Z();
1655
1656
  return e.current = r, e;
1656
- }, Bi = (r, e, t) => {
1657
- const n = A(ct), o = A(je), [s, i] = $(), [c, l] = $(-1), [h, f] = $(!0), u = st(h), a = Z(e);
1657
+ }, Vi = (r, e, t) => {
1658
+ const n = A(ct), o = A(Oe), [s, i] = $(), [c, l] = $(-1), [h, f] = $(!0), u = st(h), a = Z(e);
1658
1659
  a.current = e;
1659
- const m = () => {
1660
+ const d = () => {
1660
1661
  i(void 0), l(-1), f(!1);
1661
1662
  };
1662
1663
  return D(() => {
1663
1664
  if (t && r) {
1664
- const S = t.selectionChange$.pipe(jt(50)).subscribe((g) => {
1665
- if (g.textRanges.length === 1) {
1666
- const [v] = g.textRanges;
1667
- if (v.collapsed && u.current) {
1668
- const d = o.getFunctionAndParameter(a.current, v.startOffset - 1);
1669
- if (d) {
1670
- const { functionName: C, paramIndex: R } = d, E = n.getFunctionInfo(C);
1671
- i(E), l(R);
1665
+ const S = t.selectionChange$.pipe(jt(50)).subscribe((m) => {
1666
+ if (m.textRanges.length === 1) {
1667
+ const [C] = m.textRanges;
1668
+ if (C.collapsed && u.current) {
1669
+ const v = o.getFunctionAndParameter(a.current, C.startOffset - 1);
1670
+ if (v) {
1671
+ const { functionName: g, paramIndex: I } = v, R = n.getFunctionInfo(g);
1672
+ i(R), l(I);
1672
1673
  return;
1673
1674
  }
1674
1675
  }
1675
1676
  }
1676
1677
  i(void 0), l(-1);
1677
- }), _ = t.selectionChange$.pipe(
1678
- tt((g) => g.isEditing),
1679
- tt((g) => g.textRanges.length === 1),
1680
- mn((g) => g.textRanges[0].startOffset),
1681
- gn()
1678
+ }), p = t.selectionChange$.pipe(
1679
+ tt((m) => m.isEditing),
1680
+ tt((m) => m.textRanges.length === 1),
1681
+ gn((m) => m.textRanges[0].startOffset),
1682
+ Sn()
1682
1683
  ).subscribe(() => {
1683
1684
  f(!0);
1684
1685
  });
1685
1686
  return () => {
1686
- S.unsubscribe(), _.unsubscribe();
1687
+ S.unsubscribe(), p.unsubscribe();
1687
1688
  };
1688
1689
  }
1689
1690
  }, [t, r]), D(() => {
1690
- r || m();
1691
+ r || d();
1691
1692
  }, [r]), {
1692
1693
  functionInfo: s,
1693
1694
  paramIndex: c,
1694
- reset: m
1695
+ reset: d
1695
1696
  };
1696
1697
  }, xt = (r, e, t = !0) => {
1697
1698
  let n = -1;
@@ -1714,17 +1715,17 @@ const Xt = (r) => /* @__PURE__ */ p.jsxs("div", { className: re.formulaHelpFunct
1714
1715
  return D(() => {
1715
1716
  if (t && r) {
1716
1717
  const a = t.input$.pipe(jt(300)).subscribe(() => {
1717
- const m = t.getSelectionRanges();
1718
- if (m.length === 1) {
1719
- const S = h.current.nodes, _ = m[0];
1720
- if (_.collapsed) {
1721
- const g = xt(S, _.startOffset - 1, !1);
1722
- l.current = g;
1723
- const v = S[g];
1724
- if (v && typeof v != "string" && v.nodeType === Y.FUNCTION) {
1725
- l.current = g;
1726
- const d = v.token, C = n.getSearchListByNameFirstLetter(d);
1727
- s(C), c(d);
1718
+ const d = t.getSelectionRanges();
1719
+ if (d.length === 1) {
1720
+ const S = h.current.nodes, p = d[0];
1721
+ if (p.collapsed) {
1722
+ const m = xt(S, p.startOffset - 1, !1);
1723
+ l.current = m;
1724
+ const C = S[m];
1725
+ if (C && typeof C != "string" && C.nodeType === z.FUNCTION) {
1726
+ l.current = m;
1727
+ const v = C.token, g = n.getSearchListByNameFirstLetter(v);
1728
+ s(g), c(v);
1728
1729
  return;
1729
1730
  }
1730
1731
  }
@@ -1741,11 +1742,11 @@ const Xt = (r) => /* @__PURE__ */ p.jsxs("div", { className: re.formulaHelpFunct
1741
1742
  searchList: o,
1742
1743
  searchText: i,
1743
1744
  handlerFormulaReplace: (a) => {
1744
- const m = [...h.current.nodes];
1745
+ const d = [...h.current.nodes];
1745
1746
  if (l.current !== -1) {
1746
- const S = m.splice(l.current + 1), _ = m.pop() || "";
1747
- let g = (typeof _ == "string" ? _.length : _.token.length) - a.length;
1748
- return m.push(a), S[0] !== G.OPEN_BRACKET && (m.push(G.OPEN_BRACKET), g--), { text: Fe([...m, ...S]), offset: g };
1747
+ const S = d.splice(l.current + 1), p = d.pop() || "";
1748
+ let m = (typeof p == "string" ? p.length : p.token.length) - a.length;
1749
+ return d.push(a), S[0] !== G.OPEN_BRACKET && (d.push(G.OPEN_BRACKET), m--), { text: be([...d, ...S]), offset: m };
1749
1750
  }
1750
1751
  },
1751
1752
  reset: f
@@ -1766,18 +1767,18 @@ const Xt = (r) => /* @__PURE__ */ p.jsxs("div", { className: re.formulaHelpFunct
1766
1767
  reset: i
1767
1768
  };
1768
1769
  }, Fn = [
1769
- xe.EQUALS,
1770
- xe.GREATER_THAN,
1771
- xe.GREATER_THAN_OR_EQUAL,
1772
- xe.LESS_THAN,
1773
- xe.LESS_THAN_OR_EQUAL,
1774
- xe.NOT_EQUAL,
1775
- Te.CONCATENATE,
1776
- Te.DIVIDED,
1777
- Te.MINUS,
1778
- Te.MULTIPLY,
1779
- Te.PLUS,
1780
- Te.POWER,
1770
+ Te.EQUALS,
1771
+ Te.GREATER_THAN,
1772
+ Te.GREATER_THAN_OR_EQUAL,
1773
+ Te.LESS_THAN,
1774
+ Te.LESS_THAN_OR_EQUAL,
1775
+ Te.NOT_EQUAL,
1776
+ Fe.CONCATENATE,
1777
+ Fe.DIVIDED,
1778
+ Fe.MINUS,
1779
+ Fe.MULTIPLY,
1780
+ Fe.PLUS,
1781
+ Fe.POWER,
1781
1782
  G.COMMA
1782
1783
  ], er = [
1783
1784
  ...Fn,
@@ -1786,50 +1787,50 @@ const Xt = (r) => /* @__PURE__ */ p.jsxs("div", { className: re.formulaHelpFunct
1786
1787
  ], Yi = [
1787
1788
  ...Fn,
1788
1789
  G.CLOSE_BRACKET
1789
- ], Qt = (r) => typeof r == "string" ? r : r.token, Gi = (r, e, t) => {
1790
- const o = A(fe).getRenderById(r), s = o == null ? void 0 : o.with(le), i = Z(!1), c = st(e), l = z(() => zi(!1, 300), []), h = (u) => {
1790
+ ], Jt = (r) => typeof r == "string" ? r : r.token, Gi = (r, e, t) => {
1791
+ const o = A(de).getRenderById(r), s = o == null ? void 0 : o.with(ue), i = Z(!1), c = st(e), l = K(() => zi(!1, 300), []), h = (u) => {
1791
1792
  s && s.setSkipLastEnabled(u), i.current = u;
1792
1793
  }, f = () => i.current;
1793
1794
  return D(() => {
1794
1795
  if (t && s) {
1795
- const u = t.input$.subscribe((m) => {
1796
- const S = m.content;
1796
+ const u = t.input$.subscribe((d) => {
1797
+ const S = d.content;
1797
1798
  S.length === 1 && er.includes(S) ? (h(!0), l.setValue(!0), l.reset()) : (h(!1), l.setValue(!1));
1798
- }), a = t.selectionChange$.pipe(jt(100)).subscribe((m) => {
1799
+ }), a = t.selectionChange$.pipe(jt(100)).subscribe((d) => {
1799
1800
  if (l.getValue())
1800
1801
  return;
1801
- const S = m.textRanges;
1802
+ const S = d.textRanges;
1802
1803
  if (!S.length)
1803
1804
  return;
1804
1805
  if (S.length !== 1) {
1805
1806
  h(!1);
1806
1807
  return;
1807
1808
  }
1808
- const _ = S[0];
1809
- if (!_.collapsed) {
1809
+ const p = S[0];
1810
+ if (!p.collapsed) {
1810
1811
  h(!1);
1811
1812
  return;
1812
1813
  }
1813
- const g = c.current;
1814
- if (!g.length) {
1814
+ const m = c.current;
1815
+ if (!m.length) {
1815
1816
  h(!0);
1816
1817
  return;
1817
1818
  }
1818
- const v = _.startOffset - 1;
1819
- if (v === 0) {
1820
- const I = xt(g, 1, !1), x = g[I] || "", b = Qt(x);
1819
+ const C = p.startOffset - 1;
1820
+ if (C === 0) {
1821
+ const E = xt(m, 1, !1), y = m[E] || "", b = Jt(y);
1821
1822
  if (Fn.includes(b)) {
1822
1823
  h(!0);
1823
1824
  return;
1824
1825
  }
1825
1826
  }
1826
- const d = xt(g, v, !1), C = g[d];
1827
- if (!C) {
1827
+ const v = xt(m, C, !1), g = m[v];
1828
+ if (!g) {
1828
1829
  h(!1);
1829
1830
  return;
1830
1831
  }
1831
- const R = g[d + 1] || "", E = Qt(R), N = Qt(C);
1832
- er.includes(N) && (!R || Yi.includes(E)) ? h(!0) : h(!1);
1832
+ const I = m[v + 1] || "", R = Jt(I), N = Jt(g);
1833
+ er.includes(N) && (!I || Yi.includes(R)) ? h(!0) : h(!1);
1833
1834
  });
1834
1835
  return s.selectionMoveEnd$.subscribe(() => {
1835
1836
  Promise.resolve().then(() => {
@@ -1846,130 +1847,130 @@ const Xt = (r) => /* @__PURE__ */ p.jsxs("div", { className: re.formulaHelpFunct
1846
1847
  };
1847
1848
  }, Zi = () => {
1848
1849
  }, Xi = (r, e, t, n, o, s, i = Zi) => {
1849
- const c = A(fe), l = A(be), h = st(n), { getIsNeedAddSelection: f } = Gi(e, n, s), u = l.getUnit(e), a = (R) => {
1850
- var E, N;
1851
- return (N = (E = u == null ? void 0 : u.getSheetBySheetId(R)) == null ? void 0 : E.getName()) != null ? N : "";
1852
- }, m = z(() => a(t), [t]), S = dn(u == null ? void 0 : u.activeSheet$), _ = st({ activeSheet: S, sheetName: m }), g = c.getRenderById(e), v = g == null ? void 0 : g.with(le), d = Z(!1), C = Z();
1850
+ const c = A(de), l = A(ye), h = st(n), { getIsNeedAddSelection: f } = Gi(e, n, s), u = l.getUnit(e), a = (I) => {
1851
+ var R, N;
1852
+ return (N = (R = u == null ? void 0 : u.getSheetBySheetId(I)) == null ? void 0 : R.getName()) != null ? N : "";
1853
+ }, d = K(() => a(t), [t]), S = mn(u == null ? void 0 : u.activeSheet$), p = st({ activeSheet: S, sheetName: d }), m = c.getRenderById(e), C = m == null ? void 0 : m.with(ue), v = Z(!1), g = Z();
1853
1854
  D(() => {
1854
- if (v && r) {
1855
- let R = !0;
1856
- const E = (I) => {
1857
- var P, F, T, H, O, w;
1858
- if (R || d.current) {
1859
- R = !1;
1855
+ if (C && r) {
1856
+ let I = !0;
1857
+ const R = (E) => {
1858
+ var P, F, T, B, M, w;
1859
+ if (I || v.current) {
1860
+ I = !1;
1860
1861
  return;
1861
1862
  }
1862
- const x = s == null ? void 0 : s.getSelectionRanges();
1863
- if ((x == null ? void 0 : x.length) !== 1)
1863
+ const y = s == null ? void 0 : s.getSelectionRanges();
1864
+ if ((y == null ? void 0 : y.length) !== 1)
1864
1865
  return;
1865
- const M = x[0].startOffset - 1, y = [...h.current];
1866
+ const O = y[0].startOffset - 1, x = [...h.current];
1866
1867
  if (f())
1867
- if (M !== 0) {
1868
- const U = xt(y, M, !1);
1869
- if (U === -1 && y.length)
1868
+ if (O !== 0) {
1869
+ const k = xt(x, O, !1);
1870
+ if (k === -1 && x.length)
1870
1871
  return;
1871
- const k = I[I.length - 1], Q = y.splice(U + 1), de = (P = k.rangeWithCoord.sheetId) != null ? P : t, me = {
1872
- range: k.rangeWithCoord,
1873
- unitId: (F = k.rangeWithCoord.unitId) != null ? F : e,
1874
- sheetName: a(de)
1875
- }, J = Re([me], o && de !== t);
1876
- y.push({ token: J[0], nodeType: Y.REFERENCE });
1877
- const oe = [...y, ...Q], ae = Fe(oe);
1878
- i(ae, Ki(y), !0);
1872
+ const H = E[E.length - 1], Q = x.splice(k + 1), me = (P = H.rangeWithCoord.sheetId) != null ? P : t, ge = {
1873
+ range: H.rangeWithCoord,
1874
+ unitId: (F = H.rangeWithCoord.unitId) != null ? F : e,
1875
+ sheetName: a(me)
1876
+ }, J = Ce([ge], o && me !== t);
1877
+ x.push({ token: J[0], nodeType: z.REFERENCE });
1878
+ const se = [...x, ...Q], he = be(se);
1879
+ i(he, Ki(x), !0);
1879
1880
  } else {
1880
- const U = I[I.length - 1], k = (T = U.rangeWithCoord.sheetId) != null ? T : t, Q = {
1881
- range: U.rangeWithCoord,
1882
- unitId: (H = U.rangeWithCoord.unitId) != null ? H : e,
1883
- sheetName: a(k)
1884
- }, me = Re([Q], o && k !== t);
1885
- y.unshift({ token: me[0], nodeType: Y.REFERENCE });
1886
- const Ce = Fe(y);
1887
- i(Ce, me[0].length, !0);
1881
+ const k = E[E.length - 1], H = (T = k.rangeWithCoord.sheetId) != null ? T : t, Q = {
1882
+ range: k.rangeWithCoord,
1883
+ unitId: (B = k.rangeWithCoord.unitId) != null ? B : e,
1884
+ sheetName: a(H)
1885
+ }, ge = Ce([Q], o && H !== t);
1886
+ x.unshift({ token: ge[0], nodeType: z.REFERENCE });
1887
+ const Ie = be(x);
1888
+ i(Ie, ge[0].length, !0);
1888
1889
  }
1889
1890
  else {
1890
- let U = 0;
1891
- const k = y.map((J) => {
1892
- var oe, ae, Ae;
1891
+ let k = 0;
1892
+ const H = x.map((J) => {
1893
+ var se, he, Pe;
1893
1894
  if (typeof J == "string")
1894
1895
  return J;
1895
- if (J.nodeType === Y.REFERENCE) {
1896
- const B = he(J.token);
1897
- if (B.sheetName || (B.sheetName = m), o && ((oe = _.current.activeSheet) == null ? void 0 : oe.getName()) !== B.sheetName)
1896
+ if (J.nodeType === z.REFERENCE) {
1897
+ const we = ae(J.token);
1898
+ if (we.sheetName || (we.sheetName = d), o && ((se = p.current.activeSheet) == null ? void 0 : se.getName()) !== we.sheetName)
1898
1899
  return J.token;
1899
- const K = I[U];
1900
- if (U++, !K)
1900
+ const V = E[k];
1901
+ if (k++, !V)
1901
1902
  return "";
1902
- const se = (ae = K.rangeWithCoord.sheetId) != null ? ae : t, ce = {
1903
- range: K.rangeWithCoord,
1904
- unitId: (Ae = K.rangeWithCoord.unitId) != null ? Ae : e,
1905
- sheetName: a(se)
1903
+ const Y = (he = V.rangeWithCoord.sheetId) != null ? he : t, ee = {
1904
+ range: V.rangeWithCoord,
1905
+ unitId: (Pe = V.rangeWithCoord.unitId) != null ? Pe : e,
1906
+ sheetName: a(Y)
1906
1907
  };
1907
- return Re([ce], o)[0];
1908
+ return Ce([ee], o)[0];
1908
1909
  }
1909
1910
  return J.token;
1910
1911
  }).join(""), Q = [];
1911
- for (let J = U; J <= I.length - 1; J++) {
1912
- const oe = I[J], ae = (O = oe.rangeWithCoord.sheetId) != null ? O : t, Ae = {
1913
- range: oe.rangeWithCoord,
1914
- unitId: (w = oe.rangeWithCoord.unitId) != null ? w : e,
1915
- sheetName: a(ae)
1916
- }, K = Re([Ae], o && ae !== t);
1917
- Q.push(K[0]);
1912
+ for (let J = k; J <= E.length - 1; J++) {
1913
+ const se = E[J], he = (M = se.rangeWithCoord.sheetId) != null ? M : t, Pe = {
1914
+ range: se.rangeWithCoord,
1915
+ unitId: (w = se.rangeWithCoord.unitId) != null ? w : e,
1916
+ sheetName: a(he)
1917
+ }, V = Ce([Pe], o && he !== t);
1918
+ Q.push(V[0]);
1918
1919
  }
1919
- const de = y[y.length - 1], me = de && (typeof de == "string" ? !1 : de.nodeType === Y.REFERENCE), Ce = `${k}${Q.length && me ? "," : ""}${Q.join(",")}`;
1920
- i(Ce, Ce.length, !0);
1920
+ const me = x[x.length - 1], ge = me && (typeof me == "string" ? !1 : me.nodeType === z.REFERENCE), Ie = `${H}${Q.length && ge ? "," : ""}${Q.join(",")}`;
1921
+ i(Ie, Ie.length, !0);
1921
1922
  }
1922
- }, N = v.selectionMoveEnd$.subscribe((I) => {
1923
- if (E(I), d.current = !1, C.current) {
1924
- const { result: x, offset: b } = C.current;
1925
- i(x, b || -1, !0), C.current = void 0;
1923
+ }, N = C.selectionMoveEnd$.subscribe((E) => {
1924
+ if (R(E), v.current = !1, g.current) {
1925
+ const { result: y, offset: b } = g.current;
1926
+ i(y, b || -1, !0), g.current = void 0;
1926
1927
  }
1927
1928
  });
1928
1929
  return () => {
1929
1930
  N.unsubscribe();
1930
1931
  };
1931
1932
  }
1932
- }, [v, s, o, r]), D(() => {
1933
- if (r && v && s) {
1934
- const R = new ze(), E = (x, b) => {
1935
- let M = 0, y = 0, P = !1;
1936
- const { sheetName: F } = _.current, T = h.current.map((O) => {
1933
+ }, [C, s, o, r]), D(() => {
1934
+ if (r && C && s) {
1935
+ const I = new ze(), R = (y, b) => {
1936
+ let O = 0, x = 0, P = !1;
1937
+ const { sheetName: F } = p.current, T = h.current.map((M) => {
1937
1938
  var w;
1938
- if (typeof O == "string")
1939
- return P || (y += O.length), O;
1940
- if (O.nodeType === Y.REFERENCE) {
1941
- const U = he(O.token);
1942
- if (U.unitId || (U.unitId = e), U.sheetName || (U.sheetName = F), o && ((w = _.current.activeSheet) == null ? void 0 : w.getName()) !== U.sheetName)
1943
- return P || (y += O.token.length), O;
1944
- if (M === b) {
1939
+ if (typeof M == "string")
1940
+ return P || (x += M.length), M;
1941
+ if (M.nodeType === z.REFERENCE) {
1942
+ const k = ae(M.token);
1943
+ if (k.unitId || (k.unitId = e), k.sheetName || (k.sheetName = F), o && ((w = p.current.activeSheet) == null ? void 0 : w.getName()) !== k.sheetName)
1944
+ return P || (x += M.token.length), M;
1945
+ if (O === b) {
1945
1946
  P = !0;
1946
- const k = { ...O, token: x };
1947
- return o && U.sheetName !== F ? k.token = Nt(U.sheetName, he(x).range) : k.token = x, y += k.token.length, M++, k;
1947
+ const H = { ...M, token: y };
1948
+ return o && k.sheetName !== F ? H.token = Nt(k.sheetName, ae(y).range) : H.token = y, x += H.token.length, O++, H;
1948
1949
  }
1949
- return P || (y += O.token.length), M++, O;
1950
+ return P || (x += M.token.length), O++, M;
1950
1951
  }
1951
- return P || (y += O.token.length), O;
1952
- }), H = Fe(T);
1953
- i(H, -1, !1), C.current = { result: H, offset: y };
1952
+ return P || (x += M.token.length), M;
1953
+ }), B = be(T);
1954
+ i(B, -1, !1), g.current = { result: B, offset: x };
1954
1955
  }, N = () => {
1955
- R.dispose(), v.getSelectionControls().forEach((b, M) => {
1956
- R.add(et(b.selectionMoving$, b.selectionScaling$).pipe(
1957
- Ds((y) => Ie(y)),
1956
+ I.dispose(), C.getSelectionControls().forEach((b, O) => {
1957
+ I.add(et(b.selectionMoving$, b.selectionScaling$).pipe(
1958
+ Ds((x) => Ee(x)),
1958
1959
  $s()
1959
- ).subscribe((y) => {
1960
- d.current = !0, E(y, M);
1960
+ ).subscribe((x) => {
1961
+ v.current = !0, R(x, O);
1961
1962
  }));
1962
1963
  });
1963
- }, I = et(s.input$, v.selectionMoveEnd$).pipe(Ls(50)).subscribe(() => {
1964
+ }, E = et(s.input$, C.selectionMoveEnd$).pipe(Ls(50)).subscribe(() => {
1964
1965
  N();
1965
1966
  });
1966
1967
  return () => {
1967
- I.unsubscribe(), R.dispose();
1968
+ E.unsubscribe(), I.dispose();
1968
1969
  };
1969
1970
  }
1970
- }, [r, v, s]);
1971
+ }, [r, C, s]);
1971
1972
  }, Qi = (r, e, t) => {
1972
- const n = A(je), o = Z(!0);
1973
+ const n = A(Oe), o = Z(!0);
1973
1974
  D(() => {
1974
1975
  if (r) {
1975
1976
  const s = setTimeout(() => {
@@ -1982,7 +1983,7 @@ const Xt = (r) => /* @__PURE__ */ p.jsxs("div", { className: re.formulaHelpFunct
1982
1983
  }, [r]), D(() => {
1983
1984
  if (!o.current && e) {
1984
1985
  const s = n.checkIfAddBracket(t);
1985
- e(s === 0 && t.startsWith(Te.EQUALS), `${t}`);
1986
+ e(s === 0 && t.startsWith(Fe.EQUALS), `${t}`);
1986
1987
  }
1987
1988
  }, [t, e]);
1988
1989
  }, Ji = "univer-sheet-embedding-formula-editor-active", ec = "univer-sheet-embedding-formula-editor-wrap", tc = "univer-sheet-embedding-formula-editor-text", nc = "univer-sheet-embedding-formula-editor-error-wrap", rc = "univer-sheet-embedding-formula-editor-error", Qe = {
@@ -1991,7 +1992,7 @@ const Xt = (r) => /* @__PURE__ */ p.jsxs("div", { className: re.formulaHelpFunct
1991
1992
  sheetEmbeddingFormulaEditorText: tc,
1992
1993
  sheetEmbeddingFormulaEditorErrorWrap: nc,
1993
1994
  sheetEmbeddingFormulaEditorError: rc
1994
- }, oc = "univer-formula-search-function", sc = "univer-formula-search-function-item", ic = "univer-formula-search-function-item-name", cc = "univer-formula-search-function-item-name-light", lc = "univer-formula-search-function-item-desc", ac = "univer-formula-search-function-item-active", Le = {
1995
+ }, oc = "univer-formula-search-function", sc = "univer-formula-search-function-item", ic = "univer-formula-search-function-item-name", cc = "univer-formula-search-function-item-name-light", lc = "univer-formula-search-function-item-desc", ac = "univer-formula-search-function-item-active", De = {
1995
1996
  formulaSearchFunction: oc,
1996
1997
  formulaSearchFunctionItem: sc,
1997
1998
  formulaSearchFunctionItemName: ic,
@@ -1999,45 +2000,45 @@ const Xt = (r) => /* @__PURE__ */ p.jsxs("div", { className: re.formulaHelpFunct
1999
2000
  formulaSearchFunctionItemDesc: lc,
2000
2001
  formulaSearchFunctionItemActive: ac
2001
2002
  }, uc = () => {
2002
- }, hc = Oe(fc);
2003
+ }, hc = Ae(fc);
2003
2004
  function fc(r, e) {
2004
- const { searchText: t, searchList: n, onSelect: o, editorId: s, onClose: i = uc } = r, c = A(ve), l = A(Vt), h = A(Ee), f = z(() => !!n.length, [n]), u = Z(), [a, m] = $(0), [S, _] = $([0, 0]), g = Z(!1), v = st({ searchList: n, active: a }), d = c.getEditor(s);
2005
+ const { searchText: t, searchList: n, onSelect: o, editorId: s, onClose: i = uc } = r, c = A(Re), l = A(Bt), h = A(Ne), f = K(() => !!n.length, [n]), u = Z(), [a, d] = $(0), [S, p] = $([0, 0]), m = Z(!1), C = st({ searchList: n, active: a }), v = c.getEditor(s);
2005
2006
  D(() => {
2006
- const I = c.getEditor(s), x = I == null ? void 0 : I.getBoundingClientRect();
2007
- if (x == null)
2007
+ const E = c.getEditor(s), y = E == null ? void 0 : E.getBoundingClientRect();
2008
+ if (y == null)
2008
2009
  return;
2009
- const { left: b, top: M, height: y } = x;
2010
- _([b, M + y]), m(0);
2010
+ const { left: b, top: O, height: x } = y;
2011
+ p([b, O + x]), d(0);
2011
2012
  }, [t, n]);
2012
- function C(I) {
2013
- g.current && m(I);
2013
+ function g(E) {
2014
+ m.current && d(E);
2014
2015
  }
2015
- function R() {
2016
- g.current && m(-1);
2016
+ function I() {
2017
+ m.current && d(-1);
2017
2018
  }
2018
2019
  D(() => {
2019
2020
  if (!n.length)
2020
2021
  return;
2021
- const I = `sheet.formula-embedding-editor.search_function.${s}`, x = new ze(), b = (M) => {
2022
- const { searchList: y, active: P } = v.current;
2023
- switch (M) {
2022
+ const E = `sheet.formula-embedding-editor.search_function.${s}`, y = new ze(), b = (O) => {
2023
+ const { searchList: x, active: P } = C.current;
2024
+ switch (O) {
2024
2025
  case L.ARROW_UP: {
2025
- m((F) => {
2026
+ d((F) => {
2026
2027
  const T = Math.max(0, F - 1);
2027
- return E(T), T;
2028
+ return R(T), T;
2028
2029
  });
2029
2030
  break;
2030
2031
  }
2031
2032
  case L.ARROW_DOWN: {
2032
- m((F) => {
2033
- const T = Math.min(y.length - 1, F + 1);
2034
- return E(T), T;
2033
+ d((F) => {
2034
+ const T = Math.min(x.length - 1, F + 1);
2035
+ return R(T), T;
2035
2036
  });
2036
2037
  break;
2037
2038
  }
2038
2039
  case L.TAB:
2039
2040
  case L.ENTER: {
2040
- const F = y[P];
2041
+ const F = x[P];
2041
2042
  o(F.name);
2042
2043
  break;
2043
2044
  }
@@ -2047,85 +2048,85 @@ function fc(r, e) {
2047
2048
  }
2048
2049
  }
2049
2050
  };
2050
- return x.add(h.registerCommand({
2051
- id: I,
2051
+ return y.add(h.registerCommand({
2052
+ id: E,
2052
2053
  type: Me.OPERATION,
2053
- handler(M, y) {
2054
- const { keyCode: P } = y;
2054
+ handler(O, x) {
2055
+ const { keyCode: P } = x;
2055
2056
  b(P);
2056
2057
  }
2057
- })), [L.ARROW_UP, L.ARROW_DOWN, L.ENTER, L.ESC, L.TAB].map((M) => ({
2058
- id: I,
2059
- binding: M,
2058
+ })), [L.ARROW_UP, L.ARROW_DOWN, L.ENTER, L.ESC, L.TAB].map((O) => ({
2059
+ id: E,
2060
+ binding: O,
2060
2061
  preconditions: () => !0,
2061
2062
  priority: 1e3,
2062
2063
  staticParameters: {
2063
- eventType: pe.Keyboard,
2064
- keyCode: M
2064
+ eventType: _e.Keyboard,
2065
+ keyCode: O
2065
2066
  }
2066
- })).forEach((M) => {
2067
- x.add(l.registerShortcut(M));
2067
+ })).forEach((O) => {
2068
+ y.add(l.registerShortcut(O));
2068
2069
  }), () => {
2069
- x.dispose();
2070
+ y.dispose();
2070
2071
  };
2071
2072
  }, [n]);
2072
- function E(I) {
2073
+ function R(E) {
2073
2074
  var w;
2074
- const x = (w = u.current) == null ? void 0 : w.querySelectorAll(`.${Le.formulaSearchFunctionItem}`)[I];
2075
- if (!x) return;
2076
- const b = x.parentNode;
2075
+ const y = (w = u.current) == null ? void 0 : w.querySelectorAll(`.${De.formulaSearchFunctionItem}`)[E];
2076
+ if (!y) return;
2077
+ const b = y.parentNode;
2077
2078
  if (!b) return;
2078
- const y = b.getBoundingClientRect().top, P = b.offsetHeight, F = x.getBoundingClientRect(), T = F.top, H = F.height;
2079
- if (T >= 0 && T > y && T - y + H <= P)
2079
+ const x = b.getBoundingClientRect().top, P = b.offsetHeight, F = y.getBoundingClientRect(), T = F.top, B = F.height;
2080
+ if (T >= 0 && T > x && T - x + B <= P)
2080
2081
  return;
2081
- const O = x.offsetTop - (P - H) / 2;
2082
+ const M = y.offsetTop - (P - B) / 2;
2082
2083
  b.scrollTo({
2083
- top: O,
2084
+ top: M,
2084
2085
  behavior: "smooth"
2085
2086
  });
2086
2087
  }
2087
- const N = z(() => {
2088
- let I = "";
2088
+ const N = K(() => {
2089
+ let E = "";
2089
2090
  return () => {
2090
- clearTimeout(I), g.current = !0, I = setTimeout(() => {
2091
- g.current = !1;
2091
+ clearTimeout(E), m.current = !0, E = setTimeout(() => {
2092
+ m.current = !1;
2092
2093
  }, 300);
2093
2094
  };
2094
2095
  }, []);
2095
- return n.length > 0 && /* @__PURE__ */ p.jsx(Bt, { visible: f, offset: S, children: /* @__PURE__ */ p.jsx(
2096
+ return n.length > 0 && /* @__PURE__ */ _.jsx(Vt, { visible: f, offset: S, children: /* @__PURE__ */ _.jsx(
2096
2097
  "ul",
2097
2098
  {
2098
- className: Le.formulaSearchFunction,
2099
- ref: (I) => {
2100
- u.current = I, e && (e.current = I);
2099
+ className: De.formulaSearchFunction,
2100
+ ref: (E) => {
2101
+ u.current = E, e && (e.current = E);
2101
2102
  },
2102
- children: n.map((I, x) => /* @__PURE__ */ p.jsxs(
2103
+ children: n.map((E, y) => /* @__PURE__ */ _.jsxs(
2103
2104
  "li",
2104
2105
  {
2105
- className: a === x ? `
2106
- ${Le.formulaSearchFunctionItem}
2107
- ${Le.formulaSearchFunctionItemActive}
2108
- ` : Le.formulaSearchFunctionItem,
2109
- onMouseEnter: () => C(x),
2110
- onMouseLeave: R,
2106
+ className: a === y ? `
2107
+ ${De.formulaSearchFunctionItem}
2108
+ ${De.formulaSearchFunctionItemActive}
2109
+ ` : De.formulaSearchFunctionItem,
2110
+ onMouseEnter: () => g(y),
2111
+ onMouseLeave: I,
2111
2112
  onMouseMove: N,
2112
2113
  onClick: () => {
2113
- o(I.name), d && d.focus();
2114
+ o(E.name), v && v.focus();
2114
2115
  },
2115
2116
  children: [
2116
- /* @__PURE__ */ p.jsxs("span", { className: Le.formulaSearchFunctionItemName, children: [
2117
- /* @__PURE__ */ p.jsx("span", { className: Le.formulaSearchFunctionItemNameLight, children: I.name.substring(0, t.length) }),
2118
- /* @__PURE__ */ p.jsx("span", { children: I.name.slice(t.length) })
2117
+ /* @__PURE__ */ _.jsxs("span", { className: De.formulaSearchFunctionItemName, children: [
2118
+ /* @__PURE__ */ _.jsx("span", { className: De.formulaSearchFunctionItemNameLight, children: E.name.substring(0, t.length) }),
2119
+ /* @__PURE__ */ _.jsx("span", { children: E.name.slice(t.length) })
2119
2120
  ] }),
2120
- /* @__PURE__ */ p.jsx("span", { className: Le.formulaSearchFunctionItemDesc, children: I.desc })
2121
+ /* @__PURE__ */ _.jsx("span", { className: De.formulaSearchFunctionItemDesc, children: E.desc })
2121
2122
  ]
2122
2123
  },
2123
- x
2124
+ y
2124
2125
  ))
2125
2126
  }
2126
2127
  ) });
2127
2128
  }
2128
- const tr = (r) => r.startsWith(Te.EQUALS) ? r.slice(1) : "", Jt = () => {
2129
+ const tr = (r) => r.startsWith(Fe.EQUALS) ? r.slice(1) : "", en = () => {
2129
2130
  };
2130
2131
  function dc(r) {
2131
2132
  const {
@@ -2135,140 +2136,152 @@ function dc(r) {
2135
2136
  subUnitId: o,
2136
2137
  isFocus: s = !0,
2137
2138
  isSupportAcrossSheet: i = !1,
2138
- onFocus: c = Jt,
2139
- onBlur: l = Jt,
2139
+ onFocus: c = en,
2140
+ onBlur: l = en,
2140
2141
  onChange: h,
2141
2142
  onVerify: f,
2142
2143
  actions: u
2143
- } = r, a = A(ve), m = Z(null), [S, _] = $(() => t.startsWith(Te.EQUALS) ? t : "");
2144
- u && (u.handleOutClick = (B, K) => {
2145
- m.current && !m.current.contains(B.target) && K();
2144
+ } = r, a = A(Re), d = A(Oe), S = Z(null), [p, m] = $(() => t.startsWith(Fe.EQUALS) ? t : "");
2145
+ u && (u.handleOutClick = (V, Y) => {
2146
+ S.current && !S.current.contains(V.target) && Y();
2146
2147
  });
2147
- const g = z(() => tr(S), [S]), v = Z(null), [d, C] = $(), [R, E] = $(s), N = Z(null), I = z(() => ur(`${Fo}-${hr(4)}`), []), x = z(() => e !== void 0, [e]), b = Kt(), M = z(() => b(g), [g]), y = Dr(M, (B) => {
2148
- h(`=${B}`);
2149
- }, d), P = Ur("="), F = bn(n), T = (B, K = !0) => {
2150
- if (!d)
2148
+ const C = K(() => tr(p), [p]), v = Z(null), [g, I] = $(), [R, N] = $(s), E = Z(null), y = K(() => ur(`${Fo}-${hr(4)}`), []), b = K(() => e !== void 0, [e]), O = Kt(), x = K(() => O(C), [C]), P = Dr(x, (V) => {
2149
+ const Y = d.sequenceNodesBuilder(V);
2150
+ if (Y) {
2151
+ const ee = Y.map((j) => {
2152
+ if (typeof j == "string")
2153
+ return j;
2154
+ if (j.nodeType === z.REFERENCE) {
2155
+ const ie = { ...j }, ce = ae(j.token);
2156
+ return ce.range = zt(ce.range), i || (ce.sheetName = "", ce.unitId = ""), ie.token = Ce([ce], i)[0], ie;
2157
+ }
2158
+ return j;
2159
+ }), U = be(ee);
2160
+ h(`=${U}`);
2161
+ }
2162
+ }, g), F = Ur("="), T = Nn(n), B = (V, Y = !0) => {
2163
+ if (!g)
2151
2164
  return;
2152
- const se = b(B), ce = P(d, se, K);
2153
- F(ce);
2165
+ const ee = O(V), U = F(g, ee, Y);
2166
+ T(U);
2154
2167
  };
2155
- Qi(R, f, S);
2156
- const H = kr(d), O = qr(R);
2168
+ Qi(R, f, p);
2169
+ const M = kr(g), w = qr(R);
2157
2170
  ot(() => {
2158
2171
  if (s) {
2159
- const B = setTimeout(() => {
2160
- E(s), s && H();
2172
+ const V = setTimeout(() => {
2173
+ N(s), s && M();
2161
2174
  }, 30);
2162
2175
  return () => {
2163
- clearTimeout(B);
2176
+ clearTimeout(V);
2164
2177
  };
2165
2178
  } else
2166
- O(), E(s);
2167
- }, [s, H]);
2168
- const { checkScrollBar: w } = Kr(d);
2169
- Nn(R, n), Wr(R, d), Xi(R, n, o, M, i, d, (B, K, se) => {
2170
- const ce = `=${B}`;
2171
- y(), _(ce), T(B), se && (H(), K !== -1 && setTimeout(() => {
2172
- const W = { startOffset: K + 1, endOffset: K + 1 };
2173
- d == null || d.setSelectionRanges([W]);
2174
- const q = d == null ? void 0 : d.render.with(gr);
2175
- q == null || q.scrollToRange({ ...W, collapsed: !0 });
2176
- }, 50), w());
2177
- }), Br(), xn(R, n, i, E, l, Jt);
2178
- const { searchList: k, searchText: Q, handlerFormulaReplace: de, reset: me } = qi(R, M, d), { functionInfo: Ce, paramIndex: J, reset: oe } = Bi(R, S, d);
2179
+ w(), N(s);
2180
+ }, [s, M]);
2181
+ const { checkScrollBar: k } = Kr(g);
2182
+ yn(R, n), Wr(R, g), Xi(R, n, o, x, i, g, (V, Y, ee) => {
2183
+ const U = `=${V}`;
2184
+ P(), m(U), B(V), ee && (M(), Y !== -1 && setTimeout(() => {
2185
+ const j = { startOffset: Y + 1, endOffset: Y + 1 };
2186
+ g == null || g.setSelectionRanges([j]);
2187
+ const ie = g == null ? void 0 : g.render.with(gr);
2188
+ ie == null || ie.scrollToRange({ ...j, collapsed: !0 });
2189
+ }, 50), k());
2190
+ }), Vr(), xn(R, n, i, N, l, en);
2191
+ const { searchList: Q, searchText: me, handlerFormulaReplace: ge, reset: Ie } = qi(R, x, g), { functionInfo: J, paramIndex: se, reset: he } = Vi(R, p, g);
2179
2192
  D(() => {
2180
- if (d) {
2181
- const B = d.input$.subscribe((K) => {
2182
- var ce, W;
2183
- const se = ((W = (ce = K.data.body) == null ? void 0 : ce.dataStream) != null ? W : "").replaceAll(/\n|\r/g, "");
2184
- y(), _(se), T(tr(se), !1);
2193
+ if (g) {
2194
+ const V = g.input$.subscribe((Y) => {
2195
+ var U, j;
2196
+ const ee = ((j = (U = Y.data.body) == null ? void 0 : U.dataStream) != null ? j : "").replaceAll(/\n|\r/g, "");
2197
+ P(), m(ee), B(tr(ee), !1);
2185
2198
  });
2186
2199
  return () => {
2187
- B.unsubscribe();
2200
+ V.unsubscribe();
2188
2201
  };
2189
2202
  }
2190
- }, [d]), $r(g, "=", R, P, F, d), ot(() => {
2191
- let B;
2192
- if (N.current) {
2193
- B = a.register({
2203
+ }, [g]), $r(C, "=", R, F, T, g), ot(() => {
2204
+ let V;
2205
+ if (E.current) {
2206
+ V = a.register({
2194
2207
  autofocus: !0,
2195
- editorUnitId: I,
2208
+ editorUnitId: y,
2196
2209
  isSingle: !0,
2197
2210
  initialSnapshot: {
2198
- id: I,
2211
+ id: y,
2199
2212
  body: { dataStream: `${t}\r
2200
2213
  ` },
2201
2214
  documentStyle: {}
2202
2215
  }
2203
- }, N.current);
2204
- const K = a.getEditor(I);
2205
- C(K);
2216
+ }, E.current);
2217
+ const Y = a.getEditor(y);
2218
+ I(Y);
2206
2219
  }
2207
2220
  return () => {
2208
- B == null || B.dispose();
2221
+ V == null || V.dispose();
2209
2222
  };
2210
2223
  }, []);
2211
- const ae = (B) => {
2212
- const K = de(B);
2213
- if (K) {
2214
- _(`=${K.text}`);
2215
- const se = d == null ? void 0 : d.getSelectionRanges();
2216
- if (se && se.length === 1) {
2217
- const ce = se[0];
2218
- if (ce.collapsed) {
2219
- const W = K.offset;
2224
+ const Pe = (V) => {
2225
+ const Y = ge(V);
2226
+ if (Y) {
2227
+ m(`=${Y.text}`);
2228
+ const ee = g == null ? void 0 : g.getSelectionRanges();
2229
+ if (ee && ee.length === 1) {
2230
+ const U = ee[0];
2231
+ if (U.collapsed) {
2232
+ const j = Y.offset;
2220
2233
  setTimeout(() => {
2221
- d == null || d.setSelectionRanges([{ startOffset: ce.startOffset - W, endOffset: ce.endOffset - W }]);
2234
+ g == null || g.setSelectionRanges([{ startOffset: U.startOffset - j, endOffset: U.endOffset - j }]);
2222
2235
  }, 30);
2223
2236
  }
2224
2237
  }
2225
- me(), H(), T(K.text);
2238
+ Ie(), M(), B(Y.text);
2226
2239
  }
2227
- }, Ae = () => {
2240
+ }, we = () => {
2228
2241
  setTimeout(() => {
2229
- E(!0), c(), H();
2242
+ N(!0), c(), M();
2230
2243
  }, 30);
2231
2244
  };
2232
- return /* @__PURE__ */ p.jsxs("div", { className: Qe.sheetEmbeddingFormulaEditor, children: [
2233
- /* @__PURE__ */ p.jsxs(
2245
+ return /* @__PURE__ */ _.jsxs("div", { className: Qe.sheetEmbeddingFormulaEditor, children: [
2246
+ /* @__PURE__ */ _.jsxs(
2234
2247
  "div",
2235
2248
  {
2236
2249
  className: Lr(Qe.sheetEmbeddingFormulaEditorWrap, {
2237
2250
  [Qe.sheetEmbeddingFormulaEditorActive]: R,
2238
- [Qe.sheetEmbeddingFormulaEditorError]: x
2251
+ [Qe.sheetEmbeddingFormulaEditorError]: b
2239
2252
  }),
2240
- ref: m,
2253
+ ref: S,
2241
2254
  children: [
2242
- /* @__PURE__ */ p.jsx(
2255
+ /* @__PURE__ */ _.jsx(
2243
2256
  "div",
2244
2257
  {
2245
2258
  className: Qe.sheetEmbeddingFormulaEditorText,
2246
- ref: N,
2247
- onMouseUp: Ae
2259
+ ref: E,
2260
+ onMouseUp: we
2248
2261
  }
2249
2262
  ),
2250
- e !== void 0 ? /* @__PURE__ */ p.jsx("div", { className: Qe.sheetEmbeddingFormulaEditorErrorWrap, children: e }) : null
2263
+ e !== void 0 ? /* @__PURE__ */ _.jsx("div", { className: Qe.sheetEmbeddingFormulaEditorErrorWrap, children: e }) : null
2251
2264
  ]
2252
2265
  }
2253
2266
  ),
2254
- /* @__PURE__ */ p.jsx(
2267
+ /* @__PURE__ */ _.jsx(
2255
2268
  Wi,
2256
2269
  {
2257
- editorId: I,
2258
- paramIndex: J,
2259
- functionInfo: Ce,
2270
+ editorId: y,
2271
+ paramIndex: se,
2272
+ functionInfo: J,
2260
2273
  onClose: () => {
2261
- oe(), H();
2274
+ he(), M();
2262
2275
  }
2263
2276
  }
2264
2277
  ),
2265
- /* @__PURE__ */ p.jsx(
2278
+ /* @__PURE__ */ _.jsx(
2266
2279
  hc,
2267
2280
  {
2268
- searchText: Q,
2269
- editorId: I,
2270
- searchList: k,
2271
- onSelect: ae,
2281
+ searchText: me,
2282
+ editorId: y,
2283
+ searchList: Q,
2284
+ onSelect: Pe,
2272
2285
  ref: v
2273
2286
  }
2274
2287
  )
@@ -2279,28 +2292,28 @@ function gc(r) {
2279
2292
  return r.getContextValue(co) && r.getContextValue(lo) && r.getContextValue(ao);
2280
2293
  }
2281
2294
  function Gr(r, e = !1) {
2282
- return !e && !(ke(r == null ? void 0 : r.f) || rt(r == null ? void 0 : r.si)) ? null : typeof (r == null ? void 0 : r.v) == "string" && Ko.has(r.v) ? r.v : null;
2295
+ return !e && !(Ue(r == null ? void 0 : r.f) || rt(r == null ? void 0 : r.si)) ? null : typeof (r == null ? void 0 : r.v) == "string" && Ko.has(r.v) ? r.v : null;
2283
2296
  }
2284
2297
  var Sc = Object.defineProperty, pc = Object.getOwnPropertyDescriptor, _c = (r, e, t, n) => {
2285
2298
  for (var o = n > 1 ? void 0 : n ? pc(e, t) : e, s = r.length - 1, i; s >= 0; s--)
2286
2299
  (i = r[s]) && (o = (n ? i(e, t, o) : i(o)) || o);
2287
2300
  return n && o && Sc(e, t, o), o;
2288
2301
  }, dt = (r, e) => (t, n) => e(t, n, r);
2289
- const en = "SHEET_FORMULA_ALERT", vc = {
2290
- [ue.DIV_BY_ZERO]: "divByZero",
2291
- [ue.NAME]: "name",
2292
- [ue.VALUE]: "value",
2293
- [ue.NUM]: "num",
2294
- [ue.NA]: "na",
2295
- [ue.CYCLE]: "cycle",
2296
- [ue.REF]: "ref",
2297
- [ue.SPILL]: "spill",
2298
- [ue.CALC]: "calc",
2299
- [ue.ERROR]: "error",
2300
- [ue.CONNECT]: "connect",
2301
- [ue.NULL]: "null"
2302
+ const tn = "SHEET_FORMULA_ALERT", vc = {
2303
+ [fe.DIV_BY_ZERO]: "divByZero",
2304
+ [fe.NAME]: "name",
2305
+ [fe.VALUE]: "value",
2306
+ [fe.NUM]: "num",
2307
+ [fe.NA]: "na",
2308
+ [fe.CYCLE]: "cycle",
2309
+ [fe.REF]: "ref",
2310
+ [fe.SPILL]: "spill",
2311
+ [fe.CALC]: "calc",
2312
+ [fe.ERROR]: "error",
2313
+ [fe.CONNECT]: "connect",
2314
+ [fe.NULL]: "null"
2302
2315
  };
2303
- let fn = class extends it {
2316
+ let dn = class extends it {
2304
2317
  constructor(r, e, t, n, o, s) {
2305
2318
  super(), this._context = r, this._hoverManagerService = e, this._cellAlertManagerService = t, this._localeService = n, this._formulaDataModel = o, this._zenZoneService = s, this._init();
2306
2319
  }
@@ -2320,7 +2333,7 @@ let fn = class extends it {
2320
2333
  this._hideAlert();
2321
2334
  return;
2322
2335
  }
2323
- const u = this._cellAlertManagerService.currentAlert.get(en), a = (s = u == null ? void 0 : u.alert) == null ? void 0 : s.location;
2336
+ const u = this._cellAlertManagerService.currentAlert.get(tn), a = (s = u == null ? void 0 : u.alert) == null ? void 0 : s.location;
2324
2337
  if (a && a.row === r.location.row && a.col === r.location.col && a.subUnitId === r.location.subUnitId && a.unitId === r.location.unitId)
2325
2338
  return;
2326
2339
  this._cellAlertManagerService.showAlert({
@@ -2330,7 +2343,7 @@ let fn = class extends it {
2330
2343
  location: r.location,
2331
2344
  width: 200,
2332
2345
  height: 74,
2333
- key: en
2346
+ key: tn
2334
2347
  });
2335
2348
  return;
2336
2349
  }
@@ -2344,16 +2357,16 @@ let fn = class extends it {
2344
2357
  }));
2345
2358
  }
2346
2359
  _hideAlert() {
2347
- this._cellAlertManagerService.removeAlert(en);
2360
+ this._cellAlertManagerService.removeAlert(tn);
2348
2361
  }
2349
2362
  };
2350
- fn = _c([
2351
- dt(1, V(Oo)),
2352
- dt(2, V(Ao)),
2353
- dt(3, V(Ye)),
2354
- dt(4, V(Ut)),
2363
+ dn = _c([
2364
+ dt(1, q(Oo)),
2365
+ dt(2, q(Ao)),
2366
+ dt(3, q(Ye)),
2367
+ dt(4, q(Ut)),
2355
2368
  dt(5, Rs)
2356
- ], fn);
2369
+ ], dn);
2357
2370
  var Cc = Object.defineProperty, Rc = Object.getOwnPropertyDescriptor, Ic = (r, e, t, n) => {
2358
2371
  for (var o = n > 1 ? void 0 : n ? Rc(e, t) : e, s = r.length - 1, i; s >= 0; s--)
2359
2372
  (i = r[s]) && (o = (n ? i(e, t, o) : i(o)) || o);
@@ -2367,7 +2380,7 @@ let Tt = class extends it {
2367
2380
  const r = {
2368
2381
  type: $n.FORMULA,
2369
2382
  priority: 1001,
2370
- match: (e) => ke(e == null ? void 0 : e.f) || rt(e == null ? void 0 : e.si),
2383
+ match: (e) => Ue(e == null ? void 0 : e.f) || rt(e == null ? void 0 : e.si),
2371
2384
  isContinue: (e, t) => e.type === $n.FORMULA,
2372
2385
  applyFunctions: {
2373
2386
  [Po.COPY]: (e, t, n, o) => {
@@ -2382,23 +2395,23 @@ let Tt = class extends it {
2382
2395
  var l, h;
2383
2396
  const s = bc(o), i = [], c = /* @__PURE__ */ new Map();
2384
2397
  for (let f = 1; f <= e; f++) {
2385
- const u = (f - 1) % r.length, a = $e.deepClone(r[u]);
2398
+ const u = (f - 1) % r.length, a = ke.deepClone(r[u]);
2386
2399
  if (a) {
2387
- const m = ((l = r[u]) == null ? void 0 : l.f) || "", S = ((h = r[u]) == null ? void 0 : h.si) || "", _ = ke(m);
2400
+ const d = ((l = r[u]) == null ? void 0 : l.f) || "", S = ((h = r[u]) == null ? void 0 : h.si) || "", p = Ue(d);
2388
2401
  if (rt(S))
2389
2402
  a.si = S, a.f = null, a.v = null, a.p = null, a.t = null, i.push(a);
2390
- else if (_) {
2391
- let v = c.get(u);
2392
- if (v)
2393
- a.si = v, a.f = null, a.v = null, a.p = null, a.t = null;
2403
+ else if (p) {
2404
+ let C = c.get(u);
2405
+ if (C)
2406
+ a.si = C, a.f = null, a.v = null, a.p = null, a.t = null;
2394
2407
  else {
2395
- v = $e.generateRandomId(6), c.set(u, v);
2396
- const { offsetX: d, offsetY: C } = Ec(s, e, t), R = this._lexerTreeBuilder.moveFormulaRefOffset(
2397
- m,
2408
+ C = ke.generateRandomId(6), c.set(u, C);
2409
+ const { offsetX: v, offsetY: g } = Ec(s, e, t), I = this._lexerTreeBuilder.moveFormulaRefOffset(
2398
2410
  d,
2399
- C
2411
+ v,
2412
+ g
2400
2413
  );
2401
- a.si = v, a.f = R, a.v = null, a.p = null, a.t = null;
2414
+ a.si = C, a.f = I, a.v = null, a.p = null, a.t = null;
2402
2415
  }
2403
2416
  i.push(a);
2404
2417
  }
@@ -2409,21 +2422,21 @@ let Tt = class extends it {
2409
2422
  };
2410
2423
  Tt = Ic([
2411
2424
  rr(0, wo),
2412
- rr(1, V(je))
2425
+ rr(1, q(Oe))
2413
2426
  ], Tt);
2414
2427
  function Ec(r, e, t) {
2415
2428
  let n = 0, o = 0;
2416
2429
  switch (t) {
2417
- case te.UP:
2430
+ case ne.UP:
2418
2431
  o = -r * e;
2419
2432
  break;
2420
- case te.RIGHT:
2433
+ case ne.RIGHT:
2421
2434
  n = r;
2422
2435
  break;
2423
- case te.DOWN:
2436
+ case ne.DOWN:
2424
2437
  o = r;
2425
2438
  break;
2426
- case te.LEFT:
2439
+ case ne.LEFT:
2427
2440
  n = -r * e;
2428
2441
  break;
2429
2442
  }
@@ -2501,25 +2514,25 @@ let Ft = class extends it {
2501
2514
  }
2502
2515
  };
2503
2516
  Ft = xc([
2504
- mt(0, be),
2505
- mt(1, V(je)),
2517
+ mt(0, ye),
2518
+ mt(1, q(Oe)),
2506
2519
  mt(2, Do),
2507
- mt(3, V(Dt)),
2508
- mt(4, V(Ut))
2520
+ mt(3, q(Dt)),
2521
+ mt(4, q(Ut))
2509
2522
  ], Ft);
2510
2523
  function Fc(r, e, t, n, o, s, i, c, l = !1, h) {
2511
- const f = [], u = [], a = Mc(r, e, t, n, s, i, c, h), m = {
2524
+ const f = [], u = [], a = Mc(r, e, t, n, s, i, c, h), d = {
2512
2525
  unitId: r,
2513
2526
  subUnitId: e,
2514
2527
  cellValue: a.getData()
2515
2528
  };
2516
2529
  f.push({
2517
2530
  id: qn.id,
2518
- params: m
2531
+ params: d
2519
2532
  });
2520
2533
  const S = ds(
2521
2534
  o,
2522
- m
2535
+ d
2523
2536
  );
2524
2537
  return u.push({
2525
2538
  id: qn.id,
@@ -2535,96 +2548,96 @@ function Mc(r, e, t, n, o, s, i, c) {
2535
2548
  function Oc(r, e, t, n, o) {
2536
2549
  const s = new vt(), i = o.getSheetFormulaData(r, e);
2537
2550
  return n.forValue((c, l, h) => {
2538
- var m;
2551
+ var d;
2539
2552
  const f = t.rows[c], u = t.cols[l], a = {};
2540
- ke(h.v) ? (a.v = null, a.f = `${h.v}`, a.si = null, a.p = null, s.setValue(f, u, a)) : (m = i == null ? void 0 : i[f]) != null && m[u] && (a.v = h.v, a.f = null, a.si = null, a.p = null, s.setValue(f, u, a));
2553
+ Ue(h.v) ? (a.v = null, a.f = `${h.v}`, a.si = null, a.p = null, s.setValue(f, u, a)) : (d = i == null ? void 0 : i[f]) != null && d[u] && (a.v = h.v, a.f = null, a.si = null, a.p = null, s.setValue(f, u, a));
2541
2554
  }), s;
2542
2555
  }
2543
2556
  function Ac(r, e, t, n, o, s) {
2544
2557
  var h, f;
2545
2558
  const i = new vt(), c = (f = (h = o.getArrayFormulaCellData()) == null ? void 0 : h[s.unitId]) == null ? void 0 : f[s.subUnitId], l = o.getSheetFormulaData(r, e);
2546
- return n.forValue((u, a, m) => {
2547
- var C, R;
2548
- const S = s.range.rows[u % s.range.rows.length], _ = s.range.cols[a % s.range.cols.length], g = t.rows[u], v = t.cols[a], d = {};
2549
- if (ke(m.f) || rt(m.si))
2550
- d.v = m.v, d.f = null, d.si = null, d.p = null, i.setValue(g, v, d);
2551
- else if ((C = c == null ? void 0 : c[S]) != null && C[_]) {
2552
- const E = c[S][_];
2553
- d.v = E.v, d.f = null, d.si = null, d.p = null, i.setValue(g, v, d);
2554
- } else if ((R = l == null ? void 0 : l[g]) != null && R[v]) {
2555
- if (d.v = m.v, d.f = null, d.si = null, d.p = null, m.p) {
2556
- const E = Zr(m);
2557
- E && (d.v = E);
2559
+ return n.forValue((u, a, d) => {
2560
+ var g, I;
2561
+ const S = s.range.rows[u % s.range.rows.length], p = s.range.cols[a % s.range.cols.length], m = t.rows[u], C = t.cols[a], v = {};
2562
+ if (Ue(d.f) || rt(d.si))
2563
+ v.v = d.v, v.f = null, v.si = null, v.p = null, i.setValue(m, C, v);
2564
+ else if ((g = c == null ? void 0 : c[S]) != null && g[p]) {
2565
+ const R = c[S][p];
2566
+ v.v = R.v, v.f = null, v.si = null, v.p = null, i.setValue(m, C, v);
2567
+ } else if ((I = l == null ? void 0 : l[m]) != null && I[C]) {
2568
+ if (v.v = d.v, v.f = null, v.si = null, v.p = null, d.p) {
2569
+ const R = Zr(d);
2570
+ R && (v.v = R);
2558
2571
  }
2559
- i.setValue(g, v, d);
2572
+ i.setValue(m, C, v);
2560
2573
  }
2561
2574
  }), i;
2562
2575
  }
2563
2576
  function Pc(r, e, t, n, o, s, i) {
2564
2577
  const c = new vt(), l = /* @__PURE__ */ new Map();
2565
2578
  return n.forValue((h, f, u) => {
2566
- const a = t.rows[h], m = t.cols[f], S = {};
2579
+ const a = t.rows[h], d = t.cols[f], S = {};
2567
2580
  if (rt(u.si)) {
2568
2581
  if (i.unitId !== r || i.subUnitId !== e) {
2569
- const _ = s.getFormulaStringByCell(
2582
+ const p = s.getFormulaStringByCell(
2570
2583
  i.range.rows[h % i.range.rows.length],
2571
2584
  i.range.cols[f % i.range.cols.length],
2572
2585
  i.subUnitId,
2573
2586
  i.unitId
2574
- ), g = t.cols[f] - i.range.cols[f % i.range.cols.length], v = t.rows[h] - i.range.rows[h % i.range.rows.length], d = o.moveFormulaRefOffset(_ || "", g, v);
2575
- S.si = null, S.f = d;
2587
+ ), m = t.cols[f] - i.range.cols[f % i.range.cols.length], C = t.rows[h] - i.range.rows[h % i.range.rows.length], v = o.moveFormulaRefOffset(p || "", m, C);
2588
+ S.si = null, S.f = v;
2576
2589
  } else
2577
2590
  S.si = u.si, S.f = null;
2578
- S.v = null, S.p = null, c.setValue(a, m, S);
2579
- } else if (ke(u.f)) {
2580
- const _ = `${h % i.range.rows.length}_${f % i.range.cols.length}`;
2581
- let g = l.get(_);
2582
- if (g)
2583
- S.si = g, S.f = null;
2591
+ S.v = null, S.p = null, c.setValue(a, d, S);
2592
+ } else if (Ue(u.f)) {
2593
+ const p = `${h % i.range.rows.length}_${f % i.range.cols.length}`;
2594
+ let m = l.get(p);
2595
+ if (m)
2596
+ S.si = m, S.f = null;
2584
2597
  else {
2585
- g = $e.generateRandomId(6), l.set(_, g);
2586
- const v = t.cols[f] - i.range.cols[f % i.range.cols.length], d = t.rows[h] - i.range.rows[h % i.range.rows.length], C = o.moveFormulaRefOffset(u.f || "", v, d);
2587
- S.si = g, S.f = C;
2598
+ m = ke.generateRandomId(6), l.set(p, m);
2599
+ const C = t.cols[f] - i.range.cols[f % i.range.cols.length], v = t.rows[h] - i.range.rows[h % i.range.rows.length], g = o.moveFormulaRefOffset(u.f || "", C, v);
2600
+ S.si = m, S.f = g;
2588
2601
  }
2589
- S.v = null, S.p = null, c.setValue(a, m, S);
2602
+ S.v = null, S.p = null, c.setValue(a, d, S);
2590
2603
  } else {
2591
2604
  if (S.v = u.v, S.f = null, S.si = null, S.p = null, u.p) {
2592
- const _ = Zr(u);
2593
- _ && (S.v = _);
2605
+ const p = Zr(u);
2606
+ p && (S.v = p);
2594
2607
  }
2595
- c.setValue(a, m, S);
2608
+ c.setValue(a, d, S);
2596
2609
  }
2597
2610
  }), c;
2598
2611
  }
2599
2612
  function wc(r, e, t, n, o, s, i) {
2600
2613
  const c = new vt(), l = /* @__PURE__ */ new Map(), h = s.getSheetFormulaData(r, e);
2601
2614
  return n.forValue((f, u, a) => {
2602
- var g;
2603
- const m = t.rows[f], S = t.cols[u], _ = {};
2615
+ var m;
2616
+ const d = t.rows[f], S = t.cols[u], p = {};
2604
2617
  if (rt(a.si)) {
2605
2618
  if (i.unitId !== r || i.subUnitId !== e) {
2606
- const v = s.getFormulaStringByCell(
2619
+ const C = s.getFormulaStringByCell(
2607
2620
  i.range.rows[f % i.range.rows.length],
2608
2621
  i.range.cols[u % i.range.cols.length],
2609
2622
  i.subUnitId,
2610
2623
  i.unitId
2611
- ), d = t.cols[u] - i.range.cols[u % i.range.cols.length], C = t.rows[f] - i.range.rows[f % i.range.rows.length], R = o.moveFormulaRefOffset(v || "", d, C);
2612
- _.si = null, _.f = R;
2624
+ ), v = t.cols[u] - i.range.cols[u % i.range.cols.length], g = t.rows[f] - i.range.rows[f % i.range.rows.length], I = o.moveFormulaRefOffset(C || "", v, g);
2625
+ p.si = null, p.f = I;
2613
2626
  } else
2614
- _.si = a.si, _.f = null;
2615
- _.v = null, _.p = null, c.setValue(m, S, _);
2616
- } else if (ke(a.f)) {
2617
- const v = `${f % i.range.rows.length}_${u % i.range.cols.length}`;
2618
- let d = l.get(v);
2619
- if (d)
2620
- _.si = d, _.f = null;
2627
+ p.si = a.si, p.f = null;
2628
+ p.v = null, p.p = null, c.setValue(d, S, p);
2629
+ } else if (Ue(a.f)) {
2630
+ const C = `${f % i.range.rows.length}_${u % i.range.cols.length}`;
2631
+ let v = l.get(C);
2632
+ if (v)
2633
+ p.si = v, p.f = null;
2621
2634
  else {
2622
- d = $e.generateRandomId(6), l.set(v, d);
2623
- const C = t.cols[u] - i.range.cols[u % i.range.cols.length], R = t.rows[f] - i.range.rows[f % i.range.rows.length], E = o.moveFormulaRefOffset(a.f || "", C, R);
2624
- _.si = d, _.f = E;
2635
+ v = ke.generateRandomId(6), l.set(C, v);
2636
+ const g = t.cols[u] - i.range.cols[u % i.range.cols.length], I = t.rows[f] - i.range.rows[f % i.range.rows.length], R = o.moveFormulaRefOffset(a.f || "", g, I);
2637
+ p.si = v, p.f = R;
2625
2638
  }
2626
- _.v = null, _.p = null, c.setValue(m, S, _);
2627
- } else (g = h == null ? void 0 : h[m]) != null && g[S] && (_.v = a.v, _.f = null, _.si = null, _.p = a.p, c.setValue(m, S, _));
2639
+ p.v = null, p.p = null, c.setValue(d, S, p);
2640
+ } else (m = h == null ? void 0 : h[d]) != null && m[S] && (p.v = a.v, p.f = null, p.si = null, p.p = a.p, c.setValue(d, S, p));
2628
2641
  }), c;
2629
2642
  }
2630
2643
  function Zr(r) {
@@ -2644,8 +2657,8 @@ var Lc = Object.defineProperty, Dc = Object.getOwnPropertyDescriptor, $c = (r, e
2644
2657
  let Mt = class extends it {
2645
2658
  constructor(e, t, n, o, s, i, c, l) {
2646
2659
  super();
2647
- j(this, "_previousShape");
2648
- j(this, "_skeleton");
2660
+ W(this, "_previousShape");
2661
+ W(this, "_skeleton");
2649
2662
  this._context = e, this._sheetInterceptorService = t, this._formulaDataModel = n, this._themeService = o, this._renderManagerService = s, this._sheetSkeletonManagerService = i, this._commandService = c, this._logService = l, this._initSkeletonChangeListener(), this._initInterceptorEditorStart(), this._commandExecutedListener();
2650
2663
  }
2651
2664
  _initSkeletonChangeListener() {
@@ -2676,16 +2689,16 @@ let Mt = class extends it {
2676
2689
  ms,
2677
2690
  {
2678
2691
  handler: (e, t, n) => {
2679
- var S, _, g, v;
2692
+ var S, p, m, C;
2680
2693
  const { row: o, col: s, unitId: i, subUnitId: c, worksheet: l } = t, h = this._formulaDataModel.getArrayFormulaRange(), f = this._formulaDataModel.getArrayFormulaCellData();
2681
2694
  if (this._removeArrayFormulaRangeShape(), e == null)
2682
2695
  return n(e);
2683
2696
  let u = null;
2684
2697
  const a = this._formulaDataModel.getFormulaStringByCell(o, s, c, i);
2685
- if (a !== null && (u = { f: a }), e.v != null && e.v !== "" && ((g = (_ = (S = f[i]) == null ? void 0 : S[c]) == null ? void 0 : _[o]) == null ? void 0 : g[s]) == null)
2698
+ if (a !== null && (u = { f: a }), e.v != null && e.v !== "" && ((m = (p = (S = f[i]) == null ? void 0 : S[c]) == null ? void 0 : p[o]) == null ? void 0 : m[s]) == null)
2686
2699
  return u ? { ...e, ...u } : n(e);
2687
- const m = (v = h == null ? void 0 : h[i]) == null ? void 0 : v[c];
2688
- return m != null && (u = this._displayArrayFormulaRangeShape(m, o, s, i, c, l, u)), u ? { ...e, ...u } : n(e);
2700
+ const d = (C = h == null ? void 0 : h[i]) == null ? void 0 : C[c];
2701
+ return d != null && (u = this._displayArrayFormulaRangeShape(d, o, s, i, c, l, u)), u ? { ...e, ...u } : n(e);
2689
2702
  }
2690
2703
  }
2691
2704
  )
@@ -2707,19 +2720,19 @@ let Mt = class extends it {
2707
2720
  _displayArrayFormulaRangeShape(e, t, n, o, s, i, c) {
2708
2721
  const l = this._formulaDataModel.getSheetFormulaData(o, s);
2709
2722
  return new vt(e).forValue((h, f, u) => {
2710
- var g;
2723
+ var m;
2711
2724
  if (u == null)
2712
2725
  return !0;
2713
- const { startRow: a, startColumn: m, endRow: S, endColumn: _ } = u;
2726
+ const { startRow: a, startColumn: d, endRow: S, endColumn: p } = u;
2714
2727
  if (h === t && f === n)
2715
2728
  return this._createArrayFormulaRangeShape(u, o), !1;
2716
- if (t >= a && t <= S && n >= m && n <= _) {
2717
- const v = i.getCell(a, m);
2718
- if ((v == null ? void 0 : v.v) === ue.SPILL)
2729
+ if (t >= a && t <= S && n >= d && n <= p) {
2730
+ const C = i.getCell(a, d);
2731
+ if ((C == null ? void 0 : C.v) === fe.SPILL)
2719
2732
  return;
2720
- const d = (g = l == null ? void 0 : l[h]) == null ? void 0 : g[f];
2721
- return d == null || d.f == null ? !0 : (c == null && (c = {
2722
- f: d.f,
2733
+ const v = (m = l == null ? void 0 : l[h]) == null ? void 0 : m[f];
2734
+ return v == null || v.f == null ? !0 : (c == null && (c = {
2735
+ f: v.f,
2723
2736
  isInArrayFormulaRange: !0
2724
2737
  }), this._createArrayFormulaRangeShape(u, o), !1);
2725
2738
  }
@@ -2739,7 +2752,7 @@ let Mt = class extends it {
2739
2752
  fill: new ar(i.colorWhite).setAlpha(0).toString(),
2740
2753
  widgets: {}
2741
2754
  }
2742
- }, l = on(c, o), { rowHeaderWidth: h, columnHeaderHeight: f } = o, u = new dr(s, $o.FORMULA_EDITOR_SHOW, this._themeService, {
2755
+ }, l = sn(c, o), { rowHeaderWidth: h, columnHeaderHeight: f } = o, u = new dr(s, $o.FORMULA_EDITOR_SHOW, this._themeService, {
2743
2756
  highlightHeader: !1,
2744
2757
  rowHeaderWidth: h,
2745
2758
  columnHeaderHeight: f
@@ -2783,12 +2796,12 @@ let Mt = class extends it {
2783
2796
  }
2784
2797
  };
2785
2798
  Mt = $c([
2786
- qe(1, V(pr)),
2787
- qe(2, V(Ut)),
2788
- qe(3, V(_t)),
2789
- qe(4, fe),
2790
- qe(5, V(kt)),
2791
- qe(6, Ee),
2799
+ qe(1, q(pr)),
2800
+ qe(2, q(Ut)),
2801
+ qe(3, q(_t)),
2802
+ qe(4, de),
2803
+ qe(5, q(kt)),
2804
+ qe(6, Ne),
2792
2805
  qe(7, ho)
2793
2806
  ], Mt);
2794
2807
  var kc = Object.defineProperty, Uc = Object.getOwnPropertyDescriptor, jc = (r, e, t, n) => {
@@ -2825,18 +2838,18 @@ let Ot = class extends fo {
2825
2838
  }
2826
2839
  };
2827
2840
  Ot = jc([
2828
- or(0, V(pr)),
2829
- or(1, V(Ut))
2841
+ or(0, q(pr)),
2842
+ or(1, q(Ut))
2830
2843
  ], Ot);
2831
2844
  function Wc() {
2832
- const r = A(vs), e = A(Ee), t = dn(r.progress$), n = sn(() => {
2845
+ const r = A(vs), e = A(Ne), t = mn(r.progress$), n = cn(() => {
2833
2846
  e.executeCommand(Go.id);
2834
- }, [e]), o = sn(() => {
2847
+ }, [e]), o = cn(() => {
2835
2848
  r.clearProgress();
2836
2849
  }, [r]);
2837
- return /* @__PURE__ */ p.jsx(Is, { progress: t, onTerminate: n, onClearProgress: o });
2850
+ return /* @__PURE__ */ _.jsx(Is, { progress: t, onTerminate: n, onClearProgress: o });
2838
2851
  }
2839
- const Vc = (r, e = 100) => {
2852
+ const Bc = (r, e = 100) => {
2840
2853
  D(() => {
2841
2854
  let t = null;
2842
2855
  const n = () => {
@@ -2848,8 +2861,8 @@ const Vc = (r, e = 100) => {
2848
2861
  t !== null && clearTimeout(t), window.removeEventListener("scroll", n), window.removeEventListener("resize", n);
2849
2862
  };
2850
2863
  }, [r, e]);
2851
- }, Bc = "univer-formula-help-function", qc = "univer-formula-help-function-title", Kc = "univer-formula-help-function-title-icons", zc = "univer-formula-help-function-title-icon", Yc = "univer-formula-help-function-content", Gc = "univer-formula-help-function-content-inner", Zc = "univer-formula-help-function-content-params", Xc = "univer-formula-help-function-content-params-title", Qc = "univer-formula-help-function-content-params-detail", Jc = "univer-formula-help-function-active", el = "univer-formula-help-decorator", tl = "univer-formula-help-param", nl = "univer-formula-help-param-prefix", rl = "univer-formula-help-param-item", ol = "univer-formula-help-param-active", ne = {
2852
- formulaHelpFunction: Bc,
2864
+ }, Vc = "univer-formula-help-function", qc = "univer-formula-help-function-title", Kc = "univer-formula-help-function-title-icons", zc = "univer-formula-help-function-title-icon", Yc = "univer-formula-help-function-content", Gc = "univer-formula-help-function-content-inner", Zc = "univer-formula-help-function-content-params", Xc = "univer-formula-help-function-content-params-title", Qc = "univer-formula-help-function-content-params-detail", Jc = "univer-formula-help-function-active", el = "univer-formula-help-decorator", tl = "univer-formula-help-param", nl = "univer-formula-help-param-prefix", rl = "univer-formula-help-param-item", ol = "univer-formula-help-param-active", re = {
2865
+ formulaHelpFunction: Vc,
2853
2866
  formulaHelpFunctionTitle: qc,
2854
2867
  formulaHelpFunctionTitleIcons: Kc,
2855
2868
  formulaHelpFunctionTitleIcon: zc,
@@ -2866,151 +2879,151 @@ const Vc = (r, e = 100) => {
2866
2879
  formulaHelpParamActive: ol
2867
2880
  };
2868
2881
  function sl() {
2869
- const [r, e] = $(!1), [t, n] = $(!0), [o, s] = $(!0), [i, c] = $(0), [l, h] = $([0, 0]), [f, u] = $({ left: 0, top: 0 }), [a, m] = $(null), S = A(lt), _ = A(Ye), g = _.t("formula.prompt.required"), v = _.t("formula.prompt.optional"), d = A(be), C = A(ve), R = A(Wt), E = go();
2870
- Vc(N), D(() => {
2871
- const M = S.help$.subscribe((P) => {
2872
- const { visible: F, paramIndex: T, functionInfo: H } = P;
2882
+ const [r, e] = $(!1), [t, n] = $(!0), [o, s] = $(!0), [i, c] = $(0), [l, h] = $([0, 0]), [f, u] = $({ left: 0, top: 0 }), [a, d] = $(null), S = A(lt), p = A(Ye), m = p.t("formula.prompt.required"), C = p.t("formula.prompt.optional"), v = A(ye), g = A(Re), I = A(Wt), R = go();
2883
+ Bc(N), D(() => {
2884
+ const O = S.help$.subscribe((P) => {
2885
+ const { visible: F, paramIndex: T, functionInfo: B } = P;
2873
2886
  if (!F) {
2874
2887
  e(F);
2875
2888
  return;
2876
2889
  }
2877
- const O = I();
2878
- if (O == null)
2890
+ const M = E();
2891
+ if (M == null)
2879
2892
  return;
2880
- const { left: w, top: U, height: k } = O;
2881
- H.description === "" && H.functionParameter.length === 0 || (h([w, U + k]), c(T), m(H), u({ left: w, top: U }), e(F));
2882
- }), y = R.scrollEvent$.pipe(Sn(100)).subscribe(N);
2893
+ const { left: w, top: k, height: H } = M;
2894
+ B.description === "" && B.functionParameter.length === 0 || (h([w, k + H]), c(T), d(B), u({ left: w, top: k }), e(F));
2895
+ }), x = I.scrollEvent$.pipe(pn(100)).subscribe(N);
2883
2896
  return () => {
2884
- M == null || M.unsubscribe(), y.unsubscribe();
2897
+ O == null || O.unsubscribe(), x.unsubscribe();
2885
2898
  };
2886
2899
  }, []);
2887
2900
  function N() {
2888
2901
  if (!o)
2889
2902
  return;
2890
- const M = I();
2891
- if (M == null)
2903
+ const O = E();
2904
+ if (O == null)
2892
2905
  return;
2893
- const { left: y, top: P, height: F } = M;
2894
- h([y, P + F]);
2906
+ const { left: x, top: P, height: F } = O;
2907
+ h([x, P + F]);
2895
2908
  }
2896
- function I() {
2897
- const M = d.getCurrentUniverDocInstance();
2898
- if (!M)
2909
+ function E() {
2910
+ const O = v.getCurrentUniverDocInstance();
2911
+ if (!O)
2899
2912
  return;
2900
- const y = M.getUnitId();
2901
- if (!C.isEditor(y))
2913
+ const x = O.getUnitId();
2914
+ if (!g.isEditor(x))
2902
2915
  return;
2903
- const P = C.getEditor(y);
2916
+ const P = g.getEditor(x);
2904
2917
  return P == null ? void 0 : P.getBoundingClientRect();
2905
2918
  }
2906
- function x(M) {
2907
- c(M);
2919
+ function y(O) {
2920
+ c(O);
2908
2921
  }
2909
2922
  function b() {
2910
- s(!o), E.get(Er).focus();
2923
+ s(!o), R.get(Er).focus();
2911
2924
  }
2912
- return /* @__PURE__ */ p.jsx(p.Fragment, { children: o ? /* @__PURE__ */ p.jsx(Bt, { visible: r, offset: l, children: a ? /* @__PURE__ */ p.jsxs("div", { className: ne.formulaHelpFunction, children: [
2913
- /* @__PURE__ */ p.jsxs("div", { className: ne.formulaHelpFunctionTitle, children: [
2914
- /* @__PURE__ */ p.jsx(
2925
+ return /* @__PURE__ */ _.jsx(_.Fragment, { children: o ? /* @__PURE__ */ _.jsx(Vt, { visible: r, offset: l, children: a ? /* @__PURE__ */ _.jsxs("div", { className: re.formulaHelpFunction, children: [
2926
+ /* @__PURE__ */ _.jsxs("div", { className: re.formulaHelpFunctionTitle, children: [
2927
+ /* @__PURE__ */ _.jsx(
2915
2928
  il,
2916
2929
  {
2917
2930
  prefix: a.functionName,
2918
2931
  value: a.functionParameter,
2919
2932
  active: i,
2920
- onClick: x
2933
+ onClick: y
2921
2934
  }
2922
2935
  ),
2923
- /* @__PURE__ */ p.jsxs("div", { className: ne.formulaHelpFunctionTitleIcons, children: [
2924
- /* @__PURE__ */ p.jsx(
2936
+ /* @__PURE__ */ _.jsxs("div", { className: re.formulaHelpFunctionTitleIcons, children: [
2937
+ /* @__PURE__ */ _.jsx(
2925
2938
  "div",
2926
2939
  {
2927
- className: ne.formulaHelpFunctionTitleIcon,
2940
+ className: re.formulaHelpFunctionTitleIcon,
2928
2941
  style: { transform: t ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
2929
2942
  onClick: () => n(!t),
2930
- children: /* @__PURE__ */ p.jsx(En, {})
2943
+ children: /* @__PURE__ */ _.jsx(bn, {})
2931
2944
  }
2932
2945
  ),
2933
- /* @__PURE__ */ p.jsx(
2946
+ /* @__PURE__ */ _.jsx(
2934
2947
  "div",
2935
2948
  {
2936
- className: ne.formulaHelpFunctionTitleIcon,
2949
+ className: re.formulaHelpFunctionTitleIcon,
2937
2950
  onClick: b,
2938
- children: /* @__PURE__ */ p.jsx(qt, {})
2951
+ children: /* @__PURE__ */ _.jsx(qt, {})
2939
2952
  }
2940
2953
  )
2941
2954
  ] })
2942
2955
  ] }),
2943
- /* @__PURE__ */ p.jsx(
2956
+ /* @__PURE__ */ _.jsx(
2944
2957
  "div",
2945
2958
  {
2946
- className: ne.formulaHelpFunctionContent,
2959
+ className: re.formulaHelpFunctionContent,
2947
2960
  style: {
2948
2961
  height: t ? "unset" : 0,
2949
2962
  padding: t ? "revert-layer" : 0
2950
2963
  },
2951
- children: /* @__PURE__ */ p.jsxs("div", { className: ne.formulaHelpFunctionContentInner, children: [
2952
- /* @__PURE__ */ p.jsx(
2953
- tn,
2964
+ children: /* @__PURE__ */ _.jsxs("div", { className: re.formulaHelpFunctionContentInner, children: [
2965
+ /* @__PURE__ */ _.jsx(
2966
+ nn,
2954
2967
  {
2955
- title: _.t("formula.prompt.helpExample"),
2956
- value: `${a.functionName}(${a.functionParameter.map((M) => M.example).join(",")})`
2968
+ title: p.t("formula.prompt.helpExample"),
2969
+ value: `${a.functionName}(${a.functionParameter.map((O) => O.example).join(",")})`
2957
2970
  }
2958
2971
  ),
2959
- /* @__PURE__ */ p.jsx(
2960
- tn,
2972
+ /* @__PURE__ */ _.jsx(
2973
+ nn,
2961
2974
  {
2962
- title: _.t("formula.prompt.helpAbstract"),
2975
+ title: p.t("formula.prompt.helpAbstract"),
2963
2976
  value: a.description
2964
2977
  }
2965
2978
  ),
2966
- a && a.functionParameter && a.functionParameter.map((M, y) => /* @__PURE__ */ p.jsx(
2967
- tn,
2979
+ a && a.functionParameter && a.functionParameter.map((O, x) => /* @__PURE__ */ _.jsx(
2980
+ nn,
2968
2981
  {
2969
- className: i === y ? ne.formulaHelpFunctionActive : "",
2970
- title: M.name,
2971
- value: `${M.require ? g : v} ${M.detail}`
2982
+ className: i === x ? re.formulaHelpFunctionActive : "",
2983
+ title: O.name,
2984
+ value: `${O.require ? m : C} ${O.detail}`
2972
2985
  },
2973
- y
2986
+ x
2974
2987
  ))
2975
2988
  ] })
2976
2989
  }
2977
2990
  )
2978
- ] }) : /* @__PURE__ */ p.jsx(p.Fragment, {}) }) : r ? /* @__PURE__ */ p.jsx(
2991
+ ] }) : /* @__PURE__ */ _.jsx(_.Fragment, {}) }) : r ? /* @__PURE__ */ _.jsx(
2979
2992
  "div",
2980
2993
  {
2981
- className: ne.formulaHelpDecorator,
2994
+ className: re.formulaHelpDecorator,
2982
2995
  onClick: () => s(!o),
2983
2996
  style: { left: f.left - 24, top: f.top },
2984
- children: /* @__PURE__ */ p.jsx(Or, {})
2997
+ children: /* @__PURE__ */ _.jsx(Or, {})
2985
2998
  }
2986
- ) : /* @__PURE__ */ p.jsx(p.Fragment, {}) });
2999
+ ) : /* @__PURE__ */ _.jsx(_.Fragment, {}) });
2987
3000
  }
2988
- const tn = (r) => /* @__PURE__ */ p.jsxs("div", { className: ne.formulaHelpFunctionContentParams, children: [
2989
- /* @__PURE__ */ p.jsx(
3001
+ const nn = (r) => /* @__PURE__ */ _.jsxs("div", { className: re.formulaHelpFunctionContentParams, children: [
3002
+ /* @__PURE__ */ _.jsx(
2990
3003
  "div",
2991
3004
  {
2992
3005
  className: `
2993
- ${ne.formulaHelpFunctionContentParamsTitle}
3006
+ ${re.formulaHelpFunctionContentParamsTitle}
2994
3007
  ${r.className}
2995
3008
  `,
2996
3009
  children: r.title
2997
3010
  }
2998
3011
  ),
2999
- /* @__PURE__ */ p.jsx("div", { className: ne.formulaHelpFunctionContentParamsDetail, children: r.value })
3012
+ /* @__PURE__ */ _.jsx("div", { className: re.formulaHelpFunctionContentParamsDetail, children: r.value })
3000
3013
  ] }), il = (r) => {
3001
3014
  const { prefix: e, value: t, active: n, onClick: o } = r;
3002
- return /* @__PURE__ */ p.jsxs("div", { className: ne.formulaHelpParam, children: [
3003
- /* @__PURE__ */ p.jsxs("span", { className: ne.formulaHelpParamPrefix, children: [
3015
+ return /* @__PURE__ */ _.jsxs("div", { className: re.formulaHelpParam, children: [
3016
+ /* @__PURE__ */ _.jsxs("span", { className: re.formulaHelpParamPrefix, children: [
3004
3017
  e,
3005
3018
  "("
3006
3019
  ] }),
3007
3020
  t && t.map((s, i) => (
3008
3021
  // TODO@Dushusir: more params needs to be active
3009
- /* @__PURE__ */ p.jsxs("span", { className: ne.formulaHelpParamItem, children: [
3010
- /* @__PURE__ */ p.jsx(
3022
+ /* @__PURE__ */ _.jsxs("span", { className: re.formulaHelpParamItem, children: [
3023
+ /* @__PURE__ */ _.jsx(
3011
3024
  "span",
3012
3025
  {
3013
- className: n === i ? ne.formulaHelpFunctionActive : ne.formulaHelpParamActive,
3026
+ className: n === i ? re.formulaHelpFunctionActive : re.formulaHelpParamActive,
3014
3027
  onClick: () => o(i),
3015
3028
  children: Tn(s)
3016
3029
  }
@@ -3020,7 +3033,7 @@ const tn = (r) => /* @__PURE__ */ p.jsxs("div", { className: ne.formulaHelpFunct
3020
3033
  )),
3021
3034
  ")"
3022
3035
  ] });
3023
- }, cl = "univer-formula-search-function", ll = "univer-formula-search-function-item", al = "univer-formula-search-function-item-name", ul = "univer-formula-search-function-item-name-light", hl = "univer-formula-search-function-item-desc", fl = "univer-formula-search-function-item-active", De = {
3036
+ }, cl = "univer-formula-search-function", ll = "univer-formula-search-function-item", al = "univer-formula-search-function-item-name", ul = "univer-formula-search-function-item-name-light", hl = "univer-formula-search-function-item-desc", fl = "univer-formula-search-function-item-active", $e = {
3024
3037
  formulaSearchFunction: cl,
3025
3038
  formulaSearchFunctionItem: ll,
3026
3039
  formulaSearchFunctionItemName: al,
@@ -3029,91 +3042,91 @@ const tn = (r) => /* @__PURE__ */ p.jsxs("div", { className: ne.formulaHelpFunct
3029
3042
  formulaSearchFunctionItemActive: fl
3030
3043
  };
3031
3044
  function dl() {
3032
- const [r, e] = $(!1), [t, n] = $(0), [o, s] = $([0, 0]), [i, c] = $([]), [l, h] = $(""), f = Z(null), u = A(lt), a = A(be), m = A(ve);
3045
+ const [r, e] = $(!1), [t, n] = $(0), [o, s] = $([0, 0]), [i, c] = $([]), [l, h] = $(""), f = Z(null), u = A(lt), a = A(ye), d = A(Re);
3033
3046
  D(() => {
3034
- let d = [], C = 0;
3035
- const R = u.search$.subscribe((I) => {
3036
- const { visible: x, searchText: b, searchList: M } = I;
3037
- if (!x) {
3038
- e(x);
3047
+ let v = [], g = 0;
3048
+ const I = u.search$.subscribe((E) => {
3049
+ const { visible: y, searchText: b, searchList: O } = E;
3050
+ if (!y) {
3051
+ e(y);
3039
3052
  return;
3040
3053
  }
3041
- const y = S();
3042
- if (y == null)
3054
+ const x = S();
3055
+ if (x == null)
3043
3056
  return;
3044
- const { left: P, top: F, height: T } = y;
3045
- h(b), c(M), d = M, s([P, F + T]), e(x), n(0), C = 0;
3046
- }), E = u.navigate$.subscribe((I) => {
3047
- const { direction: x } = I;
3048
- if (x === te.UP) {
3049
- let b = C - 1;
3050
- b = b < 0 ? d.length - 1 : b, n(b), C = b;
3051
- } else if (x === te.DOWN) {
3052
- let b = C + 1;
3053
- b = b >= d.length ? 0 : b, n(b), C = b;
3057
+ const { left: P, top: F, height: T } = x;
3058
+ h(b), c(O), v = O, s([P, F + T]), e(y), n(0), g = 0;
3059
+ }), R = u.navigate$.subscribe((E) => {
3060
+ const { direction: y } = E;
3061
+ if (y === ne.UP) {
3062
+ let b = g - 1;
3063
+ b = b < 0 ? v.length - 1 : b, n(b), g = b;
3064
+ } else if (y === ne.DOWN) {
3065
+ let b = g + 1;
3066
+ b = b >= v.length ? 0 : b, n(b), g = b;
3054
3067
  }
3055
- v(C);
3056
- }), N = u.accept$.subscribe((I) => {
3057
- const x = d[C].name;
3058
- u.acceptFormulaName(x);
3068
+ C(g);
3069
+ }), N = u.accept$.subscribe((E) => {
3070
+ const y = v[g].name;
3071
+ u.acceptFormulaName(y);
3059
3072
  });
3060
3073
  return () => {
3061
- R == null || R.unsubscribe(), E == null || E.unsubscribe(), N == null || N.unsubscribe();
3074
+ I == null || I.unsubscribe(), R == null || R.unsubscribe(), N == null || N.unsubscribe();
3062
3075
  };
3063
3076
  }, []);
3064
3077
  function S() {
3065
- const C = a.getCurrentUniverDocInstance().getUnitId();
3066
- if (!m.isEditor(C))
3078
+ const g = a.getCurrentUniverDocInstance().getUnitId();
3079
+ if (!d.isEditor(g))
3067
3080
  return;
3068
- const R = m.getEditor(C);
3069
- return R == null ? void 0 : R.getBoundingClientRect();
3081
+ const I = d.getEditor(g);
3082
+ return I == null ? void 0 : I.getBoundingClientRect();
3070
3083
  }
3071
- function _(d) {
3072
- n(d);
3084
+ function p(v) {
3085
+ n(v);
3073
3086
  }
3074
- function g() {
3087
+ function m() {
3075
3088
  n(-1);
3076
3089
  }
3077
- function v(d) {
3090
+ function C(v) {
3078
3091
  var P;
3079
- const C = (P = f.current) == null ? void 0 : P.querySelectorAll(`.${De.formulaSearchFunctionItem}`)[d];
3080
- if (!C) return;
3081
- const R = C.parentNode;
3082
- if (!R) return;
3083
- const N = R.getBoundingClientRect().top, I = R.offsetHeight, x = C.getBoundingClientRect(), b = x.top, M = x.height;
3084
- if (b >= 0 && b > N && b - N + M <= I)
3092
+ const g = (P = f.current) == null ? void 0 : P.querySelectorAll(`.${$e.formulaSearchFunctionItem}`)[v];
3093
+ if (!g) return;
3094
+ const I = g.parentNode;
3095
+ if (!I) return;
3096
+ const N = I.getBoundingClientRect().top, E = I.offsetHeight, y = g.getBoundingClientRect(), b = y.top, O = y.height;
3097
+ if (b >= 0 && b > N && b - N + O <= E)
3085
3098
  return;
3086
- const y = C.offsetTop - (I - M) / 2;
3087
- R.scrollTo({
3088
- top: y,
3099
+ const x = g.offsetTop - (E - O) / 2;
3100
+ I.scrollTo({
3101
+ top: x,
3089
3102
  behavior: "smooth"
3090
3103
  });
3091
3104
  }
3092
- return i.length > 0 && /* @__PURE__ */ p.jsx(Bt, { visible: r, offset: o, children: /* @__PURE__ */ p.jsx("ul", { className: De.formulaSearchFunction, ref: f, children: i.map((d, C) => /* @__PURE__ */ p.jsxs(
3105
+ return i.length > 0 && /* @__PURE__ */ _.jsx(Vt, { visible: r, offset: o, children: /* @__PURE__ */ _.jsx("ul", { className: $e.formulaSearchFunction, ref: f, children: i.map((v, g) => /* @__PURE__ */ _.jsxs(
3093
3106
  "li",
3094
3107
  {
3095
- className: t === C ? `
3096
- ${De.formulaSearchFunctionItem}
3097
- ${De.formulaSearchFunctionItemActive}
3098
- ` : De.formulaSearchFunctionItem,
3099
- onMouseEnter: () => _(C),
3100
- onMouseLeave: g,
3101
- onClick: () => u.acceptFormulaName(d.name),
3108
+ className: t === g ? `
3109
+ ${$e.formulaSearchFunctionItem}
3110
+ ${$e.formulaSearchFunctionItemActive}
3111
+ ` : $e.formulaSearchFunctionItem,
3112
+ onMouseEnter: () => p(g),
3113
+ onMouseLeave: m,
3114
+ onClick: () => u.acceptFormulaName(v.name),
3102
3115
  children: [
3103
- /* @__PURE__ */ p.jsxs("span", { className: De.formulaSearchFunctionItemName, children: [
3104
- /* @__PURE__ */ p.jsx("span", { className: De.formulaSearchFunctionItemNameLight, children: d.name.substring(0, l.length) }),
3105
- /* @__PURE__ */ p.jsx("span", { children: d.name.slice(l.length) })
3116
+ /* @__PURE__ */ _.jsxs("span", { className: $e.formulaSearchFunctionItemName, children: [
3117
+ /* @__PURE__ */ _.jsx("span", { className: $e.formulaSearchFunctionItemNameLight, children: v.name.substring(0, l.length) }),
3118
+ /* @__PURE__ */ _.jsx("span", { children: v.name.slice(l.length) })
3106
3119
  ] }),
3107
- /* @__PURE__ */ p.jsx("span", { className: De.formulaSearchFunctionItemDesc, children: d.desc })
3120
+ /* @__PURE__ */ _.jsx("span", { className: $e.formulaSearchFunctionItemDesc, children: v.desc })
3108
3121
  ]
3109
3122
  },
3110
- C
3123
+ g
3111
3124
  )) }) });
3112
3125
  }
3113
3126
  function ml() {
3114
- return /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
3115
- /* @__PURE__ */ p.jsx(dl, {}),
3116
- /* @__PURE__ */ p.jsx(sl, {})
3127
+ return /* @__PURE__ */ _.jsxs(_.Fragment, { children: [
3128
+ /* @__PURE__ */ _.jsx(dl, {}),
3129
+ /* @__PURE__ */ _.jsx(sl, {})
3117
3130
  ] });
3118
3131
  }
3119
3132
  const gl = "univer-formula-more-functions", Sl = "univer-formula-more-functions-operation", sr = {
@@ -3122,37 +3135,37 @@ const gl = "univer-formula-more-functions", Sl = "univer-formula-more-functions-
3122
3135
  };
3123
3136
  function Xr(r) {
3124
3137
  const { prefix: e, value: t } = r;
3125
- return /* @__PURE__ */ p.jsxs("div", { children: [
3126
- /* @__PURE__ */ p.jsxs("span", { children: [
3138
+ return /* @__PURE__ */ _.jsxs("div", { children: [
3139
+ /* @__PURE__ */ _.jsxs("span", { children: [
3127
3140
  e,
3128
3141
  "("
3129
3142
  ] }),
3130
- t && t.map((n, o) => /* @__PURE__ */ p.jsxs("span", { children: [
3131
- /* @__PURE__ */ p.jsx("span", { children: Tn(n) }),
3143
+ t && t.map((n, o) => /* @__PURE__ */ _.jsxs("span", { children: [
3144
+ /* @__PURE__ */ _.jsx("span", { children: Tn(n) }),
3132
3145
  o === t.length - 1 ? "" : ","
3133
3146
  ] }, o)),
3134
3147
  ")"
3135
3148
  ] });
3136
3149
  }
3137
- const pl = "univer-formula-function-params", _l = "univer-formula-function-params-title", vl = "univer-formula-function-params-detail", nn = {
3150
+ const pl = "univer-formula-function-params", _l = "univer-formula-function-params-title", vl = "univer-formula-function-params-detail", rn = {
3138
3151
  formulaFunctionParams: pl,
3139
3152
  formulaFunctionParamsTitle: _l,
3140
3153
  formulaFunctionParamsDetail: vl
3141
3154
  };
3142
3155
  function St(r) {
3143
3156
  const { className: e, value: t, title: n } = r;
3144
- return /* @__PURE__ */ p.jsxs("div", { className: nn.formulaFunctionParams, children: [
3145
- /* @__PURE__ */ p.jsx(
3157
+ return /* @__PURE__ */ _.jsxs("div", { className: rn.formulaFunctionParams, children: [
3158
+ /* @__PURE__ */ _.jsx(
3146
3159
  "div",
3147
3160
  {
3148
3161
  className: `
3149
- ${nn.formulaFunctionParamsTitle}
3162
+ ${rn.formulaFunctionParamsTitle}
3150
3163
  ${e}
3151
3164
  `,
3152
3165
  children: n
3153
3166
  }
3154
3167
  ),
3155
- /* @__PURE__ */ p.jsx("div", { className: nn.formulaFunctionParamsDetail, children: t })
3168
+ /* @__PURE__ */ _.jsx("div", { className: rn.formulaFunctionParamsDetail, children: t })
3156
3169
  ] });
3157
3170
  }
3158
3171
  const Cl = "univer-formula-input-params-list", Rl = "univer-formula-input-params-list-item-name", Il = "univer-formula-input-params-list-item-selector", gt = {
@@ -3165,21 +3178,21 @@ function El(r) {
3165
3178
  if (!e) return null;
3166
3179
  $([]);
3167
3180
  const [n, o] = $(e.functionParameter), [s, i] = $(-1);
3168
- return /* @__PURE__ */ p.jsxs("div", { className: gt.formulaInputParams, children: [
3169
- /* @__PURE__ */ p.jsx("div", { className: gt.formulaInputParamsList, children: n.map((c, l) => /* @__PURE__ */ p.jsxs("div", { children: [
3170
- /* @__PURE__ */ p.jsx("div", { className: gt.formulaInputParamsListItemName, children: c.name }),
3171
- /* @__PURE__ */ p.jsx("div", { className: gt.formulaInputParamsListItemSelector })
3181
+ return /* @__PURE__ */ _.jsxs("div", { className: gt.formulaInputParams, children: [
3182
+ /* @__PURE__ */ _.jsx("div", { className: gt.formulaInputParamsList, children: n.map((c, l) => /* @__PURE__ */ _.jsxs("div", { children: [
3183
+ /* @__PURE__ */ _.jsx("div", { className: gt.formulaInputParamsListItemName, children: c.name }),
3184
+ /* @__PURE__ */ _.jsx("div", { className: gt.formulaInputParamsListItemSelector })
3172
3185
  ] }, l)) }),
3173
- /* @__PURE__ */ p.jsx("div", { className: gt.formulaInputParamsInfo, children: /* @__PURE__ */ p.jsx(
3186
+ /* @__PURE__ */ _.jsx("div", { className: gt.formulaInputParamsInfo, children: /* @__PURE__ */ _.jsx(
3174
3187
  St,
3175
3188
  {
3176
- title: s === -1 ? /* @__PURE__ */ p.jsx(Xr, { prefix: e.functionName, value: n }) : n[s].name,
3189
+ title: s === -1 ? /* @__PURE__ */ _.jsx(Xr, { prefix: e.functionName, value: n }) : n[s].name,
3177
3190
  value: s === -1 ? e.description : n[s].detail
3178
3191
  }
3179
3192
  ) })
3180
3193
  ] });
3181
3194
  }
3182
- const bl = "univer-formula-select-function-select", Nl = "univer-formula-select-function-result", yl = "univer-formula-select-function-result-item", xl = "univer-formula-select-function-result-item-name-light", Tl = "univer-formula-select-function-result-item-selected", Fl = "univer-formula-select-function-result-item-active", Ml = "univer-formula-select-function-content", ye = {
3195
+ const bl = "univer-formula-select-function-select", Nl = "univer-formula-select-function-result", yl = "univer-formula-select-function-result-item", xl = "univer-formula-select-function-result-item-name-light", Tl = "univer-formula-select-function-result-item-selected", Fl = "univer-formula-select-function-result-item-active", Ml = "univer-formula-select-function-content", xe = {
3183
3196
  formulaSelectFunctionSelect: bl,
3184
3197
  formulaSelectFunctionResult: Nl,
3185
3198
  formulaSelectFunctionResultItem: yl,
@@ -3189,68 +3202,68 @@ const bl = "univer-formula-select-function-select", Nl = "univer-formula-select-
3189
3202
  formulaSelectFunctionContent: Ml
3190
3203
  };
3191
3204
  function Ol(r) {
3192
- const { onChange: e } = r, t = "-1", [n, o] = $(""), [s, i] = $([]), [c, l] = $(0), [h, f] = $(t), [u, a] = $(0), [m, S] = $(null), _ = A(ct), g = A(Ye), v = A(Wt), d = dn(v.sidebarOptions$), C = Ni(Zo, g);
3193
- C.unshift({
3194
- label: g.t("formula.moreFunctions.allFunctions"),
3205
+ const { onChange: e } = r, t = "-1", [n, o] = $(""), [s, i] = $([]), [c, l] = $(0), [h, f] = $(t), [u, a] = $(0), [d, S] = $(null), p = A(ct), m = A(Ye), C = A(Wt), v = mn(C.sidebarOptions$), g = Ni(Zo, m);
3206
+ g.unshift({
3207
+ label: m.t("formula.moreFunctions.allFunctions"),
3195
3208
  value: t
3196
3209
  });
3197
- const R = g.t("formula.prompt.required"), E = g.t("formula.prompt.optional");
3210
+ const I = m.t("formula.prompt.required"), R = m.t("formula.prompt.optional");
3198
3211
  D(() => {
3199
- x(t);
3212
+ y(t);
3200
3213
  }, []), D(() => {
3201
- I(0);
3214
+ E(0);
3202
3215
  }, [s]), D(() => {
3203
- d != null && d.visible && (o(""), i([]), l(0), f(t), a(0), S(null), x(t));
3204
- }, [d]);
3216
+ v != null && v.visible && (o(""), i([]), l(0), f(t), a(0), S(null), y(t));
3217
+ }, [v]);
3205
3218
  const N = (F) => {
3206
3219
  if (n.trim() === "") return F;
3207
3220
  const T = new RegExp(`(${n.toLocaleUpperCase()})`);
3208
- return F.split(T).filter(Boolean).map((O, w) => O.match(T) ? /* @__PURE__ */ p.jsx("span", { className: ye.formulaSelectFunctionResultItemNameLight, children: O }, w) : O);
3209
- }, I = (F) => {
3221
+ return F.split(T).filter(Boolean).map((M, w) => M.match(T) ? /* @__PURE__ */ _.jsx("span", { className: xe.formulaSelectFunctionResultItemNameLight, children: M }, w) : M);
3222
+ }, E = (F) => {
3210
3223
  if (s.length === 0) {
3211
3224
  S(null);
3212
3225
  return;
3213
3226
  }
3214
3227
  a(F);
3215
- const T = _.getFunctionInfo(s[F].name);
3228
+ const T = p.getFunctionInfo(s[F].name);
3216
3229
  if (!T) {
3217
3230
  S(null);
3218
3231
  return;
3219
3232
  }
3220
3233
  S(T), e(T);
3221
3234
  };
3222
- function x(F) {
3235
+ function y(F) {
3223
3236
  f(F);
3224
- const T = _.getSearchListByType(+F);
3237
+ const T = p.getSearchListByType(+F);
3225
3238
  i(T);
3226
3239
  }
3227
3240
  function b(F) {
3228
3241
  o(F);
3229
- const T = _.getSearchListByName(F);
3242
+ const T = p.getSearchListByName(F);
3230
3243
  i(T);
3231
3244
  }
3232
- function M(F) {
3245
+ function O(F) {
3233
3246
  if (F.stopPropagation(), F.key === "ArrowDown") {
3234
3247
  const T = c + 1;
3235
3248
  l(T === s.length ? 0 : T);
3236
3249
  } else if (F.key === "ArrowUp") {
3237
3250
  const T = c - 1;
3238
3251
  l(T === -1 ? s.length - 1 : T);
3239
- } else F.key === "Enter" && I(c);
3252
+ } else F.key === "Enter" && E(c);
3240
3253
  }
3241
- const y = (F) => {
3254
+ const x = (F) => {
3242
3255
  l(F);
3243
3256
  }, P = () => {
3244
3257
  l(-1);
3245
3258
  };
3246
- return /* @__PURE__ */ p.jsxs("div", { children: [
3247
- /* @__PURE__ */ p.jsxs("div", { className: ye.formulaSelectFunctionSelect, children: [
3248
- /* @__PURE__ */ p.jsx(Os, { value: h, options: C, onChange: x }),
3249
- /* @__PURE__ */ p.jsx(
3259
+ return /* @__PURE__ */ _.jsxs("div", { children: [
3260
+ /* @__PURE__ */ _.jsxs("div", { className: xe.formulaSelectFunctionSelect, children: [
3261
+ /* @__PURE__ */ _.jsx(Os, { value: h, options: g, onChange: y }),
3262
+ /* @__PURE__ */ _.jsx(
3250
3263
  Nr,
3251
3264
  {
3252
- placeholder: g.t("formula.moreFunctions.searchFunctionPlaceholder"),
3253
- onKeyDown: M,
3265
+ placeholder: m.t("formula.moreFunctions.searchFunctionPlaceholder"),
3266
+ onKeyDown: O,
3254
3267
  value: n,
3255
3268
  onChange: b,
3256
3269
  size: "large",
@@ -3258,44 +3271,44 @@ function Ol(r) {
3258
3271
  }
3259
3272
  )
3260
3273
  ] }),
3261
- /* @__PURE__ */ p.jsx("ul", { className: ye.formulaSelectFunctionResult, onKeyDown: M, tabIndex: -1, children: s.map(({ name: F }, T) => /* @__PURE__ */ p.jsxs(
3274
+ /* @__PURE__ */ _.jsx("ul", { className: xe.formulaSelectFunctionResult, onKeyDown: O, tabIndex: -1, children: s.map(({ name: F }, T) => /* @__PURE__ */ _.jsxs(
3262
3275
  "li",
3263
3276
  {
3264
3277
  className: c === T ? `
3265
- ${ye.formulaSelectFunctionResultItem}
3266
- ${ye.formulaSelectFunctionResultItemActive}
3267
- ` : ye.formulaSelectFunctionResultItem,
3268
- onMouseEnter: () => y(T),
3278
+ ${xe.formulaSelectFunctionResultItem}
3279
+ ${xe.formulaSelectFunctionResultItemActive}
3280
+ ` : xe.formulaSelectFunctionResultItem,
3281
+ onMouseEnter: () => x(T),
3269
3282
  onMouseLeave: P,
3270
- onClick: () => I(T),
3283
+ onClick: () => E(T),
3271
3284
  children: [
3272
- u === T && /* @__PURE__ */ p.jsx(Fr, { className: ye.formulaSelectFunctionResultItemSelected }),
3273
- /* @__PURE__ */ p.jsx("span", { className: ye.formulaSelectFunctionResultItemName, children: N(F) })
3285
+ u === T && /* @__PURE__ */ _.jsx(Fr, { className: xe.formulaSelectFunctionResultItemSelected }),
3286
+ /* @__PURE__ */ _.jsx("span", { className: xe.formulaSelectFunctionResultItemName, children: N(F) })
3274
3287
  ]
3275
3288
  },
3276
3289
  T
3277
3290
  )) }),
3278
- m && /* @__PURE__ */ p.jsxs("div", { className: ye.formulaSelectFunctionContent, children: [
3279
- /* @__PURE__ */ p.jsx(St, { title: m.functionName, value: m.description }),
3280
- /* @__PURE__ */ p.jsx(
3291
+ d && /* @__PURE__ */ _.jsxs("div", { className: xe.formulaSelectFunctionContent, children: [
3292
+ /* @__PURE__ */ _.jsx(St, { title: d.functionName, value: d.description }),
3293
+ /* @__PURE__ */ _.jsx(
3281
3294
  St,
3282
3295
  {
3283
- title: g.t("formula.moreFunctions.syntax"),
3284
- value: /* @__PURE__ */ p.jsx(Xr, { prefix: m.functionName, value: m.functionParameter })
3296
+ title: m.t("formula.moreFunctions.syntax"),
3297
+ value: /* @__PURE__ */ _.jsx(Xr, { prefix: d.functionName, value: d.functionParameter })
3285
3298
  }
3286
3299
  ),
3287
- /* @__PURE__ */ p.jsx(
3300
+ /* @__PURE__ */ _.jsx(
3288
3301
  St,
3289
3302
  {
3290
- title: g.t("formula.prompt.helpExample"),
3291
- value: `${m.functionName}(${m.functionParameter.map((F) => F.example).join(",")})`
3303
+ title: m.t("formula.prompt.helpExample"),
3304
+ value: `${d.functionName}(${d.functionParameter.map((F) => F.example).join(",")})`
3292
3305
  }
3293
3306
  ),
3294
- m.functionParameter && m.functionParameter.map((F, T) => /* @__PURE__ */ p.jsx(
3307
+ d.functionParameter && d.functionParameter.map((F, T) => /* @__PURE__ */ _.jsx(
3295
3308
  St,
3296
3309
  {
3297
3310
  title: F.name,
3298
- value: `${F.require ? R : E} ${F.detail}`
3311
+ value: `${F.require ? I : R} ${F.detail}`
3299
3312
  },
3300
3313
  T
3301
3314
  ))
@@ -3303,30 +3316,30 @@ function Ol(r) {
3303
3316
  ] });
3304
3317
  }
3305
3318
  function Al() {
3306
- const r = ko(), [e, t] = $(!0), [n, o] = $(!1), [s, i] = $(null), c = A(Ye), l = A(ve);
3319
+ const r = ko(), [e, t] = $(!0), [n, o] = $(!1), [s, i] = $(null), c = A(Ye), l = A(Re);
3307
3320
  function h() {
3308
3321
  t(!e), o(!n);
3309
3322
  }
3310
3323
  function f() {
3311
3324
  l.setFormula(`=${s == null ? void 0 : s.functionName}(`);
3312
3325
  }
3313
- return /* @__PURE__ */ p.jsxs("div", { className: sr.formulaMoreFunctions, children: [
3314
- e && /* @__PURE__ */ p.jsx(Ol, { onChange: i }),
3315
- n && /* @__PURE__ */ p.jsx(El, { functionInfo: s, onChange: () => {
3326
+ return /* @__PURE__ */ _.jsxs("div", { className: sr.formulaMoreFunctions, children: [
3327
+ e && /* @__PURE__ */ _.jsx(Ol, { onChange: i }),
3328
+ n && /* @__PURE__ */ _.jsx(El, { functionInfo: s, onChange: () => {
3316
3329
  } }),
3317
- /* @__PURE__ */ p.jsxs("div", { className: sr.formulaMoreFunctionsOperation, children: [
3318
- n && /* @__PURE__ */ p.jsx(nt, { type: "primary", size: "small", onClick: h, children: c.t("formula.moreFunctions.next") }),
3319
- n && /* @__PURE__ */ p.jsx(nt, { size: "small", onClick: h, children: c.t("formula.moreFunctions.prev") }),
3320
- e && !!r && /* @__PURE__ */ p.jsx(nt, { type: "primary", size: "small", onClick: f, children: c.t("formula.moreFunctions.confirm") })
3330
+ /* @__PURE__ */ _.jsxs("div", { className: sr.formulaMoreFunctionsOperation, children: [
3331
+ n && /* @__PURE__ */ _.jsx(nt, { type: "primary", size: "small", onClick: h, children: c.t("formula.moreFunctions.next") }),
3332
+ n && /* @__PURE__ */ _.jsx(nt, { size: "small", onClick: h, children: c.t("formula.moreFunctions.prev") }),
3333
+ e && !!r && /* @__PURE__ */ _.jsx(nt, { type: "primary", size: "small", onClick: f, children: c.t("formula.moreFunctions.confirm") })
3321
3334
  ] })
3322
3335
  ] });
3323
3336
  }
3324
3337
  function Pl(r) {
3325
3338
  return {
3326
- id: Cn.id,
3339
+ id: Rn.id,
3327
3340
  icon: "FunctionSingle",
3328
3341
  tooltip: "formula.insert.tooltip",
3329
- type: _n.SELECTOR,
3342
+ type: vn.SELECTOR,
3330
3343
  selections: [
3331
3344
  {
3332
3345
  label: "SUM",
@@ -3360,50 +3373,50 @@ function Pl(r) {
3360
3373
  }
3361
3374
  function wl(r) {
3362
3375
  return {
3363
- id: Rn.id,
3376
+ id: In.id,
3364
3377
  title: "formula.insert.more",
3365
- type: _n.BUTTON
3378
+ type: vn.BUTTON
3366
3379
  };
3367
3380
  }
3368
3381
  function Ll(r) {
3369
- return r.get(be).getCurrentTypeOfUnit$(X.UNIVER_SHEET).pipe(
3370
- rs((n) => n ? r.get(Kn) ? new os((s) => s.next(!r.get(Kn).supportClipboard)) : Vn(!0) : Vn(!0))
3382
+ return r.get(ye).getCurrentTypeOfUnit$(X.UNIVER_SHEET).pipe(
3383
+ rs((n) => n ? r.get(Kn) ? new os((s) => s.next(!r.get(Kn).supportClipboard)) : Bn(!0) : Bn(!0))
3371
3384
  );
3372
3385
  }
3373
3386
  function Dl(r) {
3374
3387
  return {
3375
- id: vn.id,
3376
- type: _n.BUTTON,
3388
+ id: Cn.id,
3389
+ type: vn.BUTTON,
3377
3390
  title: "formula.operation.pasteFormula",
3378
3391
  disabled$: Ll(r).pipe(
3379
3392
  ns(mr(r, { workbookTypes: [_r], rangeTypes: [Rr], worksheetTypes: [Cr, vr] })),
3380
- mn(([e, t]) => e || t)
3393
+ gn(([e, t]) => e || t)
3381
3394
  )
3382
3395
  };
3383
3396
  }
3384
3397
  const $l = {
3385
3398
  [bs.FORMULAS_INSERT]: {
3386
- [Cn.id]: {
3399
+ [Rn.id]: {
3387
3400
  order: 1,
3388
3401
  menuItemFactory: Pl,
3389
- [Rn.id]: {
3402
+ [In.id]: {
3390
3403
  order: 1,
3391
3404
  menuItemFactory: wl
3392
3405
  }
3393
3406
  }
3394
3407
  },
3395
3408
  [Uo]: {
3396
- [vn.id]: {
3409
+ [Cn.id]: {
3397
3410
  order: 4,
3398
3411
  menuItemFactory: Dl
3399
3412
  }
3400
3413
  }
3401
- }, Qr = "meta_key_ctrl_And_Shift", zt = [
3414
+ }, Qr = "meta_key_ctrl_And_Shift", Yt = [
3402
3415
  L.ARROW_DOWN,
3403
3416
  L.ARROW_UP,
3404
3417
  L.ARROW_LEFT,
3405
3418
  L.ARROW_RIGHT
3406
- ], kl = [...zt, L.ENTER, L.TAB, L.ESC];
3419
+ ], kl = [...Yt, L.ENTER, L.TAB, L.ESC];
3407
3420
  function Ul() {
3408
3421
  const r = [];
3409
3422
  for (const e of kl)
@@ -3412,7 +3425,7 @@ function Ul() {
3412
3425
  binding: e,
3413
3426
  preconditions: (t) => Ct(t),
3414
3427
  staticParameters: {
3415
- eventType: pe.Keyboard,
3428
+ eventType: _e.Keyboard,
3416
3429
  keycode: e
3417
3430
  }
3418
3431
  });
@@ -3420,55 +3433,55 @@ function Ul() {
3420
3433
  }
3421
3434
  function jl() {
3422
3435
  const r = [];
3423
- for (const e of zt)
3436
+ for (const e of Yt)
3424
3437
  r.push({
3425
3438
  id: Ge.id,
3426
- binding: e | Ue.SHIFT,
3439
+ binding: e | je.SHIFT,
3427
3440
  preconditions: (t) => Ct(t),
3428
3441
  staticParameters: {
3429
- eventType: pe.Keyboard,
3442
+ eventType: _e.Keyboard,
3430
3443
  keycode: e,
3431
- metaKey: Ue.SHIFT
3444
+ metaKey: je.SHIFT
3432
3445
  }
3433
3446
  });
3434
3447
  return r;
3435
3448
  }
3436
3449
  function Hl() {
3437
3450
  const r = [];
3438
- for (const e of zt)
3451
+ for (const e of Yt)
3439
3452
  r.push({
3440
3453
  id: Ge.id,
3441
- binding: e | Ue.CTRL_COMMAND,
3454
+ binding: e | je.CTRL_COMMAND,
3442
3455
  preconditions: (t) => Ct(t),
3443
3456
  staticParameters: {
3444
- eventType: pe.Keyboard,
3457
+ eventType: _e.Keyboard,
3445
3458
  keycode: e,
3446
- metaKey: Ue.CTRL_COMMAND
3459
+ metaKey: je.CTRL_COMMAND
3447
3460
  }
3448
3461
  });
3449
3462
  return r;
3450
3463
  }
3451
3464
  function Wl() {
3452
3465
  const r = [];
3453
- for (const e of zt)
3466
+ for (const e of Yt)
3454
3467
  r.push({
3455
3468
  id: Ge.id,
3456
- binding: e | Ue.SHIFT | Ue.CTRL_COMMAND,
3469
+ binding: e | je.SHIFT | je.CTRL_COMMAND,
3457
3470
  preconditions: (t) => Ct(t),
3458
3471
  staticParameters: {
3459
- eventType: pe.Keyboard,
3472
+ eventType: _e.Keyboard,
3460
3473
  keycode: e,
3461
3474
  metaKey: Qr
3462
3475
  }
3463
3476
  });
3464
3477
  return r;
3465
3478
  }
3466
- const Vl = {
3467
- id: In.id,
3479
+ const Bl = {
3480
+ id: En.id,
3468
3481
  binding: L.F4,
3469
3482
  preconditions: (r) => Ct(r)
3470
3483
  };
3471
- function Bl() {
3484
+ function Vl() {
3472
3485
  const r = [];
3473
3486
  for (const e of [L.ENTER, L.TAB, L.ARROW_DOWN, L.ARROW_UP])
3474
3487
  r.push({
@@ -3476,7 +3489,7 @@ function Bl() {
3476
3489
  binding: e,
3477
3490
  preconditions: (t) => gc(t),
3478
3491
  staticParameters: {
3479
- eventType: pe.Keyboard,
3492
+ eventType: _e.Keyboard,
3480
3493
  keycode: e,
3481
3494
  isSingleEditor: !0
3482
3495
  }
@@ -3500,13 +3513,13 @@ let At = class extends it {
3500
3513
  }
3501
3514
  _registerCommands() {
3502
3515
  [
3503
- vn,
3504
3516
  Cn,
3505
3517
  Rn,
3518
+ In,
3519
+ hn,
3506
3520
  un,
3507
- an,
3508
3521
  Ge,
3509
- In
3522
+ En
3510
3523
  ].forEach((r) => this.disposeWithMe(this._commandService.registerCommand(r)));
3511
3524
  }
3512
3525
  _registerShortcuts() {
@@ -3515,8 +3528,8 @@ let At = class extends it {
3515
3528
  ...jl(),
3516
3529
  ...Hl(),
3517
3530
  ...Wl(),
3518
- ...Bl(),
3519
- Vl
3531
+ ...Vl(),
3532
+ Bl
3520
3533
  ].forEach((r) => {
3521
3534
  this.disposeWithMe(this._shortcutService.registerShortcut(r));
3522
3535
  });
@@ -3529,55 +3542,55 @@ let At = class extends it {
3529
3542
  }
3530
3543
  };
3531
3544
  At = zl([
3532
- Ke(0, V(Dt)),
3545
+ Ke(0, q(Dt)),
3533
3546
  Ke(1, ys),
3534
- Ke(2, Ee),
3535
- Ke(3, Vt),
3547
+ Ke(2, Ne),
3548
+ Ke(3, Bt),
3536
3549
  Ke(4, xs),
3537
- Ke(5, fe),
3538
- Ke(6, V(br))
3550
+ Ke(5, de),
3551
+ Ke(6, q(br))
3539
3552
  ], At);
3540
3553
  var Yl = Object.defineProperty, Gl = Object.getOwnPropertyDescriptor, Zl = (r, e, t, n) => {
3541
3554
  for (var o = n > 1 ? void 0 : n ? Gl(e, t) : e, s = r.length - 1, i; s >= 0; s--)
3542
3555
  (i = r[s]) && (o = (n ? i(e, t, o) : i(o)) || o);
3543
3556
  return n && o && Yl(e, t, o), o;
3544
- }, ie = (r, e) => (t, n) => e(t, n, r);
3557
+ }, le = (r, e) => (t, n) => e(t, n, r);
3545
3558
  const Xl = [po, $t];
3546
3559
  let Pt = class extends it {
3547
- constructor(e, t, n, o, s, i, c, l, h, f, u, a, m, S, _) {
3560
+ constructor(e, t, n, o, s, i, c, l, h, f, u, a, d, S, p) {
3548
3561
  super();
3549
- j(this, "_listenInputCache", /* @__PURE__ */ new Set());
3550
- j(this, "_formulaRefColors", []);
3551
- j(this, "_previousSequenceNodes");
3552
- j(this, "_previousRangesCount", 0);
3553
- j(this, "_previousInsertRefStringIndex");
3554
- j(this, "_currentInsertRefStringIndex", -1);
3555
- j(this, "_arrowMoveActionState", 0);
3556
- j(this, "_isSelectionMovingRefSelections", []);
3557
- j(this, "_stringColor", "");
3558
- j(this, "_numberColor", "");
3559
- j(this, "_insertSelections", []);
3560
- j(this, "_inputPanelState", 0);
3561
- j(this, "_userCursorMove", !1);
3562
- j(this, "_previousEditorUnitId");
3563
- j(this, "_existsSequenceNode", !1);
3564
- j(this, "_currentlyWorkingRefRenderer", null);
3565
- j(this, "_selectionsChangeDisposables");
3566
- j(this, "_isSelectingMode", !1);
3567
- this._commandService = e, this._contextService = t, this._editorBridgeService = n, this._formulaPromptService = o, this._lexerTreeBuilder = s, this._renderManagerService = i, this._themeService = c, this._sheetsSelectionsService = l, this._refSelectionsService = h, this._univerInstanceService = f, this._descriptionService = u, this._docSelectionManagerService = a, this._contextMenuService = m, this._editorService = S, this._layoutService = _, this._initialize();
3562
+ W(this, "_listenInputCache", /* @__PURE__ */ new Set());
3563
+ W(this, "_formulaRefColors", []);
3564
+ W(this, "_previousSequenceNodes");
3565
+ W(this, "_previousRangesCount", 0);
3566
+ W(this, "_previousInsertRefStringIndex");
3567
+ W(this, "_currentInsertRefStringIndex", -1);
3568
+ W(this, "_arrowMoveActionState", 0);
3569
+ W(this, "_isSelectionMovingRefSelections", []);
3570
+ W(this, "_stringColor", "");
3571
+ W(this, "_numberColor", "");
3572
+ W(this, "_insertSelections", []);
3573
+ W(this, "_inputPanelState", 0);
3574
+ W(this, "_userCursorMove", !1);
3575
+ W(this, "_previousEditorUnitId");
3576
+ W(this, "_existsSequenceNode", !1);
3577
+ W(this, "_currentlyWorkingRefRenderer", null);
3578
+ W(this, "_selectionsChangeDisposables");
3579
+ W(this, "_isSelectingMode", !1);
3580
+ this._commandService = e, this._contextService = t, this._editorBridgeService = n, this._formulaPromptService = o, this._lexerTreeBuilder = s, this._renderManagerService = i, this._themeService = c, this._sheetsSelectionsService = l, this._refSelectionsService = h, this._univerInstanceService = f, this._descriptionService = u, this._docSelectionManagerService = a, this._contextMenuService = d, this._editorService = S, this._layoutService = p, this._initialize();
3568
3581
  }
3569
3582
  // TODO@wzhudev: selection render service would be a render unit, we we cannot
3570
3583
  // easily access it here.
3571
3584
  get _selectionRenderService() {
3572
3585
  return this._renderManagerService.getRenderById(
3573
3586
  this._univerInstanceService.getCurrentUnitForType(X.UNIVER_SHEET).getUnitId()
3574
- ).with(le);
3587
+ ).with(ue);
3575
3588
  }
3576
3589
  /**
3577
3590
  * For multiple sheet instances.
3578
3591
  */
3579
3592
  get _allSelectionRenderServices() {
3580
- return this._renderManagerService.getAllRenderersOfType(X.UNIVER_SHEET).map((e) => e.with(le));
3593
+ return this._renderManagerService.getAllRenderersOfType(X.UNIVER_SHEET).map((e) => e.with(ue));
3581
3594
  }
3582
3595
  dispose() {
3583
3596
  this._formulaRefColors = [], this._resetTemp();
@@ -3608,7 +3621,7 @@ let Pt = class extends it {
3608
3621
  _initialCursorSync() {
3609
3622
  this.disposeWithMe(
3610
3623
  this._docSelectionManagerService.textSelection$.pipe(
3611
- tt((e) => !Ve(e.unitId) && !Be(e.unitId))
3624
+ tt((e) => !Be(e.unitId) && !Ve(e.unitId))
3612
3625
  ).subscribe((e) => {
3613
3626
  var o;
3614
3627
  if ((e == null ? void 0 : e.unitId) == null)
@@ -3625,7 +3638,7 @@ let Pt = class extends it {
3625
3638
  const e = [L.ARROW_DOWN, L.ARROW_UP, L.ARROW_LEFT, L.ARROW_RIGHT, L.CTRL, L.SHIFT];
3626
3639
  this._univerInstanceService.getCurrentTypeOfUnit$(X.UNIVER_DOC).pipe(tt((t) => {
3627
3640
  const n = (t == null ? void 0 : t.getUnitId()) || "";
3628
- return !Ve(n) && !Be(n);
3641
+ return !Be(n) && !Ve(n);
3629
3642
  })).subscribe((t) => {
3630
3643
  var i;
3631
3644
  const n = t == null ? void 0 : t.getUnitId();
@@ -3646,7 +3659,7 @@ let Pt = class extends it {
3646
3659
  this._editorBridgeService.afterVisible$.pipe(ss("visible")).subscribe((e) => {
3647
3660
  e.visible || this._closeRangePrompt();
3648
3661
  })
3649
- ), this.disposeWithMe(this._contextService.subscribeContextValue$(wn).pipe(gn()).subscribe((e) => {
3662
+ ), this.disposeWithMe(this._contextService.subscribeContextValue$(wn).pipe(Sn()).subscribe((e) => {
3650
3663
  e || this._closeRangePrompt();
3651
3664
  }));
3652
3665
  }
@@ -3654,7 +3667,7 @@ let Pt = class extends it {
3654
3667
  this.disposeWithMe(
3655
3668
  this._univerInstanceService.getCurrentTypeOfUnit$(X.UNIVER_DOC).pipe(tt((e) => {
3656
3669
  const t = (e == null ? void 0 : e.getUnitId()) || "";
3657
- return !Ve(t) && !Be(t);
3670
+ return !Be(t) && !Ve(t);
3658
3671
  })).subscribe((e) => {
3659
3672
  if (e == null)
3660
3673
  return;
@@ -3670,8 +3683,8 @@ let Pt = class extends it {
3670
3683
  _closeRangePrompt(e) {
3671
3684
  var n;
3672
3685
  const t = e || ((n = this._univerInstanceService.getCurrentUnitForType(X.UNIVER_DOC)) == null ? void 0 : n.getUnitId()) || "";
3673
- Ve(t) || Be(t) || t === So || (this._insertSelections = [], this._refSelectionsService.clear(), e && this._editorService.isSheetEditor(e) && this._updateEditorModel(`\r
3674
- `, []), this._contextService.setContextValue(Rt, !1), this._contextService.setContextValue(pt, !1), this._contextService.setContextValue(Yt, !1), this._quitSelectingMode(), this._resetTemp(), this._hideFunctionPanel());
3686
+ Be(t) || Ve(t) || t === So || (this._insertSelections = [], this._refSelectionsService.clear(), e && this._editorService.isSheetEditor(e) && this._updateEditorModel(`\r
3687
+ `, []), this._contextService.setContextValue(Rt, !1), this._contextService.setContextValue(pt, !1), this._contextService.setContextValue(Gt, !1), this._quitSelectingMode(), this._resetTemp(), this._hideFunctionPanel());
3675
3688
  }
3676
3689
  _initSelectionsEndListener() {
3677
3690
  const e = new ze();
@@ -3679,13 +3692,13 @@ let Pt = class extends it {
3679
3692
  var s;
3680
3693
  if (e.dispose(), !t || t.length === 0) return;
3681
3694
  const n = ((s = this._univerInstanceService.getCurrentUnitForType(X.UNIVER_DOC)) == null ? void 0 : s.getUnitId()) || "";
3682
- if (Ve(n) || Be(n))
3695
+ if (Be(n) || Ve(n))
3683
3696
  return;
3684
3697
  this._allSelectionRenderServices.map((i) => i.getSelectionControls()).flat().forEach((i) => {
3685
3698
  i.disableHelperSelection(), e.add(et(i.selectionMoving$, i.selectionScaling$).subscribe((c) => {
3686
3699
  var h;
3687
3700
  const l = ((h = this._univerInstanceService.getCurrentUnitForType(X.UNIVER_DOC)) == null ? void 0 : h.getUnitId()) || "";
3688
- if (Ve(l) || Be(l)) {
3701
+ if (Be(l) || Ve(l)) {
3689
3702
  e.dispose(), this._formulaPromptService.disableLockedSelectionChange();
3690
3703
  return;
3691
3704
  }
@@ -3730,7 +3743,7 @@ let Pt = class extends it {
3730
3743
  else {
3731
3744
  let n = this._formulaPromptService.getSequenceNodes();
3732
3745
  const o = this._getCurrentChar();
3733
- n.length === 0 && this._currentInsertRefStringIndex > 0 && (this._currentInsertRefStringIndex = -1), this._previousInsertRefStringIndex = this._currentInsertRefStringIndex, !Hn(o) && this._focusIsOnlyRange(e.length) && (this._formulaPromptService.insertSequenceString(this._currentInsertRefStringIndex, G.COMMA), n = this._formulaPromptService.getSequenceNodes(), this._previousInsertRefStringIndex += 1), this._previousSequenceNodes = $e.deepClone(n), this._formulaPromptService.setSequenceNodes(n);
3746
+ n.length === 0 && this._currentInsertRefStringIndex > 0 && (this._currentInsertRefStringIndex = -1), this._previousInsertRefStringIndex = this._currentInsertRefStringIndex, !Hn(o) && this._focusIsOnlyRange(e.length) && (this._formulaPromptService.insertSequenceString(this._currentInsertRefStringIndex, G.COMMA), n = this._formulaPromptService.getSequenceNodes(), this._previousInsertRefStringIndex += 1), this._previousSequenceNodes = ke.deepClone(n), this._formulaPromptService.setSequenceNodes(n);
3734
3747
  const s = this._generateRefString(t);
3735
3748
  this._formulaPromptService.insertSequenceRef(this._previousInsertRefStringIndex, s), this._selectionRenderService.setSkipLastEnabled(!1);
3736
3749
  }
@@ -3753,15 +3766,15 @@ let Pt = class extends it {
3753
3766
  l.token = e, l.endIndex += c, o[s] = l;
3754
3767
  const h = this._descriptionService.hasDefinedNameDescription(e), f = this._descriptionService.isFormulaDefinedName(e), u = e.length + 1, a = !h || f;
3755
3768
  a && o.splice(s + 1, 0, G.OPEN_BRACKET);
3756
- for (let S = s + 2, _ = o.length; S < _; S++) {
3757
- const g = o[S];
3758
- if (typeof g == "string")
3769
+ for (let S = s + 2, p = o.length; S < p; S++) {
3770
+ const m = o[S];
3771
+ if (typeof m == "string")
3759
3772
  continue;
3760
- const v = { ...g };
3761
- v.startIndex += u, v.endIndex += u, o[S] = v;
3773
+ const C = { ...m };
3774
+ C.startIndex += u, C.endIndex += u, o[S] = C;
3762
3775
  }
3763
- let m = l.endIndex + 1;
3764
- a && (m += 1), this._syncToEditor(o, m, void 0, !0, !1);
3776
+ let d = l.endIndex + 1;
3777
+ a && (d += 1), this._syncToEditor(o, d, void 0, !0, !1);
3765
3778
  })
3766
3779
  );
3767
3780
  }
@@ -3776,13 +3789,13 @@ let Pt = class extends it {
3776
3789
  this._hideFunctionPanel();
3777
3790
  return;
3778
3791
  }
3779
- if (typeof n != "string" && n.nodeType === Y.FUNCTION && !this._descriptionService.hasDefinedNameDescription(n.token.trim())) {
3792
+ if (typeof n != "string" && n.nodeType === z.FUNCTION && !this._descriptionService.hasDefinedNameDescription(n.token.trim())) {
3780
3793
  const l = n.token.toUpperCase();
3781
3794
  if (this._inputPanelState === 1) {
3782
3795
  const h = this._descriptionService.getSearchListByNameFirstLetter(l);
3783
3796
  if (this._hideFunctionPanel(), h == null || h.length === 0)
3784
3797
  return;
3785
- this._commandService.executeCommand(un.id, {
3798
+ this._commandService.executeCommand(hn.id, {
3786
3799
  visible: !0,
3787
3800
  searchText: l,
3788
3801
  searchList: h
@@ -3801,17 +3814,17 @@ let Pt = class extends it {
3801
3814
  }
3802
3815
  _changeHelpFunctionPanelState(e, t) {
3803
3816
  const n = this._descriptionService.getFunctionInfo(e);
3804
- this._hideFunctionPanel(), n != null && this._commandService.executeCommand(an.id, {
3817
+ this._hideFunctionPanel(), n != null && this._commandService.executeCommand(un.id, {
3805
3818
  visible: !0,
3806
3819
  paramIndex: t,
3807
3820
  functionInfo: n
3808
3821
  });
3809
3822
  }
3810
3823
  _hideFunctionPanel() {
3811
- this._commandService.executeCommand(un.id, {
3824
+ this._commandService.executeCommand(hn.id, {
3812
3825
  visible: !1,
3813
3826
  searchText: ""
3814
- }), this._commandService.executeCommand(an.id, {
3827
+ }), this._commandService.executeCommand(un.id, {
3815
3828
  visible: !1,
3816
3829
  paramIndex: -1
3817
3830
  });
@@ -3855,7 +3868,7 @@ let Pt = class extends it {
3855
3868
  if (!(e != null && e.getBody()))
3856
3869
  return;
3857
3870
  const t = e.getUnitId(), n = this._editorService.getEditor(t), o = (i = (s = e.getBody()) == null ? void 0 : s.dataStream) != null ? i : "";
3858
- return !n || !n.onlyInputRange() ? { dataStream: o, offset: 0 } : { dataStream: xe.EQUALS + o, offset: 1 };
3871
+ return !n || !n.onlyInputRange() ? { dataStream: o, offset: 0 } : { dataStream: Te.EQUALS + o, offset: 1 };
3859
3872
  }
3860
3873
  _getFormulaAndCellEditorBody(e) {
3861
3874
  return e.map((t) => {
@@ -3875,8 +3888,8 @@ let Pt = class extends it {
3875
3888
  */
3876
3889
  _contextSwitch() {
3877
3890
  const e = this._getCurrentBodyDataStreamAndOffset();
3878
- if (e && ke(e.dataStream)) {
3879
- this._contextService.setContextValue(Rt, !0), this._contextService.setContextValue(pt, !0), this._contextService.setContextValue(Yt, !0);
3891
+ if (e && Ue(e.dataStream)) {
3892
+ this._contextService.setContextValue(Rt, !0), this._contextService.setContextValue(pt, !0), this._contextService.setContextValue(Gt, !0);
3880
3893
  const t = this._lexerTreeBuilder.sequenceNodesBuilder(e.dataStream) || [];
3881
3894
  this._formulaPromptService.setSequenceNodes(t);
3882
3895
  const n = this._docSelectionManagerService.getActiveTextRange();
@@ -3886,7 +3899,7 @@ let Pt = class extends it {
3886
3899
  this._currentInsertRefStringIndex = o - 1 + e.offset;
3887
3900
  return;
3888
3901
  }
3889
- this._contextService.setContextValue(Rt, !1), this._contextService.setContextValue(pt, !1), this._contextService.setContextValue(Yt, !1), this._formulaPromptService.disableLockedSelectionChange(), this._formulaPromptService.disableLockedSelectionInsert(), this._formulaPromptService.clearSequenceNodes(), this._hideFunctionPanel();
3902
+ this._contextService.setContextValue(Rt, !1), this._contextService.setContextValue(pt, !1), this._contextService.setContextValue(Gt, !1), this._formulaPromptService.disableLockedSelectionChange(), this._formulaPromptService.disableLockedSelectionInsert(), this._formulaPromptService.clearSequenceNodes(), this._hideFunctionPanel();
3890
3903
  }
3891
3904
  _getContextState() {
3892
3905
  return this._contextService.getContextValue(Rt);
@@ -3921,27 +3934,27 @@ let Pt = class extends it {
3921
3934
  const f = e[l];
3922
3935
  if (typeof f == "string" || this._descriptionService.hasDefinedNameDescription(f.token.trim()))
3923
3936
  continue;
3924
- const { startIndex: u, endIndex: a, nodeType: m, token: S } = f;
3925
- let _ = "";
3926
- if (m === Y.REFERENCE) {
3937
+ const { startIndex: u, endIndex: a, nodeType: d, token: S } = f;
3938
+ let p = "";
3939
+ if (d === z.REFERENCE) {
3927
3940
  if (o.has(S))
3928
- _ = o.get(S);
3941
+ p = o.get(S);
3929
3942
  else {
3930
- const g = s % this._formulaRefColors.length;
3931
- _ = this._formulaRefColors[g], o.set(S, _), s++;
3943
+ const m = s % this._formulaRefColors.length;
3944
+ p = this._formulaRefColors[m], o.set(S, p), s++;
3932
3945
  }
3933
3946
  n.push({
3934
3947
  refIndex: l,
3935
- themeColor: _,
3948
+ themeColor: p,
3936
3949
  token: S
3937
3950
  });
3938
- } else m === Y.NUMBER ? _ = this._numberColor : m === Y.STRING ? _ = this._stringColor : m === Y.ARRAY && (_ = this._stringColor);
3939
- _ && _.length > 0 && t.push({
3951
+ } else d === z.NUMBER ? p = this._numberColor : d === z.STRING ? p = this._stringColor : d === z.ARRAY && (p = this._stringColor);
3952
+ p && p.length > 0 && t.push({
3940
3953
  st: u + 1 - i,
3941
3954
  ed: a + 2 - i,
3942
3955
  ts: {
3943
3956
  cl: {
3944
- rgb: _
3957
+ rgb: p
3945
3958
  }
3946
3959
  }
3947
3960
  });
@@ -3960,29 +3973,29 @@ let Pt = class extends it {
3960
3973
  const { unitId: n, sheetId: o } = this._editorBridgeService.getEditCellState(), { unitId: s, sheetId: i } = this._getCurrentUnitIdAndSheetId(), c = o === i, h = this._univerInstanceService.getUniverSheetInstance(n).getSheetBySheetId(o);
3961
3974
  let f = null;
3962
3975
  const u = [];
3963
- for (let a = 0, m = t.length; a < m; a++) {
3964
- const S = t[a], { themeColor: _, token: g, refIndex: v } = S, d = he(g), { unitId: C, sheetName: R, range: E } = d, N = Sr(E, h.getRowCount(), h.getColumnCount());
3965
- if (C != null && C.length > 0 && n !== C) continue;
3966
- const I = this._getSheetIdByName(n, R.trim());
3967
- if (!c && I !== i || c && R.length !== 0 && I !== o || this._exceedCurrentRange(N, h.getRowCount(), h.getColumnCount())) continue;
3968
- const x = this._getPrimary(N, _, v);
3969
- if (x) {
3970
- f = x, u.push(f);
3976
+ for (let a = 0, d = t.length; a < d; a++) {
3977
+ const S = t[a], { themeColor: p, token: m, refIndex: C } = S, v = ae(m), { unitId: g, sheetName: I, range: R } = v, N = Sr(R, h.getRowCount(), h.getColumnCount());
3978
+ if (g != null && g.length > 0 && n !== g) continue;
3979
+ const E = this._getSheetIdByName(n, I.trim());
3980
+ if (!c && E !== i || c && I.length !== 0 && E !== o || this._exceedCurrentRange(N, h.getRowCount(), h.getColumnCount())) continue;
3981
+ const y = this._getPrimary(N, p, C);
3982
+ if (y) {
3983
+ f = y, u.push(f);
3971
3984
  continue;
3972
3985
  }
3973
3986
  const b = ps(N, h);
3974
3987
  !ir.equals(b, N) && N.startRow === N.endRow && N.startColumn === N.endColumn && (N.startRow = b.startRow, N.endRow = b.endRow, N.startColumn = b.startColumn, N.endColumn = b.endColumn), u.push({
3975
3988
  range: N,
3976
3989
  primary: b,
3977
- style: bt(this._themeService, _, v.toString())
3990
+ style: bt(this._themeService, p, C.toString())
3978
3991
  });
3979
3992
  }
3980
3993
  u.length && this._refSelectionsService.setSelections(n, o, u, It.ONLY_SET);
3981
3994
  }
3982
3995
  _getPrimary(e, t, n) {
3983
3996
  const o = this._insertSelections.find((u) => {
3984
- const { startRow: a, startColumn: m, endRow: S, endColumn: _ } = u.range;
3985
- return a === e.startRow && m === e.startColumn && S === e.endRow && _ === e.endColumn || a === e.startRow && m === e.startColumn && e.startRow === e.endRow && e.startColumn === e.endColumn;
3997
+ const { startRow: a, startColumn: d, endRow: S, endColumn: p } = u.range;
3998
+ return a === e.startRow && d === e.startColumn && S === e.endRow && p === e.endColumn || a === e.startRow && d === e.startColumn && e.startRow === e.endRow && e.startColumn === e.endColumn;
3986
3999
  });
3987
4000
  if ((o == null ? void 0 : o.primary) == null)
3988
4001
  return;
@@ -4040,18 +4053,18 @@ let Pt = class extends it {
4040
4053
  const { unitId: o, sheetId: s } = e.range, { openUnitId: i, openSheetId: c } = this._getEditorOpenedForSheet();
4041
4054
  o !== i && o && (t = o), s !== c && o && s && (n = this._getSheetNameById(o, s));
4042
4055
  const { range: l, primary: h } = e;
4043
- let { startRow: f, endRow: u, startColumn: a, endColumn: m } = l;
4044
- const { startAbsoluteRefType: S, endAbsoluteRefType: _, rangeType: g } = l;
4056
+ let { startRow: f, endRow: u, startColumn: a, endColumn: d } = l;
4057
+ const { startAbsoluteRefType: S, endAbsoluteRefType: p, rangeType: m } = l;
4045
4058
  if (h) {
4046
4059
  const {
4047
- isMerged: v,
4048
- isMergedMainCell: d,
4049
- startRow: C,
4050
- endRow: R,
4051
- startColumn: E,
4060
+ isMerged: C,
4061
+ isMergedMainCell: v,
4062
+ startRow: g,
4063
+ endRow: I,
4064
+ startColumn: R,
4052
4065
  endColumn: N
4053
4066
  } = h;
4054
- (v || d) && C === f && E === a && R === u && N === m && (f = C, a = E, u = C, m = E);
4067
+ (C || v) && g === f && R === a && I === u && N === d && (f = g, a = R, u = g, d = R);
4055
4068
  }
4056
4069
  return Qo({
4057
4070
  sheetName: n,
@@ -4060,10 +4073,10 @@ let Pt = class extends it {
4060
4073
  startRow: f,
4061
4074
  endRow: u,
4062
4075
  startColumn: a,
4063
- endColumn: m,
4064
- rangeType: g,
4076
+ endColumn: d,
4077
+ rangeType: m,
4065
4078
  startAbsoluteRefType: S,
4066
- endAbsoluteRefType: _
4079
+ endAbsoluteRefType: p
4067
4080
  }
4068
4081
  });
4069
4082
  }
@@ -4077,7 +4090,7 @@ let Pt = class extends it {
4077
4090
  _syncToEditor(e, t, n, o = !0, s = !0) {
4078
4091
  let i = Jo(e);
4079
4092
  const { textRuns: c, refSelections: l } = this._buildTextRuns(e);
4080
- this._isSelectionMovingRefSelections = l, this._allSelectionRenderServices.forEach((_) => this._updateRefSelectionStyle(_, this._isSelectionMovingRefSelections));
4093
+ this._isSelectionMovingRefSelections = l, this._allSelectionRenderServices.forEach((p) => this._updateRefSelectionStyle(p, this._isSelectionMovingRefSelections));
4081
4094
  const h = this._docSelectionManagerService.getActiveTextRange();
4082
4095
  if (h == null)
4083
4096
  return;
@@ -4085,8 +4098,8 @@ let Pt = class extends it {
4085
4098
  const f = this._editorService.getEditor(n);
4086
4099
  f != null && f.isSingleChoice() ? (i = i.split(",")[0], this._selectionRenderService.setSingleSelectionEnabled(!0)) : this._selectionRenderService.setSingleSelectionEnabled(!1);
4087
4100
  let u = i, a = 1;
4088
- (!f || !f.onlyInputRange()) && (u = `${xe.EQUALS}${i}`, a = 0);
4089
- const { collapsed: m, style: S } = h;
4101
+ (!f || !f.onlyInputRange()) && (u = `${Te.EQUALS}${i}`, a = 0);
4102
+ const { collapsed: d, style: S } = h;
4090
4103
  o ? (this._commandService.executeCommand(ls.id, {
4091
4104
  unitId: n,
4092
4105
  body: {
@@ -4097,7 +4110,7 @@ let Pt = class extends it {
4097
4110
  {
4098
4111
  startOffset: t + 1 - a,
4099
4112
  endOffset: t + 1 - a,
4100
- collapsed: m,
4113
+ collapsed: d,
4101
4114
  style: S
4102
4115
  }
4103
4116
  ],
@@ -4138,7 +4151,7 @@ let Pt = class extends it {
4138
4151
  const n = this._univerInstanceService.getCurrentUniverDocInstance(), o = n.getUnitId();
4139
4152
  if (!this._editorService.isEditor(o))
4140
4153
  return;
4141
- const s = (l = this._renderManagerService.getRenderById(o)) == null ? void 0 : l.with(cn).getViewModel();
4154
+ const s = (l = this._renderManagerService.getRenderById(o)) == null ? void 0 : l.with(ln).getViewModel();
4142
4155
  if (s == null || n == null)
4143
4156
  return;
4144
4157
  const i = n == null ? void 0 : n.getSnapshot();
@@ -4152,7 +4165,7 @@ let Pt = class extends it {
4152
4165
  }
4153
4166
  _insertControlSelectionReplace(e) {
4154
4167
  this._previousSequenceNodes == null && (this._previousSequenceNodes = this._formulaPromptService.getSequenceNodes()), this._previousInsertRefStringIndex == null && (this._previousInsertRefStringIndex = this._currentInsertRefStringIndex);
4155
- const t = $e.deepClone(this._previousSequenceNodes);
4168
+ const t = ke.deepClone(this._previousSequenceNodes);
4156
4169
  if (t == null)
4157
4170
  return;
4158
4171
  const { skeleton: n } = this._getCurrentUnitIdAndSheetId(), o = n == null ? void 0 : n.worksheet.getUnitId(), s = n == null ? void 0 : n.worksheet.getSheetId();
@@ -4187,29 +4200,29 @@ let Pt = class extends it {
4187
4200
  _updateRefSelectionStyle(e, t) {
4188
4201
  const n = e.getSelectionControls(), [o, s] = e.getLocation(), i = /* @__PURE__ */ new Set();
4189
4202
  for (let c = 0, l = t.length; c < l; c++) {
4190
- const h = t[c], { refIndex: f, themeColor: u, token: a } = h, m = he(a), { unitId: S, sheetName: _, range: g } = m;
4203
+ const h = t[c], { refIndex: f, themeColor: u, token: a } = h, d = ae(a), { unitId: S, sheetName: p, range: m } = d;
4191
4204
  if (!S && S.length > 0 && o !== S)
4192
4205
  continue;
4193
- const v = this._getSheetIdByName(o, _.trim());
4194
- if (v && v !== s)
4206
+ const C = this._getSheetIdByName(o, p.trim());
4207
+ if (C && C !== s)
4195
4208
  continue;
4196
- const d = n.find((C) => {
4197
- const { startRow: R, startColumn: E, endRow: N, endColumn: I, rangeType: x } = C.getRange();
4198
- return x === ge.COLUMN && E === g.startColumn && I === g.endColumn || x === ge.ROW && R === g.startRow && N === g.endRow || R === g.startRow && E === g.startColumn && N === g.endRow && I === g.endColumn || R === g.startRow && E === g.startColumn && g.startRow === g.endRow && g.startColumn === g.endColumn;
4209
+ const v = n.find((g) => {
4210
+ const { startRow: I, startColumn: R, endRow: N, endColumn: E, rangeType: y } = g.getRange();
4211
+ return y === Se.COLUMN && R === m.startColumn && E === m.endColumn || y === Se.ROW && I === m.startRow && N === m.endRow || I === m.startRow && R === m.startColumn && N === m.endRow && E === m.endColumn || I === m.startRow && R === m.startColumn && m.startRow === m.endRow && m.startColumn === m.endColumn;
4199
4212
  });
4200
- if (d) {
4201
- const C = bt(this._themeService, u, f.toString());
4202
- d.updateStyle(C), i.add(d);
4213
+ if (v) {
4214
+ const g = bt(this._themeService, u, f.toString());
4215
+ v.updateStyle(g), i.add(v);
4203
4216
  }
4204
4217
  }
4205
4218
  }
4206
4219
  _onSelectionControlChange(e, t) {
4207
- var d;
4220
+ var v;
4208
4221
  const { skeleton: n } = this._getCurrentUnitIdAndSheetId();
4209
4222
  if (!n) return;
4210
4223
  this._formulaPromptService.enableLockedSelectionChange();
4211
- const o = (d = t.currentStyle) == null ? void 0 : d.id;
4212
- if (!o || !$e.isStringNumber(o))
4224
+ const o = (v = t.currentStyle) == null ? void 0 : v.id;
4225
+ if (!o || !ke.isStringNumber(o))
4213
4226
  return;
4214
4227
  let { startRow: s, endRow: i, startColumn: c, endColumn: l } = e;
4215
4228
  const h = n ? n.worksheet.getCellInfoInMergeData(s, c) : {
@@ -4224,24 +4237,24 @@ let Pt = class extends it {
4224
4237
  };
4225
4238
  if (h) {
4226
4239
  const {
4227
- isMerged: C,
4228
- isMergedMainCell: R,
4229
- startRow: E,
4240
+ isMerged: g,
4241
+ isMergedMainCell: I,
4242
+ startRow: R,
4230
4243
  endRow: N,
4231
- startColumn: I,
4232
- endColumn: x
4244
+ startColumn: E,
4245
+ endColumn: y
4233
4246
  } = h;
4234
- (C || R) && E === s && I === c && N === i && x === l && (s = E, c = I, i = E, l = I);
4247
+ (g || I) && R === s && E === c && N === i && y === l && (s = R, c = E, i = R, l = E);
4235
4248
  }
4236
4249
  const f = Number(o), u = this._formulaPromptService.getCurrentSequenceNodeByIndex(f);
4237
4250
  if (!u)
4238
4251
  return;
4239
- let a = { startAbsoluteRefType: ee.NONE };
4252
+ let a = { startAbsoluteRefType: te.NONE };
4240
4253
  if (typeof u != "string") {
4241
- const C = u.token;
4242
- a = es(C), a.endAbsoluteRefType == null && (a.endAbsoluteRefType = a.startAbsoluteRefType);
4254
+ const g = u.token;
4255
+ a = es(g), a.endAbsoluteRefType == null && (a.endAbsoluteRefType = a.startAbsoluteRefType);
4243
4256
  }
4244
- const m = n == null ? void 0 : n.worksheet.getUnitId(), S = n == null ? void 0 : n.worksheet.getSheetId(), _ = this._generateRefString({
4257
+ const d = n == null ? void 0 : n.worksheet.getUnitId(), S = n == null ? void 0 : n.worksheet.getSheetId(), p = this._generateRefString({
4245
4258
  range: {
4246
4259
  startRow: Math.min(s, i),
4247
4260
  endRow: Math.max(s, i),
@@ -4249,14 +4262,14 @@ let Pt = class extends it {
4249
4262
  endColumn: Math.max(c, l),
4250
4263
  ...a,
4251
4264
  sheetId: S,
4252
- unitId: m
4265
+ unitId: d
4253
4266
  },
4254
4267
  primary: h,
4255
4268
  style: null
4256
4269
  });
4257
- this._formulaPromptService.updateSequenceRef(f, _);
4258
- const g = this._formulaPromptService.getSequenceNodes(), v = g[f];
4259
- typeof v != "string" && (this._syncToEditor(g, v.endIndex + 1), t.updateRange(e, this._selectionRenderService.attachPrimaryWithCoord(h)));
4270
+ this._formulaPromptService.updateSequenceRef(f, p);
4271
+ const m = this._formulaPromptService.getSequenceNodes(), C = m[f];
4272
+ typeof C != "string" && (this._syncToEditor(m, C.endIndex + 1), t.updateRange(e, this._selectionRenderService.attachPrimaryWithCoord(h)));
4260
4273
  }
4261
4274
  _refreshFormulaAndCellEditor(e) {
4262
4275
  var t;
@@ -4282,7 +4295,7 @@ let Pt = class extends it {
4282
4295
  }
4283
4296
  n !== !0 && this._editorBridgeService.changeVisible({
4284
4297
  visible: !1,
4285
- eventType: pe.Keyboard,
4298
+ eventType: _e.Keyboard,
4286
4299
  keycode: t,
4287
4300
  unitId: ""
4288
4301
  });
@@ -4295,7 +4308,7 @@ let Pt = class extends it {
4295
4308
  }
4296
4309
  n !== !0 && this._editorBridgeService.changeVisible({
4297
4310
  visible: !1,
4298
- eventType: pe.Keyboard,
4311
+ eventType: _e.Keyboard,
4299
4312
  keycode: t,
4300
4313
  unitId: ""
4301
4314
  });
@@ -4304,18 +4317,18 @@ let Pt = class extends it {
4304
4317
  const { keycode: t } = e, n = this._editorService.getFocusEditor();
4305
4318
  (!n || (n == null ? void 0 : n.isSheetEditor()) === !0) && this._editorBridgeService.changeVisible({
4306
4319
  visible: !1,
4307
- eventType: pe.Keyboard,
4320
+ eventType: _e.Keyboard,
4308
4321
  keycode: t,
4309
4322
  unitId: ""
4310
4323
  });
4311
4324
  }
4312
4325
  _pressArrowKey(e) {
4313
4326
  const { keycode: t, metaKey: n } = e;
4314
- let o = te.DOWN;
4315
- t === L.ARROW_DOWN ? o = te.DOWN : t === L.ARROW_UP ? o = te.UP : t === L.ARROW_LEFT ? o = te.LEFT : t === L.ARROW_RIGHT && (o = te.RIGHT), n === Ue.CTRL_COMMAND ? this._commandService.executeCommand(kn.id, {
4327
+ let o = ne.DOWN;
4328
+ t === L.ARROW_DOWN ? o = ne.DOWN : t === L.ARROW_UP ? o = ne.UP : t === L.ARROW_LEFT ? o = ne.LEFT : t === L.ARROW_RIGHT && (o = ne.RIGHT), n === je.CTRL_COMMAND ? this._commandService.executeCommand(kn.id, {
4316
4329
  direction: o,
4317
4330
  jumpOver: Un.moveGap
4318
- }) : n === Ue.SHIFT ? this._commandService.executeCommand(jn.id, {
4331
+ }) : n === je.SHIFT ? this._commandService.executeCommand(jn.id, {
4319
4332
  direction: o
4320
4333
  }) : n === Qr ? this._commandService.executeCommand(jn.id, {
4321
4334
  direction: o,
@@ -4329,8 +4342,8 @@ let Pt = class extends it {
4329
4342
  this.disposeWithMe(
4330
4343
  this._commandService.onCommandExecuted((t) => {
4331
4344
  const n = this._univerInstanceService.getCurrentUnitForType(X.UNIVER_DOC), o = (n == null ? void 0 : n.getUnitId()) || "";
4332
- if (!(Ve(o) || Be(o))) {
4333
- if (t.id === In.id)
4345
+ if (!(Be(o) || Ve(o))) {
4346
+ if (t.id === En.id)
4334
4347
  this._changeRefString();
4335
4348
  else if (e.includes(t.id)) {
4336
4349
  const s = t.params, { keycode: i, isSingleEditor: c = !1 } = s;
@@ -4348,11 +4361,11 @@ let Pt = class extends it {
4348
4361
  }
4349
4362
  if (this._formulaPromptService.isSearching()) {
4350
4363
  if (i === L.ARROW_DOWN) {
4351
- this._formulaPromptService.navigate({ direction: te.DOWN });
4364
+ this._formulaPromptService.navigate({ direction: ne.DOWN });
4352
4365
  return;
4353
4366
  }
4354
4367
  if (i === L.ARROW_UP) {
4355
- this._formulaPromptService.navigate({ direction: te.UP });
4368
+ this._formulaPromptService.navigate({ direction: ne.UP });
4356
4369
  return;
4357
4370
  }
4358
4371
  }
@@ -4365,7 +4378,7 @@ let Pt = class extends it {
4365
4378
  if (this._arrowMoveActionState === 4) {
4366
4379
  this._editorBridgeService.changeVisible({
4367
4380
  visible: !1,
4368
- eventType: pe.Keyboard,
4381
+ eventType: _e.Keyboard,
4369
4382
  keycode: i,
4370
4383
  unitId: ""
4371
4384
  });
@@ -4374,7 +4387,7 @@ let Pt = class extends it {
4374
4387
  if (this._arrowMoveActionState === 2 && (this._arrowMoveActionState = 3), this._refSelectionsService.getCurrentSelections().length === 0) {
4375
4388
  const u = this._sheetsSelectionsService.getCurrentLastSelection();
4376
4389
  if (u != null) {
4377
- const a = $e.deepClone(u);
4390
+ const a = ke.deepClone(u);
4378
4391
  this._refSelectionsService.setSelections([a]);
4379
4392
  }
4380
4393
  }
@@ -4389,8 +4402,8 @@ let Pt = class extends it {
4389
4402
  _moveInEditor(e) {
4390
4403
  if (e == null)
4391
4404
  return;
4392
- let t = te.LEFT;
4393
- e === L.ARROW_DOWN ? t = te.DOWN : e === L.ARROW_UP ? t = te.UP : e === L.ARROW_RIGHT && (t = te.RIGHT), this._commandService.executeCommand(as.id, {
4405
+ let t = ne.LEFT;
4406
+ e === L.ARROW_DOWN ? t = ne.DOWN : e === L.ARROW_UP ? t = ne.UP : e === L.ARROW_RIGHT && (t = ne.RIGHT), this._commandService.executeCommand(as.id, {
4394
4407
  direction: t
4395
4408
  });
4396
4409
  }
@@ -4407,12 +4420,12 @@ let Pt = class extends it {
4407
4420
  this.disposeWithMe(
4408
4421
  this._editorService.inputFormula$.subscribe((e) => {
4409
4422
  const { formulaString: t, editorUnitId: n } = e;
4410
- if (t.substring(0, 1) !== xe.EQUALS)
4423
+ if (t.substring(0, 1) !== Te.EQUALS)
4411
4424
  return;
4412
4425
  const { unitId: o } = this._getCurrentUnitIdAndSheetId();
4413
4426
  this._editorBridgeService.isVisible().visible === !1 && this._editorBridgeService.changeVisible({
4414
4427
  visible: !0,
4415
- eventType: pe.Dblclick,
4428
+ eventType: _e.Dblclick,
4416
4429
  unitId: o
4417
4430
  });
4418
4431
  const i = this._lexerTreeBuilder.sequenceNodesBuilder(t) || [];
@@ -4428,7 +4441,7 @@ let Pt = class extends it {
4428
4441
  if (e == null)
4429
4442
  return;
4430
4443
  const { startOffset: t } = e, n = t - 2, o = this._formulaPromptService.getCurrentSequenceNodeIndex(n), s = this._formulaPromptService.getCurrentSequenceNodeByIndex(o);
4431
- if (s == null || typeof s == "string" || s.nodeType !== Y.REFERENCE)
4444
+ if (s == null || typeof s == "string" || s.nodeType !== z.REFERENCE)
4432
4445
  return;
4433
4446
  const i = s.token.split("!");
4434
4447
  let c = s.token;
@@ -4441,8 +4454,8 @@ let Pt = class extends it {
4441
4454
  if (!this._userCursorMove)
4442
4455
  h = this._changeRangeRef(c);
4443
4456
  else {
4444
- const u = c.split(G.COLON), a = u[0], m = u[1];
4445
- n - s.startIndex <= a.length ? h = this._changeSingleRef(a) + G.COLON + m : h = a + G.COLON + this._changeSingleRef(m);
4457
+ const u = c.split(G.COLON), a = u[0], d = u[1];
4458
+ n - s.startIndex <= a.length ? h = this._changeSingleRef(a) + G.COLON + d : h = a + G.COLON + this._changeSingleRef(d);
4446
4459
  }
4447
4460
  else
4448
4461
  h = this._changeSingleRef(c);
@@ -4451,14 +4464,14 @@ let Pt = class extends it {
4451
4464
  this._formulaPromptService.updateSequenceRef(o, h), this._syncToEditor(this._formulaPromptService.getSequenceNodes(), n + f + 1);
4452
4465
  }
4453
4466
  _changeRangeRef(e) {
4454
- const t = he(e).range;
4467
+ const t = ae(e).range;
4455
4468
  let n = "";
4456
- return t.startAbsoluteRefType === ee.NONE || t.startAbsoluteRefType == null ? (t.startAbsoluteRefType = ee.ALL, t.endAbsoluteRefType = ee.ALL) : (t.startAbsoluteRefType = ee.NONE, t.endAbsoluteRefType = ee.NONE), n = Ie(t), n;
4469
+ return t.startAbsoluteRefType === te.NONE || t.startAbsoluteRefType == null ? (t.startAbsoluteRefType = te.ALL, t.endAbsoluteRefType = te.ALL) : (t.startAbsoluteRefType = te.NONE, t.endAbsoluteRefType = te.NONE), n = Ee(t), n;
4457
4470
  }
4458
4471
  _changeSingleRef(e) {
4459
- const t = he(e).range, n = t.startAbsoluteRefType;
4472
+ const t = ae(e).range, n = t.startAbsoluteRefType;
4460
4473
  let o = "";
4461
- return n === ee.NONE || n == null ? (t.startAbsoluteRefType = ee.ALL, t.endAbsoluteRefType = ee.ALL) : n === ee.ALL ? (t.startAbsoluteRefType = ee.ROW, t.endAbsoluteRefType = ee.ROW) : n === ee.ROW ? (t.startAbsoluteRefType = ee.COLUMN, t.endAbsoluteRefType = ee.COLUMN) : (t.startAbsoluteRefType = ee.NONE, t.endAbsoluteRefType = ee.NONE), o = Ie(t), o;
4474
+ return n === te.NONE || n == null ? (t.startAbsoluteRefType = te.ALL, t.endAbsoluteRefType = te.ALL) : n === te.ALL ? (t.startAbsoluteRefType = te.ROW, t.endAbsoluteRefType = te.ROW) : n === te.ROW ? (t.startAbsoluteRefType = te.COLUMN, t.endAbsoluteRefType = te.COLUMN) : (t.startAbsoluteRefType = te.NONE, t.endAbsoluteRefType = te.NONE), o = Ee(t), o;
4462
4475
  }
4463
4476
  _getEditorObject() {
4464
4477
  const e = this._univerInstanceService.getCurrentUniverDocInstance();
@@ -4474,27 +4487,27 @@ let Pt = class extends it {
4474
4487
  }
4475
4488
  };
4476
4489
  Pt = Zl([
4477
- ie(0, Ee),
4478
- ie(1, Lt),
4479
- ie(2, V(Vo)),
4480
- ie(3, V(lt)),
4481
- ie(4, V(je)),
4482
- ie(5, fe),
4483
- ie(6, V(_t)),
4484
- ie(7, V(pn)),
4485
- ie(8, Ht),
4486
- ie(9, be),
4487
- ie(10, V(ct)),
4488
- ie(11, V(Ps)),
4489
- ie(12, Ir),
4490
- ie(13, ve),
4491
- ie(14, Er)
4490
+ le(0, Ne),
4491
+ le(1, Lt),
4492
+ le(2, q(Bo)),
4493
+ le(3, q(lt)),
4494
+ le(4, q(Oe)),
4495
+ le(5, de),
4496
+ le(6, q(_t)),
4497
+ le(7, q(_n)),
4498
+ le(8, Ht),
4499
+ le(9, ye),
4500
+ le(10, q(ct)),
4501
+ le(11, q(Ps)),
4502
+ le(12, Ir),
4503
+ le(13, Re),
4504
+ le(14, Er)
4492
4505
  ], Pt);
4493
4506
  var Jr = Object.defineProperty, Ql = Object.getOwnPropertyDescriptor, Jl = (r, e, t) => e in r ? Jr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, ea = (r, e, t, n) => {
4494
4507
  for (var o = n > 1 ? void 0 : n ? Ql(e, t) : e, s = r.length - 1, i; s >= 0; s--)
4495
4508
  (i = r[s]) && (o = (n ? i(e, t, o) : i(o)) || o);
4496
4509
  return n && o && Jr(e, t, o), o;
4497
- }, rn = (r, e) => (t, n) => e(t, n, r), eo = (r, e, t) => Jl(r, typeof e != "symbol" ? e + "" : e, t);
4510
+ }, on = (r, e) => (t, n) => e(t, n, r), eo = (r, e, t) => Jl(r, typeof e != "symbol" ? e + "" : e, t);
4498
4511
  let wt = class extends _o {
4499
4512
  constructor(r = nr, e, t, n) {
4500
4513
  super(), this._config = r, this._injector = e, this._renderManagerService = t, this._configService = n;
@@ -4507,7 +4520,7 @@ let wt = class extends _o {
4507
4520
  onStarting() {
4508
4521
  const r = this._injector;
4509
4522
  [
4510
- [lt, { useClass: ln }],
4523
+ [lt, { useClass: an }],
4511
4524
  [At],
4512
4525
  [Tt],
4513
4526
  [Ft],
@@ -4518,8 +4531,8 @@ let wt = class extends _o {
4518
4531
  }
4519
4532
  onRendered() {
4520
4533
  [
4521
- [le],
4522
- [fn]
4534
+ [ue],
4535
+ [dn]
4523
4536
  ].forEach((e) => {
4524
4537
  this.disposeWithMe(this._renderManagerService.registerRenderModule(X.UNIVER_SHEET, e));
4525
4538
  }), Co(this._injector, [
@@ -4529,7 +4542,7 @@ let wt = class extends _o {
4529
4542
  [Ot]
4530
4543
  ]);
4531
4544
  const r = this._injector.get(br);
4532
- r.register(Bo, Ei), r.register(qo, dc);
4545
+ r.register(Vo, Ei), r.register(qo, dc);
4533
4546
  }
4534
4547
  onSteady() {
4535
4548
  this._injector.get(Tt), this._injector.get(Pt);
@@ -4539,21 +4552,21 @@ eo(wt, "pluginName", yr);
4539
4552
  eo(wt, "type", X.UNIVER_SHEET);
4540
4553
  wt = ea([
4541
4554
  Ro(ts, Cs),
4542
- rn(1, V(Dt)),
4543
- rn(2, fe),
4544
- rn(3, Io)
4555
+ on(1, q(Dt)),
4556
+ on(2, de),
4557
+ on(3, Io)
4545
4558
  ], wt);
4546
4559
  export {
4547
4560
  Ws as FORMULA_PROMPT_ACTIVATED,
4548
4561
  dc as FormulaEditor,
4549
- an as HelpFunctionOperation,
4550
- Cn as InsertFunctionOperation,
4551
- Rn as MoreFunctionsOperation,
4562
+ un as HelpFunctionOperation,
4563
+ Rn as InsertFunctionOperation,
4564
+ In as MoreFunctionsOperation,
4552
4565
  Ei as RangeSelector,
4553
- le as RefSelectionsRenderService,
4554
- In as ReferenceAbsoluteOperation,
4555
- un as SearchFunctionOperation,
4566
+ ue as RefSelectionsRenderService,
4567
+ En as ReferenceAbsoluteOperation,
4568
+ hn as SearchFunctionOperation,
4556
4569
  Ge as SelectEditorFormulaOperation,
4557
- vn as SheetOnlyPasteFormulaCommand,
4570
+ Cn as SheetOnlyPasteFormulaCommand,
4558
4571
  wt as UniverSheetsFormulaUIPlugin
4559
4572
  };