@univerjs/sheets-drawing-ui 0.2.3 → 0.2.4-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -1,19 +1,17 @@
1
- var Qt = Object.defineProperty;
2
- var en = (i, e, n) => e in i ? Qt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
- var X = (i, e, n) => en(i, typeof e != "symbol" ? e + "" : e, n);
4
- import { CommandType as F, ICommandService as V, IUndoRedoService as ge, LocaleService as _e, IUniverInstanceService as he, RxDisposable as tn, UniverInstanceType as B, toDisposable as nn, FOCUSING_COMMON_DRAWINGS as we, OnLifecycle as se, LifecycleStages as oe, IContextService as wt, Disposable as ae, Direction as q, FOCUSING_FORMULA_EDITOR as rn, EDITOR_ACTIVATED as sn, Rectangle as on, DrawingTypeEnum as Ye, DisposableCollection as an, Tools as re, UserManagerService as cn, IPermissionService as dn, Plugin as ln, DependentOn as un } from "@univerjs/core";
5
- import { Inject as W, Injector as nt } from "@wendellhu/redi";
6
- import { ImageCropperObject as gn, COMPONENT_IMAGE_POPUP_MENU as hn, OpenImageCropOperation as mn, ImageResetSizeOperation as fn, DrawingCommonPanel as pn, DrawingRenderService as wn, UniverDrawingUIPlugin as _n } from "@univerjs/drawing-ui";
7
- import { ISheetDrawingService as H, SetDrawingApplyMutation as E, DrawingApplyType as y, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as vn } from "@univerjs/sheets-drawing";
8
- import { IDrawingManagerService as z, IImageIoService as _t, ArrangeTypeEnum as Ce, DrawingTypeEnum as Ve, DRAWING_IMAGE_COUNT_LIMIT as ct, ImageUploadStatusType as He, DRAWING_IMAGE_ALLOW_SIZE as Sn, getImageSize as Cn, DRAWING_IMAGE_WIDTH_LIMIT as dt, DRAWING_IMAGE_HEIGHT_LIMIT as lt, DRAWING_IMAGE_ALLOW_IMAGE_LIST as In, getDrawingShapeKeyByDrawingSearch as Rn, UniverDrawingPlugin as Mn } from "@univerjs/drawing";
9
- import { IRenderManagerService as K, getGroupState as Dn, transformObjectOutOfGroup as bn, precisionTo as Q, Rect as En, DRAWING_OBJECT_LAYER_INDEX as yn, SHEET_VIEWPORT_KEY as On, RENDER_CLASS_TYPE as ce } from "@univerjs/engine-render";
10
- import { SheetCanvasPopManagerService as Tn, ISheetSelectionRenderService as Ge, SheetSkeletonManagerService as ie, attachRangeWithCoord as Pn, getCurrentRangeDisable$ as Un, SetScrollOperation as An, SetZoomRatioOperation as Nn, SheetPrintInterceptorService as jn, COPY_TYPE as ut, PREDEFINED_HOOK_NAME as Ie, virtualizeDiscreteRanges as Ln, ISheetClipboardService as Bn } from "@univerjs/sheets-ui";
11
- import { takeUntil as gt, Subject as ht, BehaviorSubject as Wn, combineLatest as Re, map as mt, filter as Me, distinctUntilChanged as De } from "rxjs";
12
- import { ISidebarService as $n, BuiltInUIPart as Vn, IUIPartsService as Gn, IMessageService as xn, MenuItemType as vt, MenuPosition as Fn, MenuGroup as Yn, getMenuHiddenObservable as St, KeyCode as ue, ComponentManager as Hn, IMenuService as Xn, IShortcutService as kn, CanvasFloatDomService as zn } from "@univerjs/ui";
13
- import { useDependency as ee, connectInjector as Kn } from "@wendellhu/redi/react-bindings";
14
- import { getSheetCommandTarget as le, SheetsSelectionsService as Jn, WorkbookEditablePermission as Ze, WorksheetEditPermission as Te, RangeProtectionPermissionEditPoint as Zn, InsertRowCommand as Ct, InsertColCommand as It, RemoveRowCommand as Rt, RemoveColCommand as Mt, DeleteRangeMoveLeftCommand as Dt, DeleteRangeMoveUpCommand as bt, InsertRangeMoveDownCommand as Et, InsertRangeMoveRightCommand as yt, DeltaRowHeightCommand as qe, SetRowHeightCommand as Qe, DeltaColumnWidthCommand as Ot, SetColWidthCommand as Tt, SetRowHiddenCommand as Pt, SetSpecificRowsVisibleCommand as Ut, SetSpecificColsVisibleCommand as At, SetColHiddenCommand as Nt, SetRowVisibleMutation as qn, SetRowHiddenMutation as Qn, SetColVisibleMutation as er, SetColHiddenMutation as tr, SetWorksheetRowHeightMutation as nr, SetWorksheetColWidthMutation as rr, SetWorksheetActiveOperation as ir, SheetInterceptorService as sr, SetFrozenMutation as or, WorkbookViewPermission as ft, WorksheetViewPermission as Xe } from "@univerjs/sheets";
15
- import L, { useEffect as rt, forwardRef as jt, useRef as Lt, createElement as Bt, useState as et } from "react";
16
- import { MessageType as be, RadioGroup as ar, Radio as ke } from "@univerjs/design";
1
+ var en = Object.defineProperty;
2
+ var tn = (i, e, n) => e in i ? en(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
+ var H = (i, e, n) => tn(i, typeof e != "symbol" ? e + "" : e, n);
4
+ import { CommandType as F, ICommandService as V, IUndoRedoService as ge, LocaleService as _e, IUniverInstanceService as he, useDependency as q, RxDisposable as nn, UniverInstanceType as B, connectInjector as rn, toDisposable as sn, FOCUSING_COMMON_DRAWINGS as we, OnLifecycle as ie, LifecycleStages as se, Inject as W, Injector as nt, IContextService as _t, Disposable as oe, Direction as Q, FOCUSING_FORMULA_EDITOR as on, EDITOR_ACTIVATED as an, Rectangle as cn, DrawingTypeEnum as Ye, DisposableCollection as dn, Tools as ne, UserManagerService as ln, IPermissionService as un, Plugin as gn, DependentOn as hn } from "@univerjs/core";
5
+ import { ImageCropperObject as mn, COMPONENT_IMAGE_POPUP_MENU as fn, OpenImageCropOperation as pn, ImageResetSizeOperation as wn, DrawingCommonPanel as _n, DrawingRenderService as vn, UniverDrawingUIPlugin as Sn } from "@univerjs/drawing-ui";
6
+ import { ISheetDrawingService as k, SetDrawingApplyMutation as E, DrawingApplyType as y, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as Cn } from "@univerjs/sheets-drawing";
7
+ import { IDrawingManagerService as z, IImageIoService as vt, ArrangeTypeEnum as Ce, DrawingTypeEnum as Ve, DRAWING_IMAGE_COUNT_LIMIT as dt, ImageUploadStatusType as ke, DRAWING_IMAGE_ALLOW_SIZE as In, getImageSize as Rn, DRAWING_IMAGE_WIDTH_LIMIT as lt, DRAWING_IMAGE_HEIGHT_LIMIT as ut, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Mn, getDrawingShapeKeyByDrawingSearch as Dn, UniverDrawingPlugin as bn } from "@univerjs/drawing";
8
+ import { IRenderManagerService as K, getGroupState as En, transformObjectOutOfGroup as yn, precisionTo as ee, Rect as On, DRAWING_OBJECT_LAYER_INDEX as Pn, SHEET_VIEWPORT_KEY as Tn, RENDER_CLASS_TYPE as ae } from "@univerjs/engine-render";
9
+ import { SheetCanvasPopManagerService as Un, ISheetSelectionRenderService as Ge, SheetSkeletonManagerService as re, attachRangeWithCoord as An, getCurrentRangeDisable$ as Nn, SetScrollOperation as jn, SetZoomRatioOperation as Ln, SheetPrintInterceptorService as Bn, COPY_TYPE as gt, PREDEFINED_HOOK_NAME as Ie, virtualizeDiscreteRanges as Wn, ISheetClipboardService as $n } from "@univerjs/sheets-ui";
10
+ import { takeUntil as ht, Subject as mt, BehaviorSubject as Vn, combineLatest as Re, map as ft, filter as Me, distinctUntilChanged as De } from "rxjs";
11
+ import { ISidebarService as Gn, BuiltInUIPart as xn, IUIPartsService as Fn, IMessageService as Yn, MenuItemType as St, MenuPosition as kn, MenuGroup as Hn, getMenuHiddenObservable as Ct, KeyCode as ue, ComponentManager as Xn, IMenuService as zn, IShortcutService as Kn, CanvasFloatDomService as Jn } from "@univerjs/ui";
12
+ import { getSheetCommandTarget as le, SheetsSelectionsService as Zn, WorkbookEditablePermission as Ze, WorksheetEditPermission as Pe, RangeProtectionPermissionEditPoint as qn, InsertRowCommand as It, InsertColCommand as Rt, RemoveRowCommand as Mt, RemoveColCommand as Dt, DeleteRangeMoveLeftCommand as bt, DeleteRangeMoveUpCommand as Et, InsertRangeMoveDownCommand as yt, InsertRangeMoveRightCommand as Ot, DeltaRowHeightCommand as qe, SetRowHeightCommand as Qe, DeltaColumnWidthCommand as Pt, SetColWidthCommand as Tt, SetRowHiddenCommand as Ut, SetSpecificRowsVisibleCommand as At, SetSpecificColsVisibleCommand as Nt, SetColHiddenCommand as jt, SetRowVisibleMutation as Qn, SetRowHiddenMutation as er, SetColVisibleMutation as tr, SetColHiddenMutation as nr, SetWorksheetRowHeightMutation as rr, SetWorksheetColWidthMutation as ir, SetWorksheetActiveOperation as sr, SheetInterceptorService as or, SetFrozenMutation as ar, WorkbookViewPermission as pt, WorksheetViewPermission as He } from "@univerjs/sheets";
13
+ import L, { useEffect as rt, forwardRef as Lt, useRef as Bt, createElement as Wt, useState as et } from "react";
14
+ import { MessageType as be, RadioGroup as cr, Radio as Xe } from "@univerjs/design";
17
15
  import Ee from "clsx";
18
16
  const j = {
19
17
  id: "sheet.operation.clear-drawing-transformer",
@@ -29,37 +27,37 @@ const j = {
29
27
  id: "sheet.command.remove-sheet-image",
30
28
  type: F.COMMAND,
31
29
  handler: (i, e) => {
32
- const n = i.get(V), t = i.get(ge), r = i.get(H);
30
+ const n = i.get(V), t = i.get(ge), r = i.get(k);
33
31
  if (!e) return !1;
34
32
  const { drawings: s } = e, o = [];
35
33
  s.forEach((f) => {
36
34
  const { unitId: m } = f;
37
35
  o.push(m);
38
36
  });
39
- const a = r.getBatchRemoveOp(s), { unitId: d, subUnitId: h, undo: l, redo: c, objects: g } = a;
40
- return n.syncExecuteCommand(E.id, { unitId: d, subUnitId: h, op: c, objects: g, type: y.REMOVE }) ? (t.pushUndoRedo({
37
+ const a = r.getBatchRemoveOp(s), { unitId: d, subUnitId: h, undo: l, redo: c, objects: u } = a;
38
+ return n.syncExecuteCommand(E.id, { unitId: d, subUnitId: h, op: c, objects: u, type: y.REMOVE }) ? (t.pushUndoRedo({
41
39
  unitID: d,
42
40
  undoMutations: [
43
- { id: E.id, params: { unitId: d, subUnitId: h, op: l, objects: g, type: y.INSERT } },
41
+ { id: E.id, params: { unitId: d, subUnitId: h, op: l, objects: u, type: y.INSERT } },
44
42
  { id: j.id, params: o }
45
43
  ],
46
44
  redoMutations: [
47
- { id: E.id, params: { unitId: d, subUnitId: h, op: c, objects: g, type: y.REMOVE } },
45
+ { id: E.id, params: { unitId: d, subUnitId: h, op: c, objects: u, type: y.REMOVE } },
48
46
  { id: j.id, params: o }
49
47
  ]
50
48
  }), !0) : !1;
51
49
  }
52
- }, Wt = "COMPONENT_SHEET_DRAWING_PANEL", $t = {
50
+ }, $t = "COMPONENT_SHEET_DRAWING_PANEL", Vt = {
53
51
  id: "sidebar.operation.sheet-image",
54
52
  type: F.COMMAND,
55
53
  handler: async (i, e) => {
56
- const n = i.get($n), t = i.get(_e), r = i.get(he), s = i.get(z);
54
+ const n = i.get(Gn), t = i.get(_e), r = i.get(he), s = i.get(z);
57
55
  if (!le(r)) return !1;
58
56
  switch (e.value) {
59
57
  case "open":
60
58
  n.open({
61
59
  header: { title: t.t("sheetImage.panel.title") },
62
- children: { label: Wt },
60
+ children: { label: $t },
63
61
  onClose: () => {
64
62
  s.focusDrawing(null);
65
63
  },
@@ -73,21 +71,21 @@ const j = {
73
71
  }
74
72
  return !0;
75
73
  }
76
- }, Vt = {
74
+ }, Gt = {
77
75
  id: "sheet.operation.edit-sheet-image",
78
76
  type: F.OPERATION,
79
77
  handler: (i, e) => {
80
78
  const n = i.get(z), t = i.get(V);
81
- return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand($t.id, { value: "open" }), !0);
82
- }
83
- }, cr = "univer-upload-loading", dr = "univer-upload-loading-body", lr = "univer-upload-loading-body-animation", ur = "univer-UniverCircleAnimation", gr = "univer-upload-loading-body-text", ye = {
84
- uploadLoading: cr,
85
- uploadLoadingBody: dr,
86
- uploadLoadingBodyAnimation: lr,
87
- univerCircleAnimation: ur,
88
- uploadLoadingBodyText: gr
89
- }, hr = () => {
90
- const i = ee(_t), e = ee(_e), [n, t] = L.useState(0);
79
+ return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(Vt.id, { value: "open" }), !0);
80
+ }
81
+ }, dr = "univer-upload-loading", lr = "univer-upload-loading-body", ur = "univer-upload-loading-body-animation", gr = "univer-UniverCircleAnimation", hr = "univer-upload-loading-body-text", ye = {
82
+ uploadLoading: dr,
83
+ uploadLoadingBody: lr,
84
+ uploadLoadingBodyAnimation: ur,
85
+ univerCircleAnimation: gr,
86
+ uploadLoadingBodyText: hr
87
+ }, mr = () => {
88
+ const i = q(vt), e = q(_e), [n, t] = L.useState(0);
91
89
  return rt(() => {
92
90
  const r = i.change$.subscribe((s) => {
93
91
  t(s);
@@ -97,19 +95,19 @@ const j = {
97
95
  };
98
96
  }, [i]), /* @__PURE__ */ L.createElement("div", { style: { display: n > 0 ? "block" : "none" }, className: ye.uploadLoading }, /* @__PURE__ */ L.createElement("div", { className: ye.uploadLoadingBody }, /* @__PURE__ */ L.createElement("div", { className: ye.uploadLoadingBodyAnimation }), /* @__PURE__ */ L.createElement("div", { className: ye.uploadLoadingBodyText }, `${e.t("uploadLoading.loading")}: ${n}`)));
99
97
  };
100
- var mr = Object.defineProperty, fr = Object.getOwnPropertyDescriptor, pr = (i, e, n, t) => {
101
- for (var r = t > 1 ? void 0 : t ? fr(e, n) : e, s = i.length - 1, o; s >= 0; s--)
98
+ var fr = Object.defineProperty, pr = Object.getOwnPropertyDescriptor, wr = (i, e, n, t) => {
99
+ for (var r = t > 1 ? void 0 : t ? pr(e, n) : e, s = i.length - 1, o; s >= 0; s--)
102
100
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
103
- return t && r && mr(e, n, r), r;
101
+ return t && r && fr(e, n, r), r;
104
102
  }, te = (i, e) => (n, t) => e(n, t, i);
105
- let Pe = class extends tn {
103
+ let Te = class extends nn {
106
104
  constructor(e, n, t, r, s, o, a) {
107
105
  super();
108
- X(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
106
+ H(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
109
107
  this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = a, this._init();
110
108
  }
111
109
  _init() {
112
- this._univerInstanceService.getCurrentTypeOfUnit$(B.UNIVER_SHEET).pipe(gt(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(B.UNIVER_SHEET).pipe(gt(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(B.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(Vn.CONTENT, () => Kn(hr, this._injector));
110
+ this._univerInstanceService.getCurrentTypeOfUnit$(B.UNIVER_SHEET).pipe(ht(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(B.UNIVER_SHEET).pipe(ht(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(B.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(xn.CONTENT, () => rn(mr, this._injector));
113
111
  }
114
112
  _dispose(e) {
115
113
  const n = e.getUnitId();
@@ -124,7 +122,7 @@ let Pe = class extends tn {
124
122
  _hasCropObject(e) {
125
123
  const n = e.getAllObjects();
126
124
  for (const t of n)
127
- if (t instanceof gn)
125
+ if (t instanceof mn)
128
126
  return !0;
129
127
  return !1;
130
128
  }
@@ -138,7 +136,7 @@ let Pe = class extends tn {
138
136
  return;
139
137
  let r;
140
138
  this.disposeWithMe(
141
- nn(
139
+ sn(
142
140
  t.createControl$.subscribe(() => {
143
141
  if (this._contextService.setContextValue(we, !0), this._hasCropObject(n))
144
142
  return;
@@ -153,18 +151,18 @@ let Pe = class extends tn {
153
151
  const d = a.oKey, h = this._drawingManagerService.getDrawingOKey(d);
154
152
  if (!h)
155
153
  return;
156
- const { unitId: l, subUnitId: c, drawingId: g } = h;
154
+ const { unitId: l, subUnitId: c, drawingId: u } = h;
157
155
  r == null || r.dispose(), r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
158
- componentKey: hn,
156
+ componentKey: fn,
159
157
  direction: "horizontal",
160
158
  offset: [2, 0],
161
159
  extraProps: {
162
- menuItems: this._getImageMenuItems(l, c, g)
160
+ menuItems: this._getImageMenuItems(l, c, u)
163
161
  }
164
162
  })), this._drawingManagerService.focusDrawing([{
165
163
  unitId: l,
166
164
  subUnitId: c,
167
- drawingId: g
165
+ drawingId: u
168
166
  }]);
169
167
  })
170
168
  )
@@ -183,7 +181,7 @@ let Pe = class extends tn {
183
181
  {
184
182
  label: "image-popup.edit",
185
183
  index: 0,
186
- commandId: Vt.id,
184
+ commandId: Gt.id,
187
185
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
188
186
  disable: !1
189
187
  },
@@ -197,30 +195,30 @@ let Pe = class extends tn {
197
195
  {
198
196
  label: "image-popup.crop",
199
197
  index: 2,
200
- commandId: mn.id,
198
+ commandId: pn.id,
201
199
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
202
200
  disable: !1
203
201
  },
204
202
  {
205
203
  label: "image-popup.reset",
206
204
  index: 3,
207
- commandId: fn.id,
205
+ commandId: wn.id,
208
206
  commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
209
207
  disable: !1
210
208
  }
211
209
  ];
212
210
  }
213
211
  };
214
- Pe = pr([
215
- se(oe.Steady, Pe),
212
+ Te = wr([
213
+ ie(se.Steady, Te),
216
214
  te(0, W(nt)),
217
215
  te(1, z),
218
- te(2, W(Tn)),
216
+ te(2, W(Un)),
219
217
  te(3, K),
220
218
  te(4, he),
221
- te(5, wt),
222
- te(6, W(Gn))
223
- ], Pe);
219
+ te(5, _t),
220
+ te(6, W(Fn))
221
+ ], Te);
224
222
  const xe = {
225
223
  id: "sheet.operation.insert-float-image",
226
224
  type: F.OPERATION,
@@ -233,17 +231,17 @@ const xe = {
233
231
  id: "sheet.command.insert-sheet-image",
234
232
  type: F.COMMAND,
235
233
  handler: (i, e) => {
236
- const n = i.get(V), t = i.get(ge), r = i.get(H);
234
+ const n = i.get(V), t = i.get(ge), r = i.get(k);
237
235
  if (!e) return !1;
238
- const s = e.drawings, o = s.map((f) => f.unitId), a = r.getBatchAddOp(s), { unitId: d, subUnitId: h, undo: l, redo: c, objects: g } = a;
239
- return n.syncExecuteCommand(E.id, { op: c, unitId: d, subUnitId: h, objects: g, type: y.INSERT }) ? (t.pushUndoRedo({
236
+ const s = e.drawings, o = s.map((f) => f.unitId), a = r.getBatchAddOp(s), { unitId: d, subUnitId: h, undo: l, redo: c, objects: u } = a;
237
+ return n.syncExecuteCommand(E.id, { op: c, unitId: d, subUnitId: h, objects: u, type: y.INSERT }) ? (t.pushUndoRedo({
240
238
  unitID: d,
241
239
  undoMutations: [
242
- { id: E.id, params: { op: l, unitId: d, subUnitId: h, objects: g, type: y.REMOVE } },
240
+ { id: E.id, params: { op: l, unitId: d, subUnitId: h, objects: u, type: y.REMOVE } },
243
241
  { id: j.id, params: o }
244
242
  ],
245
243
  redoMutations: [
246
- { id: E.id, params: { op: c, unitId: d, subUnitId: h, objects: g, type: y.INSERT } },
244
+ { id: E.id, params: { op: c, unitId: d, subUnitId: h, objects: u, type: y.INSERT } },
247
245
  { id: j.id, params: o }
248
246
  ]
249
247
  }), !0) : !1;
@@ -252,7 +250,7 @@ const xe = {
252
250
  id: "sheet.command.set-sheet-image",
253
251
  type: F.COMMAND,
254
252
  handler: (i, e) => {
255
- const n = i.get(V), t = i.get(ge), r = i.get(H);
253
+ const n = i.get(V), t = i.get(ge), r = i.get(k);
256
254
  if (!e) return !1;
257
255
  const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: d, undo: h, redo: l, objects: c } = o;
258
256
  return n.syncExecuteCommand(E.id, { unitId: a, subUnitId: d, op: l, objects: c, type: y.UPDATE }) ? (t.pushUndoRedo({
@@ -267,41 +265,41 @@ const xe = {
267
265
  ]
268
266
  }), !0) : !1;
269
267
  }
270
- }, Gt = {
268
+ }, xt = {
271
269
  id: "sheet.command.set-drawing-arrange",
272
270
  type: F.COMMAND,
273
271
  handler: (i, e) => {
274
272
  const n = i.get(V), t = i.get(ge);
275
273
  if (!e) return !1;
276
- const r = i.get(H), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = e, h = { unitId: s, subUnitId: o, drawingIds: a };
274
+ const r = i.get(k), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = e, h = { unitId: s, subUnitId: o, drawingIds: a };
277
275
  let l;
278
276
  if (d === Ce.forward ? l = r.getForwardDrawingsOp(h) : d === Ce.backward ? l = r.getBackwardDrawingOp(h) : d === Ce.front ? l = r.getFrontDrawingsOp(h) : d === Ce.back && (l = r.getBackDrawingsOp(h)), l == null)
279
277
  return !1;
280
- const { objects: c, redo: g, undo: u } = l;
281
- return n.syncExecuteCommand(E.id, { op: g, unitId: s, subUnitId: o, objects: c, type: y.ARRANGE }) ? (t.pushUndoRedo({
278
+ const { objects: c, redo: u, undo: g } = l;
279
+ return n.syncExecuteCommand(E.id, { op: u, unitId: s, subUnitId: o, objects: c, type: y.ARRANGE }) ? (t.pushUndoRedo({
282
280
  unitID: s,
283
281
  undoMutations: [
284
- { id: E.id, params: { op: u, unitId: s, subUnitId: o, objects: c, type: y.ARRANGE } }
282
+ { id: E.id, params: { op: g, unitId: s, subUnitId: o, objects: c, type: y.ARRANGE } }
285
283
  ],
286
284
  redoMutations: [
287
- { id: E.id, params: { op: g, unitId: s, subUnitId: o, objects: c, type: y.ARRANGE } }
285
+ { id: E.id, params: { op: u, unitId: s, subUnitId: o, objects: c, type: y.ARRANGE } }
288
286
  ]
289
287
  }), !0) : !1;
290
288
  }
291
289
  };
292
- function wr(i) {
290
+ function _r(i) {
293
291
  const e = [];
294
292
  return i.forEach((n) => {
295
- const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: a } = t, d = Dn(0, 0, r.map((c) => c.transform || {})), h = r.map((c) => {
296
- const g = c.transform || { left: 0, top: 0 }, { unitId: u, subUnitId: f, drawingId: m } = c;
293
+ const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: a } = t, d = En(0, 0, r.map((c) => c.transform || {})), h = r.map((c) => {
294
+ const u = c.transform || { left: 0, top: 0 }, { unitId: g, subUnitId: f, drawingId: m } = c;
297
295
  return {
298
- unitId: u,
296
+ unitId: g,
299
297
  subUnitId: f,
300
298
  drawingId: m,
301
299
  transform: {
302
- ...g,
303
- left: g.left - d.left,
304
- top: g.top - d.top
300
+ ...u,
301
+ left: u.left - d.left,
302
+ top: u.top - d.top
305
303
  },
306
304
  groupId: a
307
305
  };
@@ -318,16 +316,16 @@ function wr(i) {
318
316
  });
319
317
  }), e;
320
318
  }
321
- function _r(i) {
319
+ function vr(i) {
322
320
  const e = [];
323
321
  return i.forEach((n) => {
324
322
  const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: a, transform: d = { width: 0, height: 0 } } = t;
325
323
  if (d == null)
326
324
  return;
327
325
  const h = r.map((c) => {
328
- const { transform: g } = c, { unitId: u, subUnitId: f, drawingId: m } = c, p = bn(g || {}, d, d.width || 0, d.height || 0);
326
+ const { transform: u } = c, { unitId: g, subUnitId: f, drawingId: m } = c, p = yn(u || {}, d, d.width || 0, d.height || 0);
329
327
  return {
330
- unitId: u,
328
+ unitId: g,
331
329
  subUnitId: f,
332
330
  drawingId: m,
333
331
  transform: p,
@@ -349,15 +347,15 @@ function _r(i) {
349
347
  });
350
348
  }), e;
351
349
  }
352
- const xt = {
350
+ const Ft = {
353
351
  id: "sheet.command.group-sheet-image",
354
352
  type: F.COMMAND,
355
353
  handler: (i, e) => {
356
- const n = i.get(V), t = i.get(ge), r = i.get(H);
354
+ const n = i.get(V), t = i.get(ge), r = i.get(k);
357
355
  if (!e) return !1;
358
356
  const s = [];
359
- e.forEach(({ parent: u, children: f }) => {
360
- s.push(u.unitId), f.forEach((m) => {
357
+ e.forEach(({ parent: g, children: f }) => {
358
+ s.push(g.unitId), f.forEach((m) => {
361
359
  s.push(m.unitId);
362
360
  });
363
361
  });
@@ -365,7 +363,7 @@ const xt = {
365
363
  return n.syncExecuteCommand(E.id, { op: l, unitId: a, subUnitId: d, objects: c, type: y.GROUP }) ? (t.pushUndoRedo({
366
364
  unitID: a,
367
365
  undoMutations: [
368
- { id: E.id, params: { op: h, unitId: a, subUnitId: d, objects: _r(c), type: y.UNGROUP } },
366
+ { id: E.id, params: { op: h, unitId: a, subUnitId: d, objects: vr(c), type: y.UNGROUP } },
369
367
  { id: j.id, params: s }
370
368
  ],
371
369
  redoMutations: [
@@ -374,15 +372,15 @@ const xt = {
374
372
  ]
375
373
  }), !0) : !1;
376
374
  }
377
- }, Ft = {
375
+ }, Yt = {
378
376
  id: "sheet.command.ungroup-sheet-image",
379
377
  type: F.COMMAND,
380
378
  handler: (i, e) => {
381
- const n = i.get(V), t = i.get(ge), r = i.get(H);
379
+ const n = i.get(V), t = i.get(ge), r = i.get(k);
382
380
  if (!e) return !1;
383
381
  const s = [];
384
- e.forEach(({ parent: u, children: f }) => {
385
- s.push(u.unitId), f.forEach((m) => {
382
+ e.forEach(({ parent: g, children: f }) => {
383
+ s.push(g.unitId), f.forEach((m) => {
386
384
  s.push(m.unitId);
387
385
  });
388
386
  });
@@ -390,7 +388,7 @@ const xt = {
390
388
  return n.syncExecuteCommand(E.id, { op: l, unitId: a, subUnitId: d, objects: c, type: y.UNGROUP }) ? (t.pushUndoRedo({
391
389
  unitID: a,
392
390
  undoMutations: [
393
- { id: E.id, params: { op: h, unitId: a, subUnitId: d, objects: wr(c), type: y.GROUP } },
391
+ { id: E.id, params: { op: h, unitId: a, subUnitId: d, objects: _r(c), type: y.GROUP } },
394
392
  { id: j.id, params: s }
395
393
  ],
396
394
  redoMutations: [
@@ -401,11 +399,11 @@ const xt = {
401
399
  }
402
400
  };
403
401
  function $(i, e, n) {
404
- const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: d = 0, skewY: h = 0 } = i, { column: l, columnOffset: c, row: g, rowOffset: u } = t, { column: f, columnOffset: m, row: p, rowOffset: S } = r, C = n.attachRangeWithCoord({
402
+ const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: d = 0, skewY: h = 0 } = i, { column: l, columnOffset: c, row: u, rowOffset: g } = t, { column: f, columnOffset: m, row: p, rowOffset: S } = r, C = n.attachRangeWithCoord({
405
403
  startColumn: l,
406
404
  endColumn: l,
407
- startRow: g,
408
- endRow: g
405
+ startRow: u,
406
+ endRow: u
409
407
  });
410
408
  if (C == null)
411
409
  return;
@@ -418,18 +416,18 @@ function $(i, e, n) {
418
416
  if (v == null)
419
417
  return;
420
418
  const { startX: R, startY: _ } = C, { startX: b, startY: w } = v;
421
- let T = Q(R + c, 1), D = Q(_ + u, 1), P = Q(b + m - T, 1), U = Q(w + S - D, 1);
422
- C.startX === v.endX && (P = 0), C.startY === v.endY && (U = 0);
419
+ let P = ee(R + c, 1), D = ee(_ + g, 1), T = ee(b + m - P, 1), U = ee(w + S - D, 1);
420
+ C.startX === v.endX && (T = 0), C.startY === v.endY && (U = 0);
423
421
  const M = n.getCurrentSkeleton(), I = M.rowHeaderWidth + M.columnTotalWidth, A = M.columnHeaderHeight + M.rowTotalHeight;
424
- return T + P > I && (T = I - P), D + U > A && (D = A - U), {
422
+ return P + T > I && (P = I - T), D + U > A && (D = A - U), {
425
423
  flipY: s,
426
424
  flipX: o,
427
425
  angle: a,
428
426
  skewX: d,
429
427
  skewY: h,
430
- left: T,
428
+ left: P,
431
429
  top: D,
432
- width: P,
430
+ width: T,
433
431
  height: U
434
432
  };
435
433
  }
@@ -437,19 +435,19 @@ function N(i, e) {
437
435
  const { left: n = 0, top: t = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: a = !1, angle: d = 0, skewX: h = 0, skewY: l = 0 } = i, c = e.getSelectionCellByPosition(n, t);
438
436
  if (c == null)
439
437
  return;
440
- const g = {
438
+ const u = {
441
439
  column: c.actualColumn,
442
- columnOffset: Q(n - c.startX, 1),
440
+ columnOffset: ee(n - c.startX, 1),
443
441
  row: c.actualRow,
444
- rowOffset: Q(t - c.startY, 1)
445
- }, u = e.getSelectionCellByPosition(n + r, t + s);
446
- if (u == null)
442
+ rowOffset: ee(t - c.startY, 1)
443
+ }, g = e.getSelectionCellByPosition(n + r, t + s);
444
+ if (g == null)
447
445
  return;
448
446
  const f = {
449
- column: u.actualColumn,
450
- columnOffset: Q(n + r - u.startX, 1),
451
- row: u.actualRow,
452
- rowOffset: Q(t + s - u.startY, 1)
447
+ column: g.actualColumn,
448
+ columnOffset: ee(n + r - g.startX, 1),
449
+ row: g.actualRow,
450
+ rowOffset: ee(t + s - g.startY, 1)
453
451
  };
454
452
  return {
455
453
  flipY: o,
@@ -457,16 +455,16 @@ function N(i, e) {
457
455
  angle: d,
458
456
  skewX: h,
459
457
  skewY: l,
460
- from: g,
458
+ from: u,
461
459
  to: f
462
460
  };
463
461
  }
464
- var vr = Object.defineProperty, Sr = Object.getOwnPropertyDescriptor, Cr = (i, e, n, t) => {
465
- for (var r = t > 1 ? void 0 : t ? Sr(e, n) : e, s = i.length - 1, o; s >= 0; s--)
462
+ var Sr = Object.defineProperty, Cr = Object.getOwnPropertyDescriptor, Ir = (i, e, n, t) => {
463
+ for (var r = t > 1 ? void 0 : t ? Cr(e, n) : e, s = i.length - 1, o; s >= 0; s--)
466
464
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
467
- return t && r && vr(e, n, r), r;
468
- }, k = (i, e) => (n, t) => e(n, t, i);
469
- let Ue = class extends ae {
465
+ return t && r && Sr(e, n, r), r;
466
+ }, X = (i, e) => (n, t) => e(n, t, i);
467
+ let Ue = class extends oe {
470
468
  constructor(i, e, n, t, r, s, o, a, d, h) {
471
469
  super(), this._commandService = i, this._univerInstanceService = e, this._selectionManagerService = n, this._imageIoService = t, this._sheetDrawingService = r, this._drawingManagerService = s, this._contextService = o, this._messageService = a, this._localeService = d, this._renderManagerService = h, this._init();
472
470
  }
@@ -480,7 +478,7 @@ let Ue = class extends ae {
480
478
  get _skeletonManagerService() {
481
479
  return this._renderManagerService.getRenderById(
482
480
  this._univerInstanceService.getCurrentUnitForType(B.UNIVER_SHEET).getUnitId()
483
- ).with(ie);
481
+ ).with(re);
484
482
  }
485
483
  _init() {
486
484
  this._initCommandListeners(), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener(), this._drawingAddListener();
@@ -496,10 +494,10 @@ let Ue = class extends ae {
496
494
  if (e.files == null)
497
495
  return;
498
496
  const n = e.files.length;
499
- if (n > ct) {
497
+ if (n > dt) {
500
498
  this._messageService.show({
501
499
  type: be.Error,
502
- content: this._localeService.t("update-status.exceedMaxCount", String(ct))
500
+ content: this._localeService.t("update-status.exceedMaxCount", String(dt))
503
501
  });
504
502
  return;
505
503
  }
@@ -520,13 +518,13 @@ let Ue = class extends ae {
520
518
  e = await this._imageIoService.saveImage(i);
521
519
  } catch (C) {
522
520
  const v = C.message;
523
- v === He.ERROR_EXCEED_SIZE ? this._messageService.show({
521
+ v === ke.ERROR_EXCEED_SIZE ? this._messageService.show({
524
522
  type: be.Error,
525
- content: this._localeService.t("update-status.exceedMaxSize", String(Sn / (1024 * 1024)))
526
- }) : v === He.ERROR_IMAGE_TYPE ? this._messageService.show({
523
+ content: this._localeService.t("update-status.exceedMaxSize", String(In / (1024 * 1024)))
524
+ }) : v === ke.ERROR_IMAGE_TYPE ? this._messageService.show({
527
525
  type: be.Error,
528
526
  content: this._localeService.t("update-status.invalidImageType")
529
- }) : v === He.ERROR_IMAGE && this._messageService.show({
527
+ }) : v === ke.ERROR_IMAGE && this._messageService.show({
530
528
  type: be.Error,
531
529
  content: this._localeService.t("update-status.invalidImage")
532
530
  });
@@ -536,17 +534,17 @@ let Ue = class extends ae {
536
534
  const n = this._getUnitInfo();
537
535
  if (n == null)
538
536
  return;
539
- const { unitId: t, subUnitId: r } = n, { imageId: s, imageSourceType: o, source: a, base64Cache: d } = e, { width: h, height: l, image: c } = await Cn(d || ""), g = this._renderManagerService.getRenderById(t);
540
- if (g == null)
537
+ const { unitId: t, subUnitId: r } = n, { imageId: s, imageSourceType: o, source: a, base64Cache: d } = e, { width: h, height: l, image: c } = await Rn(d || ""), u = this._renderManagerService.getRenderById(t);
538
+ if (u == null)
541
539
  return;
542
- const { width: u, height: f } = g.scene;
540
+ const { width: g, height: f } = u.scene;
543
541
  this._imageIoService.addImageSourceCache(a, o, c);
544
542
  let m = 1;
545
- if (h > dt || l > lt) {
546
- const C = dt / h, v = lt / l;
543
+ if (h > lt || l > ut) {
544
+ const C = lt / h, v = ut / l;
547
545
  m = Math.max(C, v);
548
546
  }
549
- const p = this._getImagePosition(h * m, l * m, u, f);
547
+ const p = this._getImagePosition(h * m, l * m, g, f);
550
548
  if (p == null)
551
549
  return;
552
550
  const S = {
@@ -586,7 +584,7 @@ let Ue = class extends ae {
586
584
  endColumn: 0
587
585
  };
588
586
  r && r.length > 0 && (s = r[r.length - 1].range);
589
- const o = Pn(this._skeletonManagerService.getCurrent().skeleton, s);
587
+ const o = An(this._skeletonManagerService.getCurrent().skeleton, s);
590
588
  if (o == null)
591
589
  return;
592
590
  let { startColumn: a, startRow: d, startX: h, startY: l } = o, c = !1;
@@ -596,29 +594,29 @@ let Ue = class extends ae {
596
594
  return;
597
595
  h = m.startX, l = m.startY, a = m.actualColumn, d = m.actualRow;
598
596
  }
599
- const g = {
597
+ const u = {
600
598
  column: a,
601
599
  columnOffset: 0,
602
600
  row: d,
603
601
  rowOffset: 0
604
- }, u = this._selectionRenderService.getSelectionCellByPosition(h + i, l + e);
605
- if (u == null)
602
+ }, g = this._selectionRenderService.getSelectionCellByPosition(h + i, l + e);
603
+ if (g == null)
606
604
  return;
607
605
  const f = {
608
- column: u.actualColumn,
609
- columnOffset: h + i - u.startX,
610
- row: u.actualRow,
611
- rowOffset: l + e - u.startY
606
+ column: g.actualColumn,
607
+ columnOffset: h + i - g.startX,
608
+ row: g.actualRow,
609
+ rowOffset: l + e - g.startY
612
610
  };
613
611
  return {
614
- from: g,
612
+ from: u,
615
613
  to: f
616
614
  };
617
615
  }
618
616
  _updateOrderListener() {
619
617
  this._drawingManagerService.featurePluginOrderUpdate$.subscribe((i) => {
620
618
  const { unitId: e, subUnitId: n, drawingIds: t, arrangeType: r } = i;
621
- this._commandService.executeCommand(Gt.id, {
619
+ this._commandService.executeCommand(xt.id, {
622
620
  unitId: e,
623
621
  subUnitId: n,
624
622
  drawingIds: t,
@@ -653,11 +651,11 @@ let Ue = class extends ae {
653
651
  }
654
652
  _groupDrawingListener() {
655
653
  this._drawingManagerService.featurePluginGroupUpdate$.subscribe((i) => {
656
- this._commandService.executeCommand(xt.id, i);
654
+ this._commandService.executeCommand(Ft.id, i);
657
655
  const { unitId: e, subUnitId: n, drawingId: t } = i[0].parent;
658
656
  this._drawingManagerService.focusDrawing([{ unitId: e, subUnitId: n, drawingId: t }]);
659
657
  }), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((i) => {
660
- this._commandService.executeCommand(Ft.id, i);
658
+ this._commandService.executeCommand(Yt.id, i);
661
659
  });
662
660
  }
663
661
  _focusDrawingListener() {
@@ -686,18 +684,18 @@ let Ue = class extends ae {
686
684
  this._drawingManagerService.registerDrawingData(e, this._sheetDrawingService.getDrawingDataForUnit(e)), this._drawingManagerService.initializeNotification(e);
687
685
  }
688
686
  };
689
- Ue = Cr([
690
- se(oe.Rendered, Ue),
691
- k(0, V),
692
- k(1, he),
693
- k(2, W(Jn)),
694
- k(3, _t),
695
- k(4, H),
696
- k(5, z),
697
- k(6, wt),
698
- k(7, xn),
699
- k(8, W(_e)),
700
- k(9, K)
687
+ Ue = Ir([
688
+ ie(se.Rendered, Ue),
689
+ X(0, V),
690
+ X(1, he),
691
+ X(2, W(Zn)),
692
+ X(3, vt),
693
+ X(4, k),
694
+ X(5, z),
695
+ X(6, _t),
696
+ X(7, Yn),
697
+ X(8, W(_e)),
698
+ X(9, K)
701
699
  ], Ue);
702
700
  var Y = function() {
703
701
  return Y = Object.assign || function(i) {
@@ -707,23 +705,23 @@ var Y = function() {
707
705
  }
708
706
  return i;
709
707
  }, Y.apply(this, arguments);
710
- }, Ir = function(i, e) {
708
+ }, Rr = function(i, e) {
711
709
  var n = {};
712
710
  for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
713
711
  if (i != null && typeof Object.getOwnPropertySymbols == "function")
714
712
  for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
715
713
  e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
716
714
  return n;
717
- }, Yt = jt(function(i, e) {
718
- var n = i.icon, t = i.id, r = i.className, s = i.extend, o = Ir(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Lt("_".concat(Dr()));
715
+ }, kt = Lt(function(i, e) {
716
+ var n = i.icon, t = i.id, r = i.className, s = i.extend, o = Rr(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Bt("_".concat(br()));
719
717
  return Ht(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, Y({ ref: e, className: a }, o), s);
720
718
  });
721
719
  function Ht(i, e, n, t, r) {
722
- return Bt(i.tag, Y(Y({ key: e }, Rr(i, n, r)), t), (Mr(i, n).children || []).map(function(s, o) {
720
+ return Wt(i.tag, Y(Y({ key: e }, Mr(i, n, r)), t), (Dr(i, n).children || []).map(function(s, o) {
723
721
  return Ht(s, "".concat(e, "-").concat(i.tag, "-").concat(o), n, void 0, r);
724
722
  }));
725
723
  }
726
- function Rr(i, e, n) {
724
+ function Mr(i, e, n) {
727
725
  var t = Y({}, i.attrs);
728
726
  n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
729
727
  var r = e.defIds;
@@ -732,113 +730,113 @@ function Rr(i, e, n) {
732
730
  typeof a == "string" && (t[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
733
731
  })), t;
734
732
  }
735
- function Mr(i, e) {
733
+ function Dr(i, e) {
736
734
  var n, t = e.defIds;
737
735
  return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? Y(Y({}, i), { children: i.children.map(function(r) {
738
736
  return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? Y(Y({}, r), { attrs: Y(Y({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
739
737
  }) }) : i;
740
738
  }
741
- function Dr() {
739
+ function br() {
742
740
  return Math.random().toString(36).substring(2, 8);
743
741
  }
744
- Yt.displayName = "UniverIcon";
745
- var br = { 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" } }] }, Xt = jt(function(i, e) {
746
- return Bt(Yt, Object.assign({}, i, {
742
+ kt.displayName = "UniverIcon";
743
+ var Er = { 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" } }] }, Xt = Lt(function(i, e) {
744
+ return Wt(kt, Object.assign({}, i, {
747
745
  id: "add-image-single",
748
746
  ref: e,
749
- icon: br
747
+ icon: Er
750
748
  }));
751
749
  });
752
750
  Xt.displayName = "AddImageSingle";
753
- const Er = "univer-upload-file-menu", yr = "univer-upload-file-menu-input", pt = {
754
- uploadFileMenu: Er,
755
- uploadFileMenuInput: yr
756
- }, kt = "COMPONENT_UPLOAD_FILE_MENU";
751
+ const yr = "univer-upload-file-menu", Or = "univer-upload-file-menu-input", wt = {
752
+ uploadFileMenu: yr,
753
+ uploadFileMenuInput: Or
754
+ }, zt = "COMPONENT_UPLOAD_FILE_MENU";
757
755
  var We = /* @__PURE__ */ ((i) => (i[i.cellImage = 0] = "cellImage", i[i.floatImage = 1] = "floatImage", i))(We || {});
758
- const Or = (i) => {
759
- const { type: e } = i, n = ee(V), t = Lt(null), r = () => {
756
+ const Pr = (i) => {
757
+ const { type: e } = i, n = q(V), t = Bt(null), r = () => {
760
758
  var a;
761
759
  (a = t.current) == null || a.click();
762
- }, s = In.map((a) => `.${a.replace("image/", "")}`).join(","), o = (a) => {
760
+ }, s = Mn.map((a) => `.${a.replace("image/", "")}`).join(","), o = (a) => {
763
761
  const d = a.target.files;
764
762
  if (d == null)
765
763
  return;
766
764
  const h = Array.from(d);
767
765
  e === We.floatImage ? n.executeCommand(xe.id, { files: h }) : e === We.cellImage && n.executeCommand(Be.id, { files: h }), t.current && (t.current.value = "");
768
766
  };
769
- return /* @__PURE__ */ L.createElement("div", { onClick: r, className: pt.uploadFileMenu }, /* @__PURE__ */ L.createElement(
767
+ return /* @__PURE__ */ L.createElement("div", { onClick: r, className: wt.uploadFileMenu }, /* @__PURE__ */ L.createElement(
770
768
  "input",
771
769
  {
772
770
  type: "file",
773
- className: pt.uploadFileMenuInput,
771
+ className: wt.uploadFileMenuInput,
774
772
  ref: t,
775
773
  onChange: o,
776
774
  accept: s,
777
775
  multiple: !0
778
776
  }
779
777
  ));
780
- }, zt = "addition-and-subtraction-single", Kt = "sheet.menu.image";
778
+ }, Kt = "addition-and-subtraction-single", Jt = "sheet.menu.image";
781
779
  function Tr(i) {
782
780
  return {
783
- id: Kt,
784
- type: vt.SUBITEMS,
785
- positions: [Fn.TOOLBAR_START],
786
- group: Yn.TOOLBAR_FORMULAS_INSERT,
787
- icon: zt,
781
+ id: Jt,
782
+ type: St.SUBITEMS,
783
+ positions: [kn.TOOLBAR_START],
784
+ group: Hn.TOOLBAR_FORMULAS_INSERT,
785
+ icon: Kt,
788
786
  tooltip: "sheetImage.title",
789
- hidden$: St(i, B.UNIVER_SHEET),
790
- disabled$: Un(i, { workbookTypes: [Ze], worksheetTypes: [Te], rangeTypes: [Zn] })
787
+ hidden$: Ct(i, B.UNIVER_SHEET),
788
+ disabled$: Nn(i, { workbookTypes: [Ze], worksheetTypes: [Pe], rangeTypes: [qn] })
791
789
  };
792
790
  }
793
- function Pr(i) {
791
+ function Ur(i) {
794
792
  return {
795
793
  id: xe.id,
796
794
  title: "sheetImage.upload.float",
797
- type: vt.SELECTOR,
795
+ type: St.SELECTOR,
798
796
  label: {
799
- name: kt,
797
+ name: zt,
800
798
  props: {
801
799
  type: We.floatImage
802
800
  }
803
801
  },
804
- positions: [Kt],
805
- hidden$: St(i, B.UNIVER_SHEET)
802
+ positions: [Jt],
803
+ hidden$: Ct(i, B.UNIVER_SHEET)
806
804
  };
807
805
  }
808
- const Ur = "univer-image-common-panel", Ar = "univer-image-common-panel-grid", Nr = "univer-image-common-panel-border", jr = "univer-image-common-panel-title", Lr = "univer-image-common-panel-subtitle", Br = "univer-image-common-panel-row", Wr = "univer-image-common-panel-row-vertical", $r = "univer-image-common-panel-column", Vr = "univer-image-common-panel-column-center", Gr = "univer-image-common-panel-inline", xr = "univer-image-common-panel-span2", Fr = "univer-image-common-panel-span3", Yr = "univer-image-common-panel-input", Hr = "univer-sheet-image-menu", Xr = "univer-sheet-image-menu-input", Z = {
809
- imageCommonPanel: Ur,
810
- imageCommonPanelGrid: Ar,
811
- imageCommonPanelBorder: Nr,
812
- imageCommonPanelTitle: jr,
813
- imageCommonPanelSubtitle: Lr,
814
- imageCommonPanelRow: Br,
815
- imageCommonPanelRowVertical: Wr,
816
- imageCommonPanelColumn: $r,
817
- imageCommonPanelColumnCenter: Vr,
818
- imageCommonPanelInline: Gr,
819
- imageCommonPanelSpan2: xr,
820
- imageCommonPanelSpan3: Fr,
821
- imageCommonPanelInput: Yr,
806
+ const Ar = "univer-image-common-panel", Nr = "univer-image-common-panel-grid", jr = "univer-image-common-panel-border", Lr = "univer-image-common-panel-title", Br = "univer-image-common-panel-subtitle", Wr = "univer-image-common-panel-row", $r = "univer-image-common-panel-row-vertical", Vr = "univer-image-common-panel-column", Gr = "univer-image-common-panel-column-center", xr = "univer-image-common-panel-inline", Fr = "univer-image-common-panel-span2", Yr = "univer-image-common-panel-span3", kr = "univer-image-common-panel-input", Hr = "univer-sheet-image-menu", Xr = "univer-sheet-image-menu-input", Z = {
807
+ imageCommonPanel: Ar,
808
+ imageCommonPanelGrid: Nr,
809
+ imageCommonPanelBorder: jr,
810
+ imageCommonPanelTitle: Lr,
811
+ imageCommonPanelSubtitle: Br,
812
+ imageCommonPanelRow: Wr,
813
+ imageCommonPanelRowVertical: $r,
814
+ imageCommonPanelColumn: Vr,
815
+ imageCommonPanelColumnCenter: Gr,
816
+ imageCommonPanelInline: xr,
817
+ imageCommonPanelSpan2: Fr,
818
+ imageCommonPanelSpan3: Yr,
819
+ imageCommonPanelInput: kr,
822
820
  sheetImageMenu: Hr,
823
821
  sheetImageMenuInput: Xr
824
- }, kr = (i) => {
822
+ }, zr = (i) => {
825
823
  var v;
826
- const e = ee(V), n = ee(_e), t = ee(z), r = ee(K), { drawings: s } = i, o = s[0];
824
+ const e = q(V), n = q(_e), t = q(z), r = q(K), { drawings: s } = i, o = s[0];
827
825
  if (o == null)
828
826
  return;
829
827
  const { unitId: a } = o, d = r.getRenderById(a), h = d == null ? void 0 : d.scene;
830
828
  if (h == null)
831
829
  return;
832
- const l = h.getTransformerByCreate(), [c, g] = et(!0), u = (v = o.anchorType) != null ? v : O.Position, [f, m] = et(u);
830
+ const l = h.getTransformerByCreate(), [c, u] = et(!0), g = (v = o.anchorType) != null ? v : O.Position, [f, m] = et(g);
833
831
  function p(R, _) {
834
832
  const b = [];
835
833
  return R.forEach((w) => {
836
- const { oKey: T } = w, D = _.getDrawingOKey(T);
834
+ const { oKey: P } = w, D = _.getDrawingOKey(P);
837
835
  if (D == null)
838
836
  return b.push(null), !0;
839
- const { unitId: P, subUnitId: U, drawingId: M, drawingType: I, anchorType: A, sheetTransform: G } = D;
837
+ const { unitId: T, subUnitId: U, drawingId: M, drawingType: I, anchorType: A, sheetTransform: G } = D;
840
838
  b.push({
841
- unitId: P,
839
+ unitId: T,
842
840
  subUnitId: U,
843
841
  drawingId: M,
844
842
  anchorType: A,
@@ -849,16 +847,16 @@ const Ur = "univer-image-common-panel", Ar = "univer-image-common-panel-grid", N
849
847
  }
850
848
  rt(() => {
851
849
  const R = l.clearControl$.subscribe((b) => {
852
- b === !0 && g(!1);
850
+ b === !0 && u(!1);
853
851
  }), _ = l.changeStart$.subscribe((b) => {
854
852
  var D;
855
- const { objects: w } = b, T = p(w, t);
856
- if (T.length === 0)
857
- g(!1);
858
- else if (T.length >= 1) {
859
- g(!0);
860
- const P = ((D = T[0]) == null ? void 0 : D.anchorType) || O.Position;
861
- m(P);
853
+ const { objects: w } = b, P = p(w, t);
854
+ if (P.length === 0)
855
+ u(!1);
856
+ else if (P.length >= 1) {
857
+ u(!0);
858
+ const T = ((D = P[0]) == null ? void 0 : D.anchorType) || O.Position;
859
+ m(T);
862
860
  }
863
861
  });
864
862
  return () => {
@@ -882,9 +880,9 @@ const Ur = "univer-image-common-panel", Ar = "univer-image-common-panel-grid", N
882
880
  });
883
881
  }
884
882
  const C = (R) => R ? "block" : "none";
885
- return /* @__PURE__ */ L.createElement("div", { className: Ee(Z.imageCommonPanelGrid, Z.imageCommonPanelBorder), style: { display: C(c) } }, /* @__PURE__ */ L.createElement("div", { className: Z.imageCommonPanelRow }, /* @__PURE__ */ L.createElement("div", { className: Ee(Z.imageCommonPanelColumn, Z.imageCommonPanelTitle) }, /* @__PURE__ */ L.createElement("div", null, n.t("drawing-anchor.title")))), /* @__PURE__ */ L.createElement("div", { className: Ee(Z.imageCommonPanelRow) }, /* @__PURE__ */ L.createElement("div", { className: Ee(Z.imageCommonPanelColumn) }, /* @__PURE__ */ L.createElement(ar, { value: f, onChange: S, direction: "vertical" }, /* @__PURE__ */ L.createElement(ke, { value: O.Both }, n.t("drawing-anchor.both")), /* @__PURE__ */ L.createElement(ke, { value: O.Position }, n.t("drawing-anchor.position")), /* @__PURE__ */ L.createElement(ke, { value: O.None }, n.t("drawing-anchor.none"))))));
886
- }, zr = () => {
887
- const i = ee(z), e = i.getFocusDrawings(), [n, t] = et(e);
883
+ return /* @__PURE__ */ L.createElement("div", { className: Ee(Z.imageCommonPanelGrid, Z.imageCommonPanelBorder), style: { display: C(c) } }, /* @__PURE__ */ L.createElement("div", { className: Z.imageCommonPanelRow }, /* @__PURE__ */ L.createElement("div", { className: Ee(Z.imageCommonPanelColumn, Z.imageCommonPanelTitle) }, /* @__PURE__ */ L.createElement("div", null, n.t("drawing-anchor.title")))), /* @__PURE__ */ L.createElement("div", { className: Ee(Z.imageCommonPanelRow) }, /* @__PURE__ */ L.createElement("div", { className: Ee(Z.imageCommonPanelColumn) }, /* @__PURE__ */ L.createElement(cr, { value: f, onChange: S, direction: "vertical" }, /* @__PURE__ */ L.createElement(Xe, { value: O.Both }, n.t("drawing-anchor.both")), /* @__PURE__ */ L.createElement(Xe, { value: O.Position }, n.t("drawing-anchor.position")), /* @__PURE__ */ L.createElement(Xe, { value: O.None }, n.t("drawing-anchor.none"))))));
884
+ }, Kr = () => {
885
+ const i = q(z), e = i.getFocusDrawings(), [n, t] = et(e);
888
886
  return rt(() => {
889
887
  const r = i.focus$.subscribe((s) => {
890
888
  t(s);
@@ -892,23 +890,23 @@ const Ur = "univer-image-common-panel", Ar = "univer-image-common-panel-grid", N
892
890
  return () => {
893
891
  r.unsubscribe();
894
892
  };
895
- }, []), !!(n != null && n.length) && /* @__PURE__ */ L.createElement("div", { className: Z.imageCommonPanel }, /* @__PURE__ */ L.createElement(pn, { drawings: n }), /* @__PURE__ */ L.createElement(kr, { drawings: n }));
893
+ }, []), !!(n != null && n.length) && /* @__PURE__ */ L.createElement("div", { className: Z.imageCommonPanel }, /* @__PURE__ */ L.createElement(_n, { drawings: n }), /* @__PURE__ */ L.createElement(zr, { drawings: n }));
896
894
  }, ve = {
897
895
  id: "sheet.command.move-drawing",
898
896
  type: F.COMMAND,
899
897
  handler: (i, e) => {
900
- const n = i.get(V), t = i.get(H), r = i.get(Ge), { direction: s } = e, o = t.getFocusDrawings();
898
+ const n = i.get(V), t = i.get(k), r = i.get(Ge), { direction: s } = e, o = t.getFocusDrawings();
901
899
  if (o.length === 0)
902
900
  return !1;
903
901
  const a = o[0].unitId, d = o.map((l) => {
904
902
  const { transform: c } = l;
905
903
  if (c == null)
906
904
  return null;
907
- const g = { ...c }, { left: u = 0, top: f = 0 } = c;
908
- return s === q.UP ? g.top = f - 1 : s === q.DOWN ? g.top = f + 1 : s === q.LEFT ? g.left = u - 1 : s === q.RIGHT && (g.left = u + 1), {
905
+ const u = { ...c }, { left: g = 0, top: f = 0 } = c;
906
+ return s === Q.UP ? u.top = f - 1 : s === Q.DOWN ? u.top = f + 1 : s === Q.LEFT ? u.left = g - 1 : s === Q.RIGHT && (u.left = g + 1), {
909
907
  ...l,
910
- transform: g,
911
- sheetTransform: N(g, r)
908
+ transform: u,
909
+ sheetTransform: N(u, r)
912
910
  };
913
911
  }).filter((l) => l != null);
914
912
  return n.syncExecuteCommand(Fe.id, {
@@ -916,11 +914,11 @@ const Ur = "univer-image-common-panel", Ar = "univer-image-common-panel-grid", N
916
914
  drawings: d
917
915
  }) ? (n.syncExecuteCommand(j.id, [a]), !0) : !1;
918
916
  }
919
- }, Jt = {
917
+ }, Zt = {
920
918
  id: "sheet.command.delete-drawing",
921
919
  type: F.COMMAND,
922
920
  handler: (i) => {
923
- const e = i.get(V), t = i.get(H).getFocusDrawings();
921
+ const e = i.get(V), t = i.get(k).getFocusDrawings();
924
922
  if (t.length === 0)
925
923
  return !1;
926
924
  const r = t[0].unitId, s = t.map((o) => {
@@ -939,9 +937,9 @@ const Ur = "univer-image-common-panel", Ar = "univer-image-common-panel-grid", N
939
937
  }
940
938
  };
941
939
  function Se(i) {
942
- return !i.getContextValue(rn) && !i.getContextValue(sn) && i.getContextValue(we);
940
+ return !i.getContextValue(on) && !i.getContextValue(an) && i.getContextValue(we);
943
941
  }
944
- const Kr = {
942
+ const Jr = {
945
943
  id: ve.id,
946
944
  description: "shortcut.sheet.drawing-move-down",
947
945
  group: "4_sheet-drawing-view",
@@ -949,9 +947,9 @@ const Kr = {
949
947
  priority: 100,
950
948
  preconditions: Se,
951
949
  staticParameters: {
952
- direction: q.DOWN
950
+ direction: Q.DOWN
953
951
  }
954
- }, Jr = {
952
+ }, Zr = {
955
953
  id: ve.id,
956
954
  description: "shortcut.sheet.drawing-move-up",
957
955
  group: "4_sheet-drawing-view",
@@ -959,9 +957,9 @@ const Kr = {
959
957
  priority: 100,
960
958
  preconditions: Se,
961
959
  staticParameters: {
962
- direction: q.UP
960
+ direction: Q.UP
963
961
  }
964
- }, Zr = {
962
+ }, qr = {
965
963
  id: ve.id,
966
964
  description: "shortcut.sheet.drawing-move-left",
967
965
  group: "4_sheet-drawing-view",
@@ -969,9 +967,9 @@ const Kr = {
969
967
  priority: 100,
970
968
  preconditions: Se,
971
969
  staticParameters: {
972
- direction: q.LEFT
970
+ direction: Q.LEFT
973
971
  }
974
- }, qr = {
972
+ }, Qr = {
975
973
  id: ve.id,
976
974
  description: "shortcut.sheet.drawing-move-right",
977
975
  group: "4_sheet-drawing-view",
@@ -979,10 +977,10 @@ const Kr = {
979
977
  priority: 100,
980
978
  preconditions: Se,
981
979
  staticParameters: {
982
- direction: q.RIGHT
980
+ direction: Q.RIGHT
983
981
  }
984
- }, Qr = {
985
- id: Jt.id,
982
+ }, ei = {
983
+ id: Zt.id,
986
984
  description: "shortcut.sheet.drawing-delete",
987
985
  group: "4_sheet-drawing-view",
988
986
  // when focusing on any other input tag do not trigger this shortcut
@@ -990,25 +988,25 @@ const Kr = {
990
988
  binding: ue.DELETE,
991
989
  mac: ue.BACKSPACE
992
990
  };
993
- var ei = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, ni = (i, e, n, t) => {
994
- for (var r = t > 1 ? void 0 : t ? ti(e, n) : e, s = i.length - 1, o; s >= 0; s--)
991
+ var ti = Object.defineProperty, ni = Object.getOwnPropertyDescriptor, ri = (i, e, n, t) => {
992
+ for (var r = t > 1 ? void 0 : t ? ni(e, n) : e, s = i.length - 1, o; s >= 0; s--)
995
993
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
996
- return t && r && ei(e, n, r), r;
994
+ return t && r && ti(e, n, r), r;
997
995
  }, me = (i, e) => (n, t) => e(n, t, i);
998
- const ri = {};
999
- let pe = class extends ae {
996
+ const ii = {};
997
+ let pe = class extends oe {
1000
998
  constructor(i, e, n, t, r, s) {
1001
999
  super(), this._config = i, this._injector = e, this._componentManager = n, this._menuService = t, this._commandService = r, this._shortcutService = s, this._init();
1002
1000
  }
1003
1001
  _initCustomComponents() {
1004
1002
  const i = this._componentManager;
1005
- this.disposeWithMe(i.register(zt, Xt)), this.disposeWithMe(i.register(kt, Or)), this.disposeWithMe(i.register(Wt, zr));
1003
+ this.disposeWithMe(i.register(Kt, Xt)), this.disposeWithMe(i.register(zt, Pr)), this.disposeWithMe(i.register($t, Kr));
1006
1004
  }
1007
1005
  _initMenus() {
1008
1006
  const { menu: i = {} } = this._config;
1009
1007
  [
1010
1008
  Tr,
1011
- Pr
1009
+ Ur
1012
1010
  // UploadCellImageMenuFactory,
1013
1011
  ].forEach((e) => {
1014
1012
  this._menuService.addMenuItem(e(this._injector), i);
@@ -1021,24 +1019,24 @@ let pe = class extends ae {
1021
1019
  st,
1022
1020
  it,
1023
1021
  Fe,
1024
- $t,
1025
- j,
1026
1022
  Vt,
1027
- xt,
1023
+ j,
1024
+ Gt,
1028
1025
  Ft,
1026
+ Yt,
1029
1027
  ve,
1030
- Jt,
1031
- Gt
1028
+ Zt,
1029
+ xt
1032
1030
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
1033
1031
  }
1034
1032
  _initShortcuts() {
1035
1033
  [
1036
1034
  // sheet drawing shortcuts
1037
- Kr,
1038
1035
  Jr,
1039
1036
  Zr,
1040
1037
  qr,
1041
- Qr
1038
+ Qr,
1039
+ ei
1042
1040
  ].forEach((i) => {
1043
1041
  this.disposeWithMe(this._shortcutService.registerShortcut(i));
1044
1042
  });
@@ -1047,21 +1045,20 @@ let pe = class extends ae {
1047
1045
  this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
1048
1046
  }
1049
1047
  };
1050
- pe = ni([
1051
- se(oe.Rendered, pe),
1048
+ pe = ri([
1049
+ ie(se.Rendered, pe),
1052
1050
  me(1, W(nt)),
1053
- me(2, W(Hn)),
1054
- me(3, Xn),
1051
+ me(2, W(Xn)),
1052
+ me(3, zn),
1055
1053
  me(4, V),
1056
- me(5, kn)
1054
+ me(5, Kn)
1057
1055
  ], pe);
1058
- var ii = Object.defineProperty, si = Object.getOwnPropertyDescriptor, oi = (i, e, n, t) => {
1059
- for (var r = t > 1 ? void 0 : t ? si(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1056
+ var si = Object.defineProperty, oi = Object.getOwnPropertyDescriptor, ai = (i, e, n, t) => {
1057
+ for (var r = t > 1 ? void 0 : t ? oi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1060
1058
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1061
- return t && r && ii(e, n, r), r;
1062
- }, de = (i, e) => (n, t) => e(n, t, i);
1063
- const ai = [
1064
- Ct.id,
1059
+ return t && r && si(e, n, r), r;
1060
+ }, ce = (i, e) => (n, t) => e(n, t, i);
1061
+ const ci = [
1065
1062
  It.id,
1066
1063
  Rt.id,
1067
1064
  Mt.id,
@@ -1069,23 +1066,24 @@ const ai = [
1069
1066
  bt.id,
1070
1067
  Et.id,
1071
1068
  yt.id,
1069
+ Ot.id,
1072
1070
  qe.id,
1073
1071
  Qe.id,
1074
- Ot.id,
1075
- Tt.id,
1076
1072
  Pt.id,
1073
+ Tt.id,
1077
1074
  Ut.id,
1078
1075
  At.id,
1079
- Nt.id
1080
- ], ci = [
1081
- qn.id,
1076
+ Nt.id,
1077
+ jt.id
1078
+ ], di = [
1082
1079
  Qn.id,
1083
1080
  er.id,
1084
1081
  tr.id,
1085
1082
  nr.id,
1086
- rr.id
1083
+ rr.id,
1084
+ ir.id
1087
1085
  ];
1088
- let Ae = class extends ae {
1086
+ let Ae = class extends oe {
1089
1087
  constructor(i, e, n, t, r, s) {
1090
1088
  super(), this._commandService = i, this._sheetInterceptorService = e, this._renderManagerService = n, this._sheetDrawingService = t, this._drawingManagerService = r, this._univerInstanceService = s, this._init();
1091
1089
  }
@@ -1099,7 +1097,7 @@ let Ae = class extends ae {
1099
1097
  get _skeletonManagerService() {
1100
1098
  return this._renderManagerService.getRenderById(
1101
1099
  this._univerInstanceService.getCurrentUnitForType(B.UNIVER_SHEET).getUnitId()
1102
- ).with(ie);
1100
+ ).with(re);
1103
1101
  }
1104
1102
  _init() {
1105
1103
  this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
@@ -1108,54 +1106,54 @@ let Ae = class extends ae {
1108
1106
  this.disposeWithMe(
1109
1107
  this._sheetInterceptorService.interceptCommand({
1110
1108
  getMutations: (i) => {
1111
- if (!ai.includes(i.id))
1109
+ if (!ci.includes(i.id))
1112
1110
  return { redos: [], undos: [] };
1113
1111
  if (i.params == null)
1114
1112
  return { redos: [], undos: [] };
1115
1113
  const e = i.id;
1116
- if (e === Ct.id)
1117
- return this._moveRowInterceptor(i.params, "insert");
1118
1114
  if (e === It.id)
1119
- return this._moveColInterceptor(i.params, "insert");
1115
+ return this._moveRowInterceptor(i.params, "insert");
1120
1116
  if (e === Rt.id)
1121
- return this._moveRowInterceptor(i.params, "remove");
1117
+ return this._moveColInterceptor(i.params, "insert");
1122
1118
  if (e === Mt.id)
1119
+ return this._moveRowInterceptor(i.params, "remove");
1120
+ if (e === Dt.id)
1123
1121
  return this._moveColInterceptor(i.params, "remove");
1124
- if (e === Dt.id) {
1122
+ if (e === bt.id) {
1125
1123
  const { range: n } = i.params;
1126
1124
  return this._getRangeMoveUndo(
1127
1125
  n,
1128
1126
  0
1129
1127
  /* deleteLeft */
1130
1128
  );
1131
- } else if (e === bt.id) {
1129
+ } else if (e === Et.id) {
1132
1130
  const { range: n } = i.params;
1133
1131
  return this._getRangeMoveUndo(
1134
1132
  n,
1135
1133
  1
1136
1134
  /* deleteUp */
1137
1135
  );
1138
- } else if (e === Et.id) {
1136
+ } else if (e === yt.id) {
1139
1137
  const { range: n } = i.params;
1140
1138
  return this._getRangeMoveUndo(
1141
1139
  n,
1142
1140
  2
1143
1141
  /* insertDown */
1144
1142
  );
1145
- } else if (e === yt.id) {
1143
+ } else if (e === Ot.id) {
1146
1144
  const { range: n } = i.params;
1147
1145
  return this._getRangeMoveUndo(
1148
1146
  n,
1149
1147
  3
1150
1148
  /* insertRight */
1151
1149
  );
1152
- } else if (e === Pt.id || e === Ut.id) {
1150
+ } else if (e === Ut.id || e === At.id) {
1153
1151
  const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
1154
1152
  return this._getDrawingUndoForRowVisible(t, r, s);
1155
- } else if (e === At.id || e === Nt.id) {
1153
+ } else if (e === Nt.id || e === jt.id) {
1156
1154
  const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
1157
1155
  return this._getDrawingUndoForColVisible(t, r, s);
1158
- } else if (e === qe.id || e === Qe.id || e === Ot.id || e === Tt.id) {
1156
+ } else if (e === qe.id || e === Qe.id || e === Pt.id || e === Tt.id) {
1159
1157
  const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e === qe.id || e === Qe.id;
1160
1158
  return this._getDrawingUndoForRowAndColSize(t, r, s, o);
1161
1159
  }
@@ -1170,17 +1168,17 @@ let Ae = class extends ae {
1170
1168
  return { redos: [], undos: [] };
1171
1169
  const t = n.unitId, r = n.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(t, r), d = [], h = [];
1172
1170
  if (Object.keys(a).forEach((l) => {
1173
- const c = a[l], { updateDrawings: g, deleteDrawings: u } = this._getUpdateOrDeleteDrawings(i, e, c);
1174
- d.push(...g), h.push(...u);
1171
+ const c = a[l], { updateDrawings: u, deleteDrawings: g } = this._getUpdateOrDeleteDrawings(i, e, c);
1172
+ d.push(...u), h.push(...g);
1175
1173
  }), d.length === 0 && h.length === 0)
1176
1174
  return { redos: [], undos: [] };
1177
1175
  if (d.length > 0) {
1178
- const l = this._sheetDrawingService.getBatchUpdateOp(d), { undo: c, redo: g, objects: u } = l;
1179
- s.push({ id: E.id, params: { unitId: t, subUnitId: r, op: g, objects: u, type: y.UPDATE } }), o.push({ id: E.id, params: { unitId: t, subUnitId: r, op: c, objects: u, type: y.UPDATE } });
1176
+ const l = this._sheetDrawingService.getBatchUpdateOp(d), { undo: c, redo: u, objects: g } = l;
1177
+ s.push({ id: E.id, params: { unitId: t, subUnitId: r, op: u, objects: g, type: y.UPDATE } }), o.push({ id: E.id, params: { unitId: t, subUnitId: r, op: c, objects: g, type: y.UPDATE } });
1180
1178
  }
1181
1179
  if (h.length > 0) {
1182
- const l = this._sheetDrawingService.getBatchRemoveOp(h), c = l.undo, g = l.redo, u = l.objects;
1183
- s.push({ id: E.id, params: { unitId: t, subUnitId: r, op: g, objects: u, type: y.REMOVE } }), o.push({ id: E.id, params: { unitId: t, subUnitId: r, op: c, objects: u, type: y.INSERT } });
1180
+ const l = this._sheetDrawingService.getBatchRemoveOp(h), c = l.undo, u = l.redo, g = l.objects;
1181
+ s.push({ id: E.id, params: { unitId: t, subUnitId: r, op: u, objects: g, type: y.REMOVE } }), o.push({ id: E.id, params: { unitId: t, subUnitId: r, op: c, objects: g, type: y.INSERT } });
1184
1182
  }
1185
1183
  return s.push({ id: j.id, params: [t] }), o.push({ id: j.id, params: [t] }), {
1186
1184
  redos: s,
@@ -1188,7 +1186,7 @@ let Ae = class extends ae {
1188
1186
  };
1189
1187
  }
1190
1188
  _getUpdateOrDeleteDrawings(i, e, n) {
1191
- const t = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: h, drawingId: l } = n, { from: c, to: g } = s, { row: u, column: f } = c, { row: m, column: p } = g;
1189
+ const t = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: h, drawingId: l } = n, { from: c, to: u } = s, { row: g, column: f } = c, { row: m, column: p } = u;
1192
1190
  if (s == null || a == null)
1193
1191
  return {
1194
1192
  updateDrawings: t,
@@ -1196,7 +1194,7 @@ let Ae = class extends ae {
1196
1194
  };
1197
1195
  const { startRow: S, endRow: C, startColumn: v, endColumn: R } = i;
1198
1196
  let _ = null, b = null;
1199
- if (e === 0 && u >= S && m <= C)
1197
+ if (e === 0 && g >= S && m <= C)
1200
1198
  if (f >= v && p <= R)
1201
1199
  r.push({ unitId: d, subUnitId: h, drawingId: l });
1202
1200
  else {
@@ -1204,7 +1202,7 @@ let Ae = class extends ae {
1204
1202
  _ = w == null ? void 0 : w.newSheetTransform, b = w == null ? void 0 : w.newTransform;
1205
1203
  }
1206
1204
  else if (e === 1 && f >= v && p <= R)
1207
- if (u >= S && m <= C)
1205
+ if (g >= S && m <= C)
1208
1206
  r.push({ unitId: d, subUnitId: h, drawingId: l });
1209
1207
  else {
1210
1208
  const w = this._shrinkRow(s, a, S, C, o);
@@ -1234,57 +1232,57 @@ let Ae = class extends ae {
1234
1232
  _getDrawingUndoForColVisible(i, e, n) {
1235
1233
  const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
1236
1234
  if (Object.keys(t).forEach((l) => {
1237
- const c = t[l], { sheetTransform: g, transform: u, anchorType: f = O.Position } = c;
1235
+ const c = t[l], { sheetTransform: u, transform: g, anchorType: f = O.Position } = c;
1238
1236
  if (f === O.None)
1239
- this._remainDrawingSize(u, r, c);
1237
+ this._remainDrawingSize(g, r, c);
1240
1238
  else {
1241
- const { from: m, to: p } = g, { row: S, column: C } = m, { row: v, column: R } = p;
1239
+ const { from: m, to: p } = u, { row: S, column: C } = m, { row: v, column: R } = p;
1242
1240
  for (let _ = 0; _ < n.length; _++) {
1243
- const b = n[_], { startRow: w, endRow: T, startColumn: D, endColumn: P } = b;
1241
+ const b = n[_], { startRow: w, endRow: P, startColumn: D, endColumn: T } = b;
1244
1242
  if (R < D)
1245
1243
  continue;
1246
1244
  if (f === O.Position) {
1247
1245
  let I = null, A = null;
1248
- if (C >= D && C <= P) {
1249
- const G = this._skeletonManagerService.attachRangeWithCoord({ startColumn: C, endColumn: P, startRow: m.row, endRow: p.row });
1246
+ if (C >= D && C <= T) {
1247
+ const G = this._skeletonManagerService.attachRangeWithCoord({ startColumn: C, endColumn: T, startRow: m.row, endRow: p.row });
1250
1248
  if (G == null)
1251
1249
  return;
1252
- A = { ...u, left: G.startX };
1250
+ A = { ...g, left: G.startX };
1253
1251
  }
1254
1252
  if (A != null && (I = N(A, this._selectionRenderService), I != null && A != null)) {
1255
1253
  r.push({ ...c, sheetTransform: I, transform: A });
1256
1254
  break;
1257
1255
  }
1258
- this._remainDrawingSize(u, r, c);
1256
+ this._remainDrawingSize(g, r, c);
1259
1257
  continue;
1260
1258
  }
1261
- if (C >= D && R <= P)
1259
+ if (C >= D && R <= T)
1262
1260
  continue;
1263
1261
  let U = null, M = null;
1264
- if (C >= D && C <= P) {
1265
- const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: C, endColumn: P, startRow: m.row, endRow: p.row });
1262
+ if (C >= D && C <= T) {
1263
+ const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: C, endColumn: T, startRow: m.row, endRow: p.row });
1266
1264
  if (I == null)
1267
1265
  return;
1268
1266
  M = {
1269
- ...u,
1267
+ ...g,
1270
1268
  left: (I == null ? void 0 : I.startX) || 0,
1271
- width: ((u == null ? void 0 : u.width) || 0) - I.endX + I.startX
1269
+ width: ((g == null ? void 0 : g.width) || 0) - I.endX + I.startX
1272
1270
  };
1273
- } else if (R >= D && R <= P) {
1271
+ } else if (R >= D && R <= T) {
1274
1272
  const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: R, startRow: m.row, endRow: p.row });
1275
1273
  if (I == null)
1276
1274
  return;
1277
1275
  M = {
1278
- ...u,
1279
- left: I.startX - ((u == null ? void 0 : u.width) || 0)
1276
+ ...g,
1277
+ left: I.startX - ((g == null ? void 0 : g.width) || 0)
1280
1278
  };
1281
1279
  } else {
1282
- const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: P, startRow: m.row, endRow: p.row });
1280
+ const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: T, startRow: m.row, endRow: p.row });
1283
1281
  if (I == null)
1284
1282
  return;
1285
1283
  if (M = {
1286
- ...u,
1287
- width: ((u == null ? void 0 : u.width) || 0) - I.endX + I.startX
1284
+ ...g,
1285
+ width: ((g == null ? void 0 : g.width) || 0) - I.endX + I.startX
1288
1286
  }, U = N(M, this._selectionRenderService), U != null && M != null) {
1289
1287
  s.push({ ...c, sheetTransform: U, transform: M });
1290
1288
  break;
@@ -1294,7 +1292,7 @@ let Ae = class extends ae {
1294
1292
  r.push({ ...c, sheetTransform: U, transform: M });
1295
1293
  break;
1296
1294
  } else
1297
- this._remainDrawingSize(u, r, c);
1295
+ this._remainDrawingSize(g, r, c);
1298
1296
  }
1299
1297
  }
1300
1298
  }), r.length === 0 && s.length === 0)
@@ -1328,57 +1326,57 @@ let Ae = class extends ae {
1328
1326
  _getDrawingUndoForRowVisible(i, e, n) {
1329
1327
  const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
1330
1328
  if (Object.keys(t).forEach((l) => {
1331
- const c = t[l], { sheetTransform: g, transform: u, anchorType: f = O.Position } = c;
1329
+ const c = t[l], { sheetTransform: u, transform: g, anchorType: f = O.Position } = c;
1332
1330
  if (f === O.None)
1333
- this._remainDrawingSize(u, r, c);
1331
+ this._remainDrawingSize(g, r, c);
1334
1332
  else {
1335
- const { from: m, to: p } = g, { row: S, column: C } = m, { row: v, column: R } = p;
1333
+ const { from: m, to: p } = u, { row: S, column: C } = m, { row: v, column: R } = p;
1336
1334
  for (let _ = 0; _ < n.length; _++) {
1337
- const b = n[_], { startRow: w, endRow: T, startColumn: D, endColumn: P } = b;
1335
+ const b = n[_], { startRow: w, endRow: P, startColumn: D, endColumn: T } = b;
1338
1336
  if (v < w)
1339
1337
  continue;
1340
1338
  if (f === O.Position) {
1341
1339
  let I = null, A = null;
1342
- if (S >= w && S <= T) {
1343
- const G = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: S, endRow: T });
1340
+ if (S >= w && S <= P) {
1341
+ const G = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: S, endRow: P });
1344
1342
  if (G == null)
1345
1343
  return;
1346
- A = { ...u, top: G.startY };
1344
+ A = { ...g, top: G.startY };
1347
1345
  }
1348
1346
  if (A != null && (I = N(A, this._selectionRenderService), I != null && A != null)) {
1349
1347
  r.push({ ...c, sheetTransform: I, transform: A });
1350
1348
  break;
1351
1349
  }
1352
- this._remainDrawingSize(u, r, c);
1350
+ this._remainDrawingSize(g, r, c);
1353
1351
  continue;
1354
1352
  }
1355
- if (S >= w && v <= T)
1353
+ if (S >= w && v <= P)
1356
1354
  continue;
1357
1355
  let U = null, M = null;
1358
- if (S >= w && S <= T) {
1359
- const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: S, endRow: T });
1356
+ if (S >= w && S <= P) {
1357
+ const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: S, endRow: P });
1360
1358
  if (I == null)
1361
1359
  return;
1362
1360
  M = {
1363
- ...u,
1361
+ ...g,
1364
1362
  top: (I == null ? void 0 : I.startY) || 0,
1365
- height: ((u == null ? void 0 : u.height) || 0) - I.endY + I.startY
1363
+ height: ((g == null ? void 0 : g.height) || 0) - I.endY + I.startY
1366
1364
  };
1367
- } else if (v >= w && v <= T) {
1365
+ } else if (v >= w && v <= P) {
1368
1366
  const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: w, endRow: v });
1369
1367
  if (I == null)
1370
1368
  return;
1371
1369
  M = {
1372
- ...u,
1373
- top: I.startY - ((u == null ? void 0 : u.height) || 0)
1370
+ ...g,
1371
+ top: I.startY - ((g == null ? void 0 : g.height) || 0)
1374
1372
  };
1375
1373
  } else {
1376
- const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: w, endRow: T });
1374
+ const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: w, endRow: P });
1377
1375
  if (I == null)
1378
1376
  return;
1379
1377
  if (M = {
1380
- ...u,
1381
- height: ((u == null ? void 0 : u.height) || 0) - I.endY + I.startY
1378
+ ...g,
1379
+ height: ((g == null ? void 0 : g.height) || 0) - I.endY + I.startY
1382
1380
  }, U = N(M, this._selectionRenderService), U != null && M != null) {
1383
1381
  s.push({ ...c, sheetTransform: U, transform: M });
1384
1382
  break;
@@ -1388,7 +1386,7 @@ let Ae = class extends ae {
1388
1386
  r.push({ ...c, sheetTransform: U, transform: M });
1389
1387
  break;
1390
1388
  } else
1391
- this._remainDrawingSize(u, r, c);
1389
+ this._remainDrawingSize(g, r, c);
1392
1390
  }
1393
1391
  }
1394
1392
  }), r.length === 0 && s.length === 0)
@@ -1412,12 +1410,12 @@ let Ae = class extends ae {
1412
1410
  if (l === O.None)
1413
1411
  this._remainDrawingSize(h, s, a);
1414
1412
  else {
1415
- const { from: c, to: g } = d, { row: u, column: f } = c, { row: m, column: p } = g;
1413
+ const { from: c, to: u } = d, { row: g, column: f } = c, { row: m, column: p } = u;
1416
1414
  for (let S = 0; S < n.length; S++) {
1417
1415
  const C = n[S], { startRow: v, endRow: R, startColumn: _, endColumn: b } = C;
1418
1416
  if (m < v || p < _)
1419
1417
  continue;
1420
- if (l === O.Position && (u <= v && m >= R || f <= _ && p >= b)) {
1418
+ if (l === O.Position && (g <= v && m >= R || f <= _ && p >= b)) {
1421
1419
  this._remainDrawingSize(h, s, a);
1422
1420
  continue;
1423
1421
  }
@@ -1453,9 +1451,9 @@ let Ae = class extends ae {
1453
1451
  const n = this._getUnitIdAndSubUnitId(i, e);
1454
1452
  if (n == null)
1455
1453
  return { redos: [], undos: [] };
1456
- const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startRow, a = s.endRow, d = [], h = [], l = this._sheetDrawingService.getDrawingData(t, r), c = [], g = [];
1457
- if (Object.keys(l).forEach((u) => {
1458
- const f = l[u], { sheetTransform: m, transform: p, anchorType: S = O.Position } = f;
1454
+ const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startRow, a = s.endRow, d = [], h = [], l = this._sheetDrawingService.getDrawingData(t, r), c = [], u = [];
1455
+ if (Object.keys(l).forEach((g) => {
1456
+ const f = l[g], { sheetTransform: m, transform: p, anchorType: S = O.Position } = f;
1459
1457
  if (m == null || p == null)
1460
1458
  return;
1461
1459
  let C, v;
@@ -1463,9 +1461,9 @@ let Ae = class extends ae {
1463
1461
  const _ = this._expandRow(m, p, o, a, S);
1464
1462
  C = _ == null ? void 0 : _.newSheetTransform, v = _ == null ? void 0 : _.newTransform;
1465
1463
  } else {
1466
- const { from: _, to: b } = m, { row: w } = _, { row: T } = b;
1467
- if (w >= o && T <= a)
1468
- g.push({ unitId: t, subUnitId: r, drawingId: u });
1464
+ const { from: _, to: b } = m, { row: w } = _, { row: P } = b;
1465
+ if (w >= o && P <= a)
1466
+ u.push({ unitId: t, subUnitId: r, drawingId: g });
1469
1467
  else {
1470
1468
  const D = this._shrinkRow(m, p, o, a, S);
1471
1469
  C = D == null ? void 0 : D.newSheetTransform, v = D == null ? void 0 : D.newTransform;
@@ -1473,16 +1471,16 @@ let Ae = class extends ae {
1473
1471
  }
1474
1472
  if (!C || !v)
1475
1473
  return;
1476
- const R = { unitId: t, subUnitId: r, drawingId: u, transform: v, sheetTransform: C };
1474
+ const R = { unitId: t, subUnitId: r, drawingId: g, transform: v, sheetTransform: C };
1477
1475
  c.push(R);
1478
- }), c.length === 0 && g.length === 0)
1476
+ }), c.length === 0 && u.length === 0)
1479
1477
  return { redos: [], undos: [] };
1480
1478
  if (c.length > 0) {
1481
- const u = this._sheetDrawingService.getBatchUpdateOp(c), { undo: f, redo: m, objects: p } = u;
1479
+ const g = this._sheetDrawingService.getBatchUpdateOp(c), { undo: f, redo: m, objects: p } = g;
1482
1480
  d.push({ id: E.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: y.UPDATE } }), h.push({ id: E.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: y.UPDATE } });
1483
1481
  }
1484
- if (g.length > 0) {
1485
- const u = this._sheetDrawingService.getBatchRemoveOp(g), f = u.undo, m = u.redo, p = u.objects;
1482
+ if (u.length > 0) {
1483
+ const g = this._sheetDrawingService.getBatchRemoveOp(u), f = g.undo, m = g.redo, p = g.objects;
1486
1484
  d.push({ id: E.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: y.REMOVE } }), h.push({ id: E.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: y.INSERT } });
1487
1485
  }
1488
1486
  return d.push({ id: j.id, params: [t] }), h.push({ id: j.id, params: [t] }), {
@@ -1494,9 +1492,9 @@ let Ae = class extends ae {
1494
1492
  const n = this._getUnitIdAndSubUnitId(i, e);
1495
1493
  if (n == null)
1496
1494
  return { redos: [], undos: [] };
1497
- const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startColumn, a = s.endColumn, d = [], h = [], l = this._sheetDrawingService.getDrawingData(t, r), c = [], g = [];
1498
- if (Object.keys(l).forEach((u) => {
1499
- const f = l[u], { sheetTransform: m, transform: p, anchorType: S = O.Position } = f;
1495
+ const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startColumn, a = s.endColumn, d = [], h = [], l = this._sheetDrawingService.getDrawingData(t, r), c = [], u = [];
1496
+ if (Object.keys(l).forEach((g) => {
1497
+ const f = l[g], { sheetTransform: m, transform: p, anchorType: S = O.Position } = f;
1500
1498
  if (m == null || p == null)
1501
1499
  return;
1502
1500
  let C, v;
@@ -1504,9 +1502,9 @@ let Ae = class extends ae {
1504
1502
  const _ = this._expandCol(m, p, o, a, S);
1505
1503
  C = _ == null ? void 0 : _.newSheetTransform, v = _ == null ? void 0 : _.newTransform;
1506
1504
  } else {
1507
- const { from: _, to: b } = m, { column: w } = _, { column: T } = b;
1508
- if (w >= o && T <= a)
1509
- g.push({ unitId: t, subUnitId: r, drawingId: u });
1505
+ const { from: _, to: b } = m, { column: w } = _, { column: P } = b;
1506
+ if (w >= o && P <= a)
1507
+ u.push({ unitId: t, subUnitId: r, drawingId: g });
1510
1508
  else {
1511
1509
  const D = this._shrinkCol(m, p, o, a, S);
1512
1510
  C = D == null ? void 0 : D.newSheetTransform, v = D == null ? void 0 : D.newTransform;
@@ -1514,16 +1512,16 @@ let Ae = class extends ae {
1514
1512
  }
1515
1513
  if (!C || !v)
1516
1514
  return;
1517
- const R = { unitId: t, subUnitId: r, drawingId: u, transform: v, sheetTransform: C };
1515
+ const R = { unitId: t, subUnitId: r, drawingId: g, transform: v, sheetTransform: C };
1518
1516
  c.push(R);
1519
- }), c.length === 0 && g.length === 0)
1517
+ }), c.length === 0 && u.length === 0)
1520
1518
  return { redos: [], undos: [] };
1521
1519
  if (c.length > 0) {
1522
- const u = this._sheetDrawingService.getBatchUpdateOp(c), { undo: f, redo: m, objects: p } = u;
1520
+ const g = this._sheetDrawingService.getBatchUpdateOp(c), { undo: f, redo: m, objects: p } = g;
1523
1521
  d.push({ id: E.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: y.UPDATE } }), h.push({ id: E.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: y.UPDATE } });
1524
1522
  }
1525
- if (g.length > 0) {
1526
- const u = this._sheetDrawingService.getBatchRemoveOp(g), f = u.undo, m = u.redo, p = u.objects;
1523
+ if (u.length > 0) {
1524
+ const g = this._sheetDrawingService.getBatchRemoveOp(u), f = g.undo, m = g.redo, p = g.objects;
1527
1525
  d.push({ id: E.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: y.REMOVE } }), h.push({ id: E.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: y.INSERT } });
1528
1526
  }
1529
1527
  return d.push({ id: j.id, params: [t] }), h.push({ id: j.id, params: [t] }), { redos: d, undos: h };
@@ -1537,10 +1535,10 @@ let Ae = class extends ae {
1537
1535
  };
1538
1536
  let l = null, c = null;
1539
1537
  if (d >= n) {
1540
- const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: t, startRow: o.row, endRow: a.row });
1541
- if (g == null)
1538
+ const u = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: t, startRow: o.row, endRow: a.row });
1539
+ if (u == null)
1542
1540
  return;
1543
- c = { ...e, left: (e.left || 0) + g.endX - g.startX }, l = N(c, this._selectionRenderService);
1541
+ c = { ...e, left: (e.left || 0) + u.endX - u.startX }, l = N(c, this._selectionRenderService);
1544
1542
  } else if (h >= t)
1545
1543
  if (r === O.Both)
1546
1544
  l = {
@@ -1588,24 +1586,24 @@ let Ae = class extends ae {
1588
1586
  if (d === n)
1589
1587
  c = { ...e, left: (e.left || 0) - i.from.columnOffset };
1590
1588
  else {
1591
- const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: d - 1, startRow: o.row, endRow: a.row });
1592
- if (g == null)
1589
+ const u = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: d - 1, startRow: o.row, endRow: a.row });
1590
+ if (u == null)
1593
1591
  return;
1594
- c = { ...e, left: (e.left || 0) - g.endX + g.startX - i.from.columnOffset };
1592
+ c = { ...e, left: (e.left || 0) - u.endX + u.startX - i.from.columnOffset };
1595
1593
  }
1596
1594
  l = N(c, this._selectionRenderService);
1597
1595
  } else if (h >= n && h <= t && r === O.Both) {
1598
- const g = this._skeletonManagerService.attachRangeWithCoord({
1596
+ const u = this._skeletonManagerService.attachRangeWithCoord({
1599
1597
  startColumn: n - 1,
1600
1598
  endColumn: n - 1,
1601
1599
  startRow: o.row,
1602
1600
  endRow: a.row
1603
1601
  });
1604
- if (g == null)
1602
+ if (u == null)
1605
1603
  return;
1606
1604
  l = {
1607
1605
  from: { ...o },
1608
- to: { ...a, column: n - 1, columnOffset: g.endX - g.startX }
1606
+ to: { ...a, column: n - 1, columnOffset: u.endX - u.startX }
1609
1607
  }, c = $(l, this._selectionRenderService, this._skeletonManagerService);
1610
1608
  }
1611
1609
  }
@@ -1623,10 +1621,10 @@ let Ae = class extends ae {
1623
1621
  };
1624
1622
  let l = null, c = null;
1625
1623
  if (d >= n) {
1626
- const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: t, startColumn: o.column, endColumn: a.column });
1627
- if (g == null)
1624
+ const u = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: t, startColumn: o.column, endColumn: a.column });
1625
+ if (u == null)
1628
1626
  return;
1629
- c = { ...e, top: (e.top || 0) + g.endY - g.startY }, l = N(c, this._selectionRenderService);
1627
+ c = { ...e, top: (e.top || 0) + u.endY - u.startY }, l = N(c, this._selectionRenderService);
1630
1628
  } else if (h >= t)
1631
1629
  if (r === O.Both)
1632
1630
  l = {
@@ -1677,19 +1675,19 @@ let Ae = class extends ae {
1677
1675
  if (d === n)
1678
1676
  c = { ...e, top: (e.top || 0) - i.from.rowOffset };
1679
1677
  else {
1680
- const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: d - 1, startColumn: o.column, endColumn: a.column });
1681
- if (g == null)
1678
+ const u = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: d - 1, startColumn: o.column, endColumn: a.column });
1679
+ if (u == null)
1682
1680
  return;
1683
- c = { ...e, top: (e.top || 0) - g.endY + g.startY - i.from.rowOffset };
1681
+ c = { ...e, top: (e.top || 0) - u.endY + u.startY - i.from.rowOffset };
1684
1682
  }
1685
1683
  l = N(c, this._selectionRenderService);
1686
1684
  } else if (h >= n && h <= t && r === O.Both) {
1687
- const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: n - 1, endRow: n - 1 });
1688
- if (g == null)
1685
+ const u = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: n - 1, endRow: n - 1 });
1686
+ if (u == null)
1689
1687
  return;
1690
1688
  l = {
1691
1689
  from: { ...o },
1692
- to: { ...a, row: n - 1, rowOffset: g.endY - g.startY }
1690
+ to: { ...a, row: n - 1, rowOffset: u.endY - u.startY }
1693
1691
  }, c = $(l, this._selectionRenderService, this._skeletonManagerService);
1694
1692
  }
1695
1693
  }
@@ -1701,7 +1699,7 @@ let Ae = class extends ae {
1701
1699
  _commandListener() {
1702
1700
  this.disposeWithMe(
1703
1701
  this._commandService.onCommandExecuted((i) => {
1704
- i.id === ir.id && setTimeout(() => {
1702
+ i.id === sr.id && setTimeout(() => {
1705
1703
  const e = i.params, { unitId: n, subUnitId: t } = e, r = this._drawingManagerService.drawingManagerData, s = [], o = [];
1706
1704
  Object.keys(r).forEach((a) => {
1707
1705
  const d = r[a];
@@ -1709,8 +1707,8 @@ let Ae = class extends ae {
1709
1707
  const l = d[h].data;
1710
1708
  l != null && Object.keys(l).forEach((c) => {
1711
1709
  if (a === n && h === t) {
1712
- const g = l[c];
1713
- g.transform = $(g.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(l[c]);
1710
+ const u = l[c];
1711
+ u.transform = $(u.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(l[c]);
1714
1712
  } else
1715
1713
  o.push(l[c]);
1716
1714
  });
@@ -1723,7 +1721,7 @@ let Ae = class extends ae {
1723
1721
  _sheetRefreshListener() {
1724
1722
  this.disposeWithMe(
1725
1723
  this._commandService.onCommandExecuted((i) => {
1726
- ci.includes(i.id) && requestIdleCallback(() => {
1724
+ di.includes(i.id) && requestIdleCallback(() => {
1727
1725
  const e = i.params, { unitId: n, subUnitId: t, ranges: r } = e;
1728
1726
  this._refreshDrawingTransform(n, t, r);
1729
1727
  });
@@ -1736,10 +1734,10 @@ let Ae = class extends ae {
1736
1734
  const o = t[s], { sheetTransform: a, anchorType: d = O.Position } = o;
1737
1735
  if (d === O.None)
1738
1736
  return !0;
1739
- const { from: h, to: l } = a, { row: c, column: g } = h, { row: u, column: f } = l;
1737
+ const { from: h, to: l } = a, { row: c, column: u } = h, { row: g, column: f } = l;
1740
1738
  for (let m = 0; m < n.length; m++) {
1741
1739
  const p = n[m], { startRow: S, endRow: C, startColumn: v, endColumn: R } = p;
1742
- if (on.intersects(
1740
+ if (cn.intersects(
1743
1741
  {
1744
1742
  startRow: S,
1745
1743
  endRow: C,
@@ -1748,11 +1746,11 @@ let Ae = class extends ae {
1748
1746
  },
1749
1747
  {
1750
1748
  startRow: c,
1751
- endRow: u,
1752
- startColumn: g,
1749
+ endRow: g,
1750
+ startColumn: u,
1753
1751
  endColumn: f
1754
1752
  }
1755
- ) || c > C || g > R) {
1753
+ ) || c > C || u > R) {
1756
1754
  r.push({
1757
1755
  ...o,
1758
1756
  transform: $(a, this._selectionRenderService, this._skeletonManagerService)
@@ -1763,22 +1761,22 @@ let Ae = class extends ae {
1763
1761
  }), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(j.id, [i]));
1764
1762
  }
1765
1763
  };
1766
- Ae = oi([
1767
- se(oe.Rendered, Ae),
1768
- de(0, V),
1769
- de(1, W(sr)),
1770
- de(2, K),
1771
- de(3, H),
1772
- de(4, z),
1773
- de(5, he)
1764
+ Ae = ai([
1765
+ ie(se.Rendered, Ae),
1766
+ ce(0, V),
1767
+ ce(1, W(or)),
1768
+ ce(2, K),
1769
+ ce(3, k),
1770
+ ce(4, z),
1771
+ ce(5, he)
1774
1772
  ], Ae);
1775
- var di = Object.defineProperty, li = Object.getOwnPropertyDescriptor, ui = (i, e, n, t) => {
1776
- for (var r = t > 1 ? void 0 : t ? li(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1773
+ var li = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, gi = (i, e, n, t) => {
1774
+ for (var r = t > 1 ? void 0 : t ? ui(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1777
1775
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1778
- return t && r && di(e, n, r), r;
1779
- }, ne = (i, e) => (n, t) => e(n, t, i);
1780
- function gi(i, e, n, t) {
1781
- const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(On.VIEW_MAIN), a = {
1776
+ return t && r && li(e, n, r), r;
1777
+ }, de = (i, e) => (n, t) => e(n, t, i);
1778
+ function hi(i, e, n, t) {
1779
+ const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(Tn.VIEW_MAIN), a = {
1782
1780
  left: !0,
1783
1781
  top: !0
1784
1782
  };
@@ -1787,11 +1785,11 @@ function gi(i, e, n, t) {
1787
1785
  ...i,
1788
1786
  absolute: a
1789
1787
  };
1790
- const { left: d, right: h, top: l, bottom: c } = i, g = t.getFreeze(), { startColumn: u, startRow: f, xSplit: m, ySplit: p } = g, S = n.getNoMergeCellPositionByIndexWithNoHeader(f - p, u - m), C = n.getNoMergeCellPositionByIndexWithNoHeader(f, u), { rowHeaderWidth: v, columnHeaderHeight: R } = n, _ = C.startX - S.startX, b = C.startY - S.startY, { top: w, left: T, viewportScrollX: D, viewportScrollY: P } = o;
1788
+ const { left: d, right: h, top: l, bottom: c } = i, u = t.getFreeze(), { startColumn: g, startRow: f, xSplit: m, ySplit: p } = u, S = n.getNoMergeCellPositionByIndexWithNoHeader(f - p, g - m), C = n.getNoMergeCellPositionByIndexWithNoHeader(f, g), { rowHeaderWidth: v, columnHeaderHeight: R } = n, _ = C.startX - S.startX, b = C.startY - S.startY, { top: w, left: P, viewportScrollX: D, viewportScrollY: T } = o;
1791
1789
  let U, M;
1792
- d < T ? (a.left = !0, U = (_ + v + (d - T)) * r, M = Math.max(
1790
+ d < P ? (a.left = !0, U = (_ + v + (d - P)) * r, M = Math.max(
1793
1791
  Math.min(
1794
- (_ + v + (h - T)) * r,
1792
+ (_ + v + (h - P)) * r,
1795
1793
  (_ + v) * r
1796
1794
  ),
1797
1795
  (h - D) * r
@@ -1802,8 +1800,8 @@ function gi(i, e, n, t) {
1802
1800
  (b + R + (h - w)) * s,
1803
1801
  (b + R) * s
1804
1802
  ),
1805
- (c - P) * s
1806
- )) : (a.top = !1, I = Math.max((l - P) * s, (b + R) * s), A = Math.max((c - P) * s, (b + R) * s)), {
1803
+ (c - T) * s
1804
+ )) : (a.top = !1, I = Math.max((l - T) * s, (b + R) * s), A = Math.max((c - T) * s, (b + R) * s)), {
1807
1805
  left: U,
1808
1806
  right: M,
1809
1807
  top: I,
@@ -1817,7 +1815,7 @@ const ze = (i, e, n, t) => {
1817
1815
  right: s + a,
1818
1816
  top: o,
1819
1817
  bottom: o + d
1820
- }, c = gi(l, r, n, t);
1818
+ }, c = hi(l, r, n, t);
1821
1819
  return {
1822
1820
  startX: c.left,
1823
1821
  endX: c.right,
@@ -1829,16 +1827,17 @@ const ze = (i, e, n, t) => {
1829
1827
  absolute: c.absolute
1830
1828
  };
1831
1829
  };
1832
- let tt = class extends ae {
1833
- constructor(e, n, t, r, s, o, a) {
1830
+ let tt = class extends oe {
1831
+ constructor(e, n, t, r, s, o) {
1834
1832
  super();
1835
- X(this, "_domLayerMap", /* @__PURE__ */ new Map());
1836
- X(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
1837
- X(this, "_transformChange$", new ht());
1838
- X(this, "transformChange$", this._transformChange$.asObservable());
1839
- X(this, "_remove$", new ht());
1840
- X(this, "remove$", this._remove$.asObservable());
1841
- this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = r, this._selectionRenderService = s, this._canvasFloatDomService = o, this._sheetDrawingService = a, this._drawingAddListener(), this._scrollUpdateListener(), this._featureUpdateListener(), this._deleteListener();
1833
+ H(this, "_domLayerMap", /* @__PURE__ */ new Map());
1834
+ H(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
1835
+ H(this, "_transformChange$", new mt());
1836
+ H(this, "transformChange$", this._transformChange$.asObservable());
1837
+ H(this, "_remove$", new mt());
1838
+ H(this, "remove$", this._remove$.asObservable());
1839
+ H(this, "_hooks", []);
1840
+ this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._drawingAddListener(), this._scrollUpdateListener(), this._featureUpdateListener(), this._deleteListener();
1842
1841
  }
1843
1842
  _ensureMap(e, n) {
1844
1843
  let t = this._domLayerMap.get(e);
@@ -1855,14 +1854,20 @@ let tt = class extends ae {
1855
1854
  const r = t.getTransformerByCreate(), s = n.engine.getCanvasElement();
1856
1855
  return { scene: t, transformer: r, renderObject: n, canvas: s };
1857
1856
  }
1857
+ _getFloatDomProps(e) {
1858
+ let n;
1859
+ return this._hooks.forEach((t) => {
1860
+ n = t.onGetFloatDomProps(e);
1861
+ }), n;
1862
+ }
1858
1863
  // eslint-disable-next-line max-lines-per-function
1859
1864
  _drawingAddListener() {
1860
1865
  this.disposeWithMe(
1861
1866
  // eslint-disable-next-line max-lines-per-function
1862
1867
  this._drawingManagerService.add$.subscribe((e) => {
1863
1868
  e.forEach((n) => {
1864
- var ot, at;
1865
- const { unitId: t, subUnitId: r, drawingId: s } = n, o = le(this._univerInstanceService, { unitId: t, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(n), d = (ot = this._renderManagerService.getRenderById(t)) == null ? void 0 : ot.with(ie).getWorksheetSkeleton(r);
1869
+ var ot, at, ct;
1870
+ const { unitId: t, subUnitId: r, drawingId: s } = n, o = le(this._univerInstanceService, { unitId: t, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(n), d = (ot = this._renderManagerService.getRenderById(t)) == null ? void 0 : ot.with(re).getWorksheetSkeleton(r);
1866
1871
  if (a == null || o == null || d == null)
1867
1872
  return;
1868
1873
  const { transform: h, drawingType: l } = a;
@@ -1871,12 +1876,12 @@ let tt = class extends ae {
1871
1876
  const c = this._getSceneAndTransformerByDrawingSearch(t);
1872
1877
  if (c == null)
1873
1878
  return;
1874
- const { scene: g, canvas: u } = c;
1879
+ const { scene: u, canvas: g } = c;
1875
1880
  if (h == null)
1876
1881
  return !0;
1877
- const { left: f, top: m, width: p, height: S, angle: C, flipX: v, flipY: R, skewX: _, skewY: b } = h, w = Rn({ unitId: t, subUnitId: r, drawingId: s }), T = g.getObject(w);
1878
- if (T != null) {
1879
- T.transformByState({ left: f, top: m, width: p, height: S, angle: C, flipX: v, flipY: R, skewX: _, skewY: b });
1882
+ const { left: f, top: m, width: p, height: S, angle: C, flipX: v, flipY: R, skewX: _, skewY: b } = h, w = Dn({ unitId: t, subUnitId: r, drawingId: s }), P = u.getObject(w);
1883
+ if (P != null) {
1884
+ P.transformByState({ left: f, top: m, width: p, height: S, angle: C, flipX: v, flipY: R, skewX: _, skewY: b });
1880
1885
  return;
1881
1886
  }
1882
1887
  const D = {
@@ -1885,11 +1890,11 @@ let tt = class extends ae {
1885
1890
  width: p,
1886
1891
  height: S,
1887
1892
  zIndex: this._drawingManagerService.getDrawingOrder(t, r).length - 1
1888
- }, P = new En(w, D);
1889
- g.addObject(P, yn).attachTransformerTo(P);
1890
- const U = this._ensureMap(t, r), M = new an(), I = ze(P, c.renderObject, d.skeleton, o.worksheet), A = new Wn(I), G = {
1893
+ }, T = new On(w, D);
1894
+ u.addObject(T, Pn).attachTransformerTo(T);
1895
+ const U = this._ensureMap(t, r), M = new dn(), I = ze(T, c.renderObject, d.skeleton, o.worksheet), A = new Vn(I), G = {
1891
1896
  dispose: M,
1892
- rect: P,
1897
+ rect: T,
1893
1898
  position$: A,
1894
1899
  unitId: t,
1895
1900
  subUnitId: r
@@ -1899,21 +1904,21 @@ let tt = class extends ae {
1899
1904
  id: s,
1900
1905
  componentKey: a.componentKey,
1901
1906
  onPointerDown: (x) => {
1902
- u.dispatchEvent(new PointerEvent(x.type, x));
1907
+ g.dispatchEvent(new PointerEvent(x.type, x));
1903
1908
  },
1904
1909
  onPointerMove: (x) => {
1905
- u.dispatchEvent(new PointerEvent(x.type, x));
1910
+ g.dispatchEvent(new PointerEvent(x.type, x));
1906
1911
  },
1907
1912
  onPointerUp: (x) => {
1908
- u.dispatchEvent(new PointerEvent(x.type, x));
1913
+ g.dispatchEvent(new PointerEvent(x.type, x));
1909
1914
  },
1910
1915
  onWheel: (x) => {
1911
- u.dispatchEvent(new WheelEvent(x.type, x));
1916
+ g.dispatchEvent(new WheelEvent(x.type, x));
1912
1917
  },
1913
- props: (at = U.get(s)) == null ? void 0 : at.props
1918
+ props: (ct = (at = U.get(s)) == null ? void 0 : at.props) != null ? ct : this._getFloatDomProps(s)
1914
1919
  });
1915
- const J = P.onTransformChange$.subscribeEvent(() => {
1916
- const x = ze(P, c.renderObject, d.skeleton, o.worksheet);
1920
+ const J = T.onTransformChange$.subscribeEvent(() => {
1921
+ const x = ze(T, c.renderObject, d.skeleton, o.worksheet);
1917
1922
  A.next(
1918
1923
  x
1919
1924
  );
@@ -1929,40 +1934,36 @@ let tt = class extends ae {
1929
1934
  this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
1930
1935
  var t, r;
1931
1936
  const n = (s, o) => {
1932
- var g;
1933
- const a = this._getSceneAndTransformerByDrawingSearch(s), d = this._ensureMap(s, o), h = Array.from(d.keys()), l = le(this._univerInstanceService, { unitId: s, subUnitId: o }), c = (g = this._renderManagerService.getRenderById(s)) == null ? void 0 : g.with(ie).getWorksheetSkeleton(o);
1934
- !a || !l || !c || h.forEach((u) => {
1935
- const f = this._domLayerInfoMap.get(u);
1937
+ var u;
1938
+ const a = this._getSceneAndTransformerByDrawingSearch(s), d = this._ensureMap(s, o), h = Array.from(d.keys()), l = le(this._univerInstanceService, { unitId: s, subUnitId: o }), c = (u = this._renderManagerService.getRenderById(s)) == null ? void 0 : u.with(re).getWorksheetSkeleton(o);
1939
+ !a || !l || !c || h.forEach((g) => {
1940
+ const f = this._domLayerInfoMap.get(g);
1936
1941
  if (f) {
1937
1942
  const m = ze(f.rect, a.renderObject, c.skeleton, l.worksheet);
1938
1943
  f.position$.next(m);
1939
1944
  }
1940
1945
  });
1941
1946
  };
1942
- if (e.id === An.id) {
1947
+ if (e.id === jn.id) {
1943
1948
  const s = e.params, { unitId: o, sheetId: a } = s;
1944
1949
  n(o, a);
1945
- } else if (e.id === Nn.id) {
1950
+ } else if (e.id === Ln.id) {
1946
1951
  const s = e.params, { unitId: o } = s;
1947
1952
  Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((d) => {
1948
1953
  n(o, d);
1949
1954
  });
1950
- } else if (e.id === or.id) {
1955
+ } else if (e.id === ar.id) {
1951
1956
  const { unitId: s, subUnitId: o } = e.params;
1952
1957
  n(s, o);
1953
1958
  }
1954
1959
  }));
1955
1960
  }
1956
- _getPosition(e) {
1957
- const { startX: n, endX: t, startY: r, endY: s } = e, o = this._selectionRenderService.getSelectionCellByPosition(n, r);
1958
- if (o == null)
1961
+ _getPosition(e, n) {
1962
+ var u;
1963
+ const { startX: t, endX: r, startY: s, endY: o } = e, a = (u = this._renderManagerService.getRenderById(n)) == null ? void 0 : u.with(Ge);
1964
+ if (a == null)
1959
1965
  return;
1960
- const a = {
1961
- column: o.actualColumn,
1962
- columnOffset: n - o.startX,
1963
- row: o.actualRow,
1964
- rowOffset: r - o.startY
1965
- }, d = this._selectionRenderService.getSelectionCellByPosition(t, s);
1966
+ const d = a.getSelectionCellByPosition(t, s);
1966
1967
  if (d == null)
1967
1968
  return;
1968
1969
  const h = {
@@ -1970,10 +1971,18 @@ let tt = class extends ae {
1970
1971
  columnOffset: t - d.startX,
1971
1972
  row: d.actualRow,
1972
1973
  rowOffset: s - d.startY
1974
+ }, l = a.getSelectionCellByPosition(r, o);
1975
+ if (l == null)
1976
+ return;
1977
+ const c = {
1978
+ column: l.actualColumn,
1979
+ columnOffset: r - l.startX,
1980
+ row: l.actualRow,
1981
+ rowOffset: o - l.startY
1973
1982
  };
1974
1983
  return {
1975
- from: a,
1976
- to: h
1984
+ from: h,
1985
+ to: c
1977
1986
  };
1978
1987
  }
1979
1988
  _featureUpdateListener() {
@@ -2007,7 +2016,7 @@ let tt = class extends ae {
2007
2016
  });
2008
2017
  if (!n)
2009
2018
  throw new Error("cannot find current target!");
2010
- const { unitId: t, subUnitId: r } = n, { initPosition: s, componentKey: o } = e, a = re.generateRandomId(), d = this._getPosition(s);
2019
+ const { unitId: t, subUnitId: r } = n, { initPosition: s, componentKey: o } = e, a = ne.generateRandomId(), d = this._getPosition(s, t);
2011
2020
  if (d == null)
2012
2021
  return;
2013
2022
  this._ensureMap(t, r).set(a, e);
@@ -2051,22 +2060,29 @@ let tt = class extends ae {
2051
2060
  this._commandService.syncExecuteCommand(E.id, { unitId: r, subUnitId: s, op: l, objects: c, type: y.REMOVE });
2052
2061
  }
2053
2062
  }
2063
+ addHook(e) {
2064
+ return this._hooks.push(e), {
2065
+ dispose: () => {
2066
+ const n = this._hooks.findIndex((t) => t === e);
2067
+ this._hooks.splice(n, 1);
2068
+ }
2069
+ };
2070
+ }
2054
2071
  };
2055
- tt = ui([
2056
- ne(0, W(K)),
2057
- ne(1, he),
2058
- ne(2, W(V)),
2059
- ne(3, z),
2060
- ne(4, Ge),
2061
- ne(5, W(zn)),
2062
- ne(6, H)
2072
+ tt = gi([
2073
+ de(0, W(K)),
2074
+ de(1, he),
2075
+ de(2, W(V)),
2076
+ de(3, z),
2077
+ de(4, W(Jn)),
2078
+ de(5, k)
2063
2079
  ], tt);
2064
- var hi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, fi = (i, e, n, t) => {
2065
- for (var r = t > 1 ? void 0 : t ? mi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2080
+ var mi = Object.defineProperty, fi = Object.getOwnPropertyDescriptor, pi = (i, e, n, t) => {
2081
+ for (var r = t > 1 ? void 0 : t ? fi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2066
2082
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
2067
- return t && r && hi(e, n, r), r;
2083
+ return t && r && mi(e, n, r), r;
2068
2084
  }, Oe = (i, e) => (n, t) => e(n, t, i);
2069
- let Ne = class extends ae {
2085
+ let Ne = class extends oe {
2070
2086
  constructor(i, e, n, t) {
2071
2087
  super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = e, this._drawingManagerService = n, this._renderManagerService = t, this._initPrinting();
2072
2088
  }
@@ -2091,16 +2107,16 @@ let Ne = class extends ae {
2091
2107
  const { unitId: t, subUnitId: r } = e, s = this._renderManagerService.getRenderById(t);
2092
2108
  if (!s)
2093
2109
  return n(i);
2094
- const o = s.with(ie).getWorksheetSkeleton(r);
2110
+ const o = s.with(re).getWorksheetSkeleton(r);
2095
2111
  if (!o)
2096
2112
  return n(i);
2097
2113
  const a = this._drawingManagerService.getDrawingDataForUnit(t), d = a == null ? void 0 : a[e.subUnitId];
2098
2114
  if (!d)
2099
2115
  return n(i);
2100
- const { scaleX: h, scaleY: l } = s.scene, c = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = d.order.map((u) => d.data[u]).filter((u) => u.drawingType !== Ve.DRAWING_DOM);
2101
- return g.length ? (g.forEach((u) => {
2102
- if (!u.groupId && u.transform && re.isDefine(u.transform.left) && re.isDefine(u.transform.top) && re.isDefine(u.transform.width) && re.isDefine(u.transform.height)) {
2103
- const f = o.skeleton.getCellPositionByOffset(u.transform.left, u.transform.top, h, l, { x: 0, y: 0 }), m = o.skeleton.getCellPositionByOffset(u.transform.left + u.transform.width, u.transform.top + u.transform.height, h, l, { x: 0, y: 0 });
2116
+ const { scaleX: h, scaleY: l } = s.scene, c = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, u = d.order.map((g) => d.data[g]).filter((g) => g.drawingType !== Ve.DRAWING_DOM);
2117
+ return u.length ? (u.forEach((g) => {
2118
+ if (!g.groupId && g.transform && ne.isDefine(g.transform.left) && ne.isDefine(g.transform.top) && ne.isDefine(g.transform.width) && ne.isDefine(g.transform.height)) {
2119
+ const f = o.skeleton.getCellPositionByOffset(g.transform.left, g.transform.top, h, l, { x: 0, y: 0 }), m = o.skeleton.getCellPositionByOffset(g.transform.left + g.transform.width, g.transform.top + g.transform.height, h, l, { x: 0, y: 0 });
2104
2120
  f.column < c.startColumn && (c.startColumn = f.column), f.row < c.startRow && (c.startRow = f.row), c.endRow < m.row && (c.endRow = m.row), c.endColumn < m.column && (c.endColumn = m.column);
2105
2121
  }
2106
2122
  }), n(c)) : n(i);
@@ -2110,19 +2126,19 @@ let Ne = class extends ae {
2110
2126
  );
2111
2127
  }
2112
2128
  };
2113
- Ne = fi([
2114
- se(oe.Rendered, Ne),
2115
- Oe(0, W(jn)),
2116
- Oe(1, W(wn)),
2129
+ Ne = pi([
2130
+ ie(se.Rendered, Ne),
2131
+ Oe(0, W(Bn)),
2132
+ Oe(1, W(vn)),
2117
2133
  Oe(2, z),
2118
2134
  Oe(3, K)
2119
2135
  ], Ne);
2120
- var pi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, _i = (i, e, n, t) => {
2121
- for (var r = t > 1 ? void 0 : t ? wi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2136
+ var wi = Object.defineProperty, _i = Object.getOwnPropertyDescriptor, vi = (i, e, n, t) => {
2137
+ for (var r = t > 1 ? void 0 : t ? _i(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2122
2138
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
2123
- return t && r && pi(e, n, r), r;
2139
+ return t && r && wi(e, n, r), r;
2124
2140
  }, fe = (i, e) => (n, t) => e(n, t, i);
2125
- let je = class extends ae {
2141
+ let je = class extends oe {
2126
2142
  constructor(i, e, n, t, r) {
2127
2143
  super(), this._drawingManagerService = i, this._renderManagerService = e, this._permissionService = n, this._univerInstanceService = t, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
2128
2144
  }
@@ -2140,15 +2156,15 @@ let je = class extends ae {
2140
2156
  return;
2141
2157
  }
2142
2158
  const r = e.getUnitId(), s = t.getSheetId();
2143
- if (this._permissionService.composePermission([new ft(r).id, new Xe(r, s).id]).every((a) => a.value))
2159
+ if (this._permissionService.composePermission([new pt(r).id, new He(r, s).id]).every((a) => a.value))
2144
2160
  this._drawingManagerService.setDrawingVisible(!0);
2145
2161
  else {
2146
2162
  this._drawingManagerService.setDrawingVisible(!1);
2147
- const a = e.getUnitId(), d = t.getSheetId(), h = this._drawingManagerService.getDrawingData(a, d), l = Object.values(h), c = this._renderManagerService.getRenderById(a), g = c == null ? void 0 : c.scene;
2148
- if (g == null)
2163
+ const a = e.getUnitId(), d = t.getSheetId(), h = this._drawingManagerService.getDrawingData(a, d), l = Object.values(h), c = this._renderManagerService.getRenderById(a), u = c == null ? void 0 : c.scene;
2164
+ if (u == null)
2149
2165
  return;
2150
- g.getAllObjects().forEach((f) => {
2151
- f.classType === ce.IMAGE && l.some((m) => f.oKey.includes(m.drawingId)) && g.removeObject(f);
2166
+ u.getAllObjects().forEach((f) => {
2167
+ f.classType === ae.IMAGE && l.some((m) => f.oKey.includes(m.drawingId)) && u.removeObject(f);
2152
2168
  });
2153
2169
  }
2154
2170
  });
@@ -2169,15 +2185,15 @@ let je = class extends ae {
2169
2185
  return;
2170
2186
  }
2171
2187
  const r = e.getUnitId(), s = t.getSheetId();
2172
- if (this._permissionService.composePermission([new Ze(r).id, new Te(r, s).id]).every((a) => a.value))
2188
+ if (this._permissionService.composePermission([new Ze(r).id, new Pe(r, s).id]).every((a) => a.value))
2173
2189
  this._drawingManagerService.setDrawingEditable(!0);
2174
2190
  else {
2175
2191
  this._drawingManagerService.setDrawingEditable(!1);
2176
- const a = e.getUnitId(), d = t.getSheetId(), h = this._drawingManagerService.getDrawingData(a, d), l = Object.values(h), c = this._renderManagerService.getRenderById(a), g = c == null ? void 0 : c.scene;
2177
- if (g == null)
2192
+ const a = e.getUnitId(), d = t.getSheetId(), h = this._drawingManagerService.getDrawingData(a, d), l = Object.values(h), c = this._renderManagerService.getRenderById(a), u = c == null ? void 0 : c.scene;
2193
+ if (u == null)
2178
2194
  return;
2179
- g.getAllObjects().forEach((f) => {
2180
- f.classType === ce.IMAGE && l.some((m) => f.oKey.includes(m.drawingId)) && g.detachTransformerFrom(f);
2195
+ u.getAllObjects().forEach((f) => {
2196
+ f.classType === ae.IMAGE && l.some((m) => f.oKey.includes(m.drawingId)) && u.detachTransformerFrom(f);
2181
2197
  });
2182
2198
  }
2183
2199
  });
@@ -2197,26 +2213,26 @@ let je = class extends ae {
2197
2213
  const a = this._renderManagerService.getRenderById(r), d = a == null ? void 0 : a.scene;
2198
2214
  if (d == null)
2199
2215
  return;
2200
- const h = d.getTransformerByCreate(), l = this._permissionService.composePermission$([new ft(r).id, new Xe(r, s).id]).pipe(mt((g) => g.every((u) => u.value)));
2216
+ const h = d.getTransformerByCreate(), l = this._permissionService.composePermission$([new pt(r).id, new He(r, s).id]).pipe(ft((u) => u.every((g) => g.value)));
2201
2217
  l == null || l.pipe(
2202
- Me((g) => g !== o),
2218
+ Me((u) => u !== o),
2203
2219
  De()
2204
2220
  ).subscribe({
2205
- next: (g) => {
2206
- o = g, this._drawingManagerService.setDrawingVisible(g);
2207
- const u = d.getAllObjects(), f = this._drawingManagerService.getDrawingData(r, s), m = Object.values(f);
2208
- g ? this._drawingManagerService.addNotification(m) : (u.forEach((p) => {
2209
- p.classType === ce.IMAGE && m.some((S) => p.oKey.includes(S.drawingId)) && d.removeObject(p);
2221
+ next: (u) => {
2222
+ o = u, this._drawingManagerService.setDrawingVisible(u);
2223
+ const g = d.getAllObjects(), f = this._drawingManagerService.getDrawingData(r, s), m = Object.values(f);
2224
+ u ? this._drawingManagerService.addNotification(m) : (g.forEach((p) => {
2225
+ p.classType === ae.IMAGE && m.some((S) => p.oKey.includes(S.drawingId)) && d.removeObject(p);
2210
2226
  }), h.clearSelectedObjects());
2211
2227
  }
2212
- }), (c = this._permissionService.getPermissionPoint$(new Xe(r, s).id)) == null || c.pipe(
2213
- Me((g) => g.value !== o),
2228
+ }), (c = this._permissionService.getPermissionPoint$(new He(r, s).id)) == null || c.pipe(
2229
+ Me((u) => u.value !== o),
2214
2230
  De()
2215
2231
  ).subscribe({
2216
2232
  complete: () => {
2217
2233
  o = !0, this._drawingManagerService.setDrawingVisible(!0);
2218
- const g = this._drawingManagerService.getDrawingData(r, s), u = Object.values(g);
2219
- this._drawingManagerService.addNotification(u);
2234
+ const u = this._drawingManagerService.getDrawingData(r, s), g = Object.values(u);
2235
+ this._drawingManagerService.addNotification(g);
2220
2236
  }
2221
2237
  });
2222
2238
  });
@@ -2236,31 +2252,31 @@ let je = class extends ae {
2236
2252
  const a = this._renderManagerService.getRenderById(r), d = a == null ? void 0 : a.scene;
2237
2253
  if (d == null)
2238
2254
  return;
2239
- const h = d.getTransformerByCreate(), l = this._permissionService.composePermission$([new Ze(r).id, new Te(r, s).id]).pipe(mt((g) => g.every((u) => u.value)));
2255
+ const h = d.getTransformerByCreate(), l = this._permissionService.composePermission$([new Ze(r).id, new Pe(r, s).id]).pipe(ft((u) => u.every((g) => g.value)));
2240
2256
  l == null || l.pipe(
2241
- Me((g) => g !== o),
2257
+ Me((u) => u !== o),
2242
2258
  De()
2243
2259
  ).subscribe({
2244
- next: (g) => {
2245
- o = g, this._drawingManagerService.setDrawingEditable(g);
2246
- const u = d.getAllObjects(), f = this._drawingManagerService.getDrawingData(r, s), m = Object.values(f);
2247
- g ? (u.forEach((p) => {
2248
- p.classType === ce.IMAGE && m.some((S) => p.oKey.includes(S.drawingId)) && d.attachTransformerTo(p);
2249
- }), this._drawingManagerService.addNotification(m)) : (u.forEach((p) => {
2250
- p.classType === ce.IMAGE && m.some((S) => p.oKey.includes(S.drawingId)) && d.detachTransformerFrom(p);
2260
+ next: (u) => {
2261
+ o = u, this._drawingManagerService.setDrawingEditable(u);
2262
+ const g = d.getAllObjects(), f = this._drawingManagerService.getDrawingData(r, s), m = Object.values(f);
2263
+ u ? (g.forEach((p) => {
2264
+ p.classType === ae.IMAGE && m.some((S) => p.oKey.includes(S.drawingId)) && d.attachTransformerTo(p);
2265
+ }), this._drawingManagerService.addNotification(m)) : (g.forEach((p) => {
2266
+ p.classType === ae.IMAGE && m.some((S) => p.oKey.includes(S.drawingId)) && d.detachTransformerFrom(p);
2251
2267
  }), h.clearSelectedObjects());
2252
2268
  }
2253
- }), (c = this._permissionService.getPermissionPoint$(new Te(r, s).id)) == null || c.pipe(
2254
- Me((g) => g.value !== o),
2269
+ }), (c = this._permissionService.getPermissionPoint$(new Pe(r, s).id)) == null || c.pipe(
2270
+ Me((u) => u.value !== o),
2255
2271
  De()
2256
2272
  ).subscribe({
2257
2273
  complete: () => {
2258
2274
  o = !0;
2259
- const g = e.getUnitId(), u = t.getSheetId(), f = this._drawingManagerService.getDrawingData(g, u), m = Object.values(f), p = this._renderManagerService.getRenderById(g), S = p == null ? void 0 : p.scene;
2275
+ const u = e.getUnitId(), g = t.getSheetId(), f = this._drawingManagerService.getDrawingData(u, g), m = Object.values(f), p = this._renderManagerService.getRenderById(u), S = p == null ? void 0 : p.scene;
2260
2276
  if (S == null)
2261
2277
  return;
2262
2278
  this._drawingManagerService.setDrawingEditable(!0), S.getAllObjects().forEach((v) => {
2263
- v.classType === ce.IMAGE && m.some((R) => v.oKey.includes(R.drawingId)) && S.detachTransformerFrom(v);
2279
+ v.classType === ae.IMAGE && m.some((R) => v.oKey.includes(R.drawingId)) && S.detachTransformerFrom(v);
2264
2280
  });
2265
2281
  }
2266
2282
  });
@@ -2269,23 +2285,23 @@ let je = class extends ae {
2269
2285
  );
2270
2286
  }
2271
2287
  };
2272
- je = _i([
2273
- se(oe.Rendered, je),
2288
+ je = vi([
2289
+ ie(se.Rendered, je),
2274
2290
  fe(0, z),
2275
2291
  fe(1, K),
2276
- fe(2, dn),
2292
+ fe(2, un),
2277
2293
  fe(3, he),
2278
- fe(4, W(cn))
2294
+ fe(4, W(ln))
2279
2295
  ], je);
2280
- var vi = Object.defineProperty, Si = Object.getOwnPropertyDescriptor, Ci = (i, e, n, t) => {
2281
- for (var r = t > 1 ? void 0 : t ? Si(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2296
+ var Si = Object.defineProperty, Ci = Object.getOwnPropertyDescriptor, Ii = (i, e, n, t) => {
2297
+ for (var r = t > 1 ? void 0 : t ? Ci(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2282
2298
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
2283
- return t && r && vi(e, n, r), r;
2299
+ return t && r && Si(e, n, r), r;
2284
2300
  }, Ke = (i, e) => (n, t) => e(n, t, i);
2285
- let Le = class extends ae {
2301
+ let Le = class extends oe {
2286
2302
  constructor(e, n, t) {
2287
2303
  super();
2288
- X(this, "_copyInfo");
2304
+ H(this, "_copyInfo");
2289
2305
  this._sheetClipboardService = e, this._renderManagerService = n, this._sheetDrawingService = t, this._initCopyPaste();
2290
2306
  }
2291
2307
  _initCopyPaste() {
@@ -2293,22 +2309,22 @@ let Le = class extends ae {
2293
2309
  id: "SHEET_IMAGE_UI_PLUGIN",
2294
2310
  onBeforeCopy: (e, n, t) => this._collect(e, n, t),
2295
2311
  onPasteCells: (e, n, t, r) => {
2296
- const { copyType: s = ut.COPY, pasteType: o } = r, { range: a } = e || {}, { range: d, unitId: h, subUnitId: l } = n;
2312
+ const { copyType: s = gt.COPY, pasteType: o } = r, { range: a } = e || {}, { range: d, unitId: h, subUnitId: l } = n;
2297
2313
  return this._generateMutations(d, { copyType: s, pasteType: o, copyRange: a, unitId: h, subUnitId: l });
2298
2314
  },
2299
2315
  onPastePlainText: (e, n) => ({ undos: [], redos: [] })
2300
2316
  });
2301
2317
  }
2302
2318
  _collect(e, n, t) {
2303
- var g;
2304
- const r = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(ie);
2319
+ var u;
2320
+ const r = (u = this._renderManagerService.getRenderById(e)) == null ? void 0 : u.with(re);
2305
2321
  if (!r) return;
2306
2322
  const s = r.attachRangeWithCoord(t);
2307
2323
  if (!s)
2308
2324
  return;
2309
2325
  const { startX: o, endX: a, startY: d, endY: h } = s, l = this._sheetDrawingService.getDrawingData(e, n), c = [];
2310
- Object.keys(l).forEach((u) => {
2311
- const f = l[u], { transform: m } = f;
2326
+ Object.keys(l).forEach((g) => {
2327
+ const f = l[g], { transform: m } = f;
2312
2328
  if (f.anchorType !== O.Both || !m)
2313
2329
  return;
2314
2330
  const { left: p = 0, top: S = 0, width: C = 0, height: v = 0 } = m, { drawingStartX: R, drawingEndX: _, drawingStartY: b, drawingEndY: w } = {
@@ -2341,7 +2357,7 @@ let Le = class extends ae {
2341
2357
  const { copyRange: t } = n;
2342
2358
  if (!t)
2343
2359
  return { redos: [], undos: [] };
2344
- const { drawings: r, unitId: s, subUnitId: o } = this._copyInfo, { ranges: [a, d], mapFunc: h } = Ln([t, e]), { row: l, col: c } = h(a.startRow, a.startColumn), { row: g, col: u } = h(d.startRow, d.startColumn), f = (D = this._renderManagerService.getRenderById(s)) == null ? void 0 : D.with(ie);
2360
+ const { drawings: r, unitId: s, subUnitId: o } = this._copyInfo, { ranges: [a, d], mapFunc: h } = Wn([t, e]), { row: l, col: c } = h(a.startRow, a.startColumn), { row: u, col: g } = h(d.startRow, d.startColumn), f = (D = this._renderManagerService.getRenderById(s)) == null ? void 0 : D.with(re);
2345
2361
  if (!f)
2346
2362
  return { redos: [], undos: [] };
2347
2363
  const m = f.attachRangeWithCoord({
@@ -2350,23 +2366,23 @@ let Le = class extends ae {
2350
2366
  startColumn: c,
2351
2367
  endColumn: c
2352
2368
  }), p = f.attachRangeWithCoord({
2353
- startRow: g,
2354
- endRow: g,
2355
- startColumn: u,
2356
- endColumn: u
2369
+ startRow: u,
2370
+ endRow: u,
2371
+ startColumn: g,
2372
+ endColumn: g
2357
2373
  });
2358
2374
  if (!m || !p)
2359
2375
  return { redos: [], undos: [] };
2360
- const S = [], C = [], v = p.startX - m.startX, R = p.startY - m.startY, _ = g - l, b = u - c, w = n.copyType === ut.CUT, { _sheetDrawingService: T } = this;
2361
- return r.forEach((P) => {
2362
- const { transform: U, sheetTransform: M } = P;
2376
+ const S = [], C = [], v = p.startX - m.startX, R = p.startY - m.startY, _ = u - l, b = g - c, w = n.copyType === gt.CUT, { _sheetDrawingService: P } = this;
2377
+ return r.forEach((T) => {
2378
+ const { transform: U, sheetTransform: M } = T;
2363
2379
  if (!U)
2364
2380
  return;
2365
2381
  const I = {
2366
- ...P,
2382
+ ...T,
2367
2383
  unitId: s,
2368
2384
  subUnitId: o,
2369
- drawingId: w ? P.drawingId : re.generateRandomId(),
2385
+ drawingId: w ? T.drawingId : ne.generateRandomId(),
2370
2386
  transform: {
2371
2387
  ...U,
2372
2388
  left: U.left + v,
@@ -2378,7 +2394,7 @@ let Le = class extends ae {
2378
2394
  }
2379
2395
  };
2380
2396
  if (w) {
2381
- const { undo: A, redo: G, objects: J } = T.getBatchUpdateOp([I]);
2397
+ const { undo: A, redo: G, objects: J } = P.getBatchUpdateOp([I]);
2382
2398
  S.push({
2383
2399
  id: E.id,
2384
2400
  params: {
@@ -2399,7 +2415,7 @@ let Le = class extends ae {
2399
2415
  }
2400
2416
  });
2401
2417
  } else {
2402
- const { undo: A, redo: G, objects: J } = T.getBatchAddOp([I]);
2418
+ const { undo: A, redo: G, objects: J } = P.getBatchAddOp([I]);
2403
2419
  S.push({ id: E.id, params: { op: G, unitId: s, subUnitId: o, objects: J, type: y.INSERT } }), C.push({ id: E.id, params: { op: A, unitId: s, subUnitId: o, objects: J, type: y.REMOVE } });
2404
2420
  }
2405
2421
  }), {
@@ -2408,23 +2424,23 @@ let Le = class extends ae {
2408
2424
  };
2409
2425
  }
2410
2426
  };
2411
- Le = Ci([
2412
- se(oe.Ready, Le),
2413
- Ke(0, Bn),
2427
+ Le = Ii([
2428
+ ie(se.Ready, Le),
2429
+ Ke(0, $n),
2414
2430
  Ke(1, K),
2415
- Ke(2, H)
2431
+ Ke(2, k)
2416
2432
  ], Le);
2417
- var Zt = Object.defineProperty, Ii = Object.getOwnPropertyDescriptor, Ri = (i, e, n) => e in i ? Zt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, Mi = (i, e, n, t) => {
2418
- for (var r = t > 1 ? void 0 : t ? Ii(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2433
+ var qt = Object.defineProperty, Ri = Object.getOwnPropertyDescriptor, Mi = (i, e, n) => e in i ? qt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, Di = (i, e, n, t) => {
2434
+ for (var r = t > 1 ? void 0 : t ? Ri(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2419
2435
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
2420
- return t && r && Zt(e, n, r), r;
2421
- }, Je = (i, e) => (n, t) => e(n, t, i), qt = (i, e, n) => Ri(i, typeof e != "symbol" ? e + "" : e, n);
2422
- const Di = "SHEET_IMAGE_UI_PLUGIN";
2423
- let $e = class extends ln {
2436
+ return t && r && qt(e, n, r), r;
2437
+ }, Je = (i, e) => (n, t) => e(n, t, i), Qt = (i, e, n) => Mi(i, typeof e != "symbol" ? e + "" : e, n);
2438
+ const bi = "SHEET_IMAGE_UI_PLUGIN";
2439
+ let $e = class extends gn {
2424
2440
  constructor(e = {}, n, t, r) {
2425
2441
  super();
2426
- X(this, "_pluginConfig");
2427
- this._injector = n, this._localeService = t, this._renderManagerService = r, this._pluginConfig = re.deepMerge({}, ri, e);
2442
+ H(this, "_pluginConfig");
2443
+ this._injector = n, this._localeService = t, this._renderManagerService = r, this._pluginConfig = ne.deepMerge({}, ii, e);
2428
2444
  }
2429
2445
  onStarting(e) {
2430
2446
  super.onStarting(e), this._initDependencies(e);
@@ -2443,7 +2459,7 @@ let $e = class extends ln {
2443
2459
  useFactory: () => this._injector.createInstance(pe, this._pluginConfig)
2444
2460
  }
2445
2461
  ],
2446
- [Pe],
2462
+ [Te],
2447
2463
  [Ne],
2448
2464
  [je]
2449
2465
  ], t = [
@@ -2460,28 +2476,28 @@ let $e = class extends ln {
2460
2476
  });
2461
2477
  }
2462
2478
  };
2463
- qt($e, "type", B.UNIVER_SHEET);
2464
- qt($e, "pluginName", Di);
2465
- $e = Mi([
2466
- un(Mn, _n, vn),
2479
+ Qt($e, "type", B.UNIVER_SHEET);
2480
+ Qt($e, "pluginName", bi);
2481
+ $e = Di([
2482
+ hn(bn, Sn, Cn),
2467
2483
  Je(1, W(nt)),
2468
2484
  Je(2, W(_e)),
2469
2485
  Je(3, K)
2470
2486
  ], $e);
2471
2487
  export {
2472
2488
  j as ClearSheetDrawingTransformerOperation,
2473
- Jt as DeleteDrawingsCommand,
2474
- Vt as EditSheetDrawingOperation,
2475
- xt as GroupSheetDrawingCommand,
2489
+ Zt as DeleteDrawingsCommand,
2490
+ Gt as EditSheetDrawingOperation,
2491
+ Ft as GroupSheetDrawingCommand,
2476
2492
  Be as InsertCellImageOperation,
2477
2493
  xe as InsertFloatImageOperation,
2478
2494
  st as InsertSheetDrawingCommand,
2479
2495
  ve as MoveDrawingsCommand,
2480
2496
  it as RemoveSheetDrawingCommand,
2481
- Gt as SetDrawingArrangeCommand,
2497
+ xt as SetDrawingArrangeCommand,
2482
2498
  Fe as SetSheetDrawingCommand,
2483
2499
  tt as SheetCanvasFloatDomManagerService,
2484
- $t as SidebarSheetDrawingOperation,
2485
- Ft as UngroupSheetDrawingCommand,
2500
+ Vt as SidebarSheetDrawingOperation,
2501
+ Yt as UngroupSheetDrawingCommand,
2486
2502
  $e as UniverSheetsDrawingUIPlugin
2487
2503
  };