@univerjs/sheets-drawing-ui 0.9.1-nightly.202507081607 → 0.9.1-nightly.202507101607

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1,25 +1,77 @@
1
1
  var yr = Object.defineProperty;
2
2
  var Er = (i, t, e) => t in i ? yr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
3
  var ee = (i, t, e) => Er(i, typeof t != "symbol" ? t + "" : t, e);
4
- import { CommandType as J, ICommandService as G, IUndoRedoService as xe, sequenceExecute as xn, DrawingTypeEnum as B, ArrangeTypeEnum as mt, Inject as A, IContextService as Yn, LocaleService as tt, Injector as Ye, Disposable as ne, createDocumentModelWithStyle as Vt, ObjectRelativeFromV as mn, ObjectRelativeFromH as pn, WrapTextType as wn, PositionedObjectLayoutType as _n, BooleanNumber as Sn, BuildTextUtils as Ht, ImageSourceType as vn, generateRandomId as Dt, FOCUSING_COMMON_DRAWINGS as $e, IUniverInstanceService as Se, UniverInstanceType as F, Direction as _e, IImageIoService as Tr, RxDisposable as Or, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ze, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Be, InterceptorEffectEnum as Ur, ObjectMatrix as Pr, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Ar, Tools as Re, IPermissionService as Nr, UserManagerService as kr, LifecycleService as Wr, LifecycleStages as Br, DisposableCollection as pt, fromEventSubject as jr, PRINT_CHART_COMPONENT_KEY as $r, Rectangle as Fr, FOCUSING_FX_BAR_EDITOR as xr, EDITOR_ACTIVATED as Yr, FOCUSING_PANEL_EDITOR as Xr, DependentOn as Gr, IConfigService as Lr, Plugin as Vr, merge as Hr, registerDependencies as zr, touchDependencies as Ft } from "@univerjs/core";
5
- import { ISheetDrawingService as re, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as Kr } from "@univerjs/sheets-drawing";
6
- import { SheetInterceptorService as At, SheetsSelectionsService as sn, SetRangeValuesCommand as In, getSheetCommandTarget as se, INTERCEPTOR_POINT as Jr, InterceptCellContentPriority as Zr, WorkbookViewPermission as Cn, WorksheetViewPermission as Dn, WorkbookEditablePermission as zt, WorksheetEditPermission as Kt, SetFrozenMutation as qr, SetWorksheetRowAutoHeightMutation as Qr, COMMAND_LISTENER_SKELETON_CHANGE as ei, InsertRowCommand as Xn, InsertColCommand as Gn, RemoveRowCommand as Ln, RemoveColCommand as Vn, DeleteRangeMoveLeftCommand as Hn, DeleteRangeMoveUpCommand as zn, InsertRangeMoveDownCommand as Kn, InsertRangeMoveRightCommand as Jn, DeltaRowHeightCommand as Jt, SetRowHeightCommand as Zt, DeltaColumnWidthCommand as Zn, SetColWidthCommand as qn, SetRowHiddenCommand as Qn, SetSpecificRowsVisibleCommand as er, SetSpecificColsVisibleCommand as tr, SetColHiddenCommand as nr, MoveColsCommand as rr, MoveRowsCommand as ir, MoveRangeCommand as sr, SetRowVisibleMutation as ti, SetRowHiddenMutation as ni, SetColVisibleMutation as ri, SetColHiddenMutation as ii, SetWorksheetRowHeightMutation as si, SetWorksheetColWidthMutation as oi, SetWorksheetActiveOperation as ai, RangeProtectionPermissionEditPoint as ci } from "@univerjs/sheets";
7
- import { IRenderManagerService as Z, transformObjectOutOfGroup as di, getGroupState as li, precisionTo as wt, getCurrentTypeOfRenderer as on, CURSOR_TYPE as ui, RENDER_CLASS_TYPE as Ue, Rect as Pe, ObjectType as Rn, DRAWING_OBJECT_LAYER_INDEX as xt, SHEET_VIEWPORT_KEY as or } from "@univerjs/engine-render";
8
- import { MessageType as pe, render as hi, unmount as gi, clsx as fi, RadioGroup as mi, Radio as Yt } from "@univerjs/design";
9
- import { docDrawingPositionToTransform as bn, ReplaceSnapshotCommand as pi, InnerPasteCommand as wi } from "@univerjs/docs-ui";
10
- import { IImageIoService as _i, IDrawingManagerService as ie, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Mn, DRAWING_IMAGE_COUNT_LIMIT as yn, ImageUploadStatusType as Ae, DRAWING_IMAGE_ALLOW_SIZE as En, getImageSize as Xt, SetDrawingSelectedOperation as Nt, DRAWING_IMAGE_WIDTH_LIMIT as Tn, DRAWING_IMAGE_HEIGHT_LIMIT as On, ImageSourceType as Si, getDrawingShapeKeyByDrawingSearch as ve, UniverDrawingPlugin as vi } from "@univerjs/drawing";
11
- import { convertPositionSheetOverGridToAbsolute as Ii, SheetSkeletonManagerService as V, ISheetSelectionRenderService as Xe, attachRangeWithCoord as ar, SheetCanvasPopManagerService as Ci, HoverManagerService as Di, IEditorBridgeService as Ri, IAutoFillService as bi, EditingRenderController as Mi, SetCellEditVisibleOperation as Un, PREDEFINED_HOOK_NAME as je, COPY_TYPE as Ie, discreteRangeToRange as Pn, virtualizeDiscreteRanges as yi, ISheetClipboardService as Ei, SetZoomRatioOperation as An, SetScrollOperation as Ti, SheetPrintInterceptorService as Oi, getCurrentRangeDisable$ as Ui } from "@univerjs/sheets-ui";
12
- import { ILocalFileService as Pi, IMessageService as cr, ISidebarService as Ai, IDialogService as Ni, IClipboardInterfaceService as ki, CanvasFloatDomService as Wi, PrintFloatDomSingle as Bi, ComponentManager as dr, connectInjector as ji, useDependency as qe, getMenuHiddenObservable as an, MenuItemType as cn, RibbonInsertGroup as $i, KeyCode as Fe, IMenuManagerService as Fi, IShortcutService as xi } from "@univerjs/ui";
4
+ import { precisionTo as mt, IRenderManagerService as J, transformObjectOutOfGroup as Tr, getGroupState as Or, getCurrentTypeOfRenderer as sn, CURSOR_TYPE as Ur, RENDER_CLASS_TYPE as Oe, Rect as Ve, ObjectType as mn, DRAWING_OBJECT_LAYER_INDEX as Ft, SHEET_VIEWPORT_KEY as xn } from "@univerjs/engine-render";
5
+ import { convertPositionSheetOverGridToAbsolute as Pr, SheetSkeletonManagerService as V, ISheetSelectionRenderService as Fe, attachRangeWithCoord as Yn, SheetCanvasPopManagerService as Ar, HoverManagerService as Nr, IEditorBridgeService as kr, IAutoFillService as Wr, EditingRenderController as Br, SetCellEditVisibleOperation as pn, PREDEFINED_HOOK_NAME as We, COPY_TYPE as ve, discreteRangeToRange as wn, virtualizeDiscreteRanges as jr, ISheetClipboardService as $r, SetZoomRatioOperation as _n, SetScrollOperation as Fr, SheetPrintInterceptorService as xr, getCurrentRangeDisable$ as Yr } from "@univerjs/sheets-ui";
6
+ import { CommandType as Z, ICommandService as G, IUndoRedoService as xe, sequenceExecute as Xn, DrawingTypeEnum as B, ArrangeTypeEnum as pt, Inject as A, IContextService as Gn, LocaleService as tt, Injector as Ye, Disposable as ne, createDocumentModelWithStyle as Vt, ObjectRelativeFromV as Sn, ObjectRelativeFromH as vn, WrapTextType as In, PositionedObjectLayoutType as Cn, BooleanNumber as Dn, BuildTextUtils as Ht, ImageSourceType as Rn, generateRandomId as Dt, FOCUSING_COMMON_DRAWINGS as je, IUniverInstanceService as Se, UniverInstanceType as F, Direction as _e, IImageIoService as Xr, RxDisposable as Gr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ze, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Be, InterceptorEffectEnum as Lr, ObjectMatrix as Vr, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Hr, Tools as De, IPermissionService as zr, UserManagerService as Kr, LifecycleService as Jr, LifecycleStages as Zr, DisposableCollection as wt, fromEventSubject as qr, PRINT_CHART_COMPONENT_KEY as Qr, Rectangle as ei, FOCUSING_FX_BAR_EDITOR as ti, EDITOR_ACTIVATED as ni, FOCUSING_PANEL_EDITOR as ri, DependentOn as ii, IConfigService as si, Plugin as oi, merge as ai, registerDependencies as ci, touchDependencies as xt } from "@univerjs/core";
7
+ import { ISheetDrawingService as re, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as di } from "@univerjs/sheets-drawing";
8
+ import { SheetInterceptorService as At, SheetsSelectionsService as on, SetRangeValuesCommand as bn, getSheetCommandTarget as se, INTERCEPTOR_POINT as li, InterceptCellContentPriority as ui, WorkbookViewPermission as Mn, WorksheetViewPermission as yn, WorkbookEditablePermission as zt, WorksheetEditPermission as Kt, SetFrozenMutation as hi, SetWorksheetRowAutoHeightMutation as gi, COMMAND_LISTENER_SKELETON_CHANGE as fi, InsertRowCommand as Ln, InsertColCommand as Vn, RemoveRowCommand as Hn, RemoveColCommand as zn, DeleteRangeMoveLeftCommand as Kn, DeleteRangeMoveUpCommand as Jn, InsertRangeMoveDownCommand as Zn, InsertRangeMoveRightCommand as qn, DeltaRowHeightCommand as Jt, SetRowHeightCommand as Zt, DeltaColumnWidthCommand as Qn, SetColWidthCommand as er, SetRowHiddenCommand as tr, SetSpecificRowsVisibleCommand as nr, SetSpecificColsVisibleCommand as rr, SetColHiddenCommand as ir, MoveColsCommand as sr, MoveRowsCommand as or, MoveRangeCommand as ar, SetRowVisibleMutation as mi, SetRowHiddenMutation as pi, SetColVisibleMutation as wi, SetColHiddenMutation as _i, SetWorksheetRowHeightMutation as Si, SetWorksheetColWidthMutation as vi, SetWorksheetActiveOperation as Ii, RangeProtectionPermissionEditPoint as Ci } from "@univerjs/sheets";
9
+ import { MessageType as pe, render as Di, unmount as Ri, clsx as bi, RadioGroup as Mi, Radio as Yt } from "@univerjs/design";
10
+ import { docDrawingPositionToTransform as En, ReplaceSnapshotCommand as yi, InnerPasteCommand as Ei } from "@univerjs/docs-ui";
11
+ import { IImageIoService as Ti, IDrawingManagerService as ie, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Tn, DRAWING_IMAGE_COUNT_LIMIT as On, ImageUploadStatusType as Ue, DRAWING_IMAGE_ALLOW_SIZE as Un, getImageSize as Xt, SetDrawingSelectedOperation as Nt, DRAWING_IMAGE_WIDTH_LIMIT as Pn, DRAWING_IMAGE_HEIGHT_LIMIT as An, ImageSourceType as Oi, getDrawingShapeKeyByDrawingSearch as Pe, UniverDrawingPlugin as Ui } from "@univerjs/drawing";
12
+ import { ILocalFileService as Pi, IMessageService as cr, ISidebarService as Ai, IDialogService as Ni, IClipboardInterfaceService as ki, CanvasFloatDomService as Wi, PrintFloatDomSingle as Bi, ComponentManager as dr, connectInjector as ji, useDependency as qe, getMenuHiddenObservable as an, MenuItemType as cn, RibbonInsertGroup as $i, KeyCode as $e, IMenuManagerService as Fi, IShortcutService as xi } from "@univerjs/ui";
13
13
  import { DocDrawingController as Yi, UniverDocsDrawingPlugin as Xi } from "@univerjs/docs-drawing";
14
14
  import { ImageCropperObject as Gi, COMPONENT_IMAGE_POPUP_MENU as Li, OpenImageCropOperation as Vi, ImageResetSizeOperation as Hi, DrawingRenderService as lr, DrawingCommonPanel as zi, UniverDrawingUIPlugin as Ki } from "@univerjs/drawing-ui";
15
- import { takeUntil as Nn, throttleTime as Ji, combineLatest as _t, switchMap as we, EMPTY as fe, tap as kn, map as be, distinctUntilChanged as Wn, Subject as Gt, filter as Zi, take as qi, BehaviorSubject as We, of as Bn } from "rxjs";
15
+ import { takeUntil as Nn, throttleTime as Ji, combineLatest as _t, switchMap as we, EMPTY as fe, tap as kn, map as Re, distinctUntilChanged as Wn, Subject as Gt, filter as Zi, take as qi, BehaviorSubject as ke, of as Bn } from "rxjs";
16
16
  import { jsx as oe, jsxs as qt } from "react/jsx-runtime";
17
17
  import { useMemo as Qi, useState as Qt, useEffect as ur } from "react";
18
+ function z(i, t, e) {
19
+ const { from: n, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: l = 0, skewY: u = 0 } = i, c = e.getCurrent();
20
+ if (c == null)
21
+ return;
22
+ const d = Pr(
23
+ c.unitId,
24
+ c.sheetId,
25
+ { from: n, to: r },
26
+ e
27
+ );
28
+ let { left: g, top: h, width: f, height: p } = d;
29
+ const m = e.getCurrentSkeleton(), _ = m.rowHeaderWidth + m.columnTotalWidth, v = m.columnHeaderHeight + m.rowTotalHeight;
30
+ return g + f > _ && (g = _ - f), h + p > v && (h = v - p), {
31
+ flipY: s,
32
+ flipX: o,
33
+ angle: a,
34
+ skewX: l,
35
+ skewY: u,
36
+ left: g,
37
+ top: h,
38
+ width: f,
39
+ height: p
40
+ };
41
+ }
42
+ function $(i, t) {
43
+ const { left: e = 0, top: n = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: a = !1, angle: l = 0, skewX: u = 0, skewY: c = 0 } = i, d = t.getCellWithCoordByOffset(e, n);
44
+ if (d == null)
45
+ return;
46
+ const g = {
47
+ column: d.actualColumn,
48
+ columnOffset: mt(e - d.startX, 1),
49
+ row: d.actualRow,
50
+ rowOffset: mt(n - d.startY, 1)
51
+ }, h = t.getCellWithCoordByOffset(e + r, n + s);
52
+ if (h == null)
53
+ return;
54
+ const f = {
55
+ column: h.actualColumn,
56
+ columnOffset: mt(e + r - h.startX, 1),
57
+ row: h.actualRow,
58
+ rowOffset: mt(n + s - h.startY, 1)
59
+ };
60
+ return {
61
+ flipY: o,
62
+ flipX: a,
63
+ angle: l,
64
+ skewX: u,
65
+ skewY: c,
66
+ from: g,
67
+ to: f
68
+ };
69
+ }
18
70
  const Y = {
19
71
  id: "sheet.operation.clear-drawing-transformer",
20
- type: J.MUTATION,
72
+ type: Z.MUTATION,
21
73
  handler: (i, t) => {
22
- const e = i.get(Z);
74
+ const e = i.get(J);
23
75
  return t.forEach((n) => {
24
76
  var r, s;
25
77
  (s = (r = e.getRenderById(n)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
@@ -27,7 +79,7 @@ const Y = {
27
79
  }
28
80
  }, nt = {
29
81
  id: "sheet.command.remove-sheet-image",
30
- type: J.COMMAND,
82
+ type: Z.COMMAND,
31
83
  handler: (i, t) => {
32
84
  var v, I, R;
33
85
  const e = i.get(G), n = i.get(xe), r = i.get(At), s = i.get(re);
@@ -37,8 +89,8 @@ const Y = {
37
89
  const { unitId: C } = S;
38
90
  a.push(C);
39
91
  });
40
- const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = r.onCommandExecute({ id: nt.id, params: t }), p = { id: P.id, params: { unitId: u, subUnitId: c, op: g, objects: h, type: U.REMOVE } }, m = { id: P.id, params: { unitId: u, subUnitId: c, op: l, objects: h, type: U.INSERT } };
41
- return xn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
92
+ const l = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: d, redo: g, objects: h } = l, f = r.onCommandExecute({ id: nt.id, params: t }), p = { id: P.id, params: { unitId: u, subUnitId: c, op: g, objects: h, type: U.REMOVE } }, m = { id: P.id, params: { unitId: u, subUnitId: c, op: d, objects: h, type: U.INSERT } };
93
+ return Xn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
42
94
  unitID: u,
43
95
  undoMutations: [
44
96
  ...(I = f.preUndos) != null ? I : [],
@@ -56,16 +108,16 @@ const Y = {
56
108
  }
57
109
  }, hr = {
58
110
  id: "sheet.command.delete-drawing",
59
- type: J.COMMAND,
111
+ type: Z.COMMAND,
60
112
  handler: (i) => {
61
113
  const t = i.get(G), n = i.get(re).getFocusDrawings();
62
114
  if (n.length === 0)
63
115
  return !1;
64
116
  const r = n[0].unitId, s = n.map((o) => {
65
- const { unitId: a, subUnitId: d, drawingId: u, drawingType: c } = o;
117
+ const { unitId: a, subUnitId: l, drawingId: u, drawingType: c } = o;
66
118
  return {
67
119
  unitId: a,
68
- subUnitId: d,
120
+ subUnitId: l,
69
121
  drawingId: u,
70
122
  drawingType: c
71
123
  };
@@ -79,16 +131,16 @@ const Y = {
79
131
  function es(i) {
80
132
  const t = [];
81
133
  return i.forEach((e) => {
82
- const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = li(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
83
- const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: f, drawingId: p } = l;
134
+ const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, l = Or(0, 0, r.map((d) => d.transform || {})), u = r.map((d) => {
135
+ const g = d.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: f, drawingId: p } = d;
84
136
  return {
85
137
  unitId: h,
86
138
  subUnitId: f,
87
139
  drawingId: p,
88
140
  transform: {
89
141
  ...g,
90
- left: g.left - d.left,
91
- top: g.top - d.top
142
+ left: g.left - l.left,
143
+ top: g.top - l.top
92
144
  },
93
145
  groupId: a
94
146
  };
@@ -97,7 +149,7 @@ function es(i) {
97
149
  subUnitId: o,
98
150
  drawingId: a,
99
151
  drawingType: B.DRAWING_GROUP,
100
- transform: d
152
+ transform: l
101
153
  };
102
154
  t.push({
103
155
  parent: c,
@@ -108,11 +160,11 @@ function es(i) {
108
160
  function ts(i) {
109
161
  const t = [];
110
162
  return i.forEach((e) => {
111
- const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a, transform: d = { width: 0, height: 0 } } = n;
112
- if (d == null)
163
+ const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a, transform: l = { width: 0, height: 0 } } = n;
164
+ if (l == null)
113
165
  return;
114
- const u = r.map((l) => {
115
- const { transform: g } = l, { unitId: h, subUnitId: f, drawingId: p } = l, m = di(g || {}, d, d.width || 0, d.height || 0);
166
+ const u = r.map((d) => {
167
+ const { transform: g } = d, { unitId: h, subUnitId: f, drawingId: p } = d, m = Tr(g || {}, l, l.width || 0, l.height || 0);
116
168
  return {
117
169
  unitId: h,
118
170
  subUnitId: f,
@@ -138,7 +190,7 @@ function ts(i) {
138
190
  }
139
191
  const gr = {
140
192
  id: "sheet.command.group-sheet-image",
141
- type: J.COMMAND,
193
+ type: Z.COMMAND,
142
194
  handler: (i, t) => {
143
195
  const e = i.get(G), n = i.get(xe), r = i.get(re);
144
196
  if (!t) return !1;
@@ -148,81 +200,28 @@ const gr = {
148
200
  s.push(p.unitId);
149
201
  });
150
202
  });
151
- const o = r.getGroupDrawingOp(t), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
152
- return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: d, objects: l, type: U.GROUP }) ? (n.pushUndoRedo({
203
+ const o = r.getGroupDrawingOp(t), { unitId: a, subUnitId: l, undo: u, redo: c, objects: d } = o;
204
+ return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: l, objects: d, type: U.GROUP }) ? (n.pushUndoRedo({
153
205
  unitID: a,
154
206
  undoMutations: [
155
- { id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: ts(l), type: U.UNGROUP } },
207
+ { id: P.id, params: { op: u, unitId: a, subUnitId: l, objects: ts(d), type: U.UNGROUP } },
156
208
  { id: Y.id, params: s }
157
209
  ],
158
210
  redoMutations: [
159
- { id: P.id, params: { op: c, unitId: a, subUnitId: d, objects: l, type: U.GROUP } },
211
+ { id: P.id, params: { op: c, unitId: a, subUnitId: l, objects: d, type: U.GROUP } },
160
212
  { id: Y.id, params: s }
161
213
  ]
162
214
  }), !0) : !1;
163
215
  }
164
- };
165
- function z(i, t, e) {
166
- const { from: n, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: d = 0, skewY: u = 0 } = i, c = e.getCurrent();
167
- if (c == null)
168
- return;
169
- const l = Ii(
170
- c.unitId,
171
- c.sheetId,
172
- { from: n, to: r },
173
- e
174
- );
175
- let { left: g, top: h, width: f, height: p } = l;
176
- const m = e.getCurrentSkeleton(), _ = m.rowHeaderWidth + m.columnTotalWidth, v = m.columnHeaderHeight + m.rowTotalHeight;
177
- return g + f > _ && (g = _ - f), h + p > v && (h = v - p), {
178
- flipY: s,
179
- flipX: o,
180
- angle: a,
181
- skewX: d,
182
- skewY: u,
183
- left: g,
184
- top: h,
185
- width: f,
186
- height: p
187
- };
188
- }
189
- function $(i, t) {
190
- const { left: e = 0, top: n = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: a = !1, angle: d = 0, skewX: u = 0, skewY: c = 0 } = i, l = t.getCellWithCoordByOffset(e, n);
191
- if (l == null)
192
- return;
193
- const g = {
194
- column: l.actualColumn,
195
- columnOffset: wt(e - l.startX, 1),
196
- row: l.actualRow,
197
- rowOffset: wt(n - l.startY, 1)
198
- }, h = t.getCellWithCoordByOffset(e + r, n + s);
199
- if (h == null)
200
- return;
201
- const f = {
202
- column: h.actualColumn,
203
- columnOffset: wt(e + r - h.startX, 1),
204
- row: h.actualRow,
205
- rowOffset: wt(n + s - h.startY, 1)
206
- };
207
- return {
208
- flipY: o,
209
- flipX: a,
210
- angle: d,
211
- skewX: u,
212
- skewY: c,
213
- from: g,
214
- to: f
215
- };
216
- }
217
- const kt = {
216
+ }, kt = {
218
217
  id: "sheet.command.insert-sheet-image",
219
- type: J.COMMAND,
218
+ type: Z.COMMAND,
220
219
  handler: (i, t) => {
221
220
  var v, I, R;
222
221
  const e = i.get(G), n = i.get(xe), r = i.get(re), s = i.get(At);
223
222
  if (!t) return !1;
224
- const o = t.drawings, a = o.map((S) => S.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = s.onCommandExecute({ id: kt.id, params: t }), p = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, m = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
225
- return xn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
223
+ const o = t.drawings, a = o.map((S) => S.unitId), l = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: d, redo: g, objects: h } = l, f = s.onCommandExecute({ id: kt.id, params: t }), p = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, m = { id: P.id, params: { op: d, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
224
+ return Xn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
226
225
  unitID: u,
227
226
  undoMutations: [
228
227
  ...(I = f.preUndos) != null ? I : [],
@@ -240,47 +239,47 @@ const kt = {
240
239
  }
241
240
  }, fr = {
242
241
  id: "sheet.command.set-drawing-arrange",
243
- type: J.COMMAND,
242
+ type: Z.COMMAND,
244
243
  handler: (i, t) => {
245
244
  const e = i.get(G), n = i.get(xe);
246
245
  if (!t) return !1;
247
- const r = i.get(re), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = t, u = { unitId: s, subUnitId: o, drawingIds: a };
246
+ const r = i.get(re), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: l } = t, u = { unitId: s, subUnitId: o, drawingIds: a };
248
247
  let c;
249
- if (d === mt.forward ? c = r.getForwardDrawingsOp(u) : d === mt.backward ? c = r.getBackwardDrawingOp(u) : d === mt.front ? c = r.getFrontDrawingsOp(u) : d === mt.back && (c = r.getBackDrawingsOp(u)), c == null)
248
+ if (l === pt.forward ? c = r.getForwardDrawingsOp(u) : l === pt.backward ? c = r.getBackwardDrawingOp(u) : l === pt.front ? c = r.getFrontDrawingsOp(u) : l === pt.back && (c = r.getBackDrawingsOp(u)), c == null)
250
249
  return !1;
251
- const { objects: l, redo: g, undo: h } = c;
252
- return e.syncExecuteCommand(P.id, { op: g, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE }) ? (n.pushUndoRedo({
250
+ const { objects: d, redo: g, undo: h } = c;
251
+ return e.syncExecuteCommand(P.id, { op: g, unitId: s, subUnitId: o, objects: d, type: U.ARRANGE }) ? (n.pushUndoRedo({
253
252
  unitID: s,
254
253
  undoMutations: [
255
- { id: P.id, params: { op: h, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE } }
254
+ { id: P.id, params: { op: h, unitId: s, subUnitId: o, objects: d, type: U.ARRANGE } }
256
255
  ],
257
256
  redoMutations: [
258
- { id: P.id, params: { op: g, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE } }
257
+ { id: P.id, params: { op: g, unitId: s, subUnitId: o, objects: d, type: U.ARRANGE } }
259
258
  ]
260
259
  }), !0) : !1;
261
260
  }
262
261
  }, Wt = {
263
262
  id: "sheet.command.set-sheet-image",
264
- type: J.COMMAND,
263
+ type: Z.COMMAND,
265
264
  handler: (i, t) => {
266
265
  const e = i.get(G), n = i.get(xe), r = i.get(re);
267
266
  if (!t) return !1;
268
- const { drawings: s } = t, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
269
- return e.syncExecuteCommand(P.id, { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE }) ? (n.pushUndoRedo({
267
+ const { drawings: s } = t, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: l, undo: u, redo: c, objects: d } = o;
268
+ return e.syncExecuteCommand(P.id, { unitId: a, subUnitId: l, op: c, objects: d, type: U.UPDATE }) ? (n.pushUndoRedo({
270
269
  unitID: a,
271
270
  undoMutations: [
272
- { id: P.id, params: { unitId: a, subUnitId: d, op: u, objects: l, type: U.UPDATE } },
271
+ { id: P.id, params: { unitId: a, subUnitId: l, op: u, objects: d, type: U.UPDATE } },
273
272
  { id: Y.id, params: [a] }
274
273
  ],
275
274
  redoMutations: [
276
- { id: P.id, params: { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE } },
275
+ { id: P.id, params: { unitId: a, subUnitId: l, op: c, objects: d, type: U.UPDATE } },
277
276
  { id: Y.id, params: [a] }
278
277
  ]
279
278
  }), !0) : !1;
280
279
  }
281
280
  }, mr = {
282
281
  id: "sheet.command.ungroup-sheet-image",
283
- type: J.COMMAND,
282
+ type: Z.COMMAND,
284
283
  handler: (i, t) => {
285
284
  const e = i.get(G), n = i.get(xe), r = i.get(re);
286
285
  if (!t) return !1;
@@ -290,15 +289,15 @@ const kt = {
290
289
  s.push(p.unitId);
291
290
  });
292
291
  });
293
- const o = r.getUngroupDrawingOp(t), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
294
- return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: d, objects: l, type: U.UNGROUP }) ? (n.pushUndoRedo({
292
+ const o = r.getUngroupDrawingOp(t), { unitId: a, subUnitId: l, undo: u, redo: c, objects: d } = o;
293
+ return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: l, objects: d, type: U.UNGROUP }) ? (n.pushUndoRedo({
295
294
  unitID: a,
296
295
  undoMutations: [
297
- { id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: es(l), type: U.GROUP } },
296
+ { id: P.id, params: { op: u, unitId: a, subUnitId: l, objects: es(d), type: U.GROUP } },
298
297
  { id: Y.id, params: s }
299
298
  ],
300
299
  redoMutations: [
301
- { id: P.id, params: { op: c, unitId: a, subUnitId: d, objects: l, type: U.UNGROUP } },
300
+ { id: P.id, params: { op: c, unitId: a, subUnitId: l, objects: d, type: U.UNGROUP } },
302
301
  { id: Y.id, params: s }
303
302
  ]
304
303
  }), !0) : !1;
@@ -315,38 +314,38 @@ function is(i, t, e) {
315
314
  }
316
315
  function en(i, t, e, n, r) {
317
316
  var v;
318
- const { rotatedHeight: s, rotatedWidth: o } = is(e, n, r), d = i.get(Z).getRenderById(t.unitId);
319
- if (!d)
317
+ const { rotatedHeight: s, rotatedWidth: o } = is(e, n, r), l = i.get(J).getRenderById(t.unitId);
318
+ if (!l)
320
319
  return !1;
321
- const c = (v = d.with(V).getSkeletonParam(t.subUnitId)) == null ? void 0 : v.skeleton;
320
+ const c = (v = l.with(V).getSkeletonParam(t.subUnitId)) == null ? void 0 : v.skeleton;
322
321
  if (c == null)
323
322
  return !1;
324
- const l = c.getCellByIndex(t.row, t.col), g = l.mergeInfo.endX - l.mergeInfo.startX - 2, h = l.mergeInfo.endY - l.mergeInfo.startY - 2, f = o / s, m = Math.ceil(Math.min(g, h * f)) / o, _ = !m || Number.isNaN(m) ? 1e-3 : m;
323
+ const d = c.getCellByIndex(t.row, t.col), g = d.mergeInfo.endX - d.mergeInfo.startX - 2, h = d.mergeInfo.endY - d.mergeInfo.startY - 2, f = o / s, m = Math.ceil(Math.min(g, h * f)) / o, _ = !m || Number.isNaN(m) ? 1e-3 : m;
325
324
  return {
326
325
  width: e * _,
327
326
  height: n * _
328
327
  };
329
328
  }
330
329
  let Qe = class extends ne {
331
- constructor(t, e, n, r, s, o, a, d, u, c, l, g, h) {
330
+ constructor(t, e, n, r, s, o, a, l, u, c, d, g, h) {
332
331
  super();
333
332
  ee(this, "_workbookSelections");
334
- this._context = t, this._skeletonManagerService = e, this._commandService = n, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = a, this._drawingManagerService = d, this._contextService = u, this._messageService = c, this._localeService = l, this._injector = h, this._workbookSelections = g.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
333
+ this._context = t, this._skeletonManagerService = e, this._commandService = n, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = a, this._drawingManagerService = l, this._contextService = u, this._messageService = c, this._localeService = d, this._injector = h, this._workbookSelections = g.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
335
334
  }
336
335
  async insertFloatImage() {
337
336
  const t = await this._fileOpenerService.openFile({
338
337
  multiple: !0,
339
- accept: Mn.map((n) => `.${n.replace("image/", "")}`).join(",")
338
+ accept: Tn.map((n) => `.${n.replace("image/", "")}`).join(",")
340
339
  }), e = t.length;
341
- return e > yn ? (this._messageService.show({
340
+ return e > On ? (this._messageService.show({
342
341
  type: pe.Error,
343
- content: this._localeService.t("update-status.exceedMaxCount", String(yn))
342
+ content: this._localeService.t("update-status.exceedMaxCount", String(On))
344
343
  }), !1) : e === 0 ? !1 : (t.forEach(async (n) => await this.insertFloatImageByFile(n)), !0);
345
344
  }
346
345
  async insertCellImage() {
347
346
  const e = (await this._fileOpenerService.openFile({
348
347
  multiple: !1,
349
- accept: Mn.map((n) => `.${n.replace("image/", "")}`).join(",")
348
+ accept: Tn.map((n) => `.${n.replace("image/", "")}`).join(",")
350
349
  }))[0];
351
350
  return e ? (await this._insertCellImage(e), !0) : !1;
352
351
  }
@@ -359,27 +358,27 @@ let Qe = class extends ne {
359
358
  e = await this._imageIoService.saveImage(t);
360
359
  } catch (v) {
361
360
  const I = v.message;
362
- I === Ae.ERROR_EXCEED_SIZE ? this._messageService.show({
361
+ I === Ue.ERROR_EXCEED_SIZE ? this._messageService.show({
363
362
  type: pe.Error,
364
- content: this._localeService.t("update-status.exceedMaxSize", String(En / (1024 * 1024)))
365
- }) : I === Ae.ERROR_IMAGE_TYPE ? this._messageService.show({
363
+ content: this._localeService.t("update-status.exceedMaxSize", String(Un / (1024 * 1024)))
364
+ }) : I === Ue.ERROR_IMAGE_TYPE ? this._messageService.show({
366
365
  type: pe.Error,
367
366
  content: this._localeService.t("update-status.invalidImageType")
368
- }) : I === Ae.ERROR_IMAGE && this._messageService.show({
367
+ }) : I === Ue.ERROR_IMAGE && this._messageService.show({
369
368
  type: pe.Error,
370
369
  content: this._localeService.t("update-status.invalidImage")
371
370
  });
372
371
  }
373
372
  if (e == null)
374
373
  return;
375
- const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await Xt(u || ""), { width: h, height: f } = this._context.scene;
376
- this._imageIoService.addImageSourceCache(d, a, g);
374
+ const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: l, base64Cache: u } = e, { width: c, height: d, image: g } = await Xt(u || ""), { width: h, height: f } = this._context.scene;
375
+ this._imageIoService.addImageSourceCache(l, a, g);
377
376
  let p = 1;
378
- if (c > Tn || l > On) {
379
- const v = Tn / c, I = On / l;
377
+ if (c > Pn || d > An) {
378
+ const v = Pn / c, I = An / d;
380
379
  p = Math.max(v, I);
381
380
  }
382
- const m = this._getImagePosition(c * p, l * p, h, f);
381
+ const m = this._getImagePosition(c * p, d * p, h, f);
383
382
  if (m == null)
384
383
  return;
385
384
  const _ = {
@@ -388,7 +387,7 @@ let Qe = class extends ne {
388
387
  drawingId: o,
389
388
  drawingType: B.DRAWING_IMAGE,
390
389
  imageSourceType: a,
391
- source: d,
390
+ source: l,
392
391
  transform: z(m, this._selectionRenderService, this._skeletonManagerService),
393
392
  sheetTransform: m
394
393
  };
@@ -405,26 +404,26 @@ let Qe = class extends ne {
405
404
  n = await this._imageIoService.saveImage(t);
406
405
  } catch (S) {
407
406
  const C = S.message;
408
- C === Ae.ERROR_EXCEED_SIZE ? this._messageService.show({
407
+ C === Ue.ERROR_EXCEED_SIZE ? this._messageService.show({
409
408
  type: pe.Error,
410
- content: this._localeService.t("update-status.exceedMaxSize", String(En / (1024 * 1024)))
411
- }) : C === Ae.ERROR_IMAGE_TYPE ? this._messageService.show({
409
+ content: this._localeService.t("update-status.exceedMaxSize", String(Un / (1024 * 1024)))
410
+ }) : C === Ue.ERROR_IMAGE_TYPE ? this._messageService.show({
412
411
  type: pe.Error,
413
412
  content: this._localeService.t("update-status.invalidImageType")
414
- }) : C === Ae.ERROR_IMAGE && this._messageService.show({
413
+ }) : C === Ue.ERROR_IMAGE && this._messageService.show({
415
414
  type: pe.Error,
416
415
  content: this._localeService.t("update-status.invalidImage")
417
416
  });
418
417
  }
419
418
  if (n == null)
420
419
  return !1;
421
- const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await Xt(a || "");
420
+ const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: l, height: u, image: c } = await Xt(a || "");
422
421
  this._imageIoService.addImageSourceCache(o, s, c);
423
- const l = this._workbookSelections.getCurrentLastSelection();
424
- if (!l)
422
+ const d = this._workbookSelections.getCurrentLastSelection();
423
+ if (!d)
425
424
  return !1;
426
- let g = l.primary.actualRow, h = l.primary.actualColumn;
427
- l.primary.isMerged && (g = l.primary.startRow, h = l.primary.startColumn);
425
+ let g = d.primary.actualRow, h = d.primary.actualColumn;
426
+ d.primary.isMerged && (g = d.primary.startRow, h = d.primary.startColumn);
428
427
  const f = Vt("", {}), p = en(
429
428
  this._injector,
430
429
  {
@@ -433,7 +432,7 @@ let Qe = class extends ne {
433
432
  row: g,
434
433
  col: h
435
434
  },
436
- d,
435
+ l,
437
436
  u,
438
437
  0
439
438
  );
@@ -445,11 +444,11 @@ let Qe = class extends ne {
445
444
  height: p.height
446
445
  },
447
446
  positionH: {
448
- relativeFrom: pn.PAGE,
447
+ relativeFrom: vn.PAGE,
449
448
  posOffset: 0
450
449
  },
451
450
  positionV: {
452
- relativeFrom: mn.PARAGRAPH,
451
+ relativeFrom: Sn.PARAGRAPH,
453
452
  posOffset: 0
454
453
  },
455
454
  angle: 0
@@ -460,14 +459,14 @@ let Qe = class extends ne {
460
459
  drawingType: B.DRAWING_IMAGE,
461
460
  imageSourceType: s,
462
461
  source: o,
463
- transform: bn(m),
462
+ transform: En(m),
464
463
  docTransform: m,
465
- behindDoc: Sn.FALSE,
464
+ behindDoc: Dn.FALSE,
466
465
  title: "",
467
466
  description: "",
468
- layoutType: _n.INLINE,
467
+ layoutType: Cn.INLINE,
469
468
  // Insert inline drawing by default.
470
- wrapText: wn.BOTH_SIDES,
469
+ wrapText: In.BOTH_SIDES,
471
470
  distB: 0,
472
471
  distL: 0,
473
472
  distR: 0,
@@ -481,7 +480,7 @@ let Qe = class extends ne {
481
480
  endOffset: 0
482
481
  }
483
482
  });
484
- return v ? (f.apply(v), this._commandService.syncExecuteCommand(In.id, {
483
+ return v ? (f.apply(v), this._commandService.syncExecuteCommand(bn.id, {
485
484
  value: {
486
485
  [(I = e == null ? void 0 : e.row) != null ? I : g]: {
487
486
  [(R = e == null ? void 0 : e.col) != null ? R : h]: {
@@ -498,11 +497,11 @@ let Qe = class extends ne {
498
497
  async insertCellImageByUrl(t, e) {
499
498
  var g, h;
500
499
  const { width: n, height: r, image: s } = await Xt(t || "");
501
- this._imageIoService.addImageSourceCache(t, vn.URL, s);
500
+ this._imageIoService.addImageSourceCache(t, Rn.URL, s);
502
501
  const o = this._workbookSelections.getCurrentLastSelection();
503
502
  if (!o)
504
503
  return !1;
505
- const a = Vt("", {}), d = en(
504
+ const a = Vt("", {}), l = en(
506
505
  this._injector,
507
506
  {
508
507
  unitId: this._context.unitId,
@@ -514,19 +513,19 @@ let Qe = class extends ne {
514
513
  r,
515
514
  0
516
515
  );
517
- if (!d)
516
+ if (!l)
518
517
  return !1;
519
518
  const u = {
520
519
  size: {
521
- width: d.width,
522
- height: d.height
520
+ width: l.width,
521
+ height: l.height
523
522
  },
524
523
  positionH: {
525
- relativeFrom: pn.PAGE,
524
+ relativeFrom: vn.PAGE,
526
525
  posOffset: 0
527
526
  },
528
527
  positionV: {
529
- relativeFrom: mn.PARAGRAPH,
528
+ relativeFrom: Sn.PARAGRAPH,
530
529
  posOffset: 0
531
530
  },
532
531
  angle: 0
@@ -535,21 +534,21 @@ let Qe = class extends ne {
535
534
  subUnitId: a.getUnitId(),
536
535
  drawingId: Dt(),
537
536
  drawingType: B.DRAWING_IMAGE,
538
- imageSourceType: vn.URL,
537
+ imageSourceType: Rn.URL,
539
538
  source: t,
540
- transform: bn(u),
539
+ transform: En(u),
541
540
  docTransform: u,
542
- behindDoc: Sn.FALSE,
541
+ behindDoc: Dn.FALSE,
543
542
  title: "",
544
543
  description: "",
545
- layoutType: _n.INLINE,
544
+ layoutType: Cn.INLINE,
546
545
  // Insert inline drawing by default.
547
- wrapText: wn.BOTH_SIDES,
546
+ wrapText: In.BOTH_SIDES,
548
547
  distB: 0,
549
548
  distL: 0,
550
549
  distR: 0,
551
550
  distT: 0
552
- }, l = Ht.drawing.add({
551
+ }, d = Ht.drawing.add({
553
552
  documentDataModel: a,
554
553
  drawings: [c],
555
554
  selection: {
@@ -558,7 +557,7 @@ let Qe = class extends ne {
558
557
  endOffset: 0
559
558
  }
560
559
  });
561
- return l ? (a.apply(l), this._commandService.syncExecuteCommand(In.id, {
560
+ return d ? (a.apply(d), this._commandService.syncExecuteCommand(bn.id, {
562
561
  value: {
563
562
  [(g = e == null ? void 0 : e.row) != null ? g : o.primary.actualRow]: {
564
563
  [(h = e == null ? void 0 : e.col) != null ? h : o.primary.actualColumn]: {
@@ -587,29 +586,29 @@ let Qe = class extends ne {
587
586
  endColumn: 0
588
587
  };
589
588
  s && s.length > 0 && (o = s[s.length - 1].range);
590
- const a = ar(this._skeletonManagerService.getCurrent().skeleton, o);
589
+ const a = Yn(this._skeletonManagerService.getCurrent().skeleton, o);
591
590
  if (a == null)
592
591
  return;
593
- let { startColumn: d, startRow: u, startX: c, startY: l } = a, g = !1;
594
- if (c + t > n && (c = n - t, c < 0 && (c = 0, t = n), g = !0), l + e > r && (l = r - e, l < 0 && (l = 0, e = r), g = !0), g) {
595
- const m = this._selectionRenderService.getCellWithCoordByOffset(c, l);
592
+ let { startColumn: l, startRow: u, startX: c, startY: d } = a, g = !1;
593
+ if (c + t > n && (c = n - t, c < 0 && (c = 0, t = n), g = !0), d + e > r && (d = r - e, d < 0 && (d = 0, e = r), g = !0), g) {
594
+ const m = this._selectionRenderService.getCellWithCoordByOffset(c, d);
596
595
  if (m == null)
597
596
  return;
598
- c = m.startX, l = m.startY, d = m.actualColumn, u = m.actualRow;
597
+ c = m.startX, d = m.startY, l = m.actualColumn, u = m.actualRow;
599
598
  }
600
599
  const h = {
601
- column: d,
600
+ column: l,
602
601
  columnOffset: 0,
603
602
  row: u,
604
603
  rowOffset: 0
605
- }, f = this._selectionRenderService.getCellWithCoordByOffset(c + t, l + e);
604
+ }, f = this._selectionRenderService.getCellWithCoordByOffset(c + t, d + e);
606
605
  if (f == null)
607
606
  return;
608
607
  const p = {
609
608
  column: f.actualColumn,
610
609
  columnOffset: c + t - f.startX,
611
610
  row: f.actualRow,
612
- rowOffset: l + e - f.startY
611
+ rowOffset: d + e - f.startY
613
612
  };
614
613
  return {
615
614
  from: h,
@@ -631,21 +630,21 @@ let Qe = class extends ne {
631
630
  this.disposeWithMe(this._drawingManagerService.featurePluginUpdate$.subscribe((t) => {
632
631
  const e = [];
633
632
  t.length !== 0 && (t.forEach((n) => {
634
- const { unitId: r, subUnitId: s, drawingId: o, drawingType: a, transform: d } = n;
635
- if (d == null)
633
+ const { unitId: r, subUnitId: s, drawingId: o, drawingType: a, transform: l } = n;
634
+ if (l == null)
636
635
  return;
637
636
  const u = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: o });
638
637
  if (u == null || u.unitId !== this._context.unitId)
639
638
  return;
640
- const c = $({ ...u.transform, ...d }, this._selectionRenderService);
639
+ const c = $({ ...u.transform, ...l }, this._selectionRenderService);
641
640
  if (c == null)
642
641
  return;
643
- const l = {
642
+ const d = {
644
643
  ...n,
645
- transform: { ...u.transform, ...d, ...z(c, this._selectionRenderService, this._skeletonManagerService) },
644
+ transform: { ...u.transform, ...l, ...z(c, this._selectionRenderService, this._skeletonManagerService) },
646
645
  sheetTransform: { ...c }
647
646
  };
648
- e.push(l);
647
+ e.push(d);
649
648
  }), e.length > 0 && this._commandService.executeCommand(Wt.id, {
650
649
  unitId: t[0].unitId,
651
650
  drawings: e
@@ -664,7 +663,7 @@ let Qe = class extends ne {
664
663
  _focusDrawingListener() {
665
664
  this.disposeWithMe(
666
665
  this._drawingManagerService.focus$.subscribe((t) => {
667
- t == null || t.length === 0 ? (this._contextService.setContextValue($e, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue($e, !0), this._sheetDrawingService.focusDrawing(t));
666
+ t == null || t.length === 0 ? (this._contextService.setContextValue(je, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(je, !0), this._sheetDrawingService.focusDrawing(t));
668
667
  })
669
668
  );
670
669
  }
@@ -672,23 +671,23 @@ let Qe = class extends ne {
672
671
  Qe = rs([
673
672
  te(1, A(V)),
674
673
  te(2, G),
675
- te(3, Xe),
676
- te(4, _i),
674
+ te(3, Fe),
675
+ te(4, Ti),
677
676
  te(5, Pi),
678
677
  te(6, re),
679
678
  te(7, ie),
680
- te(8, Yn),
679
+ te(8, Gn),
681
680
  te(9, cr),
682
681
  te(10, A(tt)),
683
- te(11, A(sn)),
682
+ te(11, A(on)),
684
683
  te(12, A(Ye))
685
684
  ], Qe);
686
685
  const Bt = {
687
686
  id: "sheet.command.insert-float-image",
688
- type: J.COMMAND,
687
+ type: Z.COMMAND,
689
688
  handler: async (i, t) => {
690
689
  var o, a;
691
- const e = i.get(Se), n = i.get(Z), r = (o = on(
690
+ const e = i.get(Se), n = i.get(J), r = (o = sn(
692
691
  F.UNIVER_SHEET,
693
692
  e,
694
693
  n
@@ -697,18 +696,18 @@ const Bt = {
697
696
  return !1;
698
697
  const s = t == null ? void 0 : t.files;
699
698
  if (s) {
700
- const d = s.map((u) => r.insertFloatImageByFile(u));
701
- return (await Promise.all(d)).every((u) => u);
699
+ const l = s.map((u) => r.insertFloatImageByFile(u));
700
+ return (await Promise.all(l)).every((u) => u);
702
701
  } else
703
702
  return (a = r.insertFloatImage()) != null ? a : !1;
704
703
  }
705
704
  }, dn = {
706
705
  id: "sheet.command.insert-cell-image",
707
- type: J.COMMAND,
706
+ type: Z.COMMAND,
708
707
  handler: (i) => {
709
708
  var n, r;
710
- const t = i.get(Se), e = i.get(Z);
711
- return (r = (n = on(
709
+ const t = i.get(Se), e = i.get(J);
710
+ return (r = (n = sn(
712
711
  F.UNIVER_SHEET,
713
712
  t,
714
713
  e
@@ -716,16 +715,16 @@ const Bt = {
716
715
  }
717
716
  }, rt = {
718
717
  id: "sheet.command.move-drawing",
719
- type: J.COMMAND,
718
+ type: Z.COMMAND,
720
719
  handler: (i, t) => {
721
- const e = i.get(G), n = i.get(re), r = i.get(Xe), { direction: s } = t, o = n.getFocusDrawings();
720
+ const e = i.get(G), n = i.get(re), r = i.get(Fe), { direction: s } = t, o = n.getFocusDrawings();
722
721
  if (o.length === 0)
723
722
  return !1;
724
- const a = o[0].unitId, d = o.map((c) => {
725
- const { transform: l } = c;
726
- if (l == null)
723
+ const a = o[0].unitId, l = o.map((c) => {
724
+ const { transform: d } = c;
725
+ if (d == null)
727
726
  return null;
728
- const g = { ...l }, { left: h = 0, top: f = 0 } = l;
727
+ const g = { ...d }, { left: h = 0, top: f = 0 } = d;
729
728
  return s === _e.UP ? g.top = f - 1 : s === _e.DOWN ? g.top = f + 1 : s === _e.LEFT ? g.left = h - 1 : s === _e.RIGHT && (g.left = h + 1), {
730
729
  ...c,
731
730
  transform: g,
@@ -734,12 +733,12 @@ const Bt = {
734
733
  }).filter((c) => c != null);
735
734
  return e.syncExecuteCommand(Wt.id, {
736
735
  unitId: a,
737
- drawings: d
736
+ drawings: l
738
737
  }) ? (e.syncExecuteCommand(Y.id, [a]), !0) : !1;
739
738
  }
740
739
  }, pr = "COMPONENT_SHEET_DRAWING_PANEL", wr = {
741
740
  id: "sidebar.operation.sheet-image",
742
- type: J.COMMAND,
741
+ type: Z.COMMAND,
743
742
  handler: async (i, t) => {
744
743
  const e = i.get(Ai), n = i.get(tt), r = i.get(Se), s = i.get(G);
745
744
  if (!se(r)) return !1;
@@ -763,7 +762,7 @@ const Bt = {
763
762
  }
764
763
  }, _r = {
765
764
  id: "sheet.operation.edit-sheet-image",
766
- type: J.OPERATION,
765
+ type: Z.OPERATION,
767
766
  handler: (i, t) => {
768
767
  const e = i.get(G);
769
768
  return t == null ? !1 : (e.syncExecuteCommand(Nt.id, [t]), e.executeCommand(wr.id, { value: "open" }), !0);
@@ -774,11 +773,11 @@ var os = Object.getOwnPropertyDescriptor, as = (i, t, e, n) => {
774
773
  (o = i[s]) && (r = o(r) || r);
775
774
  return r;
776
775
  }, ce = (i, t) => (e, n) => t(e, n, i);
777
- let Rt = class extends Or {
778
- constructor(t, e, n, r, s, o, a, d, u, c) {
776
+ let Rt = class extends Gr {
777
+ constructor(t, e, n, r, s, o, a, l, u, c) {
779
778
  super();
780
779
  ee(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
781
- this._injector = t, this._localeService = e, this._drawingManagerService = n, this._canvasPopManagerService = r, this._renderManagerService = s, this._univerInstanceService = o, this._messageService = a, this._contextService = d, this._ioService = u, this._commandService = c, this._init();
780
+ this._injector = t, this._localeService = e, this._drawingManagerService = n, this._canvasPopManagerService = r, this._renderManagerService = s, this._univerInstanceService = o, this._messageService = a, this._contextService = l, this._ioService = u, this._commandService = c, this._init();
782
781
  }
783
782
  _init() {
784
783
  this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(Nn(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$(F.UNIVER_SHEET).pipe(Nn(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType(F.UNIVER_SHEET).forEach((t) => this._create(t)), this._setupLoadingStatus();
@@ -824,7 +823,7 @@ let Rt = class extends Or {
824
823
  let r;
825
824
  this.disposeWithMe(
826
825
  n.createControl$.subscribe(() => {
827
- if (this._contextService.setContextValue($e, !0), this._hasCropObject(e))
826
+ if (this._contextService.setContextValue(je, !0), this._hasCropObject(e))
828
827
  return;
829
828
  const o = n.getSelectedObjectMap();
830
829
  if (o.size > 1) {
@@ -834,30 +833,30 @@ let Rt = class extends Or {
834
833
  const a = o.values().next().value;
835
834
  if (!a)
836
835
  return;
837
- const d = a.oKey, u = this._drawingManagerService.getDrawingOKey(d);
836
+ const l = a.oKey, u = this._drawingManagerService.getDrawingOKey(l);
838
837
  if (!u)
839
838
  return;
840
- const { unitId: c, subUnitId: l, drawingId: g, drawingType: h } = u, f = u.data;
839
+ const { unitId: c, subUnitId: d, drawingId: g, drawingType: h } = u, f = u.data;
841
840
  if (f && f.disablePopup)
842
841
  return;
843
842
  r == null || r.dispose();
844
- const p = this._canvasPopManagerService.getFeatureMenu(c, l, g, h);
843
+ const p = this._canvasPopManagerService.getFeatureMenu(c, d, g, h);
845
844
  r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
846
845
  componentKey: Li,
847
846
  direction: "horizontal",
848
847
  offset: [2, 0],
849
848
  extraProps: {
850
- menuItems: p || this._getImageMenuItems(c, l, g, h)
849
+ menuItems: p || this._getImageMenuItems(c, d, g, h)
851
850
  }
852
851
  }));
853
852
  })
854
853
  ), this.disposeWithMe(
855
854
  n.clearControl$.subscribe(() => {
856
- r == null || r.dispose(), this._contextService.setContextValue($e, !1), this._commandService.syncExecuteCommand(Nt.id, []);
855
+ r == null || r.dispose(), this._contextService.setContextValue(je, !1), this._commandService.syncExecuteCommand(Nt.id, []);
857
856
  })
858
857
  ), this.disposeWithMe(
859
858
  this._contextService.contextChanged$.subscribe((o) => {
860
- o[$e] === !1 && (r == null || r.dispose());
859
+ o[je] === !1 && (r == null || r.dispose());
861
860
  })
862
861
  ), this.disposeWithMe(
863
862
  n.changing$.subscribe(() => {
@@ -902,12 +901,12 @@ Rt = as([
902
901
  ce(0, A(Ye)),
903
902
  ce(1, A(tt)),
904
903
  ce(2, ie),
905
- ce(3, A(Ci)),
906
- ce(4, Z),
904
+ ce(3, A(Ar)),
905
+ ce(4, J),
907
906
  ce(5, Se),
908
907
  ce(6, cr),
909
- ce(7, Yn),
910
- ce(8, Tr),
908
+ ce(7, Gn),
909
+ ce(8, Xr),
911
910
  ce(9, G)
912
911
  ], Rt);
913
912
  var cs = Object.getOwnPropertyDescriptor, ds = (i, t, e, n) => {
@@ -925,7 +924,7 @@ let tn = class extends ne {
925
924
  this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(Ji(33)).subscribe((t) => {
926
925
  var n, r;
927
926
  let e = [];
928
- t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (t == null ? void 0 : t.unitId) === this._context.unitId && (t != null && t.drawing) && e.length === 1 && ((n = e[0].primary) == null ? void 0 : n.actualRow) === t.row && ((r = e[0].primary) == null ? void 0 : r.actualColumn) === t.col ? (this._isSetCursor = !0, this._context.scene.setCursor(ui.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
927
+ t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (t == null ? void 0 : t.unitId) === this._context.unitId && (t != null && t.drawing) && e.length === 1 && ((n = e[0].primary) == null ? void 0 : n.actualRow) === t.row && ((r = e[0].primary) == null ? void 0 : r.actualColumn) === t.col ? (this._isSetCursor = !0, this._context.scene.setCursor(Ur.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
929
928
  }));
930
929
  }
931
930
  _initImageClick() {
@@ -940,8 +939,8 @@ let tn = class extends ne {
940
939
  }
941
940
  };
942
941
  tn = ds([
943
- St(1, A(Di)),
944
- St(2, A(sn)),
942
+ St(1, A(Nr)),
943
+ St(2, A(on)),
945
944
  St(3, A(lr)),
946
945
  St(4, A(V))
947
946
  ], tn);
@@ -973,18 +972,18 @@ let nn = class extends ne {
973
972
  nn = us([
974
973
  vt(1, re),
975
974
  vt(2, ie),
976
- vt(3, A(Xe)),
975
+ vt(3, A(Fe)),
977
976
  vt(4, A(V))
978
977
  ], nn);
979
978
  var hs = Object.getOwnPropertyDescriptor, gs = (i, t, e, n) => {
980
979
  for (var r = n > 1 ? void 0 : n ? hs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
981
980
  (o = i[s]) && (r = o(r) || r);
982
981
  return r;
983
- }, Ne = (i, t) => (e, n) => t(e, n, i);
982
+ }, Ae = (i, t) => (e, n) => t(e, n, i);
984
983
  function Sr(i, t, e) {
985
984
  var n, r, s, o;
986
985
  if (((r = (n = e == null ? void 0 : e.p) == null ? void 0 : n.body) == null ? void 0 : r.dataStream.length) === 3 && ((o = (s = e.p) == null ? void 0 : s.drawingsOrder) == null ? void 0 : o.length) === 1) {
987
- const a = e.p.drawings[e.p.drawingsOrder[0]], d = en(
986
+ const a = e.p.drawings[e.p.drawingsOrder[0]], l = en(
988
987
  i,
989
988
  {
990
989
  unitId: t.unitId,
@@ -996,8 +995,8 @@ function Sr(i, t, e) {
996
995
  a.docTransform.size.height,
997
996
  a.docTransform.angle
998
997
  );
999
- if (d)
1000
- return a.transform.width = d.width, a.transform.height = d.height, a.docTransform.size.width = d.width, a.docTransform.size.height = d.height, a.transform.left = 0, a.transform.top = 0, a.docTransform.positionH.posOffset = 0, a.docTransform.positionV.posOffset = 0, e.p.documentStyle.pageSize.width = 1 / 0, e.p.documentStyle.pageSize.height = 1 / 0, !0;
998
+ if (l)
999
+ return a.transform.width = l.width, a.transform.height = l.height, a.docTransform.size.width = l.width, a.docTransform.size.height = l.height, a.transform.left = 0, a.transform.top = 0, a.docTransform.positionH.posOffset = 0, a.docTransform.positionV.posOffset = 0, e.p.documentStyle.pageSize.width = 1 / 0, e.p.documentStyle.pageSize.height = 1 / 0, !0;
1001
1000
  }
1002
1001
  return !1;
1003
1002
  }
@@ -1009,16 +1008,16 @@ let bt = class extends ne {
1009
1008
  this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
1010
1009
  i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(Ze), this._docDrawingController.loadDrawingDataForUnit(Ze), this._drawingManagerService.initializeNotification(Ze)) : this._drawingManagerService.removeDrawingDataForUnit(Ze);
1011
1010
  })), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
1012
- i.id === pi.id && i.params.unitId === Be && (this._drawingManagerService.removeDrawingDataForUnit(Be), this._docDrawingController.loadDrawingDataForUnit(Be), this._drawingManagerService.initializeNotification(Be));
1011
+ i.id === yi.id && i.params.unitId === Be && (this._drawingManagerService.removeDrawingDataForUnit(Be), this._docDrawingController.loadDrawingDataForUnit(Be), this._drawingManagerService.initializeNotification(Be));
1013
1012
  }));
1014
1013
  }
1015
1014
  _initCellContentInterceptor() {
1016
1015
  this.disposeWithMe(
1017
1016
  this._sheetInterceptorService.intercept(
1018
- Jr.CELL_CONTENT,
1017
+ li.CELL_CONTENT,
1019
1018
  {
1020
- effect: Ur.Style,
1021
- priority: Zr.CELL_IMAGE,
1019
+ effect: Lr.Style,
1020
+ priority: ui.CELL_IMAGE,
1022
1021
  handler: (i, t, e) => {
1023
1022
  var n;
1024
1023
  return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i === t.rawData && (i = { ...t.rawData }), i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }, Sr(this._injector, { unitId: t.unitId, subUnitId: t.subUnitId, row: t.row, col: t.col }, i)), e(i);
@@ -1029,12 +1028,12 @@ let bt = class extends ne {
1029
1028
  }
1030
1029
  };
1031
1030
  bt = gs([
1032
- Ne(0, G),
1033
- Ne(1, A(At)),
1034
- Ne(2, A(Ye)),
1035
- Ne(3, ie),
1036
- Ne(4, A(Yi)),
1037
- Ne(5, A(Ri))
1031
+ Ae(0, G),
1032
+ Ae(1, A(At)),
1033
+ Ae(2, A(Ye)),
1034
+ Ae(3, ie),
1035
+ Ae(4, A(Yi)),
1036
+ Ae(5, A(kr))
1038
1037
  ], bt);
1039
1038
  var fs = Object.getOwnPropertyDescriptor, ms = (i, t, e, n) => {
1040
1039
  for (var r = n > 1 ? void 0 : n ? fs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
@@ -1050,7 +1049,7 @@ let Mt = class extends ne {
1050
1049
  this._autoFillService.addHook({
1051
1050
  id: "sheet-cell-image-autofill",
1052
1051
  onBeforeSubmit: (i, t, e, n) => {
1053
- new Pr(n).forValue((r, s, o) => {
1052
+ new Vr(n).forValue((r, s, o) => {
1054
1053
  Sr(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
1055
1054
  });
1056
1055
  }
@@ -1059,7 +1058,7 @@ let Mt = class extends ne {
1059
1058
  }
1060
1059
  };
1061
1060
  Mt = ms([
1062
- $n(0, A(bi)),
1061
+ $n(0, A(Wr)),
1063
1062
  $n(1, A(Ye))
1064
1063
  ], Mt);
1065
1064
  var ps = Object.getOwnPropertyDescriptor, ws = (i, t, e, n) => {
@@ -1069,7 +1068,7 @@ var ps = Object.getOwnPropertyDescriptor, ws = (i, t, e, n) => {
1069
1068
  }, He = (i, t) => (e, n) => t(e, n, i);
1070
1069
  const _s = [
1071
1070
  Ze,
1072
- Ar,
1071
+ Hr,
1073
1072
  Be
1074
1073
  ];
1075
1074
  let yt = class extends ne {
@@ -1078,7 +1077,7 @@ let yt = class extends ne {
1078
1077
  }
1079
1078
  _setCellImage(i) {
1080
1079
  var r;
1081
- const t = Vt("", {}), e = (r = on(F.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(Mi), n = Ht.drawing.add({
1080
+ const t = Vt("", {}), e = (r = sn(F.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(Br), n = Ht.drawing.add({
1082
1081
  documentDataModel: t,
1083
1082
  drawings: [i],
1084
1083
  selection: {
@@ -1093,7 +1092,7 @@ let yt = class extends ne {
1093
1092
  this.disposeWithMe(
1094
1093
  this._commandService.beforeCommandExecuted((i) => {
1095
1094
  var t, e;
1096
- if (i.id === wi.id) {
1095
+ if (i.id === Ei.id) {
1097
1096
  const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType(F.UNIVER_DOC);
1098
1097
  if (s == null || !Object.keys((t = r.drawings) != null ? t : {}).length)
1099
1098
  return;
@@ -1101,12 +1100,12 @@ let yt = class extends ne {
1101
1100
  if (_s.includes(o)) {
1102
1101
  if (o !== Be) {
1103
1102
  const a = () => {
1104
- this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(Un.id, {
1103
+ this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(pn.id, {
1105
1104
  visible: !1
1106
1105
  });
1107
1106
  };
1108
1107
  ((e = s.getBody()) == null ? void 0 : e.dataStream) === `\r
1109
- ` ? (this._commandService.syncExecuteCommand(Un.id, {
1108
+ ` ? (this._commandService.syncExecuteCommand(pn.id, {
1110
1109
  visible: !1
1111
1110
  }), this._setCellImage(Object.values(r.drawings)[0])) : this._dialogService.open({
1112
1111
  id: "sheet-cell-image-copy-paste",
@@ -1138,7 +1137,7 @@ yt = ws([
1138
1137
  He(0, G),
1139
1138
  He(1, Se),
1140
1139
  He(2, Ni),
1141
- He(3, Z),
1140
+ He(3, J),
1142
1141
  He(4, A(tt))
1143
1142
  ], yt);
1144
1143
  var Ss = Object.getOwnPropertyDescriptor, vs = (i, t, e, n) => {
@@ -1170,10 +1169,10 @@ function Ds() {
1170
1169
  };
1171
1170
  }
1172
1171
  const Fn = [
1173
- je.SPECIAL_PASTE_COL_WIDTH,
1174
- je.SPECIAL_PASTE_VALUE,
1175
- je.SPECIAL_PASTE_FORMAT,
1176
- je.SPECIAL_PASTE_FORMULA
1172
+ We.SPECIAL_PASTE_COL_WIDTH,
1173
+ We.SPECIAL_PASTE_VALUE,
1174
+ We.SPECIAL_PASTE_FORMAT,
1175
+ We.SPECIAL_PASTE_FORMULA
1177
1176
  ];
1178
1177
  let Et = class extends ne {
1179
1178
  constructor(t, e, n, r, s) {
@@ -1192,16 +1191,16 @@ let Et = class extends ne {
1192
1191
  const s = this._focusedDrawings;
1193
1192
  if (s.length > 0) {
1194
1193
  const [o] = s;
1195
- if (r === Ie.CUT) {
1196
- const d = {
1194
+ if (r === ve.CUT) {
1195
+ const l = {
1197
1196
  unitId: t,
1198
1197
  drawings: [o]
1199
1198
  };
1200
- this._commandService.executeCommand(nt.id, d);
1199
+ this._commandService.executeCommand(nt.id, l);
1201
1200
  }
1202
1201
  setTimeout(() => {
1203
- const d = Ds();
1204
- o.drawingType === B.DRAWING_IMAGE && o.imageSourceType === Si.BASE64 ? Cs(o.source) : this._clipboardInterfaceService.writeText(""), d();
1202
+ const l = Ds();
1203
+ o.drawingType === B.DRAWING_IMAGE && o.imageSourceType === Oi.BASE64 ? Cs(o.source) : this._clipboardInterfaceService.writeText(""), l();
1205
1204
  }, 200);
1206
1205
  const a = {
1207
1206
  unitId: o.unitId,
@@ -1217,14 +1216,14 @@ let Et = class extends ne {
1217
1216
  onPasteCells: (t, e, n, r) => {
1218
1217
  if (!this._copyInfo)
1219
1218
  return { redos: [], undos: [] };
1220
- const { copyType: s = Ie.COPY, pasteType: o } = r, { range: a } = t || {}, { range: d, unitId: u, subUnitId: c } = e;
1221
- return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: c, pasteRange: d }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o }, Ie.COPY);
1219
+ const { copyType: s = ve.COPY, pasteType: o } = r, { range: a } = t || {}, { range: l, unitId: u, subUnitId: c } = e;
1220
+ return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: c, pasteRange: l }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o }, ve.COPY);
1222
1221
  },
1223
1222
  onPastePlainText: (t, e) => ({ undos: [], redos: [] }),
1224
- onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: je.DEFAULT_PASTE }, Ie.COPY) : { undos: [], redos: [] },
1223
+ onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: We.DEFAULT_PASTE }, ve.COPY) : { undos: [], redos: [] },
1225
1224
  onPasteFiles: (t, e) => {
1226
1225
  if (this._copyInfo)
1227
- return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: je.DEFAULT_PASTE }, Ie.COPY);
1226
+ return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: We.DEFAULT_PASTE }, ve.COPY);
1228
1227
  {
1229
1228
  const n = e.filter((r) => r.type.includes("image"));
1230
1229
  if (n.length)
@@ -1249,7 +1248,7 @@ let Et = class extends ne {
1249
1248
  const s = r.attachRangeWithCoord(n);
1250
1249
  if (!s)
1251
1250
  return;
1252
- const { startX: o, endX: a, startY: d, endY: u } = s, c = this._drawingService.getDrawingData(t, e), l = this._focusedDrawings.slice();
1251
+ const { startX: o, endX: a, startY: l, endY: u } = s, c = this._drawingService.getDrawingData(t, e), d = this._focusedDrawings.slice();
1253
1252
  if (Object.keys(c).forEach((h) => {
1254
1253
  const f = c[h], { transform: p } = f;
1255
1254
  if (f.anchorType !== O.Both || !p)
@@ -1260,11 +1259,11 @@ let Et = class extends ne {
1260
1259
  drawingStartY: _,
1261
1260
  drawingEndY: _ + I
1262
1261
  };
1263
- o <= R && S <= a && d <= C && w <= u && l.push(f);
1264
- }), l.length)
1262
+ o <= R && S <= a && l <= C && w <= u && d.push(f);
1263
+ }), d.length)
1265
1264
  return {
1266
1265
  copyRange: n,
1267
- drawings: l,
1266
+ drawings: d,
1268
1267
  unitId: t,
1269
1268
  subUnitId: e
1270
1269
  };
@@ -1273,14 +1272,14 @@ let Et = class extends ne {
1273
1272
  const { pasteType: n, pasteTo: r } = t;
1274
1273
  if (Fn.includes(n))
1275
1274
  return { redos: [], undos: [] };
1276
- const { unitId: s, subUnitId: o, range: a } = r, d = this._renderManagerService.getRenderById(s), u = d == null ? void 0 : d.with(V), c = d == null ? void 0 : d.with(Xe), l = this._copyInfo;
1275
+ const { unitId: s, subUnitId: o, range: a } = r, l = this._renderManagerService.getRenderById(s), u = l == null ? void 0 : l.with(V), c = l == null ? void 0 : l.with(Fe), d = this._copyInfo;
1277
1276
  if (!u || !c)
1278
1277
  return { redos: [], undos: [] };
1279
- const { drawings: g } = l, h = Pn(a);
1278
+ const { drawings: g } = d, h = wn(a);
1280
1279
  return this._generateMutations(g, {
1281
1280
  unitId: s,
1282
1281
  subUnitId: o,
1283
- isCut: e === Ie.CUT,
1282
+ isCut: e === ve.CUT,
1284
1283
  getTransform: (f, p) => {
1285
1284
  var v;
1286
1285
  const m = u.attachRangeWithCoord({
@@ -1306,16 +1305,16 @@ let Et = class extends ne {
1306
1305
  subUnitId: r,
1307
1306
  getTransform: s,
1308
1307
  isCut: o
1309
- } = e, a = [], d = [], { _drawingService: u } = this;
1308
+ } = e, a = [], l = [], { _drawingService: u } = this;
1310
1309
  return t.forEach((c) => {
1311
- const { transform: l, sheetTransform: g } = c;
1312
- if (!l)
1310
+ const { transform: d, sheetTransform: g } = c;
1311
+ if (!d)
1313
1312
  return;
1314
- const h = s(l, g), f = {
1313
+ const h = s(d, g), f = {
1315
1314
  ...c,
1316
1315
  unitId: n,
1317
1316
  subUnitId: r,
1318
- drawingId: o ? c.drawingId : Re.generateRandomId(),
1317
+ drawingId: o ? c.drawingId : De.generateRandomId(),
1319
1318
  transform: h.transform,
1320
1319
  sheetTransform: h.sheetTransform
1321
1320
  };
@@ -1330,7 +1329,7 @@ let Et = class extends ne {
1330
1329
  op: m,
1331
1330
  objects: _
1332
1331
  }
1333
- }), d.push({
1332
+ }), l.push({
1334
1333
  id: P.id,
1335
1334
  params: {
1336
1335
  unitId: n,
@@ -1342,9 +1341,9 @@ let Et = class extends ne {
1342
1341
  });
1343
1342
  } else {
1344
1343
  const { undo: p, redo: m, objects: _ } = u.getBatchAddOp([f]);
1345
- a.push({ id: P.id, params: { op: m, unitId: n, subUnitId: r, objects: _, type: U.INSERT } }), d.push({ id: P.id, params: { op: p, unitId: n, subUnitId: r, objects: _, type: U.REMOVE } });
1344
+ a.push({ id: P.id, params: { op: m, unitId: n, subUnitId: r, objects: _, type: U.INSERT } }), l.push({ id: P.id, params: { op: p, unitId: n, subUnitId: r, objects: _, type: U.REMOVE } });
1346
1345
  }
1347
- }), { redos: a, undos: d };
1346
+ }), { redos: a, undos: l };
1348
1347
  }
1349
1348
  // eslint-disable-next-line max-lines-per-function
1350
1349
  _generateRangeDrawingsPasteMutations(t, e) {
@@ -1356,7 +1355,7 @@ let Et = class extends ne {
1356
1355
  pasteRange: o
1357
1356
  } = t, {
1358
1357
  copyRange: a,
1359
- copyType: d
1358
+ copyType: l
1360
1359
  } = e;
1361
1360
  if (Fn.includes(s))
1362
1361
  return { redos: [], undos: [] };
@@ -1366,10 +1365,10 @@ let Et = class extends ne {
1366
1365
  const { drawings: c } = this._copyInfo;
1367
1366
  if (!a)
1368
1367
  return this._generateSingleDrawingPasteMutations({
1369
- pasteTo: { unitId: n, subUnitId: r, range: Pn(o) },
1368
+ pasteTo: { unitId: n, subUnitId: r, range: wn(o) },
1370
1369
  pasteType: s
1371
- }, d);
1372
- const { ranges: [l, g], mapFunc: h } = yi([a, o]), { row: f, col: p } = h(l.startRow, l.startColumn), { row: m, col: _ } = h(g.startRow, g.startColumn), v = u.attachRangeWithCoord({
1370
+ }, l);
1371
+ const { ranges: [d, g], mapFunc: h } = jr([a, o]), { row: f, col: p } = h(d.startRow, d.startColumn), { row: m, col: _ } = h(g.startRow, g.startColumn), v = u.attachRangeWithCoord({
1373
1372
  startRow: f,
1374
1373
  endRow: f,
1375
1374
  startColumn: p,
@@ -1409,13 +1408,13 @@ let Et = class extends ne {
1409
1408
  }
1410
1409
  };
1411
1410
  },
1412
- isCut: d === Ie.CUT
1411
+ isCut: l === ve.CUT
1413
1412
  });
1414
1413
  }
1415
1414
  };
1416
1415
  Et = vs([
1417
- ze(0, Ei),
1418
- ze(1, Z),
1416
+ ze(0, $r),
1417
+ ze(1, J),
1419
1418
  ze(2, ie),
1420
1419
  ze(3, ki),
1421
1420
  ze(4, G)
@@ -1441,8 +1440,8 @@ let Tt = class extends ne {
1441
1440
  }
1442
1441
  const o = n.getUnitId(), a = s.getSheetId();
1443
1442
  this._permissionService.composePermission([
1444
- new Cn(o).id,
1445
- new Dn(o, a).id
1443
+ new Mn(o).id,
1444
+ new yn(o, a).id
1446
1445
  ]).every((u) => u.value) ? this._drawingManagerService.setDrawingVisible(!0) : this._handleDrawingVisibilityFalse(n, s);
1447
1446
  })
1448
1447
  ) : (this._drawingManagerService.setDrawingVisible(!1), fe))
@@ -1455,7 +1454,7 @@ let Tt = class extends ne {
1455
1454
  if (!a)
1456
1455
  return;
1457
1456
  a.getAllObjectsByOrder().forEach((u) => {
1458
- u.classType === Ue.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.removeObject(u);
1457
+ u.classType === Oe.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.removeObject(u);
1459
1458
  });
1460
1459
  }
1461
1460
  _initDrawingEditable() {
@@ -1484,7 +1483,7 @@ let Tt = class extends ne {
1484
1483
  if (!a)
1485
1484
  return;
1486
1485
  a.getAllObjectsByOrder().forEach((u) => {
1487
- u.classType === Ue.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.detachTransformerFrom(u);
1486
+ u.classType === Oe.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.detachTransformerFrom(u);
1488
1487
  });
1489
1488
  }
1490
1489
  _initViewPermissionChange() {
@@ -1495,20 +1494,20 @@ let Tt = class extends ne {
1495
1494
  we((r) => {
1496
1495
  if (!r)
1497
1496
  return fe;
1498
- const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
1499
- if (!d)
1497
+ const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), l = a == null ? void 0 : a.scene;
1498
+ if (!l)
1500
1499
  return fe;
1501
- const u = d.getTransformerByCreate();
1500
+ const u = l.getTransformerByCreate();
1502
1501
  return this._permissionService.composePermission$([
1503
- new Cn(s).id,
1504
- new Dn(s, o).id
1502
+ new Mn(s).id,
1503
+ new yn(s, o).id
1505
1504
  ]).pipe(
1506
- be((l) => l.every((g) => g.value)),
1505
+ Re((d) => d.every((g) => g.value)),
1507
1506
  Wn()
1508
1507
  ).pipe(
1509
- be((l) => ({
1510
- permission: l,
1511
- scene: d,
1508
+ Re((d) => ({
1509
+ permission: d,
1510
+ scene: l,
1512
1511
  transformer: u,
1513
1512
  unitId: s,
1514
1513
  subUnitId: o
@@ -1519,9 +1518,9 @@ let Tt = class extends ne {
1519
1518
  ).subscribe({
1520
1519
  next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
1521
1520
  this._drawingManagerService.setDrawingVisible(e);
1522
- const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
1521
+ const a = n.getAllObjectsByOrder(), l = this._drawingManagerService.getDrawingData(s, o), u = Object.values(l);
1523
1522
  e ? this._drawingManagerService.addNotification(u) : (a.forEach((c) => {
1524
- c.classType === Ue.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.removeObject(c);
1523
+ c.classType === Oe.IMAGE && u.some((d) => c.oKey.includes(d.drawingId)) && n.removeObject(c);
1525
1524
  }), r.clearSelectedObjects());
1526
1525
  },
1527
1526
  complete: () => {
@@ -1543,20 +1542,20 @@ let Tt = class extends ne {
1543
1542
  we((r) => {
1544
1543
  if (!r)
1545
1544
  return fe;
1546
- const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
1547
- if (!d)
1545
+ const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), l = a == null ? void 0 : a.scene;
1546
+ if (!l)
1548
1547
  return fe;
1549
- const u = d.getTransformerByCreate();
1548
+ const u = l.getTransformerByCreate();
1550
1549
  return this._permissionService.composePermission$([
1551
1550
  new zt(s).id,
1552
1551
  new Kt(s, o).id
1553
1552
  ]).pipe(
1554
- be((l) => l.every((g) => g.value)),
1553
+ Re((d) => d.every((g) => g.value)),
1555
1554
  Wn()
1556
1555
  ).pipe(
1557
- be((l) => ({
1558
- permission: l,
1559
- scene: d,
1556
+ Re((d) => ({
1557
+ permission: d,
1558
+ scene: l,
1560
1559
  transformer: u,
1561
1560
  unitId: s,
1562
1561
  subUnitId: o
@@ -1567,11 +1566,11 @@ let Tt = class extends ne {
1567
1566
  ).subscribe({
1568
1567
  next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
1569
1568
  this._drawingManagerService.setDrawingEditable(e);
1570
- const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
1569
+ const a = n.getAllObjectsByOrder(), l = this._drawingManagerService.getDrawingData(s, o), u = Object.values(l);
1571
1570
  e ? (a.forEach((c) => {
1572
- c.classType === Ue.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.attachTransformerTo(c);
1571
+ c.classType === Oe.IMAGE && u.some((d) => c.oKey.includes(d.drawingId)) && n.attachTransformerTo(c);
1573
1572
  }), this._drawingManagerService.addNotification(u)) : (a.forEach((c) => {
1574
- c.classType === Ue.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.detachTransformerFrom(c);
1573
+ c.classType === Oe.IMAGE && u.some((d) => c.oKey.includes(d.drawingId)) && n.detachTransformerFrom(c);
1575
1574
  }), r.clearSelectedObjects());
1576
1575
  },
1577
1576
  complete: () => {
@@ -1584,9 +1583,9 @@ let Tt = class extends ne {
1584
1583
  const s = r.getSheetId(), o = this._renderManagerService.getRenderById(n), a = o == null ? void 0 : o.scene;
1585
1584
  if (!a)
1586
1585
  return;
1587
- const d = this._drawingManagerService.getDrawingData(n, s), u = Object.values(d);
1588
- this._drawingManagerService.setDrawingEditable(!0), a.getAllObjectsByOrder().forEach((l) => {
1589
- l.classType === Ue.IMAGE && u.some((g) => l.oKey.includes(g.drawingId)) && a.detachTransformerFrom(l);
1586
+ const l = this._drawingManagerService.getDrawingData(n, s), u = Object.values(l);
1587
+ this._drawingManagerService.setDrawingEditable(!0), a.getAllObjectsByOrder().forEach((d) => {
1588
+ d.classType === Oe.IMAGE && u.some((g) => d.oKey.includes(g.drawingId)) && a.detachTransformerFrom(d);
1590
1589
  });
1591
1590
  }
1592
1591
  })
@@ -1595,36 +1594,36 @@ let Tt = class extends ne {
1595
1594
  };
1596
1595
  Tt = bs([
1597
1596
  Ke(0, ie),
1598
- Ke(1, Z),
1599
- Ke(2, Nr),
1597
+ Ke(1, J),
1598
+ Ke(2, zr),
1600
1599
  Ke(3, Se),
1601
- Ke(4, A(kr))
1600
+ Ke(4, A(Kr))
1602
1601
  ], Tt);
1603
1602
  var Ms = Object.getOwnPropertyDescriptor, ys = (i, t, e, n) => {
1604
1603
  for (var r = n > 1 ? void 0 : n ? Ms(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1605
1604
  (o = i[s]) && (r = o(r) || r);
1606
1605
  return r;
1607
- }, Ce = (i, t) => (e, n) => t(e, n, i);
1606
+ }, Ie = (i, t) => (e, n) => t(e, n, i);
1608
1607
  function Ir(i, t, e, n, r, s = !1) {
1609
- const { scaleX: o, scaleY: a } = t.getAncestorScale(), d = t.getViewport(or.VIEW_MAIN), u = n.getFreeze(), { startColumn: c, startRow: l, xSplit: g, ySplit: h } = u, f = {
1608
+ const { scaleX: o, scaleY: a } = t.getAncestorScale(), l = t.getViewport(xn.VIEW_MAIN), u = n.getFreeze(), { startColumn: c, startRow: d, xSplit: g, ySplit: h } = u, f = {
1610
1609
  left: !0,
1611
1610
  // left means the left of pic is in a viewMainLeft
1612
1611
  top: !0
1613
1612
  };
1614
- if (!d)
1613
+ if (!l)
1615
1614
  return {
1616
1615
  ...i,
1617
1616
  absolute: f
1618
1617
  };
1619
1618
  const { left: p, right: m, top: _, bottom: v } = i;
1620
- let { top: I, left: R, viewportScrollX: S, viewportScrollY: C } = d;
1619
+ let { top: I, left: R, viewportScrollX: S, viewportScrollY: C } = l;
1621
1620
  const { boundsOfViewArea: w, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth: D, columnHeaderHeight: E } = e, T = {
1622
1621
  top: s ? 0 : E,
1623
1622
  left: s ? 0 : D
1624
1623
  };
1625
- w && (Re.isDefine(T.top) && (T.top = w.top), Re.isDefine(T.left) && (T.left = w.left)), y === "HORIZONTAL" && (C = 0), y === "VERTICAL" && (S = 0);
1624
+ w && (De.isDefine(T.top) && (T.top = w.top), De.isDefine(T.left) && (T.left = w.left)), y === "HORIZONTAL" && (C = 0), y === "VERTICAL" && (S = 0);
1626
1625
  let M = 0, b = 0;
1627
- const N = e.rowStartY(l - h) + E, x = e.colStartX(c - g) + D, q = e.rowStartY(l) + E, H = e.colStartX(c) + D;
1626
+ const N = e.rowStartY(d - h) + E, x = e.colStartX(c - g) + D, q = e.rowStartY(d) + E, H = e.colStartX(c) + D;
1628
1627
  if (g === 0)
1629
1628
  f.left = !1, M = (p - S) * o, b = (m - S) * o;
1630
1629
  else {
@@ -1647,21 +1646,21 @@ function Ir(i, t, e, n, r, s = !1) {
1647
1646
  };
1648
1647
  }
1649
1648
  const ge = (i, t, e, n, r) => {
1650
- const { left: s, top: o, width: a, height: d, angle: u } = i, c = {
1649
+ const { left: s, top: o, width: a, height: l, angle: u } = i, c = {
1651
1650
  left: s,
1652
1651
  right: s + a,
1653
1652
  top: o,
1654
- bottom: o + d
1655
- }, l = Ir(c, t, e, n, r), { scaleX: g, scaleY: h } = t.getAncestorScale();
1653
+ bottom: o + l
1654
+ }, d = Ir(c, t, e, n, r), { scaleX: g, scaleY: h } = t.getAncestorScale();
1656
1655
  return {
1657
- startX: l.left,
1658
- endX: l.right,
1659
- startY: l.top,
1660
- endY: l.bottom,
1656
+ startX: d.left,
1657
+ endX: d.right,
1658
+ startY: d.top,
1659
+ endY: d.bottom,
1661
1660
  rotate: u,
1662
1661
  width: a * g,
1663
- height: d * h,
1664
- absolute: l.absolute
1662
+ height: l * h,
1663
+ absolute: d.absolute
1665
1664
  };
1666
1665
  };
1667
1666
  let et = class extends ne {
@@ -1680,7 +1679,7 @@ let et = class extends ne {
1680
1679
  this._renderManagerService = t, this._univerInstanceService = e, this._commandService = n, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = a, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
1681
1680
  }
1682
1681
  _bindScrollEvent() {
1683
- this._lifecycleService.lifecycle$.pipe(Zi((t) => t === Br.Rendered), qi(1)).subscribe(() => {
1682
+ this._lifecycleService.lifecycle$.pipe(Zi((t) => t === Zr.Rendered), qi(1)).subscribe(() => {
1684
1683
  this._scrollUpdateListener();
1685
1684
  });
1686
1685
  }
@@ -1706,27 +1705,27 @@ let et = class extends ne {
1706
1705
  this._drawingManagerService.add$.subscribe((t) => {
1707
1706
  t.forEach((e) => {
1708
1707
  var K;
1709
- const { unitId: n, subUnitId: r, drawingId: s } = e, o = se(this._univerInstanceService, { unitId: n, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), d = this._univerInstanceService.getUnit(n, F.UNIVER_SHEET);
1710
- if (!d)
1708
+ const { unitId: n, subUnitId: r, drawingId: s } = e, o = se(this._univerInstanceService, { unitId: n, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), l = this._univerInstanceService.getUnit(n, F.UNIVER_SHEET);
1709
+ if (!l)
1711
1710
  return;
1712
- const u = d.getActiveSheet().getSheetId();
1711
+ const u = l.getActiveSheet().getSheetId();
1713
1712
  if (!a || !o)
1714
1713
  return;
1715
1714
  const c = (K = this._renderManagerService.getRenderById(n)) == null ? void 0 : K.with(V).getSkeletonParam(r);
1716
1715
  if (!c)
1717
1716
  return;
1718
- const { transform: l, drawingType: g, data: h } = a;
1717
+ const { transform: d, drawingType: g, data: h } = a;
1719
1718
  if (g !== B.DRAWING_DOM && g !== B.DRAWING_CHART)
1720
1719
  return;
1721
1720
  const f = this._getSceneAndTransformerByDrawingSearch(n);
1722
1721
  if (f == null)
1723
1722
  return;
1724
1723
  const { scene: p, canvas: m } = f;
1725
- if (l == null)
1724
+ if (d == null)
1726
1725
  return !0;
1727
1726
  if (u !== r)
1728
1727
  return;
1729
- const { left: _, top: v, width: I, height: R, angle: S, flipX: C, flipY: w, skewX: y, skewY: D } = l, E = ve({ unitId: n, subUnitId: r, drawingId: s }), T = p.getObject(E);
1728
+ const { left: _, top: v, width: I, height: R, angle: S, flipX: C, flipY: w, skewX: y, skewY: D } = d, E = Pe({ unitId: n, subUnitId: r, drawingId: s }), T = p.getObject(E);
1730
1729
  if (T != null) {
1731
1730
  T.transformByState({ left: _, top: v, width: I, height: R, angle: S, flipX: C, flipY: w, skewX: y, skewY: D });
1732
1731
  return;
@@ -1742,9 +1741,9 @@ let et = class extends ne {
1742
1741
  const k = h ? h.backgroundColor : "white";
1743
1742
  M.fill = k, h && h.border && (M.stroke = h.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8;
1744
1743
  }
1745
- const N = new Pe(E, M);
1746
- b && N.setObjectType(Rn.CHART), p.addObject(N, xt), a.allowTransform !== !1 && p.attachTransformerTo(N);
1747
- const x = new pt(), q = ge(N, f.renderUnit.scene, c.skeleton, o.worksheet), H = new We(q), L = {
1744
+ const N = new Ve(E, M);
1745
+ b && N.setObjectType(mn.CHART), p.addObject(N, Ft), a.allowTransform !== !1 && p.attachTransformerTo(N);
1746
+ const x = new wt(), q = ge(N, f.renderUnit.scene, c.skeleton, o.worksheet), H = new ke(q), L = {
1748
1747
  dispose: x,
1749
1748
  rect: N,
1750
1749
  position$: H,
@@ -1785,38 +1784,38 @@ let et = class extends ne {
1785
1784
  ), this.disposeWithMe(
1786
1785
  this._drawingManagerService.remove$.subscribe((t) => {
1787
1786
  t.forEach((e) => {
1788
- var l;
1789
- const { unitId: n, subUnitId: r, drawingId: s } = e, o = ve({ unitId: n, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(n);
1787
+ var d;
1788
+ const { unitId: n, subUnitId: r, drawingId: s } = e, o = Pe({ unitId: n, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(n);
1790
1789
  if (a == null)
1791
1790
  return;
1792
- const { transformer: d, scene: u } = a, c = u.getObject(o);
1793
- c != null && c.oKey && (d.clearControlByIds([c == null ? void 0 : c.oKey]), (l = u.getTransformer()) == null || l.clearSelectedObjects());
1791
+ const { transformer: l, scene: u } = a, c = u.getObject(o);
1792
+ c != null && c.oKey && (l.clearControlByIds([c == null ? void 0 : c.oKey]), (d = u.getTransformer()) == null || d.clearSelectedObjects());
1794
1793
  });
1795
1794
  })
1796
1795
  );
1797
1796
  }
1798
1797
  _scrollUpdateListener() {
1799
1798
  const t = (e, n) => {
1800
- var d;
1801
- const r = this._getSceneAndTransformerByDrawingSearch(e), s = Array.from(this._domLayerInfoMap.keys()).map((u) => ({ id: u, ...this._domLayerInfoMap.get(u) })).filter((u) => u.subUnitId === n && u.unitId === e).map((u) => u.id), o = se(this._univerInstanceService, { unitId: e, subUnitId: n }), a = (d = this._renderManagerService.getRenderById(e)) == null ? void 0 : d.with(V).getSkeletonParam(n);
1799
+ var l;
1800
+ const r = this._getSceneAndTransformerByDrawingSearch(e), s = Array.from(this._domLayerInfoMap.keys()).map((u) => ({ id: u, ...this._domLayerInfoMap.get(u) })).filter((u) => u.subUnitId === n && u.unitId === e).map((u) => u.id), o = se(this._univerInstanceService, { unitId: e, subUnitId: n }), a = (l = this._renderManagerService.getRenderById(e)) == null ? void 0 : l.with(V).getSkeletonParam(n);
1802
1801
  !r || !o || !a || s.forEach((u) => {
1803
1802
  const c = this._domLayerInfoMap.get(u);
1804
1803
  if (c) {
1805
- const l = ge(c.rect, r.renderUnit.scene, a.skeleton, o.worksheet, c);
1806
- c.position$.next(l);
1804
+ const d = ge(c.rect, r.renderUnit.scene, a.skeleton, o.worksheet, c);
1805
+ c.position$.next(d);
1807
1806
  }
1808
1807
  });
1809
1808
  };
1810
1809
  this.disposeWithMe(
1811
1810
  this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(
1812
1811
  we((e) => e ? e.activeSheet$ : Bn(null)),
1813
- be((e) => {
1812
+ Re((e) => {
1814
1813
  if (!e) return null;
1815
1814
  const n = e.getUnitId(), r = this._renderManagerService.getRenderById(n);
1816
1815
  return r ? { render: r, unitId: n, subUnitId: e.getSheetId() } : null;
1817
1816
  }),
1818
1817
  we(
1819
- (e) => e ? jr(e.render.scene.getViewport(or.VIEW_MAIN).onScrollAfter$).pipe(be(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : Bn(null)
1818
+ (e) => e ? qr(e.render.scene.getViewport(xn.VIEW_MAIN).onScrollAfter$).pipe(Re(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : Bn(null)
1820
1819
  )
1821
1820
  ).subscribe((e) => {
1822
1821
  if (!e) return;
@@ -1824,12 +1823,12 @@ let et = class extends ne {
1824
1823
  t(n, r);
1825
1824
  })
1826
1825
  ), this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
1827
- if (e.id === An.id) {
1826
+ if (e.id === _n.id) {
1828
1827
  const n = e.params, { unitId: r } = n;
1829
1828
  Array.from(this._domLayerInfoMap.values()).filter((o) => o.unitId === r).map((o) => o.subUnitId).forEach((o) => {
1830
1829
  t(r, o);
1831
1830
  });
1832
- } else if (e.id === qr.id) {
1831
+ } else if (e.id === hi.id) {
1833
1832
  const { unitId: n, subUnitId: r } = e.params;
1834
1833
  t(n, r);
1835
1834
  }
@@ -1837,21 +1836,21 @@ let et = class extends ne {
1837
1836
  }
1838
1837
  _getPosition(t, e) {
1839
1838
  var g;
1840
- const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(Xe);
1839
+ const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(Fe);
1841
1840
  if (a == null)
1842
1841
  return;
1843
- const d = a.getCellWithCoordByOffset(n, s);
1844
- if (d == null)
1842
+ const l = a.getCellWithCoordByOffset(n, s);
1843
+ if (l == null)
1845
1844
  return;
1846
1845
  const u = {
1847
- column: d.actualColumn,
1848
- columnOffset: n - d.startX,
1849
- row: d.actualRow,
1850
- rowOffset: s - d.startY
1846
+ column: l.actualColumn,
1847
+ columnOffset: n - l.startX,
1848
+ row: l.actualRow,
1849
+ rowOffset: s - l.startY
1851
1850
  }, c = a.getCellWithCoordByOffset(r, o);
1852
1851
  if (c == null)
1853
1852
  return;
1854
- const l = {
1853
+ const d = {
1855
1854
  column: c.actualColumn,
1856
1855
  columnOffset: r - c.startX,
1857
1856
  row: c.actualRow,
@@ -1859,7 +1858,7 @@ let et = class extends ne {
1859
1858
  };
1860
1859
  return {
1861
1860
  from: u,
1862
- to: l
1861
+ to: d
1863
1862
  };
1864
1863
  }
1865
1864
  _featureUpdateListener() {
@@ -1872,7 +1871,14 @@ let et = class extends ne {
1872
1871
  const r = {
1873
1872
  ...n.transform
1874
1873
  };
1875
- this._transformChange$.next({ id: e.drawingId, value: r });
1874
+ this._transformChange$.next({ id: e.drawingId, value: r }), this._canvasFloatDomService.updateFloatDom(e.drawingId, {
1875
+ ...n
1876
+ });
1877
+ const s = this._getSceneAndTransformerByDrawingSearch(e.unitId);
1878
+ if (s) {
1879
+ const { scene: o } = s, a = this._domLayerInfoMap.get(e.drawingId);
1880
+ a != null && a.rect && (n.allowTransform === !1 ? o.detachTransformerFrom(a.rect) : o.attachTransformerTo(a.rect));
1881
+ }
1876
1882
  });
1877
1883
  })
1878
1884
  );
@@ -1886,13 +1892,6 @@ let et = class extends ne {
1886
1892
  })
1887
1893
  );
1888
1894
  }
1889
- updateFloatDomProps(t, e, n, r) {
1890
- const s = this._domLayerInfoMap.get(n), o = this._getSceneAndTransformerByDrawingSearch(t);
1891
- if (s && o) {
1892
- const { scene: a } = o, d = ve({ unitId: t, subUnitId: e, drawingId: n }), u = a.getObject(d);
1893
- u && u instanceof Pe && u.setProps(r);
1894
- }
1895
- }
1896
1895
  // CreateFloatDomCommand --> floatDomService.addFloatDomToPosition
1897
1896
  addFloatDomToPosition(t, e) {
1898
1897
  const n = se(this._univerInstanceService, {
@@ -1901,8 +1900,8 @@ let et = class extends ne {
1901
1900
  });
1902
1901
  if (!n)
1903
1902
  throw new Error("cannot find current target!");
1904
- const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: d, allowTransform: u = !0 } = t, c = e != null ? e : Dt(), l = this._getPosition(o, r);
1905
- if (l == null)
1903
+ const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: l, allowTransform: u = !0 } = t, c = e != null ? e : Dt(), d = this._getPosition(o, r);
1904
+ if (d == null)
1906
1905
  return;
1907
1906
  const g = {
1908
1907
  unitId: r,
@@ -1910,14 +1909,14 @@ let et = class extends ne {
1910
1909
  drawingId: c,
1911
1910
  drawingType: t.type || B.DRAWING_DOM,
1912
1911
  componentKey: a,
1913
- sheetTransform: l,
1912
+ sheetTransform: d,
1914
1913
  transform: {
1915
1914
  left: o.startX,
1916
1915
  top: o.startY,
1917
1916
  width: o.endX - o.startX,
1918
1917
  height: o.endY - o.startY
1919
1918
  },
1920
- data: d,
1919
+ data: l,
1921
1920
  allowTransform: u
1922
1921
  };
1923
1922
  return this._commandService.executeCommand(kt.id, {
@@ -1941,7 +1940,7 @@ let et = class extends ne {
1941
1940
  const a = this._drawingManagerService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: t });
1942
1941
  if (!a)
1943
1942
  return;
1944
- const d = this._sheetDrawingService.getBatchRemoveOp([a]), { redo: u, objects: c } = d;
1943
+ const l = this._sheetDrawingService.getBatchRemoveOp([a]), { redo: u, objects: c } = l;
1945
1944
  this._commandService.syncExecuteCommand(P.id, { unitId: r, subUnitId: s, op: u, objects: c, type: U.REMOVE });
1946
1945
  }
1947
1946
  }
@@ -1954,21 +1953,21 @@ let et = class extends ne {
1954
1953
  });
1955
1954
  if (!s)
1956
1955
  throw new Error("cannot find current target!");
1957
- const { unitId: o, subUnitId: a } = s, d = this._getSceneAndTransformerByDrawingSearch(o);
1958
- if (!d) return;
1956
+ const { unitId: o, subUnitId: a } = s, l = this._getSceneAndTransformerByDrawingSearch(o);
1957
+ if (!l) return;
1959
1958
  const u = this._renderManagerService.getRenderById(o);
1960
1959
  if (!u) return;
1961
1960
  const c = (C = this._renderManagerService.getRenderById(o)) == null ? void 0 : C.with(V).getWorksheetSkeleton(a);
1962
1961
  if (!c) return;
1963
- const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Dt(), { position: p, position$: m } = this._createRangePositionObserver(t, u, c.skeleton);
1962
+ const { componentKey: d, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Dt(), { position: p, position$: m } = this._createRangePositionObserver(t, u, c.skeleton);
1964
1963
  if (this._getPosition(p, o) == null)
1965
1964
  return;
1966
- const v = d.scene, { scaleX: I } = v.getAncestorScale(), R = It(p, n, I), S = {
1965
+ const v = l.scene, { scaleX: I } = v.getAncestorScale(), R = It(p, n, I), S = {
1967
1966
  unitId: o,
1968
1967
  subUnitId: a,
1969
1968
  drawingId: f,
1970
1969
  drawingType: e.type || B.DRAWING_DOM,
1971
- componentKey: l,
1970
+ componentKey: d,
1972
1971
  transform: {
1973
1972
  left: R.startX,
1974
1973
  top: R.startY,
@@ -1997,12 +1996,12 @@ let et = class extends ne {
1997
1996
  const k = this._getSceneAndTransformerByDrawingSearch(D);
1998
1997
  if (k == null)
1999
1998
  return;
2000
- const { scene: ae, canvas: Me } = k;
1999
+ const { scene: ae, canvas: be } = k;
2001
2000
  if (L == null || x !== E)
2002
2001
  return;
2003
- const { left: st, top: ot, width: at, height: ct, angle: jt, flipX: $t, flipY: dt, skewX: lt, skewY: ye } = L, ut = ve({ unitId: D, subUnitId: E, drawingId: T }), de = ae.getObject(ut);
2002
+ const { left: st, top: ot, width: at, height: ct, angle: jt, flipX: $t, flipY: dt, skewX: lt, skewY: Me } = L, ut = Pe({ unitId: D, subUnitId: E, drawingId: T }), de = ae.getObject(ut);
2004
2003
  if (de != null) {
2005
- de.transformByState({ left: st, top: ot, width: at, height: ct, angle: jt, flipX: $t, flipY: dt, skewX: lt, skewY: ye });
2004
+ de.transformByState({ left: st, top: ot, width: at, height: ct, angle: jt, flipX: $t, flipY: dt, skewX: lt, skewY: Me });
2006
2005
  return;
2007
2006
  }
2008
2007
  const Q = {
@@ -2012,16 +2011,16 @@ let et = class extends ne {
2012
2011
  width: at,
2013
2012
  height: ct,
2014
2013
  zIndex: this._drawingManagerService.getDrawingOrder(D, E).length - 1
2015
- }, Ee = X === B.DRAWING_CHART;
2016
- if (Ee) {
2014
+ }, ye = X === B.DRAWING_CHART;
2015
+ if (ye) {
2017
2016
  const W = K ? K.backgroundColor : "white";
2018
2017
  Q.fill = W, Q.rotateEnabled = !1, K && K.border && (Q.stroke = K.border), Q.paintFirst = "stroke", Q.strokeWidth = 1, Q.borderEnabled = !1, Q.radius = 8;
2019
2018
  }
2020
- const le = new Pe(ut, Q);
2021
- Ee && le.setObjectType(Rn.CHART), ae.addObject(le, xt), b.allowTransform !== !1 && ae.attachTransformerTo(le);
2022
- const ue = new pt(), ht = ae.getMainViewport(), { rowHeaderWidth: Te, columnHeaderHeight: Ge } = H.skeleton, gt = {
2023
- top: Ge,
2024
- left: Te,
2019
+ const le = new Ve(ut, Q);
2020
+ ye && le.setObjectType(mn.CHART), ae.addObject(le, Ft), b.allowTransform !== !1 && ae.attachTransformerTo(le);
2021
+ const ue = new wt(), ht = ae.getMainViewport(), { rowHeaderWidth: Ee, columnHeaderHeight: Xe } = H.skeleton, gt = {
2022
+ top: Xe,
2023
+ left: Ee,
2025
2024
  bottom: ht.bottom,
2026
2025
  right: ht.right
2027
2026
  }, he = {
@@ -2031,10 +2030,10 @@ let et = class extends ne {
2031
2030
  domAnchor: n,
2032
2031
  unitId: D,
2033
2032
  subUnitId: E
2034
- }, j = ge(le, k.renderUnit.scene, H.skeleton, M.worksheet, he), Oe = new We(j);
2035
- he.position$ = Oe;
2036
- let Le = {
2037
- position$: Oe,
2033
+ }, j = ge(le, k.renderUnit.scene, H.skeleton, M.worksheet, he), Te = new ke(j);
2034
+ he.position$ = Te;
2035
+ let Ge = {
2036
+ position$: Te,
2038
2037
  id: T,
2039
2038
  componentKey: b.componentKey,
2040
2039
  onPointerDown: () => {
@@ -2044,23 +2043,23 @@ let et = class extends ne {
2044
2043
  onPointerUp: () => {
2045
2044
  },
2046
2045
  onWheel: (W) => {
2047
- Me.dispatchEvent(new WheelEvent(W.type, W));
2046
+ be.dispatchEvent(new WheelEvent(W.type, W));
2048
2047
  },
2049
2048
  data: K,
2050
2049
  unitId: D
2051
2050
  };
2052
- e.eventPassThrough && (Le = {
2053
- ...Le,
2051
+ e.eventPassThrough && (Ge = {
2052
+ ...Ge,
2054
2053
  onPointerDown: (W) => {
2055
- Me.dispatchEvent(new PointerEvent(W.type, W));
2054
+ be.dispatchEvent(new PointerEvent(W.type, W));
2056
2055
  },
2057
2056
  onPointerMove: (W) => {
2058
- Me.dispatchEvent(new PointerEvent(W.type, W));
2057
+ be.dispatchEvent(new PointerEvent(W.type, W));
2059
2058
  },
2060
2059
  onPointerUp: (W) => {
2061
- Me.dispatchEvent(new PointerEvent(W.type, W));
2060
+ be.dispatchEvent(new PointerEvent(W.type, W));
2062
2061
  }
2063
- }), this._canvasFloatDomService.addFloatDom(Le), this.disposeWithMe(m.subscribe((W) => {
2062
+ }), this._canvasFloatDomService.addFloatDom(Ge), this.disposeWithMe(m.subscribe((W) => {
2064
2063
  var un, hn, gn, fn;
2065
2064
  const ln = It({
2066
2065
  startX: W.startX,
@@ -2073,22 +2072,22 @@ let et = class extends ne {
2073
2072
  left: p.absolute.left,
2074
2073
  top: p.absolute.top
2075
2074
  }
2076
- }, n), Rr = ve({ unitId: D, subUnitId: E, drawingId: T }), br = new Pe(Rr, {
2075
+ }, n), Rr = Pe({ unitId: D, subUnitId: E, drawingId: T }), br = new Ve(Rr, {
2077
2076
  left: ln.startX,
2078
2077
  top: ln.startY,
2079
2078
  width: (gn = n.width) != null ? gn : W.width,
2080
2079
  height: (fn = n.height) != null ? fn : W.height,
2081
2080
  zIndex: this._drawingManagerService.getDrawingOrder(D, E).length - 1
2082
2081
  }), Mr = ge(br, k.renderUnit.scene, H.skeleton, M.worksheet, he);
2083
- Oe.next(Mr);
2082
+ Te.next(Mr);
2084
2083
  }));
2085
- const Ve = (y = this._renderManagerService.getRenderById(D)) == null ? void 0 : y.with(V);
2086
- Ve == null || Ve.currentSkeleton$.subscribe((W) => {
2084
+ const Le = (y = this._renderManagerService.getRenderById(D)) == null ? void 0 : y.with(V);
2085
+ Le == null || Le.currentSkeleton$.subscribe((W) => {
2087
2086
  W && H.sheetId !== W.sheetId && this._removeDom(f, !0);
2088
2087
  });
2089
2088
  const ft = le.onTransformChange$.subscribeEvent(() => {
2090
2089
  const W = ge(le, k.renderUnit.scene, H.skeleton, M.worksheet, he);
2091
- Oe.next(
2090
+ Te.next(
2092
2091
  W
2093
2092
  );
2094
2093
  });
@@ -2118,7 +2117,7 @@ let et = class extends ne {
2118
2117
  if (!u) return;
2119
2118
  const c = (R = this._renderManagerService.getRenderById(o)) == null ? void 0 : R.with(V).getWorksheetSkeleton(a);
2120
2119
  if (!c) return;
2121
- const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Dt(), { position: p, position$: m } = this._createRangePositionObserver({
2120
+ const { componentKey: d, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Dt(), { position: p, position$: m } = this._createRangePositionObserver({
2122
2121
  startRow: 0,
2123
2122
  endRow: 0,
2124
2123
  startColumn: t,
@@ -2131,7 +2130,7 @@ let et = class extends ne {
2131
2130
  subUnitId: a,
2132
2131
  drawingId: f,
2133
2132
  drawingType: e.type || B.DRAWING_DOM,
2134
- componentKey: l,
2133
+ componentKey: d,
2135
2134
  transform: {
2136
2135
  left: _.startX,
2137
2136
  top: _.startY,
@@ -2160,12 +2159,12 @@ let et = class extends ne {
2160
2159
  const { scene: X, canvas: K } = L;
2161
2160
  if (q == null || b !== y)
2162
2161
  return;
2163
- const { left: k, top: ae, width: Me, height: st, angle: ot, flipX: at, flipY: ct, skewX: jt, skewY: $t } = q, dt = ve({ unitId: w, subUnitId: y, drawingId: D }), lt = X.getObject(dt);
2162
+ const { left: k, top: ae, width: be, height: st, angle: ot, flipX: at, flipY: ct, skewX: jt, skewY: $t } = q, dt = Pe({ unitId: w, subUnitId: y, drawingId: D }), lt = X.getObject(dt);
2164
2163
  if (lt != null) {
2165
- lt.transformByState({ left: k, top: ae, width: Me, height: st, angle: ot, flipX: at, flipY: ct, skewX: jt, skewY: $t });
2164
+ lt.transformByState({ left: k, top: ae, width: be, height: st, angle: ot, flipX: at, flipY: ct, skewX: jt, skewY: $t });
2166
2165
  return;
2167
2166
  }
2168
- const ye = It({
2167
+ const Me = It({
2169
2168
  startX: _.startX,
2170
2169
  startY: 0,
2171
2170
  endX: p.endX,
@@ -2177,19 +2176,19 @@ let et = class extends ne {
2177
2176
  top: p.absolute.top
2178
2177
  }
2179
2178
  }, n), ut = {
2180
- left: ye.startX,
2181
- top: ye.startY,
2182
- width: ye.width,
2183
- height: ye.height,
2179
+ left: Me.startX,
2180
+ top: Me.startY,
2181
+ width: Me.width,
2182
+ height: Me.height,
2184
2183
  zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
2185
- }, de = new Pe(dt, ut);
2186
- X.addObject(de, xt), T.allowTransform !== !1 && X.attachTransformerTo(de);
2187
- const Q = new pt(), Ee = X.getMainViewport(), le = {
2184
+ }, de = new Ve(dt, ut);
2185
+ X.addObject(de, Ft), T.allowTransform !== !1 && X.attachTransformerTo(de);
2186
+ const Q = new wt(), ye = X.getMainViewport(), le = {
2188
2187
  top: 0,
2189
2188
  //viewMain.top,
2190
- left: Ee.left,
2191
- bottom: Ee.bottom,
2192
- right: Ee.right
2189
+ left: ye.left,
2190
+ bottom: ye.bottom,
2191
+ right: ye.right
2193
2192
  }, ue = {
2194
2193
  dispose: Q,
2195
2194
  rect: de,
@@ -2200,10 +2199,10 @@ let et = class extends ne {
2200
2199
  domAnchor: n,
2201
2200
  scrollDirectionResponse: "HORIZONTAL"
2202
2201
  /* HORIZONTAL */
2203
- }, ht = ge(de, L.renderUnit.scene, x.skeleton, E.worksheet, ue), Te = new We(ht);
2204
- ue.position$ = Te;
2205
- let Ge = {
2206
- position$: Te,
2202
+ }, ht = ge(de, L.renderUnit.scene, x.skeleton, E.worksheet, ue), Ee = new ke(ht);
2203
+ ue.position$ = Ee;
2204
+ let Xe = {
2205
+ position$: Ee,
2207
2206
  id: D,
2208
2207
  componentKey: T.componentKey,
2209
2208
  onPointerDown: () => {
@@ -2218,8 +2217,8 @@ let et = class extends ne {
2218
2217
  data: H,
2219
2218
  unitId: w
2220
2219
  };
2221
- e.eventPassThrough && (Ge = {
2222
- ...Ge,
2220
+ e.eventPassThrough && (Xe = {
2221
+ ...Xe,
2223
2222
  onPointerDown: (j) => {
2224
2223
  K.dispatchEvent(new PointerEvent(j.type, j));
2225
2224
  },
@@ -2229,15 +2228,15 @@ let et = class extends ne {
2229
2228
  onPointerUp: (j) => {
2230
2229
  K.dispatchEvent(new PointerEvent(j.type, j));
2231
2230
  }
2232
- }), this._canvasFloatDomService.addFloatDom(Ge);
2231
+ }), this._canvasFloatDomService.addFloatDom(Xe);
2233
2232
  const gt = de.onTransformChange$.subscribeEvent(() => {
2234
2233
  const j = ge(de, L.renderUnit.scene, x.skeleton, E.worksheet, ue);
2235
- Te.next(
2234
+ Ee.next(
2236
2235
  j
2237
2236
  );
2238
2237
  });
2239
2238
  this.disposeWithMe(m.subscribe((j) => {
2240
- const Oe = It({
2239
+ const Te = It({
2241
2240
  startX: j.startX,
2242
2241
  startY: 0,
2243
2242
  endX: j.endX,
@@ -2248,14 +2247,14 @@ let et = class extends ne {
2248
2247
  left: p.absolute.left,
2249
2248
  top: p.absolute.top
2250
2249
  }
2251
- }, n), Le = ve({ unitId: w, subUnitId: y, drawingId: D }), Ve = new Pe(Le, {
2252
- left: Oe.startX,
2250
+ }, n), Ge = Pe({ unitId: w, subUnitId: y, drawingId: D }), Le = new Ve(Ge, {
2251
+ left: Te.startX,
2253
2252
  top: 0,
2254
2253
  width: n.width,
2255
2254
  height: n.height,
2256
2255
  zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
2257
- }), ft = ge(Ve, L.renderUnit.scene, x.skeleton, E.worksheet, ue);
2258
- Te.next(ft);
2256
+ }), ft = ge(Le, L.renderUnit.scene, x.skeleton, E.worksheet, ue);
2257
+ Ee.next(ft);
2259
2258
  }));
2260
2259
  const he = (C = this._renderManagerService.getRenderById(w)) == null ? void 0 : C.with(V);
2261
2260
  he == null || he.currentSkeleton$.subscribe((j) => {
@@ -2284,33 +2283,33 @@ let et = class extends ne {
2284
2283
  // eslint-disable-next-line max-lines-per-function
2285
2284
  _createRangePositionObserver(t, e, n) {
2286
2285
  let { startRow: r, startColumn: s } = t;
2287
- const o = Je(r, s, n), a = new We(o), d = Je(t.endRow, t.endColumn, n), u = new We(d), c = () => {
2286
+ const o = Je(r, s, n), a = new ke(o), l = Je(t.endRow, t.endColumn, n), u = new ke(l), c = () => {
2288
2287
  const m = Je(r, s, n), _ = Je(t.endRow, t.endColumn, n);
2289
2288
  a.next(m), u.next(_);
2290
- }, l = new pt();
2291
- l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((m) => {
2292
- if (m.id === Qr.id && m.params.rowsAutoHeightInfo.findIndex((v) => v.row === r) > -1) {
2289
+ }, d = new wt();
2290
+ d.add(e.engine.clientRect$.subscribe(() => c())), d.add(this._commandService.onCommandExecuted((m) => {
2291
+ if (m.id === gi.id && m.params.rowsAutoHeightInfo.findIndex((v) => v.row === r) > -1) {
2293
2292
  c();
2294
2293
  return;
2295
2294
  }
2296
- (ei.indexOf(m.id) > -1 || m.id === Ti.id || m.id === An.id) && c();
2295
+ (fi.indexOf(m.id) > -1 || m.id === Fr.id || m.id === _n.id) && c();
2297
2296
  }));
2298
2297
  const g = (m, _) => {
2299
2298
  r = m, s = _, c();
2300
2299
  }, h = () => ({
2301
2300
  rotate: 0,
2302
- width: d.right - o.left,
2303
- height: d.bottom - o.top,
2301
+ width: l.right - o.left,
2302
+ height: l.bottom - o.top,
2304
2303
  absolute: {
2305
2304
  left: !0,
2306
2305
  top: !0
2307
2306
  },
2308
2307
  startX: o.left,
2309
2308
  startY: o.top,
2310
- endX: d.right,
2311
- endY: d.bottom
2309
+ endX: l.right,
2310
+ endY: l.bottom
2312
2311
  }), f = a.pipe(
2313
- be((m) => {
2312
+ Re((m) => {
2314
2313
  const _ = Je(t.endRow, t.endColumn, n);
2315
2314
  return {
2316
2315
  rotate: 0,
@@ -2333,18 +2332,18 @@ let et = class extends ne {
2333
2332
  updateRowCol: g,
2334
2333
  topLeftPos$: a,
2335
2334
  rightBottomPos$: u,
2336
- disposable: l
2335
+ disposable: d
2337
2336
  };
2338
2337
  }
2339
2338
  };
2340
2339
  et = ys([
2341
- Ce(0, A(Z)),
2342
- Ce(1, Se),
2343
- Ce(2, A(G)),
2344
- Ce(3, ie),
2345
- Ce(4, A(Wi)),
2346
- Ce(5, re),
2347
- Ce(6, A(Wr))
2340
+ Ie(0, A(J)),
2341
+ Ie(1, Se),
2342
+ Ie(2, A(G)),
2343
+ Ie(3, ie),
2344
+ Ie(4, A(Wi)),
2345
+ Ie(5, re),
2346
+ Ie(6, A(Jr))
2348
2347
  ], et);
2349
2348
  function Je(i, t, e) {
2350
2349
  const n = e.getCellWithCoordByIndex(i, t), r = n.isMergedMainCell ? n.mergeInfo : n;
@@ -2359,23 +2358,23 @@ function It(i, t, e) {
2359
2358
  var u, c;
2360
2359
  e = e != null ? e : 1;
2361
2360
  const n = i.endX - i.startX, r = i.endY - i.startY, s = (u = t == null ? void 0 : t.width) != null ? u : n, o = (c = t == null ? void 0 : t.height) != null ? c : r;
2362
- let a = 0, d = 0;
2361
+ let a = 0, l = 0;
2363
2362
  if (t) {
2364
2363
  if (t.horizonOffsetAlign === "right") {
2365
- const l = Ct(t.marginX, n * e);
2366
- a = i.endX - l - s;
2364
+ const d = Ct(t.marginX, n * e);
2365
+ a = i.endX - d - s;
2367
2366
  } else
2368
2367
  a = i.startX + Ct(t.marginX, n);
2369
2368
  if (t.verticalOffsetAlign === "bottom") {
2370
- const l = Ct(t.marginY, r * e);
2371
- d = i.endY - l - o;
2369
+ const d = Ct(t.marginY, r * e);
2370
+ l = i.endY - d - o;
2372
2371
  } else
2373
- d = i.startY + Ct(t.marginY, r);
2372
+ l = i.startY + Ct(t.marginY, r);
2374
2373
  }
2375
2374
  return {
2376
2375
  rotate: 0,
2377
2376
  startX: a,
2378
- startY: d,
2377
+ startY: l,
2379
2378
  endX: i.endX,
2380
2379
  endY: i.endY,
2381
2380
  width: s,
@@ -2394,12 +2393,12 @@ function Ct(i, t) {
2394
2393
  }
2395
2394
  const Es = (i) => {
2396
2395
  const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s = Qi(() => t.map((o) => {
2397
- const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g = Ir(
2396
+ const { width: a, height: l, angle: u, left: c, top: d } = o.transform, g = Ir(
2398
2397
  {
2399
2398
  left: c != null ? c : 0,
2400
2399
  right: (c != null ? c : 0) + (a != null ? a : 0),
2401
- top: l != null ? l : 0,
2402
- bottom: (l != null ? l : 0) + (d != null ? d : 0)
2400
+ top: d != null ? d : 0,
2401
+ bottom: (d != null ? d : 0) + (l != null ? l : 0)
2403
2402
  },
2404
2403
  e,
2405
2404
  n,
@@ -2413,10 +2412,10 @@ const Es = (i) => {
2413
2412
  endY: g.bottom,
2414
2413
  rotate: u,
2415
2414
  width: a * h,
2416
- height: d * f,
2415
+ height: l * f,
2417
2416
  absolute: g.absolute
2418
2417
  }, m = {
2419
- position$: new We(p),
2418
+ position$: new ke(p),
2420
2419
  position: p,
2421
2420
  id: o.drawingId,
2422
2421
  componentKey: o.componentKey,
@@ -2439,7 +2438,7 @@ var Ts = Object.getOwnPropertyDescriptor, Os = (i, t, e, n) => {
2439
2438
  for (var r = n > 1 ? void 0 : n ? Ts(t, e) : t, s = i.length - 1, o; s >= 0; s--)
2440
2439
  (o = i[s]) && (r = o(r) || r);
2441
2440
  return r;
2442
- }, De = (i, t) => (e, n) => t(e, n, i);
2441
+ }, Ce = (i, t) => (e, n) => t(e, n, i);
2443
2442
  let Ot = class extends ne {
2444
2443
  constructor(i, t, e, n, r, s, o) {
2445
2444
  super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = t, this._drawingManagerService = e, this._renderManagerService = n, this._canvasFloatDomManagerService = r, this._componetManager = s, this._injector = o, this._initPrinting(), this._initPrintingDom();
@@ -2451,8 +2450,8 @@ let Ot = class extends ne {
2451
2450
  {
2452
2451
  handler: (i, t, e) => {
2453
2452
  const { unitId: n, scene: r, subUnitId: s } = t, o = this._drawingManagerService.getDrawingDataForUnit(n), a = o == null ? void 0 : o[s];
2454
- return a && a.order.forEach((d) => {
2455
- const u = a.data[d];
2453
+ return a && a.order.forEach((l) => {
2454
+ const u = a.data[l];
2456
2455
  u.drawingType !== B.DRAWING_CHART && u.drawingType !== B.DRAWING_DOM && this._drawingRenderService.renderDrawing(u, r);
2457
2456
  }), e();
2458
2457
  }
@@ -2469,16 +2468,16 @@ let Ot = class extends ne {
2469
2468
  const o = s.with(V).getSkeletonParam(r);
2470
2469
  if (!o)
2471
2470
  return e(i);
2472
- const a = this._drawingManagerService.getDrawingDataForUnit(n), d = a == null ? void 0 : a[t.subUnitId];
2473
- if (!d)
2471
+ const a = this._drawingManagerService.getDrawingDataForUnit(n), l = a == null ? void 0 : a[t.subUnitId];
2472
+ if (!l)
2474
2473
  return e(i);
2475
- const { scaleX: u, scaleY: c } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = d.order.map((h) => d.data[h]);
2474
+ const { scaleX: u, scaleY: c } = s.scene, d = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = l.order.map((h) => l.data[h]);
2476
2475
  return g.length ? (g.forEach((h) => {
2477
- if (!h.groupId && h.transform && Re.isDefine(h.transform.left) && Re.isDefine(h.transform.top) && Re.isDefine(h.transform.width) && Re.isDefine(h.transform.height)) {
2476
+ if (!h.groupId && h.transform && De.isDefine(h.transform.left) && De.isDefine(h.transform.top) && De.isDefine(h.transform.width) && De.isDefine(h.transform.height)) {
2478
2477
  const f = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, c, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, c, { x: 0, y: 0 });
2479
- f.column < l.startColumn && (l.startColumn = f.column), f.row < l.startRow && (l.startRow = f.row), l.endRow < p.row && (l.endRow = p.row), l.endColumn < p.column && (l.endColumn = p.column);
2478
+ f.column < d.startColumn && (d.startColumn = f.column), f.row < d.startRow && (d.startRow = f.row), d.endRow < p.row && (d.endRow = p.row), d.endColumn < p.column && (d.endColumn = p.column);
2480
2479
  }
2481
- }), e(l)) : e(i);
2480
+ }), e(d)) : e(i);
2482
2481
  }
2483
2482
  }
2484
2483
  )
@@ -2497,22 +2496,22 @@ let Ot = class extends ne {
2497
2496
  if (c.drawingType === B.DRAWING_CHART)
2498
2497
  return {
2499
2498
  ...c,
2500
- componentKey: this._componetManager.get($r)
2499
+ componentKey: this._componetManager.get(Qr)
2501
2500
  };
2502
2501
  if (c.drawingType === B.DRAWING_DOM) {
2503
- const l = this._sheetPrintInterceptorService.getPrintComponent(c.componentKey);
2502
+ const d = this._sheetPrintInterceptorService.getPrintComponent(c.componentKey);
2504
2503
  return {
2505
2504
  ...c,
2506
- componentKey: this._componetManager.get(l || c.componentKey)
2505
+ componentKey: this._componetManager.get(d || c.componentKey)
2507
2506
  };
2508
2507
  }
2509
2508
  return null;
2510
- }).filter(Boolean), d = ji(Es, this._injector);
2511
- return hi(
2512
- /* @__PURE__ */ oe(d, { floatDomInfos: a, scene: t.scene, skeleton: t.skeleton, worksheet: t.worksheet }),
2509
+ }).filter(Boolean), l = ji(Es, this._injector);
2510
+ return Di(
2511
+ /* @__PURE__ */ oe(l, { floatDomInfos: a, scene: t.scene, skeleton: t.skeleton, worksheet: t.worksheet }),
2513
2512
  t.root
2514
2513
  ), i == null || i.add(() => {
2515
- gi(t.root);
2514
+ Ri(t.root);
2516
2515
  }), e(i);
2517
2516
  }
2518
2517
  }
@@ -2522,13 +2521,13 @@ let Ot = class extends ne {
2522
2521
  }
2523
2522
  };
2524
2523
  Ot = Os([
2525
- De(0, A(Oi)),
2526
- De(1, A(lr)),
2527
- De(2, ie),
2528
- De(3, Z),
2529
- De(4, A(et)),
2530
- De(5, A(dr)),
2531
- De(6, A(Ye))
2524
+ Ce(0, A(xr)),
2525
+ Ce(1, A(lr)),
2526
+ Ce(2, ie),
2527
+ Ce(3, J),
2528
+ Ce(4, A(et)),
2529
+ Ce(5, A(dr)),
2530
+ Ce(6, A(Ye))
2532
2531
  ], Ot);
2533
2532
  var Us = Object.getOwnPropertyDescriptor, Ps = (i, t, e, n) => {
2534
2533
  for (var r = n > 1 ? void 0 : n ? Us(t, e) : t, s = i.length - 1, o; s >= 0; s--)
@@ -2536,36 +2535,36 @@ var Us = Object.getOwnPropertyDescriptor, Ps = (i, t, e, n) => {
2536
2535
  return r;
2537
2536
  }, me = (i, t) => (e, n) => t(e, n, i);
2538
2537
  const As = [
2539
- Xn.id,
2540
- Gn.id,
2541
2538
  Ln.id,
2542
2539
  Vn.id,
2543
2540
  Hn.id,
2544
2541
  zn.id,
2545
2542
  Kn.id,
2546
2543
  Jn.id,
2547
- Jt.id,
2548
- Zt.id,
2549
2544
  Zn.id,
2550
2545
  qn.id,
2546
+ Jt.id,
2547
+ Zt.id,
2551
2548
  Qn.id,
2552
2549
  er.id,
2553
2550
  tr.id,
2554
2551
  nr.id,
2555
2552
  rr.id,
2556
2553
  ir.id,
2557
- sr.id
2554
+ sr.id,
2555
+ or.id,
2556
+ ar.id
2558
2557
  ], Ns = [
2559
- ti.id,
2560
- ni.id,
2561
- ri.id,
2562
- ii.id,
2563
- si.id,
2564
- oi.id
2558
+ mi.id,
2559
+ pi.id,
2560
+ wi.id,
2561
+ _i.id,
2562
+ Si.id,
2563
+ vi.id
2565
2564
  ];
2566
2565
  let rn = class extends ne {
2567
- constructor(i, t, e, n, r, s, o, a, d) {
2568
- super(), this._context = i, this._renderManagerService = t, this._commandService = e, this._selectionRenderService = n, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = a, this._univerInstanceService = d, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
2566
+ constructor(i, t, e, n, r, s, o, a, l) {
2567
+ super(), this._context = i, this._renderManagerService = t, this._commandService = e, this._selectionRenderService = n, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = a, this._univerInstanceService = l, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
2569
2568
  }
2570
2569
  _sheetInterceptorListener() {
2571
2570
  this.disposeWithMe(
@@ -2576,51 +2575,51 @@ let rn = class extends ne {
2576
2575
  if (i.params == null)
2577
2576
  return { redos: [], undos: [] };
2578
2577
  const t = i.id;
2579
- if (t === Xn.id)
2578
+ if (t === Ln.id)
2580
2579
  return this._moveRowInterceptor(i.params, "insert");
2581
- if ([rr.id, ir.id, sr.id].includes(t))
2580
+ if ([sr.id, or.id, ar.id].includes(t))
2582
2581
  return this._moveRangeInterceptor(i.params);
2583
- if (t === Gn.id)
2582
+ if (t === Vn.id)
2584
2583
  return this._moveColInterceptor(i.params, "insert");
2585
- if (t === Ln.id)
2584
+ if (t === Hn.id)
2586
2585
  return this._moveRowInterceptor(i.params, "remove");
2587
- if (t === Vn.id)
2586
+ if (t === zn.id)
2588
2587
  return this._moveColInterceptor(i.params, "remove");
2589
- if (t === Hn.id) {
2588
+ if (t === Kn.id) {
2590
2589
  const { range: e } = i.params;
2591
2590
  return this._getRangeMoveUndo(
2592
2591
  e,
2593
2592
  0
2594
2593
  /* deleteLeft */
2595
2594
  );
2596
- } else if (t === zn.id) {
2595
+ } else if (t === Jn.id) {
2597
2596
  const { range: e } = i.params;
2598
2597
  return this._getRangeMoveUndo(
2599
2598
  e,
2600
2599
  1
2601
2600
  /* deleteUp */
2602
2601
  );
2603
- } else if (t === Kn.id) {
2602
+ } else if (t === Zn.id) {
2604
2603
  const { range: e } = i.params;
2605
2604
  return this._getRangeMoveUndo(
2606
2605
  e,
2607
2606
  2
2608
2607
  /* insertDown */
2609
2608
  );
2610
- } else if (t === Jn.id) {
2609
+ } else if (t === qn.id) {
2611
2610
  const { range: e } = i.params;
2612
2611
  return this._getRangeMoveUndo(
2613
2612
  e,
2614
2613
  3
2615
2614
  /* insertRight */
2616
2615
  );
2617
- } else if (t === Qn.id || t === er.id) {
2616
+ } else if (t === tr.id || t === nr.id) {
2618
2617
  const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
2619
2618
  return this._getDrawingUndoForRowVisible(n, r, s);
2620
- } else if (t === tr.id || t === nr.id) {
2619
+ } else if (t === rr.id || t === ir.id) {
2621
2620
  const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
2622
2621
  return this._getDrawingUndoForColVisible(n, r, s);
2623
- } else if (t === Jt.id || t === Zt.id || t === Zn.id || t === qn.id) {
2622
+ } else if (t === Jt.id || t === Zt.id || t === Qn.id || t === er.id) {
2624
2623
  const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === Jt.id || t === Zt.id;
2625
2624
  return this._getDrawingUndoForRowAndColSize(n, r, s, o);
2626
2625
  }
@@ -2633,19 +2632,19 @@ let rn = class extends ne {
2633
2632
  const e = se(this._univerInstanceService);
2634
2633
  if (e == null)
2635
2634
  return { redos: [], undos: [] };
2636
- const n = e.unitId, r = e.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(n, r), d = [], u = [];
2635
+ const n = e.unitId, r = e.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(n, r), l = [], u = [];
2637
2636
  if (Object.keys(a).forEach((c) => {
2638
- const l = a[c], { updateDrawings: g, deleteDrawings: h } = this._getUpdateOrDeleteDrawings(i, t, l);
2639
- d.push(...g), u.push(...h);
2640
- }), d.length === 0 && u.length === 0)
2637
+ const d = a[c], { updateDrawings: g, deleteDrawings: h } = this._getUpdateOrDeleteDrawings(i, t, d);
2638
+ l.push(...g), u.push(...h);
2639
+ }), l.length === 0 && u.length === 0)
2641
2640
  return { redos: [], undos: [] };
2642
- if (d.length > 0) {
2643
- const c = this._sheetDrawingService.getBatchUpdateOp(d), { undo: l, redo: g, objects: h } = c;
2644
- s.push({ id: P.id, params: { unitId: n, subUnitId: r, op: g, objects: h, type: U.UPDATE } }), o.push({ id: P.id, params: { unitId: n, subUnitId: r, op: l, objects: h, type: U.UPDATE } });
2641
+ if (l.length > 0) {
2642
+ const c = this._sheetDrawingService.getBatchUpdateOp(l), { undo: d, redo: g, objects: h } = c;
2643
+ s.push({ id: P.id, params: { unitId: n, subUnitId: r, op: g, objects: h, type: U.UPDATE } }), o.push({ id: P.id, params: { unitId: n, subUnitId: r, op: d, objects: h, type: U.UPDATE } });
2645
2644
  }
2646
2645
  if (u.length > 0) {
2647
- const c = this._sheetDrawingService.getBatchRemoveOp(u), l = c.undo, g = c.redo, h = c.objects;
2648
- s.push({ id: P.id, params: { unitId: n, subUnitId: r, op: g, objects: h, type: U.REMOVE } }), o.push({ id: P.id, params: { unitId: n, subUnitId: r, op: l, objects: h, type: U.INSERT } });
2646
+ const c = this._sheetDrawingService.getBatchRemoveOp(u), d = c.undo, g = c.redo, h = c.objects;
2647
+ s.push({ id: P.id, params: { unitId: n, subUnitId: r, op: g, objects: h, type: U.REMOVE } }), o.push({ id: P.id, params: { unitId: n, subUnitId: r, op: d, objects: h, type: U.INSERT } });
2649
2648
  }
2650
2649
  return s.push({ id: Y.id, params: [n] }), o.push({ id: Y.id, params: [n] }), {
2651
2650
  redos: s,
@@ -2653,7 +2652,7 @@ let rn = class extends ne {
2653
2652
  };
2654
2653
  }
2655
2654
  _getUpdateOrDeleteDrawings(i, t, e) {
2656
- const n = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: u, drawingId: c } = e, { from: l, to: g } = s, { row: h, column: f } = l, { row: p, column: m } = g;
2655
+ const n = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: l, subUnitId: u, drawingId: c } = e, { from: d, to: g } = s, { row: h, column: f } = d, { row: p, column: m } = g;
2657
2656
  if (s == null || a == null)
2658
2657
  return {
2659
2658
  updateDrawings: n,
@@ -2663,14 +2662,14 @@ let rn = class extends ne {
2663
2662
  let S = null, C = null;
2664
2663
  if (t === 0 && h >= _ && p <= v)
2665
2664
  if (f >= I && m <= R)
2666
- r.push({ unitId: d, subUnitId: u, drawingId: c });
2665
+ r.push({ unitId: l, subUnitId: u, drawingId: c });
2667
2666
  else {
2668
2667
  const w = this._shrinkCol(s, a, I, R, o);
2669
2668
  S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
2670
2669
  }
2671
2670
  else if (t === 1 && f >= I && m <= R)
2672
2671
  if (h >= _ && p <= v)
2673
- r.push({ unitId: d, subUnitId: u, drawingId: c });
2672
+ r.push({ unitId: l, subUnitId: u, drawingId: c });
2674
2673
  else {
2675
2674
  const w = this._shrinkRow(s, a, _, v, o);
2676
2675
  S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
@@ -2699,9 +2698,9 @@ let rn = class extends ne {
2699
2698
  _getDrawingUndoForColVisible(i, t, e) {
2700
2699
  const n = this._drawingManagerService.getDrawingData(i, t), r = [], s = [];
2701
2700
  if (Object.keys(n).forEach((c) => {
2702
- const l = n[c], { sheetTransform: g, transform: h, anchorType: f = O.Position } = l;
2701
+ const d = n[c], { sheetTransform: g, transform: h, anchorType: f = O.Position } = d;
2703
2702
  if (f === O.None)
2704
- this._remainDrawingSize(h, r, l);
2703
+ this._remainDrawingSize(h, r, d);
2705
2704
  else {
2706
2705
  const { from: p, to: m } = g, { row: _, column: v } = p, { row: I, column: R } = m;
2707
2706
  for (let S = 0; S < e.length; S++) {
@@ -2717,10 +2716,10 @@ let rn = class extends ne {
2717
2716
  N = { ...h, left: x.startX };
2718
2717
  }
2719
2718
  if (N != null && (b = $(N, this._selectionRenderService), b != null && N != null)) {
2720
- r.push({ ...l, sheetTransform: b, transform: N });
2719
+ r.push({ ...d, sheetTransform: b, transform: N });
2721
2720
  break;
2722
2721
  }
2723
- this._remainDrawingSize(h, r, l);
2722
+ this._remainDrawingSize(h, r, d);
2724
2723
  continue;
2725
2724
  }
2726
2725
  if (v >= D && R <= E)
@@ -2751,28 +2750,28 @@ let rn = class extends ne {
2751
2750
  ...h,
2752
2751
  width: ((h == null ? void 0 : h.width) || 0) - b.endX + b.startX
2753
2752
  }, T = $(M, this._selectionRenderService), T != null && M != null) {
2754
- s.push({ ...l, sheetTransform: T, transform: M });
2753
+ s.push({ ...d, sheetTransform: T, transform: M });
2755
2754
  break;
2756
2755
  }
2757
2756
  }
2758
2757
  if (M != null && (T = $(M, this._selectionRenderService)), M != null && T != null) {
2759
- r.push({ ...l, sheetTransform: T, transform: M });
2758
+ r.push({ ...d, sheetTransform: T, transform: M });
2760
2759
  break;
2761
2760
  } else
2762
- this._remainDrawingSize(h, r, l);
2761
+ this._remainDrawingSize(h, r, d);
2763
2762
  }
2764
2763
  }
2765
2764
  }), r.length === 0 && s.length === 0)
2766
2765
  return { redos: [], undos: [] };
2767
- const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, t, r), d = [], u = [];
2766
+ const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, t, r), l = [], u = [];
2768
2767
  if (s.length > 0) {
2769
- const { redos: c, undos: l } = this._createUndoAndRedoMutation(i, t, s);
2770
- d.push(...c), u.push(...l);
2768
+ const { redos: c, undos: d } = this._createUndoAndRedoMutation(i, t, s);
2769
+ l.push(...c), u.push(...d);
2771
2770
  }
2772
2771
  return {
2773
2772
  redos: o,
2774
2773
  undos: a,
2775
- preRedos: d,
2774
+ preRedos: l,
2776
2775
  preUndos: u
2777
2776
  };
2778
2777
  }
@@ -2780,22 +2779,22 @@ let rn = class extends ne {
2780
2779
  const n = this._sheetDrawingService.getBatchUpdateOp(e), { undo: r, redo: s, objects: o } = n, a = [
2781
2780
  { id: P.id, params: { unitId: i, subUnitId: t, op: s, objects: o, type: U.UPDATE } },
2782
2781
  { id: Y.id, params: [i] }
2783
- ], d = [
2782
+ ], l = [
2784
2783
  { id: P.id, params: { unitId: i, subUnitId: t, op: r, objects: o, type: U.UPDATE } },
2785
2784
  { id: Y.id, params: [i] }
2786
2785
  ];
2787
2786
  return {
2788
2787
  redos: a,
2789
- undos: d
2788
+ undos: l
2790
2789
  };
2791
2790
  }
2792
2791
  // eslint-disable-next-line max-lines-per-function
2793
2792
  _getDrawingUndoForRowVisible(i, t, e) {
2794
2793
  const n = this._drawingManagerService.getDrawingData(i, t), r = [], s = [];
2795
2794
  if (Object.keys(n).forEach((c) => {
2796
- const l = n[c], { sheetTransform: g, transform: h, anchorType: f = O.Position } = l;
2795
+ const d = n[c], { sheetTransform: g, transform: h, anchorType: f = O.Position } = d;
2797
2796
  if (f === O.None)
2798
- this._remainDrawingSize(h, r, l);
2797
+ this._remainDrawingSize(h, r, d);
2799
2798
  else {
2800
2799
  const { from: p, to: m } = g, { row: _, column: v } = p, { row: I, column: R } = m;
2801
2800
  for (let S = 0; S < e.length; S++) {
@@ -2811,10 +2810,10 @@ let rn = class extends ne {
2811
2810
  N = { ...h, top: x.startY };
2812
2811
  }
2813
2812
  if (N != null && (b = $(N, this._selectionRenderService), b != null && N != null)) {
2814
- r.push({ ...l, sheetTransform: b, transform: N });
2813
+ r.push({ ...d, sheetTransform: b, transform: N });
2815
2814
  break;
2816
2815
  }
2817
- this._remainDrawingSize(h, r, l);
2816
+ this._remainDrawingSize(h, r, d);
2818
2817
  continue;
2819
2818
  }
2820
2819
  if (_ >= w && I <= y)
@@ -2845,39 +2844,39 @@ let rn = class extends ne {
2845
2844
  ...h,
2846
2845
  height: ((h == null ? void 0 : h.height) || 0) - b.endY + b.startY
2847
2846
  }, T = $(M, this._selectionRenderService), T != null && M != null) {
2848
- s.push({ ...l, sheetTransform: T, transform: M });
2847
+ s.push({ ...d, sheetTransform: T, transform: M });
2849
2848
  break;
2850
2849
  }
2851
2850
  }
2852
2851
  if (M != null && (T = $(M, this._selectionRenderService)), M != null && T != null) {
2853
- r.push({ ...l, sheetTransform: T, transform: M });
2852
+ r.push({ ...d, sheetTransform: T, transform: M });
2854
2853
  break;
2855
2854
  } else
2856
- this._remainDrawingSize(h, r, l);
2855
+ this._remainDrawingSize(h, r, d);
2857
2856
  }
2858
2857
  }
2859
2858
  }), r.length === 0 && s.length === 0)
2860
2859
  return { redos: [], undos: [] };
2861
- const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, t, r), d = [], u = [];
2860
+ const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, t, r), l = [], u = [];
2862
2861
  if (s.length > 0) {
2863
- const { redos: c, undos: l } = this._createUndoAndRedoMutation(i, t, s);
2864
- d.push(...c), u.push(...l);
2862
+ const { redos: c, undos: d } = this._createUndoAndRedoMutation(i, t, s);
2863
+ l.push(...c), u.push(...d);
2865
2864
  }
2866
2865
  return {
2867
2866
  redos: o,
2868
2867
  undos: a,
2869
- preRedos: d,
2868
+ preRedos: l,
2870
2869
  preUndos: u
2871
2870
  };
2872
2871
  }
2873
2872
  _getDrawingUndoForRowAndColSize(i, t, e, n) {
2874
2873
  const r = this._drawingManagerService.getDrawingData(i, t), s = [];
2875
2874
  return Object.keys(r).forEach((o) => {
2876
- const a = r[o], { sheetTransform: d, transform: u, anchorType: c = O.Position } = a;
2875
+ const a = r[o], { sheetTransform: l, transform: u, anchorType: c = O.Position } = a;
2877
2876
  if (c === O.None)
2878
2877
  this._remainDrawingSize(u, s, a);
2879
2878
  else {
2880
- const { from: l, to: g } = d, { row: h, column: f } = l, { row: p, column: m } = g;
2879
+ const { from: d, to: g } = l, { row: h, column: f } = d, { row: p, column: m } = g;
2881
2880
  for (let _ = 0; _ < e.length; _++) {
2882
2881
  const v = e[_], { startRow: I, endRow: R, startColumn: S, endColumn: C } = v;
2883
2882
  if (p < I || m < S)
@@ -2886,7 +2885,7 @@ let rn = class extends ne {
2886
2885
  this._remainDrawingSize(u, s, a);
2887
2886
  continue;
2888
2887
  }
2889
- const w = z({ ...d }, this._selectionRenderService, this._skeletonManagerService);
2888
+ const w = z({ ...l }, this._selectionRenderService, this._skeletonManagerService);
2890
2889
  if (w != null) {
2891
2890
  s.push({
2892
2891
  ...a,
@@ -2918,10 +2917,10 @@ let rn = class extends ne {
2918
2917
  const { unitId: r, subUnitId: s } = n, o = (R = (I = this._renderManagerService.getRenderById(r)) == null ? void 0 : I.with(V)) == null ? void 0 : R.getCurrentSkeleton();
2919
2918
  if (!o)
2920
2919
  return { redos: [], undos: [] };
2921
- const a = ar(o, e);
2920
+ const a = Yn(o, e);
2922
2921
  if (!a)
2923
2922
  return { redos: [], undos: [] };
2924
- const { startX: d, endX: u, startY: c, endY: l } = a, g = this._sheetDrawingService.getDrawingData(r, s), h = [];
2923
+ const { startX: l, endX: u, startY: c, endY: d } = a, g = this._sheetDrawingService.getDrawingData(r, s), h = [];
2925
2924
  Object.keys(g).forEach((S) => {
2926
2925
  const C = g[S];
2927
2926
  if (C.anchorType !== O.Both)
@@ -2935,7 +2934,7 @@ let rn = class extends ne {
2935
2934
  drawingStartY: D,
2936
2935
  drawingEndY: D + T
2937
2936
  };
2938
- d <= M && b <= u && c <= N && x <= l && h.push(C);
2937
+ l <= M && b <= u && c <= N && x <= d && h.push(C);
2939
2938
  });
2940
2939
  const f = [], p = [], m = t.startRow - e.startRow, _ = t.startColumn - e.startColumn, v = h.map((S) => {
2941
2940
  const C = S.sheetTransform, w = {
@@ -2960,7 +2959,7 @@ let rn = class extends ne {
2960
2959
  const e = this._getUnitIdAndSubUnitId(i, t);
2961
2960
  if (e == null)
2962
2961
  return { redos: [], undos: [] };
2963
- const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startRow, a = s.endRow, d = [], u = [], c = this._sheetDrawingService.getDrawingData(n, r), l = [], g = [];
2962
+ const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startRow, a = s.endRow, l = [], u = [], c = this._sheetDrawingService.getDrawingData(n, r), d = [], g = [];
2964
2963
  if (Object.keys(c).forEach((h) => {
2965
2964
  const f = c[h], { sheetTransform: p, transform: m, anchorType: _ = O.Position } = f;
2966
2965
  if (p == null || m == null)
@@ -2981,19 +2980,19 @@ let rn = class extends ne {
2981
2980
  if (!v || !I)
2982
2981
  return;
2983
2982
  const R = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: v };
2984
- l.push(R);
2985
- }), l.length === 0 && g.length === 0)
2983
+ d.push(R);
2984
+ }), d.length === 0 && g.length === 0)
2986
2985
  return { redos: [], undos: [] };
2987
- if (l.length > 0) {
2988
- const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: p, objects: m } = h;
2989
- d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.UPDATE } });
2986
+ if (d.length > 0) {
2987
+ const h = this._sheetDrawingService.getBatchUpdateOp(d), { undo: f, redo: p, objects: m } = h;
2988
+ l.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.UPDATE } });
2990
2989
  }
2991
2990
  if (g.length > 0) {
2992
2991
  const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, p = h.redo, m = h.objects;
2993
- d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.INSERT } });
2992
+ l.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.INSERT } });
2994
2993
  }
2995
- return d.push({ id: Y.id, params: [n] }), u.push({ id: Y.id, params: [n] }), {
2996
- redos: d,
2994
+ return l.push({ id: Y.id, params: [n] }), u.push({ id: Y.id, params: [n] }), {
2995
+ redos: l,
2997
2996
  undos: u
2998
2997
  };
2999
2998
  }
@@ -3001,7 +3000,7 @@ let rn = class extends ne {
3001
3000
  const e = this._getUnitIdAndSubUnitId(i, t);
3002
3001
  if (e == null)
3003
3002
  return { redos: [], undos: [] };
3004
- const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startColumn, a = s.endColumn, d = [], u = [], c = this._sheetDrawingService.getDrawingData(n, r), l = [], g = [];
3003
+ const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startColumn, a = s.endColumn, l = [], u = [], c = this._sheetDrawingService.getDrawingData(n, r), d = [], g = [];
3005
3004
  if (Object.keys(c).forEach((h) => {
3006
3005
  const f = c[h], { sheetTransform: p, transform: m, anchorType: _ = O.Position } = f;
3007
3006
  if (p == null || m == null)
@@ -3022,85 +3021,85 @@ let rn = class extends ne {
3022
3021
  if (!v || !I)
3023
3022
  return;
3024
3023
  const R = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: v };
3025
- l.push(R);
3026
- }), l.length === 0 && g.length === 0)
3024
+ d.push(R);
3025
+ }), d.length === 0 && g.length === 0)
3027
3026
  return { redos: [], undos: [] };
3028
- if (l.length > 0) {
3029
- const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: p, objects: m } = h;
3030
- d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.UPDATE } });
3027
+ if (d.length > 0) {
3028
+ const h = this._sheetDrawingService.getBatchUpdateOp(d), { undo: f, redo: p, objects: m } = h;
3029
+ l.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.UPDATE } });
3031
3030
  }
3032
3031
  if (g.length > 0) {
3033
3032
  const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, p = h.redo, m = h.objects;
3034
- d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.INSERT } });
3033
+ l.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.INSERT } });
3035
3034
  }
3036
- return d.push({ id: Y.id, params: [n] }), u.push({ id: Y.id, params: [n] }), { redos: d, undos: u };
3035
+ return l.push({ id: Y.id, params: [n] }), u.push({ id: Y.id, params: [n] }), { redos: l, undos: u };
3037
3036
  }
3038
3037
  _expandCol(i, t, e, n, r = O.Position) {
3039
- const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
3038
+ const s = n - e + 1, { from: o, to: a } = i, { column: l } = o, { column: u } = a;
3040
3039
  if (r === O.None)
3041
3040
  return {
3042
3041
  newSheetTransform: $({ ...t }, this._selectionRenderService),
3043
3042
  newTransform: t
3044
3043
  };
3045
- let c = null, l = null;
3046
- if (d >= e) {
3044
+ let c = null, d = null;
3045
+ if (l >= e) {
3047
3046
  const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: n, startRow: o.row, endRow: a.row });
3048
3047
  if (g == null)
3049
3048
  return;
3050
- l = { ...t, left: (t.left || 0) + g.endX - g.startX }, c = $(l, this._selectionRenderService);
3049
+ d = { ...t, left: (t.left || 0) + g.endX - g.startX }, c = $(d, this._selectionRenderService);
3051
3050
  } else if (u >= n)
3052
3051
  if (r === O.Both)
3053
3052
  c = {
3054
3053
  from: { ...o },
3055
3054
  to: { ...a, column: u + s }
3056
- }, l = z(c, this._selectionRenderService, this._skeletonManagerService);
3055
+ }, d = z(c, this._selectionRenderService, this._skeletonManagerService);
3057
3056
  else
3058
3057
  return {
3059
3058
  newSheetTransform: $({ ...t }, this._selectionRenderService),
3060
3059
  newTransform: t
3061
3060
  };
3062
- return c != null && l != null ? {
3061
+ return c != null && d != null ? {
3063
3062
  newSheetTransform: c,
3064
- newTransform: l
3063
+ newTransform: d
3065
3064
  } : null;
3066
3065
  }
3067
3066
  _shrinkCol(i, t, e, n, r = O.Position) {
3068
- const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
3067
+ const s = n - e + 1, { from: o, to: a } = i, { column: l } = o, { column: u } = a;
3069
3068
  if (r === O.None)
3070
3069
  return {
3071
3070
  newSheetTransform: $({ ...t }, this._selectionRenderService),
3072
3071
  newTransform: t
3073
3072
  };
3074
- let c = null, l = null;
3075
- if (d > n)
3073
+ let c = null, d = null;
3074
+ if (l > n)
3076
3075
  c = {
3077
- from: { ...o, column: d - s },
3076
+ from: { ...o, column: l - s },
3078
3077
  to: { ...a, column: u - s }
3079
- }, l = z(c, this._selectionRenderService, this._skeletonManagerService);
3078
+ }, d = z(c, this._selectionRenderService, this._skeletonManagerService);
3080
3079
  else {
3081
- if (d >= e && u <= n)
3080
+ if (l >= e && u <= n)
3082
3081
  return null;
3083
- if (d < e && u > n)
3082
+ if (l < e && u > n)
3084
3083
  if (r === O.Both)
3085
3084
  c = {
3086
3085
  from: { ...o },
3087
3086
  to: { ...a, column: u - s }
3088
- }, l = z(c, this._selectionRenderService, this._skeletonManagerService);
3087
+ }, d = z(c, this._selectionRenderService, this._skeletonManagerService);
3089
3088
  else
3090
3089
  return {
3091
3090
  newSheetTransform: $({ ...t }, this._selectionRenderService),
3092
3091
  newTransform: t
3093
3092
  };
3094
- else if (d >= e && d <= n) {
3095
- if (d === e)
3096
- l = { ...t, left: (t.left || 0) - i.from.columnOffset };
3093
+ else if (l >= e && l <= n) {
3094
+ if (l === e)
3095
+ d = { ...t, left: (t.left || 0) - i.from.columnOffset };
3097
3096
  else {
3098
- const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: d - 1, startRow: o.row, endRow: a.row });
3097
+ const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: l - 1, startRow: o.row, endRow: a.row });
3099
3098
  if (g == null)
3100
3099
  return;
3101
- l = { ...t, left: (t.left || 0) - g.endX + g.startX - i.from.columnOffset };
3100
+ d = { ...t, left: (t.left || 0) - g.endX + g.startX - i.from.columnOffset };
3102
3101
  }
3103
- c = $(l, this._selectionRenderService);
3102
+ c = $(d, this._selectionRenderService);
3104
3103
  } else if (u >= e && u <= n && r === O.Both) {
3105
3104
  const g = this._skeletonManagerService.attachRangeWithCoord({
3106
3105
  startColumn: e - 1,
@@ -3113,27 +3112,27 @@ let rn = class extends ne {
3113
3112
  c = {
3114
3113
  from: { ...o },
3115
3114
  to: { ...a, column: e - 1, columnOffset: g.endX - g.startX }
3116
- }, l = z(c, this._selectionRenderService, this._skeletonManagerService);
3115
+ }, d = z(c, this._selectionRenderService, this._skeletonManagerService);
3117
3116
  }
3118
3117
  }
3119
- return c != null && l != null ? {
3118
+ return c != null && d != null ? {
3120
3119
  newSheetTransform: c,
3121
- newTransform: l
3120
+ newTransform: d
3122
3121
  } : null;
3123
3122
  }
3124
3123
  _expandRow(i, t, e, n, r = O.Position) {
3125
- const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
3124
+ const s = n - e + 1, { from: o, to: a } = i, { row: l } = o, { row: u } = a;
3126
3125
  if (r === O.None)
3127
3126
  return {
3128
3127
  newSheetTransform: $({ ...t }, this._selectionRenderService),
3129
3128
  newTransform: t
3130
3129
  };
3131
- let c = null, l = null;
3132
- if (d >= e) {
3130
+ let c = null, d = null;
3131
+ if (l >= e) {
3133
3132
  const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: n, startColumn: o.column, endColumn: a.column });
3134
3133
  if (g == null)
3135
3134
  return;
3136
- l = { ...t, top: (t.top || 0) + g.endY - g.startY }, c = $(l, this._selectionRenderService);
3135
+ d = { ...t, top: (t.top || 0) + g.endY - g.startY }, c = $(d, this._selectionRenderService);
3137
3136
  } else if (u >= n)
3138
3137
  if (r === O.Both)
3139
3138
  c = {
@@ -3142,54 +3141,54 @@ let rn = class extends ne {
3142
3141
  ...a,
3143
3142
  row: u + s
3144
3143
  }
3145
- }, l = z(c, this._selectionRenderService, this._skeletonManagerService);
3144
+ }, d = z(c, this._selectionRenderService, this._skeletonManagerService);
3146
3145
  else
3147
3146
  return {
3148
3147
  newSheetTransform: $({ ...t }, this._selectionRenderService),
3149
3148
  newTransform: t
3150
3149
  };
3151
- return c != null && l != null ? {
3150
+ return c != null && d != null ? {
3152
3151
  newSheetTransform: c,
3153
- newTransform: l
3152
+ newTransform: d
3154
3153
  } : null;
3155
3154
  }
3156
3155
  _shrinkRow(i, t, e, n, r = O.Position) {
3157
- const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
3156
+ const s = n - e + 1, { from: o, to: a } = i, { row: l } = o, { row: u } = a;
3158
3157
  if (r === O.None)
3159
3158
  return {
3160
3159
  newSheetTransform: $({ ...t }, this._selectionRenderService),
3161
3160
  newTransform: t
3162
3161
  };
3163
- let c = null, l = null;
3164
- if (d > n)
3162
+ let c = null, d = null;
3163
+ if (l > n)
3165
3164
  c = {
3166
- from: { ...o, row: d - s },
3165
+ from: { ...o, row: l - s },
3167
3166
  to: { ...a, row: u - s }
3168
- }, l = z(c, this._selectionRenderService, this._skeletonManagerService);
3167
+ }, d = z(c, this._selectionRenderService, this._skeletonManagerService);
3169
3168
  else {
3170
- if (d >= e && u <= n)
3169
+ if (l >= e && u <= n)
3171
3170
  return null;
3172
- if (d < e && u > n)
3171
+ if (l < e && u > n)
3173
3172
  if (r === O.Both)
3174
3173
  c = {
3175
3174
  from: { ...o },
3176
3175
  to: { ...a, row: u - s }
3177
- }, l = z(c, this._selectionRenderService, this._skeletonManagerService);
3176
+ }, d = z(c, this._selectionRenderService, this._skeletonManagerService);
3178
3177
  else
3179
3178
  return {
3180
3179
  newSheetTransform: $({ ...t }, this._selectionRenderService),
3181
3180
  newTransform: t
3182
3181
  };
3183
- else if (d >= e && d <= n) {
3184
- if (d === e)
3185
- l = { ...t, top: (t.top || 0) - i.from.rowOffset };
3182
+ else if (l >= e && l <= n) {
3183
+ if (l === e)
3184
+ d = { ...t, top: (t.top || 0) - i.from.rowOffset };
3186
3185
  else {
3187
- const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: d - 1, startColumn: o.column, endColumn: a.column });
3186
+ const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: l - 1, startColumn: o.column, endColumn: a.column });
3188
3187
  if (g == null)
3189
3188
  return;
3190
- l = { ...t, top: (t.top || 0) - g.endY + g.startY - i.from.rowOffset };
3189
+ d = { ...t, top: (t.top || 0) - g.endY + g.startY - i.from.rowOffset };
3191
3190
  }
3192
- c = $(l, this._selectionRenderService);
3191
+ c = $(d, this._selectionRenderService);
3193
3192
  } else if (u >= e && u <= n && r === O.Both) {
3194
3193
  const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: e - 1, endRow: e - 1 });
3195
3194
  if (g == null)
@@ -3197,12 +3196,12 @@ let rn = class extends ne {
3197
3196
  c = {
3198
3197
  from: { ...o },
3199
3198
  to: { ...a, row: e - 1, rowOffset: g.endY - g.startY }
3200
- }, l = z(c, this._selectionRenderService, this._skeletonManagerService);
3199
+ }, d = z(c, this._selectionRenderService, this._skeletonManagerService);
3201
3200
  }
3202
3201
  }
3203
- return c != null && l != null ? {
3202
+ return c != null && d != null ? {
3204
3203
  newSheetTransform: c,
3205
- newTransform: l
3204
+ newTransform: d
3206
3205
  } : null;
3207
3206
  }
3208
3207
  _commandListener() {
@@ -3211,7 +3210,7 @@ let rn = class extends ne {
3211
3210
  // but the skeleton changes like other render modules. These two signals are not equivalent.
3212
3211
  // As a temp solution, I subscribed to activate$ here.
3213
3212
  this._commandService.onCommandExecuted((i) => {
3214
- if (i.id === ai.id) {
3213
+ if (i.id === Ii.id) {
3215
3214
  const { unitId: t, subUnitId: e } = i.params;
3216
3215
  this._updateDrawings(t, e);
3217
3216
  }
@@ -3247,13 +3246,13 @@ let rn = class extends ne {
3247
3246
  Object.keys(e).forEach((s) => {
3248
3247
  const o = e[s];
3249
3248
  o != null && Object.keys(o).forEach((a) => {
3250
- const d = o[a].data;
3251
- d != null && Object.keys(d).forEach((u) => {
3249
+ const l = o[a].data;
3250
+ l != null && Object.keys(l).forEach((u) => {
3252
3251
  if (s === i && a === t) {
3253
- const c = d[u];
3254
- c.transform = z(c.sheetTransform, this._selectionRenderService, this._skeletonManagerService), n.push(d[u]);
3252
+ const c = l[u];
3253
+ c.transform = z(c.sheetTransform, this._selectionRenderService, this._skeletonManagerService), n.push(l[u]);
3255
3254
  } else
3256
- r.push(d[u]);
3255
+ r.push(l[u]);
3257
3256
  });
3258
3257
  });
3259
3258
  }), this._drawingManagerService.removeNotification(r), this._drawingManagerService.addNotification(n);
@@ -3272,13 +3271,13 @@ let rn = class extends ne {
3272
3271
  _refreshDrawingTransform(i, t, e) {
3273
3272
  const n = this._drawingManagerService.getDrawingData(i, t), r = [];
3274
3273
  Object.keys(n).forEach((s) => {
3275
- const o = n[s], { sheetTransform: a, transform: d, anchorType: u = O.Position } = o;
3274
+ const o = n[s], { sheetTransform: a, transform: l, anchorType: u = O.Position } = o;
3276
3275
  if (u === O.None)
3277
3276
  return !0;
3278
- const { from: c, to: l } = a, { row: g, column: h } = c, { row: f, column: p } = l;
3277
+ const { from: c, to: d } = a, { row: g, column: h } = c, { row: f, column: p } = d;
3279
3278
  for (let m = 0; m < e.length; m++) {
3280
3279
  const _ = e[m], { startRow: v, endRow: I, startColumn: R, endColumn: S } = _;
3281
- if (Fr.intersects(
3280
+ if (ei.intersects(
3282
3281
  {
3283
3282
  startRow: v,
3284
3283
  endRow: I,
@@ -3297,8 +3296,8 @@ let rn = class extends ne {
3297
3296
  ...o,
3298
3297
  transform: {
3299
3298
  ...w,
3300
- width: C ? d == null ? void 0 : d.width : w == null ? void 0 : w.width,
3301
- height: C ? d == null ? void 0 : d.height : w == null ? void 0 : w.height
3299
+ width: C ? l == null ? void 0 : l.width : w == null ? void 0 : w.width,
3300
+ height: C ? l == null ? void 0 : l.height : w == null ? void 0 : w.height
3302
3301
  }
3303
3302
  });
3304
3303
  break;
@@ -3308,9 +3307,9 @@ let rn = class extends ne {
3308
3307
  }
3309
3308
  };
3310
3309
  rn = Ps([
3311
- me(1, Z),
3310
+ me(1, J),
3312
3311
  me(2, G),
3313
- me(3, Xe),
3312
+ me(3, Fe),
3314
3313
  me(4, A(V)),
3315
3314
  me(5, A(At)),
3316
3315
  me(6, re),
@@ -3319,13 +3318,13 @@ rn = Ps([
3319
3318
  ], rn);
3320
3319
  const ks = (i) => {
3321
3320
  var v;
3322
- const t = qe(G), e = qe(tt), n = qe(ie), r = qe(Z), { drawings: s } = i, o = s[0];
3321
+ const t = qe(G), e = qe(tt), n = qe(ie), r = qe(J), { drawings: s } = i, o = s[0];
3323
3322
  if (o == null)
3324
3323
  return;
3325
- const { unitId: a } = o, d = r.getRenderById(a), u = d == null ? void 0 : d.scene;
3324
+ const { unitId: a } = o, l = r.getRenderById(a), u = l == null ? void 0 : l.scene;
3326
3325
  if (u == null)
3327
3326
  return;
3328
- const c = u.getTransformerByCreate(), [l, g] = Qt(!0), h = (v = o.anchorType) != null ? v : O.Position, [f, p] = Qt(h);
3327
+ const c = u.getTransformerByCreate(), [d, g] = Qt(!0), h = (v = o.anchorType) != null ? v : O.Position, [f, p] = Qt(h);
3329
3328
  function m(I, R) {
3330
3329
  const S = [];
3331
3330
  return I.forEach((C) => {
@@ -3380,8 +3379,8 @@ const ks = (i) => {
3380
3379
  return /* @__PURE__ */ qt(
3381
3380
  "div",
3382
3381
  {
3383
- className: fi("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
3384
- "univer-hidden": !l
3382
+ className: bi("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
3383
+ "univer-hidden": !d
3385
3384
  }),
3386
3385
  children: [
3387
3386
  /* @__PURE__ */ oe(
@@ -3391,7 +3390,7 @@ const ks = (i) => {
3391
3390
  children: /* @__PURE__ */ oe("div", { children: e.t("drawing-anchor.title") })
3392
3391
  }
3393
3392
  ),
3394
- /* @__PURE__ */ oe("div", { children: /* @__PURE__ */ qt(mi, { value: f, onChange: _, direction: "vertical", children: [
3393
+ /* @__PURE__ */ oe("div", { children: /* @__PURE__ */ qt(Mi, { value: f, onChange: _, direction: "vertical", children: [
3395
3394
  /* @__PURE__ */ oe(Yt, { value: O.Both, children: e.t("drawing-anchor.both") }),
3396
3395
  /* @__PURE__ */ oe(Yt, { value: O.Position, children: e.t("drawing-anchor.position") }),
3397
3396
  /* @__PURE__ */ oe(Yt, { value: O.None, children: e.t("drawing-anchor.none") })
@@ -3420,7 +3419,7 @@ function Bs(i) {
3420
3419
  icon: "AddImageIcon",
3421
3420
  tooltip: "sheetImage.title",
3422
3421
  hidden$: an(i, F.UNIVER_SHEET),
3423
- disabled$: Ui(i, { workbookTypes: [zt], worksheetTypes: [Kt], rangeTypes: [ci] })
3422
+ disabled$: Yr(i, { workbookTypes: [zt], worksheetTypes: [Kt], rangeTypes: [Ci] })
3424
3423
  };
3425
3424
  }
3426
3425
  function js(i) {
@@ -3456,13 +3455,13 @@ const Fs = {
3456
3455
  }
3457
3456
  };
3458
3457
  function it(i) {
3459
- return !i.getContextValue(xr) && !i.getContextValue(Yr) && !i.getContextValue(Xr) && i.getContextValue($e);
3458
+ return !i.getContextValue(ti) && !i.getContextValue(ni) && !i.getContextValue(ri) && i.getContextValue(je);
3460
3459
  }
3461
3460
  const xs = {
3462
3461
  id: rt.id,
3463
3462
  description: "shortcut.drawing-move-down",
3464
3463
  group: "4_drawing-view",
3465
- binding: Fe.ARROW_DOWN,
3464
+ binding: $e.ARROW_DOWN,
3466
3465
  priority: 100,
3467
3466
  preconditions: it,
3468
3467
  staticParameters: {
@@ -3472,7 +3471,7 @@ const xs = {
3472
3471
  id: rt.id,
3473
3472
  description: "shortcut.drawing-move-up",
3474
3473
  group: "4_drawing-view",
3475
- binding: Fe.ARROW_UP,
3474
+ binding: $e.ARROW_UP,
3476
3475
  priority: 100,
3477
3476
  preconditions: it,
3478
3477
  staticParameters: {
@@ -3482,7 +3481,7 @@ const xs = {
3482
3481
  id: rt.id,
3483
3482
  description: "shortcut.drawing-move-left",
3484
3483
  group: "4_drawing-view",
3485
- binding: Fe.ARROW_LEFT,
3484
+ binding: $e.ARROW_LEFT,
3486
3485
  priority: 100,
3487
3486
  preconditions: it,
3488
3487
  staticParameters: {
@@ -3492,7 +3491,7 @@ const xs = {
3492
3491
  id: rt.id,
3493
3492
  description: "shortcut.drawing-move-right",
3494
3493
  group: "4_drawing-view",
3495
- binding: Fe.ARROW_RIGHT,
3494
+ binding: $e.ARROW_RIGHT,
3496
3495
  priority: 100,
3497
3496
  preconditions: it,
3498
3497
  staticParameters: {
@@ -3504,14 +3503,14 @@ const xs = {
3504
3503
  group: "4_drawing-view",
3505
3504
  // when focusing on any other input tag do not trigger this shortcut
3506
3505
  preconditions: it,
3507
- binding: Fe.DELETE,
3508
- mac: Fe.BACKSPACE
3506
+ binding: $e.DELETE,
3507
+ mac: $e.BACKSPACE
3509
3508
  };
3510
3509
  var Vs = Object.getOwnPropertyDescriptor, Hs = (i, t, e, n) => {
3511
3510
  for (var r = n > 1 ? void 0 : n ? Vs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
3512
3511
  (o = i[s]) && (r = o(r) || r);
3513
3512
  return r;
3514
- }, ke = (i, t) => (e, n) => t(e, n, i);
3513
+ }, Ne = (i, t) => (e, n) => t(e, n, i);
3515
3514
  let Ut = class extends ne {
3516
3515
  constructor(i, t, e, n, r, s) {
3517
3516
  super(), this._componentManager = i, this._menuManagerService = t, this._commandService = e, this._shortcutService = n, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
@@ -3557,12 +3556,12 @@ let Ut = class extends ne {
3557
3556
  }
3558
3557
  };
3559
3558
  Ut = Hs([
3560
- ke(0, A(dr)),
3561
- ke(1, Fi),
3562
- ke(2, G),
3563
- ke(3, xi),
3564
- ke(4, ie),
3565
- ke(5, A(sn))
3559
+ Ne(0, A(dr)),
3560
+ Ne(1, Fi),
3561
+ Ne(2, G),
3562
+ Ne(3, xi),
3563
+ Ne(4, ie),
3564
+ Ne(5, A(on))
3566
3565
  ], Ut);
3567
3566
  var zs = Object.defineProperty, Ks = Object.getOwnPropertyDescriptor, Js = (i, t, e) => t in i ? zs(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, Zs = (i, t, e, n) => {
3568
3567
  for (var r = n > 1 ? void 0 : n ? Ks(t, e) : t, s = i.length - 1, o; s >= 0; s--)
@@ -3570,10 +3569,10 @@ var zs = Object.defineProperty, Ks = Object.getOwnPropertyDescriptor, Js = (i, t
3570
3569
  return r;
3571
3570
  }, Lt = (i, t) => (e, n) => t(e, n, i), Dr = (i, t, e) => Js(i, typeof t != "symbol" ? t + "" : t, e);
3572
3571
  const qs = "SHEET_IMAGE_UI_PLUGIN";
3573
- let Pt = class extends Vr {
3572
+ let Pt = class extends oi {
3574
3573
  constructor(i = jn, t, e, n) {
3575
3574
  super(), this._config = i, this._injector = t, this._renderManagerService = e, this._configService = n;
3576
- const { menu: r, ...s } = Hr(
3575
+ const { menu: r, ...s } = ai(
3577
3576
  {},
3578
3577
  jn,
3579
3578
  this._config
@@ -3581,7 +3580,7 @@ let Pt = class extends Vr {
3581
3580
  r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(ss, s);
3582
3581
  }
3583
3582
  onStarting() {
3584
- zr(this._injector, [
3583
+ ci(this._injector, [
3585
3584
  [et],
3586
3585
  [Ut],
3587
3586
  [Rt],
@@ -3591,18 +3590,18 @@ let Pt = class extends Vr {
3591
3590
  [bt],
3592
3591
  [Mt],
3593
3592
  [yt]
3594
- ]), Ft(this._injector, [
3593
+ ]), xt(this._injector, [
3595
3594
  [et]
3596
3595
  ]);
3597
3596
  }
3598
3597
  onReady() {
3599
- Ft(this._injector, [
3598
+ xt(this._injector, [
3600
3599
  [Et],
3601
3600
  [yt]
3602
3601
  ]);
3603
3602
  }
3604
3603
  onRendered() {
3605
- this._registerRenderModules(), Ft(this._injector, [
3604
+ this._registerRenderModules(), xt(this._injector, [
3606
3605
  [Tt],
3607
3606
  [Ot],
3608
3607
  [Ut],
@@ -3627,10 +3626,10 @@ let Pt = class extends Vr {
3627
3626
  Dr(Pt, "type", F.UNIVER_SHEET);
3628
3627
  Dr(Pt, "pluginName", qs);
3629
3628
  Pt = Zs([
3630
- Gr(vi, Xi, Ki, Kr),
3629
+ ii(Ui, Xi, Ki, di),
3631
3630
  Lt(1, A(Ye)),
3632
- Lt(2, Z),
3633
- Lt(3, Lr)
3631
+ Lt(2, J),
3632
+ Lt(3, si)
3634
3633
  ], Pt);
3635
3634
  export {
3636
3635
  Y as ClearSheetDrawingTransformerOperation,
@@ -3648,5 +3647,8 @@ export {
3648
3647
  Qe as SheetDrawingUpdateController,
3649
3648
  wr as SidebarSheetDrawingOperation,
3650
3649
  mr as UngroupSheetDrawingCommand,
3651
- Pt as UniverSheetsDrawingUIPlugin
3650
+ Pt as UniverSheetsDrawingUIPlugin,
3651
+ ge as calcSheetFloatDomPosition,
3652
+ z as drawingPositionToTransform,
3653
+ $ as transformToDrawingPosition
3652
3654
  };