@epam/ai-dial-attachment-canvas 1.3.0-rc.0 → 1.4.0-dev.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,43 +1,59 @@
1
1
  import { a as e, i as t, n, r, t as i } from "./attachment-canvas-BgwyzrRC.js";
2
- import { i as a, o, t as s } from "./LazyContentBoundary-BJmXYamK.js";
2
+ import { i as a, o, t as s } from "./LazyContentBoundary-ES0u-Jn7.js";
3
3
  import { AttachmentType as c, CodeBlockTheme as l, DEFAULT_MARKDOWN_CLASS_NAMES as u, FileExtension as d, MIMEType as f, MarkdownRenderer as p, buildCssVars as m, copyToClipboard as h, isSyntaxHighlightingAllowed as g, mergeClasses as _, restrainedSyntaxTheme as v, stripUrlQueryAndFragment as y } from "@epam/ai-dial-chat-shared";
4
4
  import { SidebarOrientation as b, SidebarPanel as x } from "@epam/ai-dial-sidebar";
5
5
  import { DIAL_ICON_SIZE as S, DIAL_KIT_ICON_STROKE as C, ElementSize as w, GhostButton as T, GhostIconButton as E, LinkButton as D, LiveRegion as O, LiveRegionPoliteness as k, Spinner as A } from "@epam/ai-dial-ui-kit";
6
- import { IconAlertTriangle as j, IconArrowsMaximize as M, IconCheck as N, IconCode as ee, IconCopy as te, IconDownload as ne, IconEye as re, IconLock as ie, IconMarkdown as ae, IconRefresh as oe } from "@tabler/icons-react";
7
- import { createContext as P, lazy as se, memo as F, useCallback as I, useContext as L, useEffect as R, useMemo as z, useRef as B, useState as V } from "react";
8
- import { JsonView as ce, defaultStyles as le } from "react-json-view-lite";
9
- import { Fragment as ue, jsx as H, jsxs as U } from "react/jsx-runtime";
10
- import { AppBridge as W, AppFrame as de } from "@mcp-ui/client";
11
- import { McpUiHostContextChangedNotificationSchema as fe } from "@modelcontextprotocol/ext-apps/app-bridge";
12
- import { VisualizerConnector as G, VisualizerConnectorEvents as pe, VisualizerConnectorRequests as me } from "@epam/ai-dial-visualizer-connector";
6
+ import { IconAlertTriangle as j, IconArrowsMaximize as M, IconCheck as N, IconCode as ee, IconCopy as te, IconDownload as P, IconEye as ne, IconLock as re, IconMarkdown as ie, IconRefresh as ae } from "@tabler/icons-react";
7
+ import { createContext as F, lazy as oe, memo as I, useCallback as L, useContext as R, useEffect as z, useMemo as B, useRef as V, useState as H } from "react";
8
+ import { JsonView as se, defaultStyles as ce } from "react-json-view-lite";
9
+ import { Fragment as le, jsx as U, jsxs as W } from "react/jsx-runtime";
10
+ import { AppBridge as G, AppFrame as ue } from "@mcp-ui/client";
11
+ import { McpUiHostContextChangedNotificationSchema as de } from "@modelcontextprotocol/ext-apps/app-bridge";
12
+ import { VisualizerConnector as K, VisualizerConnectorEvents as fe, VisualizerConnectorRequests as pe } from "@epam/ai-dial-visualizer-connector";
13
13
  //#region src/constants/public-class-names.ts
14
- var he = { panel: "dial-attachment-canvas-panel" }, ge = {
14
+ var me = { panel: "dial-attachment-canvas-panel" }, q = "h-full overflow-auto p-4 flex items-center justify-center", J = "h-full overflow-hidden", he = {
15
+ [i.PlainText]: "h-full overflow-auto p-4",
16
+ [i.Image]: q,
17
+ [i.Audio]: q,
18
+ [i.Unsupported]: q,
19
+ [i.Error]: q,
20
+ [i.Json]: "h-full overflow-auto",
21
+ [i.Pdf]: J,
22
+ [i.Ooxml]: J,
23
+ [i.Visualizer]: J,
24
+ [i.GroupedVisualizer]: J,
25
+ [i.McpApp]: J,
26
+ [i.Code]: J,
27
+ [i.Html]: J,
28
+ [i.Markdown]: "h-full overflow-auto",
29
+ [i.MarkdownTable]: "flex h-full min-h-0 flex-col overflow-hidden p-4"
30
+ }, Y = {
15
31
  container: "_container_k7ib4_1",
16
32
  containerLight: "_containerLight_k7ib4_5"
17
- }, K = {
33
+ }, ge = {
18
34
  [l.Dark]: v,
19
35
  [l.Light]: v
20
- }, q = () => se(async () => {
36
+ }, _e = () => oe(async () => {
21
37
  let { Prism: e } = await import("react-syntax-highlighter");
22
38
  return { default: e };
23
- }), _e = F(({ content: e, codeBlockTheme: t = l.Light, labels: n, codeClassName: r = "dial-code-text", errorLabelClassName: i }) => {
24
- let { text: a, language: o } = e, c = z(() => g(a), [a]), u = o == null || o === "plaintext" || !c, d = K[t], f = t === l.Light, [p, m] = V(0), h = z(q, [p]), v = I(() => {
39
+ }), ve = I(({ content: e, codeBlockTheme: t = l.Light, labels: n, codeClassName: r = "dial-code-text", errorLabelClassName: i }) => {
40
+ let { text: a, language: o } = e, c = B(() => g(a), [a]), u = o == null || o === "plaintext" || !c, d = ge[t], f = t === l.Light, [p, m] = H(0), h = B(_e, [p]), v = L(() => {
25
41
  m((e) => e + 1);
26
- }, []), y = /* @__PURE__ */ H("pre", {
42
+ }, []), y = /* @__PURE__ */ U("pre", {
27
43
  className: _(r, "p-4 wrap-break-word whitespace-pre-wrap"),
28
44
  children: a
29
45
  });
30
- return /* @__PURE__ */ H("div", {
46
+ return /* @__PURE__ */ U("div", {
31
47
  dir: "ltr",
32
- className: _("h-full overflow-auto", ge.container, f && ge.containerLight),
33
- children: u ? y : /* @__PURE__ */ H(s, {
48
+ className: _("h-full overflow-auto", Y.container, f && Y.containerLight),
49
+ children: u ? y : /* @__PURE__ */ U(s, {
34
50
  retryKey: p,
35
51
  onRetry: v,
36
52
  pendingContent: y,
37
53
  errorContent: y,
38
54
  labels: n,
39
55
  errorLabelClassName: i,
40
- children: /* @__PURE__ */ H(h, {
56
+ children: /* @__PURE__ */ U(h, {
41
57
  language: o,
42
58
  style: d,
43
59
  customStyle: {
@@ -53,8 +69,8 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
53
69
  })
54
70
  })
55
71
  });
56
- }), ve = "dial-html-preview:render", ye = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, be = F(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text", codeClassName: s }) => {
57
- let { htmlFrameBlockedLabel: c = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: l = "Open in new tab", loadingLabel: u = "Loading…" } = t, [d, f] = V(!0), [p, m] = V(!1), [h, g] = V(void 0), [v, y] = V(!1), [b, x] = V(!1), S = B(null), C = B(null), w = B(!1), T = B({
72
+ }), ye = "dial-html-preview:render", be = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, xe = I(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text", codeClassName: s }) => {
73
+ let { htmlFrameBlockedLabel: c = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: l = "Open in new tab", loadingLabel: u = "Loading…" } = t, [d, f] = H(!0), [p, m] = H(!1), [h, g] = H(void 0), [v, y] = H(!1), [b, x] = H(!1), S = V(null), C = V(null), w = V(!1), T = V({
58
74
  content: e,
59
75
  generation: 0
60
76
  });
@@ -63,11 +79,11 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
63
79
  generation: T.current.generation + 1
64
80
  });
65
81
  let E = T.current.generation;
66
- R(() => {
82
+ z(() => {
67
83
  f(!0), m(!1), g(void 0), y(!1), x(!1);
68
84
  }, [e]);
69
- let O = B(n);
70
- O.current !== n && (O.current = n, n && b && x(!1), !n && w.current && (w.current = !1, f(!0))), R(() => {
85
+ let O = V(n);
86
+ O.current !== n && (O.current = n, n && b && x(!1), !n && w.current && (w.current = !1, f(!0))), z(() => {
71
87
  if (!n || e.srcdoc != null || e.resolveSourceText == null || h != null) return;
72
88
  let t = !1, r = e.resolveSourceText;
73
89
  return (async () => {
@@ -88,11 +104,11 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
88
104
  e,
89
105
  h
90
106
  ]);
91
- let k = e.isSameOriginUrl === !0 && e.url != null, j = !k && e.srcdoc != null, M = j ? e.srcdocHostUrl : void 0, N = e.srcdoc, ee = I((e) => {
107
+ let k = e.isSameOriginUrl === !0 && e.url != null, j = !k && e.srcdoc != null, M = j ? e.srcdocHostUrl : void 0, N = e.srcdoc, ee = L((e) => {
92
108
  if (f(!1), M != null) {
93
109
  let e = S.current?.contentWindow;
94
110
  e != null && e !== C.current && N != null && (C.current = e, e.postMessage({
95
- type: ve,
111
+ type: ye,
96
112
  html: N
97
113
  }, "*"));
98
114
  } else if (!(j || k)) try {
@@ -105,55 +121,55 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
105
121
  k,
106
122
  M,
107
123
  N
108
- ]), te = I(() => {
124
+ ]), te = L(() => {
109
125
  f(!1), m(!0);
110
- }, []), ne = e.srcdoc ?? h, re = e.srcdoc != null || e.resolveSourceText != null, ie = e.srcdoc == null && e.resolveSourceText != null && h == null && !b;
111
- if (n && re && (ne != null || v || ie)) return w.current = !0, ne == null ? /* @__PURE__ */ H("div", {
126
+ }, []), P = e.srcdoc ?? h, ne = e.srcdoc != null || e.resolveSourceText != null, re = e.srcdoc == null && e.resolveSourceText != null && h == null && !b;
127
+ if (n && ne && (P != null || v || re)) return w.current = !0, P == null ? /* @__PURE__ */ U("div", {
112
128
  className: "flex h-full items-center justify-center",
113
- children: /* @__PURE__ */ H(A, { ariaLabel: u })
114
- }) : /* @__PURE__ */ H(_e, {
129
+ children: /* @__PURE__ */ U(A, { ariaLabel: u })
130
+ }) : /* @__PURE__ */ U(ve, {
115
131
  content: {
116
132
  type: i.Code,
117
- text: ne,
133
+ text: P,
118
134
  language: "html"
119
135
  },
120
136
  codeBlockTheme: a,
121
137
  codeClassName: s
122
138
  });
123
- if (p) return /* @__PURE__ */ U("div", {
139
+ if (p) return /* @__PURE__ */ W("div", {
124
140
  className: "flex h-full flex-col items-center justify-center gap-3 p-4",
125
- children: [/* @__PURE__ */ H("p", {
141
+ children: [/* @__PURE__ */ U("p", {
126
142
  className: "text-center",
127
143
  children: c
128
- }), e.url != null && /* @__PURE__ */ H(D, {
144
+ }), e.url != null && /* @__PURE__ */ U(D, {
129
145
  href: e.url,
130
146
  target: "_blank",
131
147
  label: l,
132
- className: ye.openInNewTabButton,
148
+ className: be.openInNewTabButton,
133
149
  textClassName: o
134
150
  })]
135
151
  });
136
- let ae = j ? M : e.url, oe = j && M == null ? e.srcdoc : void 0;
137
- return /* @__PURE__ */ U("div", {
152
+ let ie = j ? M : e.url, ae = j && M == null ? e.srcdoc : void 0;
153
+ return /* @__PURE__ */ W("div", {
138
154
  className: "relative h-full",
139
- children: [d && /* @__PURE__ */ H("div", {
155
+ children: [d && /* @__PURE__ */ U("div", {
140
156
  className: "absolute inset-0 flex items-center justify-center",
141
- children: /* @__PURE__ */ H(A, { ariaLabel: u })
142
- }), /* @__PURE__ */ H("iframe", {
157
+ children: /* @__PURE__ */ U(A, { ariaLabel: u })
158
+ }), /* @__PURE__ */ U("iframe", {
143
159
  ref: S,
144
160
  title: r,
145
- src: ae,
146
- srcDoc: oe,
161
+ src: ie,
162
+ srcDoc: ae,
147
163
  sandbox: j || k ? "allow-scripts" : "allow-scripts allow-same-origin",
148
164
  className: _("h-full w-full border-none", d ? "invisible" : ""),
149
165
  onLoad: ee,
150
166
  onError: te
151
167
  }, E)]
152
168
  });
153
- }), xe = {
169
+ }), Se = {
154
170
  name: "MCP-UI Host",
155
171
  version: "1.0.0"
156
- }, Se = { openLinks: {} }, Ce = (e) => {
172
+ }, Ce = { openLinks: {} }, we = (e) => {
157
173
  let t;
158
174
  try {
159
175
  t = new URL(e);
@@ -167,20 +183,20 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
167
183
  return !1;
168
184
  }
169
185
  return !0;
170
- }, we = (e, t, n) => {
186
+ }, Te = (e, t, n) => {
171
187
  if (n) {
172
188
  e.style.maxWidth = "", e.style.maxHeight = "";
173
189
  return;
174
190
  }
175
191
  let r = t;
176
192
  r != null && (r.width != null && (e.style.width = `${r.width}px`), r.maxWidth != null && (e.style.maxWidth = `${r.maxWidth}px`), r.height != null && (e.style.height = `${r.height}px`), r.maxHeight != null && (e.style.maxHeight = `${r.maxHeight}px`));
177
- }, Te = (e, t, n) => {
178
- let r = B(e);
179
- R(() => {
193
+ }, Ee = (e, t, n) => {
194
+ let r = V(e);
195
+ z(() => {
180
196
  r.current = e;
181
197
  });
182
- let [i, a] = V(null), [o, s] = V(!1);
183
- return R(() => {
198
+ let [i, a] = H(null), [o, s] = H(!1);
199
+ return z(() => {
184
200
  let e = null;
185
201
  try {
186
202
  let n = t.current?.getBoundingClientRect(), i = n != null && n.width > 0 && n.height > 0 ? {
@@ -190,15 +206,15 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
190
206
  height: Math.round(n.height)
191
207
  }
192
208
  } : r.current.hostContext;
193
- e = new W(null, r.current.hostInfo ?? xe, Se, { hostContext: i }), e.onopenlink = async ({ url: e }) => {
209
+ e = new G(null, r.current.hostInfo ?? Se, Ce, { hostContext: i }), e.onopenlink = async ({ url: e }) => {
194
210
  let t = r.current.onOpenLink;
195
- return (t == null ? Ce(e) : t(e)) === !1 ? { isError: !0 } : {};
211
+ return (t == null ? we(e) : t(e)) === !1 ? { isError: !0 } : {};
196
212
  }, e.onrequestdisplaymode = async ({ mode: e }) => {
197
213
  let t = r.current.onRequestDisplayMode, n = r.current.hostContext?.displayMode ?? "inline";
198
214
  return { mode: t?.(e) ?? n };
199
- }, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(fe, ({ params: e }) => {
215
+ }, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(de, ({ params: e }) => {
200
216
  let n = t.current?.querySelector("iframe");
201
- n != null && we(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
217
+ n != null && Te(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
202
218
  }), a(e);
203
219
  } catch (e) {
204
220
  console.error("[useMcpAppBridge] Error creating AppBridge:", e), s(!0);
@@ -206,22 +222,22 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
206
222
  return () => {
207
223
  e?.close().catch((e) => console.error("[useMcpAppBridge] Error closing AppBridge:", e));
208
224
  };
209
- }, [t]), R(() => {
225
+ }, [t]), z(() => {
210
226
  i != null && i.transport != null && n != null && i.setHostContext(n);
211
227
  }, [i, n]), {
212
228
  appBridge: i,
213
229
  hasFailed: o
214
230
  };
215
- }, J = {
231
+ }, X = {
216
232
  loadingOverlay: "_loadingOverlay_1kink_2",
217
233
  fullscreenFrame: "_fullscreenFrame_1kink_21",
218
234
  loadingFrame: "_loadingFrame_1kink_29",
219
235
  statusLabel: "_statusLabel_1kink_33",
220
236
  statusDetail: "_statusDetail_1kink_38",
221
237
  errorIcon: "_errorIcon_1kink_42"
222
- }, Ee = ({ content: e, errorLabel: t = "Failed to load app", loadingLabel: n = "Loading…", onAppInfo: r }) => {
223
- let [i, a] = V("loading"), [o, s] = V(), { html: c, sandboxUrl: l, toolInput: u, toolResult: d, hostContext: f } = e, p = z(() => ({ url: new URL(l) }), [l]), m = f?.displayMode === "fullscreen", h = B(null), [g, v] = V();
224
- R(() => {
238
+ }, De = ({ content: e, errorLabel: t = "Failed to load app", loadingLabel: n = "Loading…", onAppInfo: r }) => {
239
+ let [i, a] = H("loading"), [o, s] = H(), { html: c, sandboxUrl: l, toolInput: u, toolResult: d, hostContext: f } = e, p = B(() => ({ url: new URL(l) }), [l]), m = f?.displayMode === "fullscreen", h = V(null), [g, v] = H();
240
+ z(() => {
225
241
  let e = h.current;
226
242
  if (!e) return;
227
243
  let t = new ResizeObserver(([e]) => {
@@ -234,15 +250,15 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
234
250
  });
235
251
  return t.observe(e), () => t.disconnect();
236
252
  }, []);
237
- let { appBridge: y, hasFailed: b } = Te(e, h, z(() => f == null || g == null ? f : {
253
+ let { appBridge: y, hasFailed: b } = Ee(e, h, B(() => f == null || g == null ? f : {
238
254
  ...f,
239
255
  containerDimensions: g
240
256
  }, [f, g])), x = b || i === "error";
241
- return /* @__PURE__ */ U("div", {
257
+ return /* @__PURE__ */ W("div", {
242
258
  ref: h,
243
- className: _("relative h-full w-full", x ? "min-h-[160px]" : "min-h-[100px]", m && J.fullscreenFrame, !m && i === "loading" && J.loadingFrame),
259
+ className: _("relative h-full w-full", x ? "min-h-[160px]" : "min-h-[100px]", m && X.fullscreenFrame, !m && i === "loading" && X.loadingFrame),
244
260
  children: [
245
- y != null && !x && /* @__PURE__ */ H(de, {
261
+ y != null && !x && /* @__PURE__ */ U(ue, {
246
262
  html: c,
247
263
  sandbox: p,
248
264
  appBridge: y,
@@ -256,33 +272,33 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
256
272
  s(e.message), a("error");
257
273
  }
258
274
  }),
259
- !x && i === "loading" && /* @__PURE__ */ H("div", {
260
- className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", J.loadingOverlay),
261
- children: /* @__PURE__ */ H(A, { ariaLabel: n })
275
+ !x && i === "loading" && /* @__PURE__ */ U("div", {
276
+ className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", X.loadingOverlay),
277
+ children: /* @__PURE__ */ U(A, { ariaLabel: n })
262
278
  }),
263
- /* @__PURE__ */ H(O, {
279
+ /* @__PURE__ */ U(O, {
264
280
  visuallyHidden: !0,
265
281
  children: x && [t, o].filter(Boolean).join(". ")
266
282
  }),
267
- x && /* @__PURE__ */ U("div", {
283
+ x && /* @__PURE__ */ W("div", {
268
284
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2 p-4",
269
- children: [/* @__PURE__ */ H(j, {
285
+ children: [/* @__PURE__ */ U(j, {
270
286
  size: 60,
271
287
  stroke: C,
272
288
  "aria-hidden": !0,
273
- className: J.errorIcon
274
- }), /* @__PURE__ */ U("p", {
289
+ className: X.errorIcon
290
+ }), /* @__PURE__ */ W("p", {
275
291
  "aria-hidden": !0,
276
- className: _("text-center", J.statusLabel),
277
- children: [t, o && /* @__PURE__ */ U(ue, { children: [/* @__PURE__ */ H("br", {}), /* @__PURE__ */ H("span", {
278
- className: J.statusDetail,
292
+ className: _("text-center", X.statusLabel),
293
+ children: [t, o && /* @__PURE__ */ W(le, { children: [/* @__PURE__ */ U("br", {}), /* @__PURE__ */ U("span", {
294
+ className: X.statusDetail,
279
295
  children: o
280
296
  })] })]
281
297
  })]
282
298
  })
283
299
  ]
284
300
  });
285
- }, Y = {
301
+ }, Z = {
286
302
  viewer: "_viewer_gdafg_2",
287
303
  spreadsheetCanvas: "_spreadsheetCanvas_gdafg_6",
288
304
  formulaPanel: "_formulaPanel_gdafg_12",
@@ -290,13 +306,13 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
290
306
  statusOverlay: "_statusOverlay_gdafg_27",
291
307
  errorIcon: "_errorIcon_gdafg_32",
292
308
  highlight: "_highlight_gdafg_40"
293
- }, De = (e) => {
309
+ }, Oe = (e) => {
294
310
  if (e?.kind !== "range") return "";
295
311
  let { activeCell: t } = e.selection, n = e.cells.find(({ address: e }) => e.row === t.row && e.col === t.col);
296
312
  if (n == null) return "";
297
313
  let r = n.formula;
298
314
  return r == null || r.trim().length === 0 ? n.displayText : r.startsWith("=") ? r : `=${r}`;
299
- }, X = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
315
+ }, ke = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
300
316
  switch (t) {
301
317
  case r.Docx: {
302
318
  let [{ DocxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/docx"), import("@silurus/ooxml/chart-ex")]);
@@ -318,7 +334,7 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
318
334
  }
319
335
  case r.Csv: {
320
336
  let { XlsxSheetViewer: t } = await import("@silurus/ooxml/xlsx"), r = document.createElement("canvas");
321
- r.className = Y.spreadsheetCanvas, e.replaceChildren(r);
337
+ r.className = Z.spreadsheetCanvas, e.replaceChildren(r);
322
338
  let i = new t(r, {
323
339
  showScrollbars: !0,
324
340
  onError: n
@@ -342,7 +358,7 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
342
358
  });
343
359
  }
344
360
  }
345
- }, Oe = async (e, t, n, i) => {
361
+ }, Ae = async (e, t, n, i) => {
346
362
  let { onError: a, onXlsxSelectionContextChange: o, onGeometryInvalidated: s } = n;
347
363
  switch (t.format) {
348
364
  case r.Docx: {
@@ -351,7 +367,7 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
351
367
  import("@silurus/ooxml/chart-ex"),
352
368
  import("./ooxml-highlight-surfaces-C18JJb0P.js")
353
369
  ]), l = await n.load(t.url, { chartEx: o });
354
- if (i()) throw l.destroy(), new ke();
370
+ if (i()) throw l.destroy(), new je();
355
371
  let u = r.fromDocument(e, l, {
356
372
  enableTextSelection: !0,
357
373
  refitOnResize: !0,
@@ -371,7 +387,7 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
371
387
  import("@silurus/ooxml/chart-ex"),
372
388
  import("./ooxml-highlight-surfaces-C18JJb0P.js")
373
389
  ]), l = await n.load(t.url, { chartEx: o });
374
- if (i()) throw l.destroy(), new ke();
390
+ if (i()) throw l.destroy(), new je();
375
391
  let u = r.fromPresentation(e, l, {
376
392
  enableTextSelection: !0,
377
393
  refitOnResize: !0,
@@ -405,15 +421,15 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
405
421
  };
406
422
  }
407
423
  case r.Csv: {
408
- let r = await X(e, t.format, n);
424
+ let r = await ke(e, t.format, n);
409
425
  return await r.load(t.url), { viewer: r };
410
426
  }
411
427
  }
412
- }, ke = class extends Error {}, Ae = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, formulaValueClassName: s, highlightsLabel: c = "Cited locations", highlightNavigatedLabel: l = "Scrolled to the cited location", loadingLabel: u = "Loading…" }) => {
413
- let d = B(null), [f, p] = V(!0), [m, h] = V(!1), [g, v] = V(""), [y, b] = V([]), [x, S] = V(!1), { highlights: w, selectedHighlightId: T } = t, E = w != null && w.length > 0, D = B(void 0), M = B(w);
428
+ }, je = class extends Error {}, Me = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, formulaValueClassName: s, highlightsLabel: c = "Cited locations", highlightNavigatedLabel: l = "Scrolled to the cited location", loadingLabel: u = "Loading…" }) => {
429
+ let d = V(null), [f, p] = H(!0), [m, h] = H(!1), [g, v] = H(""), [y, b] = H([]), [x, S] = H(!1), { highlights: w, selectedHighlightId: T } = t, E = w != null && w.length > 0, D = V(void 0), M = V(w);
414
430
  M.current = w;
415
- let N = B(void 0);
416
- return R(() => {
431
+ let N = V(void 0);
432
+ return z(() => {
417
433
  let e = d.current;
418
434
  if (e == null) return;
419
435
  let n, r, i = !1, a, o = () => i;
@@ -435,7 +451,7 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
435
451
  i || (p(!1), h(!0));
436
452
  },
437
453
  onXlsxSelectionContextChange: (e) => {
438
- i || v(De(e));
454
+ i || v(Oe(e));
439
455
  },
440
456
  onGeometryInvalidated: s
441
457
  }, u = () => {
@@ -446,14 +462,14 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
446
462
  return e.addEventListener("scroll", s, !0), N.current = s, (async () => {
447
463
  try {
448
464
  if (E) {
449
- let r = await Oe(e, t, l, o);
465
+ let r = await Ae(e, t, l, o);
450
466
  if (i) {
451
467
  r.viewer.destroy(), r.engine?.destroy();
452
468
  return;
453
469
  }
454
470
  n = r, D.current = r.highlights, u();
455
471
  } else {
456
- let r = await X(e, t.format, l);
472
+ let r = await ke(e, t.format, l);
457
473
  if (i) {
458
474
  r.destroy();
459
475
  return;
@@ -464,7 +480,7 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
464
480
  if (i) return;
465
481
  p(!1), await c();
466
482
  } catch (t) {
467
- if (t instanceof ke || i) return;
483
+ if (t instanceof je || i) return;
468
484
  n?.viewer.destroy(), n?.engine?.destroy(), n = void 0, D.current = void 0, e.replaceChildren(), p(!1), h(!0);
469
485
  }
470
486
  })(), () => {
@@ -474,9 +490,9 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
474
490
  t.format,
475
491
  t.url,
476
492
  E
477
- ]), R(() => {
493
+ ]), z(() => {
478
494
  N.current?.();
479
- }, [w]), R(() => {
495
+ }, [w]), z(() => {
480
496
  S(!1);
481
497
  let t = D.current;
482
498
  if (t == null || f) return;
@@ -494,38 +510,38 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
494
510
  })(), () => {
495
511
  r = !0;
496
512
  };
497
- }, [T, f]), /* @__PURE__ */ U("div", {
513
+ }, [T, f]), /* @__PURE__ */ W("div", {
498
514
  className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
499
515
  children: [
500
- t.format === r.Xlsx && /* @__PURE__ */ U("div", {
516
+ t.format === r.Xlsx && /* @__PURE__ */ W("div", {
501
517
  role: "region",
502
518
  "aria-label": a,
503
- className: _("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", Y.formulaPanel),
504
- children: [/* @__PURE__ */ H("span", {
519
+ className: _("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", Z.formulaPanel),
520
+ children: [/* @__PURE__ */ U("span", {
505
521
  "aria-hidden": "true",
506
522
  className: _("shrink-0", o),
507
523
  children: "fx"
508
- }), /* @__PURE__ */ H("code", {
524
+ }), /* @__PURE__ */ U("code", {
509
525
  dir: "ltr",
510
526
  tabIndex: 0,
511
527
  "aria-live": "polite",
512
- className: _("h-8 min-w-0 flex-1 overflow-x-auto rounded border px-2 py-1 whitespace-nowrap focus-visible:outline", Y.formulaValue, s),
528
+ className: _("h-8 min-w-0 flex-1 overflow-x-auto rounded border px-2 py-1 whitespace-nowrap focus-visible:outline", Z.formulaValue, s),
513
529
  children: g
514
530
  })]
515
531
  }),
516
- /* @__PURE__ */ U("div", {
532
+ /* @__PURE__ */ W("div", {
517
533
  className: "relative min-h-0 w-full flex-1",
518
- children: [/* @__PURE__ */ H("div", {
534
+ children: [/* @__PURE__ */ U("div", {
519
535
  ref: d,
520
536
  role: "document",
521
537
  "aria-label": n,
522
538
  "aria-busy": f,
523
- className: _("h-full w-full overflow-hidden", Y.viewer)
524
- }), y.length > 0 && /* @__PURE__ */ H("div", {
539
+ className: _("h-full w-full overflow-hidden", Z.viewer)
540
+ }), y.length > 0 && /* @__PURE__ */ U("div", {
525
541
  role: "region",
526
542
  "aria-label": c,
527
543
  className: "pointer-events-none absolute inset-0 overflow-hidden",
528
- children: y.map((e, t) => /* @__PURE__ */ H("div", {
544
+ children: y.map((e, t) => /* @__PURE__ */ U("div", {
529
545
  "aria-hidden": "true",
530
546
  style: {
531
547
  left: `${e.left}px`,
@@ -535,32 +551,32 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
535
551
  },
536
552
  "data-selected": e.highlightId === T,
537
553
  "data-clipped": e.isClippedAtEnd === !0,
538
- className: _("absolute", Y.highlight)
554
+ className: _("absolute", Z.highlight)
539
555
  }, `${e.highlightId}-${t}`))
540
556
  })]
541
557
  }),
542
- /* @__PURE__ */ H(O, {
558
+ /* @__PURE__ */ U(O, {
543
559
  visuallyHidden: !0,
544
560
  children: x ? l : ""
545
561
  }),
546
- /* @__PURE__ */ H(O, {
562
+ /* @__PURE__ */ U(O, {
547
563
  politeness: k.Assertive,
548
564
  visuallyHidden: !0,
549
565
  children: !f && m ? i : ""
550
566
  }),
551
- (f || m) && /* @__PURE__ */ H("div", {
552
- className: _("absolute inset-0 flex items-center justify-center", Y.statusOverlay),
553
- children: f ? /* @__PURE__ */ H(A, {
567
+ (f || m) && /* @__PURE__ */ U("div", {
568
+ className: _("absolute inset-0 flex items-center justify-center", Z.statusOverlay),
569
+ children: f ? /* @__PURE__ */ U(A, {
554
570
  size: 48,
555
571
  ariaLabel: u
556
- }) : /* @__PURE__ */ U("div", {
572
+ }) : /* @__PURE__ */ W("div", {
557
573
  className: "flex flex-col items-center gap-2",
558
- children: [/* @__PURE__ */ H(j, {
574
+ children: [/* @__PURE__ */ U(j, {
559
575
  "aria-hidden": "true",
560
576
  size: 60,
561
577
  stroke: C,
562
- className: Y.errorIcon
563
- }), /* @__PURE__ */ H("p", {
578
+ className: Z.errorIcon
579
+ }), /* @__PURE__ */ U("p", {
564
580
  "aria-hidden": !0,
565
581
  className: "text-center",
566
582
  children: i
@@ -569,12 +585,12 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
569
585
  })
570
586
  ]
571
587
  });
572
- }, je = (e, t) => {
588
+ }, Ne = (e, t) => {
573
589
  let n = e.toLowerCase();
574
590
  return t.find((e) => e.contentType.split(",").some((e) => e.trim().toLowerCase() === n && e.trim() !== ""));
575
- }, Me = (e, t) => {
591
+ }, Pe = (e, t) => {
576
592
  if (e != null && e !== "") return Object.prototype.hasOwnProperty.call(t, e) ? t[e] : void 0;
577
- }, Ne = (e) => `${e}:grouped-visualizer`, Pe = (e, t) => {
593
+ }, Fe = (e) => `${e}:grouped-visualizer`, Ie = (e, t) => {
578
594
  let n = (t.contentType ?? "").split(",").map((e) => e.trim().toLowerCase()).filter((e) => e !== ""), r = [], i = [];
579
595
  return e.forEach((e) => {
580
596
  e.url != null && e.url !== "" && (n.length === 0 || n.includes(e.contentType.toLowerCase())) ? r.push(e) : i.push(e);
@@ -582,34 +598,34 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
582
598
  claimed: r,
583
599
  unclaimed: i
584
600
  };
585
- }, Fe = (e) => {
601
+ }, Le = (e) => {
586
602
  if (typeof e != "object" || !e || !Object.prototype.hasOwnProperty.call(e, "message")) return;
587
603
  let { message: t } = e;
588
604
  return typeof t == "string" && t.trim() !== "" ? t : void 0;
589
- }, Ie = {
605
+ }, Re = {
590
606
  loadingOverlay: "_loadingOverlay_12637_1",
591
607
  statusLabel: "_statusLabel_12637_5",
592
608
  errorIcon: "_errorIcon_12637_9"
593
- }, Le = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a, onSendMessage: o }) => {
594
- let s = B(null), [c, l] = V("loading"), { url: u, visualizerName: d, requestTimeout: f } = e, p = B(e);
609
+ }, ze = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a, onSendMessage: o }) => {
610
+ let s = V(null), [c, l] = H("loading"), { url: u, visualizerName: d, requestTimeout: f } = e, p = V(e);
595
611
  p.current = e;
596
- let h = B(o);
597
- return h.current = o, R(() => {
612
+ let h = V(o);
613
+ return h.current = o, z(() => {
598
614
  let e = s.current;
599
615
  if (!e) return;
600
616
  l("loading");
601
- let t = new G(e, {
617
+ let t = new K(e, {
602
618
  domain: u,
603
619
  visualizerName: d,
604
620
  requestTimeout: f
605
- }), n = !0, r = t.subscribe(`${d}/${pe.SendMessage}`, (e) => {
606
- let t = Fe(e);
621
+ }), n = !0, r = t.subscribe(`${d}/${fe.SendMessage}`, (e) => {
622
+ let t = Le(e);
607
623
  t != null && h.current?.(t);
608
624
  });
609
625
  return (async () => {
610
626
  if (await t.ready(), !n) return;
611
627
  let e = p.current;
612
- if (e.type === i.GroupedVisualizer) await t.send(me.SendGroupedVisualizeData, {
628
+ if (e.type === i.GroupedVisualizer) await t.send(pe.SendGroupedVisualizeData, {
613
629
  attachments: e.attachments,
614
630
  layout: e.layout
615
631
  });
@@ -618,7 +634,7 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
618
634
  layout: r,
619
635
  ...typeof i == "object" && i ? i : {}
620
636
  };
621
- await t.send(me.SendVisualizeData, {
637
+ await t.send(pe.SendVisualizeData, {
622
638
  mimeType: n,
623
639
  visualizerData: a
624
640
  });
@@ -633,7 +649,7 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
633
649
  u,
634
650
  d,
635
651
  f
636
- ]), R(() => {
652
+ ]), z(() => {
637
653
  let e = r ?? d.trim();
638
654
  e !== "" && s.current?.querySelector("iframe")?.setAttribute("title", e);
639
655
  }, [
@@ -641,7 +657,7 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
641
657
  d,
642
658
  u,
643
659
  f
644
- ]), /* @__PURE__ */ U("div", {
660
+ ]), /* @__PURE__ */ W("div", {
645
661
  className: "relative h-full w-full",
646
662
  style: m({
647
663
  "--vs-loading-bg": a?.loadingBackground,
@@ -649,38 +665,38 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
649
665
  "--vs-error-icon": a?.errorIcon
650
666
  }),
651
667
  children: [
652
- /* @__PURE__ */ H("div", {
668
+ /* @__PURE__ */ U("div", {
653
669
  ref: s,
654
670
  className: "h-full w-full"
655
671
  }),
656
- c === "loading" && /* @__PURE__ */ U("div", {
657
- className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", Ie.loadingOverlay),
658
- children: [/* @__PURE__ */ H(A, { ariaLabel: t }), t && /* @__PURE__ */ H("p", {
672
+ c === "loading" && /* @__PURE__ */ W("div", {
673
+ className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", Re.loadingOverlay),
674
+ children: [/* @__PURE__ */ U(A, { ariaLabel: t }), t && /* @__PURE__ */ U("p", {
659
675
  "aria-hidden": !0,
660
- className: _("text-center", Ie.statusLabel),
676
+ className: _("text-center", Re.statusLabel),
661
677
  children: t
662
678
  })]
663
679
  }),
664
- /* @__PURE__ */ H(O, {
680
+ /* @__PURE__ */ U(O, {
665
681
  visuallyHidden: !0,
666
682
  children: c === "error" && n
667
683
  }),
668
- c === "error" && /* @__PURE__ */ U("div", {
684
+ c === "error" && /* @__PURE__ */ W("div", {
669
685
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
670
- children: [/* @__PURE__ */ H(j, {
686
+ children: [/* @__PURE__ */ U(j, {
671
687
  size: 60,
672
688
  stroke: C,
673
689
  "aria-hidden": !0,
674
- className: Ie.errorIcon
675
- }), /* @__PURE__ */ H("p", {
690
+ className: Re.errorIcon
691
+ }), /* @__PURE__ */ U("p", {
676
692
  "aria-hidden": !0,
677
- className: _("text-center", Ie.statusLabel),
693
+ className: _("text-center", Re.statusLabel),
678
694
  children: n
679
695
  })]
680
696
  })
681
697
  ]
682
698
  });
683
- }, Z = {
699
+ }, Q = {
684
700
  body: "_body_fvnln_4",
685
701
  statusLabel: "_statusLabel_fvnln_13",
686
702
  errorIcon: "_errorIcon_fvnln_17",
@@ -695,136 +711,118 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
695
711
  jsonExpandIcon: "_jsonExpandIcon_fvnln_54",
696
712
  jsonCollapseIcon: "_jsonCollapseIcon_fvnln_67",
697
713
  jsonCollapsedContent: "_jsonCollapsedContent_fvnln_84"
698
- }, Re = () => se(async () => ({ default: (await import("./PdfContent-DWuP2aKd.js")).PdfContent })), ze = ({ url: e, fileName: t, loadErrorLabel: n }) => {
699
- let [r, i] = V(!1);
700
- return R(() => {
714
+ }, Be = () => oe(async () => ({ default: (await import("./PdfContent-BEWJ_9tn.js")).PdfContent })), Ve = ({ url: e, fileName: t, loadErrorLabel: n }) => {
715
+ let [r, i] = H(!1);
716
+ return z(() => {
701
717
  i(!1);
702
- }, [e]), r ? /* @__PURE__ */ U("div", {
718
+ }, [e]), r ? /* @__PURE__ */ W("div", {
703
719
  className: "flex flex-col items-center gap-2",
704
- children: [/* @__PURE__ */ H(j, {
720
+ children: [/* @__PURE__ */ U(j, {
705
721
  size: 60,
706
722
  stroke: C,
707
- className: Z.errorIcon
708
- }), /* @__PURE__ */ H("p", {
709
- className: _("text-center", Z.statusLabel),
723
+ className: Q.errorIcon
724
+ }), /* @__PURE__ */ U("p", {
725
+ className: _("text-center", Q.statusLabel),
710
726
  children: n
711
727
  })]
712
- }) : /* @__PURE__ */ H("img", {
728
+ }) : /* @__PURE__ */ U("img", {
713
729
  src: e,
714
730
  alt: t ?? "",
715
731
  className: "max-h-full max-w-full object-contain",
716
732
  onError: () => i(!0)
717
733
  });
718
- }, Be = F(({ content: e, isLoading: t = !1, fileName: r, isHtmlSourceView: a = !1, labels: { unsupportedLabel: o = "Preview is not supported for this file", loadErrorLabel: c = "Failed to load file", loadErrorRetryLabel: l = "Retry", forbiddenErrorLabel: d = "You don't have permission to access this file", visualizerErrorLabel: f, htmlFrameBlockedLabel: h = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: g = "Open in new tab", pdfThumbnailsLabel: v, pdfShowThumbnailsLabel: y, pdfHideThumbnailsLabel: b, pdfPageNumberLabel: x, pdfContentLoadingLabel: S, pdfContentErrorLabel: w, pdfContentRetryLabel: E, xlsxFormulaLabel: D = "Formula", codeContentLoadingLabel: O, codeContentErrorLabel: k, codeContentRetryLabel: M, tableCopyLabel: N, tableCopiedLabel: ee, tableDownloadCsvLabel: te, codeBlockCopyLabel: ne, codeBlockCopiedLabel: re, codeBlockDownloadLabel: ae, tableScrollRegionAriaLabel: oe, mathScrollRegionAriaLabel: P, ooxmlHighlightsLabel: se, ooxmlHighlightNavigatedLabel: F, loadingLabel: L = "Loading…" } = {}, styles: ue, codeBlockTheme: W, tableDownloadFilename: de, loadPdf: fe, hidePdfToolbar: G = !1, configurePdfWorker: pe, onAppInfo: me, onRetry: he, onVisualizerSendMessage: ge }) => {
719
- let { colors: K, typography: q, bodyClassName: ve, cssVars: ye } = ue ?? {}, [xe, Se] = V(0), Ce = z(Re, [xe]), we = I(() => {
720
- Se((e) => e + 1);
721
- }, []), Te = B(void 0), [J, Y] = V(0), De = I((e) => {
722
- Te.current = e;
734
+ }, He = I(({ content: e, isLoading: t = !1, fileName: r, isHtmlSourceView: a = !1, labels: { unsupportedLabel: o = "Preview is not supported for this file", loadErrorLabel: c = "Failed to load file", loadErrorRetryLabel: l = "Retry", forbiddenErrorLabel: d = "You don't have permission to access this file", visualizerErrorLabel: f, htmlFrameBlockedLabel: h = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: g = "Open in new tab", pdfThumbnailsLabel: v, pdfShowThumbnailsLabel: y, pdfHideThumbnailsLabel: b, pdfPageNumberLabel: x, pdfContentLoadingLabel: S, pdfContentErrorLabel: w, pdfContentRetryLabel: E, xlsxFormulaLabel: D = "Formula", codeContentLoadingLabel: O, codeContentErrorLabel: k, codeContentRetryLabel: M, tableCopyLabel: N, tableCopiedLabel: ee, tableDownloadCsvLabel: te, codeBlockCopyLabel: P, codeBlockCopiedLabel: ne, codeBlockDownloadLabel: ie, tableScrollRegionAriaLabel: ae, mathScrollRegionAriaLabel: F, ooxmlHighlightsLabel: oe, ooxmlHighlightNavigatedLabel: I, loadingLabel: R = "Loading…" } = {}, styles: le, codeBlockTheme: G, tableDownloadFilename: ue, loadPdf: de, hidePdfToolbar: K = !1, configurePdfWorker: fe, onAppInfo: pe, onRetry: me, onVisualizerSendMessage: q }) => {
735
+ let { colors: J, typography: Y, bodyClassName: ge, cssVars: _e } = le ?? {}, [ye, be] = H(0), Se = B(Be, [ye]), Ce = L(() => {
736
+ be((e) => e + 1);
737
+ }, []), we = V(void 0), [Te, Ee] = H(0), X = L((e) => {
738
+ we.current = e;
723
739
  }, []);
724
- R(() => {
725
- let t = Te.current;
726
- t != null && (Te.current = void 0, e.type === i.Pdf && e.url === t && Y((e) => e + 1));
740
+ z(() => {
741
+ let t = we.current;
742
+ t != null && (we.current = void 0, e.type === i.Pdf && e.url === t && Ee((e) => e + 1));
727
743
  }, [e]);
728
- let X = q?.fontClassName != null, Oe = z(() => ({
744
+ let Z = Y?.fontClassName != null, Oe = B(() => ({
729
745
  ...m({
730
- "--ac-text": K?.text,
731
- "--ac-status-text": K?.statusText,
732
- "--ac-error-icon": K?.errorIcon,
733
- "--ac-open-in-new-tab-text": K?.openInNewTabText,
734
- "--ac-json-border": K?.jsonBorder,
735
- "--ac-json-bg": K?.jsonBackground,
736
- "--ac-json-label": K?.jsonLabel,
737
- "--ac-json-clickable-label": K?.jsonClickableLabel,
738
- "--ac-json-punctuation": K?.jsonPunctuation,
739
- "--ac-json-string": K?.jsonString,
740
- "--ac-json-number": K?.jsonNumber,
741
- "--ac-json-boolean": K?.jsonBoolean,
742
- "--ac-json-null": K?.jsonNull,
743
- "--ac-json-toggle-icon": K?.jsonToggleIcon,
744
- "--ac-json-toggle-icon-hover": K?.jsonToggleIconHover,
745
- "--ac-ooxml-bg": K?.ooxmlBackground,
746
- "--ac-ooxml-formula-border": K?.ooxmlFormulaBorder,
747
- "--ac-ooxml-formula-bg": K?.ooxmlFormulaBackground,
748
- "--ac-ooxml-formula-text": K?.ooxmlFormulaText,
749
- "--ac-ooxml-highlight-border": K?.ooxmlHighlightBorder,
750
- "--ac-ooxml-highlight-bg": K?.ooxmlHighlightBackground,
751
- "--ac-json-collapsed-text": K?.jsonCollapsedText,
752
- "--ac-json-collapsed-bg": K?.jsonCollapsedBackground,
753
- "--ac-focus-outline": K?.focusOutline,
754
- "--ac-code-bg": K?.codeBackground,
755
- "--ac-mcp-app-loading-bg": K?.mcpAppLoadingBackground,
756
- "--ac-mcp-app-status-text": K?.mcpAppStatusText,
757
- "--ac-font-family": X ? void 0 : q?.fontFamily,
758
- "--ac-font-size": X ? void 0 : q?.fontSize,
759
- "--ac-font-weight": X ? void 0 : q?.fontWeight,
760
- "--ac-line-height": X ? void 0 : q?.lineHeight,
761
- "--ac-letter-spacing": X ? void 0 : q?.letterSpacing
746
+ "--ac-text": J?.text,
747
+ "--ac-status-text": J?.statusText,
748
+ "--ac-error-icon": J?.errorIcon,
749
+ "--ac-open-in-new-tab-text": J?.openInNewTabText,
750
+ "--ac-json-border": J?.jsonBorder,
751
+ "--ac-json-bg": J?.jsonBackground,
752
+ "--ac-json-label": J?.jsonLabel,
753
+ "--ac-json-clickable-label": J?.jsonClickableLabel,
754
+ "--ac-json-punctuation": J?.jsonPunctuation,
755
+ "--ac-json-string": J?.jsonString,
756
+ "--ac-json-number": J?.jsonNumber,
757
+ "--ac-json-boolean": J?.jsonBoolean,
758
+ "--ac-json-null": J?.jsonNull,
759
+ "--ac-json-toggle-icon": J?.jsonToggleIcon,
760
+ "--ac-json-toggle-icon-hover": J?.jsonToggleIconHover,
761
+ "--ac-ooxml-bg": J?.ooxmlBackground,
762
+ "--ac-ooxml-formula-border": J?.ooxmlFormulaBorder,
763
+ "--ac-ooxml-formula-bg": J?.ooxmlFormulaBackground,
764
+ "--ac-ooxml-formula-text": J?.ooxmlFormulaText,
765
+ "--ac-ooxml-highlight-border": J?.ooxmlHighlightBorder,
766
+ "--ac-ooxml-highlight-bg": J?.ooxmlHighlightBackground,
767
+ "--ac-json-collapsed-text": J?.jsonCollapsedText,
768
+ "--ac-json-collapsed-bg": J?.jsonCollapsedBackground,
769
+ "--ac-focus-outline": J?.focusOutline,
770
+ "--ac-code-bg": J?.codeBackground,
771
+ "--ac-mcp-app-loading-bg": J?.mcpAppLoadingBackground,
772
+ "--ac-mcp-app-status-text": J?.mcpAppStatusText,
773
+ "--ac-font-family": Z ? void 0 : Y?.fontFamily,
774
+ "--ac-font-size": Z ? void 0 : Y?.fontSize,
775
+ "--ac-font-weight": Z ? void 0 : Y?.fontWeight,
776
+ "--ac-line-height": Z ? void 0 : Y?.lineHeight,
777
+ "--ac-letter-spacing": Z ? void 0 : Y?.letterSpacing
762
778
  }),
763
- ...ye
764
- }), [ue]), ke = z(() => {
779
+ ..._e
780
+ }), [le]), ke = he[e.type], Ae = B(() => {
765
781
  switch (e.type) {
766
- case i.Image:
767
- case i.Audio:
768
- case i.Unsupported:
769
- case i.Error: return "h-full overflow-auto p-4 flex items-center justify-center";
770
- case i.Json: return "h-full overflow-auto";
771
- case i.Pdf:
772
- case i.Ooxml:
773
- case i.Visualizer:
774
- case i.GroupedVisualizer:
775
- case i.McpApp:
776
- case i.Code:
777
- case i.Html: return "h-full overflow-hidden";
778
- case i.Markdown: return "h-full overflow-auto";
779
- case i.MarkdownTable: return "flex h-full min-h-0 flex-col overflow-hidden p-4";
780
- default: return "h-full overflow-auto p-4";
781
- }
782
- }, [e.type]), je = z(() => {
783
- switch (e.type) {
784
- case i.PlainText: return /* @__PURE__ */ H("pre", {
785
- className: _("wrap-break-word whitespace-pre-wrap", Z.body, q?.fontClassName),
782
+ case i.PlainText: return /* @__PURE__ */ U("pre", {
783
+ className: _("wrap-break-word whitespace-pre-wrap", Q.body, Y?.fontClassName),
786
784
  children: e.text
787
785
  });
788
- case i.Image: return /* @__PURE__ */ H(ze, {
786
+ case i.Image: return /* @__PURE__ */ U(Ve, {
789
787
  url: e.url,
790
788
  fileName: r,
791
789
  loadErrorLabel: c
792
790
  });
793
- case i.Audio: return /* @__PURE__ */ H("audio", {
791
+ case i.Audio: return /* @__PURE__ */ U("audio", {
794
792
  controls: !0,
795
793
  controlsList: "nodownload",
796
794
  src: e.url,
797
795
  "aria-label": r ?? "Audio attachment",
798
796
  className: "w-full max-w-sm",
799
797
  preload: "metadata",
800
- children: e.mimeType && /* @__PURE__ */ H("source", {
798
+ children: e.mimeType && /* @__PURE__ */ U("source", {
801
799
  src: e.url,
802
800
  type: e.mimeType
803
801
  })
804
802
  });
805
- case i.Markdown: return /* @__PURE__ */ H("div", {
803
+ case i.Markdown: return /* @__PURE__ */ U("div", {
806
804
  className: "p-4",
807
- children: /* @__PURE__ */ H(p, {
805
+ children: /* @__PURE__ */ U(p, {
808
806
  content: e.text,
809
807
  isStreaming: !1,
810
- codeBlockTheme: W,
811
- codeBlockCopyLabel: ne,
812
- codeBlockCopiedLabel: re,
813
- codeBlockDownloadLabel: ae,
814
- tableScrollRegionAriaLabel: oe,
815
- mathScrollRegionAriaLabel: P,
808
+ codeBlockTheme: G,
809
+ codeBlockCopyLabel: P,
810
+ codeBlockCopiedLabel: ne,
811
+ codeBlockDownloadLabel: ie,
812
+ tableScrollRegionAriaLabel: ae,
813
+ mathScrollRegionAriaLabel: F,
816
814
  classNames: u
817
815
  })
818
816
  });
819
- case i.MarkdownTable: return /* @__PURE__ */ H(p, {
817
+ case i.MarkdownTable: return /* @__PURE__ */ U(p, {
820
818
  content: e.text,
821
819
  isStreaming: !1,
822
- codeBlockTheme: W,
823
- codeBlockCopyLabel: ne,
824
- codeBlockCopiedLabel: re,
825
- codeBlockDownloadLabel: ae,
826
- tableScrollRegionAriaLabel: oe,
827
- mathScrollRegionAriaLabel: P,
820
+ codeBlockTheme: G,
821
+ codeBlockCopyLabel: P,
822
+ codeBlockCopiedLabel: ne,
823
+ codeBlockDownloadLabel: ie,
824
+ tableScrollRegionAriaLabel: ae,
825
+ mathScrollRegionAriaLabel: F,
828
826
  containerClassName: "flex h-full min-h-0 flex-col",
829
827
  classNames: {
830
828
  ...u,
@@ -836,81 +834,81 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
836
834
  copiedLabel: ee,
837
835
  downloadCsvLabel: te
838
836
  },
839
- tableDownloadFilename: de
837
+ tableDownloadFilename: ue
840
838
  });
841
839
  case i.Json: {
842
- let t = q?.jsonLabelClassName ?? (q?.jsonClassName ? void 0 : "dial-code-semi-text");
843
- return /* @__PURE__ */ H("div", {
840
+ let t = Y?.jsonLabelClassName ?? (Y?.jsonClassName ? void 0 : "dial-code-semi-text");
841
+ return /* @__PURE__ */ U("div", {
844
842
  dir: "ltr",
845
843
  className: "h-full overflow-auto",
846
- children: /* @__PURE__ */ H("div", {
847
- className: _("m-3 overflow-auto rounded-md border", Z.jsonWrapper),
848
- children: /* @__PURE__ */ H(ce, {
844
+ children: /* @__PURE__ */ U("div", {
845
+ className: _("m-3 overflow-auto rounded-md border", Q.jsonWrapper),
846
+ children: /* @__PURE__ */ U(se, {
849
847
  data: e.value,
850
848
  style: {
851
- container: _("whitespace-pre-wrap wrap-break-word p-2", q?.jsonClassName ?? "dial-code-text"),
852
- basicChildStyle: le.basicChildStyle,
849
+ container: _("whitespace-pre-wrap wrap-break-word p-2", Y?.jsonClassName ?? "dial-code-text"),
850
+ basicChildStyle: ce.basicChildStyle,
853
851
  childFieldsContainer: "m-0 ps-3",
854
- label: _("me-1", t, Z.jsonLabel),
855
- clickableLabel: _("me-1 cursor-pointer hover:underline", t, Z.jsonClickableLabel),
856
- nullValue: _("italic", Z.jsonNullValue),
857
- undefinedValue: _("italic", Z.jsonNullValue),
858
- stringValue: Z.jsonStringValue,
859
- booleanValue: Z.jsonBooleanValue,
860
- numberValue: Z.jsonNumberValue,
861
- otherValue: _("italic", Z.jsonNullValue),
862
- punctuation: _("me-1", Z.jsonPunctuation),
863
- collapseIcon: _("me-1 cursor-pointer select-none transition-colors", Z.jsonCollapseIcon),
864
- expandIcon: _("me-1 cursor-pointer select-none transition-colors", Z.jsonExpandIcon),
865
- collapsedContent: _(q?.jsonCollapsedClassName ?? "dial-caption-text", "me-1 cursor-pointer rounded px-1", Z.jsonCollapsedContent)
852
+ label: _("me-1", t, Q.jsonLabel),
853
+ clickableLabel: _("me-1 cursor-pointer hover:underline", t, Q.jsonClickableLabel),
854
+ nullValue: _("italic", Q.jsonNullValue),
855
+ undefinedValue: _("italic", Q.jsonNullValue),
856
+ stringValue: Q.jsonStringValue,
857
+ booleanValue: Q.jsonBooleanValue,
858
+ numberValue: Q.jsonNumberValue,
859
+ otherValue: _("italic", Q.jsonNullValue),
860
+ punctuation: _("me-1", Q.jsonPunctuation),
861
+ collapseIcon: _("me-1 cursor-pointer select-none transition-colors", Q.jsonCollapseIcon),
862
+ expandIcon: _("me-1 cursor-pointer select-none transition-colors", Q.jsonExpandIcon),
863
+ collapsedContent: _(Y?.jsonCollapsedClassName ?? "dial-caption-text", "me-1 cursor-pointer rounded px-1", Q.jsonCollapsedContent)
866
864
  }
867
865
  })
868
866
  })
869
867
  });
870
868
  }
871
- case i.Code: return /* @__PURE__ */ H(_e, {
869
+ case i.Code: return /* @__PURE__ */ U(ve, {
872
870
  content: e,
873
- codeBlockTheme: W,
874
- codeClassName: q?.codeClassName,
875
- errorLabelClassName: q?.errorMessageClassName,
871
+ codeBlockTheme: G,
872
+ codeClassName: Y?.codeClassName,
873
+ errorLabelClassName: Y?.errorMessageClassName,
876
874
  labels: {
877
875
  loadingLabel: O,
878
876
  errorLabel: k,
879
877
  retryLabel: M
880
878
  }
881
879
  });
882
- case i.Html: return /* @__PURE__ */ H(be, {
880
+ case i.Html: return /* @__PURE__ */ U(xe, {
883
881
  content: e,
884
882
  labels: {
885
883
  htmlFrameBlockedLabel: h,
886
884
  htmlOpenInNewTabLabel: g,
887
- loadingLabel: L
885
+ loadingLabel: R
888
886
  },
889
887
  isSourceView: a,
890
888
  title: r,
891
- codeBlockTheme: W,
892
- codeClassName: q?.codeClassName
889
+ codeBlockTheme: G,
890
+ codeClassName: Y?.codeClassName
893
891
  });
894
- case i.Pdf: return /* @__PURE__ */ H(s, {
895
- retryKey: xe,
896
- onRetry: we,
897
- errorLabelClassName: q?.errorMessageClassName,
892
+ case i.Pdf: return /* @__PURE__ */ U(s, {
893
+ retryKey: ye,
894
+ onRetry: Ce,
895
+ errorLabelClassName: Y?.errorMessageClassName,
898
896
  labels: {
899
897
  loadingLabel: S,
900
898
  errorLabel: w,
901
899
  retryLabel: E
902
900
  },
903
- children: /* @__PURE__ */ H(Ce, {
901
+ children: /* @__PURE__ */ U(Se, {
904
902
  fileName: r,
905
903
  url: e.url,
906
904
  highlights: e.highlights ?? [],
907
905
  selectedHighlightId: e.selectedHighlightId,
908
906
  selectedPageNumber: e.page,
909
- loadPdf: fe,
910
- onLoadError: De,
911
- hideHeader: G,
912
- configurePdfWorker: pe,
913
- errorLabelClassName: q?.errorMessageClassName,
907
+ loadPdf: de,
908
+ onLoadError: X,
909
+ hideHeader: K,
910
+ configurePdfWorker: fe,
911
+ errorLabelClassName: Y?.errorMessageClassName,
914
912
  labels: {
915
913
  thumbnailsLabel: v,
916
914
  showThumbnailsLabel: y,
@@ -921,50 +919,50 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
921
919
  retryLabel: E
922
920
  }
923
921
  })
924
- }, `${e.url}#${J}`);
925
- case i.Ooxml: return /* @__PURE__ */ H(Ae, {
922
+ }, `${e.url}#${Te}`);
923
+ case i.Ooxml: return /* @__PURE__ */ U(Me, {
926
924
  content: e,
927
925
  fileName: r,
928
926
  loadErrorLabel: c,
929
927
  formulaLabel: D,
930
- formulaLabelClassName: q?.xlsxFormulaLabelClassName ?? "dial-italic-text",
931
- formulaValueClassName: q?.xlsxFormulaValueClassName ?? "dial-code-text",
932
- highlightsLabel: se,
933
- highlightNavigatedLabel: F,
934
- loadingLabel: L
928
+ formulaLabelClassName: Y?.xlsxFormulaLabelClassName ?? "dial-italic-text",
929
+ formulaValueClassName: Y?.xlsxFormulaValueClassName ?? "dial-code-text",
930
+ highlightsLabel: oe,
931
+ highlightNavigatedLabel: I,
932
+ loadingLabel: R
935
933
  });
936
934
  case i.Visualizer:
937
- case i.GroupedVisualizer: return /* @__PURE__ */ H(Le, {
935
+ case i.GroupedVisualizer: return /* @__PURE__ */ U(ze, {
938
936
  content: e,
939
937
  errorLabel: f,
940
- onSendMessage: ge
938
+ onSendMessage: q
941
939
  });
942
- case i.McpApp: return /* @__PURE__ */ H(Ee, {
940
+ case i.McpApp: return /* @__PURE__ */ U(De, {
943
941
  content: e,
944
- loadingLabel: L,
945
- onAppInfo: me
942
+ loadingLabel: R,
943
+ onAppInfo: pe
946
944
  });
947
- case i.Unsupported: return /* @__PURE__ */ H("p", {
948
- className: _("text-center", Z.statusLabel),
945
+ case i.Unsupported: return /* @__PURE__ */ U("p", {
946
+ className: _("text-center", Q.statusLabel),
949
947
  children: o
950
948
  });
951
949
  case i.Error: {
952
950
  let t = e.errorType === n.Forbidden;
953
- return /* @__PURE__ */ U("div", {
951
+ return /* @__PURE__ */ W("div", {
954
952
  className: "flex flex-col items-center gap-2",
955
953
  children: [
956
- H(t ? ie : j, {
954
+ U(t ? re : j, {
957
955
  size: 60,
958
956
  stroke: C,
959
- className: Z.errorIcon
957
+ className: Q.errorIcon
960
958
  }),
961
- /* @__PURE__ */ H("p", {
962
- className: _("text-center", Z.statusLabel),
959
+ /* @__PURE__ */ U("p", {
960
+ className: _("text-center", Q.statusLabel),
963
961
  children: t ? d : c
964
962
  }),
965
- !t && he != null && /* @__PURE__ */ H(T, {
963
+ !t && me != null && /* @__PURE__ */ U(T, {
966
964
  label: l,
967
- onClick: he
965
+ onClick: me
968
966
  })
969
967
  ]
970
968
  });
@@ -972,31 +970,31 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
972
970
  }
973
971
  }, [
974
972
  e,
975
- q?.fontClassName,
976
- q?.jsonClassName,
977
- q?.jsonLabelClassName,
978
- q?.xlsxFormulaLabelClassName,
979
- q?.xlsxFormulaValueClassName,
980
- q?.codeClassName,
981
- q?.jsonCollapsedClassName,
982
- q?.errorMessageClassName,
973
+ Y?.fontClassName,
974
+ Y?.jsonClassName,
975
+ Y?.jsonLabelClassName,
976
+ Y?.xlsxFormulaLabelClassName,
977
+ Y?.xlsxFormulaValueClassName,
978
+ Y?.codeClassName,
979
+ Y?.jsonCollapsedClassName,
980
+ Y?.errorMessageClassName,
983
981
  r,
984
- W,
982
+ G,
985
983
  o,
986
984
  c,
987
985
  l,
988
986
  d,
989
987
  f,
990
- ge,
988
+ q,
991
989
  h,
992
990
  g,
993
991
  a,
992
+ ue,
994
993
  de,
994
+ K,
995
995
  fe,
996
- G,
997
996
  pe,
998
997
  me,
999
- he,
1000
998
  v,
1001
999
  y,
1002
1000
  b,
@@ -1008,70 +1006,70 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
1008
1006
  O,
1009
1007
  k,
1010
1008
  M,
1009
+ Se,
1010
+ ye,
1011
1011
  Ce,
1012
- xe,
1013
- we,
1014
- J,
1015
- De,
1012
+ Te,
1013
+ X,
1016
1014
  N,
1017
1015
  ee,
1018
1016
  te,
1017
+ P,
1019
1018
  ne,
1020
- re,
1019
+ ie,
1021
1020
  ae,
1022
- oe,
1023
- P,
1024
- se,
1025
1021
  F,
1026
- L
1022
+ oe,
1023
+ I,
1024
+ R
1027
1025
  ]);
1028
- return /* @__PURE__ */ H("div", {
1026
+ return /* @__PURE__ */ U("div", {
1029
1027
  style: t ? void 0 : Oe,
1030
- className: _(t ? "flex h-full items-center justify-center" : ke, ve),
1031
- children: t ? /* @__PURE__ */ H(A, { ariaLabel: L }) : je
1028
+ className: _(t ? "flex h-full items-center justify-center" : ke, ge),
1029
+ children: t ? /* @__PURE__ */ U(A, { ariaLabel: R }) : Ae
1032
1030
  });
1033
- }), Ve = {
1031
+ }), Ue = {
1034
1032
  mcpAppDivider: "_mcpAppDivider_1gxed_1",
1035
1033
  mcpAppVersion: "_mcpAppVersion_1gxed_5",
1036
1034
  panelHeader: "_panelHeader_1gxed_9"
1037
- }, He = 2e3, Ue = F(({ isOpen: e, isLoading: t = !1, onClose: n, onRetry: r, content: a, fileName: s, leftActions: c, labels: { ariaLabel: l, closeLabel: u = "Close", resizeLabel: d = "Resize panel", downloadLabel: f = "Download", copyTextLabel: p = "Copy text", copiedTextLabel: h = "Copied!", copyMarkdownLabel: g = "Copy as Markdown", copiedMarkdownLabel: v = "Copied!", copyJsonLabel: y = "Copy as JSON", copiedJsonLabel: w = "Copied!", visualizerErrorLabel: T, unsupportedLabel: D = "Preview is not supported for this file", loadErrorLabel: O = "Failed to load file", loadErrorRetryLabel: k = "Retry", forbiddenErrorLabel: A = "You don't have permission to access this file", htmlFrameBlockedLabel: j = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: M = "Open in new tab", htmlViewSourceLabel: ie = "View source", htmlViewRenderedLabel: P = "View rendered", mcpAppReloadLabel: se = "Reload", pdfThumbnailsLabel: F, pdfShowThumbnailsLabel: L, pdfHideThumbnailsLabel: ce, pdfPageNumberLabel: le, pdfContentLoadingLabel: W, pdfContentErrorLabel: de, pdfContentRetryLabel: fe, xlsxFormulaLabel: G, codeContentLoadingLabel: pe, codeContentErrorLabel: me, codeContentRetryLabel: ge, tableCopyLabel: K, tableCopiedLabel: q, tableDownloadCsvLabel: _e, codeBlockCopyLabel: ve, codeBlockCopiedLabel: ye, codeBlockDownloadLabel: be, tableScrollRegionAriaLabel: xe, mathScrollRegionAriaLabel: Se, ooxmlHighlightsLabel: Ce, ooxmlHighlightNavigatedLabel: we, loadingLabel: Te }, onDownload: J, onCopyText: Ee, onCopyMarkdown: Y, onCopyJson: De, tableDownloadFilename: X, isMobile: Oe = !1, isBoundedOverlay: ke = !1, defaultWidth: Ae, minWidth: je = 600, maxWidth: Me = 1500, onResizeStop: Ne, styles: Pe, codeBlockTheme: Fe, loadPdf: Ie, configurePdfWorker: Le, onVisualizerSendMessage: Z }) => {
1038
- let [Re, ze] = V(!1), [Ue, We] = V(!1), [Q, Ge] = V(!1), [Ke, qe] = V(!1), [Je, Ye] = V(void 0), Xe = B(null), Ze = B(null), Qe = B(null), $e = I(() => {
1039
- Ee?.(), Xe.current != null && clearTimeout(Xe.current), ze(!0), Xe.current = setTimeout(() => ze(!1), He);
1040
- }, [Ee]), et = I(() => {
1041
- Y?.(), Ze.current != null && clearTimeout(Ze.current), We(!0), Ze.current = setTimeout(() => We(!1), He);
1042
- }, [Y]), tt = I(() => {
1043
- De?.(), Qe.current != null && clearTimeout(Qe.current), Ge(!0), Qe.current = setTimeout(() => Ge(!1), He);
1044
- }, [De]);
1045
- R(() => () => {
1046
- Xe.current != null && clearTimeout(Xe.current), Ze.current != null && clearTimeout(Ze.current), Qe.current != null && clearTimeout(Qe.current);
1035
+ }, We = 2e3, Ge = I(({ isOpen: e, isLoading: t = !1, onClose: n, onRetry: r, content: a, fileName: s, leftActions: c, labels: { ariaLabel: l, closeLabel: u = "Close", resizeLabel: d = "Resize panel", downloadLabel: f = "Download", copyTextLabel: p = "Copy text", copiedTextLabel: h = "Copied!", copyMarkdownLabel: g = "Copy as Markdown", copiedMarkdownLabel: v = "Copied!", copyJsonLabel: y = "Copy as JSON", copiedJsonLabel: w = "Copied!", visualizerErrorLabel: T, unsupportedLabel: D = "Preview is not supported for this file", loadErrorLabel: O = "Failed to load file", loadErrorRetryLabel: k = "Retry", forbiddenErrorLabel: A = "You don't have permission to access this file", htmlFrameBlockedLabel: j = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: M = "Open in new tab", htmlViewSourceLabel: re = "View source", htmlViewRenderedLabel: F = "View rendered", mcpAppReloadLabel: oe = "Reload", pdfThumbnailsLabel: I, pdfShowThumbnailsLabel: R, pdfHideThumbnailsLabel: se, pdfPageNumberLabel: ce, pdfContentLoadingLabel: G, pdfContentErrorLabel: ue, pdfContentRetryLabel: de, xlsxFormulaLabel: K, codeContentLoadingLabel: fe, codeContentErrorLabel: pe, codeContentRetryLabel: q, tableCopyLabel: J, tableCopiedLabel: he, tableDownloadCsvLabel: Y, codeBlockCopyLabel: ge, codeBlockCopiedLabel: _e, codeBlockDownloadLabel: ve, tableScrollRegionAriaLabel: ye, mathScrollRegionAriaLabel: be, ooxmlHighlightsLabel: xe, ooxmlHighlightNavigatedLabel: Se, loadingLabel: Ce }, onDownload: we, onCopyText: Te, onCopyMarkdown: Ee, onCopyJson: X, tableDownloadFilename: De, isMobile: Z = !1, isBoundedOverlay: Oe = !1, defaultWidth: ke, minWidth: Ae = 600, maxWidth: je = 1500, onResizeStop: Me, styles: Ne, codeBlockTheme: Pe, loadPdf: Fe, configurePdfWorker: Ie, onVisualizerSendMessage: Le }) => {
1036
+ let [Re, ze] = H(!1), [Q, Be] = H(!1), [Ve, Ge] = H(!1), [Ke, qe] = H(!1), [Je, Ye] = H(void 0), Xe = V(null), Ze = V(null), $ = V(null), Qe = L(() => {
1037
+ Te?.(), Xe.current != null && clearTimeout(Xe.current), ze(!0), Xe.current = setTimeout(() => ze(!1), We);
1038
+ }, [Te]), $e = L(() => {
1039
+ Ee?.(), Ze.current != null && clearTimeout(Ze.current), Be(!0), Ze.current = setTimeout(() => Be(!1), We);
1040
+ }, [Ee]), et = L(() => {
1041
+ X?.(), $.current != null && clearTimeout($.current), Ge(!0), $.current = setTimeout(() => Ge(!1), We);
1042
+ }, [X]);
1043
+ z(() => () => {
1044
+ Xe.current != null && clearTimeout(Xe.current), Ze.current != null && clearTimeout(Ze.current), $.current != null && clearTimeout($.current);
1047
1045
  }, []);
1048
- let $ = I(() => {
1046
+ let tt = L(() => {
1049
1047
  qe((e) => !e);
1050
1048
  }, []);
1051
- R(() => {
1049
+ z(() => {
1052
1050
  qe(!1), Ye(void 0);
1053
1051
  }, [a]);
1054
- let { className: nt, panelStyles: rt, ...it } = Pe ?? {}, { colors: at, typography: ot } = it, st = z(() => m({
1052
+ let { className: nt, panelStyles: rt, ...it } = Ne ?? {}, { colors: at, typography: ot } = it, st = B(() => m({
1055
1053
  "--ac-mcp-app-divider": at?.mcpAppDividerColor,
1056
1054
  "--ac-mcp-app-version": at?.mcpAppVersionColor
1057
- }), [at?.mcpAppDividerColor, at?.mcpAppVersionColor]), ct = a.type === i.McpApp && Je != null ? /* @__PURE__ */ U("span", {
1055
+ }), [at?.mcpAppDividerColor, at?.mcpAppVersionColor]), ct = a.type === i.McpApp && Je != null ? /* @__PURE__ */ W("span", {
1058
1056
  style: st,
1059
1057
  children: [
1060
- /* @__PURE__ */ H("span", { children: s }),
1061
- /* @__PURE__ */ H("span", {
1058
+ /* @__PURE__ */ U("span", { children: s }),
1059
+ /* @__PURE__ */ U("span", {
1062
1060
  "aria-hidden": !0,
1063
- className: _("mx-1.5 inline-block h-3 w-0 border-s align-middle", Ve.mcpAppDivider)
1061
+ className: _("mx-1.5 inline-block h-3 w-0 border-s align-middle", Ue.mcpAppDivider)
1064
1062
  }),
1065
- /* @__PURE__ */ H("span", { children: Je.name }),
1066
- Je.version && /* @__PURE__ */ H("span", {
1067
- className: _("ms-2", ot?.mcpAppVersionClassName ?? "dial-caption-text", Ve.mcpAppVersion),
1063
+ /* @__PURE__ */ U("span", { children: Je.name }),
1064
+ Je.version && /* @__PURE__ */ U("span", {
1065
+ className: _("ms-2", ot?.mcpAppVersionClassName ?? "dial-caption-text", Ue.mcpAppVersion),
1068
1066
  children: Je.version
1069
1067
  })
1070
1068
  ]
1071
- }) : s, lt = !t && a.type === i.Html && (a.srcdoc != null || a.resolveSourceText != null), ut = !t && Ee != null && (a.type === i.PlainText || a.type === i.Code), dt = !t && Y != null && a.type === i.Markdown, ft = !t && De != null && a.type === i.Json, pt = !t && J != null && o(a), mt = !t && a.type === i.McpApp && a.onReload != null;
1072
- return /* @__PURE__ */ H(x, {
1069
+ }) : s, lt = !t && a.type === i.Html && (a.srcdoc != null || a.resolveSourceText != null), ut = !t && Te != null && (a.type === i.PlainText || a.type === i.Code), dt = !t && Ee != null && a.type === i.Markdown, ft = !t && X != null && a.type === i.Json, pt = !t && we != null && o(a), mt = !t && a.type === i.McpApp && a.onReload != null;
1070
+ return /* @__PURE__ */ U(x, {
1073
1071
  isOpen: e,
1074
- isBoundedOverlay: ke,
1072
+ isBoundedOverlay: Oe,
1075
1073
  orientation: b.Right,
1076
1074
  title: ct,
1077
1075
  labels: {
@@ -1080,11 +1078,11 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
1080
1078
  resizeLabel: d
1081
1079
  },
1082
1080
  onClose: n,
1083
- resizable: !Oe || ke,
1084
- defaultWidth: Ae,
1085
- minWidth: je,
1086
- maxWidth: Me,
1087
- onResizeStop: Ne,
1081
+ resizable: !Z || Oe,
1082
+ defaultWidth: ke,
1083
+ minWidth: Ae,
1084
+ maxWidth: je,
1085
+ onResizeStop: Me,
1088
1086
  styles: {
1089
1087
  ...rt,
1090
1088
  cssVars: {
@@ -1092,73 +1090,73 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
1092
1090
  ...rt?.cssVars
1093
1091
  },
1094
1092
  titleClassName: rt?.titleClassName ?? "dial-h3-text",
1095
- headerClassName: _("border-b", Ve.panelHeader, rt?.headerClassName),
1096
- className: _(!ke && (e ? "mobile:w-full mobile:max-w-full" : "w-0"), nt, rt?.className, he.panel)
1093
+ headerClassName: _("border-b", Ue.panelHeader, rt?.headerClassName),
1094
+ className: _(!Oe && (e ? "mobile:w-full mobile:max-w-full" : "w-0"), nt, rt?.className, me.panel)
1097
1095
  },
1098
1096
  leftActions: c,
1099
- rightActions: lt || ut || dt || ft || pt || mt ? /* @__PURE__ */ U(ue, { children: [
1100
- mt && /* @__PURE__ */ H(E, {
1101
- icon: /* @__PURE__ */ H(oe, {
1097
+ rightActions: lt || ut || dt || ft || pt || mt ? /* @__PURE__ */ W(le, { children: [
1098
+ mt && /* @__PURE__ */ U(E, {
1099
+ icon: /* @__PURE__ */ U(ae, {
1102
1100
  size: S.LG,
1103
1101
  stroke: C,
1104
1102
  "aria-hidden": !0
1105
1103
  }),
1106
- "aria-label": se,
1107
- tooltipProps: { tooltip: se },
1104
+ "aria-label": oe,
1105
+ tooltipProps: { tooltip: oe },
1108
1106
  onClick: a.type === i.McpApp ? a.onReload : void 0
1109
1107
  }),
1110
- lt && /* @__PURE__ */ H(E, {
1111
- icon: H(Ke ? re : ee, {
1108
+ lt && /* @__PURE__ */ U(E, {
1109
+ icon: U(Ke ? ne : ee, {
1112
1110
  size: S.LG,
1113
1111
  stroke: C,
1114
1112
  "aria-hidden": !0
1115
1113
  }),
1116
- "aria-label": Ke ? P : ie,
1114
+ "aria-label": Ke ? F : re,
1117
1115
  "aria-pressed": Ke,
1118
- tooltipProps: { tooltip: Ke ? P : ie },
1119
- onClick: $
1116
+ tooltipProps: { tooltip: Ke ? F : re },
1117
+ onClick: tt
1120
1118
  }),
1121
- ut && /* @__PURE__ */ H(E, {
1122
- icon: H(Re ? N : te, {
1119
+ ut && /* @__PURE__ */ U(E, {
1120
+ icon: U(Re ? N : te, {
1123
1121
  size: S.LG,
1124
1122
  stroke: C,
1125
1123
  "aria-hidden": !0
1126
1124
  }),
1127
1125
  "aria-label": Re ? h : p,
1128
1126
  tooltipProps: { tooltip: Re ? h : p },
1129
- onClick: $e
1127
+ onClick: Qe
1130
1128
  }),
1131
- dt && /* @__PURE__ */ H(E, {
1132
- icon: H(Ue ? N : ae, {
1129
+ dt && /* @__PURE__ */ U(E, {
1130
+ icon: U(Q ? N : ie, {
1133
1131
  size: S.LG,
1134
1132
  stroke: C,
1135
1133
  "aria-hidden": !0
1136
1134
  }),
1137
- "aria-label": Ue ? v : g,
1138
- tooltipProps: { tooltip: Ue ? v : g },
1139
- onClick: et
1135
+ "aria-label": Q ? v : g,
1136
+ tooltipProps: { tooltip: Q ? v : g },
1137
+ onClick: $e
1140
1138
  }),
1141
- ft && /* @__PURE__ */ H(E, {
1142
- icon: H(Q ? N : te, {
1139
+ ft && /* @__PURE__ */ U(E, {
1140
+ icon: U(Ve ? N : te, {
1143
1141
  size: S.LG,
1144
1142
  stroke: C,
1145
1143
  "aria-hidden": !0
1146
1144
  }),
1147
- "aria-label": Q ? w : y,
1148
- tooltipProps: { tooltip: Q ? w : y },
1149
- onClick: tt
1145
+ "aria-label": Ve ? w : y,
1146
+ tooltipProps: { tooltip: Ve ? w : y },
1147
+ onClick: et
1150
1148
  }),
1151
- pt && /* @__PURE__ */ H(E, {
1152
- icon: /* @__PURE__ */ H(ne, {
1149
+ pt && /* @__PURE__ */ U(E, {
1150
+ icon: /* @__PURE__ */ U(P, {
1153
1151
  size: S.LG,
1154
1152
  stroke: C
1155
1153
  }),
1156
1154
  "aria-label": f,
1157
1155
  tooltipProps: { tooltip: f },
1158
- onClick: J
1156
+ onClick: we
1159
1157
  })
1160
1158
  ] }) : null,
1161
- children: /* @__PURE__ */ H(Be, {
1159
+ children: /* @__PURE__ */ U(He, {
1162
1160
  content: a,
1163
1161
  isLoading: t,
1164
1162
  fileName: s,
@@ -1173,74 +1171,74 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
1173
1171
  visualizerErrorLabel: T,
1174
1172
  htmlFrameBlockedLabel: j,
1175
1173
  htmlOpenInNewTabLabel: M,
1176
- pdfThumbnailsLabel: F,
1177
- pdfShowThumbnailsLabel: L,
1178
- pdfHideThumbnailsLabel: ce,
1179
- pdfPageNumberLabel: le,
1180
- pdfContentLoadingLabel: W,
1181
- pdfContentErrorLabel: de,
1182
- pdfContentRetryLabel: fe,
1183
- xlsxFormulaLabel: G,
1184
- codeContentLoadingLabel: pe,
1185
- codeContentErrorLabel: me,
1186
- codeContentRetryLabel: ge,
1187
- tableCopyLabel: K,
1188
- tableCopiedLabel: q,
1189
- tableDownloadCsvLabel: _e,
1190
- codeBlockCopyLabel: ve,
1191
- codeBlockCopiedLabel: ye,
1192
- codeBlockDownloadLabel: be,
1193
- tableScrollRegionAriaLabel: xe,
1194
- mathScrollRegionAriaLabel: Se,
1195
- ooxmlHighlightsLabel: Ce,
1196
- ooxmlHighlightNavigatedLabel: we,
1197
- loadingLabel: Te
1174
+ pdfThumbnailsLabel: I,
1175
+ pdfShowThumbnailsLabel: R,
1176
+ pdfHideThumbnailsLabel: se,
1177
+ pdfPageNumberLabel: ce,
1178
+ pdfContentLoadingLabel: G,
1179
+ pdfContentErrorLabel: ue,
1180
+ pdfContentRetryLabel: de,
1181
+ xlsxFormulaLabel: K,
1182
+ codeContentLoadingLabel: fe,
1183
+ codeContentErrorLabel: pe,
1184
+ codeContentRetryLabel: q,
1185
+ tableCopyLabel: J,
1186
+ tableCopiedLabel: he,
1187
+ tableDownloadCsvLabel: Y,
1188
+ codeBlockCopyLabel: ge,
1189
+ codeBlockCopiedLabel: _e,
1190
+ codeBlockDownloadLabel: ve,
1191
+ tableScrollRegionAriaLabel: ye,
1192
+ mathScrollRegionAriaLabel: be,
1193
+ ooxmlHighlightsLabel: xe,
1194
+ ooxmlHighlightNavigatedLabel: Se,
1195
+ loadingLabel: Ce
1198
1196
  },
1199
1197
  styles: it,
1200
- codeBlockTheme: Fe,
1201
- tableDownloadFilename: X,
1202
- loadPdf: Ie,
1203
- configurePdfWorker: Le,
1204
- onVisualizerSendMessage: Z
1198
+ codeBlockTheme: Pe,
1199
+ tableDownloadFilename: De,
1200
+ loadPdf: Fe,
1201
+ configurePdfWorker: Ie,
1202
+ onVisualizerSendMessage: Le
1205
1203
  })
1206
1204
  });
1207
- }), We = /* @__PURE__ */ new Set(["html", "htm"]), Q = {
1208
- docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
1209
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
1210
- pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
1211
- }, Ge = /* @__PURE__ */ new Set(/* @__PURE__ */ "txt.md.markdown.json.jsonl.ndjson.xml.csv.tsv.yaml.yml.toml.ini.conf.cfg.css.scss.sass.less.js.jsx.ts.tsx.mjs.cjs.mts.cts.py.rb.go.rs.java.kt.swift.c.h.cpp.cs.sh.bash.zsh.fish.ps1.log.env.gitignore.dockerfile.makefile.sql".split(".")), Ke = {
1205
+ }), Ke = /* @__PURE__ */ new Set(["html", "htm"]), qe = {
1206
+ docx: f.DOCX,
1207
+ xlsx: f.XLSX,
1208
+ pptx: f.PPTX
1209
+ }, Je = /* @__PURE__ */ new Set(/* @__PURE__ */ "txt.md.markdown.json.jsonl.ndjson.xml.csv.tsv.yaml.yml.toml.ini.conf.cfg.css.scss.sass.less.js.jsx.ts.tsx.mjs.cjs.mts.cts.py.rb.go.rs.java.kt.swift.c.h.cpp.cs.sh.bash.zsh.fish.ps1.log.env.gitignore.dockerfile.makefile.sql".split(".")), Ye = {
1212
1210
  docx: r.Docx,
1213
1211
  xlsx: r.Xlsx,
1214
1212
  pptx: r.Pptx,
1215
1213
  csv: r.Csv
1216
- }, qe = {
1217
- [Q.docx]: r.Docx,
1218
- [Q.xlsx]: r.Xlsx,
1219
- [Q.pptx]: r.Pptx,
1214
+ }, Xe = {
1215
+ [qe.docx]: r.Docx,
1216
+ [qe.xlsx]: r.Xlsx,
1217
+ [qe.pptx]: r.Pptx,
1220
1218
  [f.CSV]: r.Csv
1221
- }, Je = {
1222
- [r.Docx]: Q.docx,
1223
- [r.Xlsx]: Q.xlsx,
1224
- [r.Pptx]: Q.pptx,
1219
+ }, Ze = {
1220
+ [r.Docx]: qe.docx,
1221
+ [r.Xlsx]: qe.xlsx,
1222
+ [r.Pptx]: qe.pptx,
1225
1223
  [r.Csv]: f.CSV
1226
- }, Ye = (e, t) => {
1224
+ }, $ = (e, t) => {
1227
1225
  let n = t?.split(";", 1)[0].trim().toLowerCase();
1228
1226
  if (n != null) {
1229
- let e = qe[n];
1227
+ let e = Xe[n];
1230
1228
  if (e != null) return e;
1231
1229
  }
1232
1230
  let r = e.lastIndexOf(".");
1233
- if (r !== -1) return Ke[e.slice(r + 1).toLowerCase()];
1234
- }, Xe = (e, t) => Ye(e, t) != null, Ze = (e, t) => {
1235
- let n = Ye(e, t);
1236
- return n == null ? void 0 : Je[n];
1237
- }, Qe = (e) => {
1231
+ if (r !== -1) return Ye[e.slice(r + 1).toLowerCase()];
1232
+ }, Qe = (e, t) => $(e, t) != null, $e = (e, t) => {
1233
+ let n = $(e, t);
1234
+ return n == null ? void 0 : Ze[n];
1235
+ }, et = (e) => {
1238
1236
  let t = e.lastIndexOf(".");
1239
- return t !== -1 && Ge.has(e.slice(t + 1).toLowerCase());
1240
- }, $e = (e) => {
1237
+ return t !== -1 && Je.has(e.slice(t + 1).toLowerCase());
1238
+ }, tt = (e) => {
1241
1239
  let t = e.lastIndexOf(".");
1242
- return t !== -1 && We.has(e.slice(t + 1).toLowerCase());
1243
- }, et = {
1240
+ return t !== -1 && Ke.has(e.slice(t + 1).toLowerCase());
1241
+ }, nt = {
1244
1242
  xml: "xml",
1245
1243
  csv: "plaintext",
1246
1244
  tsv: "plaintext",
@@ -1288,47 +1286,47 @@ var he = { panel: "dial-attachment-canvas-panel" }, ge = {
1288
1286
  gitignore: "plaintext",
1289
1287
  dockerfile: "plaintext",
1290
1288
  makefile: "plaintext"
1291
- }, tt = (e) => et[e], $ = (e) => ({
1289
+ }, rt = (e) => nt[e], it = (e) => ({
1292
1290
  type: i.Unsupported,
1293
1291
  ...e != null && { url: e }
1294
- }), nt = (e) => ({
1292
+ }), at = (e) => ({
1295
1293
  type: i.Error,
1296
1294
  errorType: n.LoadFailed,
1297
1295
  ...e != null && { url: e }
1298
- }), rt = (e) => ({
1296
+ }), ot = (e) => ({
1299
1297
  type: i.Error,
1300
1298
  errorType: n.Forbidden,
1301
1299
  ...e != null && { url: e }
1302
- }), it = (e) => {
1300
+ }), st = (e) => {
1303
1301
  if (e.type === i.Image || e.type === i.Audio || e.type === i.Pdf || e.type === i.Ooxml) return e.url.startsWith("blob:") ? e.url : void 0;
1304
- }, at = (e) => {
1305
- let t = it(e);
1302
+ }, ct = (e) => {
1303
+ let t = st(e);
1306
1304
  t != null && URL.revokeObjectURL(t);
1307
- }, ot = {
1305
+ }, lt = {
1308
1306
  type: i.PlainText,
1309
1307
  text: ""
1310
- }, st = P(void 0);
1311
- st.displayName = "AttachmentCanvasContext";
1312
- var ct = P(void 0), lt = ({ children: e }) => {
1313
- let t = B(0), n = I(() => {
1308
+ }, ut = F(void 0);
1309
+ ut.displayName = "AttachmentCanvasContext";
1310
+ var dt = F(void 0), ft = ({ children: e }) => {
1311
+ let t = V(0), n = L(() => {
1314
1312
  let e = ++t.current;
1315
1313
  return () => e === t.current;
1316
1314
  }, []);
1317
- R(() => () => {
1315
+ z(() => () => {
1318
1316
  t.current += 1;
1319
1317
  }, []);
1320
- let [r, i] = V(!1), [a, o] = V(!1), [s, c] = V(ot), [l, u] = V(void 0), [d, f] = V(void 0), [p, m] = V(void 0), h = I((e, t) => {
1318
+ let [r, i] = H(!1), [a, o] = H(!1), [s, c] = H(lt), [l, u] = H(void 0), [d, f] = H(void 0), [p, m] = H(void 0), h = L((e, t) => {
1321
1319
  u(e), f(t), m(void 0), o(!0), i(!0);
1322
- }, []), g = I((e, t, n, r) => {
1320
+ }, []), g = L((e, t, n, r) => {
1323
1321
  c(e), u(t), f(n), m(r == null ? void 0 : () => r), o(!1), i(!0);
1324
- }, []), _ = I(() => {
1325
- c(ot), i(!1), o(!1), f(void 0), m(void 0);
1322
+ }, []), _ = L(() => {
1323
+ c(lt), i(!1), o(!1), f(void 0), m(void 0);
1326
1324
  }, []);
1327
- return R(() => () => {
1328
- let e = it(s);
1325
+ return z(() => () => {
1326
+ let e = st(s);
1329
1327
  e != null && URL.revokeObjectURL(e);
1330
- }, [s]), /* @__PURE__ */ H(st.Provider, {
1331
- value: z(() => ({
1328
+ }, [s]), /* @__PURE__ */ U(ut.Provider, {
1329
+ value: B(() => ({
1332
1330
  isOpen: r,
1333
1331
  isLoading: a,
1334
1332
  content: s,
@@ -1349,42 +1347,42 @@ var ct = P(void 0), lt = ({ children: e }) => {
1349
1347
  _,
1350
1348
  p
1351
1349
  ]),
1352
- children: /* @__PURE__ */ H(ct.Provider, {
1350
+ children: /* @__PURE__ */ U(dt.Provider, {
1353
1351
  value: n,
1354
1352
  children: e
1355
1353
  })
1356
1354
  });
1357
- }, ut = () => {
1358
- let e = L(st);
1355
+ }, pt = () => {
1356
+ let e = R(ut);
1359
1357
  if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
1360
1358
  return e;
1361
- }, dt = () => L(ct), ft = () => {
1362
- let e = L(ct);
1359
+ }, mt = () => R(dt), ht = () => {
1360
+ let e = R(dt);
1363
1361
  if (!e) throw Error("useLatestCanvasRequest must be used within an AttachmentCanvasProvider");
1364
- let t = B(void 0);
1365
- return R(() => (t.current = {}, () => {
1362
+ let t = V(void 0);
1363
+ return z(() => (t.current = {}, () => {
1366
1364
  t.current = void 0;
1367
- }), []), I(() => {
1365
+ }), []), L(() => {
1368
1366
  let n = t.current, r = e();
1369
1367
  return () => n !== void 0 && t.current === n && r();
1370
1368
  }, [e]);
1371
- }, pt = F(({ labels: e, leftActions: t, isMobile: n = !1, isBoundedOverlay: r = !1, defaultWidth: o, minWidth: s, maxWidth: c, codeBlockTheme: l, tableDownloadFilename: u, loadPdf: d, configurePdfWorker: f, onVisualizerSendMessage: p }) => {
1372
- let { ariaLabel: m = "Attachment preview", closeLabel: g = "Close", downloadLabel: _ = "Download", unsupportedLabel: v = "Preview is not supported for this file", loadErrorLabel: y = "Failed to load file", loadErrorRetryLabel: b, forbiddenErrorLabel: x = "You don't have permission to access this file", copyTextLabel: S, copiedTextLabel: C, copyMarkdownLabel: w, copiedMarkdownLabel: T, copyJsonLabel: E, copiedJsonLabel: D, htmlFrameBlockedLabel: O, htmlOpenInNewTabLabel: k, htmlViewSourceLabel: A, htmlViewRenderedLabel: j, pdfThumbnailsLabel: M, pdfShowThumbnailsLabel: N, pdfHideThumbnailsLabel: ee, pdfPageNumberLabel: te, pdfContentLoadingLabel: ne, pdfContentErrorLabel: re, pdfContentRetryLabel: ie, xlsxFormulaLabel: ae, codeContentLoadingLabel: oe, codeContentErrorLabel: P, codeContentRetryLabel: se, tableCopyLabel: F, tableCopiedLabel: L, tableDownloadCsvLabel: R, codeBlockCopyLabel: z, codeBlockCopiedLabel: B, codeBlockDownloadLabel: V, tableScrollRegionAriaLabel: ce, mathScrollRegionAriaLabel: le, ooxmlHighlightsLabel: ue, ooxmlHighlightNavigatedLabel: U, loadingLabel: W } = e ?? {}, { isOpen: de, isLoading: fe, content: G, fileName: pe, closeCanvas: me, retryCanvas: he } = ut(), ge = I(() => {
1373
- a(G, pe);
1374
- }, [G, pe]), K = I(() => {
1375
- (G.type === i.PlainText || G.type === i.Code) && h(G.text);
1376
- }, [G]), q = I(() => {
1377
- G.type === i.Markdown && h(G.text);
1378
- }, [G]), _e = I(() => {
1379
- G.type === i.Json && h(JSON.stringify(G.value, null, 2));
1380
- }, [G]);
1381
- return /* @__PURE__ */ H(Ue, {
1382
- isOpen: de,
1383
- isLoading: fe,
1384
- onClose: me,
1385
- onRetry: he,
1386
- content: G,
1387
- fileName: pe,
1369
+ }, gt = I(({ labels: e, leftActions: t, isMobile: n = !1, isBoundedOverlay: r = !1, defaultWidth: o, minWidth: s, maxWidth: c, codeBlockTheme: l, tableDownloadFilename: u, loadPdf: d, configurePdfWorker: f, onVisualizerSendMessage: p }) => {
1370
+ let { ariaLabel: m = "Attachment preview", closeLabel: g = "Close", downloadLabel: _ = "Download", unsupportedLabel: v = "Preview is not supported for this file", loadErrorLabel: y = "Failed to load file", loadErrorRetryLabel: b, forbiddenErrorLabel: x = "You don't have permission to access this file", copyTextLabel: S, copiedTextLabel: C, copyMarkdownLabel: w, copiedMarkdownLabel: T, copyJsonLabel: E, copiedJsonLabel: D, htmlFrameBlockedLabel: O, htmlOpenInNewTabLabel: k, htmlViewSourceLabel: A, htmlViewRenderedLabel: j, pdfThumbnailsLabel: M, pdfShowThumbnailsLabel: N, pdfHideThumbnailsLabel: ee, pdfPageNumberLabel: te, pdfContentLoadingLabel: P, pdfContentErrorLabel: ne, pdfContentRetryLabel: re, xlsxFormulaLabel: ie, codeContentLoadingLabel: ae, codeContentErrorLabel: F, codeContentRetryLabel: oe, tableCopyLabel: I, tableCopiedLabel: R, tableDownloadCsvLabel: z, codeBlockCopyLabel: B, codeBlockCopiedLabel: V, codeBlockDownloadLabel: H, tableScrollRegionAriaLabel: se, mathScrollRegionAriaLabel: ce, ooxmlHighlightsLabel: le, ooxmlHighlightNavigatedLabel: W, loadingLabel: G } = e ?? {}, { isOpen: ue, isLoading: de, content: K, fileName: fe, closeCanvas: pe, retryCanvas: me } = pt(), q = L(() => {
1371
+ a(K, fe);
1372
+ }, [K, fe]), J = L(() => {
1373
+ (K.type === i.PlainText || K.type === i.Code) && h(K.text);
1374
+ }, [K]), he = L(() => {
1375
+ K.type === i.Markdown && h(K.text);
1376
+ }, [K]), Y = L(() => {
1377
+ K.type === i.Json && h(JSON.stringify(K.value, null, 2));
1378
+ }, [K]);
1379
+ return /* @__PURE__ */ U(Ge, {
1380
+ isOpen: ue,
1381
+ isLoading: de,
1382
+ onClose: pe,
1383
+ onRetry: me,
1384
+ content: K,
1385
+ fileName: fe,
1388
1386
  leftActions: t,
1389
1387
  labels: {
1390
1388
  ariaLabel: m,
@@ -1408,29 +1406,29 @@ var ct = P(void 0), lt = ({ children: e }) => {
1408
1406
  pdfShowThumbnailsLabel: N,
1409
1407
  pdfHideThumbnailsLabel: ee,
1410
1408
  pdfPageNumberLabel: te,
1411
- pdfContentLoadingLabel: ne,
1412
- pdfContentErrorLabel: re,
1413
- pdfContentRetryLabel: ie,
1414
- xlsxFormulaLabel: ae,
1415
- codeContentLoadingLabel: oe,
1416
- codeContentErrorLabel: P,
1417
- codeContentRetryLabel: se,
1418
- tableCopyLabel: F,
1419
- tableCopiedLabel: L,
1420
- tableDownloadCsvLabel: R,
1421
- codeBlockCopyLabel: z,
1422
- codeBlockCopiedLabel: B,
1423
- codeBlockDownloadLabel: V,
1424
- tableScrollRegionAriaLabel: ce,
1425
- mathScrollRegionAriaLabel: le,
1426
- ooxmlHighlightsLabel: ue,
1427
- ooxmlHighlightNavigatedLabel: U,
1428
- loadingLabel: W
1409
+ pdfContentLoadingLabel: P,
1410
+ pdfContentErrorLabel: ne,
1411
+ pdfContentRetryLabel: re,
1412
+ xlsxFormulaLabel: ie,
1413
+ codeContentLoadingLabel: ae,
1414
+ codeContentErrorLabel: F,
1415
+ codeContentRetryLabel: oe,
1416
+ tableCopyLabel: I,
1417
+ tableCopiedLabel: R,
1418
+ tableDownloadCsvLabel: z,
1419
+ codeBlockCopyLabel: B,
1420
+ codeBlockCopiedLabel: V,
1421
+ codeBlockDownloadLabel: H,
1422
+ tableScrollRegionAriaLabel: se,
1423
+ mathScrollRegionAriaLabel: ce,
1424
+ ooxmlHighlightsLabel: le,
1425
+ ooxmlHighlightNavigatedLabel: W,
1426
+ loadingLabel: G
1429
1427
  },
1430
- onDownload: ge,
1431
- onCopyText: G.type === i.PlainText || G.type === i.Code ? K : void 0,
1432
- onCopyMarkdown: G.type === i.Markdown ? q : void 0,
1433
- onCopyJson: G.type === i.Json ? _e : void 0,
1428
+ onDownload: q,
1429
+ onCopyText: K.type === i.PlainText || K.type === i.Code ? J : void 0,
1430
+ onCopyMarkdown: K.type === i.Markdown ? he : void 0,
1431
+ onCopyJson: K.type === i.Json ? Y : void 0,
1434
1432
  tableDownloadFilename: u,
1435
1433
  isMobile: n,
1436
1434
  isBoundedOverlay: r,
@@ -1442,30 +1440,30 @@ var ct = P(void 0), lt = ({ children: e }) => {
1442
1440
  loadPdf: d,
1443
1441
  onVisualizerSendMessage: p
1444
1442
  });
1445
- }), mt = {
1443
+ }), _t = {
1446
1444
  frame: "_frame_1ys0b_1",
1447
1445
  header: "_header_1ys0b_6",
1448
1446
  title: "_title_1ys0b_10"
1449
- }, ht = F(({ content: e, height: t, onExpand: n, expandAriaLabel: r, actionsGroupAriaLabel: i = "Visualizer actions", frameTitle: a, loadingLabel: o, errorLabel: s, titleClassName: c = "dial-small-semi-text", isBorderless: l = !1, isTitleHidden: u = !1, colors: d, onVisualizerSendMessage: f }) => {
1447
+ }, vt = I(({ content: e, height: t, onExpand: n, expandAriaLabel: r, actionsGroupAriaLabel: i = "Visualizer actions", frameTitle: a, loadingLabel: o, errorLabel: s, titleClassName: c = "dial-small-semi-text", isBorderless: l = !1, isTitleHidden: u = !1, colors: d, onVisualizerSendMessage: f }) => {
1450
1448
  let p = e.visualizerName.trim(), h = !u && p !== "";
1451
- return /* @__PURE__ */ U("div", {
1452
- className: _("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border", mt.frame]),
1449
+ return /* @__PURE__ */ W("div", {
1450
+ className: _("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border", _t.frame]),
1453
1451
  style: m({
1454
1452
  "--igv-bg": d?.background,
1455
1453
  "--igv-border": d?.border,
1456
1454
  "--igv-title-text": d?.titleText
1457
1455
  }),
1458
- children: [/* @__PURE__ */ U("div", {
1459
- className: _("flex min-h-10 items-center gap-2 py-2", h ? "justify-between" : "justify-end", !l && ["border-b px-4", mt.header]),
1460
- children: [h && /* @__PURE__ */ H("span", {
1461
- className: _("min-w-0 truncate", c, mt.title),
1456
+ children: [/* @__PURE__ */ W("div", {
1457
+ className: _("flex min-h-10 items-center gap-2 py-2", h ? "justify-between" : "justify-end", !l && ["border-b px-4", _t.header]),
1458
+ children: [h && /* @__PURE__ */ U("span", {
1459
+ className: _("min-w-0 truncate", c, _t.title),
1462
1460
  children: p
1463
- }), /* @__PURE__ */ H("div", {
1461
+ }), /* @__PURE__ */ U("div", {
1464
1462
  role: "toolbar",
1465
1463
  "aria-label": i,
1466
1464
  className: "flex items-center gap-1",
1467
- children: /* @__PURE__ */ H(E, {
1468
- icon: /* @__PURE__ */ H(M, {
1465
+ children: /* @__PURE__ */ U(E, {
1466
+ icon: /* @__PURE__ */ U(M, {
1469
1467
  size: S.SM,
1470
1468
  stroke: C,
1471
1469
  "aria-hidden": !0
@@ -1475,10 +1473,10 @@ var ct = P(void 0), lt = ({ children: e }) => {
1475
1473
  onClick: n
1476
1474
  })
1477
1475
  })]
1478
- }), /* @__PURE__ */ H("div", {
1476
+ }), /* @__PURE__ */ U("div", {
1479
1477
  className: "w-full",
1480
1478
  style: { height: `${t}px` },
1481
- children: /* @__PURE__ */ H(Le, {
1479
+ children: /* @__PURE__ */ U(ze, {
1482
1480
  content: e,
1483
1481
  loadingLabel: o,
1484
1482
  errorLabel: s,
@@ -1487,7 +1485,18 @@ var ct = P(void 0), lt = ({ children: e }) => {
1487
1485
  })
1488
1486
  })]
1489
1487
  });
1490
- }), gt = (e) => {
1488
+ }), yt = /* @__PURE__ */ function(e) {
1489
+ return e.Pdf = "resolvePdfContent", e.Markdown = "resolveMarkdownContent", e.Json = "resolveJsonContent", e;
1490
+ }({}), bt = {
1491
+ [f.PDF]: yt.Pdf,
1492
+ [f.Markdown]: yt.Markdown,
1493
+ [f.JSON]: yt.Json
1494
+ }, xt = {
1495
+ [d.Markdown]: yt.Markdown,
1496
+ [d.MarkdownAlt]: yt.Markdown,
1497
+ [d.JSON]: yt.Json,
1498
+ [d.PDF]: yt.Pdf
1499
+ }, St = (e) => {
1491
1500
  let t;
1492
1501
  try {
1493
1502
  t = new URL(e).pathname;
@@ -1500,13 +1509,13 @@ var ct = P(void 0), lt = ({ children: e }) => {
1500
1509
  } catch {
1501
1510
  return n;
1502
1511
  }
1503
- }, _t = (e, t) => {
1504
- let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = ut(), o = dt(), { customVisualizers: s, themeId: l, onBeforeOpen: u } = t, p = B(null), m = I(async (t, n, r) => {
1512
+ }, Ct = (e, t) => {
1513
+ let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = pt(), o = mt(), { customVisualizers: s, themeId: l, onBeforeOpen: u } = t, d = V(null), f = L(async (t, n, r) => {
1505
1514
  if (t.url == null && t.referenceUrl != null) {
1506
1515
  let i = e.resolveReferencePdfContent(t);
1507
1516
  if (i != null) return r(i, t.name, n);
1508
1517
  }
1509
- let a = t.contentType.toLowerCase(), o = je(a, s);
1518
+ let a = t.contentType.toLowerCase(), o = Ne(a, s);
1510
1519
  if (o != null) {
1511
1520
  let i = await e.resolveVisualizerContent(t, o, l);
1512
1521
  if (i != null) return r(i, t.name, n);
@@ -1515,47 +1524,34 @@ var ct = P(void 0), lt = ({ children: e }) => {
1515
1524
  let i = await e.resolveTextContent(t);
1516
1525
  if (i != null) return r(i, t.name, n);
1517
1526
  }
1518
- let c = Ye("", a);
1519
- if (c != null) return r(await e.resolveOoxmlContent(t, c) ?? $(e.resolveContentUrl(t)), t.name, n);
1520
- switch (a) {
1521
- case f.PDF: return r(await e.resolvePdfContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1522
- case f.Markdown: return r(await e.resolveMarkdownContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1523
- case f.JSON: return r(await e.resolveJsonContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1527
+ let c = $("", a);
1528
+ if (c != null) return r(await e.resolveOoxmlContent(t, c) ?? it(e.resolveContentUrl(t)), t.name, n);
1529
+ let u = bt[a];
1530
+ if (u != null) return r(await e[u](t) ?? it(e.resolveContentUrl(t)), t.name, n);
1531
+ let d = t.name ?? "", f = d.lastIndexOf("."), p = f === -1 ? "" : d.slice(f + 1).toLowerCase(), m = $(d);
1532
+ if (m != null) return r(await e.resolveOoxmlContent(t, m) ?? it(e.resolveContentUrl(t)), t.name, n);
1533
+ let h = xt[p];
1534
+ if (h != null) {
1535
+ let i = await e[h](t);
1536
+ return i != null && r(i, t.name, n);
1524
1537
  }
1525
- let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h = Ye(u);
1526
- if (h != null) return r(await e.resolveOoxmlContent(t, h) ?? $(e.resolveContentUrl(t)), t.name, n);
1527
- switch (m) {
1528
- case d.Markdown:
1529
- case d.MarkdownAlt: {
1530
- let i = await e.resolveMarkdownContent(t);
1531
- return i != null && r(i, t.name, n);
1532
- }
1533
- case d.JSON: {
1534
- let i = await e.resolveJsonContent(t);
1535
- return i != null && r(i, t.name, n);
1536
- }
1537
- case d.PDF: {
1538
- let i = await e.resolvePdfContent(t);
1539
- return i != null && r(i, t.name, n);
1540
- }
1541
- }
1542
- let g = t.name != null && $e(t.name) || t.url != null && $e(gt(t.url));
1543
- if (t.name != null && !Qe(t.name) && !g) return r($(e.resolveContentUrl(t)), t.name, n);
1538
+ let g = t.name != null && tt(t.name) || t.url != null && tt(St(t.url));
1539
+ if (t.name != null && !et(t.name) && !g) return r(it(e.resolveContentUrl(t)), t.name, n);
1544
1540
  if (g) {
1545
1541
  let a = await e.resolveHtmlContent(t);
1546
- return a == null ? e.hasTextSource(t) ? r($(e.resolveContentUrl(t)), t.name, n) : t.url != null && r({
1542
+ return a == null ? e.hasTextSource(t) ? r(it(e.resolveContentUrl(t)), t.name, n) : t.url != null && r({
1547
1543
  type: i.Html,
1548
1544
  url: t.url
1549
1545
  }, t.name, n) : r(a, t.name, n);
1550
1546
  }
1551
- let _ = await e.resolveCodeContent(t, tt(m));
1547
+ let _ = await e.resolveCodeContent(t, rt(p));
1552
1548
  return _ != null && r(_, t.name, n);
1553
1549
  }, [
1554
1550
  s,
1555
1551
  l,
1556
1552
  e
1557
- ]), h = I(async (t, s = t.id, l) => {
1558
- let d = () => l == null || l(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (at(e), !1);
1553
+ ]), p = L(async (t, s = t.id, l) => {
1554
+ let p = () => l == null || l(), m = (e, t, r) => p() ? (n(e, t, r), !0) : (ct(e), !1);
1559
1555
  switch (t.type) {
1560
1556
  case c.Image: {
1561
1557
  let r = e.resolveImageContent(t);
@@ -1571,17 +1567,17 @@ var ct = P(void 0), lt = ({ children: e }) => {
1571
1567
  }
1572
1568
  case c.File: {
1573
1569
  let e = () => {
1574
- p.current?.(t, s, o?.());
1575
- }, i = (t, r, i) => d() ? (n(t, r, i, e), !0) : (at(t), !1);
1570
+ d.current?.(t, s, o?.());
1571
+ }, i = (t, r, i) => p() ? (n(t, r, i, e), !0) : (ct(t), !1);
1576
1572
  u?.(), r(t.name, s);
1577
- let c = await m(t, s, i);
1578
- return !c && d() && a(), c;
1573
+ let c = await f(t, s, i);
1574
+ return !c && p() && a(), c;
1579
1575
  }
1580
1576
  case c.Pasted:
1581
1577
  case c.Prompt: {
1582
1578
  u?.(), r(t.name, s);
1583
1579
  let n = await e.resolveTextContent(t);
1584
- return n == null ? (d() && a(), !1) : f(n, t.name, s);
1580
+ return n == null ? (p() && a(), !1) : m(n, t.name, s);
1585
1581
  }
1586
1582
  default: return !1;
1587
1583
  }
@@ -1590,13 +1586,13 @@ var ct = P(void 0), lt = ({ children: e }) => {
1590
1586
  r,
1591
1587
  a,
1592
1588
  u,
1593
- m,
1589
+ f,
1594
1590
  e,
1595
1591
  o
1596
1592
  ]);
1597
- return R(() => {
1598
- p.current = h;
1599
- }, [h]), { openAttachmentCanvas: h };
1593
+ return z(() => {
1594
+ d.current = p;
1595
+ }, [p]), { openAttachmentCanvas: p };
1600
1596
  };
1601
1597
  //#endregion
1602
- export { he as ATTACHMENT_CANVAS_CLASS, Ue as AttachmentCanvas, Be as AttachmentCanvasBody, pt as AttachmentCanvasContainer, lt as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, _e as CodeContent, ve as HTML_PREVIEW_FRAME_RENDER_MESSAGE, ht as InlineGroupedVisualizer, Ee as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, rt as createForbiddenCanvasContent, nt as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, tt as extensionToLanguage, Me as findVisualizerForApplication, je as findVisualizerForMime, Ye as getOoxmlFileType, Ze as getOoxmlMimeType, Ne as groupedVisualizerCanvasKey, o as isDownloadable, $e as isHtmlPreviewable, Xe as isOoxmlPreviewable, Qe as isTextPreviewable, Pe as partitionAttachmentsForApplicationVisualizer, ut as useAttachmentCanvas, ft as useLatestCanvasRequest, _t as useOpenAttachmentCanvas };
1598
+ export { me as ATTACHMENT_CANVAS_CLASS, Ge as AttachmentCanvas, He as AttachmentCanvasBody, gt as AttachmentCanvasContainer, ft as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, ve as CodeContent, ye as HTML_PREVIEW_FRAME_RENDER_MESSAGE, vt as InlineGroupedVisualizer, De as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, ot as createForbiddenCanvasContent, at as createLoadErrorCanvasContent, it as createUnsupportedCanvasContent, a as downloadAttachmentContent, rt as extensionToLanguage, Pe as findVisualizerForApplication, Ne as findVisualizerForMime, $ as getOoxmlFileType, $e as getOoxmlMimeType, Fe as groupedVisualizerCanvasKey, o as isDownloadable, tt as isHtmlPreviewable, Qe as isOoxmlPreviewable, et as isTextPreviewable, Ie as partitionAttachmentsForApplicationVisualizer, pt as useAttachmentCanvas, ht as useLatestCanvasRequest, Ct as useOpenAttachmentCanvas };