@mx-space/cli 0.14.1 → 0.14.2

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.
Files changed (52) hide show
  1. package/dist/{Lexical.dev-DTxuYHmG.mjs → Lexical.dev-CtGmYDoh.mjs} +770 -271
  2. package/dist/{Lexical.node-BlCLnfA6.mjs → Lexical.node-8sRFmq2X.mjs} +15 -5
  3. package/dist/Lexical.prod-D-VfeKDz.mjs +7200 -0
  4. package/dist/{LexicalClipboard.dev-CdFkLR_D.mjs → LexicalClipboard.dev-CzQ15z6E.mjs} +6 -6
  5. package/dist/{LexicalClipboard.node-ktUajxsv.mjs → LexicalClipboard.node-D4gMGws6.mjs} +2 -2
  6. package/dist/{LexicalClipboard.prod-DliyLofW.mjs → LexicalClipboard.prod-CltkQpzS.mjs} +10 -8
  7. package/dist/{LexicalCodeCore.dev-CL9tHWJX.mjs → LexicalCodeCore.dev-DkYBZRGB.mjs} +11 -9
  8. package/dist/{LexicalCodeCore.prod-BoMSJc29.mjs → LexicalCodeCore.prod-COc3_QL8.mjs} +178 -167
  9. package/dist/{LexicalDragon.dev-CqW7Aq5H.mjs → LexicalDragon.dev-Dv5_WUae.mjs} +3 -3
  10. package/dist/{LexicalDragon.node-DLXctJyy.mjs → LexicalDragon.node-DgjrmWkd.mjs} +2 -2
  11. package/dist/{LexicalDragon.prod-DHI3T6n5.mjs → LexicalDragon.prod-DnpbDe-_.mjs} +5 -4
  12. package/dist/{LexicalExtension.dev-BP-18zns.mjs → LexicalExtension.dev-JMH_6-OZ.mjs} +73 -52
  13. package/dist/{LexicalExtension.node-BWH6xbzG.mjs → LexicalExtension.node-BUozzx4t.mjs} +4 -2
  14. package/dist/{LexicalExtension.prod-Cs6OgrDn.mjs → LexicalExtension.prod-UiyDgmou.mjs} +370 -347
  15. package/dist/{LexicalHeadless.dev-DJp__UcP.mjs → LexicalHeadless.dev-BfLGciiX.mjs} +2 -2
  16. package/dist/{LexicalHeadless.prod-o0v9cIu5.mjs → LexicalHeadless.prod-CWF7edmQ.mjs} +2 -2
  17. package/dist/{LexicalHtml.dev-DoymwFpG.mjs → LexicalHtml.dev-D5EF5PGW.mjs} +13 -11
  18. package/dist/{LexicalHtml.node-CVkbWtUA.mjs → LexicalHtml.node-BYbzHNVe.mjs} +4 -4
  19. package/dist/{LexicalHtml.prod-C2b3z99k.mjs → LexicalHtml.prod-D_FfkvVD.mjs} +330 -299
  20. package/dist/{LexicalLink.dev-7cgLOLIe.mjs → LexicalLink.dev-D3Pgh6ik.mjs} +53 -23
  21. package/dist/{LexicalLink.prod-DWFgoXHR.mjs → LexicalLink.prod-XZoAYVYD.mjs} +217 -198
  22. package/dist/{LexicalList.dev-Ci2iOxFx.mjs → LexicalList.dev-B5d3ObhB.mjs} +49 -44
  23. package/dist/LexicalList.prod-OQDpVAEb.mjs +967 -0
  24. package/dist/{LexicalMarkdown.dev-C0ZYCyuR.mjs → LexicalMarkdown.dev-BkM8G3DG.mjs} +61 -42
  25. package/dist/{LexicalMarkdown.prod-0M-Nc-rh.mjs → LexicalMarkdown.prod-DcVXCex6.mjs} +254 -202
  26. package/dist/{LexicalRichText.dev-Cnr1kDym.mjs → LexicalRichText.dev-DppD7IrA.mjs} +337 -52
  27. package/dist/{LexicalRichText.node-BUJZAiap.mjs → LexicalRichText.node-CPSn7dkg.mjs} +12 -8
  28. package/dist/LexicalRichText.prod-h7JPxFNp.mjs +718 -0
  29. package/dist/{LexicalSelection.dev-C4L7l8OB.mjs → LexicalSelection.dev-CD0SLbxP.mjs} +48 -17
  30. package/dist/{LexicalSelection.node-CLKroUMQ.mjs → LexicalSelection.node-CGlJgUlZ.mjs} +5 -4
  31. package/dist/{LexicalSelection.prod-DzFqpTlw.mjs → LexicalSelection.prod-DbVZN5AV.mjs} +101 -92
  32. package/dist/{LexicalTable.dev-Cc9-zqKa.mjs → LexicalTable.dev-D0HU14UV.mjs} +340 -138
  33. package/dist/LexicalTable.prod-BcPNSrxP.mjs +2468 -0
  34. package/dist/{LexicalUtils.dev-BRgK0L6G.mjs → LexicalUtils.dev-iKy_TrRT.mjs} +15 -19
  35. package/dist/{LexicalUtils.node-BVAwOkL4.mjs → LexicalUtils.node-CIgMS8cG.mjs} +6 -6
  36. package/dist/{LexicalUtils.prod-C1gtvVDP.mjs → LexicalUtils.prod-DIAsKJzu.mjs} +155 -159
  37. package/dist/bin/mxs.mjs +1 -1
  38. package/dist/esm-CH7CrOvh.mjs +2 -0
  39. package/dist/{esm-BNu4sUWV.mjs → esm-CwXl1N0a.mjs} +1801 -6013
  40. package/dist/index.d.mts +57 -62
  41. package/dist/index.mjs +1 -1
  42. package/dist/{mxs-CMX2yklg.mjs → mxs-iW9DgqSZ.mjs} +14930 -9234
  43. package/dist/rolldown-runtime-JspESFgx.mjs +35 -0
  44. package/dist/vendor/litexml/cli.mjs +6693 -5762
  45. package/dist/vendor/litexml/litexml-html-preview-client.js +11912 -8698
  46. package/package.json +31 -30
  47. package/LICENSE +0 -33
  48. package/dist/Lexical.prod-CeB9UQuo.mjs +0 -6816
  49. package/dist/LexicalList.prod-D0xX5d3G.mjs +0 -944
  50. package/dist/LexicalRichText.prod-BfbMQ9uM.mjs +0 -538
  51. package/dist/LexicalTable.prod-BgO4nCxy.mjs +0 -2336
  52. package/dist/esm-jbwcVZth.mjs +0 -2
@@ -1,6 +1,6 @@
1
- import { A as $getChildCaret, Ct as $normalizeCaret, D as $getCaretRange, Dt as $rewindSiblingCaret, Fr as getStaticNodeConfig, G as $getSiblingCaret, Gr as isExactShortcutMatch, Gt as COMMAND_PRIORITY_BEFORE_EDITOR, H as $getPreviousSelection, Ht as CLICK_COMMAND, I as $getEditor, J as $getSlotHost, Jn as KEY_TAB_COMMAND, Kt as COMMAND_PRIORITY_CRITICAL, Lt as $updateDOMSelection, Mt as $setSelection, Nr as getRegisteredSubtypeMap, Nt as $setSelectionFromCaretRange, O as $getCaretRangeInDirection, Ot as $selectAll, Pt as $setState, Qn as OUTDENT_CONTENT_COMMAND, Qt as COMPOSITION_START_TAG, Sr as getActiveElement, Tr as getDOMSelection, U as $getRoot, V as $getNodeFromDOMNode, Vr as isDOMNode, Vt as CLEAR_EDITOR_COMMAND, W as $getSelection, Wt as COMMAND_PRIORITY_BEFORE_CRITICAL, X as $getState, Yn as LineBreakNode, Yt as COMMAND_PRIORITY_LOW, Zt as COMPOSITION_START_COMMAND, _r as createEditor, _t as $isSiblingCaret, a as $caretRangeFromSelection, ai as safeCast, at as $isElementNode, br as defineExtension, bt as $isTextNode, cr as SKIP_SCROLL_INTO_VIEW_TAG, di as toggleTextFormatType, dn as ElementNode, dr as TabNode, dt as $isNodeSelection, f as $createNodeSelection, fr as TextNode, gn as HISTORY_MERGE_TAG, gr as createCommand, h as $createRangeSelection, hr as configExtension, ii as removeClassNamesFromElement, ir as SELECTION_CHANGE_COMMAND, it as $isEditorState, li as shallowMergeConfig, lr as SKIP_SELECTION_FOCUS_TAG, mn as FORMAT_TEXT_COMMAND, mt as $isRootNode, ni as mergeRegister, nt as $isChildCaret, or as SELECT_ALL_COMMAND, p as $createParagraphNode, pr as addClassNamesToElement, pt as $isRangeSelection, q as $getSlotFrame, qr as isHTMLElement, qt as COMMAND_PRIORITY_EDITOR, rr as RootNode, rt as $isDecoratorNode, tr as ParagraphNode, tt as $isBlockElementNode, u as $create, ui as stopLexicalPropagation, un as DecoratorNode, ur as TEXT_TYPE_TO_FORMAT, ut as $isLineBreakNode, vn as INDENT_CONTENT_COMMAND, vr as createState, wt as $normalizeSelection__EXPERIMENTAL, xn as INSERT_TAB_COMMAND, xt as $isTextPointCaret, yr as declarePeerDependency, z as $getNodeByKey } from "./Lexical.node-BlCLnfA6.mjs";
2
- import { a as $handleIndentAndOutdent, c as $isBlockFullySelected, f as IS_APPLE, g as selectionAlwaysOnDisplay, r as $getNearestBlockElementAncestorOrThrow, s as $insertNodeToNearestRoot } from "./LexicalUtils.node-BVAwOkL4.mjs";
3
- //#region ../../node_modules/.pnpm/@lexical+extension@0.46.0_typescript@6.0.3/node_modules/@lexical/extension/dist/LexicalExtension.prod.mjs
1
+ import { $n as LineBreakNode, $r as isHTMLElement, $t as COMMAND_PRIORITY_LOW, A as $getChildCaret, At as $rewindSiblingCaret, B as $getNodeByKey, Cr as createState, Ct as $isTextPointCaret, D as $getCaretRange, Dt as $normalizeSelection__EXPERIMENTAL, Et as $normalizeCaret, Ft as $setSelection, G as $getSelection, Gt as CLEAR_EDITOR_COMMAND, H as $getNodeFromDOMNode, I as $getDocument, It as $setSelectionFromCaretRange, J as $getSlotFrame, Jt as COMMAND_PRIORITY_BEFORE_CRITICAL, K as $getSiblingCaret, Kt as CLICK_COMMAND, L as $getEditor, Lt as $setState, O as $getCaretRangeInDirection, Or as getActiveElement, Qn as KEY_TAB_COMMAND, Sn as INDENT_CONTENT_COMMAND, Sr as createEditor, St as $isTextNode, Tn as INSERT_TAB_COMMAND, Tr as defineExtension, U as $getPreviousSelection, Vr as getStaticNodeConfig, Vt as $updateDOMSelection, W as $getRoot, Xt as COMMAND_PRIORITY_CRITICAL, Y as $getSlotHost, Yt as COMMAND_PRIORITY_BEFORE_EDITOR, Z as $getState, Zr as isExactShortcutMatch, Zt as COMMAND_PRIORITY_EDITOR, _i as shallowMergeConfig, _r as TextNode, a as $caretRangeFromSelection, ar as ParagraphNode, at as $isEditorState, bn as HISTORY_MERGE_TAG, br as configExtension, ci as mergeRegister, cr as SELECTION_CHANGE_COMMAND, di as registerEventListeners, dt as $isLineBreakNode, f as $createNodeSelection, fi as removeClassNamesFromElement, ft as $isNodeSelection, gr as TabNode, h as $createRangeSelection, hn as ElementNode, hr as TEXT_TYPE_TO_FORMAT, ht as $isRootNode, it as $isDecoratorNode, jr as getDOMSelection, jt as $selectAll, kn as IS_APPLE, mn as DecoratorNode, mr as SKIP_SELECTION_FOCUS_TAG, mt as $isRangeSelection, nn as COMPOSITION_START_TAG, nr as OUTDENT_CONTENT_COMMAND, nt as $isBlockElementNode, ot as $isElementNode, p as $createParagraphNode, pi as safeCast, pr as SKIP_SCROLL_INTO_VIEW_TAG, qr as isDOMNode, rt as $isChildCaret, sr as RootNode, tn as COMPOSITION_START_COMMAND, u as $create, ui as registerEventListener, ur as SELECT_ALL_COMMAND, vi as stopLexicalPropagation, vr as addClassNamesToElement, wr as declarePeerDependency, xr as createCommand, yi as toggleTextFormatType, yt as $isSiblingCaret, zr as getRegisteredSubtypeMap } from "./Lexical.node-8sRFmq2X.mjs";
2
+ import { a as $handleIndentAndOutdent, c as $isBlockFullySelected, h as selectionAlwaysOnDisplay, r as $getNearestBlockElementAncestorOrThrow, s as $insertNodeToNearestRoot } from "./LexicalUtils.node-CIgMS8cG.mjs";
3
+ //#region ../../node_modules/.pnpm/@lexical+extension@0.48.0_typescript@6.0.3/node_modules/@lexical/extension/dist/LexicalExtension.prod.mjs
4
4
  /**
5
5
  * Copyright (c) Meta Platforms, Inc. and affiliates.
6
6
  *
@@ -8,18 +8,18 @@ import { a as $handleIndentAndOutdent, c as $isBlockFullySelected, f as IS_APPLE
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  *
10
10
  */
11
- const At = Symbol.for("preact-signals");
12
- function Pt() {
13
- if (Ut > 1) return void Ut--;
11
+ const Kt = Symbol.for("preact-signals");
12
+ function $t() {
13
+ if (Bt > 1) return void Bt--;
14
14
  let t, e = !1;
15
15
  for (function() {
16
- let t = zt;
17
- for (zt = void 0; void 0 !== t;) t.S.v === t.v && (t.S.i = t.i), t = t.o;
18
- }(); void 0 !== Tt;) {
19
- let n = Tt;
20
- for (Tt = void 0, Wt++; void 0 !== n;) {
16
+ let t = Wt;
17
+ for (Wt = void 0; void 0 !== t;) t.S.v === t.v && (t.S.i = t.i), t = t.o;
18
+ }(); void 0 !== zt;) {
19
+ let n = zt;
20
+ for (zt = void 0, Vt++; void 0 !== n;) {
21
21
  const i = n.u;
22
- if (n.u = void 0, n.f &= -3, !(8 & n.f) && Xt(n)) try {
22
+ if (n.u = void 0, n.f &= -3, !(8 & n.f) && qt(n)) try {
23
23
  n.c();
24
24
  } catch (n) {
25
25
  e || (t = n, e = !0);
@@ -27,53 +27,59 @@ function Pt() {
27
27
  n = i;
28
28
  }
29
29
  }
30
- if (Wt = 0, Ut--, e) throw t;
30
+ if (Vt = 0, Bt--, e) throw t;
31
31
  }
32
- function Kt(t) {
33
- if (Ut > 0) return t();
34
- Vt = ++Bt, Ut++;
32
+ function Tt(t) {
33
+ if (Bt > 0) return t();
34
+ Zt = ++Gt, Bt++;
35
35
  try {
36
36
  return t();
37
37
  } finally {
38
- Pt();
38
+ $t();
39
39
  }
40
40
  }
41
- let $t, Tt;
42
- function jt(t) {
43
- const e = $t;
44
- $t = void 0;
41
+ let jt;
42
+ let zt;
43
+ function Ut(t) {
44
+ const e = jt;
45
+ jt = void 0;
45
46
  try {
46
47
  return t();
47
48
  } finally {
48
- $t = e;
49
+ jt = e;
49
50
  }
50
51
  }
51
- let zt, Ut = 0, Wt = 0, Bt = 0, Vt = 0, Gt = 0;
52
- function Zt(t) {
53
- if (void 0 === $t) return;
52
+ let Wt;
53
+ let Bt = 0;
54
+ let Vt = 0;
55
+ let Gt = 0;
56
+ let Zt = 0;
57
+ let Jt = 0;
58
+ function Ht(t) {
59
+ if (void 0 === jt) return;
54
60
  let e = t.n;
55
- return void 0 === e || e.t !== $t ? (e = {
61
+ return void 0 === e || e.t !== jt ? (e = {
56
62
  i: 0,
57
63
  S: t,
58
- p: $t.s,
64
+ p: jt.s,
59
65
  n: void 0,
60
- t: $t,
66
+ t: jt,
61
67
  e: void 0,
62
68
  x: void 0,
63
69
  r: e
64
- }, void 0 !== $t.s && ($t.s.n = e), $t.s = e, t.n = e, 32 & $t.f && t.S(e), e) : -1 === e.i ? (e.i = 0, void 0 !== e.n && (e.n.p = e.p, void 0 !== e.p && (e.p.n = e.n), e.p = $t.s, e.n = void 0, $t.s.n = e, $t.s = e), e) : void 0;
70
+ }, void 0 !== jt.s && (jt.s.n = e), jt.s = e, t.n = e, 32 & jt.f && t.S(e), e) : -1 === e.i ? (e.i = 0, void 0 !== e.n && (e.n.p = e.p, void 0 !== e.p && (e.p.n = e.n), e.p = jt.s, e.n = void 0, jt.s.n = e, jt.s = e), e) : void 0;
65
71
  }
66
- function Jt(t, e) {
72
+ function Xt(t, e) {
67
73
  this.v = t, this.i = 0, this.n = void 0, this.t = void 0, this.l = 0, this.W = null == e ? void 0 : e.watched, this.Z = null == e ? void 0 : e.unwatched, this.name = null == e ? void 0 : e.name;
68
74
  }
69
- function Ht(t, e) {
70
- return new Jt(t, e);
75
+ function Yt(t, e) {
76
+ return new Xt(t, e);
71
77
  }
72
- function Xt(t) {
78
+ function qt(t) {
73
79
  for (let e = t.s; void 0 !== e; e = e.n) if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i) return !0;
74
80
  return !1;
75
81
  }
76
- function Yt(t) {
82
+ function Qt(t) {
77
83
  for (let e = t.s; void 0 !== e; e = e.n) {
78
84
  const n = e.S.n;
79
85
  if (void 0 !== n && (e.r = n), e.S.n = e, e.i = -1, void 0 === e.n) {
@@ -82,7 +88,7 @@ function Yt(t) {
82
88
  }
83
89
  }
84
90
  }
85
- function qt(t) {
91
+ function te(t) {
86
92
  let e, n = t.s;
87
93
  for (; void 0 !== n;) {
88
94
  const t = n.p;
@@ -90,40 +96,40 @@ function qt(t) {
90
96
  }
91
97
  t.s = e;
92
98
  }
93
- function Qt(t, e) {
94
- Jt.call(this, void 0), this.x = t, this.s = void 0, this.g = Gt - 1, this.f = 4, this.W = null == e ? void 0 : e.watched, this.Z = null == e ? void 0 : e.unwatched, this.name = null == e ? void 0 : e.name;
99
+ function ee(t, e) {
100
+ Xt.call(this, void 0), this.x = t, this.s = void 0, this.g = Jt - 1, this.f = 4, this.W = null == e ? void 0 : e.watched, this.Z = null == e ? void 0 : e.unwatched, this.name = null == e ? void 0 : e.name;
95
101
  }
96
- function te(t, e) {
97
- return new Qt(t, e);
102
+ function ne(t, e) {
103
+ return new ee(t, e);
98
104
  }
99
- function ee(t) {
105
+ function ie(t) {
100
106
  const e = t.m;
101
107
  if (t.m = void 0, "function" == typeof e) {
102
- Ut++;
103
- const n = $t;
104
- $t = void 0;
108
+ Bt++;
109
+ const n = jt;
110
+ jt = void 0;
105
111
  try {
106
112
  e();
107
113
  } catch (e) {
108
- throw t.f &= -2, t.f |= 8, ne(t), e;
114
+ throw t.f &= -2, t.f |= 8, oe(t), e;
109
115
  } finally {
110
- $t = n, Pt();
116
+ jt = n, $t();
111
117
  }
112
118
  }
113
119
  }
114
- function ne(t) {
120
+ function oe(t) {
115
121
  for (let e = t.s; void 0 !== e; e = e.n) e.S.U(e);
116
- t.x = void 0, t.s = void 0, ee(t);
122
+ t.x = void 0, t.s = void 0, ie(t);
117
123
  }
118
- function ie(t) {
119
- if ($t !== this) throw new Error("Out-of-order effect");
120
- qt(this), $t = t, this.f &= -2, 8 & this.f && ne(this), Pt();
124
+ function se(t) {
125
+ if (jt !== this) throw new Error("Out-of-order effect");
126
+ te(this), jt = t, this.f &= -2, 8 & this.f && oe(this), $t();
121
127
  }
122
- function oe(t, e) {
128
+ function re(t, e) {
123
129
  this.x = t, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = null == e ? void 0 : e.name;
124
130
  }
125
- function se(t, e) {
126
- const n = new oe(t, e);
131
+ function ce(t, e) {
132
+ const n = new re(t, e);
127
133
  try {
128
134
  n.c();
129
135
  } catch (t) {
@@ -132,113 +138,113 @@ function se(t, e) {
132
138
  const i = n.d.bind(n);
133
139
  return i[Symbol.dispose] = i, i;
134
140
  }
135
- function re(t, e = {}) {
141
+ function ae(t, e = {}) {
136
142
  const n = {};
137
143
  for (const i in t) {
138
144
  const o = e[i];
139
- n[i] = Ht(void 0 === o ? t[i] : o);
145
+ n[i] = Yt(void 0 === o ? t[i] : o);
140
146
  }
141
147
  return n;
142
148
  }
143
- Jt.prototype.brand = At, Jt.prototype.h = function() {
149
+ Xt.prototype.brand = Kt, Xt.prototype.h = function() {
144
150
  return !0;
145
- }, Jt.prototype.S = function(t) {
151
+ }, Xt.prototype.S = function(t) {
146
152
  const e = this.t;
147
- e !== t && void 0 === t.e && (t.x = e, this.t = t, void 0 !== e ? e.e = t : jt(() => {
153
+ e !== t && void 0 === t.e && (t.x = e, this.t = t, void 0 !== e ? e.e = t : Ut(() => {
148
154
  var t;
149
155
  null == (t = this.W) || t.call(this);
150
156
  }));
151
- }, Jt.prototype.U = function(t) {
157
+ }, Xt.prototype.U = function(t) {
152
158
  if (void 0 !== this.t) {
153
159
  const e = t.e, n = t.x;
154
- void 0 !== e && (e.x = n, t.e = void 0), void 0 !== n && (n.e = e, t.x = void 0), t === this.t && (this.t = n, void 0 === n && jt(() => {
160
+ void 0 !== e && (e.x = n, t.e = void 0), void 0 !== n && (n.e = e, t.x = void 0), t === this.t && (this.t = n, void 0 === n && Ut(() => {
155
161
  var t;
156
162
  null == (t = this.Z) || t.call(this);
157
163
  }));
158
164
  }
159
- }, Jt.prototype.subscribe = function(t) {
160
- return se(() => {
161
- const e = this.value, n = $t;
162
- $t = void 0;
165
+ }, Xt.prototype.subscribe = function(t) {
166
+ return ce(() => {
167
+ const e = this.value, n = jt;
168
+ jt = void 0;
163
169
  try {
164
170
  t(e);
165
171
  } finally {
166
- $t = n;
172
+ jt = n;
167
173
  }
168
174
  }, { name: "sub" });
169
- }, Jt.prototype.valueOf = function() {
175
+ }, Xt.prototype.valueOf = function() {
170
176
  return this.value;
171
- }, Jt.prototype.toString = function() {
177
+ }, Xt.prototype.toString = function() {
172
178
  return this.value + "";
173
- }, Jt.prototype.toJSON = function() {
179
+ }, Xt.prototype.toJSON = function() {
174
180
  return this.value;
175
- }, Jt.prototype.peek = function() {
176
- const t = $t;
177
- $t = void 0;
181
+ }, Xt.prototype.peek = function() {
182
+ const t = jt;
183
+ jt = void 0;
178
184
  try {
179
185
  return this.value;
180
186
  } finally {
181
- $t = t;
187
+ jt = t;
182
188
  }
183
- }, Object.defineProperty(Jt.prototype, "value", {
189
+ }, Object.defineProperty(Xt.prototype, "value", {
184
190
  get() {
185
- const t = Zt(this);
191
+ const t = Ht(this);
186
192
  return void 0 !== t && (t.i = this.i), this.v;
187
193
  },
188
194
  set(t) {
189
195
  if (t !== this.v) {
190
- if (Wt > 100) throw new Error("Cycle detected");
196
+ if (Vt > 100) throw new Error("Cycle detected");
191
197
  (function(t) {
192
- 0 !== Ut && 0 === Wt && t.l !== Vt && (t.l = Vt, zt = {
198
+ 0 !== Bt && 0 === Vt && t.l !== Zt && (t.l = Zt, Wt = {
193
199
  S: t,
194
200
  v: t.v,
195
201
  i: t.i,
196
- o: zt
202
+ o: Wt
197
203
  });
198
- })(this), this.v = t, this.i++, Gt++, Ut++;
204
+ })(this), this.v = t, this.i++, Jt++, Bt++;
199
205
  try {
200
206
  for (let t = this.t; void 0 !== t; t = t.x) t.t.N();
201
207
  } finally {
202
- Pt();
208
+ $t();
203
209
  }
204
210
  }
205
211
  }
206
- }), Qt.prototype = new Jt(), Qt.prototype.h = function() {
212
+ }), ee.prototype = new Xt(), ee.prototype.h = function() {
207
213
  if (this.f &= -3, 1 & this.f) return !1;
208
214
  if (32 == (36 & this.f)) return !0;
209
- if (this.f &= -5, this.g === Gt) return !0;
210
- if (this.g = Gt, this.f |= 1, this.i > 0 && !Xt(this)) return this.f &= -2, !0;
211
- const t = $t;
215
+ if (this.f &= -5, this.g === Jt) return !0;
216
+ if (this.g = Jt, this.f |= 1, this.i > 0 && !qt(this)) return this.f &= -2, !0;
217
+ const t = jt;
212
218
  try {
213
- Yt(this), $t = this;
219
+ Qt(this), jt = this;
214
220
  const t = this.x();
215
221
  (16 & this.f || this.v !== t || 0 === this.i) && (this.v = t, this.f &= -17, this.i++);
216
222
  } catch (t) {
217
223
  this.v = t, this.f |= 16, this.i++;
218
224
  }
219
- return $t = t, qt(this), this.f &= -2, !0;
220
- }, Qt.prototype.S = function(t) {
225
+ return jt = t, te(this), this.f &= -2, !0;
226
+ }, ee.prototype.S = function(t) {
221
227
  if (void 0 === this.t) {
222
228
  this.f |= 36;
223
229
  for (let t = this.s; void 0 !== t; t = t.n) t.S.S(t);
224
230
  }
225
- Jt.prototype.S.call(this, t);
226
- }, Qt.prototype.U = function(t) {
227
- if (void 0 !== this.t && (Jt.prototype.U.call(this, t), void 0 === this.t)) {
231
+ Xt.prototype.S.call(this, t);
232
+ }, ee.prototype.U = function(t) {
233
+ if (void 0 !== this.t && (Xt.prototype.U.call(this, t), void 0 === this.t)) {
228
234
  this.f &= -33;
229
235
  for (let t = this.s; void 0 !== t; t = t.n) t.S.U(t);
230
236
  }
231
- }, Qt.prototype.N = function() {
237
+ }, ee.prototype.N = function() {
232
238
  if (!(2 & this.f)) {
233
239
  this.f |= 6;
234
240
  for (let t = this.t; void 0 !== t; t = t.x) t.t.N();
235
241
  }
236
- }, Object.defineProperty(Qt.prototype, "value", { get() {
242
+ }, Object.defineProperty(ee.prototype, "value", { get() {
237
243
  if (1 & this.f) throw new Error("Cycle detected");
238
- const t = Zt(this);
244
+ const t = Ht(this);
239
245
  if (this.h(), void 0 !== t && (t.i = this.i), 16 & this.f) throw this.v;
240
246
  return this.v;
241
- } }), oe.prototype.c = function() {
247
+ } }), re.prototype.c = function() {
242
248
  const t = this.S();
243
249
  try {
244
250
  if (8 & this.f) return;
@@ -248,20 +254,20 @@ Jt.prototype.brand = At, Jt.prototype.h = function() {
248
254
  } finally {
249
255
  t();
250
256
  }
251
- }, oe.prototype.S = function() {
257
+ }, re.prototype.S = function() {
252
258
  if (1 & this.f) throw new Error("Cycle detected");
253
- this.f |= 1, this.f &= -9, ee(this), Yt(this), Ut++;
254
- const t = $t;
255
- return $t = this, ie.bind(this, t);
256
- }, oe.prototype.N = function() {
257
- 2 & this.f || (this.f |= 2, this.u = Tt, Tt = this);
258
- }, oe.prototype.d = function() {
259
- this.f |= 8, 1 & this.f || ne(this);
260
- }, oe.prototype.dispose = function() {
259
+ this.f |= 1, this.f &= -9, ie(this), Qt(this), Bt++;
260
+ const t = jt;
261
+ return jt = this, se.bind(this, t);
262
+ }, re.prototype.N = function() {
263
+ 2 & this.f || (this.f |= 2, this.u = zt, zt = this);
264
+ }, re.prototype.d = function() {
265
+ this.f |= 8, 1 & this.f || oe(this);
266
+ }, re.prototype.dispose = function() {
261
267
  this.d();
262
268
  };
263
- const ce = /* @__PURE__ */ defineExtension({
264
- build: (t, e, n) => re(e),
269
+ const de = /* @__PURE__ */ defineExtension({
270
+ build: (t, e, n) => ae(e),
265
271
  config: /* @__PURE__ */ safeCast({
266
272
  defaultSelection: "rootEnd",
267
273
  disabled: !1
@@ -269,7 +275,7 @@ const ce = /* @__PURE__ */ defineExtension({
269
275
  name: "@lexical/extension/AutoFocus",
270
276
  register(t, e, i) {
271
277
  const o = i.getOutput();
272
- return se(() => o.disabled.value ? void 0 : t.registerRootListener((e) => {
278
+ return ce(() => o.disabled.value ? void 0 : t.registerRootListener((e) => {
273
279
  t.focus(() => {
274
280
  const t = null !== e ? getActiveElement(e) : null;
275
281
  null === e || null !== t && e.contains(t) || e.focus({ preventScroll: !0 });
@@ -277,26 +283,26 @@ const ce = /* @__PURE__ */ defineExtension({
277
283
  }));
278
284
  }
279
285
  });
280
- function ae() {
286
+ function le() {
281
287
  const t = $getRoot(), e = $getSelection(), n = $createParagraphNode();
282
288
  t.clear(), t.append(n), null !== e && n.select(), $isRangeSelection(e) && (e.format = 0);
283
289
  }
284
- function de(t, e = ae) {
285
- return t.registerCommand(CLEAR_EDITOR_COMMAND, (n) => (t.update(e), !0), COMMAND_PRIORITY_EDITOR);
290
+ function ue(t, e = le) {
291
+ return t.registerCommand(CLEAR_EDITOR_COMMAND, () => (e(), !0), COMMAND_PRIORITY_EDITOR);
286
292
  }
287
- const ue = /* @__PURE__ */ defineExtension({
288
- build: (t, e, n) => re(e),
289
- config: /* @__PURE__ */ safeCast({ $onClear: ae }),
293
+ const fe = /* @__PURE__ */ defineExtension({
294
+ build: (t, e, n) => ae(e),
295
+ config: /* @__PURE__ */ safeCast({ $onClear: le }),
290
296
  name: "@lexical/extension/ClearEditor",
291
297
  register(t, e, n) {
292
298
  const { $onClear: i } = n.getOutput();
293
- return se(() => de(t, i.value));
299
+ return ce(() => ue(t, i.value));
294
300
  }
295
301
  });
296
- function le(t) {
302
+ function he(t) {
297
303
  return !!$isDecoratorNode(t) || !(!$isElementNode(t) || !t.isShadowRoot());
298
304
  }
299
- function fe(t, e, n, i) {
305
+ function ge(t, e, n, i) {
300
306
  return !!t.isEditable() && n.target === e && t.read("latest", () => {
301
307
  const e = $getRoot().getLastChild();
302
308
  if (null === e) return !1;
@@ -304,37 +310,37 @@ function fe(t, e, n, i) {
304
310
  return null !== o && !(n.clientY <= o.getBoundingClientRect().bottom) && i(e);
305
311
  });
306
312
  }
307
- const he = /* @__PURE__ */ defineExtension({
308
- build: (t, e) => re(e),
313
+ const pe = /* @__PURE__ */ defineExtension({
314
+ build: (t, e) => ae(e),
309
315
  config: /* @__PURE__ */ safeCast({
310
- $shouldInsertAfter: le,
316
+ $shouldInsertAfter: he,
311
317
  disabled: !1
312
318
  }),
313
319
  name: "@lexical/ClickAfterLastBlock",
314
- register: (t, e, n) => se(() => {
320
+ register: (t, e, n) => ce(() => {
315
321
  const e = n.getOutput();
316
322
  if (!e.disabled.value) return t.registerRootListener((n) => {
317
323
  if (null === n) return;
318
- const i = (i) => {
319
- fe(t, n, i, e.$shouldInsertAfter.peek()) && i.preventDefault();
320
- }, o = (i) => {
321
- fe(t, n, i, e.$shouldInsertAfter.peek()) && (i.preventDefault(), stopLexicalPropagation(i), t.update(() => {
322
- const t = $getRoot().getLastChild();
323
- if (null === t) return;
324
- if (!e.$shouldInsertAfter.peek()(t)) return;
325
- const n = $createParagraphNode();
326
- t.insertAfter(n), n.select();
327
- }));
328
- };
329
- return n.addEventListener("mousedown", i, !0), n.addEventListener("click", o, !0), () => {
330
- n.removeEventListener("mousedown", i, !0), n.removeEventListener("click", o, !0);
331
- };
324
+ return registerEventListeners(n, {
325
+ click: (i) => {
326
+ ge(t, n, i, e.$shouldInsertAfter.peek()) && (i.preventDefault(), stopLexicalPropagation(i), t.update(() => {
327
+ const t = $getRoot().getLastChild();
328
+ if (null === t) return;
329
+ if (!e.$shouldInsertAfter.peek()(t)) return;
330
+ const n = $createParagraphNode();
331
+ t.insertAfter(n), n.select();
332
+ }));
333
+ },
334
+ mousedown: (i) => {
335
+ ge(t, n, i, e.$shouldInsertAfter.peek()) && i.preventDefault();
336
+ }
337
+ }, !0);
332
338
  });
333
339
  })
334
340
  });
335
- function ge(t) {
341
+ function me(t) {
336
342
  const e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
337
- for (const i of pe(t)) {
343
+ for (const i of ve(t)) {
338
344
  const t = "function" == typeof i ? i : i.replace;
339
345
  getStaticNodeConfig(t), e.add(t.getType()), n.add(t);
340
346
  }
@@ -343,22 +349,25 @@ function ge(t) {
343
349
  types: e
344
350
  };
345
351
  }
346
- function pe(t) {
352
+ function ve(t) {
347
353
  return ("function" == typeof t.nodes ? t.nodes() : t.nodes) || [];
348
354
  }
349
- const me = /* @__PURE__ */ createState("format", { parse: (t) => "number" == typeof t ? t : 0 });
350
- var ve = class extends DecoratorNode {
355
+ const ye = /* @__PURE__ */ createState("format", { parse: (t) => "number" == typeof t ? t : 0 });
356
+ var xe = class extends DecoratorNode {
357
+ get __isInlineFormattable() {
358
+ return !0;
359
+ }
351
360
  $config() {
352
361
  return this.config("decorator-text", {
353
362
  extends: DecoratorNode,
354
363
  stateConfigs: [{
355
364
  flat: !0,
356
- stateConfig: me
365
+ stateConfig: ye
357
366
  }]
358
367
  });
359
368
  }
360
- getFormat() {
361
- return $getState(this, me);
369
+ getFormat(t) {
370
+ return $getState(this, ye, t);
362
371
  }
363
372
  getFormatFlags(t, e) {
364
373
  return toggleTextFormatType(this.getFormat(), t, e);
@@ -368,7 +377,7 @@ var ve = class extends DecoratorNode {
368
377
  return 0 !== (this.getFormat() & e);
369
378
  }
370
379
  setFormat(t) {
371
- return $setState(this, me, t);
380
+ return $setState(this, ye, t);
372
381
  }
373
382
  toggleFormat(t) {
374
383
  const n = toggleTextFormatType(this.getFormat(), t, null);
@@ -377,29 +386,28 @@ var ve = class extends DecoratorNode {
377
386
  isInline() {
378
387
  return !0;
379
388
  }
380
- createDOM() {
381
- return document.createElement("span");
382
- }
383
- updateDOM() {
384
- return !1;
389
+ createDOM(t, e) {
390
+ return $getDocument().createElement("span");
385
391
  }
386
392
  };
387
393
  function Ee(t) {
388
- return t instanceof ve;
394
+ return t instanceof xe;
389
395
  }
390
- function ye(t, e, n) {
396
+ function be(t, e, n) {
391
397
  const i = e.fontWeight, o = e.textDecoration.split(" "), s = "700" === i || "bold" === i, r = o.includes("line-through"), c = "italic" === e.fontStyle, a = o.includes("underline"), d = e.verticalAlign;
392
398
  return s && !t.hasFormat("bold") && t.toggleFormat("bold"), r && !t.hasFormat("strikethrough") && t.toggleFormat("strikethrough"), c && !t.hasFormat("italic") && t.toggleFormat("italic"), a && !t.hasFormat("underline") && t.toggleFormat("underline"), "sub" !== d || t.hasFormat("subscript") || t.toggleFormat("subscript"), "super" !== d || t.hasFormat("superscript") || t.toggleFormat("superscript"), n && !t.hasFormat(n) && t.toggleFormat(n), t;
393
399
  }
394
- function xe(t, e, n = Se) {
395
- for (const [i, o] of Object.entries(n)) t.hasFormat(o) && (e = be(e, i));
396
- return e;
400
+ function Se(t, e, n = Oe) {
401
+ let i = e;
402
+ for (const [e, o] of Object.entries(n)) t.hasFormat(o) && (i = Ne(i, e));
403
+ return i;
397
404
  }
398
- function be(t, e) {
399
- const n = document.createElement(e);
405
+ const we = Se;
406
+ function Ne(t, e) {
407
+ const n = t.ownerDocument.createElement(e);
400
408
  return n.appendChild(t), n;
401
409
  }
402
- const Se = {
410
+ const Oe = {
403
411
  b: "bold",
404
412
  code: "code",
405
413
  em: "italic",
@@ -410,18 +418,14 @@ const Se = {
410
418
  sub: "subscript",
411
419
  sup: "superscript",
412
420
  u: "underline"
413
- }, we = /* @__PURE__ */ defineExtension({
421
+ };
422
+ const Re = /* @__PURE__ */ defineExtension({
414
423
  name: "@lexical/extension/DecoratorText",
415
- nodes: () => [ve],
416
- register: (t, e, n) => t.registerCommand(FORMAT_TEXT_COMMAND, (t) => {
417
- const e = $getSelection();
418
- if ($isNodeSelection(e) || $isRangeSelection(e)) for (const n of e.getNodes()) Ee(n) && n.toggleFormat(t);
419
- return !1;
420
- }, COMMAND_PRIORITY_LOW)
424
+ nodes: () => [xe]
421
425
  });
422
- function Ne(t, e) {
426
+ function Ce(t, e) {
423
427
  let n;
424
- return Ht(t(), {
428
+ return Yt(t(), {
425
429
  unwatched() {
426
430
  n && (n(), n = void 0);
427
431
  },
@@ -430,49 +434,57 @@ function Ne(t, e) {
430
434
  }
431
435
  });
432
436
  }
433
- const Oe = /* @__PURE__ */ defineExtension({
434
- build: (t) => Ne(() => t.getEditorState(), (e) => t.registerUpdateListener((t) => {
437
+ const De = /* @__PURE__ */ defineExtension({
438
+ build: (t) => Ce(() => t.getEditorState(), (e) => t.registerUpdateListener((t) => {
435
439
  e.value = t.editorState;
436
440
  })),
437
441
  name: "@lexical/extension/EditorState"
438
442
  });
439
- function Ce(t, ...e) {
443
+ function Ie(t, ...e) {
440
444
  const n = new URL("https://lexical.dev/docs/error"), i = new URLSearchParams();
441
445
  i.append("code", t);
442
446
  for (const t of e) i.append("v", t);
443
447
  throw n.search = i.toString(), Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
444
448
  }
445
- let Re;
449
+ let Fe;
446
450
  try {
447
- Re = "0.46.0+prod.esm";
451
+ Fe = "0.48.0+prod.esm";
448
452
  } catch (t) {}
449
- const De = Re ?? "\"<unknown>+source\"", Ie = /* @__PURE__ */ new Set([
453
+ const Me = Fe ?? "\"<unknown>+source\"";
454
+ const _e = /* @__PURE__ */ new Set([
450
455
  "__proto__",
451
456
  "constructor",
452
457
  "prototype"
453
458
  ]);
454
- function Fe(t, e) {
459
+ function ke(t, e) {
455
460
  if (t && e && !Array.isArray(e) && "object" == typeof t && "object" == typeof e) {
456
461
  const n = t, i = e;
457
- for (const t in i) !Ie.has(t) && Object.prototype.hasOwnProperty.call(i, t) && (n[t] = Fe(n[t], i[t]));
462
+ for (const t in i) !_e.has(t) && Object.prototype.hasOwnProperty.call(i, t) && (n[t] = ke(n[t], i[t]));
458
463
  return t;
459
464
  }
460
465
  return e;
461
466
  }
462
- const Me = 0, ke = 1, Le = 2, _e = 3, Ae = 4, Pe = 5, Ke = 6, $e = 7;
463
- function Te(t) {
464
- return t.id === Me;
467
+ const Ae = 0;
468
+ const Pe = 1;
469
+ const Le = 2;
470
+ const Ke = 3;
471
+ const $e = 4;
472
+ const Te = 5;
473
+ const je = 6;
474
+ const ze = 7;
475
+ function Ue(t) {
476
+ return t.id === Ae;
465
477
  }
466
- function je(t) {
478
+ function We(t) {
467
479
  return t.id === Le;
468
480
  }
469
- function ze(t) {
481
+ function Be(t) {
470
482
  return function(t) {
471
- return t.id === ke;
472
- }(t) || Ce(305, String(t.id), String(ke)), Object.assign(t, { id: Le });
483
+ return t.id === Pe;
484
+ }(t) || Ie(305, String(t.id), String(Pe)), Object.assign(t, { id: Le });
473
485
  }
474
- const Ue = /* @__PURE__ */ new Set();
475
- var We = class {
486
+ const Ve = /* @__PURE__ */ new Set();
487
+ var Ge = class {
476
488
  builder;
477
489
  configs;
478
490
  _dependency;
@@ -481,7 +493,7 @@ var We = class {
481
493
  state;
482
494
  _signal;
483
495
  constructor(t, e) {
484
- this.builder = t, this.extension = e, this.configs = /* @__PURE__ */ new Set(), this.state = { id: Me };
496
+ this.builder = t, this.extension = e, this.configs = /* @__PURE__ */ new Set(), this.state = { id: Ae };
485
497
  }
486
498
  mergeConfigs() {
487
499
  let t = this.extension.config || {};
@@ -491,7 +503,7 @@ var We = class {
491
503
  }
492
504
  init(t) {
493
505
  const e = this.state;
494
- je(e) || Ce(306, String(e.id));
506
+ We(e) || Ie(306, String(e.id));
495
507
  const n = {
496
508
  getDependency: this.getInitDependency.bind(this),
497
509
  getDirectDependentNames: this.getDirectDependentNames.bind(this),
@@ -505,14 +517,14 @@ var We = class {
505
517
  }, o = function(t, e, n) {
506
518
  return Object.assign(t, {
507
519
  config: e,
508
- id: _e,
520
+ id: Ke,
509
521
  registerState: n
510
522
  });
511
523
  }(e, this.mergeConfigs(), n);
512
524
  let s;
513
525
  this.state = o, this.extension.init && (s = this.extension.init(t, o.config, n)), this.state = function(t, e, n) {
514
526
  return Object.assign(t, {
515
- id: Ae,
527
+ id: $e,
516
528
  initResult: e,
517
529
  registerState: n
518
530
  });
@@ -521,7 +533,7 @@ var We = class {
521
533
  build(t) {
522
534
  const e = this.state;
523
535
  let n;
524
- e.id !== Ae && Ce(307, String(e.id), String(Pe)), this.extension.build && (n = this.extension.build(t, e.config, e.registerState));
536
+ e.id !== $e && Ie(307, String(e.id), String(Te)), this.extension.build && (n = this.extension.build(t, e.config, e.registerState));
525
537
  const i = {
526
538
  ...e.registerState,
527
539
  getOutput: () => n,
@@ -529,7 +541,7 @@ var We = class {
529
541
  };
530
542
  this.state = function(t, e, n) {
531
543
  return Object.assign(t, {
532
- id: Pe,
544
+ id: Te,
533
545
  output: e,
534
546
  registerState: n
535
547
  });
@@ -538,33 +550,33 @@ var We = class {
538
550
  register(t, e) {
539
551
  this._signal = e;
540
552
  const n = this.state;
541
- n.id !== Pe && Ce(308, String(n.id), String(Pe));
553
+ n.id !== Te && Ie(308, String(n.id), String(Te));
542
554
  const i = this.extension.register && this.extension.register(t, n.config, n.registerState);
543
555
  return this.state = function(t) {
544
- return Object.assign(t, { id: Ke });
556
+ return Object.assign(t, { id: je });
545
557
  }(n), () => {
546
558
  const t = this.state;
547
- t.id !== $e && Ce(309, String(n.id), String($e)), this.state = function(t) {
548
- return Object.assign(t, { id: Pe });
559
+ t.id !== ze && Ie(309, String(n.id), String(ze)), this.state = function(t) {
560
+ return Object.assign(t, { id: Te });
549
561
  }(t), i && i();
550
562
  };
551
563
  }
552
564
  afterRegistration(t) {
553
565
  const e = this.state;
554
566
  let n;
555
- return e.id !== Ke && Ce(310, String(e.id), String(Ke)), this.extension.afterRegistration && (n = this.extension.afterRegistration(t, e.config, e.registerState)), this.state = function(t) {
556
- return Object.assign(t, { id: $e });
567
+ return e.id !== je && Ie(310, String(e.id), String(je)), this.extension.afterRegistration && (n = this.extension.afterRegistration(t, e.config, e.registerState)), this.state = function(t) {
568
+ return Object.assign(t, { id: ze });
557
569
  }(e), n;
558
570
  }
559
571
  getSignal() {
560
- return void 0 === this._signal && Ce(311), this._signal;
572
+ return void 0 === this._signal && Ie(311), this._signal;
561
573
  }
562
574
  getInitResult() {
563
- void 0 === this.extension.init && Ce(312, this.extension.name);
575
+ void 0 === this.extension.init && Ie(312, this.extension.name);
564
576
  const t = this.state;
565
577
  return function(t) {
566
- return t.id >= Ae;
567
- }(t) || Ce(313, String(t.id), String(Ae)), t.initResult;
578
+ return t.id >= $e;
579
+ }(t) || Ie(313, String(t.id), String($e)), t.initResult;
568
580
  }
569
581
  getInitPeer(t) {
570
582
  const e = this.builder.extensionNameMap.get(t);
@@ -573,8 +585,8 @@ var We = class {
573
585
  getExtensionInitDependency() {
574
586
  const t = this.state;
575
587
  return function(t) {
576
- return t.id >= _e;
577
- }(t) || Ce(314, String(t.id), String(_e)), { config: t.config };
588
+ return t.id >= Ke;
589
+ }(t) || Ie(314, String(t.id), String(Ke)), { config: t.config };
578
590
  }
579
591
  getPeer(t) {
580
592
  const e = this.builder.extensionNameMap.get(t);
@@ -582,20 +594,20 @@ var We = class {
582
594
  }
583
595
  getInitDependency(t) {
584
596
  const e = this.builder.getExtensionRep(t);
585
- return void 0 === e && Ce(315, this.extension.name, t.name), e.getExtensionInitDependency();
597
+ return void 0 === e && Ie(315, this.extension.name, t.name), e.getExtensionInitDependency();
586
598
  }
587
599
  getDependency(t) {
588
600
  const e = this.builder.getExtensionRep(t);
589
- return void 0 === e && Ce(315, this.extension.name, t.name), e.getExtensionDependency();
601
+ return void 0 === e && Ie(315, this.extension.name, t.name), e.getExtensionDependency();
590
602
  }
591
603
  getState() {
592
604
  const t = this.state;
593
605
  return function(t) {
594
- return t.id >= $e;
595
- }(t) || Ce(316, String(t.id), String($e)), t;
606
+ return t.id >= ze;
607
+ }(t) || Ie(316, String(t.id), String(ze)), t;
596
608
  }
597
609
  getDirectDependentNames() {
598
- return this.builder.incomingEdges.get(this.extension.name) || Ue;
610
+ return this.builder.incomingEdges.get(this.extension.name) || Ve;
599
611
  }
600
612
  getPeerNameSet() {
601
613
  let t = this._peerNameSet;
@@ -605,8 +617,8 @@ var We = class {
605
617
  if (!this._dependency) {
606
618
  const t = this.state;
607
619
  (function(t) {
608
- return t.id >= Pe;
609
- })(t) || Ce(317, this.extension.name), this._dependency = {
620
+ return t.id >= Te;
621
+ })(t) || Ie(317, this.extension.name), this._dependency = {
610
622
  config: t.config,
611
623
  init: t.initResult,
612
624
  output: t.output
@@ -615,17 +627,17 @@ var We = class {
615
627
  return this._dependency;
616
628
  }
617
629
  };
618
- const Be = { tag: HISTORY_MERGE_TAG };
619
- function Ve() {
630
+ const Ze = { tag: HISTORY_MERGE_TAG };
631
+ function Je() {
620
632
  const t = $getRoot();
621
633
  t.isEmpty() && t.append($createParagraphNode());
622
634
  }
623
- const Ge = /* @__PURE__ */ defineExtension({
635
+ const He = /* @__PURE__ */ defineExtension({
624
636
  config: /* @__PURE__ */ safeCast({
625
- setOptions: Be,
626
- updateOptions: Be
637
+ setOptions: Ze,
638
+ updateOptions: Ze
627
639
  }),
628
- init: ({ $initialEditorState: t = Ve }) => ({
640
+ init: ({ $initialEditorState: t = Je }) => ({
629
641
  $initialEditorState: t,
630
642
  initialized: !1
631
643
  }),
@@ -653,19 +665,20 @@ const Ge = /* @__PURE__ */ defineExtension({
653
665
  TabNode,
654
666
  ParagraphNode
655
667
  ]
656
- }), Ze = Symbol.for("@lexical/extension/LexicalBuilder");
657
- function Je(...t) {
658
- return Qe.fromExtensions(t).buildEditor();
668
+ });
669
+ const Xe = Symbol.for("@lexical/extension/LexicalBuilder");
670
+ function Ye(...t) {
671
+ return nn.fromExtensions(t).buildEditor();
659
672
  }
660
- function He() {}
661
- function Xe(t) {
673
+ function qe() {}
674
+ function Qe(t) {
662
675
  throw t;
663
676
  }
664
- function Ye(t) {
677
+ function tn(t) {
665
678
  return Array.isArray(t) ? t : [t];
666
679
  }
667
- const qe = De;
668
- var Qe = class Qe {
680
+ const en = Me;
681
+ var nn = class nn {
669
682
  roots;
670
683
  extensionNameMap;
671
684
  outgoingConfigEdges;
@@ -674,21 +687,21 @@ var Qe = class Qe {
674
687
  _sortedExtensionReps;
675
688
  PACKAGE_VERSION;
676
689
  constructor(t) {
677
- this.outgoingConfigEdges = /* @__PURE__ */ new Map(), this.incomingEdges = /* @__PURE__ */ new Map(), this.extensionNameMap = /* @__PURE__ */ new Map(), this.conflicts = /* @__PURE__ */ new Map(), this.PACKAGE_VERSION = qe, this.roots = t;
690
+ this.outgoingConfigEdges = /* @__PURE__ */ new Map(), this.incomingEdges = /* @__PURE__ */ new Map(), this.extensionNameMap = /* @__PURE__ */ new Map(), this.conflicts = /* @__PURE__ */ new Map(), this.PACKAGE_VERSION = en, this.roots = t;
678
691
  for (const e of t) this.addExtension(e);
679
692
  }
680
693
  static fromExtensions(t) {
681
- const e = [Ye(Ge)];
682
- for (const n of t) e.push(Ye(n));
683
- return new Qe(e);
694
+ const e = [tn(He)];
695
+ for (const n of t) e.push(tn(n));
696
+ return new nn(e);
684
697
  }
685
698
  static maybeFromEditor(t) {
686
- const e = t[Ze];
687
- return e && (e.PACKAGE_VERSION !== qe && Ce(292, e.PACKAGE_VERSION, qe), e instanceof Qe || Ce(293)), e;
699
+ const e = t[Xe];
700
+ return e && (e.PACKAGE_VERSION !== en && Ie(292, e.PACKAGE_VERSION, en), e instanceof nn || Ie(293)), e;
688
701
  }
689
702
  static fromEditor(t) {
690
- const e = Qe.maybeFromEditor(t);
691
- return void 0 === e && Ce(294), e;
703
+ const e = nn.maybeFromEditor(t);
704
+ return void 0 === e && Ie(294), e;
692
705
  }
693
706
  constructEditor() {
694
707
  const { $initialEditorState: t, onError: e, onWarn: n, ...i } = this.buildCreateEditorArgs(), o = Object.assign(createEditor({
@@ -699,17 +712,17 @@ var Qe = class Qe {
699
712
  ...n ? { onWarn: (t) => {
700
713
  n(t, o);
701
714
  } } : {}
702
- }), { [Ze]: this });
715
+ }), { [Xe]: this });
703
716
  for (const t of this.sortedExtensionReps()) t.build(o);
704
717
  return o;
705
718
  }
706
719
  buildEditor() {
707
- let t = He;
720
+ let t = qe;
708
721
  function e() {
709
722
  try {
710
723
  t();
711
724
  } finally {
712
- t = He;
725
+ t = qe;
713
726
  }
714
727
  }
715
728
  const n = Object.assign(this.constructEditor(), {
@@ -723,7 +736,7 @@ var Qe = class Qe {
723
736
  }
724
737
  getExtensionRep(t) {
725
738
  const e = this.extensionNameMap.get(t.name);
726
- if (e) return e.extension !== t && Ce(295, t.name), e;
739
+ if (e) return e.extension !== t && Ie(295, t.name), e;
727
740
  }
728
741
  addEdge(t, e, n) {
729
742
  const i = this.outgoingConfigEdges.get(t);
@@ -732,17 +745,17 @@ var Qe = class Qe {
732
745
  o ? o.add(t) : this.incomingEdges.set(e, /* @__PURE__ */ new Set([t]));
733
746
  }
734
747
  addExtension(t) {
735
- void 0 !== this._sortedExtensionReps && Ce(296);
736
- const [n] = Ye(t);
737
- "string" != typeof n.name && Ce(297, typeof n.name);
748
+ void 0 !== this._sortedExtensionReps && Ie(296);
749
+ const [n] = tn(t);
750
+ "string" != typeof n.name && Ie(297, typeof n.name);
738
751
  let i = this.extensionNameMap.get(n.name);
739
- if (void 0 !== i && i.extension !== n && Ce(298, n.name), !i) {
740
- i = new We(this, n), this.extensionNameMap.set(n.name, i);
752
+ if (void 0 !== i && i.extension !== n && Ie(298, n.name), !i) {
753
+ i = new Ge(this, n), this.extensionNameMap.set(n.name, i);
741
754
  const t = this.conflicts.get(n.name);
742
- "string" == typeof t && Ce(299, n.name, t);
743
- for (const t of n.conflictsWith || []) this.extensionNameMap.has(t) && Ce(299, n.name, t), this.conflicts.set(t, n.name);
755
+ "string" == typeof t && Ie(299, n.name, t);
756
+ for (const t of n.conflictsWith || []) this.extensionNameMap.has(t) && Ie(299, n.name, t), this.conflicts.set(t, n.name);
744
757
  for (const t of n.dependencies || []) {
745
- const e = Ye(t);
758
+ const e = tn(t);
746
759
  this.addEdge(n.name, e[0].name, e.slice(1)), this.addExtension(e);
747
760
  }
748
761
  for (const [t, e] of n.peerDependencies || []) this.addEdge(n.name, t, e ? [e] : []);
@@ -752,25 +765,25 @@ var Qe = class Qe {
752
765
  if (this._sortedExtensionReps) return this._sortedExtensionReps;
753
766
  const t = [], e = (n, i) => {
754
767
  let o = n.state;
755
- if (je(o)) return;
768
+ if (We(o)) return;
756
769
  const s = n.extension.name;
757
770
  var r;
758
- Te(o) || Ce(300, s, i || "[unknown]"), Te(r = o) || Ce(304, String(r.id), String(Me)), o = Object.assign(r, { id: ke }), n.state = o;
771
+ Ue(o) || Ie(300, s, i || "[unknown]"), Ue(r = o) || Ie(304, String(r.id), String(Ae)), o = Object.assign(r, { id: Pe }), n.state = o;
759
772
  const c = this.outgoingConfigEdges.get(s);
760
773
  if (c) for (const t of c.keys()) {
761
774
  const n = this.extensionNameMap.get(t);
762
775
  n && e(n, s);
763
776
  }
764
- o = ze(o), n.state = o, t.push(n);
777
+ o = Be(o), n.state = o, t.push(n);
765
778
  };
766
- for (const t of this.extensionNameMap.values()) Te(t.state) && e(t);
779
+ for (const t of this.extensionNameMap.values()) Ue(t.state) && e(t);
767
780
  for (const e of t) for (const [t, n] of this.outgoingConfigEdges.get(e.extension.name) || []) if (n.length > 0) {
768
781
  const e = this.extensionNameMap.get(t);
769
782
  if (e) for (const t of n) e.configs.add(t);
770
783
  }
771
784
  for (const [t, ...e] of this.roots) if (e.length > 0) {
772
785
  const n = this.extensionNameMap.get(t.name);
773
- void 0 === n && Ce(301, t.name);
786
+ void 0 === n && Ie(301, t.name);
774
787
  for (const t of e) n.configs.add(t);
775
788
  }
776
789
  return this._sortedExtensionReps = t, this._sortedExtensionReps;
@@ -791,10 +804,10 @@ var Qe = class Qe {
791
804
  const t = {}, e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), o = {}, s = {}, r = this.sortedExtensionReps();
792
805
  for (const c of r) {
793
806
  const { extension: r } = c;
794
- if (void 0 !== r.onError && (t.onError = r.onError), void 0 !== r.onWarn && (t.onWarn = r.onWarn), void 0 !== r.disableEvents && (t.disableEvents = r.disableEvents), void 0 !== r.parentEditor && (t.parentEditor = r.parentEditor), void 0 !== r.editable && (t.editable = r.editable), void 0 !== r.namespace && (t.namespace = r.namespace), void 0 !== r.$initialEditorState && (t.$initialEditorState = r.$initialEditorState), r.nodes) for (const t of pe(r)) {
807
+ if (void 0 !== r.onError && (t.onError = r.onError), void 0 !== r.onWarn && (t.onWarn = r.onWarn), void 0 !== r.disableEvents && (t.disableEvents = r.disableEvents), void 0 !== r.parentEditor && (t.parentEditor = r.parentEditor), void 0 !== r.editable && (t.editable = r.editable), void 0 !== r.namespace && (t.namespace = r.namespace), void 0 !== r.$initialEditorState && (t.$initialEditorState = r.$initialEditorState), r.nodes) for (const t of ve(r)) {
795
808
  if ("function" != typeof t) {
796
809
  const e = n.get(t.replace);
797
- e && Ce(302, r.name, t.replace.name, e.extension.name), n.set(t.replace, c);
810
+ e && Ie(302, r.name, t.replace.name, e.extension.name), n.set(t.replace, c);
798
811
  }
799
812
  e.add(t);
800
813
  }
@@ -802,41 +815,42 @@ var Qe = class Qe {
802
815
  if (r.html.export) for (const [t, e] of r.html.export.entries()) i.set(t, e);
803
816
  r.html.import && Object.assign(o, r.html.import);
804
817
  }
805
- r.theme && Fe(s, r.theme);
818
+ r.theme && ke(s, r.theme);
806
819
  }
807
820
  Object.keys(s).length > 0 && (t.theme = s), e.size && (t.nodes = [...e]);
808
821
  const c = Object.keys(o).length > 0, a = i.size > 0;
809
822
  (c || a) && (t.html = {}, c && (t.html.import = o), a && (t.html.export = i));
810
823
  for (const e of r) e.init(t);
811
- return t.onError || (t.onError = Xe), t;
824
+ return t.onError || (t.onError = Qe), t;
812
825
  }
813
826
  };
814
- function tn(t, e) {
815
- const n = Qe.fromEditor(t).getExtensionRep(e);
816
- return void 0 === n && Ce(303, e.name), n.getExtensionDependency();
827
+ function on(t, e) {
828
+ const n = nn.fromEditor(t).getExtensionRep(e);
829
+ return void 0 === n && Ie(303, e.name), n.getExtensionDependency();
817
830
  }
818
- function en(t, e) {
819
- const n = Qe.maybeFromEditor(t);
831
+ function sn(t, e) {
832
+ const n = nn.maybeFromEditor(t);
820
833
  if (!n) return;
821
834
  const i = n.extensionNameMap.get(e);
822
835
  return i ? i.getExtensionDependency() : void 0;
823
836
  }
824
- function nn(t, e) {
825
- const n = en(t, e);
826
- return void 0 === n && Ce(291, e), n;
837
+ function rn(t, e) {
838
+ const n = sn(t, e);
839
+ return void 0 === n && Ie(291, e), n;
827
840
  }
828
- function on(t) {
829
- return tn($getEditor(), t);
841
+ function cn(t) {
842
+ return on($getEditor(), t);
830
843
  }
831
- function sn(t) {
832
- return on(t).output;
844
+ function an(t) {
845
+ return cn(t).output;
833
846
  }
834
- function rn(t) {
835
- return en($getEditor(), t);
847
+ function dn(t) {
848
+ return sn($getEditor(), t);
836
849
  }
837
- const cn = /* @__PURE__ */ new Set(), an = /* @__PURE__ */ defineExtension({
850
+ const ln = /* @__PURE__ */ new Set();
851
+ const un = /* @__PURE__ */ defineExtension({
838
852
  build(t, e, n) {
839
- const i = n.getDependency(Oe).output, o = Ht({ watchedNodeKeys: /* @__PURE__ */ new Map() }), s = Ne(() => {}, () => se(() => {
853
+ const i = n.getDependency(De).output, o = Yt({ watchedNodeKeys: /* @__PURE__ */ new Map() }), s = Ce(() => {}, () => ce(() => {
840
854
  const t = s.peek(), { watchedNodeKeys: e } = o.value;
841
855
  let n, c = !1;
842
856
  i.value.read(() => {
@@ -851,36 +865,37 @@ const cn = /* @__PURE__ */ new Set(), an = /* @__PURE__ */ defineExtension({
851
865
  }), !c && n && t && n.size === t.size || (s.value = n);
852
866
  }));
853
867
  return { watchNodeKey: function(t) {
854
- const e = te(() => (s.value || cn).has(t)), { watchedNodeKeys: n } = o.peek();
868
+ const e = ne(() => (s.value || ln).has(t)), { watchedNodeKeys: n } = o.peek();
855
869
  let i = n.get(t);
856
870
  const r = void 0 !== i;
857
871
  return i = i || /* @__PURE__ */ new Set(), i.add(e), r || (n.set(t, i), o.value = { watchedNodeKeys: n }), e;
858
872
  } };
859
873
  },
860
- dependencies: [Oe],
874
+ dependencies: [De],
861
875
  name: "@lexical/extension/NodeSelection"
862
- }), dn = /* @__PURE__ */ createCommand("INSERT_HORIZONTAL_RULE_COMMAND");
863
- var un = class un extends DecoratorNode {
876
+ });
877
+ const fn = /* @__PURE__ */ createCommand("INSERT_HORIZONTAL_RULE_COMMAND");
878
+ var hn = class hn extends DecoratorNode {
864
879
  static getType() {
865
880
  return "horizontalrule";
866
881
  }
867
882
  static clone(t) {
868
- return new un(t.__key);
883
+ return new hn(t.__key);
869
884
  }
870
885
  static importJSON(t) {
871
- return fn().updateFromJSON(t);
886
+ return pn().updateFromJSON(t);
872
887
  }
873
888
  static importDOM() {
874
889
  return { hr: () => ({
875
- conversion: ln,
890
+ conversion: gn,
876
891
  priority: 0
877
892
  }) };
878
893
  }
879
894
  exportDOM() {
880
- return { element: document.createElement("hr") };
895
+ return { element: $getDocument().createElement("hr") };
881
896
  }
882
897
  createDOM(t) {
883
- const e = document.createElement("hr");
898
+ const e = $getDocument().createElement("hr");
884
899
  return addClassNamesToElement(e, t.theme.hr), e;
885
900
  }
886
901
  getTextContent() {
@@ -893,63 +908,64 @@ var un = class un extends DecoratorNode {
893
908
  return !1;
894
909
  }
895
910
  };
896
- function ln() {
897
- return { node: fn() };
911
+ function gn() {
912
+ return { node: pn() };
898
913
  }
899
- function fn() {
900
- return $create(un);
914
+ function pn() {
915
+ return $create(hn);
901
916
  }
902
- function hn(t) {
903
- return t instanceof un;
917
+ function mn(t) {
918
+ return t instanceof hn;
904
919
  }
905
- const gn = /* @__PURE__ */ defineExtension({
906
- dependencies: [Oe, an],
920
+ const vn = /* @__PURE__ */ defineExtension({
921
+ dependencies: [De, un],
907
922
  name: "@lexical/extension/HorizontalRule",
908
- nodes: () => [un],
923
+ nodes: () => [hn],
909
924
  register(t, e, n) {
910
- const { watchNodeKey: i } = n.getDependency(an).output, s = Ht({ nodeSelections: /* @__PURE__ */ new Map() }), c = t._config.theme.hrSelected ?? "selected";
911
- return mergeRegister(t.registerCommand(dn, (t) => {
925
+ const { watchNodeKey: i } = n.getDependency(un).output, s = Yt({ nodeSelections: /* @__PURE__ */ new Map() }), c = t._config.theme.hrSelected ?? "selected";
926
+ return mergeRegister(t.registerCommand(fn, (t) => {
912
927
  const e = $getSelection();
913
928
  if (!$isRangeSelection(e)) return !1;
914
- if (null !== e.focus.getNode()) $insertNodeToNearestRoot(fn());
929
+ if (null !== e.focus.getNode()) $insertNodeToNearestRoot(pn());
915
930
  return !0;
916
931
  }, COMMAND_PRIORITY_EDITOR), t.registerCommand(CLICK_COMMAND, (t) => {
917
932
  if (isDOMNode(t.target)) {
918
933
  const e = $getNodeFromDOMNode(t.target);
919
- if (hn(e)) return function(t, e = !1) {
934
+ if (mn(e)) return function(t, e = !1) {
920
935
  const n = $getSelection(), i = t.isSelected(), o = t.getKey();
921
936
  let s;
922
937
  e && $isNodeSelection(n) ? s = n : (s = $createNodeSelection(), $setSelection(s)), i ? s.delete(o) : s.add(o);
923
938
  }(e, t.shiftKey), !0;
924
939
  }
925
940
  return !1;
926
- }, COMMAND_PRIORITY_LOW), t.registerMutationListener(un, (e, n) => {
927
- Kt(() => {
941
+ }, COMMAND_PRIORITY_LOW), t.registerMutationListener(hn, (e, n) => {
942
+ Tt(() => {
928
943
  let n = !1;
929
944
  const { nodeSelections: o } = s.peek();
930
945
  for (const [s, r] of e.entries()) if ("destroyed" === r) o.delete(s), n = !0;
931
946
  else {
932
947
  const e = o.get(s), r = t.getElementByKey(s);
933
948
  e ? e.domNode.value = r : (n = !0, o.set(s, {
934
- domNode: Ht(r),
949
+ domNode: Yt(r),
935
950
  selectedSignal: i(s)
936
951
  }));
937
952
  }
938
953
  n && (s.value = { nodeSelections: o });
939
954
  });
940
- }), se(() => {
955
+ }), ce(() => {
941
956
  const t = [];
942
- for (const { domNode: e, selectedSignal: n } of s.value.nodeSelections.values()) t.push(se(() => {
957
+ for (const { domNode: e, selectedSignal: n } of s.value.nodeSelections.values()) t.push(ce(() => {
943
958
  const t = e.value;
944
959
  if (t) n.value ? addClassNamesToElement(t, c) : removeClassNamesFromElement(t, c);
945
960
  }));
946
961
  return mergeRegister(...t);
947
962
  }));
948
963
  }
949
- }), pn = /* @__PURE__ */ defineExtension({
964
+ });
965
+ const yn = /* @__PURE__ */ defineExtension({
950
966
  build: (t) => ({
951
- composingTextNode: Ht(null),
952
- compositionKey: Ht(null)
967
+ composingTextNode: Yt(null),
968
+ compositionKey: Yt(null)
953
969
  }),
954
970
  name: "@lexical/extension/IME",
955
971
  register(t, e, n) {
@@ -957,7 +973,7 @@ const gn = /* @__PURE__ */ defineExtension({
957
973
  return mergeRegister(t.registerCommand(COMPOSITION_START_COMMAND, () => {
958
974
  const t = $getSelection();
959
975
  return $isRangeSelection(t) && (i.value = t.anchor.key), !1;
960
- }, COMMAND_PRIORITY_BEFORE_EDITOR), se(() => {
976
+ }, COMMAND_PRIORITY_BEFORE_EDITOR), ce(() => {
961
977
  const e = i.value;
962
978
  o.value = null !== e ? t.read("latest", () => {
963
979
  const t = $getNodeByKey(e);
@@ -972,21 +988,18 @@ const gn = /* @__PURE__ */ defineExtension({
972
988
  });
973
989
  }), t.registerRootListener((t) => {
974
990
  if (null === t) return void (i.value = null);
975
- const e = () => {
991
+ return registerEventListener(t, "compositionend", () => {
976
992
  i.value = null;
977
- };
978
- return t.addEventListener("compositionend", e), () => {
979
- t.removeEventListener("compositionend", e);
980
- };
993
+ });
981
994
  }));
982
995
  }
983
996
  });
984
- const mn = /* @__PURE__ */ defineExtension({
985
- build: (t, e) => re({ inheritEditableFromParent: e.inheritEditableFromParent }),
997
+ const xn = /* @__PURE__ */ defineExtension({
998
+ build: (t, e) => ae({ inheritEditableFromParent: e.inheritEditableFromParent }),
986
999
  config: /* @__PURE__ */ safeCast({
987
1000
  $getParentEditor: function() {
988
1001
  const t = $getEditor();
989
- return Qe.fromEditor(t), t;
1002
+ return nn.fromEditor(t), t;
990
1003
  },
991
1004
  inheritEditableFromParent: !1
992
1005
  }),
@@ -995,20 +1008,21 @@ const mn = /* @__PURE__ */ defineExtension({
995
1008
  t.parentEditor = i, t.theme = t.theme || i._config.theme;
996
1009
  },
997
1010
  name: "@lexical/extension/NestedEditor",
998
- register: (t, e, n) => se(() => {
1011
+ register: (t, e, n) => ce(() => {
999
1012
  const e = t._parentEditor;
1000
1013
  if (e && n.getOutput().inheritEditableFromParent.value) return t.setEditable(e.isEditable()), e.registerEditableListener(t.setEditable.bind(t));
1001
1014
  })
1002
- }), vn = /* @__PURE__ */ defineExtension({
1015
+ });
1016
+ const En = /* @__PURE__ */ defineExtension({
1003
1017
  config: /* @__PURE__ */ safeCast({
1004
1018
  attribute: "data-selected",
1005
1019
  nodes: []
1006
1020
  }),
1007
1021
  init(t, e) {
1008
- const n = /* @__PURE__ */ new Set(), i = getRegisteredSubtypeMap(ge(t).nodes);
1022
+ const n = /* @__PURE__ */ new Set(), i = getRegisteredSubtypeMap(me(t).nodes);
1009
1023
  for (const t of e.nodes) {
1010
1024
  const e = t.getType(), o = i.get(e);
1011
- void 0 === o && Ce(339, t.name, e), n.add(e);
1025
+ void 0 === o && Ie(339, t.name, e), n.add(e);
1012
1026
  for (const t of o) n.add(t);
1013
1027
  }
1014
1028
  return { matchTypes: n };
@@ -1040,26 +1054,27 @@ const mn = /* @__PURE__ */ defineExtension({
1040
1054
  };
1041
1055
  }
1042
1056
  });
1043
- function En(t) {
1057
+ function bn(t) {
1044
1058
  $isElementNode(t) && t.isInline() && t.isEmpty() && t.remove();
1045
1059
  }
1046
- const yn = /* @__PURE__ */ defineExtension({
1047
- build: (t, e, n) => re(e),
1060
+ const Sn = /* @__PURE__ */ defineExtension({
1061
+ build: (t, e, n) => ae(e),
1048
1062
  config: /* @__PURE__ */ safeCast({ disabled: !1 }),
1049
1063
  name: "@lexical/NormalizeInlineElements",
1050
1064
  register: (t, e, n) => {
1051
1065
  const i = n.getOutput();
1052
- return se(() => {
1066
+ return ce(() => {
1053
1067
  if (!i.disabled.value) {
1054
1068
  const e = [];
1055
- for (const { klass: n, transforms: i } of t._nodes.values()) n.prototype instanceof ElementNode && n.prototype.isInline !== ElementNode.prototype.isInline && (i.add(En), e.push(() => i.delete(En)));
1069
+ for (const { klass: n, transforms: i } of t._nodes.values()) n.prototype instanceof ElementNode && n.prototype.isInline !== ElementNode.prototype.isInline && (i.add(bn), e.push(() => i.delete(bn)));
1056
1070
  return () => e.forEach((t) => t());
1057
1071
  }
1058
1072
  });
1059
1073
  }
1060
- }), xn = /* @__PURE__ */ new Set([SKIP_SELECTION_FOCUS_TAG, SKIP_SCROLL_INTO_VIEW_TAG]);
1061
- const bn = /* @__PURE__ */ defineExtension({
1062
- build: (t, e, n) => re(e),
1074
+ });
1075
+ const wn = /* @__PURE__ */ new Set([SKIP_SELECTION_FOCUS_TAG, SKIP_SCROLL_INTO_VIEW_TAG]);
1076
+ const Nn = /* @__PURE__ */ defineExtension({
1077
+ build: (t, e, n) => ae(e),
1063
1078
  config: /* @__PURE__ */ safeCast({
1064
1079
  $fixFocusOverselection: function() {
1065
1080
  const t = $getSelection();
@@ -1069,7 +1084,7 @@ const bn = /* @__PURE__ */ defineExtension({
1069
1084
  for ($isTextPointCaret(n) && e.anchor.origin !== n.origin && 0 === n.offset && (n = $rewindSiblingCaret(n.getSiblingCaret())), $isSiblingCaret(n) && e.anchor.origin !== n.origin && $isLineBreakNode(n.origin) && (n = $rewindSiblingCaret(n)); $isChildCaret(n) && e.anchor.origin !== n.origin;) n = $rewindSiblingCaret($getSiblingCaret(n.origin, "next"));
1070
1085
  if ($isSiblingCaret(n) && $isElementNode(n.origin) && (n = $normalizeCaret($getChildCaret(n.origin, "previous")).getFlipped()), n = $normalizeCaret(n), !n.isSamePointCaret(e.focus)) {
1071
1086
  const t = $setSelectionFromCaretRange($getCaretRange(e.anchor, n)), i = $getEditor().getRootElement(), o = i && getDOMSelection(i.ownerDocument.defaultView);
1072
- o && $updateDOMSelection($getPreviousSelection(), t, $getEditor(), o, xn, i);
1087
+ o && $updateDOMSelection($getPreviousSelection(), t, $getEditor(), o, wn, i);
1073
1088
  }
1074
1089
  }
1075
1090
  },
@@ -1078,7 +1093,7 @@ const bn = /* @__PURE__ */ defineExtension({
1078
1093
  thresholdMsec: 100
1079
1094
  }),
1080
1095
  name: "@lexical/NormalizeTripleClickSelection",
1081
- register: (t, e, n) => se(() => {
1096
+ register: (t, e, n) => ce(() => {
1082
1097
  const e = n.getOutput();
1083
1098
  if (!e.disabled.value) return t.registerRootListener((n) => {
1084
1099
  if (!n) return;
@@ -1090,46 +1105,52 @@ const bn = /* @__PURE__ */ defineExtension({
1090
1105
  }
1091
1106
  return i;
1092
1107
  };
1093
- return mergeRegister(t.registerCommand(SELECTION_CHANGE_COMMAND, () => (o(null) && (i = 0, e.$fixFocusOverselection.peek()()), !1), COMMAND_PRIORITY_BEFORE_CRITICAL), (() => {
1094
- const t = ["mouseup", "mousedown"];
1095
- return t.forEach((t) => n.addEventListener(t, o, !0)), () => t.forEach((t) => n.removeEventListener(t, o, !0));
1096
- })());
1108
+ return mergeRegister(t.registerCommand(SELECTION_CHANGE_COMMAND, () => (o(null) && (i = 0, e.$fixFocusOverselection.peek()()), !1), COMMAND_PRIORITY_BEFORE_CRITICAL), registerEventListeners(n, {
1109
+ mousedown: o,
1110
+ mouseup: o
1111
+ }, !0));
1097
1112
  });
1098
1113
  })
1099
1114
  });
1100
- function Sn(t) {
1115
+ function On(t) {
1101
1116
  const e = t.target;
1102
1117
  isExactShortcutMatch(t, "a", {
1103
1118
  ctrlKey: !IS_APPLE,
1104
1119
  metaKey: IS_APPLE
1105
1120
  }) && isHTMLElement(e) && ("INPUT" === e.tagName || "TEXTAREA" === e.tagName) && e.addEventListener("keydown", stopLexicalPropagation, { once: !0 });
1106
1121
  }
1107
- const wn = /* @__PURE__ */ defineExtension({
1108
- build: (t, e, n) => re(e),
1122
+ const Rn = /* @__PURE__ */ defineExtension({
1123
+ build: (t, e, n) => ae(e),
1109
1124
  config: /* @__PURE__ */ safeCast({ disabled: !1 }),
1110
1125
  name: "@lexical/extension/PreventSelectAll",
1111
1126
  register: (t, e, n) => {
1112
1127
  const i = n.getOutput();
1113
- return se(() => {
1128
+ return ce(() => {
1114
1129
  if (!i.disabled.value) return t.registerRootListener((t) => {
1115
- if (t) return t.addEventListener("keydown", Sn, !0), () => t.removeEventListener("keydown", Sn, !0);
1130
+ if (t) return registerEventListener(t, "keydown", On, !0);
1116
1131
  });
1117
1132
  });
1118
1133
  }
1119
1134
  });
1120
- const Nn = /* @__PURE__ */ defineExtension({
1121
- build: (t, e, n) => re(e),
1135
+ const Cn = /* @__PURE__ */ defineExtension({
1136
+ build: (t) => Ce(() => t.getRootElement(), (e) => t.registerRootListener((t) => {
1137
+ e.value = t;
1138
+ })),
1139
+ name: "@lexical/extension/RootElement"
1140
+ });
1141
+ const Dn = /* @__PURE__ */ defineExtension({
1142
+ build: (t, e, n) => ae(e),
1122
1143
  config: /* @__PURE__ */ safeCast({
1123
1144
  cascadeSelection: !1,
1124
1145
  disabled: !1
1125
1146
  }),
1126
- dependencies: [wn],
1147
+ dependencies: [Rn],
1127
1148
  name: "@lexical/extension/SelectBlock",
1128
1149
  register: (t, e, n) => {
1129
- const i = n.getOutput(), o = n.getDependency(wn).output;
1130
- return mergeRegister(se(() => {
1150
+ const i = n.getOutput(), o = n.getDependency(Rn).output;
1151
+ return mergeRegister(ce(() => {
1131
1152
  o.disabled.value = i.disabled.value;
1132
- }), se(() => {
1153
+ }), ce(() => {
1133
1154
  if (!i.disabled.value) return t.registerCommand(SELECT_ALL_COMMAND, (e, n) => {
1134
1155
  if (n !== t) {
1135
1156
  if (!i.cascadeSelection.peek()) return !1;
@@ -1147,8 +1168,8 @@ const Nn = /* @__PURE__ */ defineExtension({
1147
1168
  }
1148
1169
  var c;
1149
1170
  if (!$isRangeSelection(o)) return !1;
1150
- const d = o.anchor.getNode(), l = d.getTopLevelElement();
1151
- if (l && l.is(o.focus.getNode().getTopLevelElement()) && !$isBlockFullySelected(l, o)) return l.select(0, l.getChildrenSize()), !0;
1171
+ const d = o.anchor.getNode(), u = d.getTopLevelElement();
1172
+ if (u && u.is(o.focus.getNode().getTopLevelElement()) && !$isBlockFullySelected(u, o)) return u.select(0, u.getChildrenSize()), !0;
1152
1173
  let f = $getSlotFrame(d);
1153
1174
  for (; null !== f;) {
1154
1175
  if ($isElementNode(f) && !$isBlockFullySelected(f, o)) return f.select(0, f.getChildrenSize()), !0;
@@ -1159,8 +1180,9 @@ const Nn = /* @__PURE__ */ defineExtension({
1159
1180
  }, COMMAND_PRIORITY_LOW);
1160
1181
  }));
1161
1182
  }
1162
- }), On = /* @__PURE__ */ defineExtension({
1163
- build: (t, e, n) => re(e),
1183
+ });
1184
+ const In = /* @__PURE__ */ defineExtension({
1185
+ build: (t, e, n) => ae(e),
1164
1186
  config: /* @__PURE__ */ safeCast({
1165
1187
  disabled: !1,
1166
1188
  onReposition: void 0
@@ -1168,15 +1190,15 @@ const Nn = /* @__PURE__ */ defineExtension({
1168
1190
  name: "@lexical/utils/SelectionAlwaysOnDisplay",
1169
1191
  register: (t, e, n) => {
1170
1192
  const i = n.getOutput();
1171
- return se(() => {
1193
+ return ce(() => {
1172
1194
  if (!i.disabled.value) return selectionAlwaysOnDisplay(t, i.onReposition.value);
1173
1195
  });
1174
1196
  }
1175
1197
  });
1176
- function Cn(t) {
1198
+ function Fn(t) {
1177
1199
  return t.canIndent();
1178
1200
  }
1179
- function Rn(t, e, n = Cn) {
1201
+ function Mn(t, e, n = Fn) {
1180
1202
  return mergeRegister(t.registerCommand(KEY_TAB_COMMAND, (e) => {
1181
1203
  const n = $getSelection();
1182
1204
  if (!$isRangeSelection(n)) return !1;
@@ -1204,25 +1226,26 @@ function Rn(t, e, n = Cn) {
1204
1226
  });
1205
1227
  }, COMMAND_PRIORITY_CRITICAL));
1206
1228
  }
1207
- const Dn = /* @__PURE__ */ defineExtension({
1208
- build: (t, e, n) => re(e),
1229
+ const _n = /* @__PURE__ */ defineExtension({
1230
+ build: (t, e, n) => ae(e),
1209
1231
  config: /* @__PURE__ */ safeCast({
1210
- $canIndent: Cn,
1232
+ $canIndent: Fn,
1211
1233
  disabled: !1,
1212
1234
  maxIndent: null
1213
1235
  }),
1214
1236
  name: "@lexical/extension/TabIndentation",
1215
1237
  register(t, e, n) {
1216
1238
  const { disabled: i, maxIndent: o, $canIndent: s } = n.getOutput();
1217
- return se(() => {
1218
- if (!i.value) return Rn(t, o, s);
1239
+ return ce(() => {
1240
+ if (!i.value) return Mn(t, o, s);
1219
1241
  });
1220
1242
  }
1221
- }), In = /* @__PURE__ */ defineExtension({
1222
- build: (t) => Ne(() => t.isEditable(), (e) => t.registerEditableListener((t) => {
1243
+ });
1244
+ const kn = /* @__PURE__ */ defineExtension({
1245
+ build: (t) => Ce(() => t.isEditable(), (e) => t.registerEditableListener((t) => {
1223
1246
  e.value = t;
1224
1247
  })),
1225
1248
  name: "@lexical/extension/WatchEditable"
1226
1249
  });
1227
1250
  //#endregion
1228
- export { fn as $createHorizontalRuleNode, le as $defaultShouldInsertAfter, on as $getExtensionDependency, sn as $getExtensionOutput, rn as $getPeerDependency, Ee as $isDecoratorTextNode, hn as $isHorizontalRuleNode, ce as AutoFocusExtension, ue as ClearEditorExtension, he as ClickAfterLastBlockExtension, we as DecoratorTextExtension, ve as DecoratorTextNode, Oe as EditorStateExtension, gn as HorizontalRuleExtension, un as HorizontalRuleNode, pn as IMEExtension, dn as INSERT_HORIZONTAL_RULE_COMMAND, Ge as InitialStateExtension, Qe as LexicalBuilder, mn as NestedEditorExtension, vn as NodeSelectionDataSelectedExtension, an as NodeSelectionExtension, yn as NormalizeInlineElementsExtension, bn as NormalizeTripleClickSelectionExtension, wn as PreventSelectAllExtension, Nn as SelectBlockExtension, On as SelectionAlwaysOnDisplayExtension, Dn as TabIndentationExtension, In as WatchEditableExtension, ye as applyFormatFromStyle, xe as applyFormatToDom, Kt as batch, Je as buildEditorFromExtensions, te as computed, configExtension, declarePeerDependency, defineExtension, se as effect, tn as getExtensionDependencyFromEditor, ge as getKnownTypesAndNodes, en as getPeerDependencyFromEditor, nn as getPeerDependencyFromEditorOrThrow, re as namedSignals, de as registerClearEditor, Rn as registerTabIndentation, safeCast, shallowMergeConfig, Ht as signal, jt as untracked, Ne as watchedSignal };
1251
+ export { we as $applyFormatToDom, pn as $createHorizontalRuleNode, he as $defaultShouldInsertAfter, cn as $getExtensionDependency, an as $getExtensionOutput, dn as $getPeerDependency, Ee as $isDecoratorTextNode, mn as $isHorizontalRuleNode, de as AutoFocusExtension, fe as ClearEditorExtension, pe as ClickAfterLastBlockExtension, Re as DecoratorTextExtension, xe as DecoratorTextNode, De as EditorStateExtension, vn as HorizontalRuleExtension, hn as HorizontalRuleNode, yn as IMEExtension, fn as INSERT_HORIZONTAL_RULE_COMMAND, He as InitialStateExtension, nn as LexicalBuilder, xn as NestedEditorExtension, En as NodeSelectionDataSelectedExtension, un as NodeSelectionExtension, Sn as NormalizeInlineElementsExtension, Nn as NormalizeTripleClickSelectionExtension, Rn as PreventSelectAllExtension, Cn as RootElementExtension, Dn as SelectBlockExtension, In as SelectionAlwaysOnDisplayExtension, _n as TabIndentationExtension, kn as WatchEditableExtension, be as applyFormatFromStyle, Se as applyFormatToDom, Tt as batch, Ye as buildEditorFromExtensions, ne as computed, configExtension, declarePeerDependency, defineExtension, ce as effect, on as getExtensionDependencyFromEditor, me as getKnownTypesAndNodes, sn as getPeerDependencyFromEditor, rn as getPeerDependencyFromEditorOrThrow, ae as namedSignals, ue as registerClearEditor, Mn as registerTabIndentation, safeCast, shallowMergeConfig, Yt as signal, Ut as untracked, Ce as watchedSignal };