@epam/ai-dial-attachment-canvas 1.2.0-dev.6 → 1.2.0-dev.61

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 (57) hide show
  1. package/{LazyContentBoundary-CRXN6PG3.js → LazyContentBoundary-tNE1ExbI.js} +2 -1
  2. package/{PdfContent-D71LPAe3.js → PdfContent-BoAtghsO.js} +1 -1
  3. package/PdfContent.css +1 -1
  4. package/{attachment-canvas-nvhW3tKV.js → attachment-canvas-BgwyzrRC.js} +2 -2
  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.map +1 -1
  8. package/components/InlineGroupedVisualizer/InlineGroupedVisualizer.d.ts +36 -0
  9. package/components/InlineGroupedVisualizer/InlineGroupedVisualizer.d.ts.map +1 -0
  10. package/components/PdfContent/PdfContent.d.ts.map +1 -1
  11. package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts +5 -3
  12. package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts.map +1 -1
  13. package/constants/public-class-names.d.ts +11 -0
  14. package/constants/public-class-names.d.ts.map +1 -0
  15. package/context/AttachmentCanvasContext.d.ts.map +1 -1
  16. package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts +14 -1
  17. package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts.map +1 -1
  18. package/index.css +2 -1
  19. package/index.d.ts +7 -3
  20. package/index.d.ts.map +1 -1
  21. package/index.js +573 -501
  22. package/models/attachment-canvas.d.ts +41 -10
  23. package/models/attachment-canvas.d.ts.map +1 -1
  24. package/{ooxml-highlight-surfaces-CaMjx8u-.js → ooxml-highlight-surfaces-BzgOKpBV.js} +182 -74
  25. package/package.json +5 -5
  26. package/types/attachment-canvas.d.ts +6 -1
  27. package/types/attachment-canvas.d.ts.map +1 -1
  28. package/utils/content.d.ts +16 -2
  29. package/utils/content.d.ts.map +1 -1
  30. package/utils/download.d.ts.map +1 -1
  31. package/utils/ooxml-highlight-surfaces.d.ts.map +1 -1
  32. package/utils/ooxml-table-row-highlight.d.ts +8 -0
  33. package/utils/ooxml-table-row-highlight.d.ts.map +1 -0
  34. package/utils/visualizer.d.ts +29 -1
  35. package/utils/visualizer.d.ts.map +1 -1
  36. package/utils/vite-external-matcher.d.ts +5 -5
  37. package/utils/vite-external-matcher.d.ts.map +1 -1
  38. package/bounded-raw-part-cache-Cg1BsSZQ-DN8p45IK.js +0 -37900
  39. package/chart-ex-DsESBs97.js +0 -1009
  40. package/comment-occurrence-C8Y2uoVr-C1cxz2TU.js +0 -6
  41. package/comment-ui-runtime-BfE7MJZn-DhQ_eg15.js +0 -112
  42. package/comment-ui-runtime-BsK8pmUT-EgWiymew.js +0 -2
  43. package/comment-ui-runtime-DcJOYlw--B15auUq-.js +0 -170
  44. package/comments-Diid5ujN-BdQhRNjI.js +0 -282
  45. package/delimited-text-worker-host-BVY-Ecni-AimUmSn0.js +0 -25
  46. package/docx-B-VcIRoc.js +0 -29870
  47. package/line-distribute-Dtudnqhs--BYZNgzX.js +0 -1237
  48. package/line-metrics-B60C86uh-DfQUk7X1.js +0 -60
  49. package/pptx-CnoDB8Fv.js +0 -9211
  50. package/read-only-comment-decoration-Dz7eTQ4d-Cl3RKKH6.js +0 -94
  51. package/read-only-comment-margin-DkgzASAl-BbDxMI5E.js +0 -189
  52. package/render-worker-host-BfbnEChF-D2thMRGX.js +0 -7
  53. package/render-worker-host-DNL9dWRh-Bky38ZHE.js +0 -7
  54. package/render-worker-host-IkHrYOci-DbjyHK7U.js +0 -7
  55. package/renderer-module-contract-D91rkYHH-BtfSKxb4.js +0 -10063
  56. package/visible-index-BgiHEc1z-BOzE9X5U.js +0 -162
  57. package/xlsx-Dn0XSlTO.js +0 -8610
package/index.js CHANGED
@@ -1,42 +1,43 @@
1
- import { a as e, i as t, n, r, t as i } from "./attachment-canvas-nvhW3tKV.js";
2
- import { i as a, o, t as s } from "./LazyContentBoundary-CRXN6PG3.js";
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";
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, mergeClasses as g, restrainedSyntaxTheme as _, stripUrlQueryAndFragment as v } from "@epam/ai-dial-chat-shared";
4
4
  import { SidebarOrientation as y, SidebarPanel as b } from "@epam/ai-dial-sidebar";
5
- import { DIAL_ICON_SIZE as x, DIAL_KIT_ICON_STROKE as S, GhostIconButton as C, LinkButton as w, Spinner as T } from "@epam/ai-dial-ui-kit";
6
- import { IconAlertTriangle as E, IconCheck as D, IconCode as O, IconCopy as k, IconDownload as ee, IconEye as te, IconLock as ne, IconMarkdown as re, IconRefresh as ie } from "@tabler/icons-react";
7
- import { createContext as ae, lazy as A, memo as j, useCallback as M, useContext as N, useEffect as P, useMemo as F, useRef as I, useState as L } from "react";
8
- import { JsonView as oe, defaultStyles as se } from "react-json-view-lite";
9
- import { Fragment as ce, jsx as R, jsxs as z } from "react/jsx-runtime";
10
- import { AppBridge as B, AppFrame as le } from "@mcp-ui/client";
11
- import { McpUiHostContextChangedNotificationSchema as ue } from "@modelcontextprotocol/ext-apps/app-bridge";
12
- import { VisualizerConnectorRequests as V } from "@epam/ai-dial-shared";
13
- import { VisualizerConnector as H } from "@epam/ai-dial-visualizer-connector";
14
- var de = {
5
+ import { DIAL_ICON_SIZE as x, DIAL_KIT_ICON_STROKE as S, ElementSize as C, GhostIconButton as w, LinkButton as T, Spinner as E } from "@epam/ai-dial-ui-kit";
6
+ import { IconAlertTriangle as D, IconArrowsMaximize as O, IconCheck as k, IconCode as ee, IconCopy as te, IconDownload as ne, IconEye as re, IconLock as ie, IconMarkdown as ae, IconRefresh as oe } from "@tabler/icons-react";
7
+ import { createContext as A, lazy as j, memo as M, useCallback as N, useContext as se, useEffect as P, useMemo as F, useRef as I, useState as L } from "react";
8
+ import { JsonView as ce, defaultStyles as le } from "react-json-view-lite";
9
+ import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
10
+ import { AppBridge as V, AppFrame as ue } from "@mcp-ui/client";
11
+ import { McpUiHostContextChangedNotificationSchema as de } from "@modelcontextprotocol/ext-apps/app-bridge";
12
+ import { VisualizerConnectorRequests as H } from "@epam/ai-dial-shared";
13
+ import { VisualizerConnector as fe } from "@epam/ai-dial-visualizer-connector";
14
+ //#region src/constants/public-class-names.ts
15
+ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
15
16
  container: "_container_1nhig_1",
16
17
  containerLight: "_containerLight_1nhig_5"
17
- }, fe = {
18
+ }, U = {
18
19
  [l.Dark]: _,
19
20
  [l.Light]: _
20
- }, pe = () => A(async () => {
21
+ }, he = () => j(async () => {
21
22
  let { Prism: e } = await import("react-syntax-highlighter");
22
23
  return { default: e };
23
- }), me = j(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
24
- let { text: r, language: i } = e, a = i == null || i === "plaintext", o = fe[t], c = t === l.Light, [u, d] = L(0), f = F(pe, [u]), p = M(() => {
24
+ }), ge = M(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
25
+ let { text: r, language: i } = e, a = i == null || i === "plaintext", o = U[t], c = t === l.Light, [u, d] = L(0), f = F(he, [u]), p = N(() => {
25
26
  d((e) => e + 1);
26
- }, []), m = /* @__PURE__ */ R("pre", {
27
+ }, []), m = /* @__PURE__ */ z("pre", {
27
28
  className: "whitespace-pre-wrap break-words p-4",
28
29
  children: r
29
30
  });
30
- return /* @__PURE__ */ R("div", {
31
+ return /* @__PURE__ */ z("div", {
31
32
  dir: "ltr",
32
- className: g("h-full overflow-auto", de.container, c && de.containerLight),
33
- children: a ? m : /* @__PURE__ */ R(s, {
33
+ className: g("h-full overflow-auto", me.container, c && me.containerLight),
34
+ children: a ? m : /* @__PURE__ */ z(s, {
34
35
  retryKey: u,
35
36
  onRetry: p,
36
37
  pendingContent: m,
37
38
  errorContent: m,
38
39
  labels: n,
39
- children: /* @__PURE__ */ R(f, {
40
+ children: /* @__PURE__ */ z(f, {
40
41
  language: i,
41
42
  style: o,
42
43
  customStyle: {
@@ -53,21 +54,21 @@ var de = {
53
54
  })
54
55
  })
55
56
  });
56
- }), he = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, ge = j(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
57
+ }), _e = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, ve = M(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
57
58
  let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = L(!0), [d, f] = L(!1), p = I(null);
58
59
  P(() => {
59
60
  u(!0), f(!1);
60
61
  }, [e]);
61
- let m = M((t) => {
62
+ let m = N((t) => {
62
63
  if (u(!1), e.srcdoc == null) try {
63
64
  p.current?.contentDocument ?? f(!0);
64
65
  } catch {
65
66
  f(!0);
66
67
  }
67
- }, [e.srcdoc]), h = M(() => {
68
+ }, [e.srcdoc]), h = N(() => {
68
69
  u(!1), f(!0);
69
70
  }, []);
70
- if (n && e.srcdoc != null) return /* @__PURE__ */ R(me, {
71
+ if (n && e.srcdoc != null) return /* @__PURE__ */ z(ge, {
71
72
  content: {
72
73
  type: i.Code,
73
74
  text: e.srcdoc,
@@ -75,26 +76,26 @@ var de = {
75
76
  },
76
77
  codeBlockTheme: a
77
78
  });
78
- if (d) return /* @__PURE__ */ z("div", {
79
+ if (d) return /* @__PURE__ */ B("div", {
79
80
  className: "flex h-full flex-col items-center justify-center gap-3 p-4",
80
- children: [/* @__PURE__ */ R("p", {
81
+ children: [/* @__PURE__ */ z("p", {
81
82
  className: "text-center",
82
83
  children: s
83
- }), e.url != null && /* @__PURE__ */ R(w, {
84
+ }), e.url != null && /* @__PURE__ */ z(T, {
84
85
  href: e.url,
85
86
  target: "_blank",
86
87
  label: c,
87
- className: he.openInNewTabButton,
88
+ className: _e.openInNewTabButton,
88
89
  textClassName: o
89
90
  })]
90
91
  });
91
92
  let _ = e.srcdoc != null, v = _ ? void 0 : e.url, y = _ ? e.srcdoc : void 0;
92
- return /* @__PURE__ */ z("div", {
93
+ return /* @__PURE__ */ B("div", {
93
94
  className: "relative h-full",
94
- children: [l && /* @__PURE__ */ R("div", {
95
+ children: [l && /* @__PURE__ */ z("div", {
95
96
  className: "absolute inset-0 flex items-center justify-center",
96
- children: /* @__PURE__ */ R(T, {})
97
- }), /* @__PURE__ */ R("iframe", {
97
+ children: /* @__PURE__ */ z(E, {})
98
+ }), /* @__PURE__ */ z("iframe", {
98
99
  ref: p,
99
100
  title: r,
100
101
  src: v,
@@ -105,10 +106,10 @@ var de = {
105
106
  onError: h
106
107
  })]
107
108
  });
108
- }), _e = {
109
+ }), ye = {
109
110
  name: "MCP-UI Host",
110
111
  version: "1.0.0"
111
- }, ve = { openLinks: {} }, U = (e) => {
112
+ }, be = { openLinks: {} }, xe = (e) => {
112
113
  let t;
113
114
  try {
114
115
  t = new URL(e);
@@ -122,14 +123,14 @@ var de = {
122
123
  return !1;
123
124
  }
124
125
  return !0;
125
- }, ye = (e, t, n) => {
126
+ }, Se = (e, t, n) => {
126
127
  if (n) {
127
128
  e.style.maxWidth = "", e.style.maxHeight = "";
128
129
  return;
129
130
  }
130
131
  let r = t;
131
132
  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`));
132
- }, be = (e, t, n) => {
133
+ }, Ce = (e, t, n) => {
133
134
  let r = I(e);
134
135
  P(() => {
135
136
  r.current = e;
@@ -138,15 +139,15 @@ var de = {
138
139
  return P(() => {
139
140
  let e = null;
140
141
  try {
141
- e = new B(null, _e, ve, { hostContext: r.current.hostContext }), e.onopenlink = async ({ url: e }) => {
142
+ e = new V(null, ye, be, { hostContext: r.current.hostContext }), e.onopenlink = async ({ url: e }) => {
142
143
  let t = r.current.onOpenLink;
143
- return (t == null ? U(e) : t(e)) === !1 ? { isError: !0 } : {};
144
+ return (t == null ? xe(e) : t(e)) === !1 ? { isError: !0 } : {};
144
145
  }, e.onrequestdisplaymode = async ({ mode: e }) => {
145
146
  let t = r.current.onRequestDisplayMode, n = r.current.hostContext?.displayMode ?? "inline";
146
147
  return { mode: t?.(e) ?? n };
147
- }, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(ue, ({ params: e }) => {
148
+ }, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(de, ({ params: e }) => {
148
149
  let n = t.current?.querySelector("iframe");
149
- n != null && ye(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
150
+ n != null && Se(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
150
151
  }), a(e);
151
152
  } catch (e) {
152
153
  console.error("[useMcpAppBridge] Error creating AppBridge:", e), s(!0);
@@ -160,12 +161,12 @@ var de = {
160
161
  appBridge: i,
161
162
  hasFailed: o
162
163
  };
163
- }, W = {
164
+ }, we = {
164
165
  loadingOverlay: "_loadingOverlay_1aric_1",
165
166
  fullscreenFrame: "_fullscreenFrame_1aric_20",
166
167
  statusLabel: "_statusLabel_1aric_27",
167
168
  errorIcon: "_errorIcon_1aric_31"
168
- }, xe = ({ content: e, errorLabel: t = "Failed to load app" }) => {
169
+ }, Te = ({ content: e, errorLabel: t = "Failed to load app" }) => {
169
170
  let [n, r] = L("loading"), { html: i, sandboxUrl: a, toolInput: o, toolResult: s, hostContext: c } = e, l = F(() => ({ url: new URL(a) }), [a]), u = c?.displayMode === "fullscreen", d = I(null), [f, p] = L();
170
171
  P(() => {
171
172
  let e = d.current;
@@ -180,15 +181,15 @@ var de = {
180
181
  });
181
182
  return t.observe(e), () => t.disconnect();
182
183
  }, []);
183
- let { appBridge: m, hasFailed: h } = be(e, d, F(() => c == null || f == null ? c : {
184
+ let { appBridge: m, hasFailed: h } = Ce(e, d, F(() => c == null || f == null ? c : {
184
185
  ...c,
185
186
  containerDimensions: f
186
187
  }, [c, f])), _ = h || n === "error";
187
- return /* @__PURE__ */ z("div", {
188
+ return /* @__PURE__ */ B("div", {
188
189
  ref: d,
189
- className: g("relative h-full w-full", u && W.fullscreenFrame),
190
+ className: g("relative h-full w-full", u && we.fullscreenFrame),
190
191
  children: [
191
- m != null && /* @__PURE__ */ R(le, {
192
+ m != null && /* @__PURE__ */ z(ue, {
192
193
  html: i,
193
194
  sandbox: l,
194
195
  appBridge: m,
@@ -198,26 +199,26 @@ var de = {
198
199
  onInitialized: () => r("ready"),
199
200
  onError: () => r("error")
200
201
  }),
201
- !_ && n === "loading" && /* @__PURE__ */ R("div", {
202
- className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", W.loadingOverlay),
203
- children: /* @__PURE__ */ R(T, {})
202
+ !_ && n === "loading" && /* @__PURE__ */ z("div", {
203
+ className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", we.loadingOverlay),
204
+ children: /* @__PURE__ */ z(E, {})
204
205
  }),
205
- _ && /* @__PURE__ */ z("div", {
206
+ _ && /* @__PURE__ */ B("div", {
206
207
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
207
- children: [/* @__PURE__ */ R(E, {
208
+ children: [/* @__PURE__ */ z(D, {
208
209
  size: 60,
209
210
  stroke: S,
210
211
  "aria-hidden": !0,
211
- className: W.errorIcon
212
- }), /* @__PURE__ */ R("p", {
212
+ className: we.errorIcon
213
+ }), /* @__PURE__ */ z("p", {
213
214
  role: "alert",
214
- className: g("text-center", W.statusLabel),
215
+ className: g("text-center", we.statusLabel),
215
216
  children: t
216
217
  })]
217
218
  })
218
219
  ]
219
220
  });
220
- }, G = {
221
+ }, W = {
221
222
  viewer: "_viewer_1w97n_2",
222
223
  spreadsheetCanvas: "_spreadsheetCanvas_1w97n_6",
223
224
  formulaPanel: "_formulaPanel_1w97n_12",
@@ -225,16 +226,16 @@ var de = {
225
226
  statusOverlay: "_statusOverlay_1w97n_24",
226
227
  errorIcon: "_errorIcon_1w97n_29",
227
228
  highlight: "_highlight_1w97n_37"
228
- }, Se = (e) => {
229
+ }, Ee = (e) => {
229
230
  if (e?.kind !== "range") return "";
230
231
  let { activeCell: t } = e.selection, n = e.cells.find(({ address: e }) => e.row === t.row && e.col === t.col);
231
232
  if (n == null) return "";
232
233
  let r = n.formula;
233
234
  return r == null || r.trim().length === 0 ? n.displayText : r.startsWith("=") ? r : `=${r}`;
234
- }, Ce = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
235
+ }, De = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
235
236
  switch (t) {
236
237
  case r.Docx: {
237
- let [{ DocxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("./docx-B-VcIRoc.js"), import("./chart-ex-DsESBs97.js")]);
238
+ let [{ DocxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/docx"), import("@silurus/ooxml/chart-ex")]);
238
239
  return new t(e, {
239
240
  enableTextSelection: !0,
240
241
  refitOnResize: !0,
@@ -243,7 +244,7 @@ var de = {
243
244
  });
244
245
  }
245
246
  case r.Xlsx: {
246
- let [{ XlsxViewer: t }, { chartEx: r }] = await Promise.all([import("./xlsx-Dn0XSlTO.js"), import("./chart-ex-DsESBs97.js")]);
247
+ let [{ XlsxViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/xlsx"), import("@silurus/ooxml/chart-ex")]);
247
248
  return new t(e, {
248
249
  showZoomSlider: !0,
249
250
  chartEx: r,
@@ -252,8 +253,8 @@ var de = {
252
253
  });
253
254
  }
254
255
  case r.Csv: {
255
- let { XlsxSheetViewer: t } = await import("./xlsx-Dn0XSlTO.js"), r = document.createElement("canvas");
256
- r.className = G.spreadsheetCanvas, e.replaceChildren(r);
256
+ let { XlsxSheetViewer: t } = await import("@silurus/ooxml/xlsx"), r = document.createElement("canvas");
257
+ r.className = W.spreadsheetCanvas, e.replaceChildren(r);
257
258
  let i = new t(r, {
258
259
  showScrollbars: !0,
259
260
  onError: n
@@ -264,7 +265,7 @@ var de = {
264
265
  };
265
266
  }
266
267
  case r.Pptx: {
267
- let [{ PptxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("./pptx-CnoDB8Fv.js"), import("./chart-ex-DsESBs97.js")]);
268
+ let [{ PptxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/pptx"), import("@silurus/ooxml/chart-ex")]);
268
269
  return new t(e, {
269
270
  enableTextSelection: !0,
270
271
  refitOnResize: !0,
@@ -273,16 +274,16 @@ var de = {
273
274
  });
274
275
  }
275
276
  }
276
- }, we = async (e, t, n, i) => {
277
+ }, Oe = async (e, t, n, i) => {
277
278
  let { onError: a, onXlsxSelectionContextChange: o, onGeometryInvalidated: s } = n;
278
279
  switch (t.format) {
279
280
  case r.Docx: {
280
281
  let [{ DocxDocument: n, DocxScrollViewer: r }, { chartEx: o }, { createDocxHighlightSurface: c }] = await Promise.all([
281
- import("./docx-B-VcIRoc.js"),
282
- import("./chart-ex-DsESBs97.js"),
283
- import("./ooxml-highlight-surfaces-CaMjx8u-.js")
282
+ import("@silurus/ooxml/docx"),
283
+ import("@silurus/ooxml/chart-ex"),
284
+ import("./ooxml-highlight-surfaces-BzgOKpBV.js")
284
285
  ]), l = await n.load(t.url, { chartEx: o });
285
- if (i()) throw l.destroy(), new Te();
286
+ if (i()) throw l.destroy(), new ke();
286
287
  let u = r.fromDocument(e, l, {
287
288
  enableTextSelection: !0,
288
289
  refitOnResize: !0,
@@ -298,11 +299,11 @@ var de = {
298
299
  }
299
300
  case r.Pptx: {
300
301
  let [{ PptxPresentation: n, PptxScrollViewer: r }, { chartEx: o }, { createPptxHighlightSurface: c }] = await Promise.all([
301
- import("./pptx-CnoDB8Fv.js"),
302
- import("./chart-ex-DsESBs97.js"),
303
- import("./ooxml-highlight-surfaces-CaMjx8u-.js")
302
+ import("@silurus/ooxml/pptx"),
303
+ import("@silurus/ooxml/chart-ex"),
304
+ import("./ooxml-highlight-surfaces-BzgOKpBV.js")
304
305
  ]), l = await n.load(t.url, { chartEx: o });
305
- if (i()) throw l.destroy(), new Te();
306
+ if (i()) throw l.destroy(), new ke();
306
307
  let u = r.fromPresentation(e, l, {
307
308
  enableTextSelection: !0,
308
309
  refitOnResize: !0,
@@ -318,9 +319,9 @@ var de = {
318
319
  }
319
320
  case r.Xlsx: {
320
321
  let [{ XlsxViewer: n }, { chartEx: r }, { createXlsxHighlightSurface: c }] = await Promise.all([
321
- import("./xlsx-Dn0XSlTO.js"),
322
- import("./chart-ex-DsESBs97.js"),
323
- import("./ooxml-highlight-surfaces-CaMjx8u-.js")
322
+ import("@silurus/ooxml/xlsx"),
323
+ import("@silurus/ooxml/chart-ex"),
324
+ import("./ooxml-highlight-surfaces-BzgOKpBV.js")
324
325
  ]), l = new n(e, {
325
326
  showZoomSlider: !0,
326
327
  chartEx: r,
@@ -336,12 +337,12 @@ var de = {
336
337
  };
337
338
  }
338
339
  case r.Csv: {
339
- let r = await Ce(e, t.format, n);
340
+ let r = await De(e, t.format, n);
340
341
  return await r.load(t.url), { viewer: r };
341
342
  }
342
343
  }
343
- }, Te = class extends Error {}, Ee = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, highlightsLabel: s = "Cited locations", highlightNavigatedLabel: c = "Scrolled to the cited location" }) => {
344
- let l = I(null), [u, d] = L(!0), [f, p] = L(!1), [m, h] = L(""), [_, v] = L([]), [y, b] = L(!1), { highlights: x, selectedHighlightId: C } = t, w = x != null && x.length > 0, D = I(void 0), O = I(x);
344
+ }, ke = class extends Error {}, Ae = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, highlightsLabel: s = "Cited locations", highlightNavigatedLabel: c = "Scrolled to the cited location" }) => {
345
+ let l = I(null), [u, d] = L(!0), [f, p] = L(!1), [m, h] = L(""), [_, v] = L([]), [y, b] = L(!1), { highlights: x, selectedHighlightId: C } = t, w = x != null && x.length > 0, T = I(void 0), O = I(x);
345
346
  O.current = x;
346
347
  let k = I(void 0);
347
348
  return P(() => {
@@ -366,7 +367,7 @@ var de = {
366
367
  i || (d(!1), p(!0));
367
368
  },
368
369
  onXlsxSelectionContextChange: (e) => {
369
- i || h(Se(e));
370
+ i || h(Ee(e));
370
371
  },
371
372
  onGeometryInvalidated: s
372
373
  }, f = () => {
@@ -375,28 +376,28 @@ var de = {
375
376
  return e.addEventListener("scroll", s, !0), k.current = s, (async () => {
376
377
  try {
377
378
  if (w) {
378
- let r = await we(e, t, u, o);
379
+ let r = await Oe(e, t, u, o);
379
380
  if (i) {
380
381
  r.viewer.destroy(), r.engine?.destroy();
381
382
  return;
382
383
  }
383
- n = r, D.current = r.highlights, f();
384
+ n = r, T.current = r.highlights, f();
384
385
  } else {
385
- let r = await Ce(e, t.format, u);
386
+ let r = await De(e, t.format, u);
386
387
  if (i) {
387
388
  r.destroy();
388
389
  return;
389
390
  }
390
- n = { viewer: r }, D.current = void 0, f(), await r.load(t.url);
391
+ n = { viewer: r }, T.current = void 0, f(), await r.load(t.url);
391
392
  }
392
393
  if (i) return;
393
394
  d(!1), await c();
394
395
  } catch (t) {
395
- if (t instanceof Te || i) return;
396
- n?.viewer.destroy(), n?.engine?.destroy(), n = void 0, D.current = void 0, e.replaceChildren(), d(!1), p(!0);
396
+ if (t instanceof ke || i) return;
397
+ n?.viewer.destroy(), n?.engine?.destroy(), n = void 0, T.current = void 0, e.replaceChildren(), d(!1), p(!0);
397
398
  }
398
399
  })(), () => {
399
- i = !0, e.removeEventListener("scroll", s, !0), a != null && cancelAnimationFrame(a), k.current = void 0, r?.disconnect(), n?.viewer.destroy(), n?.engine?.destroy(), D.current = void 0, e.replaceChildren();
400
+ 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();
400
401
  };
401
402
  }, [
402
403
  t.format,
@@ -406,7 +407,7 @@ var de = {
406
407
  k.current?.();
407
408
  }, [x]), P(() => {
408
409
  b(!1);
409
- let t = D.current;
410
+ let t = T.current;
410
411
  if (t == null || u) return;
411
412
  let n = (O.current?.find(({ id: e }) => e === C))?.locations.at(0);
412
413
  if (n == null) return;
@@ -422,38 +423,38 @@ var de = {
422
423
  })(), () => {
423
424
  r = !0;
424
425
  };
425
- }, [C, u]), /* @__PURE__ */ z("div", {
426
+ }, [C, u]), /* @__PURE__ */ B("div", {
426
427
  className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
427
428
  children: [
428
- t.format === r.Xlsx && /* @__PURE__ */ z("div", {
429
+ t.format === r.Xlsx && /* @__PURE__ */ B("div", {
429
430
  role: "region",
430
431
  "aria-label": a,
431
- className: g("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", G.formulaPanel),
432
- children: [/* @__PURE__ */ R("span", {
432
+ className: g("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", W.formulaPanel),
433
+ children: [/* @__PURE__ */ z("span", {
433
434
  "aria-hidden": "true",
434
435
  className: g("shrink-0", o),
435
436
  children: "fx"
436
- }), /* @__PURE__ */ R("code", {
437
+ }), /* @__PURE__ */ z("code", {
437
438
  dir: "ltr",
438
439
  tabIndex: 0,
439
440
  "aria-live": "polite",
440
- className: g("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", G.formulaValue),
441
+ className: g("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", W.formulaValue),
441
442
  children: m
442
443
  })]
443
444
  }),
444
- /* @__PURE__ */ z("div", {
445
+ /* @__PURE__ */ B("div", {
445
446
  className: "relative min-h-0 w-full flex-1",
446
- children: [/* @__PURE__ */ R("div", {
447
+ children: [/* @__PURE__ */ z("div", {
447
448
  ref: l,
448
449
  role: "document",
449
450
  "aria-label": n,
450
451
  "aria-busy": u,
451
- className: g("h-full w-full overflow-hidden", G.viewer)
452
- }), _.length > 0 && /* @__PURE__ */ R("div", {
452
+ className: g("h-full w-full overflow-hidden", W.viewer)
453
+ }), _.length > 0 && /* @__PURE__ */ z("div", {
453
454
  role: "region",
454
455
  "aria-label": s,
455
456
  className: "pointer-events-none absolute inset-0 overflow-hidden",
456
- children: _.map((e, t) => /* @__PURE__ */ R("div", {
457
+ children: _.map((e, t) => /* @__PURE__ */ z("div", {
457
458
  "aria-hidden": "true",
458
459
  style: {
459
460
  left: `${e.left}px`,
@@ -463,28 +464,28 @@ var de = {
463
464
  },
464
465
  "data-selected": e.highlightId === C,
465
466
  "data-clipped": e.isClippedAtEnd === !0,
466
- className: g("absolute", G.highlight)
467
+ className: g("absolute", W.highlight)
467
468
  }, `${e.highlightId}-${t}`))
468
469
  })]
469
470
  }),
470
- /* @__PURE__ */ R("div", {
471
+ /* @__PURE__ */ z("div", {
471
472
  role: "status",
472
473
  "aria-live": "polite",
473
474
  className: "sr-only",
474
475
  children: y ? c : ""
475
476
  }),
476
- (u || f) && /* @__PURE__ */ R("div", {
477
+ (u || f) && /* @__PURE__ */ z("div", {
477
478
  role: f ? "alert" : void 0,
478
479
  "aria-live": "polite",
479
- className: g("absolute inset-0 flex items-center justify-center", G.statusOverlay),
480
- children: u ? /* @__PURE__ */ R(T, { size: 48 }) : /* @__PURE__ */ z("div", {
480
+ className: g("absolute inset-0 flex items-center justify-center", W.statusOverlay),
481
+ children: u ? /* @__PURE__ */ z(E, { size: 48 }) : /* @__PURE__ */ B("div", {
481
482
  className: "flex flex-col items-center gap-2",
482
- children: [/* @__PURE__ */ R(E, {
483
+ children: [/* @__PURE__ */ z(D, {
483
484
  "aria-hidden": "true",
484
485
  size: 60,
485
486
  stroke: S,
486
- className: G.errorIcon
487
- }), /* @__PURE__ */ R("p", {
487
+ className: W.errorIcon
488
+ }), /* @__PURE__ */ z("p", {
488
489
  className: "text-center",
489
490
  children: i
490
491
  })]
@@ -492,76 +493,92 @@ var de = {
492
493
  })
493
494
  ]
494
495
  });
495
- }, De = {
496
+ }, je = {
496
497
  loadingOverlay: "_loadingOverlay_12637_1",
497
498
  statusLabel: "_statusLabel_12637_5",
498
499
  errorIcon: "_errorIcon_12637_9"
499
- }, Oe = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", colors: r }) => {
500
- let i = I(null), [a, o] = L("loading"), { url: s, visualizerName: c, requestTimeout: l } = e, u = I(e);
501
- return u.current = e, P(() => {
502
- let e = i.current;
500
+ }, Me = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a }) => {
501
+ let o = I(null), [s, c] = L("loading"), { url: l, visualizerName: u, requestTimeout: d } = e, f = I(e);
502
+ return f.current = e, P(() => {
503
+ let e = o.current;
503
504
  if (!e) return;
504
- o("loading");
505
- let t = new H(e, {
506
- domain: s,
505
+ c("loading");
506
+ let t = new fe(e, {
507
+ domain: l,
507
508
  hostDomain: window.location.origin,
508
- visualizerName: c,
509
- requestTimeout: l
509
+ visualizerName: u,
510
+ requestTimeout: d
510
511
  }), n = !0;
511
512
  return (async () => {
512
513
  if (await t.ready(), !n) return;
513
- let { mimeType: e, layout: r, data: i } = u.current, a = {
514
- layout: r,
515
- ...typeof i == "object" && i ? i : {}
516
- };
517
- await t.send(V.sendVisualizeData, {
518
- mimeType: e,
519
- visualizerData: a
520
- }), n && o("ready");
514
+ let e = f.current;
515
+ if (e.type === i.GroupedVisualizer) await t.send(H.sendGroupedVisualizeData, {
516
+ attachments: e.attachments,
517
+ layout: e.layout
518
+ });
519
+ else {
520
+ let { mimeType: n, layout: r, data: i } = e, a = {
521
+ layout: r,
522
+ ...typeof i == "object" && i ? i : {}
523
+ };
524
+ await t.send(H.sendVisualizeData, {
525
+ mimeType: n,
526
+ visualizerData: a
527
+ });
528
+ }
529
+ n && c("ready");
521
530
  })().catch(() => {
522
- n && o("error");
531
+ n && c("error");
523
532
  }), () => {
524
533
  n = !1, t.destroy();
525
534
  };
526
535
  }, [
527
- s,
528
- c,
529
- l
530
- ]), /* @__PURE__ */ z("div", {
536
+ l,
537
+ u,
538
+ d
539
+ ]), P(() => {
540
+ let e = r ?? u.trim();
541
+ e !== "" && o.current?.querySelector("iframe")?.setAttribute("title", e);
542
+ }, [
543
+ r,
544
+ u,
545
+ l,
546
+ d
547
+ ]), /* @__PURE__ */ B("div", {
531
548
  className: "relative h-full w-full",
532
549
  style: m({
533
- "--vs-loading-bg": r?.loadingBackground,
534
- "--vs-status-text": r?.statusText,
535
- "--vs-error-icon": r?.errorIcon
550
+ "--vs-loading-bg": a?.loadingBackground,
551
+ "--vs-status-text": a?.statusText,
552
+ "--vs-error-icon": a?.errorIcon
536
553
  }),
537
554
  children: [
538
- /* @__PURE__ */ R("div", {
539
- ref: i,
555
+ /* @__PURE__ */ z("div", {
556
+ ref: o,
540
557
  className: "h-full w-full"
541
558
  }),
542
- a === "loading" && /* @__PURE__ */ z("div", {
543
- className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", De.loadingOverlay),
544
- children: [/* @__PURE__ */ R(T, {}), t && /* @__PURE__ */ R("p", {
545
- className: g("text-center", De.statusLabel),
559
+ s === "loading" && /* @__PURE__ */ B("div", {
560
+ className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", je.loadingOverlay),
561
+ children: [/* @__PURE__ */ z(E, {}), t && /* @__PURE__ */ z("p", {
562
+ className: g("text-center", je.statusLabel),
546
563
  children: t
547
564
  })]
548
565
  }),
549
- a === "error" && /* @__PURE__ */ z("div", {
566
+ s === "error" && /* @__PURE__ */ B("div", {
550
567
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
551
- children: [/* @__PURE__ */ R(E, {
568
+ children: [/* @__PURE__ */ z(D, {
552
569
  size: 60,
553
570
  stroke: S,
554
571
  "aria-hidden": !0,
555
- className: De.errorIcon
556
- }), /* @__PURE__ */ R("p", {
572
+ className: je.errorIcon
573
+ }), /* @__PURE__ */ z("p", {
557
574
  role: "alert",
558
- className: g("text-center", De.statusLabel),
575
+ className: g("text-center", je.statusLabel),
559
576
  children: n
560
577
  })]
561
578
  })
562
579
  ]
563
580
  });
564
- }, K = {
581
+ }, G = {
565
582
  body: "_body_13ogb_4",
566
583
  statusLabel: "_statusLabel_13ogb_13",
567
584
  errorIcon: "_errorIcon_13ogb_17",
@@ -576,66 +593,66 @@ var de = {
576
593
  jsonExpandIcon: "_jsonExpandIcon_13ogb_54",
577
594
  jsonCollapseIcon: "_jsonCollapseIcon_13ogb_67",
578
595
  jsonCollapsedContent: "_jsonCollapsedContent_13ogb_84"
579
- }, ke = () => A(async () => ({ default: (await import("./PdfContent-D71LPAe3.js")).PdfContent })), Ae = ({ url: e, fileName: t, loadErrorLabel: n }) => {
596
+ }, Ne = () => j(async () => ({ default: (await import("./PdfContent-BoAtghsO.js")).PdfContent })), Pe = ({ url: e, fileName: t, loadErrorLabel: n }) => {
580
597
  let [r, i] = L(!1);
581
598
  return P(() => {
582
599
  i(!1);
583
- }, [e]), r ? /* @__PURE__ */ z("div", {
600
+ }, [e]), r ? /* @__PURE__ */ B("div", {
584
601
  className: "flex flex-col items-center gap-2",
585
- children: [/* @__PURE__ */ R(E, {
602
+ children: [/* @__PURE__ */ z(D, {
586
603
  size: 60,
587
604
  stroke: S,
588
- className: K.errorIcon
589
- }), /* @__PURE__ */ R("p", {
590
- className: g("text-center", K.statusLabel),
605
+ className: G.errorIcon
606
+ }), /* @__PURE__ */ z("p", {
607
+ className: g("text-center", G.statusLabel),
591
608
  children: n
592
609
  })]
593
- }) : /* @__PURE__ */ R("img", {
610
+ }) : /* @__PURE__ */ z("img", {
594
611
  src: e,
595
612
  alt: t ?? "",
596
613
  className: "max-h-full max-w-full object-contain",
597
614
  onError: () => i(!0)
598
615
  });
599
- }, je = new Set([
616
+ }, Fe = new Set([
600
617
  i.PlainText,
601
618
  i.Code,
602
619
  i.Ooxml
603
- ]), Me = j(({ 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: _, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: C, pdfContentRetryLabel: w, xlsxFormulaLabel: D = "Formula", codeContentLoadingLabel: O, codeContentErrorLabel: k, codeContentRetryLabel: ee, tableCopyCsvLabel: te, tableCopyTxtLabel: re, tableCopyMarkdownLabel: ie, tableCopiedLabel: ae, tableDownloadCsvLabel: A, ooxmlHighlightsLabel: j, ooxmlHighlightNavigatedLabel: N } = {}, styles: P, codeBlockTheme: I, tableDownloadFilename: ce, loadPdf: B, hidePdfToolbar: le = !1, configurePdfWorker: ue }) => {
604
- let { colors: V, typography: H, bodyClassName: de, cssVars: fe } = P ?? {}, [pe, he] = L(0), _e = F(ke, [pe]), ve = M(() => {
605
- he((e) => e + 1);
606
- }, []), U = H?.fontClassName != null, ye = F(() => ({
620
+ ]), Ie = M(({ 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: _, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: C, pdfContentRetryLabel: w, xlsxFormulaLabel: T = "Formula", codeContentLoadingLabel: O, codeContentErrorLabel: k, codeContentRetryLabel: ee, tableCopyLabel: te, tableCopiedLabel: ne, tableDownloadCsvLabel: re, ooxmlHighlightsLabel: ae, ooxmlHighlightNavigatedLabel: oe } = {}, styles: A, codeBlockTheme: j, tableDownloadFilename: M, loadPdf: se, hidePdfToolbar: P = !1, configurePdfWorker: I }) => {
621
+ let { colors: R, typography: V, bodyClassName: ue, cssVars: de } = A ?? {}, [H, fe] = L(0), pe = F(Ne, [H]), me = N(() => {
622
+ fe((e) => e + 1);
623
+ }, []), U = V?.fontClassName != null, he = F(() => ({
607
624
  ...m({
608
- "--ac-text": V?.text,
609
- "--ac-status-text": V?.statusText,
610
- "--ac-error-icon": V?.errorIcon,
611
- "--ac-open-in-new-tab-text": V?.openInNewTabText,
612
- "--ac-json-border": V?.jsonBorder,
613
- "--ac-json-bg": V?.jsonBackground,
614
- "--ac-json-label": V?.jsonLabel,
615
- "--ac-json-clickable-label": V?.jsonClickableLabel,
616
- "--ac-json-punctuation": V?.jsonPunctuation,
617
- "--ac-json-string": V?.jsonString,
618
- "--ac-json-number": V?.jsonNumber,
619
- "--ac-json-boolean": V?.jsonBoolean,
620
- "--ac-json-null": V?.jsonNull,
621
- "--ac-json-toggle-icon": V?.jsonToggleIcon,
622
- "--ac-json-toggle-icon-hover": V?.jsonToggleIconHover,
623
- "--ac-ooxml-bg": V?.ooxmlBackground,
624
- "--ac-ooxml-formula-border": V?.ooxmlFormulaBorder,
625
- "--ac-ooxml-formula-bg": V?.ooxmlFormulaBackground,
626
- "--ac-ooxml-formula-text": V?.ooxmlFormulaText,
627
- "--ac-ooxml-highlight-border": V?.ooxmlHighlightBorder,
628
- "--ac-ooxml-highlight-bg": V?.ooxmlHighlightBackground,
629
- "--ac-json-collapsed-text": V?.jsonCollapsedText,
630
- "--ac-json-collapsed-bg": V?.jsonCollapsedBackground,
631
- "--ac-font-family": U ? void 0 : H?.fontFamily,
632
- "--ac-font-size": U ? void 0 : H?.fontSize,
633
- "--ac-font-weight": U ? void 0 : H?.fontWeight,
634
- "--ac-line-height": U ? void 0 : H?.lineHeight,
635
- "--ac-letter-spacing": U ? void 0 : H?.letterSpacing
625
+ "--ac-text": R?.text,
626
+ "--ac-status-text": R?.statusText,
627
+ "--ac-error-icon": R?.errorIcon,
628
+ "--ac-open-in-new-tab-text": R?.openInNewTabText,
629
+ "--ac-json-border": R?.jsonBorder,
630
+ "--ac-json-bg": R?.jsonBackground,
631
+ "--ac-json-label": R?.jsonLabel,
632
+ "--ac-json-clickable-label": R?.jsonClickableLabel,
633
+ "--ac-json-punctuation": R?.jsonPunctuation,
634
+ "--ac-json-string": R?.jsonString,
635
+ "--ac-json-number": R?.jsonNumber,
636
+ "--ac-json-boolean": R?.jsonBoolean,
637
+ "--ac-json-null": R?.jsonNull,
638
+ "--ac-json-toggle-icon": R?.jsonToggleIcon,
639
+ "--ac-json-toggle-icon-hover": R?.jsonToggleIconHover,
640
+ "--ac-ooxml-bg": R?.ooxmlBackground,
641
+ "--ac-ooxml-formula-border": R?.ooxmlFormulaBorder,
642
+ "--ac-ooxml-formula-bg": R?.ooxmlFormulaBackground,
643
+ "--ac-ooxml-formula-text": R?.ooxmlFormulaText,
644
+ "--ac-ooxml-highlight-border": R?.ooxmlHighlightBorder,
645
+ "--ac-ooxml-highlight-bg": R?.ooxmlHighlightBackground,
646
+ "--ac-json-collapsed-text": R?.jsonCollapsedText,
647
+ "--ac-json-collapsed-bg": R?.jsonCollapsedBackground,
648
+ "--ac-font-family": U ? void 0 : V?.fontFamily,
649
+ "--ac-font-size": U ? void 0 : V?.fontSize,
650
+ "--ac-font-weight": U ? void 0 : V?.fontWeight,
651
+ "--ac-line-height": U ? void 0 : V?.lineHeight,
652
+ "--ac-letter-spacing": U ? void 0 : V?.letterSpacing
636
653
  }),
637
- ...fe
638
- }), [P]), be = F(() => {
654
+ ...de
655
+ }), [A]), _e = F(() => {
639
656
  switch (e.type) {
640
657
  case i.Image:
641
658
  case i.Audio:
@@ -645,6 +662,7 @@ var de = {
645
662
  case i.Pdf:
646
663
  case i.Ooxml:
647
664
  case i.Visualizer:
665
+ case i.GroupedVisualizer:
648
666
  case i.McpApp:
649
667
  case i.Code:
650
668
  case i.Html: return "h-full overflow-hidden";
@@ -652,38 +670,38 @@ var de = {
652
670
  case i.MarkdownTable: return "flex h-full min-h-0 flex-col overflow-hidden p-4";
653
671
  default: return "h-full overflow-auto p-4";
654
672
  }
655
- }, [e.type]), W = F(() => {
673
+ }, [e.type]), ye = F(() => {
656
674
  switch (e.type) {
657
- case i.PlainText: return /* @__PURE__ */ R("pre", {
658
- className: g("whitespace-pre-wrap break-words", K.body, H?.fontClassName),
675
+ case i.PlainText: return /* @__PURE__ */ z("pre", {
676
+ className: g("whitespace-pre-wrap break-words", G.body, V?.fontClassName),
659
677
  children: e.text
660
678
  });
661
- case i.Image: return /* @__PURE__ */ R(Ae, {
679
+ case i.Image: return /* @__PURE__ */ z(Pe, {
662
680
  url: e.url,
663
681
  fileName: r,
664
682
  loadErrorLabel: c
665
683
  });
666
- case i.Audio: return /* @__PURE__ */ R("audio", {
684
+ case i.Audio: return /* @__PURE__ */ z("audio", {
667
685
  controls: !0,
668
686
  src: e.url,
669
687
  "aria-label": r ?? "Audio attachment",
670
688
  className: "w-full max-w-sm",
671
689
  preload: "metadata",
672
- children: e.mimeType && /* @__PURE__ */ R("source", {
690
+ children: e.mimeType && /* @__PURE__ */ z("source", {
673
691
  src: e.url,
674
692
  type: e.mimeType
675
693
  })
676
694
  });
677
- case i.Markdown: return /* @__PURE__ */ R(p, {
695
+ case i.Markdown: return /* @__PURE__ */ z(p, {
678
696
  content: e.text,
679
697
  isStreaming: !1,
680
- codeBlockTheme: I,
698
+ codeBlockTheme: j,
681
699
  classNames: u
682
700
  });
683
- case i.MarkdownTable: return /* @__PURE__ */ R(p, {
701
+ case i.MarkdownTable: return /* @__PURE__ */ z(p, {
684
702
  content: e.text,
685
703
  isStreaming: !1,
686
- codeBlockTheme: I,
704
+ codeBlockTheme: j,
687
705
  containerClassName: "flex h-full min-h-0 flex-col",
688
706
  classNames: {
689
707
  ...u,
@@ -691,51 +709,49 @@ var de = {
691
709
  tableScrollContainer: "max-h-full"
692
710
  },
693
711
  tableActionLabels: {
694
- copyCsvLabel: te,
695
- copyTxtLabel: re,
696
- copyMarkdownLabel: ie,
697
- copiedLabel: ae,
698
- downloadCsvLabel: A
712
+ copyLabel: te,
713
+ copiedLabel: ne,
714
+ downloadCsvLabel: re
699
715
  },
700
- tableDownloadFilename: ce
716
+ tableDownloadFilename: M
701
717
  });
702
- case i.Json: return /* @__PURE__ */ R("div", {
718
+ case i.Json: return /* @__PURE__ */ z("div", {
703
719
  dir: "ltr",
704
720
  className: "h-full overflow-auto",
705
- children: /* @__PURE__ */ R("div", {
706
- className: g("m-3 overflow-auto rounded-md border", K.jsonWrapper),
707
- children: /* @__PURE__ */ R(oe, {
721
+ children: /* @__PURE__ */ z("div", {
722
+ className: g("m-3 overflow-auto rounded-md border", G.jsonWrapper),
723
+ children: /* @__PURE__ */ z(ce, {
708
724
  data: e.value,
709
725
  style: {
710
- container: g("whitespace-pre-wrap break-words p-2", H?.jsonClassName ?? "dial-code-text"),
711
- basicChildStyle: se.basicChildStyle,
726
+ container: g("whitespace-pre-wrap break-words p-2", V?.jsonClassName ?? "dial-code-text"),
727
+ basicChildStyle: le.basicChildStyle,
712
728
  childFieldsContainer: "m-0 ps-3",
713
- label: g("me-1 font-semibold", K.jsonLabel),
714
- clickableLabel: g("me-1 cursor-pointer font-semibold hover:underline", K.jsonClickableLabel),
715
- nullValue: g("italic", K.jsonNullValue),
716
- undefinedValue: g("italic", K.jsonNullValue),
717
- stringValue: K.jsonStringValue,
718
- booleanValue: K.jsonBooleanValue,
719
- numberValue: K.jsonNumberValue,
720
- otherValue: g("italic", K.jsonNullValue),
721
- punctuation: g("me-1", K.jsonPunctuation),
722
- collapseIcon: g("me-1 cursor-pointer select-none transition-colors", K.jsonCollapseIcon),
723
- expandIcon: g("me-1 cursor-pointer select-none transition-colors", K.jsonExpandIcon),
724
- collapsedContent: g("me-1 cursor-pointer rounded px-1", K.jsonCollapsedContent)
729
+ label: g("me-1 font-semibold", G.jsonLabel),
730
+ clickableLabel: g("me-1 cursor-pointer font-semibold hover:underline", G.jsonClickableLabel),
731
+ nullValue: g("italic", G.jsonNullValue),
732
+ undefinedValue: g("italic", G.jsonNullValue),
733
+ stringValue: G.jsonStringValue,
734
+ booleanValue: G.jsonBooleanValue,
735
+ numberValue: G.jsonNumberValue,
736
+ otherValue: g("italic", G.jsonNullValue),
737
+ punctuation: g("me-1", G.jsonPunctuation),
738
+ collapseIcon: g("me-1 cursor-pointer select-none transition-colors", G.jsonCollapseIcon),
739
+ expandIcon: g("me-1 cursor-pointer select-none transition-colors", G.jsonExpandIcon),
740
+ collapsedContent: g("me-1 cursor-pointer rounded px-1", G.jsonCollapsedContent)
725
741
  }
726
742
  })
727
743
  })
728
744
  });
729
- case i.Code: return /* @__PURE__ */ R(me, {
745
+ case i.Code: return /* @__PURE__ */ z(ge, {
730
746
  content: e,
731
- codeBlockTheme: I,
747
+ codeBlockTheme: j,
732
748
  labels: {
733
749
  loadingLabel: O,
734
750
  errorLabel: k,
735
751
  retryLabel: ee
736
752
  }
737
753
  });
738
- case i.Html: return /* @__PURE__ */ R(ge, {
754
+ case i.Html: return /* @__PURE__ */ z(ve, {
739
755
  content: e,
740
756
  labels: {
741
757
  htmlFrameBlockedLabel: f,
@@ -743,25 +759,25 @@ var de = {
743
759
  },
744
760
  isSourceView: a,
745
761
  title: r,
746
- codeBlockTheme: I
762
+ codeBlockTheme: j
747
763
  });
748
- case i.Pdf: return /* @__PURE__ */ R(s, {
749
- retryKey: pe,
750
- onRetry: ve,
764
+ case i.Pdf: return /* @__PURE__ */ z(s, {
765
+ retryKey: H,
766
+ onRetry: me,
751
767
  labels: {
752
768
  loadingLabel: x,
753
769
  errorLabel: C,
754
770
  retryLabel: w
755
771
  },
756
- children: /* @__PURE__ */ R(_e, {
772
+ children: /* @__PURE__ */ z(pe, {
757
773
  fileName: r,
758
774
  url: e.url,
759
775
  highlights: e.highlights ?? [],
760
776
  selectedHighlightId: e.selectedHighlightId,
761
777
  selectedPageNumber: e.page,
762
- loadPdf: B,
763
- hideHeader: le,
764
- configurePdfWorker: ue,
778
+ loadPdf: se,
779
+ hideHeader: P,
780
+ configurePdfWorker: I,
765
781
  labels: {
766
782
  thumbnailsLabel: _,
767
783
  showThumbnailsLabel: v,
@@ -773,34 +789,35 @@ var de = {
773
789
  }
774
790
  })
775
791
  }, e.url);
776
- case i.Ooxml: return /* @__PURE__ */ R(Ee, {
792
+ case i.Ooxml: return /* @__PURE__ */ z(Ae, {
777
793
  content: e,
778
794
  fileName: r,
779
795
  loadErrorLabel: c,
780
- formulaLabel: D,
781
- formulaLabelClassName: H?.xlsxFormulaLabelClassName ?? "dial-italic-text",
782
- highlightsLabel: j,
783
- highlightNavigatedLabel: N
796
+ formulaLabel: T,
797
+ formulaLabelClassName: V?.xlsxFormulaLabelClassName ?? "dial-italic-text",
798
+ highlightsLabel: ae,
799
+ highlightNavigatedLabel: oe
784
800
  });
785
- case i.Visualizer: return /* @__PURE__ */ R(Oe, {
801
+ case i.Visualizer:
802
+ case i.GroupedVisualizer: return /* @__PURE__ */ z(Me, {
786
803
  content: e,
787
804
  errorLabel: d
788
805
  });
789
- case i.McpApp: return /* @__PURE__ */ R(xe, { content: e });
790
- case i.Unsupported: return /* @__PURE__ */ R("p", {
791
- className: g("text-center", K.statusLabel),
806
+ case i.McpApp: return /* @__PURE__ */ z(Te, { content: e });
807
+ case i.Unsupported: return /* @__PURE__ */ z("p", {
808
+ className: g("text-center", G.statusLabel),
792
809
  children: o
793
810
  });
794
811
  case i.Error: {
795
812
  let t = e.errorType === n.Forbidden;
796
- return /* @__PURE__ */ z("div", {
813
+ return /* @__PURE__ */ B("div", {
797
814
  className: "flex flex-col items-center gap-2",
798
- children: [R(t ? ne : E, {
815
+ children: [z(t ? ie : D, {
799
816
  size: 60,
800
817
  stroke: S,
801
- className: K.errorIcon
802
- }), /* @__PURE__ */ R("p", {
803
- className: g("text-center", K.statusLabel),
818
+ className: G.errorIcon
819
+ }), /* @__PURE__ */ z("p", {
820
+ className: g("text-center", G.statusLabel),
804
821
  children: t ? l : c
805
822
  })]
806
823
  });
@@ -808,11 +825,11 @@ var de = {
808
825
  }
809
826
  }, [
810
827
  e,
811
- H?.fontClassName,
812
- H?.jsonClassName,
813
- H?.xlsxFormulaLabelClassName,
828
+ V?.fontClassName,
829
+ V?.jsonClassName,
830
+ V?.xlsxFormulaLabelClassName,
814
831
  r,
815
- I,
832
+ j,
816
833
  o,
817
834
  c,
818
835
  l,
@@ -820,10 +837,10 @@ var de = {
820
837
  f,
821
838
  h,
822
839
  a,
823
- ce,
824
- B,
825
- le,
826
- ue,
840
+ M,
841
+ se,
842
+ P,
843
+ I,
827
844
  _,
828
845
  v,
829
846
  y,
@@ -831,45 +848,43 @@ var de = {
831
848
  x,
832
849
  C,
833
850
  w,
834
- D,
851
+ T,
835
852
  O,
836
853
  k,
837
854
  ee,
838
- _e,
839
855
  pe,
840
- ve,
856
+ H,
857
+ me,
841
858
  te,
859
+ ne,
842
860
  re,
843
- ie,
844
861
  ae,
845
- A,
846
- j,
847
- N
862
+ oe
848
863
  ]);
849
- return /* @__PURE__ */ R("div", {
850
- style: !t && je.has(e.type) ? ye : void 0,
851
- className: g(t ? "flex h-full items-center justify-center" : be, de),
852
- children: t ? /* @__PURE__ */ R(T, {}) : W
864
+ return /* @__PURE__ */ z("div", {
865
+ style: !t && Fe.has(e.type) ? he : void 0,
866
+ className: g(t ? "flex h-full items-center justify-center" : _e, ue),
867
+ children: t ? /* @__PURE__ */ z(E, {}) : ye
853
868
  });
854
- }), Ne = 2e3, Pe = j(({ isOpen: e, isLoading: t = !1, onClose: n, content: r, fileName: a, labels: { ariaLabel: s, closeLabel: c = "Close", resizeLabel: l = "Resize panel", downloadLabel: u = "Download", copyTextLabel: d = "Copy text", copiedTextLabel: f = "Copied!", copyMarkdownLabel: p = "Copy as Markdown", copiedMarkdownLabel: m = "Copied!", copyJsonLabel: h = "Copy as JSON", copiedJsonLabel: _ = "Copied!", visualizerErrorLabel: v, unsupportedLabel: w = "Preview is not supported for this file", loadErrorLabel: T = "Failed to load file", forbiddenErrorLabel: E = "You don't have permission to access this file", htmlFrameBlockedLabel: ne = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: ae = "Open in new tab", htmlViewSourceLabel: A = "View source", htmlViewRenderedLabel: j = "View rendered", mcpAppReloadLabel: N = "Reload", pdfThumbnailsLabel: F, pdfShowThumbnailsLabel: oe, pdfHideThumbnailsLabel: se, pdfPageNumberLabel: B, pdfContentLoadingLabel: le, pdfContentErrorLabel: ue, pdfContentRetryLabel: V, xlsxFormulaLabel: H, codeContentLoadingLabel: de, codeContentErrorLabel: fe, codeContentRetryLabel: pe, tableCopyCsvLabel: me, tableCopyTxtLabel: he, tableCopyMarkdownLabel: ge, tableCopiedLabel: _e, tableDownloadCsvLabel: ve, ooxmlHighlightsLabel: U, ooxmlHighlightNavigatedLabel: ye }, onDownload: be, onCopyText: W, onCopyMarkdown: xe, onCopyJson: G, tableDownloadFilename: Se, isMobile: Ce = !1, defaultWidth: we, minWidth: Te = 600, maxWidth: Ee = 1500, onResizeStop: De, styles: Oe, codeBlockTheme: K, loadPdf: ke, configurePdfWorker: Ae }) => {
855
- let [je, Pe] = L(!1), [Fe, Ie] = L(!1), [q, Le] = L(!1), [J, Re] = L(!1), Y = I(null), X = I(null), Z = I(null), ze = M(() => {
856
- W?.(), Y.current != null && clearTimeout(Y.current), Pe(!0), Y.current = setTimeout(() => Pe(!1), Ne);
857
- }, [W]), Be = M(() => {
858
- xe?.(), X.current != null && clearTimeout(X.current), Ie(!0), X.current = setTimeout(() => Ie(!1), Ne);
859
- }, [xe]), Ve = M(() => {
860
- G?.(), Z.current != null && clearTimeout(Z.current), Le(!0), Z.current = setTimeout(() => Le(!1), Ne);
861
- }, [G]);
869
+ }), Le = 2e3, Re = M(({ isOpen: e, isLoading: t = !1, onClose: n, content: r, fileName: a, labels: { ariaLabel: s, closeLabel: c = "Close", resizeLabel: l = "Resize panel", downloadLabel: u = "Download", copyTextLabel: d = "Copy text", copiedTextLabel: f = "Copied!", copyMarkdownLabel: p = "Copy as Markdown", copiedMarkdownLabel: m = "Copied!", copyJsonLabel: h = "Copy as JSON", copiedJsonLabel: _ = "Copied!", visualizerErrorLabel: v, unsupportedLabel: C = "Preview is not supported for this file", loadErrorLabel: T = "Failed to load file", forbiddenErrorLabel: E = "You don't have permission to access this file", htmlFrameBlockedLabel: D = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: O = "Open in new tab", htmlViewSourceLabel: ie = "View source", htmlViewRenderedLabel: A = "View rendered", mcpAppReloadLabel: j = "Reload", pdfThumbnailsLabel: M, pdfShowThumbnailsLabel: se, pdfHideThumbnailsLabel: F, pdfPageNumberLabel: ce, pdfContentLoadingLabel: le, pdfContentErrorLabel: V, pdfContentRetryLabel: ue, xlsxFormulaLabel: de, codeContentLoadingLabel: H, codeContentErrorLabel: fe, codeContentRetryLabel: me, tableCopyLabel: U, tableCopiedLabel: he, tableDownloadCsvLabel: ge, ooxmlHighlightsLabel: _e, ooxmlHighlightNavigatedLabel: ve }, onDownload: ye, onCopyText: be, onCopyMarkdown: xe, onCopyJson: Se, tableDownloadFilename: Ce, isMobile: we = !1, defaultWidth: Te, minWidth: W = 600, maxWidth: Ee = 1500, onResizeStop: De, styles: Oe, codeBlockTheme: ke, loadPdf: Ae, configurePdfWorker: je }) => {
870
+ let [Me, G] = L(!1), [Ne, Pe] = L(!1), [Fe, Re] = L(!1), [K, q] = L(!1), J = I(null), Y = I(null), X = I(null), ze = N(() => {
871
+ be?.(), J.current != null && clearTimeout(J.current), G(!0), J.current = setTimeout(() => G(!1), Le);
872
+ }, [be]), Z = N(() => {
873
+ xe?.(), Y.current != null && clearTimeout(Y.current), Pe(!0), Y.current = setTimeout(() => Pe(!1), Le);
874
+ }, [xe]), Be = N(() => {
875
+ Se?.(), X.current != null && clearTimeout(X.current), Re(!0), X.current = setTimeout(() => Re(!1), Le);
876
+ }, [Se]);
862
877
  P(() => () => {
863
- Y.current != null && clearTimeout(Y.current), X.current != null && clearTimeout(X.current), Z.current != null && clearTimeout(Z.current);
878
+ J.current != null && clearTimeout(J.current), Y.current != null && clearTimeout(Y.current), X.current != null && clearTimeout(X.current);
864
879
  }, []);
865
- let Q = M(() => {
866
- Re((e) => !e);
880
+ let Ve = N(() => {
881
+ q((e) => !e);
867
882
  }, []);
868
883
  P(() => {
869
- Re(!1);
884
+ q(!1);
870
885
  }, [r]);
871
- let { className: He, panelStyles: Ue, ...We } = Oe ?? {}, Ge = !t && r.type === i.Html && r.srcdoc != null, Ke = !t && W != null && (r.type === i.PlainText || r.type === i.Code), qe = !t && xe != null && r.type === i.Markdown, $ = !t && G != null && r.type === i.Json, Je = !t && be != null && o(r), Ye = !t && r.type === i.McpApp && r.onReload != null;
872
- return /* @__PURE__ */ R(b, {
886
+ let { className: He, panelStyles: Q, ...Ue } = Oe ?? {}, We = !t && r.type === i.Html && r.srcdoc != null, $ = !t && be != null && (r.type === i.PlainText || r.type === i.Code), Ge = !t && xe != null && r.type === i.Markdown, Ke = !t && Se != null && r.type === i.Json, qe = !t && ye != null && o(r), Je = !t && r.type === i.McpApp && r.onReload != null;
887
+ return /* @__PURE__ */ z(b, {
873
888
  isOpen: e,
874
889
  orientation: y.Right,
875
890
  title: a,
@@ -879,261 +894,152 @@ var de = {
879
894
  resizeLabel: l
880
895
  },
881
896
  onClose: n,
882
- resizable: !Ce,
883
- defaultWidth: we,
884
- minWidth: Te,
897
+ resizable: !we,
898
+ defaultWidth: Te,
899
+ minWidth: W,
885
900
  maxWidth: Ee,
886
901
  onResizeStop: De,
887
902
  styles: {
888
- ...Ue,
889
- titleClassName: Ue?.titleClassName ?? "dial-h3-text",
890
- headerClassName: g("border-b border-tertiary", Ue?.headerClassName),
891
- className: g(e ? "mobile:w-full mobile:max-w-full" : "w-0", He, Ue?.className)
903
+ ...Q,
904
+ titleClassName: Q?.titleClassName ?? "dial-h3-text",
905
+ headerClassName: g("border-b border-tertiary", Q?.headerClassName),
906
+ className: g(e ? "mobile:w-full mobile:max-w-full" : "w-0", He, Q?.className, pe.panel)
892
907
  },
893
- rightActions: Ge || Ke || qe || $ || Je || Ye ? /* @__PURE__ */ z(ce, { children: [
894
- Ye && /* @__PURE__ */ R(C, {
895
- icon: /* @__PURE__ */ R(ie, {
908
+ rightActions: We || $ || Ge || Ke || qe || Je ? /* @__PURE__ */ B(R, { children: [
909
+ Je && /* @__PURE__ */ z(w, {
910
+ icon: /* @__PURE__ */ z(oe, {
896
911
  size: x.LG,
897
912
  stroke: S,
898
913
  "aria-hidden": !0
899
914
  }),
900
- "aria-label": N,
901
- tooltipProps: { tooltip: N },
915
+ "aria-label": j,
916
+ tooltipProps: { tooltip: j },
902
917
  onClick: r.type === i.McpApp ? r.onReload : void 0
903
918
  }),
904
- Ge && /* @__PURE__ */ R(C, {
905
- icon: R(J ? te : O, {
919
+ We && /* @__PURE__ */ z(w, {
920
+ icon: z(K ? re : ee, {
906
921
  size: x.LG,
907
922
  stroke: S,
908
923
  "aria-hidden": !0
909
924
  }),
910
- "aria-label": J ? j : A,
911
- "aria-pressed": J,
912
- tooltipProps: { tooltip: J ? j : A },
913
- onClick: Q
925
+ "aria-label": K ? A : ie,
926
+ "aria-pressed": K,
927
+ tooltipProps: { tooltip: K ? A : ie },
928
+ onClick: Ve
914
929
  }),
915
- Ke && /* @__PURE__ */ R(C, {
916
- icon: R(je ? D : k, {
930
+ $ && /* @__PURE__ */ z(w, {
931
+ icon: z(Me ? k : te, {
917
932
  size: x.LG,
918
933
  stroke: S,
919
934
  "aria-hidden": !0
920
935
  }),
921
- "aria-label": je ? f : d,
922
- tooltipProps: { tooltip: je ? f : d },
936
+ "aria-label": Me ? f : d,
937
+ tooltipProps: { tooltip: Me ? f : d },
923
938
  onClick: ze
924
939
  }),
925
- qe && /* @__PURE__ */ R(C, {
926
- icon: R(Fe ? D : re, {
940
+ Ge && /* @__PURE__ */ z(w, {
941
+ icon: z(Ne ? k : ae, {
927
942
  size: x.LG,
928
943
  stroke: S,
929
944
  "aria-hidden": !0
930
945
  }),
931
- "aria-label": Fe ? m : p,
932
- tooltipProps: { tooltip: Fe ? m : p },
933
- onClick: Be
946
+ "aria-label": Ne ? m : p,
947
+ tooltipProps: { tooltip: Ne ? m : p },
948
+ onClick: Z
934
949
  }),
935
- $ && /* @__PURE__ */ R(C, {
936
- icon: R(q ? D : k, {
950
+ Ke && /* @__PURE__ */ z(w, {
951
+ icon: z(Fe ? k : te, {
937
952
  size: x.LG,
938
953
  stroke: S,
939
954
  "aria-hidden": !0
940
955
  }),
941
- "aria-label": q ? _ : h,
942
- tooltipProps: { tooltip: q ? _ : h },
943
- onClick: Ve
956
+ "aria-label": Fe ? _ : h,
957
+ tooltipProps: { tooltip: Fe ? _ : h },
958
+ onClick: Be
944
959
  }),
945
- Je && /* @__PURE__ */ R(C, {
946
- icon: /* @__PURE__ */ R(ee, {
960
+ qe && /* @__PURE__ */ z(w, {
961
+ icon: /* @__PURE__ */ z(ne, {
947
962
  size: x.LG,
948
963
  stroke: S
949
964
  }),
950
965
  "aria-label": u,
951
966
  tooltipProps: { tooltip: u },
952
- onClick: be
967
+ onClick: ye
953
968
  })
954
969
  ] }) : null,
955
- children: /* @__PURE__ */ R(Me, {
970
+ children: /* @__PURE__ */ z(Ie, {
956
971
  content: r,
957
972
  isLoading: t,
958
973
  fileName: a,
959
- isHtmlSourceView: J,
974
+ isHtmlSourceView: K,
960
975
  labels: {
961
- unsupportedLabel: w,
976
+ unsupportedLabel: C,
962
977
  loadErrorLabel: T,
963
978
  forbiddenErrorLabel: E,
964
979
  visualizerErrorLabel: v,
965
- htmlFrameBlockedLabel: ne,
966
- htmlOpenInNewTabLabel: ae,
967
- pdfThumbnailsLabel: F,
968
- pdfShowThumbnailsLabel: oe,
969
- pdfHideThumbnailsLabel: se,
970
- pdfPageNumberLabel: B,
980
+ htmlFrameBlockedLabel: D,
981
+ htmlOpenInNewTabLabel: O,
982
+ pdfThumbnailsLabel: M,
983
+ pdfShowThumbnailsLabel: se,
984
+ pdfHideThumbnailsLabel: F,
985
+ pdfPageNumberLabel: ce,
971
986
  pdfContentLoadingLabel: le,
972
- pdfContentErrorLabel: ue,
973
- pdfContentRetryLabel: V,
974
- xlsxFormulaLabel: H,
975
- codeContentLoadingLabel: de,
987
+ pdfContentErrorLabel: V,
988
+ pdfContentRetryLabel: ue,
989
+ xlsxFormulaLabel: de,
990
+ codeContentLoadingLabel: H,
976
991
  codeContentErrorLabel: fe,
977
- codeContentRetryLabel: pe,
978
- tableCopyCsvLabel: me,
979
- tableCopyTxtLabel: he,
980
- tableCopyMarkdownLabel: ge,
981
- tableCopiedLabel: _e,
982
- tableDownloadCsvLabel: ve,
983
- ooxmlHighlightsLabel: U,
984
- ooxmlHighlightNavigatedLabel: ye
992
+ codeContentRetryLabel: me,
993
+ tableCopyLabel: U,
994
+ tableCopiedLabel: he,
995
+ tableDownloadCsvLabel: ge,
996
+ ooxmlHighlightsLabel: _e,
997
+ ooxmlHighlightNavigatedLabel: ve
985
998
  },
986
- styles: We,
987
- codeBlockTheme: K,
988
- tableDownloadFilename: Se,
989
- loadPdf: ke,
990
- configurePdfWorker: Ae
999
+ styles: Ue,
1000
+ codeBlockTheme: ke,
1001
+ tableDownloadFilename: Ce,
1002
+ loadPdf: Ae,
1003
+ configurePdfWorker: je
991
1004
  })
992
1005
  });
993
- }), Fe = {
994
- type: i.PlainText,
995
- text: ""
996
- }, Ie = (e) => {
997
- 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;
998
- }, q = ae(void 0);
999
- q.displayName = "AttachmentCanvasContext";
1000
- var Le = ({ children: e }) => {
1001
- let [t, n] = L(!1), [r, i] = L(!1), [a, o] = L(Fe), [s, c] = L(void 0), [l, u] = L(void 0), d = M((e, t) => {
1002
- c(e), u(t), i(!0), n(!0);
1003
- }, []), f = M((e, t, r) => {
1004
- o(e), c(t), u(r), i(!1), n(!0);
1005
- }, []), p = M(() => {
1006
- o(Fe), n(!1), i(!1), u(void 0);
1007
- }, []);
1008
- return P(() => () => {
1009
- let e = Ie(a);
1010
- e != null && URL.revokeObjectURL(e);
1011
- }, [a]), /* @__PURE__ */ R(q.Provider, {
1012
- value: F(() => ({
1013
- isOpen: t,
1014
- isLoading: r,
1015
- content: a,
1016
- fileName: s,
1017
- attachmentId: l,
1018
- openCanvasLoading: d,
1019
- openCanvas: f,
1020
- closeCanvas: p
1021
- }), [
1022
- t,
1023
- r,
1024
- a,
1025
- s,
1026
- l,
1027
- d,
1028
- f,
1029
- p
1030
- ]),
1031
- children: e
1032
- });
1033
- }, J = () => {
1034
- let e = N(q);
1035
- if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
1036
- return e;
1037
- }, Re = j(({ labels: e, isMobile: t = !1, defaultWidth: n, maxWidth: r, codeBlockTheme: o, tableDownloadFilename: s, configurePdfWorker: c }) => {
1038
- let { ariaLabel: l = "Attachment preview", closeLabel: u = "Close", downloadLabel: d = "Download", unsupportedLabel: f = "Preview is not supported for this file", loadErrorLabel: p = "Failed to load file", forbiddenErrorLabel: m = "You don't have permission to access this file", copyTextLabel: g, copiedTextLabel: _, copyMarkdownLabel: v, copiedMarkdownLabel: y, copyJsonLabel: b, copiedJsonLabel: x, htmlFrameBlockedLabel: S, htmlOpenInNewTabLabel: C, htmlViewSourceLabel: w, htmlViewRenderedLabel: T, pdfThumbnailsLabel: E, pdfShowThumbnailsLabel: D, pdfHideThumbnailsLabel: O, pdfPageNumberLabel: k, pdfContentLoadingLabel: ee, pdfContentErrorLabel: te, pdfContentRetryLabel: ne, xlsxFormulaLabel: re, codeContentLoadingLabel: ie, codeContentErrorLabel: ae, codeContentRetryLabel: A, tableCopyCsvLabel: j, tableCopyTxtLabel: N, tableCopyMarkdownLabel: P, tableCopiedLabel: F, tableDownloadCsvLabel: I, ooxmlHighlightsLabel: L, ooxmlHighlightNavigatedLabel: oe } = e ?? {}, { isOpen: se, isLoading: ce, content: z, fileName: B, closeCanvas: le } = J(), ue = M(() => {
1039
- a(z, B);
1040
- }, [z, B]), V = M(() => {
1041
- (z.type === i.PlainText || z.type === i.Code) && h(z.text);
1042
- }, [z]), H = M(() => {
1043
- z.type === i.Markdown && h(z.text);
1044
- }, [z]), de = M(() => {
1045
- z.type === i.Json && h(JSON.stringify(z.value, null, 2));
1046
- }, [z]);
1047
- return /* @__PURE__ */ R(Pe, {
1048
- isOpen: se,
1049
- isLoading: ce,
1050
- onClose: le,
1051
- content: z,
1052
- fileName: B,
1053
- labels: {
1054
- ariaLabel: l,
1055
- closeLabel: u,
1056
- downloadLabel: d,
1057
- copyTextLabel: g,
1058
- copiedTextLabel: _,
1059
- copyMarkdownLabel: v,
1060
- copiedMarkdownLabel: y,
1061
- copyJsonLabel: b,
1062
- copiedJsonLabel: x,
1063
- unsupportedLabel: f,
1064
- loadErrorLabel: p,
1065
- forbiddenErrorLabel: m,
1066
- htmlFrameBlockedLabel: S,
1067
- htmlOpenInNewTabLabel: C,
1068
- htmlViewSourceLabel: w,
1069
- htmlViewRenderedLabel: T,
1070
- pdfThumbnailsLabel: E,
1071
- pdfShowThumbnailsLabel: D,
1072
- pdfHideThumbnailsLabel: O,
1073
- pdfPageNumberLabel: k,
1074
- pdfContentLoadingLabel: ee,
1075
- pdfContentErrorLabel: te,
1076
- pdfContentRetryLabel: ne,
1077
- xlsxFormulaLabel: re,
1078
- codeContentLoadingLabel: ie,
1079
- codeContentErrorLabel: ae,
1080
- codeContentRetryLabel: A,
1081
- tableCopyCsvLabel: j,
1082
- tableCopyTxtLabel: N,
1083
- tableCopyMarkdownLabel: P,
1084
- tableCopiedLabel: F,
1085
- tableDownloadCsvLabel: I,
1086
- ooxmlHighlightsLabel: L,
1087
- ooxmlHighlightNavigatedLabel: oe
1088
- },
1089
- onDownload: ue,
1090
- onCopyText: z.type === i.PlainText || z.type === i.Code ? V : void 0,
1091
- onCopyMarkdown: z.type === i.Markdown ? H : void 0,
1092
- onCopyJson: z.type === i.Json ? de : void 0,
1093
- tableDownloadFilename: s,
1094
- isMobile: t,
1095
- defaultWidth: n,
1096
- maxWidth: r,
1097
- codeBlockTheme: o,
1098
- configurePdfWorker: c
1099
- });
1100
- }), Y = new Set(["html", "htm"]), X = {
1006
+ }), K = new Set(["html", "htm"]), q = {
1101
1007
  docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
1102
1008
  xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
1103
1009
  pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
1104
- }, Z = 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(".")), ze = {
1010
+ }, J = 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(".")), Y = {
1105
1011
  docx: r.Docx,
1106
1012
  xlsx: r.Xlsx,
1107
1013
  pptx: r.Pptx,
1108
1014
  csv: r.Csv
1109
- }, Be = {
1110
- [X.docx]: r.Docx,
1111
- [X.xlsx]: r.Xlsx,
1112
- [X.pptx]: r.Pptx,
1015
+ }, X = {
1016
+ [q.docx]: r.Docx,
1017
+ [q.xlsx]: r.Xlsx,
1018
+ [q.pptx]: r.Pptx,
1113
1019
  [f.CSV]: r.Csv
1114
- }, Ve = {
1115
- [r.Docx]: X.docx,
1116
- [r.Xlsx]: X.xlsx,
1117
- [r.Pptx]: X.pptx,
1020
+ }, ze = {
1021
+ [r.Docx]: q.docx,
1022
+ [r.Xlsx]: q.xlsx,
1023
+ [r.Pptx]: q.pptx,
1118
1024
  [r.Csv]: f.CSV
1119
- }, Q = (e, t) => {
1025
+ }, Z = (e, t) => {
1120
1026
  let n = t?.split(";", 1)[0].trim().toLowerCase();
1121
1027
  if (n != null) {
1122
- let e = Be[n];
1028
+ let e = X[n];
1123
1029
  if (e != null) return e;
1124
1030
  }
1125
1031
  let r = e.lastIndexOf(".");
1126
- if (r !== -1) return ze[e.slice(r + 1).toLowerCase()];
1127
- }, He = (e, t) => Q(e, t) != null, Ue = (e, t) => {
1128
- let n = Q(e, t);
1129
- return n == null ? void 0 : Ve[n];
1130
- }, We = (e) => {
1032
+ if (r !== -1) return Y[e.slice(r + 1).toLowerCase()];
1033
+ }, Be = (e, t) => Z(e, t) != null, Ve = (e, t) => {
1034
+ let n = Z(e, t);
1035
+ return n == null ? void 0 : ze[n];
1036
+ }, He = (e) => {
1131
1037
  let t = e.lastIndexOf(".");
1132
- return t === -1 ? !1 : Z.has(e.slice(t + 1).toLowerCase());
1133
- }, Ge = (e) => {
1038
+ return t === -1 ? !1 : J.has(e.slice(t + 1).toLowerCase());
1039
+ }, Q = (e) => {
1134
1040
  let t = e.lastIndexOf(".");
1135
- return t === -1 ? !1 : Y.has(e.slice(t + 1).toLowerCase());
1136
- }, Ke = {
1041
+ return t === -1 ? !1 : K.has(e.slice(t + 1).toLowerCase());
1042
+ }, Ue = {
1137
1043
  xml: "xml",
1138
1044
  csv: "plaintext",
1139
1045
  tsv: "plaintext",
@@ -1181,21 +1087,187 @@ var Le = ({ children: e }) => {
1181
1087
  gitignore: "plaintext",
1182
1088
  dockerfile: "plaintext",
1183
1089
  makefile: "plaintext"
1184
- }, qe = (e) => Ke[e], $ = (e) => ({
1090
+ }, We = (e) => Ue[e], $ = (e) => ({
1185
1091
  type: i.Unsupported,
1186
1092
  ...e != null && { url: e }
1187
- }), Je = (e) => ({
1093
+ }), Ge = (e) => ({
1188
1094
  type: i.Error,
1189
1095
  errorType: n.LoadFailed,
1190
1096
  ...e != null && { url: e }
1191
- }), Ye = (e) => ({
1097
+ }), Ke = (e) => ({
1192
1098
  type: i.Error,
1193
1099
  errorType: n.Forbidden,
1194
1100
  ...e != null && { url: e }
1195
- }), Xe = (e, t) => {
1101
+ }), qe = (e) => {
1102
+ 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;
1103
+ }, Je = (e) => {
1104
+ let t = qe(e);
1105
+ t != null && URL.revokeObjectURL(t);
1106
+ }, Ye = {
1107
+ type: i.PlainText,
1108
+ text: ""
1109
+ }, Xe = A(void 0);
1110
+ Xe.displayName = "AttachmentCanvasContext";
1111
+ var Ze = ({ children: e }) => {
1112
+ let [t, n] = L(!1), [r, i] = L(!1), [a, o] = L(Ye), [s, c] = L(void 0), [l, u] = L(void 0), d = N((e, t) => {
1113
+ c(e), u(t), i(!0), n(!0);
1114
+ }, []), f = N((e, t, r) => {
1115
+ o(e), c(t), u(r), i(!1), n(!0);
1116
+ }, []), p = N(() => {
1117
+ o(Ye), n(!1), i(!1), u(void 0);
1118
+ }, []);
1119
+ return P(() => () => {
1120
+ let e = qe(a);
1121
+ e != null && URL.revokeObjectURL(e);
1122
+ }, [a]), /* @__PURE__ */ z(Xe.Provider, {
1123
+ value: F(() => ({
1124
+ isOpen: t,
1125
+ isLoading: r,
1126
+ content: a,
1127
+ fileName: s,
1128
+ attachmentId: l,
1129
+ openCanvasLoading: d,
1130
+ openCanvas: f,
1131
+ closeCanvas: p
1132
+ }), [
1133
+ t,
1134
+ r,
1135
+ a,
1136
+ s,
1137
+ l,
1138
+ d,
1139
+ f,
1140
+ p
1141
+ ]),
1142
+ children: e
1143
+ });
1144
+ }, Qe = () => {
1145
+ let e = se(Xe);
1146
+ if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
1147
+ return e;
1148
+ }, $e = M(({ labels: e, isMobile: t = !1, defaultWidth: n, maxWidth: r, codeBlockTheme: o, tableDownloadFilename: s, configurePdfWorker: c }) => {
1149
+ let { ariaLabel: l = "Attachment preview", closeLabel: u = "Close", downloadLabel: d = "Download", unsupportedLabel: f = "Preview is not supported for this file", loadErrorLabel: p = "Failed to load file", forbiddenErrorLabel: m = "You don't have permission to access this file", copyTextLabel: g, copiedTextLabel: _, copyMarkdownLabel: v, copiedMarkdownLabel: y, copyJsonLabel: b, copiedJsonLabel: x, htmlFrameBlockedLabel: S, htmlOpenInNewTabLabel: C, htmlViewSourceLabel: w, htmlViewRenderedLabel: T, pdfThumbnailsLabel: E, pdfShowThumbnailsLabel: D, pdfHideThumbnailsLabel: O, pdfPageNumberLabel: k, pdfContentLoadingLabel: ee, pdfContentErrorLabel: te, pdfContentRetryLabel: ne, xlsxFormulaLabel: re, codeContentLoadingLabel: ie, codeContentErrorLabel: ae, codeContentRetryLabel: oe, tableCopyLabel: A, tableCopiedLabel: j, tableDownloadCsvLabel: M, ooxmlHighlightsLabel: se, ooxmlHighlightNavigatedLabel: P } = e ?? {}, { isOpen: F, isLoading: I, content: L, fileName: ce, closeCanvas: le } = Qe(), R = N(() => {
1150
+ a(L, ce);
1151
+ }, [L, ce]), B = N(() => {
1152
+ (L.type === i.PlainText || L.type === i.Code) && h(L.text);
1153
+ }, [L]), V = N(() => {
1154
+ L.type === i.Markdown && h(L.text);
1155
+ }, [L]), ue = N(() => {
1156
+ L.type === i.Json && h(JSON.stringify(L.value, null, 2));
1157
+ }, [L]);
1158
+ return /* @__PURE__ */ z(Re, {
1159
+ isOpen: F,
1160
+ isLoading: I,
1161
+ onClose: le,
1162
+ content: L,
1163
+ fileName: ce,
1164
+ labels: {
1165
+ ariaLabel: l,
1166
+ closeLabel: u,
1167
+ downloadLabel: d,
1168
+ copyTextLabel: g,
1169
+ copiedTextLabel: _,
1170
+ copyMarkdownLabel: v,
1171
+ copiedMarkdownLabel: y,
1172
+ copyJsonLabel: b,
1173
+ copiedJsonLabel: x,
1174
+ unsupportedLabel: f,
1175
+ loadErrorLabel: p,
1176
+ forbiddenErrorLabel: m,
1177
+ htmlFrameBlockedLabel: S,
1178
+ htmlOpenInNewTabLabel: C,
1179
+ htmlViewSourceLabel: w,
1180
+ htmlViewRenderedLabel: T,
1181
+ pdfThumbnailsLabel: E,
1182
+ pdfShowThumbnailsLabel: D,
1183
+ pdfHideThumbnailsLabel: O,
1184
+ pdfPageNumberLabel: k,
1185
+ pdfContentLoadingLabel: ee,
1186
+ pdfContentErrorLabel: te,
1187
+ pdfContentRetryLabel: ne,
1188
+ xlsxFormulaLabel: re,
1189
+ codeContentLoadingLabel: ie,
1190
+ codeContentErrorLabel: ae,
1191
+ codeContentRetryLabel: oe,
1192
+ tableCopyLabel: A,
1193
+ tableCopiedLabel: j,
1194
+ tableDownloadCsvLabel: M,
1195
+ ooxmlHighlightsLabel: se,
1196
+ ooxmlHighlightNavigatedLabel: P
1197
+ },
1198
+ onDownload: R,
1199
+ onCopyText: L.type === i.PlainText || L.type === i.Code ? B : void 0,
1200
+ onCopyMarkdown: L.type === i.Markdown ? V : void 0,
1201
+ onCopyJson: L.type === i.Json ? ue : void 0,
1202
+ tableDownloadFilename: s,
1203
+ isMobile: t,
1204
+ defaultWidth: n,
1205
+ maxWidth: r,
1206
+ codeBlockTheme: o,
1207
+ configurePdfWorker: c
1208
+ });
1209
+ }), et = {
1210
+ frame: "_frame_g47g7_1",
1211
+ header: "_header_g47g7_6",
1212
+ title: "_title_g47g7_10"
1213
+ }, tt = M(({ content: e, height: t, onExpand: n, expandAriaLabel: r, actionsGroupAriaLabel: i = "Visualizer actions", frameTitle: a, loadingLabel: o, errorLabel: s, titleClassName: c = "dial-small-semi-text", colors: l }) => {
1214
+ let u = e.visualizerName.trim();
1215
+ return /* @__PURE__ */ B("div", {
1216
+ className: g("flex w-full min-w-0 flex-col overflow-hidden rounded-xl border", et.frame),
1217
+ style: m({
1218
+ "--igv-bg": l?.background,
1219
+ "--igv-border": l?.border,
1220
+ "--igv-title-text": l?.titleText
1221
+ }),
1222
+ children: [/* @__PURE__ */ B("div", {
1223
+ className: g("flex min-h-10 items-center justify-between gap-2 border-b px-4 py-2", et.header),
1224
+ children: [/* @__PURE__ */ z("span", {
1225
+ className: g("min-w-0 truncate", c, et.title),
1226
+ children: u
1227
+ }), /* @__PURE__ */ z("div", {
1228
+ role: "toolbar",
1229
+ "aria-label": i,
1230
+ className: "flex items-center gap-1",
1231
+ children: /* @__PURE__ */ z(w, {
1232
+ icon: /* @__PURE__ */ z(O, {
1233
+ size: x.SM,
1234
+ stroke: S,
1235
+ "aria-hidden": !0
1236
+ }),
1237
+ "aria-label": r,
1238
+ size: C.Small,
1239
+ onClick: n
1240
+ })
1241
+ })]
1242
+ }), /* @__PURE__ */ z("div", {
1243
+ className: "w-full",
1244
+ style: { height: `${t}px` },
1245
+ children: /* @__PURE__ */ z(Me, {
1246
+ content: e,
1247
+ loadingLabel: o,
1248
+ errorLabel: s,
1249
+ frameTitle: a
1250
+ })
1251
+ })]
1252
+ });
1253
+ }), nt = (e, t) => {
1196
1254
  let n = e.toLowerCase();
1197
1255
  return t.find((e) => e.contentType.split(",").some((e) => e.trim().toLowerCase() === n && e.trim() !== ""));
1198
- }, Ze = (e) => {
1256
+ }, rt = (e, t) => {
1257
+ if (!(e == null || e === "")) return Object.prototype.hasOwnProperty.call(t, e) ? t[e] : void 0;
1258
+ }, it = (e) => `${e}:grouped-visualizer`, at = (e, t) => {
1259
+ let n = (t.contentType ?? "").split(",").map((e) => e.trim().toLowerCase()).filter((e) => e !== ""), r = [], i = [];
1260
+ return e.forEach((e) => {
1261
+ if (e.url != null && e.url !== "" && (n.length === 0 || n.includes(e.contentType.toLowerCase()))) {
1262
+ r.push(e);
1263
+ return;
1264
+ }
1265
+ i.push(e);
1266
+ }), {
1267
+ claimed: r,
1268
+ unclaimed: i
1269
+ };
1270
+ }, ot = (e) => {
1199
1271
  let t;
1200
1272
  try {
1201
1273
  t = new URL(e).pathname;
@@ -1208,63 +1280,63 @@ var Le = ({ children: e }) => {
1208
1280
  } catch {
1209
1281
  return n;
1210
1282
  }
1211
- }, Qe = (e, t) => {
1212
- let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = J(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u = M(async (t, r) => {
1283
+ }, st = (e, t) => {
1284
+ let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = Qe(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u = N(async (t, n, r) => {
1213
1285
  if (t.url == null && t.referenceUrl != null) {
1214
1286
  let i = e.resolveReferencePdfContent(t);
1215
- if (i != null) return n(i, t.name, r), !0;
1287
+ if (i != null) return r(i, t.name, n);
1216
1288
  }
1217
- let a = t.contentType.toLowerCase(), c = Xe(a, o);
1289
+ let a = t.contentType.toLowerCase(), c = nt(a, o);
1218
1290
  if (c != null) {
1219
1291
  let i = await e.resolveVisualizerContent(t, c, s);
1220
- if (i != null) return n(i, t.name, r), !0;
1292
+ if (i != null) return r(i, t.name, n);
1221
1293
  }
1222
1294
  if (!a && t.data != null) {
1223
1295
  let i = await e.resolveTextContent(t);
1224
- if (i != null) return n(i, t.name, r), !0;
1296
+ if (i != null) return r(i, t.name, n);
1225
1297
  }
1226
- let l = Q("", a);
1227
- if (l != null) return n(await e.resolveOoxmlContent(t, l) ?? $(e.resolveContentUrl(t)), t.name, r), !0;
1298
+ let l = Z("", a);
1299
+ if (l != null) return r(await e.resolveOoxmlContent(t, l) ?? $(e.resolveContentUrl(t)), t.name, n);
1228
1300
  switch (a) {
1229
- case f.PDF: return n(await e.resolvePdfContent(t) ?? $(e.resolveContentUrl(t)), t.name, r), !0;
1230
- case f.Markdown: return n(await e.resolveMarkdownContent(t) ?? $(e.resolveContentUrl(t)), t.name, r), !0;
1231
- case f.JSON: return n(await e.resolveJsonContent(t) ?? $(e.resolveContentUrl(t)), t.name, r), !0;
1301
+ case f.PDF: return r(await e.resolvePdfContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1302
+ case f.Markdown: return r(await e.resolveMarkdownContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1303
+ case f.JSON: return r(await e.resolveJsonContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1232
1304
  }
1233
- let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h = Q(u);
1234
- if (h != null) return n(await e.resolveOoxmlContent(t, h) ?? $(e.resolveContentUrl(t)), t.name, r), !0;
1305
+ let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h = Z(u);
1306
+ if (h != null) return r(await e.resolveOoxmlContent(t, h) ?? $(e.resolveContentUrl(t)), t.name, n);
1235
1307
  switch (m) {
1236
1308
  case d.Markdown:
1237
1309
  case d.MarkdownAlt: {
1238
1310
  let i = await e.resolveMarkdownContent(t);
1239
- return i == null ? !1 : (n(i, t.name, r), !0);
1311
+ return i == null ? !1 : r(i, t.name, n);
1240
1312
  }
1241
1313
  case d.JSON: {
1242
1314
  let i = await e.resolveJsonContent(t);
1243
- return i == null ? !1 : (n(i, t.name, r), !0);
1315
+ return i == null ? !1 : r(i, t.name, n);
1244
1316
  }
1245
1317
  case d.PDF: {
1246
1318
  let i = await e.resolvePdfContent(t);
1247
- return i == null ? !1 : (n(i, t.name, r), !0);
1319
+ return i == null ? !1 : r(i, t.name, n);
1248
1320
  }
1249
1321
  }
1250
- let g = t.name != null && Ge(t.name) || t.url != null && Ge(Ze(t.url));
1251
- if (t.name != null && !We(t.name) && !g) return n($(e.resolveContentUrl(t)), t.name, r), !0;
1322
+ let g = t.name != null && Q(t.name) || t.url != null && Q(ot(t.url));
1323
+ if (t.name != null && !He(t.name) && !g) return r($(e.resolveContentUrl(t)), t.name, n);
1252
1324
  if (g) {
1253
1325
  let a = await e.resolveHtmlContent(t);
1254
- return a == null ? e.hasTextSource(t) ? (n($(e.resolveContentUrl(t)), t.name, r), !0) : t.url == null ? !1 : (n({
1326
+ return a == null ? e.hasTextSource(t) ? r($(e.resolveContentUrl(t)), t.name, n) : t.url == null ? !1 : r({
1255
1327
  type: i.Html,
1256
1328
  url: t.url
1257
- }, t.name, r), !0) : (n(a, t.name, r), !0);
1329
+ }, t.name, n) : r(a, t.name, n);
1258
1330
  }
1259
- let _ = await e.resolveCodeContent(t, qe(m));
1260
- return _ == null ? !1 : (n(_, t.name, r), !0);
1331
+ let _ = await e.resolveCodeContent(t, We(m));
1332
+ return _ == null ? !1 : r(_, t.name, n);
1261
1333
  }, [
1262
- n,
1263
1334
  o,
1264
1335
  s,
1265
1336
  e
1266
1337
  ]);
1267
- return { openAttachmentCanvas: M(async (t, o = t.id) => {
1338
+ return { openAttachmentCanvas: N(async (t, o = t.id, s) => {
1339
+ let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (Je(e), !1);
1268
1340
  switch (t.type) {
1269
1341
  case c.Image: {
1270
1342
  let r = e.resolveImageContent(t);
@@ -1280,14 +1352,14 @@ var Le = ({ children: e }) => {
1280
1352
  }
1281
1353
  case c.File: {
1282
1354
  l?.(), r(t.name, o);
1283
- let e = await u(t, o);
1284
- return e || a(), e;
1355
+ let e = await u(t, o, f);
1356
+ return !e && d() && a(), e;
1285
1357
  }
1286
1358
  case c.Pasted:
1287
1359
  case c.Prompt: {
1288
1360
  l?.(), r(t.name, o);
1289
- let i = await e.resolveTextContent(t);
1290
- return i == null ? (a(), !1) : (n(i, t.name, o), !0);
1361
+ let n = await e.resolveTextContent(t);
1362
+ return n == null ? (d() && a(), !1) : f(n, t.name, o);
1291
1363
  }
1292
1364
  default: return !1;
1293
1365
  }
@@ -1301,4 +1373,4 @@ var Le = ({ children: e }) => {
1301
1373
  ]) };
1302
1374
  };
1303
1375
  //#endregion
1304
- export { Pe as AttachmentCanvas, Me as AttachmentCanvasBody, Re as AttachmentCanvasContainer, Le as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, me as CodeContent, xe as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, Ye as createForbiddenCanvasContent, Je as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, qe as extensionToLanguage, Xe as findVisualizerForMime, Q as getOoxmlFileType, Ue as getOoxmlMimeType, o as isDownloadable, Ge as isHtmlPreviewable, He as isOoxmlPreviewable, We as isTextPreviewable, J as useAttachmentCanvas, Qe as useOpenAttachmentCanvas };
1376
+ export { pe as ATTACHMENT_CANVAS_CLASS, Re as AttachmentCanvas, Ie as AttachmentCanvasBody, $e as AttachmentCanvasContainer, Ze as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, ge as CodeContent, tt as InlineGroupedVisualizer, Te as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, Ke as createForbiddenCanvasContent, Ge as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, We as extensionToLanguage, rt as findVisualizerForApplication, nt as findVisualizerForMime, Z as getOoxmlFileType, Ve as getOoxmlMimeType, it as groupedVisualizerCanvasKey, o as isDownloadable, Q as isHtmlPreviewable, Be as isOoxmlPreviewable, He as isTextPreviewable, at as partitionAttachmentsForApplicationVisualizer, Qe as useAttachmentCanvas, st as useOpenAttachmentCanvas };