@blocknote/core 0.1.0-alpha.3

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 (143) hide show
  1. package/README.md +99 -0
  2. package/dist/blocknote.js +4485 -0
  3. package/dist/blocknote.js.map +1 -0
  4. package/dist/blocknote.umd.cjs +90 -0
  5. package/dist/blocknote.umd.cjs.map +1 -0
  6. package/dist/style.css +1 -0
  7. package/package.json +109 -0
  8. package/src/BlockNoteExtensions.ts +90 -0
  9. package/src/EditorContent.tsx +1 -0
  10. package/src/assets/inter-v12-latin/inter-v12-latin-100.woff +0 -0
  11. package/src/assets/inter-v12-latin/inter-v12-latin-100.woff2 +0 -0
  12. package/src/assets/inter-v12-latin/inter-v12-latin-200.woff +0 -0
  13. package/src/assets/inter-v12-latin/inter-v12-latin-200.woff2 +0 -0
  14. package/src/assets/inter-v12-latin/inter-v12-latin-300.woff +0 -0
  15. package/src/assets/inter-v12-latin/inter-v12-latin-300.woff2 +0 -0
  16. package/src/assets/inter-v12-latin/inter-v12-latin-500.woff +0 -0
  17. package/src/assets/inter-v12-latin/inter-v12-latin-500.woff2 +0 -0
  18. package/src/assets/inter-v12-latin/inter-v12-latin-600.woff +0 -0
  19. package/src/assets/inter-v12-latin/inter-v12-latin-600.woff2 +0 -0
  20. package/src/assets/inter-v12-latin/inter-v12-latin-700.woff +0 -0
  21. package/src/assets/inter-v12-latin/inter-v12-latin-700.woff2 +0 -0
  22. package/src/assets/inter-v12-latin/inter-v12-latin-800.woff +0 -0
  23. package/src/assets/inter-v12-latin/inter-v12-latin-800.woff2 +0 -0
  24. package/src/assets/inter-v12-latin/inter-v12-latin-900.woff +0 -0
  25. package/src/assets/inter-v12-latin/inter-v12-latin-900.woff2 +0 -0
  26. package/src/assets/inter-v12-latin/inter-v12-latin-regular.woff +0 -0
  27. package/src/assets/inter-v12-latin/inter-v12-latin-regular.woff2 +0 -0
  28. package/src/editor.module.css +3 -0
  29. package/src/extensions/Blocks/OrderedListPlugin.ts +46 -0
  30. package/src/extensions/Blocks/PreviousBlockTypePlugin.ts +146 -0
  31. package/src/extensions/Blocks/commands/joinBackward.ts +274 -0
  32. package/src/extensions/Blocks/helpers/findBlock.ts +3 -0
  33. package/src/extensions/Blocks/helpers/setBlockHeading.ts +30 -0
  34. package/src/extensions/Blocks/index.ts +15 -0
  35. package/src/extensions/Blocks/nodes/Block.module.css +226 -0
  36. package/src/extensions/Blocks/nodes/Block.ts +390 -0
  37. package/src/extensions/Blocks/nodes/BlockGroup.ts +28 -0
  38. package/src/extensions/Blocks/nodes/Content.ts +50 -0
  39. package/src/extensions/Blocks/nodes/README.md +26 -0
  40. package/src/extensions/Blocks/rule.ts +48 -0
  41. package/src/extensions/BubbleMenu/BubbleMenuExtension.tsx +28 -0
  42. package/src/extensions/BubbleMenu/BubbleMenuPlugin.ts +245 -0
  43. package/src/extensions/BubbleMenu/component/BubbleMenu.tsx +216 -0
  44. package/src/extensions/BubbleMenu/component/DropdownBlockItem.module.css +13 -0
  45. package/src/extensions/BubbleMenu/component/DropdownBlockItem.tsx +25 -0
  46. package/src/extensions/BubbleMenu/component/LinkToolbarButton.tsx +67 -0
  47. package/src/extensions/DraggableBlocks/DraggableBlocksExtension.ts +15 -0
  48. package/src/extensions/DraggableBlocks/DraggableBlocksPlugin.tsx +266 -0
  49. package/src/extensions/DraggableBlocks/components/DragHandle.module.css +33 -0
  50. package/src/extensions/DraggableBlocks/components/DragHandle.tsx +108 -0
  51. package/src/extensions/DraggableBlocks/components/DragHandleMenu.module.css +10 -0
  52. package/src/extensions/DraggableBlocks/components/DragHandleMenu.tsx +18 -0
  53. package/src/extensions/Hyperlinks/HyperlinkMark.tsx +16 -0
  54. package/src/extensions/Hyperlinks/HyperlinkMenuPlugin.tsx +200 -0
  55. package/src/extensions/Hyperlinks/menus/HyperlinkBasicMenu.tsx +59 -0
  56. package/src/extensions/Hyperlinks/menus/HyperlinkEditMenu.tsx +72 -0
  57. package/src/extensions/Hyperlinks/menus/atlaskit/PanelTextInput.tsx +173 -0
  58. package/src/extensions/Hyperlinks/menus/atlaskit/PanelTextInputStyles.ts +36 -0
  59. package/src/extensions/Hyperlinks/menus/atlaskit/README.md +1 -0
  60. package/src/extensions/Hyperlinks/menus/atlaskit/ToolbarComponent.tsx +61 -0
  61. package/src/extensions/Paragraph/FixedParagraph.ts +12 -0
  62. package/src/extensions/Placeholder/PlaceholderExtension.ts +127 -0
  63. package/src/extensions/SlashMenu/SlashMenuExtension.ts +43 -0
  64. package/src/extensions/SlashMenu/SlashMenuItem.ts +56 -0
  65. package/src/extensions/SlashMenu/defaultCommands.tsx +229 -0
  66. package/src/extensions/SlashMenu/index.ts +11 -0
  67. package/src/extensions/TrailingNode/TrailingNodeExtension.ts +70 -0
  68. package/src/extensions/UniqueID/UniqueID.ts +281 -0
  69. package/src/extensions/helpers/formatKeyboardShortcut.ts +9 -0
  70. package/src/fonts-inter.css +94 -0
  71. package/src/globals.css +28 -0
  72. package/src/index.ts +5 -0
  73. package/src/lib/atlaskit/browser.ts +47 -0
  74. package/src/root.module.css +19 -0
  75. package/src/shared/components/toolbar/SimpleToolbarButton.module.css +13 -0
  76. package/src/shared/components/toolbar/SimpleToolbarButton.tsx +56 -0
  77. package/src/shared/components/toolbar/Toolbar.module.css +10 -0
  78. package/src/shared/components/toolbar/Toolbar.tsx +5 -0
  79. package/src/shared/components/toolbar/ToolbarSeparator.module.css +13 -0
  80. package/src/shared/components/toolbar/ToolbarSeparator.tsx +7 -0
  81. package/src/shared/components/tooltip/TooltipContent.module.css +15 -0
  82. package/src/shared/components/tooltip/TooltipContent.tsx +23 -0
  83. package/src/shared/hooks/useEditorForceUpdate.tsx +30 -0
  84. package/src/shared/plugins/suggestion/SuggestionItem.ts +31 -0
  85. package/src/shared/plugins/suggestion/SuggestionListReactRenderer.ts +227 -0
  86. package/src/shared/plugins/suggestion/SuggestionPlugin.ts +365 -0
  87. package/src/shared/plugins/suggestion/components/SuggestionGroup.module.css +45 -0
  88. package/src/shared/plugins/suggestion/components/SuggestionGroup.tsx +134 -0
  89. package/src/shared/plugins/suggestion/components/SuggestionList.module.css +10 -0
  90. package/src/shared/plugins/suggestion/components/SuggestionList.tsx +91 -0
  91. package/src/style.css +7 -0
  92. package/src/useEditor.ts +47 -0
  93. package/src/vite-env.d.ts +1 -0
  94. package/types/src/BlockNoteExtensions.d.ts +4 -0
  95. package/types/src/EditorContent.d.ts +1 -0
  96. package/types/src/extensions/Blocks/OrderedListPlugin.d.ts +2 -0
  97. package/types/src/extensions/Blocks/PreviousBlockTypePlugin.d.ts +13 -0
  98. package/types/src/extensions/Blocks/commands/joinBackward.d.ts +14 -0
  99. package/types/src/extensions/Blocks/helpers/findBlock.d.ts +6 -0
  100. package/types/src/extensions/Blocks/helpers/setBlockHeading.d.ts +5 -0
  101. package/types/src/extensions/Blocks/index.d.ts +1 -0
  102. package/types/src/extensions/Blocks/nodes/Block.d.ts +32 -0
  103. package/types/src/extensions/Blocks/nodes/BlockGroup.d.ts +2 -0
  104. package/types/src/extensions/Blocks/nodes/Content.d.ts +5 -0
  105. package/types/src/extensions/Blocks/rule.d.ts +16 -0
  106. package/types/src/extensions/BubbleMenu/BubbleMenuExtension.d.ts +5 -0
  107. package/types/src/extensions/BubbleMenu/BubbleMenuPlugin.d.ts +46 -0
  108. package/types/src/extensions/BubbleMenu/component/BubbleMenu.d.ts +5 -0
  109. package/types/src/extensions/BubbleMenu/component/DropdownBlockItem.d.ts +10 -0
  110. package/types/src/extensions/BubbleMenu/component/LinkToolbarButton.d.ts +11 -0
  111. package/types/src/extensions/DraggableBlocks/DraggableBlocksExtension.d.ts +7 -0
  112. package/types/src/extensions/DraggableBlocks/DraggableBlocksPlugin.d.ts +18 -0
  113. package/types/src/extensions/DraggableBlocks/components/DragHandle.d.ts +12 -0
  114. package/types/src/extensions/DraggableBlocks/components/DragHandleMenu.d.ts +6 -0
  115. package/types/src/extensions/Hyperlinks/HyperlinkMark.d.ts +7 -0
  116. package/types/src/extensions/Hyperlinks/HyperlinkMenuPlugin.d.ts +2 -0
  117. package/types/src/extensions/Hyperlinks/menus/HyperlinkBasicMenu.d.ts +12 -0
  118. package/types/src/extensions/Hyperlinks/menus/HyperlinkEditMenu.d.ts +10 -0
  119. package/types/src/extensions/Hyperlinks/menus/atlaskit/PanelTextInput.d.ts +39 -0
  120. package/types/src/extensions/Hyperlinks/menus/atlaskit/PanelTextInputStyles.d.ts +1 -0
  121. package/types/src/extensions/Hyperlinks/menus/atlaskit/ToolbarComponent.d.ts +11 -0
  122. package/types/src/extensions/Paragraph/FixedParagraph.d.ts +1 -0
  123. package/types/src/extensions/Placeholder/PlaceholderExtension.d.ts +25 -0
  124. package/types/src/extensions/SlashMenu/SlashMenuExtension.d.ts +10 -0
  125. package/types/src/extensions/SlashMenu/SlashMenuItem.d.ts +43 -0
  126. package/types/src/extensions/SlashMenu/defaultCommands.d.ts +8 -0
  127. package/types/src/extensions/SlashMenu/index.d.ts +5 -0
  128. package/types/src/extensions/TrailingNode/TrailingNodeExtension.d.ts +10 -0
  129. package/types/src/extensions/UniqueID/UniqueID.d.ts +3 -0
  130. package/types/src/extensions/helpers/formatKeyboardShortcut.d.ts +1 -0
  131. package/types/src/index.d.ts +4 -0
  132. package/types/src/lib/atlaskit/browser.d.ts +12 -0
  133. package/types/src/shared/components/toolbar/SimpleToolbarButton.d.ts +16 -0
  134. package/types/src/shared/components/toolbar/Toolbar.d.ts +4 -0
  135. package/types/src/shared/components/toolbar/ToolbarSeparator.d.ts +2 -0
  136. package/types/src/shared/components/tooltip/TooltipContent.d.ts +15 -0
  137. package/types/src/shared/hooks/useEditorForceUpdate.d.ts +2 -0
  138. package/types/src/shared/plugins/suggestion/SuggestionItem.d.ts +29 -0
  139. package/types/src/shared/plugins/suggestion/SuggestionListReactRenderer.d.ts +71 -0
  140. package/types/src/shared/plugins/suggestion/SuggestionPlugin.d.ts +74 -0
  141. package/types/src/shared/plugins/suggestion/components/SuggestionGroup.d.ts +23 -0
  142. package/types/src/shared/plugins/suggestion/components/SuggestionList.d.ts +26 -0
  143. package/types/src/useEditor.d.ts +8 -0
@@ -0,0 +1,4485 @@
1
+ var go = Object.defineProperty;
2
+ var yo = (e, t, n) => t in e ? go(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var H = (e, t, n) => (yo(e, typeof t != "symbol" ? t + "" : t, n), n);
4
+ import { findParentNode as bo, combineTransactionSteps as gr, getChangedRanges as yr, findChildren as fn, InputRule as wo, callOrReturn as Eo, Node as Tt, mergeAttributes as jt, isTextSelection as ko, isNodeSelection as xo, posToDOMRect as To, Extension as ot, getMarkRange as Co, findChildrenInRange as Oo, extensions as ft } from "@tiptap/core";
5
+ import So from "@tiptap/extension-bold";
6
+ import Ao from "@tiptap/extension-code";
7
+ import Mo from "@tiptap/extension-dropcursor";
8
+ import Ro from "@tiptap/extension-gapcursor";
9
+ import No from "@tiptap/extension-hard-break";
10
+ import Io from "@tiptap/extension-italic";
11
+ import Do from "@tiptap/extension-underline";
12
+ import { History as Ho } from "@tiptap/extension-history";
13
+ import Lo from "@tiptap/extension-strike";
14
+ import Bo from "@tiptap/extension-text";
15
+ import { NodeSelection as pn, Selection as kn, PluginKey as be, Plugin as we, TextSelection as Vt } from "prosemirror-state";
16
+ import { Slice as _, Fragment as W, ReplaceError as _o } from "prosemirror-model";
17
+ import * as Po from "prosemirror-view";
18
+ import { Decoration as Wt, DecorationSet as Ut } from "prosemirror-view";
19
+ import Te from "react-dom";
20
+ import A, { forwardRef as zo, useEffect as Vo, useState as Fe, PureComponent as Fo, useCallback as $o } from "react";
21
+ import br from "@atlaskit/button";
22
+ import $e from "@tippyjs/react";
23
+ import it, { css as jo } from "styled-components";
24
+ import Wo, { DropdownItem as Uo, DropdownItemGroup as qo } from "@atlaskit/dropdown-menu";
25
+ import { groupBy as Ko, escapeRegExp as Ln } from "lodash";
26
+ import { ReactRenderer as Jo, useEditor as Go } from "@tiptap/react";
27
+ import { EditorContent as wl } from "@tiptap/react";
28
+ import { Section as wr, ButtonItem as Er, MenuGroup as kr } from "@atlaskit/menu";
29
+ import { Link as Yo } from "@tiptap/extension-link";
30
+ import Xo from "@tiptap/extension-paragraph";
31
+ import { v4 as Zo } from "uuid";
32
+ const xr = 65535, Tr = Math.pow(2, 16);
33
+ function Qo(e, t) {
34
+ return e + t * Tr;
35
+ }
36
+ function Bn(e) {
37
+ return e & xr;
38
+ }
39
+ function ei(e) {
40
+ return (e - (e & xr)) / Tr;
41
+ }
42
+ const Cr = 1, Or = 2, Ft = 4, Sr = 8;
43
+ class _n {
44
+ constructor(t, n, r) {
45
+ this.pos = t, this.delInfo = n, this.recover = r;
46
+ }
47
+ get deleted() {
48
+ return (this.delInfo & Sr) > 0;
49
+ }
50
+ get deletedBefore() {
51
+ return (this.delInfo & (Cr | Ft)) > 0;
52
+ }
53
+ get deletedAfter() {
54
+ return (this.delInfo & (Or | Ft)) > 0;
55
+ }
56
+ get deletedAcross() {
57
+ return (this.delInfo & Ft) > 0;
58
+ }
59
+ }
60
+ class oe {
61
+ constructor(t, n = !1) {
62
+ if (this.ranges = t, this.inverted = n, !t.length && oe.empty)
63
+ return oe.empty;
64
+ }
65
+ recover(t) {
66
+ let n = 0, r = Bn(t);
67
+ if (!this.inverted)
68
+ for (let o = 0; o < r; o++)
69
+ n += this.ranges[o * 3 + 2] - this.ranges[o * 3 + 1];
70
+ return this.ranges[r * 3] + n + ei(t);
71
+ }
72
+ mapResult(t, n = 1) {
73
+ return this._map(t, n, !1);
74
+ }
75
+ map(t, n = 1) {
76
+ return this._map(t, n, !0);
77
+ }
78
+ _map(t, n, r) {
79
+ let o = 0, i = this.inverted ? 2 : 1, s = this.inverted ? 1 : 2;
80
+ for (let a = 0; a < this.ranges.length; a += 3) {
81
+ let c = this.ranges[a] - (this.inverted ? o : 0);
82
+ if (c > t)
83
+ break;
84
+ let d = this.ranges[a + i], u = this.ranges[a + s], f = c + d;
85
+ if (t <= f) {
86
+ let v = d ? t == c ? -1 : t == f ? 1 : n : n, m = c + o + (v < 0 ? 0 : u);
87
+ if (r)
88
+ return m;
89
+ let y = t == (n < 0 ? c : f) ? null : Qo(a / 3, t - c), h = t == c ? Or : t == f ? Cr : Ft;
90
+ return (n < 0 ? t != c : t != f) && (h |= Sr), new _n(m, h, y);
91
+ }
92
+ o += u - d;
93
+ }
94
+ return r ? t + o : new _n(t + o, 0, null);
95
+ }
96
+ touches(t, n) {
97
+ let r = 0, o = Bn(n), i = this.inverted ? 2 : 1, s = this.inverted ? 1 : 2;
98
+ for (let a = 0; a < this.ranges.length; a += 3) {
99
+ let c = this.ranges[a] - (this.inverted ? r : 0);
100
+ if (c > t)
101
+ break;
102
+ let d = this.ranges[a + i], u = c + d;
103
+ if (t <= u && a == o * 3)
104
+ return !0;
105
+ r += this.ranges[a + s] - d;
106
+ }
107
+ return !1;
108
+ }
109
+ forEach(t) {
110
+ let n = this.inverted ? 2 : 1, r = this.inverted ? 1 : 2;
111
+ for (let o = 0, i = 0; o < this.ranges.length; o += 3) {
112
+ let s = this.ranges[o], a = s - (this.inverted ? i : 0), c = s + (this.inverted ? 0 : i), d = this.ranges[o + n], u = this.ranges[o + r];
113
+ t(a, a + d, c, c + u), i += u - d;
114
+ }
115
+ }
116
+ invert() {
117
+ return new oe(this.ranges, !this.inverted);
118
+ }
119
+ toString() {
120
+ return (this.inverted ? "-" : "") + JSON.stringify(this.ranges);
121
+ }
122
+ static offset(t) {
123
+ return t == 0 ? oe.empty : new oe(t < 0 ? [0, -t, 0] : [0, 0, t]);
124
+ }
125
+ }
126
+ oe.empty = new oe([]);
127
+ const en = /* @__PURE__ */ Object.create(null);
128
+ class Ae {
129
+ getMap() {
130
+ return oe.empty;
131
+ }
132
+ merge(t) {
133
+ return null;
134
+ }
135
+ static fromJSON(t, n) {
136
+ if (!n || !n.stepType)
137
+ throw new RangeError("Invalid input for Step.fromJSON");
138
+ let r = en[n.stepType];
139
+ if (!r)
140
+ throw new RangeError(`No step type ${n.stepType} defined`);
141
+ return r.fromJSON(t, n);
142
+ }
143
+ static jsonID(t, n) {
144
+ if (t in en)
145
+ throw new RangeError("Duplicate use of step JSON ID " + t);
146
+ return en[t] = n, n.prototype.jsonID = t, n;
147
+ }
148
+ }
149
+ class X {
150
+ constructor(t, n) {
151
+ this.doc = t, this.failed = n;
152
+ }
153
+ static ok(t) {
154
+ return new X(t, null);
155
+ }
156
+ static fail(t) {
157
+ return new X(null, t);
158
+ }
159
+ static fromReplace(t, n, r, o) {
160
+ try {
161
+ return X.ok(t.replace(n, r, o));
162
+ } catch (i) {
163
+ if (i instanceof _o)
164
+ return X.fail(i.message);
165
+ throw i;
166
+ }
167
+ }
168
+ }
169
+ function xn(e, t, n) {
170
+ let r = [];
171
+ for (let o = 0; o < e.childCount; o++) {
172
+ let i = e.child(o);
173
+ i.content.size && (i = i.copy(xn(i.content, t, i))), i.isInline && (i = t(i, n, o)), r.push(i);
174
+ }
175
+ return W.fromArray(r);
176
+ }
177
+ class _e extends Ae {
178
+ constructor(t, n, r) {
179
+ super(), this.from = t, this.to = n, this.mark = r;
180
+ }
181
+ apply(t) {
182
+ let n = t.slice(this.from, this.to), r = t.resolve(this.from), o = r.node(r.sharedDepth(this.to)), i = new _(xn(n.content, (s, a) => !s.isAtom || !a.type.allowsMarkType(this.mark.type) ? s : s.mark(this.mark.addToSet(s.marks)), o), n.openStart, n.openEnd);
183
+ return X.fromReplace(t, this.from, this.to, i);
184
+ }
185
+ invert() {
186
+ return new Pe(this.from, this.to, this.mark);
187
+ }
188
+ map(t) {
189
+ let n = t.mapResult(this.from, 1), r = t.mapResult(this.to, -1);
190
+ return n.deleted && r.deleted || n.pos >= r.pos ? null : new _e(n.pos, r.pos, this.mark);
191
+ }
192
+ merge(t) {
193
+ return t instanceof _e && t.mark.eq(this.mark) && this.from <= t.to && this.to >= t.from ? new _e(Math.min(this.from, t.from), Math.max(this.to, t.to), this.mark) : null;
194
+ }
195
+ toJSON() {
196
+ return {
197
+ stepType: "addMark",
198
+ mark: this.mark.toJSON(),
199
+ from: this.from,
200
+ to: this.to
201
+ };
202
+ }
203
+ static fromJSON(t, n) {
204
+ if (typeof n.from != "number" || typeof n.to != "number")
205
+ throw new RangeError("Invalid input for AddMarkStep.fromJSON");
206
+ return new _e(n.from, n.to, t.markFromJSON(n.mark));
207
+ }
208
+ }
209
+ Ae.jsonID("addMark", _e);
210
+ class Pe extends Ae {
211
+ constructor(t, n, r) {
212
+ super(), this.from = t, this.to = n, this.mark = r;
213
+ }
214
+ apply(t) {
215
+ let n = t.slice(this.from, this.to), r = new _(xn(n.content, (o) => o.mark(this.mark.removeFromSet(o.marks)), t), n.openStart, n.openEnd);
216
+ return X.fromReplace(t, this.from, this.to, r);
217
+ }
218
+ invert() {
219
+ return new _e(this.from, this.to, this.mark);
220
+ }
221
+ map(t) {
222
+ let n = t.mapResult(this.from, 1), r = t.mapResult(this.to, -1);
223
+ return n.deleted && r.deleted || n.pos >= r.pos ? null : new Pe(n.pos, r.pos, this.mark);
224
+ }
225
+ merge(t) {
226
+ return t instanceof Pe && t.mark.eq(this.mark) && this.from <= t.to && this.to >= t.from ? new Pe(Math.min(this.from, t.from), Math.max(this.to, t.to), this.mark) : null;
227
+ }
228
+ toJSON() {
229
+ return {
230
+ stepType: "removeMark",
231
+ mark: this.mark.toJSON(),
232
+ from: this.from,
233
+ to: this.to
234
+ };
235
+ }
236
+ static fromJSON(t, n) {
237
+ if (typeof n.from != "number" || typeof n.to != "number")
238
+ throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");
239
+ return new Pe(n.from, n.to, t.markFromJSON(n.mark));
240
+ }
241
+ }
242
+ Ae.jsonID("removeMark", Pe);
243
+ class ue extends Ae {
244
+ constructor(t, n, r, o = !1) {
245
+ super(), this.from = t, this.to = n, this.slice = r, this.structure = o;
246
+ }
247
+ apply(t) {
248
+ return this.structure && hn(t, this.from, this.to) ? X.fail("Structure replace would overwrite content") : X.fromReplace(t, this.from, this.to, this.slice);
249
+ }
250
+ getMap() {
251
+ return new oe([this.from, this.to - this.from, this.slice.size]);
252
+ }
253
+ invert(t) {
254
+ return new ue(this.from, this.from + this.slice.size, t.slice(this.from, this.to));
255
+ }
256
+ map(t) {
257
+ let n = t.mapResult(this.from, 1), r = t.mapResult(this.to, -1);
258
+ return n.deletedAcross && r.deletedAcross ? null : new ue(n.pos, Math.max(n.pos, r.pos), this.slice);
259
+ }
260
+ merge(t) {
261
+ if (!(t instanceof ue) || t.structure || this.structure)
262
+ return null;
263
+ if (this.from + this.slice.size == t.from && !this.slice.openEnd && !t.slice.openStart) {
264
+ let n = this.slice.size + t.slice.size == 0 ? _.empty : new _(this.slice.content.append(t.slice.content), this.slice.openStart, t.slice.openEnd);
265
+ return new ue(this.from, this.to + (t.to - t.from), n, this.structure);
266
+ } else if (t.to == this.from && !this.slice.openStart && !t.slice.openEnd) {
267
+ let n = this.slice.size + t.slice.size == 0 ? _.empty : new _(t.slice.content.append(this.slice.content), t.slice.openStart, this.slice.openEnd);
268
+ return new ue(t.from, this.to, n, this.structure);
269
+ } else
270
+ return null;
271
+ }
272
+ toJSON() {
273
+ let t = { stepType: "replace", from: this.from, to: this.to };
274
+ return this.slice.size && (t.slice = this.slice.toJSON()), this.structure && (t.structure = !0), t;
275
+ }
276
+ static fromJSON(t, n) {
277
+ if (typeof n.from != "number" || typeof n.to != "number")
278
+ throw new RangeError("Invalid input for ReplaceStep.fromJSON");
279
+ return new ue(n.from, n.to, _.fromJSON(t, n.slice), !!n.structure);
280
+ }
281
+ }
282
+ Ae.jsonID("replace", ue);
283
+ class Oe extends Ae {
284
+ constructor(t, n, r, o, i, s, a = !1) {
285
+ super(), this.from = t, this.to = n, this.gapFrom = r, this.gapTo = o, this.slice = i, this.insert = s, this.structure = a;
286
+ }
287
+ apply(t) {
288
+ if (this.structure && (hn(t, this.from, this.gapFrom) || hn(t, this.gapTo, this.to)))
289
+ return X.fail("Structure gap-replace would overwrite content");
290
+ let n = t.slice(this.gapFrom, this.gapTo);
291
+ if (n.openStart || n.openEnd)
292
+ return X.fail("Gap is not a flat range");
293
+ let r = this.slice.insertAt(this.insert, n.content);
294
+ return r ? X.fromReplace(t, this.from, this.to, r) : X.fail("Content does not fit in gap");
295
+ }
296
+ getMap() {
297
+ return new oe([
298
+ this.from,
299
+ this.gapFrom - this.from,
300
+ this.insert,
301
+ this.gapTo,
302
+ this.to - this.gapTo,
303
+ this.slice.size - this.insert
304
+ ]);
305
+ }
306
+ invert(t) {
307
+ let n = this.gapTo - this.gapFrom;
308
+ return new Oe(this.from, this.from + this.slice.size + n, this.from + this.insert, this.from + this.insert + n, t.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
309
+ }
310
+ map(t) {
311
+ let n = t.mapResult(this.from, 1), r = t.mapResult(this.to, -1), o = t.map(this.gapFrom, -1), i = t.map(this.gapTo, 1);
312
+ return n.deletedAcross && r.deletedAcross || o < n.pos || i > r.pos ? null : new Oe(n.pos, r.pos, o, i, this.slice, this.insert, this.structure);
313
+ }
314
+ toJSON() {
315
+ let t = {
316
+ stepType: "replaceAround",
317
+ from: this.from,
318
+ to: this.to,
319
+ gapFrom: this.gapFrom,
320
+ gapTo: this.gapTo,
321
+ insert: this.insert
322
+ };
323
+ return this.slice.size && (t.slice = this.slice.toJSON()), this.structure && (t.structure = !0), t;
324
+ }
325
+ static fromJSON(t, n) {
326
+ if (typeof n.from != "number" || typeof n.to != "number" || typeof n.gapFrom != "number" || typeof n.gapTo != "number" || typeof n.insert != "number")
327
+ throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");
328
+ return new Oe(n.from, n.to, n.gapFrom, n.gapTo, _.fromJSON(t, n.slice), n.insert, !!n.structure);
329
+ }
330
+ }
331
+ Ae.jsonID("replaceAround", Oe);
332
+ function hn(e, t, n) {
333
+ let r = e.resolve(t), o = n - t, i = r.depth;
334
+ for (; o > 0 && i > 0 && r.indexAfter(i) == r.node(i).childCount; )
335
+ i--, o--;
336
+ if (o > 0) {
337
+ let s = r.node(i).maybeChild(r.indexAfter(i));
338
+ for (; o > 0; ) {
339
+ if (!s || s.isLeaf)
340
+ return !0;
341
+ s = s.firstChild, o--;
342
+ }
343
+ }
344
+ return !1;
345
+ }
346
+ function ti(e, t, n) {
347
+ return (t == 0 || e.canReplace(t, e.childCount)) && (n == e.childCount || e.canReplace(0, n));
348
+ }
349
+ function Ar(e) {
350
+ let n = e.parent.content.cutByIndex(e.startIndex, e.endIndex);
351
+ for (let r = e.depth; ; --r) {
352
+ let o = e.$from.node(r), i = e.$from.index(r), s = e.$to.indexAfter(r);
353
+ if (r < e.depth && o.canReplace(i, s, n))
354
+ return r;
355
+ if (r == 0 || o.type.spec.isolating || !ti(o, i, s))
356
+ break;
357
+ }
358
+ return null;
359
+ }
360
+ function Mr(e, t) {
361
+ let n = e.resolve(t), r = n.index();
362
+ return ni(n.nodeBefore, n.nodeAfter) && n.parent.canReplace(r, r + 1);
363
+ }
364
+ function ni(e, t) {
365
+ return !!(e && t && !e.isLeaf && e.canAppend(t));
366
+ }
367
+ function ri(e, t, n = t, r = _.empty) {
368
+ if (t == n && !r.size)
369
+ return null;
370
+ let o = e.resolve(t), i = e.resolve(n);
371
+ return oi(o, i, r) ? new ue(t, n, r) : new ii(o, i, r).fit();
372
+ }
373
+ function oi(e, t, n) {
374
+ return !n.openStart && !n.openEnd && e.start() == t.start() && e.parent.canReplace(e.index(), t.index(), n.content);
375
+ }
376
+ class ii {
377
+ constructor(t, n, r) {
378
+ this.$from = t, this.$to = n, this.unplaced = r, this.frontier = [], this.placed = W.empty;
379
+ for (let o = 0; o <= t.depth; o++) {
380
+ let i = t.node(o);
381
+ this.frontier.push({
382
+ type: i.type,
383
+ match: i.contentMatchAt(t.indexAfter(o))
384
+ });
385
+ }
386
+ for (let o = t.depth; o > 0; o--)
387
+ this.placed = W.from(t.node(o).copy(this.placed));
388
+ }
389
+ get depth() {
390
+ return this.frontier.length - 1;
391
+ }
392
+ fit() {
393
+ for (; this.unplaced.size; ) {
394
+ let d = this.findFittable();
395
+ d ? this.placeNodes(d) : this.openMore() || this.dropNode();
396
+ }
397
+ let t = this.mustMoveInline(), n = this.placed.size - this.depth - this.$from.depth, r = this.$from, o = this.close(t < 0 ? this.$to : r.doc.resolve(t));
398
+ if (!o)
399
+ return null;
400
+ let i = this.placed, s = r.depth, a = o.depth;
401
+ for (; s && a && i.childCount == 1; )
402
+ i = i.firstChild.content, s--, a--;
403
+ let c = new _(i, s, a);
404
+ return t > -1 ? new Oe(r.pos, t, this.$to.pos, this.$to.end(), c, n) : c.size || r.pos != this.$to.pos ? new ue(r.pos, o.pos, c) : null;
405
+ }
406
+ findFittable() {
407
+ for (let t = 1; t <= 2; t++)
408
+ for (let n = this.unplaced.openStart; n >= 0; n--) {
409
+ let r, o = null;
410
+ n ? (o = tn(this.unplaced.content, n - 1).firstChild, r = o.content) : r = this.unplaced.content;
411
+ let i = r.firstChild;
412
+ for (let s = this.depth; s >= 0; s--) {
413
+ let { type: a, match: c } = this.frontier[s], d, u = null;
414
+ if (t == 1 && (i ? c.matchType(i.type) || (u = c.fillBefore(W.from(i), !1)) : o && a.compatibleContent(o.type)))
415
+ return { sliceDepth: n, frontierDepth: s, parent: o, inject: u };
416
+ if (t == 2 && i && (d = c.findWrapping(i.type)))
417
+ return { sliceDepth: n, frontierDepth: s, parent: o, wrap: d };
418
+ if (o && c.matchType(o.type))
419
+ break;
420
+ }
421
+ }
422
+ }
423
+ openMore() {
424
+ let { content: t, openStart: n, openEnd: r } = this.unplaced, o = tn(t, n);
425
+ return !o.childCount || o.firstChild.isLeaf ? !1 : (this.unplaced = new _(t, n + 1, Math.max(r, o.size + n >= t.size - r ? n + 1 : 0)), !0);
426
+ }
427
+ dropNode() {
428
+ let { content: t, openStart: n, openEnd: r } = this.unplaced, o = tn(t, n);
429
+ if (o.childCount <= 1 && n > 0) {
430
+ let i = t.size - n <= n + o.size;
431
+ this.unplaced = new _(ht(t, n - 1, 1), n - 1, i ? n - 1 : r);
432
+ } else
433
+ this.unplaced = new _(ht(t, n, 1), n, r);
434
+ }
435
+ placeNodes({ sliceDepth: t, frontierDepth: n, parent: r, inject: o, wrap: i }) {
436
+ for (; this.depth > n; )
437
+ this.closeFrontierNode();
438
+ if (i)
439
+ for (let h = 0; h < i.length; h++)
440
+ this.openFrontierNode(i[h]);
441
+ let s = this.unplaced, a = r ? r.content : s.content, c = s.openStart - t, d = 0, u = [], { match: f, type: v } = this.frontier[n];
442
+ if (o) {
443
+ for (let h = 0; h < o.childCount; h++)
444
+ u.push(o.child(h));
445
+ f = f.matchFragment(o);
446
+ }
447
+ let m = a.size + t - (s.content.size - s.openEnd);
448
+ for (; d < a.childCount; ) {
449
+ let h = a.child(d), w = f.matchType(h.type);
450
+ if (!w)
451
+ break;
452
+ d++, (d > 1 || c == 0 || h.content.size) && (f = w, u.push(Rr(h.mark(v.allowedMarks(h.marks)), d == 1 ? c : 0, d == a.childCount ? m : -1)));
453
+ }
454
+ let y = d == a.childCount;
455
+ y || (m = -1), this.placed = mt(this.placed, n, W.from(u)), this.frontier[n].match = f, y && m < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
456
+ for (let h = 0, w = a; h < m; h++) {
457
+ let E = w.lastChild;
458
+ this.frontier.push({ type: E.type, match: E.contentMatchAt(E.childCount) }), w = E.content;
459
+ }
460
+ this.unplaced = y ? t == 0 ? _.empty : new _(ht(s.content, t - 1, 1), t - 1, m < 0 ? s.openEnd : t - 1) : new _(ht(s.content, t, d), s.openStart, s.openEnd);
461
+ }
462
+ mustMoveInline() {
463
+ if (!this.$to.parent.isTextblock)
464
+ return -1;
465
+ let t = this.frontier[this.depth], n;
466
+ if (!t.type.isTextblock || !nn(this.$to, this.$to.depth, t.type, t.match, !1) || this.$to.depth == this.depth && (n = this.findCloseLevel(this.$to)) && n.depth == this.depth)
467
+ return -1;
468
+ let { depth: r } = this.$to, o = this.$to.after(r);
469
+ for (; r > 1 && o == this.$to.end(--r); )
470
+ ++o;
471
+ return o;
472
+ }
473
+ findCloseLevel(t) {
474
+ e:
475
+ for (let n = Math.min(this.depth, t.depth); n >= 0; n--) {
476
+ let { match: r, type: o } = this.frontier[n], i = n < t.depth && t.end(n + 1) == t.pos + (t.depth - (n + 1)), s = nn(t, n, o, r, i);
477
+ if (!!s) {
478
+ for (let a = n - 1; a >= 0; a--) {
479
+ let { match: c, type: d } = this.frontier[a], u = nn(t, a, d, c, !0);
480
+ if (!u || u.childCount)
481
+ continue e;
482
+ }
483
+ return { depth: n, fit: s, move: i ? t.doc.resolve(t.after(n + 1)) : t };
484
+ }
485
+ }
486
+ }
487
+ close(t) {
488
+ let n = this.findCloseLevel(t);
489
+ if (!n)
490
+ return null;
491
+ for (; this.depth > n.depth; )
492
+ this.closeFrontierNode();
493
+ n.fit.childCount && (this.placed = mt(this.placed, n.depth, n.fit)), t = n.move;
494
+ for (let r = n.depth + 1; r <= t.depth; r++) {
495
+ let o = t.node(r), i = o.type.contentMatch.fillBefore(o.content, !0, t.index(r));
496
+ this.openFrontierNode(o.type, o.attrs, i);
497
+ }
498
+ return t;
499
+ }
500
+ openFrontierNode(t, n = null, r) {
501
+ let o = this.frontier[this.depth];
502
+ o.match = o.match.matchType(t), this.placed = mt(this.placed, this.depth, W.from(t.create(n, r))), this.frontier.push({ type: t, match: t.contentMatch });
503
+ }
504
+ closeFrontierNode() {
505
+ let n = this.frontier.pop().match.fillBefore(W.empty, !0);
506
+ n.childCount && (this.placed = mt(this.placed, this.frontier.length, n));
507
+ }
508
+ }
509
+ function ht(e, t, n) {
510
+ return t == 0 ? e.cutByIndex(n, e.childCount) : e.replaceChild(0, e.firstChild.copy(ht(e.firstChild.content, t - 1, n)));
511
+ }
512
+ function mt(e, t, n) {
513
+ return t == 0 ? e.append(n) : e.replaceChild(e.childCount - 1, e.lastChild.copy(mt(e.lastChild.content, t - 1, n)));
514
+ }
515
+ function tn(e, t) {
516
+ for (let n = 0; n < t; n++)
517
+ e = e.firstChild.content;
518
+ return e;
519
+ }
520
+ function Rr(e, t, n) {
521
+ if (t <= 0)
522
+ return e;
523
+ let r = e.content;
524
+ return t > 1 && (r = r.replaceChild(0, Rr(r.firstChild, t - 1, r.childCount == 1 ? n - 1 : 0))), t > 0 && (r = e.type.contentMatch.fillBefore(r).append(r), n <= 0 && (r = r.append(e.type.contentMatch.matchFragment(r).fillBefore(W.empty, !0)))), e.copy(r);
525
+ }
526
+ function nn(e, t, n, r, o) {
527
+ let i = e.node(t), s = o ? e.indexAfter(t) : e.index(t);
528
+ if (s == i.childCount && !n.compatibleContent(i.type))
529
+ return null;
530
+ let a = r.fillBefore(i.content, !0, s);
531
+ return a && !ai(n, i.content, s) ? a : null;
532
+ }
533
+ function ai(e, t, n) {
534
+ for (let r = n; r < t.childCount; r++)
535
+ if (!e.allowsMarks(t.child(r).marks))
536
+ return !0;
537
+ return !1;
538
+ }
539
+ let bt = class extends Error {
540
+ };
541
+ bt = function e(t) {
542
+ let n = Error.call(this, t);
543
+ return n.__proto__ = e.prototype, n;
544
+ };
545
+ bt.prototype = Object.create(Error.prototype);
546
+ bt.prototype.constructor = bt;
547
+ bt.prototype.name = "TransformError";
548
+ const si = (e, t, n) => {
549
+ let { $cursor: r } = e.selection;
550
+ if (!r || (n ? !n.endOfTextblock("backward", e) : r.parentOffset > 0))
551
+ return !1;
552
+ let o = ci(r);
553
+ if (!o) {
554
+ let s = r.blockRange(), a = s && Ar(s);
555
+ return a === null ? !1 : (t && t(e.tr.lift(s, a).scrollIntoView()), !0);
556
+ }
557
+ let i = o.nodeBefore;
558
+ if (!i.type.spec.isolating && li(e, o, t))
559
+ return !0;
560
+ if (r.parent.content.size === 0 && (qt(i, "end") || pn.isSelectable(i))) {
561
+ let s = ri(
562
+ e.doc,
563
+ r.before(),
564
+ r.after(),
565
+ _.empty
566
+ );
567
+ if (s && s.slice.size < s.to - s.from) {
568
+ if (t) {
569
+ let a = e.tr.step(s);
570
+ a.setSelection(
571
+ qt(i, "end") ? kn.findFrom(
572
+ a.doc.resolve(a.mapping.map(o.pos, -1)),
573
+ -1
574
+ ) : pn.create(a.doc, o.pos - i.nodeSize)
575
+ ), t(a.scrollIntoView());
576
+ }
577
+ return !0;
578
+ }
579
+ }
580
+ return i.isAtom && o.depth === r.depth - 1 ? (t && t(
581
+ e.tr.delete(o.pos - i.nodeSize, o.pos).scrollIntoView()
582
+ ), !0) : !1;
583
+ };
584
+ function ci(e) {
585
+ if (!e.parent.type.spec.isolating)
586
+ for (let t = e.depth - 1; t >= 0; t--) {
587
+ if (e.index(t) > 0)
588
+ return e.doc.resolve(e.before(t + 1));
589
+ if (e.node(t).type.spec.isolating)
590
+ break;
591
+ }
592
+ return null;
593
+ }
594
+ function li(e, t, n) {
595
+ let r = t.nodeBefore, o = t.nodeAfter, i, s;
596
+ if (r.type.spec.isolating || o.type.spec.isolating)
597
+ return !1;
598
+ if (ui(e, t, n))
599
+ return !0;
600
+ let a = t.parent.canReplace(t.index(), t.index() + 1), c = kn.findFrom(t, 1), d = c && c.$from.blockRange(c.$to), u = d && Ar(d);
601
+ if (u != null && u >= t.depth)
602
+ return n && n(e.tr.lift(d, u).scrollIntoView()), !0;
603
+ if (a && qt(o, "start", !0) && qt(r, "end")) {
604
+ let f = r, v = [];
605
+ for (; v.push(f), !f.isTextblock; )
606
+ f = f.lastChild;
607
+ let m = o, y = 1;
608
+ for (; !m.isTextblock; m = m.firstChild)
609
+ y++;
610
+ if (f.canReplace(f.childCount, f.childCount, m.content)) {
611
+ if (n) {
612
+ let h = W.empty;
613
+ for (let E = v.length - 1; E >= 0; E--)
614
+ h = W.from(v[E].copy(h));
615
+ let w = e.tr.step(
616
+ new Oe(
617
+ t.pos - v.length,
618
+ t.pos + o.nodeSize,
619
+ t.pos + y,
620
+ t.pos + o.nodeSize - y,
621
+ new _(h, v.length, 0),
622
+ 0,
623
+ !0
624
+ )
625
+ );
626
+ n(w.scrollIntoView());
627
+ }
628
+ return !0;
629
+ }
630
+ }
631
+ if (a && (i = (s = r.contentMatchAt(r.childCount)).findWrapping(
632
+ o.type
633
+ )) && s.matchType(i[0] || o.type).validEnd) {
634
+ if (n) {
635
+ let f = t.pos + o.nodeSize, v = W.empty;
636
+ for (let h = i.length - 1; h >= 0; h--)
637
+ v = W.from(i[h].create(null, v));
638
+ v = W.from(r.copy(v));
639
+ let m = e.tr.step(
640
+ new Oe(
641
+ t.pos - 1,
642
+ f,
643
+ t.pos,
644
+ f,
645
+ new _(v, 1, 0),
646
+ i.length,
647
+ !0
648
+ )
649
+ ), y = f + 2 * i.length;
650
+ Mr(m.doc, y) && m.join(y), n(m.scrollIntoView());
651
+ }
652
+ return !0;
653
+ }
654
+ return !1;
655
+ }
656
+ function qt(e, t, n = !1) {
657
+ for (let r = e; r; r = t === "start" ? r.firstChild : r.lastChild) {
658
+ if (r.isTextblock)
659
+ return !0;
660
+ if (n && r.childCount !== 1)
661
+ return !1;
662
+ }
663
+ return !1;
664
+ }
665
+ function ui(e, t, n) {
666
+ let r = t.nodeBefore, o = t.nodeAfter, i = t.index();
667
+ return !r || !o || !r.type.compatibleContent(o.type) ? !1 : !r.content.size && t.parent.canReplace(i - 1, i) ? (n && n(
668
+ e.tr.delete(t.pos - r.nodeSize, t.pos).scrollIntoView()
669
+ ), !0) : !t.parent.canReplace(i, i + 1) || !(o.isTextblock || Mr(e.doc, t.pos)) ? !1 : (n && n(
670
+ e.tr.clearIncompatible(
671
+ t.pos,
672
+ r.type,
673
+ r.contentMatchAt(r.childCount)
674
+ ).join(t.pos).scrollIntoView()
675
+ ), !0);
676
+ }
677
+ const je = bo((e) => e.type.name === "tcblock");
678
+ function Pn(e, t, n) {
679
+ const r = je(e.selection);
680
+ return r ? (t && e.setNodeMarkup(r.pos, void 0, {
681
+ ...r.node.attrs,
682
+ headingType: n
683
+ }), !0) : !1;
684
+ }
685
+ const di = new be("ordered-list"), fi = () => new we({
686
+ key: di,
687
+ appendTransaction: (e, t, n) => {
688
+ const r = n.tr;
689
+ let o = !1, i = 1, s = 0;
690
+ return n.doc.descendants((a, c) => {
691
+ a.type.name === "tcblock" && !a.attrs.listType && (i = 1), s === 0 && a.type.name === "tcblock" && a.attrs.listType === "oli" ? (s = a.content.childCount, a.content.child(0).attrs.position !== `${i}.` && (r.setNodeMarkup(c + 1, void 0, {
692
+ ...a.attrs,
693
+ position: `${i}.`
694
+ }), o = !0), i++) : s > 0 && s--;
695
+ }), o ? r : null;
696
+ }
697
+ }), zn = new be("previous-blocks"), pi = () => new we({
698
+ key: zn,
699
+ view(e) {
700
+ return {
701
+ update: async (t, n) => {
702
+ var r;
703
+ (r = this.key) != null && r.getState(t.state).needsUpdate && setTimeout(() => {
704
+ t.dispatch(
705
+ t.state.tr.setMeta(zn, { clearUpdate: !0 })
706
+ );
707
+ }, 0);
708
+ }
709
+ };
710
+ },
711
+ state: {
712
+ init() {
713
+ return {
714
+ prevBlockAttrs: {},
715
+ needsUpdate: !1
716
+ };
717
+ },
718
+ apply(e, t, n, r) {
719
+ if (t.needsUpdate = !1, t.prevBlockAttrs = {}, !e.docChanged || n.doc.eq(r.doc))
720
+ return t;
721
+ const o = gr(n.doc, [e]);
722
+ return yr(o).forEach(() => {
723
+ const s = fn(n.doc, (d) => d.attrs.id), a = new Map(
724
+ s.map((d) => [d.node.attrs.id, d])
725
+ ), c = fn(r.doc, (d) => d.attrs.id);
726
+ for (let d of c) {
727
+ const u = a.get(d.node.attrs.id);
728
+ if (u) {
729
+ const f = {
730
+ listType: d.node.attrs.listType,
731
+ blockColor: d.node.attrs.blockColor,
732
+ blockStyle: d.node.attrs.blockStyle,
733
+ headingType: d.node.attrs.headingType,
734
+ depth: r.doc.resolve(d.pos).depth
735
+ }, v = {
736
+ listType: u.node.attrs.listType,
737
+ blockColor: u.node.attrs.blockColor,
738
+ blockStyle: u.node.attrs.blockStyle,
739
+ headingType: u.node.attrs.headingType,
740
+ depth: n.doc.resolve(u.pos).depth
741
+ };
742
+ JSON.stringify(v) !== JSON.stringify(f) && (v.depthChange = v.depth - f.depth, t.prevBlockAttrs[d.node.attrs.id] = v, t.needsUpdate = !0);
743
+ }
744
+ }
745
+ }), t;
746
+ }
747
+ },
748
+ props: {
749
+ decorations(e) {
750
+ const t = this.getState(e);
751
+ if (!t.needsUpdate)
752
+ return;
753
+ const n = [];
754
+ return e.doc.descendants((r, o) => {
755
+ if (!r.attrs.id)
756
+ return;
757
+ const i = t.prevBlockAttrs[r.attrs.id];
758
+ if (!i)
759
+ return;
760
+ const s = {};
761
+ for (let [c, d] of Object.entries(i))
762
+ s["data-prev-" + c] = d || "none";
763
+ const a = Wt.node(o, o + r.nodeSize, {
764
+ ...s
765
+ });
766
+ n.push(a);
767
+ }), Ut.create(e.doc, n);
768
+ }
769
+ }
770
+ });
771
+ function rn(e) {
772
+ return new wo({
773
+ find: e.find,
774
+ handler: ({ state: t, range: n, match: r }) => {
775
+ const o = t.doc.resolve(n.from), i = Eo(e.getAttributes, void 0, r) || {}, s = o.node(-1);
776
+ if (s.type !== e.type)
777
+ return null;
778
+ t.tr.setNodeMarkup(n.from - 2, void 0, {
779
+ ...s.attrs,
780
+ ...i
781
+ }).delete(n.from, n.to);
782
+ }
783
+ });
784
+ }
785
+ const hi = "_blockOuter_4ownn_5", mi = "_block_4ownn_5", vi = "_blockContent_4ownn_25", gi = "_blockGroup_4ownn_35", yi = "_isEmpty_4ownn_198", bi = "_isFilter_4ownn_199", wi = "_hasAnchor_4ownn_212", ze = {
786
+ blockOuter: hi,
787
+ block: mi,
788
+ blockContent: vi,
789
+ blockGroup: gi,
790
+ isEmpty: yi,
791
+ isFilter: bi,
792
+ hasAnchor: wi
793
+ }, Ei = Tt.create({
794
+ name: "tcblock",
795
+ group: "block",
796
+ addOptions() {
797
+ return {
798
+ HTMLAttributes: {}
799
+ };
800
+ },
801
+ content: "tccontent blockgroup?",
802
+ defining: !0,
803
+ addAttributes() {
804
+ return {
805
+ listType: {
806
+ default: void 0,
807
+ renderHTML: (e) => ({
808
+ "data-listType": e.listType
809
+ }),
810
+ parseHTML: (e) => e.getAttribute("data-listType")
811
+ },
812
+ blockColor: {
813
+ default: void 0,
814
+ renderHTML: (e) => ({
815
+ "data-blockColor": e.blockColor
816
+ }),
817
+ parseHTML: (e) => e.getAttribute("data-blockColor")
818
+ },
819
+ blockStyle: {
820
+ default: void 0,
821
+ renderHTML: (e) => ({
822
+ "data-blockStyle": e.blockStyle
823
+ }),
824
+ parseHTML: (e) => e.getAttribute("data-blockStyle")
825
+ },
826
+ headingType: {
827
+ default: void 0,
828
+ keepOnSplit: !1,
829
+ renderHTML: (e) => ({
830
+ "data-headingType": e.headingType
831
+ }),
832
+ parseHTML: (e) => e.getAttribute("data-headingType")
833
+ }
834
+ };
835
+ },
836
+ parseHTML() {
837
+ return [
838
+ {
839
+ tag: "div"
840
+ }
841
+ ];
842
+ },
843
+ renderHTML({ HTMLAttributes: e }) {
844
+ return [
845
+ "div",
846
+ jt(this.options.HTMLAttributes, e, {
847
+ class: ze.blockOuter
848
+ }),
849
+ [
850
+ "div",
851
+ jt(this.options.HTMLAttributes, e, {
852
+ class: ze.block
853
+ }),
854
+ 0
855
+ ]
856
+ ];
857
+ },
858
+ addInputRules() {
859
+ return [
860
+ ...[1, 2, 3].map((e) => rn({
861
+ find: new RegExp(`^(#{1,${e}})\\s$`),
862
+ type: this.type,
863
+ getAttributes: {
864
+ headingType: e
865
+ }
866
+ })),
867
+ rn({
868
+ find: /^\s*([-+*])\s$/,
869
+ type: this.type,
870
+ getAttributes: {
871
+ listType: "li"
872
+ }
873
+ }),
874
+ rn({
875
+ find: new RegExp(/^1.\s/),
876
+ type: this.type,
877
+ getAttributes: {
878
+ listType: "oli"
879
+ }
880
+ })
881
+ ];
882
+ },
883
+ addCommands() {
884
+ return {
885
+ setBlockHeading: (e) => ({ tr: t, dispatch: n }) => Pn(t, n, e.level),
886
+ unsetBlockHeading: () => ({ tr: e, dispatch: t }) => Pn(e, t, void 0),
887
+ unsetList: () => ({ tr: e, dispatch: t }) => {
888
+ const n = e.selection.$anchor.node(-1), r = e.selection.$anchor.posAtIndex(0, -1) - 1;
889
+ return n.type.name === "tcblock" && n.attrs.listType && t ? (e.setNodeMarkup(r, void 0, {
890
+ ...n.attrs,
891
+ listType: void 0
892
+ }), !0) : !1;
893
+ },
894
+ addNewBlockAsSibling: (e) => ({ tr: t, dispatch: n, state: r }) => {
895
+ var a;
896
+ const o = je(t.selection);
897
+ if (!o)
898
+ return !1;
899
+ if (((a = o.node.firstChild) == null ? void 0 : a.textContent.length) === 0)
900
+ return n && t.setNodeMarkup(o.pos, void 0, e), !0;
901
+ const i = o.pos + o.node.nodeSize;
902
+ let s = r.schema.nodes.tcblock.createAndFill(e);
903
+ return n && (t.insert(i, s), t.setSelection(new Vt(t.doc.resolve(i + 1)))), !0;
904
+ },
905
+ setBlockList: (e) => ({ tr: t, dispatch: n }) => {
906
+ const r = t.selection.$anchor.node(-1), o = t.selection.$anchor.posAtIndex(0, -1) - 1;
907
+ return r.type.name === "tcblock" ? (n && t.setNodeMarkup(o, void 0, {
908
+ ...r.attrs,
909
+ listType: e
910
+ }), !0) : !1;
911
+ },
912
+ joinBackward: () => ({ view: e, dispatch: t, state: n }) => si(n, t, e)
913
+ };
914
+ },
915
+ addProseMirrorPlugins() {
916
+ return [pi(), fi()];
917
+ },
918
+ addKeyboardShortcuts() {
919
+ return {
920
+ Backspace: () => this.editor.commands.first(({ commands: n }) => [
921
+ () => n.undoInputRule(),
922
+ () => n.command(({ tr: r }) => {
923
+ const { selection: o, doc: i } = r, { empty: s, $anchor: a } = o, { pos: c, parent: d } = a, u = kn.atStart(i).from === c;
924
+ return !s || !u || !d.type.isTextblock || d.textContent.length ? !1 : n.clearNodes();
925
+ }),
926
+ () => n.deleteSelection(),
927
+ () => n.command(({ tr: r }) => {
928
+ const o = r.selection.$anchor.parentOffset === 0, i = r.selection.$anchor.node(-1);
929
+ return o && i.type.name === "tcblock" ? n.first([
930
+ () => n.unsetList(),
931
+ () => n.liftListItem("tcblock")
932
+ ]) : !1;
933
+ }),
934
+ ({ chain: r }) => r().command(({ tr: o, state: i, dispatch: s }) => {
935
+ const a = o.selection.$anchor.parentOffset === 0, c = o.selection.$anchor, d = c.node(-1);
936
+ if (a && d.type.name === "tcblock") {
937
+ if (d.childCount === 2) {
938
+ const u = c.posAtIndex(1, -1) + 1, f = c.posAtIndex(2, -1) - 1, v = i.doc.resolve(u).blockRange(i.doc.resolve(f));
939
+ s && o.lift(v, c.depth - 2);
940
+ }
941
+ return !0;
942
+ }
943
+ return !1;
944
+ }).joinBackward().run(),
945
+ () => n.selectNodeBackward()
946
+ ]),
947
+ Enter: () => this.editor.commands.first(({ commands: n }) => [
948
+ () => n.splitListItem("tcblock"),
949
+ ({ tr: r, dispatch: o }) => {
950
+ if (r.selection.$from.depth !== 3)
951
+ return !1;
952
+ const s = r.selection.$anchor.node(-1), a = r.selection.$anchor.posAtIndex(0, -1) - 1;
953
+ return s.type.name === "tcblock" && s.attrs.listType ? (o && r.setNodeMarkup(a, void 0, {
954
+ ...s.attrs,
955
+ listType: void 0
956
+ }), !0) : !1;
957
+ },
958
+ ({ tr: r, dispatch: o }) => {
959
+ const i = r.selection.$from;
960
+ return o && r.split(i.pos, 2).scrollIntoView(), !0;
961
+ }
962
+ ]),
963
+ Tab: () => this.editor.commands.sinkListItem("tcblock"),
964
+ "Shift-Tab": () => this.editor.commands.liftListItem("tcblock"),
965
+ "Mod-Alt-0": () => this.editor.chain().unsetList().unsetBlockHeading().run(),
966
+ "Mod-Alt-1": () => this.editor.commands.setBlockHeading({ level: 1 }),
967
+ "Mod-Alt-2": () => this.editor.commands.setBlockHeading({ level: 2 }),
968
+ "Mod-Alt-3": () => this.editor.commands.setBlockHeading({ level: 3 }),
969
+ "Mod-Shift-7": () => this.editor.commands.setBlockList("li"),
970
+ "Mod-Shift-8": () => this.editor.commands.setBlockList("oli")
971
+ };
972
+ }
973
+ }), ki = Tt.create({
974
+ name: "blockgroup",
975
+ addOptions() {
976
+ return {
977
+ HTMLAttributes: {}
978
+ };
979
+ },
980
+ content: "tcblock+",
981
+ parseHTML() {
982
+ return [{ tag: "div" }];
983
+ },
984
+ renderHTML({ HTMLAttributes: e }) {
985
+ return [
986
+ "div",
987
+ jt(this.options.HTMLAttributes, e, {
988
+ class: ze.blockGroup
989
+ }),
990
+ 0
991
+ ];
992
+ }
993
+ }), xi = Tt.create({
994
+ name: "tccontent",
995
+ addOptions() {
996
+ return {
997
+ HTMLAttributes: {}
998
+ };
999
+ },
1000
+ addAttributes() {
1001
+ return {
1002
+ position: {
1003
+ default: void 0,
1004
+ renderHTML: (e) => ({
1005
+ "data-position": e.position
1006
+ }),
1007
+ parseHTML: (e) => e.getAttribute("data-position")
1008
+ }
1009
+ };
1010
+ },
1011
+ content: "inline*",
1012
+ parseHTML() {
1013
+ return [
1014
+ {
1015
+ tag: "div"
1016
+ }
1017
+ ];
1018
+ },
1019
+ renderHTML({ HTMLAttributes: e }) {
1020
+ return [
1021
+ "div",
1022
+ jt(this.options.HTMLAttributes, e, {
1023
+ class: ze.blockContent
1024
+ }),
1025
+ ["div", 0]
1026
+ ];
1027
+ }
1028
+ }), Ti = [
1029
+ xi,
1030
+ Ei,
1031
+ ki,
1032
+ Tt.create({
1033
+ name: "doc",
1034
+ topNode: !0,
1035
+ content: "blockgroup"
1036
+ })
1037
+ ];
1038
+ var U = "top", ee = "bottom", te = "right", q = "left", Gt = "auto", Ct = [U, ee, te, q], et = "start", wt = "end", Ci = "clippingParents", Nr = "viewport", pt = "popper", Oi = "reference", Vn = /* @__PURE__ */ Ct.reduce(function(e, t) {
1039
+ return e.concat([t + "-" + et, t + "-" + wt]);
1040
+ }, []), Ir = /* @__PURE__ */ [].concat(Ct, [Gt]).reduce(function(e, t) {
1041
+ return e.concat([t, t + "-" + et, t + "-" + wt]);
1042
+ }, []), Si = "beforeRead", Ai = "read", Mi = "afterRead", Ri = "beforeMain", Ni = "main", Ii = "afterMain", Di = "beforeWrite", Hi = "write", Li = "afterWrite", mn = [Si, Ai, Mi, Ri, Ni, Ii, Di, Hi, Li];
1043
+ function pe(e) {
1044
+ return e ? (e.nodeName || "").toLowerCase() : null;
1045
+ }
1046
+ function ne(e) {
1047
+ if (e == null)
1048
+ return window;
1049
+ if (e.toString() !== "[object Window]") {
1050
+ var t = e.ownerDocument;
1051
+ return t && t.defaultView || window;
1052
+ }
1053
+ return e;
1054
+ }
1055
+ function We(e) {
1056
+ var t = ne(e).Element;
1057
+ return e instanceof t || e instanceof Element;
1058
+ }
1059
+ function Z(e) {
1060
+ var t = ne(e).HTMLElement;
1061
+ return e instanceof t || e instanceof HTMLElement;
1062
+ }
1063
+ function Tn(e) {
1064
+ if (typeof ShadowRoot > "u")
1065
+ return !1;
1066
+ var t = ne(e).ShadowRoot;
1067
+ return e instanceof t || e instanceof ShadowRoot;
1068
+ }
1069
+ function Bi(e) {
1070
+ var t = e.state;
1071
+ Object.keys(t.elements).forEach(function(n) {
1072
+ var r = t.styles[n] || {}, o = t.attributes[n] || {}, i = t.elements[n];
1073
+ !Z(i) || !pe(i) || (Object.assign(i.style, r), Object.keys(o).forEach(function(s) {
1074
+ var a = o[s];
1075
+ a === !1 ? i.removeAttribute(s) : i.setAttribute(s, a === !0 ? "" : a);
1076
+ }));
1077
+ });
1078
+ }
1079
+ function _i(e) {
1080
+ var t = e.state, n = {
1081
+ popper: {
1082
+ position: t.options.strategy,
1083
+ left: "0",
1084
+ top: "0",
1085
+ margin: "0"
1086
+ },
1087
+ arrow: {
1088
+ position: "absolute"
1089
+ },
1090
+ reference: {}
1091
+ };
1092
+ return Object.assign(t.elements.popper.style, n.popper), t.styles = n, t.elements.arrow && Object.assign(t.elements.arrow.style, n.arrow), function() {
1093
+ Object.keys(t.elements).forEach(function(r) {
1094
+ var o = t.elements[r], i = t.attributes[r] || {}, s = Object.keys(t.styles.hasOwnProperty(r) ? t.styles[r] : n[r]), a = s.reduce(function(c, d) {
1095
+ return c[d] = "", c;
1096
+ }, {});
1097
+ !Z(o) || !pe(o) || (Object.assign(o.style, a), Object.keys(i).forEach(function(c) {
1098
+ o.removeAttribute(c);
1099
+ }));
1100
+ });
1101
+ };
1102
+ }
1103
+ const Dr = {
1104
+ name: "applyStyles",
1105
+ enabled: !0,
1106
+ phase: "write",
1107
+ fn: Bi,
1108
+ effect: _i,
1109
+ requires: ["computeStyles"]
1110
+ };
1111
+ function ie(e) {
1112
+ return e.split("-")[0];
1113
+ }
1114
+ var Ve = Math.max, Kt = Math.min, tt = Math.round;
1115
+ function vn() {
1116
+ var e = navigator.userAgentData;
1117
+ return e != null && e.brands ? e.brands.map(function(t) {
1118
+ return t.brand + "/" + t.version;
1119
+ }).join(" ") : navigator.userAgent;
1120
+ }
1121
+ function Hr() {
1122
+ return !/^((?!chrome|android).)*safari/i.test(vn());
1123
+ }
1124
+ function nt(e, t, n) {
1125
+ t === void 0 && (t = !1), n === void 0 && (n = !1);
1126
+ var r = e.getBoundingClientRect(), o = 1, i = 1;
1127
+ t && Z(e) && (o = e.offsetWidth > 0 && tt(r.width) / e.offsetWidth || 1, i = e.offsetHeight > 0 && tt(r.height) / e.offsetHeight || 1);
1128
+ var s = We(e) ? ne(e) : window, a = s.visualViewport, c = !Hr() && n, d = (r.left + (c && a ? a.offsetLeft : 0)) / o, u = (r.top + (c && a ? a.offsetTop : 0)) / i, f = r.width / o, v = r.height / i;
1129
+ return {
1130
+ width: f,
1131
+ height: v,
1132
+ top: u,
1133
+ right: d + f,
1134
+ bottom: u + v,
1135
+ left: d,
1136
+ x: d,
1137
+ y: u
1138
+ };
1139
+ }
1140
+ function Cn(e) {
1141
+ var t = nt(e), n = e.offsetWidth, r = e.offsetHeight;
1142
+ return Math.abs(t.width - n) <= 1 && (n = t.width), Math.abs(t.height - r) <= 1 && (r = t.height), {
1143
+ x: e.offsetLeft,
1144
+ y: e.offsetTop,
1145
+ width: n,
1146
+ height: r
1147
+ };
1148
+ }
1149
+ function Lr(e, t) {
1150
+ var n = t.getRootNode && t.getRootNode();
1151
+ if (e.contains(t))
1152
+ return !0;
1153
+ if (n && Tn(n)) {
1154
+ var r = t;
1155
+ do {
1156
+ if (r && e.isSameNode(r))
1157
+ return !0;
1158
+ r = r.parentNode || r.host;
1159
+ } while (r);
1160
+ }
1161
+ return !1;
1162
+ }
1163
+ function ae(e) {
1164
+ return ne(e).getComputedStyle(e);
1165
+ }
1166
+ function Pi(e) {
1167
+ return ["table", "td", "th"].indexOf(pe(e)) >= 0;
1168
+ }
1169
+ function Me(e) {
1170
+ return ((We(e) ? e.ownerDocument : e.document) || window.document).documentElement;
1171
+ }
1172
+ function Yt(e) {
1173
+ return pe(e) === "html" ? e : e.assignedSlot || e.parentNode || (Tn(e) ? e.host : null) || Me(e);
1174
+ }
1175
+ function Fn(e) {
1176
+ return !Z(e) || ae(e).position === "fixed" ? null : e.offsetParent;
1177
+ }
1178
+ function zi(e) {
1179
+ var t = /firefox/i.test(vn()), n = /Trident/i.test(vn());
1180
+ if (n && Z(e)) {
1181
+ var r = ae(e);
1182
+ if (r.position === "fixed")
1183
+ return null;
1184
+ }
1185
+ var o = Yt(e);
1186
+ for (Tn(o) && (o = o.host); Z(o) && ["html", "body"].indexOf(pe(o)) < 0; ) {
1187
+ var i = ae(o);
1188
+ if (i.transform !== "none" || i.perspective !== "none" || i.contain === "paint" || ["transform", "perspective"].indexOf(i.willChange) !== -1 || t && i.willChange === "filter" || t && i.filter && i.filter !== "none")
1189
+ return o;
1190
+ o = o.parentNode;
1191
+ }
1192
+ return null;
1193
+ }
1194
+ function Ot(e) {
1195
+ for (var t = ne(e), n = Fn(e); n && Pi(n) && ae(n).position === "static"; )
1196
+ n = Fn(n);
1197
+ return n && (pe(n) === "html" || pe(n) === "body" && ae(n).position === "static") ? t : n || zi(e) || t;
1198
+ }
1199
+ function On(e) {
1200
+ return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
1201
+ }
1202
+ function vt(e, t, n) {
1203
+ return Ve(e, Kt(t, n));
1204
+ }
1205
+ function Vi(e, t, n) {
1206
+ var r = vt(e, t, n);
1207
+ return r > n ? n : r;
1208
+ }
1209
+ function Br() {
1210
+ return {
1211
+ top: 0,
1212
+ right: 0,
1213
+ bottom: 0,
1214
+ left: 0
1215
+ };
1216
+ }
1217
+ function _r(e) {
1218
+ return Object.assign({}, Br(), e);
1219
+ }
1220
+ function Pr(e, t) {
1221
+ return t.reduce(function(n, r) {
1222
+ return n[r] = e, n;
1223
+ }, {});
1224
+ }
1225
+ var Fi = function(t, n) {
1226
+ return t = typeof t == "function" ? t(Object.assign({}, n.rects, {
1227
+ placement: n.placement
1228
+ })) : t, _r(typeof t != "number" ? t : Pr(t, Ct));
1229
+ };
1230
+ function $i(e) {
1231
+ var t, n = e.state, r = e.name, o = e.options, i = n.elements.arrow, s = n.modifiersData.popperOffsets, a = ie(n.placement), c = On(a), d = [q, te].indexOf(a) >= 0, u = d ? "height" : "width";
1232
+ if (!(!i || !s)) {
1233
+ var f = Fi(o.padding, n), v = Cn(i), m = c === "y" ? U : q, y = c === "y" ? ee : te, h = n.rects.reference[u] + n.rects.reference[c] - s[c] - n.rects.popper[u], w = s[c] - n.rects.reference[c], E = Ot(i), T = E ? c === "y" ? E.clientHeight || 0 : E.clientWidth || 0 : 0, C = h / 2 - w / 2, l = f[m], k = T - v[u] - f[y], g = T / 2 - v[u] / 2 + C, O = vt(l, g, k), L = c;
1234
+ n.modifiersData[r] = (t = {}, t[L] = O, t.centerOffset = O - g, t);
1235
+ }
1236
+ }
1237
+ function ji(e) {
1238
+ var t = e.state, n = e.options, r = n.element, o = r === void 0 ? "[data-popper-arrow]" : r;
1239
+ if (o != null && !(typeof o == "string" && (o = t.elements.popper.querySelector(o), !o))) {
1240
+ if (process.env.NODE_ENV !== "production" && (Z(o) || console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', "To use an SVG arrow, wrap it in an HTMLElement that will be used as", "the arrow."].join(" "))), !Lr(t.elements.popper, o)) {
1241
+ process.env.NODE_ENV !== "production" && console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', "element."].join(" "));
1242
+ return;
1243
+ }
1244
+ t.elements.arrow = o;
1245
+ }
1246
+ }
1247
+ const Wi = {
1248
+ name: "arrow",
1249
+ enabled: !0,
1250
+ phase: "main",
1251
+ fn: $i,
1252
+ effect: ji,
1253
+ requires: ["popperOffsets"],
1254
+ requiresIfExists: ["preventOverflow"]
1255
+ };
1256
+ function rt(e) {
1257
+ return e.split("-")[1];
1258
+ }
1259
+ var Ui = {
1260
+ top: "auto",
1261
+ right: "auto",
1262
+ bottom: "auto",
1263
+ left: "auto"
1264
+ };
1265
+ function qi(e) {
1266
+ var t = e.x, n = e.y, r = window, o = r.devicePixelRatio || 1;
1267
+ return {
1268
+ x: tt(t * o) / o || 0,
1269
+ y: tt(n * o) / o || 0
1270
+ };
1271
+ }
1272
+ function $n(e) {
1273
+ var t, n = e.popper, r = e.popperRect, o = e.placement, i = e.variation, s = e.offsets, a = e.position, c = e.gpuAcceleration, d = e.adaptive, u = e.roundOffsets, f = e.isFixed, v = s.x, m = v === void 0 ? 0 : v, y = s.y, h = y === void 0 ? 0 : y, w = typeof u == "function" ? u({
1274
+ x: m,
1275
+ y: h
1276
+ }) : {
1277
+ x: m,
1278
+ y: h
1279
+ };
1280
+ m = w.x, h = w.y;
1281
+ var E = s.hasOwnProperty("x"), T = s.hasOwnProperty("y"), C = q, l = U, k = window;
1282
+ if (d) {
1283
+ var g = Ot(n), O = "clientHeight", L = "clientWidth";
1284
+ if (g === ne(n) && (g = Me(n), ae(g).position !== "static" && a === "absolute" && (O = "scrollHeight", L = "scrollWidth")), g = g, o === U || (o === q || o === te) && i === wt) {
1285
+ l = ee;
1286
+ var B = f && g === k && k.visualViewport ? k.visualViewport.height : g[O];
1287
+ h -= B - r.height, h *= c ? 1 : -1;
1288
+ }
1289
+ if (o === q || (o === U || o === ee) && i === wt) {
1290
+ C = te;
1291
+ var I = f && g === k && k.visualViewport ? k.visualViewport.width : g[L];
1292
+ m -= I - r.width, m *= c ? 1 : -1;
1293
+ }
1294
+ }
1295
+ var M = Object.assign({
1296
+ position: a
1297
+ }, d && Ui), N = u === !0 ? qi({
1298
+ x: m,
1299
+ y: h
1300
+ }) : {
1301
+ x: m,
1302
+ y: h
1303
+ };
1304
+ if (m = N.x, h = N.y, c) {
1305
+ var D;
1306
+ return Object.assign({}, M, (D = {}, D[l] = T ? "0" : "", D[C] = E ? "0" : "", D.transform = (k.devicePixelRatio || 1) <= 1 ? "translate(" + m + "px, " + h + "px)" : "translate3d(" + m + "px, " + h + "px, 0)", D));
1307
+ }
1308
+ return Object.assign({}, M, (t = {}, t[l] = T ? h + "px" : "", t[C] = E ? m + "px" : "", t.transform = "", t));
1309
+ }
1310
+ function Ki(e) {
1311
+ var t = e.state, n = e.options, r = n.gpuAcceleration, o = r === void 0 ? !0 : r, i = n.adaptive, s = i === void 0 ? !0 : i, a = n.roundOffsets, c = a === void 0 ? !0 : a;
1312
+ if (process.env.NODE_ENV !== "production") {
1313
+ var d = ae(t.elements.popper).transitionProperty || "";
1314
+ s && ["transform", "top", "right", "bottom", "left"].some(function(f) {
1315
+ return d.indexOf(f) >= 0;
1316
+ }) && console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', `
1317
+
1318
+ `, 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", `
1319
+
1320
+ `, "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" "));
1321
+ }
1322
+ var u = {
1323
+ placement: ie(t.placement),
1324
+ variation: rt(t.placement),
1325
+ popper: t.elements.popper,
1326
+ popperRect: t.rects.popper,
1327
+ gpuAcceleration: o,
1328
+ isFixed: t.options.strategy === "fixed"
1329
+ };
1330
+ t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, $n(Object.assign({}, u, {
1331
+ offsets: t.modifiersData.popperOffsets,
1332
+ position: t.options.strategy,
1333
+ adaptive: s,
1334
+ roundOffsets: c
1335
+ })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, $n(Object.assign({}, u, {
1336
+ offsets: t.modifiersData.arrow,
1337
+ position: "absolute",
1338
+ adaptive: !1,
1339
+ roundOffsets: c
1340
+ })))), t.attributes.popper = Object.assign({}, t.attributes.popper, {
1341
+ "data-popper-placement": t.placement
1342
+ });
1343
+ }
1344
+ const Ji = {
1345
+ name: "computeStyles",
1346
+ enabled: !0,
1347
+ phase: "beforeWrite",
1348
+ fn: Ki,
1349
+ data: {}
1350
+ };
1351
+ var Pt = {
1352
+ passive: !0
1353
+ };
1354
+ function Gi(e) {
1355
+ var t = e.state, n = e.instance, r = e.options, o = r.scroll, i = o === void 0 ? !0 : o, s = r.resize, a = s === void 0 ? !0 : s, c = ne(t.elements.popper), d = [].concat(t.scrollParents.reference, t.scrollParents.popper);
1356
+ return i && d.forEach(function(u) {
1357
+ u.addEventListener("scroll", n.update, Pt);
1358
+ }), a && c.addEventListener("resize", n.update, Pt), function() {
1359
+ i && d.forEach(function(u) {
1360
+ u.removeEventListener("scroll", n.update, Pt);
1361
+ }), a && c.removeEventListener("resize", n.update, Pt);
1362
+ };
1363
+ }
1364
+ const Yi = {
1365
+ name: "eventListeners",
1366
+ enabled: !0,
1367
+ phase: "write",
1368
+ fn: function() {
1369
+ },
1370
+ effect: Gi,
1371
+ data: {}
1372
+ };
1373
+ var Xi = {
1374
+ left: "right",
1375
+ right: "left",
1376
+ bottom: "top",
1377
+ top: "bottom"
1378
+ };
1379
+ function $t(e) {
1380
+ return e.replace(/left|right|bottom|top/g, function(t) {
1381
+ return Xi[t];
1382
+ });
1383
+ }
1384
+ var Zi = {
1385
+ start: "end",
1386
+ end: "start"
1387
+ };
1388
+ function jn(e) {
1389
+ return e.replace(/start|end/g, function(t) {
1390
+ return Zi[t];
1391
+ });
1392
+ }
1393
+ function Sn(e) {
1394
+ var t = ne(e), n = t.pageXOffset, r = t.pageYOffset;
1395
+ return {
1396
+ scrollLeft: n,
1397
+ scrollTop: r
1398
+ };
1399
+ }
1400
+ function An(e) {
1401
+ return nt(Me(e)).left + Sn(e).scrollLeft;
1402
+ }
1403
+ function Qi(e, t) {
1404
+ var n = ne(e), r = Me(e), o = n.visualViewport, i = r.clientWidth, s = r.clientHeight, a = 0, c = 0;
1405
+ if (o) {
1406
+ i = o.width, s = o.height;
1407
+ var d = Hr();
1408
+ (d || !d && t === "fixed") && (a = o.offsetLeft, c = o.offsetTop);
1409
+ }
1410
+ return {
1411
+ width: i,
1412
+ height: s,
1413
+ x: a + An(e),
1414
+ y: c
1415
+ };
1416
+ }
1417
+ function ea(e) {
1418
+ var t, n = Me(e), r = Sn(e), o = (t = e.ownerDocument) == null ? void 0 : t.body, i = Ve(n.scrollWidth, n.clientWidth, o ? o.scrollWidth : 0, o ? o.clientWidth : 0), s = Ve(n.scrollHeight, n.clientHeight, o ? o.scrollHeight : 0, o ? o.clientHeight : 0), a = -r.scrollLeft + An(e), c = -r.scrollTop;
1419
+ return ae(o || n).direction === "rtl" && (a += Ve(n.clientWidth, o ? o.clientWidth : 0) - i), {
1420
+ width: i,
1421
+ height: s,
1422
+ x: a,
1423
+ y: c
1424
+ };
1425
+ }
1426
+ function Mn(e) {
1427
+ var t = ae(e), n = t.overflow, r = t.overflowX, o = t.overflowY;
1428
+ return /auto|scroll|overlay|hidden/.test(n + o + r);
1429
+ }
1430
+ function zr(e) {
1431
+ return ["html", "body", "#document"].indexOf(pe(e)) >= 0 ? e.ownerDocument.body : Z(e) && Mn(e) ? e : zr(Yt(e));
1432
+ }
1433
+ function gt(e, t) {
1434
+ var n;
1435
+ t === void 0 && (t = []);
1436
+ var r = zr(e), o = r === ((n = e.ownerDocument) == null ? void 0 : n.body), i = ne(r), s = o ? [i].concat(i.visualViewport || [], Mn(r) ? r : []) : r, a = t.concat(s);
1437
+ return o ? a : a.concat(gt(Yt(s)));
1438
+ }
1439
+ function gn(e) {
1440
+ return Object.assign({}, e, {
1441
+ left: e.x,
1442
+ top: e.y,
1443
+ right: e.x + e.width,
1444
+ bottom: e.y + e.height
1445
+ });
1446
+ }
1447
+ function ta(e, t) {
1448
+ var n = nt(e, !1, t === "fixed");
1449
+ return n.top = n.top + e.clientTop, n.left = n.left + e.clientLeft, n.bottom = n.top + e.clientHeight, n.right = n.left + e.clientWidth, n.width = e.clientWidth, n.height = e.clientHeight, n.x = n.left, n.y = n.top, n;
1450
+ }
1451
+ function Wn(e, t, n) {
1452
+ return t === Nr ? gn(Qi(e, n)) : We(t) ? ta(t, n) : gn(ea(Me(e)));
1453
+ }
1454
+ function na(e) {
1455
+ var t = gt(Yt(e)), n = ["absolute", "fixed"].indexOf(ae(e).position) >= 0, r = n && Z(e) ? Ot(e) : e;
1456
+ return We(r) ? t.filter(function(o) {
1457
+ return We(o) && Lr(o, r) && pe(o) !== "body";
1458
+ }) : [];
1459
+ }
1460
+ function ra(e, t, n, r) {
1461
+ var o = t === "clippingParents" ? na(e) : [].concat(t), i = [].concat(o, [n]), s = i[0], a = i.reduce(function(c, d) {
1462
+ var u = Wn(e, d, r);
1463
+ return c.top = Ve(u.top, c.top), c.right = Kt(u.right, c.right), c.bottom = Kt(u.bottom, c.bottom), c.left = Ve(u.left, c.left), c;
1464
+ }, Wn(e, s, r));
1465
+ return a.width = a.right - a.left, a.height = a.bottom - a.top, a.x = a.left, a.y = a.top, a;
1466
+ }
1467
+ function Vr(e) {
1468
+ var t = e.reference, n = e.element, r = e.placement, o = r ? ie(r) : null, i = r ? rt(r) : null, s = t.x + t.width / 2 - n.width / 2, a = t.y + t.height / 2 - n.height / 2, c;
1469
+ switch (o) {
1470
+ case U:
1471
+ c = {
1472
+ x: s,
1473
+ y: t.y - n.height
1474
+ };
1475
+ break;
1476
+ case ee:
1477
+ c = {
1478
+ x: s,
1479
+ y: t.y + t.height
1480
+ };
1481
+ break;
1482
+ case te:
1483
+ c = {
1484
+ x: t.x + t.width,
1485
+ y: a
1486
+ };
1487
+ break;
1488
+ case q:
1489
+ c = {
1490
+ x: t.x - n.width,
1491
+ y: a
1492
+ };
1493
+ break;
1494
+ default:
1495
+ c = {
1496
+ x: t.x,
1497
+ y: t.y
1498
+ };
1499
+ }
1500
+ var d = o ? On(o) : null;
1501
+ if (d != null) {
1502
+ var u = d === "y" ? "height" : "width";
1503
+ switch (i) {
1504
+ case et:
1505
+ c[d] = c[d] - (t[u] / 2 - n[u] / 2);
1506
+ break;
1507
+ case wt:
1508
+ c[d] = c[d] + (t[u] / 2 - n[u] / 2);
1509
+ break;
1510
+ }
1511
+ }
1512
+ return c;
1513
+ }
1514
+ function Et(e, t) {
1515
+ t === void 0 && (t = {});
1516
+ var n = t, r = n.placement, o = r === void 0 ? e.placement : r, i = n.strategy, s = i === void 0 ? e.strategy : i, a = n.boundary, c = a === void 0 ? Ci : a, d = n.rootBoundary, u = d === void 0 ? Nr : d, f = n.elementContext, v = f === void 0 ? pt : f, m = n.altBoundary, y = m === void 0 ? !1 : m, h = n.padding, w = h === void 0 ? 0 : h, E = _r(typeof w != "number" ? w : Pr(w, Ct)), T = v === pt ? Oi : pt, C = e.rects.popper, l = e.elements[y ? T : v], k = ra(We(l) ? l : l.contextElement || Me(e.elements.popper), c, u, s), g = nt(e.elements.reference), O = Vr({
1517
+ reference: g,
1518
+ element: C,
1519
+ strategy: "absolute",
1520
+ placement: o
1521
+ }), L = gn(Object.assign({}, C, O)), B = v === pt ? L : g, I = {
1522
+ top: k.top - B.top + E.top,
1523
+ bottom: B.bottom - k.bottom + E.bottom,
1524
+ left: k.left - B.left + E.left,
1525
+ right: B.right - k.right + E.right
1526
+ }, M = e.modifiersData.offset;
1527
+ if (v === pt && M) {
1528
+ var N = M[o];
1529
+ Object.keys(I).forEach(function(D) {
1530
+ var K = [te, ee].indexOf(D) >= 0 ? 1 : -1, J = [U, ee].indexOf(D) >= 0 ? "y" : "x";
1531
+ I[D] += N[J] * K;
1532
+ });
1533
+ }
1534
+ return I;
1535
+ }
1536
+ function oa(e, t) {
1537
+ t === void 0 && (t = {});
1538
+ var n = t, r = n.placement, o = n.boundary, i = n.rootBoundary, s = n.padding, a = n.flipVariations, c = n.allowedAutoPlacements, d = c === void 0 ? Ir : c, u = rt(r), f = u ? a ? Vn : Vn.filter(function(y) {
1539
+ return rt(y) === u;
1540
+ }) : Ct, v = f.filter(function(y) {
1541
+ return d.indexOf(y) >= 0;
1542
+ });
1543
+ v.length === 0 && (v = f, process.env.NODE_ENV !== "production" && console.error(["Popper: The `allowedAutoPlacements` option did not allow any", "placements. Ensure the `placement` option matches the variation", "of the allowed placements.", 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(" ")));
1544
+ var m = v.reduce(function(y, h) {
1545
+ return y[h] = Et(e, {
1546
+ placement: h,
1547
+ boundary: o,
1548
+ rootBoundary: i,
1549
+ padding: s
1550
+ })[ie(h)], y;
1551
+ }, {});
1552
+ return Object.keys(m).sort(function(y, h) {
1553
+ return m[y] - m[h];
1554
+ });
1555
+ }
1556
+ function ia(e) {
1557
+ if (ie(e) === Gt)
1558
+ return [];
1559
+ var t = $t(e);
1560
+ return [jn(e), t, jn(t)];
1561
+ }
1562
+ function aa(e) {
1563
+ var t = e.state, n = e.options, r = e.name;
1564
+ if (!t.modifiersData[r]._skip) {
1565
+ for (var o = n.mainAxis, i = o === void 0 ? !0 : o, s = n.altAxis, a = s === void 0 ? !0 : s, c = n.fallbackPlacements, d = n.padding, u = n.boundary, f = n.rootBoundary, v = n.altBoundary, m = n.flipVariations, y = m === void 0 ? !0 : m, h = n.allowedAutoPlacements, w = t.options.placement, E = ie(w), T = E === w, C = c || (T || !y ? [$t(w)] : ia(w)), l = [w].concat(C).reduce(function(he, re) {
1566
+ return he.concat(ie(re) === Gt ? oa(t, {
1567
+ placement: re,
1568
+ boundary: u,
1569
+ rootBoundary: f,
1570
+ padding: d,
1571
+ flipVariations: y,
1572
+ allowedAutoPlacements: h
1573
+ }) : re);
1574
+ }, []), k = t.rects.reference, g = t.rects.popper, O = /* @__PURE__ */ new Map(), L = !0, B = l[0], I = 0; I < l.length; I++) {
1575
+ var M = l[I], N = ie(M), D = rt(M) === et, K = [U, ee].indexOf(N) >= 0, J = K ? "width" : "height", V = Et(t, {
1576
+ placement: M,
1577
+ boundary: u,
1578
+ rootBoundary: f,
1579
+ altBoundary: v,
1580
+ padding: d
1581
+ }), F = K ? D ? te : q : D ? ee : U;
1582
+ k[J] > g[J] && (F = $t(F));
1583
+ var P = $t(F), se = [];
1584
+ if (i && se.push(V[N] <= 0), a && se.push(V[F] <= 0, V[P] <= 0), se.every(function(he) {
1585
+ return he;
1586
+ })) {
1587
+ B = M, L = !1;
1588
+ break;
1589
+ }
1590
+ O.set(M, se);
1591
+ }
1592
+ if (L)
1593
+ for (var ce = y ? 3 : 1, Re = function(re) {
1594
+ var me = l.find(function(Ue) {
1595
+ var ve = O.get(Ue);
1596
+ if (ve)
1597
+ return ve.slice(0, re).every(function(qe) {
1598
+ return qe;
1599
+ });
1600
+ });
1601
+ if (me)
1602
+ return B = me, "break";
1603
+ }, le = ce; le > 0; le--) {
1604
+ var Ne = Re(le);
1605
+ if (Ne === "break")
1606
+ break;
1607
+ }
1608
+ t.placement !== B && (t.modifiersData[r]._skip = !0, t.placement = B, t.reset = !0);
1609
+ }
1610
+ }
1611
+ const sa = {
1612
+ name: "flip",
1613
+ enabled: !0,
1614
+ phase: "main",
1615
+ fn: aa,
1616
+ requiresIfExists: ["offset"],
1617
+ data: {
1618
+ _skip: !1
1619
+ }
1620
+ };
1621
+ function Un(e, t, n) {
1622
+ return n === void 0 && (n = {
1623
+ x: 0,
1624
+ y: 0
1625
+ }), {
1626
+ top: e.top - t.height - n.y,
1627
+ right: e.right - t.width + n.x,
1628
+ bottom: e.bottom - t.height + n.y,
1629
+ left: e.left - t.width - n.x
1630
+ };
1631
+ }
1632
+ function qn(e) {
1633
+ return [U, te, ee, q].some(function(t) {
1634
+ return e[t] >= 0;
1635
+ });
1636
+ }
1637
+ function ca(e) {
1638
+ var t = e.state, n = e.name, r = t.rects.reference, o = t.rects.popper, i = t.modifiersData.preventOverflow, s = Et(t, {
1639
+ elementContext: "reference"
1640
+ }), a = Et(t, {
1641
+ altBoundary: !0
1642
+ }), c = Un(s, r), d = Un(a, o, i), u = qn(c), f = qn(d);
1643
+ t.modifiersData[n] = {
1644
+ referenceClippingOffsets: c,
1645
+ popperEscapeOffsets: d,
1646
+ isReferenceHidden: u,
1647
+ hasPopperEscaped: f
1648
+ }, t.attributes.popper = Object.assign({}, t.attributes.popper, {
1649
+ "data-popper-reference-hidden": u,
1650
+ "data-popper-escaped": f
1651
+ });
1652
+ }
1653
+ const la = {
1654
+ name: "hide",
1655
+ enabled: !0,
1656
+ phase: "main",
1657
+ requiresIfExists: ["preventOverflow"],
1658
+ fn: ca
1659
+ };
1660
+ function ua(e, t, n) {
1661
+ var r = ie(e), o = [q, U].indexOf(r) >= 0 ? -1 : 1, i = typeof n == "function" ? n(Object.assign({}, t, {
1662
+ placement: e
1663
+ })) : n, s = i[0], a = i[1];
1664
+ return s = s || 0, a = (a || 0) * o, [q, te].indexOf(r) >= 0 ? {
1665
+ x: a,
1666
+ y: s
1667
+ } : {
1668
+ x: s,
1669
+ y: a
1670
+ };
1671
+ }
1672
+ function da(e) {
1673
+ var t = e.state, n = e.options, r = e.name, o = n.offset, i = o === void 0 ? [0, 0] : o, s = Ir.reduce(function(u, f) {
1674
+ return u[f] = ua(f, t.rects, i), u;
1675
+ }, {}), a = s[t.placement], c = a.x, d = a.y;
1676
+ t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += c, t.modifiersData.popperOffsets.y += d), t.modifiersData[r] = s;
1677
+ }
1678
+ const fa = {
1679
+ name: "offset",
1680
+ enabled: !0,
1681
+ phase: "main",
1682
+ requires: ["popperOffsets"],
1683
+ fn: da
1684
+ };
1685
+ function pa(e) {
1686
+ var t = e.state, n = e.name;
1687
+ t.modifiersData[n] = Vr({
1688
+ reference: t.rects.reference,
1689
+ element: t.rects.popper,
1690
+ strategy: "absolute",
1691
+ placement: t.placement
1692
+ });
1693
+ }
1694
+ const ha = {
1695
+ name: "popperOffsets",
1696
+ enabled: !0,
1697
+ phase: "read",
1698
+ fn: pa,
1699
+ data: {}
1700
+ };
1701
+ function ma(e) {
1702
+ return e === "x" ? "y" : "x";
1703
+ }
1704
+ function va(e) {
1705
+ var t = e.state, n = e.options, r = e.name, o = n.mainAxis, i = o === void 0 ? !0 : o, s = n.altAxis, a = s === void 0 ? !1 : s, c = n.boundary, d = n.rootBoundary, u = n.altBoundary, f = n.padding, v = n.tether, m = v === void 0 ? !0 : v, y = n.tetherOffset, h = y === void 0 ? 0 : y, w = Et(t, {
1706
+ boundary: c,
1707
+ rootBoundary: d,
1708
+ padding: f,
1709
+ altBoundary: u
1710
+ }), E = ie(t.placement), T = rt(t.placement), C = !T, l = On(E), k = ma(l), g = t.modifiersData.popperOffsets, O = t.rects.reference, L = t.rects.popper, B = typeof h == "function" ? h(Object.assign({}, t.rects, {
1711
+ placement: t.placement
1712
+ })) : h, I = typeof B == "number" ? {
1713
+ mainAxis: B,
1714
+ altAxis: B
1715
+ } : Object.assign({
1716
+ mainAxis: 0,
1717
+ altAxis: 0
1718
+ }, B), M = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, N = {
1719
+ x: 0,
1720
+ y: 0
1721
+ };
1722
+ if (!!g) {
1723
+ if (i) {
1724
+ var D, K = l === "y" ? U : q, J = l === "y" ? ee : te, V = l === "y" ? "height" : "width", F = g[l], P = F + w[K], se = F - w[J], ce = m ? -L[V] / 2 : 0, Re = T === et ? O[V] : L[V], le = T === et ? -L[V] : -O[V], Ne = t.elements.arrow, he = m && Ne ? Cn(Ne) : {
1725
+ width: 0,
1726
+ height: 0
1727
+ }, re = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : Br(), me = re[K], Ue = re[J], ve = vt(0, O[V], he[V]), qe = C ? O[V] / 2 - ce - ve - me - I.mainAxis : Re - ve - me - I.mainAxis, Ee = C ? -O[V] / 2 + ce + ve + Ue + I.mainAxis : le + ve + Ue + I.mainAxis, Ke = t.elements.arrow && Ot(t.elements.arrow), St = Ke ? l === "y" ? Ke.clientTop || 0 : Ke.clientLeft || 0 : 0, st = (D = M == null ? void 0 : M[l]) != null ? D : 0, At = F + qe - st - St, Mt = F + Ee - st, ct = vt(m ? Kt(P, At) : P, F, m ? Ve(se, Mt) : se);
1728
+ g[l] = ct, N[l] = ct - F;
1729
+ }
1730
+ if (a) {
1731
+ var lt, Rt = l === "x" ? U : q, Nt = l === "x" ? ee : te, ge = g[k], ke = k === "y" ? "height" : "width", ut = ge + w[Rt], Ie = ge - w[Nt], dt = [U, q].indexOf(E) !== -1, It = (lt = M == null ? void 0 : M[k]) != null ? lt : 0, Dt = dt ? ut : ge - O[ke] - L[ke] - It + I.altAxis, Ht = dt ? ge + O[ke] + L[ke] - It - I.altAxis : Ie, Lt = m && dt ? Vi(Dt, ge, Ht) : vt(m ? Dt : ut, ge, m ? Ht : Ie);
1732
+ g[k] = Lt, N[k] = Lt - ge;
1733
+ }
1734
+ t.modifiersData[r] = N;
1735
+ }
1736
+ }
1737
+ const ga = {
1738
+ name: "preventOverflow",
1739
+ enabled: !0,
1740
+ phase: "main",
1741
+ fn: va,
1742
+ requiresIfExists: ["offset"]
1743
+ };
1744
+ function ya(e) {
1745
+ return {
1746
+ scrollLeft: e.scrollLeft,
1747
+ scrollTop: e.scrollTop
1748
+ };
1749
+ }
1750
+ function ba(e) {
1751
+ return e === ne(e) || !Z(e) ? Sn(e) : ya(e);
1752
+ }
1753
+ function wa(e) {
1754
+ var t = e.getBoundingClientRect(), n = tt(t.width) / e.offsetWidth || 1, r = tt(t.height) / e.offsetHeight || 1;
1755
+ return n !== 1 || r !== 1;
1756
+ }
1757
+ function Ea(e, t, n) {
1758
+ n === void 0 && (n = !1);
1759
+ var r = Z(t), o = Z(t) && wa(t), i = Me(t), s = nt(e, o, n), a = {
1760
+ scrollLeft: 0,
1761
+ scrollTop: 0
1762
+ }, c = {
1763
+ x: 0,
1764
+ y: 0
1765
+ };
1766
+ return (r || !r && !n) && ((pe(t) !== "body" || Mn(i)) && (a = ba(t)), Z(t) ? (c = nt(t, !0), c.x += t.clientLeft, c.y += t.clientTop) : i && (c.x = An(i))), {
1767
+ x: s.left + a.scrollLeft - c.x,
1768
+ y: s.top + a.scrollTop - c.y,
1769
+ width: s.width,
1770
+ height: s.height
1771
+ };
1772
+ }
1773
+ function ka(e) {
1774
+ var t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = [];
1775
+ e.forEach(function(i) {
1776
+ t.set(i.name, i);
1777
+ });
1778
+ function o(i) {
1779
+ n.add(i.name);
1780
+ var s = [].concat(i.requires || [], i.requiresIfExists || []);
1781
+ s.forEach(function(a) {
1782
+ if (!n.has(a)) {
1783
+ var c = t.get(a);
1784
+ c && o(c);
1785
+ }
1786
+ }), r.push(i);
1787
+ }
1788
+ return e.forEach(function(i) {
1789
+ n.has(i.name) || o(i);
1790
+ }), r;
1791
+ }
1792
+ function xa(e) {
1793
+ var t = ka(e);
1794
+ return mn.reduce(function(n, r) {
1795
+ return n.concat(t.filter(function(o) {
1796
+ return o.phase === r;
1797
+ }));
1798
+ }, []);
1799
+ }
1800
+ function Ta(e) {
1801
+ var t;
1802
+ return function() {
1803
+ return t || (t = new Promise(function(n) {
1804
+ Promise.resolve().then(function() {
1805
+ t = void 0, n(e());
1806
+ });
1807
+ })), t;
1808
+ };
1809
+ }
1810
+ function xe(e) {
1811
+ for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
1812
+ n[r - 1] = arguments[r];
1813
+ return [].concat(n).reduce(function(o, i) {
1814
+ return o.replace(/%s/, i);
1815
+ }, e);
1816
+ }
1817
+ var He = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s', Ca = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available', Kn = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
1818
+ function Oa(e) {
1819
+ e.forEach(function(t) {
1820
+ [].concat(Object.keys(t), Kn).filter(function(n, r, o) {
1821
+ return o.indexOf(n) === r;
1822
+ }).forEach(function(n) {
1823
+ switch (n) {
1824
+ case "name":
1825
+ typeof t.name != "string" && console.error(xe(He, String(t.name), '"name"', '"string"', '"' + String(t.name) + '"'));
1826
+ break;
1827
+ case "enabled":
1828
+ typeof t.enabled != "boolean" && console.error(xe(He, t.name, '"enabled"', '"boolean"', '"' + String(t.enabled) + '"'));
1829
+ break;
1830
+ case "phase":
1831
+ mn.indexOf(t.phase) < 0 && console.error(xe(He, t.name, '"phase"', "either " + mn.join(", "), '"' + String(t.phase) + '"'));
1832
+ break;
1833
+ case "fn":
1834
+ typeof t.fn != "function" && console.error(xe(He, t.name, '"fn"', '"function"', '"' + String(t.fn) + '"'));
1835
+ break;
1836
+ case "effect":
1837
+ t.effect != null && typeof t.effect != "function" && console.error(xe(He, t.name, '"effect"', '"function"', '"' + String(t.fn) + '"'));
1838
+ break;
1839
+ case "requires":
1840
+ t.requires != null && !Array.isArray(t.requires) && console.error(xe(He, t.name, '"requires"', '"array"', '"' + String(t.requires) + '"'));
1841
+ break;
1842
+ case "requiresIfExists":
1843
+ Array.isArray(t.requiresIfExists) || console.error(xe(He, t.name, '"requiresIfExists"', '"array"', '"' + String(t.requiresIfExists) + '"'));
1844
+ break;
1845
+ case "options":
1846
+ case "data":
1847
+ break;
1848
+ default:
1849
+ console.error('PopperJS: an invalid property has been provided to the "' + t.name + '" modifier, valid properties are ' + Kn.map(function(r) {
1850
+ return '"' + r + '"';
1851
+ }).join(", ") + '; but "' + n + '" was provided.');
1852
+ }
1853
+ t.requires && t.requires.forEach(function(r) {
1854
+ e.find(function(o) {
1855
+ return o.name === r;
1856
+ }) == null && console.error(xe(Ca, String(t.name), r, r));
1857
+ });
1858
+ });
1859
+ });
1860
+ }
1861
+ function Sa(e, t) {
1862
+ var n = /* @__PURE__ */ new Set();
1863
+ return e.filter(function(r) {
1864
+ var o = t(r);
1865
+ if (!n.has(o))
1866
+ return n.add(o), !0;
1867
+ });
1868
+ }
1869
+ function Aa(e) {
1870
+ var t = e.reduce(function(n, r) {
1871
+ var o = n[r.name];
1872
+ return n[r.name] = o ? Object.assign({}, o, r, {
1873
+ options: Object.assign({}, o.options, r.options),
1874
+ data: Object.assign({}, o.data, r.data)
1875
+ }) : r, n;
1876
+ }, {});
1877
+ return Object.keys(t).map(function(n) {
1878
+ return t[n];
1879
+ });
1880
+ }
1881
+ var Jn = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.", Ma = "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.", Gn = {
1882
+ placement: "bottom",
1883
+ modifiers: [],
1884
+ strategy: "absolute"
1885
+ };
1886
+ function Yn() {
1887
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
1888
+ t[n] = arguments[n];
1889
+ return !t.some(function(r) {
1890
+ return !(r && typeof r.getBoundingClientRect == "function");
1891
+ });
1892
+ }
1893
+ function Ra(e) {
1894
+ e === void 0 && (e = {});
1895
+ var t = e, n = t.defaultModifiers, r = n === void 0 ? [] : n, o = t.defaultOptions, i = o === void 0 ? Gn : o;
1896
+ return function(a, c, d) {
1897
+ d === void 0 && (d = i);
1898
+ var u = {
1899
+ placement: "bottom",
1900
+ orderedModifiers: [],
1901
+ options: Object.assign({}, Gn, i),
1902
+ modifiersData: {},
1903
+ elements: {
1904
+ reference: a,
1905
+ popper: c
1906
+ },
1907
+ attributes: {},
1908
+ styles: {}
1909
+ }, f = [], v = !1, m = {
1910
+ state: u,
1911
+ setOptions: function(E) {
1912
+ var T = typeof E == "function" ? E(u.options) : E;
1913
+ h(), u.options = Object.assign({}, i, u.options, T), u.scrollParents = {
1914
+ reference: We(a) ? gt(a) : a.contextElement ? gt(a.contextElement) : [],
1915
+ popper: gt(c)
1916
+ };
1917
+ var C = xa(Aa([].concat(r, u.options.modifiers)));
1918
+ if (u.orderedModifiers = C.filter(function(M) {
1919
+ return M.enabled;
1920
+ }), process.env.NODE_ENV !== "production") {
1921
+ var l = Sa([].concat(C, u.options.modifiers), function(M) {
1922
+ var N = M.name;
1923
+ return N;
1924
+ });
1925
+ if (Oa(l), ie(u.options.placement) === Gt) {
1926
+ var k = u.orderedModifiers.find(function(M) {
1927
+ var N = M.name;
1928
+ return N === "flip";
1929
+ });
1930
+ k || console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "));
1931
+ }
1932
+ var g = ae(c), O = g.marginTop, L = g.marginRight, B = g.marginBottom, I = g.marginLeft;
1933
+ [O, L, B, I].some(function(M) {
1934
+ return parseFloat(M);
1935
+ }) && console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" "));
1936
+ }
1937
+ return y(), m.update();
1938
+ },
1939
+ forceUpdate: function() {
1940
+ if (!v) {
1941
+ var E = u.elements, T = E.reference, C = E.popper;
1942
+ if (!Yn(T, C)) {
1943
+ process.env.NODE_ENV !== "production" && console.error(Jn);
1944
+ return;
1945
+ }
1946
+ u.rects = {
1947
+ reference: Ea(T, Ot(C), u.options.strategy === "fixed"),
1948
+ popper: Cn(C)
1949
+ }, u.reset = !1, u.placement = u.options.placement, u.orderedModifiers.forEach(function(M) {
1950
+ return u.modifiersData[M.name] = Object.assign({}, M.data);
1951
+ });
1952
+ for (var l = 0, k = 0; k < u.orderedModifiers.length; k++) {
1953
+ if (process.env.NODE_ENV !== "production" && (l += 1, l > 100)) {
1954
+ console.error(Ma);
1955
+ break;
1956
+ }
1957
+ if (u.reset === !0) {
1958
+ u.reset = !1, k = -1;
1959
+ continue;
1960
+ }
1961
+ var g = u.orderedModifiers[k], O = g.fn, L = g.options, B = L === void 0 ? {} : L, I = g.name;
1962
+ typeof O == "function" && (u = O({
1963
+ state: u,
1964
+ options: B,
1965
+ name: I,
1966
+ instance: m
1967
+ }) || u);
1968
+ }
1969
+ }
1970
+ },
1971
+ update: Ta(function() {
1972
+ return new Promise(function(w) {
1973
+ m.forceUpdate(), w(u);
1974
+ });
1975
+ }),
1976
+ destroy: function() {
1977
+ h(), v = !0;
1978
+ }
1979
+ };
1980
+ if (!Yn(a, c))
1981
+ return process.env.NODE_ENV !== "production" && console.error(Jn), m;
1982
+ m.setOptions(d).then(function(w) {
1983
+ !v && d.onFirstUpdate && d.onFirstUpdate(w);
1984
+ });
1985
+ function y() {
1986
+ u.orderedModifiers.forEach(function(w) {
1987
+ var E = w.name, T = w.options, C = T === void 0 ? {} : T, l = w.effect;
1988
+ if (typeof l == "function") {
1989
+ var k = l({
1990
+ state: u,
1991
+ name: E,
1992
+ instance: m,
1993
+ options: C
1994
+ }), g = function() {
1995
+ };
1996
+ f.push(k || g);
1997
+ }
1998
+ });
1999
+ }
2000
+ function h() {
2001
+ f.forEach(function(w) {
2002
+ return w();
2003
+ }), f = [];
2004
+ }
2005
+ return m;
2006
+ };
2007
+ }
2008
+ var Na = [Yi, ha, Ji, Dr, fa, sa, ga, Wi, la], Ia = /* @__PURE__ */ Ra({
2009
+ defaultModifiers: Na
2010
+ }), Da = "tippy-box", Fr = "tippy-content", Ha = "tippy-backdrop", $r = "tippy-arrow", jr = "tippy-svg-arrow", Le = {
2011
+ passive: !0,
2012
+ capture: !0
2013
+ }, Wr = function() {
2014
+ return document.body;
2015
+ };
2016
+ function La(e, t) {
2017
+ return {}.hasOwnProperty.call(e, t);
2018
+ }
2019
+ function on(e, t, n) {
2020
+ if (Array.isArray(e)) {
2021
+ var r = e[t];
2022
+ return r == null ? Array.isArray(n) ? n[t] : n : r;
2023
+ }
2024
+ return e;
2025
+ }
2026
+ function Rn(e, t) {
2027
+ var n = {}.toString.call(e);
2028
+ return n.indexOf("[object") === 0 && n.indexOf(t + "]") > -1;
2029
+ }
2030
+ function Ur(e, t) {
2031
+ return typeof e == "function" ? e.apply(void 0, t) : e;
2032
+ }
2033
+ function Xn(e, t) {
2034
+ if (t === 0)
2035
+ return e;
2036
+ var n;
2037
+ return function(r) {
2038
+ clearTimeout(n), n = setTimeout(function() {
2039
+ e(r);
2040
+ }, t);
2041
+ };
2042
+ }
2043
+ function Ba(e, t) {
2044
+ var n = Object.assign({}, e);
2045
+ return t.forEach(function(r) {
2046
+ delete n[r];
2047
+ }), n;
2048
+ }
2049
+ function _a(e) {
2050
+ return e.split(/\s+/).filter(Boolean);
2051
+ }
2052
+ function Qe(e) {
2053
+ return [].concat(e);
2054
+ }
2055
+ function Zn(e, t) {
2056
+ e.indexOf(t) === -1 && e.push(t);
2057
+ }
2058
+ function Pa(e) {
2059
+ return e.filter(function(t, n) {
2060
+ return e.indexOf(t) === n;
2061
+ });
2062
+ }
2063
+ function za(e) {
2064
+ return e.split("-")[0];
2065
+ }
2066
+ function Jt(e) {
2067
+ return [].slice.call(e);
2068
+ }
2069
+ function Qn(e) {
2070
+ return Object.keys(e).reduce(function(t, n) {
2071
+ return e[n] !== void 0 && (t[n] = e[n]), t;
2072
+ }, {});
2073
+ }
2074
+ function yt() {
2075
+ return document.createElement("div");
2076
+ }
2077
+ function kt(e) {
2078
+ return ["Element", "Fragment"].some(function(t) {
2079
+ return Rn(e, t);
2080
+ });
2081
+ }
2082
+ function Va(e) {
2083
+ return Rn(e, "NodeList");
2084
+ }
2085
+ function Fa(e) {
2086
+ return Rn(e, "MouseEvent");
2087
+ }
2088
+ function $a(e) {
2089
+ return !!(e && e._tippy && e._tippy.reference === e);
2090
+ }
2091
+ function ja(e) {
2092
+ return kt(e) ? [e] : Va(e) ? Jt(e) : Array.isArray(e) ? e : Jt(document.querySelectorAll(e));
2093
+ }
2094
+ function an(e, t) {
2095
+ e.forEach(function(n) {
2096
+ n && (n.style.transitionDuration = t + "ms");
2097
+ });
2098
+ }
2099
+ function er(e, t) {
2100
+ e.forEach(function(n) {
2101
+ n && n.setAttribute("data-state", t);
2102
+ });
2103
+ }
2104
+ function Wa(e) {
2105
+ var t, n = Qe(e), r = n[0];
2106
+ return r != null && (t = r.ownerDocument) != null && t.body ? r.ownerDocument : document;
2107
+ }
2108
+ function Ua(e, t) {
2109
+ var n = t.clientX, r = t.clientY;
2110
+ return e.every(function(o) {
2111
+ var i = o.popperRect, s = o.popperState, a = o.props, c = a.interactiveBorder, d = za(s.placement), u = s.modifiersData.offset;
2112
+ if (!u)
2113
+ return !0;
2114
+ var f = d === "bottom" ? u.top.y : 0, v = d === "top" ? u.bottom.y : 0, m = d === "right" ? u.left.x : 0, y = d === "left" ? u.right.x : 0, h = i.top - r + f > c, w = r - i.bottom - v > c, E = i.left - n + m > c, T = n - i.right - y > c;
2115
+ return h || w || E || T;
2116
+ });
2117
+ }
2118
+ function sn(e, t, n) {
2119
+ var r = t + "EventListener";
2120
+ ["transitionend", "webkitTransitionEnd"].forEach(function(o) {
2121
+ e[r](o, n);
2122
+ });
2123
+ }
2124
+ function tr(e, t) {
2125
+ for (var n = t; n; ) {
2126
+ var r;
2127
+ if (e.contains(n))
2128
+ return !0;
2129
+ n = n.getRootNode == null || (r = n.getRootNode()) == null ? void 0 : r.host;
2130
+ }
2131
+ return !1;
2132
+ }
2133
+ var de = {
2134
+ isTouch: !1
2135
+ }, nr = 0;
2136
+ function qa() {
2137
+ de.isTouch || (de.isTouch = !0, window.performance && document.addEventListener("mousemove", qr));
2138
+ }
2139
+ function qr() {
2140
+ var e = performance.now();
2141
+ e - nr < 20 && (de.isTouch = !1, document.removeEventListener("mousemove", qr)), nr = e;
2142
+ }
2143
+ function Ka() {
2144
+ var e = document.activeElement;
2145
+ if ($a(e)) {
2146
+ var t = e._tippy;
2147
+ e.blur && !t.state.isVisible && e.blur();
2148
+ }
2149
+ }
2150
+ function Ja() {
2151
+ document.addEventListener("touchstart", qa, Le), window.addEventListener("blur", Ka);
2152
+ }
2153
+ var Ga = typeof window < "u" && typeof document < "u", Ya = Ga ? !!window.msCrypto : !1;
2154
+ function Ye(e) {
2155
+ var t = e === "destroy" ? "n already-" : " ";
2156
+ return [e + "() was called on a" + t + "destroyed instance. This is a no-op but", "indicates a potential memory leak."].join(" ");
2157
+ }
2158
+ function rr(e) {
2159
+ var t = /[ \t]{2,}/g, n = /^[ \t]*/gm;
2160
+ return e.replace(t, " ").replace(n, "").trim();
2161
+ }
2162
+ function Xa(e) {
2163
+ return rr(`
2164
+ %ctippy.js
2165
+
2166
+ %c` + rr(e) + `
2167
+
2168
+ %c\u{1F477}\u200D This is a development-only message. It will be removed in production.
2169
+ `);
2170
+ }
2171
+ function Kr(e) {
2172
+ return [
2173
+ Xa(e),
2174
+ "color: #00C584; font-size: 1.3em; font-weight: bold;",
2175
+ "line-height: 1.5",
2176
+ "color: #a6a095;"
2177
+ ];
2178
+ }
2179
+ var xt;
2180
+ process.env.NODE_ENV !== "production" && Za();
2181
+ function Za() {
2182
+ xt = /* @__PURE__ */ new Set();
2183
+ }
2184
+ function ye(e, t) {
2185
+ if (e && !xt.has(t)) {
2186
+ var n;
2187
+ xt.add(t), (n = console).warn.apply(n, Kr(t));
2188
+ }
2189
+ }
2190
+ function yn(e, t) {
2191
+ if (e && !xt.has(t)) {
2192
+ var n;
2193
+ xt.add(t), (n = console).error.apply(n, Kr(t));
2194
+ }
2195
+ }
2196
+ function Qa(e) {
2197
+ var t = !e, n = Object.prototype.toString.call(e) === "[object Object]" && !e.addEventListener;
2198
+ yn(t, ["tippy() was passed", "`" + String(e) + "`", "as its targets (first) argument. Valid types are: String, Element,", "Element[], or NodeList."].join(" ")), yn(n, ["tippy() was passed a plain object which is not supported as an argument", "for virtual positioning. Use props.getReferenceClientRect instead."].join(" "));
2199
+ }
2200
+ var Jr = {
2201
+ animateFill: !1,
2202
+ followCursor: !1,
2203
+ inlinePositioning: !1,
2204
+ sticky: !1
2205
+ }, es = {
2206
+ allowHTML: !1,
2207
+ animation: "fade",
2208
+ arrow: !0,
2209
+ content: "",
2210
+ inertia: !1,
2211
+ maxWidth: 350,
2212
+ role: "tooltip",
2213
+ theme: "",
2214
+ zIndex: 9999
2215
+ }, Y = Object.assign({
2216
+ appendTo: Wr,
2217
+ aria: {
2218
+ content: "auto",
2219
+ expanded: "auto"
2220
+ },
2221
+ delay: 0,
2222
+ duration: [300, 250],
2223
+ getReferenceClientRect: null,
2224
+ hideOnClick: !0,
2225
+ ignoreAttributes: !1,
2226
+ interactive: !1,
2227
+ interactiveBorder: 2,
2228
+ interactiveDebounce: 0,
2229
+ moveTransition: "",
2230
+ offset: [0, 10],
2231
+ onAfterUpdate: function() {
2232
+ },
2233
+ onBeforeUpdate: function() {
2234
+ },
2235
+ onCreate: function() {
2236
+ },
2237
+ onDestroy: function() {
2238
+ },
2239
+ onHidden: function() {
2240
+ },
2241
+ onHide: function() {
2242
+ },
2243
+ onMount: function() {
2244
+ },
2245
+ onShow: function() {
2246
+ },
2247
+ onShown: function() {
2248
+ },
2249
+ onTrigger: function() {
2250
+ },
2251
+ onUntrigger: function() {
2252
+ },
2253
+ onClickOutside: function() {
2254
+ },
2255
+ placement: "top",
2256
+ plugins: [],
2257
+ popperOptions: {},
2258
+ render: null,
2259
+ showOnCreate: !1,
2260
+ touch: !0,
2261
+ trigger: "mouseenter focus",
2262
+ triggerTarget: null
2263
+ }, Jr, es), ts = Object.keys(Y), ns = function(t) {
2264
+ process.env.NODE_ENV !== "production" && Yr(t, []);
2265
+ var n = Object.keys(t);
2266
+ n.forEach(function(r) {
2267
+ Y[r] = t[r];
2268
+ });
2269
+ };
2270
+ function Gr(e) {
2271
+ var t = e.plugins || [], n = t.reduce(function(r, o) {
2272
+ var i = o.name, s = o.defaultValue;
2273
+ if (i) {
2274
+ var a;
2275
+ r[i] = e[i] !== void 0 ? e[i] : (a = Y[i]) != null ? a : s;
2276
+ }
2277
+ return r;
2278
+ }, {});
2279
+ return Object.assign({}, e, n);
2280
+ }
2281
+ function rs(e, t) {
2282
+ var n = t ? Object.keys(Gr(Object.assign({}, Y, {
2283
+ plugins: t
2284
+ }))) : ts, r = n.reduce(function(o, i) {
2285
+ var s = (e.getAttribute("data-tippy-" + i) || "").trim();
2286
+ if (!s)
2287
+ return o;
2288
+ if (i === "content")
2289
+ o[i] = s;
2290
+ else
2291
+ try {
2292
+ o[i] = JSON.parse(s);
2293
+ } catch {
2294
+ o[i] = s;
2295
+ }
2296
+ return o;
2297
+ }, {});
2298
+ return r;
2299
+ }
2300
+ function or(e, t) {
2301
+ var n = Object.assign({}, t, {
2302
+ content: Ur(t.content, [e])
2303
+ }, t.ignoreAttributes ? {} : rs(e, t.plugins));
2304
+ return n.aria = Object.assign({}, Y.aria, n.aria), n.aria = {
2305
+ expanded: n.aria.expanded === "auto" ? t.interactive : n.aria.expanded,
2306
+ content: n.aria.content === "auto" ? t.interactive ? null : "describedby" : n.aria.content
2307
+ }, n;
2308
+ }
2309
+ function Yr(e, t) {
2310
+ e === void 0 && (e = {}), t === void 0 && (t = []);
2311
+ var n = Object.keys(e);
2312
+ n.forEach(function(r) {
2313
+ var o = Ba(Y, Object.keys(Jr)), i = !La(o, r);
2314
+ i && (i = t.filter(function(s) {
2315
+ return s.name === r;
2316
+ }).length === 0), ye(i, ["`" + r + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", "a plugin, forgot to pass it in an array as props.plugins.", `
2317
+
2318
+ `, `All props: https://atomiks.github.io/tippyjs/v6/all-props/
2319
+ `, "Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "));
2320
+ });
2321
+ }
2322
+ var os = function() {
2323
+ return "innerHTML";
2324
+ };
2325
+ function bn(e, t) {
2326
+ e[os()] = t;
2327
+ }
2328
+ function ir(e) {
2329
+ var t = yt();
2330
+ return e === !0 ? t.className = $r : (t.className = jr, kt(e) ? t.appendChild(e) : bn(t, e)), t;
2331
+ }
2332
+ function ar(e, t) {
2333
+ kt(t.content) ? (bn(e, ""), e.appendChild(t.content)) : typeof t.content != "function" && (t.allowHTML ? bn(e, t.content) : e.textContent = t.content);
2334
+ }
2335
+ function wn(e) {
2336
+ var t = e.firstElementChild, n = Jt(t.children);
2337
+ return {
2338
+ box: t,
2339
+ content: n.find(function(r) {
2340
+ return r.classList.contains(Fr);
2341
+ }),
2342
+ arrow: n.find(function(r) {
2343
+ return r.classList.contains($r) || r.classList.contains(jr);
2344
+ }),
2345
+ backdrop: n.find(function(r) {
2346
+ return r.classList.contains(Ha);
2347
+ })
2348
+ };
2349
+ }
2350
+ function Xr(e) {
2351
+ var t = yt(), n = yt();
2352
+ n.className = Da, n.setAttribute("data-state", "hidden"), n.setAttribute("tabindex", "-1");
2353
+ var r = yt();
2354
+ r.className = Fr, r.setAttribute("data-state", "hidden"), ar(r, e.props), t.appendChild(n), n.appendChild(r), o(e.props, e.props);
2355
+ function o(i, s) {
2356
+ var a = wn(t), c = a.box, d = a.content, u = a.arrow;
2357
+ s.theme ? c.setAttribute("data-theme", s.theme) : c.removeAttribute("data-theme"), typeof s.animation == "string" ? c.setAttribute("data-animation", s.animation) : c.removeAttribute("data-animation"), s.inertia ? c.setAttribute("data-inertia", "") : c.removeAttribute("data-inertia"), c.style.maxWidth = typeof s.maxWidth == "number" ? s.maxWidth + "px" : s.maxWidth, s.role ? c.setAttribute("role", s.role) : c.removeAttribute("role"), (i.content !== s.content || i.allowHTML !== s.allowHTML) && ar(d, e.props), s.arrow ? u ? i.arrow !== s.arrow && (c.removeChild(u), c.appendChild(ir(s.arrow))) : c.appendChild(ir(s.arrow)) : u && c.removeChild(u);
2358
+ }
2359
+ return {
2360
+ popper: t,
2361
+ onUpdate: o
2362
+ };
2363
+ }
2364
+ Xr.$$tippy = !0;
2365
+ var is = 1, zt = [], cn = [];
2366
+ function as(e, t) {
2367
+ var n = or(e, Object.assign({}, Y, Gr(Qn(t)))), r, o, i, s = !1, a = !1, c = !1, d = !1, u, f, v, m = [], y = Xn(At, n.interactiveDebounce), h, w = is++, E = null, T = Pa(n.plugins), C = {
2368
+ isEnabled: !0,
2369
+ isVisible: !1,
2370
+ isDestroyed: !1,
2371
+ isMounted: !1,
2372
+ isShown: !1
2373
+ }, l = {
2374
+ id: w,
2375
+ reference: e,
2376
+ popper: yt(),
2377
+ popperInstance: E,
2378
+ props: n,
2379
+ state: C,
2380
+ plugins: T,
2381
+ clearDelayTimeouts: Dt,
2382
+ setProps: Ht,
2383
+ setContent: Lt,
2384
+ show: uo,
2385
+ hide: fo,
2386
+ hideWithInteractivity: po,
2387
+ enable: dt,
2388
+ disable: It,
2389
+ unmount: ho,
2390
+ destroy: mo
2391
+ };
2392
+ if (!n.render)
2393
+ return process.env.NODE_ENV !== "production" && yn(!0, "render() function has not been supplied."), l;
2394
+ var k = n.render(l), g = k.popper, O = k.onUpdate;
2395
+ g.setAttribute("data-tippy-root", ""), g.id = "tippy-" + l.id, l.popper = g, e._tippy = l, g._tippy = l;
2396
+ var L = T.map(function(p) {
2397
+ return p.fn(l);
2398
+ }), B = e.hasAttribute("aria-expanded");
2399
+ return Ke(), ce(), F(), P("onCreate", [l]), n.showOnCreate && ut(), g.addEventListener("mouseenter", function() {
2400
+ l.props.interactive && l.state.isVisible && l.clearDelayTimeouts();
2401
+ }), g.addEventListener("mouseleave", function() {
2402
+ l.props.interactive && l.props.trigger.indexOf("mouseenter") >= 0 && K().addEventListener("mousemove", y);
2403
+ }), l;
2404
+ function I() {
2405
+ var p = l.props.touch;
2406
+ return Array.isArray(p) ? p : [p, 0];
2407
+ }
2408
+ function M() {
2409
+ return I()[0] === "hold";
2410
+ }
2411
+ function N() {
2412
+ var p;
2413
+ return !!((p = l.props.render) != null && p.$$tippy);
2414
+ }
2415
+ function D() {
2416
+ return h || e;
2417
+ }
2418
+ function K() {
2419
+ var p = D().parentNode;
2420
+ return p ? Wa(p) : document;
2421
+ }
2422
+ function J() {
2423
+ return wn(g);
2424
+ }
2425
+ function V(p) {
2426
+ return l.state.isMounted && !l.state.isVisible || de.isTouch || u && u.type === "focus" ? 0 : on(l.props.delay, p ? 0 : 1, Y.delay);
2427
+ }
2428
+ function F(p) {
2429
+ p === void 0 && (p = !1), g.style.pointerEvents = l.props.interactive && !p ? "" : "none", g.style.zIndex = "" + l.props.zIndex;
2430
+ }
2431
+ function P(p, b, x) {
2432
+ if (x === void 0 && (x = !0), L.forEach(function(S) {
2433
+ S[p] && S[p].apply(S, b);
2434
+ }), x) {
2435
+ var R;
2436
+ (R = l.props)[p].apply(R, b);
2437
+ }
2438
+ }
2439
+ function se() {
2440
+ var p = l.props.aria;
2441
+ if (!!p.content) {
2442
+ var b = "aria-" + p.content, x = g.id, R = Qe(l.props.triggerTarget || e);
2443
+ R.forEach(function(S) {
2444
+ var $ = S.getAttribute(b);
2445
+ if (l.state.isVisible)
2446
+ S.setAttribute(b, $ ? $ + " " + x : x);
2447
+ else {
2448
+ var Q = $ && $.replace(x, "").trim();
2449
+ Q ? S.setAttribute(b, Q) : S.removeAttribute(b);
2450
+ }
2451
+ });
2452
+ }
2453
+ }
2454
+ function ce() {
2455
+ if (!(B || !l.props.aria.expanded)) {
2456
+ var p = Qe(l.props.triggerTarget || e);
2457
+ p.forEach(function(b) {
2458
+ l.props.interactive ? b.setAttribute("aria-expanded", l.state.isVisible && b === D() ? "true" : "false") : b.removeAttribute("aria-expanded");
2459
+ });
2460
+ }
2461
+ }
2462
+ function Re() {
2463
+ K().removeEventListener("mousemove", y), zt = zt.filter(function(p) {
2464
+ return p !== y;
2465
+ });
2466
+ }
2467
+ function le(p) {
2468
+ if (!(de.isTouch && (c || p.type === "mousedown"))) {
2469
+ var b = p.composedPath && p.composedPath()[0] || p.target;
2470
+ if (!(l.props.interactive && tr(g, b))) {
2471
+ if (Qe(l.props.triggerTarget || e).some(function(x) {
2472
+ return tr(x, b);
2473
+ })) {
2474
+ if (de.isTouch || l.state.isVisible && l.props.trigger.indexOf("click") >= 0)
2475
+ return;
2476
+ } else
2477
+ P("onClickOutside", [l, p]);
2478
+ l.props.hideOnClick === !0 && (l.clearDelayTimeouts(), l.hide(), a = !0, setTimeout(function() {
2479
+ a = !1;
2480
+ }), l.state.isMounted || me());
2481
+ }
2482
+ }
2483
+ }
2484
+ function Ne() {
2485
+ c = !0;
2486
+ }
2487
+ function he() {
2488
+ c = !1;
2489
+ }
2490
+ function re() {
2491
+ var p = K();
2492
+ p.addEventListener("mousedown", le, !0), p.addEventListener("touchend", le, Le), p.addEventListener("touchstart", he, Le), p.addEventListener("touchmove", Ne, Le);
2493
+ }
2494
+ function me() {
2495
+ var p = K();
2496
+ p.removeEventListener("mousedown", le, !0), p.removeEventListener("touchend", le, Le), p.removeEventListener("touchstart", he, Le), p.removeEventListener("touchmove", Ne, Le);
2497
+ }
2498
+ function Ue(p, b) {
2499
+ qe(p, function() {
2500
+ !l.state.isVisible && g.parentNode && g.parentNode.contains(g) && b();
2501
+ });
2502
+ }
2503
+ function ve(p, b) {
2504
+ qe(p, b);
2505
+ }
2506
+ function qe(p, b) {
2507
+ var x = J().box;
2508
+ function R(S) {
2509
+ S.target === x && (sn(x, "remove", R), b());
2510
+ }
2511
+ if (p === 0)
2512
+ return b();
2513
+ sn(x, "remove", f), sn(x, "add", R), f = R;
2514
+ }
2515
+ function Ee(p, b, x) {
2516
+ x === void 0 && (x = !1);
2517
+ var R = Qe(l.props.triggerTarget || e);
2518
+ R.forEach(function(S) {
2519
+ S.addEventListener(p, b, x), m.push({
2520
+ node: S,
2521
+ eventType: p,
2522
+ handler: b,
2523
+ options: x
2524
+ });
2525
+ });
2526
+ }
2527
+ function Ke() {
2528
+ M() && (Ee("touchstart", st, {
2529
+ passive: !0
2530
+ }), Ee("touchend", Mt, {
2531
+ passive: !0
2532
+ })), _a(l.props.trigger).forEach(function(p) {
2533
+ if (p !== "manual")
2534
+ switch (Ee(p, st), p) {
2535
+ case "mouseenter":
2536
+ Ee("mouseleave", Mt);
2537
+ break;
2538
+ case "focus":
2539
+ Ee(Ya ? "focusout" : "blur", ct);
2540
+ break;
2541
+ case "focusin":
2542
+ Ee("focusout", ct);
2543
+ break;
2544
+ }
2545
+ });
2546
+ }
2547
+ function St() {
2548
+ m.forEach(function(p) {
2549
+ var b = p.node, x = p.eventType, R = p.handler, S = p.options;
2550
+ b.removeEventListener(x, R, S);
2551
+ }), m = [];
2552
+ }
2553
+ function st(p) {
2554
+ var b, x = !1;
2555
+ if (!(!l.state.isEnabled || lt(p) || a)) {
2556
+ var R = ((b = u) == null ? void 0 : b.type) === "focus";
2557
+ u = p, h = p.currentTarget, ce(), !l.state.isVisible && Fa(p) && zt.forEach(function(S) {
2558
+ return S(p);
2559
+ }), p.type === "click" && (l.props.trigger.indexOf("mouseenter") < 0 || s) && l.props.hideOnClick !== !1 && l.state.isVisible ? x = !0 : ut(p), p.type === "click" && (s = !x), x && !R && Ie(p);
2560
+ }
2561
+ }
2562
+ function At(p) {
2563
+ var b = p.target, x = D().contains(b) || g.contains(b);
2564
+ if (!(p.type === "mousemove" && x)) {
2565
+ var R = ke().concat(g).map(function(S) {
2566
+ var $, Q = S._tippy, Je = ($ = Q.popperInstance) == null ? void 0 : $.state;
2567
+ return Je ? {
2568
+ popperRect: S.getBoundingClientRect(),
2569
+ popperState: Je,
2570
+ props: n
2571
+ } : null;
2572
+ }).filter(Boolean);
2573
+ Ua(R, p) && (Re(), Ie(p));
2574
+ }
2575
+ }
2576
+ function Mt(p) {
2577
+ var b = lt(p) || l.props.trigger.indexOf("click") >= 0 && s;
2578
+ if (!b) {
2579
+ if (l.props.interactive) {
2580
+ l.hideWithInteractivity(p);
2581
+ return;
2582
+ }
2583
+ Ie(p);
2584
+ }
2585
+ }
2586
+ function ct(p) {
2587
+ l.props.trigger.indexOf("focusin") < 0 && p.target !== D() || l.props.interactive && p.relatedTarget && g.contains(p.relatedTarget) || Ie(p);
2588
+ }
2589
+ function lt(p) {
2590
+ return de.isTouch ? M() !== p.type.indexOf("touch") >= 0 : !1;
2591
+ }
2592
+ function Rt() {
2593
+ Nt();
2594
+ var p = l.props, b = p.popperOptions, x = p.placement, R = p.offset, S = p.getReferenceClientRect, $ = p.moveTransition, Q = N() ? wn(g).arrow : null, Je = S ? {
2595
+ getBoundingClientRect: S,
2596
+ contextElement: S.contextElement || D()
2597
+ } : e, Hn = {
2598
+ name: "$$tippy",
2599
+ enabled: !0,
2600
+ phase: "beforeWrite",
2601
+ requires: ["computeStyles"],
2602
+ fn: function(Bt) {
2603
+ var Ge = Bt.state;
2604
+ if (N()) {
2605
+ var vo = J(), Qt = vo.box;
2606
+ ["placement", "reference-hidden", "escaped"].forEach(function(_t) {
2607
+ _t === "placement" ? Qt.setAttribute("data-placement", Ge.placement) : Ge.attributes.popper["data-popper-" + _t] ? Qt.setAttribute("data-" + _t, "") : Qt.removeAttribute("data-" + _t);
2608
+ }), Ge.attributes.popper = {};
2609
+ }
2610
+ }
2611
+ }, De = [{
2612
+ name: "offset",
2613
+ options: {
2614
+ offset: R
2615
+ }
2616
+ }, {
2617
+ name: "preventOverflow",
2618
+ options: {
2619
+ padding: {
2620
+ top: 2,
2621
+ bottom: 2,
2622
+ left: 5,
2623
+ right: 5
2624
+ }
2625
+ }
2626
+ }, {
2627
+ name: "flip",
2628
+ options: {
2629
+ padding: 5
2630
+ }
2631
+ }, {
2632
+ name: "computeStyles",
2633
+ options: {
2634
+ adaptive: !$
2635
+ }
2636
+ }, Hn];
2637
+ N() && Q && De.push({
2638
+ name: "arrow",
2639
+ options: {
2640
+ element: Q,
2641
+ padding: 3
2642
+ }
2643
+ }), De.push.apply(De, (b == null ? void 0 : b.modifiers) || []), l.popperInstance = Ia(Je, g, Object.assign({}, b, {
2644
+ placement: x,
2645
+ onFirstUpdate: v,
2646
+ modifiers: De
2647
+ }));
2648
+ }
2649
+ function Nt() {
2650
+ l.popperInstance && (l.popperInstance.destroy(), l.popperInstance = null);
2651
+ }
2652
+ function ge() {
2653
+ var p = l.props.appendTo, b, x = D();
2654
+ l.props.interactive && p === Wr || p === "parent" ? b = x.parentNode : b = Ur(p, [x]), b.contains(g) || b.appendChild(g), l.state.isMounted = !0, Rt(), process.env.NODE_ENV !== "production" && ye(l.props.interactive && p === Y.appendTo && x.nextElementSibling !== g, ["Interactive tippy element may not be accessible via keyboard", "navigation because it is not directly after the reference element", "in the DOM source order.", `
2655
+
2656
+ `, "Using a wrapper <div> or <span> tag around the reference element", "solves this by creating a new parentNode context.", `
2657
+
2658
+ `, "Specifying `appendTo: document.body` silences this warning, but it", "assumes you are using a focus management solution to handle", "keyboard navigation.", `
2659
+
2660
+ `, "See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "));
2661
+ }
2662
+ function ke() {
2663
+ return Jt(g.querySelectorAll("[data-tippy-root]"));
2664
+ }
2665
+ function ut(p) {
2666
+ l.clearDelayTimeouts(), p && P("onTrigger", [l, p]), re();
2667
+ var b = V(!0), x = I(), R = x[0], S = x[1];
2668
+ de.isTouch && R === "hold" && S && (b = S), b ? r = setTimeout(function() {
2669
+ l.show();
2670
+ }, b) : l.show();
2671
+ }
2672
+ function Ie(p) {
2673
+ if (l.clearDelayTimeouts(), P("onUntrigger", [l, p]), !l.state.isVisible) {
2674
+ me();
2675
+ return;
2676
+ }
2677
+ if (!(l.props.trigger.indexOf("mouseenter") >= 0 && l.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(p.type) >= 0 && s)) {
2678
+ var b = V(!1);
2679
+ b ? o = setTimeout(function() {
2680
+ l.state.isVisible && l.hide();
2681
+ }, b) : i = requestAnimationFrame(function() {
2682
+ l.hide();
2683
+ });
2684
+ }
2685
+ }
2686
+ function dt() {
2687
+ l.state.isEnabled = !0;
2688
+ }
2689
+ function It() {
2690
+ l.hide(), l.state.isEnabled = !1;
2691
+ }
2692
+ function Dt() {
2693
+ clearTimeout(r), clearTimeout(o), cancelAnimationFrame(i);
2694
+ }
2695
+ function Ht(p) {
2696
+ if (process.env.NODE_ENV !== "production" && ye(l.state.isDestroyed, Ye("setProps")), !l.state.isDestroyed) {
2697
+ P("onBeforeUpdate", [l, p]), St();
2698
+ var b = l.props, x = or(e, Object.assign({}, b, Qn(p), {
2699
+ ignoreAttributes: !0
2700
+ }));
2701
+ l.props = x, Ke(), b.interactiveDebounce !== x.interactiveDebounce && (Re(), y = Xn(At, x.interactiveDebounce)), b.triggerTarget && !x.triggerTarget ? Qe(b.triggerTarget).forEach(function(R) {
2702
+ R.removeAttribute("aria-expanded");
2703
+ }) : x.triggerTarget && e.removeAttribute("aria-expanded"), ce(), F(), O && O(b, x), l.popperInstance && (Rt(), ke().forEach(function(R) {
2704
+ requestAnimationFrame(R._tippy.popperInstance.forceUpdate);
2705
+ })), P("onAfterUpdate", [l, p]);
2706
+ }
2707
+ }
2708
+ function Lt(p) {
2709
+ l.setProps({
2710
+ content: p
2711
+ });
2712
+ }
2713
+ function uo() {
2714
+ process.env.NODE_ENV !== "production" && ye(l.state.isDestroyed, Ye("show"));
2715
+ var p = l.state.isVisible, b = l.state.isDestroyed, x = !l.state.isEnabled, R = de.isTouch && !l.props.touch, S = on(l.props.duration, 0, Y.duration);
2716
+ if (!(p || b || x || R) && !D().hasAttribute("disabled") && (P("onShow", [l], !1), l.props.onShow(l) !== !1)) {
2717
+ if (l.state.isVisible = !0, N() && (g.style.visibility = "visible"), F(), re(), l.state.isMounted || (g.style.transition = "none"), N()) {
2718
+ var $ = J(), Q = $.box, Je = $.content;
2719
+ an([Q, Je], 0);
2720
+ }
2721
+ v = function() {
2722
+ var De;
2723
+ if (!(!l.state.isVisible || d)) {
2724
+ if (d = !0, g.offsetHeight, g.style.transition = l.props.moveTransition, N() && l.props.animation) {
2725
+ var Zt = J(), Bt = Zt.box, Ge = Zt.content;
2726
+ an([Bt, Ge], S), er([Bt, Ge], "visible");
2727
+ }
2728
+ se(), ce(), Zn(cn, l), (De = l.popperInstance) == null || De.forceUpdate(), P("onMount", [l]), l.props.animation && N() && ve(S, function() {
2729
+ l.state.isShown = !0, P("onShown", [l]);
2730
+ });
2731
+ }
2732
+ }, ge();
2733
+ }
2734
+ }
2735
+ function fo() {
2736
+ process.env.NODE_ENV !== "production" && ye(l.state.isDestroyed, Ye("hide"));
2737
+ var p = !l.state.isVisible, b = l.state.isDestroyed, x = !l.state.isEnabled, R = on(l.props.duration, 1, Y.duration);
2738
+ if (!(p || b || x) && (P("onHide", [l], !1), l.props.onHide(l) !== !1)) {
2739
+ if (l.state.isVisible = !1, l.state.isShown = !1, d = !1, s = !1, N() && (g.style.visibility = "hidden"), Re(), me(), F(!0), N()) {
2740
+ var S = J(), $ = S.box, Q = S.content;
2741
+ l.props.animation && (an([$, Q], R), er([$, Q], "hidden"));
2742
+ }
2743
+ se(), ce(), l.props.animation ? N() && Ue(R, l.unmount) : l.unmount();
2744
+ }
2745
+ }
2746
+ function po(p) {
2747
+ process.env.NODE_ENV !== "production" && ye(l.state.isDestroyed, Ye("hideWithInteractivity")), K().addEventListener("mousemove", y), Zn(zt, y), y(p);
2748
+ }
2749
+ function ho() {
2750
+ process.env.NODE_ENV !== "production" && ye(l.state.isDestroyed, Ye("unmount")), l.state.isVisible && l.hide(), l.state.isMounted && (Nt(), ke().forEach(function(p) {
2751
+ p._tippy.unmount();
2752
+ }), g.parentNode && g.parentNode.removeChild(g), cn = cn.filter(function(p) {
2753
+ return p !== l;
2754
+ }), l.state.isMounted = !1, P("onHidden", [l]));
2755
+ }
2756
+ function mo() {
2757
+ process.env.NODE_ENV !== "production" && ye(l.state.isDestroyed, Ye("destroy")), !l.state.isDestroyed && (l.clearDelayTimeouts(), l.unmount(), St(), delete e._tippy, l.state.isDestroyed = !0, P("onDestroy", [l]));
2758
+ }
2759
+ }
2760
+ function at(e, t) {
2761
+ t === void 0 && (t = {});
2762
+ var n = Y.plugins.concat(t.plugins || []);
2763
+ process.env.NODE_ENV !== "production" && (Qa(e), Yr(t, n)), Ja();
2764
+ var r = Object.assign({}, t, {
2765
+ plugins: n
2766
+ }), o = ja(e);
2767
+ if (process.env.NODE_ENV !== "production") {
2768
+ var i = kt(r.content), s = o.length > 1;
2769
+ ye(i && s, ["tippy() was passed an Element as the `content` prop, but more than", "one tippy instance was created by this invocation. This means the", "content element will only be appended to the last tippy instance.", `
2770
+
2771
+ `, "Instead, pass the .innerHTML of the element, or use a function that", "returns a cloned version of the element instead.", `
2772
+
2773
+ `, `1) content: element.innerHTML
2774
+ `, "2) content: () => element.cloneNode(true)"].join(" "));
2775
+ }
2776
+ var a = o.reduce(function(c, d) {
2777
+ var u = d && as(d, r);
2778
+ return u && c.push(u), c;
2779
+ }, []);
2780
+ return kt(e) ? a[0] : a;
2781
+ }
2782
+ at.defaultProps = Y;
2783
+ at.setDefaultProps = ns;
2784
+ at.currentInput = de;
2785
+ Object.assign({}, Dr, {
2786
+ effect: function(t) {
2787
+ var n = t.state, r = {
2788
+ popper: {
2789
+ position: n.options.strategy,
2790
+ left: "0",
2791
+ top: "0",
2792
+ margin: "0"
2793
+ },
2794
+ arrow: {
2795
+ position: "absolute"
2796
+ },
2797
+ reference: {}
2798
+ };
2799
+ Object.assign(n.elements.popper.style, r.popper), n.styles = r, n.elements.arrow && Object.assign(n.elements.arrow.style, r.arrow);
2800
+ }
2801
+ });
2802
+ at.setDefaultProps({
2803
+ render: Xr
2804
+ });
2805
+ class ss {
2806
+ constructor({
2807
+ editor: t,
2808
+ element: n,
2809
+ view: r,
2810
+ tippyOptions: o = {},
2811
+ shouldShow: i
2812
+ }) {
2813
+ H(this, "editor");
2814
+ H(this, "element");
2815
+ H(this, "view");
2816
+ H(this, "preventHide", !1);
2817
+ H(this, "preventShow", !1);
2818
+ H(this, "tippy");
2819
+ H(this, "tippyOptions");
2820
+ H(this, "shouldShow", ({
2821
+ view: t,
2822
+ state: n,
2823
+ from: r,
2824
+ to: o
2825
+ }) => {
2826
+ const { doc: i, selection: s } = n, { empty: a } = s, c = !i.textBetween(r, o).length && ko(n.selection);
2827
+ return !(!t.hasFocus() || a || c);
2828
+ });
2829
+ H(this, "mousedownHandler", () => {
2830
+ this.preventHide = !0;
2831
+ });
2832
+ H(this, "viewMousedownHandler", () => {
2833
+ this.preventShow = !0;
2834
+ });
2835
+ H(this, "viewMouseupHandler", () => {
2836
+ this.preventShow = !1, setTimeout(() => this.update(this.editor.view));
2837
+ });
2838
+ H(this, "dragstartHandler", () => {
2839
+ this.hide();
2840
+ });
2841
+ H(this, "focusHandler", () => {
2842
+ setTimeout(() => this.update(this.editor.view));
2843
+ });
2844
+ H(this, "blurHandler", ({ event: t }) => {
2845
+ var n;
2846
+ if (this.preventHide) {
2847
+ this.preventHide = !1;
2848
+ return;
2849
+ }
2850
+ (t == null ? void 0 : t.relatedTarget) && ((n = this.element.parentNode) == null ? void 0 : n.contains(t.relatedTarget)) || this.hide();
2851
+ });
2852
+ this.editor = t, this.element = n, this.view = r, i && (this.shouldShow = i), this.element.addEventListener("mousedown", this.mousedownHandler, {
2853
+ capture: !0
2854
+ }), this.view.dom.addEventListener("mousedown", this.viewMousedownHandler), this.view.dom.addEventListener("mouseup", this.viewMouseupHandler), this.view.dom.addEventListener("dragstart", this.dragstartHandler), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.tippyOptions = o, this.element.remove(), this.element.style.visibility = "visible";
2855
+ }
2856
+ createTooltip() {
2857
+ const { element: t } = this.editor.options, n = !!t.parentElement;
2858
+ this.tippy || !n || (this.tippy = at(t, {
2859
+ duration: 0,
2860
+ getReferenceClientRect: null,
2861
+ content: this.element,
2862
+ interactive: !0,
2863
+ trigger: "manual",
2864
+ placement: "top",
2865
+ hideOnClick: "toggle",
2866
+ ...this.tippyOptions
2867
+ }), this.tippy.popper.firstChild && this.tippy.popper.firstChild.addEventListener(
2868
+ "blur",
2869
+ (r) => {
2870
+ this.blurHandler({ event: r });
2871
+ }
2872
+ ));
2873
+ }
2874
+ update(t, n) {
2875
+ var v, m;
2876
+ const { state: r, composing: o } = t, { doc: i, selection: s } = r, a = n && n.doc.eq(i) && n.selection.eq(s);
2877
+ if (o || a)
2878
+ return;
2879
+ this.createTooltip();
2880
+ const { ranges: c } = s, d = Math.min(...c.map((y) => y.$from.pos)), u = Math.max(...c.map((y) => y.$to.pos));
2881
+ if (!((v = this.shouldShow) == null ? void 0 : v.call(this, {
2882
+ editor: this.editor,
2883
+ view: t,
2884
+ state: r,
2885
+ oldState: n,
2886
+ from: d,
2887
+ to: u
2888
+ })) || this.preventShow) {
2889
+ this.hide();
2890
+ return;
2891
+ }
2892
+ (m = this.tippy) == null || m.setProps({
2893
+ getReferenceClientRect: () => {
2894
+ if (xo(r.selection)) {
2895
+ const y = t.nodeDOM(d);
2896
+ if (y)
2897
+ return y.getBoundingClientRect();
2898
+ }
2899
+ return To(t, d, u);
2900
+ }
2901
+ }), this.show();
2902
+ }
2903
+ show() {
2904
+ var t;
2905
+ (t = this.tippy) == null || t.show();
2906
+ }
2907
+ hide() {
2908
+ var t;
2909
+ (t = this.tippy) == null || t.hide();
2910
+ }
2911
+ destroy() {
2912
+ var t;
2913
+ (t = this.tippy) == null || t.destroy(), this.element.removeEventListener("mousedown", this.mousedownHandler, {
2914
+ capture: !0
2915
+ }), this.view.dom.removeEventListener("mousedown", this.viewMousedownHandler), this.view.dom.removeEventListener("mouseup", this.viewMouseupHandler), this.view.dom.removeEventListener("dragstart", this.dragstartHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler);
2916
+ }
2917
+ }
2918
+ const cs = (e) => new we({
2919
+ key: new be("BubbleMenuPlugin"),
2920
+ view: (t) => new ss({ view: t, ...e })
2921
+ });
2922
+ var Zr = {
2923
+ color: void 0,
2924
+ size: void 0,
2925
+ className: void 0,
2926
+ style: void 0,
2927
+ attr: void 0
2928
+ }, sr = A.createContext && A.createContext(Zr), Se = globalThis && globalThis.__assign || function() {
2929
+ return Se = Object.assign || function(e) {
2930
+ for (var t, n = 1, r = arguments.length; n < r; n++) {
2931
+ t = arguments[n];
2932
+ for (var o in t)
2933
+ Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
2934
+ }
2935
+ return e;
2936
+ }, Se.apply(this, arguments);
2937
+ }, ls = globalThis && globalThis.__rest || function(e, t) {
2938
+ var n = {};
2939
+ for (var r in e)
2940
+ Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
2941
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
2942
+ for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
2943
+ t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
2944
+ return n;
2945
+ };
2946
+ function Qr(e) {
2947
+ return e && e.map(function(t, n) {
2948
+ return A.createElement(t.tag, Se({
2949
+ key: n
2950
+ }, t.attr), Qr(t.child));
2951
+ });
2952
+ }
2953
+ function z(e) {
2954
+ return function(t) {
2955
+ return A.createElement(us, Se({
2956
+ attr: Se({}, e.attr)
2957
+ }, t), Qr(e.child));
2958
+ };
2959
+ }
2960
+ function us(e) {
2961
+ var t = function(n) {
2962
+ var r = e.attr, o = e.size, i = e.title, s = ls(e, ["attr", "size", "title"]), a = o || n.size || "1em", c;
2963
+ return n.className && (c = n.className), e.className && (c = (c ? c + " " : "") + e.className), A.createElement("svg", Se({
2964
+ stroke: "currentColor",
2965
+ fill: "currentColor",
2966
+ strokeWidth: "0"
2967
+ }, n.attr, r, s, {
2968
+ className: c,
2969
+ style: Se(Se({
2970
+ color: e.color || n.color
2971
+ }, n.style), e.style),
2972
+ height: a,
2973
+ width: a,
2974
+ xmlns: "http://www.w3.org/2000/svg"
2975
+ }), i && A.createElement("title", null, i), e.children);
2976
+ };
2977
+ return sr !== void 0 ? A.createElement(sr.Consumer, null, function(n) {
2978
+ return t(n);
2979
+ }) : t(Zr);
2980
+ }
2981
+ function ds(e) {
2982
+ return z({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M8 11h4.5a2.5 2.5 0 1 0 0-5H8v5zm10 4.5a4.5 4.5 0 0 1-4.5 4.5H6V4h6.5a4.5 4.5 0 0 1 3.256 7.606A4.498 4.498 0 0 1 18 15.5zM8 13v5h5.5a2.5 2.5 0 1 0 0-5H8z" } }] }] })(e);
2983
+ }
2984
+ function eo(e) {
2985
+ return z({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { fill: "none", d: "M0 0H24V24H0z" } }, { tag: "path", attr: { d: "M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm8-12v12h-2v-9.796l-2 .536V8.67L19.5 8H21z" } }] }] })(e);
2986
+ }
2987
+ function to(e) {
2988
+ return z({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { fill: "none", d: "M0 0H24V24H0z" } }, { tag: "path", attr: { d: "M4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 4c2.071 0 3.75 1.679 3.75 3.75 0 .857-.288 1.648-.772 2.28l-.148.18L18.034 18H22v2h-7v-1.556l4.82-5.546c.268-.307.43-.709.43-1.148 0-.966-.784-1.75-1.75-1.75-.918 0-1.671.707-1.744 1.606l-.006.144h-2C14.75 9.679 16.429 8 18.5 8z" } }] }] })(e);
2989
+ }
2990
+ function no(e) {
2991
+ return z({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { fill: "none", d: "M0 0H24V24H0z" } }, { tag: "path", attr: { d: "M22 8l-.002 2-2.505 2.883c1.59.435 2.757 1.89 2.757 3.617 0 2.071-1.679 3.75-3.75 3.75-1.826 0-3.347-1.305-3.682-3.033l1.964-.382c.156.806.866 1.415 1.718 1.415.966 0 1.75-.784 1.75-1.75s-.784-1.75-1.75-1.75c-.286 0-.556.069-.794.19l-1.307-1.547L19.35 10H15V8h7zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z" } }] }] })(e);
2992
+ }
2993
+ function fs(e) {
2994
+ return z({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-8 3.5L7 9v7l-4-3.5z" } }] }] })(e);
2995
+ }
2996
+ function ps(e) {
2997
+ return z({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-4 3.5L3 16V9l4 3.5z" } }] }] })(e);
2998
+ }
2999
+ function hs(e) {
3000
+ return z({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M15 20H7v-2h2.927l2.116-12H9V4h8v2h-2.927l-2.116 12H15z" } }] }] })(e);
3001
+ }
3002
+ function ms(e) {
3003
+ return z({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M17 17h5v2h-3v3h-2v-5zM7 7H2V5h3V2h2v5zm11.364 8.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z" } }] }] })(e);
3004
+ }
3005
+ function ro(e) {
3006
+ return z({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M18.364 15.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z" } }] }] })(e);
3007
+ }
3008
+ function oo(e) {
3009
+ return z({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M8 4h13v2H8V4zM5 3v3h1v1H3V6h1V4H3V3h2zM3 14v-2.5h2V11H3v-1h3v2.5H4v.5h2v1H3zm2 5.5H3v-1h2V18H3v-1h3v4H3v-1h2v-.5zM8 11h13v2H8v-2zm0 7h13v2H8v-2z" } }] }] })(e);
3010
+ }
3011
+ function io(e) {
3012
+ return z({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M8 4h13v2H8V4zM4.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 6.9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z" } }] }] })(e);
3013
+ }
3014
+ function vs(e) {
3015
+ return z({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M17.154 14c.23.516.346 1.09.346 1.72 0 1.342-.524 2.392-1.571 3.147C14.88 19.622 13.433 20 11.586 20c-1.64 0-3.263-.381-4.87-1.144V16.6c1.52.877 3.075 1.316 4.666 1.316 2.551 0 3.83-.732 3.839-2.197a2.21 2.21 0 0 0-.648-1.603l-.12-.117H3v-2h18v2h-3.846zm-4.078-3H7.629a4.086 4.086 0 0 1-.481-.522C6.716 9.92 6.5 9.246 6.5 8.452c0-1.236.466-2.287 1.397-3.153C8.83 4.433 10.271 4 12.222 4c1.471 0 2.879.328 4.222.984v2.152c-1.2-.687-2.515-1.03-3.946-1.03-2.48 0-3.719.782-3.719 2.346 0 .42.218.786.654 1.099.436.313.974.562 1.613.75.62.18 1.297.414 2.03.699z" } }] }] })(e);
3016
+ }
3017
+ function Nn(e) {
3018
+ return z({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M13 6v15h-2V6H5V4h14v2z" } }] }] })(e);
3019
+ }
3020
+ function gs(e) {
3021
+ return z({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M8 3v9a4 4 0 1 0 8 0V3h2v9a6 6 0 1 1-12 0V3h2zM4 20h16v2H4v-2z" } }] }] })(e);
3022
+ }
3023
+ function ys(e) {
3024
+ return z({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm11-3v9l-3.794-3.793-5.999 6-1.414-1.414 5.999-6L12 3h9z" } }] }] })(e);
3025
+ }
3026
+ const bs = "_icon_1sxr9_1", ws = "_isSelected_1sxr9_7", Es = "_isDisabled_1sxr9_11", ln = {
3027
+ icon: bs,
3028
+ isSelected: ws,
3029
+ isDisabled: Es
3030
+ }, ks = "_tooltip_mmzq3_1", xs = "_secondaryText_mmzq3_12", cr = {
3031
+ tooltip: ks,
3032
+ secondaryText: xs
3033
+ }, En = (e) => /* @__PURE__ */ React.createElement("div", {
3034
+ className: cr.tooltip
3035
+ }, /* @__PURE__ */ React.createElement("div", null, e.mainTooltip), e.secondaryTooltip && /* @__PURE__ */ React.createElement("div", {
3036
+ className: cr.secondaryText
3037
+ }, e.secondaryTooltip)), fe = zo(
3038
+ (e, t) => {
3039
+ const n = e.icon;
3040
+ return /* @__PURE__ */ A.createElement($e, {
3041
+ content: /* @__PURE__ */ A.createElement(En, {
3042
+ mainTooltip: e.mainTooltip,
3043
+ secondaryTooltip: e.secondaryTooltip
3044
+ })
3045
+ }, /* @__PURE__ */ A.createElement(br, {
3046
+ ref: t,
3047
+ appearance: "subtle",
3048
+ onClick: e.onClick,
3049
+ isSelected: e.isSelected || !1,
3050
+ isDisabled: e.isDisabled || !1,
3051
+ iconBefore: n && /* @__PURE__ */ A.createElement(n, {
3052
+ className: ln.icon + " " + (e.isSelected ? ln.isSelected : "") + " " + (e.isDisabled ? ln.isDisabled : "")
3053
+ })
3054
+ }, e.children));
3055
+ }
3056
+ ), Ts = "_toolbar_1rs9g_1", Cs = {
3057
+ toolbar: Ts
3058
+ }, ao = (e) => /* @__PURE__ */ React.createElement("div", {
3059
+ className: Cs.toolbar
3060
+ }, e.children);
3061
+ function Os() {
3062
+ const [, e] = Fe(0);
3063
+ return () => e((t) => t + 1);
3064
+ }
3065
+ const Ss = (e) => {
3066
+ const t = Os();
3067
+ Vo(() => {
3068
+ const n = () => {
3069
+ requestAnimationFrame(() => {
3070
+ requestAnimationFrame(() => {
3071
+ t();
3072
+ });
3073
+ });
3074
+ };
3075
+ return e.on("transaction", n), () => {
3076
+ e.off("transaction", n);
3077
+ };
3078
+ }, [e]);
3079
+ }, j = {
3080
+ mac: !1,
3081
+ ie: !1,
3082
+ ie_version: 0,
3083
+ gecko: !1,
3084
+ chrome: !1,
3085
+ chrome_version: 0,
3086
+ android: !1,
3087
+ ios: !1,
3088
+ webkit: !1
3089
+ };
3090
+ if (typeof navigator < "u") {
3091
+ const e = /Edge\/(\d+)/.exec(navigator.userAgent), t = /MSIE \d/.test(navigator.userAgent), n = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(
3092
+ navigator.userAgent
3093
+ );
3094
+ j.mac = /Mac/.test(navigator.platform);
3095
+ let r = j.ie = !!(t || n || e);
3096
+ j.ie_version = t ? document.documentMode || 6 : n ? +n[1] : e ? +e[1] : null, j.gecko = !r && /gecko\/\d/i.test(navigator.userAgent), j.chrome = !r && /Chrome\//.test(navigator.userAgent), j.chrome_version = parseInt(
3097
+ (navigator.userAgent.match(/Chrome\/(\d{2})/) || [])[1],
3098
+ 10
3099
+ ), j.android = /Android \d/.test(navigator.userAgent), j.ios = !r && /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent), j.webkit = !r && !!document.documentElement && "WebkitAppearance" in document.documentElement.style;
3100
+ }
3101
+ function G(e) {
3102
+ return j.ios || j.mac ? e.replace("Mod", "\u2318") : e.replace("Mod", "Ctrl");
3103
+ }
3104
+ var As = "#EBECF0", Ms = "#97A0AF", Rs = "#505F79", Ns = "#172B4D";
3105
+ const Is = it.input`
3106
+ input& {
3107
+ autofocus: true;
3108
+ background: transparent;
3109
+ border: 0;
3110
+ border-radius: 0;
3111
+ box-sizing: content-box;
3112
+ color: ${Rs};
3113
+ flex-grow: 1;
3114
+ font-size: 13px;
3115
+ line-height: 20px;
3116
+ padding: 0;
3117
+ ${(e) => e.width ? `width: ${e.width}px` : ""};
3118
+ min-width: 145px;
3119
+
3120
+ /* Hides IE10+ built-in [x] clear input button */
3121
+ &::-ms-clear {
3122
+ display: none;
3123
+ }
3124
+
3125
+ &:focus {
3126
+ outline: none;
3127
+ }
3128
+
3129
+ &::placeholder {
3130
+ color: ${Ns};
3131
+ opacity: 0.5;
3132
+ }
3133
+ }
3134
+ `, un = 90, Ds = 89;
3135
+ class lr extends Fo {
3136
+ constructor(n) {
3137
+ super(n);
3138
+ H(this, "input");
3139
+ H(this, "focusTimeoutId");
3140
+ H(this, "onMouseDown", () => {
3141
+ const { onMouseDown: n } = this.props;
3142
+ n && n();
3143
+ });
3144
+ H(this, "onBlur", (n) => {
3145
+ const { onBlur: r } = this.props;
3146
+ r && r(n);
3147
+ });
3148
+ H(this, "handleChange", () => {
3149
+ const { onChange: n } = this.props;
3150
+ this.input && this.setState({
3151
+ value: this.input.value
3152
+ }), n && this.input && n(this.input.value);
3153
+ });
3154
+ H(this, "handleKeydown", (n) => {
3155
+ const { onUndo: r, onRedo: o, onSubmit: i, onCancel: s } = this.props;
3156
+ n.keyCode === 13 && i ? (n.preventDefault(), i(this.input.value)) : n.keyCode === 27 && s ? s(n) : typeof r == "function" && this.isUndoEvent(n) ? (n.preventDefault(), r()) : typeof o == "function" && this.isRedoEvent(n) && (n.preventDefault(), o()), this.props.onKeyDown && this.props.onKeyDown(n);
3157
+ });
3158
+ H(this, "handleRef", (n) => {
3159
+ n instanceof HTMLInputElement ? (this.input = n, this.props.autoFocus && (this.focusTimeoutId = window.setTimeout(() => this.focus()))) : this.input = void 0;
3160
+ });
3161
+ this.state = {
3162
+ value: n.defaultValue || ""
3163
+ };
3164
+ }
3165
+ UNSAFE_componentWillReceiveProps(n) {
3166
+ n.defaultValue !== this.props.defaultValue && this.setState({
3167
+ value: n.defaultValue
3168
+ });
3169
+ }
3170
+ componentWillUnmount() {
3171
+ window.clearTimeout(this.focusTimeoutId);
3172
+ }
3173
+ render() {
3174
+ const { placeholder: n, width: r, maxLength: o, testId: i, ariaLabel: s } = this.props, { value: a } = this.state;
3175
+ return /* @__PURE__ */ React.createElement(Is, {
3176
+ "data-testid": i || "",
3177
+ type: "text",
3178
+ placeholder: n,
3179
+ value: a,
3180
+ onChange: this.handleChange,
3181
+ onKeyDown: this.handleKeydown,
3182
+ onMouseDown: this.onMouseDown,
3183
+ onBlur: this.onBlur,
3184
+ ref: this.handleRef,
3185
+ width: r,
3186
+ maxLength: o,
3187
+ "aria-label": s,
3188
+ id: this.props.id,
3189
+ style: { fontSize: "0.8rem" }
3190
+ });
3191
+ }
3192
+ focus() {
3193
+ const { input: n } = this;
3194
+ if (n) {
3195
+ const r = typeof this.props.autoFocus == "object" ? this.props.autoFocus : {};
3196
+ n.focus(r);
3197
+ }
3198
+ }
3199
+ isUndoEvent(n) {
3200
+ return n.keyCode === un && (j.mac && n.metaKey && !n.shiftKey || !j.mac && n.ctrlKey);
3201
+ }
3202
+ isRedoEvent(n) {
3203
+ return !j.mac && n.ctrlKey && n.keyCode === Ds || j.mac && n.metaKey && n.shiftKey && n.keyCode === un || n.ctrlKey && n.shiftKey && n.keyCode === un;
3204
+ }
3205
+ }
3206
+ const ur = 420, Hs = 360, so = `
3207
+ display: flex;
3208
+ line-height: 0;
3209
+ padding: 4px 0;
3210
+ align-items: center;
3211
+ `, Ls = it.div`
3212
+ ${so}
3213
+ border-bottom: none !important;
3214
+ `, Bs = it.div`
3215
+ width: ${ur}px;
3216
+ display: flex;
3217
+ flex-direction: column;
3218
+ overflow: auto;
3219
+ padding: 0;
3220
+
3221
+ ${({ provider: e }) => jo`
3222
+ width: ${e ? ur : Hs}px;
3223
+ `};
3224
+ line-height: initial;
3225
+ `, _s = it.div`
3226
+ ${so};
3227
+ border-top: 1px solid ${As};
3228
+ `, dr = it.span`
3229
+ color: ${Ms};
3230
+ padding: 3px 6px;
3231
+ width: 32px;
3232
+ `, Ps = it.div`
3233
+ background-color: white;
3234
+ border-radius: 3px;
3235
+ box-shadow: rgb(9 30 66 / 31%) 0px 0px 1px,
3236
+ rgb(9 30 66 / 25%) 0px 4px 8px -2px;
3237
+ padding: 3px 6px;
3238
+ display: flex;
3239
+ line-height: 1;
3240
+ box-sizing: border-box;
3241
+ `, co = (e) => {
3242
+ const [t, n] = Fe(e.url), [r, o] = Fe(e.text);
3243
+ return /* @__PURE__ */ React.createElement(Ps, null, /* @__PURE__ */ React.createElement(Bs, {
3244
+ provider: !1
3245
+ }, /* @__PURE__ */ React.createElement(Ls, null, /* @__PURE__ */ React.createElement(dr, null, /* @__PURE__ */ React.createElement($e, {
3246
+ content: /* @__PURE__ */ React.createElement(En, {
3247
+ mainTooltip: "Edit URL"
3248
+ }),
3249
+ placement: "left"
3250
+ }, /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(ro, {
3251
+ size: 20
3252
+ })))), /* @__PURE__ */ React.createElement(lr, {
3253
+ defaultValue: t,
3254
+ autoFocus: !0,
3255
+ onSubmit: (i) => {
3256
+ e.onSubmit(i, r);
3257
+ },
3258
+ onChange: (i) => {
3259
+ n(i);
3260
+ }
3261
+ })), /* @__PURE__ */ React.createElement(_s, null, /* @__PURE__ */ React.createElement(dr, null, /* @__PURE__ */ React.createElement($e, {
3262
+ content: /* @__PURE__ */ React.createElement(En, {
3263
+ mainTooltip: "Edit title"
3264
+ }),
3265
+ placement: "left"
3266
+ }, /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(Nn, {
3267
+ size: 20
3268
+ })))), /* @__PURE__ */ React.createElement(lr, {
3269
+ defaultValue: r,
3270
+ onSubmit: (i) => {
3271
+ e.onSubmit(t, i);
3272
+ },
3273
+ onChange: (i) => {
3274
+ o(i);
3275
+ }
3276
+ }))));
3277
+ }, zs = (e) => {
3278
+ const [t, n] = Fe(), r = $o(() => {
3279
+ const o = (d, u) => {
3280
+ if (d === "")
3281
+ return;
3282
+ const f = e.editor.schema.mark("link", { href: d });
3283
+ let { from: v, to: m } = e.editor.state.selection;
3284
+ e.editor.view.dispatch(
3285
+ e.editor.view.state.tr.insertText(u, v, m).addMark(v, v + u.length, f)
3286
+ );
3287
+ }, { from: i, to: s } = e.editor.state.selection, a = e.editor.state.doc.textBetween(i, s), c = e.editor.isActive("link") && e.editor.getAttributes("link").href || "";
3288
+ n(
3289
+ /* @__PURE__ */ React.createElement(co, {
3290
+ key: Math.random() + "",
3291
+ url: c,
3292
+ text: a,
3293
+ onSubmit: o
3294
+ })
3295
+ );
3296
+ }, [e.editor]);
3297
+ return /* @__PURE__ */ React.createElement($e, {
3298
+ content: t,
3299
+ trigger: "click",
3300
+ onShow: (o) => {
3301
+ r();
3302
+ },
3303
+ interactive: !0,
3304
+ maxWidth: 500
3305
+ }, /* @__PURE__ */ React.createElement(fe, {
3306
+ ...e
3307
+ }));
3308
+ };
3309
+ function Vs(e) {
3310
+ return z({ tag: "svg", attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M16.972 6.251c-.967-.538-2.185-.188-2.72.777l-3.713 6.682-2.125-2.125c-.781-.781-2.047-.781-2.828 0-.781.781-.781 2.047 0 2.828l4 4c.378.379.888.587 1.414.587l.277-.02c.621-.087 1.166-.46 1.471-1.009l5-9c.537-.966.189-2.183-.776-2.72z" } }] })(e);
3311
+ }
3312
+ const Fs = "_item_container_1fy3g_1", $s = "_logo_and_item_container_1fy3g_8", fr = {
3313
+ item_container: Fs,
3314
+ logo_and_item_container: $s
3315
+ };
3316
+ function Xe(e) {
3317
+ const t = e.icon;
3318
+ return /* @__PURE__ */ React.createElement(Uo, {
3319
+ onClick: e.onClick
3320
+ }, /* @__PURE__ */ React.createElement("div", {
3321
+ className: `${fr.item_container}`
3322
+ }, /* @__PURE__ */ React.createElement("div", {
3323
+ className: `${fr.logo_and_item_container}`
3324
+ }, /* @__PURE__ */ React.createElement(t, null), e.title), e.isSelected && /* @__PURE__ */ React.createElement(Vs, null)));
3325
+ }
3326
+ function js(e, t) {
3327
+ const n = ["Heading 1", "Heading 2", "Heading 3"], r = {
3328
+ li: "Bullet List",
3329
+ oli: "Numbered List"
3330
+ };
3331
+ return e ? n[e - 1] : t ? r[t] : "Text";
3332
+ }
3333
+ const Ws = (e) => {
3334
+ Ss(e.editor);
3335
+ const t = je(e.editor.state.selection), n = t == null ? void 0 : t.node.attrs.headingType, r = t == null ? void 0 : t.node.attrs.listType, o = js(
3336
+ n,
3337
+ r
3338
+ );
3339
+ return /* @__PURE__ */ React.createElement(ao, null, /* @__PURE__ */ React.createElement(Wo, {
3340
+ trigger: o
3341
+ }, /* @__PURE__ */ React.createElement(qo, null, /* @__PURE__ */ React.createElement(Xe, {
3342
+ title: "Text",
3343
+ icon: Nn,
3344
+ isSelected: o === "Paragraph",
3345
+ onClick: () => e.editor.chain().focus().unsetBlockHeading().unsetList().run()
3346
+ }), /* @__PURE__ */ React.createElement(Xe, {
3347
+ title: "Heading 1",
3348
+ icon: eo,
3349
+ isSelected: o === "Heading 1",
3350
+ onClick: () => e.editor.chain().focus().unsetList().setBlockHeading({ level: 1 }).run()
3351
+ }), /* @__PURE__ */ React.createElement(Xe, {
3352
+ title: "Heading 2",
3353
+ icon: to,
3354
+ isSelected: o === "Heading 2",
3355
+ onClick: () => e.editor.chain().focus().unsetList().setBlockHeading({ level: 2 }).run()
3356
+ }), /* @__PURE__ */ React.createElement(Xe, {
3357
+ title: "Heading 3",
3358
+ icon: no,
3359
+ isSelected: o === "Heading 3",
3360
+ onClick: () => e.editor.chain().focus().unsetList().setBlockHeading({ level: 3 }).run()
3361
+ }), /* @__PURE__ */ React.createElement(Xe, {
3362
+ title: "Bullet List",
3363
+ icon: io,
3364
+ isSelected: o === "Bullet List",
3365
+ onClick: () => e.editor.chain().focus().unsetBlockHeading().setBlockList("li").run()
3366
+ }), /* @__PURE__ */ React.createElement(Xe, {
3367
+ title: "Numbered List",
3368
+ icon: oo,
3369
+ isSelected: o === "Numbered List",
3370
+ onClick: () => e.editor.chain().focus().unsetBlockHeading().setBlockList("oli").run()
3371
+ }))), /* @__PURE__ */ React.createElement(fe, {
3372
+ onClick: () => e.editor.chain().focus().toggleBold().run(),
3373
+ isSelected: e.editor.isActive("bold"),
3374
+ mainTooltip: "Bold",
3375
+ secondaryTooltip: G("Mod+B"),
3376
+ icon: ds
3377
+ }), /* @__PURE__ */ React.createElement(fe, {
3378
+ onClick: () => e.editor.chain().focus().toggleItalic().run(),
3379
+ isSelected: e.editor.isActive("italic"),
3380
+ mainTooltip: "Italic",
3381
+ secondaryTooltip: G("Mod+I"),
3382
+ icon: hs
3383
+ }), /* @__PURE__ */ React.createElement(fe, {
3384
+ onClick: () => e.editor.chain().focus().toggleUnderline().run(),
3385
+ isSelected: e.editor.isActive("underline"),
3386
+ mainTooltip: "Underline",
3387
+ secondaryTooltip: G("Mod+U"),
3388
+ icon: gs
3389
+ }), /* @__PURE__ */ React.createElement(fe, {
3390
+ onClick: () => e.editor.chain().focus().toggleStrike().run(),
3391
+ isDisabled: e.editor.isActive("strike"),
3392
+ mainTooltip: "Strike-through",
3393
+ secondaryTooltip: G("Mod+Shift+X"),
3394
+ icon: vs
3395
+ }), /* @__PURE__ */ React.createElement(fe, {
3396
+ onClick: () => e.editor.chain().focus().sinkListItem("tcblock").run(),
3397
+ isDisabled: !e.editor.can().sinkListItem("tcblock"),
3398
+ mainTooltip: "Indent",
3399
+ secondaryTooltip: G("Tab"),
3400
+ icon: ps
3401
+ }), /* @__PURE__ */ React.createElement(fe, {
3402
+ onClick: () => e.editor.chain().focus().liftListItem("tcblock").run(),
3403
+ isDisabled: !e.editor.can().command(({ state: i }) => {
3404
+ const s = je(i.selection);
3405
+ return s ? s.depth > 2 : !1;
3406
+ }),
3407
+ mainTooltip: "Decrease Indent",
3408
+ secondaryTooltip: G("Shift+Tab"),
3409
+ icon: fs
3410
+ }), /* @__PURE__ */ React.createElement(zs, {
3411
+ isSelected: e.editor.isActive("link"),
3412
+ mainTooltip: "Link",
3413
+ secondaryTooltip: G("Mod+K"),
3414
+ icon: ro,
3415
+ editor: e.editor
3416
+ }));
3417
+ }, Us = "_bnRoot_15721_7", Xt = {
3418
+ bnRoot: Us
3419
+ }, qs = ot.create({
3420
+ name: "BubbleMenuExtension",
3421
+ addProseMirrorPlugins() {
3422
+ const e = document.createElement("div");
3423
+ return e.className = Xt.bnRoot, Te.render(/* @__PURE__ */ React.createElement(Ws, {
3424
+ editor: this.editor
3425
+ }), e), [
3426
+ cs({
3427
+ editor: this.editor,
3428
+ element: e,
3429
+ pluginKey: new be("BubbleMenuPlugin"),
3430
+ tippyOptions: {
3431
+ appendTo: document.body
3432
+ }
3433
+ })
3434
+ ];
3435
+ }
3436
+ });
3437
+ function Ks(e) {
3438
+ return z({ tag: "svg", attr: { t: "1551322312294", style: "", viewBox: "0 0 1024 1024", version: "1.1" }, child: [{ tag: "defs", attr: {}, child: [] }, { tag: "path", attr: { d: "M474 152m8 0l60 0q8 0 8 8l0 704q0 8-8 8l-60 0q-8 0-8-8l0-704q0-8 8-8Z" } }, { tag: "path", attr: { d: "M168 474m8 0l672 0q8 0 8 8l0 60q0 8-8 8l-672 0q-8 0-8-8l0-60q0-8 8-8Z" } }] })(e);
3439
+ }
3440
+ const Js = "_menuList_drels_1", Gs = {
3441
+ menuList: Js
3442
+ }, Ys = "_suggestionWrapper_hy0qj_1", Xs = "_buttonName_hy0qj_9", Zs = "_buttonHint_hy0qj_13", Qs = "_buttonShortcut_hy0qj_17", ec = "_iconWrapper_hy0qj_25", tc = "_icon_hy0qj_25", nc = "_selectedIcon_hy0qj_42", Ce = {
3443
+ suggestionWrapper: Ys,
3444
+ buttonName: Xs,
3445
+ buttonHint: Zs,
3446
+ buttonShortcut: Qs,
3447
+ iconWrapper: ec,
3448
+ icon: tc,
3449
+ selectedIcon: nc
3450
+ }, rc = 5;
3451
+ function oc(e) {
3452
+ return /* @__PURE__ */ A.createElement("div", {
3453
+ className: Ce.suggestionWrapper
3454
+ }, /* @__PURE__ */ A.createElement("div", null, /* @__PURE__ */ A.createElement("div", {
3455
+ className: Ce.buttonName
3456
+ }, e.item.name), e.item.hint && /* @__PURE__ */ A.createElement("div", {
3457
+ className: Ce.buttonHint
3458
+ }, e.item.hint)), e.item.shortcut && /* @__PURE__ */ A.createElement("div", null, /* @__PURE__ */ A.createElement("div", {
3459
+ className: Ce.buttonShortcut
3460
+ }, e.item.shortcut)));
3461
+ }
3462
+ function ic(e, t) {
3463
+ const n = e.icon;
3464
+ return n && /* @__PURE__ */ A.createElement("div", {
3465
+ className: Ce.iconWrapper
3466
+ }, /* @__PURE__ */ A.createElement(n, {
3467
+ className: Ce.icon + " " + (t ? Ce.selectedIcon : "")
3468
+ }));
3469
+ }
3470
+ function ac(e) {
3471
+ let t = e.selectedIndex !== void 0 && e.selectedIndex === e.index;
3472
+ const n = A.useRef(null);
3473
+ return A.useEffect(() => {
3474
+ t && n.current && n.current.getBoundingClientRect().left > rc && n.current.scrollIntoView({
3475
+ behavior: "smooth",
3476
+ block: "nearest"
3477
+ });
3478
+ }, [t]), /* @__PURE__ */ A.createElement("div", {
3479
+ className: Ce.buttonItem
3480
+ }, /* @__PURE__ */ A.createElement(Er, {
3481
+ isSelected: t,
3482
+ iconBefore: ic(e.item, t),
3483
+ onClick: (r) => {
3484
+ setTimeout(() => {
3485
+ e.clickItem(e.item);
3486
+ }, 0);
3487
+ },
3488
+ ref: n
3489
+ }, /* @__PURE__ */ A.createElement(oc, {
3490
+ item: e.item
3491
+ })));
3492
+ }
3493
+ function sc(e) {
3494
+ return /* @__PURE__ */ A.createElement(wr, {
3495
+ title: e.name
3496
+ }, e.items.map((t, n) => /* @__PURE__ */ A.createElement(ac, {
3497
+ item: t,
3498
+ key: n,
3499
+ index: n,
3500
+ selectedIndex: e.selectedIndex,
3501
+ clickItem: e.clickItem
3502
+ })));
3503
+ }
3504
+ function cc(e) {
3505
+ const t = [];
3506
+ let n = 0;
3507
+ for (const r in e.groups) {
3508
+ const o = e.groups[r];
3509
+ t.push(
3510
+ /* @__PURE__ */ React.createElement(sc, {
3511
+ key: r,
3512
+ name: r,
3513
+ items: o,
3514
+ selectedIndex: e.selectedIndex >= n ? e.selectedIndex - n : void 0,
3515
+ clickItem: e.onSelectItem
3516
+ })
3517
+ ), n += o.length;
3518
+ }
3519
+ return /* @__PURE__ */ React.createElement("div", {
3520
+ className: Gs.menuList + " " + Xt.bnRoot
3521
+ }, /* @__PURE__ */ React.createElement(kr, null, t.length > 0 ? t : /* @__PURE__ */ React.createElement(wr, {
3522
+ title: "No match found"
3523
+ }, " ")));
3524
+ }
3525
+ function lc(e) {
3526
+ let t, n, r = !0, o = 0, i;
3527
+ const s = (a) => {
3528
+ if (!i)
3529
+ throw new Error("props not set");
3530
+ let c = 0;
3531
+ for (const d in i.groups) {
3532
+ const u = i.groups[d], f = u.length;
3533
+ if (a < c + f)
3534
+ return u[a - c];
3535
+ c += f;
3536
+ }
3537
+ throw Error("item not found");
3538
+ };
3539
+ return {
3540
+ getComponent: () => {
3541
+ if (!(!n || !n[0]))
3542
+ return n[0].reference;
3543
+ },
3544
+ onStart: (a) => {
3545
+ i = a, r = !1, o = 0;
3546
+ const c = {
3547
+ groups: a.groups,
3548
+ count: a.count,
3549
+ onSelectItem: a.onSelectItem,
3550
+ selectedIndex: o
3551
+ };
3552
+ t = new Jo(cc, {
3553
+ editor: e,
3554
+ props: c
3555
+ }), n = at("body", {
3556
+ getReferenceClientRect: a.clientRect,
3557
+ appendTo: () => document.body,
3558
+ content: t.element,
3559
+ showOnCreate: !0,
3560
+ interactive: !0,
3561
+ trigger: "manual",
3562
+ placement: "bottom-start"
3563
+ });
3564
+ },
3565
+ onUpdate: (a) => {
3566
+ i = a, i.groups !== t.props.groups && (o = 0);
3567
+ const c = {
3568
+ groups: i.groups,
3569
+ count: i.count,
3570
+ onSelectItem: i.onSelectItem,
3571
+ selectedIndex: o
3572
+ };
3573
+ t.updateProps(c), n[0].setProps({
3574
+ getReferenceClientRect: i.clientRect
3575
+ });
3576
+ },
3577
+ onKeyDown: (a) => {
3578
+ if (!i)
3579
+ return !1;
3580
+ if (a.key === "ArrowUp")
3581
+ return o = (o + i.count - 1) % i.count, t.updateProps({
3582
+ selectedIndex: o
3583
+ }), !0;
3584
+ if (a.key === "ArrowDown")
3585
+ return o = (o + 1) % i.count, t.updateProps({
3586
+ selectedIndex: o
3587
+ }), !0;
3588
+ if (a.key === "Enter") {
3589
+ const c = s(o);
3590
+ return i.onSelectItem(c), !0;
3591
+ }
3592
+ return a.key === "Escape" ? (i.onClose(), !0) : !1;
3593
+ },
3594
+ onExit: (a) => {
3595
+ if (r)
3596
+ return;
3597
+ r = !0;
3598
+ const c = n[0], d = t;
3599
+ c.hide(), setTimeout(() => {
3600
+ c.destroy(), d.destroy();
3601
+ }, 1e3);
3602
+ }
3603
+ };
3604
+ }
3605
+ function uc(e, t) {
3606
+ if (!t.empty)
3607
+ return;
3608
+ const n = t.$anchor.nodeBefore;
3609
+ if (!n || !n.text)
3610
+ return;
3611
+ const r = new RegExp(`${Ln(e)}([^${Ln(e)}]*)$`), o = n.text.match(r);
3612
+ if (!!o)
3613
+ return {
3614
+ query: o[1],
3615
+ range: {
3616
+ from: t.$anchor.pos - o[1].length - e.length,
3617
+ to: t.$anchor.pos
3618
+ }
3619
+ };
3620
+ }
3621
+ function dc({
3622
+ pluginKey: e,
3623
+ editor: t,
3624
+ char: n,
3625
+ onSelectItem: r = () => {
3626
+ },
3627
+ items: o = () => []
3628
+ }) {
3629
+ if (n.length !== 1)
3630
+ throw new Error("'char' should be a single character");
3631
+ const i = lc(t);
3632
+ return new we({
3633
+ key: e,
3634
+ filterTransaction(s) {
3635
+ const a = s.getMeta("blur");
3636
+ if (a != null && a.event.relatedTarget) {
3637
+ const c = i.getComponent();
3638
+ if (c != null && c.contains(a.event.relatedTarget))
3639
+ return !1;
3640
+ }
3641
+ return !0;
3642
+ },
3643
+ view() {
3644
+ return {
3645
+ update: async (s, a) => {
3646
+ var T, C, l, k, g;
3647
+ const c = (T = this.key) == null ? void 0 : T.getState(a), d = (C = this.key) == null ? void 0 : C.getState(s.state), u = !c.active && d.active, f = c.active && !d.active, v = !u && !f && c.query !== d.query;
3648
+ if (!u && !v && !f)
3649
+ return;
3650
+ const m = f ? c : d, y = document.querySelector(
3651
+ `[data-decoration-id="${m.decorationId}"]`
3652
+ ), h = Ko(
3653
+ m.items,
3654
+ "groupName"
3655
+ ), w = () => {
3656
+ s.dispatch(
3657
+ s.state.tr.setMeta(e, { deactivate: !0 })
3658
+ );
3659
+ }, E = {
3660
+ groups: v || u ? h : {},
3661
+ count: m.items.length,
3662
+ onSelectItem: (O) => {
3663
+ w(), r({
3664
+ item: O,
3665
+ editor: t,
3666
+ range: m.range
3667
+ });
3668
+ },
3669
+ clientRect: y ? () => y.getBoundingClientRect() : null,
3670
+ onClose: () => {
3671
+ var O;
3672
+ w(), (O = i.onExit) == null || O.call(i, E);
3673
+ }
3674
+ };
3675
+ f && ((l = i.onExit) == null || l.call(i, E)), v && ((k = i.onUpdate) == null || k.call(i, E)), u && ((g = i.onStart) == null || g.call(i, E));
3676
+ }
3677
+ };
3678
+ },
3679
+ state: {
3680
+ init() {
3681
+ return {
3682
+ active: !1,
3683
+ range: {},
3684
+ query: null,
3685
+ notFoundCount: 0,
3686
+ items: [],
3687
+ type: "slash",
3688
+ decorationId: null
3689
+ };
3690
+ },
3691
+ apply(s, a, c, d) {
3692
+ var v, m, y;
3693
+ const { selection: u } = s, f = { ...a };
3694
+ if (u.from === u.to && !((v = s.getMeta(e)) != null && v.deactivate) && !s.getMeta("focus") && !s.getMeta("blur") && !s.getMeta("pointer")) {
3695
+ if (a.active && u.from <= a.range.from)
3696
+ f.active = !1;
3697
+ else if ((m = s.getMeta(e)) != null && m.activate) {
3698
+ const h = `id_${Math.floor(
3699
+ Math.random() * 4294967295
3700
+ )}`;
3701
+ f.decorationId = h, f.range = {
3702
+ from: u.from - 1,
3703
+ to: u.to
3704
+ }, f.query = "", f.active = !0, f.type = (y = s.getMeta(e)) == null ? void 0 : y.type;
3705
+ } else if (a.active) {
3706
+ const h = uc(
3707
+ a.type === "slash" ? n : "",
3708
+ u
3709
+ );
3710
+ if (!h)
3711
+ throw new Error("active but no match (suggestions)");
3712
+ f.range = h.range, f.active = !0, f.decorationId = a.decorationId, f.query = h.query;
3713
+ }
3714
+ } else
3715
+ f.active = !1;
3716
+ return f.active && (f.items = o(f.query), f.items.length ? f.notFoundCount = 0 : f.range.to > a.range.to ? f.notFoundCount = a.notFoundCount + 1 : f.notFoundCount = a.notFoundCount, f.notFoundCount > 3 && (f.active = !1)), f.active || (f.decorationId = null, f.range = {}, f.query = null, f.notFoundCount = 0, f.items = []), f;
3717
+ }
3718
+ },
3719
+ props: {
3720
+ handleKeyDown(s, a) {
3721
+ var d;
3722
+ const { active: c } = this.getState(s.state);
3723
+ return c ? ((d = i.onKeyDown) == null ? void 0 : d.call(i, a)) || !1 : a.key === n ? (s.dispatch(
3724
+ s.state.tr.insertText(n).scrollIntoView().setMeta(e, { activate: !0, type: "slash" })
3725
+ ), !0) : !1;
3726
+ },
3727
+ decorations(s) {
3728
+ const { active: a, range: c, decorationId: d, type: u } = this.getState(
3729
+ s
3730
+ );
3731
+ if (!a)
3732
+ return null;
3733
+ if (u === "drag") {
3734
+ const f = je(s.selection);
3735
+ if (f)
3736
+ return Ut.create(s.doc, [
3737
+ Wt.node(
3738
+ f.pos,
3739
+ f.pos + f.node.nodeSize,
3740
+ {
3741
+ nodeName: "span",
3742
+ class: "suggestion-decorator",
3743
+ "data-decoration-id": d
3744
+ }
3745
+ )
3746
+ ]);
3747
+ }
3748
+ return Ut.create(s.doc, [
3749
+ Wt.inline(c.from, c.to, {
3750
+ nodeName: "span",
3751
+ class: "suggestion-decorator",
3752
+ "data-decoration-id": d
3753
+ })
3754
+ ]);
3755
+ }
3756
+ }
3757
+ });
3758
+ }
3759
+ var Be = /* @__PURE__ */ ((e) => (e.HEADINGS = "Headings", e.BASIC_BLOCKS = "Basic Blocks", e.CODE = "Code Blocks", e.INLINE = "Inline", e.EMBED = "Embed", e.PLUGIN = "Plugin", e))(Be || {});
3760
+ class Ze {
3761
+ constructor(t, n, r, o = [], i, s, a) {
3762
+ H(this, "groupName");
3763
+ this.name = t, this.group = n, this.execute = r, this.aliases = o, this.icon = i, this.hint = s, this.shortcut = a, this.groupName = n;
3764
+ }
3765
+ match(t) {
3766
+ return this.name.toLowerCase().startsWith(t.toLowerCase()) || this.aliases.filter(
3767
+ (n) => n.toLowerCase().startsWith(t.toLowerCase())
3768
+ ).length !== 0;
3769
+ }
3770
+ }
3771
+ const fc = {
3772
+ heading: new Ze(
3773
+ "Heading",
3774
+ Be.HEADINGS,
3775
+ (e, t) => e.chain().focus().deleteRange(t).addNewBlockAsSibling({ headingType: 1 }).run(),
3776
+ ["h", "heading1", "h1"],
3777
+ eo,
3778
+ "Used for a top-level heading",
3779
+ G("Mod-Alt-1")
3780
+ ),
3781
+ heading2: new Ze(
3782
+ "Heading 2",
3783
+ Be.HEADINGS,
3784
+ (e, t) => e.chain().focus().deleteRange(t).addNewBlockAsSibling({ headingType: 2 }).run(),
3785
+ ["h2", "heading2", "subheading"],
3786
+ to,
3787
+ "Used for key sections",
3788
+ G("Mod-Alt-2")
3789
+ ),
3790
+ heading3: new Ze(
3791
+ "Heading 3",
3792
+ Be.HEADINGS,
3793
+ (e, t) => e.chain().focus().deleteRange(t).addNewBlockAsSibling({ headingType: 3 }).run(),
3794
+ ["h3", "heading3", "subheading"],
3795
+ no,
3796
+ "Used for subsections and group headings",
3797
+ G("Mod-Alt-3")
3798
+ ),
3799
+ numberedList: new Ze(
3800
+ "Numbered List",
3801
+ Be.BASIC_BLOCKS,
3802
+ (e, t) => e.chain().focus().deleteRange(t).addNewBlockAsSibling({ listType: "oli" }).run(),
3803
+ ["li", "list", "numberedlist", "numbered list"],
3804
+ oo,
3805
+ "Used to display a numbered list",
3806
+ G("Mod-Shift-7")
3807
+ ),
3808
+ bulletlist: new Ze(
3809
+ "Bullet List",
3810
+ Be.BASIC_BLOCKS,
3811
+ (e, t) => e.chain().focus().deleteRange(t).addNewBlockAsSibling({ listType: "li" }).run(),
3812
+ ["ul", "list", "bulletlist", "bullet list"],
3813
+ io,
3814
+ "Used to display an unordered list",
3815
+ G("Mod-Shift-8")
3816
+ ),
3817
+ paragraph: new Ze(
3818
+ "Paragraph",
3819
+ Be.BASIC_BLOCKS,
3820
+ (e, t) => e.chain().focus().deleteRange(t).addNewBlockAsSibling().run(),
3821
+ ["p"],
3822
+ Nn,
3823
+ "Used for the body of your document",
3824
+ G("Mod-Alt-0")
3825
+ )
3826
+ }, In = new be("suggestions-slash-commands"), pc = ot.create({
3827
+ name: "slash-command",
3828
+ addOptions() {
3829
+ return {
3830
+ commands: fc
3831
+ };
3832
+ },
3833
+ addProseMirrorPlugins() {
3834
+ return [
3835
+ dc({
3836
+ pluginKey: In,
3837
+ editor: this.editor,
3838
+ char: "/",
3839
+ items: (e) => {
3840
+ const t = [];
3841
+ for (const n in this.options.commands)
3842
+ t.push(this.options.commands[n]);
3843
+ return t.filter((n) => n.match(e));
3844
+ },
3845
+ onSelectItem: ({ item: e, editor: t, range: n }) => {
3846
+ e.execute(t, n);
3847
+ }
3848
+ })
3849
+ ];
3850
+ }
3851
+ }), hc = "_dragHandle_tsup4_1", mc = "_dragHandleAdd_tsup4_19", pr = {
3852
+ dragHandle: hc,
3853
+ dragHandleAdd: mc
3854
+ }, vc = "_menuList_drels_1", gc = {
3855
+ menuList: vc
3856
+ }, yc = (e) => /* @__PURE__ */ React.createElement("div", {
3857
+ className: gc.menuList
3858
+ }, /* @__PURE__ */ React.createElement(kr, null, /* @__PURE__ */ React.createElement(Er, {
3859
+ onClick: e.onDelete
3860
+ }, "Delete"))), bc = (e) => {
3861
+ const [t, n] = Fe(!1), [r, o] = Fe(!1), i = () => {
3862
+ const a = e.view.posAtCoords(e.coords);
3863
+ if (!a)
3864
+ return;
3865
+ const c = je(
3866
+ Vt.create(e.view.state.doc, a.pos)
3867
+ );
3868
+ c && (e.view.dispatch && e.view.dispatch(
3869
+ e.view.state.tr.deleteRange(
3870
+ c.pos,
3871
+ c.pos + c.node.nodeSize
3872
+ )
3873
+ ), o(!0));
3874
+ }, s = () => {
3875
+ var d;
3876
+ n(!0), e.onAddClicked && e.onAddClicked();
3877
+ const a = e.view.posAtCoords(e.coords);
3878
+ if (!a)
3879
+ return;
3880
+ const c = je(
3881
+ Vt.create(e.view.state.doc, a.pos)
3882
+ );
3883
+ if (!!c) {
3884
+ if (((d = c.node.firstChild) == null ? void 0 : d.textContent.length) !== 0) {
3885
+ const u = c.pos + c.node.nodeSize;
3886
+ let f = e.view.state.schema.nodes.tccontent.createAndFill();
3887
+ e.view.state.tr.insert(u, f), e.view.dispatch(e.view.state.tr.insert(u, f)), e.view.dispatch(
3888
+ e.view.state.tr.setSelection(
3889
+ new Vt(e.view.state.tr.doc.resolve(u + 1))
3890
+ )
3891
+ );
3892
+ }
3893
+ e.view.focus(), e.view.dispatch(
3894
+ e.view.state.tr.scrollIntoView().setMeta(In, {
3895
+ activate: !0,
3896
+ type: "drag"
3897
+ })
3898
+ );
3899
+ }
3900
+ };
3901
+ return r || t ? null : /* @__PURE__ */ React.createElement("div", {
3902
+ style: { display: "flex", flexDirection: "row" }
3903
+ }, /* @__PURE__ */ React.createElement(Ks, {
3904
+ size: 24,
3905
+ fillOpacity: "0.25",
3906
+ className: pr.dragHandleAdd,
3907
+ onClick: s
3908
+ }), /* @__PURE__ */ React.createElement($e, {
3909
+ content: /* @__PURE__ */ React.createElement(yc, {
3910
+ onDelete: i
3911
+ }),
3912
+ placement: "left",
3913
+ trigger: "click",
3914
+ duration: 0,
3915
+ interactiveBorder: 100,
3916
+ interactive: !0,
3917
+ onShow: e.onShow,
3918
+ onHide: e.onHide
3919
+ }, /* @__PURE__ */ React.createElement("div", {
3920
+ className: pr.dragHandle
3921
+ })));
3922
+ }, wc = Po.__serializeForClipboard;
3923
+ let dn;
3924
+ function Ec() {
3925
+ if (!dn) {
3926
+ const e = document.querySelector(
3927
+ ".ProseMirror > [class*='blockGroup']"
3928
+ );
3929
+ e && (dn = lo(e).left);
3930
+ }
3931
+ return dn;
3932
+ }
3933
+ function kc(e) {
3934
+ let t = {
3935
+ left: e.left + document.body.scrollLeft,
3936
+ top: e.top + document.body.scrollTop,
3937
+ width: e.width,
3938
+ height: e.height,
3939
+ bottom: 0,
3940
+ right: 0
3941
+ };
3942
+ return t.bottom = t.top + t.height, t.right = t.left + t.width, t;
3943
+ }
3944
+ function lo(e) {
3945
+ return kc(e.getBoundingClientRect());
3946
+ }
3947
+ function xc(e, t) {
3948
+ let n = Dn(e, t);
3949
+ if (n && n.node.nodeType === 1) {
3950
+ const r = t.docView;
3951
+ let o = r.nearestDesc(n.node, !0);
3952
+ return !o || o === r ? null : o.posBefore;
3953
+ }
3954
+ return null;
3955
+ }
3956
+ function Dn(e, t) {
3957
+ var o;
3958
+ let n = t.posAtCoords(e);
3959
+ if (!n)
3960
+ return;
3961
+ let r = t.domAtPos(n.pos).node;
3962
+ if (r !== t.dom) {
3963
+ for (; r && r.parentNode && r.parentNode !== t.dom && !((o = r.hasAttribute) != null && o.call(r, "data-id")); )
3964
+ r = r.parentNode;
3965
+ if (!!r)
3966
+ return { node: r, id: r.getAttribute("data-id") };
3967
+ }
3968
+ }
3969
+ function Tc(e, t) {
3970
+ if (!e.dataTransfer)
3971
+ return;
3972
+ let n = {
3973
+ left: t.dom.clientWidth / 2,
3974
+ top: e.clientY
3975
+ }, r = xc(n, t);
3976
+ if (r != null) {
3977
+ t.dispatch(
3978
+ t.state.tr.setSelection(pn.create(t.state.doc, r))
3979
+ );
3980
+ let o = t.state.selection.content(), { dom: i, text: s } = wc(t, o);
3981
+ e.dataTransfer.clearData(), e.dataTransfer.setData("text/html", i.innerHTML), e.dataTransfer.setData("text/plain", s), e.dataTransfer.effectAllowed = "move";
3982
+ const a = Dn(n, t);
3983
+ e.dataTransfer.setDragImage(a == null ? void 0 : a.node, 0, 0), t.dragging = { slice: o, move: !0 };
3984
+ }
3985
+ }
3986
+ const Cc = () => {
3987
+ let e, n = !1, r = !1;
3988
+ const o = () => {
3989
+ n = !0;
3990
+ }, i = () => {
3991
+ n = !1;
3992
+ }, s = () => {
3993
+ r = !0;
3994
+ };
3995
+ return new we({
3996
+ key: new be("DraggableBlocksPlugin"),
3997
+ view(a) {
3998
+ return e = document.createElement("div"), e.setAttribute("draggable", "true"), e.style.position = "absolute", e.style.height = "24px", document.body.append(e), e.addEventListener(
3999
+ "dragstart",
4000
+ (c) => Tc(c, a)
4001
+ ), {
4002
+ destroy() {
4003
+ if (!e)
4004
+ throw new Error("unexpected");
4005
+ e.parentNode.removeChild(e), e = void 0;
4006
+ }
4007
+ };
4008
+ },
4009
+ props: {
4010
+ handleKeyDown(a, c) {
4011
+ if (!e)
4012
+ throw new Error("unexpected");
4013
+ return n = !1, r = !1, Te.render(/* @__PURE__ */ React.createElement(React.Fragment, null), e), !1;
4014
+ },
4015
+ handleDOMEvents: {
4016
+ mouseleave(a, c) {
4017
+ if (!e)
4018
+ throw new Error("unexpected");
4019
+ return !0;
4020
+ },
4021
+ mousedown(a, c) {
4022
+ if (!e)
4023
+ throw new Error("unexpected");
4024
+ return n = !1, r = !1, Te.render(/* @__PURE__ */ React.createElement(React.Fragment, null), e), !1;
4025
+ },
4026
+ mousemove(a, c) {
4027
+ if (!e)
4028
+ throw new Error("unexpected");
4029
+ if (n || r)
4030
+ return !0;
4031
+ const d = {
4032
+ left: a.dom.clientWidth / 2,
4033
+ top: c.clientY
4034
+ }, u = Dn(d, a);
4035
+ if (!u)
4036
+ return console.warn("Perhaps we should hide element?"), !0;
4037
+ const f = u.node.firstChild;
4038
+ if (!f)
4039
+ return !0;
4040
+ const v = lo(f), m = u.node.ownerDocument.defaultView, y = e.getBoundingClientRect(), h = Ec() - 48 + m.pageXOffset;
4041
+ return v.top += v.height / 2 - y.height / 2 + m.pageYOffset, e.style.left = h + "px", e.style.top = v.top + "px", Te.render(
4042
+ /* @__PURE__ */ React.createElement(bc, {
4043
+ onShow: o,
4044
+ onHide: i,
4045
+ onAddClicked: s,
4046
+ key: u.id + "",
4047
+ view: a,
4048
+ coords: d
4049
+ }),
4050
+ e
4051
+ ), !0;
4052
+ }
4053
+ }
4054
+ }
4055
+ });
4056
+ }, Oc = ot.create({
4057
+ name: "DraggableBlocksExtension",
4058
+ priority: 1e3,
4059
+ addProseMirrorPlugins() {
4060
+ return [Cc()];
4061
+ }
4062
+ }), Sc = "_separator_1j7dp_1", Ac = {
4063
+ separator: Sc
4064
+ }, hr = () => /* @__PURE__ */ React.createElement(br, {
4065
+ appearance: "subtle",
4066
+ className: Ac.separator
4067
+ }), Mc = (e) => {
4068
+ const [t, n] = Fe(!1);
4069
+ if (t)
4070
+ return e.editMenu;
4071
+ function r(o) {
4072
+ n(!0), o.stopPropagation();
4073
+ }
4074
+ return /* @__PURE__ */ A.createElement(ao, null, /* @__PURE__ */ A.createElement(fe, {
4075
+ mainTooltip: "Edit",
4076
+ isSelected: !1,
4077
+ onClick: r
4078
+ }, "Edit Link"), /* @__PURE__ */ A.createElement(hr, null), /* @__PURE__ */ A.createElement(fe, {
4079
+ mainTooltip: "Open in new tab",
4080
+ isSelected: !1,
4081
+ onClick: () => {
4082
+ window.open(e.href, "_blank");
4083
+ },
4084
+ icon: ys
4085
+ }), /* @__PURE__ */ A.createElement(hr, null), /* @__PURE__ */ A.createElement(fe, {
4086
+ mainTooltip: "Remove link",
4087
+ isSelected: !1,
4088
+ onClick: e.removeHandler,
4089
+ icon: ms
4090
+ }));
4091
+ }, mr = new be("HyperlinkMenuPlugin"), Rc = (e) => {
4092
+ const { anchorPos: t, ...n } = e;
4093
+ return /* @__PURE__ */ React.createElement($e, {
4094
+ getReferenceClientRect: () => t,
4095
+ content: /* @__PURE__ */ React.createElement(co, {
4096
+ ...n
4097
+ }),
4098
+ interactive: !0,
4099
+ interactiveBorder: 30,
4100
+ showOnCreate: !0,
4101
+ trigger: "click",
4102
+ hideOnClick: !0,
4103
+ className: Xt.bnRoot,
4104
+ appendTo: document.body
4105
+ }, /* @__PURE__ */ React.createElement("div", null));
4106
+ }, Nc = () => {
4107
+ const e = document.createElement("div");
4108
+ let t, n = "hidden", r = 0;
4109
+ return new we({
4110
+ key: mr,
4111
+ view() {
4112
+ return {
4113
+ update: async (o, i) => {
4114
+ const s = o.state.selection;
4115
+ if (s.from !== s.to) {
4116
+ n !== "hidden" && (n = "hidden", Te.render(/* @__PURE__ */ React.createElement(React.Fragment, null), e));
4117
+ return;
4118
+ }
4119
+ let a, c, d, u = !1;
4120
+ if (t) {
4121
+ a = o.posAtDOM(t.firstChild, 0), c = o.state.doc.resolve(a);
4122
+ const l = c.parent.childAfter(c.parentOffset).node;
4123
+ d = l == null ? void 0 : l.marks.find((k) => k.type.name.startsWith("link"));
4124
+ }
4125
+ if (!d && (o.hasFocus() || n === "cursor-based")) {
4126
+ a = s.from, c = o.state.doc.resolve(a);
4127
+ const l = c.parent.childAfter(c.parentOffset).node;
4128
+ d = l == null ? void 0 : l.marks.find((k) => k.type.name.startsWith("link")), u = !0;
4129
+ }
4130
+ if (!d || !a || !c) {
4131
+ n === "cursor-based" && (n = "hidden", Te.render(/* @__PURE__ */ React.createElement(React.Fragment, null), e));
4132
+ return;
4133
+ }
4134
+ const f = Co(c, d.type, d.attrs);
4135
+ if (!f)
4136
+ return;
4137
+ const v = o.state.doc.textBetween(f.from, f.to), m = d.attrs.href, y = {
4138
+ ...o.coordsAtPos(Math.round((f.from + f.to) / 2)),
4139
+ height: 0,
4140
+ width: 0
4141
+ }, h = d, w = (l, k) => {
4142
+ n = "hidden", Te.render(/* @__PURE__ */ React.createElement(React.Fragment, null), e), h.attrs = { ...h.attrs, href: l };
4143
+ const g = o.state.tr.insertText(k, f.from, f.to);
4144
+ g.addMark(f.from, f.from + k.length, h), o.dispatch(g);
4145
+ }, E = () => {
4146
+ o.dispatch(
4147
+ o.state.tr.removeMark(f.from, f.to, h.type).setMeta("preventAutolink", !0)
4148
+ );
4149
+ }, T = Rc({
4150
+ anchorPos: y,
4151
+ text: v,
4152
+ url: m,
4153
+ onSubmit: w
4154
+ }), C = /* @__PURE__ */ React.createElement($e, {
4155
+ key: r + "",
4156
+ getReferenceClientRect: () => y,
4157
+ content: /* @__PURE__ */ React.createElement(Mc, {
4158
+ editMenu: T,
4159
+ removeHandler: E,
4160
+ href: m
4161
+ }),
4162
+ onHide: () => {
4163
+ r++, n = "hidden";
4164
+ },
4165
+ aria: { expanded: !1 },
4166
+ interactive: !0,
4167
+ interactiveBorder: 30,
4168
+ triggerTarget: t,
4169
+ showOnCreate: u,
4170
+ appendTo: document.body
4171
+ }, /* @__PURE__ */ React.createElement("div", null));
4172
+ Te.render(C, e), n = u ? "cursor-based" : "mouse-based";
4173
+ }
4174
+ };
4175
+ },
4176
+ props: {
4177
+ handleDOMEvents: {
4178
+ mouseover(o, i) {
4179
+ const s = i.target instanceof HTMLAnchorElement && i.target.nodeName === "A" ? i.target : void 0;
4180
+ return s !== t && (t = s, o.dispatch(
4181
+ o.state.tr.setMeta(mr, { hoveredLinkChanged: !0 })
4182
+ )), !1;
4183
+ }
4184
+ }
4185
+ }
4186
+ });
4187
+ }, Ic = Yo.extend({
4188
+ priority: 500,
4189
+ addProseMirrorPlugins() {
4190
+ var e;
4191
+ return [...((e = this.parent) == null ? void 0 : e.call(this)) || [], Nc()];
4192
+ }
4193
+ }), Dc = Xo.extend({
4194
+ addKeyboardShortcuts: () => ({
4195
+ "Mod-Alt-0": () => !1
4196
+ })
4197
+ }), Hc = ot.create({
4198
+ name: "placeholder",
4199
+ addOptions() {
4200
+ return {
4201
+ emptyEditorClass: "is-editor-empty",
4202
+ emptyNodeClass: "is-empty",
4203
+ isFilterClass: "is-filter",
4204
+ hasAnchorClass: "has-anchor",
4205
+ placeholder: "Write something \u2026",
4206
+ showOnlyWhenEditable: !0,
4207
+ showOnlyCurrent: !0,
4208
+ includeChildren: !1
4209
+ };
4210
+ },
4211
+ addProseMirrorPlugins() {
4212
+ return [
4213
+ new we({
4214
+ props: {
4215
+ decorations: (e) => {
4216
+ const { doc: t, selection: n } = e, r = In.getState(e), o = this.editor.isEditable || !this.options.showOnlyWhenEditable, { anchor: i } = n, s = [];
4217
+ if (!!o)
4218
+ return t.descendants((a, c) => {
4219
+ const d = i >= c && i <= c + a.nodeSize, u = !a.isLeaf && !a.childCount;
4220
+ if ((d || !this.options.showOnlyCurrent) && u) {
4221
+ const f = [this.options.emptyNodeClass];
4222
+ this.editor.isEmpty && f.push(this.options.emptyEditorClass), d && f.push(this.options.hasAnchorClass), r.type === "drag" && r.active && f.push(this.options.isFilterClass);
4223
+ const v = Wt.node(c, c + a.nodeSize, {
4224
+ class: f.join(" ")
4225
+ });
4226
+ s.push(v);
4227
+ }
4228
+ return this.options.includeChildren;
4229
+ }), Ut.create(t, s);
4230
+ }
4231
+ }
4232
+ })
4233
+ ];
4234
+ }
4235
+ }), Lc = ot.create({
4236
+ name: "trailingNode",
4237
+ addProseMirrorPlugins() {
4238
+ const e = new be(this.name);
4239
+ return [
4240
+ new we({
4241
+ key: e,
4242
+ appendTransaction: (t, n, r) => {
4243
+ const { doc: o, tr: i, schema: s } = r, a = e.getState(r), c = o.content.size - 2, d = s.nodes.tcblock, u = s.nodes.tccontent;
4244
+ if (!!a)
4245
+ return i.insert(
4246
+ c,
4247
+ d.create(void 0, u.create())
4248
+ );
4249
+ },
4250
+ state: {
4251
+ init: (t, n) => {
4252
+ },
4253
+ apply: (t, n) => {
4254
+ if (!t.docChanged)
4255
+ return n;
4256
+ let r = t.doc.lastChild;
4257
+ if (!r || r.type.name !== "blockgroup")
4258
+ throw new Error("Expected blockgroup");
4259
+ if (r = r.lastChild, !r || r.type.name !== "tcblock")
4260
+ throw new Error("Expected tcblock");
4261
+ return r.nodeSize > 4;
4262
+ }
4263
+ }
4264
+ })
4265
+ ];
4266
+ }
4267
+ });
4268
+ function Bc(e, t = JSON.stringify) {
4269
+ const n = {};
4270
+ return e.filter((r) => {
4271
+ const o = t(r);
4272
+ return Object.prototype.hasOwnProperty.call(n, o) ? !1 : n[o] = !0;
4273
+ });
4274
+ }
4275
+ function _c(e) {
4276
+ const t = e.filter(
4277
+ (r, o) => e.indexOf(r) !== o
4278
+ );
4279
+ return Bc(t);
4280
+ }
4281
+ const Pc = ot.create({
4282
+ name: "uniqueID",
4283
+ priority: 1e4,
4284
+ addOptions() {
4285
+ return {
4286
+ attributeName: "id",
4287
+ types: [],
4288
+ generateID: () => Zo(),
4289
+ filterTransaction: null
4290
+ };
4291
+ },
4292
+ addGlobalAttributes() {
4293
+ return [
4294
+ {
4295
+ types: this.options.types,
4296
+ attributes: {
4297
+ [this.options.attributeName]: {
4298
+ default: null,
4299
+ parseHTML: (e) => e.getAttribute(`data-${this.options.attributeName}`),
4300
+ renderHTML: (e) => e[this.options.attributeName] ? {
4301
+ [`data-${this.options.attributeName}`]: e[this.options.attributeName]
4302
+ } : {}
4303
+ }
4304
+ }
4305
+ }
4306
+ ];
4307
+ },
4308
+ onCreate() {
4309
+ if (this.editor.extensionManager.extensions.find(
4310
+ (c) => c.name === "collaboration"
4311
+ ))
4312
+ return;
4313
+ const { view: e, state: t } = this.editor, { tr: n, doc: r } = t, { types: o, attributeName: i, generateID: s } = this.options;
4314
+ fn(r, (c) => o.includes(c.type.name) && c.attrs[i] === null).forEach(({ node: c, pos: d }) => {
4315
+ n.setNodeMarkup(d, void 0, {
4316
+ ...c.attrs,
4317
+ [i]: s()
4318
+ });
4319
+ }), n.setMeta("addToHistory", !1), e.dispatch(n);
4320
+ },
4321
+ addProseMirrorPlugins() {
4322
+ let e = null, t = !1;
4323
+ return [
4324
+ new we({
4325
+ key: new be("uniqueID"),
4326
+ appendTransaction: (n, r, o) => {
4327
+ console.log("appendTransaction");
4328
+ const i = n.some((y) => y.docChanged) && !r.doc.eq(o.doc), s = this.options.filterTransaction && n.some((y) => {
4329
+ var h, w;
4330
+ return !(!((w = (h = this.options).filterTransaction) === null || w === void 0) && w.call(h, y));
4331
+ });
4332
+ if (!i || s)
4333
+ return;
4334
+ const { tr: a } = o, { types: c, attributeName: d, generateID: u } = this.options, f = gr(
4335
+ r.doc,
4336
+ n
4337
+ ), { mapping: v } = f;
4338
+ if (yr(f).forEach(({ newRange: y }) => {
4339
+ const h = Oo(
4340
+ o.doc,
4341
+ y,
4342
+ (T) => c.includes(T.type.name)
4343
+ ), w = h.map(({ node: T }) => T.attrs[d]).filter((T) => T !== null), E = _c(w);
4344
+ h.forEach(({ node: T, pos: C }) => {
4345
+ var l;
4346
+ const k = (l = a.doc.nodeAt(C)) === null || l === void 0 ? void 0 : l.attrs[d];
4347
+ if (k === null) {
4348
+ a.setNodeMarkup(C, void 0, {
4349
+ ...T.attrs,
4350
+ [d]: u()
4351
+ });
4352
+ return;
4353
+ }
4354
+ const { deleted: g } = v.invert().mapResult(C);
4355
+ g && E.includes(k) && a.setNodeMarkup(C, void 0, {
4356
+ ...T.attrs,
4357
+ [d]: u()
4358
+ });
4359
+ });
4360
+ }), !!a.steps.length)
4361
+ return a;
4362
+ },
4363
+ view(n) {
4364
+ const r = (o) => {
4365
+ var i;
4366
+ e = !((i = n.dom.parentElement) === null || i === void 0) && i.contains(o.target) ? n.dom.parentElement : null;
4367
+ };
4368
+ return window.addEventListener("dragstart", r), {
4369
+ destroy() {
4370
+ window.removeEventListener("dragstart", r);
4371
+ }
4372
+ };
4373
+ },
4374
+ props: {
4375
+ handleDOMEvents: {
4376
+ drop: (n, r) => {
4377
+ var o;
4378
+ return (e !== n.dom.parentElement || ((o = r.dataTransfer) === null || o === void 0 ? void 0 : o.effectAllowed) === "copy") && (e = null, t = !0), !1;
4379
+ },
4380
+ paste: () => (t = !0, !1)
4381
+ },
4382
+ transformPasted: (n) => {
4383
+ if (!t)
4384
+ return n;
4385
+ const { types: r, attributeName: o } = this.options, i = (s) => {
4386
+ const a = [];
4387
+ return s.forEach((c) => {
4388
+ if (c.isText) {
4389
+ a.push(c);
4390
+ return;
4391
+ }
4392
+ if (!r.includes(c.type.name)) {
4393
+ a.push(c.copy(i(c.content)));
4394
+ return;
4395
+ }
4396
+ const d = c.type.create(
4397
+ {
4398
+ ...c.attrs,
4399
+ [o]: null
4400
+ },
4401
+ i(c.content),
4402
+ c.marks
4403
+ );
4404
+ a.push(d);
4405
+ }), W.from(a);
4406
+ };
4407
+ return t = !1, new _(
4408
+ i(n.content),
4409
+ n.openStart,
4410
+ n.openEnd
4411
+ );
4412
+ }
4413
+ }
4414
+ })
4415
+ ];
4416
+ }
4417
+ }), vl = Tt.create({
4418
+ name: "doc",
4419
+ topNode: !0,
4420
+ content: "block+"
4421
+ }), zc = () => [
4422
+ ft.ClipboardTextSerializer,
4423
+ ft.Commands,
4424
+ ft.Editable,
4425
+ ft.FocusEvents,
4426
+ ft.Tabindex,
4427
+ Ro,
4428
+ Hc.configure({
4429
+ emptyNodeClass: ze.isEmpty,
4430
+ hasAnchorClass: ze.hasAnchor,
4431
+ isFilterClass: ze.isFilter,
4432
+ includeChildren: !0,
4433
+ showOnlyCurrent: !1
4434
+ }),
4435
+ Pc.configure({
4436
+ types: ["tcblock"]
4437
+ }),
4438
+ No,
4439
+ Bo,
4440
+ So,
4441
+ Ao,
4442
+ Io,
4443
+ Lo,
4444
+ Do,
4445
+ Ic,
4446
+ Dc,
4447
+ ...Ti,
4448
+ Oc,
4449
+ Mo.configure({ width: 5, color: "#ddeeff" }),
4450
+ qs,
4451
+ Ho,
4452
+ pc,
4453
+ Lc
4454
+ ], Vc = "_bnEditor_1bxtz_1", Fc = {
4455
+ bnEditor: Vc
4456
+ }, vr = zc(), $c = {
4457
+ enableInputRules: !0,
4458
+ enablePasteRules: !0,
4459
+ enableCoreExtensions: !1
4460
+ }, gl = (e = {}, t = []) => {
4461
+ var o, i, s;
4462
+ const n = e.disableHistoryExtension ? vr.filter((a) => a.name !== "history") : vr, r = {
4463
+ ...$c,
4464
+ ...e,
4465
+ extensions: e.enableBlockNoteExtensions === !1 ? e.extensions : [...e.extensions || [], ...n],
4466
+ editorProps: {
4467
+ attributes: {
4468
+ ...((o = e.editorProps) == null ? void 0 : o.attributes) || {},
4469
+ class: [
4470
+ Fc.bnEditor,
4471
+ Xt.bnRoot,
4472
+ ((s = (i = e.editorProps) == null ? void 0 : i.attributes) == null ? void 0 : s.class) || ""
4473
+ ].join(" ")
4474
+ }
4475
+ }
4476
+ };
4477
+ return Go(r, t);
4478
+ };
4479
+ export {
4480
+ vl as Document,
4481
+ wl as EditorContent,
4482
+ zc as getBlockNoteExtensions,
4483
+ gl as useEditor
4484
+ };
4485
+ //# sourceMappingURL=blocknote.js.map