@epam/ai-dial-attachment-canvas 1.3.0-dev.331 → 1.3.0-dev.342

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