@univerjs/sheets-drawing-ui 0.3.0-alpha.0 → 0.3.0-nightly.202410101606

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,2501 +1 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
3
- var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
4
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
5
- import { CommandType, ICommandService, IUndoRedoService, LocaleService, IUniverInstanceService, useDependency, OnLifecycle, LifecycleStages, Inject, Injector, RxDisposable, UniverInstanceType, connectInjector, toDisposable, FOCUSING_COMMON_DRAWINGS, IContextService, Disposable, Direction, FOCUSING_FX_BAR_EDITOR, EDITOR_ACTIVATED, Rectangle, DrawingTypeEnum as DrawingTypeEnum$1, DisposableCollection, generateRandomId, Tools, UserManagerService, IPermissionService, LifecycleService, DependentOn, Plugin, IConfigService } from "@univerjs/core";
6
- import { ImageCropperObject, COMPONENT_IMAGE_POPUP_MENU, OpenImageCropOperation, ImageResetSizeOperation, DrawingCommonPanel, DrawingRenderService, UniverDrawingUIPlugin } from "@univerjs/drawing-ui";
7
- import { ISheetDrawingService, SetDrawingApplyMutation, DrawingApplyType, SheetDrawingAnchorType, UniverSheetsDrawingPlugin } from "@univerjs/sheets-drawing";
8
- import { IDrawingManagerService, IImageIoService, DrawingTypeEnum, ArrangeTypeEnum, DRAWING_IMAGE_ALLOW_IMAGE_LIST, DRAWING_IMAGE_COUNT_LIMIT, ImageUploadStatusType, DRAWING_IMAGE_ALLOW_SIZE, getImageSize, DRAWING_IMAGE_WIDTH_LIMIT, DRAWING_IMAGE_HEIGHT_LIMIT, getDrawingShapeKeyByDrawingSearch, UniverDrawingPlugin } from "@univerjs/drawing";
9
- import { IRenderManagerService, precisionTo, getGroupState, transformObjectOutOfGroup, Rect, DRAWING_OBJECT_LAYER_INDEX, SHEET_VIEWPORT_KEY, RENDER_CLASS_TYPE } from "@univerjs/engine-render";
10
- import { SheetCanvasPopManagerService, attachRangeWithCoord, SheetSkeletonManagerService, ISheetSelectionRenderService, getCurrentRangeDisable$, SetScrollOperation, SetZoomRatioOperation, SheetPrintInterceptorService, COPY_TYPE, PREDEFINED_HOOK_NAME, virtualizeDiscreteRanges, ISheetClipboardService } from "@univerjs/sheets-ui";
11
- import { ISidebarService, IUIPartsService, BuiltInUIPart, ILocalFileService, IMessageService, MenuItemType, getMenuHiddenObservable, KeyCode, RibbonStartGroup, ComponentManager, IMenuManagerService, IShortcutService, CanvasFloatDomService } from "@univerjs/ui";
12
- import { takeUntil, Subject, BehaviorSubject, combineLatest, map, filter, distinctUntilChanged } from "rxjs";
13
- import { getSheetCommandTarget, SheetsSelectionsService, WorkbookEditablePermission, WorksheetEditPermission, RangeProtectionPermissionEditPoint, InsertRowCommand, InsertColCommand, RemoveRowCommand, RemoveColCommand, DeleteRangeMoveLeftCommand, DeleteRangeMoveUpCommand, InsertRangeMoveDownCommand, InsertRangeMoveRightCommand, DeltaRowHeightCommand, SetRowHeightCommand, DeltaColumnWidthCommand, SetColWidthCommand, SetRowHiddenCommand, SetSpecificRowsVisibleCommand, SetSpecificColsVisibleCommand, SetColHiddenCommand, MoveColsCommand, MoveRowsCommand, MoveRangeCommand, SetRowVisibleMutation, SetRowHiddenMutation, SetColVisibleMutation, SetColHiddenMutation, SetWorksheetRowHeightMutation, SetWorksheetColWidthMutation, SheetInterceptorService, SetWorksheetActiveOperation, SetFrozenMutation, WorkbookViewPermission, WorksheetViewPermission } from "@univerjs/sheets";
14
- import React, { useEffect, forwardRef, useRef, createElement, useState } from "react";
15
- import { MessageType, RadioGroup, Radio } from "@univerjs/design";
16
- import clsx from "clsx";
17
- const ClearSheetDrawingTransformerOperation = {
18
- id: "sheet.operation.clear-drawing-transformer",
19
- type: CommandType.MUTATION,
20
- handler: /* @__PURE__ */ __name((accessor, params) => {
21
- const renderManagerService = accessor.get(IRenderManagerService);
22
- return params.forEach((unitId) => {
23
- var _a11, _b;
24
- (_b = (_a11 = renderManagerService.getRenderById(unitId)) == null ? void 0 : _a11.scene.getTransformer()) == null || _b.debounceRefreshControls();
25
- }), !0;
26
- }, "handler")
27
- }, RemoveSheetDrawingCommand = {
28
- id: "sheet.command.remove-sheet-image",
29
- type: CommandType.COMMAND,
30
- handler: /* @__PURE__ */ __name((accessor, params) => {
31
- const commandService = accessor.get(ICommandService), undoRedoService = accessor.get(IUndoRedoService), sheetDrawingService = accessor.get(ISheetDrawingService);
32
- if (!params) return !1;
33
- const { drawings } = params, unitIds = [];
34
- drawings.forEach((param) => {
35
- const { unitId: unitId2 } = param;
36
- unitIds.push(unitId2);
37
- });
38
- const jsonOp = sheetDrawingService.getBatchRemoveOp(drawings), { unitId, subUnitId, undo, redo, objects } = jsonOp;
39
- return commandService.syncExecuteCommand(SetDrawingApplyMutation.id, { unitId, subUnitId, op: redo, objects, type: DrawingApplyType.REMOVE }) ? (undoRedoService.pushUndoRedo({
40
- unitID: unitId,
41
- undoMutations: [
42
- { id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: undo, objects, type: DrawingApplyType.INSERT } },
43
- { id: ClearSheetDrawingTransformerOperation.id, params: unitIds }
44
- ],
45
- redoMutations: [
46
- { id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: redo, objects, type: DrawingApplyType.REMOVE } },
47
- { id: ClearSheetDrawingTransformerOperation.id, params: unitIds }
48
- ]
49
- }), !0) : !1;
50
- }, "handler")
51
- }, COMPONENT_SHEET_DRAWING_PANEL = "COMPONENT_SHEET_DRAWING_PANEL", SidebarSheetDrawingOperation = {
52
- id: "sidebar.operation.sheet-image",
53
- type: CommandType.COMMAND,
54
- handler: /* @__PURE__ */ __name(async (accessor, params) => {
55
- const sidebarService = accessor.get(ISidebarService), localeService = accessor.get(LocaleService), univerInstanceService = accessor.get(IUniverInstanceService), drawingManagerService = accessor.get(IDrawingManagerService);
56
- if (!getSheetCommandTarget(univerInstanceService)) return !1;
57
- switch (params.value) {
58
- case "open":
59
- sidebarService.open({
60
- header: { title: localeService.t("sheetImage.panel.title") },
61
- children: { label: COMPONENT_SHEET_DRAWING_PANEL },
62
- onClose: /* @__PURE__ */ __name(() => {
63
- drawingManagerService.focusDrawing(null);
64
- }, "onClose"),
65
- width: 360
66
- });
67
- break;
68
- case "close":
69
- default:
70
- sidebarService.close();
71
- break;
72
- }
73
- return !0;
74
- }, "handler")
75
- }, EditSheetDrawingOperation = {
76
- id: "sheet.operation.edit-sheet-image",
77
- type: CommandType.OPERATION,
78
- handler: /* @__PURE__ */ __name((accessor, params) => {
79
- const drawingManagerService = accessor.get(IDrawingManagerService), commandService = accessor.get(ICommandService);
80
- return params == null ? !1 : (drawingManagerService.focusDrawing([params]), commandService.executeCommand(SidebarSheetDrawingOperation.id, { value: "open" }), !0);
81
- }, "handler")
82
- }, uploadLoading = "univer-upload-loading", uploadLoadingBody = "univer-upload-loading-body", uploadLoadingBodyAnimation = "univer-upload-loading-body-animation", univerCircleAnimation = "univer-UniverCircleAnimation", uploadLoadingBodyText = "univer-upload-loading-body-text", styles$1 = {
83
- uploadLoading,
84
- uploadLoadingBody,
85
- uploadLoadingBodyAnimation,
86
- univerCircleAnimation,
87
- uploadLoadingBodyText
88
- }, UploadLoading = /* @__PURE__ */ __name(() => {
89
- const imageIoService = useDependency(IImageIoService), localeService = useDependency(LocaleService), [remain, setRemain] = React.useState(0);
90
- return useEffect(() => {
91
- const sub = imageIoService.change$.subscribe((count) => {
92
- setRemain(count);
93
- });
94
- return () => {
95
- sub.unsubscribe();
96
- };
97
- }, [imageIoService]), /* @__PURE__ */ React.createElement("div", { style: { display: remain > 0 ? "block" : "none" }, className: styles$1.uploadLoading }, /* @__PURE__ */ React.createElement("div", { className: styles$1.uploadLoadingBody }, /* @__PURE__ */ React.createElement("div", { className: styles$1.uploadLoadingBodyAnimation }), /* @__PURE__ */ React.createElement("div", { className: styles$1.uploadLoadingBodyText }, `${localeService.t("uploadLoading.loading")}: ${remain}`)));
98
- }, "UploadLoading");
99
- var __defProp$9 = Object.defineProperty, __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor, __decorateClass$9 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
100
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
101
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
102
- return kind && result && __defProp$9(target, key, result), result;
103
- }, "__decorateClass$9"), __decorateParam$9 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$9"), _a;
104
- let DrawingPopupMenuController = (_a = class extends RxDisposable {
105
- constructor(_injector, _drawingManagerService, _canvasPopManagerService, _renderManagerService, _univerInstanceService, _contextService, _uiPartsService) {
106
- super();
107
- __publicField(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
108
- this._injector = _injector, this._drawingManagerService = _drawingManagerService, this._canvasPopManagerService = _canvasPopManagerService, this._renderManagerService = _renderManagerService, this._univerInstanceService = _univerInstanceService, this._contextService = _contextService, this._uiPartsService = _uiPartsService, this._init();
109
- }
110
- _init() {
111
- this._univerInstanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SHEET).pipe(takeUntil(this.dispose$)).subscribe((workbook) => this._create(workbook)), this._univerInstanceService.getTypeOfUnitDisposed$(UniverInstanceType.UNIVER_SHEET).pipe(takeUntil(this.dispose$)).subscribe((workbook) => this._dispose(workbook)), this._univerInstanceService.getAllUnitsForType(UniverInstanceType.UNIVER_SHEET).forEach((workbook) => this._create(workbook)), this._uiPartsService.registerComponent(BuiltInUIPart.CONTENT, () => connectInjector(UploadLoading, this._injector));
112
- }
113
- _dispose(workbook) {
114
- const unitId = workbook.getUnitId();
115
- this._renderManagerService.removeRender(unitId);
116
- }
117
- _create(workbook) {
118
- if (!workbook)
119
- return;
120
- const unitId = workbook.getUnitId();
121
- this._renderManagerService.has(unitId) && !this._initImagePopupMenu.has(unitId) && (this._popupMenuListener(unitId), this._initImagePopupMenu.add(unitId));
122
- }
123
- _hasCropObject(scene) {
124
- const objects = scene.getAllObjectsByOrder();
125
- for (const object of objects)
126
- if (object instanceof ImageCropperObject)
127
- return !0;
128
- return !1;
129
- }
130
- _popupMenuListener(unitId) {
131
- var _a11;
132
- const scene = (_a11 = this._renderManagerService.getRenderById(unitId)) == null ? void 0 : _a11.scene;
133
- if (!scene)
134
- return;
135
- const transformer = scene.getTransformerByCreate();
136
- if (!transformer)
137
- return;
138
- let singletonPopupDisposer;
139
- this.disposeWithMe(
140
- toDisposable(
141
- transformer.createControl$.subscribe(() => {
142
- if (this._contextService.setContextValue(FOCUSING_COMMON_DRAWINGS, !0), this._hasCropObject(scene))
143
- return;
144
- const selectedObjects = transformer.getSelectedObjectMap();
145
- if (selectedObjects.size > 1) {
146
- singletonPopupDisposer == null || singletonPopupDisposer.dispose();
147
- return;
148
- }
149
- const object = selectedObjects.values().next().value;
150
- if (!object)
151
- return;
152
- const oKey = object.oKey, drawingParam = this._drawingManagerService.getDrawingOKey(oKey);
153
- if (!drawingParam)
154
- return;
155
- const { unitId: unitId2, subUnitId, drawingId, drawingType } = drawingParam;
156
- singletonPopupDisposer == null || singletonPopupDisposer.dispose(), singletonPopupDisposer = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(object, {
157
- componentKey: COMPONENT_IMAGE_POPUP_MENU,
158
- direction: "horizontal",
159
- offset: [2, 0],
160
- extraProps: {
161
- menuItems: this._getImageMenuItems(unitId2, subUnitId, drawingId, drawingType)
162
- }
163
- })), this._drawingManagerService.focusDrawing([{
164
- unitId: unitId2,
165
- subUnitId,
166
- drawingId
167
- }]);
168
- })
169
- )
170
- ), this.disposeWithMe(
171
- transformer.clearControl$.subscribe(() => {
172
- singletonPopupDisposer == null || singletonPopupDisposer.dispose(), this._contextService.setContextValue(FOCUSING_COMMON_DRAWINGS, !1), this._drawingManagerService.focusDrawing(null);
173
- })
174
- ), this.disposeWithMe(
175
- transformer.changing$.subscribe(() => {
176
- singletonPopupDisposer == null || singletonPopupDisposer.dispose();
177
- })
178
- );
179
- }
180
- _getImageMenuItems(unitId, subUnitId, drawingId, drawingType) {
181
- return [
182
- {
183
- label: "image-popup.edit",
184
- index: 0,
185
- commandId: EditSheetDrawingOperation.id,
186
- commandParams: { unitId, subUnitId, drawingId },
187
- disable: drawingType === DrawingTypeEnum.DRAWING_DOM
188
- },
189
- {
190
- label: "image-popup.delete",
191
- index: 1,
192
- commandId: RemoveSheetDrawingCommand.id,
193
- commandParams: { unitId, drawings: [{ unitId, subUnitId, drawingId }] },
194
- disable: !1
195
- },
196
- {
197
- label: "image-popup.crop",
198
- index: 2,
199
- commandId: OpenImageCropOperation.id,
200
- commandParams: { unitId, subUnitId, drawingId },
201
- disable: drawingType === DrawingTypeEnum.DRAWING_DOM
202
- },
203
- {
204
- label: "image-popup.reset",
205
- index: 3,
206
- commandId: ImageResetSizeOperation.id,
207
- commandParams: [{ unitId, subUnitId, drawingId }],
208
- disable: drawingType === DrawingTypeEnum.DRAWING_DOM
209
- }
210
- ];
211
- }
212
- }, __name(_a, "DrawingPopupMenuController"), _a);
213
- DrawingPopupMenuController = __decorateClass$9([
214
- OnLifecycle(LifecycleStages.Steady, DrawingPopupMenuController),
215
- __decorateParam$9(0, Inject(Injector)),
216
- __decorateParam$9(1, IDrawingManagerService),
217
- __decorateParam$9(2, Inject(SheetCanvasPopManagerService)),
218
- __decorateParam$9(3, IRenderManagerService),
219
- __decorateParam$9(4, IUniverInstanceService),
220
- __decorateParam$9(5, IContextService),
221
- __decorateParam$9(6, Inject(IUIPartsService))
222
- ], DrawingPopupMenuController);
223
- function drawingPositionToTransform(position, selectionRenderService, sheetSkeletonManagerService) {
224
- const { from, to, flipY = !1, flipX = !1, angle = 0, skewX = 0, skewY = 0 } = position, { column: fromColumn, columnOffset: fromColumnOffset, row: fromRow, rowOffset: fromRowOffset } = from, { column: toColumn, columnOffset: toColumnOffset, row: toRow, rowOffset: toRowOffset } = to, skeleton = sheetSkeletonManagerService.getCurrentSkeleton(), startSelectionCell = attachRangeWithCoord(skeleton, {
225
- startColumn: fromColumn,
226
- endColumn: fromColumn,
227
- startRow: fromRow,
228
- endRow: fromRow
229
- });
230
- if (startSelectionCell == null)
231
- return;
232
- const endSelectionCell = attachRangeWithCoord(skeleton, {
233
- startColumn: toColumn,
234
- endColumn: toColumn,
235
- startRow: toRow,
236
- endRow: toRow
237
- });
238
- if (endSelectionCell == null)
239
- return;
240
- const { startX: startSelectionX, startY: startSelectionY } = startSelectionCell, { startX: endSelectionX, startY: endSelectionY } = endSelectionCell;
241
- let left = precisionTo(startSelectionX + fromColumnOffset, 1), top = precisionTo(startSelectionY + fromRowOffset, 1), width = precisionTo(endSelectionX + toColumnOffset - left, 1), height = precisionTo(endSelectionY + toRowOffset - top, 1);
242
- startSelectionCell.startX === endSelectionCell.endX && (width = 0), startSelectionCell.startY === endSelectionCell.endY && (height = 0);
243
- const sheetWidth = skeleton.rowHeaderWidth + skeleton.columnTotalWidth, sheetHeight = skeleton.columnHeaderHeight + skeleton.rowTotalHeight;
244
- return left + width > sheetWidth && (left = sheetWidth - width), top + height > sheetHeight && (top = sheetHeight - height), {
245
- flipY,
246
- flipX,
247
- angle,
248
- skewX,
249
- skewY,
250
- left,
251
- top,
252
- width,
253
- height
254
- };
255
- }
256
- __name(drawingPositionToTransform, "drawingPositionToTransform");
257
- function transformToDrawingPosition(transform, selectionRenderService) {
258
- const { left = 0, top = 0, width = 0, height = 0, flipY = !1, flipX = !1, angle = 0, skewX = 0, skewY = 0 } = transform, startSelectionCell = selectionRenderService.getSelectionCellByPosition(left, top);
259
- if (startSelectionCell == null)
260
- return;
261
- const from = {
262
- column: startSelectionCell.actualColumn,
263
- columnOffset: precisionTo(left - startSelectionCell.startX, 1),
264
- row: startSelectionCell.actualRow,
265
- rowOffset: precisionTo(top - startSelectionCell.startY, 1)
266
- }, endSelectionCell = selectionRenderService.getSelectionCellByPosition(left + width, top + height);
267
- if (endSelectionCell == null)
268
- return;
269
- const to = {
270
- column: endSelectionCell.actualColumn,
271
- columnOffset: precisionTo(left + width - endSelectionCell.startX, 1),
272
- row: endSelectionCell.actualRow,
273
- rowOffset: precisionTo(top + height - endSelectionCell.startY, 1)
274
- };
275
- return {
276
- flipY,
277
- flipX,
278
- angle,
279
- skewX,
280
- skewY,
281
- from,
282
- to
283
- };
284
- }
285
- __name(transformToDrawingPosition, "transformToDrawingPosition");
286
- function ungroupToGroup(ungroupParams) {
287
- const newGroupParams = [];
288
- return ungroupParams.forEach((ungroupParam) => {
289
- const { parent, children } = ungroupParam, { unitId, subUnitId, drawingId: groupId } = parent, groupTransform = getGroupState(0, 0, children.map((o) => o.transform || {})), newChildren = children.map((drawing) => {
290
- const transform = drawing.transform || { left: 0, top: 0 }, { unitId: unitId2, subUnitId: subUnitId2, drawingId } = drawing;
291
- return {
292
- unitId: unitId2,
293
- subUnitId: subUnitId2,
294
- drawingId,
295
- transform: {
296
- ...transform,
297
- left: transform.left - groupTransform.left,
298
- top: transform.top - groupTransform.top
299
- },
300
- groupId
301
- };
302
- }), groupParam = {
303
- unitId,
304
- subUnitId,
305
- drawingId: groupId,
306
- drawingType: DrawingTypeEnum.DRAWING_GROUP,
307
- transform: groupTransform
308
- };
309
- newGroupParams.push({
310
- parent: groupParam,
311
- children: newChildren
312
- });
313
- }), newGroupParams;
314
- }
315
- __name(ungroupToGroup, "ungroupToGroup");
316
- function groupToUngroup(groupParams) {
317
- const newGroupParams = [];
318
- return groupParams.forEach((groupParam) => {
319
- const { parent, children } = groupParam, { unitId, subUnitId, drawingId: groupId, transform: groupTransform = { width: 0, height: 0 } } = parent;
320
- if (groupTransform == null)
321
- return;
322
- const newChildren = children.map((object) => {
323
- const { transform } = object, { unitId: unitId2, subUnitId: subUnitId2, drawingId } = object, newTransform = transformObjectOutOfGroup(transform || {}, groupTransform, groupTransform.width || 0, groupTransform.height || 0);
324
- return {
325
- unitId: unitId2,
326
- subUnitId: subUnitId2,
327
- drawingId,
328
- transform: newTransform,
329
- groupId: void 0
330
- };
331
- }), ungroupParam = {
332
- unitId,
333
- subUnitId,
334
- drawingId: groupId,
335
- drawingType: DrawingTypeEnum.DRAWING_GROUP,
336
- transform: {
337
- left: 0,
338
- top: 0
339
- }
340
- };
341
- newGroupParams.push({
342
- parent: ungroupParam,
343
- children: newChildren
344
- });
345
- }), newGroupParams;
346
- }
347
- __name(groupToUngroup, "groupToUngroup");
348
- const GroupSheetDrawingCommand = {
349
- id: "sheet.command.group-sheet-image",
350
- type: CommandType.COMMAND,
351
- handler: /* @__PURE__ */ __name((accessor, params) => {
352
- const commandService = accessor.get(ICommandService), undoRedoService = accessor.get(IUndoRedoService), sheetDrawingService = accessor.get(ISheetDrawingService);
353
- if (!params) return !1;
354
- const unitIds = [];
355
- params.forEach(({ parent, children }) => {
356
- unitIds.push(parent.unitId), children.forEach((child) => {
357
- unitIds.push(child.unitId);
358
- });
359
- });
360
- const jsonOp = sheetDrawingService.getGroupDrawingOp(params), { unitId, subUnitId, undo, redo, objects } = jsonOp;
361
- return commandService.syncExecuteCommand(SetDrawingApplyMutation.id, { op: redo, unitId, subUnitId, objects, type: DrawingApplyType.GROUP }) ? (undoRedoService.pushUndoRedo({
362
- unitID: unitId,
363
- undoMutations: [
364
- { id: SetDrawingApplyMutation.id, params: { op: undo, unitId, subUnitId, objects: groupToUngroup(objects), type: DrawingApplyType.UNGROUP } },
365
- { id: ClearSheetDrawingTransformerOperation.id, params: unitIds }
366
- ],
367
- redoMutations: [
368
- { id: SetDrawingApplyMutation.id, params: { op: redo, unitId, subUnitId, objects, type: DrawingApplyType.GROUP } },
369
- { id: ClearSheetDrawingTransformerOperation.id, params: unitIds }
370
- ]
371
- }), !0) : !1;
372
- }, "handler")
373
- }, InsertSheetDrawingCommand = {
374
- id: "sheet.command.insert-sheet-image",
375
- type: CommandType.COMMAND,
376
- handler: /* @__PURE__ */ __name((accessor, params) => {
377
- const commandService = accessor.get(ICommandService), undoRedoService = accessor.get(IUndoRedoService), sheetDrawingService = accessor.get(ISheetDrawingService);
378
- if (!params) return !1;
379
- const drawings = params.drawings, unitIds = drawings.map((param) => param.unitId), jsonOp = sheetDrawingService.getBatchAddOp(drawings), { unitId, subUnitId, undo, redo, objects } = jsonOp;
380
- return commandService.syncExecuteCommand(SetDrawingApplyMutation.id, { op: redo, unitId, subUnitId, objects, type: DrawingApplyType.INSERT }) ? (undoRedoService.pushUndoRedo({
381
- unitID: unitId,
382
- undoMutations: [
383
- { id: SetDrawingApplyMutation.id, params: { op: undo, unitId, subUnitId, objects, type: DrawingApplyType.REMOVE } },
384
- { id: ClearSheetDrawingTransformerOperation.id, params: unitIds }
385
- ],
386
- redoMutations: [
387
- { id: SetDrawingApplyMutation.id, params: { op: redo, unitId, subUnitId, objects, type: DrawingApplyType.INSERT } },
388
- { id: ClearSheetDrawingTransformerOperation.id, params: unitIds }
389
- ]
390
- }), !0) : !1;
391
- }, "handler")
392
- }, SetDrawingArrangeCommand = {
393
- id: "sheet.command.set-drawing-arrange",
394
- type: CommandType.COMMAND,
395
- handler: /* @__PURE__ */ __name((accessor, params) => {
396
- const commandService = accessor.get(ICommandService), undoRedoService = accessor.get(IUndoRedoService);
397
- if (!params) return !1;
398
- const sheetDrawingService = accessor.get(ISheetDrawingService), { unitId, subUnitId, drawingIds, arrangeType } = params, drawingOrderMapParam = { unitId, subUnitId, drawingIds };
399
- let jsonOp;
400
- if (arrangeType === ArrangeTypeEnum.forward ? jsonOp = sheetDrawingService.getForwardDrawingsOp(drawingOrderMapParam) : arrangeType === ArrangeTypeEnum.backward ? jsonOp = sheetDrawingService.getBackwardDrawingOp(drawingOrderMapParam) : arrangeType === ArrangeTypeEnum.front ? jsonOp = sheetDrawingService.getFrontDrawingsOp(drawingOrderMapParam) : arrangeType === ArrangeTypeEnum.back && (jsonOp = sheetDrawingService.getBackDrawingsOp(drawingOrderMapParam)), jsonOp == null)
401
- return !1;
402
- const { objects, redo, undo } = jsonOp;
403
- return commandService.syncExecuteCommand(SetDrawingApplyMutation.id, { op: redo, unitId, subUnitId, objects, type: DrawingApplyType.ARRANGE }) ? (undoRedoService.pushUndoRedo({
404
- unitID: unitId,
405
- undoMutations: [
406
- { id: SetDrawingApplyMutation.id, params: { op: undo, unitId, subUnitId, objects, type: DrawingApplyType.ARRANGE } }
407
- ],
408
- redoMutations: [
409
- { id: SetDrawingApplyMutation.id, params: { op: redo, unitId, subUnitId, objects, type: DrawingApplyType.ARRANGE } }
410
- ]
411
- }), !0) : !1;
412
- }, "handler")
413
- }, SetSheetDrawingCommand = {
414
- id: "sheet.command.set-sheet-image",
415
- type: CommandType.COMMAND,
416
- handler: /* @__PURE__ */ __name((accessor, params) => {
417
- const commandService = accessor.get(ICommandService), undoRedoService = accessor.get(IUndoRedoService), sheetDrawingService = accessor.get(ISheetDrawingService);
418
- if (!params) return !1;
419
- const { drawings } = params, jsonOp = sheetDrawingService.getBatchUpdateOp(drawings), { unitId, subUnitId, undo, redo, objects } = jsonOp;
420
- return commandService.syncExecuteCommand(SetDrawingApplyMutation.id, { unitId, subUnitId, op: redo, objects, type: DrawingApplyType.UPDATE }) ? (undoRedoService.pushUndoRedo({
421
- unitID: unitId,
422
- undoMutations: [
423
- { id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: undo, objects, type: DrawingApplyType.UPDATE } },
424
- { id: ClearSheetDrawingTransformerOperation.id, params: [unitId] }
425
- ],
426
- redoMutations: [
427
- { id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: redo, objects, type: DrawingApplyType.UPDATE } },
428
- { id: ClearSheetDrawingTransformerOperation.id, params: [unitId] }
429
- ]
430
- }), !0) : !1;
431
- }, "handler")
432
- }, UngroupSheetDrawingCommand = {
433
- id: "sheet.command.ungroup-sheet-image",
434
- type: CommandType.COMMAND,
435
- handler: /* @__PURE__ */ __name((accessor, params) => {
436
- const commandService = accessor.get(ICommandService), undoRedoService = accessor.get(IUndoRedoService), sheetDrawingService = accessor.get(ISheetDrawingService);
437
- if (!params) return !1;
438
- const unitIds = [];
439
- params.forEach(({ parent, children }) => {
440
- unitIds.push(parent.unitId), children.forEach((child) => {
441
- unitIds.push(child.unitId);
442
- });
443
- });
444
- const jsonOp = sheetDrawingService.getUngroupDrawingOp(params), { unitId, subUnitId, undo, redo, objects } = jsonOp;
445
- return commandService.syncExecuteCommand(SetDrawingApplyMutation.id, { op: redo, unitId, subUnitId, objects, type: DrawingApplyType.UNGROUP }) ? (undoRedoService.pushUndoRedo({
446
- unitID: unitId,
447
- undoMutations: [
448
- { id: SetDrawingApplyMutation.id, params: { op: undo, unitId, subUnitId, objects: ungroupToGroup(objects), type: DrawingApplyType.GROUP } },
449
- { id: ClearSheetDrawingTransformerOperation.id, params: unitIds }
450
- ],
451
- redoMutations: [
452
- { id: SetDrawingApplyMutation.id, params: { op: redo, unitId, subUnitId, objects, type: DrawingApplyType.UNGROUP } },
453
- { id: ClearSheetDrawingTransformerOperation.id, params: unitIds }
454
- ]
455
- }), !0) : !1;
456
- }, "handler")
457
- };
458
- var __defProp$8 = Object.defineProperty, __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor, __decorateClass$8 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
459
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
460
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
461
- return kind && result && __defProp$8(target, key, result), result;
462
- }, "__decorateClass$8"), __decorateParam$8 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$8"), _a2;
463
- let SheetDrawingUpdateController = (_a2 = class extends Disposable {
464
- constructor(_context, _skeletonManagerService, _commandService, _selectionRenderService, _imageIoService, _fileOpenerService, _sheetDrawingService, _drawingManagerService, _contextService, _messageService, _localeService, selectionManagerService) {
465
- super();
466
- __publicField(this, "_workbookSelections");
467
- this._context = _context, this._skeletonManagerService = _skeletonManagerService, this._commandService = _commandService, this._selectionRenderService = _selectionRenderService, this._imageIoService = _imageIoService, this._fileOpenerService = _fileOpenerService, this._sheetDrawingService = _sheetDrawingService, this._drawingManagerService = _drawingManagerService, this._contextService = _contextService, this._messageService = _messageService, this._localeService = _localeService, this._workbookSelections = selectionManagerService.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
468
- }
469
- async insertFloatImage() {
470
- const files = await this._fileOpenerService.openFile({
471
- multiple: !0,
472
- accept: DRAWING_IMAGE_ALLOW_IMAGE_LIST.map((image) => `.${image.replace("image/", "")}`).join(",")
473
- }), fileLength = files.length;
474
- return fileLength > DRAWING_IMAGE_COUNT_LIMIT ? (this._messageService.show({
475
- type: MessageType.Error,
476
- content: this._localeService.t("update-status.exceedMaxCount", String(DRAWING_IMAGE_COUNT_LIMIT))
477
- }), !1) : fileLength === 0 ? !1 : (files.forEach(async (file) => await this._insertFloatImage(file)), !0);
478
- }
479
- async _insertFloatImage(file) {
480
- let imageParam;
481
- try {
482
- imageParam = await this._imageIoService.saveImage(file);
483
- } catch (error) {
484
- const type = error.message;
485
- type === ImageUploadStatusType.ERROR_EXCEED_SIZE ? this._messageService.show({
486
- type: MessageType.Error,
487
- content: this._localeService.t("update-status.exceedMaxSize", String(DRAWING_IMAGE_ALLOW_SIZE / (1024 * 1024)))
488
- }) : type === ImageUploadStatusType.ERROR_IMAGE_TYPE ? this._messageService.show({
489
- type: MessageType.Error,
490
- content: this._localeService.t("update-status.invalidImageType")
491
- }) : type === ImageUploadStatusType.ERROR_IMAGE && this._messageService.show({
492
- type: MessageType.Error,
493
- content: this._localeService.t("update-status.invalidImage")
494
- });
495
- }
496
- if (imageParam == null)
497
- return;
498
- const info = this._getUnitInfo(), { unitId, subUnitId } = info, { imageId, imageSourceType, source, base64Cache } = imageParam, { width, height, image } = await getImageSize(base64Cache || ""), { width: sceneWidth, height: sceneHeight } = this._context.scene;
499
- this._imageIoService.addImageSourceCache(source, imageSourceType, image);
500
- let scale = 1;
501
- if (width > DRAWING_IMAGE_WIDTH_LIMIT || height > DRAWING_IMAGE_HEIGHT_LIMIT) {
502
- const scaleWidth = DRAWING_IMAGE_WIDTH_LIMIT / width, scaleHeight = DRAWING_IMAGE_HEIGHT_LIMIT / height;
503
- scale = Math.max(scaleWidth, scaleHeight);
504
- }
505
- const sheetTransform = this._getImagePosition(width * scale, height * scale, sceneWidth, sceneHeight);
506
- if (sheetTransform == null)
507
- return;
508
- const sheetDrawingParam = {
509
- unitId,
510
- subUnitId,
511
- drawingId: imageId,
512
- drawingType: DrawingTypeEnum.DRAWING_IMAGE,
513
- imageSourceType,
514
- source,
515
- transform: drawingPositionToTransform(sheetTransform, this._selectionRenderService, this._skeletonManagerService),
516
- sheetTransform
517
- };
518
- this._commandService.executeCommand(InsertSheetDrawingCommand.id, {
519
- unitId,
520
- drawings: [sheetDrawingParam]
521
- });
522
- }
523
- _getUnitInfo() {
524
- const workbook = this._context.unit, worksheet = workbook.getActiveSheet(), unitId = workbook.getUnitId(), subUnitId = worksheet.getSheetId();
525
- return {
526
- unitId,
527
- subUnitId
528
- };
529
- }
530
- _getImagePosition(imageWidth, imageHeight, sceneWidth, sceneHeight) {
531
- const selections = this._workbookSelections.getCurrentSelections();
532
- let range = {
533
- startRow: 0,
534
- endRow: 0,
535
- startColumn: 0,
536
- endColumn: 0
537
- };
538
- selections && selections.length > 0 && (range = selections[selections.length - 1].range);
539
- const rangeWithCoord = attachRangeWithCoord(this._skeletonManagerService.getCurrent().skeleton, range);
540
- if (rangeWithCoord == null)
541
- return;
542
- let { startColumn, startRow, startX, startY } = rangeWithCoord, isChangeStart = !1;
543
- if (startX + imageWidth > sceneWidth && (startX = sceneWidth - imageWidth, startX < 0 && (startX = 0, imageWidth = sceneWidth), isChangeStart = !0), startY + imageHeight > sceneHeight && (startY = sceneHeight - imageHeight, startY < 0 && (startY = 0, imageHeight = sceneHeight), isChangeStart = !0), isChangeStart) {
544
- const newCoord = this._selectionRenderService.getSelectionCellByPosition(startX, startY);
545
- if (newCoord == null)
546
- return;
547
- startX = newCoord.startX, startY = newCoord.startY, startColumn = newCoord.actualColumn, startRow = newCoord.actualRow;
548
- }
549
- const from = {
550
- column: startColumn,
551
- columnOffset: 0,
552
- row: startRow,
553
- rowOffset: 0
554
- }, endSelectionCell = this._selectionRenderService.getSelectionCellByPosition(startX + imageWidth, startY + imageHeight);
555
- if (endSelectionCell == null)
556
- return;
557
- const to = {
558
- column: endSelectionCell.actualColumn,
559
- columnOffset: startX + imageWidth - endSelectionCell.startX,
560
- row: endSelectionCell.actualRow,
561
- rowOffset: startY + imageHeight - endSelectionCell.startY
562
- };
563
- return {
564
- from,
565
- to
566
- };
567
- }
568
- _updateOrderListener() {
569
- this._drawingManagerService.featurePluginOrderUpdate$.subscribe((params) => {
570
- const { unitId, subUnitId, drawingIds, arrangeType } = params;
571
- this._commandService.executeCommand(SetDrawingArrangeCommand.id, {
572
- unitId,
573
- subUnitId,
574
- drawingIds,
575
- arrangeType
576
- });
577
- });
578
- }
579
- _updateImageListener() {
580
- this._drawingManagerService.featurePluginUpdate$.subscribe((params) => {
581
- const drawings = [];
582
- params.length !== 0 && (params.forEach((param) => {
583
- const { unitId, subUnitId, drawingId, drawingType, transform } = param;
584
- if (transform == null)
585
- return;
586
- const sheetDrawing = this._sheetDrawingService.getDrawingByParam({ unitId, subUnitId, drawingId });
587
- if (sheetDrawing == null || sheetDrawing.unitId !== this._context.unitId)
588
- return;
589
- const sheetTransform = transformToDrawingPosition({ ...sheetDrawing.transform, ...transform }, this._selectionRenderService);
590
- if (sheetTransform == null)
591
- return;
592
- const newDrawing = {
593
- ...param,
594
- transform: { ...sheetDrawing.transform, ...transform, ...drawingPositionToTransform(sheetTransform, this._selectionRenderService, this._skeletonManagerService) },
595
- sheetTransform: { ...sheetTransform }
596
- };
597
- drawings.push(newDrawing);
598
- }), drawings.length > 0 && this._commandService.executeCommand(SetSheetDrawingCommand.id, {
599
- unitId: params[0].unitId,
600
- drawings
601
- }));
602
- });
603
- }
604
- _groupDrawingListener() {
605
- this._drawingManagerService.featurePluginGroupUpdate$.subscribe((params) => {
606
- this._commandService.executeCommand(GroupSheetDrawingCommand.id, params);
607
- const { unitId, subUnitId, drawingId } = params[0].parent;
608
- this._drawingManagerService.focusDrawing([{ unitId, subUnitId, drawingId }]);
609
- }), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((params) => {
610
- this._commandService.executeCommand(UngroupSheetDrawingCommand.id, params);
611
- });
612
- }
613
- _focusDrawingListener() {
614
- this.disposeWithMe(
615
- this._drawingManagerService.focus$.subscribe((params) => {
616
- params == null || params.length === 0 ? (this._contextService.setContextValue(FOCUSING_COMMON_DRAWINGS, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(FOCUSING_COMMON_DRAWINGS, !0), this._sheetDrawingService.focusDrawing(params));
617
- })
618
- );
619
- }
620
- }, __name(_a2, "SheetDrawingUpdateController"), _a2);
621
- SheetDrawingUpdateController = __decorateClass$8([
622
- __decorateParam$8(1, Inject(SheetSkeletonManagerService)),
623
- __decorateParam$8(2, ICommandService),
624
- __decorateParam$8(3, ISheetSelectionRenderService),
625
- __decorateParam$8(4, IImageIoService),
626
- __decorateParam$8(5, ILocalFileService),
627
- __decorateParam$8(6, ISheetDrawingService),
628
- __decorateParam$8(7, IDrawingManagerService),
629
- __decorateParam$8(8, IContextService),
630
- __decorateParam$8(9, IMessageService),
631
- __decorateParam$8(10, Inject(LocaleService)),
632
- __decorateParam$8(11, Inject(SheetsSelectionsService))
633
- ], SheetDrawingUpdateController);
634
- var __assign = function() {
635
- return __assign = Object.assign || function(t) {
636
- for (var s, i = 1, n = arguments.length; i < n; i++) {
637
- s = arguments[i];
638
- for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
639
- }
640
- return t;
641
- }, __assign.apply(this, arguments);
642
- }, __rest = function(s, e) {
643
- var t = {};
644
- for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
645
- if (s != null && typeof Object.getOwnPropertySymbols == "function")
646
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
647
- e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
648
- return t;
649
- }, IconBase = forwardRef(function(props, ref) {
650
- var icon = props.icon, id = props.id, className = props.className, extend = props.extend, restProps = __rest(props, ["icon", "id", "className", "extend"]), cls = "univerjs-icon univerjs-icon-".concat(id, " ").concat(className || "").trim(), idSuffix = useRef("_".concat(generateShortUuid()));
651
- return render(icon, "".concat(id), { defIds: icon.defIds, idSuffix: idSuffix.current }, __assign({ ref, className: cls }, restProps), extend);
652
- });
653
- function render(node, id, runtimeProps, rootProps, extend) {
654
- return createElement(node.tag, __assign(__assign({ key: id }, replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend)), rootProps), (replaceRuntimeIdsInDefs(node, runtimeProps).children || []).map(function(child, index) {
655
- return render(child, "".concat(id, "-").concat(node.tag, "-").concat(index), runtimeProps, void 0, extend);
656
- }));
657
- }
658
- __name(render, "render");
659
- function replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend) {
660
- var attrs = __assign({}, node.attrs);
661
- extend != null && extend.colorChannel1 && attrs.fill === "colorChannel1" && (attrs.fill = extend.colorChannel1);
662
- var defIds = runtimeProps.defIds;
663
- return !defIds || defIds.length === 0 || (node.tag === "use" && attrs["xlink:href"] && (attrs["xlink:href"] = attrs["xlink:href"] + runtimeProps.idSuffix), Object.entries(attrs).forEach(function(_a11) {
664
- var key = _a11[0], value = _a11[1];
665
- typeof value == "string" && (attrs[key] = value.replace(/url\(#(.*)\)/, "url(#$1".concat(runtimeProps.idSuffix, ")")));
666
- })), attrs;
667
- }
668
- __name(replaceRuntimeIdsAndExtInAttrs, "replaceRuntimeIdsAndExtInAttrs");
669
- function replaceRuntimeIdsInDefs(node, runtimeProps) {
670
- var _a11, defIds = runtimeProps.defIds;
671
- return !defIds || defIds.length === 0 ? node : node.tag === "defs" && (!((_a11 = node.children) === null || _a11 === void 0) && _a11.length) ? __assign(__assign({}, node), { children: node.children.map(function(child) {
672
- return typeof child.attrs.id == "string" && defIds && defIds.indexOf(child.attrs.id) > -1 ? __assign(__assign({}, child), { attrs: __assign(__assign({}, child.attrs), { id: child.attrs.id + runtimeProps.idSuffix }) }) : child;
673
- }) }) : node;
674
- }
675
- __name(replaceRuntimeIdsInDefs, "replaceRuntimeIdsInDefs");
676
- function generateShortUuid() {
677
- return Math.random().toString(36).substring(2, 8);
678
- }
679
- __name(generateShortUuid, "generateShortUuid");
680
- IconBase.displayName = "UniverIcon";
681
- var element = { 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" } }] }, AddImageSingle = forwardRef(function(props, ref) {
682
- return createElement(IconBase, Object.assign({}, props, {
683
- id: "add-image-single",
684
- ref,
685
- icon: element
686
- }));
687
- });
688
- AddImageSingle.displayName = "AddImageSingle";
689
- const InsertFloatImageCommand = {
690
- id: "sheet.command.insert-float-image",
691
- type: CommandType.COMMAND,
692
- handler: /* @__PURE__ */ __name((accessor) => {
693
- var _a11, _b;
694
- return (_b = (_a11 = accessor.get(IRenderManagerService).getCurrentTypeOfRenderer(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a11.with(SheetDrawingUpdateController).insertFloatImage()) != null ? _b : !1;
695
- }, "handler")
696
- }, IMAGE_UPLOAD_ICON = "addition-and-subtraction-single", IMAGE_MENU_ID = "sheet.menu.image";
697
- function ImageMenuFactory(accessor) {
698
- return {
699
- id: IMAGE_MENU_ID,
700
- type: MenuItemType.SUBITEMS,
701
- icon: IMAGE_UPLOAD_ICON,
702
- tooltip: "sheetImage.title",
703
- hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
704
- disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] })
705
- };
706
- }
707
- __name(ImageMenuFactory, "ImageMenuFactory");
708
- function UploadFloatImageMenuFactory(_accessor) {
709
- return {
710
- id: InsertFloatImageCommand.id,
711
- title: "sheetImage.upload.float",
712
- type: MenuItemType.BUTTON,
713
- hidden$: getMenuHiddenObservable(_accessor, UniverInstanceType.UNIVER_SHEET)
714
- };
715
- }
716
- __name(UploadFloatImageMenuFactory, "UploadFloatImageMenuFactory");
717
- const imageCommonPanel = "univer-image-common-panel", imageCommonPanelGrid = "univer-image-common-panel-grid", imageCommonPanelBorder = "univer-image-common-panel-border", imageCommonPanelTitle = "univer-image-common-panel-title", imageCommonPanelSubtitle = "univer-image-common-panel-subtitle", imageCommonPanelRow = "univer-image-common-panel-row", imageCommonPanelRowVertical = "univer-image-common-panel-row-vertical", imageCommonPanelColumn = "univer-image-common-panel-column", imageCommonPanelColumnCenter = "univer-image-common-panel-column-center", imageCommonPanelInline = "univer-image-common-panel-inline", imageCommonPanelSpan2 = "univer-image-common-panel-span2", imageCommonPanelSpan3 = "univer-image-common-panel-span3", imageCommonPanelInput = "univer-image-common-panel-input", sheetImageMenu = "univer-sheet-image-menu", sheetImageMenuInput = "univer-sheet-image-menu-input", styles = {
718
- imageCommonPanel,
719
- imageCommonPanelGrid,
720
- imageCommonPanelBorder,
721
- imageCommonPanelTitle,
722
- imageCommonPanelSubtitle,
723
- imageCommonPanelRow,
724
- imageCommonPanelRowVertical,
725
- imageCommonPanelColumn,
726
- imageCommonPanelColumnCenter,
727
- imageCommonPanelInline,
728
- imageCommonPanelSpan2,
729
- imageCommonPanelSpan3,
730
- imageCommonPanelInput,
731
- sheetImageMenu,
732
- sheetImageMenuInput
733
- }, SheetDrawingAnchor = /* @__PURE__ */ __name((props) => {
734
- var _a11;
735
- const commandService = useDependency(ICommandService), localeService = useDependency(LocaleService), drawingManagerService = useDependency(IDrawingManagerService), renderManagerService = useDependency(IRenderManagerService), { drawings } = props, drawingParam = drawings[0];
736
- if (drawingParam == null)
737
- return;
738
- const { unitId } = drawingParam, renderObject = renderManagerService.getRenderById(unitId), scene = renderObject == null ? void 0 : renderObject.scene;
739
- if (scene == null)
740
- return;
741
- const transformer = scene.getTransformerByCreate(), [anchorShow, setAnchorShow] = useState(!0), type = (_a11 = drawingParam.anchorType) != null ? _a11 : SheetDrawingAnchorType.Position, [value, setValue] = useState(type);
742
- function getUpdateParams(objects, drawingManagerService2) {
743
- const params = [];
744
- return objects.forEach((object) => {
745
- const { oKey } = object, searchParam = drawingManagerService2.getDrawingOKey(oKey);
746
- if (searchParam == null)
747
- return params.push(null), !0;
748
- const { unitId: unitId2, subUnitId, drawingId, drawingType, anchorType, sheetTransform } = searchParam;
749
- params.push({
750
- unitId: unitId2,
751
- subUnitId,
752
- drawingId,
753
- anchorType,
754
- sheetTransform,
755
- drawingType
756
- });
757
- }), params;
758
- }
759
- __name(getUpdateParams, "getUpdateParams"), useEffect(() => {
760
- const onClearControlObserver = transformer.clearControl$.subscribe((changeSelf) => {
761
- changeSelf === !0 && setAnchorShow(!1);
762
- }), onChangeStartObserver = transformer.changeStart$.subscribe((state) => {
763
- var _a12;
764
- const { objects } = state, params = getUpdateParams(objects, drawingManagerService);
765
- if (params.length === 0)
766
- setAnchorShow(!1);
767
- else if (params.length >= 1) {
768
- setAnchorShow(!0);
769
- const anchorType = ((_a12 = params[0]) == null ? void 0 : _a12.anchorType) || SheetDrawingAnchorType.Position;
770
- setValue(anchorType);
771
- }
772
- });
773
- return () => {
774
- onChangeStartObserver.unsubscribe(), onClearControlObserver.unsubscribe();
775
- };
776
- }, []);
777
- function handleChange(value2) {
778
- setValue(value2);
779
- const focusDrawings = drawingManagerService.getFocusDrawings();
780
- if (focusDrawings.length === 0)
781
- return;
782
- const updateParams = focusDrawings.map((drawing) => ({
783
- unitId: drawing.unitId,
784
- subUnitId: drawing.subUnitId,
785
- drawingId: drawing.drawingId,
786
- anchorType: value2
787
- }));
788
- commandService.executeCommand(SetSheetDrawingCommand.id, {
789
- unitId: focusDrawings[0].unitId,
790
- drawings: updateParams
791
- });
792
- }
793
- __name(handleChange, "handleChange");
794
- const gridDisplay = /* @__PURE__ */ __name((isShow) => isShow ? "block" : "none", "gridDisplay");
795
- return /* @__PURE__ */ React.createElement("div", { className: clsx(styles.imageCommonPanelGrid, styles.imageCommonPanelBorder), style: { display: gridDisplay(anchorShow) } }, /* @__PURE__ */ React.createElement("div", { className: styles.imageCommonPanelRow }, /* @__PURE__ */ React.createElement("div", { className: clsx(styles.imageCommonPanelColumn, styles.imageCommonPanelTitle) }, /* @__PURE__ */ React.createElement("div", null, localeService.t("drawing-anchor.title")))), /* @__PURE__ */ React.createElement("div", { className: clsx(styles.imageCommonPanelRow) }, /* @__PURE__ */ React.createElement("div", { className: clsx(styles.imageCommonPanelColumn) }, /* @__PURE__ */ React.createElement(RadioGroup, { value, onChange: handleChange, direction: "vertical" }, /* @__PURE__ */ React.createElement(Radio, { value: SheetDrawingAnchorType.Both }, localeService.t("drawing-anchor.both")), /* @__PURE__ */ React.createElement(Radio, { value: SheetDrawingAnchorType.Position }, localeService.t("drawing-anchor.position")), /* @__PURE__ */ React.createElement(Radio, { value: SheetDrawingAnchorType.None }, localeService.t("drawing-anchor.none"))))));
796
- }, "SheetDrawingAnchor"), SheetDrawingPanel = /* @__PURE__ */ __name(() => {
797
- const drawingManagerService = useDependency(IDrawingManagerService), focusDrawings = drawingManagerService.getFocusDrawings(), [drawings, setDrawings] = useState(focusDrawings);
798
- return useEffect(() => {
799
- const focusDispose = drawingManagerService.focus$.subscribe((drawings2) => {
800
- setDrawings(drawings2);
801
- });
802
- return () => {
803
- focusDispose.unsubscribe();
804
- };
805
- }, []), !!(drawings != null && drawings.length) && /* @__PURE__ */ React.createElement("div", { className: styles.imageCommonPanel }, /* @__PURE__ */ React.createElement(DrawingCommonPanel, { drawings }), /* @__PURE__ */ React.createElement(SheetDrawingAnchor, { drawings }));
806
- }, "SheetDrawingPanel"), MoveDrawingsCommand = {
807
- id: "sheet.command.move-drawing",
808
- type: CommandType.COMMAND,
809
- handler: /* @__PURE__ */ __name((accessor, params) => {
810
- const commandService = accessor.get(ICommandService), drawingManagerService = accessor.get(ISheetDrawingService), selectionRenderService = accessor.get(ISheetSelectionRenderService), { direction } = params, drawings = drawingManagerService.getFocusDrawings();
811
- if (drawings.length === 0)
812
- return !1;
813
- const unitId = drawings[0].unitId, newDrawings = drawings.map((drawing) => {
814
- const { transform } = drawing;
815
- if (transform == null)
816
- return null;
817
- const newTransform = { ...transform }, { left = 0, top = 0 } = transform;
818
- return direction === Direction.UP ? newTransform.top = top - 1 : direction === Direction.DOWN ? newTransform.top = top + 1 : direction === Direction.LEFT ? newTransform.left = left - 1 : direction === Direction.RIGHT && (newTransform.left = left + 1), {
819
- ...drawing,
820
- transform: newTransform,
821
- sheetTransform: transformToDrawingPosition(newTransform, selectionRenderService)
822
- };
823
- }).filter((drawing) => drawing != null);
824
- return commandService.syncExecuteCommand(SetSheetDrawingCommand.id, {
825
- unitId,
826
- drawings: newDrawings
827
- }) ? (commandService.syncExecuteCommand(ClearSheetDrawingTransformerOperation.id, [unitId]), !0) : !1;
828
- }, "handler")
829
- }, DeleteDrawingsCommand = {
830
- id: "sheet.command.delete-drawing",
831
- type: CommandType.COMMAND,
832
- handler: /* @__PURE__ */ __name((accessor) => {
833
- const commandService = accessor.get(ICommandService), drawings = accessor.get(ISheetDrawingService).getFocusDrawings();
834
- if (drawings.length === 0)
835
- return !1;
836
- const unitId = drawings[0].unitId, newDrawings = drawings.map((drawing) => {
837
- const { unitId: unitId2, subUnitId, drawingId, drawingType } = drawing;
838
- return {
839
- unitId: unitId2,
840
- subUnitId,
841
- drawingId,
842
- drawingType
843
- };
844
- });
845
- return commandService.executeCommand(RemoveSheetDrawingCommand.id, {
846
- unitId,
847
- drawings: newDrawings
848
- });
849
- }, "handler")
850
- };
851
- function whenSheetDrawingFocused(contextService) {
852
- return !contextService.getContextValue(FOCUSING_FX_BAR_EDITOR) && !contextService.getContextValue(EDITOR_ACTIVATED) && contextService.getContextValue(FOCUSING_COMMON_DRAWINGS);
853
- }
854
- __name(whenSheetDrawingFocused, "whenSheetDrawingFocused");
855
- const MoveDrawingDownShortcutItem = {
856
- id: MoveDrawingsCommand.id,
857
- description: "shortcut.sheet.drawing-move-down",
858
- group: "4_sheet-drawing-view",
859
- binding: KeyCode.ARROW_DOWN,
860
- priority: 100,
861
- preconditions: whenSheetDrawingFocused,
862
- staticParameters: {
863
- direction: Direction.DOWN
864
- }
865
- }, MoveDrawingUpShortcutItem = {
866
- id: MoveDrawingsCommand.id,
867
- description: "shortcut.sheet.drawing-move-up",
868
- group: "4_sheet-drawing-view",
869
- binding: KeyCode.ARROW_UP,
870
- priority: 100,
871
- preconditions: whenSheetDrawingFocused,
872
- staticParameters: {
873
- direction: Direction.UP
874
- }
875
- }, MoveDrawingLeftShortcutItem = {
876
- id: MoveDrawingsCommand.id,
877
- description: "shortcut.sheet.drawing-move-left",
878
- group: "4_sheet-drawing-view",
879
- binding: KeyCode.ARROW_LEFT,
880
- priority: 100,
881
- preconditions: whenSheetDrawingFocused,
882
- staticParameters: {
883
- direction: Direction.LEFT
884
- }
885
- }, MoveDrawingRightShortcutItem = {
886
- id: MoveDrawingsCommand.id,
887
- description: "shortcut.sheet.drawing-move-right",
888
- group: "4_sheet-drawing-view",
889
- binding: KeyCode.ARROW_RIGHT,
890
- priority: 100,
891
- preconditions: whenSheetDrawingFocused,
892
- staticParameters: {
893
- direction: Direction.RIGHT
894
- }
895
- }, DeleteDrawingsShortcutItem = {
896
- id: DeleteDrawingsCommand.id,
897
- description: "shortcut.sheet.drawing-delete",
898
- group: "4_sheet-drawing-view",
899
- // when focusing on any other input tag do not trigger this shortcut
900
- preconditions: whenSheetDrawingFocused,
901
- binding: KeyCode.DELETE,
902
- mac: KeyCode.BACKSPACE
903
- }, menuSchema = {
904
- [RibbonStartGroup.FORMULAS_INSERT]: {
905
- [IMAGE_MENU_ID]: {
906
- order: 3,
907
- menuItemFactory: ImageMenuFactory,
908
- [InsertFloatImageCommand.id]: {
909
- order: 0,
910
- menuItemFactory: UploadFloatImageMenuFactory
911
- }
912
- }
913
- }
914
- };
915
- var __defProp$7 = Object.defineProperty, __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor, __decorateClass$7 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
916
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
917
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
918
- return kind && result && __defProp$7(target, key, result), result;
919
- }, "__decorateClass$7"), __decorateParam$7 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$7"), _a3;
920
- let SheetDrawingUIController = (_a3 = class extends Disposable {
921
- constructor(_injector, _componentManager, _menuManagerService, _commandService, _shortcutService) {
922
- super(), this._injector = _injector, this._componentManager = _componentManager, this._menuManagerService = _menuManagerService, this._commandService = _commandService, this._shortcutService = _shortcutService, this._init();
923
- }
924
- _initCustomComponents() {
925
- const componentManager = this._componentManager;
926
- this.disposeWithMe(componentManager.register(IMAGE_UPLOAD_ICON, AddImageSingle)), this.disposeWithMe(componentManager.register(COMPONENT_SHEET_DRAWING_PANEL, SheetDrawingPanel));
927
- }
928
- _initMenus() {
929
- this._menuManagerService.mergeMenu(menuSchema);
930
- }
931
- _initCommands() {
932
- [
933
- InsertFloatImageCommand,
934
- InsertSheetDrawingCommand,
935
- RemoveSheetDrawingCommand,
936
- SetSheetDrawingCommand,
937
- SidebarSheetDrawingOperation,
938
- ClearSheetDrawingTransformerOperation,
939
- EditSheetDrawingOperation,
940
- GroupSheetDrawingCommand,
941
- UngroupSheetDrawingCommand,
942
- MoveDrawingsCommand,
943
- DeleteDrawingsCommand,
944
- SetDrawingArrangeCommand
945
- ].forEach((command) => this.disposeWithMe(this._commandService.registerCommand(command)));
946
- }
947
- _initShortcuts() {
948
- [
949
- // sheet drawing shortcuts
950
- MoveDrawingDownShortcutItem,
951
- MoveDrawingUpShortcutItem,
952
- MoveDrawingLeftShortcutItem,
953
- MoveDrawingRightShortcutItem,
954
- DeleteDrawingsShortcutItem
955
- ].forEach((item) => {
956
- this.disposeWithMe(this._shortcutService.registerShortcut(item));
957
- });
958
- }
959
- _init() {
960
- this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
961
- }
962
- }, __name(_a3, "SheetDrawingUIController"), _a3);
963
- SheetDrawingUIController = __decorateClass$7([
964
- OnLifecycle(LifecycleStages.Rendered, SheetDrawingUIController),
965
- __decorateParam$7(0, Inject(Injector)),
966
- __decorateParam$7(1, Inject(ComponentManager)),
967
- __decorateParam$7(2, IMenuManagerService),
968
- __decorateParam$7(3, ICommandService),
969
- __decorateParam$7(4, IShortcutService)
970
- ], SheetDrawingUIController);
971
- var __defProp$6 = Object.defineProperty, __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor, __decorateClass$6 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
972
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
973
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
974
- return kind && result && __defProp$6(target, key, result), result;
975
- }, "__decorateClass$6"), __decorateParam$6 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$6");
976
- const UPDATE_COMMANDS = [
977
- InsertRowCommand.id,
978
- InsertColCommand.id,
979
- RemoveRowCommand.id,
980
- RemoveColCommand.id,
981
- DeleteRangeMoveLeftCommand.id,
982
- DeleteRangeMoveUpCommand.id,
983
- InsertRangeMoveDownCommand.id,
984
- InsertRangeMoveRightCommand.id,
985
- DeltaRowHeightCommand.id,
986
- SetRowHeightCommand.id,
987
- DeltaColumnWidthCommand.id,
988
- SetColWidthCommand.id,
989
- SetRowHiddenCommand.id,
990
- SetSpecificRowsVisibleCommand.id,
991
- SetSpecificColsVisibleCommand.id,
992
- SetColHiddenCommand.id,
993
- MoveColsCommand.id,
994
- MoveRowsCommand.id,
995
- MoveRangeCommand.id
996
- ], REFRESH_MUTATIONS = [
997
- SetRowVisibleMutation.id,
998
- SetRowHiddenMutation.id,
999
- SetColVisibleMutation.id,
1000
- SetColHiddenMutation.id,
1001
- SetWorksheetRowHeightMutation.id,
1002
- SetWorksheetColWidthMutation.id
1003
- ];
1004
- var _a4;
1005
- let SheetDrawingTransformAffectedController = (_a4 = class extends Disposable {
1006
- constructor(_context, _renderManagerService, _commandService, _selectionRenderService, _skeletonManagerService, _sheetInterceptorService, _sheetDrawingService, _drawingManagerService, _univerInstanceService) {
1007
- super(), this._context = _context, this._renderManagerService = _renderManagerService, this._commandService = _commandService, this._selectionRenderService = _selectionRenderService, this._skeletonManagerService = _skeletonManagerService, this._sheetInterceptorService = _sheetInterceptorService, this._sheetDrawingService = _sheetDrawingService, this._drawingManagerService = _drawingManagerService, this._univerInstanceService = _univerInstanceService, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
1008
- }
1009
- _sheetInterceptorListener() {
1010
- this.disposeWithMe(
1011
- this._sheetInterceptorService.interceptCommand({
1012
- getMutations: /* @__PURE__ */ __name((commandInfo) => {
1013
- if (!UPDATE_COMMANDS.includes(commandInfo.id))
1014
- return { redos: [], undos: [] };
1015
- if (commandInfo.params == null)
1016
- return { redos: [], undos: [] };
1017
- const cId = commandInfo.id;
1018
- if (cId === InsertRowCommand.id)
1019
- return this._moveRowInterceptor(commandInfo.params, "insert");
1020
- if ([MoveColsCommand.id, MoveRowsCommand.id, MoveRangeCommand.id].includes(cId))
1021
- return this._moveRangeInterceptor(commandInfo.params);
1022
- if (cId === InsertColCommand.id)
1023
- return this._moveColInterceptor(commandInfo.params, "insert");
1024
- if (cId === RemoveRowCommand.id)
1025
- return this._moveRowInterceptor(commandInfo.params, "remove");
1026
- if (cId === RemoveColCommand.id)
1027
- return this._moveColInterceptor(commandInfo.params, "remove");
1028
- if (cId === DeleteRangeMoveLeftCommand.id) {
1029
- const { range } = commandInfo.params;
1030
- return this._getRangeMoveUndo(
1031
- range,
1032
- 0
1033
- /* deleteLeft */
1034
- );
1035
- } else if (cId === DeleteRangeMoveUpCommand.id) {
1036
- const { range } = commandInfo.params;
1037
- return this._getRangeMoveUndo(
1038
- range,
1039
- 1
1040
- /* deleteUp */
1041
- );
1042
- } else if (cId === InsertRangeMoveDownCommand.id) {
1043
- const { range } = commandInfo.params;
1044
- return this._getRangeMoveUndo(
1045
- range,
1046
- 2
1047
- /* insertDown */
1048
- );
1049
- } else if (cId === InsertRangeMoveRightCommand.id) {
1050
- const { range } = commandInfo.params;
1051
- return this._getRangeMoveUndo(
1052
- range,
1053
- 3
1054
- /* insertRight */
1055
- );
1056
- } else if (cId === SetRowHiddenCommand.id || cId === SetSpecificRowsVisibleCommand.id) {
1057
- const params = commandInfo.params, { unitId, subUnitId, ranges } = params;
1058
- return this._getDrawingUndoForRowVisible(unitId, subUnitId, ranges);
1059
- } else if (cId === SetSpecificColsVisibleCommand.id || cId === SetColHiddenCommand.id) {
1060
- const params = commandInfo.params, { unitId, subUnitId, ranges } = params;
1061
- return this._getDrawingUndoForColVisible(unitId, subUnitId, ranges);
1062
- } else if (cId === DeltaRowHeightCommand.id || cId === SetRowHeightCommand.id || cId === DeltaColumnWidthCommand.id || cId === SetColWidthCommand.id) {
1063
- const params = commandInfo.params, { unitId, subUnitId, ranges } = params, isRow = cId === DeltaRowHeightCommand.id || cId === SetRowHeightCommand.id;
1064
- return this._getDrawingUndoForRowAndColSize(unitId, subUnitId, ranges, isRow);
1065
- }
1066
- return { redos: [], undos: [] };
1067
- }, "getMutations")
1068
- })
1069
- );
1070
- }
1071
- _getRangeMoveUndo(range, type) {
1072
- const newParams = getSheetCommandTarget(this._univerInstanceService);
1073
- if (newParams == null)
1074
- return { redos: [], undos: [] };
1075
- const unitId = newParams.unitId, subUnitId = newParams.subUnitId, redos = [], undos = [], drawingData = this._sheetDrawingService.getDrawingData(unitId, subUnitId), updateDrawings = [], deleteDrawings = [];
1076
- if (Object.keys(drawingData).forEach((drawingId) => {
1077
- const drawing = drawingData[drawingId], { updateDrawings: updateDrawingsPart, deleteDrawings: deleteDrawingsPart } = this._getUpdateOrDeleteDrawings(range, type, drawing);
1078
- updateDrawings.push(...updateDrawingsPart), deleteDrawings.push(...deleteDrawingsPart);
1079
- }), updateDrawings.length === 0 && deleteDrawings.length === 0)
1080
- return { redos: [], undos: [] };
1081
- if (updateDrawings.length > 0) {
1082
- const updateJsonOp = this._sheetDrawingService.getBatchUpdateOp(updateDrawings), { undo, redo, objects } = updateJsonOp;
1083
- redos.push({ id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: redo, objects, type: DrawingApplyType.UPDATE } }), undos.push({ id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: undo, objects, type: DrawingApplyType.UPDATE } });
1084
- }
1085
- if (deleteDrawings.length > 0) {
1086
- const deleteJsonOp = this._sheetDrawingService.getBatchRemoveOp(deleteDrawings), deleteUndo = deleteJsonOp.undo, deleteRedo = deleteJsonOp.redo, deleteObjects = deleteJsonOp.objects;
1087
- redos.push({ id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: deleteRedo, objects: deleteObjects, type: DrawingApplyType.REMOVE } }), undos.push({ id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: deleteUndo, objects: deleteObjects, type: DrawingApplyType.INSERT } });
1088
- }
1089
- return redos.push({ id: ClearSheetDrawingTransformerOperation.id, params: [unitId] }), undos.push({ id: ClearSheetDrawingTransformerOperation.id, params: [unitId] }), {
1090
- redos,
1091
- undos
1092
- };
1093
- }
1094
- _getUpdateOrDeleteDrawings(range, type, drawing) {
1095
- const updateDrawings = [], deleteDrawings = [], { sheetTransform, anchorType = SheetDrawingAnchorType.Position, transform, unitId, subUnitId, drawingId } = drawing, { from, to } = sheetTransform, { row: fromRow, column: fromColumn } = from, { row: toRow, column: toColumn } = to;
1096
- if (sheetTransform == null || transform == null)
1097
- return {
1098
- updateDrawings,
1099
- deleteDrawings
1100
- };
1101
- const { startRow, endRow, startColumn, endColumn } = range;
1102
- let newSheetTransform = null, newTransform = null;
1103
- if (type === 0 && fromRow >= startRow && toRow <= endRow)
1104
- if (fromColumn >= startColumn && toColumn <= endColumn)
1105
- deleteDrawings.push({ unitId, subUnitId, drawingId });
1106
- else {
1107
- const param = this._shrinkCol(sheetTransform, transform, startColumn, endColumn, anchorType);
1108
- newSheetTransform = param == null ? void 0 : param.newSheetTransform, newTransform = param == null ? void 0 : param.newTransform;
1109
- }
1110
- else if (type === 1 && fromColumn >= startColumn && toColumn <= endColumn)
1111
- if (fromRow >= startRow && toRow <= endRow)
1112
- deleteDrawings.push({ unitId, subUnitId, drawingId });
1113
- else {
1114
- const param = this._shrinkRow(sheetTransform, transform, startRow, endRow, anchorType);
1115
- newSheetTransform = param == null ? void 0 : param.newSheetTransform, newTransform = param == null ? void 0 : param.newTransform;
1116
- }
1117
- else if (type === 2) {
1118
- const param = this._expandRow(sheetTransform, transform, startRow, endRow, anchorType);
1119
- newSheetTransform = param == null ? void 0 : param.newSheetTransform, newTransform = param == null ? void 0 : param.newTransform;
1120
- } else if (type === 3) {
1121
- const param = this._expandCol(sheetTransform, transform, startColumn, endColumn, anchorType);
1122
- newSheetTransform = param == null ? void 0 : param.newSheetTransform, newTransform = param == null ? void 0 : param.newTransform;
1123
- }
1124
- if (newSheetTransform != null && newTransform != null) {
1125
- const newTransform2 = drawingPositionToTransform(newSheetTransform, this._selectionRenderService, this._skeletonManagerService);
1126
- updateDrawings.push({ ...drawing, sheetTransform: newSheetTransform, transform: newTransform2 });
1127
- }
1128
- return { updateDrawings, deleteDrawings };
1129
- }
1130
- _remainDrawingSize(transform, updateDrawings, drawing) {
1131
- const newSheetTransform = transformToDrawingPosition({ ...transform }, this._selectionRenderService);
1132
- newSheetTransform != null && updateDrawings.push({
1133
- ...drawing,
1134
- sheetTransform: newSheetTransform
1135
- });
1136
- }
1137
- // eslint-disable-next-line max-lines-per-function
1138
- _getDrawingUndoForColVisible(unitId, subUnitId, ranges) {
1139
- const drawingData = this._drawingManagerService.getDrawingData(unitId, subUnitId), updateDrawings = [], preUpdateDrawings = [];
1140
- if (Object.keys(drawingData).forEach((drawingId) => {
1141
- const drawing = drawingData[drawingId], { sheetTransform, transform, anchorType = SheetDrawingAnchorType.Position } = drawing;
1142
- if (anchorType === SheetDrawingAnchorType.None)
1143
- this._remainDrawingSize(transform, updateDrawings, drawing);
1144
- else {
1145
- const { from, to } = sheetTransform, { row: fromRow, column: fromColumn } = from, { row: toRow, column: toColumn } = to;
1146
- for (let i = 0; i < ranges.length; i++) {
1147
- const range = ranges[i], { startRow, endRow, startColumn, endColumn } = range;
1148
- if (toColumn < startColumn)
1149
- continue;
1150
- if (anchorType === SheetDrawingAnchorType.Position) {
1151
- let newSheetTransform2 = null, newTransform2 = null;
1152
- if (fromColumn >= startColumn && fromColumn <= endColumn) {
1153
- const selectionCell = this._skeletonManagerService.attachRangeWithCoord({ startColumn: fromColumn, endColumn, startRow: from.row, endRow: to.row });
1154
- if (selectionCell == null)
1155
- return;
1156
- newTransform2 = { ...transform, left: selectionCell.startX };
1157
- }
1158
- if (newTransform2 != null && (newSheetTransform2 = transformToDrawingPosition(newTransform2, this._selectionRenderService), newSheetTransform2 != null && newTransform2 != null)) {
1159
- updateDrawings.push({ ...drawing, sheetTransform: newSheetTransform2, transform: newTransform2 });
1160
- break;
1161
- }
1162
- this._remainDrawingSize(transform, updateDrawings, drawing);
1163
- continue;
1164
- }
1165
- if (fromColumn >= startColumn && toColumn <= endColumn)
1166
- continue;
1167
- let newSheetTransform = null, newTransform = null;
1168
- if (fromColumn >= startColumn && fromColumn <= endColumn) {
1169
- const selectionCell = this._skeletonManagerService.attachRangeWithCoord({ startColumn: fromColumn, endColumn, startRow: from.row, endRow: to.row });
1170
- if (selectionCell == null)
1171
- return;
1172
- newTransform = {
1173
- ...transform,
1174
- left: (selectionCell == null ? void 0 : selectionCell.startX) || 0,
1175
- width: ((transform == null ? void 0 : transform.width) || 0) - selectionCell.endX + selectionCell.startX
1176
- };
1177
- } else if (toColumn >= startColumn && toColumn <= endColumn) {
1178
- const selectionCell = this._skeletonManagerService.attachRangeWithCoord({ startColumn, endColumn: toColumn, startRow: from.row, endRow: to.row });
1179
- if (selectionCell == null)
1180
- return;
1181
- newTransform = {
1182
- ...transform,
1183
- left: selectionCell.startX - ((transform == null ? void 0 : transform.width) || 0)
1184
- };
1185
- } else {
1186
- const selectionCell = this._skeletonManagerService.attachRangeWithCoord({ startColumn, endColumn, startRow: from.row, endRow: to.row });
1187
- if (selectionCell == null)
1188
- return;
1189
- if (newTransform = {
1190
- ...transform,
1191
- width: ((transform == null ? void 0 : transform.width) || 0) - selectionCell.endX + selectionCell.startX
1192
- }, newSheetTransform = transformToDrawingPosition(newTransform, this._selectionRenderService), newSheetTransform != null && newTransform != null) {
1193
- preUpdateDrawings.push({ ...drawing, sheetTransform: newSheetTransform, transform: newTransform });
1194
- break;
1195
- }
1196
- }
1197
- if (newTransform != null && (newSheetTransform = transformToDrawingPosition(newTransform, this._selectionRenderService)), newTransform != null && newSheetTransform != null) {
1198
- updateDrawings.push({ ...drawing, sheetTransform: newSheetTransform, transform: newTransform });
1199
- break;
1200
- } else
1201
- this._remainDrawingSize(transform, updateDrawings, drawing);
1202
- }
1203
- }
1204
- }), updateDrawings.length === 0 && preUpdateDrawings.length === 0)
1205
- return { redos: [], undos: [] };
1206
- const { redos, undos } = this._createUndoAndRedoMutation(unitId, subUnitId, updateDrawings), preRedos = [], preUndos = [];
1207
- if (preUpdateDrawings.length > 0) {
1208
- const { redos: redos2, undos: undos2 } = this._createUndoAndRedoMutation(unitId, subUnitId, preUpdateDrawings);
1209
- preRedos.push(...redos2), preUndos.push(...undos2);
1210
- }
1211
- return {
1212
- redos,
1213
- undos,
1214
- preRedos,
1215
- preUndos
1216
- };
1217
- }
1218
- _createUndoAndRedoMutation(unitId, subUnitId, updateDrawings) {
1219
- const updateJsonOp = this._sheetDrawingService.getBatchUpdateOp(updateDrawings), { undo, redo, objects } = updateJsonOp, redos = [
1220
- { id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: redo, objects, type: DrawingApplyType.UPDATE } },
1221
- { id: ClearSheetDrawingTransformerOperation.id, params: [unitId] }
1222
- ], undos = [
1223
- { id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: undo, objects, type: DrawingApplyType.UPDATE } },
1224
- { id: ClearSheetDrawingTransformerOperation.id, params: [unitId] }
1225
- ];
1226
- return {
1227
- redos,
1228
- undos
1229
- };
1230
- }
1231
- // eslint-disable-next-line max-lines-per-function
1232
- _getDrawingUndoForRowVisible(unitId, subUnitId, ranges) {
1233
- const drawingData = this._drawingManagerService.getDrawingData(unitId, subUnitId), updateDrawings = [], preUpdateDrawings = [];
1234
- if (Object.keys(drawingData).forEach((drawingId) => {
1235
- const drawing = drawingData[drawingId], { sheetTransform, transform, anchorType = SheetDrawingAnchorType.Position } = drawing;
1236
- if (anchorType === SheetDrawingAnchorType.None)
1237
- this._remainDrawingSize(transform, updateDrawings, drawing);
1238
- else {
1239
- const { from, to } = sheetTransform, { row: fromRow, column: fromColumn } = from, { row: toRow, column: toColumn } = to;
1240
- for (let i = 0; i < ranges.length; i++) {
1241
- const range = ranges[i], { startRow, endRow, startColumn, endColumn } = range;
1242
- if (toRow < startRow)
1243
- continue;
1244
- if (anchorType === SheetDrawingAnchorType.Position) {
1245
- let newSheetTransform2 = null, newTransform2 = null;
1246
- if (fromRow >= startRow && fromRow <= endRow) {
1247
- const selectionCell = this._skeletonManagerService.attachRangeWithCoord({ startColumn: from.column, endColumn: to.column, startRow: fromRow, endRow });
1248
- if (selectionCell == null)
1249
- return;
1250
- newTransform2 = { ...transform, top: selectionCell.startY };
1251
- }
1252
- if (newTransform2 != null && (newSheetTransform2 = transformToDrawingPosition(newTransform2, this._selectionRenderService), newSheetTransform2 != null && newTransform2 != null)) {
1253
- updateDrawings.push({ ...drawing, sheetTransform: newSheetTransform2, transform: newTransform2 });
1254
- break;
1255
- }
1256
- this._remainDrawingSize(transform, updateDrawings, drawing);
1257
- continue;
1258
- }
1259
- if (fromRow >= startRow && toRow <= endRow)
1260
- continue;
1261
- let newSheetTransform = null, newTransform = null;
1262
- if (fromRow >= startRow && fromRow <= endRow) {
1263
- const selectionCell = this._skeletonManagerService.attachRangeWithCoord({ startColumn: from.column, endColumn: to.column, startRow: fromRow, endRow });
1264
- if (selectionCell == null)
1265
- return;
1266
- newTransform = {
1267
- ...transform,
1268
- top: (selectionCell == null ? void 0 : selectionCell.startY) || 0,
1269
- height: ((transform == null ? void 0 : transform.height) || 0) - selectionCell.endY + selectionCell.startY
1270
- };
1271
- } else if (toRow >= startRow && toRow <= endRow) {
1272
- const selectionCell = this._skeletonManagerService.attachRangeWithCoord({ startColumn: from.column, endColumn: to.column, startRow, endRow: toRow });
1273
- if (selectionCell == null)
1274
- return;
1275
- newTransform = {
1276
- ...transform,
1277
- top: selectionCell.startY - ((transform == null ? void 0 : transform.height) || 0)
1278
- };
1279
- } else {
1280
- const selectionCell = this._skeletonManagerService.attachRangeWithCoord({ startColumn: from.column, endColumn: to.column, startRow, endRow });
1281
- if (selectionCell == null)
1282
- return;
1283
- if (newTransform = {
1284
- ...transform,
1285
- height: ((transform == null ? void 0 : transform.height) || 0) - selectionCell.endY + selectionCell.startY
1286
- }, newSheetTransform = transformToDrawingPosition(newTransform, this._selectionRenderService), newSheetTransform != null && newTransform != null) {
1287
- preUpdateDrawings.push({ ...drawing, sheetTransform: newSheetTransform, transform: newTransform });
1288
- break;
1289
- }
1290
- }
1291
- if (newTransform != null && (newSheetTransform = transformToDrawingPosition(newTransform, this._selectionRenderService)), newTransform != null && newSheetTransform != null) {
1292
- updateDrawings.push({ ...drawing, sheetTransform: newSheetTransform, transform: newTransform });
1293
- break;
1294
- } else
1295
- this._remainDrawingSize(transform, updateDrawings, drawing);
1296
- }
1297
- }
1298
- }), updateDrawings.length === 0 && preUpdateDrawings.length === 0)
1299
- return { redos: [], undos: [] };
1300
- const { redos, undos } = this._createUndoAndRedoMutation(unitId, subUnitId, updateDrawings), preRedos = [], preUndos = [];
1301
- if (preUpdateDrawings.length > 0) {
1302
- const { redos: redos2, undos: undos2 } = this._createUndoAndRedoMutation(unitId, subUnitId, preUpdateDrawings);
1303
- preRedos.push(...redos2), preUndos.push(...undos2);
1304
- }
1305
- return {
1306
- redos,
1307
- undos,
1308
- preRedos,
1309
- preUndos
1310
- };
1311
- }
1312
- _getDrawingUndoForRowAndColSize(unitId, subUnitId, ranges, isRow) {
1313
- const drawingData = this._drawingManagerService.getDrawingData(unitId, subUnitId), updateDrawings = [];
1314
- return Object.keys(drawingData).forEach((drawingId) => {
1315
- const drawing = drawingData[drawingId], { sheetTransform, transform, anchorType = SheetDrawingAnchorType.Position } = drawing;
1316
- if (anchorType === SheetDrawingAnchorType.None)
1317
- this._remainDrawingSize(transform, updateDrawings, drawing);
1318
- else {
1319
- const { from, to } = sheetTransform, { row: fromRow, column: fromColumn } = from, { row: toRow, column: toColumn } = to;
1320
- for (let i = 0; i < ranges.length; i++) {
1321
- const range = ranges[i], { startRow, endRow, startColumn, endColumn } = range;
1322
- if (toRow < startRow || toColumn < startColumn)
1323
- continue;
1324
- if (anchorType === SheetDrawingAnchorType.Position && (fromRow <= startRow && toRow >= endRow || fromColumn <= startColumn && toColumn >= endColumn)) {
1325
- this._remainDrawingSize(transform, updateDrawings, drawing);
1326
- continue;
1327
- }
1328
- const newTransform = drawingPositionToTransform(
1329
- { ...sheetTransform },
1330
- this._selectionRenderService,
1331
- this._skeletonManagerService
1332
- );
1333
- if (newTransform != null) {
1334
- updateDrawings.push({
1335
- ...drawing,
1336
- transform: newTransform
1337
- });
1338
- break;
1339
- }
1340
- }
1341
- }
1342
- }), updateDrawings.length === 0 ? { redos: [], undos: [] } : this._createUndoAndRedoMutation(unitId, subUnitId, updateDrawings);
1343
- }
1344
- _getUnitIdAndSubUnitId(params, type) {
1345
- let unitId, subUnitId;
1346
- if (type === "insert")
1347
- unitId = params.unitId, subUnitId = params.subUnitId;
1348
- else {
1349
- const newParams = getSheetCommandTarget(this._univerInstanceService);
1350
- if (newParams == null)
1351
- return;
1352
- unitId = newParams.unitId, subUnitId = newParams.subUnitId;
1353
- }
1354
- return { unitId, subUnitId };
1355
- }
1356
- _moveRangeInterceptor(params) {
1357
- var _a11, _b;
1358
- const { toRange, fromRange } = params, target = getSheetCommandTarget(this._univerInstanceService);
1359
- if (!target)
1360
- return { redos: [], undos: [] };
1361
- const { unitId, subUnitId } = target, skeleton = (_b = (_a11 = this._renderManagerService.getRenderById(unitId)) == null ? void 0 : _a11.with(SheetSkeletonManagerService)) == null ? void 0 : _b.getCurrentSkeleton();
1362
- if (!skeleton)
1363
- return { redos: [], undos: [] };
1364
- const selectionRect = attachRangeWithCoord(skeleton, fromRange);
1365
- if (!selectionRect)
1366
- return { redos: [], undos: [] };
1367
- const { startX, endX, startY, endY } = selectionRect, drawings = this._sheetDrawingService.getDrawingData(unitId, subUnitId), containedDrawings = [];
1368
- Object.keys(drawings).forEach((drawingId) => {
1369
- const drawing = drawings[drawingId];
1370
- if (drawing.anchorType !== SheetDrawingAnchorType.Both)
1371
- return;
1372
- const { transform } = drawing;
1373
- if (!transform)
1374
- return;
1375
- const { left = 0, top = 0, width = 0, height = 0 } = transform, { drawingStartX, drawingEndX, drawingStartY, drawingEndY } = {
1376
- drawingStartX: left,
1377
- drawingEndX: left + width,
1378
- drawingStartY: top,
1379
- drawingEndY: top + height
1380
- };
1381
- startX <= drawingStartX && drawingEndX <= endX && startY <= drawingStartY && drawingEndY <= endY && containedDrawings.push(drawing);
1382
- });
1383
- const redos = [], undos = [], rowOffset = toRange.startRow - fromRange.startRow, colOffset = toRange.startColumn - fromRange.startColumn, updateDrawings = containedDrawings.map((drawing) => {
1384
- const oldSheetTransform = drawing.sheetTransform, sheetTransform = {
1385
- to: { ...oldSheetTransform.to, row: oldSheetTransform.to.row + rowOffset, column: oldSheetTransform.to.column + colOffset },
1386
- from: { ...oldSheetTransform.from, row: oldSheetTransform.from.row + rowOffset, column: oldSheetTransform.from.column + colOffset }
1387
- }, transform = drawingPositionToTransform(sheetTransform, this._selectionRenderService, this._skeletonManagerService);
1388
- return {
1389
- unitId,
1390
- subUnitId,
1391
- drawingId: drawing.drawingId,
1392
- transform,
1393
- sheetTransform
1394
- };
1395
- });
1396
- if (updateDrawings.length) {
1397
- const updateJsonOp = this._sheetDrawingService.getBatchUpdateOp(updateDrawings), { undo, redo, objects } = updateJsonOp;
1398
- redos.push({ id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: redo, objects, type: DrawingApplyType.UPDATE } }), undos.push({ id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: undo, objects, type: DrawingApplyType.UPDATE } });
1399
- }
1400
- return { redos, undos };
1401
- }
1402
- _moveRowInterceptor(params, type) {
1403
- const ids = this._getUnitIdAndSubUnitId(params, type);
1404
- if (ids == null)
1405
- return { redos: [], undos: [] };
1406
- const { unitId, subUnitId } = ids, { range } = params, rowStartIndex = range.startRow, rowEndIndex = range.endRow, redos = [], undos = [], data = this._sheetDrawingService.getDrawingData(unitId, subUnitId), updateDrawings = [], deleteDrawings = [];
1407
- if (Object.keys(data).forEach((drawingId) => {
1408
- const drawing = data[drawingId], { sheetTransform, transform, anchorType = SheetDrawingAnchorType.Position } = drawing;
1409
- if (sheetTransform == null || transform == null)
1410
- return;
1411
- let newSheetTransform, newTransform;
1412
- if (type === "insert") {
1413
- const param = this._expandRow(sheetTransform, transform, rowStartIndex, rowEndIndex, anchorType);
1414
- newSheetTransform = param == null ? void 0 : param.newSheetTransform, newTransform = param == null ? void 0 : param.newTransform;
1415
- } else {
1416
- const { from, to } = sheetTransform, { row: fromRow } = from, { row: toRow } = to;
1417
- if (anchorType === SheetDrawingAnchorType.Both && fromRow >= rowStartIndex && toRow <= rowEndIndex)
1418
- deleteDrawings.push({ unitId, subUnitId, drawingId });
1419
- else {
1420
- const param = this._shrinkRow(sheetTransform, transform, rowStartIndex, rowEndIndex, anchorType);
1421
- newSheetTransform = param == null ? void 0 : param.newSheetTransform, newTransform = param == null ? void 0 : param.newTransform;
1422
- }
1423
- }
1424
- if (!newSheetTransform || !newTransform)
1425
- return;
1426
- const params2 = { unitId, subUnitId, drawingId, transform: newTransform, sheetTransform: newSheetTransform };
1427
- updateDrawings.push(params2);
1428
- }), updateDrawings.length === 0 && deleteDrawings.length === 0)
1429
- return { redos: [], undos: [] };
1430
- if (updateDrawings.length > 0) {
1431
- const updateJsonOp = this._sheetDrawingService.getBatchUpdateOp(updateDrawings), { undo, redo, objects } = updateJsonOp;
1432
- redos.push({ id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: redo, objects, type: DrawingApplyType.UPDATE } }), undos.push({ id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: undo, objects, type: DrawingApplyType.UPDATE } });
1433
- }
1434
- if (deleteDrawings.length > 0) {
1435
- const deleteJsonOp = this._sheetDrawingService.getBatchRemoveOp(deleteDrawings), deleteUndo = deleteJsonOp.undo, deleteRedo = deleteJsonOp.redo, deleteObjects = deleteJsonOp.objects;
1436
- redos.push({ id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: deleteRedo, objects: deleteObjects, type: DrawingApplyType.REMOVE } }), undos.push({ id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: deleteUndo, objects: deleteObjects, type: DrawingApplyType.INSERT } });
1437
- }
1438
- return redos.push({ id: ClearSheetDrawingTransformerOperation.id, params: [unitId] }), undos.push({ id: ClearSheetDrawingTransformerOperation.id, params: [unitId] }), {
1439
- redos,
1440
- undos
1441
- };
1442
- }
1443
- _moveColInterceptor(params, type) {
1444
- const ids = this._getUnitIdAndSubUnitId(params, type);
1445
- if (ids == null)
1446
- return { redos: [], undos: [] };
1447
- const { unitId, subUnitId } = ids, { range } = params, colStartIndex = range.startColumn, colEndIndex = range.endColumn, redos = [], undos = [], data = this._sheetDrawingService.getDrawingData(unitId, subUnitId), updateDrawings = [], deleteDrawings = [];
1448
- if (Object.keys(data).forEach((drawingId) => {
1449
- const drawing = data[drawingId], { sheetTransform, transform, anchorType = SheetDrawingAnchorType.Position } = drawing;
1450
- if (sheetTransform == null || transform == null)
1451
- return;
1452
- let newSheetTransform, newTransform;
1453
- if (type === "insert") {
1454
- const param = this._expandCol(sheetTransform, transform, colStartIndex, colEndIndex, anchorType);
1455
- newSheetTransform = param == null ? void 0 : param.newSheetTransform, newTransform = param == null ? void 0 : param.newTransform;
1456
- } else {
1457
- const { from, to } = sheetTransform, { column: fromColumn } = from, { column: toColumn } = to;
1458
- if (anchorType === SheetDrawingAnchorType.Both && fromColumn >= colStartIndex && toColumn <= colEndIndex)
1459
- deleteDrawings.push({ unitId, subUnitId, drawingId });
1460
- else {
1461
- const param = this._shrinkCol(sheetTransform, transform, colStartIndex, colEndIndex, anchorType);
1462
- newSheetTransform = param == null ? void 0 : param.newSheetTransform, newTransform = param == null ? void 0 : param.newTransform;
1463
- }
1464
- }
1465
- if (!newSheetTransform || !newTransform)
1466
- return;
1467
- const params2 = { unitId, subUnitId, drawingId, transform: newTransform, sheetTransform: newSheetTransform };
1468
- updateDrawings.push(params2);
1469
- }), updateDrawings.length === 0 && deleteDrawings.length === 0)
1470
- return { redos: [], undos: [] };
1471
- if (updateDrawings.length > 0) {
1472
- const updateJsonOp = this._sheetDrawingService.getBatchUpdateOp(updateDrawings), { undo, redo, objects } = updateJsonOp;
1473
- redos.push({ id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: redo, objects, type: DrawingApplyType.UPDATE } }), undos.push({ id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: undo, objects, type: DrawingApplyType.UPDATE } });
1474
- }
1475
- if (deleteDrawings.length > 0) {
1476
- const deleteJsonOp = this._sheetDrawingService.getBatchRemoveOp(deleteDrawings), deleteUndo = deleteJsonOp.undo, deleteRedo = deleteJsonOp.redo, deleteObjects = deleteJsonOp.objects;
1477
- redos.push({ id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: deleteRedo, objects: deleteObjects, type: DrawingApplyType.REMOVE } }), undos.push({ id: SetDrawingApplyMutation.id, params: { unitId, subUnitId, op: deleteUndo, objects: deleteObjects, type: DrawingApplyType.INSERT } });
1478
- }
1479
- return redos.push({ id: ClearSheetDrawingTransformerOperation.id, params: [unitId] }), undos.push({ id: ClearSheetDrawingTransformerOperation.id, params: [unitId] }), { redos, undos };
1480
- }
1481
- _expandCol(sheetTransform, transform, colStartIndex, colEndIndex, anchorType = SheetDrawingAnchorType.Position) {
1482
- const colCount = colEndIndex - colStartIndex + 1, { from, to } = sheetTransform, { column: fromColumn } = from, { column: toColumn } = to;
1483
- if (anchorType === SheetDrawingAnchorType.None)
1484
- return {
1485
- newSheetTransform: transformToDrawingPosition({ ...transform }, this._selectionRenderService),
1486
- newTransform: transform
1487
- };
1488
- let newSheetTransform = null, newTransform = null;
1489
- if (fromColumn >= colStartIndex) {
1490
- const selectionCell = this._skeletonManagerService.attachRangeWithCoord({ startColumn: colStartIndex, endColumn: colEndIndex, startRow: from.row, endRow: to.row });
1491
- if (selectionCell == null)
1492
- return;
1493
- newTransform = { ...transform, left: (transform.left || 0) + selectionCell.endX - selectionCell.startX }, newSheetTransform = transformToDrawingPosition(newTransform, this._selectionRenderService);
1494
- } else if (toColumn >= colEndIndex)
1495
- if (anchorType === SheetDrawingAnchorType.Both)
1496
- newSheetTransform = {
1497
- from: { ...from },
1498
- to: { ...to, column: toColumn + colCount }
1499
- }, newTransform = drawingPositionToTransform(newSheetTransform, this._selectionRenderService, this._skeletonManagerService);
1500
- else
1501
- return {
1502
- newSheetTransform: transformToDrawingPosition({ ...transform }, this._selectionRenderService),
1503
- newTransform: transform
1504
- };
1505
- return newSheetTransform != null && newTransform != null ? {
1506
- newSheetTransform,
1507
- newTransform
1508
- } : null;
1509
- }
1510
- _shrinkCol(sheetTransform, transform, colStartIndex, colEndIndex, anchorType = SheetDrawingAnchorType.Position) {
1511
- const colCount = colEndIndex - colStartIndex + 1, { from, to } = sheetTransform, { column: fromColumn } = from, { column: toColumn } = to;
1512
- if (anchorType === SheetDrawingAnchorType.None)
1513
- return {
1514
- newSheetTransform: transformToDrawingPosition({ ...transform }, this._selectionRenderService),
1515
- newTransform: transform
1516
- };
1517
- let newSheetTransform = null, newTransform = null;
1518
- if (fromColumn > colEndIndex)
1519
- newSheetTransform = {
1520
- from: { ...from, column: fromColumn - colCount },
1521
- to: { ...to, column: toColumn - colCount }
1522
- }, newTransform = drawingPositionToTransform(newSheetTransform, this._selectionRenderService, this._skeletonManagerService);
1523
- else {
1524
- if (fromColumn >= colStartIndex && toColumn <= colEndIndex)
1525
- return null;
1526
- if (fromColumn < colStartIndex && toColumn > colEndIndex)
1527
- if (anchorType === SheetDrawingAnchorType.Both)
1528
- newSheetTransform = {
1529
- from: { ...from },
1530
- to: { ...to, column: toColumn - colCount }
1531
- }, newTransform = drawingPositionToTransform(newSheetTransform, this._selectionRenderService, this._skeletonManagerService);
1532
- else
1533
- return {
1534
- newSheetTransform: transformToDrawingPosition({ ...transform }, this._selectionRenderService),
1535
- newTransform: transform
1536
- };
1537
- else if (fromColumn >= colStartIndex && fromColumn <= colEndIndex) {
1538
- if (fromColumn === colStartIndex)
1539
- newTransform = { ...transform, left: (transform.left || 0) - sheetTransform.from.columnOffset };
1540
- else {
1541
- const selectionCell = this._skeletonManagerService.attachRangeWithCoord({ startColumn: colStartIndex, endColumn: fromColumn - 1, startRow: from.row, endRow: to.row });
1542
- if (selectionCell == null)
1543
- return;
1544
- newTransform = { ...transform, left: (transform.left || 0) - selectionCell.endX + selectionCell.startX - sheetTransform.from.columnOffset };
1545
- }
1546
- newSheetTransform = transformToDrawingPosition(newTransform, this._selectionRenderService);
1547
- } else if (toColumn >= colStartIndex && toColumn <= colEndIndex && anchorType === SheetDrawingAnchorType.Both) {
1548
- const selectionCell = this._skeletonManagerService.attachRangeWithCoord({
1549
- startColumn: colStartIndex - 1,
1550
- endColumn: colStartIndex - 1,
1551
- startRow: from.row,
1552
- endRow: to.row
1553
- });
1554
- if (selectionCell == null)
1555
- return;
1556
- newSheetTransform = {
1557
- from: { ...from },
1558
- to: { ...to, column: colStartIndex - 1, columnOffset: selectionCell.endX - selectionCell.startX }
1559
- }, newTransform = drawingPositionToTransform(newSheetTransform, this._selectionRenderService, this._skeletonManagerService);
1560
- }
1561
- }
1562
- return newSheetTransform != null && newTransform != null ? {
1563
- newSheetTransform,
1564
- newTransform
1565
- } : null;
1566
- }
1567
- _expandRow(sheetTransform, transform, rowStartIndex, rowEndIndex, anchorType = SheetDrawingAnchorType.Position) {
1568
- const rowCount = rowEndIndex - rowStartIndex + 1, { from, to } = sheetTransform, { row: fromRow } = from, { row: toRow } = to;
1569
- if (anchorType === SheetDrawingAnchorType.None)
1570
- return {
1571
- newSheetTransform: transformToDrawingPosition({ ...transform }, this._selectionRenderService),
1572
- newTransform: transform
1573
- };
1574
- let newSheetTransform = null, newTransform = null;
1575
- if (fromRow >= rowStartIndex) {
1576
- const selectionCell = this._skeletonManagerService.attachRangeWithCoord({ startRow: rowStartIndex, endRow: rowEndIndex, startColumn: from.column, endColumn: to.column });
1577
- if (selectionCell == null)
1578
- return;
1579
- newTransform = { ...transform, top: (transform.top || 0) + selectionCell.endY - selectionCell.startY }, newSheetTransform = transformToDrawingPosition(newTransform, this._selectionRenderService);
1580
- } else if (toRow >= rowEndIndex)
1581
- if (anchorType === SheetDrawingAnchorType.Both)
1582
- newSheetTransform = {
1583
- from: { ...from },
1584
- to: {
1585
- ...to,
1586
- row: toRow + rowCount
1587
- }
1588
- }, newTransform = drawingPositionToTransform(newSheetTransform, this._selectionRenderService, this._skeletonManagerService);
1589
- else
1590
- return {
1591
- newSheetTransform: transformToDrawingPosition({ ...transform }, this._selectionRenderService),
1592
- newTransform: transform
1593
- };
1594
- return newSheetTransform != null && newTransform != null ? {
1595
- newSheetTransform,
1596
- newTransform
1597
- } : null;
1598
- }
1599
- _shrinkRow(sheetTransform, transform, rowStartIndex, rowEndIndex, anchorType = SheetDrawingAnchorType.Position) {
1600
- const rowCount = rowEndIndex - rowStartIndex + 1, { from, to } = sheetTransform, { row: fromRow } = from, { row: toRow } = to;
1601
- if (anchorType === SheetDrawingAnchorType.None)
1602
- return {
1603
- newSheetTransform: transformToDrawingPosition({ ...transform }, this._selectionRenderService),
1604
- newTransform: transform
1605
- };
1606
- let newSheetTransform = null, newTransform = null;
1607
- if (fromRow > rowEndIndex)
1608
- newSheetTransform = {
1609
- from: { ...from, row: fromRow - rowCount },
1610
- to: { ...to, row: toRow - rowCount }
1611
- }, newTransform = drawingPositionToTransform(newSheetTransform, this._selectionRenderService, this._skeletonManagerService);
1612
- else {
1613
- if (fromRow >= rowStartIndex && toRow <= rowEndIndex)
1614
- return null;
1615
- if (fromRow < rowStartIndex && toRow > rowEndIndex)
1616
- if (anchorType === SheetDrawingAnchorType.Both)
1617
- newSheetTransform = {
1618
- from: { ...from },
1619
- to: { ...to, row: toRow - rowCount }
1620
- }, newTransform = drawingPositionToTransform(newSheetTransform, this._selectionRenderService, this._skeletonManagerService);
1621
- else
1622
- return {
1623
- newSheetTransform: transformToDrawingPosition({ ...transform }, this._selectionRenderService),
1624
- newTransform: transform
1625
- };
1626
- else if (fromRow >= rowStartIndex && fromRow <= rowEndIndex) {
1627
- if (fromRow === rowStartIndex)
1628
- newTransform = { ...transform, top: (transform.top || 0) - sheetTransform.from.rowOffset };
1629
- else {
1630
- const selectionCell = this._skeletonManagerService.attachRangeWithCoord({ startRow: rowStartIndex, endRow: fromRow - 1, startColumn: from.column, endColumn: to.column });
1631
- if (selectionCell == null)
1632
- return;
1633
- newTransform = { ...transform, top: (transform.top || 0) - selectionCell.endY + selectionCell.startY - sheetTransform.from.rowOffset };
1634
- }
1635
- newSheetTransform = transformToDrawingPosition(newTransform, this._selectionRenderService);
1636
- } else if (toRow >= rowStartIndex && toRow <= rowEndIndex && anchorType === SheetDrawingAnchorType.Both) {
1637
- const selectionCell = this._skeletonManagerService.attachRangeWithCoord({ startColumn: from.column, endColumn: from.column, startRow: rowStartIndex - 1, endRow: rowStartIndex - 1 });
1638
- if (selectionCell == null)
1639
- return;
1640
- newSheetTransform = {
1641
- from: { ...from },
1642
- to: { ...to, row: rowStartIndex - 1, rowOffset: selectionCell.endY - selectionCell.startY }
1643
- }, newTransform = drawingPositionToTransform(newSheetTransform, this._selectionRenderService, this._skeletonManagerService);
1644
- }
1645
- }
1646
- return newSheetTransform != null && newTransform != null ? {
1647
- newSheetTransform,
1648
- newTransform
1649
- } : null;
1650
- }
1651
- _commandListener() {
1652
- this.disposeWithMe(
1653
- this._commandService.onCommandExecuted((command) => {
1654
- command.id === SetWorksheetActiveOperation.id && setTimeout(() => {
1655
- const params = command.params, { unitId: showUnitId, subUnitId: showSubunitId } = params, drawingMap = this._drawingManagerService.drawingManagerData, insertDrawings = [], removeDrawings = [];
1656
- Object.keys(drawingMap).forEach((unitId) => {
1657
- const subUnitMap = drawingMap[unitId];
1658
- subUnitMap != null && Object.keys(subUnitMap).forEach((subUnitId) => {
1659
- const drawingData = subUnitMap[subUnitId].data;
1660
- drawingData != null && Object.keys(drawingData).forEach((drawingId) => {
1661
- if (unitId === showUnitId && subUnitId === showSubunitId) {
1662
- const drawing = drawingData[drawingId];
1663
- drawing.transform = drawingPositionToTransform(drawing.sheetTransform, this._selectionRenderService, this._skeletonManagerService), insertDrawings.push(drawingData[drawingId]);
1664
- } else
1665
- removeDrawings.push(drawingData[drawingId]);
1666
- });
1667
- });
1668
- }), this._drawingManagerService.removeNotification(removeDrawings), this._drawingManagerService.addNotification(insertDrawings);
1669
- }, 0);
1670
- })
1671
- );
1672
- }
1673
- _sheetRefreshListener() {
1674
- this.disposeWithMe(
1675
- this._commandService.onCommandExecuted((command) => {
1676
- REFRESH_MUTATIONS.includes(command.id) && requestIdleCallback(() => {
1677
- const params = command.params, { unitId, subUnitId, ranges } = params;
1678
- this._refreshDrawingTransform(unitId, subUnitId, ranges);
1679
- });
1680
- })
1681
- );
1682
- }
1683
- _refreshDrawingTransform(unitId, subUnitId, ranges) {
1684
- const drawingData = this._drawingManagerService.getDrawingData(unitId, subUnitId), updateDrawings = [];
1685
- Object.keys(drawingData).forEach((drawingId) => {
1686
- const drawing = drawingData[drawingId], { sheetTransform, transform, anchorType = SheetDrawingAnchorType.Position } = drawing;
1687
- if (anchorType === SheetDrawingAnchorType.None)
1688
- return !0;
1689
- const { from, to } = sheetTransform, { row: fromRow, column: fromColumn } = from, { row: toRow, column: toColumn } = to;
1690
- for (let i = 0; i < ranges.length; i++) {
1691
- const range = ranges[i], { startRow, endRow, startColumn, endColumn } = range;
1692
- if (Rectangle.intersects(
1693
- {
1694
- startRow,
1695
- endRow,
1696
- startColumn,
1697
- endColumn
1698
- },
1699
- {
1700
- startRow: fromRow,
1701
- endRow: toRow,
1702
- startColumn: fromColumn,
1703
- endColumn: toColumn
1704
- }
1705
- ) || fromRow > endRow || fromColumn > endColumn) {
1706
- const isPositionAnchor = anchorType === SheetDrawingAnchorType.Position, newTransform = drawingPositionToTransform(sheetTransform, this._selectionRenderService, this._skeletonManagerService);
1707
- updateDrawings.push({
1708
- ...drawing,
1709
- transform: {
1710
- ...newTransform,
1711
- width: isPositionAnchor ? transform == null ? void 0 : transform.width : newTransform == null ? void 0 : newTransform.width,
1712
- height: isPositionAnchor ? transform == null ? void 0 : transform.height : newTransform == null ? void 0 : newTransform.height
1713
- }
1714
- });
1715
- break;
1716
- }
1717
- }
1718
- }), updateDrawings.length !== 0 && (this._drawingManagerService.refreshTransform(updateDrawings), this._commandService.syncExecuteCommand(ClearSheetDrawingTransformerOperation.id, [unitId]));
1719
- }
1720
- }, __name(_a4, "SheetDrawingTransformAffectedController"), _a4);
1721
- SheetDrawingTransformAffectedController = __decorateClass$6([
1722
- __decorateParam$6(1, IRenderManagerService),
1723
- __decorateParam$6(2, ICommandService),
1724
- __decorateParam$6(3, ISheetSelectionRenderService),
1725
- __decorateParam$6(4, Inject(SheetSkeletonManagerService)),
1726
- __decorateParam$6(5, Inject(SheetInterceptorService)),
1727
- __decorateParam$6(6, ISheetDrawingService),
1728
- __decorateParam$6(7, IDrawingManagerService),
1729
- __decorateParam$6(8, IUniverInstanceService)
1730
- ], SheetDrawingTransformAffectedController);
1731
- var __defProp$5 = Object.defineProperty, __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor, __decorateClass$5 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
1732
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
1733
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
1734
- return kind && result && __defProp$5(target, key, result), result;
1735
- }, "__decorateClass$5"), __decorateParam$5 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$5");
1736
- function transformBound2DOMBound(originBound, scene, skeleton, worksheet) {
1737
- const { scaleX, scaleY } = scene.getAncestorScale(), viewMain = scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_MAIN), absolute = {
1738
- left: !0,
1739
- top: !0
1740
- };
1741
- if (!viewMain)
1742
- return {
1743
- ...originBound,
1744
- absolute
1745
- };
1746
- const { left, right, top, bottom } = originBound, freeze = worksheet.getFreeze(), { startColumn, startRow, xSplit, ySplit } = freeze, startSheetView = skeleton.getNoMergeCellPositionByIndexWithNoHeader(startRow - ySplit, startColumn - xSplit), endSheetView = skeleton.getNoMergeCellPositionByIndexWithNoHeader(startRow, startColumn), { rowHeaderWidth, columnHeaderHeight } = skeleton, freezeWidth = endSheetView.startX - startSheetView.startX, freezeHeight = endSheetView.startY - startSheetView.startY, { top: freezeTop, left: freezeLeft, viewportScrollX: actualScrollX, viewportScrollY: actualScrollY } = viewMain;
1747
- let offsetLeft, offsetRight;
1748
- left < freezeLeft ? (absolute.left = !0, offsetLeft = (freezeWidth + rowHeaderWidth + (left - freezeLeft)) * scaleX, offsetRight = Math.max(
1749
- Math.min(
1750
- (freezeWidth + rowHeaderWidth + (right - freezeLeft)) * scaleX,
1751
- (freezeWidth + rowHeaderWidth) * scaleX
1752
- ),
1753
- (right - actualScrollX) * scaleX
1754
- )) : (absolute.left = !1, offsetLeft = Math.max((left - actualScrollX) * scaleX, (freezeWidth + rowHeaderWidth) * scaleX), offsetRight = Math.max((right - actualScrollX) * scaleX, (freezeWidth + rowHeaderWidth) * scaleX));
1755
- let offsetTop, offsetBottom;
1756
- return top < freezeTop ? (absolute.top = !0, offsetTop = (freezeHeight + columnHeaderHeight + (top - freezeTop)) * scaleY, offsetBottom = Math.max(
1757
- Math.min(
1758
- (freezeHeight + columnHeaderHeight + (right - freezeTop)) * scaleY,
1759
- (freezeHeight + columnHeaderHeight) * scaleY
1760
- ),
1761
- (bottom - actualScrollY) * scaleY
1762
- )) : (absolute.top = !1, offsetTop = Math.max((top - actualScrollY) * scaleY, (freezeHeight + columnHeaderHeight) * scaleY), offsetBottom = Math.max((bottom - actualScrollY) * scaleY, (freezeHeight + columnHeaderHeight) * scaleY)), {
1763
- left: offsetLeft,
1764
- right: offsetRight,
1765
- top: offsetTop,
1766
- bottom: offsetBottom,
1767
- absolute
1768
- };
1769
- }
1770
- __name(transformBound2DOMBound, "transformBound2DOMBound");
1771
- const calcPosition = /* @__PURE__ */ __name((targetObject, currentRender, skeleton, worksheet) => {
1772
- const { scene } = currentRender, { left, top, width, height, angle } = targetObject, bound = {
1773
- left,
1774
- right: left + width,
1775
- top,
1776
- bottom: top + height
1777
- }, offsetBound = transformBound2DOMBound(bound, scene, skeleton, worksheet), { scaleX, scaleY } = scene.getAncestorScale();
1778
- return {
1779
- startX: offsetBound.left,
1780
- endX: offsetBound.right,
1781
- startY: offsetBound.top,
1782
- endY: offsetBound.bottom,
1783
- rotate: angle,
1784
- width: width * scaleX,
1785
- height: height * scaleY,
1786
- absolute: offsetBound.absolute
1787
- };
1788
- }, "calcPosition");
1789
- var _a5;
1790
- let SheetCanvasFloatDomManagerService = (_a5 = class extends Disposable {
1791
- constructor(_renderManagerService, _univerInstanceService, _commandService, _drawingManagerService, _canvasFloatDomService, _sheetDrawingService) {
1792
- super();
1793
- __publicField(this, "_domLayerMap", /* @__PURE__ */ new Map());
1794
- __publicField(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
1795
- __publicField(this, "_transformChange$", new Subject());
1796
- __publicField(this, "transformChange$", this._transformChange$.asObservable());
1797
- __publicField(this, "_remove$", new Subject());
1798
- __publicField(this, "remove$", this._remove$.asObservable());
1799
- __publicField(this, "_hooks", []);
1800
- this._renderManagerService = _renderManagerService, this._univerInstanceService = _univerInstanceService, this._commandService = _commandService, this._drawingManagerService = _drawingManagerService, this._canvasFloatDomService = _canvasFloatDomService, this._sheetDrawingService = _sheetDrawingService, this._drawingAddListener(), this._scrollUpdateListener(), this._featureUpdateListener(), this._deleteListener();
1801
- }
1802
- _ensureMap(unitId, subUnitId) {
1803
- let unitMap = this._domLayerMap.get(unitId);
1804
- unitMap || (unitMap = /* @__PURE__ */ new Map(), this._domLayerMap.set(unitId, unitMap));
1805
- let subUnitMap = unitMap.get(subUnitId);
1806
- return subUnitMap || (subUnitMap = /* @__PURE__ */ new Map(), unitMap.set(subUnitId, subUnitMap)), subUnitMap;
1807
- }
1808
- _getSceneAndTransformerByDrawingSearch(unitId) {
1809
- if (unitId == null)
1810
- return;
1811
- const renderObject = this._renderManagerService.getRenderById(unitId), scene = renderObject == null ? void 0 : renderObject.scene;
1812
- if (renderObject == null || scene == null)
1813
- return null;
1814
- const transformer = scene.getTransformerByCreate(), canvas = renderObject.engine.getCanvasElement();
1815
- return { scene, transformer, renderObject, canvas };
1816
- }
1817
- _getFloatDomProps(id) {
1818
- let props;
1819
- return this._hooks.forEach((hook) => {
1820
- props = hook.onGetFloatDomProps(id);
1821
- }), props;
1822
- }
1823
- // eslint-disable-next-line max-lines-per-function
1824
- _drawingAddListener() {
1825
- this.disposeWithMe(
1826
- // eslint-disable-next-line max-lines-per-function
1827
- this._drawingManagerService.add$.subscribe((params) => {
1828
- params.forEach((param) => {
1829
- var _a11, _b, _c;
1830
- const { unitId, subUnitId, drawingId } = param, target = getSheetCommandTarget(this._univerInstanceService, { unitId, subUnitId }), floatDomParam = this._drawingManagerService.getDrawingByParam(param);
1831
- if (!floatDomParam || !target)
1832
- return;
1833
- const skeleton = (_a11 = this._renderManagerService.getRenderById(unitId)) == null ? void 0 : _a11.with(SheetSkeletonManagerService).getWorksheetSkeleton(subUnitId);
1834
- if (!skeleton)
1835
- return;
1836
- const { transform, drawingType, data } = floatDomParam;
1837
- if (drawingType !== DrawingTypeEnum$1.DRAWING_DOM)
1838
- return;
1839
- const renderObject = this._getSceneAndTransformerByDrawingSearch(unitId);
1840
- if (renderObject == null)
1841
- return;
1842
- const { scene, canvas } = renderObject;
1843
- if (transform == null)
1844
- return !0;
1845
- const { left, top, width, height, angle, flipX, flipY, skewX, skewY } = transform, rectShapeKey = getDrawingShapeKeyByDrawingSearch({ unitId, subUnitId, drawingId }), rectShape = scene.getObject(rectShapeKey);
1846
- if (rectShape != null) {
1847
- rectShape.transformByState({ left, top, width, height, angle, flipX, flipY, skewX, skewY });
1848
- return;
1849
- }
1850
- const imageConfig = {
1851
- left,
1852
- top,
1853
- width,
1854
- height,
1855
- zIndex: this._drawingManagerService.getDrawingOrder(unitId, subUnitId).length - 1
1856
- }, rect = new Rect(rectShapeKey, imageConfig);
1857
- scene.addObject(rect, DRAWING_OBJECT_LAYER_INDEX), floatDomParam.allowTransform !== !1 && scene.attachTransformerTo(rect);
1858
- const map2 = this._ensureMap(unitId, subUnitId), disposableCollection = new DisposableCollection(), initPosition = calcPosition(rect, renderObject.renderObject, skeleton.skeleton, target.worksheet), position$ = new BehaviorSubject(initPosition), info = {
1859
- dispose: disposableCollection,
1860
- rect,
1861
- position$,
1862
- unitId,
1863
- subUnitId
1864
- };
1865
- this._canvasFloatDomService.addFloatDom({
1866
- position$,
1867
- id: drawingId,
1868
- componentKey: floatDomParam.componentKey,
1869
- onPointerDown: /* @__PURE__ */ __name((evt) => {
1870
- canvas.dispatchEvent(new PointerEvent(evt.type, evt));
1871
- }, "onPointerDown"),
1872
- onPointerMove: /* @__PURE__ */ __name((evt) => {
1873
- canvas.dispatchEvent(new PointerEvent(evt.type, evt));
1874
- }, "onPointerMove"),
1875
- onPointerUp: /* @__PURE__ */ __name((evt) => {
1876
- canvas.dispatchEvent(new PointerEvent(evt.type, evt));
1877
- }, "onPointerUp"),
1878
- onWheel: /* @__PURE__ */ __name((evt) => {
1879
- canvas.dispatchEvent(new WheelEvent(evt.type, evt));
1880
- }, "onWheel"),
1881
- props: (_c = (_b = map2.get(drawingId)) == null ? void 0 : _b.props) != null ? _c : this._getFloatDomProps(drawingId),
1882
- data,
1883
- unitId
1884
- });
1885
- const listener = rect.onTransformChange$.subscribeEvent(() => {
1886
- const newPosition = calcPosition(rect, renderObject.renderObject, skeleton.skeleton, target.worksheet);
1887
- position$.next(
1888
- newPosition
1889
- );
1890
- });
1891
- disposableCollection.add(() => {
1892
- this._canvasFloatDomService.removeFloatDom(drawingId);
1893
- }), listener && disposableCollection.add(listener), this._domLayerInfoMap.set(drawingId, info), map2.set(drawingId, {
1894
- ...map2.get(drawingId)
1895
- });
1896
- });
1897
- })
1898
- );
1899
- }
1900
- _scrollUpdateListener() {
1901
- this.disposeWithMe(this._commandService.onCommandExecuted((commandInfo) => {
1902
- var _a11, _b;
1903
- const updateSheet = /* @__PURE__ */ __name((unitId, subUnitId) => {
1904
- var _a12;
1905
- const renderObject = this._getSceneAndTransformerByDrawingSearch(unitId), map2 = this._ensureMap(unitId, subUnitId), ids = Array.from(map2.keys()), target = getSheetCommandTarget(this._univerInstanceService, { unitId, subUnitId }), skeleton = (_a12 = this._renderManagerService.getRenderById(unitId)) == null ? void 0 : _a12.with(SheetSkeletonManagerService).getWorksheetSkeleton(subUnitId);
1906
- !renderObject || !target || !skeleton || ids.forEach((id) => {
1907
- const info = this._domLayerInfoMap.get(id);
1908
- if (info) {
1909
- const position = calcPosition(info.rect, renderObject.renderObject, skeleton.skeleton, target.worksheet);
1910
- info.position$.next(position);
1911
- }
1912
- });
1913
- }, "updateSheet");
1914
- if (commandInfo.id === SetScrollOperation.id) {
1915
- const params = commandInfo.params, { unitId, sheetId } = params;
1916
- updateSheet(unitId, sheetId);
1917
- } else if (commandInfo.id === SetZoomRatioOperation.id) {
1918
- const params = commandInfo.params, { unitId } = params;
1919
- Array.from((_b = (_a11 = this._domLayerMap.get(unitId)) == null ? void 0 : _a11.keys()) != null ? _b : []).forEach((subUnitId) => {
1920
- updateSheet(unitId, subUnitId);
1921
- });
1922
- } else if (commandInfo.id === SetFrozenMutation.id) {
1923
- const { unitId, subUnitId } = commandInfo.params;
1924
- updateSheet(unitId, subUnitId);
1925
- }
1926
- }));
1927
- }
1928
- _getPosition(position, unitId) {
1929
- var _a11;
1930
- const { startX, endX, startY, endY } = position, selectionRenderService = (_a11 = this._renderManagerService.getRenderById(unitId)) == null ? void 0 : _a11.with(ISheetSelectionRenderService);
1931
- if (selectionRenderService == null)
1932
- return;
1933
- const start = selectionRenderService.getSelectionCellByPosition(startX, startY);
1934
- if (start == null)
1935
- return;
1936
- const from = {
1937
- column: start.actualColumn,
1938
- columnOffset: startX - start.startX,
1939
- row: start.actualRow,
1940
- rowOffset: startY - start.startY
1941
- }, end = selectionRenderService.getSelectionCellByPosition(endX, endY);
1942
- if (end == null)
1943
- return;
1944
- const to = {
1945
- column: end.actualColumn,
1946
- columnOffset: endX - end.startX,
1947
- row: end.actualRow,
1948
- rowOffset: endY - end.startY
1949
- };
1950
- return {
1951
- from,
1952
- to
1953
- };
1954
- }
1955
- _featureUpdateListener() {
1956
- this.disposeWithMe(
1957
- this._drawingManagerService.update$.subscribe((params) => {
1958
- params.forEach((data) => {
1959
- const sheetDrawing = this._drawingManagerService.getDrawingByParam(data);
1960
- if (!sheetDrawing || sheetDrawing.drawingType !== DrawingTypeEnum$1.DRAWING_DOM)
1961
- return;
1962
- const newValue = {
1963
- ...sheetDrawing.transform
1964
- };
1965
- this._transformChange$.next({ id: data.drawingId, value: newValue });
1966
- });
1967
- })
1968
- );
1969
- }
1970
- _deleteListener() {
1971
- this.disposeWithMe(
1972
- this._drawingManagerService.remove$.subscribe((params) => {
1973
- params.forEach((param) => {
1974
- this._removeDom(param.drawingId);
1975
- });
1976
- })
1977
- );
1978
- }
1979
- addFloatDomToPosition(layer, propId) {
1980
- const target = getSheetCommandTarget(this._univerInstanceService, {
1981
- unitId: layer.unitId,
1982
- subUnitId: layer.subUnitId
1983
- });
1984
- if (!target)
1985
- throw new Error("cannot find current target!");
1986
- const { unitId, subUnitId } = target, { initPosition, componentKey, data, allowTransform = !0 } = layer, id = propId != null ? propId : generateRandomId(), sheetTransform = this._getPosition(initPosition, unitId);
1987
- if (sheetTransform == null)
1988
- return;
1989
- this._ensureMap(unitId, subUnitId).set(id, layer);
1990
- const sheetDrawingParam = {
1991
- unitId,
1992
- subUnitId,
1993
- drawingId: id,
1994
- drawingType: DrawingTypeEnum$1.DRAWING_DOM,
1995
- componentKey,
1996
- sheetTransform,
1997
- transform: {
1998
- left: initPosition.startX,
1999
- top: initPosition.startY,
2000
- width: initPosition.endX - initPosition.startX,
2001
- height: initPosition.endY - initPosition.startY
2002
- },
2003
- data,
2004
- allowTransform
2005
- };
2006
- return this._commandService.executeCommand(InsertSheetDrawingCommand.id, {
2007
- unitId,
2008
- drawings: [sheetDrawingParam]
2009
- }), {
2010
- id,
2011
- dispose: /* @__PURE__ */ __name(() => {
2012
- this._removeDom(id, !0);
2013
- }, "dispose")
2014
- };
2015
- }
2016
- _removeDom(id, removeDrawing = !1) {
2017
- const info = this._domLayerInfoMap.get(id);
2018
- if (!info)
2019
- return;
2020
- const { unitId, subUnitId } = info;
2021
- this._domLayerInfoMap.delete(id), info.dispose.dispose();
2022
- const renderObject = this._getSceneAndTransformerByDrawingSearch(unitId);
2023
- if (renderObject && renderObject.scene.removeObject(info.rect), removeDrawing) {
2024
- this._ensureMap(unitId, subUnitId).delete(id);
2025
- const param = this._drawingManagerService.getDrawingByParam({ unitId, subUnitId, drawingId: id });
2026
- if (!param)
2027
- return;
2028
- const jsonOp = this._sheetDrawingService.getBatchRemoveOp([param]), { redo, objects } = jsonOp;
2029
- this._commandService.syncExecuteCommand(SetDrawingApplyMutation.id, { unitId, subUnitId, op: redo, objects, type: DrawingApplyType.REMOVE });
2030
- }
2031
- }
2032
- addHook(hook) {
2033
- return this._hooks.push(hook), {
2034
- dispose: /* @__PURE__ */ __name(() => {
2035
- const index = this._hooks.findIndex((h) => h === hook);
2036
- this._hooks.splice(index, 1);
2037
- }, "dispose")
2038
- };
2039
- }
2040
- }, __name(_a5, "SheetCanvasFloatDomManagerService"), _a5);
2041
- SheetCanvasFloatDomManagerService = __decorateClass$5([
2042
- OnLifecycle(LifecycleStages.Starting, SheetCanvasFloatDomManagerService),
2043
- __decorateParam$5(0, Inject(IRenderManagerService)),
2044
- __decorateParam$5(1, IUniverInstanceService),
2045
- __decorateParam$5(2, Inject(ICommandService)),
2046
- __decorateParam$5(3, IDrawingManagerService),
2047
- __decorateParam$5(4, Inject(CanvasFloatDomService)),
2048
- __decorateParam$5(5, ISheetDrawingService)
2049
- ], SheetCanvasFloatDomManagerService);
2050
- var __defProp$4 = Object.defineProperty, __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor, __decorateClass$4 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
2051
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
2052
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
2053
- return kind && result && __defProp$4(target, key, result), result;
2054
- }, "__decorateClass$4"), __decorateParam$4 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$4"), _a6;
2055
- let SheetDrawingPrintingController = (_a6 = class extends Disposable {
2056
- constructor(_sheetPrintInterceptorService, _drawingRenderService, _drawingManagerService, _renderManagerService) {
2057
- super(), this._sheetPrintInterceptorService = _sheetPrintInterceptorService, this._drawingRenderService = _drawingRenderService, this._drawingManagerService = _drawingManagerService, this._renderManagerService = _renderManagerService, this._initPrinting();
2058
- }
2059
- _initPrinting() {
2060
- this.disposeWithMe(
2061
- this._sheetPrintInterceptorService.interceptor.intercept(
2062
- this._sheetPrintInterceptorService.interceptor.getInterceptPoints().PRINTING_COMPONENT_COLLECT,
2063
- {
2064
- handler: /* @__PURE__ */ __name((_param, pos, next) => {
2065
- const { unitId, scene, subUnitId } = pos, unitData = this._drawingManagerService.getDrawingDataForUnit(unitId), subUnitData = unitData == null ? void 0 : unitData[subUnitId];
2066
- return subUnitData && subUnitData.order.forEach((id) => {
2067
- this._drawingRenderService.renderDrawing(subUnitData.data[id], scene);
2068
- }), next();
2069
- }, "handler")
2070
- }
2071
- )
2072
- ), this.disposeWithMe(
2073
- this._sheetPrintInterceptorService.interceptor.intercept(
2074
- this._sheetPrintInterceptorService.interceptor.getInterceptPoints().PRINTING_RANGE,
2075
- {
2076
- handler: /* @__PURE__ */ __name((range, pos, next) => {
2077
- const { unitId, subUnitId } = pos, renderer = this._renderManagerService.getRenderById(unitId);
2078
- if (!renderer)
2079
- return next(range);
2080
- const skeleton = renderer.with(SheetSkeletonManagerService).getWorksheetSkeleton(subUnitId);
2081
- if (!skeleton)
2082
- return next(range);
2083
- const unitData = this._drawingManagerService.getDrawingDataForUnit(unitId), subUnitData = unitData == null ? void 0 : unitData[pos.subUnitId];
2084
- if (!subUnitData)
2085
- return next(range);
2086
- const { scaleX, scaleY } = renderer.scene, newRange = range ? { ...range } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, data = subUnitData.order.map((key) => subUnitData.data[key]).filter((item) => item.drawingType !== DrawingTypeEnum.DRAWING_DOM);
2087
- return data.length ? (data.forEach((param) => {
2088
- if (!param.groupId && param.transform && Tools.isDefine(param.transform.left) && Tools.isDefine(param.transform.top) && Tools.isDefine(param.transform.width) && Tools.isDefine(param.transform.height)) {
2089
- const start = skeleton.skeleton.getCellPositionByOffset(param.transform.left, param.transform.top, scaleX, scaleY, { x: 0, y: 0 }), end = skeleton.skeleton.getCellPositionByOffset(param.transform.left + param.transform.width, param.transform.top + param.transform.height, scaleX, scaleY, { x: 0, y: 0 });
2090
- start.column < newRange.startColumn && (newRange.startColumn = start.column), start.row < newRange.startRow && (newRange.startRow = start.row), newRange.endRow < end.row && (newRange.endRow = end.row), newRange.endColumn < end.column && (newRange.endColumn = end.column);
2091
- }
2092
- }), next(newRange)) : next(range);
2093
- }, "handler")
2094
- }
2095
- )
2096
- );
2097
- }
2098
- }, __name(_a6, "SheetDrawingPrintingController"), _a6);
2099
- SheetDrawingPrintingController = __decorateClass$4([
2100
- OnLifecycle(LifecycleStages.Rendered, SheetDrawingPrintingController),
2101
- __decorateParam$4(0, Inject(SheetPrintInterceptorService)),
2102
- __decorateParam$4(1, Inject(DrawingRenderService)),
2103
- __decorateParam$4(2, IDrawingManagerService),
2104
- __decorateParam$4(3, IRenderManagerService)
2105
- ], SheetDrawingPrintingController);
2106
- var __defProp$3 = Object.defineProperty, __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor, __decorateClass$3 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
2107
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
2108
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
2109
- return kind && result && __defProp$3(target, key, result), result;
2110
- }, "__decorateClass$3"), __decorateParam$3 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$3"), _a7;
2111
- let SheetDrawingPermissionController = (_a7 = class extends Disposable {
2112
- constructor(_drawingManagerService, _renderManagerService, _permissionService, _univerInstanceService, _userManagerService) {
2113
- super(), this._drawingManagerService = _drawingManagerService, this._renderManagerService = _renderManagerService, this._permissionService = _permissionService, this._univerInstanceService = _univerInstanceService, this._userManagerService = _userManagerService, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
2114
- }
2115
- _initDrawingVisible() {
2116
- const workbook$ = this._univerInstanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SHEET);
2117
- this.disposeWithMe(
2118
- combineLatest([workbook$, this._userManagerService.currentUser$]).subscribe(([workbook, _]) => {
2119
- if (!workbook) {
2120
- this._drawingManagerService.setDrawingVisible(!1);
2121
- return;
2122
- }
2123
- workbook.activeSheet$.subscribe((sheet) => {
2124
- if (!sheet) {
2125
- this._drawingManagerService.setDrawingVisible(!1);
2126
- return;
2127
- }
2128
- const unitId = workbook.getUnitId(), subUnitId = sheet.getSheetId();
2129
- if (this._permissionService.composePermission([new WorkbookViewPermission(unitId).id, new WorksheetViewPermission(unitId, subUnitId).id]).every((permission) => permission.value))
2130
- this._drawingManagerService.setDrawingVisible(!0);
2131
- else {
2132
- this._drawingManagerService.setDrawingVisible(!1);
2133
- const unitId2 = workbook.getUnitId(), subUnitId2 = sheet.getSheetId(), drawingData = this._drawingManagerService.getDrawingData(unitId2, subUnitId2), drawingDataValues = Object.values(drawingData), renderObject = this._renderManagerService.getRenderById(unitId2), scene = renderObject == null ? void 0 : renderObject.scene;
2134
- if (scene == null)
2135
- return;
2136
- scene.getAllObjectsByOrder().forEach((object) => {
2137
- object.classType === RENDER_CLASS_TYPE.IMAGE && drawingDataValues.some((item) => object.oKey.includes(item.drawingId)) && scene.removeObject(object);
2138
- });
2139
- }
2140
- });
2141
- })
2142
- );
2143
- }
2144
- _initDrawingEditable() {
2145
- const workbook$ = this._univerInstanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SHEET);
2146
- this.disposeWithMe(
2147
- combineLatest([workbook$, this._userManagerService.currentUser$]).subscribe(([workbook, _]) => {
2148
- if (!workbook) {
2149
- this._drawingManagerService.setDrawingEditable(!1);
2150
- return;
2151
- }
2152
- workbook.activeSheet$.subscribe((sheet) => {
2153
- if (!sheet) {
2154
- this._drawingManagerService.setDrawingEditable(!1);
2155
- return;
2156
- }
2157
- const unitId = workbook.getUnitId(), subUnitId = sheet.getSheetId();
2158
- if (this._permissionService.composePermission([new WorkbookEditablePermission(unitId).id, new WorksheetEditPermission(unitId, subUnitId).id]).every((permission) => permission.value))
2159
- this._drawingManagerService.setDrawingEditable(!0);
2160
- else {
2161
- this._drawingManagerService.setDrawingEditable(!1);
2162
- const unitId2 = workbook.getUnitId(), subUnitId2 = sheet.getSheetId(), drawingData = this._drawingManagerService.getDrawingData(unitId2, subUnitId2), drawingDataValues = Object.values(drawingData), renderObject = this._renderManagerService.getRenderById(unitId2), scene = renderObject == null ? void 0 : renderObject.scene;
2163
- if (scene == null)
2164
- return;
2165
- scene.getAllObjectsByOrder().forEach((object) => {
2166
- object.classType === RENDER_CLASS_TYPE.IMAGE && drawingDataValues.some((item) => object.oKey.includes(item.drawingId)) && scene.detachTransformerFrom(object);
2167
- });
2168
- }
2169
- });
2170
- })
2171
- );
2172
- }
2173
- _initViewPermissionChange() {
2174
- const workbook$ = this._univerInstanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SHEET);
2175
- this.disposeWithMe(
2176
- combineLatest([workbook$, this._userManagerService.currentUser$]).subscribe(([workbook, _]) => {
2177
- workbook && workbook.activeSheet$.subscribe((sheet) => {
2178
- var _a11;
2179
- if (!sheet)
2180
- return;
2181
- const unitId = workbook.getUnitId(), subUnitId = sheet.getSheetId();
2182
- let initialViewPermission = !0;
2183
- const renderObject = this._renderManagerService.getRenderById(unitId), scene = renderObject == null ? void 0 : renderObject.scene;
2184
- if (scene == null)
2185
- return;
2186
- const transformer = scene.getTransformerByCreate(), worksheetViewPermission$ = this._permissionService.composePermission$([new WorkbookViewPermission(unitId).id, new WorksheetViewPermission(unitId, subUnitId).id]).pipe(map((permissions) => permissions.every((item) => item.value)));
2187
- worksheetViewPermission$ == null || worksheetViewPermission$.pipe(
2188
- filter((permission) => permission !== initialViewPermission),
2189
- distinctUntilChanged()
2190
- ).subscribe({
2191
- next: /* @__PURE__ */ __name((permission) => {
2192
- initialViewPermission = permission, this._drawingManagerService.setDrawingVisible(permission);
2193
- const objects = scene.getAllObjectsByOrder(), drawingData = this._drawingManagerService.getDrawingData(unitId, subUnitId), drawingDataValues = Object.values(drawingData);
2194
- permission ? this._drawingManagerService.addNotification(drawingDataValues) : (objects.forEach((object) => {
2195
- object.classType === RENDER_CLASS_TYPE.IMAGE && drawingDataValues.some((item) => object.oKey.includes(item.drawingId)) && scene.removeObject(object);
2196
- }), transformer.clearSelectedObjects());
2197
- }, "next")
2198
- }), (_a11 = this._permissionService.getPermissionPoint$(new WorksheetViewPermission(unitId, subUnitId).id)) == null || _a11.pipe(
2199
- filter((permission) => permission.value !== initialViewPermission),
2200
- distinctUntilChanged()
2201
- ).subscribe({
2202
- complete: /* @__PURE__ */ __name(() => {
2203
- initialViewPermission = !0, this._drawingManagerService.setDrawingVisible(!0);
2204
- const drawingData = this._drawingManagerService.getDrawingData(unitId, subUnitId), drawingDataValues = Object.values(drawingData);
2205
- this._drawingManagerService.addNotification(drawingDataValues);
2206
- }, "complete")
2207
- });
2208
- });
2209
- })
2210
- );
2211
- }
2212
- _initEditPermissionChange() {
2213
- const workbook$ = this._univerInstanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SHEET);
2214
- this.disposeWithMe(
2215
- combineLatest([workbook$, this._userManagerService.currentUser$]).subscribe(([workbook, _]) => {
2216
- workbook && workbook.activeSheet$.subscribe((sheet) => {
2217
- var _a11;
2218
- if (!sheet)
2219
- return;
2220
- const unitId = workbook.getUnitId(), subUnitId = sheet.getSheetId();
2221
- let initialEditPermission = !0;
2222
- const renderObject = this._renderManagerService.getRenderById(unitId), scene = renderObject == null ? void 0 : renderObject.scene;
2223
- if (scene == null)
2224
- return;
2225
- const transformer = scene.getTransformerByCreate(), composeWorksheetEditPermission = this._permissionService.composePermission$([new WorkbookEditablePermission(unitId).id, new WorksheetEditPermission(unitId, subUnitId).id]).pipe(map((permissions) => permissions.every((item) => item.value)));
2226
- composeWorksheetEditPermission == null || composeWorksheetEditPermission.pipe(
2227
- filter((permission) => permission !== initialEditPermission),
2228
- distinctUntilChanged()
2229
- ).subscribe({
2230
- next: /* @__PURE__ */ __name((permission) => {
2231
- initialEditPermission = permission, this._drawingManagerService.setDrawingEditable(permission);
2232
- const objects = scene.getAllObjectsByOrder(), drawingData = this._drawingManagerService.getDrawingData(unitId, subUnitId), drawingDataValues = Object.values(drawingData);
2233
- permission ? (objects.forEach((object) => {
2234
- object.classType === RENDER_CLASS_TYPE.IMAGE && drawingDataValues.some((item) => object.oKey.includes(item.drawingId)) && scene.attachTransformerTo(object);
2235
- }), this._drawingManagerService.addNotification(drawingDataValues)) : (objects.forEach((object) => {
2236
- object.classType === RENDER_CLASS_TYPE.IMAGE && drawingDataValues.some((item) => object.oKey.includes(item.drawingId)) && scene.detachTransformerFrom(object);
2237
- }), transformer.clearSelectedObjects());
2238
- }, "next")
2239
- }), (_a11 = this._permissionService.getPermissionPoint$(new WorksheetEditPermission(unitId, subUnitId).id)) == null || _a11.pipe(
2240
- filter((permission) => permission.value !== initialEditPermission),
2241
- distinctUntilChanged()
2242
- ).subscribe({
2243
- complete: /* @__PURE__ */ __name(() => {
2244
- initialEditPermission = !0;
2245
- const unitId2 = workbook.getUnitId(), subUnitId2 = sheet.getSheetId(), drawingData = this._drawingManagerService.getDrawingData(unitId2, subUnitId2), drawingDataValues = Object.values(drawingData), renderObject2 = this._renderManagerService.getRenderById(unitId2), scene2 = renderObject2 == null ? void 0 : renderObject2.scene;
2246
- if (scene2 == null)
2247
- return;
2248
- this._drawingManagerService.setDrawingEditable(!0), scene2.getAllObjectsByOrder().forEach((object) => {
2249
- object.classType === RENDER_CLASS_TYPE.IMAGE && drawingDataValues.some((item) => object.oKey.includes(item.drawingId)) && scene2.detachTransformerFrom(object);
2250
- });
2251
- }, "complete")
2252
- });
2253
- });
2254
- })
2255
- );
2256
- }
2257
- }, __name(_a7, "SheetDrawingPermissionController"), _a7);
2258
- SheetDrawingPermissionController = __decorateClass$3([
2259
- OnLifecycle(LifecycleStages.Rendered, SheetDrawingPermissionController),
2260
- __decorateParam$3(0, IDrawingManagerService),
2261
- __decorateParam$3(1, IRenderManagerService),
2262
- __decorateParam$3(2, IPermissionService),
2263
- __decorateParam$3(3, IUniverInstanceService),
2264
- __decorateParam$3(4, Inject(UserManagerService))
2265
- ], SheetDrawingPermissionController);
2266
- var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor, __decorateClass$2 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
2267
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
2268
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
2269
- return kind && result && __defProp$2(target, key, result), result;
2270
- }, "__decorateClass$2"), __decorateParam$2 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$2"), _a8;
2271
- let SheetsDrawingCopyPasteController = (_a8 = class extends Disposable {
2272
- constructor(_sheetClipboardService, _renderManagerService, _sheetDrawingService) {
2273
- super();
2274
- __publicField(this, "_copyInfo");
2275
- this._sheetClipboardService = _sheetClipboardService, this._renderManagerService = _renderManagerService, this._sheetDrawingService = _sheetDrawingService, this._initCopyPaste();
2276
- }
2277
- _initCopyPaste() {
2278
- this._sheetClipboardService.addClipboardHook({
2279
- id: "SHEET_IMAGE_UI_PLUGIN",
2280
- onBeforeCopy: /* @__PURE__ */ __name((unitId, subUnitId, range) => this._collect(unitId, subUnitId, range), "onBeforeCopy"),
2281
- onPasteCells: /* @__PURE__ */ __name((pasteFrom, pasteTo, data, payload) => {
2282
- const { copyType = COPY_TYPE.COPY, pasteType } = payload, { range: copyRange } = pasteFrom || {}, { range: pastedRange, unitId, subUnitId } = pasteTo;
2283
- return this._generateMutations(pastedRange, { copyType, pasteType, copyRange, unitId, subUnitId });
2284
- }, "onPasteCells"),
2285
- onPastePlainText: /* @__PURE__ */ __name((pasteTo, clipText) => ({ undos: [], redos: [] }), "onPastePlainText")
2286
- });
2287
- }
2288
- _collect(unitId, subUnitId, range) {
2289
- var _a11;
2290
- const skeletonManagerService = (_a11 = this._renderManagerService.getRenderById(unitId)) == null ? void 0 : _a11.with(SheetSkeletonManagerService);
2291
- if (!skeletonManagerService) return;
2292
- const selectionRect = skeletonManagerService.attachRangeWithCoord(range);
2293
- if (!selectionRect)
2294
- return;
2295
- const { startX, endX, startY, endY } = selectionRect, drawings = this._sheetDrawingService.getDrawingData(unitId, subUnitId), containedDrawings = [];
2296
- Object.keys(drawings).forEach((drawingId) => {
2297
- const drawing = drawings[drawingId], { transform } = drawing;
2298
- if (drawing.anchorType !== SheetDrawingAnchorType.Both || !transform)
2299
- return;
2300
- const { left = 0, top = 0, width = 0, height = 0 } = transform, { drawingStartX, drawingEndX, drawingStartY, drawingEndY } = {
2301
- drawingStartX: left,
2302
- drawingEndX: left + width,
2303
- drawingStartY: top,
2304
- drawingEndY: top + height
2305
- };
2306
- startX <= drawingStartX && drawingEndX <= endX && startY <= drawingStartY && drawingEndY <= endY && containedDrawings.push(drawing);
2307
- }), containedDrawings.length && (this._copyInfo = {
2308
- drawings: containedDrawings,
2309
- unitId,
2310
- subUnitId
2311
- });
2312
- }
2313
- // eslint-disable-next-line max-lines-per-function
2314
- _generateMutations(pastedRange, copyInfo) {
2315
- var _a11;
2316
- if (!this._copyInfo)
2317
- return { redos: [], undos: [] };
2318
- if ([
2319
- PREDEFINED_HOOK_NAME.SPECIAL_PASTE_COL_WIDTH,
2320
- PREDEFINED_HOOK_NAME.SPECIAL_PASTE_VALUE,
2321
- PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,
2322
- PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMULA
2323
- ].includes(
2324
- copyInfo.pasteType
2325
- ))
2326
- return { redos: [], undos: [] };
2327
- const { copyRange } = copyInfo;
2328
- if (!copyRange)
2329
- return { redos: [], undos: [] };
2330
- const { drawings, unitId, subUnitId } = this._copyInfo, { ranges: [vCopyRange, vPastedRange], mapFunc } = virtualizeDiscreteRanges([copyRange, pastedRange]), { row: copyRow, col: copyCol } = mapFunc(vCopyRange.startRow, vCopyRange.startColumn), { row: pasteRow, col: pasteCol } = mapFunc(vPastedRange.startRow, vPastedRange.startColumn), skeletonManagerService = (_a11 = this._renderManagerService.getRenderById(unitId)) == null ? void 0 : _a11.with(SheetSkeletonManagerService);
2331
- if (!skeletonManagerService)
2332
- return { redos: [], undos: [] };
2333
- const copyRect = skeletonManagerService.attachRangeWithCoord({
2334
- startRow: copyRow,
2335
- endRow: copyRow,
2336
- startColumn: copyCol,
2337
- endColumn: copyCol
2338
- }), pasteRect = skeletonManagerService.attachRangeWithCoord({
2339
- startRow: pasteRow,
2340
- endRow: pasteRow,
2341
- startColumn: pasteCol,
2342
- endColumn: pasteCol
2343
- });
2344
- if (!copyRect || !pasteRect)
2345
- return { redos: [], undos: [] };
2346
- const redos = [], undos = [], leftOffset = pasteRect.startX - copyRect.startX, topOffset = pasteRect.startY - copyRect.startY, rowOffset = pasteRow - copyRow, columnOffset = pasteCol - copyCol, isCut = copyInfo.copyType === COPY_TYPE.CUT, { _sheetDrawingService } = this;
2347
- return drawings.forEach((drawing) => {
2348
- const { transform, sheetTransform } = drawing;
2349
- if (!transform)
2350
- return;
2351
- const drawingObject = {
2352
- ...drawing,
2353
- unitId,
2354
- subUnitId,
2355
- drawingId: isCut ? drawing.drawingId : Tools.generateRandomId(),
2356
- transform: {
2357
- ...transform,
2358
- left: transform.left + leftOffset,
2359
- top: transform.top + topOffset
2360
- },
2361
- sheetTransform: {
2362
- to: { ...sheetTransform.to, row: sheetTransform.to.row + rowOffset, column: sheetTransform.to.column + columnOffset },
2363
- from: { ...sheetTransform.from, row: sheetTransform.from.row + rowOffset, column: sheetTransform.from.column + columnOffset }
2364
- }
2365
- };
2366
- if (isCut) {
2367
- const { undo, redo, objects } = _sheetDrawingService.getBatchUpdateOp([drawingObject]);
2368
- redos.push({
2369
- id: SetDrawingApplyMutation.id,
2370
- params: {
2371
- unitId,
2372
- subUnitId,
2373
- type: DrawingApplyType.UPDATE,
2374
- op: redo,
2375
- objects
2376
- }
2377
- }), undos.push({
2378
- id: SetDrawingApplyMutation.id,
2379
- params: {
2380
- unitId,
2381
- subUnitId,
2382
- type: DrawingApplyType.UPDATE,
2383
- op: undo,
2384
- objects
2385
- }
2386
- });
2387
- } else {
2388
- const { undo, redo, objects } = _sheetDrawingService.getBatchAddOp([drawingObject]);
2389
- redos.push({ id: SetDrawingApplyMutation.id, params: { op: redo, unitId, subUnitId, objects, type: DrawingApplyType.INSERT } }), undos.push({ id: SetDrawingApplyMutation.id, params: { op: undo, unitId, subUnitId, objects, type: DrawingApplyType.REMOVE } });
2390
- }
2391
- }), {
2392
- redos,
2393
- undos
2394
- };
2395
- }
2396
- }, __name(_a8, "SheetsDrawingCopyPasteController"), _a8);
2397
- SheetsDrawingCopyPasteController = __decorateClass$2([
2398
- OnLifecycle(LifecycleStages.Ready, SheetsDrawingCopyPasteController),
2399
- __decorateParam$2(0, ISheetClipboardService),
2400
- __decorateParam$2(1, IRenderManagerService),
2401
- __decorateParam$2(2, ISheetDrawingService)
2402
- ], SheetsDrawingCopyPasteController);
2403
- var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
2404
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
2405
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
2406
- return kind && result && __defProp$1(target, key, result), result;
2407
- }, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$1"), _a9;
2408
- let SheetsDrawingRenderController = (_a9 = class extends Disposable {
2409
- constructor(_context, _sheetDrawingService, _drawingManagerService, _lifecycleService, _sheetSelectionRenderService, _sheetSkeletonManagerService) {
2410
- super(), this._context = _context, this._sheetDrawingService = _sheetDrawingService, this._drawingManagerService = _drawingManagerService, this._lifecycleService = _lifecycleService, this._sheetSelectionRenderService = _sheetSelectionRenderService, this._sheetSkeletonManagerService = _sheetSkeletonManagerService, this._init();
2411
- }
2412
- _init() {
2413
- this._drawingInitializeListener();
2414
- }
2415
- _drawingInitializeListener() {
2416
- if (this._context.type === UniverInstanceType.UNIVER_SHEET) {
2417
- this._sheetDrawingService.initializeNotification(this._context.unitId);
2418
- const data = this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId);
2419
- for (const subUnit in data) {
2420
- const subUnitData = data[subUnit];
2421
- for (const drawingId in subUnitData.data) {
2422
- const drawingData = subUnitData.data[drawingId];
2423
- drawingData.transform = drawingPositionToTransform(drawingData.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
2424
- }
2425
- }
2426
- this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
2427
- }
2428
- }
2429
- }, __name(_a9, "SheetsDrawingRenderController"), _a9);
2430
- SheetsDrawingRenderController = __decorateClass$1([
2431
- __decorateParam$1(1, ISheetDrawingService),
2432
- __decorateParam$1(2, IDrawingManagerService),
2433
- __decorateParam$1(3, Inject(LifecycleService)),
2434
- __decorateParam$1(4, Inject(ISheetSelectionRenderService)),
2435
- __decorateParam$1(5, Inject(SheetSkeletonManagerService))
2436
- ], SheetsDrawingRenderController);
2437
- const PLUGIN_CONFIG_KEY = "sheets-drawing-ui.config", defaultPluginConfig = {};
2438
- var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __defNormalProp2 = /* @__PURE__ */ __name((obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, "__defNormalProp"), __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
2439
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
2440
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
2441
- return kind && result && __defProp2(target, key, result), result;
2442
- }, "__decorateClass"), __decorateParam = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam"), __publicField2 = /* @__PURE__ */ __name((obj, key, value) => __defNormalProp2(obj, typeof key != "symbol" ? key + "" : key, value), "__publicField");
2443
- const PLUGIN_NAME = "SHEET_IMAGE_UI_PLUGIN";
2444
- var _a10;
2445
- let UniverSheetsDrawingUIPlugin = (_a10 = class extends Plugin {
2446
- constructor(_config = defaultPluginConfig, _injector, _renderManagerService, _configService) {
2447
- super(), this._config = _config, this._injector = _injector, this._renderManagerService = _renderManagerService, this._configService = _configService;
2448
- const { menu, ...rest } = this._config;
2449
- menu && this._configService.setConfig("menu", menu, { merge: !0 }), this._configService.setConfig(PLUGIN_CONFIG_KEY, rest);
2450
- }
2451
- onStarting() {
2452
- this._initDependencies();
2453
- }
2454
- onRendered() {
2455
- this._registerRenderModules();
2456
- }
2457
- _initDependencies() {
2458
- [
2459
- [SheetCanvasFloatDomManagerService],
2460
- [SheetDrawingUIController],
2461
- [DrawingPopupMenuController],
2462
- [SheetDrawingPrintingController],
2463
- [SheetDrawingPermissionController],
2464
- [SheetsDrawingCopyPasteController]
2465
- ].forEach((dependency) => this._injector.add(dependency));
2466
- }
2467
- _registerRenderModules() {
2468
- [
2469
- [SheetDrawingUpdateController],
2470
- [SheetDrawingTransformAffectedController],
2471
- [SheetsDrawingRenderController]
2472
- ].forEach((m) => {
2473
- this.disposeWithMe(this._renderManagerService.registerRenderModule(UniverInstanceType.UNIVER_SHEET, m));
2474
- });
2475
- }
2476
- }, __name(_a10, "UniverSheetsDrawingUIPlugin"), _a10);
2477
- __publicField2(UniverSheetsDrawingUIPlugin, "type", UniverInstanceType.UNIVER_SHEET);
2478
- __publicField2(UniverSheetsDrawingUIPlugin, "pluginName", PLUGIN_NAME);
2479
- UniverSheetsDrawingUIPlugin = __decorateClass([
2480
- DependentOn(UniverDrawingPlugin, UniverDrawingUIPlugin, UniverSheetsDrawingPlugin),
2481
- __decorateParam(1, Inject(Injector)),
2482
- __decorateParam(2, IRenderManagerService),
2483
- __decorateParam(3, IConfigService)
2484
- ], UniverSheetsDrawingUIPlugin);
2485
- export {
2486
- ClearSheetDrawingTransformerOperation,
2487
- DeleteDrawingsCommand,
2488
- EditSheetDrawingOperation,
2489
- GroupSheetDrawingCommand,
2490
- IMAGE_MENU_ID,
2491
- InsertFloatImageCommand,
2492
- InsertSheetDrawingCommand,
2493
- MoveDrawingsCommand,
2494
- RemoveSheetDrawingCommand,
2495
- SetDrawingArrangeCommand,
2496
- SetSheetDrawingCommand,
2497
- SheetCanvasFloatDomManagerService,
2498
- SidebarSheetDrawingOperation,
2499
- UngroupSheetDrawingCommand,
2500
- UniverSheetsDrawingUIPlugin
2501
- };
1
+ const _0x3d4902=_0x42a1;(function(_0x2e60ed,_0x341b3d){const _0x7312e2=_0x42a1,_0x2bb6fe=_0x2e60ed();while(!![]){try{const _0x173802=parseInt(_0x7312e2(0x1d7))/0x1+parseInt(_0x7312e2(0x276))/0x2*(parseInt(_0x7312e2(0x2e1))/0x3)+parseInt(_0x7312e2(0x373))/0x4+parseInt(_0x7312e2(0x290))/0x5*(-parseInt(_0x7312e2(0x351))/0x6)+parseInt(_0x7312e2(0x2e4))/0x7*(-parseInt(_0x7312e2(0x20f))/0x8)+parseInt(_0x7312e2(0x24e))/0x9+-parseInt(_0x7312e2(0x394))/0xa;if(_0x173802===_0x341b3d)break;else _0x2bb6fe['push'](_0x2bb6fe['shift']());}catch(_0xc07f6e){_0x2bb6fe['push'](_0x2bb6fe['shift']());}}}(_0x3354,0x56f16));var __defProp=Object[_0x3d4902(0x1c5)],__defNormalProp=(_0x5451ab,_0x2f00a3,_0x433551)=>_0x2f00a3 in _0x5451ab?__defProp(_0x5451ab,_0x2f00a3,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x433551}):_0x5451ab[_0x2f00a3]=_0x433551,__name=(_0x39af59,_0x1b8eab)=>__defProp(_0x39af59,'name',{'value':_0x1b8eab,'configurable':!0x0}),__publicField=(_0x132c1a,_0x118952,_0x35eabe)=>__defNormalProp(_0x132c1a,typeof _0x118952!='symbol'?_0x118952+'':_0x118952,_0x35eabe);import{CommandType,ICommandService,IUndoRedoService,LocaleService,IUniverInstanceService,useDependency,Inject,Injector,IContextService,RxDisposable,UniverInstanceType,connectInjector,toDisposable,FOCUSING_COMMON_DRAWINGS,Disposable,Direction,FOCUSING_FX_BAR_EDITOR,EDITOR_ACTIVATED,Tools,UserManagerService,IPermissionService,Rectangle,DrawingTypeEnum as _0x4c08d0,DisposableCollection,generateRandomId,DependentOn,Plugin,IConfigService}from'@univerjs/core';import{IDrawingManagerService,IImageIoService,DrawingTypeEnum,ArrangeTypeEnum,DRAWING_IMAGE_ALLOW_IMAGE_LIST,DRAWING_IMAGE_COUNT_LIMIT,ImageUploadStatusType,DRAWING_IMAGE_ALLOW_SIZE,getImageSize,DRAWING_IMAGE_WIDTH_LIMIT,DRAWING_IMAGE_HEIGHT_LIMIT,getDrawingShapeKeyByDrawingSearch,UniverDrawingPlugin}from'@univerjs/drawing';import{ImageCropperObject,COMPONENT_IMAGE_POPUP_MENU,OpenImageCropOperation,ImageResetSizeOperation,DrawingCommonPanel,DrawingRenderService,UniverDrawingUIPlugin}from'@univerjs/drawing-ui';import{IRenderManagerService,precisionTo,getGroupState,transformObjectOutOfGroup,RENDER_CLASS_TYPE,Rect,DRAWING_OBJECT_LAYER_INDEX,SHEET_VIEWPORT_KEY}from'@univerjs/engine-render';import{ISheetDrawingService,SetDrawingApplyMutation,DrawingApplyType,SheetDrawingAnchorType,UniverSheetsDrawingPlugin}from'@univerjs/sheets-drawing';import{SheetCanvasPopManagerService,attachRangeWithCoord,ISheetSelectionRenderService,SheetSkeletonManagerService,getCurrentRangeDisable$,COPY_TYPE,PREDEFINED_HOOK_NAME,virtualizeDiscreteRanges,ISheetClipboardService,SheetPrintInterceptorService,SetScrollOperation,SetZoomRatioOperation}from'@univerjs/sheets-ui';import{ISidebarService,IUIPartsService,BuiltInUIPart,ILocalFileService,IMessageService,MenuItemType,getMenuHiddenObservable,RibbonStartGroup,KeyCode,ComponentManager,IMenuManagerService,IShortcutService,CanvasFloatDomService}from'@univerjs/ui';import{takeUntil,combineLatest,map,filter,distinctUntilChanged,Subject,BehaviorSubject}from'rxjs';import{getSheetCommandTarget,SheetsSelectionsService,WorkbookEditablePermission,WorksheetEditPermission,RangeProtectionPermissionEditPoint,WorkbookViewPermission,WorksheetViewPermission,InsertRowCommand,InsertColCommand,RemoveRowCommand,RemoveColCommand,DeleteRangeMoveLeftCommand,DeleteRangeMoveUpCommand,InsertRangeMoveDownCommand,InsertRangeMoveRightCommand,DeltaRowHeightCommand,SetRowHeightCommand,DeltaColumnWidthCommand,SetColWidthCommand,SetRowHiddenCommand,SetSpecificRowsVisibleCommand,SetSpecificColsVisibleCommand,SetColHiddenCommand,MoveColsCommand,MoveRowsCommand,MoveRangeCommand,SetRowVisibleMutation,SetRowHiddenMutation,SetColVisibleMutation,SetColHiddenMutation,SetWorksheetRowHeightMutation,SetWorksheetColWidthMutation,SheetInterceptorService,SetWorksheetActiveOperation,SetFrozenMutation}from'@univerjs/sheets';import _0x2b08c1,{useEffect,forwardRef,useRef,createElement,useState}from'react';import{MessageType,RadioGroup,Radio}from'@univerjs/design';import _0x5733cb from'clsx';const PLUGIN_CONFIG_KEY=_0x3d4902(0x380),defaultPluginConfig={},ClearSheetDrawingTransformerOperation={'id':_0x3d4902(0x390),'type':CommandType[_0x3d4902(0x249)],'handler':__name((_0x451b74,_0x22ec77)=>{const _0x27ead6=_0x3d4902,_0x273001=_0x451b74['get'](IRenderManagerService);return _0x22ec77[_0x27ead6(0x23c)](_0x9e2724=>{const _0x40ff5d=_0x27ead6;var _0x4e4e01,_0x21008d;(_0x21008d=(_0x4e4e01=_0x273001[_0x40ff5d(0x200)](_0x9e2724))==null?void 0x0:_0x4e4e01[_0x40ff5d(0x34f)][_0x40ff5d(0x240)]())==null||_0x21008d['debounceRefreshControls']();}),!0x0;},_0x3d4902(0x312))},RemoveSheetDrawingCommand={'id':_0x3d4902(0x1f2),'type':CommandType['COMMAND'],'handler':__name((_0x461ddf,_0x4606e6)=>{const _0x37c11d=_0x3d4902,_0x3987ee=_0x461ddf[_0x37c11d(0x2c8)](ICommandService),_0x50ec30=_0x461ddf[_0x37c11d(0x2c8)](IUndoRedoService),_0x1ec8e5=_0x461ddf[_0x37c11d(0x2c8)](ISheetDrawingService);if(!_0x4606e6)return!0x1;const {drawings:_0x4d3ee6}=_0x4606e6,_0x4edd0b=[];_0x4d3ee6[_0x37c11d(0x23c)](_0x53c66d=>{const _0x1f2f16=_0x37c11d,{unitId:_0x432de3}=_0x53c66d;_0x4edd0b[_0x1f2f16(0x1dd)](_0x432de3);});const _0x5dbe9c=_0x1ec8e5['getBatchRemoveOp'](_0x4d3ee6),{unitId:_0x14bcd2,subUnitId:_0x4b3a74,undo:_0x58fd71,redo:_0x644b03,objects:_0x161a5d}=_0x5dbe9c;return _0x3987ee[_0x37c11d(0x31c)](SetDrawingApplyMutation['id'],{'unitId':_0x14bcd2,'subUnitId':_0x4b3a74,'op':_0x644b03,'objects':_0x161a5d,'type':DrawingApplyType[_0x37c11d(0x331)]})?(_0x50ec30[_0x37c11d(0x29e)]({'unitID':_0x14bcd2,'undoMutations':[{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x14bcd2,'subUnitId':_0x4b3a74,'op':_0x58fd71,'objects':_0x161a5d,'type':DrawingApplyType[_0x37c11d(0x1ef)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':_0x4edd0b}],'redoMutations':[{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x14bcd2,'subUnitId':_0x4b3a74,'op':_0x644b03,'objects':_0x161a5d,'type':DrawingApplyType['REMOVE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':_0x4edd0b}]}),!0x0):!0x1;},'handler')},COMPONENT_SHEET_DRAWING_PANEL='COMPONENT_SHEET_DRAWING_PANEL',SidebarSheetDrawingOperation={'id':_0x3d4902(0x2c6),'type':CommandType[_0x3d4902(0x217)],'handler':__name(async(_0x4c7c1f,_0x591c58)=>{const _0x19829e=_0x3d4902,_0x5710b3=_0x4c7c1f['get'](ISidebarService),_0x592dd9=_0x4c7c1f['get'](LocaleService),_0x3a0202=_0x4c7c1f['get'](IUniverInstanceService),_0x115f7d=_0x4c7c1f[_0x19829e(0x2c8)](IDrawingManagerService);if(!getSheetCommandTarget(_0x3a0202))return!0x1;switch(_0x591c58[_0x19829e(0x216)]){case _0x19829e(0x205):_0x5710b3['open']({'header':{'title':_0x592dd9['t'](_0x19829e(0x32f))},'children':{'label':COMPONENT_SHEET_DRAWING_PANEL},'onClose':__name(()=>{const _0x535691=_0x19829e;_0x115f7d[_0x535691(0x298)](null);},_0x19829e(0x377)),'width':0x168});break;case _0x19829e(0x2e0):default:_0x5710b3[_0x19829e(0x2e0)]();break;}return!0x0;},_0x3d4902(0x312))},EditSheetDrawingOperation={'id':'sheet.operation.edit-sheet-image','type':CommandType[_0x3d4902(0x1fe)],'handler':__name((_0x5bcac4,_0x4b0218)=>{const _0x1e41ca=_0x3d4902,_0x256397=_0x5bcac4[_0x1e41ca(0x2c8)](IDrawingManagerService),_0x43d02a=_0x5bcac4[_0x1e41ca(0x2c8)](ICommandService);return _0x4b0218==null?!0x1:(_0x256397[_0x1e41ca(0x298)]([_0x4b0218]),_0x43d02a['executeCommand'](SidebarSheetDrawingOperation['id'],{'value':_0x1e41ca(0x205)}),!0x0);},_0x3d4902(0x312))},uploadLoading=_0x3d4902(0x285),uploadLoadingBody='univer-upload-loading-body',uploadLoadingBodyAnimation=_0x3d4902(0x25b),univerCircleAnimation=_0x3d4902(0x23e),uploadLoadingBodyText=_0x3d4902(0x392),styles$1={'uploadLoading':uploadLoading,'uploadLoadingBody':uploadLoadingBody,'uploadLoadingBodyAnimation':uploadLoadingBodyAnimation,'univerCircleAnimation':univerCircleAnimation,'uploadLoadingBodyText':uploadLoadingBodyText},UploadLoading=__name(()=>{const _0x43beac=_0x3d4902,_0x3d1d5a=useDependency(IImageIoService),_0x5a0ccc=useDependency(LocaleService),[_0x9d5d2b,_0xf0533]=_0x2b08c1['useState'](0x0);return useEffect(()=>{const _0x5de050=_0x42a1,_0x593ea4=_0x3d1d5a[_0x5de050(0x323)][_0x5de050(0x2c2)](_0x3b6ec2=>{_0xf0533(_0x3b6ec2);});return()=>{const _0x25e755=_0x5de050;_0x593ea4[_0x25e755(0x335)]();};},[_0x3d1d5a]),_0x2b08c1['createElement'](_0x43beac(0x329),{'style':{'display':_0x9d5d2b>0x0?'block':_0x43beac(0x302)},'className':styles$1['uploadLoading']},_0x2b08c1[_0x43beac(0x296)](_0x43beac(0x329),{'className':styles$1[_0x43beac(0x2ca)]},_0x2b08c1[_0x43beac(0x296)](_0x43beac(0x329),{'className':styles$1[_0x43beac(0x383)]}),_0x2b08c1['createElement'](_0x43beac(0x329),{'className':styles$1[_0x43beac(0x333)]},_0x5a0ccc['t']('uploadLoading.loading')+':\x20'+_0x9d5d2b)));},'UploadLoading');var __defProp$9=Object[_0x3d4902(0x1c5)],__getOwnPropDesc$9=Object[_0x3d4902(0x358)],__decorateClass$9=__name((_0x21c12e,_0x2da03,_0x6febfa,_0x4c2528)=>{const _0x1be958=_0x3d4902;for(var _0xbe7261=_0x4c2528>0x1?void 0x0:_0x4c2528?__getOwnPropDesc$9(_0x2da03,_0x6febfa):_0x2da03,_0x2ed1a0=_0x21c12e[_0x1be958(0x307)]-0x1,_0x4779fa;_0x2ed1a0>=0x0;_0x2ed1a0--)(_0x4779fa=_0x21c12e[_0x2ed1a0])&&(_0xbe7261=(_0x4c2528?_0x4779fa(_0x2da03,_0x6febfa,_0xbe7261):_0x4779fa(_0xbe7261))||_0xbe7261);return _0x4c2528&&_0xbe7261&&__defProp$9(_0x2da03,_0x6febfa,_0xbe7261),_0xbe7261;},'__decorateClass$9'),__decorateParam$9=__name((_0x1338de,_0x2b34a5)=>(_0x376824,_0x9acb03)=>_0x2b34a5(_0x376824,_0x9acb03,_0x1338de),_0x3d4902(0x22b)),_a;let DrawingPopupMenuController=(_a=class extends RxDisposable{constructor(_0x4f1503,_0x553d5c,_0x119488,_0x3bf845,_0xb21663,_0x8bf5c7,_0x69d4aa){const _0x1c874b=_0x3d4902;super(),__publicField(this,_0x1c874b(0x263),new Set()),(this[_0x1c874b(0x2e5)]=_0x4f1503,this[_0x1c874b(0x1bd)]=_0x553d5c,this[_0x1c874b(0x2e7)]=_0x119488,this[_0x1c874b(0x2ef)]=_0x3bf845,this['_univerInstanceService']=_0xb21663,this[_0x1c874b(0x2c7)]=_0x8bf5c7,this[_0x1c874b(0x372)]=_0x69d4aa,this[_0x1c874b(0x306)]());}[_0x3d4902(0x306)](){const _0x2ee0a6=_0x3d4902;this['_univerInstanceService'][_0x2ee0a6(0x2ee)](UniverInstanceType['UNIVER_SHEET'])['pipe'](takeUntil(this[_0x2ee0a6(0x2d2)]))[_0x2ee0a6(0x2c2)](_0xa10824=>this[_0x2ee0a6(0x2f1)](_0xa10824)),this[_0x2ee0a6(0x2b7)][_0x2ee0a6(0x314)](UniverInstanceType[_0x2ee0a6(0x1e8)])[_0x2ee0a6(0x1bc)](takeUntil(this[_0x2ee0a6(0x2d2)]))['subscribe'](_0x3d846c=>this[_0x2ee0a6(0x1d8)](_0x3d846c)),this['_univerInstanceService'][_0x2ee0a6(0x2a7)](UniverInstanceType[_0x2ee0a6(0x1e8)])['forEach'](_0x2cc4b8=>this[_0x2ee0a6(0x2f1)](_0x2cc4b8)),this[_0x2ee0a6(0x372)][_0x2ee0a6(0x2f0)](BuiltInUIPart[_0x2ee0a6(0x25d)],()=>connectInjector(UploadLoading,this[_0x2ee0a6(0x2e5)]));}[_0x3d4902(0x1d8)](_0x740a60){const _0x28dab8=_0x3d4902,_0xf0c34b=_0x740a60['getUnitId']();this['_renderManagerService'][_0x28dab8(0x2e3)](_0xf0c34b);}[_0x3d4902(0x2f1)](_0x23b6f1){const _0x3b2db2=_0x3d4902;if(!_0x23b6f1)return;const _0x26904a=_0x23b6f1['getUnitId']();this[_0x3b2db2(0x2ef)][_0x3b2db2(0x1ec)](_0x26904a)&&!this[_0x3b2db2(0x263)]['has'](_0x26904a)&&(this[_0x3b2db2(0x258)](_0x26904a),this[_0x3b2db2(0x263)]['add'](_0x26904a));}[_0x3d4902(0x1d6)](_0xe3215e){const _0x59f4be=_0x3d4902,_0x4fc8bd=_0xe3215e[_0x59f4be(0x2de)]();for(const _0x4d5dfa of _0x4fc8bd)if(_0x4d5dfa instanceof ImageCropperObject)return!0x0;return!0x1;}['_popupMenuListener'](_0x2048f2){const _0x29c0b6=_0x3d4902;var _0x4455a4;const _0x561d25=(_0x4455a4=this[_0x29c0b6(0x2ef)][_0x29c0b6(0x200)](_0x2048f2))==null?void 0x0:_0x4455a4[_0x29c0b6(0x34f)];if(!_0x561d25)return;const _0x42de18=_0x561d25[_0x29c0b6(0x301)]();if(!_0x42de18)return;let _0x19f822;this[_0x29c0b6(0x26e)](toDisposable(_0x42de18['createControl$'][_0x29c0b6(0x2c2)](()=>{const _0x4aecb9=_0x29c0b6;if(this[_0x4aecb9(0x2c7)][_0x4aecb9(0x20d)](FOCUSING_COMMON_DRAWINGS,!0x0),this['_hasCropObject'](_0x561d25))return;const _0x351cac=_0x42de18[_0x4aecb9(0x313)]();if(_0x351cac[_0x4aecb9(0x1e5)]>0x1){_0x19f822==null||_0x19f822[_0x4aecb9(0x272)]();return;}const _0x35f3cf=_0x351cac[_0x4aecb9(0x32b)]()[_0x4aecb9(0x24f)]()['value'];if(!_0x35f3cf)return;const _0x42655f=_0x35f3cf['oKey'],_0x344aac=this[_0x4aecb9(0x1bd)][_0x4aecb9(0x1f1)](_0x42655f);if(!_0x344aac)return;const {unitId:_0xd170dc,subUnitId:_0xa3ebf4,drawingId:_0x30db96,drawingType:_0x2e0223}=_0x344aac;_0x19f822==null||_0x19f822[_0x4aecb9(0x272)](),_0x19f822=this[_0x4aecb9(0x26e)](this['_canvasPopManagerService']['attachPopupToObject'](_0x35f3cf,{'componentKey':COMPONENT_IMAGE_POPUP_MENU,'direction':_0x4aecb9(0x24d),'offset':[0x2,0x0],'extraProps':{'menuItems':this[_0x4aecb9(0x338)](_0xd170dc,_0xa3ebf4,_0x30db96,_0x2e0223)}})),this[_0x4aecb9(0x1bd)][_0x4aecb9(0x298)]([{'unitId':_0xd170dc,'subUnitId':_0xa3ebf4,'drawingId':_0x30db96}]);}))),this['disposeWithMe'](_0x42de18[_0x29c0b6(0x269)][_0x29c0b6(0x2c2)](()=>{const _0x20ab7e=_0x29c0b6;_0x19f822==null||_0x19f822[_0x20ab7e(0x272)](),this[_0x20ab7e(0x2c7)]['setContextValue'](FOCUSING_COMMON_DRAWINGS,!0x1),this[_0x20ab7e(0x1bd)][_0x20ab7e(0x298)](null);})),this[_0x29c0b6(0x26e)](_0x42de18[_0x29c0b6(0x388)][_0x29c0b6(0x2c2)](()=>{_0x19f822==null||_0x19f822['dispose']();}));}[_0x3d4902(0x338)](_0x52cd8f,_0x5634e8,_0x37611a,_0x4aa68f){const _0x489c79=_0x3d4902;return[{'label':'image-popup.edit','index':0x0,'commandId':EditSheetDrawingOperation['id'],'commandParams':{'unitId':_0x52cd8f,'subUnitId':_0x5634e8,'drawingId':_0x37611a},'disable':_0x4aa68f===DrawingTypeEnum[_0x489c79(0x26f)]},{'label':_0x489c79(0x378),'index':0x1,'commandId':RemoveSheetDrawingCommand['id'],'commandParams':{'unitId':_0x52cd8f,'drawings':[{'unitId':_0x52cd8f,'subUnitId':_0x5634e8,'drawingId':_0x37611a}]},'disable':!0x1},{'label':'image-popup.crop','index':0x2,'commandId':OpenImageCropOperation['id'],'commandParams':{'unitId':_0x52cd8f,'subUnitId':_0x5634e8,'drawingId':_0x37611a},'disable':_0x4aa68f===DrawingTypeEnum[_0x489c79(0x26f)]},{'label':_0x489c79(0x221),'index':0x3,'commandId':ImageResetSizeOperation['id'],'commandParams':[{'unitId':_0x52cd8f,'subUnitId':_0x5634e8,'drawingId':_0x37611a}],'disable':_0x4aa68f===DrawingTypeEnum[_0x489c79(0x26f)]}];}},__name(_a,_0x3d4902(0x2a2)),_a);DrawingPopupMenuController=__decorateClass$9([__decorateParam$9(0x0,Inject(Injector)),__decorateParam$9(0x1,IDrawingManagerService),__decorateParam$9(0x2,Inject(SheetCanvasPopManagerService)),__decorateParam$9(0x3,IRenderManagerService),__decorateParam$9(0x4,IUniverInstanceService),__decorateParam$9(0x5,IContextService),__decorateParam$9(0x6,Inject(IUIPartsService))],DrawingPopupMenuController);function drawingPositionToTransform(_0x5f2486,_0x391613,_0x1d76c7){const _0x581115=_0x3d4902,{from:_0x5f4ca2,to:_0x58af36,flipY:flipY=!0x1,flipX:flipX=!0x1,angle:angle=0x0,skewX:skewX=0x0,skewY:skewY=0x0}=_0x5f2486,{column:_0x17aece,columnOffset:_0x413927,row:_0x5f5596,rowOffset:_0x44597c}=_0x5f4ca2,{column:_0x157e51,columnOffset:_0x12b499,row:_0x573a04,rowOffset:_0x5e203c}=_0x58af36,_0x447436=_0x1d76c7[_0x581115(0x253)](),_0x55efa3=attachRangeWithCoord(_0x447436,{'startColumn':_0x17aece,'endColumn':_0x17aece,'startRow':_0x5f5596,'endRow':_0x5f5596});if(_0x55efa3==null)return;const _0x4c78be=attachRangeWithCoord(_0x447436,{'startColumn':_0x157e51,'endColumn':_0x157e51,'startRow':_0x573a04,'endRow':_0x573a04});if(_0x4c78be==null)return;const {startX:_0xd136b2,startY:_0x13b211}=_0x55efa3,{startX:_0x5997e5,startY:_0x1c9e9d}=_0x4c78be;let _0x4a9055=precisionTo(_0xd136b2+_0x413927,0x1),_0x2cd72a=precisionTo(_0x13b211+_0x44597c,0x1),_0x145df2=precisionTo(_0x5997e5+_0x12b499-_0x4a9055,0x1),_0x53db3f=precisionTo(_0x1c9e9d+_0x5e203c-_0x2cd72a,0x1);_0x55efa3['startX']===_0x4c78be[_0x581115(0x295)]&&(_0x145df2=0x0),_0x55efa3['startY']===_0x4c78be['endY']&&(_0x53db3f=0x0);const _0x327b66=_0x447436[_0x581115(0x24c)]+_0x447436['columnTotalWidth'],_0x492d46=_0x447436[_0x581115(0x1c1)]+_0x447436['rowTotalHeight'];return _0x4a9055+_0x145df2>_0x327b66&&(_0x4a9055=_0x327b66-_0x145df2),_0x2cd72a+_0x53db3f>_0x492d46&&(_0x2cd72a=_0x492d46-_0x53db3f),{'flipY':flipY,'flipX':flipX,'angle':angle,'skewX':skewX,'skewY':skewY,'left':_0x4a9055,'top':_0x2cd72a,'width':_0x145df2,'height':_0x53db3f};}__name(drawingPositionToTransform,_0x3d4902(0x34c));function transformToDrawingPosition(_0xbe0078,_0x2bae00){const _0x4ebfa4=_0x3d4902,{left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipY:flipY=!0x1,flipX:flipX=!0x1,angle:angle=0x0,skewX:skewX=0x0,skewY:skewY=0x0}=_0xbe0078,_0x4ac106=_0x2bae00[_0x4ebfa4(0x248)](left,top);if(_0x4ac106==null)return;const _0x5567ce={'column':_0x4ac106[_0x4ebfa4(0x2a9)],'columnOffset':precisionTo(left-_0x4ac106['startX'],0x1),'row':_0x4ac106[_0x4ebfa4(0x29d)],'rowOffset':precisionTo(top-_0x4ac106[_0x4ebfa4(0x34b)],0x1)},_0x5dd7cc=_0x2bae00[_0x4ebfa4(0x248)](left+width,top+height);if(_0x5dd7cc==null)return;const _0x48888f={'column':_0x5dd7cc['actualColumn'],'columnOffset':precisionTo(left+width-_0x5dd7cc[_0x4ebfa4(0x36e)],0x1),'row':_0x5dd7cc[_0x4ebfa4(0x29d)],'rowOffset':precisionTo(top+height-_0x5dd7cc[_0x4ebfa4(0x34b)],0x1)};return{'flipY':flipY,'flipX':flipX,'angle':angle,'skewX':skewX,'skewY':skewY,'from':_0x5567ce,'to':_0x48888f};}__name(transformToDrawingPosition,_0x3d4902(0x31e));var __defProp$8=Object[_0x3d4902(0x1c5)],__getOwnPropDesc$8=Object[_0x3d4902(0x358)],__decorateClass$8=__name((_0x166393,_0x2c55ca,_0x313c97,_0x23941f)=>{const _0x300778=_0x3d4902;for(var _0x15710a=_0x23941f>0x1?void 0x0:_0x23941f?__getOwnPropDesc$8(_0x2c55ca,_0x313c97):_0x2c55ca,_0x533a37=_0x166393[_0x300778(0x307)]-0x1,_0x5e36f8;_0x533a37>=0x0;_0x533a37--)(_0x5e36f8=_0x166393[_0x533a37])&&(_0x15710a=(_0x23941f?_0x5e36f8(_0x2c55ca,_0x313c97,_0x15710a):_0x5e36f8(_0x15710a))||_0x15710a);return _0x23941f&&_0x15710a&&__defProp$8(_0x2c55ca,_0x313c97,_0x15710a),_0x15710a;},'__decorateClass$8'),__decorateParam$8=__name((_0x30dd0e,_0x2067b2)=>(_0x1f1dbd,_0xfc407)=>_0x2067b2(_0x1f1dbd,_0xfc407,_0x30dd0e),'__decorateParam$8'),_a2;let SheetsDrawingRenderController=(_a2=class extends Disposable{constructor(_0x97d7a5,_0x136c01,_0x2523b6,_0x3ac19f,_0x2fe148){const _0xe93ed3=_0x3d4902;super(),this['_context']=_0x97d7a5,this['_sheetDrawingService']=_0x136c01,this[_0xe93ed3(0x1bd)]=_0x2523b6,this[_0xe93ed3(0x31d)]=_0x3ac19f,this[_0xe93ed3(0x346)]=_0x2fe148,this['_init']();}[_0x3d4902(0x306)](){const _0x3a77a8=_0x3d4902;this[_0x3a77a8(0x1c7)]();}[_0x3d4902(0x1c7)](){const _0x4b6135=_0x3d4902;this[_0x4b6135(0x2cb)][_0x4b6135(0x260)](this['_context'][_0x4b6135(0x291)]);const _0x3a2daf=this[_0x4b6135(0x2cb)][_0x4b6135(0x2f8)](this[_0x4b6135(0x324)][_0x4b6135(0x291)]);for(const _0x472c08 in _0x3a2daf){const _0x3ffd33=_0x3a2daf[_0x472c08];for(const _0x1edee6 in _0x3ffd33['data']){const _0x2788ec=_0x3ffd33[_0x4b6135(0x34d)][_0x1edee6];_0x2788ec[_0x4b6135(0x32e)]=drawingPositionToTransform(_0x2788ec[_0x4b6135(0x2a0)],this[_0x4b6135(0x31d)],this['_sheetSkeletonManagerService']);}}this[_0x4b6135(0x1bd)][_0x4b6135(0x2f2)](this['_context'][_0x4b6135(0x291)],this[_0x4b6135(0x2cb)][_0x4b6135(0x2f8)](this[_0x4b6135(0x324)][_0x4b6135(0x291)])),this[_0x4b6135(0x1bd)]['initializeNotification'](this['_context'][_0x4b6135(0x291)]);}},__name(_a2,_0x3d4902(0x202)),_a2);SheetsDrawingRenderController=__decorateClass$8([__decorateParam$8(0x1,ISheetDrawingService),__decorateParam$8(0x2,IDrawingManagerService),__decorateParam$8(0x3,Inject(ISheetSelectionRenderService)),__decorateParam$8(0x4,Inject(SheetSkeletonManagerService))],SheetsDrawingRenderController);var __assign=function(){const _0x25036f=_0x3d4902;return __assign=Object['assign']||function(_0x213960){const _0x1f4a6a=_0x42a1;for(var _0x2bd2c9,_0x39efd8=0x1,_0x2de415=arguments[_0x1f4a6a(0x307)];_0x39efd8<_0x2de415;_0x39efd8++){_0x2bd2c9=arguments[_0x39efd8];for(var _0x2204f6 in _0x2bd2c9)Object[_0x1f4a6a(0x21e)]['hasOwnProperty'][_0x1f4a6a(0x222)](_0x2bd2c9,_0x2204f6)&&(_0x213960[_0x2204f6]=_0x2bd2c9[_0x2204f6]);}return _0x213960;},__assign[_0x25036f(0x2be)](this,arguments);},__rest=function(_0x1020b0,_0x141bea){const _0x557539=_0x3d4902;var _0x1a0e09={};for(var _0xdf738b in _0x1020b0)Object[_0x557539(0x21e)][_0x557539(0x293)][_0x557539(0x222)](_0x1020b0,_0xdf738b)&&_0x141bea[_0x557539(0x2f7)](_0xdf738b)<0x0&&(_0x1a0e09[_0xdf738b]=_0x1020b0[_0xdf738b]);if(_0x1020b0!=null&&typeof Object[_0x557539(0x315)]==_0x557539(0x2e2)){for(var _0x57c487=0x0,_0xdf738b=Object[_0x557539(0x315)](_0x1020b0);_0x57c487<_0xdf738b['length'];_0x57c487++)_0x141bea[_0x557539(0x2f7)](_0xdf738b[_0x57c487])<0x0&&Object[_0x557539(0x21e)]['propertyIsEnumerable'][_0x557539(0x222)](_0x1020b0,_0xdf738b[_0x57c487])&&(_0x1a0e09[_0xdf738b[_0x57c487]]=_0x1020b0[_0xdf738b[_0x57c487]]);}return _0x1a0e09;},IconBase=forwardRef(function(_0xfdfa98,_0xaa1934){const _0x10f40d=_0x3d4902;var _0x2c7d62=_0xfdfa98[_0x10f40d(0x282)],_0x5c0bb1=_0xfdfa98['id'],_0x497b08=_0xfdfa98[_0x10f40d(0x361)],_0x38d2d6=_0xfdfa98[_0x10f40d(0x2eb)],_0x11722d=__rest(_0xfdfa98,[_0x10f40d(0x282),'id','className',_0x10f40d(0x2eb)]),_0x47241e=_0x10f40d(0x229)[_0x10f40d(0x1c6)](_0x5c0bb1,'\x20')['concat'](_0x497b08||'')[_0x10f40d(0x28e)](),_0x3e5dc5=useRef('_'[_0x10f40d(0x1c6)](generateShortUuid()));return render(_0x2c7d62,''[_0x10f40d(0x1c6)](_0x5c0bb1),{'defIds':_0x2c7d62['defIds'],'idSuffix':_0x3e5dc5[_0x10f40d(0x29b)]},__assign({'ref':_0xaa1934,'className':_0x47241e},_0x11722d),_0x38d2d6);});function render(_0x449194,_0xd1f106,_0x315f46,_0x2c0c4a,_0x2b9800){const _0x9fb30a=_0x3d4902;return createElement(_0x449194[_0x9fb30a(0x261)],__assign(__assign({'key':_0xd1f106},replaceRuntimeIdsAndExtInAttrs(_0x449194,_0x315f46,_0x2b9800)),_0x2c0c4a),(replaceRuntimeIdsInDefs(_0x449194,_0x315f46)[_0x9fb30a(0x2d0)]||[])[_0x9fb30a(0x38d)](function(_0xca6ed1,_0x205b73){const _0x11a564=_0x9fb30a;return render(_0xca6ed1,''[_0x11a564(0x1c6)](_0xd1f106,'-')[_0x11a564(0x1c6)](_0x449194[_0x11a564(0x261)],'-')['concat'](_0x205b73),_0x315f46,void 0x0,_0x2b9800);}));}__name(render,'render');function replaceRuntimeIdsAndExtInAttrs(_0x18e588,_0x5985a5,_0x498aed){const _0x55d31a=_0x3d4902;var _0x1e0dc3=__assign({},_0x18e588[_0x55d31a(0x273)]);_0x498aed!=null&&_0x498aed[_0x55d31a(0x213)]&&_0x1e0dc3[_0x55d31a(0x228)]===_0x55d31a(0x213)&&(_0x1e0dc3[_0x55d31a(0x228)]=_0x498aed[_0x55d31a(0x213)]);var _0x24f6f5=_0x5985a5[_0x55d31a(0x20b)];return!_0x24f6f5||_0x24f6f5[_0x55d31a(0x307)]===0x0||(_0x18e588[_0x55d31a(0x261)]===_0x55d31a(0x37b)&&_0x1e0dc3[_0x55d31a(0x1ee)]&&(_0x1e0dc3['xlink:href']=_0x1e0dc3[_0x55d31a(0x1ee)]+_0x5985a5[_0x55d31a(0x277)]),Object[_0x55d31a(0x254)](_0x1e0dc3)[_0x55d31a(0x23c)](function(_0xf1c11a){const _0x97c0c6=_0x55d31a;var _0x1b7577=_0xf1c11a[0x0],_0x423403=_0xf1c11a[0x1];typeof _0x423403=='string'&&(_0x1e0dc3[_0x1b7577]=_0x423403[_0x97c0c6(0x328)](/url\(#(.*)\)/,_0x97c0c6(0x36d)[_0x97c0c6(0x1c6)](_0x5985a5[_0x97c0c6(0x277)],')')));})),_0x1e0dc3;}__name(replaceRuntimeIdsAndExtInAttrs,_0x3d4902(0x1f5));function replaceRuntimeIdsInDefs(_0x27ac55,_0x165fb5){const _0x3a268a=_0x3d4902;var _0x3a471a,_0x263c52=_0x165fb5['defIds'];return!_0x263c52||_0x263c52[_0x3a268a(0x307)]===0x0?_0x27ac55:_0x27ac55['tag']===_0x3a268a(0x30a)&&(!((_0x3a471a=_0x27ac55[_0x3a268a(0x2d0)])===null||_0x3a471a===void 0x0)&&_0x3a471a[_0x3a268a(0x307)])?__assign(__assign({},_0x27ac55),{'children':_0x27ac55[_0x3a268a(0x2d0)][_0x3a268a(0x38d)](function(_0x1f46eb){const _0x307baf=_0x3a268a;return typeof _0x1f46eb[_0x307baf(0x273)]['id']==_0x307baf(0x287)&&_0x263c52&&_0x263c52['indexOf'](_0x1f46eb[_0x307baf(0x273)]['id'])>-0x1?__assign(__assign({},_0x1f46eb),{'attrs':__assign(__assign({},_0x1f46eb['attrs']),{'id':_0x1f46eb[_0x307baf(0x273)]['id']+_0x165fb5['idSuffix']})}):_0x1f46eb;})}):_0x27ac55;}__name(replaceRuntimeIdsInDefs,_0x3d4902(0x2c3));function generateShortUuid(){const _0x16473f=_0x3d4902;return Math[_0x16473f(0x2b4)]()[_0x16473f(0x268)](0x24)[_0x16473f(0x33b)](0x2,0x8);}__name(generateShortUuid,_0x3d4902(0x283)),IconBase[_0x3d4902(0x1bb)]=_0x3d4902(0x22e);var element={'tag':_0x3d4902(0x2ac),'attrs':{'fill':_0x3d4902(0x302),'viewBox':_0x3d4902(0x266),'width':_0x3d4902(0x244),'height':'1em'},'children':[{'tag':_0x3d4902(0x2bf),'attrs':{'fill':_0x3d4902(0x2c9),'d':_0x3d4902(0x343),'fillRule':_0x3d4902(0x1cb),'clipRule':'evenodd'}},{'tag':_0x3d4902(0x2bf),'attrs':{'fill':_0x3d4902(0x2c9),'d':_0x3d4902(0x368)}}]},AddImageSingle=forwardRef(function(_0x107ad2,_0x1a4556){const _0x178195=_0x3d4902;return createElement(IconBase,Object['assign']({},_0x107ad2,{'id':_0x178195(0x30e),'ref':_0x1a4556,'icon':element}));});AddImageSingle[_0x3d4902(0x1bb)]=_0x3d4902(0x251);const DeleteDrawingsCommand={'id':'sheet.command.delete-drawing','type':CommandType[_0x3d4902(0x217)],'handler':__name(_0x5f10e5=>{const _0x7819c7=_0x3d4902,_0xed6f24=_0x5f10e5[_0x7819c7(0x2c8)](ICommandService),_0x4c876b=_0x5f10e5[_0x7819c7(0x2c8)](ISheetDrawingService)[_0x7819c7(0x28c)]();if(_0x4c876b['length']===0x0)return!0x1;const _0x52a954=_0x4c876b[0x0][_0x7819c7(0x291)],_0x477d91=_0x4c876b[_0x7819c7(0x38d)](_0x2791b0=>{const {unitId:_0x3bcb3c,subUnitId:_0x2ba849,drawingId:_0x5481da,drawingType:_0x1c963e}=_0x2791b0;return{'unitId':_0x3bcb3c,'subUnitId':_0x2ba849,'drawingId':_0x5481da,'drawingType':_0x1c963e};});return _0xed6f24[_0x7819c7(0x234)](RemoveSheetDrawingCommand['id'],{'unitId':_0x52a954,'drawings':_0x477d91});},_0x3d4902(0x312))};function ungroupToGroup(_0x397724){const _0x125486=_0x3d4902,_0x488bae=[];return _0x397724[_0x125486(0x23c)](_0x2362ff=>{const _0x276b83=_0x125486,{parent:_0x567da0,children:_0x2bae71}=_0x2362ff,{unitId:_0x9caec3,subUnitId:_0x4245d6,drawingId:_0x295691}=_0x567da0,_0x318a00=getGroupState(0x0,0x0,_0x2bae71[_0x276b83(0x38d)](_0x24d821=>_0x24d821[_0x276b83(0x32e)]||{})),_0x3cdb34=_0x2bae71['map'](_0x326f97=>{const _0x22690d=_0x276b83,_0x536270=_0x326f97['transform']||{'left':0x0,'top':0x0},{unitId:_0x3a8904,subUnitId:_0x3ae124,drawingId:_0x20c879}=_0x326f97;return{'unitId':_0x3a8904,'subUnitId':_0x3ae124,'drawingId':_0x20c879,'transform':{..._0x536270,'left':_0x536270['left']-_0x318a00[_0x22690d(0x242)],'top':_0x536270['top']-_0x318a00[_0x22690d(0x326)]},'groupId':_0x295691};}),_0xdf9f2e={'unitId':_0x9caec3,'subUnitId':_0x4245d6,'drawingId':_0x295691,'drawingType':DrawingTypeEnum[_0x276b83(0x1d1)],'transform':_0x318a00};_0x488bae[_0x276b83(0x1dd)]({'parent':_0xdf9f2e,'children':_0x3cdb34});}),_0x488bae;}__name(ungroupToGroup,'ungroupToGroup');function groupToUngroup(_0x44e57c){const _0x491771=[];return _0x44e57c['forEach'](_0x22f850=>{const _0x3b1147=_0x42a1,{parent:_0x33183f,children:_0x160957}=_0x22f850,{unitId:_0x2abb01,subUnitId:_0x436c17,drawingId:_0x5c0e76,transform:_0xb8dfd6={'width':0x0,'height':0x0}}=_0x33183f;if(_0xb8dfd6==null)return;const _0x5e5356=_0x160957[_0x3b1147(0x38d)](_0x1aa6cb=>{const _0x4fedbb=_0x3b1147,{transform:_0x2d0c36}=_0x1aa6cb,{unitId:_0x12a6a2,subUnitId:_0x3f9e41,drawingId:_0x3d73cd}=_0x1aa6cb,_0x17a8e7=transformObjectOutOfGroup(_0x2d0c36||{},_0xb8dfd6,_0xb8dfd6[_0x4fedbb(0x259)]||0x0,_0xb8dfd6[_0x4fedbb(0x241)]||0x0);return{'unitId':_0x12a6a2,'subUnitId':_0x3f9e41,'drawingId':_0x3d73cd,'transform':_0x17a8e7,'groupId':void 0x0};}),_0x4ec85f={'unitId':_0x2abb01,'subUnitId':_0x436c17,'drawingId':_0x5c0e76,'drawingType':DrawingTypeEnum[_0x3b1147(0x1d1)],'transform':{'left':0x0,'top':0x0}};_0x491771[_0x3b1147(0x1dd)]({'parent':_0x4ec85f,'children':_0x5e5356});}),_0x491771;}__name(groupToUngroup,_0x3d4902(0x212));const GroupSheetDrawingCommand={'id':'sheet.command.group-sheet-image','type':CommandType['COMMAND'],'handler':__name((_0x31f349,_0x11f5a1)=>{const _0x3414b8=_0x3d4902,_0x3c43e0=_0x31f349[_0x3414b8(0x2c8)](ICommandService),_0x1fd24f=_0x31f349['get'](IUndoRedoService),_0x3dfc00=_0x31f349[_0x3414b8(0x2c8)](ISheetDrawingService);if(!_0x11f5a1)return!0x1;const _0x3d6bd3=[];_0x11f5a1['forEach'](({parent:_0x2ba760,children:_0x2436a3})=>{const _0x2d669b=_0x3414b8;_0x3d6bd3[_0x2d669b(0x1dd)](_0x2ba760[_0x2d669b(0x291)]),_0x2436a3[_0x2d669b(0x23c)](_0x13cf0c=>{const _0x532be1=_0x2d669b;_0x3d6bd3['push'](_0x13cf0c[_0x532be1(0x291)]);});});const _0x5c4701=_0x3dfc00['getGroupDrawingOp'](_0x11f5a1),{unitId:_0x6c454f,subUnitId:_0x40fb92,undo:_0x8b542e,redo:_0x26e12a,objects:_0x488a04}=_0x5c4701;return _0x3c43e0[_0x3414b8(0x31c)](SetDrawingApplyMutation['id'],{'op':_0x26e12a,'unitId':_0x6c454f,'subUnitId':_0x40fb92,'objects':_0x488a04,'type':DrawingApplyType[_0x3414b8(0x1cc)]})?(_0x1fd24f[_0x3414b8(0x29e)]({'unitID':_0x6c454f,'undoMutations':[{'id':SetDrawingApplyMutation['id'],'params':{'op':_0x8b542e,'unitId':_0x6c454f,'subUnitId':_0x40fb92,'objects':groupToUngroup(_0x488a04),'type':DrawingApplyType[_0x3414b8(0x2dc)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':_0x3d6bd3}],'redoMutations':[{'id':SetDrawingApplyMutation['id'],'params':{'op':_0x26e12a,'unitId':_0x6c454f,'subUnitId':_0x40fb92,'objects':_0x488a04,'type':DrawingApplyType['GROUP']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':_0x3d6bd3}]}),!0x0):!0x1;},'handler')},InsertSheetDrawingCommand={'id':_0x3d4902(0x38f),'type':CommandType[_0x3d4902(0x217)],'handler':__name((_0x53505d,_0xda3078)=>{const _0x2dab6a=_0x3d4902,_0x3aa55e=_0x53505d[_0x2dab6a(0x2c8)](ICommandService),_0x43de6c=_0x53505d[_0x2dab6a(0x2c8)](IUndoRedoService),_0xd437b3=_0x53505d[_0x2dab6a(0x2c8)](ISheetDrawingService);if(!_0xda3078)return!0x1;const _0x928cfb=_0xda3078['drawings'],_0x23c9a0=_0x928cfb[_0x2dab6a(0x38d)](_0x19c94c=>_0x19c94c['unitId']),_0x45114=_0xd437b3[_0x2dab6a(0x2fc)](_0x928cfb),{unitId:_0x5bd424,subUnitId:_0x2a0215,undo:_0x507ddb,redo:_0x2af079,objects:_0x38b65a}=_0x45114;return _0x3aa55e[_0x2dab6a(0x31c)](SetDrawingApplyMutation['id'],{'op':_0x2af079,'unitId':_0x5bd424,'subUnitId':_0x2a0215,'objects':_0x38b65a,'type':DrawingApplyType[_0x2dab6a(0x1ef)]})?(_0x43de6c[_0x2dab6a(0x29e)]({'unitID':_0x5bd424,'undoMutations':[{'id':SetDrawingApplyMutation['id'],'params':{'op':_0x507ddb,'unitId':_0x5bd424,'subUnitId':_0x2a0215,'objects':_0x38b65a,'type':DrawingApplyType[_0x2dab6a(0x331)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':_0x23c9a0}],'redoMutations':[{'id':SetDrawingApplyMutation['id'],'params':{'op':_0x2af079,'unitId':_0x5bd424,'subUnitId':_0x2a0215,'objects':_0x38b65a,'type':DrawingApplyType['INSERT']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':_0x23c9a0}]}),!0x0):!0x1;},_0x3d4902(0x312))},SetDrawingArrangeCommand={'id':_0x3d4902(0x2ab),'type':CommandType['COMMAND'],'handler':__name((_0x1abeea,_0x50062c)=>{const _0x16780d=_0x3d4902,_0x1194a1=_0x1abeea[_0x16780d(0x2c8)](ICommandService),_0x433d0e=_0x1abeea[_0x16780d(0x2c8)](IUndoRedoService);if(!_0x50062c)return!0x1;const _0x596246=_0x1abeea[_0x16780d(0x2c8)](ISheetDrawingService),{unitId:_0x51062a,subUnitId:_0x48e1c9,drawingIds:_0x3f0631,arrangeType:_0x80c59d}=_0x50062c,_0x35b09f={'unitId':_0x51062a,'subUnitId':_0x48e1c9,'drawingIds':_0x3f0631};let _0x81e6b5;if(_0x80c59d===ArrangeTypeEnum['forward']?_0x81e6b5=_0x596246[_0x16780d(0x2a3)](_0x35b09f):_0x80c59d===ArrangeTypeEnum[_0x16780d(0x1e0)]?_0x81e6b5=_0x596246['getBackwardDrawingOp'](_0x35b09f):_0x80c59d===ArrangeTypeEnum[_0x16780d(0x1ca)]?_0x81e6b5=_0x596246[_0x16780d(0x262)](_0x35b09f):_0x80c59d===ArrangeTypeEnum['back']&&(_0x81e6b5=_0x596246['getBackDrawingsOp'](_0x35b09f)),_0x81e6b5==null)return!0x1;const {objects:_0x4abc48,redo:_0x4e80c6,undo:_0x286a21}=_0x81e6b5;return _0x1194a1['syncExecuteCommand'](SetDrawingApplyMutation['id'],{'op':_0x4e80c6,'unitId':_0x51062a,'subUnitId':_0x48e1c9,'objects':_0x4abc48,'type':DrawingApplyType[_0x16780d(0x356)]})?(_0x433d0e[_0x16780d(0x29e)]({'unitID':_0x51062a,'undoMutations':[{'id':SetDrawingApplyMutation['id'],'params':{'op':_0x286a21,'unitId':_0x51062a,'subUnitId':_0x48e1c9,'objects':_0x4abc48,'type':DrawingApplyType['ARRANGE']}}],'redoMutations':[{'id':SetDrawingApplyMutation['id'],'params':{'op':_0x4e80c6,'unitId':_0x51062a,'subUnitId':_0x48e1c9,'objects':_0x4abc48,'type':DrawingApplyType[_0x16780d(0x356)]}}]}),!0x0):!0x1;},_0x3d4902(0x312))},SetSheetDrawingCommand={'id':_0x3d4902(0x345),'type':CommandType['COMMAND'],'handler':__name((_0x11a7b5,_0x1d19cb)=>{const _0x1c7b56=_0x3d4902,_0x4a1a4b=_0x11a7b5[_0x1c7b56(0x2c8)](ICommandService),_0x563c7c=_0x11a7b5[_0x1c7b56(0x2c8)](IUndoRedoService),_0x220568=_0x11a7b5[_0x1c7b56(0x2c8)](ISheetDrawingService);if(!_0x1d19cb)return!0x1;const {drawings:_0x32d7ca}=_0x1d19cb,_0x1dfa8c=_0x220568['getBatchUpdateOp'](_0x32d7ca),{unitId:_0x1b16d3,subUnitId:_0x19a8cb,undo:_0x5e4b37,redo:_0x355ef,objects:_0x4c5f82}=_0x1dfa8c;return _0x4a1a4b[_0x1c7b56(0x31c)](SetDrawingApplyMutation['id'],{'unitId':_0x1b16d3,'subUnitId':_0x19a8cb,'op':_0x355ef,'objects':_0x4c5f82,'type':DrawingApplyType[_0x1c7b56(0x1cd)]})?(_0x563c7c[_0x1c7b56(0x29e)]({'unitID':_0x1b16d3,'undoMutations':[{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x1b16d3,'subUnitId':_0x19a8cb,'op':_0x5e4b37,'objects':_0x4c5f82,'type':DrawingApplyType[_0x1c7b56(0x1cd)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x1b16d3]}],'redoMutations':[{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x1b16d3,'subUnitId':_0x19a8cb,'op':_0x355ef,'objects':_0x4c5f82,'type':DrawingApplyType[_0x1c7b56(0x1cd)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x1b16d3]}]}),!0x0):!0x1;},_0x3d4902(0x312))},UngroupSheetDrawingCommand={'id':_0x3d4902(0x2f9),'type':CommandType[_0x3d4902(0x217)],'handler':__name((_0x58d1f4,_0x3174c0)=>{const _0x1c4860=_0x3d4902,_0x52b6ce=_0x58d1f4[_0x1c4860(0x2c8)](ICommandService),_0xadf93a=_0x58d1f4[_0x1c4860(0x2c8)](IUndoRedoService),_0x29d091=_0x58d1f4[_0x1c4860(0x2c8)](ISheetDrawingService);if(!_0x3174c0)return!0x1;const _0x27f5b6=[];_0x3174c0[_0x1c4860(0x23c)](({parent:_0x1afea4,children:_0xfa40f0})=>{const _0x43e7c0=_0x1c4860;_0x27f5b6['push'](_0x1afea4['unitId']),_0xfa40f0[_0x43e7c0(0x23c)](_0x245e4d=>{const _0x2783d0=_0x43e7c0;_0x27f5b6[_0x2783d0(0x1dd)](_0x245e4d[_0x2783d0(0x291)]);});});const _0x225966=_0x29d091[_0x1c4860(0x2ed)](_0x3174c0),{unitId:_0x35a094,subUnitId:_0xe4ea93,undo:_0x131616,redo:_0x523852,objects:_0x360025}=_0x225966;return _0x52b6ce['syncExecuteCommand'](SetDrawingApplyMutation['id'],{'op':_0x523852,'unitId':_0x35a094,'subUnitId':_0xe4ea93,'objects':_0x360025,'type':DrawingApplyType[_0x1c4860(0x2dc)]})?(_0xadf93a[_0x1c4860(0x29e)]({'unitID':_0x35a094,'undoMutations':[{'id':SetDrawingApplyMutation['id'],'params':{'op':_0x131616,'unitId':_0x35a094,'subUnitId':_0xe4ea93,'objects':ungroupToGroup(_0x360025),'type':DrawingApplyType[_0x1c4860(0x1cc)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':_0x27f5b6}],'redoMutations':[{'id':SetDrawingApplyMutation['id'],'params':{'op':_0x523852,'unitId':_0x35a094,'subUnitId':_0xe4ea93,'objects':_0x360025,'type':DrawingApplyType[_0x1c4860(0x2dc)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':_0x27f5b6}]}),!0x0):!0x1;},_0x3d4902(0x312))};var __defProp$7=Object[_0x3d4902(0x1c5)],__getOwnPropDesc$7=Object[_0x3d4902(0x358)],__decorateClass$7=__name((_0x4b6657,_0x56e850,_0x51cd21,_0x58e0dc)=>{const _0x25318c=_0x3d4902;for(var _0x2766bd=_0x58e0dc>0x1?void 0x0:_0x58e0dc?__getOwnPropDesc$7(_0x56e850,_0x51cd21):_0x56e850,_0x1c929a=_0x4b6657[_0x25318c(0x307)]-0x1,_0x3974c1;_0x1c929a>=0x0;_0x1c929a--)(_0x3974c1=_0x4b6657[_0x1c929a])&&(_0x2766bd=(_0x58e0dc?_0x3974c1(_0x56e850,_0x51cd21,_0x2766bd):_0x3974c1(_0x2766bd))||_0x2766bd);return _0x58e0dc&&_0x2766bd&&__defProp$7(_0x56e850,_0x51cd21,_0x2766bd),_0x2766bd;},_0x3d4902(0x33f)),__decorateParam$7=__name((_0x1cbb0c,_0x70c96a)=>(_0x3919c7,_0x98efe5)=>_0x70c96a(_0x3919c7,_0x98efe5,_0x1cbb0c),_0x3d4902(0x23a)),_a3;let SheetDrawingUpdateController=(_a3=class extends Disposable{constructor(_0x12e714,_0x2110fb,_0x2a57c1,_0x5e58d8,_0x1858fc,_0x3779d4,_0x11e454,_0x17c4a3,_0x4fd33d,_0x125ca2,_0x5b04c7,_0x947012){const _0x40a9e0=_0x3d4902;super(),__publicField(this,_0x40a9e0(0x1ce)),(this[_0x40a9e0(0x324)]=_0x12e714,this[_0x40a9e0(0x2d4)]=_0x2110fb,this[_0x40a9e0(0x208)]=_0x2a57c1,this[_0x40a9e0(0x36b)]=_0x5e58d8,this[_0x40a9e0(0x243)]=_0x1858fc,this[_0x40a9e0(0x219)]=_0x3779d4,this[_0x40a9e0(0x2cb)]=_0x11e454,this[_0x40a9e0(0x1bd)]=_0x17c4a3,this['_contextService']=_0x4fd33d,this[_0x40a9e0(0x362)]=_0x125ca2,this[_0x40a9e0(0x2fa)]=_0x5b04c7,this[_0x40a9e0(0x1ce)]=_0x947012['getWorkbookSelections'](this['_context'][_0x40a9e0(0x291)]),this[_0x40a9e0(0x29a)](),this[_0x40a9e0(0x24b)](),this[_0x40a9e0(0x33e)](),this['_focusDrawingListener']());}async[_0x3d4902(0x25f)](){const _0x1a570c=_0x3d4902,_0x14f08f=await this[_0x1a570c(0x219)][_0x1a570c(0x1fb)]({'multiple':!0x0,'accept':DRAWING_IMAGE_ALLOW_IMAGE_LIST[_0x1a570c(0x38d)](_0x29af6d=>'.'+_0x29af6d[_0x1a570c(0x328)](_0x1a570c(0x1fa),''))['join'](',')}),_0x43adc1=_0x14f08f[_0x1a570c(0x307)];return _0x43adc1>DRAWING_IMAGE_COUNT_LIMIT?(this[_0x1a570c(0x362)]['show']({'type':MessageType[_0x1a570c(0x27b)],'content':this['_localeService']['t'](_0x1a570c(0x236),String(DRAWING_IMAGE_COUNT_LIMIT))}),!0x1):_0x43adc1===0x0?!0x1:(_0x14f08f['forEach'](async _0x499487=>await this[_0x1a570c(0x2c0)](_0x499487)),!0x0);}async[_0x3d4902(0x2c0)](_0x58b542){const _0x1cadc5=_0x3d4902;let _0x146c15;try{_0x146c15=await this[_0x1cadc5(0x243)][_0x1cadc5(0x252)](_0x58b542);}catch(_0x5c3b1f){const _0x3223f6=_0x5c3b1f['message'];_0x3223f6===ImageUploadStatusType[_0x1cadc5(0x348)]?this['_messageService'][_0x1cadc5(0x27d)]({'type':MessageType['Error'],'content':this[_0x1cadc5(0x2fa)]['t'](_0x1cadc5(0x1fd),String(DRAWING_IMAGE_ALLOW_SIZE/(0x400*0x400)))}):_0x3223f6===ImageUploadStatusType[_0x1cadc5(0x271)]?this[_0x1cadc5(0x362)][_0x1cadc5(0x27d)]({'type':MessageType[_0x1cadc5(0x27b)],'content':this[_0x1cadc5(0x2fa)]['t']('update-status.invalidImageType')}):_0x3223f6===ImageUploadStatusType[_0x1cadc5(0x214)]&&this[_0x1cadc5(0x362)][_0x1cadc5(0x27d)]({'type':MessageType[_0x1cadc5(0x27b)],'content':this[_0x1cadc5(0x2fa)]['t'](_0x1cadc5(0x23d))});}if(_0x146c15==null)return;const _0x467026=this[_0x1cadc5(0x1e6)](),{unitId:_0x1fc7ec,subUnitId:_0xa4c669}=_0x467026,{imageId:_0x516143,imageSourceType:_0x2746a3,source:_0x3d802c,base64Cache:_0x3a39d3}=_0x146c15,{width:_0x1fec69,height:_0x453403,image:_0xb195fd}=await getImageSize(_0x3a39d3||''),{width:_0x4520f5,height:_0x5a22e5}=this[_0x1cadc5(0x324)][_0x1cadc5(0x34f)];this['_imageIoService']['addImageSourceCache'](_0x3d802c,_0x2746a3,_0xb195fd);let _0x13f978=0x1;if(_0x1fec69>DRAWING_IMAGE_WIDTH_LIMIT||_0x453403>DRAWING_IMAGE_HEIGHT_LIMIT){const _0x1abb6a=DRAWING_IMAGE_WIDTH_LIMIT/_0x1fec69,_0x250d86=DRAWING_IMAGE_HEIGHT_LIMIT/_0x453403;_0x13f978=Math[_0x1cadc5(0x211)](_0x1abb6a,_0x250d86);}const _0x216b9a=this[_0x1cadc5(0x381)](_0x1fec69*_0x13f978,_0x453403*_0x13f978,_0x4520f5,_0x5a22e5);if(_0x216b9a==null)return;const _0xf3674={'unitId':_0x1fc7ec,'subUnitId':_0xa4c669,'drawingId':_0x516143,'drawingType':DrawingTypeEnum[_0x1cadc5(0x1ff)],'imageSourceType':_0x2746a3,'source':_0x3d802c,'transform':drawingPositionToTransform(_0x216b9a,this[_0x1cadc5(0x36b)],this['_skeletonManagerService']),'sheetTransform':_0x216b9a};this[_0x1cadc5(0x208)][_0x1cadc5(0x234)](InsertSheetDrawingCommand['id'],{'unitId':_0x1fc7ec,'drawings':[_0xf3674]});}[_0x3d4902(0x1e6)](){const _0x1afffc=_0x3d4902,_0x1cf479=this[_0x1afffc(0x324)][_0x1afffc(0x1f3)],_0x232846=_0x1cf479[_0x1afffc(0x31f)](),_0x4ebf6c=_0x1cf479[_0x1afffc(0x33a)](),_0x186db1=_0x232846['getSheetId']();return{'unitId':_0x4ebf6c,'subUnitId':_0x186db1};}[_0x3d4902(0x381)](_0x4a1d8b,_0x5cc99d,_0x1ca68e,_0x46b862){const _0xe1f0f4=_0x3d4902,_0x28f1e7=this[_0xe1f0f4(0x1ce)][_0xe1f0f4(0x2a1)]();let _0x104ea8={'startRow':0x0,'endRow':0x0,'startColumn':0x0,'endColumn':0x0};_0x28f1e7&&_0x28f1e7[_0xe1f0f4(0x307)]>0x0&&(_0x104ea8=_0x28f1e7[_0x28f1e7[_0xe1f0f4(0x307)]-0x1][_0xe1f0f4(0x227)]);const _0x288c9c=attachRangeWithCoord(this[_0xe1f0f4(0x2d4)][_0xe1f0f4(0x1c9)]()[_0xe1f0f4(0x300)],_0x104ea8);if(_0x288c9c==null)return;let {startColumn:_0x8a43da,startRow:_0x5ac242,startX:_0x564a3f,startY:_0x566137}=_0x288c9c,_0x48071=!0x1;if(_0x564a3f+_0x4a1d8b>_0x1ca68e&&(_0x564a3f=_0x1ca68e-_0x4a1d8b,_0x564a3f<0x0&&(_0x564a3f=0x0,_0x4a1d8b=_0x1ca68e),_0x48071=!0x0),_0x566137+_0x5cc99d>_0x46b862&&(_0x566137=_0x46b862-_0x5cc99d,_0x566137<0x0&&(_0x566137=0x0,_0x5cc99d=_0x46b862),_0x48071=!0x0),_0x48071){const _0x797597=this['_selectionRenderService'][_0xe1f0f4(0x248)](_0x564a3f,_0x566137);if(_0x797597==null)return;_0x564a3f=_0x797597[_0xe1f0f4(0x36e)],_0x566137=_0x797597[_0xe1f0f4(0x34b)],_0x8a43da=_0x797597[_0xe1f0f4(0x2a9)],_0x5ac242=_0x797597[_0xe1f0f4(0x29d)];}const _0x12fb59={'column':_0x8a43da,'columnOffset':0x0,'row':_0x5ac242,'rowOffset':0x0},_0x4f2d51=this[_0xe1f0f4(0x36b)][_0xe1f0f4(0x248)](_0x564a3f+_0x4a1d8b,_0x566137+_0x5cc99d);if(_0x4f2d51==null)return;const _0x2b7ea7={'column':_0x4f2d51[_0xe1f0f4(0x2a9)],'columnOffset':_0x564a3f+_0x4a1d8b-_0x4f2d51['startX'],'row':_0x4f2d51[_0xe1f0f4(0x29d)],'rowOffset':_0x566137+_0x5cc99d-_0x4f2d51[_0xe1f0f4(0x34b)]};return{'from':_0x12fb59,'to':_0x2b7ea7};}[_0x3d4902(0x24b)](){const _0x8f2534=_0x3d4902;this[_0x8f2534(0x1bd)][_0x8f2534(0x1e9)][_0x8f2534(0x2c2)](_0x4167d0=>{const _0x2cc814=_0x8f2534,{unitId:_0xe4afd6,subUnitId:_0x1944b3,drawingIds:_0x4b4baa,arrangeType:_0x4b91d7}=_0x4167d0;this[_0x2cc814(0x208)][_0x2cc814(0x234)](SetDrawingArrangeCommand['id'],{'unitId':_0xe4afd6,'subUnitId':_0x1944b3,'drawingIds':_0x4b4baa,'arrangeType':_0x4b91d7});});}[_0x3d4902(0x29a)](){const _0xa038d8=_0x3d4902;this['_drawingManagerService'][_0xa038d8(0x35b)][_0xa038d8(0x2c2)](_0x397474=>{const _0x58caea=_0xa038d8,_0x514555=[];_0x397474[_0x58caea(0x307)]!==0x0&&(_0x397474['forEach'](_0x3c2a69=>{const _0x50237a=_0x58caea,{unitId:_0x344555,subUnitId:_0x1addc4,drawingId:_0x5b0232,drawingType:_0x30d386,transform:_0x331d5e}=_0x3c2a69;if(_0x331d5e==null)return;const _0xe49963=this[_0x50237a(0x2cb)][_0x50237a(0x1fc)]({'unitId':_0x344555,'subUnitId':_0x1addc4,'drawingId':_0x5b0232});if(_0xe49963==null||_0xe49963['unitId']!==this[_0x50237a(0x324)][_0x50237a(0x291)])return;const _0xf66de=transformToDrawingPosition({..._0xe49963['transform'],..._0x331d5e},this['_selectionRenderService']);if(_0xf66de==null)return;const _0x2ed75a={..._0x3c2a69,'transform':{..._0xe49963['transform'],..._0x331d5e,...drawingPositionToTransform(_0xf66de,this[_0x50237a(0x36b)],this[_0x50237a(0x2d4)])},'sheetTransform':{..._0xf66de}};_0x514555[_0x50237a(0x1dd)](_0x2ed75a);}),_0x514555['length']>0x0&&this[_0x58caea(0x208)][_0x58caea(0x234)](SetSheetDrawingCommand['id'],{'unitId':_0x397474[0x0]['unitId'],'drawings':_0x514555}));});}[_0x3d4902(0x33e)](){const _0x4c08f7=_0x3d4902;this[_0x4c08f7(0x1bd)][_0x4c08f7(0x2fb)][_0x4c08f7(0x2c2)](_0x19ba9d=>{const _0x59d318=_0x4c08f7;this[_0x59d318(0x208)][_0x59d318(0x234)](GroupSheetDrawingCommand['id'],_0x19ba9d);const {unitId:_0x3da15a,subUnitId:_0x5265bd,drawingId:_0x534779}=_0x19ba9d[0x0][_0x59d318(0x375)];this[_0x59d318(0x1bd)]['focusDrawing']([{'unitId':_0x3da15a,'subUnitId':_0x5265bd,'drawingId':_0x534779}]);}),this['_drawingManagerService'][_0x4c08f7(0x340)]['subscribe'](_0x5cd806=>{const _0xe1b7db=_0x4c08f7;this['_commandService'][_0xe1b7db(0x234)](UngroupSheetDrawingCommand['id'],_0x5cd806);});}[_0x3d4902(0x28d)](){const _0x5b0506=_0x3d4902;this[_0x5b0506(0x26e)](this['_drawingManagerService'][_0x5b0506(0x28a)]['subscribe'](_0x2bddf1=>{const _0x32f03f=_0x5b0506;_0x2bddf1==null||_0x2bddf1[_0x32f03f(0x307)]===0x0?(this[_0x32f03f(0x2c7)]['setContextValue'](FOCUSING_COMMON_DRAWINGS,!0x1),this[_0x32f03f(0x2cb)]['focusDrawing']([])):(this['_contextService'][_0x32f03f(0x20d)](FOCUSING_COMMON_DRAWINGS,!0x0),this[_0x32f03f(0x2cb)][_0x32f03f(0x298)](_0x2bddf1));}));}},__name(_a3,_0x3d4902(0x308)),_a3);SheetDrawingUpdateController=__decorateClass$7([__decorateParam$7(0x1,Inject(SheetSkeletonManagerService)),__decorateParam$7(0x2,ICommandService),__decorateParam$7(0x3,ISheetSelectionRenderService),__decorateParam$7(0x4,IImageIoService),__decorateParam$7(0x5,ILocalFileService),__decorateParam$7(0x6,ISheetDrawingService),__decorateParam$7(0x7,IDrawingManagerService),__decorateParam$7(0x8,IContextService),__decorateParam$7(0x9,IMessageService),__decorateParam$7(0xa,Inject(LocaleService)),__decorateParam$7(0xb,Inject(SheetsSelectionsService))],SheetDrawingUpdateController);const InsertFloatImageCommand={'id':_0x3d4902(0x207),'type':CommandType['COMMAND'],'handler':__name(_0xdfb341=>{const _0x31365=_0x3d4902;var _0x86946c,_0x1c3118;return(_0x1c3118=(_0x86946c=_0xdfb341[_0x31365(0x2c8)](IRenderManagerService)[_0x31365(0x1c3)](UniverInstanceType[_0x31365(0x1e8)]))==null?void 0x0:_0x86946c[_0x31365(0x1f7)](SheetDrawingUpdateController)[_0x31365(0x25f)]())!=null?_0x1c3118:!0x1;},'handler')},MoveDrawingsCommand={'id':'sheet.command.move-drawing','type':CommandType[_0x3d4902(0x217)],'handler':__name((_0x15031c,_0x1ec317)=>{const _0x5aef94=_0x3d4902,_0x2e6961=_0x15031c['get'](ICommandService),_0x3150df=_0x15031c[_0x5aef94(0x2c8)](ISheetDrawingService),_0x2b5402=_0x15031c[_0x5aef94(0x2c8)](ISheetSelectionRenderService),{direction:_0x1db143}=_0x1ec317,_0x4a92bc=_0x3150df['getFocusDrawings']();if(_0x4a92bc['length']===0x0)return!0x1;const _0x2e6df1=_0x4a92bc[0x0][_0x5aef94(0x291)],_0x6e9b2d=_0x4a92bc['map'](_0x1e5ee0=>{const _0x4d2b8e=_0x5aef94,{transform:_0x440d20}=_0x1e5ee0;if(_0x440d20==null)return null;const _0x12d373={..._0x440d20},{left:left=0x0,top:top=0x0}=_0x440d20;return _0x1db143===Direction['UP']?_0x12d373['top']=top-0x1:_0x1db143===Direction[_0x4d2b8e(0x1e1)]?_0x12d373[_0x4d2b8e(0x326)]=top+0x1:_0x1db143===Direction[_0x4d2b8e(0x21a)]?_0x12d373[_0x4d2b8e(0x242)]=left-0x1:_0x1db143===Direction[_0x4d2b8e(0x2b9)]&&(_0x12d373[_0x4d2b8e(0x242)]=left+0x1),{..._0x1e5ee0,'transform':_0x12d373,'sheetTransform':transformToDrawingPosition(_0x12d373,_0x2b5402)};})[_0x5aef94(0x1e3)](_0x3cc3f1=>_0x3cc3f1!=null);return _0x2e6961[_0x5aef94(0x31c)](SetSheetDrawingCommand['id'],{'unitId':_0x2e6df1,'drawings':_0x6e9b2d})?(_0x2e6961[_0x5aef94(0x31c)](ClearSheetDrawingTransformerOperation['id'],[_0x2e6df1]),!0x0):!0x1;},_0x3d4902(0x312))},IMAGE_UPLOAD_ICON=_0x3d4902(0x35d),IMAGE_MENU_ID=_0x3d4902(0x1d4);function ImageMenuFactory(_0x4ef23a){const _0x3cd2bd=_0x3d4902;return{'id':IMAGE_MENU_ID,'type':MenuItemType[_0x3cd2bd(0x304)],'icon':IMAGE_UPLOAD_ICON,'tooltip':_0x3cd2bd(0x34a),'hidden$':getMenuHiddenObservable(_0x4ef23a,UniverInstanceType[_0x3cd2bd(0x1e8)]),'disabled$':getCurrentRangeDisable$(_0x4ef23a,{'workbookTypes':[WorkbookEditablePermission],'worksheetTypes':[WorksheetEditPermission],'rangeTypes':[RangeProtectionPermissionEditPoint]})};}__name(ImageMenuFactory,_0x3d4902(0x30b));function UploadFloatImageMenuFactory(_0x3fbbf1){const _0x48fb4e=_0x3d4902;return{'id':InsertFloatImageCommand['id'],'title':'sheetImage.upload.float','type':MenuItemType[_0x48fb4e(0x387)],'hidden$':getMenuHiddenObservable(_0x3fbbf1,UniverInstanceType[_0x48fb4e(0x1e8)])};}__name(UploadFloatImageMenuFactory,_0x3d4902(0x311));const imageCommonPanel=_0x3d4902(0x35a),imageCommonPanelGrid='univer-image-common-panel-grid',imageCommonPanelBorder='univer-image-common-panel-border',imageCommonPanelTitle=_0x3d4902(0x25c),imageCommonPanelSubtitle=_0x3d4902(0x36a),imageCommonPanelRow=_0x3d4902(0x209),imageCommonPanelRowVertical=_0x3d4902(0x2a6),imageCommonPanelColumn='univer-image-common-panel-column',imageCommonPanelColumnCenter='univer-image-common-panel-column-center',imageCommonPanelInline='univer-image-common-panel-inline',imageCommonPanelSpan2=_0x3d4902(0x317),imageCommonPanelSpan3=_0x3d4902(0x1f4),imageCommonPanelInput=_0x3d4902(0x22c),sheetImageMenu=_0x3d4902(0x35e),sheetImageMenuInput=_0x3d4902(0x2c5),styles={'imageCommonPanel':imageCommonPanel,'imageCommonPanelGrid':imageCommonPanelGrid,'imageCommonPanelBorder':imageCommonPanelBorder,'imageCommonPanelTitle':imageCommonPanelTitle,'imageCommonPanelSubtitle':imageCommonPanelSubtitle,'imageCommonPanelRow':imageCommonPanelRow,'imageCommonPanelRowVertical':imageCommonPanelRowVertical,'imageCommonPanelColumn':imageCommonPanelColumn,'imageCommonPanelColumnCenter':imageCommonPanelColumnCenter,'imageCommonPanelInline':imageCommonPanelInline,'imageCommonPanelSpan2':imageCommonPanelSpan2,'imageCommonPanelSpan3':imageCommonPanelSpan3,'imageCommonPanelInput':imageCommonPanelInput,'sheetImageMenu':sheetImageMenu,'sheetImageMenuInput':sheetImageMenuInput},SheetDrawingAnchor=__name(_0x24f134=>{const _0x363a31=_0x3d4902;var _0x4a992f;const _0x163606=useDependency(ICommandService),_0x375f28=useDependency(LocaleService),_0x3ebc62=useDependency(IDrawingManagerService),_0x222f38=useDependency(IRenderManagerService),{drawings:_0x1039bb}=_0x24f134,_0x13683a=_0x1039bb[0x0];if(_0x13683a==null)return;const {unitId:_0x928ff3}=_0x13683a,_0x39ee2e=_0x222f38[_0x363a31(0x200)](_0x928ff3),_0x1d5002=_0x39ee2e==null?void 0x0:_0x39ee2e['scene'];if(_0x1d5002==null)return;const _0x286910=_0x1d5002[_0x363a31(0x301)](),[_0x357fdc,_0xd66395]=useState(!0x0),_0x4a0f2c=(_0x4a992f=_0x13683a[_0x363a31(0x391)])!=null?_0x4a992f:SheetDrawingAnchorType[_0x363a31(0x352)],[_0x554c75,_0x2b1439]=useState(_0x4a0f2c);function _0x4e4407(_0x381a6e,_0x1e7ec6){const _0x2f9d00=_0x363a31,_0x2240c8=[];return _0x381a6e[_0x2f9d00(0x23c)](_0x4a1765=>{const _0x5a515d=_0x2f9d00,{oKey:_0x4cc7a8}=_0x4a1765,_0x2bc70d=_0x1e7ec6[_0x5a515d(0x1f1)](_0x4cc7a8);if(_0x2bc70d==null)return _0x2240c8[_0x5a515d(0x1dd)](null),!0x0;const {unitId:_0x4ea7e8,subUnitId:_0x3fb710,drawingId:_0x3463b9,drawingType:_0x3a0f95,anchorType:_0x175f29,sheetTransform:_0x52a4b4}=_0x2bc70d;_0x2240c8[_0x5a515d(0x1dd)]({'unitId':_0x4ea7e8,'subUnitId':_0x3fb710,'drawingId':_0x3463b9,'anchorType':_0x175f29,'sheetTransform':_0x52a4b4,'drawingType':_0x3a0f95});}),_0x2240c8;}__name(_0x4e4407,_0x363a31(0x279)),useEffect(()=>{const _0x2aa40a=_0x363a31,_0x203066=_0x286910[_0x2aa40a(0x269)]['subscribe'](_0x1f544e=>{_0x1f544e===!0x0&&_0xd66395(!0x1);}),_0xdfefef=_0x286910['changeStart$']['subscribe'](_0x23719f=>{const _0x365988=_0x2aa40a;var _0x285e18;const {objects:_0x34b11f}=_0x23719f,_0x511746=_0x4e4407(_0x34b11f,_0x3ebc62);if(_0x511746[_0x365988(0x307)]===0x0)_0xd66395(!0x1);else{if(_0x511746[_0x365988(0x307)]>=0x1){_0xd66395(!0x0);const _0x422386=((_0x285e18=_0x511746[0x0])==null?void 0x0:_0x285e18[_0x365988(0x391)])||SheetDrawingAnchorType[_0x365988(0x352)];_0x2b1439(_0x422386);}}});return()=>{_0xdfefef['unsubscribe'](),_0x203066['unsubscribe']();};},[]);function _0x4ab113(_0x29f1a4){const _0xe16b78=_0x363a31;_0x2b1439(_0x29f1a4);const _0x1162b9=_0x3ebc62[_0xe16b78(0x28c)]();if(_0x1162b9[_0xe16b78(0x307)]===0x0)return;const _0x34dcf4=_0x1162b9['map'](_0x1e23a0=>({'unitId':_0x1e23a0['unitId'],'subUnitId':_0x1e23a0[_0xe16b78(0x2f3)],'drawingId':_0x1e23a0[_0xe16b78(0x1be)],'anchorType':_0x29f1a4}));_0x163606[_0xe16b78(0x234)](SetSheetDrawingCommand['id'],{'unitId':_0x1162b9[0x0][_0xe16b78(0x291)],'drawings':_0x34dcf4});}__name(_0x4ab113,_0x363a31(0x38c));const _0x17706d=__name(_0x2fd476=>_0x2fd476?'block':_0x363a31(0x302),_0x363a31(0x2b8));return _0x2b08c1[_0x363a31(0x296)](_0x363a31(0x329),{'className':_0x5733cb(styles[_0x363a31(0x2ae)],styles['imageCommonPanelBorder']),'style':{'display':_0x17706d(_0x357fdc)}},_0x2b08c1[_0x363a31(0x296)]('div',{'className':styles[_0x363a31(0x29f)]},_0x2b08c1[_0x363a31(0x296)]('div',{'className':_0x5733cb(styles[_0x363a31(0x350)],styles[_0x363a31(0x2c1)])},_0x2b08c1[_0x363a31(0x296)](_0x363a31(0x329),null,_0x375f28['t']('drawing-anchor.title')))),_0x2b08c1[_0x363a31(0x296)]('div',{'className':_0x5733cb(styles['imageCommonPanelRow'])},_0x2b08c1[_0x363a31(0x296)](_0x363a31(0x329),{'className':_0x5733cb(styles['imageCommonPanelColumn'])},_0x2b08c1[_0x363a31(0x296)](RadioGroup,{'value':_0x554c75,'onChange':_0x4ab113,'direction':_0x363a31(0x359)},_0x2b08c1['createElement'](Radio,{'value':SheetDrawingAnchorType[_0x363a31(0x341)]},_0x375f28['t']('drawing-anchor.both')),_0x2b08c1[_0x363a31(0x296)](Radio,{'value':SheetDrawingAnchorType['Position']},_0x375f28['t'](_0x363a31(0x38a))),_0x2b08c1[_0x363a31(0x296)](Radio,{'value':SheetDrawingAnchorType[_0x363a31(0x37d)]},_0x375f28['t'](_0x363a31(0x232)))))));},_0x3d4902(0x21d)),SheetDrawingPanel=__name(()=>{const _0x36a5b5=_0x3d4902,_0x39183d=useDependency(IDrawingManagerService),_0x4b8d3e=_0x39183d[_0x36a5b5(0x28c)](),[_0x34b092,_0xaa20a1]=useState(_0x4b8d3e);return useEffect(()=>{const _0x1c99f7=_0x36a5b5,_0x3b695f=_0x39183d[_0x1c99f7(0x28a)]['subscribe'](_0x2dd7d5=>{_0xaa20a1(_0x2dd7d5);});return()=>{const _0x3b3463=_0x1c99f7;_0x3b695f[_0x3b3463(0x335)]();};},[]),!!(_0x34b092!=null&&_0x34b092[_0x36a5b5(0x307)])&&_0x2b08c1['createElement'](_0x36a5b5(0x329),{'className':styles[_0x36a5b5(0x30f)]},_0x2b08c1[_0x36a5b5(0x296)](DrawingCommonPanel,{'drawings':_0x34b092}),_0x2b08c1[_0x36a5b5(0x296)](SheetDrawingAnchor,{'drawings':_0x34b092}));},_0x3d4902(0x337)),menuSchema={[RibbonStartGroup[_0x3d4902(0x37e)]]:{[IMAGE_MENU_ID]:{'order':0x3,'menuItemFactory':ImageMenuFactory,[InsertFloatImageCommand['id']]:{'order':0x0,'menuItemFactory':UploadFloatImageMenuFactory}}}};function whenSheetDrawingFocused(_0x214776){const _0x2b4b92=_0x3d4902;return!_0x214776[_0x2b4b92(0x2a4)](FOCUSING_FX_BAR_EDITOR)&&!_0x214776[_0x2b4b92(0x2a4)](EDITOR_ACTIVATED)&&_0x214776['getContextValue'](FOCUSING_COMMON_DRAWINGS);}__name(whenSheetDrawingFocused,_0x3d4902(0x303));const MoveDrawingDownShortcutItem={'id':MoveDrawingsCommand['id'],'description':_0x3d4902(0x245),'group':_0x3d4902(0x247),'binding':KeyCode[_0x3d4902(0x1de)],'priority':0x64,'preconditions':whenSheetDrawingFocused,'staticParameters':{'direction':Direction['DOWN']}},MoveDrawingUpShortcutItem={'id':MoveDrawingsCommand['id'],'description':'shortcut.sheet.drawing-move-up','group':_0x3d4902(0x247),'binding':KeyCode['ARROW_UP'],'priority':0x64,'preconditions':whenSheetDrawingFocused,'staticParameters':{'direction':Direction['UP']}},MoveDrawingLeftShortcutItem={'id':MoveDrawingsCommand['id'],'description':_0x3d4902(0x2f5),'group':_0x3d4902(0x247),'binding':KeyCode['ARROW_LEFT'],'priority':0x64,'preconditions':whenSheetDrawingFocused,'staticParameters':{'direction':Direction[_0x3d4902(0x21a)]}},MoveDrawingRightShortcutItem={'id':MoveDrawingsCommand['id'],'description':_0x3d4902(0x2d7),'group':_0x3d4902(0x247),'binding':KeyCode[_0x3d4902(0x2c4)],'priority':0x64,'preconditions':whenSheetDrawingFocused,'staticParameters':{'direction':Direction[_0x3d4902(0x2b9)]}},DeleteDrawingsShortcutItem={'id':DeleteDrawingsCommand['id'],'description':_0x3d4902(0x371),'group':_0x3d4902(0x247),'preconditions':whenSheetDrawingFocused,'binding':KeyCode['DELETE'],'mac':KeyCode[_0x3d4902(0x288)]};var __defProp$6=Object[_0x3d4902(0x1c5)],__getOwnPropDesc$6=Object[_0x3d4902(0x358)],__decorateClass$6=__name((_0x3a00cf,_0x30d4e5,_0xf3de13,_0x2e8636)=>{for(var _0x231a38=_0x2e8636>0x1?void 0x0:_0x2e8636?__getOwnPropDesc$6(_0x30d4e5,_0xf3de13):_0x30d4e5,_0x3accd8=_0x3a00cf['length']-0x1,_0x389062;_0x3accd8>=0x0;_0x3accd8--)(_0x389062=_0x3a00cf[_0x3accd8])&&(_0x231a38=(_0x2e8636?_0x389062(_0x30d4e5,_0xf3de13,_0x231a38):_0x389062(_0x231a38))||_0x231a38);return _0x2e8636&&_0x231a38&&__defProp$6(_0x30d4e5,_0xf3de13,_0x231a38),_0x231a38;},_0x3d4902(0x2e6)),__decorateParam$6=__name((_0x28471d,_0x30860d)=>(_0x377239,_0x1991e)=>_0x30860d(_0x377239,_0x1991e,_0x28471d),_0x3d4902(0x2cc)),_a4;let SheetDrawingUIController=(_a4=class extends Disposable{constructor(_0x393aea,_0x248da4,_0x236c74,_0x2bce2e){const _0x521d8a=_0x3d4902;super(),this['_componentManager']=_0x393aea,this['_menuManagerService']=_0x248da4,this[_0x521d8a(0x208)]=_0x236c74,this[_0x521d8a(0x20c)]=_0x2bce2e,this[_0x521d8a(0x306)]();}[_0x3d4902(0x35c)](){const _0x41e9a2=_0x3d4902,_0x4c2dc1=this[_0x41e9a2(0x364)];this[_0x41e9a2(0x26e)](_0x4c2dc1[_0x41e9a2(0x206)](IMAGE_UPLOAD_ICON,AddImageSingle)),this['disposeWithMe'](_0x4c2dc1[_0x41e9a2(0x206)](COMPONENT_SHEET_DRAWING_PANEL,SheetDrawingPanel));}[_0x3d4902(0x1c8)](){const _0x51848e=_0x3d4902;this['_menuManagerService'][_0x51848e(0x233)](menuSchema);}[_0x3d4902(0x2d5)](){const _0x35fcdc=_0x3d4902;[InsertFloatImageCommand,InsertSheetDrawingCommand,RemoveSheetDrawingCommand,SetSheetDrawingCommand,SidebarSheetDrawingOperation,ClearSheetDrawingTransformerOperation,EditSheetDrawingOperation,GroupSheetDrawingCommand,UngroupSheetDrawingCommand,MoveDrawingsCommand,DeleteDrawingsCommand,SetDrawingArrangeCommand][_0x35fcdc(0x23c)](_0xa0acfb=>this[_0x35fcdc(0x26e)](this[_0x35fcdc(0x208)][_0x35fcdc(0x1da)](_0xa0acfb)));}['_initShortcuts'](){const _0x578724=_0x3d4902;[MoveDrawingDownShortcutItem,MoveDrawingUpShortcutItem,MoveDrawingLeftShortcutItem,MoveDrawingRightShortcutItem,DeleteDrawingsShortcutItem][_0x578724(0x23c)](_0x560dba=>{const _0x53e4e6=_0x578724;this[_0x53e4e6(0x26e)](this['_shortcutService'][_0x53e4e6(0x1bf)](_0x560dba));});}[_0x3d4902(0x306)](){const _0x204b4c=_0x3d4902;this[_0x204b4c(0x2d5)](),this[_0x204b4c(0x35c)](),this[_0x204b4c(0x1c8)](),this[_0x204b4c(0x2bd)]();}},__name(_a4,'SheetDrawingUIController'),_a4);SheetDrawingUIController=__decorateClass$6([__decorateParam$6(0x0,Inject(ComponentManager)),__decorateParam$6(0x1,IMenuManagerService),__decorateParam$6(0x2,ICommandService),__decorateParam$6(0x3,IShortcutService)],SheetDrawingUIController);var __defProp$5=Object[_0x3d4902(0x1c5)],__getOwnPropDesc$5=Object[_0x3d4902(0x358)],__decorateClass$5=__name((_0xff5b6c,_0x5066af,_0xd8166a,_0x3c0b07)=>{const _0x2c25f8=_0x3d4902;for(var _0x5299fb=_0x3c0b07>0x1?void 0x0:_0x3c0b07?__getOwnPropDesc$5(_0x5066af,_0xd8166a):_0x5066af,_0x1f26f9=_0xff5b6c[_0x2c25f8(0x307)]-0x1,_0x549e57;_0x1f26f9>=0x0;_0x1f26f9--)(_0x549e57=_0xff5b6c[_0x1f26f9])&&(_0x5299fb=(_0x3c0b07?_0x549e57(_0x5066af,_0xd8166a,_0x5299fb):_0x549e57(_0x5299fb))||_0x5299fb);return _0x3c0b07&&_0x5299fb&&__defProp$5(_0x5066af,_0xd8166a,_0x5299fb),_0x5299fb;},'__decorateClass$5'),__decorateParam$5=__name((_0x5828e4,_0x2d9936)=>(_0x25a92c,_0x32ea7b)=>_0x2d9936(_0x25a92c,_0x32ea7b,_0x5828e4),_0x3d4902(0x210)),_a5;let SheetsDrawingCopyPasteController=(_a5=class extends Disposable{constructor(_0x54135f,_0x4da44f,_0x38361f){const _0x2004ff=_0x3d4902;super(),__publicField(this,_0x2004ff(0x2ec)),(this[_0x2004ff(0x1db)]=_0x54135f,this[_0x2004ff(0x2ef)]=_0x4da44f,this[_0x2004ff(0x2cb)]=_0x38361f,this[_0x2004ff(0x34e)]());}['_initCopyPaste'](){const _0xc54e10=_0x3d4902;this[_0xc54e10(0x1db)]['addClipboardHook']({'id':_0xc54e10(0x2b3),'onBeforeCopy':__name((_0x15ea26,_0x14110b,_0x7f17fa)=>this['_collect'](_0x15ea26,_0x14110b,_0x7f17fa),_0xc54e10(0x365)),'onPasteCells':__name((_0xb078de,_0x4e3918,_0x29119e,_0x4da668)=>{const {copyType:copyType=COPY_TYPE['COPY'],pasteType:_0x3c0dad}=_0x4da668,{range:_0x16e83e}=_0xb078de||{},{range:_0x11f5e5,unitId:_0x3b598d,subUnitId:_0x9dd343}=_0x4e3918;return this['_generateMutations'](_0x11f5e5,{'copyType':copyType,'pasteType':_0x3c0dad,'copyRange':_0x16e83e,'unitId':_0x3b598d,'subUnitId':_0x9dd343});},_0xc54e10(0x2b2)),'onPastePlainText':__name((_0x5e57de,_0x581101)=>({'undos':[],'redos':[]}),_0xc54e10(0x389))});}['_collect'](_0x24524c,_0x2c9bf7,_0x2395c6){const _0x4a9009=_0x3d4902;var _0x439d2e;const _0x511319=(_0x439d2e=this[_0x4a9009(0x2ef)]['getRenderById'](_0x24524c))==null?void 0x0:_0x439d2e[_0x4a9009(0x1f7)](SheetSkeletonManagerService);if(!_0x511319)return;const _0x2c18f9=_0x511319[_0x4a9009(0x366)](_0x2395c6);if(!_0x2c18f9)return;const {startX:_0xce00d7,endX:_0x4c14bf,startY:_0x1e0142,endY:_0x22c259}=_0x2c18f9,_0x5a51f3=this['_sheetDrawingService'][_0x4a9009(0x257)](_0x24524c,_0x2c9bf7),_0x177013=[];Object['keys'](_0x5a51f3)['forEach'](_0x452ee1=>{const _0x4c4a49=_0x4a9009,_0x421286=_0x5a51f3[_0x452ee1],{transform:_0x2e40da}=_0x421286;if(_0x421286[_0x4c4a49(0x391)]!==SheetDrawingAnchorType[_0x4c4a49(0x341)]||!_0x2e40da)return;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0}=_0x2e40da,{drawingStartX:_0x16cd0d,drawingEndX:_0x49a4a6,drawingStartY:_0xe1741d,drawingEndY:_0x412aa1}={'drawingStartX':left,'drawingEndX':left+width,'drawingStartY':top,'drawingEndY':top+height};_0xce00d7<=_0x16cd0d&&_0x49a4a6<=_0x4c14bf&&_0x1e0142<=_0xe1741d&&_0x412aa1<=_0x22c259&&_0x177013[_0x4c4a49(0x1dd)](_0x421286);}),_0x177013[_0x4a9009(0x307)]&&(this[_0x4a9009(0x2ec)]={'drawings':_0x177013,'unitId':_0x24524c,'subUnitId':_0x2c9bf7});}[_0x3d4902(0x342)](_0x67af04,_0x387f17){const _0x578e82=_0x3d4902;var _0x1844ee;if(!this[_0x578e82(0x2ec)])return{'redos':[],'undos':[]};if([PREDEFINED_HOOK_NAME[_0x578e82(0x21c)],PREDEFINED_HOOK_NAME[_0x578e82(0x264)],PREDEFINED_HOOK_NAME['SPECIAL_PASTE_FORMAT'],PREDEFINED_HOOK_NAME['SPECIAL_PASTE_FORMULA']]['includes'](_0x387f17[_0x578e82(0x37c)]))return{'redos':[],'undos':[]};const {copyRange:_0x30970f}=_0x387f17;if(!_0x30970f)return{'redos':[],'undos':[]};const {drawings:_0x6413,unitId:_0x54790b,subUnitId:_0x3b349e}=this[_0x578e82(0x2ec)],{ranges:[_0x593328,_0x475a4e],mapFunc:_0x12a656}=virtualizeDiscreteRanges([_0x30970f,_0x67af04]),{row:_0x3e646b,col:_0x150fe9}=_0x12a656(_0x593328[_0x578e82(0x360)],_0x593328['startColumn']),{row:_0xedee3f,col:_0x228ce4}=_0x12a656(_0x475a4e[_0x578e82(0x360)],_0x475a4e['startColumn']),_0x1e82e3=(_0x1844ee=this[_0x578e82(0x2ef)]['getRenderById'](_0x54790b))==null?void 0x0:_0x1844ee[_0x578e82(0x1f7)](SheetSkeletonManagerService);if(!_0x1e82e3)return{'redos':[],'undos':[]};const _0x30be63=_0x1e82e3[_0x578e82(0x366)]({'startRow':_0x3e646b,'endRow':_0x3e646b,'startColumn':_0x150fe9,'endColumn':_0x150fe9}),_0x4c9066=_0x1e82e3[_0x578e82(0x366)]({'startRow':_0xedee3f,'endRow':_0xedee3f,'startColumn':_0x228ce4,'endColumn':_0x228ce4});if(!_0x30be63||!_0x4c9066)return{'redos':[],'undos':[]};const _0x21da1=[],_0x264e5a=[],_0x1feaaf=_0x4c9066[_0x578e82(0x36e)]-_0x30be63[_0x578e82(0x36e)],_0x4c2fe1=_0x4c9066[_0x578e82(0x34b)]-_0x30be63[_0x578e82(0x34b)],_0x44e52d=_0xedee3f-_0x3e646b,_0x350319=_0x228ce4-_0x150fe9,_0x4def01=_0x387f17[_0x578e82(0x370)]===COPY_TYPE[_0x578e82(0x27f)],{_sheetDrawingService:_0x1335fb}=this;return _0x6413[_0x578e82(0x23c)](_0x4a54fa=>{const _0x57f9b1=_0x578e82,{transform:_0x42f0e6,sheetTransform:_0x1d5c98}=_0x4a54fa;if(!_0x42f0e6)return;const _0x39a31d={..._0x4a54fa,'unitId':_0x54790b,'subUnitId':_0x3b349e,'drawingId':_0x4def01?_0x4a54fa[_0x57f9b1(0x1be)]:Tools[_0x57f9b1(0x322)](),'transform':{..._0x42f0e6,'left':_0x42f0e6[_0x57f9b1(0x242)]+_0x1feaaf,'top':_0x42f0e6[_0x57f9b1(0x326)]+_0x4c2fe1},'sheetTransform':{'to':{..._0x1d5c98['to'],'row':_0x1d5c98['to']['row']+_0x44e52d,'column':_0x1d5c98['to'][_0x57f9b1(0x2ad)]+_0x350319},'from':{..._0x1d5c98[_0x57f9b1(0x237)],'row':_0x1d5c98[_0x57f9b1(0x237)]['row']+_0x44e52d,'column':_0x1d5c98[_0x57f9b1(0x237)][_0x57f9b1(0x2ad)]+_0x350319}}};if(_0x4def01){const {undo:_0x19d518,redo:_0x486fee,objects:_0x108ff1}=_0x1335fb[_0x57f9b1(0x255)]([_0x39a31d]);_0x21da1[_0x57f9b1(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x54790b,'subUnitId':_0x3b349e,'type':DrawingApplyType[_0x57f9b1(0x1cd)],'op':_0x486fee,'objects':_0x108ff1}}),_0x264e5a[_0x57f9b1(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x54790b,'subUnitId':_0x3b349e,'type':DrawingApplyType[_0x57f9b1(0x1cd)],'op':_0x19d518,'objects':_0x108ff1}});}else{const {undo:_0x5efd6f,redo:_0x112f86,objects:_0x42bac1}=_0x1335fb[_0x57f9b1(0x2fc)]([_0x39a31d]);_0x21da1[_0x57f9b1(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'op':_0x112f86,'unitId':_0x54790b,'subUnitId':_0x3b349e,'objects':_0x42bac1,'type':DrawingApplyType['INSERT']}}),_0x264e5a[_0x57f9b1(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'op':_0x5efd6f,'unitId':_0x54790b,'subUnitId':_0x3b349e,'objects':_0x42bac1,'type':DrawingApplyType[_0x57f9b1(0x331)]}});}}),{'redos':_0x21da1,'undos':_0x264e5a};}},__name(_a5,'SheetsDrawingCopyPasteController'),_a5);SheetsDrawingCopyPasteController=__decorateClass$5([__decorateParam$5(0x0,ISheetClipboardService),__decorateParam$5(0x1,IRenderManagerService),__decorateParam$5(0x2,ISheetDrawingService)],SheetsDrawingCopyPasteController);var __defProp$4=Object['defineProperty'],__getOwnPropDesc$4=Object[_0x3d4902(0x358)],__decorateClass$4=__name((_0x540221,_0x57512c,_0xf7c78b,_0x1ae8d6)=>{for(var _0x34d57f=_0x1ae8d6>0x1?void 0x0:_0x1ae8d6?__getOwnPropDesc$4(_0x57512c,_0xf7c78b):_0x57512c,_0x2fbe27=_0x540221['length']-0x1,_0x4c8957;_0x2fbe27>=0x0;_0x2fbe27--)(_0x4c8957=_0x540221[_0x2fbe27])&&(_0x34d57f=(_0x1ae8d6?_0x4c8957(_0x57512c,_0xf7c78b,_0x34d57f):_0x4c8957(_0x34d57f))||_0x34d57f);return _0x1ae8d6&&_0x34d57f&&__defProp$4(_0x57512c,_0xf7c78b,_0x34d57f),_0x34d57f;},_0x3d4902(0x2dd)),__decorateParam$4=__name((_0x172d15,_0x48be39)=>(_0x419598,_0x13fd85)=>_0x48be39(_0x419598,_0x13fd85,_0x172d15),_0x3d4902(0x1c2)),_a6;let SheetDrawingPermissionController=(_a6=class extends Disposable{constructor(_0x1b3060,_0x57e27e,_0x31e851,_0x4f23cd,_0xefc3b4){const _0xe0bd46=_0x3d4902;super(),this['_drawingManagerService']=_0x1b3060,this[_0xe0bd46(0x2ef)]=_0x57e27e,this['_permissionService']=_0x31e851,this['_univerInstanceService']=_0x4f23cd,this['_userManagerService']=_0xefc3b4,this[_0xe0bd46(0x27e)](),this[_0xe0bd46(0x22d)](),this[_0xe0bd46(0x1cf)](),this[_0xe0bd46(0x27a)]();}[_0x3d4902(0x27e)](){const _0x7d55db=_0x3d4902,_0x2845e6=this['_univerInstanceService']['getCurrentTypeOfUnit$'](UniverInstanceType[_0x7d55db(0x1e8)]);this[_0x7d55db(0x26e)](combineLatest([_0x2845e6,this[_0x7d55db(0x256)]['currentUser$']])[_0x7d55db(0x2c2)](([_0x580cd4,_0xea6f18])=>{const _0x1596a1=_0x7d55db;if(!_0x580cd4){this['_drawingManagerService']['setDrawingVisible'](!0x1);return;}_0x580cd4[_0x1596a1(0x339)][_0x1596a1(0x2c2)](_0x3540b9=>{const _0x46a4b5=_0x1596a1;if(!_0x3540b9){this['_drawingManagerService'][_0x46a4b5(0x218)](!0x1);return;}const _0x4f7ec0=_0x580cd4['getUnitId'](),_0x249097=_0x3540b9[_0x46a4b5(0x2df)]();if(this[_0x46a4b5(0x1e4)][_0x46a4b5(0x2b0)]([new WorkbookViewPermission(_0x4f7ec0)['id'],new WorksheetViewPermission(_0x4f7ec0,_0x249097)['id']])[_0x46a4b5(0x32c)](_0x3fd922=>_0x3fd922[_0x46a4b5(0x216)]))this[_0x46a4b5(0x1bd)][_0x46a4b5(0x218)](!0x0);else{this[_0x46a4b5(0x1bd)][_0x46a4b5(0x218)](!0x1);const _0x4971f6=_0x580cd4[_0x46a4b5(0x33a)](),_0x3ee739=_0x3540b9[_0x46a4b5(0x2df)](),_0x20b928=this[_0x46a4b5(0x1bd)][_0x46a4b5(0x257)](_0x4971f6,_0x3ee739),_0x1770f4=Object['values'](_0x20b928),_0x1b1209=this['_renderManagerService'][_0x46a4b5(0x200)](_0x4971f6),_0x42a557=_0x1b1209==null?void 0x0:_0x1b1209['scene'];if(_0x42a557==null)return;_0x42a557[_0x46a4b5(0x2de)]()['forEach'](_0xcbd9eb=>{const _0x28f11a=_0x46a4b5;_0xcbd9eb[_0x28f11a(0x20e)]===RENDER_CLASS_TYPE['IMAGE']&&_0x1770f4[_0x28f11a(0x1d0)](_0x42ccf3=>_0xcbd9eb[_0x28f11a(0x355)][_0x28f11a(0x2a8)](_0x42ccf3[_0x28f11a(0x1be)]))&&_0x42a557[_0x28f11a(0x250)](_0xcbd9eb);});}});}));}[_0x3d4902(0x22d)](){const _0x3f18ca=_0x3d4902,_0x230a07=this[_0x3f18ca(0x2b7)][_0x3f18ca(0x2ee)](UniverInstanceType[_0x3f18ca(0x1e8)]);this[_0x3f18ca(0x26e)](combineLatest([_0x230a07,this['_userManagerService'][_0x3f18ca(0x1e2)]])['subscribe'](([_0x382075,_0x34110f])=>{const _0x2a39d4=_0x3f18ca;if(!_0x382075){this[_0x2a39d4(0x1bd)]['setDrawingEditable'](!0x1);return;}_0x382075['activeSheet$'][_0x2a39d4(0x2c2)](_0x53cc73=>{const _0x8acfef=_0x2a39d4;if(!_0x53cc73){this[_0x8acfef(0x1bd)]['setDrawingEditable'](!0x1);return;}const _0x2faf3c=_0x382075[_0x8acfef(0x33a)](),_0x18b69f=_0x53cc73[_0x8acfef(0x2df)]();if(this[_0x8acfef(0x1e4)][_0x8acfef(0x2b0)]([new WorkbookEditablePermission(_0x2faf3c)['id'],new WorksheetEditPermission(_0x2faf3c,_0x18b69f)['id']])[_0x8acfef(0x32c)](_0xa144b2=>_0xa144b2[_0x8acfef(0x216)]))this[_0x8acfef(0x1bd)][_0x8acfef(0x30d)](!0x0);else{this['_drawingManagerService']['setDrawingEditable'](!0x1);const _0x35813e=_0x382075[_0x8acfef(0x33a)](),_0x43ea0c=_0x53cc73[_0x8acfef(0x2df)](),_0x2b7028=this[_0x8acfef(0x1bd)][_0x8acfef(0x257)](_0x35813e,_0x43ea0c),_0x493863=Object[_0x8acfef(0x32b)](_0x2b7028),_0x5651e6=this[_0x8acfef(0x2ef)]['getRenderById'](_0x35813e),_0xed1673=_0x5651e6==null?void 0x0:_0x5651e6[_0x8acfef(0x34f)];if(_0xed1673==null)return;_0xed1673[_0x8acfef(0x2de)]()[_0x8acfef(0x23c)](_0x1f7d92=>{const _0x4702a3=_0x8acfef;_0x1f7d92[_0x4702a3(0x20e)]===RENDER_CLASS_TYPE[_0x4702a3(0x27c)]&&_0x493863[_0x4702a3(0x1d0)](_0x36ab5d=>_0x1f7d92[_0x4702a3(0x355)][_0x4702a3(0x2a8)](_0x36ab5d['drawingId']))&&_0xed1673[_0x4702a3(0x22a)](_0x1f7d92);});}});}));}['_initViewPermissionChange'](){const _0x3dd344=_0x3d4902,_0x32405b=this[_0x3dd344(0x2b7)]['getCurrentTypeOfUnit$'](UniverInstanceType[_0x3dd344(0x1e8)]);this[_0x3dd344(0x26e)](combineLatest([_0x32405b,this[_0x3dd344(0x256)][_0x3dd344(0x1e2)]])[_0x3dd344(0x2c2)](([_0x550c89,_0x4b38b4])=>{const _0x4da286=_0x3dd344;_0x550c89&&_0x550c89[_0x4da286(0x339)][_0x4da286(0x2c2)](_0x4066d3=>{const _0x4c6afe=_0x4da286;var _0x31f559;if(!_0x4066d3)return;const _0x3a994e=_0x550c89[_0x4c6afe(0x33a)](),_0x4b9b13=_0x4066d3[_0x4c6afe(0x2df)]();let _0x5cb980=!0x0;const _0x2f48af=this[_0x4c6afe(0x2ef)][_0x4c6afe(0x200)](_0x3a994e),_0x5ada29=_0x2f48af==null?void 0x0:_0x2f48af[_0x4c6afe(0x34f)];if(_0x5ada29==null)return;const _0x3abea2=_0x5ada29['getTransformerByCreate'](),_0x17fd5c=this[_0x4c6afe(0x1e4)][_0x4c6afe(0x223)]([new WorkbookViewPermission(_0x3a994e)['id'],new WorksheetViewPermission(_0x3a994e,_0x4b9b13)['id']])[_0x4c6afe(0x1bc)](map(_0x5e98f3=>_0x5e98f3[_0x4c6afe(0x32c)](_0xe9f69=>_0xe9f69[_0x4c6afe(0x216)])));_0x17fd5c==null||_0x17fd5c[_0x4c6afe(0x1bc)](filter(_0x1d25cb=>_0x1d25cb!==_0x5cb980),distinctUntilChanged())[_0x4c6afe(0x2c2)]({'next':__name(_0x44a5a9=>{const _0x59f59f=_0x4c6afe;_0x5cb980=_0x44a5a9,this[_0x59f59f(0x1bd)][_0x59f59f(0x218)](_0x44a5a9);const _0x5068c5=_0x5ada29['getAllObjectsByOrder'](),_0x2dca7b=this[_0x59f59f(0x1bd)][_0x59f59f(0x257)](_0x3a994e,_0x4b9b13),_0x245abe=Object[_0x59f59f(0x32b)](_0x2dca7b);_0x44a5a9?this[_0x59f59f(0x1bd)][_0x59f59f(0x36c)](_0x245abe):(_0x5068c5[_0x59f59f(0x23c)](_0xa3f35d=>{const _0x579630=_0x59f59f;_0xa3f35d[_0x579630(0x20e)]===RENDER_CLASS_TYPE[_0x579630(0x27c)]&&_0x245abe[_0x579630(0x1d0)](_0xb38cab=>_0xa3f35d[_0x579630(0x355)][_0x579630(0x2a8)](_0xb38cab['drawingId']))&&_0x5ada29['removeObject'](_0xa3f35d);}),_0x3abea2['clearSelectedObjects']());},_0x4c6afe(0x24f))}),(_0x31f559=this['_permissionService'][_0x4c6afe(0x2f6)](new WorksheetViewPermission(_0x3a994e,_0x4b9b13)['id']))==null||_0x31f559[_0x4c6afe(0x1bc)](filter(_0x14ef0f=>_0x14ef0f['value']!==_0x5cb980),distinctUntilChanged())[_0x4c6afe(0x2c2)]({'complete':__name(()=>{const _0x1b441c=_0x4c6afe;_0x5cb980=!0x0,this[_0x1b441c(0x1bd)][_0x1b441c(0x218)](!0x0);const _0x3ee8b4=this[_0x1b441c(0x1bd)][_0x1b441c(0x257)](_0x3a994e,_0x4b9b13),_0xd05938=Object[_0x1b441c(0x32b)](_0x3ee8b4);this[_0x1b441c(0x1bd)][_0x1b441c(0x36c)](_0xd05938);},_0x4c6afe(0x2f4))});});}));}['_initEditPermissionChange'](){const _0x2cd0ec=_0x3d4902,_0x2f331a=this[_0x2cd0ec(0x2b7)]['getCurrentTypeOfUnit$'](UniverInstanceType['UNIVER_SHEET']);this[_0x2cd0ec(0x26e)](combineLatest([_0x2f331a,this[_0x2cd0ec(0x256)]['currentUser$']])['subscribe'](([_0x2bd971,_0x18c240])=>{const _0x4874c1=_0x2cd0ec;_0x2bd971&&_0x2bd971[_0x4874c1(0x339)][_0x4874c1(0x2c2)](_0x4fc68f=>{const _0x54ead9=_0x4874c1;var _0x250124;if(!_0x4fc68f)return;const _0x516459=_0x2bd971[_0x54ead9(0x33a)](),_0x104e68=_0x4fc68f[_0x54ead9(0x2df)]();let _0x6ab435=!0x0;const _0x4bb2da=this[_0x54ead9(0x2ef)][_0x54ead9(0x200)](_0x516459),_0x29235d=_0x4bb2da==null?void 0x0:_0x4bb2da[_0x54ead9(0x34f)];if(_0x29235d==null)return;const _0x37c4b6=_0x29235d['getTransformerByCreate'](),_0x1da58c=this[_0x54ead9(0x1e4)][_0x54ead9(0x223)]([new WorkbookEditablePermission(_0x516459)['id'],new WorksheetEditPermission(_0x516459,_0x104e68)['id']])[_0x54ead9(0x1bc)](map(_0x264e94=>_0x264e94[_0x54ead9(0x32c)](_0x1f1198=>_0x1f1198[_0x54ead9(0x216)])));_0x1da58c==null||_0x1da58c[_0x54ead9(0x1bc)](filter(_0x585489=>_0x585489!==_0x6ab435),distinctUntilChanged())[_0x54ead9(0x2c2)]({'next':__name(_0x440929=>{const _0x26019f=_0x54ead9;_0x6ab435=_0x440929,this['_drawingManagerService'][_0x26019f(0x30d)](_0x440929);const _0x3d79d5=_0x29235d[_0x26019f(0x2de)](),_0x395b70=this[_0x26019f(0x1bd)]['getDrawingData'](_0x516459,_0x104e68),_0x1db495=Object['values'](_0x395b70);_0x440929?(_0x3d79d5[_0x26019f(0x23c)](_0x408cef=>{const _0x356c45=_0x26019f;_0x408cef[_0x356c45(0x20e)]===RENDER_CLASS_TYPE[_0x356c45(0x27c)]&&_0x1db495[_0x356c45(0x1d0)](_0x23bc8d=>_0x408cef[_0x356c45(0x355)][_0x356c45(0x2a8)](_0x23bc8d[_0x356c45(0x1be)]))&&_0x29235d['attachTransformerTo'](_0x408cef);}),this[_0x26019f(0x1bd)]['addNotification'](_0x1db495)):(_0x3d79d5[_0x26019f(0x23c)](_0x498897=>{const _0x4ec5ad=_0x26019f;_0x498897['classType']===RENDER_CLASS_TYPE['IMAGE']&&_0x1db495[_0x4ec5ad(0x1d0)](_0x4b43e5=>_0x498897[_0x4ec5ad(0x355)]['includes'](_0x4b43e5[_0x4ec5ad(0x1be)]))&&_0x29235d[_0x4ec5ad(0x22a)](_0x498897);}),_0x37c4b6['clearSelectedObjects']());},_0x54ead9(0x24f))}),(_0x250124=this[_0x54ead9(0x1e4)][_0x54ead9(0x2f6)](new WorksheetEditPermission(_0x516459,_0x104e68)['id']))==null||_0x250124[_0x54ead9(0x1bc)](filter(_0x3fd5de=>_0x3fd5de[_0x54ead9(0x216)]!==_0x6ab435),distinctUntilChanged())['subscribe']({'complete':__name(()=>{const _0x28ab56=_0x54ead9;_0x6ab435=!0x0;const _0x51be31=_0x2bd971[_0x28ab56(0x33a)](),_0x2dd013=_0x4fc68f['getSheetId'](),_0x51563c=this['_drawingManagerService'][_0x28ab56(0x257)](_0x51be31,_0x2dd013),_0x57d266=Object[_0x28ab56(0x32b)](_0x51563c),_0x561ec3=this[_0x28ab56(0x2ef)][_0x28ab56(0x200)](_0x51be31),_0xafffae=_0x561ec3==null?void 0x0:_0x561ec3[_0x28ab56(0x34f)];if(_0xafffae==null)return;this['_drawingManagerService'][_0x28ab56(0x30d)](!0x0),_0xafffae[_0x28ab56(0x2de)]()[_0x28ab56(0x23c)](_0x25de94=>{const _0x3351fd=_0x28ab56;_0x25de94[_0x3351fd(0x20e)]===RENDER_CLASS_TYPE[_0x3351fd(0x27c)]&&_0x57d266[_0x3351fd(0x1d0)](_0x1ed654=>_0x25de94[_0x3351fd(0x355)][_0x3351fd(0x2a8)](_0x1ed654[_0x3351fd(0x1be)]))&&_0xafffae[_0x3351fd(0x22a)](_0x25de94);});},_0x54ead9(0x2f4))});});}));}},__name(_a6,'SheetDrawingPermissionController'),_a6);SheetDrawingPermissionController=__decorateClass$4([__decorateParam$4(0x0,IDrawingManagerService),__decorateParam$4(0x1,IRenderManagerService),__decorateParam$4(0x2,IPermissionService),__decorateParam$4(0x3,IUniverInstanceService),__decorateParam$4(0x4,Inject(UserManagerService))],SheetDrawingPermissionController);var __defProp$3=Object['defineProperty'],__getOwnPropDesc$3=Object[_0x3d4902(0x358)],__decorateClass$3=__name((_0x152c37,_0x5d884b,_0xed789e,_0x209923)=>{for(var _0x464141=_0x209923>0x1?void 0x0:_0x209923?__getOwnPropDesc$3(_0x5d884b,_0xed789e):_0x5d884b,_0x27a6be=_0x152c37['length']-0x1,_0x1f711f;_0x27a6be>=0x0;_0x27a6be--)(_0x1f711f=_0x152c37[_0x27a6be])&&(_0x464141=(_0x209923?_0x1f711f(_0x5d884b,_0xed789e,_0x464141):_0x1f711f(_0x464141))||_0x464141);return _0x209923&&_0x464141&&__defProp$3(_0x5d884b,_0xed789e,_0x464141),_0x464141;},_0x3d4902(0x32a)),__decorateParam$3=__name((_0x2e38e4,_0x456c7c)=>(_0x16628a,_0x57677a)=>_0x456c7c(_0x16628a,_0x57677a,_0x2e38e4),'__decorateParam$3'),_a7;let SheetDrawingPrintingController=(_a7=class extends Disposable{constructor(_0xdddca5,_0x48119d,_0x27d572,_0x6fd15d){const _0x1c3e73=_0x3d4902;super(),this['_sheetPrintInterceptorService']=_0xdddca5,this['_drawingRenderService']=_0x48119d,this[_0x1c3e73(0x1bd)]=_0x27d572,this[_0x1c3e73(0x2ef)]=_0x6fd15d,this['_initPrinting']();}[_0x3d4902(0x369)](){const _0x2b0964=_0x3d4902;this[_0x2b0964(0x26e)](this[_0x2b0964(0x26a)]['interceptor'][_0x2b0964(0x2cf)](this['_sheetPrintInterceptorService'][_0x2b0964(0x2fd)][_0x2b0964(0x24a)]()[_0x2b0964(0x21b)],{'handler':__name((_0x2646d9,_0x5767f6,_0x4ed500)=>{const _0x48d1ce=_0x2b0964,{unitId:_0x24e3ee,scene:_0x5856d1,subUnitId:_0x1311e5}=_0x5767f6,_0x4eaf35=this[_0x48d1ce(0x1bd)]['getDrawingDataForUnit'](_0x24e3ee),_0x13e2ac=_0x4eaf35==null?void 0x0:_0x4eaf35[_0x1311e5];return _0x13e2ac&&_0x13e2ac[_0x48d1ce(0x320)]['forEach'](_0x2a1433=>{const _0x507e60=_0x48d1ce;this['_drawingRenderService'][_0x507e60(0x270)](_0x13e2ac[_0x507e60(0x34d)][_0x2a1433],_0x5856d1);}),_0x4ed500();},_0x2b0964(0x312))})),this[_0x2b0964(0x26e)](this[_0x2b0964(0x26a)][_0x2b0964(0x2fd)]['intercept'](this[_0x2b0964(0x26a)]['interceptor']['getInterceptPoints']()['PRINTING_RANGE'],{'handler':__name((_0x5ea998,_0x2edbf2,_0x463211)=>{const _0xf8045e=_0x2b0964,{unitId:_0xdef2a,subUnitId:_0x52b79c}=_0x2edbf2,_0x4dc218=this[_0xf8045e(0x2ef)][_0xf8045e(0x200)](_0xdef2a);if(!_0x4dc218)return _0x463211(_0x5ea998);const _0x2d5cf4=_0x4dc218[_0xf8045e(0x1f7)](SheetSkeletonManagerService)[_0xf8045e(0x395)](_0x52b79c);if(!_0x2d5cf4)return _0x463211(_0x5ea998);const _0x16e4b2=this['_drawingManagerService'][_0xf8045e(0x2f8)](_0xdef2a),_0x112425=_0x16e4b2==null?void 0x0:_0x16e4b2[_0x2edbf2[_0xf8045e(0x2f3)]];if(!_0x112425)return _0x463211(_0x5ea998);const {scaleX:_0x113801,scaleY:_0x5b6809}=_0x4dc218[_0xf8045e(0x34f)],_0x2a6610=_0x5ea998?{..._0x5ea998}:{'startColumn':0x0,'endColumn':0x0,'endRow':0x0,'startRow':0x0},_0x2a2856=_0x112425[_0xf8045e(0x320)][_0xf8045e(0x38d)](_0x1dee80=>_0x112425[_0xf8045e(0x34d)][_0x1dee80])[_0xf8045e(0x1e3)](_0x4d00b3=>_0x4d00b3[_0xf8045e(0x2d8)]!==DrawingTypeEnum[_0xf8045e(0x26f)]);return _0x2a2856['length']?(_0x2a2856[_0xf8045e(0x23c)](_0xb6ca7=>{const _0x3e257d=_0xf8045e;if(!_0xb6ca7[_0x3e257d(0x33c)]&&_0xb6ca7['transform']&&Tools[_0x3e257d(0x321)](_0xb6ca7[_0x3e257d(0x32e)][_0x3e257d(0x242)])&&Tools['isDefine'](_0xb6ca7[_0x3e257d(0x32e)][_0x3e257d(0x326)])&&Tools[_0x3e257d(0x321)](_0xb6ca7['transform'][_0x3e257d(0x259)])&&Tools[_0x3e257d(0x321)](_0xb6ca7['transform'][_0x3e257d(0x241)])){const _0x403546=_0x2d5cf4[_0x3e257d(0x300)]['getCellPositionByOffset'](_0xb6ca7[_0x3e257d(0x32e)][_0x3e257d(0x242)],_0xb6ca7['transform'][_0x3e257d(0x326)],_0x113801,_0x5b6809,{'x':0x0,'y':0x0}),_0x4c38de=_0x2d5cf4[_0x3e257d(0x300)][_0x3e257d(0x354)](_0xb6ca7[_0x3e257d(0x32e)][_0x3e257d(0x242)]+_0xb6ca7[_0x3e257d(0x32e)][_0x3e257d(0x259)],_0xb6ca7[_0x3e257d(0x32e)][_0x3e257d(0x326)]+_0xb6ca7[_0x3e257d(0x32e)]['height'],_0x113801,_0x5b6809,{'x':0x0,'y':0x0});_0x403546[_0x3e257d(0x2ad)]<_0x2a6610[_0x3e257d(0x336)]&&(_0x2a6610[_0x3e257d(0x336)]=_0x403546['column']),_0x403546[_0x3e257d(0x1ed)]<_0x2a6610['startRow']&&(_0x2a6610[_0x3e257d(0x360)]=_0x403546[_0x3e257d(0x1ed)]),_0x2a6610['endRow']<_0x4c38de[_0x3e257d(0x1ed)]&&(_0x2a6610[_0x3e257d(0x278)]=_0x4c38de['row']),_0x2a6610['endColumn']<_0x4c38de[_0x3e257d(0x2ad)]&&(_0x2a6610['endColumn']=_0x4c38de['column']);}}),_0x463211(_0x2a6610)):_0x463211(_0x5ea998);},_0x2b0964(0x312))}));}},__name(_a7,_0x3d4902(0x316)),_a7);SheetDrawingPrintingController=__decorateClass$3([__decorateParam$3(0x0,Inject(SheetPrintInterceptorService)),__decorateParam$3(0x1,Inject(DrawingRenderService)),__decorateParam$3(0x2,IDrawingManagerService),__decorateParam$3(0x3,IRenderManagerService)],SheetDrawingPrintingController);function _0x3354(){const _0x4c5c17=['getNoMergeCellPositionByIndexWithNoHeader','icon','generateShortUuid','_getFloatDomProps','univer-upload-loading','SheetDrawingTransformAffectedController','string','BACKSPACE','rowOffset','focus$','undo','getFocusDrawings','_focusDrawingListener','trim','_initDependencies','30fFjmWR','unitId','getObject','hasOwnProperty','refreshTransform','endX','createElement','subscribeEvent','focusDrawing','onCommandExecuted','_updateImageListener','current','getDrawingOrder','actualRow','pushUndoRedo','imageCommonPanelRow','sheetTransform','getCurrentSelections','DrawingPopupMenuController','getForwardDrawingsOp','getContextValue','rect','univer-image-common-panel-row-vertical','getAllUnitsForType','includes','actualColumn','pluginName','sheet.command.set-drawing-arrange','svg','column','imageCommonPanelGrid','newSheetTransform','composePermission','set','onPasteCells','SHEET_IMAGE_UI_PLUGIN','random','_refreshDrawingTransform','onStarting','_univerInstanceService','gridDisplay','RIGHT','_featureUpdateListener','registerRenderModule','onPointerDown','_initShortcuts','apply','path','_insertFloatImage','imageCommonPanelTitle','subscribe','replaceRuntimeIdsInDefs','ARROW_RIGHT','univer-sheet-image-menu-input','sidebar.operation.sheet-image','_contextService','get','currentColor','uploadLoadingBody','_sheetDrawingService','__decorateParam$6','renderObject','_scrollUpdateListener','intercept','children','transformChange$','dispose$','addHook','_skeletonManagerService','_initCommands','_removeDom','shortcut.sheet.drawing-move-right','drawingType','__decorateParam$2','_getSceneAndTransformerByDrawingSearch','_drawingAddListener','UNGROUP','__decorateClass$4','getAllObjectsByOrder','getSheetId','close','3PTKWSx','function','removeRender','28rKGJjz','_injector','__decorateClass$6','_canvasPopManagerService','worksheet','_getUpdateOrDeleteDrawings','getFreeze','extend','_copyInfo','getUngroupDrawingOp','getCurrentTypeOfUnit$','_renderManagerService','registerComponent','_create','registerDrawingData','subUnitId','complete','shortcut.sheet.drawing-move-left','getPermissionPoint$','indexOf','getDrawingDataForUnit','sheet.command.ungroup-sheet-image','_localeService','featurePluginGroupUpdate$','getBatchAddOp','interceptor','insert','engine','skeleton','getTransformerByCreate','none','whenSheetDrawingFocused','SUBITEMS','removeFloatDom','_init','length','SheetDrawingUpdateController','columnOffset','defs','ImageMenuFactory','intersects','setDrawingEditable','add-image-single','imageCommonPanel','_sheetInterceptorService','UploadFloatImageMenuFactory','handler','getSelectedObjectMap','getTypeOfUnitDisposed$','getOwnPropertySymbols','SheetDrawingPrintingController','univer-image-common-panel-span2','_deleteListener','remove','addFloatDom','asObservable','syncExecuteCommand','_sheetSelectionRenderService','transformToDrawingPosition','getActiveSheet','order','isDefine','generateRandomId','change$','_context','transformByState','top','delete','replace','div','__decorateClass$3','values','every','_config','transform','sheetImage.panel.title','_ensureMap','REMOVE','_getDrawingUndoForRowVisible','uploadLoadingBodyText','redo','unsubscribe','startColumn','SheetDrawingPanel','_getImageMenuItems','activeSheet$','getUnitId','substring','groupId','type','_groupDrawingListener','__decorateClass$7','featurePluginUngroupUpdate$','Both','_generateMutations','M2.2498\x203.65005C2.2498\x202.87685\x202.87661\x202.25005\x203.64981\x202.25005H7.9998C8.33118\x202.25005\x208.5998\x201.98142\x208.5998\x201.65005C8.5998\x201.31868\x208.33118\x201.05005\x207.9998\x201.05005H3.64981C2.21387\x201.05005\x201.0498\x202.21411\x201.0498\x203.65005V12.35C1.0498\x2013.786\x202.21386\x2014.95\x203.6498\x2014.95H12.3498C13.7857\x2014.95\x2014.9498\x2013.786\x2014.9498\x2012.3501V8.00005C14.9498\x207.66868\x2014.6812\x207.40005\x2014.3498\x207.40005C14.0184\x207.40005\x2013.7498\x207.66868\x2013.7498\x208.00005V9.23974L12.2385\x208.1063C11.7252\x207.72129\x2011.0068\x207.7723\x2010.5531\x208.22605L9.00869\x209.77041L6.73916\x207.8251C6.24387\x207.40055\x205.5095\x207.41278\x205.02864\x207.85359L2.2498\x2010.4009V3.65005ZM2.2498\x2012.0287V12.35C2.2498\x2013.1232\x202.87661\x2013.75\x203.6498\x2013.75H12.3498C13.123\x2013.75\x2013.7498\x2013.1232\x2013.7498\x2012.3501V10.7397L11.5186\x209.06631C11.4829\x209.03956\x2011.433\x209.04314\x2011.4016\x209.07458L9.92249\x2010.5537L11.1015\x2011.5642C11.3531\x2011.7799\x2011.3822\x2012.1587\x2011.1666\x2012.4103C10.9509\x2012.6619\x2010.5721\x2012.691\x2010.3205\x2012.4753L5.9582\x208.7362C5.92384\x208.70674\x205.87288\x208.70758\x205.83952\x208.73816L2.2498\x2012.0287Z','add','sheet.command.set-sheet-image','_sheetSkeletonManagerService','_hooks','ERROR_EXCEED_SIZE','_registerRenderModules','sheetImage.title','startY','drawingPositionToTransform','data','_initCopyPaste','scene','imageCommonPanelColumn','2904eKKoAZ','Position','__decorateParam$1','getCellPositionByOffset','oKey','ARRANGE','dispatchEvent','getOwnPropertyDescriptor','vertical','univer-image-common-panel','featurePluginUpdate$','_initCustomComponents','addition-and-subtraction-single','univer-sheet-image-menu','_commandListener','startRow','className','_messageService','endColumn','_componentManager','onBeforeCopy','attachRangeWithCoord','getAncestorScale','M11.8097\x201.14783C12.1411\x201.14783\x2012.4097\x201.41646\x2012.4097\x201.74783V3.297H14.1541C14.4855\x203.297\x2014.7541\x203.56563\x2014.7541\x203.897C14.7541\x204.22837\x2014.4855\x204.497\x2014.1541\x204.497H12.4097V6.24167C12.4097\x206.57304\x2012.1411\x206.84167\x2011.8097\x206.84167C11.4783\x206.84167\x2011.2097\x206.57304\x2011.2097\x206.24167V4.497H9.6603C9.32893\x204.497\x209.0603\x204.22837\x209.0603\x203.897C9.0603\x203.56563\x209.32893\x203.297\x209.6603\x203.297H11.2097V1.74783C11.2097\x201.41646\x2011.4783\x201.14783\x2011.8097\x201.14783Z','_initPrinting','univer-image-common-panel-subtitle','_selectionRenderService','addNotification','url(#$1','startX','_getUnitIdAndSubUnitId','copyType','shortcut.sheet.drawing-delete','_uiPartsService','2753784mWGiyD','setConfig','parent','splice','onClose','image-popup.delete','_createUndoAndRedoMutation','_getDrawingUndoForColVisible','use','pasteType','None','FORMULAS_INSERT','VIEW_MAIN','sheets-drawing-ui.config','_getImagePosition','onWheel','uploadLoadingBodyAnimation','keys','update$','getMutations','BUTTON','changing$','onPastePlainText','drawing-anchor.position','_expandCol','handleChange','map','_sheetRefreshListener','sheet.command.insert-sheet-image','sheet.operation.clear-drawing-transformer','anchorType','univer-upload-loading-body-text','_domLayerMap','13321200hyOfqM','getWorksheetSkeleton','displayName','pipe','_drawingManagerService','drawingId','registerShortcut','allowTransform','columnHeaderHeight','__decorateParam$4','getCurrentTypeOfRenderer','_moveColInterceptor','defineProperty','concat','_drawingInitializeListener','_initMenus','getCurrent','front','evenodd','GROUP','UPDATE','_workbookSelections','_initViewPermissionChange','some','DRAWING_GROUP','_getDrawingUndoForRowAndColSize','_remainDrawingSize','sheet.menu.image','UniverSheetsDrawingUIPlugin','_hasCropObject','659935Gzljml','_dispose','objects','registerCommand','_sheetClipboardService','_getRangeMoveUndo','push','ARROW_DOWN','__decorateClass$1','backward','DOWN','currentUser$','filter','_permissionService','size','_getUnitInfo','calcPosition','UNIVER_SHEET','featurePluginOrderUpdate$','getBatchRemoveOp','symbol','has','row','xlink:href','INSERT','drawingManagerData','getDrawingOKey','sheet.command.remove-sheet-image','unit','univer-image-common-panel-span3','replaceRuntimeIdsAndExtInAttrs','_transformChange$','with','removeNotification','absolute','image/','openFile','getDrawingByParam','update-status.exceedMaxSize','OPERATION','DRAWING_IMAGE','getRenderById','_moveRowInterceptor','SheetsDrawingRenderController','onReady','endY','open','register','sheet.command.insert-float-image','_commandService','univer-image-common-panel-row','_remove$','defIds','_shortcutService','setContextValue','classType','1097912ZLXxTP','__decorateParam$5','max','groupToUngroup','colorChannel1','ERROR_IMAGE','onPointerMove','value','COMMAND','setDrawingVisible','_fileOpenerService','LEFT','PRINTING_COMPONENT_COLLECT','SPECIAL_PASTE_COL_WIDTH','SheetDrawingAnchor','prototype','min','updateSheet','image-popup.reset','call','composePermission$','SheetCanvasFloatDomManagerService','_configService','_shrinkRow','range','fill','univerjs-icon\x20univerjs-icon-','detachTransformerFrom','__decorateParam$9','univer-image-common-panel-input','_initDrawingEditable','UniverIcon','remove$','_domLayerInfoMap','_shrinkCol','drawing-anchor.none','mergeMenu','executeCommand','_sheetInterceptorListener','update-status.exceedMaxCount','from','onTransformChange$','getViewport','__decorateParam$7','attachTransformerTo','forEach','update-status.invalidImage','univer-UniverCircleAnimation','__decorateParam','getTransformer','height','left','_imageIoService','1em','shortcut.sheet.drawing-move-down','__publicField','4_sheet-drawing-view','getSelectionCellByPosition','MUTATION','getInterceptPoints','_updateOrderListener','rowHeaderWidth','horizontal','3891447pLbzmW','next','removeObject','AddImageSingle','saveImage','getCurrentSkeleton','entries','getBatchUpdateOp','_userManagerService','getDrawingData','_popupMenuListener','width','_getPosition','univer-upload-loading-body-animation','univer-image-common-panel-title','CONTENT','add$','insertFloatImage','initializeNotification','tag','getFrontDrawingsOp','_initImagePopupMenu','SPECIAL_PASTE_VALUE','_moveRangeInterceptor','0\x200\x2016\x2016','_canvasFloatDomService','toString','clearControl$','_sheetPrintInterceptorService','findIndex','newTransform','_expandRow','disposeWithMe','DRAWING_DOM','renderDrawing','ERROR_IMAGE_TYPE','dispose','attrs','onPointerUp','transformBound2DOMBound','918668xAdoKJ','idSuffix','endRow','getUpdateParams','_initEditPermissionChange','Error','IMAGE','show','_initDrawingVisible','CUT','params'];_0x3354=function(){return _0x4c5c17;};return _0x3354();}var __defProp$2=Object[_0x3d4902(0x1c5)],__getOwnPropDesc$2=Object[_0x3d4902(0x358)],__decorateClass$2=__name((_0x453a1d,_0x801dc7,_0x1859cb,_0x8fd9fe)=>{const _0x4066a8=_0x3d4902;for(var _0x26df8f=_0x8fd9fe>0x1?void 0x0:_0x8fd9fe?__getOwnPropDesc$2(_0x801dc7,_0x1859cb):_0x801dc7,_0x2b4a08=_0x453a1d[_0x4066a8(0x307)]-0x1,_0xbba711;_0x2b4a08>=0x0;_0x2b4a08--)(_0xbba711=_0x453a1d[_0x2b4a08])&&(_0x26df8f=(_0x8fd9fe?_0xbba711(_0x801dc7,_0x1859cb,_0x26df8f):_0xbba711(_0x26df8f))||_0x26df8f);return _0x8fd9fe&&_0x26df8f&&__defProp$2(_0x801dc7,_0x1859cb,_0x26df8f),_0x26df8f;},'__decorateClass$2'),__decorateParam$2=__name((_0x444deb,_0xb7f9f3)=>(_0x2f30c5,_0x14e040)=>_0xb7f9f3(_0x2f30c5,_0x14e040,_0x444deb),_0x3d4902(0x2d9));const UPDATE_COMMANDS=[InsertRowCommand['id'],InsertColCommand['id'],RemoveRowCommand['id'],RemoveColCommand['id'],DeleteRangeMoveLeftCommand['id'],DeleteRangeMoveUpCommand['id'],InsertRangeMoveDownCommand['id'],InsertRangeMoveRightCommand['id'],DeltaRowHeightCommand['id'],SetRowHeightCommand['id'],DeltaColumnWidthCommand['id'],SetColWidthCommand['id'],SetRowHiddenCommand['id'],SetSpecificRowsVisibleCommand['id'],SetSpecificColsVisibleCommand['id'],SetColHiddenCommand['id'],MoveColsCommand['id'],MoveRowsCommand['id'],MoveRangeCommand['id']],REFRESH_MUTATIONS=[SetRowVisibleMutation['id'],SetRowHiddenMutation['id'],SetColVisibleMutation['id'],SetColHiddenMutation['id'],SetWorksheetRowHeightMutation['id'],SetWorksheetColWidthMutation['id']];var _a8;let SheetDrawingTransformAffectedController=(_a8=class extends Disposable{constructor(_0xa11ad1,_0x4e3fb8,_0x35e151,_0x59307d,_0x56d51e,_0x11c16e,_0x2ab288,_0x5f4204,_0xbd409b){const _0xbedace=_0x3d4902;super(),this[_0xbedace(0x324)]=_0xa11ad1,this[_0xbedace(0x2ef)]=_0x4e3fb8,this[_0xbedace(0x208)]=_0x35e151,this[_0xbedace(0x36b)]=_0x59307d,this[_0xbedace(0x2d4)]=_0x56d51e,this[_0xbedace(0x310)]=_0x11c16e,this['_sheetDrawingService']=_0x2ab288,this[_0xbedace(0x1bd)]=_0x5f4204,this[_0xbedace(0x2b7)]=_0xbd409b,this[_0xbedace(0x235)](),this[_0xbedace(0x35f)](),this[_0xbedace(0x38e)]();}[_0x3d4902(0x235)](){const _0x29ec91=_0x3d4902;this[_0x29ec91(0x26e)](this[_0x29ec91(0x310)]['interceptCommand']({'getMutations':__name(_0x501de5=>{const _0xed6ad=_0x29ec91;if(!UPDATE_COMMANDS[_0xed6ad(0x2a8)](_0x501de5['id']))return{'redos':[],'undos':[]};if(_0x501de5['params']==null)return{'redos':[],'undos':[]};const _0x3fdd11=_0x501de5['id'];if(_0x3fdd11===InsertRowCommand['id'])return this[_0xed6ad(0x201)](_0x501de5['params'],_0xed6ad(0x2fe));if([MoveColsCommand['id'],MoveRowsCommand['id'],MoveRangeCommand['id']][_0xed6ad(0x2a8)](_0x3fdd11))return this[_0xed6ad(0x265)](_0x501de5[_0xed6ad(0x280)]);if(_0x3fdd11===InsertColCommand['id'])return this[_0xed6ad(0x1c4)](_0x501de5[_0xed6ad(0x280)],_0xed6ad(0x2fe));if(_0x3fdd11===RemoveRowCommand['id'])return this['_moveRowInterceptor'](_0x501de5[_0xed6ad(0x280)],_0xed6ad(0x319));if(_0x3fdd11===RemoveColCommand['id'])return this[_0xed6ad(0x1c4)](_0x501de5['params'],_0xed6ad(0x319));if(_0x3fdd11===DeleteRangeMoveLeftCommand['id']){const {range:_0x1ebdd0}=_0x501de5[_0xed6ad(0x280)];return this[_0xed6ad(0x1dc)](_0x1ebdd0,0x0);}else{if(_0x3fdd11===DeleteRangeMoveUpCommand['id']){const {range:_0xb7ca11}=_0x501de5[_0xed6ad(0x280)];return this[_0xed6ad(0x1dc)](_0xb7ca11,0x1);}else{if(_0x3fdd11===InsertRangeMoveDownCommand['id']){const {range:_0x547766}=_0x501de5[_0xed6ad(0x280)];return this[_0xed6ad(0x1dc)](_0x547766,0x2);}else{if(_0x3fdd11===InsertRangeMoveRightCommand['id']){const {range:_0x4dfdf4}=_0x501de5[_0xed6ad(0x280)];return this['_getRangeMoveUndo'](_0x4dfdf4,0x3);}else{if(_0x3fdd11===SetRowHiddenCommand['id']||_0x3fdd11===SetSpecificRowsVisibleCommand['id']){const _0x1f9ee4=_0x501de5['params'],{unitId:_0x54e190,subUnitId:_0x26457a,ranges:_0x4203c8}=_0x1f9ee4;return this['_getDrawingUndoForRowVisible'](_0x54e190,_0x26457a,_0x4203c8);}else{if(_0x3fdd11===SetSpecificColsVisibleCommand['id']||_0x3fdd11===SetColHiddenCommand['id']){const _0x32109b=_0x501de5['params'],{unitId:_0x57d559,subUnitId:_0x321e74,ranges:_0x31b4b0}=_0x32109b;return this['_getDrawingUndoForColVisible'](_0x57d559,_0x321e74,_0x31b4b0);}else{if(_0x3fdd11===DeltaRowHeightCommand['id']||_0x3fdd11===SetRowHeightCommand['id']||_0x3fdd11===DeltaColumnWidthCommand['id']||_0x3fdd11===SetColWidthCommand['id']){const _0x5dfe4e=_0x501de5[_0xed6ad(0x280)],{unitId:_0x420a49,subUnitId:_0xd77743,ranges:_0x2b48bd}=_0x5dfe4e,_0xb6b2b8=_0x3fdd11===DeltaRowHeightCommand['id']||_0x3fdd11===SetRowHeightCommand['id'];return this[_0xed6ad(0x1d2)](_0x420a49,_0xd77743,_0x2b48bd,_0xb6b2b8);}}}}}}}return{'redos':[],'undos':[]};},_0x29ec91(0x386))}));}[_0x3d4902(0x1dc)](_0x3c735e,_0x1468ea){const _0x28cedd=_0x3d4902,_0x1c5521=getSheetCommandTarget(this[_0x28cedd(0x2b7)]);if(_0x1c5521==null)return{'redos':[],'undos':[]};const _0x6e9424=_0x1c5521['unitId'],_0x40d26f=_0x1c5521[_0x28cedd(0x2f3)],_0x2e2d06=[],_0x3a326d=[],_0x1ba97d=this[_0x28cedd(0x2cb)][_0x28cedd(0x257)](_0x6e9424,_0x40d26f),_0x1e2305=[],_0x1a028a=[];if(Object['keys'](_0x1ba97d)[_0x28cedd(0x23c)](_0x1c0a11=>{const _0x29a243=_0x28cedd,_0x4d7256=_0x1ba97d[_0x1c0a11],{updateDrawings:_0x2bae9a,deleteDrawings:_0x5efa6e}=this['_getUpdateOrDeleteDrawings'](_0x3c735e,_0x1468ea,_0x4d7256);_0x1e2305[_0x29a243(0x1dd)](..._0x2bae9a),_0x1a028a['push'](..._0x5efa6e);}),_0x1e2305[_0x28cedd(0x307)]===0x0&&_0x1a028a['length']===0x0)return{'redos':[],'undos':[]};if(_0x1e2305['length']>0x0){const _0x1bbc8a=this[_0x28cedd(0x2cb)][_0x28cedd(0x255)](_0x1e2305),{undo:_0x1d31e1,redo:_0x33ba08,objects:_0x15b714}=_0x1bbc8a;_0x2e2d06[_0x28cedd(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x6e9424,'subUnitId':_0x40d26f,'op':_0x33ba08,'objects':_0x15b714,'type':DrawingApplyType[_0x28cedd(0x1cd)]}}),_0x3a326d[_0x28cedd(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x6e9424,'subUnitId':_0x40d26f,'op':_0x1d31e1,'objects':_0x15b714,'type':DrawingApplyType[_0x28cedd(0x1cd)]}});}if(_0x1a028a[_0x28cedd(0x307)]>0x0){const _0xec87f5=this[_0x28cedd(0x2cb)]['getBatchRemoveOp'](_0x1a028a),_0x4b6eb8=_0xec87f5[_0x28cedd(0x28b)],_0x3da840=_0xec87f5[_0x28cedd(0x334)],_0x10ac45=_0xec87f5[_0x28cedd(0x1d9)];_0x2e2d06[_0x28cedd(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x6e9424,'subUnitId':_0x40d26f,'op':_0x3da840,'objects':_0x10ac45,'type':DrawingApplyType['REMOVE']}}),_0x3a326d['push']({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x6e9424,'subUnitId':_0x40d26f,'op':_0x4b6eb8,'objects':_0x10ac45,'type':DrawingApplyType['INSERT']}});}return _0x2e2d06[_0x28cedd(0x1dd)]({'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x6e9424]}),_0x3a326d[_0x28cedd(0x1dd)]({'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x6e9424]}),{'redos':_0x2e2d06,'undos':_0x3a326d};}[_0x3d4902(0x2e9)](_0x3894d5,_0x2ef4d7,_0x2adbc4){const _0x11c33d=_0x3d4902,_0x50784b=[],_0x53017c=[],{sheetTransform:_0x215adb,anchorType:anchorType=SheetDrawingAnchorType[_0x11c33d(0x352)],transform:_0x443b0e,unitId:_0x30a1b7,subUnitId:_0x30d04b,drawingId:_0x20cdfb}=_0x2adbc4,{from:_0x1a33fc,to:_0x337100}=_0x215adb,{row:_0x410d24,column:_0x19a56f}=_0x1a33fc,{row:_0xb3ddb2,column:_0xb575fb}=_0x337100;if(_0x215adb==null||_0x443b0e==null)return{'updateDrawings':_0x50784b,'deleteDrawings':_0x53017c};const {startRow:_0x9bdc72,endRow:_0x4fe437,startColumn:_0x5efc2f,endColumn:_0x3c5151}=_0x3894d5;let _0x13d5a8=null,_0x32bafe=null;if(_0x2ef4d7===0x0&&_0x410d24>=_0x9bdc72&&_0xb3ddb2<=_0x4fe437){if(_0x19a56f>=_0x5efc2f&&_0xb575fb<=_0x3c5151)_0x53017c[_0x11c33d(0x1dd)]({'unitId':_0x30a1b7,'subUnitId':_0x30d04b,'drawingId':_0x20cdfb});else{const _0x244e60=this['_shrinkCol'](_0x215adb,_0x443b0e,_0x5efc2f,_0x3c5151,anchorType);_0x13d5a8=_0x244e60==null?void 0x0:_0x244e60[_0x11c33d(0x2af)],_0x32bafe=_0x244e60==null?void 0x0:_0x244e60['newTransform'];}}else{if(_0x2ef4d7===0x1&&_0x19a56f>=_0x5efc2f&&_0xb575fb<=_0x3c5151){if(_0x410d24>=_0x9bdc72&&_0xb3ddb2<=_0x4fe437)_0x53017c[_0x11c33d(0x1dd)]({'unitId':_0x30a1b7,'subUnitId':_0x30d04b,'drawingId':_0x20cdfb});else{const _0x43304b=this[_0x11c33d(0x226)](_0x215adb,_0x443b0e,_0x9bdc72,_0x4fe437,anchorType);_0x13d5a8=_0x43304b==null?void 0x0:_0x43304b[_0x11c33d(0x2af)],_0x32bafe=_0x43304b==null?void 0x0:_0x43304b['newTransform'];}}else{if(_0x2ef4d7===0x2){const _0x252f9f=this[_0x11c33d(0x26d)](_0x215adb,_0x443b0e,_0x9bdc72,_0x4fe437,anchorType);_0x13d5a8=_0x252f9f==null?void 0x0:_0x252f9f[_0x11c33d(0x2af)],_0x32bafe=_0x252f9f==null?void 0x0:_0x252f9f['newTransform'];}else{if(_0x2ef4d7===0x3){const _0x345e2c=this[_0x11c33d(0x38b)](_0x215adb,_0x443b0e,_0x5efc2f,_0x3c5151,anchorType);_0x13d5a8=_0x345e2c==null?void 0x0:_0x345e2c['newSheetTransform'],_0x32bafe=_0x345e2c==null?void 0x0:_0x345e2c['newTransform'];}}}}if(_0x13d5a8!=null&&_0x32bafe!=null){const _0x4bf3f2=drawingPositionToTransform(_0x13d5a8,this[_0x11c33d(0x36b)],this[_0x11c33d(0x2d4)]);_0x50784b[_0x11c33d(0x1dd)]({..._0x2adbc4,'sheetTransform':_0x13d5a8,'transform':_0x4bf3f2});}return{'updateDrawings':_0x50784b,'deleteDrawings':_0x53017c};}['_remainDrawingSize'](_0x46b241,_0x59d2e1,_0x567f40){const _0x49b972=_0x3d4902,_0x3b82cd=transformToDrawingPosition({..._0x46b241},this['_selectionRenderService']);_0x3b82cd!=null&&_0x59d2e1[_0x49b972(0x1dd)]({..._0x567f40,'sheetTransform':_0x3b82cd});}[_0x3d4902(0x37a)](_0x4971b5,_0x2fd31b,_0x1c98f1){const _0x44d340=_0x3d4902,_0x344fca=this['_drawingManagerService']['getDrawingData'](_0x4971b5,_0x2fd31b),_0x428c74=[],_0x23077c=[];if(Object[_0x44d340(0x384)](_0x344fca)[_0x44d340(0x23c)](_0x2fe849=>{const _0x5231e2=_0x44d340,_0x20b04d=_0x344fca[_0x2fe849],{sheetTransform:_0x5b2a70,transform:_0x3dcb8e,anchorType:anchorType=SheetDrawingAnchorType[_0x5231e2(0x352)]}=_0x20b04d;if(anchorType===SheetDrawingAnchorType[_0x5231e2(0x37d)])this[_0x5231e2(0x1d3)](_0x3dcb8e,_0x428c74,_0x20b04d);else{const {from:_0x5504ab,to:_0xdedd3a}=_0x5b2a70,{row:_0x498f74,column:_0x2eaa77}=_0x5504ab,{row:_0x16f2f6,column:_0x21ad9a}=_0xdedd3a;for(let _0x6e039e=0x0;_0x6e039e<_0x1c98f1[_0x5231e2(0x307)];_0x6e039e++){const _0x3c73dc=_0x1c98f1[_0x6e039e],{startRow:_0x515018,endRow:_0x356c99,startColumn:_0x577bd1,endColumn:_0x2d330e}=_0x3c73dc;if(_0x21ad9a<_0x577bd1)continue;if(anchorType===SheetDrawingAnchorType[_0x5231e2(0x352)]){let _0x2f13a0=null,_0x406ec8=null;if(_0x2eaa77>=_0x577bd1&&_0x2eaa77<=_0x2d330e){const _0x9e8b94=this['_skeletonManagerService'][_0x5231e2(0x366)]({'startColumn':_0x2eaa77,'endColumn':_0x2d330e,'startRow':_0x5504ab[_0x5231e2(0x1ed)],'endRow':_0xdedd3a[_0x5231e2(0x1ed)]});if(_0x9e8b94==null)return;_0x406ec8={..._0x3dcb8e,'left':_0x9e8b94[_0x5231e2(0x36e)]};}if(_0x406ec8!=null&&(_0x2f13a0=transformToDrawingPosition(_0x406ec8,this[_0x5231e2(0x36b)]),_0x2f13a0!=null&&_0x406ec8!=null)){_0x428c74[_0x5231e2(0x1dd)]({..._0x20b04d,'sheetTransform':_0x2f13a0,'transform':_0x406ec8});break;}this[_0x5231e2(0x1d3)](_0x3dcb8e,_0x428c74,_0x20b04d);continue;}if(_0x2eaa77>=_0x577bd1&&_0x21ad9a<=_0x2d330e)continue;let _0x178f11=null,_0x257645=null;if(_0x2eaa77>=_0x577bd1&&_0x2eaa77<=_0x2d330e){const _0x2474da=this['_skeletonManagerService']['attachRangeWithCoord']({'startColumn':_0x2eaa77,'endColumn':_0x2d330e,'startRow':_0x5504ab['row'],'endRow':_0xdedd3a[_0x5231e2(0x1ed)]});if(_0x2474da==null)return;_0x257645={..._0x3dcb8e,'left':(_0x2474da==null?void 0x0:_0x2474da['startX'])||0x0,'width':((_0x3dcb8e==null?void 0x0:_0x3dcb8e[_0x5231e2(0x259)])||0x0)-_0x2474da['endX']+_0x2474da[_0x5231e2(0x36e)]};}else{if(_0x21ad9a>=_0x577bd1&&_0x21ad9a<=_0x2d330e){const _0x3b2df3=this[_0x5231e2(0x2d4)][_0x5231e2(0x366)]({'startColumn':_0x577bd1,'endColumn':_0x21ad9a,'startRow':_0x5504ab[_0x5231e2(0x1ed)],'endRow':_0xdedd3a[_0x5231e2(0x1ed)]});if(_0x3b2df3==null)return;_0x257645={..._0x3dcb8e,'left':_0x3b2df3[_0x5231e2(0x36e)]-((_0x3dcb8e==null?void 0x0:_0x3dcb8e[_0x5231e2(0x259)])||0x0)};}else{const _0x583a71=this[_0x5231e2(0x2d4)][_0x5231e2(0x366)]({'startColumn':_0x577bd1,'endColumn':_0x2d330e,'startRow':_0x5504ab[_0x5231e2(0x1ed)],'endRow':_0xdedd3a['row']});if(_0x583a71==null)return;if(_0x257645={..._0x3dcb8e,'width':((_0x3dcb8e==null?void 0x0:_0x3dcb8e['width'])||0x0)-_0x583a71['endX']+_0x583a71['startX']},_0x178f11=transformToDrawingPosition(_0x257645,this['_selectionRenderService']),_0x178f11!=null&&_0x257645!=null){_0x23077c[_0x5231e2(0x1dd)]({..._0x20b04d,'sheetTransform':_0x178f11,'transform':_0x257645});break;}}}if(_0x257645!=null&&(_0x178f11=transformToDrawingPosition(_0x257645,this['_selectionRenderService'])),_0x257645!=null&&_0x178f11!=null){_0x428c74[_0x5231e2(0x1dd)]({..._0x20b04d,'sheetTransform':_0x178f11,'transform':_0x257645});break;}else this[_0x5231e2(0x1d3)](_0x3dcb8e,_0x428c74,_0x20b04d);}}}),_0x428c74[_0x44d340(0x307)]===0x0&&_0x23077c['length']===0x0)return{'redos':[],'undos':[]};const {redos:_0x5d355c,undos:_0x630c65}=this[_0x44d340(0x379)](_0x4971b5,_0x2fd31b,_0x428c74),_0x2c3560=[],_0x57977f=[];if(_0x23077c['length']>0x0){const {redos:_0x56f128,undos:_0x149af8}=this[_0x44d340(0x379)](_0x4971b5,_0x2fd31b,_0x23077c);_0x2c3560[_0x44d340(0x1dd)](..._0x56f128),_0x57977f[_0x44d340(0x1dd)](..._0x149af8);}return{'redos':_0x5d355c,'undos':_0x630c65,'preRedos':_0x2c3560,'preUndos':_0x57977f};}[_0x3d4902(0x379)](_0x1e6ee8,_0x21a29c,_0x12de3d){const _0x541fe9=_0x3d4902,_0x518c63=this[_0x541fe9(0x2cb)]['getBatchUpdateOp'](_0x12de3d),{undo:_0x22df6d,redo:_0x3f73c2,objects:_0x1e332d}=_0x518c63,_0x147d85=[{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x1e6ee8,'subUnitId':_0x21a29c,'op':_0x3f73c2,'objects':_0x1e332d,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x1e6ee8]}],_0x2f73fa=[{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x1e6ee8,'subUnitId':_0x21a29c,'op':_0x22df6d,'objects':_0x1e332d,'type':DrawingApplyType[_0x541fe9(0x1cd)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x1e6ee8]}];return{'redos':_0x147d85,'undos':_0x2f73fa};}[_0x3d4902(0x332)](_0x302724,_0x367a28,_0x4321d6){const _0x21358d=_0x3d4902,_0x49f2c5=this[_0x21358d(0x1bd)][_0x21358d(0x257)](_0x302724,_0x367a28),_0x49a766=[],_0x3dcd2b=[];if(Object[_0x21358d(0x384)](_0x49f2c5)[_0x21358d(0x23c)](_0x4cbdc7=>{const _0xb4c9e2=_0x21358d,_0x4d19ce=_0x49f2c5[_0x4cbdc7],{sheetTransform:_0x1d0163,transform:_0x38750b,anchorType:anchorType=SheetDrawingAnchorType[_0xb4c9e2(0x352)]}=_0x4d19ce;if(anchorType===SheetDrawingAnchorType[_0xb4c9e2(0x37d)])this['_remainDrawingSize'](_0x38750b,_0x49a766,_0x4d19ce);else{const {from:_0x57dd87,to:_0x3a467c}=_0x1d0163,{row:_0x3388e9,column:_0x7af01e}=_0x57dd87,{row:_0x3fcd8a,column:_0xe81d74}=_0x3a467c;for(let _0xca70d4=0x0;_0xca70d4<_0x4321d6['length'];_0xca70d4++){const _0x438044=_0x4321d6[_0xca70d4],{startRow:_0x55ad25,endRow:_0x4d029f,startColumn:_0x373764,endColumn:_0x14f3bd}=_0x438044;if(_0x3fcd8a<_0x55ad25)continue;if(anchorType===SheetDrawingAnchorType[_0xb4c9e2(0x352)]){let _0x1d9b0b=null,_0x210bf3=null;if(_0x3388e9>=_0x55ad25&&_0x3388e9<=_0x4d029f){const _0x30bc67=this['_skeletonManagerService']['attachRangeWithCoord']({'startColumn':_0x57dd87['column'],'endColumn':_0x3a467c[_0xb4c9e2(0x2ad)],'startRow':_0x3388e9,'endRow':_0x4d029f});if(_0x30bc67==null)return;_0x210bf3={..._0x38750b,'top':_0x30bc67[_0xb4c9e2(0x34b)]};}if(_0x210bf3!=null&&(_0x1d9b0b=transformToDrawingPosition(_0x210bf3,this[_0xb4c9e2(0x36b)]),_0x1d9b0b!=null&&_0x210bf3!=null)){_0x49a766[_0xb4c9e2(0x1dd)]({..._0x4d19ce,'sheetTransform':_0x1d9b0b,'transform':_0x210bf3});break;}this['_remainDrawingSize'](_0x38750b,_0x49a766,_0x4d19ce);continue;}if(_0x3388e9>=_0x55ad25&&_0x3fcd8a<=_0x4d029f)continue;let _0x2cfc79=null,_0x948b5a=null;if(_0x3388e9>=_0x55ad25&&_0x3388e9<=_0x4d029f){const _0x10e84b=this[_0xb4c9e2(0x2d4)][_0xb4c9e2(0x366)]({'startColumn':_0x57dd87['column'],'endColumn':_0x3a467c[_0xb4c9e2(0x2ad)],'startRow':_0x3388e9,'endRow':_0x4d029f});if(_0x10e84b==null)return;_0x948b5a={..._0x38750b,'top':(_0x10e84b==null?void 0x0:_0x10e84b[_0xb4c9e2(0x34b)])||0x0,'height':((_0x38750b==null?void 0x0:_0x38750b[_0xb4c9e2(0x241)])||0x0)-_0x10e84b['endY']+_0x10e84b[_0xb4c9e2(0x34b)]};}else{if(_0x3fcd8a>=_0x55ad25&&_0x3fcd8a<=_0x4d029f){const _0x3a26d4=this[_0xb4c9e2(0x2d4)][_0xb4c9e2(0x366)]({'startColumn':_0x57dd87[_0xb4c9e2(0x2ad)],'endColumn':_0x3a467c[_0xb4c9e2(0x2ad)],'startRow':_0x55ad25,'endRow':_0x3fcd8a});if(_0x3a26d4==null)return;_0x948b5a={..._0x38750b,'top':_0x3a26d4[_0xb4c9e2(0x34b)]-((_0x38750b==null?void 0x0:_0x38750b[_0xb4c9e2(0x241)])||0x0)};}else{const _0x324aaf=this['_skeletonManagerService'][_0xb4c9e2(0x366)]({'startColumn':_0x57dd87[_0xb4c9e2(0x2ad)],'endColumn':_0x3a467c['column'],'startRow':_0x55ad25,'endRow':_0x4d029f});if(_0x324aaf==null)return;if(_0x948b5a={..._0x38750b,'height':((_0x38750b==null?void 0x0:_0x38750b[_0xb4c9e2(0x241)])||0x0)-_0x324aaf[_0xb4c9e2(0x204)]+_0x324aaf['startY']},_0x2cfc79=transformToDrawingPosition(_0x948b5a,this[_0xb4c9e2(0x36b)]),_0x2cfc79!=null&&_0x948b5a!=null){_0x3dcd2b[_0xb4c9e2(0x1dd)]({..._0x4d19ce,'sheetTransform':_0x2cfc79,'transform':_0x948b5a});break;}}}if(_0x948b5a!=null&&(_0x2cfc79=transformToDrawingPosition(_0x948b5a,this['_selectionRenderService'])),_0x948b5a!=null&&_0x2cfc79!=null){_0x49a766[_0xb4c9e2(0x1dd)]({..._0x4d19ce,'sheetTransform':_0x2cfc79,'transform':_0x948b5a});break;}else this['_remainDrawingSize'](_0x38750b,_0x49a766,_0x4d19ce);}}}),_0x49a766[_0x21358d(0x307)]===0x0&&_0x3dcd2b[_0x21358d(0x307)]===0x0)return{'redos':[],'undos':[]};const {redos:_0xe3e194,undos:_0x28a6db}=this['_createUndoAndRedoMutation'](_0x302724,_0x367a28,_0x49a766),_0x1864bb=[],_0x22c977=[];if(_0x3dcd2b[_0x21358d(0x307)]>0x0){const {redos:_0x4ff4b4,undos:_0x53edcf}=this[_0x21358d(0x379)](_0x302724,_0x367a28,_0x3dcd2b);_0x1864bb[_0x21358d(0x1dd)](..._0x4ff4b4),_0x22c977[_0x21358d(0x1dd)](..._0x53edcf);}return{'redos':_0xe3e194,'undos':_0x28a6db,'preRedos':_0x1864bb,'preUndos':_0x22c977};}[_0x3d4902(0x1d2)](_0x3e1cac,_0x20fd92,_0x465a50,_0x31a4bc){const _0x38756b=_0x3d4902,_0x2cac31=this[_0x38756b(0x1bd)][_0x38756b(0x257)](_0x3e1cac,_0x20fd92),_0x4aaceb=[];return Object[_0x38756b(0x384)](_0x2cac31)[_0x38756b(0x23c)](_0x3c24ef=>{const _0x393303=_0x38756b,_0x3ec004=_0x2cac31[_0x3c24ef],{sheetTransform:_0x477274,transform:_0x2a9e81,anchorType:anchorType=SheetDrawingAnchorType[_0x393303(0x352)]}=_0x3ec004;if(anchorType===SheetDrawingAnchorType[_0x393303(0x37d)])this['_remainDrawingSize'](_0x2a9e81,_0x4aaceb,_0x3ec004);else{const {from:_0x39baa2,to:_0x208bde}=_0x477274,{row:_0x5805b4,column:_0x568029}=_0x39baa2,{row:_0x221eb7,column:_0x1fa155}=_0x208bde;for(let _0x676429=0x0;_0x676429<_0x465a50[_0x393303(0x307)];_0x676429++){const _0x194552=_0x465a50[_0x676429],{startRow:_0xfcd296,endRow:_0x212f2f,startColumn:_0x401476,endColumn:_0x54957c}=_0x194552;if(_0x221eb7<_0xfcd296||_0x1fa155<_0x401476)continue;if(anchorType===SheetDrawingAnchorType[_0x393303(0x352)]&&(_0x5805b4<=_0xfcd296&&_0x221eb7>=_0x212f2f||_0x568029<=_0x401476&&_0x1fa155>=_0x54957c)){this[_0x393303(0x1d3)](_0x2a9e81,_0x4aaceb,_0x3ec004);continue;}const _0x4e2990=drawingPositionToTransform({..._0x477274},this[_0x393303(0x36b)],this[_0x393303(0x2d4)]);if(_0x4e2990!=null){_0x4aaceb[_0x393303(0x1dd)]({..._0x3ec004,'transform':_0x4e2990});break;}}}}),_0x4aaceb[_0x38756b(0x307)]===0x0?{'redos':[],'undos':[]}:this[_0x38756b(0x379)](_0x3e1cac,_0x20fd92,_0x4aaceb);}['_getUnitIdAndSubUnitId'](_0x5d5e3d,_0x3f581d){const _0xc176c9=_0x3d4902;let _0x837cf0,_0x684b72;if(_0x3f581d===_0xc176c9(0x2fe))_0x837cf0=_0x5d5e3d['unitId'],_0x684b72=_0x5d5e3d['subUnitId'];else{const _0x405b6f=getSheetCommandTarget(this['_univerInstanceService']);if(_0x405b6f==null)return;_0x837cf0=_0x405b6f[_0xc176c9(0x291)],_0x684b72=_0x405b6f[_0xc176c9(0x2f3)];}return{'unitId':_0x837cf0,'subUnitId':_0x684b72};}[_0x3d4902(0x265)](_0x31c7a2){const _0x420a30=_0x3d4902;var _0x24327e,_0xb36d77;const {toRange:_0x44ae2a,fromRange:_0x210e46}=_0x31c7a2,_0x255250=getSheetCommandTarget(this[_0x420a30(0x2b7)]);if(!_0x255250)return{'redos':[],'undos':[]};const {unitId:_0x1199ce,subUnitId:_0xfb803c}=_0x255250,_0x706d70=(_0xb36d77=(_0x24327e=this['_renderManagerService'][_0x420a30(0x200)](_0x1199ce))==null?void 0x0:_0x24327e['with'](SheetSkeletonManagerService))==null?void 0x0:_0xb36d77[_0x420a30(0x253)]();if(!_0x706d70)return{'redos':[],'undos':[]};const _0x1961d5=attachRangeWithCoord(_0x706d70,_0x210e46);if(!_0x1961d5)return{'redos':[],'undos':[]};const {startX:_0x116231,endX:_0x2bfffd,startY:_0x448968,endY:_0x57cfb0}=_0x1961d5,_0x34ac40=this[_0x420a30(0x2cb)][_0x420a30(0x257)](_0x1199ce,_0xfb803c),_0x47fe65=[];Object[_0x420a30(0x384)](_0x34ac40)[_0x420a30(0x23c)](_0x433314=>{const _0x4538bd=_0x420a30,_0x143d84=_0x34ac40[_0x433314];if(_0x143d84[_0x4538bd(0x391)]!==SheetDrawingAnchorType[_0x4538bd(0x341)])return;const {transform:_0x59ed97}=_0x143d84;if(!_0x59ed97)return;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0}=_0x59ed97,{drawingStartX:_0x4feaeb,drawingEndX:_0xa1cecf,drawingStartY:_0x4a4d1a,drawingEndY:_0x3b8d21}={'drawingStartX':left,'drawingEndX':left+width,'drawingStartY':top,'drawingEndY':top+height};_0x116231<=_0x4feaeb&&_0xa1cecf<=_0x2bfffd&&_0x448968<=_0x4a4d1a&&_0x3b8d21<=_0x57cfb0&&_0x47fe65['push'](_0x143d84);});const _0x1a634c=[],_0x1f415b=[],_0x12f5d7=_0x44ae2a[_0x420a30(0x360)]-_0x210e46[_0x420a30(0x360)],_0x38ee3e=_0x44ae2a[_0x420a30(0x336)]-_0x210e46[_0x420a30(0x336)],_0x2fdda6=_0x47fe65['map'](_0xbe6215=>{const _0x2f8441=_0x420a30,_0x49285e=_0xbe6215[_0x2f8441(0x2a0)],_0x450725={'to':{..._0x49285e['to'],'row':_0x49285e['to'][_0x2f8441(0x1ed)]+_0x12f5d7,'column':_0x49285e['to'][_0x2f8441(0x2ad)]+_0x38ee3e},'from':{..._0x49285e[_0x2f8441(0x237)],'row':_0x49285e['from']['row']+_0x12f5d7,'column':_0x49285e['from'][_0x2f8441(0x2ad)]+_0x38ee3e}},_0x4046c7=drawingPositionToTransform(_0x450725,this[_0x2f8441(0x36b)],this[_0x2f8441(0x2d4)]);return{'unitId':_0x1199ce,'subUnitId':_0xfb803c,'drawingId':_0xbe6215[_0x2f8441(0x1be)],'transform':_0x4046c7,'sheetTransform':_0x450725};});if(_0x2fdda6[_0x420a30(0x307)]){const _0x2d981f=this['_sheetDrawingService']['getBatchUpdateOp'](_0x2fdda6),{undo:_0x74d17d,redo:_0x49c9bc,objects:_0x5a70dd}=_0x2d981f;_0x1a634c[_0x420a30(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x1199ce,'subUnitId':_0xfb803c,'op':_0x49c9bc,'objects':_0x5a70dd,'type':DrawingApplyType[_0x420a30(0x1cd)]}}),_0x1f415b[_0x420a30(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x1199ce,'subUnitId':_0xfb803c,'op':_0x74d17d,'objects':_0x5a70dd,'type':DrawingApplyType[_0x420a30(0x1cd)]}});}return{'redos':_0x1a634c,'undos':_0x1f415b};}[_0x3d4902(0x201)](_0x43e0fd,_0x19cabf){const _0x333b9f=_0x3d4902,_0x1eaf4d=this[_0x333b9f(0x36f)](_0x43e0fd,_0x19cabf);if(_0x1eaf4d==null)return{'redos':[],'undos':[]};const {unitId:_0x579951,subUnitId:_0x37bd67}=_0x1eaf4d,{range:_0x2e3f92}=_0x43e0fd,_0x1c3085=_0x2e3f92[_0x333b9f(0x360)],_0x1e250c=_0x2e3f92[_0x333b9f(0x278)],_0x4e770f=[],_0x2f8a21=[],_0x1e1ffb=this['_sheetDrawingService'][_0x333b9f(0x257)](_0x579951,_0x37bd67),_0x4d757f=[],_0x165cf7=[];if(Object[_0x333b9f(0x384)](_0x1e1ffb)['forEach'](_0x5ade3=>{const _0x4ccd6b=_0x333b9f,_0x355dd9=_0x1e1ffb[_0x5ade3],{sheetTransform:_0x2a4616,transform:_0x3045fd,anchorType:anchorType=SheetDrawingAnchorType[_0x4ccd6b(0x352)]}=_0x355dd9;if(_0x2a4616==null||_0x3045fd==null)return;let _0x23a560,_0x14dbc8;if(_0x19cabf===_0x4ccd6b(0x2fe)){const _0x5cdeb0=this[_0x4ccd6b(0x26d)](_0x2a4616,_0x3045fd,_0x1c3085,_0x1e250c,anchorType);_0x23a560=_0x5cdeb0==null?void 0x0:_0x5cdeb0[_0x4ccd6b(0x2af)],_0x14dbc8=_0x5cdeb0==null?void 0x0:_0x5cdeb0[_0x4ccd6b(0x26c)];}else{const {from:_0x2eb554,to:_0x42a6d4}=_0x2a4616,{row:_0x3c812f}=_0x2eb554,{row:_0x487273}=_0x42a6d4;if(anchorType===SheetDrawingAnchorType[_0x4ccd6b(0x341)]&&_0x3c812f>=_0x1c3085&&_0x487273<=_0x1e250c)_0x165cf7[_0x4ccd6b(0x1dd)]({'unitId':_0x579951,'subUnitId':_0x37bd67,'drawingId':_0x5ade3});else{const _0x4b470f=this[_0x4ccd6b(0x226)](_0x2a4616,_0x3045fd,_0x1c3085,_0x1e250c,anchorType);_0x23a560=_0x4b470f==null?void 0x0:_0x4b470f[_0x4ccd6b(0x2af)],_0x14dbc8=_0x4b470f==null?void 0x0:_0x4b470f[_0x4ccd6b(0x26c)];}}if(!_0x23a560||!_0x14dbc8)return;const _0x251f57={'unitId':_0x579951,'subUnitId':_0x37bd67,'drawingId':_0x5ade3,'transform':_0x14dbc8,'sheetTransform':_0x23a560};_0x4d757f[_0x4ccd6b(0x1dd)](_0x251f57);}),_0x4d757f['length']===0x0&&_0x165cf7[_0x333b9f(0x307)]===0x0)return{'redos':[],'undos':[]};if(_0x4d757f[_0x333b9f(0x307)]>0x0){const _0x3c60ef=this[_0x333b9f(0x2cb)][_0x333b9f(0x255)](_0x4d757f),{undo:_0x17a6ed,redo:_0x4edd5d,objects:_0x28a733}=_0x3c60ef;_0x4e770f[_0x333b9f(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x579951,'subUnitId':_0x37bd67,'op':_0x4edd5d,'objects':_0x28a733,'type':DrawingApplyType[_0x333b9f(0x1cd)]}}),_0x2f8a21[_0x333b9f(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x579951,'subUnitId':_0x37bd67,'op':_0x17a6ed,'objects':_0x28a733,'type':DrawingApplyType['UPDATE']}});}if(_0x165cf7[_0x333b9f(0x307)]>0x0){const _0x35c4e2=this[_0x333b9f(0x2cb)][_0x333b9f(0x1ea)](_0x165cf7),_0x2db886=_0x35c4e2['undo'],_0x42e451=_0x35c4e2['redo'],_0x177df3=_0x35c4e2[_0x333b9f(0x1d9)];_0x4e770f[_0x333b9f(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x579951,'subUnitId':_0x37bd67,'op':_0x42e451,'objects':_0x177df3,'type':DrawingApplyType[_0x333b9f(0x331)]}}),_0x2f8a21[_0x333b9f(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x579951,'subUnitId':_0x37bd67,'op':_0x2db886,'objects':_0x177df3,'type':DrawingApplyType[_0x333b9f(0x1ef)]}});}return _0x4e770f[_0x333b9f(0x1dd)]({'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x579951]}),_0x2f8a21[_0x333b9f(0x1dd)]({'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x579951]}),{'redos':_0x4e770f,'undos':_0x2f8a21};}[_0x3d4902(0x1c4)](_0x2631f2,_0x21b91f){const _0xa5b4e5=_0x3d4902,_0xc69b62=this['_getUnitIdAndSubUnitId'](_0x2631f2,_0x21b91f);if(_0xc69b62==null)return{'redos':[],'undos':[]};const {unitId:_0x94dbba,subUnitId:_0x49cd57}=_0xc69b62,{range:_0xa8aea1}=_0x2631f2,_0x334122=_0xa8aea1[_0xa5b4e5(0x336)],_0x408b9a=_0xa8aea1[_0xa5b4e5(0x363)],_0x2cd968=[],_0x59134a=[],_0x124810=this[_0xa5b4e5(0x2cb)][_0xa5b4e5(0x257)](_0x94dbba,_0x49cd57),_0x2409b3=[],_0x1e3101=[];if(Object['keys'](_0x124810)[_0xa5b4e5(0x23c)](_0x1c4b05=>{const _0x5dd8eb=_0xa5b4e5,_0x2ce2b7=_0x124810[_0x1c4b05],{sheetTransform:_0x131be1,transform:_0x2d34df,anchorType:anchorType=SheetDrawingAnchorType['Position']}=_0x2ce2b7;if(_0x131be1==null||_0x2d34df==null)return;let _0x43b954,_0x407606;if(_0x21b91f===_0x5dd8eb(0x2fe)){const _0xd0496f=this[_0x5dd8eb(0x38b)](_0x131be1,_0x2d34df,_0x334122,_0x408b9a,anchorType);_0x43b954=_0xd0496f==null?void 0x0:_0xd0496f[_0x5dd8eb(0x2af)],_0x407606=_0xd0496f==null?void 0x0:_0xd0496f[_0x5dd8eb(0x26c)];}else{const {from:_0x32ed8e,to:_0x258248}=_0x131be1,{column:_0xfb7ab2}=_0x32ed8e,{column:_0x3d3958}=_0x258248;if(anchorType===SheetDrawingAnchorType[_0x5dd8eb(0x341)]&&_0xfb7ab2>=_0x334122&&_0x3d3958<=_0x408b9a)_0x1e3101[_0x5dd8eb(0x1dd)]({'unitId':_0x94dbba,'subUnitId':_0x49cd57,'drawingId':_0x1c4b05});else{const _0x55d9de=this[_0x5dd8eb(0x231)](_0x131be1,_0x2d34df,_0x334122,_0x408b9a,anchorType);_0x43b954=_0x55d9de==null?void 0x0:_0x55d9de[_0x5dd8eb(0x2af)],_0x407606=_0x55d9de==null?void 0x0:_0x55d9de[_0x5dd8eb(0x26c)];}}if(!_0x43b954||!_0x407606)return;const _0x359011={'unitId':_0x94dbba,'subUnitId':_0x49cd57,'drawingId':_0x1c4b05,'transform':_0x407606,'sheetTransform':_0x43b954};_0x2409b3['push'](_0x359011);}),_0x2409b3['length']===0x0&&_0x1e3101[_0xa5b4e5(0x307)]===0x0)return{'redos':[],'undos':[]};if(_0x2409b3[_0xa5b4e5(0x307)]>0x0){const _0x157fe9=this[_0xa5b4e5(0x2cb)][_0xa5b4e5(0x255)](_0x2409b3),{undo:_0x428c95,redo:_0x103222,objects:_0x40ff1e}=_0x157fe9;_0x2cd968[_0xa5b4e5(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x94dbba,'subUnitId':_0x49cd57,'op':_0x103222,'objects':_0x40ff1e,'type':DrawingApplyType[_0xa5b4e5(0x1cd)]}}),_0x59134a[_0xa5b4e5(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x94dbba,'subUnitId':_0x49cd57,'op':_0x428c95,'objects':_0x40ff1e,'type':DrawingApplyType[_0xa5b4e5(0x1cd)]}});}if(_0x1e3101[_0xa5b4e5(0x307)]>0x0){const _0x57897e=this[_0xa5b4e5(0x2cb)][_0xa5b4e5(0x1ea)](_0x1e3101),_0x3d655e=_0x57897e[_0xa5b4e5(0x28b)],_0x15073d=_0x57897e['redo'],_0x5bc383=_0x57897e[_0xa5b4e5(0x1d9)];_0x2cd968[_0xa5b4e5(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x94dbba,'subUnitId':_0x49cd57,'op':_0x15073d,'objects':_0x5bc383,'type':DrawingApplyType[_0xa5b4e5(0x331)]}}),_0x59134a[_0xa5b4e5(0x1dd)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x94dbba,'subUnitId':_0x49cd57,'op':_0x3d655e,'objects':_0x5bc383,'type':DrawingApplyType['INSERT']}});}return _0x2cd968[_0xa5b4e5(0x1dd)]({'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x94dbba]}),_0x59134a[_0xa5b4e5(0x1dd)]({'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x94dbba]}),{'redos':_0x2cd968,'undos':_0x59134a};}[_0x3d4902(0x38b)](_0x51e538,_0x507b7d,_0x15b86a,_0x2d7431,_0xda0c53=SheetDrawingAnchorType[_0x3d4902(0x352)]){const _0x3d60f5=_0x3d4902,_0x3244b8=_0x2d7431-_0x15b86a+0x1,{from:_0x2cf4ad,to:_0x27b3b0}=_0x51e538,{column:_0x15b474}=_0x2cf4ad,{column:_0x51318a}=_0x27b3b0;if(_0xda0c53===SheetDrawingAnchorType[_0x3d60f5(0x37d)])return{'newSheetTransform':transformToDrawingPosition({..._0x507b7d},this[_0x3d60f5(0x36b)]),'newTransform':_0x507b7d};let _0x53ee0f=null,_0x56b00e=null;if(_0x15b474>=_0x15b86a){const _0x14a10c=this[_0x3d60f5(0x2d4)][_0x3d60f5(0x366)]({'startColumn':_0x15b86a,'endColumn':_0x2d7431,'startRow':_0x2cf4ad[_0x3d60f5(0x1ed)],'endRow':_0x27b3b0['row']});if(_0x14a10c==null)return;_0x56b00e={..._0x507b7d,'left':(_0x507b7d[_0x3d60f5(0x242)]||0x0)+_0x14a10c[_0x3d60f5(0x295)]-_0x14a10c['startX']},_0x53ee0f=transformToDrawingPosition(_0x56b00e,this[_0x3d60f5(0x36b)]);}else{if(_0x51318a>=_0x2d7431){if(_0xda0c53===SheetDrawingAnchorType['Both'])_0x53ee0f={'from':{..._0x2cf4ad},'to':{..._0x27b3b0,'column':_0x51318a+_0x3244b8}},_0x56b00e=drawingPositionToTransform(_0x53ee0f,this['_selectionRenderService'],this['_skeletonManagerService']);else return{'newSheetTransform':transformToDrawingPosition({..._0x507b7d},this[_0x3d60f5(0x36b)]),'newTransform':_0x507b7d};}}return _0x53ee0f!=null&&_0x56b00e!=null?{'newSheetTransform':_0x53ee0f,'newTransform':_0x56b00e}:null;}[_0x3d4902(0x231)](_0x4d0ccd,_0x74134d,_0x4e1e41,_0x46f034,_0x6ad34c=SheetDrawingAnchorType[_0x3d4902(0x352)]){const _0x2aee4f=_0x3d4902,_0x3ae7e3=_0x46f034-_0x4e1e41+0x1,{from:_0x421432,to:_0x35b128}=_0x4d0ccd,{column:_0x213b65}=_0x421432,{column:_0x428dfe}=_0x35b128;if(_0x6ad34c===SheetDrawingAnchorType[_0x2aee4f(0x37d)])return{'newSheetTransform':transformToDrawingPosition({..._0x74134d},this[_0x2aee4f(0x36b)]),'newTransform':_0x74134d};let _0x48637c=null,_0x4b136c=null;if(_0x213b65>_0x46f034)_0x48637c={'from':{..._0x421432,'column':_0x213b65-_0x3ae7e3},'to':{..._0x35b128,'column':_0x428dfe-_0x3ae7e3}},_0x4b136c=drawingPositionToTransform(_0x48637c,this[_0x2aee4f(0x36b)],this[_0x2aee4f(0x2d4)]);else{if(_0x213b65>=_0x4e1e41&&_0x428dfe<=_0x46f034)return null;if(_0x213b65<_0x4e1e41&&_0x428dfe>_0x46f034){if(_0x6ad34c===SheetDrawingAnchorType[_0x2aee4f(0x341)])_0x48637c={'from':{..._0x421432},'to':{..._0x35b128,'column':_0x428dfe-_0x3ae7e3}},_0x4b136c=drawingPositionToTransform(_0x48637c,this[_0x2aee4f(0x36b)],this[_0x2aee4f(0x2d4)]);else return{'newSheetTransform':transformToDrawingPosition({..._0x74134d},this[_0x2aee4f(0x36b)]),'newTransform':_0x74134d};}else{if(_0x213b65>=_0x4e1e41&&_0x213b65<=_0x46f034){if(_0x213b65===_0x4e1e41)_0x4b136c={..._0x74134d,'left':(_0x74134d[_0x2aee4f(0x242)]||0x0)-_0x4d0ccd['from']['columnOffset']};else{const _0x18f595=this[_0x2aee4f(0x2d4)][_0x2aee4f(0x366)]({'startColumn':_0x4e1e41,'endColumn':_0x213b65-0x1,'startRow':_0x421432[_0x2aee4f(0x1ed)],'endRow':_0x35b128['row']});if(_0x18f595==null)return;_0x4b136c={..._0x74134d,'left':(_0x74134d[_0x2aee4f(0x242)]||0x0)-_0x18f595[_0x2aee4f(0x295)]+_0x18f595[_0x2aee4f(0x36e)]-_0x4d0ccd['from'][_0x2aee4f(0x309)]};}_0x48637c=transformToDrawingPosition(_0x4b136c,this[_0x2aee4f(0x36b)]);}else{if(_0x428dfe>=_0x4e1e41&&_0x428dfe<=_0x46f034&&_0x6ad34c===SheetDrawingAnchorType[_0x2aee4f(0x341)]){const _0x110ecf=this['_skeletonManagerService'][_0x2aee4f(0x366)]({'startColumn':_0x4e1e41-0x1,'endColumn':_0x4e1e41-0x1,'startRow':_0x421432[_0x2aee4f(0x1ed)],'endRow':_0x35b128[_0x2aee4f(0x1ed)]});if(_0x110ecf==null)return;_0x48637c={'from':{..._0x421432},'to':{..._0x35b128,'column':_0x4e1e41-0x1,'columnOffset':_0x110ecf[_0x2aee4f(0x295)]-_0x110ecf[_0x2aee4f(0x36e)]}},_0x4b136c=drawingPositionToTransform(_0x48637c,this[_0x2aee4f(0x36b)],this[_0x2aee4f(0x2d4)]);}}}}return _0x48637c!=null&&_0x4b136c!=null?{'newSheetTransform':_0x48637c,'newTransform':_0x4b136c}:null;}[_0x3d4902(0x26d)](_0x3b42a9,_0x19d37b,_0x3f1e24,_0x5b2417,_0xa17e16=SheetDrawingAnchorType[_0x3d4902(0x352)]){const _0x583cd0=_0x3d4902,_0x4437f5=_0x5b2417-_0x3f1e24+0x1,{from:_0x178743,to:_0x3ef237}=_0x3b42a9,{row:_0x5789a5}=_0x178743,{row:_0x2d3650}=_0x3ef237;if(_0xa17e16===SheetDrawingAnchorType[_0x583cd0(0x37d)])return{'newSheetTransform':transformToDrawingPosition({..._0x19d37b},this[_0x583cd0(0x36b)]),'newTransform':_0x19d37b};let _0x28b61f=null,_0x1e1245=null;if(_0x5789a5>=_0x3f1e24){const _0x33a346=this['_skeletonManagerService'][_0x583cd0(0x366)]({'startRow':_0x3f1e24,'endRow':_0x5b2417,'startColumn':_0x178743['column'],'endColumn':_0x3ef237[_0x583cd0(0x2ad)]});if(_0x33a346==null)return;_0x1e1245={..._0x19d37b,'top':(_0x19d37b[_0x583cd0(0x326)]||0x0)+_0x33a346[_0x583cd0(0x204)]-_0x33a346[_0x583cd0(0x34b)]},_0x28b61f=transformToDrawingPosition(_0x1e1245,this[_0x583cd0(0x36b)]);}else{if(_0x2d3650>=_0x5b2417){if(_0xa17e16===SheetDrawingAnchorType[_0x583cd0(0x341)])_0x28b61f={'from':{..._0x178743},'to':{..._0x3ef237,'row':_0x2d3650+_0x4437f5}},_0x1e1245=drawingPositionToTransform(_0x28b61f,this[_0x583cd0(0x36b)],this[_0x583cd0(0x2d4)]);else return{'newSheetTransform':transformToDrawingPosition({..._0x19d37b},this['_selectionRenderService']),'newTransform':_0x19d37b};}}return _0x28b61f!=null&&_0x1e1245!=null?{'newSheetTransform':_0x28b61f,'newTransform':_0x1e1245}:null;}[_0x3d4902(0x226)](_0x24c326,_0x1dc7cb,_0x41b9f0,_0x16d76b,_0x42c820=SheetDrawingAnchorType['Position']){const _0x2c5ca6=_0x3d4902,_0xaed8c0=_0x16d76b-_0x41b9f0+0x1,{from:_0x5707fa,to:_0x53a73b}=_0x24c326,{row:_0x4c4838}=_0x5707fa,{row:_0x17460}=_0x53a73b;if(_0x42c820===SheetDrawingAnchorType[_0x2c5ca6(0x37d)])return{'newSheetTransform':transformToDrawingPosition({..._0x1dc7cb},this[_0x2c5ca6(0x36b)]),'newTransform':_0x1dc7cb};let _0x3ab1ba=null,_0x357433=null;if(_0x4c4838>_0x16d76b)_0x3ab1ba={'from':{..._0x5707fa,'row':_0x4c4838-_0xaed8c0},'to':{..._0x53a73b,'row':_0x17460-_0xaed8c0}},_0x357433=drawingPositionToTransform(_0x3ab1ba,this['_selectionRenderService'],this['_skeletonManagerService']);else{if(_0x4c4838>=_0x41b9f0&&_0x17460<=_0x16d76b)return null;if(_0x4c4838<_0x41b9f0&&_0x17460>_0x16d76b){if(_0x42c820===SheetDrawingAnchorType[_0x2c5ca6(0x341)])_0x3ab1ba={'from':{..._0x5707fa},'to':{..._0x53a73b,'row':_0x17460-_0xaed8c0}},_0x357433=drawingPositionToTransform(_0x3ab1ba,this['_selectionRenderService'],this['_skeletonManagerService']);else return{'newSheetTransform':transformToDrawingPosition({..._0x1dc7cb},this[_0x2c5ca6(0x36b)]),'newTransform':_0x1dc7cb};}else{if(_0x4c4838>=_0x41b9f0&&_0x4c4838<=_0x16d76b){if(_0x4c4838===_0x41b9f0)_0x357433={..._0x1dc7cb,'top':(_0x1dc7cb[_0x2c5ca6(0x326)]||0x0)-_0x24c326[_0x2c5ca6(0x237)]['rowOffset']};else{const _0x1a601c=this[_0x2c5ca6(0x2d4)][_0x2c5ca6(0x366)]({'startRow':_0x41b9f0,'endRow':_0x4c4838-0x1,'startColumn':_0x5707fa[_0x2c5ca6(0x2ad)],'endColumn':_0x53a73b[_0x2c5ca6(0x2ad)]});if(_0x1a601c==null)return;_0x357433={..._0x1dc7cb,'top':(_0x1dc7cb[_0x2c5ca6(0x326)]||0x0)-_0x1a601c[_0x2c5ca6(0x204)]+_0x1a601c[_0x2c5ca6(0x34b)]-_0x24c326[_0x2c5ca6(0x237)][_0x2c5ca6(0x289)]};}_0x3ab1ba=transformToDrawingPosition(_0x357433,this['_selectionRenderService']);}else{if(_0x17460>=_0x41b9f0&&_0x17460<=_0x16d76b&&_0x42c820===SheetDrawingAnchorType[_0x2c5ca6(0x341)]){const _0x16757a=this['_skeletonManagerService'][_0x2c5ca6(0x366)]({'startColumn':_0x5707fa[_0x2c5ca6(0x2ad)],'endColumn':_0x5707fa[_0x2c5ca6(0x2ad)],'startRow':_0x41b9f0-0x1,'endRow':_0x41b9f0-0x1});if(_0x16757a==null)return;_0x3ab1ba={'from':{..._0x5707fa},'to':{..._0x53a73b,'row':_0x41b9f0-0x1,'rowOffset':_0x16757a['endY']-_0x16757a[_0x2c5ca6(0x34b)]}},_0x357433=drawingPositionToTransform(_0x3ab1ba,this[_0x2c5ca6(0x36b)],this[_0x2c5ca6(0x2d4)]);}}}}return _0x3ab1ba!=null&&_0x357433!=null?{'newSheetTransform':_0x3ab1ba,'newTransform':_0x357433}:null;}[_0x3d4902(0x35f)](){const _0x5190b6=_0x3d4902;this[_0x5190b6(0x26e)](this[_0x5190b6(0x208)]['onCommandExecuted'](_0x1018d=>{_0x1018d['id']===SetWorksheetActiveOperation['id']&&setTimeout(()=>{const _0x51e00b=_0x42a1,_0x19ed86=_0x1018d[_0x51e00b(0x280)],{unitId:_0x292871,subUnitId:_0x42eb89}=_0x19ed86,_0x9b29e8=this[_0x51e00b(0x1bd)][_0x51e00b(0x1f0)],_0xdc37c3=[],_0x438377=[];Object[_0x51e00b(0x384)](_0x9b29e8)[_0x51e00b(0x23c)](_0x27def8=>{const _0x1261fc=_0x51e00b,_0xd56554=_0x9b29e8[_0x27def8];_0xd56554!=null&&Object[_0x1261fc(0x384)](_0xd56554)[_0x1261fc(0x23c)](_0x18850e=>{const _0x31df0e=_0x1261fc,_0x330a5a=_0xd56554[_0x18850e][_0x31df0e(0x34d)];_0x330a5a!=null&&Object[_0x31df0e(0x384)](_0x330a5a)['forEach'](_0xe91552=>{const _0x188234=_0x31df0e;if(_0x27def8===_0x292871&&_0x18850e===_0x42eb89){const _0x5b1d8f=_0x330a5a[_0xe91552];_0x5b1d8f[_0x188234(0x32e)]=drawingPositionToTransform(_0x5b1d8f[_0x188234(0x2a0)],this['_selectionRenderService'],this[_0x188234(0x2d4)]),_0xdc37c3['push'](_0x330a5a[_0xe91552]);}else _0x438377[_0x188234(0x1dd)](_0x330a5a[_0xe91552]);});});}),this[_0x51e00b(0x1bd)][_0x51e00b(0x1f8)](_0x438377),this[_0x51e00b(0x1bd)][_0x51e00b(0x36c)](_0xdc37c3);},0x0);}));}['_sheetRefreshListener'](){const _0x3fc302=_0x3d4902;this['disposeWithMe'](this[_0x3fc302(0x208)][_0x3fc302(0x299)](_0x481151=>{REFRESH_MUTATIONS['includes'](_0x481151['id'])&&requestIdleCallback(()=>{const _0x1c5f54=_0x42a1,_0x4c5a59=_0x481151[_0x1c5f54(0x280)],{unitId:_0x39fe28,subUnitId:_0x56c263,ranges:_0x43f3e9}=_0x4c5a59;this[_0x1c5f54(0x2b5)](_0x39fe28,_0x56c263,_0x43f3e9);});}));}[_0x3d4902(0x2b5)](_0x3bff8f,_0x1311b8,_0x12a2d5){const _0x4c7312=_0x3d4902,_0x5d4bbe=this[_0x4c7312(0x1bd)][_0x4c7312(0x257)](_0x3bff8f,_0x1311b8),_0x225582=[];Object[_0x4c7312(0x384)](_0x5d4bbe)[_0x4c7312(0x23c)](_0x42e7ec=>{const _0xde1c9d=_0x4c7312,_0xfda4f6=_0x5d4bbe[_0x42e7ec],{sheetTransform:_0x85f874,transform:_0x277e0f,anchorType:anchorType=SheetDrawingAnchorType[_0xde1c9d(0x352)]}=_0xfda4f6;if(anchorType===SheetDrawingAnchorType[_0xde1c9d(0x37d)])return!0x0;const {from:_0x34e523,to:_0xa87a14}=_0x85f874,{row:_0x2b09d5,column:_0x28ab96}=_0x34e523,{row:_0x3cbff4,column:_0x40ab4c}=_0xa87a14;for(let _0x145fac=0x0;_0x145fac<_0x12a2d5[_0xde1c9d(0x307)];_0x145fac++){const _0x4914ba=_0x12a2d5[_0x145fac],{startRow:_0x43428e,endRow:_0x313bd6,startColumn:_0x5cc201,endColumn:_0x111a0f}=_0x4914ba;if(Rectangle[_0xde1c9d(0x30c)]({'startRow':_0x43428e,'endRow':_0x313bd6,'startColumn':_0x5cc201,'endColumn':_0x111a0f},{'startRow':_0x2b09d5,'endRow':_0x3cbff4,'startColumn':_0x28ab96,'endColumn':_0x40ab4c})||_0x2b09d5>_0x313bd6||_0x28ab96>_0x111a0f){const _0x1461c5=anchorType===SheetDrawingAnchorType[_0xde1c9d(0x352)],_0x1c6674=drawingPositionToTransform(_0x85f874,this[_0xde1c9d(0x36b)],this[_0xde1c9d(0x2d4)]);_0x225582[_0xde1c9d(0x1dd)]({..._0xfda4f6,'transform':{..._0x1c6674,'width':_0x1461c5?_0x277e0f==null?void 0x0:_0x277e0f[_0xde1c9d(0x259)]:_0x1c6674==null?void 0x0:_0x1c6674[_0xde1c9d(0x259)],'height':_0x1461c5?_0x277e0f==null?void 0x0:_0x277e0f['height']:_0x1c6674==null?void 0x0:_0x1c6674[_0xde1c9d(0x241)]}});break;}}}),_0x225582[_0x4c7312(0x307)]!==0x0&&(this['_drawingManagerService'][_0x4c7312(0x294)](_0x225582),this[_0x4c7312(0x208)]['syncExecuteCommand'](ClearSheetDrawingTransformerOperation['id'],[_0x3bff8f]));}},__name(_a8,_0x3d4902(0x286)),_a8);SheetDrawingTransformAffectedController=__decorateClass$2([__decorateParam$2(0x1,IRenderManagerService),__decorateParam$2(0x2,ICommandService),__decorateParam$2(0x3,ISheetSelectionRenderService),__decorateParam$2(0x4,Inject(SheetSkeletonManagerService)),__decorateParam$2(0x5,Inject(SheetInterceptorService)),__decorateParam$2(0x6,ISheetDrawingService),__decorateParam$2(0x7,IDrawingManagerService),__decorateParam$2(0x8,IUniverInstanceService)],SheetDrawingTransformAffectedController);var __defProp$1=Object[_0x3d4902(0x1c5)],__getOwnPropDesc$1=Object['getOwnPropertyDescriptor'],__decorateClass$1=__name((_0x43b065,_0x2420b4,_0xfc3d86,_0x556825)=>{const _0x554c21=_0x3d4902;for(var _0x30708e=_0x556825>0x1?void 0x0:_0x556825?__getOwnPropDesc$1(_0x2420b4,_0xfc3d86):_0x2420b4,_0x49040c=_0x43b065[_0x554c21(0x307)]-0x1,_0x15cf2f;_0x49040c>=0x0;_0x49040c--)(_0x15cf2f=_0x43b065[_0x49040c])&&(_0x30708e=(_0x556825?_0x15cf2f(_0x2420b4,_0xfc3d86,_0x30708e):_0x15cf2f(_0x30708e))||_0x30708e);return _0x556825&&_0x30708e&&__defProp$1(_0x2420b4,_0xfc3d86,_0x30708e),_0x30708e;},_0x3d4902(0x1df)),__decorateParam$1=__name((_0x2ec25d,_0x5e6cb9)=>(_0x465450,_0x15785c)=>_0x5e6cb9(_0x465450,_0x15785c,_0x2ec25d),_0x3d4902(0x353));function transformBound2DOMBound(_0x117ff5,_0x1941c7,_0x5b418f,_0x2cfd31){const _0x84aa1e=_0x3d4902,{scaleX:_0x4dfae4,scaleY:_0x59b154}=_0x1941c7['getAncestorScale'](),_0x535605=_0x1941c7[_0x84aa1e(0x239)](SHEET_VIEWPORT_KEY[_0x84aa1e(0x37f)]),_0x5edb4e={'left':!0x0,'top':!0x0};if(!_0x535605)return{..._0x117ff5,'absolute':_0x5edb4e};const {left:_0x48bf01,right:_0x4783d2,top:_0x49f9c6,bottom:_0x45b23d}=_0x117ff5,_0x2f9692=_0x2cfd31[_0x84aa1e(0x2ea)](),{startColumn:_0x5af3c6,startRow:_0x3a2139,xSplit:_0x22d551,ySplit:_0x286332}=_0x2f9692,_0x2f8403=_0x5b418f[_0x84aa1e(0x281)](_0x3a2139-_0x286332,_0x5af3c6-_0x22d551),_0x181f57=_0x5b418f[_0x84aa1e(0x281)](_0x3a2139,_0x5af3c6),{rowHeaderWidth:_0x23e623,columnHeaderHeight:_0x2653ef}=_0x5b418f,_0x113c26=_0x181f57[_0x84aa1e(0x36e)]-_0x2f8403[_0x84aa1e(0x36e)],_0x360223=_0x181f57[_0x84aa1e(0x34b)]-_0x2f8403[_0x84aa1e(0x34b)],{top:_0x4d4bb3,left:_0x5cb8be,viewportScrollX:_0x253d1f,viewportScrollY:_0xe2c04}=_0x535605;let _0x463d7e,_0x4e54e8;_0x48bf01<_0x5cb8be?(_0x5edb4e['left']=!0x0,_0x463d7e=(_0x113c26+_0x23e623+(_0x48bf01-_0x5cb8be))*_0x4dfae4,_0x4e54e8=Math[_0x84aa1e(0x211)](Math['min']((_0x113c26+_0x23e623+(_0x4783d2-_0x5cb8be))*_0x4dfae4,(_0x113c26+_0x23e623)*_0x4dfae4),(_0x4783d2-_0x253d1f)*_0x4dfae4)):(_0x5edb4e[_0x84aa1e(0x242)]=!0x1,_0x463d7e=Math[_0x84aa1e(0x211)]((_0x48bf01-_0x253d1f)*_0x4dfae4,(_0x113c26+_0x23e623)*_0x4dfae4),_0x4e54e8=Math['max']((_0x4783d2-_0x253d1f)*_0x4dfae4,(_0x113c26+_0x23e623)*_0x4dfae4));let _0x3c2d94,_0x5c2b21;return _0x49f9c6<_0x4d4bb3?(_0x5edb4e[_0x84aa1e(0x326)]=!0x0,_0x3c2d94=(_0x360223+_0x2653ef+(_0x49f9c6-_0x4d4bb3))*_0x59b154,_0x5c2b21=Math[_0x84aa1e(0x211)](Math[_0x84aa1e(0x21f)]((_0x360223+_0x2653ef+(_0x4783d2-_0x4d4bb3))*_0x59b154,(_0x360223+_0x2653ef)*_0x59b154),(_0x45b23d-_0xe2c04)*_0x59b154)):(_0x5edb4e[_0x84aa1e(0x326)]=!0x1,_0x3c2d94=Math[_0x84aa1e(0x211)]((_0x49f9c6-_0xe2c04)*_0x59b154,(_0x360223+_0x2653ef)*_0x59b154),_0x5c2b21=Math[_0x84aa1e(0x211)]((_0x45b23d-_0xe2c04)*_0x59b154,(_0x360223+_0x2653ef)*_0x59b154)),{'left':_0x463d7e,'right':_0x4e54e8,'top':_0x3c2d94,'bottom':_0x5c2b21,'absolute':_0x5edb4e};}__name(transformBound2DOMBound,_0x3d4902(0x275));const calcPosition=__name((_0x263e1c,_0x616a32,_0x2909d2,_0x377d56)=>{const _0x3a240f=_0x3d4902,{scene:_0x17632a}=_0x616a32,{left:_0x15abd7,top:_0x53e5ef,width:_0x26e0e7,height:_0x22c821,angle:_0xf83e5a}=_0x263e1c,_0x3aedf8={'left':_0x15abd7,'right':_0x15abd7+_0x26e0e7,'top':_0x53e5ef,'bottom':_0x53e5ef+_0x22c821},_0x49478f=transformBound2DOMBound(_0x3aedf8,_0x17632a,_0x2909d2,_0x377d56),{scaleX:_0x176533,scaleY:_0x254794}=_0x17632a[_0x3a240f(0x367)]();return{'startX':_0x49478f[_0x3a240f(0x242)],'endX':_0x49478f['right'],'startY':_0x49478f['top'],'endY':_0x49478f['bottom'],'rotate':_0xf83e5a,'width':_0x26e0e7*_0x176533,'height':_0x22c821*_0x254794,'absolute':_0x49478f[_0x3a240f(0x1f9)]};},_0x3d4902(0x1e7));var _a9;let SheetCanvasFloatDomManagerService=(_a9=class extends Disposable{constructor(_0x150930,_0x3c28d9,_0x33c7c4,_0x2b7c70,_0x3b3608,_0x3203c8){const _0x10808b=_0x3d4902;super(),__publicField(this,'_domLayerMap',new Map()),__publicField(this,_0x10808b(0x230),new Map()),__publicField(this,_0x10808b(0x1f6),new Subject()),__publicField(this,_0x10808b(0x2d1),this[_0x10808b(0x1f6)][_0x10808b(0x31b)]()),__publicField(this,_0x10808b(0x20a),new Subject()),__publicField(this,_0x10808b(0x22f),this['_remove$'][_0x10808b(0x31b)]()),__publicField(this,_0x10808b(0x347),[]),(this[_0x10808b(0x2ef)]=_0x150930,this[_0x10808b(0x2b7)]=_0x3c28d9,this[_0x10808b(0x208)]=_0x33c7c4,this[_0x10808b(0x1bd)]=_0x2b7c70,this[_0x10808b(0x267)]=_0x3b3608,this[_0x10808b(0x2cb)]=_0x3203c8,this['_drawingAddListener'](),this[_0x10808b(0x2ce)](),this['_featureUpdateListener'](),this[_0x10808b(0x318)]());}['_ensureMap'](_0x31f462,_0x367117){const _0x42a220=_0x3d4902;let _0x48bb73=this[_0x42a220(0x393)][_0x42a220(0x2c8)](_0x31f462);_0x48bb73||(_0x48bb73=new Map(),this[_0x42a220(0x393)][_0x42a220(0x2b1)](_0x31f462,_0x48bb73));let _0x2bd1f4=_0x48bb73[_0x42a220(0x2c8)](_0x367117);return _0x2bd1f4||(_0x2bd1f4=new Map(),_0x48bb73[_0x42a220(0x2b1)](_0x367117,_0x2bd1f4)),_0x2bd1f4;}[_0x3d4902(0x2da)](_0x559e4e){const _0x1e918e=_0x3d4902;if(_0x559e4e==null)return;const _0x4db5a2=this[_0x1e918e(0x2ef)]['getRenderById'](_0x559e4e),_0xc5ed56=_0x4db5a2==null?void 0x0:_0x4db5a2[_0x1e918e(0x34f)];if(_0x4db5a2==null||_0xc5ed56==null)return null;const _0x1f7fec=_0xc5ed56[_0x1e918e(0x301)](),_0xa5b95c=_0x4db5a2[_0x1e918e(0x2ff)]['getCanvasElement']();return{'scene':_0xc5ed56,'transformer':_0x1f7fec,'renderObject':_0x4db5a2,'canvas':_0xa5b95c};}[_0x3d4902(0x284)](_0x328a53){const _0xd2c5cb=_0x3d4902;let _0x5a8838;return this[_0xd2c5cb(0x347)][_0xd2c5cb(0x23c)](_0x53fa0a=>{_0x5a8838=_0x53fa0a['onGetFloatDomProps'](_0x328a53);}),_0x5a8838;}[_0x3d4902(0x2db)](){const _0x4decf3=_0x3d4902;this[_0x4decf3(0x26e)](this['_drawingManagerService'][_0x4decf3(0x25e)][_0x4decf3(0x2c2)](_0x53eb91=>{const _0x328237=_0x4decf3;_0x53eb91[_0x328237(0x23c)](_0x1cacb4=>{const _0x52478f=_0x328237;var _0x27cf61,_0x43f8b3,_0x2799fa;const {unitId:_0x3e69a8,subUnitId:_0x7d08b,drawingId:_0x368c15}=_0x1cacb4,_0x2dd0ac=getSheetCommandTarget(this[_0x52478f(0x2b7)],{'unitId':_0x3e69a8,'subUnitId':_0x7d08b}),_0x5846e2=this[_0x52478f(0x1bd)][_0x52478f(0x1fc)](_0x1cacb4);if(!_0x5846e2||!_0x2dd0ac)return;const _0x4c18a7=(_0x27cf61=this[_0x52478f(0x2ef)][_0x52478f(0x200)](_0x3e69a8))==null?void 0x0:_0x27cf61[_0x52478f(0x1f7)](SheetSkeletonManagerService)[_0x52478f(0x395)](_0x7d08b);if(!_0x4c18a7)return;const {transform:_0x4b29f2,drawingType:_0x147ca1,data:_0x8cf4fb}=_0x5846e2;if(_0x147ca1!==_0x4c08d0[_0x52478f(0x26f)])return;const _0x3a6403=this[_0x52478f(0x2da)](_0x3e69a8);if(_0x3a6403==null)return;const {scene:_0x11c134,canvas:_0x1978c8}=_0x3a6403;if(_0x4b29f2==null)return!0x0;const {left:_0x11a90e,top:_0x1c0720,width:_0x3dd134,height:_0x7f6789,angle:_0x2c3e78,flipX:_0x91067,flipY:_0x2f9319,skewX:_0x2934a4,skewY:_0x1d265f}=_0x4b29f2,_0x30196f=getDrawingShapeKeyByDrawingSearch({'unitId':_0x3e69a8,'subUnitId':_0x7d08b,'drawingId':_0x368c15}),_0x581625=_0x11c134[_0x52478f(0x292)](_0x30196f);if(_0x581625!=null){_0x581625[_0x52478f(0x325)]({'left':_0x11a90e,'top':_0x1c0720,'width':_0x3dd134,'height':_0x7f6789,'angle':_0x2c3e78,'flipX':_0x91067,'flipY':_0x2f9319,'skewX':_0x2934a4,'skewY':_0x1d265f});return;}const _0x1d712c={'left':_0x11a90e,'top':_0x1c0720,'width':_0x3dd134,'height':_0x7f6789,'zIndex':this[_0x52478f(0x1bd)][_0x52478f(0x29c)](_0x3e69a8,_0x7d08b)[_0x52478f(0x307)]-0x1},_0xda30c9=new Rect(_0x30196f,_0x1d712c);_0x11c134['addObject'](_0xda30c9,DRAWING_OBJECT_LAYER_INDEX),_0x5846e2[_0x52478f(0x1c0)]!==!0x1&&_0x11c134[_0x52478f(0x23b)](_0xda30c9);const _0x48fa72=this[_0x52478f(0x330)](_0x3e69a8,_0x7d08b),_0x5659b0=new DisposableCollection(),_0x25e891=calcPosition(_0xda30c9,_0x3a6403[_0x52478f(0x2cd)],_0x4c18a7[_0x52478f(0x300)],_0x2dd0ac[_0x52478f(0x2e8)]),_0x42e3c4=new BehaviorSubject(_0x25e891),_0x2a8498={'dispose':_0x5659b0,'rect':_0xda30c9,'position$':_0x42e3c4,'unitId':_0x3e69a8,'subUnitId':_0x7d08b};this['_canvasFloatDomService'][_0x52478f(0x31a)]({'position$':_0x42e3c4,'id':_0x368c15,'componentKey':_0x5846e2['componentKey'],'onPointerDown':__name(_0x14d56a=>{const _0x52ca4a=_0x52478f;_0x1978c8[_0x52ca4a(0x357)](new PointerEvent(_0x14d56a[_0x52ca4a(0x33d)],_0x14d56a));},_0x52478f(0x2bc)),'onPointerMove':__name(_0x566dd1=>{const _0x57d9c8=_0x52478f;_0x1978c8[_0x57d9c8(0x357)](new PointerEvent(_0x566dd1['type'],_0x566dd1));},_0x52478f(0x215)),'onPointerUp':__name(_0x1464a3=>{const _0x41380e=_0x52478f;_0x1978c8[_0x41380e(0x357)](new PointerEvent(_0x1464a3[_0x41380e(0x33d)],_0x1464a3));},_0x52478f(0x274)),'onWheel':__name(_0x1a136c=>{const _0x2c2c27=_0x52478f;_0x1978c8[_0x2c2c27(0x357)](new WheelEvent(_0x1a136c[_0x2c2c27(0x33d)],_0x1a136c));},_0x52478f(0x382)),'props':(_0x2799fa=(_0x43f8b3=_0x48fa72[_0x52478f(0x2c8)](_0x368c15))==null?void 0x0:_0x43f8b3['props'])!=null?_0x2799fa:this[_0x52478f(0x284)](_0x368c15),'data':_0x8cf4fb,'unitId':_0x3e69a8});const _0x2f4635=_0xda30c9[_0x52478f(0x238)][_0x52478f(0x297)](()=>{const _0x4fcb83=_0x52478f,_0x11fa7d=calcPosition(_0xda30c9,_0x3a6403['renderObject'],_0x4c18a7[_0x4fcb83(0x300)],_0x2dd0ac[_0x4fcb83(0x2e8)]);_0x42e3c4[_0x4fcb83(0x24f)](_0x11fa7d);});_0x5659b0[_0x52478f(0x344)](()=>{const _0x455608=_0x52478f;this['_canvasFloatDomService'][_0x455608(0x305)](_0x368c15);}),_0x2f4635&&_0x5659b0[_0x52478f(0x344)](_0x2f4635),this[_0x52478f(0x230)][_0x52478f(0x2b1)](_0x368c15,_0x2a8498),_0x48fa72['set'](_0x368c15,{..._0x48fa72[_0x52478f(0x2c8)](_0x368c15)});});}));}[_0x3d4902(0x2ce)](){const _0x3337e9=_0x3d4902;this['disposeWithMe'](this[_0x3337e9(0x208)][_0x3337e9(0x299)](_0x50950b=>{const _0x155fc0=_0x3337e9;var _0x3b9802,_0x14fdbe;const _0x53eb8f=__name((_0x3dbf18,_0x5c590a)=>{const _0x32479c=_0x42a1;var _0x5b82ef;const _0x31a1ef=this[_0x32479c(0x2da)](_0x3dbf18),_0x1b801c=this[_0x32479c(0x330)](_0x3dbf18,_0x5c590a),_0x5bb8a9=Array[_0x32479c(0x237)](_0x1b801c[_0x32479c(0x384)]()),_0x4f91c3=getSheetCommandTarget(this['_univerInstanceService'],{'unitId':_0x3dbf18,'subUnitId':_0x5c590a}),_0x9d53b4=(_0x5b82ef=this[_0x32479c(0x2ef)]['getRenderById'](_0x3dbf18))==null?void 0x0:_0x5b82ef['with'](SheetSkeletonManagerService)[_0x32479c(0x395)](_0x5c590a);!_0x31a1ef||!_0x4f91c3||!_0x9d53b4||_0x5bb8a9['forEach'](_0x5a4d96=>{const _0x42188a=_0x32479c,_0x1d63b0=this[_0x42188a(0x230)][_0x42188a(0x2c8)](_0x5a4d96);if(_0x1d63b0){const _0x2002f7=calcPosition(_0x1d63b0[_0x42188a(0x2a5)],_0x31a1ef[_0x42188a(0x2cd)],_0x9d53b4[_0x42188a(0x300)],_0x4f91c3['worksheet']);_0x1d63b0['position$']['next'](_0x2002f7);}});},_0x155fc0(0x220));if(_0x50950b['id']===SetScrollOperation['id']){const _0x1f3ef4=_0x50950b[_0x155fc0(0x280)],{unitId:_0x5d8433,sheetId:_0xff3404}=_0x1f3ef4;_0x53eb8f(_0x5d8433,_0xff3404);}else{if(_0x50950b['id']===SetZoomRatioOperation['id']){const _0x1c468c=_0x50950b['params'],{unitId:_0x5e83fb}=_0x1c468c;Array[_0x155fc0(0x237)]((_0x14fdbe=(_0x3b9802=this[_0x155fc0(0x393)][_0x155fc0(0x2c8)](_0x5e83fb))==null?void 0x0:_0x3b9802[_0x155fc0(0x384)]())!=null?_0x14fdbe:[])[_0x155fc0(0x23c)](_0x4ba9cd=>{_0x53eb8f(_0x5e83fb,_0x4ba9cd);});}else{if(_0x50950b['id']===SetFrozenMutation['id']){const {unitId:_0x3008fa,subUnitId:_0x1131ec}=_0x50950b['params'];_0x53eb8f(_0x3008fa,_0x1131ec);}}}}));}['_getPosition'](_0x2763fa,_0x55befe){const _0x40bc6f=_0x3d4902;var _0x2ecf3b;const {startX:_0x52b732,endX:_0x2b746d,startY:_0x3bbe91,endY:_0x499587}=_0x2763fa,_0x47d66f=(_0x2ecf3b=this['_renderManagerService'][_0x40bc6f(0x200)](_0x55befe))==null?void 0x0:_0x2ecf3b['with'](ISheetSelectionRenderService);if(_0x47d66f==null)return;const _0x596493=_0x47d66f[_0x40bc6f(0x248)](_0x52b732,_0x3bbe91);if(_0x596493==null)return;const _0x43904e={'column':_0x596493[_0x40bc6f(0x2a9)],'columnOffset':_0x52b732-_0x596493[_0x40bc6f(0x36e)],'row':_0x596493[_0x40bc6f(0x29d)],'rowOffset':_0x3bbe91-_0x596493['startY']},_0x506574=_0x47d66f[_0x40bc6f(0x248)](_0x2b746d,_0x499587);if(_0x506574==null)return;const _0x42022e={'column':_0x506574[_0x40bc6f(0x2a9)],'columnOffset':_0x2b746d-_0x506574[_0x40bc6f(0x36e)],'row':_0x506574[_0x40bc6f(0x29d)],'rowOffset':_0x499587-_0x506574[_0x40bc6f(0x34b)]};return{'from':_0x43904e,'to':_0x42022e};}[_0x3d4902(0x2ba)](){const _0x1a1f94=_0x3d4902;this[_0x1a1f94(0x26e)](this[_0x1a1f94(0x1bd)][_0x1a1f94(0x385)][_0x1a1f94(0x2c2)](_0x38ea27=>{const _0x3671ac=_0x1a1f94;_0x38ea27[_0x3671ac(0x23c)](_0x330b71=>{const _0xb4abda=_0x3671ac,_0x244259=this[_0xb4abda(0x1bd)]['getDrawingByParam'](_0x330b71);if(!_0x244259||_0x244259['drawingType']!==_0x4c08d0['DRAWING_DOM'])return;const _0x5ef806={..._0x244259['transform']};this['_transformChange$'][_0xb4abda(0x24f)]({'id':_0x330b71[_0xb4abda(0x1be)],'value':_0x5ef806});});}));}['_deleteListener'](){const _0x39223c=_0x3d4902;this[_0x39223c(0x26e)](this[_0x39223c(0x1bd)][_0x39223c(0x22f)][_0x39223c(0x2c2)](_0xd71a62=>{const _0x35b09b=_0x39223c;_0xd71a62[_0x35b09b(0x23c)](_0xa801d3=>{const _0x27db38=_0x35b09b;this['_removeDom'](_0xa801d3[_0x27db38(0x1be)]);});}));}['addFloatDomToPosition'](_0x172a07,_0x51d60c){const _0x5f460b=_0x3d4902,_0x2acd9b=getSheetCommandTarget(this[_0x5f460b(0x2b7)],{'unitId':_0x172a07['unitId'],'subUnitId':_0x172a07[_0x5f460b(0x2f3)]});if(!_0x2acd9b)throw new Error('cannot\x20find\x20current\x20target!');const {unitId:_0x25aabb,subUnitId:_0x186f4a}=_0x2acd9b,{initPosition:_0xeda42,componentKey:_0x50844b,data:_0xf0eafe,allowTransform:allowTransform=!0x0}=_0x172a07,_0x5c6a3e=_0x51d60c!=null?_0x51d60c:generateRandomId(),_0x475387=this[_0x5f460b(0x25a)](_0xeda42,_0x25aabb);if(_0x475387==null)return;this[_0x5f460b(0x330)](_0x25aabb,_0x186f4a)[_0x5f460b(0x2b1)](_0x5c6a3e,_0x172a07);const _0x296c24={'unitId':_0x25aabb,'subUnitId':_0x186f4a,'drawingId':_0x5c6a3e,'drawingType':_0x4c08d0['DRAWING_DOM'],'componentKey':_0x50844b,'sheetTransform':_0x475387,'transform':{'left':_0xeda42[_0x5f460b(0x36e)],'top':_0xeda42['startY'],'width':_0xeda42[_0x5f460b(0x295)]-_0xeda42['startX'],'height':_0xeda42[_0x5f460b(0x204)]-_0xeda42[_0x5f460b(0x34b)]},'data':_0xf0eafe,'allowTransform':allowTransform};return this[_0x5f460b(0x208)][_0x5f460b(0x234)](InsertSheetDrawingCommand['id'],{'unitId':_0x25aabb,'drawings':[_0x296c24]}),{'id':_0x5c6a3e,'dispose':__name(()=>{this['_removeDom'](_0x5c6a3e,!0x0);},_0x5f460b(0x272))};}[_0x3d4902(0x2d6)](_0x39c636,_0x517187=!0x1){const _0x10eedf=_0x3d4902,_0x3f88d6=this['_domLayerInfoMap']['get'](_0x39c636);if(!_0x3f88d6)return;const {unitId:_0x32e896,subUnitId:_0x19b527}=_0x3f88d6;this[_0x10eedf(0x230)]['delete'](_0x39c636),_0x3f88d6[_0x10eedf(0x272)]['dispose']();const _0x2eba82=this['_getSceneAndTransformerByDrawingSearch'](_0x32e896);if(_0x2eba82&&_0x2eba82[_0x10eedf(0x34f)][_0x10eedf(0x250)](_0x3f88d6['rect']),_0x517187){this['_ensureMap'](_0x32e896,_0x19b527)[_0x10eedf(0x327)](_0x39c636);const _0x15d324=this['_drawingManagerService'][_0x10eedf(0x1fc)]({'unitId':_0x32e896,'subUnitId':_0x19b527,'drawingId':_0x39c636});if(!_0x15d324)return;const _0x445827=this['_sheetDrawingService'][_0x10eedf(0x1ea)]([_0x15d324]),{redo:_0x3d5fdd,objects:_0x5e8952}=_0x445827;this['_commandService']['syncExecuteCommand'](SetDrawingApplyMutation['id'],{'unitId':_0x32e896,'subUnitId':_0x19b527,'op':_0x3d5fdd,'objects':_0x5e8952,'type':DrawingApplyType[_0x10eedf(0x331)]});}}[_0x3d4902(0x2d3)](_0x5ee835){const _0xf4602f=_0x3d4902;return this[_0xf4602f(0x347)][_0xf4602f(0x1dd)](_0x5ee835),{'dispose':__name(()=>{const _0x3fcfba=_0xf4602f,_0x856a7d=this[_0x3fcfba(0x347)][_0x3fcfba(0x26b)](_0x184d32=>_0x184d32===_0x5ee835);this[_0x3fcfba(0x347)][_0x3fcfba(0x376)](_0x856a7d,0x1);},_0xf4602f(0x272))};}},__name(_a9,_0x3d4902(0x224)),_a9);SheetCanvasFloatDomManagerService=__decorateClass$1([__decorateParam$1(0x0,Inject(IRenderManagerService)),__decorateParam$1(0x1,IUniverInstanceService),__decorateParam$1(0x2,Inject(ICommandService)),__decorateParam$1(0x3,IDrawingManagerService),__decorateParam$1(0x4,Inject(CanvasFloatDomService)),__decorateParam$1(0x5,ISheetDrawingService)],SheetCanvasFloatDomManagerService);var __defProp2=Object[_0x3d4902(0x1c5)],__getOwnPropDesc=Object[_0x3d4902(0x358)],__defNormalProp2=__name((_0x3349cb,_0x116e72,_0x41f727)=>_0x116e72 in _0x3349cb?__defProp2(_0x3349cb,_0x116e72,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x41f727}):_0x3349cb[_0x116e72]=_0x41f727,'__defNormalProp'),__decorateClass=__name((_0x37e2e1,_0x1622b4,_0x1f9e13,_0x52450a)=>{for(var _0x3981cb=_0x52450a>0x1?void 0x0:_0x52450a?__getOwnPropDesc(_0x1622b4,_0x1f9e13):_0x1622b4,_0x31d9e8=_0x37e2e1['length']-0x1,_0x26fd72;_0x31d9e8>=0x0;_0x31d9e8--)(_0x26fd72=_0x37e2e1[_0x31d9e8])&&(_0x3981cb=(_0x52450a?_0x26fd72(_0x1622b4,_0x1f9e13,_0x3981cb):_0x26fd72(_0x3981cb))||_0x3981cb);return _0x52450a&&_0x3981cb&&__defProp2(_0x1622b4,_0x1f9e13,_0x3981cb),_0x3981cb;},'__decorateClass'),__decorateParam=__name((_0x340f45,_0x51bc34)=>(_0x7c8716,_0x2e3568)=>_0x51bc34(_0x7c8716,_0x2e3568,_0x340f45),_0x3d4902(0x23f)),__publicField2=__name((_0x29f744,_0xe07a02,_0x45a335)=>__defNormalProp2(_0x29f744,typeof _0xe07a02!=_0x3d4902(0x1eb)?_0xe07a02+'':_0xe07a02,_0x45a335),_0x3d4902(0x246));const PLUGIN_NAME=_0x3d4902(0x2b3);var _a10;function _0x42a1(_0x30a788,_0x391317){const _0x3354fc=_0x3354();return _0x42a1=function(_0x42a180,_0x1656a5){_0x42a180=_0x42a180-0x1bb;let _0x10d4d8=_0x3354fc[_0x42a180];return _0x10d4d8;},_0x42a1(_0x30a788,_0x391317);}let UniverSheetsDrawingUIPlugin=(_a10=class extends Plugin{constructor(_0x1cac11=defaultPluginConfig,_0x304b46,_0x5d9002,_0x2d7147){const _0x2c8589=_0x3d4902;super(),this[_0x2c8589(0x32d)]=_0x1cac11,this['_injector']=_0x304b46,this[_0x2c8589(0x2ef)]=_0x5d9002,this[_0x2c8589(0x225)]=_0x2d7147;const {menu:_0x26e7c3,..._0x25928b}=this[_0x2c8589(0x32d)];_0x26e7c3&&this[_0x2c8589(0x225)][_0x2c8589(0x374)]('menu',_0x26e7c3,{'merge':!0x0}),this[_0x2c8589(0x225)][_0x2c8589(0x374)](PLUGIN_CONFIG_KEY,_0x25928b);}[_0x3d4902(0x2b6)](){const _0x2d418d=_0x3d4902;this['_initDependencies'](),this[_0x2d418d(0x2e5)][_0x2d418d(0x2c8)](SheetCanvasFloatDomManagerService);}[_0x3d4902(0x203)](){const _0x15587b=_0x3d4902;this[_0x15587b(0x2e5)][_0x15587b(0x2c8)](SheetsDrawingCopyPasteController);}['onRendered'](){const _0x4e5511=_0x3d4902;this[_0x4e5511(0x349)](),this[_0x4e5511(0x2e5)]['get'](SheetDrawingPermissionController),this[_0x4e5511(0x2e5)]['get'](SheetDrawingPrintingController),this[_0x4e5511(0x2e5)]['get'](SheetDrawingUIController);}['onSteady'](){const _0x30b0f8=_0x3d4902;this[_0x30b0f8(0x2e5)][_0x30b0f8(0x2c8)](DrawingPopupMenuController);}[_0x3d4902(0x28f)](){const _0x5c88af=_0x3d4902;[[SheetCanvasFloatDomManagerService],[SheetDrawingUIController],[DrawingPopupMenuController],[SheetDrawingPrintingController],[SheetDrawingPermissionController],[SheetsDrawingCopyPasteController]]['forEach'](_0x98fd7c=>this[_0x5c88af(0x2e5)][_0x5c88af(0x344)](_0x98fd7c));}[_0x3d4902(0x349)](){const _0x1cd9bd=_0x3d4902;[[SheetDrawingUpdateController],[SheetDrawingTransformAffectedController],[SheetsDrawingRenderController]][_0x1cd9bd(0x23c)](_0xdce0ef=>{const _0x4bfe17=_0x1cd9bd;this[_0x4bfe17(0x26e)](this['_renderManagerService'][_0x4bfe17(0x2bb)](UniverInstanceType['UNIVER_SHEET'],_0xdce0ef));});}},__name(_a10,_0x3d4902(0x1d5)),_a10);__publicField2(UniverSheetsDrawingUIPlugin,_0x3d4902(0x33d),UniverInstanceType[_0x3d4902(0x1e8)]),__publicField2(UniverSheetsDrawingUIPlugin,_0x3d4902(0x2aa),PLUGIN_NAME),UniverSheetsDrawingUIPlugin=__decorateClass([DependentOn(UniverDrawingPlugin,UniverDrawingUIPlugin,UniverSheetsDrawingPlugin),__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,IRenderManagerService),__decorateParam(0x3,IConfigService)],UniverSheetsDrawingUIPlugin);export{ClearSheetDrawingTransformerOperation,DeleteDrawingsCommand,EditSheetDrawingOperation,GroupSheetDrawingCommand,IMAGE_MENU_ID,InsertFloatImageCommand,InsertSheetDrawingCommand,MoveDrawingsCommand,RemoveSheetDrawingCommand,SetDrawingArrangeCommand,SetSheetDrawingCommand,SheetCanvasFloatDomManagerService,SidebarSheetDrawingOperation,UngroupSheetDrawingCommand,UniverSheetsDrawingUIPlugin};