@alfadocs/ui-kit 1.41.0 → 1.42.0

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 (68) hide show
  1. package/dist/_chunks/{calendar-workspace-UllCER2k.js → calendar-workspace-qlxrxCqm.js} +1980 -1967
  2. package/dist/_chunks/{help-me-write-templates-GB70jnV9.js → help-me-write-templates-B-m7zgJa.js} +242 -231
  3. package/dist/_chunks/{notes-panel-_diLt8Cj.js → notes-panel-CRAovkjx.js} +84 -68
  4. package/dist/_chunks/{rich-text-editor-D7AKKAQ2.js → rich-text-editor-DUMeifwc.js} +1195 -1138
  5. package/dist/agent-catalog.json +1 -1
  6. package/dist/components/notes-panel/index.js +1 -1
  7. package/dist/components/notes-panel/notes-panel.d.ts +32 -0
  8. package/dist/components/rich-text-editor/index.js +1 -1
  9. package/dist/i18n/locales/ar.d.ts +1 -0
  10. package/dist/i18n/locales/ar.js +2 -1
  11. package/dist/i18n/locales/de.d.ts +1 -0
  12. package/dist/i18n/locales/de.js +2 -1
  13. package/dist/i18n/locales/el.d.ts +1 -0
  14. package/dist/i18n/locales/el.js +2 -1
  15. package/dist/i18n/locales/en.d.ts +1 -0
  16. package/dist/i18n/locales/en.js +2 -1
  17. package/dist/i18n/locales/es.d.ts +1 -0
  18. package/dist/i18n/locales/es.js +2 -1
  19. package/dist/i18n/locales/fr.d.ts +1 -0
  20. package/dist/i18n/locales/fr.js +2 -1
  21. package/dist/i18n/locales/hi.d.ts +1 -0
  22. package/dist/i18n/locales/hi.js +2 -1
  23. package/dist/i18n/locales/it.d.ts +1 -0
  24. package/dist/i18n/locales/it.js +2 -1
  25. package/dist/i18n/locales/ja.d.ts +1 -0
  26. package/dist/i18n/locales/ja.js +2 -1
  27. package/dist/i18n/locales/nl.d.ts +1 -0
  28. package/dist/i18n/locales/nl.js +2 -1
  29. package/dist/i18n/locales/pl.d.ts +1 -0
  30. package/dist/i18n/locales/pl.js +2 -1
  31. package/dist/i18n/locales/pt.d.ts +1 -0
  32. package/dist/i18n/locales/pt.js +2 -1
  33. package/dist/i18n/locales/ro.d.ts +1 -0
  34. package/dist/i18n/locales/ro.js +2 -1
  35. package/dist/i18n/locales/ru.d.ts +1 -0
  36. package/dist/i18n/locales/ru.js +2 -1
  37. package/dist/i18n/locales/sq.d.ts +1 -0
  38. package/dist/i18n/locales/sq.js +2 -1
  39. package/dist/i18n/locales/sv.d.ts +1 -0
  40. package/dist/i18n/locales/sv.js +2 -1
  41. package/dist/i18n/locales/tr.d.ts +1 -0
  42. package/dist/i18n/locales/tr.js +2 -1
  43. package/dist/i18n/locales/zh.d.ts +1 -0
  44. package/dist/i18n/locales/zh.js +2 -1
  45. package/dist/index.js +4 -4
  46. package/dist/locales/ar.json +2 -1
  47. package/dist/locales/de.json +2 -1
  48. package/dist/locales/el.json +2 -1
  49. package/dist/locales/en.json +2 -1
  50. package/dist/locales/es.json +2 -1
  51. package/dist/locales/fr.json +2 -1
  52. package/dist/locales/hi.json +2 -1
  53. package/dist/locales/it.json +2 -1
  54. package/dist/locales/ja.json +2 -1
  55. package/dist/locales/nl.json +2 -1
  56. package/dist/locales/pl.json +2 -1
  57. package/dist/locales/pt.json +2 -1
  58. package/dist/locales/ro.json +2 -1
  59. package/dist/locales/ru.json +2 -1
  60. package/dist/locales/sq.json +2 -1
  61. package/dist/locales/sv.json +2 -1
  62. package/dist/locales/tr.json +2 -1
  63. package/dist/locales/zh.json +2 -1
  64. package/dist/patterns/calendar/calendar.journey.d.ts +11 -0
  65. package/dist/patterns/calendar/calendar.sheets.d.ts +20 -0
  66. package/dist/patterns/calendar/index.js +1 -1
  67. package/dist/patterns/help-me-write-templates/index.js +1 -1
  68. package/package.json +1 -1
@@ -1,111 +1,111 @@
1
1
  import { jsx as t, jsxs as k, Fragment as Me } from "react/jsx-runtime";
2
- import { useId as _e, useState as A, useRef as M, useCallback as x, useEffect as I, Fragment as pt, forwardRef as Qr, useMemo as qe, useImperativeHandle as Yr } from "react";
3
- import { c as Ot } from "./index-D2ZczOXr.js";
4
- import { useTranslation as ne } from "react-i18next";
5
- import { SafeHtml as Jr, sanitiseHtml as en } from "../safe-html/index.js";
6
- import { u as tn } from "./registry-DvAUVLHh.js";
7
- import { S as pr } from "./spinner-hbwuKwMf.js";
8
- import { B as pe } from "./button-CaUe1uyd.js";
9
- import { A as rn } from "./ai-consent-banner-D7I2U-cz.js";
10
- import { I as G } from "./icon-button-CehAeZoP.js";
11
- import { T as nn } from "./text-area-Bt3p7Pt0.js";
12
- import { E as br } from "./editor-overlay-DwNKaI22.js";
13
- import { X as lr } from "./x-B5YnXwCz.js";
14
- import { R as on } from "./rotate-ccw-BBQnIVTr.js";
15
- import { C as an } from "./check-DrFSN__t.js";
16
- import { S as gt } from "./square-DASBRZ0U.js";
17
- import { M as yr } from "./mic-CUklMZGF.js";
18
- import { S as sn } from "./send-C5kDJ-Mz.js";
19
- import { a as vr } from "./tooltip-Cp-PLePW.js";
20
- import { P as V } from "./popover-DO-pssF3.js";
21
- import { D as he } from "./dropdown-menu-DU-Hrf33.js";
2
+ import { useId as Ee, useState as z, useRef as T, useCallback as x, useEffect as I, Fragment as vt, forwardRef as nn, useMemo as Pe, useImperativeHandle as on } from "react";
3
+ import { c as Ft } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as se } from "react-i18next";
5
+ import { SafeHtml as an, sanitiseHtml as sn } from "../safe-html/index.js";
6
+ import { u as ln } from "./registry-DvAUVLHh.js";
7
+ import { S as kr } from "./spinner-hbwuKwMf.js";
8
+ import { B as ve } from "./button-CaUe1uyd.js";
9
+ import { A as cn } from "./ai-consent-banner-D7I2U-cz.js";
10
+ import { I as V } from "./icon-button-CehAeZoP.js";
11
+ import { T as dn } from "./text-area-Bt3p7Pt0.js";
12
+ import { E as Cr } from "./editor-overlay-DwNKaI22.js";
13
+ import { X as mr } from "./x-B5YnXwCz.js";
14
+ import { R as un } from "./rotate-ccw-BBQnIVTr.js";
15
+ import { C as mn } from "./check-DrFSN__t.js";
16
+ import { S as pt } from "./square-DASBRZ0U.js";
17
+ import { M as Nr } from "./mic-CUklMZGF.js";
18
+ import { S as fn } from "./send-C5kDJ-Mz.js";
19
+ import { a as Tr } from "./tooltip-Cp-PLePW.js";
20
+ import { P as K } from "./popover-DO-pssF3.js";
21
+ import { D as ye } from "./dropdown-menu-DU-Hrf33.js";
22
22
  import { D as Z } from "./dialog-BJiLqhx6.js";
23
- import { C as Pt } from "./color-picker-Bl5f0iK1.js";
24
- import { T as ft } from "./text-input-CUvCb6ST.js";
25
- import { C as ln } from "./checkbox-CZkipDn7.js";
26
- import { F as cn } from "./file-upload-BDpb08GM.js";
27
- import { c as R } from "./createLucideIcon-DhHxpK9K.js";
28
- import { E as dn } from "./ellipsis-dRo9ouSU.js";
29
- import { H as un } from "./highlighter-DSkckT2Q.js";
30
- import { I as mn } from "./image-B_5MNK0x.js";
31
- import { C as gn } from "./chevron-down-DWE7GSq9.js";
32
- import { T as fn } from "./trash-2-uumy3fy1.js";
33
- import { W as hn } from "./wand-sparkles-DAjKyhz7.js";
34
- import { A as pn } from "./astroid-BN4f5VXU.js";
23
+ import { C as jt } from "./color-picker-Bl5f0iK1.js";
24
+ import { T as bt } from "./text-input-CUvCb6ST.js";
25
+ import { C as gn } from "./checkbox-CZkipDn7.js";
26
+ import { F as hn } from "./file-upload-BDpb08GM.js";
27
+ import { c as S } from "./createLucideIcon-DhHxpK9K.js";
28
+ import { E as pn } from "./ellipsis-dRo9ouSU.js";
29
+ import { H as bn } from "./highlighter-DSkckT2Q.js";
30
+ import { I as yn } from "./image-B_5MNK0x.js";
31
+ import { C as vn } from "./chevron-down-DWE7GSq9.js";
32
+ import { T as wn } from "./trash-2-uumy3fy1.js";
33
+ import { W as xn } from "./wand-sparkles-DAjKyhz7.js";
34
+ import { A as kn } from "./astroid-BN4f5VXU.js";
35
35
  /**
36
36
  * @license lucide-react v1.22.0 - ISC
37
37
  *
38
38
  * This source code is licensed under the ISC license.
39
39
  * See the LICENSE file in the root directory of this source tree.
40
40
  */
41
- const bn = [
41
+ const Cn = [
42
42
  ["path", { d: "M4 20h16", key: "14thso" }],
43
43
  ["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
44
44
  ["path", { d: "M8 12h8", key: "1wcyev" }]
45
- ], yn = R("baseline", bn);
45
+ ], Nn = S("baseline", Cn);
46
46
  /**
47
47
  * @license lucide-react v1.22.0 - ISC
48
48
  *
49
49
  * This source code is licensed under the ISC license.
50
50
  * See the LICENSE file in the root directory of this source tree.
51
51
  */
52
- const vn = [
52
+ const Tn = [
53
53
  ["rect", { width: "13", height: "7", x: "3", y: "3", rx: "1", key: "11xb64" }],
54
54
  ["path", { d: "m22 15-3-3 3-3", key: "26chmm" }],
55
55
  ["rect", { width: "13", height: "7", x: "3", y: "14", rx: "1", key: "k6ky7n" }]
56
- ], wn = R("between-horizontal-end", vn);
56
+ ], An = S("between-horizontal-end", Tn);
57
57
  /**
58
58
  * @license lucide-react v1.22.0 - ISC
59
59
  *
60
60
  * This source code is licensed under the ISC license.
61
61
  * See the LICENSE file in the root directory of this source tree.
62
62
  */
63
- const xn = [
63
+ const zn = [
64
64
  ["rect", { width: "13", height: "7", x: "8", y: "3", rx: "1", key: "pkso9a" }],
65
65
  ["path", { d: "m2 9 3 3-3 3", key: "1agib5" }],
66
66
  ["rect", { width: "13", height: "7", x: "8", y: "14", rx: "1", key: "1q5fc1" }]
67
- ], kn = R("between-horizontal-start", xn);
67
+ ], Rn = S("between-horizontal-start", zn);
68
68
  /**
69
69
  * @license lucide-react v1.22.0 - ISC
70
70
  *
71
71
  * This source code is licensed under the ISC license.
72
72
  * See the LICENSE file in the root directory of this source tree.
73
73
  */
74
- const Cn = [
74
+ const _n = [
75
75
  ["rect", { width: "7", height: "13", x: "3", y: "3", rx: "1", key: "1fdu0f" }],
76
76
  ["path", { d: "m9 22 3-3 3 3", key: "17z65a" }],
77
77
  ["rect", { width: "7", height: "13", x: "14", y: "3", rx: "1", key: "1squn4" }]
78
- ], Nn = R("between-vertical-end", Cn);
78
+ ], Mn = S("between-vertical-end", _n);
79
79
  /**
80
80
  * @license lucide-react v1.22.0 - ISC
81
81
  *
82
82
  * This source code is licensed under the ISC license.
83
83
  * See the LICENSE file in the root directory of this source tree.
84
84
  */
85
- const Tn = [
85
+ const En = [
86
86
  ["rect", { width: "7", height: "13", x: "3", y: "8", rx: "1", key: "1fjrkv" }],
87
87
  ["path", { d: "m15 2-3 3-3-3", key: "1uh6eb" }],
88
88
  ["rect", { width: "7", height: "13", x: "14", y: "8", rx: "1", key: "w3fjg8" }]
89
- ], An = R("between-vertical-start", Tn);
89
+ ], Sn = S("between-vertical-start", En);
90
90
  /**
91
91
  * @license lucide-react v1.22.0 - ISC
92
92
  *
93
93
  * This source code is licensed under the ISC license.
94
94
  * See the LICENSE file in the root directory of this source tree.
95
95
  */
96
- const zn = [
96
+ const Ln = [
97
97
  [
98
98
  "path",
99
99
  { d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8", key: "mg9rjx" }
100
100
  ]
101
- ], Mn = R("bold", zn);
101
+ ], In = S("bold", Ln);
102
102
  /**
103
103
  * @license lucide-react v1.22.0 - ISC
104
104
  *
105
105
  * This source code is licensed under the ISC license.
106
106
  * See the LICENSE file in the root directory of this source tree.
107
107
  */
108
- const _n = [
108
+ const $n = [
109
109
  [
110
110
  "path",
111
111
  { d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
@@ -117,98 +117,98 @@ const _n = [
117
117
  key: "e1hn23"
118
118
  }
119
119
  ]
120
- ], En = R("braces", _n);
120
+ ], Hn = S("braces", $n);
121
121
  /**
122
122
  * @license lucide-react v1.22.0 - ISC
123
123
  *
124
124
  * This source code is licensed under the ISC license.
125
125
  * See the LICENSE file in the root directory of this source tree.
126
126
  */
127
- const Rn = [
127
+ const Dn = [
128
128
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
129
129
  ["path", { d: "M12 3v18", key: "108xh3" }]
130
- ], Sn = R("columns-2", Rn);
130
+ ], On = S("columns-2", Dn);
131
131
  /**
132
132
  * @license lucide-react v1.22.0 - ISC
133
133
  *
134
134
  * This source code is licensed under the ISC license.
135
135
  * See the LICENSE file in the root directory of this source tree.
136
136
  */
137
- const Ln = [
137
+ const qn = [
138
138
  ["path", { d: "M4 12h8", key: "17cfdx" }],
139
139
  ["path", { d: "M4 18V6", key: "1rz3zl" }],
140
140
  ["path", { d: "M12 18V6", key: "zqpxq5" }],
141
141
  ["path", { d: "M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1", key: "9jr5yi" }]
142
- ], In = R("heading-2", Ln);
142
+ ], Pn = S("heading-2", qn);
143
143
  /**
144
144
  * @license lucide-react v1.22.0 - ISC
145
145
  *
146
146
  * This source code is licensed under the ISC license.
147
147
  * See the LICENSE file in the root directory of this source tree.
148
148
  */
149
- const $n = [
149
+ const Fn = [
150
150
  ["path", { d: "M4 12h8", key: "17cfdx" }],
151
151
  ["path", { d: "M4 18V6", key: "1rz3zl" }],
152
152
  ["path", { d: "M12 18V6", key: "zqpxq5" }],
153
153
  ["path", { d: "M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2", key: "68ncm8" }],
154
154
  ["path", { d: "M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2", key: "1ejuhz" }]
155
- ], Hn = R("heading-3", $n);
155
+ ], jn = S("heading-3", Fn);
156
156
  /**
157
157
  * @license lucide-react v1.22.0 - ISC
158
158
  *
159
159
  * This source code is licensed under the ISC license.
160
160
  * See the LICENSE file in the root directory of this source tree.
161
161
  */
162
- const Dn = [
162
+ const Bn = [
163
163
  ["line", { x1: "19", x2: "10", y1: "4", y2: "4", key: "15jd3p" }],
164
164
  ["line", { x1: "14", x2: "5", y1: "20", y2: "20", key: "bu0au3" }],
165
165
  ["line", { x1: "15", x2: "9", y1: "4", y2: "20", key: "uljnxc" }]
166
- ], qn = R("italic", Dn);
166
+ ], Gn = S("italic", Bn);
167
167
  /**
168
168
  * @license lucide-react v1.22.0 - ISC
169
169
  *
170
170
  * This source code is licensed under the ISC license.
171
171
  * See the LICENSE file in the root directory of this source tree.
172
172
  */
173
- const On = [
173
+ const Vn = [
174
174
  ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
175
175
  ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
176
- ], Pn = R("link", On);
176
+ ], Kn = S("link", Vn);
177
177
  /**
178
178
  * @license lucide-react v1.22.0 - ISC
179
179
  *
180
180
  * This source code is licensed under the ISC license.
181
181
  * See the LICENSE file in the root directory of this source tree.
182
182
  */
183
- const jn = [
183
+ const Wn = [
184
184
  ["path", { d: "M11 5h10", key: "1cz7ny" }],
185
185
  ["path", { d: "M11 12h10", key: "1438ji" }],
186
186
  ["path", { d: "M11 19h10", key: "11t30w" }],
187
187
  ["path", { d: "M4 4h1v5", key: "10yrso" }],
188
188
  ["path", { d: "M4 9h2", key: "r1h2o0" }],
189
189
  ["path", { d: "M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02", key: "xtkcd5" }]
190
- ], Bn = R("list-ordered", jn);
190
+ ], Xn = S("list-ordered", Wn);
191
191
  /**
192
192
  * @license lucide-react v1.22.0 - ISC
193
193
  *
194
194
  * This source code is licensed under the ISC license.
195
195
  * See the LICENSE file in the root directory of this source tree.
196
196
  */
197
- const Fn = [
197
+ const Zn = [
198
198
  ["path", { d: "M3 5h.01", key: "18ugdj" }],
199
199
  ["path", { d: "M3 12h.01", key: "nlz23k" }],
200
200
  ["path", { d: "M3 19h.01", key: "noohij" }],
201
201
  ["path", { d: "M8 5h13", key: "1pao27" }],
202
202
  ["path", { d: "M8 12h13", key: "1za7za" }],
203
203
  ["path", { d: "M8 19h13", key: "m83p4d" }]
204
- ], Gn = R("list", Fn);
204
+ ], Un = S("list", Zn);
205
205
  /**
206
206
  * @license lucide-react v1.22.0 - ISC
207
207
  *
208
208
  * This source code is licensed under the ISC license.
209
209
  * See the LICENSE file in the root directory of this source tree.
210
210
  */
211
- const Vn = [
211
+ const Qn = [
212
212
  ["path", { d: "M11 7 6 2", key: "1jwth8" }],
213
213
  ["path", { d: "M18.992 12H2.041", key: "xw1gg" }],
214
214
  [
@@ -225,25 +225,25 @@ const Vn = [
225
225
  key: "1nk1rd"
226
226
  }
227
227
  ]
228
- ], Kn = R("paint-bucket", Vn);
228
+ ], Yn = S("paint-bucket", Qn);
229
229
  /**
230
230
  * @license lucide-react v1.22.0 - ISC
231
231
  *
232
232
  * This source code is licensed under the ISC license.
233
233
  * See the LICENSE file in the root directory of this source tree.
234
234
  */
235
- const Wn = [
235
+ const Jn = [
236
236
  ["rect", { width: "16", height: "6", x: "2", y: "2", rx: "2", key: "jcyz7m" }],
237
237
  ["path", { d: "M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2", key: "1b9h7c" }],
238
238
  ["rect", { width: "4", height: "6", x: "8", y: "16", rx: "1", key: "d6e7yl" }]
239
- ], Xn = R("paint-roller", Wn);
239
+ ], eo = S("paint-roller", Jn);
240
240
  /**
241
241
  * @license lucide-react v1.22.0 - ISC
242
242
  *
243
243
  * This source code is licensed under the ISC license.
244
244
  * See the LICENSE file in the root directory of this source tree.
245
245
  */
246
- const Zn = [
246
+ const to = [
247
247
  [
248
248
  "path",
249
249
  {
@@ -255,68 +255,68 @@ const Zn = [
255
255
  ["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
256
256
  ["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
257
257
  ["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }]
258
- ], Un = R("palette", Zn);
258
+ ], ro = S("palette", to);
259
259
  /**
260
260
  * @license lucide-react v1.22.0 - ISC
261
261
  *
262
262
  * This source code is licensed under the ISC license.
263
263
  * See the LICENSE file in the root directory of this source tree.
264
264
  */
265
- const Qn = [
265
+ const no = [
266
266
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
267
267
  ["path", { d: "M9 3v18", key: "fh3hqa" }]
268
- ], Yn = R("panel-left", Qn);
268
+ ], oo = S("panel-left", no);
269
269
  /**
270
270
  * @license lucide-react v1.22.0 - ISC
271
271
  *
272
272
  * This source code is licensed under the ISC license.
273
273
  * See the LICENSE file in the root directory of this source tree.
274
274
  */
275
- const Jn = [
275
+ const ao = [
276
276
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
277
277
  ["path", { d: "M15 3v18", key: "14nvp0" }]
278
- ], eo = R("panel-right", Jn);
278
+ ], io = S("panel-right", ao);
279
279
  /**
280
280
  * @license lucide-react v1.22.0 - ISC
281
281
  *
282
282
  * This source code is licensed under the ISC license.
283
283
  * See the LICENSE file in the root directory of this source tree.
284
284
  */
285
- const to = [
285
+ const so = [
286
286
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
287
287
  ["path", { d: "M14 9h1", key: "l0svgy" }],
288
288
  ["path", { d: "M19 9h2", key: "te2zfg" }],
289
289
  ["path", { d: "M3 9h2", key: "1h4ldw" }],
290
290
  ["path", { d: "M9 9h1", key: "15jzuz" }]
291
- ], ro = R("panel-top-dashed", to);
291
+ ], lo = S("panel-top-dashed", so);
292
292
  /**
293
293
  * @license lucide-react v1.22.0 - ISC
294
294
  *
295
295
  * This source code is licensed under the ISC license.
296
296
  * See the LICENSE file in the root directory of this source tree.
297
297
  */
298
- const no = [
298
+ const co = [
299
299
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
300
300
  ["path", { d: "M3 9h18", key: "1pudct" }]
301
- ], oo = R("panel-top", no);
301
+ ], uo = S("panel-top", co);
302
302
  /**
303
303
  * @license lucide-react v1.22.0 - ISC
304
304
  *
305
305
  * This source code is licensed under the ISC license.
306
306
  * See the LICENSE file in the root directory of this source tree.
307
307
  */
308
- const ao = [
308
+ const mo = [
309
309
  ["path", { d: "M13 4v16", key: "8vvj80" }],
310
310
  ["path", { d: "M17 4v16", key: "7dpous" }],
311
311
  ["path", { d: "M19 4H9.5a4.5 4.5 0 0 0 0 9H13", key: "sh4n9v" }]
312
- ], io = R("pilcrow", ao);
312
+ ], fo = S("pilcrow", mo);
313
313
  /**
314
314
  * @license lucide-react v1.22.0 - ISC
315
315
  *
316
316
  * This source code is licensed under the ISC license.
317
317
  * See the LICENSE file in the root directory of this source tree.
318
318
  */
319
- const so = [
319
+ const go = [
320
320
  [
321
321
  "path",
322
322
  {
@@ -331,101 +331,101 @@ const so = [
331
331
  key: "1ymkrd"
332
332
  }
333
333
  ]
334
- ], lo = R("quote", so);
334
+ ], ho = S("quote", go);
335
335
  /**
336
336
  * @license lucide-react v1.22.0 - ISC
337
337
  *
338
338
  * This source code is licensed under the ISC license.
339
339
  * See the LICENSE file in the root directory of this source tree.
340
340
  */
341
- const co = [
341
+ const po = [
342
342
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
343
343
  ["path", { d: "M3 12h18", key: "1i2n21" }]
344
- ], uo = R("rows-2", co);
344
+ ], bo = S("rows-2", po);
345
345
  /**
346
346
  * @license lucide-react v1.22.0 - ISC
347
347
  *
348
348
  * This source code is licensed under the ISC license.
349
349
  * See the LICENSE file in the root directory of this source tree.
350
350
  */
351
- const mo = [
351
+ const yo = [
352
352
  ["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
353
353
  ["path", { d: "M8 12h8", key: "1wcyev" }],
354
354
  ["path", { d: "m16 20 2 2 4-4", key: "13tcca" }]
355
- ], go = R("spell-check", mo);
355
+ ], vo = S("spell-check", yo);
356
356
  /**
357
357
  * @license lucide-react v1.22.0 - ISC
358
358
  *
359
359
  * This source code is licensed under the ISC license.
360
360
  * See the LICENSE file in the root directory of this source tree.
361
361
  */
362
- const fo = [
362
+ const wo = [
363
363
  ["path", { d: "M16 4H9a3 3 0 0 0-2.83 4", key: "43sutm" }],
364
364
  ["path", { d: "M14 12a4 4 0 0 1 0 8H6", key: "nlfj13" }],
365
365
  ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }]
366
- ], ho = R("strikethrough", fo);
366
+ ], xo = S("strikethrough", wo);
367
367
  /**
368
368
  * @license lucide-react v1.22.0 - ISC
369
369
  *
370
370
  * This source code is licensed under the ISC license.
371
371
  * See the LICENSE file in the root directory of this source tree.
372
372
  */
373
- const po = [
373
+ const ko = [
374
374
  ["path", { d: "M12 3v18", key: "108xh3" }],
375
375
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
376
376
  ["path", { d: "M3 9h18", key: "1pudct" }],
377
377
  ["path", { d: "M3 15h18", key: "5xshup" }]
378
- ], bo = R("table", po);
378
+ ], Co = S("table", ko);
379
379
  /**
380
380
  * @license lucide-react v1.22.0 - ISC
381
381
  *
382
382
  * This source code is licensed under the ISC license.
383
383
  * See the LICENSE file in the root directory of this source tree.
384
384
  */
385
- const yo = [
385
+ const No = [
386
386
  ["path", { d: "M21 5H3", key: "1fi0y6" }],
387
387
  ["path", { d: "M17 12H7", key: "16if0g" }],
388
388
  ["path", { d: "M19 19H5", key: "vjpgq2" }]
389
- ], vo = R("text-align-center", yo);
389
+ ], To = S("text-align-center", No);
390
390
  /**
391
391
  * @license lucide-react v1.22.0 - ISC
392
392
  *
393
393
  * This source code is licensed under the ISC license.
394
394
  * See the LICENSE file in the root directory of this source tree.
395
395
  */
396
- const wo = [
396
+ const Ao = [
397
397
  ["path", { d: "M21 5H3", key: "1fi0y6" }],
398
398
  ["path", { d: "M21 12H9", key: "dn1m92" }],
399
399
  ["path", { d: "M21 19H7", key: "4cu937" }]
400
- ], xo = R("text-align-end", wo);
400
+ ], zo = S("text-align-end", Ao);
401
401
  /**
402
402
  * @license lucide-react v1.22.0 - ISC
403
403
  *
404
404
  * This source code is licensed under the ISC license.
405
405
  * See the LICENSE file in the root directory of this source tree.
406
406
  */
407
- const ko = [
407
+ const Ro = [
408
408
  ["path", { d: "M21 5H3", key: "1fi0y6" }],
409
409
  ["path", { d: "M15 12H3", key: "6jk70r" }],
410
410
  ["path", { d: "M17 19H3", key: "z6ezky" }]
411
- ], Co = R("text-align-start", ko);
411
+ ], _o = S("text-align-start", Ro);
412
412
  /**
413
413
  * @license lucide-react v1.22.0 - ISC
414
414
  *
415
415
  * This source code is licensed under the ISC license.
416
416
  * See the LICENSE file in the root directory of this source tree.
417
417
  */
418
- const No = [
418
+ const Mo = [
419
419
  ["path", { d: "M6 4v6a6 6 0 0 0 12 0V4", key: "9kb039" }],
420
420
  ["line", { x1: "4", x2: "20", y1: "20", y2: "20", key: "nun2al" }]
421
- ], To = R("underline", No);
421
+ ], Eo = S("underline", Mo);
422
422
  /**
423
423
  * @license lucide-react v1.22.0 - ISC
424
424
  *
425
425
  * This source code is licensed under the ISC license.
426
426
  * See the LICENSE file in the root directory of this source tree.
427
427
  */
428
- const Ao = [
428
+ const So = [
429
429
  [
430
430
  "path",
431
431
  {
@@ -433,7 +433,7 @@ const Ao = [
433
433
  key: "1ngwbx"
434
434
  }
435
435
  ]
436
- ], zo = R("wrench", Ao), Mo = {
436
+ ], Lo = S("wrench", So), Io = {
437
437
  id: "rich-text-editor",
438
438
  capabilities: ["edit_inline"],
439
439
  state: {
@@ -570,7 +570,7 @@ const Ao = [
570
570
  description: "Sourced from the id prop."
571
571
  }
572
572
  }
573
- }, _o = "ds:aria-pressed:!bg-[var(--destructive)] ds:aria-pressed:!text-[var(--destructive-foreground)]", ze = "ds:!size-[var(--min-target-size)]", Eo = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", Ro = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]", cr = [
573
+ }, $o = "ds:aria-pressed:!bg-[var(--destructive)] ds:aria-pressed:!text-[var(--destructive-foreground)]", _e = "ds:!size-[var(--min-target-size)]", Ho = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", Do = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]", fr = [
574
574
  "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
575
575
  "ds:bg-[color-mix(in_srgb,var(--background)_70%,transparent)]",
576
576
  "ds:p-[var(--spacing-sm)] ds:[max-block-size:10rem] ds:overflow-y-auto",
@@ -584,91 +584,91 @@ const Ao = [
584
584
  "ds:[&_ul]:list-disc ds:[&_ol]:list-decimal",
585
585
  "ds:[&_ul]:ps-[var(--spacing-md)] ds:[&_ol]:ps-[var(--spacing-md)]"
586
586
  ].join(" ");
587
- function dr(o, i) {
587
+ function gr(o, i) {
588
588
  return i ? o ? /\s$/.test(o) ? `${o}${i}` : `${o} ${i}` : i : o;
589
589
  }
590
- function So({
590
+ function Oo({
591
591
  open: o,
592
592
  onClose: i,
593
- onRequestAiDraft: h,
594
- onInsert: g,
595
- previewAsHtml: f = !0,
593
+ onRequestAiDraft: m,
594
+ onInsert: c,
595
+ previewAsHtml: g = !0,
596
596
  privacyNotice: l,
597
- onDictate: v
597
+ onDictate: b
598
598
  }) {
599
- const { t: u } = ne(), b = _e(), C = _e(), [z, $] = A(""), [L, _] = A(!1), [F, m] = A(!1), [c, p] = A(null), E = M(null), [T, H] = A(!1), [y, q] = A(""), [O, U] = A(""), X = M(null), P = x(() => {
600
- var j;
601
- (j = X.current) == null || j.abort();
602
- }, []), ae = x(() => {
603
- if (!v) return;
604
- const j = new AbortController();
605
- X.current = j, H(!0), q(""), U(u("editor.ai.listening")), v({
606
- signal: j.signal,
607
- onPartialTranscript: (K) => {
608
- j.signal.aborted || q(K);
599
+ const { t: d } = se(), p = Ee(), C = Ee(), [R, $] = z(""), [L, M] = z(!1), [G, h] = z(!1), [u, y] = z(null), E = T(null), [A, H] = z(!1), [w, O] = z(""), [q, U] = z(""), X = T(null), P = x(() => {
600
+ var F;
601
+ (F = X.current) == null || F.abort();
602
+ }, []), ne = x(() => {
603
+ if (!b) return;
604
+ const F = new AbortController();
605
+ X.current = F, H(!0), O(""), U(d("editor.ai.listening")), b({
606
+ signal: F.signal,
607
+ onPartialTranscript: (W) => {
608
+ F.signal.aborted || O(W);
609
609
  },
610
- onFinalTranscript: (K) => {
611
- if (j.signal.aborted) return;
612
- const ee = K.trim();
613
- q(""), ee && ($((N) => dr(N, ee)), U(ee));
610
+ onFinalTranscript: (W) => {
611
+ if (F.signal.aborted) return;
612
+ const oe = W.trim();
613
+ O(""), oe && ($((N) => gr(N, oe)), U(oe));
614
614
  }
615
615
  }).catch(() => {
616
616
  }).finally(() => {
617
- q(""), X.current === j && (X.current = null, H(!1), U(""));
617
+ O(""), X.current === F && (X.current = null, H(!1), U(""));
618
618
  });
619
- }, [v, u]), be = x(() => {
620
- T ? P() : ae();
621
- }, [T, ae, P]);
619
+ }, [b, d]), we = x(() => {
620
+ A ? P() : ne();
621
+ }, [A, ne, P]);
622
622
  I(() => {
623
- var j, K;
624
- o ? ($(""), _(!1), m(!1), p(null), q(""), U("")) : ((j = E.current) == null || j.abort(), E.current = null, (K = X.current) == null || K.abort());
623
+ var F, W;
624
+ o ? ($(""), M(!1), h(!1), y(null), O(""), U("")) : ((F = E.current) == null || F.abort(), E.current = null, (W = X.current) == null || W.abort());
625
625
  }, [o]), I(
626
626
  () => () => {
627
- var j, K;
628
- (j = E.current) == null || j.abort(), (K = X.current) == null || K.abort();
627
+ var F, W;
628
+ (F = E.current) == null || F.abort(), (W = X.current) == null || W.abort();
629
629
  },
630
630
  []
631
631
  );
632
- const B = x(() => {
633
- var ee;
634
- const j = z.trim();
635
- if (!j || L) return;
636
- P(), (ee = E.current) == null || ee.abort();
637
- const K = new AbortController();
638
- E.current = K, m(!1), _(!0), h({ prompt: j, signal: K.signal }).then((N) => {
639
- K.signal.aborted || (p(N), _(!1));
632
+ const j = x(() => {
633
+ var oe;
634
+ const F = R.trim();
635
+ if (!F || L) return;
636
+ P(), (oe = E.current) == null || oe.abort();
637
+ const W = new AbortController();
638
+ E.current = W, h(!1), M(!0), m({ prompt: F, signal: W.signal }).then((N) => {
639
+ W.signal.aborted || (y(N), M(!1));
640
640
  }).catch((N) => {
641
- K.signal.aborted || N && typeof N == "object" && "name" in N && N.name === "AbortError" || (m(!0), _(!1));
641
+ W.signal.aborted || N && typeof N == "object" && "name" in N && N.name === "AbortError" || (h(!0), M(!1));
642
642
  });
643
- }, [z, L, h, P]), Q = x(() => {
644
- c != null && (g(c), i());
645
- }, [c, g, i]), Ee = c != null, D = T ? dr(z, y) : z;
643
+ }, [R, L, m, P]), Q = x(() => {
644
+ u != null && (c(u), i());
645
+ }, [u, c, i]), Se = u != null, D = A ? gr(R, w) : R;
646
646
  return /* @__PURE__ */ t(
647
- br,
647
+ Cr,
648
648
  {
649
649
  open: o,
650
650
  onClose: i,
651
- ariaLabel: u("editor.ai.dialogTitle"),
652
- children: Ee ? /* @__PURE__ */ k("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
651
+ ariaLabel: d("editor.ai.dialogTitle"),
652
+ children: Se ? /* @__PURE__ */ k("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
653
653
  /* @__PURE__ */ t(
654
- G,
654
+ V,
655
655
  {
656
656
  size: "md",
657
657
  intent: "outline",
658
- className: ze,
659
- icon: /* @__PURE__ */ t(lr, {}),
660
- "aria-label": u("common.close"),
658
+ className: _e,
659
+ icon: /* @__PURE__ */ t(mr, {}),
660
+ "aria-label": d("common.close"),
661
661
  onClick: i
662
662
  }
663
663
  ),
664
- /* @__PURE__ */ t("div", { className: "ds:min-w-0 ds:flex-1", children: f ? /* @__PURE__ */ t(
665
- Jr,
664
+ /* @__PURE__ */ t("div", { className: "ds:min-w-0 ds:flex-1", children: g ? /* @__PURE__ */ t(
665
+ an,
666
666
  {
667
- html: c,
667
+ html: u,
668
668
  profile: "rich-text",
669
- className: cr,
669
+ className: fr,
670
670
  tabIndex: 0,
671
- "aria-label": u("editor.ai.dialogTitle")
671
+ "aria-label": d("editor.ai.dialogTitle")
672
672
  }
673
673
  ) : (
674
674
  // Focusable so a keyboard user can scroll a long draft preview
@@ -676,161 +676,161 @@ function So({
676
676
  // tabIndex allowlist doesn't cover a scrollable, non-interactive
677
677
  // text region.
678
678
  // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
679
- /* @__PURE__ */ t("p", { className: cr, tabIndex: 0, children: c })
679
+ /* @__PURE__ */ t("p", { className: fr, tabIndex: 0, children: u })
680
680
  ) }),
681
681
  /* @__PURE__ */ t(
682
- G,
682
+ V,
683
683
  {
684
684
  size: "md",
685
685
  intent: "outline",
686
- className: `${ze} ds:rounded-full`,
687
- icon: /* @__PURE__ */ t(on, {}),
688
- "aria-label": u("editor.ai.retry"),
689
- onClick: () => p(null)
686
+ className: `${_e} ds:rounded-full`,
687
+ icon: /* @__PURE__ */ t(un, {}),
688
+ "aria-label": d("editor.ai.retry"),
689
+ onClick: () => y(null)
690
690
  }
691
691
  ),
692
692
  /* @__PURE__ */ t(
693
- G,
693
+ V,
694
694
  {
695
695
  size: "md",
696
696
  intent: "primary",
697
- className: `${ze} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
698
- icon: /* @__PURE__ */ t(an, {}),
699
- "aria-label": u("common.confirm"),
697
+ className: `${_e} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
698
+ icon: /* @__PURE__ */ t(mn, {}),
699
+ "aria-label": d("common.confirm"),
700
700
  onClick: Q
701
701
  }
702
702
  )
703
703
  ] }) : /* @__PURE__ */ k(Me, { children: [
704
704
  /* @__PURE__ */ k("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
705
705
  /* @__PURE__ */ t(
706
- G,
706
+ V,
707
707
  {
708
708
  size: "md",
709
709
  intent: "outline",
710
- className: ze,
711
- icon: /* @__PURE__ */ t(lr, {}),
712
- "aria-label": u("common.close"),
710
+ className: _e,
711
+ icon: /* @__PURE__ */ t(mr, {}),
712
+ "aria-label": d("common.close"),
713
713
  onClick: i
714
714
  }
715
715
  ),
716
716
  /* @__PURE__ */ t("div", { className: "ds:min-w-0 ds:flex-1", children: /* @__PURE__ */ t(
717
- nn,
717
+ dn,
718
718
  {
719
- id: b,
719
+ id: p,
720
720
  size: "md",
721
721
  value: D,
722
- onChange: (j) => $(j.target.value),
723
- placeholder: u("editor.ai.promptPlaceholder"),
724
- "aria-label": u("editor.ai.promptLabel"),
722
+ onChange: (F) => $(F.target.value),
723
+ placeholder: d("editor.ai.promptPlaceholder"),
724
+ "aria-label": d("editor.ai.promptLabel"),
725
725
  autoResize: !0,
726
726
  minRows: 1,
727
727
  maxRows: 3,
728
- readOnly: T,
729
- tone: F ? "error" : "default",
730
- "aria-describedby": F ? C : void 0
728
+ readOnly: A,
729
+ tone: G ? "error" : "default",
730
+ "aria-describedby": G ? C : void 0
731
731
  }
732
732
  ) }),
733
- v ? /* @__PURE__ */ t(
734
- G,
733
+ b ? /* @__PURE__ */ t(
734
+ V,
735
735
  {
736
736
  size: "md",
737
737
  intent: "outline",
738
- className: T ? `${ze} ${_o}` : ze,
739
- icon: T ? /* @__PURE__ */ t(gt, { className: "ds:fill-current" }) : /* @__PURE__ */ t(yr, {}),
740
- "aria-pressed": T,
741
- "aria-label": u(T ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
742
- onClick: be
738
+ className: A ? `${_e} ${$o}` : _e,
739
+ icon: A ? /* @__PURE__ */ t(pt, { className: "ds:fill-current" }) : /* @__PURE__ */ t(Nr, {}),
740
+ "aria-pressed": A,
741
+ "aria-label": d(A ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
742
+ onClick: we
743
743
  }
744
744
  ) : null,
745
745
  /* @__PURE__ */ t(
746
- G,
746
+ V,
747
747
  {
748
748
  size: "md",
749
749
  intent: "primary",
750
- icon: L ? /* @__PURE__ */ t(pr, { size: "sm", variant: "pulse" }) : /* @__PURE__ */ t(sn, {}),
751
- className: `${ze} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
752
- disabled: L || !z.trim(),
750
+ icon: L ? /* @__PURE__ */ t(kr, { size: "sm", variant: "pulse" }) : /* @__PURE__ */ t(fn, {}),
751
+ className: `${_e} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
752
+ disabled: L || !R.trim(),
753
753
  "aria-busy": L || void 0,
754
- "aria-label": u("editor.ai.generate"),
755
- onClick: B
754
+ "aria-label": d("editor.ai.generate"),
755
+ onClick: j
756
756
  }
757
757
  )
758
758
  ] }),
759
- v ? /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: O }) : null,
760
- F ? /* @__PURE__ */ t("p", { id: C, role: "alert", className: Ro, children: u("editor.ai.error") }) : l ? /* @__PURE__ */ t("p", { className: Eo, children: l }) : null
759
+ b ? /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: q }) : null,
760
+ G ? /* @__PURE__ */ t("p", { id: C, role: "alert", className: Do, children: d("editor.ai.error") }) : l ? /* @__PURE__ */ t("p", { className: Ho, children: l }) : null
761
761
  ] })
762
762
  }
763
763
  );
764
764
  }
765
- const Lo = {
765
+ const qo = {
766
766
  bold: {
767
767
  id: "bold",
768
- icon: /* @__PURE__ */ t(Mn, {}),
768
+ icon: /* @__PURE__ */ t(In, {}),
769
769
  label: ["editor.bold", "Bold"],
770
770
  command: ["module.inline.format", { tag: "b" }],
771
771
  toggle: "bold"
772
772
  },
773
773
  italic: {
774
774
  id: "italic",
775
- icon: /* @__PURE__ */ t(qn, {}),
775
+ icon: /* @__PURE__ */ t(Gn, {}),
776
776
  label: ["editor.italic", "Italic"],
777
777
  command: ["module.inline.format", { tag: "i" }],
778
778
  toggle: "italic"
779
779
  },
780
780
  underline: {
781
781
  id: "underline",
782
- icon: /* @__PURE__ */ t(To, {}),
782
+ icon: /* @__PURE__ */ t(Eo, {}),
783
783
  label: ["editor.underline", "Underline"],
784
784
  command: ["module.inline.format", { tag: "u" }],
785
785
  toggle: "underline"
786
786
  },
787
787
  strike: {
788
788
  id: "strike",
789
- icon: /* @__PURE__ */ t(ho, {}),
789
+ icon: /* @__PURE__ */ t(xo, {}),
790
790
  label: ["editor.strike", "Strikethrough"],
791
791
  command: ["module.inline.format", { tag: "del" }],
792
792
  toggle: "strike"
793
793
  },
794
794
  ul: {
795
795
  id: "ul",
796
- icon: /* @__PURE__ */ t(Gn, {}),
796
+ icon: /* @__PURE__ */ t(Un, {}),
797
797
  label: ["editor.list.bullet", "Bulleted list"],
798
798
  command: ["module.list.toggle", "ul"],
799
799
  toggle: "ul"
800
800
  },
801
801
  ol: {
802
802
  id: "ol",
803
- icon: /* @__PURE__ */ t(Bn, {}),
803
+ icon: /* @__PURE__ */ t(Xn, {}),
804
804
  label: ["editor.list.ordered", "Numbered list"],
805
805
  command: ["module.list.toggle", "ol"],
806
806
  toggle: "ol"
807
807
  }
808
- }, St = [
808
+ }, Ht = [
809
809
  {
810
810
  id: "paragraph",
811
811
  tag: "p",
812
- icon: /* @__PURE__ */ t(io, {}),
812
+ icon: /* @__PURE__ */ t(fo, {}),
813
813
  label: ["editor.paragraph", "Paragraph"]
814
814
  },
815
815
  {
816
816
  id: "h2",
817
817
  tag: "h2",
818
- icon: /* @__PURE__ */ t(In, {}),
818
+ icon: /* @__PURE__ */ t(Pn, {}),
819
819
  label: ["editor.heading2", "Heading 2"]
820
820
  },
821
821
  {
822
822
  id: "h3",
823
823
  tag: "h3",
824
- icon: /* @__PURE__ */ t(Hn, {}),
824
+ icon: /* @__PURE__ */ t(jn, {}),
825
825
  label: ["editor.heading3", "Heading 3"]
826
826
  },
827
827
  {
828
828
  id: "quote",
829
829
  tag: "blockquote",
830
- icon: /* @__PURE__ */ t(lo, {}),
830
+ icon: /* @__PURE__ */ t(ho, {}),
831
831
  label: ["editor.quote", "Quote"]
832
832
  }
833
- ], Io = {
833
+ ], Po = {
834
834
  minimal: ["bold", "italic", "underline", "link"],
835
835
  standard: [
836
836
  "format",
@@ -843,109 +843,109 @@ const Lo = {
843
843
  "link"
844
844
  ],
845
845
  full: ["format", "bold", "italic", "underline", "strike", "ul", "ol", "link"]
846
- }, wr = [
846
+ }, Ar = [
847
847
  {
848
848
  id: "rowAbove",
849
849
  command: "plugin.table.addRowAbove",
850
- icon: /* @__PURE__ */ t(kn, {}),
850
+ icon: /* @__PURE__ */ t(Rn, {}),
851
851
  label: ["editor.table.rowAbove", "Add row above"]
852
852
  },
853
853
  {
854
854
  id: "rowBelow",
855
855
  command: "plugin.table.addRowBelow",
856
- icon: /* @__PURE__ */ t(wn, {}),
856
+ icon: /* @__PURE__ */ t(An, {}),
857
857
  label: ["editor.table.rowBelow", "Add row below"]
858
858
  },
859
859
  {
860
860
  id: "colLeft",
861
861
  command: "plugin.table.addColumnLeft",
862
- icon: /* @__PURE__ */ t(An, {}),
862
+ icon: /* @__PURE__ */ t(Sn, {}),
863
863
  label: ["editor.table.columnLeft", "Add column left"]
864
864
  },
865
865
  {
866
866
  id: "colRight",
867
867
  command: "plugin.table.addColumnRight",
868
- icon: /* @__PURE__ */ t(Nn, {}),
868
+ icon: /* @__PURE__ */ t(Mn, {}),
869
869
  label: ["editor.table.columnRight", "Add column right"]
870
870
  },
871
871
  {
872
872
  id: "addHead",
873
873
  command: "plugin.table.addHead",
874
- icon: /* @__PURE__ */ t(oo, {}),
874
+ icon: /* @__PURE__ */ t(uo, {}),
875
875
  label: ["editor.table.addHeader", "Add header row"]
876
876
  },
877
877
  {
878
878
  id: "deleteHead",
879
879
  command: "plugin.table.deleteHead",
880
- icon: /* @__PURE__ */ t(ro, {}),
880
+ icon: /* @__PURE__ */ t(lo, {}),
881
881
  label: ["editor.table.deleteHeader", "Remove header row"]
882
882
  },
883
883
  {
884
884
  id: "deleteRow",
885
885
  command: "plugin.table.deleteRow",
886
- icon: /* @__PURE__ */ t(uo, {}),
886
+ icon: /* @__PURE__ */ t(bo, {}),
887
887
  label: ["editor.table.deleteRow", "Delete row"]
888
888
  },
889
889
  {
890
890
  id: "deleteColumn",
891
891
  command: "plugin.table.deleteColumn",
892
- icon: /* @__PURE__ */ t(Sn, {}),
892
+ icon: /* @__PURE__ */ t(On, {}),
893
893
  label: ["editor.table.deleteColumn", "Delete column"]
894
894
  },
895
895
  {
896
896
  id: "deleteTable",
897
897
  command: "plugin.table.deleteTable",
898
- icon: /* @__PURE__ */ t(fn, {}),
898
+ icon: /* @__PURE__ */ t(wn, {}),
899
899
  label: ["editor.table.deleteTable", "Delete table"]
900
900
  }
901
- ], mt = 6, $o = Ot(
901
+ ], ft = 6, Fo = Ft(
902
902
  [
903
903
  "ds:@container/toolbar",
904
904
  "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
905
905
  "ds:bg-[var(--background)] ds:p-[var(--spacing-xs)]",
906
906
  "ds:shadow-[var(--shadow-md)]"
907
907
  ].join(" ")
908
- ), Ho = "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", jt = "ds:self-stretch ds:[inline-size:var(--border-width-sm)] ds:bg-[var(--border)] ds:[margin-inline:var(--spacing-2xs)]", Ge = "ds:text-[length:var(--font-size-sm)] ds:font-medium ds:text-[color:var(--foreground)]";
909
- function ht(o) {
908
+ ), jo = "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", Bt = "ds:self-stretch ds:[inline-size:var(--border-width-sm)] ds:bg-[var(--border)] ds:[margin-inline:var(--spacing-2xs)]", Ke = "ds:text-[length:var(--font-size-sm)] ds:font-medium ds:text-[color:var(--foreground)]";
909
+ function yt(o) {
910
910
  return o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
911
911
  }
912
- function Do({
912
+ function Bo({
913
913
  variables: o,
914
914
  insertVariable: i,
915
- saveSelection: h
915
+ saveSelection: m
916
916
  }) {
917
- const { t: g } = ne(), f = M(!1);
917
+ const { t: c } = se(), g = T(!1);
918
918
  return /* @__PURE__ */ k(
919
- he.Root,
919
+ ye.Root,
920
920
  {
921
921
  onOpenChange: (l) => {
922
- l && h();
922
+ l && m();
923
923
  },
924
924
  children: [
925
- /* @__PURE__ */ t(he.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
926
- G,
925
+ /* @__PURE__ */ t(ye.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
926
+ V,
927
927
  {
928
928
  size: "sm",
929
929
  intent: "ghost",
930
- icon: /* @__PURE__ */ t(En, {}),
931
- "aria-label": g("editor.insertVariable", "Insert variable")
930
+ icon: /* @__PURE__ */ t(Hn, {}),
931
+ "aria-label": c("editor.insertVariable", "Insert variable")
932
932
  }
933
933
  ) }),
934
934
  /* @__PURE__ */ k(
935
- he.Content,
935
+ ye.Content,
936
936
  {
937
937
  align: "start",
938
938
  onCloseAutoFocus: (l) => {
939
- f.current && l.preventDefault(), f.current = !1;
939
+ g.current && l.preventDefault(), g.current = !1;
940
940
  },
941
941
  children: [
942
- /* @__PURE__ */ t(he.Label, { children: g("editor.variables", "Variables") }),
942
+ /* @__PURE__ */ t(ye.Label, { children: c("editor.variables", "Variables") }),
943
943
  o.map((l) => /* @__PURE__ */ t(
944
- he.Item,
944
+ ye.Item,
945
945
  {
946
946
  description: l.description ?? `[[${l.token}]]`,
947
947
  onSelect: () => {
948
- f.current = !0, i(l.token);
948
+ g.current = !0, i(l.token);
949
949
  },
950
950
  children: l.label
951
951
  },
@@ -958,181 +958,181 @@ function Do({
958
958
  }
959
959
  );
960
960
  }
961
- function qo({
961
+ function Go({
962
962
  run: o,
963
963
  active: i,
964
- onTriggerDown: h
964
+ onTriggerDown: m
965
965
  }) {
966
- const { t: g } = ne(), f = St.find((l) => i.has(l.id)) ?? St[0];
967
- return /* @__PURE__ */ k(he.Root, { children: [
968
- /* @__PURE__ */ t(he.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
969
- pe,
966
+ const { t: c } = se(), g = Ht.find((l) => i.has(l.id)) ?? Ht[0];
967
+ return /* @__PURE__ */ k(ye.Root, { children: [
968
+ /* @__PURE__ */ t(ye.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
969
+ ve,
970
970
  {
971
971
  size: "sm",
972
972
  intent: "ghost",
973
- startIcon: f.icon,
974
- endIcon: /* @__PURE__ */ t(gn, {}),
975
- "aria-label": `${g("editor.format", "Paragraph style")}: ${g(
976
- f.label[0],
977
- f.label[1]
973
+ startIcon: g.icon,
974
+ endIcon: /* @__PURE__ */ t(vn, {}),
975
+ "aria-label": `${c("editor.format", "Paragraph style")}: ${c(
976
+ g.label[0],
977
+ g.label[1]
978
978
  )}`,
979
- onMouseDown: h,
980
- children: /* @__PURE__ */ t("span", { className: "ds:hidden ds:@[448px]/toolbar:inline", children: g(f.label[0], f.label[1]) })
979
+ onMouseDown: m,
980
+ children: /* @__PURE__ */ t("span", { className: "ds:hidden ds:@[448px]/toolbar:inline", children: c(g.label[0], g.label[1]) })
981
981
  }
982
982
  ) }),
983
- /* @__PURE__ */ t(he.Content, { align: "start", children: St.map((l) => /* @__PURE__ */ t(
984
- he.Item,
983
+ /* @__PURE__ */ t(ye.Content, { align: "start", children: Ht.map((l) => /* @__PURE__ */ t(
984
+ ye.Item,
985
985
  {
986
986
  startIcon: l.icon,
987
987
  onSelect: () => o("module.block.format", { tag: l.tag }),
988
- children: g(l.label[0], l.label[1])
988
+ children: c(l.label[0], l.label[1])
989
989
  },
990
990
  l.id
991
991
  )) })
992
992
  ] });
993
993
  }
994
- function Oo({
994
+ function Vo({
995
995
  insertHtml: o,
996
996
  saveSelection: i,
997
- restoreSelection: h,
998
- getSelectedText: g
997
+ restoreSelection: m,
998
+ getSelectedText: c
999
999
  }) {
1000
- const { t: f } = ne(), [l, v] = A(!1), [u, b] = A(""), [C, z] = A(""), [$, L] = A(!1), _ = _e(), F = _e(), m = () => {
1001
- b(""), z(""), L(!1);
1002
- }, c = () => {
1003
- const p = u.trim();
1004
- if (!p) return;
1005
- const E = C.trim() || p, T = $ ? ' target="_blank" rel="noopener noreferrer"' : "", H = `<a href="${ht(p)}"${T}>${ht(E)}</a>`;
1006
- v(!1), m(), window.requestAnimationFrame(() => {
1007
- h(), o(H);
1000
+ const { t: g } = se(), [l, b] = z(!1), [d, p] = z(""), [C, R] = z(""), [$, L] = z(!1), M = Ee(), G = Ee(), h = () => {
1001
+ p(""), R(""), L(!1);
1002
+ }, u = () => {
1003
+ const y = d.trim();
1004
+ if (!y) return;
1005
+ const E = C.trim() || y, A = $ ? ' target="_blank" rel="noopener noreferrer"' : "", H = `<a href="${yt(y)}"${A}>${yt(E)}</a>`;
1006
+ b(!1), h(), window.requestAnimationFrame(() => {
1007
+ m(), o(H);
1008
1008
  });
1009
1009
  };
1010
- return /* @__PURE__ */ k(Z.Root, { open: l, onOpenChange: v, children: [
1010
+ return /* @__PURE__ */ k(Z.Root, { open: l, onOpenChange: b, children: [
1011
1011
  /* @__PURE__ */ t(Z.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1012
- G,
1012
+ V,
1013
1013
  {
1014
1014
  size: "sm",
1015
1015
  intent: "ghost",
1016
- icon: /* @__PURE__ */ t(Pn, {}),
1017
- "aria-label": f("editor.link.insert", "Insert link"),
1016
+ icon: /* @__PURE__ */ t(Kn, {}),
1017
+ "aria-label": g("editor.link.insert", "Insert link"),
1018
1018
  onMouseDown: () => {
1019
- i(), z(g());
1019
+ i(), R(c());
1020
1020
  }
1021
1021
  }
1022
1022
  ) }),
1023
1023
  /* @__PURE__ */ k(Z.Content, { children: [
1024
- /* @__PURE__ */ t(Z.Header, { children: /* @__PURE__ */ t(Z.Title, { children: f("editor.link.insert", "Insert link") }) }),
1024
+ /* @__PURE__ */ t(Z.Header, { children: /* @__PURE__ */ t(Z.Title, { children: g("editor.link.insert", "Insert link") }) }),
1025
1025
  /* @__PURE__ */ k(Z.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1026
1026
  /* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1027
- /* @__PURE__ */ t("label", { htmlFor: _, className: Ge, children: f("editor.link.url", "URL") }),
1027
+ /* @__PURE__ */ t("label", { htmlFor: M, className: Ke, children: g("editor.link.url", "URL") }),
1028
1028
  /* @__PURE__ */ t(
1029
- ft,
1029
+ bt,
1030
1030
  {
1031
- id: _,
1031
+ id: M,
1032
1032
  type: "url",
1033
- value: u,
1034
- onChange: (p) => b(p.target.value),
1033
+ value: d,
1034
+ onChange: (y) => p(y.target.value),
1035
1035
  placeholder: "https://…"
1036
1036
  }
1037
1037
  )
1038
1038
  ] }),
1039
1039
  /* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1040
- /* @__PURE__ */ t("label", { htmlFor: F, className: Ge, children: f("editor.link.text", "Text to display") }),
1040
+ /* @__PURE__ */ t("label", { htmlFor: G, className: Ke, children: g("editor.link.text", "Text to display") }),
1041
1041
  /* @__PURE__ */ t(
1042
- ft,
1042
+ bt,
1043
1043
  {
1044
- id: F,
1044
+ id: G,
1045
1045
  value: C,
1046
- onChange: (p) => z(p.target.value),
1047
- placeholder: f("editor.link.textPlaceholder", "Link text")
1046
+ onChange: (y) => R(y.target.value),
1047
+ placeholder: g("editor.link.textPlaceholder", "Link text")
1048
1048
  }
1049
1049
  )
1050
1050
  ] }),
1051
1051
  /* @__PURE__ */ t(
1052
- ln,
1052
+ gn,
1053
1053
  {
1054
1054
  checked: $,
1055
- onCheckedChange: (p) => L(p === !0),
1056
- label: f("editor.link.newTab", "Open in new tab")
1055
+ onCheckedChange: (y) => L(y === !0),
1056
+ label: g("editor.link.newTab", "Open in new tab")
1057
1057
  }
1058
1058
  )
1059
1059
  ] }),
1060
1060
  /* @__PURE__ */ k(Z.Footer, { children: [
1061
- /* @__PURE__ */ t(Z.Close, { asChild: !0, children: /* @__PURE__ */ t(pe, { intent: "secondary", children: f("common.cancel") }) }),
1062
- /* @__PURE__ */ t(pe, { onClick: c, disabled: !u.trim(), children: f("editor.link.insertAction", "Insert") })
1061
+ /* @__PURE__ */ t(Z.Close, { asChild: !0, children: /* @__PURE__ */ t(ve, { intent: "secondary", children: g("common.cancel") }) }),
1062
+ /* @__PURE__ */ t(ve, { onClick: u, disabled: !d.trim(), children: g("editor.link.insertAction", "Insert") })
1063
1063
  ] })
1064
1064
  ] })
1065
1065
  ] });
1066
1066
  }
1067
- function Po({
1067
+ function Ko({
1068
1068
  insertHtml: o,
1069
1069
  saveSelection: i,
1070
- restoreSelection: h,
1071
- uploadImage: g
1070
+ restoreSelection: m,
1071
+ uploadImage: c
1072
1072
  }) {
1073
- const { t: f } = ne(), [l, v] = A(!1), [u, b] = A(""), [C, z] = A(""), $ = _e(), L = _e(), _ = (m, c) => {
1074
- const p = `<img src="${ht(m)}" alt="${ht(c)}" loading="lazy">`;
1075
- v(!1), b(""), z(""), window.requestAnimationFrame(() => {
1076
- h(), o(p);
1073
+ const { t: g } = se(), [l, b] = z(!1), [d, p] = z(""), [C, R] = z(""), $ = Ee(), L = Ee(), M = (h, u) => {
1074
+ const y = `<img src="${yt(h)}" alt="${yt(u)}" loading="lazy">`;
1075
+ b(!1), p(""), R(""), window.requestAnimationFrame(() => {
1076
+ m(), o(y);
1077
1077
  });
1078
- }, F = () => {
1079
- const m = u.trim();
1080
- m && _(m, C.trim());
1078
+ }, G = () => {
1079
+ const h = d.trim();
1080
+ h && M(h, C.trim());
1081
1081
  };
1082
- return /* @__PURE__ */ k(Z.Root, { open: l, onOpenChange: v, children: [
1082
+ return /* @__PURE__ */ k(Z.Root, { open: l, onOpenChange: b, children: [
1083
1083
  /* @__PURE__ */ t(Z.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1084
- G,
1084
+ V,
1085
1085
  {
1086
1086
  size: "sm",
1087
1087
  intent: "ghost",
1088
- icon: /* @__PURE__ */ t(mn, {}),
1089
- "aria-label": f("editor.image.insert", "Insert image"),
1088
+ icon: /* @__PURE__ */ t(yn, {}),
1089
+ "aria-label": g("editor.image.insert", "Insert image"),
1090
1090
  onMouseDown: () => i()
1091
1091
  }
1092
1092
  ) }),
1093
1093
  /* @__PURE__ */ k(Z.Content, { children: [
1094
- /* @__PURE__ */ t(Z.Header, { children: /* @__PURE__ */ t(Z.Title, { children: f("editor.image.insert", "Insert image") }) }),
1094
+ /* @__PURE__ */ t(Z.Header, { children: /* @__PURE__ */ t(Z.Title, { children: g("editor.image.insert", "Insert image") }) }),
1095
1095
  /* @__PURE__ */ k(Z.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1096
- g ? /* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1097
- /* @__PURE__ */ t("span", { className: Ge, children: f("editor.image.upload", "Upload") }),
1096
+ c ? /* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1097
+ /* @__PURE__ */ t("span", { className: Ke, children: g("editor.image.upload", "Upload") }),
1098
1098
  /* @__PURE__ */ t(
1099
- cn,
1099
+ hn,
1100
1100
  {
1101
1101
  variant: "dropzone",
1102
1102
  accept: {
1103
1103
  "image/*": [".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg"]
1104
1104
  },
1105
1105
  maxFiles: 1,
1106
- onUpload: async (m, { signal: c }) => {
1107
- const p = await g(m, c);
1108
- _(p, m.name);
1106
+ onUpload: async (h, { signal: u }) => {
1107
+ const y = await c(h, u);
1108
+ M(y, h.name);
1109
1109
  }
1110
1110
  }
1111
1111
  ),
1112
- /* @__PURE__ */ t("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: f("editor.image.orUrl", "Or paste an image URL") })
1112
+ /* @__PURE__ */ t("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: g("editor.image.orUrl", "Or paste an image URL") })
1113
1113
  ] }) : null,
1114
1114
  /* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1115
- /* @__PURE__ */ t("label", { htmlFor: $, className: Ge, children: f("editor.image.url", "Image URL") }),
1115
+ /* @__PURE__ */ t("label", { htmlFor: $, className: Ke, children: g("editor.image.url", "Image URL") }),
1116
1116
  /* @__PURE__ */ t(
1117
- ft,
1117
+ bt,
1118
1118
  {
1119
1119
  id: $,
1120
1120
  type: "url",
1121
- value: u,
1122
- onChange: (m) => b(m.target.value),
1121
+ value: d,
1122
+ onChange: (h) => p(h.target.value),
1123
1123
  placeholder: "https://…"
1124
1124
  }
1125
1125
  )
1126
1126
  ] }),
1127
1127
  /* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1128
- /* @__PURE__ */ t("label", { htmlFor: L, className: Ge, children: f("editor.image.alt", "Alt text") }),
1128
+ /* @__PURE__ */ t("label", { htmlFor: L, className: Ke, children: g("editor.image.alt", "Alt text") }),
1129
1129
  /* @__PURE__ */ t(
1130
- ft,
1130
+ bt,
1131
1131
  {
1132
1132
  id: L,
1133
1133
  value: C,
1134
- onChange: (m) => z(m.target.value),
1135
- placeholder: f(
1134
+ onChange: (h) => R(h.target.value),
1135
+ placeholder: g(
1136
1136
  "editor.image.altPlaceholder",
1137
1137
  "Describe the image"
1138
1138
  )
@@ -1141,126 +1141,126 @@ function Po({
1141
1141
  ] })
1142
1142
  ] }),
1143
1143
  /* @__PURE__ */ k(Z.Footer, { children: [
1144
- /* @__PURE__ */ t(Z.Close, { asChild: !0, children: /* @__PURE__ */ t(pe, { intent: "secondary", children: f("common.cancel") }) }),
1145
- /* @__PURE__ */ t(pe, { onClick: F, disabled: !u.trim(), children: f("editor.image.insertAction", "Insert") })
1144
+ /* @__PURE__ */ t(Z.Close, { asChild: !0, children: /* @__PURE__ */ t(ve, { intent: "secondary", children: g("common.cancel") }) }),
1145
+ /* @__PURE__ */ t(ve, { onClick: G, disabled: !d.trim(), children: g("editor.image.insertAction", "Insert") })
1146
1146
  ] })
1147
1147
  ] })
1148
1148
  ] });
1149
1149
  }
1150
- function jo({
1150
+ function Wo({
1151
1151
  run: o,
1152
1152
  saveSelection: i,
1153
- restoreSelection: h
1153
+ restoreSelection: m
1154
1154
  }) {
1155
- const { t: g } = ne(), [f, l] = A("#1f2a5c"), v = (b) => {
1156
- l(b), h(), o("module.inline.format", {
1155
+ const { t: c } = se(), [g, l] = z("#1f2a5c"), b = (p) => {
1156
+ l(p), m(), o("module.inline.format", {
1157
1157
  tag: "span",
1158
- style: { color: b },
1158
+ style: { color: p },
1159
1159
  type: "toggle"
1160
1160
  });
1161
- }, u = () => {
1162
- h(), o("module.inline.remove", { style: "color" });
1161
+ }, d = () => {
1162
+ m(), o("module.inline.remove", { style: "color" });
1163
1163
  };
1164
- return /* @__PURE__ */ k(V, { onOpenChange: (b) => b && i(), children: [
1165
- /* @__PURE__ */ t(V.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1166
- G,
1164
+ return /* @__PURE__ */ k(K, { onOpenChange: (p) => p && i(), children: [
1165
+ /* @__PURE__ */ t(K.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1166
+ V,
1167
1167
  {
1168
1168
  size: "sm",
1169
1169
  intent: "ghost",
1170
- icon: /* @__PURE__ */ t(Un, {}),
1171
- "aria-label": g("editor.textColor", "Text colour"),
1172
- onMouseDown: (b) => {
1173
- b.preventDefault(), i();
1170
+ icon: /* @__PURE__ */ t(ro, {}),
1171
+ "aria-label": c("editor.textColor", "Text colour"),
1172
+ onMouseDown: (p) => {
1173
+ p.preventDefault(), i();
1174
1174
  }
1175
1175
  }
1176
1176
  ) }),
1177
- /* @__PURE__ */ k(V.Content, { side: "bottom", align: "start", children: [
1178
- /* @__PURE__ */ t(V.Heading, { children: g("editor.textColor", "Text colour") }),
1177
+ /* @__PURE__ */ k(K.Content, { side: "bottom", align: "start", children: [
1178
+ /* @__PURE__ */ t(K.Heading, { children: c("editor.textColor", "Text colour") }),
1179
1179
  /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ t(
1180
- Pt,
1180
+ jt,
1181
1181
  {
1182
1182
  variant: "inline",
1183
1183
  size: "sm",
1184
- value: f,
1185
- onChange: v
1184
+ value: g,
1185
+ onChange: b
1186
1186
  }
1187
1187
  ) }),
1188
- /* @__PURE__ */ t("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ t(pe, { size: "sm", intent: "secondary", onClick: u, children: g("editor.color.remove", "Remove colour") }) })
1188
+ /* @__PURE__ */ t("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ t(ve, { size: "sm", intent: "secondary", onClick: d, children: c("editor.color.remove", "Remove colour") }) })
1189
1189
  ] })
1190
1190
  ] });
1191
1191
  }
1192
- function Bo({
1192
+ function Xo({
1193
1193
  run: o,
1194
1194
  saveSelection: i,
1195
- restoreSelection: h
1195
+ restoreSelection: m
1196
1196
  }) {
1197
- const { t: g } = ne(), [f, l] = A("#fff3a3"), v = (b) => {
1198
- l(b), h(), o("module.inline.format", {
1197
+ const { t: c } = se(), [g, l] = z("#fff3a3"), b = (p) => {
1198
+ l(p), m(), o("module.inline.format", {
1199
1199
  tag: "span",
1200
- style: { "background-color": b },
1200
+ style: { "background-color": p },
1201
1201
  type: "toggle"
1202
1202
  });
1203
- }, u = () => {
1204
- h(), o("module.inline.remove", { style: "background-color" });
1203
+ }, d = () => {
1204
+ m(), o("module.inline.remove", { style: "background-color" });
1205
1205
  };
1206
- return /* @__PURE__ */ k(V, { onOpenChange: (b) => b && i(), children: [
1207
- /* @__PURE__ */ t(V.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1208
- G,
1206
+ return /* @__PURE__ */ k(K, { onOpenChange: (p) => p && i(), children: [
1207
+ /* @__PURE__ */ t(K.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1208
+ V,
1209
1209
  {
1210
1210
  size: "sm",
1211
1211
  intent: "ghost",
1212
- icon: /* @__PURE__ */ t(un, {}),
1213
- "aria-label": g("editor.highlightColor", "Highlight"),
1214
- onMouseDown: (b) => {
1215
- b.preventDefault(), i();
1212
+ icon: /* @__PURE__ */ t(bn, {}),
1213
+ "aria-label": c("editor.highlightColor", "Highlight"),
1214
+ onMouseDown: (p) => {
1215
+ p.preventDefault(), i();
1216
1216
  }
1217
1217
  }
1218
1218
  ) }),
1219
- /* @__PURE__ */ k(V.Content, { side: "bottom", align: "start", children: [
1220
- /* @__PURE__ */ t(V.Heading, { children: g("editor.highlightColor", "Highlight") }),
1219
+ /* @__PURE__ */ k(K.Content, { side: "bottom", align: "start", children: [
1220
+ /* @__PURE__ */ t(K.Heading, { children: c("editor.highlightColor", "Highlight") }),
1221
1221
  /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ t(
1222
- Pt,
1222
+ jt,
1223
1223
  {
1224
1224
  variant: "inline",
1225
1225
  size: "sm",
1226
- value: f,
1227
- onChange: v
1226
+ value: g,
1227
+ onChange: b
1228
1228
  }
1229
1229
  ) }),
1230
- /* @__PURE__ */ t("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ t(pe, { size: "sm", intent: "secondary", onClick: u, children: g("editor.highlight.remove", "Remove highlight") }) })
1230
+ /* @__PURE__ */ t("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ t(ve, { size: "sm", intent: "secondary", onClick: d, children: c("editor.highlight.remove", "Remove highlight") }) })
1231
1231
  ] })
1232
1232
  ] });
1233
1233
  }
1234
- function Fo(o, i) {
1235
- const h = Array.from({ length: i }, () => "<td><br></td>").join("");
1236
- return `<table><tbody>${Array.from({ length: o }, () => `<tr>${h}</tr>`).join("")}</tbody></table>`;
1234
+ function Zo(o, i) {
1235
+ const m = Array.from({ length: i }, () => "<td><br></td>").join("");
1236
+ return `<table><tbody>${Array.from({ length: o }, () => `<tr>${m}</tr>`).join("")}</tbody></table>`;
1237
1237
  }
1238
- function Go({
1238
+ function Uo({
1239
1239
  run: o,
1240
1240
  insertTable: i,
1241
- active: h
1241
+ active: m
1242
1242
  }) {
1243
- const { t: g } = ne(), [f, l] = A({ r: 0, c: 0 }), v = h.has("table");
1244
- return /* @__PURE__ */ k(V, { onOpenChange: (u) => !u && l({ r: 0, c: 0 }), children: [
1245
- /* @__PURE__ */ t(V.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1246
- G,
1243
+ const { t: c } = se(), [g, l] = z({ r: 0, c: 0 }), b = m.has("table");
1244
+ return /* @__PURE__ */ k(K, { onOpenChange: (d) => !d && l({ r: 0, c: 0 }), children: [
1245
+ /* @__PURE__ */ t(K.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1246
+ V,
1247
1247
  {
1248
1248
  size: "sm",
1249
1249
  intent: "ghost",
1250
- icon: /* @__PURE__ */ t(bo, {}),
1251
- "aria-label": g("editor.table.insert", "Insert table"),
1252
- onMouseDown: (u) => u.preventDefault()
1250
+ icon: /* @__PURE__ */ t(Co, {}),
1251
+ "aria-label": c("editor.table.insert", "Insert table"),
1252
+ onMouseDown: (d) => d.preventDefault()
1253
1253
  }
1254
1254
  ) }),
1255
- /* @__PURE__ */ t(V.Content, { side: "bottom", align: "start", children: v ? (
1255
+ /* @__PURE__ */ t(K.Content, { side: "bottom", align: "start", children: b ? (
1256
1256
  // Caret is already inside a table — offer the manage ops only, never
1257
1257
  // a nested-table insert (mirrors Redactor's native dropdown, which
1258
1258
  // disables "insert table" while the caret is in a table).
1259
- /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: wr.map((u) => /* @__PURE__ */ k(
1259
+ /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: Ar.map((d) => /* @__PURE__ */ k(
1260
1260
  "button",
1261
1261
  {
1262
1262
  type: "button",
1263
- onClick: () => o(u.command),
1263
+ onClick: () => o(d.command),
1264
1264
  className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-2xs)] ds:text-start ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)] ds:hover:bg-[var(--muted)]",
1265
1265
  children: [
1266
1266
  /* @__PURE__ */ t(
@@ -1268,101 +1268,101 @@ function Go({
1268
1268
  {
1269
1269
  "aria-hidden": "true",
1270
1270
  className: "ds:inline-flex ds:size-4 ds:shrink-0 ds:items-center ds:justify-center ds:text-[color:var(--muted-foreground)]",
1271
- children: u.icon
1271
+ children: d.icon
1272
1272
  }
1273
1273
  ),
1274
- g(u.label[0], u.label[1])
1274
+ c(d.label[0], d.label[1])
1275
1275
  ]
1276
1276
  },
1277
- u.id
1277
+ d.id
1278
1278
  )) })
1279
1279
  ) : /* @__PURE__ */ k(Me, { children: [
1280
- /* @__PURE__ */ t(V.Heading, { children: g("editor.table.insert", "Insert table") }),
1280
+ /* @__PURE__ */ t(K.Heading, { children: c("editor.table.insert", "Insert table") }),
1281
1281
  /* @__PURE__ */ t(
1282
1282
  "div",
1283
1283
  {
1284
1284
  role: "group",
1285
- "aria-label": g("editor.table.sizePicker", "Table size"),
1285
+ "aria-label": c("editor.table.sizePicker", "Table size"),
1286
1286
  className: "ds:mt-[var(--spacing-sm)] ds:grid ds:w-fit ds:grid-cols-6 ds:gap-[var(--spacing-2xs)]",
1287
1287
  onMouseLeave: () => l({ r: 0, c: 0 }),
1288
- children: Array.from({ length: mt * mt }, (u, b) => {
1289
- const C = Math.floor(b / mt) + 1, z = b % mt + 1, $ = C <= f.r && z <= f.c;
1288
+ children: Array.from({ length: ft * ft }, (d, p) => {
1289
+ const C = Math.floor(p / ft) + 1, R = p % ft + 1, $ = C <= g.r && R <= g.c;
1290
1290
  return /* @__PURE__ */ t(
1291
1291
  "button",
1292
1292
  {
1293
1293
  type: "button",
1294
- "aria-label": g("editor.table.sizeCell", "{{r}}×{{c}}", {
1294
+ "aria-label": c("editor.table.sizeCell", "{{r}}×{{c}}", {
1295
1295
  r: C,
1296
- c: z
1296
+ c: R
1297
1297
  }),
1298
- onMouseEnter: () => l({ r: C, c: z }),
1299
- onClick: () => i(Fo(C, z)),
1298
+ onMouseEnter: () => l({ r: C, c: R }),
1299
+ onClick: () => i(Zo(C, R)),
1300
1300
  className: `ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ${$ ? "ds:bg-[var(--primary)]" : "ds:bg-[var(--muted)]"}`
1301
1301
  },
1302
- b
1302
+ p
1303
1303
  );
1304
1304
  })
1305
1305
  }
1306
1306
  ),
1307
- /* @__PURE__ */ t("p", { className: "ds:mt-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: f.r > 0 ? g("editor.table.sizeCell", "{{r}}×{{c}}", {
1308
- r: f.r,
1309
- c: f.c
1310
- }) : g("editor.table.sizeHint", "Pick a size") })
1307
+ /* @__PURE__ */ t("p", { className: "ds:mt-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: g.r > 0 ? c("editor.table.sizeCell", "{{r}}×{{c}}", {
1308
+ r: g.r,
1309
+ c: g.c
1310
+ }) : c("editor.table.sizeHint", "Pick a size") })
1311
1311
  ] }) })
1312
1312
  ] });
1313
1313
  }
1314
- const Vo = Object.fromEntries(wr.map((o) => [o.id, o])), Ko = [
1314
+ const Qo = Object.fromEntries(Ar.map((o) => [o.id, o])), Yo = [
1315
1315
  "ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
1316
1316
  "ds:[inset-block-start:var(--rte-tt-top)] ds:[inset-inline-start:var(--rte-tt-start)]",
1317
1317
  "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
1318
1318
  "ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]"
1319
- ].join(" "), Wo = "#fde68a";
1320
- function ur({
1319
+ ].join(" "), Jo = "#fde68a";
1320
+ function hr({
1321
1321
  scope: o,
1322
1322
  icon: i,
1323
- label: h,
1324
- onOpenChange: g,
1325
- saveTableCell: f,
1323
+ label: m,
1324
+ onOpenChange: c,
1325
+ saveTableCell: g,
1326
1326
  applyTableBackground: l
1327
1327
  }) {
1328
- const { t: v } = ne(), [u, b] = A(Wo);
1328
+ const { t: b } = se(), [d, p] = z(Jo);
1329
1329
  return /* @__PURE__ */ k(
1330
- V,
1330
+ K,
1331
1331
  {
1332
1332
  onOpenChange: (C) => {
1333
- g(C), C && f();
1333
+ c(C), C && g();
1334
1334
  },
1335
1335
  children: [
1336
- /* @__PURE__ */ t(V.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1337
- G,
1336
+ /* @__PURE__ */ t(K.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1337
+ V,
1338
1338
  {
1339
1339
  size: "sm",
1340
1340
  intent: "ghost",
1341
1341
  icon: i,
1342
- tooltip: h,
1342
+ tooltip: m,
1343
1343
  onMouseDown: (C) => C.preventDefault()
1344
1344
  }
1345
1345
  ) }),
1346
- /* @__PURE__ */ k(V.Content, { side: "bottom", align: "center", children: [
1346
+ /* @__PURE__ */ k(K.Content, { side: "bottom", align: "center", children: [
1347
1347
  /* @__PURE__ */ t(
1348
- Pt,
1348
+ jt,
1349
1349
  {
1350
1350
  variant: "inline",
1351
1351
  size: "sm",
1352
- value: u,
1352
+ value: d,
1353
1353
  onChange: (C) => {
1354
- b(C), l(o, C);
1354
+ p(C), l(o, C);
1355
1355
  }
1356
1356
  }
1357
1357
  ),
1358
1358
  /* @__PURE__ */ t(
1359
- pe,
1359
+ ve,
1360
1360
  {
1361
1361
  size: "sm",
1362
1362
  intent: "ghost",
1363
1363
  className: "ds:mt-[var(--spacing-xs)] ds:w-full",
1364
1364
  onClick: () => l(o, null),
1365
- children: v("editor.table.clearColor", "Clear colour")
1365
+ children: b("editor.table.clearColor", "Clear colour")
1366
1366
  }
1367
1367
  )
1368
1368
  ] })
@@ -1370,47 +1370,47 @@ function ur({
1370
1370
  }
1371
1371
  );
1372
1372
  }
1373
- function Xo({
1373
+ function ea({
1374
1374
  active: o,
1375
1375
  run: i,
1376
- areaRef: h,
1377
- getActiveTableEl: g,
1378
- enableColor: f = !1,
1376
+ areaRef: m,
1377
+ getActiveTableEl: c,
1378
+ enableColor: g = !1,
1379
1379
  saveTableCell: l,
1380
- applyTableBackground: v
1380
+ applyTableBackground: b
1381
1381
  }) {
1382
- const { t: u } = ne(), b = o.has("table"), [C, z] = A(null), $ = M(0), [L, _] = A(!1), F = x((c) => {
1382
+ const { t: d } = se(), p = o.has("table"), [C, R] = z(null), $ = T(0), [L, M] = z(!1), G = x((u) => {
1383
1383
  $.current = Math.max(
1384
1384
  0,
1385
- $.current + (c ? 1 : -1)
1386
- ), _($.current > 0);
1385
+ $.current + (u ? 1 : -1)
1386
+ ), M($.current > 0);
1387
1387
  }, []);
1388
1388
  if (I(() => {
1389
1389
  if (L) return;
1390
- if (!b || typeof window > "u") {
1391
- z(null);
1390
+ if (!p || typeof window > "u") {
1391
+ R(null);
1392
1392
  return;
1393
1393
  }
1394
- const c = () => {
1395
- const H = h.current, y = g();
1396
- if (!H || !y) {
1397
- z(null);
1394
+ const u = () => {
1395
+ const H = m.current, w = c();
1396
+ if (!H || !w) {
1397
+ R(null);
1398
1398
  return;
1399
1399
  }
1400
- const q = H.getBoundingClientRect(), O = y.getBoundingClientRect(), U = getComputedStyle(H).direction === "rtl", X = Math.max(0, O.top - q.top - 44), P = U ? q.right - O.right + O.width / 2 : O.left - q.left + O.width / 2;
1401
- z({ top: X, start: Math.max(0, P), rtl: U });
1400
+ const O = H.getBoundingClientRect(), q = w.getBoundingClientRect(), U = getComputedStyle(H).direction === "rtl", X = Math.max(0, q.top - O.top - 44), P = U ? O.right - q.right + q.width / 2 : q.left - O.left + q.width / 2;
1401
+ R({ top: X, start: Math.max(0, P), rtl: U });
1402
1402
  };
1403
- c();
1404
- const p = new ResizeObserver(c), E = h.current, T = g();
1405
- return E && p.observe(E), T && p.observe(T), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
1406
- p.disconnect(), window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
1403
+ u();
1404
+ const y = new ResizeObserver(u), E = m.current, A = c();
1405
+ return E && y.observe(E), A && y.observe(A), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
1406
+ y.disconnect(), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
1407
1407
  };
1408
- }, [b, L, h, g]), !b && !L || !C) return null;
1409
- const m = [
1408
+ }, [p, L, m, c]), !p && !L || !C) return null;
1409
+ const h = [
1410
1410
  ["rowAbove", "rowBelow"],
1411
1411
  ["colLeft", "colRight"],
1412
1412
  ["addHead"],
1413
- ...f ? ["colour"] : [],
1413
+ ...g ? ["colour"] : [],
1414
1414
  ["deleteRow", "deleteColumn"],
1415
1415
  ["deleteTable"]
1416
1416
  ];
@@ -1418,110 +1418,110 @@ function Xo({
1418
1418
  // Tooltips disambiguate the icon-only ops on hover (and provide each
1419
1419
  // button's accessible name via IconButton's `tooltip` prop). Radix Tooltip
1420
1420
  // needs a provider ancestor, so scope one to the bar.
1421
- /* @__PURE__ */ t(vr, { children: /* @__PURE__ */ t(
1421
+ /* @__PURE__ */ t(Tr, { children: /* @__PURE__ */ t(
1422
1422
  "div",
1423
1423
  {
1424
1424
  role: "group",
1425
- "aria-label": u("editor.table.toolbar", "Table tools"),
1426
- className: `${Ko} ${C.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
1425
+ "aria-label": d("editor.table.toolbar", "Table tools"),
1426
+ className: `${Yo} ${C.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
1427
1427
  style: {
1428
1428
  "--rte-tt-top": `${C.top}px`,
1429
1429
  "--rte-tt-start": `${C.start}px`
1430
1430
  },
1431
- children: m.map((c, p) => /* @__PURE__ */ k(pt, { children: [
1432
- p > 0 ? /* @__PURE__ */ t("span", { "aria-hidden": "true", className: jt }) : null,
1433
- c === "colour" ? /* @__PURE__ */ k(Me, { children: [
1431
+ children: h.map((u, y) => /* @__PURE__ */ k(vt, { children: [
1432
+ y > 0 ? /* @__PURE__ */ t("span", { "aria-hidden": "true", className: Bt }) : null,
1433
+ u === "colour" ? /* @__PURE__ */ k(Me, { children: [
1434
1434
  /* @__PURE__ */ t(
1435
- ur,
1435
+ hr,
1436
1436
  {
1437
1437
  scope: "cell",
1438
- icon: /* @__PURE__ */ t(Kn, {}),
1439
- label: u("editor.table.cellColor", "Cell colour"),
1440
- onOpenChange: F,
1438
+ icon: /* @__PURE__ */ t(Yn, {}),
1439
+ label: d("editor.table.cellColor", "Cell colour"),
1440
+ onOpenChange: G,
1441
1441
  saveTableCell: l,
1442
- applyTableBackground: v
1442
+ applyTableBackground: b
1443
1443
  }
1444
1444
  ),
1445
1445
  /* @__PURE__ */ t(
1446
- ur,
1446
+ hr,
1447
1447
  {
1448
1448
  scope: "row",
1449
- icon: /* @__PURE__ */ t(Xn, {}),
1450
- label: u("editor.table.rowColor", "Row colour"),
1451
- onOpenChange: F,
1449
+ icon: /* @__PURE__ */ t(eo, {}),
1450
+ label: d("editor.table.rowColor", "Row colour"),
1451
+ onOpenChange: G,
1452
1452
  saveTableCell: l,
1453
- applyTableBackground: v
1453
+ applyTableBackground: b
1454
1454
  }
1455
1455
  )
1456
- ] }) : c.map((E) => {
1457
- const T = Vo[E];
1456
+ ] }) : u.map((E) => {
1457
+ const A = Qo[E];
1458
1458
  return /* @__PURE__ */ t(
1459
- G,
1459
+ V,
1460
1460
  {
1461
1461
  size: "sm",
1462
1462
  intent: "ghost",
1463
- icon: T.icon,
1464
- tooltip: u(T.label[0], T.label[1]),
1463
+ icon: A.icon,
1464
+ tooltip: d(A.label[0], A.label[1]),
1465
1465
  onMouseDown: (H) => H.preventDefault(),
1466
- onClick: () => i(T.command)
1466
+ onClick: () => i(A.command)
1467
1467
  },
1468
1468
  E
1469
1469
  );
1470
1470
  })
1471
- ] }, c === "colour" ? "colour" : c[0]))
1471
+ ] }, u === "colour" ? "colour" : u[0]))
1472
1472
  }
1473
1473
  ) })
1474
1474
  );
1475
1475
  }
1476
- const Ht = [
1476
+ const Ot = [
1477
1477
  "wysiwyg-img-inline",
1478
1478
  "wysiwyg-img-wrap-left",
1479
1479
  "wysiwyg-img-wrap-right"
1480
- ], xr = [
1480
+ ], zr = [
1481
1481
  "wysiwyg-img-align-left",
1482
1482
  "wysiwyg-img-align-center",
1483
1483
  "wysiwyg-img-align-right"
1484
1484
  ];
1485
- function mr(o, i) {
1486
- return i.find((h) => o.classList.contains(h)) ?? "";
1485
+ function pr(o, i) {
1486
+ return i.find((m) => o.classList.contains(m)) ?? "";
1487
1487
  }
1488
- function Zo(o) {
1489
- const i = o.closest(".redactor-in"), h = i instanceof HTMLElement ? i.clientWidth : 0, g = o.getBoundingClientRect().width;
1490
- return h <= 0 || g <= 0 ? Ve : Math.round(Math.min(Ve, g / h * 100));
1488
+ function ta(o) {
1489
+ const i = o.closest(".redactor-in"), m = i instanceof HTMLElement ? i.clientWidth : 0, c = o.getBoundingClientRect().width;
1490
+ return m <= 0 || c <= 0 ? We : Math.round(Math.min(We, c / m * 100));
1491
1491
  }
1492
- const Dt = 10, Ve = 100, Uo = 5, Qo = 10, gr = (o) => Math.min(Ve, Math.max(Dt, Math.round(o))), Yo = [
1492
+ const qt = 10, We = 100, ra = 5, na = 10, br = (o) => Math.min(We, Math.max(qt, Math.round(o))), oa = [
1493
1493
  {
1494
1494
  id: "wysiwyg-img-inline",
1495
- icon: /* @__PURE__ */ t(yn, {}),
1495
+ icon: /* @__PURE__ */ t(Nn, {}),
1496
1496
  label: ["editor.image.inline", "Inline with text"]
1497
1497
  },
1498
1498
  {
1499
1499
  id: "wysiwyg-img-wrap-left",
1500
- icon: /* @__PURE__ */ t(Yn, {}),
1500
+ icon: /* @__PURE__ */ t(oo, {}),
1501
1501
  label: ["editor.image.wrapLeft", "Wrap left"]
1502
1502
  },
1503
1503
  {
1504
1504
  id: "wysiwyg-img-wrap-right",
1505
- icon: /* @__PURE__ */ t(eo, {}),
1505
+ icon: /* @__PURE__ */ t(io, {}),
1506
1506
  label: ["editor.image.wrapRight", "Wrap right"]
1507
1507
  }
1508
- ], Jo = [
1508
+ ], aa = [
1509
1509
  {
1510
1510
  id: "wysiwyg-img-align-left",
1511
- icon: /* @__PURE__ */ t(Co, {}),
1511
+ icon: /* @__PURE__ */ t(_o, {}),
1512
1512
  label: ["editor.image.alignLeft", "Align left"]
1513
1513
  },
1514
1514
  {
1515
1515
  id: "wysiwyg-img-align-center",
1516
- icon: /* @__PURE__ */ t(vo, {}),
1516
+ icon: /* @__PURE__ */ t(To, {}),
1517
1517
  label: ["editor.image.alignCenter", "Align centre"]
1518
1518
  },
1519
1519
  {
1520
1520
  id: "wysiwyg-img-align-right",
1521
- icon: /* @__PURE__ */ t(xo, {}),
1521
+ icon: /* @__PURE__ */ t(zo, {}),
1522
1522
  label: ["editor.image.alignRight", "Align right"]
1523
1523
  }
1524
- ], ea = [
1524
+ ], ia = [
1525
1525
  {
1526
1526
  id: "tl",
1527
1527
  pos: "ds:[inset-block-start:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-start:calc(var(--spacing-md)*-0.5)]",
@@ -1554,14 +1554,14 @@ const Dt = 10, Ve = 100, Uo = 5, Qo = 10, gr = (o) => Math.min(Ve, Math.max(Dt,
1554
1554
  labelKey: "editor.image.resizeBottomEnd",
1555
1555
  labelFallback: "Resize image, bottom-end corner"
1556
1556
  }
1557
- ], ta = [
1557
+ ], sa = [
1558
1558
  "ds:absolute ds:z-20 ds:pointer-events-none",
1559
1559
  "ds:[inset-block-start:var(--rte-img-top)] ds:[inset-inline-start:var(--rte-img-start)]",
1560
1560
  "ds:[inline-size:var(--rte-img-width)] ds:[block-size:var(--rte-img-height)]",
1561
1561
  "ds:rounded-[var(--radius-2xs)]",
1562
1562
  "ds:[outline-style:solid] ds:[outline-width:var(--border-width-md)]",
1563
1563
  "ds:[outline-color:var(--accent)] ds:[outline-offset:var(--focus-ring-offset)]"
1564
- ].join(" "), ra = [
1564
+ ].join(" "), la = [
1565
1565
  "ds:absolute ds:pointer-events-auto ds:touch-none",
1566
1566
  "ds:[inline-size:var(--spacing-md)] ds:[block-size:var(--spacing-md)]",
1567
1567
  "ds:rounded-[var(--radius-2xs)] ds:shadow-[var(--shadow-sm)]",
@@ -1570,116 +1570,116 @@ const Dt = 10, Ve = 100, Uo = 5, Qo = 10, gr = (o) => Math.min(Ve, Math.max(Dt,
1570
1570
  "ds:focus-visible:outline-solid ds:focus-visible:outline-[var(--ring)]",
1571
1571
  "ds:focus-visible:[outline-offset:var(--focus-ring-offset)]",
1572
1572
  "ds:forced-colors:bg-[CanvasText]"
1573
- ].join(" "), na = [
1573
+ ].join(" "), ca = [
1574
1574
  "ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
1575
1575
  "ds:[inset-block-start:var(--rte-img-bar-top)] ds:[inset-inline-start:var(--rte-img-center)]",
1576
1576
  "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
1577
1577
  "ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]"
1578
1578
  ].join(" ");
1579
- function oa({
1579
+ function da({
1580
1580
  areaRef: o,
1581
1581
  activeImageEl: i,
1582
- applyImageClass: h,
1583
- setImageWidth: g
1582
+ applyImageClass: m,
1583
+ setImageWidth: c
1584
1584
  }) {
1585
- const { t: f } = ne(), [l, v] = A(null), u = M(null);
1585
+ const { t: g } = se(), [l, b] = z(null), d = T(null);
1586
1586
  I(() => {
1587
1587
  if (!i || typeof window > "u") {
1588
- v(null);
1588
+ b(null);
1589
1589
  return;
1590
1590
  }
1591
- const m = () => {
1591
+ const h = () => {
1592
1592
  const H = o.current;
1593
1593
  if (!H) {
1594
- v(null);
1594
+ b(null);
1595
1595
  return;
1596
1596
  }
1597
- const y = H.getBoundingClientRect(), q = i.getBoundingClientRect(), O = getComputedStyle(H).direction === "rtl", U = q.top - y.top, X = O ? y.right - q.right : q.left - y.left, P = X + q.width / 2, ae = Math.max(0, U - 44);
1598
- v({
1597
+ const w = H.getBoundingClientRect(), O = i.getBoundingClientRect(), q = getComputedStyle(H).direction === "rtl", U = O.top - w.top, X = q ? w.right - O.right : O.left - w.left, P = X + O.width / 2, ne = Math.max(0, U - 44);
1598
+ b({
1599
1599
  top: U,
1600
1600
  start: Math.max(0, X),
1601
- width: q.width,
1602
- height: q.height,
1601
+ width: O.width,
1602
+ height: O.height,
1603
1603
  center: Math.max(0, P),
1604
- barTop: ae,
1605
- pct: Zo(i),
1606
- rtl: O
1604
+ barTop: ne,
1605
+ pct: ta(i),
1606
+ rtl: q
1607
1607
  });
1608
1608
  };
1609
- m();
1610
- const c = new ResizeObserver(m);
1611
- c.observe(i);
1612
- const p = o.current;
1613
- p && c.observe(p);
1609
+ h();
1610
+ const u = new ResizeObserver(h);
1611
+ u.observe(i);
1612
+ const y = o.current;
1613
+ y && u.observe(y);
1614
1614
  const E = i.closest(".redactor-in");
1615
- let T = null;
1616
- return E && (T = new MutationObserver(m), T.observe(E, {
1615
+ let A = null;
1616
+ return E && (A = new MutationObserver(h), A.observe(E, {
1617
1617
  subtree: !0,
1618
1618
  childList: !0,
1619
1619
  characterData: !0,
1620
1620
  attributes: !0,
1621
1621
  attributeFilter: ["class", "style", "width", "height", "src"]
1622
- })), window.addEventListener("scroll", m, !0), window.addEventListener("resize", m), () => {
1623
- c.disconnect(), T == null || T.disconnect(), window.removeEventListener("scroll", m, !0), window.removeEventListener("resize", m);
1622
+ })), window.addEventListener("scroll", h, !0), window.addEventListener("resize", h), () => {
1623
+ u.disconnect(), A == null || A.disconnect(), window.removeEventListener("scroll", h, !0), window.removeEventListener("resize", h);
1624
1624
  };
1625
1625
  }, [i, o]);
1626
- const b = x(
1627
- (m) => (c) => {
1628
- !c.isPrimary || !l || (c.preventDefault(), c.currentTarget.setPointerCapture(c.pointerId), u.current = {
1629
- pointerId: c.pointerId,
1630
- startX: c.clientX,
1626
+ const p = x(
1627
+ (h) => (u) => {
1628
+ !u.isPrimary || !l || (u.preventDefault(), u.currentTarget.setPointerCapture(u.pointerId), d.current = {
1629
+ pointerId: u.pointerId,
1630
+ startX: u.clientX,
1631
1631
  startPct: l.pct,
1632
- sign: m.sign * (l.rtl ? -1 : 1)
1632
+ sign: h.sign * (l.rtl ? -1 : 1)
1633
1633
  });
1634
1634
  },
1635
1635
  [l]
1636
1636
  ), C = x(
1637
- (m) => {
1638
- const c = u.current;
1639
- if (!c || m.pointerId !== c.pointerId || !i) return;
1640
- const p = i.closest(".redactor-in"), E = p instanceof HTMLElement ? p.clientWidth : 0;
1637
+ (h) => {
1638
+ const u = d.current;
1639
+ if (!u || h.pointerId !== u.pointerId || !i) return;
1640
+ const y = i.closest(".redactor-in"), E = y instanceof HTMLElement ? y.clientWidth : 0;
1641
1641
  if (E <= 0) return;
1642
- const T = c.sign * (m.clientX - c.startX) / E * 100;
1643
- g(gr(c.startPct + T));
1642
+ const A = u.sign * (h.clientX - u.startX) / E * 100;
1643
+ c(br(u.startPct + A));
1644
1644
  },
1645
- [i, g]
1646
- ), z = x(
1647
- (m) => {
1648
- const c = u.current;
1649
- !c || m.pointerId !== c.pointerId || (m.currentTarget.releasePointerCapture(m.pointerId), u.current = null);
1645
+ [i, c]
1646
+ ), R = x(
1647
+ (h) => {
1648
+ const u = d.current;
1649
+ !u || h.pointerId !== u.pointerId || (h.currentTarget.releasePointerCapture(h.pointerId), d.current = null);
1650
1650
  },
1651
1651
  []
1652
1652
  ), $ = x(
1653
- (m) => {
1653
+ (h) => {
1654
1654
  if (!l) return;
1655
- let c = null;
1656
- const p = m.shiftKey ? Qo : Uo;
1657
- switch (m.key) {
1655
+ let u = null;
1656
+ const y = h.shiftKey ? na : ra;
1657
+ switch (h.key) {
1658
1658
  // Up / right always grow; down / left always shrink — independent of
1659
1659
  // which corner has focus, so the gesture reads the same everywhere.
1660
1660
  case "ArrowRight":
1661
1661
  case "ArrowUp":
1662
- c = l.pct + p;
1662
+ u = l.pct + y;
1663
1663
  break;
1664
1664
  case "ArrowLeft":
1665
1665
  case "ArrowDown":
1666
- c = l.pct - p;
1666
+ u = l.pct - y;
1667
1667
  break;
1668
1668
  case "Home":
1669
- c = Dt;
1669
+ u = qt;
1670
1670
  break;
1671
1671
  case "End":
1672
- c = Ve;
1672
+ u = We;
1673
1673
  break;
1674
1674
  default:
1675
1675
  return;
1676
1676
  }
1677
- m.preventDefault(), g(gr(c));
1677
+ h.preventDefault(), c(br(u));
1678
1678
  },
1679
- [l, g]
1679
+ [l, c]
1680
1680
  );
1681
1681
  if (!i || !l) return null;
1682
- const L = mr(i, Ht), _ = mr(i, xr), F = f("editor.image.widthAnnounce", {
1682
+ const L = pr(i, Ot), M = pr(i, zr), G = g("editor.image.widthAnnounce", {
1683
1683
  width: l.pct,
1684
1684
  defaultValue: "{{width}} percent"
1685
1685
  });
@@ -1687,212 +1687,212 @@ function oa({
1687
1687
  /* @__PURE__ */ t(
1688
1688
  "div",
1689
1689
  {
1690
- className: ta,
1690
+ className: sa,
1691
1691
  style: {
1692
1692
  "--rte-img-top": `${l.top}px`,
1693
1693
  "--rte-img-start": `${l.start}px`,
1694
1694
  "--rte-img-width": `${l.width}px`,
1695
1695
  "--rte-img-height": `${l.height}px`
1696
1696
  },
1697
- children: ea.map((m) => /* @__PURE__ */ t(
1697
+ children: ia.map((h) => /* @__PURE__ */ t(
1698
1698
  "div",
1699
1699
  {
1700
1700
  role: "slider",
1701
1701
  tabIndex: 0,
1702
- "aria-label": f(m.labelKey, m.labelFallback),
1702
+ "aria-label": g(h.labelKey, h.labelFallback),
1703
1703
  "aria-orientation": "horizontal",
1704
- "aria-valuemin": Dt,
1705
- "aria-valuemax": Ve,
1704
+ "aria-valuemin": qt,
1705
+ "aria-valuemax": We,
1706
1706
  "aria-valuenow": l.pct,
1707
- "aria-valuetext": F,
1708
- className: `${ra} ${m.pos} ${m.cursor}`,
1709
- onPointerDown: b(m),
1707
+ "aria-valuetext": G,
1708
+ className: `${la} ${h.pos} ${h.cursor}`,
1709
+ onPointerDown: p(h),
1710
1710
  onPointerMove: C,
1711
- onPointerUp: z,
1712
- onPointerCancel: z,
1711
+ onPointerUp: R,
1712
+ onPointerCancel: R,
1713
1713
  onKeyDown: $
1714
1714
  },
1715
- m.id
1715
+ h.id
1716
1716
  ))
1717
1717
  }
1718
1718
  ),
1719
- /* @__PURE__ */ t(vr, { children: /* @__PURE__ */ t(
1719
+ /* @__PURE__ */ t(Tr, { children: /* @__PURE__ */ t(
1720
1720
  "div",
1721
1721
  {
1722
1722
  role: "group",
1723
- "aria-label": f("editor.image.toolbar", "Image tools"),
1724
- className: `${na} ${l.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
1723
+ "aria-label": g("editor.image.toolbar", "Image tools"),
1724
+ className: `${ca} ${l.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
1725
1725
  style: {
1726
1726
  "--rte-img-bar-top": `${l.barTop}px`,
1727
1727
  "--rte-img-center": `${l.center}px`
1728
1728
  },
1729
- children: [Yo, Jo].map((m, c) => /* @__PURE__ */ k(pt, { children: [
1730
- c > 0 ? /* @__PURE__ */ t("span", { "aria-hidden": "true", className: jt }) : null,
1731
- m.map((p) => {
1732
- const E = c === 0 ? L === p.id : _ === p.id;
1729
+ children: [oa, aa].map((h, u) => /* @__PURE__ */ k(vt, { children: [
1730
+ u > 0 ? /* @__PURE__ */ t("span", { "aria-hidden": "true", className: Bt }) : null,
1731
+ h.map((y) => {
1732
+ const E = u === 0 ? L === y.id : M === y.id;
1733
1733
  return /* @__PURE__ */ t(
1734
- G,
1734
+ V,
1735
1735
  {
1736
1736
  size: "sm",
1737
1737
  intent: "ghost",
1738
- icon: p.icon,
1738
+ icon: y.icon,
1739
1739
  "aria-pressed": E,
1740
- tooltip: f(p.label[0], p.label[1]),
1741
- onMouseDown: (T) => T.preventDefault(),
1742
- onClick: () => h(p.id)
1740
+ tooltip: g(y.label[0], y.label[1]),
1741
+ onMouseDown: (A) => A.preventDefault(),
1742
+ onClick: () => m(y.id)
1743
1743
  },
1744
- p.id
1744
+ y.id
1745
1745
  );
1746
1746
  })
1747
- ] }, c === 0 ? "flow" : "align"))
1747
+ ] }, u === 0 ? "flow" : "align"))
1748
1748
  }
1749
1749
  ) })
1750
1750
  ] });
1751
1751
  }
1752
- function aa({
1752
+ function ua({
1753
1753
  run: o,
1754
1754
  active: i,
1755
- preset: h,
1756
- insertHtml: g,
1757
- insertTable: f,
1755
+ preset: m,
1756
+ insertHtml: c,
1757
+ insertTable: g,
1758
1758
  saveSelection: l,
1759
- restoreSelection: v,
1760
- getSelectedText: u,
1761
- uploadImage: b,
1759
+ restoreSelection: b,
1760
+ getSelectedText: d,
1761
+ uploadImage: p,
1762
1762
  enableColor: C = !1,
1763
- enableImage: z = !1,
1763
+ enableImage: R = !1,
1764
1764
  enableTable: $ = !1,
1765
1765
  showExtensions: L = !1,
1766
- variables: _,
1767
- insertVariable: F
1766
+ variables: M,
1767
+ insertVariable: G
1768
1768
  }) {
1769
- const { t: m } = ne(), c = (B) => B.preventDefault(), p = (B) => Io[h].includes(B), E = (B) => {
1770
- if (!p(B)) return null;
1771
- const Q = Lo[B];
1769
+ const { t: h } = se(), u = (j) => j.preventDefault(), y = (j) => Po[m].includes(j), E = (j) => {
1770
+ if (!y(j)) return null;
1771
+ const Q = qo[j];
1772
1772
  return /* @__PURE__ */ t(
1773
- G,
1773
+ V,
1774
1774
  {
1775
1775
  size: "sm",
1776
1776
  intent: "ghost",
1777
1777
  icon: Q.icon,
1778
- "aria-label": m(Q.label[0], Q.label[1]),
1778
+ "aria-label": h(Q.label[0], Q.label[1]),
1779
1779
  "aria-pressed": Q.toggle ? i.has(Q.toggle) : void 0,
1780
- onMouseDown: c,
1780
+ onMouseDown: u,
1781
1781
  onClick: () => o(...Q.command)
1782
1782
  },
1783
1783
  Q.id
1784
1784
  );
1785
- }, T = () => /* @__PURE__ */ t("span", { "aria-hidden": "true", className: jt }), H = p("format"), y = [
1785
+ }, A = () => /* @__PURE__ */ t("span", { "aria-hidden": "true", className: Bt }), H = y("format"), w = [
1786
1786
  E("bold"),
1787
1787
  E("italic"),
1788
1788
  E("underline"),
1789
1789
  E("strike"),
1790
1790
  C ? /* @__PURE__ */ t(
1791
- jo,
1791
+ Wo,
1792
1792
  {
1793
1793
  run: o,
1794
1794
  saveSelection: l,
1795
- restoreSelection: v
1795
+ restoreSelection: b
1796
1796
  },
1797
1797
  "colour"
1798
1798
  ) : null,
1799
1799
  C ? /* @__PURE__ */ t(
1800
- Bo,
1800
+ Xo,
1801
1801
  {
1802
1802
  run: o,
1803
1803
  saveSelection: l,
1804
- restoreSelection: v
1804
+ restoreSelection: b
1805
1805
  },
1806
1806
  "highlight"
1807
1807
  ) : null
1808
- ].filter(Boolean), q = H || y.length > 0, O = [E("ul"), E("ol")].filter(Boolean), U = [
1809
- p("link") ? /* @__PURE__ */ t(
1810
- Oo,
1808
+ ].filter(Boolean), O = H || w.length > 0, q = [E("ul"), E("ol")].filter(Boolean), U = [
1809
+ y("link") ? /* @__PURE__ */ t(
1810
+ Vo,
1811
1811
  {
1812
- insertHtml: g,
1812
+ insertHtml: c,
1813
1813
  saveSelection: l,
1814
- restoreSelection: v,
1815
- getSelectedText: u
1814
+ restoreSelection: b,
1815
+ getSelectedText: d
1816
1816
  },
1817
1817
  "link"
1818
1818
  ) : null,
1819
- z ? /* @__PURE__ */ t(
1820
- Po,
1819
+ R ? /* @__PURE__ */ t(
1820
+ Ko,
1821
1821
  {
1822
- insertHtml: g,
1822
+ insertHtml: c,
1823
1823
  saveSelection: l,
1824
- restoreSelection: v,
1825
- uploadImage: b
1824
+ restoreSelection: b,
1825
+ uploadImage: p
1826
1826
  },
1827
1827
  "image"
1828
1828
  ) : null,
1829
1829
  $ ? /* @__PURE__ */ t(
1830
- Go,
1830
+ Uo,
1831
1831
  {
1832
1832
  run: o,
1833
- insertTable: f,
1833
+ insertTable: g,
1834
1834
  active: i
1835
1835
  },
1836
1836
  "table"
1837
1837
  ) : null,
1838
- _ && _.length > 0 && F ? /* @__PURE__ */ t(
1839
- Do,
1838
+ M && M.length > 0 && G ? /* @__PURE__ */ t(
1839
+ Bo,
1840
1840
  {
1841
- variables: _,
1842
- insertVariable: F,
1841
+ variables: M,
1842
+ insertVariable: G,
1843
1843
  saveSelection: l
1844
1844
  },
1845
1845
  "variables"
1846
1846
  ) : null
1847
1847
  ].filter(Boolean), X = L ? [
1848
1848
  /* @__PURE__ */ t(
1849
- G,
1849
+ V,
1850
1850
  {
1851
1851
  size: "sm",
1852
1852
  intent: "ghost",
1853
- icon: /* @__PURE__ */ t(zo, {}),
1854
- "aria-label": m("editor.extensions", "Editor extensions"),
1853
+ icon: /* @__PURE__ */ t(Lo, {}),
1854
+ "aria-label": h("editor.extensions", "Editor extensions"),
1855
1855
  disabled: !0,
1856
- onMouseDown: c
1856
+ onMouseDown: u
1857
1857
  },
1858
1858
  "extensions"
1859
1859
  )
1860
- ] : [], P = [O, U, X].filter(
1861
- (B) => B.length > 0
1862
- ), ae = P.length > 0, be = (B) => P.map((Q, Ee) => /* @__PURE__ */ k(pt, { children: [
1863
- Ee > 0 || B ? /* @__PURE__ */ t(T, {}) : null,
1860
+ ] : [], P = [q, U, X].filter(
1861
+ (j) => j.length > 0
1862
+ ), ne = P.length > 0, we = (j) => P.map((Q, Se) => /* @__PURE__ */ k(vt, { children: [
1863
+ Se > 0 || j ? /* @__PURE__ */ t(A, {}) : null,
1864
1864
  Q
1865
- ] }, Ee));
1865
+ ] }, Se));
1866
1866
  return (
1867
1867
  // Outer element is the query container + visual chrome; the flex row is an
1868
1868
  // inner child so `container-type` never lands on the flex parent (which
1869
1869
  // would blockify the inline controls).
1870
- /* @__PURE__ */ t("div", { className: $o(), "data-component": "editor-toolbar", children: /* @__PURE__ */ k(
1870
+ /* @__PURE__ */ t("div", { className: Fo(), "data-component": "editor-toolbar", children: /* @__PURE__ */ k(
1871
1871
  "div",
1872
1872
  {
1873
1873
  role: "group",
1874
- "aria-label": m("editor.toolbarLabel"),
1875
- className: Ho,
1874
+ "aria-label": h("editor.toolbarLabel"),
1875
+ className: jo,
1876
1876
  children: [
1877
- H ? /* @__PURE__ */ t(qo, { run: o, active: i, onTriggerDown: c }) : null,
1878
- H && y.length > 0 ? /* @__PURE__ */ t(T, {}) : null,
1879
- y,
1880
- ae ? /* @__PURE__ */ k(Me, { children: [
1881
- /* @__PURE__ */ t("div", { className: "ds:hidden ds:@[384px]/toolbar:contents", children: be(q) }),
1877
+ H ? /* @__PURE__ */ t(Go, { run: o, active: i, onTriggerDown: u }) : null,
1878
+ H && w.length > 0 ? /* @__PURE__ */ t(A, {}) : null,
1879
+ w,
1880
+ ne ? /* @__PURE__ */ k(Me, { children: [
1881
+ /* @__PURE__ */ t("div", { className: "ds:hidden ds:@[384px]/toolbar:contents", children: we(O) }),
1882
1882
  /* @__PURE__ */ k("div", { className: "ds:contents ds:@[384px]/toolbar:hidden", children: [
1883
- q ? /* @__PURE__ */ t(T, {}) : null,
1884
- /* @__PURE__ */ k(V, { children: [
1885
- /* @__PURE__ */ t(V.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1886
- G,
1883
+ O ? /* @__PURE__ */ t(A, {}) : null,
1884
+ /* @__PURE__ */ k(K, { children: [
1885
+ /* @__PURE__ */ t(K.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1886
+ V,
1887
1887
  {
1888
1888
  size: "sm",
1889
1889
  intent: "ghost",
1890
- icon: /* @__PURE__ */ t(dn, {}),
1891
- "aria-label": m("editor.more", "More options"),
1892
- onMouseDown: c
1890
+ icon: /* @__PURE__ */ t(pn, {}),
1891
+ "aria-label": h("editor.more", "More options"),
1892
+ onMouseDown: u
1893
1893
  }
1894
1894
  ) }),
1895
- /* @__PURE__ */ t(V.Content, { side: "bottom", align: "end", children: /* @__PURE__ */ t("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: be(!1) }) })
1895
+ /* @__PURE__ */ t(K.Content, { side: "bottom", align: "end", children: /* @__PURE__ */ t("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: we(!1) }) })
1896
1896
  ] })
1897
1897
  ] })
1898
1898
  ] }) : null
@@ -1902,85 +1902,114 @@ function aa({
1902
1902
  );
1903
1903
  }
1904
1904
  function fe(o) {
1905
- return en(o, "rich-text");
1905
+ return sn(o, "rich-text");
1906
1906
  }
1907
- function Lt(o = "") {
1907
+ function gt(o = "") {
1908
1908
  const i = String(o).trim();
1909
1909
  if (i === "" || i === "<p><br></p>" || i === "<p>&nbsp;</p>")
1910
1910
  return "";
1911
- const h = i.replace(/<br\s*\/?>/gi, "").replace(/&nbsp;/gi, "").replace(/<[^>]+>/g, "").trim();
1912
- return h === "" && /<img\b[^>]*>/i.test(i) ? i : h === "" ? "" : i;
1911
+ const m = i.replace(/<br\s*\/?>/gi, "").replace(/&nbsp;/gi, "").replace(/<[^>]+>/g, "").trim();
1912
+ return m === "" && /<img\b[^>]*>/i.test(i) ? i : m === "" ? "" : i;
1913
1913
  }
1914
- function ia(o) {
1914
+ function yr(o) {
1915
1915
  return o.replace(
1916
1916
  /<img(?![^>]*\sloading=)([^>]*)>/gi,
1917
1917
  '<img loading="lazy"$1>'
1918
1918
  );
1919
1919
  }
1920
- const It = /^[A-Za-z0-9_]+$/, kr = /\[\[([A-Za-z0-9_]+)\]\]/g, qt = "rte-variable-invalid", sa = new RegExp(
1921
- `\\s*\\b${qt}\\b`,
1920
+ const Dt = /^[A-Za-z0-9_]+$/, Rr = /\[\[([A-Za-z0-9_]+)\]\]/g, Pt = "rte-variable-invalid", ma = new RegExp(
1921
+ `\\s*\\b${Pt}\\b`,
1922
1922
  "g"
1923
1923
  );
1924
- function fr(o) {
1924
+ function vr(o) {
1925
1925
  return o.includes('data-redactor-type="variable"') ? o.replace(
1926
1926
  /<span\b[^>]*data-redactor-type="variable"[^>]*>/g,
1927
- (i) => i.replace(/\s(?:data-label|title)="[^"]*"/g, "").replace(sa, "").replace(/\sclass=""/g, "")
1927
+ (i) => i.replace(/\s(?:data-label|title)="[^"]*"/g, "").replace(ma, "").replace(/\sclass=""/g, "")
1928
1928
  ) : o;
1929
1929
  }
1930
- function la(o) {
1930
+ function fa(o) {
1931
1931
  const i = o.replace(/<[^>]*>/g, " ");
1932
- return Array.from(i.matchAll(kr), (h) => h[1]);
1932
+ return Array.from(i.matchAll(Rr), (m) => m[1]);
1933
1933
  }
1934
- function ca(o) {
1934
+ function ga(o) {
1935
1935
  return typeof o == "object" && o !== null && "name" in o && o.name === "AiCreditsExhaustedError";
1936
1936
  }
1937
- function hr(o) {
1937
+ function wr(o) {
1938
+ return o.replace(/<[^>]*>/g, "").replace(/&nbsp;/gi, "").replace(/[\s\u200B\uFEFF]+/g, "");
1939
+ }
1940
+ function ha(o) {
1941
+ const i = window.getSelection();
1942
+ if (!i || i.rangeCount === 0) return null;
1943
+ const m = i.getRangeAt(0);
1944
+ if (!o.contains(m.startContainer)) return null;
1945
+ const c = document.createRange();
1946
+ return c.selectNodeContents(o), c.setEnd(m.startContainer, m.startOffset), c.toString().length;
1947
+ }
1948
+ function pa(o, i) {
1949
+ var l;
1950
+ const m = window.getSelection();
1951
+ if (!m) return;
1952
+ const c = document.createTreeWalker(o, NodeFilter.SHOW_TEXT);
1953
+ let g = 0;
1954
+ for (let b = c.nextNode(); b; b = c.nextNode()) {
1955
+ const d = b;
1956
+ if (g + d.data.length >= i) {
1957
+ const p = document.createRange(), C = (l = d.parentElement) == null ? void 0 : l.closest(
1958
+ '[data-redactor-type="variable"]'
1959
+ );
1960
+ C ? p.setStartAfter(C) : p.setStart(d, i - g), p.collapse(!0), m.removeAllRanges(), m.addRange(p);
1961
+ return;
1962
+ }
1963
+ g += d.data.length;
1964
+ }
1965
+ }
1966
+ function xr(o) {
1938
1967
  return `<span data-redactor-type="variable">[[${o}]]</span>`;
1939
1968
  }
1940
- function $t(o, i) {
1941
- var v;
1969
+ function ht(o, i) {
1970
+ var b;
1942
1971
  if (i.size === 0 || !o.includes("[[") || typeof DOMParser > "u")
1943
1972
  return o;
1944
- const h = new DOMParser().parseFromString(
1973
+ const m = new DOMParser().parseFromString(
1945
1974
  `<body>${o}</body>`,
1946
1975
  "text/html"
1947
- ), g = h.createTreeWalker(h.body, NodeFilter.SHOW_TEXT), f = [];
1948
- for (let u = g.nextNode(); u; u = g.nextNode()) {
1949
- const b = u;
1950
- (v = b.parentElement) != null && v.closest('[data-redactor-type="variable"]') || b.data.includes("[[") && f.push(b);
1976
+ ), c = m.createTreeWalker(m.body, NodeFilter.SHOW_TEXT), g = [];
1977
+ for (let d = c.nextNode(); d; d = c.nextNode()) {
1978
+ const p = d;
1979
+ (b = p.parentElement) != null && b.closest('[data-redactor-type="variable"]') || p.data.includes("[[") && g.push(p);
1951
1980
  }
1952
1981
  let l = !1;
1953
- for (const u of f) {
1954
- const b = h.createDocumentFragment();
1982
+ for (const d of g) {
1983
+ const p = m.createDocumentFragment();
1955
1984
  let C = 0;
1956
- for (const z of u.data.matchAll(kr)) {
1957
- const $ = i.get(z[1].toLowerCase());
1958
- if (!$ || z.index === void 0) continue;
1959
- b.append(u.data.slice(C, z.index));
1960
- const L = h.createElement("span");
1961
- L.setAttribute("data-redactor-type", "variable"), L.textContent = `[[${$}]]`, b.append(L), C = z.index + z[0].length;
1985
+ for (const R of d.data.matchAll(Rr)) {
1986
+ const $ = i.get(R[1].toLowerCase());
1987
+ if (!$ || R.index === void 0) continue;
1988
+ p.append(d.data.slice(C, R.index));
1989
+ const L = m.createElement("span");
1990
+ L.setAttribute("data-redactor-type", "variable"), L.textContent = `[[${$}]]`, p.append(L), C = R.index + R[0].length;
1962
1991
  }
1963
- C !== 0 && (b.append(u.data.slice(C)), u.replaceWith(b), l = !0);
1992
+ C !== 0 && (p.append(d.data.slice(C)), d.replaceWith(p), l = !0);
1964
1993
  }
1965
- return l ? h.body.innerHTML : o;
1994
+ return l ? m.body.innerHTML : o;
1966
1995
  }
1967
- function da(o) {
1996
+ function ba(o) {
1968
1997
  if (!o || typeof o != "object") return;
1969
- const i = o, h = (g) => {
1970
- if (g && typeof g == "object" && "url" in g) {
1971
- const f = g.url;
1972
- return typeof f == "string" ? f : void 0;
1998
+ const i = o, m = (c) => {
1999
+ if (c && typeof c == "object" && "url" in c) {
2000
+ const g = c.url;
2001
+ return typeof g == "string" ? g : void 0;
1973
2002
  }
1974
2003
  };
1975
- return typeof i.url == "string" ? i.url : h(i.file) ?? h(i.data) ?? Object.values(i).map(h).find(Boolean);
2004
+ return typeof i.url == "string" ? i.url : m(i.file) ?? m(i.data) ?? Object.values(i).map(m).find(Boolean);
1976
2005
  }
1977
- function ua(o) {
2006
+ function ya(o) {
1978
2007
  if (o) return o;
1979
2008
  if (typeof window > "u") return null;
1980
2009
  const i = window;
1981
2010
  return i.$R ?? i.Redactor ?? null;
1982
2011
  }
1983
- const ma = {
2012
+ const va = {
1984
2013
  bold: ["module.inline.format", { tag: "b" }],
1985
2014
  italic: ["module.inline.format", { tag: "i" }],
1986
2015
  strikethrough: ["module.inline.format", { tag: "del" }],
@@ -1989,28 +2018,28 @@ const ma = {
1989
2018
  heading: ["module.block.format", { tag: "h2" }],
1990
2019
  quote: ["module.block.format", { tag: "blockquote" }],
1991
2020
  paragraph: ["module.block.format", { tag: "p" }]
1992
- }, ga = {
2021
+ }, wa = {
1993
2022
  zh: "zh_cn",
1994
2023
  pt: "pt_br"
1995
2024
  };
1996
- function fa(o) {
2025
+ function xa(o) {
1997
2026
  const i = o.split("-")[0];
1998
- return ga[i] ?? i ?? "en";
2027
+ return wa[i] ?? i ?? "en";
1999
2028
  }
2000
- const ha = Ot(
2029
+ const ka = Ft(
2001
2030
  "redactor-theme-alfadocs ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"
2002
- ), pa = [
2031
+ ), Ca = [
2003
2032
  "ds:absolute ds:z-30 ds:flex ds:flex-col ds:p-[var(--spacing-2xs)]",
2004
2033
  "ds:[inset-inline-start:var(--rte-typeahead-x)] ds:[inset-block-start:var(--rte-typeahead-y)]",
2005
2034
  "ds:min-w-[16rem] ds:[max-block-size:16rem] ds:overflow-y-auto",
2006
2035
  "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
2007
2036
  "ds:bg-[var(--popover)] ds:text-[color:var(--popover-foreground)] ds:shadow-[var(--shadow-lg)]"
2008
- ].join(" "), ba = [
2037
+ ].join(" "), Na = [
2009
2038
  "ds:group ds:flex ds:items-baseline ds:gap-[var(--spacing-sm)] ds:cursor-pointer",
2010
2039
  "ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]",
2011
2040
  "ds:text-[length:var(--font-size-sm)]",
2012
2041
  "ds:aria-selected:bg-[var(--accent)] ds:aria-selected:text-[color:var(--accent-foreground)]"
2013
- ].join(" "), ya = Ot(
2042
+ ].join(" "), Ta = Ft(
2014
2043
  [
2015
2044
  "ds:block ds:[inline-size:100%]",
2016
2045
  "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
@@ -2024,7 +2053,7 @@ const ha = Ot(
2024
2053
  "ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
2025
2054
  "ds:forced-colors:focus-visible:outline-[CanvasText]"
2026
2055
  ].join(" ")
2027
- ), Cr = [
2056
+ ), _r = [
2028
2057
  "ds:inline-flex ds:items-center ds:justify-center",
2029
2058
  "ds:[min-block-size:var(--min-target-size)] ds:[min-inline-size:var(--min-target-size)]",
2030
2059
  "ds:text-[color:var(--primary-foreground)]",
@@ -2033,143 +2062,147 @@ const ha = Ot(
2033
2062
  "ds:focus-visible:outline-solid",
2034
2063
  "ds:focus-visible:outline-[var(--primary-foreground)]",
2035
2064
  "ds:focus-visible:[outline-offset:calc(var(--focus-ring-width)*-1)]"
2036
- ].join(" "), va = `${Cr} ds:hover:bg-[color-mix(in_srgb,var(--primary-foreground)_15%,transparent)]`, wa = `${Cr} ds:bg-[var(--destructive)] ds:hover:bg-[color-mix(in_srgb,var(--destructive)_88%,var(--primary-foreground))]`, xa = Qr(
2065
+ ].join(" "), Aa = `${_r} ds:hover:bg-[color-mix(in_srgb,var(--primary-foreground)_15%,transparent)]`, za = `${_r} ds:bg-[var(--destructive)] ds:hover:bg-[color-mix(in_srgb,var(--destructive)_88%,var(--primary-foreground))]`, Ra = nn(
2037
2066
  ({
2038
2067
  id: o,
2039
2068
  defaultValue: i,
2040
- value: h,
2041
- onChange: g,
2042
- toolbar: f = "standard",
2069
+ value: m,
2070
+ onChange: c,
2071
+ toolbar: g = "standard",
2043
2072
  placeholder: l,
2044
- readOnly: v = !1,
2045
- ariaLabel: u,
2046
- minHeight: b,
2073
+ readOnly: b = !1,
2074
+ ariaLabel: d,
2075
+ minHeight: p,
2047
2076
  showExtensions: C,
2048
- className: z,
2077
+ className: R,
2049
2078
  redactor: $,
2050
2079
  options: L,
2051
- plugins: _,
2052
- lang: F,
2053
- imageUploadUrl: m,
2054
- onUploadImage: c,
2055
- onKeyDown: p,
2080
+ plugins: M,
2081
+ lang: G,
2082
+ imageUploadUrl: h,
2083
+ onUploadImage: u,
2084
+ onKeyDown: y,
2056
2085
  onRequestAiDraft: E,
2057
- aiDraftFormat: T = "html",
2086
+ aiDraftFormat: A = "html",
2058
2087
  aiPrivacyNotice: H,
2059
- aiConsent: y,
2060
- aiConsentHeadingLevel: q,
2061
- onDictate: O,
2088
+ aiConsent: w,
2089
+ aiConsentHeadingLevel: O,
2090
+ onDictate: q,
2062
2091
  onProofread: U,
2063
2092
  onAutoFormat: X,
2064
2093
  variables: P,
2065
- validateVariable: ae,
2066
- onVariableValidityChange: be,
2067
- renderHelpMeWrite: B,
2094
+ validateVariable: ne,
2095
+ onVariableValidityChange: we,
2096
+ renderHelpMeWrite: j,
2068
2097
  onAiCreditsExhausted: Q
2069
- }, Ee) => {
2070
- const { t: D, i18n: j } = ne(), K = _e(), ee = qe(
2071
- () => `rte-${K.replace(/[^a-zA-Z0-9-_]/g, "")}`,
2072
- [K]
2073
- ), N = `#${ee}`, ie = M(null), te = M(null), bt = M(!1), yt = M(v), W = M(null), Ke = M(null), [re, Bt] = A(!1), [Ft, Re] = A(!1), [Nr, Tr] = A(""), [Ar, Gt] = A(!1), We = M(Q), Vt = M(B);
2098
+ }, Se) => {
2099
+ const { t: D, i18n: F } = se(), W = Ee(), oe = Pe(
2100
+ () => `rte-${W.replace(/[^a-zA-Z0-9-_]/g, "")}`,
2101
+ [W]
2102
+ ), N = `#${oe}`, de = T(null), J = T(null), wt = T(!1), xt = T(b), B = T(null), Xe = T(null), [ae, Gt] = z(!1), [Vt, Le] = z(!1), [Mr, Er] = z(""), [Sr, Kt] = z(!1), Ze = T(Q), Wt = T(j);
2074
2103
  I(() => {
2075
- We.current = Q, Vt.current = B;
2076
- }, [Q, B]);
2077
- const Xe = M(null), ye = qe(
2104
+ Ze.current = Q, Wt.current = j;
2105
+ }, [Q, j]);
2106
+ const Ue = T(null), ee = Pe(
2078
2107
  () => new Map(
2079
- (P ?? []).map((e) => e.token).filter((e) => It.test(e)).map((e) => [e.toLowerCase(), e])
2108
+ (P ?? []).map((e) => e.token).filter((e) => Dt.test(e)).map((e) => [e.toLowerCase(), e])
2080
2109
  ),
2081
2110
  [P]
2082
- ), Kt = qe(
2111
+ ), Xt = Pe(
2083
2112
  () => new Map(
2084
2113
  (P ?? []).map(
2085
2114
  (e) => [e.token.toLowerCase(), e.label]
2086
2115
  )
2087
2116
  ),
2088
2117
  [P]
2089
- ), Ze = M(ye);
2118
+ ), Qe = T(ee);
2090
2119
  I(() => {
2091
- Ze.current = ye;
2092
- }, [ye]);
2093
- const vt = M(ae);
2120
+ Qe.current = ee;
2121
+ }, [ee]);
2122
+ const kt = T(ne);
2094
2123
  I(() => {
2095
- vt.current = ae;
2096
- }, [ae]);
2097
- const wt = ae !== void 0, xt = x(
2098
- (e) => wt && vt.current ? vt.current(e) : ye.has(e.toLowerCase()),
2099
- [wt, ye]
2100
- ), Se = ye.size > 0 || wt, [Le, Wt] = A([]), Ue = M(be);
2124
+ kt.current = ne;
2125
+ }, [ne]);
2126
+ const Ct = ne !== void 0, Nt = x(
2127
+ (e) => Ct && kt.current ? kt.current(e) : ee.has(e.toLowerCase()),
2128
+ [Ct, ee]
2129
+ ), Ie = ee.size > 0 || Ct, [$e, Zt] = z([]), ke = T(we);
2101
2130
  I(() => {
2102
- Ue.current = be;
2103
- }, [be]);
2104
- const xe = M(() => {
2105
- }), [Xt, zr] = A(
2131
+ ke.current = we;
2132
+ }, [we]);
2133
+ const ge = T(() => {
2134
+ }), [Ut, Lr] = z(
2106
2135
  () => /* @__PURE__ */ new Set()
2107
- ), Qe = M(null), [Mr, _r] = A(
2136
+ ), Ye = T(null), [Ir, $r] = z(
2108
2137
  null
2109
- ), Ye = x((e) => {
2110
- Qe.current = e, _r(e);
2111
- }, []), Oe = M(null), J = M(g), Je = M(p);
2138
+ ), Je = x((e) => {
2139
+ Ye.current = e, $r(e);
2140
+ }, []), Fe = T(null), et = T(null), te = T(c), tt = T(y);
2112
2141
  I(() => {
2113
- J.current = g, Je.current = p;
2114
- }, [g, p]);
2115
- const Er = M(
2142
+ te.current = c, tt.current = y;
2143
+ }, [c, y]);
2144
+ const Hr = T(
2116
2145
  (() => {
2117
- const e = h ?? i ?? "";
2146
+ const e = m ?? i ?? "";
2118
2147
  return e ? fe(e) : "";
2119
2148
  })()
2120
- ), ue = x(() => {
2149
+ ), le = x(() => {
2121
2150
  var r;
2122
- const e = te.current;
2151
+ const e = J.current;
2123
2152
  if (e)
2124
2153
  try {
2125
2154
  const n = e(N, "source.getCode");
2126
- if (typeof n == "string") return fr(n);
2155
+ if (typeof n == "string") return vr(n);
2127
2156
  } catch {
2128
2157
  }
2129
- return ((r = ie.current) == null ? void 0 : r.value) ?? "";
2158
+ return ((r = de.current) == null ? void 0 : r.value) ?? "";
2130
2159
  }, [N]);
2131
2160
  I(() => {
2132
- xe.current = () => {
2161
+ ge.current = () => {
2133
2162
  var n;
2134
- if (!Se) {
2135
- Wt((a) => a.length ? [] : a);
2163
+ if (!Ie) {
2164
+ Zt((a) => a.length ? [] : a);
2136
2165
  return;
2137
2166
  }
2138
- const e = (n = W.current) == null ? void 0 : n.querySelector(".redactor-in");
2167
+ const e = (n = B.current) == null ? void 0 : n.querySelector(".redactor-in");
2139
2168
  e == null || e.querySelectorAll('[data-redactor-type="variable"]').forEach((a) => {
2140
2169
  const s = /^\[\[([A-Za-z0-9_]+)\]\]$/.exec(
2141
2170
  a.textContent ?? ""
2142
- ), d = !s || !xt(s[1]);
2143
- a.classList.contains(qt) !== d && a.classList.toggle(qt, d);
2144
- const w = s ? Kt.get(s[1].toLowerCase()) ?? s[1] : a.textContent ?? "";
2145
- a.getAttribute("data-label") !== w && a.setAttribute("data-label", w);
2146
- const S = a.textContent ?? "";
2147
- a.getAttribute("title") !== S && a.setAttribute("title", S);
2171
+ ), f = !s || !Nt(s[1]);
2172
+ a.classList.contains(Pt) !== f && a.classList.toggle(Pt, f);
2173
+ const v = s ? Xt.get(s[1].toLowerCase()) ?? s[1] : a.textContent ?? "";
2174
+ a.getAttribute("data-label") !== v && a.setAttribute("data-label", v);
2175
+ const _ = a.textContent ?? "";
2176
+ a.getAttribute("title") !== _ && a.setAttribute("title", _);
2148
2177
  });
2149
2178
  const r = Array.from(
2150
2179
  new Set(
2151
- la(ue()).filter(
2152
- (a) => !xt(a)
2180
+ fa(le()).filter(
2181
+ (a) => !Nt(a)
2153
2182
  )
2154
2183
  )
2155
2184
  );
2156
- Wt(
2157
- (a) => a.length === r.length && a.every((s, d) => s === r[d]) ? a : r
2185
+ Zt(
2186
+ (a) => a.length === r.length && a.every((s, f) => s === r[f]) ? a : r
2158
2187
  );
2159
- }, xe.current();
2160
- }, [Se, xt, Kt, ue]), I(() => {
2188
+ }, ge.current();
2189
+ }, [Ie, Nt, Xt, le]), I(() => {
2161
2190
  var n;
2162
- const r = ((n = W.current) == null ? void 0 : n.querySelector(".redactor-in")) ?? ie.current;
2163
- r && (Le.length > 0 ? (r.setAttribute("aria-invalid", "true"), r.setAttribute("aria-describedby", `${ee}-variables-error`)) : (r.removeAttribute("aria-invalid"), r.removeAttribute("aria-describedby")));
2164
- }, [Le, ee, re]), I(() => {
2165
- var e;
2166
- Se && ((e = Ue.current) == null || e.call(Ue, Le));
2167
- }, [Le, Se]);
2168
- const se = x(
2191
+ const r = ((n = B.current) == null ? void 0 : n.querySelector(".redactor-in")) ?? de.current;
2192
+ r && ($e.length > 0 ? (r.setAttribute("aria-invalid", "true"), r.setAttribute("aria-describedby", `${oe}-variables-error`)) : (r.removeAttribute("aria-invalid"), r.removeAttribute("aria-describedby")));
2193
+ }, [$e, oe, ae]);
2194
+ const Tt = T(!1);
2195
+ I(() => {
2196
+ var e, r;
2197
+ Ie ? (Tt.current = !0, (e = ke.current) == null || e.call(ke, $e)) : Tt.current && (Tt.current = !1, (r = ke.current) == null || r.call(ke, []));
2198
+ }, [$e, Ie]), I(() => {
2199
+ ne && ge.current();
2200
+ }, [ne]);
2201
+ const ie = x(
2169
2202
  (e, ...r) => {
2170
- const n = te.current;
2203
+ const n = J.current;
2171
2204
  if (!n) return !1;
2172
- const a = yt.current;
2205
+ const a = xt.current;
2173
2206
  if (a)
2174
2207
  try {
2175
2208
  n(N, "disableReadOnly");
@@ -2188,50 +2221,50 @@ const ha = Ot(
2188
2221
  }
2189
2222
  },
2190
2223
  [N]
2191
- ), le = x(
2224
+ ), ue = x(
2192
2225
  (e, r) => {
2193
- var we;
2226
+ var be;
2194
2227
  const n = (r == null ? void 0 : r.asHtml) ?? !0, a = n ? fe(e) : e;
2195
- if (se(n ? "insertion.insertHtml" : "insertion.insertText", a)) return;
2196
- const d = ie.current;
2197
- if (!d) return;
2198
- const w = d.selectionStart ?? d.value.length, S = d.selectionEnd ?? d.value.length;
2199
- d.value = d.value.slice(0, w) + a + d.value.slice(S);
2200
- const de = w + a.length;
2228
+ if (ie(n ? "insertion.insertHtml" : "insertion.insertText", a)) return;
2229
+ const f = de.current;
2230
+ if (!f) return;
2231
+ const v = f.selectionStart ?? f.value.length, _ = f.selectionEnd ?? f.value.length;
2232
+ f.value = f.value.slice(0, v) + a + f.value.slice(_);
2233
+ const re = v + a.length;
2201
2234
  try {
2202
- d.setSelectionRange(de, de);
2235
+ f.setSelectionRange(re, re);
2203
2236
  } catch {
2204
2237
  }
2205
- (we = J.current) == null || we.call(J, { html: fe(d.value), markdown: "" });
2238
+ (be = te.current) == null || be.call(te, { html: fe(f.value), markdown: "" });
2206
2239
  },
2207
- [se]
2208
- ), ke = M(null), oe = x(() => {
2240
+ [ie]
2241
+ ), Ce = T(null), ce = x(() => {
2209
2242
  var a;
2210
- const e = (a = W.current) == null ? void 0 : a.querySelector(".redactor-in"), r = typeof window < "u" ? window.getSelection() : null, n = /* @__PURE__ */ new Set();
2243
+ const e = (a = B.current) == null ? void 0 : a.querySelector(".redactor-in"), r = typeof window < "u" ? window.getSelection() : null, n = /* @__PURE__ */ new Set();
2211
2244
  if (e && r && r.anchorNode && e.contains(r.anchorNode) && typeof document.queryCommandState == "function") {
2212
- r.rangeCount > 0 && (ke.current = r.getRangeAt(0).cloneRange());
2245
+ r.rangeCount > 0 && (Ce.current = r.getRangeAt(0).cloneRange());
2213
2246
  try {
2214
2247
  document.queryCommandState("bold") && n.add("bold"), document.queryCommandState("italic") && n.add("italic"), document.queryCommandState("underline") && n.add("underline"), document.queryCommandState("strikeThrough") && n.add("strike"), document.queryCommandState("insertUnorderedList") && n.add("ul"), document.queryCommandState("insertOrderedList") && n.add("ol");
2215
2248
  const s = String(
2216
2249
  document.queryCommandValue("formatBlock") || ""
2217
2250
  ).toLowerCase();
2218
2251
  /^h[1-6]$/.test(s) ? (n.add("heading"), n.add(s)) : s === "blockquote" ? n.add("quote") : n.add("paragraph");
2219
- const d = r.anchorNode.nodeType === Node.TEXT_NODE ? r.anchorNode.parentElement : r.anchorNode;
2220
- d && e.contains(d) && d.closest("table") && n.add("table");
2252
+ const f = r.anchorNode.nodeType === Node.TEXT_NODE ? r.anchorNode.parentElement : r.anchorNode;
2253
+ f && e.contains(f) && f.closest("table") && n.add("table");
2221
2254
  } catch {
2222
2255
  }
2223
2256
  }
2224
- zr(
2225
- (s) => s.size === n.size && [...n].every((d) => s.has(d)) ? s : n
2257
+ Lr(
2258
+ (s) => s.size === n.size && [...n].every((f) => s.has(f)) ? s : n
2226
2259
  );
2227
- }, []), Ie = x(
2260
+ }, []), He = x(
2228
2261
  (e, ...r) => {
2229
- se(e, ...r), typeof window < "u" ? window.requestAnimationFrame(() => oe()) : oe();
2262
+ ie(e, ...r), typeof window < "u" ? window.requestAnimationFrame(() => ce()) : ce();
2230
2263
  },
2231
- [se, oe]
2264
+ [ie, ce]
2232
2265
  );
2233
2266
  I(() => {
2234
- const e = W.current;
2267
+ const e = B.current;
2235
2268
  if (!e) return;
2236
2269
  const r = {
2237
2270
  b: ["module.inline.format", { tag: "b" }],
@@ -2241,137 +2274,137 @@ const ha = Ot(
2241
2274
  if (!(a.metaKey || a.ctrlKey) || a.altKey || a.shiftKey || a.isComposing) return;
2242
2275
  const s = r[a.key.toLowerCase()];
2243
2276
  if (!s) return;
2244
- const d = e.querySelector(".redactor-in");
2245
- !d || !(a.target instanceof Node) || !d.contains(a.target) || yt.current || (a.preventDefault(), a.stopImmediatePropagation(), Ie(...s));
2277
+ const f = e.querySelector(".redactor-in");
2278
+ !f || !(a.target instanceof Node) || !f.contains(a.target) || xt.current || (a.preventDefault(), a.stopImmediatePropagation(), He(...s));
2246
2279
  };
2247
2280
  return e.addEventListener("keydown", n, !0), () => e.removeEventListener("keydown", n, !0);
2248
- }, [Ie]);
2249
- const Ce = x(
2281
+ }, [He]);
2282
+ const Ne = x(
2250
2283
  (e) => {
2251
- le(e, { asHtml: !0 }), typeof window < "u" && window.requestAnimationFrame(() => oe());
2284
+ ue(e, { asHtml: !0 }), typeof window < "u" && window.requestAnimationFrame(() => ce());
2252
2285
  },
2253
- [le, oe]
2254
- ), [Y, kt] = A(null), Pe = M(null), je = `${ee}-variables`, Ne = qe(() => {
2286
+ [ue, ce]
2287
+ ), [Y, At] = z(null), je = T(null), Be = `${oe}-variables`, Te = Pe(() => {
2255
2288
  if (!Y) return [];
2256
2289
  const e = Y.query.trim().toLowerCase(), r = e.replace(/\s+/g, "_");
2257
2290
  return (P ?? []).filter(
2258
- (n) => It.test(n.token) && (!e || n.token.toLowerCase().includes(r) || n.label.toLowerCase().includes(e))
2291
+ (n) => Dt.test(n.token) && (!e || n.token.toLowerCase().includes(r) || n.label.toLowerCase().includes(e))
2259
2292
  );
2260
- }, [Y, P]), me = x(() => {
2261
- Pe.current = null, kt(null);
2262
- }, []), et = x(
2293
+ }, [Y, P]), he = x(() => {
2294
+ je.current = null, At(null);
2295
+ }, []), rt = x(
2263
2296
  (e, r) => {
2264
2297
  const n = window.getSelection();
2265
2298
  if (!n) return;
2266
2299
  const a = document.createRange();
2267
- a.setStart(r.node, r.start), a.setEnd(r.node, r.end), n.removeAllRanges(), n.addRange(a), Ce(hr(e)), window.requestAnimationFrame(() => xe.current());
2300
+ a.setStart(r.node, r.start), a.setEnd(r.node, r.end), n.removeAllRanges(), n.addRange(a), Ne(xr(e)), window.requestAnimationFrame(() => ge.current());
2268
2301
  },
2269
- [Ce]
2302
+ [Ne]
2270
2303
  );
2271
2304
  I(() => {
2272
- const e = W.current;
2273
- if (!e || !Se) return;
2305
+ const e = B.current;
2306
+ if (!e || !Ie) return;
2274
2307
  const r = () => {
2275
- var sr;
2276
- const s = e.querySelector(".redactor-in"), d = window.getSelection();
2277
- if (!s || !d || d.rangeCount === 0 || !d.isCollapsed) {
2278
- me();
2308
+ var ur;
2309
+ const s = e.querySelector(".redactor-in"), f = window.getSelection();
2310
+ if (!s || !f || f.rangeCount === 0 || !f.isCollapsed) {
2311
+ he();
2279
2312
  return;
2280
2313
  }
2281
- const { startContainer: w, startOffset: S } = d.getRangeAt(0);
2282
- if (w.nodeType !== Node.TEXT_NODE || !s.contains(w) || (((sr = w.parentElement) == null ? void 0 : sr.closest(
2314
+ const { startContainer: v, startOffset: _ } = f.getRangeAt(0);
2315
+ if (v.nodeType !== Node.TEXT_NODE || !s.contains(v) || (((ur = v.parentElement) == null ? void 0 : ur.closest(
2283
2316
  '[data-redactor-type="variable"]'
2284
2317
  )) ?? null) !== null) {
2285
- me();
2318
+ he();
2286
2319
  return;
2287
2320
  }
2288
- const de = w, we = de.data.slice(0, S), dt = /\[\[([A-Za-z0-9_]+)\]\]$/.exec(we);
2289
- if (dt) {
2290
- me(), et(
2291
- ye.get(dt[1].toLowerCase()) ?? dt[1],
2292
- { node: de, start: S - dt[0].length, end: S }
2321
+ const re = v, be = re.data.slice(0, _), Re = /\[\[([A-Za-z0-9_]+)\]\]$/.exec(be);
2322
+ if (Re) {
2323
+ he(), rt(
2324
+ ee.get(Re[1].toLowerCase()) ?? Re[1],
2325
+ { node: re, start: _ - Re[0].length, end: _ }
2293
2326
  );
2294
2327
  return;
2295
2328
  }
2296
- const ut = /\[\[([A-Za-z0-9_ ]{0,40})$/.exec(we), At = Ke.current;
2297
- if (!ut || !At || (P ?? []).length === 0) {
2298
- me();
2329
+ const mt = /\[\[([A-Za-z0-9_ ]{0,40})$/.exec(be), Mt = Xe.current;
2330
+ if (!mt || !Mt || (P ?? []).length === 0) {
2331
+ he();
2299
2332
  return;
2300
2333
  }
2301
- const zt = {
2302
- node: de,
2303
- start: S - ut[0].length,
2304
- end: S
2334
+ const Et = {
2335
+ node: re,
2336
+ start: _ - mt[0].length,
2337
+ end: _
2305
2338
  };
2306
- Pe.current = zt;
2307
- const Mt = document.createRange();
2308
- Mt.setStart(de, zt.start), Mt.setEnd(de, zt.end);
2309
- const _t = Mt.getBoundingClientRect(), Et = At.getBoundingClientRect(), Ur = getComputedStyle(At).direction === "rtl";
2310
- kt((Rt) => ({
2311
- query: ut[1],
2312
- index: Rt && Rt.query === ut[1] ? Rt.index : 0,
2313
- left: Ur ? Et.right - _t.right : _t.left - Et.left,
2314
- top: _t.bottom - Et.top + 4
2339
+ je.current = Et;
2340
+ const St = document.createRange();
2341
+ St.setStart(re, Et.start), St.setEnd(re, Et.end);
2342
+ const Lt = St.getBoundingClientRect(), It = Mt.getBoundingClientRect(), rn = getComputedStyle(Mt).direction === "rtl";
2343
+ At(($t) => ({
2344
+ query: mt[1],
2345
+ index: $t && $t.query === mt[1] ? $t.index : 0,
2346
+ left: rn ? It.right - Lt.right : Lt.left - It.left,
2347
+ top: Lt.bottom - It.top + 4
2315
2348
  }));
2316
2349
  }, n = (s) => {
2317
- if (!Pe.current) return;
2318
- const d = tt.current.length;
2350
+ if (!je.current) return;
2351
+ const f = nt.current.length;
2319
2352
  if (s.key === "ArrowDown" || s.key === "ArrowUp") {
2320
- if (!d) return;
2353
+ if (!f) return;
2321
2354
  s.preventDefault(), s.stopImmediatePropagation();
2322
- const w = s.key === "ArrowDown" ? 1 : d - 1;
2323
- kt(
2324
- (S) => S && { ...S, index: (S.index + w) % d }
2355
+ const v = s.key === "ArrowDown" ? 1 : f - 1;
2356
+ At(
2357
+ (_) => _ && { ..._, index: (_.index + v) % f }
2325
2358
  );
2326
- } else if ((s.key === "Enter" || s.key === "Tab") && d) {
2359
+ } else if ((s.key === "Enter" || s.key === "Tab") && f) {
2327
2360
  s.preventDefault(), s.stopImmediatePropagation();
2328
- const w = tt.current[Zt.current] ?? tt.current[0], S = Pe.current;
2329
- me(), et(w.token, S);
2330
- } else s.key === "Escape" && (s.preventDefault(), s.stopImmediatePropagation(), me());
2331
- }, a = () => me();
2361
+ const v = nt.current[Qt.current] ?? nt.current[0], _ = je.current;
2362
+ he(), rt(v.token, _);
2363
+ } else s.key === "Escape" && (s.preventDefault(), s.stopImmediatePropagation(), he());
2364
+ }, a = () => he();
2332
2365
  return e.addEventListener("input", r), e.addEventListener("keydown", n, !0), e.addEventListener("focusout", a), () => {
2333
2366
  e.removeEventListener("input", r), e.removeEventListener("keydown", n, !0), e.removeEventListener("focusout", a);
2334
2367
  };
2335
2368
  }, [
2336
- Se,
2337
- ye,
2369
+ Ie,
2370
+ ee,
2338
2371
  P,
2339
- et,
2340
- me
2372
+ rt,
2373
+ he
2341
2374
  ]);
2342
- const tt = M(Ne), Zt = M(0);
2375
+ const nt = T(Te), Qt = T(0);
2343
2376
  I(() => {
2344
- tt.current = Ne, Zt.current = (Y == null ? void 0 : Y.index) ?? 0;
2345
- }, [Ne, Y]), I(() => {
2377
+ nt.current = Te, Qt.current = (Y == null ? void 0 : Y.index) ?? 0;
2378
+ }, [Te, Y]), I(() => {
2346
2379
  var r;
2347
- const e = (r = W.current) == null ? void 0 : r.querySelector(".redactor-in");
2380
+ const e = (r = B.current) == null ? void 0 : r.querySelector(".redactor-in");
2348
2381
  if (e)
2349
2382
  if (Y) {
2350
- e.setAttribute("aria-expanded", "true"), e.setAttribute("aria-controls", je);
2351
- const n = Ne[Y.index];
2383
+ e.setAttribute("aria-expanded", "true"), e.setAttribute("aria-controls", Be);
2384
+ const n = Te[Y.index];
2352
2385
  n ? e.setAttribute(
2353
2386
  "aria-activedescendant",
2354
- `${je}-${n.token}`
2387
+ `${Be}-${n.token}`
2355
2388
  ) : e.removeAttribute("aria-activedescendant");
2356
2389
  } else
2357
2390
  e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls"), e.removeAttribute("aria-activedescendant");
2358
- }, [Y, Ne, je]);
2359
- const Be = x(() => {
2391
+ }, [Y, Te, Be]);
2392
+ const Ge = x(() => {
2360
2393
  var r;
2361
2394
  if (typeof window < "u") {
2362
- const n = (r = W.current) == null ? void 0 : r.querySelector(".redactor-in"), a = window.getSelection();
2363
- n && a && a.rangeCount > 0 && a.anchorNode && n.contains(a.anchorNode) && (ke.current = a.getRangeAt(0).cloneRange());
2395
+ const n = (r = B.current) == null ? void 0 : r.querySelector(".redactor-in"), a = window.getSelection();
2396
+ n && a && a.rangeCount > 0 && a.anchorNode && n.contains(a.anchorNode) && (Ce.current = a.getRangeAt(0).cloneRange());
2364
2397
  }
2365
- const e = te.current;
2398
+ const e = J.current;
2366
2399
  if (e)
2367
2400
  try {
2368
2401
  e(N, "selection.save");
2369
2402
  } catch {
2370
2403
  }
2371
- }, [N]), ve = x(() => {
2372
- const e = te.current;
2404
+ }, [N]), xe = x(() => {
2405
+ const e = J.current;
2373
2406
  if (!e) return;
2374
- const r = ke.current;
2407
+ const r = Ce.current;
2375
2408
  try {
2376
2409
  e(N, "editor.focus");
2377
2410
  } catch {
@@ -2389,77 +2422,77 @@ const ha = Ot(
2389
2422
  e(N, "selection.restore");
2390
2423
  } catch {
2391
2424
  }
2392
- }, [N]), Rr = x(() => {
2425
+ }, [N]), Dr = x(() => {
2393
2426
  var n;
2394
2427
  if (typeof window > "u") return "";
2395
- const e = (n = W.current) == null ? void 0 : n.querySelector(".redactor-in"), r = window.getSelection();
2428
+ const e = (n = B.current) == null ? void 0 : n.querySelector(".redactor-in"), r = window.getSelection();
2396
2429
  return !e || !r || !r.anchorNode || !e.contains(r.anchorNode) ? "" : r.toString();
2397
- }, []), Sr = x(() => {
2430
+ }, []), Or = x(() => {
2398
2431
  var s;
2399
2432
  if (typeof window > "u") return null;
2400
- const e = (s = W.current) == null ? void 0 : s.querySelector(".redactor-in"), r = window.getSelection();
2433
+ const e = (s = B.current) == null ? void 0 : s.querySelector(".redactor-in"), r = window.getSelection();
2401
2434
  if (!e || !r || r.rangeCount === 0) return null;
2402
2435
  const n = r.anchorNode, a = n && n.nodeType === Node.TEXT_NODE ? n.parentElement : n;
2403
2436
  return !a || !e.contains(a) ? null : a.closest("table");
2404
- }, []), Ut = M(null), rt = x(() => {
2437
+ }, []), Yt = T(null), ot = x(() => {
2405
2438
  var s;
2406
2439
  if (typeof window > "u") return null;
2407
- const e = (s = W.current) == null ? void 0 : s.querySelector(".redactor-in"), r = window.getSelection();
2440
+ const e = (s = B.current) == null ? void 0 : s.querySelector(".redactor-in"), r = window.getSelection();
2408
2441
  if (!e || !r || r.rangeCount === 0) return null;
2409
2442
  const n = r.anchorNode, a = n && n.nodeType === Node.TEXT_NODE ? n.parentElement : n;
2410
2443
  return !a || !e.contains(a) ? null : a.closest("td,th");
2411
- }, []), Lr = x(() => {
2412
- Ut.current = rt();
2413
- }, [rt]), Ir = x(
2444
+ }, []), qr = x(() => {
2445
+ Yt.current = ot();
2446
+ }, [ot]), Pr = x(
2414
2447
  (e, r) => {
2415
- var d;
2416
- const n = Ut.current ?? rt();
2448
+ var f;
2449
+ const n = Yt.current ?? ot();
2417
2450
  if (!n) return;
2418
- const a = e === "row" ? Array.from(((d = n.closest("tr")) == null ? void 0 : d.children) ?? [n]).filter(
2419
- (w) => w instanceof HTMLElement && (w.tagName === "TD" || w.tagName === "TH")
2420
- ) : [n], s = te.current;
2451
+ const a = e === "row" ? Array.from(((f = n.closest("tr")) == null ? void 0 : f.children) ?? [n]).filter(
2452
+ (v) => v instanceof HTMLElement && (v.tagName === "TD" || v.tagName === "TH")
2453
+ ) : [n], s = J.current;
2421
2454
  if (s)
2422
2455
  try {
2423
2456
  s(N, "module.buffer.trigger");
2424
2457
  } catch {
2425
2458
  }
2426
- for (const w of a)
2427
- r ? w.style.setProperty("background-color", r) : w.style.removeProperty("background-color");
2459
+ for (const v of a)
2460
+ r ? v.style.setProperty("background-color", r) : v.style.removeProperty("background-color");
2428
2461
  if (s)
2429
2462
  try {
2430
2463
  s(N, "broadcast", "hardsync");
2431
2464
  } catch {
2432
2465
  }
2433
- typeof window < "u" && window.requestAnimationFrame(() => oe());
2466
+ typeof window < "u" && window.requestAnimationFrame(() => ce());
2434
2467
  },
2435
- [rt, N, oe]
2468
+ [ot, N, ce]
2436
2469
  );
2437
2470
  I(() => {
2438
- const e = W.current;
2471
+ const e = B.current;
2439
2472
  if (typeof window > "u" || !e) return;
2440
2473
  const r = (s) => {
2441
- const d = e.querySelector(".redactor-in"), w = s.target;
2442
- if (!d || !(w instanceof Node) || !d.contains(w))
2474
+ const f = e.querySelector(".redactor-in"), v = s.target;
2475
+ if (!f || !(v instanceof Node) || !f.contains(v))
2443
2476
  return;
2444
- const S = w instanceof Element ? w.closest("img") : null;
2445
- Ye(S && d.contains(S) ? S : null);
2477
+ const _ = v instanceof Element ? v.closest("img") : null;
2478
+ Je(_ && f.contains(_) ? _ : null);
2446
2479
  }, n = (s) => {
2447
- s.key === "Escape" && Qe.current && Ye(null);
2480
+ s.key === "Escape" && Ye.current && Je(null);
2448
2481
  }, a = (s) => {
2449
- const d = s.relatedTarget;
2450
- (!(d instanceof Node) || !e.contains(d)) && Ye(null);
2482
+ const f = s.relatedTarget;
2483
+ (!(f instanceof Node) || !e.contains(f)) && Je(null);
2451
2484
  };
2452
2485
  return e.addEventListener("click", r), e.addEventListener("keydown", n), e.addEventListener("focusout", a), () => {
2453
2486
  e.removeEventListener("click", r), e.removeEventListener("keydown", n), e.removeEventListener("focusout", a);
2454
2487
  };
2455
- }, [Ye]);
2456
- const $r = x(
2488
+ }, [Je]);
2489
+ const Fr = x(
2457
2490
  (e) => {
2458
- const r = Qe.current;
2491
+ const r = Ye.current;
2459
2492
  if (!r) return;
2460
- const n = Ht.includes(
2493
+ const n = Ot.includes(
2461
2494
  e
2462
- ) ? Ht : xr, a = te.current;
2495
+ ) ? Ot : zr, a = J.current;
2463
2496
  if (a)
2464
2497
  try {
2465
2498
  a(N, "module.buffer.trigger");
@@ -2471,14 +2504,14 @@ const ha = Ot(
2471
2504
  a(N, "broadcast", "hardsync");
2472
2505
  } catch {
2473
2506
  }
2474
- typeof window < "u" && window.requestAnimationFrame(() => oe());
2507
+ typeof window < "u" && window.requestAnimationFrame(() => ce());
2475
2508
  },
2476
- [N, oe]
2477
- ), Hr = x(
2509
+ [N, ce]
2510
+ ), jr = x(
2478
2511
  (e) => {
2479
- const r = Qe.current;
2512
+ const r = Ye.current;
2480
2513
  if (!r) return;
2481
- const n = te.current;
2514
+ const n = J.current;
2482
2515
  if (n)
2483
2516
  try {
2484
2517
  n(N, "module.buffer.trigger");
@@ -2489,168 +2522,168 @@ const ha = Ot(
2489
2522
  n(N, "broadcast", "hardsync");
2490
2523
  } catch {
2491
2524
  }
2492
- typeof window < "u" && window.requestAnimationFrame(() => oe());
2525
+ typeof window < "u" && window.requestAnimationFrame(() => ce());
2493
2526
  },
2494
- [N, oe]
2495
- ), Dr = x(
2527
+ [N, ce]
2528
+ ), Br = x(
2496
2529
  (e) => {
2497
2530
  var n;
2498
- const r = te.current;
2531
+ const r = J.current;
2499
2532
  if (r && typeof window < "u") {
2500
- const a = (n = W.current) == null ? void 0 : n.querySelector(".redactor-in"), s = window.getSelection(), d = s == null ? void 0 : s.anchorNode, w = d && d.nodeType === Node.TEXT_NODE ? d.parentElement : d, S = w && (a != null && a.contains(w)) ? w.closest("ul,ol") : null;
2501
- if (S)
2533
+ const a = (n = B.current) == null ? void 0 : n.querySelector(".redactor-in"), s = window.getSelection(), f = s == null ? void 0 : s.anchorNode, v = f && f.nodeType === Node.TEXT_NODE ? f.parentElement : f, _ = v && (a != null && a.contains(v)) ? v.closest("ul,ol") : null;
2534
+ if (_)
2502
2535
  try {
2503
- r(N, "caret.setAfter", S);
2536
+ r(N, "caret.setAfter", _);
2504
2537
  } catch {
2505
2538
  }
2506
2539
  }
2507
- Ce(e), typeof window < "u" && window.requestAnimationFrame(() => {
2540
+ Ne(e), typeof window < "u" && window.requestAnimationFrame(() => {
2508
2541
  var s;
2509
- const a = (s = W.current) == null ? void 0 : s.querySelector(".redactor-in");
2510
- a == null || a.querySelectorAll("table td, table th").forEach((d) => {
2511
- let w = d.lastChild;
2512
- for (; w && w.nodeType === Node.TEXT_NODE && !(w.textContent ?? "").trim(); ) {
2513
- const S = w.previousSibling;
2514
- d.removeChild(w), w = S;
2542
+ const a = (s = B.current) == null ? void 0 : s.querySelector(".redactor-in");
2543
+ a == null || a.querySelectorAll("table td, table th").forEach((f) => {
2544
+ let v = f.lastChild;
2545
+ for (; v && v.nodeType === Node.TEXT_NODE && !(v.textContent ?? "").trim(); ) {
2546
+ const _ = v.previousSibling;
2547
+ f.removeChild(v), v = _;
2515
2548
  }
2516
2549
  });
2517
2550
  });
2518
2551
  },
2519
- [Ce, N]
2520
- ), qr = x(
2552
+ [Ne, N]
2553
+ ), Gr = x(
2521
2554
  async (e, r) => {
2522
- if (c) return c(e, r);
2523
- if (!m) throw new Error("No image upload URL configured.");
2555
+ if (u) return u(e, r);
2556
+ if (!h) throw new Error("No image upload URL configured.");
2524
2557
  const n = new FormData();
2525
2558
  n.append("file", e);
2526
- const a = await fetch(m, {
2559
+ const a = await fetch(h, {
2527
2560
  method: "POST",
2528
2561
  body: n,
2529
2562
  credentials: "same-origin",
2530
2563
  signal: r
2531
2564
  });
2532
2565
  if (!a.ok) throw new Error(`Image upload failed (${a.status}).`);
2533
- const s = da(await a.json());
2566
+ const s = ba(await a.json());
2534
2567
  if (!s) throw new Error("Image upload response contained no URL.");
2535
2568
  return s;
2536
2569
  },
2537
- [m, c]
2538
- ), Fe = M(null), nt = M(null), [Te, Qt] = A(!1), [Or, Yt] = A(!1), [Pr, Ct] = A(""), ot = x(() => {
2539
- const e = nt.current;
2540
- e != null && e.parentNode && e.parentNode.removeChild(e), nt.current = null;
2541
- }, []), Jt = x((e) => {
2570
+ [h, u]
2571
+ ), Ve = T(null), at = T(null), [Ae, Jt] = z(!1), [Vr, er] = z(!1), [Kr, zt] = z(""), it = x(() => {
2572
+ const e = at.current;
2573
+ e != null && e.parentNode && e.parentNode.removeChild(e), at.current = null;
2574
+ }, []), tr = x((e) => {
2542
2575
  var a;
2543
- const r = (a = W.current) == null ? void 0 : a.querySelector(
2576
+ const r = (a = B.current) == null ? void 0 : a.querySelector(
2544
2577
  ".redactor-in"
2545
2578
  );
2546
2579
  if (!r) return;
2547
- let n = nt.current;
2580
+ let n = at.current;
2548
2581
  if (!n || !r.contains(n)) {
2549
2582
  n = document.createElement("span"), n.setAttribute("data-rte-interim", ""), n.setAttribute("contenteditable", "false");
2550
2583
  const s = window.getSelection();
2551
2584
  if (s && s.rangeCount > 0 && r.contains(s.anchorNode)) {
2552
- const d = s.getRangeAt(0);
2553
- d.collapse(!1), d.insertNode(n);
2585
+ const f = s.getRangeAt(0);
2586
+ f.collapse(!1), f.insertNode(n);
2554
2587
  } else
2555
2588
  r.appendChild(n);
2556
- nt.current = n;
2589
+ at.current = n;
2557
2590
  }
2558
2591
  n.textContent = e;
2559
- }, []), at = x(() => {
2592
+ }, []), st = x(() => {
2560
2593
  var e;
2561
- (e = Fe.current) == null || e.abort();
2562
- }, []), er = x(() => {
2563
- var d;
2594
+ (e = Ve.current) == null || e.abort();
2595
+ }, []), rr = x(() => {
2596
+ var f;
2564
2597
  if (typeof window > "u") return !1;
2565
- const e = window.getSelection(), r = (d = W.current) == null ? void 0 : d.querySelector(".redactor-in");
2598
+ const e = window.getSelection(), r = (f = B.current) == null ? void 0 : f.querySelector(".redactor-in");
2566
2599
  if (!e || e.rangeCount === 0 || !r) return !1;
2567
2600
  const { startContainer: n, startOffset: a } = e.getRangeAt(0);
2568
2601
  if (!r.contains(n) || n.nodeType !== Node.TEXT_NODE || a === 0)
2569
2602
  return !1;
2570
2603
  const s = n.data.charAt(a - 1);
2571
2604
  return /\S/.test(s) && s !== " ";
2572
- }, []), ce = y !== void 0 && !y.granted, it = x(() => {
2573
- if (!O || ce) return;
2605
+ }, []), me = w !== void 0 && !w.granted, lt = x(() => {
2606
+ if (!q || me) return;
2574
2607
  const e = new AbortController();
2575
- Fe.current = e, Yt(!1), Qt(!0), Ct(D("editor.ai.listening")), ot(), O({
2608
+ Ve.current = e, er(!1), Jt(!0), zt(D("editor.ai.listening")), it(), q({
2576
2609
  signal: e.signal,
2577
2610
  // Interim text shows live in the editor (grey + caret); each final
2578
2611
  // replaces it with committed text at the caret.
2579
2612
  onPartialTranscript: (r) => {
2580
- e.signal.aborted || Jt(r);
2613
+ e.signal.aborted || tr(r);
2581
2614
  },
2582
2615
  onFinalTranscript: (r) => {
2583
2616
  if (e.signal.aborted) return;
2584
- ot();
2617
+ it();
2585
2618
  const n = r.trim();
2586
2619
  if (n) {
2587
- const a = er() ? " " : "";
2588
- le(`${a}${n} `, { asHtml: !1 }), Ct(n);
2620
+ const a = rr() ? " " : "";
2621
+ ue(`${a}${n} `, { asHtml: !1 }), zt(n);
2589
2622
  }
2590
2623
  }
2591
2624
  }).catch((r) => {
2592
2625
  var n;
2593
2626
  if (!(e.signal.aborted || r && typeof r == "object" && "name" in r && r.name === "AbortError")) {
2594
- if (ca(r) && ((n = We.current) == null || n.call(We), Vt.current)) {
2595
- Gt(!0), Re(!0);
2627
+ if (ga(r) && ((n = Ze.current) == null || n.call(Ze), Wt.current)) {
2628
+ Kt(!0), Le(!0);
2596
2629
  return;
2597
2630
  }
2598
- Yt(!0);
2631
+ er(!0);
2599
2632
  }
2600
2633
  }).finally(() => {
2601
- ot(), Fe.current === e && (Fe.current = null, Qt(!1), Ct(""));
2634
+ it(), Ve.current === e && (Ve.current = null, Jt(!1), zt(""));
2602
2635
  });
2603
2636
  }, [
2604
- O,
2605
- ce,
2606
- le,
2607
- ot,
2608
- Jt,
2609
- er,
2637
+ q,
2638
+ me,
2639
+ ue,
2640
+ it,
2641
+ tr,
2642
+ rr,
2610
2643
  D
2611
2644
  ]);
2612
2645
  I(() => () => {
2613
2646
  var e;
2614
- return (e = Fe.current) == null ? void 0 : e.abort();
2647
+ return (e = Ve.current) == null ? void 0 : e.abort();
2615
2648
  }, []);
2616
- const [jr, st] = A(null), $e = M(null), [Br, tr] = A(!1), Fr = ((y == null ? void 0 : y.pending) ?? !1) || Br, lt = M(!1), rr = x(() => {
2617
- $e.current = null, lt.current = !1, st(null);
2618
- }, []), Gr = x(() => {
2649
+ const [Wr, ct] = z(null), De = T(null), [Xr, nr] = z(!1), Zr = ((w == null ? void 0 : w.pending) ?? !1) || Xr, dt = T(!1), or = x(() => {
2650
+ De.current = null, dt.current = !1, ct(null);
2651
+ }, []), Ur = x(() => {
2619
2652
  var r;
2620
- lt.current = !0;
2621
- const e = (r = y == null ? void 0 : y.onGrant) == null ? void 0 : r.call(y);
2622
- e && typeof e.then == "function" && (tr(!0), Promise.resolve(e).catch(() => {
2623
- }).finally(() => tr(!1)));
2624
- }, [y]), nr = M((y == null ? void 0 : y.granted) ?? !0);
2653
+ dt.current = !0;
2654
+ const e = (r = w == null ? void 0 : w.onGrant) == null ? void 0 : r.call(w);
2655
+ e && typeof e.then == "function" && (nr(!0), Promise.resolve(e).catch(() => {
2656
+ }).finally(() => nr(!1)));
2657
+ }, [w]), ar = T((w == null ? void 0 : w.granted) ?? !0);
2625
2658
  I(() => {
2626
- const e = nr.current;
2627
- if (nr.current = (y == null ? void 0 : y.granted) ?? !0, !e && (y != null && y.granted) && $e.current) {
2628
- const r = $e.current, n = lt.current;
2629
- if ($e.current = null, lt.current = !1, st(null), !n) return;
2630
- r === "write" ? Re(!0) : (ve(), it());
2659
+ const e = ar.current;
2660
+ if (ar.current = (w == null ? void 0 : w.granted) ?? !0, !e && (w != null && w.granted) && De.current) {
2661
+ const r = De.current, n = dt.current;
2662
+ if (De.current = null, dt.current = !1, ct(null), !n) return;
2663
+ r === "write" ? Le(!0) : (xe(), lt());
2631
2664
  }
2632
- }, [y == null ? void 0 : y.granted, ve, it]), I(() => {
2633
- ce && (Re(!1), Te && at());
2634
- }, [ce, Te, at]);
2635
- const Vr = x(() => {
2636
- if (Te) {
2637
- at();
2665
+ }, [w == null ? void 0 : w.granted, xe, lt]), I(() => {
2666
+ me && (Le(!1), Ae && st());
2667
+ }, [me, Ae, st]);
2668
+ const Qr = x(() => {
2669
+ if (Ae) {
2670
+ st();
2638
2671
  return;
2639
2672
  }
2640
- if (ce) {
2641
- Be(), $e.current = "dictate", st("dictate");
2673
+ if (me) {
2674
+ Ge(), De.current = "dictate", ct("dictate");
2642
2675
  return;
2643
2676
  }
2644
- it();
2645
- }, [Te, at, ce, Be, it]), Kr = x(() => {
2646
- Be();
2647
- const e = ke.current;
2648
- if (Xe.current = e ? e.cloneRange() : null, Tr(e && !e.collapsed ? e.toString() : ""), ce) {
2649
- $e.current = "write", st("write");
2677
+ lt();
2678
+ }, [Ae, st, me, Ge, lt]), Yr = x(() => {
2679
+ Ge();
2680
+ const e = Ce.current;
2681
+ if (Ue.current = e ? e.cloneRange() : null, Er(e && !e.collapsed ? e.toString() : ""), me) {
2682
+ De.current = "write", ct("write");
2650
2683
  return;
2651
2684
  }
2652
- Re(!0);
2653
- }, [Be, ce]), or = qe(() => y != null && y.granted ? /* @__PURE__ */ k(Me, { children: [
2685
+ Le(!0);
2686
+ }, [Ge, me]), ir = Pe(() => w != null && w.granted ? /* @__PURE__ */ k(Me, { children: [
2654
2687
  D(
2655
2688
  "editor.ai.consentRecorded",
2656
2689
  "AI assistance consent has been recorded."
@@ -2659,46 +2692,46 @@ const ha = Ot(
2659
2692
  " ",
2660
2693
  H
2661
2694
  ] }) : null
2662
- ] }) : H, [y, H, D]), [ge, Nt] = A(null), Ae = M(null), ar = x(
2695
+ ] }) : H, [w, H, D]), [pe, Rt] = z(null), ze = T(null), sr = x(
2663
2696
  (e, r) => {
2664
- if (Ae.current) return;
2697
+ if (ze.current) return;
2665
2698
  const n = new AbortController();
2666
- Ae.current = n, Nt(e);
2667
- const a = ue();
2699
+ ze.current = n, Rt(e);
2700
+ const a = le();
2668
2701
  Promise.resolve(r({ html: a, signal: n.signal })).then((s) => {
2669
- var w;
2702
+ var v;
2670
2703
  if (n.signal.aborted) return;
2671
- const d = fe(String(s ?? ""));
2672
- se("source.setCode", d), (w = J.current) == null || w.call(J, { html: d, markdown: "" });
2704
+ const f = fe(String(s ?? ""));
2705
+ ie("source.setCode", f), (v = te.current) == null || v.call(te, { html: f, markdown: "" });
2673
2706
  }).catch(() => {
2674
2707
  }).finally(() => {
2675
- Ae.current === n && (Ae.current = null, Nt(null));
2708
+ ze.current === n && (ze.current = null, Rt(null));
2676
2709
  });
2677
2710
  },
2678
- [ue, se]
2679
- ), ir = x(() => {
2711
+ [le, ie]
2712
+ ), lr = x(() => {
2680
2713
  var e;
2681
- (e = Ae.current) == null || e.abort(), Ae.current = null, Nt(null);
2714
+ (e = ze.current) == null || e.abort(), ze.current = null, Rt(null);
2682
2715
  }, []);
2683
2716
  I(() => () => {
2684
2717
  var e;
2685
- return (e = Ae.current) == null ? void 0 : e.abort();
2718
+ return (e = ze.current) == null ? void 0 : e.abort();
2686
2719
  }, []), I(() => {
2687
- const e = ie.current;
2720
+ const e = de.current;
2688
2721
  if (!e) return;
2689
- e.value = Er.current, xe.current();
2690
- const r = ua($);
2722
+ e.value = Hr.current, ge.current();
2723
+ const r = ya($);
2691
2724
  if (!r) {
2692
- Bt(!0);
2725
+ Gt(!0);
2693
2726
  return;
2694
2727
  }
2695
- te.current = r, e.value = $t(e.value, Ze.current);
2728
+ J.current = r, e.value = ht(e.value, Qe.current);
2696
2729
  const n = {
2697
- lang: F ?? fa(j.language || "en"),
2730
+ lang: G ?? xa(F.language || "en"),
2698
2731
  // The kit renders its OWN toolbar (EditorToolbar) and drives Redactor
2699
2732
  // via the command API, so Redactor's native toolbar is suppressed.
2700
2733
  toolbar: !1,
2701
- plugins: _ ?? [],
2734
+ plugins: M ?? [],
2702
2735
  placeholder: l ?? D("editor.placeholder"),
2703
2736
  toolbarFixed: !1,
2704
2737
  // Platform parity (RedactorWysiwyg.js:84): no inline shortcode expansion.
@@ -2709,7 +2742,7 @@ const ha = Ot(
2709
2742
  // second, untokenised, mouse-only UI competing with ours.
2710
2743
  imageEditable: !1,
2711
2744
  imageResizable: !1
2712
- }, a = m ? { imageUpload: m } : {}, s = (L == null ? void 0 : L.callbacks) ?? {}, d = {
2745
+ }, a = h ? { imageUpload: h } : {}, s = (L == null ? void 0 : L.callbacks) ?? {}, f = {
2713
2746
  ...n,
2714
2747
  ...a,
2715
2748
  ...L ?? {},
@@ -2720,126 +2753,150 @@ const ha = Ot(
2720
2753
  imageResizable: !1,
2721
2754
  callbacks: {
2722
2755
  ...s,
2723
- changed(w) {
2724
- xe.current();
2725
- const S = Lt(
2726
- ia(fr(w))
2727
- ), de = fe(S);
2728
- bt.current = !0, J.current && (Oe.current && clearTimeout(Oe.current), Oe.current = setTimeout(() => {
2729
- var we;
2730
- (we = J.current) == null || we.call(J, { html: de, markdown: "" });
2731
- }, 100));
2756
+ changed(v) {
2757
+ ge.current();
2758
+ const _ = gt(
2759
+ yr(vr(v))
2760
+ ), re = fe(_), be = dr.current;
2761
+ if (be && Date.now() < be.until && wr(re) === be.text) {
2762
+ et.current = re;
2763
+ return;
2764
+ }
2765
+ re !== et.current && (et.current = re, wt.current = !0, te.current && (Fe.current && clearTimeout(Fe.current), Fe.current = setTimeout(() => {
2766
+ var Re;
2767
+ (Re = te.current) == null || Re.call(te, { html: re, markdown: "" });
2768
+ }, 100)));
2732
2769
  },
2733
- keydown(w) {
2734
- var S;
2735
- (S = Je.current) == null || S.call(Je, w);
2770
+ keydown(v) {
2771
+ var _;
2772
+ (_ = tt.current) == null || _.call(tt, v);
2736
2773
  },
2737
2774
  observe() {
2738
- oe();
2775
+ ce();
2739
2776
  }
2740
2777
  }
2741
2778
  };
2742
2779
  try {
2743
- if (r(N, d), xe.current(), v)
2780
+ if (r(N, f), et.current = fe(
2781
+ gt(yr(le()))
2782
+ ), ge.current(), b)
2744
2783
  try {
2745
2784
  r(N, "enableReadOnly");
2746
2785
  } catch {
2747
2786
  }
2748
2787
  } catch {
2749
- Bt(!0);
2788
+ Gt(!0);
2750
2789
  }
2751
2790
  return () => {
2752
- Oe.current && clearTimeout(Oe.current);
2791
+ Fe.current && clearTimeout(Fe.current);
2753
2792
  try {
2754
2793
  r(N, "destroy");
2755
2794
  } catch {
2756
2795
  }
2757
- te.current = null;
2796
+ J.current = null;
2758
2797
  };
2759
- }, []), I(() => {
2760
- if (!te.current || h === void 0) return;
2761
- if (bt.current) {
2762
- bt.current = !1;
2798
+ }, []);
2799
+ const cr = T(ee), dr = T(
2800
+ null
2801
+ );
2802
+ I(() => {
2803
+ var n, a;
2804
+ if (cr.current === ee || (cr.current = ee, !J.current || ee.size === 0)) return;
2805
+ const e = le(), r = ht(e, ee);
2806
+ if (r !== e) {
2807
+ const s = (n = B.current) == null ? void 0 : n.querySelector(".redactor-in"), v = s != null && s.contains(document.activeElement) && s ? ha(s) : null;
2808
+ dr.current = {
2809
+ text: wr(e),
2810
+ until: Date.now() + 1e3
2811
+ }, ie("source.setCode", r);
2812
+ const _ = (a = B.current) == null ? void 0 : a.querySelector(".redactor-in");
2813
+ v !== null && _ && pa(_, v);
2814
+ }
2815
+ window.requestAnimationFrame(() => ge.current());
2816
+ }, [ee, le, ie]), I(() => {
2817
+ if (!J.current || m === void 0) return;
2818
+ if (wt.current) {
2819
+ wt.current = !1;
2763
2820
  return;
2764
2821
  }
2765
- const e = $t(
2766
- fe(Lt(h)),
2767
- Ze.current
2822
+ const e = ht(
2823
+ fe(gt(m)),
2824
+ Qe.current
2768
2825
  );
2769
- Lt(ue()) !== e && se("source.setCode", e);
2770
- }, [h, ue, se]), I(() => {
2771
- yt.current = v;
2772
- const e = te.current;
2826
+ gt(le()) !== e && ie("source.setCode", e);
2827
+ }, [m, le, ie]), I(() => {
2828
+ xt.current = b;
2829
+ const e = J.current;
2773
2830
  if (e)
2774
2831
  try {
2775
- e(N, v ? "enableReadOnly" : "disableReadOnly");
2832
+ e(N, b ? "enableReadOnly" : "disableReadOnly");
2776
2833
  } catch {
2777
2834
  }
2778
- }, [v, N]), I(() => {
2779
- if (!re || h === void 0) return;
2780
- const e = ie.current;
2835
+ }, [b, N]), I(() => {
2836
+ if (!ae || m === void 0) return;
2837
+ const e = de.current;
2781
2838
  if (!e) return;
2782
- const r = fe(h);
2839
+ const r = fe(m);
2783
2840
  e.value !== r && document.activeElement !== e && (e.value = r);
2784
- }, [re, h]);
2785
- const He = qe(
2841
+ }, [ae, m]);
2842
+ const Oe = Pe(
2786
2843
  () => ({
2787
2844
  getHTML() {
2788
- return ue();
2845
+ return le();
2789
2846
  },
2790
2847
  getText() {
2791
- return ue().replace(/<[^>]*>/g, " ").replace(/&nbsp;/gi, " ").replace(/\s+/g, " ").trim();
2848
+ return le().replace(/<[^>]*>/g, " ").replace(/&nbsp;/gi, " ").replace(/\s+/g, " ").trim();
2792
2849
  },
2793
2850
  getMarkdown() {
2794
2851
  return "";
2795
2852
  },
2796
2853
  setContent(e) {
2797
2854
  const r = fe(e);
2798
- se(
2855
+ ie(
2799
2856
  "source.setCode",
2800
- $t(r, Ze.current)
2801
- ) || ie.current && (ie.current.value = r);
2857
+ ht(r, Qe.current)
2858
+ ) || de.current && (de.current.value = r);
2802
2859
  },
2803
- insertAtCursor: le,
2860
+ insertAtCursor: ue,
2804
2861
  applyFormat(e) {
2805
- const r = ma[e];
2806
- r && Ie(...r);
2862
+ const r = va[e];
2863
+ r && He(...r);
2807
2864
  },
2808
2865
  focus() {
2809
2866
  var r;
2810
- const e = te.current;
2867
+ const e = J.current;
2811
2868
  if (e)
2812
2869
  try {
2813
2870
  e(N, "editor.focus");
2814
2871
  return;
2815
2872
  } catch {
2816
2873
  }
2817
- (r = ie.current) == null || r.focus();
2874
+ (r = de.current) == null || r.focus();
2818
2875
  },
2819
2876
  clear() {
2820
- se("source.setCode", "") || ie.current && (ie.current.value = "");
2877
+ ie("source.setCode", "") || de.current && (de.current.value = "");
2821
2878
  }
2822
2879
  }),
2823
- [N, ue, se, le, Ie]
2880
+ [N, le, ie, ue, He]
2824
2881
  );
2825
- Yr(Ee, () => He, [He]), tn(Mo, He, o);
2826
- const Wr = x(
2882
+ on(Se, () => Oe, [Oe]), ln(Io, Oe, o);
2883
+ const Jr = x(
2827
2884
  (e) => {
2828
2885
  var r;
2829
- xe.current(), (r = J.current) == null || r.call(J, {
2886
+ ge.current(), (r = te.current) == null || r.call(te, {
2830
2887
  html: fe(e.target.value),
2831
2888
  markdown: ""
2832
2889
  });
2833
2890
  },
2834
2891
  []
2835
- ), ct = u ?? D("editor.regionLabel"), Xr = l ?? D("editor.placeholder");
2892
+ ), ut = d ?? D("editor.regionLabel"), en = l ?? D("editor.placeholder");
2836
2893
  I(() => {
2837
2894
  var a;
2838
- if (re) return;
2839
- const e = (a = W.current) == null ? void 0 : a.querySelector(".redactor-in");
2895
+ if (ae) return;
2896
+ const e = (a = B.current) == null ? void 0 : a.querySelector(".redactor-in");
2840
2897
  if (!e) return;
2841
2898
  const r = () => {
2842
- e.getAttribute("role") !== "textbox" && e.setAttribute("role", "textbox"), e.getAttribute("aria-multiline") !== "true" && e.setAttribute("aria-multiline", "true"), e.getAttribute("aria-label") !== ct && e.setAttribute("aria-label", ct), e.hasAttribute("aria-labelledby") && e.removeAttribute("aria-labelledby");
2899
+ e.getAttribute("role") !== "textbox" && e.setAttribute("role", "textbox"), e.getAttribute("aria-multiline") !== "true" && e.setAttribute("aria-multiline", "true"), e.getAttribute("aria-label") !== ut && e.setAttribute("aria-label", ut), e.hasAttribute("aria-labelledby") && e.removeAttribute("aria-labelledby");
2843
2900
  };
2844
2901
  r();
2845
2902
  const n = new MutationObserver(r);
@@ -2847,98 +2904,98 @@ const ha = Ot(
2847
2904
  attributes: !0,
2848
2905
  attributeFilter: ["role", "aria-labelledby"]
2849
2906
  }), () => n.disconnect();
2850
- }, [re, ct]);
2851
- const Tt = ge !== null, Zr = x(
2907
+ }, [ae, ut]);
2908
+ const _t = pe !== null, tn = x(
2852
2909
  (e) => {
2853
- if (It.test(e)) {
2854
- if (re) {
2855
- le(`[[${e}]]`, { asHtml: !1 });
2910
+ if (Dt.test(e)) {
2911
+ if (ae) {
2912
+ ue(`[[${e}]]`, { asHtml: !1 });
2856
2913
  return;
2857
2914
  }
2858
- ve(), Ce(hr(e));
2915
+ xe(), Ne(xr(e));
2859
2916
  }
2860
2917
  },
2861
- [re, le, ve, Ce]
2862
- ), De = [];
2863
- return O && De.push({
2918
+ [ae, ue, xe, Ne]
2919
+ ), qe = [];
2920
+ return q && qe.push({
2864
2921
  key: "dictate",
2865
- icon: Te ? /* @__PURE__ */ t(gt, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ t(yr, { "aria-hidden": "true", className: "ds:size-5" }),
2866
- label: D(Te ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
2867
- onClick: Vr,
2868
- recording: Te
2869
- }), U && De.push({
2922
+ icon: Ae ? /* @__PURE__ */ t(pt, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ t(Nr, { "aria-hidden": "true", className: "ds:size-5" }),
2923
+ label: D(Ae ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
2924
+ onClick: Qr,
2925
+ recording: Ae
2926
+ }), U && qe.push({
2870
2927
  key: "proofread",
2871
2928
  // While running, the segment becomes a STOP/cancel button (progress is
2872
2929
  // shown by the scrim spinner).
2873
- icon: ge === "proofread" ? /* @__PURE__ */ t(gt, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ t(go, { "aria-hidden": "true", className: "ds:size-5" }),
2874
- label: ge === "proofread" ? D("common.cancel") : D("editor.ai.proofread", "Check spelling & grammar"),
2875
- onClick: ge === "proofread" ? ir : () => ar("proofread", U),
2876
- running: ge === "proofread"
2877
- }), X && De.push({
2930
+ icon: pe === "proofread" ? /* @__PURE__ */ t(pt, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ t(vo, { "aria-hidden": "true", className: "ds:size-5" }),
2931
+ label: pe === "proofread" ? D("common.cancel") : D("editor.ai.proofread", "Check spelling & grammar"),
2932
+ onClick: pe === "proofread" ? lr : () => sr("proofread", U),
2933
+ running: pe === "proofread"
2934
+ }), X && qe.push({
2878
2935
  key: "format",
2879
- icon: ge === "format" ? /* @__PURE__ */ t(gt, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ t(hn, { "aria-hidden": "true", className: "ds:size-5" }),
2880
- label: ge === "format" ? D("common.cancel") : D("editor.ai.autoFormat", "Auto-format document"),
2881
- onClick: ge === "format" ? ir : () => ar("format", X),
2882
- running: ge === "format"
2883
- }), (E || B) && De.push({
2936
+ icon: pe === "format" ? /* @__PURE__ */ t(pt, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ t(xn, { "aria-hidden": "true", className: "ds:size-5" }),
2937
+ label: pe === "format" ? D("common.cancel") : D("editor.ai.autoFormat", "Auto-format document"),
2938
+ onClick: pe === "format" ? lr : () => sr("format", X),
2939
+ running: pe === "format"
2940
+ }), (E || j) && qe.push({
2884
2941
  key: "write",
2885
- icon: /* @__PURE__ */ t(pn, { "aria-hidden": "true", className: "ds:size-5" }),
2942
+ icon: /* @__PURE__ */ t(kn, { "aria-hidden": "true", className: "ds:size-5" }),
2886
2943
  label: D("editor.ai.helpMeWrite"),
2887
- onClick: Kr
2944
+ onClick: Yr
2888
2945
  }), /* @__PURE__ */ k(
2889
2946
  "div",
2890
2947
  {
2891
- ref: W,
2892
- className: [ha(), z].filter(Boolean).join(" "),
2948
+ ref: B,
2949
+ className: [ka(), R].filter(Boolean).join(" "),
2893
2950
  "data-component": "rich-text-editor",
2894
2951
  "data-component-id": o,
2895
- "data-min-height": b,
2952
+ "data-min-height": p,
2896
2953
  children: [
2897
- !re && !v ? /* @__PURE__ */ t(
2898
- aa,
2954
+ !ae && !b ? /* @__PURE__ */ t(
2955
+ ua,
2899
2956
  {
2900
- run: Ie,
2901
- active: Xt,
2902
- preset: f,
2903
- insertHtml: Ce,
2904
- insertTable: Dr,
2905
- saveSelection: Be,
2906
- restoreSelection: ve,
2907
- getSelectedText: Rr,
2908
- uploadImage: m || c ? qr : void 0,
2909
- enableColor: (_ == null ? void 0 : _.includes("fontcolor")) ?? !1,
2910
- enableImage: !!(m || c),
2911
- enableTable: (_ == null ? void 0 : _.includes("table")) ?? !1,
2957
+ run: He,
2958
+ active: Ut,
2959
+ preset: g,
2960
+ insertHtml: Ne,
2961
+ insertTable: Br,
2962
+ saveSelection: Ge,
2963
+ restoreSelection: xe,
2964
+ getSelectedText: Dr,
2965
+ uploadImage: h || u ? Gr : void 0,
2966
+ enableColor: (M == null ? void 0 : M.includes("fontcolor")) ?? !1,
2967
+ enableImage: !!(h || u),
2968
+ enableTable: (M == null ? void 0 : M.includes("table")) ?? !1,
2912
2969
  showExtensions: C,
2913
2970
  variables: P,
2914
- insertVariable: Zr
2971
+ insertVariable: tn
2915
2972
  }
2916
2973
  ) : null,
2917
- /* @__PURE__ */ k("div", { className: "ds:relative", ref: Ke, children: [
2974
+ /* @__PURE__ */ k("div", { className: "ds:relative", ref: Xe, children: [
2918
2975
  /* @__PURE__ */ t(
2919
2976
  "textarea",
2920
2977
  {
2921
- ref: ie,
2922
- id: ee,
2923
- "aria-label": ct,
2978
+ ref: de,
2979
+ id: oe,
2980
+ "aria-label": ut,
2924
2981
  "aria-multiline": "true",
2925
- "aria-busy": Tt || void 0,
2926
- placeholder: Xr,
2927
- onChange: re ? Wr : void 0,
2928
- readOnly: re ? v : void 0,
2929
- className: re ? ya() : void 0
2982
+ "aria-busy": _t || void 0,
2983
+ placeholder: en,
2984
+ onChange: ae ? Jr : void 0,
2985
+ readOnly: ae ? b : void 0,
2986
+ className: ae ? Ta() : void 0
2930
2987
  }
2931
2988
  ),
2932
- Tt ? /* @__PURE__ */ t(
2989
+ _t ? /* @__PURE__ */ t(
2933
2990
  "div",
2934
2991
  {
2935
2992
  "aria-hidden": "true",
2936
2993
  className: "ds:absolute ds:inset-0 ds:z-[5] ds:flex ds:items-center ds:justify-center ds:cursor-wait ds:rounded-[var(--radius-md)] ds:bg-[color-mix(in_srgb,var(--background)_40%,transparent)]",
2937
- children: /* @__PURE__ */ t(pr, { size: "lg", variant: "prism" })
2994
+ children: /* @__PURE__ */ t(kr, { size: "lg", variant: "prism" })
2938
2995
  }
2939
2996
  ) : null,
2940
2997
  /* @__PURE__ */ k("div", { className: "ds:sticky ds:bottom-0 ds:z-10", children: [
2941
- De.length > 0 ? /* @__PURE__ */ t("div", { className: "ds:absolute ds:[inset-block-end:var(--spacing-md)] ds:[inset-inline-end:var(--spacing-md)] ds:z-10 ds:flex ds:items-center ds:overflow-hidden ds:rounded-full ds:bg-[var(--primary)] ds:bg-[image:var(--gradient-brand)] ds:shadow-[0_8px_24px_color-mix(in_srgb,var(--primary)_35%,transparent)]", children: De.map((e, r) => /* @__PURE__ */ k(pt, { children: [
2998
+ qe.length > 0 ? /* @__PURE__ */ t("div", { className: "ds:absolute ds:[inset-block-end:var(--spacing-md)] ds:[inset-inline-end:var(--spacing-md)] ds:z-10 ds:flex ds:items-center ds:overflow-hidden ds:rounded-full ds:bg-[var(--primary)] ds:bg-[image:var(--gradient-brand)] ds:shadow-[0_8px_24px_color-mix(in_srgb,var(--primary)_35%,transparent)]", children: qe.map((e, r) => /* @__PURE__ */ k(vt, { children: [
2942
2999
  r > 0 ? /* @__PURE__ */ t(
2943
3000
  "span",
2944
3001
  {
@@ -2953,70 +3010,70 @@ const ha = Ot(
2953
3010
  onClick: e.onClick,
2954
3011
  "aria-pressed": e.recording || void 0,
2955
3012
  "aria-busy": e.running || void 0,
2956
- disabled: Tt && !e.running || void 0,
3013
+ disabled: _t && !e.running || void 0,
2957
3014
  "aria-label": e.label,
2958
- className: e.recording ? wa : va,
3015
+ className: e.recording ? za : Aa,
2959
3016
  children: e.icon
2960
3017
  }
2961
3018
  )
2962
3019
  ] }, e.key)) }) : null,
2963
- B ? B({
2964
- open: Ft && !ce,
3020
+ j ? j({
3021
+ open: Vt && !me,
2965
3022
  onClose: () => {
2966
- Re(!1), Gt(!1);
3023
+ Le(!1), Kt(!1);
2967
3024
  },
2968
- selectionText: Nr,
2969
- creditsExhausted: Ar,
2970
- getHTML: He.getHTML,
2971
- getText: He.getText,
3025
+ selectionText: Mr,
3026
+ creditsExhausted: Sr,
3027
+ getHTML: Oe.getHTML,
3028
+ getText: Oe.getText,
2972
3029
  insertAtSelection: (e) => {
2973
- Xe.current && (ke.current = Xe.current.cloneRange()), ve(), le(e, { asHtml: !0 });
3030
+ Ue.current && (Ce.current = Ue.current.cloneRange()), xe(), ue(e, { asHtml: !0 });
2974
3031
  },
2975
3032
  insertAfterSelection: (e) => {
2976
- const r = Xe.current ?? ke.current;
3033
+ const r = Ue.current ?? Ce.current;
2977
3034
  if (r) {
2978
3035
  const n = r.cloneRange();
2979
- n.collapse(!1), ke.current = n;
3036
+ n.collapse(!1), Ce.current = n;
2980
3037
  }
2981
- ve(), le(e, { asHtml: !0 });
3038
+ xe(), ue(e, { asHtml: !0 });
2982
3039
  },
2983
- setContent: He.setContent,
2984
- onDictate: O,
2985
- privacyNotice: or
3040
+ setContent: Oe.setContent,
3041
+ onDictate: q,
3042
+ privacyNotice: ir
2986
3043
  }) : E ? /* @__PURE__ */ t(
2987
- So,
3044
+ Oo,
2988
3045
  {
2989
- open: Ft && !ce,
2990
- onClose: () => Re(!1),
3046
+ open: Vt && !me,
3047
+ onClose: () => Le(!1),
2991
3048
  onRequestAiDraft: E,
2992
3049
  onInsert: (e) => {
2993
- ve(), le(e, { asHtml: T !== "text" });
3050
+ xe(), ue(e, { asHtml: A !== "text" });
2994
3051
  },
2995
- previewAsHtml: T !== "text",
2996
- privacyNotice: or,
2997
- onDictate: O
3052
+ previewAsHtml: A !== "text",
3053
+ privacyNotice: ir,
3054
+ onDictate: q
2998
3055
  }
2999
3056
  ) : null,
3000
- y ? /* @__PURE__ */ t(
3001
- br,
3057
+ w ? /* @__PURE__ */ t(
3058
+ Cr,
3002
3059
  {
3003
- open: jr !== null,
3004
- onClose: rr,
3060
+ open: Wr !== null,
3061
+ onClose: or,
3005
3062
  ariaLabel: D(
3006
3063
  "editor.ai.consentRegionLabel",
3007
3064
  "AI assistance consent for this document"
3008
3065
  ),
3009
- footer: /* @__PURE__ */ t(pe, { intent: "ghost", size: "sm", onClick: rr, children: D("common.close") }),
3066
+ footer: /* @__PURE__ */ t(ve, { intent: "ghost", size: "sm", onClick: or, children: D("common.close") }),
3010
3067
  children: /* @__PURE__ */ t(
3011
- rn,
3068
+ cn,
3012
3069
  {
3013
- granted: y.granted,
3014
- grantedAt: y.grantedAt,
3015
- grantedBy: y.grantedBy,
3016
- canGrant: (y.canGrant ?? !0) && y.onGrant !== void 0,
3017
- pending: Fr,
3018
- onGrantConsent: Gr,
3019
- headingLevel: q,
3070
+ granted: w.granted,
3071
+ grantedAt: w.grantedAt,
3072
+ grantedBy: w.grantedBy,
3073
+ canGrant: (w.canGrant ?? !0) && w.onGrant !== void 0,
3074
+ pending: Zr,
3075
+ onGrantConsent: Ur,
3076
+ headingLevel: O,
3020
3077
  "aria-label": D(
3021
3078
  "editor.ai.consentRegionLabel",
3022
3079
  "AI assistance consent for this document"
@@ -3026,54 +3083,54 @@ const ha = Ot(
3026
3083
  }
3027
3084
  ) : null
3028
3085
  ] }),
3029
- !re && !v && ((_ == null ? void 0 : _.includes("table")) ?? !1) ? /* @__PURE__ */ t(
3030
- Xo,
3086
+ !ae && !b && ((M == null ? void 0 : M.includes("table")) ?? !1) ? /* @__PURE__ */ t(
3087
+ ea,
3031
3088
  {
3032
- active: Xt,
3033
- run: Ie,
3034
- areaRef: Ke,
3035
- getActiveTableEl: Sr,
3036
- enableColor: (_ == null ? void 0 : _.includes("fontcolor")) ?? !1,
3037
- saveTableCell: Lr,
3038
- applyTableBackground: Ir
3089
+ active: Ut,
3090
+ run: He,
3091
+ areaRef: Xe,
3092
+ getActiveTableEl: Or,
3093
+ enableColor: (M == null ? void 0 : M.includes("fontcolor")) ?? !1,
3094
+ saveTableCell: qr,
3095
+ applyTableBackground: Pr
3039
3096
  }
3040
3097
  ) : null,
3041
- !re && !v ? /* @__PURE__ */ t(
3042
- oa,
3098
+ !ae && !b ? /* @__PURE__ */ t(
3099
+ da,
3043
3100
  {
3044
- areaRef: Ke,
3045
- activeImageEl: Mr,
3046
- applyImageClass: $r,
3047
- setImageWidth: Hr
3101
+ areaRef: Xe,
3102
+ activeImageEl: Ir,
3103
+ applyImageClass: Fr,
3104
+ setImageWidth: jr
3048
3105
  }
3049
3106
  ) : null,
3050
3107
  Y ? /* @__PURE__ */ t(
3051
3108
  "div",
3052
3109
  {
3053
- id: je,
3110
+ id: Be,
3054
3111
  role: "listbox",
3055
3112
  "aria-label": D("editor.variables", "Variables"),
3056
3113
  "data-component": "variable-typeahead",
3057
- className: pa,
3114
+ className: Ca,
3058
3115
  style: {
3059
3116
  "--rte-typeahead-x": `${Y.left}px`,
3060
3117
  "--rte-typeahead-y": `${Y.top}px`
3061
3118
  },
3062
- children: Ne.length === 0 ? /* @__PURE__ */ t("p", { className: "ds:m-0 ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: D("editor.variableNoMatch", {
3119
+ children: Te.length === 0 ? /* @__PURE__ */ t("p", { className: "ds:m-0 ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: D("editor.variableNoMatch", {
3063
3120
  query: Y.query,
3064
3121
  defaultValue: "No variable matches “{{query}}”"
3065
- }) }) : Ne.map((e, r) => /* @__PURE__ */ k(
3122
+ }) }) : Te.map((e, r) => /* @__PURE__ */ k(
3066
3123
  "div",
3067
3124
  {
3068
- id: `${je}-${e.token}`,
3125
+ id: `${Be}-${e.token}`,
3069
3126
  role: "option",
3070
3127
  tabIndex: -1,
3071
3128
  "aria-selected": r === Y.index,
3072
- className: ba,
3129
+ className: Na,
3073
3130
  onMouseDown: (n) => {
3074
3131
  n.preventDefault();
3075
- const a = Pe.current;
3076
- me(), a && et(e.token, a);
3132
+ const a = je.current;
3133
+ he(), a && rt(e.token, a);
3077
3134
  },
3078
3135
  children: [
3079
3136
  /* @__PURE__ */ t("span", { className: "ds:truncate", children: e.label }),
@@ -3085,19 +3142,19 @@ const ha = Ot(
3085
3142
  }
3086
3143
  ) : null
3087
3144
  ] }),
3088
- O ? /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: Pr }) : null,
3089
- Le.length > 0 ? /* @__PURE__ */ t(
3145
+ q ? /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: Kr }) : null,
3146
+ $e.length > 0 ? /* @__PURE__ */ t(
3090
3147
  "p",
3091
3148
  {
3092
- id: `${ee}-variables-error`,
3149
+ id: `${oe}-variables-error`,
3093
3150
  role: "alert",
3094
3151
  className: "ds:m-0 ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]",
3095
3152
  children: D("editor.variableInvalid", {
3096
- tokens: Le.map((e) => `[[${e}]]`).join(", ")
3153
+ tokens: $e.map((e) => `[[${e}]]`).join(", ")
3097
3154
  })
3098
3155
  }
3099
3156
  ) : null,
3100
- O && Or ? /* @__PURE__ */ t(
3157
+ q && Vr ? /* @__PURE__ */ t(
3101
3158
  "p",
3102
3159
  {
3103
3160
  role: "alert",
@@ -3110,10 +3167,10 @@ const ha = Ot(
3110
3167
  );
3111
3168
  }
3112
3169
  );
3113
- xa.displayName = "RichTextEditor";
3170
+ Ra.displayName = "RichTextEditor";
3114
3171
  export {
3115
- xa as R,
3116
- Mo as r,
3117
- ha as w
3172
+ Ra as R,
3173
+ Io as r,
3174
+ ka as w
3118
3175
  };
3119
- //# sourceMappingURL=rich-text-editor-D7AKKAQ2.js.map
3176
+ //# sourceMappingURL=rich-text-editor-DUMeifwc.js.map