@univerjs/sheets-formula 0.9.2 → 0.9.3-nightly.202507250750

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/index.js CHANGED
@@ -1,18 +1,18 @@
1
- var Ya = Object.defineProperty;
2
- var Xa = (a, e, n) => e in a ? Ya(a, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[e] = n;
3
- var W = (a, e, n) => Xa(a, typeof e != "symbol" ? e + "" : e, n);
4
- import { CommandType as xt, ICommandService as ce, ObjectMatrix as G, Tools as Me, IUniverInstanceService as Ae, Rectangle as fe, sequenceExecuteAsync as Wa, Inject as X, LifecycleService as Ka, Disposable as ae, ILogService as ka, IConfigService as Ce, LocaleService as _t, isFormulaString as xe, isFormulaId as la, cellToRange as sa, Direction as We, getIntersectRange as Xe, RANGE_TYPE as Y, UniverInstanceType as te, Injector as ot, InterceptorEffectEnum as Qa, CellValueType as Gt, isRealNum as $a, createIdentifier as yt, toDisposable as ie, moveRangeByOffset as Nt, DisposableCollection as Ke, AbsoluteRefType as ke, Optional as ja, DependentOn as da, Plugin as pa, merge as La, touchDependencies as Fe, 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, SetStyleCommand as qt, SetBorderCommand as Ta, ClearSelectionFormatCommand as Ea, handleMoveCols as Ia, EffectRefRangId as H, runRefRangeMutations as w, handleMoveRows as Na, handleMoveRange as Ra, handleInsertRangeMoveRight as Sa, handleInsertRangeMoveDown as Aa, handleDeleteRangeMoveUp as Ca, handleDeleteRangeMoveLeft as Da, handleIRemoveCol as ba, handleIRemoveRow as Oa, handleInsertCol as Ma, handleInsertRow as xa, RemoveDefinedNameCommand as _a, SetDefinedNameCommand as ya, 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 gt, RemoveSheetMutation as Rt, InsertSheetMutation as St, MoveRangeMutation as wt, MoveRowsMutation as Yt, MoveColsMutation as Xt, ReorderRangeMutation as Wt, RemoveRowMutation as Kt, RemoveColMutation as kt, InsertColMutation as Qt, InsertRowMutation as $t, SetRowHiddenMutation as jt, SetRowVisibleMutation as zt, INTERCEPTOR_POINT as Pn, SetWorksheetActiveOperation as Tn, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as lt, RefRangeService as En, handleDefaultRangeChangeWithEffectRefCommands as Zt, getSeparateEffectedRangesOnCommand as In, handleCommonDefaultRangeChangeWithEffectRefCommands as Nn, UniverSheetsPlugin as Rn } from "@univerjs/sheets";
6
- import { serializeRange as ye, IActiveDirtyManagerService as ht, 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 Be, FormulaExecutedStateType as De, sequenceNodeType as ee, deserializeRangeWithSheetWithCache as pe, serializeRangeToRefString as mt, ErrorType as j, IDefinedNamesService as Ut, LexerTreeBuilder as Ft, generateStringWithSequence as Qe, SetDefinedNameMutation as qe, SetFormulaDataMutation as ve, SetArrayFormulaDataMutation as At, initSheetFormulaData as ta, RemoveDefinedNameMutation as Ct, stripErrorMargin as bn, FunctionType as t, FUNCTION_NAMES_ARRAY as aa, FUNCTION_NAMES_COMPATIBILITY as x, FUNCTION_NAMES_CUBE as se, FUNCTION_NAMES_DATABASE as $, FUNCTION_NAMES_DATE as F, FUNCTION_NAMES_ENGINEERING as A, FUNCTION_NAMES_FINANCIAL as C, FUNCTION_NAMES_INFORMATION as v, FUNCTION_NAMES_LOGICAL as K, FUNCTION_NAMES_LOOKUP as _, FUNCTION_NAMES_MATH as L, FUNCTION_NAMES_STATISTICAL as l, FUNCTION_NAMES_TEXT as b, FUNCTION_NAMES_WEB as st, IFunctionService as Bt, isReferenceStrings as On, functionArray as Mn, functionCompatibility as xn, functionCube as _n, functionDatabase as yn, functionDate as qn, functionEngineering as gn, functionFinancial as hn, functionInformation as Un, functionLogical as Fn, functionLookup as Bn, functionMath as vn, functionMeta as Vn, functionStatistical as Gn, functionText as Hn, functionUniver as wn, functionWeb as Yn, serializeRangeWithSpreadsheet as na, serializeRangeWithSheet as ia, CustomFunction as Dt, AsyncCustomFunction as qa, UniverFormulaEnginePlugin as ga, IFormulaCurrentConfigService as Xn, Lexer as Wn, AstTreeBuilder as Kn, Interpreter as kn, generateExecuteAstNodeData as Qn, getObjectValue as $n } from "@univerjs/engine-formula";
7
- import { Subject as ra, BehaviorSubject as ha, bufferWhen as jn, filter as oa, map as zn } from "rxjs";
8
- import { IRPCChannelService as Ua, fromModule as Zn, toModule as Jn } from "@univerjs/rpc";
9
- const ei = {
1
+ var Xa = Object.defineProperty;
2
+ var Wa = (a, e, n) => e in a ? Xa(a, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[e] = n;
3
+ var W = (a, e, n) => Wa(a, typeof e != "symbol" ? e + "" : e, n);
4
+ import { CommandType as xt, ICommandService as ce, ObjectMatrix as G, generateRandomId as la, IUniverInstanceService as Ae, Rectangle as fe, sequenceExecuteAsync as Ka, Inject as X, LifecycleService as ka, Disposable as ae, ILogService as Qa, IConfigService as Ce, LocaleService as _t, isFormulaString as Me, isFormulaId as sa, cellToRange as da, Direction as Xe, getIntersectRange as Ye, RANGE_TYPE as Y, UniverInstanceType as te, Injector as rt, Tools as ft, InterceptorEffectEnum as $a, CellValueType as Gt, isRealNum as ja, createIdentifier as yt, toDisposable as ie, moveRangeByOffset as Nt, DisposableCollection as We, AbsoluteRefType as Ke, Optional as za, DependentOn as pa, Plugin as La, merge as Pa, touchDependencies as Ue, isNodeEnv as Ht } from "@univerjs/core";
5
+ import { SetRangeValuesCommand as Ta, SheetsSelectionsService as Za, getSheetCommandTarget as Ja, findFirstNonEmptyCell as en, alignToMergedCellsBorders as ct, expandToContinuousRange as tn, SetSelectionsOperation as an, SetRangeValuesMutation as Z, SetStyleCommand as qt, SetBorderCommand as Ea, ClearSelectionFormatCommand as Ia, handleMoveCols as Na, EffectRefRangId as H, runRefRangeMutations as w, handleMoveRows as Ra, handleMoveRange as Sa, handleInsertRangeMoveRight as Aa, handleInsertRangeMoveDown as Ca, handleDeleteRangeMoveUp as Da, handleDeleteRangeMoveLeft as ba, handleIRemoveCol as Oa, handleIRemoveRow as Ma, handleInsertCol as xa, handleInsertRow as _a, RemoveDefinedNameCommand as ya, SetDefinedNameCommand as qa, RemoveSheetCommand as nn, SetWorksheetNameCommand as rn, DeleteRangeMoveLeftCommand as on, DeleteRangeMoveUpCommand as un, RemoveColCommand as mn, RemoveRowCommand as fn, InsertRangeMoveDownCommand as cn, InsertRangeMoveRightCommand as ln, InsertColCommand as sn, InsertRowCommand as dn, MoveColsCommand as pn, MoveRowsCommand as Ln, MoveRangeCommand as Pn, SheetInterceptorService as gt, RemoveSheetMutation as Rt, InsertSheetMutation as St, MoveRangeMutation as wt, MoveRowsMutation as Yt, MoveColsMutation as Xt, ReorderRangeMutation as Wt, RemoveRowMutation as Kt, RemoveColMutation as kt, InsertColMutation as Qt, InsertRowMutation as $t, SetRowHiddenMutation as jt, SetRowVisibleMutation as zt, INTERCEPTOR_POINT as Tn, SetWorksheetActiveOperation as En, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as lt, RefRangeService as In, handleDefaultRangeChangeWithEffectRefCommands as Zt, getSeparateEffectedRangesOnCommand as Nn, handleCommonDefaultRangeChangeWithEffectRefCommands as Rn, UniverSheetsPlugin as Sn } from "@univerjs/sheets";
6
+ import { serializeRange as _e, IActiveDirtyManagerService as ht, SetFormulaCalculationResultMutation as An, RemoveOtherFormulaMutation as Cn, SetOtherFormulaMutation as Dn, FormulaDataModel as ot, SetFormulaCalculationStartMutation as Ie, SetFormulaCalculationStopMutation as Jt, ENGINE_FORMULA_CYCLE_REFERENCE_COUNT as ea, SetFormulaCalculationNotificationMutation as bn, FormulaExecuteStageType as Fe, FormulaExecutedStateType as De, sequenceNodeType as ee, deserializeRangeWithSheetWithCache as pe, serializeRangeToRefString as ut, ErrorType as j, IDefinedNamesService as Ut, LexerTreeBuilder as Ft, generateStringWithSequence as ke, SetDefinedNameMutation as ye, SetFormulaDataMutation as Be, SetArrayFormulaDataMutation as At, initSheetFormulaData as ta, RemoveDefinedNameMutation as Ct, stripErrorMargin as On, FunctionType as t, FUNCTION_NAMES_ARRAY as aa, FUNCTION_NAMES_COMPATIBILITY as x, FUNCTION_NAMES_CUBE as se, FUNCTION_NAMES_DATABASE as $, FUNCTION_NAMES_DATE as F, FUNCTION_NAMES_ENGINEERING as A, FUNCTION_NAMES_FINANCIAL as C, FUNCTION_NAMES_INFORMATION as v, FUNCTION_NAMES_LOGICAL as K, FUNCTION_NAMES_LOOKUP as _, FUNCTION_NAMES_MATH as L, FUNCTION_NAMES_STATISTICAL as l, FUNCTION_NAMES_TEXT as b, FUNCTION_NAMES_WEB as st, IFunctionService as Bt, isReferenceStrings as Mn, functionArray as xn, functionCompatibility as _n, functionCube as yn, functionDatabase as qn, functionDate as gn, functionEngineering as hn, functionFinancial as Un, functionInformation as Fn, functionLogical as Bn, functionLookup as vn, functionMath as Vn, functionMeta as Gn, functionStatistical as Hn, functionText as wn, functionUniver as Yn, functionWeb as Xn, serializeRangeWithSpreadsheet as na, serializeRangeWithSheet as ia, CustomFunction as Dt, AsyncCustomFunction as ga, UniverFormulaEnginePlugin as ha, IFormulaCurrentConfigService as Wn, Lexer as Kn, AstTreeBuilder as kn, Interpreter as Qn, generateExecuteAstNodeData as $n, getObjectValue as jn } from "@univerjs/engine-formula";
7
+ import { Subject as ra, BehaviorSubject as Ua, bufferWhen as zn, filter as oa, map as Zn } from "rxjs";
8
+ import { IRPCChannelService as Fa, fromModule as Jn, toModule as ei } from "@univerjs/rpc";
9
+ const ti = {
10
10
  id: "formula.command.insert-function",
11
11
  type: xt.COMMAND,
12
12
  handler: async (a, e) => {
13
13
  const { list: n, listOfRangeHasNumber: i } = e, r = a.get(ce), o = new G();
14
14
  n.forEach((f) => {
15
- const { range: m, primary: c, formula: s } = f, { row: P, column: E } = c, p = Me.generateRandomId(6);
15
+ const { range: m, primary: c, formula: s } = f, { row: P, column: E } = c, p = la(6);
16
16
  o.setValue(P, E, {
17
17
  f: s,
18
18
  si: p
@@ -32,21 +32,21 @@ const ei = {
32
32
  const u = {
33
33
  value: o.getData()
34
34
  };
35
- return r.executeCommand(Pa.id, u);
35
+ return r.executeCommand(Ta.id, u);
36
36
  }
37
- }, ti = {
37
+ }, ai = {
38
38
  id: "sheets-formula.command.quick-sum",
39
39
  type: xt.COMMAND,
40
40
  handler: async (a) => {
41
- const n = a.get(za).getCurrentLastSelection();
41
+ const n = a.get(Za).getCurrentLastSelection();
42
42
  if (!n) return !1;
43
- const i = a.get(Ae), r = Za(i);
43
+ const i = a.get(Ae), r = Ja(i);
44
44
  if (!r) return !1;
45
45
  const o = n.range, { worksheet: u } = r;
46
- let f = Ja(o, u);
46
+ let f = en(o, u);
47
47
  if (!f) return !1;
48
48
  f = ct(f, u);
49
- const m = en({
49
+ const m = tn({
50
50
  startRow: f.startRow,
51
51
  startColumn: f.startColumn,
52
52
  endRow: o.endRow,
@@ -60,7 +60,7 @@ const ei = {
60
60
  if (!fe.equals(s, m))
61
61
  for (const p of u.iterateByColumn(s))
62
62
  (!p.value || !u.cellHasValue(p.value)) && c.setValue(p.row, p.col, {
63
- f: `=SUM(${ye({
63
+ f: `=SUM(${_e({
64
64
  startColumn: p.col,
65
65
  endColumn: p.col,
66
66
  startRow: m.startRow,
@@ -76,7 +76,7 @@ const ei = {
76
76
  if (!fe.equals(P, m))
77
77
  for (const p of u.iterateByRow(P))
78
78
  (!p.value || !u.cellHasValue(p.value)) && c.setValue(p.row, p.col, {
79
- f: `=SUM(${ye({
79
+ f: `=SUM(${_e({
80
80
  startColumn: m.startColumn,
81
81
  endColumn: p.col - 1,
82
82
  startRow: p.row,
@@ -84,16 +84,16 @@ const ei = {
84
84
  })})`
85
85
  });
86
86
  const E = a.get(ce);
87
- return (await Wa([
87
+ return (await Ka([
88
88
  {
89
- id: Pa.id,
89
+ id: Ta.id,
90
90
  params: {
91
91
  range: m,
92
92
  value: c.getMatrix()
93
93
  }
94
94
  },
95
95
  {
96
- id: tn.id,
96
+ id: an.id,
97
97
  params: {
98
98
  unitId: r.unitId,
99
99
  subUnitId: r.subUnitId,
@@ -112,15 +112,15 @@ const ei = {
112
112
  handler() {
113
113
  return !0;
114
114
  }
115
- }, he = "sheets-formula.base.config";
115
+ }, ge = "sheets-formula.base.config";
116
116
  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 || {});
117
- const ua = {}, ai = "sheets-formula.remote.config", ma = {};
118
- 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 || {}), ni = Object.getOwnPropertyDescriptor, ii = (a, e, n, i) => {
119
- for (var r = i > 1 ? void 0 : i ? ni(e, n) : e, o = a.length - 1, u; o >= 0; o--)
117
+ const ua = {}, ni = "sheets-formula.remote.config", ma = {};
118
+ 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 || {}), ii = Object.getOwnPropertyDescriptor, ri = (a, e, n, i) => {
119
+ for (var r = i > 1 ? void 0 : i ? ii(e, n) : e, o = a.length - 1, u; o >= 0; o--)
120
120
  (u = a[o]) && (r = u(r) || r);
121
121
  return r;
122
122
  }, dt = (a, e) => (n, i) => e(n, i, a);
123
- let $e = class extends ae {
123
+ let Qe = class extends ae {
124
124
  constructor(e, n, i) {
125
125
  super();
126
126
  W(this, "_formulaCacheMap", /* @__PURE__ */ new Map());
@@ -129,7 +129,7 @@ let $e = class extends ae {
129
129
  // FIXME: this design could be improved.
130
130
  W(this, "_formulaResult$", new ra());
131
131
  W(this, "formulaResult$", this._formulaResult$.asObservable());
132
- W(this, "calculateStarted$", new ha(!1));
132
+ W(this, "calculateStarted$", new Ua(!1));
133
133
  this._commandService = e, this._activeDirtyManagerService = n, this._lifecycleService = i, this._initFormulaRegister(), this._initFormulaCalculationResultChange();
134
134
  }
135
135
  dispose() {
@@ -142,7 +142,7 @@ let $e = class extends ae {
142
142
  return r || (r = /* @__PURE__ */ new Map(), i.set(n, r)), r;
143
143
  }
144
144
  _createFormulaId(e, n) {
145
- return `formula.${e}_${n}_${Me.generateRandomId(8)}`;
145
+ return `formula.${e}_${n}_${la(8)}`;
146
146
  }
147
147
  _initFormulaRegister() {
148
148
  this._activeDirtyManagerService.register(
@@ -170,7 +170,7 @@ let $e = class extends ae {
170
170
  }
171
171
  }
172
172
  };
173
- this._commandService.executeCommand(Cn.id, c).then(() => {
173
+ this._commandService.executeCommand(Dn.id, c).then(() => {
174
174
  this._commandService.executeCommand(
175
175
  Oe.id,
176
176
  { [i]: { [r]: { [u]: !0 } } }
@@ -178,14 +178,14 @@ let $e = class extends ae {
178
178
  });
179
179
  };
180
180
  this.disposeWithMe(
181
- this._formulaChangeWithRange$.pipe(jn(() => this.calculateStarted$.pipe(oa((n) => n)))).subscribe((n) => n.forEach(e))
181
+ this._formulaChangeWithRange$.pipe(zn(() => this.calculateStarted$.pipe(oa((n) => n)))).subscribe((n) => n.forEach(e))
182
182
  ), this.disposeWithMe(
183
183
  this._formulaChangeWithRange$.pipe(oa(() => this.calculateStarted$.getValue())).subscribe(e)
184
184
  );
185
185
  }
186
186
  _initFormulaCalculationResultChange() {
187
187
  this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
188
- if (e.id === Sn.id) {
188
+ if (e.id === An.id) {
189
189
  const n = e.params, { unitOtherData: i } = n, r = {};
190
190
  for (const o in i) {
191
191
  const u = i[o], f = {};
@@ -236,7 +236,7 @@ let $e = class extends ae {
236
236
  subUnitId: n,
237
237
  formulaIdList: i
238
238
  };
239
- this._commandService.executeCommand(An.id, r);
239
+ this._commandService.executeCommand(Cn.id, r);
240
240
  const o = this._ensureCacheMap(e, n);
241
241
  i.forEach((u) => o.delete(u));
242
242
  }
@@ -259,18 +259,18 @@ let $e = class extends ae {
259
259
  ));
260
260
  }
261
261
  };
262
- $e = ii([
262
+ Qe = ri([
263
263
  dt(0, ce),
264
264
  dt(1, ht),
265
- dt(2, X(Ka))
266
- ], $e);
267
- var ri = Object.getOwnPropertyDescriptor, oi = (a, e, n, i) => {
268
- for (var r = i > 1 ? void 0 : i ? ri(e, n) : e, o = a.length - 1, u; o >= 0; o--)
265
+ dt(2, X(ka))
266
+ ], Qe);
267
+ var oi = Object.getOwnPropertyDescriptor, ui = (a, e, n, i) => {
268
+ for (var r = i > 1 ? void 0 : i ? oi(e, n) : e, o = a.length - 1, u; o >= 0; o--)
269
269
  (u = a[o]) && (r = u(r) || r);
270
270
  return r;
271
271
  }, de = (a, e) => (n, i) => e(n, i, a);
272
272
  const fa = { done: 0, count: 0 }, pt = { onlyLocal: !0 };
273
- let _e = class extends ae {
273
+ let xe = class extends ae {
274
274
  constructor(e, n, i, r, o, u, f) {
275
275
  super();
276
276
  W(this, "_waitingCommandQueue", []);
@@ -293,7 +293,7 @@ let _e = class extends ae {
293
293
  * The mark of forced calculation. If a new mutation triggers dirty area calculation during the forced calculation process, forced calculation is still required.
294
294
  */
295
295
  W(this, "_forceCalculating", !1);
296
- W(this, "_progress$", new ha(fa));
296
+ W(this, "_progress$", new Ua(fa));
297
297
  W(this, "progress$", this._progress$.asObservable());
298
298
  this._commandService = e, this._activeDirtyManagerService = n, this._logService = i, this._configService = r, this._formulaDataModel = o, this._localeService = u, this._registerOtherFormulaService = f, this._commandExecutedListener(), this._initialExecuteFormulaProcessListener(), this._initialExecuteFormula();
299
299
  }
@@ -326,7 +326,7 @@ let _e = class extends ae {
326
326
  }
327
327
  _getCalculationMode() {
328
328
  var n;
329
- const e = this._configService.getConfig(he);
329
+ const e = this._configService.getConfig(ge);
330
330
  return (n = e == null ? void 0 : e.initialFormulaComputing) != null ? n : Le.WHEN_EMPTY;
331
331
  }
332
332
  _commandExecutedListener() {
@@ -342,7 +342,7 @@ let _e = class extends ae {
342
342
  if (this._activeDirtyManagerService.get(e.id)) {
343
343
  if (e.id === Z.id) {
344
344
  const i = e.params;
345
- if (n && n.onlyLocal === !0 || i.trigger === qt.id || i.trigger === Ta.id || i.trigger === Ea.id)
345
+ if (n && n.onlyLocal === !0 || i.trigger === qt.id || i.trigger === Ea.id || i.trigger === Ia.id)
346
346
  return;
347
347
  }
348
348
  this._waitingCommandQueue.push(e), clearTimeout(this._setTimeoutKey), this._setTimeoutKey = setTimeout(() => {
@@ -435,28 +435,28 @@ let _e = class extends ae {
435
435
  const { forceCalculation: o = !1 } = i.params;
436
436
  o && (this._forceCalculating = !0);
437
437
  } else i.id === Jt.id && this.clearProgress();
438
- if (i.id !== Dn.id)
438
+ if (i.id !== bn.id)
439
439
  return;
440
440
  const r = i.params;
441
441
  if (r.stageInfo != null) {
442
442
  const {
443
443
  stage: o
444
444
  } = r.stageInfo;
445
- if (o === Be.START)
445
+ if (o === Fe.START)
446
446
  n === 0 && (this._startExecutionTime = performance.now()), n++, e !== null && (clearTimeout(e), e = null), e = setTimeout(() => {
447
447
  e = null, this._startProgress();
448
448
  }, 1e3);
449
- else if (o === Be.CURRENTLY_CALCULATING) {
449
+ else if (o === Fe.CURRENTLY_CALCULATING) {
450
450
  if (this._executionInProgressParams = r.stageInfo, e === null) {
451
451
  const u = this._localeService.t("formula.progress.calculating");
452
452
  this._calculateProgress(u);
453
453
  }
454
- } else if (o === Be.START_DEPENDENCY_ARRAY_FORMULA) {
454
+ } else if (o === Fe.START_DEPENDENCY_ARRAY_FORMULA) {
455
455
  if (this._executionInProgressParams = r.stageInfo, e === null) {
456
456
  const u = this._localeService.t("formula.progress.array-analysis");
457
457
  this._calculateProgress(u);
458
458
  }
459
- } else if (o === Be.CURRENTLY_CALCULATING_ARRAY_FORMULA && (this._executionInProgressParams = r.stageInfo, e === null)) {
459
+ } else if (o === Fe.CURRENTLY_CALCULATING_ARRAY_FORMULA && (this._executionInProgressParams = r.stageInfo, e === null)) {
460
460
  const u = this._localeService.t("formula.progress.array-calculation");
461
461
  this._calculateProgress(u);
462
462
  }
@@ -517,16 +517,16 @@ let _e = class extends ae {
517
517
  };
518
518
  }
519
519
  };
520
- _e = oi([
520
+ xe = ui([
521
521
  de(0, ce),
522
522
  de(1, ht),
523
- de(2, ka),
523
+ de(2, Qa),
524
524
  de(3, Ce),
525
- de(4, X(ut)),
525
+ de(4, X(ot)),
526
526
  de(5, X(_t)),
527
- de(6, X($e))
528
- ], _e);
529
- function ui(a, e, n) {
527
+ de(6, X(Qe))
528
+ ], xe);
529
+ function mi(a, e, n) {
530
530
  var i;
531
531
  return a == null || a[e] == null || ((i = a[e]) == null ? void 0 : i[n]) == null;
532
532
  }
@@ -545,18 +545,18 @@ function Lt(a, e, n) {
545
545
  };
546
546
  }
547
547
  var y = /* @__PURE__ */ ((a) => (a[a.MoveRange = 0] = "MoveRange", a[a.MoveRows = 1] = "MoveRows", a[a.MoveCols = 2] = "MoveCols", a[a.InsertRow = 3] = "InsertRow", a[a.InsertColumn = 4] = "InsertColumn", a[a.RemoveRow = 5] = "RemoveRow", a[a.RemoveColumn = 6] = "RemoveColumn", a[a.DeleteMoveLeft = 7] = "DeleteMoveLeft", a[a.DeleteMoveUp = 8] = "DeleteMoveUp", a[a.InsertMoveDown = 9] = "InsertMoveDown", a[a.InsertMoveRight = 10] = "InsertMoveRight", a[a.SetName = 11] = "SetName", a[a.RemoveSheet = 12] = "RemoveSheet", a[a.SetDefinedName = 13] = "SetDefinedName", a[a.RemoveDefinedName = 14] = "RemoveDefinedName", a))(y || {});
548
- const mi = [
548
+ const fi = [
549
549
  11,
550
550
  12,
551
551
  13,
552
552
  14
553
553
  /* RemoveDefinedName */
554
554
  ];
555
- function fi(a, e, n) {
555
+ function ci(a, e, n) {
556
556
  const { type: i } = n;
557
- return mi.includes(i) ? ci(a, e) : li(a, e, n);
557
+ return fi.includes(i) ? li(a, e) : si(a, e, n);
558
558
  }
559
- function ci(a, e) {
559
+ function li(a, e) {
560
560
  const n = [], i = [];
561
561
  return Object.keys(e).forEach((r) => {
562
562
  const o = e[r], u = a[r];
@@ -567,7 +567,7 @@ function ci(a, e) {
567
567
  if (m.forValue((N, d, D) => {
568
568
  if (D == null)
569
569
  return !0;
570
- const I = ge(D);
570
+ const I = qe(D);
571
571
  I !== null && (s.setValue(N, d, I), P.setValue(N, d, c.getValue(N, d)));
572
572
  }), s.getSizeOf() === 0)
573
573
  return;
@@ -595,8 +595,8 @@ function ci(a, e) {
595
595
  redos: i
596
596
  };
597
597
  }
598
- function li(a, e, n) {
599
- const { redoFormulaData: i, undoFormulaData: r } = si(a, e, n), o = [], u = [];
598
+ function si(a, e, n) {
599
+ const { redoFormulaData: i, undoFormulaData: r } = di(a, e, n), o = [], u = [];
600
600
  return Object.keys(i).forEach((f) => {
601
601
  Object.keys(i[f]).forEach((m) => {
602
602
  if (Object.keys(i[f][m]).length !== 0) {
@@ -630,10 +630,10 @@ function li(a, e, n) {
630
630
  redos: o
631
631
  };
632
632
  }
633
- function si(a, e, n) {
633
+ function di(a, e, n) {
634
634
  const i = {}, r = {}, { unitId: o, sheetId: u } = n;
635
635
  return (/* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(e)])).forEach((m) => {
636
- if (ui(a, m, u))
636
+ if (mi(a, m, u))
637
637
  return;
638
638
  (/* @__PURE__ */ new Set([
639
639
  ...Object.keys(a[m] || {}),
@@ -642,8 +642,8 @@ function si(a, e, n) {
642
642
  var D, I;
643
643
  const P = (D = a[m]) == null ? void 0 : D[s], E = (I = e[m]) == null ? void 0 : I[s], p = new G(P || {}), R = new G(E || {});
644
644
  let S = [];
645
- m !== o || s !== u ? S = pi(R) : S = di(p, n);
646
- const N = Mi(S, p, R), d = xi(S, p);
645
+ m !== o || s !== u ? S = Li(R) : S = pi(p, n);
646
+ const N = xi(S, p, R), d = _i(S, p);
647
647
  i[m] || (i[m] = {}), r[m] || (r[m] = {}), i[m][s] = {
648
648
  ...i[m][s],
649
649
  ...N
@@ -657,11 +657,11 @@ function si(a, e, n) {
657
657
  undoFormulaData: r
658
658
  };
659
659
  }
660
- function di(a, e) {
660
+ function pi(a, e) {
661
661
  const { type: n, from: i, to: r, range: o } = e, u = [];
662
662
  return a.forValue((f, m, c) => {
663
- if (c == null || !Fa(c)) return !0;
664
- const s = sa(f, m);
663
+ if (c == null || !Ba(c)) return !0;
664
+ const s = da(f, m);
665
665
  let P = null, E = !1;
666
666
  if ([
667
667
  0,
@@ -669,69 +669,69 @@ function di(a, e) {
669
669
  2
670
670
  /* MoveCols */
671
671
  ].includes(n))
672
- P = Li(n, i, r, s);
672
+ P = Pi(n, i, r, s);
673
673
  else if (o != null) {
674
- const p = Pi(s, e);
674
+ const p = Ti(s, e);
675
675
  P = p.newCell, E = p.isReverse;
676
676
  }
677
677
  E ? u.unshift({ oldCell: s, newCell: P }) : u.push({ oldCell: s, newCell: P });
678
678
  }), u;
679
679
  }
680
- function pi(a) {
680
+ function Li(a) {
681
681
  const e = [];
682
682
  return a.forValue((n, i, r) => {
683
- if (r == null || !Fa(r)) return !0;
684
- const o = sa(n, i);
683
+ if (r == null || !Ba(r)) return !0;
684
+ const o = da(n, i);
685
685
  e.push({ oldCell: o, newCell: o });
686
686
  }), e;
687
687
  }
688
- function Li(a, e, n, i) {
688
+ function Pi(a, e, n, i) {
689
689
  if (e == null || n == null)
690
690
  return null;
691
691
  switch (a) {
692
692
  case 0:
693
- return Ti(e, n, i);
694
- case 1:
695
693
  return Ei(e, n, i);
696
- case 2:
694
+ case 1:
697
695
  return Ii(e, n, i);
696
+ case 2:
697
+ return Ni(e, n, i);
698
698
  default:
699
699
  return null;
700
700
  }
701
701
  }
702
- function Pi(a, e) {
702
+ function Ti(a, e) {
703
703
  const { type: n, rangeFilteredRows: i } = e, r = e.range;
704
704
  let o = null, u = !1;
705
705
  switch (n) {
706
706
  case 3:
707
- o = Ni(r, a), u = !0;
707
+ o = Ri(r, a), u = !0;
708
708
  break;
709
709
  case 4:
710
- o = Ri(r, a), u = !0;
710
+ o = Si(r, a), u = !0;
711
711
  break;
712
712
  case 5:
713
- o = Si(r, a, i);
713
+ o = Ai(r, a, i);
714
714
  break;
715
715
  case 6:
716
- o = Ai(r, a);
716
+ o = Ci(r, a);
717
717
  break;
718
718
  case 7:
719
- o = Ci(r, a);
719
+ o = Di(r, a);
720
720
  break;
721
721
  case 8:
722
- o = Di(r, a);
722
+ o = bi(r, a);
723
723
  break;
724
724
  case 9:
725
- o = bi(r, a), u = !0;
725
+ o = Oi(r, a), u = !0;
726
726
  break;
727
727
  case 10:
728
- o = Oi(r, a), u = !0;
728
+ o = Mi(r, a), u = !0;
729
729
  break;
730
730
  }
731
731
  return { newCell: o, isReverse: u };
732
732
  }
733
- function Ti(a, e, n) {
734
- const i = Ra(
733
+ function Ei(a, e, n) {
734
+ const i = Sa(
735
735
  {
736
736
  id: H.MoveRangeCommandId,
737
737
  params: { toRange: e, fromRange: a }
@@ -740,8 +740,8 @@ function Ti(a, e, n) {
740
740
  );
741
741
  return w(i, n);
742
742
  }
743
- function Ei(a, e, n) {
744
- const i = Na(
743
+ function Ii(a, e, n) {
744
+ const i = Ra(
745
745
  {
746
746
  id: H.MoveRowsCommandId,
747
747
  params: { toRange: e, fromRange: a }
@@ -750,8 +750,8 @@ function Ei(a, e, n) {
750
750
  );
751
751
  return w(i, n);
752
752
  }
753
- function Ii(a, e, n) {
754
- const i = Ia(
753
+ function Ni(a, e, n) {
754
+ const i = Na(
755
755
  {
756
756
  id: H.MoveColsCommandId,
757
757
  params: { toRange: e, fromRange: a }
@@ -760,28 +760,28 @@ function Ii(a, e, n) {
760
760
  );
761
761
  return w(i, n);
762
762
  }
763
- function Ni(a, e) {
764
- const n = xa(
763
+ function Ri(a, e) {
764
+ const n = _a(
765
765
  {
766
766
  id: H.InsertRowCommandId,
767
- params: { range: a, unitId: "", subUnitId: "", direction: We.DOWN }
767
+ params: { range: a, unitId: "", subUnitId: "", direction: Xe.DOWN }
768
768
  },
769
769
  e
770
770
  );
771
771
  return w(n, e);
772
772
  }
773
- function Ri(a, e) {
774
- const n = Ma(
773
+ function Si(a, e) {
774
+ const n = xa(
775
775
  {
776
776
  id: H.InsertColCommandId,
777
- params: { range: a, unitId: "", subUnitId: "", direction: We.RIGHT }
777
+ params: { range: a, unitId: "", subUnitId: "", direction: Xe.RIGHT }
778
778
  },
779
779
  e
780
780
  );
781
781
  return w(n, e);
782
782
  }
783
- function Si(a, e, n) {
784
- const i = Oa(
783
+ function Ai(a, e, n) {
784
+ const i = Ma(
785
785
  {
786
786
  id: H.RemoveRowCommandId,
787
787
  params: { range: a }
@@ -791,8 +791,8 @@ function Si(a, e, n) {
791
791
  );
792
792
  return w(i, e);
793
793
  }
794
- function Ai(a, e) {
795
- const n = ba(
794
+ function Ci(a, e) {
795
+ const n = Oa(
796
796
  {
797
797
  id: H.RemoveColCommandId,
798
798
  params: { range: a }
@@ -801,8 +801,8 @@ function Ai(a, e) {
801
801
  );
802
802
  return w(n, e);
803
803
  }
804
- function Ci(a, e) {
805
- const n = Da(
804
+ function Di(a, e) {
805
+ const n = ba(
806
806
  {
807
807
  id: H.DeleteRangeMoveLeftCommandId,
808
808
  params: { range: a }
@@ -811,8 +811,8 @@ function Ci(a, e) {
811
811
  );
812
812
  return w(n, e);
813
813
  }
814
- function Di(a, e) {
815
- const n = Ca(
814
+ function bi(a, e) {
815
+ const n = Da(
816
816
  {
817
817
  id: H.DeleteRangeMoveUpCommandId,
818
818
  params: { range: a }
@@ -821,8 +821,8 @@ function Di(a, e) {
821
821
  );
822
822
  return w(n, e);
823
823
  }
824
- function bi(a, e) {
825
- const n = Aa(
824
+ function Oi(a, e) {
825
+ const n = Ca(
826
826
  {
827
827
  id: H.InsertRangeMoveDownCommandId,
828
828
  params: { range: a }
@@ -831,8 +831,8 @@ function bi(a, e) {
831
831
  );
832
832
  return w(n, e);
833
833
  }
834
- function Oi(a, e) {
835
- const n = Sa(
834
+ function Mi(a, e) {
835
+ const n = Aa(
836
836
  {
837
837
  id: H.InsertRangeMoveRightCommandId,
838
838
  params: { range: a }
@@ -841,33 +841,33 @@ function Oi(a, e) {
841
841
  );
842
842
  return w(n, e);
843
843
  }
844
- function Mi(a, e, n) {
844
+ function xi(a, e, n) {
845
845
  var r, o, u;
846
846
  const i = new G({});
847
847
  for (let f = 0; f < a.length; f++) {
848
848
  const { oldCell: m, newCell: c } = a[f];
849
849
  if ((r = i.getValue(m.startRow, m.startColumn)) != null && r.f || (o = i.getValue(m.startRow, m.startColumn)) != null && o.si || i.setValue(m.startRow, m.startColumn, { f: null, si: null }), c) {
850
- const s = (u = n.getValue(m.startRow, m.startColumn)) != null ? u : e.getValue(m.startRow, m.startColumn), P = ge(s);
850
+ const s = (u = n.getValue(m.startRow, m.startColumn)) != null ? u : e.getValue(m.startRow, m.startColumn), P = qe(s);
851
851
  i.setValue(c.startRow, c.startColumn, P);
852
852
  }
853
853
  }
854
854
  return i.getMatrix();
855
855
  }
856
- function xi(a, e) {
856
+ function _i(a, e) {
857
857
  const n = new G({});
858
858
  for (let i = a.length - 1; i >= 0; i--) {
859
- const { oldCell: r, newCell: o } = a[i], u = e.getValue(r.startRow, r.startColumn), f = ge(u);
859
+ const { oldCell: r, newCell: o } = a[i], u = e.getValue(r.startRow, r.startColumn), f = qe(u);
860
860
  if (n.setValue(r.startRow, r.startColumn, f), o) {
861
- const m = e.getValue(o.startRow, o.startColumn), c = ge(m);
861
+ const m = e.getValue(o.startRow, o.startColumn), c = qe(m);
862
862
  n.setValue(o.startRow, o.startColumn, c != null ? c : { f: null, si: null });
863
863
  }
864
864
  }
865
865
  return n.getMatrix();
866
866
  }
867
- function ge(a) {
867
+ function qe(a) {
868
868
  if (a == null)
869
869
  return;
870
- const { f: e, si: n, x: i = 0, y: r = 0 } = a, o = xe(e), u = la(n);
870
+ const { f: e, si: n, x: i = 0, y: r = 0 } = a, o = Me(e), u = sa(n);
871
871
  if (!o && !u)
872
872
  return {
873
873
  f: null,
@@ -876,18 +876,18 @@ function ge(a) {
876
876
  const f = {};
877
877
  return u && (f.si = n), o && i === 0 && r === 0 && (f.f = e), f.f === void 0 && (f.f = null), f.si === void 0 && (f.si = null), f;
878
878
  }
879
- function _i(a) {
879
+ function yi(a) {
880
880
  const e = new G({});
881
881
  return new G(a).forValue((i, r, o) => {
882
- const u = ge(o);
882
+ const u = qe(o);
883
883
  u && e.setValue(i, r, u);
884
884
  }), e.getMatrix();
885
885
  }
886
- function Fa(a) {
887
- const e = (a == null ? void 0 : a.f) || "", n = (a == null ? void 0 : a.si) || "", i = xe(e), r = la(n);
886
+ function Ba(a) {
887
+ const e = (a == null ? void 0 : a.f) || "", n = (a == null ? void 0 : a.si) || "", i = Me(e), r = sa(n);
888
888
  return !!(i || r);
889
889
  }
890
- function Ba(a, e, n, i, r, o) {
890
+ function va(a, e, n, i, r, o) {
891
891
  if ((r == null || r.length === 0) && (o == null || o.length === 0)) {
892
892
  if (a === n && e === i)
893
893
  return !0;
@@ -895,7 +895,7 @@ function Ba(a, e, n, i, r, o) {
895
895
  return !0;
896
896
  return !1;
897
897
  }
898
- function va(a, e, n = 0, i = 0) {
898
+ function Va(a, e, n = 0, i = 0) {
899
899
  const r = [];
900
900
  for (let o = 0, u = a.length; o < u; o++) {
901
901
  const f = a[o];
@@ -906,7 +906,7 @@ function va(a, e, n = 0, i = 0) {
906
906
  const { token: m } = f, c = pe(m), { range: s, sheetName: P, unitId: E } = c, p = fe.moveOffset(s, n, i);
907
907
  r.push({
908
908
  ...f,
909
- token: mt({
909
+ token: ut({
910
910
  range: p,
911
911
  unitId: E,
912
912
  sheetName: P
@@ -915,7 +915,7 @@ function va(a, e, n = 0, i = 0) {
915
915
  }
916
916
  return r;
917
917
  }
918
- function Va(a, e, n, i) {
918
+ function Ga(a, e, n, i) {
919
919
  const { type: r, unitId: o, sheetId: u, range: f, from: m, to: c, rangeFilteredRows: s } = e, {
920
920
  range: P,
921
921
  sheetId: E,
@@ -924,7 +924,7 @@ function Va(a, e, n, i) {
924
924
  refOffsetX: S,
925
925
  refOffsetY: N
926
926
  } = a;
927
- if (!Ba(
927
+ if (!va(
928
928
  o,
929
929
  u,
930
930
  n,
@@ -938,10 +938,10 @@ function Va(a, e, n, i) {
938
938
  if (r === y.MoveRange) {
939
939
  if (m == null || c == null)
940
940
  return;
941
- const I = Tt(d, m), T = Xe(d, m);
941
+ const I = Tt(d, m), T = Ye(d, m);
942
942
  if (T == null || I !== 4)
943
943
  return;
944
- const g = Ra(
944
+ const g = Sa(
945
945
  { id: H.MoveRangeCommandId, params: { toRange: c, fromRange: m } },
946
946
  T
947
947
  ), h = w(g, T);
@@ -952,7 +952,7 @@ function Va(a, e, n, i) {
952
952
  if (m == null || c == null)
953
953
  return;
954
954
  const I = Tt(d, m);
955
- let T = Xe(d, m);
955
+ let T = Ye(d, m);
956
956
  if (T == null && (m.endRow < d.startRow && c.endRow <= d.startRow || m.startRow > d.endRow && c.startRow > d.endRow))
957
957
  return;
958
958
  T == null && (T = {
@@ -962,7 +962,7 @@ function Va(a, e, n, i) {
962
962
  endColumn: d.endColumn,
963
963
  rangeType: Y.NORMAL
964
964
  });
965
- const g = Na(
965
+ const g = Ra(
966
966
  { id: H.MoveRowsCommandId, params: { toRange: c, fromRange: m } },
967
967
  T
968
968
  ), h = w(g, T);
@@ -973,7 +973,7 @@ function Va(a, e, n, i) {
973
973
  if (m == null || c == null)
974
974
  return;
975
975
  const I = Tt(d, m);
976
- let T = Xe(d, m);
976
+ let T = Ye(d, m);
977
977
  if (T == null && (m.endColumn < d.startColumn && c.endColumn <= d.startColumn || m.startColumn > d.endColumn && c.startColumn > d.endColumn))
978
978
  return;
979
979
  T == null && (T = {
@@ -983,7 +983,7 @@ function Va(a, e, n, i) {
983
983
  endColumn: d.endColumn,
984
984
  rangeType: Y.NORMAL
985
985
  });
986
- const g = Ia(
986
+ const g = Na(
987
987
  { id: H.MoveColsCommandId, params: { toRange: c, fromRange: m } },
988
988
  T
989
989
  ), h = w(g, T);
@@ -993,10 +993,10 @@ function Va(a, e, n, i) {
993
993
  }
994
994
  if (f != null) {
995
995
  if (r === y.InsertRow) {
996
- const I = xa(
996
+ const I = _a(
997
997
  {
998
998
  id: H.InsertRowCommandId,
999
- params: { range: f, unitId: "", subUnitId: "", direction: We.DOWN }
999
+ params: { range: f, unitId: "", subUnitId: "", direction: Xe.DOWN }
1000
1000
  },
1001
1001
  d
1002
1002
  ), T = w(I, d);
@@ -1007,10 +1007,10 @@ function Va(a, e, n, i) {
1007
1007
  ...T
1008
1008
  };
1009
1009
  } else if (r === y.InsertColumn) {
1010
- const I = Ma(
1010
+ const I = xa(
1011
1011
  {
1012
1012
  id: H.InsertColCommandId,
1013
- params: { range: f, unitId: "", subUnitId: "", direction: We.RIGHT }
1013
+ params: { range: f, unitId: "", subUnitId: "", direction: Xe.RIGHT }
1014
1014
  },
1015
1015
  d
1016
1016
  ), T = w(I, d);
@@ -1021,7 +1021,7 @@ function Va(a, e, n, i) {
1021
1021
  ...T
1022
1022
  };
1023
1023
  } else if (r === y.RemoveRow) {
1024
- const I = Oa(
1024
+ const I = Ma(
1025
1025
  {
1026
1026
  id: H.RemoveRowCommandId,
1027
1027
  params: { range: f }
@@ -1036,7 +1036,7 @@ function Va(a, e, n, i) {
1036
1036
  ...T
1037
1037
  };
1038
1038
  } else if (r === y.RemoveColumn) {
1039
- const I = ba(
1039
+ const I = Oa(
1040
1040
  {
1041
1041
  id: H.RemoveColCommandId,
1042
1042
  params: { range: f }
@@ -1050,7 +1050,7 @@ function Va(a, e, n, i) {
1050
1050
  ...T
1051
1051
  };
1052
1052
  } else if (r === y.DeleteMoveLeft) {
1053
- const I = Da(
1053
+ const I = ba(
1054
1054
  {
1055
1055
  id: H.DeleteRangeMoveLeftCommandId,
1056
1056
  params: { range: f }
@@ -1064,7 +1064,7 @@ function Va(a, e, n, i) {
1064
1064
  ...T
1065
1065
  };
1066
1066
  } else if (r === y.DeleteMoveUp) {
1067
- const I = Ca(
1067
+ const I = Da(
1068
1068
  {
1069
1069
  id: H.DeleteRangeMoveUpCommandId,
1070
1070
  params: { range: f }
@@ -1078,7 +1078,7 @@ function Va(a, e, n, i) {
1078
1078
  ...T
1079
1079
  };
1080
1080
  } else if (r === y.InsertMoveDown) {
1081
- const I = Aa(
1081
+ const I = Ca(
1082
1082
  {
1083
1083
  id: H.InsertRangeMoveDownCommandId,
1084
1084
  params: { range: f }
@@ -1092,7 +1092,7 @@ function Va(a, e, n, i) {
1092
1092
  ...T
1093
1093
  };
1094
1094
  } else if (r === y.InsertMoveRight) {
1095
- const I = Sa(
1095
+ const I = Aa(
1096
1096
  {
1097
1097
  id: H.InsertRangeMoveRightCommandId,
1098
1098
  params: { range: f }
@@ -1108,7 +1108,7 @@ function Va(a, e, n, i) {
1108
1108
  }
1109
1109
  }
1110
1110
  if (D != null)
1111
- return mt({
1111
+ return ut({
1112
1112
  range: D,
1113
1113
  sheetName: R,
1114
1114
  unitId: p
@@ -1211,55 +1211,55 @@ function be(a) {
1211
1211
  endColumn: Se(r)
1212
1212
  };
1213
1213
  }
1214
- function Ga(a, e) {
1214
+ function Ha(a, e) {
1215
1215
  const { id: n } = e;
1216
1216
  let i = null;
1217
1217
  switch (n) {
1218
+ case Pn.id:
1219
+ i = qi(e, a);
1220
+ break;
1218
1221
  case Ln.id:
1219
- i = yi(e, a);
1222
+ i = gi(e, a);
1220
1223
  break;
1221
1224
  case pn.id:
1222
- i = qi(e, a);
1225
+ i = hi(e, a);
1223
1226
  break;
1224
1227
  case dn.id:
1225
- i = gi(e, a);
1228
+ i = Ui(e);
1226
1229
  break;
1227
1230
  case sn.id:
1228
- i = hi(e);
1231
+ i = Fi(e);
1229
1232
  break;
1230
1233
  case ln.id:
1231
- i = Ui(e);
1232
- break;
1233
- case cn.id:
1234
- i = Fi(e, a);
1235
- break;
1236
- case fn.id:
1237
1234
  i = Bi(e, a);
1238
1235
  break;
1239
- case mn.id:
1236
+ case cn.id:
1240
1237
  i = vi(e, a);
1241
1238
  break;
1242
- case un.id:
1239
+ case fn.id:
1243
1240
  i = Vi(e, a);
1244
1241
  break;
1245
- case on.id:
1242
+ case mn.id:
1246
1243
  i = Gi(e, a);
1247
1244
  break;
1248
- case rn.id:
1245
+ case un.id:
1249
1246
  i = Hi(e, a);
1250
1247
  break;
1251
- case nn.id:
1248
+ case on.id:
1252
1249
  i = wi(e, a);
1253
1250
  break;
1254
- case an.id:
1251
+ case rn.id:
1255
1252
  i = Yi(e, a);
1256
1253
  break;
1257
- case ya.id:
1254
+ case nn.id:
1258
1255
  i = Xi(e, a);
1259
1256
  break;
1260
- case _a.id:
1257
+ case qa.id:
1261
1258
  i = Wi(e, a);
1262
1259
  break;
1260
+ case ya.id:
1261
+ i = Ki(e, a);
1262
+ break;
1263
1263
  }
1264
1264
  return i;
1265
1265
  }
@@ -1271,7 +1271,7 @@ function J(a) {
1271
1271
  sheetId: n
1272
1272
  };
1273
1273
  }
1274
- function yi(a, e) {
1274
+ function qi(a, e) {
1275
1275
  const { params: n } = a;
1276
1276
  if (!n) return null;
1277
1277
  const { fromRange: i, toRange: r } = n;
@@ -1285,7 +1285,7 @@ function yi(a, e) {
1285
1285
  sheetId: u
1286
1286
  };
1287
1287
  }
1288
- function qi(a, e) {
1288
+ function gi(a, e) {
1289
1289
  const { params: n } = a;
1290
1290
  if (!n) return null;
1291
1291
  const {
@@ -1314,7 +1314,7 @@ function qi(a, e) {
1314
1314
  sheetId: c
1315
1315
  };
1316
1316
  }
1317
- function gi(a, e) {
1317
+ function hi(a, e) {
1318
1318
  const { params: n } = a;
1319
1319
  if (!n) return null;
1320
1320
  const {
@@ -1343,7 +1343,7 @@ function gi(a, e) {
1343
1343
  sheetId: c
1344
1344
  };
1345
1345
  }
1346
- function hi(a) {
1346
+ function Ui(a) {
1347
1347
  const { params: e } = a;
1348
1348
  if (!e) return null;
1349
1349
  const { range: n, unitId: i, subUnitId: r } = e;
@@ -1354,7 +1354,7 @@ function hi(a) {
1354
1354
  sheetId: r
1355
1355
  };
1356
1356
  }
1357
- function Ui(a) {
1357
+ function Fi(a) {
1358
1358
  const { params: e } = a;
1359
1359
  if (!e) return null;
1360
1360
  const { range: n, unitId: i, subUnitId: r } = e;
@@ -1365,7 +1365,7 @@ function Ui(a) {
1365
1365
  sheetId: r
1366
1366
  };
1367
1367
  }
1368
- function Fi(a, e) {
1368
+ function Bi(a, e) {
1369
1369
  const { params: n } = a;
1370
1370
  if (!n) return null;
1371
1371
  const { range: i } = n, { unitId: r, sheetId: o } = J(e);
@@ -1376,7 +1376,7 @@ function Fi(a, e) {
1376
1376
  sheetId: o
1377
1377
  };
1378
1378
  }
1379
- function Bi(a, e) {
1379
+ function vi(a, e) {
1380
1380
  const { params: n } = a;
1381
1381
  if (!n) return null;
1382
1382
  const { range: i } = n, { unitId: r, sheetId: o } = J(e);
@@ -1387,7 +1387,7 @@ function Bi(a, e) {
1387
1387
  sheetId: o
1388
1388
  };
1389
1389
  }
1390
- function vi(a, e) {
1390
+ function Vi(a, e) {
1391
1391
  var u, f;
1392
1392
  const { params: n } = a;
1393
1393
  if (!n) return null;
@@ -1400,7 +1400,7 @@ function vi(a, e) {
1400
1400
  rangeFilteredRows: (f = (u = e.getSheetBySheetId(o)) == null ? void 0 : u.getRangeFilterRows(i)) != null ? f : []
1401
1401
  };
1402
1402
  }
1403
- function Vi(a, e) {
1403
+ function Gi(a, e) {
1404
1404
  const { params: n } = a;
1405
1405
  if (!n) return null;
1406
1406
  const { range: i } = n, { unitId: r, sheetId: o } = J(e);
@@ -1411,7 +1411,7 @@ function Vi(a, e) {
1411
1411
  sheetId: o
1412
1412
  };
1413
1413
  }
1414
- function Gi(a, e) {
1414
+ function Hi(a, e) {
1415
1415
  const { params: n } = a;
1416
1416
  if (!n) return null;
1417
1417
  const { range: i } = n, { unitId: r, sheetId: o } = J(e);
@@ -1422,7 +1422,7 @@ function Gi(a, e) {
1422
1422
  sheetId: o
1423
1423
  };
1424
1424
  }
1425
- function Hi(a, e) {
1425
+ function wi(a, e) {
1426
1426
  const { params: n } = a;
1427
1427
  if (!n) return null;
1428
1428
  const { range: i } = n, { unitId: r, sheetId: o } = J(e);
@@ -1433,7 +1433,7 @@ function Hi(a, e) {
1433
1433
  sheetId: o
1434
1434
  };
1435
1435
  }
1436
- function wi(a, e) {
1436
+ function Yi(a, e) {
1437
1437
  const { params: n } = a;
1438
1438
  if (!n) return null;
1439
1439
  const { unitId: i, subUnitId: r, name: o } = n, { unitId: u, sheetId: f } = J(e);
@@ -1444,7 +1444,7 @@ function wi(a, e) {
1444
1444
  sheetName: o
1445
1445
  };
1446
1446
  }
1447
- function Yi(a, e) {
1447
+ function Xi(a, e) {
1448
1448
  const { params: n } = a;
1449
1449
  if (!n) return null;
1450
1450
  const { unitId: i, subUnitId: r } = n, { unitId: o, sheetId: u } = J(e);
@@ -1454,7 +1454,7 @@ function Yi(a, e) {
1454
1454
  sheetId: r || u
1455
1455
  };
1456
1456
  }
1457
- function Xi(a, e) {
1457
+ function Wi(a, e) {
1458
1458
  const { params: n } = a;
1459
1459
  if (!n) return null;
1460
1460
  const { unitId: i, name: r, id: o } = n, { sheetId: u } = J(e);
@@ -1466,7 +1466,7 @@ function Xi(a, e) {
1466
1466
  definedNameId: o
1467
1467
  };
1468
1468
  }
1469
- function Wi(a, e) {
1469
+ function Ki(a, e) {
1470
1470
  const { params: n } = a;
1471
1471
  if (!n) return null;
1472
1472
  const { unitId: i, name: r, id: o } = n, { sheetId: u } = J(e);
@@ -1478,12 +1478,12 @@ function Wi(a, e) {
1478
1478
  definedNameId: o
1479
1479
  };
1480
1480
  }
1481
- var Ki = Object.getOwnPropertyDescriptor, ki = (a, e, n, i) => {
1482
- for (var r = i > 1 ? void 0 : i ? Ki(e, n) : e, o = a.length - 1, u; o >= 0; o--)
1481
+ var ki = Object.getOwnPropertyDescriptor, Qi = (a, e, n, i) => {
1482
+ for (var r = i > 1 ? void 0 : i ? ki(e, n) : e, o = a.length - 1, u; o >= 0; o--)
1483
1483
  (u = a[o]) && (r = u(r) || r);
1484
1484
  return r;
1485
- }, Ve = (a, e) => (n, i) => e(n, i, a);
1486
- let je = class extends ae {
1485
+ }, ve = (a, e) => (n, i) => e(n, i, a);
1486
+ let $e = class extends ae {
1487
1487
  constructor(a, e, n, i) {
1488
1488
  super(), this._definedNamesService = a, this._univerInstanceService = e, this._sheetInterceptorService = n, this._lexerTreeBuilder = i, this._initialize();
1489
1489
  }
@@ -1494,7 +1494,7 @@ let je = class extends ae {
1494
1494
  this.disposeWithMe(
1495
1495
  this._sheetInterceptorService.interceptCommand({
1496
1496
  getMutations: (a) => {
1497
- if (a.id === ya.id || a.id === _a.id)
1497
+ if (a.id === qa.id || a.id === ya.id)
1498
1498
  return {
1499
1499
  redos: [],
1500
1500
  undos: []
@@ -1505,7 +1505,7 @@ let je = class extends ae {
1505
1505
  redos: [],
1506
1506
  undos: []
1507
1507
  };
1508
- const n = Ga(e, a);
1508
+ const n = Ha(e, a);
1509
1509
  return n ? this._getUpdateDefinedNameMutations(e, n) : {
1510
1510
  redos: [],
1511
1511
  undos: []
@@ -1552,13 +1552,13 @@ let je = class extends ae {
1552
1552
  } = e;
1553
1553
  if (O == null || M == null || M.length === 0 || Q !== M)
1554
1554
  continue;
1555
- V = mt({
1555
+ V = ut({
1556
1556
  range: h,
1557
1557
  sheetName: O,
1558
1558
  unitId: q
1559
1559
  });
1560
1560
  } else
1561
- V = Va(
1561
+ V = Ga(
1562
1562
  U,
1563
1563
  e,
1564
1564
  i,
@@ -1571,8 +1571,8 @@ let je = class extends ae {
1571
1571
  }
1572
1572
  if (!P)
1573
1573
  return !0;
1574
- const p = Qe(va(s, E)), R = {
1575
- id: qe.id,
1574
+ const p = ke(Va(s, E)), R = {
1575
+ id: ye.id,
1576
1576
  params: {
1577
1577
  unitId: i,
1578
1578
  ...m,
@@ -1581,7 +1581,7 @@ let je = class extends ae {
1581
1581
  };
1582
1582
  u.push(R);
1583
1583
  const S = {
1584
- id: qe.id,
1584
+ id: ye.id,
1585
1585
  params: {
1586
1586
  unitId: i,
1587
1587
  ...m
@@ -1599,18 +1599,18 @@ let je = class extends ae {
1599
1599
  return ((o = this._definedNamesService.getWorksheetByRef(e, i)) == null ? void 0 : o.getSheetId()) === n ? j.REF : null;
1600
1600
  }
1601
1601
  };
1602
- je = ki([
1603
- Ve(0, Ut),
1604
- Ve(1, Ae),
1605
- Ve(2, X(gt)),
1606
- Ve(3, X(Ft))
1607
- ], je);
1608
- var Qi = Object.getOwnPropertyDescriptor, $i = (a, e, n, i) => {
1609
- for (var r = i > 1 ? void 0 : i ? Qi(e, n) : e, o = a.length - 1, u; o >= 0; o--)
1602
+ $e = Qi([
1603
+ ve(0, Ut),
1604
+ ve(1, Ae),
1605
+ ve(2, X(gt)),
1606
+ ve(3, X(Ft))
1607
+ ], $e);
1608
+ var $i = Object.getOwnPropertyDescriptor, ji = (a, e, n, i) => {
1609
+ for (var r = i > 1 ? void 0 : i ? $i(e, n) : e, o = a.length - 1, u; o >= 0; o--)
1610
1610
  (u = a[o]) && (r = u(r) || r);
1611
1611
  return r;
1612
1612
  }, me = (a, e) => (n, i) => e(n, i, a);
1613
- let ze = class extends ae {
1613
+ let je = class extends ae {
1614
1614
  constructor(a, e, n, i, r, o, u, f) {
1615
1615
  super(), this._univerInstanceService = a, this._commandService = e, this._lexerTreeBuilder = n, this._formulaDataModel = i, this._sheetInterceptorService = r, this._definedNamesService = o, this._configService = u, this._injector = f, this._commandExecutedListener();
1616
1616
  }
@@ -1629,12 +1629,12 @@ let ze = class extends ae {
1629
1629
  this._commandService.beforeCommandExecuted((a, e) => {
1630
1630
  if (a.id === Z.id) {
1631
1631
  const n = a.params;
1632
- if (e && e.onlyLocal === !0 || n.trigger === qt.id || n.trigger === Ta.id || n.trigger === Ea.id)
1632
+ if (e && e.onlyLocal === !0 || n.trigger === qt.id || n.trigger === Ea.id || n.trigger === Ia.id)
1633
1633
  return;
1634
1634
  this._handleSetRangeValuesMutation(n);
1635
1635
  }
1636
1636
  })
1637
- ), 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)));
1637
+ ), 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)));
1638
1638
  }
1639
1639
  _handleSetRangeValuesMutation(a) {
1640
1640
  const { subUnitId: e, unitId: n, cellValue: i } = a;
@@ -1650,14 +1650,14 @@ let ze = class extends ae {
1650
1650
  {
1651
1651
  unitId: n,
1652
1652
  subUnitId: e,
1653
- cellValue: _i(r)
1653
+ cellValue: yi(r)
1654
1654
  },
1655
1655
  {
1656
1656
  onlyLocal: !0,
1657
1657
  fromFormula: !0
1658
1658
  }
1659
1659
  ), this._formulaDataModel.updateArrayFormulaCellData(n, e, i), this._formulaDataModel.updateArrayFormulaRange(n, e, i), this._commandService.executeCommand(
1660
- ve.id,
1660
+ Be.id,
1661
1661
  {
1662
1662
  formulaData: o
1663
1663
  },
@@ -1680,7 +1680,7 @@ let ze = class extends ae {
1680
1680
  _handleWorkbookDisposed(a, e) {
1681
1681
  const n = this._formulaDataModel.getFormulaData(), i = Lt(n, a, e), r = this._formulaDataModel.getArrayFormulaRange(), o = Lt(r, a, e), u = this._formulaDataModel.getArrayFormulaCellData(), f = Lt(u, a, e);
1682
1682
  i && this._commandService.executeCommand(
1683
- ve.id,
1683
+ Be.id,
1684
1684
  {
1685
1685
  formulaData: i
1686
1686
  },
@@ -1701,7 +1701,7 @@ let ze = class extends ae {
1701
1701
  _handleInsertSheetMutation(a) {
1702
1702
  const { sheet: e, unitId: n } = a, i = this._formulaDataModel.getFormulaData(), { id: r, cellData: o } = e, u = new G(o), f = ta(i, n, r, u);
1703
1703
  this._commandService.executeCommand(
1704
- ve.id,
1704
+ Be.id,
1705
1705
  {
1706
1706
  formulaData: f
1707
1707
  },
@@ -1717,8 +1717,8 @@ let ze = class extends ae {
1717
1717
  var p;
1718
1718
  const s = c.getCellMatrix(), P = c.getSheetId(), E = ta(e, n, P, s);
1719
1719
  i[n][P] = (p = E[n]) == null ? void 0 : p[P];
1720
- }), this._commandService.executeCommand(ve.id, { formulaData: i }, { onlyLocal: !0 });
1721
- const o = this._configService.getConfig(he), u = (m = o == null ? void 0 : o.initialFormulaComputing) != null ? m : Le.WHEN_EMPTY, f = this._getDirtyDataByCalculationMode(u);
1720
+ }), this._commandService.executeCommand(Be.id, { formulaData: i }, { onlyLocal: !0 });
1721
+ const o = this._configService.getConfig(ge), u = (m = o == null ? void 0 : o.initialFormulaComputing) != null ? m : Le.WHEN_EMPTY, f = this._getDirtyDataByCalculationMode(u);
1722
1722
  this._commandService.executeCommand(Ie.id, f, { onlyLocal: !0 });
1723
1723
  }
1724
1724
  _getDirtyDataByCalculationMode(a) {
@@ -1740,13 +1740,13 @@ let ze = class extends ae {
1740
1740
  undos: [],
1741
1741
  redos: []
1742
1742
  };
1743
- const n = Ga(e, a);
1743
+ const n = Ha(e, a);
1744
1744
  if (n) {
1745
1745
  const { unitSheetNameMap: i } = this._formulaDataModel.getCalculateData(), r = this._formulaDataModel.getFormulaData(), { newFormulaData: o } = this._getFormulaReferenceMoveInfo(
1746
1746
  r,
1747
1747
  i,
1748
1748
  n
1749
- ), { undos: u, redos: f } = fi(r, o, n);
1749
+ ), { undos: u, redos: f } = ci(r, o, n);
1750
1750
  return {
1751
1751
  undos: u,
1752
1752
  redos: f
@@ -1759,7 +1759,7 @@ let ze = class extends ae {
1759
1759
  }
1760
1760
  // eslint-disable-next-line max-lines-per-function
1761
1761
  _getFormulaReferenceMoveInfo(a, e, n) {
1762
- if (!Me.isDefine(a)) return { newFormulaData: {}, oldFormulaData: {} };
1762
+ if (!ft.isDefine(a)) return { newFormulaData: {}, oldFormulaData: {} };
1763
1763
  const i = Object.keys(a);
1764
1764
  if (i.length === 0) return { newFormulaData: {}, oldFormulaData: {} };
1765
1765
  const r = {}, o = {};
@@ -1768,7 +1768,7 @@ let ze = class extends ae {
1768
1768
  if (f == null)
1769
1769
  continue;
1770
1770
  const m = Object.keys(f);
1771
- Me.isDefine(r[u]) || (r[u] = {}), Me.isDefine(o[u]) || (o[u] = {});
1771
+ ft.isDefine(r[u]) || (r[u] = {}), ft.isDefine(o[u]) || (o[u] = {});
1772
1772
  for (const c of m) {
1773
1773
  const s = new G(f[c] || {}), P = new G();
1774
1774
  s.forValue((E, p, R) => {
@@ -1799,7 +1799,7 @@ let ze = class extends ae {
1799
1799
  } else if (Q !== ee.REFERENCE)
1800
1800
  continue;
1801
1801
  const Pe = pe(V), { range: ne, sheetName: re, unitId: k } = Pe, oe = k == null || k.length === 0 ? u : k, z = ((B = e == null ? void 0 : e[oe]) == null ? void 0 : B[re]) || "";
1802
- if (!Ba(
1802
+ if (!va(
1803
1803
  n.unitId,
1804
1804
  n.sheetId,
1805
1805
  u,
@@ -1808,7 +1808,7 @@ let ze = class extends ae {
1808
1808
  z
1809
1809
  ))
1810
1810
  continue;
1811
- const Ue = {
1811
+ const he = {
1812
1812
  range: ne,
1813
1813
  sheetId: z,
1814
1814
  unitId: k,
@@ -1825,7 +1825,7 @@ let ze = class extends ae {
1825
1825
  } = n;
1826
1826
  if (le == null || z == null || z.length === 0 || Ee !== z)
1827
1827
  continue;
1828
- ue = mt({
1828
+ ue = ut({
1829
1829
  range: ne,
1830
1830
  sheetName: le,
1831
1831
  unitId: k
@@ -1839,8 +1839,8 @@ let ze = class extends ae {
1839
1839
  if (z == null || z.length === 0 || Ee !== z)
1840
1840
  continue;
1841
1841
  ue = j.REF;
1842
- } else O !== y.SetDefinedName && (ue = Va(
1843
- Ue,
1842
+ } else O !== y.SetDefinedName && (ue = Ga(
1843
+ he,
1844
1844
  n,
1845
1845
  u,
1846
1846
  c
@@ -1852,9 +1852,9 @@ let ze = class extends ae {
1852
1852
  }
1853
1853
  if (!T)
1854
1854
  return !0;
1855
- const h = va(I, g, N, d);
1855
+ const h = Va(I, g, N, d);
1856
1856
  P.setValue(E, p, {
1857
- f: `=${Qe(h)}`
1857
+ f: `=${ke(h)}`
1858
1858
  });
1859
1859
  }), o[u] && (o[u][c] = P.getData());
1860
1860
  }
@@ -1862,23 +1862,23 @@ let ze = class extends ae {
1862
1862
  return { newFormulaData: o };
1863
1863
  }
1864
1864
  };
1865
- ze = $i([
1865
+ je = ji([
1866
1866
  me(0, Ae),
1867
1867
  me(1, ce),
1868
1868
  me(2, X(Ft)),
1869
- me(3, X(ut)),
1869
+ me(3, X(ot)),
1870
1870
  me(4, X(gt)),
1871
1871
  me(5, Ut),
1872
1872
  me(6, Ce),
1873
- me(7, X(ot))
1874
- ], ze);
1875
- const ji = "SHEETS_FORMULA_PLUGIN";
1876
- var zi = Object.getOwnPropertyDescriptor, Zi = (a, e, n, i) => {
1877
- for (var r = i > 1 ? void 0 : i ? zi(e, n) : e, o = a.length - 1, u; o >= 0; o--)
1873
+ me(7, X(rt))
1874
+ ], je);
1875
+ const zi = "SHEETS_FORMULA_PLUGIN";
1876
+ var Zi = Object.getOwnPropertyDescriptor, Ji = (a, e, n, i) => {
1877
+ for (var r = i > 1 ? void 0 : i ? Zi(e, n) : e, o = a.length - 1, u; o >= 0; o--)
1878
1878
  (u = a[o]) && (r = u(r) || r);
1879
1879
  return r;
1880
1880
  }, Et = (a, e) => (n, i) => e(n, i, a);
1881
- let Ze = class extends ae {
1881
+ let ze = class extends ae {
1882
1882
  constructor(a, e, n) {
1883
1883
  super(), this._activeDirtyManagerService = a, this._univerInstanceService = e, this._formulaDataModel = n, this._initialize();
1884
1884
  }
@@ -2059,8 +2059,8 @@ let Ze = class extends ae {
2059
2059
  });
2060
2060
  }
2061
2061
  _initialDefinedName() {
2062
- this._activeDirtyManagerService.register(qe.id, {
2063
- commandId: qe.id,
2062
+ this._activeDirtyManagerService.register(ye.id, {
2063
+ commandId: ye.id,
2064
2064
  getDirtyData: (a) => {
2065
2065
  const e = a.params;
2066
2066
  return { dirtyDefinedNameMap: this._getDefinedNameMutation(e) };
@@ -2172,17 +2172,17 @@ let Ze = class extends ae {
2172
2172
  return i;
2173
2173
  }
2174
2174
  };
2175
- Ze = Zi([
2175
+ ze = Ji([
2176
2176
  Et(0, ht),
2177
2177
  Et(1, Ae),
2178
- Et(2, X(ut))
2179
- ], Ze);
2180
- var Ji = Object.getOwnPropertyDescriptor, er = (a, e, n, i) => {
2181
- for (var r = i > 1 ? void 0 : i ? Ji(e, n) : e, o = a.length - 1, u; o >= 0; o--)
2178
+ Et(2, X(ot))
2179
+ ], ze);
2180
+ var er = Object.getOwnPropertyDescriptor, tr = (a, e, n, i) => {
2181
+ for (var r = i > 1 ? void 0 : i ? er(e, n) : e, o = a.length - 1, u; o >= 0; o--)
2182
2182
  (u = a[o]) && (r = u(r) || r);
2183
2183
  return r;
2184
- }, Ge = (a, e) => (n, i) => e(n, i, a);
2185
- let Je = class extends ae {
2184
+ }, Ve = (a, e) => (n, i) => e(n, i, a);
2185
+ let Ze = class extends ae {
2186
2186
  constructor(a, e, n, i) {
2187
2187
  super(), this._commandService = a, this._configService = e, this._sheetInterceptorService = n, this._formulaDataModel = i, this._initialize();
2188
2188
  }
@@ -2199,7 +2199,7 @@ let Je = class extends ae {
2199
2199
  if (e == null)
2200
2200
  return;
2201
2201
  const { arrayFormulaRange: n, arrayFormulaCellData: i } = e;
2202
- this._formulaDataModel.setArrayFormulaRange(n), this._formulaDataModel.setArrayFormulaCellData(i), (r = this._configService.getConfig(he)) != null && r.writeArrayFormulaToSnapshot && this._writeArrayFormulaToSnapshot(n, i);
2202
+ this._formulaDataModel.setArrayFormulaRange(n), this._formulaDataModel.setArrayFormulaCellData(i), (r = this._configService.getConfig(ge)) != null && r.writeArrayFormulaToSnapshot && this._writeArrayFormulaToSnapshot(n, i);
2203
2203
  })
2204
2204
  );
2205
2205
  }
@@ -2208,7 +2208,7 @@ let Je = class extends ae {
2208
2208
  i && Array.from(Object.entries(i)).forEach(([r, o]) => {
2209
2209
  const u = new G();
2210
2210
  new G(o).forValue((m, c, s) => {
2211
- u.setValue(m, c, { ref: ye(s) });
2211
+ u.setValue(m, c, { ref: _e(s) });
2212
2212
  }), this._commandService.executeCommand(Z.id, {
2213
2213
  unitId: n,
2214
2214
  subUnitId: r,
@@ -2233,26 +2233,26 @@ let Je = class extends ae {
2233
2233
  }
2234
2234
  _initInterceptorCellContent() {
2235
2235
  this.disposeWithMe(
2236
- this._sheetInterceptorService.intercept(Pn.CELL_CONTENT, {
2236
+ this._sheetInterceptorService.intercept(Tn.CELL_CONTENT, {
2237
2237
  priority: 100,
2238
- effect: Qa.Value,
2238
+ effect: $a.Value,
2239
2239
  handler: (a, e, n) => {
2240
2240
  var s, P, E;
2241
2241
  let i = a;
2242
2242
  const { unitId: r, subUnitId: o, row: u, col: f } = e, m = this._formulaDataModel.getArrayFormulaCellData(), c = (E = (P = (s = m == null ? void 0 : m[r]) == null ? void 0 : s[o]) == null ? void 0 : P[u]) == null ? void 0 : E[f];
2243
- return c == null ? n(i) : ((!i || i === e.rawData) && (i = { ...e.rawData }), c.v == null && c.t == null ? (i.v = 0, i.t = Gt.NUMBER, n(i)) : (i == null ? void 0 : i.t) === Gt.NUMBER && i.v !== void 0 && i.v !== null && $a(i.v) ? (i.v = bn(Number(i.v)), n(i)) : (i.v = c.v, i.t = c.t, n(i)));
2243
+ return c == null ? n(i) : ((!i || i === e.rawData) && (i = { ...e.rawData }), c.v == null && c.t == null ? (i.v = 0, i.t = Gt.NUMBER, n(i)) : (i == null ? void 0 : i.t) === Gt.NUMBER && i.v !== void 0 && i.v !== null && ja(i.v) ? (i.v = On(Number(i.v)), n(i)) : (i.v = c.v, i.t = c.t, n(i)));
2244
2244
  }
2245
2245
  })
2246
2246
  );
2247
2247
  }
2248
2248
  };
2249
- Je = er([
2250
- Ge(0, ce),
2251
- Ge(1, Ce),
2252
- Ge(2, X(gt)),
2253
- Ge(3, X(ut))
2254
- ], Je);
2255
- const tr = [
2249
+ Ze = tr([
2250
+ Ve(0, ce),
2251
+ Ve(1, Ce),
2252
+ Ve(2, X(gt)),
2253
+ Ve(3, X(ot))
2254
+ ], Ze);
2255
+ const ar = [
2256
2256
  {
2257
2257
  functionName: aa.ARRAY_CONSTRAIN,
2258
2258
  functionType: t.Array,
@@ -2304,7 +2304,7 @@ const tr = [
2304
2304
  }
2305
2305
  ]
2306
2306
  }
2307
- ], ar = [
2307
+ ], nr = [
2308
2308
  {
2309
2309
  functionName: x.BETADIST,
2310
2310
  functionType: t.Compatibility,
@@ -3358,7 +3358,7 @@ const tr = [
3358
3358
  }
3359
3359
  ]
3360
3360
  }
3361
- ], nr = [
3361
+ ], ir = [
3362
3362
  {
3363
3363
  functionName: se.CUBEKPIMEMBER,
3364
3364
  functionType: t.Cube,
@@ -3513,7 +3513,7 @@ const tr = [
3513
3513
  }
3514
3514
  ]
3515
3515
  }
3516
- ], ir = [
3516
+ ], rr = [
3517
3517
  {
3518
3518
  functionName: $.DAVERAGE,
3519
3519
  functionType: t.Database,
@@ -3862,7 +3862,7 @@ const tr = [
3862
3862
  }
3863
3863
  ]
3864
3864
  }
3865
- ], rr = [
3865
+ ], or = [
3866
3866
  {
3867
3867
  functionName: F.DATE,
3868
3868
  functionType: t.Date,
@@ -4434,7 +4434,7 @@ const tr = [
4434
4434
  }
4435
4435
  ]
4436
4436
  }
4437
- ], or = [
4437
+ ], ur = [
4438
4438
  {
4439
4439
  functionName: A.BESSELI,
4440
4440
  functionType: t.Engineering,
@@ -5507,7 +5507,7 @@ const tr = [
5507
5507
  }
5508
5508
  ]
5509
5509
  }
5510
- ], ur = [
5510
+ ], mr = [
5511
5511
  {
5512
5512
  functionName: C.ACCRINT,
5513
5513
  functionType: t.Financial,
@@ -7768,7 +7768,7 @@ const tr = [
7768
7768
  }
7769
7769
  ]
7770
7770
  }
7771
- ], mr = [
7771
+ ], fr = [
7772
7772
  {
7773
7773
  functionName: v.CELL,
7774
7774
  functionType: t.Information,
@@ -8177,7 +8177,7 @@ const tr = [
8177
8177
  }
8178
8178
  ]
8179
8179
  }
8180
- ], fr = [
8180
+ ], cr = [
8181
8181
  {
8182
8182
  functionName: K.AND,
8183
8183
  functionType: t.Logical,
@@ -8651,7 +8651,7 @@ const tr = [
8651
8651
  }
8652
8652
  ]
8653
8653
  }
8654
- ], cr = [
8654
+ ], lr = [
8655
8655
  {
8656
8656
  functionName: _.ADDRESS,
8657
8657
  functionType: t.Lookup,
@@ -9683,7 +9683,7 @@ const tr = [
9683
9683
  }
9684
9684
  ]
9685
9685
  }
9686
- ], lr = [
9686
+ ], sr = [
9687
9687
  {
9688
9688
  functionName: L.ABS,
9689
9689
  functionType: t.Math,
@@ -11321,7 +11321,7 @@ const tr = [
11321
11321
  }
11322
11322
  ]
11323
11323
  }
11324
- ], sr = [
11324
+ ], dr = [
11325
11325
  {
11326
11326
  functionName: l.AVEDEV,
11327
11327
  functionType: t.Statistical,
@@ -14263,7 +14263,7 @@ const tr = [
14263
14263
  }
14264
14264
  ]
14265
14265
  }
14266
- ], dr = [
14266
+ ], pr = [
14267
14267
  {
14268
14268
  functionName: b.ASC,
14269
14269
  functionType: t.Text,
@@ -15477,7 +15477,7 @@ const tr = [
15477
15477
  }
15478
15478
  ]
15479
15479
  }
15480
- ], pr = [], Lr = [
15480
+ ], Lr = [], Pr = [
15481
15481
  {
15482
15482
  functionName: st.ENCODEURL,
15483
15483
  functionType: t.Web,
@@ -15537,29 +15537,29 @@ const tr = [
15537
15537
  }
15538
15538
  ]
15539
15539
  }
15540
- ], Pr = [
15541
- ...ur,
15542
- ...rr,
15543
- ...lr,
15540
+ ], Tr = [
15541
+ ...mr,
15542
+ ...or,
15544
15543
  ...sr,
15545
- ...cr,
15546
- ...ir,
15547
15544
  ...dr,
15545
+ ...lr,
15546
+ ...rr,
15547
+ ...pr,
15548
+ ...cr,
15548
15549
  ...fr,
15549
- ...mr,
15550
- ...or,
15550
+ ...ur,
15551
+ ...ir,
15551
15552
  ...nr,
15553
+ ...Pr,
15552
15554
  ...ar,
15553
- ...Lr,
15554
- ...tr,
15555
- ...pr
15555
+ ...Lr
15556
15556
  ];
15557
- function Tr(a, e) {
15557
+ function Er(a, e) {
15558
15558
  let n = "";
15559
15559
  return a.aliasFunctionName ? (n = e.t(a.aliasFunctionName), n === a.aliasFunctionName && (n = a.functionName)) : n = a.functionName, n;
15560
15560
  }
15561
- var Er = Object.getOwnPropertyDescriptor, Ir = (a, e, n, i) => {
15562
- for (var r = i > 1 ? void 0 : i ? Er(e, n) : e, o = a.length - 1, u; o >= 0; o--)
15561
+ var Ir = Object.getOwnPropertyDescriptor, Nr = (a, e, n, i) => {
15562
+ for (var r = i > 1 ? void 0 : i ? Ir(e, n) : e, o = a.length - 1, u; o >= 0; o--)
15563
15563
  (u = a[o]) && (r = u(r) || r);
15564
15564
  return r;
15565
15565
  }, It = (a, e) => (n, i) => e(n, i, a);
@@ -15622,7 +15622,7 @@ let bt = class {
15622
15622
  if (e.length === 0)
15623
15623
  return !1;
15624
15624
  const n = e[0].description;
15625
- return !On(n);
15625
+ return !Mn(n);
15626
15626
  }
15627
15627
  _initialize() {
15628
15628
  this._localeService.localeChanged$.subscribe(() => {
@@ -15632,7 +15632,6 @@ let bt = class {
15632
15632
  _initDescription() {
15633
15633
  var i;
15634
15634
  const a = [
15635
- ...Mn,
15636
15635
  ...xn,
15637
15636
  ..._n,
15638
15637
  ...yn,
@@ -15647,13 +15646,14 @@ let bt = class {
15647
15646
  ...Gn,
15648
15647
  ...Hn,
15649
15648
  ...wn,
15650
- ...Yn
15651
- ].map((r) => r[1]), e = Pr.filter((r) => a.includes(r.functionName)), n = this._configService.getConfig(he);
15649
+ ...Yn,
15650
+ ...Xn
15651
+ ].map((r) => r[1]), e = Tr.filter((r) => a.includes(r.functionName)), n = this._configService.getConfig(ge);
15652
15652
  this._descriptions = e.concat((i = n == null ? void 0 : n.description) != null ? i : []);
15653
15653
  }
15654
15654
  _registerDescriptions() {
15655
15655
  const a = this._localeService, e = this._descriptions.map((n) => ({
15656
- functionName: Tr(n, a),
15656
+ functionName: Er(n, a),
15657
15657
  functionType: n.functionType,
15658
15658
  description: a.t(n.description),
15659
15659
  abstract: a.t(n.abstract),
@@ -15668,17 +15668,17 @@ let bt = class {
15668
15668
  this._functionService.registerDescriptions(...e);
15669
15669
  }
15670
15670
  };
15671
- bt = Ir([
15671
+ bt = Nr([
15672
15672
  It(0, Bt),
15673
15673
  It(1, X(_t)),
15674
15674
  It(2, Ce)
15675
15675
  ], bt);
15676
- var Nr = Object.getOwnPropertyDescriptor, Rr = (a, e, n, i) => {
15677
- for (var r = i > 1 ? void 0 : i ? Nr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
15676
+ var Rr = Object.getOwnPropertyDescriptor, Sr = (a, e, n, i) => {
15677
+ for (var r = i > 1 ? void 0 : i ? Rr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
15678
15678
  (u = a[o]) && (r = u(r) || r);
15679
15679
  return r;
15680
- }, He = (a, e) => (n, i) => e(n, i, a);
15681
- let et = class extends ae {
15680
+ }, Ge = (a, e) => (n, i) => e(n, i, a);
15681
+ let Je = class extends ae {
15682
15682
  constructor(e, n, i, r) {
15683
15683
  super();
15684
15684
  W(this, "_preUnitId", null);
@@ -15705,9 +15705,9 @@ let et = class extends ae {
15705
15705
  this.disposeWithMe(
15706
15706
  this._commandService.onCommandExecuted((e, n) => {
15707
15707
  if (!(n != null && n.fromCollab)) {
15708
- if (e.id === Tn.id)
15708
+ if (e.id === En.id)
15709
15709
  this._unregisterDescriptionsForNotInSheetId(), this._registerDescriptions();
15710
- else if (e.id === qe.id) {
15710
+ else if (e.id === ye.id) {
15711
15711
  const i = e.params;
15712
15712
  this._registerDescription(i);
15713
15713
  } else if (e.id === Ct.id) {
@@ -15790,34 +15790,34 @@ let et = class extends ae {
15790
15790
  }), this._descriptionService.unregisterDescriptions(r);
15791
15791
  }
15792
15792
  };
15793
- et = Rr([
15794
- He(0, vt),
15795
- He(1, Ut),
15796
- He(2, Ae),
15797
- He(3, ce)
15798
- ], et);
15799
- var Sr = Object.getOwnPropertyDescriptor, Ar = (a, e, n, i) => {
15800
- for (var r = i > 1 ? void 0 : i ? Sr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
15793
+ Je = Sr([
15794
+ Ge(0, vt),
15795
+ Ge(1, Ut),
15796
+ Ge(2, Ae),
15797
+ Ge(3, ce)
15798
+ ], Je);
15799
+ var Ar = Object.getOwnPropertyDescriptor, Cr = (a, e, n, i) => {
15800
+ for (var r = i > 1 ? void 0 : i ? Ar(e, n) : e, o = a.length - 1, u; o >= 0; o--)
15801
15801
  (u = a[o]) && (r = u(r) || r);
15802
15802
  return r;
15803
- }, Cr = (a, e) => (n, i) => e(n, i, a);
15804
- let tt = class extends ae {
15803
+ }, Dr = (a, e) => (n, i) => e(n, i, a);
15804
+ let et = class extends ae {
15805
15805
  constructor(a) {
15806
15806
  super(), this._commandService = a, [
15807
- ei,
15808
15807
  ti,
15808
+ ai,
15809
15809
  Oe
15810
15810
  ].forEach((e) => this._commandService.registerCommand(e));
15811
15811
  }
15812
15812
  };
15813
- tt = Ar([
15814
- Cr(0, ce)
15815
- ], tt);
15816
- var Dr = Object.getOwnPropertyDescriptor, br = (a, e, n, i) => {
15817
- for (var r = i > 1 ? void 0 : i ? Dr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
15813
+ et = Cr([
15814
+ Dr(0, ce)
15815
+ ], et);
15816
+ var br = Object.getOwnPropertyDescriptor, Or = (a, e, n, i) => {
15817
+ for (var r = i > 1 ? void 0 : i ? br(e, n) : e, o = a.length - 1, u; o >= 0; o--)
15818
15818
  (u = a[o]) && (r = u(r) || r);
15819
15819
  return r;
15820
- }, we = (a, e) => (n, i) => e(n, i, a);
15820
+ }, He = (a, e) => (n, i) => e(n, i, a);
15821
15821
  function ca(a, e, n, i) {
15822
15822
  const r = a.sequenceNodesBuilder(e);
15823
15823
  if (r == null)
@@ -15829,7 +15829,7 @@ function ca(a, e, n, i) {
15829
15829
  continue;
15830
15830
  const { token: c } = m, s = pe(c), { sheetName: P, unitId: E } = s;
15831
15831
  let p = s.range;
15832
- p.startAbsoluteRefType === ke.ALL && p.endAbsoluteRefType === ke.ALL || (p = Nt(p, n, i), o.push({
15832
+ p.startAbsoluteRefType === Ke.ALL && p.endAbsoluteRefType === Ke.ALL || (p = Nt(p, n, i), o.push({
15833
15833
  unitId: E,
15834
15834
  sheetName: P,
15835
15835
  range: p
@@ -15854,7 +15854,7 @@ let Ot = class extends ae {
15854
15854
  let T = "";
15855
15855
  if (I) {
15856
15856
  const g = I.startColumn - E.startColumn, h = I.startRow - E.startRow, B = Nt(E, g, h);
15857
- p && R ? T = na(p, R, B) : R ? T = ia(R, B) : T = ye(B);
15857
+ p && R ? T = na(p, R, B) : R ? T = ia(R, B) : T = _e(B);
15858
15858
  } else
15859
15859
  T = j.REF;
15860
15860
  return {
@@ -15864,10 +15864,10 @@ let Ot = class extends ae {
15864
15864
  } else
15865
15865
  return s;
15866
15866
  });
15867
- return c ? `=${Qe(c)}` : "";
15867
+ return c ? `=${ke(c)}` : "";
15868
15868
  }
15869
15869
  registerFormula(a, e, n, i) {
15870
- const r = /* @__PURE__ */ new Map(), o = this._lexerTreeBuilder.sequenceNodesBuilder(n), u = new Ke(), f = (m) => {
15870
+ const r = /* @__PURE__ */ new Map(), o = this._lexerTreeBuilder.sequenceNodesBuilder(n), u = new We(), f = (m) => {
15871
15871
  const c = this._univerInstanceService.getCurrentUnitForType(te.UNIVER_SHEET), s = c.getActiveSheet(), P = c.getUnitId(), E = s.getSheetId(), p = o == null ? void 0 : o.map((S) => {
15872
15872
  if (typeof S == "object" && S.nodeType === ee.REFERENCE) {
15873
15873
  const N = r.get(S.token);
@@ -15877,7 +15877,7 @@ let Ot = class extends ae {
15877
15877
  let D = "";
15878
15878
  if (d) {
15879
15879
  const I = d.startColumn - N.range.startColumn, T = d.startRow - N.range.startRow, g = Nt(N.range, I, T);
15880
- N.unitId && N.sheetName ? D = na(N.unitId, N.sheetName, g) : N.sheetName ? D = ia(N.sheetName, g) : D = ye(g);
15880
+ N.unitId && N.sheetName ? D = na(N.unitId, N.sheetName, g) : N.sheetName ? D = ia(N.sheetName, g) : D = _e(g);
15881
15881
  } else
15882
15882
  D = j.REF;
15883
15883
  return {
@@ -15886,7 +15886,7 @@ let Ot = class extends ae {
15886
15886
  };
15887
15887
  } else
15888
15888
  return S;
15889
- }), R = p && Qe(p);
15889
+ }), R = p && ke(p);
15890
15890
  return i(`=${R}`);
15891
15891
  };
15892
15892
  return o == null || o.forEach((m) => {
@@ -15905,11 +15905,11 @@ let Ot = class extends ae {
15905
15905
  }), u;
15906
15906
  }
15907
15907
  _getFormulaDependcy(a, e, n, i) {
15908
- const r = xe(n) ? this._lexerTreeBuilder.sequenceNodesBuilder(n) : null, o = [];
15908
+ const r = Me(n) ? this._lexerTreeBuilder.sequenceNodesBuilder(n) : null, o = [];
15909
15909
  return r == null || r.forEach((u) => {
15910
15910
  if (typeof u == "object" && u.nodeType === ee.REFERENCE) {
15911
15911
  const f = pe(u.token), { range: m, unitId: c, sheetName: s } = f;
15912
- if (m.startAbsoluteRefType === ke.ALL && m.endAbsoluteRefType === ke.ALL)
15912
+ if (m.startAbsoluteRefType === Ke.ALL && m.endAbsoluteRefType === Ke.ALL)
15913
15913
  return;
15914
15914
  const P = this._univerInstanceService.getUnit(c || a), E = s ? P == null ? void 0 : P.getSheetBySheetName(s) : P == null ? void 0 : P.getSheetBySheetId(e);
15915
15915
  if (!E)
@@ -15930,13 +15930,13 @@ let Ot = class extends ae {
15930
15930
  }
15931
15931
  // eslint-disable-next-line max-lines-per-function
15932
15932
  registerRangeFormula(a, e, n, i, r) {
15933
- const o = new Ke(), u = i.map((m) => this._getFormulaDependcy(a, e, m, n)), f = (m) => {
15934
- const c = n[0].startRow, s = n[0].startColumn, P = [{ unitId: a, subUnitId: e, ranges: n }, ...u.flat()], E = [], p = In(this._injector, m);
15933
+ const o = new We(), u = i.map((m) => this._getFormulaDependcy(a, e, m, n)), f = (m) => {
15934
+ const c = n[0].startRow, s = n[0].startColumn, P = [{ unitId: a, subUnitId: e, ranges: n }, ...u.flat()], E = [], p = Nn(this._injector, m);
15935
15935
  for (const { unitId: R, subUnitId: S, ranges: N } of P)
15936
15936
  if (R === p.unitId && S === p.subUnitId) {
15937
15937
  const d = [], D = N[0].startRow, I = N[0].startColumn, T = D - c, g = I - s;
15938
15938
  for (const h of p.ranges) {
15939
- const B = N.map((q) => Xe(h, q)).filter(Boolean);
15939
+ const B = N.map((q) => Ye(h, q)).filter(Boolean);
15940
15940
  B.length > 0 && d.push(...B);
15941
15941
  }
15942
15942
  d.length > 0 && E.push(
@@ -15953,12 +15953,12 @@ let Ot = class extends ae {
15953
15953
  S.sort((T, g) => T.startRow - g.startRow || T.startColumn - g.startColumn);
15954
15954
  const N = /* @__PURE__ */ new Map();
15955
15955
  for (let T = 0; T < R.length; T++) {
15956
- const g = R[T], h = g.startRow, B = g.startColumn, q = h - c, M = B - s, U = Nn(g, m).sort((k, oe) => k.startRow - oe.startRow || k.startColumn - oe.startColumn);
15956
+ const g = R[T], h = g.startRow, B = g.startColumn, q = h - c, M = B - s, U = Rn(g, m).sort((k, oe) => k.startRow - oe.startRow || k.startColumn - oe.startColumn);
15957
15957
  if (!U.length)
15958
15958
  continue;
15959
15959
  const V = U[0].startRow, Q = U[0].startColumn, O = V - c, Pe = Q - s, ne = [];
15960
15960
  for (let k = 0; k < i.length; k++) {
15961
- const oe = i[k], z = xe(oe), Ue = z ? this._lexerTreeBuilder.moveFormulaRefOffset(oe, M, q) : oe, ue = z ? this.transformFormulaByEffectCommand(a, e, Ue, m) : Ue, Te = ca(this._lexerTreeBuilder, ue, -Pe, -O);
15961
+ const oe = i[k], z = Me(oe), he = z ? this._lexerTreeBuilder.moveFormulaRefOffset(oe, M, q) : oe, ue = z ? this.transformFormulaByEffectCommand(a, e, he, m) : he, Te = ca(this._lexerTreeBuilder, ue, -Pe, -O);
15962
15962
  ne.push({
15963
15963
  newFormula: ue,
15964
15964
  orginFormula: Te
@@ -15977,7 +15977,7 @@ let Ot = class extends ae {
15977
15977
  for (let q = 0; q < i.length; q++) {
15978
15978
  const M = i[q];
15979
15979
  h.push({
15980
- newFormula: xe(M) ? this._lexerTreeBuilder.moveFormulaRefOffset(M, g - s, T - c) : M,
15980
+ newFormula: Me(M) ? this._lexerTreeBuilder.moveFormulaRefOffset(M, g - s, T - c) : M,
15981
15981
  orginFormula: M
15982
15982
  });
15983
15983
  }
@@ -16017,51 +16017,51 @@ let Ot = class extends ae {
16017
16017
  }), o;
16018
16018
  }
16019
16019
  };
16020
- Ot = br([
16021
- we(0, X(En)),
16022
- we(1, X(Ft)),
16023
- we(2, Ae),
16024
- we(3, X(ot))
16020
+ Ot = Or([
16021
+ He(0, X(In)),
16022
+ He(1, X(Ft)),
16023
+ He(2, Ae),
16024
+ He(3, X(rt))
16025
16025
  ], Ot);
16026
- var Or = Object.getOwnPropertyDescriptor, Mr = (a, e, n, i) => {
16027
- for (var r = i > 1 ? void 0 : i ? Or(e, n) : e, o = a.length - 1, u; o >= 0; o--)
16026
+ var Mr = Object.getOwnPropertyDescriptor, xr = (a, e, n, i) => {
16027
+ for (var r = i > 1 ? void 0 : i ? Mr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
16028
16028
  (u = a[o]) && (r = u(r) || r);
16029
16029
  return r;
16030
- }, xr = (a, e) => (n, i) => e(n, i, a);
16031
- const Vt = "sheets-formula.remote-register-function.service", Ha = yt(Vt);
16032
- let at = class {
16030
+ }, _r = (a, e) => (n, i) => e(n, i, a);
16031
+ const Vt = "sheets-formula.remote-register-function.service", wa = yt(Vt);
16032
+ let tt = class {
16033
16033
  constructor(a) {
16034
16034
  this._functionService = a;
16035
16035
  }
16036
16036
  async registerFunctions(a) {
16037
- const e = a.map(([n, i]) => _r(n, i));
16037
+ const e = a.map(([n, i]) => yr(n, i));
16038
16038
  this._functionService.registerExecutors(...e);
16039
16039
  }
16040
16040
  async registerAsyncFunctions(a) {
16041
- const e = a.map(([n, i]) => yr(n, i));
16041
+ const e = a.map(([n, i]) => qr(n, i));
16042
16042
  this._functionService.registerExecutors(...e);
16043
16043
  }
16044
16044
  async unregisterFunctions(a) {
16045
16045
  this._functionService.unregisterExecutors(...a), this._functionService.unregisterDescriptions(...a), this._functionService.deleteFormulaAstCacheKey(...a);
16046
16046
  }
16047
16047
  };
16048
- at = Mr([
16049
- xr(0, Bt)
16050
- ], at);
16051
- function _r(a, e) {
16048
+ tt = xr([
16049
+ _r(0, Bt)
16050
+ ], tt);
16051
+ function yr(a, e) {
16052
16052
  const n = new Dt(e), i = new Function(`return ${a}`)();
16053
16053
  return n.calculateCustom = i, n;
16054
16054
  }
16055
- function yr(a, e) {
16056
- const n = new qa(e), i = new Function(`return ${a}`)();
16055
+ function qr(a, e) {
16056
+ const n = new ga(e), i = new Function(`return ${a}`)();
16057
16057
  return n.calculateCustom = i, n;
16058
16058
  }
16059
- var qr = Object.getOwnPropertyDescriptor, gr = (a, e, n, i) => {
16060
- for (var r = i > 1 ? void 0 : i ? qr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
16059
+ var gr = Object.getOwnPropertyDescriptor, hr = (a, e, n, i) => {
16060
+ for (var r = i > 1 ? void 0 : i ? gr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
16061
16061
  (u = a[o]) && (r = u(r) || r);
16062
16062
  return r;
16063
- }, Ye = (a, e) => (n, i) => e(n, i, a);
16064
- const hr = yt(
16063
+ }, we = (a, e) => (n, i) => e(n, i, a);
16064
+ const Ur = yt(
16065
16065
  "sheets-formula.register-function-service"
16066
16066
  );
16067
16067
  let Mt = class extends ae {
@@ -16077,7 +16077,7 @@ let Mt = class extends ae {
16077
16077
  registerFunctions(a) {
16078
16078
  const { locales: e, description: n, calculate: i } = a;
16079
16079
  e && this._localeService.load(e);
16080
- const r = new Ke();
16080
+ const r = new We();
16081
16081
  if (n)
16082
16082
  r.add(this._descriptionService.registerDescriptions(n));
16083
16083
  else {
@@ -16093,7 +16093,7 @@ let Mt = class extends ae {
16093
16093
  return r.add(this._registerLocalExecutors(i)), this._remoteRegisterFunctionService && r.add(this._registerRemoteExecutors(i)), r;
16094
16094
  }
16095
16095
  _registerSingleFunction(a) {
16096
- const { name: e, func: n, description: i, locales: r, async: o = !1 } = a, u = new Ke();
16096
+ const { name: e, func: n, description: i, locales: r, async: o = !1 } = a, u = new We();
16097
16097
  if (r && this._localeService.load(r), typeof i == "string") {
16098
16098
  const m = {
16099
16099
  functionName: e,
@@ -16105,7 +16105,7 @@ let Mt = class extends ae {
16105
16105
  u.add(this._descriptionService.registerDescriptions([m]));
16106
16106
  } else
16107
16107
  u.add(this._descriptionService.registerDescriptions([i]));
16108
- const f = o ? new qa(e) : new Dt(e);
16108
+ const f = o ? new ga(e) : new Dt(e);
16109
16109
  return f.calculateCustom = n, this._functionService.registerExecutors(f), u.add(ie(() => this._functionService.unregisterExecutors(e))), u.add(ie(() => this._functionService.unregisterDescriptions(e))), u.add(ie(() => this._functionService.deleteFormulaAstCacheKey(e))), this._remoteRegisterFunctionService && (this._remoteRegisterFunctionService.registerAsyncFunctions([[n.toString(), e]]), u.add(
16110
16110
  ie(() => this._remoteRegisterFunctionService.unregisterFunctions([e]))
16111
16111
  )), u;
@@ -16122,101 +16122,101 @@ let Mt = class extends ae {
16122
16122
  return this._remoteRegisterFunctionService.registerFunctions(n), ie(() => this._remoteRegisterFunctionService.unregisterFunctions(e));
16123
16123
  }
16124
16124
  };
16125
- Mt = gr([
16126
- Ye(0, X(_t)),
16127
- Ye(1, X(vt)),
16128
- Ye(2, Bt),
16129
- Ye(3, ja(Ha))
16125
+ Mt = hr([
16126
+ we(0, X(_t)),
16127
+ we(1, X(vt)),
16128
+ we(2, Bt),
16129
+ we(3, za(wa))
16130
16130
  ], Mt);
16131
- var Ur = Object.defineProperty, Fr = Object.getOwnPropertyDescriptor, Br = (a, e, n) => e in a ? Ur(a, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[e] = n, wa = (a, e, n, i) => {
16132
- for (var r = i > 1 ? void 0 : i ? Fr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
16131
+ var Fr = Object.defineProperty, Br = Object.getOwnPropertyDescriptor, vr = (a, e, n) => e in a ? Fr(a, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[e] = n, Ya = (a, e, n, i) => {
16132
+ for (var r = i > 1 ? void 0 : i ? Br(e, n) : e, o = a.length - 1, u; o >= 0; o--)
16133
16133
  (u = a[o]) && (r = u(r) || r);
16134
16134
  return r;
16135
- }, nt = (a, e) => (n, i) => e(n, i, a), ft = (a, e, n) => Br(a, typeof e != "symbol" ? e + "" : e, n);
16136
- let it = class extends pa {
16135
+ }, at = (a, e) => (n, i) => e(n, i, a), mt = (a, e, n) => vr(a, typeof e != "symbol" ? e + "" : e, n);
16136
+ let nt = class extends La {
16137
16137
  constructor(a = ma, e, n) {
16138
16138
  super(), this._config = a, this._injector = e, this._configService = n;
16139
- const { ...i } = La(
16139
+ const { ...i } = Pa(
16140
16140
  {},
16141
16141
  ma,
16142
16142
  this._config
16143
16143
  );
16144
- this._configService.setConfig(ai, i);
16144
+ this._configService.setConfig(ni, i);
16145
16145
  }
16146
16146
  onStarting() {
16147
- this._injector.add([at]), this._injector.get(Ua).registerChannel(
16147
+ this._injector.add([tt]), this._injector.get(Fa).registerChannel(
16148
16148
  Vt,
16149
- Zn(this._injector.get(at))
16149
+ Jn(this._injector.get(tt))
16150
16150
  );
16151
16151
  }
16152
16152
  };
16153
- ft(it, "pluginName", "SHEET_FORMULA_REMOTE_PLUGIN");
16154
- ft(it, "type", te.UNIVER_SHEET);
16155
- it = wa([
16156
- da(ga),
16157
- nt(1, X(ot)),
16158
- nt(2, Ce)
16159
- ], it);
16160
- let rt = class extends pa {
16153
+ mt(nt, "pluginName", "SHEET_FORMULA_REMOTE_PLUGIN");
16154
+ mt(nt, "type", te.UNIVER_SHEET);
16155
+ nt = Ya([
16156
+ pa(ha),
16157
+ at(1, X(rt)),
16158
+ at(2, Ce)
16159
+ ], nt);
16160
+ let it = class extends La {
16161
16161
  constructor(a = ua, e, n) {
16162
16162
  super(), this._config = a, this._injector = e, this._configService = n;
16163
- const { ...i } = La(
16163
+ const { ...i } = Pa(
16164
16164
  {},
16165
16165
  ua,
16166
16166
  this._config
16167
16167
  );
16168
- this._configService.setConfig(he, i, { merge: !0 });
16168
+ this._configService.setConfig(ge, i, { merge: !0 });
16169
16169
  }
16170
16170
  onStarting() {
16171
16171
  const a = this._injector, e = [
16172
- [hr, { useClass: Mt }],
16172
+ [Ur, { useClass: Mt }],
16173
16173
  [vt, { useClass: bt }],
16174
- [tt],
16174
+ [et],
16175
16175
  [Ot],
16176
- [$e],
16177
- [Je],
16178
- [_e],
16179
- [ze],
16176
+ [Qe],
16180
16177
  [Ze],
16181
- [et],
16182
- [je]
16178
+ [xe],
16179
+ [je],
16180
+ [ze],
16181
+ [Je],
16182
+ [$e]
16183
16183
  ];
16184
16184
  if (this._config.notExecuteFormula) {
16185
- const n = a.get(Ua);
16186
- e.push([Ha, {
16187
- useFactory: () => Jn(n.requestChannel(Vt))
16185
+ const n = a.get(Fa);
16186
+ e.push([wa, {
16187
+ useFactory: () => ei(n.requestChannel(Vt))
16188
16188
  }]);
16189
16189
  }
16190
16190
  e.forEach((n) => a.add(n));
16191
16191
  }
16192
16192
  onReady() {
16193
- Fe(this._injector, [
16194
- [tt],
16195
- [Ze],
16196
- [Je],
16193
+ Ue(this._injector, [
16194
+ [et],
16197
16195
  [ze],
16198
- [je]
16199
- ]), Ht() && Fe(this._injector, [
16200
- [_e]
16196
+ [Ze],
16197
+ [je],
16198
+ [$e]
16199
+ ]), Ht() && Ue(this._injector, [
16200
+ [xe]
16201
16201
  ]);
16202
16202
  }
16203
16203
  onRendered() {
16204
- Fe(this._injector, [
16205
- [et]
16206
- ]), Ht() || Fe(this._injector, [
16207
- [_e]
16204
+ Ue(this._injector, [
16205
+ [Je]
16206
+ ]), Ht() || Ue(this._injector, [
16207
+ [xe]
16208
16208
  ]);
16209
16209
  }
16210
16210
  };
16211
- ft(rt, "pluginName", ji);
16212
- ft(rt, "type", te.UNIVER_SHEET);
16213
- rt = wa([
16214
- da(ga, Rn),
16215
- nt(1, X(ot)),
16216
- nt(2, Ce)
16217
- ], rt);
16218
- function Xr(a, e, n, i) {
16219
- const r = a.get(Xn), o = a.get(Wn), u = a.get(Kn), f = a.get(kn);
16211
+ mt(it, "pluginName", zi);
16212
+ mt(it, "type", te.UNIVER_SHEET);
16213
+ it = Ya([
16214
+ pa(ha, Sn),
16215
+ at(1, X(rt)),
16216
+ at(2, Ce)
16217
+ ], it);
16218
+ function Wr(a, e, n, i) {
16219
+ const r = a.get(Wn), o = a.get(Kn), u = a.get(kn), f = a.get(Qn);
16220
16220
  r.load({
16221
16221
  formulaData: {},
16222
16222
  arrayFormulaCellData: {},
@@ -16232,27 +16232,27 @@ function Xr(a, e, n, i) {
16232
16232
  },
16233
16233
  dirtyUnitOtherFormulaMap: {}
16234
16234
  });
16235
- const m = o.treeBuilder(e), c = u.parse(m), s = f.execute(Qn(c));
16236
- return $n(s);
16235
+ const m = o.treeBuilder(e), c = u.parse(m), s = f.execute($n(c));
16236
+ return jn(s);
16237
16237
  }
16238
16238
  export {
16239
16239
  Le as CalculationMode,
16240
16240
  bt as DescriptionService,
16241
16241
  Ot as FormulaRefRangeService,
16242
16242
  vt as IDescriptionService,
16243
- hr as IRegisterFunctionService,
16244
- Ha as IRemoteRegisterFunctionService,
16245
- ei as InsertFunctionCommand,
16243
+ Ur as IRegisterFunctionService,
16244
+ wa as IRemoteRegisterFunctionService,
16245
+ ti as InsertFunctionCommand,
16246
16246
  Oe as OtherFormulaMarkDirty,
16247
- he as PLUGIN_CONFIG_KEY_BASE,
16248
- ti as QuickSumCommand,
16247
+ ge as PLUGIN_CONFIG_KEY_BASE,
16248
+ ai as QuickSumCommand,
16249
16249
  Mt as RegisterFunctionService,
16250
- $e as RegisterOtherFormulaService,
16251
- at as RemoteRegisterFunctionService,
16252
- _e as TriggerCalculationController,
16253
- it as UniverRemoteSheetsFormulaPlugin,
16254
- rt as UniverSheetsFormulaPlugin,
16255
- je as UpdateDefinedNameController,
16256
- ze as UpdateFormulaController,
16257
- Xr as calculateFormula
16250
+ Qe as RegisterOtherFormulaService,
16251
+ tt as RemoteRegisterFunctionService,
16252
+ xe as TriggerCalculationController,
16253
+ nt as UniverRemoteSheetsFormulaPlugin,
16254
+ it as UniverSheetsFormulaPlugin,
16255
+ $e as UpdateDefinedNameController,
16256
+ je as UpdateFormulaController,
16257
+ Wr as calculateFormula
16258
16258
  };