@univerjs/sheets-formula 0.8.1-nightly.202506151606 → 0.8.1-nightly.202506171607

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,16 +1,16 @@
1
1
  var Ya = Object.defineProperty;
2
2
  var Xa = (a, e, n) => e in a ? Ya(a, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[e] = n;
3
3
  var W = (a, e, n) => Xa(a, typeof e != "symbol" ? e + "" : e, n);
4
- import { CommandType as xt, ICommandService as ce, ObjectMatrix as Y, Tools as Ae, IUniverInstanceService as Ce, Rectangle as fe, sequenceExecuteAsync as Wa, isFormulaString as xe, isFormulaId as la, cellToRange as sa, Direction as Ye, getIntersectRange as we, RANGE_TYPE as w, Inject as X, Disposable as ae, UniverInstanceType as ee, LifecycleService as Ka, ILogService as ka, IConfigService as De, LocaleService as _t, Injector as rt, createIdentifier as yt, toDisposable as ie, moveRangeByOffset as Nt, DisposableCollection as Xe, AbsoluteRefType as We, Optional as Qa, InterceptorEffectEnum as $a, CellValueType as Gt, isRealNum as ja, DependentOn as da, Plugin as pa, merge as La, touchDependencies as he, isNodeEnv as Ht } from "@univerjs/core";
5
- import { SetRangeValuesCommand as Pa, SheetsSelectionsService as za, getSheetCommandTarget as Za, findFirstNonEmptyCell as Ja, alignToMergedCellsBorders as ct, expandToContinuousRange as en, SetSelectionsOperation as tn, SetRangeValuesMutation as te, handleMoveCols as Ta, EffectRefRangId as G, runRefRangeMutations as H, handleMoveRows as Ea, handleMoveRange as Ia, handleInsertRangeMoveRight as Na, handleInsertRangeMoveDown as Ra, handleDeleteRangeMoveUp as Sa, handleDeleteRangeMoveLeft as Aa, handleIRemoveCol as Ca, handleIRemoveRow as Da, handleInsertCol as ba, handleInsertRow as Oa, RemoveDefinedNameCommand as Ma, SetDefinedNameCommand as xa, RemoveSheetCommand as an, SetWorksheetNameCommand as nn, DeleteRangeMoveLeftCommand as rn, DeleteRangeMoveUpCommand as on, RemoveColCommand as un, RemoveRowCommand as mn, InsertRangeMoveDownCommand as fn, InsertRangeMoveRightCommand as cn, InsertColCommand as ln, InsertRowCommand as sn, MoveColsCommand as dn, MoveRowsCommand as pn, MoveRangeCommand as Ln, SheetInterceptorService as qt, SetStyleCommand as gt, SetBorderCommand as _a, ClearSelectionFormatCommand as ya, RemoveSheetMutation as Rt, InsertSheetMutation as St, RefRangeService as Pn, handleDefaultRangeChangeWithEffectRefCommands as wt, getSeparateEffectedRangesOnCommand as Tn, handleCommonDefaultRangeChangeWithEffectRefCommands as En, MoveRangeMutation as Yt, MoveRowsMutation as Xt, MoveColsMutation as Wt, ReorderRangeMutation as Kt, RemoveRowMutation as kt, RemoveColMutation as Qt, InsertColMutation as $t, InsertRowMutation as jt, SetRowHiddenMutation as zt, SetRowVisibleMutation as Zt, INTERCEPTOR_POINT as In, SetWorksheetActiveOperation as Nn, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as lt, UniverSheetsPlugin as Rn } from "@univerjs/sheets";
6
- import { serializeRange as Ke, sequenceNodeType as J, deserializeRangeWithSheetWithCache as pe, serializeRangeToRefString as ot, ErrorType as j, IDefinedNamesService as ht, LexerTreeBuilder as Ut, generateStringWithSequence as ke, SetDefinedNameMutation as ye, IActiveDirtyManagerService as Ft, SetFormulaCalculationResultMutation as Sn, RemoveOtherFormulaMutation as An, SetOtherFormulaMutation as Cn, FormulaDataModel as ut, SetFormulaCalculationStartMutation as Ie, SetFormulaCalculationStopMutation as Jt, ENGINE_FORMULA_CYCLE_REFERENCE_COUNT as ea, SetFormulaCalculationNotificationMutation as Dn, FormulaExecuteStageType as Ue, FormulaExecutedStateType as be, IFormulaCurrentConfigService as bn, Lexer as On, AstTreeBuilder as Mn, Interpreter as xn, generateExecuteAstNodeData as _n, getObjectValue as yn, SetFormulaDataMutation as Fe, SetArrayFormulaDataMutation as At, initSheetFormulaData as ta, FunctionType as t, FUNCTION_NAMES_ARRAY as aa, FUNCTION_NAMES_COMPATIBILITY as _, FUNCTION_NAMES_CUBE as se, FUNCTION_NAMES_DATABASE as $, FUNCTION_NAMES_DATE as B, FUNCTION_NAMES_ENGINEERING as S, FUNCTION_NAMES_FINANCIAL as C, FUNCTION_NAMES_INFORMATION as v, FUNCTION_NAMES_LOGICAL as K, FUNCTION_NAMES_LOOKUP as y, FUNCTION_NAMES_MATH as P, FUNCTION_NAMES_STATISTICAL as s, FUNCTION_NAMES_TEXT as D, FUNCTION_NAMES_WEB as st, IFunctionService as Bt, isReferenceStrings as qn, functionArray as gn, functionCompatibility as hn, functionCube as Un, functionDatabase as Fn, functionDate as Bn, functionEngineering as vn, functionFinancial as Vn, functionInformation as Gn, functionLogical as Hn, functionLookup as wn, functionMath as Yn, functionMeta as Xn, functionStatistical as Wn, functionText as Kn, functionUniver as kn, functionWeb as Qn, serializeRangeWithSpreadsheet as na, serializeRangeWithSheet as ia, CustomFunction as Ct, AsyncCustomFunction as qa, RemoveDefinedNameMutation as Dt, stripErrorMargin as $n, UniverFormulaEnginePlugin as ga } from "@univerjs/engine-formula";
4
+ import { CommandType as xt, ICommandService as ce, ObjectMatrix as G, Tools as Ae, IUniverInstanceService as Ce, Rectangle as fe, sequenceExecuteAsync as Wa, isFormulaString as xe, isFormulaId as la, cellToRange as sa, Direction as Xe, getIntersectRange as Ye, RANGE_TYPE as Y, Inject as X, Disposable as ae, UniverInstanceType as te, LifecycleService as Ka, ILogService as ka, IConfigService as De, LocaleService as _t, Injector as rt, createIdentifier as yt, toDisposable as ie, moveRangeByOffset as Nt, DisposableCollection as We, AbsoluteRefType as Ke, Optional as Qa, InterceptorEffectEnum as $a, CellValueType as Gt, isRealNum as ja, DependentOn as da, Plugin as pa, merge as La, touchDependencies as Ue, isNodeEnv as Ht } from "@univerjs/core";
5
+ import { SetRangeValuesCommand as Pa, SheetsSelectionsService as za, getSheetCommandTarget as Za, findFirstNonEmptyCell as Ja, alignToMergedCellsBorders as ct, expandToContinuousRange as en, SetSelectionsOperation as tn, SetRangeValuesMutation as Z, handleMoveCols as Ta, EffectRefRangId as H, runRefRangeMutations as w, handleMoveRows as Ea, handleMoveRange as Ia, handleInsertRangeMoveRight as Na, handleInsertRangeMoveDown as Ra, handleDeleteRangeMoveUp as Sa, handleDeleteRangeMoveLeft as Aa, handleIRemoveCol as Ca, handleIRemoveRow as Da, handleInsertCol as ba, handleInsertRow as Oa, RemoveDefinedNameCommand as Ma, SetDefinedNameCommand as xa, RemoveSheetCommand as an, SetWorksheetNameCommand as nn, DeleteRangeMoveLeftCommand as rn, DeleteRangeMoveUpCommand as on, RemoveColCommand as un, RemoveRowCommand as mn, InsertRangeMoveDownCommand as fn, InsertRangeMoveRightCommand as cn, InsertColCommand as ln, InsertRowCommand as sn, MoveColsCommand as dn, MoveRowsCommand as pn, MoveRangeCommand as Ln, SheetInterceptorService as qt, SetStyleCommand as gt, SetBorderCommand as _a, ClearSelectionFormatCommand as ya, RemoveSheetMutation as Rt, InsertSheetMutation as St, RefRangeService as Pn, handleDefaultRangeChangeWithEffectRefCommands as wt, getSeparateEffectedRangesOnCommand as Tn, handleCommonDefaultRangeChangeWithEffectRefCommands as En, MoveRangeMutation as Yt, MoveRowsMutation as Xt, MoveColsMutation as Wt, ReorderRangeMutation as Kt, RemoveRowMutation as kt, RemoveColMutation as Qt, InsertColMutation as $t, InsertRowMutation as jt, SetRowHiddenMutation as zt, SetRowVisibleMutation as Zt, INTERCEPTOR_POINT as In, SetWorksheetActiveOperation as Nn, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as lt, UniverSheetsPlugin as Rn } from "@univerjs/sheets";
6
+ import { serializeRange as ye, sequenceNodeType as ee, deserializeRangeWithSheetWithCache as pe, serializeRangeToRefString as ot, ErrorType as j, IDefinedNamesService as ht, LexerTreeBuilder as Ut, generateStringWithSequence as ke, SetDefinedNameMutation as qe, IActiveDirtyManagerService as Ft, SetFormulaCalculationResultMutation as Sn, RemoveOtherFormulaMutation as An, SetOtherFormulaMutation as Cn, FormulaDataModel as ut, SetFormulaCalculationStartMutation as Ie, SetFormulaCalculationStopMutation as Jt, ENGINE_FORMULA_CYCLE_REFERENCE_COUNT as ea, SetFormulaCalculationNotificationMutation as Dn, FormulaExecuteStageType as Fe, FormulaExecutedStateType as be, IFormulaCurrentConfigService as bn, Lexer as On, AstTreeBuilder as Mn, Interpreter as xn, generateExecuteAstNodeData as _n, getObjectValue as yn, SetFormulaDataMutation as Be, SetArrayFormulaDataMutation as At, initSheetFormulaData as ta, FunctionType as t, FUNCTION_NAMES_ARRAY as aa, FUNCTION_NAMES_COMPATIBILITY as _, FUNCTION_NAMES_CUBE as se, FUNCTION_NAMES_DATABASE as $, FUNCTION_NAMES_DATE as B, FUNCTION_NAMES_ENGINEERING as S, FUNCTION_NAMES_FINANCIAL as C, FUNCTION_NAMES_INFORMATION as v, FUNCTION_NAMES_LOGICAL as K, FUNCTION_NAMES_LOOKUP as y, FUNCTION_NAMES_MATH as P, FUNCTION_NAMES_STATISTICAL as s, FUNCTION_NAMES_TEXT as D, FUNCTION_NAMES_WEB as st, IFunctionService as Bt, isReferenceStrings as qn, functionArray as gn, functionCompatibility as hn, functionCube as Un, functionDatabase as Fn, functionDate as Bn, functionEngineering as vn, functionFinancial as Vn, functionInformation as Gn, functionLogical as Hn, functionLookup as wn, functionMath as Yn, functionMeta as Xn, functionStatistical as Wn, functionText as Kn, functionUniver as kn, functionWeb as Qn, serializeRangeWithSpreadsheet as na, serializeRangeWithSheet as ia, CustomFunction as Ct, AsyncCustomFunction as qa, RemoveDefinedNameMutation as Dt, stripErrorMargin as $n, UniverFormulaEnginePlugin as ga } from "@univerjs/engine-formula";
7
7
  import { Subject as ra, BehaviorSubject as ha, bufferWhen as jn, filter as oa, map as zn } from "rxjs";
8
8
  import { IRPCChannelService as Ua, fromModule as Zn, toModule as Jn } from "@univerjs/rpc";
9
9
  const ei = {
10
10
  id: "formula.command.insert-function",
11
11
  type: xt.COMMAND,
12
12
  handler: async (a, e) => {
13
- const { list: n, listOfRangeHasNumber: i } = e, r = a.get(ce), o = new Y();
13
+ const { list: n, listOfRangeHasNumber: i } = e, r = a.get(ce), o = new G();
14
14
  n.forEach((m) => {
15
15
  const { range: f, primary: c, formula: d } = m, { row: T, column: L } = c, E = Ae.generateRandomId(6);
16
16
  o.setValue(T, L, {
@@ -51,7 +51,7 @@ const ei = {
51
51
  startColumn: m.startColumn,
52
52
  endRow: o.endRow,
53
53
  endColumn: o.endColumn
54
- }, { left: !0, right: !0, up: !0, down: !0 }, u), c = new Y(), d = ct({
54
+ }, { left: !0, right: !0, up: !0, down: !0 }, u), c = new G(), d = ct({
55
55
  startRow: f.endRow,
56
56
  endRow: f.endRow,
57
57
  startColumn: f.startColumn,
@@ -60,7 +60,7 @@ const ei = {
60
60
  if (!fe.equals(d, f))
61
61
  for (const E of u.iterateByColumn(d))
62
62
  (!E.value || !u.cellHasValue(E.value)) && c.setValue(E.row, E.col, {
63
- f: `=SUM(${Ke({
63
+ f: `=SUM(${ye({
64
64
  startColumn: E.col,
65
65
  endColumn: E.col,
66
66
  startRow: f.startRow,
@@ -76,7 +76,7 @@ const ei = {
76
76
  if (!fe.equals(T, f))
77
77
  for (const E of u.iterateByRow(T))
78
78
  (!E.value || !u.cellHasValue(E.value)) && c.setValue(E.row, E.col, {
79
- f: `=SUM(${Ke({
79
+ f: `=SUM(${ye({
80
80
  startColumn: f.startColumn,
81
81
  endColumn: E.col - 1,
82
82
  startRow: E.row,
@@ -150,7 +150,7 @@ function ri(a, e) {
150
150
  if (o == null || u == null)
151
151
  return !0;
152
152
  Object.keys(o).forEach((m) => {
153
- const f = new Y(o[m] || {}), c = new Y(u[m] || {}), d = new Y(), T = new Y();
153
+ const f = new G(o[m] || {}), c = new G(u[m] || {}), d = new G(), T = new G();
154
154
  if (f.forValue((l, N, R) => {
155
155
  if (R == null)
156
156
  return !0;
@@ -163,7 +163,7 @@ function ri(a, e) {
163
163
  unitId: r,
164
164
  cellValue: d.getMatrix()
165
165
  }, E = {
166
- id: te.id,
166
+ id: Z.id,
167
167
  params: L
168
168
  };
169
169
  i.push(E);
@@ -172,7 +172,7 @@ function ri(a, e) {
172
172
  unitId: r,
173
173
  cellValue: T.getMatrix()
174
174
  }, A = {
175
- id: te.id,
175
+ id: Z.id,
176
176
  params: I
177
177
  };
178
178
  n.push(A);
@@ -198,7 +198,7 @@ function oi(a, e, n) {
198
198
  unitId: m,
199
199
  cellValue: i[m][f]
200
200
  }, d = {
201
- id: te.id,
201
+ id: Z.id,
202
202
  params: c
203
203
  };
204
204
  o.push(d);
@@ -212,7 +212,7 @@ function oi(a, e, n) {
212
212
  unitId: m,
213
213
  cellValue: r[m][f]
214
214
  }, d = {
215
- id: te.id,
215
+ id: Z.id,
216
216
  params: c
217
217
  };
218
218
  u.push(d);
@@ -233,7 +233,7 @@ function ui(a, e, n) {
233
233
  ...Object.keys(e[L] || {})
234
234
  ])).forEach((I) => {
235
235
  var F, U;
236
- const A = (F = a[L]) == null ? void 0 : F[I], l = (U = e[L]) == null ? void 0 : U[I], N = new Y(A || {}), R = new Y(l || {});
236
+ const A = (F = a[L]) == null ? void 0 : F[I], l = (U = e[L]) == null ? void 0 : U[I], N = new G(A || {}), R = new G(l || {});
237
237
  let p = [];
238
238
  L !== u || I !== m ? p = fi(R) : p = mi(N, o, c, d, f);
239
239
  const O = Ai(p, N, R), M = Ci(p, N);
@@ -325,115 +325,115 @@ function li(a, e, n) {
325
325
  function si(a, e, n) {
326
326
  const i = Ia(
327
327
  {
328
- id: G.MoveRangeCommandId,
328
+ id: H.MoveRangeCommandId,
329
329
  params: { toRange: e, fromRange: a }
330
330
  },
331
331
  n
332
332
  );
333
- return H(i, n);
333
+ return w(i, n);
334
334
  }
335
335
  function di(a, e, n) {
336
336
  const i = Ea(
337
337
  {
338
- id: G.MoveRowsCommandId,
338
+ id: H.MoveRowsCommandId,
339
339
  params: { toRange: e, fromRange: a }
340
340
  },
341
341
  n
342
342
  );
343
- return H(i, n);
343
+ return w(i, n);
344
344
  }
345
345
  function pi(a, e, n) {
346
346
  const i = Ta(
347
347
  {
348
- id: G.MoveColsCommandId,
348
+ id: H.MoveColsCommandId,
349
349
  params: { toRange: e, fromRange: a }
350
350
  },
351
351
  n
352
352
  );
353
- return H(i, n);
353
+ return w(i, n);
354
354
  }
355
355
  function Li(a, e) {
356
356
  const n = Oa(
357
357
  {
358
- id: G.InsertRowCommandId,
359
- params: { range: a, unitId: "", subUnitId: "", direction: Ye.DOWN }
358
+ id: H.InsertRowCommandId,
359
+ params: { range: a, unitId: "", subUnitId: "", direction: Xe.DOWN }
360
360
  },
361
361
  e
362
362
  );
363
- return H(n, e);
363
+ return w(n, e);
364
364
  }
365
365
  function Pi(a, e) {
366
366
  const n = ba(
367
367
  {
368
- id: G.InsertColCommandId,
369
- params: { range: a, unitId: "", subUnitId: "", direction: Ye.RIGHT }
368
+ id: H.InsertColCommandId,
369
+ params: { range: a, unitId: "", subUnitId: "", direction: Xe.RIGHT }
370
370
  },
371
371
  e
372
372
  );
373
- return H(n, e);
373
+ return w(n, e);
374
374
  }
375
375
  function Ti(a, e) {
376
376
  const n = Da(
377
377
  {
378
- id: G.RemoveRowCommandId,
378
+ id: H.RemoveRowCommandId,
379
379
  params: { range: a }
380
380
  },
381
381
  e
382
382
  );
383
- return H(n, e);
383
+ return w(n, e);
384
384
  }
385
385
  function Ei(a, e) {
386
386
  const n = Ca(
387
387
  {
388
- id: G.RemoveColCommandId,
388
+ id: H.RemoveColCommandId,
389
389
  params: { range: a }
390
390
  },
391
391
  e
392
392
  );
393
- return H(n, e);
393
+ return w(n, e);
394
394
  }
395
395
  function Ii(a, e) {
396
396
  const n = Aa(
397
397
  {
398
- id: G.DeleteRangeMoveLeftCommandId,
398
+ id: H.DeleteRangeMoveLeftCommandId,
399
399
  params: { range: a }
400
400
  },
401
401
  e
402
402
  );
403
- return H(n, e);
403
+ return w(n, e);
404
404
  }
405
405
  function Ni(a, e) {
406
406
  const n = Sa(
407
407
  {
408
- id: G.DeleteRangeMoveUpCommandId,
408
+ id: H.DeleteRangeMoveUpCommandId,
409
409
  params: { range: a }
410
410
  },
411
411
  e
412
412
  );
413
- return H(n, e);
413
+ return w(n, e);
414
414
  }
415
415
  function Ri(a, e) {
416
416
  const n = Ra(
417
417
  {
418
- id: G.InsertRangeMoveDownCommandId,
418
+ id: H.InsertRangeMoveDownCommandId,
419
419
  params: { range: a }
420
420
  },
421
421
  e
422
422
  );
423
- return H(n, e);
423
+ return w(n, e);
424
424
  }
425
425
  function Si(a, e) {
426
426
  const n = Na(
427
427
  {
428
- id: G.InsertRangeMoveRightCommandId,
428
+ id: H.InsertRangeMoveRightCommandId,
429
429
  params: { range: a }
430
430
  },
431
431
  e
432
432
  );
433
- return H(n, e);
433
+ return w(n, e);
434
434
  }
435
435
  function Ai(a, e, n) {
436
- const i = new Y({});
436
+ const i = new G({});
437
437
  return a.forEach((r) => {
438
438
  const { oldCell: o, newCell: u } = r, { startRow: m, startColumn: f } = o, c = n.getValue(m, f) || e.getValue(m, f), d = mt(c);
439
439
  if (i.setValue(m, f, { f: null, si: null }), u) {
@@ -443,7 +443,7 @@ function Ai(a, e, n) {
443
443
  }), i.getMatrix();
444
444
  }
445
445
  function Ci(a, e) {
446
- const n = new Y({});
446
+ const n = new G({});
447
447
  return a.reverse().forEach((i) => {
448
448
  const { oldCell: r, newCell: o } = i, { startRow: u, startColumn: m } = r, f = e.getValue(u, m), c = mt(f);
449
449
  if (o) {
@@ -466,8 +466,8 @@ function mt(a) {
466
466
  return u && (m.si = n), o && i === 0 && r === 0 && (m.f = e), m.f === void 0 && (m.f = null), m.si === void 0 && (m.si = null), m;
467
467
  }
468
468
  function Di(a) {
469
- const e = new Y({});
470
- return new Y(a).forValue((i, r, o) => {
469
+ const e = new G({});
470
+ return new G(a).forValue((i, r, o) => {
471
471
  const u = mt(o);
472
472
  u && e.setValue(i, r, u);
473
473
  }), e.getMatrix();
@@ -488,7 +488,7 @@ function va(a, e, n = 0, i = 0) {
488
488
  const r = [];
489
489
  for (let o = 0, u = a.length; o < u; o++) {
490
490
  const m = a[o];
491
- if (typeof m == "string" || m.nodeType !== J.REFERENCE || e.includes(o)) {
491
+ if (typeof m == "string" || m.nodeType !== ee.REFERENCE || e.includes(o)) {
492
492
  r.push(m);
493
493
  continue;
494
494
  }
@@ -527,13 +527,13 @@ function Va(a, e, n, i) {
527
527
  if (r === q.MoveRange) {
528
528
  if (f == null || c == null)
529
529
  return;
530
- const R = Lt(l, f), p = we(l, f);
530
+ const R = Lt(l, f), p = Ye(l, f);
531
531
  if (p == null || R !== 4)
532
532
  return;
533
533
  const O = Ia(
534
- { id: G.MoveRangeCommandId, params: { toRange: c, fromRange: f } },
534
+ { id: H.MoveRangeCommandId, params: { toRange: c, fromRange: f } },
535
535
  p
536
- ), M = H(O, p);
536
+ ), M = w(O, p);
537
537
  if (M == null)
538
538
  return j.REF;
539
539
  N = pt(R, M, f, c, l, p);
@@ -541,7 +541,7 @@ function Va(a, e, n, i) {
541
541
  if (f == null || c == null)
542
542
  return;
543
543
  const R = Lt(l, f);
544
- let p = we(l, f);
544
+ let p = Ye(l, f);
545
545
  if (p == null && (f.endRow < l.startRow && c.endRow < l.startRow || f.startRow > l.endRow && c.startRow > l.endRow))
546
546
  return;
547
547
  p == null && (p = {
@@ -549,12 +549,12 @@ function Va(a, e, n, i) {
549
549
  endRow: l.endRow,
550
550
  startColumn: l.startColumn,
551
551
  endColumn: l.endColumn,
552
- rangeType: w.NORMAL
552
+ rangeType: Y.NORMAL
553
553
  });
554
554
  const O = Ea(
555
- { id: G.MoveRowsCommandId, params: { toRange: c, fromRange: f } },
555
+ { id: H.MoveRowsCommandId, params: { toRange: c, fromRange: f } },
556
556
  p
557
- ), M = H(O, p);
557
+ ), M = w(O, p);
558
558
  if (M == null)
559
559
  return j.REF;
560
560
  N = pt(R, M, f, c, l, p);
@@ -562,7 +562,7 @@ function Va(a, e, n, i) {
562
562
  if (f == null || c == null)
563
563
  return;
564
564
  const R = Lt(l, f);
565
- let p = we(l, f);
565
+ let p = Ye(l, f);
566
566
  if (p == null && (f.endColumn < l.startColumn && c.endColumn < l.startColumn || f.startColumn > l.endColumn && c.startColumn > l.endColumn))
567
567
  return;
568
568
  p == null && (p = {
@@ -570,12 +570,12 @@ function Va(a, e, n, i) {
570
570
  endRow: l.endRow,
571
571
  startColumn: l.startColumn,
572
572
  endColumn: l.endColumn,
573
- rangeType: w.NORMAL
573
+ rangeType: Y.NORMAL
574
574
  });
575
575
  const O = Ta(
576
- { id: G.MoveColsCommandId, params: { toRange: c, fromRange: f } },
576
+ { id: H.MoveColsCommandId, params: { toRange: c, fromRange: f } },
577
577
  p
578
- ), M = H(O, p);
578
+ ), M = w(O, p);
579
579
  if (M == null)
580
580
  return j.REF;
581
581
  N = pt(R, M, f, c, l, p);
@@ -584,11 +584,11 @@ function Va(a, e, n, i) {
584
584
  if (r === q.InsertRow) {
585
585
  const R = Oa(
586
586
  {
587
- id: G.InsertRowCommandId,
588
- params: { range: m, unitId: "", subUnitId: "", direction: Ye.DOWN }
587
+ id: H.InsertRowCommandId,
588
+ params: { range: m, unitId: "", subUnitId: "", direction: Xe.DOWN }
589
589
  },
590
590
  l
591
- ), p = H(R, l);
591
+ ), p = w(R, l);
592
592
  if (p == null)
593
593
  return;
594
594
  N = {
@@ -598,11 +598,11 @@ function Va(a, e, n, i) {
598
598
  } else if (r === q.InsertColumn) {
599
599
  const R = ba(
600
600
  {
601
- id: G.InsertColCommandId,
602
- params: { range: m, unitId: "", subUnitId: "", direction: Ye.RIGHT }
601
+ id: H.InsertColCommandId,
602
+ params: { range: m, unitId: "", subUnitId: "", direction: Xe.RIGHT }
603
603
  },
604
604
  l
605
- ), p = H(R, l);
605
+ ), p = w(R, l);
606
606
  if (p == null)
607
607
  return;
608
608
  N = {
@@ -612,11 +612,11 @@ function Va(a, e, n, i) {
612
612
  } else if (r === q.RemoveRow) {
613
613
  const R = Da(
614
614
  {
615
- id: G.RemoveRowCommandId,
615
+ id: H.RemoveRowCommandId,
616
616
  params: { range: m }
617
617
  },
618
618
  l
619
- ), p = H(R, l);
619
+ ), p = w(R, l);
620
620
  if (p == null)
621
621
  return j.REF;
622
622
  N = {
@@ -626,11 +626,11 @@ function Va(a, e, n, i) {
626
626
  } else if (r === q.RemoveColumn) {
627
627
  const R = Ca(
628
628
  {
629
- id: G.RemoveColCommandId,
629
+ id: H.RemoveColCommandId,
630
630
  params: { range: m }
631
631
  },
632
632
  l
633
- ), p = H(R, l);
633
+ ), p = w(R, l);
634
634
  if (p == null)
635
635
  return j.REF;
636
636
  N = {
@@ -640,11 +640,11 @@ function Va(a, e, n, i) {
640
640
  } else if (r === q.DeleteMoveLeft) {
641
641
  const R = Aa(
642
642
  {
643
- id: G.DeleteRangeMoveLeftCommandId,
643
+ id: H.DeleteRangeMoveLeftCommandId,
644
644
  params: { range: m }
645
645
  },
646
646
  l
647
- ), p = H(R, l);
647
+ ), p = w(R, l);
648
648
  if (p == null)
649
649
  return j.REF;
650
650
  N = {
@@ -654,11 +654,11 @@ function Va(a, e, n, i) {
654
654
  } else if (r === q.DeleteMoveUp) {
655
655
  const R = Sa(
656
656
  {
657
- id: G.DeleteRangeMoveUpCommandId,
657
+ id: H.DeleteRangeMoveUpCommandId,
658
658
  params: { range: m }
659
659
  },
660
660
  l
661
- ), p = H(R, l);
661
+ ), p = w(R, l);
662
662
  if (p == null)
663
663
  return j.REF;
664
664
  N = {
@@ -668,11 +668,11 @@ function Va(a, e, n, i) {
668
668
  } else if (r === q.InsertMoveDown) {
669
669
  const R = Ra(
670
670
  {
671
- id: G.InsertRangeMoveDownCommandId,
671
+ id: H.InsertRangeMoveDownCommandId,
672
672
  params: { range: m }
673
673
  },
674
674
  l
675
- ), p = H(R, l);
675
+ ), p = w(R, l);
676
676
  if (p == null)
677
677
  return;
678
678
  N = {
@@ -682,11 +682,11 @@ function Va(a, e, n, i) {
682
682
  } else if (r === q.InsertMoveRight) {
683
683
  const R = Na(
684
684
  {
685
- id: G.InsertRangeMoveRightCommandId,
685
+ id: H.InsertRangeMoveRightCommandId,
686
686
  params: { range: m }
687
687
  },
688
688
  l
689
- ), p = H(R, l);
689
+ ), p = w(R, l);
690
690
  if (p == null)
691
691
  return;
692
692
  N = {
@@ -708,7 +708,7 @@ function pt(a, e, n, i, r, o) {
708
708
  startColumn: L,
709
709
  endRow: E,
710
710
  endColumn: I,
711
- rangeType: A = w.NORMAL
711
+ rangeType: A = Y.NORMAL
712
712
  } = Oe(n), { startRow: l, startColumn: N, endRow: R, endColumn: p } = Oe(i), {
713
713
  startRow: O,
714
714
  endRow: M,
@@ -719,13 +719,13 @@ function pt(a, e, n, i, r, o) {
719
719
  endRow: x,
720
720
  startColumn: h,
721
721
  endColumn: V,
722
- rangeType: Q = w.NORMAL
722
+ rangeType: Q = Y.NORMAL
723
723
  } = Oe(r), b = { ...r };
724
724
  function Pe() {
725
- return d === w.COLUMN && Q === w.COLUMN ? !0 : f >= h && c <= V;
725
+ return d === Y.COLUMN && Q === Y.COLUMN ? !0 : f >= h && c <= V;
726
726
  }
727
727
  function ne() {
728
- return d === w.ROW && Q === w.ROW ? !0 : u >= g && m <= x;
728
+ return d === Y.ROW && Q === Y.ROW ? !0 : u >= g && m <= x;
729
729
  }
730
730
  if (a === 0)
731
731
  if (Pe())
@@ -767,19 +767,19 @@ function pt(a, e, n, i, r, o) {
767
767
  return;
768
768
  else
769
769
  return;
770
- else a === 4 ? (b.startRow = u, b.startColumn = f, b.endRow = m, b.endColumn = c) : L <= h && I >= V || A === w.ROW && Q === w.ROW ? n.endRow < g ? (l >= g && (b.startRow -= E - T + 1), l >= x && (b.endRow -= E - T + 1)) : n.startRow > x ? (R <= x && (b.endRow += E - T + 1), R <= g && (b.startRow += E - T + 1)) : n.startRow >= g && n.endRow <= x && (l <= g ? b.startRow += E - T + 1 : l >= x && (b.endRow -= E - T + 1)) : T <= g && E >= x || A === w.COLUMN && Q === w.COLUMN ? n.endColumn < h ? (N >= h && (b.startColumn -= I - L + 1), N >= V && (b.endColumn -= I - L + 1)) : n.startColumn > V ? (p <= V && (b.endColumn += I - L + 1), p <= h && (b.startColumn += I - L + 1)) : n.startColumn >= h && n.endColumn <= V && (N <= h ? b.startColumn += I - L + 1 : N >= V && (b.endColumn -= I - L + 1)) : ((N <= U + 1 && p >= V || N <= h && p >= F - 1) && l <= g && R >= x || (l <= M + 1 && R >= x || l <= g && R >= O - 1) && N <= h && p >= V, b.startRow = u, b.startColumn = f, b.endRow = m, b.endColumn = c);
770
+ else a === 4 ? (b.startRow = u, b.startColumn = f, b.endRow = m, b.endColumn = c) : L <= h && I >= V || A === Y.ROW && Q === Y.ROW ? n.endRow < g ? (l >= g && (b.startRow -= E - T + 1), l >= x && (b.endRow -= E - T + 1)) : n.startRow > x ? (R <= x && (b.endRow += E - T + 1), R <= g && (b.startRow += E - T + 1)) : n.startRow >= g && n.endRow <= x && (l <= g ? b.startRow += E - T + 1 : l >= x && (b.endRow -= E - T + 1)) : T <= g && E >= x || A === Y.COLUMN && Q === Y.COLUMN ? n.endColumn < h ? (N >= h && (b.startColumn -= I - L + 1), N >= V && (b.endColumn -= I - L + 1)) : n.startColumn > V ? (p <= V && (b.endColumn += I - L + 1), p <= h && (b.startColumn += I - L + 1)) : n.startColumn >= h && n.endColumn <= V && (N <= h ? b.startColumn += I - L + 1 : N >= V && (b.endColumn -= I - L + 1)) : ((N <= U + 1 && p >= V || N <= h && p >= F - 1) && l <= g && R >= x || (l <= M + 1 && R >= x || l <= g && R >= O - 1) && N <= h && p >= V, b.startRow = u, b.startColumn = f, b.endRow = m, b.endColumn = c);
771
771
  return b;
772
772
  }
773
773
  function Lt(a, e) {
774
774
  const n = Re(a.startRow), i = Se(a.endRow), r = Re(a.startColumn), o = Se(a.endColumn), u = Re(e.startRow), m = Se(e.endRow), f = Re(e.startColumn), c = Se(e.endColumn);
775
775
  function d() {
776
- return a.rangeType === w.COLUMN && e.rangeType === w.COLUMN ? !0 : n >= u && i <= m;
776
+ return a.rangeType === Y.COLUMN && e.rangeType === Y.COLUMN ? !0 : n >= u && i <= m;
777
777
  }
778
778
  function T() {
779
- return a.rangeType === w.ROW && e.rangeType === w.ROW ? !0 : r >= f && o <= c;
779
+ return a.rangeType === Y.ROW && e.rangeType === Y.ROW ? !0 : r >= f && o <= c;
780
780
  }
781
781
  function L() {
782
- return a.rangeType === w.ALL && e.rangeType === w.ALL;
782
+ return a.rangeType === Y.ALL && e.rangeType === Y.ALL;
783
783
  }
784
784
  return d() && T() || L() ? 4 : T() && n >= u && n <= m && i > m ? 0 : T() && i >= u && i <= m && n < u ? 1 : d() && r >= f && r <= c && o > c ? 2 : d() && o >= f && o <= c && r < f ? 3 : null;
785
785
  }
@@ -851,7 +851,7 @@ function Ga(a, e) {
851
851
  }
852
852
  return i;
853
853
  }
854
- function Z(a) {
854
+ function J(a) {
855
855
  var i;
856
856
  const e = a.getUnitId(), n = ((i = a.getActiveSheet()) == null ? void 0 : i.getSheetId()) || "";
857
857
  return {
@@ -864,7 +864,7 @@ function bi(a, e) {
864
864
  if (!n) return null;
865
865
  const { fromRange: i, toRange: r } = n;
866
866
  if (!i || !r) return null;
867
- const { unitId: o, sheetId: u } = Z(e);
867
+ const { unitId: o, sheetId: u } = J(e);
868
868
  return {
869
869
  type: q.MoveRange,
870
870
  from: i,
@@ -886,13 +886,13 @@ function Oi(a, e) {
886
886
  startColumn: 0,
887
887
  endRow: r,
888
888
  endColumn: f.getColumnCount() - 1,
889
- rangeType: w.ROW
889
+ rangeType: Y.ROW
890
890
  }, T = {
891
891
  startRow: o,
892
892
  startColumn: 0,
893
893
  endRow: u,
894
894
  endColumn: f.getColumnCount() - 1,
895
- rangeType: w.ROW
895
+ rangeType: Y.ROW
896
896
  };
897
897
  return {
898
898
  type: q.MoveRows,
@@ -915,13 +915,13 @@ function Mi(a, e) {
915
915
  startColumn: i,
916
916
  endRow: f.getRowCount() - 1,
917
917
  endColumn: r,
918
- rangeType: w.COLUMN
918
+ rangeType: Y.COLUMN
919
919
  }, T = {
920
920
  startRow: 0,
921
921
  startColumn: o,
922
922
  endRow: f.getRowCount() - 1,
923
923
  endColumn: u,
924
- rangeType: w.COLUMN
924
+ rangeType: Y.COLUMN
925
925
  };
926
926
  return {
927
927
  type: q.MoveCols,
@@ -956,7 +956,7 @@ function _i(a) {
956
956
  function yi(a, e) {
957
957
  const { params: n } = a;
958
958
  if (!n) return null;
959
- const { range: i } = n, { unitId: r, sheetId: o } = Z(e);
959
+ const { range: i } = n, { unitId: r, sheetId: o } = J(e);
960
960
  return {
961
961
  type: q.InsertMoveRight,
962
962
  range: i,
@@ -967,7 +967,7 @@ function yi(a, e) {
967
967
  function qi(a, e) {
968
968
  const { params: n } = a;
969
969
  if (!n) return null;
970
- const { range: i } = n, { unitId: r, sheetId: o } = Z(e);
970
+ const { range: i } = n, { unitId: r, sheetId: o } = J(e);
971
971
  return {
972
972
  type: q.InsertMoveDown,
973
973
  range: i,
@@ -978,7 +978,7 @@ function qi(a, e) {
978
978
  function gi(a, e) {
979
979
  const { params: n } = a;
980
980
  if (!n) return null;
981
- const { range: i } = n, { unitId: r, sheetId: o } = Z(e);
981
+ const { range: i } = n, { unitId: r, sheetId: o } = J(e);
982
982
  return {
983
983
  type: q.RemoveRow,
984
984
  range: i,
@@ -989,7 +989,7 @@ function gi(a, e) {
989
989
  function hi(a, e) {
990
990
  const { params: n } = a;
991
991
  if (!n) return null;
992
- const { range: i } = n, { unitId: r, sheetId: o } = Z(e);
992
+ const { range: i } = n, { unitId: r, sheetId: o } = J(e);
993
993
  return {
994
994
  type: q.RemoveColumn,
995
995
  range: i,
@@ -1000,7 +1000,7 @@ function hi(a, e) {
1000
1000
  function Ui(a, e) {
1001
1001
  const { params: n } = a;
1002
1002
  if (!n) return null;
1003
- const { range: i } = n, { unitId: r, sheetId: o } = Z(e);
1003
+ const { range: i } = n, { unitId: r, sheetId: o } = J(e);
1004
1004
  return {
1005
1005
  type: q.DeleteMoveUp,
1006
1006
  range: i,
@@ -1011,7 +1011,7 @@ function Ui(a, e) {
1011
1011
  function Fi(a, e) {
1012
1012
  const { params: n } = a;
1013
1013
  if (!n) return null;
1014
- const { range: i } = n, { unitId: r, sheetId: o } = Z(e);
1014
+ const { range: i } = n, { unitId: r, sheetId: o } = J(e);
1015
1015
  return {
1016
1016
  type: q.DeleteMoveLeft,
1017
1017
  range: i,
@@ -1022,7 +1022,7 @@ function Fi(a, e) {
1022
1022
  function Bi(a, e) {
1023
1023
  const { params: n } = a;
1024
1024
  if (!n) return null;
1025
- const { unitId: i, subUnitId: r, name: o } = n, { unitId: u, sheetId: m } = Z(e);
1025
+ const { unitId: i, subUnitId: r, name: o } = n, { unitId: u, sheetId: m } = J(e);
1026
1026
  return {
1027
1027
  type: q.SetName,
1028
1028
  unitId: i || u,
@@ -1033,7 +1033,7 @@ function Bi(a, e) {
1033
1033
  function vi(a, e) {
1034
1034
  const { params: n } = a;
1035
1035
  if (!n) return null;
1036
- const { unitId: i, subUnitId: r } = n, { unitId: o, sheetId: u } = Z(e);
1036
+ const { unitId: i, subUnitId: r } = n, { unitId: o, sheetId: u } = J(e);
1037
1037
  return {
1038
1038
  type: q.RemoveSheet,
1039
1039
  unitId: i || o,
@@ -1043,7 +1043,7 @@ function vi(a, e) {
1043
1043
  function Vi(a, e) {
1044
1044
  const { params: n } = a;
1045
1045
  if (!n) return null;
1046
- const { unitId: i, name: r, id: o } = n, { sheetId: u } = Z(e);
1046
+ const { unitId: i, name: r, id: o } = n, { sheetId: u } = J(e);
1047
1047
  return {
1048
1048
  type: q.SetDefinedName,
1049
1049
  unitId: i,
@@ -1055,7 +1055,7 @@ function Vi(a, e) {
1055
1055
  function Gi(a, e) {
1056
1056
  const { params: n } = a;
1057
1057
  if (!n) return null;
1058
- const { unitId: i, name: r, id: o } = n, { sheetId: u } = Z(e);
1058
+ const { unitId: i, name: r, id: o } = n, { sheetId: u } = J(e);
1059
1059
  return {
1060
1060
  type: q.RemoveDefinedName,
1061
1061
  unitId: i,
@@ -1068,7 +1068,7 @@ var Hi = Object.getOwnPropertyDescriptor, wi = (a, e, n, i) => {
1068
1068
  for (var r = i > 1 ? void 0 : i ? Hi(e, n) : e, o = a.length - 1, u; o >= 0; o--)
1069
1069
  (u = a[o]) && (r = u(r) || r);
1070
1070
  return r;
1071
- }, Be = (a, e) => (n, i) => e(n, i, a);
1071
+ }, ve = (a, e) => (n, i) => e(n, i, a);
1072
1072
  let Qe = class extends ae {
1073
1073
  constructor(a, e, n, i) {
1074
1074
  super(), this._definedNamesService = a, this._univerInstanceService = e, this._sheetInterceptorService = n, this._lexerTreeBuilder = i, this._initialize();
@@ -1085,7 +1085,7 @@ let Qe = class extends ae {
1085
1085
  redos: [],
1086
1086
  undos: []
1087
1087
  };
1088
- const e = this._univerInstanceService.getCurrentUnitForType(ee.UNIVER_SHEET);
1088
+ const e = this._univerInstanceService.getCurrentUnitForType(te.UNIVER_SHEET);
1089
1089
  if (e == null)
1090
1090
  return {
1091
1091
  redos: [],
@@ -1118,7 +1118,7 @@ let Qe = class extends ae {
1118
1118
  const L = [];
1119
1119
  for (let N = 0, R = d.length; N < R; N++) {
1120
1120
  const p = d[N];
1121
- if (typeof p == "string" || p.nodeType !== J.REFERENCE)
1121
+ if (typeof p == "string" || p.nodeType !== ee.REFERENCE)
1122
1122
  continue;
1123
1123
  const { token: O } = p, M = pe(O), { range: F, sheetName: U, unitId: g } = M, x = ((l = a.getSheetBySheetName(U)) == null ? void 0 : l.getSheetId()) || "", h = {
1124
1124
  range: F,
@@ -1158,7 +1158,7 @@ let Qe = class extends ae {
1158
1158
  if (!T)
1159
1159
  return !0;
1160
1160
  const E = ke(va(d, L)), I = {
1161
- id: ye.id,
1161
+ id: qe.id,
1162
1162
  params: {
1163
1163
  unitId: i,
1164
1164
  ...f,
@@ -1167,7 +1167,7 @@ let Qe = class extends ae {
1167
1167
  };
1168
1168
  u.push(I);
1169
1169
  const A = {
1170
- id: ye.id,
1170
+ id: qe.id,
1171
1171
  params: {
1172
1172
  unitId: i,
1173
1173
  ...f
@@ -1186,10 +1186,10 @@ let Qe = class extends ae {
1186
1186
  }
1187
1187
  };
1188
1188
  Qe = wi([
1189
- Be(0, ht),
1190
- Be(1, Ce),
1191
- Be(2, X(qt)),
1192
- Be(3, X(Ut))
1189
+ ve(0, ht),
1190
+ ve(1, Ce),
1191
+ ve(2, X(qt)),
1192
+ ve(3, X(Ut))
1193
1193
  ], Qe);
1194
1194
  var Ne = /* @__PURE__ */ ((a) => (a[a.NOT_REGISTER = 1] = "NOT_REGISTER", a[a.SUCCESS = 2] = "SUCCESS", a[a.WAIT = 3] = "WAIT", a[a.ERROR = 4] = "ERROR", a))(Ne || {}), Yi = Object.getOwnPropertyDescriptor, Xi = (a, e, n, i) => {
1195
1195
  for (var r = i > 1 ? void 0 : i ? Yi(e, n) : e, o = a.length - 1, u; o >= 0; o--)
@@ -1276,7 +1276,7 @@ let $e = class extends ae {
1276
1276
  if (!I)
1277
1277
  continue;
1278
1278
  I.result || (I.result = {});
1279
- const A = new Y(E), l = new Y(I.result);
1279
+ const A = new G(E), l = new G(I.result);
1280
1280
  A.forValue((N, R, p) => {
1281
1281
  l.setValue(N, R, p);
1282
1282
  }), I.status = Ne.SUCCESS, I.callbacks.forEach((N) => {
@@ -1340,7 +1340,7 @@ $e = Xi([
1340
1340
  Pt(1, Ft),
1341
1341
  Pt(2, X(Ka))
1342
1342
  ], $e);
1343
- const qe = "sheets-formula.base.config";
1343
+ const ge = "sheets-formula.base.config";
1344
1344
  var Le = /* @__PURE__ */ ((a) => (a[a.FORCED = 0] = "FORCED", a[a.WHEN_EMPTY = 1] = "WHEN_EMPTY", a[a.NO_CALCULATION = 2] = "NO_CALCULATION", a))(Le || {});
1345
1345
  const ua = {}, Wi = "sheets-formula.remote.config", ma = {};
1346
1346
  var Ki = Object.getOwnPropertyDescriptor, ki = (a, e, n, i) => {
@@ -1405,7 +1405,7 @@ let _e = class extends ae {
1405
1405
  }
1406
1406
  _getCalculationMode() {
1407
1407
  var n;
1408
- const e = this._configService.getConfig(qe);
1408
+ const e = this._configService.getConfig(ge);
1409
1409
  return (n = e == null ? void 0 : e.initialFormulaComputing) != null ? n : Le.WHEN_EMPTY;
1410
1410
  }
1411
1411
  _commandExecutedListener() {
@@ -1419,7 +1419,7 @@ let _e = class extends ae {
1419
1419
  ), this.disposeWithMe(
1420
1420
  this._commandService.onCommandExecuted((e, n) => {
1421
1421
  if (this._activeDirtyManagerService.get(e.id)) {
1422
- if (e.id === te.id) {
1422
+ if (e.id === Z.id) {
1423
1423
  const i = e.params;
1424
1424
  if (n && n.onlyLocal === !0 || i.trigger === gt.id || i.trigger === _a.id || i.trigger === ya.id)
1425
1425
  return;
@@ -1521,21 +1521,21 @@ let _e = class extends ae {
1521
1521
  const {
1522
1522
  stage: o
1523
1523
  } = r.stageInfo;
1524
- if (o === Ue.START)
1524
+ if (o === Fe.START)
1525
1525
  n === 0 && (this._startExecutionTime = performance.now()), n++, e !== null && (clearTimeout(e), e = null), e = setTimeout(() => {
1526
1526
  e = null, this._startProgress();
1527
1527
  }, 1e3);
1528
- else if (o === Ue.CURRENTLY_CALCULATING) {
1528
+ else if (o === Fe.CURRENTLY_CALCULATING) {
1529
1529
  if (this._executionInProgressParams = r.stageInfo, e === null) {
1530
1530
  const u = this._localeService.t("formula.progress.calculating");
1531
1531
  this._calculateProgress(u);
1532
1532
  }
1533
- } else if (o === Ue.START_DEPENDENCY_ARRAY_FORMULA) {
1533
+ } else if (o === Fe.START_DEPENDENCY_ARRAY_FORMULA) {
1534
1534
  if (this._executionInProgressParams = r.stageInfo, e === null) {
1535
1535
  const u = this._localeService.t("formula.progress.array-analysis");
1536
1536
  this._calculateProgress(u);
1537
1537
  }
1538
- } else if (o === Ue.CURRENTLY_CALCULATING_ARRAY_FORMULA && (this._executionInProgressParams = r.stageInfo, e === null)) {
1538
+ } else if (o === Fe.CURRENTLY_CALCULATING_ARRAY_FORMULA && (this._executionInProgressParams = r.stageInfo, e === null)) {
1539
1539
  const u = this._localeService.t("formula.progress.array-calculation");
1540
1540
  this._calculateProgress(u);
1541
1541
  }
@@ -1647,14 +1647,14 @@ let je = class extends ae {
1647
1647
  })
1648
1648
  ), this.disposeWithMe(
1649
1649
  this._commandService.beforeCommandExecuted((a, e) => {
1650
- if (a.id === te.id) {
1650
+ if (a.id === Z.id) {
1651
1651
  const n = a.params;
1652
1652
  if (e && e.onlyLocal === !0 || n.trigger === gt.id || n.trigger === _a.id || n.trigger === ya.id)
1653
1653
  return;
1654
1654
  this._handleSetRangeValuesMutation(n);
1655
1655
  }
1656
1656
  })
1657
- ), this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(ee.UNIVER_SHEET).subscribe((a) => this._handleWorkbookAdded(a))), this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(ee.UNIVER_SHEET).pipe(zn((a) => a.getUnitId())).subscribe((a) => this._handleWorkbookDisposed(a)));
1657
+ ), this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(te.UNIVER_SHEET).subscribe((a) => this._handleWorkbookAdded(a))), this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(te.UNIVER_SHEET).pipe(zn((a) => a.getUnitId())).subscribe((a) => this._handleWorkbookDisposed(a)));
1658
1658
  }
1659
1659
  _handleSetRangeValuesMutation(a) {
1660
1660
  const { subUnitId: e, unitId: n, cellValue: i } = a;
@@ -1666,7 +1666,7 @@ let je = class extends ae {
1666
1666
  }
1667
1667
  };
1668
1668
  this._commandService.executeCommand(
1669
- te.id,
1669
+ Z.id,
1670
1670
  {
1671
1671
  unitId: n,
1672
1672
  subUnitId: e,
@@ -1677,7 +1677,7 @@ let je = class extends ae {
1677
1677
  fromFormula: !0
1678
1678
  }
1679
1679
  ), this._formulaDataModel.updateArrayFormulaCellData(n, e, i), this._formulaDataModel.updateArrayFormulaRange(n, e, i), this._commandService.executeCommand(
1680
- Fe.id,
1680
+ Be.id,
1681
1681
  {
1682
1682
  formulaData: o
1683
1683
  },
@@ -1700,7 +1700,7 @@ let je = class extends ae {
1700
1700
  _handleWorkbookDisposed(a, e) {
1701
1701
  const n = this._formulaDataModel.getFormulaData(), i = dt(n, a, e), r = this._formulaDataModel.getArrayFormulaRange(), o = dt(r, a, e), u = this._formulaDataModel.getArrayFormulaCellData(), m = dt(u, a, e);
1702
1702
  i && this._commandService.executeCommand(
1703
- Fe.id,
1703
+ Be.id,
1704
1704
  {
1705
1705
  formulaData: i
1706
1706
  },
@@ -1719,9 +1719,9 @@ let je = class extends ae {
1719
1719
  );
1720
1720
  }
1721
1721
  _handleInsertSheetMutation(a) {
1722
- const { sheet: e, unitId: n } = a, i = this._formulaDataModel.getFormulaData(), { id: r, cellData: o } = e, u = new Y(o), m = ta(i, n, r, u);
1722
+ const { sheet: e, unitId: n } = a, i = this._formulaDataModel.getFormulaData(), { id: r, cellData: o } = e, u = new G(o), m = ta(i, n, r, u);
1723
1723
  this._commandService.executeCommand(
1724
- Fe.id,
1724
+ Be.id,
1725
1725
  {
1726
1726
  formulaData: m
1727
1727
  },
@@ -1737,8 +1737,8 @@ let je = class extends ae {
1737
1737
  var E;
1738
1738
  const d = c.getCellMatrix(), T = c.getSheetId(), L = ta(e, n, T, d);
1739
1739
  i[n][T] = (E = L[n]) == null ? void 0 : E[T];
1740
- }), this._commandService.executeCommand(Fe.id, { formulaData: i }, { onlyLocal: !0 });
1741
- const o = this._configService.getConfig(qe), u = (f = o == null ? void 0 : o.initialFormulaComputing) != null ? f : Le.WHEN_EMPTY, m = this._getDirtyDataByCalculationMode(u);
1740
+ }), this._commandService.executeCommand(Be.id, { formulaData: i }, { onlyLocal: !0 });
1741
+ const o = this._configService.getConfig(ge), u = (f = o == null ? void 0 : o.initialFormulaComputing) != null ? f : Le.WHEN_EMPTY, m = this._getDirtyDataByCalculationMode(u);
1742
1742
  this._commandService.executeCommand(Ie.id, m, { onlyLocal: !0 });
1743
1743
  }
1744
1744
  _getDirtyDataByCalculationMode(a) {
@@ -1754,7 +1754,7 @@ let je = class extends ae {
1754
1754
  };
1755
1755
  }
1756
1756
  _getUpdateFormula(a) {
1757
- const e = this._univerInstanceService.getCurrentUnitForType(ee.UNIVER_SHEET);
1757
+ const e = this._univerInstanceService.getCurrentUnitForType(te.UNIVER_SHEET);
1758
1758
  if (!e)
1759
1759
  return {
1760
1760
  undos: [],
@@ -1790,7 +1790,7 @@ let je = class extends ae {
1790
1790
  const f = Object.keys(m);
1791
1791
  Ae.isDefine(r[u]) || (r[u] = {}), Ae.isDefine(o[u]) || (o[u] = {});
1792
1792
  for (const c of f) {
1793
- const d = new Y(m[c] || {}), T = new Y();
1793
+ const d = new G(m[c] || {}), T = new G();
1794
1794
  d.forValue((L, E, I) => {
1795
1795
  var U;
1796
1796
  if (!I) return !0;
@@ -1804,7 +1804,7 @@ let je = class extends ae {
1804
1804
  if (typeof h == "string")
1805
1805
  continue;
1806
1806
  const { token: V, nodeType: Q } = h, { type: b } = n;
1807
- if ((b === q.SetDefinedName || b === q.RemoveDefinedName) && (Q === J.DEFINED_NAME || Q === J.FUNCTION)) {
1807
+ if ((b === q.SetDefinedName || b === q.RemoveDefinedName) && (Q === ee.DEFINED_NAME || Q === ee.FUNCTION)) {
1808
1808
  const { definedNameId: Te, definedName: Ee } = n;
1809
1809
  if (Te === void 0 || Ee === void 0)
1810
1810
  continue;
@@ -1816,7 +1816,7 @@ let je = class extends ae {
1816
1816
  token: b === q.SetDefinedName ? Ee : j.REF
1817
1817
  }, O = !0, M.push(g);
1818
1818
  continue;
1819
- } else if (Q !== J.REFERENCE)
1819
+ } else if (Q !== ee.REFERENCE)
1820
1820
  continue;
1821
1821
  const Pe = pe(V), { range: ne, sheetName: re, unitId: k } = Pe, oe = k == null || k.length === 0 ? u : k, z = ((U = e == null ? void 0 : e[oe]) == null ? void 0 : U[re]) || "";
1822
1822
  if (!Ba(
@@ -1828,7 +1828,7 @@ let je = class extends ae {
1828
1828
  z
1829
1829
  ))
1830
1830
  continue;
1831
- const ge = {
1831
+ const he = {
1832
1832
  range: ne,
1833
1833
  sheetId: z,
1834
1834
  unitId: k,
@@ -1860,7 +1860,7 @@ let je = class extends ae {
1860
1860
  continue;
1861
1861
  ue = j.REF;
1862
1862
  } else b !== q.SetDefinedName && (ue = Va(
1863
- ge,
1863
+ he,
1864
1864
  n,
1865
1865
  u,
1866
1866
  c
@@ -15288,7 +15288,7 @@ let bt = class {
15288
15288
  ...Kn,
15289
15289
  ...kn,
15290
15290
  ...Qn
15291
- ].map((r) => r[1]), e = lr.filter((r) => a.includes(r.functionName)), n = this._configService.getConfig(qe);
15291
+ ].map((r) => r[1]), e = lr.filter((r) => a.includes(r.functionName)), n = this._configService.getConfig(ge);
15292
15292
  this._descriptions = e.concat((i = n == null ? void 0 : n.description) != null ? i : []);
15293
15293
  }
15294
15294
  _registerDescriptions() {
@@ -15317,7 +15317,7 @@ var Lr = Object.getOwnPropertyDescriptor, Pr = (a, e, n, i) => {
15317
15317
  for (var r = i > 1 ? void 0 : i ? Lr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
15318
15318
  (u = a[o]) && (r = u(r) || r);
15319
15319
  return r;
15320
- }, ve = (a, e) => (n, i) => e(n, i, a);
15320
+ }, Ve = (a, e) => (n, i) => e(n, i, a);
15321
15321
  function ca(a, e, n, i) {
15322
15322
  const r = a.sequenceNodesBuilder(e);
15323
15323
  if (r == null)
@@ -15325,11 +15325,11 @@ function ca(a, e, n, i) {
15325
15325
  const o = [];
15326
15326
  for (let u = 0, m = r.length; u < m; u++) {
15327
15327
  const f = r[u];
15328
- if (typeof f == "string" || f.nodeType !== J.REFERENCE)
15328
+ if (typeof f == "string" || f.nodeType !== ee.REFERENCE)
15329
15329
  continue;
15330
15330
  const { token: c } = f, d = pe(c), { sheetName: T, unitId: L } = d;
15331
15331
  let E = d.range;
15332
- E.startAbsoluteRefType === We.ALL && E.endAbsoluteRefType === We.ALL || (E = Nt(E, n, i), o.push({
15332
+ E.startAbsoluteRefType === Ke.ALL && E.endAbsoluteRefType === Ke.ALL || (E = Nt(E, n, i), o.push({
15333
15333
  unitId: L,
15334
15334
  sheetName: T,
15335
15335
  range: E
@@ -15342,8 +15342,8 @@ let Ot = class extends ae {
15342
15342
  super(), this._refRangeService = a, this._lexerTreeBuilder = e, this._univerInstanceService = n, this._injector = i;
15343
15343
  }
15344
15344
  transformFormulaByEffectCommand(a, e, n, i) {
15345
- const r = this._lexerTreeBuilder.sequenceNodesBuilder(n), o = this._univerInstanceService.getCurrentUnitForType(ee.UNIVER_SHEET), u = o.getActiveSheet(), m = o.getUnitId(), f = u.getSheetId(), c = r == null ? void 0 : r.map((d) => {
15346
- if (typeof d == "object" && d.nodeType === J.REFERENCE) {
15345
+ const r = this._lexerTreeBuilder.sequenceNodesBuilder(n), o = this._univerInstanceService.getCurrentUnitForType(te.UNIVER_SHEET), u = o.getActiveSheet(), m = o.getUnitId(), f = u.getSheetId(), c = r == null ? void 0 : r.map((d) => {
15346
+ if (typeof d == "object" && d.nodeType === ee.REFERENCE) {
15347
15347
  const T = pe(d.token), { range: L, unitId: E, sheetName: I } = T, A = this._univerInstanceService.getUnit(E || a), l = I ? A == null ? void 0 : A.getSheetBySheetName(I) : A == null ? void 0 : A.getSheetBySheetId(e);
15348
15348
  if (!l)
15349
15349
  throw new Error("Sheet not found");
@@ -15354,7 +15354,7 @@ let Ot = class extends ae {
15354
15354
  let O = "";
15355
15355
  if (p) {
15356
15356
  const M = p.startColumn - L.startColumn, F = p.startRow - L.startRow, U = Nt(L, M, F);
15357
- E && I ? O = na(E, I, U) : I ? O = ia(I, U) : O = Ke(U);
15357
+ E && I ? O = na(E, I, U) : I ? O = ia(I, U) : O = ye(U);
15358
15358
  } else
15359
15359
  O = j.REF;
15360
15360
  return {
@@ -15367,9 +15367,9 @@ let Ot = class extends ae {
15367
15367
  return c ? `=${ke(c)}` : "";
15368
15368
  }
15369
15369
  registerFormula(a, e, n, i) {
15370
- const r = /* @__PURE__ */ new Map(), o = this._lexerTreeBuilder.sequenceNodesBuilder(n), u = new Xe(), m = (f) => {
15371
- const c = this._univerInstanceService.getCurrentUnitForType(ee.UNIVER_SHEET), d = c.getActiveSheet(), T = c.getUnitId(), L = d.getSheetId(), E = o == null ? void 0 : o.map((A) => {
15372
- if (typeof A == "object" && A.nodeType === J.REFERENCE) {
15370
+ const r = /* @__PURE__ */ new Map(), o = this._lexerTreeBuilder.sequenceNodesBuilder(n), u = new We(), m = (f) => {
15371
+ const c = this._univerInstanceService.getCurrentUnitForType(te.UNIVER_SHEET), d = c.getActiveSheet(), T = c.getUnitId(), L = d.getSheetId(), E = o == null ? void 0 : o.map((A) => {
15372
+ if (typeof A == "object" && A.nodeType === ee.REFERENCE) {
15373
15373
  const l = r.get(A.token);
15374
15374
  if (l.unitId !== T || l.subUnitId !== L)
15375
15375
  return A;
@@ -15377,7 +15377,7 @@ let Ot = class extends ae {
15377
15377
  let R = "";
15378
15378
  if (N) {
15379
15379
  const p = N.startColumn - l.range.startColumn, O = N.startRow - l.range.startRow, M = Nt(l.range, p, O);
15380
- l.unitId && l.sheetName ? R = na(l.unitId, l.sheetName, M) : l.sheetName ? R = ia(l.sheetName, M) : R = Ke(M);
15380
+ l.unitId && l.sheetName ? R = na(l.unitId, l.sheetName, M) : l.sheetName ? R = ia(l.sheetName, M) : R = ye(M);
15381
15381
  } else
15382
15382
  R = j.REF;
15383
15383
  return {
@@ -15390,7 +15390,7 @@ let Ot = class extends ae {
15390
15390
  return i(`=${I}`);
15391
15391
  };
15392
15392
  return o == null || o.forEach((f) => {
15393
- if (typeof f == "object" && f.nodeType === J.REFERENCE) {
15393
+ if (typeof f == "object" && f.nodeType === ee.REFERENCE) {
15394
15394
  const c = pe(f.token), { range: d, unitId: T, sheetName: L } = c, E = this._univerInstanceService.getUnit(T || a), I = L ? E == null ? void 0 : E.getSheetBySheetName(L) : E == null ? void 0 : E.getSheetBySheetId(e);
15395
15395
  if (!I)
15396
15396
  return;
@@ -15407,9 +15407,9 @@ let Ot = class extends ae {
15407
15407
  _getFormulaDependcy(a, e, n, i) {
15408
15408
  const r = xe(n) ? this._lexerTreeBuilder.sequenceNodesBuilder(n) : null, o = [];
15409
15409
  return r == null || r.forEach((u) => {
15410
- if (typeof u == "object" && u.nodeType === J.REFERENCE) {
15410
+ if (typeof u == "object" && u.nodeType === ee.REFERENCE) {
15411
15411
  const m = pe(u.token), { range: f, unitId: c, sheetName: d } = m;
15412
- if (f.startAbsoluteRefType === We.ALL && f.endAbsoluteRefType === We.ALL)
15412
+ if (f.startAbsoluteRefType === Ke.ALL && f.endAbsoluteRefType === Ke.ALL)
15413
15413
  return;
15414
15414
  const T = this._univerInstanceService.getUnit(c || a), L = d ? T == null ? void 0 : T.getSheetBySheetName(d) : T == null ? void 0 : T.getSheetBySheetId(e);
15415
15415
  if (!L)
@@ -15430,13 +15430,13 @@ let Ot = class extends ae {
15430
15430
  }
15431
15431
  // eslint-disable-next-line max-lines-per-function
15432
15432
  registerRangeFormula(a, e, n, i, r) {
15433
- const o = new Xe(), u = i.map((f) => this._getFormulaDependcy(a, e, f, n)), m = (f) => {
15433
+ const o = new We(), u = i.map((f) => this._getFormulaDependcy(a, e, f, n)), m = (f) => {
15434
15434
  const c = n[0].startRow, d = n[0].startColumn, T = [{ unitId: a, subUnitId: e, ranges: n }, ...u.flat()], L = [], E = Tn(this._injector, f);
15435
15435
  for (const { unitId: I, subUnitId: A, ranges: l } of T)
15436
15436
  if (I === E.unitId && A === E.subUnitId) {
15437
15437
  const N = [], R = l[0].startRow, p = l[0].startColumn, O = R - c, M = p - d;
15438
15438
  for (const F of E.ranges) {
15439
- const U = l.map((g) => we(F, g)).filter(Boolean);
15439
+ const U = l.map((g) => Ye(F, g)).filter(Boolean);
15440
15440
  U.length > 0 && N.push(...U);
15441
15441
  }
15442
15442
  N.length > 0 && L.push(
@@ -15458,7 +15458,7 @@ let Ot = class extends ae {
15458
15458
  continue;
15459
15459
  const V = h[0].startRow, Q = h[0].startColumn, b = V - c, Pe = Q - d, ne = [];
15460
15460
  for (let k = 0; k < i.length; k++) {
15461
- const oe = i[k], z = xe(oe), ge = z ? this._lexerTreeBuilder.moveFormulaRefOffset(oe, x, g) : oe, ue = z ? this.transformFormulaByEffectCommand(a, e, ge, f) : ge, Te = ca(this._lexerTreeBuilder, ue, -Pe, -b);
15461
+ const oe = i[k], z = xe(oe), he = z ? this._lexerTreeBuilder.moveFormulaRefOffset(oe, x, g) : oe, ue = z ? this.transformFormulaByEffectCommand(a, e, he, f) : he, Te = ca(this._lexerTreeBuilder, ue, -Pe, -b);
15462
15462
  ne.push({
15463
15463
  newFormula: ue,
15464
15464
  orginFormula: Te
@@ -15518,10 +15518,10 @@ let Ot = class extends ae {
15518
15518
  }
15519
15519
  };
15520
15520
  Ot = Pr([
15521
- ve(0, X(Pn)),
15522
- ve(1, X(Ut)),
15523
- ve(2, Ce),
15524
- ve(3, X(rt))
15521
+ Ve(0, X(Pn)),
15522
+ Ve(1, X(Ut)),
15523
+ Ve(2, Ce),
15524
+ Ve(3, X(rt))
15525
15525
  ], Ot);
15526
15526
  var Tr = Object.getOwnPropertyDescriptor, Er = (a, e, n, i) => {
15527
15527
  for (var r = i > 1 ? void 0 : i ? Tr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
@@ -15560,7 +15560,7 @@ var Sr = Object.getOwnPropertyDescriptor, Ar = (a, e, n, i) => {
15560
15560
  for (var r = i > 1 ? void 0 : i ? Sr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
15561
15561
  (u = a[o]) && (r = u(r) || r);
15562
15562
  return r;
15563
- }, Ve = (a, e) => (n, i) => e(n, i, a);
15563
+ }, Ge = (a, e) => (n, i) => e(n, i, a);
15564
15564
  const Cr = yt(
15565
15565
  "sheets-formula.register-function-service"
15566
15566
  );
@@ -15577,7 +15577,7 @@ let Mt = class extends ae {
15577
15577
  registerFunctions(a) {
15578
15578
  const { locales: e, description: n, calculate: i } = a;
15579
15579
  e && this._localeService.load(e);
15580
- const r = new Xe();
15580
+ const r = new We();
15581
15581
  if (n)
15582
15582
  r.add(this._descriptionService.registerDescriptions(n));
15583
15583
  else {
@@ -15593,7 +15593,7 @@ let Mt = class extends ae {
15593
15593
  return r.add(this._registerLocalExecutors(i)), this._remoteRegisterFunctionService && r.add(this._registerRemoteExecutors(i)), r;
15594
15594
  }
15595
15595
  _registerSingleFunction(a) {
15596
- const { name: e, func: n, description: i, locales: r, async: o = !1 } = a, u = new Xe();
15596
+ const { name: e, func: n, description: i, locales: r, async: o = !1 } = a, u = new We();
15597
15597
  if (r && this._localeService.load(r), typeof i == "string") {
15598
15598
  const f = {
15599
15599
  functionName: e,
@@ -15623,10 +15623,10 @@ let Mt = class extends ae {
15623
15623
  }
15624
15624
  };
15625
15625
  Mt = Ar([
15626
- Ve(0, X(_t)),
15627
- Ve(1, X(vt)),
15628
- Ve(2, Bt),
15629
- Ve(3, Qa(Ha))
15626
+ Ge(0, X(_t)),
15627
+ Ge(1, X(vt)),
15628
+ Ge(2, Bt),
15629
+ Ge(3, Qa(Ha))
15630
15630
  ], Mt);
15631
15631
  const Dr = "SHEETS_FORMULA_PLUGIN";
15632
15632
  var br = Object.getOwnPropertyDescriptor, Or = (a, e, n, i) => {
@@ -15642,8 +15642,8 @@ let Ze = class extends ae {
15642
15642
  this._initialConversion();
15643
15643
  }
15644
15644
  _initialConversion() {
15645
- this._activeDirtyManagerService.register(te.id, {
15646
- commandId: te.id,
15645
+ this._activeDirtyManagerService.register(Z.id, {
15646
+ commandId: Z.id,
15647
15647
  getDirtyData: (a) => {
15648
15648
  const e = a.params;
15649
15649
  return e.trigger === gt.id ? {} : {
@@ -15815,8 +15815,8 @@ let Ze = class extends ae {
15815
15815
  });
15816
15816
  }
15817
15817
  _initialDefinedName() {
15818
- this._activeDirtyManagerService.register(ye.id, {
15819
- commandId: ye.id,
15818
+ this._activeDirtyManagerService.register(qe.id, {
15819
+ commandId: qe.id,
15820
15820
  getDirtyData: (a) => {
15821
15821
  const e = a.params;
15822
15822
  return { dirtyDefinedNameMap: this._getDefinedNameMutation(e) };
@@ -15883,7 +15883,7 @@ let Ze = class extends ae {
15883
15883
  return e[i] == null && (e[i] = {}), e[i][n.id] = n.name, e;
15884
15884
  }
15885
15885
  _rangeToMatrix(a) {
15886
- const e = new Y(), { startRow: n, startColumn: i, endRow: r, endColumn: o } = a;
15886
+ const e = new G(), { startRow: n, startColumn: i, endRow: r, endColumn: o } = a;
15887
15887
  for (let u = n; u <= r; u++)
15888
15888
  for (let m = i; m <= o; m++)
15889
15889
  e.setValue(u, m, {});
@@ -15891,7 +15891,7 @@ let Ze = class extends ae {
15891
15891
  }
15892
15892
  _getDirtyRangesByCellValue(a, e, n) {
15893
15893
  const i = [];
15894
- return n == null || new Y(n).getDiscreteRanges().forEach((u) => {
15894
+ return n == null || new G(n).getDiscreteRanges().forEach((u) => {
15895
15895
  i.push({ unitId: a, sheetId: e, range: u });
15896
15896
  }), i;
15897
15897
  }
@@ -15904,9 +15904,9 @@ let Ze = class extends ae {
15904
15904
  const i = [];
15905
15905
  if (n == null)
15906
15906
  return i;
15907
- const r = new Y(n), o = this._formulaDataModel.getArrayFormulaRange();
15907
+ const r = new G(n), o = this._formulaDataModel.getArrayFormulaRange();
15908
15908
  if ((u = o == null ? void 0 : o[a]) != null && u[e]) {
15909
- const f = new Y((m = o == null ? void 0 : o[a]) == null ? void 0 : m[e]);
15909
+ const f = new G((m = o == null ? void 0 : o[a]) == null ? void 0 : m[e]);
15910
15910
  r.forValue((c, d) => {
15911
15911
  f.forValue((T, L, E) => {
15912
15912
  if (E == null)
@@ -15937,7 +15937,7 @@ var Mr = Object.getOwnPropertyDescriptor, xr = (a, e, n, i) => {
15937
15937
  for (var r = i > 1 ? void 0 : i ? Mr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
15938
15938
  (u = a[o]) && (r = u(r) || r);
15939
15939
  return r;
15940
- }, Ge = (a, e) => (n, i) => e(n, i, a);
15940
+ }, He = (a, e) => (n, i) => e(n, i, a);
15941
15941
  let Je = class extends ae {
15942
15942
  constructor(a, e, n, i) {
15943
15943
  super(), this._commandService = a, this._configService = e, this._sheetInterceptorService = n, this._formulaDataModel = i, this._initialize();
@@ -15955,17 +15955,28 @@ let Je = class extends ae {
15955
15955
  if (e == null)
15956
15956
  return;
15957
15957
  const { arrayFormulaRange: n, arrayFormulaCellData: i } = e;
15958
- this._formulaDataModel.setArrayFormulaRange(n), this._formulaDataModel.setArrayFormulaCellData(i), (r = this._configService.getConfig(qe)) != null && r.writeArrayFormulaToSnapshot && this._writeArrayFormulaToSnapshot(i);
15958
+ this._formulaDataModel.setArrayFormulaRange(n), this._formulaDataModel.setArrayFormulaCellData(i), (r = this._configService.getConfig(ge)) != null && r.writeArrayFormulaToSnapshot && this._writeArrayFormulaToSnapshot(n, i);
15959
15959
  })
15960
15960
  );
15961
15961
  }
15962
- _writeArrayFormulaToSnapshot(a) {
15963
- Array.from(Object.entries(a)).forEach(([e, n]) => {
15964
- n && Array.from(Object.entries(n)).forEach(([i, r]) => {
15965
- this._commandService.executeCommand(te.id, {
15966
- unitId: e,
15967
- subUnitId: i,
15968
- cellValue: r
15962
+ _writeArrayFormulaToSnapshot(a, e) {
15963
+ Object.entries(a).forEach(([n, i]) => {
15964
+ i && Array.from(Object.entries(i)).forEach(([r, o]) => {
15965
+ const u = new G();
15966
+ new G(o).forValue((f, c, d) => {
15967
+ u.setValue(f, c, { ref: ye(d) });
15968
+ }), this._commandService.executeCommand(Z.id, {
15969
+ unitId: n,
15970
+ subUnitId: r,
15971
+ cellValue: u.getMatrix()
15972
+ }, { onlyLocal: !0 });
15973
+ });
15974
+ }), Array.from(Object.entries(e)).forEach(([n, i]) => {
15975
+ i && Array.from(Object.entries(i)).forEach(([r, o]) => {
15976
+ this._commandService.executeCommand(Z.id, {
15977
+ unitId: n,
15978
+ subUnitId: r,
15979
+ cellValue: o
15969
15980
  }, { onlyLocal: !0 });
15970
15981
  });
15971
15982
  });
@@ -15986,16 +15997,16 @@ let Je = class extends ae {
15986
15997
  }
15987
15998
  };
15988
15999
  Je = xr([
15989
- Ge(0, ce),
15990
- Ge(1, De),
15991
- Ge(2, X(qt)),
15992
- Ge(3, X(ut))
16000
+ He(0, ce),
16001
+ He(1, De),
16002
+ He(2, X(qt)),
16003
+ He(3, X(ut))
15993
16004
  ], Je);
15994
16005
  var _r = Object.getOwnPropertyDescriptor, yr = (a, e, n, i) => {
15995
16006
  for (var r = i > 1 ? void 0 : i ? _r(e, n) : e, o = a.length - 1, u; o >= 0; o--)
15996
16007
  (u = a[o]) && (r = u(r) || r);
15997
16008
  return r;
15998
- }, He = (a, e) => (n, i) => e(n, i, a);
16009
+ }, we = (a, e) => (n, i) => e(n, i, a);
15999
16010
  let et = class extends ae {
16000
16011
  constructor(e, n, i, r) {
16001
16012
  super();
@@ -16014,7 +16025,7 @@ let et = class extends ae {
16014
16025
  }
16015
16026
  _changeUnitListener() {
16016
16027
  ie(
16017
- this._univerInstanceService.getCurrentTypeOfUnit$(ee.UNIVER_SHEET).subscribe(() => {
16028
+ this._univerInstanceService.getCurrentTypeOfUnit$(te.UNIVER_SHEET).subscribe(() => {
16018
16029
  this._unRegisterDescriptions(), this._registerDescriptions();
16019
16030
  })
16020
16031
  );
@@ -16025,7 +16036,7 @@ let et = class extends ae {
16025
16036
  if (!(n != null && n.fromCollab)) {
16026
16037
  if (e.id === Nn.id)
16027
16038
  this._unregisterDescriptionsForNotInSheetId(), this._registerDescriptions();
16028
- else if (e.id === ye.id) {
16039
+ else if (e.id === qe.id) {
16029
16040
  const i = e.params;
16030
16041
  this._registerDescription(i);
16031
16042
  } else if (e.id === Dt.id) {
@@ -16066,7 +16077,7 @@ let et = class extends ae {
16066
16077
  }), this._descriptionService.unregisterDescriptions(n), this._preUnitId = null;
16067
16078
  }
16068
16079
  _getUnitIdAndSheetId() {
16069
- const e = this._univerInstanceService.getCurrentUnitForType(ee.UNIVER_SHEET);
16080
+ const e = this._univerInstanceService.getCurrentUnitForType(te.UNIVER_SHEET);
16070
16081
  if (e == null)
16071
16082
  return {};
16072
16083
  const n = e.getActiveSheet();
@@ -16109,10 +16120,10 @@ let et = class extends ae {
16109
16120
  }
16110
16121
  };
16111
16122
  et = yr([
16112
- He(0, vt),
16113
- He(1, ht),
16114
- He(2, Ce),
16115
- He(3, ce)
16123
+ we(0, vt),
16124
+ we(1, ht),
16125
+ we(2, Ce),
16126
+ we(3, ce)
16116
16127
  ], et);
16117
16128
  var qr = Object.getOwnPropertyDescriptor, gr = (a, e, n, i) => {
16118
16129
  for (var r = i > 1 ? void 0 : i ? qr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
@@ -16154,7 +16165,7 @@ let nt = class extends pa {
16154
16165
  }
16155
16166
  };
16156
16167
  ft(nt, "pluginName", "SHEET_FORMULA_REMOTE_PLUGIN");
16157
- ft(nt, "type", ee.UNIVER_SHEET);
16168
+ ft(nt, "type", te.UNIVER_SHEET);
16158
16169
  nt = wa([
16159
16170
  da(ga),
16160
16171
  at(1, X(rt)),
@@ -16168,7 +16179,7 @@ let it = class extends pa {
16168
16179
  ua,
16169
16180
  this._config
16170
16181
  );
16171
- this._configService.setConfig(qe, i, { merge: !0 });
16182
+ this._configService.setConfig(ge, i, { merge: !0 });
16172
16183
  }
16173
16184
  onStarting() {
16174
16185
  const a = this._injector, e = [
@@ -16193,26 +16204,26 @@ let it = class extends pa {
16193
16204
  e.forEach((n) => a.add(n));
16194
16205
  }
16195
16206
  onReady() {
16196
- he(this._injector, [
16207
+ Ue(this._injector, [
16197
16208
  [tt],
16198
16209
  [Ze],
16199
16210
  [Je],
16200
16211
  [je],
16201
16212
  [Qe]
16202
- ]), Ht() && he(this._injector, [
16213
+ ]), Ht() && Ue(this._injector, [
16203
16214
  [_e]
16204
16215
  ]);
16205
16216
  }
16206
16217
  onRendered() {
16207
- he(this._injector, [
16218
+ Ue(this._injector, [
16208
16219
  [et]
16209
- ]), Ht() || he(this._injector, [
16220
+ ]), Ht() || Ue(this._injector, [
16210
16221
  [_e]
16211
16222
  ]);
16212
16223
  }
16213
16224
  };
16214
16225
  ft(it, "pluginName", Dr);
16215
- ft(it, "type", ee.UNIVER_SHEET);
16226
+ ft(it, "type", te.UNIVER_SHEET);
16216
16227
  it = wa([
16217
16228
  da(ga, Rn),
16218
16229
  at(1, X(rt)),
@@ -16227,7 +16238,7 @@ export {
16227
16238
  Ha as IRemoteRegisterFunctionService,
16228
16239
  ei as InsertFunctionCommand,
16229
16240
  Me as OtherFormulaMarkDirty,
16230
- qe as PLUGIN_CONFIG_KEY_BASE,
16241
+ ge as PLUGIN_CONFIG_KEY_BASE,
16231
16242
  ti as QuickSumCommand,
16232
16243
  Mt as RegisterFunctionService,
16233
16244
  $e as RegisterOtherFormulaService,