@univerjs/sheets-drawing-ui 0.7.0 → 0.8.0-nightly.202505261607

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,72 +1,72 @@
1
- var Nr = Object.defineProperty;
2
- var kr = (i, t, e) => t in i ? Nr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var ee = (i, t, e) => kr(i, typeof t != "symbol" ? t + "" : t, e);
4
- import { CommandType as Z, ICommandService as G, IUndoRedoService as Le, sequenceExecute as Ln, LocaleService as nt, IUniverInstanceService as Se, Inject as A, Injector as Ye, IContextService as Yn, IImageIoService as Wr, RxDisposable as jr, UniverInstanceType as x, FOCUSING_COMMON_DRAWINGS as xe, DrawingTypeEnum as j, Disposable as re, ArrangeTypeEnum as pt, createDocumentModelWithStyle as Ht, ObjectRelativeFromV as pn, ObjectRelativeFromH as wn, WrapTextType as _n, PositionedObjectLayoutType as vn, BooleanNumber as Sn, BuildTextUtils as zt, ImageSourceType as In, generateRandomId as bt, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as qe, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Be, InterceptorEffectEnum as Br, ObjectMatrix as $r, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as xr, Tools as Re, IPermissionService as Fr, UserManagerService as Lr, LifecycleService as Yr, LifecycleStages as Gr, DisposableCollection as wt, fromEventSubject as Xr, PRINT_CHART_COMPONENT_KEY as Vr, Rectangle as Hr, Direction as ve, FOCUSING_FX_BAR_EDITOR as zr, EDITOR_ACTIVATED as Kr, FOCUSING_PANEL_EDITOR as Zr, DependentOn as Jr, IConfigService as qr, Plugin as Qr, merge as ei, registerDependencies as ti, touchDependencies as Ft } from "@univerjs/core";
5
- import { DocDrawingController as ni, UniverDocsDrawingPlugin as ri } from "@univerjs/docs-drawing";
6
- import { SetDrawingSelectedOperation as Nt, IDrawingManagerService as ie, IImageIoService as ii, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Cn, DRAWING_IMAGE_COUNT_LIMIT as Dn, ImageUploadStatusType as Pe, DRAWING_IMAGE_ALLOW_SIZE as bn, getImageSize as Lt, DRAWING_IMAGE_WIDTH_LIMIT as Rn, DRAWING_IMAGE_HEIGHT_LIMIT as Mn, ImageSourceType as si, getDrawingShapeKeyByDrawingSearch as Ie, UniverDrawingPlugin as oi } from "@univerjs/drawing";
7
- import { ImageCropperObject as ai, COMPONENT_IMAGE_POPUP_MENU as ci, OpenImageCropOperation as di, ImageResetSizeOperation as li, DrawingRenderService as Gn, DrawingCommonPanel as ui, UniverDrawingUIPlugin as hi } from "@univerjs/drawing-ui";
8
- import { IRenderManagerService as J, CURSOR_TYPE as gi, precisionTo as _t, transformObjectOutOfGroup as fi, getGroupState as mi, getCurrentTypeOfRenderer as on, RENDER_CLASS_TYPE as Ae, Rect as Ne, ObjectType as yn, DRAWING_OBJECT_LAYER_INDEX as Yt, SHEET_VIEWPORT_KEY as Xn } from "@univerjs/engine-render";
9
- import { ISheetDrawingService as se, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as pi } from "@univerjs/sheets-drawing";
10
- import { MessageType as we, render as wi, unmount as _i, clsx as vi, RadioGroup as Si, Radio as Gt } from "@univerjs/design";
11
- import { SheetCanvasPopManagerService as Ii, HoverManagerService as Ci, SheetSkeletonManagerService as V, convertPositionSheetOverGridToAbsolute as Di, ISheetSelectionRenderService as Ge, attachRangeWithCoord as Vn, IEditorBridgeService as bi, IAutoFillService as Ri, EditingRenderController as Mi, SetCellEditVisibleOperation as En, PREDEFINED_HOOK_NAME as $e, COPY_TYPE as Ce, discreteRangeToRange as Tn, virtualizeDiscreteRanges as yi, ISheetClipboardService as Ei, SetZoomRatioOperation as On, SetScrollOperation as Ti, SheetPrintInterceptorService as Oi, getCurrentRangeDisable$ as Ui } from "@univerjs/sheets-ui";
12
- import { ISidebarService as Pi, IMessageService as Hn, ILocalFileService as Ai, IDialogService as Ni, IClipboardInterfaceService as ki, CanvasFloatDomService as Wi, PrintFloatDomSingle as ji, ComponentManager as zn, connectInjector as Bi, getMenuHiddenObservable as an, MenuItemType as cn, useDependency as Qe, RibbonStartGroup as $i, KeyCode as Fe, IMenuManagerService as xi, IShortcutService as Fi } from "@univerjs/ui";
13
- import { takeUntil as Un, throttleTime as Li, combineLatest as vt, switchMap as _e, EMPTY as me, tap as Pn, map as Me, distinctUntilChanged as An, Subject as Xt, filter as Yi, take as Gi, BehaviorSubject as je, of as Nn } from "rxjs";
14
- import { SheetInterceptorService as kt, getSheetCommandTarget as oe, SheetsSelectionsService as dn, SetRangeValuesCommand as kn, INTERCEPTOR_POINT as Xi, InterceptCellContentPriority as Vi, WorkbookViewPermission as Wn, WorksheetViewPermission as jn, WorkbookEditablePermission as Kt, WorksheetEditPermission as Zt, SetFrozenMutation as Hi, SetWorksheetRowAutoHeightMutation as zi, COMMAND_LISTENER_SKELETON_CHANGE as Ki, InsertRowCommand as Kn, InsertColCommand as Zn, RemoveRowCommand as Jn, RemoveColCommand as qn, DeleteRangeMoveLeftCommand as Qn, DeleteRangeMoveUpCommand as er, InsertRangeMoveDownCommand as tr, InsertRangeMoveRightCommand as nr, DeltaRowHeightCommand as Jt, SetRowHeightCommand as qt, DeltaColumnWidthCommand as rr, SetColWidthCommand as ir, SetRowHiddenCommand as sr, SetSpecificRowsVisibleCommand as or, SetSpecificColsVisibleCommand as ar, SetColHiddenCommand as cr, MoveColsCommand as dr, MoveRowsCommand as lr, MoveRangeCommand as ur, SetRowVisibleMutation as Zi, SetRowHiddenMutation as Ji, SetColVisibleMutation as qi, SetColHiddenMutation as Qi, SetWorksheetRowHeightMutation as es, SetWorksheetColWidthMutation as ts, SetWorksheetActiveOperation as ns, RangeProtectionPermissionEditPoint as rs } from "@univerjs/sheets";
15
- import { docDrawingPositionToTransform as Bn, ReplaceSnapshotCommand as is, InnerPasteCommand as ss } from "@univerjs/docs-ui";
16
- import { jsx as ae, jsxs as Qt } from "react/jsx-runtime";
17
- import { useMemo as os, forwardRef as hr, useRef as as, createElement as gr, useState as en, useEffect as fr } from "react";
18
- const cs = "sheets-drawing-ui.config", $n = {}, L = {
1
+ var yr = Object.defineProperty;
2
+ var Er = (i, t, e) => t in i ? yr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var ee = (i, t, e) => Er(i, typeof t != "symbol" ? t + "" : t, e);
4
+ import { CommandType as J, ICommandService as G, IUndoRedoService as xe, sequenceExecute as xn, LocaleService as tt, IUniverInstanceService as Se, Inject as A, Injector as Ye, IContextService as Yn, IImageIoService as Tr, RxDisposable as Or, UniverInstanceType as F, FOCUSING_COMMON_DRAWINGS as $e, DrawingTypeEnum as B, Disposable as ne, ArrangeTypeEnum as mt, createDocumentModelWithStyle as Vt, ObjectRelativeFromV as mn, ObjectRelativeFromH as pn, WrapTextType as wn, PositionedObjectLayoutType as _n, BooleanNumber as Sn, BuildTextUtils as Ht, ImageSourceType as vn, generateRandomId as Dt, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ze, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Be, InterceptorEffectEnum as Ur, ObjectMatrix as Pr, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Ar, Tools as Re, IPermissionService as Nr, UserManagerService as kr, LifecycleService as Wr, LifecycleStages as Br, DisposableCollection as pt, fromEventSubject as jr, PRINT_CHART_COMPONENT_KEY as $r, Rectangle as Fr, Direction as _e, FOCUSING_FX_BAR_EDITOR as xr, EDITOR_ACTIVATED as Yr, FOCUSING_PANEL_EDITOR as Xr, DependentOn as Gr, IConfigService as Lr, Plugin as Vr, merge as Hr, registerDependencies as zr, touchDependencies as Ft } from "@univerjs/core";
5
+ import { DocDrawingController as Kr, UniverDocsDrawingPlugin as Jr } from "@univerjs/docs-drawing";
6
+ import { SetDrawingSelectedOperation as At, IDrawingManagerService as re, IImageIoService as Zr, DRAWING_IMAGE_ALLOW_IMAGE_LIST as In, DRAWING_IMAGE_COUNT_LIMIT as Cn, ImageUploadStatusType as Ue, DRAWING_IMAGE_ALLOW_SIZE as Dn, getImageSize as xt, DRAWING_IMAGE_WIDTH_LIMIT as Rn, DRAWING_IMAGE_HEIGHT_LIMIT as bn, ImageSourceType as qr, getDrawingShapeKeyByDrawingSearch as ve, UniverDrawingPlugin as Qr } from "@univerjs/drawing";
7
+ import { ImageCropperObject as ei, COMPONENT_IMAGE_POPUP_MENU as ti, OpenImageCropOperation as ni, ImageResetSizeOperation as ri, DrawingRenderService as Xn, DrawingCommonPanel as ii, UniverDrawingUIPlugin as si } from "@univerjs/drawing-ui";
8
+ import { IRenderManagerService as Z, CURSOR_TYPE as oi, precisionTo as wt, transformObjectOutOfGroup as ai, getGroupState as ci, getCurrentTypeOfRenderer as sn, RENDER_CLASS_TYPE as Pe, Rect as Ae, ObjectType as Mn, DRAWING_OBJECT_LAYER_INDEX as Yt, SHEET_VIEWPORT_KEY as Gn } from "@univerjs/engine-render";
9
+ import { ISheetDrawingService as ie, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as di } from "@univerjs/sheets-drawing";
10
+ import { MessageType as pe, render as li, unmount as ui, clsx as hi, RadioGroup as gi, Radio as Xt } from "@univerjs/design";
11
+ import { SheetCanvasPopManagerService as fi, HoverManagerService as mi, SheetSkeletonManagerService as V, convertPositionSheetOverGridToAbsolute as pi, ISheetSelectionRenderService as Xe, attachRangeWithCoord as Ln, IEditorBridgeService as wi, IAutoFillService as _i, EditingRenderController as Si, SetCellEditVisibleOperation as yn, PREDEFINED_HOOK_NAME as je, COPY_TYPE as Ie, discreteRangeToRange as En, virtualizeDiscreteRanges as vi, ISheetClipboardService as Ii, SetZoomRatioOperation as Tn, SetScrollOperation as Ci, SheetPrintInterceptorService as Di, getCurrentRangeDisable$ as Ri } from "@univerjs/sheets-ui";
12
+ import { ISidebarService as bi, IMessageService as Vn, ILocalFileService as Mi, IDialogService as yi, IClipboardInterfaceService as Ei, CanvasFloatDomService as Ti, PrintFloatDomSingle as Oi, ComponentManager as Hn, connectInjector as Ui, useDependency as qe, getMenuHiddenObservable as on, MenuItemType as an, RibbonInsertGroup as Pi, KeyCode as Fe, IMenuManagerService as Ai, IShortcutService as Ni } from "@univerjs/ui";
13
+ import { takeUntil as On, throttleTime as ki, combineLatest as _t, switchMap as we, EMPTY as fe, tap as Un, map as be, distinctUntilChanged as Pn, Subject as Gt, filter as Wi, take as Bi, BehaviorSubject as We, of as An } from "rxjs";
14
+ import { SheetInterceptorService as Nt, getSheetCommandTarget as se, SheetsSelectionsService as cn, SetRangeValuesCommand as Nn, INTERCEPTOR_POINT as ji, InterceptCellContentPriority as $i, WorkbookViewPermission as kn, WorksheetViewPermission as Wn, WorkbookEditablePermission as zt, WorksheetEditPermission as Kt, SetFrozenMutation as Fi, SetWorksheetRowAutoHeightMutation as xi, COMMAND_LISTENER_SKELETON_CHANGE as Yi, InsertRowCommand as zn, InsertColCommand as Kn, RemoveRowCommand as Jn, RemoveColCommand as Zn, DeleteRangeMoveLeftCommand as qn, DeleteRangeMoveUpCommand as Qn, InsertRangeMoveDownCommand as er, InsertRangeMoveRightCommand as tr, DeltaRowHeightCommand as Jt, SetRowHeightCommand as Zt, DeltaColumnWidthCommand as nr, SetColWidthCommand as rr, SetRowHiddenCommand as ir, SetSpecificRowsVisibleCommand as sr, SetSpecificColsVisibleCommand as or, SetColHiddenCommand as ar, MoveColsCommand as cr, MoveRowsCommand as dr, MoveRangeCommand as lr, SetRowVisibleMutation as Xi, SetRowHiddenMutation as Gi, SetColVisibleMutation as Li, SetColHiddenMutation as Vi, SetWorksheetRowHeightMutation as Hi, SetWorksheetColWidthMutation as zi, SetWorksheetActiveOperation as Ki, RangeProtectionPermissionEditPoint as Ji } from "@univerjs/sheets";
15
+ import { docDrawingPositionToTransform as Bn, ReplaceSnapshotCommand as Zi, InnerPasteCommand as qi } from "@univerjs/docs-ui";
16
+ import { jsx as oe, jsxs as qt } from "react/jsx-runtime";
17
+ import { useMemo as Qi, useState as Qt, useEffect as ur } from "react";
18
+ const es = "sheets-drawing-ui.config", jn = {}, Y = {
19
19
  id: "sheet.operation.clear-drawing-transformer",
20
- type: Z.MUTATION,
20
+ type: J.MUTATION,
21
21
  handler: (i, t) => {
22
- const e = i.get(J);
22
+ const e = i.get(Z);
23
23
  return t.forEach((n) => {
24
24
  var r, s;
25
25
  (s = (r = e.getRenderById(n)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
26
26
  }), !0;
27
27
  }
28
- }, rt = {
28
+ }, nt = {
29
29
  id: "sheet.command.remove-sheet-image",
30
- type: Z.COMMAND,
30
+ type: J.COMMAND,
31
31
  handler: (i, t) => {
32
- var S, I, b;
33
- const e = i.get(G), n = i.get(Le), r = i.get(kt), s = i.get(se);
32
+ var v, I, R;
33
+ const e = i.get(G), n = i.get(xe), r = i.get(Nt), s = i.get(ie);
34
34
  if (!t) return !1;
35
35
  const { drawings: o } = t, a = [];
36
- o.forEach((v) => {
37
- const { unitId: D } = v;
38
- a.push(D);
36
+ o.forEach((S) => {
37
+ const { unitId: C } = S;
38
+ a.push(C);
39
39
  });
40
- const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, m = r.onCommandExecute({ id: rt.id, params: t }), p = { id: P.id, params: { unitId: u, subUnitId: c, op: g, objects: h, type: U.REMOVE } }, f = { id: P.id, params: { unitId: u, subUnitId: c, op: l, objects: h, type: U.INSERT } };
41
- return Ln([...(S = m.preRedos) != null ? S : [], p, ...m.redos], e) ? (n.pushUndoRedo({
40
+ const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = r.onCommandExecute({ id: nt.id, params: t }), p = { id: P.id, params: { unitId: u, subUnitId: c, op: g, objects: h, type: U.REMOVE } }, m = { id: P.id, params: { unitId: u, subUnitId: c, op: l, objects: h, type: U.INSERT } };
41
+ return xn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
42
42
  unitID: u,
43
43
  undoMutations: [
44
- ...(I = m.preUndos) != null ? I : [],
45
- f,
46
- ...m.undos,
47
- { id: L.id, params: a }
44
+ ...(I = f.preUndos) != null ? I : [],
45
+ m,
46
+ ...f.undos,
47
+ { id: Y.id, params: a }
48
48
  ],
49
49
  redoMutations: [
50
- ...(b = m.preRedos) != null ? b : [],
50
+ ...(R = f.preRedos) != null ? R : [],
51
51
  p,
52
- ...m.redos,
53
- { id: L.id, params: a }
52
+ ...f.redos,
53
+ { id: Y.id, params: a }
54
54
  ]
55
55
  }), !0) : !1;
56
56
  }
57
- }, mr = "COMPONENT_SHEET_DRAWING_PANEL", pr = {
57
+ }, hr = "COMPONENT_SHEET_DRAWING_PANEL", gr = {
58
58
  id: "sidebar.operation.sheet-image",
59
- type: Z.COMMAND,
59
+ type: J.COMMAND,
60
60
  handler: async (i, t) => {
61
- const e = i.get(Pi), n = i.get(nt), r = i.get(Se), s = i.get(G);
62
- if (!oe(r)) return !1;
61
+ const e = i.get(bi), n = i.get(tt), r = i.get(Se), s = i.get(G);
62
+ if (!se(r)) return !1;
63
63
  switch (t.value) {
64
64
  case "open":
65
65
  e.open({
66
66
  header: { title: n.t("sheetImage.panel.title") },
67
- children: { label: mr },
67
+ children: { label: hr },
68
68
  onClose: () => {
69
- s.syncExecuteCommand(Nt.id, []);
69
+ s.syncExecuteCommand(At.id, []);
70
70
  },
71
71
  width: 360
72
72
  });
@@ -78,27 +78,27 @@ const cs = "sheets-drawing-ui.config", $n = {}, L = {
78
78
  }
79
79
  return !0;
80
80
  }
81
- }, wr = {
81
+ }, fr = {
82
82
  id: "sheet.operation.edit-sheet-image",
83
- type: Z.OPERATION,
83
+ type: J.OPERATION,
84
84
  handler: (i, t) => {
85
85
  const e = i.get(G);
86
- return t == null ? !1 : (e.syncExecuteCommand(Nt.id, [t]), e.executeCommand(pr.id, { value: "open" }), !0);
86
+ return t == null ? !1 : (e.syncExecuteCommand(At.id, [t]), e.executeCommand(gr.id, { value: "open" }), !0);
87
87
  }
88
88
  };
89
- var ds = Object.getOwnPropertyDescriptor, ls = (i, t, e, n) => {
90
- for (var r = n > 1 ? void 0 : n ? ds(t, e) : t, s = i.length - 1, o; s >= 0; s--)
89
+ var ts = Object.getOwnPropertyDescriptor, ns = (i, t, e, n) => {
90
+ for (var r = n > 1 ? void 0 : n ? ts(t, e) : t, s = i.length - 1, o; s >= 0; s--)
91
91
  (o = i[s]) && (r = o(r) || r);
92
92
  return r;
93
- }, de = (i, t) => (e, n) => t(e, n, i);
94
- let Rt = class extends jr {
93
+ }, ce = (i, t) => (e, n) => t(e, n, i);
94
+ let Rt = class extends Or {
95
95
  constructor(t, e, n, r, s, o, a, d, u, c) {
96
96
  super();
97
97
  ee(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
98
98
  this._injector = t, this._localeService = e, this._drawingManagerService = n, this._canvasPopManagerService = r, this._renderManagerService = s, this._univerInstanceService = o, this._messageService = a, this._contextService = d, this._ioService = u, this._commandService = c, this._init();
99
99
  }
100
100
  _init() {
101
- this._univerInstanceService.getCurrentTypeOfUnit$(x.UNIVER_SHEET).pipe(Un(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$(x.UNIVER_SHEET).pipe(Un(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType(x.UNIVER_SHEET).forEach((t) => this._create(t)), this._setupLoadingStatus();
101
+ this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(On(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$(F.UNIVER_SHEET).pipe(On(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType(F.UNIVER_SHEET).forEach((t) => this._create(t)), this._setupLoadingStatus();
102
102
  }
103
103
  _setupLoadingStatus() {
104
104
  const t = "image-upload-loading";
@@ -106,7 +106,7 @@ let Rt = class extends jr {
106
106
  this.disposeWithMe(this._ioService.change$.subscribe((n) => {
107
107
  n > 0 && !e ? e = this._messageService.show({
108
108
  id: t,
109
- type: we.Loading,
109
+ type: pe.Loading,
110
110
  content: `${this._localeService.t("uploadLoading.loading")}: ${n}`,
111
111
  duration: 0
112
112
  }) : n === 0 && (e == null || e.dispose(), e = void 0);
@@ -126,7 +126,7 @@ let Rt = class extends jr {
126
126
  _hasCropObject(t) {
127
127
  const e = t.getAllObjectsByOrder();
128
128
  for (const n of e)
129
- if (n instanceof ai)
129
+ if (n instanceof ei)
130
130
  return !0;
131
131
  return !1;
132
132
  }
@@ -141,7 +141,7 @@ let Rt = class extends jr {
141
141
  let r;
142
142
  this.disposeWithMe(
143
143
  n.createControl$.subscribe(() => {
144
- if (this._contextService.setContextValue(xe, !0), this._hasCropObject(e))
144
+ if (this._contextService.setContextValue($e, !0), this._hasCropObject(e))
145
145
  return;
146
146
  const o = n.getSelectedObjectMap();
147
147
  if (o.size > 1) {
@@ -154,13 +154,13 @@ let Rt = class extends jr {
154
154
  const d = a.oKey, u = this._drawingManagerService.getDrawingOKey(d);
155
155
  if (!u)
156
156
  return;
157
- const { unitId: c, subUnitId: l, drawingId: g, drawingType: h } = u, m = u.data;
158
- if (m && m.disablePopup)
157
+ const { unitId: c, subUnitId: l, drawingId: g, drawingType: h } = u, f = u.data;
158
+ if (f && f.disablePopup)
159
159
  return;
160
160
  r == null || r.dispose();
161
161
  const p = this._canvasPopManagerService.getFeatureMenu(c, l, g, h);
162
162
  r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
163
- componentKey: ci,
163
+ componentKey: ti,
164
164
  direction: "horizontal",
165
165
  offset: [2, 0],
166
166
  extraProps: {
@@ -170,11 +170,11 @@ let Rt = class extends jr {
170
170
  })
171
171
  ), this.disposeWithMe(
172
172
  n.clearControl$.subscribe(() => {
173
- r == null || r.dispose(), this._contextService.setContextValue(xe, !1), this._commandService.syncExecuteCommand(Nt.id, []);
173
+ r == null || r.dispose(), this._contextService.setContextValue($e, !1), this._commandService.syncExecuteCommand(At.id, []);
174
174
  })
175
175
  ), this.disposeWithMe(
176
176
  this._contextService.contextChanged$.subscribe((o) => {
177
- o[xe] === !1 && (r == null || r.dispose());
177
+ o[$e] === !1 && (r == null || r.dispose());
178
178
  })
179
179
  ), this.disposeWithMe(
180
180
  n.changing$.subscribe(() => {
@@ -187,62 +187,62 @@ let Rt = class extends jr {
187
187
  {
188
188
  label: "image-popup.edit",
189
189
  index: 0,
190
- commandId: wr.id,
190
+ commandId: fr.id,
191
191
  commandParams: { unitId: t, subUnitId: e, drawingId: n },
192
- disable: r === j.DRAWING_DOM
192
+ disable: r === B.DRAWING_DOM
193
193
  },
194
194
  {
195
195
  label: "image-popup.delete",
196
196
  index: 1,
197
- commandId: rt.id,
197
+ commandId: nt.id,
198
198
  commandParams: { unitId: t, drawings: [{ unitId: t, subUnitId: e, drawingId: n }] },
199
199
  disable: !1
200
200
  },
201
201
  {
202
202
  label: "image-popup.crop",
203
203
  index: 2,
204
- commandId: di.id,
204
+ commandId: ni.id,
205
205
  commandParams: { unitId: t, subUnitId: e, drawingId: n },
206
- disable: r === j.DRAWING_DOM
206
+ disable: r === B.DRAWING_DOM
207
207
  },
208
208
  {
209
209
  label: "image-popup.reset",
210
210
  index: 3,
211
- commandId: li.id,
211
+ commandId: ri.id,
212
212
  commandParams: [{ unitId: t, subUnitId: e, drawingId: n }],
213
- disable: r === j.DRAWING_DOM
213
+ disable: r === B.DRAWING_DOM
214
214
  }
215
215
  ];
216
216
  }
217
217
  };
218
- Rt = ls([
219
- de(0, A(Ye)),
220
- de(1, A(nt)),
221
- de(2, ie),
222
- de(3, A(Ii)),
223
- de(4, J),
224
- de(5, Se),
225
- de(6, Hn),
226
- de(7, Yn),
227
- de(8, Wr),
228
- de(9, G)
218
+ Rt = ns([
219
+ ce(0, A(Ye)),
220
+ ce(1, A(tt)),
221
+ ce(2, re),
222
+ ce(3, A(fi)),
223
+ ce(4, Z),
224
+ ce(5, Se),
225
+ ce(6, Vn),
226
+ ce(7, Yn),
227
+ ce(8, Tr),
228
+ ce(9, G)
229
229
  ], Rt);
230
- var us = Object.getOwnPropertyDescriptor, hs = (i, t, e, n) => {
231
- for (var r = n > 1 ? void 0 : n ? us(t, e) : t, s = i.length - 1, o; s >= 0; s--)
230
+ var rs = Object.getOwnPropertyDescriptor, is = (i, t, e, n) => {
231
+ for (var r = n > 1 ? void 0 : n ? rs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
232
232
  (o = i[s]) && (r = o(r) || r);
233
233
  return r;
234
234
  }, St = (i, t) => (e, n) => t(e, n, i);
235
- let tn = class extends re {
235
+ let en = class extends ne {
236
236
  constructor(t, e, n, r, s) {
237
237
  super();
238
238
  ee(this, "_isSetCursor", !1);
239
239
  this._context = t, this._hoverManagerService = e, this._selectionsService = n, this._drawingRenderService = r, this._sheetSkeletonManagerService = s, this._initHover(), this._initImageClick();
240
240
  }
241
241
  _initHover() {
242
- this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(Li(33)).subscribe((t) => {
242
+ this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(ki(33)).subscribe((t) => {
243
243
  var n, r;
244
244
  let e = [];
245
- t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (t == null ? void 0 : t.unitId) === this._context.unitId && (t != null && t.drawing) && e.length === 1 && ((n = e[0].primary) == null ? void 0 : n.actualRow) === t.row && ((r = e[0].primary) == null ? void 0 : r.actualColumn) === t.col ? (this._isSetCursor = !0, this._context.scene.setCursor(gi.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
245
+ t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (t == null ? void 0 : t.unitId) === this._context.unitId && (t != null && t.drawing) && e.length === 1 && ((n = e[0].primary) == null ? void 0 : n.actualRow) === t.row && ((r = e[0].primary) == null ? void 0 : r.actualColumn) === t.col ? (this._isSetCursor = !0, this._context.scene.setCursor(oi.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
246
246
  }));
247
247
  }
248
248
  _initImageClick() {
@@ -256,25 +256,25 @@ let tn = class extends re {
256
256
  }));
257
257
  }
258
258
  };
259
- tn = hs([
260
- St(1, A(Ci)),
261
- St(2, A(dn)),
262
- St(3, A(Gn)),
259
+ en = is([
260
+ St(1, A(mi)),
261
+ St(2, A(cn)),
262
+ St(3, A(Xn)),
263
263
  St(4, A(V))
264
- ], tn);
264
+ ], en);
265
265
  function z(i, t, e) {
266
266
  const { from: n, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: d = 0, skewY: u = 0 } = i, c = e.getCurrent();
267
267
  if (c == null)
268
268
  return;
269
- const l = Di(
269
+ const l = pi(
270
270
  c.unitId,
271
271
  c.sheetId,
272
272
  { from: n, to: r },
273
273
  e
274
274
  );
275
- let { left: g, top: h, width: m, height: p } = l;
276
- const f = e.getCurrentSkeleton(), _ = f.rowHeaderWidth + f.columnTotalWidth, S = f.columnHeaderHeight + f.rowTotalHeight;
277
- return g + m > _ && (g = _ - m), h + p > S && (h = S - p), {
275
+ let { left: g, top: h, width: f, height: p } = l;
276
+ const m = e.getCurrentSkeleton(), _ = m.rowHeaderWidth + m.columnTotalWidth, v = m.columnHeaderHeight + m.rowTotalHeight;
277
+ return g + f > _ && (g = _ - f), h + p > v && (h = v - p), {
278
278
  flipY: s,
279
279
  flipX: o,
280
280
  angle: a,
@@ -282,7 +282,7 @@ function z(i, t, e) {
282
282
  skewY: u,
283
283
  left: g,
284
284
  top: h,
285
- width: m,
285
+ width: f,
286
286
  height: p
287
287
  };
288
288
  }
@@ -292,17 +292,17 @@ function $(i, t) {
292
292
  return;
293
293
  const g = {
294
294
  column: l.actualColumn,
295
- columnOffset: _t(e - l.startX, 1),
295
+ columnOffset: wt(e - l.startX, 1),
296
296
  row: l.actualRow,
297
- rowOffset: _t(n - l.startY, 1)
297
+ rowOffset: wt(n - l.startY, 1)
298
298
  }, h = t.getCellWithCoordByOffset(e + r, n + s);
299
299
  if (h == null)
300
300
  return;
301
- const m = {
301
+ const f = {
302
302
  column: h.actualColumn,
303
- columnOffset: _t(e + r - h.startX, 1),
303
+ columnOffset: wt(e + r - h.startX, 1),
304
304
  row: h.actualRow,
305
- rowOffset: _t(n + s - h.startY, 1)
305
+ rowOffset: wt(n + s - h.startY, 1)
306
306
  };
307
307
  return {
308
308
  flipY: o,
@@ -311,15 +311,15 @@ function $(i, t) {
311
311
  skewX: u,
312
312
  skewY: c,
313
313
  from: g,
314
- to: m
314
+ to: f
315
315
  };
316
316
  }
317
- var gs = Object.getOwnPropertyDescriptor, fs = (i, t, e, n) => {
318
- for (var r = n > 1 ? void 0 : n ? gs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
317
+ var ss = Object.getOwnPropertyDescriptor, os = (i, t, e, n) => {
318
+ for (var r = n > 1 ? void 0 : n ? ss(t, e) : t, s = i.length - 1, o; s >= 0; s--)
319
319
  (o = i[s]) && (r = o(r) || r);
320
320
  return r;
321
- }, It = (i, t) => (e, n) => t(e, n, i);
322
- let nn = class extends re {
321
+ }, vt = (i, t) => (e, n) => t(e, n, i);
322
+ let tn = class extends ne {
323
323
  constructor(i, t, e, n, r) {
324
324
  super(), this._context = i, this._sheetDrawingService = t, this._drawingManagerService = e, this._sheetSelectionRenderService = n, this._sheetSkeletonManagerService = r, this._init();
325
325
  }
@@ -339,20 +339,20 @@ let nn = class extends re {
339
339
  this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
340
340
  }
341
341
  };
342
- nn = fs([
343
- It(1, se),
344
- It(2, ie),
345
- It(3, A(Ge)),
346
- It(4, A(V))
347
- ], nn);
348
- function ms(i) {
342
+ tn = os([
343
+ vt(1, ie),
344
+ vt(2, re),
345
+ vt(3, A(Xe)),
346
+ vt(4, A(V))
347
+ ], tn);
348
+ function as(i) {
349
349
  const t = [];
350
350
  return i.forEach((e) => {
351
- const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = mi(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
352
- const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: m, drawingId: p } = l;
351
+ const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = ci(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
352
+ const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: f, drawingId: p } = l;
353
353
  return {
354
354
  unitId: h,
355
- subUnitId: m,
355
+ subUnitId: f,
356
356
  drawingId: p,
357
357
  transform: {
358
358
  ...g,
@@ -365,7 +365,7 @@ function ms(i) {
365
365
  unitId: s,
366
366
  subUnitId: o,
367
367
  drawingId: a,
368
- drawingType: j.DRAWING_GROUP,
368
+ drawingType: B.DRAWING_GROUP,
369
369
  transform: d
370
370
  };
371
371
  t.push({
@@ -374,26 +374,26 @@ function ms(i) {
374
374
  });
375
375
  }), t;
376
376
  }
377
- function ps(i) {
377
+ function cs(i) {
378
378
  const t = [];
379
379
  return i.forEach((e) => {
380
380
  const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a, transform: d = { width: 0, height: 0 } } = n;
381
381
  if (d == null)
382
382
  return;
383
383
  const u = r.map((l) => {
384
- const { transform: g } = l, { unitId: h, subUnitId: m, drawingId: p } = l, f = fi(g || {}, d, d.width || 0, d.height || 0);
384
+ const { transform: g } = l, { unitId: h, subUnitId: f, drawingId: p } = l, m = ai(g || {}, d, d.width || 0, d.height || 0);
385
385
  return {
386
386
  unitId: h,
387
- subUnitId: m,
387
+ subUnitId: f,
388
388
  drawingId: p,
389
- transform: f,
389
+ transform: m,
390
390
  groupId: void 0
391
391
  };
392
392
  }), c = {
393
393
  unitId: s,
394
394
  subUnitId: o,
395
395
  drawingId: a,
396
- drawingType: j.DRAWING_GROUP,
396
+ drawingType: B.DRAWING_GROUP,
397
397
  transform: {
398
398
  left: 0,
399
399
  top: 0
@@ -405,15 +405,15 @@ function ps(i) {
405
405
  });
406
406
  }), t;
407
407
  }
408
- const _r = {
408
+ const mr = {
409
409
  id: "sheet.command.group-sheet-image",
410
- type: Z.COMMAND,
410
+ type: J.COMMAND,
411
411
  handler: (i, t) => {
412
- const e = i.get(G), n = i.get(Le), r = i.get(se);
412
+ const e = i.get(G), n = i.get(xe), r = i.get(ie);
413
413
  if (!t) return !1;
414
414
  const s = [];
415
- t.forEach(({ parent: h, children: m }) => {
416
- s.push(h.unitId), m.forEach((p) => {
415
+ t.forEach(({ parent: h, children: f }) => {
416
+ s.push(h.unitId), f.forEach((p) => {
417
417
  s.push(p.unitId);
418
418
  });
419
419
  });
@@ -421,48 +421,48 @@ const _r = {
421
421
  return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: d, objects: l, type: U.GROUP }) ? (n.pushUndoRedo({
422
422
  unitID: a,
423
423
  undoMutations: [
424
- { id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: ps(l), type: U.UNGROUP } },
425
- { id: L.id, params: s }
424
+ { id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: cs(l), type: U.UNGROUP } },
425
+ { id: Y.id, params: s }
426
426
  ],
427
427
  redoMutations: [
428
428
  { id: P.id, params: { op: c, unitId: a, subUnitId: d, objects: l, type: U.GROUP } },
429
- { id: L.id, params: s }
429
+ { id: Y.id, params: s }
430
430
  ]
431
431
  }), !0) : !1;
432
432
  }
433
- }, Wt = {
433
+ }, kt = {
434
434
  id: "sheet.command.insert-sheet-image",
435
- type: Z.COMMAND,
435
+ type: J.COMMAND,
436
436
  handler: (i, t) => {
437
- var S, I, b;
438
- const e = i.get(G), n = i.get(Le), r = i.get(se), s = i.get(kt);
437
+ var v, I, R;
438
+ const e = i.get(G), n = i.get(xe), r = i.get(ie), s = i.get(Nt);
439
439
  if (!t) return !1;
440
- const o = t.drawings, a = o.map((v) => v.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, m = s.onCommandExecute({ id: Wt.id, params: t }), p = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, f = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
441
- return Ln([...(S = m.preRedos) != null ? S : [], p, ...m.redos], e) ? (n.pushUndoRedo({
440
+ const o = t.drawings, a = o.map((S) => S.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = s.onCommandExecute({ id: kt.id, params: t }), p = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, m = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
441
+ return xn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
442
442
  unitID: u,
443
443
  undoMutations: [
444
- ...(I = m.preUndos) != null ? I : [],
445
- f,
446
- ...m.undos,
447
- { id: L.id, params: a }
444
+ ...(I = f.preUndos) != null ? I : [],
445
+ m,
446
+ ...f.undos,
447
+ { id: Y.id, params: a }
448
448
  ],
449
449
  redoMutations: [
450
- ...(b = m.preRedos) != null ? b : [],
450
+ ...(R = f.preRedos) != null ? R : [],
451
451
  p,
452
- ...m.redos,
453
- { id: L.id, params: a }
452
+ ...f.redos,
453
+ { id: Y.id, params: a }
454
454
  ]
455
455
  }), !0) : !1;
456
456
  }
457
- }, vr = {
457
+ }, pr = {
458
458
  id: "sheet.command.set-drawing-arrange",
459
- type: Z.COMMAND,
459
+ type: J.COMMAND,
460
460
  handler: (i, t) => {
461
- const e = i.get(G), n = i.get(Le);
461
+ const e = i.get(G), n = i.get(xe);
462
462
  if (!t) return !1;
463
- const r = i.get(se), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = t, u = { unitId: s, subUnitId: o, drawingIds: a };
463
+ const r = i.get(ie), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = t, u = { unitId: s, subUnitId: o, drawingIds: a };
464
464
  let c;
465
- if (d === pt.forward ? c = r.getForwardDrawingsOp(u) : d === pt.backward ? c = r.getBackwardDrawingOp(u) : d === pt.front ? c = r.getFrontDrawingsOp(u) : d === pt.back && (c = r.getBackDrawingsOp(u)), c == null)
465
+ if (d === mt.forward ? c = r.getForwardDrawingsOp(u) : d === mt.backward ? c = r.getBackwardDrawingOp(u) : d === mt.front ? c = r.getFrontDrawingsOp(u) : d === mt.back && (c = r.getBackDrawingsOp(u)), c == null)
466
466
  return !1;
467
467
  const { objects: l, redo: g, undo: h } = c;
468
468
  return e.syncExecuteCommand(P.id, { op: g, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE }) ? (n.pushUndoRedo({
@@ -475,34 +475,34 @@ const _r = {
475
475
  ]
476
476
  }), !0) : !1;
477
477
  }
478
- }, jt = {
478
+ }, Wt = {
479
479
  id: "sheet.command.set-sheet-image",
480
- type: Z.COMMAND,
480
+ type: J.COMMAND,
481
481
  handler: (i, t) => {
482
- const e = i.get(G), n = i.get(Le), r = i.get(se);
482
+ const e = i.get(G), n = i.get(xe), r = i.get(ie);
483
483
  if (!t) return !1;
484
484
  const { drawings: s } = t, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
485
485
  return e.syncExecuteCommand(P.id, { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE }) ? (n.pushUndoRedo({
486
486
  unitID: a,
487
487
  undoMutations: [
488
488
  { id: P.id, params: { unitId: a, subUnitId: d, op: u, objects: l, type: U.UPDATE } },
489
- { id: L.id, params: [a] }
489
+ { id: Y.id, params: [a] }
490
490
  ],
491
491
  redoMutations: [
492
492
  { id: P.id, params: { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE } },
493
- { id: L.id, params: [a] }
493
+ { id: Y.id, params: [a] }
494
494
  ]
495
495
  }), !0) : !1;
496
496
  }
497
- }, Sr = {
497
+ }, wr = {
498
498
  id: "sheet.command.ungroup-sheet-image",
499
- type: Z.COMMAND,
499
+ type: J.COMMAND,
500
500
  handler: (i, t) => {
501
- const e = i.get(G), n = i.get(Le), r = i.get(se);
501
+ const e = i.get(G), n = i.get(xe), r = i.get(ie);
502
502
  if (!t) return !1;
503
503
  const s = [];
504
- t.forEach(({ parent: h, children: m }) => {
505
- s.push(h.unitId), m.forEach((p) => {
504
+ t.forEach(({ parent: h, children: f }) => {
505
+ s.push(h.unitId), f.forEach((p) => {
506
506
  s.push(p.unitId);
507
507
  });
508
508
  });
@@ -510,40 +510,40 @@ const _r = {
510
510
  return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: d, objects: l, type: U.UNGROUP }) ? (n.pushUndoRedo({
511
511
  unitID: a,
512
512
  undoMutations: [
513
- { id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: ms(l), type: U.GROUP } },
514
- { id: L.id, params: s }
513
+ { id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: as(l), type: U.GROUP } },
514
+ { id: Y.id, params: s }
515
515
  ],
516
516
  redoMutations: [
517
517
  { id: P.id, params: { op: c, unitId: a, subUnitId: d, objects: l, type: U.UNGROUP } },
518
- { id: L.id, params: s }
518
+ { id: Y.id, params: s }
519
519
  ]
520
520
  }), !0) : !1;
521
521
  }
522
522
  };
523
- var ws = Object.getOwnPropertyDescriptor, _s = (i, t, e, n) => {
524
- for (var r = n > 1 ? void 0 : n ? ws(t, e) : t, s = i.length - 1, o; s >= 0; s--)
523
+ var ds = Object.getOwnPropertyDescriptor, ls = (i, t, e, n) => {
524
+ for (var r = n > 1 ? void 0 : n ? ds(t, e) : t, s = i.length - 1, o; s >= 0; s--)
525
525
  (o = i[s]) && (r = o(r) || r);
526
526
  return r;
527
527
  }, te = (i, t) => (e, n) => t(e, n, i);
528
- function vs(i, t, e) {
528
+ function us(i, t, e) {
529
529
  const n = e * Math.PI / 180, r = Math.abs(i * Math.cos(n)) + Math.abs(t * Math.sin(n)), s = Math.abs(i * Math.sin(n)) + Math.abs(t * Math.cos(n));
530
530
  return { rotatedWidth: r, rotatedHeight: s };
531
531
  }
532
- function rn(i, t, e, n, r) {
533
- var S;
534
- const { rotatedHeight: s, rotatedWidth: o } = vs(e, n, r), d = i.get(J).getRenderById(t.unitId);
532
+ function nn(i, t, e, n, r) {
533
+ var v;
534
+ const { rotatedHeight: s, rotatedWidth: o } = us(e, n, r), d = i.get(Z).getRenderById(t.unitId);
535
535
  if (!d)
536
536
  return !1;
537
- const c = (S = d.with(V).getSkeletonParam(t.subUnitId)) == null ? void 0 : S.skeleton;
537
+ const c = (v = d.with(V).getSkeletonParam(t.subUnitId)) == null ? void 0 : v.skeleton;
538
538
  if (c == null)
539
539
  return !1;
540
- const l = c.getCellByIndex(t.row, t.col), g = l.mergeInfo.endX - l.mergeInfo.startX - 2, h = l.mergeInfo.endY - l.mergeInfo.startY - 2, m = o / s, f = Math.ceil(Math.min(g, h * m)) / o, _ = !f || Number.isNaN(f) ? 1e-3 : f;
540
+ const l = c.getCellByIndex(t.row, t.col), g = l.mergeInfo.endX - l.mergeInfo.startX - 2, h = l.mergeInfo.endY - l.mergeInfo.startY - 2, f = o / s, m = Math.ceil(Math.min(g, h * f)) / o, _ = !m || Number.isNaN(m) ? 1e-3 : m;
541
541
  return {
542
542
  width: e * _,
543
543
  height: n * _
544
544
  };
545
545
  }
546
- let et = class extends re {
546
+ let Qe = class extends ne {
547
547
  constructor(t, e, n, r, s, o, a, d, u, c, l, g, h) {
548
548
  super();
549
549
  ee(this, "_workbookSelections");
@@ -552,17 +552,17 @@ let et = class extends re {
552
552
  async insertFloatImage() {
553
553
  const t = await this._fileOpenerService.openFile({
554
554
  multiple: !0,
555
- accept: Cn.map((n) => `.${n.replace("image/", "")}`).join(",")
555
+ accept: In.map((n) => `.${n.replace("image/", "")}`).join(",")
556
556
  }), e = t.length;
557
- return e > Dn ? (this._messageService.show({
558
- type: we.Error,
559
- content: this._localeService.t("update-status.exceedMaxCount", String(Dn))
557
+ return e > Cn ? (this._messageService.show({
558
+ type: pe.Error,
559
+ content: this._localeService.t("update-status.exceedMaxCount", String(Cn))
560
560
  }), !1) : e === 0 ? !1 : (t.forEach(async (n) => await this.insertFloatImageByFile(n)), !0);
561
561
  }
562
562
  async insertCellImage() {
563
563
  const e = (await this._fileOpenerService.openFile({
564
564
  multiple: !1,
565
- accept: Cn.map((n) => `.${n.replace("image/", "")}`).join(",")
565
+ accept: In.map((n) => `.${n.replace("image/", "")}`).join(",")
566
566
  }))[0];
567
567
  return e ? (await this._insertCellImage(e), !0) : !1;
568
568
  }
@@ -573,105 +573,107 @@ let et = class extends re {
573
573
  let e;
574
574
  try {
575
575
  e = await this._imageIoService.saveImage(t);
576
- } catch (S) {
577
- const I = S.message;
578
- I === Pe.ERROR_EXCEED_SIZE ? this._messageService.show({
579
- type: we.Error,
580
- content: this._localeService.t("update-status.exceedMaxSize", String(bn / (1024 * 1024)))
581
- }) : I === Pe.ERROR_IMAGE_TYPE ? this._messageService.show({
582
- type: we.Error,
576
+ } catch (v) {
577
+ const I = v.message;
578
+ I === Ue.ERROR_EXCEED_SIZE ? this._messageService.show({
579
+ type: pe.Error,
580
+ content: this._localeService.t("update-status.exceedMaxSize", String(Dn / (1024 * 1024)))
581
+ }) : I === Ue.ERROR_IMAGE_TYPE ? this._messageService.show({
582
+ type: pe.Error,
583
583
  content: this._localeService.t("update-status.invalidImageType")
584
- }) : I === Pe.ERROR_IMAGE && this._messageService.show({
585
- type: we.Error,
584
+ }) : I === Ue.ERROR_IMAGE && this._messageService.show({
585
+ type: pe.Error,
586
586
  content: this._localeService.t("update-status.invalidImage")
587
587
  });
588
588
  }
589
589
  if (e == null)
590
590
  return;
591
- const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await Lt(u || ""), { width: h, height: m } = this._context.scene;
591
+ const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await xt(u || ""), { width: h, height: f } = this._context.scene;
592
592
  this._imageIoService.addImageSourceCache(d, a, g);
593
593
  let p = 1;
594
- if (c > Rn || l > Mn) {
595
- const S = Rn / c, I = Mn / l;
596
- p = Math.max(S, I);
594
+ if (c > Rn || l > bn) {
595
+ const v = Rn / c, I = bn / l;
596
+ p = Math.max(v, I);
597
597
  }
598
- const f = this._getImagePosition(c * p, l * p, h, m);
599
- if (f == null)
598
+ const m = this._getImagePosition(c * p, l * p, h, f);
599
+ if (m == null)
600
600
  return;
601
601
  const _ = {
602
602
  unitId: r,
603
603
  subUnitId: s,
604
604
  drawingId: o,
605
- drawingType: j.DRAWING_IMAGE,
605
+ drawingType: B.DRAWING_IMAGE,
606
606
  imageSourceType: a,
607
607
  source: d,
608
- transform: z(f, this._selectionRenderService, this._skeletonManagerService),
609
- sheetTransform: f
608
+ transform: z(m, this._selectionRenderService, this._skeletonManagerService),
609
+ sheetTransform: m
610
610
  };
611
- return this._commandService.executeCommand(Wt.id, {
611
+ return this._commandService.executeCommand(kt.id, {
612
612
  unitId: r,
613
613
  drawings: [_]
614
614
  });
615
615
  }
616
616
  // eslint-disable-next-line max-lines-per-function
617
617
  async _insertCellImage(t, e) {
618
- var _, S;
618
+ var I, R;
619
619
  let n;
620
620
  try {
621
621
  n = await this._imageIoService.saveImage(t);
622
- } catch (I) {
623
- const b = I.message;
624
- b === Pe.ERROR_EXCEED_SIZE ? this._messageService.show({
625
- type: we.Error,
626
- content: this._localeService.t("update-status.exceedMaxSize", String(bn / (1024 * 1024)))
627
- }) : b === Pe.ERROR_IMAGE_TYPE ? this._messageService.show({
628
- type: we.Error,
622
+ } catch (S) {
623
+ const C = S.message;
624
+ C === Ue.ERROR_EXCEED_SIZE ? this._messageService.show({
625
+ type: pe.Error,
626
+ content: this._localeService.t("update-status.exceedMaxSize", String(Dn / (1024 * 1024)))
627
+ }) : C === Ue.ERROR_IMAGE_TYPE ? this._messageService.show({
628
+ type: pe.Error,
629
629
  content: this._localeService.t("update-status.invalidImageType")
630
- }) : b === Pe.ERROR_IMAGE && this._messageService.show({
631
- type: we.Error,
630
+ }) : C === Ue.ERROR_IMAGE && this._messageService.show({
631
+ type: pe.Error,
632
632
  content: this._localeService.t("update-status.invalidImage")
633
633
  });
634
634
  }
635
635
  if (n == null)
636
636
  return !1;
637
- const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await Lt(a || "");
637
+ const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await xt(a || "");
638
638
  this._imageIoService.addImageSourceCache(o, s, c);
639
639
  const l = this._workbookSelections.getCurrentLastSelection();
640
640
  if (!l)
641
641
  return !1;
642
- const g = Ht("", {}), h = rn(
642
+ let g = l.primary.actualRow, h = l.primary.actualColumn;
643
+ l.primary.isMerged && (g = l.primary.startRow, h = l.primary.startColumn);
644
+ const f = Vt("", {}), p = nn(
643
645
  this._injector,
644
646
  {
645
647
  unitId: this._context.unitId,
646
648
  subUnitId: this._context.unit.getActiveSheet().getSheetId(),
647
- row: l.primary.actualRow,
648
- col: l.primary.actualColumn
649
+ row: g,
650
+ col: h
649
651
  },
650
652
  d,
651
653
  u,
652
654
  0
653
655
  );
654
- if (!h)
656
+ if (!p)
655
657
  return !1;
656
658
  const m = {
657
659
  size: {
658
- width: h.width,
659
- height: h.height
660
+ width: p.width,
661
+ height: p.height
660
662
  },
661
663
  positionH: {
662
- relativeFrom: wn.PAGE,
664
+ relativeFrom: pn.PAGE,
663
665
  posOffset: 0
664
666
  },
665
667
  positionV: {
666
- relativeFrom: pn.PARAGRAPH,
668
+ relativeFrom: mn.PARAGRAPH,
667
669
  posOffset: 0
668
670
  },
669
671
  angle: 0
670
- }, p = {
671
- unitId: g.getUnitId(),
672
- subUnitId: g.getUnitId(),
672
+ }, _ = {
673
+ unitId: f.getUnitId(),
674
+ subUnitId: f.getUnitId(),
673
675
  drawingId: r,
674
- drawingType: j.DRAWING_IMAGE,
676
+ drawingType: B.DRAWING_IMAGE,
675
677
  imageSourceType: s,
676
678
  source: o,
677
679
  transform: Bn(m),
@@ -679,27 +681,27 @@ let et = class extends re {
679
681
  behindDoc: Sn.FALSE,
680
682
  title: "",
681
683
  description: "",
682
- layoutType: vn.INLINE,
684
+ layoutType: _n.INLINE,
683
685
  // Insert inline drawing by default.
684
- wrapText: _n.BOTH_SIDES,
686
+ wrapText: wn.BOTH_SIDES,
685
687
  distB: 0,
686
688
  distL: 0,
687
689
  distR: 0,
688
690
  distT: 0
689
- }, f = zt.drawing.add({
690
- documentDataModel: g,
691
- drawings: [p],
691
+ }, v = Ht.drawing.add({
692
+ documentDataModel: f,
693
+ drawings: [_],
692
694
  selection: {
693
695
  collapsed: !0,
694
696
  startOffset: 0,
695
697
  endOffset: 0
696
698
  }
697
699
  });
698
- return f ? (g.apply(f), this._commandService.syncExecuteCommand(kn.id, {
700
+ return v ? (f.apply(v), this._commandService.syncExecuteCommand(Nn.id, {
699
701
  value: {
700
- [(_ = e == null ? void 0 : e.row) != null ? _ : l.primary.actualRow]: {
701
- [(S = e == null ? void 0 : e.col) != null ? S : l.primary.actualColumn]: {
702
- p: g.getSnapshot(),
702
+ [(I = e == null ? void 0 : e.row) != null ? I : g]: {
703
+ [(R = e == null ? void 0 : e.col) != null ? R : h]: {
704
+ p: f.getSnapshot(),
703
705
  t: 1
704
706
  }
705
707
  }
@@ -711,12 +713,12 @@ let et = class extends re {
711
713
  // eslint-disable-next-line max-lines-per-function
712
714
  async insertCellImageByUrl(t, e) {
713
715
  var g, h;
714
- const { width: n, height: r, image: s } = await Lt(t || "");
715
- this._imageIoService.addImageSourceCache(t, In.URL, s);
716
+ const { width: n, height: r, image: s } = await xt(t || "");
717
+ this._imageIoService.addImageSourceCache(t, vn.URL, s);
716
718
  const o = this._workbookSelections.getCurrentLastSelection();
717
719
  if (!o)
718
720
  return !1;
719
- const a = Ht("", {}), d = rn(
721
+ const a = Vt("", {}), d = nn(
720
722
  this._injector,
721
723
  {
722
724
  unitId: this._context.unitId,
@@ -736,34 +738,34 @@ let et = class extends re {
736
738
  height: d.height
737
739
  },
738
740
  positionH: {
739
- relativeFrom: wn.PAGE,
741
+ relativeFrom: pn.PAGE,
740
742
  posOffset: 0
741
743
  },
742
744
  positionV: {
743
- relativeFrom: pn.PARAGRAPH,
745
+ relativeFrom: mn.PARAGRAPH,
744
746
  posOffset: 0
745
747
  },
746
748
  angle: 0
747
749
  }, c = {
748
750
  unitId: a.getUnitId(),
749
751
  subUnitId: a.getUnitId(),
750
- drawingId: bt(),
751
- drawingType: j.DRAWING_IMAGE,
752
- imageSourceType: In.URL,
752
+ drawingId: Dt(),
753
+ drawingType: B.DRAWING_IMAGE,
754
+ imageSourceType: vn.URL,
753
755
  source: t,
754
756
  transform: Bn(u),
755
757
  docTransform: u,
756
758
  behindDoc: Sn.FALSE,
757
759
  title: "",
758
760
  description: "",
759
- layoutType: vn.INLINE,
761
+ layoutType: _n.INLINE,
760
762
  // Insert inline drawing by default.
761
- wrapText: _n.BOTH_SIDES,
763
+ wrapText: wn.BOTH_SIDES,
762
764
  distB: 0,
763
765
  distL: 0,
764
766
  distR: 0,
765
767
  distT: 0
766
- }, l = zt.drawing.add({
768
+ }, l = Ht.drawing.add({
767
769
  documentDataModel: a,
768
770
  drawings: [c],
769
771
  selection: {
@@ -772,7 +774,7 @@ let et = class extends re {
772
774
  endOffset: 0
773
775
  }
774
776
  });
775
- return l ? (a.apply(l), this._commandService.syncExecuteCommand(kn.id, {
777
+ return l ? (a.apply(l), this._commandService.syncExecuteCommand(Nn.id, {
776
778
  value: {
777
779
  [(g = e == null ? void 0 : e.row) != null ? g : o.primary.actualRow]: {
778
780
  [(h = e == null ? void 0 : e.col) != null ? h : o.primary.actualColumn]: {
@@ -801,29 +803,29 @@ let et = class extends re {
801
803
  endColumn: 0
802
804
  };
803
805
  s && s.length > 0 && (o = s[s.length - 1].range);
804
- const a = Vn(this._skeletonManagerService.getCurrent().skeleton, o);
806
+ const a = Ln(this._skeletonManagerService.getCurrent().skeleton, o);
805
807
  if (a == null)
806
808
  return;
807
809
  let { startColumn: d, startRow: u, startX: c, startY: l } = a, g = !1;
808
810
  if (c + t > n && (c = n - t, c < 0 && (c = 0, t = n), g = !0), l + e > r && (l = r - e, l < 0 && (l = 0, e = r), g = !0), g) {
809
- const f = this._selectionRenderService.getCellWithCoordByOffset(c, l);
810
- if (f == null)
811
+ const m = this._selectionRenderService.getCellWithCoordByOffset(c, l);
812
+ if (m == null)
811
813
  return;
812
- c = f.startX, l = f.startY, d = f.actualColumn, u = f.actualRow;
814
+ c = m.startX, l = m.startY, d = m.actualColumn, u = m.actualRow;
813
815
  }
814
816
  const h = {
815
817
  column: d,
816
818
  columnOffset: 0,
817
819
  row: u,
818
820
  rowOffset: 0
819
- }, m = this._selectionRenderService.getCellWithCoordByOffset(c + t, l + e);
820
- if (m == null)
821
+ }, f = this._selectionRenderService.getCellWithCoordByOffset(c + t, l + e);
822
+ if (f == null)
821
823
  return;
822
824
  const p = {
823
- column: m.actualColumn,
824
- columnOffset: c + t - m.startX,
825
- row: m.actualRow,
826
- rowOffset: l + e - m.startY
825
+ column: f.actualColumn,
826
+ columnOffset: c + t - f.startX,
827
+ row: f.actualRow,
828
+ rowOffset: l + e - f.startY
827
829
  };
828
830
  return {
829
831
  from: h,
@@ -833,7 +835,7 @@ let et = class extends re {
833
835
  _updateOrderListener() {
834
836
  this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((t) => {
835
837
  const { unitId: e, subUnitId: n, drawingIds: r, arrangeType: s } = t;
836
- this._commandService.executeCommand(vr.id, {
838
+ this._commandService.executeCommand(pr.id, {
837
839
  unitId: e,
838
840
  subUnitId: n,
839
841
  drawingIds: r,
@@ -860,7 +862,7 @@ let et = class extends re {
860
862
  sheetTransform: { ...c }
861
863
  };
862
864
  e.push(l);
863
- }), e.length > 0 && this._commandService.executeCommand(jt.id, {
865
+ }), e.length > 0 && this._commandService.executeCommand(Wt.id, {
864
866
  unitId: t[0].unitId,
865
867
  drawings: e
866
868
  }));
@@ -868,44 +870,44 @@ let et = class extends re {
868
870
  }
869
871
  _groupDrawingListener() {
870
872
  this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((t) => {
871
- this._commandService.executeCommand(_r.id, t);
873
+ this._commandService.executeCommand(mr.id, t);
872
874
  const { unitId: e, subUnitId: n, drawingId: r } = t[0].parent;
873
- this._commandService.syncExecuteCommand(Nt.id, [{ unitId: e, subUnitId: n, drawingId: r }]);
875
+ this._commandService.syncExecuteCommand(At.id, [{ unitId: e, subUnitId: n, drawingId: r }]);
874
876
  })), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((t) => {
875
- this._commandService.executeCommand(Sr.id, t);
877
+ this._commandService.executeCommand(wr.id, t);
876
878
  }));
877
879
  }
878
880
  _focusDrawingListener() {
879
881
  this.disposeWithMe(
880
882
  this._drawingManagerService.focus$.subscribe((t) => {
881
- t == null || t.length === 0 ? (this._contextService.setContextValue(xe, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(xe, !0), this._sheetDrawingService.focusDrawing(t));
883
+ t == null || t.length === 0 ? (this._contextService.setContextValue($e, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue($e, !0), this._sheetDrawingService.focusDrawing(t));
882
884
  })
883
885
  );
884
886
  }
885
887
  };
886
- et = _s([
888
+ Qe = ls([
887
889
  te(1, A(V)),
888
890
  te(2, G),
889
- te(3, Ge),
890
- te(4, ii),
891
- te(5, Ai),
892
- te(6, se),
893
- te(7, ie),
891
+ te(3, Xe),
892
+ te(4, Zr),
893
+ te(5, Mi),
894
+ te(6, ie),
895
+ te(7, re),
894
896
  te(8, Yn),
895
- te(9, Hn),
896
- te(10, A(nt)),
897
- te(11, A(dn)),
897
+ te(9, Vn),
898
+ te(10, A(tt)),
899
+ te(11, A(cn)),
898
900
  te(12, A(Ye))
899
- ], et);
900
- var Ss = Object.getOwnPropertyDescriptor, Is = (i, t, e, n) => {
901
- for (var r = n > 1 ? void 0 : n ? Ss(t, e) : t, s = i.length - 1, o; s >= 0; s--)
901
+ ], Qe);
902
+ var hs = Object.getOwnPropertyDescriptor, gs = (i, t, e, n) => {
903
+ for (var r = n > 1 ? void 0 : n ? hs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
902
904
  (o = i[s]) && (r = o(r) || r);
903
905
  return r;
904
- }, ke = (i, t) => (e, n) => t(e, n, i);
905
- function Ir(i, t, e) {
906
+ }, Ne = (i, t) => (e, n) => t(e, n, i);
907
+ function _r(i, t, e) {
906
908
  var n, r, s, o;
907
909
  if (((r = (n = e == null ? void 0 : e.p) == null ? void 0 : n.body) == null ? void 0 : r.dataStream.length) === 3 && ((o = (s = e.p) == null ? void 0 : s.drawingsOrder) == null ? void 0 : o.length) === 1) {
908
- const a = e.p.drawings[e.p.drawingsOrder[0]], d = rn(
910
+ const a = e.p.drawings[e.p.drawingsOrder[0]], d = nn(
909
911
  i,
910
912
  {
911
913
  unitId: t.unitId,
@@ -922,47 +924,47 @@ function Ir(i, t, e) {
922
924
  }
923
925
  return !1;
924
926
  }
925
- let Mt = class extends re {
927
+ let bt = class extends ne {
926
928
  constructor(i, t, e, n, r, s) {
927
929
  super(), this._commandService = i, this._sheetInterceptorService = t, this._injector = e, this._drawingManagerService = n, this._docDrawingController = r, this._editorBridgeService = s, this._handleInitEditor(), this._initCellContentInterceptor();
928
930
  }
929
931
  _handleInitEditor() {
930
932
  this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
931
- i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(qe), this._docDrawingController.loadDrawingDataForUnit(qe), this._drawingManagerService.initializeNotification(qe)) : this._drawingManagerService.removeDrawingDataForUnit(qe);
933
+ i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(Ze), this._docDrawingController.loadDrawingDataForUnit(Ze), this._drawingManagerService.initializeNotification(Ze)) : this._drawingManagerService.removeDrawingDataForUnit(Ze);
932
934
  })), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
933
- i.id === is.id && i.params.unitId === Be && (this._drawingManagerService.removeDrawingDataForUnit(Be), this._docDrawingController.loadDrawingDataForUnit(Be), this._drawingManagerService.initializeNotification(Be));
935
+ i.id === Zi.id && i.params.unitId === Be && (this._drawingManagerService.removeDrawingDataForUnit(Be), this._docDrawingController.loadDrawingDataForUnit(Be), this._drawingManagerService.initializeNotification(Be));
934
936
  }));
935
937
  }
936
938
  _initCellContentInterceptor() {
937
939
  this.disposeWithMe(
938
940
  this._sheetInterceptorService.intercept(
939
- Xi.CELL_CONTENT,
941
+ ji.CELL_CONTENT,
940
942
  {
941
- effect: Br.Style,
942
- priority: Vi.CELL_IMAGE,
943
+ effect: Ur.Style,
944
+ priority: $i.CELL_IMAGE,
943
945
  handler: (i, t, e) => {
944
946
  var n;
945
- return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }, Ir(this._injector, { unitId: t.unitId, subUnitId: t.subUnitId, row: t.row, col: t.col }, i)), e(i);
947
+ return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }, _r(this._injector, { unitId: t.unitId, subUnitId: t.subUnitId, row: t.row, col: t.col }, i)), e(i);
946
948
  }
947
949
  }
948
950
  )
949
951
  );
950
952
  }
951
953
  };
952
- Mt = Is([
953
- ke(0, G),
954
- ke(1, A(kt)),
955
- ke(2, A(Ye)),
956
- ke(3, ie),
957
- ke(4, A(ni)),
958
- ke(5, A(bi))
959
- ], Mt);
960
- var Cs = Object.getOwnPropertyDescriptor, Ds = (i, t, e, n) => {
961
- for (var r = n > 1 ? void 0 : n ? Cs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
954
+ bt = gs([
955
+ Ne(0, G),
956
+ Ne(1, A(Nt)),
957
+ Ne(2, A(Ye)),
958
+ Ne(3, re),
959
+ Ne(4, A(Kr)),
960
+ Ne(5, A(wi))
961
+ ], bt);
962
+ var fs = Object.getOwnPropertyDescriptor, ms = (i, t, e, n) => {
963
+ for (var r = n > 1 ? void 0 : n ? fs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
962
964
  (o = i[s]) && (r = o(r) || r);
963
965
  return r;
964
- }, xn = (i, t) => (e, n) => t(e, n, i);
965
- let yt = class extends re {
966
+ }, $n = (i, t) => (e, n) => t(e, n, i);
967
+ let Mt = class extends ne {
966
968
  constructor(i, t) {
967
969
  super(), this._autoFillService = i, this._injector = t, this._initAutoFillHooks();
968
970
  }
@@ -971,35 +973,35 @@ let yt = class extends re {
971
973
  this._autoFillService.addHook({
972
974
  id: "sheet-cell-image-autofill",
973
975
  onBeforeSubmit: (i, t, e, n) => {
974
- new $r(n).forValue((r, s, o) => {
975
- Ir(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
976
+ new Pr(n).forValue((r, s, o) => {
977
+ _r(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
976
978
  });
977
979
  }
978
980
  })
979
981
  );
980
982
  }
981
983
  };
982
- yt = Ds([
983
- xn(0, A(Ri)),
984
- xn(1, A(Ye))
985
- ], yt);
986
- var bs = Object.getOwnPropertyDescriptor, Rs = (i, t, e, n) => {
987
- for (var r = n > 1 ? void 0 : n ? bs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
984
+ Mt = ms([
985
+ $n(0, A(_i)),
986
+ $n(1, A(Ye))
987
+ ], Mt);
988
+ var ps = Object.getOwnPropertyDescriptor, ws = (i, t, e, n) => {
989
+ for (var r = n > 1 ? void 0 : n ? ps(t, e) : t, s = i.length - 1, o; s >= 0; s--)
988
990
  (o = i[s]) && (r = o(r) || r);
989
991
  return r;
990
- }, ze = (i, t) => (e, n) => t(e, n, i);
991
- const Ms = [
992
- qe,
993
- xr,
992
+ }, He = (i, t) => (e, n) => t(e, n, i);
993
+ const _s = [
994
+ Ze,
995
+ Ar,
994
996
  Be
995
997
  ];
996
- let Et = class extends re {
998
+ let yt = class extends ne {
997
999
  constructor(i, t, e, n, r) {
998
1000
  super(), this._commandService = i, this._univerInstanceService = t, this._dialogService = e, this._renderManagerService = n, this._localeService = r, this._initDocImageCopyPasteHooks();
999
1001
  }
1000
1002
  _setCellImage(i) {
1001
1003
  var r;
1002
- const t = Ht("", {}), e = (r = on(x.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(Mi), n = zt.drawing.add({
1004
+ const t = Vt("", {}), e = (r = sn(F.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(Si), n = Ht.drawing.add({
1003
1005
  documentDataModel: t,
1004
1006
  drawings: [i],
1005
1007
  selection: {
@@ -1014,20 +1016,20 @@ let Et = class extends re {
1014
1016
  this.disposeWithMe(
1015
1017
  this._commandService.beforeCommandExecuted((i) => {
1016
1018
  var t, e;
1017
- if (i.id === ss.id) {
1018
- const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType(x.UNIVER_DOC);
1019
+ if (i.id === qi.id) {
1020
+ const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType(F.UNIVER_DOC);
1019
1021
  if (s == null || !Object.keys((t = r.drawings) != null ? t : {}).length)
1020
1022
  return;
1021
1023
  const o = s.getUnitId();
1022
- if (Ms.includes(o)) {
1024
+ if (_s.includes(o)) {
1023
1025
  if (o !== Be) {
1024
1026
  const a = () => {
1025
- this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(En.id, {
1027
+ this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(yn.id, {
1026
1028
  visible: !1
1027
1029
  });
1028
1030
  };
1029
1031
  ((e = s.getBody()) == null ? void 0 : e.dataStream) === `\r
1030
- ` ? (this._commandService.syncExecuteCommand(En.id, {
1032
+ ` ? (this._commandService.syncExecuteCommand(yn.id, {
1031
1033
  visible: !1
1032
1034
  }), this._setCellImage(Object.values(r.drawings)[0])) : this._dialogService.open({
1033
1035
  id: "sheet-cell-image-copy-paste",
@@ -1055,23 +1057,23 @@ let Et = class extends re {
1055
1057
  );
1056
1058
  }
1057
1059
  };
1058
- Et = Rs([
1059
- ze(0, G),
1060
- ze(1, Se),
1061
- ze(2, Ni),
1062
- ze(3, J),
1063
- ze(4, A(nt))
1064
- ], Et);
1060
+ yt = ws([
1061
+ He(0, G),
1062
+ He(1, Se),
1063
+ He(2, yi),
1064
+ He(3, Z),
1065
+ He(4, A(tt))
1066
+ ], yt);
1065
1067
  const Bt = {
1066
1068
  id: "sheet.command.insert-float-image",
1067
- type: Z.COMMAND,
1069
+ type: J.COMMAND,
1068
1070
  handler: async (i, t) => {
1069
1071
  var o, a;
1070
- const e = i.get(Se), n = i.get(J), r = (o = on(
1071
- x.UNIVER_SHEET,
1072
+ const e = i.get(Se), n = i.get(Z), r = (o = sn(
1073
+ F.UNIVER_SHEET,
1072
1074
  e,
1073
1075
  n
1074
- )) == null ? void 0 : o.with(et);
1076
+ )) == null ? void 0 : o.with(Qe);
1075
1077
  if (!r)
1076
1078
  return !1;
1077
1079
  const s = t == null ? void 0 : t.files;
@@ -1081,38 +1083,38 @@ const Bt = {
1081
1083
  } else
1082
1084
  return (a = r.insertFloatImage()) != null ? a : !1;
1083
1085
  }
1084
- }, ln = {
1086
+ }, dn = {
1085
1087
  id: "sheet.command.insert-cell-image",
1086
- type: Z.COMMAND,
1088
+ type: J.COMMAND,
1087
1089
  handler: (i) => {
1088
1090
  var n, r;
1089
- const t = i.get(Se), e = i.get(J);
1090
- return (r = (n = on(
1091
- x.UNIVER_SHEET,
1091
+ const t = i.get(Se), e = i.get(Z);
1092
+ return (r = (n = sn(
1093
+ F.UNIVER_SHEET,
1092
1094
  t,
1093
1095
  e
1094
- )) == null ? void 0 : n.with(et).insertCellImage()) != null ? r : !1;
1096
+ )) == null ? void 0 : n.with(Qe).insertCellImage()) != null ? r : !1;
1095
1097
  }
1096
1098
  };
1097
- var ys = Object.getOwnPropertyDescriptor, Es = (i, t, e, n) => {
1098
- for (var r = n > 1 ? void 0 : n ? ys(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1099
+ var Ss = Object.getOwnPropertyDescriptor, vs = (i, t, e, n) => {
1100
+ for (var r = n > 1 ? void 0 : n ? Ss(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1099
1101
  (o = i[s]) && (r = o(r) || r);
1100
1102
  return r;
1101
- }, Ke = (i, t) => (e, n) => t(e, n, i);
1102
- const Cr = "image/png";
1103
- function Ts(i) {
1103
+ }, ze = (i, t) => (e, n) => t(e, n, i);
1104
+ const Sr = "image/png";
1105
+ function Is(i) {
1104
1106
  const t = i.split(","), e = atob(t[1]), n = e.length, r = new Uint8Array(n);
1105
1107
  for (let s = 0; s < n; s++)
1106
1108
  r[s] = e.charCodeAt(s);
1107
- return new Blob([r], { type: Cr });
1109
+ return new Blob([r], { type: Sr });
1108
1110
  }
1109
- function Os(i) {
1110
- const t = new ClipboardItem({ [Cr]: Ts(i) });
1111
+ function Cs(i) {
1112
+ const t = new ClipboardItem({ [Sr]: Is(i) });
1111
1113
  navigator.clipboard.write([t]).catch((e) => {
1112
1114
  console.error("Could not copy image using clipboard API: ", e);
1113
1115
  });
1114
1116
  }
1115
- function Us() {
1117
+ function Ds() {
1116
1118
  function i() {
1117
1119
  const n = document.createElement("input");
1118
1120
  return n.style.position = "absolute", n.style.height = "1px", n.style.width = "1px", n.style.opacity = "0", n;
@@ -1123,12 +1125,12 @@ function Us() {
1123
1125
  };
1124
1126
  }
1125
1127
  const Fn = [
1126
- $e.SPECIAL_PASTE_COL_WIDTH,
1127
- $e.SPECIAL_PASTE_VALUE,
1128
- $e.SPECIAL_PASTE_FORMAT,
1129
- $e.SPECIAL_PASTE_FORMULA
1128
+ je.SPECIAL_PASTE_COL_WIDTH,
1129
+ je.SPECIAL_PASTE_VALUE,
1130
+ je.SPECIAL_PASTE_FORMAT,
1131
+ je.SPECIAL_PASTE_FORMULA
1130
1132
  ];
1131
- let Tt = class extends re {
1133
+ let Et = class extends ne {
1132
1134
  constructor(t, e, n, r, s) {
1133
1135
  super();
1134
1136
  ee(this, "_copyInfo");
@@ -1145,16 +1147,16 @@ let Tt = class extends re {
1145
1147
  const s = this._focusedDrawings;
1146
1148
  if (s.length > 0) {
1147
1149
  const [o] = s;
1148
- if (r === Ce.CUT) {
1150
+ if (r === Ie.CUT) {
1149
1151
  const d = {
1150
1152
  unitId: t,
1151
1153
  drawings: [o]
1152
1154
  };
1153
- this._commandService.executeCommand(rt.id, d);
1155
+ this._commandService.executeCommand(nt.id, d);
1154
1156
  }
1155
1157
  setTimeout(() => {
1156
- const d = Us();
1157
- o.drawingType === j.DRAWING_IMAGE && o.imageSourceType === si.BASE64 ? Os(o.source) : this._clipboardInterfaceService.writeText(""), d();
1158
+ const d = Ds();
1159
+ o.drawingType === B.DRAWING_IMAGE && o.imageSourceType === qr.BASE64 ? Cs(o.source) : this._clipboardInterfaceService.writeText(""), d();
1158
1160
  }, 200);
1159
1161
  const a = {
1160
1162
  unitId: o.unitId,
@@ -1170,14 +1172,14 @@ let Tt = class extends re {
1170
1172
  onPasteCells: (t, e, n, r) => {
1171
1173
  if (!this._copyInfo)
1172
1174
  return { redos: [], undos: [] };
1173
- const { copyType: s = Ce.COPY, pasteType: o } = r, { range: a } = t || {}, { range: d, unitId: u, subUnitId: c } = e;
1174
- return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: c, pasteRange: d }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o }, Ce.COPY);
1175
+ const { copyType: s = Ie.COPY, pasteType: o } = r, { range: a } = t || {}, { range: d, unitId: u, subUnitId: c } = e;
1176
+ return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: c, pasteRange: d }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o }, Ie.COPY);
1175
1177
  },
1176
1178
  onPastePlainText: (t, e) => ({ undos: [], redos: [] }),
1177
- onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: $e.DEFAULT_PASTE }, Ce.COPY) : { undos: [], redos: [] },
1179
+ onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: je.DEFAULT_PASTE }, Ie.COPY) : { undos: [], redos: [] },
1178
1180
  onPasteFiles: (t, e) => {
1179
1181
  if (this._copyInfo)
1180
- return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: $e.DEFAULT_PASTE }, Ce.COPY);
1182
+ return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: je.DEFAULT_PASTE }, Ie.COPY);
1181
1183
  {
1182
1184
  const n = e.filter((r) => r.type.includes("image"));
1183
1185
  if (n.length)
@@ -1204,16 +1206,16 @@ let Tt = class extends re {
1204
1206
  return;
1205
1207
  const { startX: o, endX: a, startY: d, endY: u } = s, c = this._drawingService.getDrawingData(t, e), l = this._focusedDrawings.slice();
1206
1208
  if (Object.keys(c).forEach((h) => {
1207
- const m = c[h], { transform: p } = m;
1208
- if (m.anchorType !== O.Both || !p)
1209
+ const f = c[h], { transform: p } = f;
1210
+ if (f.anchorType !== O.Both || !p)
1209
1211
  return;
1210
- const { left: f = 0, top: _ = 0, width: S = 0, height: I = 0 } = p, { drawingStartX: b, drawingEndX: v, drawingStartY: D, drawingEndY: w } = {
1211
- drawingStartX: f,
1212
- drawingEndX: f + S,
1212
+ const { left: m = 0, top: _ = 0, width: v = 0, height: I = 0 } = p, { drawingStartX: R, drawingEndX: S, drawingStartY: C, drawingEndY: w } = {
1213
+ drawingStartX: m,
1214
+ drawingEndX: m + v,
1213
1215
  drawingStartY: _,
1214
1216
  drawingEndY: _ + I
1215
1217
  };
1216
- o <= b && v <= a && d <= D && w <= u && l.push(m);
1218
+ o <= R && S <= a && d <= C && w <= u && l.push(f);
1217
1219
  }), l.length)
1218
1220
  return {
1219
1221
  copyRange: n,
@@ -1226,29 +1228,29 @@ let Tt = class extends re {
1226
1228
  const { pasteType: n, pasteTo: r } = t;
1227
1229
  if (Fn.includes(n))
1228
1230
  return { redos: [], undos: [] };
1229
- const { unitId: s, subUnitId: o, range: a } = r, d = this._renderManagerService.getRenderById(s), u = d == null ? void 0 : d.with(V), c = d == null ? void 0 : d.with(Ge), l = this._copyInfo;
1231
+ const { unitId: s, subUnitId: o, range: a } = r, d = this._renderManagerService.getRenderById(s), u = d == null ? void 0 : d.with(V), c = d == null ? void 0 : d.with(Xe), l = this._copyInfo;
1230
1232
  if (!u || !c)
1231
1233
  return { redos: [], undos: [] };
1232
- const { drawings: g } = l, h = Tn(a);
1234
+ const { drawings: g } = l, h = En(a);
1233
1235
  return this._generateMutations(g, {
1234
1236
  unitId: s,
1235
1237
  subUnitId: o,
1236
- isCut: e === Ce.CUT,
1237
- getTransform: (m, p) => {
1238
- var S;
1239
- const f = u.attachRangeWithCoord({
1238
+ isCut: e === Ie.CUT,
1239
+ getTransform: (f, p) => {
1240
+ var v;
1241
+ const m = u.attachRangeWithCoord({
1240
1242
  startRow: h.startRow,
1241
1243
  endRow: h.endRow,
1242
1244
  startColumn: h.startColumn,
1243
1245
  endColumn: h.endColumn
1244
1246
  }), _ = {
1245
- ...m,
1246
- left: f == null ? void 0 : f.startX,
1247
- top: f == null ? void 0 : f.startY
1247
+ ...f,
1248
+ left: m == null ? void 0 : m.startX,
1249
+ top: m == null ? void 0 : m.startY
1248
1250
  };
1249
1251
  return {
1250
1252
  transform: _,
1251
- sheetTransform: (S = $(_, c)) != null ? S : p
1253
+ sheetTransform: (v = $(_, c)) != null ? v : p
1252
1254
  };
1253
1255
  }
1254
1256
  });
@@ -1264,7 +1266,7 @@ let Tt = class extends re {
1264
1266
  const { transform: l, sheetTransform: g } = c;
1265
1267
  if (!l)
1266
1268
  return;
1267
- const h = s(l, g), m = {
1269
+ const h = s(l, g), f = {
1268
1270
  ...c,
1269
1271
  unitId: n,
1270
1272
  subUnitId: r,
@@ -1273,14 +1275,14 @@ let Tt = class extends re {
1273
1275
  sheetTransform: h.sheetTransform
1274
1276
  };
1275
1277
  if (o) {
1276
- const { undo: p, redo: f, objects: _ } = u.getBatchUpdateOp([m]);
1278
+ const { undo: p, redo: m, objects: _ } = u.getBatchUpdateOp([f]);
1277
1279
  a.push({
1278
1280
  id: P.id,
1279
1281
  params: {
1280
1282
  unitId: n,
1281
1283
  subUnitId: r,
1282
1284
  type: U.UPDATE,
1283
- op: f,
1285
+ op: m,
1284
1286
  objects: _
1285
1287
  }
1286
1288
  }), d.push({
@@ -1294,8 +1296,8 @@ let Tt = class extends re {
1294
1296
  }
1295
1297
  });
1296
1298
  } else {
1297
- const { undo: p, redo: f, objects: _ } = u.getBatchAddOp([m]);
1298
- a.push({ id: P.id, params: { op: f, unitId: n, subUnitId: r, objects: _, type: U.INSERT } }), d.push({ id: P.id, params: { op: p, unitId: n, subUnitId: r, objects: _, type: U.REMOVE } });
1299
+ const { undo: p, redo: m, objects: _ } = u.getBatchAddOp([f]);
1300
+ a.push({ id: P.id, params: { op: m, unitId: n, subUnitId: r, objects: _, type: U.INSERT } }), d.push({ id: P.id, params: { op: p, unitId: n, subUnitId: r, objects: _, type: U.REMOVE } });
1299
1301
  }
1300
1302
  }), { redos: a, undos: d };
1301
1303
  }
@@ -1319,86 +1321,86 @@ let Tt = class extends re {
1319
1321
  const { drawings: c } = this._copyInfo;
1320
1322
  if (!a)
1321
1323
  return this._generateSingleDrawingPasteMutations({
1322
- pasteTo: { unitId: n, subUnitId: r, range: Tn(o) },
1324
+ pasteTo: { unitId: n, subUnitId: r, range: En(o) },
1323
1325
  pasteType: s
1324
1326
  }, d);
1325
- const { ranges: [l, g], mapFunc: h } = yi([a, o]), { row: m, col: p } = h(l.startRow, l.startColumn), { row: f, col: _ } = h(g.startRow, g.startColumn), S = u.attachRangeWithCoord({
1326
- startRow: m,
1327
- endRow: m,
1327
+ const { ranges: [l, g], mapFunc: h } = vi([a, o]), { row: f, col: p } = h(l.startRow, l.startColumn), { row: m, col: _ } = h(g.startRow, g.startColumn), v = u.attachRangeWithCoord({
1328
+ startRow: f,
1329
+ endRow: f,
1328
1330
  startColumn: p,
1329
1331
  endColumn: p
1330
1332
  }), I = u.attachRangeWithCoord({
1331
- startRow: f,
1332
- endRow: f,
1333
+ startRow: m,
1334
+ endRow: m,
1333
1335
  startColumn: _,
1334
1336
  endColumn: _
1335
1337
  });
1336
- if (!S || !I || !this._copyInfo)
1338
+ if (!v || !I || !this._copyInfo)
1337
1339
  return { redos: [], undos: [] };
1338
- const b = I.startX - S.startX, v = I.startY - S.startY, D = f - m, w = _ - p;
1340
+ const R = I.startX - v.startX, S = I.startY - v.startY, C = m - f, w = _ - p;
1339
1341
  return this._generateMutations(c, {
1340
1342
  unitId: n,
1341
1343
  subUnitId: r,
1342
- getTransform: (C, E) => {
1344
+ getTransform: (D, E) => {
1343
1345
  var T, M;
1344
1346
  return {
1345
1347
  transform: {
1346
- ...C,
1347
- left: ((T = C == null ? void 0 : C.left) != null ? T : 0) + b,
1348
- top: ((M = C == null ? void 0 : C.top) != null ? M : 0) + v
1348
+ ...D,
1349
+ left: ((T = D == null ? void 0 : D.left) != null ? T : 0) + R,
1350
+ top: ((M = D == null ? void 0 : D.top) != null ? M : 0) + S
1349
1351
  },
1350
1352
  sheetTransform: {
1351
1353
  ...E,
1352
1354
  to: {
1353
1355
  ...E.to,
1354
- row: E.to.row + D,
1356
+ row: E.to.row + C,
1355
1357
  column: E.to.column + w
1356
1358
  },
1357
1359
  from: {
1358
1360
  ...E.from,
1359
- row: E.from.row + D,
1361
+ row: E.from.row + C,
1360
1362
  column: E.from.column + w
1361
1363
  }
1362
1364
  }
1363
1365
  };
1364
1366
  },
1365
- isCut: d === Ce.CUT
1367
+ isCut: d === Ie.CUT
1366
1368
  });
1367
1369
  }
1368
1370
  };
1369
- Tt = Es([
1370
- Ke(0, Ei),
1371
- Ke(1, J),
1372
- Ke(2, ie),
1373
- Ke(3, ki),
1374
- Ke(4, G)
1375
- ], Tt);
1376
- var Ps = Object.getOwnPropertyDescriptor, As = (i, t, e, n) => {
1377
- for (var r = n > 1 ? void 0 : n ? Ps(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1371
+ Et = vs([
1372
+ ze(0, Ii),
1373
+ ze(1, Z),
1374
+ ze(2, re),
1375
+ ze(3, Ei),
1376
+ ze(4, G)
1377
+ ], Et);
1378
+ var Rs = Object.getOwnPropertyDescriptor, bs = (i, t, e, n) => {
1379
+ for (var r = n > 1 ? void 0 : n ? Rs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1378
1380
  (o = i[s]) && (r = o(r) || r);
1379
1381
  return r;
1380
- }, Ze = (i, t) => (e, n) => t(e, n, i);
1381
- let Ot = class extends re {
1382
+ }, Ke = (i, t) => (e, n) => t(e, n, i);
1383
+ let Tt = class extends ne {
1382
1384
  constructor(i, t, e, n, r) {
1383
1385
  super(), this._drawingManagerService = i, this._renderManagerService = t, this._permissionService = e, this._univerInstanceService = n, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
1384
1386
  }
1385
1387
  _initDrawingVisible() {
1386
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(x.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = vt([i, t]);
1388
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = _t([i, t]);
1387
1389
  this.disposeWithMe(
1388
1390
  e.pipe(
1389
- _e(([n, r]) => n ? n.activeSheet$.pipe(
1390
- Pn((s) => {
1391
+ we(([n, r]) => n ? n.activeSheet$.pipe(
1392
+ Un((s) => {
1391
1393
  if (!s) {
1392
1394
  this._drawingManagerService.setDrawingVisible(!1);
1393
1395
  return;
1394
1396
  }
1395
1397
  const o = n.getUnitId(), a = s.getSheetId();
1396
1398
  this._permissionService.composePermission([
1397
- new Wn(o).id,
1398
- new jn(o, a).id
1399
+ new kn(o).id,
1400
+ new Wn(o, a).id
1399
1401
  ]).every((u) => u.value) ? this._drawingManagerService.setDrawingVisible(!0) : this._handleDrawingVisibilityFalse(n, s);
1400
1402
  })
1401
- ) : (this._drawingManagerService.setDrawingVisible(!1), me))
1403
+ ) : (this._drawingManagerService.setDrawingVisible(!1), fe))
1402
1404
  ).subscribe()
1403
1405
  );
1404
1406
  }
@@ -1408,26 +1410,26 @@ let Ot = class extends re {
1408
1410
  if (!a)
1409
1411
  return;
1410
1412
  a.getAllObjectsByOrder().forEach((u) => {
1411
- u.classType === Ae.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.removeObject(u);
1413
+ u.classType === Pe.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.removeObject(u);
1412
1414
  });
1413
1415
  }
1414
1416
  _initDrawingEditable() {
1415
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(x.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = vt([i, t]);
1417
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = _t([i, t]);
1416
1418
  this.disposeWithMe(
1417
1419
  e.pipe(
1418
- _e(([n, r]) => n ? n.activeSheet$.pipe(
1419
- Pn((s) => {
1420
+ we(([n, r]) => n ? n.activeSheet$.pipe(
1421
+ Un((s) => {
1420
1422
  if (!s) {
1421
1423
  this._drawingManagerService.setDrawingEditable(!1);
1422
1424
  return;
1423
1425
  }
1424
1426
  const o = n.getUnitId(), a = s.getSheetId();
1425
1427
  this._permissionService.composePermission([
1426
- new Kt(o).id,
1427
- new Zt(o, a).id
1428
+ new zt(o).id,
1429
+ new Kt(o, a).id
1428
1430
  ]).every((u) => u.value) ? this._drawingManagerService.setDrawingEditable(!0) : this._handleDrawingEditableFalse(n, s);
1429
1431
  })
1430
- ) : (this._drawingManagerService.setDrawingEditable(!1), me))
1432
+ ) : (this._drawingManagerService.setDrawingEditable(!1), fe))
1431
1433
  ).subscribe()
1432
1434
  );
1433
1435
  }
@@ -1437,29 +1439,29 @@ let Ot = class extends re {
1437
1439
  if (!a)
1438
1440
  return;
1439
1441
  a.getAllObjectsByOrder().forEach((u) => {
1440
- u.classType === Ae.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.detachTransformerFrom(u);
1442
+ u.classType === Pe.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.detachTransformerFrom(u);
1441
1443
  });
1442
1444
  }
1443
1445
  _initViewPermissionChange() {
1444
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(x.UNIVER_SHEET), t = this._userManagerService.currentUser$;
1446
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$;
1445
1447
  this.disposeWithMe(
1446
- vt([i, t]).pipe(
1447
- _e(([e, n]) => e ? e.activeSheet$.pipe(
1448
- _e((r) => {
1448
+ _t([i, t]).pipe(
1449
+ we(([e, n]) => e ? e.activeSheet$.pipe(
1450
+ we((r) => {
1449
1451
  if (!r)
1450
- return me;
1452
+ return fe;
1451
1453
  const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
1452
1454
  if (!d)
1453
- return me;
1455
+ return fe;
1454
1456
  const u = d.getTransformerByCreate();
1455
1457
  return this._permissionService.composePermission$([
1456
- new Wn(s).id,
1457
- new jn(s, o).id
1458
+ new kn(s).id,
1459
+ new Wn(s, o).id
1458
1460
  ]).pipe(
1459
- Me((l) => l.every((g) => g.value)),
1460
- An()
1461
+ be((l) => l.every((g) => g.value)),
1462
+ Pn()
1461
1463
  ).pipe(
1462
- Me((l) => ({
1464
+ be((l) => ({
1463
1465
  permission: l,
1464
1466
  scene: d,
1465
1467
  transformer: u,
@@ -1468,18 +1470,18 @@ let Ot = class extends re {
1468
1470
  }))
1469
1471
  );
1470
1472
  })
1471
- ) : me)
1473
+ ) : fe)
1472
1474
  ).subscribe({
1473
1475
  next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
1474
1476
  this._drawingManagerService.setDrawingVisible(e);
1475
1477
  const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
1476
1478
  e ? this._drawingManagerService.addNotification(u) : (a.forEach((c) => {
1477
- c.classType === Ae.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.removeObject(c);
1479
+ c.classType === Pe.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.removeObject(c);
1478
1480
  }), r.clearSelectedObjects());
1479
1481
  },
1480
1482
  complete: () => {
1481
1483
  this._drawingManagerService.setDrawingVisible(!0);
1482
- const e = this._univerInstanceService.getCurrentUnitForType(x.UNIVER_SHEET), n = e == null ? void 0 : e.getActiveSheet(), r = e == null ? void 0 : e.getUnitId(), s = n == null ? void 0 : n.getSheetId();
1484
+ const e = this._univerInstanceService.getCurrentUnitForType(F.UNIVER_SHEET), n = e == null ? void 0 : e.getActiveSheet(), r = e == null ? void 0 : e.getUnitId(), s = n == null ? void 0 : n.getSheetId();
1483
1485
  if (!r || !s)
1484
1486
  return;
1485
1487
  const o = this._drawingManagerService.getDrawingData(r, s), a = Object.values(o);
@@ -1489,25 +1491,25 @@ let Ot = class extends re {
1489
1491
  );
1490
1492
  }
1491
1493
  _initEditPermissionChange() {
1492
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(x.UNIVER_SHEET), t = this._userManagerService.currentUser$;
1494
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$;
1493
1495
  this.disposeWithMe(
1494
- vt([i, t]).pipe(
1495
- _e(([e, n]) => e ? e.activeSheet$.pipe(
1496
- _e((r) => {
1496
+ _t([i, t]).pipe(
1497
+ we(([e, n]) => e ? e.activeSheet$.pipe(
1498
+ we((r) => {
1497
1499
  if (!r)
1498
- return me;
1500
+ return fe;
1499
1501
  const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
1500
1502
  if (!d)
1501
- return me;
1503
+ return fe;
1502
1504
  const u = d.getTransformerByCreate();
1503
1505
  return this._permissionService.composePermission$([
1504
- new Kt(s).id,
1505
- new Zt(s, o).id
1506
+ new zt(s).id,
1507
+ new Kt(s, o).id
1506
1508
  ]).pipe(
1507
- Me((l) => l.every((g) => g.value)),
1508
- An()
1509
+ be((l) => l.every((g) => g.value)),
1510
+ Pn()
1509
1511
  ).pipe(
1510
- Me((l) => ({
1512
+ be((l) => ({
1511
1513
  permission: l,
1512
1514
  scene: d,
1513
1515
  transformer: u,
@@ -1516,19 +1518,19 @@ let Ot = class extends re {
1516
1518
  }))
1517
1519
  );
1518
1520
  })
1519
- ) : me)
1521
+ ) : fe)
1520
1522
  ).subscribe({
1521
1523
  next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
1522
1524
  this._drawingManagerService.setDrawingEditable(e);
1523
1525
  const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
1524
1526
  e ? (a.forEach((c) => {
1525
- c.classType === Ae.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.attachTransformerTo(c);
1527
+ c.classType === Pe.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.attachTransformerTo(c);
1526
1528
  }), this._drawingManagerService.addNotification(u)) : (a.forEach((c) => {
1527
- c.classType === Ae.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.detachTransformerFrom(c);
1529
+ c.classType === Pe.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.detachTransformerFrom(c);
1528
1530
  }), r.clearSelectedObjects());
1529
1531
  },
1530
1532
  complete: () => {
1531
- const e = this._univerInstanceService.getCurrentUnitForType(x.UNIVER_SHEET);
1533
+ const e = this._univerInstanceService.getCurrentUnitForType(F.UNIVER_SHEET);
1532
1534
  if (!e)
1533
1535
  return;
1534
1536
  const n = e.getUnitId(), r = e.getActiveSheet();
@@ -1539,27 +1541,27 @@ let Ot = class extends re {
1539
1541
  return;
1540
1542
  const d = this._drawingManagerService.getDrawingData(n, s), u = Object.values(d);
1541
1543
  this._drawingManagerService.setDrawingEditable(!0), a.getAllObjectsByOrder().forEach((l) => {
1542
- l.classType === Ae.IMAGE && u.some((g) => l.oKey.includes(g.drawingId)) && a.detachTransformerFrom(l);
1544
+ l.classType === Pe.IMAGE && u.some((g) => l.oKey.includes(g.drawingId)) && a.detachTransformerFrom(l);
1543
1545
  });
1544
1546
  }
1545
1547
  })
1546
1548
  );
1547
1549
  }
1548
1550
  };
1549
- Ot = As([
1550
- Ze(0, ie),
1551
- Ze(1, J),
1552
- Ze(2, Fr),
1553
- Ze(3, Se),
1554
- Ze(4, A(Lr))
1555
- ], Ot);
1556
- var Ns = Object.getOwnPropertyDescriptor, ks = (i, t, e, n) => {
1557
- for (var r = n > 1 ? void 0 : n ? Ns(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1551
+ Tt = bs([
1552
+ Ke(0, re),
1553
+ Ke(1, Z),
1554
+ Ke(2, Nr),
1555
+ Ke(3, Se),
1556
+ Ke(4, A(kr))
1557
+ ], Tt);
1558
+ var Ms = Object.getOwnPropertyDescriptor, ys = (i, t, e, n) => {
1559
+ for (var r = n > 1 ? void 0 : n ? Ms(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1558
1560
  (o = i[s]) && (r = o(r) || r);
1559
1561
  return r;
1560
- }, De = (i, t) => (e, n) => t(e, n, i);
1561
- function Dr(i, t, e, n, r, s = !1) {
1562
- const { scaleX: o, scaleY: a } = t.getAncestorScale(), d = t.getViewport(Xn.VIEW_MAIN), u = n.getFreeze(), { startColumn: c, startRow: l, xSplit: g, ySplit: h } = u, m = {
1562
+ }, Ce = (i, t) => (e, n) => t(e, n, i);
1563
+ function vr(i, t, e, n, r, s = !1) {
1564
+ const { scaleX: o, scaleY: a } = t.getAncestorScale(), d = t.getViewport(Gn.VIEW_MAIN), u = n.getFreeze(), { startColumn: c, startRow: l, xSplit: g, ySplit: h } = u, f = {
1563
1565
  left: !0,
1564
1566
  // left means the left of pic is in a viewMainLeft
1565
1567
  top: !0
@@ -1567,45 +1569,45 @@ function Dr(i, t, e, n, r, s = !1) {
1567
1569
  if (!d)
1568
1570
  return {
1569
1571
  ...i,
1570
- absolute: m
1572
+ absolute: f
1571
1573
  };
1572
- const { left: p, right: f, top: _, bottom: S } = i;
1573
- let { top: I, left: b, viewportScrollX: v, viewportScrollY: D } = d;
1574
- const { boundsOfViewArea: w, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth: C, columnHeaderHeight: E } = e, T = {
1574
+ const { left: p, right: m, top: _, bottom: v } = i;
1575
+ let { top: I, left: R, viewportScrollX: S, viewportScrollY: C } = d;
1576
+ const { boundsOfViewArea: w, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth: D, columnHeaderHeight: E } = e, T = {
1575
1577
  top: s ? 0 : E,
1576
- left: s ? 0 : C
1578
+ left: s ? 0 : D
1577
1579
  };
1578
- w && (Re.isDefine(T.top) && (T.top = w.top), Re.isDefine(T.left) && (T.left = w.left)), y === "HORIZONTAL" && (D = 0), y === "VERTICAL" && (v = 0);
1579
- let M = 0, R = 0;
1580
- const N = e.rowStartY(l - h) + E, F = e.colStartX(c - g) + C, q = e.rowStartY(l) + E, H = e.colStartX(c) + C;
1580
+ w && (Re.isDefine(T.top) && (T.top = w.top), Re.isDefine(T.left) && (T.left = w.left)), y === "HORIZONTAL" && (C = 0), y === "VERTICAL" && (S = 0);
1581
+ let M = 0, b = 0;
1582
+ const N = e.rowStartY(l - h) + E, x = e.colStartX(c - g) + D, q = e.rowStartY(l) + E, H = e.colStartX(c) + D;
1581
1583
  if (g === 0)
1582
- m.left = !1, M = (p - v) * o, R = (f - v) * o;
1584
+ f.left = !1, M = (p - S) * o, b = (m - S) * o;
1583
1585
  else {
1584
- const k = p - (F - C), ce = f - (F - C);
1585
- f < H ? (M = k * o, R = ce * o) : p <= H && f >= H ? (M = k * o, R = Math.max(b, (f - v) * o)) : p > H && (m.left = !1, M = Math.max((p - v) * o, b), R = Math.max((f - v) * o, b));
1586
+ const k = p - (x - D), ae = m - (x - D);
1587
+ m < H ? (M = k * o, b = ae * o) : p <= H && m >= H ? (M = k * o, b = Math.max(R, (m - S) * o)) : p > H && (f.left = !1, M = Math.max((p - S) * o, R), b = Math.max((m - S) * o, R));
1586
1588
  }
1587
- let X = 0, Y = 0;
1589
+ let L = 0, X = 0;
1588
1590
  if (h === 0)
1589
- m.top = !1, X = (_ - D) * a, Y = (S - D) * a;
1591
+ f.top = !1, L = (_ - C) * a, X = (v - C) * a;
1590
1592
  else {
1591
- const k = _ - (N - E), ce = S - (N - E);
1592
- S < q ? (X = k * a, Y = ce * a) : _ <= q && S >= q ? (X = k * a, Y = Math.max(I, (S - D) * a)) : _ > q && (m.top = !1, X = Math.max((_ - D) * a, I), Y = Math.max((S - D) * a, I));
1593
+ const k = _ - (N - E), ae = v - (N - E);
1594
+ v < q ? (L = k * a, X = ae * a) : _ <= q && v >= q ? (L = k * a, X = Math.max(I, (v - C) * a)) : _ > q && (f.top = !1, L = Math.max((_ - C) * a, I), X = Math.max((v - C) * a, I));
1593
1595
  }
1594
- return M = Math.max(M, T.left), X = Math.max(X, T.top), R = Math.max(R, T.left), Y = Math.max(Y, T.top), {
1596
+ return M = Math.max(M, T.left), L = Math.max(L, T.top), b = Math.max(b, T.left), X = Math.max(X, T.top), {
1595
1597
  left: M,
1596
- right: R,
1597
- top: X,
1598
- bottom: Y,
1599
- absolute: m
1598
+ right: b,
1599
+ top: L,
1600
+ bottom: X,
1601
+ absolute: f
1600
1602
  };
1601
1603
  }
1602
- const fe = (i, t, e, n, r) => {
1604
+ const ge = (i, t, e, n, r) => {
1603
1605
  const { left: s, top: o, width: a, height: d, angle: u } = i, c = {
1604
1606
  left: s,
1605
1607
  right: s + a,
1606
1608
  top: o,
1607
1609
  bottom: o + d
1608
- }, l = Dr(c, t, e, n, r), { scaleX: g, scaleY: h } = t.getAncestorScale();
1610
+ }, l = vr(c, t, e, n, r), { scaleX: g, scaleY: h } = t.getAncestorScale();
1609
1611
  return {
1610
1612
  startX: l.left,
1611
1613
  endX: l.right,
@@ -1617,23 +1619,23 @@ const fe = (i, t, e, n, r) => {
1617
1619
  absolute: l.absolute
1618
1620
  };
1619
1621
  };
1620
- let tt = class extends re {
1622
+ let et = class extends ne {
1621
1623
  constructor(t, e, n, r, s, o, a) {
1622
1624
  super();
1623
1625
  /**
1624
1626
  * for update dom container position when scrolling and zoom
1625
1627
  */
1626
1628
  ee(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
1627
- ee(this, "_transformChange$", new Xt());
1629
+ ee(this, "_transformChange$", new Gt());
1628
1630
  ee(this, "transformChange$", this._transformChange$.asObservable());
1629
- ee(this, "_add$", new Xt());
1631
+ ee(this, "_add$", new Gt());
1630
1632
  ee(this, "add$", this._add$.asObservable());
1631
- ee(this, "_remove$", new Xt());
1633
+ ee(this, "_remove$", new Gt());
1632
1634
  ee(this, "remove$", this._remove$.asObservable());
1633
1635
  this._renderManagerService = t, this._univerInstanceService = e, this._commandService = n, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = a, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
1634
1636
  }
1635
1637
  _bindScrollEvent() {
1636
- this._lifecycleService.lifecycle$.pipe(Yi((t) => t === Gr.Rendered), Gi(1)).subscribe(() => {
1638
+ this._lifecycleService.lifecycle$.pipe(Wi((t) => t === Br.Rendered), Bi(1)).subscribe(() => {
1637
1639
  this._scrollUpdateListener();
1638
1640
  });
1639
1641
  }
@@ -1659,7 +1661,7 @@ let tt = class extends re {
1659
1661
  this._drawingManagerService.add$.subscribe((t) => {
1660
1662
  t.forEach((e) => {
1661
1663
  var K;
1662
- const { unitId: n, subUnitId: r, drawingId: s } = e, o = oe(this._univerInstanceService, { unitId: n, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), d = this._univerInstanceService.getUnit(n, x.UNIVER_SHEET);
1664
+ const { unitId: n, subUnitId: r, drawingId: s } = e, o = se(this._univerInstanceService, { unitId: n, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), d = this._univerInstanceService.getUnit(n, F.UNIVER_SHEET);
1663
1665
  if (!d)
1664
1666
  return;
1665
1667
  const u = d.getActiveSheet().getSheetId();
@@ -1669,36 +1671,36 @@ let tt = class extends re {
1669
1671
  if (!c)
1670
1672
  return;
1671
1673
  const { transform: l, drawingType: g, data: h } = a;
1672
- if (g !== j.DRAWING_DOM && g !== j.DRAWING_CHART)
1674
+ if (g !== B.DRAWING_DOM && g !== B.DRAWING_CHART)
1673
1675
  return;
1674
- const m = this._getSceneAndTransformerByDrawingSearch(n);
1675
- if (m == null)
1676
+ const f = this._getSceneAndTransformerByDrawingSearch(n);
1677
+ if (f == null)
1676
1678
  return;
1677
- const { scene: p, canvas: f } = m;
1679
+ const { scene: p, canvas: m } = f;
1678
1680
  if (l == null)
1679
1681
  return !0;
1680
1682
  if (u !== r)
1681
1683
  return;
1682
- const { left: _, top: S, width: I, height: b, angle: v, flipX: D, flipY: w, skewX: y, skewY: C } = l, E = Ie({ unitId: n, subUnitId: r, drawingId: s }), T = p.getObject(E);
1684
+ const { left: _, top: v, width: I, height: R, angle: S, flipX: C, flipY: w, skewX: y, skewY: D } = l, E = ve({ unitId: n, subUnitId: r, drawingId: s }), T = p.getObject(E);
1683
1685
  if (T != null) {
1684
- T.transformByState({ left: _, top: S, width: I, height: b, angle: v, flipX: D, flipY: w, skewX: y, skewY: C });
1686
+ T.transformByState({ left: _, top: v, width: I, height: R, angle: S, flipX: C, flipY: w, skewX: y, skewY: D });
1685
1687
  return;
1686
1688
  }
1687
1689
  const M = {
1688
1690
  left: _,
1689
- top: S,
1691
+ top: v,
1690
1692
  width: I,
1691
- height: b,
1693
+ height: R,
1692
1694
  zIndex: this._drawingManagerService.getDrawingOrder(n, r).length - 1
1693
- }, R = g === j.DRAWING_CHART;
1694
- if (M.rotateEnabled = !1, R) {
1695
+ }, b = g === B.DRAWING_CHART;
1696
+ if (M.rotateEnabled = !1, b) {
1695
1697
  const k = h ? h.backgroundColor : "white";
1696
1698
  M.fill = k, h && h.border && (M.stroke = h.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8;
1697
1699
  }
1698
- const N = new Ne(E, M);
1699
- R && N.setObjectType(yn.CHART), p.addObject(N, Yt), a.allowTransform !== !1 && p.attachTransformerTo(N);
1700
- const F = new wt(), q = fe(N, m.renderUnit.scene, c.skeleton, o.worksheet), H = new je(q), X = {
1701
- dispose: F,
1700
+ const N = new Ae(E, M);
1701
+ b && N.setObjectType(Mn.CHART), p.addObject(N, Yt), a.allowTransform !== !1 && p.attachTransformerTo(N);
1702
+ const x = new pt(), q = ge(N, f.renderUnit.scene, c.skeleton, o.worksheet), H = new We(q), L = {
1703
+ dispose: x,
1702
1704
  rect: N,
1703
1705
  position$: H,
1704
1706
  unitId: n,
@@ -1710,36 +1712,36 @@ let tt = class extends re {
1710
1712
  id: s,
1711
1713
  componentKey: a.componentKey,
1712
1714
  onPointerDown: (k) => {
1713
- f.dispatchEvent(new PointerEvent(k.type, k));
1715
+ m.dispatchEvent(new PointerEvent(k.type, k));
1714
1716
  },
1715
1717
  onPointerMove: (k) => {
1716
- f.dispatchEvent(new PointerEvent(k.type, k));
1718
+ m.dispatchEvent(new PointerEvent(k.type, k));
1717
1719
  },
1718
1720
  onPointerUp: (k) => {
1719
- f.dispatchEvent(new PointerEvent(k.type, k));
1721
+ m.dispatchEvent(new PointerEvent(k.type, k));
1720
1722
  },
1721
1723
  onWheel: (k) => {
1722
- f.dispatchEvent(new WheelEvent(k.type, k));
1724
+ m.dispatchEvent(new WheelEvent(k.type, k));
1723
1725
  },
1724
1726
  data: h,
1725
1727
  unitId: n
1726
1728
  });
1727
- const Y = N.onTransformChange$.subscribeEvent(() => {
1728
- const k = fe(N, m.renderUnit.scene, c.skeleton, o.worksheet);
1729
+ const X = N.onTransformChange$.subscribeEvent(() => {
1730
+ const k = ge(N, f.renderUnit.scene, c.skeleton, o.worksheet);
1729
1731
  H.next(
1730
1732
  k
1731
1733
  );
1732
1734
  });
1733
- F.add(() => {
1735
+ x.add(() => {
1734
1736
  this._canvasFloatDomService.removeFloatDom(s);
1735
- }), Y && F.add(Y), this._domLayerInfoMap.set(s, X);
1737
+ }), X && x.add(X), this._domLayerInfoMap.set(s, L);
1736
1738
  });
1737
1739
  })
1738
1740
  ), this.disposeWithMe(
1739
1741
  this._drawingManagerService.remove$.subscribe((t) => {
1740
1742
  t.forEach((e) => {
1741
1743
  var l;
1742
- const { unitId: n, subUnitId: r, drawingId: s } = e, o = Ie({ unitId: n, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(n);
1744
+ const { unitId: n, subUnitId: r, drawingId: s } = e, o = ve({ unitId: n, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(n);
1743
1745
  if (a == null)
1744
1746
  return;
1745
1747
  const { transformer: d, scene: u } = a, c = u.getObject(o);
@@ -1751,25 +1753,25 @@ let tt = class extends re {
1751
1753
  _scrollUpdateListener() {
1752
1754
  const t = (e, n) => {
1753
1755
  var d;
1754
- const r = this._getSceneAndTransformerByDrawingSearch(e), s = Array.from(this._domLayerInfoMap.keys()).map((u) => ({ id: u, ...this._domLayerInfoMap.get(u) })).filter((u) => u.subUnitId === n && u.unitId === e).map((u) => u.id), o = oe(this._univerInstanceService, { unitId: e, subUnitId: n }), a = (d = this._renderManagerService.getRenderById(e)) == null ? void 0 : d.with(V).getSkeletonParam(n);
1756
+ const r = this._getSceneAndTransformerByDrawingSearch(e), s = Array.from(this._domLayerInfoMap.keys()).map((u) => ({ id: u, ...this._domLayerInfoMap.get(u) })).filter((u) => u.subUnitId === n && u.unitId === e).map((u) => u.id), o = se(this._univerInstanceService, { unitId: e, subUnitId: n }), a = (d = this._renderManagerService.getRenderById(e)) == null ? void 0 : d.with(V).getSkeletonParam(n);
1755
1757
  !r || !o || !a || s.forEach((u) => {
1756
1758
  const c = this._domLayerInfoMap.get(u);
1757
1759
  if (c) {
1758
- const l = fe(c.rect, r.renderUnit.scene, a.skeleton, o.worksheet, c);
1760
+ const l = ge(c.rect, r.renderUnit.scene, a.skeleton, o.worksheet, c);
1759
1761
  c.position$.next(l);
1760
1762
  }
1761
1763
  });
1762
1764
  };
1763
1765
  this.disposeWithMe(
1764
- this._univerInstanceService.getCurrentTypeOfUnit$(x.UNIVER_SHEET).pipe(
1765
- _e((e) => e ? e.activeSheet$ : Nn(null)),
1766
- Me((e) => {
1766
+ this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(
1767
+ we((e) => e ? e.activeSheet$ : An(null)),
1768
+ be((e) => {
1767
1769
  if (!e) return null;
1768
1770
  const n = e.getUnitId(), r = this._renderManagerService.getRenderById(n);
1769
1771
  return r ? { render: r, unitId: n, subUnitId: e.getSheetId() } : null;
1770
1772
  }),
1771
- _e(
1772
- (e) => e ? Xr(e.render.scene.getViewport(Xn.VIEW_MAIN).onScrollAfter$).pipe(Me(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : Nn(null)
1773
+ we(
1774
+ (e) => e ? jr(e.render.scene.getViewport(Gn.VIEW_MAIN).onScrollAfter$).pipe(be(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : An(null)
1773
1775
  )
1774
1776
  ).subscribe((e) => {
1775
1777
  if (!e) return;
@@ -1777,12 +1779,12 @@ let tt = class extends re {
1777
1779
  t(n, r);
1778
1780
  })
1779
1781
  ), this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
1780
- if (e.id === On.id) {
1782
+ if (e.id === Tn.id) {
1781
1783
  const n = e.params, { unitId: r } = n;
1782
1784
  Array.from(this._domLayerInfoMap.values()).filter((o) => o.unitId === r).map((o) => o.subUnitId).forEach((o) => {
1783
1785
  t(r, o);
1784
1786
  });
1785
- } else if (e.id === Hi.id) {
1787
+ } else if (e.id === Fi.id) {
1786
1788
  const { unitId: n, subUnitId: r } = e.params;
1787
1789
  t(n, r);
1788
1790
  }
@@ -1790,7 +1792,7 @@ let tt = class extends re {
1790
1792
  }
1791
1793
  _getPosition(t, e) {
1792
1794
  var g;
1793
- const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(Ge);
1795
+ const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(Xe);
1794
1796
  if (a == null)
1795
1797
  return;
1796
1798
  const d = a.getCellWithCoordByOffset(n, s);
@@ -1820,7 +1822,7 @@ let tt = class extends re {
1820
1822
  this._drawingManagerService.update$.subscribe((t) => {
1821
1823
  t.forEach((e) => {
1822
1824
  const n = this._drawingManagerService.getDrawingByParam(e);
1823
- if (!n || n.drawingType !== j.DRAWING_DOM && n.drawingType !== j.DRAWING_CHART)
1825
+ if (!n || n.drawingType !== B.DRAWING_DOM && n.drawingType !== B.DRAWING_CHART)
1824
1826
  return;
1825
1827
  const r = {
1826
1828
  ...n.transform
@@ -1842,26 +1844,26 @@ let tt = class extends re {
1842
1844
  updateFloatDomProps(t, e, n, r) {
1843
1845
  const s = this._domLayerInfoMap.get(n), o = this._getSceneAndTransformerByDrawingSearch(t);
1844
1846
  if (s && o) {
1845
- const { scene: a } = o, d = Ie({ unitId: t, subUnitId: e, drawingId: n }), u = a.getObject(d);
1846
- u && u instanceof Ne && u.setProps(r);
1847
+ const { scene: a } = o, d = ve({ unitId: t, subUnitId: e, drawingId: n }), u = a.getObject(d);
1848
+ u && u instanceof Ae && u.setProps(r);
1847
1849
  }
1848
1850
  }
1849
1851
  // CreateFloatDomCommand --> floatDomService.addFloatDomToPosition
1850
1852
  addFloatDomToPosition(t, e) {
1851
- const n = oe(this._univerInstanceService, {
1853
+ const n = se(this._univerInstanceService, {
1852
1854
  unitId: t.unitId,
1853
1855
  subUnitId: t.subUnitId
1854
1856
  });
1855
1857
  if (!n)
1856
1858
  throw new Error("cannot find current target!");
1857
- const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: d, allowTransform: u = !0 } = t, c = e != null ? e : bt(), l = this._getPosition(o, r);
1859
+ const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: d, allowTransform: u = !0 } = t, c = e != null ? e : Dt(), l = this._getPosition(o, r);
1858
1860
  if (l == null)
1859
1861
  return;
1860
1862
  const g = {
1861
1863
  unitId: r,
1862
1864
  subUnitId: s,
1863
1865
  drawingId: c,
1864
- drawingType: t.type || j.DRAWING_DOM,
1866
+ drawingType: t.type || B.DRAWING_DOM,
1865
1867
  componentKey: a,
1866
1868
  sheetTransform: l,
1867
1869
  transform: {
@@ -1873,7 +1875,7 @@ let tt = class extends re {
1873
1875
  data: d,
1874
1876
  allowTransform: u
1875
1877
  };
1876
- return this._commandService.executeCommand(Wt.id, {
1878
+ return this._commandService.executeCommand(kt.id, {
1877
1879
  unitId: r,
1878
1880
  drawings: [g]
1879
1881
  }), this._add$.next({ unitId: r, subUnitId: s, id: c }), {
@@ -1900,8 +1902,8 @@ let tt = class extends re {
1900
1902
  }
1901
1903
  // eslint-disable-next-line max-lines-per-function, complexity
1902
1904
  addFloatDomToRange(t, e, n, r) {
1903
- var D, w, y;
1904
- const s = oe(this._univerInstanceService, {
1905
+ var C, w, y;
1906
+ const s = se(this._univerInstanceService, {
1905
1907
  unitId: e.unitId,
1906
1908
  subUnitId: e.subUnitId
1907
1909
  });
@@ -1911,85 +1913,85 @@ let tt = class extends re {
1911
1913
  if (!d) return;
1912
1914
  const u = this._renderManagerService.getRenderById(o);
1913
1915
  if (!u) return;
1914
- const c = (D = this._renderManagerService.getRenderById(o)) == null ? void 0 : D.with(V).getWorksheetSkeleton(a);
1916
+ const c = (C = this._renderManagerService.getRenderById(o)) == null ? void 0 : C.with(V).getWorksheetSkeleton(a);
1915
1917
  if (!c) return;
1916
- const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : bt(), { position: p, position$: f } = this._createRangePositionObserver(t, u, c.skeleton);
1918
+ const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Dt(), { position: p, position$: m } = this._createRangePositionObserver(t, u, c.skeleton);
1917
1919
  if (this._getPosition(p, o) == null)
1918
1920
  return;
1919
- const S = d.scene, { scaleX: I } = S.getAncestorScale(), b = Ct(p, n, I), v = {
1921
+ const v = d.scene, { scaleX: I } = v.getAncestorScale(), R = It(p, n, I), S = {
1920
1922
  unitId: o,
1921
1923
  subUnitId: a,
1922
- drawingId: m,
1923
- drawingType: e.type || j.DRAWING_DOM,
1924
+ drawingId: f,
1925
+ drawingType: e.type || B.DRAWING_DOM,
1924
1926
  componentKey: l,
1925
1927
  transform: {
1926
- left: b.startX,
1927
- top: b.startY,
1928
- width: b.width,
1929
- height: b.height
1928
+ left: R.startX,
1929
+ top: R.startY,
1930
+ width: R.width,
1931
+ height: R.height
1930
1932
  },
1931
1933
  data: g,
1932
1934
  allowTransform: h
1933
1935
  };
1934
1936
  {
1935
- const { unitId: C, subUnitId: E, drawingId: T } = v, M = oe(this._univerInstanceService, { unitId: C, subUnitId: E }), R = v, N = this._univerInstanceService.getUnit(C, x.UNIVER_SHEET);
1937
+ const { unitId: D, subUnitId: E, drawingId: T } = S, M = se(this._univerInstanceService, { unitId: D, subUnitId: E }), b = S, N = this._univerInstanceService.getUnit(D, F.UNIVER_SHEET);
1936
1938
  if (!N)
1937
1939
  return;
1938
- const F = N.getActiveSheet().getSheetId();
1939
- if (!R || !M)
1940
+ const x = N.getActiveSheet().getSheetId();
1941
+ if (!b || !M)
1940
1942
  return;
1941
- const q = (w = this._renderManagerService.getRenderById(C)) == null ? void 0 : w.with(V);
1943
+ const q = (w = this._renderManagerService.getRenderById(D)) == null ? void 0 : w.with(V);
1942
1944
  if (!q)
1943
1945
  return;
1944
1946
  const H = q.getWorksheetSkeleton(E);
1945
1947
  if (!H)
1946
1948
  return;
1947
- const { transform: X, drawingType: Y, data: K } = R;
1948
- if (Y !== j.DRAWING_DOM && Y !== j.DRAWING_CHART)
1949
+ const { transform: L, drawingType: X, data: K } = b;
1950
+ if (X !== B.DRAWING_DOM && X !== B.DRAWING_CHART)
1949
1951
  return;
1950
- const k = this._getSceneAndTransformerByDrawingSearch(C);
1952
+ const k = this._getSceneAndTransformerByDrawingSearch(D);
1951
1953
  if (k == null)
1952
1954
  return;
1953
- const { scene: ce, canvas: ye } = k;
1954
- if (X == null || F !== E)
1955
+ const { scene: ae, canvas: Me } = k;
1956
+ if (L == null || x !== E)
1955
1957
  return;
1956
- const { left: ot, top: at, width: ct, height: dt, angle: $t, flipX: xt, flipY: lt, skewX: ut, skewY: Ee } = X, ht = Ie({ unitId: C, subUnitId: E, drawingId: T }), le = ce.getObject(ht);
1957
- if (le != null) {
1958
- le.transformByState({ left: ot, top: at, width: ct, height: dt, angle: $t, flipX: xt, flipY: lt, skewX: ut, skewY: Ee });
1958
+ const { left: st, top: ot, width: at, height: ct, angle: jt, flipX: $t, flipY: dt, skewX: lt, skewY: ye } = L, ut = ve({ unitId: D, subUnitId: E, drawingId: T }), de = ae.getObject(ut);
1959
+ if (de != null) {
1960
+ de.transformByState({ left: st, top: ot, width: at, height: ct, angle: jt, flipX: $t, flipY: dt, skewX: lt, skewY: ye });
1959
1961
  return;
1960
1962
  }
1961
1963
  const Q = {
1962
- left: ot,
1964
+ left: st,
1963
1965
  // from floatDomParam.transform
1964
- top: at,
1965
- width: ct,
1966
- height: dt,
1967
- zIndex: this._drawingManagerService.getDrawingOrder(C, E).length - 1
1968
- }, Te = Y === j.DRAWING_CHART;
1969
- if (Te) {
1966
+ top: ot,
1967
+ width: at,
1968
+ height: ct,
1969
+ zIndex: this._drawingManagerService.getDrawingOrder(D, E).length - 1
1970
+ }, Ee = X === B.DRAWING_CHART;
1971
+ if (Ee) {
1970
1972
  const W = K ? K.backgroundColor : "white";
1971
1973
  Q.fill = W, Q.rotateEnabled = !1, K && K.border && (Q.stroke = K.border), Q.paintFirst = "stroke", Q.strokeWidth = 1, Q.borderEnabled = !1, Q.radius = 8;
1972
1974
  }
1973
- const ue = new Ne(ht, Q);
1974
- Te && ue.setObjectType(yn.CHART), ce.addObject(ue, Yt), R.allowTransform !== !1 && ce.attachTransformerTo(ue);
1975
- const he = new wt(), gt = ce.getMainViewport(), { rowHeaderWidth: Oe, columnHeaderHeight: Xe } = H.skeleton, ft = {
1976
- top: Xe,
1977
- left: Oe,
1978
- bottom: gt.bottom,
1979
- right: gt.right
1980
- }, ge = {
1981
- dispose: he,
1982
- rect: ue,
1983
- boundsOfViewArea: ft,
1975
+ const le = new Ae(ut, Q);
1976
+ Ee && le.setObjectType(Mn.CHART), ae.addObject(le, Yt), b.allowTransform !== !1 && ae.attachTransformerTo(le);
1977
+ const ue = new pt(), ht = ae.getMainViewport(), { rowHeaderWidth: Te, columnHeaderHeight: Ge } = H.skeleton, gt = {
1978
+ top: Ge,
1979
+ left: Te,
1980
+ bottom: ht.bottom,
1981
+ right: ht.right
1982
+ }, he = {
1983
+ dispose: ue,
1984
+ rect: le,
1985
+ boundsOfViewArea: gt,
1984
1986
  domAnchor: n,
1985
- unitId: C,
1987
+ unitId: D,
1986
1988
  subUnitId: E
1987
- }, B = fe(ue, k.renderUnit.scene, H.skeleton, M.worksheet, ge), Ue = new je(B);
1988
- ge.position$ = Ue;
1989
- let Ve = {
1990
- position$: Ue,
1989
+ }, j = ge(le, k.renderUnit.scene, H.skeleton, M.worksheet, he), Oe = new We(j);
1990
+ he.position$ = Oe;
1991
+ let Le = {
1992
+ position$: Oe,
1991
1993
  id: T,
1992
- componentKey: R.componentKey,
1994
+ componentKey: b.componentKey,
1993
1995
  onPointerDown: () => {
1994
1996
  },
1995
1997
  onPointerMove: () => {
@@ -1997,69 +1999,69 @@ let tt = class extends re {
1997
1999
  onPointerUp: () => {
1998
2000
  },
1999
2001
  onWheel: (W) => {
2000
- ye.dispatchEvent(new WheelEvent(W.type, W));
2002
+ Me.dispatchEvent(new WheelEvent(W.type, W));
2001
2003
  },
2002
2004
  data: K,
2003
- unitId: C
2005
+ unitId: D
2004
2006
  };
2005
- e.eventPassThrough && (Ve = {
2006
- ...Ve,
2007
+ e.eventPassThrough && (Le = {
2008
+ ...Le,
2007
2009
  onPointerDown: (W) => {
2008
- ye.dispatchEvent(new PointerEvent(W.type, W));
2010
+ Me.dispatchEvent(new PointerEvent(W.type, W));
2009
2011
  },
2010
2012
  onPointerMove: (W) => {
2011
- ye.dispatchEvent(new PointerEvent(W.type, W));
2013
+ Me.dispatchEvent(new PointerEvent(W.type, W));
2012
2014
  },
2013
2015
  onPointerUp: (W) => {
2014
- ye.dispatchEvent(new PointerEvent(W.type, W));
2016
+ Me.dispatchEvent(new PointerEvent(W.type, W));
2015
2017
  }
2016
- }), this._canvasFloatDomService.addFloatDom(Ve), this.disposeWithMe(f.subscribe((W) => {
2017
- var hn, gn, fn, mn;
2018
- const un = Ct({
2018
+ }), this._canvasFloatDomService.addFloatDom(Le), this.disposeWithMe(m.subscribe((W) => {
2019
+ var un, hn, gn, fn;
2020
+ const ln = It({
2019
2021
  startX: W.startX,
2020
2022
  startY: W.startY,
2021
2023
  endX: W.endX,
2022
2024
  endY: W.endY,
2023
- width: (hn = n.width) != null ? hn : W.width,
2024
- height: (gn = n.height) != null ? gn : W.height,
2025
+ width: (un = n.width) != null ? un : W.width,
2026
+ height: (hn = n.height) != null ? hn : W.height,
2025
2027
  absolute: {
2026
2028
  left: p.absolute.left,
2027
2029
  top: p.absolute.top
2028
2030
  }
2029
- }, n), Ur = Ie({ unitId: C, subUnitId: E, drawingId: T }), Pr = new Ne(Ur, {
2030
- left: un.startX,
2031
- top: un.startY,
2032
- width: (fn = n.width) != null ? fn : W.width,
2033
- height: (mn = n.height) != null ? mn : W.height,
2034
- zIndex: this._drawingManagerService.getDrawingOrder(C, E).length - 1
2035
- }), Ar = fe(Pr, k.renderUnit.scene, H.skeleton, M.worksheet, ge);
2036
- Ue.next(Ar);
2031
+ }, n), Rr = ve({ unitId: D, subUnitId: E, drawingId: T }), br = new Ae(Rr, {
2032
+ left: ln.startX,
2033
+ top: ln.startY,
2034
+ width: (gn = n.width) != null ? gn : W.width,
2035
+ height: (fn = n.height) != null ? fn : W.height,
2036
+ zIndex: this._drawingManagerService.getDrawingOrder(D, E).length - 1
2037
+ }), Mr = ge(br, k.renderUnit.scene, H.skeleton, M.worksheet, he);
2038
+ Oe.next(Mr);
2037
2039
  }));
2038
- const He = (y = this._renderManagerService.getRenderById(C)) == null ? void 0 : y.with(V);
2039
- He == null || He.currentSkeleton$.subscribe((W) => {
2040
- W && H.sheetId !== W.sheetId && this._removeDom(m, !0);
2040
+ const Ve = (y = this._renderManagerService.getRenderById(D)) == null ? void 0 : y.with(V);
2041
+ Ve == null || Ve.currentSkeleton$.subscribe((W) => {
2042
+ W && H.sheetId !== W.sheetId && this._removeDom(f, !0);
2041
2043
  });
2042
- const mt = ue.onTransformChange$.subscribeEvent(() => {
2043
- const W = fe(ue, k.renderUnit.scene, H.skeleton, M.worksheet, ge);
2044
- Ue.next(
2044
+ const ft = le.onTransformChange$.subscribeEvent(() => {
2045
+ const W = ge(le, k.renderUnit.scene, H.skeleton, M.worksheet, he);
2046
+ Oe.next(
2045
2047
  W
2046
2048
  );
2047
2049
  });
2048
- he.add(() => {
2050
+ ue.add(() => {
2049
2051
  this._canvasFloatDomService.removeFloatDom(T);
2050
- }), mt && he.add(mt), this._domLayerInfoMap.set(T, ge);
2052
+ }), ft && ue.add(ft), this._domLayerInfoMap.set(T, he);
2051
2053
  }
2052
2054
  return {
2053
- id: m,
2055
+ id: f,
2054
2056
  dispose: () => {
2055
- this._removeDom(m, !0);
2057
+ this._removeDom(f, !0);
2056
2058
  }
2057
2059
  };
2058
2060
  }
2059
2061
  // eslint-disable-next-line max-lines-per-function, complexity
2060
2062
  addFloatDomToColumnHeader(t, e, n, r) {
2061
- var b, v, D;
2062
- const s = oe(this._univerInstanceService, {
2063
+ var R, S, C;
2064
+ const s = se(this._univerInstanceService, {
2063
2065
  unitId: e.unitId,
2064
2066
  subUnitId: e.subUnitId
2065
2067
  });
@@ -2069,9 +2071,9 @@ let tt = class extends re {
2069
2071
  if (!this._getSceneAndTransformerByDrawingSearch(o)) return;
2070
2072
  const u = this._renderManagerService.getRenderById(o);
2071
2073
  if (!u) return;
2072
- const c = (b = this._renderManagerService.getRenderById(o)) == null ? void 0 : b.with(V).getWorksheetSkeleton(a);
2074
+ const c = (R = this._renderManagerService.getRenderById(o)) == null ? void 0 : R.with(V).getWorksheetSkeleton(a);
2073
2075
  if (!c) return;
2074
- const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : bt(), { position: p, position$: f } = this._createRangePositionObserver({
2076
+ const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Dt(), { position: p, position$: m } = this._createRangePositionObserver({
2075
2077
  startRow: 0,
2076
2078
  endRow: 0,
2077
2079
  startColumn: t,
@@ -2082,8 +2084,8 @@ let tt = class extends re {
2082
2084
  const I = {
2083
2085
  unitId: o,
2084
2086
  subUnitId: a,
2085
- drawingId: m,
2086
- drawingType: e.type || j.DRAWING_DOM,
2087
+ drawingId: f,
2088
+ drawingType: e.type || B.DRAWING_DOM,
2087
2089
  componentKey: l,
2088
2090
  transform: {
2089
2091
  left: _.startX,
@@ -2095,30 +2097,30 @@ let tt = class extends re {
2095
2097
  allowTransform: h
2096
2098
  };
2097
2099
  {
2098
- const { unitId: w, subUnitId: y, drawingId: C } = I, E = oe(this._univerInstanceService, { unitId: w, subUnitId: y }), T = I, M = this._univerInstanceService.getUnit(w, x.UNIVER_SHEET);
2100
+ const { unitId: w, subUnitId: y, drawingId: D } = I, E = se(this._univerInstanceService, { unitId: w, subUnitId: y }), T = I, M = this._univerInstanceService.getUnit(w, F.UNIVER_SHEET);
2099
2101
  if (!M)
2100
2102
  return;
2101
- const R = M.getActiveSheet().getSheetId();
2103
+ const b = M.getActiveSheet().getSheetId();
2102
2104
  if (!T || !E)
2103
2105
  return;
2104
- const N = (v = this._renderManagerService.getRenderById(w)) == null ? void 0 : v.with(V);
2106
+ const N = (S = this._renderManagerService.getRenderById(w)) == null ? void 0 : S.with(V);
2105
2107
  if (!N)
2106
2108
  return;
2107
- const F = N.getWorksheetSkeleton(y);
2108
- if (!F)
2109
+ const x = N.getWorksheetSkeleton(y);
2110
+ if (!x)
2109
2111
  return;
2110
- const { transform: q, data: H } = T, X = this._getSceneAndTransformerByDrawingSearch(w);
2111
- if (X == null)
2112
+ const { transform: q, data: H } = T, L = this._getSceneAndTransformerByDrawingSearch(w);
2113
+ if (L == null)
2112
2114
  return;
2113
- const { scene: Y, canvas: K } = X;
2114
- if (q == null || R !== y)
2115
+ const { scene: X, canvas: K } = L;
2116
+ if (q == null || b !== y)
2115
2117
  return;
2116
- const { left: k, top: ce, width: ye, height: ot, angle: at, flipX: ct, flipY: dt, skewX: $t, skewY: xt } = q, lt = Ie({ unitId: w, subUnitId: y, drawingId: C }), ut = Y.getObject(lt);
2117
- if (ut != null) {
2118
- ut.transformByState({ left: k, top: ce, width: ye, height: ot, angle: at, flipX: ct, flipY: dt, skewX: $t, skewY: xt });
2118
+ const { left: k, top: ae, width: Me, height: st, angle: ot, flipX: at, flipY: ct, skewX: jt, skewY: $t } = q, dt = ve({ unitId: w, subUnitId: y, drawingId: D }), lt = X.getObject(dt);
2119
+ if (lt != null) {
2120
+ lt.transformByState({ left: k, top: ae, width: Me, height: st, angle: ot, flipX: at, flipY: ct, skewX: jt, skewY: $t });
2119
2121
  return;
2120
2122
  }
2121
- const Ee = Ct({
2123
+ const ye = It({
2122
2124
  startX: _.startX,
2123
2125
  startY: 0,
2124
2126
  endX: p.endX,
@@ -2129,35 +2131,35 @@ let tt = class extends re {
2129
2131
  left: p.absolute.left,
2130
2132
  top: p.absolute.top
2131
2133
  }
2132
- }, n), ht = {
2133
- left: Ee.startX,
2134
- top: Ee.startY,
2135
- width: Ee.width,
2136
- height: Ee.height,
2134
+ }, n), ut = {
2135
+ left: ye.startX,
2136
+ top: ye.startY,
2137
+ width: ye.width,
2138
+ height: ye.height,
2137
2139
  zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
2138
- }, le = new Ne(lt, ht);
2139
- Y.addObject(le, Yt), T.allowTransform !== !1 && Y.attachTransformerTo(le);
2140
- const Q = new wt(), Te = Y.getMainViewport(), ue = {
2140
+ }, de = new Ae(dt, ut);
2141
+ X.addObject(de, Yt), T.allowTransform !== !1 && X.attachTransformerTo(de);
2142
+ const Q = new pt(), Ee = X.getMainViewport(), le = {
2141
2143
  top: 0,
2142
2144
  //viewMain.top,
2143
- left: Te.left,
2144
- bottom: Te.bottom,
2145
- right: Te.right
2146
- }, he = {
2145
+ left: Ee.left,
2146
+ bottom: Ee.bottom,
2147
+ right: Ee.right
2148
+ }, ue = {
2147
2149
  dispose: Q,
2148
- rect: le,
2150
+ rect: de,
2149
2151
  // position$,
2150
2152
  unitId: w,
2151
2153
  subUnitId: y,
2152
- boundsOfViewArea: ue,
2154
+ boundsOfViewArea: le,
2153
2155
  domAnchor: n,
2154
2156
  scrollDirectionResponse: "HORIZONTAL"
2155
2157
  /* HORIZONTAL */
2156
- }, gt = fe(le, X.renderUnit.scene, F.skeleton, E.worksheet, he), Oe = new je(gt);
2157
- he.position$ = Oe;
2158
- let Xe = {
2159
- position$: Oe,
2160
- id: C,
2158
+ }, ht = ge(de, L.renderUnit.scene, x.skeleton, E.worksheet, ue), Te = new We(ht);
2159
+ ue.position$ = Te;
2160
+ let Ge = {
2161
+ position$: Te,
2162
+ id: D,
2161
2163
  componentKey: T.componentKey,
2162
2164
  onPointerDown: () => {
2163
2165
  },
@@ -2165,62 +2167,62 @@ let tt = class extends re {
2165
2167
  },
2166
2168
  onPointerUp: () => {
2167
2169
  },
2168
- onWheel: (B) => {
2169
- K.dispatchEvent(new WheelEvent(B.type, B));
2170
+ onWheel: (j) => {
2171
+ K.dispatchEvent(new WheelEvent(j.type, j));
2170
2172
  },
2171
2173
  data: H,
2172
2174
  unitId: w
2173
2175
  };
2174
- e.eventPassThrough && (Xe = {
2175
- ...Xe,
2176
- onPointerDown: (B) => {
2177
- K.dispatchEvent(new PointerEvent(B.type, B));
2176
+ e.eventPassThrough && (Ge = {
2177
+ ...Ge,
2178
+ onPointerDown: (j) => {
2179
+ K.dispatchEvent(new PointerEvent(j.type, j));
2178
2180
  },
2179
- onPointerMove: (B) => {
2180
- K.dispatchEvent(new PointerEvent(B.type, B));
2181
+ onPointerMove: (j) => {
2182
+ K.dispatchEvent(new PointerEvent(j.type, j));
2181
2183
  },
2182
- onPointerUp: (B) => {
2183
- K.dispatchEvent(new PointerEvent(B.type, B));
2184
+ onPointerUp: (j) => {
2185
+ K.dispatchEvent(new PointerEvent(j.type, j));
2184
2186
  }
2185
- }), this._canvasFloatDomService.addFloatDom(Xe);
2186
- const ft = le.onTransformChange$.subscribeEvent(() => {
2187
- const B = fe(le, X.renderUnit.scene, F.skeleton, E.worksheet, he);
2188
- Oe.next(
2189
- B
2187
+ }), this._canvasFloatDomService.addFloatDom(Ge);
2188
+ const gt = de.onTransformChange$.subscribeEvent(() => {
2189
+ const j = ge(de, L.renderUnit.scene, x.skeleton, E.worksheet, ue);
2190
+ Te.next(
2191
+ j
2190
2192
  );
2191
2193
  });
2192
- this.disposeWithMe(f.subscribe((B) => {
2193
- const Ue = Ct({
2194
- startX: B.startX,
2194
+ this.disposeWithMe(m.subscribe((j) => {
2195
+ const Oe = It({
2196
+ startX: j.startX,
2195
2197
  startY: 0,
2196
- endX: B.endX,
2197
- endY: B.endY,
2198
+ endX: j.endX,
2199
+ endY: j.endY,
2198
2200
  width: n.width,
2199
2201
  height: n.height,
2200
2202
  absolute: {
2201
2203
  left: p.absolute.left,
2202
2204
  top: p.absolute.top
2203
2205
  }
2204
- }, n), Ve = Ie({ unitId: w, subUnitId: y, drawingId: C }), He = new Ne(Ve, {
2205
- left: Ue.startX,
2206
+ }, n), Le = ve({ unitId: w, subUnitId: y, drawingId: D }), Ve = new Ae(Le, {
2207
+ left: Oe.startX,
2206
2208
  top: 0,
2207
2209
  width: n.width,
2208
2210
  height: n.height,
2209
2211
  zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
2210
- }), mt = fe(He, X.renderUnit.scene, F.skeleton, E.worksheet, he);
2211
- Oe.next(mt);
2212
+ }), ft = ge(Ve, L.renderUnit.scene, x.skeleton, E.worksheet, ue);
2213
+ Te.next(ft);
2212
2214
  }));
2213
- const ge = (D = this._renderManagerService.getRenderById(w)) == null ? void 0 : D.with(V);
2214
- ge == null || ge.currentSkeleton$.subscribe((B) => {
2215
- B && c.sheetId !== B.sheetId && this._removeDom(m, !0);
2215
+ const he = (C = this._renderManagerService.getRenderById(w)) == null ? void 0 : C.with(V);
2216
+ he == null || he.currentSkeleton$.subscribe((j) => {
2217
+ j && c.sheetId !== j.sheetId && this._removeDom(f, !0);
2216
2218
  }), Q.add(() => {
2217
- this._canvasFloatDomService.removeFloatDom(C);
2218
- }), ft && Q.add(ft), this._domLayerInfoMap.set(C, he);
2219
+ this._canvasFloatDomService.removeFloatDom(D);
2220
+ }), gt && Q.add(gt), this._domLayerInfoMap.set(D, ue);
2219
2221
  }
2220
2222
  return {
2221
- id: m,
2223
+ id: f,
2222
2224
  dispose: () => {
2223
- this._removeDom(m, !0);
2225
+ this._removeDom(f, !0);
2224
2226
  }
2225
2227
  };
2226
2228
  }
@@ -2237,19 +2239,19 @@ let tt = class extends re {
2237
2239
  // eslint-disable-next-line max-lines-per-function
2238
2240
  _createRangePositionObserver(t, e, n) {
2239
2241
  let { startRow: r, startColumn: s } = t;
2240
- const o = Je(r, s, n), a = new je(o), d = Je(t.endRow, t.endColumn, n), u = new je(d), c = () => {
2241
- const f = Je(r, s, n), _ = Je(t.endRow, t.endColumn, n);
2242
- a.next(f), u.next(_);
2243
- }, l = new wt();
2244
- l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((f) => {
2245
- if (f.id === zi.id && f.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
2242
+ const o = Je(r, s, n), a = new We(o), d = Je(t.endRow, t.endColumn, n), u = new We(d), c = () => {
2243
+ const m = Je(r, s, n), _ = Je(t.endRow, t.endColumn, n);
2244
+ a.next(m), u.next(_);
2245
+ }, l = new pt();
2246
+ l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((m) => {
2247
+ if (m.id === xi.id && m.params.rowsAutoHeightInfo.findIndex((v) => v.row === r) > -1) {
2246
2248
  c();
2247
2249
  return;
2248
2250
  }
2249
- (Ki.indexOf(f.id) > -1 || f.id === Ti.id || f.id === On.id) && c();
2251
+ (Yi.indexOf(m.id) > -1 || m.id === Ci.id || m.id === Tn.id) && c();
2250
2252
  }));
2251
- const g = (f, _) => {
2252
- r = f, s = _, c();
2253
+ const g = (m, _) => {
2254
+ r = m, s = _, c();
2253
2255
  }, h = () => ({
2254
2256
  rotate: 0,
2255
2257
  width: d.right - o.left,
@@ -2262,26 +2264,26 @@ let tt = class extends re {
2262
2264
  startY: o.top,
2263
2265
  endX: d.right,
2264
2266
  endY: d.bottom
2265
- }), m = a.pipe(
2266
- Me((f) => {
2267
+ }), f = a.pipe(
2268
+ be((m) => {
2267
2269
  const _ = Je(t.endRow, t.endColumn, n);
2268
2270
  return {
2269
2271
  rotate: 0,
2270
- width: _.right - f.left,
2271
- height: _.bottom - f.top,
2272
+ width: _.right - m.left,
2273
+ height: _.bottom - m.top,
2272
2274
  absolute: {
2273
2275
  left: !0,
2274
2276
  top: !0
2275
2277
  },
2276
- startX: f.left,
2277
- startY: f.top,
2278
+ startX: m.left,
2279
+ startY: m.top,
2278
2280
  endX: _.right,
2279
2281
  endY: _.bottom
2280
2282
  };
2281
2283
  })
2282
2284
  ), p = h();
2283
2285
  return {
2284
- position$: m,
2286
+ position$: f,
2285
2287
  position: p,
2286
2288
  updateRowCol: g,
2287
2289
  topLeftPos$: a,
@@ -2290,15 +2292,15 @@ let tt = class extends re {
2290
2292
  };
2291
2293
  }
2292
2294
  };
2293
- tt = ks([
2294
- De(0, A(J)),
2295
- De(1, Se),
2296
- De(2, A(G)),
2297
- De(3, ie),
2298
- De(4, A(Wi)),
2299
- De(5, se),
2300
- De(6, A(Yr))
2301
- ], tt);
2295
+ et = ys([
2296
+ Ce(0, A(Z)),
2297
+ Ce(1, Se),
2298
+ Ce(2, A(G)),
2299
+ Ce(3, re),
2300
+ Ce(4, A(Ti)),
2301
+ Ce(5, ie),
2302
+ Ce(6, A(Wr))
2303
+ ], et);
2302
2304
  function Je(i, t, e) {
2303
2305
  const n = e.getCellWithCoordByIndex(i, t), r = n.isMergedMainCell ? n.mergeInfo : n;
2304
2306
  return {
@@ -2308,22 +2310,22 @@ function Je(i, t, e) {
2308
2310
  bottom: r.endY
2309
2311
  };
2310
2312
  }
2311
- function Ct(i, t, e) {
2313
+ function It(i, t, e) {
2312
2314
  var u, c;
2313
2315
  e = e != null ? e : 1;
2314
2316
  const n = i.endX - i.startX, r = i.endY - i.startY, s = (u = t == null ? void 0 : t.width) != null ? u : n, o = (c = t == null ? void 0 : t.height) != null ? c : r;
2315
2317
  let a = 0, d = 0;
2316
2318
  if (t) {
2317
2319
  if (t.horizonOffsetAlign === "right") {
2318
- const l = Dt(t.marginX, n * e);
2320
+ const l = Ct(t.marginX, n * e);
2319
2321
  a = i.endX - l - s;
2320
2322
  } else
2321
- a = i.startX + Dt(t.marginX, n);
2323
+ a = i.startX + Ct(t.marginX, n);
2322
2324
  if (t.verticalOffsetAlign === "bottom") {
2323
- const l = Dt(t.marginY, r * e);
2325
+ const l = Ct(t.marginY, r * e);
2324
2326
  d = i.endY - l - o;
2325
2327
  } else
2326
- d = i.startY + Dt(t.marginY, r);
2328
+ d = i.startY + Ct(t.marginY, r);
2327
2329
  }
2328
2330
  return {
2329
2331
  rotate: 0,
@@ -2339,15 +2341,15 @@ function Ct(i, t, e) {
2339
2341
  }
2340
2342
  };
2341
2343
  }
2342
- function Dt(i, t) {
2344
+ function Ct(i, t) {
2343
2345
  if (i === void 0) return 0;
2344
2346
  if (typeof i == "number") return i;
2345
2347
  const e = Number.parseFloat(i);
2346
2348
  return t * e / 100;
2347
2349
  }
2348
- const Ws = (i) => {
2349
- const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s = os(() => t.map((o) => {
2350
- const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g = Dr(
2350
+ const Es = (i) => {
2351
+ const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s = Qi(() => t.map((o) => {
2352
+ const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g = vr(
2351
2353
  {
2352
2354
  left: c != null ? c : 0,
2353
2355
  right: (c != null ? c : 0) + (a != null ? a : 0),
@@ -2359,17 +2361,17 @@ const Ws = (i) => {
2359
2361
  r,
2360
2362
  void 0,
2361
2363
  !0
2362
- ), { scaleX: h, scaleY: m } = e.getAncestorScale(), p = {
2364
+ ), { scaleX: h, scaleY: f } = e.getAncestorScale(), p = {
2363
2365
  startX: g.left,
2364
2366
  endX: g.right,
2365
2367
  startY: g.top,
2366
2368
  endY: g.bottom,
2367
2369
  rotate: u,
2368
2370
  width: a * h,
2369
- height: d * m,
2371
+ height: d * f,
2370
2372
  absolute: g.absolute
2371
- }, f = {
2372
- position$: new je(p),
2373
+ }, m = {
2374
+ position$: new We(p),
2373
2375
  position: p,
2374
2376
  id: o.drawingId,
2375
2377
  componentKey: o.componentKey,
@@ -2384,16 +2386,16 @@ const Ws = (i) => {
2384
2386
  unitId: o.unitId,
2385
2387
  data: o.data
2386
2388
  };
2387
- return [o.drawingId, f];
2389
+ return [o.drawingId, m];
2388
2390
  }), [t, e, n, r]);
2389
- return /* @__PURE__ */ ae("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ ae(ji, { layer: a, id: o, position: a.position }, o)) });
2391
+ return /* @__PURE__ */ oe("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ oe(Oi, { layer: a, id: o, position: a.position }, o)) });
2390
2392
  };
2391
- var js = Object.getOwnPropertyDescriptor, Bs = (i, t, e, n) => {
2392
- for (var r = n > 1 ? void 0 : n ? js(t, e) : t, s = i.length - 1, o; s >= 0; s--)
2393
+ var Ts = Object.getOwnPropertyDescriptor, Os = (i, t, e, n) => {
2394
+ for (var r = n > 1 ? void 0 : n ? Ts(t, e) : t, s = i.length - 1, o; s >= 0; s--)
2393
2395
  (o = i[s]) && (r = o(r) || r);
2394
2396
  return r;
2395
- }, be = (i, t) => (e, n) => t(e, n, i);
2396
- let Ut = class extends re {
2397
+ }, De = (i, t) => (e, n) => t(e, n, i);
2398
+ let Ot = class extends ne {
2397
2399
  constructor(i, t, e, n, r, s, o) {
2398
2400
  super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = t, this._drawingManagerService = e, this._renderManagerService = n, this._canvasFloatDomManagerService = r, this._componetManager = s, this._injector = o, this._initPrinting(), this._initPrintingDom();
2399
2401
  }
@@ -2406,7 +2408,7 @@ let Ut = class extends re {
2406
2408
  const { unitId: n, scene: r, subUnitId: s } = t, o = this._drawingManagerService.getDrawingDataForUnit(n), a = o == null ? void 0 : o[s];
2407
2409
  return a && a.order.forEach((d) => {
2408
2410
  const u = a.data[d];
2409
- u.drawingType !== j.DRAWING_CHART && u.drawingType !== j.DRAWING_DOM && this._drawingRenderService.renderDrawing(u, r);
2411
+ u.drawingType !== B.DRAWING_CHART && u.drawingType !== B.DRAWING_DOM && this._drawingRenderService.renderDrawing(u, r);
2410
2412
  }), e();
2411
2413
  }
2412
2414
  }
@@ -2428,8 +2430,8 @@ let Ut = class extends re {
2428
2430
  const { scaleX: u, scaleY: c } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = d.order.map((h) => d.data[h]);
2429
2431
  return g.length ? (g.forEach((h) => {
2430
2432
  if (!h.groupId && h.transform && Re.isDefine(h.transform.left) && Re.isDefine(h.transform.top) && Re.isDefine(h.transform.width) && Re.isDefine(h.transform.height)) {
2431
- const m = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, c, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, c, { x: 0, y: 0 });
2432
- m.column < l.startColumn && (l.startColumn = m.column), m.row < l.startRow && (l.startRow = m.row), l.endRow < p.row && (l.endRow = p.row), l.endColumn < p.column && (l.endColumn = p.column);
2433
+ const f = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, c, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, c, { x: 0, y: 0 });
2434
+ f.column < l.startColumn && (l.startColumn = f.column), f.row < l.startRow && (l.startRow = f.row), l.endRow < p.row && (l.endRow = p.row), l.endColumn < p.column && (l.endColumn = p.column);
2433
2435
  }
2434
2436
  }), e(l)) : e(i);
2435
2437
  }
@@ -2447,12 +2449,12 @@ let Ut = class extends re {
2447
2449
  if (o) {
2448
2450
  const a = o.order.map((u) => {
2449
2451
  const c = o.data[u];
2450
- if (c.drawingType === j.DRAWING_CHART)
2452
+ if (c.drawingType === B.DRAWING_CHART)
2451
2453
  return {
2452
2454
  ...c,
2453
- componentKey: this._componetManager.get(Vr)
2455
+ componentKey: this._componetManager.get($r)
2454
2456
  };
2455
- if (c.drawingType === j.DRAWING_DOM) {
2457
+ if (c.drawingType === B.DRAWING_DOM) {
2456
2458
  const l = this._sheetPrintInterceptorService.getPrintComponent(c.componentKey);
2457
2459
  return {
2458
2460
  ...c,
@@ -2460,12 +2462,12 @@ let Ut = class extends re {
2460
2462
  };
2461
2463
  }
2462
2464
  return null;
2463
- }).filter(Boolean), d = Bi(Ws, this._injector);
2464
- return wi(
2465
- /* @__PURE__ */ ae(d, { floatDomInfos: a, scene: t.scene, skeleton: t.skeleton, worksheet: t.worksheet }),
2465
+ }).filter(Boolean), d = Ui(Es, this._injector);
2466
+ return li(
2467
+ /* @__PURE__ */ oe(d, { floatDomInfos: a, scene: t.scene, skeleton: t.skeleton, worksheet: t.worksheet }),
2466
2468
  t.root
2467
2469
  ), i == null || i.add(() => {
2468
- _i(t.root);
2470
+ ui(t.root);
2469
2471
  }), e(i);
2470
2472
  }
2471
2473
  }
@@ -2474,31 +2476,32 @@ let Ut = class extends re {
2474
2476
  );
2475
2477
  }
2476
2478
  };
2477
- Ut = Bs([
2478
- be(0, A(Oi)),
2479
- be(1, A(Gn)),
2480
- be(2, ie),
2481
- be(3, J),
2482
- be(4, A(tt)),
2483
- be(5, A(zn)),
2484
- be(6, A(Ye))
2485
- ], Ut);
2486
- var $s = Object.getOwnPropertyDescriptor, xs = (i, t, e, n) => {
2487
- for (var r = n > 1 ? void 0 : n ? $s(t, e) : t, s = i.length - 1, o; s >= 0; s--)
2479
+ Ot = Os([
2480
+ De(0, A(Di)),
2481
+ De(1, A(Xn)),
2482
+ De(2, re),
2483
+ De(3, Z),
2484
+ De(4, A(et)),
2485
+ De(5, A(Hn)),
2486
+ De(6, A(Ye))
2487
+ ], Ot);
2488
+ var Us = Object.getOwnPropertyDescriptor, Ps = (i, t, e, n) => {
2489
+ for (var r = n > 1 ? void 0 : n ? Us(t, e) : t, s = i.length - 1, o; s >= 0; s--)
2488
2490
  (o = i[s]) && (r = o(r) || r);
2489
2491
  return r;
2490
- }, pe = (i, t) => (e, n) => t(e, n, i);
2491
- const Fs = [
2492
+ }, me = (i, t) => (e, n) => t(e, n, i);
2493
+ const As = [
2494
+ zn.id,
2492
2495
  Kn.id,
2493
- Zn.id,
2494
2496
  Jn.id,
2497
+ Zn.id,
2495
2498
  qn.id,
2496
2499
  Qn.id,
2497
2500
  er.id,
2498
2501
  tr.id,
2499
- nr.id,
2500
2502
  Jt.id,
2501
- qt.id,
2503
+ Zt.id,
2504
+ nr.id,
2502
2505
  rr.id,
2503
2506
  ir.id,
2504
2507
  sr.id,
@@ -2506,17 +2509,16 @@ const Fs = [
2506
2509
  ar.id,
2507
2510
  cr.id,
2508
2511
  dr.id,
2509
- lr.id,
2510
- ur.id
2511
- ], Ls = [
2512
- Zi.id,
2513
- Ji.id,
2514
- qi.id,
2515
- Qi.id,
2516
- es.id,
2517
- ts.id
2512
+ lr.id
2513
+ ], Ns = [
2514
+ Xi.id,
2515
+ Gi.id,
2516
+ Li.id,
2517
+ Vi.id,
2518
+ Hi.id,
2519
+ zi.id
2518
2520
  ];
2519
- let sn = class extends re {
2521
+ let rn = class extends ne {
2520
2522
  constructor(i, t, e, n, r, s, o, a, d) {
2521
2523
  super(), this._context = i, this._renderManagerService = t, this._commandService = e, this._selectionRenderService = n, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = a, this._univerInstanceService = d, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
2522
2524
  }
@@ -2524,57 +2526,57 @@ let sn = class extends re {
2524
2526
  this.disposeWithMe(
2525
2527
  this._sheetInterceptorService.interceptCommand({
2526
2528
  getMutations: (i) => {
2527
- if (!Fs.includes(i.id))
2529
+ if (!As.includes(i.id))
2528
2530
  return { redos: [], undos: [] };
2529
2531
  if (i.params == null)
2530
2532
  return { redos: [], undos: [] };
2531
2533
  const t = i.id;
2532
- if (t === Kn.id)
2534
+ if (t === zn.id)
2533
2535
  return this._moveRowInterceptor(i.params, "insert");
2534
- if ([dr.id, lr.id, ur.id].includes(t))
2536
+ if ([cr.id, dr.id, lr.id].includes(t))
2535
2537
  return this._moveRangeInterceptor(i.params);
2536
- if (t === Zn.id)
2538
+ if (t === Kn.id)
2537
2539
  return this._moveColInterceptor(i.params, "insert");
2538
2540
  if (t === Jn.id)
2539
2541
  return this._moveRowInterceptor(i.params, "remove");
2540
- if (t === qn.id)
2542
+ if (t === Zn.id)
2541
2543
  return this._moveColInterceptor(i.params, "remove");
2542
- if (t === Qn.id) {
2544
+ if (t === qn.id) {
2543
2545
  const { range: e } = i.params;
2544
2546
  return this._getRangeMoveUndo(
2545
2547
  e,
2546
2548
  0
2547
2549
  /* deleteLeft */
2548
2550
  );
2549
- } else if (t === er.id) {
2551
+ } else if (t === Qn.id) {
2550
2552
  const { range: e } = i.params;
2551
2553
  return this._getRangeMoveUndo(
2552
2554
  e,
2553
2555
  1
2554
2556
  /* deleteUp */
2555
2557
  );
2556
- } else if (t === tr.id) {
2558
+ } else if (t === er.id) {
2557
2559
  const { range: e } = i.params;
2558
2560
  return this._getRangeMoveUndo(
2559
2561
  e,
2560
2562
  2
2561
2563
  /* insertDown */
2562
2564
  );
2563
- } else if (t === nr.id) {
2565
+ } else if (t === tr.id) {
2564
2566
  const { range: e } = i.params;
2565
2567
  return this._getRangeMoveUndo(
2566
2568
  e,
2567
2569
  3
2568
2570
  /* insertRight */
2569
2571
  );
2570
- } else if (t === sr.id || t === or.id) {
2572
+ } else if (t === ir.id || t === sr.id) {
2571
2573
  const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
2572
2574
  return this._getDrawingUndoForRowVisible(n, r, s);
2573
- } else if (t === ar.id || t === cr.id) {
2575
+ } else if (t === or.id || t === ar.id) {
2574
2576
  const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
2575
2577
  return this._getDrawingUndoForColVisible(n, r, s);
2576
- } else if (t === Jt.id || t === qt.id || t === rr.id || t === ir.id) {
2577
- const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === Jt.id || t === qt.id;
2578
+ } else if (t === Jt.id || t === Zt.id || t === nr.id || t === rr.id) {
2579
+ const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === Jt.id || t === Zt.id;
2578
2580
  return this._getDrawingUndoForRowAndColSize(n, r, s, o);
2579
2581
  }
2580
2582
  return { redos: [], undos: [] };
@@ -2583,7 +2585,7 @@ let sn = class extends re {
2583
2585
  );
2584
2586
  }
2585
2587
  _getRangeMoveUndo(i, t) {
2586
- const e = oe(this._univerInstanceService);
2588
+ const e = se(this._univerInstanceService);
2587
2589
  if (e == null)
2588
2590
  return { redos: [], undos: [] };
2589
2591
  const n = e.unitId, r = e.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(n, r), d = [], u = [];
@@ -2600,44 +2602,44 @@ let sn = class extends re {
2600
2602
  const c = this._sheetDrawingService.getBatchRemoveOp(u), l = c.undo, g = c.redo, h = c.objects;
2601
2603
  s.push({ id: P.id, params: { unitId: n, subUnitId: r, op: g, objects: h, type: U.REMOVE } }), o.push({ id: P.id, params: { unitId: n, subUnitId: r, op: l, objects: h, type: U.INSERT } });
2602
2604
  }
2603
- return s.push({ id: L.id, params: [n] }), o.push({ id: L.id, params: [n] }), {
2605
+ return s.push({ id: Y.id, params: [n] }), o.push({ id: Y.id, params: [n] }), {
2604
2606
  redos: s,
2605
2607
  undos: o
2606
2608
  };
2607
2609
  }
2608
2610
  _getUpdateOrDeleteDrawings(i, t, e) {
2609
- const n = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: u, drawingId: c } = e, { from: l, to: g } = s, { row: h, column: m } = l, { row: p, column: f } = g;
2611
+ const n = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: u, drawingId: c } = e, { from: l, to: g } = s, { row: h, column: f } = l, { row: p, column: m } = g;
2610
2612
  if (s == null || a == null)
2611
2613
  return {
2612
2614
  updateDrawings: n,
2613
2615
  deleteDrawings: r
2614
2616
  };
2615
- const { startRow: _, endRow: S, startColumn: I, endColumn: b } = i;
2616
- let v = null, D = null;
2617
- if (t === 0 && h >= _ && p <= S)
2618
- if (m >= I && f <= b)
2617
+ const { startRow: _, endRow: v, startColumn: I, endColumn: R } = i;
2618
+ let S = null, C = null;
2619
+ if (t === 0 && h >= _ && p <= v)
2620
+ if (f >= I && m <= R)
2619
2621
  r.push({ unitId: d, subUnitId: u, drawingId: c });
2620
2622
  else {
2621
- const w = this._shrinkCol(s, a, I, b, o);
2622
- v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
2623
+ const w = this._shrinkCol(s, a, I, R, o);
2624
+ S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
2623
2625
  }
2624
- else if (t === 1 && m >= I && f <= b)
2625
- if (h >= _ && p <= S)
2626
+ else if (t === 1 && f >= I && m <= R)
2627
+ if (h >= _ && p <= v)
2626
2628
  r.push({ unitId: d, subUnitId: u, drawingId: c });
2627
2629
  else {
2628
- const w = this._shrinkRow(s, a, _, S, o);
2629
- v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
2630
+ const w = this._shrinkRow(s, a, _, v, o);
2631
+ S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
2630
2632
  }
2631
2633
  else if (t === 2) {
2632
- const w = this._expandRow(s, a, _, S, o);
2633
- v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
2634
+ const w = this._expandRow(s, a, _, v, o);
2635
+ S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
2634
2636
  } else if (t === 3) {
2635
- const w = this._expandCol(s, a, I, b, o);
2636
- v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
2637
+ const w = this._expandCol(s, a, I, R, o);
2638
+ S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
2637
2639
  }
2638
- if (v != null && D != null) {
2639
- const w = z(v, this._selectionRenderService, this._skeletonManagerService);
2640
- n.push({ ...e, sheetTransform: v, transform: w });
2640
+ if (S != null && C != null) {
2641
+ const w = z(S, this._selectionRenderService, this._skeletonManagerService);
2642
+ n.push({ ...e, sheetTransform: S, transform: w });
2641
2643
  }
2642
2644
  return { updateDrawings: n, deleteDrawings: r };
2643
2645
  }
@@ -2652,57 +2654,57 @@ let sn = class extends re {
2652
2654
  _getDrawingUndoForColVisible(i, t, e) {
2653
2655
  const n = this._drawingManagerService.getDrawingData(i, t), r = [], s = [];
2654
2656
  if (Object.keys(n).forEach((c) => {
2655
- const l = n[c], { sheetTransform: g, transform: h, anchorType: m = O.Position } = l;
2656
- if (m === O.None)
2657
+ const l = n[c], { sheetTransform: g, transform: h, anchorType: f = O.Position } = l;
2658
+ if (f === O.None)
2657
2659
  this._remainDrawingSize(h, r, l);
2658
2660
  else {
2659
- const { from: p, to: f } = g, { row: _, column: S } = p, { row: I, column: b } = f;
2660
- for (let v = 0; v < e.length; v++) {
2661
- const D = e[v], { startRow: w, endRow: y, startColumn: C, endColumn: E } = D;
2662
- if (b < C)
2661
+ const { from: p, to: m } = g, { row: _, column: v } = p, { row: I, column: R } = m;
2662
+ for (let S = 0; S < e.length; S++) {
2663
+ const C = e[S], { startRow: w, endRow: y, startColumn: D, endColumn: E } = C;
2664
+ if (R < D)
2663
2665
  continue;
2664
- if (m === O.Position) {
2665
- let R = null, N = null;
2666
- if (S >= C && S <= E) {
2667
- const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: p.row, endRow: f.row });
2668
- if (F == null)
2666
+ if (f === O.Position) {
2667
+ let b = null, N = null;
2668
+ if (v >= D && v <= E) {
2669
+ const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: v, endColumn: E, startRow: p.row, endRow: m.row });
2670
+ if (x == null)
2669
2671
  return;
2670
- N = { ...h, left: F.startX };
2672
+ N = { ...h, left: x.startX };
2671
2673
  }
2672
- if (N != null && (R = $(N, this._selectionRenderService), R != null && N != null)) {
2673
- r.push({ ...l, sheetTransform: R, transform: N });
2674
+ if (N != null && (b = $(N, this._selectionRenderService), b != null && N != null)) {
2675
+ r.push({ ...l, sheetTransform: b, transform: N });
2674
2676
  break;
2675
2677
  }
2676
2678
  this._remainDrawingSize(h, r, l);
2677
2679
  continue;
2678
2680
  }
2679
- if (S >= C && b <= E)
2681
+ if (v >= D && R <= E)
2680
2682
  continue;
2681
2683
  let T = null, M = null;
2682
- if (S >= C && S <= E) {
2683
- const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: p.row, endRow: f.row });
2684
- if (R == null)
2684
+ if (v >= D && v <= E) {
2685
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: v, endColumn: E, startRow: p.row, endRow: m.row });
2686
+ if (b == null)
2685
2687
  return;
2686
2688
  M = {
2687
2689
  ...h,
2688
- left: (R == null ? void 0 : R.startX) || 0,
2689
- width: ((h == null ? void 0 : h.width) || 0) - R.endX + R.startX
2690
+ left: (b == null ? void 0 : b.startX) || 0,
2691
+ width: ((h == null ? void 0 : h.width) || 0) - b.endX + b.startX
2690
2692
  };
2691
- } else if (b >= C && b <= E) {
2692
- const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: C, endColumn: b, startRow: p.row, endRow: f.row });
2693
- if (R == null)
2693
+ } else if (R >= D && R <= E) {
2694
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: R, startRow: p.row, endRow: m.row });
2695
+ if (b == null)
2694
2696
  return;
2695
2697
  M = {
2696
2698
  ...h,
2697
- left: R.startX - ((h == null ? void 0 : h.width) || 0)
2699
+ left: b.startX - ((h == null ? void 0 : h.width) || 0)
2698
2700
  };
2699
2701
  } else {
2700
- const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: C, endColumn: E, startRow: p.row, endRow: f.row });
2701
- if (R == null)
2702
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: E, startRow: p.row, endRow: m.row });
2703
+ if (b == null)
2702
2704
  return;
2703
2705
  if (M = {
2704
2706
  ...h,
2705
- width: ((h == null ? void 0 : h.width) || 0) - R.endX + R.startX
2707
+ width: ((h == null ? void 0 : h.width) || 0) - b.endX + b.startX
2706
2708
  }, T = $(M, this._selectionRenderService), T != null && M != null) {
2707
2709
  s.push({ ...l, sheetTransform: T, transform: M });
2708
2710
  break;
@@ -2732,10 +2734,10 @@ let sn = class extends re {
2732
2734
  _createUndoAndRedoMutation(i, t, e) {
2733
2735
  const n = this._sheetDrawingService.getBatchUpdateOp(e), { undo: r, redo: s, objects: o } = n, a = [
2734
2736
  { id: P.id, params: { unitId: i, subUnitId: t, op: s, objects: o, type: U.UPDATE } },
2735
- { id: L.id, params: [i] }
2737
+ { id: Y.id, params: [i] }
2736
2738
  ], d = [
2737
2739
  { id: P.id, params: { unitId: i, subUnitId: t, op: r, objects: o, type: U.UPDATE } },
2738
- { id: L.id, params: [i] }
2740
+ { id: Y.id, params: [i] }
2739
2741
  ];
2740
2742
  return {
2741
2743
  redos: a,
@@ -2746,25 +2748,25 @@ let sn = class extends re {
2746
2748
  _getDrawingUndoForRowVisible(i, t, e) {
2747
2749
  const n = this._drawingManagerService.getDrawingData(i, t), r = [], s = [];
2748
2750
  if (Object.keys(n).forEach((c) => {
2749
- const l = n[c], { sheetTransform: g, transform: h, anchorType: m = O.Position } = l;
2750
- if (m === O.None)
2751
+ const l = n[c], { sheetTransform: g, transform: h, anchorType: f = O.Position } = l;
2752
+ if (f === O.None)
2751
2753
  this._remainDrawingSize(h, r, l);
2752
2754
  else {
2753
- const { from: p, to: f } = g, { row: _, column: S } = p, { row: I, column: b } = f;
2754
- for (let v = 0; v < e.length; v++) {
2755
- const D = e[v], { startRow: w, endRow: y, startColumn: C, endColumn: E } = D;
2755
+ const { from: p, to: m } = g, { row: _, column: v } = p, { row: I, column: R } = m;
2756
+ for (let S = 0; S < e.length; S++) {
2757
+ const C = e[S], { startRow: w, endRow: y, startColumn: D, endColumn: E } = C;
2756
2758
  if (I < w)
2757
2759
  continue;
2758
- if (m === O.Position) {
2759
- let R = null, N = null;
2760
+ if (f === O.Position) {
2761
+ let b = null, N = null;
2760
2762
  if (_ >= w && _ <= y) {
2761
- const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: _, endRow: y });
2762
- if (F == null)
2763
+ const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: y });
2764
+ if (x == null)
2763
2765
  return;
2764
- N = { ...h, top: F.startY };
2766
+ N = { ...h, top: x.startY };
2765
2767
  }
2766
- if (N != null && (R = $(N, this._selectionRenderService), R != null && N != null)) {
2767
- r.push({ ...l, sheetTransform: R, transform: N });
2768
+ if (N != null && (b = $(N, this._selectionRenderService), b != null && N != null)) {
2769
+ r.push({ ...l, sheetTransform: b, transform: N });
2768
2770
  break;
2769
2771
  }
2770
2772
  this._remainDrawingSize(h, r, l);
@@ -2774,29 +2776,29 @@ let sn = class extends re {
2774
2776
  continue;
2775
2777
  let T = null, M = null;
2776
2778
  if (_ >= w && _ <= y) {
2777
- const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: _, endRow: y });
2778
- if (R == null)
2779
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: y });
2780
+ if (b == null)
2779
2781
  return;
2780
2782
  M = {
2781
2783
  ...h,
2782
- top: (R == null ? void 0 : R.startY) || 0,
2783
- height: ((h == null ? void 0 : h.height) || 0) - R.endY + R.startY
2784
+ top: (b == null ? void 0 : b.startY) || 0,
2785
+ height: ((h == null ? void 0 : h.height) || 0) - b.endY + b.startY
2784
2786
  };
2785
2787
  } else if (I >= w && I <= y) {
2786
- const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: I });
2787
- if (R == null)
2788
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: I });
2789
+ if (b == null)
2788
2790
  return;
2789
2791
  M = {
2790
2792
  ...h,
2791
- top: R.startY - ((h == null ? void 0 : h.height) || 0)
2793
+ top: b.startY - ((h == null ? void 0 : h.height) || 0)
2792
2794
  };
2793
2795
  } else {
2794
- const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: y });
2795
- if (R == null)
2796
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: y });
2797
+ if (b == null)
2796
2798
  return;
2797
2799
  if (M = {
2798
2800
  ...h,
2799
- height: ((h == null ? void 0 : h.height) || 0) - R.endY + R.startY
2801
+ height: ((h == null ? void 0 : h.height) || 0) - b.endY + b.startY
2800
2802
  }, T = $(M, this._selectionRenderService), T != null && M != null) {
2801
2803
  s.push({ ...l, sheetTransform: T, transform: M });
2802
2804
  break;
@@ -2830,12 +2832,12 @@ let sn = class extends re {
2830
2832
  if (c === O.None)
2831
2833
  this._remainDrawingSize(u, s, a);
2832
2834
  else {
2833
- const { from: l, to: g } = d, { row: h, column: m } = l, { row: p, column: f } = g;
2835
+ const { from: l, to: g } = d, { row: h, column: f } = l, { row: p, column: m } = g;
2834
2836
  for (let _ = 0; _ < e.length; _++) {
2835
- const S = e[_], { startRow: I, endRow: b, startColumn: v, endColumn: D } = S;
2836
- if (p < I || f < v)
2837
+ const v = e[_], { startRow: I, endRow: R, startColumn: S, endColumn: C } = v;
2838
+ if (p < I || m < S)
2837
2839
  continue;
2838
- if (c === O.Position && (h <= I && p >= b || m <= v && f >= D)) {
2840
+ if (c === O.Position && (h <= I && p >= R || f <= S && m >= C)) {
2839
2841
  this._remainDrawingSize(u, s, a);
2840
2842
  continue;
2841
2843
  }
@@ -2856,7 +2858,7 @@ let sn = class extends re {
2856
2858
  if (t === "insert")
2857
2859
  e = i.unitId, n = i.subUnitId;
2858
2860
  else {
2859
- const r = oe(this._univerInstanceService);
2861
+ const r = se(this._univerInstanceService);
2860
2862
  if (r == null)
2861
2863
  return;
2862
2864
  e = r.unitId, n = r.subUnitId;
@@ -2864,50 +2866,50 @@ let sn = class extends re {
2864
2866
  return { unitId: e, subUnitId: n };
2865
2867
  }
2866
2868
  _moveRangeInterceptor(i) {
2867
- var I, b;
2868
- const { toRange: t, fromRange: e } = i, n = oe(this._univerInstanceService);
2869
+ var I, R;
2870
+ const { toRange: t, fromRange: e } = i, n = se(this._univerInstanceService);
2869
2871
  if (!n)
2870
2872
  return { redos: [], undos: [] };
2871
- const { unitId: r, subUnitId: s } = n, o = (b = (I = this._renderManagerService.getRenderById(r)) == null ? void 0 : I.with(V)) == null ? void 0 : b.getCurrentSkeleton();
2873
+ const { unitId: r, subUnitId: s } = n, o = (R = (I = this._renderManagerService.getRenderById(r)) == null ? void 0 : I.with(V)) == null ? void 0 : R.getCurrentSkeleton();
2872
2874
  if (!o)
2873
2875
  return { redos: [], undos: [] };
2874
- const a = Vn(o, e);
2876
+ const a = Ln(o, e);
2875
2877
  if (!a)
2876
2878
  return { redos: [], undos: [] };
2877
2879
  const { startX: d, endX: u, startY: c, endY: l } = a, g = this._sheetDrawingService.getDrawingData(r, s), h = [];
2878
- Object.keys(g).forEach((v) => {
2879
- const D = g[v];
2880
- if (D.anchorType !== O.Both)
2880
+ Object.keys(g).forEach((S) => {
2881
+ const C = g[S];
2882
+ if (C.anchorType !== O.Both)
2881
2883
  return;
2882
- const { transform: w } = D;
2884
+ const { transform: w } = C;
2883
2885
  if (!w)
2884
2886
  return;
2885
- const { left: y = 0, top: C = 0, width: E = 0, height: T = 0 } = w, { drawingStartX: M, drawingEndX: R, drawingStartY: N, drawingEndY: F } = {
2887
+ const { left: y = 0, top: D = 0, width: E = 0, height: T = 0 } = w, { drawingStartX: M, drawingEndX: b, drawingStartY: N, drawingEndY: x } = {
2886
2888
  drawingStartX: y,
2887
2889
  drawingEndX: y + E,
2888
- drawingStartY: C,
2889
- drawingEndY: C + T
2890
+ drawingStartY: D,
2891
+ drawingEndY: D + T
2890
2892
  };
2891
- d <= M && R <= u && c <= N && F <= l && h.push(D);
2893
+ d <= M && b <= u && c <= N && x <= l && h.push(C);
2892
2894
  });
2893
- const m = [], p = [], f = t.startRow - e.startRow, _ = t.startColumn - e.startColumn, S = h.map((v) => {
2894
- const D = v.sheetTransform, w = {
2895
- to: { ...D.to, row: D.to.row + f, column: D.to.column + _ },
2896
- from: { ...D.from, row: D.from.row + f, column: D.from.column + _ }
2895
+ const f = [], p = [], m = t.startRow - e.startRow, _ = t.startColumn - e.startColumn, v = h.map((S) => {
2896
+ const C = S.sheetTransform, w = {
2897
+ to: { ...C.to, row: C.to.row + m, column: C.to.column + _ },
2898
+ from: { ...C.from, row: C.from.row + m, column: C.from.column + _ }
2897
2899
  }, y = z(w, this._selectionRenderService, this._skeletonManagerService);
2898
2900
  return {
2899
2901
  unitId: r,
2900
2902
  subUnitId: s,
2901
- drawingId: v.drawingId,
2903
+ drawingId: S.drawingId,
2902
2904
  transform: y,
2903
2905
  sheetTransform: w
2904
2906
  };
2905
2907
  });
2906
- if (S.length) {
2907
- const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: D, redo: w, objects: y } = v;
2908
- m.push({ id: P.id, params: { unitId: r, subUnitId: s, op: w, objects: y, type: U.UPDATE } }), p.push({ id: P.id, params: { unitId: r, subUnitId: s, op: D, objects: y, type: U.UPDATE } });
2908
+ if (v.length) {
2909
+ const S = this._sheetDrawingService.getBatchUpdateOp(v), { undo: C, redo: w, objects: y } = S;
2910
+ f.push({ id: P.id, params: { unitId: r, subUnitId: s, op: w, objects: y, type: U.UPDATE } }), p.push({ id: P.id, params: { unitId: r, subUnitId: s, op: C, objects: y, type: U.UPDATE } });
2909
2911
  }
2910
- return { redos: m, undos: p };
2912
+ return { redos: f, undos: p };
2911
2913
  }
2912
2914
  _moveRowInterceptor(i, t) {
2913
2915
  const e = this._getUnitIdAndSubUnitId(i, t);
@@ -2915,37 +2917,37 @@ let sn = class extends re {
2915
2917
  return { redos: [], undos: [] };
2916
2918
  const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startRow, a = s.endRow, d = [], u = [], c = this._sheetDrawingService.getDrawingData(n, r), l = [], g = [];
2917
2919
  if (Object.keys(c).forEach((h) => {
2918
- const m = c[h], { sheetTransform: p, transform: f, anchorType: _ = O.Position } = m;
2919
- if (p == null || f == null)
2920
+ const f = c[h], { sheetTransform: p, transform: m, anchorType: _ = O.Position } = f;
2921
+ if (p == null || m == null)
2920
2922
  return;
2921
- let S, I;
2923
+ let v, I;
2922
2924
  if (t === "insert") {
2923
- const v = this._expandRow(p, f, o, a, _);
2924
- S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
2925
+ const S = this._expandRow(p, m, o, a, _);
2926
+ v = S == null ? void 0 : S.newSheetTransform, I = S == null ? void 0 : S.newTransform;
2925
2927
  } else {
2926
- const { from: v, to: D } = p, { row: w } = v, { row: y } = D;
2928
+ const { from: S, to: C } = p, { row: w } = S, { row: y } = C;
2927
2929
  if (_ === O.Both && w >= o && y <= a)
2928
2930
  g.push({ unitId: n, subUnitId: r, drawingId: h });
2929
2931
  else {
2930
- const C = this._shrinkRow(p, f, o, a, _);
2931
- S = C == null ? void 0 : C.newSheetTransform, I = C == null ? void 0 : C.newTransform;
2932
+ const D = this._shrinkRow(p, m, o, a, _);
2933
+ v = D == null ? void 0 : D.newSheetTransform, I = D == null ? void 0 : D.newTransform;
2932
2934
  }
2933
2935
  }
2934
- if (!S || !I)
2936
+ if (!v || !I)
2935
2937
  return;
2936
- const b = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: S };
2937
- l.push(b);
2938
+ const R = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: v };
2939
+ l.push(R);
2938
2940
  }), l.length === 0 && g.length === 0)
2939
2941
  return { redos: [], undos: [] };
2940
2942
  if (l.length > 0) {
2941
- const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: p, objects: f } = h;
2942
- d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: f, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: f, type: U.UPDATE } });
2943
+ const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: p, objects: m } = h;
2944
+ d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.UPDATE } });
2943
2945
  }
2944
2946
  if (g.length > 0) {
2945
- const h = this._sheetDrawingService.getBatchRemoveOp(g), m = h.undo, p = h.redo, f = h.objects;
2946
- d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: f, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: f, type: U.INSERT } });
2947
+ const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, p = h.redo, m = h.objects;
2948
+ d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.INSERT } });
2947
2949
  }
2948
- return d.push({ id: L.id, params: [n] }), u.push({ id: L.id, params: [n] }), {
2950
+ return d.push({ id: Y.id, params: [n] }), u.push({ id: Y.id, params: [n] }), {
2949
2951
  redos: d,
2950
2952
  undos: u
2951
2953
  };
@@ -2956,37 +2958,37 @@ let sn = class extends re {
2956
2958
  return { redos: [], undos: [] };
2957
2959
  const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startColumn, a = s.endColumn, d = [], u = [], c = this._sheetDrawingService.getDrawingData(n, r), l = [], g = [];
2958
2960
  if (Object.keys(c).forEach((h) => {
2959
- const m = c[h], { sheetTransform: p, transform: f, anchorType: _ = O.Position } = m;
2960
- if (p == null || f == null)
2961
+ const f = c[h], { sheetTransform: p, transform: m, anchorType: _ = O.Position } = f;
2962
+ if (p == null || m == null)
2961
2963
  return;
2962
- let S, I;
2964
+ let v, I;
2963
2965
  if (t === "insert") {
2964
- const v = this._expandCol(p, f, o, a, _);
2965
- S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
2966
+ const S = this._expandCol(p, m, o, a, _);
2967
+ v = S == null ? void 0 : S.newSheetTransform, I = S == null ? void 0 : S.newTransform;
2966
2968
  } else {
2967
- const { from: v, to: D } = p, { column: w } = v, { column: y } = D;
2969
+ const { from: S, to: C } = p, { column: w } = S, { column: y } = C;
2968
2970
  if (_ === O.Both && w >= o && y <= a)
2969
2971
  g.push({ unitId: n, subUnitId: r, drawingId: h });
2970
2972
  else {
2971
- const C = this._shrinkCol(p, f, o, a, _);
2972
- S = C == null ? void 0 : C.newSheetTransform, I = C == null ? void 0 : C.newTransform;
2973
+ const D = this._shrinkCol(p, m, o, a, _);
2974
+ v = D == null ? void 0 : D.newSheetTransform, I = D == null ? void 0 : D.newTransform;
2973
2975
  }
2974
2976
  }
2975
- if (!S || !I)
2977
+ if (!v || !I)
2976
2978
  return;
2977
- const b = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: S };
2978
- l.push(b);
2979
+ const R = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: v };
2980
+ l.push(R);
2979
2981
  }), l.length === 0 && g.length === 0)
2980
2982
  return { redos: [], undos: [] };
2981
2983
  if (l.length > 0) {
2982
- const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: p, objects: f } = h;
2983
- d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: f, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: f, type: U.UPDATE } });
2984
+ const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: p, objects: m } = h;
2985
+ d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.UPDATE } });
2984
2986
  }
2985
2987
  if (g.length > 0) {
2986
- const h = this._sheetDrawingService.getBatchRemoveOp(g), m = h.undo, p = h.redo, f = h.objects;
2987
- d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: f, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: f, type: U.INSERT } });
2988
+ const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, p = h.redo, m = h.objects;
2989
+ d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.INSERT } });
2988
2990
  }
2989
- return d.push({ id: L.id, params: [n] }), u.push({ id: L.id, params: [n] }), { redos: d, undos: u };
2991
+ return d.push({ id: Y.id, params: [n] }), u.push({ id: Y.id, params: [n] }), { redos: d, undos: u };
2990
2992
  }
2991
2993
  _expandCol(i, t, e, n, r = O.Position) {
2992
2994
  const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
@@ -3164,7 +3166,7 @@ let sn = class extends re {
3164
3166
  // but the skeleton changes like other render modules. These two signals are not equivalent.
3165
3167
  // As a temp solution, I subscribed to activate$ here.
3166
3168
  this._commandService.onCommandExecuted((i) => {
3167
- if (i.id === ns.id) {
3169
+ if (i.id === Ki.id) {
3168
3170
  const { unitId: t, subUnitId: e } = i.params;
3169
3171
  this._updateDrawings(t, e);
3170
3172
  }
@@ -3215,7 +3217,7 @@ let sn = class extends re {
3215
3217
  _sheetRefreshListener() {
3216
3218
  this.disposeWithMe(
3217
3219
  this._commandService.onCommandExecuted((i) => {
3218
- Ls.includes(i.id) && requestIdleCallback(() => {
3220
+ Ns.includes(i.id) && requestIdleCallback(() => {
3219
3221
  const t = i.params, { unitId: e, subUnitId: n, ranges: r } = t;
3220
3222
  this._refreshDrawingTransform(e, n, r);
3221
3223
  });
@@ -3228,107 +3230,53 @@ let sn = class extends re {
3228
3230
  const o = n[s], { sheetTransform: a, transform: d, anchorType: u = O.Position } = o;
3229
3231
  if (u === O.None)
3230
3232
  return !0;
3231
- const { from: c, to: l } = a, { row: g, column: h } = c, { row: m, column: p } = l;
3232
- for (let f = 0; f < e.length; f++) {
3233
- const _ = e[f], { startRow: S, endRow: I, startColumn: b, endColumn: v } = _;
3234
- if (Hr.intersects(
3233
+ const { from: c, to: l } = a, { row: g, column: h } = c, { row: f, column: p } = l;
3234
+ for (let m = 0; m < e.length; m++) {
3235
+ const _ = e[m], { startRow: v, endRow: I, startColumn: R, endColumn: S } = _;
3236
+ if (Fr.intersects(
3235
3237
  {
3236
- startRow: S,
3238
+ startRow: v,
3237
3239
  endRow: I,
3238
- startColumn: b,
3239
- endColumn: v
3240
+ startColumn: R,
3241
+ endColumn: S
3240
3242
  },
3241
3243
  {
3242
3244
  startRow: g,
3243
- endRow: m,
3245
+ endRow: f,
3244
3246
  startColumn: h,
3245
3247
  endColumn: p
3246
3248
  }
3247
- ) || g > I || h > v) {
3248
- const D = u === O.Position, w = z(a, this._selectionRenderService, this._skeletonManagerService);
3249
+ ) || g > I || h > S) {
3250
+ const C = u === O.Position, w = z(a, this._selectionRenderService, this._skeletonManagerService);
3249
3251
  r.push({
3250
3252
  ...o,
3251
3253
  transform: {
3252
3254
  ...w,
3253
- width: D ? d == null ? void 0 : d.width : w == null ? void 0 : w.width,
3254
- height: D ? d == null ? void 0 : d.height : w == null ? void 0 : w.height
3255
+ width: C ? d == null ? void 0 : d.width : w == null ? void 0 : w.width,
3256
+ height: C ? d == null ? void 0 : d.height : w == null ? void 0 : w.height
3255
3257
  }
3256
3258
  });
3257
3259
  break;
3258
3260
  }
3259
3261
  }
3260
- }), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(L.id, [i]));
3262
+ }), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(Y.id, [i]));
3261
3263
  }
3262
3264
  };
3263
- sn = xs([
3264
- pe(1, J),
3265
- pe(2, G),
3266
- pe(3, Ge),
3267
- pe(4, A(V)),
3268
- pe(5, A(kt)),
3269
- pe(6, se),
3270
- pe(7, ie),
3271
- pe(8, Se)
3272
- ], sn);
3273
- var ne = function() {
3274
- return ne = Object.assign || function(i) {
3275
- for (var t, e = 1, n = arguments.length; e < n; e++) {
3276
- t = arguments[e];
3277
- for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (i[r] = t[r]);
3278
- }
3279
- return i;
3280
- }, ne.apply(this, arguments);
3281
- }, Ys = function(i, t) {
3282
- var e = {};
3283
- for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && t.indexOf(n) < 0 && (e[n] = i[n]);
3284
- if (i != null && typeof Object.getOwnPropertySymbols == "function")
3285
- for (var r = 0, n = Object.getOwnPropertySymbols(i); r < n.length; r++)
3286
- t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, n[r]) && (e[n[r]] = i[n[r]]);
3287
- return e;
3288
- }, br = hr(function(i, t) {
3289
- var e = i.icon, n = i.id, r = i.className, s = i.extend, o = Ys(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), d = as("_".concat(Vs()));
3290
- return Rr(e, "".concat(n), { defIds: e.defIds, idSuffix: d.current }, ne({ ref: t, className: a }, o), s);
3291
- });
3292
- function Rr(i, t, e, n, r) {
3293
- return gr(i.tag, ne(ne({ key: t }, Gs(i, e, r)), n), (Xs(i, e).children || []).map(function(s, o) {
3294
- return Rr(s, "".concat(t, "-").concat(i.tag, "-").concat(o), e, void 0, r);
3295
- }));
3296
- }
3297
- function Gs(i, t, e) {
3298
- var n = ne({}, i.attrs);
3299
- e != null && e.colorChannel1 && n.fill === "colorChannel1" && (n.fill = e.colorChannel1), i.tag === "mask" && n.id && (n.id = n.id + t.idSuffix), Object.entries(n).forEach(function(s) {
3300
- var o = s[0], a = s[1];
3301
- o === "mask" && typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
3302
- });
3303
- var r = t.defIds;
3304
- return !r || r.length === 0 || (i.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(function(s) {
3305
- var o = s[0], a = s[1];
3306
- typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
3307
- })), n;
3308
- }
3309
- function Xs(i, t) {
3310
- var e, n = t.defIds;
3311
- return !n || n.length === 0 ? i : i.tag === "defs" && (!((e = i.children) === null || e === void 0) && e.length) ? ne(ne({}, i), { children: i.children.map(function(r) {
3312
- return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? ne(ne({}, r), { attrs: ne(ne({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
3313
- }) }) : i;
3314
- }
3315
- function Vs() {
3316
- return Math.random().toString(36).substring(2, 8);
3317
- }
3318
- br.displayName = "UniverIcon";
3319
- var Hs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, Mr = hr(function(i, t) {
3320
- return gr(br, Object.assign({}, i, {
3321
- id: "add-image-single",
3322
- ref: t,
3323
- icon: Hs
3324
- }));
3325
- });
3326
- Mr.displayName = "AddImageSingle";
3327
- const yr = {
3265
+ rn = Ps([
3266
+ me(1, Z),
3267
+ me(2, G),
3268
+ me(3, Xe),
3269
+ me(4, A(V)),
3270
+ me(5, A(Nt)),
3271
+ me(6, ie),
3272
+ me(7, re),
3273
+ me(8, Se)
3274
+ ], rn);
3275
+ const Ir = {
3328
3276
  id: "sheet.command.delete-drawing",
3329
- type: Z.COMMAND,
3277
+ type: J.COMMAND,
3330
3278
  handler: (i) => {
3331
- const t = i.get(G), n = i.get(se).getFocusDrawings();
3279
+ const t = i.get(G), n = i.get(ie).getFocusDrawings();
3332
3280
  if (n.length === 0)
3333
3281
  return !1;
3334
3282
  const r = n[0].unitId, s = n.map((o) => {
@@ -3340,265 +3288,265 @@ const yr = {
3340
3288
  drawingType: c
3341
3289
  };
3342
3290
  });
3343
- return t.executeCommand(rt.id, {
3291
+ return t.executeCommand(nt.id, {
3344
3292
  unitId: r,
3345
3293
  drawings: s
3346
3294
  });
3347
3295
  }
3348
- }, it = {
3296
+ }, rt = {
3349
3297
  id: "sheet.command.move-drawing",
3350
- type: Z.COMMAND,
3298
+ type: J.COMMAND,
3351
3299
  handler: (i, t) => {
3352
- const e = i.get(G), n = i.get(se), r = i.get(Ge), { direction: s } = t, o = n.getFocusDrawings();
3300
+ const e = i.get(G), n = i.get(ie), r = i.get(Xe), { direction: s } = t, o = n.getFocusDrawings();
3353
3301
  if (o.length === 0)
3354
3302
  return !1;
3355
3303
  const a = o[0].unitId, d = o.map((c) => {
3356
3304
  const { transform: l } = c;
3357
3305
  if (l == null)
3358
3306
  return null;
3359
- const g = { ...l }, { left: h = 0, top: m = 0 } = l;
3360
- return s === ve.UP ? g.top = m - 1 : s === ve.DOWN ? g.top = m + 1 : s === ve.LEFT ? g.left = h - 1 : s === ve.RIGHT && (g.left = h + 1), {
3307
+ const g = { ...l }, { left: h = 0, top: f = 0 } = l;
3308
+ return s === _e.UP ? g.top = f - 1 : s === _e.DOWN ? g.top = f + 1 : s === _e.LEFT ? g.left = h - 1 : s === _e.RIGHT && (g.left = h + 1), {
3361
3309
  ...c,
3362
3310
  transform: g,
3363
3311
  sheetTransform: $(g, r)
3364
3312
  };
3365
3313
  }).filter((c) => c != null);
3366
- return e.syncExecuteCommand(jt.id, {
3314
+ return e.syncExecuteCommand(Wt.id, {
3367
3315
  unitId: a,
3368
3316
  drawings: d
3369
- }) ? (e.syncExecuteCommand(L.id, [a]), !0) : !1;
3317
+ }) ? (e.syncExecuteCommand(Y.id, [a]), !0) : !1;
3370
3318
  }
3371
- }, Er = "addition-and-subtraction-single", Tr = "sheet.menu.image";
3372
- function zs(i) {
3373
- return {
3374
- id: Tr,
3375
- type: cn.SUBITEMS,
3376
- icon: Er,
3377
- tooltip: "sheetImage.title",
3378
- hidden$: an(i, x.UNIVER_SHEET),
3379
- disabled$: Ui(i, { workbookTypes: [Kt], worksheetTypes: [Zt], rangeTypes: [rs] })
3380
- };
3381
- }
3382
- function Ks(i) {
3383
- return {
3384
- id: Bt.id,
3385
- title: "sheetImage.upload.float",
3386
- type: cn.BUTTON,
3387
- hidden$: an(i, x.UNIVER_SHEET)
3388
- };
3389
- }
3390
- function Zs(i) {
3391
- return {
3392
- id: ln.id,
3393
- title: "sheetImage.upload.cell",
3394
- type: cn.BUTTON,
3395
- hidden$: an(i, x.UNIVER_SHEET)
3396
- };
3397
- }
3398
- const Js = (i) => {
3399
- var S;
3400
- const t = Qe(G), e = Qe(nt), n = Qe(ie), r = Qe(J), { drawings: s } = i, o = s[0];
3319
+ }, ks = (i) => {
3320
+ var v;
3321
+ const t = qe(G), e = qe(tt), n = qe(re), r = qe(Z), { drawings: s } = i, o = s[0];
3401
3322
  if (o == null)
3402
3323
  return;
3403
3324
  const { unitId: a } = o, d = r.getRenderById(a), u = d == null ? void 0 : d.scene;
3404
3325
  if (u == null)
3405
3326
  return;
3406
- const c = u.getTransformerByCreate(), [l, g] = en(!0), h = (S = o.anchorType) != null ? S : O.Position, [m, p] = en(h);
3407
- function f(I, b) {
3408
- const v = [];
3409
- return I.forEach((D) => {
3410
- const { oKey: w } = D, y = b.getDrawingOKey(w);
3327
+ const c = u.getTransformerByCreate(), [l, g] = Qt(!0), h = (v = o.anchorType) != null ? v : O.Position, [f, p] = Qt(h);
3328
+ function m(I, R) {
3329
+ const S = [];
3330
+ return I.forEach((C) => {
3331
+ const { oKey: w } = C, y = R.getDrawingOKey(w);
3411
3332
  if (y == null)
3412
- return v.push(null), !0;
3413
- const { unitId: C, subUnitId: E, drawingId: T, drawingType: M, anchorType: R, sheetTransform: N } = y;
3414
- v.push({
3415
- unitId: C,
3333
+ return S.push(null), !0;
3334
+ const { unitId: D, subUnitId: E, drawingId: T, drawingType: M, anchorType: b, sheetTransform: N } = y;
3335
+ S.push({
3336
+ unitId: D,
3416
3337
  subUnitId: E,
3417
3338
  drawingId: T,
3418
- anchorType: R,
3339
+ anchorType: b,
3419
3340
  sheetTransform: N,
3420
3341
  drawingType: M
3421
3342
  });
3422
- }), v;
3343
+ }), S;
3423
3344
  }
3424
- fr(() => {
3425
- const I = c.clearControl$.subscribe((v) => {
3426
- v === !0 && g(!1);
3427
- }), b = c.changeStart$.subscribe((v) => {
3345
+ ur(() => {
3346
+ const I = c.clearControl$.subscribe((S) => {
3347
+ S === !0 && g(!1);
3348
+ }), R = c.changeStart$.subscribe((S) => {
3428
3349
  var y;
3429
- const { objects: D } = v, w = f(D, n);
3350
+ const { objects: C } = S, w = m(C, n);
3430
3351
  if (w.length === 0)
3431
3352
  g(!1);
3432
3353
  else if (w.length >= 1) {
3433
3354
  g(!0);
3434
- const C = ((y = w[0]) == null ? void 0 : y.anchorType) || O.Position;
3435
- p(C);
3355
+ const D = ((y = w[0]) == null ? void 0 : y.anchorType) || O.Position;
3356
+ p(D);
3436
3357
  }
3437
3358
  });
3438
3359
  return () => {
3439
- b.unsubscribe(), I.unsubscribe();
3360
+ R.unsubscribe(), I.unsubscribe();
3440
3361
  };
3441
3362
  }, []);
3442
3363
  function _(I) {
3443
3364
  p(I);
3444
- const b = n.getFocusDrawings();
3445
- if (b.length === 0)
3365
+ const R = n.getFocusDrawings();
3366
+ if (R.length === 0)
3446
3367
  return;
3447
- const v = b.map((D) => ({
3448
- unitId: D.unitId,
3449
- subUnitId: D.subUnitId,
3450
- drawingId: D.drawingId,
3368
+ const S = R.map((C) => ({
3369
+ unitId: C.unitId,
3370
+ subUnitId: C.subUnitId,
3371
+ drawingId: C.drawingId,
3451
3372
  anchorType: I
3452
3373
  }));
3453
- t.executeCommand(jt.id, {
3454
- unitId: b[0].unitId,
3455
- drawings: v
3374
+ t.executeCommand(Wt.id, {
3375
+ unitId: R[0].unitId,
3376
+ drawings: S
3456
3377
  });
3457
3378
  }
3458
- return /* @__PURE__ */ Qt(
3379
+ return /* @__PURE__ */ qt(
3459
3380
  "div",
3460
3381
  {
3461
- className: vi("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
3382
+ className: hi("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
3462
3383
  "univer-hidden": !l
3463
3384
  }),
3464
3385
  children: [
3465
- /* @__PURE__ */ ae(
3386
+ /* @__PURE__ */ oe(
3466
3387
  "header",
3467
3388
  {
3468
- className: "univer-text-gray-600 dark:univer-text-gray-200",
3469
- children: /* @__PURE__ */ ae("div", { children: e.t("drawing-anchor.title") })
3389
+ className: "univer-text-gray-600 dark:!univer-text-gray-200",
3390
+ children: /* @__PURE__ */ oe("div", { children: e.t("drawing-anchor.title") })
3470
3391
  }
3471
3392
  ),
3472
- /* @__PURE__ */ ae("div", { children: /* @__PURE__ */ Qt(Si, { value: m, onChange: _, direction: "vertical", children: [
3473
- /* @__PURE__ */ ae(Gt, { value: O.Both, children: e.t("drawing-anchor.both") }),
3474
- /* @__PURE__ */ ae(Gt, { value: O.Position, children: e.t("drawing-anchor.position") }),
3475
- /* @__PURE__ */ ae(Gt, { value: O.None, children: e.t("drawing-anchor.none") })
3393
+ /* @__PURE__ */ oe("div", { children: /* @__PURE__ */ qt(gi, { value: f, onChange: _, direction: "vertical", children: [
3394
+ /* @__PURE__ */ oe(Xt, { value: O.Both, children: e.t("drawing-anchor.both") }),
3395
+ /* @__PURE__ */ oe(Xt, { value: O.Position, children: e.t("drawing-anchor.position") }),
3396
+ /* @__PURE__ */ oe(Xt, { value: O.None, children: e.t("drawing-anchor.none") })
3476
3397
  ] }) })
3477
3398
  ]
3478
3399
  }
3479
3400
  );
3480
- }, qs = () => {
3481
- const i = Qe(ie), t = i.getFocusDrawings(), [e, n] = en(t);
3482
- return fr(() => {
3401
+ }, Ws = () => {
3402
+ const i = qe(re), t = i.getFocusDrawings(), [e, n] = Qt(t);
3403
+ return ur(() => {
3483
3404
  const r = i.focus$.subscribe((s) => {
3484
3405
  n(s);
3485
3406
  });
3486
3407
  return () => {
3487
3408
  r.unsubscribe();
3488
3409
  };
3489
- }, []), !!(e != null && e.length) && /* @__PURE__ */ Qt("div", { className: "univer-text-sm", children: [
3490
- /* @__PURE__ */ ae(ui, { drawings: e }),
3491
- /* @__PURE__ */ ae(Js, { drawings: e })
3410
+ }, []), !!(e != null && e.length) && /* @__PURE__ */ qt("div", { className: "univer-text-sm", children: [
3411
+ /* @__PURE__ */ oe(ii, { drawings: e }),
3412
+ /* @__PURE__ */ oe(ks, { drawings: e })
3492
3413
  ] });
3493
- }, Qs = {
3494
- [$i.FORMULAS_INSERT]: {
3495
- [Tr]: {
3496
- order: 3,
3497
- menuItemFactory: zs,
3414
+ }, Cr = "sheet.menu.image";
3415
+ function Bs(i) {
3416
+ return {
3417
+ id: Cr,
3418
+ type: an.SUBITEMS,
3419
+ icon: "AddImageSingle",
3420
+ tooltip: "sheetImage.title",
3421
+ hidden$: on(i, F.UNIVER_SHEET),
3422
+ disabled$: Ri(i, { workbookTypes: [zt], worksheetTypes: [Kt], rangeTypes: [Ji] })
3423
+ };
3424
+ }
3425
+ function js(i) {
3426
+ return {
3427
+ id: Bt.id,
3428
+ title: "sheetImage.upload.float",
3429
+ type: an.BUTTON,
3430
+ hidden$: on(i, F.UNIVER_SHEET)
3431
+ };
3432
+ }
3433
+ function $s(i) {
3434
+ return {
3435
+ id: dn.id,
3436
+ title: "sheetImage.upload.cell",
3437
+ type: an.BUTTON,
3438
+ hidden$: on(i, F.UNIVER_SHEET)
3439
+ };
3440
+ }
3441
+ const Fs = {
3442
+ [Pi.MEDIA]: {
3443
+ [Cr]: {
3444
+ order: 0,
3445
+ menuItemFactory: Bs,
3498
3446
  [Bt.id]: {
3499
3447
  order: 0,
3500
- menuItemFactory: Ks
3448
+ menuItemFactory: js
3501
3449
  },
3502
- [ln.id]: {
3450
+ [dn.id]: {
3503
3451
  order: 1,
3504
- menuItemFactory: Zs
3452
+ menuItemFactory: $s
3505
3453
  }
3506
3454
  }
3507
3455
  }
3508
3456
  };
3509
- function st(i) {
3510
- return !i.getContextValue(zr) && !i.getContextValue(Kr) && !i.getContextValue(Zr) && i.getContextValue(xe);
3457
+ function it(i) {
3458
+ return !i.getContextValue(xr) && !i.getContextValue(Yr) && !i.getContextValue(Xr) && i.getContextValue($e);
3511
3459
  }
3512
- const eo = {
3513
- id: it.id,
3460
+ const xs = {
3461
+ id: rt.id,
3514
3462
  description: "shortcut.drawing-move-down",
3515
3463
  group: "4_drawing-view",
3516
3464
  binding: Fe.ARROW_DOWN,
3517
3465
  priority: 100,
3518
- preconditions: st,
3466
+ preconditions: it,
3519
3467
  staticParameters: {
3520
- direction: ve.DOWN
3468
+ direction: _e.DOWN
3521
3469
  }
3522
- }, to = {
3523
- id: it.id,
3470
+ }, Ys = {
3471
+ id: rt.id,
3524
3472
  description: "shortcut.drawing-move-up",
3525
3473
  group: "4_drawing-view",
3526
3474
  binding: Fe.ARROW_UP,
3527
3475
  priority: 100,
3528
- preconditions: st,
3476
+ preconditions: it,
3529
3477
  staticParameters: {
3530
- direction: ve.UP
3478
+ direction: _e.UP
3531
3479
  }
3532
- }, no = {
3533
- id: it.id,
3480
+ }, Xs = {
3481
+ id: rt.id,
3534
3482
  description: "shortcut.drawing-move-left",
3535
3483
  group: "4_drawing-view",
3536
3484
  binding: Fe.ARROW_LEFT,
3537
3485
  priority: 100,
3538
- preconditions: st,
3486
+ preconditions: it,
3539
3487
  staticParameters: {
3540
- direction: ve.LEFT
3488
+ direction: _e.LEFT
3541
3489
  }
3542
- }, ro = {
3543
- id: it.id,
3490
+ }, Gs = {
3491
+ id: rt.id,
3544
3492
  description: "shortcut.drawing-move-right",
3545
3493
  group: "4_drawing-view",
3546
3494
  binding: Fe.ARROW_RIGHT,
3547
3495
  priority: 100,
3548
- preconditions: st,
3496
+ preconditions: it,
3549
3497
  staticParameters: {
3550
- direction: ve.RIGHT
3498
+ direction: _e.RIGHT
3551
3499
  }
3552
- }, io = {
3553
- id: yr.id,
3500
+ }, Ls = {
3501
+ id: Ir.id,
3554
3502
  description: "shortcut.drawing-delete",
3555
3503
  group: "4_drawing-view",
3556
3504
  // when focusing on any other input tag do not trigger this shortcut
3557
- preconditions: st,
3505
+ preconditions: it,
3558
3506
  binding: Fe.DELETE,
3559
3507
  mac: Fe.BACKSPACE
3560
3508
  };
3561
- var so = Object.getOwnPropertyDescriptor, oo = (i, t, e, n) => {
3562
- for (var r = n > 1 ? void 0 : n ? so(t, e) : t, s = i.length - 1, o; s >= 0; s--)
3509
+ var Vs = Object.getOwnPropertyDescriptor, Hs = (i, t, e, n) => {
3510
+ for (var r = n > 1 ? void 0 : n ? Vs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
3563
3511
  (o = i[s]) && (r = o(r) || r);
3564
3512
  return r;
3565
- }, We = (i, t) => (e, n) => t(e, n, i);
3566
- let Pt = class extends re {
3513
+ }, ke = (i, t) => (e, n) => t(e, n, i);
3514
+ let Ut = class extends ne {
3567
3515
  constructor(i, t, e, n, r, s) {
3568
3516
  super(), this._componentManager = i, this._menuManagerService = t, this._commandService = e, this._shortcutService = n, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
3569
3517
  }
3570
3518
  _initCustomComponents() {
3571
3519
  const i = this._componentManager;
3572
- this.disposeWithMe(i.register(Er, Mr)), this.disposeWithMe(i.register(mr, qs));
3520
+ this.disposeWithMe(i.register(hr, Ws));
3573
3521
  }
3574
3522
  _initMenus() {
3575
- this._menuManagerService.mergeMenu(Qs);
3523
+ this._menuManagerService.mergeMenu(Fs);
3576
3524
  }
3577
3525
  _initCommands() {
3578
3526
  [
3579
3527
  Bt,
3580
- ln,
3528
+ dn,
3529
+ kt,
3530
+ nt,
3581
3531
  Wt,
3582
- rt,
3583
- jt,
3584
- pr,
3585
- L,
3532
+ gr,
3533
+ Y,
3534
+ fr,
3535
+ mr,
3586
3536
  wr,
3587
- _r,
3588
- Sr,
3589
- it,
3590
- yr,
3591
- vr
3537
+ rt,
3538
+ Ir,
3539
+ pr
3592
3540
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
3593
3541
  }
3594
3542
  _initShortcuts() {
3595
3543
  [
3596
3544
  // sheet drawing shortcuts
3597
- eo,
3598
- to,
3599
- no,
3600
- ro,
3601
- io
3545
+ xs,
3546
+ Ys,
3547
+ Xs,
3548
+ Gs,
3549
+ Ls
3602
3550
  ].forEach((i) => {
3603
3551
  this.disposeWithMe(this._shortcutService.registerShortcut(i));
3604
3552
  });
@@ -3607,58 +3555,58 @@ let Pt = class extends re {
3607
3555
  this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
3608
3556
  }
3609
3557
  };
3610
- Pt = oo([
3611
- We(0, A(zn)),
3612
- We(1, xi),
3613
- We(2, G),
3614
- We(3, Fi),
3615
- We(4, ie),
3616
- We(5, A(dn))
3617
- ], Pt);
3618
- var ao = Object.defineProperty, co = Object.getOwnPropertyDescriptor, lo = (i, t, e) => t in i ? ao(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, uo = (i, t, e, n) => {
3619
- for (var r = n > 1 ? void 0 : n ? co(t, e) : t, s = i.length - 1, o; s >= 0; s--)
3558
+ Ut = Hs([
3559
+ ke(0, A(Hn)),
3560
+ ke(1, Ai),
3561
+ ke(2, G),
3562
+ ke(3, Ni),
3563
+ ke(4, re),
3564
+ ke(5, A(cn))
3565
+ ], Ut);
3566
+ var zs = Object.defineProperty, Ks = Object.getOwnPropertyDescriptor, Js = (i, t, e) => t in i ? zs(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, Zs = (i, t, e, n) => {
3567
+ for (var r = n > 1 ? void 0 : n ? Ks(t, e) : t, s = i.length - 1, o; s >= 0; s--)
3620
3568
  (o = i[s]) && (r = o(r) || r);
3621
3569
  return r;
3622
- }, Vt = (i, t) => (e, n) => t(e, n, i), Or = (i, t, e) => lo(i, typeof t != "symbol" ? t + "" : t, e);
3623
- const ho = "SHEET_IMAGE_UI_PLUGIN";
3624
- let At = class extends Qr {
3625
- constructor(i = $n, t, e, n) {
3570
+ }, Lt = (i, t) => (e, n) => t(e, n, i), Dr = (i, t, e) => Js(i, typeof t != "symbol" ? t + "" : t, e);
3571
+ const qs = "SHEET_IMAGE_UI_PLUGIN";
3572
+ let Pt = class extends Vr {
3573
+ constructor(i = jn, t, e, n) {
3626
3574
  super(), this._config = i, this._injector = t, this._renderManagerService = e, this._configService = n;
3627
- const { menu: r, ...s } = ei(
3575
+ const { menu: r, ...s } = Hr(
3628
3576
  {},
3629
- $n,
3577
+ jn,
3630
3578
  this._config
3631
3579
  );
3632
- r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(cs, s);
3580
+ r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(es, s);
3633
3581
  }
3634
3582
  onStarting() {
3635
- ti(this._injector, [
3636
- [tt],
3637
- [Pt],
3638
- [Rt],
3583
+ zr(this._injector, [
3584
+ [et],
3639
3585
  [Ut],
3586
+ [Rt],
3640
3587
  [Ot],
3641
3588
  [Tt],
3589
+ [Et],
3590
+ [bt],
3642
3591
  [Mt],
3643
- [yt],
3644
- [Et]
3592
+ [yt]
3645
3593
  ]), Ft(this._injector, [
3646
- [tt]
3594
+ [et]
3647
3595
  ]);
3648
3596
  }
3649
3597
  onReady() {
3650
3598
  Ft(this._injector, [
3651
- [Tt],
3652
- [Et]
3599
+ [Et],
3600
+ [yt]
3653
3601
  ]);
3654
3602
  }
3655
3603
  onRendered() {
3656
3604
  this._registerRenderModules(), Ft(this._injector, [
3605
+ [Tt],
3657
3606
  [Ot],
3658
3607
  [Ut],
3659
- [Pt],
3660
- [Mt],
3661
- [yt]
3608
+ [bt],
3609
+ [Mt]
3662
3610
  ]);
3663
3611
  }
3664
3612
  onSteady() {
@@ -3666,38 +3614,38 @@ let At = class extends Qr {
3666
3614
  }
3667
3615
  _registerRenderModules() {
3668
3616
  [
3669
- [et],
3670
- [sn],
3671
- [nn],
3672
- [tn]
3617
+ [Qe],
3618
+ [rn],
3619
+ [tn],
3620
+ [en]
3673
3621
  ].forEach((i) => {
3674
- this.disposeWithMe(this._renderManagerService.registerRenderModule(x.UNIVER_SHEET, i));
3622
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(F.UNIVER_SHEET, i));
3675
3623
  });
3676
3624
  }
3677
3625
  };
3678
- Or(At, "type", x.UNIVER_SHEET);
3679
- Or(At, "pluginName", ho);
3680
- At = uo([
3681
- Jr(oi, ri, hi, pi),
3682
- Vt(1, A(Ye)),
3683
- Vt(2, J),
3684
- Vt(3, qr)
3685
- ], At);
3626
+ Dr(Pt, "type", F.UNIVER_SHEET);
3627
+ Dr(Pt, "pluginName", qs);
3628
+ Pt = Zs([
3629
+ Gr(Qr, Jr, si, di),
3630
+ Lt(1, A(Ye)),
3631
+ Lt(2, Z),
3632
+ Lt(3, Lr)
3633
+ ], Pt);
3686
3634
  export {
3687
- L as ClearSheetDrawingTransformerOperation,
3688
- yr as DeleteDrawingsCommand,
3689
- wr as EditSheetDrawingOperation,
3690
- _r as GroupSheetDrawingCommand,
3635
+ Y as ClearSheetDrawingTransformerOperation,
3636
+ Ir as DeleteDrawingsCommand,
3637
+ fr as EditSheetDrawingOperation,
3638
+ mr as GroupSheetDrawingCommand,
3691
3639
  Bt as InsertFloatImageCommand,
3692
- Wt as InsertSheetDrawingCommand,
3693
- it as MoveDrawingsCommand,
3694
- rt as RemoveSheetDrawingCommand,
3695
- Tr as SHEETS_IMAGE_MENU_ID,
3696
- vr as SetDrawingArrangeCommand,
3697
- jt as SetSheetDrawingCommand,
3698
- tt as SheetCanvasFloatDomManagerService,
3699
- et as SheetDrawingUpdateController,
3700
- pr as SidebarSheetDrawingOperation,
3701
- Sr as UngroupSheetDrawingCommand,
3702
- At as UniverSheetsDrawingUIPlugin
3640
+ kt as InsertSheetDrawingCommand,
3641
+ rt as MoveDrawingsCommand,
3642
+ nt as RemoveSheetDrawingCommand,
3643
+ Cr as SHEETS_IMAGE_MENU_ID,
3644
+ pr as SetDrawingArrangeCommand,
3645
+ Wt as SetSheetDrawingCommand,
3646
+ et as SheetCanvasFloatDomManagerService,
3647
+ Qe as SheetDrawingUpdateController,
3648
+ gr as SidebarSheetDrawingOperation,
3649
+ wr as UngroupSheetDrawingCommand,
3650
+ Pt as UniverSheetsDrawingUIPlugin
3703
3651
  };