@epam/ai-dial-attachment-canvas 1.3.0-dev.310 → 1.3.0-dev.317

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