eddyter 1.3.60 → 1.3.62

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 (37) hide show
  1. package/dist/api/ai/index.d.ts +12 -12
  2. package/dist/assets/index.css +1 -0
  3. package/dist/{babel-44680aef.js → babel-B9hn44Wo.js} +2107 -2683
  4. package/dist/components/FileUpload/InsertFileDialog.d.ts +0 -1
  5. package/dist/components/LinkPreviewHover/index.d.ts +0 -1
  6. package/dist/components/ScopedEditor.d.ts +0 -1
  7. package/dist/components/ui/dropdown-menu.d.ts +3 -3
  8. package/dist/components/ui/skeleton.d.ts +0 -1
  9. package/dist/context/ToolbarContext.d.ts +6 -2
  10. package/dist/{estree-a7dc9ac5.js → estree-CocPn_Md.js} +1830 -2226
  11. package/dist/hooks/useModal.d.ts +0 -1
  12. package/dist/{html-f2fcab26.js → html-CxCicOef.js} +979 -1223
  13. package/dist/html2pdf.bundle-DNyY_rJA.js +32961 -0
  14. package/dist/html2pdf.bundle.min-GfQzEXnM.js +20244 -0
  15. package/dist/{index-98d915c4.js → index-BoOSmKss.js} +347 -378
  16. package/dist/{index-e3302f38.js → index-CIBuU2Zv.js} +14448 -15269
  17. package/dist/{index-8889e1ba.js → index-YHNm3bIK.js} +8 -39
  18. package/dist/index.js +13 -47
  19. package/dist/{markdown-48d2f5f1.js → markdown-BUjgWFLu.js} +1466 -1908
  20. package/dist/plugins/AutocompletePlugin.d.ts +0 -1
  21. package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRulePlugin.d.ts +0 -1
  22. package/dist/plugins/HtmlSyncPlugin.d.ts +0 -1
  23. package/dist/plugins/LinkPreviewPlugin/index.d.ts +0 -1
  24. package/dist/plugins/PasteOptionsPlugin/index.d.ts +0 -1
  25. package/dist/plugins/SignatureCanvasPlugin/SignatureCanvasPlugin.d.ts +0 -1
  26. package/dist/plugins/SlashCommandPlugin/index.d.ts +0 -1
  27. package/dist/plugins/UsageTrackingPlugin.d.ts +0 -1
  28. package/dist/plugins/VoiceTranscriptPlugin.d.ts +1 -1
  29. package/dist/postcss-CGIcwj_g.js +4717 -0
  30. package/dist/{standalone-2029bc8b.js → standalone-C0qguT38.js} +988 -1244
  31. package/dist/typescript-BM7wk6k-.js +12922 -0
  32. package/package.json +6 -6
  33. package/dist/assets/style.css +0 -1
  34. package/dist/html2pdf.bundle-519d30c0.js +0 -34001
  35. package/dist/html2pdf.bundle.min-8451fd59.js +0 -21964
  36. package/dist/postcss-9ac167c3.js +0 -5172
  37. package/dist/typescript-bd1bb88f.js +0 -13632
@@ -1,66 +1,39 @@
1
- import { jsx as t, jsxs as h, Fragment as it } from "react/jsx-runtime";
2
- import { CodeNode as ve } from "@lexical/code";
1
+ import { jsx as t, jsxs as h, Fragment as ot } from "react/jsx-runtime";
2
+ import { CodeNode as Ee } from "@lexical/code";
3
3
  import { LinkNode as ke } from "@lexical/link";
4
- import { AutoFocusPlugin as ot } from "@lexical/react/LexicalAutoFocusPlugin";
5
- import { useCollaborationContext as nt } from "@lexical/react/LexicalCollaborationContext";
6
- import { useLexicalComposerContext as ct } from "@lexical/react/LexicalComposerContext";
7
- import { ContentEditable as Ee } from "@lexical/react/LexicalContentEditable";
8
- import { LexicalErrorBoundary as Ie } from "@lexical/react/LexicalErrorBoundary";
9
- import { HistoryPlugin as Pe } from "@lexical/react/LexicalHistoryPlugin";
10
- import { LexicalNestedComposer as Re } from "@lexical/react/LexicalNestedComposer";
11
- import { OnChangePlugin as De } from "@lexical/react/LexicalOnChangePlugin";
12
- import { RichTextPlugin as ze } from "@lexical/react/LexicalRichTextPlugin";
13
- import { useLexicalEditable as at } from "@lexical/react/useLexicalEditable";
14
- import { useLexicalNodeSelection as st } from "@lexical/react/useLexicalNodeSelection";
15
- import { calculateZoomLevel as xe, mergeRegister as dt } from "@lexical/utils";
16
- import { RootNode as Se, TextNode as Le, LineBreakNode as We, ParagraphNode as Ae, $getSelection as J, $isNodeSelection as X, $isParagraphNode as we, $setSelection as ce, $isRangeSelection as lt, SELECTION_CHANGE_COMMAND as mt, COMMAND_PRIORITY_LOW as M, CLICK_COMMAND as ut, DRAGSTART_COMMAND as gt, KEY_DELETE_COMMAND as ht, KEY_BACKSPACE_COMMAND as pt, KEY_ENTER_COMMAND as ft, KEY_ESCAPE_COMMAND as bt, createCommand as yt, $getNodeByKey as U } from "lexical";
17
- import { useRef as T, useState as R, useEffect as ae, useCallback as W, Suspense as xt } from "react";
18
- import { a as wt, D as Ct, b as Nt, d as vt, e as kt, f as Et, h as It, B as Ce, L as Me, i as $e, $ as F, W as Pt, j as Rt, A as Dt, k as zt, l as St, T as Lt, m as Wt, S as At, E as Mt, n as $t, t as $, o as _t, p as Ot, C as Ht } from "./index-e3302f38.js";
19
- import "axios";
20
- import "react-dom";
21
- import "@emotion/styled";
22
- import "@lexical/html";
23
- import "@lexical/react/LexicalCheckListPlugin";
24
- import "@lexical/react/LexicalComposer";
25
- import "@lexical/react/LexicalHorizontalRulePlugin";
26
- import "@lexical/react/LexicalListPlugin";
27
- import "@lexical/react/LexicalTablePlugin";
28
- import "@lexical/table";
29
- import "@lexical/markdown";
30
- import "@lexical/list";
31
- import "@lexical/rich-text";
32
- import "@lexical/selection";
33
- import "@lexical/react/LexicalHorizontalRuleNode";
34
- import "@lexical/react/LexicalDecoratorBlockNode";
35
- import "emoji-picker-react";
36
- import "@lexical/react/LexicalLinkPlugin";
37
- import "@lexical/react/LexicalTypeaheadMenuPlugin";
38
- import "@lexical/react/LexicalDraggableBlockPlugin";
39
- /**
40
- * @license lucide-react v0.344.0 - ISC
41
- *
42
- * This source code is licensed under the ISC license.
43
- * See the LICENSE file in the root directory of this source tree.
44
- */
45
- const Tt = wt("Link2", [
4
+ import { AutoFocusPlugin as nt } from "@lexical/react/LexicalAutoFocusPlugin";
5
+ import { useCollaborationContext as ct } from "@lexical/react/LexicalCollaborationContext";
6
+ import { useLexicalComposerContext as at } from "@lexical/react/LexicalComposerContext";
7
+ import { ContentEditable as Ie } from "@lexical/react/LexicalContentEditable";
8
+ import { LexicalErrorBoundary as Pe } from "@lexical/react/LexicalErrorBoundary";
9
+ import { HistoryPlugin as Re } from "@lexical/react/LexicalHistoryPlugin";
10
+ import { LexicalNestedComposer as De } from "@lexical/react/LexicalNestedComposer";
11
+ import { OnChangePlugin as ze } from "@lexical/react/LexicalOnChangePlugin";
12
+ import { RichTextPlugin as Se } from "@lexical/react/LexicalRichTextPlugin";
13
+ import { useLexicalEditable as st } from "@lexical/react/useLexicalEditable";
14
+ import { useLexicalNodeSelection as dt } from "@lexical/react/useLexicalNodeSelection";
15
+ import { calculateZoomLevel as we, mergeRegister as lt } from "@lexical/utils";
16
+ import { RootNode as Le, TextNode as We, LineBreakNode as Ae, ParagraphNode as Me, $getSelection as V, $isNodeSelection as K, $isParagraphNode as Ce, $setSelection as ae, $isRangeSelection as ut, SELECTION_CHANGE_COMMAND as mt, COMMAND_PRIORITY_LOW as $, CLICK_COMMAND as gt, DRAGSTART_COMMAND as ht, KEY_DELETE_COMMAND as ft, KEY_BACKSPACE_COMMAND as pt, KEY_ENTER_COMMAND as bt, KEY_ESCAPE_COMMAND as yt, createCommand as xt, $getNodeByKey as J } from "lexical";
17
+ import { useRef as H, useState as R, useEffect as se, useCallback as A, Suspense as wt } from "react";
18
+ import { a as Ct, D as Nt, b as vt, d as Et, e as kt, f as It, h as Pt, B as Ne, L as $e, i as _e, $ as X, W as Rt, j as Dt, A as zt, k as St, l as Lt, T as Wt, m as At, S as Mt, E as $t, n as _t, t as _, o as Ot, p as Ht, C as Tt } from "./index-CIBuU2Zv.js";
19
+ const jt = Ct("Link2", [
46
20
  ["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
47
21
  ["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
48
22
  ["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
49
- ]);
50
- const jt = ({
23
+ ]), Bt = ({
51
24
  open: u,
52
- onOpenChange: f,
25
+ onOpenChange: p,
53
26
  oldImageUrl: b,
54
27
  newImageUrl: N,
55
- onReplace: z,
56
- onCancel: v
57
- }) => /* @__PURE__ */ t(Ct, { open: u, onOpenChange: f, children: /* @__PURE__ */ h(Nt, { className: "sm:max-w-[800px] max-h-[90vh] overflow-y-auto", children: [
58
- /* @__PURE__ */ h(vt, { children: [
28
+ onReplace: S,
29
+ onCancel: E
30
+ }) => /* @__PURE__ */ t(Nt, { open: u, onOpenChange: p, children: /* @__PURE__ */ h(vt, { className: "sm:max-w-[800px] max-h-[90vh] overflow-y-auto", children: [
31
+ /* @__PURE__ */ h(Et, { children: [
59
32
  /* @__PURE__ */ h(kt, { className: "flex items-center gap-2 text-xl", children: [
60
33
  /* @__PURE__ */ t("span", { className: "text-2xl", children: "🔄" }),
61
34
  "Compare Images"
62
35
  ] }),
63
- /* @__PURE__ */ t(Et, { className: "text-sm pt-1", children: "Choose whether to replace the original image with the refined version." })
36
+ /* @__PURE__ */ t(It, { className: "text-sm pt-1", children: "Choose whether to replace the original image with the refined version." })
64
37
  ] }),
65
38
  /* @__PURE__ */ h("div", { className: "space-y-4 py-4", children: [
66
39
  /* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ h("div", { className: "space-y-2", children: [
@@ -82,19 +55,19 @@ const jt = ({
82
55
  ' Clicking "Replace" will update the image in your document. This action cannot be undone.'
83
56
  ] }) })
84
57
  ] }),
85
- /* @__PURE__ */ h(It, { className: "gap-2", children: [
58
+ /* @__PURE__ */ h(Pt, { className: "gap-2", children: [
86
59
  /* @__PURE__ */ t(
87
- Ce,
60
+ Ne,
88
61
  {
89
62
  variant: "outline",
90
- onClick: v,
63
+ onClick: E,
91
64
  children: "Keep Original"
92
65
  }
93
66
  ),
94
67
  /* @__PURE__ */ h(
95
- Ce,
68
+ Ne,
96
69
  {
97
- onClick: z,
70
+ onClick: S,
98
71
  className: "bg-blue-500 hover:bg-blue-600 text-white",
99
72
  children: [
100
73
  /* @__PURE__ */ t("span", { className: "mr-2", children: "✓" }),
@@ -104,27 +77,27 @@ const jt = ({
104
77
  )
105
78
  ] })
106
79
  ] }) });
107
- function Bt({
80
+ function Yt({
108
81
  caption: u
109
82
  }) {
110
83
  return /* @__PURE__ */ t("div", { className: "signature-caption-container", children: /* @__PURE__ */ h(
111
- Re,
84
+ De,
112
85
  {
113
86
  initialEditor: u,
114
87
  initialNodes: [
115
- Se,
116
88
  Le,
117
89
  We,
118
90
  Ae,
91
+ Me,
119
92
  ke,
120
- ve
93
+ Ee
121
94
  ],
122
95
  children: [
123
96
  /* @__PURE__ */ t(
124
- ze,
97
+ Se,
125
98
  {
126
99
  contentEditable: /* @__PURE__ */ t(
127
- Ee,
100
+ Ie,
128
101
  {
129
102
  "aria-placeholder": "Enter signature name...",
130
103
  placeholder: /* @__PURE__ */ t("div", { style: {
@@ -140,41 +113,41 @@ function Bt({
140
113
  className: "signature-caption-editable"
141
114
  }
142
115
  ),
143
- ErrorBoundary: Ie
116
+ ErrorBoundary: Pe
144
117
  }
145
118
  ),
146
- /* @__PURE__ */ t(De, { onChange: () => {
119
+ /* @__PURE__ */ t(ze, { onChange: () => {
147
120
  } }),
148
- /* @__PURE__ */ t(Pe, {}),
149
- /* @__PURE__ */ t(Me, { namespace: $e.namespace })
121
+ /* @__PURE__ */ t(Re, {}),
122
+ /* @__PURE__ */ t($e, { namespace: _e.namespace })
150
123
  ]
151
124
  }
152
125
  ) });
153
126
  }
154
- function se(u, f, b) {
155
- return Math.min(Math.max(u, f), b);
127
+ function de(u, p, b) {
128
+ return Math.min(Math.max(u, p), b);
156
129
  }
157
- const s = {
130
+ const c = {
158
131
  east: 1,
159
132
  north: 8,
160
133
  south: 2,
161
134
  west: 4
162
135
  };
163
- function Yt({
136
+ function Kt({
164
137
  onResizeStart: u,
165
- onResizeEnd: f,
138
+ onResizeEnd: p,
166
139
  buttonRef: b,
167
140
  imageRef: N,
168
- maxWidth: z,
169
- editor: v,
170
- showCaption: G,
171
- setShowCaption: A,
172
- captionsEnabled: S
141
+ maxWidth: S,
142
+ editor: E,
143
+ showCaption: F,
144
+ setShowCaption: M,
145
+ captionsEnabled: L
173
146
  }) {
174
- const j = T(null), k = T({
147
+ const T = H(null), k = H({
175
148
  priority: "",
176
149
  value: "default"
177
- }), l = T({
150
+ }), l = H({
178
151
  currentHeight: 0,
179
152
  currentWidth: 0,
180
153
  direction: 0,
@@ -184,9 +157,9 @@ function Yt({
184
157
  startWidth: 0,
185
158
  startX: 0,
186
159
  startY: 0
187
- }), p = v.getRootElement(), x = p !== null ? p.getBoundingClientRect().width - 20 : 100, q = p !== null ? p.getBoundingClientRect().height - 20 : 100, g = 100, E = 100, _ = (i) => {
188
- const d = i === s.east || i === s.west, o = i === s.north || i === s.south, D = i & s.north && i & s.west || i & s.south && i & s.east, C = d ? "ew" : o ? "ns" : D ? "nwse" : "nesw";
189
- p !== null && p.style.setProperty(
160
+ }), f = E.getRootElement(), x = f !== null ? f.getBoundingClientRect().width - 20 : 100, G = f !== null ? f.getBoundingClientRect().height - 20 : 100, m = 100, I = 100, O = (i) => {
161
+ const a = i === c.east || i === c.west, o = i === c.north || i === c.south, v = i & c.north && i & c.west || i & c.south && i & c.east, C = a ? "ew" : o ? "ns" : v ? "nwse" : "nesw";
162
+ f !== null && f.style.setProperty(
190
163
  "cursor",
191
164
  `${C}-resize`,
192
165
  "important"
@@ -203,69 +176,69 @@ function Yt({
203
176
  "none",
204
177
  "important"
205
178
  ));
206
- }, L = () => {
207
- p !== null && p.style.setProperty("cursor", "text"), document.body !== null && (document.body.style.setProperty("cursor", "default"), document.body.style.setProperty(
179
+ }, W = () => {
180
+ f !== null && f.style.setProperty("cursor", "text"), document.body !== null && (document.body.style.setProperty("cursor", "default"), document.body.style.setProperty(
208
181
  "-webkit-user-select",
209
182
  k.current.value,
210
183
  k.current.priority
211
184
  ));
212
- }, I = (i, d) => {
213
- if (!v.isEditable())
185
+ }, P = (i, a) => {
186
+ if (!E.isEditable())
214
187
  return;
215
- const o = N.current, D = j.current;
216
- if (o !== null && D !== null) {
188
+ const o = N.current, v = T.current;
189
+ if (o !== null && v !== null) {
217
190
  i.preventDefault();
218
- const { width: C, height: P } = o.getBoundingClientRect(), m = xe(o), a = l.current;
219
- a.startWidth = C, a.startHeight = P, a.ratio = C / P, a.currentWidth = C, a.currentHeight = P, a.startX = i.clientX / m, a.startY = i.clientY / m, a.isResizing = !0, a.direction = d, _(d), u(), D.classList.add("image-control-wrapper--resizing"), o.style.height = `${P}px`, o.style.width = `${C}px`, document.addEventListener("pointermove", n), document.addEventListener("pointerup", O);
191
+ const { width: C, height: D } = o.getBoundingClientRect(), g = we(o), d = l.current;
192
+ d.startWidth = C, d.startHeight = D, d.ratio = C / D, d.currentWidth = C, d.currentHeight = D, d.startX = i.clientX / g, d.startY = i.clientY / g, d.isResizing = !0, d.direction = a, O(a), u(), v.classList.add("image-control-wrapper--resizing"), o.style.height = `${D}px`, o.style.width = `${C}px`, document.addEventListener("pointermove", Q), document.addEventListener("pointerup", n);
220
193
  }
221
- }, n = (i) => {
222
- const d = N.current, o = l.current, D = o.direction & (s.east | s.west), C = o.direction & (s.south | s.north);
223
- if (d !== null && o.isResizing) {
224
- const P = xe(d);
225
- if (D && C) {
226
- let m = Math.floor(o.startX - i.clientX / P);
227
- m = o.direction & s.east ? -m : m;
228
- const a = se(
229
- o.startWidth + m,
230
- g,
194
+ }, Q = (i) => {
195
+ const a = N.current, o = l.current, v = o.direction & (c.east | c.west), C = o.direction & (c.south | c.north);
196
+ if (a !== null && o.isResizing) {
197
+ const D = we(a);
198
+ if (v && C) {
199
+ let g = Math.floor(o.startX - i.clientX / D);
200
+ g = o.direction & c.east ? -g : g;
201
+ const d = de(
202
+ o.startWidth + g,
203
+ m,
231
204
  x
232
- ), H = a / o.ratio;
233
- d.style.width = `${a}px`, d.style.height = `${H}px`, o.currentHeight = H, o.currentWidth = a;
205
+ ), z = d / o.ratio;
206
+ a.style.width = `${d}px`, a.style.height = `${z}px`, o.currentHeight = z, o.currentWidth = d;
234
207
  } else if (C) {
235
- let m = Math.floor(o.startY - i.clientY / P);
236
- m = o.direction & s.south ? -m : m;
237
- const a = se(
238
- o.startHeight + m,
239
- E,
240
- q
208
+ let g = Math.floor(o.startY - i.clientY / D);
209
+ g = o.direction & c.south ? -g : g;
210
+ const d = de(
211
+ o.startHeight + g,
212
+ I,
213
+ G
241
214
  );
242
- d.style.height = `${a}px`, o.currentHeight = a;
215
+ a.style.height = `${d}px`, o.currentHeight = d;
243
216
  } else {
244
- let m = Math.floor(o.startX - i.clientX / P);
245
- m = o.direction & s.east ? -m : m;
246
- const a = se(
247
- o.startWidth + m,
248
- g,
217
+ let g = Math.floor(o.startX - i.clientX / D);
218
+ g = o.direction & c.east ? -g : g;
219
+ const d = de(
220
+ o.startWidth + g,
221
+ m,
249
222
  x
250
223
  );
251
- d.style.width = `${a}px`, o.currentWidth = a;
224
+ a.style.width = `${d}px`, o.currentWidth = d;
252
225
  }
253
226
  }
254
- }, O = () => {
255
- const i = N.current, d = l.current, o = j.current;
256
- if (i !== null && o !== null && d.isResizing) {
257
- const D = d.currentWidth, C = d.currentHeight;
258
- d.startWidth = 0, d.startHeight = 0, d.ratio = 0, d.startX = 0, d.startY = 0, d.currentWidth = 0, d.currentHeight = 0, d.isResizing = !1, o.classList.remove("image-control-wrapper--resizing"), L(), f(D, C), document.removeEventListener("pointermove", n), document.removeEventListener("pointerup", O);
227
+ }, n = () => {
228
+ const i = N.current, a = l.current, o = T.current;
229
+ if (i !== null && o !== null && a.isResizing) {
230
+ const v = a.currentWidth, C = a.currentHeight;
231
+ a.startWidth = 0, a.startHeight = 0, a.ratio = 0, a.startX = 0, a.startY = 0, a.currentWidth = 0, a.currentHeight = 0, a.isResizing = !1, o.classList.remove("image-control-wrapper--resizing"), W(), p(v, C), document.removeEventListener("pointermove", Q), document.removeEventListener("pointerup", n);
259
232
  }
260
233
  };
261
- return /* @__PURE__ */ h("div", { ref: j, children: [
262
- !G && S && /* @__PURE__ */ t(
234
+ return /* @__PURE__ */ h("div", { ref: T, children: [
235
+ !F && L && /* @__PURE__ */ t(
263
236
  "button",
264
237
  {
265
238
  className: "image-caption-button",
266
239
  ref: b,
267
240
  onClick: () => {
268
- A(!G);
241
+ M(!F);
269
242
  },
270
243
  children: "Add Caption"
271
244
  }
@@ -275,7 +248,7 @@ function Yt({
275
248
  {
276
249
  className: "image-resizer image-resizer-n",
277
250
  onPointerDown: (i) => {
278
- I(i, s.north);
251
+ P(i, c.north);
279
252
  }
280
253
  }
281
254
  ),
@@ -284,7 +257,7 @@ function Yt({
284
257
  {
285
258
  className: "image-resizer image-resizer-ne",
286
259
  onPointerDown: (i) => {
287
- I(i, s.north | s.east);
260
+ P(i, c.north | c.east);
288
261
  }
289
262
  }
290
263
  ),
@@ -293,7 +266,7 @@ function Yt({
293
266
  {
294
267
  className: "image-resizer image-resizer-e",
295
268
  onPointerDown: (i) => {
296
- I(i, s.east);
269
+ P(i, c.east);
297
270
  }
298
271
  }
299
272
  ),
@@ -302,7 +275,7 @@ function Yt({
302
275
  {
303
276
  className: "image-resizer image-resizer-se",
304
277
  onPointerDown: (i) => {
305
- I(i, s.south | s.east);
278
+ P(i, c.south | c.east);
306
279
  }
307
280
  }
308
281
  ),
@@ -311,7 +284,7 @@ function Yt({
311
284
  {
312
285
  className: "image-resizer image-resizer-s",
313
286
  onPointerDown: (i) => {
314
- I(i, s.south);
287
+ P(i, c.south);
315
288
  }
316
289
  }
317
290
  ),
@@ -320,7 +293,7 @@ function Yt({
320
293
  {
321
294
  className: "image-resizer image-resizer-sw",
322
295
  onPointerDown: (i) => {
323
- I(i, s.south | s.west);
296
+ P(i, c.south | c.west);
324
297
  }
325
298
  }
326
299
  ),
@@ -329,7 +302,7 @@ function Yt({
329
302
  {
330
303
  className: "image-resizer image-resizer-w",
331
304
  onPointerDown: (i) => {
332
- I(i, s.west);
305
+ P(i, c.west);
333
306
  }
334
307
  }
335
308
  ),
@@ -338,57 +311,57 @@ function Yt({
338
311
  {
339
312
  className: "image-resizer image-resizer-nw",
340
313
  onPointerDown: (i) => {
341
- I(i, s.north | s.west);
314
+ P(i, c.north | c.west);
342
315
  }
343
316
  }
344
317
  )
345
318
  ] });
346
319
  }
347
- const de = /* @__PURE__ */ new Set(), Ne = yt("RIGHT_CLICK_IMAGE_COMMAND");
348
- function Kt(u) {
349
- if (!de.has(u))
350
- throw new Promise((f) => {
320
+ const le = /* @__PURE__ */ new Set(), ve = xt("RIGHT_CLICK_IMAGE_COMMAND");
321
+ function Xt(u) {
322
+ if (!le.has(u))
323
+ throw new Promise((p) => {
351
324
  const b = new Image();
352
325
  b.src = u, b.onload = () => {
353
- de.add(u), f(null);
326
+ le.add(u), p(null);
354
327
  }, b.onerror = () => {
355
- de.add(u);
328
+ le.add(u);
356
329
  };
357
330
  });
358
331
  }
359
- function Xt({
332
+ function Ft({
360
333
  altText: u,
361
- className: f,
334
+ className: p,
362
335
  imageRef: b,
363
336
  src: N,
364
- width: z,
365
- height: v,
366
- maxWidth: G,
367
- onError: A
337
+ width: S,
338
+ height: E,
339
+ maxWidth: F,
340
+ onError: M
368
341
  }) {
369
- return Kt(N), /* @__PURE__ */ t(
342
+ return Xt(N), /* @__PURE__ */ t(
370
343
  "img",
371
344
  {
372
- className: f || void 0,
345
+ className: p || void 0,
373
346
  src: N,
374
347
  alt: u,
375
348
  ref: b,
376
- style: typeof z == "number" && typeof v == "number" ? {
349
+ style: typeof S == "number" && typeof E == "number" ? {
377
350
  // User has set a numeric size or original dimensions are provided
378
- width: typeof z == "number" ? z : "auto",
379
- height: typeof v == "number" ? v : "auto",
351
+ width: typeof S == "number" ? S : "auto",
352
+ height: typeof E == "number" ? E : "auto",
380
353
  maxWidth: "100%"
381
354
  } : {
382
355
  // No dimensions specified - use original image size
383
356
  maxWidth: "100%",
384
357
  height: "auto"
385
358
  },
386
- onError: A,
359
+ onError: M,
387
360
  draggable: "false"
388
361
  }
389
362
  );
390
363
  }
391
- function Ft() {
364
+ function Gt() {
392
365
  return /* @__PURE__ */ t(
393
366
  "img",
394
367
  {
@@ -402,173 +375,171 @@ function Ft() {
402
375
  }
403
376
  );
404
377
  }
405
- function Lr({
378
+ function gr({
406
379
  src: u,
407
- altText: f,
380
+ altText: p,
408
381
  nodeKey: b,
409
382
  width: N,
410
- height: z,
411
- maxWidth: v,
412
- resizable: G,
413
- showCaption: A,
414
- caption: S,
415
- captionsEnabled: j,
383
+ height: S,
384
+ maxWidth: E,
385
+ resizable: F,
386
+ showCaption: M,
387
+ caption: L,
388
+ captionsEnabled: T,
416
389
  originalPrompt: k,
417
390
  position: l = "none",
418
- linkUrl: p
391
+ linkUrl: f
419
392
  }) {
420
- const x = T(null), q = T(null), [g, E, _] = st(b), [L, I] = R(!1);
421
- nt();
422
- const [n] = ct(), [O, i] = R(null), d = T(null), [o, D] = R(!1), C = at(), [P, m] = R(!1), [a, H] = R(""), [B, le] = R(!1), [_e, Z] = R(!1), [me, Q] = R(""), [Oe, ee] = R(""), [He, ue] = R(!1), Y = T(null), [ge, Te] = R(0), je = ge > 0 && ge < 350;
423
- ae(() => {
393
+ const x = H(null), G = H(null), [m, I, O] = dt(b), [W, P] = R(!1), { isCollabActive: Q } = ct(), [n] = at(), [i, a] = R(null), o = H(null), [v, C] = R(!1), D = st(), [g, d] = R(!1), [z, U] = R(""), [j, ue] = R(!1), [Oe, Z] = R(!1), [me, ee] = R(""), [He, te] = R(""), [Te, ge] = R(!1), B = H(null), [he, je] = R(0), Be = he > 0 && he < 350;
394
+ se(() => {
424
395
  if (x.current) {
425
396
  const e = () => {
426
- x.current && Te(x.current.offsetWidth);
397
+ x.current && je(x.current.offsetWidth);
427
398
  };
428
399
  e();
429
400
  const r = new ResizeObserver(e);
430
401
  return r.observe(x.current), () => r.disconnect();
431
402
  }
432
- }, [N, z, g]);
433
- const te = W(
403
+ }, [N, S, m]);
404
+ const re = A(
434
405
  (e) => {
435
- const r = J();
436
- return g && X(r) && (e.preventDefault(), n.update(() => {
406
+ const r = V();
407
+ return m && K(r) && (e.preventDefault(), n.update(() => {
437
408
  r.getNodes().forEach((y) => {
438
- if (F(y)) {
409
+ if (X(y)) {
439
410
  const w = y.getParent();
440
- y.remove(), w && we(w) && w.getChildrenSize() === 0 && w.setFormat("left");
411
+ y.remove(), w && Ce(w) && w.getChildrenSize() === 0 && w.setFormat("left");
441
412
  }
442
413
  });
443
414
  })), !1;
444
415
  },
445
- [n, g]
446
- ), he = W(
416
+ [n, m]
417
+ ), fe = A(
447
418
  (e) => {
448
- const r = J(), c = q.current;
449
- if (g && X(r) && r.getNodes().length === 1) {
450
- if (A)
451
- return ce(null), e.preventDefault(), S.focus(), !0;
452
- if (c !== null && c !== document.activeElement)
453
- return e.preventDefault(), c.focus(), !0;
419
+ const r = V(), s = G.current;
420
+ if (m && K(r) && r.getNodes().length === 1) {
421
+ if (M)
422
+ return ae(null), e.preventDefault(), L.focus(), !0;
423
+ if (s !== null && s !== document.activeElement)
424
+ return e.preventDefault(), s.focus(), !0;
454
425
  }
455
426
  return !1;
456
427
  },
457
- [S, g, A]
458
- ), pe = W(
459
- (e) => d.current === S || q.current === e.target ? (ce(null), n.update(() => {
460
- E(!0);
428
+ [L, m, M]
429
+ ), pe = A(
430
+ (e) => o.current === L || G.current === e.target ? (ae(null), n.update(() => {
431
+ I(!0);
461
432
  const r = n.getRootElement();
462
433
  r !== null && r.focus();
463
434
  }), !0) : !1,
464
- [S, n, E]
465
- ), re = W(
435
+ [L, n, I]
436
+ ), ie = A(
466
437
  (e) => {
467
438
  const r = e;
468
- if (L)
439
+ if (W)
469
440
  return !0;
470
441
  const y = r.target === x.current;
471
442
  let w = !1;
472
443
  if (!y && x.current) {
473
- const V = x.current.getBoundingClientRect();
474
- w = r.clientX >= V.left && r.clientX <= V.right && r.clientY >= V.top && r.clientY <= V.bottom;
444
+ const q = x.current.getBoundingClientRect();
445
+ w = r.clientX >= q.left && r.clientX <= q.right && r.clientY >= q.top && r.clientY <= q.bottom;
475
446
  }
476
- return y || w ? (r.shiftKey ? E(!g) : (_(), E(!0)), !0) : !1;
447
+ return y || w ? (r.shiftKey ? I(!m) : (O(), I(!0)), !0) : !1;
477
448
  },
478
- [L, g, E, _]
479
- ), ie = W(
449
+ [W, m, I, O]
450
+ ), oe = A(
480
451
  (e) => {
481
452
  n.getEditorState().read(() => {
482
- const r = J();
483
- e.target.tagName === "IMG" && lt(r) && r.getNodes().length === 1 && n.dispatchCommand(
484
- Ne,
453
+ const r = V();
454
+ e.target.tagName === "IMG" && ut(r) && r.getNodes().length === 1 && n.dispatchCommand(
455
+ ve,
485
456
  e
486
457
  );
487
458
  });
488
459
  },
489
460
  [n]
490
461
  );
491
- ae(() => {
462
+ se(() => {
492
463
  let e = !0;
493
- const r = n.getRootElement(), c = dt(
464
+ const r = n.getRootElement(), s = lt(
494
465
  n.registerUpdateListener(({ editorState: y }) => {
495
- e && i(y.read(() => J()));
466
+ e && a(y.read(() => V()));
496
467
  }),
497
468
  n.registerCommand(
498
469
  mt,
499
- (y, w) => (d.current = w, !1),
500
- M
470
+ (y, w) => (o.current = w, !1),
471
+ $
501
472
  ),
502
473
  n.registerCommand(
503
- ut,
504
- re,
505
- M
474
+ gt,
475
+ ie,
476
+ $
506
477
  ),
507
478
  n.registerCommand(
508
- Ne,
509
- re,
510
- M
479
+ ve,
480
+ ie,
481
+ $
511
482
  ),
512
483
  n.registerCommand(
513
- gt,
484
+ ht,
514
485
  (y) => y.target === x.current ? (y.preventDefault(), !0) : !1,
515
- M
486
+ $
516
487
  ),
517
488
  n.registerCommand(
518
- ht,
519
- te,
520
- M
489
+ ft,
490
+ re,
491
+ $
521
492
  ),
522
493
  n.registerCommand(
523
494
  pt,
524
- te,
525
- M
495
+ re,
496
+ $
526
497
  ),
527
- n.registerCommand(ft, he, M),
498
+ n.registerCommand(bt, fe, $),
528
499
  n.registerCommand(
529
- bt,
500
+ yt,
530
501
  pe,
531
- M
502
+ $
532
503
  )
533
504
  );
534
- return r == null || r.addEventListener("contextmenu", ie), () => {
535
- e = !1, c(), r == null || r.removeEventListener("contextmenu", ie);
505
+ return r?.addEventListener("contextmenu", oe), () => {
506
+ e = !1, s(), r?.removeEventListener("contextmenu", oe);
536
507
  };
537
508
  }, [
538
- _,
509
+ O,
539
510
  n,
540
- L,
541
- g,
511
+ W,
512
+ m,
542
513
  b,
543
- te,
544
- he,
545
- pe,
546
514
  re,
515
+ fe,
516
+ pe,
547
517
  ie,
548
- E
518
+ oe,
519
+ I
549
520
  ]);
550
- const Be = () => {
521
+ const Ye = () => {
551
522
  n.update(() => {
552
- const e = U(b);
553
- F(e) && e.setShowCaption(!0);
523
+ const e = J(b);
524
+ X(e) && e.setShowCaption(!0);
554
525
  });
555
- }, Ye = (e, r) => {
526
+ }, Ke = (e, r) => {
556
527
  setTimeout(() => {
557
- I(!1);
528
+ P(!1);
558
529
  }, 200), n.update(() => {
559
- const c = U(b);
560
- F(c) && c.setWidthAndHeight(e, r);
530
+ const s = J(b);
531
+ X(s) && s.setWidthAndHeight(e, r);
561
532
  });
562
- }, Ke = () => {
563
- I(!0);
564
- }, Xe = (e) => {
533
+ }, Xe = () => {
534
+ P(!0);
535
+ }, Fe = (e) => {
565
536
  if (e.preventDefault(), e.stopPropagation(), u.startsWith("data:")) {
566
537
  const r = window.open("", "_blank");
567
538
  r && (r.document.write(`
568
539
  <!DOCTYPE html>
569
540
  <html>
570
541
  <head>
571
- <title>${f || "Image"}</title>
542
+ <title>${p || "Image"}</title>
572
543
  <style>
573
544
  body {
574
545
  margin: 0;
@@ -586,98 +557,96 @@ function Lr({
586
557
  </style>
587
558
  </head>
588
559
  <body>
589
- <img src="${u}" alt="${f || "Image"}" />
560
+ <img src="${u}" alt="${p || "Image"}" />
590
561
  </body>
591
562
  </html>
592
563
  `), r.document.close());
593
564
  } else
594
565
  window.open(u, "_blank");
595
- }, Fe = (e) => {
566
+ }, Ge = (e) => {
596
567
  e.preventDefault(), e.stopPropagation(), n.update(() => {
597
- const r = U(b);
598
- if (F(r)) {
599
- const c = r.getParent();
600
- r.remove(), c && we(c) && c.getChildrenSize() === 0 && c.setFormat("left");
568
+ const r = J(b);
569
+ if (X(r)) {
570
+ const s = r.getParent();
571
+ r.remove(), s && Ce(s) && s.getChildrenSize() === 0 && s.setFormat("left");
601
572
  }
602
573
  });
603
- }, K = (e, r) => {
574
+ }, Y = (e, r) => {
604
575
  e.preventDefault(), e.stopPropagation(), n.update(() => {
605
- const c = U(b);
606
- F(c) && c.setPosition(r);
576
+ const s = J(b);
577
+ X(s) && s.setPosition(r);
607
578
  });
608
- }, Ge = (e) => {
609
- e.preventDefault(), e.stopPropagation(), m(!P);
610
- }, qe = W(() => {
611
- p && !g && (Y.current = setTimeout(() => {
612
- ue(!0);
579
+ }, qe = (e) => {
580
+ e.preventDefault(), e.stopPropagation(), d(!g);
581
+ }, Ve = A(() => {
582
+ f && !m && (B.current = setTimeout(() => {
583
+ ge(!0);
613
584
  }, 300));
614
- }, [p, g]), Ve = W(() => {
615
- Y.current && (clearTimeout(Y.current), Y.current = null), ue(!1);
616
- }, []), fe = W((e) => {
617
- e.preventDefault(), e.stopPropagation(), p && window.open(p, "_blank", "noopener,noreferrer");
618
- }, [p]);
619
- ae(() => () => {
620
- Y.current && clearTimeout(Y.current);
585
+ }, [f, m]), Je = A(() => {
586
+ B.current && (clearTimeout(B.current), B.current = null), ge(!1);
587
+ }, []), be = A((e) => {
588
+ e.preventDefault(), e.stopPropagation(), f && window.open(f, "_blank", "noopener,noreferrer");
589
+ }, [f]);
590
+ se(() => () => {
591
+ B.current && clearTimeout(B.current);
621
592
  }, []);
622
- const be = async () => {
623
- if (!a.trim() || B)
624
- return;
625
- le(!0);
626
- const e = $.loading("Refining image...", {
593
+ const ye = async () => {
594
+ if (!z.trim() || j) return;
595
+ ue(!0);
596
+ const e = _.loading("Refining image...", {
627
597
  description: "This may take 10-30 seconds. Please wait."
628
598
  });
629
599
  try {
630
- let r = a.trim();
600
+ let r = z.trim();
631
601
  if (k && k.trim()) {
632
- const ne = k.trim(), rt = a.trim().replace(/^(add|also add|include|with|and)\s+(some|a|an)\s+/gi, "").replace(/^(add|also add|include|with|and)\s+/gi, "").trim();
633
- r = `${ne} with ${rt}`;
634
- } else if (f && f !== "Generated image" && f.trim()) {
635
- const ne = a.trim().replace(/^(add|also add|include|with|and)\s+(some|a|an)\s+/gi, "").replace(/^(add|also add|include|with|and)\s+/gi, "").trim();
636
- r = `${f} with ${ne}`;
602
+ const ce = k.trim(), it = z.trim().replace(/^(add|also add|include|with|and)\s+(some|a|an)\s+/gi, "").replace(/^(add|also add|include|with|and)\s+/gi, "").trim();
603
+ r = `${ce} with ${it}`;
604
+ } else if (p && p !== "Generated image" && p.trim()) {
605
+ const ce = z.trim().replace(/^(add|also add|include|with|and)\s+(some|a|an)\s+/gi, "").replace(/^(add|also add|include|with|and)\s+/gi, "").trim();
606
+ r = `${p} with ${ce}`;
637
607
  }
638
- const c = await _t({
608
+ const y = (await Ot({
639
609
  content: `Generate Image: ${r}`
640
- }), y = c == null ? void 0 : c.data;
610
+ }))?.data;
641
611
  if (!y)
642
612
  throw new Error("Failed to generate image - empty response");
643
- const oe = new DOMParser().parseFromString(y, "text/html").querySelector("img");
644
- if (!oe || !oe.src)
613
+ const ne = new DOMParser().parseFromString(y, "text/html").querySelector("img");
614
+ if (!ne || !ne.src)
645
615
  throw new Error("No image found in response");
646
- const tt = oe.src;
647
- $.dismiss(e), $.success("Image refined successfully!", {
616
+ const rt = ne.src;
617
+ _.dismiss(e), _.success("Image refined successfully!", {
648
618
  description: "Compare the images and choose which to keep."
649
- }), Q(tt), ee(r), Z(!0), H(""), m(!1);
619
+ }), ee(rt), te(r), Z(!0), U(""), d(!1);
650
620
  } catch (r) {
651
- if ($.dismiss(e), r instanceof Ot) {
652
- const c = r.code === "API_KEYS_DISABLED" ? "API Keys Disabled" : "API Key Required";
653
- $.error(c, {
654
- description: r.message,
655
- duration: 8e3
656
- });
657
- } else
658
- r instanceof Ht ? $.error("Credits Issue", {
621
+ if (_.dismiss(e), r instanceof Ht) {
622
+ const s = r.code === "API_KEYS_DISABLED" ? "API Keys Disabled" : "API Key Required";
623
+ _.error(s, {
659
624
  description: r.message,
660
625
  duration: 8e3
661
- }) : $.error("Failed to refine image", {
662
- description: r instanceof Error ? r.message : "Unknown error. Please try again."
663
626
  });
627
+ } else r instanceof Tt ? _.error("Credits Issue", {
628
+ description: r.message,
629
+ duration: 8e3
630
+ }) : _.error("Failed to refine image", {
631
+ description: r instanceof Error ? r.message : "Unknown error. Please try again."
632
+ });
664
633
  } finally {
665
- le(!1);
634
+ ue(!1);
666
635
  }
667
- }, Je = () => {
636
+ }, Ue = () => {
668
637
  n.update(() => {
669
- const e = U(b);
670
- if (F(e)) {
671
- e.setSrc(me), e.setOriginalPrompt(Oe);
672
- const r = J();
673
- r && ce(r.clone());
638
+ const e = J(b);
639
+ if (X(e)) {
640
+ e.setSrc(me), e.setOriginalPrompt(He);
641
+ const r = V();
642
+ r && ae(r.clone());
674
643
  }
675
- }), Z(!1), Q(""), ee(""), $.success("Image replaced successfully!", {
644
+ }), Z(!1), ee(""), te(""), _.success("Image replaced successfully!", {
676
645
  description: "The image has been updated with the refined version."
677
646
  });
678
- }, Ue = () => {
679
- Z(!1), Q(""), ee("");
680
- }, Ze = g && X(O) && !L, ye = (g || L) && C, Qe = () => l === "left" || l === "right" ? {
647
+ }, Ze = () => {
648
+ Z(!1), ee(""), te("");
649
+ }, Qe = m && K(i) && !W, xe = (m || W) && D, et = () => l === "left" || l === "right" ? {
681
650
  position: "relative",
682
651
  display: "block",
683
652
  width: "100%"
@@ -693,55 +662,55 @@ function Lr({
693
662
  } : {
694
663
  position: "relative",
695
664
  display: "inline-block"
696
- }, et = W(
665
+ }, tt = A(
697
666
  (e) => {
698
- if (L || e.target.closest("button"))
667
+ if (W || e.target.closest("button"))
699
668
  return;
700
- const c = e.target === x.current;
669
+ const s = e.target === x.current;
701
670
  let y = !1;
702
- if (!c && x.current) {
671
+ if (!s && x.current) {
703
672
  const w = x.current.getBoundingClientRect();
704
673
  y = e.clientX >= w.left && e.clientX <= w.right && e.clientY >= w.top && e.clientY <= w.bottom;
705
674
  }
706
- !c && !y || (e.stopPropagation(), e.shiftKey ? E(!g) : (_(), E(!0)));
675
+ !s && !y || (e.stopPropagation(), e.shiftKey ? I(!m) : (O(), I(!0)));
707
676
  },
708
- [L, g, E, _]
677
+ [W, m, I, O]
709
678
  );
710
- return /* @__PURE__ */ t(xt, { fallback: null, children: /* @__PURE__ */ h(it, { children: [
679
+ return /* @__PURE__ */ t(wt, { fallback: null, children: /* @__PURE__ */ h(ot, { children: [
711
680
  /* @__PURE__ */ h(
712
681
  "div",
713
682
  {
714
- draggable: Ze,
715
- style: Qe(),
716
- onClick: et,
717
- onMouseEnter: qe,
718
- onMouseLeave: Ve,
683
+ draggable: Qe,
684
+ style: et(),
685
+ onClick: tt,
686
+ onMouseEnter: Ve,
687
+ onMouseLeave: Je,
719
688
  children: [
720
- o ? /* @__PURE__ */ t(Ft, {}) : /* @__PURE__ */ t(
721
- Xt,
689
+ v ? /* @__PURE__ */ t(Gt, {}) : /* @__PURE__ */ t(
690
+ Ft,
722
691
  {
723
- className: ye ? `focused ${X(O) ? "draggable" : ""}` : p ? "cteditor-cursor-pointer" : null,
692
+ className: xe ? `focused ${K(i) ? "draggable" : ""}` : f ? "cteditor-cursor-pointer" : null,
724
693
  src: u,
725
- altText: f,
694
+ altText: p,
726
695
  imageRef: x,
727
696
  width: N,
728
- height: z,
729
- maxWidth: v,
730
- onError: () => D(!0)
697
+ height: S,
698
+ maxWidth: E,
699
+ onError: () => C(!0)
731
700
  }
732
701
  ),
733
- He && p && !g && /* @__PURE__ */ h(
702
+ Te && f && !m && /* @__PURE__ */ h(
734
703
  "div",
735
704
  {
736
705
  className: "cteditor-absolute cteditor-bottom-2 cteditor-left-2 cteditor-right-2 cteditor-bg-background cteditor-rounded-lg cteditor-shadow-lg cteditor-border cteditor-border-border cteditor-p-2 cteditor-flex cteditor-items-center cteditor-gap-2",
737
706
  style: { zIndex: 10 },
738
707
  children: [
739
- /* @__PURE__ */ t(Tt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-muted-foreground cteditor-flex-shrink-0" }),
740
- /* @__PURE__ */ t("span", { className: "cteditor-text-sm cteditor-text-foreground cteditor-truncate cteditor-flex-1", children: p }),
708
+ /* @__PURE__ */ t(jt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-muted-foreground cteditor-flex-shrink-0" }),
709
+ /* @__PURE__ */ t("span", { className: "cteditor-text-sm cteditor-text-foreground cteditor-truncate cteditor-flex-1", children: f }),
741
710
  /* @__PURE__ */ t(
742
711
  "button",
743
712
  {
744
- onClick: fe,
713
+ onClick: be,
745
714
  className: "cteditor-px-2 cteditor-py-1.5 cteditor-text-xs cteditor-rounded cteditor-bg-primary cteditor-text-primary-foreground hover:cteditor-bg-primary/90 cteditor-transition-colors cteditor-flex-shrink-0",
746
715
  children: "Open"
747
716
  }
@@ -749,125 +718,125 @@ function Lr({
749
718
  ]
750
719
  }
751
720
  ),
752
- g && X(O) && !o && /* @__PURE__ */ h(
721
+ m && K(i) && !v && /* @__PURE__ */ h(
753
722
  "div",
754
723
  {
755
- className: `cteditor-absolute cteditor-flex cteditor-gap-1 z-10 ${je ? "cteditor-left-1/2 cteditor--translate-x-1/2 cteditor-bottom-0 cteditor-translate-y-full cteditor-mt-1" : "cteditor-top-2 cteditor-right-2"}`,
724
+ className: `cteditor-absolute cteditor-flex cteditor-gap-1 z-10 ${Be ? "cteditor-left-1/2 cteditor--translate-x-1/2 cteditor-bottom-0 cteditor-translate-y-full cteditor-mt-1" : "cteditor-top-2 cteditor-right-2"}`,
756
725
  children: [
757
726
  /* @__PURE__ */ h("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-0.5 cteditor-bg-background/80 cteditor-rounded-md cteditor-shadow-md cteditor-border cteditor-border-border cteditor-p-0.5", children: [
758
727
  /* @__PURE__ */ t(
759
728
  "button",
760
729
  {
761
- onClick: (e) => K(e, "left"),
730
+ onClick: (e) => Y(e, "left"),
762
731
  className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "left" ? "cteditor-bg-accent" : ""}`,
763
732
  "aria-label": "Wrap text left",
764
733
  title: "Wrap text left",
765
- children: /* @__PURE__ */ t(Pt, {})
734
+ children: /* @__PURE__ */ t(Rt, {})
766
735
  }
767
736
  ),
768
737
  /* @__PURE__ */ t(
769
738
  "button",
770
739
  {
771
- onClick: (e) => K(e, "right"),
740
+ onClick: (e) => Y(e, "right"),
772
741
  className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "right" ? "cteditor-bg-accent" : ""}`,
773
742
  "aria-label": "Wrap text right",
774
743
  title: "Wrap text right",
775
- children: /* @__PURE__ */ t(Rt, {})
744
+ children: /* @__PURE__ */ t(Dt, {})
776
745
  }
777
746
  ),
778
747
  /* @__PURE__ */ t("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-border cteditor-mx-0.5" }),
779
748
  /* @__PURE__ */ t(
780
749
  "button",
781
750
  {
782
- onClick: (e) => K(e, "inline-left"),
751
+ onClick: (e) => Y(e, "inline-left"),
783
752
  className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "inline-left" ? "cteditor-bg-accent" : ""}`,
784
753
  "aria-label": "Align left",
785
754
  title: "Align left (no text wrap)",
786
- children: /* @__PURE__ */ t(Dt, {})
755
+ children: /* @__PURE__ */ t(zt, {})
787
756
  }
788
757
  ),
789
758
  /* @__PURE__ */ t(
790
759
  "button",
791
760
  {
792
- onClick: (e) => K(e, "inline-center"),
761
+ onClick: (e) => Y(e, "inline-center"),
793
762
  className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "inline-center" || l === "full" ? "cteditor-bg-accent" : ""}`,
794
763
  "aria-label": "Align center",
795
764
  title: "Align center (no text wrap)",
796
- children: /* @__PURE__ */ t(zt, {})
765
+ children: /* @__PURE__ */ t(St, {})
797
766
  }
798
767
  ),
799
768
  /* @__PURE__ */ t(
800
769
  "button",
801
770
  {
802
- onClick: (e) => K(e, "inline-right"),
771
+ onClick: (e) => Y(e, "inline-right"),
803
772
  className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "inline-right" ? "cteditor-bg-accent" : ""}`,
804
773
  "aria-label": "Align right",
805
774
  title: "Align right (no text wrap)",
806
- children: /* @__PURE__ */ t(St, {})
775
+ children: /* @__PURE__ */ t(Lt, {})
807
776
  }
808
777
  ),
809
778
  /* @__PURE__ */ t("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-border cteditor-mx-0.5" }),
810
779
  /* @__PURE__ */ t(
811
780
  "button",
812
781
  {
813
- onClick: (e) => K(e, "none"),
782
+ onClick: (e) => Y(e, "none"),
814
783
  className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "none" ? "cteditor-bg-accent" : ""}`,
815
784
  "aria-label": "Inline",
816
785
  title: "Inline with text",
817
- children: /* @__PURE__ */ t(Lt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
786
+ children: /* @__PURE__ */ t(Wt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
818
787
  }
819
788
  )
820
789
  ] }),
821
- p && /* @__PURE__ */ t(
790
+ f && /* @__PURE__ */ t(
822
791
  "button",
823
792
  {
824
- onClick: fe,
793
+ onClick: be,
825
794
  className: " cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-accent cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border",
826
795
  "aria-label": "Visit link",
827
- title: `Visit: ${p}`,
828
- children: /* @__PURE__ */ t(Wt, {})
796
+ title: `Visit: ${f}`,
797
+ children: /* @__PURE__ */ t(At, {})
829
798
  }
830
799
  ),
831
800
  k && /* @__PURE__ */ t(
832
801
  "button",
833
802
  {
834
803
  onClick: (e) => {
835
- e.stopPropagation(), Ge(e);
804
+ e.stopPropagation(), qe(e);
836
805
  },
837
806
  className: " cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-accent cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border",
838
807
  "aria-label": "Refine image",
839
808
  title: "Refine image",
840
- children: /* @__PURE__ */ t(At, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
809
+ children: /* @__PURE__ */ t(Mt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
841
810
  }
842
811
  ),
843
812
  /* @__PURE__ */ t(
844
813
  "button",
845
814
  {
846
815
  onClick: (e) => {
847
- e.stopPropagation(), Xe(e);
816
+ e.stopPropagation(), Fe(e);
848
817
  },
849
818
  className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-accent cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border",
850
819
  "aria-label": "Open image in new tab",
851
820
  title: "Open in new tab",
852
- children: /* @__PURE__ */ t(Mt, {})
821
+ children: /* @__PURE__ */ t($t, {})
853
822
  }
854
823
  ),
855
824
  /* @__PURE__ */ t(
856
825
  "button",
857
826
  {
858
827
  onClick: (e) => {
859
- e.stopPropagation(), Fe(e);
828
+ e.stopPropagation(), Ge(e);
860
829
  },
861
830
  className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-destructive hover:cteditor-text-destructive-foreground cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border",
862
831
  "aria-label": "Delete image",
863
832
  title: "Delete image",
864
- children: /* @__PURE__ */ t($t, {})
833
+ children: /* @__PURE__ */ t(_t, {})
865
834
  }
866
835
  )
867
836
  ]
868
837
  }
869
838
  ),
870
- P && g && !o && k && /* @__PURE__ */ t(
839
+ g && m && !v && k && /* @__PURE__ */ t(
871
840
  "div",
872
841
  {
873
842
  className: "cteditor-absolute cteditor-bottom-2 cteditor-left-2 cteditor-right-2 cteditor-bg-background cteditor-rounded-lg cteditor-shadow-xl cteditor-border cteditor-border-border cteditor-p-3",
@@ -881,10 +850,10 @@ function Lr({
881
850
  "input",
882
851
  {
883
852
  type: "text",
884
- value: a,
885
- onChange: (e) => H(e.target.value),
853
+ value: z,
854
+ onChange: (e) => U(e.target.value),
886
855
  onKeyDown: (e) => {
887
- e.stopPropagation(), e.key === "Enter" && a.trim() && !B && be(), e.key === "Escape" && (m(!1), H(""));
856
+ e.stopPropagation(), e.key === "Enter" && z.trim() && !j && ye(), e.key === "Escape" && (d(!1), U(""));
888
857
  },
889
858
  onKeyUp: (e) => {
890
859
  e.stopPropagation();
@@ -894,7 +863,7 @@ function Lr({
894
863
  },
895
864
  placeholder: "e.g., flying birds, golden sunset, stormy clouds...",
896
865
  className: "cteditor-w-full cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-border cteditor-border-border cteditor-rounded-md cteditor-bg-background cteditor-text-foreground focus:cteditor-outline-none focus:cteditor-ring-2 focus:cteditor-ring-blue-500",
897
- disabled: B,
866
+ disabled: j,
898
867
  autoFocus: !0
899
868
  }
900
869
  ),
@@ -903,11 +872,11 @@ function Lr({
903
872
  "button",
904
873
  {
905
874
  onClick: (e) => {
906
- e.stopPropagation(), be();
875
+ e.stopPropagation(), ye();
907
876
  },
908
- disabled: B || !a.trim(),
877
+ disabled: j || !z.trim(),
909
878
  className: "cteditor-flex-1 cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-rounded-md cteditor-bg-blue-500 cteditor-text-white hover:cteditor-bg-blue-600 disabled:cteditor-opacity-50 disabled:cteditor-cursor-not-allowed cteditor-transition-colors",
910
- children: B ? /* @__PURE__ */ h("span", { className: "cteditor-flex cteditor-items-center cteditor-justify-center cteditor-gap-2", children: [
879
+ children: j ? /* @__PURE__ */ h("span", { className: "cteditor-flex cteditor-items-center cteditor-justify-center cteditor-gap-2", children: [
911
880
  /* @__PURE__ */ t("span", { className: "cteditor-inline-block cteditor-w-4 cteditor-h-4 cteditor-border-2 cteditor-border-white cteditor-border-t-transparent cteditor-rounded-full cteditor-animate-spin" }),
912
881
  "Refining..."
913
882
  ] }) : "Refine Image"
@@ -917,9 +886,9 @@ function Lr({
917
886
  "button",
918
887
  {
919
888
  onClick: (e) => {
920
- e.stopPropagation(), m(!1), H("");
889
+ e.stopPropagation(), d(!1), U("");
921
890
  },
922
- disabled: B,
891
+ disabled: j,
923
892
  className: "cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-rounded-md cteditor-bg-background cteditor-border cteditor-border-border cteditor-text-foreground hover:cteditor-bg-accent disabled:cteditor-opacity-50 disabled:cteditor-cursor-not-allowed cteditor-transition-colors",
924
893
  children: "Cancel"
925
894
  }
@@ -928,24 +897,24 @@ function Lr({
928
897
  ] })
929
898
  }
930
899
  ),
931
- G && X(O) && ye && /* @__PURE__ */ t(
932
- Yt,
900
+ F && K(i) && xe && /* @__PURE__ */ t(
901
+ Kt,
933
902
  {
934
- showCaption: A,
935
- setShowCaption: Be,
903
+ showCaption: M,
904
+ setShowCaption: Ye,
936
905
  editor: n,
937
- buttonRef: q,
906
+ buttonRef: G,
938
907
  imageRef: x,
939
- maxWidth: v,
940
- onResizeStart: Ke,
941
- onResizeEnd: Ye,
942
- captionsEnabled: !o && j
908
+ maxWidth: E,
909
+ onResizeStart: Xe,
910
+ onResizeEnd: Ke,
911
+ captionsEnabled: !v && T
943
912
  }
944
913
  )
945
914
  ]
946
915
  }
947
916
  ),
948
- A && (f.startsWith("Signature by") ? /* @__PURE__ */ t(Bt, { caption: S }) : /* @__PURE__ */ t(
917
+ M && (p.startsWith("Signature by") ? /* @__PURE__ */ t(Yt, { caption: L }) : /* @__PURE__ */ t(
949
918
  "div",
950
919
  {
951
920
  className: "image-caption-container",
@@ -956,61 +925,61 @@ function Lr({
956
925
  ...l === "inline-center" || l === "full" ? { margin: "0 auto" } : l === "inline-right" ? { marginLeft: "auto" } : l === "left" ? { float: "left", clear: "left" } : l === "right" ? { float: "right", clear: "right" } : {}
957
926
  },
958
927
  children: /* @__PURE__ */ h(
959
- Re,
928
+ De,
960
929
  {
961
- initialEditor: S,
930
+ initialEditor: L,
962
931
  initialNodes: [
963
- Se,
964
932
  Le,
965
933
  We,
966
934
  Ae,
935
+ Me,
967
936
  ke,
968
- ve
937
+ Ee
969
938
  ],
970
939
  children: [
971
- /* @__PURE__ */ t(ot, {}),
940
+ /* @__PURE__ */ t(nt, {}),
972
941
  /* @__PURE__ */ t(
973
- ze,
942
+ Se,
974
943
  {
975
944
  contentEditable: /* @__PURE__ */ t(
976
- Ee,
945
+ Ie,
977
946
  {
978
947
  "aria-placeholder": "Enter a caption...",
979
948
  placeholder: () => /* @__PURE__ */ t("span", { className: "cteditor-text-xs", children: "Enter a caption..." }),
980
949
  className: "ImageNode__contentEditable"
981
950
  }
982
951
  ),
983
- ErrorBoundary: Ie
952
+ ErrorBoundary: Pe
984
953
  }
985
954
  ),
986
955
  /* @__PURE__ */ t(
987
- De,
956
+ ze,
988
957
  {
989
958
  onChange: () => {
990
959
  }
991
960
  }
992
961
  ),
993
- /* @__PURE__ */ t(Pe, {}),
994
- /* @__PURE__ */ t(Me, { namespace: $e.namespace })
962
+ /* @__PURE__ */ t(Re, {}),
963
+ /* @__PURE__ */ t($e, { namespace: _e.namespace })
995
964
  ]
996
965
  }
997
966
  )
998
967
  }
999
968
  )),
1000
969
  /* @__PURE__ */ t(
1001
- jt,
970
+ Bt,
1002
971
  {
1003
- open: _e,
972
+ open: Oe,
1004
973
  onOpenChange: Z,
1005
974
  oldImageUrl: u,
1006
975
  newImageUrl: me,
1007
- onReplace: Je,
1008
- onCancel: Ue
976
+ onReplace: Ue,
977
+ onCancel: Ze
1009
978
  }
1010
979
  )
1011
980
  ] }) });
1012
981
  }
1013
982
  export {
1014
- Ne as RIGHT_CLICK_IMAGE_COMMAND,
1015
- Lr as default
983
+ ve as RIGHT_CLICK_IMAGE_COMMAND,
984
+ gr as default
1016
985
  };