@univerjs/sheets-formula-ui 0.6.6 → 0.6.7-experimental.20250328-3aaa828

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,38 +1,38 @@
1
- var Yo = Object.defineProperty;
2
- var zo = (t, e, n) => e in t ? Yo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var B = (t, e, n) => zo(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { CommandType as Ie, ICommandService as ae, createIdentifier as Go, IContextService as tn, IUniverInstanceService as oe, Rectangle as Yn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as nn, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as zn, DEFAULT_EMPTY_DOCUMENT_VALUE as Gn, isRealNum as Zo, CellValueType as Rn, getCellValueType as Xo, LocaleService as qe, Tools as ft, Inject as K, Injector as mt, ThemeService as gt, toDisposable as Zn, DisposableCollection as Ue, RANGE_TYPE as ge, UniverInstanceType as ue, ColorKit as on, getBodySlice as In, Direction as ne, EDITOR_ACTIVATED as It, createInternalEditorID as Qo, generateRandomId as Jo, BuildTextUtils as er, RichTextBuilder as tr, isFormulaString as Re, isFormulaId as Ve, FOCUSING_DOC as nr, FOCUSING_UNIVER_EDITOR as or, Disposable as pt, isICellData as rr, ObjectMatrix as et, ILogService as sr, RxDisposable as ir, InterceptorEffectEnum as cr, DependentOn as lr, IConfigService as ar, Plugin as ur, merge as fr, registerDependencies as hr, touchDependencies as dr } from "@univerjs/core";
5
- import { SheetPasteCommand as mr, PREDEFINED_HOOK_NAME as Qe, IEditorBridgeService as Xn, SetCellEditVisibleOperation as Qn, SheetSkeletonManagerService as wt, BaseSelectionRenderService as gr, getCoordByOffset as En, checkInHeaderRanges as bn, getAllSelection as pr, genNormalSelectionStyle as Jn, getSheetObject as Sr, attachSelectionWithCoord as Gt, SelectionControl as eo, MoveSelectionCommand as Nn, JumpOver as yn, ExpandSelectionCommand as Tn, EMBEDDING_FORMULA_EDITOR as Cr, IMarkSelectionService as vr, HoverManagerService as _r, CellAlertManagerService as Rr, CellAlertType as Ir, IAutoFillService as Er, APPLY_TYPE as br, DATA_TYPE as Fn, ISheetClipboardService as Nr, COPY_TYPE as to, SELECTION_SHAPE_DEPTH as yr, useActiveWorkbook as Tr, getCurrentRangeDisable$ as no, PASTE_SPECIAL_MENU_ID as Fr, whenFormulaEditorActivated as St, SheetsUIPart as Or, RANGE_SELECTOR_COMPONENT_KEY as Mr, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as Ar } from "@univerjs/sheets-ui";
6
- import { sequenceNodeType as z, serializeRange as pe, LexerTreeBuilder as Ee, deserializeRangeWithSheetWithCache as Pr, matchRefDrawToken as xr, isFormulaLexerToken as wr, matchToken as tt, deserializeRangeWithSheet as nt, serializeRangeWithSheet as ht, generateStringWithSequence as Dr, operatorToken as oo, ERROR_TYPE_SET as Lr, ErrorType as se, FormulaDataModel as Dt, SetFormulaCalculationResultMutation as kr, SetArrayFormulaDataMutation as $r, SetFormulaCalculationStopMutation as Hr, FunctionType as Wr, UniverFormulaEnginePlugin as Ur } from "@univerjs/engine-formula";
7
- import { Subject as st, BehaviorSubject as ro, throttleTime as so, debounceTime as rn, filter as Zt, map as io, distinctUntilChanged as Vr, merge as Br, combineLatestWith as qr, switchMap as jr, of as On, Observable as Kr } from "rxjs";
8
- import { IEditorService as be, DocSelectionRenderService as co, ReplaceTextRunsCommand as Mn, MoveSelectionOperation as Yr, MoveCursorOperation as zr, useKeyboardEvent as Gr, useResize as Zr, DocBackScrollRenderController as Xr, RichTextEditor as Qr } from "@univerjs/docs-ui";
9
- import { DeviceInputEventType as Ne, ScrollTimerType as Bt, SHEET_VIEWPORT_KEY as An, Vector2 as Pn, IRenderManagerService as ye } from "@univerjs/engine-render";
10
- import { SheetsSelectionsService as sn, getSheetCommandTarget as lo, getCellAtRowCol as Jr, SetSelectionsOperation as cn, IRefSelectionsService as Lt, SelectionMoveType as qt, convertSelectionDataToRange as es, setEndForRange as ts, REF_SELECTIONS_ENABLED as xn, SetWorksheetActiveOperation as wn, SetRangeValuesMutation as Dn, SetRangeValuesUndoMutationFactory as ns, SheetInterceptorService as ao, BEFORE_CELL_EDIT as os, SetWorksheetRowAutoHeightMutation as rs, INTERCEPTOR_POINT as ss, WorksheetSetCellValuePermission as uo, WorksheetEditPermission as fo, RangeProtectionPermissionEditPoint as ho, WorkbookEditablePermission as mo } from "@univerjs/sheets";
11
- import { InsertFunctionCommand as is, IDescriptionService as kt, TriggerCalculationController as cs, UniverSheetsFormulaPlugin as ls } from "@univerjs/sheets-formula";
12
- import { ISidebarService as $t, useDependency as O, useEvent as ee, RectPopup as go, IShortcutService as Ht, KeyCode as D, MetaKeys as U, IContextMenuService as as, useObservable as Be, useUpdateEffect as us, IZenZoneService as fs, ProgressBar as hs, useInjector as ds, ILayoutService as ms, MenuItemType as ln, getMenuHiddenObservable as gs, IClipboardInterfaceService as Ln, RibbonStartGroup as ps, IMenuManagerService as Ss, IUIPartsService as po, ComponentManager as So, BuiltInUIPart as Co, connectInjector as Xt } from "@univerjs/ui";
13
- import { jsx as b, jsxs as $, Fragment as ut } from "react/jsx-runtime";
14
- import { clsx as kn, Tooltip as Cs, Dialog as vs, Input as vo, Button as Je, Popup as _o, Select as _s } from "@univerjs/design";
15
- import { forwardRef as Te, useRef as j, createElement as Le, useEffect as L, useMemo as le, useState as k, useCallback as yt, useLayoutEffect as Tt } from "react";
16
- import { DocSelectionManagerService as Ro } from "@univerjs/docs";
17
- import { debounceTime as Rs } from "rxjs/operators";
18
- const an = {
1
+ var Zo = Object.defineProperty;
2
+ var Xo = (t, e, n) => e in t ? Zo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var B = (t, e, n) => Xo(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { CommandType as Ie, ICommandService as ae, createIdentifier as Qo, IContextService as on, IUniverInstanceService as oe, Rectangle as Gn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as rn, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Zn, DEFAULT_EMPTY_DOCUMENT_VALUE as Xn, isRealNum as Jo, CellValueType as En, getCellValueType as er, LocaleService as je, Tools as ft, Inject as K, Injector as mt, ThemeService as gt, toDisposable as Qn, DisposableCollection as Ve, RANGE_TYPE as ge, UniverInstanceType as ue, ColorKit as sn, getBodySlice as bn, Direction as ne, EDITOR_ACTIVATED as bt, createInternalEditorID as tr, generateRandomId as nr, BuildTextUtils as or, RichTextBuilder as rr, isFormulaString as Re, isFormulaId as Be, FOCUSING_DOC as sr, FOCUSING_UNIVER_EDITOR as ir, Disposable as pt, isICellData as cr, ObjectMatrix as tt, ILogService as lr, RxDisposable as ar, InterceptorEffectEnum as ur, DependentOn as fr, IConfigService as hr, Plugin as dr, merge as mr, registerDependencies as gr, touchDependencies as pr } from "@univerjs/core";
5
+ import { SheetPasteCommand as Sr, PREDEFINED_HOOK_NAME as Je, IEditorBridgeService as Jn, SetCellEditVisibleOperation as eo, SheetSkeletonManagerService as Lt, BaseSelectionRenderService as Cr, getCoordByOffset as yn, checkInHeaderRanges as Nn, getAllSelection as vr, genNormalSelectionStyle as to, getSheetObject as _r, attachSelectionWithCoord as Xt, SelectionControl as no, MoveSelectionCommand as Tn, JumpOver as Fn, ExpandSelectionCommand as On, EMBEDDING_FORMULA_EDITOR as Rr, IMarkSelectionService as Ir, HoverManagerService as Er, CellAlertManagerService as br, CellAlertType as yr, IAutoFillService as Nr, APPLY_TYPE as Tr, DATA_TYPE as Mn, ISheetClipboardService as Fr, COPY_TYPE as oo, SELECTION_SHAPE_DEPTH as Or, useActiveWorkbook as Mr, getCurrentRangeDisable$ as ro, PASTE_SPECIAL_MENU_ID as Ar, whenFormulaEditorActivated as St, SheetsUIPart as Pr, RANGE_SELECTOR_COMPONENT_KEY as xr, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as wr } from "@univerjs/sheets-ui";
6
+ import { sequenceNodeType as z, serializeRange as pe, LexerTreeBuilder as Ee, deserializeRangeWithSheetWithCache as Dr, matchRefDrawToken as Lr, isFormulaLexerToken as $r, matchToken as nt, deserializeRangeWithSheet as ot, serializeRangeWithSheet as ht, generateStringWithSequence as kr, operatorToken as so, ERROR_TYPE_SET as Hr, ErrorType as se, FormulaDataModel as $t, SetFormulaCalculationResultMutation as Wr, SetArrayFormulaDataMutation as Ur, SetFormulaCalculationStopMutation as Vr, FunctionType as Br, UniverFormulaEnginePlugin as qr } from "@univerjs/engine-formula";
7
+ import { Subject as st, BehaviorSubject as io, throttleTime as co, debounceTime as cn, filter as Qt, map as lo, distinctUntilChanged as jr, merge as Kr, combineLatestWith as Yr, switchMap as zr, of as An, Observable as Gr } from "rxjs";
8
+ import { IEditorService as be, DocSelectionRenderService as ao, ReplaceTextRunsCommand as Pn, MoveSelectionOperation as Zr, MoveCursorOperation as Xr, useKeyboardEvent as Qr, useResize as Jr, DocBackScrollRenderController as es, RichTextEditor as ts } from "@univerjs/docs-ui";
9
+ import { DeviceInputEventType as ye, ScrollTimerType as jt, SHEET_VIEWPORT_KEY as xn, Vector2 as wn, IRenderManagerService as Ne } from "@univerjs/engine-render";
10
+ import { SheetsSelectionsService as ln, getSheetCommandTarget as uo, getCellAtRowCol as ns, SetSelectionsOperation as an, IRefSelectionsService as kt, SelectionMoveType as Kt, convertSelectionDataToRange as os, setEndForRange as rs, REF_SELECTIONS_ENABLED as Dn, SetWorksheetActiveOperation as Ln, SetRangeValuesMutation as $n, SetRangeValuesUndoMutationFactory as ss, SheetInterceptorService as fo, BEFORE_CELL_EDIT as is, SetWorksheetRowAutoHeightMutation as cs, INTERCEPTOR_POINT as ls, WorksheetSetCellValuePermission as ho, WorksheetEditPermission as mo, RangeProtectionPermissionEditPoint as go, WorkbookEditablePermission as po } from "@univerjs/sheets";
11
+ import { InsertFunctionCommand as as, IDescriptionService as Ht, TriggerCalculationController as us, UniverSheetsFormulaPlugin as fs } from "@univerjs/sheets-formula";
12
+ import { ISidebarService as Wt, useDependency as O, useEvent as ee, RectPopup as So, IShortcutService as Ut, KeyCode as D, MetaKeys as U, IContextMenuService as hs, useObservable as qe, useUpdateEffect as ds, IZenZoneService as ms, ProgressBar as gs, useInjector as ps, ILayoutService as Ss, MenuItemType as un, getMenuHiddenObservable as Cs, IClipboardInterfaceService as kn, RibbonStartGroup as vs, IMenuManagerService as _s, IUIPartsService as Co, ComponentManager as vo, BuiltInUIPart as _o, connectInjector as Jt } from "@univerjs/ui";
13
+ import { jsx as b, jsxs as k, Fragment as ut } from "react/jsx-runtime";
14
+ import { clsx as Hn, Tooltip as Rs, Dialog as Is, Input as Ro, Button as et, Popup as Io, Select as Es } from "@univerjs/design";
15
+ import { forwardRef as Te, useRef as j, createElement as Le, useEffect as L, useMemo as le, useState as $, useCallback as Ft, useLayoutEffect as Ot } from "react";
16
+ import { DocSelectionManagerService as Eo } from "@univerjs/docs";
17
+ import { debounceTime as bs } from "rxjs/operators";
18
+ const fn = {
19
19
  id: "sheet.command.paste-formula",
20
20
  type: Ie.COMMAND,
21
- handler: async (t) => t.get(ae).executeCommand(mr.id, {
22
- value: Qe.SPECIAL_PASTE_FORMULA
21
+ handler: async (t) => t.get(ae).executeCommand(Sr.id, {
22
+ value: Je.SPECIAL_PASTE_FORMULA
23
23
  })
24
- }, ot = {
24
+ }, rt = {
25
25
  id: "formula-ui.operation.select-editor-formula",
26
26
  type: Ie.OPERATION,
27
27
  handler: (t, e) => !0
28
28
  };
29
- var Is = Object.getOwnPropertyDescriptor, Es = (t, e, n, o) => {
30
- for (var r = o > 1 ? void 0 : o ? Is(e, n) : e, s = t.length - 1, i; s >= 0; s--)
29
+ var ys = Object.getOwnPropertyDescriptor, Ns = (t, e, n, o) => {
30
+ for (var r = o > 1 ? void 0 : o ? ys(e, n) : e, s = t.length - 1, i; s >= 0; s--)
31
31
  (i = t[s]) && (r = i(r) || r);
32
32
  return r;
33
- }, bs = (t, e) => (n, o) => e(n, o, t);
34
- const Ns = "FORMULA_PROMPT_ACTIVATED", Ct = Go("formula-ui.prompt-service");
35
- let Qt = class {
33
+ }, Ts = (t, e) => (n, o) => e(n, o, t);
34
+ const Fs = "FORMULA_PROMPT_ACTIVATED", Ct = Qo("formula-ui.prompt-service");
35
+ let en = class {
36
36
  constructor(t) {
37
37
  B(this, "_search$", new st());
38
38
  B(this, "_help$", new st());
@@ -55,7 +55,7 @@ let Qt = class {
55
55
  this._search$.complete(), this._help$.complete(), this._navigate$.complete(), this._accept$.complete(), this._acceptFormulaName$.complete(), this._sequenceNodes = [];
56
56
  }
57
57
  search(t) {
58
- this._contextService.setContextValue(Ns, t.visible), this._searching = t.visible, this._search$.next(t);
58
+ this._contextService.setContextValue(Fs, t.visible), this._searching = t.visible, this._search$.next(t);
59
59
  }
60
60
  isSearching() {
61
61
  return this._searching;
@@ -125,8 +125,8 @@ let Qt = class {
125
125
  const c = this._sequenceNodes[s];
126
126
  if (typeof c == "string")
127
127
  continue;
128
- const a = { ...c };
129
- a.startIndex += o, a.endIndex += o, this._sequenceNodes[s] = a;
128
+ const l = { ...c };
129
+ l.startIndex += o, l.endIndex += o, this._sequenceNodes[s] = l;
130
130
  }
131
131
  }
132
132
  /**
@@ -164,8 +164,8 @@ let Qt = class {
164
164
  const c = this._sequenceNodes[s];
165
165
  if (typeof c == "string")
166
166
  continue;
167
- const a = { ...c };
168
- a.startIndex += r, a.endIndex += r, this._sequenceNodes[s] = a;
167
+ const l = { ...c };
168
+ l.startIndex += r, l.endIndex += r, this._sequenceNodes[s] = l;
169
169
  }
170
170
  }
171
171
  enableLockedSelectionChange() {
@@ -187,85 +187,85 @@ let Qt = class {
187
187
  return this._isLockedOnSelectionInsertRefString;
188
188
  }
189
189
  };
190
- Qt = Es([
191
- bs(0, tn)
192
- ], Qt);
193
- const ys = {
190
+ en = Ns([
191
+ Ts(0, on)
192
+ ], en);
193
+ const Os = {
194
194
  id: "formula-ui.operation.help-function",
195
195
  type: Ie.OPERATION,
196
196
  handler: async (t, e) => (t.get(Ct).help(e), !0)
197
- }, un = {
197
+ }, hn = {
198
198
  id: "formula-ui.operation.insert-function",
199
199
  type: Ie.OPERATION,
200
200
  // eslint-disable-next-line
201
201
  handler: async (t, e) => {
202
- var S, C;
203
- const n = t.get(sn), o = t.get(be), r = n.getCurrentSelections();
202
+ var C, S;
203
+ const n = t.get(ln), o = t.get(be), r = n.getCurrentSelections();
204
204
  if (!r || !r.length)
205
205
  return !1;
206
- const s = lo(t.get(oe));
206
+ const s = uo(t.get(oe));
207
207
  if (!s) return !1;
208
- const { worksheet: i, unitId: c, subUnitId: a } = s, h = i.getCellMatrix(), { value: u } = e, m = t.get(ae);
209
- t.get(Xn);
210
- const l = [], d = [];
211
- let f = null, R = 0, g = 0, p = "";
212
- if (r.length === 1 && (Os(r[0].range) || Ms(r[0].range) && Hn(h, r[0].range))) {
213
- const { range: v, primary: I } = r[0], T = (S = I == null ? void 0 : I.actualRow) != null ? S : v.startRow, w = (C = I == null ? void 0 : I.actualColumn) != null ? C : v.startColumn;
214
- f = v, R = T, g = w;
215
- const A = $n(h, T, w);
208
+ const { worksheet: i, unitId: c, subUnitId: l } = s, h = i.getCellMatrix(), { value: f } = e, m = t.get(ae);
209
+ t.get(Jn);
210
+ const u = [], d = [];
211
+ let a = null, I = 0, g = 0, p = "";
212
+ if (r.length === 1 && (Ps(r[0].range) || xs(r[0].range) && Un(h, r[0].range))) {
213
+ const { range: v, primary: _ } = r[0], T = (C = _ == null ? void 0 : _.actualRow) != null ? C : v.startRow, w = (S = _ == null ? void 0 : _.actualColumn) != null ? S : v.startColumn;
214
+ a = v, I = T, g = w;
215
+ const A = Wn(h, T, w);
216
216
  A && (p = pe(A));
217
217
  } else
218
218
  r.some((v) => {
219
219
  var w, A;
220
- const { range: I, primary: T } = v;
221
- if (Hn(h, I)) {
222
- const M = (w = T == null ? void 0 : T.actualRow) != null ? w : I.startRow, _ = (A = T == null ? void 0 : T.actualColumn) != null ? A : I.startColumn, N = $n(h, M, _);
223
- if (!N)
224
- return f = I, R = M, g = _, !0;
225
- const P = pe(N), y = `=${u}(${P})`;
226
- l.push({
227
- range: I,
220
+ const { range: _, primary: T } = v;
221
+ if (Un(h, _)) {
222
+ const M = (w = T == null ? void 0 : T.actualRow) != null ? w : _.startRow, R = (A = T == null ? void 0 : T.actualColumn) != null ? A : _.startColumn, y = Wn(h, M, R);
223
+ if (!y)
224
+ return a = _, I = M, g = R, !0;
225
+ const P = pe(y), N = `=${f}(${P})`;
226
+ u.push({
227
+ range: _,
228
228
  primary: {
229
229
  row: M,
230
- column: _
230
+ column: R
231
231
  },
232
- formula: y
232
+ formula: N
233
233
  });
234
234
  } else {
235
- const { startRow: M, startColumn: _, endRow: N, endColumn: P } = I;
236
- if (M === N) {
237
- const y = As(h, M, P, i.getColumnCount() - 1), E = y === P ? P - 1 : P, F = pe({
235
+ const { startRow: M, startColumn: R, endRow: y, endColumn: P } = _;
236
+ if (M === y) {
237
+ const N = ws(h, M, P, i.getColumnCount() - 1), E = N === P ? P - 1 : P, F = pe({
238
238
  startRow: M,
239
- endRow: N,
240
- startColumn: _,
239
+ endRow: y,
240
+ startColumn: R,
241
241
  endColumn: E
242
- }), x = `=${u}(${F})`;
242
+ }), x = `=${f}(${F})`;
243
243
  d.push({
244
- range: I,
244
+ range: _,
245
245
  primary: {
246
246
  row: M,
247
- column: y
247
+ column: N
248
248
  },
249
249
  formula: x
250
250
  });
251
251
  } else {
252
- let y = -1;
253
- for (let F = _; F <= P; F++) {
254
- const x = Ps(h, F, N, i.getRowCount() - 1);
255
- y = Math.max(y, x);
252
+ let N = -1;
253
+ for (let F = R; F <= P; F++) {
254
+ const x = Ds(h, F, y, i.getRowCount() - 1);
255
+ N = Math.max(N, x);
256
256
  }
257
- const E = y === N ? N - 1 : N;
258
- for (let F = _; F <= P; F++) {
257
+ const E = N === y ? y - 1 : y;
258
+ for (let F = R; F <= P; F++) {
259
259
  const x = pe({
260
260
  startRow: M,
261
261
  endRow: E,
262
262
  startColumn: F,
263
263
  endColumn: F
264
- }), H = `=${u}(${x})`;
264
+ }), H = `=${f}(${x})`;
265
265
  d.push({
266
- range: I,
266
+ range: _,
267
267
  primary: {
268
- row: y,
268
+ row: N,
269
269
  column: F
270
270
  },
271
271
  formula: H
@@ -275,42 +275,42 @@ const ys = {
275
275
  }
276
276
  return !1;
277
277
  });
278
- if (f) {
279
- const v = Jr(R, g, i), I = {
280
- range: Yn.clone(f),
278
+ if (a) {
279
+ const v = ns(I, g, i), _ = {
280
+ range: Gn.clone(a),
281
281
  primary: {
282
282
  startRow: v.startRow,
283
283
  startColumn: v.startColumn,
284
284
  endRow: v.endRow,
285
285
  endColumn: v.endColumn,
286
- actualRow: R,
286
+ actualRow: I,
287
287
  actualColumn: g,
288
288
  isMerged: v.isMerged,
289
- isMergedMainCell: v.startRow === R && v.startColumn === g
289
+ isMergedMainCell: v.startRow === I && v.startColumn === g
290
290
  }
291
291
  }, T = {
292
292
  unitId: c,
293
- subUnitId: a,
294
- selections: [I]
293
+ subUnitId: l,
294
+ selections: [_]
295
295
  };
296
- await m.executeCommand(cn.id, T);
297
- const w = o.getEditor(nn), A = o.getEditor(zn);
298
- m.syncExecuteCommand(Qn.id, {
296
+ await m.executeCommand(an.id, T);
297
+ const w = o.getEditor(rn), A = o.getEditor(Zn);
298
+ m.syncExecuteCommand(eo.id, {
299
299
  visible: !0,
300
300
  unitId: c,
301
- eventType: Ne.Dblclick
301
+ eventType: ye.Dblclick
302
302
  });
303
- const M = `=${u}(${p}`;
303
+ const M = `=${f}(${p}`;
304
304
  w == null || w.replaceText(M), A == null || A.replaceText(M, !1);
305
305
  }
306
- return l.length === 0 && d.length === 0 ? !1 : m.executeCommand(is.id, {
307
- list: l,
306
+ return u.length === 0 && d.length === 0 ? !1 : m.executeCommand(as.id, {
307
+ list: u,
308
308
  listOfRangeHasNumber: d
309
309
  });
310
310
  }
311
311
  };
312
- function $n(t, e, n) {
313
- const o = Ts(t, e, n);
312
+ function Wn(t, e, n) {
313
+ const o = Ms(t, e, n);
314
314
  if (o !== e)
315
315
  return {
316
316
  startRow: o,
@@ -318,7 +318,7 @@ function $n(t, e, n) {
318
318
  startColumn: n,
319
319
  endColumn: n
320
320
  };
321
- const r = Fs(t, e, n);
321
+ const r = As(t, e, n);
322
322
  return r !== n ? {
323
323
  startRow: e,
324
324
  endRow: e,
@@ -326,7 +326,7 @@ function $n(t, e, n) {
326
326
  endColumn: n - 1
327
327
  } : null;
328
328
  }
329
- function Ts(t, e, n) {
329
+ function Ms(t, e, n) {
330
330
  let o = !1;
331
331
  if (e === 0) return e;
332
332
  for (let r = e - 1; r >= 0; r--) {
@@ -343,7 +343,7 @@ function Ts(t, e, n) {
343
343
  }
344
344
  return e;
345
345
  }
346
- function Fs(t, e, n) {
346
+ function As(t, e, n) {
347
347
  let o = !1;
348
348
  if (n === 0) return n;
349
349
  for (let r = n - 1; r >= 0; r--) {
@@ -365,52 +365,52 @@ function dt(t) {
365
365
  const e = t == null ? void 0 : t.p.body;
366
366
  if (e == null)
367
367
  return !1;
368
- const n = e.dataStream, r = n.substring(n.length - 2, n.length) === Gn ? n.substring(0, n.length - 2) : n;
369
- return Zo(r);
368
+ const n = e.dataStream, r = n.substring(n.length - 2, n.length) === Xn ? n.substring(0, n.length - 2) : n;
369
+ return Jo(r);
370
370
  }
371
- return t && (t.t === Rn.NUMBER || Xo(t) === Rn.NUMBER);
371
+ return t && (t.t === En.NUMBER || er(t) === En.NUMBER);
372
372
  }
373
- function Os(t) {
373
+ function Ps(t) {
374
374
  return t.startRow === t.endRow && t.startColumn === t.endColumn;
375
375
  }
376
- function Ms(t) {
376
+ function xs(t) {
377
377
  return t.startRow !== t.endRow && t.startColumn !== t.endColumn;
378
378
  }
379
- function Hn(t, e) {
379
+ function Un(t, e) {
380
380
  for (let n = e.startRow; n <= e.endRow; n++)
381
381
  for (let o = e.startColumn; o <= e.endColumn; o++)
382
382
  if (dt(t.getValue(n, o)))
383
383
  return !1;
384
384
  return !0;
385
385
  }
386
- function As(t, e, n, o) {
386
+ function ws(t, e, n, o) {
387
387
  for (let r = n; r <= o; r++)
388
388
  if (!t.getValue(e, r))
389
389
  return r;
390
390
  return o;
391
391
  }
392
- function Ps(t, e, n, o) {
392
+ function Ds(t, e, n, o) {
393
393
  for (let r = n; r <= o; r++)
394
394
  if (!t.getValue(r, e))
395
395
  return r;
396
396
  return o;
397
397
  }
398
- const Io = "SHEET_FORMULA_UI_PLUGIN", Eo = `${Io}_MORE_FUNCTIONS_COMPONENT`, fn = {
398
+ const bo = "SHEET_FORMULA_UI_PLUGIN", yo = `${bo}_MORE_FUNCTIONS_COMPONENT`, dn = {
399
399
  id: "formula-ui.operation.more-functions",
400
400
  type: Ie.OPERATION,
401
- handler: async (t) => (t.get($t).open({
401
+ handler: async (t) => (t.get(Wt).open({
402
402
  header: { title: "formula.insert.tooltip" },
403
- children: { label: Eo }
403
+ children: { label: yo }
404
404
  }), !0)
405
- }, bo = {
405
+ }, No = {
406
406
  id: "formula-ui.operation.change-ref-to-absolute",
407
407
  type: Ie.OPERATION,
408
408
  handler: async (t) => !0
409
- }, xs = {
409
+ }, Ls = {
410
410
  id: "formula-ui.operation.search-function",
411
411
  type: Ie.OPERATION,
412
412
  handler: async (t, e) => (t.get(Ct).search(e), !0)
413
- }, hn = (t, e, n = !0) => {
413
+ }, mn = (t, e, n = !0) => {
414
414
  let o = -1;
415
415
  return t.reduce((r, s, i) => {
416
416
  if (r.isFinish)
@@ -419,12 +419,12 @@ const Io = "SHEET_FORMULA_UI_PLUGIN", Eo = `${Io}_MORE_FUNCTIONS_COMPONENT`, fn
419
419
  if (typeof s != "string")
420
420
  r.currentIndex += s.token.length;
421
421
  else {
422
- const a = s.length;
423
- r.currentIndex += a;
422
+ const l = s.length;
423
+ r.currentIndex += l;
424
424
  }
425
425
  return (n ? r.currentIndex === e : e > c && e <= r.currentIndex) && (o = i, r.isFinish = !0), r;
426
426
  }, { currentIndex: 0, isFinish: !1 }), o;
427
- }, No = (t, e) => {
427
+ }, To = (t, e) => {
428
428
  const n = t[e];
429
429
  let o = -1;
430
430
  if (!n || typeof n == "string" || n.nodeType !== z.REFERENCE) return -1;
@@ -442,23 +442,23 @@ var ce = function() {
442
442
  }
443
443
  return t;
444
444
  }, ce.apply(this, arguments);
445
- }, ws = function(t, e) {
445
+ }, $s = function(t, e) {
446
446
  var n = {};
447
447
  for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
448
448
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
449
449
  for (var r = 0, o = Object.getOwnPropertySymbols(t); r < o.length; r++)
450
450
  e.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[r]) && (n[o[r]] = t[o[r]]);
451
451
  return n;
452
- }, ke = Te(function(t, e) {
453
- var n = t.icon, o = t.id, r = t.className, s = t.extend, i = ws(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(o, " ").concat(r || "").trim(), a = j("_".concat(ks()));
454
- return yo(n, "".concat(o), { defIds: n.defIds, idSuffix: a.current }, ce({ ref: e, className: c }, i), s);
452
+ }, $e = Te(function(t, e) {
453
+ var n = t.icon, o = t.id, r = t.className, s = t.extend, i = $s(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(o, " ").concat(r || "").trim(), l = j("_".concat(Ws()));
454
+ return Fo(n, "".concat(o), { defIds: n.defIds, idSuffix: l.current }, ce({ ref: e, className: c }, i), s);
455
455
  });
456
- function yo(t, e, n, o, r) {
457
- return Le(t.tag, ce(ce({ key: e }, Ds(t, n, r)), o), (Ls(t, n).children || []).map(function(s, i) {
458
- return yo(s, "".concat(e, "-").concat(t.tag, "-").concat(i), n, void 0, r);
456
+ function Fo(t, e, n, o, r) {
457
+ return Le(t.tag, ce(ce({ key: e }, ks(t, n, r)), o), (Hs(t, n).children || []).map(function(s, i) {
458
+ return Fo(s, "".concat(e, "-").concat(t.tag, "-").concat(i), n, void 0, r);
459
459
  }));
460
460
  }
461
- function Ds(t, e, n) {
461
+ function ks(t, e, n) {
462
462
  var o = ce({}, t.attrs);
463
463
  n != null && n.colorChannel1 && o.fill === "colorChannel1" && (o.fill = n.colorChannel1), t.tag === "mask" && o.id && (o.id = o.id + e.idSuffix), Object.entries(o).forEach(function(s) {
464
464
  var i = s[0], c = s[1];
@@ -470,79 +470,79 @@ function Ds(t, e, n) {
470
470
  typeof c == "string" && (o[i] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
471
471
  })), o;
472
472
  }
473
- function Ls(t, e) {
473
+ function Hs(t, e) {
474
474
  var n, o = e.defIds;
475
475
  return !o || o.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? ce(ce({}, t), { children: t.children.map(function(r) {
476
476
  return typeof r.attrs.id == "string" && o && o.indexOf(r.attrs.id) > -1 ? ce(ce({}, r), { attrs: ce(ce({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
477
477
  }) }) : t;
478
478
  }
479
- function ks() {
479
+ function Ws() {
480
480
  return Math.random().toString(36).substring(2, 8);
481
481
  }
482
- ke.displayName = "UniverIcon";
483
- var $s = { 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" } }] }, To = Te(function(t, e) {
484
- return Le(ke, Object.assign({}, t, {
482
+ $e.displayName = "UniverIcon";
483
+ var Us = { 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" } }] }, Oo = Te(function(t, e) {
484
+ return Le($e, Object.assign({}, t, {
485
485
  id: "check-mark-single",
486
486
  ref: e,
487
- icon: $s
487
+ icon: Us
488
488
  }));
489
489
  });
490
- To.displayName = "CheckMarkSingle";
491
- var Hs = { 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" } }] }, Wt = Te(function(t, e) {
492
- return Le(ke, Object.assign({}, t, {
490
+ Oo.displayName = "CheckMarkSingle";
491
+ var Vs = { 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" } }] }, Vt = Te(function(t, e) {
492
+ return Le($e, Object.assign({}, t, {
493
493
  id: "close-single",
494
494
  ref: e,
495
- icon: Hs
495
+ icon: Vs
496
496
  }));
497
497
  });
498
- Wt.displayName = "CloseSingle";
499
- var Ws = { 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" } }] }, Fo = Te(function(t, e) {
500
- return Le(ke, Object.assign({}, t, {
498
+ Vt.displayName = "CloseSingle";
499
+ var Bs = { 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" } }] }, Mo = Te(function(t, e) {
500
+ return Le($e, Object.assign({}, t, {
501
501
  id: "delete-single",
502
502
  ref: e,
503
- icon: Ws
503
+ icon: Bs
504
504
  }));
505
505
  });
506
- Fo.displayName = "DeleteSingle";
507
- var Us = { 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" } }] }, Oo = Te(function(t, e) {
508
- return Le(ke, Object.assign({}, t, {
506
+ Mo.displayName = "DeleteSingle";
507
+ var qs = { 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" } }] }, Ao = Te(function(t, e) {
508
+ return Le($e, Object.assign({}, t, {
509
509
  id: "details-single",
510
510
  ref: e,
511
- icon: Us
511
+ icon: qs
512
512
  }));
513
513
  });
514
- Oo.displayName = "DetailsSingle";
515
- var Vs = { 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" } }] }, Mo = Te(function(t, e) {
516
- return Le(ke, Object.assign({}, t, {
514
+ Ao.displayName = "DetailsSingle";
515
+ var js = { 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" } }] }, Po = Te(function(t, e) {
516
+ return Le($e, Object.assign({}, t, {
517
517
  id: "increase-single",
518
518
  ref: e,
519
- icon: Vs
519
+ icon: js
520
520
  }));
521
521
  });
522
- Mo.displayName = "IncreaseSingle";
523
- var Bs = { 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" } }] }, dn = Te(function(t, e) {
524
- return Le(ke, Object.assign({}, t, {
522
+ Po.displayName = "IncreaseSingle";
523
+ var Ks = { 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" } }] }, gn = Te(function(t, e) {
524
+ return Le($e, Object.assign({}, t, {
525
525
  id: "more-single",
526
526
  ref: e,
527
- icon: Bs
527
+ icon: Ks
528
528
  }));
529
529
  });
530
- dn.displayName = "MoreSingle";
531
- var qs = { 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" } }] }, Ao = Te(function(t, e) {
532
- return Le(ke, Object.assign({}, t, {
530
+ gn.displayName = "MoreSingle";
531
+ var Ys = { 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" } }] }, xo = Te(function(t, e) {
532
+ return Le($e, Object.assign({}, t, {
533
533
  id: "select-range-single",
534
534
  ref: e,
535
- icon: qs
535
+ icon: Ys
536
536
  }));
537
537
  });
538
- Ao.displayName = "SelectRangeSingle";
539
- function js(t, e) {
538
+ xo.displayName = "SelectRangeSingle";
539
+ function zs(t, e) {
540
540
  return Object.keys(t).filter((n) => isNaN(Number(n)) && n !== "DefinedName").map((n) => ({
541
541
  label: e.t(`formula.functionType.${n.toLocaleLowerCase()}`),
542
542
  value: `${t[n]}`
543
543
  }));
544
544
  }
545
- function mn(t) {
545
+ function pn(t) {
546
546
  if (!t.require && !t.repeat)
547
547
  return `[${t.name}]`;
548
548
  if (t.require && !t.repeat)
@@ -552,7 +552,7 @@ function mn(t) {
552
552
  if (t.require && t.repeat)
553
553
  return `${t.name},...`;
554
554
  }
555
- const Ks = (t, e = 100) => {
555
+ const Gs = (t, e = 100) => {
556
556
  L(() => {
557
557
  let n = null;
558
558
  const o = () => {
@@ -565,58 +565,58 @@ const Ks = (t, e = 100) => {
565
565
  };
566
566
  }, [t, e]);
567
567
  };
568
- function Po(t, e, n) {
569
- const o = O(be), r = le(() => new ro({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = O($t), i = O(oe), c = ee(() => {
570
- const a = o.getEditor(t);
571
- if (!a)
568
+ function wo(t, e, n) {
569
+ const o = O(be), r = le(() => new io({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = O(Wt), i = O(oe), c = ee(() => {
570
+ const l = o.getEditor(t);
571
+ if (!l)
572
572
  return;
573
- const h = a.getBoundingClientRect(), { left: u, top: m, right: l, bottom: d } = h, f = r.getValue();
574
- if (!(f.left === u && f.top === m && f.right === l && f.bottom === d))
575
- return r.next({ left: u - 1, right: l + 1, top: m - 1, bottom: d + 1 }), h;
573
+ const h = l.getBoundingClientRect(), { left: f, top: m, right: u, bottom: d } = h, a = r.getValue();
574
+ if (!(a.left === f && a.top === m && a.right === u && a.bottom === d))
575
+ return r.next({ left: f - 1, right: u + 1, top: m - 1, bottom: d + 1 }), h;
576
576
  });
577
577
  return L(() => {
578
578
  e && c();
579
- }, [t, o, i.unitAdded$, c, e, ...n != null ? n : []]), Ks(c), L(() => {
580
- const a = s.scrollEvent$.pipe(so(100)).subscribe(c);
579
+ }, [t, o, i.unitAdded$, c, e, ...n != null ? n : []]), Gs(c), L(() => {
580
+ const l = s.scrollEvent$.pipe(co(100)).subscribe(c);
581
581
  return () => {
582
- a.unsubscribe();
582
+ l.unsubscribe();
583
583
  };
584
584
  }, []), [r, c];
585
585
  }
586
- const je = (t) => {
586
+ const Ke = (t) => {
587
587
  const e = j(t);
588
588
  return e.current = t, e;
589
- }, Ys = (t, e, n) => {
590
- const o = O(kt), r = O(Ee), [s, i] = k(), [c, a] = k(-1), [h, u] = k(!0), m = je(h), l = j(e);
591
- l.current = e;
589
+ }, Zs = (t, e, n) => {
590
+ const o = O(Ht), r = O(Ee), [s, i] = $(), [c, l] = $(-1), [h, f] = $(!0), m = Ke(h), u = j(e);
591
+ u.current = e;
592
592
  const d = () => {
593
- i(void 0), a(-1), u(!1);
593
+ i(void 0), l(-1), f(!1);
594
594
  };
595
595
  return L(() => {
596
596
  if (n && t) {
597
- const f = n.selectionChange$.pipe(rn(50)).subscribe((g) => {
597
+ const a = n.selectionChange$.pipe(cn(50)).subscribe((g) => {
598
598
  if (g.textRanges.length === 1) {
599
599
  const [p] = g.textRanges;
600
600
  if (p.collapsed && m.current) {
601
- const S = r.getFunctionAndParameter(`${l.current}A`, p.startOffset - 1);
602
- if (S) {
603
- const { functionName: C, paramIndex: v } = S, I = o.getFunctionInfo(C);
604
- i(I), a(v);
601
+ const C = r.getFunctionAndParameter(`${u.current}A`, p.startOffset - 1);
602
+ if (C) {
603
+ const { functionName: S, paramIndex: v } = C, _ = o.getFunctionInfo(S);
604
+ i(_), l(v);
605
605
  return;
606
606
  }
607
607
  }
608
608
  }
609
- i(void 0), a(-1);
610
- }), R = n.selectionChange$.pipe(
611
- Zt((g) => g.isEditing),
612
- Zt((g) => g.textRanges.length === 1),
613
- io((g) => g.textRanges[0].startOffset),
614
- Vr()
609
+ i(void 0), l(-1);
610
+ }), I = n.selectionChange$.pipe(
611
+ Qt((g) => g.isEditing),
612
+ Qt((g) => g.textRanges.length === 1),
613
+ lo((g) => g.textRanges[0].startOffset),
614
+ jr()
615
615
  ).subscribe(() => {
616
- u(!0);
616
+ f(!0);
617
617
  });
618
618
  return () => {
619
- f.unsubscribe(), R.unsubscribe();
619
+ a.unsubscribe(), I.unsubscribe();
620
620
  };
621
621
  }
622
622
  }, [n, t]), L(() => {
@@ -626,22 +626,22 @@ const je = (t) => {
626
626
  paramIndex: c,
627
627
  reset: d
628
628
  };
629
- }, zs = "univer-formula-help-function", Gs = "univer-formula-help-function-title", Zs = "univer-formula-help-function-title-icons", Xs = "univer-formula-help-function-title-icon", Qs = "univer-formula-help-function-content", Js = "univer-formula-help-function-content-inner", ei = "univer-formula-help-function-content-params", ti = "univer-formula-help-function-content-params-title", ni = "univer-formula-help-function-content-params-detail", oi = "univer-formula-help-function-active", ri = "univer-formula-help-param", si = "univer-formula-help-param-prefix", ii = "univer-formula-help-param-item", ci = "univer-formula-help-param-active", J = {
630
- formulaHelpFunction: zs,
631
- formulaHelpFunctionTitle: Gs,
632
- formulaHelpFunctionTitleIcons: Zs,
633
- formulaHelpFunctionTitleIcon: Xs,
634
- formulaHelpFunctionContent: Qs,
635
- formulaHelpFunctionContentInner: Js,
636
- formulaHelpFunctionContentParams: ei,
637
- formulaHelpFunctionContentParamsTitle: ti,
638
- formulaHelpFunctionContentParamsDetail: ni,
639
- formulaHelpFunctionActive: oi,
640
- formulaHelpParam: ri,
641
- formulaHelpParamPrefix: si,
642
- formulaHelpParamItem: ii,
643
- formulaHelpParamActive: ci
644
- }, jt = ({ className: t, title: e, value: n }) => /* @__PURE__ */ $("div", { className: J.formulaHelpFunctionContentParams, children: [
629
+ }, Xs = "univer-formula-help-function", Qs = "univer-formula-help-function-title", Js = "univer-formula-help-function-title-icons", ei = "univer-formula-help-function-title-icon", ti = "univer-formula-help-function-content", ni = "univer-formula-help-function-content-inner", oi = "univer-formula-help-function-content-params", ri = "univer-formula-help-function-content-params-title", si = "univer-formula-help-function-content-params-detail", ii = "univer-formula-help-function-active", ci = "univer-formula-help-param", li = "univer-formula-help-param-prefix", ai = "univer-formula-help-param-item", ui = "univer-formula-help-param-active", J = {
630
+ formulaHelpFunction: Xs,
631
+ formulaHelpFunctionTitle: Qs,
632
+ formulaHelpFunctionTitleIcons: Js,
633
+ formulaHelpFunctionTitleIcon: ei,
634
+ formulaHelpFunctionContent: ti,
635
+ formulaHelpFunctionContentInner: ni,
636
+ formulaHelpFunctionContentParams: oi,
637
+ formulaHelpFunctionContentParamsTitle: ri,
638
+ formulaHelpFunctionContentParamsDetail: si,
639
+ formulaHelpFunctionActive: ii,
640
+ formulaHelpParam: ci,
641
+ formulaHelpParamPrefix: li,
642
+ formulaHelpParamItem: ai,
643
+ formulaHelpParamActive: ui
644
+ }, Yt = ({ className: t, title: e, value: n }) => /* @__PURE__ */ k("div", { className: J.formulaHelpFunctionContentParams, children: [
645
645
  /* @__PURE__ */ b(
646
646
  "div",
647
647
  {
@@ -653,40 +653,40 @@ const je = (t) => {
653
653
  }
654
654
  ),
655
655
  /* @__PURE__ */ b("div", { className: J.formulaHelpFunctionContentParamsDetail, children: n })
656
- ] }), li = (t) => {
656
+ ] }), fi = (t) => {
657
657
  const { prefix: e, value: n, active: o, onClick: r } = t;
658
- return /* @__PURE__ */ $("div", { className: J.formulaHelpParam, children: [
659
- /* @__PURE__ */ $("span", { className: J.formulaHelpParamPrefix, children: [
658
+ return /* @__PURE__ */ k("div", { className: J.formulaHelpParam, children: [
659
+ /* @__PURE__ */ k("span", { className: J.formulaHelpParamPrefix, children: [
660
660
  e,
661
661
  "("
662
662
  ] }),
663
- n && n.map((s, i) => /* @__PURE__ */ $("span", { className: J.formulaHelpParamItem, children: [
663
+ n && n.map((s, i) => /* @__PURE__ */ k("span", { className: J.formulaHelpParamItem, children: [
664
664
  /* @__PURE__ */ b(
665
665
  "span",
666
666
  {
667
667
  className: o === i ? J.formulaHelpFunctionActive : J.formulaHelpParamActive,
668
668
  onClick: () => r(i),
669
- children: mn(s)
669
+ children: pn(s)
670
670
  }
671
671
  ),
672
672
  i === n.length - 1 ? "" : ","
673
673
  ] }, s.name)),
674
674
  ")"
675
675
  ] });
676
- }, Wn = () => {
676
+ }, Vn = () => {
677
677
  };
678
- function ai(t) {
679
- const { onParamsSwitch: e = Wn, onClose: n = Wn, isFocus: o, editor: r, formulaText: s } = t, { functionInfo: i, paramIndex: c, reset: a } = Ys(o, s, r), h = le(() => !!i && c >= 0, [i, c]), [u, m] = k(!0), l = O(qe), d = l.t("formula.prompt.required"), f = l.t("formula.prompt.optional"), R = r.getEditorId(), [g] = Po(R, h, [i, c]);
680
- function p(C) {
681
- e && e(C);
678
+ function hi(t) {
679
+ const { onParamsSwitch: e = Vn, onClose: n = Vn, isFocus: o, editor: r, formulaText: s } = t, { functionInfo: i, paramIndex: c, reset: l } = Zs(o, s, r), h = le(() => !!i && c >= 0, [i, c]), [f, m] = $(!0), u = O(je), d = u.t("formula.prompt.required"), a = u.t("formula.prompt.optional"), I = r.getEditorId(), [g] = wo(I, h, [i, c]);
680
+ function p(S) {
681
+ e && e(S);
682
682
  }
683
- const S = () => {
684
- a(), n();
683
+ const C = () => {
684
+ l(), n();
685
685
  };
686
- return h && i ? /* @__PURE__ */ b(go, { portal: !0, onClickOutside: () => a(), anchorRect$: g, direction: "vertical", children: /* @__PURE__ */ $("div", { className: J.formulaHelpFunction, children: [
687
- /* @__PURE__ */ $("div", { className: J.formulaHelpFunctionTitle, children: [
686
+ return h && i ? /* @__PURE__ */ b(So, { portal: !0, onClickOutside: () => l(), anchorRect$: g, direction: "vertical", children: /* @__PURE__ */ k("div", { className: J.formulaHelpFunction, children: [
687
+ /* @__PURE__ */ k("div", { className: J.formulaHelpFunctionTitle, children: [
688
688
  /* @__PURE__ */ b(
689
- li,
689
+ fi,
690
690
  {
691
691
  prefix: i.functionName,
692
692
  value: i.functionParameter,
@@ -694,22 +694,22 @@ function ai(t) {
694
694
  onClick: p
695
695
  }
696
696
  ),
697
- /* @__PURE__ */ $("div", { className: J.formulaHelpFunctionTitleIcons, children: [
697
+ /* @__PURE__ */ k("div", { className: J.formulaHelpFunctionTitleIcons, children: [
698
698
  /* @__PURE__ */ b(
699
699
  "div",
700
700
  {
701
701
  className: J.formulaHelpFunctionTitleIcon,
702
- style: { transform: u ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
703
- onClick: () => m(!u),
704
- children: /* @__PURE__ */ b(dn, {})
702
+ style: { transform: f ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
703
+ onClick: () => m(!f),
704
+ children: /* @__PURE__ */ b(gn, {})
705
705
  }
706
706
  ),
707
707
  /* @__PURE__ */ b(
708
708
  "div",
709
709
  {
710
710
  className: J.formulaHelpFunctionTitleIcon,
711
- onClick: S,
712
- children: /* @__PURE__ */ b(Wt, {})
711
+ onClick: C,
712
+ children: /* @__PURE__ */ b(Vt, {})
713
713
  }
714
714
  )
715
715
  ] })
@@ -719,30 +719,30 @@ function ai(t) {
719
719
  {
720
720
  className: J.formulaHelpFunctionContent,
721
721
  style: {
722
- height: u ? "unset" : 0,
723
- padding: u ? "revert-layer" : 0
722
+ height: f ? "unset" : 0,
723
+ padding: f ? "revert-layer" : 0
724
724
  },
725
- children: /* @__PURE__ */ $("div", { className: J.formulaHelpFunctionContentInner, children: [
725
+ children: /* @__PURE__ */ k("div", { className: J.formulaHelpFunctionContentInner, children: [
726
726
  /* @__PURE__ */ b(
727
- jt,
727
+ Yt,
728
728
  {
729
- title: l.t("formula.prompt.helpExample"),
730
- value: `${i.functionName}(${i.functionParameter.map((C) => C.example).join(",")})`
729
+ title: u.t("formula.prompt.helpExample"),
730
+ value: `${i.functionName}(${i.functionParameter.map((S) => S.example).join(",")})`
731
731
  }
732
732
  ),
733
733
  /* @__PURE__ */ b(
734
- jt,
734
+ Yt,
735
735
  {
736
- title: l.t("formula.prompt.helpAbstract"),
736
+ title: u.t("formula.prompt.helpAbstract"),
737
737
  value: i.description
738
738
  }
739
739
  ),
740
- i && i.functionParameter && i.functionParameter.map((C, v) => /* @__PURE__ */ b(
741
- jt,
740
+ i && i.functionParameter && i.functionParameter.map((S, v) => /* @__PURE__ */ b(
741
+ Yt,
742
742
  {
743
743
  className: c === v ? J.formulaHelpFunctionActive : "",
744
- title: C.name,
745
- value: `${C.require ? d : f} ${C.detail}`
744
+ title: S.name,
745
+ value: `${S.require ? d : a} ${S.detail}`
746
746
  },
747
747
  v
748
748
  ))
@@ -751,7 +751,7 @@ function ai(t) {
751
751
  )
752
752
  ] }) }) : null;
753
753
  }
754
- const ui = (t) => {
754
+ const di = (t) => {
755
755
  const e = O(be);
756
756
  return ee((o) => {
757
757
  var r, s;
@@ -762,18 +762,18 @@ const ui = (t) => {
762
762
  t.setSelectionRanges([{ startOffset: o, endOffset: o }]);
763
763
  else if (!i.length && !t.docSelectionRenderService.isOnPointerEvent) {
764
764
  const c = (s = (r = t.getDocumentData().body) == null ? void 0 : r.dataStream) != null ? s : `\r
765
- `, a = Math.max(c.length - 2, 0);
766
- t.setSelectionRanges([{ startOffset: a, endOffset: a }]);
765
+ `, l = Math.max(c.length - 2, 0);
766
+ t.setSelectionRanges([{ startOffset: l, endOffset: l }]);
767
767
  }
768
768
  }
769
769
  });
770
770
  };
771
- var fi = Object.getOwnPropertyDescriptor, hi = (t, e, n, o) => {
772
- for (var r = o > 1 ? void 0 : o ? fi(e, n) : e, s = t.length - 1, i; s >= 0; s--)
771
+ var mi = Object.getOwnPropertyDescriptor, gi = (t, e, n, o) => {
772
+ for (var r = o > 1 ? void 0 : o ? mi(e, n) : e, s = t.length - 1, i; s >= 0; s--)
773
773
  (i = t[s]) && (r = i(r) || r);
774
774
  return r;
775
- }, Ze = (t, e) => (n, o) => e(n, o, t);
776
- let De = class extends gr {
775
+ }, Xe = (t, e) => (n, o) => e(n, o, t);
776
+ let De = class extends Cr {
777
777
  constructor(e, n, o, r, s, i, c) {
778
778
  super(
779
779
  n,
@@ -784,7 +784,7 @@ let De = class extends gr {
784
784
  );
785
785
  B(this, "_workbookSelections");
786
786
  B(this, "_eventDisposables");
787
- 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(di(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
787
+ 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(pi(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
788
788
  }
789
789
  getLocation() {
790
790
  return this._skeleton.getLocation();
@@ -808,7 +808,7 @@ let De = class extends gr {
808
808
  * Call this method and user will be able to select on the canvas to update selections.
809
809
  */
810
810
  enableSelectionChanging() {
811
- return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), Zn(() => this._disableSelectionChanging());
811
+ return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), Qn(() => this._disableSelectionChanging());
812
812
  }
813
813
  _disableSelectionChanging() {
814
814
  var e;
@@ -818,27 +818,27 @@ let De = class extends gr {
818
818
  this._disableSelectionChanging();
819
819
  }
820
820
  _initCanvasEventListeners() {
821
- const e = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = e, { scene: i } = this._context, c = new Ue();
822
- return c.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((a, h) => {
823
- this.inRefSelectionMode() && (this._onPointerDown(a, r.zIndex + 1, ge.NORMAL, this._getActiveViewport(a)), a.button !== 2 && h.stopPropagation());
821
+ const e = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = e, { scene: i } = this._context, c = new Ve();
822
+ return c.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((l, h) => {
823
+ this.inRefSelectionMode() && (this._onPointerDown(l, r.zIndex + 1, ge.NORMAL, this._getActiveViewport(l)), l.button !== 2 && h.stopPropagation());
824
824
  })), c.add(
825
- n == null ? void 0 : n.onPointerDown$.subscribeEvent((a, h) => {
825
+ n == null ? void 0 : n.onPointerDown$.subscribeEvent((l, h) => {
826
826
  if (!this.inRefSelectionMode()) return;
827
- const u = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: m } = En(a.offsetX, a.offsetY, i, u);
828
- bn(this._workbookSelections.getCurrentSelections(), m, ge.ROW) || (this._onPointerDown(a, (r.zIndex || 1) + 1, ge.ROW, this._getActiveViewport(a), Bt.Y), a.button !== 2 && h.stopPropagation());
827
+ const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: m } = yn(l.offsetX, l.offsetY, i, f);
828
+ Nn(this._workbookSelections.getCurrentSelections(), m, ge.ROW) || (this._onPointerDown(l, (r.zIndex || 1) + 1, ge.ROW, this._getActiveViewport(l), jt.Y), l.button !== 2 && h.stopPropagation());
829
829
  })
830
- ), c.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((a, h) => {
830
+ ), c.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((l, h) => {
831
831
  if (!this.inRefSelectionMode()) return;
832
- const u = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: m } = En(a.offsetX, a.offsetY, i, u);
833
- bn(this._workbookSelections.getCurrentSelections(), m, ge.COLUMN) || (this._onPointerDown(a, (r.zIndex || 1) + 1, ge.COLUMN, this._getActiveViewport(a), Bt.X), a.button !== 2 && h.stopPropagation());
834
- })), c.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((a, h) => {
832
+ const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: m } = yn(l.offsetX, l.offsetY, i, f);
833
+ Nn(this._workbookSelections.getCurrentSelections(), m, ge.COLUMN) || (this._onPointerDown(l, (r.zIndex || 1) + 1, ge.COLUMN, this._getActiveViewport(l), jt.X), l.button !== 2 && h.stopPropagation());
834
+ })), c.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((l, h) => {
835
835
  if (this._reset(), !this.inRefSelectionMode()) return;
836
- const u = this._sheetSkeletonManagerService.getCurrent().skeleton, m = pr(u);
836
+ const f = this._sheetSkeletonManagerService.getCurrent().skeleton, m = vr(f);
837
837
  this._addSelectionControlByModelData(m), this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
838
- const l = i.onPointerUp$.subscribeEvent(() => {
839
- l.unsubscribe(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle());
838
+ const u = i.onPointerUp$.subscribeEvent(() => {
839
+ u.unsubscribe(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle());
840
840
  });
841
- a.button !== 2 && h.stopPropagation();
841
+ l.button !== 2 && h.stopPropagation();
842
842
  })), c;
843
843
  }
844
844
  /**
@@ -848,7 +848,7 @@ let De = class extends gr {
848
848
  */
849
849
  _addSelectionControlByModelData(e) {
850
850
  var i;
851
- const n = this._skeleton, o = (i = e.style) != null ? i : Jn(this._themeService), r = this._scene;
851
+ const n = this._skeleton, o = (i = e.style) != null ? i : to(this._themeService), r = this._scene;
852
852
  return e.style = o, this.newSelectionControl(r, n, e);
853
853
  }
854
854
  _initSelectionChangeListener() {
@@ -861,18 +861,18 @@ let De = class extends gr {
861
861
  */
862
862
  _initUserActionSyncListener() {
863
863
  this.disposeWithMe(this.selectionMoveStart$.subscribe((e) => {
864
- this._updateSelections(e, qt.MOVE_START);
864
+ this._updateSelections(e, Kt.MOVE_START);
865
865
  })), this.disposeWithMe(this.selectionMoving$.subscribe((e) => {
866
- this._updateSelections(e, qt.MOVING);
866
+ this._updateSelections(e, Kt.MOVING);
867
867
  })), this.disposeWithMe(this.selectionMoveEnd$.subscribe((e) => {
868
- this._updateSelections(e, qt.MOVE_END);
868
+ this._updateSelections(e, Kt.MOVE_END);
869
869
  }));
870
870
  }
871
871
  _updateSelections(e, n) {
872
872
  const r = this._context.unit.getActiveSheet().getSheetId();
873
873
  e.length !== 0 && this._workbookSelections.setSelections(
874
874
  r,
875
- e.map((s) => es(s)),
875
+ e.map((s) => os(s)),
876
876
  n
877
877
  );
878
878
  }
@@ -880,7 +880,7 @@ let De = class extends gr {
880
880
  this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((e) => {
881
881
  if (!e)
882
882
  return;
883
- const { skeleton: n } = e, { scene: o } = this._context, r = o.getViewport(An.VIEW_MAIN);
883
+ const { skeleton: n } = e, { scene: o } = this._context, r = o.getViewport(xn.VIEW_MAIN);
884
884
  this._skeleton && this._skeleton.worksheet.getSheetId() !== n.worksheet.getSheetId() && this._reset(), this._changeRuntime(n, o, r);
885
885
  const s = this._workbookSelections.getCurrentSelections();
886
886
  this.resetSelectionsByModelData(s);
@@ -888,10 +888,10 @@ let De = class extends gr {
888
888
  }
889
889
  _getActiveViewport(e) {
890
890
  const n = this._getSheetObject();
891
- return n == null ? void 0 : n.scene.getActiveViewportByCoord(Pn.FromArray([e.offsetX, e.offsetY]));
891
+ return n == null ? void 0 : n.scene.getActiveViewportByCoord(wn.FromArray([e.offsetX, e.offsetY]));
892
892
  }
893
893
  _getSheetObject() {
894
- return Sr(this._context.unit, this._context);
894
+ return _r(this._context.unit, this._context);
895
895
  }
896
896
  /**
897
897
  * Handle pointer down event, bind pointermove & pointerup handler.
@@ -904,18 +904,18 @@ let De = class extends gr {
904
904
  * @param scrollTimerType
905
905
  */
906
906
  // eslint-disable-next-line complexity, max-lines-per-function
907
- _onPointerDown(e, n = 0, o = ge.NORMAL, r, s = Bt.ALL) {
908
- var _;
907
+ _onPointerDown(e, n = 0, o = ge.NORMAL, r, s = jt.ALL) {
908
+ var R;
909
909
  this._rangeType = o;
910
910
  const i = this._skeleton, c = this._scene;
911
911
  if (!c || !i)
912
912
  return;
913
913
  r && (this._activeViewport = r);
914
- const { offsetX: a, offsetY: h } = e, u = c.getViewport(An.VIEW_MAIN);
915
- if (!u) return;
916
- const m = c.getCoordRelativeToViewport(Pn.FromArray([a, h])), { x: l, y: d } = m;
917
- this._startViewportPosX = l, this._startViewportPosY = d;
918
- const f = c.getScrollXYInfoByViewport(m), { scaleX: R, scaleY: g } = c.getAncestorScale(), p = this._skeleton.getCellByOffset(l, d, R, g, f);
914
+ const { offsetX: l, offsetY: h } = e, f = c.getViewport(xn.VIEW_MAIN);
915
+ if (!f) return;
916
+ const m = c.getCoordRelativeToViewport(wn.FromArray([l, h])), { x: u, y: d } = m;
917
+ this._startViewportPosX = u, this._startViewportPosY = d;
918
+ const a = c.getScrollXYInfoByViewport(m), { scaleX: I, scaleY: g } = c.getAncestorScale(), p = this._skeleton.getCellByOffset(u, d, I, g, a);
919
919
  if (!p) return;
920
920
  switch (o) {
921
921
  case ge.NORMAL:
@@ -929,38 +929,38 @@ let De = class extends gr {
929
929
  case ge.ALL:
930
930
  p.startRow = 0, p.startColumn = 0, p.endRow = this._skeleton.getRowCount() - 1, p.endColumn = this._skeleton.getColumnCount() - 1;
931
931
  }
932
- const S = { range: p, primary: p, style: null };
933
- S.range.rangeType = o;
934
- const C = Gt(S, this._skeleton);
935
- this._startRangeWhenPointerDown = { ...C.rangeWithCoord };
936
- const v = { ...C.rangeWithCoord, rangeType: o };
937
- let I = this.getActiveSelectionControl();
932
+ const C = { range: p, primary: p, style: null };
933
+ C.range.rangeType = o;
934
+ const S = Xt(C, this._skeleton);
935
+ this._startRangeWhenPointerDown = { ...S.rangeWithCoord };
936
+ const v = { ...S.rangeWithCoord, rangeType: o };
937
+ let _ = this.getActiveSelectionControl();
938
938
  const T = this.getSelectionControls();
939
- for (const N of T) {
940
- if (e.button === 2 && Yn.contains(N.model, v)) {
941
- I = N;
939
+ for (const y of T) {
940
+ if (e.button === 2 && Gn.contains(y.model, v)) {
941
+ _ = y;
942
942
  return;
943
943
  }
944
- if (N.model.isEqual(v)) {
945
- I = N;
944
+ if (y.model.isEqual(v)) {
945
+ _ = y;
946
946
  break;
947
947
  }
948
948
  }
949
949
  this._checkClearPreviousControls(e);
950
- const w = I == null ? void 0 : I.model.currentCell, A = e.shiftKey && w, M = this._remainLastEnabled && !e.ctrlKey && !e.shiftKey && !this._skipLastEnabled && !this._singleSelectionEnabled;
950
+ const w = _ == null ? void 0 : _.model.currentCell, A = e.shiftKey && w, M = this._remainLastEnabled && !e.ctrlKey && !e.shiftKey && !this._skipLastEnabled && !this._singleSelectionEnabled;
951
951
  A && w ? this._makeSelectionByTwoCells(
952
952
  w,
953
953
  v,
954
954
  i,
955
955
  o,
956
- I
956
+ _
957
957
  // Get updated in this method
958
- ) : M && I ? I.updateRangeBySelectionWithCoord(C) : I = this.newSelectionControl(c, i, S);
959
- for (let N = 0; N < this.getSelectionControls().length - 1; N++)
960
- this.getSelectionControls()[N].clearHighlight();
961
- this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), c.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (_ = c.getTransformer()) == null || _.clearSelectedObjects(), this._setupPointerMoveListener(u, I, o, s, l, d), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = c.onPointerUp$.subscribeEvent(() => {
962
- var N;
963
- this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (N = this._escapeShortcutDisposable) == null || N.dispose(), this._escapeShortcutDisposable = null;
958
+ ) : M && _ ? _.updateRangeBySelectionWithCoord(S) : _ = this.newSelectionControl(c, i, C);
959
+ for (let y = 0; y < this.getSelectionControls().length - 1; y++)
960
+ this.getSelectionControls()[y].clearHighlight();
961
+ this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), c.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (R = c.getTransformer()) == null || R.clearSelectedObjects(), this._setupPointerMoveListener(f, _, o, s, u, d), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = c.onPointerUp$.subscribeEvent(() => {
962
+ var y;
963
+ this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (y = this._escapeShortcutDisposable) == null || y.dispose(), this._escapeShortcutDisposable = null;
964
964
  });
965
965
  }
966
966
  /**
@@ -971,13 +971,13 @@ let De = class extends gr {
971
971
  * @returns {SelectionControl} selectionControl just created
972
972
  */
973
973
  newSelectionControl(e, n, o) {
974
- const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new eo(e, r, this._themeService, {
974
+ const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new no(e, r, this._themeService, {
975
975
  highlightHeader: this._highlightHeader,
976
976
  enableAutoFill: !1,
977
977
  rowHeaderWidth: s,
978
978
  columnHeaderHeight: i
979
- }), a = Gt(o, n);
980
- return c.updateRangeBySelectionWithCoord(a), this._selectionControls.push(c), c.setControlExtension({
979
+ }), l = Xt(o, n);
980
+ return c.updateRangeBySelectionWithCoord(l), this._selectionControls.push(c), c.setControlExtension({
981
981
  skeleton: n,
982
982
  scene: e,
983
983
  themeService: this._themeService,
@@ -990,102 +990,102 @@ let De = class extends gr {
990
990
  }), c;
991
991
  }
992
992
  };
993
- De = hi([
994
- Ze(1, K(mt)),
995
- Ze(2, K(gt)),
996
- Ze(3, Ht),
997
- Ze(4, K(wt)),
998
- Ze(5, tn),
999
- Ze(6, Lt)
993
+ De = gi([
994
+ Xe(1, K(mt)),
995
+ Xe(2, K(gt)),
996
+ Xe(3, Ut),
997
+ Xe(4, K(Lt)),
998
+ Xe(5, on),
999
+ Xe(6, kt)
1000
1000
  ], De);
1001
- function di(t) {
1002
- const e = Jn(t);
1001
+ function pi(t) {
1002
+ const e = to(t);
1003
1003
  return e.widgets = { tl: !0, tc: !0, tr: !0, ml: !0, mr: !0, bl: !0, bc: !0, br: !0 }, e;
1004
1004
  }
1005
- function mi(t) {
1005
+ function Si(t) {
1006
1006
  var r, s;
1007
1007
  const n = t.get(oe).getCurrentUniverDocInstance();
1008
1008
  return n != null && n.getBody() ? { dataStream: (s = (r = n.getBody()) == null ? void 0 : r.dataStream) != null ? s : "", offset: 0 } : void 0;
1009
1009
  }
1010
1010
  var we = /* @__PURE__ */ ((t) => (t[t.NOT_SELECT = 0] = "NOT_SELECT", t[t.NEED_ADD = 1] = "NEED_ADD", t[t.CAN_EDIT = 2] = "CAN_EDIT", t[t.EDIT_OTHER_SHEET_REFERENCE = 3] = "EDIT_OTHER_SHEET_REFERENCE", t))(we || {});
1011
- function gi(t) {
1011
+ function Ci(t) {
1012
1012
  var w;
1013
- const { editorId: e, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = t, i = O(ye), c = O(oe), a = i.getRenderById(r), h = i.getRenderById(e), u = h == null ? void 0 : h.with(co), m = O(Ro), l = O(mt), [d, f] = k(
1013
+ const { editorId: e, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = t, i = O(Ne), c = O(oe), l = i.getRenderById(r), h = i.getRenderById(e), f = h == null ? void 0 : h.with(ao), m = O(Eo), u = O(mt), [d, a] = $(
1014
1014
  0
1015
1015
  /* NOT_SELECT */
1016
- ), R = O(Ee), g = j(!0), p = a == null ? void 0 : a.with(De), S = je(d), C = c.getUnit(r, ue.UNIVER_SHEET), v = C == null ? void 0 : C.getSheetBySheetId(s), I = ee((A) => {
1016
+ ), I = O(Ee), g = j(!0), p = l == null ? void 0 : l.with(De), C = Ke(d), S = c.getUnit(r, ue.UNIVER_SHEET), v = S == null ? void 0 : S.getSheetBySheetId(s), _ = ee((A) => {
1017
1017
  p && p.setSkipLastEnabled(
1018
1018
  A === 1 || A === 3
1019
1019
  /* EDIT_OTHER_SHEET_REFERENCE */
1020
- ), S.current = A, f(A);
1020
+ ), C.current = A, a(A);
1021
1021
  }), T = ee(() => {
1022
1022
  var te, ie;
1023
- if (!C) return;
1024
- const A = C.getActiveSheet(), M = u == null ? void 0 : u.getActiveTextRange(), _ = M != null && M.collapsed ? M.startOffset : -1, N = mi(l);
1025
- if (!N) return;
1026
- const P = (te = N == null ? void 0 : N.dataStream) == null ? void 0 : te.slice(0, -2), y = ((ie = R.sequenceNodesBuilder(P)) != null ? ie : []).map((q) => typeof q == "object" ? q.nodeType === z.REFERENCE ? {
1023
+ if (!S) return;
1024
+ const A = S.getActiveSheet(), M = f == null ? void 0 : f.getActiveTextRange(), R = M != null && M.collapsed ? M.startOffset : -1, y = Si(u);
1025
+ if (!y) return;
1026
+ const P = (te = y == null ? void 0 : y.dataStream) == null ? void 0 : te.slice(0, -2), N = ((ie = I.sequenceNodesBuilder(P)) != null ? ie : []).map((q) => typeof q == "object" ? q.nodeType === z.REFERENCE ? {
1027
1027
  ...q,
1028
- range: Pr(q.token)
1028
+ range: Dr(q.token)
1029
1029
  } : {
1030
1030
  ...q,
1031
1031
  range: void 0
1032
- } : q), E = P[_ - 1], F = P[_], x = y.find((q) => typeof q == "object" && q.nodeType === z.REFERENCE && _ === q.endIndex + 2), H = E && xr(E) && (!F || wr(F) && F !== tt.OPEN_BRACKET), V = !!x;
1032
+ } : q), E = P[R - 1], F = P[R], x = N.find((q) => typeof q == "object" && q.nodeType === z.REFERENCE && R === q.endIndex + 2), H = E && Lr(E) && (!F || $r(F) && F !== nt.OPEN_BRACKET), V = !!x;
1033
1033
  if ((P == null ? void 0 : P.substring(0, 1)) === "=" && (H || V))
1034
1034
  if (V) {
1035
1035
  if (g.current)
1036
1036
  return;
1037
- !x.range.sheetName && A.getSheetId() === (v == null ? void 0 : v.getSheetId()) || x.range.sheetName === A.getName() ? I(
1037
+ !x.range.sheetName && A.getSheetId() === (v == null ? void 0 : v.getSheetId()) || x.range.sheetName === A.getName() ? _(
1038
1038
  2
1039
1039
  /* CAN_EDIT */
1040
- ) : I(
1040
+ ) : _(
1041
1041
  3
1042
1042
  /* EDIT_OTHER_SHEET_REFERENCE */
1043
1043
  );
1044
1044
  } else
1045
- g.current = !1, I(
1045
+ g.current = !1, _(
1046
1046
  1
1047
1047
  /* NEED_ADD */
1048
1048
  );
1049
1049
  else
1050
- I(
1050
+ _(
1051
1051
  0
1052
1052
  /* NOT_SELECT */
1053
1053
  );
1054
1054
  });
1055
1055
  return L(() => {
1056
- const A = m.textSelection$.pipe(Zt((M) => M.unitId === e)).subscribe(() => {
1056
+ const A = m.textSelection$.pipe(Qt((M) => M.unitId === e)).subscribe(() => {
1057
1057
  T();
1058
1058
  });
1059
1059
  return () => A.unsubscribe();
1060
1060
  }, [T, m.textSelection$, e]), L(() => {
1061
- n || (I(
1061
+ n || (_(
1062
1062
  0
1063
1063
  /* NOT_SELECT */
1064
1064
  ), g.current = !0);
1065
- }, [n, I]), L(() => {
1065
+ }, [n, _]), L(() => {
1066
1066
  var M;
1067
1067
  if (!o) return;
1068
1068
  const A = (M = h == null ? void 0 : h.mainComponent) == null ? void 0 : M.onPointerDown$.subscribeEvent(() => {
1069
- I(
1069
+ _(
1070
1070
  0
1071
1071
  /* NOT_SELECT */
1072
1072
  ), g.current = !0;
1073
1073
  });
1074
1074
  return () => A == null ? void 0 : A.unsubscribe();
1075
- }, [o, (w = h == null ? void 0 : h.mainComponent) == null ? void 0 : w.onPointerDown$, I]), L(() => {
1075
+ }, [o, (w = h == null ? void 0 : h.mainComponent) == null ? void 0 : w.onPointerDown$, _]), L(() => {
1076
1076
  if (!n) return;
1077
- const A = C == null ? void 0 : C.activeSheet$.subscribe(() => {
1077
+ const A = S == null ? void 0 : S.activeSheet$.subscribe(() => {
1078
1078
  T();
1079
1079
  });
1080
1080
  return () => A == null ? void 0 : A.unsubscribe();
1081
- }, [T, n, C == null ? void 0 : C.activeSheet$]), { isSelecting: d, isSelectingRef: S };
1081
+ }, [T, n, S == null ? void 0 : S.activeSheet$]), { isSelecting: d, isSelectingRef: C };
1082
1082
  }
1083
- const pi = () => {
1083
+ const vi = () => {
1084
1084
  const t = O(Ee);
1085
- return yt((n) => t.sequenceNodesBuilder(n) || [], [t]);
1085
+ return Ft((n) => t.sequenceNodesBuilder(n) || [], [t]);
1086
1086
  };
1087
- function Si(t, e, n) {
1088
- const o = t.getCurrentTheme(), r = new on(e).setAlpha(0.05).toRgbString();
1087
+ function _i(t, e, n) {
1088
+ const o = t.getCurrentTheme(), r = new sn(e).setAlpha(0.05).toRgbString();
1089
1089
  return {
1090
1090
  id: n,
1091
1091
  strokeWidth: 1,
@@ -1097,8 +1097,8 @@ function Si(t, e, n) {
1097
1097
  widgetStroke: o.colorWhite
1098
1098
  };
1099
1099
  }
1100
- function xo(t) {
1101
- var p, S, C;
1100
+ function Do(t) {
1101
+ var p, C, S;
1102
1102
  const {
1103
1103
  unitId: e,
1104
1104
  subUnitId: n,
@@ -1107,101 +1107,101 @@ function xo(t) {
1107
1107
  refSelectionsService: s,
1108
1108
  refSelectionsRenderService: i,
1109
1109
  sheetSkeletonManagerService: c,
1110
- themeService: a,
1110
+ themeService: l,
1111
1111
  univerInstanceService: h
1112
- } = t, u = h.getUnit(e, ue.UNIVER_SHEET), m = u == null ? void 0 : u.getActiveSheet(), l = [];
1113
- if (!u || !m) {
1114
- s.setSelections(l);
1112
+ } = t, f = h.getUnit(e, ue.UNIVER_SHEET), m = f == null ? void 0 : f.getActiveSheet(), u = [];
1113
+ if (!f || !m) {
1114
+ s.setSelections(u);
1115
1115
  return;
1116
1116
  }
1117
- const d = m.getSheetId(), f = (v) => {
1118
- var I;
1119
- return (I = u == null ? void 0 : u.getSheetBySheetName(v)) == null ? void 0 : I.getSheetId();
1117
+ const d = m.getSheetId(), a = (v) => {
1118
+ var _;
1119
+ return (_ = f == null ? void 0 : f.getSheetBySheetName(v)) == null ? void 0 : _.getSheetId();
1120
1120
  };
1121
1121
  if (!((p = c == null ? void 0 : c.getWorksheetSkeleton(d)) == null ? void 0 : p.skeleton)) return;
1122
1122
  const g = [];
1123
- for (let v = 0, I = o.length; v < I; v++) {
1124
- const T = o[v], { themeColor: w, token: A, refIndex: M, endIndex: _ } = T, N = nt(A), { unitId: P, sheetName: y, range: E } = N;
1123
+ for (let v = 0, _ = o.length; v < _; v++) {
1124
+ const T = o[v], { themeColor: w, token: A, refIndex: M, endIndex: R } = T, y = ot(A), { unitId: P, sheetName: N, range: E } = y;
1125
1125
  if (P && e !== P)
1126
1126
  continue;
1127
- const F = f(y);
1127
+ const F = a(N);
1128
1128
  if (F && F !== d || !F && d !== n)
1129
1129
  continue;
1130
- const x = ts(E, m.getRowCount(), m.getColumnCount());
1131
- x.unitId = e, x.sheetId = d, l.push({
1130
+ const x = rs(E, m.getRowCount(), m.getColumnCount());
1131
+ x.unitId = e, x.sheetId = d, u.push({
1132
1132
  range: x,
1133
1133
  primary: null,
1134
- style: Si(a, w, M.toString())
1135
- }), g.push(_);
1134
+ style: _i(l, w, M.toString())
1135
+ }), g.push(R);
1136
1136
  }
1137
1137
  if (r) {
1138
- const v = (C = (S = r.getSelectionRanges()) == null ? void 0 : S[0]) == null ? void 0 : C.startOffset, I = g.findIndex((T) => T + 2 === v);
1139
- I !== -1 ? i == null || i.setActiveSelectionIndex(I) : i == null || i.resetActiveSelectionIndex();
1138
+ const v = (S = (C = r.getSelectionRanges()) == null ? void 0 : C[0]) == null ? void 0 : S.startOffset, _ = g.findIndex((T) => T + 2 === v);
1139
+ _ !== -1 ? i == null || i.setActiveSelectionIndex(_) : i == null || i.resetActiveSelectionIndex();
1140
1140
  }
1141
- return l;
1141
+ return u;
1142
1142
  }
1143
- function Ci(t, e) {
1144
- const n = O(oe), o = O(gt), r = O(Lt), i = O(ye).getRenderById(t), c = i == null ? void 0 : i.with(De), a = i == null ? void 0 : i.with(wt), h = ee((u, m) => {
1143
+ function Ri(t, e) {
1144
+ const n = O(oe), o = O(gt), r = O(kt), i = O(Ne).getRenderById(t), c = i == null ? void 0 : i.with(De), l = i == null ? void 0 : i.with(Lt), h = ee((f, m) => {
1145
1145
  if (c != null && c.selectionMoving) return;
1146
- const l = xo({
1146
+ const u = Do({
1147
1147
  unitId: t,
1148
1148
  subUnitId: e,
1149
- refSelections: u,
1149
+ refSelections: f,
1150
1150
  editor: m,
1151
1151
  refSelectionsService: r,
1152
1152
  refSelectionsRenderService: c,
1153
- sheetSkeletonManagerService: a,
1153
+ sheetSkeletonManagerService: l,
1154
1154
  themeService: o,
1155
1155
  univerInstanceService: n
1156
1156
  });
1157
- if (!l) return;
1158
- ((c == null ? void 0 : c.getSelectionControls()) || []).length === l.length ? c == null || c.resetSelectionsByModelData(l) : r.setSelections(l);
1157
+ if (!u) return;
1158
+ ((c == null ? void 0 : c.getSelectionControls()) || []).length === u.length ? c == null || c.resetSelectionsByModelData(u) : r.setSelections(u);
1159
1159
  });
1160
1160
  return L(() => () => {
1161
1161
  c == null || c.resetActiveSelectionIndex();
1162
1162
  }, [c]), h;
1163
1163
  }
1164
- function wo(t = "") {
1165
- const e = O(kt), n = vi(), o = O(ae), r = le(() => t.length, [t]);
1166
- return ee((i, c, a = !0, h) => {
1167
- const u = i.getDocumentData(), m = i.getEditorId();
1168
- if (!u)
1164
+ function Lo(t = "") {
1165
+ const e = O(Ht), n = Ii(), o = O(ae), r = le(() => t.length, [t]);
1166
+ return ee((i, c, l = !0, h) => {
1167
+ const f = i.getDocumentData(), m = i.getEditorId();
1168
+ if (!f)
1169
1169
  return [];
1170
- const l = u.body;
1171
- if (!l)
1170
+ const u = f.body;
1171
+ if (!u)
1172
1172
  return [];
1173
- const d = l.dataStream.slice(0, l.dataStream.length - 2), f = { dataStream: "", ...u.body };
1173
+ const d = u.dataStream.slice(0, u.dataStream.length - 2), a = { dataStream: "", ...f.body };
1174
1174
  if (!d.startsWith(t)) return [];
1175
1175
  if (c == null || c.length === 0)
1176
- return f.textRuns = [], o.syncExecuteCommand(Mn.id, {
1176
+ return a.textRuns = [], o.syncExecuteCommand(Pn.id, {
1177
1177
  unitId: m,
1178
- body: In(f, 0, f.dataStream.length - 2)
1178
+ body: bn(a, 0, a.dataStream.length - 2)
1179
1179
  }), [];
1180
1180
  {
1181
- const { textRuns: R, refSelections: g } = _i(e, n, c);
1182
- r && R.forEach((C) => {
1183
- C.ed = C.ed + r, C.st = C.st + r;
1184
- }), f.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...R];
1185
- const p = c.reduce((C, v) => typeof v == "string" ? `${C}${v}` : `${C}${v.token}`, "");
1186
- f.dataStream = `${t}${p}\r
1181
+ const { textRuns: I, refSelections: g } = Ei(e, n, c);
1182
+ r && I.forEach((S) => {
1183
+ S.ed = S.ed + r, S.st = S.st + r;
1184
+ }), a.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...I];
1185
+ const p = c.reduce((S, v) => typeof v == "string" ? `${S}${v}` : `${S}${v.token}`, "");
1186
+ a.dataStream = `${t}${p}\r
1187
1187
  `;
1188
- let S;
1189
- if (a) {
1190
- S = i.getSelectionRanges();
1191
- const C = f.dataStream.length - 2 + r;
1192
- S.forEach((v) => {
1193
- v.startOffset = Math.max(0, Math.min(v.startOffset, C)), v.endOffset = Math.max(0, Math.min(v.endOffset, C));
1188
+ let C;
1189
+ if (l) {
1190
+ C = i.getSelectionRanges();
1191
+ const S = a.dataStream.length - 2 + r;
1192
+ C.forEach((v) => {
1193
+ v.startOffset = Math.max(0, Math.min(v.startOffset, S)), v.endOffset = Math.max(0, Math.min(v.endOffset, S));
1194
1194
  });
1195
1195
  }
1196
- return o.syncExecuteCommand(Mn.id, {
1196
+ return o.syncExecuteCommand(Pn.id, {
1197
1197
  unitId: m,
1198
- body: In(f, 0, f.dataStream.length - 2),
1199
- textRanges: h != null ? h : S
1198
+ body: bn(a, 0, a.dataStream.length - 2),
1199
+ textRanges: h != null ? h : C
1200
1200
  }), g;
1201
1201
  }
1202
1202
  });
1203
1203
  }
1204
- function vi() {
1204
+ function Ii() {
1205
1205
  const e = O(gt).getCurrentTheme();
1206
1206
  return le(() => {
1207
1207
  const o = [
@@ -1221,16 +1221,16 @@ function vi() {
1221
1221
  return { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i };
1222
1222
  }, [e]);
1223
1223
  }
1224
- function _i(t, e, n) {
1225
- const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i } = e, c = [], a = [], h = /* @__PURE__ */ new Map();
1226
- let u = 0;
1227
- for (let m = 0, l = n.length; m < l; m++) {
1224
+ function Ei(t, e, n) {
1225
+ const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i } = e, c = [], l = [], h = /* @__PURE__ */ new Map();
1226
+ let f = 0;
1227
+ for (let m = 0, u = n.length; m < u; m++) {
1228
1228
  const d = n[m];
1229
1229
  if (typeof d == "string") {
1230
- const C = c[c.length - 1], v = C ? C.ed : 0, I = v + d.length;
1230
+ const S = c[c.length - 1], v = S ? S.ed : 0, _ = v + d.length;
1231
1231
  c.push({
1232
1232
  st: v,
1233
- ed: I,
1233
+ ed: _,
1234
1234
  ts: {
1235
1235
  cl: {
1236
1236
  rgb: i
@@ -1253,36 +1253,36 @@ function _i(t, e, n) {
1253
1253
  });
1254
1254
  continue;
1255
1255
  }
1256
- const { startIndex: f, endIndex: R, nodeType: g, token: p } = d;
1257
- let S = "";
1256
+ const { startIndex: a, endIndex: I, nodeType: g, token: p } = d;
1257
+ let C = "";
1258
1258
  if (g === z.REFERENCE) {
1259
1259
  if (h.has(p))
1260
- S = h.get(p);
1260
+ C = h.get(p);
1261
1261
  else {
1262
- const C = u % o.length;
1263
- S = o[C], h.set(p, S), u++;
1262
+ const S = f % o.length;
1263
+ C = o[S], h.set(p, C), f++;
1264
1264
  }
1265
- a.push({
1265
+ l.push({
1266
1266
  refIndex: m,
1267
- themeColor: S,
1267
+ themeColor: C,
1268
1268
  token: p,
1269
1269
  startIndex: d.startIndex,
1270
1270
  endIndex: d.endIndex,
1271
- index: a.length
1271
+ index: l.length
1272
1272
  });
1273
- } else g === z.NUMBER ? S = r : (g === z.STRING || g === z.ARRAY) && (S = s);
1274
- S && S.length > 0 ? c.push({
1275
- st: f,
1276
- ed: R + 1,
1273
+ } else g === z.NUMBER ? C = r : (g === z.STRING || g === z.ARRAY) && (C = s);
1274
+ C && C.length > 0 ? c.push({
1275
+ st: a,
1276
+ ed: I + 1,
1277
1277
  ts: {
1278
1278
  cl: {
1279
- rgb: S
1279
+ rgb: C
1280
1280
  },
1281
1281
  fs: 11
1282
1282
  }
1283
1283
  }) : c.push({
1284
- st: f,
1285
- ed: R + 1,
1284
+ st: a,
1285
+ ed: I + 1,
1286
1286
  ts: {
1287
1287
  cl: {
1288
1288
  rgb: i
@@ -1291,52 +1291,52 @@ function _i(t, e, n) {
1291
1291
  }
1292
1292
  });
1293
1293
  }
1294
- return { textRuns: c, refSelections: a };
1294
+ return { textRuns: c, refSelections: l };
1295
1295
  }
1296
- const Ri = (t, e, n, o) => {
1297
- const r = O(ae), s = O(Ht), i = j(e);
1296
+ const bi = (t, e, n, o) => {
1297
+ const r = O(ae), s = O(Ut), i = j(e);
1298
1298
  i.current = e;
1299
1299
  const c = j(o);
1300
1300
  c.current = o, L(() => {
1301
1301
  if (!n || !t)
1302
1302
  return;
1303
- const h = `sheet.formula-embedding-editor.${n.getEditorId()}`, u = new Ue(), m = (f, R) => {
1303
+ const h = `sheet.formula-embedding-editor.${n.getEditorId()}`, f = new Ve(), m = (a, I) => {
1304
1304
  if (c.current) {
1305
- c.current(f, R);
1305
+ c.current(a, I);
1306
1306
  return;
1307
1307
  }
1308
1308
  let g = ne.LEFT;
1309
- f === D.ARROW_DOWN ? g = ne.DOWN : f === D.ARROW_UP ? g = ne.UP : f === D.ARROW_RIGHT && (g = ne.RIGHT), R === U.SHIFT ? r.executeCommand(Yr.id, {
1309
+ a === D.ARROW_DOWN ? g = ne.DOWN : a === D.ARROW_UP ? g = ne.UP : a === D.ARROW_RIGHT && (g = ne.RIGHT), I === U.SHIFT ? r.executeCommand(Zr.id, {
1310
1310
  direction: g
1311
- }) : r.executeCommand(zr.id, {
1311
+ }) : r.executeCommand(Xr.id, {
1312
1312
  direction: g
1313
1313
  });
1314
- }, l = (f, R) => {
1314
+ }, u = (a, I) => {
1315
1315
  let g = ne.DOWN;
1316
- f === D.ARROW_DOWN ? g = ne.DOWN : f === D.ARROW_UP ? g = ne.UP : f === D.ARROW_LEFT ? g = ne.LEFT : f === D.ARROW_RIGHT && (g = ne.RIGHT), i.current ? R === U.CTRL_COMMAND ? r.executeCommand(Nn.id, {
1316
+ a === D.ARROW_DOWN ? g = ne.DOWN : a === D.ARROW_UP ? g = ne.UP : a === D.ARROW_LEFT ? g = ne.LEFT : a === D.ARROW_RIGHT && (g = ne.RIGHT), i.current ? I === U.CTRL_COMMAND ? r.executeCommand(Tn.id, {
1317
1317
  direction: g,
1318
- jumpOver: yn.moveGap,
1318
+ jumpOver: Fn.moveGap,
1319
1319
  extra: "formula-editor",
1320
1320
  fromCurrentSelection: i.current === we.NEED_ADD || i.current === we.EDIT_OTHER_SHEET_REFERENCE
1321
- }) : R === U.SHIFT ? r.executeCommand(Tn.id, {
1321
+ }) : I === U.SHIFT ? r.executeCommand(On.id, {
1322
1322
  direction: g,
1323
1323
  extra: "formula-editor"
1324
- }) : R === (U.CTRL_COMMAND | U.SHIFT) ? r.executeCommand(Tn.id, {
1324
+ }) : I === (U.CTRL_COMMAND | U.SHIFT) ? r.executeCommand(On.id, {
1325
1325
  direction: g,
1326
- jumpOver: yn.moveGap,
1326
+ jumpOver: Fn.moveGap,
1327
1327
  extra: "formula-editor"
1328
- }) : r.executeCommand(Nn.id, {
1328
+ }) : r.executeCommand(Tn.id, {
1329
1329
  direction: g,
1330
1330
  extra: "formula-editor",
1331
1331
  fromCurrentSelection: i.current === we.NEED_ADD || i.current === we.EDIT_OTHER_SHEET_REFERENCE
1332
- }) : m(f, R);
1332
+ }) : m(a, I);
1333
1333
  };
1334
- return u.add(r.registerCommand({
1334
+ return f.add(r.registerCommand({
1335
1335
  id: h,
1336
1336
  type: Ie.OPERATION,
1337
- handler(f, R) {
1338
- const { keyCode: g, metaKey: p } = R;
1339
- l(g, p);
1337
+ handler(a, I) {
1338
+ const { keyCode: g, metaKey: p } = I;
1339
+ u(g, p);
1340
1340
  }
1341
1341
  })), [
1342
1342
  { keyCode: D.ARROW_DOWN },
@@ -1355,245 +1355,245 @@ const Ri = (t, e, n, o) => {
1355
1355
  { keyCode: D.ARROW_LEFT, metaKey: U.CTRL_COMMAND | U.SHIFT },
1356
1356
  { keyCode: D.ARROW_RIGHT, metaKey: U.CTRL_COMMAND | U.SHIFT },
1357
1357
  { keyCode: D.ARROW_UP, metaKey: U.CTRL_COMMAND | U.SHIFT }
1358
- ].map(({ keyCode: f, metaKey: R }) => ({
1358
+ ].map(({ keyCode: a, metaKey: I }) => ({
1359
1359
  id: h,
1360
- binding: R ? f | R : f,
1360
+ binding: I ? a | I : a,
1361
1361
  preconditions: () => !0,
1362
1362
  priority: 900,
1363
1363
  staticParameters: {
1364
- eventType: Ne.Keyboard,
1365
- keyCode: f,
1366
- metaKey: R
1364
+ eventType: ye.Keyboard,
1365
+ keyCode: a,
1366
+ metaKey: I
1367
1367
  }
1368
- })).forEach((f) => {
1369
- u.add(s.registerShortcut(f));
1368
+ })).forEach((a) => {
1369
+ f.add(s.registerShortcut(a));
1370
1370
  }), () => {
1371
- u.dispose();
1371
+ f.dispose();
1372
1372
  };
1373
1373
  }, [r, n, t, s]);
1374
- }, Ii = (t, e, n, o = !0) => {
1375
- const r = O(ye), s = O(tn), i = O(as), c = O(Lt), a = r.getRenderById(n), h = a == null ? void 0 : a.with(De);
1376
- Tt(() => {
1374
+ }, yi = (t, e, n, o = !0) => {
1375
+ const r = O(Ne), s = O(on), i = O(hs), c = O(kt), l = r.getRenderById(n), h = l == null ? void 0 : l.with(De);
1376
+ Ot(() => {
1377
1377
  if (t)
1378
- return s.setContextValue(It, !0), () => {
1379
- s.setContextValue(It, !1), c.clear();
1378
+ return s.setContextValue(bt, !0), () => {
1379
+ s.setContextValue(bt, !1), c.clear();
1380
1380
  };
1381
- }, [s, t, c]), Tt(() => {
1381
+ }, [s, t, c]), Ot(() => {
1382
1382
  if (t && e) {
1383
- const u = h == null ? void 0 : h.enableSelectionChanging();
1384
- return s.setContextValue(xn, !0), () => {
1385
- s.setContextValue(xn, !1), u == null || u.dispose();
1383
+ const f = h == null ? void 0 : h.enableSelectionChanging();
1384
+ return s.setContextValue(Dn, !0), () => {
1385
+ s.setContextValue(Dn, !1), f == null || f.dispose();
1386
1386
  };
1387
1387
  }
1388
1388
  }, [s, t, h, e]), L(() => {
1389
1389
  if (t)
1390
- return s.setContextValue(It, !0), o && i.disable(), () => {
1391
- s.setContextValue(It, !1), o && i.enable();
1390
+ return s.setContextValue(bt, !0), o && i.disable(), () => {
1391
+ s.setContextValue(bt, !1), o && i.enable();
1392
1392
  };
1393
1393
  }, [i, s, t, o]), L(() => {
1394
1394
  t && (h == null || h.setSkipLastEnabled(!1));
1395
1395
  }, [t, h]);
1396
- }, Ei = (t, e, n) => {
1397
- const o = O(oe), r = O(sn);
1398
- return yt(() => {
1396
+ }, Ni = (t, e, n) => {
1397
+ const o = O(oe), r = O(ln);
1398
+ return Ft(() => {
1399
1399
  if (t) {
1400
- const i = [...r.getWorkbookSelections(e).getSelectionsOfWorksheet(n)], c = o.getCurrentUnitForType(ue.UNIVER_SHEET), a = c == null ? void 0 : c.getActiveSheet();
1401
- a && a.getSheetId() === n && r.setSelections(i);
1400
+ const i = [...r.getWorkbookSelections(e).getSelectionsOfWorksheet(n)], c = o.getCurrentUnitForType(ue.UNIVER_SHEET), l = c == null ? void 0 : c.getActiveSheet();
1401
+ l && l.getSheetId() === n && r.setSelections(i);
1402
1402
  }
1403
1403
  }, [t, r, n, e, o]);
1404
- }, bi = (t) => t.reduce((e, n) => typeof n == "string" ? e + n.length : e + n.token.length, 0), Jt = (t) => t.map((e) => typeof e == "string" ? e : e.token).join(""), Et = (t, e = !1, n = "") => e ? t.map((o) => o.sheetName !== "" && o.sheetName !== n ? ht(o.sheetName, o.range) : pe(o.range)) : t.map((o) => pe(o.range)), Ni = (t) => {
1405
- var u, m, l;
1404
+ }, Ti = (t) => t.reduce((e, n) => typeof n == "string" ? e + n.length : e + n.token.length, 0), tn = (t) => t.map((e) => typeof e == "string" ? e : e.token).join(""), yt = (t, e = !1, n = "") => e ? t.map((o) => o.sheetName !== "" && o.sheetName !== n ? ht(o.sheetName, o.range) : pe(o.range)) : t.map((o) => pe(o.range)), Fi = (t) => {
1405
+ var f, m, u;
1406
1406
  const { editor: e, lexerTreeBuilder: n } = t, o = e == null ? void 0 : e.getSelectionRanges();
1407
1407
  if ((o == null ? void 0 : o.length) !== 1)
1408
1408
  return;
1409
- const s = o[0].startOffset - 1, i = ((m = (u = e == null ? void 0 : e.getDocumentData().body) == null ? void 0 : u.dataStream) != null ? m : `\r
1410
- `).slice(0, -2), c = (l = n.sequenceNodesBuilder(i.slice(1))) != null ? l : [], a = hn(c, s, !1), h = No(c, a);
1409
+ const s = o[0].startOffset - 1, i = ((m = (f = e == null ? void 0 : e.getDocumentData().body) == null ? void 0 : f.dataStream) != null ? m : `\r
1410
+ `).slice(0, -2), c = (u = n.sequenceNodesBuilder(i.slice(1))) != null ? u : [], l = mn(c, s, !1), h = To(c, l);
1411
1411
  return {
1412
- nodeIndex: a,
1412
+ nodeIndex: l,
1413
1413
  updatingRefIndex: h,
1414
1414
  sequenceNodes: c,
1415
1415
  offset: s
1416
1416
  };
1417
- }, yi = () => {
1418
- }, Ti = (t, e, n, o, r, s, i, c, a, h = yi) => {
1419
- const u = O(ye), m = O(oe), l = O(ae), d = O(Ro), f = O(gt), R = O(Ee), g = m.getUnit(o), p = ee((_) => {
1420
- var N, P;
1421
- return (P = (N = g == null ? void 0 : g.getSheetBySheetId(_)) == null ? void 0 : N.getName()) != null ? P : "";
1422
- }), S = le(() => p(r), [p, r]), C = Be(g == null ? void 0 : g.activeSheet$), v = je({ activeSheet: C, sheetName: S }), I = u.getRenderById(o), T = I == null ? void 0 : I.with(De), w = I == null ? void 0 : I.with(wt), A = O(Lt), M = ee((_, N) => {
1423
- var H, V, te, ie, q, Ke;
1424
- const P = Ni({ editor: a, lexerTreeBuilder: R });
1417
+ }, Oi = () => {
1418
+ }, Mi = (t, e, n, o, r, s, i, c, l, h = Oi) => {
1419
+ const f = O(Ne), m = O(oe), u = O(ae), d = O(Eo), a = O(gt), I = O(Ee), g = m.getUnit(o), p = ee((R) => {
1420
+ var y, P;
1421
+ return (P = (y = g == null ? void 0 : g.getSheetBySheetId(R)) == null ? void 0 : y.getName()) != null ? P : "";
1422
+ }), C = le(() => p(r), [p, r]), S = qe(g == null ? void 0 : g.activeSheet$), v = Ke({ activeSheet: S, sheetName: C }), _ = f.getRenderById(o), T = _ == null ? void 0 : _.with(De), w = _ == null ? void 0 : _.with(Lt), A = O(kt), M = ee((R, y) => {
1423
+ var H, V, te, ie, q, Ye;
1424
+ const P = Fi({ editor: l, lexerTreeBuilder: I });
1425
1425
  if (!P) return;
1426
- const { nodeIndex: y, updatingRefIndex: E, sequenceNodes: F, offset: x } = P;
1426
+ const { nodeIndex: N, updatingRefIndex: E, sequenceNodes: F, offset: x } = P;
1427
1427
  if (n.current === we.NEED_ADD)
1428
1428
  if (x !== 0) {
1429
- if (y === -1 && F.length)
1429
+ if (N === -1 && F.length)
1430
1430
  return;
1431
- const W = _[_.length - 1], Z = F.splice(y + 1), fe = (H = W.sheetId) != null ? H : r, he = {
1431
+ const W = R[R.length - 1], Z = F.splice(N + 1), fe = (H = W.sheetId) != null ? H : r, he = {
1432
1432
  range: W,
1433
1433
  unitId: (V = W.unitId) != null ? V : o,
1434
1434
  sheetName: p(fe)
1435
- }, de = Et([he], i && fe !== r, S);
1435
+ }, de = yt([he], i && fe !== r, C);
1436
1436
  F.push({ token: de[0], nodeType: z.REFERENCE });
1437
- const Fe = [...F, ...Z], vt = Jt(Fe);
1438
- h(vt, bi(F), N);
1437
+ const Fe = [...F, ...Z], vt = tn(Fe);
1438
+ h(vt, Ti(F), y);
1439
1439
  } else {
1440
- const W = _[_.length - 1], Z = (te = W.sheetId) != null ? te : r, fe = {
1440
+ const W = R[R.length - 1], Z = (te = W.sheetId) != null ? te : r, fe = {
1441
1441
  range: W,
1442
1442
  unitId: (ie = W.unitId) != null ? ie : o,
1443
1443
  sheetName: p(Z)
1444
- }, re = Et([fe], i && Z !== r);
1444
+ }, re = yt([fe], i && Z !== r);
1445
1445
  F.unshift({ token: re[0], nodeType: z.REFERENCE });
1446
- const de = Jt(F);
1447
- h(de, re[0].length, N);
1446
+ const de = tn(F);
1447
+ h(de, re[0].length, y);
1448
1448
  }
1449
1449
  else if (n.current === we.EDIT_OTHER_SHEET_REFERENCE) {
1450
- const W = _.pop();
1450
+ const W = R.pop();
1451
1451
  if (!W) return;
1452
- const Z = F[y];
1452
+ const Z = F[N];
1453
1453
  if (typeof Z == "object" && Z.nodeType === z.REFERENCE) {
1454
1454
  const fe = Z.token;
1455
- Z.token = S === (C == null ? void 0 : C.getName()) ? pe(W) : ht(C.getName(), W);
1455
+ Z.token = C === (S == null ? void 0 : S.getName()) ? pe(W) : ht(S.getName(), W);
1456
1456
  const he = x + (Z.token.length - fe.length);
1457
- h(Dr(F), he, N);
1457
+ h(kr(F), he, y);
1458
1458
  }
1459
1459
  } else {
1460
- const W = [..._];
1460
+ const W = [...R];
1461
1461
  if (E !== -1) {
1462
1462
  const Y = W.pop();
1463
1463
  Y && W.splice(E, 0, Y);
1464
1464
  }
1465
1465
  let Z = 0;
1466
1466
  const fe = F.map((Y) => {
1467
- var me, $e, Oe;
1467
+ var me, ke, Oe;
1468
1468
  if (typeof Y == "string")
1469
1469
  return Y;
1470
1470
  if (Y.nodeType === z.REFERENCE) {
1471
- const Me = nt(Y.token);
1472
- if (Me.sheetName || (Me.sheetName = S), i && ((me = v.current.activeSheet) == null ? void 0 : me.getName()) !== Me.sheetName)
1471
+ const Me = ot(Y.token);
1472
+ if (Me.sheetName || (Me.sheetName = C), i && ((me = v.current.activeSheet) == null ? void 0 : me.getName()) !== Me.sheetName)
1473
1473
  return Y.token;
1474
1474
  const Se = W[Z];
1475
1475
  if (Z++, !Se)
1476
1476
  return "";
1477
- const _t = ($e = Se.sheetId) != null ? $e : r, Vt = {
1477
+ const _t = (ke = Se.sheetId) != null ? ke : r, qt = {
1478
1478
  range: Se,
1479
1479
  unitId: (Oe = Se.unitId) != null ? Oe : o,
1480
1480
  sheetName: p(_t)
1481
1481
  };
1482
- return Et([Vt], i, S)[0];
1482
+ return yt([qt], i, C)[0];
1483
1483
  }
1484
1484
  return Y.token;
1485
1485
  });
1486
1486
  let he = "", re;
1487
1487
  fe.forEach((Y, me) => {
1488
- he += Y, me === y && (re = he.length);
1488
+ he += Y, me === N && (re = he.length);
1489
1489
  });
1490
1490
  const de = [];
1491
- for (let Y = Z; Y <= _.length - 1; Y++) {
1492
- const me = _[Y], $e = (q = me.sheetId) != null ? q : r, Oe = {
1491
+ for (let Y = Z; Y <= R.length - 1; Y++) {
1492
+ const me = R[Y], ke = (q = me.sheetId) != null ? q : r, Oe = {
1493
1493
  range: me,
1494
- unitId: (Ke = me.unitId) != null ? Ke : o,
1495
- sheetName: p($e)
1496
- }, Se = Et([Oe], i && $e !== r, S);
1494
+ unitId: (Ye = me.unitId) != null ? Ye : o,
1495
+ sheetName: p(ke)
1496
+ }, Se = yt([Oe], i && ke !== r, C);
1497
1497
  de.push(Se[0]);
1498
1498
  }
1499
- const Fe = F[F.length - 1], vt = Fe && (typeof Fe == "string" ? !1 : Fe.nodeType === z.REFERENCE), Ye = `${he}${de.length && vt ? "," : ""}${de.join(",")}`;
1500
- h(Ye, !de.length && re ? re : Ye.length, N);
1499
+ const Fe = F[F.length - 1], vt = Fe && (typeof Fe == "string" ? !1 : Fe.nodeType === z.REFERENCE), ze = `${he}${de.length && vt ? "," : ""}${de.join(",")}`;
1500
+ h(ze, !de.length && re ? re : ze.length, y);
1501
1501
  }
1502
1502
  });
1503
1503
  L(() => {
1504
1504
  if (T && t) {
1505
- let _ = !0;
1506
- const N = (y, E) => {
1507
- if (_) {
1508
- _ = !1;
1505
+ let R = !0;
1506
+ const y = (N, E) => {
1507
+ if (R) {
1508
+ R = !1;
1509
1509
  return;
1510
1510
  }
1511
- M(y.map((F) => F.rangeWithCoord), E);
1512
- }, P = new Ue();
1513
- return P.add(T.selectionMoving$.subscribe((y) => {
1514
- N(y, !1);
1515
- })), P.add(T.selectionMoveEnd$.subscribe((y) => {
1516
- N(y, !0);
1511
+ M(N.map((F) => F.rangeWithCoord), E);
1512
+ }, P = new Ve();
1513
+ return P.add(T.selectionMoving$.subscribe((N) => {
1514
+ y(N, !1);
1515
+ })), P.add(T.selectionMoveEnd$.subscribe((N) => {
1516
+ y(N, !0);
1517
1517
  })), () => {
1518
1518
  P.dispose();
1519
1519
  };
1520
1520
  }
1521
1521
  }, [t, M, T]), L(() => {
1522
- if (e && T && a) {
1523
- const _ = new Ue(), N = () => {
1524
- _.dispose(), T.getSelectionControls().forEach((E, F) => {
1525
- _.add(
1522
+ if (e && T && l) {
1523
+ const R = new Ve(), y = () => {
1524
+ R.dispose(), T.getSelectionControls().forEach((E, F) => {
1525
+ R.add(
1526
1526
  E.selectionScaling$.subscribe((x) => {
1527
1527
  const H = T.getSelectionDataWithStyle().map((te) => te.rangeWithCoord), V = H[F];
1528
1528
  x.sheetId = V.sheetId, x.unitId = V.unitId, H[F] = x, M(H, !1);
1529
1529
  })
1530
- ), _.add(
1530
+ ), R.add(
1531
1531
  E.selectionMoving$.subscribe((x) => {
1532
1532
  const H = T.getSelectionDataWithStyle().map((te) => te.rangeWithCoord), V = H[F];
1533
1533
  x.sheetId = V.sheetId, x.unitId = V.unitId, H[F] = x, M(H, !0);
1534
1534
  })
1535
1535
  );
1536
1536
  });
1537
- }, P = Br(
1538
- a.input$,
1537
+ }, P = Kr(
1538
+ l.input$,
1539
1539
  A.selectionSet$,
1540
1540
  T.selectionMoveEnd$
1541
1541
  ).pipe(
1542
- Rs(50)
1542
+ bs(50)
1543
1543
  ).subscribe(() => {
1544
- N();
1544
+ y();
1545
1545
  });
1546
1546
  return () => {
1547
- P.unsubscribe(), _.dispose();
1547
+ P.unsubscribe(), R.dispose();
1548
1548
  };
1549
1549
  }
1550
- }, [a, e, M, T, A.selectionSet$]), T == null || T.getSelectionDataWithStyle(), L(() => {
1550
+ }, [l, e, M, T, A.selectionSet$]), T == null || T.getSelectionDataWithStyle(), L(() => {
1551
1551
  if (c) {
1552
- const _ = l.onCommandExecuted((N) => {
1553
- var y;
1554
- if (N.id !== cn.id)
1552
+ const R = u.onCommandExecuted((y) => {
1553
+ var N;
1554
+ if (y.id !== an.id)
1555
1555
  return;
1556
- const P = N.params;
1556
+ const P = y.params;
1557
1557
  if (P.extra === "formula-editor" && P.selections.length) {
1558
1558
  const E = P.selections[P.selections.length - 1];
1559
1559
  if (E) {
1560
- const F = n.current === we.NEED_ADD, x = ((y = T == null ? void 0 : T.getSelectionDataWithStyle()) != null ? y : []).map((H) => H.rangeWithCoord);
1560
+ const F = n.current === we.NEED_ADD, x = ((N = T == null ? void 0 : T.getSelectionDataWithStyle()) != null ? N : []).map((H) => H.rangeWithCoord);
1561
1561
  F ? x.push(E.range) : x[x.length - 1] = E.range, M(x, !0);
1562
1562
  }
1563
1563
  }
1564
1564
  });
1565
1565
  return () => {
1566
- _.dispose();
1566
+ R.dispose();
1567
1567
  };
1568
1568
  }
1569
- }, [l, a, n, R, c, M, T]), L(() => {
1570
- if (!a)
1569
+ }, [u, l, n, I, c, M, T]), L(() => {
1570
+ if (!l)
1571
1571
  return;
1572
- const _ = d.textSelection$.subscribe((N) => {
1573
- N.unitId === a.getEditorId() && xo({
1572
+ const R = d.textSelection$.subscribe((y) => {
1573
+ y.unitId === l.getEditorId() && Do({
1574
1574
  unitId: o,
1575
1575
  subUnitId: r,
1576
1576
  refSelections: s.current,
1577
- editor: a,
1577
+ editor: l,
1578
1578
  refSelectionsService: A,
1579
1579
  refSelectionsRenderService: T,
1580
1580
  sheetSkeletonManagerService: w,
1581
- themeService: f,
1581
+ themeService: a,
1582
1582
  univerInstanceService: m
1583
1583
  });
1584
1584
  });
1585
- return () => _.unsubscribe();
1586
- }, [d.textSelection$, a, s, T, A, w, r, f, o, m]);
1587
- }, Fi = (t, e, n, o, r, s) => {
1588
- const i = O(ae), c = O(be), h = O(ye).getRenderById(e), u = h == null ? void 0 : h.with(De);
1585
+ return () => R.unsubscribe();
1586
+ }, [d.textSelection$, l, s, T, A, w, r, a, o, m]);
1587
+ }, Ai = (t, e, n, o, r, s) => {
1588
+ const i = O(ae), c = O(be), h = O(Ne).getRenderById(e), f = h == null ? void 0 : h.with(De);
1589
1589
  L(() => {
1590
- if (t && u)
1590
+ if (t && f)
1591
1591
  if (n) {
1592
- const m = i.onCommandExecuted((l) => {
1593
- if (l.id === wn.id) {
1594
- const d = u.getSelectionControls().length;
1595
- for (let f = 1; f <= d; f++)
1596
- u.clearLastSelection();
1592
+ const m = i.onCommandExecuted((u) => {
1593
+ if (u.id === Ln.id) {
1594
+ const d = f.getSelectionControls().length;
1595
+ for (let a = 1; a <= d; a++)
1596
+ f.clearLastSelection();
1597
1597
  setTimeout(() => {
1598
1598
  s();
1599
1599
  }, 30);
@@ -1603,10 +1603,10 @@ const Ri = (t, e, n, o) => {
1603
1603
  m.dispose();
1604
1604
  };
1605
1605
  } else {
1606
- const m = i.beforeCommandExecuted((l) => {
1607
- if (l.id === wn.id) {
1606
+ const m = i.beforeCommandExecuted((u) => {
1607
+ if (u.id === Ln.id) {
1608
1608
  o(!1), r(), s();
1609
- const d = c.getEditor(nn);
1609
+ const d = c.getEditor(rn);
1610
1610
  d == null || d.focus();
1611
1611
  }
1612
1612
  });
@@ -1614,8 +1614,8 @@ const Ri = (t, e, n, o) => {
1614
1614
  m.dispose();
1615
1615
  };
1616
1616
  }
1617
- }, [t, u]);
1618
- }, Oi = (t, e, n) => {
1617
+ }, [t, f]);
1618
+ }, Pi = (t, e, n) => {
1619
1619
  const o = O(Ee), r = j(!0);
1620
1620
  L(() => {
1621
1621
  if (t) {
@@ -1629,85 +1629,85 @@ const Ri = (t, e, n, o) => {
1629
1629
  }, [t]), L(() => {
1630
1630
  if (!r.current && e) {
1631
1631
  const s = o.checkIfAddBracket(n);
1632
- e(s === 0 && n.startsWith(oo.EQUALS), `${n}`);
1632
+ e(s === 0 && n.startsWith(so.EQUALS), `${n}`);
1633
1633
  }
1634
1634
  }, [n, e]);
1635
- }, Mi = "univer-sheet-embedding-formula-editor-active", Ai = "univer-sheet-embedding-formula-editor-wrap", Pi = "univer-sheet-embedding-formula-editor-text", xi = "univer-sheet-embedding-formula-editor-error", wi = "univer-sheet-embedding-formula-editor", Di = "univer-sheet-embedding-formula-editor-error-wrap", Xe = {
1636
- sheetEmbeddingFormulaEditorActive: Mi,
1637
- sheetEmbeddingFormulaEditorWrap: Ai,
1638
- sheetEmbeddingFormulaEditorText: Pi,
1639
- sheetEmbeddingFormulaEditorError: xi,
1640
- sheetEmbeddingFormulaEditor: wi,
1641
- sheetEmbeddingFormulaEditorErrorWrap: Di
1642
- }, Li = (t, e = [], n) => {
1643
- const o = O(kt), [r, s] = k([]), [i, c] = k(""), a = j(-1), h = je({ nodes: e }), u = () => {
1644
- s([]), c(""), a.current = -1;
1635
+ }, xi = "univer-sheet-embedding-formula-editor-active", wi = "univer-sheet-embedding-formula-editor-wrap", Di = "univer-sheet-embedding-formula-editor-text", Li = "univer-sheet-embedding-formula-editor-error", $i = "univer-sheet-embedding-formula-editor", ki = "univer-sheet-embedding-formula-editor-error-wrap", Qe = {
1636
+ sheetEmbeddingFormulaEditorActive: xi,
1637
+ sheetEmbeddingFormulaEditorWrap: wi,
1638
+ sheetEmbeddingFormulaEditorText: Di,
1639
+ sheetEmbeddingFormulaEditorError: Li,
1640
+ sheetEmbeddingFormulaEditor: $i,
1641
+ sheetEmbeddingFormulaEditorErrorWrap: ki
1642
+ }, Hi = (t, e = [], n) => {
1643
+ const o = O(Ht), [r, s] = $([]), [i, c] = $(""), l = j(-1), h = Ke({ nodes: e }), f = () => {
1644
+ s([]), c(""), l.current = -1;
1645
1645
  };
1646
1646
  return L(() => {
1647
1647
  if (n && t) {
1648
- const l = n.input$.pipe(rn(300)).subscribe(() => {
1648
+ const u = n.input$.pipe(cn(300)).subscribe(() => {
1649
1649
  const d = n.getSelectionRanges();
1650
1650
  if (d.length === 1) {
1651
- const f = h.current.nodes, R = d[0];
1652
- if (R.collapsed) {
1653
- const g = hn(f, R.startOffset - 1, !1);
1654
- a.current = g;
1655
- const p = f[g];
1651
+ const a = h.current.nodes, I = d[0];
1652
+ if (I.collapsed) {
1653
+ const g = mn(a, I.startOffset - 1, !1);
1654
+ l.current = g;
1655
+ const p = a[g];
1656
1656
  if (p && typeof p != "string" && p.nodeType === z.FUNCTION) {
1657
- a.current = g;
1658
- const S = p.token, C = o.getSearchListByNameFirstLetter(S);
1659
- s(C), c(S);
1657
+ l.current = g;
1658
+ const C = p.token, S = o.getSearchListByNameFirstLetter(C);
1659
+ s(S), c(C);
1660
1660
  return;
1661
1661
  }
1662
1662
  }
1663
1663
  }
1664
- a.current = -1, c(""), s((f) => f != null && f.length ? [] : f);
1664
+ l.current = -1, c(""), s((a) => a != null && a.length ? [] : a);
1665
1665
  });
1666
1666
  return () => {
1667
- l.unsubscribe();
1667
+ u.unsubscribe();
1668
1668
  };
1669
1669
  }
1670
1670
  }, [n, t]), L(() => {
1671
- t || u();
1671
+ t || f();
1672
1672
  }, [t]), {
1673
1673
  searchList: r,
1674
1674
  searchText: i,
1675
- handlerFormulaReplace: (l) => {
1675
+ handlerFormulaReplace: (u) => {
1676
1676
  const d = [...h.current.nodes];
1677
- if (a.current !== -1) {
1678
- const f = d.splice(a.current + 1), R = d.pop() || "";
1679
- let g = (typeof R == "string" ? R.length : R.token.length) - l.length;
1680
- return d.push(l), f[0] !== tt.OPEN_BRACKET && (d.push(tt.OPEN_BRACKET), g--), { text: Jt([...d, ...f]), offset: g };
1677
+ if (l.current !== -1) {
1678
+ const a = d.splice(l.current + 1), I = d.pop() || "";
1679
+ let g = (typeof I == "string" ? I.length : I.token.length) - u.length;
1680
+ return d.push(u), a[0] !== nt.OPEN_BRACKET && (d.push(nt.OPEN_BRACKET), g--), { text: tn([...d, ...a]), offset: g };
1681
1681
  }
1682
1682
  },
1683
- reset: u
1683
+ reset: f
1684
1684
  };
1685
- }, ki = "univer-formula-search-function", $i = "univer-formula-search-function-item", Hi = "univer-formula-search-function-item-name", Wi = "univer-formula-search-function-item-name-light", Ui = "univer-formula-search-function-item-desc", Vi = "univer-formula-search-function-item-active", Pe = {
1686
- formulaSearchFunction: ki,
1687
- formulaSearchFunctionItem: $i,
1688
- formulaSearchFunctionItemName: Hi,
1689
- formulaSearchFunctionItemNameLight: Wi,
1690
- formulaSearchFunctionItemDesc: Ui,
1691
- formulaSearchFunctionItemActive: Vi
1692
- }, Bi = () => {
1693
- }, qi = Te(ji);
1694
- function ji(t, e) {
1695
- const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i = Bi } = t, c = s.getEditorId(), a = O(Ht), h = O(ae), { searchList: u, searchText: m, handlerFormulaReplace: l, reset: d } = Li(n, o, s), f = le(() => !!u.length, [u]), R = j(void 0), [g, p] = k(0), S = j(!1), [C] = Po(c, f, [m, u]), v = je({ searchList: u, active: g }), I = (_) => {
1696
- const N = l(_);
1697
- N && (d(), r(N));
1685
+ }, Wi = "univer-formula-search-function", Ui = "univer-formula-search-function-item", Vi = "univer-formula-search-function-item-name", Bi = "univer-formula-search-function-item-name-light", qi = "univer-formula-search-function-item-desc", ji = "univer-formula-search-function-item-active", Pe = {
1686
+ formulaSearchFunction: Wi,
1687
+ formulaSearchFunctionItem: Ui,
1688
+ formulaSearchFunctionItemName: Vi,
1689
+ formulaSearchFunctionItemNameLight: Bi,
1690
+ formulaSearchFunctionItemDesc: qi,
1691
+ formulaSearchFunctionItemActive: ji
1692
+ }, Ki = () => {
1693
+ }, Yi = Te(zi);
1694
+ function zi(t, e) {
1695
+ const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i = Ki } = t, c = s.getEditorId(), l = O(Ut), h = O(ae), { searchList: f, searchText: m, handlerFormulaReplace: u, reset: d } = Hi(n, o, s), a = le(() => !!f.length, [f]), I = j(void 0), [g, p] = $(0), C = j(!1), [S] = wo(c, a, [m, f]), v = Ke({ searchList: f, active: g }), _ = (R) => {
1696
+ const y = u(R);
1697
+ y && (d(), r(y));
1698
1698
  };
1699
- function T(_) {
1700
- S.current && p(_);
1699
+ function T(R) {
1700
+ C.current && p(R);
1701
1701
  }
1702
1702
  function w() {
1703
- S.current && p(-1);
1703
+ C.current && p(-1);
1704
1704
  }
1705
1705
  L(() => {
1706
- if (!u.length)
1706
+ if (!f.length)
1707
1707
  return;
1708
- const _ = `sheet.formula-embedding-editor.search_function.${c}`, N = new Ue(), P = (y) => {
1708
+ const R = `sheet.formula-embedding-editor.search_function.${c}`, y = new Ve(), P = (N) => {
1709
1709
  const { searchList: E, active: F } = v.current;
1710
- switch (y) {
1710
+ switch (N) {
1711
1711
  case D.ARROW_UP: {
1712
1712
  p((x) => {
1713
1713
  const H = Math.max(0, x - 1);
@@ -1725,7 +1725,7 @@ function ji(t, e) {
1725
1725
  case D.TAB:
1726
1726
  case D.ENTER: {
1727
1727
  const x = E[F];
1728
- I(x.name);
1728
+ _(x.name);
1729
1729
  break;
1730
1730
  }
1731
1731
  case D.ESC: {
@@ -1734,88 +1734,88 @@ function ji(t, e) {
1734
1734
  }
1735
1735
  }
1736
1736
  };
1737
- return N.add(h.registerCommand({
1738
- id: _,
1737
+ return y.add(h.registerCommand({
1738
+ id: R,
1739
1739
  type: Ie.OPERATION,
1740
- handler(y, E) {
1740
+ handler(N, E) {
1741
1741
  const { keyCode: F } = E;
1742
1742
  P(F);
1743
1743
  }
1744
- })), [D.ARROW_UP, D.ARROW_DOWN, D.ENTER, D.ESC, D.TAB].map((y) => ({
1745
- id: _,
1746
- binding: y,
1744
+ })), [D.ARROW_UP, D.ARROW_DOWN, D.ENTER, D.ESC, D.TAB].map((N) => ({
1745
+ id: R,
1746
+ binding: N,
1747
1747
  preconditions: () => !0,
1748
1748
  priority: 1e3,
1749
1749
  staticParameters: {
1750
- eventType: Ne.Keyboard,
1751
- keyCode: y
1750
+ eventType: ye.Keyboard,
1751
+ keyCode: N
1752
1752
  }
1753
- })).forEach((y) => {
1754
- N.add(a.registerShortcut(y));
1753
+ })).forEach((N) => {
1754
+ y.add(l.registerShortcut(N));
1755
1755
  }), () => {
1756
- N.dispose();
1756
+ y.dispose();
1757
1757
  };
1758
- }, [u]);
1759
- function A(_) {
1758
+ }, [f]);
1759
+ function A(R) {
1760
1760
  var ie;
1761
- const N = (ie = R.current) == null ? void 0 : ie.querySelectorAll(`.${Pe.formulaSearchFunctionItem}`)[_];
1762
- if (!N) return;
1763
- const P = N.parentNode;
1761
+ const y = (ie = I.current) == null ? void 0 : ie.querySelectorAll(`.${Pe.formulaSearchFunctionItem}`)[R];
1762
+ if (!y) return;
1763
+ const P = y.parentNode;
1764
1764
  if (!P) return;
1765
- const E = P.getBoundingClientRect().top, F = P.offsetHeight, x = N.getBoundingClientRect(), H = x.top, V = x.height;
1765
+ const E = P.getBoundingClientRect().top, F = P.offsetHeight, x = y.getBoundingClientRect(), H = x.top, V = x.height;
1766
1766
  if (H >= 0 && H > E && H - E + V <= F)
1767
1767
  return;
1768
- const te = N.offsetTop - (F - V) / 2;
1768
+ const te = y.offsetTop - (F - V) / 2;
1769
1769
  P.scrollTo({
1770
1770
  top: te,
1771
1771
  behavior: "smooth"
1772
1772
  });
1773
1773
  }
1774
1774
  const M = le(() => {
1775
- let _ = "";
1775
+ let R = "";
1776
1776
  return () => {
1777
- clearTimeout(_), S.current = !0, _ = setTimeout(() => {
1778
- S.current = !1;
1777
+ clearTimeout(R), C.current = !0, R = setTimeout(() => {
1778
+ C.current = !1;
1779
1779
  }, 300);
1780
1780
  };
1781
1781
  }, []);
1782
- return u.length > 0 && f && /* @__PURE__ */ b(go, { portal: !0, anchorRect$: C, direction: "vertical", children: /* @__PURE__ */ b(
1782
+ return f.length > 0 && a && /* @__PURE__ */ b(So, { portal: !0, anchorRect$: S, direction: "vertical", children: /* @__PURE__ */ b(
1783
1783
  "ul",
1784
1784
  {
1785
1785
  className: Pe.formulaSearchFunction,
1786
- ref: (_) => {
1787
- R.current = _, e && (e.current = _);
1786
+ ref: (R) => {
1787
+ I.current = R, e && (e.current = R);
1788
1788
  },
1789
- children: u.map((_, N) => /* @__PURE__ */ $(
1789
+ children: f.map((R, y) => /* @__PURE__ */ k(
1790
1790
  "li",
1791
1791
  {
1792
- className: g === N ? `
1792
+ className: g === y ? `
1793
1793
  ${Pe.formulaSearchFunctionItem}
1794
1794
  ${Pe.formulaSearchFunctionItemActive}
1795
1795
  ` : Pe.formulaSearchFunctionItem,
1796
- onMouseEnter: () => T(N),
1796
+ onMouseEnter: () => T(y),
1797
1797
  onMouseLeave: w,
1798
1798
  onMouseMove: M,
1799
1799
  onClick: () => {
1800
- I(_.name), s && s.focus();
1800
+ _(R.name), s && s.focus();
1801
1801
  },
1802
1802
  children: [
1803
- /* @__PURE__ */ $("span", { className: Pe.formulaSearchFunctionItemName, children: [
1804
- /* @__PURE__ */ b("span", { className: Pe.formulaSearchFunctionItemNameLight, children: _.name.substring(0, m.length) }),
1805
- /* @__PURE__ */ b("span", { children: _.name.slice(m.length) })
1803
+ /* @__PURE__ */ k("span", { className: Pe.formulaSearchFunctionItemName, children: [
1804
+ /* @__PURE__ */ b("span", { className: Pe.formulaSearchFunctionItemNameLight, children: R.name.substring(0, m.length) }),
1805
+ /* @__PURE__ */ b("span", { children: R.name.slice(m.length) })
1806
1806
  ] }),
1807
- /* @__PURE__ */ b("span", { className: Pe.formulaSearchFunctionItemDesc, children: _.desc })
1807
+ /* @__PURE__ */ b("span", { className: Pe.formulaSearchFunctionItemDesc, children: R.desc })
1808
1808
  ]
1809
1809
  },
1810
- _.name
1810
+ R.name
1811
1811
  ))
1812
1812
  }
1813
1813
  ) });
1814
1814
  }
1815
- const Ki = (t) => t.startsWith(oo.EQUALS) ? t.slice(1) : "", Un = () => {
1815
+ const Gi = (t) => t.startsWith(so.EQUALS) ? t.slice(1) : "", Bn = () => {
1816
1816
  };
1817
- function Yi(t) {
1818
- var Sn, Cn;
1817
+ function Zi(t) {
1818
+ var vn, _n;
1819
1819
  const {
1820
1820
  errorText: e,
1821
1821
  initValue: n,
@@ -1823,66 +1823,66 @@ function Yi(t) {
1823
1823
  subUnitId: r,
1824
1824
  isFocus: s = !0,
1825
1825
  isSupportAcrossSheet: i = !1,
1826
- onFocus: c = Un,
1827
- onBlur: a = Un,
1826
+ onFocus: c = Bn,
1827
+ onBlur: l = Bn,
1828
1828
  onChange: h,
1829
- onVerify: u,
1829
+ onVerify: f,
1830
1830
  actions: m,
1831
- className: l,
1831
+ className: u,
1832
1832
  editorId: d,
1833
- moveCursor: f = !0,
1834
- onFormulaSelectingChange: R,
1833
+ moveCursor: a = !0,
1834
+ onFormulaSelectingChange: I,
1835
1835
  keyboradEventConfig: g,
1836
1836
  onMoveInEditor: p,
1837
- resetSelectionOnBlur: S = !0,
1838
- autoScrollbar: C = !0,
1837
+ resetSelectionOnBlur: C = !0,
1838
+ autoScrollbar: S = !0,
1839
1839
  isSingle: v = !0,
1840
- disableSelectionOnClick: I = !1,
1840
+ disableSelectionOnClick: _ = !1,
1841
1841
  disableContextMenu: T,
1842
1842
  style: w
1843
- } = t, A = O(be), M = j(null), _ = ee(h);
1843
+ } = t, A = O(be), M = j(null), R = ee(h);
1844
1844
  m && (m.handleOutClick = (X, Q) => {
1845
1845
  M.current && !M.current.contains(X.target) && Q();
1846
1846
  });
1847
- const N = ee(R), P = j(null), y = j(void 0), E = y.current, [F, x] = k(s), H = j(null), V = le(() => d != null ? d : Qo(`${Cr}-${Jo(4)}`), []), te = le(() => e !== void 0, [e]), ie = O(oe), q = ie.getUnit(V);
1848
- Be(q == null ? void 0 : q.change$);
1849
- const Ke = pi(), W = er.transform.getPlainText((Cn = (Sn = q == null ? void 0 : q.getBody()) == null ? void 0 : Sn.dataStream) != null ? Cn : ""), Z = je(W), fe = le(() => Ki(W), [W]), he = le(() => Ke(fe), [fe, Ke]), { isSelecting: re, isSelectingRef: de } = gi({ unitId: o, subUnitId: r, editorId: V, isFocus: F, disableOnClick: I }), Fe = j(""), Ye = O(ye).getRenderById(V), Y = Ye == null ? void 0 : Ye.with(co), me = Y == null ? void 0 : Y.isFocusing, $e = le(() => ie.getCurrentTypeOfUnit$(ue.UNIVER_DOC), [ie]), Oe = Be($e), Me = (Oe == null ? void 0 : Oe.getUnitId()) === V, Se = j([]), _t = re;
1850
- us(() => {
1851
- _(W);
1852
- }, [W, _]);
1853
- const Vt = wo("="), gn = Ci(o, r), ze = ee((X, Q = !0, Ce, ve) => {
1854
- if (!y.current) return;
1847
+ const y = ee(I), P = j(null), N = j(void 0), E = N.current, [F, x] = $(s), H = j(null), V = le(() => d != null ? d : tr(`${Rr}-${nr(4)}`), []), te = le(() => e !== void 0, [e]), ie = O(oe), q = ie.getUnit(V);
1848
+ qe(q == null ? void 0 : q.change$);
1849
+ const Ye = vi(), W = or.transform.getPlainText((_n = (vn = q == null ? void 0 : q.getBody()) == null ? void 0 : vn.dataStream) != null ? _n : ""), Z = Ke(W), fe = le(() => Gi(W), [W]), he = le(() => Ye(fe), [fe, Ye]), { isSelecting: re, isSelectingRef: de } = Ci({ unitId: o, subUnitId: r, editorId: V, isFocus: F, disableOnClick: _ }), Fe = j(""), ze = O(Ne).getRenderById(V), Y = ze == null ? void 0 : ze.with(ao), me = Y == null ? void 0 : Y.isFocusing, ke = le(() => ie.getCurrentTypeOfUnit$(ue.UNIVER_DOC), [ie]), Oe = qe(ke), Me = (Oe == null ? void 0 : Oe.getUnitId()) === V, Se = j([]), _t = re;
1850
+ ds(() => {
1851
+ R(W);
1852
+ }, [W, R]);
1853
+ const qt = Lo("="), Sn = Ri(o, r), Ge = ee((X, Q = !0, Ce, ve) => {
1854
+ if (!N.current) return;
1855
1855
  Fe.current = X;
1856
- const rt = Ke(X[0] === "=" ? X.slice(1) : ""), Ae = Vt(
1857
- y.current,
1858
- rt,
1856
+ const Rt = X[0] === "=" ? X.slice(1) : "", Ae = Ye(Rt), Yo = Ae.reduce((He, Et) => typeof Et == "object" ? `${He}${Et.token}` : `${He}${Et}`, ""), It = qt(
1857
+ N.current,
1858
+ Yo === Rt ? Ae : [],
1859
1859
  Q,
1860
1860
  ve
1861
1861
  );
1862
- if (Se.current = Ae, Ce) {
1863
- const Rt = ve != null ? ve : E == null ? void 0 : E.getSelectionRanges();
1864
- if ((Rt == null ? void 0 : Rt.length) !== 1)
1862
+ if (Se.current = It, Ce) {
1863
+ const He = ve != null ? ve : E == null ? void 0 : E.getSelectionRanges();
1864
+ if ((He == null ? void 0 : He.length) !== 1)
1865
1865
  return;
1866
- const jo = Rt[0].startOffset - 1, Ko = hn(rt, jo, !1), vn = No(rt, Ko);
1867
- if (vn >= 0) {
1868
- const _n = Ae.splice(vn, 1)[0];
1869
- _n && Ae.push(_n);
1866
+ const zo = He[0].startOffset - 1, Go = mn(Ae, zo, !1), Rn = To(Ae, Go);
1867
+ if (Rn >= 0) {
1868
+ const In = It.splice(Rn, 1)[0];
1869
+ In && It.push(In);
1870
1870
  }
1871
- gn(F ? Ae : [], y.current);
1871
+ Sn(F ? It : [], N.current);
1872
1872
  }
1873
1873
  });
1874
1874
  L(() => {
1875
- F && ze(W, !1, !0);
1875
+ F && Ge(W, !1, !0);
1876
1876
  }, [F]), L(() => {
1877
1877
  if (F) {
1878
1878
  if (Fe.current === W) return;
1879
- ze(W, !1, !0);
1879
+ Ge(W, !1, !0);
1880
1880
  }
1881
- }, [W]), Oi(F, u, W);
1882
- const Ge = ui(E), pn = Ei(F, o, r);
1881
+ }, [W]), Pi(F, f, W);
1882
+ const Ze = di(E), Cn = Ni(F, o, r);
1883
1883
  L(() => {
1884
- N(re);
1885
- }, [N, re]), Gr(F, g, E), Tt(() => {
1884
+ y(re);
1885
+ }, [y, re]), Qr(F, g, E), Ot(() => {
1886
1886
  let X;
1887
1887
  if (H.current) {
1888
1888
  X = A.register({
@@ -1902,26 +1902,26 @@ function Yi(t) {
1902
1902
  }
1903
1903
  }, H.current);
1904
1904
  const Q = A.getEditor(V);
1905
- y.current = Q, ze(n, !1, !0);
1905
+ N.current = Q, Ge(n, !1, !0);
1906
1906
  }
1907
1907
  return () => {
1908
1908
  X == null || X.dispose();
1909
1909
  };
1910
- }, []), Tt(() => {
1911
- s ? (x(s), Ge()) : (S && (E == null || E.blur(), pn()), x(s));
1912
- }, [s, E, Ge, pn, S]);
1913
- const { checkScrollBar: Uo } = Zr(E, v, C);
1914
- Ii(F, !!(re && Me), o, T), Ri(F && f, _t, E, p);
1915
- const Vo = ee((X, Q, Ce) => {
1910
+ }, []), Ot(() => {
1911
+ s ? (x(s), Ze()) : (C && (E == null || E.blur(), Cn()), x(s));
1912
+ }, [s, E, Ze, Cn, C]);
1913
+ const { checkScrollBar: Bo } = Jr(E, v, S);
1914
+ yi(F, !!(re && Me), o, T), bi(F && a, _t, E, p);
1915
+ const qo = ee((X, Q, Ce) => {
1916
1916
  if (!me)
1917
1917
  return;
1918
1918
  const ve = Q !== -1 ? [{ startOffset: Q + 1, endOffset: Q + 1, collapsed: !0 }] : void 0;
1919
- ze(`=${X}`, !0, Ce, ve), Ce && (Ge(), Q !== -1 && setTimeout(() => {
1920
- const rt = { startOffset: Q + 1, endOffset: Q + 1 }, Ae = E == null ? void 0 : E.render.with(Xr);
1921
- Ae == null || Ae.scrollToRange({ ...rt, collapsed: !0 });
1922
- }, 50), Uo());
1919
+ Ge(`=${X}`, !0, Ce, ve), Ce && (Ze(), Q !== -1 && setTimeout(() => {
1920
+ const Rt = { startOffset: Q + 1, endOffset: Q + 1 }, Ae = E == null ? void 0 : E.render.with(es);
1921
+ Ae == null || Ae.scrollToRange({ ...Rt, collapsed: !0 });
1922
+ }, 50), Bo());
1923
1923
  });
1924
- Ti(
1924
+ Mi(
1925
1925
  F && !!(re && Me),
1926
1926
  F,
1927
1927
  de,
@@ -1931,11 +1931,11 @@ function Yi(t) {
1931
1931
  i,
1932
1932
  !!_t,
1933
1933
  E,
1934
- Vo
1935
- ), Fi(F && !!(re && Me), o, i, x, a, () => {
1936
- ze(Z.current, !1, !0);
1934
+ qo
1935
+ ), Ai(F && !!(re && Me), o, i, x, l, () => {
1936
+ Ge(Z.current, !1, !0);
1937
1937
  });
1938
- const Bo = (X) => {
1938
+ const jo = (X) => {
1939
1939
  if (X) {
1940
1940
  const Q = E == null ? void 0 : E.getSelectionRanges();
1941
1941
  if (Q && Q.length === 1) {
@@ -1947,64 +1947,64 @@ function Yi(t) {
1947
1947
  }, 30);
1948
1948
  }
1949
1949
  }
1950
- Ge(), ze(`=${X.text}`);
1950
+ Ze(), Ge(`=${X.text}`);
1951
1951
  }
1952
- }, qo = () => {
1953
- x(!0), c(), Ge();
1952
+ }, Ko = () => {
1953
+ x(!0), c(), Ze();
1954
1954
  };
1955
- return /* @__PURE__ */ $("div", { style: w, className: kn(Xe.sheetEmbeddingFormulaEditor, l), children: [
1955
+ return /* @__PURE__ */ k("div", { style: w, className: Hn(Qe.sheetEmbeddingFormulaEditor, u), children: [
1956
1956
  /* @__PURE__ */ b(
1957
1957
  "div",
1958
1958
  {
1959
- className: kn(Xe.sheetEmbeddingFormulaEditorWrap, {
1960
- [Xe.sheetEmbeddingFormulaEditorActive]: F,
1961
- [Xe.sheetEmbeddingFormulaEditorError]: te
1959
+ className: Hn(Qe.sheetEmbeddingFormulaEditorWrap, {
1960
+ [Qe.sheetEmbeddingFormulaEditorActive]: F,
1961
+ [Qe.sheetEmbeddingFormulaEditorError]: te
1962
1962
  }),
1963
1963
  ref: M,
1964
1964
  children: /* @__PURE__ */ b(
1965
1965
  "div",
1966
1966
  {
1967
- className: Xe.sheetEmbeddingFormulaEditorText,
1967
+ className: Qe.sheetEmbeddingFormulaEditorText,
1968
1968
  ref: H,
1969
- onMouseUp: qo
1969
+ onMouseUp: Ko
1970
1970
  }
1971
1971
  )
1972
1972
  }
1973
1973
  ),
1974
- e !== void 0 ? /* @__PURE__ */ b("div", { className: Xe.sheetEmbeddingFormulaEditorErrorWrap, children: e }) : null,
1974
+ e !== void 0 ? /* @__PURE__ */ b("div", { className: Qe.sheetEmbeddingFormulaEditorErrorWrap, children: e }) : null,
1975
1975
  E ? /* @__PURE__ */ b(
1976
- ai,
1976
+ hi,
1977
1977
  {
1978
1978
  editor: E,
1979
1979
  isFocus: F,
1980
1980
  formulaText: W,
1981
- onClose: () => Ge()
1981
+ onClose: () => Ze()
1982
1982
  }
1983
1983
  ) : null,
1984
1984
  E ? /* @__PURE__ */ b(
1985
- qi,
1985
+ Yi,
1986
1986
  {
1987
1987
  isFocus: F,
1988
1988
  sequenceNodes: he,
1989
- onSelect: Bo,
1989
+ onSelect: jo,
1990
1990
  ref: P,
1991
1991
  editor: E
1992
1992
  }
1993
1993
  ) : null
1994
1994
  ] });
1995
1995
  }
1996
- function zi(t, e, n, o) {
1997
- const r = O(Ee), s = wo(""), i = Be(t == null ? void 0 : t.getDocumentDataModel().change$), [c, a] = k([]), h = O(vr), u = j(""), m = O(oe);
1996
+ function Xi(t, e, n, o) {
1997
+ const r = O(Ee), s = Lo(""), i = qe(t == null ? void 0 : t.getDocumentDataModel().change$), [c, l] = $([]), h = O(Ir), f = j(""), m = O(oe);
1998
1998
  return L(() => {
1999
1999
  if (!t) return;
2000
- const l = t.getDocumentDataModel().getPlainText();
2001
- if (u.current === l)
2000
+ const u = t.getDocumentDataModel().getPlainText();
2001
+ if (f.current === u)
2002
2002
  return;
2003
- u.current = l;
2004
- const d = r.sequenceNodesBuilder(l);
2005
- a(d != null ? d : []);
2003
+ f.current = u;
2004
+ const d = r.sequenceNodesBuilder(u);
2005
+ l(d != null ? d : []);
2006
2006
  }, [i, t, r]), L(() => {
2007
- var f, R;
2007
+ var a, I;
2008
2008
  if (!t) return;
2009
2009
  if (!e) {
2010
2010
  const g = t.getDocumentData();
@@ -2012,18 +2012,18 @@ function zi(t, e, n, o) {
2012
2012
  ...g,
2013
2013
  body: {
2014
2014
  ...g.body,
2015
- dataStream: (R = (f = g.body) == null ? void 0 : f.dataStream) != null ? R : "",
2015
+ dataStream: (I = (a = g.body) == null ? void 0 : a.dataStream) != null ? I : "",
2016
2016
  textRuns: []
2017
2017
  }
2018
2018
  });
2019
2019
  return;
2020
2020
  }
2021
- const l = s(t, c, !1), d = new Ue();
2022
- return l.forEach((g) => {
2023
- const p = nt(g.token), S = m.getCurrentUnitForType(ue.UNIVER_SHEET), C = S == null ? void 0 : S.getActiveSheet();
2024
- if (!p.sheetName && o !== (C == null ? void 0 : C.getSheetId()) || p.sheetName && (C == null ? void 0 : C.getName()) !== p.sheetName)
2021
+ const u = s(t, c, !1), d = new Ve();
2022
+ return u.forEach((g) => {
2023
+ const p = ot(g.token), C = m.getCurrentUnitForType(ue.UNIVER_SHEET), S = C == null ? void 0 : C.getActiveSheet();
2024
+ if (!p.sheetName && o !== (S == null ? void 0 : S.getSheetId()) || p.sheetName && (S == null ? void 0 : S.getName()) !== p.sheetName)
2025
2025
  return;
2026
- const v = new on(g.themeColor).toRgb(), I = h.addShape({
2026
+ const v = new sn(g.themeColor).toRgb(), _ = h.addShape({
2027
2027
  range: p.range,
2028
2028
  style: {
2029
2029
  stroke: g.themeColor,
@@ -2032,49 +2032,49 @@ function zi(t, e, n, o) {
2032
2032
  },
2033
2033
  primary: null
2034
2034
  });
2035
- I && d.add(() => h.removeShape(I));
2035
+ _ && d.add(() => h.removeShape(_));
2036
2036
  }), () => {
2037
2037
  d.dispose();
2038
2038
  };
2039
2039
  }, [t, e, s, h, c]), { sequenceNodes: c };
2040
2040
  }
2041
- function Gi(t) {
2042
- const e = O(sn), { supportAcrossSheet: n = !1, unitId: o, subUnitId: r, onChange: s } = t, c = O(oe).getUnit(o, ue.UNIVER_SHEET), a = ee(s), h = ee((u, m) => {
2043
- const l = c == null ? void 0 : c.getActiveSheet();
2044
- if (!l || !n && l.getSheetId() !== r || !(u != null && u.length)) return;
2045
- const d = u.map((f) => ({
2046
- range: f.range,
2041
+ function Qi(t) {
2042
+ const e = O(ln), { supportAcrossSheet: n = !1, unitId: o, subUnitId: r, onChange: s } = t, c = O(oe).getUnit(o, ue.UNIVER_SHEET), l = ee(s), h = ee((f, m) => {
2043
+ const u = c == null ? void 0 : c.getActiveSheet();
2044
+ if (!u || !n && u.getSheetId() !== r || !(f != null && f.length)) return;
2045
+ const d = f.map((a) => ({
2046
+ range: a.range,
2047
2047
  unitId: o,
2048
- sheetName: l.getSheetId() === r ? "" : l.getName()
2048
+ sheetName: u.getSheetId() === r ? "" : u.getName()
2049
2049
  }));
2050
- a(d, m);
2050
+ l(d, m);
2051
2051
  });
2052
2052
  L(() => {
2053
- const u = new Ue();
2054
- return u.add(e.selectionMoveStart$.subscribe((m) => {
2053
+ const f = new Ve();
2054
+ return f.add(e.selectionMoveStart$.subscribe((m) => {
2055
2055
  h(m, !0);
2056
- })), u.add(e.selectionMoving$.subscribe((m) => {
2056
+ })), f.add(e.selectionMoving$.subscribe((m) => {
2057
2057
  h(m, !1);
2058
- })), u.add(e.selectionMoveEnd$.subscribe((m) => {
2058
+ })), f.add(e.selectionMoveEnd$.subscribe((m) => {
2059
2059
  h(m, !1);
2060
2060
  })), () => {
2061
- u.dispose();
2061
+ f.dispose();
2062
2062
  };
2063
2063
  }, [h, e.selectionMoveEnd$, e.selectionMoveStart$, e.selectionMoving$]);
2064
2064
  }
2065
- const Zi = "univer-sheet-range-selector-icon", Xi = "univer-sheet-range-selector-dialog", Qi = "univer-sheet-range-selector-dialog-item", Ji = "univer-sheet-range-selector-dialog-item-delete", Nt = {
2066
- sheetRangeSelectorIcon: Zi,
2067
- sheetRangeSelectorDialog: Xi,
2068
- sheetRangeSelectorDialogItem: Qi,
2069
- sheetRangeSelectorDialogItemDelete: Ji
2070
- }, Vn = (t) => !t.some((n) => {
2065
+ const Ji = "univer-sheet-range-selector-icon", ec = "univer-sheet-range-selector-dialog", tc = "univer-sheet-range-selector-dialog-item", nc = "univer-sheet-range-selector-dialog-item-delete", Tt = {
2066
+ sheetRangeSelectorIcon: Ji,
2067
+ sheetRangeSelectorDialog: ec,
2068
+ sheetRangeSelectorDialogItem: tc,
2069
+ sheetRangeSelectorDialogItemDelete: nc
2070
+ }, qn = (t) => !t.some((n) => {
2071
2071
  if (typeof n == "string") {
2072
- if (n !== tt.COMMA)
2072
+ if (n !== nt.COMMA)
2073
2073
  return !0;
2074
2074
  } else if (n.nodeType !== z.REFERENCE)
2075
2075
  return !0;
2076
2076
  return !1;
2077
- }), ec = (t) => {
2077
+ }), oc = (t) => {
2078
2078
  if (t.endColumn < t.startColumn) {
2079
2079
  const e = t.endColumn;
2080
2080
  t.endColumn = t.startColumn, t.startColumn = e;
@@ -2085,124 +2085,124 @@ const Zi = "univer-sheet-range-selector-icon", Xi = "univer-sheet-range-selector
2085
2085
  }
2086
2086
  return t;
2087
2087
  };
2088
- function tc(t) {
2089
- const { visible: e, initialValue: n, unitId: o, subUnitId: r, maxRangeCount: s = 1 / 0, supportAcrossSheet: i, onConfirm: c, onClose: a, onShowBySelection: h } = t, u = O(qe), m = O(Ee), [l, d] = k([]), [f, R] = k(0), g = j(null);
2088
+ function rc(t) {
2089
+ const { visible: e, initialValue: n, unitId: o, subUnitId: r, maxRangeCount: s = 1 / 0, supportAcrossSheet: i, onConfirm: c, onClose: l, onShowBySelection: h } = t, f = O(je), m = O(Ee), [u, d] = $([]), [a, I] = $(0), g = j(null);
2090
2090
  L(() => {
2091
2091
  if (e && n.length) {
2092
- const v = n.map((I) => I.sheetName ? ht(I.sheetName, I.range) : pe(I.range));
2093
- d(v), R(v.length - 1);
2092
+ const v = n.map((_) => _.sheetName ? ht(_.sheetName, _.range) : pe(_.range));
2093
+ d(v), I(v.length - 1);
2094
2094
  } else
2095
- d([""]), R(0);
2095
+ d([""]), I(0);
2096
2096
  }, [e]);
2097
- const p = (v, I) => {
2098
- const T = [...l];
2099
- T[v] = I, d(T);
2100
- }, S = () => {
2101
- d([...l, ""]), R(l.length);
2102
- }, C = (v) => {
2103
- l.splice(v, 1), d([...l]);
2097
+ const p = (v, _) => {
2098
+ const T = [...u];
2099
+ T[v] = _, d(T);
2100
+ }, C = () => {
2101
+ d([...u, ""]), I(u.length);
2102
+ }, S = (v) => {
2103
+ u.splice(v, 1), d([...u]);
2104
2104
  };
2105
- return Gi({
2105
+ return Qi({
2106
2106
  unitId: o,
2107
2107
  subUnitId: r,
2108
2108
  supportAcrossSheet: i,
2109
- onChange: (v, I) => {
2109
+ onChange: (v, _) => {
2110
2110
  if (!e && h != null && h(v))
2111
2111
  return;
2112
- const T = new Set(l), w = v.map((_) => _.sheetName ? ht(_.sheetName, _.range) : pe(_.range)), A = w.filter((_) => !T.has(_));
2112
+ const T = new Set(u), w = v.map((R) => R.sheetName ? ht(R.sheetName, R.range) : pe(R.range)), A = w.filter((R) => !T.has(R));
2113
2113
  if (!A.length) return;
2114
- const M = [...l];
2114
+ const M = [...u];
2115
2115
  if (w.length > 1) {
2116
- I || M.splice(f, 1), M.push(...A);
2117
- const _ = M.slice(0, s);
2118
- d(_), R(_.length - 1), requestAnimationFrame(() => {
2119
- var N;
2120
- (N = g.current) == null || N.scrollTo({ top: g.current.scrollHeight });
2116
+ _ || M.splice(a, 1), M.push(...A);
2117
+ const R = M.slice(0, s);
2118
+ d(R), I(R.length - 1), requestAnimationFrame(() => {
2119
+ var y;
2120
+ (y = g.current) == null || y.scrollTo({ top: g.current.scrollHeight });
2121
2121
  });
2122
2122
  } else {
2123
- M.splice(f, 1, ...A);
2124
- const _ = M.slice(0, s);
2125
- d(_), R(f + A.length - 1);
2123
+ M.splice(a, 1, ...A);
2124
+ const R = M.slice(0, s);
2125
+ d(R), I(a + A.length - 1);
2126
2126
  }
2127
2127
  }
2128
2128
  }), /* @__PURE__ */ b(
2129
- vs,
2129
+ Is,
2130
2130
  {
2131
2131
  width: "328px",
2132
2132
  visible: e,
2133
- title: u.t("rangeSelector.title"),
2133
+ title: f.t("rangeSelector.title"),
2134
2134
  draggable: !0,
2135
- closeIcon: /* @__PURE__ */ b(Wt, {}),
2136
- footer: /* @__PURE__ */ $("footer", { children: [
2137
- /* @__PURE__ */ b(Je, { onClick: a, children: u.t("rangeSelector.cancel") }),
2135
+ closeIcon: /* @__PURE__ */ b(Vt, {}),
2136
+ footer: /* @__PURE__ */ k("footer", { children: [
2137
+ /* @__PURE__ */ b(et, { onClick: l, children: f.t("rangeSelector.cancel") }),
2138
2138
  /* @__PURE__ */ b(
2139
- Je,
2139
+ et,
2140
2140
  {
2141
2141
  style: { marginLeft: 10 },
2142
2142
  onClick: () => {
2143
2143
  c(
2144
- l.filter((v) => {
2145
- const I = m.sequenceNodesBuilder(v);
2146
- return I && I.length === 1 && typeof I[0] != "string" && I[0].nodeType === z.REFERENCE;
2147
- }).map((v) => nt(v)).map((v) => ({ ...v, range: ec(v.range) }))
2144
+ u.filter((v) => {
2145
+ const _ = m.sequenceNodesBuilder(v);
2146
+ return _ && _.length === 1 && typeof _[0] != "string" && _[0].nodeType === z.REFERENCE;
2147
+ }).map((v) => ot(v)).map((v) => ({ ...v, range: oc(v.range) }))
2148
2148
  );
2149
2149
  },
2150
2150
  type: "primary",
2151
- children: u.t("rangeSelector.confirm")
2151
+ children: f.t("rangeSelector.confirm")
2152
2152
  }
2153
2153
  )
2154
2154
  ] }),
2155
- onClose: a,
2156
- children: /* @__PURE__ */ $("div", { ref: g, className: Nt.sheetRangeSelectorDialog, children: [
2157
- l.map((v, I) => /* @__PURE__ */ $("div", { className: Nt.sheetRangeSelectorDialogItem, children: [
2155
+ onClose: l,
2156
+ children: /* @__PURE__ */ k("div", { ref: g, className: Tt.sheetRangeSelectorDialog, children: [
2157
+ u.map((v, _) => /* @__PURE__ */ k("div", { className: Tt.sheetRangeSelectorDialogItem, children: [
2158
2158
  /* @__PURE__ */ b(
2159
- vo,
2159
+ Ro,
2160
2160
  {
2161
2161
  affixWrapperStyle: { width: "100%" },
2162
- placeholder: u.t("rangeSelector.placeHolder"),
2163
- onFocus: () => R(I),
2162
+ placeholder: f.t("rangeSelector.placeHolder"),
2163
+ onFocus: () => I(_),
2164
2164
  value: v,
2165
- onChange: (T) => p(I, T),
2166
- style: { borderColor: f === I ? "rgb(var(--primary-color))" : void 0 }
2165
+ onChange: (T) => p(_, T),
2166
+ style: { borderColor: a === _ ? "rgb(var(--primary-color))" : void 0 }
2167
2167
  }
2168
2168
  ),
2169
- l.length > 1 && /* @__PURE__ */ b(Fo, { className: Nt.sheetRangeSelectorDialogItemDelete, onClick: () => C(I) })
2170
- ] }, I)),
2171
- l.length < s && /* @__PURE__ */ b("div", { children: /* @__PURE__ */ $(Je, { type: "link", size: "small", onClick: S, children: [
2172
- /* @__PURE__ */ b(Mo, {}),
2173
- /* @__PURE__ */ b("span", { children: u.t("rangeSelector.addAnotherRange") })
2169
+ u.length > 1 && /* @__PURE__ */ b(Mo, { className: Tt.sheetRangeSelectorDialogItemDelete, onClick: () => S(_) })
2170
+ ] }, _)),
2171
+ u.length < s && /* @__PURE__ */ b("div", { children: /* @__PURE__ */ k(et, { type: "link", size: "small", onClick: C, children: [
2172
+ /* @__PURE__ */ b(Po, {}),
2173
+ /* @__PURE__ */ b("span", { children: f.t("rangeSelector.addAnotherRange") })
2174
2174
  ] }) })
2175
2175
  ] })
2176
2176
  }
2177
2177
  );
2178
2178
  }
2179
- function nc(t) {
2180
- return t.split(tt.COMMA).filter((e) => !!e).map((e) => nt(e));
2179
+ function sc(t) {
2180
+ return t.split(nt.COMMA).filter((e) => !!e).map((e) => ot(e));
2181
2181
  }
2182
- function oc(t) {
2183
- return t.map((e) => e.sheetName ? ht(e.sheetName, e.range) : pe(e.range)).join(tt.COMMA);
2182
+ function ic(t) {
2183
+ return t.map((e) => e.sheetName ? ht(e.sheetName, e.range) : pe(e.range)).join(nt.COMMA);
2184
2184
  }
2185
- function Do(t) {
2186
- const [e, n] = k(null), {
2185
+ function $o(t) {
2186
+ const [e, n] = $(null), {
2187
2187
  onVerify: o,
2188
2188
  selectorRef: r,
2189
2189
  unitId: s,
2190
2190
  subUnitId: i,
2191
2191
  maxRangeCount: c,
2192
- supportAcrossSheet: a,
2192
+ supportAcrossSheet: l,
2193
2193
  autoFocus: h,
2194
- onChange: u,
2194
+ onChange: f,
2195
2195
  onRangeSelectorDialogVisibleChange: m,
2196
- onClickOutside: l,
2196
+ onClickOutside: u,
2197
2197
  onFocusChange: d,
2198
- forceShowDialogWhenSelectionChanged: f,
2199
- hideEditor: R,
2198
+ forceShowDialogWhenSelectionChanged: a,
2199
+ hideEditor: I,
2200
2200
  resetRange: g
2201
- } = t, [p, S] = k(h != null ? h : !1), [C, v] = k(!1), [I, T] = k([]), w = O(qe), A = O(be), { sequenceNodes: M } = zi(e, p, s, i), _ = je(M), N = O(ae), P = ee(() => {
2201
+ } = t, [p, C] = $(h != null ? h : !1), [S, v] = $(!1), [_, T] = $([]), w = O(je), A = O(be), { sequenceNodes: M } = Xi(e, p, s, i), R = Ke(M), y = O(ae), P = ee(() => {
2202
2202
  e == null || e.setSelectionRanges([]), e == null || e.blur(), A.blur();
2203
- }), y = ee(() => {
2203
+ }), N = ee(() => {
2204
2204
  var E;
2205
- P(), T(nc((E = e == null ? void 0 : e.getDocumentDataModel().getPlainText()) != null ? E : "")), v(!0);
2205
+ P(), T(sc((E = e == null ? void 0 : e.getDocumentDataModel().getPlainText()) != null ? E : "")), v(!0);
2206
2206
  });
2207
2207
  return L(() => {
2208
2208
  r && (r.current = {
@@ -2213,7 +2213,7 @@ function Do(t) {
2213
2213
  A.focus(e.getEditorId());
2214
2214
  },
2215
2215
  blur: P,
2216
- verify: () => Vn(_.current),
2216
+ verify: () => qn(R.current),
2217
2217
  showDialog: (E) => {
2218
2218
  P(), T(E), v(!0);
2219
2219
  },
@@ -2225,63 +2225,63 @@ function Do(t) {
2225
2225
  return (E = e == null ? void 0 : e.getDocumentDataModel().getPlainText()) != null ? E : "";
2226
2226
  }
2227
2227
  });
2228
- }, [P, e, A, r, _]), L(() => {
2228
+ }, [P, e, A, r, R]), L(() => {
2229
2229
  var E;
2230
- o == null || o(Vn(M), (E = e == null ? void 0 : e.getDocumentDataModel().getPlainText()) != null ? E : "");
2230
+ o == null || o(qn(M), (E = e == null ? void 0 : e.getDocumentDataModel().getPlainText()) != null ? E : "");
2231
2231
  }, [M]), L(() => {
2232
- m == null || m(C);
2233
- }, [C]), L(() => {
2234
- if (C && g)
2232
+ m == null || m(S);
2233
+ }, [S]), L(() => {
2234
+ if (S && g)
2235
2235
  return () => {
2236
2236
  const E = {
2237
2237
  unitId: s,
2238
2238
  subUnitId: i,
2239
2239
  selections: g
2240
2240
  };
2241
- N.executeCommand(cn.id, E);
2241
+ y.executeCommand(an.id, E);
2242
2242
  };
2243
- }, [C]), /* @__PURE__ */ $(ut, { children: [
2244
- R ? null : /* @__PURE__ */ b(
2245
- Qr,
2243
+ }, [S]), /* @__PURE__ */ k(ut, { children: [
2244
+ I ? null : /* @__PURE__ */ b(
2245
+ ts,
2246
2246
  {
2247
2247
  isSingle: !0,
2248
2248
  ...t,
2249
2249
  onFocusChange: (E, F) => {
2250
- S(E), d == null || d(E, F);
2250
+ C(E), d == null || d(E, F);
2251
2251
  },
2252
2252
  editorRef: n,
2253
2253
  onClickOutside: () => {
2254
- S(!1), P(), l == null || l();
2254
+ C(!1), P(), u == null || u();
2255
2255
  },
2256
- icon: /* @__PURE__ */ b(Cs, { title: w.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ b(Ao, { className: Nt.sheetRangeSelectorIcon, onClick: y }) })
2256
+ icon: /* @__PURE__ */ b(Rs, { title: w.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ b(xo, { className: Tt.sheetRangeSelectorIcon, onClick: N }) })
2257
2257
  }
2258
2258
  ),
2259
2259
  /* @__PURE__ */ b(
2260
- tc,
2260
+ rc,
2261
2261
  {
2262
- initialValue: I,
2262
+ initialValue: _,
2263
2263
  unitId: s,
2264
2264
  subUnitId: i,
2265
- visible: C,
2265
+ visible: S,
2266
2266
  maxRangeCount: c,
2267
2267
  onConfirm: (E) => {
2268
- const F = oc(E), x = tr.newEmptyData();
2269
- x.body.dataStream = F, e == null || e.replaceText(F, !1), u == null || u(x, F), v(!1), T([]), requestAnimationFrame(() => {
2268
+ const F = ic(E), x = rr.newEmptyData();
2269
+ x.body.dataStream = F, e == null || e.replaceText(F, !1), f == null || f(x, F), v(!1), T([]), requestAnimationFrame(() => {
2270
2270
  P();
2271
2271
  });
2272
2272
  },
2273
2273
  onClose: () => {
2274
2274
  v(!1), T([]);
2275
2275
  },
2276
- supportAcrossSheet: a,
2277
- onShowBySelection: (E) => p || f ? (T(E), v(!0), !1) : !0
2276
+ supportAcrossSheet: l,
2277
+ onShowBySelection: (E) => p || a ? (T(E), v(!0), !1) : !0
2278
2278
  }
2279
2279
  )
2280
2280
  ] });
2281
2281
  }
2282
- class Lo {
2282
+ class ko {
2283
2283
  constructor() {
2284
- B(this, "_currentSelector$", new ro(null));
2284
+ B(this, "_currentSelector$", new io(null));
2285
2285
  B(this, "currentSelector$", this._currentSelector$.asObservable());
2286
2286
  }
2287
2287
  showRangeSelectorDialog(e) {
@@ -2293,19 +2293,19 @@ class Lo {
2293
2293
  return this._currentSelector$.next(e), o;
2294
2294
  }
2295
2295
  }
2296
- const rc = "sheets-formula-ui.base.config", Bn = {};
2297
- function sc(t) {
2298
- return t.getContextValue(nr) && t.getContextValue(or);
2296
+ const cc = "sheets-formula-ui.base.config", jn = {};
2297
+ function lc(t) {
2298
+ return t.getContextValue(sr) && t.getContextValue(ir);
2299
2299
  }
2300
- function ko(t, e = !1) {
2301
- return !e && !(Re(t == null ? void 0 : t.f) || Ve(t == null ? void 0 : t.si)) ? null : typeof (t == null ? void 0 : t.v) == "string" && Lr.has(t.v) ? t.v : null;
2300
+ function Ho(t, e = !1) {
2301
+ return !e && !(Re(t == null ? void 0 : t.f) || Be(t == null ? void 0 : t.si)) ? null : typeof (t == null ? void 0 : t.v) == "string" && Hr.has(t.v) ? t.v : null;
2302
2302
  }
2303
- var ic = Object.getOwnPropertyDescriptor, cc = (t, e, n, o) => {
2304
- for (var r = o > 1 ? void 0 : o ? ic(e, n) : e, s = t.length - 1, i; s >= 0; s--)
2303
+ var ac = Object.getOwnPropertyDescriptor, uc = (t, e, n, o) => {
2304
+ for (var r = o > 1 ? void 0 : o ? ac(e, n) : e, s = t.length - 1, i; s >= 0; s--)
2305
2305
  (i = t[s]) && (r = i(r) || r);
2306
2306
  return r;
2307
2307
  }, it = (t, e) => (n, o) => e(n, o, t);
2308
- const Kt = "SHEET_FORMULA_ALERT", lc = {
2308
+ const zt = "SHEET_FORMULA_ALERT", fc = {
2309
2309
  [se.DIV_BY_ZERO]: "divByZero",
2310
2310
  [se.NAME]: "name",
2311
2311
  [se.VALUE]: "value",
@@ -2319,7 +2319,7 @@ const Kt = "SHEET_FORMULA_ALERT", lc = {
2319
2319
  [se.CONNECT]: "connect",
2320
2320
  [se.NULL]: "null"
2321
2321
  };
2322
- let en = class extends pt {
2322
+ let nn = class extends pt {
2323
2323
  constructor(t, e, n, o, r, s) {
2324
2324
  super(), this._context = t, this._hoverManagerService = e, this._cellAlertManagerService = n, this._localeService = o, this._formulaDataModel = r, this._zenZoneService = s, this._init();
2325
2325
  }
@@ -2327,29 +2327,29 @@ let en = class extends pt {
2327
2327
  this._initCellAlertPopup(), this._initZenService();
2328
2328
  }
2329
2329
  _initCellAlertPopup() {
2330
- this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(rn(100)).subscribe((t) => {
2330
+ this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(cn(100)).subscribe((t) => {
2331
2331
  var e, n, o, r, s;
2332
2332
  if (t) {
2333
2333
  const c = this._context.unit.getActiveSheet();
2334
2334
  if (!c) return;
2335
- const a = c.getCell(t.location.row, t.location.col), h = (r = (o = (n = (e = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : e[t.location.unitId]) == null ? void 0 : n[t.location.subUnitId]) == null ? void 0 : o[t.location.row]) == null ? void 0 : r[t.location.col];
2336
- if (rr(a)) {
2337
- const u = ko(a, !!h);
2338
- if (!u) {
2335
+ const l = c.getCell(t.location.row, t.location.col), h = (r = (o = (n = (e = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : e[t.location.unitId]) == null ? void 0 : n[t.location.subUnitId]) == null ? void 0 : o[t.location.row]) == null ? void 0 : r[t.location.col];
2336
+ if (cr(l)) {
2337
+ const f = Ho(l, !!h);
2338
+ if (!f) {
2339
2339
  this._hideAlert();
2340
2340
  return;
2341
2341
  }
2342
- const m = this._cellAlertManagerService.currentAlert.get(Kt), l = (s = m == null ? void 0 : m.alert) == null ? void 0 : s.location;
2343
- if (l && l.row === t.location.row && l.col === t.location.col && l.subUnitId === t.location.subUnitId && l.unitId === t.location.unitId)
2342
+ const m = this._cellAlertManagerService.currentAlert.get(zt), u = (s = m == null ? void 0 : m.alert) == null ? void 0 : s.location;
2343
+ if (u && u.row === t.location.row && u.col === t.location.col && u.subUnitId === t.location.subUnitId && u.unitId === t.location.unitId)
2344
2344
  return;
2345
2345
  this._cellAlertManagerService.showAlert({
2346
- type: Ir.ERROR,
2346
+ type: yr.ERROR,
2347
2347
  title: this._localeService.t("formula.error.title"),
2348
- message: this._localeService.t(`formula.error.${lc[u]}`),
2348
+ message: this._localeService.t(`formula.error.${fc[f]}`),
2349
2349
  location: t.location,
2350
2350
  width: 200,
2351
2351
  height: 74,
2352
- key: Kt
2352
+ key: zt
2353
2353
  });
2354
2354
  return;
2355
2355
  }
@@ -2363,92 +2363,93 @@ let en = class extends pt {
2363
2363
  }));
2364
2364
  }
2365
2365
  _hideAlert() {
2366
- this._cellAlertManagerService.removeAlert(Kt);
2366
+ this._cellAlertManagerService.removeAlert(zt);
2367
2367
  }
2368
2368
  };
2369
- en = cc([
2370
- it(1, K(_r)),
2371
- it(2, K(Rr)),
2372
- it(3, K(qe)),
2373
- it(4, K(Dt)),
2374
- it(5, fs)
2375
- ], en);
2376
- var ac = Object.getOwnPropertyDescriptor, uc = (t, e, n, o) => {
2377
- for (var r = o > 1 ? void 0 : o ? ac(e, n) : e, s = t.length - 1, i; s >= 0; s--)
2369
+ nn = uc([
2370
+ it(1, K(Er)),
2371
+ it(2, K(br)),
2372
+ it(3, K(je)),
2373
+ it(4, K($t)),
2374
+ it(5, ms)
2375
+ ], nn);
2376
+ var hc = Object.getOwnPropertyDescriptor, dc = (t, e, n, o) => {
2377
+ for (var r = o > 1 ? void 0 : o ? hc(e, n) : e, s = t.length - 1, i; s >= 0; s--)
2378
2378
  (i = t[s]) && (r = i(r) || r);
2379
2379
  return r;
2380
- }, qn = (t, e) => (n, o) => e(n, o, t);
2381
- let Ft = class extends pt {
2380
+ }, Kn = (t, e) => (n, o) => e(n, o, t);
2381
+ let Mt = class extends pt {
2382
2382
  constructor(t, e) {
2383
2383
  super(), this._autoFillService = t, this._lexerTreeBuilder = e, this._registerAutoFill();
2384
2384
  }
2385
2385
  _registerAutoFill() {
2386
2386
  const t = {
2387
- type: Fn.FORMULA,
2387
+ type: Mn.FORMULA,
2388
2388
  priority: 1001,
2389
- match: (e) => Re(e == null ? void 0 : e.f) || Ve(e == null ? void 0 : e.si),
2390
- isContinue: (e, n) => e.type === Fn.FORMULA,
2389
+ match: (e) => Re(e == null ? void 0 : e.f) || Be(e == null ? void 0 : e.si),
2390
+ isContinue: (e, n) => e.type === Mn.FORMULA,
2391
2391
  applyFunctions: {
2392
- [br.COPY]: (e, n, o, r) => {
2393
- const { data: s, index: i } = e;
2394
- return this._fillCopyFormula(s, n, o, i, r);
2392
+ [Tr.COPY]: (e, n, o, r, s) => {
2393
+ const { data: i, index: c } = e;
2394
+ return this._fillCopyFormula(i, n, o, c, r, s);
2395
2395
  }
2396
2396
  }
2397
2397
  };
2398
2398
  this._autoFillService.registerRule(t);
2399
2399
  }
2400
- _fillCopyFormula(t, e, n, o, r) {
2401
- var a, h;
2402
- const s = hc(r), i = [], c = /* @__PURE__ */ new Map();
2403
- for (let u = 1; u <= e; u++) {
2404
- const m = (u - 1) % t.length, l = ft.deepClone(t[m]);
2405
- if (l) {
2406
- const d = ((a = t[m]) == null ? void 0 : a.f) || "", f = ((h = t[m]) == null ? void 0 : h.si) || "", R = Re(d);
2407
- if (Ve(f))
2408
- l.si = f, l.f = null, l.v = null, l.p = null, l.t = null, i.push(l);
2409
- else if (R) {
2410
- let p = c.get(m);
2411
- if (p)
2412
- l.si = p, l.f = null, l.v = null, l.p = null, l.t = null;
2400
+ _fillCopyFormula(t, e, n, o, r, s) {
2401
+ var h, f;
2402
+ const i = gc(r), c = [], l = /* @__PURE__ */ new Map();
2403
+ for (let m = 1; m <= e; m++) {
2404
+ const u = (m - 1) % t.length, d = o[u], a = ft.deepClone(t[u]);
2405
+ if (a) {
2406
+ const I = ((h = t[u]) == null ? void 0 : h.f) || "", g = ((f = t[u]) == null ? void 0 : f.si) || "", p = Re(I);
2407
+ if (Be(g))
2408
+ a.si = g, a.f = null, a.v = null, a.p = null, a.t = null, c.push(a);
2409
+ else if (p) {
2410
+ let S = l.get(u);
2411
+ if (S)
2412
+ a.si = S, a.f = null, a.v = null, a.p = null, a.t = null;
2413
2413
  else {
2414
- p = ft.generateRandomId(6), c.set(m, p);
2415
- const { offsetX: S, offsetY: C } = fc(s, e, n), v = this._lexerTreeBuilder.moveFormulaRefOffset(
2416
- d,
2417
- S,
2418
- C
2414
+ S = ft.generateRandomId(6), l.set(u, S);
2415
+ const { offsetX: v, offsetY: _ } = mc(i, e, n, s, d), T = this._lexerTreeBuilder.moveFormulaRefOffset(
2416
+ I,
2417
+ v,
2418
+ _
2419
2419
  );
2420
- l.si = p, l.f = v, l.v = null, l.p = null, l.t = null;
2420
+ a.si = S, a.f = T, a.v = null, a.p = null, a.t = null;
2421
2421
  }
2422
- i.push(l);
2422
+ c.push(a);
2423
2423
  }
2424
2424
  }
2425
2425
  }
2426
- return i;
2426
+ return c;
2427
2427
  }
2428
2428
  };
2429
- Ft = uc([
2430
- qn(0, Er),
2431
- qn(1, K(Ee))
2432
- ], Ft);
2433
- function fc(t, e, n) {
2434
- let o = 0, r = 0;
2429
+ Mt = dc([
2430
+ Kn(0, Nr),
2431
+ Kn(1, K(Ee))
2432
+ ], Mt);
2433
+ function mc(t, e, n, o, r) {
2434
+ const { source: s, target: i } = o, { rows: c } = i, { rows: l } = s;
2435
+ let h = 0, f = 0;
2435
2436
  switch (n) {
2436
2437
  case ne.UP:
2437
- r = -t * e;
2438
+ f = c[r] - l[r];
2438
2439
  break;
2439
2440
  case ne.RIGHT:
2440
- o = t;
2441
+ h = t;
2441
2442
  break;
2442
2443
  case ne.DOWN:
2443
- r = t;
2444
+ f = c[r] - l[r];
2444
2445
  break;
2445
2446
  case ne.LEFT:
2446
- o = -t * e;
2447
+ h = -t * e;
2447
2448
  break;
2448
2449
  }
2449
- return { offsetX: o, offsetY: r };
2450
+ return { offsetX: h, offsetY: f };
2450
2451
  }
2451
- function hc(t) {
2452
+ function gc(t) {
2452
2453
  let e = 0;
2453
2454
  for (const n in t)
2454
2455
  t[n].forEach((o) => {
@@ -2456,13 +2457,13 @@ function hc(t) {
2456
2457
  });
2457
2458
  return e;
2458
2459
  }
2459
- var dc = Object.getOwnPropertyDescriptor, mc = (t, e, n, o) => {
2460
- for (var r = o > 1 ? void 0 : o ? dc(e, n) : e, s = t.length - 1, i; s >= 0; s--)
2460
+ var pc = Object.getOwnPropertyDescriptor, Sc = (t, e, n, o) => {
2461
+ for (var r = o > 1 ? void 0 : o ? pc(e, n) : e, s = t.length - 1, i; s >= 0; s--)
2461
2462
  (i = t[s]) && (r = i(r) || r);
2462
2463
  return r;
2463
2464
  }, ct = (t, e) => (n, o) => e(n, o, t);
2464
- const gc = "default-paste-formula";
2465
- let Ot = class extends pt {
2465
+ const Cc = "default-paste-formula";
2466
+ let At = class extends pt {
2466
2467
  constructor(t, e, n, o, r) {
2467
2468
  super(), this._currentUniverSheet = t, this._lexerTreeBuilder = e, this._sheetClipboardService = n, this._injector = o, this._formulaDataModel = r, this._initialize();
2468
2469
  }
@@ -2474,7 +2475,7 @@ let Ot = class extends pt {
2474
2475
  }
2475
2476
  _pasteFormulaHook() {
2476
2477
  return {
2477
- id: Qe.SPECIAL_PASTE_FORMULA,
2478
+ id: Je.SPECIAL_PASTE_FORMULA,
2478
2479
  priority: 10,
2479
2480
  specialPasteInfo: { label: "specialPaste.formula" },
2480
2481
  onPasteCells: (t, e, n, o) => this._onPasteCells(t, e, n, o, !0)
@@ -2482,37 +2483,37 @@ let Ot = class extends pt {
2482
2483
  }
2483
2484
  _pasteWithFormulaHook() {
2484
2485
  return {
2485
- id: gc,
2486
+ id: Cc,
2486
2487
  priority: 10,
2487
2488
  onPasteCells: (t, e, n, o) => this._onPasteCells(t, e, n, o, !1)
2488
2489
  };
2489
2490
  }
2490
2491
  _onPasteCells(t, e, n, o, r) {
2491
- var l;
2492
+ var u;
2492
2493
  if ([
2493
- Qe.SPECIAL_PASTE_FORMAT,
2494
- Qe.SPECIAL_PASTE_COL_WIDTH
2494
+ Je.SPECIAL_PASTE_FORMAT,
2495
+ Je.SPECIAL_PASTE_COL_WIDTH
2495
2496
  ].includes(o.pasteType))
2496
2497
  return {
2497
2498
  undos: [],
2498
2499
  redos: []
2499
2500
  };
2500
- const i = this._currentUniverSheet.getCurrentUnitForType(ue.UNIVER_SHEET), c = e.unitId || i.getUnitId(), a = e.subUnitId || ((l = i.getActiveSheet()) == null ? void 0 : l.getSheetId());
2501
- if (!c || !a)
2501
+ const i = this._currentUniverSheet.getCurrentUnitForType(ue.UNIVER_SHEET), c = e.unitId || i.getUnitId(), l = e.subUnitId || ((u = i.getActiveSheet()) == null ? void 0 : u.getSheetId());
2502
+ if (!c || !l)
2502
2503
  return {
2503
2504
  undos: [],
2504
2505
  redos: []
2505
2506
  };
2506
- const h = e.range, u = n, m = {
2507
- copyType: o.copyType || to.COPY,
2507
+ const h = e.range, f = n, m = {
2508
+ copyType: o.copyType || oo.COPY,
2508
2509
  copyRange: t == null ? void 0 : t.range,
2509
2510
  pasteType: o.pasteType
2510
2511
  };
2511
- return this._injector.invoke((d) => pc(
2512
+ return this._injector.invoke((d) => vc(
2512
2513
  c,
2513
- a,
2514
+ l,
2514
2515
  h,
2515
- u,
2516
+ f,
2516
2517
  d,
2517
2518
  m,
2518
2519
  this._lexerTreeBuilder,
@@ -2522,16 +2523,16 @@ let Ot = class extends pt {
2522
2523
  ));
2523
2524
  }
2524
2525
  };
2525
- Ot = mc([
2526
+ At = Sc([
2526
2527
  ct(0, oe),
2527
2528
  ct(1, K(Ee)),
2528
- ct(2, Nr),
2529
+ ct(2, Fr),
2529
2530
  ct(3, K(mt)),
2530
- ct(4, K(Dt))
2531
- ], Ot);
2532
- function pc(t, e, n, o, r, s, i, c, a = !1, h) {
2533
- const u = [], m = [], l = Sc(t, e, n, o, s, i, c, h);
2534
- if (!l.hasValue())
2531
+ ct(4, K($t))
2532
+ ], At);
2533
+ function vc(t, e, n, o, r, s, i, c, l = !1, h) {
2534
+ const f = [], m = [], u = _c(t, e, n, o, s, i, c, h);
2535
+ if (!u.hasValue())
2535
2536
  return {
2536
2537
  undos: [],
2537
2538
  redos: []
@@ -2539,175 +2540,175 @@ function pc(t, e, n, o, r, s, i, c, a = !1, h) {
2539
2540
  const d = {
2540
2541
  unitId: t,
2541
2542
  subUnitId: e,
2542
- cellValue: l.getData()
2543
+ cellValue: u.getData()
2543
2544
  };
2544
- u.push({
2545
- id: Dn.id,
2545
+ f.push({
2546
+ id: $n.id,
2546
2547
  params: d
2547
2548
  });
2548
- const f = ns(
2549
+ const a = ss(
2549
2550
  r,
2550
2551
  d
2551
2552
  );
2552
2553
  return m.push({
2553
- id: Dn.id,
2554
- params: f
2554
+ id: $n.id,
2555
+ params: a
2555
2556
  }), {
2556
2557
  undos: m,
2557
- redos: u
2558
+ redos: f
2558
2559
  };
2559
2560
  }
2560
- function Sc(t, e, n, o, r, s, i, c) {
2561
- return c ? r.pasteType === Qe.SPECIAL_PASTE_VALUE ? vc(t, e, n, o, i, c) : r.pasteType === Qe.SPECIAL_PASTE_FORMULA ? _c(t, e, n, o, s, i, c) : Rc(t, e, n, o, r.copyType, s, i, c) : Cc(t, e, n, o, i);
2561
+ function _c(t, e, n, o, r, s, i, c) {
2562
+ return c ? r.pasteType === Je.SPECIAL_PASTE_VALUE ? Ic(t, e, n, o, i, c) : r.pasteType === Je.SPECIAL_PASTE_FORMULA ? Ec(t, e, n, o, s, i, c) : bc(t, e, n, o, r.copyType, s, i, c) : Rc(t, e, n, o, i);
2562
2563
  }
2563
- function Cc(t, e, n, o, r) {
2564
- const s = new et(), i = r.getSheetFormulaData(t, e);
2565
- return o.forValue((c, a, h) => {
2564
+ function Rc(t, e, n, o, r) {
2565
+ const s = new tt(), i = r.getSheetFormulaData(t, e);
2566
+ return o.forValue((c, l, h) => {
2566
2567
  var d;
2567
- const u = n.rows[c], m = n.cols[a], l = {};
2568
- Re(h.v) ? (l.v = null, l.f = `${h.v}`, l.si = null, l.p = null, s.setValue(u, m, l)) : (d = i == null ? void 0 : i[u]) != null && d[m] && (l.v = h.v, l.f = null, l.si = null, l.p = null, s.setValue(u, m, l));
2568
+ const f = n.rows[c], m = n.cols[l], u = {};
2569
+ Re(h.v) ? (u.v = null, u.f = `${h.v}`, u.si = null, u.p = null, s.setValue(f, m, u)) : (d = i == null ? void 0 : i[f]) != null && d[m] && (u.v = h.v, u.f = null, u.si = null, u.p = null, s.setValue(f, m, u));
2569
2570
  }), s;
2570
2571
  }
2571
- function vc(t, e, n, o, r, s) {
2572
- var h, u;
2573
- const i = new et(), c = (u = (h = r.getArrayFormulaCellData()) == null ? void 0 : h[s.unitId]) == null ? void 0 : u[s.subUnitId], a = r.getSheetFormulaData(t, e);
2574
- return o.forValue((m, l, d) => {
2575
- var C, v;
2576
- const f = s.range.rows[m % s.range.rows.length], R = s.range.cols[l % s.range.cols.length], g = n.rows[m], p = n.cols[l], S = {};
2577
- if (Re(d.f) || Ve(d.si))
2578
- S.v = d.v, S.f = null, S.si = null, S.p = null, i.setValue(g, p, S);
2579
- else if ((C = c == null ? void 0 : c[f]) != null && C[R]) {
2580
- const I = c[f][R];
2581
- S.v = I.v, S.f = null, S.si = null, S.p = null, i.setValue(g, p, S);
2582
- } else if ((v = a == null ? void 0 : a[g]) != null && v[p]) {
2583
- if (S.v = d.v, S.f = null, S.si = null, S.p = null, d.p) {
2584
- const I = $o(d);
2585
- I && (S.v = I);
2572
+ function Ic(t, e, n, o, r, s) {
2573
+ var h, f;
2574
+ const i = new tt(), c = (f = (h = r.getArrayFormulaCellData()) == null ? void 0 : h[s.unitId]) == null ? void 0 : f[s.subUnitId], l = r.getSheetFormulaData(t, e);
2575
+ return o.forValue((m, u, d) => {
2576
+ var S, v;
2577
+ const a = s.range.rows[m % s.range.rows.length], I = s.range.cols[u % s.range.cols.length], g = n.rows[m], p = n.cols[u], C = {};
2578
+ if (Re(d.f) || Be(d.si))
2579
+ C.v = d.v, C.f = null, C.si = null, C.p = null, i.setValue(g, p, C);
2580
+ else if ((S = c == null ? void 0 : c[a]) != null && S[I]) {
2581
+ const _ = c[a][I];
2582
+ C.v = _.v, C.f = null, C.si = null, C.p = null, i.setValue(g, p, C);
2583
+ } else if ((v = l == null ? void 0 : l[g]) != null && v[p]) {
2584
+ if (C.v = d.v, C.f = null, C.si = null, C.p = null, d.p) {
2585
+ const _ = Wo(d);
2586
+ _ && (C.v = _);
2586
2587
  }
2587
- i.setValue(g, p, S);
2588
+ i.setValue(g, p, C);
2588
2589
  }
2589
2590
  }), i;
2590
2591
  }
2591
- function _c(t, e, n, o, r, s, i) {
2592
- const c = new et(), a = /* @__PURE__ */ new Map();
2593
- return o.forValue((h, u, m) => {
2594
- const l = n.rows[h], d = n.cols[u], f = {};
2595
- if (Ve(m.si)) {
2592
+ function Ec(t, e, n, o, r, s, i) {
2593
+ const c = new tt(), l = /* @__PURE__ */ new Map();
2594
+ return o.forValue((h, f, m) => {
2595
+ const u = n.rows[h], d = n.cols[f], a = {};
2596
+ if (Be(m.si)) {
2596
2597
  if (i.unitId !== t || i.subUnitId !== e) {
2597
- const R = s.getFormulaStringByCell(
2598
+ const I = s.getFormulaStringByCell(
2598
2599
  i.range.rows[h % i.range.rows.length],
2599
- i.range.cols[u % i.range.cols.length],
2600
+ i.range.cols[f % i.range.cols.length],
2600
2601
  i.subUnitId,
2601
2602
  i.unitId
2602
- ), g = n.cols[u] - i.range.cols[u % i.range.cols.length], p = n.rows[h] - i.range.rows[h % i.range.rows.length], S = r.moveFormulaRefOffset(R || "", g, p);
2603
- f.si = null, f.f = S;
2603
+ ), g = n.cols[f] - i.range.cols[f % i.range.cols.length], p = n.rows[h] - i.range.rows[h % i.range.rows.length], C = r.moveFormulaRefOffset(I || "", g, p);
2604
+ a.si = null, a.f = C;
2604
2605
  } else
2605
- f.si = m.si, f.f = null;
2606
- f.v = null, f.p = null, c.setValue(l, d, f);
2606
+ a.si = m.si, a.f = null;
2607
+ a.v = null, a.p = null, c.setValue(u, d, a);
2607
2608
  } else if (Re(m.f)) {
2608
- const R = `${h % i.range.rows.length}_${u % i.range.cols.length}`;
2609
- let g = a.get(R);
2609
+ const I = `${h % i.range.rows.length}_${f % i.range.cols.length}`;
2610
+ let g = l.get(I);
2610
2611
  if (g)
2611
- f.si = g, f.f = null;
2612
+ a.si = g, a.f = null;
2612
2613
  else {
2613
- g = ft.generateRandomId(6), a.set(R, g);
2614
- const p = n.cols[u] - i.range.cols[u % i.range.cols.length], S = n.rows[h] - i.range.rows[h % i.range.rows.length], C = r.moveFormulaRefOffset(m.f || "", p, S);
2615
- f.si = g, f.f = C;
2614
+ g = ft.generateRandomId(6), l.set(I, g);
2615
+ const p = n.cols[f] - i.range.cols[f % i.range.cols.length], C = n.rows[h] - i.range.rows[h % i.range.rows.length], S = r.moveFormulaRefOffset(m.f || "", p, C);
2616
+ a.si = g, a.f = S;
2616
2617
  }
2617
- f.v = null, f.p = null, c.setValue(l, d, f);
2618
+ a.v = null, a.p = null, c.setValue(u, d, a);
2618
2619
  } else {
2619
- if (f.v = m.v, f.f = null, f.si = null, f.p = null, m.p) {
2620
- const R = $o(m);
2621
- R && (f.v = R);
2620
+ if (a.v = m.v, a.f = null, a.si = null, a.p = null, m.p) {
2621
+ const I = Wo(m);
2622
+ I && (a.v = I);
2622
2623
  }
2623
- c.setValue(l, d, f);
2624
+ c.setValue(u, d, a);
2624
2625
  }
2625
2626
  }), c;
2626
2627
  }
2627
- function Rc(t, e, n, o, r, s, i, c) {
2628
- const a = new et(), h = /* @__PURE__ */ new Map(), u = i.getSheetFormulaData(t, e), m = [];
2629
- return r === to.CUT ? o.forValue((l, d, f) => {
2630
- const R = n.rows[l], g = n.cols[d], p = {};
2631
- if (Ve(f.si)) {
2632
- if (Re(f.f))
2633
- m.push(f.si), p.f = f.f, p.si = f.si;
2634
- else if (m.includes(f.si))
2635
- p.f = null, p.si = f.si;
2628
+ function bc(t, e, n, o, r, s, i, c) {
2629
+ const l = new tt(), h = /* @__PURE__ */ new Map(), f = i.getSheetFormulaData(t, e), m = [];
2630
+ return r === oo.CUT ? o.forValue((u, d, a) => {
2631
+ const I = n.rows[u], g = n.cols[d], p = {};
2632
+ if (Be(a.si)) {
2633
+ if (Re(a.f))
2634
+ m.push(a.si), p.f = a.f, p.si = a.si;
2635
+ else if (m.includes(a.si))
2636
+ p.f = null, p.si = a.si;
2636
2637
  else {
2637
- const S = i.getFormulaStringByCell(
2638
- c.range.rows[l % c.range.rows.length],
2638
+ const C = i.getFormulaStringByCell(
2639
+ c.range.rows[u % c.range.rows.length],
2639
2640
  c.range.cols[d % c.range.cols.length],
2640
2641
  c.subUnitId,
2641
2642
  c.unitId
2642
2643
  );
2643
- p.f = S, p.si = null;
2644
+ p.f = C, p.si = null;
2644
2645
  }
2645
- p.v = null, p.p = null, a.setValue(R, g, p);
2646
- } else Re(f.f) && (p.f = f.f, p.si = null, p.v = null, p.p = null, a.setValue(R, g, p));
2647
- }) : o.forValue((l, d, f) => {
2648
- var S;
2649
- const R = n.rows[l], g = n.cols[d], p = {};
2650
- if (Ve(f.si)) {
2646
+ p.v = null, p.p = null, l.setValue(I, g, p);
2647
+ } else Re(a.f) && (p.f = a.f, p.si = null, p.v = null, p.p = null, l.setValue(I, g, p));
2648
+ }) : o.forValue((u, d, a) => {
2649
+ var C;
2650
+ const I = n.rows[u], g = n.cols[d], p = {};
2651
+ if (Be(a.si)) {
2651
2652
  if (c.unitId !== t || c.subUnitId !== e) {
2652
- const C = i.getFormulaStringByCell(
2653
- c.range.rows[l % c.range.rows.length],
2653
+ const S = i.getFormulaStringByCell(
2654
+ c.range.rows[u % c.range.rows.length],
2654
2655
  c.range.cols[d % c.range.cols.length],
2655
2656
  c.subUnitId,
2656
2657
  c.unitId
2657
- ), v = n.cols[d] - c.range.cols[d % c.range.cols.length], I = n.rows[l] - c.range.rows[l % c.range.rows.length], T = s.moveFormulaRefOffset(C || "", v, I);
2658
+ ), v = n.cols[d] - c.range.cols[d % c.range.cols.length], _ = n.rows[u] - c.range.rows[u % c.range.rows.length], T = s.moveFormulaRefOffset(S || "", v, _);
2658
2659
  p.si = null, p.f = T;
2659
2660
  } else
2660
- p.si = f.si, p.f = null;
2661
- p.v = null, p.p = null, a.setValue(R, g, p);
2662
- } else if (Re(f.f)) {
2663
- const C = `${l % c.range.rows.length}_${d % c.range.cols.length}`;
2664
- let v = h.get(C);
2661
+ p.si = a.si, p.f = null;
2662
+ p.v = null, p.p = null, l.setValue(I, g, p);
2663
+ } else if (Re(a.f)) {
2664
+ const S = `${u % c.range.rows.length}_${d % c.range.cols.length}`;
2665
+ let v = h.get(S);
2665
2666
  if (v)
2666
2667
  p.si = v, p.f = null;
2667
2668
  else {
2668
- v = ft.generateRandomId(6), h.set(C, v);
2669
- const I = n.cols[d] - c.range.cols[d % c.range.cols.length], T = n.rows[l] - c.range.rows[l % c.range.rows.length], w = s.moveFormulaRefOffset(f.f || "", I, T);
2669
+ v = ft.generateRandomId(6), h.set(S, v);
2670
+ const _ = n.cols[d] - c.range.cols[d % c.range.cols.length], T = n.rows[u] - c.range.rows[u % c.range.rows.length], w = s.moveFormulaRefOffset(a.f || "", _, T);
2670
2671
  p.si = v, p.f = w;
2671
2672
  }
2672
- p.v = null, p.p = null, a.setValue(R, g, p);
2673
- } else (S = u == null ? void 0 : u[R]) != null && S[g] && (p.v = f.v, p.f = null, p.si = null, p.p = f.p, a.setValue(R, g, p));
2674
- }), m.length > 0 && new et(u).forValue((l, d, f) => {
2675
- if (!(c.range.rows.includes(l) && c.range.cols.includes(d)) && !(n.rows.includes(l) && n.cols.includes(d)) && m.includes(f == null ? void 0 : f.si)) {
2676
- const R = i.getFormulaStringByCell(
2677
- l,
2673
+ p.v = null, p.p = null, l.setValue(I, g, p);
2674
+ } else (C = f == null ? void 0 : f[I]) != null && C[g] && (p.v = a.v, p.f = null, p.si = null, p.p = a.p, l.setValue(I, g, p));
2675
+ }), m.length > 0 && new tt(f).forValue((u, d, a) => {
2676
+ if (!(c.range.rows.includes(u) && c.range.cols.includes(d)) && !(n.rows.includes(u) && n.cols.includes(d)) && m.includes(a == null ? void 0 : a.si)) {
2677
+ const I = i.getFormulaStringByCell(
2678
+ u,
2678
2679
  d,
2679
2680
  c.subUnitId,
2680
2681
  c.unitId
2681
2682
  );
2682
- a.setValue(l, d, {
2683
- f: R,
2683
+ l.setValue(u, d, {
2684
+ f: I,
2684
2685
  si: null,
2685
2686
  v: null,
2686
2687
  p: null
2687
2688
  });
2688
2689
  }
2689
- }), a;
2690
+ }), l;
2690
2691
  }
2691
- function $o(t) {
2692
+ function Wo(t) {
2692
2693
  if (t != null && t.p) {
2693
2694
  const e = t == null ? void 0 : t.p.body;
2694
2695
  if (e == null)
2695
2696
  return;
2696
2697
  const n = e.dataStream;
2697
- return n.substring(n.length - 2, n.length) === Gn ? n.substring(0, n.length - 2) : n;
2698
+ return n.substring(n.length - 2, n.length) === Xn ? n.substring(0, n.length - 2) : n;
2698
2699
  }
2699
2700
  }
2700
- var Ic = Object.getOwnPropertyDescriptor, Ec = (t, e, n, o) => {
2701
- for (var r = o > 1 ? void 0 : o ? Ic(e, n) : e, s = t.length - 1, i; s >= 0; s--)
2701
+ var yc = Object.getOwnPropertyDescriptor, Nc = (t, e, n, o) => {
2702
+ for (var r = o > 1 ? void 0 : o ? yc(e, n) : e, s = t.length - 1, i; s >= 0; s--)
2702
2703
  (i = t[s]) && (r = i(r) || r);
2703
2704
  return r;
2704
- }, He = (t, e) => (n, o) => e(n, o, t);
2705
- let Mt = class extends pt {
2706
- constructor(e, n, o, r, s, i, c, a) {
2705
+ }, We = (t, e) => (n, o) => e(n, o, t);
2706
+ let Pt = class extends pt {
2707
+ constructor(e, n, o, r, s, i, c, l) {
2707
2708
  super();
2708
2709
  B(this, "_previousShape");
2709
2710
  B(this, "_skeleton");
2710
- this._context = e, this._sheetInterceptorService = n, this._formulaDataModel = o, this._themeService = r, this._renderManagerService = s, this._sheetSkeletonManagerService = i, this._commandService = c, this._logService = a, this._initSkeletonChangeListener(), this._initInterceptorEditorStart(), this._commandExecutedListener();
2711
+ this._context = e, this._sheetInterceptorService = n, this._formulaDataModel = o, this._themeService = r, this._renderManagerService = s, this._sheetSkeletonManagerService = i, this._commandService = c, this._logService = l, this._initSkeletonChangeListener(), this._initInterceptorEditorStart(), this._commandExecutedListener();
2711
2712
  }
2712
2713
  _initSkeletonChangeListener() {
2713
2714
  this.disposeWithMe(
@@ -2732,19 +2733,19 @@ let Mt = class extends pt {
2732
2733
  }
2733
2734
  _initInterceptorEditorStart() {
2734
2735
  this.disposeWithMe(
2735
- Zn(
2736
- this._sheetInterceptorService.writeCellInterceptor.intercept(os, {
2736
+ Qn(
2737
+ this._sheetInterceptorService.writeCellInterceptor.intercept(is, {
2737
2738
  handler: (e, n, o) => {
2738
- var f, R, g, p;
2739
- const { row: r, col: s, unitId: i, subUnitId: c, worksheet: a } = n, h = this._formulaDataModel.getArrayFormulaRange(), u = this._formulaDataModel.getArrayFormulaCellData();
2739
+ var a, I, g, p;
2740
+ const { row: r, col: s, unitId: i, subUnitId: c, worksheet: l } = n, h = this._formulaDataModel.getArrayFormulaRange(), f = this._formulaDataModel.getArrayFormulaCellData();
2740
2741
  if (this._removeArrayFormulaRangeShape(), e == null)
2741
2742
  return o(e);
2742
2743
  let m = null;
2743
- const l = this._formulaDataModel.getFormulaStringByCell(r, s, c, i);
2744
- if (l !== null && (m = { f: l }), e.v != null && e.v !== "" && ((g = (R = (f = u[i]) == null ? void 0 : f[c]) == null ? void 0 : R[r]) == null ? void 0 : g[s]) == null)
2744
+ const u = this._formulaDataModel.getFormulaStringByCell(r, s, c, i);
2745
+ if (u !== null && (m = { f: u }), e.v != null && e.v !== "" && ((g = (I = (a = f[i]) == null ? void 0 : a[c]) == null ? void 0 : I[r]) == null ? void 0 : g[s]) == null)
2745
2746
  return m ? { ...e, ...m } : o(e);
2746
2747
  const d = (p = h == null ? void 0 : h[i]) == null ? void 0 : p[c];
2747
- return d != null && (m = this._displayArrayFormulaRangeShape(d, r, s, i, c, a, m)), m ? { ...e, ...m } : o(e);
2748
+ return d != null && (m = this._displayArrayFormulaRangeShape(d, r, s, i, c, l, m)), m ? { ...e, ...m } : o(e);
2748
2749
  }
2749
2750
  })
2750
2751
  )
@@ -2752,10 +2753,10 @@ let Mt = class extends pt {
2752
2753
  }
2753
2754
  _commandExecutedListener() {
2754
2755
  this.disposeWithMe(this._commandService.onCommandExecuted((e, n) => {
2755
- (e.id === kr.id || e.id === $r.id && n && n.remove) && this._removeArrayFormulaRangeShape();
2756
+ (e.id === Wr.id || e.id === Ur.id && n && n.remove) && this._removeArrayFormulaRangeShape();
2756
2757
  })), this.disposeWithMe(
2757
2758
  this._commandService.beforeCommandExecuted((e) => {
2758
- rs.id === e.id && requestIdleCallback(() => {
2759
+ cs.id === e.id && requestIdleCallback(() => {
2759
2760
  const n = e.params, { unitId: o, subUnitId: r, rowsAutoHeightInfo: s } = n;
2760
2761
  this._refreshArrayFormulaRangeShapeByRow(o, r, s);
2761
2762
  });
@@ -2763,21 +2764,21 @@ let Mt = class extends pt {
2763
2764
  );
2764
2765
  }
2765
2766
  _displayArrayFormulaRangeShape(e, n, o, r, s, i, c) {
2766
- const a = this._formulaDataModel.getSheetFormulaData(r, s);
2767
- return new et(e).forValue((h, u, m) => {
2767
+ const l = this._formulaDataModel.getSheetFormulaData(r, s);
2768
+ return new tt(e).forValue((h, f, m) => {
2768
2769
  var g;
2769
2770
  if (m == null)
2770
2771
  return !0;
2771
- const { startRow: l, startColumn: d, endRow: f, endColumn: R } = m;
2772
- if (h === n && u === o)
2772
+ const { startRow: u, startColumn: d, endRow: a, endColumn: I } = m;
2773
+ if (h === n && f === o)
2773
2774
  return this._createArrayFormulaRangeShape(m, r), !1;
2774
- if (n >= l && n <= f && o >= d && o <= R) {
2775
- const p = i.getCell(l, d);
2775
+ if (n >= u && n <= a && o >= d && o <= I) {
2776
+ const p = i.getCell(u, d);
2776
2777
  if ((p == null ? void 0 : p.v) === se.SPILL)
2777
2778
  return;
2778
- const S = (g = a == null ? void 0 : a[h]) == null ? void 0 : g[u];
2779
- return S == null || S.f == null ? !0 : (c == null && (c = {
2780
- f: S.f,
2779
+ const C = (g = l == null ? void 0 : l[h]) == null ? void 0 : g[f];
2780
+ return C == null || C.f == null ? !0 : (c == null && (c = {
2781
+ f: C.f,
2781
2782
  isInArrayFormulaRange: !0
2782
2783
  }), this._createArrayFormulaRangeShape(m, r), !1);
2783
2784
  }
@@ -2794,15 +2795,15 @@ let Mt = class extends pt {
2794
2795
  style: {
2795
2796
  strokeWidth: 1,
2796
2797
  stroke: i.hyacinth700,
2797
- fill: new on(i.colorWhite).setAlpha(0).toString(),
2798
+ fill: new sn(i.colorWhite).setAlpha(0).toString(),
2798
2799
  widgets: {}
2799
2800
  }
2800
- }, a = Gt(c, r), { rowHeaderWidth: h, columnHeaderHeight: u } = r, m = new eo(s, yr.FORMULA_EDITOR_SHOW, this._themeService, {
2801
+ }, l = Xt(c, r), { rowHeaderWidth: h, columnHeaderHeight: f } = r, m = new no(s, Or.FORMULA_EDITOR_SHOW, this._themeService, {
2801
2802
  highlightHeader: !1,
2802
2803
  rowHeaderWidth: h,
2803
- columnHeaderHeight: u
2804
+ columnHeaderHeight: f
2804
2805
  });
2805
- m.updateRangeBySelectionWithCoord(a), m.setEvent(!1), this._previousShape = m;
2806
+ m.updateRangeBySelectionWithCoord(l), m.setEvent(!1), this._previousShape = m;
2806
2807
  }
2807
2808
  _removeArrayFormulaRangeShape() {
2808
2809
  this._previousShape != null && (this._previousShape.dispose(), this._previousShape = null);
@@ -2825,55 +2826,55 @@ let Mt = class extends pt {
2825
2826
  _refreshArrayFormulaRangeShapeByRow(e, n, o) {
2826
2827
  if (!this._checkCurrentSheet(e, n) || !this._previousShape) return;
2827
2828
  const { startRow: r, endRow: s, startColumn: i, endColumn: c } = this._previousShape.getRange();
2828
- for (let a = 0; a < o.length; a++) {
2829
- const { row: h } = o[a];
2829
+ for (let l = 0; l < o.length; l++) {
2830
+ const { row: h } = o[l];
2830
2831
  if (r >= h) {
2831
- const u = {
2832
+ const f = {
2832
2833
  startRow: r,
2833
2834
  endRow: s,
2834
2835
  startColumn: i,
2835
2836
  endColumn: c
2836
2837
  };
2837
- this._refreshArrayFormulaRangeShape(e, u);
2838
+ this._refreshArrayFormulaRangeShape(e, f);
2838
2839
  break;
2839
2840
  }
2840
2841
  }
2841
2842
  }
2842
2843
  };
2843
- Mt = Ec([
2844
- He(1, K(ao)),
2845
- He(2, K(Dt)),
2846
- He(3, K(gt)),
2847
- He(4, ye),
2848
- He(5, K(wt)),
2849
- He(6, ae),
2850
- He(7, sr)
2851
- ], Mt);
2852
- var bc = Object.getOwnPropertyDescriptor, Nc = (t, e, n, o) => {
2853
- for (var r = o > 1 ? void 0 : o ? bc(e, n) : e, s = t.length - 1, i; s >= 0; s--)
2844
+ Pt = Nc([
2845
+ We(1, K(fo)),
2846
+ We(2, K($t)),
2847
+ We(3, K(gt)),
2848
+ We(4, Ne),
2849
+ We(5, K(Lt)),
2850
+ We(6, ae),
2851
+ We(7, lr)
2852
+ ], Pt);
2853
+ var Tc = Object.getOwnPropertyDescriptor, Fc = (t, e, n, o) => {
2854
+ for (var r = o > 1 ? void 0 : o ? Tc(e, n) : e, s = t.length - 1, i; s >= 0; s--)
2854
2855
  (i = t[s]) && (r = i(r) || r);
2855
2856
  return r;
2856
- }, jn = (t, e) => (n, o) => e(n, o, t);
2857
- const yc = {
2857
+ }, Yn = (t, e) => (n, o) => e(n, o, t);
2858
+ const Oc = {
2858
2859
  tl: {
2859
2860
  size: 6,
2860
2861
  color: "#409f11"
2861
2862
  }
2862
2863
  };
2863
- let At = class extends ir {
2864
+ let xt = class extends ar {
2864
2865
  constructor(t, e) {
2865
2866
  super(), this._sheetInterceptorService = t, this._formulaDataModel = e, this.disposeWithMe(this._sheetInterceptorService.intercept(
2866
- ss.CELL_CONTENT,
2867
+ ls.CELL_CONTENT,
2867
2868
  {
2868
- effect: cr.Style,
2869
+ effect: ur.Style,
2869
2870
  handler: (n, o, r) => {
2870
- var c, a, h, u;
2871
- const s = (u = (h = (a = (c = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : c[o.unitId]) == null ? void 0 : a[o.subUnitId]) == null ? void 0 : h[o.row]) == null ? void 0 : u[o.col];
2872
- return ko(n, !!s) ? r({
2871
+ var c, l, h, f;
2872
+ const s = (f = (h = (l = (c = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : c[o.unitId]) == null ? void 0 : l[o.subUnitId]) == null ? void 0 : h[o.row]) == null ? void 0 : f[o.col];
2873
+ return Ho(n, !!s) ? r({
2873
2874
  ...n,
2874
2875
  markers: {
2875
2876
  ...n == null ? void 0 : n.markers,
2876
- ...yc
2877
+ ...Oc
2877
2878
  }
2878
2879
  }) : r(n);
2879
2880
  },
@@ -2882,19 +2883,19 @@ let At = class extends ir {
2882
2883
  ));
2883
2884
  }
2884
2885
  };
2885
- At = Nc([
2886
- jn(0, K(ao)),
2887
- jn(1, K(Dt))
2888
- ], At);
2889
- function Tc() {
2890
- const t = O(cs), e = O(ae), n = Be(t.progress$), o = yt(() => {
2891
- e.executeCommand(Hr.id);
2892
- }, [e]), r = yt(() => {
2886
+ xt = Fc([
2887
+ Yn(0, K(fo)),
2888
+ Yn(1, K($t))
2889
+ ], xt);
2890
+ function Mc() {
2891
+ const t = O(us), e = O(ae), n = qe(t.progress$), o = Ft(() => {
2892
+ e.executeCommand(Vr.id);
2893
+ }, [e]), r = Ft(() => {
2893
2894
  t.clearProgress();
2894
2895
  }, [t]);
2895
- return /* @__PURE__ */ b(hs, { progress: n, onTerminate: o, onClearProgress: r });
2896
+ return /* @__PURE__ */ b(gs, { progress: n, onTerminate: o, onClearProgress: r });
2896
2897
  }
2897
- const Fc = (t, e = 100) => {
2898
+ const Ac = (t, e = 100) => {
2898
2899
  L(() => {
2899
2900
  let n = null;
2900
2901
  const o = () => {
@@ -2906,86 +2907,86 @@ const Fc = (t, e = 100) => {
2906
2907
  n !== null && clearTimeout(n), window.removeEventListener("scroll", o), window.removeEventListener("resize", o);
2907
2908
  };
2908
2909
  }, [t, e]);
2909
- }, Oc = "univer-formula-help-function", Mc = "univer-formula-help-function-title", Ac = "univer-formula-help-function-title-icons", Pc = "univer-formula-help-function-title-icon", xc = "univer-formula-help-function-content", wc = "univer-formula-help-function-content-inner", Dc = "univer-formula-help-function-content-params", Lc = "univer-formula-help-function-content-params-title", kc = "univer-formula-help-function-content-params-detail", $c = "univer-formula-help-function-active", Hc = "univer-formula-help-decorator", Wc = "univer-formula-help-param", Uc = "univer-formula-help-param-prefix", Vc = "univer-formula-help-param-item", Bc = "univer-formula-help-param-active", G = {
2910
- formulaHelpFunction: Oc,
2911
- formulaHelpFunctionTitle: Mc,
2912
- formulaHelpFunctionTitleIcons: Ac,
2913
- formulaHelpFunctionTitleIcon: Pc,
2914
- formulaHelpFunctionContent: xc,
2915
- formulaHelpFunctionContentInner: wc,
2916
- formulaHelpFunctionContentParams: Dc,
2917
- formulaHelpFunctionContentParamsTitle: Lc,
2918
- formulaHelpFunctionContentParamsDetail: kc,
2919
- formulaHelpFunctionActive: $c,
2920
- formulaHelpDecorator: Hc,
2921
- formulaHelpParam: Wc,
2922
- formulaHelpParamPrefix: Uc,
2923
- formulaHelpParamItem: Vc,
2924
- formulaHelpParamActive: Bc
2910
+ }, Pc = "univer-formula-help-function", xc = "univer-formula-help-function-title", wc = "univer-formula-help-function-title-icons", Dc = "univer-formula-help-function-title-icon", Lc = "univer-formula-help-function-content", $c = "univer-formula-help-function-content-inner", kc = "univer-formula-help-function-content-params", Hc = "univer-formula-help-function-content-params-title", Wc = "univer-formula-help-function-content-params-detail", Uc = "univer-formula-help-function-active", Vc = "univer-formula-help-decorator", Bc = "univer-formula-help-param", qc = "univer-formula-help-param-prefix", jc = "univer-formula-help-param-item", Kc = "univer-formula-help-param-active", G = {
2911
+ formulaHelpFunction: Pc,
2912
+ formulaHelpFunctionTitle: xc,
2913
+ formulaHelpFunctionTitleIcons: wc,
2914
+ formulaHelpFunctionTitleIcon: Dc,
2915
+ formulaHelpFunctionContent: Lc,
2916
+ formulaHelpFunctionContentInner: $c,
2917
+ formulaHelpFunctionContentParams: kc,
2918
+ formulaHelpFunctionContentParamsTitle: Hc,
2919
+ formulaHelpFunctionContentParamsDetail: Wc,
2920
+ formulaHelpFunctionActive: Uc,
2921
+ formulaHelpDecorator: Vc,
2922
+ formulaHelpParam: Bc,
2923
+ formulaHelpParamPrefix: qc,
2924
+ formulaHelpParamItem: jc,
2925
+ formulaHelpParamActive: Kc
2925
2926
  };
2926
- function qc() {
2927
- const [t, e] = k(!1), [n, o] = k(!0), [r, s] = k(!0), [i, c] = k(0), [a, h] = k([0, 0]), [u, m] = k({ left: 0, top: 0 }), [l, d] = k(null), f = O(Ct), R = O(qe), g = R.t("formula.prompt.required"), p = R.t("formula.prompt.optional"), S = O(oe), C = O(be), v = O($t), I = ds();
2928
- Fc(T), L(() => {
2929
- const _ = f.help$.subscribe((P) => {
2930
- const { visible: y, paramIndex: E, functionInfo: F } = P;
2931
- if (!y) {
2932
- e(y);
2927
+ function Yc() {
2928
+ const [t, e] = $(!1), [n, o] = $(!0), [r, s] = $(!0), [i, c] = $(0), [l, h] = $([0, 0]), [f, m] = $({ left: 0, top: 0 }), [u, d] = $(null), a = O(Ct), I = O(je), g = I.t("formula.prompt.required"), p = I.t("formula.prompt.optional"), C = O(oe), S = O(be), v = O(Wt), _ = ps();
2929
+ Ac(T), L(() => {
2930
+ const R = a.help$.subscribe((P) => {
2931
+ const { visible: N, paramIndex: E, functionInfo: F } = P;
2932
+ if (!N) {
2933
+ e(N);
2933
2934
  return;
2934
2935
  }
2935
2936
  const x = w();
2936
2937
  if (x == null)
2937
2938
  return;
2938
2939
  const { left: H, top: V, height: te } = x;
2939
- F.description === "" && F.functionParameter.length === 0 || (h([H, V + te]), c(E), d(F), m({ left: H, top: V }), e(y));
2940
- }), N = v.scrollEvent$.pipe(so(100)).subscribe(T);
2940
+ F.description === "" && F.functionParameter.length === 0 || (h([H, V + te]), c(E), d(F), m({ left: H, top: V }), e(N));
2941
+ }), y = v.scrollEvent$.pipe(co(100)).subscribe(T);
2941
2942
  return () => {
2942
- _ == null || _.unsubscribe(), N.unsubscribe();
2943
+ R == null || R.unsubscribe(), y.unsubscribe();
2943
2944
  };
2944
2945
  }, []);
2945
2946
  function T() {
2946
2947
  if (!r)
2947
2948
  return;
2948
- const _ = w();
2949
- if (_ == null)
2949
+ const R = w();
2950
+ if (R == null)
2950
2951
  return;
2951
- const { left: N, top: P, height: y } = _;
2952
- h([N, P + y]);
2952
+ const { left: y, top: P, height: N } = R;
2953
+ h([y, P + N]);
2953
2954
  }
2954
2955
  function w() {
2955
- const _ = S.getCurrentUniverDocInstance();
2956
- if (!_)
2956
+ const R = C.getCurrentUniverDocInstance();
2957
+ if (!R)
2957
2958
  return;
2958
- const N = _.getUnitId();
2959
- if (!C.isEditor(N))
2959
+ const y = R.getUnitId();
2960
+ if (!S.isEditor(y))
2960
2961
  return;
2961
- const P = C.getEditor(N);
2962
+ const P = S.getEditor(y);
2962
2963
  return P == null ? void 0 : P.getBoundingClientRect();
2963
2964
  }
2964
- function A(_) {
2965
- c(_);
2965
+ function A(R) {
2966
+ c(R);
2966
2967
  }
2967
2968
  function M() {
2968
- s(!r), I.get(ms).focus();
2969
+ s(!r), _.get(Ss).focus();
2969
2970
  }
2970
- return /* @__PURE__ */ b(ut, { children: r ? /* @__PURE__ */ b(_o, { visible: t, offset: a, children: l ? /* @__PURE__ */ $("div", { className: G.formulaHelpFunction, children: [
2971
- /* @__PURE__ */ $("div", { className: G.formulaHelpFunctionTitle, children: [
2971
+ return /* @__PURE__ */ b(ut, { children: r ? /* @__PURE__ */ b(Io, { visible: t, offset: l, children: u ? /* @__PURE__ */ k("div", { className: G.formulaHelpFunction, children: [
2972
+ /* @__PURE__ */ k("div", { className: G.formulaHelpFunctionTitle, children: [
2972
2973
  /* @__PURE__ */ b(
2973
- jc,
2974
+ zc,
2974
2975
  {
2975
- prefix: l.functionName,
2976
- value: l.functionParameter,
2976
+ prefix: u.functionName,
2977
+ value: u.functionParameter,
2977
2978
  active: i,
2978
2979
  onClick: A
2979
2980
  }
2980
2981
  ),
2981
- /* @__PURE__ */ $("div", { className: G.formulaHelpFunctionTitleIcons, children: [
2982
+ /* @__PURE__ */ k("div", { className: G.formulaHelpFunctionTitleIcons, children: [
2982
2983
  /* @__PURE__ */ b(
2983
2984
  "div",
2984
2985
  {
2985
2986
  className: G.formulaHelpFunctionTitleIcon,
2986
2987
  style: { transform: n ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
2987
2988
  onClick: () => o(!n),
2988
- children: /* @__PURE__ */ b(dn, {})
2989
+ children: /* @__PURE__ */ b(gn, {})
2989
2990
  }
2990
2991
  ),
2991
2992
  /* @__PURE__ */ b(
@@ -2993,7 +2994,7 @@ function qc() {
2993
2994
  {
2994
2995
  className: G.formulaHelpFunctionTitleIcon,
2995
2996
  onClick: M,
2996
- children: /* @__PURE__ */ b(Wt, {})
2997
+ children: /* @__PURE__ */ b(Vt, {})
2997
2998
  }
2998
2999
  )
2999
3000
  ] })
@@ -3006,29 +3007,29 @@ function qc() {
3006
3007
  height: n ? "unset" : 0,
3007
3008
  padding: n ? "revert-layer" : 0
3008
3009
  },
3009
- children: /* @__PURE__ */ $("div", { className: G.formulaHelpFunctionContentInner, children: [
3010
+ children: /* @__PURE__ */ k("div", { className: G.formulaHelpFunctionContentInner, children: [
3010
3011
  /* @__PURE__ */ b(
3011
- Yt,
3012
+ Gt,
3012
3013
  {
3013
- title: R.t("formula.prompt.helpExample"),
3014
- value: `${l.functionName}(${l.functionParameter.map((_) => _.example).join(",")})`
3014
+ title: I.t("formula.prompt.helpExample"),
3015
+ value: `${u.functionName}(${u.functionParameter.map((R) => R.example).join(",")})`
3015
3016
  }
3016
3017
  ),
3017
3018
  /* @__PURE__ */ b(
3018
- Yt,
3019
+ Gt,
3019
3020
  {
3020
- title: R.t("formula.prompt.helpAbstract"),
3021
- value: l.description
3021
+ title: I.t("formula.prompt.helpAbstract"),
3022
+ value: u.description
3022
3023
  }
3023
3024
  ),
3024
- l && l.functionParameter && l.functionParameter.map((_, N) => /* @__PURE__ */ b(
3025
- Yt,
3025
+ u && u.functionParameter && u.functionParameter.map((R, y) => /* @__PURE__ */ b(
3026
+ Gt,
3026
3027
  {
3027
- className: i === N ? G.formulaHelpFunctionActive : "",
3028
- title: _.name,
3029
- value: `${_.require ? g : p} ${_.detail}`
3028
+ className: i === y ? G.formulaHelpFunctionActive : "",
3029
+ title: R.name,
3030
+ value: `${R.require ? g : p} ${R.detail}`
3030
3031
  },
3031
- N
3032
+ y
3032
3033
  ))
3033
3034
  ] })
3034
3035
  }
@@ -3038,12 +3039,12 @@ function qc() {
3038
3039
  {
3039
3040
  className: G.formulaHelpDecorator,
3040
3041
  onClick: () => s(!r),
3041
- style: { left: u.left - 24, top: u.top },
3042
- children: /* @__PURE__ */ b(Oo, {})
3042
+ style: { left: f.left - 24, top: f.top },
3043
+ children: /* @__PURE__ */ b(Ao, {})
3043
3044
  }
3044
3045
  ) : /* @__PURE__ */ b(ut, {}) });
3045
3046
  }
3046
- const Yt = (t) => /* @__PURE__ */ $("div", { className: G.formulaHelpFunctionContentParams, children: [
3047
+ const Gt = (t) => /* @__PURE__ */ k("div", { className: G.formulaHelpFunctionContentParams, children: [
3047
3048
  /* @__PURE__ */ b(
3048
3049
  "div",
3049
3050
  {
@@ -3055,22 +3056,22 @@ const Yt = (t) => /* @__PURE__ */ $("div", { className: G.formulaHelpFunctionCon
3055
3056
  }
3056
3057
  ),
3057
3058
  /* @__PURE__ */ b("div", { className: G.formulaHelpFunctionContentParamsDetail, children: t.value })
3058
- ] }), jc = (t) => {
3059
+ ] }), zc = (t) => {
3059
3060
  const { prefix: e, value: n, active: o, onClick: r } = t;
3060
- return /* @__PURE__ */ $("div", { className: G.formulaHelpParam, children: [
3061
- /* @__PURE__ */ $("span", { className: G.formulaHelpParamPrefix, children: [
3061
+ return /* @__PURE__ */ k("div", { className: G.formulaHelpParam, children: [
3062
+ /* @__PURE__ */ k("span", { className: G.formulaHelpParamPrefix, children: [
3062
3063
  e,
3063
3064
  "("
3064
3065
  ] }),
3065
3066
  n && n.map((s, i) => (
3066
3067
  // TODO@Dushusir: more params needs to be active
3067
- /* @__PURE__ */ $("span", { className: G.formulaHelpParamItem, children: [
3068
+ /* @__PURE__ */ k("span", { className: G.formulaHelpParamItem, children: [
3068
3069
  /* @__PURE__ */ b(
3069
3070
  "span",
3070
3071
  {
3071
3072
  className: o === i ? G.formulaHelpFunctionActive : G.formulaHelpParamActive,
3072
3073
  onClick: () => r(i),
3073
- children: mn(s)
3074
+ children: pn(s)
3074
3075
  }
3075
3076
  ),
3076
3077
  i === n.length - 1 ? "" : ","
@@ -3078,236 +3079,236 @@ const Yt = (t) => /* @__PURE__ */ $("div", { className: G.formulaHelpFunctionCon
3078
3079
  )),
3079
3080
  ")"
3080
3081
  ] });
3081
- }, Kc = "univer-formula-search-function", Yc = "univer-formula-search-function-item", zc = "univer-formula-search-function-item-name", Gc = "univer-formula-search-function-item-name-light", Zc = "univer-formula-search-function-item-desc", Xc = "univer-formula-search-function-item-active", xe = {
3082
- formulaSearchFunction: Kc,
3083
- formulaSearchFunctionItem: Yc,
3084
- formulaSearchFunctionItemName: zc,
3085
- formulaSearchFunctionItemNameLight: Gc,
3086
- formulaSearchFunctionItemDesc: Zc,
3087
- formulaSearchFunctionItemActive: Xc
3082
+ }, Gc = "univer-formula-search-function", Zc = "univer-formula-search-function-item", Xc = "univer-formula-search-function-item-name", Qc = "univer-formula-search-function-item-name-light", Jc = "univer-formula-search-function-item-desc", el = "univer-formula-search-function-item-active", xe = {
3083
+ formulaSearchFunction: Gc,
3084
+ formulaSearchFunctionItem: Zc,
3085
+ formulaSearchFunctionItemName: Xc,
3086
+ formulaSearchFunctionItemNameLight: Qc,
3087
+ formulaSearchFunctionItemDesc: Jc,
3088
+ formulaSearchFunctionItemActive: el
3088
3089
  };
3089
- function Qc() {
3090
- const [t, e] = k(!1), [n, o] = k(0), [r, s] = k([0, 0]), [i, c] = k([]), [a, h] = k(""), u = j(null), m = O(Ct), l = O(oe), d = O(be);
3090
+ function tl() {
3091
+ const [t, e] = $(!1), [n, o] = $(0), [r, s] = $([0, 0]), [i, c] = $([]), [l, h] = $(""), f = j(null), m = O(Ct), u = O(oe), d = O(be);
3091
3092
  L(() => {
3092
- let S = [], C = 0;
3093
+ let C = [], S = 0;
3093
3094
  const v = m.search$.subscribe((w) => {
3094
- const { visible: A, searchText: M, searchList: _ } = w;
3095
+ const { visible: A, searchText: M, searchList: R } = w;
3095
3096
  if (!A) {
3096
3097
  e(A);
3097
3098
  return;
3098
3099
  }
3099
- const N = f();
3100
- if (N == null)
3100
+ const y = a();
3101
+ if (y == null)
3101
3102
  return;
3102
- const { left: P, top: y, height: E } = N;
3103
- h(M), c(_), S = _, s([P, y + E]), e(A), o(0), C = 0;
3104
- }), I = m.navigate$.subscribe((w) => {
3103
+ const { left: P, top: N, height: E } = y;
3104
+ h(M), c(R), C = R, s([P, N + E]), e(A), o(0), S = 0;
3105
+ }), _ = m.navigate$.subscribe((w) => {
3105
3106
  const { direction: A } = w;
3106
3107
  if (A === ne.UP) {
3107
- let M = C - 1;
3108
- M = M < 0 ? S.length - 1 : M, o(M), C = M;
3108
+ let M = S - 1;
3109
+ M = M < 0 ? C.length - 1 : M, o(M), S = M;
3109
3110
  } else if (A === ne.DOWN) {
3110
- let M = C + 1;
3111
- M = M >= S.length ? 0 : M, o(M), C = M;
3111
+ let M = S + 1;
3112
+ M = M >= C.length ? 0 : M, o(M), S = M;
3112
3113
  }
3113
- p(C);
3114
+ p(S);
3114
3115
  }), T = m.accept$.subscribe((w) => {
3115
- const A = S[C].name;
3116
+ const A = C[S].name;
3116
3117
  m.acceptFormulaName(A);
3117
3118
  });
3118
3119
  return () => {
3119
- v == null || v.unsubscribe(), I == null || I.unsubscribe(), T == null || T.unsubscribe();
3120
+ v == null || v.unsubscribe(), _ == null || _.unsubscribe(), T == null || T.unsubscribe();
3120
3121
  };
3121
3122
  }, []);
3122
- function f() {
3123
- const C = l.getCurrentUniverDocInstance().getUnitId();
3124
- if (!d.isEditor(C))
3123
+ function a() {
3124
+ const S = u.getCurrentUniverDocInstance().getUnitId();
3125
+ if (!d.isEditor(S))
3125
3126
  return;
3126
- const v = d.getEditor(C);
3127
+ const v = d.getEditor(S);
3127
3128
  return v == null ? void 0 : v.getBoundingClientRect();
3128
3129
  }
3129
- function R(S) {
3130
- o(S);
3130
+ function I(C) {
3131
+ o(C);
3131
3132
  }
3132
3133
  function g() {
3133
3134
  o(-1);
3134
3135
  }
3135
- function p(S) {
3136
+ function p(C) {
3136
3137
  var P;
3137
- const C = (P = u.current) == null ? void 0 : P.querySelectorAll(`.${xe.formulaSearchFunctionItem}`)[S];
3138
- if (!C) return;
3139
- const v = C.parentNode;
3138
+ const S = (P = f.current) == null ? void 0 : P.querySelectorAll(`.${xe.formulaSearchFunctionItem}`)[C];
3139
+ if (!S) return;
3140
+ const v = S.parentNode;
3140
3141
  if (!v) return;
3141
- const T = v.getBoundingClientRect().top, w = v.offsetHeight, A = C.getBoundingClientRect(), M = A.top, _ = A.height;
3142
- if (M >= 0 && M > T && M - T + _ <= w)
3142
+ const T = v.getBoundingClientRect().top, w = v.offsetHeight, A = S.getBoundingClientRect(), M = A.top, R = A.height;
3143
+ if (M >= 0 && M > T && M - T + R <= w)
3143
3144
  return;
3144
- const N = C.offsetTop - (w - _) / 2;
3145
+ const y = S.offsetTop - (w - R) / 2;
3145
3146
  v.scrollTo({
3146
- top: N,
3147
+ top: y,
3147
3148
  behavior: "smooth"
3148
3149
  });
3149
3150
  }
3150
- return i.length > 0 && /* @__PURE__ */ b(_o, { visible: t, offset: r, children: /* @__PURE__ */ b("ul", { className: xe.formulaSearchFunction, ref: u, children: i.map((S, C) => /* @__PURE__ */ $(
3151
+ return i.length > 0 && /* @__PURE__ */ b(Io, { visible: t, offset: r, children: /* @__PURE__ */ b("ul", { className: xe.formulaSearchFunction, ref: f, children: i.map((C, S) => /* @__PURE__ */ k(
3151
3152
  "li",
3152
3153
  {
3153
- className: n === C ? `
3154
+ className: n === S ? `
3154
3155
  ${xe.formulaSearchFunctionItem}
3155
3156
  ${xe.formulaSearchFunctionItemActive}
3156
3157
  ` : xe.formulaSearchFunctionItem,
3157
- onMouseEnter: () => R(C),
3158
+ onMouseEnter: () => I(S),
3158
3159
  onMouseLeave: g,
3159
- onClick: () => m.acceptFormulaName(S.name),
3160
+ onClick: () => m.acceptFormulaName(C.name),
3160
3161
  children: [
3161
- /* @__PURE__ */ $("span", { className: xe.formulaSearchFunctionItemName, children: [
3162
- /* @__PURE__ */ b("span", { className: xe.formulaSearchFunctionItemNameLight, children: S.name.substring(0, a.length) }),
3163
- /* @__PURE__ */ b("span", { children: S.name.slice(a.length) })
3162
+ /* @__PURE__ */ k("span", { className: xe.formulaSearchFunctionItemName, children: [
3163
+ /* @__PURE__ */ b("span", { className: xe.formulaSearchFunctionItemNameLight, children: C.name.substring(0, l.length) }),
3164
+ /* @__PURE__ */ b("span", { children: C.name.slice(l.length) })
3164
3165
  ] }),
3165
- /* @__PURE__ */ b("span", { className: xe.formulaSearchFunctionItemDesc, children: S.desc })
3166
+ /* @__PURE__ */ b("span", { className: xe.formulaSearchFunctionItemDesc, children: C.desc })
3166
3167
  ]
3167
3168
  },
3168
- C
3169
+ S
3169
3170
  )) }) });
3170
3171
  }
3171
- function Jc() {
3172
- return /* @__PURE__ */ $(ut, { children: [
3173
- /* @__PURE__ */ b(Qc, {}),
3174
- /* @__PURE__ */ b(qc, {})
3172
+ function nl() {
3173
+ return /* @__PURE__ */ k(ut, { children: [
3174
+ /* @__PURE__ */ b(tl, {}),
3175
+ /* @__PURE__ */ b(Yc, {})
3175
3176
  ] });
3176
3177
  }
3177
- const el = "univer-formula-more-functions", tl = "univer-formula-more-functions-operation", Kn = {
3178
- formulaMoreFunctions: el,
3179
- formulaMoreFunctionsOperation: tl
3178
+ const ol = "univer-formula-more-functions", rl = "univer-formula-more-functions-operation", zn = {
3179
+ formulaMoreFunctions: ol,
3180
+ formulaMoreFunctionsOperation: rl
3180
3181
  };
3181
- function Ho(t) {
3182
+ function Uo(t) {
3182
3183
  const { prefix: e, value: n } = t;
3183
- return /* @__PURE__ */ $("div", { children: [
3184
- /* @__PURE__ */ $("span", { children: [
3184
+ return /* @__PURE__ */ k("div", { children: [
3185
+ /* @__PURE__ */ k("span", { children: [
3185
3186
  e,
3186
3187
  "("
3187
3188
  ] }),
3188
- n && n.map((o, r) => /* @__PURE__ */ $("span", { children: [
3189
- /* @__PURE__ */ b("span", { children: mn(o) }),
3189
+ n && n.map((o, r) => /* @__PURE__ */ k("span", { children: [
3190
+ /* @__PURE__ */ b("span", { children: pn(o) }),
3190
3191
  r === n.length - 1 ? "" : ","
3191
3192
  ] }, r)),
3192
3193
  ")"
3193
3194
  ] });
3194
3195
  }
3195
- const nl = "univer-formula-function-params", ol = "univer-formula-function-params-title", rl = "univer-formula-function-params-detail", zt = {
3196
- formulaFunctionParams: nl,
3197
- formulaFunctionParamsTitle: ol,
3198
- formulaFunctionParamsDetail: rl
3196
+ const sl = "univer-formula-function-params", il = "univer-formula-function-params-title", cl = "univer-formula-function-params-detail", Zt = {
3197
+ formulaFunctionParams: sl,
3198
+ formulaFunctionParamsTitle: il,
3199
+ formulaFunctionParamsDetail: cl
3199
3200
  };
3200
3201
  function at(t) {
3201
3202
  const { className: e, value: n, title: o } = t;
3202
- return /* @__PURE__ */ $("div", { className: zt.formulaFunctionParams, children: [
3203
+ return /* @__PURE__ */ k("div", { className: Zt.formulaFunctionParams, children: [
3203
3204
  /* @__PURE__ */ b(
3204
3205
  "div",
3205
3206
  {
3206
3207
  className: `
3207
- ${zt.formulaFunctionParamsTitle}
3208
+ ${Zt.formulaFunctionParamsTitle}
3208
3209
  ${e}
3209
3210
  `,
3210
3211
  children: o
3211
3212
  }
3212
3213
  ),
3213
- /* @__PURE__ */ b("div", { className: zt.formulaFunctionParamsDetail, children: n })
3214
+ /* @__PURE__ */ b("div", { className: Zt.formulaFunctionParamsDetail, children: n })
3214
3215
  ] });
3215
3216
  }
3216
- const sl = "univer-formula-input-params-list", il = "univer-formula-input-params-list-item-name", cl = "univer-formula-input-params-list-item-selector", lt = {
3217
- formulaInputParamsList: sl,
3218
- formulaInputParamsListItemName: il,
3219
- formulaInputParamsListItemSelector: cl
3217
+ const ll = "univer-formula-input-params-list", al = "univer-formula-input-params-list-item-name", ul = "univer-formula-input-params-list-item-selector", lt = {
3218
+ formulaInputParamsList: ll,
3219
+ formulaInputParamsListItemName: al,
3220
+ formulaInputParamsListItemSelector: ul
3220
3221
  };
3221
- function ll(t) {
3222
+ function fl(t) {
3222
3223
  const { functionInfo: e, onChange: n } = t;
3223
3224
  if (!e) return null;
3224
- const [o, r] = k([]), [s, i] = k(e.functionParameter), [c, a] = k(-1);
3225
- return /* @__PURE__ */ $("div", { className: lt.formulaInputParams, children: [
3226
- /* @__PURE__ */ b("div", { className: lt.formulaInputParamsList, children: s.map((h, u) => /* @__PURE__ */ $("div", { children: [
3225
+ const [o, r] = $([]), [s, i] = $(e.functionParameter), [c, l] = $(-1);
3226
+ return /* @__PURE__ */ k("div", { className: lt.formulaInputParams, children: [
3227
+ /* @__PURE__ */ b("div", { className: lt.formulaInputParamsList, children: s.map((h, f) => /* @__PURE__ */ k("div", { children: [
3227
3228
  /* @__PURE__ */ b("div", { className: lt.formulaInputParamsListItemName, children: h.name }),
3228
3229
  /* @__PURE__ */ b("div", { className: lt.formulaInputParamsListItemSelector })
3229
- ] }, u)) }),
3230
+ ] }, f)) }),
3230
3231
  /* @__PURE__ */ b("div", { className: lt.formulaInputParamsInfo, children: /* @__PURE__ */ b(
3231
3232
  at,
3232
3233
  {
3233
- title: c === -1 ? /* @__PURE__ */ b(Ho, { prefix: e.functionName, value: s }) : s[c].name,
3234
+ title: c === -1 ? /* @__PURE__ */ b(Uo, { prefix: e.functionName, value: s }) : s[c].name,
3234
3235
  value: c === -1 ? e.description : s[c].detail
3235
3236
  }
3236
3237
  ) })
3237
3238
  ] });
3238
3239
  }
3239
- const al = "univer-formula-select-function-select", ul = "univer-formula-select-function-result", fl = "univer-formula-select-function-result-item", hl = "univer-formula-select-function-result-item-name-light", dl = "univer-formula-select-function-result-item-selected", ml = "univer-formula-select-function-result-item-active", gl = "univer-formula-select-function-content", _e = {
3240
- formulaSelectFunctionSelect: al,
3241
- formulaSelectFunctionResult: ul,
3242
- formulaSelectFunctionResultItem: fl,
3243
- formulaSelectFunctionResultItemNameLight: hl,
3244
- formulaSelectFunctionResultItemSelected: dl,
3245
- formulaSelectFunctionResultItemActive: ml,
3246
- formulaSelectFunctionContent: gl
3240
+ const hl = "univer-formula-select-function-select", dl = "univer-formula-select-function-result", ml = "univer-formula-select-function-result-item", gl = "univer-formula-select-function-result-item-name-light", pl = "univer-formula-select-function-result-item-selected", Sl = "univer-formula-select-function-result-item-active", Cl = "univer-formula-select-function-content", _e = {
3241
+ formulaSelectFunctionSelect: hl,
3242
+ formulaSelectFunctionResult: dl,
3243
+ formulaSelectFunctionResultItem: ml,
3244
+ formulaSelectFunctionResultItemNameLight: gl,
3245
+ formulaSelectFunctionResultItemSelected: pl,
3246
+ formulaSelectFunctionResultItemActive: Sl,
3247
+ formulaSelectFunctionContent: Cl
3247
3248
  };
3248
- function pl(t) {
3249
- const { onChange: e } = t, n = "-1", [o, r] = k(""), [s, i] = k([]), [c, a] = k(0), [h, u] = k(n), [m, l] = k(0), [d, f] = k(null), R = O(kt), g = O(qe), p = O($t), S = Be(p.sidebarOptions$), C = js(Wr, g);
3250
- C.unshift({
3249
+ function vl(t) {
3250
+ const { onChange: e } = t, n = "-1", [o, r] = $(""), [s, i] = $([]), [c, l] = $(0), [h, f] = $(n), [m, u] = $(0), [d, a] = $(null), I = O(Ht), g = O(je), p = O(Wt), C = qe(p.sidebarOptions$), S = zs(Br, g);
3251
+ S.unshift({
3251
3252
  label: g.t("formula.moreFunctions.allFunctions"),
3252
3253
  value: n
3253
3254
  });
3254
- const v = g.t("formula.prompt.required"), I = g.t("formula.prompt.optional");
3255
+ const v = g.t("formula.prompt.required"), _ = g.t("formula.prompt.optional");
3255
3256
  L(() => {
3256
3257
  A(n);
3257
3258
  }, []), L(() => {
3258
3259
  w(0);
3259
3260
  }, [s]), L(() => {
3260
- S != null && S.visible && (r(""), i([]), a(0), u(n), l(0), f(null), A(n));
3261
- }, [S]);
3262
- const T = (y) => {
3263
- if (o.trim() === "") return y;
3261
+ C != null && C.visible && (r(""), i([]), l(0), f(n), u(0), a(null), A(n));
3262
+ }, [C]);
3263
+ const T = (N) => {
3264
+ if (o.trim() === "") return N;
3264
3265
  const E = new RegExp(`(${o.toLocaleUpperCase()})`);
3265
- return y.split(E).filter(Boolean).map((x, H) => x.match(E) ? /* @__PURE__ */ b("span", { className: _e.formulaSelectFunctionResultItemNameLight, children: x }, H) : x);
3266
- }, w = (y) => {
3266
+ return N.split(E).filter(Boolean).map((x, H) => x.match(E) ? /* @__PURE__ */ b("span", { className: _e.formulaSelectFunctionResultItemNameLight, children: x }, H) : x);
3267
+ }, w = (N) => {
3267
3268
  if (s.length === 0) {
3268
- f(null);
3269
+ a(null);
3269
3270
  return;
3270
3271
  }
3271
- l(y);
3272
- const E = R.getFunctionInfo(s[y].name);
3272
+ u(N);
3273
+ const E = I.getFunctionInfo(s[N].name);
3273
3274
  if (!E) {
3274
- f(null);
3275
+ a(null);
3275
3276
  return;
3276
3277
  }
3277
- f(E), e(E);
3278
+ a(E), e(E);
3278
3279
  };
3279
- function A(y) {
3280
- u(y);
3281
- const E = R.getSearchListByType(+y);
3280
+ function A(N) {
3281
+ f(N);
3282
+ const E = I.getSearchListByType(+N);
3282
3283
  i(E);
3283
3284
  }
3284
- function M(y) {
3285
- r(y);
3286
- const E = R.getSearchListByName(y);
3285
+ function M(N) {
3286
+ r(N);
3287
+ const E = I.getSearchListByName(N);
3287
3288
  i(E);
3288
3289
  }
3289
- function _(y) {
3290
- if (y.stopPropagation(), y.key === "ArrowDown") {
3290
+ function R(N) {
3291
+ if (N.stopPropagation(), N.key === "ArrowDown") {
3291
3292
  const E = c + 1;
3292
- a(E === s.length ? 0 : E);
3293
- } else if (y.key === "ArrowUp") {
3293
+ l(E === s.length ? 0 : E);
3294
+ } else if (N.key === "ArrowUp") {
3294
3295
  const E = c - 1;
3295
- a(E === -1 ? s.length - 1 : E);
3296
- } else y.key === "Enter" && w(c);
3296
+ l(E === -1 ? s.length - 1 : E);
3297
+ } else N.key === "Enter" && w(c);
3297
3298
  }
3298
- const N = (y) => {
3299
- a(y);
3299
+ const y = (N) => {
3300
+ l(N);
3300
3301
  }, P = () => {
3301
- a(-1);
3302
+ l(-1);
3302
3303
  };
3303
- return /* @__PURE__ */ $("div", { children: [
3304
- /* @__PURE__ */ $("div", { className: _e.formulaSelectFunctionSelect, children: [
3305
- /* @__PURE__ */ b(_s, { value: h, options: C, onChange: A }),
3304
+ return /* @__PURE__ */ k("div", { children: [
3305
+ /* @__PURE__ */ k("div", { className: _e.formulaSelectFunctionSelect, children: [
3306
+ /* @__PURE__ */ b(Es, { value: h, options: S, onChange: A }),
3306
3307
  /* @__PURE__ */ b(
3307
- vo,
3308
+ Ro,
3308
3309
  {
3309
3310
  placeholder: g.t("formula.moreFunctions.searchFunctionPlaceholder"),
3310
- onKeyDown: _,
3311
+ onKeyDown: R,
3311
3312
  value: o,
3312
3313
  onChange: M,
3313
3314
  size: "small",
@@ -3315,85 +3316,85 @@ function pl(t) {
3315
3316
  }
3316
3317
  )
3317
3318
  ] }),
3318
- /* @__PURE__ */ b("ul", { className: _e.formulaSelectFunctionResult, onKeyDown: _, tabIndex: -1, children: s.map(({ name: y }, E) => /* @__PURE__ */ $(
3319
+ /* @__PURE__ */ b("ul", { className: _e.formulaSelectFunctionResult, onKeyDown: R, tabIndex: -1, children: s.map(({ name: N }, E) => /* @__PURE__ */ k(
3319
3320
  "li",
3320
3321
  {
3321
3322
  className: c === E ? `
3322
3323
  ${_e.formulaSelectFunctionResultItem}
3323
3324
  ${_e.formulaSelectFunctionResultItemActive}
3324
3325
  ` : _e.formulaSelectFunctionResultItem,
3325
- onMouseEnter: () => N(E),
3326
+ onMouseEnter: () => y(E),
3326
3327
  onMouseLeave: P,
3327
3328
  onClick: () => w(E),
3328
3329
  children: [
3329
- m === E && /* @__PURE__ */ b(To, { className: _e.formulaSelectFunctionResultItemSelected }),
3330
- /* @__PURE__ */ b("span", { className: _e.formulaSelectFunctionResultItemName, children: T(y) })
3330
+ m === E && /* @__PURE__ */ b(Oo, { className: _e.formulaSelectFunctionResultItemSelected }),
3331
+ /* @__PURE__ */ b("span", { className: _e.formulaSelectFunctionResultItemName, children: T(N) })
3331
3332
  ]
3332
3333
  },
3333
3334
  E
3334
3335
  )) }),
3335
- d && /* @__PURE__ */ $("div", { className: _e.formulaSelectFunctionContent, children: [
3336
+ d && /* @__PURE__ */ k("div", { className: _e.formulaSelectFunctionContent, children: [
3336
3337
  /* @__PURE__ */ b(at, { title: d.functionName, value: d.description }),
3337
3338
  /* @__PURE__ */ b(
3338
3339
  at,
3339
3340
  {
3340
3341
  title: g.t("formula.moreFunctions.syntax"),
3341
- value: /* @__PURE__ */ b(Ho, { prefix: d.functionName, value: d.functionParameter })
3342
+ value: /* @__PURE__ */ b(Uo, { prefix: d.functionName, value: d.functionParameter })
3342
3343
  }
3343
3344
  ),
3344
3345
  /* @__PURE__ */ b(
3345
3346
  at,
3346
3347
  {
3347
3348
  title: g.t("formula.prompt.helpExample"),
3348
- value: `${d.functionName}(${d.functionParameter.map((y) => y.example).join(",")})`
3349
+ value: `${d.functionName}(${d.functionParameter.map((N) => N.example).join(",")})`
3349
3350
  }
3350
3351
  ),
3351
- d.functionParameter && d.functionParameter.map((y) => /* @__PURE__ */ b(
3352
+ d.functionParameter && d.functionParameter.map((N) => /* @__PURE__ */ b(
3352
3353
  at,
3353
3354
  {
3354
- title: y.name,
3355
- value: `${y.require ? v : I} ${y.detail}`
3355
+ title: N.name,
3356
+ value: `${N.require ? v : _} ${N.detail}`
3356
3357
  },
3357
- y.name
3358
+ N.name
3358
3359
  ))
3359
3360
  ] })
3360
3361
  ] });
3361
3362
  }
3362
- function Sl() {
3363
- const t = Tr(), [e, n] = k(!0), [o, r] = k(!1), [s, i] = k(null);
3364
- O(Xn);
3365
- const c = O(qe), a = O(be), h = O(oe), u = O(ae);
3363
+ function _l() {
3364
+ const t = Mr(), [e, n] = $(!0), [o, r] = $(!1), [s, i] = $(null);
3365
+ O(Jn);
3366
+ const c = O(je), l = O(be), h = O(oe), f = O(ae);
3366
3367
  function m() {
3367
3368
  n(!e), r(!o);
3368
3369
  }
3369
- function l() {
3370
- const d = lo(h);
3370
+ function u() {
3371
+ const d = uo(h);
3371
3372
  if (!d) return;
3372
- u.executeCommand(Qn.id, {
3373
+ f.executeCommand(eo.id, {
3373
3374
  visible: !0,
3374
3375
  unitId: d.unitId,
3375
- eventType: Ne.Dblclick
3376
+ eventType: ye.Dblclick
3376
3377
  });
3377
- const f = a.getEditor(nn), R = a.getEditor(zn), g = `=${s == null ? void 0 : s.functionName}(`;
3378
- f == null || f.replaceText(g), R == null || R.replaceText(g, !1);
3378
+ const a = l.getEditor(rn), I = l.getEditor(Zn), g = `=${s == null ? void 0 : s.functionName}(`;
3379
+ a == null || a.replaceText(g), I == null || I.replaceText(g, !1);
3379
3380
  }
3380
- return /* @__PURE__ */ $("div", { className: Kn.formulaMoreFunctions, children: [
3381
- e && /* @__PURE__ */ b(pl, { onChange: i }),
3382
- o && /* @__PURE__ */ b(ll, { functionInfo: s, onChange: () => {
3381
+ return /* @__PURE__ */ k("div", { className: zn.formulaMoreFunctions, children: [
3382
+ e && /* @__PURE__ */ b(vl, { onChange: i }),
3383
+ o && /* @__PURE__ */ b(fl, { functionInfo: s, onChange: () => {
3383
3384
  } }),
3384
- /* @__PURE__ */ $("div", { className: Kn.formulaMoreFunctionsOperation, children: [
3385
- o && /* @__PURE__ */ b(Je, { type: "primary", size: "small", onClick: m, children: c.t("formula.moreFunctions.next") }),
3386
- o && /* @__PURE__ */ b(Je, { size: "small", onClick: m, children: c.t("formula.moreFunctions.prev") }),
3387
- e && !!t && /* @__PURE__ */ b(Je, { type: "primary", size: "small", onClick: l, children: c.t("formula.moreFunctions.confirm") })
3385
+ /* @__PURE__ */ k("div", { className: zn.formulaMoreFunctionsOperation, children: [
3386
+ o && /* @__PURE__ */ b(et, { type: "primary", size: "small", onClick: m, children: c.t("formula.moreFunctions.next") }),
3387
+ o && /* @__PURE__ */ b(et, { size: "small", onClick: m, children: c.t("formula.moreFunctions.prev") }),
3388
+ e && !!t && /* @__PURE__ */ b(et, { type: "primary", size: "small", onClick: u, children: c.t("formula.moreFunctions.confirm") })
3388
3389
  ] })
3389
3390
  ] });
3390
3391
  }
3391
- function Cl(t) {
3392
+ function Rl(t) {
3392
3393
  return {
3393
- id: un.id,
3394
+ id: hn.id,
3394
3395
  icon: "FunctionSingle",
3395
3396
  tooltip: "formula.insert.tooltip",
3396
- type: ln.SELECTOR,
3397
+ type: un.SELECTOR,
3397
3398
  selections: [
3398
3399
  {
3399
3400
  label: {
@@ -3436,141 +3437,141 @@ function Cl(t) {
3436
3437
  icon: "MinSingle"
3437
3438
  }
3438
3439
  ],
3439
- hidden$: gs(t, ue.UNIVER_SHEET),
3440
- disabled$: no(t, { workbookTypes: [mo], worksheetTypes: [fo, uo], rangeTypes: [ho] })
3440
+ hidden$: Cs(t, ue.UNIVER_SHEET),
3441
+ disabled$: ro(t, { workbookTypes: [po], worksheetTypes: [mo, ho], rangeTypes: [go] })
3441
3442
  };
3442
3443
  }
3443
- function vl(t) {
3444
+ function Il(t) {
3444
3445
  return {
3445
- id: fn.id,
3446
+ id: dn.id,
3446
3447
  title: "formula.insert.more",
3447
- type: ln.BUTTON
3448
+ type: un.BUTTON
3448
3449
  };
3449
3450
  }
3450
- function _l(t) {
3451
+ function El(t) {
3451
3452
  return t.get(oe).getCurrentTypeOfUnit$(ue.UNIVER_SHEET).pipe(
3452
- jr((o) => o ? t.get(Ln) ? new Kr((s) => s.next(!t.get(Ln).supportClipboard)) : On(!0) : On(!0))
3453
+ zr((o) => o ? t.get(kn) ? new Gr((s) => s.next(!t.get(kn).supportClipboard)) : An(!0) : An(!0))
3453
3454
  );
3454
3455
  }
3455
- function Rl(t) {
3456
+ function bl(t) {
3456
3457
  return {
3457
- id: an.id,
3458
- type: ln.BUTTON,
3458
+ id: fn.id,
3459
+ type: un.BUTTON,
3459
3460
  title: "formula.operation.pasteFormula",
3460
- disabled$: _l(t).pipe(
3461
- qr(no(t, { workbookTypes: [mo], rangeTypes: [ho], worksheetTypes: [uo, fo] })),
3462
- io(([e, n]) => e || n)
3461
+ disabled$: El(t).pipe(
3462
+ Yr(ro(t, { workbookTypes: [po], rangeTypes: [go], worksheetTypes: [ho, mo] })),
3463
+ lo(([e, n]) => e || n)
3463
3464
  )
3464
3465
  };
3465
3466
  }
3466
- const Il = {
3467
- [ps.FORMULAS_INSERT]: {
3468
- [un.id]: {
3467
+ const yl = {
3468
+ [vs.FORMULAS_INSERT]: {
3469
+ [hn.id]: {
3469
3470
  order: 1,
3470
- menuItemFactory: Cl,
3471
- [fn.id]: {
3471
+ menuItemFactory: Rl,
3472
+ [dn.id]: {
3472
3473
  order: 1,
3473
- menuItemFactory: vl
3474
+ menuItemFactory: Il
3474
3475
  }
3475
3476
  }
3476
3477
  },
3477
- [Fr]: {
3478
- [an.id]: {
3478
+ [Ar]: {
3479
+ [fn.id]: {
3479
3480
  order: 4,
3480
- menuItemFactory: Rl
3481
+ menuItemFactory: bl
3481
3482
  }
3482
3483
  }
3483
- }, El = "meta_key_ctrl_And_Shift", Ut = [
3484
+ }, Nl = "meta_key_ctrl_And_Shift", Bt = [
3484
3485
  D.ARROW_DOWN,
3485
3486
  D.ARROW_UP,
3486
3487
  D.ARROW_LEFT,
3487
3488
  D.ARROW_RIGHT
3488
- ], bl = [...Ut, D.ENTER, D.TAB, D.ESC];
3489
- function Nl() {
3489
+ ], Tl = [...Bt, D.ENTER, D.TAB, D.ESC];
3490
+ function Fl() {
3490
3491
  const t = [];
3491
- for (const e of bl)
3492
+ for (const e of Tl)
3492
3493
  t.push({
3493
- id: ot.id,
3494
+ id: rt.id,
3494
3495
  binding: e,
3495
3496
  preconditions: (n) => St(n),
3496
3497
  staticParameters: {
3497
- eventType: Ne.Keyboard,
3498
+ eventType: ye.Keyboard,
3498
3499
  keycode: e
3499
3500
  }
3500
3501
  });
3501
3502
  return t;
3502
3503
  }
3503
- function yl() {
3504
+ function Ol() {
3504
3505
  const t = [];
3505
- for (const e of Ut)
3506
+ for (const e of Bt)
3506
3507
  t.push({
3507
- id: ot.id,
3508
+ id: rt.id,
3508
3509
  binding: e | U.SHIFT,
3509
3510
  preconditions: (n) => St(n),
3510
3511
  staticParameters: {
3511
- eventType: Ne.Keyboard,
3512
+ eventType: ye.Keyboard,
3512
3513
  keycode: e,
3513
3514
  metaKey: U.SHIFT
3514
3515
  }
3515
3516
  });
3516
3517
  return t;
3517
3518
  }
3518
- function Tl() {
3519
+ function Ml() {
3519
3520
  const t = [];
3520
- for (const e of Ut)
3521
+ for (const e of Bt)
3521
3522
  t.push({
3522
- id: ot.id,
3523
+ id: rt.id,
3523
3524
  binding: e | U.CTRL_COMMAND,
3524
3525
  preconditions: (n) => St(n),
3525
3526
  staticParameters: {
3526
- eventType: Ne.Keyboard,
3527
+ eventType: ye.Keyboard,
3527
3528
  keycode: e,
3528
3529
  metaKey: U.CTRL_COMMAND
3529
3530
  }
3530
3531
  });
3531
3532
  return t;
3532
3533
  }
3533
- function Fl() {
3534
+ function Al() {
3534
3535
  const t = [];
3535
- for (const e of Ut)
3536
+ for (const e of Bt)
3536
3537
  t.push({
3537
- id: ot.id,
3538
+ id: rt.id,
3538
3539
  binding: e | U.SHIFT | U.CTRL_COMMAND,
3539
3540
  preconditions: (n) => St(n),
3540
3541
  staticParameters: {
3541
- eventType: Ne.Keyboard,
3542
+ eventType: ye.Keyboard,
3542
3543
  keycode: e,
3543
- metaKey: El
3544
+ metaKey: Nl
3544
3545
  }
3545
3546
  });
3546
3547
  return t;
3547
3548
  }
3548
- const Ol = {
3549
- id: bo.id,
3549
+ const Pl = {
3550
+ id: No.id,
3550
3551
  binding: D.F4,
3551
3552
  preconditions: (t) => St(t)
3552
3553
  };
3553
- function Ml() {
3554
+ function xl() {
3554
3555
  const t = [];
3555
3556
  for (const e of [D.ENTER, D.TAB, D.ARROW_DOWN, D.ARROW_UP])
3556
3557
  t.push({
3557
- id: ot.id,
3558
+ id: rt.id,
3558
3559
  binding: e,
3559
- preconditions: (n) => sc(n),
3560
+ preconditions: (n) => lc(n),
3560
3561
  staticParameters: {
3561
- eventType: Ne.Keyboard,
3562
+ eventType: ye.Keyboard,
3562
3563
  keycode: e,
3563
3564
  isSingleEditor: !0
3564
3565
  }
3565
3566
  });
3566
3567
  return t;
3567
3568
  }
3568
- var Al = Object.getOwnPropertyDescriptor, Pl = (t, e, n, o) => {
3569
- for (var r = o > 1 ? void 0 : o ? Al(e, n) : e, s = t.length - 1, i; s >= 0; s--)
3569
+ var wl = Object.getOwnPropertyDescriptor, Dl = (t, e, n, o) => {
3570
+ for (var r = o > 1 ? void 0 : o ? wl(e, n) : e, s = t.length - 1, i; s >= 0; s--)
3570
3571
  (i = t[s]) && (r = i(r) || r);
3571
3572
  return r;
3572
- }, We = (t, e) => (n, o) => e(n, o, t);
3573
- let Pt = class extends pt {
3573
+ }, Ue = (t, e) => (n, o) => e(n, o, t);
3574
+ let wt = class extends pt {
3574
3575
  constructor(t, e, n, o, r, s, i) {
3575
3576
  super(), this._injector = t, this._menuManagerService = e, this._commandService = n, this._shortcutService = o, this._uiPartsService = r, this._renderManagerService = s, this._componentManager = i, this._initialize();
3576
3577
  }
@@ -3578,50 +3579,50 @@ let Pt = class extends pt {
3578
3579
  this._registerCommands(), this._registerMenus(), this._registerShortcuts(), this._registerComponents(), this._registerRenderModules();
3579
3580
  }
3580
3581
  _registerMenus() {
3581
- this._menuManagerService.mergeMenu(Il);
3582
+ this._menuManagerService.mergeMenu(yl);
3582
3583
  }
3583
3584
  _registerCommands() {
3584
3585
  [
3585
- an,
3586
- un,
3587
3586
  fn,
3588
- xs,
3589
- ys,
3590
- ot,
3591
- bo
3587
+ hn,
3588
+ dn,
3589
+ Ls,
3590
+ Os,
3591
+ rt,
3592
+ No
3592
3593
  ].forEach((t) => this.disposeWithMe(this._commandService.registerCommand(t)));
3593
3594
  }
3594
3595
  _registerShortcuts() {
3595
3596
  [
3596
- ...Nl(),
3597
- ...yl(),
3598
- ...Tl(),
3599
3597
  ...Fl(),
3598
+ ...Ol(),
3600
3599
  ...Ml(),
3601
- Ol
3600
+ ...Al(),
3601
+ ...xl(),
3602
+ Pl
3602
3603
  ].forEach((t) => {
3603
3604
  this.disposeWithMe(this._shortcutService.registerShortcut(t));
3604
3605
  });
3605
3606
  }
3606
3607
  _registerComponents() {
3607
- this.disposeWithMe(this._uiPartsService.registerComponent(Co.CONTENT, () => Xt(Jc, this._injector))), this.disposeWithMe(this._uiPartsService.registerComponent(Or.FORMULA_AUX, () => Xt(Tc, this._injector))), this._componentManager.register(Eo, Sl);
3608
+ this.disposeWithMe(this._uiPartsService.registerComponent(_o.CONTENT, () => Jt(nl, this._injector))), this.disposeWithMe(this._uiPartsService.registerComponent(Pr.FORMULA_AUX, () => Jt(Mc, this._injector))), this._componentManager.register(yo, _l);
3608
3609
  }
3609
3610
  _registerRenderModules() {
3610
- this.disposeWithMe(this._renderManagerService.registerRenderModule(ue.UNIVER_SHEET, [Mt]));
3611
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(ue.UNIVER_SHEET, [Pt]));
3611
3612
  }
3612
3613
  };
3613
- Pt = Pl([
3614
- We(0, K(mt)),
3615
- We(1, Ss),
3616
- We(2, ae),
3617
- We(3, Ht),
3618
- We(4, po),
3619
- We(5, ye),
3620
- We(6, K(So))
3621
- ], Pt);
3622
- const xl = () => {
3614
+ wt = Dl([
3615
+ Ue(0, K(mt)),
3616
+ Ue(1, _s),
3617
+ Ue(2, ae),
3618
+ Ue(3, Ut),
3619
+ Ue(4, Co),
3620
+ Ue(5, Ne),
3621
+ Ue(6, K(vo))
3622
+ ], wt);
3623
+ const Ll = () => {
3623
3624
  var o, r;
3624
- const t = O(Lo), e = Be(t.currentSelector$), n = j(null);
3625
+ const t = O(ko), e = qe(t.currentSelector$), n = j(null);
3625
3626
  return L(() => {
3626
3627
  var s, i;
3627
3628
  if (e)
@@ -3630,7 +3631,7 @@ const xl = () => {
3630
3631
  (c = n.current) == null || c.hideDialog();
3631
3632
  };
3632
3633
  }, [e]), /* @__PURE__ */ b(
3633
- Do,
3634
+ $o,
3634
3635
  {
3635
3636
  unitId: (o = e == null ? void 0 : e.unitId) != null ? o : "",
3636
3637
  subUnitId: (r = e == null ? void 0 : e.subUnitId) != null ? r : "",
@@ -3638,78 +3639,78 @@ const xl = () => {
3638
3639
  selectorRef: n,
3639
3640
  onChange: (s, i) => {
3640
3641
  var c;
3641
- e == null || e.callback((c = i == null ? void 0 : i.split(",").map((a) => nt(a))) != null ? c : []);
3642
+ e == null || e.callback((c = i == null ? void 0 : i.split(",").map((l) => ot(l))) != null ? c : []);
3642
3643
  }
3643
3644
  }
3644
3645
  );
3645
3646
  };
3646
- var wl = Object.defineProperty, Dl = Object.getOwnPropertyDescriptor, Ll = (t, e, n) => e in t ? wl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, kl = (t, e, n, o) => {
3647
- for (var r = o > 1 ? void 0 : o ? Dl(e, n) : e, s = t.length - 1, i; s >= 0; s--)
3647
+ var $l = Object.defineProperty, kl = Object.getOwnPropertyDescriptor, Hl = (t, e, n) => e in t ? $l(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Wl = (t, e, n, o) => {
3648
+ for (var r = o > 1 ? void 0 : o ? kl(e, n) : e, s = t.length - 1, i; s >= 0; s--)
3648
3649
  (i = t[s]) && (r = i(r) || r);
3649
3650
  return r;
3650
- }, bt = (t, e) => (n, o) => e(n, o, t), Wo = (t, e, n) => Ll(t, typeof e != "symbol" ? e + "" : e, n);
3651
- let xt = class extends ur {
3652
- constructor(t = Bn, e, n, o, r) {
3651
+ }, Nt = (t, e) => (n, o) => e(n, o, t), Vo = (t, e, n) => Hl(t, typeof e != "symbol" ? e + "" : e, n);
3652
+ let Dt = class extends dr {
3653
+ constructor(t = jn, e, n, o, r) {
3653
3654
  super(), this._config = t, this._injector = e, this._renderManagerService = n, this._configService = o, this._uiPartsService = r;
3654
- const { menu: s, ...i } = fr(
3655
- Bn,
3655
+ const { menu: s, ...i } = mr(
3656
+ jn,
3656
3657
  this._config
3657
3658
  );
3658
- s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(rc, i, { merge: !0 });
3659
+ s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(cc, i, { merge: !0 });
3659
3660
  }
3660
3661
  onStarting() {
3661
- hr(this._injector, [
3662
- [Ct, { useClass: Qt }],
3663
- [Lo],
3664
- [Pt],
3665
- [Ft],
3666
- [Ot],
3662
+ gr(this._injector, [
3663
+ [Ct, { useClass: en }],
3664
+ [ko],
3665
+ [wt],
3667
3666
  [Mt],
3668
- [At]
3667
+ [At],
3668
+ [Pt],
3669
+ [xt]
3669
3670
  ]);
3670
3671
  }
3671
3672
  onRendered() {
3672
3673
  [
3673
3674
  [De],
3674
- [en]
3675
+ [nn]
3675
3676
  ].forEach((t) => {
3676
3677
  this.disposeWithMe(this._renderManagerService.registerRenderModule(ue.UNIVER_SHEET, t));
3677
- }), dr(this._injector, [
3678
- [Pt],
3678
+ }), pr(this._injector, [
3679
+ [wt],
3679
3680
  // FormulaProgressBar relies on TriggerCalculationController, but it is necessary to ensure that the formula calculation is done after rendered.
3680
- [Ot],
3681
- [At]
3681
+ [At],
3682
+ [xt]
3682
3683
  ]), this._initUIPart();
3683
3684
  }
3684
3685
  onSteady() {
3685
- this._injector.get(Ft);
3686
+ this._injector.get(Mt);
3686
3687
  }
3687
3688
  _initUIPart() {
3688
- const t = this._injector.get(So);
3689
- this.disposeWithMe(t.register(Mr, Do)), this.disposeWithMe(t.register(Ar, Yi)), this.disposeWithMe(this._uiPartsService.registerComponent(Co.GLOBAL, () => Xt(xl, this._injector)));
3689
+ const t = this._injector.get(vo);
3690
+ this.disposeWithMe(t.register(xr, $o)), this.disposeWithMe(t.register(wr, Zi)), this.disposeWithMe(this._uiPartsService.registerComponent(_o.GLOBAL, () => Jt(Ll, this._injector)));
3690
3691
  }
3691
3692
  };
3692
- Wo(xt, "pluginName", Io);
3693
- Wo(xt, "type", ue.UNIVER_SHEET);
3694
- xt = kl([
3695
- lr(Ur, ls),
3696
- bt(1, K(mt)),
3697
- bt(2, ye),
3698
- bt(3, ar),
3699
- bt(4, po)
3700
- ], xt);
3693
+ Vo(Dt, "pluginName", bo);
3694
+ Vo(Dt, "type", ue.UNIVER_SHEET);
3695
+ Dt = Wl([
3696
+ fr(qr, fs),
3697
+ Nt(1, K(mt)),
3698
+ Nt(2, Ne),
3699
+ Nt(3, hr),
3700
+ Nt(4, Co)
3701
+ ], Dt);
3701
3702
  export {
3702
- Ns as FORMULA_PROMPT_ACTIVATED,
3703
- Yi as FormulaEditor,
3704
- Lo as GlobalRangeSelectorService,
3705
- ys as HelpFunctionOperation,
3706
- un as InsertFunctionOperation,
3707
- fn as MoreFunctionsOperation,
3708
- Do as RangeSelector,
3703
+ Fs as FORMULA_PROMPT_ACTIVATED,
3704
+ Zi as FormulaEditor,
3705
+ ko as GlobalRangeSelectorService,
3706
+ Os as HelpFunctionOperation,
3707
+ hn as InsertFunctionOperation,
3708
+ dn as MoreFunctionsOperation,
3709
+ $o as RangeSelector,
3709
3710
  De as RefSelectionsRenderService,
3710
- bo as ReferenceAbsoluteOperation,
3711
- xs as SearchFunctionOperation,
3712
- ot as SelectEditorFormulaOperation,
3713
- an as SheetOnlyPasteFormulaCommand,
3714
- xt as UniverSheetsFormulaUIPlugin
3711
+ No as ReferenceAbsoluteOperation,
3712
+ Ls as SearchFunctionOperation,
3713
+ rt as SelectEditorFormulaOperation,
3714
+ fn as SheetOnlyPasteFormulaCommand,
3715
+ Dt as UniverSheetsFormulaUIPlugin
3715
3716
  };