@univerjs/sheets-drawing-ui 0.5.5-nightly.202501210404 → 0.5.5-nightly.202501210734

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,71 +1,71 @@
1
- var yr = Object.defineProperty;
2
- var Or = (i, e, n) => e in i ? yr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
- var J = (i, e, n) => Or(i, typeof e != "symbol" ? e + "" : e, n);
4
- import { CommandType as q, ICommandService as X, IUndoRedoService as $e, sequenceExecute as Pn, LocaleService as Wt, IUniverInstanceService as ke, useDependency as Me, Inject as N, Injector as Ke, IContextService as Un, RxDisposable as Er, UniverInstanceType as G, connectInjector as Tr, toDisposable as Pr, FOCUSING_COMMON_DRAWINGS as xe, DrawingTypeEnum as L, Disposable as ae, ArrangeTypeEnum as dt, createDocumentModelWithStyle as Ur, ObjectRelativeFromH as Ar, ObjectRelativeFromV as Nr, BooleanNumber as jr, PositionedObjectLayoutType as Wr, WrapTextType as xr, BuildTextUtils as Br, Range as $r, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as lt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as ut, InterceptorEffectEnum as kr, ObjectMatrix as Lr, Tools as ye, UserManagerService as Fr, IPermissionService as Yr, Rectangle as Gr, Direction as ve, FOCUSING_FX_BAR_EDITOR as Xr, EDITOR_ACTIVATED as Vr, FOCUSING_PANEL_EDITOR as Hr, LifecycleService as zr, LifecycleStages as Kr, DisposableCollection as ht, fromEventSubject as Jr, generateRandomId as Gt, DependentOn as Zr, Plugin as qr, merge as Qr, registerDependencies as ei, touchDependencies as Xt, IConfigService as ti } from "@univerjs/core";
5
- import { DocDrawingController as ni, UniverDocsDrawingPlugin as ri } from "@univerjs/docs-drawing";
6
- import { SetDrawingSelectedOperation as xt, IImageIoService as An, IDrawingManagerService as de, DRAWING_IMAGE_ALLOW_IMAGE_LIST as fn, DRAWING_IMAGE_COUNT_LIMIT as pn, ImageUploadStatusType as Ne, DRAWING_IMAGE_ALLOW_SIZE as wn, getImageSize as _n, DRAWING_IMAGE_WIDTH_LIMIT as vn, DRAWING_IMAGE_HEIGHT_LIMIT as Sn, getDrawingShapeKeyByDrawingSearch as Ce, UniverDrawingPlugin as ii } from "@univerjs/drawing";
7
- import { ImageCropperObject as si, COMPONENT_IMAGE_POPUP_MENU as oi, OpenImageCropOperation as ai, ImageResetSizeOperation as ci, DrawingRenderService as Nn, DrawingCommonPanel as di, UniverDrawingUIPlugin as li } from "@univerjs/drawing-ui";
8
- import { IRenderManagerService as Q, precisionTo as gt, getGroupState as ui, transformObjectOutOfGroup as hi, RENDER_CLASS_TYPE as je, Rect as We, ObjectType as In, DRAWING_OBJECT_LAYER_INDEX as Vt, SHEET_VIEWPORT_KEY as jn } from "@univerjs/engine-render";
9
- import { ISheetDrawingService as ee, SetDrawingApplyMutation as P, DrawingApplyType as U, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as gi } from "@univerjs/sheets-drawing";
10
- import { SheetCanvasPopManagerService as mi, convertPositionSheetOverGridToAbsolute as fi, ISheetSelectionRenderService as Je, SheetSkeletonManagerService as H, attachRangeWithCoord as Wn, IEditorBridgeService as pi, IAutoFillService as wi, HoverManagerService as _i, COPY_TYPE as Cn, PREDEFINED_HOOK_NAME as mt, virtualizeDiscreteRanges as vi, ISheetClipboardService as Si, SheetPrintInterceptorService as Ii, getCurrentRangeDisable$ as Ci, SetZoomRatioOperation as bn, SetScrollOperation as bi } from "@univerjs/sheets-ui";
11
- import { ISidebarService as Ri, IUIPartsService as Di, BuiltInUIPart as Mi, ILocalFileService as yi, IMessageService as Oi, MenuItemType as an, getMenuHiddenObservable as xn, RibbonStartGroup as Ei, KeyCode as Be, ComponentManager as Ti, IMenuManagerService as Pi, IShortcutService as Ui, CanvasFloatDomService as Ai } from "@univerjs/ui";
12
- import { takeUntil as Rn, combineLatest as ft, map as He, filter as Se, distinctUntilChanged as pt, Subject as Ht, take as Ni, BehaviorSubject as Ye, switchMap as Dn } from "rxjs";
13
- import { SheetInterceptorService as Bt, getSheetCommandTarget as Y, SheetsSelectionsService as Bn, SetRangeValuesCommand as ji, SetWorksheetRowHeightMutation as $n, SetWorksheetColWidthMutation as kn, SetWorksheetRowIsAutoHeightMutation as Wi, SetWorksheetRowAutoHeightMutation as Ln, AddWorksheetMergeMutation as xi, RemoveWorksheetMergeMutation as Bi, AFTER_CELL_EDIT as $i, INTERCEPTOR_POINT as ki, InterceptCellContentPriority as Li, WorkbookViewPermission as Mn, WorksheetViewPermission as zt, WorkbookEditablePermission as Qt, WorksheetEditPermission as Dt, InsertRowCommand as Fn, InsertColCommand as Yn, RemoveRowCommand as Gn, RemoveColCommand as Xn, DeleteRangeMoveLeftCommand as Vn, DeleteRangeMoveUpCommand as Hn, InsertRangeMoveDownCommand as zn, InsertRangeMoveRightCommand as Kn, DeltaRowHeightCommand as en, SetRowHeightCommand as tn, DeltaColumnWidthCommand as Jn, SetColWidthCommand as Zn, SetRowHiddenCommand as qn, SetSpecificRowsVisibleCommand as Qn, SetSpecificColsVisibleCommand as er, SetColHiddenCommand as tr, MoveColsCommand as nr, MoveRowsCommand as rr, MoveRangeCommand as ir, SetRowVisibleMutation as Fi, SetRowHiddenMutation as Yi, SetColVisibleMutation as Gi, SetColHiddenMutation as Xi, SetWorksheetActiveOperation as Vi, RangeProtectionPermissionEditPoint as Hi, SetFrozenMutation as zi, COMMAND_LISTENER_SKELETON_CHANGE as Ki } from "@univerjs/sheets";
14
- import sr, { useEffect as cn, forwardRef as or, useRef as Ji, createElement as ar, useState as nn } from "react";
15
- import { docDrawingPositionToTransform as Zi, ReplaceSnapshotCommand as qi } from "@univerjs/docs-ui";
16
- import { MessageType as be, RadioGroup as Qi, Radio as Kt } from "@univerjs/design";
17
- const es = "sheets-drawing-ui.config", yn = {}, k = {
1
+ var Er = Object.defineProperty;
2
+ var Pr = (i, e, n) => e in i ? Er(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
+ var K = (i, e, n) => Pr(i, typeof e != "symbol" ? e + "" : e, n);
4
+ import { CommandType as J, ICommandService as F, IUndoRedoService as Fe, sequenceExecute as Nn, LocaleService as $t, IUniverInstanceService as Ye, useDependency as ye, Inject as N, Injector as et, IContextService as jn, RxDisposable as Ur, UniverInstanceType as V, connectInjector as Ar, toDisposable as Nr, FOCUSING_COMMON_DRAWINGS as ke, DrawingTypeEnum as L, Disposable as oe, ArrangeTypeEnum as ft, createDocumentModelWithStyle as jr, ObjectRelativeFromH as Br, ObjectRelativeFromV as Wr, BooleanNumber as xr, PositionedObjectLayoutType as $r, WrapTextType as kr, BuildTextUtils as Lr, Range as Fr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as mt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as pt, InterceptorEffectEnum as Yr, ObjectMatrix as Gr, Tools as Oe, UserManagerService as Xr, IPermissionService as Vr, Rectangle as Hr, Direction as _e, FOCUSING_FX_BAR_EDITOR as zr, EDITOR_ACTIVATED as Kr, FOCUSING_PANEL_EDITOR as Jr, LifecycleService as Zr, LifecycleStages as qr, DisposableCollection as wt, fromEventSubject as Qr, generateRandomId as Ht, DependentOn as ei, Plugin as ti, merge as ni, registerDependencies as ri, touchDependencies as zt, IConfigService as ii } from "@univerjs/core";
5
+ import { DocDrawingController as si, UniverDocsDrawingPlugin as oi } from "@univerjs/docs-drawing";
6
+ import { SetDrawingSelectedOperation as kt, IImageIoService as Bn, IDrawingManagerService as te, DRAWING_IMAGE_ALLOW_IMAGE_LIST as wn, DRAWING_IMAGE_COUNT_LIMIT as _n, ImageUploadStatusType as je, DRAWING_IMAGE_ALLOW_SIZE as vn, getImageSize as Sn, DRAWING_IMAGE_WIDTH_LIMIT as In, DRAWING_IMAGE_HEIGHT_LIMIT as Cn, ImageSourceType as ai, getDrawingShapeKeyByDrawingSearch as Ce, UniverDrawingPlugin as ci } from "@univerjs/drawing";
7
+ import { ImageCropperObject as di, COMPONENT_IMAGE_POPUP_MENU as li, OpenImageCropOperation as ui, ImageResetSizeOperation as hi, DrawingRenderService as Wn, DrawingCommonPanel as gi, UniverDrawingUIPlugin as fi } from "@univerjs/drawing-ui";
8
+ import { IRenderManagerService as Z, precisionTo as _t, getGroupState as mi, transformObjectOutOfGroup as pi, RENDER_CLASS_TYPE as Be, Rect as We, ObjectType as bn, DRAWING_OBJECT_LAYER_INDEX as Kt, SHEET_VIEWPORT_KEY as xn } from "@univerjs/engine-render";
9
+ import { ISheetDrawingService as ne, SetDrawingApplyMutation as P, DrawingApplyType as U, SheetDrawingAnchorType as T, UniverSheetsDrawingPlugin as wi } from "@univerjs/sheets-drawing";
10
+ import { SheetCanvasPopManagerService as _i, convertPositionSheetOverGridToAbsolute as vi, ISheetSelectionRenderService as Ge, SheetSkeletonManagerService as G, attachRangeWithCoord as $n, IEditorBridgeService as Si, IAutoFillService as Ii, HoverManagerService as Ci, PREDEFINED_HOOK_NAME as $e, COPY_TYPE as be, discreteRangeToRange as Rn, virtualizeDiscreteRanges as bi, ISheetClipboardService as Ri, SheetPrintInterceptorService as Di, getCurrentRangeDisable$ as Mi, SetZoomRatioOperation as Dn, SetScrollOperation as yi } from "@univerjs/sheets-ui";
11
+ import { ISidebarService as Oi, IUIPartsService as Ti, BuiltInUIPart as Ei, ILocalFileService as Pi, IMessageService as Ui, IClipboardInterfaceService as Ai, MenuItemType as dn, getMenuHiddenObservable as kn, RibbonStartGroup as Ni, KeyCode as Le, ComponentManager as ji, IMenuManagerService as Bi, IShortcutService as Wi, CanvasFloatDomService as xi } from "@univerjs/ui";
12
+ import { takeUntil as Mn, combineLatest as vt, map as qe, filter as ve, distinctUntilChanged as St, Subject as Jt, take as $i, BehaviorSubject as He, switchMap as yn } from "rxjs";
13
+ import { SheetInterceptorService as Lt, getSheetCommandTarget as X, SheetsSelectionsService as ln, SetRangeValuesCommand as ki, SetWorksheetRowHeightMutation as Ln, SetWorksheetColWidthMutation as Fn, SetWorksheetRowIsAutoHeightMutation as Li, SetWorksheetRowAutoHeightMutation as Yn, AddWorksheetMergeMutation as Fi, RemoveWorksheetMergeMutation as Yi, AFTER_CELL_EDIT as Gi, INTERCEPTOR_POINT as Xi, InterceptCellContentPriority as Vi, WorkbookViewPermission as On, WorksheetViewPermission as Zt, WorkbookEditablePermission as tn, WorksheetEditPermission as Ot, InsertRowCommand as Gn, InsertColCommand as Xn, RemoveRowCommand as Vn, RemoveColCommand as Hn, DeleteRangeMoveLeftCommand as zn, DeleteRangeMoveUpCommand as Kn, InsertRangeMoveDownCommand as Jn, InsertRangeMoveRightCommand as Zn, DeltaRowHeightCommand as nn, SetRowHeightCommand as rn, DeltaColumnWidthCommand as qn, SetColWidthCommand as Qn, SetRowHiddenCommand as er, SetSpecificRowsVisibleCommand as tr, SetSpecificColsVisibleCommand as nr, SetColHiddenCommand as rr, MoveColsCommand as ir, MoveRowsCommand as sr, MoveRangeCommand as or, SetRowVisibleMutation as Hi, SetRowHiddenMutation as zi, SetColVisibleMutation as Ki, SetColHiddenMutation as Ji, SetWorksheetActiveOperation as Zi, RangeProtectionPermissionEditPoint as qi, SetFrozenMutation as Qi, COMMAND_LISTENER_SKELETON_CHANGE as es } from "@univerjs/sheets";
14
+ import ar, { useEffect as un, forwardRef as cr, useRef as ts, createElement as dr, useState as sn } from "react";
15
+ import { docDrawingPositionToTransform as ns, ReplaceSnapshotCommand as rs } from "@univerjs/docs-ui";
16
+ import { MessageType as Re, RadioGroup as is, Radio as qt } from "@univerjs/design";
17
+ const ss = "sheets-drawing-ui.config", Tn = {}, k = {
18
18
  id: "sheet.operation.clear-drawing-transformer",
19
- type: q.MUTATION,
19
+ type: J.MUTATION,
20
20
  handler: (i, e) => {
21
- const n = i.get(Q);
21
+ const n = i.get(Z);
22
22
  return e.forEach((t) => {
23
23
  var r, s;
24
24
  (s = (r = n.getRenderById(t)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
25
25
  }), !0;
26
26
  }
27
- }, $t = {
27
+ }, tt = {
28
28
  id: "sheet.command.remove-sheet-image",
29
- type: q.COMMAND,
29
+ type: J.COMMAND,
30
30
  handler: (i, e) => {
31
31
  var S, I, D;
32
- const n = i.get(X), t = i.get($e), r = i.get(Bt), s = i.get(ee);
32
+ const n = i.get(F), t = i.get(Fe), r = i.get(Lt), s = i.get(ne);
33
33
  if (!e) return !1;
34
- const { drawings: o } = e, c = [];
34
+ const { drawings: o } = e, d = [];
35
35
  o.forEach((v) => {
36
- const { unitId: R } = v;
37
- c.push(R);
36
+ const { unitId: C } = v;
37
+ d.push(C);
38
38
  });
39
- const d = s.getBatchRemoveOp(o), { unitId: g, subUnitId: a, undo: l, redo: h, objects: u } = d, m = r.onCommandExecute({ id: $t.id, params: e }), p = { id: P.id, params: { unitId: g, subUnitId: a, op: h, objects: u, type: U.REMOVE } }, f = { id: P.id, params: { unitId: g, subUnitId: a, op: l, objects: u, type: U.INSERT } };
40
- return Pn([...(S = m.preRedos) != null ? S : [], p, ...m.redos], n) ? (t.pushUndoRedo({
39
+ const a = s.getBatchRemoveOp(o), { unitId: g, subUnitId: c, undo: l, redo: h, objects: u } = a, f = r.onCommandExecute({ id: tt.id, params: e }), p = { id: P.id, params: { unitId: g, subUnitId: c, op: h, objects: u, type: U.REMOVE } }, m = { id: P.id, params: { unitId: g, subUnitId: c, op: l, objects: u, type: U.INSERT } };
40
+ return Nn([...(S = f.preRedos) != null ? S : [], p, ...f.redos], n) ? (t.pushUndoRedo({
41
41
  unitID: g,
42
42
  undoMutations: [
43
- ...(I = m.preUndos) != null ? I : [],
44
- f,
45
- ...m.undos,
46
- { id: k.id, params: c }
43
+ ...(I = f.preUndos) != null ? I : [],
44
+ m,
45
+ ...f.undos,
46
+ { id: k.id, params: d }
47
47
  ],
48
48
  redoMutations: [
49
- ...(D = m.preRedos) != null ? D : [],
49
+ ...(D = f.preRedos) != null ? D : [],
50
50
  p,
51
- ...m.redos,
52
- { id: k.id, params: c }
51
+ ...f.redos,
52
+ { id: k.id, params: d }
53
53
  ]
54
54
  }), !0) : !1;
55
55
  }
56
- }, cr = "COMPONENT_SHEET_DRAWING_PANEL", dr = {
56
+ }, lr = "COMPONENT_SHEET_DRAWING_PANEL", ur = {
57
57
  id: "sidebar.operation.sheet-image",
58
- type: q.COMMAND,
58
+ type: J.COMMAND,
59
59
  handler: async (i, e) => {
60
- const n = i.get(Ri), t = i.get(Wt), r = i.get(ke), s = i.get(X);
61
- if (!Y(r)) return !1;
60
+ const n = i.get(Oi), t = i.get($t), r = i.get(Ye), s = i.get(F);
61
+ if (!X(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: cr },
66
+ children: { label: lr },
67
67
  onClose: () => {
68
- s.syncExecuteCommand(xt.id, []);
68
+ s.syncExecuteCommand(kt.id, []);
69
69
  },
70
70
  width: 360
71
71
  });
@@ -77,15 +77,15 @@ const es = "sheets-drawing-ui.config", yn = {}, k = {
77
77
  }
78
78
  return !0;
79
79
  }
80
- }, lr = {
80
+ }, hr = {
81
81
  id: "sheet.operation.edit-sheet-image",
82
- type: q.OPERATION,
82
+ type: J.OPERATION,
83
83
  handler: (i, e) => {
84
- const n = i.get(X);
85
- return e == null ? !1 : (n.syncExecuteCommand(xt.id, [e]), n.executeCommand(dr.id, { value: "open" }), !0);
84
+ const n = i.get(F);
85
+ return e == null ? !1 : (n.syncExecuteCommand(kt.id, [e]), n.executeCommand(ur.id, { value: "open" }), !0);
86
86
  }
87
87
  };
88
- var Jt = { exports: {} }, Ge = {};
88
+ var Qt = { exports: {} }, ze = {};
89
89
  /**
90
90
  * @license React
91
91
  * react-jsx-runtime.production.min.js
@@ -95,58 +95,58 @@ var Jt = { exports: {} }, Ge = {};
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 On;
99
- function ts() {
100
- if (On) return Ge;
101
- On = 1;
102
- var i = sr, 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(c, d, g) {
104
- var a, l = {}, h = null, u = null;
105
- g !== void 0 && (h = "" + g), d.key !== void 0 && (h = "" + d.key), d.ref !== void 0 && (u = d.ref);
106
- for (a in d) t.call(d, a) && !s.hasOwnProperty(a) && (l[a] = d[a]);
107
- if (c && c.defaultProps) for (a in d = c.defaultProps, d) l[a] === void 0 && (l[a] = d[a]);
108
- return { $$typeof: e, type: c, key: h, ref: u, props: l, _owner: r.current };
109
- }
110
- return Ge.Fragment = n, Ge.jsx = o, Ge.jsxs = o, Ge;
111
- }
112
98
  var En;
113
- function ns() {
114
- return En || (En = 1, Jt.exports = ts()), Jt.exports;
99
+ function os() {
100
+ if (En) return ze;
101
+ En = 1;
102
+ var i = ar, 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, a, g) {
104
+ var c, l = {}, h = null, u = null;
105
+ g !== void 0 && (h = "" + g), a.key !== void 0 && (h = "" + a.key), a.ref !== void 0 && (u = a.ref);
106
+ for (c in a) t.call(a, c) && !s.hasOwnProperty(c) && (l[c] = a[c]);
107
+ if (d && d.defaultProps) for (c in a = d.defaultProps, a) l[c] === void 0 && (l[c] = a[c]);
108
+ return { $$typeof: e, type: d, key: h, ref: u, props: l, _owner: r.current };
109
+ }
110
+ return ze.Fragment = n, ze.jsx = o, ze.jsxs = o, ze;
111
+ }
112
+ var Pn;
113
+ function as() {
114
+ return Pn || (Pn = 1, Qt.exports = os()), Qt.exports;
115
115
  }
116
- var F = ns();
117
- const rs = "univer-upload-loading", is = "univer-upload-loading-body", ss = "univer-upload-loading-body-animation", os = "univer-UniverCircleAnimation", as = "univer-upload-loading-body-text", wt = {
118
- uploadLoading: rs,
119
- uploadLoadingBody: is,
120
- uploadLoadingBodyAnimation: ss,
121
- univerCircleAnimation: os,
122
- uploadLoadingBodyText: as
123
- }, cs = () => {
124
- const i = Me(An), e = Me(Wt), [n, t] = sr.useState(0);
125
- return cn(() => {
116
+ var Y = as();
117
+ const cs = "univer-upload-loading", ds = "univer-upload-loading-body", ls = "univer-upload-loading-body-animation", us = "univer-UniverCircleAnimation", hs = "univer-upload-loading-body-text", It = {
118
+ uploadLoading: cs,
119
+ uploadLoadingBody: ds,
120
+ uploadLoadingBodyAnimation: ls,
121
+ univerCircleAnimation: us,
122
+ uploadLoadingBodyText: hs
123
+ }, gs = () => {
124
+ const i = ye(Bn), e = ye($t), [n, t] = ar.useState(0);
125
+ return un(() => {
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__ */ F.jsx("div", { style: { display: n > 0 ? "block" : "none" }, className: wt.uploadLoading, children: /* @__PURE__ */ F.jsxs("div", { className: wt.uploadLoadingBody, children: [
133
- /* @__PURE__ */ F.jsx("div", { className: wt.uploadLoadingBodyAnimation }),
134
- /* @__PURE__ */ F.jsx("div", { className: wt.uploadLoadingBodyText, children: `${e.t("uploadLoading.loading")}: ${n}` })
132
+ }, [i]), /* @__PURE__ */ Y.jsx("div", { style: { display: n > 0 ? "block" : "none" }, className: It.uploadLoading, children: /* @__PURE__ */ Y.jsxs("div", { className: It.uploadLoadingBody, children: [
133
+ /* @__PURE__ */ Y.jsx("div", { className: It.uploadLoadingBodyAnimation }),
134
+ /* @__PURE__ */ Y.jsx("div", { className: It.uploadLoadingBodyText, children: `${e.t("uploadLoading.loading")}: ${n}` })
135
135
  ] }) });
136
136
  };
137
- var ds = Object.defineProperty, ls = Object.getOwnPropertyDescriptor, us = (i, e, n, t) => {
138
- for (var r = t > 1 ? void 0 : t ? ls(e, n) : e, s = i.length - 1, o; s >= 0; s--)
137
+ var fs = Object.defineProperty, ms = Object.getOwnPropertyDescriptor, ps = (i, e, n, t) => {
138
+ for (var r = t > 1 ? void 0 : t ? ms(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 && ds(e, n, r), r;
141
- }, pe = (i, e) => (n, t) => e(n, t, i);
142
- let Mt = class extends Er {
143
- constructor(e, n, t, r, s, o, c, d) {
140
+ return t && r && fs(e, n, r), r;
141
+ }, me = (i, e) => (n, t) => e(n, t, i);
142
+ let Tt = class extends Ur {
143
+ constructor(e, n, t, r, s, o, d, a) {
144
144
  super();
145
- J(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 = c, this._commandService = d, this._init();
145
+ K(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._commandService = a, this._init();
147
147
  }
148
148
  _init() {
149
- this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET).pipe(Rn(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_SHEET).pipe(Rn(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(G.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(Mi.CONTENT, () => Tr(cs, this._injector));
149
+ this._univerInstanceService.getCurrentTypeOfUnit$(V.UNIVER_SHEET).pipe(Mn(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(V.UNIVER_SHEET).pipe(Mn(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(V.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(Ei.CONTENT, () => Ar(gs, this._injector));
150
150
  }
151
151
  _dispose(e) {
152
152
  const n = e.getUnitId();
@@ -161,7 +161,7 @@ let Mt = class extends Er {
161
161
  _hasCropObject(e) {
162
162
  const n = e.getAllObjectsByOrder();
163
163
  for (const t of n)
164
- if (t instanceof si)
164
+ if (t instanceof di)
165
165
  return !0;
166
166
  return !1;
167
167
  }
@@ -175,43 +175,43 @@ let Mt = class extends Er {
175
175
  return;
176
176
  let r;
177
177
  this.disposeWithMe(
178
- Pr(
178
+ Nr(
179
179
  t.createControl$.subscribe(() => {
180
- if (this._contextService.setContextValue(xe, !0), this._hasCropObject(n))
180
+ if (this._contextService.setContextValue(ke, !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 c = o.values().next().value;
188
- if (!c)
187
+ const d = o.values().next().value;
188
+ if (!d)
189
189
  return;
190
- const d = c.oKey, g = this._drawingManagerService.getDrawingOKey(d);
190
+ const a = d.oKey, g = this._drawingManagerService.getDrawingOKey(a);
191
191
  if (!g)
192
192
  return;
193
- const { unitId: a, subUnitId: l, drawingId: h, drawingType: u } = g, m = g.data;
194
- if (m && m.disablePopup)
193
+ const { unitId: c, subUnitId: l, drawingId: h, drawingType: u } = g, f = g.data;
194
+ if (f && f.disablePopup)
195
195
  return;
196
196
  r == null || r.dispose();
197
- const p = this._canvasPopManagerService.getFeatureMenu(a, l, h, u);
198
- r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(c, {
199
- componentKey: oi,
197
+ const p = this._canvasPopManagerService.getFeatureMenu(c, l, h, u);
198
+ r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(d, {
199
+ componentKey: li,
200
200
  direction: "horizontal",
201
201
  offset: [2, 0],
202
202
  extraProps: {
203
- menuItems: p || this._getImageMenuItems(a, l, h, u)
203
+ menuItems: p || this._getImageMenuItems(c, l, h, u)
204
204
  }
205
205
  }));
206
206
  })
207
207
  )
208
208
  ), this.disposeWithMe(
209
209
  t.clearControl$.subscribe(() => {
210
- r == null || r.dispose(), this._contextService.setContextValue(xe, !1), this._commandService.syncExecuteCommand(xt.id, []);
210
+ r == null || r.dispose(), this._contextService.setContextValue(ke, !1), this._commandService.syncExecuteCommand(kt.id, []);
211
211
  })
212
212
  ), this.disposeWithMe(
213
213
  this._contextService.contextChanged$.subscribe((o) => {
214
- o[xe] === !1 && (r == null || r.dispose());
214
+ o[ke] === !1 && (r == null || r.dispose());
215
215
  })
216
216
  ), this.disposeWithMe(
217
217
  t.changing$.subscribe(() => {
@@ -224,102 +224,102 @@ let Mt = class extends Er {
224
224
  {
225
225
  label: "image-popup.edit",
226
226
  index: 0,
227
- commandId: lr.id,
227
+ commandId: hr.id,
228
228
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
229
229
  disable: r === L.DRAWING_DOM
230
230
  },
231
231
  {
232
232
  label: "image-popup.delete",
233
233
  index: 1,
234
- commandId: $t.id,
234
+ commandId: tt.id,
235
235
  commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId: n, drawingId: t }] },
236
236
  disable: !1
237
237
  },
238
238
  {
239
239
  label: "image-popup.crop",
240
240
  index: 2,
241
- commandId: ai.id,
241
+ commandId: ui.id,
242
242
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
243
243
  disable: r === L.DRAWING_DOM
244
244
  },
245
245
  {
246
246
  label: "image-popup.reset",
247
247
  index: 3,
248
- commandId: ci.id,
248
+ commandId: hi.id,
249
249
  commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
250
250
  disable: r === L.DRAWING_DOM
251
251
  }
252
252
  ];
253
253
  }
254
254
  };
255
- Mt = us([
256
- pe(0, N(Ke)),
257
- pe(1, de),
258
- pe(2, N(mi)),
259
- pe(3, Q),
260
- pe(4, ke),
261
- pe(5, Un),
262
- pe(6, N(Di)),
263
- pe(7, X)
264
- ], Mt);
265
- function V(i, e, n) {
266
- const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: c = 0, skewX: d = 0, skewY: g = 0 } = i, a = n.getCurrent();
267
- if (a == null)
255
+ Tt = ps([
256
+ me(0, N(et)),
257
+ me(1, te),
258
+ me(2, N(_i)),
259
+ me(3, Z),
260
+ me(4, Ye),
261
+ me(5, jn),
262
+ me(6, N(Ti)),
263
+ me(7, F)
264
+ ], Tt);
265
+ function H(i, e, n) {
266
+ const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: d = 0, skewX: a = 0, skewY: g = 0 } = i, c = n.getCurrent();
267
+ if (c == null)
268
268
  return;
269
- const l = fi(
270
- a.unitId,
271
- a.sheetId,
269
+ const l = vi(
270
+ c.unitId,
271
+ c.sheetId,
272
272
  { from: t, to: r },
273
273
  n
274
274
  );
275
- let { left: h, top: u, width: m, height: p } = l;
276
- const f = n.getCurrentSkeleton(), w = f.rowHeaderWidth + f.columnTotalWidth, S = f.columnHeaderHeight + f.rowTotalHeight;
277
- return h + m > w && (h = w - m), u + p > S && (u = S - p), {
275
+ let { left: h, top: u, width: f, height: p } = l;
276
+ const m = n.getCurrentSkeleton(), w = m.rowHeaderWidth + m.columnTotalWidth, S = m.columnHeaderHeight + m.rowTotalHeight;
277
+ return h + f > w && (h = w - f), u + p > S && (u = S - p), {
278
278
  flipY: s,
279
279
  flipX: o,
280
- angle: c,
281
- skewX: d,
280
+ angle: d,
281
+ skewX: a,
282
282
  skewY: g,
283
283
  left: h,
284
284
  top: u,
285
- width: m,
285
+ width: f,
286
286
  height: p
287
287
  };
288
288
  }
289
- function $(i, e) {
290
- const { left: n = 0, top: t = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: c = !1, angle: d = 0, skewX: g = 0, skewY: a = 0 } = i, l = e.getCellWithCoordByOffset(n, t);
289
+ function x(i, e) {
290
+ const { left: n = 0, top: t = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: d = !1, angle: a = 0, skewX: g = 0, skewY: c = 0 } = i, l = e.getCellWithCoordByOffset(n, t);
291
291
  if (l == null)
292
292
  return;
293
293
  const h = {
294
294
  column: l.actualColumn,
295
- columnOffset: gt(n - l.startX, 1),
295
+ columnOffset: _t(n - l.startX, 1),
296
296
  row: l.actualRow,
297
- rowOffset: gt(t - l.startY, 1)
297
+ rowOffset: _t(t - l.startY, 1)
298
298
  }, u = e.getCellWithCoordByOffset(n + r, t + s);
299
299
  if (u == null)
300
300
  return;
301
- const m = {
301
+ const f = {
302
302
  column: u.actualColumn,
303
- columnOffset: gt(n + r - u.startX, 1),
303
+ columnOffset: _t(n + r - u.startX, 1),
304
304
  row: u.actualRow,
305
- rowOffset: gt(t + s - u.startY, 1)
305
+ rowOffset: _t(t + s - u.startY, 1)
306
306
  };
307
307
  return {
308
308
  flipY: o,
309
- flipX: c,
310
- angle: d,
309
+ flipX: d,
310
+ angle: a,
311
311
  skewX: g,
312
- skewY: a,
312
+ skewY: c,
313
313
  from: h,
314
- to: m
314
+ to: f
315
315
  };
316
316
  }
317
- var hs = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, ms = (i, e, n, t) => {
318
- for (var r = t > 1 ? void 0 : t ? gs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
317
+ var ws = Object.defineProperty, _s = Object.getOwnPropertyDescriptor, vs = (i, e, n, t) => {
318
+ for (var r = t > 1 ? void 0 : t ? _s(e, n) : e, s = i.length - 1, o; s >= 0; s--)
319
319
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
320
- return t && r && hs(e, n, r), r;
321
- }, _t = (i, e) => (n, t) => e(n, t, i);
322
- let rn = class extends ae {
320
+ return t && r && ws(e, n, r), r;
321
+ }, Ct = (i, e) => (n, t) => e(n, t, i);
322
+ let on = class extends oe {
323
323
  constructor(i, e, n, t, r) {
324
324
  super(), this._context = i, this._sheetDrawingService = e, this._drawingManagerService = n, this._sheetSelectionRenderService = t, this._sheetSkeletonManagerService = r, this._init();
325
325
  }
@@ -333,66 +333,66 @@ let rn = class extends ae {
333
333
  const n = i[e];
334
334
  for (const t in n.data) {
335
335
  const r = n.data[t];
336
- r.transform = V(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
336
+ r.transform = H(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
337
337
  }
338
338
  }
339
339
  this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
340
340
  }
341
341
  };
342
- rn = ms([
343
- _t(1, ee),
344
- _t(2, de),
345
- _t(3, N(Je)),
346
- _t(4, N(H))
347
- ], rn);
348
- function fs(i) {
342
+ on = vs([
343
+ Ct(1, ne),
344
+ Ct(2, te),
345
+ Ct(3, N(Ge)),
346
+ Ct(4, N(G))
347
+ ], on);
348
+ function Ss(i) {
349
349
  const e = [];
350
350
  return i.forEach((n) => {
351
- const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: c } = t, d = ui(0, 0, r.map((l) => l.transform || {})), g = r.map((l) => {
352
- const h = l.transform || { left: 0, top: 0 }, { unitId: u, subUnitId: m, drawingId: p } = l;
351
+ const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: d } = t, a = mi(0, 0, r.map((l) => l.transform || {})), g = r.map((l) => {
352
+ const h = l.transform || { left: 0, top: 0 }, { unitId: u, subUnitId: f, drawingId: p } = l;
353
353
  return {
354
354
  unitId: u,
355
- subUnitId: m,
355
+ subUnitId: f,
356
356
  drawingId: p,
357
357
  transform: {
358
358
  ...h,
359
- left: h.left - d.left,
360
- top: h.top - d.top
359
+ left: h.left - a.left,
360
+ top: h.top - a.top
361
361
  },
362
- groupId: c
362
+ groupId: d
363
363
  };
364
- }), a = {
364
+ }), c = {
365
365
  unitId: s,
366
366
  subUnitId: o,
367
- drawingId: c,
367
+ drawingId: d,
368
368
  drawingType: L.DRAWING_GROUP,
369
- transform: d
369
+ transform: a
370
370
  };
371
371
  e.push({
372
- parent: a,
372
+ parent: c,
373
373
  children: g
374
374
  });
375
375
  }), e;
376
376
  }
377
- function ps(i) {
377
+ function Is(i) {
378
378
  const e = [];
379
379
  return i.forEach((n) => {
380
- const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: c, transform: d = { width: 0, height: 0 } } = t;
381
- if (d == null)
380
+ const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: d, transform: a = { width: 0, height: 0 } } = t;
381
+ if (a == null)
382
382
  return;
383
383
  const g = r.map((l) => {
384
- const { transform: h } = l, { unitId: u, subUnitId: m, drawingId: p } = l, f = hi(h || {}, d, d.width || 0, d.height || 0);
384
+ const { transform: h } = l, { unitId: u, subUnitId: f, drawingId: p } = l, m = pi(h || {}, a, a.width || 0, a.height || 0);
385
385
  return {
386
386
  unitId: u,
387
- subUnitId: m,
387
+ subUnitId: f,
388
388
  drawingId: p,
389
- transform: f,
389
+ transform: m,
390
390
  groupId: void 0
391
391
  };
392
- }), a = {
392
+ }), c = {
393
393
  unitId: s,
394
394
  subUnitId: o,
395
- drawingId: c,
395
+ drawingId: d,
396
396
  drawingType: L.DRAWING_GROUP,
397
397
  transform: {
398
398
  left: 0,
@@ -400,71 +400,71 @@ function ps(i) {
400
400
  }
401
401
  };
402
402
  e.push({
403
- parent: a,
403
+ parent: c,
404
404
  children: g
405
405
  });
406
406
  }), e;
407
407
  }
408
- const ur = {
408
+ const gr = {
409
409
  id: "sheet.command.group-sheet-image",
410
- type: q.COMMAND,
410
+ type: J.COMMAND,
411
411
  handler: (i, e) => {
412
- const n = i.get(X), t = i.get($e), r = i.get(ee);
412
+ const n = i.get(F), t = i.get(Fe), r = i.get(ne);
413
413
  if (!e) return !1;
414
414
  const s = [];
415
- e.forEach(({ parent: u, children: m }) => {
416
- s.push(u.unitId), m.forEach((p) => {
415
+ e.forEach(({ parent: u, children: f }) => {
416
+ s.push(u.unitId), f.forEach((p) => {
417
417
  s.push(p.unitId);
418
418
  });
419
419
  });
420
- const o = r.getGroupDrawingOp(e), { unitId: c, subUnitId: d, undo: g, redo: a, objects: l } = o;
421
- return n.syncExecuteCommand(P.id, { op: a, unitId: c, subUnitId: d, objects: l, type: U.GROUP }) ? (t.pushUndoRedo({
422
- unitID: c,
420
+ const o = r.getGroupDrawingOp(e), { unitId: d, subUnitId: a, undo: g, redo: c, objects: l } = o;
421
+ return n.syncExecuteCommand(P.id, { op: c, unitId: d, subUnitId: a, objects: l, type: U.GROUP }) ? (t.pushUndoRedo({
422
+ unitID: d,
423
423
  undoMutations: [
424
- { id: P.id, params: { op: g, unitId: c, subUnitId: d, objects: ps(l), type: U.UNGROUP } },
424
+ { id: P.id, params: { op: g, unitId: d, subUnitId: a, objects: Is(l), type: U.UNGROUP } },
425
425
  { id: k.id, params: s }
426
426
  ],
427
427
  redoMutations: [
428
- { id: P.id, params: { op: a, unitId: c, subUnitId: d, objects: l, type: U.GROUP } },
428
+ { id: P.id, params: { op: c, unitId: d, subUnitId: a, objects: l, type: U.GROUP } },
429
429
  { id: k.id, params: s }
430
430
  ]
431
431
  }), !0) : !1;
432
432
  }
433
- }, kt = {
433
+ }, Ft = {
434
434
  id: "sheet.command.insert-sheet-image",
435
- type: q.COMMAND,
435
+ type: J.COMMAND,
436
436
  handler: (i, e) => {
437
437
  var S, I, D;
438
- const n = i.get(X), t = i.get($e), r = i.get(ee), s = i.get(Bt);
438
+ const n = i.get(F), t = i.get(Fe), r = i.get(ne), s = i.get(Lt);
439
439
  if (!e) return !1;
440
- const o = e.drawings, c = o.map((v) => v.unitId), d = r.getBatchAddOp(o), { unitId: g, subUnitId: a, undo: l, redo: h, objects: u } = d, m = s.onCommandExecute({ id: kt.id, params: e }), p = { id: P.id, params: { op: h, unitId: g, subUnitId: a, objects: u, type: U.INSERT } }, f = { id: P.id, params: { op: l, unitId: g, subUnitId: a, objects: u, type: U.REMOVE } };
441
- return Pn([...(S = m.preRedos) != null ? S : [], p, ...m.redos], n) ? (t.pushUndoRedo({
440
+ const o = e.drawings, d = o.map((v) => v.unitId), a = r.getBatchAddOp(o), { unitId: g, subUnitId: c, undo: l, redo: h, objects: u } = a, f = s.onCommandExecute({ id: Ft.id, params: e }), p = { id: P.id, params: { op: h, unitId: g, subUnitId: c, objects: u, type: U.INSERT } }, m = { id: P.id, params: { op: l, unitId: g, subUnitId: c, objects: u, type: U.REMOVE } };
441
+ return Nn([...(S = f.preRedos) != null ? S : [], p, ...f.redos], n) ? (t.pushUndoRedo({
442
442
  unitID: g,
443
443
  undoMutations: [
444
- ...(I = m.preUndos) != null ? I : [],
445
- f,
446
- ...m.undos,
447
- { id: k.id, params: c }
444
+ ...(I = f.preUndos) != null ? I : [],
445
+ m,
446
+ ...f.undos,
447
+ { id: k.id, params: d }
448
448
  ],
449
449
  redoMutations: [
450
- ...(D = m.preRedos) != null ? D : [],
450
+ ...(D = f.preRedos) != null ? D : [],
451
451
  p,
452
- ...m.redos,
453
- { id: k.id, params: c }
452
+ ...f.redos,
453
+ { id: k.id, params: d }
454
454
  ]
455
455
  }), !0) : !1;
456
456
  }
457
- }, hr = {
457
+ }, fr = {
458
458
  id: "sheet.command.set-drawing-arrange",
459
- type: q.COMMAND,
459
+ type: J.COMMAND,
460
460
  handler: (i, e) => {
461
- const n = i.get(X), t = i.get($e);
461
+ const n = i.get(F), t = i.get(Fe);
462
462
  if (!e) return !1;
463
- const r = i.get(ee), { unitId: s, subUnitId: o, drawingIds: c, arrangeType: d } = e, g = { unitId: s, subUnitId: o, drawingIds: c };
464
- let a;
465
- if (d === dt.forward ? a = r.getForwardDrawingsOp(g) : d === dt.backward ? a = r.getBackwardDrawingOp(g) : d === dt.front ? a = r.getFrontDrawingsOp(g) : d === dt.back && (a = r.getBackDrawingsOp(g)), a == null)
463
+ const r = i.get(ne), { unitId: s, subUnitId: o, drawingIds: d, arrangeType: a } = e, g = { unitId: s, subUnitId: o, drawingIds: d };
464
+ let c;
465
+ if (a === ft.forward ? c = r.getForwardDrawingsOp(g) : a === ft.backward ? c = r.getBackwardDrawingOp(g) : a === ft.front ? c = r.getFrontDrawingsOp(g) : a === ft.back && (c = r.getBackDrawingsOp(g)), c == null)
466
466
  return !1;
467
- const { objects: l, redo: h, undo: u } = a;
467
+ const { objects: l, redo: h, undo: u } = c;
468
468
  return n.syncExecuteCommand(P.id, { op: h, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE }) ? (t.pushUndoRedo({
469
469
  unitID: s,
470
470
  undoMutations: [
@@ -475,137 +475,137 @@ const ur = {
475
475
  ]
476
476
  }), !0) : !1;
477
477
  }
478
- }, Lt = {
478
+ }, Yt = {
479
479
  id: "sheet.command.set-sheet-image",
480
- type: q.COMMAND,
480
+ type: J.COMMAND,
481
481
  handler: (i, e) => {
482
- const n = i.get(X), t = i.get($e), r = i.get(ee);
482
+ const n = i.get(F), t = i.get(Fe), r = i.get(ne);
483
483
  if (!e) return !1;
484
- const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: c, subUnitId: d, undo: g, redo: a, objects: l } = o;
485
- return n.syncExecuteCommand(P.id, { unitId: c, subUnitId: d, op: a, objects: l, type: U.UPDATE }) ? (t.pushUndoRedo({
486
- unitID: c,
484
+ const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: d, subUnitId: a, undo: g, redo: c, objects: l } = o;
485
+ return n.syncExecuteCommand(P.id, { unitId: d, subUnitId: a, op: c, objects: l, type: U.UPDATE }) ? (t.pushUndoRedo({
486
+ unitID: d,
487
487
  undoMutations: [
488
- { id: P.id, params: { unitId: c, subUnitId: d, op: g, objects: l, type: U.UPDATE } },
489
- { id: k.id, params: [c] }
488
+ { id: P.id, params: { unitId: d, subUnitId: a, op: g, objects: l, type: U.UPDATE } },
489
+ { id: k.id, params: [d] }
490
490
  ],
491
491
  redoMutations: [
492
- { id: P.id, params: { unitId: c, subUnitId: d, op: a, objects: l, type: U.UPDATE } },
493
- { id: k.id, params: [c] }
492
+ { id: P.id, params: { unitId: d, subUnitId: a, op: c, objects: l, type: U.UPDATE } },
493
+ { id: k.id, params: [d] }
494
494
  ]
495
495
  }), !0) : !1;
496
496
  }
497
- }, gr = {
497
+ }, mr = {
498
498
  id: "sheet.command.ungroup-sheet-image",
499
- type: q.COMMAND,
499
+ type: J.COMMAND,
500
500
  handler: (i, e) => {
501
- const n = i.get(X), t = i.get($e), r = i.get(ee);
501
+ const n = i.get(F), t = i.get(Fe), r = i.get(ne);
502
502
  if (!e) return !1;
503
503
  const s = [];
504
- e.forEach(({ parent: u, children: m }) => {
505
- s.push(u.unitId), m.forEach((p) => {
504
+ e.forEach(({ parent: u, children: f }) => {
505
+ s.push(u.unitId), f.forEach((p) => {
506
506
  s.push(p.unitId);
507
507
  });
508
508
  });
509
- const o = r.getUngroupDrawingOp(e), { unitId: c, subUnitId: d, undo: g, redo: a, objects: l } = o;
510
- return n.syncExecuteCommand(P.id, { op: a, unitId: c, subUnitId: d, objects: l, type: U.UNGROUP }) ? (t.pushUndoRedo({
511
- unitID: c,
509
+ const o = r.getUngroupDrawingOp(e), { unitId: d, subUnitId: a, undo: g, redo: c, objects: l } = o;
510
+ return n.syncExecuteCommand(P.id, { op: c, unitId: d, subUnitId: a, objects: l, type: U.UNGROUP }) ? (t.pushUndoRedo({
511
+ unitID: d,
512
512
  undoMutations: [
513
- { id: P.id, params: { op: g, unitId: c, subUnitId: d, objects: fs(l), type: U.GROUP } },
513
+ { id: P.id, params: { op: g, unitId: d, subUnitId: a, objects: Ss(l), type: U.GROUP } },
514
514
  { id: k.id, params: s }
515
515
  ],
516
516
  redoMutations: [
517
- { id: P.id, params: { op: a, unitId: c, subUnitId: d, objects: l, type: U.UNGROUP } },
517
+ { id: P.id, params: { op: c, unitId: d, subUnitId: a, objects: l, type: U.UNGROUP } },
518
518
  { id: k.id, params: s }
519
519
  ]
520
520
  }), !0) : !1;
521
521
  }
522
522
  };
523
- var ws = Object.defineProperty, _s = Object.getOwnPropertyDescriptor, vs = (i, e, n, t) => {
524
- for (var r = t > 1 ? void 0 : t ? _s(e, n) : e, s = i.length - 1, o; s >= 0; s--)
523
+ var Cs = Object.defineProperty, bs = Object.getOwnPropertyDescriptor, Rs = (i, e, n, t) => {
524
+ for (var r = t > 1 ? void 0 : t ? bs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
525
525
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
526
- return t && r && ws(e, n, r), r;
527
- }, ne = (i, e) => (n, t) => e(n, t, i);
528
- function Ss(i, e, n) {
526
+ return t && r && Cs(e, n, r), r;
527
+ }, Q = (i, e) => (n, t) => e(n, t, i);
528
+ function Ds(i, e, n) {
529
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));
530
530
  return { rotatedWidth: r, rotatedHeight: s };
531
531
  }
532
- function mr(i, e, n, t, r) {
532
+ function pr(i, e, n, t, r) {
533
533
  var S;
534
- const { rotatedHeight: s, rotatedWidth: o } = Ss(n, t, r), d = i.get(Q).getRenderById(e.unitId);
535
- if (!d)
534
+ const { rotatedHeight: s, rotatedWidth: o } = Ds(n, t, r), a = i.get(Z).getRenderById(e.unitId);
535
+ if (!a)
536
536
  return !1;
537
- const a = (S = d.with(H).getWorksheetSkeleton(e.subUnitId)) == null ? void 0 : S.skeleton;
538
- if (a == null)
537
+ const c = (S = a.with(G).getWorksheetSkeleton(e.subUnitId)) == null ? void 0 : S.skeleton;
538
+ if (c == null)
539
539
  return !1;
540
- const l = a.getCellByIndex(e.row, e.col), h = l.mergeInfo.endX - l.mergeInfo.startX - 2, u = l.mergeInfo.endY - l.mergeInfo.startY - 2, m = o / s, f = Math.ceil(Math.min(h, u * m)) / o, w = !f || Number.isNaN(f) ? 1e-3 : f;
540
+ const l = c.getCellByIndex(e.row, e.col), h = l.mergeInfo.endX - l.mergeInfo.startX - 2, u = l.mergeInfo.endY - l.mergeInfo.startY - 2, f = o / s, m = Math.ceil(Math.min(h, u * f)) / o, w = !m || Number.isNaN(m) ? 1e-3 : m;
541
541
  return {
542
542
  width: n * w,
543
543
  height: t * w
544
544
  };
545
545
  }
546
- let ze = class extends ae {
547
- constructor(e, n, t, r, s, o, c, d, g, a, l, h, u) {
546
+ let Qe = class extends oe {
547
+ constructor(e, n, t, r, s, o, d, a, g, c, l, h, u) {
548
548
  super();
549
- J(this, "_workbookSelections");
550
- this._context = e, this._skeletonManagerService = n, this._commandService = t, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = c, this._drawingManagerService = d, this._contextService = g, this._messageService = a, this._localeService = l, this._injector = u, this._workbookSelections = h.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
549
+ K(this, "_workbookSelections");
550
+ this._context = e, this._skeletonManagerService = n, this._commandService = t, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = d, this._drawingManagerService = a, this._contextService = g, this._messageService = c, this._localeService = l, this._injector = u, this._workbookSelections = h.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
551
551
  }
552
552
  async insertFloatImage() {
553
553
  const e = await this._fileOpenerService.openFile({
554
554
  multiple: !0,
555
- accept: fn.map((t) => `.${t.replace("image/", "")}`).join(",")
555
+ accept: wn.map((t) => `.${t.replace("image/", "")}`).join(",")
556
556
  }), n = e.length;
557
- return n > pn ? (this._messageService.show({
558
- type: be.Error,
559
- content: this._localeService.t("update-status.exceedMaxCount", String(pn))
560
- }), !1) : n === 0 ? !1 : (e.forEach(async (t) => await this._insertFloatImage(t)), !0);
557
+ return n > _n ? (this._messageService.show({
558
+ type: Re.Error,
559
+ content: this._localeService.t("update-status.exceedMaxCount", String(_n))
560
+ }), !1) : n === 0 ? !1 : (e.forEach(async (t) => await this.insertFloatImageByFile(t)), !0);
561
561
  }
562
562
  async insertCellImage() {
563
563
  const n = (await this._fileOpenerService.openFile({
564
564
  multiple: !1,
565
- accept: fn.map((t) => `.${t.replace("image/", "")}`).join(",")
565
+ accept: wn.map((t) => `.${t.replace("image/", "")}`).join(",")
566
566
  }))[0];
567
567
  return n ? (await this._insertCellImage(n), !0) : !1;
568
568
  }
569
- async _insertFloatImage(e) {
569
+ async insertFloatImageByFile(e) {
570
570
  let n;
571
571
  try {
572
572
  n = await this._imageIoService.saveImage(e);
573
573
  } catch (S) {
574
574
  const I = S.message;
575
- I === Ne.ERROR_EXCEED_SIZE ? this._messageService.show({
576
- type: be.Error,
577
- content: this._localeService.t("update-status.exceedMaxSize", String(wn / (1024 * 1024)))
578
- }) : I === Ne.ERROR_IMAGE_TYPE ? this._messageService.show({
579
- type: be.Error,
575
+ I === je.ERROR_EXCEED_SIZE ? this._messageService.show({
576
+ type: Re.Error,
577
+ content: this._localeService.t("update-status.exceedMaxSize", String(vn / (1024 * 1024)))
578
+ }) : I === je.ERROR_IMAGE_TYPE ? this._messageService.show({
579
+ type: Re.Error,
580
580
  content: this._localeService.t("update-status.invalidImageType")
581
- }) : I === Ne.ERROR_IMAGE && this._messageService.show({
582
- type: be.Error,
581
+ }) : I === je.ERROR_IMAGE && this._messageService.show({
582
+ type: Re.Error,
583
583
  content: this._localeService.t("update-status.invalidImage")
584
584
  });
585
585
  }
586
586
  if (n == null)
587
587
  return;
588
- const t = this._getUnitInfo(), { unitId: r, subUnitId: s } = t, { imageId: o, imageSourceType: c, source: d, base64Cache: g } = n, { width: a, height: l, image: h } = await _n(g || ""), { width: u, height: m } = this._context.scene;
589
- this._imageIoService.addImageSourceCache(d, c, h);
588
+ const t = this._getUnitInfo(), { unitId: r, subUnitId: s } = t, { imageId: o, imageSourceType: d, source: a, base64Cache: g } = n, { width: c, height: l, image: h } = await Sn(g || ""), { width: u, height: f } = this._context.scene;
589
+ this._imageIoService.addImageSourceCache(a, d, h);
590
590
  let p = 1;
591
- if (a > vn || l > Sn) {
592
- const S = vn / a, I = Sn / l;
591
+ if (c > In || l > Cn) {
592
+ const S = In / c, I = Cn / l;
593
593
  p = Math.max(S, I);
594
594
  }
595
- const f = this._getImagePosition(a * p, l * p, u, m);
596
- if (f == null)
595
+ const m = this._getImagePosition(c * p, l * p, u, f);
596
+ if (m == null)
597
597
  return;
598
598
  const w = {
599
599
  unitId: r,
600
600
  subUnitId: s,
601
601
  drawingId: o,
602
602
  drawingType: L.DRAWING_IMAGE,
603
- imageSourceType: c,
604
- source: d,
605
- transform: V(f, this._selectionRenderService, this._skeletonManagerService),
606
- sheetTransform: f
603
+ imageSourceType: d,
604
+ source: a,
605
+ transform: H(m, this._selectionRenderService, this._skeletonManagerService),
606
+ sheetTransform: m
607
607
  };
608
- this._commandService.executeCommand(kt.id, {
608
+ return this._commandService.executeCommand(Ft.id, {
609
609
  unitId: r,
610
610
  drawings: [w]
611
611
  });
@@ -615,36 +615,36 @@ let ze = class extends ae {
615
615
  let n;
616
616
  try {
617
617
  n = await this._imageIoService.saveImage(e);
618
- } catch (f) {
619
- const w = f.message;
620
- w === Ne.ERROR_EXCEED_SIZE ? this._messageService.show({
621
- type: be.Error,
622
- content: this._localeService.t("update-status.exceedMaxSize", String(wn / (1024 * 1024)))
623
- }) : w === Ne.ERROR_IMAGE_TYPE ? this._messageService.show({
624
- type: be.Error,
618
+ } catch (m) {
619
+ const w = m.message;
620
+ w === je.ERROR_EXCEED_SIZE ? this._messageService.show({
621
+ type: Re.Error,
622
+ content: this._localeService.t("update-status.exceedMaxSize", String(vn / (1024 * 1024)))
623
+ }) : w === je.ERROR_IMAGE_TYPE ? this._messageService.show({
624
+ type: Re.Error,
625
625
  content: this._localeService.t("update-status.invalidImageType")
626
- }) : w === Ne.ERROR_IMAGE && this._messageService.show({
627
- type: be.Error,
626
+ }) : w === je.ERROR_IMAGE && this._messageService.show({
627
+ type: Re.Error,
628
628
  content: this._localeService.t("update-status.invalidImage")
629
629
  });
630
630
  }
631
631
  if (n == null)
632
632
  return;
633
- const { imageId: t, imageSourceType: r, source: s, base64Cache: o } = n, { width: c, height: d, image: g } = await _n(o || "");
633
+ const { imageId: t, imageSourceType: r, source: s, base64Cache: o } = n, { width: d, height: a, image: g } = await Sn(o || "");
634
634
  this._imageIoService.addImageSourceCache(s, r, g);
635
- const a = this._workbookSelections.getCurrentLastSelection();
636
- if (!a)
635
+ const c = this._workbookSelections.getCurrentLastSelection();
636
+ if (!c)
637
637
  return !1;
638
- const l = Ur("", {}), h = mr(
638
+ const l = jr("", {}), h = pr(
639
639
  this._injector,
640
640
  {
641
641
  unitId: this._context.unitId,
642
642
  subUnitId: this._context.unit.getActiveSheet().getSheetId(),
643
- row: a.primary.actualRow,
644
- col: a.primary.actualColumn
643
+ row: c.primary.actualRow,
644
+ col: c.primary.actualColumn
645
645
  },
646
- c,
647
646
  d,
647
+ a,
648
648
  0
649
649
  );
650
650
  if (!h)
@@ -655,46 +655,46 @@ let ze = class extends ae {
655
655
  height: h.height
656
656
  },
657
657
  positionH: {
658
- relativeFrom: Ar.PAGE,
658
+ relativeFrom: Br.PAGE,
659
659
  posOffset: 0
660
660
  },
661
661
  positionV: {
662
- relativeFrom: Nr.PARAGRAPH,
662
+ relativeFrom: Wr.PARAGRAPH,
663
663
  posOffset: 0
664
664
  },
665
665
  angle: 0
666
- }, m = {
666
+ }, f = {
667
667
  unitId: l.getUnitId(),
668
668
  subUnitId: l.getUnitId(),
669
669
  drawingId: t,
670
670
  drawingType: L.DRAWING_IMAGE,
671
671
  imageSourceType: r,
672
672
  source: s,
673
- transform: Zi(u),
673
+ transform: ns(u),
674
674
  docTransform: u,
675
- behindDoc: jr.FALSE,
675
+ behindDoc: xr.FALSE,
676
676
  title: "",
677
677
  description: "",
678
- layoutType: Wr.INLINE,
678
+ layoutType: $r.INLINE,
679
679
  // Insert inline drawing by default.
680
- wrapText: xr.BOTH_SIDES,
680
+ wrapText: kr.BOTH_SIDES,
681
681
  distB: 0,
682
682
  distL: 0,
683
683
  distR: 0,
684
684
  distT: 0
685
- }, p = Br.drawing.add({
685
+ }, p = Lr.drawing.add({
686
686
  documentDataModel: l,
687
- drawings: [m],
687
+ drawings: [f],
688
688
  selection: {
689
689
  collapsed: !0,
690
690
  startOffset: 0,
691
691
  endOffset: 0
692
692
  }
693
693
  });
694
- return p ? (l.apply(p), this._commandService.syncExecuteCommand(ji.id, {
694
+ return p ? (l.apply(p), this._commandService.syncExecuteCommand(ki.id, {
695
695
  value: {
696
- [a.primary.actualRow]: {
697
- [a.primary.actualColumn]: {
696
+ [c.primary.actualRow]: {
697
+ [c.primary.actualColumn]: {
698
698
  p: l.getSnapshot(),
699
699
  t: 1
700
700
  }
@@ -718,29 +718,29 @@ let ze = class extends ae {
718
718
  endColumn: 0
719
719
  };
720
720
  s && s.length > 0 && (o = s[s.length - 1].range);
721
- const c = Wn(this._skeletonManagerService.getCurrent().skeleton, o);
722
- if (c == null)
721
+ const d = $n(this._skeletonManagerService.getCurrent().skeleton, o);
722
+ if (d == null)
723
723
  return;
724
- let { startColumn: d, startRow: g, startX: a, startY: l } = c, h = !1;
725
- if (a + e > t && (a = t - e, a < 0 && (a = 0, e = t), h = !0), l + n > r && (l = r - n, l < 0 && (l = 0, n = r), h = !0), h) {
726
- const f = this._selectionRenderService.getCellWithCoordByOffset(a, l);
727
- if (f == null)
724
+ let { startColumn: a, startRow: g, startX: c, startY: l } = d, h = !1;
725
+ if (c + e > t && (c = t - e, c < 0 && (c = 0, e = t), h = !0), l + n > r && (l = r - n, l < 0 && (l = 0, n = r), h = !0), h) {
726
+ const m = this._selectionRenderService.getCellWithCoordByOffset(c, l);
727
+ if (m == null)
728
728
  return;
729
- a = f.startX, l = f.startY, d = f.actualColumn, g = f.actualRow;
729
+ c = m.startX, l = m.startY, a = m.actualColumn, g = m.actualRow;
730
730
  }
731
731
  const u = {
732
- column: d,
732
+ column: a,
733
733
  columnOffset: 0,
734
734
  row: g,
735
735
  rowOffset: 0
736
- }, m = this._selectionRenderService.getCellWithCoordByOffset(a + e, l + n);
737
- if (m == null)
736
+ }, f = this._selectionRenderService.getCellWithCoordByOffset(c + e, l + n);
737
+ if (f == null)
738
738
  return;
739
739
  const p = {
740
- column: m.actualColumn,
741
- columnOffset: a + e - m.startX,
742
- row: m.actualRow,
743
- rowOffset: l + n - m.startY
740
+ column: f.actualColumn,
741
+ columnOffset: c + e - f.startX,
742
+ row: f.actualRow,
743
+ rowOffset: l + n - f.startY
744
744
  };
745
745
  return {
746
746
  from: u,
@@ -750,7 +750,7 @@ let ze = class extends ae {
750
750
  _updateOrderListener() {
751
751
  this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((e) => {
752
752
  const { unitId: n, subUnitId: t, drawingIds: r, arrangeType: s } = e;
753
- this._commandService.executeCommand(hr.id, {
753
+ this._commandService.executeCommand(fr.id, {
754
754
  unitId: n,
755
755
  subUnitId: t,
756
756
  drawingIds: r,
@@ -762,22 +762,22 @@ let ze = class extends ae {
762
762
  this.disposeWithMe(this._drawingManagerService.featurePluginUpdate$.subscribe((e) => {
763
763
  const n = [];
764
764
  e.length !== 0 && (e.forEach((t) => {
765
- const { unitId: r, subUnitId: s, drawingId: o, drawingType: c, transform: d } = t;
766
- if (d == null)
765
+ const { unitId: r, subUnitId: s, drawingId: o, drawingType: d, transform: a } = t;
766
+ if (a == null)
767
767
  return;
768
768
  const g = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: o });
769
769
  if (g == null || g.unitId !== this._context.unitId)
770
770
  return;
771
- const a = $({ ...g.transform, ...d }, this._selectionRenderService);
772
- if (a == null)
771
+ const c = x({ ...g.transform, ...a }, this._selectionRenderService);
772
+ if (c == null)
773
773
  return;
774
774
  const l = {
775
775
  ...t,
776
- transform: { ...g.transform, ...d, ...V(a, this._selectionRenderService, this._skeletonManagerService) },
777
- sheetTransform: { ...a }
776
+ transform: { ...g.transform, ...a, ...H(c, this._selectionRenderService, this._skeletonManagerService) },
777
+ sheetTransform: { ...c }
778
778
  };
779
779
  n.push(l);
780
- }), n.length > 0 && this._commandService.executeCommand(Lt.id, {
780
+ }), n.length > 0 && this._commandService.executeCommand(Yt.id, {
781
781
  unitId: e[0].unitId,
782
782
  drawings: n
783
783
  }));
@@ -785,44 +785,44 @@ let ze = class extends ae {
785
785
  }
786
786
  _groupDrawingListener() {
787
787
  this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((e) => {
788
- this._commandService.executeCommand(ur.id, e);
788
+ this._commandService.executeCommand(gr.id, e);
789
789
  const { unitId: n, subUnitId: t, drawingId: r } = e[0].parent;
790
- this._commandService.syncExecuteCommand(xt.id, [{ unitId: n, subUnitId: t, drawingId: r }]);
790
+ this._commandService.syncExecuteCommand(kt.id, [{ unitId: n, subUnitId: t, drawingId: r }]);
791
791
  })), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((e) => {
792
- this._commandService.executeCommand(gr.id, e);
792
+ this._commandService.executeCommand(mr.id, e);
793
793
  }));
794
794
  }
795
795
  _focusDrawingListener() {
796
796
  this.disposeWithMe(
797
797
  this._drawingManagerService.focus$.subscribe((e) => {
798
- e == null || e.length === 0 ? (this._contextService.setContextValue(xe, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(xe, !0), this._sheetDrawingService.focusDrawing(e));
798
+ e == null || e.length === 0 ? (this._contextService.setContextValue(ke, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(ke, !0), this._sheetDrawingService.focusDrawing(e));
799
799
  })
800
800
  );
801
801
  }
802
802
  };
803
- ze = vs([
804
- ne(1, N(H)),
805
- ne(2, X),
806
- ne(3, Je),
807
- ne(4, An),
808
- ne(5, yi),
809
- ne(6, ee),
810
- ne(7, de),
811
- ne(8, Un),
812
- ne(9, Oi),
813
- ne(10, N(Wt)),
814
- ne(11, N(Bn)),
815
- ne(12, N(Ke))
816
- ], ze);
817
- var Is = Object.defineProperty, Cs = Object.getOwnPropertyDescriptor, bs = (i, e, n, t) => {
818
- for (var r = t > 1 ? void 0 : t ? Cs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
803
+ Qe = Rs([
804
+ Q(1, N(G)),
805
+ Q(2, F),
806
+ Q(3, Ge),
807
+ Q(4, Bn),
808
+ Q(5, Pi),
809
+ Q(6, ne),
810
+ Q(7, te),
811
+ Q(8, jn),
812
+ Q(9, Ui),
813
+ Q(10, N($t)),
814
+ Q(11, N(ln)),
815
+ Q(12, N(et))
816
+ ], Qe);
817
+ var Ms = Object.defineProperty, ys = Object.getOwnPropertyDescriptor, Os = (i, e, n, t) => {
818
+ for (var r = t > 1 ? void 0 : t ? ys(e, n) : e, s = i.length - 1, o; s >= 0; s--)
819
819
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
820
- return t && r && Is(e, n, r), r;
821
- }, Re = (i, e) => (n, t) => e(n, t, i);
822
- function sn(i, e, n) {
820
+ return t && r && Ms(e, n, r), r;
821
+ }, De = (i, e) => (n, t) => e(n, t, i);
822
+ function an(i, e, n) {
823
823
  var t, r, s, o;
824
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) {
825
- const c = n.p.drawings[n.p.drawingsOrder[0]], d = mr(
825
+ const d = n.p.drawings[n.p.drawingsOrder[0]], a = pr(
826
826
  i,
827
827
  {
828
828
  unitId: e.unitId,
@@ -830,74 +830,74 @@ function sn(i, e, n) {
830
830
  row: e.row,
831
831
  col: e.col
832
832
  },
833
- c.docTransform.size.width,
834
- c.docTransform.size.height,
835
- c.docTransform.angle
833
+ d.docTransform.size.width,
834
+ d.docTransform.size.height,
835
+ d.docTransform.angle
836
836
  );
837
- if (d)
838
- return c.transform.width = d.width, c.transform.height = d.height, c.docTransform.size.width = d.width, c.docTransform.size.height = d.height, c.transform.left = 0, c.transform.top = 0, c.docTransform.positionH.posOffset = 0, c.docTransform.positionV.posOffset = 0, n.p.documentStyle.pageSize.width = 1 / 0, n.p.documentStyle.pageSize.height = 1 / 0, !0;
837
+ if (a)
838
+ return d.transform.width = a.width, d.transform.height = a.height, d.docTransform.size.width = a.width, d.docTransform.size.height = a.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;
839
839
  }
840
840
  return !1;
841
841
  }
842
- let yt = class extends ae {
842
+ let Et = class extends oe {
843
843
  constructor(i, e, n, t, r, s, o) {
844
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();
845
845
  }
846
846
  _initHandleResize() {
847
847
  this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
848
848
  let e, n = [];
849
- if (i.id === $n.id) {
849
+ if (i.id === Ln.id) {
850
850
  const t = i.params;
851
- n = t.ranges, e = Y(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
852
- } else if (i.id === kn.id) {
851
+ n = t.ranges, e = X(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
852
+ } else if (i.id === Fn.id) {
853
853
  const t = i.params;
854
- n = t.ranges, e = Y(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
855
- } else if (i.id === Wi.id) {
854
+ n = t.ranges, e = X(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
855
+ } else if (i.id === Li.id) {
856
856
  const t = i.params;
857
- n = t.ranges, e = Y(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
858
- } else if (i.id === Ln.id) {
857
+ n = t.ranges, e = X(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
858
+ } else if (i.id === Yn.id) {
859
859
  const t = i.params;
860
- e = Y(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId }), n = t.rowsAutoHeightInfo.map((r) => ({
860
+ e = X(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId }), n = t.rowsAutoHeightInfo.map((r) => ({
861
861
  startRow: r.row,
862
862
  endRow: r.row,
863
863
  startColumn: 0,
864
864
  endColumn: 9999
865
865
  }));
866
- } else if (i.id === xi.id) {
866
+ } else if (i.id === Fi.id) {
867
867
  const t = i.params;
868
- n = t.ranges, e = Y(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
869
- } else if (i.id === Bi.id) {
868
+ n = t.ranges, e = X(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
869
+ } else if (i.id === Yi.id) {
870
870
  const t = i.params;
871
- n = t.ranges, e = Y(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
871
+ n = t.ranges, e = X(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
872
872
  }
873
873
  e && n.length && n.forEach((t) => {
874
- const r = $r.transformRange(t, e.worksheet);
874
+ const r = Fr.transformRange(t, e.worksheet);
875
875
  for (let s = r.startRow; s <= r.endRow; s++)
876
876
  for (let o = r.startColumn; o <= r.endColumn; o++)
877
- sn(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: s, col: o }, e.worksheet.getCellRaw(s, o));
877
+ an(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: s, col: o }, e.worksheet.getCellRaw(s, o));
878
878
  });
879
879
  }));
880
880
  }
881
881
  _handleInitEditor() {
882
882
  this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
883
- i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(lt), this._docDrawingController.loadDrawingDataForUnit(lt), this._drawingManagerService.initializeNotification(lt)) : this._drawingManagerService.removeDrawingDataForUnit(lt);
883
+ i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(mt), this._docDrawingController.loadDrawingDataForUnit(mt), this._drawingManagerService.initializeNotification(mt)) : this._drawingManagerService.removeDrawingDataForUnit(mt);
884
884
  })), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
885
- i.id === qi.id && i.params.unitId === ut && (this._drawingManagerService.removeDrawingDataForUnit(ut), this._docDrawingController.loadDrawingDataForUnit(ut), this._drawingManagerService.initializeNotification(ut));
885
+ i.id === rs.id && i.params.unitId === pt && (this._drawingManagerService.removeDrawingDataForUnit(pt), this._docDrawingController.loadDrawingDataForUnit(pt), this._drawingManagerService.initializeNotification(pt));
886
886
  }));
887
887
  }
888
888
  _handleWriteCell() {
889
- this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept($i, {
889
+ this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(Gi, {
890
890
  priority: 9999,
891
- handler: (i, e, n) => (sn(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: e.row, col: e.col }, i), n(i))
891
+ handler: (i, e, n) => (an(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: e.row, col: e.col }, i), n(i))
892
892
  }));
893
893
  }
894
894
  _initCellContentInterceptor() {
895
895
  this.disposeWithMe(
896
896
  this._sheetInterceptorService.intercept(
897
- ki.CELL_CONTENT,
897
+ Xi.CELL_CONTENT,
898
898
  {
899
- effect: kr.Style,
900
- priority: Li.CELL_IMAGE,
899
+ effect: Yr.Style,
900
+ priority: Vi.CELL_IMAGE,
901
901
  handler: (i, e, n) => {
902
902
  var t;
903
903
  return i != null && i.p && ((t = i.p.drawingsOrder) != null && t.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }), n(i);
@@ -907,21 +907,21 @@ let yt = class extends ae {
907
907
  );
908
908
  }
909
909
  };
910
- yt = bs([
911
- Re(0, X),
912
- Re(1, N(Bt)),
913
- Re(2, ke),
914
- Re(3, N(Ke)),
915
- Re(4, de),
916
- Re(5, N(ni)),
917
- Re(6, N(pi))
918
- ], yt);
919
- var Rs = Object.defineProperty, Ds = Object.getOwnPropertyDescriptor, Ms = (i, e, n, t) => {
920
- for (var r = t > 1 ? void 0 : t ? Ds(e, n) : e, s = i.length - 1, o; s >= 0; s--)
910
+ Et = Os([
911
+ De(0, F),
912
+ De(1, N(Lt)),
913
+ De(2, Ye),
914
+ De(3, N(et)),
915
+ De(4, te),
916
+ De(5, N(si)),
917
+ De(6, N(Si))
918
+ ], Et);
919
+ var Ts = Object.defineProperty, Es = Object.getOwnPropertyDescriptor, Ps = (i, e, n, t) => {
920
+ for (var r = t > 1 ? void 0 : t ? Es(e, n) : e, s = i.length - 1, o; s >= 0; s--)
921
921
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
922
- return t && r && Rs(e, n, r), r;
923
- }, Tn = (i, e) => (n, t) => e(n, t, i);
924
- let Ot = class extends ae {
922
+ return t && r && Ts(e, n, r), r;
923
+ }, Un = (i, e) => (n, t) => e(n, t, i);
924
+ let Pt = class extends oe {
925
925
  constructor(i, e) {
926
926
  super(), this._autoFillService = i, this._injector = e, this._initAutoFillHooks();
927
927
  }
@@ -930,27 +930,27 @@ let Ot = class extends ae {
930
930
  this._autoFillService.addHook({
931
931
  id: "sheet-cell-image-autofill",
932
932
  onBeforeSubmit: (i, e, n, t) => {
933
- new Lr(t).forValue((r, s, o) => {
934
- sn(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
933
+ new Gr(t).forValue((r, s, o) => {
934
+ an(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
935
935
  });
936
936
  }
937
937
  })
938
938
  );
939
939
  }
940
940
  };
941
- Ot = Ms([
942
- Tn(0, N(wi)),
943
- Tn(1, N(Ke))
944
- ], Ot);
945
- var ys = Object.defineProperty, Os = Object.getOwnPropertyDescriptor, Es = (i, e, n, t) => {
946
- for (var r = t > 1 ? void 0 : t ? Os(e, n) : e, s = i.length - 1, o; s >= 0; s--)
941
+ Pt = Ps([
942
+ Un(0, N(Ii)),
943
+ Un(1, N(et))
944
+ ], Pt);
945
+ var Us = Object.defineProperty, As = Object.getOwnPropertyDescriptor, Ns = (i, e, n, t) => {
946
+ for (var r = t > 1 ? void 0 : t ? As(e, n) : e, s = i.length - 1, o; s >= 0; s--)
947
947
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
948
- return t && r && ys(e, n, r), r;
949
- }, vt = (i, e) => (n, t) => e(n, t, i);
950
- let Et = class extends ae {
948
+ return t && r && Us(e, n, r), r;
949
+ }, bt = (i, e) => (n, t) => e(n, t, i);
950
+ let Ut = class extends oe {
951
951
  constructor(e, n, t, r) {
952
952
  super();
953
- J(this, "_isSetCursor", !1);
953
+ K(this, "_isSetCursor", !1);
954
954
  this._hoverManagerService = e, this._renderManagerService = n, this._selectionsService = t, this._drawingRenderService = r;
955
955
  }
956
956
  _initHover() {
@@ -958,159 +958,327 @@ let Et = class extends ae {
958
958
  _initImageClick() {
959
959
  }
960
960
  };
961
- Et = Es([
962
- vt(0, N(_i)),
963
- vt(1, N(Q)),
964
- vt(2, N(Bn)),
965
- vt(3, N(Nn))
966
- ], Et);
967
- var Ts = Object.defineProperty, Ps = Object.getOwnPropertyDescriptor, Us = (i, e, n, t) => {
968
- for (var r = t > 1 ? void 0 : t ? Ps(e, n) : e, s = i.length - 1, o; s >= 0; s--)
961
+ Ut = Ns([
962
+ bt(0, N(Ci)),
963
+ bt(1, N(Z)),
964
+ bt(2, N(ln)),
965
+ bt(3, N(Wn))
966
+ ], Ut);
967
+ const Gt = {
968
+ id: "sheet.command.insert-float-image",
969
+ type: J.COMMAND,
970
+ handler: async (i, e) => {
971
+ var s, o;
972
+ const t = (s = i.get(Z).getCurrentTypeOfRenderer(V.UNIVER_SHEET)) == null ? void 0 : s.with(Qe);
973
+ if (!t)
974
+ return !1;
975
+ const r = e == null ? void 0 : e.files;
976
+ if (r) {
977
+ const d = r.map((a) => t.insertFloatImageByFile(a));
978
+ return (await Promise.all(d)).every((a) => a);
979
+ } else
980
+ return (o = t.insertFloatImage()) != null ? o : !1;
981
+ }
982
+ }, hn = {
983
+ id: "sheet.command.insert-cell-image",
984
+ type: J.COMMAND,
985
+ handler: (i) => {
986
+ var n, t;
987
+ return (t = (n = i.get(Z).getCurrentTypeOfRenderer(V.UNIVER_SHEET)) == null ? void 0 : n.with(Qe).insertCellImage()) != null ? t : !1;
988
+ }
989
+ };
990
+ var js = Object.defineProperty, Bs = Object.getOwnPropertyDescriptor, Ws = (i, e, n, t) => {
991
+ for (var r = t > 1 ? void 0 : t ? Bs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
969
992
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
970
- return t && r && Ts(e, n, r), r;
971
- }, Zt = (i, e) => (n, t) => e(n, t, i);
972
- let Tt = class extends ae {
973
- constructor(e, n, t) {
993
+ return t && r && js(e, n, r), r;
994
+ }, Ke = (i, e) => (n, t) => e(n, t, i);
995
+ const wr = "image/png";
996
+ function xs(i) {
997
+ const e = i.split(","), n = atob(e[1]), t = n.length, r = new Uint8Array(t);
998
+ for (let s = 0; s < t; s++)
999
+ r[s] = n.charCodeAt(s);
1000
+ return new Blob([r], { type: wr });
1001
+ }
1002
+ function $s(i) {
1003
+ const e = new ClipboardItem({ [wr]: xs(i) });
1004
+ navigator.clipboard.write([e]).catch((n) => {
1005
+ console.error("Could not copy image using clipboard API: ", n);
1006
+ });
1007
+ }
1008
+ function ks() {
1009
+ function i() {
1010
+ const t = document.createElement("input");
1011
+ return t.style.position = "absolute", t.style.height = "1px", t.style.width = "1px", t.style.opacity = "0", t;
1012
+ }
1013
+ const e = document.activeElement, n = i();
1014
+ return document.body.appendChild(n), n.focus(), () => {
1015
+ n.blur(), document.body.removeChild(n), e instanceof HTMLElement && e.focus();
1016
+ };
1017
+ }
1018
+ const An = [
1019
+ $e.SPECIAL_PASTE_COL_WIDTH,
1020
+ $e.SPECIAL_PASTE_VALUE,
1021
+ $e.SPECIAL_PASTE_FORMAT,
1022
+ $e.SPECIAL_PASTE_FORMULA
1023
+ ];
1024
+ let At = class extends oe {
1025
+ constructor(e, n, t, r, s) {
974
1026
  super();
975
- J(this, "_copyInfo");
976
- this._sheetClipboardService = e, this._renderManagerService = n, this._sheetDrawingService = t, this._initCopyPaste();
1027
+ K(this, "_copyInfo");
1028
+ this._sheetClipboardService = e, this._renderManagerService = n, this._drawingService = t, this._clipboardInterfaceService = r, this._commandService = s, this._initCopyPaste();
1029
+ }
1030
+ get _focusedDrawings() {
1031
+ return this._drawingService.getFocusDrawings();
977
1032
  }
1033
+ // eslint-disable-next-line max-lines-per-function
978
1034
  _initCopyPaste() {
979
1035
  this._sheetClipboardService.addClipboardHook({
980
1036
  id: "SHEET_IMAGE_UI_PLUGIN",
981
- onBeforeCopy: (e, n, t) => this._collect(e, n, t),
1037
+ onBeforeCopy: (e, n, t, r) => {
1038
+ const s = this._focusedDrawings;
1039
+ if (s.length > 0) {
1040
+ const [o] = s;
1041
+ if (r === be.CUT) {
1042
+ const a = {
1043
+ unitId: e,
1044
+ drawings: [o]
1045
+ };
1046
+ this._commandService.executeCommand(tt.id, a);
1047
+ }
1048
+ setTimeout(() => {
1049
+ const a = ks();
1050
+ o.drawingType === L.DRAWING_IMAGE && o.imageSourceType === ai.BASE64 ? $s(o.source) : this._clipboardInterfaceService.writeText(""), a();
1051
+ }, 200);
1052
+ const d = {
1053
+ unitId: o.unitId,
1054
+ subUnitId: o.subUnitId,
1055
+ drawings: [o]
1056
+ };
1057
+ this._copyInfo = d;
1058
+ } else {
1059
+ const o = this._createDrawingsCopyInfoByRange(e, n, t);
1060
+ this._copyInfo = o;
1061
+ }
1062
+ },
982
1063
  onPasteCells: (e, n, t, r) => {
983
- const { copyType: s = Cn.COPY, pasteType: o } = r, { range: c } = e || {}, { range: d, unitId: g, subUnitId: a } = n;
984
- return this._generateMutations(d, { copyType: s, pasteType: o, copyRange: c, unitId: g, subUnitId: a });
1064
+ if (!this._copyInfo)
1065
+ return { redos: [], undos: [] };
1066
+ const { copyType: s = be.COPY, pasteType: o } = r, { range: d } = e || {}, { range: a, unitId: g, subUnitId: c } = n;
1067
+ return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: g, subUnitId: c, pasteRange: a }, { copyRange: d, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: n, pasteType: o }, be.COPY);
985
1068
  },
986
- onPastePlainText: (e, n) => ({ undos: [], redos: [] })
1069
+ onPastePlainText: (e, n) => ({ undos: [], redos: [] }),
1070
+ onPasteUnrecognized: (e) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: $e.DEFAULT_PASTE }, be.COPY) : { undos: [], redos: [] },
1071
+ onPasteFiles: (e, n) => {
1072
+ if (this._copyInfo)
1073
+ return this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: $e.DEFAULT_PASTE }, be.COPY);
1074
+ {
1075
+ const t = n.filter((r) => r.type.includes("image"));
1076
+ if (t.length)
1077
+ return {
1078
+ undos: [],
1079
+ redos: [
1080
+ {
1081
+ id: Gt.id,
1082
+ params: { files: t }
1083
+ }
1084
+ ]
1085
+ };
1086
+ }
1087
+ return { undos: [], redos: [] };
1088
+ }
987
1089
  });
988
1090
  }
989
- _collect(e, n, t) {
1091
+ _createDrawingsCopyInfoByRange(e, n, t) {
990
1092
  var h;
991
- const r = (h = this._renderManagerService.getRenderById(e)) == null ? void 0 : h.with(H);
1093
+ const r = (h = this._renderManagerService.getRenderById(e)) == null ? void 0 : h.with(G);
992
1094
  if (!r) return;
993
1095
  const s = r.attachRangeWithCoord(t);
994
1096
  if (!s)
995
1097
  return;
996
- const { startX: o, endX: c, startY: d, endY: g } = s, a = this._sheetDrawingService.getDrawingData(e, n), l = [];
997
- Object.keys(a).forEach((u) => {
998
- const m = a[u], { transform: p } = m;
999
- if (m.anchorType !== O.Both || !p)
1098
+ const { startX: o, endX: d, startY: a, endY: g } = s, c = this._drawingService.getDrawingData(e, n), l = this._focusedDrawings.slice();
1099
+ if (Object.keys(c).forEach((u) => {
1100
+ const f = c[u], { transform: p } = f;
1101
+ if (f.anchorType !== T.Both || !p)
1000
1102
  return;
1001
- const { left: f = 0, top: w = 0, width: S = 0, height: I = 0 } = p, { drawingStartX: D, drawingEndX: v, drawingStartY: R, drawingEndY: _ } = {
1002
- drawingStartX: f,
1003
- drawingEndX: f + S,
1103
+ const { left: m = 0, top: w = 0, width: S = 0, height: I = 0 } = p, { drawingStartX: D, drawingEndX: v, drawingStartY: C, drawingEndY: _ } = {
1104
+ drawingStartX: m,
1105
+ drawingEndX: m + S,
1004
1106
  drawingStartY: w,
1005
1107
  drawingEndY: w + I
1006
1108
  };
1007
- o <= D && v <= c && d <= R && _ <= g && l.push(m);
1008
- }), l.length && (this._copyInfo = {
1009
- drawings: l,
1010
- unitId: e,
1011
- subUnitId: n
1012
- });
1109
+ o <= D && v <= d && a <= C && _ <= g && l.push(f);
1110
+ }), l.length)
1111
+ return {
1112
+ copyRange: t,
1113
+ drawings: l,
1114
+ unitId: e,
1115
+ subUnitId: n
1116
+ };
1013
1117
  }
1014
- // eslint-disable-next-line max-lines-per-function
1015
- _generateMutations(e, n) {
1016
- var A;
1017
- if (!this._copyInfo)
1018
- return { redos: [], undos: [] };
1019
- if ([
1020
- mt.SPECIAL_PASTE_COL_WIDTH,
1021
- mt.SPECIAL_PASTE_VALUE,
1022
- mt.SPECIAL_PASTE_FORMAT,
1023
- mt.SPECIAL_PASTE_FORMULA
1024
- ].includes(n.pasteType))
1118
+ _generateSingleDrawingPasteMutations(e, n) {
1119
+ const { pasteType: t, pasteTo: r } = e;
1120
+ if (An.includes(t))
1025
1121
  return { redos: [], undos: [] };
1026
- const { copyRange: r } = n;
1027
- if (!r)
1122
+ const { unitId: s, subUnitId: o, range: d } = r, a = this._renderManagerService.getRenderById(s), g = a == null ? void 0 : a.with(G), c = a == null ? void 0 : a.with(Ge), l = this._copyInfo;
1123
+ if (!g || !c)
1028
1124
  return { redos: [], undos: [] };
1029
- const { drawings: s, unitId: o, subUnitId: c } = this._copyInfo, { ranges: [d, g], mapFunc: a } = vi([r, e]), { row: l, col: h } = a(d.startRow, d.startColumn), { row: u, col: m } = a(g.startRow, g.startColumn), p = (A = this._renderManagerService.getRenderById(o)) == null ? void 0 : A.with(H);
1030
- if (!p)
1031
- return { redos: [], undos: [] };
1032
- const f = p.attachRangeWithCoord({
1033
- startRow: l,
1034
- endRow: l,
1035
- startColumn: h,
1036
- endColumn: h
1037
- }), w = p.attachRangeWithCoord({
1038
- startRow: u,
1039
- endRow: u,
1040
- startColumn: m,
1041
- endColumn: m
1125
+ const { drawings: h } = l, u = Rn(d);
1126
+ return this._generateMutations(h, {
1127
+ unitId: s,
1128
+ subUnitId: o,
1129
+ isCut: n === be.CUT,
1130
+ getTransform: (f, p) => {
1131
+ var S;
1132
+ const m = g.attachRangeWithCoord({
1133
+ startRow: u.startRow,
1134
+ endRow: u.endRow,
1135
+ startColumn: u.startColumn,
1136
+ endColumn: u.endColumn
1137
+ }), w = {
1138
+ ...f,
1139
+ left: m == null ? void 0 : m.startX,
1140
+ top: m == null ? void 0 : m.startY
1141
+ };
1142
+ return {
1143
+ transform: w,
1144
+ sheetTransform: (S = x(w, c)) != null ? S : p
1145
+ };
1146
+ }
1042
1147
  });
1043
- if (!f || !w)
1044
- return { redos: [], undos: [] };
1045
- const S = [], I = [], D = w.startX - f.startX, v = w.startY - f.startY, R = u - l, _ = m - h, E = n.copyType === Cn.CUT, { _sheetDrawingService: M } = this;
1046
- return s.forEach((T) => {
1047
- const { transform: b, sheetTransform: C } = T;
1048
- if (!b)
1148
+ }
1149
+ _generateMutations(e, n) {
1150
+ const {
1151
+ unitId: t,
1152
+ subUnitId: r,
1153
+ getTransform: s,
1154
+ isCut: o
1155
+ } = n, d = [], a = [], { _drawingService: g } = this;
1156
+ return e.forEach((c) => {
1157
+ const { transform: l, sheetTransform: h } = c;
1158
+ if (!l)
1049
1159
  return;
1050
- const y = {
1051
- ...T,
1052
- unitId: o,
1053
- subUnitId: c,
1054
- drawingId: E ? T.drawingId : ye.generateRandomId(),
1055
- transform: {
1056
- ...b,
1057
- left: b.left + D,
1058
- top: b.top + v
1059
- },
1060
- sheetTransform: {
1061
- to: { ...C.to, row: C.to.row + R, column: C.to.column + _ },
1062
- from: { ...C.from, row: C.from.row + R, column: C.from.column + _ }
1063
- }
1160
+ const u = s(l, h), f = {
1161
+ ...c,
1162
+ unitId: t,
1163
+ subUnitId: r,
1164
+ drawingId: o ? c.drawingId : Oe.generateRandomId(),
1165
+ transform: u.transform,
1166
+ sheetTransform: u.sheetTransform
1064
1167
  };
1065
- if (E) {
1066
- const { undo: W, redo: z, objects: Z } = M.getBatchUpdateOp([y]);
1067
- S.push({
1168
+ if (o) {
1169
+ const { undo: p, redo: m, objects: w } = g.getBatchUpdateOp([f]);
1170
+ d.push({
1068
1171
  id: P.id,
1069
1172
  params: {
1070
- unitId: o,
1071
- subUnitId: c,
1173
+ unitId: t,
1174
+ subUnitId: r,
1072
1175
  type: U.UPDATE,
1073
- op: z,
1074
- objects: Z
1176
+ op: m,
1177
+ objects: w
1075
1178
  }
1076
- }), I.push({
1179
+ }), a.push({
1077
1180
  id: P.id,
1078
1181
  params: {
1079
- unitId: o,
1080
- subUnitId: c,
1182
+ unitId: t,
1183
+ subUnitId: r,
1081
1184
  type: U.UPDATE,
1082
- op: W,
1083
- objects: Z
1185
+ op: p,
1186
+ objects: w
1084
1187
  }
1085
1188
  });
1086
1189
  } else {
1087
- const { undo: W, redo: z, objects: Z } = M.getBatchAddOp([y]);
1088
- S.push({ id: P.id, params: { op: z, unitId: o, subUnitId: c, objects: Z, type: U.INSERT } }), I.push({ id: P.id, params: { op: W, unitId: o, subUnitId: c, objects: Z, type: U.REMOVE } });
1190
+ const { undo: p, redo: m, objects: w } = g.getBatchAddOp([f]);
1191
+ d.push({ id: P.id, params: { op: m, unitId: t, subUnitId: r, objects: w, type: U.INSERT } }), a.push({ id: P.id, params: { op: p, unitId: t, subUnitId: r, objects: w, type: U.REMOVE } });
1089
1192
  }
1090
- }), {
1091
- redos: S,
1092
- undos: I
1093
- };
1193
+ }), { redos: d, undos: a };
1194
+ }
1195
+ // eslint-disable-next-line max-lines-per-function
1196
+ _generateRangeDrawingsPasteMutations(e, n) {
1197
+ var E;
1198
+ const {
1199
+ unitId: t,
1200
+ subUnitId: r,
1201
+ pasteType: s,
1202
+ pasteRange: o
1203
+ } = e, {
1204
+ copyRange: d,
1205
+ copyType: a
1206
+ } = n;
1207
+ if (An.includes(s))
1208
+ return { redos: [], undos: [] };
1209
+ const g = (E = this._renderManagerService.getRenderById(t)) == null ? void 0 : E.with(G);
1210
+ if (!g || !this._copyInfo)
1211
+ return { redos: [], undos: [] };
1212
+ const { drawings: c } = this._copyInfo;
1213
+ if (!d)
1214
+ return this._generateSingleDrawingPasteMutations({
1215
+ pasteTo: { unitId: t, subUnitId: r, range: Rn(o) },
1216
+ pasteType: s
1217
+ }, a);
1218
+ const { ranges: [l, h], mapFunc: u } = bi([d, o]), { row: f, col: p } = u(l.startRow, l.startColumn), { row: m, col: w } = u(h.startRow, h.startColumn), S = g.attachRangeWithCoord({
1219
+ startRow: f,
1220
+ endRow: f,
1221
+ startColumn: p,
1222
+ endColumn: p
1223
+ }), I = g.attachRangeWithCoord({
1224
+ startRow: m,
1225
+ endRow: m,
1226
+ startColumn: w,
1227
+ endColumn: w
1228
+ });
1229
+ if (!S || !I || !this._copyInfo)
1230
+ return { redos: [], undos: [] };
1231
+ const D = I.startX - S.startX, v = I.startY - S.startY, C = m - f, _ = w - p;
1232
+ return this._generateMutations(c, {
1233
+ unitId: t,
1234
+ subUnitId: r,
1235
+ getTransform: (M, y) => {
1236
+ var A, b;
1237
+ return {
1238
+ transform: {
1239
+ ...M,
1240
+ left: ((A = M == null ? void 0 : M.left) != null ? A : 0) + D,
1241
+ top: ((b = M == null ? void 0 : M.top) != null ? b : 0) + v
1242
+ },
1243
+ sheetTransform: {
1244
+ ...y,
1245
+ to: {
1246
+ ...y.to,
1247
+ row: y.to.row + C,
1248
+ column: y.to.column + _
1249
+ },
1250
+ from: {
1251
+ ...y.from,
1252
+ row: y.from.row + C,
1253
+ column: y.from.column + _
1254
+ }
1255
+ }
1256
+ };
1257
+ },
1258
+ isCut: a === be.CUT
1259
+ });
1094
1260
  }
1095
1261
  };
1096
- Tt = Us([
1097
- Zt(0, Si),
1098
- Zt(1, Q),
1099
- Zt(2, ee)
1100
- ], Tt);
1101
- var As = Object.defineProperty, Ns = Object.getOwnPropertyDescriptor, js = (i, e, n, t) => {
1102
- for (var r = t > 1 ? void 0 : t ? Ns(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1262
+ At = Ws([
1263
+ Ke(0, Ri),
1264
+ Ke(1, Z),
1265
+ Ke(2, te),
1266
+ Ke(3, Ai),
1267
+ Ke(4, F)
1268
+ ], At);
1269
+ var Ls = Object.defineProperty, Fs = Object.getOwnPropertyDescriptor, Ys = (i, e, n, t) => {
1270
+ for (var r = t > 1 ? void 0 : t ? Fs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1103
1271
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1104
- return t && r && As(e, n, r), r;
1105
- }, Xe = (i, e) => (n, t) => e(n, t, i);
1106
- let Pt = class extends ae {
1272
+ return t && r && Ls(e, n, r), r;
1273
+ }, Je = (i, e) => (n, t) => e(n, t, i);
1274
+ let Nt = class extends oe {
1107
1275
  constructor(i, e, n, t, r) {
1108
1276
  super(), this._drawingManagerService = i, this._renderManagerService = e, this._permissionService = n, this._univerInstanceService = t, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
1109
1277
  }
1110
1278
  _initDrawingVisible() {
1111
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
1279
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(V.UNIVER_SHEET);
1112
1280
  this.disposeWithMe(
1113
- ft([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1281
+ vt([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1114
1282
  if (!e) {
1115
1283
  this._drawingManagerService.setDrawingVisible(!1);
1116
1284
  return;
@@ -1121,15 +1289,15 @@ let Pt = class extends ae {
1121
1289
  return;
1122
1290
  }
1123
1291
  const r = e.getUnitId(), s = t.getSheetId();
1124
- if (this._permissionService.composePermission([new Mn(r).id, new zt(r, s).id]).every((c) => c.value))
1292
+ if (this._permissionService.composePermission([new On(r).id, new Zt(r, s).id]).every((d) => d.value))
1125
1293
  this._drawingManagerService.setDrawingVisible(!0);
1126
1294
  else {
1127
1295
  this._drawingManagerService.setDrawingVisible(!1);
1128
- const c = e.getUnitId(), d = t.getSheetId(), g = this._drawingManagerService.getDrawingData(c, d), a = Object.values(g), l = this._renderManagerService.getRenderById(c), h = l == null ? void 0 : l.scene;
1296
+ const d = e.getUnitId(), a = t.getSheetId(), g = this._drawingManagerService.getDrawingData(d, a), c = Object.values(g), l = this._renderManagerService.getRenderById(d), h = l == null ? void 0 : l.scene;
1129
1297
  if (h == null)
1130
1298
  return;
1131
- h.getAllObjectsByOrder().forEach((m) => {
1132
- m.classType === je.IMAGE && a.some((p) => m.oKey.includes(p.drawingId)) && h.removeObject(m);
1299
+ h.getAllObjectsByOrder().forEach((f) => {
1300
+ f.classType === Be.IMAGE && c.some((p) => f.oKey.includes(p.drawingId)) && h.removeObject(f);
1133
1301
  });
1134
1302
  }
1135
1303
  });
@@ -1137,9 +1305,9 @@ let Pt = class extends ae {
1137
1305
  );
1138
1306
  }
1139
1307
  _initDrawingEditable() {
1140
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
1308
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(V.UNIVER_SHEET);
1141
1309
  this.disposeWithMe(
1142
- ft([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1310
+ vt([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1143
1311
  if (!e) {
1144
1312
  this._drawingManagerService.setDrawingEditable(!1);
1145
1313
  return;
@@ -1150,15 +1318,15 @@ let Pt = class extends ae {
1150
1318
  return;
1151
1319
  }
1152
1320
  const r = e.getUnitId(), s = t.getSheetId();
1153
- if (this._permissionService.composePermission([new Qt(r).id, new Dt(r, s).id]).every((c) => c.value))
1321
+ if (this._permissionService.composePermission([new tn(r).id, new Ot(r, s).id]).every((d) => d.value))
1154
1322
  this._drawingManagerService.setDrawingEditable(!0);
1155
1323
  else {
1156
1324
  this._drawingManagerService.setDrawingEditable(!1);
1157
- const c = e.getUnitId(), d = t.getSheetId(), g = this._drawingManagerService.getDrawingData(c, d), a = Object.values(g), l = this._renderManagerService.getRenderById(c), h = l == null ? void 0 : l.scene;
1325
+ const d = e.getUnitId(), a = t.getSheetId(), g = this._drawingManagerService.getDrawingData(d, a), c = Object.values(g), l = this._renderManagerService.getRenderById(d), h = l == null ? void 0 : l.scene;
1158
1326
  if (h == null)
1159
1327
  return;
1160
- h.getAllObjectsByOrder().forEach((m) => {
1161
- m.classType === je.IMAGE && a.some((p) => m.oKey.includes(p.drawingId)) && h.detachTransformerFrom(m);
1328
+ h.getAllObjectsByOrder().forEach((f) => {
1329
+ f.classType === Be.IMAGE && c.some((p) => f.oKey.includes(p.drawingId)) && h.detachTransformerFrom(f);
1162
1330
  });
1163
1331
  }
1164
1332
  });
@@ -1166,33 +1334,33 @@ let Pt = class extends ae {
1166
1334
  );
1167
1335
  }
1168
1336
  _initViewPermissionChange() {
1169
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
1337
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(V.UNIVER_SHEET);
1170
1338
  this.disposeWithMe(
1171
- ft([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1339
+ vt([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1172
1340
  e && e.activeSheet$.subscribe((t) => {
1173
1341
  var l;
1174
1342
  if (!t)
1175
1343
  return;
1176
1344
  const r = e.getUnitId(), s = t.getSheetId();
1177
1345
  let o = !0;
1178
- const c = this._renderManagerService.getRenderById(r), d = c == null ? void 0 : c.scene;
1179
- if (d == null)
1346
+ const d = this._renderManagerService.getRenderById(r), a = d == null ? void 0 : d.scene;
1347
+ if (a == null)
1180
1348
  return;
1181
- const g = d.getTransformerByCreate(), a = this._permissionService.composePermission$([new Mn(r).id, new zt(r, s).id]).pipe(He((h) => h.every((u) => u.value)));
1182
- a == null || a.pipe(
1183
- Se((h) => h !== o),
1184
- pt()
1349
+ const g = a.getTransformerByCreate(), c = this._permissionService.composePermission$([new On(r).id, new Zt(r, s).id]).pipe(qe((h) => h.every((u) => u.value)));
1350
+ c == null || c.pipe(
1351
+ ve((h) => h !== o),
1352
+ St()
1185
1353
  ).subscribe({
1186
1354
  next: (h) => {
1187
1355
  o = h, this._drawingManagerService.setDrawingVisible(h);
1188
- const u = d.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), p = Object.values(m);
1189
- h ? this._drawingManagerService.addNotification(p) : (u.forEach((f) => {
1190
- f.classType === je.IMAGE && p.some((w) => f.oKey.includes(w.drawingId)) && d.removeObject(f);
1356
+ const u = a.getAllObjectsByOrder(), f = this._drawingManagerService.getDrawingData(r, s), p = Object.values(f);
1357
+ h ? this._drawingManagerService.addNotification(p) : (u.forEach((m) => {
1358
+ m.classType === Be.IMAGE && p.some((w) => m.oKey.includes(w.drawingId)) && a.removeObject(m);
1191
1359
  }), g.clearSelectedObjects());
1192
1360
  }
1193
- }), (l = this._permissionService.getPermissionPoint$(new zt(r, s).id)) == null || l.pipe(
1194
- Se((h) => h.value !== o),
1195
- pt()
1361
+ }), (l = this._permissionService.getPermissionPoint$(new Zt(r, s).id)) == null || l.pipe(
1362
+ ve((h) => h.value !== o),
1363
+ St()
1196
1364
  ).subscribe({
1197
1365
  complete: () => {
1198
1366
  o = !0, this._drawingManagerService.setDrawingVisible(!0);
@@ -1205,43 +1373,43 @@ let Pt = class extends ae {
1205
1373
  );
1206
1374
  }
1207
1375
  _initEditPermissionChange() {
1208
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
1376
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(V.UNIVER_SHEET);
1209
1377
  this.disposeWithMe(
1210
- ft([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1378
+ vt([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1211
1379
  e && e.activeSheet$.subscribe((t) => {
1212
1380
  var l;
1213
1381
  if (!t)
1214
1382
  return;
1215
1383
  const r = e.getUnitId(), s = t.getSheetId();
1216
1384
  let o = !0;
1217
- const c = this._renderManagerService.getRenderById(r), d = c == null ? void 0 : c.scene;
1218
- if (d == null)
1385
+ const d = this._renderManagerService.getRenderById(r), a = d == null ? void 0 : d.scene;
1386
+ if (a == null)
1219
1387
  return;
1220
- const g = d.getTransformerByCreate(), a = this._permissionService.composePermission$([new Qt(r).id, new Dt(r, s).id]).pipe(He((h) => h.every((u) => u.value)));
1221
- a == null || a.pipe(
1222
- Se((h) => h !== o),
1223
- pt()
1388
+ const g = a.getTransformerByCreate(), c = this._permissionService.composePermission$([new tn(r).id, new Ot(r, s).id]).pipe(qe((h) => h.every((u) => u.value)));
1389
+ c == null || c.pipe(
1390
+ ve((h) => h !== o),
1391
+ St()
1224
1392
  ).subscribe({
1225
1393
  next: (h) => {
1226
1394
  o = h, this._drawingManagerService.setDrawingEditable(h);
1227
- const u = d.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), p = Object.values(m);
1228
- h ? (u.forEach((f) => {
1229
- f.classType === je.IMAGE && p.some((w) => f.oKey.includes(w.drawingId)) && d.attachTransformerTo(f);
1230
- }), this._drawingManagerService.addNotification(p)) : (u.forEach((f) => {
1231
- f.classType === je.IMAGE && p.some((w) => f.oKey.includes(w.drawingId)) && d.detachTransformerFrom(f);
1395
+ const u = a.getAllObjectsByOrder(), f = this._drawingManagerService.getDrawingData(r, s), p = Object.values(f);
1396
+ h ? (u.forEach((m) => {
1397
+ m.classType === Be.IMAGE && p.some((w) => m.oKey.includes(w.drawingId)) && a.attachTransformerTo(m);
1398
+ }), this._drawingManagerService.addNotification(p)) : (u.forEach((m) => {
1399
+ m.classType === Be.IMAGE && p.some((w) => m.oKey.includes(w.drawingId)) && a.detachTransformerFrom(m);
1232
1400
  }), g.clearSelectedObjects());
1233
1401
  }
1234
- }), (l = this._permissionService.getPermissionPoint$(new Dt(r, s).id)) == null || l.pipe(
1235
- Se((h) => h.value !== o),
1236
- pt()
1402
+ }), (l = this._permissionService.getPermissionPoint$(new Ot(r, s).id)) == null || l.pipe(
1403
+ ve((h) => h.value !== o),
1404
+ St()
1237
1405
  ).subscribe({
1238
1406
  complete: () => {
1239
1407
  o = !0;
1240
- const h = e.getUnitId(), u = t.getSheetId(), m = this._drawingManagerService.getDrawingData(h, u), p = Object.values(m), f = this._renderManagerService.getRenderById(h), w = f == null ? void 0 : f.scene;
1408
+ const h = e.getUnitId(), u = t.getSheetId(), f = this._drawingManagerService.getDrawingData(h, u), p = Object.values(f), m = this._renderManagerService.getRenderById(h), w = m == null ? void 0 : m.scene;
1241
1409
  if (w == null)
1242
1410
  return;
1243
1411
  this._drawingManagerService.setDrawingEditable(!0), w.getAllObjectsByOrder().forEach((I) => {
1244
- I.classType === je.IMAGE && p.some((D) => I.oKey.includes(D.drawingId)) && w.detachTransformerFrom(I);
1412
+ I.classType === Be.IMAGE && p.some((D) => I.oKey.includes(D.drawingId)) && w.detachTransformerFrom(I);
1245
1413
  });
1246
1414
  }
1247
1415
  });
@@ -1250,19 +1418,19 @@ let Pt = class extends ae {
1250
1418
  );
1251
1419
  }
1252
1420
  };
1253
- Pt = js([
1254
- Xe(0, de),
1255
- Xe(1, Q),
1256
- Xe(2, Yr),
1257
- Xe(3, ke),
1258
- Xe(4, N(Fr))
1259
- ], Pt);
1260
- var Ws = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, Bs = (i, e, n, t) => {
1261
- for (var r = t > 1 ? void 0 : t ? xs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1421
+ Nt = Ys([
1422
+ Je(0, te),
1423
+ Je(1, Z),
1424
+ Je(2, Vr),
1425
+ Je(3, Ye),
1426
+ Je(4, N(Xr))
1427
+ ], Nt);
1428
+ var Gs = Object.defineProperty, Xs = Object.getOwnPropertyDescriptor, Vs = (i, e, n, t) => {
1429
+ for (var r = t > 1 ? void 0 : t ? Xs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1262
1430
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1263
- return t && r && Ws(e, n, r), r;
1264
- }, St = (i, e) => (n, t) => e(n, t, i);
1265
- let Ut = class extends ae {
1431
+ return t && r && Gs(e, n, r), r;
1432
+ }, Rt = (i, e) => (n, t) => e(n, t, i);
1433
+ let jt = class extends oe {
1266
1434
  constructor(i, e, n, t) {
1267
1435
  super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = e, this._drawingManagerService = n, this._renderManagerService = t, this._initPrinting();
1268
1436
  }
@@ -1272,9 +1440,9 @@ let Ut = class extends ae {
1272
1440
  this._sheetPrintInterceptorService.interceptor.getInterceptPoints().PRINTING_COMPONENT_COLLECT,
1273
1441
  {
1274
1442
  handler: (i, e, n) => {
1275
- const { unitId: t, scene: r, subUnitId: s } = e, o = this._drawingManagerService.getDrawingDataForUnit(t), c = o == null ? void 0 : o[s];
1276
- return c && c.order.forEach((d) => {
1277
- this._drawingRenderService.renderDrawing(c.data[d], r);
1443
+ const { unitId: t, scene: r, subUnitId: s } = e, o = this._drawingManagerService.getDrawingDataForUnit(t), d = o == null ? void 0 : o[s];
1444
+ return d && d.order.forEach((a) => {
1445
+ this._drawingRenderService.renderDrawing(d.data[a], r);
1278
1446
  }), n();
1279
1447
  }
1280
1448
  }
@@ -1287,17 +1455,17 @@ let Ut = class extends ae {
1287
1455
  const { unitId: t, subUnitId: r } = e, s = this._renderManagerService.getRenderById(t);
1288
1456
  if (!s)
1289
1457
  return n(i);
1290
- const o = s.with(H).getWorksheetSkeleton(r);
1458
+ const o = s.with(G).getWorksheetSkeleton(r);
1291
1459
  if (!o)
1292
1460
  return n(i);
1293
- const c = this._drawingManagerService.getDrawingDataForUnit(t), d = c == null ? void 0 : c[e.subUnitId];
1294
- if (!d)
1461
+ const d = this._drawingManagerService.getDrawingDataForUnit(t), a = d == null ? void 0 : d[e.subUnitId];
1462
+ if (!a)
1295
1463
  return n(i);
1296
- const { scaleX: g, scaleY: a } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, h = d.order.map((u) => d.data[u]).filter((u) => u.drawingType !== L.DRAWING_DOM);
1464
+ const { scaleX: g, scaleY: c } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, h = a.order.map((u) => a.data[u]).filter((u) => u.drawingType !== L.DRAWING_DOM);
1297
1465
  return h.length ? (h.forEach((u) => {
1298
- if (!u.groupId && u.transform && ye.isDefine(u.transform.left) && ye.isDefine(u.transform.top) && ye.isDefine(u.transform.width) && ye.isDefine(u.transform.height)) {
1299
- const m = o.skeleton.getCellIndexByOffset(u.transform.left, u.transform.top, g, a, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(u.transform.left + u.transform.width, u.transform.top + u.transform.height, g, a, { x: 0, y: 0 });
1300
- m.column < l.startColumn && (l.startColumn = m.column), m.row < l.startRow && (l.startRow = m.row), l.endRow < p.row && (l.endRow = p.row), l.endColumn < p.column && (l.endColumn = p.column);
1466
+ if (!u.groupId && u.transform && Oe.isDefine(u.transform.left) && Oe.isDefine(u.transform.top) && Oe.isDefine(u.transform.width) && Oe.isDefine(u.transform.height)) {
1467
+ const f = o.skeleton.getCellIndexByOffset(u.transform.left, u.transform.top, g, c, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(u.transform.left + u.transform.width, u.transform.top + u.transform.height, g, c, { x: 0, y: 0 });
1468
+ f.column < l.startColumn && (l.startColumn = f.column), f.row < l.startRow && (l.startRow = f.row), l.endRow < p.row && (l.endRow = p.row), l.endColumn < p.column && (l.endColumn = p.column);
1301
1469
  }
1302
1470
  }), n(l)) : n(i);
1303
1471
  }
@@ -1306,104 +1474,104 @@ let Ut = class extends ae {
1306
1474
  );
1307
1475
  }
1308
1476
  };
1309
- Ut = Bs([
1310
- St(0, N(Ii)),
1311
- St(1, N(Nn)),
1312
- St(2, de),
1313
- St(3, Q)
1314
- ], Ut);
1315
- var $s = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, Ls = (i, e, n, t) => {
1316
- for (var r = t > 1 ? void 0 : t ? ks(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1477
+ jt = Vs([
1478
+ Rt(0, N(Di)),
1479
+ Rt(1, N(Wn)),
1480
+ Rt(2, te),
1481
+ Rt(3, Z)
1482
+ ], jt);
1483
+ var Hs = Object.defineProperty, zs = Object.getOwnPropertyDescriptor, Ks = (i, e, n, t) => {
1484
+ for (var r = t > 1 ? void 0 : t ? zs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1317
1485
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1318
- return t && r && $s(e, n, r), r;
1319
- }, we = (i, e) => (n, t) => e(n, t, i);
1320
- const Fs = [
1321
- Fn.id,
1322
- Yn.id,
1486
+ return t && r && Hs(e, n, r), r;
1487
+ }, pe = (i, e) => (n, t) => e(n, t, i);
1488
+ const Js = [
1323
1489
  Gn.id,
1324
1490
  Xn.id,
1325
1491
  Vn.id,
1326
1492
  Hn.id,
1327
1493
  zn.id,
1328
1494
  Kn.id,
1329
- en.id,
1330
- tn.id,
1331
1495
  Jn.id,
1332
1496
  Zn.id,
1497
+ nn.id,
1498
+ rn.id,
1333
1499
  qn.id,
1334
1500
  Qn.id,
1335
1501
  er.id,
1336
1502
  tr.id,
1337
1503
  nr.id,
1338
1504
  rr.id,
1339
- ir.id
1340
- ], Ys = [
1341
- Fi.id,
1342
- Yi.id,
1343
- Gi.id,
1344
- Xi.id,
1345
- $n.id,
1346
- kn.id
1505
+ ir.id,
1506
+ sr.id,
1507
+ or.id
1508
+ ], Zs = [
1509
+ Hi.id,
1510
+ zi.id,
1511
+ Ki.id,
1512
+ Ji.id,
1513
+ Ln.id,
1514
+ Fn.id
1347
1515
  ];
1348
- let on = class extends ae {
1349
- constructor(i, e, n, t, r, s, o, c, d) {
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 = c, this._univerInstanceService = d, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
1516
+ let cn = class extends oe {
1517
+ constructor(i, e, n, t, r, s, o, d, a) {
1518
+ 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 = a, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
1351
1519
  }
1352
1520
  _sheetInterceptorListener() {
1353
1521
  this.disposeWithMe(
1354
1522
  this._sheetInterceptorService.interceptCommand({
1355
1523
  getMutations: (i) => {
1356
- if (!Fs.includes(i.id))
1524
+ if (!Js.includes(i.id))
1357
1525
  return { redos: [], undos: [] };
1358
1526
  if (i.params == null)
1359
1527
  return { redos: [], undos: [] };
1360
1528
  const e = i.id;
1361
- if (e === Fn.id)
1529
+ if (e === Gn.id)
1362
1530
  return this._moveRowInterceptor(i.params, "insert");
1363
- if ([nr.id, rr.id, ir.id].includes(e))
1531
+ if ([ir.id, sr.id, or.id].includes(e))
1364
1532
  return this._moveRangeInterceptor(i.params);
1365
- if (e === Yn.id)
1533
+ if (e === Xn.id)
1366
1534
  return this._moveColInterceptor(i.params, "insert");
1367
- if (e === Gn.id)
1535
+ if (e === Vn.id)
1368
1536
  return this._moveRowInterceptor(i.params, "remove");
1369
- if (e === Xn.id)
1537
+ if (e === Hn.id)
1370
1538
  return this._moveColInterceptor(i.params, "remove");
1371
- if (e === Vn.id) {
1539
+ if (e === zn.id) {
1372
1540
  const { range: n } = i.params;
1373
1541
  return this._getRangeMoveUndo(
1374
1542
  n,
1375
1543
  0
1376
1544
  /* deleteLeft */
1377
1545
  );
1378
- } else if (e === Hn.id) {
1546
+ } else if (e === Kn.id) {
1379
1547
  const { range: n } = i.params;
1380
1548
  return this._getRangeMoveUndo(
1381
1549
  n,
1382
1550
  1
1383
1551
  /* deleteUp */
1384
1552
  );
1385
- } else if (e === zn.id) {
1553
+ } else if (e === Jn.id) {
1386
1554
  const { range: n } = i.params;
1387
1555
  return this._getRangeMoveUndo(
1388
1556
  n,
1389
1557
  2
1390
1558
  /* insertDown */
1391
1559
  );
1392
- } else if (e === Kn.id) {
1560
+ } else if (e === Zn.id) {
1393
1561
  const { range: n } = i.params;
1394
1562
  return this._getRangeMoveUndo(
1395
1563
  n,
1396
1564
  3
1397
1565
  /* insertRight */
1398
1566
  );
1399
- } else if (e === qn.id || e === Qn.id) {
1567
+ } else if (e === er.id || e === tr.id) {
1400
1568
  const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
1401
1569
  return this._getDrawingUndoForRowVisible(t, r, s);
1402
- } else if (e === er.id || e === tr.id) {
1570
+ } else if (e === nr.id || e === rr.id) {
1403
1571
  const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
1404
1572
  return this._getDrawingUndoForColVisible(t, r, s);
1405
- } else if (e === en.id || e === tn.id || e === Jn.id || e === Zn.id) {
1406
- const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e === en.id || e === tn.id;
1573
+ } else if (e === nn.id || e === rn.id || e === qn.id || e === Qn.id) {
1574
+ const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e === nn.id || e === rn.id;
1407
1575
  return this._getDrawingUndoForRowAndColSize(t, r, s, o);
1408
1576
  }
1409
1577
  return { redos: [], undos: [] };
@@ -1412,21 +1580,21 @@ let on = class extends ae {
1412
1580
  );
1413
1581
  }
1414
1582
  _getRangeMoveUndo(i, e) {
1415
- const n = Y(this._univerInstanceService);
1583
+ const n = X(this._univerInstanceService);
1416
1584
  if (n == null)
1417
1585
  return { redos: [], undos: [] };
1418
- const t = n.unitId, r = n.subUnitId, s = [], o = [], c = this._sheetDrawingService.getDrawingData(t, r), d = [], g = [];
1419
- if (Object.keys(c).forEach((a) => {
1420
- const l = c[a], { updateDrawings: h, deleteDrawings: u } = this._getUpdateOrDeleteDrawings(i, e, l);
1421
- d.push(...h), g.push(...u);
1422
- }), d.length === 0 && g.length === 0)
1586
+ const t = n.unitId, r = n.subUnitId, s = [], o = [], d = this._sheetDrawingService.getDrawingData(t, r), a = [], g = [];
1587
+ if (Object.keys(d).forEach((c) => {
1588
+ const l = d[c], { updateDrawings: h, deleteDrawings: u } = this._getUpdateOrDeleteDrawings(i, e, l);
1589
+ a.push(...h), g.push(...u);
1590
+ }), a.length === 0 && g.length === 0)
1423
1591
  return { redos: [], undos: [] };
1424
- if (d.length > 0) {
1425
- const a = this._sheetDrawingService.getBatchUpdateOp(d), { undo: l, redo: h, objects: u } = a;
1592
+ if (a.length > 0) {
1593
+ const c = this._sheetDrawingService.getBatchUpdateOp(a), { undo: l, redo: h, objects: u } = c;
1426
1594
  s.push({ id: P.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: U.UPDATE } }), o.push({ id: P.id, params: { unitId: t, subUnitId: r, op: l, objects: u, type: U.UPDATE } });
1427
1595
  }
1428
1596
  if (g.length > 0) {
1429
- const a = this._sheetDrawingService.getBatchRemoveOp(g), l = a.undo, h = a.redo, u = a.objects;
1597
+ const c = this._sheetDrawingService.getBatchRemoveOp(g), l = c.undo, h = c.redo, u = c.objects;
1430
1598
  s.push({ id: P.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: U.REMOVE } }), o.push({ id: P.id, params: { unitId: t, subUnitId: r, op: l, objects: u, type: U.INSERT } });
1431
1599
  }
1432
1600
  return s.push({ id: k.id, params: [t] }), o.push({ id: k.id, params: [t] }), {
@@ -1435,43 +1603,43 @@ let on = class extends ae {
1435
1603
  };
1436
1604
  }
1437
1605
  _getUpdateOrDeleteDrawings(i, e, n) {
1438
- const t = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: c, unitId: d, subUnitId: g, drawingId: a } = n, { from: l, to: h } = s, { row: u, column: m } = l, { row: p, column: f } = h;
1439
- if (s == null || c == null)
1606
+ const t = [], r = [], { sheetTransform: s, anchorType: o = T.Position, transform: d, unitId: a, subUnitId: g, drawingId: c } = n, { from: l, to: h } = s, { row: u, column: f } = l, { row: p, column: m } = h;
1607
+ if (s == null || d == null)
1440
1608
  return {
1441
1609
  updateDrawings: t,
1442
1610
  deleteDrawings: r
1443
1611
  };
1444
1612
  const { startRow: w, endRow: S, startColumn: I, endColumn: D } = i;
1445
- let v = null, R = null;
1613
+ let v = null, C = null;
1446
1614
  if (e === 0 && u >= w && p <= S)
1447
- if (m >= I && f <= D)
1448
- r.push({ unitId: d, subUnitId: g, drawingId: a });
1615
+ if (f >= I && m <= D)
1616
+ r.push({ unitId: a, subUnitId: g, drawingId: c });
1449
1617
  else {
1450
- const _ = this._shrinkCol(s, c, I, D, o);
1451
- v = _ == null ? void 0 : _.newSheetTransform, R = _ == null ? void 0 : _.newTransform;
1618
+ const _ = this._shrinkCol(s, d, I, D, o);
1619
+ v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
1452
1620
  }
1453
- else if (e === 1 && m >= I && f <= D)
1621
+ else if (e === 1 && f >= I && m <= D)
1454
1622
  if (u >= w && p <= S)
1455
- r.push({ unitId: d, subUnitId: g, drawingId: a });
1623
+ r.push({ unitId: a, subUnitId: g, drawingId: c });
1456
1624
  else {
1457
- const _ = this._shrinkRow(s, c, w, S, o);
1458
- v = _ == null ? void 0 : _.newSheetTransform, R = _ == null ? void 0 : _.newTransform;
1625
+ const _ = this._shrinkRow(s, d, w, S, o);
1626
+ v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
1459
1627
  }
1460
1628
  else if (e === 2) {
1461
- const _ = this._expandRow(s, c, w, S, o);
1462
- v = _ == null ? void 0 : _.newSheetTransform, R = _ == null ? void 0 : _.newTransform;
1629
+ const _ = this._expandRow(s, d, w, S, o);
1630
+ v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
1463
1631
  } else if (e === 3) {
1464
- const _ = this._expandCol(s, c, I, D, o);
1465
- v = _ == null ? void 0 : _.newSheetTransform, R = _ == null ? void 0 : _.newTransform;
1632
+ const _ = this._expandCol(s, d, I, D, o);
1633
+ v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
1466
1634
  }
1467
- if (v != null && R != null) {
1468
- const _ = V(v, this._selectionRenderService, this._skeletonManagerService);
1635
+ if (v != null && C != null) {
1636
+ const _ = H(v, this._selectionRenderService, this._skeletonManagerService);
1469
1637
  t.push({ ...n, sheetTransform: v, transform: _ });
1470
1638
  }
1471
1639
  return { updateDrawings: t, deleteDrawings: r };
1472
1640
  }
1473
1641
  _remainDrawingSize(i, e, n) {
1474
- const t = $({ ...i }, this._selectionRenderService);
1642
+ const t = x({ ...i }, this._selectionRenderService);
1475
1643
  t != null && e.push({
1476
1644
  ...n,
1477
1645
  sheetTransform: t
@@ -1480,65 +1648,65 @@ let on = class extends ae {
1480
1648
  // eslint-disable-next-line max-lines-per-function
1481
1649
  _getDrawingUndoForColVisible(i, e, n) {
1482
1650
  const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
1483
- if (Object.keys(t).forEach((a) => {
1484
- const l = t[a], { sheetTransform: h, transform: u, anchorType: m = O.Position } = l;
1485
- if (m === O.None)
1651
+ if (Object.keys(t).forEach((c) => {
1652
+ const l = t[c], { sheetTransform: h, transform: u, anchorType: f = T.Position } = l;
1653
+ if (f === T.None)
1486
1654
  this._remainDrawingSize(u, r, l);
1487
1655
  else {
1488
- const { from: p, to: f } = h, { row: w, column: S } = p, { row: I, column: D } = f;
1656
+ const { from: p, to: m } = h, { row: w, column: S } = p, { row: I, column: D } = m;
1489
1657
  for (let v = 0; v < n.length; v++) {
1490
- const R = n[v], { startRow: _, endRow: E, startColumn: M, endColumn: A } = R;
1658
+ const C = n[v], { startRow: _, endRow: E, startColumn: M, endColumn: y } = C;
1491
1659
  if (D < M)
1492
1660
  continue;
1493
- if (m === O.Position) {
1494
- let C = null, y = null;
1495
- if (S >= M && S <= A) {
1496
- const W = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: A, startRow: p.row, endRow: f.row });
1497
- if (W == null)
1661
+ if (f === T.Position) {
1662
+ let R = null, O = null;
1663
+ if (S >= M && S <= y) {
1664
+ const $ = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: y, startRow: p.row, endRow: m.row });
1665
+ if ($ == null)
1498
1666
  return;
1499
- y = { ...u, left: W.startX };
1667
+ O = { ...u, left: $.startX };
1500
1668
  }
1501
- if (y != null && (C = $(y, this._selectionRenderService), C != null && y != null)) {
1502
- r.push({ ...l, sheetTransform: C, transform: y });
1669
+ if (O != null && (R = x(O, this._selectionRenderService), R != null && O != null)) {
1670
+ r.push({ ...l, sheetTransform: R, transform: O });
1503
1671
  break;
1504
1672
  }
1505
1673
  this._remainDrawingSize(u, r, l);
1506
1674
  continue;
1507
1675
  }
1508
- if (S >= M && D <= A)
1676
+ if (S >= M && D <= y)
1509
1677
  continue;
1510
- let T = null, b = null;
1511
- if (S >= M && S <= A) {
1512
- const C = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: A, startRow: p.row, endRow: f.row });
1513
- if (C == null)
1678
+ let A = null, b = null;
1679
+ if (S >= M && S <= y) {
1680
+ const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: y, startRow: p.row, endRow: m.row });
1681
+ if (R == null)
1514
1682
  return;
1515
1683
  b = {
1516
1684
  ...u,
1517
- left: (C == null ? void 0 : C.startX) || 0,
1518
- width: ((u == null ? void 0 : u.width) || 0) - C.endX + C.startX
1685
+ left: (R == null ? void 0 : R.startX) || 0,
1686
+ width: ((u == null ? void 0 : u.width) || 0) - R.endX + R.startX
1519
1687
  };
1520
- } else if (D >= M && D <= A) {
1521
- const C = this._skeletonManagerService.attachRangeWithCoord({ startColumn: M, endColumn: D, startRow: p.row, endRow: f.row });
1522
- if (C == null)
1688
+ } else if (D >= M && D <= y) {
1689
+ const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: M, endColumn: D, startRow: p.row, endRow: m.row });
1690
+ if (R == null)
1523
1691
  return;
1524
1692
  b = {
1525
1693
  ...u,
1526
- left: C.startX - ((u == null ? void 0 : u.width) || 0)
1694
+ left: R.startX - ((u == null ? void 0 : u.width) || 0)
1527
1695
  };
1528
1696
  } else {
1529
- const C = this._skeletonManagerService.attachRangeWithCoord({ startColumn: M, endColumn: A, startRow: p.row, endRow: f.row });
1530
- if (C == null)
1697
+ const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: M, endColumn: y, startRow: p.row, endRow: m.row });
1698
+ if (R == null)
1531
1699
  return;
1532
1700
  if (b = {
1533
1701
  ...u,
1534
- width: ((u == null ? void 0 : u.width) || 0) - C.endX + C.startX
1535
- }, T = $(b, this._selectionRenderService), T != null && b != null) {
1536
- s.push({ ...l, sheetTransform: T, transform: b });
1702
+ width: ((u == null ? void 0 : u.width) || 0) - R.endX + R.startX
1703
+ }, A = x(b, this._selectionRenderService), A != null && b != null) {
1704
+ s.push({ ...l, sheetTransform: A, transform: b });
1537
1705
  break;
1538
1706
  }
1539
1707
  }
1540
- if (b != null && (T = $(b, this._selectionRenderService)), b != null && T != null) {
1541
- r.push({ ...l, sheetTransform: T, transform: b });
1708
+ if (b != null && (A = x(b, this._selectionRenderService)), b != null && A != null) {
1709
+ r.push({ ...l, sheetTransform: A, transform: b });
1542
1710
  break;
1543
1711
  } else
1544
1712
  this._remainDrawingSize(u, r, l);
@@ -1546,54 +1714,54 @@ let on = class extends ae {
1546
1714
  }
1547
1715
  }), r.length === 0 && s.length === 0)
1548
1716
  return { redos: [], undos: [] };
1549
- const { redos: o, undos: c } = this._createUndoAndRedoMutation(i, e, r), d = [], g = [];
1717
+ const { redos: o, undos: d } = this._createUndoAndRedoMutation(i, e, r), a = [], g = [];
1550
1718
  if (s.length > 0) {
1551
- const { redos: a, undos: l } = this._createUndoAndRedoMutation(i, e, s);
1552
- d.push(...a), g.push(...l);
1719
+ const { redos: c, undos: l } = this._createUndoAndRedoMutation(i, e, s);
1720
+ a.push(...c), g.push(...l);
1553
1721
  }
1554
1722
  return {
1555
1723
  redos: o,
1556
- undos: c,
1557
- preRedos: d,
1724
+ undos: d,
1725
+ preRedos: a,
1558
1726
  preUndos: g
1559
1727
  };
1560
1728
  }
1561
1729
  _createUndoAndRedoMutation(i, e, n) {
1562
- const t = this._sheetDrawingService.getBatchUpdateOp(n), { undo: r, redo: s, objects: o } = t, c = [
1730
+ const t = this._sheetDrawingService.getBatchUpdateOp(n), { undo: r, redo: s, objects: o } = t, d = [
1563
1731
  { id: P.id, params: { unitId: i, subUnitId: e, op: s, objects: o, type: U.UPDATE } },
1564
1732
  { id: k.id, params: [i] }
1565
- ], d = [
1733
+ ], a = [
1566
1734
  { id: P.id, params: { unitId: i, subUnitId: e, op: r, objects: o, type: U.UPDATE } },
1567
1735
  { id: k.id, params: [i] }
1568
1736
  ];
1569
1737
  return {
1570
- redos: c,
1571
- undos: d
1738
+ redos: d,
1739
+ undos: a
1572
1740
  };
1573
1741
  }
1574
1742
  // eslint-disable-next-line max-lines-per-function
1575
1743
  _getDrawingUndoForRowVisible(i, e, n) {
1576
1744
  const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
1577
- if (Object.keys(t).forEach((a) => {
1578
- const l = t[a], { sheetTransform: h, transform: u, anchorType: m = O.Position } = l;
1579
- if (m === O.None)
1745
+ if (Object.keys(t).forEach((c) => {
1746
+ const l = t[c], { sheetTransform: h, transform: u, anchorType: f = T.Position } = l;
1747
+ if (f === T.None)
1580
1748
  this._remainDrawingSize(u, r, l);
1581
1749
  else {
1582
- const { from: p, to: f } = h, { row: w, column: S } = p, { row: I, column: D } = f;
1750
+ const { from: p, to: m } = h, { row: w, column: S } = p, { row: I, column: D } = m;
1583
1751
  for (let v = 0; v < n.length; v++) {
1584
- const R = n[v], { startRow: _, endRow: E, startColumn: M, endColumn: A } = R;
1752
+ const C = n[v], { startRow: _, endRow: E, startColumn: M, endColumn: y } = C;
1585
1753
  if (I < _)
1586
1754
  continue;
1587
- if (m === O.Position) {
1588
- let C = null, y = null;
1755
+ if (f === T.Position) {
1756
+ let R = null, O = null;
1589
1757
  if (w >= _ && w <= E) {
1590
- const W = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: E });
1591
- if (W == null)
1758
+ const $ = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: E });
1759
+ if ($ == null)
1592
1760
  return;
1593
- y = { ...u, top: W.startY };
1761
+ O = { ...u, top: $.startY };
1594
1762
  }
1595
- if (y != null && (C = $(y, this._selectionRenderService), C != null && y != null)) {
1596
- r.push({ ...l, sheetTransform: C, transform: y });
1763
+ if (O != null && (R = x(O, this._selectionRenderService), R != null && O != null)) {
1764
+ r.push({ ...l, sheetTransform: R, transform: O });
1597
1765
  break;
1598
1766
  }
1599
1767
  this._remainDrawingSize(u, r, l);
@@ -1601,38 +1769,38 @@ let on = class extends ae {
1601
1769
  }
1602
1770
  if (w >= _ && I <= E)
1603
1771
  continue;
1604
- let T = null, b = null;
1772
+ let A = null, b = null;
1605
1773
  if (w >= _ && w <= E) {
1606
- const C = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: E });
1607
- if (C == null)
1774
+ const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: E });
1775
+ if (R == null)
1608
1776
  return;
1609
1777
  b = {
1610
1778
  ...u,
1611
- top: (C == null ? void 0 : C.startY) || 0,
1612
- height: ((u == null ? void 0 : u.height) || 0) - C.endY + C.startY
1779
+ top: (R == null ? void 0 : R.startY) || 0,
1780
+ height: ((u == null ? void 0 : u.height) || 0) - R.endY + R.startY
1613
1781
  };
1614
1782
  } else if (I >= _ && I <= E) {
1615
- const C = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: _, endRow: I });
1616
- if (C == null)
1783
+ const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: I });
1784
+ if (R == null)
1617
1785
  return;
1618
1786
  b = {
1619
1787
  ...u,
1620
- top: C.startY - ((u == null ? void 0 : u.height) || 0)
1788
+ top: R.startY - ((u == null ? void 0 : u.height) || 0)
1621
1789
  };
1622
1790
  } else {
1623
- const C = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: _, endRow: E });
1624
- if (C == null)
1791
+ const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: E });
1792
+ if (R == null)
1625
1793
  return;
1626
1794
  if (b = {
1627
1795
  ...u,
1628
- height: ((u == null ? void 0 : u.height) || 0) - C.endY + C.startY
1629
- }, T = $(b, this._selectionRenderService), T != null && b != null) {
1630
- s.push({ ...l, sheetTransform: T, transform: b });
1796
+ height: ((u == null ? void 0 : u.height) || 0) - R.endY + R.startY
1797
+ }, A = x(b, this._selectionRenderService), A != null && b != null) {
1798
+ s.push({ ...l, sheetTransform: A, transform: b });
1631
1799
  break;
1632
1800
  }
1633
1801
  }
1634
- if (b != null && (T = $(b, this._selectionRenderService)), b != null && T != null) {
1635
- r.push({ ...l, sheetTransform: T, transform: b });
1802
+ if (b != null && (A = x(b, this._selectionRenderService)), b != null && A != null) {
1803
+ r.push({ ...l, sheetTransform: A, transform: b });
1636
1804
  break;
1637
1805
  } else
1638
1806
  this._remainDrawingSize(u, r, l);
@@ -1640,42 +1808,42 @@ let on = class extends ae {
1640
1808
  }
1641
1809
  }), r.length === 0 && s.length === 0)
1642
1810
  return { redos: [], undos: [] };
1643
- const { redos: o, undos: c } = this._createUndoAndRedoMutation(i, e, r), d = [], g = [];
1811
+ const { redos: o, undos: d } = this._createUndoAndRedoMutation(i, e, r), a = [], g = [];
1644
1812
  if (s.length > 0) {
1645
- const { redos: a, undos: l } = this._createUndoAndRedoMutation(i, e, s);
1646
- d.push(...a), g.push(...l);
1813
+ const { redos: c, undos: l } = this._createUndoAndRedoMutation(i, e, s);
1814
+ a.push(...c), g.push(...l);
1647
1815
  }
1648
1816
  return {
1649
1817
  redos: o,
1650
- undos: c,
1651
- preRedos: d,
1818
+ undos: d,
1819
+ preRedos: a,
1652
1820
  preUndos: g
1653
1821
  };
1654
1822
  }
1655
1823
  _getDrawingUndoForRowAndColSize(i, e, n, t) {
1656
1824
  const r = this._drawingManagerService.getDrawingData(i, e), s = [];
1657
1825
  return Object.keys(r).forEach((o) => {
1658
- const c = r[o], { sheetTransform: d, transform: g, anchorType: a = O.Position } = c;
1659
- if (a === O.None)
1660
- this._remainDrawingSize(g, s, c);
1826
+ const d = r[o], { sheetTransform: a, transform: g, anchorType: c = T.Position } = d;
1827
+ if (c === T.None)
1828
+ this._remainDrawingSize(g, s, d);
1661
1829
  else {
1662
- const { from: l, to: h } = d, { row: u, column: m } = l, { row: p, column: f } = h;
1830
+ const { from: l, to: h } = a, { row: u, column: f } = l, { row: p, column: m } = h;
1663
1831
  for (let w = 0; w < n.length; w++) {
1664
- const S = n[w], { startRow: I, endRow: D, startColumn: v, endColumn: R } = S;
1665
- if (p < I || f < v)
1832
+ const S = n[w], { startRow: I, endRow: D, startColumn: v, endColumn: C } = S;
1833
+ if (p < I || m < v)
1666
1834
  continue;
1667
- if (a === O.Position && (u <= I && p >= D || m <= v && f >= R)) {
1668
- this._remainDrawingSize(g, s, c);
1835
+ if (c === T.Position && (u <= I && p >= D || f <= v && m >= C)) {
1836
+ this._remainDrawingSize(g, s, d);
1669
1837
  continue;
1670
1838
  }
1671
- const _ = V(
1672
- { ...d },
1839
+ const _ = H(
1840
+ { ...a },
1673
1841
  this._selectionRenderService,
1674
1842
  this._skeletonManagerService
1675
1843
  );
1676
1844
  if (_ != null) {
1677
1845
  s.push({
1678
- ...c,
1846
+ ...d,
1679
1847
  transform: _
1680
1848
  });
1681
1849
  break;
@@ -1689,7 +1857,7 @@ let on = class extends ae {
1689
1857
  if (e === "insert")
1690
1858
  n = i.unitId, t = i.subUnitId;
1691
1859
  else {
1692
- const r = Y(this._univerInstanceService);
1860
+ const r = X(this._univerInstanceService);
1693
1861
  if (r == null)
1694
1862
  return;
1695
1863
  n = r.unitId, t = r.subUnitId;
@@ -1698,36 +1866,36 @@ let on = class extends ae {
1698
1866
  }
1699
1867
  _moveRangeInterceptor(i) {
1700
1868
  var I, D;
1701
- const { toRange: e, fromRange: n } = i, t = Y(this._univerInstanceService);
1869
+ const { toRange: e, fromRange: n } = i, t = X(this._univerInstanceService);
1702
1870
  if (!t)
1703
1871
  return { redos: [], undos: [] };
1704
- const { unitId: r, subUnitId: s } = t, o = (D = (I = this._renderManagerService.getRenderById(r)) == null ? void 0 : I.with(H)) == null ? void 0 : D.getCurrentSkeleton();
1872
+ const { unitId: r, subUnitId: s } = t, o = (D = (I = this._renderManagerService.getRenderById(r)) == null ? void 0 : I.with(G)) == null ? void 0 : D.getCurrentSkeleton();
1705
1873
  if (!o)
1706
1874
  return { redos: [], undos: [] };
1707
- const c = Wn(o, n);
1708
- if (!c)
1875
+ const d = $n(o, n);
1876
+ if (!d)
1709
1877
  return { redos: [], undos: [] };
1710
- const { startX: d, endX: g, startY: a, endY: l } = c, h = this._sheetDrawingService.getDrawingData(r, s), u = [];
1878
+ const { startX: a, endX: g, startY: c, endY: l } = d, h = this._sheetDrawingService.getDrawingData(r, s), u = [];
1711
1879
  Object.keys(h).forEach((v) => {
1712
- const R = h[v];
1713
- if (R.anchorType !== O.Both)
1880
+ const C = h[v];
1881
+ if (C.anchorType !== T.Both)
1714
1882
  return;
1715
- const { transform: _ } = R;
1883
+ const { transform: _ } = C;
1716
1884
  if (!_)
1717
1885
  return;
1718
- const { left: E = 0, top: M = 0, width: A = 0, height: T = 0 } = _, { drawingStartX: b, drawingEndX: C, drawingStartY: y, drawingEndY: W } = {
1886
+ const { left: E = 0, top: M = 0, width: y = 0, height: A = 0 } = _, { drawingStartX: b, drawingEndX: R, drawingStartY: O, drawingEndY: $ } = {
1719
1887
  drawingStartX: E,
1720
- drawingEndX: E + A,
1888
+ drawingEndX: E + y,
1721
1889
  drawingStartY: M,
1722
- drawingEndY: M + T
1890
+ drawingEndY: M + A
1723
1891
  };
1724
- d <= b && C <= g && a <= y && W <= l && u.push(R);
1892
+ a <= b && R <= g && c <= O && $ <= l && u.push(C);
1725
1893
  });
1726
- const m = [], p = [], f = e.startRow - n.startRow, w = e.startColumn - n.startColumn, S = u.map((v) => {
1727
- const R = v.sheetTransform, _ = {
1728
- to: { ...R.to, row: R.to.row + f, column: R.to.column + w },
1729
- from: { ...R.from, row: R.from.row + f, column: R.from.column + w }
1730
- }, E = V(_, this._selectionRenderService, this._skeletonManagerService);
1894
+ const f = [], p = [], m = e.startRow - n.startRow, w = e.startColumn - n.startColumn, S = u.map((v) => {
1895
+ const C = v.sheetTransform, _ = {
1896
+ to: { ...C.to, row: C.to.row + m, column: C.to.column + w },
1897
+ from: { ...C.from, row: C.from.row + m, column: C.from.column + w }
1898
+ }, E = H(_, this._selectionRenderService, this._skeletonManagerService);
1731
1899
  return {
1732
1900
  unitId: r,
1733
1901
  subUnitId: s,
@@ -1737,30 +1905,30 @@ let on = class extends ae {
1737
1905
  };
1738
1906
  });
1739
1907
  if (S.length) {
1740
- const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: R, redo: _, objects: E } = v;
1741
- m.push({ id: P.id, params: { unitId: r, subUnitId: s, op: _, objects: E, type: U.UPDATE } }), p.push({ id: P.id, params: { unitId: r, subUnitId: s, op: R, objects: E, type: U.UPDATE } });
1908
+ const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: C, redo: _, objects: E } = v;
1909
+ f.push({ id: P.id, params: { unitId: r, subUnitId: s, op: _, objects: E, type: U.UPDATE } }), p.push({ id: P.id, params: { unitId: r, subUnitId: s, op: C, objects: E, type: U.UPDATE } });
1742
1910
  }
1743
- return { redos: m, undos: p };
1911
+ return { redos: f, undos: p };
1744
1912
  }
1745
1913
  _moveRowInterceptor(i, e) {
1746
1914
  const n = this._getUnitIdAndSubUnitId(i, e);
1747
1915
  if (n == null)
1748
1916
  return { redos: [], undos: [] };
1749
- const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startRow, c = s.endRow, d = [], g = [], a = this._sheetDrawingService.getDrawingData(t, r), l = [], h = [];
1750
- if (Object.keys(a).forEach((u) => {
1751
- const m = a[u], { sheetTransform: p, transform: f, anchorType: w = O.Position } = m;
1752
- if (p == null || f == null)
1917
+ const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startRow, d = s.endRow, a = [], g = [], c = this._sheetDrawingService.getDrawingData(t, r), l = [], h = [];
1918
+ if (Object.keys(c).forEach((u) => {
1919
+ const f = c[u], { sheetTransform: p, transform: m, anchorType: w = T.Position } = f;
1920
+ if (p == null || m == null)
1753
1921
  return;
1754
1922
  let S, I;
1755
1923
  if (e === "insert") {
1756
- const v = this._expandRow(p, f, o, c, w);
1924
+ const v = this._expandRow(p, m, o, d, w);
1757
1925
  S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
1758
1926
  } else {
1759
- const { from: v, to: R } = p, { row: _ } = v, { row: E } = R;
1760
- if (w === O.Both && _ >= o && E <= c)
1927
+ const { from: v, to: C } = p, { row: _ } = v, { row: E } = C;
1928
+ if (w === T.Both && _ >= o && E <= d)
1761
1929
  h.push({ unitId: t, subUnitId: r, drawingId: u });
1762
1930
  else {
1763
- const M = this._shrinkRow(p, f, o, c, w);
1931
+ const M = this._shrinkRow(p, m, o, d, w);
1764
1932
  S = M == null ? void 0 : M.newSheetTransform, I = M == null ? void 0 : M.newTransform;
1765
1933
  }
1766
1934
  }
@@ -1771,15 +1939,15 @@ let on = class extends ae {
1771
1939
  }), l.length === 0 && h.length === 0)
1772
1940
  return { redos: [], undos: [] };
1773
1941
  if (l.length > 0) {
1774
- const u = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: p, objects: f } = u;
1775
- d.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: U.UPDATE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: U.UPDATE } });
1942
+ const u = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: p, objects: m } = u;
1943
+ a.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: m, type: U.UPDATE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: f, objects: m, type: U.UPDATE } });
1776
1944
  }
1777
1945
  if (h.length > 0) {
1778
- const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, p = u.redo, f = u.objects;
1779
- d.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: U.REMOVE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: U.INSERT } });
1946
+ const u = this._sheetDrawingService.getBatchRemoveOp(h), f = u.undo, p = u.redo, m = u.objects;
1947
+ a.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: m, type: U.REMOVE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: f, objects: m, type: U.INSERT } });
1780
1948
  }
1781
- return d.push({ id: k.id, params: [t] }), g.push({ id: k.id, params: [t] }), {
1782
- redos: d,
1949
+ return a.push({ id: k.id, params: [t] }), g.push({ id: k.id, params: [t] }), {
1950
+ redos: a,
1783
1951
  undos: g
1784
1952
  };
1785
1953
  }
@@ -1787,21 +1955,21 @@ let on = class extends ae {
1787
1955
  const n = this._getUnitIdAndSubUnitId(i, e);
1788
1956
  if (n == null)
1789
1957
  return { redos: [], undos: [] };
1790
- const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startColumn, c = s.endColumn, d = [], g = [], a = this._sheetDrawingService.getDrawingData(t, r), l = [], h = [];
1791
- if (Object.keys(a).forEach((u) => {
1792
- const m = a[u], { sheetTransform: p, transform: f, anchorType: w = O.Position } = m;
1793
- if (p == null || f == null)
1958
+ const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startColumn, d = s.endColumn, a = [], g = [], c = this._sheetDrawingService.getDrawingData(t, r), l = [], h = [];
1959
+ if (Object.keys(c).forEach((u) => {
1960
+ const f = c[u], { sheetTransform: p, transform: m, anchorType: w = T.Position } = f;
1961
+ if (p == null || m == null)
1794
1962
  return;
1795
1963
  let S, I;
1796
1964
  if (e === "insert") {
1797
- const v = this._expandCol(p, f, o, c, w);
1965
+ const v = this._expandCol(p, m, o, d, w);
1798
1966
  S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
1799
1967
  } else {
1800
- const { from: v, to: R } = p, { column: _ } = v, { column: E } = R;
1801
- if (w === O.Both && _ >= o && E <= c)
1968
+ const { from: v, to: C } = p, { column: _ } = v, { column: E } = C;
1969
+ if (w === T.Both && _ >= o && E <= d)
1802
1970
  h.push({ unitId: t, subUnitId: r, drawingId: u });
1803
1971
  else {
1804
- const M = this._shrinkCol(p, f, o, c, w);
1972
+ const M = this._shrinkCol(p, m, o, d, w);
1805
1973
  S = M == null ? void 0 : M.newSheetTransform, I = M == null ? void 0 : M.newTransform;
1806
1974
  }
1807
1975
  }
@@ -1812,200 +1980,200 @@ let on = class extends ae {
1812
1980
  }), l.length === 0 && h.length === 0)
1813
1981
  return { redos: [], undos: [] };
1814
1982
  if (l.length > 0) {
1815
- const u = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: p, objects: f } = u;
1816
- d.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: U.UPDATE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: U.UPDATE } });
1983
+ const u = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: p, objects: m } = u;
1984
+ a.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: m, type: U.UPDATE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: f, objects: m, type: U.UPDATE } });
1817
1985
  }
1818
1986
  if (h.length > 0) {
1819
- const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, p = u.redo, f = u.objects;
1820
- d.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: U.REMOVE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: U.INSERT } });
1987
+ const u = this._sheetDrawingService.getBatchRemoveOp(h), f = u.undo, p = u.redo, m = u.objects;
1988
+ a.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: m, type: U.REMOVE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: f, objects: m, type: U.INSERT } });
1821
1989
  }
1822
- return d.push({ id: k.id, params: [t] }), g.push({ id: k.id, params: [t] }), { redos: d, undos: g };
1990
+ return a.push({ id: k.id, params: [t] }), g.push({ id: k.id, params: [t] }), { redos: a, undos: g };
1823
1991
  }
1824
- _expandCol(i, e, n, t, r = O.Position) {
1825
- const s = t - n + 1, { from: o, to: c } = i, { column: d } = o, { column: g } = c;
1826
- if (r === O.None)
1992
+ _expandCol(i, e, n, t, r = T.Position) {
1993
+ const s = t - n + 1, { from: o, to: d } = i, { column: a } = o, { column: g } = d;
1994
+ if (r === T.None)
1827
1995
  return {
1828
- newSheetTransform: $({ ...e }, this._selectionRenderService),
1996
+ newSheetTransform: x({ ...e }, this._selectionRenderService),
1829
1997
  newTransform: e
1830
1998
  };
1831
- let a = null, l = null;
1832
- if (d >= n) {
1833
- const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: t, startRow: o.row, endRow: c.row });
1999
+ let c = null, l = null;
2000
+ if (a >= n) {
2001
+ const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: t, startRow: o.row, endRow: d.row });
1834
2002
  if (h == null)
1835
2003
  return;
1836
- l = { ...e, left: (e.left || 0) + h.endX - h.startX }, a = $(l, this._selectionRenderService);
2004
+ l = { ...e, left: (e.left || 0) + h.endX - h.startX }, c = x(l, this._selectionRenderService);
1837
2005
  } else if (g >= t)
1838
- if (r === O.Both)
1839
- a = {
2006
+ if (r === T.Both)
2007
+ c = {
1840
2008
  from: { ...o },
1841
- to: { ...c, column: g + s }
1842
- }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
2009
+ to: { ...d, column: g + s }
2010
+ }, l = H(c, this._selectionRenderService, this._skeletonManagerService);
1843
2011
  else
1844
2012
  return {
1845
- newSheetTransform: $({ ...e }, this._selectionRenderService),
2013
+ newSheetTransform: x({ ...e }, this._selectionRenderService),
1846
2014
  newTransform: e
1847
2015
  };
1848
- return a != null && l != null ? {
1849
- newSheetTransform: a,
2016
+ return c != null && l != null ? {
2017
+ newSheetTransform: c,
1850
2018
  newTransform: l
1851
2019
  } : null;
1852
2020
  }
1853
- _shrinkCol(i, e, n, t, r = O.Position) {
1854
- const s = t - n + 1, { from: o, to: c } = i, { column: d } = o, { column: g } = c;
1855
- if (r === O.None)
2021
+ _shrinkCol(i, e, n, t, r = T.Position) {
2022
+ const s = t - n + 1, { from: o, to: d } = i, { column: a } = o, { column: g } = d;
2023
+ if (r === T.None)
1856
2024
  return {
1857
- newSheetTransform: $({ ...e }, this._selectionRenderService),
2025
+ newSheetTransform: x({ ...e }, this._selectionRenderService),
1858
2026
  newTransform: e
1859
2027
  };
1860
- let a = null, l = null;
1861
- if (d > t)
1862
- a = {
1863
- from: { ...o, column: d - s },
1864
- to: { ...c, column: g - s }
1865
- }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
2028
+ let c = null, l = null;
2029
+ if (a > t)
2030
+ c = {
2031
+ from: { ...o, column: a - s },
2032
+ to: { ...d, column: g - s }
2033
+ }, l = H(c, this._selectionRenderService, this._skeletonManagerService);
1866
2034
  else {
1867
- if (d >= n && g <= t)
2035
+ if (a >= n && g <= t)
1868
2036
  return null;
1869
- if (d < n && g > t)
1870
- if (r === O.Both)
1871
- a = {
2037
+ if (a < n && g > t)
2038
+ if (r === T.Both)
2039
+ c = {
1872
2040
  from: { ...o },
1873
- to: { ...c, column: g - s }
1874
- }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
2041
+ to: { ...d, column: g - s }
2042
+ }, l = H(c, this._selectionRenderService, this._skeletonManagerService);
1875
2043
  else
1876
2044
  return {
1877
- newSheetTransform: $({ ...e }, this._selectionRenderService),
2045
+ newSheetTransform: x({ ...e }, this._selectionRenderService),
1878
2046
  newTransform: e
1879
2047
  };
1880
- else if (d >= n && d <= t) {
1881
- if (d === n)
2048
+ else if (a >= n && a <= t) {
2049
+ if (a === n)
1882
2050
  l = { ...e, left: (e.left || 0) - i.from.columnOffset };
1883
2051
  else {
1884
- const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: d - 1, startRow: o.row, endRow: c.row });
2052
+ const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: a - 1, startRow: o.row, endRow: d.row });
1885
2053
  if (h == null)
1886
2054
  return;
1887
2055
  l = { ...e, left: (e.left || 0) - h.endX + h.startX - i.from.columnOffset };
1888
2056
  }
1889
- a = $(l, this._selectionRenderService);
1890
- } else if (g >= n && g <= t && r === O.Both) {
2057
+ c = x(l, this._selectionRenderService);
2058
+ } else if (g >= n && g <= t && r === T.Both) {
1891
2059
  const h = this._skeletonManagerService.attachRangeWithCoord({
1892
2060
  startColumn: n - 1,
1893
2061
  endColumn: n - 1,
1894
2062
  startRow: o.row,
1895
- endRow: c.row
2063
+ endRow: d.row
1896
2064
  });
1897
2065
  if (h == null)
1898
2066
  return;
1899
- a = {
2067
+ c = {
1900
2068
  from: { ...o },
1901
- to: { ...c, column: n - 1, columnOffset: h.endX - h.startX }
1902
- }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
2069
+ to: { ...d, column: n - 1, columnOffset: h.endX - h.startX }
2070
+ }, l = H(c, this._selectionRenderService, this._skeletonManagerService);
1903
2071
  }
1904
2072
  }
1905
- return a != null && l != null ? {
1906
- newSheetTransform: a,
2073
+ return c != null && l != null ? {
2074
+ newSheetTransform: c,
1907
2075
  newTransform: l
1908
2076
  } : null;
1909
2077
  }
1910
- _expandRow(i, e, n, t, r = O.Position) {
1911
- const s = t - n + 1, { from: o, to: c } = i, { row: d } = o, { row: g } = c;
1912
- if (r === O.None)
2078
+ _expandRow(i, e, n, t, r = T.Position) {
2079
+ const s = t - n + 1, { from: o, to: d } = i, { row: a } = o, { row: g } = d;
2080
+ if (r === T.None)
1913
2081
  return {
1914
- newSheetTransform: $({ ...e }, this._selectionRenderService),
2082
+ newSheetTransform: x({ ...e }, this._selectionRenderService),
1915
2083
  newTransform: e
1916
2084
  };
1917
- let a = null, l = null;
1918
- if (d >= n) {
1919
- const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: t, startColumn: o.column, endColumn: c.column });
2085
+ let c = null, l = null;
2086
+ if (a >= n) {
2087
+ const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: t, startColumn: o.column, endColumn: d.column });
1920
2088
  if (h == null)
1921
2089
  return;
1922
- l = { ...e, top: (e.top || 0) + h.endY - h.startY }, a = $(l, this._selectionRenderService);
2090
+ l = { ...e, top: (e.top || 0) + h.endY - h.startY }, c = x(l, this._selectionRenderService);
1923
2091
  } else if (g >= t)
1924
- if (r === O.Both)
1925
- a = {
2092
+ if (r === T.Both)
2093
+ c = {
1926
2094
  from: { ...o },
1927
2095
  to: {
1928
- ...c,
2096
+ ...d,
1929
2097
  row: g + s
1930
2098
  }
1931
- }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
2099
+ }, l = H(c, this._selectionRenderService, this._skeletonManagerService);
1932
2100
  else
1933
2101
  return {
1934
- newSheetTransform: $({ ...e }, this._selectionRenderService),
2102
+ newSheetTransform: x({ ...e }, this._selectionRenderService),
1935
2103
  newTransform: e
1936
2104
  };
1937
- return a != null && l != null ? {
1938
- newSheetTransform: a,
2105
+ return c != null && l != null ? {
2106
+ newSheetTransform: c,
1939
2107
  newTransform: l
1940
2108
  } : null;
1941
2109
  }
1942
- _shrinkRow(i, e, n, t, r = O.Position) {
1943
- const s = t - n + 1, { from: o, to: c } = i, { row: d } = o, { row: g } = c;
1944
- if (r === O.None)
2110
+ _shrinkRow(i, e, n, t, r = T.Position) {
2111
+ const s = t - n + 1, { from: o, to: d } = i, { row: a } = o, { row: g } = d;
2112
+ if (r === T.None)
1945
2113
  return {
1946
- newSheetTransform: $({ ...e }, this._selectionRenderService),
2114
+ newSheetTransform: x({ ...e }, this._selectionRenderService),
1947
2115
  newTransform: e
1948
2116
  };
1949
- let a = null, l = null;
1950
- if (d > t)
1951
- a = {
1952
- from: { ...o, row: d - s },
1953
- to: { ...c, row: g - s }
1954
- }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
2117
+ let c = null, l = null;
2118
+ if (a > t)
2119
+ c = {
2120
+ from: { ...o, row: a - s },
2121
+ to: { ...d, row: g - s }
2122
+ }, l = H(c, this._selectionRenderService, this._skeletonManagerService);
1955
2123
  else {
1956
- if (d >= n && g <= t)
2124
+ if (a >= n && g <= t)
1957
2125
  return null;
1958
- if (d < n && g > t)
1959
- if (r === O.Both)
1960
- a = {
2126
+ if (a < n && g > t)
2127
+ if (r === T.Both)
2128
+ c = {
1961
2129
  from: { ...o },
1962
- to: { ...c, row: g - s }
1963
- }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
2130
+ to: { ...d, row: g - s }
2131
+ }, l = H(c, this._selectionRenderService, this._skeletonManagerService);
1964
2132
  else
1965
2133
  return {
1966
- newSheetTransform: $({ ...e }, this._selectionRenderService),
2134
+ newSheetTransform: x({ ...e }, this._selectionRenderService),
1967
2135
  newTransform: e
1968
2136
  };
1969
- else if (d >= n && d <= t) {
1970
- if (d === n)
2137
+ else if (a >= n && a <= t) {
2138
+ if (a === n)
1971
2139
  l = { ...e, top: (e.top || 0) - i.from.rowOffset };
1972
2140
  else {
1973
- const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: d - 1, startColumn: o.column, endColumn: c.column });
2141
+ const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: a - 1, startColumn: o.column, endColumn: d.column });
1974
2142
  if (h == null)
1975
2143
  return;
1976
2144
  l = { ...e, top: (e.top || 0) - h.endY + h.startY - i.from.rowOffset };
1977
2145
  }
1978
- a = $(l, this._selectionRenderService);
1979
- } else if (g >= n && g <= t && r === O.Both) {
2146
+ c = x(l, this._selectionRenderService);
2147
+ } else if (g >= n && g <= t && r === T.Both) {
1980
2148
  const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: n - 1, endRow: n - 1 });
1981
2149
  if (h == null)
1982
2150
  return;
1983
- a = {
2151
+ c = {
1984
2152
  from: { ...o },
1985
- to: { ...c, row: n - 1, rowOffset: h.endY - h.startY }
1986
- }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
2153
+ to: { ...d, row: n - 1, rowOffset: h.endY - h.startY }
2154
+ }, l = H(c, this._selectionRenderService, this._skeletonManagerService);
1987
2155
  }
1988
2156
  }
1989
- return a != null && l != null ? {
1990
- newSheetTransform: a,
2157
+ return c != null && l != null ? {
2158
+ newSheetTransform: c,
1991
2159
  newTransform: l
1992
2160
  } : null;
1993
2161
  }
1994
2162
  _commandListener() {
1995
2163
  this.disposeWithMe(
1996
2164
  this._commandService.onCommandExecuted((i) => {
1997
- i.id === Vi.id && setTimeout(() => {
2165
+ i.id === Zi.id && setTimeout(() => {
1998
2166
  const e = i.params, { unitId: n, subUnitId: t } = e, r = this._drawingManagerService.drawingManagerData, s = [], o = [];
1999
- Object.keys(r).forEach((c) => {
2000
- const d = r[c];
2001
- d != null && Object.keys(d).forEach((g) => {
2002
- const a = d[g].data;
2003
- a != null && Object.keys(a).forEach((l) => {
2004
- if (c === n && g === t) {
2005
- const h = a[l];
2006
- h.transform = V(h.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(a[l]);
2167
+ Object.keys(r).forEach((d) => {
2168
+ const a = r[d];
2169
+ a != null && Object.keys(a).forEach((g) => {
2170
+ const c = a[g].data;
2171
+ c != null && Object.keys(c).forEach((l) => {
2172
+ if (d === n && g === t) {
2173
+ const h = c[l];
2174
+ h.transform = H(h.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(c[l]);
2007
2175
  } else
2008
- o.push(a[l]);
2176
+ o.push(c[l]);
2009
2177
  });
2010
2178
  });
2011
2179
  }), this._drawingManagerService.removeNotification(o), this._drawingManagerService.addNotification(s);
@@ -2016,7 +2184,7 @@ let on = class extends ae {
2016
2184
  _sheetRefreshListener() {
2017
2185
  this.disposeWithMe(
2018
2186
  this._commandService.onCommandExecuted((i) => {
2019
- Ys.includes(i.id) && requestIdleCallback(() => {
2187
+ Zs.includes(i.id) && requestIdleCallback(() => {
2020
2188
  const e = i.params, { unitId: n, subUnitId: t, ranges: r } = e;
2021
2189
  this._refreshDrawingTransform(n, t, r);
2022
2190
  });
@@ -2026,13 +2194,13 @@ let on = class extends ae {
2026
2194
  _refreshDrawingTransform(i, e, n) {
2027
2195
  const t = this._drawingManagerService.getDrawingData(i, e), r = [];
2028
2196
  Object.keys(t).forEach((s) => {
2029
- const o = t[s], { sheetTransform: c, transform: d, anchorType: g = O.Position } = o;
2030
- if (g === O.None)
2197
+ const o = t[s], { sheetTransform: d, transform: a, anchorType: g = T.Position } = o;
2198
+ if (g === T.None)
2031
2199
  return !0;
2032
- const { from: a, to: l } = c, { row: h, column: u } = a, { row: m, column: p } = l;
2033
- for (let f = 0; f < n.length; f++) {
2034
- const w = n[f], { startRow: S, endRow: I, startColumn: D, endColumn: v } = w;
2035
- if (Gr.intersects(
2200
+ const { from: c, to: l } = d, { row: h, column: u } = c, { row: f, column: p } = l;
2201
+ for (let m = 0; m < n.length; m++) {
2202
+ const w = n[m], { startRow: S, endRow: I, startColumn: D, endColumn: v } = w;
2203
+ if (Hr.intersects(
2036
2204
  {
2037
2205
  startRow: S,
2038
2206
  endRow: I,
@@ -2041,18 +2209,18 @@ let on = class extends ae {
2041
2209
  },
2042
2210
  {
2043
2211
  startRow: h,
2044
- endRow: m,
2212
+ endRow: f,
2045
2213
  startColumn: u,
2046
2214
  endColumn: p
2047
2215
  }
2048
2216
  ) || h > I || u > v) {
2049
- const R = g === O.Position, _ = V(c, this._selectionRenderService, this._skeletonManagerService);
2217
+ const C = g === T.Position, _ = H(d, this._selectionRenderService, this._skeletonManagerService);
2050
2218
  r.push({
2051
2219
  ...o,
2052
2220
  transform: {
2053
2221
  ..._,
2054
- width: R ? d == null ? void 0 : d.width : _ == null ? void 0 : _.width,
2055
- height: R ? d == null ? void 0 : d.height : _ == null ? void 0 : _.height
2222
+ width: C ? a == null ? void 0 : a.width : _ == null ? void 0 : _.width,
2223
+ height: C ? a == null ? void 0 : a.height : _ == null ? void 0 : _.height
2056
2224
  }
2057
2225
  });
2058
2226
  break;
@@ -2061,219 +2229,205 @@ let on = class extends ae {
2061
2229
  }), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(k.id, [i]));
2062
2230
  }
2063
2231
  };
2064
- on = Ls([
2065
- we(1, Q),
2066
- we(2, X),
2067
- we(3, Je),
2068
- we(4, N(H)),
2069
- we(5, N(Bt)),
2070
- we(6, ee),
2071
- we(7, de),
2072
- we(8, ke)
2073
- ], on);
2074
- var re = function() {
2075
- return re = Object.assign || function(i) {
2232
+ cn = Ks([
2233
+ pe(1, Z),
2234
+ pe(2, F),
2235
+ pe(3, Ge),
2236
+ pe(4, N(G)),
2237
+ pe(5, N(Lt)),
2238
+ pe(6, ne),
2239
+ pe(7, te),
2240
+ pe(8, Ye)
2241
+ ], cn);
2242
+ var ee = function() {
2243
+ return ee = Object.assign || function(i) {
2076
2244
  for (var e, n = 1, t = arguments.length; n < t; n++) {
2077
2245
  e = arguments[n];
2078
2246
  for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (i[r] = e[r]);
2079
2247
  }
2080
2248
  return i;
2081
- }, re.apply(this, arguments);
2082
- }, Gs = function(i, e) {
2249
+ }, ee.apply(this, arguments);
2250
+ }, qs = function(i, e) {
2083
2251
  var n = {};
2084
2252
  for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
2085
2253
  if (i != null && typeof Object.getOwnPropertySymbols == "function")
2086
2254
  for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
2087
2255
  e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
2088
2256
  return n;
2089
- }, fr = or(function(i, e) {
2090
- var n = i.icon, t = i.id, r = i.className, s = i.extend, o = Gs(i, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Ji("_".concat(Hs()));
2091
- return pr(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, re({ ref: e, className: c }, o), s);
2257
+ }, _r = cr(function(i, e) {
2258
+ var n = i.icon, t = i.id, r = i.className, s = i.extend, o = qs(i, ["icon", "id", "className", "extend"]), d = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), a = ts("_".concat(to()));
2259
+ return vr(n, "".concat(t), { defIds: n.defIds, idSuffix: a.current }, ee({ ref: e, className: d }, o), s);
2092
2260
  });
2093
- function pr(i, e, n, t, r) {
2094
- return ar(i.tag, re(re({ key: e }, Xs(i, n, r)), t), (Vs(i, n).children || []).map(function(s, o) {
2095
- return pr(s, "".concat(e, "-").concat(i.tag, "-").concat(o), n, void 0, r);
2261
+ function vr(i, e, n, t, r) {
2262
+ return dr(i.tag, ee(ee({ key: e }, Qs(i, n, r)), t), (eo(i, n).children || []).map(function(s, o) {
2263
+ return vr(s, "".concat(e, "-").concat(i.tag, "-").concat(o), n, void 0, r);
2096
2264
  }));
2097
2265
  }
2098
- function Xs(i, e, n) {
2099
- var t = re({}, i.attrs);
2266
+ function Qs(i, e, n) {
2267
+ var t = ee({}, i.attrs);
2100
2268
  n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
2101
2269
  var r = e.defIds;
2102
2270
  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) {
2103
- var o = s[0], c = s[1];
2104
- typeof c == "string" && (t[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
2271
+ var o = s[0], d = s[1];
2272
+ typeof d == "string" && (t[o] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
2105
2273
  })), t;
2106
2274
  }
2107
- function Vs(i, e) {
2275
+ function eo(i, e) {
2108
2276
  var n, t = e.defIds;
2109
- return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? re(re({}, i), { children: i.children.map(function(r) {
2110
- return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? re(re({}, r), { attrs: re(re({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
2277
+ return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? ee(ee({}, i), { children: i.children.map(function(r) {
2278
+ return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? ee(ee({}, r), { attrs: ee(ee({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
2111
2279
  }) }) : i;
2112
2280
  }
2113
- function Hs() {
2281
+ function to() {
2114
2282
  return Math.random().toString(36).substring(2, 8);
2115
2283
  }
2116
- fr.displayName = "UniverIcon";
2117
- var zs = { 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" } }] }, wr = or(function(i, e) {
2118
- return ar(fr, Object.assign({}, i, {
2284
+ _r.displayName = "UniverIcon";
2285
+ var no = { 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" } }] }, Sr = cr(function(i, e) {
2286
+ return dr(_r, Object.assign({}, i, {
2119
2287
  id: "add-image-single",
2120
2288
  ref: e,
2121
- icon: zs
2289
+ icon: no
2122
2290
  }));
2123
2291
  });
2124
- wr.displayName = "AddImageSingle";
2125
- const _r = {
2292
+ Sr.displayName = "AddImageSingle";
2293
+ const Ir = {
2126
2294
  id: "sheet.command.delete-drawing",
2127
- type: q.COMMAND,
2295
+ type: J.COMMAND,
2128
2296
  handler: (i) => {
2129
- const e = i.get(X), t = i.get(ee).getFocusDrawings();
2297
+ const e = i.get(F), t = i.get(ne).getFocusDrawings();
2130
2298
  if (t.length === 0)
2131
2299
  return !1;
2132
2300
  const r = t[0].unitId, s = t.map((o) => {
2133
- const { unitId: c, subUnitId: d, drawingId: g, drawingType: a } = o;
2301
+ const { unitId: d, subUnitId: a, drawingId: g, drawingType: c } = o;
2134
2302
  return {
2135
- unitId: c,
2136
- subUnitId: d,
2303
+ unitId: d,
2304
+ subUnitId: a,
2137
2305
  drawingId: g,
2138
- drawingType: a
2306
+ drawingType: c
2139
2307
  };
2140
2308
  });
2141
- return e.executeCommand($t.id, {
2309
+ return e.executeCommand(tt.id, {
2142
2310
  unitId: r,
2143
2311
  drawings: s
2144
2312
  });
2145
2313
  }
2146
- }, dn = {
2147
- id: "sheet.command.insert-float-image",
2148
- type: q.COMMAND,
2149
- handler: (i) => {
2150
- var n, t;
2151
- return (t = (n = i.get(Q).getCurrentTypeOfRenderer(G.UNIVER_SHEET)) == null ? void 0 : n.with(ze).insertFloatImage()) != null ? t : !1;
2152
- }
2153
- }, ln = {
2154
- id: "sheet.command.insert-cell-image",
2155
- type: q.COMMAND,
2156
- handler: (i) => {
2157
- var n, t;
2158
- return (t = (n = i.get(Q).getCurrentTypeOfRenderer(G.UNIVER_SHEET)) == null ? void 0 : n.with(ze).insertCellImage()) != null ? t : !1;
2159
- }
2160
- }, Ze = {
2314
+ }, nt = {
2161
2315
  id: "sheet.command.move-drawing",
2162
- type: q.COMMAND,
2316
+ type: J.COMMAND,
2163
2317
  handler: (i, e) => {
2164
- const n = i.get(X), t = i.get(ee), r = i.get(Je), { direction: s } = e, o = t.getFocusDrawings();
2318
+ const n = i.get(F), t = i.get(ne), r = i.get(Ge), { direction: s } = e, o = t.getFocusDrawings();
2165
2319
  if (o.length === 0)
2166
2320
  return !1;
2167
- const c = o[0].unitId, d = o.map((a) => {
2168
- const { transform: l } = a;
2321
+ const d = o[0].unitId, a = o.map((c) => {
2322
+ const { transform: l } = c;
2169
2323
  if (l == null)
2170
2324
  return null;
2171
- const h = { ...l }, { left: u = 0, top: m = 0 } = l;
2172
- return s === ve.UP ? h.top = m - 1 : s === ve.DOWN ? h.top = m + 1 : s === ve.LEFT ? h.left = u - 1 : s === ve.RIGHT && (h.left = u + 1), {
2173
- ...a,
2325
+ const h = { ...l }, { left: u = 0, top: f = 0 } = l;
2326
+ return s === _e.UP ? h.top = f - 1 : s === _e.DOWN ? h.top = f + 1 : s === _e.LEFT ? h.left = u - 1 : s === _e.RIGHT && (h.left = u + 1), {
2327
+ ...c,
2174
2328
  transform: h,
2175
- sheetTransform: $(h, r)
2329
+ sheetTransform: x(h, r)
2176
2330
  };
2177
- }).filter((a) => a != null);
2178
- return n.syncExecuteCommand(Lt.id, {
2179
- unitId: c,
2180
- drawings: d
2181
- }) ? (n.syncExecuteCommand(k.id, [c]), !0) : !1;
2182
- }
2183
- }, vr = "addition-and-subtraction-single", Sr = "sheet.menu.image";
2184
- function Ks(i) {
2331
+ }).filter((c) => c != null);
2332
+ return n.syncExecuteCommand(Yt.id, {
2333
+ unitId: d,
2334
+ drawings: a
2335
+ }) ? (n.syncExecuteCommand(k.id, [d]), !0) : !1;
2336
+ }
2337
+ }, Cr = "addition-and-subtraction-single", br = "sheet.menu.image";
2338
+ function ro(i) {
2185
2339
  return {
2186
- id: Sr,
2187
- type: an.SUBITEMS,
2188
- icon: vr,
2340
+ id: br,
2341
+ type: dn.SUBITEMS,
2342
+ icon: Cr,
2189
2343
  tooltip: "sheetImage.title",
2190
- hidden$: xn(i, G.UNIVER_SHEET),
2191
- disabled$: Ci(i, { workbookTypes: [Qt], worksheetTypes: [Dt], rangeTypes: [Hi] })
2344
+ hidden$: kn(i, V.UNIVER_SHEET),
2345
+ disabled$: Mi(i, { workbookTypes: [tn], worksheetTypes: [Ot], rangeTypes: [qi] })
2192
2346
  };
2193
2347
  }
2194
- function Js(i) {
2348
+ function io(i) {
2195
2349
  return {
2196
- id: dn.id,
2350
+ id: Gt.id,
2197
2351
  title: "sheetImage.upload.float",
2198
- type: an.BUTTON,
2199
- hidden$: xn(i, G.UNIVER_SHEET)
2352
+ type: dn.BUTTON,
2353
+ hidden$: kn(i, V.UNIVER_SHEET)
2200
2354
  };
2201
2355
  }
2202
- function Zs(i) {
2356
+ function so(i) {
2203
2357
  return {
2204
- id: ln.id,
2358
+ id: hn.id,
2205
2359
  title: "sheetImage.upload.cell",
2206
- type: an.BUTTON
2360
+ type: dn.BUTTON
2207
2361
  };
2208
2362
  }
2209
- const qs = "univer-image-common-panel", Qs = "univer-image-common-panel-grid", eo = "univer-image-common-panel-border", to = "univer-image-common-panel-title", no = "univer-image-common-panel-subtitle", ro = "univer-image-common-panel-row", io = "univer-image-common-panel-row-vertical", so = "univer-image-common-panel-column", oo = "univer-image-common-panel-column-center", ao = "univer-image-common-panel-inline", co = "univer-image-common-panel-span2", lo = "univer-image-common-panel-span3", uo = "univer-image-common-panel-input", ho = "univer-sheet-image-menu", go = "univer-sheet-image-menu-input", _e = {
2210
- imageCommonPanel: qs,
2211
- imageCommonPanelGrid: Qs,
2212
- imageCommonPanelBorder: eo,
2213
- imageCommonPanelTitle: to,
2214
- imageCommonPanelSubtitle: no,
2215
- imageCommonPanelRow: ro,
2216
- imageCommonPanelRowVertical: io,
2217
- imageCommonPanelColumn: so,
2218
- imageCommonPanelColumnCenter: oo,
2219
- imageCommonPanelInline: ao,
2220
- imageCommonPanelSpan2: co,
2221
- imageCommonPanelSpan3: lo,
2222
- imageCommonPanelInput: uo,
2223
- sheetImageMenu: ho,
2224
- sheetImageMenuInput: go
2363
+ const oo = "univer-image-common-panel", ao = "univer-image-common-panel-grid", co = "univer-image-common-panel-border", lo = "univer-image-common-panel-title", uo = "univer-image-common-panel-subtitle", ho = "univer-image-common-panel-row", go = "univer-image-common-panel-row-vertical", fo = "univer-image-common-panel-column", mo = "univer-image-common-panel-column-center", po = "univer-image-common-panel-inline", wo = "univer-image-common-panel-span2", _o = "univer-image-common-panel-span3", vo = "univer-image-common-panel-input", So = "univer-sheet-image-menu", Io = "univer-sheet-image-menu-input", we = {
2364
+ imageCommonPanel: oo,
2365
+ imageCommonPanelGrid: ao,
2366
+ imageCommonPanelBorder: co,
2367
+ imageCommonPanelTitle: lo,
2368
+ imageCommonPanelSubtitle: uo,
2369
+ imageCommonPanelRow: ho,
2370
+ imageCommonPanelRowVertical: go,
2371
+ imageCommonPanelColumn: fo,
2372
+ imageCommonPanelColumnCenter: mo,
2373
+ imageCommonPanelInline: po,
2374
+ imageCommonPanelSpan2: wo,
2375
+ imageCommonPanelSpan3: _o,
2376
+ imageCommonPanelInput: vo,
2377
+ sheetImageMenu: So,
2378
+ sheetImageMenuInput: Io
2225
2379
  };
2226
- function Ir(i) {
2380
+ function Rr(i) {
2227
2381
  var e, n, t = "";
2228
2382
  if (typeof i == "string" || typeof i == "number") t += i;
2229
2383
  else if (typeof i == "object") if (Array.isArray(i)) {
2230
2384
  var r = i.length;
2231
- for (e = 0; e < r; e++) i[e] && (n = Ir(i[e])) && (t && (t += " "), t += n);
2385
+ for (e = 0; e < r; e++) i[e] && (n = Rr(i[e])) && (t && (t += " "), t += n);
2232
2386
  } else for (n in i) i[n] && (t && (t += " "), t += n);
2233
2387
  return t;
2234
2388
  }
2235
- function It() {
2236
- for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = Ir(i)) && (t && (t += " "), t += e);
2389
+ function Dt() {
2390
+ for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = Rr(i)) && (t && (t += " "), t += e);
2237
2391
  return t;
2238
2392
  }
2239
- const mo = (i) => {
2393
+ const Co = (i) => {
2240
2394
  var I;
2241
- const e = Me(X), n = Me(Wt), t = Me(de), r = Me(Q), { drawings: s } = i, o = s[0];
2395
+ const e = ye(F), n = ye($t), t = ye(te), r = ye(Z), { drawings: s } = i, o = s[0];
2242
2396
  if (o == null)
2243
2397
  return;
2244
- const { unitId: c } = o, d = r.getRenderById(c), g = d == null ? void 0 : d.scene;
2398
+ const { unitId: d } = o, a = r.getRenderById(d), g = a == null ? void 0 : a.scene;
2245
2399
  if (g == null)
2246
2400
  return;
2247
- const a = g.getTransformerByCreate(), [l, h] = nn(!0), u = (I = o.anchorType) != null ? I : O.Position, [m, p] = nn(u);
2248
- function f(D, v) {
2249
- const R = [];
2401
+ const c = g.getTransformerByCreate(), [l, h] = sn(!0), u = (I = o.anchorType) != null ? I : T.Position, [f, p] = sn(u);
2402
+ function m(D, v) {
2403
+ const C = [];
2250
2404
  return D.forEach((_) => {
2251
2405
  const { oKey: E } = _, M = v.getDrawingOKey(E);
2252
2406
  if (M == null)
2253
- return R.push(null), !0;
2254
- const { unitId: A, subUnitId: T, drawingId: b, drawingType: C, anchorType: y, sheetTransform: W } = M;
2255
- R.push({
2256
- unitId: A,
2257
- subUnitId: T,
2407
+ return C.push(null), !0;
2408
+ const { unitId: y, subUnitId: A, drawingId: b, drawingType: R, anchorType: O, sheetTransform: $ } = M;
2409
+ C.push({
2410
+ unitId: y,
2411
+ subUnitId: A,
2258
2412
  drawingId: b,
2259
- anchorType: y,
2260
- sheetTransform: W,
2261
- drawingType: C
2413
+ anchorType: O,
2414
+ sheetTransform: $,
2415
+ drawingType: R
2262
2416
  });
2263
- }), R;
2417
+ }), C;
2264
2418
  }
2265
- cn(() => {
2266
- const D = a.clearControl$.subscribe((R) => {
2267
- R === !0 && h(!1);
2268
- }), v = a.changeStart$.subscribe((R) => {
2419
+ un(() => {
2420
+ const D = c.clearControl$.subscribe((C) => {
2421
+ C === !0 && h(!1);
2422
+ }), v = c.changeStart$.subscribe((C) => {
2269
2423
  var M;
2270
- const { objects: _ } = R, E = f(_, t);
2424
+ const { objects: _ } = C, E = m(_, t);
2271
2425
  if (E.length === 0)
2272
2426
  h(!1);
2273
2427
  else if (E.length >= 1) {
2274
2428
  h(!0);
2275
- const A = ((M = E[0]) == null ? void 0 : M.anchorType) || O.Position;
2276
- p(A);
2429
+ const y = ((M = E[0]) == null ? void 0 : M.anchorType) || T.Position;
2430
+ p(y);
2277
2431
  }
2278
2432
  });
2279
2433
  return () => {
@@ -2285,148 +2439,148 @@ const mo = (i) => {
2285
2439
  const v = t.getFocusDrawings();
2286
2440
  if (v.length === 0)
2287
2441
  return;
2288
- const R = v.map((_) => ({
2442
+ const C = v.map((_) => ({
2289
2443
  unitId: _.unitId,
2290
2444
  subUnitId: _.subUnitId,
2291
2445
  drawingId: _.drawingId,
2292
2446
  anchorType: D
2293
2447
  }));
2294
- e.executeCommand(Lt.id, {
2448
+ e.executeCommand(Yt.id, {
2295
2449
  unitId: v[0].unitId,
2296
- drawings: R
2450
+ drawings: C
2297
2451
  });
2298
2452
  }
2299
2453
  const S = (D) => D ? "block" : "none";
2300
- return /* @__PURE__ */ F.jsxs("div", { className: It(_e.imageCommonPanelGrid, _e.imageCommonPanelBorder), style: { display: S(l) }, children: [
2301
- /* @__PURE__ */ F.jsx("div", { className: _e.imageCommonPanelRow, children: /* @__PURE__ */ F.jsx("div", { className: It(_e.imageCommonPanelColumn, _e.imageCommonPanelTitle), children: /* @__PURE__ */ F.jsx("div", { children: n.t("drawing-anchor.title") }) }) }),
2302
- /* @__PURE__ */ F.jsx("div", { className: It(_e.imageCommonPanelRow), children: /* @__PURE__ */ F.jsx("div", { className: It(_e.imageCommonPanelColumn), children: /* @__PURE__ */ F.jsxs(Qi, { value: m, onChange: w, direction: "vertical", children: [
2303
- /* @__PURE__ */ F.jsx(Kt, { value: O.Both, children: n.t("drawing-anchor.both") }),
2304
- /* @__PURE__ */ F.jsx(Kt, { value: O.Position, children: n.t("drawing-anchor.position") }),
2305
- /* @__PURE__ */ F.jsx(Kt, { value: O.None, children: n.t("drawing-anchor.none") })
2454
+ return /* @__PURE__ */ Y.jsxs("div", { className: Dt(we.imageCommonPanelGrid, we.imageCommonPanelBorder), style: { display: S(l) }, children: [
2455
+ /* @__PURE__ */ Y.jsx("div", { className: we.imageCommonPanelRow, children: /* @__PURE__ */ Y.jsx("div", { className: Dt(we.imageCommonPanelColumn, we.imageCommonPanelTitle), children: /* @__PURE__ */ Y.jsx("div", { children: n.t("drawing-anchor.title") }) }) }),
2456
+ /* @__PURE__ */ Y.jsx("div", { className: Dt(we.imageCommonPanelRow), children: /* @__PURE__ */ Y.jsx("div", { className: Dt(we.imageCommonPanelColumn), children: /* @__PURE__ */ Y.jsxs(is, { value: f, onChange: w, direction: "vertical", children: [
2457
+ /* @__PURE__ */ Y.jsx(qt, { value: T.Both, children: n.t("drawing-anchor.both") }),
2458
+ /* @__PURE__ */ Y.jsx(qt, { value: T.Position, children: n.t("drawing-anchor.position") }),
2459
+ /* @__PURE__ */ Y.jsx(qt, { value: T.None, children: n.t("drawing-anchor.none") })
2306
2460
  ] }) }) })
2307
2461
  ] });
2308
- }, fo = () => {
2309
- const i = Me(de), e = i.getFocusDrawings(), [n, t] = nn(e);
2310
- return cn(() => {
2462
+ }, bo = () => {
2463
+ const i = ye(te), e = i.getFocusDrawings(), [n, t] = sn(e);
2464
+ return un(() => {
2311
2465
  const r = i.focus$.subscribe((s) => {
2312
2466
  t(s);
2313
2467
  });
2314
2468
  return () => {
2315
2469
  r.unsubscribe();
2316
2470
  };
2317
- }, []), !!(n != null && n.length) && /* @__PURE__ */ F.jsxs("div", { className: _e.imageCommonPanel, children: [
2318
- /* @__PURE__ */ F.jsx(di, { drawings: n }),
2319
- /* @__PURE__ */ F.jsx(mo, { drawings: n })
2471
+ }, []), !!(n != null && n.length) && /* @__PURE__ */ Y.jsxs("div", { className: we.imageCommonPanel, children: [
2472
+ /* @__PURE__ */ Y.jsx(gi, { drawings: n }),
2473
+ /* @__PURE__ */ Y.jsx(Co, { drawings: n })
2320
2474
  ] });
2321
- }, po = {
2322
- [Ei.FORMULAS_INSERT]: {
2323
- [Sr]: {
2475
+ }, Ro = {
2476
+ [Ni.FORMULAS_INSERT]: {
2477
+ [br]: {
2324
2478
  order: 3,
2325
- menuItemFactory: Ks,
2326
- [dn.id]: {
2479
+ menuItemFactory: ro,
2480
+ [Gt.id]: {
2327
2481
  order: 0,
2328
- menuItemFactory: Js
2482
+ menuItemFactory: io
2329
2483
  },
2330
- [ln.id]: {
2484
+ [hn.id]: {
2331
2485
  order: 1,
2332
- menuItemFactory: Zs
2486
+ menuItemFactory: so
2333
2487
  }
2334
2488
  }
2335
2489
  }
2336
2490
  };
2337
- function qe(i) {
2338
- return !i.getContextValue(Xr) && !i.getContextValue(Vr) && !i.getContextValue(Hr) && i.getContextValue(xe);
2491
+ function rt(i) {
2492
+ return !i.getContextValue(zr) && !i.getContextValue(Kr) && !i.getContextValue(Jr) && i.getContextValue(ke);
2339
2493
  }
2340
- const wo = {
2341
- id: Ze.id,
2494
+ const Do = {
2495
+ id: nt.id,
2342
2496
  description: "shortcut.sheet.drawing-move-down",
2343
2497
  group: "4_sheet-drawing-view",
2344
- binding: Be.ARROW_DOWN,
2498
+ binding: Le.ARROW_DOWN,
2345
2499
  priority: 100,
2346
- preconditions: qe,
2500
+ preconditions: rt,
2347
2501
  staticParameters: {
2348
- direction: ve.DOWN
2502
+ direction: _e.DOWN
2349
2503
  }
2350
- }, _o = {
2351
- id: Ze.id,
2504
+ }, Mo = {
2505
+ id: nt.id,
2352
2506
  description: "shortcut.sheet.drawing-move-up",
2353
2507
  group: "4_sheet-drawing-view",
2354
- binding: Be.ARROW_UP,
2508
+ binding: Le.ARROW_UP,
2355
2509
  priority: 100,
2356
- preconditions: qe,
2510
+ preconditions: rt,
2357
2511
  staticParameters: {
2358
- direction: ve.UP
2512
+ direction: _e.UP
2359
2513
  }
2360
- }, vo = {
2361
- id: Ze.id,
2514
+ }, yo = {
2515
+ id: nt.id,
2362
2516
  description: "shortcut.sheet.drawing-move-left",
2363
2517
  group: "4_sheet-drawing-view",
2364
- binding: Be.ARROW_LEFT,
2518
+ binding: Le.ARROW_LEFT,
2365
2519
  priority: 100,
2366
- preconditions: qe,
2520
+ preconditions: rt,
2367
2521
  staticParameters: {
2368
- direction: ve.LEFT
2522
+ direction: _e.LEFT
2369
2523
  }
2370
- }, So = {
2371
- id: Ze.id,
2524
+ }, Oo = {
2525
+ id: nt.id,
2372
2526
  description: "shortcut.sheet.drawing-move-right",
2373
2527
  group: "4_sheet-drawing-view",
2374
- binding: Be.ARROW_RIGHT,
2528
+ binding: Le.ARROW_RIGHT,
2375
2529
  priority: 100,
2376
- preconditions: qe,
2530
+ preconditions: rt,
2377
2531
  staticParameters: {
2378
- direction: ve.RIGHT
2532
+ direction: _e.RIGHT
2379
2533
  }
2380
- }, Io = {
2381
- id: _r.id,
2534
+ }, To = {
2535
+ id: Ir.id,
2382
2536
  description: "shortcut.sheet.drawing-delete",
2383
2537
  group: "4_sheet-drawing-view",
2384
2538
  // when focusing on any other input tag do not trigger this shortcut
2385
- preconditions: qe,
2386
- binding: Be.DELETE,
2387
- mac: Be.BACKSPACE
2539
+ preconditions: rt,
2540
+ binding: Le.DELETE,
2541
+ mac: Le.BACKSPACE
2388
2542
  };
2389
- var Co = Object.defineProperty, bo = Object.getOwnPropertyDescriptor, Ro = (i, e, n, t) => {
2390
- for (var r = t > 1 ? void 0 : t ? bo(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2543
+ var Eo = Object.defineProperty, Po = Object.getOwnPropertyDescriptor, Uo = (i, e, n, t) => {
2544
+ for (var r = t > 1 ? void 0 : t ? Po(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2391
2545
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
2392
- return t && r && Co(e, n, r), r;
2393
- }, Ct = (i, e) => (n, t) => e(n, t, i);
2394
- let At = class extends ae {
2395
- constructor(i, e, n, t) {
2396
- super(), this._componentManager = i, this._menuManagerService = e, this._commandService = n, this._shortcutService = t, this._init();
2546
+ return t && r && Eo(e, n, r), r;
2547
+ }, xe = (i, e) => (n, t) => e(n, t, i);
2548
+ let Bt = class extends oe {
2549
+ constructor(i, e, n, t, r, s) {
2550
+ super(), this._componentManager = i, this._menuManagerService = e, this._commandService = n, this._shortcutService = t, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
2397
2551
  }
2398
2552
  _initCustomComponents() {
2399
2553
  const i = this._componentManager;
2400
- this.disposeWithMe(i.register(vr, wr)), this.disposeWithMe(i.register(cr, fo));
2554
+ this.disposeWithMe(i.register(Cr, Sr)), this.disposeWithMe(i.register(lr, bo));
2401
2555
  }
2402
2556
  _initMenus() {
2403
- this._menuManagerService.mergeMenu(po);
2557
+ this._menuManagerService.mergeMenu(Ro);
2404
2558
  }
2405
2559
  _initCommands() {
2406
2560
  [
2407
- dn,
2408
- ln,
2409
- kt,
2410
- $t,
2411
- Lt,
2412
- dr,
2413
- k,
2414
- lr,
2561
+ Gt,
2562
+ hn,
2563
+ Ft,
2564
+ tt,
2565
+ Yt,
2415
2566
  ur,
2567
+ k,
2568
+ hr,
2416
2569
  gr,
2417
- Ze,
2418
- _r,
2419
- hr
2570
+ mr,
2571
+ nt,
2572
+ Ir,
2573
+ fr
2420
2574
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
2421
2575
  }
2422
2576
  _initShortcuts() {
2423
2577
  [
2424
2578
  // sheet drawing shortcuts
2425
- wo,
2426
- _o,
2427
- vo,
2428
- So,
2429
- Io
2579
+ Do,
2580
+ Mo,
2581
+ yo,
2582
+ Oo,
2583
+ To
2430
2584
  ].forEach((i) => {
2431
2585
  this.disposeWithMe(this._shortcutService.registerShortcut(i));
2432
2586
  });
@@ -2435,94 +2589,96 @@ let At = class extends ae {
2435
2589
  this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
2436
2590
  }
2437
2591
  };
2438
- At = Ro([
2439
- Ct(0, N(Ti)),
2440
- Ct(1, Pi),
2441
- Ct(2, X),
2442
- Ct(3, Ui)
2443
- ], At);
2444
- var Do = Object.defineProperty, Mo = Object.getOwnPropertyDescriptor, yo = (i, e, n, t) => {
2445
- for (var r = t > 1 ? void 0 : t ? Mo(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2592
+ Bt = Uo([
2593
+ xe(0, N(ji)),
2594
+ xe(1, Bi),
2595
+ xe(2, F),
2596
+ xe(3, Wi),
2597
+ xe(4, te),
2598
+ xe(5, N(ln))
2599
+ ], Bt);
2600
+ var Ao = Object.defineProperty, No = Object.getOwnPropertyDescriptor, jo = (i, e, n, t) => {
2601
+ for (var r = t > 1 ? void 0 : t ? No(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2446
2602
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
2447
- return t && r && Do(e, n, r), r;
2448
- }, De = (i, e) => (n, t) => e(n, t, i);
2449
- function Oo(i, e, n, t, r) {
2450
- const { scaleX: s, scaleY: o } = e.getAncestorScale(), c = e.getViewport(jn.VIEW_MAIN), d = {
2603
+ return t && r && Ao(e, n, r), r;
2604
+ }, Me = (i, e) => (n, t) => e(n, t, i);
2605
+ function Bo(i, e, n, t, r) {
2606
+ const { scaleX: s, scaleY: o } = e.getAncestorScale(), d = e.getViewport(xn.VIEW_MAIN), a = {
2451
2607
  left: !0,
2452
2608
  top: !0
2453
2609
  };
2454
- if (!c)
2610
+ if (!d)
2455
2611
  return {
2456
2612
  ...i,
2457
- absolute: d
2613
+ absolute: a
2458
2614
  };
2459
- const { left: g, right: a, top: l, bottom: h } = i;
2460
- let { top: u, left: m, viewportScrollX: p, viewportScrollY: f } = c;
2615
+ const { left: g, right: c, top: l, bottom: h } = i;
2616
+ let { top: u, left: f, viewportScrollX: p, viewportScrollY: m } = d;
2461
2617
  const { boundsOfViewArea: w, scrollDirectionResponse: S } = r || {};
2462
- w && (ye.isDefine(w.top) && (u = w.top), ye.isDefine(w.left) && (m = w.left)), S === "HORIZONTAL" && (f = 0), S === "VERTICAL" && (p = 0);
2618
+ w && (Oe.isDefine(w.top) && (u = w.top), Oe.isDefine(w.left) && (f = w.left)), S === "HORIZONTAL" && (m = 0), S === "VERTICAL" && (p = 0);
2463
2619
  let I, D;
2464
- g < m ? (d.left = !0, I = (m + (g - m)) * s, D = Math.max(
2620
+ g < f ? (a.left = !0, I = (f + (g - f)) * s, D = Math.max(
2465
2621
  Math.min(
2466
- (m + (a - m)) * s,
2467
- m * s
2622
+ (f + (c - f)) * s,
2623
+ f * s
2468
2624
  ),
2469
- (a - p) * s
2470
- )) : (d.left = !1, I = Math.max((g - p) * s, m * s), D = Math.max((a - p) * s, m * s));
2471
- let v, R;
2472
- return l < u ? (d.top = !0, v = (u + (l - u)) * o, R = Math.max(
2625
+ (c - p) * s
2626
+ )) : (a.left = !1, I = Math.max((g - p) * s, f * s), D = Math.max((c - p) * s, f * s));
2627
+ let v, C;
2628
+ return l < u ? (a.top = !0, v = (u + (l - u)) * o, C = Math.max(
2473
2629
  Math.min(
2474
- (u + (a - u)) * o,
2630
+ (u + (c - u)) * o,
2475
2631
  u * o
2476
2632
  ),
2477
- (h - f) * o
2478
- )) : (d.top = !1, v = Math.max((l - f) * o, u * o), R = Math.max((h - f) * o, u * o)), {
2633
+ (h - m) * o
2634
+ )) : (a.top = !1, v = Math.max((l - m) * o, u * o), C = Math.max((h - m) * o, u * o)), {
2479
2635
  left: I,
2480
2636
  right: D,
2481
2637
  top: v,
2482
- bottom: R,
2483
- absolute: d
2638
+ bottom: C,
2639
+ absolute: a
2484
2640
  };
2485
2641
  }
2486
- const me = (i, e, n, t, r) => {
2487
- const { scene: s } = e, { left: o, top: c, width: d, height: g, angle: a } = i, l = {
2642
+ const ge = (i, e, n, t, r) => {
2643
+ const { scene: s } = e, { left: o, top: d, width: a, height: g, angle: c } = i, l = {
2488
2644
  left: o,
2489
- right: o + d,
2490
- top: c,
2491
- bottom: c + g
2492
- }, h = Oo(l, s, n, t, r), { scaleX: u, scaleY: m } = s.getAncestorScale();
2645
+ right: o + a,
2646
+ top: d,
2647
+ bottom: d + g
2648
+ }, h = Bo(l, s, n, t, r), { scaleX: u, scaleY: f } = s.getAncestorScale();
2493
2649
  return {
2494
2650
  startX: h.left,
2495
2651
  endX: h.right,
2496
2652
  startY: h.top,
2497
2653
  endY: h.bottom,
2498
- rotate: a,
2499
- width: d * u,
2500
- height: g * m,
2654
+ rotate: c,
2655
+ width: a * u,
2656
+ height: g * f,
2501
2657
  absolute: h.absolute
2502
2658
  };
2503
2659
  };
2504
- let Nt = class extends ae {
2505
- constructor(e, n, t, r, s, o, c) {
2660
+ let Wt = class extends oe {
2661
+ constructor(e, n, t, r, s, o, d) {
2506
2662
  super();
2507
2663
  /**
2508
2664
  * for update dom container position when scrolling and zoom
2509
2665
  */
2510
- J(this, "_domLayerMap", /* @__PURE__ */ new Map());
2666
+ K(this, "_domLayerMap", /* @__PURE__ */ new Map());
2511
2667
  /**
2512
2668
  * for update dom container position when scrolling and zoom
2513
2669
  */
2514
- J(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
2515
- J(this, "_transformChange$", new Ht());
2516
- J(this, "transformChange$", this._transformChange$.asObservable());
2517
- J(this, "_add$", new Ht());
2518
- J(this, "add$", this._add$.asObservable());
2519
- J(this, "_remove$", new Ht());
2520
- J(this, "remove$", this._remove$.asObservable());
2521
- J(this, "_hooks", []);
2522
- this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = c, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
2670
+ K(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
2671
+ K(this, "_transformChange$", new Jt());
2672
+ K(this, "transformChange$", this._transformChange$.asObservable());
2673
+ K(this, "_add$", new Jt());
2674
+ K(this, "add$", this._add$.asObservable());
2675
+ K(this, "_remove$", new Jt());
2676
+ K(this, "remove$", this._remove$.asObservable());
2677
+ K(this, "_hooks", []);
2678
+ 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();
2523
2679
  }
2524
2680
  _bindScrollEvent() {
2525
- this._lifecycleService.lifecycle$.pipe(Se((e) => e === Kr.Rendered), Ni(1)).subscribe(() => {
2681
+ this._lifecycleService.lifecycle$.pipe(ve((e) => e === qr.Rendered), $i(1)).subscribe(() => {
2526
2682
  this._scrollUpdateListener();
2527
2683
  });
2528
2684
  }
@@ -2559,30 +2715,30 @@ let Nt = class extends ae {
2559
2715
  this.disposeWithMe(
2560
2716
  this._drawingManagerService.add$.subscribe((e) => {
2561
2717
  e.forEach((n) => {
2562
- var ie, se, K;
2563
- const { unitId: t, subUnitId: r, drawingId: s } = n, o = Y(this._univerInstanceService, { unitId: t, subUnitId: r }), c = this._drawingManagerService.getDrawingByParam(n), d = this._univerInstanceService.getUnit(t, G.UNIVER_SHEET);
2564
- if (!d)
2718
+ var re, ie, z;
2719
+ const { unitId: t, subUnitId: r, drawingId: s } = n, o = X(this._univerInstanceService, { unitId: t, subUnitId: r }), d = this._drawingManagerService.getDrawingByParam(n), a = this._univerInstanceService.getUnit(t, V.UNIVER_SHEET);
2720
+ if (!a)
2565
2721
  return;
2566
- const g = d.getActiveSheet().getSheetId();
2567
- if (!c || !o)
2722
+ const g = a.getActiveSheet().getSheetId();
2723
+ if (!d || !o)
2568
2724
  return;
2569
- const a = (ie = this._renderManagerService.getRenderById(t)) == null ? void 0 : ie.with(H).getWorksheetSkeleton(r);
2570
- if (!a)
2725
+ const c = (re = this._renderManagerService.getRenderById(t)) == null ? void 0 : re.with(G).getWorksheetSkeleton(r);
2726
+ if (!c)
2571
2727
  return;
2572
- const { transform: l, drawingType: h, data: u } = c;
2728
+ const { transform: l, drawingType: h, data: u } = d;
2573
2729
  if (h !== L.DRAWING_DOM && h !== L.DRAWING_CHART)
2574
2730
  return;
2575
- const m = this._getSceneAndTransformerByDrawingSearch(t);
2576
- if (m == null)
2731
+ const f = this._getSceneAndTransformerByDrawingSearch(t);
2732
+ if (f == null)
2577
2733
  return;
2578
- const { scene: p, canvas: f } = m;
2734
+ const { scene: p, canvas: m } = f;
2579
2735
  if (l == null)
2580
2736
  return !0;
2581
2737
  if (g !== r)
2582
2738
  return;
2583
- const { left: w, top: S, width: I, height: D, angle: v, flipX: R, flipY: _, skewX: E, skewY: M } = l, A = Ce({ unitId: t, subUnitId: r, drawingId: s }), T = p.getObject(A);
2584
- if (T != null) {
2585
- T.transformByState({ left: w, top: S, width: I, height: D, angle: v, flipX: R, flipY: _, skewX: E, skewY: M });
2739
+ const { left: w, top: S, width: I, height: D, angle: v, flipX: C, flipY: _, skewX: E, skewY: M } = l, y = Ce({ unitId: t, subUnitId: r, drawingId: s }), A = p.getObject(y);
2740
+ if (A != null) {
2741
+ A.transformByState({ left: w, top: S, width: I, height: D, angle: v, flipX: C, flipY: _, skewX: E, skewY: M });
2586
2742
  return;
2587
2743
  }
2588
2744
  const b = {
@@ -2591,16 +2747,16 @@ let Nt = class extends ae {
2591
2747
  width: I,
2592
2748
  height: D,
2593
2749
  zIndex: this._drawingManagerService.getDrawingOrder(t, r).length - 1
2594
- }, C = h === L.DRAWING_CHART;
2595
- if (C) {
2596
- const B = u ? u.backgroundColor : "white";
2597
- b.fill = B, b.rotateEnabled = !1, u && u.border && (b.stroke = u.border), b.paintFirst = "stroke", b.strokeWidth = 1, b.borderEnabled = !1, b.radius = 8;
2750
+ }, R = h === L.DRAWING_CHART;
2751
+ if (R) {
2752
+ const W = u ? u.backgroundColor : "white";
2753
+ b.fill = W, b.rotateEnabled = !1, u && u.border && (b.stroke = u.border), b.paintFirst = "stroke", b.strokeWidth = 1, b.borderEnabled = !1, b.radius = 8;
2598
2754
  }
2599
- const y = new We(A, b);
2600
- C && y.setObjectType(In.CHART), p.addObject(y, Vt), c.allowTransform !== !1 && p.attachTransformerTo(y);
2601
- const W = this._ensureMap(t, r), z = new ht(), Z = me(y, m.renderUnit, a.skeleton, o.worksheet), ce = new Ye(Z), Ie = {
2602
- dispose: z,
2603
- rect: y,
2755
+ const O = new We(y, b);
2756
+ R && O.setObjectType(bn.CHART), p.addObject(O, Kt), d.allowTransform !== !1 && p.attachTransformerTo(O);
2757
+ const $ = this._ensureMap(t, r), ae = new wt(), Se = ge(O, f.renderUnit, c.skeleton, o.worksheet), ce = new He(Se), Ie = {
2758
+ dispose: ae,
2759
+ rect: O,
2604
2760
  position$: ce,
2605
2761
  unitId: t,
2606
2762
  subUnitId: r
@@ -2608,44 +2764,44 @@ let Nt = class extends ae {
2608
2764
  this._canvasFloatDomService.addFloatDom({
2609
2765
  position$: ce,
2610
2766
  id: s,
2611
- componentKey: c.componentKey,
2612
- onPointerDown: (B) => {
2613
- f.dispatchEvent(new PointerEvent(B.type, B));
2767
+ componentKey: d.componentKey,
2768
+ onPointerDown: (W) => {
2769
+ m.dispatchEvent(new PointerEvent(W.type, W));
2614
2770
  },
2615
- onPointerMove: (B) => {
2616
- f.dispatchEvent(new PointerEvent(B.type, B));
2771
+ onPointerMove: (W) => {
2772
+ m.dispatchEvent(new PointerEvent(W.type, W));
2617
2773
  },
2618
- onPointerUp: (B) => {
2619
- f.dispatchEvent(new PointerEvent(B.type, B));
2774
+ onPointerUp: (W) => {
2775
+ m.dispatchEvent(new PointerEvent(W.type, W));
2620
2776
  },
2621
- onWheel: (B) => {
2622
- f.dispatchEvent(new WheelEvent(B.type, B));
2777
+ onWheel: (W) => {
2778
+ m.dispatchEvent(new WheelEvent(W.type, W));
2623
2779
  },
2624
- props: (K = (se = W.get(s)) == null ? void 0 : se.props) != null ? K : this._getFloatDomProps(s),
2780
+ props: (z = (ie = $.get(s)) == null ? void 0 : ie.props) != null ? z : this._getFloatDomProps(s),
2625
2781
  data: u,
2626
2782
  unitId: t
2627
2783
  });
2628
- const le = y.onTransformChange$.subscribeEvent(() => {
2629
- const B = me(y, m.renderUnit, a.skeleton, o.worksheet);
2784
+ const de = O.onTransformChange$.subscribeEvent(() => {
2785
+ const W = ge(O, f.renderUnit, c.skeleton, o.worksheet);
2630
2786
  ce.next(
2631
- B
2787
+ W
2632
2788
  );
2633
2789
  });
2634
- z.add(() => {
2790
+ ae.add(() => {
2635
2791
  this._canvasFloatDomService.removeFloatDom(s);
2636
- }), le && z.add(le), this._domLayerInfoMap.set(s, Ie), W.set(s, {
2637
- ...W.get(s)
2792
+ }), de && ae.add(de), this._domLayerInfoMap.set(s, Ie), $.set(s, {
2793
+ ...$.get(s)
2638
2794
  });
2639
2795
  });
2640
2796
  })
2641
2797
  ), this.disposeWithMe(
2642
2798
  this._drawingManagerService.remove$.subscribe((e) => {
2643
2799
  e.forEach((n) => {
2644
- const { unitId: t, subUnitId: r, drawingId: s } = n, o = Ce({ unitId: t, subUnitId: r, drawingId: s }), c = this._getSceneAndTransformerByDrawingSearch(t);
2645
- if (c == null)
2800
+ const { unitId: t, subUnitId: r, drawingId: s } = n, o = Ce({ unitId: t, subUnitId: r, drawingId: s }), d = this._getSceneAndTransformerByDrawingSearch(t);
2801
+ if (d == null)
2646
2802
  return;
2647
- const { transformer: d, scene: g } = c, a = g.getObject(o);
2648
- a != null && a.oKey && d.clearControlByIds([a == null ? void 0 : a.oKey]);
2803
+ const { transformer: a, scene: g } = d, c = g.getObject(o);
2804
+ c != null && c.oKey && a.clearControlByIds([c == null ? void 0 : c.oKey]);
2649
2805
  });
2650
2806
  })
2651
2807
  );
@@ -2653,39 +2809,39 @@ let Nt = class extends ae {
2653
2809
  _scrollUpdateListener() {
2654
2810
  const e = (n, t) => {
2655
2811
  var g;
2656
- const r = this._getSceneAndTransformerByDrawingSearch(n), s = this._ensureMap(n, t), o = Array.from(s.keys()), c = Y(this._univerInstanceService, { unitId: n, subUnitId: t }), d = (g = this._renderManagerService.getRenderById(n)) == null ? void 0 : g.with(H).getWorksheetSkeleton(t);
2657
- !r || !c || !d || o.forEach((a) => {
2658
- const l = this._domLayerInfoMap.get(a);
2812
+ const r = this._getSceneAndTransformerByDrawingSearch(n), s = this._ensureMap(n, t), o = Array.from(s.keys()), d = X(this._univerInstanceService, { unitId: n, subUnitId: t }), a = (g = this._renderManagerService.getRenderById(n)) == null ? void 0 : g.with(G).getWorksheetSkeleton(t);
2813
+ !r || !d || !a || o.forEach((c) => {
2814
+ const l = this._domLayerInfoMap.get(c);
2659
2815
  if (l) {
2660
- const h = me(l.rect, r.renderUnit, d.skeleton, c.worksheet, l);
2816
+ const h = ge(l.rect, r.renderUnit, a.skeleton, d.worksheet, l);
2661
2817
  l.position$.next(h);
2662
2818
  }
2663
2819
  });
2664
2820
  };
2665
2821
  this.disposeWithMe(
2666
- this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET).pipe(
2667
- Se((n) => !!n),
2668
- Dn((n) => n.activeSheet$),
2669
- Se((n) => !!n),
2670
- He((n) => {
2822
+ this._univerInstanceService.getCurrentTypeOfUnit$(V.UNIVER_SHEET).pipe(
2823
+ ve((n) => !!n),
2824
+ yn((n) => n.activeSheet$),
2825
+ ve((n) => !!n),
2826
+ qe((n) => {
2671
2827
  const t = this._renderManagerService.getRenderById(n.getUnitId());
2672
2828
  return t ? { render: t, unitId: n.getUnitId(), subUnitId: n.getSheetId() } : null;
2673
2829
  }),
2674
- Se((n) => !!n),
2675
- Dn(
2676
- (n) => Jr(n.render.scene.getViewport(jn.VIEW_MAIN).onScrollAfter$).pipe(He(() => ({ unitId: n.unitId, subUnitId: n.subUnitId })))
2830
+ ve((n) => !!n),
2831
+ yn(
2832
+ (n) => Qr(n.render.scene.getViewport(xn.VIEW_MAIN).onScrollAfter$).pipe(qe(() => ({ unitId: n.unitId, subUnitId: n.subUnitId })))
2677
2833
  )
2678
2834
  ).subscribe(({ unitId: n, subUnitId: t }) => {
2679
2835
  e(n, t);
2680
2836
  })
2681
2837
  ), this.disposeWithMe(this._commandService.onCommandExecuted((n) => {
2682
2838
  var t, r;
2683
- if (n.id === bn.id) {
2839
+ if (n.id === Dn.id) {
2684
2840
  const s = n.params, { unitId: o } = s;
2685
- Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((d) => {
2686
- e(o, d);
2841
+ Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((a) => {
2842
+ e(o, a);
2687
2843
  });
2688
- } else if (n.id === zi.id) {
2844
+ } else if (n.id === Qi.id) {
2689
2845
  const { unitId: s, subUnitId: o } = n.params;
2690
2846
  e(s, o);
2691
2847
  }
@@ -2693,25 +2849,25 @@ let Nt = class extends ae {
2693
2849
  }
2694
2850
  _getPosition(e, n) {
2695
2851
  var h;
2696
- const { startX: t, endX: r, startY: s, endY: o } = e, c = (h = this._renderManagerService.getRenderById(n)) == null ? void 0 : h.with(Je);
2697
- if (c == null)
2698
- return;
2699
- const d = c.getCellWithCoordByOffset(t, s);
2852
+ const { startX: t, endX: r, startY: s, endY: o } = e, d = (h = this._renderManagerService.getRenderById(n)) == null ? void 0 : h.with(Ge);
2700
2853
  if (d == null)
2701
2854
  return;
2702
- const g = {
2703
- column: d.actualColumn,
2704
- columnOffset: t - d.startX,
2705
- row: d.actualRow,
2706
- rowOffset: s - d.startY
2707
- }, a = c.getCellWithCoordByOffset(r, o);
2855
+ const a = d.getCellWithCoordByOffset(t, s);
2708
2856
  if (a == null)
2709
2857
  return;
2710
- const l = {
2858
+ const g = {
2711
2859
  column: a.actualColumn,
2712
- columnOffset: r - a.startX,
2860
+ columnOffset: t - a.startX,
2713
2861
  row: a.actualRow,
2714
- rowOffset: o - a.startY
2862
+ rowOffset: s - a.startY
2863
+ }, c = d.getCellWithCoordByOffset(r, o);
2864
+ if (c == null)
2865
+ return;
2866
+ const l = {
2867
+ column: c.actualColumn,
2868
+ columnOffset: r - c.startX,
2869
+ row: c.actualRow,
2870
+ rowOffset: o - c.startY
2715
2871
  };
2716
2872
  return {
2717
2873
  from: g,
@@ -2745,28 +2901,28 @@ let Nt = class extends ae {
2745
2901
  updateFloatDomProps(e, n, t, r) {
2746
2902
  const s = this._domLayerInfoMap.get(t), o = this._getSceneAndTransformerByDrawingSearch(e);
2747
2903
  if (s && o) {
2748
- const { scene: c } = o, d = Ce({ unitId: e, subUnitId: n, drawingId: t }), g = c.getObject(d);
2904
+ const { scene: d } = o, a = Ce({ unitId: e, subUnitId: n, drawingId: t }), g = d.getObject(a);
2749
2905
  g && g instanceof We && g.setProps(r);
2750
2906
  }
2751
2907
  }
2752
2908
  // CreateFloatDomCommand --> floatDomService.addFloatDomToPosition
2753
2909
  addFloatDomToPosition(e, n) {
2754
- const t = Y(this._univerInstanceService, {
2910
+ const t = X(this._univerInstanceService, {
2755
2911
  unitId: e.unitId,
2756
2912
  subUnitId: e.subUnitId
2757
2913
  });
2758
2914
  if (!t)
2759
2915
  throw new Error("cannot find current target!");
2760
- const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: c, data: d, allowTransform: g = !0 } = e, a = n != null ? n : Gt(), l = this._getPosition(o, r);
2916
+ const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: d, data: a, allowTransform: g = !0 } = e, c = n != null ? n : Ht(), l = this._getPosition(o, r);
2761
2917
  if (l == null)
2762
2918
  return;
2763
- this._ensureMap(r, s).set(a, e);
2919
+ this._ensureMap(r, s).set(c, e);
2764
2920
  const u = {
2765
2921
  unitId: r,
2766
2922
  subUnitId: s,
2767
- drawingId: a,
2923
+ drawingId: c,
2768
2924
  drawingType: e.type || L.DRAWING_DOM,
2769
- componentKey: c,
2925
+ componentKey: d,
2770
2926
  sheetTransform: l,
2771
2927
  transform: {
2772
2928
  left: o.startX,
@@ -2774,16 +2930,16 @@ let Nt = class extends ae {
2774
2930
  width: o.endX - o.startX,
2775
2931
  height: o.endY - o.startY
2776
2932
  },
2777
- data: d,
2933
+ data: a,
2778
2934
  allowTransform: g
2779
2935
  };
2780
- return this._commandService.executeCommand(kt.id, {
2936
+ return this._commandService.executeCommand(Ft.id, {
2781
2937
  unitId: r,
2782
2938
  drawings: [u]
2783
- }), this._add$.next({ unitId: r, subUnitId: s, id: a }), {
2784
- id: a,
2939
+ }), this._add$.next({ unitId: r, subUnitId: s, id: c }), {
2940
+ id: c,
2785
2941
  dispose: () => {
2786
- this._removeDom(a, !0);
2942
+ this._removeDom(c, !0);
2787
2943
  }
2788
2944
  };
2789
2945
  }
@@ -2796,11 +2952,11 @@ let Nt = class extends ae {
2796
2952
  const o = this._getSceneAndTransformerByDrawingSearch(r);
2797
2953
  if (o && o.scene.removeObject(t.rect), n) {
2798
2954
  this._ensureMap(r, s).delete(e);
2799
- const d = this._drawingManagerService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: e });
2800
- if (!d)
2955
+ const a = this._drawingManagerService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: e });
2956
+ if (!a)
2801
2957
  return;
2802
- const g = this._sheetDrawingService.getBatchRemoveOp([d]), { redo: a, objects: l } = g;
2803
- this._commandService.syncExecuteCommand(P.id, { unitId: r, subUnitId: s, op: a, objects: l, type: U.REMOVE });
2958
+ const g = this._sheetDrawingService.getBatchRemoveOp([a]), { redo: c, objects: l } = g;
2959
+ this._commandService.syncExecuteCommand(P.id, { unitId: r, subUnitId: s, op: c, objects: l, type: U.REMOVE });
2804
2960
  }
2805
2961
  }
2806
2962
  addHook(e) {
@@ -2812,27 +2968,27 @@ let Nt = class extends ae {
2812
2968
  };
2813
2969
  }
2814
2970
  addFloatDomToRange(e, n, t, r) {
2815
- var _, E, M, A, T;
2816
- const s = Y(this._univerInstanceService, {
2971
+ var _, E, M, y, A;
2972
+ const s = X(this._univerInstanceService, {
2817
2973
  unitId: n.unitId,
2818
2974
  subUnitId: n.subUnitId
2819
2975
  });
2820
2976
  if (!s)
2821
2977
  throw new Error("cannot find current target!");
2822
- const { unitId: o, subUnitId: c } = s, d = this._getSceneAndTransformerByDrawingSearch(o);
2823
- if (!d) return;
2978
+ const { unitId: o, subUnitId: d } = s, a = this._getSceneAndTransformerByDrawingSearch(o);
2979
+ if (!a) return;
2824
2980
  const g = this._renderManagerService.getRenderById(o);
2825
2981
  if (!g) return;
2826
- const a = (_ = this._renderManagerService.getRenderById(o)) == null ? void 0 : _.with(H).getWorksheetSkeleton(c);
2827
- if (!a) return;
2828
- const { componentKey: l, data: h, allowTransform: u = !0 } = n, m = r != null ? r : Gt(), { position: p, position$: f } = this._createRangePositionObserver(e, g, a.skeleton), w = this._getPosition(p, o);
2982
+ const c = (_ = this._renderManagerService.getRenderById(o)) == null ? void 0 : _.with(G).getWorksheetSkeleton(d);
2983
+ if (!c) return;
2984
+ const { componentKey: l, data: h, allowTransform: u = !0 } = n, f = r != null ? r : Ht(), { position: p, position$: m } = this._createRangePositionObserver(e, g, c.skeleton), w = this._getPosition(p, o);
2829
2985
  if (w == null)
2830
2986
  return;
2831
- this._ensureMap(o, c).set(m, n);
2832
- const I = d.scene, { scaleX: D } = I.getAncestorScale(), v = bt(p, t, D), R = {
2987
+ this._ensureMap(o, d).set(f, n);
2988
+ const I = a.scene, { scaleX: D } = I.getAncestorScale(), v = Mt(p, t, D), C = {
2833
2989
  unitId: o,
2834
- subUnitId: c,
2835
- drawingId: m,
2990
+ subUnitId: d,
2991
+ drawingId: f,
2836
2992
  drawingType: n.type || L.DRAWING_DOM,
2837
2993
  componentKey: l,
2838
2994
  sheetTransform: w,
@@ -2846,64 +3002,64 @@ let Nt = class extends ae {
2846
3002
  allowTransform: u
2847
3003
  };
2848
3004
  {
2849
- const { unitId: b, subUnitId: C, drawingId: y } = R, W = Y(this._univerInstanceService, { unitId: b, subUnitId: C }), z = R, Z = this._univerInstanceService.getUnit(b, G.UNIVER_SHEET);
2850
- if (!Z)
3005
+ const { unitId: b, subUnitId: R, drawingId: O } = C, $ = X(this._univerInstanceService, { unitId: b, subUnitId: R }), ae = C, Se = this._univerInstanceService.getUnit(b, V.UNIVER_SHEET);
3006
+ if (!Se)
2851
3007
  return;
2852
- const ce = Z.getActiveSheet().getSheetId();
2853
- if (!z || !W)
3008
+ const ce = Se.getActiveSheet().getSheetId();
3009
+ if (!ae || !$)
2854
3010
  return;
2855
- const Ie = (E = this._renderManagerService.getRenderById(b)) == null ? void 0 : E.with(H);
3011
+ const Ie = (E = this._renderManagerService.getRenderById(b)) == null ? void 0 : E.with(G);
2856
3012
  if (!Ie)
2857
3013
  return;
2858
- const le = Ie.getWorksheetSkeleton(C);
2859
- if (!le)
3014
+ const de = Ie.getWorksheetSkeleton(R);
3015
+ if (!de)
2860
3016
  return;
2861
- const { transform: ie, drawingType: se, data: K } = z;
2862
- if (se !== L.DRAWING_DOM && se !== L.DRAWING_CHART)
3017
+ const { transform: re, drawingType: ie, data: z } = ae;
3018
+ if (ie !== L.DRAWING_DOM && ie !== L.DRAWING_CHART)
2863
3019
  return;
2864
- const B = this._getSceneAndTransformerByDrawingSearch(b);
2865
- if (B == null)
3020
+ const W = this._getSceneAndTransformerByDrawingSearch(b);
3021
+ if (W == null)
2866
3022
  return;
2867
- const { scene: Oe, canvas: Ee } = B;
2868
- if (ie == null || ce !== C)
3023
+ const { scene: Te, canvas: Ee } = W;
3024
+ if (re == null || ce !== R)
2869
3025
  return;
2870
- const { left: Qe, top: et, width: tt, height: nt, angle: Ft, flipX: Yt, flipY: rt, skewX: it, skewY: Te } = ie, st = Ce({ unitId: b, subUnitId: C, drawingId: y }), ue = Oe.getObject(st);
2871
- if (ue != null) {
2872
- ue.transformByState({ left: Qe, top: et, width: tt, height: nt, angle: Ft, flipX: Yt, flipY: rt, skewX: it, skewY: Te });
3026
+ const { left: it, top: st, width: ot, height: at, angle: Xt, flipX: Vt, flipY: ct, skewX: dt, skewY: Pe } = re, lt = Ce({ unitId: b, subUnitId: R, drawingId: O }), le = Te.getObject(lt);
3027
+ if (le != null) {
3028
+ le.transformByState({ left: it, top: st, width: ot, height: at, angle: Xt, flipX: Vt, flipY: ct, skewX: dt, skewY: Pe });
2873
3029
  return;
2874
3030
  }
2875
- const te = {
2876
- left: Qe,
3031
+ const q = {
3032
+ left: it,
2877
3033
  // from floatDomParam.transform
2878
- top: et,
2879
- width: tt,
2880
- height: nt,
2881
- zIndex: this._drawingManagerService.getDrawingOrder(b, C).length - 1
2882
- }, Pe = se === L.DRAWING_CHART;
2883
- if (Pe) {
2884
- const j = K ? K.backgroundColor : "white";
2885
- te.fill = j, te.rotateEnabled = !1, K && K.border && (te.stroke = K.border), te.paintFirst = "stroke", te.strokeWidth = 1, te.borderEnabled = !1, te.radius = 8;
3034
+ top: st,
3035
+ width: ot,
3036
+ height: at,
3037
+ zIndex: this._drawingManagerService.getDrawingOrder(b, R).length - 1
3038
+ }, Ue = ie === L.DRAWING_CHART;
3039
+ if (Ue) {
3040
+ const j = z ? z.backgroundColor : "white";
3041
+ q.fill = j, q.rotateEnabled = !1, z && z.border && (q.stroke = z.border), q.paintFirst = "stroke", q.strokeWidth = 1, q.borderEnabled = !1, q.radius = 8;
2886
3042
  }
2887
- const oe = new We(st, te);
2888
- Pe && oe.setObjectType(In.CHART), Oe.addObject(oe, Vt), z.allowTransform !== !1 && Oe.attachTransformerTo(oe);
2889
- const Le = this._ensureMap(b, C), he = new ht(), Ue = Oe.getMainViewport(), Ae = {
2890
- top: Ue.top,
2891
- left: Ue.left,
2892
- bottom: Ue.bottom,
2893
- right: Ue.right
2894
- }, ge = {
2895
- dispose: he,
2896
- rect: oe,
2897
- boundsOfViewArea: Ae,
3043
+ const se = new We(lt, q);
3044
+ Ue && se.setObjectType(bn.CHART), Te.addObject(se, Kt), ae.allowTransform !== !1 && Te.attachTransformerTo(se);
3045
+ const Xe = this._ensureMap(b, R), ue = new wt(), Ae = Te.getMainViewport(), Ne = {
3046
+ top: Ae.top,
3047
+ left: Ae.left,
3048
+ bottom: Ae.bottom,
3049
+ right: Ae.right
3050
+ }, he = {
3051
+ dispose: ue,
3052
+ rect: se,
3053
+ boundsOfViewArea: Ne,
2898
3054
  domAnchor: t,
2899
3055
  unitId: b,
2900
- subUnitId: C
2901
- }, ot = me(oe, B.renderUnit, le.skeleton, W.worksheet, ge), fe = new Ye(ot);
2902
- ge.position$ = fe;
2903
- let x = {
3056
+ subUnitId: R
3057
+ }, ut = ge(se, W.renderUnit, de.skeleton, $.worksheet, he), fe = new He(ut);
3058
+ he.position$ = fe;
3059
+ let B = {
2904
3060
  position$: fe,
2905
- id: y,
2906
- componentKey: z.componentKey,
3061
+ id: O,
3062
+ componentKey: ae.componentKey,
2907
3063
  onPointerDown: () => {
2908
3064
  },
2909
3065
  onPointerMove: () => {
@@ -2913,12 +3069,12 @@ let Nt = class extends ae {
2913
3069
  onWheel: (j) => {
2914
3070
  Ee.dispatchEvent(new WheelEvent(j.type, j));
2915
3071
  },
2916
- props: (A = (M = Le.get(y)) == null ? void 0 : M.props) != null ? A : this._getFloatDomProps(y),
2917
- data: K,
3072
+ props: (y = (M = Xe.get(O)) == null ? void 0 : M.props) != null ? y : this._getFloatDomProps(O),
3073
+ data: z,
2918
3074
  unitId: b
2919
3075
  };
2920
- n.eventPassThrough && (x = {
2921
- ...x,
3076
+ n.eventPassThrough && (B = {
3077
+ ...B,
2922
3078
  onPointerDown: (j) => {
2923
3079
  Ee.dispatchEvent(new PointerEvent(j.type, j));
2924
3080
  },
@@ -2928,81 +3084,81 @@ let Nt = class extends ae {
2928
3084
  onPointerUp: (j) => {
2929
3085
  Ee.dispatchEvent(new PointerEvent(j.type, j));
2930
3086
  }
2931
- }), this._canvasFloatDomService.addFloatDom(x), this.disposeWithMe(f.subscribe((j) => {
2932
- var un, hn, gn, mn;
2933
- const ct = bt({
3087
+ }), this._canvasFloatDomService.addFloatDom(B), this.disposeWithMe(m.subscribe((j) => {
3088
+ var gn, fn, mn, pn;
3089
+ const gt = Mt({
2934
3090
  rotate: 0,
2935
3091
  startX: j.startX,
2936
3092
  startY: j.startY,
2937
3093
  endX: j.endX,
2938
3094
  endY: j.endY,
2939
- width: (un = t.width) != null ? un : j.width,
2940
- height: (hn = t.height) != null ? hn : j.height,
3095
+ width: (gn = t.width) != null ? gn : j.width,
3096
+ height: (fn = t.height) != null ? fn : j.height,
2941
3097
  absolute: {
2942
3098
  left: p.absolute.left,
2943
3099
  top: p.absolute.top
2944
3100
  }
2945
- }, t), Rr = Ce({ unitId: b, subUnitId: C, drawingId: y }), Dr = new We(Rr, {
2946
- left: ct.startX,
2947
- top: ct.startY,
2948
- width: (gn = t.width) != null ? gn : j.width,
2949
- height: (mn = t.height) != null ? mn : j.height,
2950
- zIndex: this._drawingManagerService.getDrawingOrder(b, C).length - 1
2951
- }), Mr = me(Dr, B.renderUnit, le.skeleton, W.worksheet, ge);
2952
- fe.next(Mr);
3101
+ }, t), yr = Ce({ unitId: b, subUnitId: R, drawingId: O }), Or = new We(yr, {
3102
+ left: gt.startX,
3103
+ top: gt.startY,
3104
+ width: (mn = t.width) != null ? mn : j.width,
3105
+ height: (pn = t.height) != null ? pn : j.height,
3106
+ zIndex: this._drawingManagerService.getDrawingOrder(b, R).length - 1
3107
+ }), Tr = ge(Or, W.renderUnit, de.skeleton, $.worksheet, he);
3108
+ fe.next(Tr);
2953
3109
  }));
2954
- const Fe = (T = this._renderManagerService.getRenderById(b)) == null ? void 0 : T.with(H);
2955
- Fe == null || Fe.currentSkeleton$.subscribe((j) => {
2956
- j && a.sheetId !== j.sheetId && this._removeDom(m, !0);
3110
+ const Ve = (A = this._renderManagerService.getRenderById(b)) == null ? void 0 : A.with(G);
3111
+ Ve == null || Ve.currentSkeleton$.subscribe((j) => {
3112
+ j && c.sheetId !== j.sheetId && this._removeDom(f, !0);
2957
3113
  });
2958
- const at = oe.onTransformChange$.subscribeEvent(() => {
2959
- const j = me(oe, B.renderUnit, le.skeleton, W.worksheet, ge);
3114
+ const ht = se.onTransformChange$.subscribeEvent(() => {
3115
+ const j = ge(se, W.renderUnit, de.skeleton, $.worksheet, he);
2960
3116
  fe.next(
2961
3117
  j
2962
3118
  );
2963
3119
  });
2964
- he.add(() => {
2965
- this._canvasFloatDomService.removeFloatDom(y);
2966
- }), at && he.add(at), this._domLayerInfoMap.set(y, ge), Le.set(y, {
2967
- ...Le.get(y)
3120
+ ue.add(() => {
3121
+ this._canvasFloatDomService.removeFloatDom(O);
3122
+ }), ht && ue.add(ht), this._domLayerInfoMap.set(O, he), Xe.set(O, {
3123
+ ...Xe.get(O)
2968
3124
  });
2969
3125
  }
2970
3126
  return {
2971
- id: m,
3127
+ id: f,
2972
3128
  dispose: () => {
2973
- this._removeDom(m, !0);
3129
+ this._removeDom(f, !0);
2974
3130
  }
2975
3131
  };
2976
3132
  }
2977
3133
  addFloatDomToColumnHeader(e, n, t, r) {
2978
- var v, R, _, E, M;
2979
- const s = Y(this._univerInstanceService, {
3134
+ var v, C, _, E, M;
3135
+ const s = X(this._univerInstanceService, {
2980
3136
  unitId: n.unitId,
2981
3137
  subUnitId: n.subUnitId
2982
3138
  });
2983
3139
  if (!s)
2984
3140
  throw new Error("cannot find current target!");
2985
- const { unitId: o, subUnitId: c } = s;
3141
+ const { unitId: o, subUnitId: d } = s;
2986
3142
  if (!this._getSceneAndTransformerByDrawingSearch(o)) return;
2987
3143
  const g = this._renderManagerService.getRenderById(o);
2988
3144
  if (!g) return;
2989
- const a = (v = this._renderManagerService.getRenderById(o)) == null ? void 0 : v.with(H).getWorksheetSkeleton(c);
2990
- if (!a) return;
2991
- const { componentKey: l, data: h, allowTransform: u = !0 } = n, m = r != null ? r : Gt(), { position: p, position$: f } = this._createRangePositionObserver({
3145
+ const c = (v = this._renderManagerService.getRenderById(o)) == null ? void 0 : v.with(G).getWorksheetSkeleton(d);
3146
+ if (!c) return;
3147
+ const { componentKey: l, data: h, allowTransform: u = !0 } = n, f = r != null ? r : Ht(), { position: p, position$: m } = this._createRangePositionObserver({
2992
3148
  startRow: 0,
2993
3149
  endRow: 0,
2994
3150
  startColumn: e,
2995
3151
  endColumn: e
2996
- }, g, a.skeleton), w = p;
3152
+ }, g, c.skeleton), w = p;
2997
3153
  w.startY = 0;
2998
3154
  const S = this._getPosition(p, o);
2999
3155
  if (S == null)
3000
3156
  return;
3001
- this._ensureMap(o, c).set(m, n);
3157
+ this._ensureMap(o, d).set(f, n);
3002
3158
  const D = {
3003
3159
  unitId: o,
3004
- subUnitId: c,
3005
- drawingId: m,
3160
+ subUnitId: d,
3161
+ drawingId: f,
3006
3162
  drawingType: n.type || L.DRAWING_DOM,
3007
3163
  componentKey: l,
3008
3164
  sheetTransform: S,
@@ -3016,30 +3172,30 @@ let Nt = class extends ae {
3016
3172
  allowTransform: u
3017
3173
  };
3018
3174
  {
3019
- const { unitId: A, subUnitId: T, drawingId: b } = D, C = Y(this._univerInstanceService, { unitId: A, subUnitId: T }), y = D, W = this._univerInstanceService.getUnit(A, G.UNIVER_SHEET);
3020
- if (!W)
3175
+ const { unitId: y, subUnitId: A, drawingId: b } = D, R = X(this._univerInstanceService, { unitId: y, subUnitId: A }), O = D, $ = this._univerInstanceService.getUnit(y, V.UNIVER_SHEET);
3176
+ if (!$)
3021
3177
  return;
3022
- const z = W.getActiveSheet().getSheetId();
3023
- if (!y || !C)
3178
+ const ae = $.getActiveSheet().getSheetId();
3179
+ if (!O || !R)
3024
3180
  return;
3025
- const Z = (R = this._renderManagerService.getRenderById(A)) == null ? void 0 : R.with(H);
3026
- if (!Z)
3181
+ const Se = (C = this._renderManagerService.getRenderById(y)) == null ? void 0 : C.with(G);
3182
+ if (!Se)
3027
3183
  return;
3028
- const ce = Z.getWorksheetSkeleton(T);
3184
+ const ce = Se.getWorksheetSkeleton(A);
3029
3185
  if (!ce)
3030
3186
  return;
3031
- const { transform: Ie, data: le } = y, ie = this._getSceneAndTransformerByDrawingSearch(A);
3032
- if (ie == null)
3187
+ const { transform: Ie, data: de } = O, re = this._getSceneAndTransformerByDrawingSearch(y);
3188
+ if (re == null)
3033
3189
  return;
3034
- const { scene: se, canvas: K } = ie;
3035
- if (Ie == null || z !== T)
3190
+ const { scene: ie, canvas: z } = re;
3191
+ if (Ie == null || ae !== A)
3036
3192
  return;
3037
- const { left: B, top: Oe, width: Ee, height: Qe, angle: et, flipX: tt, flipY: nt, skewX: Ft, skewY: Yt } = Ie, rt = Ce({ unitId: A, subUnitId: T, drawingId: b }), it = se.getObject(rt);
3038
- if (it != null) {
3039
- it.transformByState({ left: B, top: Oe, width: Ee, height: Qe, angle: et, flipX: tt, flipY: nt, skewX: Ft, skewY: Yt });
3193
+ const { left: W, top: Te, width: Ee, height: it, angle: st, flipX: ot, flipY: at, skewX: Xt, skewY: Vt } = Ie, ct = Ce({ unitId: y, subUnitId: A, drawingId: b }), dt = ie.getObject(ct);
3194
+ if (dt != null) {
3195
+ dt.transformByState({ left: W, top: Te, width: Ee, height: it, angle: st, flipX: ot, flipY: at, skewX: Xt, skewY: Vt });
3040
3196
  return;
3041
3197
  }
3042
- const Te = bt({
3198
+ const Pe = Mt({
3043
3199
  rotate: 0,
3044
3200
  startX: w.startX,
3045
3201
  startY: 0,
@@ -3051,102 +3207,102 @@ let Nt = class extends ae {
3051
3207
  left: p.absolute.left,
3052
3208
  top: p.absolute.top
3053
3209
  }
3054
- }, t), st = {
3055
- left: Te.startX,
3056
- top: Te.startY,
3057
- width: Te.width,
3058
- height: Te.height,
3059
- zIndex: this._drawingManagerService.getDrawingOrder(A, T).length - 1
3060
- }, ue = new We(rt, st);
3061
- se.addObject(ue, Vt), y.allowTransform !== !1 && se.attachTransformerTo(ue);
3062
- const te = this._ensureMap(A, T), Pe = new ht(), oe = se.getMainViewport(), Le = {
3210
+ }, t), lt = {
3211
+ left: Pe.startX,
3212
+ top: Pe.startY,
3213
+ width: Pe.width,
3214
+ height: Pe.height,
3215
+ zIndex: this._drawingManagerService.getDrawingOrder(y, A).length - 1
3216
+ }, le = new We(ct, lt);
3217
+ ie.addObject(le, Kt), O.allowTransform !== !1 && ie.attachTransformerTo(le);
3218
+ const q = this._ensureMap(y, A), Ue = new wt(), se = ie.getMainViewport(), Xe = {
3063
3219
  top: 0,
3064
3220
  //viewMain.top,
3065
- left: oe.left,
3066
- bottom: oe.bottom,
3067
- right: oe.right
3068
- }, he = {
3069
- dispose: Pe,
3070
- rect: ue,
3221
+ left: se.left,
3222
+ bottom: se.bottom,
3223
+ right: se.right
3224
+ }, ue = {
3225
+ dispose: Ue,
3226
+ rect: le,
3071
3227
  // position$,
3072
- unitId: A,
3073
- subUnitId: T,
3074
- boundsOfViewArea: Le,
3228
+ unitId: y,
3229
+ subUnitId: A,
3230
+ boundsOfViewArea: Xe,
3075
3231
  domAnchor: t,
3076
3232
  scrollDirectionResponse: "HORIZONTAL"
3077
3233
  /* HORIZONTAL */
3078
- }, Ue = me(ue, ie.renderUnit, ce.skeleton, C.worksheet, he), Ae = new Ye(Ue);
3079
- he.position$ = Ae;
3080
- let ge = {
3081
- position$: Ae,
3234
+ }, Ae = ge(le, re.renderUnit, ce.skeleton, R.worksheet, ue), Ne = new He(Ae);
3235
+ ue.position$ = Ne;
3236
+ let he = {
3237
+ position$: Ne,
3082
3238
  id: b,
3083
- componentKey: y.componentKey,
3239
+ componentKey: O.componentKey,
3084
3240
  onPointerDown: () => {
3085
3241
  },
3086
3242
  onPointerMove: () => {
3087
3243
  },
3088
3244
  onPointerUp: () => {
3089
3245
  },
3090
- onWheel: (x) => {
3091
- K.dispatchEvent(new WheelEvent(x.type, x));
3246
+ onWheel: (B) => {
3247
+ z.dispatchEvent(new WheelEvent(B.type, B));
3092
3248
  },
3093
- props: (E = (_ = te.get(b)) == null ? void 0 : _.props) != null ? E : this._getFloatDomProps(b),
3094
- data: le,
3095
- unitId: A
3249
+ props: (E = (_ = q.get(b)) == null ? void 0 : _.props) != null ? E : this._getFloatDomProps(b),
3250
+ data: de,
3251
+ unitId: y
3096
3252
  };
3097
- n.eventPassThrough && (ge = {
3098
- ...ge,
3099
- onPointerDown: (x) => {
3100
- K.dispatchEvent(new PointerEvent(x.type, x));
3253
+ n.eventPassThrough && (he = {
3254
+ ...he,
3255
+ onPointerDown: (B) => {
3256
+ z.dispatchEvent(new PointerEvent(B.type, B));
3101
3257
  },
3102
- onPointerMove: (x) => {
3103
- K.dispatchEvent(new PointerEvent(x.type, x));
3258
+ onPointerMove: (B) => {
3259
+ z.dispatchEvent(new PointerEvent(B.type, B));
3104
3260
  },
3105
- onPointerUp: (x) => {
3106
- K.dispatchEvent(new PointerEvent(x.type, x));
3261
+ onPointerUp: (B) => {
3262
+ z.dispatchEvent(new PointerEvent(B.type, B));
3107
3263
  }
3108
- }), this._canvasFloatDomService.addFloatDom(ge);
3109
- const ot = ue.onTransformChange$.subscribeEvent(() => {
3110
- const x = me(ue, ie.renderUnit, ce.skeleton, C.worksheet, he);
3111
- Ae.next(
3112
- x
3264
+ }), this._canvasFloatDomService.addFloatDom(he);
3265
+ const ut = le.onTransformChange$.subscribeEvent(() => {
3266
+ const B = ge(le, re.renderUnit, ce.skeleton, R.worksheet, ue);
3267
+ Ne.next(
3268
+ B
3113
3269
  );
3114
3270
  });
3115
- this.disposeWithMe(f.subscribe((x) => {
3116
- const Fe = bt({
3271
+ this.disposeWithMe(m.subscribe((B) => {
3272
+ const Ve = Mt({
3117
3273
  rotate: 0,
3118
- startX: x.startX,
3274
+ startX: B.startX,
3119
3275
  startY: 0,
3120
- endX: x.endX,
3121
- endY: x.endY,
3276
+ endX: B.endX,
3277
+ endY: B.endY,
3122
3278
  width: t.width,
3123
3279
  height: t.height,
3124
3280
  absolute: {
3125
3281
  left: p.absolute.left,
3126
3282
  top: p.absolute.top
3127
3283
  }
3128
- }, t), at = Ce({ unitId: A, subUnitId: T, drawingId: b }), j = new We(at, {
3129
- left: Fe.startX,
3284
+ }, t), ht = Ce({ unitId: y, subUnitId: A, drawingId: b }), j = new We(ht, {
3285
+ left: Ve.startX,
3130
3286
  top: 0,
3131
3287
  width: t.width,
3132
3288
  height: t.height,
3133
- zIndex: this._drawingManagerService.getDrawingOrder(A, T).length - 1
3134
- }), ct = me(j, ie.renderUnit, ce.skeleton, C.worksheet, he);
3135
- Ae.next(ct);
3289
+ zIndex: this._drawingManagerService.getDrawingOrder(y, A).length - 1
3290
+ }), gt = ge(j, re.renderUnit, ce.skeleton, R.worksheet, ue);
3291
+ Ne.next(gt);
3136
3292
  }));
3137
- const fe = (M = this._renderManagerService.getRenderById(A)) == null ? void 0 : M.with(H);
3138
- fe == null || fe.currentSkeleton$.subscribe((x) => {
3139
- x && a.sheetId !== x.sheetId && this._removeDom(m, !0);
3140
- }), Pe.add(() => {
3293
+ const fe = (M = this._renderManagerService.getRenderById(y)) == null ? void 0 : M.with(G);
3294
+ fe == null || fe.currentSkeleton$.subscribe((B) => {
3295
+ B && c.sheetId !== B.sheetId && this._removeDom(f, !0);
3296
+ }), Ue.add(() => {
3141
3297
  this._canvasFloatDomService.removeFloatDom(b);
3142
- }), ot && Pe.add(ot), this._domLayerInfoMap.set(b, he), te.set(b, {
3143
- ...te.get(b)
3298
+ }), ut && Ue.add(ut), this._domLayerInfoMap.set(b, ue), q.set(b, {
3299
+ ...q.get(b)
3144
3300
  });
3145
3301
  }
3146
3302
  return {
3147
- id: m,
3303
+ id: f,
3148
3304
  dispose: () => {
3149
- this._removeDom(m, !0);
3305
+ this._removeDom(f, !0);
3150
3306
  }
3151
3307
  };
3152
3308
  }
@@ -3162,69 +3318,69 @@ let Nt = class extends ae {
3162
3318
  */
3163
3319
  _createRangePositionObserver(e, n, t) {
3164
3320
  let { startRow: r, startColumn: s } = e;
3165
- const o = Ve(r, s, t), c = new Ye(o), d = Ve(e.endRow, e.endColumn, t), g = new Ye(d), a = () => {
3166
- const f = Ve(r, s, t), w = Ve(e.endRow, e.endColumn, t);
3167
- c.next(f), g.next(w);
3168
- }, l = new ht();
3169
- l.add(n.engine.clientRect$.subscribe(() => a())), l.add(this._commandService.onCommandExecuted((f) => {
3170
- if (f.id === Ln.id && f.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
3171
- a();
3321
+ const o = Ze(r, s, t), d = new He(o), a = Ze(e.endRow, e.endColumn, t), g = new He(a), c = () => {
3322
+ const m = Ze(r, s, t), w = Ze(e.endRow, e.endColumn, t);
3323
+ d.next(m), g.next(w);
3324
+ }, l = new wt();
3325
+ l.add(n.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((m) => {
3326
+ if (m.id === Yn.id && m.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
3327
+ c();
3172
3328
  return;
3173
3329
  }
3174
- (Ki.indexOf(f.id) > -1 || f.id === bi.id || f.id === bn.id) && a();
3330
+ (es.indexOf(m.id) > -1 || m.id === yi.id || m.id === Dn.id) && c();
3175
3331
  }));
3176
- const h = (f, w) => {
3177
- r = f, s = w, a();
3332
+ const h = (m, w) => {
3333
+ r = m, s = w, c();
3178
3334
  }, u = () => ({
3179
3335
  rotate: 0,
3180
- width: d.right - o.left,
3181
- height: d.bottom - o.top,
3336
+ width: a.right - o.left,
3337
+ height: a.bottom - o.top,
3182
3338
  absolute: {
3183
3339
  left: !0,
3184
3340
  top: !0
3185
3341
  },
3186
3342
  startX: o.left,
3187
3343
  startY: o.top,
3188
- endX: d.right,
3189
- endY: d.bottom
3190
- }), m = c.pipe(
3191
- He((f) => {
3192
- const w = Ve(e.endRow, e.endColumn, t);
3344
+ endX: a.right,
3345
+ endY: a.bottom
3346
+ }), f = d.pipe(
3347
+ qe((m) => {
3348
+ const w = Ze(e.endRow, e.endColumn, t);
3193
3349
  return {
3194
3350
  rotate: 0,
3195
- width: w.right - f.left,
3196
- height: w.bottom - f.top,
3351
+ width: w.right - m.left,
3352
+ height: w.bottom - m.top,
3197
3353
  absolute: {
3198
3354
  left: !0,
3199
3355
  top: !0
3200
3356
  },
3201
- startX: f.left,
3202
- startY: f.top,
3357
+ startX: m.left,
3358
+ startY: m.top,
3203
3359
  endX: w.right,
3204
3360
  endY: w.bottom
3205
3361
  };
3206
3362
  })
3207
3363
  ), p = u();
3208
3364
  return {
3209
- position$: m,
3365
+ position$: f,
3210
3366
  position: p,
3211
3367
  updateRowCol: h,
3212
- topLeftPos$: c,
3368
+ topLeftPos$: d,
3213
3369
  rightBottomPos$: g,
3214
3370
  disposable: l
3215
3371
  };
3216
3372
  }
3217
3373
  };
3218
- Nt = yo([
3219
- De(0, N(Q)),
3220
- De(1, ke),
3221
- De(2, N(X)),
3222
- De(3, de),
3223
- De(4, N(Ai)),
3224
- De(5, ee),
3225
- De(6, N(zr))
3226
- ], Nt);
3227
- function Ve(i, e, n) {
3374
+ Wt = jo([
3375
+ Me(0, N(Z)),
3376
+ Me(1, Ye),
3377
+ Me(2, N(F)),
3378
+ Me(3, te),
3379
+ Me(4, N(xi)),
3380
+ Me(5, ne),
3381
+ Me(6, N(Zr))
3382
+ ], Wt);
3383
+ function Ze(i, e, n) {
3228
3384
  const t = n.getCellWithCoordByIndex(i, e), r = t.isMergedMainCell ? t.mergeInfo : t;
3229
3385
  return {
3230
3386
  left: r.startX,
@@ -3233,27 +3389,27 @@ function Ve(i, e, n) {
3233
3389
  bottom: r.endY
3234
3390
  };
3235
3391
  }
3236
- function bt(i, e, n) {
3237
- var g, a;
3392
+ function Mt(i, e, n) {
3393
+ var g, c;
3238
3394
  n = n != null ? n : 1;
3239
- const t = i.endX - i.startX, r = i.endY - i.startY, s = (g = e == null ? void 0 : e.width) != null ? g : t, o = (a = e == null ? void 0 : e.height) != null ? a : r;
3240
- let c = 0, d = 0;
3395
+ const t = i.endX - i.startX, r = i.endY - i.startY, s = (g = e == null ? void 0 : e.width) != null ? g : t, o = (c = e == null ? void 0 : e.height) != null ? c : r;
3396
+ let d = 0, a = 0;
3241
3397
  if (e) {
3242
3398
  if (e.horizonOffsetAlign === "right") {
3243
- const l = Rt(e.marginX, t * n);
3244
- c = i.endX - l - s;
3399
+ const l = yt(e.marginX, t * n);
3400
+ d = i.endX - l - s;
3245
3401
  } else
3246
- c = i.startX + Rt(e.marginX, t);
3402
+ d = i.startX + yt(e.marginX, t);
3247
3403
  if (e.verticalOffsetAlign === "bottom") {
3248
- const l = Rt(e.marginY, r * n);
3249
- d = i.endY - l - o;
3404
+ const l = yt(e.marginY, r * n);
3405
+ a = i.endY - l - o;
3250
3406
  } else
3251
- d = i.startY + Rt(e.marginY, r);
3407
+ a = i.startY + yt(e.marginY, r);
3252
3408
  }
3253
3409
  return {
3254
3410
  rotate: 0,
3255
- startX: c,
3256
- startY: d,
3411
+ startX: d,
3412
+ startY: a,
3257
3413
  endX: i.endX,
3258
3414
  endY: i.endY,
3259
3415
  width: s,
@@ -3264,93 +3420,93 @@ function bt(i, e, n) {
3264
3420
  }
3265
3421
  };
3266
3422
  }
3267
- function Rt(i, e) {
3423
+ function yt(i, e) {
3268
3424
  if (i === void 0) return 0;
3269
3425
  if (typeof i == "number") return i;
3270
3426
  const n = Number.parseFloat(i);
3271
3427
  return e * n / 100;
3272
3428
  }
3273
- var Cr = Object.defineProperty, Eo = Object.getOwnPropertyDescriptor, To = (i, e, n) => e in i ? Cr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, Po = (i, e, n, t) => {
3274
- for (var r = t > 1 ? void 0 : t ? Eo(e, n) : e, s = i.length - 1, o; s >= 0; s--)
3429
+ var Dr = Object.defineProperty, Wo = Object.getOwnPropertyDescriptor, xo = (i, e, n) => e in i ? Dr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, $o = (i, e, n, t) => {
3430
+ for (var r = t > 1 ? void 0 : t ? Wo(e, n) : e, s = i.length - 1, o; s >= 0; s--)
3275
3431
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
3276
- return t && r && Cr(e, n, r), r;
3277
- }, qt = (i, e) => (n, t) => e(n, t, i), br = (i, e, n) => To(i, typeof e != "symbol" ? e + "" : e, n);
3278
- const Uo = "SHEET_IMAGE_UI_PLUGIN";
3279
- let jt = class extends qr {
3280
- constructor(i = yn, e, n, t) {
3432
+ return t && r && Dr(e, n, r), r;
3433
+ }, en = (i, e) => (n, t) => e(n, t, i), Mr = (i, e, n) => xo(i, typeof e != "symbol" ? e + "" : e, n);
3434
+ const ko = "SHEET_IMAGE_UI_PLUGIN";
3435
+ let xt = class extends ti {
3436
+ constructor(i = Tn, e, n, t) {
3281
3437
  super(), this._config = i, this._injector = e, this._renderManagerService = n, this._configService = t;
3282
- const { menu: r, ...s } = Qr(
3438
+ const { menu: r, ...s } = ni(
3283
3439
  {},
3284
- yn,
3440
+ Tn,
3285
3441
  this._config
3286
3442
  );
3287
- r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(es, s);
3443
+ r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(ss, s);
3288
3444
  }
3289
3445
  onStarting() {
3290
- ei(this._injector, [
3446
+ ri(this._injector, [
3447
+ [Wt],
3448
+ [Bt],
3449
+ [Tt],
3450
+ [jt],
3291
3451
  [Nt],
3292
3452
  [At],
3293
- [Mt],
3294
- [Ut],
3295
- [Pt],
3296
- [Tt],
3297
- [yt],
3298
3453
  [Et],
3299
- [Ot]
3300
- ]), Xt(this._injector, [
3301
- [Nt]
3454
+ [Ut],
3455
+ [Pt]
3456
+ ]), zt(this._injector, [
3457
+ [Wt]
3302
3458
  ]);
3303
3459
  }
3304
3460
  onReady() {
3305
- Xt(this._injector, [
3306
- [Tt]
3461
+ zt(this._injector, [
3462
+ [At]
3307
3463
  ]);
3308
3464
  }
3309
3465
  onRendered() {
3310
- this._registerRenderModules(), Xt(this._injector, [
3311
- [Pt],
3312
- [Ut],
3313
- [At],
3314
- [yt],
3466
+ this._registerRenderModules(), zt(this._injector, [
3467
+ [Nt],
3468
+ [jt],
3469
+ [Bt],
3315
3470
  [Et],
3316
- [Ot]
3471
+ [Ut],
3472
+ [Pt]
3317
3473
  ]);
3318
3474
  }
3319
3475
  onSteady() {
3320
- this._injector.get(Mt);
3476
+ this._injector.get(Tt);
3321
3477
  }
3322
3478
  _registerRenderModules() {
3323
3479
  [
3324
- [ze],
3325
- [on],
3326
- [rn]
3480
+ [Qe],
3481
+ [cn],
3482
+ [on]
3327
3483
  ].forEach((i) => {
3328
- this.disposeWithMe(this._renderManagerService.registerRenderModule(G.UNIVER_SHEET, i));
3484
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(V.UNIVER_SHEET, i));
3329
3485
  });
3330
3486
  }
3331
3487
  };
3332
- br(jt, "type", G.UNIVER_SHEET);
3333
- br(jt, "pluginName", Uo);
3334
- jt = Po([
3335
- Zr(ii, ri, li, gi),
3336
- qt(1, N(Ke)),
3337
- qt(2, Q),
3338
- qt(3, ti)
3339
- ], jt);
3488
+ Mr(xt, "type", V.UNIVER_SHEET);
3489
+ Mr(xt, "pluginName", ko);
3490
+ xt = $o([
3491
+ ei(ci, oi, fi, wi),
3492
+ en(1, N(et)),
3493
+ en(2, Z),
3494
+ en(3, ii)
3495
+ ], xt);
3340
3496
  export {
3341
3497
  k as ClearSheetDrawingTransformerOperation,
3342
- _r as DeleteDrawingsCommand,
3343
- lr as EditSheetDrawingOperation,
3344
- ur as GroupSheetDrawingCommand,
3345
- dn as InsertFloatImageCommand,
3346
- kt as InsertSheetDrawingCommand,
3347
- Ze as MoveDrawingsCommand,
3348
- $t as RemoveSheetDrawingCommand,
3349
- Sr as SHEETS_IMAGE_MENU_ID,
3350
- hr as SetDrawingArrangeCommand,
3351
- Lt as SetSheetDrawingCommand,
3352
- Nt as SheetCanvasFloatDomManagerService,
3353
- dr as SidebarSheetDrawingOperation,
3354
- gr as UngroupSheetDrawingCommand,
3355
- jt as UniverSheetsDrawingUIPlugin
3498
+ Ir as DeleteDrawingsCommand,
3499
+ hr as EditSheetDrawingOperation,
3500
+ gr as GroupSheetDrawingCommand,
3501
+ Gt as InsertFloatImageCommand,
3502
+ Ft as InsertSheetDrawingCommand,
3503
+ nt as MoveDrawingsCommand,
3504
+ tt as RemoveSheetDrawingCommand,
3505
+ br as SHEETS_IMAGE_MENU_ID,
3506
+ fr as SetDrawingArrangeCommand,
3507
+ Yt as SetSheetDrawingCommand,
3508
+ Wt as SheetCanvasFloatDomManagerService,
3509
+ ur as SidebarSheetDrawingOperation,
3510
+ mr as UngroupSheetDrawingCommand,
3511
+ xt as UniverSheetsDrawingUIPlugin
3356
3512
  };