@univerjs/find-replace 0.5.0 → 0.5.1

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,91 +1,91 @@
1
- var at = Object.defineProperty;
2
- var ot = (i, e, n) => e in i ? at(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
- var o = (i, e, n) => ot(i, typeof e != "symbol" ? e + "" : e, n);
4
- import { createIdentifier as ct, Inject as y, Injector as X, Disposable as ee, IUniverInstanceService as pe, IContextService as te, DisposableCollection as lt, toDisposable as A, CommandType as x, LocaleService as U, useDependency as v, ICommandService as ie, FOCUSING_SHEET as _e, EDITOR_ACTIVATED as ge, UniverInstanceType as dt, RxDisposable as ht, Plugin as ut, IConfigService as ft } from "@univerjs/core";
5
- import { IConfirmService as pt, IMessageService as me, useObservable as I, ILayoutService as ve, KeyCode as M, MetaKeys as b, MenuItemType as _t, getMenuHiddenObservable as gt, RibbonStartGroup as mt, ComponentManager as vt, IMenuManagerService as St, IShortcutService as Ct, IDialogService as Rt } from "@univerjs/ui";
6
- import { throttleTime as Mt, BehaviorSubject as D, combineLatest as Se, debounceTime as bt, Subject as Ce, fromEvent as xt, map as yt, takeUntil as ce } from "rxjs";
7
- import { MessageType as E, InputWithSlot as It, Pager as Dt, Button as N, FormLayout as R, Input as Ft, Select as V, FormDualColumnLayout as le, Checkbox as de } from "@univerjs/design";
8
- import { RENDER_RAW_FORMULA_KEY as Pt } from "@univerjs/engine-render";
9
- import Ot, { forwardRef as B, useRef as q, createElement as Re, useCallback as u, Fragment as $, useEffect as L, useMemo as ne, useImperativeHandle as Tt } from "react";
10
- const Et = "find-replace.config", Nt = {};
11
- var _ = function() {
12
- return _ = Object.assign || function(i) {
13
- for (var e, n = 1, t = arguments.length; n < t; n++) {
1
+ var ot = Object.defineProperty;
2
+ var ct = (t, e, n) => e in t ? ot(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var o = (t, e, n) => ct(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { createIdentifier as lt, Inject as D, Injector as ee, Disposable as te, IUniverInstanceService as me, IContextService as ie, DisposableCollection as dt, toDisposable as L, CommandType as y, LocaleService as B, useDependency as C, ICommandService as ne, FOCUSING_SHEET as ve, EDITOR_ACTIVATED as Se, UniverInstanceType as ht, RxDisposable as ut, Plugin as ft, IConfigService as pt } from "@univerjs/core";
5
+ import { IConfirmService as _t, IMessageService as Ce, useObservable as F, ILayoutService as Re, KeyCode as b, MetaKeys as x, MenuItemType as gt, getMenuHiddenObservable as mt, RibbonStartGroup as vt, ComponentManager as St, IMenuManagerService as Ct, IShortcutService as Rt, IDialogService as Mt } from "@univerjs/ui";
6
+ import { throttleTime as bt, BehaviorSubject as P, combineLatest as Me, debounceTime as xt, Subject as be, fromEvent as yt, map as It, takeUntil as le } from "rxjs";
7
+ import { MessageType as N, InputWithSlot as Dt, Pager as Ft, Button as $, FormLayout as M, Input as Pt, Select as V, FormDualColumnLayout as de, Checkbox as he } from "@univerjs/design";
8
+ import { RENDER_RAW_FORMULA_KEY as Ot } from "@univerjs/engine-render";
9
+ import Tt, { forwardRef as W, useRef as J, createElement as xe, useCallback as p, Fragment as A, useEffect as j, useMemo as re, useImperativeHandle as Et } from "react";
10
+ const Nt = "find-replace.config", $t = {};
11
+ var g = function() {
12
+ return g = Object.assign || function(t) {
13
+ for (var e, n = 1, i = arguments.length; n < i; n++) {
14
14
  e = arguments[n];
15
- for (var s in e) Object.prototype.hasOwnProperty.call(e, s) && (i[s] = e[s]);
15
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
16
16
  }
17
- return i;
18
- }, _.apply(this, arguments);
19
- }, $t = function(i, e) {
17
+ return t;
18
+ }, g.apply(this, arguments);
19
+ }, At = function(t, e) {
20
20
  var n = {};
21
- for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
22
- if (i != null && typeof Object.getOwnPropertySymbols == "function")
23
- for (var s = 0, t = Object.getOwnPropertySymbols(i); s < t.length; s++)
24
- e.indexOf(t[s]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[s]) && (n[t[s]] = i[t[s]]);
21
+ for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
22
+ if (t != null && typeof Object.getOwnPropertySymbols == "function")
23
+ for (var r = 0, i = Object.getOwnPropertySymbols(t); r < i.length; r++)
24
+ e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[r]) && (n[i[r]] = t[i[r]]);
25
25
  return n;
26
- }, Me = B(function(i, e) {
27
- var n = i.icon, t = i.id, s = i.className, r = i.extend, a = $t(i, ["icon", "id", "className", "extend"]), l = "univerjs-icon univerjs-icon-".concat(t, " ").concat(s || "").trim(), d = q("_".concat(jt()));
28
- return be(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, _({ ref: e, className: l }, a), r);
26
+ }, ye = W(function(t, e) {
27
+ var n = t.icon, i = t.id, r = t.className, s = t.extend, a = At(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), l = J("_".concat(wt()));
28
+ return Ie(n, "".concat(i), { defIds: n.defIds, idSuffix: l.current }, g({ ref: e, className: c }, a), s);
29
29
  });
30
- function be(i, e, n, t, s) {
31
- return Re(i.tag, _(_({ key: e }, At(i, n, s)), t), (Lt(i, n).children || []).map(function(r, a) {
32
- return be(r, "".concat(e, "-").concat(i.tag, "-").concat(a), n, void 0, s);
30
+ function Ie(t, e, n, i, r) {
31
+ return xe(t.tag, g(g({ key: e }, Lt(t, n, r)), i), (jt(t, n).children || []).map(function(s, a) {
32
+ return Ie(s, "".concat(e, "-").concat(t.tag, "-").concat(a), n, void 0, r);
33
33
  }));
34
34
  }
35
- function At(i, e, n) {
36
- var t = _({}, i.attrs);
37
- n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
38
- var s = e.defIds;
39
- return !s || s.length === 0 || (i.tag === "use" && t["xlink:href"] && (t["xlink:href"] = t["xlink:href"] + e.idSuffix), Object.entries(t).forEach(function(r) {
40
- var a = r[0], l = r[1];
41
- typeof l == "string" && (t[a] = l.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
42
- })), t;
35
+ function Lt(t, e, n) {
36
+ var i = g({}, t.attrs);
37
+ n != null && n.colorChannel1 && i.fill === "colorChannel1" && (i.fill = n.colorChannel1);
38
+ var r = e.defIds;
39
+ return !r || r.length === 0 || (t.tag === "use" && i["xlink:href"] && (i["xlink:href"] = i["xlink:href"] + e.idSuffix), Object.entries(i).forEach(function(s) {
40
+ var a = s[0], c = s[1];
41
+ typeof c == "string" && (i[a] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
42
+ })), i;
43
43
  }
44
- function Lt(i, e) {
45
- var n, t = e.defIds;
46
- return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? _(_({}, i), { children: i.children.map(function(s) {
47
- return typeof s.attrs.id == "string" && t && t.indexOf(s.attrs.id) > -1 ? _(_({}, s), { attrs: _(_({}, s.attrs), { id: s.attrs.id + e.idSuffix }) }) : s;
48
- }) }) : i;
44
+ function jt(t, e) {
45
+ var n, i = e.defIds;
46
+ return !i || i.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? g(g({}, t), { children: t.children.map(function(r) {
47
+ return typeof r.attrs.id == "string" && i && i.indexOf(r.attrs.id) > -1 ? g(g({}, r), { attrs: g(g({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
48
+ }) }) : t;
49
49
  }
50
- function jt() {
50
+ function wt() {
51
51
  return Math.random().toString(36).substring(2, 8);
52
52
  }
53
- Me.displayName = "UniverIcon";
54
- var wt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_217_40", style: { maskType: "alpha" }, width: 17, height: 17, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0.9 0.09H16.9V16.09H0.9z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_217_40)" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.39551 7.37266C2.39551 4.18105 4.98281 1.59375 8.17441 1.59375C11.366 1.59375 13.9533 4.18105 13.9533 7.37266C13.9533 8.72342 13.4898 9.96603 12.7133 10.95L15.1964 13.4331C15.4619 13.6986 15.4619 14.1291 15.1964 14.3946C14.9309 14.6601 14.5004 14.6601 14.2349 14.3946L11.7518 11.9115C10.7678 12.6881 9.52525 13.1516 8.17441 13.1516C4.98281 13.1516 2.39551 10.5642 2.39551 7.37266ZM8.17441 2.95349C5.73378 2.95349 3.75525 4.93202 3.75525 7.37266C3.75525 9.81333 5.73378 11.7918 8.17441 11.7918C10.6151 11.7918 12.5936 9.81333 12.5936 7.37266C12.5936 4.93202 10.6151 2.95349 8.17441 2.95349Z", fillRule: "evenodd", clipRule: "evenodd" } }] }] }, xe = B(function(i, e) {
55
- return Re(Me, Object.assign({}, i, {
53
+ ye.displayName = "UniverIcon";
54
+ var Ut = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_217_40", style: { maskType: "alpha" }, width: 17, height: 17, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0.9 0.09H16.9V16.09H0.9z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_217_40)" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.39551 7.37266C2.39551 4.18105 4.98281 1.59375 8.17441 1.59375C11.366 1.59375 13.9533 4.18105 13.9533 7.37266C13.9533 8.72342 13.4898 9.96603 12.7133 10.95L15.1964 13.4331C15.4619 13.6986 15.4619 14.1291 15.1964 14.3946C14.9309 14.6601 14.5004 14.6601 14.2349 14.3946L11.7518 11.9115C10.7678 12.6881 9.52525 13.1516 8.17441 13.1516C4.98281 13.1516 2.39551 10.5642 2.39551 7.37266ZM8.17441 2.95349C5.73378 2.95349 3.75525 4.93202 3.75525 7.37266C3.75525 9.81333 5.73378 11.7918 8.17441 11.7918C10.6151 11.7918 12.5936 9.81333 12.5936 7.37266C12.5936 4.93202 10.6151 2.95349 8.17441 2.95349Z", fillRule: "evenodd", clipRule: "evenodd" } }] }] }, De = W(function(t, e) {
55
+ return xe(ye, Object.assign({}, t, {
56
56
  id: "search-single-16",
57
57
  ref: e,
58
- icon: wt
58
+ icon: Ut
59
59
  }));
60
60
  });
61
- xe.displayName = "SearchSingle16";
62
- const ye = "FIND_REPLACE_INPUT_FOCUS", Ie = "FIND_REPLACE_DIALOG_FOCUS", De = "FIND_REPLACE_REPLACE_REVEALED";
63
- var Ut = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, Fe = (i, e, n, t) => {
64
- for (var s = t > 1 ? void 0 : t ? Bt(e, n) : e, r = i.length - 1, a; r >= 0; r--)
65
- (a = i[r]) && (s = (t ? a(e, n, s) : a(s)) || s);
66
- return t && s && Ut(e, n, s), s;
67
- }, K = (i, e) => (n, t) => e(n, t, i);
68
- class Ei extends ee {
61
+ De.displayName = "SearchSingle16";
62
+ const Fe = "FIND_REPLACE_INPUT_FOCUS", Pe = "FIND_REPLACE_DIALOG_FOCUS", Oe = "FIND_REPLACE_REPLACE_REVEALED";
63
+ var Bt = Object.defineProperty, Wt = Object.getOwnPropertyDescriptor, Te = (t, e, n, i) => {
64
+ for (var r = i > 1 ? void 0 : i ? Wt(e, n) : e, s = t.length - 1, a; s >= 0; s--)
65
+ (a = t[s]) && (r = (i ? a(e, n, r) : a(r)) || r);
66
+ return i && r && Bt(e, n, r), r;
67
+ }, K = (t, e) => (n, i) => e(n, i, t);
68
+ class Pi extends te {
69
69
  }
70
- const g = ct("find-replace.service");
71
- function Wt(i) {
72
- return typeof i.findString < "u" || typeof i.inputtingFindString < "u" || typeof i.findDirection < "u" || typeof i.matchesTheWholeCell < "u" || typeof i.caseSensitive < "u" || typeof i.findScope < "u" || typeof i.findBy < "u";
70
+ const m = lt("find-replace.service");
71
+ function Gt(t) {
72
+ return typeof t.findString < "u" || typeof t.inputtingFindString < "u" || typeof t.findDirection < "u" || typeof t.matchesTheWholeCell < "u" || typeof t.caseSensitive < "u" || typeof t.findScope < "u" || typeof t.findBy < "u";
73
73
  }
74
- let z = class extends ee {
75
- constructor(e, n, t) {
74
+ let z = class extends te {
75
+ constructor(e, n, i) {
76
76
  super();
77
- o(this, "currentMatch$", new D(null));
78
- o(this, "replaceables$", new D([]));
77
+ o(this, "currentMatch$", new P(null));
78
+ o(this, "replaceables$", new P([]));
79
79
  /** All find models returned by providers. */
80
80
  o(this, "_findModels", []);
81
81
  /** The find model that the current match is from. */
82
82
  o(this, "_matchingModel", null);
83
83
  o(this, "_matches", []);
84
84
  o(this, "_currentSearchingDisposables", null);
85
- this._state = e, this._providers = n, this._univerInstanceService = t, this.disposeWithMe(
86
- this._state.stateUpdates$.pipe(Mt(200, void 0, { leading: !0, trailing: !0 })).subscribe(async (s) => {
87
- const r = this._state.state;
88
- Wt(s) && (r.findString !== "" && !r.replaceRevealed ? (await this._startSearching(), this._state.changeState({ findCompleted: !0 })) : s.replaceRevealed !== !0 && this._stopSearching());
85
+ this._state = e, this._providers = n, this._univerInstanceService = i, this.disposeWithMe(
86
+ this._state.stateUpdates$.pipe(bt(200, void 0, { leading: !0, trailing: !0 })).subscribe(async (r) => {
87
+ const s = this._state.state;
88
+ Gt(r) && (s.findString !== "" && !s.replaceRevealed ? (await this._startSearching(), this._state.changeState({ findCompleted: !0 })) : r.replaceRevealed !== !0 && this._stopSearching());
89
89
  })
90
90
  );
91
91
  }
@@ -105,7 +105,7 @@ let z = class extends ee {
105
105
  async _startSearching() {
106
106
  if (!this._state.findString)
107
107
  return { results: [] };
108
- const e = Array.from(this._providers), n = this._findModels = (await Promise.all(e.map((s) => s.find({
108
+ const e = Array.from(this._providers), n = this._findModels = (await Promise.all(e.map((r) => r.find({
109
109
  findString: this._state.findString,
110
110
  findDirection: this._state.findDirection,
111
111
  findScope: this._state.findScope,
@@ -115,8 +115,8 @@ let z = class extends ee {
115
115
  matchesTheWholeCell: this._state.matchesTheWholeCell
116
116
  })))).flat();
117
117
  this._subscribeToModelsChanges(n);
118
- const t = this._matches = n.map((s) => s.getMatches()).flat();
119
- return this.replaceables$.next(t.filter((s) => s.replaceable)), t.length ? (this._moveToInitialMatch(n), this._state.changeState({ matchesCount: t.length }), { results: t }) : (this._state.changeState({ matchesCount: 0, matchesPosition: 0 }), { results: [] });
118
+ const i = this._matches = n.map((r) => r.getMatches()).flat();
119
+ return this.replaceables$.next(i.filter((r) => r.replaceable)), i.length ? (this._moveToInitialMatch(n), this._state.changeState({ matchesCount: i.length }), { results: i }) : (this._state.changeState({ matchesCount: 0, matchesPosition: 0 }), { results: [] });
120
120
  }
121
121
  /** Terminate the current searching session, when searching string is empty. */
122
122
  _stopSearching() {
@@ -129,27 +129,27 @@ let z = class extends ee {
129
129
  }
130
130
  // When a document's content changes, we should reset all matches and try to move to the next match.
131
131
  _subscribeToModelsChanges(e) {
132
- const n = this._currentSearchingDisposables = new lt(), t = Se(e.map((s) => s.matchesUpdate$)).pipe(bt(220)).subscribe(([...s]) => {
133
- const r = this._matches = s.flat();
134
- r.length ? (this._moveToInitialMatch(this._findModels, !0), this._state.changeState({ matchesCount: r.length }), this.replaceables$.next(r.filter((a) => a.replaceable))) : (this._state.changeState({ matchesCount: 0, matchesPosition: 0 }), this.replaceables$.next([]));
132
+ const n = this._currentSearchingDisposables = new dt(), i = Me(e.map((r) => r.matchesUpdate$)).pipe(xt(220)).subscribe(([...r]) => {
133
+ const s = this._matches = r.flat();
134
+ s.length ? (this._moveToInitialMatch(this._findModels, !0), this._state.changeState({ matchesCount: s.length }), this.replaceables$.next(s.filter((a) => a.replaceable))) : (this._state.changeState({ matchesCount: 0, matchesPosition: 0 }), this.replaceables$.next([]));
135
135
  });
136
- e.forEach((s) => n.add(A(s.activelyChangingMatch$.subscribe((r) => {
137
- const a = this._matches.findIndex((l) => l === r);
136
+ e.forEach((r) => n.add(L(r.activelyChangingMatch$.subscribe((s) => {
137
+ const a = this._matches.findIndex((c) => c === s);
138
138
  this._state.changeState({ matchesPosition: a + 1 });
139
- })))), n.add(A(t));
139
+ })))), n.add(L(i));
140
140
  }
141
141
  async replace() {
142
142
  return this._matchingModel ? this._matchingModel.replace(this._state.replaceString) : !1;
143
143
  }
144
144
  async replaceAll() {
145
- const e = await Promise.all(this._findModels.map((n) => n.replaceAll(this._state.replaceString))).then((n) => n.reduce((t, s) => (t.success += s.success, t.failure += s.failure, t), { success: 0, failure: 0 }));
145
+ const e = await Promise.all(this._findModels.map((n) => n.replaceAll(this._state.replaceString))).then((n) => n.reduce((i, r) => (i.success += r.success, i.failure += r.failure, i), { success: 0, failure: 0 }));
146
146
  return e.failure === 0 && this._stopSearching(), e;
147
147
  }
148
148
  getCurrentMatch() {
149
149
  return this._state.matchesPosition > 0 ? this._matches[this._state.matchesPosition - 1] : null;
150
150
  }
151
151
  _markMatch(e) {
152
- const n = this._matches.findIndex((t) => t === e);
152
+ const n = this._matches.findIndex((i) => i === e);
153
153
  this.currentMatch$.next(e), this._state.changeState({ matchesPosition: n + 1 });
154
154
  }
155
155
  moveToNextMatch() {
@@ -159,23 +159,23 @@ let z = class extends ee {
159
159
  if (n)
160
160
  this._markMatch(n);
161
161
  else {
162
- const t = this._findModels.findIndex((s) => s === this._matchingModel);
163
- this._moveToNextUnitMatch(t);
162
+ const i = this._findModels.findIndex((r) => r === this._matchingModel);
163
+ this._moveToNextUnitMatch(i);
164
164
  }
165
165
  }
166
166
  _moveToNextUnitMatch(e) {
167
167
  const n = this._findModels.length;
168
- for (let t = (e + 1) % n; t !== e; ) {
169
- const s = this._findModels[t], r = s.moveToNextMatch({ ignoreSelection: !0 });
170
- if (r) {
171
- this._matchingModel = s, this._markMatch(r);
168
+ for (let i = (e + 1) % n; i !== e; ) {
169
+ const r = this._findModels[i], s = r.moveToNextMatch({ ignoreSelection: !0 });
170
+ if (s) {
171
+ this._matchingModel = r, this._markMatch(s);
172
172
  return;
173
173
  }
174
- t = (t + 1) % n;
174
+ i = (i + 1) % n;
175
175
  }
176
176
  if (this._matchingModel) {
177
- const t = this._matchingModel.moveToNextMatch({ ignoreSelection: !0 });
178
- t && this._markMatch(t);
177
+ const i = this._matchingModel.moveToNextMatch({ ignoreSelection: !0 });
178
+ i && this._markMatch(i);
179
179
  }
180
180
  }
181
181
  moveToPreviousMatch() {
@@ -183,41 +183,41 @@ let z = class extends ee {
183
183
  return;
184
184
  const e = this._findModels.length === 1, n = this._matchingModel.moveToPreviousMatch({ loop: e });
185
185
  if (n) {
186
- const t = this._matches.findIndex((s) => s === n);
187
- this.currentMatch$.next(n), this._state.changeState({ matchesPosition: t + 1 });
186
+ const i = this._matches.findIndex((r) => r === n);
187
+ this.currentMatch$.next(n), this._state.changeState({ matchesPosition: i + 1 });
188
188
  } else {
189
- const t = this._findModels.length, s = this._findModels.findIndex((a) => a === this._matchingModel);
190
- for (let a = (s - 1 + t) % t; a !== s; ) {
191
- const l = this._findModels[a], d = l.moveToPreviousMatch({ ignoreSelection: !0 });
192
- if (d) {
193
- this._matchingModel = l, this._markMatch(d);
189
+ const i = this._findModels.length, r = this._findModels.findIndex((a) => a === this._matchingModel);
190
+ for (let a = (r - 1 + i) % i; a !== r; ) {
191
+ const c = this._findModels[a], l = c.moveToPreviousMatch({ ignoreSelection: !0 });
192
+ if (l) {
193
+ this._matchingModel = c, this._markMatch(l);
194
194
  return;
195
195
  }
196
- a = (a - 1) % t;
196
+ a = (a - 1) % i;
197
197
  }
198
- const r = this._matchingModel.moveToPreviousMatch({ ignoreSelection: !0 });
199
- r && this._markMatch(r);
198
+ const s = this._matchingModel.moveToPreviousMatch({ ignoreSelection: !0 });
199
+ s && this._markMatch(s);
200
200
  }
201
201
  }
202
202
  _moveToInitialMatch(e, n = !1) {
203
- var r;
204
- const t = (r = this._univerInstanceService.getFocusedUnit()) == null ? void 0 : r.getUnitId();
205
- if (!t)
203
+ var s;
204
+ const i = (s = this._univerInstanceService.getFocusedUnit()) == null ? void 0 : s.getUnitId();
205
+ if (!i)
206
206
  return -1;
207
- const s = e.findIndex((a) => a.unitId === t);
208
- if (s !== -1) {
209
- this._matchingModel = e[s];
207
+ const r = e.findIndex((a) => a.unitId === i);
208
+ if (r !== -1) {
209
+ this._matchingModel = e[r];
210
210
  const a = this._matchingModel.moveToNextMatch({ stayIfOnMatch: !0, noFocus: n });
211
211
  if (a)
212
- return this._markMatch(a), s;
212
+ return this._markMatch(a), r;
213
213
  }
214
- return this._moveToNextUnitMatch(s), 0;
214
+ return this._moveToNextUnitMatch(r), 0;
215
215
  }
216
216
  };
217
- z = Fe([
218
- K(2, pe)
217
+ z = Te([
218
+ K(2, me)
219
219
  ], z);
220
- var Y = /* @__PURE__ */ ((i) => (i.ROW = "row", i.COLUMN = "column", i))(Y || {}), Z = /* @__PURE__ */ ((i) => (i.VALUE = "value", i.FORMULA = "formula", i))(Z || {}), J = /* @__PURE__ */ ((i) => (i.SUBUNIT = "subunit", i.UNIT = "unit", i))(J || {});
220
+ var Y = /* @__PURE__ */ ((t) => (t.ROW = "row", t.COLUMN = "column", t))(Y || {}), Z = /* @__PURE__ */ ((t) => (t.VALUE = "value", t.FORMULA = "formula", t))(Z || {}), Q = /* @__PURE__ */ ((t) => (t.SUBUNIT = "subunit", t.UNIT = "unit", t))(Q || {});
221
221
  function se() {
222
222
  return {
223
223
  caseSensitive: !1,
@@ -235,11 +235,11 @@ function se() {
235
235
  revealed: !0
236
236
  };
237
237
  }
238
- class Gt {
238
+ class kt {
239
239
  constructor() {
240
- o(this, "_stateUpdates$", new Ce());
240
+ o(this, "_stateUpdates$", new be());
241
241
  o(this, "stateUpdates$", this._stateUpdates$.asObservable());
242
- o(this, "_state$", new D(se()));
242
+ o(this, "_state$", new P(se()));
243
243
  o(this, "state$", this._state$.asObservable());
244
244
  o(this, "_findString", "");
245
245
  o(this, "_inputtingFindString", "");
@@ -300,8 +300,8 @@ class Gt {
300
300
  // eslint-disable-next-line max-lines-per-function, complexity
301
301
  changeState(e) {
302
302
  let n = !1;
303
- const t = {};
304
- typeof e.findString < "u" && e.findString !== this._findString && (this._findString = e.findString, t.findString = this._findString, n = !0), typeof e.revealed < "u" && e.revealed !== this._revealed && (this._revealed = e.revealed, t.revealed = e.revealed, n = !0), typeof e.replaceRevealed < "u" && e.replaceRevealed !== this._replaceRevealed && (this._replaceRevealed = e.replaceRevealed, t.replaceRevealed = e.replaceRevealed, n = !0), typeof e.replaceString < "u" && e.replaceString !== this._replaceString && (this._replaceString = e.replaceString, t.replaceString = e.replaceString, n = !0), typeof e.matchesCount < "u" && e.matchesCount !== this._matchesCount && (this._matchesCount = e.matchesCount, t.matchesCount = e.matchesCount, n = !0), typeof e.matchesPosition < "u" && e.matchesPosition !== this._matchesPosition && (this._matchesPosition = e.matchesPosition, t.matchesPosition = e.matchesPosition, n = !0), typeof e.findBy < "u" && e.findBy !== this._findBy && (this._findBy = e.findBy, t.findBy = e.findBy, n = !0), typeof e.findScope < "u" && e.findScope !== this._findScope && (this._findScope = e.findScope, t.findScope = e.findScope, n = !0), typeof e.findDirection < "u" && e.findDirection !== this._findDirection && (this._findDirection = e.findDirection, t.findDirection = e.findDirection, n = !0), typeof e.caseSensitive < "u" && e.caseSensitive !== this._caseSensitive && (this._caseSensitive = e.caseSensitive, t.caseSensitive = e.caseSensitive, n = !0), typeof e.matchesTheWholeCell < "u" && e.matchesTheWholeCell !== this._matchesTheWholeCell && (this._matchesTheWholeCell = e.matchesTheWholeCell, t.matchesTheWholeCell = e.matchesTheWholeCell, n = !0), typeof e.inputtingFindString < "u" && e.inputtingFindString !== this._inputtingFindString && (this._inputtingFindString = e.inputtingFindString, t.inputtingFindString = e.inputtingFindString, n = !0), typeof e.findCompleted < "u" && e.findCompleted !== this._findCompleted && (this._findCompleted = e.findCompleted, t.findCompleted = e.findCompleted, n = !0), n && (this._state$.next({
303
+ const i = {};
304
+ typeof e.findString < "u" && e.findString !== this._findString && (this._findString = e.findString, i.findString = this._findString, n = !0), typeof e.revealed < "u" && e.revealed !== this._revealed && (this._revealed = e.revealed, i.revealed = e.revealed, n = !0), typeof e.replaceRevealed < "u" && e.replaceRevealed !== this._replaceRevealed && (this._replaceRevealed = e.replaceRevealed, i.replaceRevealed = e.replaceRevealed, n = !0), typeof e.replaceString < "u" && e.replaceString !== this._replaceString && (this._replaceString = e.replaceString, i.replaceString = e.replaceString, n = !0), typeof e.matchesCount < "u" && e.matchesCount !== this._matchesCount && (this._matchesCount = e.matchesCount, i.matchesCount = e.matchesCount, n = !0), typeof e.matchesPosition < "u" && e.matchesPosition !== this._matchesPosition && (this._matchesPosition = e.matchesPosition, i.matchesPosition = e.matchesPosition, n = !0), typeof e.findBy < "u" && e.findBy !== this._findBy && (this._findBy = e.findBy, i.findBy = e.findBy, n = !0), typeof e.findScope < "u" && e.findScope !== this._findScope && (this._findScope = e.findScope, i.findScope = e.findScope, n = !0), typeof e.findDirection < "u" && e.findDirection !== this._findDirection && (this._findDirection = e.findDirection, i.findDirection = e.findDirection, n = !0), typeof e.caseSensitive < "u" && e.caseSensitive !== this._caseSensitive && (this._caseSensitive = e.caseSensitive, i.caseSensitive = e.caseSensitive, n = !0), typeof e.matchesTheWholeCell < "u" && e.matchesTheWholeCell !== this._matchesTheWholeCell && (this._matchesTheWholeCell = e.matchesTheWholeCell, i.matchesTheWholeCell = e.matchesTheWholeCell, n = !0), typeof e.inputtingFindString < "u" && e.inputtingFindString !== this._inputtingFindString && (this._inputtingFindString = e.inputtingFindString, i.inputtingFindString = e.inputtingFindString, n = !0), typeof e.findCompleted < "u" && e.findCompleted !== this._findCompleted && (this._findCompleted = e.findCompleted, i.findCompleted = e.findCompleted, n = !0), n && (this._state$.next({
305
305
  caseSensitive: this._caseSensitive,
306
306
  findBy: this._findBy,
307
307
  findCompleted: this._findCompleted,
@@ -314,20 +314,20 @@ class Gt {
314
314
  matchesTheWholeCell: this._matchesTheWholeCell,
315
315
  replaceRevealed: this._replaceRevealed,
316
316
  revealed: this._revealed
317
- }), this._stateUpdates$.next(t));
317
+ }), this._stateUpdates$.next(i));
318
318
  }
319
319
  }
320
- let Q = class extends ee {
320
+ let X = class extends te {
321
321
  constructor(e, n) {
322
322
  super();
323
323
  o(this, "_providers", /* @__PURE__ */ new Set());
324
- o(this, "_state", new Gt());
324
+ o(this, "_state", new kt());
325
325
  o(this, "_model");
326
- o(this, "_currentMatch$", new D(null));
326
+ o(this, "_currentMatch$", new P(null));
327
327
  o(this, "currentMatch$", this._currentMatch$.asObservable());
328
- o(this, "_replaceables$", new D([]));
328
+ o(this, "_replaceables$", new P([]));
329
329
  o(this, "replaceables$", this._replaceables$.asObservable());
330
- o(this, "_focusSignal$", new Ce());
330
+ o(this, "_focusSignal$", new be());
331
331
  o(this, "focusSignal$", this._focusSignal$.asObservable());
332
332
  this._injector = e, this._contextService = n;
333
333
  }
@@ -403,7 +403,7 @@ let Q = class extends ee {
403
403
  start(e = !1) {
404
404
  if (this._providers.size === 0)
405
405
  return !1;
406
- this._model = this._injector.createInstance(z, this._state, this._providers), this._model.currentMatch$.subscribe((t) => this._currentMatch$.next(t)), this._model.replaceables$.subscribe((t) => this._replaceables$.next(t));
406
+ this._model = this._injector.createInstance(z, this._state, this._providers), this._model.currentMatch$.subscribe((i) => this._currentMatch$.next(i)), this._model.replaceables$.subscribe((i) => this._replaceables$.next(i));
407
407
  const n = se();
408
408
  return e && (n.replaceRevealed = !0), this._state.changeState(n), this._toggleRevealReplace(e), !0;
409
409
  }
@@ -416,71 +416,71 @@ let Q = class extends ee {
416
416
  (e = this._model) == null || e.dispose(), this._model = null, this._toggleDisplayRawFormula(!1), this._toggleRevealReplace(!1);
417
417
  }
418
418
  registerFindReplaceProvider(e) {
419
- return this._providers.add(e), A(() => this._providers.delete(e));
419
+ return this._providers.add(e), L(() => this._providers.delete(e));
420
420
  }
421
421
  _toggleRevealReplace(e) {
422
- this._contextService.setContextValue(De, e);
422
+ this._contextService.setContextValue(Oe, e);
423
423
  }
424
424
  _toggleDisplayRawFormula(e) {
425
- this._contextService.setContextValue(Pt, e);
425
+ this._contextService.setContextValue(Ot, e);
426
426
  }
427
427
  };
428
- Q = Fe([
429
- K(0, y(X)),
430
- K(1, te)
431
- ], Q);
432
- const Pe = {
428
+ X = Te([
429
+ K(0, D(ee)),
430
+ K(1, ie)
431
+ ], X);
432
+ const Ee = {
433
433
  id: "ui.command.replace-current-match",
434
- type: x.COMMAND,
435
- handler: (i) => i.get(g).replace()
436
- }, kt = "CONFIRM_REPLACE_ALL", Oe = {
434
+ type: y.COMMAND,
435
+ handler: (t) => t.get(m).replace()
436
+ }, Vt = "CONFIRM_REPLACE_ALL", Ne = {
437
437
  id: "ui.command.replace-all-matches",
438
- type: x.COMMAND,
439
- handler: async (i) => {
440
- const e = i.get(pt), n = i.get(U), t = i.get(me);
438
+ type: y.COMMAND,
439
+ handler: async (t) => {
440
+ const e = t.get(_t), n = t.get(B), i = t.get(Ce);
441
441
  if (!await e.confirm({
442
- id: kt,
442
+ id: Vt,
443
443
  title: { title: n.t("find-replace.replace.confirm.title") },
444
444
  cancelText: n.t("button.cancel"),
445
445
  confirmText: n.t("button.confirm")
446
446
  }))
447
447
  return !1;
448
- const r = await i.get(g).replaceAll(), { success: a, failure: l } = r;
449
- return l > 0 ? (a === 0 ? t.show({
450
- type: E.Error,
448
+ const s = await t.get(m).replaceAll(), { success: a, failure: c } = s;
449
+ return c > 0 ? (a === 0 ? i.show({
450
+ type: N.Error,
451
451
  content: n.t("find-replace.replace.all-failure")
452
- }) : t.show({
453
- type: E.Warning,
454
- content: n.t("find-replace.replace.partial-success", `${a}`, `${l}`)
455
- }), !1) : (t.show({
456
- type: E.Success,
452
+ }) : i.show({
453
+ type: N.Warning,
454
+ content: n.t("find-replace.replace.partial-success", `${a}`, `${c}`)
455
+ }), !1) : (i.show({
456
+ type: N.Success,
457
457
  content: n.t("find-replace.replace.all-success", `${a}`)
458
458
  }), !0);
459
459
  }
460
- }, F = {
460
+ }, O = {
461
461
  id: "ui.operation.open-find-dialog",
462
- type: x.OPERATION,
463
- handler: (i) => {
464
- const e = i.get(g);
462
+ type: y.OPERATION,
463
+ handler: (t) => {
464
+ const e = t.get(m);
465
465
  return e.revealed ? e.focusFindInput() : e.start(), !0;
466
466
  }
467
- }, re = {
467
+ }, ae = {
468
468
  id: "ui.operation.open-replace-dialog",
469
- type: x.OPERATION,
470
- handler: (i) => {
471
- const e = i.get(g);
469
+ type: y.OPERATION,
470
+ handler: (t) => {
471
+ const e = t.get(m);
472
472
  return e.revealed ? e.replaceRevealed ? e.focusFindInput() : e.revealReplace() : e.start(!0), !0;
473
473
  }
474
- }, Te = {
475
- type: x.OPERATION,
474
+ }, $e = {
475
+ type: y.OPERATION,
476
476
  id: "ui.operation.go-to-next-match",
477
- handler: (i) => (i.get(g).moveToNextMatch(), !0)
478
- }, Ee = {
479
- type: x.OPERATION,
477
+ handler: (t) => (t.get(m).moveToNextMatch(), !0)
478
+ }, Ae = {
479
+ type: y.OPERATION,
480
480
  id: "ui.operation.go-to-previous-match",
481
- handler: (i) => (i.get(g).moveToPreviousMatch(), !0)
481
+ handler: (t) => (t.get(m).moveToPreviousMatch(), !0)
482
482
  };
483
- var Ne = { exports: {} }, W = {};
483
+ var H = { exports: {} }, I = {};
484
484
  /**
485
485
  * @license React
486
486
  * react-jsx-runtime.production.min.js
@@ -490,318 +490,324 @@ var Ne = { exports: {} }, W = {};
490
490
  * This source code is licensed under the MIT license found in the
491
491
  * LICENSE file in the root directory of this source tree.
492
492
  */
493
- var Vt = Ot, Ht = Symbol.for("react.element"), qt = Symbol.for("react.fragment"), Kt = Object.prototype.hasOwnProperty, zt = Vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Yt = { key: !0, ref: !0, __self: !0, __source: !0 };
494
- function $e(i, e, n) {
495
- var t, s = {}, r = null, a = null;
496
- n !== void 0 && (r = "" + n), e.key !== void 0 && (r = "" + e.key), e.ref !== void 0 && (a = e.ref);
497
- for (t in e) Kt.call(e, t) && !Yt.hasOwnProperty(t) && (s[t] = e[t]);
498
- if (i && i.defaultProps) for (t in e = i.defaultProps, e) s[t] === void 0 && (s[t] = e[t]);
499
- return { $$typeof: Ht, type: i, key: r, ref: a, props: s, _owner: zt.current };
493
+ var ue;
494
+ function Ht() {
495
+ if (ue) return I;
496
+ ue = 1;
497
+ var t = Tt, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, r = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
498
+ function a(c, l, _) {
499
+ var h, u = {}, R = null, v = null;
500
+ _ !== void 0 && (R = "" + _), l.key !== void 0 && (R = "" + l.key), l.ref !== void 0 && (v = l.ref);
501
+ for (h in l) i.call(l, h) && !s.hasOwnProperty(h) && (u[h] = l[h]);
502
+ if (c && c.defaultProps) for (h in l = c.defaultProps, l) u[h] === void 0 && (u[h] = l[h]);
503
+ return { $$typeof: e, type: c, key: R, ref: v, props: u, _owner: r.current };
504
+ }
505
+ return I.Fragment = n, I.jsx = a, I.jsxs = a, I;
506
+ }
507
+ var fe;
508
+ function qt() {
509
+ return fe || (fe = 1, H.exports = Ht()), H.exports;
500
510
  }
501
- W.Fragment = qt;
502
- W.jsx = $e;
503
- W.jsxs = $e;
504
- Ne.exports = W;
505
- var c = Ne.exports;
506
- function Ae(i) {
507
- const { findCompleted: e, localeService: n, matchesCount: t, matchesPosition: s, findString: r, findReplaceService: a, onChange: l, ...d } = i, f = e && t === 0 ? n.t("find-replace.dialog.no-result") : t === 0 ? " " : void 0;
508
- return /* @__PURE__ */ c.jsx(
509
- It,
511
+ var d = qt();
512
+ function Le(t) {
513
+ const { findCompleted: e, localeService: n, matchesCount: i, matchesPosition: r, findString: s, findReplaceService: a, onChange: c, ...l } = t, h = e && i === 0 ? n.t("find-replace.dialog.no-result") : i === 0 ? " " : void 0;
514
+ return /* @__PURE__ */ d.jsx(
515
+ Dt,
510
516
  {
511
517
  autoFocus: !0,
512
518
  placeholder: n.t("find-replace.dialog.find-placeholder"),
513
- slot: /* @__PURE__ */ c.jsx(
514
- Dt,
519
+ slot: /* @__PURE__ */ d.jsx(
520
+ Ft,
515
521
  {
516
522
  loop: !0,
517
- text: f,
518
- value: s,
519
- total: t,
520
- onChange: (p) => {
521
- s === t && p === 1 ? a.moveToNextMatch() : s === 1 && p === t || p < s ? a.moveToPreviousMatch() : a.moveToNextMatch();
523
+ text: h,
524
+ value: r,
525
+ total: i,
526
+ onChange: (u) => {
527
+ r === i && u === 1 ? a.moveToNextMatch() : r === 1 && u === i || u < r ? a.moveToPreviousMatch() : a.moveToNextMatch();
522
528
  }
523
529
  }
524
530
  ),
525
- value: r,
526
- onChange: (p) => l == null ? void 0 : l(p),
527
- ...d
531
+ value: s,
532
+ onChange: (u) => c == null ? void 0 : c(u),
533
+ ...l
528
534
  }
529
535
  );
530
536
  }
531
- const Zt = "univer-find-replace-dialog-container", Jt = "univer-find-replace-expand-container", Qt = "univer-button-text", Xt = "univer-find-replace-buttons-group", ei = "univer-find-replace-buttons-group-right", j = {
532
- findReplaceDialogContainer: Zt,
533
- findReplaceExpandContainer: Jt,
534
- buttonText: Qt,
535
- findReplaceButtonsGroup: Xt,
536
- findReplaceButtonsGroupRight: ei
537
+ const Jt = "univer-find-replace-dialog-container", Kt = "univer-find-replace-expand-container", zt = "univer-button-text", Yt = "univer-find-replace-buttons-group", Zt = "univer-find-replace-buttons-group-right", w = {
538
+ findReplaceDialogContainer: Jt,
539
+ findReplaceExpandContainer: Kt,
540
+ buttonText: zt,
541
+ findReplaceButtonsGroup: Yt,
542
+ findReplaceButtonsGroupRight: Zt
537
543
  };
538
- function Le(i, e) {
539
- const n = u(() => {
540
- var s;
541
- (s = document.querySelector(".univer-find-input input")) == null || s.focus();
542
- }, []), t = u(() => {
543
- const s = document.querySelectorAll(".univer-find-replace-dialog-container .univer-select-selection-search-input");
544
- return Array.from(s).some((r) => r === document.activeElement);
544
+ function je(t, e) {
545
+ const n = p(() => {
546
+ var r;
547
+ (r = document.querySelector(".univer-find-input input")) == null || r.focus();
548
+ }, []), i = p(() => {
549
+ const r = document.querySelectorAll(".univer-find-replace-dialog-container .univer-select-selection-search-input");
550
+ return Array.from(r).some((s) => s === document.activeElement);
545
551
  }, []);
546
- return Tt(e, () => ({ focus: n, selectHasFocus: t })), L(() => {
547
- const s = i.focusSignal$.subscribe(() => n());
548
- return () => s.unsubscribe();
549
- }, [i, n]), { focus: n, selectHasFocus: t };
552
+ return Et(e, () => ({ focus: n, selectHasFocus: i })), j(() => {
553
+ const r = t.focusSignal$.subscribe(() => n());
554
+ return () => r.unsubscribe();
555
+ }, [t, n]), { focus: n, selectHasFocus: i };
550
556
  }
551
- const ti = B(function(e, n) {
552
- const t = v(U), s = v(g), r = v(ie), a = I(s.state$, void 0, !0), { findCompleted: l, findString: d, matchesCount: S, matchesPosition: f } = a, p = u(() => {
553
- r.executeCommand(re.id);
554
- }, [r]), O = u((C) => s.changeFindString(C), [s]);
555
- return Le(s, n), /* @__PURE__ */ c.jsxs($, { children: [
556
- /* @__PURE__ */ c.jsx(
557
- Ae,
557
+ const Qt = W(function(e, n) {
558
+ const i = C(B), r = C(m), s = C(ne), a = F(r.state$, void 0, !0), { findCompleted: c, findString: l, matchesCount: _, matchesPosition: h } = a, u = p(() => {
559
+ s.executeCommand(ae.id);
560
+ }, [s]), R = p((v) => r.changeFindString(v), [r]);
561
+ return je(r, n), /* @__PURE__ */ d.jsxs(A, { children: [
562
+ /* @__PURE__ */ d.jsx(
563
+ Le,
558
564
  {
559
- findCompleted: l,
565
+ findCompleted: c,
560
566
  className: "univer-find-input",
561
- matchesCount: S,
562
- matchesPosition: f,
563
- findReplaceService: s,
564
- localeService: t,
565
- findString: d,
566
- onChange: O
567
+ matchesCount: _,
568
+ matchesPosition: h,
569
+ findReplaceService: r,
570
+ localeService: i,
571
+ findString: l,
572
+ onChange: R
567
573
  }
568
574
  ),
569
- /* @__PURE__ */ c.jsx("div", { className: j.findReplaceExpandContainer, children: /* @__PURE__ */ c.jsx(N, { type: "text", size: "small", onClick: p, children: t.t("find-replace.dialog.advanced-finding") }) })
575
+ /* @__PURE__ */ d.jsx("div", { className: w.findReplaceExpandContainer, children: /* @__PURE__ */ d.jsx($, { type: "text", size: "small", onClick: u, children: i.t("find-replace.dialog.advanced-finding") }) })
570
576
  ] });
571
- }), ii = B(function(e, n) {
572
- const t = v(g), s = v(U), r = v(ie), a = v(me), l = I(t.currentMatch$, void 0, !0), d = I(t.replaceables$, void 0, !0), S = I(t.state$, void 0, !0), {
573
- matchesCount: f,
574
- matchesPosition: p,
575
- findString: O,
576
- inputtingFindString: C,
577
- replaceString: Ue,
578
- caseSensitive: Be,
579
- matchesTheWholeCell: We,
580
- findDirection: Ge,
581
- findScope: ke,
582
- findBy: Ve,
577
+ }), Xt = W(function(e, n) {
578
+ const i = C(m), r = C(B), s = C(ne), a = C(Ce), c = F(i.currentMatch$, void 0, !0), l = F(i.replaceables$, void 0, !0), _ = F(i.state$, void 0, !0), {
579
+ matchesCount: h,
580
+ matchesPosition: u,
581
+ findString: R,
582
+ inputtingFindString: v,
583
+ replaceString: Be,
584
+ caseSensitive: We,
585
+ matchesTheWholeCell: Ge,
586
+ findDirection: ke,
587
+ findScope: Ve,
588
+ findBy: He,
583
589
  findCompleted: k
584
- } = S, He = C.length === 0, qe = f === 0 || !(l != null && l.replaceable), Ke = d.length === 0, ze = u(
585
- (h) => t.changeInputtingFindString(h),
586
- [t]
587
- ), Ye = u(
588
- (h) => t.changeReplaceString(h),
589
- [t]
590
- ), { focus: Ze } = Le(t, n), Je = u(() => {
591
- O === C ? t.moveToNextMatch() : (t.changeFindString(C), t.find());
592
- }, [O, C, t]), Qe = u(() => r.executeCommand(Pe.id), [r]), Xe = u(async () => {
593
- await r.executeCommand(Oe.id), Ze();
594
- }, [r]), et = u((h) => {
595
- t.changeFindDirection(h);
596
- }, [t]), tt = u((h) => {
597
- t.changeFindScope(h);
598
- }, [t]), it = u((h) => {
599
- t.changeFindBy(h);
600
- }, [t]), nt = si(s), st = ri(s), rt = ai(s);
601
- return L(() => {
602
- const h = k && f === 0;
603
- let T = null;
604
- return h && (T = a.show({
605
- content: s.t("find-replace.dialog.no-match"),
606
- type: E.Warning,
590
+ } = _, qe = v.length === 0, Je = h === 0 || !(c != null && c.replaceable), Ke = l.length === 0, ze = p(
591
+ (f) => i.changeInputtingFindString(f),
592
+ [i]
593
+ ), Ye = p(
594
+ (f) => i.changeReplaceString(f),
595
+ [i]
596
+ ), { focus: Ze } = je(i, n), Qe = p(() => {
597
+ R === v ? i.moveToNextMatch() : (i.changeFindString(v), i.find());
598
+ }, [R, v, i]), Xe = p(() => s.executeCommand(Ee.id), [s]), et = p(async () => {
599
+ await s.executeCommand(Ne.id), Ze();
600
+ }, [s]), tt = p((f) => {
601
+ i.changeFindDirection(f);
602
+ }, [i]), it = p((f) => {
603
+ i.changeFindScope(f);
604
+ }, [i]), nt = p((f) => {
605
+ i.changeFindBy(f);
606
+ }, [i]), rt = ti(r), st = ii(r), at = ni(r);
607
+ return j(() => {
608
+ const f = k && h === 0;
609
+ let E = null;
610
+ return f && (E = a.show({
611
+ content: r.t("find-replace.dialog.no-match"),
612
+ type: N.Warning,
607
613
  duration: 5e3
608
- })), () => T == null ? void 0 : T.dispose();
609
- }, [k, f, a, s]), /* @__PURE__ */ c.jsxs($, { children: [
610
- /* @__PURE__ */ c.jsx(R, { label: s.t("find-replace.dialog.find"), children: /* @__PURE__ */ c.jsx(
611
- Ae,
614
+ })), () => E == null ? void 0 : E.dispose();
615
+ }, [k, h, a, r]), /* @__PURE__ */ d.jsxs(A, { children: [
616
+ /* @__PURE__ */ d.jsx(M, { label: r.t("find-replace.dialog.find"), children: /* @__PURE__ */ d.jsx(
617
+ Le,
612
618
  {
613
619
  findCompleted: k,
614
620
  className: "univer-find-input",
615
- matchesCount: f,
616
- matchesPosition: p,
617
- findReplaceService: t,
618
- localeService: s,
619
- findString: C,
621
+ matchesCount: h,
622
+ matchesPosition: u,
623
+ findReplaceService: i,
624
+ localeService: r,
625
+ findString: v,
620
626
  onChange: ze
621
627
  }
622
628
  ) }),
623
- /* @__PURE__ */ c.jsx(R, { label: s.t("find-replace.dialog.replace"), children: /* @__PURE__ */ c.jsx(
624
- Ft,
629
+ /* @__PURE__ */ d.jsx(M, { label: r.t("find-replace.dialog.replace"), children: /* @__PURE__ */ d.jsx(
630
+ Pt,
625
631
  {
626
- placeholder: s.t("find-replace.dialog.replace-placeholder"),
627
- value: Ue,
628
- onChange: (h) => Ye(h)
632
+ placeholder: r.t("find-replace.dialog.replace-placeholder"),
633
+ value: Be,
634
+ onChange: (f) => Ye(f)
629
635
  }
630
636
  ) }),
631
- /* @__PURE__ */ c.jsx(R, { label: s.t("find-replace.dialog.find-direction.title"), children: /* @__PURE__ */ c.jsx(V, { value: Ge, options: st, onChange: et }) }),
632
- /* @__PURE__ */ c.jsx(le, { children: /* @__PURE__ */ c.jsxs($, { children: [
633
- /* @__PURE__ */ c.jsx(R, { label: s.t("find-replace.dialog.find-scope.title"), children: /* @__PURE__ */ c.jsx(V, { value: ke, options: nt, onChange: tt }) }),
634
- /* @__PURE__ */ c.jsx(R, { label: s.t("find-replace.dialog.find-by.title"), children: /* @__PURE__ */ c.jsx(V, { value: Ve, options: rt, onChange: it }) })
637
+ /* @__PURE__ */ d.jsx(M, { label: r.t("find-replace.dialog.find-direction.title"), children: /* @__PURE__ */ d.jsx(V, { value: ke, options: st, onChange: tt }) }),
638
+ /* @__PURE__ */ d.jsx(de, { children: /* @__PURE__ */ d.jsxs(A, { children: [
639
+ /* @__PURE__ */ d.jsx(M, { label: r.t("find-replace.dialog.find-scope.title"), children: /* @__PURE__ */ d.jsx(V, { value: Ve, options: rt, onChange: it }) }),
640
+ /* @__PURE__ */ d.jsx(M, { label: r.t("find-replace.dialog.find-by.title"), children: /* @__PURE__ */ d.jsx(V, { value: He, options: at, onChange: nt }) })
635
641
  ] }) }),
636
- /* @__PURE__ */ c.jsx(le, { children: /* @__PURE__ */ c.jsxs($, { children: [
637
- /* @__PURE__ */ c.jsx(R, { children: /* @__PURE__ */ c.jsx(
638
- de,
642
+ /* @__PURE__ */ d.jsx(de, { children: /* @__PURE__ */ d.jsxs(A, { children: [
643
+ /* @__PURE__ */ d.jsx(M, { children: /* @__PURE__ */ d.jsx(
644
+ he,
639
645
  {
640
- checked: Be,
641
- onChange: (h) => {
642
- t.changeCaseSensitive(h);
646
+ checked: We,
647
+ onChange: (f) => {
648
+ i.changeCaseSensitive(f);
643
649
  },
644
- children: s.t("find-replace.dialog.case-sensitive")
650
+ children: r.t("find-replace.dialog.case-sensitive")
645
651
  }
646
652
  ) }),
647
- /* @__PURE__ */ c.jsx(R, { children: /* @__PURE__ */ c.jsx(
648
- de,
653
+ /* @__PURE__ */ d.jsx(M, { children: /* @__PURE__ */ d.jsx(
654
+ he,
649
655
  {
650
- checked: We,
651
- onChange: (h) => {
652
- t.changeMatchesTheWholeCell(h);
656
+ checked: Ge,
657
+ onChange: (f) => {
658
+ i.changeMatchesTheWholeCell(f);
653
659
  },
654
- children: s.t("find-replace.dialog.match-the-whole-cell")
660
+ children: r.t("find-replace.dialog.match-the-whole-cell")
655
661
  }
656
662
  ) })
657
663
  ] }) }),
658
- /* @__PURE__ */ c.jsxs("div", { className: j.findReplaceButtonsGroup, children: [
659
- /* @__PURE__ */ c.jsx(N, { type: "primary", onClick: Je, disabled: He, children: s.t("find-replace.dialog.find") }),
660
- /* @__PURE__ */ c.jsxs("span", { className: j.findReplaceButtonsGroupRight, children: [
661
- /* @__PURE__ */ c.jsx(N, { disabled: qe, onClick: Qe, children: s.t("find-replace.dialog.replace") }),
662
- /* @__PURE__ */ c.jsx(N, { disabled: Ke, onClick: Xe, children: s.t("find-replace.dialog.replace-all") })
664
+ /* @__PURE__ */ d.jsxs("div", { className: w.findReplaceButtonsGroup, children: [
665
+ /* @__PURE__ */ d.jsx($, { type: "primary", onClick: Qe, disabled: qe, children: r.t("find-replace.dialog.find") }),
666
+ /* @__PURE__ */ d.jsxs("span", { className: w.findReplaceButtonsGroupRight, children: [
667
+ /* @__PURE__ */ d.jsx($, { disabled: Je, onClick: Xe, children: r.t("find-replace.dialog.replace") }),
668
+ /* @__PURE__ */ d.jsx($, { disabled: Ke, onClick: et, children: r.t("find-replace.dialog.replace-all") })
663
669
  ] })
664
670
  ] })
665
671
  ] });
666
672
  });
667
- function ni() {
668
- const i = v(g), e = v(ve), n = v(te), t = I(i.state$, void 0, !0), s = q(null);
669
- L(() => {
670
- let d;
671
- return s.current && (d = e.registerContainerElement(s.current)), () => d == null ? void 0 : d.dispose();
673
+ function ei() {
674
+ const t = C(m), e = C(Re), n = C(ie), i = F(t.state$, void 0, !0), r = J(null);
675
+ j(() => {
676
+ let l;
677
+ return r.current && (l = e.registerContainerElement(r.current)), () => l == null ? void 0 : l.dispose();
672
678
  }, [e]);
673
- const r = q(null), a = u(
674
- (d) => n.setContextValue(Ie, d),
679
+ const s = J(null), a = p(
680
+ (l) => n.setContextValue(Pe, l),
675
681
  [n]
676
- ), l = u(
677
- (d) => n.setContextValue(ye, d),
682
+ ), c = p(
683
+ (l) => n.setContextValue(Fe, l),
678
684
  [n]
679
685
  );
680
- return L(() => {
681
- var S;
682
- const d = xt(document, "focusin").subscribe((f) => {
683
- var p;
684
- f.target && ((p = s.current) != null && p.contains(f.target)) ? a(!0) : a(!1), !r.current || !r.current.selectHasFocus() ? l(!0) : l(!1);
686
+ return j(() => {
687
+ var _;
688
+ const l = yt(document, "focusin").subscribe((h) => {
689
+ var u;
690
+ h.target && ((u = r.current) != null && u.contains(h.target)) ? a(!0) : a(!1), !s.current || !s.current.selectHasFocus() ? c(!0) : c(!1);
685
691
  });
686
- return (S = r.current) == null || S.focus(), a(!0), l(!0), () => {
687
- d.unsubscribe(), a(!1);
692
+ return (_ = s.current) == null || _.focus(), a(!0), c(!0), () => {
693
+ l.unsubscribe(), a(!1);
688
694
  };
689
- }, [a, l]), /* @__PURE__ */ c.jsx("div", { className: j.findReplaceDialogContainer, ref: s, children: t.replaceRevealed ? /* @__PURE__ */ c.jsx(ii, { ref: r }) : /* @__PURE__ */ c.jsx(ti, { ref: r }) });
695
+ }, [a, c]), /* @__PURE__ */ d.jsx("div", { className: w.findReplaceDialogContainer, ref: r, children: i.replaceRevealed ? /* @__PURE__ */ d.jsx(Xt, { ref: s }) : /* @__PURE__ */ d.jsx(Qt, { ref: s }) });
690
696
  }
691
- function si(i) {
692
- const e = i.getCurrentLocale();
693
- return ne(() => [
694
- { label: i.t("find-replace.dialog.find-scope.current-sheet"), value: J.SUBUNIT },
695
- { label: i.t("find-replace.dialog.find-scope.workbook"), value: J.UNIT }
697
+ function ti(t) {
698
+ const e = t.getCurrentLocale();
699
+ return re(() => [
700
+ { label: t.t("find-replace.dialog.find-scope.current-sheet"), value: Q.SUBUNIT },
701
+ { label: t.t("find-replace.dialog.find-scope.workbook"), value: Q.UNIT }
696
702
  ], [e]);
697
703
  }
698
- function ri(i) {
699
- const e = i.getCurrentLocale();
700
- return ne(() => [
701
- { label: i.t("find-replace.dialog.find-direction.row"), value: Y.ROW },
702
- { label: i.t("find-replace.dialog.find-direction.column"), value: Y.COLUMN }
704
+ function ii(t) {
705
+ const e = t.getCurrentLocale();
706
+ return re(() => [
707
+ { label: t.t("find-replace.dialog.find-direction.row"), value: Y.ROW },
708
+ { label: t.t("find-replace.dialog.find-direction.column"), value: Y.COLUMN }
703
709
  ], [e]);
704
710
  }
705
- function ai(i) {
706
- const e = i.getCurrentLocale();
707
- return ne(() => [
708
- { label: i.t("find-replace.dialog.find-by.value"), value: Z.VALUE },
709
- { label: i.t("find-replace.dialog.find-by.formula"), value: Z.FORMULA }
711
+ function ni(t) {
712
+ const e = t.getCurrentLocale();
713
+ return re(() => [
714
+ { label: t.t("find-replace.dialog.find-by.value"), value: Z.VALUE },
715
+ { label: t.t("find-replace.dialog.find-by.formula"), value: Z.FORMULA }
710
716
  ], [e]);
711
717
  }
712
- function P(i) {
713
- return i.getContextValue(Ie);
718
+ function T(t) {
719
+ return t.getContextValue(Pe);
714
720
  }
715
- function oi(i) {
716
- return i.getContextValue(De);
721
+ function ri(t) {
722
+ return t.getContextValue(Oe);
717
723
  }
718
- function je(i) {
719
- return i.getContextValue(ye);
724
+ function we(t) {
725
+ return t.getContextValue(Fe);
720
726
  }
721
727
  const G = "7_find-replace-shortcuts";
722
- function ae(i) {
723
- return i.getContextValue(_e);
728
+ function oe(t) {
729
+ return t.getContextValue(ve);
724
730
  }
725
- function oe(i) {
726
- return !i.getContextValue(ge);
731
+ function ce(t) {
732
+ return !t.getContextValue(Se);
727
733
  }
728
- const ci = {
729
- id: F.id,
734
+ const si = {
735
+ id: O.id,
730
736
  description: "find-replace.shortcut.open-find-dialog",
731
- binding: M.F | b.CTRL_COMMAND,
737
+ binding: b.F | x.CTRL_COMMAND,
732
738
  group: G,
733
- preconditions(i) {
734
- return !P(i) && ae(i) && oe(i);
739
+ preconditions(t) {
740
+ return !T(t) && oe(t) && ce(t);
735
741
  }
736
- }, li = {
737
- id: F.id,
742
+ }, ai = {
743
+ id: O.id,
738
744
  description: "find-replace.shortcut.open-find-dialog",
739
- binding: M.F | b.CTRL_COMMAND,
740
- mac: M.F | b.MAC_CTRL,
741
- preconditions(i) {
742
- return !P(i) && ae(i) && oe(i);
745
+ binding: b.F | x.CTRL_COMMAND,
746
+ mac: b.F | x.MAC_CTRL,
747
+ preconditions(t) {
748
+ return !T(t) && oe(t) && ce(t);
743
749
  }
744
- }, di = {
745
- id: re.id,
750
+ }, oi = {
751
+ id: ae.id,
746
752
  description: "find-replace.shortcut.open-replace-dialog",
747
- binding: M.H | b.CTRL_COMMAND,
748
- mac: M.H | b.MAC_CTRL,
753
+ binding: b.H | x.CTRL_COMMAND,
754
+ mac: b.H | x.MAC_CTRL,
749
755
  group: G,
750
- preconditions(i) {
751
- return ae(i) && oe(i) && (!P(i) || !oi(i));
756
+ preconditions(t) {
757
+ return oe(t) && ce(t) && (!T(t) || !ri(t));
752
758
  }
753
- }, hi = {
754
- id: Te.id,
759
+ }, ci = {
760
+ id: $e.id,
755
761
  description: "find-replace.shortcut.go-to-next-match",
756
- binding: M.ENTER,
762
+ binding: b.ENTER,
757
763
  group: G,
758
764
  priority: 1e3,
759
- preconditions(i) {
760
- return je(i) && P(i);
765
+ preconditions(t) {
766
+ return we(t) && T(t);
761
767
  }
762
- }, ui = {
763
- id: Ee.id,
768
+ }, li = {
769
+ id: Ae.id,
764
770
  description: "find-replace.shortcut.go-to-previous-match",
765
- binding: M.ENTER | b.SHIFT,
771
+ binding: b.ENTER | x.SHIFT,
766
772
  group: G,
767
773
  priority: 1e3,
768
- preconditions(i) {
769
- return je(i) && P(i);
774
+ preconditions(t) {
775
+ return we(t) && T(t);
770
776
  }
771
777
  };
772
- function fi(i) {
773
- const e = i.get(te);
778
+ function di(t) {
779
+ const e = t.get(ie);
774
780
  return {
775
- id: F.id,
781
+ id: O.id,
776
782
  icon: "SearchIcon",
777
783
  tooltip: "find-replace.toolbar",
778
- type: _t.BUTTON,
779
- hidden$: gt(i, dt.UNIVER_SHEET),
780
- disabled$: Se([
781
- e.subscribeContextValue$(ge),
782
- e.subscribeContextValue$(_e)
783
- ]).pipe(yt(([n, t]) => n || !t))
784
+ type: gt.BUTTON,
785
+ hidden$: mt(t, ht.UNIVER_SHEET),
786
+ disabled$: Me([
787
+ e.subscribeContextValue$(Se),
788
+ e.subscribeContextValue$(ve)
789
+ ]).pipe(It(([n, i]) => n || !i))
784
790
  };
785
791
  }
786
- const pi = {
787
- [mt.OTHERS]: {
788
- [F.id]: {
792
+ const hi = {
793
+ [vt.OTHERS]: {
794
+ [O.id]: {
789
795
  order: 2,
790
- menuItemFactory: fi
796
+ menuItemFactory: di
791
797
  }
792
798
  }
793
799
  };
794
- var _i = Object.defineProperty, gi = Object.getOwnPropertyDescriptor, mi = (i, e, n, t) => {
795
- for (var s = t > 1 ? void 0 : t ? gi(e, n) : e, r = i.length - 1, a; r >= 0; r--)
796
- (a = i[r]) && (s = (t ? a(e, n, s) : a(s)) || s);
797
- return t && s && _i(e, n, s), s;
798
- }, m = (i, e) => (n, t) => e(n, t, i);
799
- const he = "DESKTOP_FIND_REPLACE_DIALOG", we = 350, vi = 20, Si = -90;
800
- let w = class extends ht {
801
- constructor(e, n, t, s, r, a, l, d, S, f) {
800
+ var ui = Object.defineProperty, fi = Object.getOwnPropertyDescriptor, pi = (t, e, n, i) => {
801
+ for (var r = i > 1 ? void 0 : i ? fi(e, n) : e, s = t.length - 1, a; s >= 0; s--)
802
+ (a = t[s]) && (r = (i ? a(e, n, r) : a(r)) || r);
803
+ return i && r && ui(e, n, r), r;
804
+ }, S = (t, e) => (n, i) => e(n, i, t);
805
+ const pe = "DESKTOP_FIND_REPLACE_DIALOG", Ue = 350, _i = 20, gi = -90;
806
+ let U = class extends ut {
807
+ constructor(e, n, i, r, s, a, c, l, _, h) {
802
808
  super();
803
809
  o(this, "_closingListenerDisposable");
804
- this._univerInstanceService = e, this._menuManagerService = n, this._shortcutService = t, this._commandService = s, this._findReplaceService = r, this._dialogService = a, this._layoutService = l, this._localeService = d, this._componentManager = S, this._injector = f, this._initCommands(), this._initUI(), this._initShortcuts();
810
+ this._univerInstanceService = e, this._menuManagerService = n, this._shortcutService = i, this._commandService = r, this._findReplaceService = s, this._dialogService = a, this._layoutService = c, this._localeService = l, this._componentManager = _, this._injector = h, this._initCommands(), this._initUI(), this._initShortcuts();
805
811
  }
806
812
  dispose() {
807
813
  var e;
@@ -809,104 +815,104 @@ let w = class extends ht {
809
815
  }
810
816
  _initCommands() {
811
817
  [
812
- F,
813
- re,
814
- Te,
815
- Ee,
816
- Oe,
817
- Pe
818
+ O,
819
+ ae,
820
+ $e,
821
+ Ae,
822
+ Ne,
823
+ Ee
818
824
  ].forEach((e) => {
819
825
  this.disposeWithMe(this._commandService.registerCommand(e));
820
826
  });
821
827
  }
822
828
  _initShortcuts() {
823
829
  [
824
- di,
825
- ci,
830
+ oi,
831
+ si,
832
+ ai,
826
833
  li,
827
- ui,
828
- hi
834
+ ci
829
835
  ].forEach((e) => this.disposeWithMe(this._shortcutService.registerShortcut(e)));
830
836
  }
831
837
  _initUI() {
832
- this.disposeWithMe(this._componentManager.register("FindReplaceDialog", ni)), this.disposeWithMe(this._componentManager.register("SearchIcon", xe)), this._menuManagerService.mergeMenu(pi), this._findReplaceService.stateUpdates$.pipe(ce(this.dispose$)).subscribe((e) => {
838
+ this.disposeWithMe(this._componentManager.register("FindReplaceDialog", ei)), this.disposeWithMe(this._componentManager.register("SearchIcon", De)), this._menuManagerService.mergeMenu(hi), this._findReplaceService.stateUpdates$.pipe(le(this.dispose$)).subscribe((e) => {
833
839
  e.revealed === !0 && this._openPanel();
834
840
  });
835
841
  }
836
842
  _openPanel() {
837
843
  this._dialogService.open({
838
- id: he,
844
+ id: pe,
839
845
  draggable: !0,
840
- width: we,
846
+ width: Ue,
841
847
  title: { title: this._localeService.t("find-replace.dialog.title") },
842
848
  children: { label: "FindReplaceDialog" },
843
849
  destroyOnClose: !0,
844
- defaultPosition: Ci(),
850
+ defaultPosition: mi(),
845
851
  preservePositionOnDestroy: !0,
846
852
  onClose: () => this.closePanel()
847
- }), this._closingListenerDisposable = A(this._univerInstanceService.focused$.pipe(ce(this.dispose$)).subscribe((e) => {
853
+ }), this._closingListenerDisposable = L(this._univerInstanceService.focused$.pipe(le(this.dispose$)).subscribe((e) => {
848
854
  (!e || !this._univerInstanceService.getUniverSheetInstance(e)) && this.closePanel();
849
855
  }));
850
856
  }
851
857
  closePanel() {
852
- this._closingListenerDisposable && (this._closingListenerDisposable.dispose(), this._closingListenerDisposable = null, this._dialogService.close(he), this._findReplaceService.terminate(), queueMicrotask(() => this._layoutService.focus()));
858
+ this._closingListenerDisposable && (this._closingListenerDisposable.dispose(), this._closingListenerDisposable = null, this._dialogService.close(pe), this._findReplaceService.terminate(), queueMicrotask(() => this._layoutService.focus()));
853
859
  }
854
860
  };
855
- w = mi([
856
- m(0, pe),
857
- m(1, St),
858
- m(2, Ct),
859
- m(3, ie),
860
- m(4, g),
861
- m(5, Rt),
862
- m(6, ve),
863
- m(7, y(U)),
864
- m(8, y(vt)),
865
- m(9, y(X))
866
- ], w);
867
- function Ci() {
868
- const { innerWidth: i } = window;
869
- return { x: (i - we) / 2 - vi, y: Si };
861
+ U = pi([
862
+ S(0, me),
863
+ S(1, Ct),
864
+ S(2, Rt),
865
+ S(3, ne),
866
+ S(4, m),
867
+ S(5, Mt),
868
+ S(6, Re),
869
+ S(7, D(B)),
870
+ S(8, D(St)),
871
+ S(9, D(ee))
872
+ ], U);
873
+ function mi() {
874
+ const { innerWidth: t } = window;
875
+ return { x: (t - Ue) / 2 - _i, y: gi };
870
876
  }
871
- var Ri = Object.defineProperty, Mi = Object.getOwnPropertyDescriptor, bi = (i, e, n, t) => {
872
- for (var s = t > 1 ? void 0 : t ? Mi(e, n) : e, r = i.length - 1, a; r >= 0; r--)
873
- (a = i[r]) && (s = (t ? a(e, n, s) : a(s)) || s);
874
- return t && s && Ri(e, n, s), s;
875
- }, ue = (i, e) => (n, t) => e(n, t, i);
876
- const xi = "UNIVER_FIND_REPLACE_PLUGIN";
877
- var H;
878
- let fe = (H = class extends ut {
879
- constructor(i = Nt, e, n) {
880
- super(), this._config = i, this._injector = e, this._configService = n;
881
- const { ...t } = this._config;
882
- this._configService.setConfig(Et, t);
877
+ var vi = Object.defineProperty, Si = Object.getOwnPropertyDescriptor, Ci = (t, e, n, i) => {
878
+ for (var r = i > 1 ? void 0 : i ? Si(e, n) : e, s = t.length - 1, a; s >= 0; s--)
879
+ (a = t[s]) && (r = (i ? a(e, n, r) : a(r)) || r);
880
+ return i && r && vi(e, n, r), r;
881
+ }, _e = (t, e) => (n, i) => e(n, i, t);
882
+ const Ri = "UNIVER_FIND_REPLACE_PLUGIN";
883
+ var q;
884
+ let ge = (q = class extends ft {
885
+ constructor(t = $t, e, n) {
886
+ super(), this._config = t, this._injector = e, this._configService = n;
887
+ const { ...i } = this._config;
888
+ this._configService.setConfig(Nt, i);
883
889
  }
884
890
  onStarting() {
885
891
  [
886
- [w],
887
- [g, { useClass: Q }]
888
- ].forEach((i) => this._injector.add(i));
892
+ [U],
893
+ [m, { useClass: X }]
894
+ ].forEach((t) => this._injector.add(t));
889
895
  }
890
896
  onRendered() {
891
- this._injector.get(w);
897
+ this._injector.get(U);
892
898
  }
893
- }, o(H, "pluginName", xi), H);
894
- fe = bi([
895
- ue(1, y(X)),
896
- ue(2, ft)
897
- ], fe);
899
+ }, o(q, "pluginName", Ri), q);
900
+ ge = Ci([
901
+ _e(1, D(ee)),
902
+ _e(2, pt)
903
+ ], ge);
898
904
  export {
899
905
  Z as FindBy,
900
906
  Y as FindDirection,
901
- Ei as FindModel,
902
- w as FindReplaceController,
903
- J as FindScope,
904
- Te as GoToNextMatchOperation,
905
- Ee as GoToPreviousMatchOperation,
906
- g as IFindReplaceService,
907
- F as OpenFindDialogOperation,
908
- re as OpenReplaceDialogOperation,
909
- Oe as ReplaceAllMatchesCommand,
910
- Pe as ReplaceCurrentMatchCommand,
911
- fe as UniverFindReplacePlugin
907
+ Pi as FindModel,
908
+ U as FindReplaceController,
909
+ Q as FindScope,
910
+ $e as GoToNextMatchOperation,
911
+ Ae as GoToPreviousMatchOperation,
912
+ m as IFindReplaceService,
913
+ O as OpenFindDialogOperation,
914
+ ae as OpenReplaceDialogOperation,
915
+ Ne as ReplaceAllMatchesCommand,
916
+ Ee as ReplaceCurrentMatchCommand,
917
+ ge as UniverFindReplacePlugin
912
918
  };