@univerjs/sheets-drawing-ui 0.5.3 → 0.5.4-nightly.202501131606

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -1,20 +1,20 @@
1
- var jn = Object.defineProperty;
2
- var Wn = (i, e, n) => e in i ? jn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
- var V = (i, e, n) => Wn(i, typeof e != "symbol" ? e + "" : e, n);
4
- import { CommandType as Y, ICommandService as F, IUndoRedoService as me, sequenceExecute as Lt, LocaleService as Ke, IUniverInstanceService as fe, useDependency as de, Inject as U, Injector as Se, IContextService as Gt, RxDisposable as xn, UniverInstanceType as G, connectInjector as $n, toDisposable as Bn, FOCUSING_COMMON_DRAWINGS as he, DrawingTypeEnum as k, Disposable as Z, ArrangeTypeEnum as Me, createDocumentModelWithStyle as Ln, ObjectRelativeFromH as Gn, ObjectRelativeFromV as Fn, BooleanNumber as Vn, PositionedObjectLayoutType as kn, WrapTextType as Hn, BuildTextUtils as Yn, Range as Xn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as De, DOCS_ZEN_EDITOR_UNIT_ID_KEY as be, InterceptorEffectEnum as zn, ObjectMatrix as Kn, Tools as _e, UserManagerService as Jn, IPermissionService as qn, Rectangle as Zn, Direction as re, FOCUSING_FX_BAR_EDITOR as Qn, EDITOR_ACTIVATED as er, FOCUSING_PANEL_EDITOR as tr, LifecycleService as nr, LifecycleStages as rr, DisposableCollection as ir, fromEventSubject as sr, generateRandomId as or, DependentOn as ar, Plugin as cr, merge as dr, registerDependencies as lr, touchDependencies as tt, IConfigService as ur } from "@univerjs/core";
5
- import { DocDrawingController as hr, UniverDocsDrawingPlugin as gr } from "@univerjs/docs-drawing";
6
- import { IDrawingManagerService as q, IImageIoService as Ft, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Dt, DRAWING_IMAGE_COUNT_LIMIT as bt, ImageUploadStatusType as le, DRAWING_IMAGE_ALLOW_SIZE as yt, getImageSize as Ot, DRAWING_IMAGE_WIDTH_LIMIT as Tt, DRAWING_IMAGE_HEIGHT_LIMIT as Et, getDrawingShapeKeyByDrawingSearch as nt, UniverDrawingPlugin as mr } from "@univerjs/drawing";
7
- import { ImageCropperObject as fr, COMPONENT_IMAGE_POPUP_MENU as pr, OpenImageCropOperation as wr, ImageResetSizeOperation as _r, DrawingRenderService as Vt, DrawingCommonPanel as vr, UniverDrawingUIPlugin as Sr } from "@univerjs/drawing-ui";
8
- import { IRenderManagerService as X, precisionTo as ye, getGroupState as Ir, transformObjectOutOfGroup as Cr, RENDER_CLASS_TYPE as ue, Rect as Pt, ObjectType as Rr, DRAWING_OBJECT_LAYER_INDEX as Mr, SHEET_VIEWPORT_KEY as kt } from "@univerjs/engine-render";
9
- import { ISheetDrawingService as z, SetDrawingApplyMutation as O, DrawingApplyType as T, SheetDrawingAnchorType as y, UniverSheetsDrawingPlugin as Dr } from "@univerjs/sheets-drawing";
10
- import { SheetCanvasPopManagerService as br, convertPositionSheetOverGridToAbsolute as yr, ISheetSelectionRenderService as Ie, SheetSkeletonManagerService as Q, attachRangeWithCoord as Ht, IEditorBridgeService as Or, IAutoFillService as Tr, HoverManagerService as Er, COPY_TYPE as Ut, PREDEFINED_HOOK_NAME as Oe, virtualizeDiscreteRanges as Pr, ISheetClipboardService as Ur, SheetPrintInterceptorService as Ar, getCurrentRangeDisable$ as Nr, SetZoomRatioOperation as jr } from "@univerjs/sheets-ui";
11
- import { ISidebarService as Wr, IUIPartsService as xr, BuiltInUIPart as $r, ILocalFileService as Br, IMessageService as Lr, MenuItemType as wt, getMenuHiddenObservable as Yt, RibbonStartGroup as Gr, KeyCode as ge, ComponentManager as Fr, IMenuManagerService as Vr, IShortcutService as kr, CanvasFloatDomService as Hr } from "@univerjs/ui";
12
- import { takeUntil as At, combineLatest as Te, map as $e, filter as ie, distinctUntilChanged as Ee, Subject as rt, take as Yr, BehaviorSubject as Xr, switchMap as Nt } from "rxjs";
13
- import { SheetInterceptorService as Je, getSheetCommandTarget as H, SheetsSelectionsService as Xt, SetRangeValuesCommand as zr, SetWorksheetRowHeightMutation as zt, SetWorksheetColWidthMutation as Kt, SetWorksheetRowIsAutoHeightMutation as Kr, SetWorksheetRowAutoHeightMutation as Jr, AddWorksheetMergeMutation as qr, RemoveWorksheetMergeMutation as Zr, AFTER_CELL_EDIT as Qr, INTERCEPTOR_POINT as ei, InterceptCellContentPriority as ti, WorkbookViewPermission as jt, WorksheetViewPermission as it, WorkbookEditablePermission as lt, WorksheetEditPermission as xe, InsertRowCommand as Jt, InsertColCommand as qt, RemoveRowCommand as Zt, RemoveColCommand as Qt, DeleteRangeMoveLeftCommand as en, DeleteRangeMoveUpCommand as tn, InsertRangeMoveDownCommand as nn, InsertRangeMoveRightCommand as rn, DeltaRowHeightCommand as ut, SetRowHeightCommand as ht, DeltaColumnWidthCommand as sn, SetColWidthCommand as on, SetRowHiddenCommand as an, SetSpecificRowsVisibleCommand as cn, SetSpecificColsVisibleCommand as dn, SetColHiddenCommand as ln, MoveColsCommand as un, MoveRowsCommand as hn, MoveRangeCommand as gn, SetRowVisibleMutation as ni, SetRowHiddenMutation as ri, SetColVisibleMutation as ii, SetColHiddenMutation as si, SetWorksheetActiveOperation as oi, RangeProtectionPermissionEditPoint as ai, SetFrozenMutation as ci } from "@univerjs/sheets";
14
- import mn, { useEffect as _t, forwardRef as fn, useRef as di, createElement as pn, useState as gt } from "react";
15
- import { docDrawingPositionToTransform as li, ReplaceSnapshotCommand as ui } from "@univerjs/docs-ui";
16
- import { MessageType as se, RadioGroup as hi, Radio as st } from "@univerjs/design";
17
- const gi = "sheets-drawing-ui.config", Wt = {}, W = {
1
+ var Wn = Object.defineProperty;
2
+ var xn = (i, e, n) => e in i ? Wn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
+ var V = (i, e, n) => xn(i, typeof e != "symbol" ? e + "" : e, n);
4
+ import { CommandType as Y, ICommandService as B, IUndoRedoService as fe, sequenceExecute as Ft, LocaleService as Je, IUniverInstanceService as pe, useDependency as le, Inject as U, Injector as Ie, IContextService as Vt, RxDisposable as $n, UniverInstanceType as F, connectInjector as Bn, toDisposable as Ln, FOCUSING_COMMON_DRAWINGS as ge, DrawingTypeEnum as k, Disposable as q, ArrangeTypeEnum as be, createDocumentModelWithStyle as Gn, ObjectRelativeFromH as Fn, ObjectRelativeFromV as Vn, BooleanNumber as kn, PositionedObjectLayoutType as Hn, WrapTextType as Yn, BuildTextUtils as Xn, Range as zn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as De, DOCS_ZEN_EDITOR_UNIT_ID_KEY as ye, InterceptorEffectEnum as Kn, ObjectMatrix as Jn, Tools as ve, UserManagerService as qn, IPermissionService as Zn, Rectangle as Qn, Direction as re, FOCUSING_FX_BAR_EDITOR as er, EDITOR_ACTIVATED as tr, FOCUSING_PANEL_EDITOR as nr, LifecycleService as rr, LifecycleStages as ir, DisposableCollection as sr, fromEventSubject as or, generateRandomId as ar, DependentOn as cr, Plugin as dr, merge as lr, registerDependencies as ur, touchDependencies as rt, IConfigService as hr } from "@univerjs/core";
5
+ import { DocDrawingController as gr, UniverDocsDrawingPlugin as mr } from "@univerjs/docs-drawing";
6
+ import { SetDrawingSelectedOperation as qe, IImageIoService as kt, IDrawingManagerService as Q, DRAWING_IMAGE_ALLOW_IMAGE_LIST as yt, DRAWING_IMAGE_COUNT_LIMIT as Ot, ImageUploadStatusType as ue, DRAWING_IMAGE_ALLOW_SIZE as Et, getImageSize as Tt, DRAWING_IMAGE_WIDTH_LIMIT as Pt, DRAWING_IMAGE_HEIGHT_LIMIT as Ut, getDrawingShapeKeyByDrawingSearch as it, UniverDrawingPlugin as fr } from "@univerjs/drawing";
7
+ import { ImageCropperObject as pr, COMPONENT_IMAGE_POPUP_MENU as _r, OpenImageCropOperation as wr, ImageResetSizeOperation as vr, DrawingRenderService as Ht, DrawingCommonPanel as Sr, UniverDrawingUIPlugin as Ir } from "@univerjs/drawing-ui";
8
+ import { IRenderManagerService as X, precisionTo as Oe, getGroupState as Cr, transformObjectOutOfGroup as Rr, RENDER_CLASS_TYPE as he, Rect as At, ObjectType as Mr, DRAWING_OBJECT_LAYER_INDEX as br, SHEET_VIEWPORT_KEY as Yt } from "@univerjs/engine-render";
9
+ import { ISheetDrawingService as z, SetDrawingApplyMutation as O, DrawingApplyType as E, SheetDrawingAnchorType as y, UniverSheetsDrawingPlugin as Dr } from "@univerjs/sheets-drawing";
10
+ import { SheetCanvasPopManagerService as yr, convertPositionSheetOverGridToAbsolute as Or, ISheetSelectionRenderService as Ce, SheetSkeletonManagerService as Z, attachRangeWithCoord as Xt, IEditorBridgeService as Er, IAutoFillService as Tr, HoverManagerService as Pr, COPY_TYPE as Nt, PREDEFINED_HOOK_NAME as Ee, virtualizeDiscreteRanges as Ur, ISheetClipboardService as Ar, SheetPrintInterceptorService as Nr, getCurrentRangeDisable$ as jr, SetZoomRatioOperation as Wr } from "@univerjs/sheets-ui";
11
+ import { ISidebarService as xr, IUIPartsService as $r, BuiltInUIPart as Br, ILocalFileService as Lr, IMessageService as Gr, MenuItemType as vt, getMenuHiddenObservable as zt, RibbonStartGroup as Fr, KeyCode as me, ComponentManager as Vr, IMenuManagerService as kr, IShortcutService as Hr, CanvasFloatDomService as Yr } from "@univerjs/ui";
12
+ import { takeUntil as jt, combineLatest as Te, map as Be, filter as ie, distinctUntilChanged as Pe, Subject as st, take as Xr, BehaviorSubject as zr, switchMap as Wt } from "rxjs";
13
+ import { SheetInterceptorService as Ze, getSheetCommandTarget as H, SheetsSelectionsService as Kt, SetRangeValuesCommand as Kr, SetWorksheetRowHeightMutation as Jt, SetWorksheetColWidthMutation as qt, SetWorksheetRowIsAutoHeightMutation as Jr, SetWorksheetRowAutoHeightMutation as qr, AddWorksheetMergeMutation as Zr, RemoveWorksheetMergeMutation as Qr, AFTER_CELL_EDIT as ei, INTERCEPTOR_POINT as ti, InterceptCellContentPriority as ni, WorkbookViewPermission as xt, WorksheetViewPermission as ot, WorkbookEditablePermission as ht, WorksheetEditPermission as $e, InsertRowCommand as Zt, InsertColCommand as Qt, RemoveRowCommand as en, RemoveColCommand as tn, DeleteRangeMoveLeftCommand as nn, DeleteRangeMoveUpCommand as rn, InsertRangeMoveDownCommand as sn, InsertRangeMoveRightCommand as on, DeltaRowHeightCommand as gt, SetRowHeightCommand as mt, DeltaColumnWidthCommand as an, SetColWidthCommand as cn, SetRowHiddenCommand as dn, SetSpecificRowsVisibleCommand as ln, SetSpecificColsVisibleCommand as un, SetColHiddenCommand as hn, MoveColsCommand as gn, MoveRowsCommand as mn, MoveRangeCommand as fn, SetRowVisibleMutation as ri, SetRowHiddenMutation as ii, SetColVisibleMutation as si, SetColHiddenMutation as oi, SetWorksheetActiveOperation as ai, RangeProtectionPermissionEditPoint as ci, SetFrozenMutation as di } from "@univerjs/sheets";
14
+ import pn, { useEffect as St, forwardRef as _n, useRef as li, createElement as wn, useState as ft } from "react";
15
+ import { docDrawingPositionToTransform as ui, ReplaceSnapshotCommand as hi } from "@univerjs/docs-ui";
16
+ import { MessageType as ae, RadioGroup as gi, Radio as at } from "@univerjs/design";
17
+ const mi = "sheets-drawing-ui.config", $t = {}, W = {
18
18
  id: "sheet.operation.clear-drawing-transformer",
19
19
  type: Y.MUTATION,
20
20
  handler: (i, e) => {
@@ -24,48 +24,48 @@ const gi = "sheets-drawing-ui.config", Wt = {}, W = {
24
24
  (s = (r = n.getRenderById(t)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
25
25
  }), !0;
26
26
  }
27
- }, qe = {
27
+ }, Qe = {
28
28
  id: "sheet.command.remove-sheet-image",
29
29
  type: Y.COMMAND,
30
30
  handler: (i, e) => {
31
- var I, S, R;
32
- const n = i.get(F), t = i.get(me), r = i.get(Je), s = i.get(z);
31
+ var I, S, M;
32
+ const n = i.get(B), t = i.get(fe), r = i.get(Ze), s = i.get(z);
33
33
  if (!e) return !1;
34
- const { drawings: o } = e, d = [];
35
- o.forEach((_) => {
36
- const { unitId: C } = _;
37
- d.push(C);
34
+ const { drawings: o } = e, a = [];
35
+ o.forEach((w) => {
36
+ const { unitId: C } = w;
37
+ a.push(C);
38
38
  });
39
- const l = s.getBatchRemoveOp(o), { unitId: g, subUnitId: c, undo: a, redo: h, objects: u } = l, m = r.onCommandExecute({ id: qe.id, params: e }), f = { id: O.id, params: { unitId: g, subUnitId: c, op: h, objects: u, type: T.REMOVE } }, p = { id: O.id, params: { unitId: g, subUnitId: c, op: a, objects: u, type: T.INSERT } };
40
- return Lt([...(I = m.preRedos) != null ? I : [], f, ...m.redos], n) ? (t.pushUndoRedo({
39
+ const l = s.getBatchRemoveOp(o), { unitId: g, subUnitId: d, undo: c, redo: h, objects: u } = l, m = r.onCommandExecute({ id: Qe.id, params: e }), f = { id: O.id, params: { unitId: g, subUnitId: d, op: h, objects: u, type: E.REMOVE } }, p = { id: O.id, params: { unitId: g, subUnitId: d, op: c, objects: u, type: E.INSERT } };
40
+ return Ft([...(I = m.preRedos) != null ? I : [], f, ...m.redos], n) ? (t.pushUndoRedo({
41
41
  unitID: g,
42
42
  undoMutations: [
43
43
  ...(S = m.preUndos) != null ? S : [],
44
44
  p,
45
45
  ...m.undos,
46
- { id: W.id, params: d }
46
+ { id: W.id, params: a }
47
47
  ],
48
48
  redoMutations: [
49
- ...(R = m.preRedos) != null ? R : [],
49
+ ...(M = m.preRedos) != null ? M : [],
50
50
  f,
51
51
  ...m.redos,
52
- { id: W.id, params: d }
52
+ { id: W.id, params: a }
53
53
  ]
54
54
  }), !0) : !1;
55
55
  }
56
- }, wn = "COMPONENT_SHEET_DRAWING_PANEL", _n = {
56
+ }, vn = "COMPONENT_SHEET_DRAWING_PANEL", Sn = {
57
57
  id: "sidebar.operation.sheet-image",
58
58
  type: Y.COMMAND,
59
59
  handler: async (i, e) => {
60
- const n = i.get(Wr), t = i.get(Ke), r = i.get(fe), s = i.get(q);
60
+ const n = i.get(xr), t = i.get(Je), r = i.get(pe), s = i.get(B);
61
61
  if (!H(r)) return !1;
62
62
  switch (e.value) {
63
63
  case "open":
64
64
  n.open({
65
65
  header: { title: t.t("sheetImage.panel.title") },
66
- children: { label: wn },
66
+ children: { label: vn },
67
67
  onClose: () => {
68
- s.focusDrawing(null);
68
+ s.syncExecuteCommand(qe.id, []);
69
69
  },
70
70
  width: 360
71
71
  });
@@ -77,15 +77,15 @@ const gi = "sheets-drawing-ui.config", Wt = {}, W = {
77
77
  }
78
78
  return !0;
79
79
  }
80
- }, vn = {
80
+ }, In = {
81
81
  id: "sheet.operation.edit-sheet-image",
82
82
  type: Y.OPERATION,
83
83
  handler: (i, e) => {
84
- const n = i.get(q), t = i.get(F);
85
- return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(_n.id, { value: "open" }), !0);
84
+ const n = i.get(B);
85
+ return e == null ? !1 : (n.syncExecuteCommand(qe.id, [e]), n.executeCommand(Sn.id, { value: "open" }), !0);
86
86
  }
87
87
  };
88
- var ot = { exports: {} }, pe = {};
88
+ var ct = { exports: {} }, _e = {};
89
89
  /**
90
90
  * @license React
91
91
  * react-jsx-runtime.production.min.js
@@ -95,58 +95,58 @@ var ot = { exports: {} }, pe = {};
95
95
  * This source code is licensed under the MIT license found in the
96
96
  * LICENSE file in the root directory of this source tree.
97
97
  */
98
- var xt;
99
- function mi() {
100
- if (xt) return pe;
101
- xt = 1;
102
- var i = mn, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), t = Object.prototype.hasOwnProperty, r = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
103
- function o(d, l, g) {
104
- var c, a = {}, h = null, u = null;
98
+ var Bt;
99
+ function fi() {
100
+ if (Bt) return _e;
101
+ Bt = 1;
102
+ var i = pn, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), t = Object.prototype.hasOwnProperty, r = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
103
+ function o(a, l, g) {
104
+ var d, c = {}, h = null, u = null;
105
105
  g !== void 0 && (h = "" + g), l.key !== void 0 && (h = "" + l.key), l.ref !== void 0 && (u = l.ref);
106
- for (c in l) t.call(l, c) && !s.hasOwnProperty(c) && (a[c] = l[c]);
107
- if (d && d.defaultProps) for (c in l = d.defaultProps, l) a[c] === void 0 && (a[c] = l[c]);
108
- return { $$typeof: e, type: d, key: h, ref: u, props: a, _owner: r.current };
106
+ for (d in l) t.call(l, d) && !s.hasOwnProperty(d) && (c[d] = l[d]);
107
+ if (a && a.defaultProps) for (d in l = a.defaultProps, l) c[d] === void 0 && (c[d] = l[d]);
108
+ return { $$typeof: e, type: a, key: h, ref: u, props: c, _owner: r.current };
109
109
  }
110
- return pe.Fragment = n, pe.jsx = o, pe.jsxs = o, pe;
110
+ return _e.Fragment = n, _e.jsx = o, _e.jsxs = o, _e;
111
111
  }
112
- var $t;
113
- function fi() {
114
- return $t || ($t = 1, ot.exports = mi()), ot.exports;
112
+ var Lt;
113
+ function pi() {
114
+ return Lt || (Lt = 1, ct.exports = fi()), ct.exports;
115
115
  }
116
- var $ = fi();
117
- const pi = "univer-upload-loading", wi = "univer-upload-loading-body", _i = "univer-upload-loading-body-animation", vi = "univer-UniverCircleAnimation", Si = "univer-upload-loading-body-text", Pe = {
118
- uploadLoading: pi,
116
+ var $ = pi();
117
+ const _i = "univer-upload-loading", wi = "univer-upload-loading-body", vi = "univer-upload-loading-body-animation", Si = "univer-UniverCircleAnimation", Ii = "univer-upload-loading-body-text", Ue = {
118
+ uploadLoading: _i,
119
119
  uploadLoadingBody: wi,
120
- uploadLoadingBodyAnimation: _i,
121
- univerCircleAnimation: vi,
122
- uploadLoadingBodyText: Si
123
- }, Ii = () => {
124
- const i = de(Ft), e = de(Ke), [n, t] = mn.useState(0);
125
- return _t(() => {
120
+ uploadLoadingBodyAnimation: vi,
121
+ univerCircleAnimation: Si,
122
+ uploadLoadingBodyText: Ii
123
+ }, Ci = () => {
124
+ const i = le(kt), e = le(Je), [n, t] = pn.useState(0);
125
+ return St(() => {
126
126
  const r = i.change$.subscribe((s) => {
127
127
  t(s);
128
128
  });
129
129
  return () => {
130
130
  r.unsubscribe();
131
131
  };
132
- }, [i]), /* @__PURE__ */ $.jsx("div", { style: { display: n > 0 ? "block" : "none" }, className: Pe.uploadLoading, children: /* @__PURE__ */ $.jsxs("div", { className: Pe.uploadLoadingBody, children: [
133
- /* @__PURE__ */ $.jsx("div", { className: Pe.uploadLoadingBodyAnimation }),
134
- /* @__PURE__ */ $.jsx("div", { className: Pe.uploadLoadingBodyText, children: `${e.t("uploadLoading.loading")}: ${n}` })
132
+ }, [i]), /* @__PURE__ */ $.jsx("div", { style: { display: n > 0 ? "block" : "none" }, className: Ue.uploadLoading, children: /* @__PURE__ */ $.jsxs("div", { className: Ue.uploadLoadingBody, children: [
133
+ /* @__PURE__ */ $.jsx("div", { className: Ue.uploadLoadingBodyAnimation }),
134
+ /* @__PURE__ */ $.jsx("div", { className: Ue.uploadLoadingBodyText, children: `${e.t("uploadLoading.loading")}: ${n}` })
135
135
  ] }) });
136
136
  };
137
- var Ci = Object.defineProperty, Ri = Object.getOwnPropertyDescriptor, Mi = (i, e, n, t) => {
138
- for (var r = t > 1 ? void 0 : t ? Ri(e, n) : e, s = i.length - 1, o; s >= 0; s--)
137
+ var Ri = Object.defineProperty, Mi = Object.getOwnPropertyDescriptor, bi = (i, e, n, t) => {
138
+ for (var r = t > 1 ? void 0 : t ? Mi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
139
139
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
140
- return t && r && Ci(e, n, r), r;
141
- }, oe = (i, e) => (n, t) => e(n, t, i);
142
- let Be = class extends xn {
143
- constructor(e, n, t, r, s, o, d) {
140
+ return t && r && Ri(e, n, r), r;
141
+ }, ee = (i, e) => (n, t) => e(n, t, i);
142
+ let Le = class extends $n {
143
+ constructor(e, n, t, r, s, o, a, l) {
144
144
  super();
145
145
  V(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
146
- this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = d, this._init();
146
+ this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = a, this._commandService = l, this._init();
147
147
  }
148
148
  _init() {
149
- this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET).pipe(At(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_SHEET).pipe(At(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(G.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent($r.CONTENT, () => $n(Ii, this._injector));
149
+ this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(jt(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(F.UNIVER_SHEET).pipe(jt(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(F.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(Br.CONTENT, () => Bn(Ci, this._injector));
150
150
  }
151
151
  _dispose(e) {
152
152
  const n = e.getUnitId();
@@ -161,7 +161,7 @@ let Be = class extends xn {
161
161
  _hasCropObject(e) {
162
162
  const n = e.getAllObjectsByOrder();
163
163
  for (const t of n)
164
- if (t instanceof fr)
164
+ if (t instanceof pr)
165
165
  return !0;
166
166
  return !1;
167
167
  }
@@ -175,47 +175,43 @@ let Be = class extends xn {
175
175
  return;
176
176
  let r;
177
177
  this.disposeWithMe(
178
- Bn(
178
+ Ln(
179
179
  t.createControl$.subscribe(() => {
180
- if (this._contextService.setContextValue(he, !0), this._hasCropObject(n))
180
+ if (this._contextService.setContextValue(ge, !0), this._hasCropObject(n))
181
181
  return;
182
182
  const o = t.getSelectedObjectMap();
183
183
  if (o.size > 1) {
184
184
  r == null || r.dispose();
185
185
  return;
186
186
  }
187
- const d = o.values().next().value;
188
- if (!d)
187
+ const a = o.values().next().value;
188
+ if (!a)
189
189
  return;
190
- const l = d.oKey, g = this._drawingManagerService.getDrawingOKey(l);
190
+ const l = a.oKey, g = this._drawingManagerService.getDrawingOKey(l);
191
191
  if (!g)
192
192
  return;
193
- const { unitId: c, subUnitId: a, drawingId: h, drawingType: u } = g, m = g.data;
193
+ const { unitId: d, subUnitId: c, drawingId: h, drawingType: u } = g, m = g.data;
194
194
  if (m && m.disablePopup)
195
195
  return;
196
196
  r == null || r.dispose();
197
- const f = this._canvasPopManagerService.getFeatureMenu(c, a, h, u);
198
- r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(d, {
199
- componentKey: pr,
197
+ const f = this._canvasPopManagerService.getFeatureMenu(d, c, h, u);
198
+ r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
199
+ componentKey: _r,
200
200
  direction: "horizontal",
201
201
  offset: [2, 0],
202
202
  extraProps: {
203
- menuItems: f || this._getImageMenuItems(c, a, h, u)
203
+ menuItems: f || this._getImageMenuItems(d, c, h, u)
204
204
  }
205
- })), this._drawingManagerService.focusDrawing([{
206
- unitId: c,
207
- subUnitId: a,
208
- drawingId: h
209
- }]);
205
+ }));
210
206
  })
211
207
  )
212
208
  ), this.disposeWithMe(
213
209
  t.clearControl$.subscribe(() => {
214
- r == null || r.dispose(), this._contextService.setContextValue(he, !1), this._drawingManagerService.focusDrawing(null);
210
+ r == null || r.dispose(), this._contextService.setContextValue(ge, !1), this._commandService.syncExecuteCommand(qe.id, []);
215
211
  })
216
212
  ), this.disposeWithMe(
217
213
  this._contextService.contextChanged$.subscribe((o) => {
218
- o[he] === !1 && (r == null || r.dispose());
214
+ o[ge] === !1 && (r == null || r.dispose());
219
215
  })
220
216
  ), this.disposeWithMe(
221
217
  t.changing$.subscribe(() => {
@@ -228,14 +224,14 @@ let Be = class extends xn {
228
224
  {
229
225
  label: "image-popup.edit",
230
226
  index: 0,
231
- commandId: vn.id,
227
+ commandId: In.id,
232
228
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
233
229
  disable: r === k.DRAWING_DOM
234
230
  },
235
231
  {
236
232
  label: "image-popup.delete",
237
233
  index: 1,
238
- commandId: qe.id,
234
+ commandId: Qe.id,
239
235
  commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId: n, drawingId: t }] },
240
236
  disable: !1
241
237
  },
@@ -249,38 +245,39 @@ let Be = class extends xn {
249
245
  {
250
246
  label: "image-popup.reset",
251
247
  index: 3,
252
- commandId: _r.id,
248
+ commandId: vr.id,
253
249
  commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
254
250
  disable: r === k.DRAWING_DOM
255
251
  }
256
252
  ];
257
253
  }
258
254
  };
259
- Be = Mi([
260
- oe(0, U(Se)),
261
- oe(1, q),
262
- oe(2, U(br)),
263
- oe(3, X),
264
- oe(4, fe),
265
- oe(5, Gt),
266
- oe(6, U(xr))
267
- ], Be);
268
- function B(i, e, n) {
269
- const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: d = 0, skewX: l = 0, skewY: g = 0 } = i, c = n.getCurrent();
270
- if (c == null)
255
+ Le = bi([
256
+ ee(0, U(Ie)),
257
+ ee(1, Q),
258
+ ee(2, U(yr)),
259
+ ee(3, X),
260
+ ee(4, pe),
261
+ ee(5, Vt),
262
+ ee(6, U($r)),
263
+ ee(7, B)
264
+ ], Le);
265
+ function L(i, e, n) {
266
+ const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: l = 0, skewY: g = 0 } = i, d = n.getCurrent();
267
+ if (d == null)
271
268
  return;
272
- const a = yr(
273
- c.unitId,
274
- c.sheetId,
269
+ const c = Or(
270
+ d.unitId,
271
+ d.sheetId,
275
272
  { from: t, to: r },
276
273
  n
277
274
  );
278
- let { left: h, top: u, width: m, height: f } = a;
275
+ let { left: h, top: u, width: m, height: f } = c;
279
276
  const p = n.getCurrentSkeleton(), v = p.rowHeaderWidth + p.columnTotalWidth, I = p.columnHeaderHeight + p.rowTotalHeight;
280
277
  return h + m > v && (h = v - m), u + f > I && (u = I - f), {
281
278
  flipY: s,
282
279
  flipX: o,
283
- angle: d,
280
+ angle: a,
284
281
  skewX: l,
285
282
  skewY: g,
286
283
  left: h,
@@ -290,39 +287,39 @@ function B(i, e, n) {
290
287
  };
291
288
  }
292
289
  function j(i, e) {
293
- const { left: n = 0, top: t = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: d = !1, angle: l = 0, skewX: g = 0, skewY: c = 0 } = i, a = e.getCellWithCoordByOffset(n, t);
294
- if (a == null)
290
+ const { left: n = 0, top: t = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: a = !1, angle: l = 0, skewX: g = 0, skewY: d = 0 } = i, c = e.getCellWithCoordByOffset(n, t);
291
+ if (c == null)
295
292
  return;
296
293
  const h = {
297
- column: a.actualColumn,
298
- columnOffset: ye(n - a.startX, 1),
299
- row: a.actualRow,
300
- rowOffset: ye(t - a.startY, 1)
294
+ column: c.actualColumn,
295
+ columnOffset: Oe(n - c.startX, 1),
296
+ row: c.actualRow,
297
+ rowOffset: Oe(t - c.startY, 1)
301
298
  }, u = e.getCellWithCoordByOffset(n + r, t + s);
302
299
  if (u == null)
303
300
  return;
304
301
  const m = {
305
302
  column: u.actualColumn,
306
- columnOffset: ye(n + r - u.startX, 1),
303
+ columnOffset: Oe(n + r - u.startX, 1),
307
304
  row: u.actualRow,
308
- rowOffset: ye(t + s - u.startY, 1)
305
+ rowOffset: Oe(t + s - u.startY, 1)
309
306
  };
310
307
  return {
311
308
  flipY: o,
312
- flipX: d,
309
+ flipX: a,
313
310
  angle: l,
314
311
  skewX: g,
315
- skewY: c,
312
+ skewY: d,
316
313
  from: h,
317
314
  to: m
318
315
  };
319
316
  }
320
- var Di = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, yi = (i, e, n, t) => {
321
- for (var r = t > 1 ? void 0 : t ? bi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
317
+ var Di = Object.defineProperty, yi = Object.getOwnPropertyDescriptor, Oi = (i, e, n, t) => {
318
+ for (var r = t > 1 ? void 0 : t ? yi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
322
319
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
323
320
  return t && r && Di(e, n, r), r;
324
- }, Ue = (i, e) => (n, t) => e(n, t, i);
325
- let mt = class extends Z {
321
+ }, Ae = (i, e) => (n, t) => e(n, t, i);
322
+ let pt = class extends q {
326
323
  constructor(i, e, n, t, r) {
327
324
  super(), this._context = i, this._sheetDrawingService = e, this._drawingManagerService = n, this._sheetSelectionRenderService = t, this._sheetSkeletonManagerService = r, this._init();
328
325
  }
@@ -336,23 +333,23 @@ let mt = class extends Z {
336
333
  const n = i[e];
337
334
  for (const t in n.data) {
338
335
  const r = n.data[t];
339
- r.transform = B(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
336
+ r.transform = L(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
340
337
  }
341
338
  }
342
339
  this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
343
340
  }
344
341
  };
345
- mt = yi([
346
- Ue(1, z),
347
- Ue(2, q),
348
- Ue(3, U(Ie)),
349
- Ue(4, U(Q))
350
- ], mt);
351
- function Oi(i) {
342
+ pt = Oi([
343
+ Ae(1, z),
344
+ Ae(2, Q),
345
+ Ae(3, U(Ce)),
346
+ Ae(4, U(Z))
347
+ ], pt);
348
+ function Ei(i) {
352
349
  const e = [];
353
350
  return i.forEach((n) => {
354
- const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: d } = t, l = Ir(0, 0, r.map((a) => a.transform || {})), g = r.map((a) => {
355
- const h = a.transform || { left: 0, top: 0 }, { unitId: u, subUnitId: m, drawingId: f } = a;
351
+ const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: a } = t, l = Cr(0, 0, r.map((c) => c.transform || {})), g = r.map((c) => {
352
+ const h = c.transform || { left: 0, top: 0 }, { unitId: u, subUnitId: m, drawingId: f } = c;
356
353
  return {
357
354
  unitId: u,
358
355
  subUnitId: m,
@@ -362,17 +359,17 @@ function Oi(i) {
362
359
  left: h.left - l.left,
363
360
  top: h.top - l.top
364
361
  },
365
- groupId: d
362
+ groupId: a
366
363
  };
367
- }), c = {
364
+ }), d = {
368
365
  unitId: s,
369
366
  subUnitId: o,
370
- drawingId: d,
367
+ drawingId: a,
371
368
  drawingType: k.DRAWING_GROUP,
372
369
  transform: l
373
370
  };
374
371
  e.push({
375
- parent: c,
372
+ parent: d,
376
373
  children: g
377
374
  });
378
375
  }), e;
@@ -380,11 +377,11 @@ function Oi(i) {
380
377
  function Ti(i) {
381
378
  const e = [];
382
379
  return i.forEach((n) => {
383
- const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: d, transform: l = { width: 0, height: 0 } } = t;
380
+ const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: a, transform: l = { width: 0, height: 0 } } = t;
384
381
  if (l == null)
385
382
  return;
386
- const g = r.map((a) => {
387
- const { transform: h } = a, { unitId: u, subUnitId: m, drawingId: f } = a, p = Cr(h || {}, l, l.width || 0, l.height || 0);
383
+ const g = r.map((c) => {
384
+ const { transform: h } = c, { unitId: u, subUnitId: m, drawingId: f } = c, p = Rr(h || {}, l, l.width || 0, l.height || 0);
388
385
  return {
389
386
  unitId: u,
390
387
  subUnitId: m,
@@ -392,10 +389,10 @@ function Ti(i) {
392
389
  transform: p,
393
390
  groupId: void 0
394
391
  };
395
- }), c = {
392
+ }), d = {
396
393
  unitId: s,
397
394
  subUnitId: o,
398
- drawingId: d,
395
+ drawingId: a,
399
396
  drawingType: k.DRAWING_GROUP,
400
397
  transform: {
401
398
  left: 0,
@@ -403,16 +400,16 @@ function Ti(i) {
403
400
  }
404
401
  };
405
402
  e.push({
406
- parent: c,
403
+ parent: d,
407
404
  children: g
408
405
  });
409
406
  }), e;
410
407
  }
411
- const Sn = {
408
+ const Cn = {
412
409
  id: "sheet.command.group-sheet-image",
413
410
  type: Y.COMMAND,
414
411
  handler: (i, e) => {
415
- const n = i.get(F), t = i.get(me), r = i.get(z);
412
+ const n = i.get(B), t = i.get(fe), r = i.get(z);
416
413
  if (!e) return !1;
417
414
  const s = [];
418
415
  e.forEach(({ parent: u, children: m }) => {
@@ -420,88 +417,88 @@ const Sn = {
420
417
  s.push(f.unitId);
421
418
  });
422
419
  });
423
- const o = r.getGroupDrawingOp(e), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
424
- return n.syncExecuteCommand(O.id, { op: c, unitId: d, subUnitId: l, objects: a, type: T.GROUP }) ? (t.pushUndoRedo({
425
- unitID: d,
420
+ const o = r.getGroupDrawingOp(e), { unitId: a, subUnitId: l, undo: g, redo: d, objects: c } = o;
421
+ return n.syncExecuteCommand(O.id, { op: d, unitId: a, subUnitId: l, objects: c, type: E.GROUP }) ? (t.pushUndoRedo({
422
+ unitID: a,
426
423
  undoMutations: [
427
- { id: O.id, params: { op: g, unitId: d, subUnitId: l, objects: Ti(a), type: T.UNGROUP } },
424
+ { id: O.id, params: { op: g, unitId: a, subUnitId: l, objects: Ti(c), type: E.UNGROUP } },
428
425
  { id: W.id, params: s }
429
426
  ],
430
427
  redoMutations: [
431
- { id: O.id, params: { op: c, unitId: d, subUnitId: l, objects: a, type: T.GROUP } },
428
+ { id: O.id, params: { op: d, unitId: a, subUnitId: l, objects: c, type: E.GROUP } },
432
429
  { id: W.id, params: s }
433
430
  ]
434
431
  }), !0) : !1;
435
432
  }
436
- }, Ze = {
433
+ }, et = {
437
434
  id: "sheet.command.insert-sheet-image",
438
435
  type: Y.COMMAND,
439
436
  handler: (i, e) => {
440
- var I, S, R;
441
- const n = i.get(F), t = i.get(me), r = i.get(z), s = i.get(Je);
437
+ var I, S, M;
438
+ const n = i.get(B), t = i.get(fe), r = i.get(z), s = i.get(Ze);
442
439
  if (!e) return !1;
443
- const o = e.drawings, d = o.map((_) => _.unitId), l = r.getBatchAddOp(o), { unitId: g, subUnitId: c, undo: a, redo: h, objects: u } = l, m = s.onCommandExecute({ id: Ze.id, params: e }), f = { id: O.id, params: { op: h, unitId: g, subUnitId: c, objects: u, type: T.INSERT } }, p = { id: O.id, params: { op: a, unitId: g, subUnitId: c, objects: u, type: T.REMOVE } };
444
- return Lt([...(I = m.preRedos) != null ? I : [], f, ...m.redos], n) ? (t.pushUndoRedo({
440
+ const o = e.drawings, a = o.map((w) => w.unitId), l = r.getBatchAddOp(o), { unitId: g, subUnitId: d, undo: c, redo: h, objects: u } = l, m = s.onCommandExecute({ id: et.id, params: e }), f = { id: O.id, params: { op: h, unitId: g, subUnitId: d, objects: u, type: E.INSERT } }, p = { id: O.id, params: { op: c, unitId: g, subUnitId: d, objects: u, type: E.REMOVE } };
441
+ return Ft([...(I = m.preRedos) != null ? I : [], f, ...m.redos], n) ? (t.pushUndoRedo({
445
442
  unitID: g,
446
443
  undoMutations: [
447
444
  ...(S = m.preUndos) != null ? S : [],
448
445
  p,
449
446
  ...m.undos,
450
- { id: W.id, params: d }
447
+ { id: W.id, params: a }
451
448
  ],
452
449
  redoMutations: [
453
- ...(R = m.preRedos) != null ? R : [],
450
+ ...(M = m.preRedos) != null ? M : [],
454
451
  f,
455
452
  ...m.redos,
456
- { id: W.id, params: d }
453
+ { id: W.id, params: a }
457
454
  ]
458
455
  }), !0) : !1;
459
456
  }
460
- }, In = {
457
+ }, Rn = {
461
458
  id: "sheet.command.set-drawing-arrange",
462
459
  type: Y.COMMAND,
463
460
  handler: (i, e) => {
464
- const n = i.get(F), t = i.get(me);
461
+ const n = i.get(B), t = i.get(fe);
465
462
  if (!e) return !1;
466
- const r = i.get(z), { unitId: s, subUnitId: o, drawingIds: d, arrangeType: l } = e, g = { unitId: s, subUnitId: o, drawingIds: d };
467
- let c;
468
- if (l === Me.forward ? c = r.getForwardDrawingsOp(g) : l === Me.backward ? c = r.getBackwardDrawingOp(g) : l === Me.front ? c = r.getFrontDrawingsOp(g) : l === Me.back && (c = r.getBackDrawingsOp(g)), c == null)
463
+ const r = i.get(z), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: l } = e, g = { unitId: s, subUnitId: o, drawingIds: a };
464
+ let d;
465
+ if (l === be.forward ? d = r.getForwardDrawingsOp(g) : l === be.backward ? d = r.getBackwardDrawingOp(g) : l === be.front ? d = r.getFrontDrawingsOp(g) : l === be.back && (d = r.getBackDrawingsOp(g)), d == null)
469
466
  return !1;
470
- const { objects: a, redo: h, undo: u } = c;
471
- return n.syncExecuteCommand(O.id, { op: h, unitId: s, subUnitId: o, objects: a, type: T.ARRANGE }) ? (t.pushUndoRedo({
467
+ const { objects: c, redo: h, undo: u } = d;
468
+ return n.syncExecuteCommand(O.id, { op: h, unitId: s, subUnitId: o, objects: c, type: E.ARRANGE }) ? (t.pushUndoRedo({
472
469
  unitID: s,
473
470
  undoMutations: [
474
- { id: O.id, params: { op: u, unitId: s, subUnitId: o, objects: a, type: T.ARRANGE } }
471
+ { id: O.id, params: { op: u, unitId: s, subUnitId: o, objects: c, type: E.ARRANGE } }
475
472
  ],
476
473
  redoMutations: [
477
- { id: O.id, params: { op: h, unitId: s, subUnitId: o, objects: a, type: T.ARRANGE } }
474
+ { id: O.id, params: { op: h, unitId: s, subUnitId: o, objects: c, type: E.ARRANGE } }
478
475
  ]
479
476
  }), !0) : !1;
480
477
  }
481
- }, Qe = {
478
+ }, tt = {
482
479
  id: "sheet.command.set-sheet-image",
483
480
  type: Y.COMMAND,
484
481
  handler: (i, e) => {
485
- const n = i.get(F), t = i.get(me), r = i.get(z);
482
+ const n = i.get(B), t = i.get(fe), r = i.get(z);
486
483
  if (!e) return !1;
487
- const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
488
- return n.syncExecuteCommand(O.id, { unitId: d, subUnitId: l, op: c, objects: a, type: T.UPDATE }) ? (t.pushUndoRedo({
489
- unitID: d,
484
+ const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: l, undo: g, redo: d, objects: c } = o;
485
+ return n.syncExecuteCommand(O.id, { unitId: a, subUnitId: l, op: d, objects: c, type: E.UPDATE }) ? (t.pushUndoRedo({
486
+ unitID: a,
490
487
  undoMutations: [
491
- { id: O.id, params: { unitId: d, subUnitId: l, op: g, objects: a, type: T.UPDATE } },
492
- { id: W.id, params: [d] }
488
+ { id: O.id, params: { unitId: a, subUnitId: l, op: g, objects: c, type: E.UPDATE } },
489
+ { id: W.id, params: [a] }
493
490
  ],
494
491
  redoMutations: [
495
- { id: O.id, params: { unitId: d, subUnitId: l, op: c, objects: a, type: T.UPDATE } },
496
- { id: W.id, params: [d] }
492
+ { id: O.id, params: { unitId: a, subUnitId: l, op: d, objects: c, type: E.UPDATE } },
493
+ { id: W.id, params: [a] }
497
494
  ]
498
495
  }), !0) : !1;
499
496
  }
500
- }, Cn = {
497
+ }, Mn = {
501
498
  id: "sheet.command.ungroup-sheet-image",
502
499
  type: Y.COMMAND,
503
500
  handler: (i, e) => {
504
- const n = i.get(F), t = i.get(me), r = i.get(z);
501
+ const n = i.get(B), t = i.get(fe), r = i.get(z);
505
502
  if (!e) return !1;
506
503
  const s = [];
507
504
  e.forEach(({ parent: u, children: m }) => {
@@ -509,63 +506,63 @@ const Sn = {
509
506
  s.push(f.unitId);
510
507
  });
511
508
  });
512
- const o = r.getUngroupDrawingOp(e), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
513
- return n.syncExecuteCommand(O.id, { op: c, unitId: d, subUnitId: l, objects: a, type: T.UNGROUP }) ? (t.pushUndoRedo({
514
- unitID: d,
509
+ const o = r.getUngroupDrawingOp(e), { unitId: a, subUnitId: l, undo: g, redo: d, objects: c } = o;
510
+ return n.syncExecuteCommand(O.id, { op: d, unitId: a, subUnitId: l, objects: c, type: E.UNGROUP }) ? (t.pushUndoRedo({
511
+ unitID: a,
515
512
  undoMutations: [
516
- { id: O.id, params: { op: g, unitId: d, subUnitId: l, objects: Oi(a), type: T.GROUP } },
513
+ { id: O.id, params: { op: g, unitId: a, subUnitId: l, objects: Ei(c), type: E.GROUP } },
517
514
  { id: W.id, params: s }
518
515
  ],
519
516
  redoMutations: [
520
- { id: O.id, params: { op: c, unitId: d, subUnitId: l, objects: a, type: T.UNGROUP } },
517
+ { id: O.id, params: { op: d, unitId: a, subUnitId: l, objects: c, type: E.UNGROUP } },
521
518
  { id: W.id, params: s }
522
519
  ]
523
520
  }), !0) : !1;
524
521
  }
525
522
  };
526
- var Ei = Object.defineProperty, Pi = Object.getOwnPropertyDescriptor, Ui = (i, e, n, t) => {
527
- for (var r = t > 1 ? void 0 : t ? Pi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
523
+ var Pi = Object.defineProperty, Ui = Object.getOwnPropertyDescriptor, Ai = (i, e, n, t) => {
524
+ for (var r = t > 1 ? void 0 : t ? Ui(e, n) : e, s = i.length - 1, o; s >= 0; s--)
528
525
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
529
- return t && r && Ei(e, n, r), r;
526
+ return t && r && Pi(e, n, r), r;
530
527
  }, K = (i, e) => (n, t) => e(n, t, i);
531
- function Ai(i, e, n) {
528
+ function Ni(i, e, n) {
532
529
  const t = n * Math.PI / 180, r = Math.abs(i * Math.cos(t)) + Math.abs(e * Math.sin(t)), s = Math.abs(i * Math.sin(t)) + Math.abs(e * Math.cos(t));
533
530
  return { rotatedWidth: r, rotatedHeight: s };
534
531
  }
535
- function Rn(i, e, n, t, r) {
532
+ function bn(i, e, n, t, r) {
536
533
  var I;
537
- const { rotatedHeight: s, rotatedWidth: o } = Ai(n, t, r), l = i.get(X).getRenderById(e.unitId);
534
+ const { rotatedHeight: s, rotatedWidth: o } = Ni(n, t, r), l = i.get(X).getRenderById(e.unitId);
538
535
  if (!l)
539
536
  return !1;
540
- const c = (I = l.with(Q).getWorksheetSkeleton(e.subUnitId)) == null ? void 0 : I.skeleton;
541
- if (c == null)
537
+ const d = (I = l.with(Z).getWorksheetSkeleton(e.subUnitId)) == null ? void 0 : I.skeleton;
538
+ if (d == null)
542
539
  return !1;
543
- const a = c.getCellByIndex(e.row, e.col), h = a.mergeInfo.endX - a.mergeInfo.startX - 2, u = a.mergeInfo.endY - a.mergeInfo.startY - 2, m = o / s, p = Math.ceil(Math.min(h, u * m)) / o, v = !p || Number.isNaN(p) ? 1e-3 : p;
540
+ const c = d.getCellByIndex(e.row, e.col), h = c.mergeInfo.endX - c.mergeInfo.startX - 2, u = c.mergeInfo.endY - c.mergeInfo.startY - 2, m = o / s, p = Math.ceil(Math.min(h, u * m)) / o, v = !p || Number.isNaN(p) ? 1e-3 : p;
544
541
  return {
545
542
  width: n * v,
546
543
  height: t * v
547
544
  };
548
545
  }
549
- let ve = class extends Z {
550
- constructor(e, n, t, r, s, o, d, l, g, c, a, h, u) {
546
+ let Se = class extends q {
547
+ constructor(e, n, t, r, s, o, a, l, g, d, c, h, u) {
551
548
  super();
552
549
  V(this, "_workbookSelections");
553
- this._context = e, this._skeletonManagerService = n, this._commandService = t, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = d, this._drawingManagerService = l, this._contextService = g, this._messageService = c, this._localeService = a, this._injector = u, this._workbookSelections = h.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
550
+ this._context = e, this._skeletonManagerService = n, this._commandService = t, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = a, this._drawingManagerService = l, this._contextService = g, this._messageService = d, this._localeService = c, this._injector = u, this._workbookSelections = h.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
554
551
  }
555
552
  async insertFloatImage() {
556
553
  const e = await this._fileOpenerService.openFile({
557
554
  multiple: !0,
558
- accept: Dt.map((t) => `.${t.replace("image/", "")}`).join(",")
555
+ accept: yt.map((t) => `.${t.replace("image/", "")}`).join(",")
559
556
  }), n = e.length;
560
- return n > bt ? (this._messageService.show({
561
- type: se.Error,
562
- content: this._localeService.t("update-status.exceedMaxCount", String(bt))
557
+ return n > Ot ? (this._messageService.show({
558
+ type: ae.Error,
559
+ content: this._localeService.t("update-status.exceedMaxCount", String(Ot))
563
560
  }), !1) : n === 0 ? !1 : (e.forEach(async (t) => await this._insertFloatImage(t)), !0);
564
561
  }
565
562
  async insertCellImage() {
566
563
  const n = (await this._fileOpenerService.openFile({
567
564
  multiple: !1,
568
- accept: Dt.map((t) => `.${t.replace("image/", "")}`).join(",")
565
+ accept: yt.map((t) => `.${t.replace("image/", "")}`).join(",")
569
566
  }))[0];
570
567
  return n ? (await this._insertCellImage(n), !0) : !1;
571
568
  }
@@ -575,27 +572,27 @@ let ve = class extends Z {
575
572
  n = await this._imageIoService.saveImage(e);
576
573
  } catch (I) {
577
574
  const S = I.message;
578
- S === le.ERROR_EXCEED_SIZE ? this._messageService.show({
579
- type: se.Error,
580
- content: this._localeService.t("update-status.exceedMaxSize", String(yt / (1024 * 1024)))
581
- }) : S === le.ERROR_IMAGE_TYPE ? this._messageService.show({
582
- type: se.Error,
575
+ S === ue.ERROR_EXCEED_SIZE ? this._messageService.show({
576
+ type: ae.Error,
577
+ content: this._localeService.t("update-status.exceedMaxSize", String(Et / (1024 * 1024)))
578
+ }) : S === ue.ERROR_IMAGE_TYPE ? this._messageService.show({
579
+ type: ae.Error,
583
580
  content: this._localeService.t("update-status.invalidImageType")
584
- }) : S === le.ERROR_IMAGE && this._messageService.show({
585
- type: se.Error,
581
+ }) : S === ue.ERROR_IMAGE && this._messageService.show({
582
+ type: ae.Error,
586
583
  content: this._localeService.t("update-status.invalidImage")
587
584
  });
588
585
  }
589
586
  if (n == null)
590
587
  return;
591
- const t = this._getUnitInfo(), { unitId: r, subUnitId: s } = t, { imageId: o, imageSourceType: d, source: l, base64Cache: g } = n, { width: c, height: a, image: h } = await Ot(g || ""), { width: u, height: m } = this._context.scene;
592
- this._imageIoService.addImageSourceCache(l, d, h);
588
+ const t = this._getUnitInfo(), { unitId: r, subUnitId: s } = t, { imageId: o, imageSourceType: a, source: l, base64Cache: g } = n, { width: d, height: c, image: h } = await Tt(g || ""), { width: u, height: m } = this._context.scene;
589
+ this._imageIoService.addImageSourceCache(l, a, h);
593
590
  let f = 1;
594
- if (c > Tt || a > Et) {
595
- const I = Tt / c, S = Et / a;
591
+ if (d > Pt || c > Ut) {
592
+ const I = Pt / d, S = Ut / c;
596
593
  f = Math.max(I, S);
597
594
  }
598
- const p = this._getImagePosition(c * f, a * f, u, m);
595
+ const p = this._getImagePosition(d * f, c * f, u, m);
599
596
  if (p == null)
600
597
  return;
601
598
  const v = {
@@ -603,12 +600,12 @@ let ve = class extends Z {
603
600
  subUnitId: s,
604
601
  drawingId: o,
605
602
  drawingType: k.DRAWING_IMAGE,
606
- imageSourceType: d,
603
+ imageSourceType: a,
607
604
  source: l,
608
- transform: B(p, this._selectionRenderService, this._skeletonManagerService),
605
+ transform: L(p, this._selectionRenderService, this._skeletonManagerService),
609
606
  sheetTransform: p
610
607
  };
611
- this._commandService.executeCommand(Ze.id, {
608
+ this._commandService.executeCommand(et.id, {
612
609
  unitId: r,
613
610
  drawings: [v]
614
611
  });
@@ -620,33 +617,33 @@ let ve = class extends Z {
620
617
  n = await this._imageIoService.saveImage(e);
621
618
  } catch (p) {
622
619
  const v = p.message;
623
- v === le.ERROR_EXCEED_SIZE ? this._messageService.show({
624
- type: se.Error,
625
- content: this._localeService.t("update-status.exceedMaxSize", String(yt / (1024 * 1024)))
626
- }) : v === le.ERROR_IMAGE_TYPE ? this._messageService.show({
627
- type: se.Error,
620
+ v === ue.ERROR_EXCEED_SIZE ? this._messageService.show({
621
+ type: ae.Error,
622
+ content: this._localeService.t("update-status.exceedMaxSize", String(Et / (1024 * 1024)))
623
+ }) : v === ue.ERROR_IMAGE_TYPE ? this._messageService.show({
624
+ type: ae.Error,
628
625
  content: this._localeService.t("update-status.invalidImageType")
629
- }) : v === le.ERROR_IMAGE && this._messageService.show({
630
- type: se.Error,
626
+ }) : v === ue.ERROR_IMAGE && this._messageService.show({
627
+ type: ae.Error,
631
628
  content: this._localeService.t("update-status.invalidImage")
632
629
  });
633
630
  }
634
631
  if (n == null)
635
632
  return;
636
- const { imageId: t, imageSourceType: r, source: s, base64Cache: o } = n, { width: d, height: l, image: g } = await Ot(o || "");
633
+ const { imageId: t, imageSourceType: r, source: s, base64Cache: o } = n, { width: a, height: l, image: g } = await Tt(o || "");
637
634
  this._imageIoService.addImageSourceCache(s, r, g);
638
- const c = this._workbookSelections.getCurrentLastSelection();
639
- if (!c)
635
+ const d = this._workbookSelections.getCurrentLastSelection();
636
+ if (!d)
640
637
  return !1;
641
- const a = Ln("", {}), h = Rn(
638
+ const c = Gn("", {}), h = bn(
642
639
  this._injector,
643
640
  {
644
641
  unitId: this._context.unitId,
645
642
  subUnitId: this._context.unit.getActiveSheet().getSheetId(),
646
- row: c.primary.actualRow,
647
- col: c.primary.actualColumn
643
+ row: d.primary.actualRow,
644
+ col: d.primary.actualColumn
648
645
  },
649
- d,
646
+ a,
650
647
  l,
651
648
  0
652
649
  );
@@ -658,35 +655,35 @@ let ve = class extends Z {
658
655
  height: h.height
659
656
  },
660
657
  positionH: {
661
- relativeFrom: Gn.PAGE,
658
+ relativeFrom: Fn.PAGE,
662
659
  posOffset: 0
663
660
  },
664
661
  positionV: {
665
- relativeFrom: Fn.PARAGRAPH,
662
+ relativeFrom: Vn.PARAGRAPH,
666
663
  posOffset: 0
667
664
  },
668
665
  angle: 0
669
666
  }, m = {
670
- unitId: a.getUnitId(),
671
- subUnitId: a.getUnitId(),
667
+ unitId: c.getUnitId(),
668
+ subUnitId: c.getUnitId(),
672
669
  drawingId: t,
673
670
  drawingType: k.DRAWING_IMAGE,
674
671
  imageSourceType: r,
675
672
  source: s,
676
- transform: li(u),
673
+ transform: ui(u),
677
674
  docTransform: u,
678
- behindDoc: Vn.FALSE,
675
+ behindDoc: kn.FALSE,
679
676
  title: "",
680
677
  description: "",
681
- layoutType: kn.INLINE,
678
+ layoutType: Hn.INLINE,
682
679
  // Insert inline drawing by default.
683
- wrapText: Hn.BOTH_SIDES,
680
+ wrapText: Yn.BOTH_SIDES,
684
681
  distB: 0,
685
682
  distL: 0,
686
683
  distR: 0,
687
684
  distT: 0
688
- }, f = Yn.drawing.add({
689
- documentDataModel: a,
685
+ }, f = Xn.drawing.add({
686
+ documentDataModel: c,
690
687
  drawings: [m],
691
688
  selection: {
692
689
  collapsed: !0,
@@ -694,11 +691,11 @@ let ve = class extends Z {
694
691
  endOffset: 0
695
692
  }
696
693
  });
697
- return f ? (a.apply(f), this._commandService.syncExecuteCommand(zr.id, {
694
+ return f ? (c.apply(f), this._commandService.syncExecuteCommand(Kr.id, {
698
695
  value: {
699
- [c.primary.actualRow]: {
700
- [c.primary.actualColumn]: {
701
- p: a.getSnapshot(),
696
+ [d.primary.actualRow]: {
697
+ [d.primary.actualColumn]: {
698
+ p: c.getSnapshot(),
702
699
  t: 1
703
700
  }
704
701
  }
@@ -721,29 +718,29 @@ let ve = class extends Z {
721
718
  endColumn: 0
722
719
  };
723
720
  s && s.length > 0 && (o = s[s.length - 1].range);
724
- const d = Ht(this._skeletonManagerService.getCurrent().skeleton, o);
725
- if (d == null)
721
+ const a = Xt(this._skeletonManagerService.getCurrent().skeleton, o);
722
+ if (a == null)
726
723
  return;
727
- let { startColumn: l, startRow: g, startX: c, startY: a } = d, h = !1;
728
- if (c + e > t && (c = t - e, c < 0 && (c = 0, e = t), h = !0), a + n > r && (a = r - n, a < 0 && (a = 0, n = r), h = !0), h) {
729
- const p = this._selectionRenderService.getCellWithCoordByOffset(c, a);
724
+ let { startColumn: l, startRow: g, startX: d, startY: c } = a, h = !1;
725
+ if (d + e > t && (d = t - e, d < 0 && (d = 0, e = t), h = !0), c + n > r && (c = r - n, c < 0 && (c = 0, n = r), h = !0), h) {
726
+ const p = this._selectionRenderService.getCellWithCoordByOffset(d, c);
730
727
  if (p == null)
731
728
  return;
732
- c = p.startX, a = p.startY, l = p.actualColumn, g = p.actualRow;
729
+ d = p.startX, c = p.startY, l = p.actualColumn, g = p.actualRow;
733
730
  }
734
731
  const u = {
735
732
  column: l,
736
733
  columnOffset: 0,
737
734
  row: g,
738
735
  rowOffset: 0
739
- }, m = this._selectionRenderService.getCellWithCoordByOffset(c + e, a + n);
736
+ }, m = this._selectionRenderService.getCellWithCoordByOffset(d + e, c + n);
740
737
  if (m == null)
741
738
  return;
742
739
  const f = {
743
740
  column: m.actualColumn,
744
- columnOffset: c + e - m.startX,
741
+ columnOffset: d + e - m.startX,
745
742
  row: m.actualRow,
746
- rowOffset: a + n - m.startY
743
+ rowOffset: c + n - m.startY
747
744
  };
748
745
  return {
749
746
  from: u,
@@ -753,7 +750,7 @@ let ve = class extends Z {
753
750
  _updateOrderListener() {
754
751
  this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((e) => {
755
752
  const { unitId: n, subUnitId: t, drawingIds: r, arrangeType: s } = e;
756
- this._commandService.executeCommand(In.id, {
753
+ this._commandService.executeCommand(Rn.id, {
757
754
  unitId: n,
758
755
  subUnitId: t,
759
756
  drawingIds: r,
@@ -765,22 +762,22 @@ let ve = class extends Z {
765
762
  this.disposeWithMe(this._drawingManagerService.featurePluginUpdate$.subscribe((e) => {
766
763
  const n = [];
767
764
  e.length !== 0 && (e.forEach((t) => {
768
- const { unitId: r, subUnitId: s, drawingId: o, drawingType: d, transform: l } = t;
765
+ const { unitId: r, subUnitId: s, drawingId: o, drawingType: a, transform: l } = t;
769
766
  if (l == null)
770
767
  return;
771
768
  const g = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: o });
772
769
  if (g == null || g.unitId !== this._context.unitId)
773
770
  return;
774
- const c = j({ ...g.transform, ...l }, this._selectionRenderService);
775
- if (c == null)
771
+ const d = j({ ...g.transform, ...l }, this._selectionRenderService);
772
+ if (d == null)
776
773
  return;
777
- const a = {
774
+ const c = {
778
775
  ...t,
779
- transform: { ...g.transform, ...l, ...B(c, this._selectionRenderService, this._skeletonManagerService) },
780
- sheetTransform: { ...c }
776
+ transform: { ...g.transform, ...l, ...L(d, this._selectionRenderService, this._skeletonManagerService) },
777
+ sheetTransform: { ...d }
781
778
  };
782
- n.push(a);
783
- }), n.length > 0 && this._commandService.executeCommand(Qe.id, {
779
+ n.push(c);
780
+ }), n.length > 0 && this._commandService.executeCommand(tt.id, {
784
781
  unitId: e[0].unitId,
785
782
  drawings: n
786
783
  }));
@@ -788,44 +785,44 @@ let ve = class extends Z {
788
785
  }
789
786
  _groupDrawingListener() {
790
787
  this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((e) => {
791
- this._commandService.executeCommand(Sn.id, e);
788
+ this._commandService.executeCommand(Cn.id, e);
792
789
  const { unitId: n, subUnitId: t, drawingId: r } = e[0].parent;
793
- this._drawingManagerService.focusDrawing([{ unitId: n, subUnitId: t, drawingId: r }]);
790
+ this._commandService.syncExecuteCommand(qe.id, [{ unitId: n, subUnitId: t, drawingId: r }]);
794
791
  })), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((e) => {
795
- this._commandService.executeCommand(Cn.id, e);
792
+ this._commandService.executeCommand(Mn.id, e);
796
793
  }));
797
794
  }
798
795
  _focusDrawingListener() {
799
796
  this.disposeWithMe(
800
797
  this._drawingManagerService.focus$.subscribe((e) => {
801
- e == null || e.length === 0 ? (this._contextService.setContextValue(he, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(he, !0), this._sheetDrawingService.focusDrawing(e));
798
+ e == null || e.length === 0 ? (this._contextService.setContextValue(ge, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(ge, !0), this._sheetDrawingService.focusDrawing(e));
802
799
  })
803
800
  );
804
801
  }
805
802
  };
806
- ve = Ui([
807
- K(1, U(Q)),
808
- K(2, F),
809
- K(3, Ie),
810
- K(4, Ft),
811
- K(5, Br),
803
+ Se = Ai([
804
+ K(1, U(Z)),
805
+ K(2, B),
806
+ K(3, Ce),
807
+ K(4, kt),
808
+ K(5, Lr),
812
809
  K(6, z),
813
- K(7, q),
814
- K(8, Gt),
815
- K(9, Lr),
816
- K(10, U(Ke)),
817
- K(11, U(Xt)),
818
- K(12, U(Se))
819
- ], ve);
820
- var Ni = Object.defineProperty, ji = Object.getOwnPropertyDescriptor, Wi = (i, e, n, t) => {
821
- for (var r = t > 1 ? void 0 : t ? ji(e, n) : e, s = i.length - 1, o; s >= 0; s--)
810
+ K(7, Q),
811
+ K(8, Vt),
812
+ K(9, Gr),
813
+ K(10, U(Je)),
814
+ K(11, U(Kt)),
815
+ K(12, U(Ie))
816
+ ], Se);
817
+ var ji = Object.defineProperty, Wi = Object.getOwnPropertyDescriptor, xi = (i, e, n, t) => {
818
+ for (var r = t > 1 ? void 0 : t ? Wi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
822
819
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
823
- return t && r && Ni(e, n, r), r;
824
- }, ae = (i, e) => (n, t) => e(n, t, i);
825
- function ft(i, e, n) {
820
+ return t && r && ji(e, n, r), r;
821
+ }, ce = (i, e) => (n, t) => e(n, t, i);
822
+ function _t(i, e, n) {
826
823
  var t, r, s, o;
827
824
  if (((r = (t = n == null ? void 0 : n.p) == null ? void 0 : t.body) == null ? void 0 : r.dataStream.length) === 3 && ((o = (s = n.p) == null ? void 0 : s.drawingsOrder) == null ? void 0 : o.length) === 1) {
828
- const d = n.p.drawings[n.p.drawingsOrder[0]], l = Rn(
825
+ const a = n.p.drawings[n.p.drawingsOrder[0]], l = bn(
829
826
  i,
830
827
  {
831
828
  unitId: e.unitId,
@@ -833,32 +830,32 @@ function ft(i, e, n) {
833
830
  row: e.row,
834
831
  col: e.col
835
832
  },
836
- d.docTransform.size.width,
837
- d.docTransform.size.height,
838
- d.docTransform.angle
833
+ a.docTransform.size.width,
834
+ a.docTransform.size.height,
835
+ a.docTransform.angle
839
836
  );
840
837
  if (l)
841
- return d.transform.width = l.width, d.transform.height = l.height, d.docTransform.size.width = l.width, d.docTransform.size.height = l.height, d.transform.left = 0, d.transform.top = 0, d.docTransform.positionH.posOffset = 0, d.docTransform.positionV.posOffset = 0, n.p.documentStyle.pageSize.width = 1 / 0, n.p.documentStyle.pageSize.height = 1 / 0, !0;
838
+ 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, n.p.documentStyle.pageSize.width = 1 / 0, n.p.documentStyle.pageSize.height = 1 / 0, !0;
842
839
  }
843
840
  return !1;
844
841
  }
845
- let Le = class extends Z {
842
+ let Ge = class extends q {
846
843
  constructor(i, e, n, t, r, s, o) {
847
844
  super(), this._commandService = i, this._sheetInterceptorService = e, this._univerInstanceService = n, this._injector = t, this._drawingManagerService = r, this._docDrawingController = s, this._editorBridgeService = o, this._initHandleResize(), this._handleInitEditor(), this._handleWriteCell(), this._initCellContentInterceptor();
848
845
  }
849
846
  _initHandleResize() {
850
847
  this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
851
848
  let e, n = [];
852
- if (i.id === zt.id) {
849
+ if (i.id === Jt.id) {
853
850
  const t = i.params;
854
851
  n = t.ranges, e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
855
- } else if (i.id === Kt.id) {
852
+ } else if (i.id === qt.id) {
856
853
  const t = i.params;
857
854
  n = t.ranges, e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
858
- } else if (i.id === Kr.id) {
855
+ } else if (i.id === Jr.id) {
859
856
  const t = i.params;
860
857
  n = t.ranges, e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
861
- } else if (i.id === Jr.id) {
858
+ } else if (i.id === qr.id) {
862
859
  const t = i.params;
863
860
  e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId }), n = t.rowsAutoHeightInfo.map((r) => ({
864
861
  startRow: r.row,
@@ -866,18 +863,18 @@ let Le = class extends Z {
866
863
  startColumn: 0,
867
864
  endColumn: 9999
868
865
  }));
869
- } else if (i.id === qr.id) {
866
+ } else if (i.id === Zr.id) {
870
867
  const t = i.params;
871
868
  n = t.ranges, e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
872
- } else if (i.id === Zr.id) {
869
+ } else if (i.id === Qr.id) {
873
870
  const t = i.params;
874
871
  n = t.ranges, e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
875
872
  }
876
873
  e && n.length && n.forEach((t) => {
877
- const r = Xn.transformRange(t, e.worksheet);
874
+ const r = zn.transformRange(t, e.worksheet);
878
875
  for (let s = r.startRow; s <= r.endRow; s++)
879
876
  for (let o = r.startColumn; o <= r.endColumn; o++)
880
- ft(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: s, col: o }, e.worksheet.getCellRaw(s, o));
877
+ _t(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: s, col: o }, e.worksheet.getCellRaw(s, o));
881
878
  });
882
879
  }));
883
880
  }
@@ -885,22 +882,22 @@ let Le = class extends Z {
885
882
  this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
886
883
  i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(De), this._docDrawingController.loadDrawingDataForUnit(De), this._drawingManagerService.initializeNotification(De)) : this._drawingManagerService.removeDrawingDataForUnit(De);
887
884
  })), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
888
- i.id === ui.id && i.params.unitId === be && (this._drawingManagerService.removeDrawingDataForUnit(be), this._docDrawingController.loadDrawingDataForUnit(be), this._drawingManagerService.initializeNotification(be));
885
+ i.id === hi.id && i.params.unitId === ye && (this._drawingManagerService.removeDrawingDataForUnit(ye), this._docDrawingController.loadDrawingDataForUnit(ye), this._drawingManagerService.initializeNotification(ye));
889
886
  }));
890
887
  }
891
888
  _handleWriteCell() {
892
- this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(Qr, {
889
+ this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(ei, {
893
890
  priority: 9999,
894
- handler: (i, e, n) => (ft(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: e.row, col: e.col }, i), n(i))
891
+ handler: (i, e, n) => (_t(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: e.row, col: e.col }, i), n(i))
895
892
  }));
896
893
  }
897
894
  _initCellContentInterceptor() {
898
895
  this.disposeWithMe(
899
896
  this._sheetInterceptorService.intercept(
900
- ei.CELL_CONTENT,
897
+ ti.CELL_CONTENT,
901
898
  {
902
- effect: zn.Style,
903
- priority: ti.CELL_IMAGE,
899
+ effect: Kn.Style,
900
+ priority: ni.CELL_IMAGE,
904
901
  handler: (i, e, n) => {
905
902
  var t;
906
903
  return i != null && i.p && ((t = i.p.drawingsOrder) != null && t.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }), n(i);
@@ -910,21 +907,21 @@ let Le = class extends Z {
910
907
  );
911
908
  }
912
909
  };
913
- Le = Wi([
914
- ae(0, F),
915
- ae(1, U(Je)),
916
- ae(2, fe),
917
- ae(3, U(Se)),
918
- ae(4, q),
919
- ae(5, U(hr)),
920
- ae(6, U(Or))
921
- ], Le);
922
- var xi = Object.defineProperty, $i = Object.getOwnPropertyDescriptor, Bi = (i, e, n, t) => {
923
- for (var r = t > 1 ? void 0 : t ? $i(e, n) : e, s = i.length - 1, o; s >= 0; s--)
910
+ Ge = xi([
911
+ ce(0, B),
912
+ ce(1, U(Ze)),
913
+ ce(2, pe),
914
+ ce(3, U(Ie)),
915
+ ce(4, Q),
916
+ ce(5, U(gr)),
917
+ ce(6, U(Er))
918
+ ], Ge);
919
+ var $i = Object.defineProperty, Bi = Object.getOwnPropertyDescriptor, Li = (i, e, n, t) => {
920
+ for (var r = t > 1 ? void 0 : t ? Bi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
924
921
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
925
- return t && r && xi(e, n, r), r;
926
- }, Bt = (i, e) => (n, t) => e(n, t, i);
927
- let Ge = class extends Z {
922
+ return t && r && $i(e, n, r), r;
923
+ }, Gt = (i, e) => (n, t) => e(n, t, i);
924
+ let Fe = class extends q {
928
925
  constructor(i, e) {
929
926
  super(), this._autoFillService = i, this._injector = e, this._initAutoFillHooks();
930
927
  }
@@ -933,24 +930,24 @@ let Ge = class extends Z {
933
930
  this._autoFillService.addHook({
934
931
  id: "sheet-cell-image-autofill",
935
932
  onBeforeSubmit: (i, e, n, t) => {
936
- new Kn(t).forValue((r, s, o) => {
937
- ft(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
933
+ new Jn(t).forValue((r, s, o) => {
934
+ _t(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
938
935
  });
939
936
  }
940
937
  })
941
938
  );
942
939
  }
943
940
  };
944
- Ge = Bi([
945
- Bt(0, U(Tr)),
946
- Bt(1, U(Se))
947
- ], Ge);
948
- var Li = Object.defineProperty, Gi = Object.getOwnPropertyDescriptor, Fi = (i, e, n, t) => {
949
- for (var r = t > 1 ? void 0 : t ? Gi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
941
+ Fe = Li([
942
+ Gt(0, U(Tr)),
943
+ Gt(1, U(Ie))
944
+ ], Fe);
945
+ var Gi = Object.defineProperty, Fi = Object.getOwnPropertyDescriptor, Vi = (i, e, n, t) => {
946
+ for (var r = t > 1 ? void 0 : t ? Fi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
950
947
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
951
- return t && r && Li(e, n, r), r;
952
- }, Ae = (i, e) => (n, t) => e(n, t, i);
953
- let Fe = class extends Z {
948
+ return t && r && Gi(e, n, r), r;
949
+ }, Ne = (i, e) => (n, t) => e(n, t, i);
950
+ let Ve = class extends q {
954
951
  constructor(e, n, t, r) {
955
952
  super();
956
953
  V(this, "_isSetCursor", !1);
@@ -961,18 +958,18 @@ let Fe = class extends Z {
961
958
  _initImageClick() {
962
959
  }
963
960
  };
964
- Fe = Fi([
965
- Ae(0, U(Er)),
966
- Ae(1, U(X)),
967
- Ae(2, U(Xt)),
968
- Ae(3, U(Vt))
969
- ], Fe);
970
- var Vi = Object.defineProperty, ki = Object.getOwnPropertyDescriptor, Hi = (i, e, n, t) => {
971
- for (var r = t > 1 ? void 0 : t ? ki(e, n) : e, s = i.length - 1, o; s >= 0; s--)
961
+ Ve = Vi([
962
+ Ne(0, U(Pr)),
963
+ Ne(1, U(X)),
964
+ Ne(2, U(Kt)),
965
+ Ne(3, U(Ht))
966
+ ], Ve);
967
+ var ki = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, Yi = (i, e, n, t) => {
968
+ for (var r = t > 1 ? void 0 : t ? Hi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
972
969
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
973
- return t && r && Vi(e, n, r), r;
974
- }, at = (i, e) => (n, t) => e(n, t, i);
975
- let Ve = class extends Z {
970
+ return t && r && ki(e, n, r), r;
971
+ }, dt = (i, e) => (n, t) => e(n, t, i);
972
+ let ke = class extends q {
976
973
  constructor(e, n, t) {
977
974
  super();
978
975
  V(this, "_copyInfo");
@@ -983,137 +980,135 @@ let Ve = class extends Z {
983
980
  id: "SHEET_IMAGE_UI_PLUGIN",
984
981
  onBeforeCopy: (e, n, t) => this._collect(e, n, t),
985
982
  onPasteCells: (e, n, t, r) => {
986
- const { copyType: s = Ut.COPY, pasteType: o } = r, { range: d } = e || {}, { range: l, unitId: g, subUnitId: c } = n;
987
- return this._generateMutations(l, { copyType: s, pasteType: o, copyRange: d, unitId: g, subUnitId: c });
983
+ const { copyType: s = Nt.COPY, pasteType: o } = r, { range: a } = e || {}, { range: l, unitId: g, subUnitId: d } = n;
984
+ return this._generateMutations(l, { copyType: s, pasteType: o, copyRange: a, unitId: g, subUnitId: d });
988
985
  },
989
986
  onPastePlainText: (e, n) => ({ undos: [], redos: [] })
990
987
  });
991
988
  }
992
989
  _collect(e, n, t) {
993
990
  var h;
994
- const r = (h = this._renderManagerService.getRenderById(e)) == null ? void 0 : h.with(Q);
991
+ const r = (h = this._renderManagerService.getRenderById(e)) == null ? void 0 : h.with(Z);
995
992
  if (!r) return;
996
993
  const s = r.attachRangeWithCoord(t);
997
994
  if (!s)
998
995
  return;
999
- const { startX: o, endX: d, startY: l, endY: g } = s, c = this._sheetDrawingService.getDrawingData(e, n), a = [];
1000
- Object.keys(c).forEach((u) => {
1001
- const m = c[u], { transform: f } = m;
996
+ const { startX: o, endX: a, startY: l, endY: g } = s, d = this._sheetDrawingService.getDrawingData(e, n), c = [];
997
+ Object.keys(d).forEach((u) => {
998
+ const m = d[u], { transform: f } = m;
1002
999
  if (m.anchorType !== y.Both || !f)
1003
1000
  return;
1004
- const { left: p = 0, top: v = 0, width: I = 0, height: S = 0 } = f, { drawingStartX: R, drawingEndX: _, drawingStartY: C, drawingEndY: w } = {
1001
+ const { left: p = 0, top: v = 0, width: I = 0, height: S = 0 } = f, { drawingStartX: M, drawingEndX: w, drawingStartY: C, drawingEndY: _ } = {
1005
1002
  drawingStartX: p,
1006
1003
  drawingEndX: p + I,
1007
1004
  drawingStartY: v,
1008
1005
  drawingEndY: v + S
1009
1006
  };
1010
- o <= R && _ <= d && l <= C && w <= g && a.push(m);
1011
- }), a.length && (this._copyInfo = {
1012
- drawings: a,
1007
+ o <= M && w <= a && l <= C && _ <= g && c.push(m);
1008
+ }), c.length && (this._copyInfo = {
1009
+ drawings: c,
1013
1010
  unitId: e,
1014
1011
  subUnitId: n
1015
1012
  });
1016
1013
  }
1017
1014
  // eslint-disable-next-line max-lines-per-function
1018
1015
  _generateMutations(e, n) {
1019
- var b;
1016
+ var N;
1020
1017
  if (!this._copyInfo)
1021
1018
  return { redos: [], undos: [] };
1022
1019
  if ([
1023
- Oe.SPECIAL_PASTE_COL_WIDTH,
1024
- Oe.SPECIAL_PASTE_VALUE,
1025
- Oe.SPECIAL_PASTE_FORMAT,
1026
- Oe.SPECIAL_PASTE_FORMULA
1027
- ].includes(
1028
- n.pasteType
1029
- ))
1020
+ Ee.SPECIAL_PASTE_COL_WIDTH,
1021
+ Ee.SPECIAL_PASTE_VALUE,
1022
+ Ee.SPECIAL_PASTE_FORMAT,
1023
+ Ee.SPECIAL_PASTE_FORMULA
1024
+ ].includes(n.pasteType))
1030
1025
  return { redos: [], undos: [] };
1031
- const { copyRange: t } = n;
1032
- if (!t)
1026
+ const { copyRange: r } = n;
1027
+ if (!r)
1033
1028
  return { redos: [], undos: [] };
1034
- const { drawings: r, unitId: s, subUnitId: o } = this._copyInfo, { ranges: [d, l], mapFunc: g } = Pr([t, e]), { row: c, col: a } = g(d.startRow, d.startColumn), { row: h, col: u } = g(l.startRow, l.startColumn), m = (b = this._renderManagerService.getRenderById(s)) == null ? void 0 : b.with(Q);
1035
- if (!m)
1029
+ const { drawings: s, unitId: o, subUnitId: a } = this._copyInfo, { ranges: [l, g], mapFunc: d } = Ur([r, e]), { row: c, col: h } = d(l.startRow, l.startColumn), { row: u, col: m } = d(g.startRow, g.startColumn), f = (N = this._renderManagerService.getRenderById(o)) == null ? void 0 : N.with(Z);
1030
+ if (!f)
1036
1031
  return { redos: [], undos: [] };
1037
- const f = m.attachRangeWithCoord({
1032
+ const p = f.attachRangeWithCoord({
1038
1033
  startRow: c,
1039
1034
  endRow: c,
1040
- startColumn: a,
1041
- endColumn: a
1042
- }), p = m.attachRangeWithCoord({
1043
- startRow: h,
1044
- endRow: h,
1045
- startColumn: u,
1046
- endColumn: u
1035
+ startColumn: h,
1036
+ endColumn: h
1037
+ }), v = f.attachRangeWithCoord({
1038
+ startRow: u,
1039
+ endRow: u,
1040
+ startColumn: m,
1041
+ endColumn: m
1047
1042
  });
1048
- if (!f || !p)
1043
+ if (!p || !v)
1049
1044
  return { redos: [], undos: [] };
1050
- const v = [], I = [], S = p.startX - f.startX, R = p.startY - f.startY, _ = h - c, C = u - a, w = n.copyType === Ut.CUT, { _sheetDrawingService: E } = this;
1051
- return r.forEach((N) => {
1052
- const { transform: A, sheetTransform: D } = N;
1053
- if (!A)
1045
+ const I = [], S = [], M = v.startX - p.startX, w = v.startY - p.startY, C = u - c, _ = m - h, T = n.copyType === Nt.CUT, { _sheetDrawingService: D } = this;
1046
+ return s.forEach((A) => {
1047
+ const { transform: b, sheetTransform: R } = A;
1048
+ if (!b)
1054
1049
  return;
1055
- const M = {
1056
- ...N,
1057
- unitId: s,
1058
- subUnitId: o,
1059
- drawingId: w ? N.drawingId : _e.generateRandomId(),
1050
+ const P = {
1051
+ ...A,
1052
+ unitId: o,
1053
+ subUnitId: a,
1054
+ drawingId: T ? A.drawingId : ve.generateRandomId(),
1060
1055
  transform: {
1061
- ...A,
1062
- left: A.left + S,
1063
- top: A.top + R
1056
+ ...b,
1057
+ left: b.left + M,
1058
+ top: b.top + w
1064
1059
  },
1065
1060
  sheetTransform: {
1066
- to: { ...D.to, row: D.to.row + _, column: D.to.column + C },
1067
- from: { ...D.from, row: D.from.row + _, column: D.from.column + C }
1061
+ to: { ...R.to, row: R.to.row + C, column: R.to.column + _ },
1062
+ from: { ...R.from, row: R.from.row + C, column: R.from.column + _ }
1068
1063
  }
1069
1064
  };
1070
- if (w) {
1071
- const { undo: P, redo: x, objects: ee } = E.getBatchUpdateOp([M]);
1072
- v.push({
1065
+ if (T) {
1066
+ const { undo: x, redo: se, objects: oe } = D.getBatchUpdateOp([P]);
1067
+ I.push({
1073
1068
  id: O.id,
1074
1069
  params: {
1075
- unitId: s,
1076
- subUnitId: o,
1077
- type: T.UPDATE,
1078
- op: x,
1079
- objects: ee
1070
+ unitId: o,
1071
+ subUnitId: a,
1072
+ type: E.UPDATE,
1073
+ op: se,
1074
+ objects: oe
1080
1075
  }
1081
- }), I.push({
1076
+ }), S.push({
1082
1077
  id: O.id,
1083
1078
  params: {
1084
- unitId: s,
1085
- subUnitId: o,
1086
- type: T.UPDATE,
1087
- op: P,
1088
- objects: ee
1079
+ unitId: o,
1080
+ subUnitId: a,
1081
+ type: E.UPDATE,
1082
+ op: x,
1083
+ objects: oe
1089
1084
  }
1090
1085
  });
1091
1086
  } else {
1092
- const { undo: P, redo: x, objects: ee } = E.getBatchAddOp([M]);
1093
- v.push({ id: O.id, params: { op: x, unitId: s, subUnitId: o, objects: ee, type: T.INSERT } }), I.push({ id: O.id, params: { op: P, unitId: s, subUnitId: o, objects: ee, type: T.REMOVE } });
1087
+ const { undo: x, redo: se, objects: oe } = D.getBatchAddOp([P]);
1088
+ I.push({ id: O.id, params: { op: se, unitId: o, subUnitId: a, objects: oe, type: E.INSERT } }), S.push({ id: O.id, params: { op: x, unitId: o, subUnitId: a, objects: oe, type: E.REMOVE } });
1094
1089
  }
1095
1090
  }), {
1096
- redos: v,
1097
- undos: I
1091
+ redos: I,
1092
+ undos: S
1098
1093
  };
1099
1094
  }
1100
1095
  };
1101
- Ve = Hi([
1102
- at(0, Ur),
1103
- at(1, X),
1104
- at(2, z)
1105
- ], Ve);
1106
- var Yi = Object.defineProperty, Xi = Object.getOwnPropertyDescriptor, zi = (i, e, n, t) => {
1107
- for (var r = t > 1 ? void 0 : t ? Xi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1096
+ ke = Yi([
1097
+ dt(0, Ar),
1098
+ dt(1, X),
1099
+ dt(2, z)
1100
+ ], ke);
1101
+ var Xi = Object.defineProperty, zi = Object.getOwnPropertyDescriptor, Ki = (i, e, n, t) => {
1102
+ for (var r = t > 1 ? void 0 : t ? zi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1108
1103
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1109
- return t && r && Yi(e, n, r), r;
1104
+ return t && r && Xi(e, n, r), r;
1110
1105
  }, we = (i, e) => (n, t) => e(n, t, i);
1111
- let ke = class extends Z {
1106
+ let He = class extends q {
1112
1107
  constructor(i, e, n, t, r) {
1113
1108
  super(), this._drawingManagerService = i, this._renderManagerService = e, this._permissionService = n, this._univerInstanceService = t, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
1114
1109
  }
1115
1110
  _initDrawingVisible() {
1116
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
1111
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET);
1117
1112
  this.disposeWithMe(
1118
1113
  Te([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1119
1114
  if (!e) {
@@ -1126,15 +1121,15 @@ let ke = class extends Z {
1126
1121
  return;
1127
1122
  }
1128
1123
  const r = e.getUnitId(), s = t.getSheetId();
1129
- if (this._permissionService.composePermission([new jt(r).id, new it(r, s).id]).every((d) => d.value))
1124
+ if (this._permissionService.composePermission([new xt(r).id, new ot(r, s).id]).every((a) => a.value))
1130
1125
  this._drawingManagerService.setDrawingVisible(!0);
1131
1126
  else {
1132
1127
  this._drawingManagerService.setDrawingVisible(!1);
1133
- const d = e.getUnitId(), l = t.getSheetId(), g = this._drawingManagerService.getDrawingData(d, l), c = Object.values(g), a = this._renderManagerService.getRenderById(d), h = a == null ? void 0 : a.scene;
1128
+ const a = e.getUnitId(), l = t.getSheetId(), g = this._drawingManagerService.getDrawingData(a, l), d = Object.values(g), c = this._renderManagerService.getRenderById(a), h = c == null ? void 0 : c.scene;
1134
1129
  if (h == null)
1135
1130
  return;
1136
1131
  h.getAllObjectsByOrder().forEach((m) => {
1137
- m.classType === ue.IMAGE && c.some((f) => m.oKey.includes(f.drawingId)) && h.removeObject(m);
1132
+ m.classType === he.IMAGE && d.some((f) => m.oKey.includes(f.drawingId)) && h.removeObject(m);
1138
1133
  });
1139
1134
  }
1140
1135
  });
@@ -1142,7 +1137,7 @@ let ke = class extends Z {
1142
1137
  );
1143
1138
  }
1144
1139
  _initDrawingEditable() {
1145
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
1140
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET);
1146
1141
  this.disposeWithMe(
1147
1142
  Te([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1148
1143
  if (!e) {
@@ -1155,15 +1150,15 @@ let ke = class extends Z {
1155
1150
  return;
1156
1151
  }
1157
1152
  const r = e.getUnitId(), s = t.getSheetId();
1158
- if (this._permissionService.composePermission([new lt(r).id, new xe(r, s).id]).every((d) => d.value))
1153
+ if (this._permissionService.composePermission([new ht(r).id, new $e(r, s).id]).every((a) => a.value))
1159
1154
  this._drawingManagerService.setDrawingEditable(!0);
1160
1155
  else {
1161
1156
  this._drawingManagerService.setDrawingEditable(!1);
1162
- const d = e.getUnitId(), l = t.getSheetId(), g = this._drawingManagerService.getDrawingData(d, l), c = Object.values(g), a = this._renderManagerService.getRenderById(d), h = a == null ? void 0 : a.scene;
1157
+ const a = e.getUnitId(), l = t.getSheetId(), g = this._drawingManagerService.getDrawingData(a, l), d = Object.values(g), c = this._renderManagerService.getRenderById(a), h = c == null ? void 0 : c.scene;
1163
1158
  if (h == null)
1164
1159
  return;
1165
1160
  h.getAllObjectsByOrder().forEach((m) => {
1166
- m.classType === ue.IMAGE && c.some((f) => m.oKey.includes(f.drawingId)) && h.detachTransformerFrom(m);
1161
+ m.classType === he.IMAGE && d.some((f) => m.oKey.includes(f.drawingId)) && h.detachTransformerFrom(m);
1167
1162
  });
1168
1163
  }
1169
1164
  });
@@ -1171,33 +1166,33 @@ let ke = class extends Z {
1171
1166
  );
1172
1167
  }
1173
1168
  _initViewPermissionChange() {
1174
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
1169
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET);
1175
1170
  this.disposeWithMe(
1176
1171
  Te([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1177
1172
  e && e.activeSheet$.subscribe((t) => {
1178
- var a;
1173
+ var c;
1179
1174
  if (!t)
1180
1175
  return;
1181
1176
  const r = e.getUnitId(), s = t.getSheetId();
1182
1177
  let o = !0;
1183
- const d = this._renderManagerService.getRenderById(r), l = d == null ? void 0 : d.scene;
1178
+ const a = this._renderManagerService.getRenderById(r), l = a == null ? void 0 : a.scene;
1184
1179
  if (l == null)
1185
1180
  return;
1186
- const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new jt(r).id, new it(r, s).id]).pipe($e((h) => h.every((u) => u.value)));
1187
- c == null || c.pipe(
1181
+ const g = l.getTransformerByCreate(), d = this._permissionService.composePermission$([new xt(r).id, new ot(r, s).id]).pipe(Be((h) => h.every((u) => u.value)));
1182
+ d == null || d.pipe(
1188
1183
  ie((h) => h !== o),
1189
- Ee()
1184
+ Pe()
1190
1185
  ).subscribe({
1191
1186
  next: (h) => {
1192
1187
  o = h, this._drawingManagerService.setDrawingVisible(h);
1193
1188
  const u = l.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), f = Object.values(m);
1194
1189
  h ? this._drawingManagerService.addNotification(f) : (u.forEach((p) => {
1195
- p.classType === ue.IMAGE && f.some((v) => p.oKey.includes(v.drawingId)) && l.removeObject(p);
1190
+ p.classType === he.IMAGE && f.some((v) => p.oKey.includes(v.drawingId)) && l.removeObject(p);
1196
1191
  }), g.clearSelectedObjects());
1197
1192
  }
1198
- }), (a = this._permissionService.getPermissionPoint$(new it(r, s).id)) == null || a.pipe(
1193
+ }), (c = this._permissionService.getPermissionPoint$(new ot(r, s).id)) == null || c.pipe(
1199
1194
  ie((h) => h.value !== o),
1200
- Ee()
1195
+ Pe()
1201
1196
  ).subscribe({
1202
1197
  complete: () => {
1203
1198
  o = !0, this._drawingManagerService.setDrawingVisible(!0);
@@ -1210,35 +1205,35 @@ let ke = class extends Z {
1210
1205
  );
1211
1206
  }
1212
1207
  _initEditPermissionChange() {
1213
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
1208
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET);
1214
1209
  this.disposeWithMe(
1215
1210
  Te([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1216
1211
  e && e.activeSheet$.subscribe((t) => {
1217
- var a;
1212
+ var c;
1218
1213
  if (!t)
1219
1214
  return;
1220
1215
  const r = e.getUnitId(), s = t.getSheetId();
1221
1216
  let o = !0;
1222
- const d = this._renderManagerService.getRenderById(r), l = d == null ? void 0 : d.scene;
1217
+ const a = this._renderManagerService.getRenderById(r), l = a == null ? void 0 : a.scene;
1223
1218
  if (l == null)
1224
1219
  return;
1225
- const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new lt(r).id, new xe(r, s).id]).pipe($e((h) => h.every((u) => u.value)));
1226
- c == null || c.pipe(
1220
+ const g = l.getTransformerByCreate(), d = this._permissionService.composePermission$([new ht(r).id, new $e(r, s).id]).pipe(Be((h) => h.every((u) => u.value)));
1221
+ d == null || d.pipe(
1227
1222
  ie((h) => h !== o),
1228
- Ee()
1223
+ Pe()
1229
1224
  ).subscribe({
1230
1225
  next: (h) => {
1231
1226
  o = h, this._drawingManagerService.setDrawingEditable(h);
1232
1227
  const u = l.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), f = Object.values(m);
1233
1228
  h ? (u.forEach((p) => {
1234
- p.classType === ue.IMAGE && f.some((v) => p.oKey.includes(v.drawingId)) && l.attachTransformerTo(p);
1229
+ p.classType === he.IMAGE && f.some((v) => p.oKey.includes(v.drawingId)) && l.attachTransformerTo(p);
1235
1230
  }), this._drawingManagerService.addNotification(f)) : (u.forEach((p) => {
1236
- p.classType === ue.IMAGE && f.some((v) => p.oKey.includes(v.drawingId)) && l.detachTransformerFrom(p);
1231
+ p.classType === he.IMAGE && f.some((v) => p.oKey.includes(v.drawingId)) && l.detachTransformerFrom(p);
1237
1232
  }), g.clearSelectedObjects());
1238
1233
  }
1239
- }), (a = this._permissionService.getPermissionPoint$(new xe(r, s).id)) == null || a.pipe(
1234
+ }), (c = this._permissionService.getPermissionPoint$(new $e(r, s).id)) == null || c.pipe(
1240
1235
  ie((h) => h.value !== o),
1241
- Ee()
1236
+ Pe()
1242
1237
  ).subscribe({
1243
1238
  complete: () => {
1244
1239
  o = !0;
@@ -1246,7 +1241,7 @@ let ke = class extends Z {
1246
1241
  if (v == null)
1247
1242
  return;
1248
1243
  this._drawingManagerService.setDrawingEditable(!0), v.getAllObjectsByOrder().forEach((S) => {
1249
- S.classType === ue.IMAGE && f.some((R) => S.oKey.includes(R.drawingId)) && v.detachTransformerFrom(S);
1244
+ S.classType === he.IMAGE && f.some((M) => S.oKey.includes(M.drawingId)) && v.detachTransformerFrom(S);
1250
1245
  });
1251
1246
  }
1252
1247
  });
@@ -1255,19 +1250,19 @@ let ke = class extends Z {
1255
1250
  );
1256
1251
  }
1257
1252
  };
1258
- ke = zi([
1259
- we(0, q),
1253
+ He = Ki([
1254
+ we(0, Q),
1260
1255
  we(1, X),
1261
- we(2, qn),
1262
- we(3, fe),
1263
- we(4, U(Jn))
1264
- ], ke);
1265
- var Ki = Object.defineProperty, Ji = Object.getOwnPropertyDescriptor, qi = (i, e, n, t) => {
1266
- for (var r = t > 1 ? void 0 : t ? Ji(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1256
+ we(2, Zn),
1257
+ we(3, pe),
1258
+ we(4, U(qn))
1259
+ ], He);
1260
+ var Ji = Object.defineProperty, qi = Object.getOwnPropertyDescriptor, Zi = (i, e, n, t) => {
1261
+ for (var r = t > 1 ? void 0 : t ? qi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1267
1262
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1268
- return t && r && Ki(e, n, r), r;
1269
- }, Ne = (i, e) => (n, t) => e(n, t, i);
1270
- let He = class extends Z {
1263
+ return t && r && Ji(e, n, r), r;
1264
+ }, je = (i, e) => (n, t) => e(n, t, i);
1265
+ let Ye = class extends q {
1271
1266
  constructor(i, e, n, t) {
1272
1267
  super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = e, this._drawingManagerService = n, this._renderManagerService = t, this._initPrinting();
1273
1268
  }
@@ -1277,9 +1272,9 @@ let He = class extends Z {
1277
1272
  this._sheetPrintInterceptorService.interceptor.getInterceptPoints().PRINTING_COMPONENT_COLLECT,
1278
1273
  {
1279
1274
  handler: (i, e, n) => {
1280
- const { unitId: t, scene: r, subUnitId: s } = e, o = this._drawingManagerService.getDrawingDataForUnit(t), d = o == null ? void 0 : o[s];
1281
- return d && d.order.forEach((l) => {
1282
- this._drawingRenderService.renderDrawing(d.data[l], r);
1275
+ const { unitId: t, scene: r, subUnitId: s } = e, o = this._drawingManagerService.getDrawingDataForUnit(t), a = o == null ? void 0 : o[s];
1276
+ return a && a.order.forEach((l) => {
1277
+ this._drawingRenderService.renderDrawing(a.data[l], r);
1283
1278
  }), n();
1284
1279
  }
1285
1280
  }
@@ -1292,123 +1287,123 @@ let He = class extends Z {
1292
1287
  const { unitId: t, subUnitId: r } = e, s = this._renderManagerService.getRenderById(t);
1293
1288
  if (!s)
1294
1289
  return n(i);
1295
- const o = s.with(Q).getWorksheetSkeleton(r);
1290
+ const o = s.with(Z).getWorksheetSkeleton(r);
1296
1291
  if (!o)
1297
1292
  return n(i);
1298
- const d = this._drawingManagerService.getDrawingDataForUnit(t), l = d == null ? void 0 : d[e.subUnitId];
1293
+ const a = this._drawingManagerService.getDrawingDataForUnit(t), l = a == null ? void 0 : a[e.subUnitId];
1299
1294
  if (!l)
1300
1295
  return n(i);
1301
- const { scaleX: g, scaleY: c } = s.scene, a = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, h = l.order.map((u) => l.data[u]).filter((u) => u.drawingType !== k.DRAWING_DOM);
1296
+ const { scaleX: g, scaleY: d } = s.scene, c = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, h = l.order.map((u) => l.data[u]).filter((u) => u.drawingType !== k.DRAWING_DOM);
1302
1297
  return h.length ? (h.forEach((u) => {
1303
- if (!u.groupId && u.transform && _e.isDefine(u.transform.left) && _e.isDefine(u.transform.top) && _e.isDefine(u.transform.width) && _e.isDefine(u.transform.height)) {
1304
- const m = o.skeleton.getCellIndexByOffset(u.transform.left, u.transform.top, g, c, { x: 0, y: 0 }), f = o.skeleton.getCellIndexByOffset(u.transform.left + u.transform.width, u.transform.top + u.transform.height, g, c, { x: 0, y: 0 });
1305
- m.column < a.startColumn && (a.startColumn = m.column), m.row < a.startRow && (a.startRow = m.row), a.endRow < f.row && (a.endRow = f.row), a.endColumn < f.column && (a.endColumn = f.column);
1298
+ if (!u.groupId && u.transform && ve.isDefine(u.transform.left) && ve.isDefine(u.transform.top) && ve.isDefine(u.transform.width) && ve.isDefine(u.transform.height)) {
1299
+ const m = o.skeleton.getCellIndexByOffset(u.transform.left, u.transform.top, g, d, { x: 0, y: 0 }), f = o.skeleton.getCellIndexByOffset(u.transform.left + u.transform.width, u.transform.top + u.transform.height, g, d, { x: 0, y: 0 });
1300
+ m.column < c.startColumn && (c.startColumn = m.column), m.row < c.startRow && (c.startRow = m.row), c.endRow < f.row && (c.endRow = f.row), c.endColumn < f.column && (c.endColumn = f.column);
1306
1301
  }
1307
- }), n(a)) : n(i);
1302
+ }), n(c)) : n(i);
1308
1303
  }
1309
1304
  }
1310
1305
  )
1311
1306
  );
1312
1307
  }
1313
1308
  };
1314
- He = qi([
1315
- Ne(0, U(Ar)),
1316
- Ne(1, U(Vt)),
1317
- Ne(2, q),
1318
- Ne(3, X)
1319
- ], He);
1320
- var Zi = Object.defineProperty, Qi = Object.getOwnPropertyDescriptor, es = (i, e, n, t) => {
1321
- for (var r = t > 1 ? void 0 : t ? Qi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1309
+ Ye = Zi([
1310
+ je(0, U(Nr)),
1311
+ je(1, U(Ht)),
1312
+ je(2, Q),
1313
+ je(3, X)
1314
+ ], Ye);
1315
+ var Qi = Object.defineProperty, es = Object.getOwnPropertyDescriptor, ts = (i, e, n, t) => {
1316
+ for (var r = t > 1 ? void 0 : t ? es(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1322
1317
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1323
- return t && r && Zi(e, n, r), r;
1318
+ return t && r && Qi(e, n, r), r;
1324
1319
  }, te = (i, e) => (n, t) => e(n, t, i);
1325
- const ts = [
1326
- Jt.id,
1327
- qt.id,
1320
+ const ns = [
1328
1321
  Zt.id,
1329
1322
  Qt.id,
1330
1323
  en.id,
1331
1324
  tn.id,
1332
1325
  nn.id,
1333
1326
  rn.id,
1334
- ut.id,
1335
- ht.id,
1336
1327
  sn.id,
1337
1328
  on.id,
1329
+ gt.id,
1330
+ mt.id,
1338
1331
  an.id,
1339
1332
  cn.id,
1340
1333
  dn.id,
1341
1334
  ln.id,
1342
1335
  un.id,
1343
1336
  hn.id,
1344
- gn.id
1345
- ], ns = [
1346
- ni.id,
1337
+ gn.id,
1338
+ mn.id,
1339
+ fn.id
1340
+ ], rs = [
1347
1341
  ri.id,
1348
1342
  ii.id,
1349
1343
  si.id,
1350
- zt.id,
1351
- Kt.id
1344
+ oi.id,
1345
+ Jt.id,
1346
+ qt.id
1352
1347
  ];
1353
- let pt = class extends Z {
1354
- constructor(i, e, n, t, r, s, o, d, l) {
1355
- super(), this._context = i, this._renderManagerService = e, this._commandService = n, this._selectionRenderService = t, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = d, this._univerInstanceService = l, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
1348
+ let wt = class extends q {
1349
+ constructor(i, e, n, t, r, s, o, a, l) {
1350
+ super(), this._context = i, this._renderManagerService = e, this._commandService = n, this._selectionRenderService = t, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = a, this._univerInstanceService = l, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
1356
1351
  }
1357
1352
  _sheetInterceptorListener() {
1358
1353
  this.disposeWithMe(
1359
1354
  this._sheetInterceptorService.interceptCommand({
1360
1355
  getMutations: (i) => {
1361
- if (!ts.includes(i.id))
1356
+ if (!ns.includes(i.id))
1362
1357
  return { redos: [], undos: [] };
1363
1358
  if (i.params == null)
1364
1359
  return { redos: [], undos: [] };
1365
1360
  const e = i.id;
1366
- if (e === Jt.id)
1361
+ if (e === Zt.id)
1367
1362
  return this._moveRowInterceptor(i.params, "insert");
1368
- if ([un.id, hn.id, gn.id].includes(e))
1363
+ if ([gn.id, mn.id, fn.id].includes(e))
1369
1364
  return this._moveRangeInterceptor(i.params);
1370
- if (e === qt.id)
1365
+ if (e === Qt.id)
1371
1366
  return this._moveColInterceptor(i.params, "insert");
1372
- if (e === Zt.id)
1367
+ if (e === en.id)
1373
1368
  return this._moveRowInterceptor(i.params, "remove");
1374
- if (e === Qt.id)
1369
+ if (e === tn.id)
1375
1370
  return this._moveColInterceptor(i.params, "remove");
1376
- if (e === en.id) {
1371
+ if (e === nn.id) {
1377
1372
  const { range: n } = i.params;
1378
1373
  return this._getRangeMoveUndo(
1379
1374
  n,
1380
1375
  0
1381
1376
  /* deleteLeft */
1382
1377
  );
1383
- } else if (e === tn.id) {
1378
+ } else if (e === rn.id) {
1384
1379
  const { range: n } = i.params;
1385
1380
  return this._getRangeMoveUndo(
1386
1381
  n,
1387
1382
  1
1388
1383
  /* deleteUp */
1389
1384
  );
1390
- } else if (e === nn.id) {
1385
+ } else if (e === sn.id) {
1391
1386
  const { range: n } = i.params;
1392
1387
  return this._getRangeMoveUndo(
1393
1388
  n,
1394
1389
  2
1395
1390
  /* insertDown */
1396
1391
  );
1397
- } else if (e === rn.id) {
1392
+ } else if (e === on.id) {
1398
1393
  const { range: n } = i.params;
1399
1394
  return this._getRangeMoveUndo(
1400
1395
  n,
1401
1396
  3
1402
1397
  /* insertRight */
1403
1398
  );
1404
- } else if (e === an.id || e === cn.id) {
1399
+ } else if (e === dn.id || e === ln.id) {
1405
1400
  const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
1406
1401
  return this._getDrawingUndoForRowVisible(t, r, s);
1407
- } else if (e === dn.id || e === ln.id) {
1402
+ } else if (e === un.id || e === hn.id) {
1408
1403
  const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
1409
1404
  return this._getDrawingUndoForColVisible(t, r, s);
1410
- } else if (e === ut.id || e === ht.id || e === sn.id || e === on.id) {
1411
- const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e === ut.id || e === ht.id;
1405
+ } else if (e === gt.id || e === mt.id || e === an.id || e === cn.id) {
1406
+ const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e === gt.id || e === mt.id;
1412
1407
  return this._getDrawingUndoForRowAndColSize(t, r, s, o);
1413
1408
  }
1414
1409
  return { redos: [], undos: [] };
@@ -1420,19 +1415,19 @@ let pt = class extends Z {
1420
1415
  const n = H(this._univerInstanceService);
1421
1416
  if (n == null)
1422
1417
  return { redos: [], undos: [] };
1423
- const t = n.unitId, r = n.subUnitId, s = [], o = [], d = this._sheetDrawingService.getDrawingData(t, r), l = [], g = [];
1424
- if (Object.keys(d).forEach((c) => {
1425
- const a = d[c], { updateDrawings: h, deleteDrawings: u } = this._getUpdateOrDeleteDrawings(i, e, a);
1418
+ const t = n.unitId, r = n.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(t, r), l = [], g = [];
1419
+ if (Object.keys(a).forEach((d) => {
1420
+ const c = a[d], { updateDrawings: h, deleteDrawings: u } = this._getUpdateOrDeleteDrawings(i, e, c);
1426
1421
  l.push(...h), g.push(...u);
1427
1422
  }), l.length === 0 && g.length === 0)
1428
1423
  return { redos: [], undos: [] };
1429
1424
  if (l.length > 0) {
1430
- const c = this._sheetDrawingService.getBatchUpdateOp(l), { undo: a, redo: h, objects: u } = c;
1431
- s.push({ id: O.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: T.UPDATE } }), o.push({ id: O.id, params: { unitId: t, subUnitId: r, op: a, objects: u, type: T.UPDATE } });
1425
+ const d = this._sheetDrawingService.getBatchUpdateOp(l), { undo: c, redo: h, objects: u } = d;
1426
+ s.push({ id: O.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: E.UPDATE } }), o.push({ id: O.id, params: { unitId: t, subUnitId: r, op: c, objects: u, type: E.UPDATE } });
1432
1427
  }
1433
1428
  if (g.length > 0) {
1434
- const c = this._sheetDrawingService.getBatchRemoveOp(g), a = c.undo, h = c.redo, u = c.objects;
1435
- s.push({ id: O.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: T.REMOVE } }), o.push({ id: O.id, params: { unitId: t, subUnitId: r, op: a, objects: u, type: T.INSERT } });
1429
+ const d = this._sheetDrawingService.getBatchRemoveOp(g), c = d.undo, h = d.redo, u = d.objects;
1430
+ s.push({ id: O.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: E.REMOVE } }), o.push({ id: O.id, params: { unitId: t, subUnitId: r, op: c, objects: u, type: E.INSERT } });
1436
1431
  }
1437
1432
  return s.push({ id: W.id, params: [t] }), o.push({ id: W.id, params: [t] }), {
1438
1433
  redos: s,
@@ -1440,38 +1435,38 @@ let pt = class extends Z {
1440
1435
  };
1441
1436
  }
1442
1437
  _getUpdateOrDeleteDrawings(i, e, n) {
1443
- const t = [], r = [], { sheetTransform: s, anchorType: o = y.Position, transform: d, unitId: l, subUnitId: g, drawingId: c } = n, { from: a, to: h } = s, { row: u, column: m } = a, { row: f, column: p } = h;
1444
- if (s == null || d == null)
1438
+ const t = [], r = [], { sheetTransform: s, anchorType: o = y.Position, transform: a, unitId: l, subUnitId: g, drawingId: d } = n, { from: c, to: h } = s, { row: u, column: m } = c, { row: f, column: p } = h;
1439
+ if (s == null || a == null)
1445
1440
  return {
1446
1441
  updateDrawings: t,
1447
1442
  deleteDrawings: r
1448
1443
  };
1449
- const { startRow: v, endRow: I, startColumn: S, endColumn: R } = i;
1450
- let _ = null, C = null;
1444
+ const { startRow: v, endRow: I, startColumn: S, endColumn: M } = i;
1445
+ let w = null, C = null;
1451
1446
  if (e === 0 && u >= v && f <= I)
1452
- if (m >= S && p <= R)
1453
- r.push({ unitId: l, subUnitId: g, drawingId: c });
1447
+ if (m >= S && p <= M)
1448
+ r.push({ unitId: l, subUnitId: g, drawingId: d });
1454
1449
  else {
1455
- const w = this._shrinkCol(s, d, S, R, o);
1456
- _ = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
1450
+ const _ = this._shrinkCol(s, a, S, M, o);
1451
+ w = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
1457
1452
  }
1458
- else if (e === 1 && m >= S && p <= R)
1453
+ else if (e === 1 && m >= S && p <= M)
1459
1454
  if (u >= v && f <= I)
1460
- r.push({ unitId: l, subUnitId: g, drawingId: c });
1455
+ r.push({ unitId: l, subUnitId: g, drawingId: d });
1461
1456
  else {
1462
- const w = this._shrinkRow(s, d, v, I, o);
1463
- _ = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
1457
+ const _ = this._shrinkRow(s, a, v, I, o);
1458
+ w = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
1464
1459
  }
1465
1460
  else if (e === 2) {
1466
- const w = this._expandRow(s, d, v, I, o);
1467
- _ = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
1461
+ const _ = this._expandRow(s, a, v, I, o);
1462
+ w = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
1468
1463
  } else if (e === 3) {
1469
- const w = this._expandCol(s, d, S, R, o);
1470
- _ = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
1464
+ const _ = this._expandCol(s, a, S, M, o);
1465
+ w = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
1471
1466
  }
1472
- if (_ != null && C != null) {
1473
- const w = B(_, this._selectionRenderService, this._skeletonManagerService);
1474
- t.push({ ...n, sheetTransform: _, transform: w });
1467
+ if (w != null && C != null) {
1468
+ const _ = L(w, this._selectionRenderService, this._skeletonManagerService);
1469
+ t.push({ ...n, sheetTransform: w, transform: _ });
1475
1470
  }
1476
1471
  return { updateDrawings: t, deleteDrawings: r };
1477
1472
  }
@@ -1485,174 +1480,174 @@ let pt = class extends Z {
1485
1480
  // eslint-disable-next-line max-lines-per-function
1486
1481
  _getDrawingUndoForColVisible(i, e, n) {
1487
1482
  const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
1488
- if (Object.keys(t).forEach((c) => {
1489
- const a = t[c], { sheetTransform: h, transform: u, anchorType: m = y.Position } = a;
1483
+ if (Object.keys(t).forEach((d) => {
1484
+ const c = t[d], { sheetTransform: h, transform: u, anchorType: m = y.Position } = c;
1490
1485
  if (m === y.None)
1491
- this._remainDrawingSize(u, r, a);
1486
+ this._remainDrawingSize(u, r, c);
1492
1487
  else {
1493
- const { from: f, to: p } = h, { row: v, column: I } = f, { row: S, column: R } = p;
1494
- for (let _ = 0; _ < n.length; _++) {
1495
- const C = n[_], { startRow: w, endRow: E, startColumn: b, endColumn: N } = C;
1496
- if (R < b)
1488
+ const { from: f, to: p } = h, { row: v, column: I } = f, { row: S, column: M } = p;
1489
+ for (let w = 0; w < n.length; w++) {
1490
+ const C = n[w], { startRow: _, endRow: T, startColumn: D, endColumn: N } = C;
1491
+ if (M < D)
1497
1492
  continue;
1498
1493
  if (m === y.Position) {
1499
- let M = null, P = null;
1500
- if (I >= b && I <= N) {
1494
+ let R = null, P = null;
1495
+ if (I >= D && I <= N) {
1501
1496
  const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: I, endColumn: N, startRow: f.row, endRow: p.row });
1502
1497
  if (x == null)
1503
1498
  return;
1504
1499
  P = { ...u, left: x.startX };
1505
1500
  }
1506
- if (P != null && (M = j(P, this._selectionRenderService), M != null && P != null)) {
1507
- r.push({ ...a, sheetTransform: M, transform: P });
1501
+ if (P != null && (R = j(P, this._selectionRenderService), R != null && P != null)) {
1502
+ r.push({ ...c, sheetTransform: R, transform: P });
1508
1503
  break;
1509
1504
  }
1510
- this._remainDrawingSize(u, r, a);
1505
+ this._remainDrawingSize(u, r, c);
1511
1506
  continue;
1512
1507
  }
1513
- if (I >= b && R <= N)
1508
+ if (I >= D && M <= N)
1514
1509
  continue;
1515
- let A = null, D = null;
1516
- if (I >= b && I <= N) {
1517
- const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn: I, endColumn: N, startRow: f.row, endRow: p.row });
1518
- if (M == null)
1510
+ let A = null, b = null;
1511
+ if (I >= D && I <= N) {
1512
+ const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: I, endColumn: N, startRow: f.row, endRow: p.row });
1513
+ if (R == null)
1519
1514
  return;
1520
- D = {
1515
+ b = {
1521
1516
  ...u,
1522
- left: (M == null ? void 0 : M.startX) || 0,
1523
- width: ((u == null ? void 0 : u.width) || 0) - M.endX + M.startX
1517
+ left: (R == null ? void 0 : R.startX) || 0,
1518
+ width: ((u == null ? void 0 : u.width) || 0) - R.endX + R.startX
1524
1519
  };
1525
- } else if (R >= b && R <= N) {
1526
- const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn: b, endColumn: R, startRow: f.row, endRow: p.row });
1527
- if (M == null)
1520
+ } else if (M >= D && M <= N) {
1521
+ const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: M, startRow: f.row, endRow: p.row });
1522
+ if (R == null)
1528
1523
  return;
1529
- D = {
1524
+ b = {
1530
1525
  ...u,
1531
- left: M.startX - ((u == null ? void 0 : u.width) || 0)
1526
+ left: R.startX - ((u == null ? void 0 : u.width) || 0)
1532
1527
  };
1533
1528
  } else {
1534
- const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn: b, endColumn: N, startRow: f.row, endRow: p.row });
1535
- if (M == null)
1529
+ const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: N, startRow: f.row, endRow: p.row });
1530
+ if (R == null)
1536
1531
  return;
1537
- if (D = {
1532
+ if (b = {
1538
1533
  ...u,
1539
- width: ((u == null ? void 0 : u.width) || 0) - M.endX + M.startX
1540
- }, A = j(D, this._selectionRenderService), A != null && D != null) {
1541
- s.push({ ...a, sheetTransform: A, transform: D });
1534
+ width: ((u == null ? void 0 : u.width) || 0) - R.endX + R.startX
1535
+ }, A = j(b, this._selectionRenderService), A != null && b != null) {
1536
+ s.push({ ...c, sheetTransform: A, transform: b });
1542
1537
  break;
1543
1538
  }
1544
1539
  }
1545
- if (D != null && (A = j(D, this._selectionRenderService)), D != null && A != null) {
1546
- r.push({ ...a, sheetTransform: A, transform: D });
1540
+ if (b != null && (A = j(b, this._selectionRenderService)), b != null && A != null) {
1541
+ r.push({ ...c, sheetTransform: A, transform: b });
1547
1542
  break;
1548
1543
  } else
1549
- this._remainDrawingSize(u, r, a);
1544
+ this._remainDrawingSize(u, r, c);
1550
1545
  }
1551
1546
  }
1552
1547
  }), r.length === 0 && s.length === 0)
1553
1548
  return { redos: [], undos: [] };
1554
- const { redos: o, undos: d } = this._createUndoAndRedoMutation(i, e, r), l = [], g = [];
1549
+ const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, e, r), l = [], g = [];
1555
1550
  if (s.length > 0) {
1556
- const { redos: c, undos: a } = this._createUndoAndRedoMutation(i, e, s);
1557
- l.push(...c), g.push(...a);
1551
+ const { redos: d, undos: c } = this._createUndoAndRedoMutation(i, e, s);
1552
+ l.push(...d), g.push(...c);
1558
1553
  }
1559
1554
  return {
1560
1555
  redos: o,
1561
- undos: d,
1556
+ undos: a,
1562
1557
  preRedos: l,
1563
1558
  preUndos: g
1564
1559
  };
1565
1560
  }
1566
1561
  _createUndoAndRedoMutation(i, e, n) {
1567
- const t = this._sheetDrawingService.getBatchUpdateOp(n), { undo: r, redo: s, objects: o } = t, d = [
1568
- { id: O.id, params: { unitId: i, subUnitId: e, op: s, objects: o, type: T.UPDATE } },
1562
+ const t = this._sheetDrawingService.getBatchUpdateOp(n), { undo: r, redo: s, objects: o } = t, a = [
1563
+ { id: O.id, params: { unitId: i, subUnitId: e, op: s, objects: o, type: E.UPDATE } },
1569
1564
  { id: W.id, params: [i] }
1570
1565
  ], l = [
1571
- { id: O.id, params: { unitId: i, subUnitId: e, op: r, objects: o, type: T.UPDATE } },
1566
+ { id: O.id, params: { unitId: i, subUnitId: e, op: r, objects: o, type: E.UPDATE } },
1572
1567
  { id: W.id, params: [i] }
1573
1568
  ];
1574
1569
  return {
1575
- redos: d,
1570
+ redos: a,
1576
1571
  undos: l
1577
1572
  };
1578
1573
  }
1579
1574
  // eslint-disable-next-line max-lines-per-function
1580
1575
  _getDrawingUndoForRowVisible(i, e, n) {
1581
1576
  const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
1582
- if (Object.keys(t).forEach((c) => {
1583
- const a = t[c], { sheetTransform: h, transform: u, anchorType: m = y.Position } = a;
1577
+ if (Object.keys(t).forEach((d) => {
1578
+ const c = t[d], { sheetTransform: h, transform: u, anchorType: m = y.Position } = c;
1584
1579
  if (m === y.None)
1585
- this._remainDrawingSize(u, r, a);
1580
+ this._remainDrawingSize(u, r, c);
1586
1581
  else {
1587
- const { from: f, to: p } = h, { row: v, column: I } = f, { row: S, column: R } = p;
1588
- for (let _ = 0; _ < n.length; _++) {
1589
- const C = n[_], { startRow: w, endRow: E, startColumn: b, endColumn: N } = C;
1590
- if (S < w)
1582
+ const { from: f, to: p } = h, { row: v, column: I } = f, { row: S, column: M } = p;
1583
+ for (let w = 0; w < n.length; w++) {
1584
+ const C = n[w], { startRow: _, endRow: T, startColumn: D, endColumn: N } = C;
1585
+ if (S < _)
1591
1586
  continue;
1592
1587
  if (m === y.Position) {
1593
- let M = null, P = null;
1594
- if (v >= w && v <= E) {
1595
- const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: v, endRow: E });
1588
+ let R = null, P = null;
1589
+ if (v >= _ && v <= T) {
1590
+ const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: v, endRow: T });
1596
1591
  if (x == null)
1597
1592
  return;
1598
1593
  P = { ...u, top: x.startY };
1599
1594
  }
1600
- if (P != null && (M = j(P, this._selectionRenderService), M != null && P != null)) {
1601
- r.push({ ...a, sheetTransform: M, transform: P });
1595
+ if (P != null && (R = j(P, this._selectionRenderService), R != null && P != null)) {
1596
+ r.push({ ...c, sheetTransform: R, transform: P });
1602
1597
  break;
1603
1598
  }
1604
- this._remainDrawingSize(u, r, a);
1599
+ this._remainDrawingSize(u, r, c);
1605
1600
  continue;
1606
1601
  }
1607
- if (v >= w && S <= E)
1602
+ if (v >= _ && S <= T)
1608
1603
  continue;
1609
- let A = null, D = null;
1610
- if (v >= w && v <= E) {
1611
- const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: v, endRow: E });
1612
- if (M == null)
1604
+ let A = null, b = null;
1605
+ if (v >= _ && v <= T) {
1606
+ const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: v, endRow: T });
1607
+ if (R == null)
1613
1608
  return;
1614
- D = {
1609
+ b = {
1615
1610
  ...u,
1616
- top: (M == null ? void 0 : M.startY) || 0,
1617
- height: ((u == null ? void 0 : u.height) || 0) - M.endY + M.startY
1611
+ top: (R == null ? void 0 : R.startY) || 0,
1612
+ height: ((u == null ? void 0 : u.height) || 0) - R.endY + R.startY
1618
1613
  };
1619
- } else if (S >= w && S <= E) {
1620
- const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: w, endRow: S });
1621
- if (M == null)
1614
+ } else if (S >= _ && S <= T) {
1615
+ const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: _, endRow: S });
1616
+ if (R == null)
1622
1617
  return;
1623
- D = {
1618
+ b = {
1624
1619
  ...u,
1625
- top: M.startY - ((u == null ? void 0 : u.height) || 0)
1620
+ top: R.startY - ((u == null ? void 0 : u.height) || 0)
1626
1621
  };
1627
1622
  } else {
1628
- const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: w, endRow: E });
1629
- if (M == null)
1623
+ const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: _, endRow: T });
1624
+ if (R == null)
1630
1625
  return;
1631
- if (D = {
1626
+ if (b = {
1632
1627
  ...u,
1633
- height: ((u == null ? void 0 : u.height) || 0) - M.endY + M.startY
1634
- }, A = j(D, this._selectionRenderService), A != null && D != null) {
1635
- s.push({ ...a, sheetTransform: A, transform: D });
1628
+ height: ((u == null ? void 0 : u.height) || 0) - R.endY + R.startY
1629
+ }, A = j(b, this._selectionRenderService), A != null && b != null) {
1630
+ s.push({ ...c, sheetTransform: A, transform: b });
1636
1631
  break;
1637
1632
  }
1638
1633
  }
1639
- if (D != null && (A = j(D, this._selectionRenderService)), D != null && A != null) {
1640
- r.push({ ...a, sheetTransform: A, transform: D });
1634
+ if (b != null && (A = j(b, this._selectionRenderService)), b != null && A != null) {
1635
+ r.push({ ...c, sheetTransform: A, transform: b });
1641
1636
  break;
1642
1637
  } else
1643
- this._remainDrawingSize(u, r, a);
1638
+ this._remainDrawingSize(u, r, c);
1644
1639
  }
1645
1640
  }
1646
1641
  }), r.length === 0 && s.length === 0)
1647
1642
  return { redos: [], undos: [] };
1648
- const { redos: o, undos: d } = this._createUndoAndRedoMutation(i, e, r), l = [], g = [];
1643
+ const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, e, r), l = [], g = [];
1649
1644
  if (s.length > 0) {
1650
- const { redos: c, undos: a } = this._createUndoAndRedoMutation(i, e, s);
1651
- l.push(...c), g.push(...a);
1645
+ const { redos: d, undos: c } = this._createUndoAndRedoMutation(i, e, s);
1646
+ l.push(...d), g.push(...c);
1652
1647
  }
1653
1648
  return {
1654
1649
  redos: o,
1655
- undos: d,
1650
+ undos: a,
1656
1651
  preRedos: l,
1657
1652
  preUndos: g
1658
1653
  };
@@ -1660,28 +1655,28 @@ let pt = class extends Z {
1660
1655
  _getDrawingUndoForRowAndColSize(i, e, n, t) {
1661
1656
  const r = this._drawingManagerService.getDrawingData(i, e), s = [];
1662
1657
  return Object.keys(r).forEach((o) => {
1663
- const d = r[o], { sheetTransform: l, transform: g, anchorType: c = y.Position } = d;
1664
- if (c === y.None)
1665
- this._remainDrawingSize(g, s, d);
1658
+ const a = r[o], { sheetTransform: l, transform: g, anchorType: d = y.Position } = a;
1659
+ if (d === y.None)
1660
+ this._remainDrawingSize(g, s, a);
1666
1661
  else {
1667
- const { from: a, to: h } = l, { row: u, column: m } = a, { row: f, column: p } = h;
1662
+ const { from: c, to: h } = l, { row: u, column: m } = c, { row: f, column: p } = h;
1668
1663
  for (let v = 0; v < n.length; v++) {
1669
- const I = n[v], { startRow: S, endRow: R, startColumn: _, endColumn: C } = I;
1670
- if (f < S || p < _)
1664
+ const I = n[v], { startRow: S, endRow: M, startColumn: w, endColumn: C } = I;
1665
+ if (f < S || p < w)
1671
1666
  continue;
1672
- if (c === y.Position && (u <= S && f >= R || m <= _ && p >= C)) {
1673
- this._remainDrawingSize(g, s, d);
1667
+ if (d === y.Position && (u <= S && f >= M || m <= w && p >= C)) {
1668
+ this._remainDrawingSize(g, s, a);
1674
1669
  continue;
1675
1670
  }
1676
- const w = B(
1671
+ const _ = L(
1677
1672
  { ...l },
1678
1673
  this._selectionRenderService,
1679
1674
  this._skeletonManagerService
1680
1675
  );
1681
- if (w != null) {
1676
+ if (_ != null) {
1682
1677
  s.push({
1683
- ...d,
1684
- transform: w
1678
+ ...a,
1679
+ transform: _
1685
1680
  });
1686
1681
  break;
1687
1682
  }
@@ -1702,48 +1697,48 @@ let pt = class extends Z {
1702
1697
  return { unitId: n, subUnitId: t };
1703
1698
  }
1704
1699
  _moveRangeInterceptor(i) {
1705
- var S, R;
1700
+ var S, M;
1706
1701
  const { toRange: e, fromRange: n } = i, t = H(this._univerInstanceService);
1707
1702
  if (!t)
1708
1703
  return { redos: [], undos: [] };
1709
- const { unitId: r, subUnitId: s } = t, o = (R = (S = this._renderManagerService.getRenderById(r)) == null ? void 0 : S.with(Q)) == null ? void 0 : R.getCurrentSkeleton();
1704
+ const { unitId: r, subUnitId: s } = t, o = (M = (S = this._renderManagerService.getRenderById(r)) == null ? void 0 : S.with(Z)) == null ? void 0 : M.getCurrentSkeleton();
1710
1705
  if (!o)
1711
1706
  return { redos: [], undos: [] };
1712
- const d = Ht(o, n);
1713
- if (!d)
1707
+ const a = Xt(o, n);
1708
+ if (!a)
1714
1709
  return { redos: [], undos: [] };
1715
- const { startX: l, endX: g, startY: c, endY: a } = d, h = this._sheetDrawingService.getDrawingData(r, s), u = [];
1716
- Object.keys(h).forEach((_) => {
1717
- const C = h[_];
1710
+ const { startX: l, endX: g, startY: d, endY: c } = a, h = this._sheetDrawingService.getDrawingData(r, s), u = [];
1711
+ Object.keys(h).forEach((w) => {
1712
+ const C = h[w];
1718
1713
  if (C.anchorType !== y.Both)
1719
1714
  return;
1720
- const { transform: w } = C;
1721
- if (!w)
1715
+ const { transform: _ } = C;
1716
+ if (!_)
1722
1717
  return;
1723
- const { left: E = 0, top: b = 0, width: N = 0, height: A = 0 } = w, { drawingStartX: D, drawingEndX: M, drawingStartY: P, drawingEndY: x } = {
1724
- drawingStartX: E,
1725
- drawingEndX: E + N,
1726
- drawingStartY: b,
1727
- drawingEndY: b + A
1718
+ const { left: T = 0, top: D = 0, width: N = 0, height: A = 0 } = _, { drawingStartX: b, drawingEndX: R, drawingStartY: P, drawingEndY: x } = {
1719
+ drawingStartX: T,
1720
+ drawingEndX: T + N,
1721
+ drawingStartY: D,
1722
+ drawingEndY: D + A
1728
1723
  };
1729
- l <= D && M <= g && c <= P && x <= a && u.push(C);
1724
+ l <= b && R <= g && d <= P && x <= c && u.push(C);
1730
1725
  });
1731
- const m = [], f = [], p = e.startRow - n.startRow, v = e.startColumn - n.startColumn, I = u.map((_) => {
1732
- const C = _.sheetTransform, w = {
1726
+ const m = [], f = [], p = e.startRow - n.startRow, v = e.startColumn - n.startColumn, I = u.map((w) => {
1727
+ const C = w.sheetTransform, _ = {
1733
1728
  to: { ...C.to, row: C.to.row + p, column: C.to.column + v },
1734
1729
  from: { ...C.from, row: C.from.row + p, column: C.from.column + v }
1735
- }, E = B(w, this._selectionRenderService, this._skeletonManagerService);
1730
+ }, T = L(_, this._selectionRenderService, this._skeletonManagerService);
1736
1731
  return {
1737
1732
  unitId: r,
1738
1733
  subUnitId: s,
1739
- drawingId: _.drawingId,
1740
- transform: E,
1741
- sheetTransform: w
1734
+ drawingId: w.drawingId,
1735
+ transform: T,
1736
+ sheetTransform: _
1742
1737
  };
1743
1738
  });
1744
1739
  if (I.length) {
1745
- const _ = this._sheetDrawingService.getBatchUpdateOp(I), { undo: C, redo: w, objects: E } = _;
1746
- m.push({ id: O.id, params: { unitId: r, subUnitId: s, op: w, objects: E, type: T.UPDATE } }), f.push({ id: O.id, params: { unitId: r, subUnitId: s, op: C, objects: E, type: T.UPDATE } });
1740
+ const w = this._sheetDrawingService.getBatchUpdateOp(I), { undo: C, redo: _, objects: T } = w;
1741
+ m.push({ id: O.id, params: { unitId: r, subUnitId: s, op: _, objects: T, type: E.UPDATE } }), f.push({ id: O.id, params: { unitId: r, subUnitId: s, op: C, objects: T, type: E.UPDATE } });
1747
1742
  }
1748
1743
  return { redos: m, undos: f };
1749
1744
  }
@@ -1751,37 +1746,37 @@ let pt = class extends Z {
1751
1746
  const n = this._getUnitIdAndSubUnitId(i, e);
1752
1747
  if (n == null)
1753
1748
  return { redos: [], undos: [] };
1754
- const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startRow, d = s.endRow, l = [], g = [], c = this._sheetDrawingService.getDrawingData(t, r), a = [], h = [];
1755
- if (Object.keys(c).forEach((u) => {
1756
- const m = c[u], { sheetTransform: f, transform: p, anchorType: v = y.Position } = m;
1749
+ const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startRow, a = s.endRow, l = [], g = [], d = this._sheetDrawingService.getDrawingData(t, r), c = [], h = [];
1750
+ if (Object.keys(d).forEach((u) => {
1751
+ const m = d[u], { sheetTransform: f, transform: p, anchorType: v = y.Position } = m;
1757
1752
  if (f == null || p == null)
1758
1753
  return;
1759
1754
  let I, S;
1760
1755
  if (e === "insert") {
1761
- const _ = this._expandRow(f, p, o, d, v);
1762
- I = _ == null ? void 0 : _.newSheetTransform, S = _ == null ? void 0 : _.newTransform;
1756
+ const w = this._expandRow(f, p, o, a, v);
1757
+ I = w == null ? void 0 : w.newSheetTransform, S = w == null ? void 0 : w.newTransform;
1763
1758
  } else {
1764
- const { from: _, to: C } = f, { row: w } = _, { row: E } = C;
1765
- if (v === y.Both && w >= o && E <= d)
1759
+ const { from: w, to: C } = f, { row: _ } = w, { row: T } = C;
1760
+ if (v === y.Both && _ >= o && T <= a)
1766
1761
  h.push({ unitId: t, subUnitId: r, drawingId: u });
1767
1762
  else {
1768
- const b = this._shrinkRow(f, p, o, d, v);
1769
- I = b == null ? void 0 : b.newSheetTransform, S = b == null ? void 0 : b.newTransform;
1763
+ const D = this._shrinkRow(f, p, o, a, v);
1764
+ I = D == null ? void 0 : D.newSheetTransform, S = D == null ? void 0 : D.newTransform;
1770
1765
  }
1771
1766
  }
1772
1767
  if (!I || !S)
1773
1768
  return;
1774
- const R = { unitId: t, subUnitId: r, drawingId: u, transform: S, sheetTransform: I };
1775
- a.push(R);
1776
- }), a.length === 0 && h.length === 0)
1769
+ const M = { unitId: t, subUnitId: r, drawingId: u, transform: S, sheetTransform: I };
1770
+ c.push(M);
1771
+ }), c.length === 0 && h.length === 0)
1777
1772
  return { redos: [], undos: [] };
1778
- if (a.length > 0) {
1779
- const u = this._sheetDrawingService.getBatchUpdateOp(a), { undo: m, redo: f, objects: p } = u;
1780
- l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: T.UPDATE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: T.UPDATE } });
1773
+ if (c.length > 0) {
1774
+ const u = this._sheetDrawingService.getBatchUpdateOp(c), { undo: m, redo: f, objects: p } = u;
1775
+ l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: E.UPDATE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: E.UPDATE } });
1781
1776
  }
1782
1777
  if (h.length > 0) {
1783
1778
  const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, f = u.redo, p = u.objects;
1784
- l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: T.REMOVE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: T.INSERT } });
1779
+ l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: E.REMOVE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: E.INSERT } });
1785
1780
  }
1786
1781
  return l.push({ id: W.id, params: [t] }), g.push({ id: W.id, params: [t] }), {
1787
1782
  redos: l,
@@ -1792,91 +1787,91 @@ let pt = class extends Z {
1792
1787
  const n = this._getUnitIdAndSubUnitId(i, e);
1793
1788
  if (n == null)
1794
1789
  return { redos: [], undos: [] };
1795
- const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startColumn, d = s.endColumn, l = [], g = [], c = this._sheetDrawingService.getDrawingData(t, r), a = [], h = [];
1796
- if (Object.keys(c).forEach((u) => {
1797
- const m = c[u], { sheetTransform: f, transform: p, anchorType: v = y.Position } = m;
1790
+ const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startColumn, a = s.endColumn, l = [], g = [], d = this._sheetDrawingService.getDrawingData(t, r), c = [], h = [];
1791
+ if (Object.keys(d).forEach((u) => {
1792
+ const m = d[u], { sheetTransform: f, transform: p, anchorType: v = y.Position } = m;
1798
1793
  if (f == null || p == null)
1799
1794
  return;
1800
1795
  let I, S;
1801
1796
  if (e === "insert") {
1802
- const _ = this._expandCol(f, p, o, d, v);
1803
- I = _ == null ? void 0 : _.newSheetTransform, S = _ == null ? void 0 : _.newTransform;
1797
+ const w = this._expandCol(f, p, o, a, v);
1798
+ I = w == null ? void 0 : w.newSheetTransform, S = w == null ? void 0 : w.newTransform;
1804
1799
  } else {
1805
- const { from: _, to: C } = f, { column: w } = _, { column: E } = C;
1806
- if (v === y.Both && w >= o && E <= d)
1800
+ const { from: w, to: C } = f, { column: _ } = w, { column: T } = C;
1801
+ if (v === y.Both && _ >= o && T <= a)
1807
1802
  h.push({ unitId: t, subUnitId: r, drawingId: u });
1808
1803
  else {
1809
- const b = this._shrinkCol(f, p, o, d, v);
1810
- I = b == null ? void 0 : b.newSheetTransform, S = b == null ? void 0 : b.newTransform;
1804
+ const D = this._shrinkCol(f, p, o, a, v);
1805
+ I = D == null ? void 0 : D.newSheetTransform, S = D == null ? void 0 : D.newTransform;
1811
1806
  }
1812
1807
  }
1813
1808
  if (!I || !S)
1814
1809
  return;
1815
- const R = { unitId: t, subUnitId: r, drawingId: u, transform: S, sheetTransform: I };
1816
- a.push(R);
1817
- }), a.length === 0 && h.length === 0)
1810
+ const M = { unitId: t, subUnitId: r, drawingId: u, transform: S, sheetTransform: I };
1811
+ c.push(M);
1812
+ }), c.length === 0 && h.length === 0)
1818
1813
  return { redos: [], undos: [] };
1819
- if (a.length > 0) {
1820
- const u = this._sheetDrawingService.getBatchUpdateOp(a), { undo: m, redo: f, objects: p } = u;
1821
- l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: T.UPDATE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: T.UPDATE } });
1814
+ if (c.length > 0) {
1815
+ const u = this._sheetDrawingService.getBatchUpdateOp(c), { undo: m, redo: f, objects: p } = u;
1816
+ l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: E.UPDATE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: E.UPDATE } });
1822
1817
  }
1823
1818
  if (h.length > 0) {
1824
1819
  const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, f = u.redo, p = u.objects;
1825
- l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: T.REMOVE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: T.INSERT } });
1820
+ l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: E.REMOVE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: E.INSERT } });
1826
1821
  }
1827
1822
  return l.push({ id: W.id, params: [t] }), g.push({ id: W.id, params: [t] }), { redos: l, undos: g };
1828
1823
  }
1829
1824
  _expandCol(i, e, n, t, r = y.Position) {
1830
- const s = t - n + 1, { from: o, to: d } = i, { column: l } = o, { column: g } = d;
1825
+ const s = t - n + 1, { from: o, to: a } = i, { column: l } = o, { column: g } = a;
1831
1826
  if (r === y.None)
1832
1827
  return {
1833
1828
  newSheetTransform: j({ ...e }, this._selectionRenderService),
1834
1829
  newTransform: e
1835
1830
  };
1836
- let c = null, a = null;
1831
+ let d = null, c = null;
1837
1832
  if (l >= n) {
1838
- const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: t, startRow: o.row, endRow: d.row });
1833
+ const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: t, startRow: o.row, endRow: a.row });
1839
1834
  if (h == null)
1840
1835
  return;
1841
- a = { ...e, left: (e.left || 0) + h.endX - h.startX }, c = j(a, this._selectionRenderService);
1836
+ c = { ...e, left: (e.left || 0) + h.endX - h.startX }, d = j(c, this._selectionRenderService);
1842
1837
  } else if (g >= t)
1843
1838
  if (r === y.Both)
1844
- c = {
1839
+ d = {
1845
1840
  from: { ...o },
1846
- to: { ...d, column: g + s }
1847
- }, a = B(c, this._selectionRenderService, this._skeletonManagerService);
1841
+ to: { ...a, column: g + s }
1842
+ }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1848
1843
  else
1849
1844
  return {
1850
1845
  newSheetTransform: j({ ...e }, this._selectionRenderService),
1851
1846
  newTransform: e
1852
1847
  };
1853
- return c != null && a != null ? {
1854
- newSheetTransform: c,
1855
- newTransform: a
1848
+ return d != null && c != null ? {
1849
+ newSheetTransform: d,
1850
+ newTransform: c
1856
1851
  } : null;
1857
1852
  }
1858
1853
  _shrinkCol(i, e, n, t, r = y.Position) {
1859
- const s = t - n + 1, { from: o, to: d } = i, { column: l } = o, { column: g } = d;
1854
+ const s = t - n + 1, { from: o, to: a } = i, { column: l } = o, { column: g } = a;
1860
1855
  if (r === y.None)
1861
1856
  return {
1862
1857
  newSheetTransform: j({ ...e }, this._selectionRenderService),
1863
1858
  newTransform: e
1864
1859
  };
1865
- let c = null, a = null;
1860
+ let d = null, c = null;
1866
1861
  if (l > t)
1867
- c = {
1862
+ d = {
1868
1863
  from: { ...o, column: l - s },
1869
- to: { ...d, column: g - s }
1870
- }, a = B(c, this._selectionRenderService, this._skeletonManagerService);
1864
+ to: { ...a, column: g - s }
1865
+ }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1871
1866
  else {
1872
1867
  if (l >= n && g <= t)
1873
1868
  return null;
1874
1869
  if (l < n && g > t)
1875
1870
  if (r === y.Both)
1876
- c = {
1871
+ d = {
1877
1872
  from: { ...o },
1878
- to: { ...d, column: g - s }
1879
- }, a = B(c, this._selectionRenderService, this._skeletonManagerService);
1873
+ to: { ...a, column: g - s }
1874
+ }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1880
1875
  else
1881
1876
  return {
1882
1877
  newSheetTransform: j({ ...e }, this._selectionRenderService),
@@ -1884,88 +1879,88 @@ let pt = class extends Z {
1884
1879
  };
1885
1880
  else if (l >= n && l <= t) {
1886
1881
  if (l === n)
1887
- a = { ...e, left: (e.left || 0) - i.from.columnOffset };
1882
+ c = { ...e, left: (e.left || 0) - i.from.columnOffset };
1888
1883
  else {
1889
- const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: l - 1, startRow: o.row, endRow: d.row });
1884
+ const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: l - 1, startRow: o.row, endRow: a.row });
1890
1885
  if (h == null)
1891
1886
  return;
1892
- a = { ...e, left: (e.left || 0) - h.endX + h.startX - i.from.columnOffset };
1887
+ c = { ...e, left: (e.left || 0) - h.endX + h.startX - i.from.columnOffset };
1893
1888
  }
1894
- c = j(a, this._selectionRenderService);
1889
+ d = j(c, this._selectionRenderService);
1895
1890
  } else if (g >= n && g <= t && r === y.Both) {
1896
1891
  const h = this._skeletonManagerService.attachRangeWithCoord({
1897
1892
  startColumn: n - 1,
1898
1893
  endColumn: n - 1,
1899
1894
  startRow: o.row,
1900
- endRow: d.row
1895
+ endRow: a.row
1901
1896
  });
1902
1897
  if (h == null)
1903
1898
  return;
1904
- c = {
1899
+ d = {
1905
1900
  from: { ...o },
1906
- to: { ...d, column: n - 1, columnOffset: h.endX - h.startX }
1907
- }, a = B(c, this._selectionRenderService, this._skeletonManagerService);
1901
+ to: { ...a, column: n - 1, columnOffset: h.endX - h.startX }
1902
+ }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1908
1903
  }
1909
1904
  }
1910
- return c != null && a != null ? {
1911
- newSheetTransform: c,
1912
- newTransform: a
1905
+ return d != null && c != null ? {
1906
+ newSheetTransform: d,
1907
+ newTransform: c
1913
1908
  } : null;
1914
1909
  }
1915
1910
  _expandRow(i, e, n, t, r = y.Position) {
1916
- const s = t - n + 1, { from: o, to: d } = i, { row: l } = o, { row: g } = d;
1911
+ const s = t - n + 1, { from: o, to: a } = i, { row: l } = o, { row: g } = a;
1917
1912
  if (r === y.None)
1918
1913
  return {
1919
1914
  newSheetTransform: j({ ...e }, this._selectionRenderService),
1920
1915
  newTransform: e
1921
1916
  };
1922
- let c = null, a = null;
1917
+ let d = null, c = null;
1923
1918
  if (l >= n) {
1924
- const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: t, startColumn: o.column, endColumn: d.column });
1919
+ const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: t, startColumn: o.column, endColumn: a.column });
1925
1920
  if (h == null)
1926
1921
  return;
1927
- a = { ...e, top: (e.top || 0) + h.endY - h.startY }, c = j(a, this._selectionRenderService);
1922
+ c = { ...e, top: (e.top || 0) + h.endY - h.startY }, d = j(c, this._selectionRenderService);
1928
1923
  } else if (g >= t)
1929
1924
  if (r === y.Both)
1930
- c = {
1925
+ d = {
1931
1926
  from: { ...o },
1932
1927
  to: {
1933
- ...d,
1928
+ ...a,
1934
1929
  row: g + s
1935
1930
  }
1936
- }, a = B(c, this._selectionRenderService, this._skeletonManagerService);
1931
+ }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1937
1932
  else
1938
1933
  return {
1939
1934
  newSheetTransform: j({ ...e }, this._selectionRenderService),
1940
1935
  newTransform: e
1941
1936
  };
1942
- return c != null && a != null ? {
1943
- newSheetTransform: c,
1944
- newTransform: a
1937
+ return d != null && c != null ? {
1938
+ newSheetTransform: d,
1939
+ newTransform: c
1945
1940
  } : null;
1946
1941
  }
1947
1942
  _shrinkRow(i, e, n, t, r = y.Position) {
1948
- const s = t - n + 1, { from: o, to: d } = i, { row: l } = o, { row: g } = d;
1943
+ const s = t - n + 1, { from: o, to: a } = i, { row: l } = o, { row: g } = a;
1949
1944
  if (r === y.None)
1950
1945
  return {
1951
1946
  newSheetTransform: j({ ...e }, this._selectionRenderService),
1952
1947
  newTransform: e
1953
1948
  };
1954
- let c = null, a = null;
1949
+ let d = null, c = null;
1955
1950
  if (l > t)
1956
- c = {
1951
+ d = {
1957
1952
  from: { ...o, row: l - s },
1958
- to: { ...d, row: g - s }
1959
- }, a = B(c, this._selectionRenderService, this._skeletonManagerService);
1953
+ to: { ...a, row: g - s }
1954
+ }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1960
1955
  else {
1961
1956
  if (l >= n && g <= t)
1962
1957
  return null;
1963
1958
  if (l < n && g > t)
1964
1959
  if (r === y.Both)
1965
- c = {
1960
+ d = {
1966
1961
  from: { ...o },
1967
- to: { ...d, row: g - s }
1968
- }, a = B(c, this._selectionRenderService, this._skeletonManagerService);
1962
+ to: { ...a, row: g - s }
1963
+ }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1969
1964
  else
1970
1965
  return {
1971
1966
  newSheetTransform: j({ ...e }, this._selectionRenderService),
@@ -1973,44 +1968,44 @@ let pt = class extends Z {
1973
1968
  };
1974
1969
  else if (l >= n && l <= t) {
1975
1970
  if (l === n)
1976
- a = { ...e, top: (e.top || 0) - i.from.rowOffset };
1971
+ c = { ...e, top: (e.top || 0) - i.from.rowOffset };
1977
1972
  else {
1978
- const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: l - 1, startColumn: o.column, endColumn: d.column });
1973
+ const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: l - 1, startColumn: o.column, endColumn: a.column });
1979
1974
  if (h == null)
1980
1975
  return;
1981
- a = { ...e, top: (e.top || 0) - h.endY + h.startY - i.from.rowOffset };
1976
+ c = { ...e, top: (e.top || 0) - h.endY + h.startY - i.from.rowOffset };
1982
1977
  }
1983
- c = j(a, this._selectionRenderService);
1978
+ d = j(c, this._selectionRenderService);
1984
1979
  } else if (g >= n && g <= t && r === y.Both) {
1985
1980
  const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: n - 1, endRow: n - 1 });
1986
1981
  if (h == null)
1987
1982
  return;
1988
- c = {
1983
+ d = {
1989
1984
  from: { ...o },
1990
- to: { ...d, row: n - 1, rowOffset: h.endY - h.startY }
1991
- }, a = B(c, this._selectionRenderService, this._skeletonManagerService);
1985
+ to: { ...a, row: n - 1, rowOffset: h.endY - h.startY }
1986
+ }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1992
1987
  }
1993
1988
  }
1994
- return c != null && a != null ? {
1995
- newSheetTransform: c,
1996
- newTransform: a
1989
+ return d != null && c != null ? {
1990
+ newSheetTransform: d,
1991
+ newTransform: c
1997
1992
  } : null;
1998
1993
  }
1999
1994
  _commandListener() {
2000
1995
  this.disposeWithMe(
2001
1996
  this._commandService.onCommandExecuted((i) => {
2002
- i.id === oi.id && setTimeout(() => {
1997
+ i.id === ai.id && setTimeout(() => {
2003
1998
  const e = i.params, { unitId: n, subUnitId: t } = e, r = this._drawingManagerService.drawingManagerData, s = [], o = [];
2004
- Object.keys(r).forEach((d) => {
2005
- const l = r[d];
1999
+ Object.keys(r).forEach((a) => {
2000
+ const l = r[a];
2006
2001
  l != null && Object.keys(l).forEach((g) => {
2007
- const c = l[g].data;
2008
- c != null && Object.keys(c).forEach((a) => {
2009
- if (d === n && g === t) {
2010
- const h = c[a];
2011
- h.transform = B(h.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(c[a]);
2002
+ const d = l[g].data;
2003
+ d != null && Object.keys(d).forEach((c) => {
2004
+ if (a === n && g === t) {
2005
+ const h = d[c];
2006
+ h.transform = L(h.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(d[c]);
2012
2007
  } else
2013
- o.push(c[a]);
2008
+ o.push(d[c]);
2014
2009
  });
2015
2010
  });
2016
2011
  }), this._drawingManagerService.removeNotification(o), this._drawingManagerService.addNotification(s);
@@ -2021,7 +2016,7 @@ let pt = class extends Z {
2021
2016
  _sheetRefreshListener() {
2022
2017
  this.disposeWithMe(
2023
2018
  this._commandService.onCommandExecuted((i) => {
2024
- ns.includes(i.id) && requestIdleCallback(() => {
2019
+ rs.includes(i.id) && requestIdleCallback(() => {
2025
2020
  const e = i.params, { unitId: n, subUnitId: t, ranges: r } = e;
2026
2021
  this._refreshDrawingTransform(n, t, r);
2027
2022
  });
@@ -2031,18 +2026,18 @@ let pt = class extends Z {
2031
2026
  _refreshDrawingTransform(i, e, n) {
2032
2027
  const t = this._drawingManagerService.getDrawingData(i, e), r = [];
2033
2028
  Object.keys(t).forEach((s) => {
2034
- const o = t[s], { sheetTransform: d, transform: l, anchorType: g = y.Position } = o;
2029
+ const o = t[s], { sheetTransform: a, transform: l, anchorType: g = y.Position } = o;
2035
2030
  if (g === y.None)
2036
2031
  return !0;
2037
- const { from: c, to: a } = d, { row: h, column: u } = c, { row: m, column: f } = a;
2032
+ const { from: d, to: c } = a, { row: h, column: u } = d, { row: m, column: f } = c;
2038
2033
  for (let p = 0; p < n.length; p++) {
2039
- const v = n[p], { startRow: I, endRow: S, startColumn: R, endColumn: _ } = v;
2040
- if (Zn.intersects(
2034
+ const v = n[p], { startRow: I, endRow: S, startColumn: M, endColumn: w } = v;
2035
+ if (Qn.intersects(
2041
2036
  {
2042
2037
  startRow: I,
2043
2038
  endRow: S,
2044
- startColumn: R,
2045
- endColumn: _
2039
+ startColumn: M,
2040
+ endColumn: w
2046
2041
  },
2047
2042
  {
2048
2043
  startRow: h,
@@ -2050,14 +2045,14 @@ let pt = class extends Z {
2050
2045
  startColumn: u,
2051
2046
  endColumn: f
2052
2047
  }
2053
- ) || h > S || u > _) {
2054
- const C = g === y.Position, w = B(d, this._selectionRenderService, this._skeletonManagerService);
2048
+ ) || h > S || u > w) {
2049
+ const C = g === y.Position, _ = L(a, this._selectionRenderService, this._skeletonManagerService);
2055
2050
  r.push({
2056
2051
  ...o,
2057
2052
  transform: {
2058
- ...w,
2059
- width: C ? l == null ? void 0 : l.width : w == null ? void 0 : w.width,
2060
- height: C ? l == null ? void 0 : l.height : w == null ? void 0 : w.height
2053
+ ..._,
2054
+ width: C ? l == null ? void 0 : l.width : _ == null ? void 0 : _.width,
2055
+ height: C ? l == null ? void 0 : l.height : _ == null ? void 0 : _.height
2061
2056
  }
2062
2057
  });
2063
2058
  break;
@@ -2066,16 +2061,16 @@ let pt = class extends Z {
2066
2061
  }), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(W.id, [i]));
2067
2062
  }
2068
2063
  };
2069
- pt = es([
2064
+ wt = ts([
2070
2065
  te(1, X),
2071
- te(2, F),
2072
- te(3, Ie),
2073
- te(4, U(Q)),
2074
- te(5, U(Je)),
2066
+ te(2, B),
2067
+ te(3, Ce),
2068
+ te(4, U(Z)),
2069
+ te(5, U(Ze)),
2075
2070
  te(6, z),
2076
- te(7, q),
2077
- te(8, fe)
2078
- ], pt);
2071
+ te(7, Q),
2072
+ te(8, pe)
2073
+ ], wt);
2079
2074
  var J = function() {
2080
2075
  return J = Object.assign || function(i) {
2081
2076
  for (var e, n = 1, t = arguments.length; n < t; n++) {
@@ -2084,235 +2079,235 @@ var J = function() {
2084
2079
  }
2085
2080
  return i;
2086
2081
  }, J.apply(this, arguments);
2087
- }, rs = function(i, e) {
2082
+ }, is = function(i, e) {
2088
2083
  var n = {};
2089
2084
  for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
2090
2085
  if (i != null && typeof Object.getOwnPropertySymbols == "function")
2091
2086
  for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
2092
2087
  e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
2093
2088
  return n;
2094
- }, Mn = fn(function(i, e) {
2095
- var n = i.icon, t = i.id, r = i.className, s = i.extend, o = rs(i, ["icon", "id", "className", "extend"]), d = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), l = di("_".concat(os()));
2096
- return Dn(n, "".concat(t), { defIds: n.defIds, idSuffix: l.current }, J({ ref: e, className: d }, o), s);
2089
+ }, Dn = _n(function(i, e) {
2090
+ var n = i.icon, t = i.id, r = i.className, s = i.extend, o = is(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), l = li("_".concat(as()));
2091
+ return yn(n, "".concat(t), { defIds: n.defIds, idSuffix: l.current }, J({ ref: e, className: a }, o), s);
2097
2092
  });
2098
- function Dn(i, e, n, t, r) {
2099
- return pn(i.tag, J(J({ key: e }, is(i, n, r)), t), (ss(i, n).children || []).map(function(s, o) {
2100
- return Dn(s, "".concat(e, "-").concat(i.tag, "-").concat(o), n, void 0, r);
2093
+ function yn(i, e, n, t, r) {
2094
+ return wn(i.tag, J(J({ key: e }, ss(i, n, r)), t), (os(i, n).children || []).map(function(s, o) {
2095
+ return yn(s, "".concat(e, "-").concat(i.tag, "-").concat(o), n, void 0, r);
2101
2096
  }));
2102
2097
  }
2103
- function is(i, e, n) {
2098
+ function ss(i, e, n) {
2104
2099
  var t = J({}, i.attrs);
2105
2100
  n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
2106
2101
  var r = e.defIds;
2107
2102
  return !r || r.length === 0 || (i.tag === "use" && t["xlink:href"] && (t["xlink:href"] = t["xlink:href"] + e.idSuffix), Object.entries(t).forEach(function(s) {
2108
- var o = s[0], d = s[1];
2109
- typeof d == "string" && (t[o] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
2103
+ var o = s[0], a = s[1];
2104
+ typeof a == "string" && (t[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
2110
2105
  })), t;
2111
2106
  }
2112
- function ss(i, e) {
2107
+ function os(i, e) {
2113
2108
  var n, t = e.defIds;
2114
2109
  return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? J(J({}, i), { children: i.children.map(function(r) {
2115
2110
  return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? J(J({}, r), { attrs: J(J({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
2116
2111
  }) }) : i;
2117
2112
  }
2118
- function os() {
2113
+ function as() {
2119
2114
  return Math.random().toString(36).substring(2, 8);
2120
2115
  }
2121
- Mn.displayName = "UniverIcon";
2122
- var as = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, bn = fn(function(i, e) {
2123
- return pn(Mn, Object.assign({}, i, {
2116
+ Dn.displayName = "UniverIcon";
2117
+ var cs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, On = _n(function(i, e) {
2118
+ return wn(Dn, Object.assign({}, i, {
2124
2119
  id: "add-image-single",
2125
2120
  ref: e,
2126
- icon: as
2121
+ icon: cs
2127
2122
  }));
2128
2123
  });
2129
- bn.displayName = "AddImageSingle";
2130
- const yn = {
2124
+ On.displayName = "AddImageSingle";
2125
+ const En = {
2131
2126
  id: "sheet.command.delete-drawing",
2132
2127
  type: Y.COMMAND,
2133
2128
  handler: (i) => {
2134
- const e = i.get(F), t = i.get(z).getFocusDrawings();
2129
+ const e = i.get(B), t = i.get(z).getFocusDrawings();
2135
2130
  if (t.length === 0)
2136
2131
  return !1;
2137
2132
  const r = t[0].unitId, s = t.map((o) => {
2138
- const { unitId: d, subUnitId: l, drawingId: g, drawingType: c } = o;
2133
+ const { unitId: a, subUnitId: l, drawingId: g, drawingType: d } = o;
2139
2134
  return {
2140
- unitId: d,
2135
+ unitId: a,
2141
2136
  subUnitId: l,
2142
2137
  drawingId: g,
2143
- drawingType: c
2138
+ drawingType: d
2144
2139
  };
2145
2140
  });
2146
- return e.executeCommand(qe.id, {
2141
+ return e.executeCommand(Qe.id, {
2147
2142
  unitId: r,
2148
2143
  drawings: s
2149
2144
  });
2150
2145
  }
2151
- }, vt = {
2146
+ }, It = {
2152
2147
  id: "sheet.command.insert-float-image",
2153
2148
  type: Y.COMMAND,
2154
2149
  handler: (i) => {
2155
2150
  var n, t;
2156
- return (t = (n = i.get(X).getCurrentTypeOfRenderer(G.UNIVER_SHEET)) == null ? void 0 : n.with(ve).insertFloatImage()) != null ? t : !1;
2151
+ return (t = (n = i.get(X).getCurrentTypeOfRenderer(F.UNIVER_SHEET)) == null ? void 0 : n.with(Se).insertFloatImage()) != null ? t : !1;
2157
2152
  }
2158
- }, St = {
2153
+ }, Ct = {
2159
2154
  id: "sheet.command.insert-cell-image",
2160
2155
  type: Y.COMMAND,
2161
2156
  handler: (i) => {
2162
2157
  var n, t;
2163
- return (t = (n = i.get(X).getCurrentTypeOfRenderer(G.UNIVER_SHEET)) == null ? void 0 : n.with(ve).insertCellImage()) != null ? t : !1;
2158
+ return (t = (n = i.get(X).getCurrentTypeOfRenderer(F.UNIVER_SHEET)) == null ? void 0 : n.with(Se).insertCellImage()) != null ? t : !1;
2164
2159
  }
2165
- }, Ce = {
2160
+ }, Re = {
2166
2161
  id: "sheet.command.move-drawing",
2167
2162
  type: Y.COMMAND,
2168
2163
  handler: (i, e) => {
2169
- const n = i.get(F), t = i.get(z), r = i.get(Ie), { direction: s } = e, o = t.getFocusDrawings();
2164
+ const n = i.get(B), t = i.get(z), r = i.get(Ce), { direction: s } = e, o = t.getFocusDrawings();
2170
2165
  if (o.length === 0)
2171
2166
  return !1;
2172
- const d = o[0].unitId, l = o.map((c) => {
2173
- const { transform: a } = c;
2174
- if (a == null)
2167
+ const a = o[0].unitId, l = o.map((d) => {
2168
+ const { transform: c } = d;
2169
+ if (c == null)
2175
2170
  return null;
2176
- const h = { ...a }, { left: u = 0, top: m = 0 } = a;
2171
+ const h = { ...c }, { left: u = 0, top: m = 0 } = c;
2177
2172
  return s === re.UP ? h.top = m - 1 : s === re.DOWN ? h.top = m + 1 : s === re.LEFT ? h.left = u - 1 : s === re.RIGHT && (h.left = u + 1), {
2178
- ...c,
2173
+ ...d,
2179
2174
  transform: h,
2180
2175
  sheetTransform: j(h, r)
2181
2176
  };
2182
- }).filter((c) => c != null);
2183
- return n.syncExecuteCommand(Qe.id, {
2184
- unitId: d,
2177
+ }).filter((d) => d != null);
2178
+ return n.syncExecuteCommand(tt.id, {
2179
+ unitId: a,
2185
2180
  drawings: l
2186
- }) ? (n.syncExecuteCommand(W.id, [d]), !0) : !1;
2181
+ }) ? (n.syncExecuteCommand(W.id, [a]), !0) : !1;
2187
2182
  }
2188
- }, On = "addition-and-subtraction-single", Tn = "sheet.menu.image";
2189
- function cs(i) {
2183
+ }, Tn = "addition-and-subtraction-single", Pn = "sheet.menu.image";
2184
+ function ds(i) {
2190
2185
  return {
2191
- id: Tn,
2192
- type: wt.SUBITEMS,
2193
- icon: On,
2186
+ id: Pn,
2187
+ type: vt.SUBITEMS,
2188
+ icon: Tn,
2194
2189
  tooltip: "sheetImage.title",
2195
- hidden$: Yt(i, G.UNIVER_SHEET),
2196
- disabled$: Nr(i, { workbookTypes: [lt], worksheetTypes: [xe], rangeTypes: [ai] })
2190
+ hidden$: zt(i, F.UNIVER_SHEET),
2191
+ disabled$: jr(i, { workbookTypes: [ht], worksheetTypes: [$e], rangeTypes: [ci] })
2197
2192
  };
2198
2193
  }
2199
- function ds(i) {
2194
+ function ls(i) {
2200
2195
  return {
2201
- id: vt.id,
2196
+ id: It.id,
2202
2197
  title: "sheetImage.upload.float",
2203
- type: wt.BUTTON,
2204
- hidden$: Yt(i, G.UNIVER_SHEET)
2198
+ type: vt.BUTTON,
2199
+ hidden$: zt(i, F.UNIVER_SHEET)
2205
2200
  };
2206
2201
  }
2207
- function ls(i) {
2202
+ function us(i) {
2208
2203
  return {
2209
- id: St.id,
2204
+ id: Ct.id,
2210
2205
  title: "sheetImage.upload.cell",
2211
- type: wt.BUTTON
2206
+ type: vt.BUTTON
2212
2207
  };
2213
2208
  }
2214
- const us = "univer-image-common-panel", hs = "univer-image-common-panel-grid", gs = "univer-image-common-panel-border", ms = "univer-image-common-panel-title", fs = "univer-image-common-panel-subtitle", ps = "univer-image-common-panel-row", ws = "univer-image-common-panel-row-vertical", _s = "univer-image-common-panel-column", vs = "univer-image-common-panel-column-center", Ss = "univer-image-common-panel-inline", Is = "univer-image-common-panel-span2", Cs = "univer-image-common-panel-span3", Rs = "univer-image-common-panel-input", Ms = "univer-sheet-image-menu", Ds = "univer-sheet-image-menu-input", ne = {
2215
- imageCommonPanel: us,
2216
- imageCommonPanelGrid: hs,
2217
- imageCommonPanelBorder: gs,
2218
- imageCommonPanelTitle: ms,
2219
- imageCommonPanelSubtitle: fs,
2220
- imageCommonPanelRow: ps,
2209
+ const hs = "univer-image-common-panel", gs = "univer-image-common-panel-grid", ms = "univer-image-common-panel-border", fs = "univer-image-common-panel-title", ps = "univer-image-common-panel-subtitle", _s = "univer-image-common-panel-row", ws = "univer-image-common-panel-row-vertical", vs = "univer-image-common-panel-column", Ss = "univer-image-common-panel-column-center", Is = "univer-image-common-panel-inline", Cs = "univer-image-common-panel-span2", Rs = "univer-image-common-panel-span3", Ms = "univer-image-common-panel-input", bs = "univer-sheet-image-menu", Ds = "univer-sheet-image-menu-input", ne = {
2210
+ imageCommonPanel: hs,
2211
+ imageCommonPanelGrid: gs,
2212
+ imageCommonPanelBorder: ms,
2213
+ imageCommonPanelTitle: fs,
2214
+ imageCommonPanelSubtitle: ps,
2215
+ imageCommonPanelRow: _s,
2221
2216
  imageCommonPanelRowVertical: ws,
2222
- imageCommonPanelColumn: _s,
2223
- imageCommonPanelColumnCenter: vs,
2224
- imageCommonPanelInline: Ss,
2225
- imageCommonPanelSpan2: Is,
2226
- imageCommonPanelSpan3: Cs,
2227
- imageCommonPanelInput: Rs,
2228
- sheetImageMenu: Ms,
2217
+ imageCommonPanelColumn: vs,
2218
+ imageCommonPanelColumnCenter: Ss,
2219
+ imageCommonPanelInline: Is,
2220
+ imageCommonPanelSpan2: Cs,
2221
+ imageCommonPanelSpan3: Rs,
2222
+ imageCommonPanelInput: Ms,
2223
+ sheetImageMenu: bs,
2229
2224
  sheetImageMenuInput: Ds
2230
2225
  };
2231
- function En(i) {
2226
+ function Un(i) {
2232
2227
  var e, n, t = "";
2233
2228
  if (typeof i == "string" || typeof i == "number") t += i;
2234
2229
  else if (typeof i == "object") if (Array.isArray(i)) {
2235
2230
  var r = i.length;
2236
- for (e = 0; e < r; e++) i[e] && (n = En(i[e])) && (t && (t += " "), t += n);
2231
+ for (e = 0; e < r; e++) i[e] && (n = Un(i[e])) && (t && (t += " "), t += n);
2237
2232
  } else for (n in i) i[n] && (t && (t += " "), t += n);
2238
2233
  return t;
2239
2234
  }
2240
- function je() {
2241
- for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = En(i)) && (t && (t += " "), t += e);
2235
+ function We() {
2236
+ for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = Un(i)) && (t && (t += " "), t += e);
2242
2237
  return t;
2243
2238
  }
2244
- const bs = (i) => {
2239
+ const ys = (i) => {
2245
2240
  var S;
2246
- const e = de(F), n = de(Ke), t = de(q), r = de(X), { drawings: s } = i, o = s[0];
2241
+ const e = le(B), n = le(Je), t = le(Q), r = le(X), { drawings: s } = i, o = s[0];
2247
2242
  if (o == null)
2248
2243
  return;
2249
- const { unitId: d } = o, l = r.getRenderById(d), g = l == null ? void 0 : l.scene;
2244
+ const { unitId: a } = o, l = r.getRenderById(a), g = l == null ? void 0 : l.scene;
2250
2245
  if (g == null)
2251
2246
  return;
2252
- const c = g.getTransformerByCreate(), [a, h] = gt(!0), u = (S = o.anchorType) != null ? S : y.Position, [m, f] = gt(u);
2253
- function p(R, _) {
2247
+ const d = g.getTransformerByCreate(), [c, h] = ft(!0), u = (S = o.anchorType) != null ? S : y.Position, [m, f] = ft(u);
2248
+ function p(M, w) {
2254
2249
  const C = [];
2255
- return R.forEach((w) => {
2256
- const { oKey: E } = w, b = _.getDrawingOKey(E);
2257
- if (b == null)
2250
+ return M.forEach((_) => {
2251
+ const { oKey: T } = _, D = w.getDrawingOKey(T);
2252
+ if (D == null)
2258
2253
  return C.push(null), !0;
2259
- const { unitId: N, subUnitId: A, drawingId: D, drawingType: M, anchorType: P, sheetTransform: x } = b;
2254
+ const { unitId: N, subUnitId: A, drawingId: b, drawingType: R, anchorType: P, sheetTransform: x } = D;
2260
2255
  C.push({
2261
2256
  unitId: N,
2262
2257
  subUnitId: A,
2263
- drawingId: D,
2258
+ drawingId: b,
2264
2259
  anchorType: P,
2265
2260
  sheetTransform: x,
2266
- drawingType: M
2261
+ drawingType: R
2267
2262
  });
2268
2263
  }), C;
2269
2264
  }
2270
- _t(() => {
2271
- const R = c.clearControl$.subscribe((C) => {
2265
+ St(() => {
2266
+ const M = d.clearControl$.subscribe((C) => {
2272
2267
  C === !0 && h(!1);
2273
- }), _ = c.changeStart$.subscribe((C) => {
2274
- var b;
2275
- const { objects: w } = C, E = p(w, t);
2276
- if (E.length === 0)
2268
+ }), w = d.changeStart$.subscribe((C) => {
2269
+ var D;
2270
+ const { objects: _ } = C, T = p(_, t);
2271
+ if (T.length === 0)
2277
2272
  h(!1);
2278
- else if (E.length >= 1) {
2273
+ else if (T.length >= 1) {
2279
2274
  h(!0);
2280
- const N = ((b = E[0]) == null ? void 0 : b.anchorType) || y.Position;
2275
+ const N = ((D = T[0]) == null ? void 0 : D.anchorType) || y.Position;
2281
2276
  f(N);
2282
2277
  }
2283
2278
  });
2284
2279
  return () => {
2285
- _.unsubscribe(), R.unsubscribe();
2280
+ w.unsubscribe(), M.unsubscribe();
2286
2281
  };
2287
2282
  }, []);
2288
- function v(R) {
2289
- f(R);
2290
- const _ = t.getFocusDrawings();
2291
- if (_.length === 0)
2283
+ function v(M) {
2284
+ f(M);
2285
+ const w = t.getFocusDrawings();
2286
+ if (w.length === 0)
2292
2287
  return;
2293
- const C = _.map((w) => ({
2294
- unitId: w.unitId,
2295
- subUnitId: w.subUnitId,
2296
- drawingId: w.drawingId,
2297
- anchorType: R
2288
+ const C = w.map((_) => ({
2289
+ unitId: _.unitId,
2290
+ subUnitId: _.subUnitId,
2291
+ drawingId: _.drawingId,
2292
+ anchorType: M
2298
2293
  }));
2299
- e.executeCommand(Qe.id, {
2300
- unitId: _[0].unitId,
2294
+ e.executeCommand(tt.id, {
2295
+ unitId: w[0].unitId,
2301
2296
  drawings: C
2302
2297
  });
2303
2298
  }
2304
- const I = (R) => R ? "block" : "none";
2305
- return /* @__PURE__ */ $.jsxs("div", { className: je(ne.imageCommonPanelGrid, ne.imageCommonPanelBorder), style: { display: I(a) }, children: [
2306
- /* @__PURE__ */ $.jsx("div", { className: ne.imageCommonPanelRow, children: /* @__PURE__ */ $.jsx("div", { className: je(ne.imageCommonPanelColumn, ne.imageCommonPanelTitle), children: /* @__PURE__ */ $.jsx("div", { children: n.t("drawing-anchor.title") }) }) }),
2307
- /* @__PURE__ */ $.jsx("div", { className: je(ne.imageCommonPanelRow), children: /* @__PURE__ */ $.jsx("div", { className: je(ne.imageCommonPanelColumn), children: /* @__PURE__ */ $.jsxs(hi, { value: m, onChange: v, direction: "vertical", children: [
2308
- /* @__PURE__ */ $.jsx(st, { value: y.Both, children: n.t("drawing-anchor.both") }),
2309
- /* @__PURE__ */ $.jsx(st, { value: y.Position, children: n.t("drawing-anchor.position") }),
2310
- /* @__PURE__ */ $.jsx(st, { value: y.None, children: n.t("drawing-anchor.none") })
2299
+ const I = (M) => M ? "block" : "none";
2300
+ return /* @__PURE__ */ $.jsxs("div", { className: We(ne.imageCommonPanelGrid, ne.imageCommonPanelBorder), style: { display: I(c) }, children: [
2301
+ /* @__PURE__ */ $.jsx("div", { className: ne.imageCommonPanelRow, children: /* @__PURE__ */ $.jsx("div", { className: We(ne.imageCommonPanelColumn, ne.imageCommonPanelTitle), children: /* @__PURE__ */ $.jsx("div", { children: n.t("drawing-anchor.title") }) }) }),
2302
+ /* @__PURE__ */ $.jsx("div", { className: We(ne.imageCommonPanelRow), children: /* @__PURE__ */ $.jsx("div", { className: We(ne.imageCommonPanelColumn), children: /* @__PURE__ */ $.jsxs(gi, { value: m, onChange: v, direction: "vertical", children: [
2303
+ /* @__PURE__ */ $.jsx(at, { value: y.Both, children: n.t("drawing-anchor.both") }),
2304
+ /* @__PURE__ */ $.jsx(at, { value: y.Position, children: n.t("drawing-anchor.position") }),
2305
+ /* @__PURE__ */ $.jsx(at, { value: y.None, children: n.t("drawing-anchor.none") })
2311
2306
  ] }) }) })
2312
2307
  ] });
2313
- }, ys = () => {
2314
- const i = de(q), e = i.getFocusDrawings(), [n, t] = gt(e);
2315
- return _t(() => {
2308
+ }, Os = () => {
2309
+ const i = le(Q), e = i.getFocusDrawings(), [n, t] = ft(e);
2310
+ return St(() => {
2316
2311
  const r = i.focus$.subscribe((s) => {
2317
2312
  t(s);
2318
2313
  });
@@ -2320,118 +2315,118 @@ const bs = (i) => {
2320
2315
  r.unsubscribe();
2321
2316
  };
2322
2317
  }, []), !!(n != null && n.length) && /* @__PURE__ */ $.jsxs("div", { className: ne.imageCommonPanel, children: [
2323
- /* @__PURE__ */ $.jsx(vr, { drawings: n }),
2324
- /* @__PURE__ */ $.jsx(bs, { drawings: n })
2318
+ /* @__PURE__ */ $.jsx(Sr, { drawings: n }),
2319
+ /* @__PURE__ */ $.jsx(ys, { drawings: n })
2325
2320
  ] });
2326
- }, Os = {
2327
- [Gr.FORMULAS_INSERT]: {
2328
- [Tn]: {
2321
+ }, Es = {
2322
+ [Fr.FORMULAS_INSERT]: {
2323
+ [Pn]: {
2329
2324
  order: 3,
2330
- menuItemFactory: cs,
2331
- [vt.id]: {
2325
+ menuItemFactory: ds,
2326
+ [It.id]: {
2332
2327
  order: 0,
2333
- menuItemFactory: ds
2328
+ menuItemFactory: ls
2334
2329
  },
2335
- [St.id]: {
2330
+ [Ct.id]: {
2336
2331
  order: 1,
2337
- menuItemFactory: ls
2332
+ menuItemFactory: us
2338
2333
  }
2339
2334
  }
2340
2335
  }
2341
2336
  };
2342
- function Re(i) {
2343
- return !i.getContextValue(Qn) && !i.getContextValue(er) && !i.getContextValue(tr) && i.getContextValue(he);
2337
+ function Me(i) {
2338
+ return !i.getContextValue(er) && !i.getContextValue(tr) && !i.getContextValue(nr) && i.getContextValue(ge);
2344
2339
  }
2345
2340
  const Ts = {
2346
- id: Ce.id,
2341
+ id: Re.id,
2347
2342
  description: "shortcut.sheet.drawing-move-down",
2348
2343
  group: "4_sheet-drawing-view",
2349
- binding: ge.ARROW_DOWN,
2344
+ binding: me.ARROW_DOWN,
2350
2345
  priority: 100,
2351
- preconditions: Re,
2346
+ preconditions: Me,
2352
2347
  staticParameters: {
2353
2348
  direction: re.DOWN
2354
2349
  }
2355
- }, Es = {
2356
- id: Ce.id,
2350
+ }, Ps = {
2351
+ id: Re.id,
2357
2352
  description: "shortcut.sheet.drawing-move-up",
2358
2353
  group: "4_sheet-drawing-view",
2359
- binding: ge.ARROW_UP,
2354
+ binding: me.ARROW_UP,
2360
2355
  priority: 100,
2361
- preconditions: Re,
2356
+ preconditions: Me,
2362
2357
  staticParameters: {
2363
2358
  direction: re.UP
2364
2359
  }
2365
- }, Ps = {
2366
- id: Ce.id,
2360
+ }, Us = {
2361
+ id: Re.id,
2367
2362
  description: "shortcut.sheet.drawing-move-left",
2368
2363
  group: "4_sheet-drawing-view",
2369
- binding: ge.ARROW_LEFT,
2364
+ binding: me.ARROW_LEFT,
2370
2365
  priority: 100,
2371
- preconditions: Re,
2366
+ preconditions: Me,
2372
2367
  staticParameters: {
2373
2368
  direction: re.LEFT
2374
2369
  }
2375
- }, Us = {
2376
- id: Ce.id,
2370
+ }, As = {
2371
+ id: Re.id,
2377
2372
  description: "shortcut.sheet.drawing-move-right",
2378
2373
  group: "4_sheet-drawing-view",
2379
- binding: ge.ARROW_RIGHT,
2374
+ binding: me.ARROW_RIGHT,
2380
2375
  priority: 100,
2381
- preconditions: Re,
2376
+ preconditions: Me,
2382
2377
  staticParameters: {
2383
2378
  direction: re.RIGHT
2384
2379
  }
2385
- }, As = {
2386
- id: yn.id,
2380
+ }, Ns = {
2381
+ id: En.id,
2387
2382
  description: "shortcut.sheet.drawing-delete",
2388
2383
  group: "4_sheet-drawing-view",
2389
2384
  // when focusing on any other input tag do not trigger this shortcut
2390
- preconditions: Re,
2391
- binding: ge.DELETE,
2392
- mac: ge.BACKSPACE
2385
+ preconditions: Me,
2386
+ binding: me.DELETE,
2387
+ mac: me.BACKSPACE
2393
2388
  };
2394
- var Ns = Object.defineProperty, js = Object.getOwnPropertyDescriptor, Ws = (i, e, n, t) => {
2395
- for (var r = t > 1 ? void 0 : t ? js(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2389
+ var js = Object.defineProperty, Ws = Object.getOwnPropertyDescriptor, xs = (i, e, n, t) => {
2390
+ for (var r = t > 1 ? void 0 : t ? Ws(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2396
2391
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
2397
- return t && r && Ns(e, n, r), r;
2398
- }, We = (i, e) => (n, t) => e(n, t, i);
2399
- let Ye = class extends Z {
2392
+ return t && r && js(e, n, r), r;
2393
+ }, xe = (i, e) => (n, t) => e(n, t, i);
2394
+ let Xe = class extends q {
2400
2395
  constructor(i, e, n, t) {
2401
2396
  super(), this._componentManager = i, this._menuManagerService = e, this._commandService = n, this._shortcutService = t, this._init();
2402
2397
  }
2403
2398
  _initCustomComponents() {
2404
2399
  const i = this._componentManager;
2405
- this.disposeWithMe(i.register(On, bn)), this.disposeWithMe(i.register(wn, ys));
2400
+ this.disposeWithMe(i.register(Tn, On)), this.disposeWithMe(i.register(vn, Os));
2406
2401
  }
2407
2402
  _initMenus() {
2408
- this._menuManagerService.mergeMenu(Os);
2403
+ this._menuManagerService.mergeMenu(Es);
2409
2404
  }
2410
2405
  _initCommands() {
2411
2406
  [
2412
- vt,
2413
- St,
2414
- Ze,
2415
- qe,
2407
+ It,
2408
+ Ct,
2409
+ et,
2416
2410
  Qe,
2417
- _n,
2418
- W,
2419
- vn,
2411
+ tt,
2420
2412
  Sn,
2413
+ W,
2414
+ In,
2421
2415
  Cn,
2422
- Ce,
2423
- yn,
2424
- In
2416
+ Mn,
2417
+ Re,
2418
+ En,
2419
+ Rn
2425
2420
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
2426
2421
  }
2427
2422
  _initShortcuts() {
2428
2423
  [
2429
2424
  // sheet drawing shortcuts
2430
2425
  Ts,
2431
- Es,
2432
2426
  Ps,
2433
2427
  Us,
2434
- As
2428
+ As,
2429
+ Ns
2435
2430
  ].forEach((i) => {
2436
2431
  this.disposeWithMe(this._shortcutService.registerShortcut(i));
2437
2432
  });
@@ -2440,85 +2435,85 @@ let Ye = class extends Z {
2440
2435
  this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
2441
2436
  }
2442
2437
  };
2443
- Ye = Ws([
2444
- We(0, U(Fr)),
2445
- We(1, Vr),
2446
- We(2, F),
2447
- We(3, kr)
2448
- ], Ye);
2449
- var xs = Object.defineProperty, $s = Object.getOwnPropertyDescriptor, Bs = (i, e, n, t) => {
2450
- for (var r = t > 1 ? void 0 : t ? $s(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2438
+ Xe = xs([
2439
+ xe(0, U(Vr)),
2440
+ xe(1, kr),
2441
+ xe(2, B),
2442
+ xe(3, Hr)
2443
+ ], Xe);
2444
+ var $s = Object.defineProperty, Bs = Object.getOwnPropertyDescriptor, Ls = (i, e, n, t) => {
2445
+ for (var r = t > 1 ? void 0 : t ? Bs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2451
2446
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
2452
- return t && r && xs(e, n, r), r;
2453
- }, ce = (i, e) => (n, t) => e(n, t, i);
2454
- function Ls(i, e, n, t) {
2455
- const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(kt.VIEW_MAIN), d = {
2447
+ return t && r && $s(e, n, r), r;
2448
+ }, de = (i, e) => (n, t) => e(n, t, i);
2449
+ function Gs(i, e, n, t) {
2450
+ const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(Yt.VIEW_MAIN), a = {
2456
2451
  left: !0,
2457
2452
  top: !0
2458
2453
  };
2459
2454
  if (!o)
2460
2455
  return {
2461
2456
  ...i,
2462
- absolute: d
2457
+ absolute: a
2463
2458
  };
2464
- const { left: l, right: g, top: c, bottom: a } = i, h = t.getFreeze(), { startColumn: u, startRow: m, xSplit: f, ySplit: p } = h, v = n.getNoMergeCellPositionByIndexWithNoHeader(m - p, u - f), I = n.getNoMergeCellPositionByIndexWithNoHeader(m, u), { rowHeaderWidth: S, columnHeaderHeight: R } = n, _ = I.startX - v.startX, C = I.startY - v.startY, { top: w, left: E, viewportScrollX: b, viewportScrollY: N } = o;
2465
- let A, D;
2466
- l < E ? (d.left = !0, A = (_ + S + (l - E)) * r, D = Math.max(
2459
+ const { left: l, right: g, top: d, bottom: c } = i, h = t.getFreeze(), { startColumn: u, startRow: m, xSplit: f, ySplit: p } = h, v = n.getNoMergeCellPositionByIndexWithNoHeader(m - p, u - f), I = n.getNoMergeCellPositionByIndexWithNoHeader(m, u), { rowHeaderWidth: S, columnHeaderHeight: M } = n, w = I.startX - v.startX, C = I.startY - v.startY, { top: _, left: T, viewportScrollX: D, viewportScrollY: N } = o;
2460
+ let A, b;
2461
+ l < T ? (a.left = !0, A = (w + S + (l - T)) * r, b = Math.max(
2467
2462
  Math.min(
2468
- (_ + S + (g - E)) * r,
2469
- (_ + S) * r
2463
+ (w + S + (g - T)) * r,
2464
+ (w + S) * r
2470
2465
  ),
2471
- (g - b) * r
2472
- )) : (d.left = !1, A = Math.max((l - b) * r, (_ + S) * r), D = Math.max((g - b) * r, (_ + S) * r));
2473
- let M, P;
2474
- return c < w ? (d.top = !0, M = (C + R + (c - w)) * s, P = Math.max(
2466
+ (g - D) * r
2467
+ )) : (a.left = !1, A = Math.max((l - D) * r, (w + S) * r), b = Math.max((g - D) * r, (w + S) * r));
2468
+ let R, P;
2469
+ return d < _ ? (a.top = !0, R = (C + M + (d - _)) * s, P = Math.max(
2475
2470
  Math.min(
2476
- (C + R + (g - w)) * s,
2477
- (C + R) * s
2471
+ (C + M + (g - _)) * s,
2472
+ (C + M) * s
2478
2473
  ),
2479
- (a - N) * s
2480
- )) : (d.top = !1, M = Math.max((c - N) * s, (C + R) * s), P = Math.max((a - N) * s, (C + R) * s)), {
2474
+ (c - N) * s
2475
+ )) : (a.top = !1, R = Math.max((d - N) * s, (C + M) * s), P = Math.max((c - N) * s, (C + M) * s)), {
2481
2476
  left: A,
2482
- right: D,
2483
- top: M,
2477
+ right: b,
2478
+ top: R,
2484
2479
  bottom: P,
2485
- absolute: d
2480
+ absolute: a
2486
2481
  };
2487
2482
  }
2488
- const ct = (i, e, n, t) => {
2489
- const { scene: r } = e, { left: s, top: o, width: d, height: l, angle: g } = i, c = {
2483
+ const lt = (i, e, n, t) => {
2484
+ const { scene: r } = e, { left: s, top: o, width: a, height: l, angle: g } = i, d = {
2490
2485
  left: s,
2491
- right: s + d,
2486
+ right: s + a,
2492
2487
  top: o,
2493
2488
  bottom: o + l
2494
- }, a = Ls(c, r, n, t), { scaleX: h, scaleY: u } = r.getAncestorScale();
2489
+ }, c = Gs(d, r, n, t), { scaleX: h, scaleY: u } = r.getAncestorScale();
2495
2490
  return {
2496
- startX: a.left,
2497
- endX: a.right,
2498
- startY: a.top,
2499
- endY: a.bottom,
2491
+ startX: c.left,
2492
+ endX: c.right,
2493
+ startY: c.top,
2494
+ endY: c.bottom,
2500
2495
  rotate: g,
2501
- width: d * h,
2496
+ width: a * h,
2502
2497
  height: l * u,
2503
- absolute: a.absolute
2498
+ absolute: c.absolute
2504
2499
  };
2505
2500
  };
2506
- let Xe = class extends Z {
2507
- constructor(e, n, t, r, s, o, d) {
2501
+ let ze = class extends q {
2502
+ constructor(e, n, t, r, s, o, a) {
2508
2503
  super();
2509
2504
  V(this, "_domLayerMap", /* @__PURE__ */ new Map());
2510
2505
  V(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
2511
- V(this, "_transformChange$", new rt());
2506
+ V(this, "_transformChange$", new st());
2512
2507
  V(this, "transformChange$", this._transformChange$.asObservable());
2513
- V(this, "_add$", new rt());
2508
+ V(this, "_add$", new st());
2514
2509
  V(this, "add$", this._add$.asObservable());
2515
- V(this, "_remove$", new rt());
2510
+ V(this, "_remove$", new st());
2516
2511
  V(this, "remove$", this._remove$.asObservable());
2517
2512
  V(this, "_hooks", []);
2518
- this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = d, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
2513
+ this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = a, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
2519
2514
  }
2520
2515
  _bindScrollEvent() {
2521
- this._lifecycleService.lifecycle$.pipe(ie((e) => e === rr.Rendered), Yr(1)).subscribe(() => {
2516
+ this._lifecycleService.lifecycle$.pipe(ie((e) => e === ir.Rendered), Xr(1)).subscribe(() => {
2522
2517
  this._scrollUpdateListener();
2523
2518
  });
2524
2519
  }
@@ -2552,81 +2547,81 @@ let Xe = class extends Z {
2552
2547
  // eslint-disable-next-line max-lines-per-function
2553
2548
  this._drawingManagerService.add$.subscribe((e) => {
2554
2549
  e.forEach((n) => {
2555
- var Ct, Rt, Mt;
2556
- const { unitId: t, subUnitId: r, drawingId: s } = n, o = H(this._univerInstanceService, { unitId: t, subUnitId: r }), d = this._drawingManagerService.getDrawingByParam(n), l = this._univerInstanceService.getUnit(t, G.UNIVER_SHEET);
2550
+ var Mt, bt, Dt;
2551
+ const { unitId: t, subUnitId: r, drawingId: s } = n, o = H(this._univerInstanceService, { unitId: t, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(n), l = this._univerInstanceService.getUnit(t, F.UNIVER_SHEET);
2557
2552
  if (!l)
2558
2553
  return;
2559
2554
  const g = l.getActiveSheet().getSheetId();
2560
- if (!d || !o)
2555
+ if (!a || !o)
2561
2556
  return;
2562
- const c = (Ct = this._renderManagerService.getRenderById(t)) == null ? void 0 : Ct.with(Q).getWorksheetSkeleton(r);
2563
- if (!c)
2557
+ const d = (Mt = this._renderManagerService.getRenderById(t)) == null ? void 0 : Mt.with(Z).getWorksheetSkeleton(r);
2558
+ if (!d)
2564
2559
  return;
2565
- const { transform: a, drawingType: h, data: u } = d;
2560
+ const { transform: c, drawingType: h, data: u } = a;
2566
2561
  if (h !== k.DRAWING_DOM && h !== k.DRAWING_CHART)
2567
2562
  return;
2568
2563
  const m = this._getSceneAndTransformerByDrawingSearch(t);
2569
2564
  if (m == null)
2570
2565
  return;
2571
2566
  const { scene: f, canvas: p } = m;
2572
- if (a == null)
2567
+ if (c == null)
2573
2568
  return !0;
2574
2569
  if (g !== r)
2575
2570
  return;
2576
- const { left: v, top: I, width: S, height: R, angle: _, flipX: C, flipY: w, skewX: E, skewY: b } = a, N = nt({ unitId: t, subUnitId: r, drawingId: s }), A = f.getObject(N);
2571
+ const { left: v, top: I, width: S, height: M, angle: w, flipX: C, flipY: _, skewX: T, skewY: D } = c, N = it({ unitId: t, subUnitId: r, drawingId: s }), A = f.getObject(N);
2577
2572
  if (A != null) {
2578
- A.transformByState({ left: v, top: I, width: S, height: R, angle: _, flipX: C, flipY: w, skewX: E, skewY: b });
2573
+ A.transformByState({ left: v, top: I, width: S, height: M, angle: w, flipX: C, flipY: _, skewX: T, skewY: D });
2579
2574
  return;
2580
2575
  }
2581
- const D = {
2576
+ const b = {
2582
2577
  left: v,
2583
2578
  top: I,
2584
2579
  width: S,
2585
- height: R,
2580
+ height: M,
2586
2581
  zIndex: this._drawingManagerService.getDrawingOrder(t, r).length - 1
2587
- }, M = h === k.DRAWING_CHART;
2588
- if (M) {
2589
- const L = u ? u.backgroundColor : "white";
2590
- D.fill = L, D.rotateEnabled = !1, u && u.border && (D.stroke = u.border), D.paintFirst = "stroke", D.strokeWidth = 1, D.borderEnabled = !1, D.radius = 8;
2582
+ }, R = h === k.DRAWING_CHART;
2583
+ if (R) {
2584
+ const G = u ? u.backgroundColor : "white";
2585
+ b.fill = G, b.rotateEnabled = !1, u && u.border && (b.stroke = u.border), b.paintFirst = "stroke", b.strokeWidth = 1, b.borderEnabled = !1, b.radius = 8;
2591
2586
  }
2592
- const P = new Pt(N, D);
2593
- M && P.setObjectType(Rr.CHART), f.addObject(P, Mr), d.allowTransform !== !1 && f.attachTransformerTo(P);
2594
- const x = this._ensureMap(t, r), ee = new ir(), An = ct(P, m.renderObject, c.skeleton, o.worksheet), et = new Xr(An), Nn = {
2595
- dispose: ee,
2587
+ const P = new At(N, b);
2588
+ R && P.setObjectType(Mr.CHART), f.addObject(P, br), a.allowTransform !== !1 && f.attachTransformerTo(P);
2589
+ const x = this._ensureMap(t, r), se = new sr(), oe = lt(P, m.renderObject, d.skeleton, o.worksheet), nt = new zr(oe), jn = {
2590
+ dispose: se,
2596
2591
  rect: P,
2597
- position$: et,
2592
+ position$: nt,
2598
2593
  unitId: t,
2599
2594
  subUnitId: r
2600
2595
  };
2601
2596
  this._canvasFloatDomService.addFloatDom({
2602
- position$: et,
2597
+ position$: nt,
2603
2598
  id: s,
2604
- componentKey: d.componentKey,
2605
- onPointerDown: (L) => {
2606
- p.dispatchEvent(new PointerEvent(L.type, L));
2599
+ componentKey: a.componentKey,
2600
+ onPointerDown: (G) => {
2601
+ p.dispatchEvent(new PointerEvent(G.type, G));
2607
2602
  },
2608
- onPointerMove: (L) => {
2609
- p.dispatchEvent(new PointerEvent(L.type, L));
2603
+ onPointerMove: (G) => {
2604
+ p.dispatchEvent(new PointerEvent(G.type, G));
2610
2605
  },
2611
- onPointerUp: (L) => {
2612
- p.dispatchEvent(new PointerEvent(L.type, L));
2606
+ onPointerUp: (G) => {
2607
+ p.dispatchEvent(new PointerEvent(G.type, G));
2613
2608
  },
2614
- onWheel: (L) => {
2615
- p.dispatchEvent(new WheelEvent(L.type, L));
2609
+ onWheel: (G) => {
2610
+ p.dispatchEvent(new WheelEvent(G.type, G));
2616
2611
  },
2617
- props: (Mt = (Rt = x.get(s)) == null ? void 0 : Rt.props) != null ? Mt : this._getFloatDomProps(s),
2612
+ props: (Dt = (bt = x.get(s)) == null ? void 0 : bt.props) != null ? Dt : this._getFloatDomProps(s),
2618
2613
  data: u,
2619
2614
  unitId: t
2620
2615
  });
2621
- const It = P.onTransformChange$.subscribeEvent(() => {
2622
- const L = ct(P, m.renderObject, c.skeleton, o.worksheet);
2623
- et.next(
2624
- L
2616
+ const Rt = P.onTransformChange$.subscribeEvent(() => {
2617
+ const G = lt(P, m.renderObject, d.skeleton, o.worksheet);
2618
+ nt.next(
2619
+ G
2625
2620
  );
2626
2621
  });
2627
- ee.add(() => {
2622
+ se.add(() => {
2628
2623
  this._canvasFloatDomService.removeFloatDom(s);
2629
- }), It && ee.add(It), this._domLayerInfoMap.set(s, Nn), x.set(s, {
2624
+ }), Rt && se.add(Rt), this._domLayerInfoMap.set(s, jn), x.set(s, {
2630
2625
  ...x.get(s)
2631
2626
  });
2632
2627
  });
@@ -2634,11 +2629,11 @@ let Xe = class extends Z {
2634
2629
  ), this.disposeWithMe(
2635
2630
  this._drawingManagerService.remove$.subscribe((e) => {
2636
2631
  e.forEach((n) => {
2637
- const { unitId: t, subUnitId: r, drawingId: s } = n, o = nt({ unitId: t, subUnitId: r, drawingId: s }), d = this._getSceneAndTransformerByDrawingSearch(t);
2638
- if (d == null)
2632
+ const { unitId: t, subUnitId: r, drawingId: s } = n, o = it({ unitId: t, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(t);
2633
+ if (a == null)
2639
2634
  return;
2640
- const { transformer: l, scene: g } = d, c = g.getObject(o);
2641
- c != null && c.oKey && l.clearControlByIds([c == null ? void 0 : c.oKey]);
2635
+ const { transformer: l, scene: g } = a, d = g.getObject(o);
2636
+ d != null && d.oKey && l.clearControlByIds([d == null ? void 0 : d.oKey]);
2642
2637
  });
2643
2638
  })
2644
2639
  );
@@ -2646,39 +2641,39 @@ let Xe = class extends Z {
2646
2641
  _scrollUpdateListener() {
2647
2642
  const e = (n, t) => {
2648
2643
  var g;
2649
- const r = this._getSceneAndTransformerByDrawingSearch(n), s = this._ensureMap(n, t), o = Array.from(s.keys()), d = H(this._univerInstanceService, { unitId: n, subUnitId: t }), l = (g = this._renderManagerService.getRenderById(n)) == null ? void 0 : g.with(Q).getWorksheetSkeleton(t);
2650
- !r || !d || !l || o.forEach((c) => {
2651
- const a = this._domLayerInfoMap.get(c);
2652
- if (a) {
2653
- const h = ct(a.rect, r.renderObject, l.skeleton, d.worksheet);
2654
- a.position$.next(h);
2644
+ const r = this._getSceneAndTransformerByDrawingSearch(n), s = this._ensureMap(n, t), o = Array.from(s.keys()), a = H(this._univerInstanceService, { unitId: n, subUnitId: t }), l = (g = this._renderManagerService.getRenderById(n)) == null ? void 0 : g.with(Z).getWorksheetSkeleton(t);
2645
+ !r || !a || !l || o.forEach((d) => {
2646
+ const c = this._domLayerInfoMap.get(d);
2647
+ if (c) {
2648
+ const h = lt(c.rect, r.renderObject, l.skeleton, a.worksheet);
2649
+ c.position$.next(h);
2655
2650
  }
2656
2651
  });
2657
2652
  };
2658
2653
  this.disposeWithMe(
2659
- this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET).pipe(
2654
+ this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(
2660
2655
  ie((n) => !!n),
2661
- Nt((n) => n.activeSheet$),
2656
+ Wt((n) => n.activeSheet$),
2662
2657
  ie((n) => !!n),
2663
- $e((n) => {
2658
+ Be((n) => {
2664
2659
  const t = this._renderManagerService.getRenderById(n.getUnitId());
2665
2660
  return t ? { render: t, unitId: n.getUnitId(), subUnitId: n.getSheetId() } : null;
2666
2661
  }),
2667
2662
  ie((n) => !!n),
2668
- Nt(
2669
- (n) => sr(n.render.scene.getViewport(kt.VIEW_MAIN).onScrollAfter$).pipe($e(() => ({ unitId: n.unitId, subUnitId: n.subUnitId })))
2663
+ Wt(
2664
+ (n) => or(n.render.scene.getViewport(Yt.VIEW_MAIN).onScrollAfter$).pipe(Be(() => ({ unitId: n.unitId, subUnitId: n.subUnitId })))
2670
2665
  )
2671
2666
  ).subscribe(({ unitId: n, subUnitId: t }) => {
2672
2667
  e(n, t);
2673
2668
  })
2674
2669
  ), this.disposeWithMe(this._commandService.onCommandExecuted((n) => {
2675
2670
  var t, r;
2676
- if (n.id === jr.id) {
2671
+ if (n.id === Wr.id) {
2677
2672
  const s = n.params, { unitId: o } = s;
2678
2673
  Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((l) => {
2679
2674
  e(o, l);
2680
2675
  });
2681
- } else if (n.id === ci.id) {
2676
+ } else if (n.id === di.id) {
2682
2677
  const { unitId: s, subUnitId: o } = n.params;
2683
2678
  e(s, o);
2684
2679
  }
@@ -2686,10 +2681,10 @@ let Xe = class extends Z {
2686
2681
  }
2687
2682
  _getPosition(e, n) {
2688
2683
  var h;
2689
- const { startX: t, endX: r, startY: s, endY: o } = e, d = (h = this._renderManagerService.getRenderById(n)) == null ? void 0 : h.with(Ie);
2690
- if (d == null)
2684
+ const { startX: t, endX: r, startY: s, endY: o } = e, a = (h = this._renderManagerService.getRenderById(n)) == null ? void 0 : h.with(Ce);
2685
+ if (a == null)
2691
2686
  return;
2692
- const l = d.getCellWithCoordByOffset(t, s);
2687
+ const l = a.getCellWithCoordByOffset(t, s);
2693
2688
  if (l == null)
2694
2689
  return;
2695
2690
  const g = {
@@ -2697,18 +2692,18 @@ let Xe = class extends Z {
2697
2692
  columnOffset: t - l.startX,
2698
2693
  row: l.actualRow,
2699
2694
  rowOffset: s - l.startY
2700
- }, c = d.getCellWithCoordByOffset(r, o);
2701
- if (c == null)
2695
+ }, d = a.getCellWithCoordByOffset(r, o);
2696
+ if (d == null)
2702
2697
  return;
2703
- const a = {
2704
- column: c.actualColumn,
2705
- columnOffset: r - c.startX,
2706
- row: c.actualRow,
2707
- rowOffset: o - c.startY
2698
+ const c = {
2699
+ column: d.actualColumn,
2700
+ columnOffset: r - d.startX,
2701
+ row: d.actualRow,
2702
+ rowOffset: o - d.startY
2708
2703
  };
2709
2704
  return {
2710
2705
  from: g,
2711
- to: a
2706
+ to: c
2712
2707
  };
2713
2708
  }
2714
2709
  _featureUpdateListener() {
@@ -2738,8 +2733,8 @@ let Xe = class extends Z {
2738
2733
  updateFloatDomProps(e, n, t, r) {
2739
2734
  const s = this._domLayerInfoMap.get(t), o = this._getSceneAndTransformerByDrawingSearch(e);
2740
2735
  if (s && o) {
2741
- const { scene: d } = o, l = nt({ unitId: e, subUnitId: n, drawingId: t }), g = d.getObject(l);
2742
- g && g instanceof Pt && g.setProps(r);
2736
+ const { scene: a } = o, l = it({ unitId: e, subUnitId: n, drawingId: t }), g = a.getObject(l);
2737
+ g && g instanceof At && g.setProps(r);
2743
2738
  }
2744
2739
  }
2745
2740
  addFloatDomToPosition(e, n) {
@@ -2749,17 +2744,17 @@ let Xe = class extends Z {
2749
2744
  });
2750
2745
  if (!t)
2751
2746
  throw new Error("cannot find current target!");
2752
- const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: d, data: l, allowTransform: g = !0 } = e, c = n != null ? n : or(), a = this._getPosition(o, r);
2753
- if (a == null)
2747
+ const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: a, data: l, allowTransform: g = !0 } = e, d = n != null ? n : ar(), c = this._getPosition(o, r);
2748
+ if (c == null)
2754
2749
  return;
2755
- this._ensureMap(r, s).set(c, e);
2750
+ this._ensureMap(r, s).set(d, e);
2756
2751
  const u = {
2757
2752
  unitId: r,
2758
2753
  subUnitId: s,
2759
- drawingId: c,
2754
+ drawingId: d,
2760
2755
  drawingType: e.type || k.DRAWING_DOM,
2761
- componentKey: d,
2762
- sheetTransform: a,
2756
+ componentKey: a,
2757
+ sheetTransform: c,
2763
2758
  transform: {
2764
2759
  left: o.startX,
2765
2760
  top: o.startY,
@@ -2769,13 +2764,13 @@ let Xe = class extends Z {
2769
2764
  data: l,
2770
2765
  allowTransform: g
2771
2766
  };
2772
- return this._commandService.executeCommand(Ze.id, {
2767
+ return this._commandService.executeCommand(et.id, {
2773
2768
  unitId: r,
2774
2769
  drawings: [u]
2775
- }), this._add$.next({ unitId: r, subUnitId: s, id: c }), {
2776
- id: c,
2770
+ }), this._add$.next({ unitId: r, subUnitId: s, id: d }), {
2771
+ id: d,
2777
2772
  dispose: () => {
2778
- this._removeDom(c, !0);
2773
+ this._removeDom(d, !0);
2779
2774
  }
2780
2775
  };
2781
2776
  }
@@ -2791,8 +2786,8 @@ let Xe = class extends Z {
2791
2786
  const l = this._drawingManagerService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: e });
2792
2787
  if (!l)
2793
2788
  return;
2794
- const g = this._sheetDrawingService.getBatchRemoveOp([l]), { redo: c, objects: a } = g;
2795
- this._commandService.syncExecuteCommand(O.id, { unitId: r, subUnitId: s, op: c, objects: a, type: T.REMOVE });
2789
+ const g = this._sheetDrawingService.getBatchRemoveOp([l]), { redo: d, objects: c } = g;
2790
+ this._commandService.syncExecuteCommand(O.id, { unitId: r, subUnitId: s, op: d, objects: c, type: E.REMOVE });
2796
2791
  }
2797
2792
  }
2798
2793
  addHook(e) {
@@ -2804,96 +2799,96 @@ let Xe = class extends Z {
2804
2799
  };
2805
2800
  }
2806
2801
  };
2807
- Xe = Bs([
2808
- ce(0, U(X)),
2809
- ce(1, fe),
2810
- ce(2, U(F)),
2811
- ce(3, q),
2812
- ce(4, U(Hr)),
2813
- ce(5, z),
2814
- ce(6, U(nr))
2815
- ], Xe);
2816
- var Pn = Object.defineProperty, Gs = Object.getOwnPropertyDescriptor, Fs = (i, e, n) => e in i ? Pn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, Vs = (i, e, n, t) => {
2817
- for (var r = t > 1 ? void 0 : t ? Gs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2802
+ ze = Ls([
2803
+ de(0, U(X)),
2804
+ de(1, pe),
2805
+ de(2, U(B)),
2806
+ de(3, Q),
2807
+ de(4, U(Yr)),
2808
+ de(5, z),
2809
+ de(6, U(rr))
2810
+ ], ze);
2811
+ var An = Object.defineProperty, Fs = Object.getOwnPropertyDescriptor, Vs = (i, e, n) => e in i ? An(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, ks = (i, e, n, t) => {
2812
+ for (var r = t > 1 ? void 0 : t ? Fs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2818
2813
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
2819
- return t && r && Pn(e, n, r), r;
2820
- }, dt = (i, e) => (n, t) => e(n, t, i), Un = (i, e, n) => Fs(i, typeof e != "symbol" ? e + "" : e, n);
2821
- const ks = "SHEET_IMAGE_UI_PLUGIN";
2822
- let ze = class extends cr {
2823
- constructor(i = Wt, e, n, t) {
2814
+ return t && r && An(e, n, r), r;
2815
+ }, ut = (i, e) => (n, t) => e(n, t, i), Nn = (i, e, n) => Vs(i, typeof e != "symbol" ? e + "" : e, n);
2816
+ const Hs = "SHEET_IMAGE_UI_PLUGIN";
2817
+ let Ke = class extends dr {
2818
+ constructor(i = $t, e, n, t) {
2824
2819
  super(), this._config = i, this._injector = e, this._renderManagerService = n, this._configService = t;
2825
- const { menu: r, ...s } = dr(
2820
+ const { menu: r, ...s } = lr(
2826
2821
  {},
2827
- Wt,
2822
+ $t,
2828
2823
  this._config
2829
2824
  );
2830
- r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(gi, s);
2825
+ r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(mi, s);
2831
2826
  }
2832
2827
  onStarting() {
2833
- lr(this._injector, [
2828
+ ur(this._injector, [
2829
+ [ze],
2834
2830
  [Xe],
2831
+ [Le],
2835
2832
  [Ye],
2836
- [Be],
2837
2833
  [He],
2838
2834
  [ke],
2835
+ [Ge],
2839
2836
  [Ve],
2840
- [Le],
2841
- [Fe],
2842
- [Ge]
2843
- ]), tt(this._injector, [
2844
- [Xe]
2837
+ [Fe]
2838
+ ]), rt(this._injector, [
2839
+ [ze]
2845
2840
  ]);
2846
2841
  }
2847
2842
  onReady() {
2848
- tt(this._injector, [
2849
- [Ve]
2843
+ rt(this._injector, [
2844
+ [ke]
2850
2845
  ]);
2851
2846
  }
2852
2847
  onRendered() {
2853
- this._registerRenderModules(), tt(this._injector, [
2854
- [ke],
2848
+ this._registerRenderModules(), rt(this._injector, [
2855
2849
  [He],
2856
2850
  [Ye],
2857
- [Le],
2858
- [Fe],
2859
- [Ge]
2851
+ [Xe],
2852
+ [Ge],
2853
+ [Ve],
2854
+ [Fe]
2860
2855
  ]);
2861
2856
  }
2862
2857
  onSteady() {
2863
- this._injector.get(Be);
2858
+ this._injector.get(Le);
2864
2859
  }
2865
2860
  _registerRenderModules() {
2866
2861
  [
2867
- [ve],
2868
- [pt],
2869
- [mt]
2862
+ [Se],
2863
+ [wt],
2864
+ [pt]
2870
2865
  ].forEach((i) => {
2871
- this.disposeWithMe(this._renderManagerService.registerRenderModule(G.UNIVER_SHEET, i));
2866
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(F.UNIVER_SHEET, i));
2872
2867
  });
2873
2868
  }
2874
2869
  };
2875
- Un(ze, "type", G.UNIVER_SHEET);
2876
- Un(ze, "pluginName", ks);
2877
- ze = Vs([
2878
- ar(mr, gr, Sr, Dr),
2879
- dt(1, U(Se)),
2880
- dt(2, X),
2881
- dt(3, ur)
2882
- ], ze);
2870
+ Nn(Ke, "type", F.UNIVER_SHEET);
2871
+ Nn(Ke, "pluginName", Hs);
2872
+ Ke = ks([
2873
+ cr(fr, mr, Ir, Dr),
2874
+ ut(1, U(Ie)),
2875
+ ut(2, X),
2876
+ ut(3, hr)
2877
+ ], Ke);
2883
2878
  export {
2884
2879
  W as ClearSheetDrawingTransformerOperation,
2885
- yn as DeleteDrawingsCommand,
2886
- vn as EditSheetDrawingOperation,
2887
- Sn as GroupSheetDrawingCommand,
2888
- vt as InsertFloatImageCommand,
2889
- Ze as InsertSheetDrawingCommand,
2890
- Ce as MoveDrawingsCommand,
2891
- qe as RemoveSheetDrawingCommand,
2892
- Tn as SHEETS_IMAGE_MENU_ID,
2893
- In as SetDrawingArrangeCommand,
2894
- Qe as SetSheetDrawingCommand,
2895
- Xe as SheetCanvasFloatDomManagerService,
2896
- _n as SidebarSheetDrawingOperation,
2897
- Cn as UngroupSheetDrawingCommand,
2898
- ze as UniverSheetsDrawingUIPlugin
2880
+ En as DeleteDrawingsCommand,
2881
+ In as EditSheetDrawingOperation,
2882
+ Cn as GroupSheetDrawingCommand,
2883
+ It as InsertFloatImageCommand,
2884
+ et as InsertSheetDrawingCommand,
2885
+ Re as MoveDrawingsCommand,
2886
+ Qe as RemoveSheetDrawingCommand,
2887
+ Pn as SHEETS_IMAGE_MENU_ID,
2888
+ Rn as SetDrawingArrangeCommand,
2889
+ tt as SetSheetDrawingCommand,
2890
+ ze as SheetCanvasFloatDomManagerService,
2891
+ Sn as SidebarSheetDrawingOperation,
2892
+ Mn as UngroupSheetDrawingCommand,
2893
+ Ke as UniverSheetsDrawingUIPlugin
2899
2894
  };