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

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