@univerjs/sheets-hyper-link-ui 0.6.0 → 0.6.1-nightly.202502221605

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
@@ -39,14 +39,14 @@ function fi(e) {
39
39
  return e;
40
40
  }
41
41
  const Hn = "sheets-hyper-link-ui.config", hn = {};
42
- var vi = Object.getOwnPropertyDescriptor, _i = (e, t, n, i) => {
43
- for (var r = i > 1 ? void 0 : i ? vi(t, n) : t, s = e.length - 1, o; s >= 0; s--)
44
- (o = e[s]) && (r = o(r) || r);
45
- return r;
46
- }, _e = (e, t) => (n, i) => t(n, i, e);
42
+ var vi = Object.getOwnPropertyDescriptor, _i = (e, t, n, r) => {
43
+ for (var i = r > 1 ? void 0 : r ? vi(t, n) : t, s = e.length - 1, o; s >= 0; s--)
44
+ (o = e[s]) && (i = o(i) || i);
45
+ return i;
46
+ }, _e = (e, t) => (n, r) => t(n, r, e);
47
47
  function Si(e, t) {
48
- const n = t.getMergeData(), i = t.getMaxColumns() - 1, r = t.getMaxRows() - 1;
49
- if (i < e.endColumn && (e.endColumn = i), r < e.endRow && (e.endRow = r), e.rangeType === rn.COLUMN || rn.ROW)
48
+ const n = t.getMergeData(), r = t.getMaxColumns() - 1, i = t.getMaxRows() - 1;
49
+ if (r < e.endColumn && (e.endColumn = r), i < e.endRow && (e.endRow = i), e.rangeType === rn.COLUMN || rn.ROW)
50
50
  return e;
51
51
  const s = [];
52
52
  return n.forEach((o) => {
@@ -54,8 +54,8 @@ function Si(e, t) {
54
54
  }), Ee.realUnion(e, ...s);
55
55
  }
56
56
  let pe = class {
57
- constructor(e, t, n, i, r, s) {
58
- this._univerInstanceService = e, this._commandService = t, this._definedNamesService = n, this._messageService = i, this._localeService = r, this._configService = s;
57
+ constructor(e, t, n, r, i, s) {
58
+ this._univerInstanceService = e, this._commandService = t, this._definedNamesService = n, this._messageService = r, this._localeService = i, this._configService = s;
59
59
  }
60
60
  navigate(e) {
61
61
  switch (e.type) {
@@ -67,12 +67,12 @@ let pe = class {
67
67
  }
68
68
  }
69
69
  _navigateToUniver(e) {
70
- const { gid: t, range: n, rangeid: i } = e, r = this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET);
71
- if (!r)
70
+ const { gid: t, range: n, rangeid: r } = e, i = this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET);
71
+ if (!i)
72
72
  return;
73
- const s = r.getUnitId();
74
- if (i) {
75
- const o = this._definedNamesService.getValueById(s, i);
73
+ const s = i.getUnitId();
74
+ if (r) {
75
+ const o = this._definedNamesService.getValueById(s, r);
76
76
  if (!o)
77
77
  return;
78
78
  const { formulaOrRefString: c } = o, u = this._definedNamesService.getWorksheetByRef(s, c);
@@ -90,7 +90,7 @@ let pe = class {
90
90
  });
91
91
  return;
92
92
  }
93
- this.navigateToDefineName(s, i);
93
+ this.navigateToDefineName(s, r);
94
94
  }
95
95
  if (t) {
96
96
  if (n) {
@@ -101,10 +101,10 @@ let pe = class {
101
101
  this.navigateToSheetById(s, t);
102
102
  }
103
103
  }
104
- async navigateToRange(e, t, n, i) {
105
- const r = await this.navigateToSheetById(e, t);
106
- if (r) {
107
- const s = Si(n, r);
104
+ async navigateToRange(e, t, n, r) {
105
+ const i = await this.navigateToSheetById(e, t);
106
+ if (i) {
107
+ const s = Si(n, i);
108
108
  await this._commandService.executeCommand(
109
109
  kn.id,
110
110
  {
@@ -117,7 +117,7 @@ let pe = class {
117
117
  }
118
118
  ), await this._commandService.executeCommand(Ln.id, {
119
119
  range: s,
120
- forceTop: i
120
+ forceTop: r
121
121
  });
122
122
  }
123
123
  }
@@ -125,16 +125,16 @@ let pe = class {
125
125
  const n = this._univerInstanceService.getUnit(e, b.UNIVER_SHEET);
126
126
  if (!n)
127
127
  return !1;
128
- const i = n.getActiveSheet();
129
- if (!i)
128
+ const r = n.getActiveSheet();
129
+ if (!r)
130
130
  return !1;
131
- if (i.getSheetId() === t)
132
- return i;
133
- const r = n.getSheetBySheetId(t);
134
- return r ? n.getHiddenWorksheets().indexOf(t) > -1 ? (this._messageService.show({
131
+ if (r.getSheetId() === t)
132
+ return r;
133
+ const i = n.getSheetBySheetId(t);
134
+ return i ? n.getHiddenWorksheets().indexOf(t) > -1 ? (this._messageService.show({
135
135
  content: this._localeService.t("hyperLink.message.hiddenSheet"),
136
136
  type: Ne.Error
137
- }), !1) : await this._commandService.executeCommand(bn.id, { unitId: e, subUnitId: t }) ? r : !1 : (this._messageService.show({
137
+ }), !1) : await this._commandService.executeCommand(bn.id, { unitId: e, subUnitId: t }) ? i : !1 : (this._messageService.show({
138
138
  content: this._localeService.t("hyperLink.message.noSheet"),
139
139
  type: Ne.Error
140
140
  }), !1);
@@ -159,17 +159,17 @@ pe = _i([
159
159
  _e(5, In)
160
160
  ], pe);
161
161
  const Ht = "SHEET_HYPER_LINK_UI_PLUGIN";
162
- var Ci = Object.getOwnPropertyDescriptor, Ii = (e, t, n, i) => {
163
- for (var r = i > 1 ? void 0 : i ? Ci(t, n) : t, s = e.length - 1, o; s >= 0; s--)
164
- (o = e[s]) && (r = o(r) || r);
165
- return r;
166
- }, Fe = (e, t) => (n, i) => t(n, i, e);
162
+ var Ci = Object.getOwnPropertyDescriptor, Ii = (e, t, n, r) => {
163
+ for (var i = r > 1 ? void 0 : r ? Ci(t, n) : t, s = e.length - 1, o; s >= 0; s--)
164
+ (o = e[s]) && (i = o(i) || i);
165
+ return i;
166
+ }, Fe = (e, t) => (n, r) => t(n, r, e);
167
167
  let Ye = class extends z {
168
- constructor(t, n, i, r) {
168
+ constructor(t, n, r, i) {
169
169
  super();
170
170
  V(this, "_plainTextFilter", /* @__PURE__ */ new Set());
171
171
  V(this, "_copyInfo");
172
- this._sheetClipboardService = t, this._hyperLinkModel = n, this._injector = i, this._resolverService = r, this._initCopyPaste(), this.disposeWithMe(() => {
172
+ this._sheetClipboardService = t, this._hyperLinkModel = n, this._injector = r, this._resolverService = i, this._initCopyPaste(), this.disposeWithMe(() => {
173
173
  this._plainTextFilter.clear();
174
174
  });
175
175
  }
@@ -186,15 +186,15 @@ let Ye = class extends z {
186
186
  _initCopyPaste() {
187
187
  this._sheetClipboardService.addClipboardHook({
188
188
  id: Ht,
189
- onBeforeCopy: (t, n, i) => this._collect(t, n, i),
190
- onPasteCells: (t, n, i, r) => {
191
- const { copyType: s = Ir.COPY, pasteType: o } = r, { range: c } = t || {}, { range: u, unitId: p, subUnitId: l } = n;
189
+ onBeforeCopy: (t, n, r) => this._collect(t, n, r),
190
+ onPasteCells: (t, n, r, i) => {
191
+ const { copyType: s = Ir.COPY, pasteType: o } = i, { range: c } = t || {}, { range: u, unitId: p, subUnitId: l } = n;
192
192
  return this._generateMutations(u, { copyType: s, pasteType: o, copyRange: c, unitId: p, subUnitId: l });
193
193
  },
194
194
  onPastePlainText: (t, n) => {
195
- const i = this._filterPlainText(n);
196
- if (Ke(n) && i) {
197
- const { range: r, unitId: s, subUnitId: o } = t, { ranges: [c], mapFunc: u } = Rt([r]), p = [], l = [];
195
+ const r = this._filterPlainText(n);
196
+ if (Ke(n) && r) {
197
+ const { range: i, unitId: s, subUnitId: o } = t, { ranges: [c], mapFunc: u } = Rt([i]), p = [], l = [];
198
198
  return En.foreach(c, (g, d) => {
199
199
  const { row: _, col: C } = u(g, d), v = this._hyperLinkModel.getHyperLinkByLocation(s, o, _, C);
200
200
  v && p.push({
@@ -219,14 +219,14 @@ let Ye = class extends z {
219
219
  priority: 99
220
220
  });
221
221
  }
222
- _collect(t, n, i) {
223
- const r = new tr();
222
+ _collect(t, n, r) {
223
+ const i = new tr();
224
224
  this._copyInfo = {
225
225
  unitId: t,
226
226
  subUnitId: n,
227
- matrix: r
227
+ matrix: i
228
228
  };
229
- const s = this._injector.invoke((u) => yr(i, u, t, n));
229
+ const s = this._injector.invoke((u) => yr(r, u, t, n));
230
230
  if (!s)
231
231
  return;
232
232
  const { rows: o, cols: c } = s;
@@ -234,7 +234,7 @@ let Ye = class extends z {
234
234
  c.forEach((l, g) => {
235
235
  var _;
236
236
  const d = this._hyperLinkModel.getHyperLinkByLocation(t, n, u, l);
237
- r.setValue(p, g, (_ = d == null ? void 0 : d.id) != null ? _ : "");
237
+ i.setValue(p, g, (_ = d == null ? void 0 : d.id) != null ? _ : "");
238
238
  });
239
239
  });
240
240
  }
@@ -251,7 +251,7 @@ let Ye = class extends z {
251
251
  Be.SPECIAL_PASTE_FORMULA
252
252
  ].includes(n.pasteType))
253
253
  return { redos: [], undos: [] };
254
- const { unitId: r, subUnitId: s } = this._copyInfo, o = [], c = [], { ranges: [u, p], mapFunc: l } = Rt([n.copyRange, t]);
254
+ const { unitId: i, subUnitId: s } = this._copyInfo, o = [], c = [], { ranges: [u, p], mapFunc: l } = Rt([n.copyRange, t]);
255
255
  return Er(u, p, !0).forEach(({ startRange: d }) => {
256
256
  var _;
257
257
  (_ = this._copyInfo) == null || _.matrix.forValue((C, v, w) => {
@@ -263,7 +263,7 @@ let Ye = class extends z {
263
263
  endColumn: v
264
264
  },
265
265
  d
266
- ), k = this._hyperLinkModel.getHyperLink(r, s, w), { row: U, col: O } = l(a.startRow, a.startColumn), L = this._hyperLinkModel.getHyperLinkByLocation(n.unitId, n.subUnitId, U, O), $ = Ie.generateRandomId();
266
+ ), k = this._hyperLinkModel.getHyperLink(i, s, w), { row: U, col: O } = l(a.startRow, a.startColumn), L = this._hyperLinkModel.getHyperLinkByLocation(n.unitId, n.subUnitId, U, O), $ = Ie.generateRandomId();
267
267
  L && o.push({
268
268
  id: He.id,
269
269
  params: {
@@ -321,7 +321,7 @@ class xn extends z {
321
321
  return Array.from(this._customHyperLinks.values()).map(({ option: n }) => n);
322
322
  }
323
323
  findCustomHyperLink(n) {
324
- return Array.from(this._customHyperLinks.values()).find((r) => r.match(n));
324
+ return Array.from(this._customHyperLinks.values()).find((i) => i.match(n));
325
325
  }
326
326
  registerCustomHyperLink(n) {
327
327
  this._customHyperLinks.set(n.type, n);
@@ -330,8 +330,8 @@ class xn extends z {
330
330
  return this._customHyperLinks.get(n);
331
331
  }
332
332
  removeCustomHyperLink(n) {
333
- const { _customHyperLinks: i } = this;
334
- i.delete(n);
333
+ const { _customHyperLinks: r } = this;
334
+ r.delete(n);
335
335
  }
336
336
  dispose() {
337
337
  super.dispose(), this._customHyperLinks.clear();
@@ -342,7 +342,7 @@ const yi = "univer-cell-link-edit", Ei = "univer-cell-link-edit-buttons", gn = {
342
342
  cellLinkEditButtons: Ei
343
343
  }, ze = () => {
344
344
  var Ft;
345
- const [e, t] = J(""), [n, i] = J(!1), [r, s] = J(""), [o, c] = J(!0), [u, p] = J(S.URL), [l, g] = J(""), d = E(ct), _ = E(Pn), C = E(re), v = E(Y), w = E(K), a = Kr(w.currentEditing$), k = E(wt), U = E(pe), O = E(ie), L = E(xn), $ = dn(() => L.getOptions(), [L]), D = E(pt), X = E(Ae), Re = E(Rr), $e = E(De), oe = E(Rn), Le = E(nr), Pe = E(De), ke = Pt({}), se = dn(() => {
345
+ const [e, t] = J(""), [n, r] = J(!1), [i, s] = J(""), [o, c] = J(!0), [u, p] = J(S.URL), [l, g] = J(""), d = E(ct), _ = E(Pn), C = E(re), v = E(Y), w = E(K), a = Kr(w.currentEditing$), k = E(wt), U = E(pe), O = E(ie), L = E(xn), $ = dn(() => L.getOptions(), [L]), D = E(pt), X = E(Ae), Re = E(Rr), $e = E(De), oe = E(Rn), Le = E(nr), Pe = E(De), ke = Pt({}), se = dn(() => {
346
346
  if (!L.isBuiltInLinkType(u))
347
347
  return L.getCustomHyperLink(u);
348
348
  }, [L, u]), [B, Kn] = J(!1), [be, gt] = J(!1), x = Pt(!1), F = v.getCurrentUnitForType(b.UNIVER_SHEET), Yn = (F == null ? void 0 : F.getActiveSheet().getSheetId()) || "", Q = hi((h) => {
@@ -510,9 +510,9 @@ const yi = "univer-cell-link-edit", Ei = "univer-cell-link-edit-buttons", gn = {
510
510
  return;
511
511
  I.sheetName || (I.sheetName = ((M = F.getActiveSheet()) == null ? void 0 : M.getName()) || "");
512
512
  const P = Hr(I);
513
- g(P), P && (x.current || !r) && (Q(P), x.current = !0);
513
+ g(P), P && (x.current || !i) && (Q(P), x.current = !0);
514
514
  }), vt = async () => {
515
- if (o && !r || !l || u === S.URL && !Ke(l)) {
515
+ if (o && !i || !l || u === S.URL && !Ke(l)) {
516
516
  Kn(!0);
517
517
  return;
518
518
  }
@@ -524,7 +524,7 @@ const yi = "univer-cell-link-edit", Ei = "univer-cell-link-edit-buttons", gn = {
524
524
  unitId: a.unitId,
525
525
  subUnitId: a.subUnitId,
526
526
  payload: {
527
- display: o ? r : "",
527
+ display: o ? i : "",
528
528
  payload: Vt(u, l)
529
529
  },
530
530
  row: a.row,
@@ -541,7 +541,7 @@ const yi = "univer-cell-link-edit", Ei = "univer-cell-link-edit-buttons", gn = {
541
541
  row: a.row,
542
542
  column: a.col,
543
543
  payload: Vt(u, l),
544
- display: o ? r : ""
544
+ display: o ? i : ""
545
545
  },
546
546
  documentId: a.type === m.ZEN_EDITOR ? N : C.getCurrentEditorId()
547
547
  });
@@ -574,11 +574,11 @@ const yi = "univer-cell-link-edit", Ei = "univer-cell-link-edit-buttons", gn = {
574
574
  ve,
575
575
  {
576
576
  label: d.t("hyperLink.form.label"),
577
- error: B && !r ? d.t("hyperLink.form.inputError") : "",
577
+ error: B && !i ? d.t("hyperLink.form.inputError") : "",
578
578
  children: /* @__PURE__ */ f(
579
579
  an,
580
580
  {
581
- value: r,
581
+ value: i,
582
582
  onChange: (h) => {
583
583
  Q(h), x.current = !1;
584
584
  },
@@ -610,7 +610,7 @@ const yi = "univer-cell-link-edit", Ei = "univer-cell-link-edit-buttons", gn = {
610
610
  {
611
611
  value: l,
612
612
  onChange: (h) => {
613
- g(h), h && (x.current || !r || r === l) && (Q(h), x.current = !0);
613
+ g(h), h && (x.current || !i || i === l) && (Q(h), x.current = !0);
614
614
  },
615
615
  placeholder: d.t("hyperLink.form.linkPlaceholder"),
616
616
  autoFocus: !0,
@@ -636,7 +636,7 @@ const yi = "univer-cell-link-edit", Ei = "univer-cell-link-edit-buttons", gn = {
636
636
  onRangeSelectorDialogVisibleChange: async (h) => {
637
637
  var y, I;
638
638
  if (h)
639
- a.type === m.ZEN_EDITOR && (D.hide(), oe.setContextValue(Ct, !0)), a.type !== m.VIEWING && C.enableForceKeepVisible(), i(!0);
639
+ a.type === m.ZEN_EDITOR && (D.hide(), oe.setContextValue(Ct, !0)), a.type !== m.VIEWING && C.enableForceKeepVisible(), r(!0);
640
640
  else {
641
641
  if (await U.navigateToRange(a.unitId, a.subUnitId, { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col }, !0), a.type === m.ZEN_EDITOR) {
642
642
  await O.executeCommand(kn.id, {
@@ -647,7 +647,7 @@ const yi = "univer-cell-link-edit", Ei = "univer-cell-link-edit-buttons", gn = {
647
647
  const P = (y = X.getRenderById(N)) == null ? void 0 : y.with(ni), M = (I = Pe.getTextRanges({ unitId: N, subUnitId: N })) == null ? void 0 : I[0];
648
648
  P && M && (P.scrollToRange(M), Pe.refreshSelection({ unitId: N, subUnitId: N }));
649
649
  }
650
- C.disableForceKeepVisible(), i(!1);
650
+ C.disableForceKeepVisible(), r(!1);
651
651
  }
652
652
  }
653
653
  }
@@ -661,7 +661,7 @@ const yi = "univer-cell-link-edit", Ei = "univer-cell-link-edit-buttons", gn = {
661
661
  var P, M;
662
662
  g(h);
663
663
  const y = (P = mt.find((j) => j.value === h)) == null ? void 0 : P.label, I = (M = mt.find((j) => j.value === l)) == null ? void 0 : M.label;
664
- y && (x.current || !r || r === I) && (Q(y), x.current = !0);
664
+ y && (x.current || !i || i === I) && (Q(y), x.current = !0);
665
665
  }
666
666
  }
667
667
  ) }),
@@ -674,7 +674,7 @@ const yi = "univer-cell-link-edit", Ei = "univer-cell-link-edit-buttons", gn = {
674
674
  var P, M;
675
675
  g(h);
676
676
  const y = (P = ft.find((j) => j.value === h)) == null ? void 0 : P.label, I = (M = ft.find((j) => j.value === l)) == null ? void 0 : M.label;
677
- y && (x.current || !r || r === I) && (Q(y), x.current = !0);
677
+ y && (x.current || !i || i === I) && (Q(y), x.current = !0);
678
678
  }
679
679
  }
680
680
  ) }),
@@ -683,7 +683,7 @@ const yi = "univer-cell-link-edit", Ei = "univer-cell-link-edit-buttons", gn = {
683
683
  {
684
684
  linkId: e,
685
685
  payload: l,
686
- display: r,
686
+ display: i,
687
687
  showError: B,
688
688
  setByPayload: x,
689
689
  setDisplay: (h) => {
@@ -719,41 +719,44 @@ const yi = "univer-cell-link-edit", Ei = "univer-cell-link-edit-buttons", gn = {
719
719
  ze.componentKey = "univer.sheet.cell-link-edit";
720
720
  var A = function() {
721
721
  return A = Object.assign || function(e) {
722
- for (var t, n = 1, i = arguments.length; n < i; n++) {
722
+ for (var t, n = 1, r = arguments.length; n < r; n++) {
723
723
  t = arguments[n];
724
- for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
724
+ for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
725
725
  }
726
726
  return e;
727
727
  }, A.apply(this, arguments);
728
728
  }, Ri = function(e, t) {
729
729
  var n = {};
730
- for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
730
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
731
731
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
732
- for (var r = 0, i = Object.getOwnPropertySymbols(e); r < i.length; r++)
733
- t.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, i[r]) && (n[i[r]] = e[i[r]]);
732
+ for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)
733
+ t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
734
734
  return n;
735
735
  }, me = he(function(e, t) {
736
- var n = e.icon, i = e.id, r = e.className, s = e.extend, o = Ri(e, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), u = Pt("_".concat(ki()));
737
- return Dn(n, "".concat(i), { defIds: n.defIds, idSuffix: u.current }, A({ ref: t, className: c }, o), s);
736
+ var n = e.icon, r = e.id, i = e.className, s = e.extend, o = Ri(e, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), u = Pt("_".concat(ki()));
737
+ return Dn(n, "".concat(r), { defIds: n.defIds, idSuffix: u.current }, A({ ref: t, className: c }, o), s);
738
738
  });
739
- function Dn(e, t, n, i, r) {
740
- return ge(e.tag, A(A({ key: t }, Li(e, n, r)), i), (Pi(e, n).children || []).map(function(s, o) {
741
- return Dn(s, "".concat(t, "-").concat(e.tag, "-").concat(o), n, void 0, r);
739
+ function Dn(e, t, n, r, i) {
740
+ return ge(e.tag, A(A({ key: t }, Li(e, n, i)), r), (Pi(e, n).children || []).map(function(s, o) {
741
+ return Dn(s, "".concat(t, "-").concat(e.tag, "-").concat(o), n, void 0, i);
742
742
  }));
743
743
  }
744
744
  function Li(e, t, n) {
745
- var i = A({}, e.attrs);
746
- n != null && n.colorChannel1 && i.fill === "colorChannel1" && (i.fill = n.colorChannel1);
747
- var r = t.defIds;
748
- return !r || r.length === 0 || (e.tag === "use" && i["xlink:href"] && (i["xlink:href"] = i["xlink:href"] + t.idSuffix), Object.entries(i).forEach(function(s) {
745
+ var r = A({}, e.attrs);
746
+ n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1), e.tag === "mask" && r.id && (r.id = r.id + t.idSuffix), Object.entries(r).forEach(function(s) {
747
+ var o = s[0], c = s[1];
748
+ o === "mask" && typeof c == "string" && (r[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
749
+ });
750
+ var i = t.defIds;
751
+ return !i || i.length === 0 || (e.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + t.idSuffix), Object.entries(r).forEach(function(s) {
749
752
  var o = s[0], c = s[1];
750
- typeof c == "string" && (i[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
751
- })), i;
753
+ typeof c == "string" && (r[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
754
+ })), r;
752
755
  }
753
756
  function Pi(e, t) {
754
- var n, i = t.defIds;
755
- return !i || i.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? A(A({}, e), { children: e.children.map(function(r) {
756
- return typeof r.attrs.id == "string" && i && i.indexOf(r.attrs.id) > -1 ? A(A({}, r), { attrs: A(A({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
757
+ var n, r = t.defIds;
758
+ return !r || r.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? A(A({}, e), { children: e.children.map(function(i) {
759
+ return typeof i.attrs.id == "string" && r && r.indexOf(i.attrs.id) > -1 ? A(A({}, i), { attrs: A(A({}, i.attrs), { id: i.attrs.id + t.idSuffix }) }) : i;
757
760
  }) }) : e;
758
761
  }
759
762
  function ki() {
@@ -809,17 +812,17 @@ var Mi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
809
812
  });
810
813
  Vn.displayName = "Xlsx";
811
814
  function Fn(e) {
812
- var t, n, i = "";
813
- if (typeof e == "string" || typeof e == "number") i += e;
815
+ var t, n, r = "";
816
+ if (typeof e == "string" || typeof e == "number") r += e;
814
817
  else if (typeof e == "object") if (Array.isArray(e)) {
815
- var r = e.length;
816
- for (t = 0; t < r; t++) e[t] && (n = Fn(e[t])) && (i && (i += " "), i += n);
817
- } else for (n in e) e[n] && (i && (i += " "), i += n);
818
- return i;
818
+ var i = e.length;
819
+ for (t = 0; t < i; t++) e[t] && (n = Fn(e[t])) && (r && (r += " "), r += n);
820
+ } else for (n in e) e[n] && (r && (r += " "), r += n);
821
+ return r;
819
822
  }
820
823
  function mn() {
821
- for (var e, t, n = 0, i = "", r = arguments.length; n < r; n++) (e = arguments[n]) && (t = Fn(e)) && (i && (i += " "), i += t);
822
- return i;
824
+ for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = Fn(e)) && (r && (r += " "), r += t);
825
+ return r;
823
826
  }
824
827
  const Ui = "univer-cell-link", Hi = "univer-cell-link-type", xi = "univer-cell-link-content", Di = "univer-cell-link-content-error", Ai = "univer-cell-link-url", $i = "univer-cell-link-operations", Bi = "univer-cell-link-operation", Vi = "univer-cell-link-operation-error", Z = {
825
828
  cellLink: Ui,
@@ -838,7 +841,7 @@ const Ui = "univer-cell-link", Hi = "univer-cell-link-type", xi = "univer-cell-l
838
841
  [S.INVALID]: /* @__PURE__ */ f(Ze, {})
839
842
  }, fn = (e) => {
840
843
  var U, O;
841
- const t = E(K), n = E(ie), i = E(Nn), r = E(ct), s = E(pe), o = E(re), c = E(wt), u = E(pt), { customRange: p, row: l, col: g, unitId: d, subUnitId: _, editPermission: C, copyPermission: v, type: w } = e;
844
+ const t = E(K), n = E(ie), r = E(Nn), i = E(ct), s = E(pe), o = E(re), c = E(wt), u = E(pt), { customRange: p, row: l, col: g, unitId: d, subUnitId: _, editPermission: C, copyPermission: v, type: w } = e;
842
845
  if (!((U = p == null ? void 0 : p.properties) != null && U.url))
843
846
  return null;
844
847
  const a = c.parseHyperLink((O = p.properties.url) != null ? O : ""), k = a.type === S.INVALID;
@@ -868,13 +871,13 @@ const Ui = "univer-cell-link", Hi = "univer-cell-link-type", xi = "univer-cell-l
868
871
  L.hash = a.url.slice(1), navigator.clipboard.writeText(L.href);
869
872
  } else
870
873
  navigator.clipboard.writeText(a.url);
871
- i.show({
872
- content: r.t("hyperLink.message.coped"),
874
+ r.show({
875
+ content: i.t("hyperLink.message.coped"),
873
876
  type: Ne.Info
874
877
  });
875
878
  }
876
879
  },
877
- children: /* @__PURE__ */ f(Ve, { placement: "bottom", title: r.t("hyperLink.popup.copy"), children: /* @__PURE__ */ f(An, {}) })
880
+ children: /* @__PURE__ */ f(Ve, { placement: "bottom", title: i.t("hyperLink.popup.copy"), children: /* @__PURE__ */ f(An, {}) })
878
881
  }
879
882
  ),
880
883
  C && /* @__PURE__ */ Ce(di, { children: [
@@ -892,7 +895,7 @@ const Ui = "univer-cell-link", Hi = "univer-cell-link-type", xi = "univer-cell-l
892
895
  type: w
893
896
  });
894
897
  },
895
- children: /* @__PURE__ */ f(Ve, { placement: "bottom", title: r.t("hyperLink.popup.edit"), children: /* @__PURE__ */ f(Bn, {}) })
898
+ children: /* @__PURE__ */ f(Ve, { placement: "bottom", title: i.t("hyperLink.popup.edit"), children: /* @__PURE__ */ f(Bn, {}) })
896
899
  }
897
900
  ),
898
901
  /* @__PURE__ */ f(
@@ -910,15 +913,15 @@ const Ui = "univer-cell-link", Hi = "univer-cell-link-type", xi = "univer-cell-l
910
913
  documentId: w === m.ZEN_EDITOR ? N : o.getCurrentEditorId()
911
914
  }) && t.hideCurrentPopup(void 0, !0);
912
915
  },
913
- children: /* @__PURE__ */ f(Ve, { placement: "bottom", title: r.t("hyperLink.popup.cancel"), children: /* @__PURE__ */ f($n, {}) })
916
+ children: /* @__PURE__ */ f(Ve, { placement: "bottom", title: i.t("hyperLink.popup.cancel"), children: /* @__PURE__ */ f($n, {}) })
914
917
  }
915
918
  )
916
919
  ] })
917
920
  ] })
918
921
  ] });
919
922
  }, Xe = () => {
920
- var r, s;
921
- const e = E(K), [t, n] = J(null), i = E(Y);
923
+ var i, s;
924
+ const e = E(K), [t, n] = J(null), r = E(Y);
922
925
  if (ne(() => {
923
926
  n(e.currentPopup);
924
927
  const o = e.currentPopup$.subscribe((c) => {
@@ -930,23 +933,23 @@ const Ui = "univer-cell-link", Hi = "univer-cell-link-type", xi = "univer-cell-l
930
933
  }, [e.currentPopup, e.currentPopup$]), !t)
931
934
  return null;
932
935
  if (t.showAll) {
933
- const o = i.getUnit(t.unitId, b.UNIVER_SHEET), c = o == null ? void 0 : o.getSheetBySheetId(t.subUnitId), u = c == null ? void 0 : c.getCell(t.row, t.col), p = (s = (r = u == null ? void 0 : u.p) == null ? void 0 : r.body) == null ? void 0 : s.customRanges;
936
+ const o = r.getUnit(t.unitId, b.UNIVER_SHEET), c = o == null ? void 0 : o.getSheetBySheetId(t.subUnitId), u = c == null ? void 0 : c.getCell(t.row, t.col), p = (s = (i = u == null ? void 0 : u.p) == null ? void 0 : i.body) == null ? void 0 : s.customRanges;
934
937
  return p != null && p.length ? /* @__PURE__ */ f("div", { children: p.map((l) => /* @__PURE__ */ f(fn, { ...t, customRange: l }, l.rangeId)) }) : null;
935
938
  }
936
939
  return /* @__PURE__ */ f(fn, { ...t });
937
940
  };
938
941
  Xe.componentKey = "univer.sheet.cell-link-popup";
939
- var ji = Object.getOwnPropertyDescriptor, Wi = (e, t, n, i) => {
940
- for (var r = i > 1 ? void 0 : i ? ji(t, n) : t, s = e.length - 1, o; s >= 0; s--)
941
- (o = e[s]) && (r = o(r) || r);
942
- return r;
943
- }, ce = (e, t) => (n, i) => t(n, i, e);
942
+ var ji = Object.getOwnPropertyDescriptor, Wi = (e, t, n, r) => {
943
+ for (var i = r > 1 ? void 0 : r ? ji(t, n) : t, s = e.length - 1, o; s >= 0; s--)
944
+ (o = e[s]) && (i = o(i) || i);
945
+ return i;
946
+ }, ce = (e, t) => (n, r) => t(n, r, e);
944
947
  const vn = (e, t) => {
945
- var n, i;
946
- return e.unitId === t.unitId && e.subUnitId === t.subUnitId && e.row === t.row && e.col === t.col && ((n = e.customRange) == null ? void 0 : n.rangeId) === ((i = t.customRange) == null ? void 0 : i.rangeId) && e.type === t.type;
948
+ var n, r;
949
+ return e.unitId === t.unitId && e.subUnitId === t.subUnitId && e.row === t.row && e.col === t.col && ((n = e.customRange) == null ? void 0 : n.rangeId) === ((r = t.customRange) == null ? void 0 : r.rangeId) && e.type === t.type;
947
950
  };
948
951
  let K = class extends z {
949
- constructor(t, n, i, r, s, o, c) {
952
+ constructor(t, n, r, i, s, o, c) {
950
953
  super();
951
954
  V(this, "_currentPopup", null);
952
955
  V(this, "_currentPopup$", new si());
@@ -955,7 +958,7 @@ let K = class extends z {
955
958
  V(this, "_currentEditing$", new ai(null));
956
959
  V(this, "currentEditing$", this._currentEditing$.asObservable());
957
960
  V(this, "_isKeepVisible", !1);
958
- this._sheetCanvasPopManagerService = t, this._injector = n, this._univerInstanceService = i, this._editorBridgeService = r, this._textSelectionManagerService = s, this._docCanvasPopManagerService = o, this._zenZoneService = c, this.disposeWithMe(() => {
961
+ this._sheetCanvasPopManagerService = t, this._injector = n, this._univerInstanceService = r, this._editorBridgeService = i, this._textSelectionManagerService = s, this._docCanvasPopManagerService = o, this._zenZoneService = c, this.disposeWithMe(() => {
959
962
  this.hideCurrentPopup(), this.endEditing(), this._currentEditing$.complete(), this._currentPopup$.complete();
960
963
  });
961
964
  }
@@ -977,7 +980,7 @@ let K = class extends z {
977
980
  const n = this._currentEditing$.getValue();
978
981
  if (n && vn(t, n))
979
982
  return;
980
- const { unitId: i, subUnitId: r, row: s, col: o, customRangeRect: c, customRange: u } = t;
983
+ const { unitId: r, subUnitId: i, row: s, col: o, customRangeRect: c, customRange: u } = t;
981
984
  let p;
982
985
  const l = {
983
986
  componentKey: Xe.componentKey,
@@ -1009,7 +1012,7 @@ let K = class extends z {
1009
1012
  N
1010
1013
  );
1011
1014
  } else if (t.showAll)
1012
- p = this._sheetCanvasPopManagerService.attachPopupToCell(t.row, t.col, l, i, r);
1015
+ p = this._sheetCanvasPopManagerService.attachPopupToCell(t.row, t.col, l, r, i);
1013
1016
  else {
1014
1017
  if (!u)
1015
1018
  return;
@@ -1020,8 +1023,8 @@ let K = class extends z {
1020
1023
  );
1021
1024
  }
1022
1025
  p && (this._currentPopup = {
1023
- unitId: i,
1024
- subUnitId: r,
1026
+ unitId: r,
1027
+ subUnitId: i,
1025
1028
  disposable: p,
1026
1029
  row: s,
1027
1030
  col: o,
@@ -1033,14 +1036,14 @@ let K = class extends z {
1033
1036
  }, this._currentPopup$.next(this._currentPopup));
1034
1037
  }
1035
1038
  hideCurrentPopup(t, n) {
1036
- var i, r;
1037
- this._currentPopup && ((!t || t === this._currentPopup.type) && this._currentPopup.disposable.canDispose() || n) && ((r = (i = this._currentPopup) == null ? void 0 : i.disposable) == null || r.dispose(), this._currentPopup = null, this._currentPopup$.next(null));
1039
+ var r, i;
1040
+ this._currentPopup && ((!t || t === this._currentPopup.type) && this._currentPopup.disposable.canDispose() || n) && ((i = (r = this._currentPopup) == null ? void 0 : r.disposable) == null || i.dispose(), this._currentPopup = null, this._currentPopup$.next(null));
1038
1041
  }
1039
1042
  _getEditingRange() {
1040
- var i, r, s;
1043
+ var r, i, s;
1041
1044
  const t = this._editorBridgeService.isVisible().visible, n = this._editorBridgeService.getEditCellState();
1042
1045
  if (t && n) {
1043
- const o = this._textSelectionManagerService.getActiveTextRange(), c = (i = n.documentLayoutObject.documentModel) == null ? void 0 : i.getBody();
1046
+ const o = this._textSelectionManagerService.getActiveTextRange(), c = (r = n.documentLayoutObject.documentModel) == null ? void 0 : r.getBody();
1044
1047
  if (!c)
1045
1048
  return null;
1046
1049
  if (!o || o.collapsed)
@@ -1050,7 +1053,7 @@ let K = class extends z {
1050
1053
  collapsed: c.dataStream.length - 2 === 0,
1051
1054
  label: Se.transform.getPlainText(c.dataStream)
1052
1055
  };
1053
- const u = Se.customRange.getCustomRangesInterestsWithSelection(o, (s = (r = c.customRanges) == null ? void 0 : r.filter((g) => g.rangeType === Ge.HYPERLINK)) != null ? s : []);
1056
+ const u = Se.customRange.getCustomRangesInterestsWithSelection(o, (s = (i = c.customRanges) == null ? void 0 : i.filter((g) => g.rangeType === Ge.HYPERLINK)) != null ? s : []);
1054
1057
  let p = o.startOffset, l = o.endOffset;
1055
1058
  return u.forEach((g) => {
1056
1059
  p = Math.min(p, g.startIndex), l = Math.max(l, g.endIndex + 1);
@@ -1078,8 +1081,8 @@ let K = class extends z {
1078
1081
  }
1079
1082
  startAddEditing(t) {
1080
1083
  var s, o, c, u, p;
1081
- const { unitId: n, subUnitId: i, type: r } = t;
1082
- if (r === m.ZEN_EDITOR) {
1084
+ const { unitId: n, subUnitId: r, type: i } = t;
1085
+ if (i === m.ZEN_EDITOR) {
1083
1086
  const l = this._univerInstanceService.getUnit(N, b.UNIVER_DOC);
1084
1087
  if (!l)
1085
1088
  return;
@@ -1096,7 +1099,7 @@ let K = class extends z {
1096
1099
  ...t,
1097
1100
  label: d
1098
1101
  });
1099
- } else if (r === m.EDITING) {
1102
+ } else if (i === m.EDITING) {
1100
1103
  const l = this._getEditingRange();
1101
1104
  if (!l)
1102
1105
  return;
@@ -1111,7 +1114,7 @@ let K = class extends z {
1111
1114
  d.pop(),
1112
1115
  this._editPopup,
1113
1116
  n,
1114
- i
1117
+ r
1115
1118
  ), this._currentEditing$.next({
1116
1119
  ...t,
1117
1120
  label: (o = l == null ? void 0 : l.label) != null ? o : ""
@@ -1122,9 +1125,9 @@ let K = class extends z {
1122
1125
  t.col,
1123
1126
  this._editPopup,
1124
1127
  n,
1125
- i
1128
+ r
1126
1129
  );
1127
- const l = this._univerInstanceService.getUnit(n, b.UNIVER_SHEET), g = l == null ? void 0 : l.getSheetBySheetId(i), d = g == null ? void 0 : g.getCellRaw(t.row, t.col);
1130
+ const l = this._univerInstanceService.getUnit(n, b.UNIVER_SHEET), g = l == null ? void 0 : l.getSheetBySheetId(r), d = g == null ? void 0 : g.getCellRaw(t.row, t.col);
1128
1131
  this._currentEditing$.next({
1129
1132
  ...t,
1130
1133
  label: d != null && d.p ? Se.transform.getPlainText((u = (c = d.p.body) == null ? void 0 : c.dataStream) != null ? u : "") : ((p = d == null ? void 0 : d.v) != null ? p : "").toString()
@@ -1135,21 +1138,21 @@ let K = class extends z {
1135
1138
  startEditing(t) {
1136
1139
  var o, c, u, p, l, g;
1137
1140
  (o = this._currentEditingPopup) == null || o.dispose(), this.hideCurrentPopup(void 0, !0);
1138
- const { unitId: n, subUnitId: i } = t;
1139
- let r, s;
1141
+ const { unitId: n, subUnitId: r } = t;
1142
+ let i, s;
1140
1143
  if (t.type === m.ZEN_EDITOR) {
1141
1144
  const d = this._univerInstanceService.getUnit(N, b.UNIVER_DOC);
1142
- if (r = (u = (c = d == null ? void 0 : d.getBody()) == null ? void 0 : c.customRanges) == null ? void 0 : u.find((_) => _.rangeId === t.customRangeId), s = r ? (p = d == null ? void 0 : d.getBody()) == null ? void 0 : p.dataStream.slice(r.startIndex, r.endIndex + 1) : "", !r || !s)
1145
+ if (i = (u = (c = d == null ? void 0 : d.getBody()) == null ? void 0 : c.customRanges) == null ? void 0 : u.find((_) => _.rangeId === t.customRangeId), s = i ? (p = d == null ? void 0 : d.getBody()) == null ? void 0 : p.dataStream.slice(i.startIndex, i.endIndex + 1) : "", !i || !s)
1143
1146
  return;
1144
1147
  this._textSelectionManagerService.replaceTextRanges([
1145
1148
  {
1146
- startOffset: r.startIndex,
1147
- endOffset: r.endIndex + 1
1149
+ startOffset: i.startIndex,
1150
+ endOffset: i.endIndex + 1
1148
1151
  }
1149
1152
  ]), this._currentEditingPopup = this._docCanvasPopManagerService.attachPopupToRange(
1150
1153
  {
1151
- startOffset: r.startIndex,
1152
- endOffset: r.endIndex,
1154
+ startOffset: i.startIndex,
1155
+ endOffset: i.endIndex,
1153
1156
  collapsed: !1
1154
1157
  },
1155
1158
  this._editPopup,
@@ -1159,33 +1162,33 @@ let K = class extends z {
1159
1162
  const d = Pr(this._injector, t.unitId, t.subUnitId, t.row, t.col, t.customRangeId);
1160
1163
  if (!d || !((l = d.rects) != null && l.length))
1161
1164
  return;
1162
- r = d.customRange, s = d.label, this._textSelectionManagerService.replaceTextRanges([
1165
+ i = d.customRange, s = d.label, this._textSelectionManagerService.replaceTextRanges([
1163
1166
  {
1164
- startOffset: r.startIndex,
1165
- endOffset: r.endIndex + 1
1167
+ startOffset: i.startIndex,
1168
+ endOffset: i.endIndex + 1
1166
1169
  }
1167
1170
  ]), this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(
1168
1171
  d.rects.pop(),
1169
1172
  this._editPopup,
1170
1173
  n,
1171
- i
1174
+ r
1172
1175
  );
1173
1176
  } else {
1174
- const d = this._univerInstanceService.getUnit(n, b.UNIVER_SHEET), _ = d == null ? void 0 : d.getSheetBySheetId(i), C = _ == null ? void 0 : _.getCellRaw(t.row, t.col), v = d == null ? void 0 : d.getStyles().getStyleByCell(C), w = v == null ? void 0 : v.tr, a = kr(this._injector, t.unitId, t.subUnitId, t.row, t.col, t.customRangeId);
1177
+ const d = this._univerInstanceService.getUnit(n, b.UNIVER_SHEET), _ = d == null ? void 0 : d.getSheetBySheetId(r), C = _ == null ? void 0 : _.getCellRaw(t.row, t.col), v = d == null ? void 0 : d.getStyles().getStyleByCell(C), w = v == null ? void 0 : v.tr, a = kr(this._injector, t.unitId, t.subUnitId, t.row, t.col, t.customRangeId);
1175
1178
  if (!a || !((g = a.rects) != null && g.length))
1176
1179
  return;
1177
- r = a.customRange, s = a.label, w ? this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToCell(
1180
+ i = a.customRange, s = a.label, w ? this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToCell(
1178
1181
  t.row,
1179
1182
  t.col,
1180
1183
  this._editPopup,
1181
1184
  n,
1182
- i
1185
+ r
1183
1186
  ) : this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupByPosition(
1184
1187
  a.rects.pop(),
1185
1188
  this._editPopup,
1186
1189
  {
1187
1190
  unitId: n,
1188
- subUnitId: i,
1191
+ subUnitId: r,
1189
1192
  row: t.row,
1190
1193
  col: t.col
1191
1194
  }
@@ -1193,14 +1196,14 @@ let K = class extends z {
1193
1196
  }
1194
1197
  this._currentEditing$.next({
1195
1198
  ...t,
1196
- customRange: r,
1199
+ customRange: i,
1197
1200
  label: s
1198
1201
  });
1199
1202
  }
1200
1203
  endEditing(t) {
1201
- var i;
1204
+ var r;
1202
1205
  const n = this._currentEditing$.getValue();
1203
- n && (!t || t === n.type) && ((i = this._currentEditingPopup) == null || i.dispose(), this._currentEditing$.next(null));
1206
+ n && (!t || t === n.type) && ((r = this._currentEditingPopup) == null || r.dispose(), this._currentEditing$.next(null));
1204
1207
  }
1205
1208
  };
1206
1209
  K = Wi([
@@ -1217,28 +1220,28 @@ const Zi = /* @__PURE__ */ new Set([
1217
1220
  It.CHECKBOX,
1218
1221
  It.LIST,
1219
1222
  It.LIST_MULTIPLE
1220
- ]), Dt = (e, t, n, i) => {
1223
+ ]), Dt = (e, t, n, r) => {
1221
1224
  var c, u;
1222
- const r = t.getCell(n, i);
1223
- if (r != null && r.f || r != null && r.si)
1225
+ const i = t.getCell(n, r);
1226
+ if (i != null && i.f || i != null && i.si)
1224
1227
  return 1;
1225
- const s = e.has(pn) ? e.get(pn) : null, o = s == null ? void 0 : s.getRuleByLocation(t.getUnitId(), t.getSheetId(), n, i);
1226
- return o && Zi.has(o.type) ? !0 : (u = (c = r == null ? void 0 : r.p) == null ? void 0 : c.drawingsOrder) != null && u.length ? 2 : 0;
1228
+ const s = e.has(pn) ? e.get(pn) : null, o = s == null ? void 0 : s.getRuleByLocation(t.getUnitId(), t.getSheetId(), n, r);
1229
+ return o && Zi.has(o.type) ? !0 : (u = (c = i == null ? void 0 : i.p) == null ? void 0 : c.drawingsOrder) != null && u.length ? 2 : 0;
1227
1230
  }, Gi = (e) => {
1228
1231
  const t = e.get(Y).getCurrentUnitForType(b.UNIVER_SHEET);
1229
1232
  if (!t)
1230
1233
  return !0;
1231
- const n = t.getActiveSheet(), i = e.get(Ot).getCurrentSelections();
1232
- if (!i.length)
1234
+ const n = t.getActiveSheet(), r = e.get(Ot).getCurrentSelections();
1235
+ if (!r.length)
1233
1236
  return !0;
1234
- const r = i[0].range.startRow, s = i[0].range.startColumn;
1235
- return Dt(e, n, r, s) === 1;
1237
+ const i = r[0].range.startRow, s = r[0].range.startColumn;
1238
+ return Dt(e, n, i, s) === 1;
1236
1239
  }, Ki = (e) => {
1237
- const t = e.get(De), n = e.get(Y), i = t.getTextRanges();
1238
- if (!(i != null && i.length))
1240
+ const t = e.get(De), n = e.get(Y), r = t.getTextRanges();
1241
+ if (!(r != null && r.length))
1239
1242
  return !0;
1240
- const r = n.getCurrentUnitForType(b.UNIVER_DOC);
1241
- return !!(!r || i.every((o) => o.collapsed) || !r.getSelfOrHeaderFooterModel(i[0].segmentId).getBody());
1243
+ const i = n.getCurrentUnitForType(b.UNIVER_DOC);
1244
+ return !!(!i || r.every((o) => o.collapsed) || !i.getSelfOrHeaderFooterModel(r[0].segmentId).getBody());
1242
1245
  }, At = {
1243
1246
  type: ut.OPERATION,
1244
1247
  id: "sheet.operation.open-hyper-link-edit-panel",
@@ -1259,14 +1262,14 @@ const Zi = /* @__PURE__ */ new Set([
1259
1262
  id: "sheet.operation.insert-hyper-link",
1260
1263
  handler(e) {
1261
1264
  var g;
1262
- const t = e.get(Y), n = wn(t), i = e.get(re);
1265
+ const t = e.get(Y), n = wn(t), r = e.get(re);
1263
1266
  if (!n)
1264
1267
  return !1;
1265
- const r = e.get(ie), o = e.get(Ot).getCurrentLastSelection();
1268
+ const i = e.get(ie), o = e.get(Ot).getCurrentLastSelection();
1266
1269
  if (!o)
1267
1270
  return !1;
1268
- const c = o.range.startRow, u = o.range.startColumn, p = i.isVisible(), l = ((g = t.getFocusedUnit()) == null ? void 0 : g.getUnitId()) === N;
1269
- return r.executeCommand(At.id, {
1271
+ const c = o.range.startRow, u = o.range.startColumn, p = r.isVisible(), l = ((g = t.getFocusedUnit()) == null ? void 0 : g.getUnitId()) === N;
1272
+ return i.executeCommand(At.id, {
1270
1273
  unitId: n.unitId,
1271
1274
  subUnitId: n.subUnitId,
1272
1275
  row: c,
@@ -1284,9 +1287,9 @@ const Zi = /* @__PURE__ */ new Set([
1284
1287
  return e.get(K).currentEditing ? t.executeCommand(qe.id) : t.executeCommand($t.id);
1285
1288
  }
1286
1289
  }, Bt = (e, t = N) => {
1287
- var r;
1288
- const n = e.get(Y), i = (r = e.get(Ae).getRenderById(t)) == null ? void 0 : r.with(Un);
1289
- return i ? i.textSelectionInner$.pipe(le(() => {
1290
+ var i;
1291
+ const n = e.get(Y), r = (i = e.get(Ae).getRenderById(t)) == null ? void 0 : i.with(Un);
1292
+ return r ? r.textSelectionInner$.pipe(le(() => {
1290
1293
  const o = e.get(re).getEditCellState();
1291
1294
  if (!o)
1292
1295
  return !0;
@@ -1294,12 +1297,12 @@ const Zi = /* @__PURE__ */ new Set([
1294
1297
  return !(c != null && c.worksheet) || Dt(e, c.worksheet, o.row, o.column) === 1 ? !0 : Ki(e);
1295
1298
  })) : Me(!0);
1296
1299
  }, jn = (e) => {
1297
- const t = wr(e, { workbookTypes: [Ut], worksheetTypes: [Nt, On, Mt], rangeTypes: [Tt] }, !0), n = e.get(Y), i = e.get(Ot), r = e.has(re) ? e.get(re) : null, s = n.focused$.pipe(
1300
+ const t = wr(e, { workbookTypes: [Ut], worksheetTypes: [Nt, On, Mt], rangeTypes: [Tt] }, !0), n = e.get(Y), r = e.get(Ot), i = e.has(re) ? e.get(re) : null, s = n.focused$.pipe(
1298
1301
  un((o) => !!o),
1299
1302
  le((o) => n.getUnit(o, b.UNIVER_SHEET)),
1300
1303
  un((o) => !!o),
1301
1304
  ue((o) => o.activeSheet$),
1302
- ue((o) => i.selectionMoveEnd$.pipe(le((c) => o && { selections: c, sheet: o }))),
1305
+ ue((o) => r.selectionMoveEnd$.pipe(le((c) => o && { selections: c, sheet: o }))),
1303
1306
  le((o) => {
1304
1307
  if (!o)
1305
1308
  return Ue.DISABLED_BY_CELL;
@@ -1312,7 +1315,7 @@ const Zi = /* @__PURE__ */ new Set([
1312
1315
  ue((o) => {
1313
1316
  if (o === Ue.DISABLED_BY_CELL)
1314
1317
  return Me(!0);
1315
- const c = (r ? r.visible$ : Me(null)).pipe(le((p) => p != null && p.visible ? ye : void 0)), u = e.get(Rn).subscribeContextValue$(sr);
1318
+ const c = (i ? i.visible$ : Me(null)).pipe(le((p) => p != null && p.visible ? ye : void 0)), u = e.get(Rn).subscribeContextValue$(sr);
1316
1319
  return ci([c, u]).pipe(
1317
1320
  ue(
1318
1321
  ([p, l]) => p ? l ? Me(!0) : Bt(e, p) : Me(o === Ue.ALLOW_ON_EDITING)
@@ -1360,19 +1363,19 @@ const Zi = /* @__PURE__ */ new Set([
1360
1363
  binding: Lt.K | zr.CTRL_COMMAND,
1361
1364
  preconditions: br
1362
1365
  };
1363
- var Ji = Object.getOwnPropertyDescriptor, Qi = (e, t, n, i) => {
1364
- for (var r = i > 1 ? void 0 : i ? Ji(t, n) : t, s = e.length - 1, o; s >= 0; s--)
1365
- (o = e[s]) && (r = o(r) || r);
1366
- return r;
1367
- }, _n = (e, t) => (n, i) => t(n, i, e);
1366
+ var Ji = Object.getOwnPropertyDescriptor, Qi = (e, t, n, r) => {
1367
+ for (var i = r > 1 ? void 0 : r ? Ji(t, n) : t, s = e.length - 1, o; s >= 0; s--)
1368
+ (o = e[s]) && (i = o(i) || i);
1369
+ return i;
1370
+ }, _n = (e, t) => (n, r) => t(n, r, e);
1368
1371
  let tt = class extends z {
1369
1372
  constructor(e, t) {
1370
1373
  super(), this._autoFillService = e, this._hyperLinkModel = t, this._initAutoFill();
1371
1374
  }
1372
1375
  // eslint-disable-next-line max-lines-per-function
1373
1376
  _initAutoFill() {
1374
- const e = () => ({ redos: [], undos: [] }), t = (i, r) => {
1375
- const { source: s, target: o, unitId: c, subUnitId: u } = i, p = Rt([s, o]), [l, g] = p.ranges, { mapFunc: d } = p, _ = {
1377
+ const e = () => ({ redos: [], undos: [] }), t = (r, i) => {
1378
+ const { source: s, target: o, unitId: c, subUnitId: u } = r, p = Rt([s, o]), [l, g] = p.ranges, { mapFunc: d } = p, _ = {
1376
1379
  row: l.startRow,
1377
1380
  col: l.startColumn
1378
1381
  }, C = Tr(l, g), v = [], w = [];
@@ -1413,7 +1416,7 @@ let tt = class extends z {
1413
1416
  subUnitId: u,
1414
1417
  id: B.id
1415
1418
  }
1416
- }), (Oe.COPY === r || Oe.SERIES === r) && oe && (v.push({
1419
+ }), (Oe.COPY === i || Oe.SERIES === i) && oe && (v.push({
1417
1420
  id: xe.id,
1418
1421
  params: {
1419
1422
  unitId: c,
@@ -1447,7 +1450,7 @@ let tt = class extends z {
1447
1450
  };
1448
1451
  }, n = {
1449
1452
  id: Ht,
1450
- onFillData: (i, r, s) => s === Oe.COPY || s === Oe.ONLY_FORMAT || s === Oe.SERIES ? t(i, s) : e()
1453
+ onFillData: (r, i, s) => s === Oe.COPY || s === Oe.ONLY_FORMAT || s === Oe.SERIES ? t(r, s) : e()
1451
1454
  };
1452
1455
  this.disposeWithMe(this._autoFillService.addHook(n));
1453
1456
  }
@@ -1456,11 +1459,11 @@ tt = Qi([
1456
1459
  _n(0, Or),
1457
1460
  _n(1, R(dt))
1458
1461
  ], tt);
1459
- var eo = Object.getOwnPropertyDescriptor, to = (e, t, n, i) => {
1460
- for (var r = i > 1 ? void 0 : i ? eo(t, n) : t, s = e.length - 1, o; s >= 0; s--)
1461
- (o = e[s]) && (r = o(r) || r);
1462
- return r;
1463
- }, Et = (e, t) => (n, i) => t(n, i, e);
1462
+ var eo = Object.getOwnPropertyDescriptor, to = (e, t, n, r) => {
1463
+ for (var i = r > 1 ? void 0 : r ? eo(t, n) : t, s = e.length - 1, o; s >= 0; s--)
1464
+ (o = e[s]) && (i = o(i) || i);
1465
+ return i;
1466
+ }, Et = (e, t) => (n, r) => t(n, r, e);
1464
1467
  let nt = class extends z {
1465
1468
  constructor(e, t, n) {
1466
1469
  super(), this._localeService = e, this._commandService = t, this._sheetPermissionCheckController = n, this._commandExecutedListener();
@@ -1482,17 +1485,17 @@ nt = to([
1482
1485
  Et(1, ie),
1483
1486
  Et(2, R(Tn))
1484
1487
  ], nt);
1485
- var no = Object.getOwnPropertyDescriptor, ro = (e, t, n, i) => {
1486
- for (var r = i > 1 ? void 0 : i ? no(t, n) : t, s = e.length - 1, o; s >= 0; s--)
1487
- (o = e[s]) && (r = o(r) || r);
1488
- return r;
1489
- }, G = (e, t) => (n, i) => t(n, i, e);
1488
+ var no = Object.getOwnPropertyDescriptor, ro = (e, t, n, r) => {
1489
+ for (var i = r > 1 ? void 0 : r ? no(t, n) : t, s = e.length - 1, o; s >= 0; s--)
1490
+ (o = e[s]) && (i = o(i) || i);
1491
+ return i;
1492
+ }, G = (e, t) => (n, r) => t(n, r, e);
1490
1493
  let rt = class extends z {
1491
- constructor(e, t, n, i, r, s, o, c, u, p) {
1492
- super(), this._hoverManagerService = e, this._sheetsHyperLinkPopupService = t, this._renderManagerService = n, this._permissionService = i, this._sheetPermissionCheckController = r, this._commandService = s, this._editorBridgeService = o, this._textSelectionManagerService = c, this._univerInstanceService = u, this._zenZoneService = p, this._initHoverListener(), this._initCommandListener(), this._initHoverEditingListener(), this._initTextSelectionListener(), this._initZenEditor();
1494
+ constructor(e, t, n, r, i, s, o, c, u, p) {
1495
+ super(), this._hoverManagerService = e, this._sheetsHyperLinkPopupService = t, this._renderManagerService = n, this._permissionService = r, this._sheetPermissionCheckController = i, this._commandService = s, this._editorBridgeService = o, this._textSelectionManagerService = c, this._univerInstanceService = u, this._zenZoneService = p, this._initHoverListener(), this._initCommandListener(), this._initHoverEditingListener(), this._initTextSelectionListener(), this._initZenEditor();
1493
1496
  }
1494
1497
  _getLinkPermission(e) {
1495
- const { unitId: t, subUnitId: n, row: i, col: r } = e, s = this._univerInstanceService.getUnit(t, b.UNIVER_SHEET);
1498
+ const { unitId: t, subUnitId: n, row: r, col: i } = e, s = this._univerInstanceService.getUnit(t, b.UNIVER_SHEET);
1496
1499
  if (!(s == null ? void 0 : s.getSheetBySheetId(n)))
1497
1500
  return {
1498
1501
  viewPermission: !1,
@@ -1503,11 +1506,11 @@ let rt = class extends z {
1503
1506
  workbookTypes: [$r],
1504
1507
  worksheetTypes: [Ar],
1505
1508
  rangeTypes: [Dr]
1506
- }, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }]), u = this._sheetPermissionCheckController.permissionCheckWithRanges({
1509
+ }, [{ startRow: r, startColumn: i, endRow: r, endColumn: i }]), u = this._sheetPermissionCheckController.permissionCheckWithRanges({
1507
1510
  workbookTypes: [Ut],
1508
1511
  worksheetTypes: [Nt, Mt],
1509
1512
  rangeTypes: [Tt]
1510
- }, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }]), p = this._permissionService.composePermission([new Br(t).id, new Vr(t, n).id]).every((l) => l.value);
1513
+ }, [{ startRow: r, startColumn: i, endRow: r, endColumn: i }]), p = this._permissionService.composePermission([new Br(t).id, new Vr(t, n).id]).every((l) => l.value);
1511
1514
  return {
1512
1515
  viewPermission: c,
1513
1516
  editPermission: u,
@@ -1523,7 +1526,7 @@ let rt = class extends z {
1523
1526
  this._sheetsHyperLinkPopupService.hideCurrentPopup();
1524
1527
  return;
1525
1528
  }
1526
- const { unitId: t, subUnitId: n, row: i, col: r } = e, s = this._renderManagerService.getRenderById(t);
1529
+ const { unitId: t, subUnitId: n, row: r, col: i } = e, s = this._renderManagerService.getRenderById(t);
1527
1530
  if (!s)
1528
1531
  return;
1529
1532
  const o = this._univerInstanceService.getUnit(t, b.UNIVER_SHEET), c = o == null ? void 0 : o.getSheetBySheetId(n);
@@ -1533,7 +1536,7 @@ let rt = class extends z {
1533
1536
  this._sheetsHyperLinkPopupService.hideCurrentPopup(m.VIEWING);
1534
1537
  return;
1535
1538
  }
1536
- const p = (O = s == null ? void 0 : s.with(sn).getSkeletonParam(n)) == null ? void 0 : O.skeleton, l = r, g = i;
1539
+ const p = (O = s == null ? void 0 : s.with(sn).getSkeletonParam(n)) == null ? void 0 : O.skeleton, l = i, g = r;
1537
1540
  let d = g, _ = l;
1538
1541
  p && p.overflowCache.forValue(($, D, X) => {
1539
1542
  Ee.contains(X, { startColumn: l, endColumn: l, startRow: g, endRow: g }) && (d = $, _ = D);
@@ -1573,10 +1576,10 @@ let rt = class extends z {
1573
1576
  e == null || e.unsubscribe(), this._sheetsHyperLinkPopupService.hideCurrentPopup(m.EDITING), this._sheetsHyperLinkPopupService.endEditing(m.EDITING);
1574
1577
  return;
1575
1578
  }
1576
- const { editorUnitId: i, unitId: r, sheetId: s, row: o, column: c } = n, u = this._renderManagerService.getRenderById(i);
1579
+ const { editorUnitId: r, unitId: i, sheetId: s, row: o, column: c } = n, u = this._renderManagerService.getRenderById(r);
1577
1580
  if (!u)
1578
1581
  return;
1579
- const { editPermission: p, viewPermission: l, copyPermission: g } = this._getLinkPermission({ unitId: r, subUnitId: s, row: o, col: c }), d = u.with(ln);
1582
+ const { editPermission: p, viewPermission: l, copyPermission: g } = this._getLinkPermission({ unitId: i, subUnitId: s, row: o, col: c }), d = u.with(ln);
1580
1583
  l && (e == null || e.unsubscribe(), e = d.hoverCustomRanges$.pipe(We(200)).subscribe((_) => {
1581
1584
  var k, U;
1582
1585
  const C = _.find((O) => O.range.rangeType === Ge.HYPERLINK);
@@ -1585,11 +1588,11 @@ let rt = class extends z {
1585
1588
  return;
1586
1589
  }
1587
1590
  const v = C.rects[C.rects.length - 1];
1588
- if (!((U = (k = this._renderManagerService.getRenderById(r)) == null ? void 0 : k.with(sn).getSkeletonParam(s)) == null ? void 0 : U.skeleton) || !v)
1591
+ if (!((U = (k = this._renderManagerService.getRenderById(i)) == null ? void 0 : k.with(sn).getSkeletonParam(s)) == null ? void 0 : U.skeleton) || !v)
1589
1592
  return;
1590
1593
  const a = u.engine.getCanvasElement().getBoundingClientRect();
1591
1594
  this._sheetsHyperLinkPopupService.showPopup({
1592
- unitId: r,
1595
+ unitId: i,
1593
1596
  subUnitId: s,
1594
1597
  row: o,
1595
1598
  col: c,
@@ -1624,13 +1627,13 @@ let rt = class extends z {
1624
1627
  });
1625
1628
  })
1626
1629
  ).subscribe((e) => {
1627
- const t = e == null ? void 0 : e.find((i) => i.range.rangeType === Ge.HYPERLINK), n = this._editorBridgeService.getEditCellState();
1630
+ const t = e == null ? void 0 : e.find((r) => r.range.rangeType === Ge.HYPERLINK), n = this._editorBridgeService.getEditCellState();
1628
1631
  if (t && n) {
1629
- const { unitId: i, sheetId: r, row: s, column: o } = n, { editPermission: c, viewPermission: u, copyPermission: p } = this._getLinkPermission({ unitId: i, subUnitId: r, row: s, col: o });
1632
+ const { unitId: r, sheetId: i, row: s, column: o } = n, { editPermission: c, viewPermission: u, copyPermission: p } = this._getLinkPermission({ unitId: r, subUnitId: i, row: s, col: o });
1630
1633
  u && this._sheetsHyperLinkPopupService.showPopup({
1631
1634
  type: m.ZEN_EDITOR,
1632
- unitId: i,
1633
- subUnitId: r,
1635
+ unitId: r,
1636
+ subUnitId: i,
1634
1637
  row: s,
1635
1638
  col: o,
1636
1639
  customRange: t.range,
@@ -1668,11 +1671,11 @@ rt = ro([
1668
1671
  G(8, Y),
1669
1672
  G(9, pt)
1670
1673
  ], rt);
1671
- var io = Object.getOwnPropertyDescriptor, Zn = (e, t, n, i) => {
1672
- for (var r = i > 1 ? void 0 : i ? io(t, n) : t, s = e.length - 1, o; s >= 0; s--)
1673
- (o = e[s]) && (r = o(r) || r);
1674
- return r;
1675
- }, kt = (e, t) => (n, i) => t(n, i, e);
1674
+ var io = Object.getOwnPropertyDescriptor, Zn = (e, t, n, r) => {
1675
+ for (var i = r > 1 ? void 0 : r ? io(t, n) : t, s = e.length - 1, o; s >= 0; s--)
1676
+ (o = e[s]) && (i = o(i) || i);
1677
+ return i;
1678
+ }, kt = (e, t) => (n, r) => t(n, r, e);
1676
1679
  let bt = class extends z {
1677
1680
  constructor(e, t) {
1678
1681
  super(), this._context = e, this._hyperLinkModel = t, this._initSkeletonChange();
@@ -1702,7 +1705,7 @@ let it = class extends z {
1702
1705
  effect: cr.Value,
1703
1706
  priority: 100,
1704
1707
  handler: (e, t, n) => {
1705
- const { row: i, col: r, unitId: s, subUnitId: o } = t, c = this._hyperLinkModel.getHyperLinkByLocation(s, o, i, r);
1708
+ const { row: r, col: i, unitId: s, subUnitId: o } = t, c = this._hyperLinkModel.getHyperLinkByLocation(s, o, r, i);
1706
1709
  return n(c ? {
1707
1710
  ...e,
1708
1711
  linkUrl: c.payload,
@@ -1743,14 +1746,14 @@ const oo = {
1743
1746
  }
1744
1747
  }
1745
1748
  };
1746
- var so = Object.getOwnPropertyDescriptor, ao = (e, t, n, i) => {
1747
- for (var r = i > 1 ? void 0 : i ? so(t, n) : t, s = e.length - 1, o; s >= 0; s--)
1748
- (o = e[s]) && (r = o(r) || r);
1749
- return r;
1750
- }, Te = (e, t) => (n, i) => t(n, i, e);
1749
+ var so = Object.getOwnPropertyDescriptor, ao = (e, t, n, r) => {
1750
+ for (var i = r > 1 ? void 0 : r ? so(t, n) : t, s = e.length - 1, o; s >= 0; s--)
1751
+ (o = e[s]) && (i = o(i) || i);
1752
+ return i;
1753
+ }, Te = (e, t) => (n, r) => t(n, r, e);
1751
1754
  let ot = class extends z {
1752
- constructor(e, t, n, i, r) {
1753
- super(), this._componentManager = e, this._commandService = t, this._menuManagerService = n, this._injector = i, this._shortcutService = r, this._initComponents(), this._initCommands(), this._initMenus(), this._initShortCut();
1755
+ constructor(e, t, n, r, i) {
1756
+ super(), this._componentManager = e, this._commandService = t, this._menuManagerService = n, this._injector = r, this._shortcutService = i, this._initComponents(), this._initCommands(), this._initMenus(), this._initShortCut();
1754
1757
  }
1755
1758
  _initComponents() {
1756
1759
  [
@@ -1785,11 +1788,11 @@ ot = ao([
1785
1788
  Te(3, R(lt)),
1786
1789
  Te(4, R(ti))
1787
1790
  ], ot);
1788
- var co = Object.getOwnPropertyDescriptor, lo = (e, t, n, i) => {
1789
- for (var r = i > 1 ? void 0 : i ? co(t, n) : t, s = e.length - 1, o; s >= 0; s--)
1790
- (o = e[s]) && (r = o(r) || r);
1791
- return r;
1792
- }, Sn = (e, t) => (n, i) => t(n, i, e);
1791
+ var co = Object.getOwnPropertyDescriptor, lo = (e, t, n, r) => {
1792
+ for (var i = r > 1 ? void 0 : r ? co(t, n) : t, s = e.length - 1, o; s >= 0; s--)
1793
+ (o = e[s]) && (i = o(i) || i);
1794
+ return i;
1795
+ }, Sn = (e, t) => (n, r) => t(n, r, e);
1793
1796
  let st = class extends z {
1794
1797
  constructor(e, t) {
1795
1798
  super(), this._parserService = e, this._resolverService = t, this._handleInitUrl();
@@ -1806,20 +1809,20 @@ st = lo([
1806
1809
  Sn(0, R(wt)),
1807
1810
  Sn(1, R(pe))
1808
1811
  ], st);
1809
- var uo = Object.defineProperty, po = Object.getOwnPropertyDescriptor, ho = (e, t, n) => t in e ? uo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, go = (e, t, n, i) => {
1810
- for (var r = i > 1 ? void 0 : i ? po(t, n) : t, s = e.length - 1, o; s >= 0; s--)
1811
- (o = e[s]) && (r = o(r) || r);
1812
- return r;
1813
- }, Cn = (e, t) => (n, i) => t(n, i, e), Gn = (e, t, n) => ho(e, typeof t != "symbol" ? t + "" : t, n);
1812
+ var uo = Object.defineProperty, po = Object.getOwnPropertyDescriptor, ho = (e, t, n) => t in e ? uo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, go = (e, t, n, r) => {
1813
+ for (var i = r > 1 ? void 0 : r ? po(t, n) : t, s = e.length - 1, o; s >= 0; s--)
1814
+ (o = e[s]) && (i = o(i) || i);
1815
+ return i;
1816
+ }, Cn = (e, t) => (n, r) => t(n, r, e), Gn = (e, t, n) => ho(e, typeof t != "symbol" ? t + "" : t, n);
1814
1817
  let at = class extends ur {
1815
1818
  constructor(e = hn, t, n) {
1816
1819
  super(), this._config = e, this._injector = t, this._configService = n;
1817
- const { menu: i, ...r } = dr(
1820
+ const { menu: r, ...i } = dr(
1818
1821
  {},
1819
1822
  hn,
1820
1823
  this._config
1821
1824
  );
1822
- i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Hn, r);
1825
+ r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(Hn, i);
1823
1826
  }
1824
1827
  onStarting() {
1825
1828
  [