@univerjs/docs-drawing-ui 0.7.0-nightly.202505091607 → 0.7.0-nightly.202505111606

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,27 +1,27 @@
1
1
  var kn = Object.defineProperty;
2
- var jn = (i, e, t) => e in i ? kn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var _e = (i, e, t) => jn(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { CommandType as q, ICommandService as G, IUniverInstanceService as z, TextX as Dt, JSONX as $, MemoryCursor as Wn, TextXActionType as Y, IUndoRedoService as Zt, BuildTextUtils as Hn, ArrangeTypeEnum as Je, Tools as Ce, Inject as Z, IContextService as Qt, LocaleService as ft, Disposable as Ue, WrapTextType as qe, PositionedObjectLayoutType as k, BooleanNumber as oe, DrawingTypeEnum as Le, ObjectRelativeFromV as j, ObjectRelativeFromH as J, FOCUSING_COMMON_DRAWINGS as rt, UniverInstanceType as Ie, Direction as he, DocumentFlavor as pt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as yt, FOCUSING_UNIVER_EDITOR as Gn, UndoCommand as Vn, RedoCommand as $n, DisposableCollection as zn, toDisposable as ye, fromEventSubject as Jt, generateRandomId as Xn, Injector as en, DOC_DRAWING_PRINTING_COMPONENT_KEY as qn, throttle as Et, COLORS as Kn, RxDisposable as Yn, LifecycleService as Zn, LifecycleStages as Rt, DependentOn as Qn, IConfigService as Jn, Plugin as ei, merge as ti } from "@univerjs/core";
5
- import { IDocDrawingService as Be, UniverDocsDrawingPlugin as ni } from "@univerjs/docs-drawing";
6
- import { IImageIoService as ii, IDrawingManagerService as ve, DRAWING_IMAGE_ALLOW_IMAGE_LIST as ri, DRAWING_IMAGE_COUNT_LIMIT as At, ImageUploadStatusType as wt, DRAWING_IMAGE_ALLOW_SIZE as si, getImageSize as oi, getDrawingShapeKeyByDrawingSearch as ai, DRAWING_IMAGE_WIDTH_LIMIT as Pt, DRAWING_IMAGE_HEIGHT_LIMIT as Lt, UniverDrawingPlugin as ci } from "@univerjs/drawing";
2
+ var Wn = (i, e, t) => e in i ? kn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
+ var Ie = (i, e, t) => Wn(i, typeof e != "symbol" ? e + "" : e, t);
4
+ import { CommandType as q, ICommandService as j, IUniverInstanceService as z, TextX as Dt, JSONX as $, MemoryCursor as Hn, TextXActionType as Y, IUndoRedoService as Zt, BuildTextUtils as Gn, ArrangeTypeEnum as Qe, Tools as be, Inject as Z, IContextService as Qt, LocaleService as gt, Disposable as Le, WrapTextType as Xe, PositionedObjectLayoutType as k, BooleanNumber as se, DrawingTypeEnum as Pe, ObjectRelativeFromV as W, ObjectRelativeFromH as J, FOCUSING_COMMON_DRAWINGS as it, UniverInstanceType as we, Direction as fe, DocumentFlavor as pt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Ot, FOCUSING_UNIVER_EDITOR as jn, UndoCommand as Vn, RedoCommand as $n, DisposableCollection as zn, toDisposable as De, fromEventSubject as Jt, generateRandomId as Xn, Injector as en, DOC_DRAWING_PRINTING_COMPONENT_KEY as qn, throttle as Et, COLORS as Kn, RxDisposable as Yn, LifecycleService as Zn, LifecycleStages as Rt, DependentOn as Qn, IConfigService as Jn, Plugin as ei, merge as ti } from "@univerjs/core";
5
+ import { IDocDrawingService as Ue, UniverDocsDrawingPlugin as ni } from "@univerjs/docs-drawing";
6
+ import { IImageIoService as ii, IDrawingManagerService as me, DRAWING_IMAGE_ALLOW_IMAGE_LIST as ri, DRAWING_IMAGE_COUNT_LIMIT as At, ImageUploadStatusType as vt, DRAWING_IMAGE_ALLOW_SIZE as si, getImageSize as oi, getDrawingShapeKeyByDrawingSearch as ai, DRAWING_IMAGE_WIDTH_LIMIT as Pt, DRAWING_IMAGE_HEIGHT_LIMIT as Lt, UniverDrawingPlugin as ci } from "@univerjs/drawing";
7
7
  import { DrawingCommonPanel as di, DrawingRenderService as tn, ImageCropperObject as li, COMPONENT_IMAGE_POPUP_MENU as ui, OpenImageCropOperation as gi, ImageResetSizeOperation as fi, UniverDrawingUIPlugin as hi } from "@univerjs/drawing-ui";
8
- import { IRenderManagerService as Q, DocumentEditArea as We, getCurrentTypeOfRenderer as mi, CURSOR_TYPE as Ut, Liquid as nn, PageLayoutType as Bt, DocumentSkeletonPageType as Ft, Vector2 as vi, Rect as pi, getColor as wi, TRANSFORM_CHANGE_OBSERVABLE_TYPE as Ii } from "@univerjs/engine-render";
9
- import { IMessageService as _i, ILocalFileService as Si, ISidebarService as Di, useDependency as we, getMenuHiddenObservable as rn, MenuItemType as sn, RibbonStartGroup as yi, KeyCode as He, ComponentManager as on, IMenuManagerService as Oi, IShortcutService as Ti, CanvasFloatDomService as Mi, PrintFloatDomSingle as bi, connectInjector as Ci, UniverUIPlugin as xi } from "@univerjs/ui";
10
- import { RichTextEditingMutation as ee, DocSelectionManagerService as Ot, DocSkeletonManagerService as ne } from "@univerjs/docs";
11
- import { DocSelectionRenderService as xe, getRichTextEditPath as Ke, getCustomBlockIdsInSelections as Ni, docDrawingPositionToTransform as an, VIEWPORT_KEY as cn, SetDocZoomRatioOperation as dn, DocPrintInterceptorService as Ei, NodePositionConvertToCursor as kt, getOneTextSelectionRange as jt, getAnchorBounding as Ri, TEXT_RANGE_LAYER_INDEX as Ai, getDocObject as Pi, DocCanvasPopManagerService as Li, IEditorService as Ui } from "@univerjs/docs-ui";
12
- import { MessageType as Wt, clsx as te, InputNumber as je, Select as Ht, Checkbox as Bi, borderTopClassName as ln, RadioGroup as Gt, Radio as be, render as Fi, unmount as ki } from "@univerjs/design";
13
- import { BehaviorSubject as Tt, debounceTime as un, Observable as ji, map as Vt, switchMap as Wi, of as Hi, takeUntil as $t, filter as zt } from "rxjs";
8
+ import { IRenderManagerService as Q, DocumentEditArea as We, getCurrentTypeOfRenderer as mi, CURSOR_TYPE as Ut, Liquid as nn, PageLayoutType as Bt, DocumentSkeletonPageType as Ft, Vector2 as pi, Rect as vi, getColor as wi, TRANSFORM_CHANGE_OBSERVABLE_TYPE as Ii } from "@univerjs/engine-render";
9
+ import { IMessageService as _i, ILocalFileService as Si, ISidebarService as Di, useDependency as ve, getMenuHiddenObservable as rn, MenuItemType as sn, RibbonStartGroup as Oi, KeyCode as He, ComponentManager as on, IMenuManagerService as yi, IShortcutService as Ti, CanvasFloatDomService as Mi, PrintFloatDomSingle as bi, connectInjector as xi, UniverUIPlugin as Ci } from "@univerjs/ui";
10
+ import { RichTextEditingMutation as ee, DocSelectionManagerService as yt, DocSkeletonManagerService as te } from "@univerjs/docs";
11
+ import { DocSelectionRenderService as xe, getRichTextEditPath as qe, getCustomBlockIdsInSelections as Ni, docDrawingPositionToTransform as an, VIEWPORT_KEY as cn, SetDocZoomRatioOperation as dn, DocPrintInterceptorService as Ei, NodePositionConvertToCursor as kt, getOneTextSelectionRange as Wt, getAnchorBounding as Ri, TEXT_RANGE_LAYER_INDEX as Ai, getDocObject as Pi, DocCanvasPopManagerService as Li, IEditorService as Ui } from "@univerjs/docs-ui";
12
+ import { MessageType as Ht, clsx as _t, InputNumber as ke, Select as Gt, Checkbox as Bi, borderTopClassName as ln, RadioGroup as jt, Radio as Me, render as Fi, unmount as ki } from "@univerjs/design";
13
+ import { BehaviorSubject as Tt, debounceTime as un, Observable as Wi, map as Vt, switchMap as Hi, of as Gi, takeUntil as $t, filter as zt } from "rxjs";
14
14
  import { jsxs as X, jsx as m } from "react/jsx-runtime";
15
- import { forwardRef as gn, useRef as Gi, createElement as fn, useState as se, useEffect as Mt, useMemo as Vi } from "react";
15
+ import { forwardRef as gn, useRef as ji, createElement as fn, useState as re, useEffect as Mt, useMemo as Vi } from "react";
16
16
  const $i = "docs-drawing-ui.config", Xt = {};
17
- var me = function() {
18
- return me = Object.assign || function(i) {
17
+ var he = function() {
18
+ return he = Object.assign || function(i) {
19
19
  for (var e, t = 1, n = arguments.length; t < n; t++) {
20
20
  e = arguments[t];
21
21
  for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (i[r] = e[r]);
22
22
  }
23
23
  return i;
24
- }, me.apply(this, arguments);
24
+ }, he.apply(this, arguments);
25
25
  }, zi = function(i, e) {
26
26
  var t = {};
27
27
  for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && e.indexOf(n) < 0 && (t[n] = i[n]);
@@ -30,16 +30,16 @@ var me = function() {
30
30
  e.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, n[r]) && (t[n[r]] = i[n[r]]);
31
31
  return t;
32
32
  }, hn = gn(function(i, e) {
33
- var t = i.icon, n = i.id, r = i.className, s = i.extend, o = zi(i, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), d = Gi("_".concat(Ki()));
34
- return mn(t, "".concat(n), { defIds: t.defIds, idSuffix: d.current }, me({ ref: e, className: c }, o), s);
33
+ var t = i.icon, n = i.id, r = i.className, s = i.extend, o = zi(i, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), d = ji("_".concat(Ki()));
34
+ return mn(t, "".concat(n), { defIds: t.defIds, idSuffix: d.current }, he({ ref: e, className: c }, o), s);
35
35
  });
36
36
  function mn(i, e, t, n, r) {
37
- return fn(i.tag, me(me({ key: e }, Xi(i, t, r)), n), (qi(i, t).children || []).map(function(s, o) {
37
+ return fn(i.tag, he(he({ key: e }, Xi(i, t, r)), n), (qi(i, t).children || []).map(function(s, o) {
38
38
  return mn(s, "".concat(e, "-").concat(i.tag, "-").concat(o), t, void 0, r);
39
39
  }));
40
40
  }
41
41
  function Xi(i, e, t) {
42
- var n = me({}, i.attrs);
42
+ var n = he({}, i.attrs);
43
43
  t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1), i.tag === "mask" && n.id && (n.id = n.id + e.idSuffix), Object.entries(n).forEach(function(s) {
44
44
  var o = s[0], c = s[1];
45
45
  o === "mask" && typeof c == "string" && (n[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
@@ -52,46 +52,46 @@ function Xi(i, e, t) {
52
52
  }
53
53
  function qi(i, e) {
54
54
  var t, n = e.defIds;
55
- return !n || n.length === 0 ? i : i.tag === "defs" && (!((t = i.children) === null || t === void 0) && t.length) ? me(me({}, i), { children: i.children.map(function(r) {
56
- return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? me(me({}, r), { attrs: me(me({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
55
+ return !n || n.length === 0 ? i : i.tag === "defs" && (!((t = i.children) === null || t === void 0) && t.length) ? he(he({}, i), { children: i.children.map(function(r) {
56
+ return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? he(he({}, r), { attrs: he(he({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
57
57
  }) }) : i;
58
58
  }
59
59
  function Ki() {
60
60
  return Math.random().toString(36).substring(2, 8);
61
61
  }
62
62
  hn.displayName = "UniverIcon";
63
- var Yi = { 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" } }] }, vn = gn(function(i, e) {
63
+ var Yi = { 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" } }] }, pn = gn(function(i, e) {
64
64
  return fn(hn, Object.assign({}, i, {
65
65
  id: "add-image-single",
66
66
  ref: e,
67
67
  icon: Yi
68
68
  }));
69
69
  });
70
- vn.displayName = "AddImageSingle";
70
+ pn.displayName = "AddImageSingle";
71
71
  const bt = {
72
72
  id: "doc.command.remove-doc-image",
73
73
  type: q.COMMAND,
74
74
  // eslint-disable-next-line max-lines-per-function
75
75
  handler: (i, e) => {
76
- var C, M, E, U;
77
- const t = i.get(G), n = i.get(z), r = i.get(Q), s = n.getCurrentUniverDocInstance();
76
+ var x, M, E, U;
77
+ const t = i.get(j), n = i.get(z), r = i.get(Q), s = n.getCurrentUniverDocInstance();
78
78
  if (e == null || s == null)
79
79
  return !1;
80
- const o = r.getRenderById(e.unitId).with(xe), { drawings: c } = e, d = (C = o.getSegment()) != null ? C : "", a = new Dt(), l = $.getInstance(), g = (E = (M = s.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : M.customBlocks) != null ? E : [], u = c.map((N) => g.find((I) => I.blockId === N.drawingId)).filter((N) => !!N).sort((N, I) => N.startIndex > I.startIndex ? 1 : -1), h = c[0].unitId, f = new Wn();
80
+ const o = r.getRenderById(e.unitId).with(xe), { drawings: c } = e, d = (x = o.getSegment()) != null ? x : "", a = new Dt(), l = $.getInstance(), g = (E = (M = s.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : M.customBlocks) != null ? E : [], u = c.map((N) => g.find((I) => I.blockId === N.drawingId)).filter((N) => !!N).sort((N, I) => N.startIndex > I.startIndex ? 1 : -1), h = c[0].unitId, f = new Hn();
81
81
  f.reset();
82
- const p = u[0].startIndex, v = [
82
+ const v = u[0].startIndex, p = [
83
83
  {
84
- startOffset: p,
85
- endOffset: p
84
+ startOffset: v,
85
+ endOffset: v
86
86
  }
87
87
  ], w = {
88
88
  id: ee.id,
89
89
  params: {
90
90
  unitId: h,
91
91
  actions: [],
92
- textRanges: v
92
+ textRanges: p
93
93
  }
94
- }, y = [];
94
+ }, O = [];
95
95
  for (const N of u) {
96
96
  const { startIndex: I } = N;
97
97
  I > f.cursor && a.push({
@@ -102,19 +102,19 @@ const bt = {
102
102
  len: 1
103
103
  }), f.moveCursorTo(I + 1);
104
104
  }
105
- const D = Ke(s, d);
106
- y.push(l.editOp(a.serialize(), D));
105
+ const D = qe(s, d);
106
+ O.push(l.editOp(a.serialize(), D));
107
107
  for (const N of u) {
108
- const { blockId: I } = N, P = ((U = s.getDrawings()) != null ? U : {})[I], A = s.getDrawingsOrder().indexOf(I), H = l.removeOp(["drawings", I], P), _ = l.removeOp(["drawingsOrder", A], I);
109
- y.push(H), y.push(_);
108
+ const { blockId: I } = N, P = ((U = s.getDrawings()) != null ? U : {})[I], A = s.getDrawingsOrder().indexOf(I), G = l.removeOp(["drawings", I], P), _ = l.removeOp(["drawingsOrder", A], I);
109
+ O.push(G), O.push(_);
110
110
  }
111
- return w.params.actions = y.reduce((N, I) => $.compose(N, I), null), !!t.syncExecuteCommand(w.id, w.params);
111
+ return w.params.actions = O.reduce((N, I) => $.compose(N, I), null), !!t.syncExecuteCommand(w.id, w.params);
112
112
  }
113
- }, pn = {
113
+ }, vn = {
114
114
  id: "doc.command.delete-drawing",
115
115
  type: q.COMMAND,
116
116
  handler: (i) => {
117
- const e = i.get(G), n = i.get(Be).getFocusDrawings();
117
+ const e = i.get(j), n = i.get(Ue).getFocusDrawings();
118
118
  if (n.length === 0)
119
119
  return !1;
120
120
  const { unitId: r } = n[0], s = n.map((o) => {
@@ -135,8 +135,8 @@ const bt = {
135
135
  id: "doc.command.group-doc-image",
136
136
  type: q.COMMAND,
137
137
  handler: (i, e) => {
138
- i.get(G), i.get(Zt);
139
- const t = i.get(Be);
138
+ i.get(j), i.get(Zt);
139
+ const t = i.get(Ue);
140
140
  if (!e) return !1;
141
141
  const n = [];
142
142
  e.forEach(({ parent: l, children: g }) => {
@@ -147,7 +147,7 @@ const bt = {
147
147
  const r = t.getGroupDrawingOp(e), { unitId: s, subUnitId: o, undo: c, redo: d, objects: a } = r;
148
148
  return !1;
149
149
  }
150
- }, Ct = {
150
+ }, xt = {
151
151
  id: "doc.command.insert-doc-image",
152
152
  type: q.COMMAND,
153
153
  // eslint-disable-next-line max-lines-per-function
@@ -155,13 +155,13 @@ const bt = {
155
155
  var M, E, U, N;
156
156
  if (e == null)
157
157
  return !1;
158
- const t = i.get(G), n = i.get(Ot), r = i.get(z), s = n.getActiveTextRange(), o = r.getCurrentUniverDocInstance();
158
+ const t = i.get(j), n = i.get(yt), r = i.get(z), s = n.getActiveTextRange(), o = r.getCurrentUniverDocInstance();
159
159
  if (s == null || o == null)
160
160
  return !1;
161
161
  const c = o.getUnitId(), { drawings: d } = e, { collapsed: a, startOffset: l, segmentId: g } = s, u = o.getSelfOrHeaderFooterModel(g).getBody();
162
162
  if (u == null)
163
163
  return !1;
164
- const h = new Dt(), f = $.getInstance(), p = [], v = (E = (M = o.getSnapshot().drawingsOrder) == null ? void 0 : M.length) != null ? E : 0;
164
+ const h = new Dt(), f = $.getInstance(), v = [], p = (E = (M = o.getSnapshot().drawingsOrder) == null ? void 0 : M.length) != null ? E : 0;
165
165
  let w = 0;
166
166
  if (a)
167
167
  l > 0 && h.push({
@@ -169,16 +169,16 @@ const bt = {
169
169
  len: l
170
170
  });
171
171
  else {
172
- const I = Hn.selection.delete([s], u, 0, null, !1);
172
+ const I = Gn.selection.delete([s], u, 0, null, !1);
173
173
  h.push(...I);
174
- const P = Ni(u, [s]), W = (U = o.getDrawings()) != null ? U : {}, A = (N = o.getDrawingsOrder()) != null ? N : [], H = P.sort((_, S) => A.indexOf(_) > A.indexOf(S) ? -1 : A.indexOf(_) < A.indexOf(S) ? 1 : 0);
175
- if (H.length > 0)
176
- for (const _ of H) {
177
- const S = W[_], x = A.indexOf(_);
178
- if (S == null || x < 0)
174
+ const P = Ni(u, [s]), H = (U = o.getDrawings()) != null ? U : {}, A = (N = o.getDrawingsOrder()) != null ? N : [], G = P.sort((_, S) => A.indexOf(_) > A.indexOf(S) ? -1 : A.indexOf(_) < A.indexOf(S) ? 1 : 0);
175
+ if (G.length > 0)
176
+ for (const _ of G) {
177
+ const S = H[_], C = A.indexOf(_);
178
+ if (S == null || C < 0)
179
179
  continue;
180
- const T = f.removeOp(["drawings", _], S), L = f.removeOp(["drawingsOrder", x], _);
181
- p.push(T), p.push(L), w++;
180
+ const T = f.removeOp(["drawings", _], S), L = f.removeOp(["drawingsOrder", C], _);
181
+ v.push(T), v.push(L), w++;
182
182
  }
183
183
  }
184
184
  h.push({
@@ -192,13 +192,13 @@ const bt = {
192
192
  },
193
193
  len: d.length
194
194
  });
195
- const y = Ke(o, g), D = f.editOp(h.serialize(), y);
196
- p.push(D);
195
+ const O = qe(o, g), D = f.editOp(h.serialize(), O);
196
+ v.push(D);
197
197
  for (const I of d) {
198
- const { drawingId: P } = I, W = f.insertOp(["drawings", P], I), A = f.insertOp(["drawingsOrder", v - w], P);
199
- p.push(W), p.push(A);
198
+ const { drawingId: P } = I, H = f.insertOp(["drawings", P], I), A = f.insertOp(["drawingsOrder", p - w], P);
199
+ v.push(H), v.push(A);
200
200
  }
201
- const O = {
201
+ const y = {
202
202
  id: ee.id,
203
203
  params: {
204
204
  unitId: c,
@@ -206,24 +206,24 @@ const bt = {
206
206
  textRanges: []
207
207
  }
208
208
  };
209
- return O.params.actions = p.reduce((I, P) => $.compose(I, P), null), !!t.syncExecuteCommand(O.id, O.params);
209
+ return y.params.actions = v.reduce((I, P) => $.compose(I, P), null), !!t.syncExecuteCommand(y.id, y.params);
210
210
  }
211
211
  }, In = {
212
212
  id: "doc.command.set-drawing-arrange",
213
213
  type: q.COMMAND,
214
214
  handler: (i, e) => {
215
- const t = i.get(G), n = i.get(Be);
215
+ const t = i.get(j), n = i.get(Ue);
216
216
  if (e == null)
217
217
  return !1;
218
218
  const { unitId: r, subUnitId: s, drawingIds: o, arrangeType: c } = e, d = { unitId: r, subUnitId: s, drawingIds: o };
219
219
  let a;
220
- if (c === Je.forward ? a = n.getForwardDrawingsOp(d) : c === Je.backward ? a = n.getBackwardDrawingOp(d) : c === Je.front ? a = n.getFrontDrawingsOp(d) : c === Je.back && (a = n.getBackDrawingsOp(d)), a == null)
220
+ if (c === Qe.forward ? a = n.getForwardDrawingsOp(d) : c === Qe.backward ? a = n.getBackwardDrawingOp(d) : c === Qe.front ? a = n.getFrontDrawingsOp(d) : c === Qe.back && (a = n.getBackDrawingsOp(d)), a == null)
221
221
  return !1;
222
222
  const { redo: l } = a;
223
223
  if (l == null)
224
224
  return !1;
225
225
  const g = [];
226
- let u = Ce.deepClone(l);
226
+ let u = be.deepClone(l);
227
227
  u = u.slice(3), u.unshift("drawingsOrder"), g.push(u);
228
228
  const h = {
229
229
  id: ee.id,
@@ -233,14 +233,14 @@ const bt = {
233
233
  textRanges: null
234
234
  }
235
235
  };
236
- return h.params.actions = g.reduce((p, v) => $.compose(p, v), null), !!t.syncExecuteCommand(h.id, h.params);
236
+ return h.params.actions = g.reduce((v, p) => $.compose(v, p), null), !!t.syncExecuteCommand(h.id, h.params);
237
237
  }
238
238
  }, _n = {
239
239
  id: "doc.command.ungroup-doc-image",
240
240
  type: q.COMMAND,
241
241
  handler: (i, e) => {
242
- i.get(G), i.get(Zt);
243
- const t = i.get(Be);
242
+ i.get(j), i.get(Zt);
243
+ const t = i.get(Ue);
244
244
  if (!e) return !1;
245
245
  const n = [];
246
246
  e.forEach(({ parent: l, children: g }) => {
@@ -252,10 +252,10 @@ const bt = {
252
252
  return !1;
253
253
  }
254
254
  };
255
- class ht {
255
+ class ft {
256
256
  constructor() {
257
- _e(this, "_refreshDrawings$", new Tt(null));
258
- _e(this, "refreshDrawings$", this._refreshDrawings$.asObservable());
257
+ Ie(this, "_refreshDrawings$", new Tt(null));
258
+ Ie(this, "refreshDrawings$", this._refreshDrawings$.asObservable());
259
259
  }
260
260
  refreshDrawings(e) {
261
261
  this._refreshDrawings$.next(e);
@@ -265,8 +265,8 @@ var Zi = Object.getOwnPropertyDescriptor, Qi = (i, e, t, n) => {
265
265
  for (var r = n > 1 ? void 0 : n ? Zi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
266
266
  (o = i[s]) && (r = o(r) || r);
267
267
  return r;
268
- }, ge = (i, e) => (t, n) => e(t, n, i);
269
- let st = class extends Ue {
268
+ }, ue = (i, e) => (t, n) => e(t, n, i);
269
+ let rt = class extends Le {
270
270
  constructor(i, e, t, n, r, s, o, c, d, a, l, g, u) {
271
271
  super(), this._context = i, this._commandService = e, this._docSelectionManagerService = t, this._renderManagerSrv = n, this._imageIoService = r, this._docDrawingService = s, this._drawingManagerService = o, this._contextService = c, this._messageService = d, this._localeService = a, this._docSelectionRenderService = l, this._docRefreshDrawingsService = g, this._fileOpenerService = u, this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener(), this._transformDrawingListener(), this._editAreaChangeListener();
272
272
  }
@@ -276,7 +276,7 @@ let st = class extends Ue {
276
276
  accept: ri.map((t) => `.${t.replace("image/", "")}`).join(",")
277
277
  }), e = i.length;
278
278
  return e > At ? (this._messageService.show({
279
- type: Wt.Error,
279
+ type: Ht.Error,
280
280
  content: this._localeService.t("update-status.exceedMaxCount", String(At))
281
281
  }), !1) : e === 0 ? !1 : (await this._insertFloatImages(i), !0);
282
282
  }
@@ -289,18 +289,18 @@ let st = class extends Ue {
289
289
  const s = r.message;
290
290
  let o = "";
291
291
  switch (s) {
292
- case wt.ERROR_EXCEED_SIZE:
292
+ case vt.ERROR_EXCEED_SIZE:
293
293
  o = this._localeService.t("update-status.exceedMaxSize", String(si / (1024 * 1024)));
294
294
  break;
295
- case wt.ERROR_IMAGE_TYPE:
295
+ case vt.ERROR_IMAGE_TYPE:
296
296
  o = this._localeService.t("update-status.invalidImageType");
297
297
  break;
298
- case wt.ERROR_IMAGE:
298
+ case vt.ERROR_IMAGE:
299
299
  o = this._localeService.t("update-status.invalidImage");
300
300
  break;
301
301
  }
302
302
  this._messageService.show({
303
- type: Wt.Error,
303
+ type: Ht.Error,
304
304
  content: o
305
305
  });
306
306
  }
@@ -314,8 +314,8 @@ let st = class extends Ue {
314
314
  this._imageIoService.addImageSourceCache(s, o, g);
315
315
  let u = 1;
316
316
  if (a > Pt || l > Lt) {
317
- const v = Pt / a, w = Lt / l;
318
- u = Math.min(v, w);
317
+ const p = Pt / a, w = Lt / l;
318
+ u = Math.min(p, w);
319
319
  }
320
320
  const h = this._getImagePosition(a * u, l * u);
321
321
  if (h == null)
@@ -324,32 +324,32 @@ let st = class extends Ue {
324
324
  unitId: t,
325
325
  subUnitId: t,
326
326
  drawingId: s,
327
- drawingType: Le.DRAWING_IMAGE,
327
+ drawingType: Pe.DRAWING_IMAGE,
328
328
  imageSourceType: o,
329
329
  source: c,
330
330
  transform: an(h),
331
331
  docTransform: h,
332
- behindDoc: oe.FALSE,
332
+ behindDoc: se.FALSE,
333
333
  title: "",
334
334
  description: "",
335
335
  layoutType: k.INLINE,
336
336
  // Insert inline drawing by default.
337
- wrapText: qe.BOTH_SIDES,
337
+ wrapText: Xe.BOTH_SIDES,
338
338
  distB: 0,
339
339
  distL: 0,
340
340
  distR: 0,
341
341
  distT: 0
342
342
  };
343
- this._isInsertInHeaderFooter() && (f.isMultiTransform = oe.TRUE, f.transforms = f.transform ? [f.transform] : null), n.push(f);
343
+ this._isInsertInHeaderFooter() && (f.isMultiTransform = se.TRUE, f.transforms = f.transform ? [f.transform] : null), n.push(f);
344
344
  }
345
- this._commandService.executeCommand(Ct.id, {
345
+ this._commandService.executeCommand(xt.id, {
346
346
  unitId: t,
347
347
  drawings: n
348
348
  });
349
349
  }
350
350
  _isInsertInHeaderFooter() {
351
351
  var n;
352
- const { unitId: i } = this._context, e = (n = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : n.with(ne).getViewModel(), t = e == null ? void 0 : e.getEditArea();
352
+ const { unitId: i } = this._context, e = (n = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : n.with(te).getViewModel(), t = e == null ? void 0 : e.getEditArea();
353
353
  return t === We.HEADER || t === We.FOOTER;
354
354
  }
355
355
  _getImagePosition(i, e) {
@@ -366,7 +366,7 @@ let st = class extends Ue {
366
366
  posOffset: n.left
367
367
  },
368
368
  positionV: {
369
- relativeFrom: j.PARAGRAPH,
369
+ relativeFrom: W.PARAGRAPH,
370
370
  posOffset: 0
371
371
  },
372
372
  angle: 0
@@ -412,12 +412,12 @@ let st = class extends Ue {
412
412
  var r;
413
413
  const { transformer: e, docsLeft: t, docsTop: n } = (r = this._getCurrentSceneAndTransformer()) != null ? r : {};
414
414
  if (i == null || i.length === 0)
415
- this._contextService.setContextValue(rt, !1), this._docDrawingService.focusDrawing([]), e && e.resetProps({
415
+ this._contextService.setContextValue(it, !1), this._docDrawingService.focusDrawing([]), e && e.resetProps({
416
416
  zeroTop: 0,
417
417
  zeroLeft: 0
418
418
  });
419
419
  else {
420
- this._contextService.setContextValue(rt, !0), this._docDrawingService.focusDrawing(i), this._setDrawingSelections(i);
420
+ this._contextService.setContextValue(it, !0), this._docDrawingService.focusDrawing(i), this._setDrawingSelections(i);
421
421
  const s = this._docSelectionRenderService.getSegment(), o = this._findSegmentIdByDrawingId(i[0].drawingId);
422
422
  s !== o && this._docSelectionRenderService.setSegment(o), e && e.resetProps({
423
423
  zeroTop: n,
@@ -443,7 +443,7 @@ let st = class extends Ue {
443
443
  // Update drawings edit status and opacity. You can not edit header footer images when you are editing body. and vice verse.
444
444
  _updateDrawingsEditStatus() {
445
445
  var c;
446
- const { unit: i, scene: e, unitId: t } = this._context, n = (c = this._renderManagerSrv.getRenderById(t)) == null ? void 0 : c.with(ne).getViewModel();
446
+ const { unit: i, scene: e, unitId: t } = this._context, n = (c = this._renderManagerSrv.getRenderById(t)) == null ? void 0 : c.with(te).getViewModel();
447
447
  if (n == null || i == null)
448
448
  return;
449
449
  const r = i.getSnapshot(), { drawings: s = {} } = r, o = n.getEditArea() === We.BODY;
@@ -456,7 +456,7 @@ let st = class extends Ue {
456
456
  u.setOpacity(0.5);
457
457
  } catch {
458
458
  }
459
- if (o && a.isMultiTransform !== oe.TRUE || !o && a.isMultiTransform === oe.TRUE) {
459
+ if (o && a.isMultiTransform !== se.TRUE || !o && a.isMultiTransform === se.TRUE) {
460
460
  a.allowTransform !== !1 && e.attachTransformerTo(u);
461
461
  try {
462
462
  u.setOpacity(1);
@@ -468,7 +468,7 @@ let st = class extends Ue {
468
468
  }
469
469
  _editAreaChangeListener() {
470
470
  var t;
471
- const { unitId: i } = this._context, e = (t = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : t.with(ne).getViewModel();
471
+ const { unitId: i } = this._context, e = (t = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : t.with(te).getViewModel();
472
472
  e != null && (this._updateDrawingsEditStatus(), this.disposeWithMe(
473
473
  e.editAreaChange$.subscribe(() => {
474
474
  this._updateDrawingsEditStatus();
@@ -494,30 +494,30 @@ let st = class extends Ue {
494
494
  this._docSelectionManagerService.replaceDocRanges(n);
495
495
  }
496
496
  };
497
- st = Qi([
498
- ge(1, G),
499
- ge(2, Z(Ot)),
500
- ge(3, Q),
501
- ge(4, ii),
502
- ge(5, Be),
503
- ge(6, ve),
504
- ge(7, Qt),
505
- ge(8, _i),
506
- ge(9, Z(ft)),
507
- ge(10, Z(xe)),
508
- ge(11, Z(ht)),
509
- ge(12, Si)
510
- ], st);
497
+ rt = Qi([
498
+ ue(1, j),
499
+ ue(2, Z(yt)),
500
+ ue(3, Q),
501
+ ue(4, ii),
502
+ ue(5, Ue),
503
+ ue(6, me),
504
+ ue(7, Qt),
505
+ ue(8, _i),
506
+ ue(9, Z(gt)),
507
+ ue(10, Z(xe)),
508
+ ue(11, Z(ft)),
509
+ ue(12, Si)
510
+ ], rt);
511
511
  const Sn = {
512
512
  id: "doc.command.insert-float-image",
513
513
  type: q.COMMAND,
514
514
  handler: (i) => {
515
515
  var n, r;
516
516
  const e = i.get(z), t = i.get(Q);
517
- return (r = (n = mi(Ie.UNIVER_DOC, e, t)) == null ? void 0 : n.with(st).insertDocImage()) != null ? r : !1;
517
+ return (r = (n = mi(we.UNIVER_DOC, e, t)) == null ? void 0 : n.with(rt).insertDocImage()) != null ? r : !1;
518
518
  }
519
519
  };
520
- var fe = /* @__PURE__ */ ((i) => (i.INLINE = "inline", i.BEHIND_TEXT = "behindText", i.IN_FRONT_OF_TEXT = "inFrontOfText", i.WRAP_SQUARE = "wrapSquare", i.WRAP_TOP_AND_BOTTOM = "wrapTopAndBottom", i))(fe || {});
520
+ var ge = /* @__PURE__ */ ((i) => (i.INLINE = "inline", i.BEHIND_TEXT = "behindText", i.IN_FRONT_OF_TEXT = "inFrontOfText", i.WRAP_SQUARE = "wrapSquare", i.WRAP_TOP_AND_BOTTOM = "wrapTopAndBottom", i))(ge || {});
521
521
  const Ji = {
522
522
  inline: k.INLINE,
523
523
  wrapSquare: k.WRAP_SQUARE,
@@ -530,7 +530,7 @@ function Dn(i, e, t, n, r, s, o) {
530
530
  const c = new Dt(), d = $.getInstance(), a = [], l = s.getSelfOrHeaderFooterModel(e).getBody(), g = s.getSelfOrHeaderFooterModel(i).getBody();
531
531
  if (l == null || g == null)
532
532
  return;
533
- const u = (f = (h = l.customBlocks) == null ? void 0 : h.find((p) => p.blockId === r)) == null ? void 0 : f.startIndex;
533
+ const u = (f = (h = l.customBlocks) == null ? void 0 : h.find((v) => v.blockId === r)) == null ? void 0 : f.startIndex;
534
534
  if (u != null) {
535
535
  if (n = Math.min(g.dataStream.length - 2, n), i === e) {
536
536
  if (n < u ? (n > 0 && c.push({
@@ -572,8 +572,8 @@ function Dn(i, e, t, n, r, s, o) {
572
572
  },
573
573
  len: 1
574
574
  })), n !== u) {
575
- const p = Ke(s, e), v = d.editOp(c.serialize(), p);
576
- a.push(v);
575
+ const v = qe(s, e), p = d.editOp(c.serialize(), v);
576
+ a.push(p);
577
577
  }
578
578
  } else {
579
579
  u > 0 && c.push({
@@ -583,8 +583,8 @@ function Dn(i, e, t, n, r, s, o) {
583
583
  t: Y.DELETE,
584
584
  len: 1
585
585
  });
586
- let p = Ke(s, e), v = d.editOp(c.serialize(), p);
587
- a.push(v), c.empty(), n > 0 && c.push({
586
+ let v = qe(s, e), p = d.editOp(c.serialize(), v);
587
+ a.push(p), c.empty(), n > 0 && c.push({
588
588
  t: Y.RETAIN,
589
589
  len: n
590
590
  }), c.push({
@@ -597,12 +597,12 @@ function Dn(i, e, t, n, r, s, o) {
597
597
  }]
598
598
  },
599
599
  len: 1
600
- }), p = Ke(s, i), v = d.editOp(c.serialize(), p), a.push(v), o.setSegment(i), o.setSegmentPage(t);
600
+ }), v = qe(s, i), p = d.editOp(c.serialize(), v), a.push(p), o.setSegment(i), o.setSegmentPage(t);
601
601
  }
602
602
  return a;
603
603
  }
604
604
  }
605
- const yn = {
605
+ const On = {
606
606
  id: "doc.command.update-doc-drawing-wrapping-style",
607
607
  type: q.COMMAND,
608
608
  // eslint-disable-next-line max-lines-per-function, complexity
@@ -610,41 +610,41 @@ const yn = {
610
610
  var E, U;
611
611
  if (e == null)
612
612
  return !1;
613
- const { drawings: t, wrappingStyle: n, unitId: r } = e, s = i.get(G), o = i.get(z), d = i.get(Q).getRenderById(r), a = d == null ? void 0 : d.with(ne).getSkeleton().getSkeletonData(), l = d == null ? void 0 : d.with(ne).getViewModel(), g = d == null ? void 0 : d.scene, u = o.getCurrentUniverDocInstance();
613
+ const { drawings: t, wrappingStyle: n, unitId: r } = e, s = i.get(j), o = i.get(z), d = i.get(Q).getRenderById(r), a = d == null ? void 0 : d.with(te).getSkeleton().getSkeletonData(), l = d == null ? void 0 : d.with(te).getViewModel(), g = d == null ? void 0 : d.scene, u = o.getCurrentUniverDocInstance();
614
614
  if (u == null || a == null || g == null || l == null)
615
615
  return !1;
616
- const h = l.getEditArea(), f = g.getTransformerByCreate(), { pages: p, skeHeaders: v, skeFooters: w } = a, y = $.getInstance(), D = [], { drawings: O = {} } = u.getSnapshot();
616
+ const h = l.getEditArea(), f = g.getTransformerByCreate(), { pages: v, skeHeaders: p, skeFooters: w } = a, O = $.getInstance(), D = [], { drawings: y = {} } = u.getSnapshot();
617
617
  for (const N of t) {
618
- const { drawingId: I } = N, P = O[I].layoutType, W = Ji[n];
619
- if (P !== W) {
620
- const S = y.replaceOp(["drawings", I, "layoutType"], P, W);
618
+ const { drawingId: I } = N, P = y[I].layoutType, H = Ji[n];
619
+ if (P !== H) {
620
+ const S = O.replaceOp(["drawings", I, "layoutType"], P, H);
621
621
  D.push(S);
622
622
  }
623
623
  if (n === "behindText" || n === "inFrontOfText") {
624
- const S = O[I].behindDoc, x = n === "behindText" ? oe.TRUE : oe.FALSE;
625
- if (S !== x) {
626
- const T = y.replaceOp(["drawings", I, "behindDoc"], S, x);
624
+ const S = y[I].behindDoc, C = n === "behindText" ? se.TRUE : se.FALSE;
625
+ if (S !== C) {
626
+ const T = O.replaceOp(["drawings", I, "behindDoc"], S, C);
627
627
  D.push(T);
628
628
  }
629
629
  }
630
630
  if (n === "inline")
631
631
  continue;
632
- let A = null, H = 0, _ = 0;
633
- for (const S of p) {
634
- const { headerId: x, footerId: T, marginTop: L, marginLeft: B, marginBottom: b, pageWidth: R, pageHeight: V } = S;
632
+ let A = null, G = 0, _ = 0;
633
+ for (const S of v) {
634
+ const { headerId: C, footerId: T, marginTop: L, marginLeft: B, marginBottom: b, pageWidth: R, pageHeight: V } = S;
635
635
  switch (h) {
636
636
  case We.HEADER: {
637
- const F = (E = v.get(x)) == null ? void 0 : E.get(R);
638
- F != null && F.skeDrawings.has(I) && (A = F.skeDrawings.get(I), H = F.marginTop, _ = B);
637
+ const F = (E = p.get(C)) == null ? void 0 : E.get(R);
638
+ F != null && F.skeDrawings.has(I) && (A = F.skeDrawings.get(I), G = F.marginTop, _ = B);
639
639
  break;
640
640
  }
641
641
  case We.FOOTER: {
642
642
  const F = (U = w.get(T)) == null ? void 0 : U.get(R);
643
- F != null && F.skeDrawings.has(I) && (A = F.skeDrawings.get(I), H = V - b + F.marginTop, _ = B);
643
+ F != null && F.skeDrawings.has(I) && (A = F.skeDrawings.get(I), G = V - b + F.marginTop, _ = B);
644
644
  break;
645
645
  }
646
646
  case We.BODY: {
647
- S.skeDrawings.has(I) && (A = S.skeDrawings.get(I), H = L, _ = B);
647
+ S.skeDrawings.has(I) && (A = S.skeDrawings.get(I), G = L, _ = B);
648
648
  break;
649
649
  }
650
650
  }
@@ -652,31 +652,31 @@ const yn = {
652
652
  break;
653
653
  }
654
654
  if (A != null) {
655
- const { aTop: S, aLeft: x } = A, T = O[I].docTransform.positionH;
656
- let L = x;
655
+ const { aTop: S, aLeft: C } = A, T = y[I].docTransform.positionH;
656
+ let L = C;
657
657
  T.relativeFrom === J.MARGIN ? L -= _ : T.relativeFrom === J.COLUMN && (L -= A.columnLeft);
658
658
  const B = {
659
659
  relativeFrom: T.relativeFrom,
660
660
  posOffset: L
661
661
  };
662
662
  if (T.posOffset !== B.posOffset) {
663
- const F = y.replaceOp(["drawings", I, "docTransform", "positionH"], T, B);
663
+ const F = O.replaceOp(["drawings", I, "docTransform", "positionH"], T, B);
664
664
  D.push(F);
665
665
  }
666
- const b = O[I].docTransform.positionV;
666
+ const b = y[I].docTransform.positionV;
667
667
  let R = S;
668
- b.relativeFrom === j.PAGE ? R += H : b.relativeFrom === j.LINE ? R -= A.lineTop : b.relativeFrom === j.PARAGRAPH && (R -= A.blockAnchorTop);
668
+ b.relativeFrom === W.PAGE ? R += G : b.relativeFrom === W.LINE ? R -= A.lineTop : b.relativeFrom === W.PARAGRAPH && (R -= A.blockAnchorTop);
669
669
  const V = {
670
670
  relativeFrom: b.relativeFrom,
671
671
  posOffset: R
672
672
  };
673
673
  if (b.posOffset !== V.posOffset) {
674
- const F = y.replaceOp(["drawings", I, "docTransform", "positionV"], b, V);
674
+ const F = O.replaceOp(["drawings", I, "docTransform", "positionV"], b, V);
675
675
  D.push(F);
676
676
  }
677
677
  }
678
678
  }
679
- const C = {
679
+ const x = {
680
680
  id: ee.id,
681
681
  params: {
682
682
  unitId: r,
@@ -684,27 +684,27 @@ const yn = {
684
684
  textRanges: null
685
685
  }
686
686
  };
687
- C.params.actions = D.reduce((N, I) => $.compose(N, I), null);
688
- const M = s.syncExecuteCommand(C.id, C.params);
687
+ x.params.actions = D.reduce((N, I) => $.compose(N, I), null);
688
+ const M = s.syncExecuteCommand(x.id, x.params);
689
689
  return f.refreshControls(), !!M;
690
690
  }
691
- }, On = {
691
+ }, yn = {
692
692
  id: "doc.command.update-doc-drawing-distance",
693
693
  type: q.COMMAND,
694
694
  handler: (i, e) => {
695
695
  if (e == null)
696
696
  return !1;
697
- const t = i.get(G), r = i.get(z).getCurrentUniverDocInstance();
697
+ const t = i.get(j), r = i.get(z).getCurrentUniverDocInstance();
698
698
  if (r == null)
699
699
  return !1;
700
700
  const { drawings: s, dist: o, unitId: c } = e, d = $.getInstance(), a = [], { drawings: l = {} } = r.getSnapshot();
701
701
  for (const h of s) {
702
702
  const { drawingId: f } = h;
703
- for (const [p, v] of Object.entries(o)) {
704
- const w = l[f][p];
705
- if (w !== v) {
706
- const y = d.replaceOp(["drawings", f, p], w, v);
707
- a.push(y);
703
+ for (const [v, p] of Object.entries(o)) {
704
+ const w = l[f][v];
705
+ if (w !== p) {
706
+ const O = d.replaceOp(["drawings", f, v], w, p);
707
+ a.push(O);
708
708
  }
709
709
  }
710
710
  }
@@ -724,15 +724,15 @@ const yn = {
724
724
  handler: (i, e) => {
725
725
  if (e == null)
726
726
  return !1;
727
- const t = i.get(G), r = i.get(z).getCurrentUniverDocInstance();
727
+ const t = i.get(j), r = i.get(z).getCurrentUniverDocInstance();
728
728
  if (r == null)
729
729
  return !1;
730
730
  const { drawings: s, wrapText: o, unitId: c } = e, d = $.getInstance(), a = [], { drawings: l = {} } = r.getSnapshot();
731
731
  for (const h of s) {
732
- const { drawingId: f } = h, p = l[f].wrapText;
733
- if (p !== o) {
734
- const v = d.replaceOp(["drawings", f, "wrapText"], p, o);
735
- a.push(v);
732
+ const { drawingId: f } = h, v = l[f].wrapText;
733
+ if (v !== o) {
734
+ const p = d.replaceOp(["drawings", f, "wrapText"], v, o);
735
+ a.push(p);
736
736
  }
737
737
  }
738
738
  const g = {
@@ -745,24 +745,24 @@ const yn = {
745
745
  };
746
746
  return g.params.actions = a.reduce((h, f) => $.compose(h, f), null), !!t.syncExecuteCommand(g.id, g.params);
747
747
  }
748
- }, Ye = {
748
+ }, Ke = {
749
749
  id: "doc.command.update-drawing-doc-transform",
750
750
  type: q.COMMAND,
751
751
  handler: (i, e) => {
752
752
  if (e == null)
753
753
  return !1;
754
- const t = i.get(G), n = i.get(z), s = i.get(Q).getRenderById(e.unitId), o = s == null ? void 0 : s.scene;
754
+ const t = i.get(j), n = i.get(z), s = i.get(Q).getRenderById(e.unitId), o = s == null ? void 0 : s.scene;
755
755
  if (o == null)
756
756
  return !1;
757
757
  const c = o.getTransformerByCreate(), d = n.getCurrentUniverDocInstance();
758
758
  if (d == null)
759
759
  return !1;
760
760
  const { drawings: a, unitId: l } = e, g = $.getInstance(), u = [], { drawings: h = {} } = d.getSnapshot();
761
- for (const v of a) {
762
- const { drawingId: w, key: y, value: D } = v, O = h[w].docTransform[y];
763
- if (!Ce.diffValue(O, D)) {
764
- const C = g.replaceOp(["drawings", w, "docTransform", y], O, D);
765
- u.push(C);
761
+ for (const p of a) {
762
+ const { drawingId: w, key: O, value: D } = p, y = h[w].docTransform[O];
763
+ if (!be.diffValue(y, D)) {
764
+ const x = g.replaceOp(["drawings", w, "docTransform", O], y, D);
765
+ u.push(x);
766
766
  }
767
767
  }
768
768
  const f = {
@@ -774,9 +774,9 @@ const yn = {
774
774
  debounce: !0
775
775
  }
776
776
  };
777
- f.params.actions = u.reduce((v, w) => $.compose(v, w), null);
778
- const p = t.syncExecuteCommand(f.id, f.params);
779
- return c.refreshControls(), !!p;
777
+ f.params.actions = u.reduce((p, w) => $.compose(p, w), null);
778
+ const v = t.syncExecuteCommand(f.id, f.params);
779
+ return c.refreshControls(), !!v;
780
780
  }
781
781
  }, Mn = {
782
782
  id: "doc.command.move-inline-drawing",
@@ -785,27 +785,27 @@ const yn = {
785
785
  var U, N;
786
786
  if (e == null)
787
787
  return !1;
788
- const t = i.get(Q), n = (U = t.getRenderById(e.unitId)) == null ? void 0 : U.with(xe), r = i.get(ht), s = t.getRenderById(e.unitId), o = s == null ? void 0 : s.scene, c = s == null ? void 0 : s.with(ne).getSkeleton();
788
+ const t = i.get(Q), n = (U = t.getRenderById(e.unitId)) == null ? void 0 : U.with(xe), r = i.get(ft), s = t.getRenderById(e.unitId), o = s == null ? void 0 : s.scene, c = s == null ? void 0 : s.with(te).getSkeleton();
789
789
  if (o == null || n == null)
790
790
  return !1;
791
- const d = o.getTransformerByCreate(), a = i.get(G), g = i.get(z).getCurrentUniverDocInstance();
791
+ const d = o.getTransformerByCreate(), a = i.get(j), g = i.get(z).getCurrentUniverDocInstance();
792
792
  if (g == null)
793
793
  return !1;
794
- const { drawing: u, unitId: h, offset: f, segmentId: p, segmentPage: v, needRefreshDrawings: w } = e;
794
+ const { drawing: u, unitId: h, offset: f, segmentId: v, segmentPage: p, needRefreshDrawings: w } = e;
795
795
  if (w)
796
796
  return r.refreshDrawings(c), d.refreshControls(), !0;
797
- const y = [], { drawingId: D } = u, O = (N = n.getSegment()) != null ? N : "", C = Dn(
798
- p,
799
- O,
797
+ const O = [], { drawingId: D } = u, y = (N = n.getSegment()) != null ? N : "", x = Dn(
800
798
  v,
799
+ y,
800
+ p,
801
801
  f,
802
802
  D,
803
803
  g,
804
804
  n
805
805
  );
806
- if (C == null || C.length === 0)
806
+ if (x == null || x.length === 0)
807
807
  return r.refreshDrawings(c), d.refreshControls(), !1;
808
- y.push(...C);
808
+ O.push(...x);
809
809
  const M = {
810
810
  id: ee.id,
811
811
  params: {
@@ -814,7 +814,7 @@ const yn = {
814
814
  textRanges: null
815
815
  }
816
816
  };
817
- M.params.actions = y.reduce((I, P) => $.compose(I, P), null);
817
+ M.params.actions = O.reduce((I, P) => $.compose(I, P), null);
818
818
  const E = a.syncExecuteCommand(M.id, M.params);
819
819
  return d.refreshControls(), !!E;
820
820
  }
@@ -823,19 +823,19 @@ const yn = {
823
823
  type: q.COMMAND,
824
824
  // eslint-disable-next-line max-lines-per-function
825
825
  handler: (i, e) => {
826
- var A, H;
826
+ var A, G;
827
827
  if (e == null)
828
828
  return !1;
829
829
  const t = i.get(Q), n = (A = t.getRenderById(e.unitId)) == null ? void 0 : A.with(xe), r = t.getRenderById(e.unitId), s = r == null ? void 0 : r.scene;
830
830
  if (s == null || n == null)
831
831
  return !1;
832
- const o = s.getTransformerByCreate(), c = i.get(G), a = i.get(z).getCurrentUniverDocInstance();
832
+ const o = s.getTransformerByCreate(), c = i.get(j), a = i.get(z).getCurrentUniverDocInstance();
833
833
  if (a == null)
834
834
  return !1;
835
- const { drawing: l, unitId: g, offset: u, docTransform: h, segmentId: f, segmentPage: p } = e, v = [], { drawingId: w } = l, y = (H = n.getSegment()) != null ? H : "", D = Dn(
835
+ const { drawing: l, unitId: g, offset: u, docTransform: h, segmentId: f, segmentPage: v } = e, p = [], { drawingId: w } = l, O = (G = n.getSegment()) != null ? G : "", D = Dn(
836
836
  f,
837
- y,
838
- p,
837
+ O,
838
+ v,
839
839
  u,
840
840
  w,
841
841
  a,
@@ -843,23 +843,23 @@ const yn = {
843
843
  );
844
844
  if (D == null)
845
845
  return !1;
846
- D.length > 0 && v.push(...D);
847
- const O = $.getInstance(), { drawings: C = {} } = a.getSnapshot(), M = C[w].docTransform, { positionH: E, positionV: U, size: N, angle: I } = M;
848
- if (!Ce.diffValue(E, h.positionH)) {
849
- const _ = O.replaceOp(["drawings", w, "docTransform", "positionH"], E, h.positionH);
850
- v.push(_);
846
+ D.length > 0 && p.push(...D);
847
+ const y = $.getInstance(), { drawings: x = {} } = a.getSnapshot(), M = x[w].docTransform, { positionH: E, positionV: U, size: N, angle: I } = M;
848
+ if (!be.diffValue(E, h.positionH)) {
849
+ const _ = y.replaceOp(["drawings", w, "docTransform", "positionH"], E, h.positionH);
850
+ p.push(_);
851
851
  }
852
- if (!Ce.diffValue(U, h.positionV)) {
853
- const _ = O.replaceOp(["drawings", w, "docTransform", "positionV"], U, h.positionV);
854
- v.push(_);
852
+ if (!be.diffValue(U, h.positionV)) {
853
+ const _ = y.replaceOp(["drawings", w, "docTransform", "positionV"], U, h.positionV);
854
+ p.push(_);
855
855
  }
856
- if (!Ce.diffValue(N, h.size)) {
857
- const _ = O.replaceOp(["drawings", w, "docTransform", "size"], N, h.size);
858
- v.push(_);
856
+ if (!be.diffValue(N, h.size)) {
857
+ const _ = y.replaceOp(["drawings", w, "docTransform", "size"], N, h.size);
858
+ p.push(_);
859
859
  }
860
- if (!Ce.diffValue(I, h.angle)) {
861
- const _ = O.replaceOp(["drawings", w, "docTransform", "angle"], I, h.angle);
862
- v.push(_);
860
+ if (!be.diffValue(I, h.angle)) {
861
+ const _ = y.replaceOp(["drawings", w, "docTransform", "angle"], I, h.angle);
862
+ p.push(_);
863
863
  }
864
864
  const P = {
865
865
  id: ee.id,
@@ -870,35 +870,35 @@ const yn = {
870
870
  debounce: !0
871
871
  }
872
872
  };
873
- P.params.actions = v.reduce((_, S) => $.compose(_, S), null);
874
- const W = c.syncExecuteCommand(P.id, P.params);
875
- return o.refreshControls(), !!W;
873
+ P.params.actions = p.reduce((_, S) => $.compose(_, S), null);
874
+ const H = c.syncExecuteCommand(P.id, P.params);
875
+ return o.refreshControls(), !!H;
876
876
  }
877
- }, Ze = {
877
+ }, Ye = {
878
878
  id: "doc.command.move-drawing",
879
879
  type: q.COMMAND,
880
880
  handler: (i, e) => {
881
- const t = i.get(G), n = i.get(Be), r = i.get(z), s = i.get(Q), { direction: o } = e, c = n.getFocusDrawings();
881
+ const t = i.get(j), n = i.get(Ue), r = i.get(z), s = i.get(Q), { direction: o } = e, c = n.getFocusDrawings();
882
882
  if (c.length === 0)
883
883
  return !1;
884
884
  const d = c[0].unitId, a = s.getRenderById(d), l = a == null ? void 0 : a.scene;
885
885
  if (l == null)
886
886
  return !1;
887
- const g = l.getTransformerByCreate(), u = r.getUniverDocInstance(d), h = c.map((p) => {
887
+ const g = l.getTransformerByCreate(), u = r.getUniverDocInstance(d), h = c.map((v) => {
888
888
  var M, E, U, N, I;
889
- const { drawingId: v } = p, w = (M = u == null ? void 0 : u.getSnapshot().drawings) == null ? void 0 : M[v];
889
+ const { drawingId: p } = v, w = (M = u == null ? void 0 : u.getSnapshot().drawings) == null ? void 0 : M[p];
890
890
  if (w == null || w.layoutType === k.INLINE)
891
891
  return null;
892
- const { positionH: y, positionV: D } = w.docTransform, O = { ...y }, C = { ...D };
893
- return o === he.UP ? C.posOffset = ((E = C.posOffset) != null ? E : 0) - 2 : o === he.DOWN ? C.posOffset = ((U = C.posOffset) != null ? U : 0) + 2 : o === he.LEFT ? O.posOffset = ((N = O.posOffset) != null ? N : 0) - 2 : o === he.RIGHT && (O.posOffset = ((I = O.posOffset) != null ? I : 0) + 2), {
894
- drawingId: v,
895
- key: o === he.UP || o === he.DOWN ? "positionV" : "positionH",
896
- value: o === he.UP || o === he.DOWN ? C : O
892
+ const { positionH: O, positionV: D } = w.docTransform, y = { ...O }, x = { ...D };
893
+ return o === fe.UP ? x.posOffset = ((E = x.posOffset) != null ? E : 0) - 2 : o === fe.DOWN ? x.posOffset = ((U = x.posOffset) != null ? U : 0) + 2 : o === fe.LEFT ? y.posOffset = ((N = y.posOffset) != null ? N : 0) - 2 : o === fe.RIGHT && (y.posOffset = ((I = y.posOffset) != null ? I : 0) + 2), {
894
+ drawingId: p,
895
+ key: o === fe.UP || o === fe.DOWN ? "positionV" : "positionH",
896
+ value: o === fe.UP || o === fe.DOWN ? x : y
897
897
  };
898
- }).filter((p) => p != null);
898
+ }).filter((v) => v != null);
899
899
  if (h.length === 0)
900
900
  return !1;
901
- const f = t.syncExecuteCommand(Ye.id, {
901
+ const f = t.syncExecuteCommand(Ke.id, {
902
902
  unitId: d,
903
903
  subUnitId: d,
904
904
  drawings: h
@@ -915,16 +915,16 @@ const yn = {
915
915
  (s = (r = t.getRenderById(n)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
916
916
  }), !0;
917
917
  }
918
- }, Cn = "COMPONENT_DOC_DRAWING_PANEL", xn = {
918
+ }, xn = "COMPONENT_DOC_DRAWING_PANEL", Cn = {
919
919
  id: "sidebar.operation.doc-image",
920
920
  type: q.COMMAND,
921
921
  handler: async (i, e) => {
922
- const t = i.get(Di), n = i.get(ft), r = i.get(ve);
922
+ const t = i.get(Di), n = i.get(gt), r = i.get(me);
923
923
  switch (e.value) {
924
924
  case "open":
925
925
  t.open({
926
926
  header: { title: n.t("docImage.panel.title") },
927
- children: { label: Cn },
927
+ children: { label: xn },
928
928
  onClose: () => {
929
929
  r.focusDrawing(null);
930
930
  },
@@ -942,11 +942,11 @@ const yn = {
942
942
  id: "doc.operation.edit-doc-image",
943
943
  type: q.OPERATION,
944
944
  handler: (i, e) => {
945
- const t = i.get(ve), n = i.get(G);
946
- return e == null ? !1 : (t.focusDrawing([e]), n.executeCommand(xn.id, { value: "open" }), !0);
945
+ const t = i.get(me), n = i.get(j);
946
+ return e == null ? !1 : (t.focusDrawing([e]), n.executeCommand(Cn.id, { value: "open" }), !0);
947
947
  }
948
948
  }, qt = -1e3, Kt = 1e3, tr = (i) => {
949
- const e = we(G), t = we(ft), n = we(ve), r = we(Q), s = we(z), { drawings: o } = i, c = o[0];
949
+ const e = ve(j), t = ve(gt), n = ve(me), r = ve(Q), s = ve(z), { drawings: o } = i, c = o[0];
950
950
  if (c == null)
951
951
  return;
952
952
  const { unitId: d } = c, a = s.getUniverDocInstance(d), l = a == null ? void 0 : a.getSnapshot().documentStyle.documentFlavor, g = r.getRenderById(d), u = g == null ? void 0 : g.scene;
@@ -961,31 +961,31 @@ const yn = {
961
961
  }, {
962
962
  label: t.t("image-position.margin"),
963
963
  value: String(J.MARGIN)
964
- }], p = [{
964
+ }], v = [{
965
965
  label: t.t("image-position.line"),
966
- value: String(j.LINE),
966
+ value: String(W.LINE),
967
967
  disabled: l === pt.MODERN
968
968
  }, {
969
969
  label: t.t("image-position.page"),
970
- value: String(j.PAGE),
970
+ value: String(W.PAGE),
971
971
  disabled: l === pt.MODERN
972
972
  }, {
973
973
  label: t.t("image-position.margin"),
974
- value: String(j.MARGIN),
974
+ value: String(W.MARGIN),
975
975
  disabled: l === pt.MODERN
976
976
  }, {
977
977
  label: t.t("image-position.paragraph"),
978
- value: String(j.PARAGRAPH)
979
- }], [v, w] = se(!0), [y, D] = se({
978
+ value: String(W.PARAGRAPH)
979
+ }], [p, w] = re(!0), [O, D] = re({
980
980
  relativeFrom: J.PAGE,
981
981
  posOffset: 0
982
- }), [O, C] = se({
983
- relativeFrom: j.PAGE,
982
+ }), [y, x] = re({
983
+ relativeFrom: W.PAGE,
984
984
  posOffset: 0
985
- }), [M, E] = se(!0), [U, N] = se(!0);
986
- function I(S, x) {
985
+ }), [M, E] = re(!0), [U, N] = re(!0);
986
+ function I(S, C) {
987
987
  var b;
988
- S === "positionH" ? D(x) : C(x);
988
+ S === "positionH" ? D(C) : x(C);
989
989
  const T = n.getFocusDrawings();
990
990
  if (T.length === 0)
991
991
  return;
@@ -994,173 +994,165 @@ const yn = {
994
994
  subUnitId: R.subUnitId,
995
995
  drawingId: R.drawingId
996
996
  }));
997
- e.executeCommand(Ye.id, {
997
+ e.executeCommand(Ke.id, {
998
998
  unitId: T[0].unitId,
999
999
  subUnitId: T[0].unitId,
1000
1000
  drawings: L.map((R) => ({
1001
1001
  drawingId: R.drawingId,
1002
1002
  key: S,
1003
- value: x
1003
+ value: C
1004
1004
  }))
1005
1005
  });
1006
1006
  const B = (b = r.getRenderById(d)) == null ? void 0 : b.with(xe);
1007
1007
  B && B.blur(), h.refreshControls();
1008
1008
  }
1009
1009
  function P(S) {
1010
- var re, Se, De;
1011
- const x = y.relativeFrom, T = y.posOffset, L = Number(S);
1012
- if (x === L)
1010
+ var ie, _e, Se;
1011
+ const C = O.relativeFrom, T = O.posOffset, L = Number(S);
1012
+ if (C === L)
1013
1013
  return;
1014
1014
  const B = n.getFocusDrawings();
1015
1015
  if (B.length === 0)
1016
1016
  return;
1017
1017
  const b = B[0].drawingId, R = B[0].unitId;
1018
1018
  let V = null, F = 0;
1019
- const K = (re = r.getRenderById(R)) == null ? void 0 : re.with(ne).getSkeleton(), ae = K == null ? void 0 : K.getSkeletonData();
1020
- if (ae == null)
1019
+ const K = (ie = r.getRenderById(R)) == null ? void 0 : ie.with(te).getSkeleton(), oe = K == null ? void 0 : K.getSkeletonData();
1020
+ if (oe == null)
1021
1021
  return;
1022
- const { pages: Fe, skeHeaders: Ne, skeFooters: Ge } = ae;
1023
- for (const de of Fe) {
1024
- const { marginLeft: Oe, skeDrawings: Te, headerId: Ee, footerId: Re, pageWidth: Me } = de;
1025
- if (Te.has(b)) {
1026
- V = Te.get(b), F = Oe;
1022
+ const { pages: Be, skeHeaders: Ce, skeFooters: Ge } = oe;
1023
+ for (const ce of Be) {
1024
+ const { marginLeft: Oe, skeDrawings: ye, headerId: Ne, footerId: Ee, pageWidth: Te } = ce;
1025
+ if (ye.has(b)) {
1026
+ V = ye.get(b), F = Oe;
1027
1027
  break;
1028
1028
  }
1029
- const le = (Se = Ne.get(Ee)) == null ? void 0 : Se.get(Me);
1030
- if (le != null && le.skeDrawings.has(b)) {
1031
- V = le == null ? void 0 : le.skeDrawings.get(b), F = Oe;
1029
+ const de = (_e = Ce.get(Ne)) == null ? void 0 : _e.get(Te);
1030
+ if (de != null && de.skeDrawings.has(b)) {
1031
+ V = de == null ? void 0 : de.skeDrawings.get(b), F = Oe;
1032
1032
  break;
1033
1033
  }
1034
- const ue = (De = Ge.get(Re)) == null ? void 0 : De.get(Me);
1035
- if (ue != null && ue.skeDrawings.has(b)) {
1036
- V = ue == null ? void 0 : ue.skeDrawings.get(b), F = Oe;
1034
+ const le = (Se = Ge.get(Ee)) == null ? void 0 : Se.get(Te);
1035
+ if (le != null && le.skeDrawings.has(b)) {
1036
+ V = le == null ? void 0 : le.skeDrawings.get(b), F = Oe;
1037
1037
  break;
1038
1038
  }
1039
1039
  }
1040
1040
  if (V == null)
1041
1041
  return;
1042
- let ce = 0;
1043
- x === J.COLUMN ? ce -= V.columnLeft : x === J.MARGIN && (ce -= F), L === J.COLUMN ? ce += V.columnLeft : L === J.MARGIN ? ce += F : J.PAGE;
1044
- const ie = {
1042
+ let ae = 0;
1043
+ C === J.COLUMN ? ae -= V.columnLeft : C === J.MARGIN && (ae -= F), L === J.COLUMN ? ae += V.columnLeft : L === J.MARGIN ? ae += F : J.PAGE;
1044
+ const ne = {
1045
1045
  relativeFrom: L,
1046
- posOffset: (T != null ? T : 0) - ce
1046
+ posOffset: (T != null ? T : 0) - ae
1047
1047
  };
1048
- I("positionH", ie);
1048
+ I("positionH", ne);
1049
1049
  }
1050
- function W(S) {
1051
- var Te, Ee, Re, Me, le, ue;
1052
- const x = O.relativeFrom, T = O.posOffset, L = Number(S);
1053
- if (x === L)
1050
+ function H(S) {
1051
+ var ye, Ne, Ee, Te, de, le;
1052
+ const C = y.relativeFrom, T = y.posOffset, L = Number(S);
1053
+ if (C === L)
1054
1054
  return;
1055
1055
  const B = n.getFocusDrawings();
1056
1056
  if (B.length === 0)
1057
1057
  return;
1058
- const { drawingId: b, unitId: R } = B[0], V = s.getUniverDocInstance(R), F = (Te = r.getRenderById(R)) == null ? void 0 : Te.with(ne).getSkeleton(), K = (Ee = r.getRenderById(R)) == null ? void 0 : Ee.with(xe), ae = K == null ? void 0 : K.getSegment(), Fe = K == null ? void 0 : K.getSegmentPage(), Ne = (Me = (Re = V == null ? void 0 : V.getSelfOrHeaderFooterModel(ae).getBody()) == null ? void 0 : Re.customBlocks) == null ? void 0 : Me.find((Ae) => Ae.blockId === b);
1059
- if (Ne == null || F == null || K == null)
1058
+ const { drawingId: b, unitId: R } = B[0], V = s.getUniverDocInstance(R), F = (ye = r.getRenderById(R)) == null ? void 0 : ye.with(te).getSkeleton(), K = (Ne = r.getRenderById(R)) == null ? void 0 : Ne.with(xe), oe = K == null ? void 0 : K.getSegment(), Be = K == null ? void 0 : K.getSegmentPage(), Ce = (Te = (Ee = V == null ? void 0 : V.getSelfOrHeaderFooterModel(oe).getBody()) == null ? void 0 : Ee.customBlocks) == null ? void 0 : Te.find((Re) => Re.blockId === b);
1059
+ if (Ce == null || F == null || K == null)
1060
1060
  return;
1061
- const { startIndex: Ge } = Ne, ce = F.findNodeByCharIndex(Ge, ae, Fe), ie = (le = ce == null ? void 0 : ce.parent) == null ? void 0 : le.parent, re = ie == null ? void 0 : ie.parent, Se = re == null ? void 0 : re.lines.find((Ae) => Ae.paragraphIndex === (ie == null ? void 0 : ie.paragraphIndex) && Ae.paragraphStart), De = (ue = re == null ? void 0 : re.parent) == null ? void 0 : ue.parent;
1062
- if (ce == null || ie == null || Se == null || re == null || De == null)
1061
+ const { startIndex: Ge } = Ce, ae = F.findNodeByCharIndex(Ge, oe, Be), ne = (de = ae == null ? void 0 : ae.parent) == null ? void 0 : de.parent, ie = ne == null ? void 0 : ne.parent, _e = ie == null ? void 0 : ie.lines.find((Re) => Re.paragraphIndex === (ne == null ? void 0 : ne.paragraphIndex) && Re.paragraphStart), Se = (le = ie == null ? void 0 : ie.parent) == null ? void 0 : le.parent;
1062
+ if (ae == null || ne == null || _e == null || ie == null || Se == null)
1063
1063
  return;
1064
- let de = 0;
1065
- x === j.PARAGRAPH ? de -= Se.top : x === j.LINE ? de -= ie.top : x === j.PAGE && (de += De.marginTop), L === j.PARAGRAPH ? de += Se.top : L === j.LINE ? de += ie.top : L === j.PAGE && (de -= De.marginTop);
1064
+ let ce = 0;
1065
+ C === W.PARAGRAPH ? ce -= _e.top : C === W.LINE ? ce -= ne.top : C === W.PAGE && (ce += Se.marginTop), L === W.PARAGRAPH ? ce += _e.top : L === W.LINE ? ce += ne.top : L === W.PAGE && (ce -= Se.marginTop);
1066
1066
  const Oe = {
1067
1067
  relativeFrom: L,
1068
- posOffset: (T != null ? T : 0) - de
1068
+ posOffset: (T != null ? T : 0) - ce
1069
1069
  };
1070
1070
  I("positionV", Oe);
1071
1071
  }
1072
1072
  function A(S) {
1073
1073
  var R;
1074
- const x = a == null ? void 0 : a.getSnapshot(), T = (R = x == null ? void 0 : x.drawings) == null ? void 0 : R[S.drawingId];
1074
+ const C = a == null ? void 0 : a.getSnapshot(), T = (R = C == null ? void 0 : C.drawings) == null ? void 0 : R[S.drawingId];
1075
1075
  if (T == null)
1076
1076
  return;
1077
1077
  const { layoutType: L } = T, {
1078
1078
  positionH: B,
1079
1079
  positionV: b
1080
1080
  } = T.docTransform;
1081
- D(B), C(b), w(L === k.INLINE), E(b.relativeFrom === j.PARAGRAPH || b.relativeFrom === j.LINE);
1081
+ D(B), x(b), w(L === k.INLINE), E(b.relativeFrom === W.PARAGRAPH || b.relativeFrom === W.LINE);
1082
1082
  }
1083
- function H() {
1083
+ function G() {
1084
1084
  const S = n.getFocusDrawings();
1085
1085
  S.length !== 0 && A(S[0]);
1086
1086
  }
1087
1087
  function _(S) {
1088
- E(S), W(String(S ? j.PARAGRAPH : j.PAGE));
1088
+ E(S), H(String(S ? W.PARAGRAPH : W.PAGE));
1089
1089
  }
1090
1090
  return Mt(() => {
1091
- H();
1091
+ G();
1092
1092
  const S = n.focus$.subscribe((T) => {
1093
1093
  if (T.length === 0) {
1094
1094
  N(!1);
1095
1095
  return;
1096
1096
  }
1097
1097
  N(!0), A(T[0]);
1098
- }), x = e.onCommandExecuted(async (T) => {
1099
- T.id === ee.id && H();
1098
+ }), C = e.onCommandExecuted(async (T) => {
1099
+ T.id === ee.id && G();
1100
1100
  });
1101
1101
  return () => {
1102
- S.unsubscribe(), x.dispose();
1102
+ S.unsubscribe(), C.dispose();
1103
1103
  };
1104
1104
  }, []), /* @__PURE__ */ X(
1105
1105
  "div",
1106
1106
  {
1107
- className: te("univer-relative univer-mt-5 univer-w-full", ln),
1108
- style: { display: U ? "block" : "none" },
1107
+ className: _t("univer-relative univer-mt-5 univer-w-full", ln, {
1108
+ "univer-hidden": !U
1109
+ }),
1109
1110
  children: [
1111
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1 univer-text-gray-400", children: /* @__PURE__ */ m("div", { children: t.t("image-position.title") }) }) }),
1110
1112
  /* @__PURE__ */ m(
1111
1113
  "div",
1112
1114
  {
1113
- className: `
1114
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1115
- `,
1116
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1 univer-text-gray-400", children: /* @__PURE__ */ m("div", { children: t.t("image-position.title") }) })
1117
- }
1118
- ),
1119
- /* @__PURE__ */ m(
1120
- "div",
1121
- {
1122
- className: `
1123
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1124
- `,
1125
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1 univer-text-gray-900", children: /* @__PURE__ */ m("div", { children: t.t("image-position.horizontal") }) })
1115
+ className: "univer-relative univer-mt-2.5 univer-flex univer-h-full",
1116
+ children: /* @__PURE__ */ m(
1117
+ "div",
1118
+ {
1119
+ className: `
1120
+ univer-flex univer-items-center univer-gap-1 univer-text-gray-900
1121
+ dark:univer-text-white
1122
+ `,
1123
+ children: /* @__PURE__ */ m("div", { children: t.t("image-position.horizontal") })
1124
+ }
1125
+ )
1126
1126
  }
1127
1127
  ),
1128
1128
  /* @__PURE__ */ X(
1129
1129
  "div",
1130
1130
  {
1131
- className: `
1132
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1133
- `,
1131
+ className: "univer-relative univer-mt-2.5 univer-flex univer-h-full",
1134
1132
  children: [
1135
1133
  /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1 univer-text-gray-400", children: /* @__PURE__ */ X("label", { children: [
1136
1134
  /* @__PURE__ */ m(
1137
1135
  "div",
1138
1136
  {
1139
- className: `
1140
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1141
- univer-justify-start
1142
- `,
1137
+ className: "univer-relative univer-mt-2.5 univer-flex univer-h-full",
1143
1138
  children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: t.t("image-position.absolutePosition") })
1144
1139
  }
1145
1140
  ),
1146
1141
  /* @__PURE__ */ m(
1147
1142
  "div",
1148
1143
  {
1149
- className: `
1150
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1151
- univer-justify-start
1152
- `,
1144
+ className: "univer-relative univer-mt-2.5 univer-flex univer-h-full",
1153
1145
  children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(
1154
- je,
1146
+ ke,
1155
1147
  {
1156
1148
  min: qt,
1157
1149
  max: Kt,
1158
1150
  precision: 1,
1159
- disabled: v,
1160
- value: y.posOffset,
1151
+ disabled: p,
1152
+ value: O.posOffset,
1161
1153
  onChange: (S) => {
1162
1154
  I("positionH", {
1163
- relativeFrom: y.relativeFrom,
1155
+ relativeFrom: O.relativeFrom,
1164
1156
  posOffset: S
1165
1157
  });
1166
1158
  }
@@ -1170,28 +1162,16 @@ const yn = {
1170
1162
  )
1171
1163
  ] }) }),
1172
1164
  /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ X("label", { children: [
1165
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: t.t("image-position.toTheRightOf") }) }),
1173
1166
  /* @__PURE__ */ m(
1174
1167
  "div",
1175
1168
  {
1176
- className: `
1177
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1178
- univer-justify-start
1179
- `,
1180
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: t.t("image-position.toTheRightOf") })
1181
- }
1182
- ),
1183
- /* @__PURE__ */ m(
1184
- "div",
1185
- {
1186
- className: `
1187
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1188
- univer-justify-start
1189
- `,
1169
+ className: "univer-relative univer-mt-2.5 univer-flex univer-h-full",
1190
1170
  children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(
1191
- Ht,
1171
+ Gt,
1192
1172
  {
1193
- value: String(y.relativeFrom),
1194
- disabled: v,
1173
+ value: String(O.relativeFrom),
1174
+ disabled: p,
1195
1175
  options: f,
1196
1176
  onChange: P
1197
1177
  }
@@ -1202,150 +1182,117 @@ const yn = {
1202
1182
  ]
1203
1183
  }
1204
1184
  ),
1205
- /* @__PURE__ */ m(
1185
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m(
1206
1186
  "div",
1207
1187
  {
1208
1188
  className: `
1209
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1210
- `,
1211
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1 univer-text-gray-900", children: /* @__PURE__ */ m("div", { children: t.t("image-position.vertical") }) })
1189
+ univer-flex univer-items-center univer-gap-1 univer-text-gray-900
1190
+ dark:univer-text-white
1191
+ `,
1192
+ children: /* @__PURE__ */ m("div", { children: t.t("image-position.vertical") })
1212
1193
  }
1213
- ),
1214
- /* @__PURE__ */ X(
1215
- "div",
1216
- {
1217
- className: `
1218
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1219
- `,
1220
- children: [
1221
- /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ X("label", { children: [
1222
- /* @__PURE__ */ m(
1223
- "div",
1194
+ ) }),
1195
+ /* @__PURE__ */ X("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: [
1196
+ /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ X("label", { children: [
1197
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: t.t("image-position.absolutePosition") }) }),
1198
+ /* @__PURE__ */ m(
1199
+ "div",
1200
+ {
1201
+ className: "univer-relative univer-mt-2.5 univer-flex univer-h-full",
1202
+ children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(
1203
+ ke,
1224
1204
  {
1225
- className: `
1226
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1227
- univer-justify-start
1228
- `,
1229
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: t.t("image-position.absolutePosition") })
1205
+ min: qt,
1206
+ max: Kt,
1207
+ precision: 1,
1208
+ disabled: p,
1209
+ value: y.posOffset,
1210
+ onChange: (S) => {
1211
+ I("positionV", {
1212
+ relativeFrom: y.relativeFrom,
1213
+ posOffset: S
1214
+ });
1215
+ }
1230
1216
  }
1231
- ),
1232
- /* @__PURE__ */ m(
1233
- "div",
1234
- {
1235
- className: `
1236
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1237
- univer-justify-start
1238
- `,
1239
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(
1240
- je,
1241
- {
1242
- min: qt,
1243
- max: Kt,
1244
- precision: 1,
1245
- disabled: v,
1246
- value: O.posOffset,
1247
- onChange: (S) => {
1248
- I("positionV", {
1249
- relativeFrom: O.relativeFrom,
1250
- posOffset: S
1251
- });
1252
- }
1253
- }
1254
- ) })
1255
- }
1256
- )
1257
- ] }) }),
1258
- /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ X("label", { children: [
1259
- /* @__PURE__ */ m(
1260
- "div",
1261
- {
1262
- className: `
1263
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1264
- univer-justify-start
1265
- `,
1266
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: t.t("image-position.bellow") })
1267
- }
1268
- ),
1269
- /* @__PURE__ */ m(
1270
- "div",
1217
+ ) })
1218
+ }
1219
+ )
1220
+ ] }) }),
1221
+ /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ X("label", { children: [
1222
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: t.t("image-position.bellow") }) }),
1223
+ /* @__PURE__ */ m(
1224
+ "div",
1225
+ {
1226
+ className: "univer-relative univer-mt-2.5 univer-flex univer-h-full",
1227
+ children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(
1228
+ Gt,
1271
1229
  {
1272
- className: `
1273
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1274
- univer-justify-start
1275
- `,
1276
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(
1277
- Ht,
1278
- {
1279
- disabled: v,
1280
- value: String(O.relativeFrom),
1281
- options: p,
1282
- onChange: W
1283
- }
1284
- ) })
1230
+ disabled: p,
1231
+ value: String(y.relativeFrom),
1232
+ options: v,
1233
+ onChange: H
1285
1234
  }
1286
- )
1287
- ] }) })
1288
- ]
1289
- }
1290
- ),
1291
- /* @__PURE__ */ m(
1235
+ ) })
1236
+ }
1237
+ )
1238
+ ] }) })
1239
+ ] }),
1240
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m(
1292
1241
  "div",
1293
1242
  {
1294
1243
  className: `
1295
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1296
- `,
1297
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1 univer-text-gray-900", children: /* @__PURE__ */ m("div", { children: t.t("image-position.options") }) })
1244
+ univer-flex univer-items-center univer-gap-1 univer-text-gray-900
1245
+ dark:univer-text-white
1246
+ `,
1247
+ children: /* @__PURE__ */ m("div", { children: t.t("image-position.options") })
1298
1248
  }
1299
- ),
1249
+ ) }),
1300
1250
  /* @__PURE__ */ m(
1301
1251
  "div",
1302
1252
  {
1303
- className: `
1304
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1305
- `,
1306
- style: { marginBottom: "50px" },
1307
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(Bi, { disabled: v, checked: M, onChange: _, children: t.t("image-position.moveObjectWithText") }) })
1253
+ className: "univer-relative univer-mb-12 univer-mt-2.5 univer-flex univer-h-full",
1254
+ children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(Bi, { disabled: p, checked: M, onChange: _, children: t.t("image-position.moveObjectWithText") }) })
1308
1255
  }
1309
1256
  )
1310
1257
  ]
1311
1258
  }
1312
1259
  );
1313
- }, et = 0, tt = 100, nr = (i) => {
1314
- const e = we(G), t = we(ft), n = we(ve), r = we(Q), s = we(z), { drawings: o } = i, c = o[0];
1260
+ }, Je = 0, et = 100, nr = (i) => {
1261
+ const e = ve(j), t = ve(gt), n = ve(me), r = ve(Q), s = ve(z), { drawings: o } = i, c = o[0];
1315
1262
  if (c == null)
1316
1263
  return null;
1317
1264
  const { unitId: d } = c, a = s.getUniverDocInstance(d), l = r.getRenderById(d);
1318
1265
  if ((l == null ? void 0 : l.scene) == null)
1319
1266
  return null;
1320
- const [u, h] = se(!0), [f, p] = se(!0), [v, w] = se(!0), [y, D] = se(fe.INLINE), [O, C] = se(""), [M, E] = se({
1267
+ const [u, h] = re(!0), [f, v] = re(!0), [p, w] = re(!0), [O, D] = re(ge.INLINE), [y, x] = re(""), [M, E] = re({
1321
1268
  distT: 0,
1322
1269
  distL: 0,
1323
1270
  distB: 0,
1324
1271
  distR: 0
1325
- }), [U, N] = se(!0);
1272
+ }), [U, N] = re(!0);
1326
1273
  function I(_) {
1327
1274
  D(_);
1328
1275
  const S = n.getFocusDrawings();
1329
1276
  if (S.length === 0)
1330
1277
  return;
1331
- const { unitId: x, subUnitId: T } = S[0], L = S.map(({ unitId: B, subUnitId: b, drawingId: R }) => ({
1278
+ const { unitId: C, subUnitId: T } = S[0], L = S.map(({ unitId: B, subUnitId: b, drawingId: R }) => ({
1332
1279
  unitId: B,
1333
1280
  subUnitId: b,
1334
1281
  drawingId: R
1335
1282
  }));
1336
- e.executeCommand(yn.id, {
1337
- unitId: x,
1283
+ e.executeCommand(On.id, {
1284
+ unitId: C,
1338
1285
  subUnitId: T,
1339
1286
  drawings: L,
1340
1287
  wrappingStyle: _
1341
1288
  });
1342
1289
  }
1343
1290
  function P(_) {
1344
- C(_);
1291
+ x(_);
1345
1292
  const S = n.getFocusDrawings();
1346
1293
  if (S.length === 0)
1347
1294
  return;
1348
- const x = S.map((T) => ({
1295
+ const C = S.map((T) => ({
1349
1296
  unitId: T.unitId,
1350
1297
  subUnitId: T.subUnitId,
1351
1298
  drawingId: T.drawingId
@@ -1353,15 +1300,15 @@ const yn = {
1353
1300
  e.executeCommand(Tn.id, {
1354
1301
  unitId: S[0].unitId,
1355
1302
  subUnitId: S[0].unitId,
1356
- drawings: x,
1303
+ drawings: C,
1357
1304
  wrapText: _
1358
1305
  });
1359
1306
  }
1360
- function W(_, S) {
1307
+ function H(_, S) {
1361
1308
  if (_ == null)
1362
1309
  return;
1363
- const x = { ...M, [S]: _ };
1364
- E(x);
1310
+ const C = { ...M, [S]: _ };
1311
+ E(C);
1365
1312
  const T = n.getFocusDrawings();
1366
1313
  if (T.length === 0)
1367
1314
  return;
@@ -1370,7 +1317,7 @@ const yn = {
1370
1317
  subUnitId: B.subUnitId,
1371
1318
  drawingId: B.drawingId
1372
1319
  }));
1373
- e.executeCommand(On.id, {
1320
+ e.executeCommand(yn.id, {
1374
1321
  unitId: T[0].unitId,
1375
1322
  subUnitId: T[0].unitId,
1376
1323
  drawings: L,
@@ -1381,39 +1328,39 @@ const yn = {
1381
1328
  }
1382
1329
  function A() {
1383
1330
  const _ = n.getFocusDrawings();
1384
- _.length !== 0 && H(_[0]);
1331
+ _.length !== 0 && G(_[0]);
1385
1332
  }
1386
- function H(_) {
1387
- var K, ae;
1388
- const S = (ae = (K = a == null ? void 0 : a.getSnapshot()) == null ? void 0 : K.drawings) == null ? void 0 : ae[_.drawingId];
1333
+ function G(_) {
1334
+ var K, oe;
1335
+ const S = (oe = (K = a == null ? void 0 : a.getSnapshot()) == null ? void 0 : K.drawings) == null ? void 0 : oe[_.drawingId];
1389
1336
  if (S == null)
1390
1337
  return;
1391
1338
  const {
1392
- distT: x = 0,
1339
+ distT: C = 0,
1393
1340
  distL: T = 0,
1394
1341
  distB: L = 0,
1395
1342
  distR: B = 0,
1396
1343
  layoutType: b = k.INLINE,
1397
- behindDoc: R = oe.FALSE,
1398
- wrapText: V = qe.BOTH_SIDES
1344
+ behindDoc: R = se.FALSE,
1345
+ wrapText: V = Xe.BOTH_SIDES
1399
1346
  } = S;
1400
1347
  if (E({
1401
- distT: x,
1348
+ distT: C,
1402
1349
  distL: T,
1403
1350
  distB: L,
1404
1351
  distR: B
1405
- }), C(V), h(b !== k.WRAP_SQUARE), b === k.WRAP_NONE || b === k.INLINE ? p(!0) : p(!1), b === k.WRAP_NONE || b === k.INLINE || b === k.WRAP_TOP_AND_BOTTOM ? w(!0) : w(!1), b === k.WRAP_NONE)
1406
- R === oe.TRUE ? D(fe.BEHIND_TEXT) : D(fe.IN_FRONT_OF_TEXT);
1352
+ }), x(V), h(b !== k.WRAP_SQUARE), b === k.WRAP_NONE || b === k.INLINE ? v(!0) : v(!1), b === k.WRAP_NONE || b === k.INLINE || b === k.WRAP_TOP_AND_BOTTOM ? w(!0) : w(!1), b === k.WRAP_NONE)
1353
+ R === se.TRUE ? D(ge.BEHIND_TEXT) : D(ge.IN_FRONT_OF_TEXT);
1407
1354
  else
1408
1355
  switch (b) {
1409
1356
  case k.INLINE:
1410
- D(fe.INLINE);
1357
+ D(ge.INLINE);
1411
1358
  break;
1412
1359
  case k.WRAP_SQUARE:
1413
- D(fe.WRAP_SQUARE);
1360
+ D(ge.WRAP_SQUARE);
1414
1361
  break;
1415
1362
  case k.WRAP_TOP_AND_BOTTOM:
1416
- D(fe.WRAP_TOP_AND_BOTTOM);
1363
+ D(ge.WRAP_TOP_AND_BOTTOM);
1417
1364
  break;
1418
1365
  default:
1419
1366
  throw new Error(`Unsupported layout type: ${b}`);
@@ -1421,14 +1368,14 @@ const yn = {
1421
1368
  }
1422
1369
  return Mt(() => {
1423
1370
  A();
1424
- const _ = n.focus$.subscribe((x) => {
1425
- if (x.length === 0) {
1371
+ const _ = n.focus$.subscribe((C) => {
1372
+ if (C.length === 0) {
1426
1373
  N(!1);
1427
1374
  return;
1428
1375
  }
1429
- N(!0), H(x[0]);
1430
- }), S = e.onCommandExecuted(async (x) => {
1431
- x.id === ee.id && A();
1376
+ N(!0), G(C[0]);
1377
+ }), S = e.onCommandExecuted(async (C) => {
1378
+ C.id === ee.id && A();
1432
1379
  });
1433
1380
  return () => {
1434
1381
  _.unsubscribe(), S.dispose();
@@ -1436,148 +1383,110 @@ const yn = {
1436
1383
  }, []), /* @__PURE__ */ X(
1437
1384
  "div",
1438
1385
  {
1439
- className: te("univer-relative univer-mt-5 univer-w-full", ln, {
1386
+ className: _t("univer-relative univer-mt-5 univer-w-full", ln, {
1440
1387
  "univer-hidden": !U
1441
1388
  }),
1442
1389
  children: [
1443
- /* @__PURE__ */ m(
1390
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m(
1444
1391
  "div",
1445
1392
  {
1446
1393
  className: `
1447
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1448
- `,
1449
- children: /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1 univer-text-gray-600"), children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.title") }) })
1394
+ univer-flex univer-items-center univer-gap-1 univer-text-gray-600
1395
+ dark:univer-text-gray-200
1396
+ `,
1397
+ children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.title") })
1450
1398
  }
1451
- ),
1452
- /* @__PURE__ */ m(
1399
+ ) }),
1400
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m(
1453
1401
  "div",
1454
1402
  {
1455
1403
  className: `
1456
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1457
- `,
1458
- children: /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1 univer-text-gray-900"), children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.wrappingStyle") }) })
1404
+ univer-flex univer-items-center univer-gap-1 univer-text-gray-900
1405
+ dark:univer-text-white
1406
+ `,
1407
+ children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.wrappingStyle") })
1459
1408
  }
1460
- ),
1461
- /* @__PURE__ */ m(
1462
- "div",
1463
- {
1464
- className: te(`
1465
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1466
- `),
1467
- children: /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X(Gt, { value: y, onChange: I, direction: "vertical", children: [
1468
- /* @__PURE__ */ m(be, { value: fe.INLINE, children: t.t("image-text-wrap.inline") }),
1469
- /* @__PURE__ */ m(be, { value: fe.WRAP_SQUARE, children: t.t("image-text-wrap.square") }),
1470
- /* @__PURE__ */ m(be, { value: fe.WRAP_TOP_AND_BOTTOM, children: t.t("image-text-wrap.topAndBottom") }),
1471
- /* @__PURE__ */ m(be, { value: fe.BEHIND_TEXT, children: t.t("image-text-wrap.behindText") }),
1472
- /* @__PURE__ */ m(be, { value: fe.IN_FRONT_OF_TEXT, children: t.t("image-text-wrap.inFrontText") })
1473
- ] }) })
1474
- }
1475
- ),
1476
- /* @__PURE__ */ m(
1409
+ ) }),
1410
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ X(jt, { value: O, onChange: I, direction: "vertical", children: [
1411
+ /* @__PURE__ */ m(Me, { value: ge.INLINE, children: t.t("image-text-wrap.inline") }),
1412
+ /* @__PURE__ */ m(Me, { value: ge.WRAP_SQUARE, children: t.t("image-text-wrap.square") }),
1413
+ /* @__PURE__ */ m(Me, { value: ge.WRAP_TOP_AND_BOTTOM, children: t.t("image-text-wrap.topAndBottom") }),
1414
+ /* @__PURE__ */ m(Me, { value: ge.BEHIND_TEXT, children: t.t("image-text-wrap.behindText") }),
1415
+ /* @__PURE__ */ m(Me, { value: ge.IN_FRONT_OF_TEXT, children: t.t("image-text-wrap.inFrontText") })
1416
+ ] }) }) }),
1417
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m(
1477
1418
  "div",
1478
1419
  {
1479
1420
  className: `
1480
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1481
- `,
1482
- children: /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1 univer-text-gray-900"), children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.wrapText") }) })
1421
+ univer-flex univer-items-center univer-gap-1 univer-text-gray-900
1422
+ dark:univer-text-white
1423
+ `,
1424
+ children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.wrapText") })
1483
1425
  }
1484
- ),
1426
+ ) }),
1485
1427
  /* @__PURE__ */ m(
1486
1428
  "div",
1487
1429
  {
1488
- className: te(`
1489
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1490
- `),
1491
- children: /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X(Gt, { disabled: u, value: O, onChange: P, direction: "horizontal", children: [
1492
- /* @__PURE__ */ m(be, { value: qe.BOTH_SIDES, children: t.t("image-text-wrap.bothSide") }),
1493
- /* @__PURE__ */ m(be, { value: qe.LEFT, children: t.t("image-text-wrap.leftOnly") }),
1494
- /* @__PURE__ */ m(be, { value: qe.RIGHT, children: t.t("image-text-wrap.rightOnly") })
1430
+ className: "univer-relative univer-mt-2.5 univer-flex univer-h-full",
1431
+ children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ X(jt, { disabled: u, value: y, onChange: P, direction: "horizontal", children: [
1432
+ /* @__PURE__ */ m(Me, { value: Xe.BOTH_SIDES, children: t.t("image-text-wrap.bothSide") }),
1433
+ /* @__PURE__ */ m(Me, { value: Xe.LEFT, children: t.t("image-text-wrap.leftOnly") }),
1434
+ /* @__PURE__ */ m(Me, { value: Xe.RIGHT, children: t.t("image-text-wrap.rightOnly") })
1495
1435
  ] }) })
1496
1436
  }
1497
1437
  ),
1498
- /* @__PURE__ */ m(
1438
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m(
1499
1439
  "div",
1500
1440
  {
1501
1441
  className: `
1502
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1503
- `,
1504
- children: /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1 univer-text-gray-900"), children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.distanceFromText") }) })
1442
+ univer-flex univer-items-center univer-gap-1 univer-text-gray-900
1443
+ dark:univer-text-white
1444
+ `,
1445
+ children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.distanceFromText") })
1505
1446
  }
1506
- ),
1447
+ ) }),
1507
1448
  /* @__PURE__ */ X(
1508
1449
  "div",
1509
1450
  {
1510
- className: `
1511
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1512
- `,
1451
+ className: "univer-relative univer-mt-2.5 univer-flex univer-h-full",
1513
1452
  children: [
1514
- /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X("label", { children: [
1515
- /* @__PURE__ */ m(
1516
- "div",
1453
+ /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ X("label", { children: [
1454
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: t.t("image-text-wrap.top") }) }),
1455
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(
1456
+ ke,
1517
1457
  {
1518
- className: `
1519
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1520
- univer-justify-start
1521
- `,
1522
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: t.t("image-text-wrap.top") })
1458
+ min: Je,
1459
+ max: et,
1460
+ disabled: f,
1461
+ precision: 1,
1462
+ value: M.distT,
1463
+ onChange: (_) => {
1464
+ H(_, "distT");
1465
+ }
1523
1466
  }
1524
- ),
1525
- /* @__PURE__ */ m(
1526
- "div",
1527
- {
1528
- className: `
1529
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1530
- univer-justify-start
1531
- `,
1532
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(
1533
- je,
1534
- {
1535
- min: et,
1536
- max: tt,
1537
- disabled: f,
1538
- precision: 1,
1539
- value: M.distT,
1540
- onChange: (_) => {
1541
- W(_, "distT");
1542
- }
1543
- }
1544
- ) })
1545
- }
1546
- )
1467
+ ) }) })
1547
1468
  ] }) }),
1548
- /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X("label", { children: [
1469
+ /* @__PURE__ */ m("div", { className: _t("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X("label", { children: [
1549
1470
  /* @__PURE__ */ m(
1550
1471
  "div",
1551
1472
  {
1552
- className: `
1553
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1554
- univer-justify-start
1555
- `,
1473
+ className: "univer-relative univer-mt-2.5 univer-flex univer-h-full",
1556
1474
  children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: t.t("image-text-wrap.left") })
1557
1475
  }
1558
1476
  ),
1559
- /* @__PURE__ */ m(
1560
- "div",
1477
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(
1478
+ ke,
1561
1479
  {
1562
- className: `
1563
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1564
- univer-justify-start
1565
- `,
1566
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(
1567
- je,
1568
- {
1569
- min: et,
1570
- max: tt,
1571
- disabled: v,
1572
- precision: 1,
1573
- value: M.distL,
1574
- onChange: (_) => {
1575
- W(_, "distL");
1576
- }
1577
- }
1578
- ) })
1480
+ min: Je,
1481
+ max: et,
1482
+ disabled: p,
1483
+ precision: 1,
1484
+ value: M.distL,
1485
+ onChange: (_) => {
1486
+ H(_, "distL");
1487
+ }
1579
1488
  }
1580
- )
1489
+ ) }) })
1581
1490
  ] }) })
1582
1491
  ]
1583
1492
  }
@@ -1585,77 +1494,39 @@ const yn = {
1585
1494
  /* @__PURE__ */ X(
1586
1495
  "div",
1587
1496
  {
1588
- className: `
1589
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1590
- `,
1497
+ className: "univer-relative univer-mt-2.5 univer-flex univer-h-full",
1591
1498
  children: [
1592
- /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X("label", { children: [
1593
- /* @__PURE__ */ m(
1594
- "div",
1595
- {
1596
- className: `
1597
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1598
- univer-justify-start
1599
- `,
1600
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: t.t("image-text-wrap.bottom") })
1601
- }
1602
- ),
1603
- /* @__PURE__ */ m(
1604
- "div",
1499
+ /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ X("label", { children: [
1500
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: t.t("image-text-wrap.bottom") }) }),
1501
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(
1502
+ ke,
1605
1503
  {
1606
- className: `
1607
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1608
- univer-justify-start
1609
- `,
1610
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(
1611
- je,
1612
- {
1613
- min: et,
1614
- max: tt,
1615
- disabled: f,
1616
- precision: 1,
1617
- value: M.distB,
1618
- onChange: (_) => {
1619
- W(_, "distB");
1620
- }
1621
- }
1622
- ) })
1504
+ min: Je,
1505
+ max: et,
1506
+ disabled: f,
1507
+ precision: 1,
1508
+ value: M.distB,
1509
+ onChange: (_) => {
1510
+ H(_, "distB");
1511
+ }
1623
1512
  }
1624
- )
1513
+ ) }) })
1625
1514
  ] }) }),
1626
- /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X("label", { children: [
1627
- /* @__PURE__ */ m(
1628
- "div",
1515
+ /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ X("label", { children: [
1516
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: t.t("image-text-wrap.right") }) }),
1517
+ /* @__PURE__ */ m("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(
1518
+ ke,
1629
1519
  {
1630
- className: `
1631
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1632
- univer-justify-start
1633
- `,
1634
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: t.t("image-text-wrap.right") })
1520
+ min: Je,
1521
+ max: et,
1522
+ disabled: p,
1523
+ precision: 1,
1524
+ value: M.distR,
1525
+ onChange: (_) => {
1526
+ H(_, "distR");
1527
+ }
1635
1528
  }
1636
- ),
1637
- /* @__PURE__ */ m(
1638
- "div",
1639
- {
1640
- className: `
1641
- univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start
1642
- univer-justify-start
1643
- `,
1644
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(
1645
- je,
1646
- {
1647
- min: et,
1648
- max: tt,
1649
- disabled: v,
1650
- precision: 1,
1651
- value: M.distR,
1652
- onChange: (_) => {
1653
- W(_, "distR");
1654
- }
1655
- }
1656
- ) })
1657
- }
1658
- )
1529
+ ) }) })
1659
1530
  ] }) })
1660
1531
  ]
1661
1532
  }
@@ -1664,7 +1535,7 @@ const yn = {
1664
1535
  }
1665
1536
  );
1666
1537
  }, ir = () => {
1667
- const i = we(ve), e = i.getFocusDrawings(), [t, n] = se(e);
1538
+ const i = ve(me), e = i.getFocusDrawings(), [t, n] = re(e);
1668
1539
  return Mt(() => {
1669
1540
  const r = i.focus$.subscribe((s) => {
1670
1541
  n(s);
@@ -1678,8 +1549,8 @@ const yn = {
1678
1549
  /* @__PURE__ */ m(tr, { drawings: t })
1679
1550
  ] });
1680
1551
  }, En = "addition-and-subtraction-single", Rn = "doc.menu.image", An = Sn.id, rr = (i) => {
1681
- const e = i.get(Ot), t = i.get(z);
1682
- return new ji((n) => {
1552
+ const e = i.get(yt), t = i.get(z);
1553
+ return new Wi((n) => {
1683
1554
  const r = e.textSelection$.subscribe(() => {
1684
1555
  var o;
1685
1556
  const s = e.getActiveTextRange();
@@ -1708,7 +1579,7 @@ function sr(i) {
1708
1579
  icon: En,
1709
1580
  tooltip: "docImage.title",
1710
1581
  disabled$: rr(i),
1711
- hidden$: rn(i, Ie.UNIVER_DOC, void 0, yt)
1582
+ hidden$: rn(i, we.UNIVER_DOC, void 0, Ot)
1712
1583
  };
1713
1584
  }
1714
1585
  function or(i) {
@@ -1716,11 +1587,11 @@ function or(i) {
1716
1587
  id: An,
1717
1588
  title: "docImage.upload.float",
1718
1589
  type: sn.BUTTON,
1719
- hidden$: rn(i, Ie.UNIVER_DOC, void 0, yt)
1590
+ hidden$: rn(i, we.UNIVER_DOC, void 0, Ot)
1720
1591
  };
1721
1592
  }
1722
1593
  const ar = {
1723
- [yi.LAYOUT]: {
1594
+ [Oi.LAYOUT]: {
1724
1595
  [Rn]: {
1725
1596
  order: 0,
1726
1597
  menuItemFactory: sr,
@@ -1731,55 +1602,55 @@ const ar = {
1731
1602
  }
1732
1603
  }
1733
1604
  };
1734
- function Qe(i) {
1735
- return i.getContextValue(Gn) && i.getContextValue(rt);
1605
+ function Ze(i) {
1606
+ return i.getContextValue(jn) && i.getContextValue(it);
1736
1607
  }
1737
1608
  const cr = {
1738
- id: Ze.id,
1609
+ id: Ye.id,
1739
1610
  description: "shortcut.drawing-move-down",
1740
1611
  group: "4_drawing-view",
1741
1612
  binding: He.ARROW_DOWN,
1742
1613
  priority: 100,
1743
- preconditions: Qe,
1614
+ preconditions: Ze,
1744
1615
  staticParameters: {
1745
- direction: he.DOWN
1616
+ direction: fe.DOWN
1746
1617
  }
1747
1618
  }, dr = {
1748
- id: Ze.id,
1619
+ id: Ye.id,
1749
1620
  description: "shortcut.drawing-move-up",
1750
1621
  group: "4_drawing-view",
1751
1622
  binding: He.ARROW_UP,
1752
1623
  priority: 100,
1753
- preconditions: Qe,
1624
+ preconditions: Ze,
1754
1625
  staticParameters: {
1755
- direction: he.UP
1626
+ direction: fe.UP
1756
1627
  }
1757
1628
  }, lr = {
1758
- id: Ze.id,
1629
+ id: Ye.id,
1759
1630
  description: "shortcut.drawing-move-left",
1760
1631
  group: "4_drawing-view",
1761
1632
  binding: He.ARROW_LEFT,
1762
1633
  priority: 100,
1763
- preconditions: Qe,
1634
+ preconditions: Ze,
1764
1635
  staticParameters: {
1765
- direction: he.LEFT
1636
+ direction: fe.LEFT
1766
1637
  }
1767
1638
  }, ur = {
1768
- id: Ze.id,
1639
+ id: Ye.id,
1769
1640
  description: "shortcut.drawing-move-right",
1770
1641
  group: "4_drawing-view",
1771
1642
  binding: He.ARROW_RIGHT,
1772
1643
  priority: 100,
1773
- preconditions: Qe,
1644
+ preconditions: Ze,
1774
1645
  staticParameters: {
1775
- direction: he.RIGHT
1646
+ direction: fe.RIGHT
1776
1647
  }
1777
1648
  }, gr = {
1778
- id: pn.id,
1649
+ id: vn.id,
1779
1650
  description: "shortcut.drawing-delete",
1780
1651
  group: "4_drawing-view",
1781
1652
  // when focusing on any other input tag do not trigger this shortcut
1782
- preconditions: Qe,
1653
+ preconditions: Ze,
1783
1654
  binding: He.DELETE,
1784
1655
  mac: He.BACKSPACE
1785
1656
  };
@@ -1787,14 +1658,14 @@ var fr = Object.getOwnPropertyDescriptor, hr = (i, e, t, n) => {
1787
1658
  for (var r = n > 1 ? void 0 : n ? fr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1788
1659
  (o = i[s]) && (r = o(r) || r);
1789
1660
  return r;
1790
- }, nt = (i, e) => (t, n) => e(t, n, i);
1791
- let ot = class extends Ue {
1661
+ }, tt = (i, e) => (t, n) => e(t, n, i);
1662
+ let st = class extends Le {
1792
1663
  constructor(i, e, t, n) {
1793
1664
  super(), this._componentManager = i, this._menuManagerService = e, this._commandService = t, this._shortcutService = n, this._init();
1794
1665
  }
1795
1666
  _initCustomComponents() {
1796
1667
  const i = this._componentManager;
1797
- this.disposeWithMe(i.register(En, vn)), this.disposeWithMe(i.register(Cn, ir));
1668
+ this.disposeWithMe(i.register(En, pn)), this.disposeWithMe(i.register(xn, ir));
1798
1669
  }
1799
1670
  _initMenus() {
1800
1671
  this._menuManagerService.mergeMenu(ar);
@@ -1802,21 +1673,21 @@ let ot = class extends Ue {
1802
1673
  _initCommands() {
1803
1674
  [
1804
1675
  Sn,
1805
- Ct,
1806
- yn,
1676
+ xt,
1807
1677
  On,
1678
+ yn,
1808
1679
  Tn,
1809
- Ye,
1680
+ Ke,
1810
1681
  Mn,
1811
1682
  bn,
1812
1683
  bt,
1813
- xn,
1684
+ Cn,
1814
1685
  er,
1815
1686
  Nn,
1816
1687
  wn,
1817
1688
  _n,
1818
- Ze,
1819
- pn,
1689
+ Ye,
1690
+ vn,
1820
1691
  In
1821
1692
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
1822
1693
  }
@@ -1836,18 +1707,18 @@ let ot = class extends Ue {
1836
1707
  this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
1837
1708
  }
1838
1709
  };
1839
- ot = hr([
1840
- nt(0, Z(on)),
1841
- nt(1, Oi),
1842
- nt(2, G),
1843
- nt(3, Ti)
1844
- ], ot);
1845
- var mr = Object.getOwnPropertyDescriptor, vr = (i, e, t, n) => {
1710
+ st = hr([
1711
+ tt(0, Z(on)),
1712
+ tt(1, yi),
1713
+ tt(2, j),
1714
+ tt(3, Ti)
1715
+ ], st);
1716
+ var mr = Object.getOwnPropertyDescriptor, pr = (i, e, t, n) => {
1846
1717
  for (var r = n > 1 ? void 0 : n ? mr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1847
1718
  (o = i[s]) && (r = o(r) || r);
1848
1719
  return r;
1849
- }, $e = (i, e) => (t, n) => e(t, n, i);
1850
- function pr(i) {
1720
+ }, Ve = (i, e) => (t, n) => e(t, n, i);
1721
+ function vr(i) {
1851
1722
  var n, r, s, o;
1852
1723
  if ($.isNoop(i) || !Array.isArray(i))
1853
1724
  return null;
@@ -1885,7 +1756,7 @@ function wr(i) {
1885
1756
  }
1886
1757
  return e;
1887
1758
  }
1888
- let at = class extends Ue {
1759
+ let ot = class extends Le {
1889
1760
  constructor(i, e, t, n, r) {
1890
1761
  super(), this._univerInstanceService = i, this._commandService = e, this._drawingManagerService = t, this._docDrawingService = n, this._renderManagerService = r, this._initialize();
1891
1762
  }
@@ -1897,7 +1768,7 @@ let at = class extends Ue {
1897
1768
  this._commandService.beforeCommandExecuted((i) => {
1898
1769
  if (i.id !== ee.id)
1899
1770
  return;
1900
- const e = i.params, { unitId: t, actions: n } = e, r = pr(n);
1771
+ const e = i.params, { unitId: t, actions: n } = e, r = vr(n);
1901
1772
  if (r != null)
1902
1773
  for (const { type: s, drawingId: o, drawing: c } of r)
1903
1774
  s === "add" ? this._addDrawings(t, [c]) : this._removeDrawings(t, [o]);
@@ -1953,18 +1824,18 @@ let at = class extends Ue {
1953
1824
  n.orderNotification(s), r.orderNotification(s);
1954
1825
  }
1955
1826
  };
1956
- at = vr([
1957
- $e(0, z),
1958
- $e(1, G),
1959
- $e(2, ve),
1960
- $e(3, Be),
1961
- $e(4, Q)
1962
- ], at);
1827
+ ot = pr([
1828
+ Ve(0, z),
1829
+ Ve(1, j),
1830
+ Ve(2, me),
1831
+ Ve(3, Ue),
1832
+ Ve(4, Q)
1833
+ ], ot);
1963
1834
  var Ir = Object.getOwnPropertyDescriptor, _r = (i, e, t, n) => {
1964
1835
  for (var r = n > 1 ? void 0 : n ? Ir(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1965
1836
  (o = i[s]) && (r = o(r) || r);
1966
1837
  return r;
1967
- }, ke = (i, e) => (t, n) => e(t, n, i);
1838
+ }, Fe = (i, e) => (t, n) => e(t, n, i);
1968
1839
  function Pn(i, e, t = 1, n = 0) {
1969
1840
  const { top: r, left: s, bottom: o, right: c } = i, d = c - s, a = o - r, l = e.getViewport(cn.VIEW_MAIN), { viewportScrollX: g, viewportScrollY: u } = l, { scaleX: h, scaleY: f } = e.getAncestorScale();
1970
1841
  return {
@@ -1982,14 +1853,14 @@ function Pn(i, e, t = 1, n = 0) {
1982
1853
  opacity: t != null ? t : 1
1983
1854
  };
1984
1855
  }
1985
- function It(i, e) {
1856
+ function wt(i, e) {
1986
1857
  const { top: t, left: n, width: r, height: s, angle: o, opacity: c } = i;
1987
1858
  return Pn({ top: t, left: n, bottom: t + s, right: n + r }, e.scene, c, o);
1988
1859
  }
1989
- let ct = class extends Ue {
1860
+ let at = class extends Le {
1990
1861
  constructor(e, t, n, r, s, o) {
1991
1862
  super();
1992
- _e(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
1863
+ Ie(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
1993
1864
  this._renderManagerService = e, this._drawingManagerService = t, this._drawingRenderService = n, this._canvasFloatDomService = r, this._univerInstanceService = s, this._commandService = o, this._initialize();
1994
1865
  }
1995
1866
  dispose() {
@@ -2023,7 +1894,7 @@ let ct = class extends Ue {
2023
1894
  _insertRects(e) {
2024
1895
  e.forEach(async (t) => {
2025
1896
  const { unitId: n } = t;
2026
- if (!this._univerInstanceService.getUnit(n, Ie.UNIVER_DOC))
1897
+ if (!this._univerInstanceService.getUnit(n, we.UNIVER_DOC))
2027
1898
  return;
2028
1899
  const s = this._getSceneAndTransformerByDrawingSearch(n);
2029
1900
  if (s == null)
@@ -2035,7 +1906,7 @@ let ct = class extends Ue {
2035
1906
  if (!(c == null || c.length === 0))
2036
1907
  for (const d of c) {
2037
1908
  this._addHoverForRect(d);
2038
- const a = new zn(), l = It(d, s.renderUnit), g = new Tt(l), u = s.canvas, h = o.data, f = {
1909
+ const a = new zn(), l = wt(d, s.renderUnit), g = new Tt(l), u = s.canvas, h = o.data, f = {
2039
1910
  dispose: a,
2040
1911
  rect: d,
2041
1912
  position$: g,
@@ -2045,42 +1916,42 @@ let ct = class extends Ue {
2045
1916
  position$: g,
2046
1917
  id: o.drawingId,
2047
1918
  componentKey: o.componentKey,
2048
- onPointerDown: (v) => {
2049
- u.dispatchEvent(new PointerEvent(v.type, v));
1919
+ onPointerDown: (p) => {
1920
+ u.dispatchEvent(new PointerEvent(p.type, p));
2050
1921
  },
2051
- onPointerMove: (v) => {
2052
- u.dispatchEvent(new PointerEvent(v.type, v));
1922
+ onPointerMove: (p) => {
1923
+ u.dispatchEvent(new PointerEvent(p.type, p));
2053
1924
  },
2054
- onPointerUp: (v) => {
2055
- u.dispatchEvent(new PointerEvent(v.type, v));
1925
+ onPointerUp: (p) => {
1926
+ u.dispatchEvent(new PointerEvent(p.type, p));
2056
1927
  },
2057
- onWheel: (v) => {
2058
- u.dispatchEvent(new WheelEvent(v.type, v));
1928
+ onWheel: (p) => {
1929
+ u.dispatchEvent(new WheelEvent(p.type, p));
2059
1930
  },
2060
1931
  data: h,
2061
1932
  unitId: n
2062
1933
  });
2063
- const p = d.onTransformChange$.subscribeEvent(() => {
2064
- const v = It(d, s.renderUnit);
1934
+ const v = d.onTransformChange$.subscribeEvent(() => {
1935
+ const p = wt(d, s.renderUnit);
2065
1936
  g.next(
2066
- v
1937
+ p
2067
1938
  );
2068
1939
  });
2069
1940
  a.add(() => {
2070
1941
  this._canvasFloatDomService.removeFloatDom(o.drawingId);
2071
- }), p && a.add(p), this._domLayerInfoMap.set(o.drawingId, f);
1942
+ }), v && a.add(v), this._domLayerInfoMap.set(o.drawingId, f);
2072
1943
  }
2073
1944
  });
2074
1945
  }
2075
1946
  _addHoverForRect(e) {
2076
1947
  this.disposeWithMe(
2077
- ye(
1948
+ De(
2078
1949
  e.onPointerEnter$.subscribeEvent(() => {
2079
1950
  e.cursor = Ut.GRAB;
2080
1951
  })
2081
1952
  )
2082
1953
  ), this.disposeWithMe(
2083
- ye(
1954
+ De(
2084
1955
  e.onPointerLeave$.subscribeEvent(() => {
2085
1956
  e.cursor = Ut.DEFAULT;
2086
1957
  })
@@ -2101,19 +1972,19 @@ let ct = class extends Ue {
2101
1972
  const n = this._getSceneAndTransformerByDrawingSearch(t);
2102
1973
  n && this._domLayerInfoMap.forEach((r) => {
2103
1974
  if (r.unitId !== t) return;
2104
- const s = It(r.rect, n.renderUnit);
1975
+ const s = wt(r.rect, n.renderUnit);
2105
1976
  r.position$.next(s);
2106
1977
  });
2107
1978
  };
2108
1979
  this.disposeWithMe(
2109
- this._univerInstanceService.getCurrentTypeOfUnit$(Ie.UNIVER_DOC).pipe(
1980
+ this._univerInstanceService.getCurrentTypeOfUnit$(we.UNIVER_DOC).pipe(
2110
1981
  Vt((t) => {
2111
1982
  if (!t) return null;
2112
1983
  const n = t.getUnitId(), r = this._renderManagerService.getRenderById(n);
2113
1984
  return r ? { render: r, unitId: n } : null;
2114
1985
  }),
2115
- Wi(
2116
- (t) => t ? Jt(t.render.scene.getViewport(cn.VIEW_MAIN).onScrollAfter$).pipe(Vt(() => ({ unitId: t.unitId }))) : Hi(null)
1986
+ Hi(
1987
+ (t) => t ? Jt(t.render.scene.getViewport(cn.VIEW_MAIN).onScrollAfter$).pipe(Vt(() => ({ unitId: t.unitId }))) : Gi(null)
2117
1988
  )
2118
1989
  ).subscribe((t) => {
2119
1990
  if (!t) return;
@@ -2128,16 +1999,16 @@ let ct = class extends Ue {
2128
1999
  }));
2129
2000
  }
2130
2001
  insertFloatDom(e, t) {
2131
- var p, v, w;
2132
- const n = this._univerInstanceService.getCurrentUnitOfType(Ie.UNIVER_DOC);
2002
+ var v, p, w;
2003
+ const n = this._univerInstanceService.getCurrentUnitOfType(we.UNIVER_DOC);
2133
2004
  if (!n) return !1;
2134
2005
  const r = this._getSceneAndTransformerByDrawingSearch(n.getUnitId());
2135
2006
  if (!r) return !1;
2136
- const c = (p = r.renderUnit.with(ne).getSkeleton().getSkeletonData()) == null ? void 0 : p.pages[0];
2007
+ const c = (v = r.renderUnit.with(te).getSkeleton().getSkeletonData()) == null ? void 0 : v.pages[0];
2137
2008
  if (!c) return !1;
2138
2009
  const { pageWidth: d, marginLeft: a, marginRight: l } = c, g = d - a - l, u = {
2139
2010
  size: {
2140
- width: (v = t.width) != null ? v : g,
2011
+ width: (p = t.width) != null ? p : g,
2141
2012
  height: t.height
2142
2013
  },
2143
2014
  positionH: {
@@ -2145,7 +2016,7 @@ let ct = class extends Ue {
2145
2016
  posOffset: 0
2146
2017
  },
2147
2018
  positionV: {
2148
- relativeFrom: j.PAGE,
2019
+ relativeFrom: W.PAGE,
2149
2020
  posOffset: 0
2150
2021
  },
2151
2022
  angle: 0
@@ -2154,7 +2025,7 @@ let ct = class extends Ue {
2154
2025
  drawings: [
2155
2026
  {
2156
2027
  drawingId: h,
2157
- drawingType: Le.DRAWING_DOM,
2028
+ drawingType: Pe.DRAWING_DOM,
2158
2029
  subUnitId: n.getUnitId(),
2159
2030
  unitId: n.getUnitId(),
2160
2031
  ...e,
@@ -2166,17 +2037,17 @@ let ct = class extends Ue {
2166
2037
  }
2167
2038
  ]
2168
2039
  };
2169
- return this._commandService.syncExecuteCommand(Ct.id, f), h;
2040
+ return this._commandService.syncExecuteCommand(xt.id, f), h;
2170
2041
  }
2171
2042
  };
2172
- ct = _r([
2173
- ke(0, Q),
2174
- ke(1, ve),
2175
- ke(2, Z(tn)),
2176
- ke(3, Z(Mi)),
2177
- ke(4, z),
2178
- ke(5, G)
2179
- ], ct);
2043
+ at = _r([
2044
+ Fe(0, Q),
2045
+ Fe(1, me),
2046
+ Fe(2, Z(tn)),
2047
+ Fe(3, Z(Mi)),
2048
+ Fe(4, z),
2049
+ Fe(5, j)
2050
+ ], at);
2180
2051
  const Sr = (i) => {
2181
2052
  const { floatDomInfos: e, scene: t, offset: n, bound: r } = i, s = r.right - r.left, o = r.bottom - r.top, c = Vi(() => e.map((d) => {
2182
2053
  const { width: a = 0, height: l = 0, left: g = 0, top: u = 0 } = d.transform, f = Pn(
@@ -2187,7 +2058,7 @@ const Sr = (i) => {
2187
2058
  bottom: u + l
2188
2059
  },
2189
2060
  t
2190
- ), p = {
2061
+ ), v = {
2191
2062
  position$: new Tt(f),
2192
2063
  position: f,
2193
2064
  id: d.drawingId,
@@ -2203,16 +2074,16 @@ const Sr = (i) => {
2203
2074
  unitId: d.unitId,
2204
2075
  data: d.data
2205
2076
  };
2206
- return [d.drawingId, p];
2077
+ return [d.drawingId, v];
2207
2078
  }).filter(([d, a]) => !(a.position.endX < 0 || a.position.endY < 0 || a.position.startX > s || a.position.startY > o)), [e, t, n, s, o]);
2208
2079
  return /* @__PURE__ */ m("div", { style: { position: "absolute", top: 0, left: 0 }, children: c.map(([d, a]) => /* @__PURE__ */ m(bi, { layer: a, id: d, position: a.position }, d)) });
2209
2080
  };
2210
- var Dr = Object.getOwnPropertyDescriptor, yr = (i, e, t, n) => {
2081
+ var Dr = Object.getOwnPropertyDescriptor, Or = (i, e, t, n) => {
2211
2082
  for (var r = n > 1 ? void 0 : n ? Dr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2212
2083
  (o = i[s]) && (r = o(r) || r);
2213
2084
  return r;
2214
- }, ze = (i, e) => (t, n) => e(t, n, i);
2215
- let dt = class extends Ue {
2085
+ }, $e = (i, e) => (t, n) => e(t, n, i);
2086
+ let ct = class extends Le {
2216
2087
  constructor(i, e, t, n, r) {
2217
2088
  super(), this._docPrintInterceptorService = i, this._drawingRenderService = e, this._drawingManagerService = t, this._componetManager = n, this._injector = r, this._initPrinting(), this._initPrintingDom();
2218
2089
  }
@@ -2225,7 +2096,7 @@ let dt = class extends Ue {
2225
2096
  const { unitId: n, scene: r } = e, s = this._drawingManagerService.getDrawingDataForUnit(n), o = s == null ? void 0 : s[n];
2226
2097
  return o && o.order.forEach((c) => {
2227
2098
  const d = o.data[c];
2228
- d.drawingType !== Le.DRAWING_CHART && d.drawingType !== Le.DRAWING_DOM && this._drawingRenderService.renderDrawing(d, r);
2099
+ d.drawingType !== Pe.DRAWING_CHART && d.drawingType !== Pe.DRAWING_DOM && this._drawingRenderService.renderDrawing(d, r);
2229
2100
  }), t();
2230
2101
  }
2231
2102
  }
@@ -2242,12 +2113,12 @@ let dt = class extends Ue {
2242
2113
  if (s) {
2243
2114
  const o = s.order.map((d) => {
2244
2115
  const a = s.data[d];
2245
- if (a.drawingType === Le.DRAWING_CHART)
2116
+ if (a.drawingType === Pe.DRAWING_CHART)
2246
2117
  return {
2247
2118
  ...a,
2248
2119
  componentKey: this._componetManager.get(qn)
2249
2120
  };
2250
- if (a.drawingType === Le.DRAWING_DOM) {
2121
+ if (a.drawingType === Pe.DRAWING_DOM) {
2251
2122
  const l = this._docPrintInterceptorService.getPrintComponent(a.componentKey);
2252
2123
  return {
2253
2124
  ...a,
@@ -2255,7 +2126,7 @@ let dt = class extends Ue {
2255
2126
  };
2256
2127
  }
2257
2128
  return null;
2258
- }).filter(Boolean), c = Ci(Sr, this._injector);
2129
+ }).filter(Boolean), c = xi(Sr, this._injector);
2259
2130
  return Fi(
2260
2131
  /* @__PURE__ */ m(
2261
2132
  c,
@@ -2279,31 +2150,31 @@ let dt = class extends Ue {
2279
2150
  );
2280
2151
  }
2281
2152
  };
2282
- dt = yr([
2283
- ze(0, Z(Ei)),
2284
- ze(1, Z(tn)),
2285
- ze(2, ve),
2286
- ze(3, Z(on)),
2287
- ze(4, Z(en))
2288
- ], dt);
2289
- var Or = Object.getOwnPropertyDescriptor, Tr = (i, e, t, n) => {
2290
- for (var r = n > 1 ? void 0 : n ? Or(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2153
+ ct = Or([
2154
+ $e(0, Z(Ei)),
2155
+ $e(1, Z(tn)),
2156
+ $e(2, me),
2157
+ $e(3, Z(on)),
2158
+ $e(4, Z(en))
2159
+ ], ct);
2160
+ var yr = Object.getOwnPropertyDescriptor, Tr = (i, e, t, n) => {
2161
+ for (var r = n > 1 ? void 0 : n ? yr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2291
2162
  (o = i[s]) && (r = o(r) || r);
2292
2163
  return r;
2293
- }, it = (i, e) => (t, n) => e(t, n, i);
2164
+ }, nt = (i, e) => (t, n) => e(t, n, i);
2294
2165
  const Mr = "__InlineDrawingAnchor__";
2295
2166
  function Yt(i) {
2296
2167
  const { path: e } = i;
2297
2168
  return e.some((t) => t === "cells");
2298
2169
  }
2299
- let lt = class extends Ue {
2170
+ let dt = class extends Le {
2300
2171
  constructor(e, t, n, r) {
2301
2172
  super();
2302
- _e(this, "_liquid", new nn());
2303
- _e(this, "_listenerOnImageMap", /* @__PURE__ */ new Set());
2173
+ Ie(this, "_liquid", new nn());
2174
+ Ie(this, "_listenerOnImageMap", /* @__PURE__ */ new Set());
2304
2175
  // Use to cache the drawings is under transforming or scaling.
2305
- _e(this, "_transformerCache", /* @__PURE__ */ new Map());
2306
- _e(this, "_anchorShape");
2176
+ Ie(this, "_transformerCache", /* @__PURE__ */ new Map());
2177
+ Ie(this, "_anchorShape");
2307
2178
  this._commandService = e, this._univerInstanceService = t, this._drawingManagerService = n, this._renderManagerService = r, this._init();
2308
2179
  }
2309
2180
  _init() {
@@ -2328,22 +2199,22 @@ let lt = class extends Ue {
2328
2199
  if (t == null)
2329
2200
  return;
2330
2201
  this.disposeWithMe(
2331
- ye(
2202
+ De(
2332
2203
  t.changeStart$.subscribe((s) => {
2333
2204
  var c;
2334
2205
  this._transformerCache.clear();
2335
2206
  const { objects: o } = s;
2336
2207
  for (const d of o.values()) {
2337
- const { oKey: a, width: l, height: g, left: u, top: h, angle: f } = d, p = this._drawingManagerService.getDrawingOKey(a);
2338
- if (p == null)
2208
+ const { oKey: a, width: l, height: g, left: u, top: h, angle: f } = d, v = this._drawingManagerService.getDrawingOKey(a);
2209
+ if (v == null)
2339
2210
  continue;
2340
- const v = this._univerInstanceService.getUniverDocInstance(p.unitId), w = (c = v == null ? void 0 : v.getSnapshot().drawings) == null ? void 0 : c[p.drawingId];
2211
+ const p = this._univerInstanceService.getUniverDocInstance(v.unitId), w = (c = p == null ? void 0 : p.getSnapshot().drawings) == null ? void 0 : c[v.drawingId];
2341
2212
  if ((w == null ? void 0 : w.layoutType) === k.INLINE)
2342
2213
  try {
2343
2214
  d.setOpacity(0.2);
2344
2215
  } catch {
2345
2216
  }
2346
- w != null && this._transformerCache.set(p.drawingId, {
2217
+ w != null && this._transformerCache.set(v.drawingId, {
2347
2218
  drawing: w,
2348
2219
  top: h,
2349
2220
  left: u,
@@ -2357,21 +2228,21 @@ let lt = class extends Ue {
2357
2228
  );
2358
2229
  const n = Et(this._updateMultipleDrawingDocTransform.bind(this), 50);
2359
2230
  Et(this._nonInlineDrawingTransform.bind(this), 50), this.disposeWithMe(
2360
- ye(
2231
+ De(
2361
2232
  t.changing$.subscribe((s) => {
2362
2233
  const { objects: o, offsetX: c, offsetY: d } = s;
2363
2234
  if (o.size > 1)
2364
2235
  n(o);
2365
2236
  else if (o.size === 1) {
2366
- const a = this._transformerCache.values().next().value, l = o.values().next().value, { width: g, height: u, top: h, left: f, angle: p } = l;
2367
- if (a && g === a.width && u === a.height && h === a.top && f === a.left && p === a.angle)
2237
+ const a = this._transformerCache.values().next().value, l = o.values().next().value, { width: g, height: u, top: h, left: f, angle: v } = l;
2238
+ if (a && g === a.width && u === a.height && h === a.top && f === a.left && v === a.angle)
2368
2239
  return;
2369
2240
  a && (a.drawing.layoutType, k.INLINE), a && a.drawing.layoutType === k.INLINE && c != null && d != null && this._updateInlineDrawingAnchor(a.drawing, c, d);
2370
2241
  }
2371
2242
  })
2372
2243
  )
2373
2244
  ), this.disposeWithMe(
2374
- ye(
2245
+ De(
2375
2246
  // eslint-disable-next-line complexity
2376
2247
  t.changeEnd$.subscribe((s) => {
2377
2248
  const { objects: o, offsetX: c, offsetY: d } = s;
@@ -2389,10 +2260,10 @@ let lt = class extends Ue {
2389
2260
  if (this._anchorShape && this._anchorShape.hide(), o.size > 1)
2390
2261
  this._updateMultipleDrawingDocTransform(o);
2391
2262
  else if (o.size === 1) {
2392
- const a = this._transformerCache.values().next().value, l = o.values().next().value, { width: g, height: u, top: h, left: f, angle: p } = l;
2393
- if (a && g === a.width && u === a.height && h === a.top && f === a.left && p === a.angle)
2263
+ const a = this._transformerCache.values().next().value, l = o.values().next().value, { width: g, height: u, top: h, left: f, angle: v } = l;
2264
+ if (a && g === a.width && u === a.height && h === a.top && f === a.left && v === a.angle)
2394
2265
  return;
2395
- a && a.drawing.layoutType === k.INLINE ? g !== a.width || u !== a.height || p !== a.angle ? this._updateDrawingSize(a, l) : c != null && d != null && this._moveInlineDrawing(a.drawing, c, d) : a && this._nonInlineDrawingTransform(a.drawing, l);
2266
+ a && a.drawing.layoutType === k.INLINE ? g !== a.width || u !== a.height || v !== a.angle ? this._updateDrawingSize(a, l) : c != null && d != null && this._moveInlineDrawing(a.drawing, c, d) : a && this._nonInlineDrawingTransform(a.drawing, l);
2396
2267
  }
2397
2268
  this._transformerCache.clear();
2398
2269
  })
@@ -2415,8 +2286,8 @@ let lt = class extends Ue {
2415
2286
  const h = this._transformerCache.get(u.drawingId);
2416
2287
  if (h == null)
2417
2288
  continue;
2418
- const { drawing: f, top: p, left: v, width: w, height: y, angle: D } = h, { width: O, height: C } = this._getPageContentSize(f);
2419
- if (l = Math.min(l, O), g = Math.min(g, C), (w !== l || y !== g) && t.push({
2289
+ const { drawing: f, top: v, left: p, width: w, height: O, angle: D } = h, { width: y, height: x } = this._getPageContentSize(f);
2290
+ if (l = Math.min(l, y), g = Math.min(g, x), (w !== l || O !== g) && t.push({
2420
2291
  drawingId: u.drawingId,
2421
2292
  key: "size",
2422
2293
  value: {
@@ -2427,8 +2298,8 @@ let lt = class extends Ue {
2427
2298
  drawingId: u.drawingId,
2428
2299
  key: "angle",
2429
2300
  value: a
2430
- }), p !== d || v !== c) {
2431
- const M = d - p, E = c - v;
2301
+ }), v !== d || p !== c) {
2302
+ const M = d - v, E = c - p;
2432
2303
  M !== 0 && t.push({
2433
2304
  drawingId: u.drawingId,
2434
2305
  key: "positionV",
@@ -2446,7 +2317,7 @@ let lt = class extends Ue {
2446
2317
  });
2447
2318
  }
2448
2319
  }
2449
- t.length > 0 && n && r && this._commandService.executeCommand(Ye.id, {
2320
+ t.length > 0 && n && r && this._commandService.executeCommand(Ke.id, {
2450
2321
  unitId: n,
2451
2322
  subUnitId: r,
2452
2323
  drawings: t
@@ -2467,8 +2338,8 @@ let lt = class extends Ue {
2467
2338
  r != null && this._createOrUpdateInlineAnchor(e.unitId, r);
2468
2339
  }
2469
2340
  _getInlineDrawingAnchor(e, t, n) {
2470
- var A, H;
2471
- const r = this._renderManagerService.getRenderById(e.unitId), s = r == null ? void 0 : r.with(ne).getSkeleton();
2341
+ var A, G;
2342
+ const r = this._renderManagerService.getRenderById(e.unitId), s = r == null ? void 0 : r.with(te).getSkeleton();
2472
2343
  if (r == null)
2473
2344
  return;
2474
2345
  const { mainComponent: o, scene: c } = r, d = o, a = c.getViewports()[0], {
@@ -2476,83 +2347,83 @@ let lt = class extends Ue {
2476
2347
  pageMarginLeft: g,
2477
2348
  pageMarginTop: u
2478
2349
  } = d.getOffsetConfig();
2479
- let h = null, f = !1, p = -1, v = "";
2480
- const w = 0.5, y = this._getTransformCoordForDocumentOffset(d, a, t, n);
2481
- if (y == null)
2350
+ let h = null, f = !1, v = -1, p = "";
2351
+ const w = 0.5, O = this._getTransformCoordForDocumentOffset(d, a, t, n);
2352
+ if (O == null)
2482
2353
  return;
2483
2354
  const D = (A = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : A.with(xe);
2484
2355
  if (D == null)
2485
2356
  return;
2486
- const O = s == null ? void 0 : s.findNodeByCoord(y, l, g, u, {
2357
+ const y = s == null ? void 0 : s.findNodeByCoord(O, l, g, u, {
2487
2358
  strict: !1,
2488
2359
  segmentId: D.getSegment(),
2489
2360
  segmentPage: D.getSegmentPage()
2490
2361
  });
2491
- if (O) {
2492
- const { node: _, ratioX: S, segmentPage: x, segmentId: T } = O;
2493
- f = S < w, h = _, p = x, v = T;
2362
+ if (y) {
2363
+ const { node: _, ratioX: S, segmentPage: C, segmentId: T } = y;
2364
+ f = S < w, h = _, v = C, p = T;
2494
2365
  }
2495
2366
  if (h == null)
2496
2367
  return;
2497
- const C = s == null ? void 0 : s.findPositionByGlyph(h, p), M = this._getDocObject();
2498
- if (C == null || s == null || M == null || Yt(C))
2368
+ const x = s == null ? void 0 : s.findPositionByGlyph(h, v), M = this._getDocObject();
2369
+ if (x == null || s == null || M == null || Yt(x))
2499
2370
  return;
2500
2371
  const E = {
2501
- ...C,
2372
+ ...x,
2502
2373
  isBack: f
2503
- }, U = M.document.getOffsetConfig(), N = new kt(U, s), { cursorList: I, contentBoxPointGroup: P } = N.getRangePointData(E, E), { startOffset: W } = (H = jt(I)) != null ? H : {};
2504
- if (W != null)
2505
- return { offset: W, contentBoxPointGroup: P, segmentId: v, segmentPage: p };
2374
+ }, U = M.document.getOffsetConfig(), N = new kt(U, s), { cursorList: I, contentBoxPointGroup: P } = N.getRangePointData(E, E), { startOffset: H } = (G = Wt(I)) != null ? G : {};
2375
+ if (H != null)
2376
+ return { offset: H, contentBoxPointGroup: P, segmentId: p, segmentPage: v };
2506
2377
  }
2507
2378
  // eslint-disable-next-line max-lines-per-function, complexity
2508
2379
  _getDrawingAnchor(e, t) {
2509
- var Se, De, de, Oe, Te, Ee, Re, Me, le, ue, Ae;
2510
- const n = this._renderManagerService.getRenderById(e.unitId), r = n == null ? void 0 : n.with(ne).getSkeleton(), s = r == null ? void 0 : r.getSkeletonData();
2380
+ var _e, Se, ce, Oe, ye, Ne, Ee, Te, de, le, Re;
2381
+ const n = this._renderManagerService.getRenderById(e.unitId), r = n == null ? void 0 : n.with(te).getSkeleton(), s = r == null ? void 0 : r.getSkeletonData();
2511
2382
  if (s == null || n == null)
2512
2383
  return;
2513
- const { pages: o, skeHeaders: c, skeFooters: d } = s, { mainComponent: a, scene: l } = n, g = a, u = l.getViewports()[0], { pageLayoutType: h = Bt.VERTICAL, pageMarginLeft: f, pageMarginTop: p, docsLeft: v, docsTop: w } = g.getOffsetConfig(), { left: y, top: D, angle: O } = t;
2514
- let { width: C, height: M } = t;
2384
+ const { pages: o, skeHeaders: c, skeFooters: d } = s, { mainComponent: a, scene: l } = n, g = a, u = l.getViewports()[0], { pageLayoutType: h = Bt.VERTICAL, pageMarginLeft: f, pageMarginTop: v, docsLeft: p, docsTop: w } = g.getOffsetConfig(), { left: O, top: D, angle: y } = t;
2385
+ let { width: x, height: M } = t;
2515
2386
  const { positionV: E, positionH: U } = e.docTransform, { width: N, height: I } = this._getPageContentSize(e);
2516
- C = Math.min(C, N), M = Math.min(M, I);
2517
- let P = null, W = "", A = -1;
2518
- const H = !1, _ = {
2387
+ x = Math.min(x, N), M = Math.min(M, I);
2388
+ let P = null, H = "", A = -1;
2389
+ const G = !1, _ = {
2519
2390
  ...e.docTransform,
2520
2391
  size: {
2521
- width: C,
2392
+ width: x,
2522
2393
  height: M
2523
2394
  },
2524
- angle: O
2525
- }, { x: S, y: x } = l.getViewportScrollXY(u), T = this._getTransformCoordForDocumentOffset(g, u, y - S, D - x);
2395
+ angle: y
2396
+ }, { x: S, y: C } = l.getViewportScrollXY(u), T = this._getTransformCoordForDocumentOffset(g, u, O - S, D - C);
2526
2397
  if (T == null)
2527
2398
  return;
2528
- const L = (Se = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : Se.with(xe);
2399
+ const L = (_e = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : _e.with(xe);
2529
2400
  if (L == null)
2530
2401
  return;
2531
- const B = r == null ? void 0 : r.findNodeByCoord(T, h, f, p, {
2402
+ const B = r == null ? void 0 : r.findNodeByCoord(T, h, f, v, {
2532
2403
  strict: !1,
2533
2404
  segmentId: L.getSegment(),
2534
2405
  segmentPage: L.getSegmentPage()
2535
2406
  });
2536
2407
  if (B) {
2537
- const { node: pe, segmentPage: mt, segmentId: vt } = B;
2538
- P = pe, A = mt, W = vt;
2408
+ const { node: pe, segmentPage: ht, segmentId: mt } = B;
2409
+ P = pe, A = ht, H = mt;
2539
2410
  }
2540
2411
  if (P == null)
2541
2412
  return;
2542
- const b = (De = P.parent) == null ? void 0 : De.parent, R = b == null ? void 0 : b.parent, V = (de = R == null ? void 0 : R.lines.find((pe) => pe.paragraphIndex === (b == null ? void 0 : b.paragraphIndex) && pe.paragraphStart)) != null ? de : R == null ? void 0 : R.lines[0], F = (Oe = R == null ? void 0 : R.parent) == null ? void 0 : Oe.parent;
2413
+ const b = (Se = P.parent) == null ? void 0 : Se.parent, R = b == null ? void 0 : b.parent, V = (ce = R == null ? void 0 : R.lines.find((pe) => pe.paragraphIndex === (b == null ? void 0 : b.paragraphIndex) && pe.paragraphStart)) != null ? ce : R == null ? void 0 : R.lines[0], F = (Oe = R == null ? void 0 : R.parent) == null ? void 0 : Oe.parent;
2543
2414
  if (b == null || R == null || V == null || F == null)
2544
2415
  return;
2545
2416
  this._liquid.reset();
2546
2417
  const K = F.type;
2547
2418
  for (const pe of o) {
2548
- const { headerId: mt, footerId: vt, pageHeight: Un, pageWidth: xt, marginLeft: Nt, marginBottom: Bn } = pe, Fn = o.indexOf(pe);
2419
+ const { headerId: ht, footerId: mt, pageHeight: Un, pageWidth: Ct, marginLeft: Nt, marginBottom: Bn } = pe, Fn = o.indexOf(pe);
2549
2420
  if (A > -1 && Fn === A) {
2550
2421
  switch (K) {
2551
2422
  case Ft.HEADER: {
2552
- const Ve = (Te = c.get(mt)) == null ? void 0 : Te.get(xt);
2553
- if (Ve)
2423
+ const je = (ye = c.get(ht)) == null ? void 0 : ye.get(Ct);
2424
+ if (je)
2554
2425
  this._liquid.translatePagePadding({
2555
- marginTop: Ve.marginTop,
2426
+ marginTop: je.marginTop,
2556
2427
  marginLeft: Nt
2557
2428
  });
2558
2429
  else
@@ -2560,10 +2431,10 @@ let lt = class extends Ue {
2560
2431
  break;
2561
2432
  }
2562
2433
  case Ft.FOOTER: {
2563
- const Ve = (Ee = d.get(vt)) == null ? void 0 : Ee.get(xt);
2564
- if (Ve)
2434
+ const je = (Ne = d.get(mt)) == null ? void 0 : Ne.get(Ct);
2435
+ if (je)
2565
2436
  this._liquid.translatePagePadding({
2566
- marginTop: Un - Bn + Ve.marginTop,
2437
+ marginTop: Un - Bn + je.marginTop,
2567
2438
  marginLeft: Nt
2568
2439
  });
2569
2440
  else
@@ -2575,18 +2446,18 @@ let lt = class extends Ue {
2575
2446
  }
2576
2447
  if (this._liquid.translatePagePadding(pe), pe === F)
2577
2448
  break;
2578
- this._liquid.restorePagePadding(pe), this._liquid.translatePage(pe, h, f, p);
2449
+ this._liquid.restorePagePadding(pe), this._liquid.translatePage(pe, h, f, v);
2579
2450
  }
2580
- switch (E.relativeFrom === j.LINE ? P = b.divides[0].glyphGroup[0] : P = (ue = (le = (Me = (Re = V.divides) == null ? void 0 : Re[0]) == null ? void 0 : Me.glyphGroup) == null ? void 0 : le[0]) != null ? ue : P, _.positionH = {
2451
+ switch (E.relativeFrom === W.LINE ? P = b.divides[0].glyphGroup[0] : P = (le = (de = (Te = (Ee = V.divides) == null ? void 0 : Ee[0]) == null ? void 0 : Te.glyphGroup) == null ? void 0 : de[0]) != null ? le : P, _.positionH = {
2581
2452
  relativeFrom: U.relativeFrom,
2582
- posOffset: y - this._liquid.x - v
2453
+ posOffset: O - this._liquid.x - p
2583
2454
  }, U.relativeFrom) {
2584
2455
  case J.MARGIN: {
2585
- _.positionH.posOffset = y - this._liquid.x - v - F.marginLeft;
2456
+ _.positionH.posOffset = O - this._liquid.x - p - F.marginLeft;
2586
2457
  break;
2587
2458
  }
2588
2459
  case J.COLUMN: {
2589
- _.positionH.posOffset = y - this._liquid.x - v - R.left;
2460
+ _.positionH.posOffset = O - this._liquid.x - p - R.left;
2590
2461
  break;
2591
2462
  }
2592
2463
  }
@@ -2594,30 +2465,30 @@ let lt = class extends Ue {
2594
2465
  relativeFrom: E.relativeFrom,
2595
2466
  posOffset: D - this._liquid.y - w
2596
2467
  }, E.relativeFrom) {
2597
- case j.PAGE: {
2468
+ case W.PAGE: {
2598
2469
  _.positionV.posOffset = D - this._liquid.y - w - F.marginTop;
2599
2470
  break;
2600
2471
  }
2601
- case j.LINE: {
2472
+ case W.LINE: {
2602
2473
  _.positionV.posOffset = D - this._liquid.y - w - b.top;
2603
2474
  break;
2604
2475
  }
2605
- case j.PARAGRAPH: {
2476
+ case W.PARAGRAPH: {
2606
2477
  _.positionV.posOffset = D - this._liquid.y - w - V.top;
2607
2478
  break;
2608
2479
  }
2609
2480
  }
2610
2481
  if (P == null)
2611
2482
  return;
2612
- const ae = r == null ? void 0 : r.findPositionByGlyph(P, A), Fe = this._getDocObject();
2613
- if (ae == null || r == null || Fe == null || Yt(ae))
2483
+ const oe = r == null ? void 0 : r.findPositionByGlyph(P, A), Be = this._getDocObject();
2484
+ if (oe == null || r == null || Be == null || Yt(oe))
2614
2485
  return;
2615
- const Ne = {
2616
- ...ae,
2617
- isBack: H
2618
- }, Ge = Fe.document.getOffsetConfig(), ce = new kt(Ge, r), { cursorList: ie } = ce.getRangePointData(Ne, Ne), { startOffset: re } = (Ae = jt(ie)) != null ? Ae : {};
2619
- if (re != null)
2620
- return { offset: re, docTransform: _, segmentId: W, segmentPage: A };
2486
+ const Ce = {
2487
+ ...oe,
2488
+ isBack: G
2489
+ }, Ge = Be.document.getOffsetConfig(), ae = new kt(Ge, r), { cursorList: ne } = ae.getRangePointData(Ce, Ce), { startOffset: ie } = (Re = Wt(ne)) != null ? Re : {};
2490
+ if (ie != null)
2491
+ return { offset: ie, docTransform: _, segmentId: H, segmentPage: A };
2621
2492
  }
2622
2493
  // Update drawing when use transformer to resize it.
2623
2494
  _updateDrawingSize(e, t) {
@@ -2635,7 +2506,7 @@ let lt = class extends Ue {
2635
2506
  drawingId: r.drawingId,
2636
2507
  key: "angle",
2637
2508
  value: u
2638
- }), n.length > 0 && d && a && this._commandService.executeCommand(Ye.id, {
2509
+ }), n.length > 0 && d && a && this._commandService.executeCommand(Ke.id, {
2639
2510
  unitId: d,
2640
2511
  subUnitId: a,
2641
2512
  drawings: n
@@ -2657,7 +2528,7 @@ let lt = class extends Ue {
2657
2528
  // Limit the drawing to the page area, mainly in the vertical direction,
2658
2529
  // and the upper and lower limits cannot exceed the page margin area.
2659
2530
  _limitDrawingInPage(e, t) {
2660
- const n = this._renderManagerService.getRenderById(e.unitId), { left: r, top: s, width: o, height: c, angle: d } = t, a = n == null ? void 0 : n.with(ne).getSkeleton(), l = a == null ? void 0 : a.getSkeletonData(), { pages: g } = l != null ? l : {};
2531
+ const n = this._renderManagerService.getRenderById(e.unitId), { left: r, top: s, width: o, height: c, angle: d } = t, a = n == null ? void 0 : n.with(te).getSkeleton(), l = a == null ? void 0 : a.getSkeletonData(), { pages: g } = l != null ? l : {};
2661
2532
  if (l == null || n == null || g == null)
2662
2533
  return {
2663
2534
  left: r,
@@ -2666,34 +2537,34 @@ let lt = class extends Ue {
2666
2537
  height: c,
2667
2538
  angle: d
2668
2539
  };
2669
- const { mainComponent: u } = n, h = u, { top: f, pageLayoutType: p, pageMarginLeft: v, pageMarginTop: w } = h;
2670
- let y = s;
2540
+ const { mainComponent: u } = n, h = u, { top: f, pageLayoutType: v, pageMarginLeft: p, pageMarginTop: w } = h;
2541
+ let O = s;
2671
2542
  this._liquid.reset();
2672
2543
  for (const D of g) {
2673
- const { marginBottom: O, pageHeight: C } = D, M = g.indexOf(D), E = g[M + 1];
2544
+ const { marginBottom: y, pageHeight: x } = D, M = g.indexOf(D), E = g[M + 1];
2674
2545
  if (E == null)
2675
2546
  continue;
2676
- if (Ce.hasIntersectionBetweenTwoRanges(
2547
+ if (be.hasIntersectionBetweenTwoRanges(
2677
2548
  s,
2678
2549
  s + c,
2679
- this._liquid.y + f + C - O,
2680
- this._liquid.y + f + C + w + E.marginTop
2550
+ this._liquid.y + f + x - y,
2551
+ this._liquid.y + f + x + w + E.marginTop
2681
2552
  )) {
2682
- const N = s + c / 2, I = this._liquid.y + f + C + w / 2;
2683
- N < I ? y = Math.min(s, this._liquid.y + f + C - O - c) : y = Math.max(s, this._liquid.y + f + C + w + E.marginTop);
2553
+ const N = s + c / 2, I = this._liquid.y + f + x + w / 2;
2554
+ N < I ? O = Math.min(s, this._liquid.y + f + x - y - c) : O = Math.max(s, this._liquid.y + f + x + w + E.marginTop);
2684
2555
  }
2685
- this._liquid.translatePage(D, p, v, w);
2556
+ this._liquid.translatePage(D, v, p, w);
2686
2557
  }
2687
2558
  return {
2688
2559
  left: r,
2689
- top: y,
2560
+ top: O,
2690
2561
  width: o,
2691
2562
  height: c,
2692
2563
  angle: d
2693
2564
  };
2694
2565
  }
2695
2566
  _nonInlineDrawingTransform(e, t, n = !1) {
2696
- const r = e.isMultiTransform === oe.TRUE ? t : this._limitDrawingInPage(e, t);
2567
+ const r = e.isMultiTransform === se.TRUE ? t : this._limitDrawingInPage(e, t);
2697
2568
  if (n && r.top !== t.top)
2698
2569
  return;
2699
2570
  const s = this._getDrawingAnchor(e, r), { offset: o, docTransform: c, segmentId: d, segmentPage: a } = s != null ? s : {};
@@ -2717,7 +2588,7 @@ let lt = class extends Ue {
2717
2588
  return { scene: n, transformer: r };
2718
2589
  }
2719
2590
  _getTransformCoordForDocumentOffset(e, t, n, r) {
2720
- const { documentTransform: s } = e.getOffsetConfig(), o = t.transformVector2SceneCoord(vi.FromArray([n, r]));
2591
+ const { documentTransform: s } = e.getOffsetConfig(), o = t.transformVector2SceneCoord(pi.FromArray([n, r]));
2721
2592
  if (o)
2722
2593
  return s.clone().invert().applyPoint(o);
2723
2594
  }
@@ -2733,7 +2604,7 @@ let lt = class extends Ue {
2733
2604
  this._anchorShape.transformByState({ left: h, top: f, height: u }), this._anchorShape.show();
2734
2605
  return;
2735
2606
  }
2736
- const p = 6, v = new pi(Mr + Ce.generateRandomId(p), {
2607
+ const v = 6, p = new vi(Mr + be.generateRandomId(v), {
2737
2608
  left: h,
2738
2609
  top: f,
2739
2610
  height: u,
@@ -2741,13 +2612,13 @@ let lt = class extends Ue {
2741
2612
  stroke: wi(Kn.darkGray, 1),
2742
2613
  evented: !1
2743
2614
  });
2744
- this._anchorShape = v, s.addObject(v, Ai);
2615
+ this._anchorShape = p, s.addObject(p, Ai);
2745
2616
  }
2746
2617
  _getDocObject() {
2747
2618
  return Pi(this._univerInstanceService, this._renderManagerService);
2748
2619
  }
2749
2620
  _getPageContentSize(e) {
2750
- const t = this._renderManagerService.getRenderById(e.unitId), n = t == null ? void 0 : t.with(ne).getSkeleton(), r = 500, s = 500, o = n == null ? void 0 : n.getSkeletonData();
2621
+ const t = this._renderManagerService.getRenderById(e.unitId), n = t == null ? void 0 : t.with(te).getSkeleton(), r = 500, s = 500, o = n == null ? void 0 : n.getSkeletonData();
2751
2622
  if (o == null || t == null)
2752
2623
  return {
2753
2624
  width: r,
@@ -2775,25 +2646,25 @@ let lt = class extends Ue {
2775
2646
  };
2776
2647
  }
2777
2648
  };
2778
- lt = Tr([
2779
- it(0, G),
2780
- it(1, z),
2781
- it(2, ve),
2782
- it(3, Q)
2783
- ], lt);
2784
- var br = Object.getOwnPropertyDescriptor, Cr = (i, e, t, n) => {
2649
+ dt = Tr([
2650
+ nt(0, j),
2651
+ nt(1, z),
2652
+ nt(2, me),
2653
+ nt(3, Q)
2654
+ ], dt);
2655
+ var br = Object.getOwnPropertyDescriptor, xr = (i, e, t, n) => {
2785
2656
  for (var r = n > 1 ? void 0 : n ? br(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2786
2657
  (o = i[s]) && (r = o(r) || r);
2787
2658
  return r;
2788
- }, Xe = (i, e) => (t, n) => e(t, n, i);
2789
- let ut = class extends Yn {
2659
+ }, ze = (i, e) => (t, n) => e(t, n, i);
2660
+ let lt = class extends Yn {
2790
2661
  constructor(e, t, n, r, s) {
2791
2662
  super();
2792
- _e(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
2663
+ Ie(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
2793
2664
  this._drawingManagerService = e, this._canvasPopManagerService = t, this._renderManagerService = n, this._univerInstanceService = r, this._contextService = s, this._init();
2794
2665
  }
2795
2666
  _init() {
2796
- this._univerInstanceService.getCurrentTypeOfUnit$(Ie.UNIVER_DOC).pipe($t(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(Ie.UNIVER_DOC).pipe($t(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(Ie.UNIVER_DOC).forEach((e) => this._create(e));
2667
+ this._univerInstanceService.getCurrentTypeOfUnit$(we.UNIVER_DOC).pipe($t(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(we.UNIVER_DOC).pipe($t(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(we.UNIVER_DOC).forEach((e) => this._create(e));
2797
2668
  }
2798
2669
  _dispose(e) {
2799
2670
  const t = e.getUnitId();
@@ -2823,7 +2694,7 @@ let ut = class extends Yn {
2823
2694
  return;
2824
2695
  const r = [];
2825
2696
  this.disposeWithMe(
2826
- ye(
2697
+ De(
2827
2698
  n.createControl$.subscribe(() => {
2828
2699
  if (this._hasCropObject(t))
2829
2700
  return;
@@ -2834,7 +2705,7 @@ let ut = class extends Yn {
2834
2705
  if (!c)
2835
2706
  return;
2836
2707
  const d = c.oKey, a = this._drawingManagerService.getDrawingOKey(d);
2837
- if (!a || a.drawingType === Le.DRAWING_DOM)
2708
+ if (!a || a.drawingType === Pe.DRAWING_DOM)
2838
2709
  return;
2839
2710
  const { unitId: l, subUnitId: g, drawingId: u, drawingType: h } = a, f = this._canvasPopManagerService.attachPopupToObject(
2840
2711
  c,
@@ -2856,19 +2727,19 @@ let ut = class extends Yn {
2856
2727
  })
2857
2728
  )
2858
2729
  ), this.disposeWithMe(
2859
- ye(
2730
+ De(
2860
2731
  n.clearControl$.subscribe(() => {
2861
- r.forEach((o) => o.dispose()), r.length = 0, this._contextService.setContextValue(rt, !1), this._drawingManagerService.focusDrawing(null);
2732
+ r.forEach((o) => o.dispose()), r.length = 0, this._contextService.setContextValue(it, !1), this._drawingManagerService.focusDrawing(null);
2862
2733
  })
2863
2734
  )
2864
2735
  ), this.disposeWithMe(
2865
- ye(
2736
+ De(
2866
2737
  n.changing$.subscribe(() => {
2867
2738
  r.forEach((o) => o.dispose()), r.length = 0;
2868
2739
  })
2869
2740
  )
2870
2741
  ), this.disposeWithMe(
2871
- ye(
2742
+ De(
2872
2743
  n.changeStart$.subscribe(() => {
2873
2744
  r.forEach((o) => o.dispose()), r.length = 0;
2874
2745
  })
@@ -2911,22 +2782,22 @@ let ut = class extends Yn {
2911
2782
  ];
2912
2783
  }
2913
2784
  };
2914
- ut = Cr([
2915
- Xe(0, ve),
2916
- Xe(1, Z(Li)),
2917
- Xe(2, Q),
2918
- Xe(3, z),
2919
- Xe(4, Qt)
2920
- ], ut);
2921
- var xr = Object.getOwnPropertyDescriptor, Nr = (i, e, t, n) => {
2922
- for (var r = n > 1 ? void 0 : n ? xr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2785
+ lt = xr([
2786
+ ze(0, me),
2787
+ ze(1, Z(Li)),
2788
+ ze(2, Q),
2789
+ ze(3, z),
2790
+ ze(4, Qt)
2791
+ ], lt);
2792
+ var Cr = Object.getOwnPropertyDescriptor, Nr = (i, e, t, n) => {
2793
+ for (var r = n > 1 ? void 0 : n ? Cr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2923
2794
  (o = i[s]) && (r = o(r) || r);
2924
2795
  return r;
2925
- }, Pe = (i, e) => (t, n) => e(t, n, i);
2926
- let St = class extends Ue {
2796
+ }, Ae = (i, e) => (t, n) => e(t, n, i);
2797
+ let St = class extends Le {
2927
2798
  constructor(e, t, n, r, s, o, c, d) {
2928
2799
  super();
2929
- _e(this, "_liquid", new nn());
2800
+ Ie(this, "_liquid", new nn());
2930
2801
  this._context = e, this._docSkeletonManagerService = t, this._commandService = n, this._editorService = r, this._drawingManagerService = s, this._docRefreshDrawingsService = o, this._univerInstanceService = c, this._lifecycleService = d, this._initialize(), this._commandExecutedListener();
2931
2802
  }
2932
2803
  _initialize() {
@@ -2950,7 +2821,7 @@ let St = class extends Ue {
2950
2821
  const c = this._docSkeletonManagerService.getSkeleton();
2951
2822
  if (c == null)
2952
2823
  return;
2953
- if (this._editorService.isEditor(s) && s !== yt) {
2824
+ if (this._editorService.isEditor(s) && s !== Ot) {
2954
2825
  o == null || o.makeDirty();
2955
2826
  return;
2956
2827
  }
@@ -2972,16 +2843,16 @@ let St = class extends Ue {
2972
2843
  );
2973
2844
  }
2974
2845
  _refreshDrawing(e) {
2975
- var y, D;
2846
+ var O, D;
2976
2847
  const t = e == null ? void 0 : e.getSkeletonData(), { mainComponent: n, unitId: r } = this._context, s = n;
2977
2848
  if (!t)
2978
2849
  return;
2979
2850
  const { left: o, top: c, pageLayoutType: d, pageMarginLeft: a, pageMarginTop: l } = s, { pages: g, skeHeaders: u, skeFooters: h } = t, f = {};
2980
2851
  this._liquid.reset();
2981
- for (let O = 0, C = g.length; O < C; O++) {
2982
- const M = g[O], { headerId: E, footerId: U, pageWidth: N } = M;
2852
+ for (let y = 0, x = g.length; y < x; y++) {
2853
+ const M = g[y], { headerId: E, footerId: U, pageWidth: N } = M;
2983
2854
  if (E) {
2984
- const I = (y = u.get(E)) == null ? void 0 : y.get(N);
2855
+ const I = (O = u.get(E)) == null ? void 0 : O.get(N);
2985
2856
  I && this._calculateDrawingPosition(
2986
2857
  r,
2987
2858
  I,
@@ -3006,8 +2877,8 @@ let St = class extends Ue {
3006
2877
  }
3007
2878
  this._calculateDrawingPosition(r, M, o, c, f, M.marginTop, M.marginLeft), this._liquid.translatePage(M, d, a, l);
3008
2879
  }
3009
- const p = Object.values(f), v = p.filter((O) => !O.isMultiTransform), w = p.filter((O) => O.isMultiTransform);
3010
- v.length > 0 && this._drawingManagerService.refreshTransform(v), this._handleMultiDrawingsTransform(w);
2880
+ const v = Object.values(f), p = v.filter((y) => !y.isMultiTransform), w = v.filter((y) => y.isMultiTransform);
2881
+ p.length > 0 && this._drawingManagerService.refreshTransform(p), this._handleMultiDrawingsTransform(w);
3011
2882
  }
3012
2883
  _handleMultiDrawingsTransform(e) {
3013
2884
  const { scene: t, unitId: n } = this._context, r = t.getTransformerByCreate();
@@ -3015,7 +2886,7 @@ let St = class extends Ue {
3015
2886
  const a = this._drawingManagerService.getDrawingByParam(d);
3016
2887
  a != null && (a.transform = d.transform, a.transforms = d.transforms, a.isMultiTransform = d.isMultiTransform);
3017
2888
  });
3018
- const o = [...r.getSelectedObjectMap().keys()], c = Object.values(this._drawingManagerService.getDrawingData(n, n)).filter((d) => d.isMultiTransform === oe.TRUE);
2889
+ const o = [...r.getSelectedObjectMap().keys()], c = Object.values(this._drawingManagerService.getDrawingData(n, n)).filter((d) => d.isMultiTransform === se.TRUE);
3019
2890
  this._drawingManagerService.removeNotification(c), e.length > 0 && this._drawingManagerService.addNotification(e);
3020
2891
  for (const d of o) {
3021
2892
  const a = t.getObject(d);
@@ -3028,22 +2899,22 @@ let St = class extends Ue {
3028
2899
  marginTop: o,
3029
2900
  marginLeft: c
3030
2901
  }), d.forEach((a) => {
3031
- const { aLeft: l, aTop: g, height: u, width: h, angle: f, drawingId: p, drawingOrigin: v } = a, w = v.layoutType === k.WRAP_NONE && v.behindDoc === oe.TRUE, { isMultiTransform: y = oe.FALSE } = v, D = {
2902
+ const { aLeft: l, aTop: g, height: u, width: h, angle: f, drawingId: v, drawingOrigin: p } = a, w = p.layoutType === k.WRAP_NONE && p.behindDoc === se.TRUE, { isMultiTransform: O = se.FALSE } = p, D = {
3032
2903
  left: l + n + this._liquid.x,
3033
2904
  top: g + r + this._liquid.y,
3034
2905
  width: h,
3035
2906
  height: u,
3036
2907
  angle: f
3037
2908
  };
3038
- s[p] == null ? s[p] = {
2909
+ s[v] == null ? s[v] = {
3039
2910
  unitId: e,
3040
2911
  subUnitId: e,
3041
- drawingId: p,
2912
+ drawingId: v,
3042
2913
  behindText: w,
3043
2914
  transform: D,
3044
2915
  transforms: [D],
3045
- isMultiTransform: y
3046
- } : y === oe.TRUE && s[p].transforms.push(D);
2916
+ isMultiTransform: O
2917
+ } : O === se.TRUE && s[v].transforms.push(D);
3047
2918
  }), this._liquid.restorePagePadding({
3048
2919
  marginTop: o,
3049
2920
  marginLeft: c
@@ -3058,21 +2929,21 @@ let St = class extends Ue {
3058
2929
  }
3059
2930
  };
3060
2931
  St = Nr([
3061
- Pe(1, Z(ne)),
3062
- Pe(2, G),
3063
- Pe(3, Ui),
3064
- Pe(4, ve),
3065
- Pe(5, Z(ht)),
3066
- Pe(6, z),
3067
- Pe(7, Z(Zn))
2932
+ Ae(1, Z(te)),
2933
+ Ae(2, j),
2934
+ Ae(3, Ui),
2935
+ Ae(4, me),
2936
+ Ae(5, Z(ft)),
2937
+ Ae(6, z),
2938
+ Ae(7, Z(Zn))
3068
2939
  ], St);
3069
2940
  var Er = Object.defineProperty, Rr = Object.getOwnPropertyDescriptor, Ar = (i, e, t) => e in i ? Er(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Pr = (i, e, t, n) => {
3070
2941
  for (var r = n > 1 ? void 0 : n ? Rr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
3071
2942
  (o = i[s]) && (r = o(r) || r);
3072
2943
  return r;
3073
- }, _t = (i, e) => (t, n) => e(t, n, i), Ln = (i, e, t) => Ar(i, typeof e != "symbol" ? e + "" : e, t);
2944
+ }, It = (i, e) => (t, n) => e(t, n, i), Ln = (i, e, t) => Ar(i, typeof e != "symbol" ? e + "" : e, t);
3074
2945
  const Lr = "DOC_DRAWING_UI_PLUGIN";
3075
- let gt = class extends ei {
2946
+ let ut = class extends ei {
3076
2947
  constructor(i = Xt, e, t, n) {
3077
2948
  super(), this._config = i, this._injector = e, this._renderManagerSrv = t, this._configService = n;
3078
2949
  const { ...r } = ti(
@@ -3084,46 +2955,46 @@ let gt = class extends ei {
3084
2955
  }
3085
2956
  onStarting() {
3086
2957
  [
3087
- [ot],
3088
- [ut],
2958
+ [st],
3089
2959
  [lt],
2960
+ [dt],
2961
+ [ot],
2962
+ [ft],
3090
2963
  [at],
3091
- [ht],
3092
- [ct],
3093
- [dt]
2964
+ [ct]
3094
2965
  ].forEach((e) => this._injector.add(e));
3095
2966
  }
3096
2967
  onReady() {
3097
2968
  [
3098
- [st],
2969
+ [rt],
3099
2970
  [St]
3100
- ].forEach((i) => this._renderManagerSrv.registerRenderModule(Ie.UNIVER_DOC, i)), this._injector.get(at), this._injector.get(ot), this._injector.get(lt), this._injector.get(dt);
2971
+ ].forEach((i) => this._renderManagerSrv.registerRenderModule(we.UNIVER_DOC, i)), this._injector.get(ot), this._injector.get(st), this._injector.get(dt), this._injector.get(ct);
3101
2972
  }
3102
2973
  onRendered() {
3103
- this._injector.get(ut), this._injector.get(ct);
2974
+ this._injector.get(lt), this._injector.get(at);
3104
2975
  }
3105
2976
  };
3106
- Ln(gt, "type", Ie.UNIVER_DOC);
3107
- Ln(gt, "pluginName", Lr);
3108
- gt = Pr([
3109
- Qn(hi, ci, ni, xi),
3110
- _t(1, Z(en)),
3111
- _t(2, Q),
3112
- _t(3, Jn)
3113
- ], gt);
2977
+ Ln(ut, "type", we.UNIVER_DOC);
2978
+ Ln(ut, "pluginName", Lr);
2979
+ ut = Pr([
2980
+ Qn(hi, ci, ni, Ci),
2981
+ It(1, Z(en)),
2982
+ It(2, Q),
2983
+ It(3, Jn)
2984
+ ], ut);
3114
2985
  export {
3115
2986
  er as ClearDocDrawingTransformerOperation,
3116
2987
  Rn as DOCS_IMAGE_MENU_ID,
3117
- pn as DeleteDocDrawingsCommand,
3118
- ct as DocFloatDomController,
2988
+ vn as DeleteDocDrawingsCommand,
2989
+ at as DocFloatDomController,
3119
2990
  Nn as EditDocDrawingOperation,
3120
2991
  wn as GroupDocDrawingCommand,
3121
- Ct as InsertDocDrawingCommand,
2992
+ xt as InsertDocDrawingCommand,
3122
2993
  Sn as InsertDocImageCommand,
3123
- Ze as MoveDocDrawingsCommand,
2994
+ Ye as MoveDocDrawingsCommand,
3124
2995
  bt as RemoveDocDrawingCommand,
3125
2996
  In as SetDocDrawingArrangeCommand,
3126
- xn as SidebarDocDrawingOperation,
2997
+ Cn as SidebarDocDrawingOperation,
3127
2998
  _n as UngroupDocDrawingCommand,
3128
- gt as UniverDocsDrawingUIPlugin
2999
+ ut as UniverDocsDrawingUIPlugin
3129
3000
  };