@epam/ai-dial-attachment-canvas 1.2.0-dev.288 → 1.2.0-dev.300

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -5,39 +5,39 @@ import { SidebarOrientation as b, SidebarPanel as x } from "@epam/ai-dial-sideba
5
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
6
  import { IconAlertTriangle as O, IconArrowsMaximize as k, IconCheck as A, IconCode as j, IconCopy as ee, IconDownload as te, IconEye as M, IconLock as ne, IconMarkdown as re, IconRefresh as ie } from "@tabler/icons-react";
7
7
  import { createContext as N, lazy as P, memo as F, useCallback as I, useContext as ae, useEffect as L, useMemo as R, useRef as z, useState as B } from "react";
8
- import { JsonView as oe, defaultStyles as V } from "react-json-view-lite";
9
- import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
10
- import { AppBridge as G, AppFrame as K } from "@mcp-ui/client";
11
- import { McpUiHostContextChangedNotificationSchema as se } from "@modelcontextprotocol/ext-apps/app-bridge";
12
- import { VisualizerConnectorEvents as ce, VisualizerConnectorRequests as le } from "@epam/ai-dial-shared";
13
- import { VisualizerConnector as ue } from "@epam/ai-dial-visualizer-connector";
8
+ import { JsonView as oe, defaultStyles as se } from "react-json-view-lite";
9
+ import { Fragment as ce, jsx as V, jsxs as H } from "react/jsx-runtime";
10
+ import { AppBridge as le, 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 G } from "@epam/ai-dial-visualizer-connector";
14
14
  //#region src/constants/public-class-names.ts
15
- var de = { panel: "dial-attachment-canvas-panel" }, fe = {
15
+ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
16
16
  container: "_container_1nhig_1",
17
17
  containerLight: "_containerLight_1nhig_5"
18
- }, q = {
18
+ }, pe = {
19
19
  [l.Dark]: v,
20
20
  [l.Light]: v
21
- }, pe = () => P(async () => {
21
+ }, me = () => P(async () => {
22
22
  let { Prism: e } = await import("react-syntax-highlighter");
23
23
  return { default: e };
24
- }), me = F(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
25
- let { text: r, language: i } = e, a = R(() => g(r), [r]), o = i == null || i === "plaintext" || !a, c = q[t], u = t === l.Light, [d, f] = B(0), p = R(pe, [d]), m = I(() => {
24
+ }), he = F(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
25
+ let { text: r, language: i } = e, a = R(() => g(r), [r]), o = i == null || i === "plaintext" || !a, c = pe[t], u = t === l.Light, [d, f] = B(0), p = R(me, [d]), m = I(() => {
26
26
  f((e) => e + 1);
27
- }, []), h = /* @__PURE__ */ U("pre", {
27
+ }, []), h = /* @__PURE__ */ V("pre", {
28
28
  className: "whitespace-pre-wrap break-words p-4",
29
29
  children: r
30
30
  });
31
- return /* @__PURE__ */ U("div", {
31
+ return /* @__PURE__ */ V("div", {
32
32
  dir: "ltr",
33
33
  className: _("h-full overflow-auto", fe.container, u && fe.containerLight),
34
- children: o ? h : /* @__PURE__ */ U(s, {
34
+ children: o ? h : /* @__PURE__ */ V(s, {
35
35
  retryKey: d,
36
36
  onRetry: m,
37
37
  pendingContent: h,
38
38
  errorContent: h,
39
39
  labels: n,
40
- children: /* @__PURE__ */ U(p, {
40
+ children: /* @__PURE__ */ V(p, {
41
41
  language: i,
42
42
  style: c,
43
43
  customStyle: {
@@ -54,7 +54,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
54
54
  })
55
55
  })
56
56
  });
57
- }), he = "dial-html-preview:render", ge = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, _e = F(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
57
+ }), ge = "dial-html-preview:render", _e = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, ve = F(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
58
58
  let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = B(!0), [d, f] = B(!1), [p, m] = B(void 0), [h, g] = B(!1), [v, y] = B(!1), b = z(null), x = z(null), S = z(!1), C = z({
59
59
  content: e,
60
60
  generation: 0
@@ -93,7 +93,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
93
93
  if (u(!1), A != null) {
94
94
  let e = b.current?.contentWindow;
95
95
  e != null && e !== x.current && j != null && (x.current = e, e.postMessage({
96
- type: he,
96
+ type: ge,
97
97
  html: j
98
98
  }, "*"));
99
99
  return;
@@ -111,10 +111,10 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
111
111
  ]), te = I(() => {
112
112
  u(!1), f(!0);
113
113
  }, []), M = e.srcdoc ?? p, ne = e.srcdoc != null || e.resolveSourceText != null, re = e.srcdoc == null && e.resolveSourceText != null && p == null && !v;
114
- if (n && ne && (M != null || h || re)) return S.current = !0, M == null ? /* @__PURE__ */ U("div", {
114
+ if (n && ne && (M != null || h || re)) return S.current = !0, M == null ? /* @__PURE__ */ V("div", {
115
115
  className: "flex h-full items-center justify-center",
116
- children: /* @__PURE__ */ U(D, {})
117
- }) : /* @__PURE__ */ U(me, {
116
+ children: /* @__PURE__ */ V(D, {})
117
+ }) : /* @__PURE__ */ V(he, {
118
118
  content: {
119
119
  type: i.Code,
120
120
  text: M,
@@ -122,26 +122,26 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
122
122
  },
123
123
  codeBlockTheme: a
124
124
  });
125
- if (d) return /* @__PURE__ */ W("div", {
125
+ if (d) return /* @__PURE__ */ H("div", {
126
126
  className: "flex h-full flex-col items-center justify-center gap-3 p-4",
127
- children: [/* @__PURE__ */ U("p", {
127
+ children: [/* @__PURE__ */ V("p", {
128
128
  className: "text-center",
129
129
  children: s
130
- }), e.url != null && /* @__PURE__ */ U(E, {
130
+ }), e.url != null && /* @__PURE__ */ V(E, {
131
131
  href: e.url,
132
132
  target: "_blank",
133
133
  label: c,
134
- className: ge.openInNewTabButton,
134
+ className: _e.openInNewTabButton,
135
135
  textClassName: o
136
136
  })]
137
137
  });
138
138
  let ie = k ? A : e.url, N = k && A == null ? e.srcdoc : void 0;
139
- return /* @__PURE__ */ W("div", {
139
+ return /* @__PURE__ */ H("div", {
140
140
  className: "relative h-full",
141
- children: [l && /* @__PURE__ */ U("div", {
141
+ children: [l && /* @__PURE__ */ V("div", {
142
142
  className: "absolute inset-0 flex items-center justify-center",
143
- children: /* @__PURE__ */ U(D, {})
144
- }), /* @__PURE__ */ U("iframe", {
143
+ children: /* @__PURE__ */ V(D, {})
144
+ }), /* @__PURE__ */ V("iframe", {
145
145
  ref: b,
146
146
  title: r,
147
147
  src: ie,
@@ -152,10 +152,10 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
152
152
  onError: te
153
153
  }, w)]
154
154
  });
155
- }), ve = {
155
+ }), ye = {
156
156
  name: "MCP-UI Host",
157
157
  version: "1.0.0"
158
- }, ye = { openLinks: {} }, be = (e) => {
158
+ }, q = { openLinks: {} }, be = (e) => {
159
159
  let t;
160
160
  try {
161
161
  t = new URL(e);
@@ -192,13 +192,13 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
192
192
  height: Math.round(n.height)
193
193
  }
194
194
  } : r.current.hostContext;
195
- e = new G(null, r.current.hostInfo ?? ve, ye, { hostContext: i }), e.onopenlink = async ({ url: e }) => {
195
+ e = new le(null, r.current.hostInfo ?? ye, q, { hostContext: i }), e.onopenlink = async ({ url: e }) => {
196
196
  let t = r.current.onOpenLink;
197
197
  return (t == null ? be(e) : t(e)) === !1 ? { isError: !0 } : {};
198
198
  }, e.onrequestdisplaymode = async ({ mode: e }) => {
199
199
  let t = r.current.onRequestDisplayMode, n = r.current.hostContext?.displayMode ?? "inline";
200
200
  return { mode: t?.(e) ?? n };
201
- }, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(se, ({ params: e }) => {
201
+ }, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(U, ({ params: e }) => {
202
202
  let n = t.current?.querySelector("iframe");
203
203
  n != null && xe(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
204
204
  }), a(e);
@@ -215,12 +215,12 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
215
215
  hasFailed: o
216
216
  };
217
217
  }, J = {
218
- loadingOverlay: "_loadingOverlay_iea4a_2",
219
- fullscreenFrame: "_fullscreenFrame_iea4a_21",
220
- loadingFrame: "_loadingFrame_iea4a_29",
221
- statusLabel: "_statusLabel_iea4a_33",
222
- statusDetail: "_statusDetail_iea4a_38",
223
- errorIcon: "_errorIcon_iea4a_42"
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
224
  }, Ce = ({ content: e, errorLabel: t = "Failed to load app", onAppInfo: n }) => {
225
225
  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();
226
226
  L(() => {
@@ -240,11 +240,11 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
240
240
  ...d,
241
241
  containerDimensions: h
242
242
  }, [d, h])), b = y || r === "error";
243
- return /* @__PURE__ */ W("div", {
243
+ return /* @__PURE__ */ H("div", {
244
244
  ref: m,
245
245
  className: _("relative h-full min-h-[200px] w-full", p && J.fullscreenFrame, !p && r === "loading" && J.loadingFrame),
246
246
  children: [
247
- v != null && !b && /* @__PURE__ */ U(K, {
247
+ v != null && !b && /* @__PURE__ */ V(ue, {
248
248
  html: s,
249
249
  sandbox: f,
250
250
  appBridge: v,
@@ -258,21 +258,21 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
258
258
  o(e.message), i("error");
259
259
  }
260
260
  }),
261
- !b && r === "loading" && /* @__PURE__ */ U("div", {
261
+ !b && r === "loading" && /* @__PURE__ */ V("div", {
262
262
  className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", J.loadingOverlay),
263
- children: /* @__PURE__ */ U(D, {})
263
+ children: /* @__PURE__ */ V(D, {})
264
264
  }),
265
- b && /* @__PURE__ */ W("div", {
265
+ b && /* @__PURE__ */ H("div", {
266
266
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2 p-4",
267
- children: [/* @__PURE__ */ U(O, {
267
+ children: [/* @__PURE__ */ V(O, {
268
268
  size: 60,
269
269
  stroke: C,
270
270
  "aria-hidden": !0,
271
271
  className: J.errorIcon
272
- }), /* @__PURE__ */ W("p", {
272
+ }), /* @__PURE__ */ H("p", {
273
273
  role: "alert",
274
274
  className: _("text-center", J.statusLabel),
275
- children: [t, a && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("br", {}), /* @__PURE__ */ U("span", {
275
+ children: [t, a && /* @__PURE__ */ H(ce, { children: [/* @__PURE__ */ V("br", {}), /* @__PURE__ */ V("span", {
276
276
  className: J.statusDetail,
277
277
  children: a
278
278
  })] })]
@@ -281,13 +281,13 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
281
281
  ]
282
282
  });
283
283
  }, Y = {
284
- viewer: "_viewer_1w97n_2",
285
- spreadsheetCanvas: "_spreadsheetCanvas_1w97n_6",
286
- formulaPanel: "_formulaPanel_1w97n_12",
287
- formulaValue: "_formulaValue_1w97n_18",
288
- statusOverlay: "_statusOverlay_1w97n_24",
289
- errorIcon: "_errorIcon_1w97n_29",
290
- highlight: "_highlight_1w97n_37"
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
291
  }, we = (e) => {
292
292
  if (e?.kind !== "range") return "";
293
293
  let { activeCell: t } = e.selection, n = e.cells.find(({ address: e }) => e.row === t.row && e.col === t.col);
@@ -492,18 +492,18 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
492
492
  })(), () => {
493
493
  r = !0;
494
494
  };
495
- }, [S, u]), /* @__PURE__ */ W("div", {
495
+ }, [S, u]), /* @__PURE__ */ H("div", {
496
496
  className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
497
497
  children: [
498
- t.format === r.Xlsx && /* @__PURE__ */ W("div", {
498
+ t.format === r.Xlsx && /* @__PURE__ */ H("div", {
499
499
  role: "region",
500
500
  "aria-label": a,
501
501
  className: _("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", Y.formulaPanel),
502
- children: [/* @__PURE__ */ U("span", {
502
+ children: [/* @__PURE__ */ V("span", {
503
503
  "aria-hidden": "true",
504
504
  className: _("shrink-0", o),
505
505
  children: "fx"
506
- }), /* @__PURE__ */ U("code", {
506
+ }), /* @__PURE__ */ V("code", {
507
507
  dir: "ltr",
508
508
  tabIndex: 0,
509
509
  "aria-live": "polite",
@@ -511,19 +511,19 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
511
511
  children: m
512
512
  })]
513
513
  }),
514
- /* @__PURE__ */ W("div", {
514
+ /* @__PURE__ */ H("div", {
515
515
  className: "relative min-h-0 w-full flex-1",
516
- children: [/* @__PURE__ */ U("div", {
516
+ children: [/* @__PURE__ */ V("div", {
517
517
  ref: l,
518
518
  role: "document",
519
519
  "aria-label": n,
520
520
  "aria-busy": u,
521
521
  className: _("h-full w-full overflow-hidden", Y.viewer)
522
- }), g.length > 0 && /* @__PURE__ */ U("div", {
522
+ }), g.length > 0 && /* @__PURE__ */ V("div", {
523
523
  role: "region",
524
524
  "aria-label": s,
525
525
  className: "pointer-events-none absolute inset-0 overflow-hidden",
526
- children: g.map((e, t) => /* @__PURE__ */ U("div", {
526
+ children: g.map((e, t) => /* @__PURE__ */ V("div", {
527
527
  "aria-hidden": "true",
528
528
  style: {
529
529
  left: `${e.left}px`,
@@ -537,24 +537,24 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
537
537
  }, `${e.highlightId}-${t}`))
538
538
  })]
539
539
  }),
540
- /* @__PURE__ */ U("div", {
540
+ /* @__PURE__ */ V("div", {
541
541
  role: "status",
542
542
  "aria-live": "polite",
543
543
  className: "sr-only",
544
544
  children: y ? c : ""
545
545
  }),
546
- (u || f) && /* @__PURE__ */ U("div", {
546
+ (u || f) && /* @__PURE__ */ V("div", {
547
547
  role: f ? "alert" : void 0,
548
548
  "aria-live": "polite",
549
549
  className: _("absolute inset-0 flex items-center justify-center", Y.statusOverlay),
550
- children: u ? /* @__PURE__ */ U(D, { size: 48 }) : /* @__PURE__ */ W("div", {
550
+ children: u ? /* @__PURE__ */ V(D, { size: 48 }) : /* @__PURE__ */ H("div", {
551
551
  className: "flex flex-col items-center gap-2",
552
- children: [/* @__PURE__ */ U(O, {
552
+ children: [/* @__PURE__ */ V(O, {
553
553
  "aria-hidden": "true",
554
554
  size: 60,
555
555
  stroke: C,
556
556
  className: Y.errorIcon
557
- }), /* @__PURE__ */ U("p", {
557
+ }), /* @__PURE__ */ V("p", {
558
558
  className: "text-center",
559
559
  children: i
560
560
  })]
@@ -595,19 +595,19 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
595
595
  let e = s.current;
596
596
  if (!e) return;
597
597
  l("loading");
598
- let t = new ue(e, {
598
+ let t = new G(e, {
599
599
  domain: u,
600
600
  hostDomain: window.location.origin,
601
601
  visualizerName: d,
602
602
  requestTimeout: f
603
- }), n = !0, r = t.subscribe(`${d}/${ce.sendMessage}`, (e) => {
603
+ }), n = !0, r = t.subscribe(`${d}/${W.sendMessage}`, (e) => {
604
604
  let t = Ne(e);
605
605
  t != null && h.current?.(t);
606
606
  });
607
607
  return (async () => {
608
608
  if (await t.ready(), !n) return;
609
609
  let e = p.current;
610
- if (e.type === i.GroupedVisualizer) await t.send(le.sendGroupedVisualizeData, {
610
+ if (e.type === i.GroupedVisualizer) await t.send(de.sendGroupedVisualizeData, {
611
611
  attachments: e.attachments,
612
612
  layout: e.layout
613
613
  });
@@ -616,7 +616,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
616
616
  layout: r,
617
617
  ...typeof i == "object" && i ? i : {}
618
618
  };
619
- await t.send(le.sendVisualizeData, {
619
+ await t.send(de.sendVisualizeData, {
620
620
  mimeType: n,
621
621
  visualizerData: a
622
622
  });
@@ -639,7 +639,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
639
639
  d,
640
640
  u,
641
641
  f
642
- ]), /* @__PURE__ */ W("div", {
642
+ ]), /* @__PURE__ */ H("div", {
643
643
  className: "relative h-full w-full",
644
644
  style: m({
645
645
  "--vs-loading-bg": a?.loadingBackground,
@@ -647,25 +647,25 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
647
647
  "--vs-error-icon": a?.errorIcon
648
648
  }),
649
649
  children: [
650
- /* @__PURE__ */ U("div", {
650
+ /* @__PURE__ */ V("div", {
651
651
  ref: s,
652
652
  className: "h-full w-full"
653
653
  }),
654
- c === "loading" && /* @__PURE__ */ W("div", {
654
+ c === "loading" && /* @__PURE__ */ H("div", {
655
655
  className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", Pe.loadingOverlay),
656
- children: [/* @__PURE__ */ U(D, {}), t && /* @__PURE__ */ U("p", {
656
+ children: [/* @__PURE__ */ V(D, {}), t && /* @__PURE__ */ V("p", {
657
657
  className: _("text-center", Pe.statusLabel),
658
658
  children: t
659
659
  })]
660
660
  }),
661
- c === "error" && /* @__PURE__ */ W("div", {
661
+ c === "error" && /* @__PURE__ */ H("div", {
662
662
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
663
- children: [/* @__PURE__ */ U(O, {
663
+ children: [/* @__PURE__ */ V(O, {
664
664
  size: 60,
665
665
  stroke: C,
666
666
  "aria-hidden": !0,
667
667
  className: Pe.errorIcon
668
- }), /* @__PURE__ */ U("p", {
668
+ }), /* @__PURE__ */ V("p", {
669
669
  role: "alert",
670
670
  className: _("text-center", Pe.statusLabel),
671
671
  children: n
@@ -692,17 +692,17 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
692
692
  let [r, i] = B(!1);
693
693
  return L(() => {
694
694
  i(!1);
695
- }, [e]), r ? /* @__PURE__ */ W("div", {
695
+ }, [e]), r ? /* @__PURE__ */ H("div", {
696
696
  className: "flex flex-col items-center gap-2",
697
- children: [/* @__PURE__ */ U(O, {
697
+ children: [/* @__PURE__ */ V(O, {
698
698
  size: 60,
699
699
  stroke: C,
700
700
  className: X.errorIcon
701
- }), /* @__PURE__ */ U("p", {
701
+ }), /* @__PURE__ */ V("p", {
702
702
  className: _("text-center", X.statusLabel),
703
703
  children: n
704
704
  })]
705
- }) : /* @__PURE__ */ U("img", {
705
+ }) : /* @__PURE__ */ V("img", {
706
706
  src: e,
707
707
  alt: t ?? "",
708
708
  className: "max-h-full max-w-full object-contain",
@@ -712,10 +712,10 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
712
712
  i.PlainText,
713
713
  i.Code,
714
714
  i.Ooxml
715
- ]), ze = F(({ content: e, isLoading: t = !1, fileName: r, isHtmlSourceView: a = !1, labels: { unsupportedLabel: o = "Preview is not supported for this file", loadErrorLabel: c = "Failed to load file", 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: j, tableCopiedLabel: ee, tableDownloadCsvLabel: te, ooxmlHighlightsLabel: M, ooxmlHighlightNavigatedLabel: re } = {}, styles: ie, codeBlockTheme: N, tableDownloadFilename: P, loadPdf: F, hidePdfToolbar: ae = !1, configurePdfWorker: L, onAppInfo: z, onVisualizerSendMessage: H }) => {
716
- let { colors: G, typography: K, bodyClassName: se, cssVars: ce } = ie ?? {}, [le, ue] = B(0), de = R(Ie, [le]), fe = I(() => {
717
- ue((e) => e + 1);
718
- }, []), q = K?.fontClassName != null, pe = R(() => ({
715
+ ]), ze = F(({ content: e, isLoading: t = !1, fileName: r, isHtmlSourceView: a = !1, labels: { unsupportedLabel: o = "Preview is not supported for this file", loadErrorLabel: c = "Failed to load file", 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: j, tableCopiedLabel: ee, tableDownloadCsvLabel: te, codeBlockCopyLabel: M, codeBlockCopiedLabel: re, codeBlockDownloadLabel: ie, tableScrollRegionAriaLabel: N, mathScrollRegionAriaLabel: P, ooxmlHighlightsLabel: F, ooxmlHighlightNavigatedLabel: ae } = {}, styles: L, codeBlockTheme: z, tableDownloadFilename: ce, loadPdf: le, hidePdfToolbar: ue = !1, configurePdfWorker: U, onAppInfo: W, onVisualizerSendMessage: de }) => {
716
+ let { colors: G, typography: K, bodyClassName: fe, cssVars: pe } = L ?? {}, [me, ge] = B(0), _e = R(Ie, [me]), ye = I(() => {
717
+ ge((e) => e + 1);
718
+ }, []), q = K?.fontClassName != null, be = R(() => ({
719
719
  ...m({
720
720
  "--ac-text": G?.text,
721
721
  "--ac-status-text": G?.statusText,
@@ -746,8 +746,8 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
746
746
  "--ac-line-height": q ? void 0 : K?.lineHeight,
747
747
  "--ac-letter-spacing": q ? void 0 : K?.letterSpacing
748
748
  }),
749
- ...ce
750
- }), [ie]), he = R(() => {
749
+ ...pe
750
+ }), [L]), xe = R(() => {
751
751
  switch (e.type) {
752
752
  case i.Image:
753
753
  case i.Audio:
@@ -765,39 +765,49 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
765
765
  case i.MarkdownTable: return "flex h-full min-h-0 flex-col overflow-hidden p-4";
766
766
  default: return "h-full overflow-auto p-4";
767
767
  }
768
- }, [e.type]), ge = R(() => {
768
+ }, [e.type]), Se = R(() => {
769
769
  switch (e.type) {
770
- case i.PlainText: return /* @__PURE__ */ U("pre", {
770
+ case i.PlainText: return /* @__PURE__ */ V("pre", {
771
771
  className: _("whitespace-pre-wrap break-words", X.body, K?.fontClassName),
772
772
  children: e.text
773
773
  });
774
- case i.Image: return /* @__PURE__ */ U(Le, {
774
+ case i.Image: return /* @__PURE__ */ V(Le, {
775
775
  url: e.url,
776
776
  fileName: r,
777
777
  loadErrorLabel: c
778
778
  });
779
- case i.Audio: return /* @__PURE__ */ U("audio", {
779
+ case i.Audio: return /* @__PURE__ */ V("audio", {
780
780
  controls: !0,
781
781
  controlsList: "nodownload",
782
782
  src: e.url,
783
783
  "aria-label": r ?? "Audio attachment",
784
784
  className: "w-full max-w-sm",
785
785
  preload: "metadata",
786
- children: e.mimeType && /* @__PURE__ */ U("source", {
786
+ children: e.mimeType && /* @__PURE__ */ V("source", {
787
787
  src: e.url,
788
788
  type: e.mimeType
789
789
  })
790
790
  });
791
- case i.Markdown: return /* @__PURE__ */ U(p, {
791
+ case i.Markdown: return /* @__PURE__ */ V(p, {
792
792
  content: e.text,
793
793
  isStreaming: !1,
794
- codeBlockTheme: N,
794
+ codeBlockTheme: z,
795
+ codeBlockCopyLabel: M,
796
+ codeBlockCopiedLabel: re,
797
+ codeBlockDownloadLabel: ie,
798
+ tableScrollRegionAriaLabel: N,
799
+ mathScrollRegionAriaLabel: P,
795
800
  classNames: u
796
801
  });
797
- case i.MarkdownTable: return /* @__PURE__ */ U(p, {
802
+ case i.MarkdownTable: return /* @__PURE__ */ V(p, {
798
803
  content: e.text,
799
804
  isStreaming: !1,
800
- codeBlockTheme: N,
805
+ codeBlockTheme: z,
806
+ codeBlockCopyLabel: M,
807
+ codeBlockCopiedLabel: re,
808
+ codeBlockDownloadLabel: ie,
809
+ tableScrollRegionAriaLabel: N,
810
+ mathScrollRegionAriaLabel: P,
801
811
  containerClassName: "flex h-full min-h-0 flex-col",
802
812
  classNames: {
803
813
  ...u,
@@ -809,18 +819,18 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
809
819
  copiedLabel: ee,
810
820
  downloadCsvLabel: te
811
821
  },
812
- tableDownloadFilename: P
822
+ tableDownloadFilename: ce
813
823
  });
814
- case i.Json: return /* @__PURE__ */ U("div", {
824
+ case i.Json: return /* @__PURE__ */ V("div", {
815
825
  dir: "ltr",
816
826
  className: "h-full overflow-auto",
817
- children: /* @__PURE__ */ U("div", {
827
+ children: /* @__PURE__ */ V("div", {
818
828
  className: _("m-3 overflow-auto rounded-md border", X.jsonWrapper),
819
- children: /* @__PURE__ */ U(oe, {
829
+ children: /* @__PURE__ */ V(oe, {
820
830
  data: e.value,
821
831
  style: {
822
832
  container: _("whitespace-pre-wrap break-words p-2", K?.jsonClassName ?? "dial-code-text"),
823
- basicChildStyle: V.basicChildStyle,
833
+ basicChildStyle: se.basicChildStyle,
824
834
  childFieldsContainer: "m-0 ps-3",
825
835
  label: _("me-1 font-semibold", X.jsonLabel),
826
836
  clickableLabel: _("me-1 cursor-pointer font-semibold hover:underline", X.jsonClickableLabel),
@@ -838,16 +848,16 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
838
848
  })
839
849
  })
840
850
  });
841
- case i.Code: return /* @__PURE__ */ U(me, {
851
+ case i.Code: return /* @__PURE__ */ V(he, {
842
852
  content: e,
843
- codeBlockTheme: N,
853
+ codeBlockTheme: z,
844
854
  labels: {
845
855
  loadingLabel: E,
846
856
  errorLabel: k,
847
857
  retryLabel: A
848
858
  }
849
859
  });
850
- case i.Html: return /* @__PURE__ */ U(_e, {
860
+ case i.Html: return /* @__PURE__ */ V(ve, {
851
861
  content: e,
852
862
  labels: {
853
863
  htmlFrameBlockedLabel: f,
@@ -855,25 +865,25 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
855
865
  },
856
866
  isSourceView: a,
857
867
  title: r,
858
- codeBlockTheme: N
868
+ codeBlockTheme: z
859
869
  });
860
- case i.Pdf: return /* @__PURE__ */ U(s, {
861
- retryKey: le,
862
- onRetry: fe,
870
+ case i.Pdf: return /* @__PURE__ */ V(s, {
871
+ retryKey: me,
872
+ onRetry: ye,
863
873
  labels: {
864
874
  loadingLabel: x,
865
875
  errorLabel: S,
866
876
  retryLabel: w
867
877
  },
868
- children: /* @__PURE__ */ U(de, {
878
+ children: /* @__PURE__ */ V(_e, {
869
879
  fileName: r,
870
880
  url: e.url,
871
881
  highlights: e.highlights ?? [],
872
882
  selectedHighlightId: e.selectedHighlightId,
873
883
  selectedPageNumber: e.page,
874
- loadPdf: F,
875
- hideHeader: ae,
876
- configurePdfWorker: L,
884
+ loadPdf: le,
885
+ hideHeader: ue,
886
+ configurePdfWorker: U,
877
887
  labels: {
878
888
  thumbnailsLabel: g,
879
889
  showThumbnailsLabel: v,
@@ -885,38 +895,38 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
885
895
  }
886
896
  })
887
897
  }, e.url);
888
- case i.Ooxml: return /* @__PURE__ */ U(Oe, {
898
+ case i.Ooxml: return /* @__PURE__ */ V(Oe, {
889
899
  content: e,
890
900
  fileName: r,
891
901
  loadErrorLabel: c,
892
902
  formulaLabel: T,
893
903
  formulaLabelClassName: K?.xlsxFormulaLabelClassName ?? "dial-italic-text",
894
- highlightsLabel: M,
895
- highlightNavigatedLabel: re
904
+ highlightsLabel: F,
905
+ highlightNavigatedLabel: ae
896
906
  });
897
907
  case i.Visualizer:
898
- case i.GroupedVisualizer: return /* @__PURE__ */ U(Fe, {
908
+ case i.GroupedVisualizer: return /* @__PURE__ */ V(Fe, {
899
909
  content: e,
900
910
  errorLabel: d,
901
- onSendMessage: H
911
+ onSendMessage: de
902
912
  });
903
- case i.McpApp: return /* @__PURE__ */ U(Ce, {
913
+ case i.McpApp: return /* @__PURE__ */ V(Ce, {
904
914
  content: e,
905
- onAppInfo: z
915
+ onAppInfo: W
906
916
  });
907
- case i.Unsupported: return /* @__PURE__ */ U("p", {
917
+ case i.Unsupported: return /* @__PURE__ */ V("p", {
908
918
  className: _("text-center", X.statusLabel),
909
919
  children: o
910
920
  });
911
921
  case i.Error: {
912
922
  let t = e.errorType === n.Forbidden;
913
- return /* @__PURE__ */ W("div", {
923
+ return /* @__PURE__ */ H("div", {
914
924
  className: "flex flex-col items-center gap-2",
915
- children: [U(t ? ne : O, {
925
+ children: [V(t ? ne : O, {
916
926
  size: 60,
917
927
  stroke: C,
918
928
  className: X.errorIcon
919
- }), /* @__PURE__ */ U("p", {
929
+ }), /* @__PURE__ */ V("p", {
920
930
  className: _("text-center", X.statusLabel),
921
931
  children: t ? l : c
922
932
  })]
@@ -929,20 +939,20 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
929
939
  K?.jsonClassName,
930
940
  K?.xlsxFormulaLabelClassName,
931
941
  r,
932
- N,
942
+ z,
933
943
  o,
934
944
  c,
935
945
  l,
936
946
  d,
937
- H,
947
+ de,
938
948
  f,
939
949
  h,
940
950
  a,
941
- P,
942
- F,
943
- ae,
944
- L,
945
- z,
951
+ ce,
952
+ le,
953
+ ue,
954
+ U,
955
+ W,
946
956
  g,
947
957
  v,
948
958
  y,
@@ -954,83 +964,88 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
954
964
  E,
955
965
  k,
956
966
  A,
957
- de,
958
- le,
959
- fe,
967
+ _e,
968
+ me,
969
+ ye,
960
970
  j,
961
971
  ee,
962
972
  te,
963
973
  M,
964
- re
974
+ re,
975
+ ie,
976
+ N,
977
+ P,
978
+ F,
979
+ ae
965
980
  ]);
966
- return /* @__PURE__ */ U("div", {
967
- style: !t && Re.has(e.type) ? pe : void 0,
968
- className: _(t ? "flex h-full items-center justify-center" : he, se),
969
- children: t ? /* @__PURE__ */ U(D, {}) : ge
981
+ return /* @__PURE__ */ V("div", {
982
+ style: !t && Re.has(e.type) ? be : void 0,
983
+ className: _(t ? "flex h-full items-center justify-center" : xe, fe),
984
+ children: t ? /* @__PURE__ */ V(D, {}) : Se
970
985
  });
971
986
  }), Be = {
972
987
  mcpAppDivider: "_mcpAppDivider_1jh5p_1",
973
988
  mcpAppVersion: "_mcpAppVersion_1jh5p_5"
974
- }, Ve = 2e3, He = F(({ 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: ne = "Open in new tab", htmlViewSourceLabel: N = "View source", htmlViewRenderedLabel: P = "View rendered", mcpAppReloadLabel: F = "Reload", pdfThumbnailsLabel: ae, pdfShowThumbnailsLabel: oe, pdfHideThumbnailsLabel: V, pdfPageNumberLabel: G, pdfContentLoadingLabel: K, pdfContentErrorLabel: se, pdfContentRetryLabel: ce, xlsxFormulaLabel: le, codeContentLoadingLabel: ue, codeContentErrorLabel: fe, codeContentRetryLabel: q, tableCopyLabel: pe, tableCopiedLabel: me, tableDownloadCsvLabel: he, ooxmlHighlightsLabel: ge, ooxmlHighlightNavigatedLabel: _e }, onDownload: ve, onCopyText: ye, onCopyMarkdown: be, onCopyJson: xe, tableDownloadFilename: Se, isMobile: J = !1, defaultWidth: Ce, minWidth: Y = 600, maxWidth: we = 1500, onResizeStop: Te, styles: Ee, codeBlockTheme: De, loadPdf: Oe, configurePdfWorker: ke, onVisualizerSendMessage: Ae }) => {
975
- let [je, Me] = B(!1), [Ne, Pe] = B(!1), [Fe, X] = B(!1), [Ie, Le] = B(!1), [Re, He] = B(void 0), Ue = z(null), Z = z(null), We = z(null), Ge = I(() => {
976
- ye?.(), Ue.current != null && clearTimeout(Ue.current), Me(!0), Ue.current = setTimeout(() => Me(!1), Ve);
977
- }, [ye]), Ke = I(() => {
978
- be?.(), Z.current != null && clearTimeout(Z.current), Pe(!0), Z.current = setTimeout(() => Pe(!1), Ve);
979
- }, [be]), qe = I(() => {
980
- xe?.(), We.current != null && clearTimeout(We.current), X(!0), We.current = setTimeout(() => X(!1), Ve);
981
- }, [xe]);
989
+ }, Ve = 2e3, He = F(({ 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: ne = "Open in new tab", htmlViewSourceLabel: N = "View source", htmlViewRenderedLabel: P = "View rendered", mcpAppReloadLabel: F = "Reload", pdfThumbnailsLabel: ae, pdfShowThumbnailsLabel: oe, pdfHideThumbnailsLabel: se, pdfPageNumberLabel: le, pdfContentLoadingLabel: ue, pdfContentErrorLabel: U, pdfContentRetryLabel: W, xlsxFormulaLabel: de, codeContentLoadingLabel: G, codeContentErrorLabel: fe, codeContentRetryLabel: pe, tableCopyLabel: me, tableCopiedLabel: he, tableDownloadCsvLabel: ge, codeBlockCopyLabel: _e, codeBlockCopiedLabel: ve, codeBlockDownloadLabel: ye, tableScrollRegionAriaLabel: q, mathScrollRegionAriaLabel: be, ooxmlHighlightsLabel: xe, ooxmlHighlightNavigatedLabel: Se }, onDownload: J, onCopyText: Ce, onCopyMarkdown: Y, onCopyJson: we, 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 }) => {
990
+ let [X, Ie] = B(!1), [Le, Re] = B(!1), [He, Ue] = B(!1), [Z, We] = B(!1), [Ge, Ke] = B(void 0), qe = z(null), Q = z(null), Je = z(null), Ye = I(() => {
991
+ Ce?.(), qe.current != null && clearTimeout(qe.current), Ie(!0), qe.current = setTimeout(() => Ie(!1), Ve);
992
+ }, [Ce]), Xe = I(() => {
993
+ Y?.(), Q.current != null && clearTimeout(Q.current), Re(!0), Q.current = setTimeout(() => Re(!1), Ve);
994
+ }, [Y]), Ze = I(() => {
995
+ we?.(), Je.current != null && clearTimeout(Je.current), Ue(!0), Je.current = setTimeout(() => Ue(!1), Ve);
996
+ }, [we]);
982
997
  L(() => () => {
983
- Ue.current != null && clearTimeout(Ue.current), Z.current != null && clearTimeout(Z.current), We.current != null && clearTimeout(We.current);
998
+ qe.current != null && clearTimeout(qe.current), Q.current != null && clearTimeout(Q.current), Je.current != null && clearTimeout(Je.current);
984
999
  }, []);
985
- let Je = I(() => {
986
- Le((e) => !e);
1000
+ let Qe = I(() => {
1001
+ We((e) => !e);
987
1002
  }, []);
988
1003
  L(() => {
989
- Le(!1), He(void 0);
1004
+ We(!1), Ke(void 0);
990
1005
  }, [r]);
991
- let { className: Ye, panelStyles: Xe, ...Ze } = Ee ?? {}, { colors: Q, typography: Qe } = Ze, $e = R(() => m({
992
- "--ac-mcp-app-divider": Q?.mcpAppDividerColor,
993
- "--ac-mcp-app-version": Q?.mcpAppVersionColor
994
- }), [Q?.mcpAppDividerColor, Q?.mcpAppVersionColor]), $ = r.type === i.McpApp && Re != null ? /* @__PURE__ */ W("span", {
995
- style: $e,
1006
+ let { className: $e, panelStyles: $, ...et } = je ?? {}, { colors: tt, typography: nt } = et, rt = R(() => m({
1007
+ "--ac-mcp-app-divider": tt?.mcpAppDividerColor,
1008
+ "--ac-mcp-app-version": tt?.mcpAppVersionColor
1009
+ }), [tt?.mcpAppDividerColor, tt?.mcpAppVersionColor]), it = r.type === i.McpApp && Ge != null ? /* @__PURE__ */ H("span", {
1010
+ style: rt,
996
1011
  children: [
997
- /* @__PURE__ */ U("span", { children: a }),
998
- /* @__PURE__ */ U("span", {
1012
+ /* @__PURE__ */ V("span", { children: a }),
1013
+ /* @__PURE__ */ V("span", {
999
1014
  "aria-hidden": !0,
1000
1015
  className: _("mx-1.5 inline-block h-3 w-0 border-s align-middle", Be.mcpAppDivider)
1001
1016
  }),
1002
- /* @__PURE__ */ U("span", { children: Re.name }),
1003
- Re.version && /* @__PURE__ */ U("span", {
1004
- className: _("ms-2", Qe?.mcpAppVersionClassName ?? "dial-caption-text", Be.mcpAppVersion),
1005
- children: Re.version
1017
+ /* @__PURE__ */ V("span", { children: Ge.name }),
1018
+ Ge.version && /* @__PURE__ */ V("span", {
1019
+ className: _("ms-2", nt?.mcpAppVersionClassName ?? "dial-caption-text", Be.mcpAppVersion),
1020
+ children: Ge.version
1006
1021
  })
1007
1022
  ]
1008
- }) : a, et = !t && r.type === i.Html && (r.srcdoc != null || r.resolveSourceText != null), tt = !t && ye != null && (r.type === i.PlainText || r.type === i.Code), nt = !t && be != null && r.type === i.Markdown, rt = !t && xe != null && r.type === i.Json, it = !t && ve != null && o(r), at = !t && r.type === i.McpApp && r.onReload != null;
1009
- return /* @__PURE__ */ U(x, {
1023
+ }) : a, at = !t && r.type === i.Html && (r.srcdoc != null || r.resolveSourceText != null), ot = !t && Ce != null && (r.type === i.PlainText || r.type === i.Code), st = !t && Y != null && r.type === i.Markdown, ct = !t && we != null && r.type === i.Json, lt = !t && J != null && o(r), ut = !t && r.type === i.McpApp && r.onReload != null;
1024
+ return /* @__PURE__ */ V(x, {
1010
1025
  isOpen: e,
1011
1026
  orientation: b.Right,
1012
- title: $,
1027
+ title: it,
1013
1028
  labels: {
1014
1029
  ariaLabel: c,
1015
1030
  closeLabel: l,
1016
1031
  resizeLabel: u
1017
1032
  },
1018
1033
  onClose: n,
1019
- resizable: !J,
1020
- defaultWidth: Ce,
1021
- minWidth: Y,
1022
- maxWidth: we,
1023
- onResizeStop: Te,
1034
+ resizable: !Ee,
1035
+ defaultWidth: De,
1036
+ minWidth: Oe,
1037
+ maxWidth: ke,
1038
+ onResizeStop: Ae,
1024
1039
  styles: {
1025
- ...Xe,
1026
- titleClassName: Xe?.titleClassName ?? "dial-h3-text",
1027
- headerClassName: _("border-b border-tertiary", Xe?.headerClassName),
1028
- className: _(e ? "mobile:w-full mobile:max-w-full" : "w-0", Ye, Xe?.className, de.panel)
1040
+ ...$,
1041
+ titleClassName: $?.titleClassName ?? "dial-h3-text",
1042
+ headerClassName: _("border-b border-tertiary", $?.headerClassName),
1043
+ className: _(e ? "mobile:w-full mobile:max-w-full" : "w-0", $e, $?.className, K.panel)
1029
1044
  },
1030
1045
  leftActions: s,
1031
- rightActions: et || tt || nt || rt || it || at ? /* @__PURE__ */ W(H, { children: [
1032
- at && /* @__PURE__ */ U(T, {
1033
- icon: /* @__PURE__ */ U(ie, {
1046
+ rightActions: at || ot || st || ct || lt || ut ? /* @__PURE__ */ H(ce, { children: [
1047
+ ut && /* @__PURE__ */ V(T, {
1048
+ icon: /* @__PURE__ */ V(ie, {
1034
1049
  size: S.LG,
1035
1050
  stroke: C,
1036
1051
  "aria-hidden": !0
@@ -1039,63 +1054,63 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
1039
1054
  tooltipProps: { tooltip: F },
1040
1055
  onClick: r.type === i.McpApp ? r.onReload : void 0
1041
1056
  }),
1042
- et && /* @__PURE__ */ U(T, {
1043
- icon: U(Ie ? M : j, {
1057
+ at && /* @__PURE__ */ V(T, {
1058
+ icon: V(Z ? M : j, {
1044
1059
  size: S.LG,
1045
1060
  stroke: C,
1046
1061
  "aria-hidden": !0
1047
1062
  }),
1048
- "aria-label": Ie ? P : N,
1049
- "aria-pressed": Ie,
1050
- tooltipProps: { tooltip: Ie ? P : N },
1051
- onClick: Je
1063
+ "aria-label": Z ? P : N,
1064
+ "aria-pressed": Z,
1065
+ tooltipProps: { tooltip: Z ? P : N },
1066
+ onClick: Qe
1052
1067
  }),
1053
- tt && /* @__PURE__ */ U(T, {
1054
- icon: U(je ? A : ee, {
1068
+ ot && /* @__PURE__ */ V(T, {
1069
+ icon: V(X ? A : ee, {
1055
1070
  size: S.LG,
1056
1071
  stroke: C,
1057
1072
  "aria-hidden": !0
1058
1073
  }),
1059
- "aria-label": je ? p : f,
1060
- tooltipProps: { tooltip: je ? p : f },
1061
- onClick: Ge
1074
+ "aria-label": X ? p : f,
1075
+ tooltipProps: { tooltip: X ? p : f },
1076
+ onClick: Ye
1062
1077
  }),
1063
- nt && /* @__PURE__ */ U(T, {
1064
- icon: U(Ne ? A : re, {
1078
+ st && /* @__PURE__ */ V(T, {
1079
+ icon: V(Le ? A : re, {
1065
1080
  size: S.LG,
1066
1081
  stroke: C,
1067
1082
  "aria-hidden": !0
1068
1083
  }),
1069
- "aria-label": Ne ? g : h,
1070
- tooltipProps: { tooltip: Ne ? g : h },
1071
- onClick: Ke
1084
+ "aria-label": Le ? g : h,
1085
+ tooltipProps: { tooltip: Le ? g : h },
1086
+ onClick: Xe
1072
1087
  }),
1073
- rt && /* @__PURE__ */ U(T, {
1074
- icon: U(Fe ? A : ee, {
1088
+ ct && /* @__PURE__ */ V(T, {
1089
+ icon: V(He ? A : ee, {
1075
1090
  size: S.LG,
1076
1091
  stroke: C,
1077
1092
  "aria-hidden": !0
1078
1093
  }),
1079
- "aria-label": Fe ? y : v,
1080
- tooltipProps: { tooltip: Fe ? y : v },
1081
- onClick: qe
1094
+ "aria-label": He ? y : v,
1095
+ tooltipProps: { tooltip: He ? y : v },
1096
+ onClick: Ze
1082
1097
  }),
1083
- it && /* @__PURE__ */ U(T, {
1084
- icon: /* @__PURE__ */ U(te, {
1098
+ lt && /* @__PURE__ */ V(T, {
1099
+ icon: /* @__PURE__ */ V(te, {
1085
1100
  size: S.LG,
1086
1101
  stroke: C
1087
1102
  }),
1088
1103
  "aria-label": d,
1089
1104
  tooltipProps: { tooltip: d },
1090
- onClick: ve
1105
+ onClick: J
1091
1106
  })
1092
1107
  ] }) : null,
1093
- children: /* @__PURE__ */ U(ze, {
1108
+ children: /* @__PURE__ */ V(ze, {
1094
1109
  content: r,
1095
1110
  isLoading: t,
1096
1111
  fileName: a,
1097
- isHtmlSourceView: Ie,
1098
- onAppInfo: r.type === i.McpApp ? He : void 0,
1112
+ isHtmlSourceView: Z,
1113
+ onAppInfo: r.type === i.McpApp ? Ke : void 0,
1099
1114
  labels: {
1100
1115
  unsupportedLabel: E,
1101
1116
  loadErrorLabel: D,
@@ -1105,27 +1120,32 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
1105
1120
  htmlOpenInNewTabLabel: ne,
1106
1121
  pdfThumbnailsLabel: ae,
1107
1122
  pdfShowThumbnailsLabel: oe,
1108
- pdfHideThumbnailsLabel: V,
1109
- pdfPageNumberLabel: G,
1110
- pdfContentLoadingLabel: K,
1111
- pdfContentErrorLabel: se,
1112
- pdfContentRetryLabel: ce,
1113
- xlsxFormulaLabel: le,
1114
- codeContentLoadingLabel: ue,
1123
+ pdfHideThumbnailsLabel: se,
1124
+ pdfPageNumberLabel: le,
1125
+ pdfContentLoadingLabel: ue,
1126
+ pdfContentErrorLabel: U,
1127
+ pdfContentRetryLabel: W,
1128
+ xlsxFormulaLabel: de,
1129
+ codeContentLoadingLabel: G,
1115
1130
  codeContentErrorLabel: fe,
1116
- codeContentRetryLabel: q,
1117
- tableCopyLabel: pe,
1118
- tableCopiedLabel: me,
1119
- tableDownloadCsvLabel: he,
1120
- ooxmlHighlightsLabel: ge,
1121
- ooxmlHighlightNavigatedLabel: _e
1131
+ codeContentRetryLabel: pe,
1132
+ tableCopyLabel: me,
1133
+ tableCopiedLabel: he,
1134
+ tableDownloadCsvLabel: ge,
1135
+ codeBlockCopyLabel: _e,
1136
+ codeBlockCopiedLabel: ve,
1137
+ codeBlockDownloadLabel: ye,
1138
+ tableScrollRegionAriaLabel: q,
1139
+ mathScrollRegionAriaLabel: be,
1140
+ ooxmlHighlightsLabel: xe,
1141
+ ooxmlHighlightNavigatedLabel: Se
1122
1142
  },
1123
- styles: Ze,
1124
- codeBlockTheme: De,
1125
- tableDownloadFilename: Se,
1126
- loadPdf: Oe,
1127
- configurePdfWorker: ke,
1128
- onVisualizerSendMessage: Ae
1143
+ styles: et,
1144
+ codeBlockTheme: Me,
1145
+ tableDownloadFilename: Te,
1146
+ loadPdf: Ne,
1147
+ configurePdfWorker: Pe,
1148
+ onVisualizerSendMessage: Fe
1129
1149
  })
1130
1150
  });
1131
1151
  }), Ue = new Set(["html", "htm"]), Z = {
@@ -1147,7 +1167,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
1147
1167
  [r.Xlsx]: Z.xlsx,
1148
1168
  [r.Pptx]: Z.pptx,
1149
1169
  [r.Csv]: f.CSV
1150
- }, Je = (e, t) => {
1170
+ }, Q = (e, t) => {
1151
1171
  let n = t?.split(";", 1)[0].trim().toLowerCase();
1152
1172
  if (n != null) {
1153
1173
  let e = Ke[n];
@@ -1155,13 +1175,13 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
1155
1175
  }
1156
1176
  let r = e.lastIndexOf(".");
1157
1177
  if (r !== -1) return Ge[e.slice(r + 1).toLowerCase()];
1158
- }, Ye = (e, t) => Je(e, t) != null, Xe = (e, t) => {
1159
- let n = Je(e, t);
1178
+ }, Je = (e, t) => Q(e, t) != null, Ye = (e, t) => {
1179
+ let n = Q(e, t);
1160
1180
  return n == null ? void 0 : qe[n];
1161
- }, Ze = (e) => {
1181
+ }, Xe = (e) => {
1162
1182
  let t = e.lastIndexOf(".");
1163
1183
  return t === -1 ? !1 : We.has(e.slice(t + 1).toLowerCase());
1164
- }, Q = (e) => {
1184
+ }, Ze = (e) => {
1165
1185
  let t = e.lastIndexOf(".");
1166
1186
  return t === -1 ? !1 : Ue.has(e.slice(t + 1).toLowerCase());
1167
1187
  }, Qe = {
@@ -1244,7 +1264,7 @@ var ot = ({ children: e }) => {
1244
1264
  return L(() => () => {
1245
1265
  let e = nt(a);
1246
1266
  e != null && URL.revokeObjectURL(e);
1247
- }, [a]), /* @__PURE__ */ U(at.Provider, {
1267
+ }, [a]), /* @__PURE__ */ V(at.Provider, {
1248
1268
  value: R(() => ({
1249
1269
  isOpen: t,
1250
1270
  isLoading: r,
@@ -1271,21 +1291,21 @@ var ot = ({ children: e }) => {
1271
1291
  if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
1272
1292
  return e;
1273
1293
  }, ct = F(({ labels: e, leftActions: t, isMobile: n = !1, defaultWidth: r, maxWidth: o, codeBlockTheme: s, tableDownloadFilename: c, loadPdf: l, configurePdfWorker: u, onVisualizerSendMessage: d }) => {
1274
- 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: j, pdfPageNumberLabel: ee, pdfContentLoadingLabel: te, pdfContentErrorLabel: M, pdfContentRetryLabel: ne, xlsxFormulaLabel: re, codeContentLoadingLabel: ie, codeContentErrorLabel: N, codeContentRetryLabel: P, tableCopyLabel: F, tableCopiedLabel: ae, tableDownloadCsvLabel: L, ooxmlHighlightsLabel: R, ooxmlHighlightNavigatedLabel: z } = e ?? {}, { isOpen: B, isLoading: oe, content: V, fileName: H, closeCanvas: W } = st(), G = I(() => {
1275
- a(V, H);
1276
- }, [V, H]), K = I(() => {
1277
- (V.type === i.PlainText || V.type === i.Code) && h(V.text);
1278
- }, [V]), se = I(() => {
1279
- V.type === i.Markdown && h(V.text);
1280
- }, [V]), ce = I(() => {
1281
- V.type === i.Json && h(JSON.stringify(V.value, null, 2));
1282
- }, [V]);
1283
- return /* @__PURE__ */ U(He, {
1284
- isOpen: B,
1285
- isLoading: oe,
1286
- onClose: W,
1287
- content: V,
1288
- fileName: H,
1294
+ 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: j, pdfPageNumberLabel: ee, pdfContentLoadingLabel: te, pdfContentErrorLabel: M, pdfContentRetryLabel: ne, xlsxFormulaLabel: re, codeContentLoadingLabel: ie, codeContentErrorLabel: N, codeContentRetryLabel: P, tableCopyLabel: F, tableCopiedLabel: ae, tableDownloadCsvLabel: L, codeBlockCopyLabel: R, codeBlockCopiedLabel: z, codeBlockDownloadLabel: B, tableScrollRegionAriaLabel: oe, mathScrollRegionAriaLabel: se, ooxmlHighlightsLabel: ce, ooxmlHighlightNavigatedLabel: H } = e ?? {}, { isOpen: le, isLoading: ue, content: U, fileName: W, closeCanvas: de } = st(), G = I(() => {
1295
+ a(U, W);
1296
+ }, [U, W]), K = I(() => {
1297
+ (U.type === i.PlainText || U.type === i.Code) && h(U.text);
1298
+ }, [U]), fe = I(() => {
1299
+ U.type === i.Markdown && h(U.text);
1300
+ }, [U]), pe = I(() => {
1301
+ U.type === i.Json && h(JSON.stringify(U.value, null, 2));
1302
+ }, [U]);
1303
+ return /* @__PURE__ */ V(He, {
1304
+ isOpen: le,
1305
+ isLoading: ue,
1306
+ onClose: de,
1307
+ content: U,
1308
+ fileName: W,
1289
1309
  leftActions: t,
1290
1310
  labels: {
1291
1311
  ariaLabel: f,
@@ -1318,13 +1338,18 @@ var ot = ({ children: e }) => {
1318
1338
  tableCopyLabel: F,
1319
1339
  tableCopiedLabel: ae,
1320
1340
  tableDownloadCsvLabel: L,
1321
- ooxmlHighlightsLabel: R,
1322
- ooxmlHighlightNavigatedLabel: z
1341
+ codeBlockCopyLabel: R,
1342
+ codeBlockCopiedLabel: z,
1343
+ codeBlockDownloadLabel: B,
1344
+ tableScrollRegionAriaLabel: oe,
1345
+ mathScrollRegionAriaLabel: se,
1346
+ ooxmlHighlightsLabel: ce,
1347
+ ooxmlHighlightNavigatedLabel: H
1323
1348
  },
1324
1349
  onDownload: G,
1325
- onCopyText: V.type === i.PlainText || V.type === i.Code ? K : void 0,
1326
- onCopyMarkdown: V.type === i.Markdown ? se : void 0,
1327
- onCopyJson: V.type === i.Json ? ce : void 0,
1350
+ onCopyText: U.type === i.PlainText || U.type === i.Code ? K : void 0,
1351
+ onCopyMarkdown: U.type === i.Markdown ? fe : void 0,
1352
+ onCopyJson: U.type === i.Json ? pe : void 0,
1328
1353
  tableDownloadFilename: c,
1329
1354
  isMobile: n,
1330
1355
  defaultWidth: r,
@@ -1335,29 +1360,29 @@ var ot = ({ children: e }) => {
1335
1360
  onVisualizerSendMessage: d
1336
1361
  });
1337
1362
  }), lt = {
1338
- frame: "_frame_g47g7_1",
1339
- header: "_header_g47g7_6",
1340
- title: "_title_g47g7_10"
1363
+ frame: "_frame_1ys0b_1",
1364
+ header: "_header_1ys0b_6",
1365
+ title: "_title_1ys0b_10"
1341
1366
  }, ut = 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 }) => {
1342
1367
  let p = e.visualizerName.trim(), h = !u && p !== "";
1343
- return /* @__PURE__ */ W("div", {
1368
+ return /* @__PURE__ */ H("div", {
1344
1369
  className: _("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border", lt.frame]),
1345
1370
  style: m({
1346
1371
  "--igv-bg": d?.background,
1347
1372
  "--igv-border": d?.border,
1348
1373
  "--igv-title-text": d?.titleText
1349
1374
  }),
1350
- children: [/* @__PURE__ */ W("div", {
1375
+ children: [/* @__PURE__ */ H("div", {
1351
1376
  className: _("flex min-h-10 items-center gap-2 py-2", h ? "justify-between" : "justify-end", !l && ["border-b px-4", lt.header]),
1352
- children: [h && /* @__PURE__ */ U("span", {
1377
+ children: [h && /* @__PURE__ */ V("span", {
1353
1378
  className: _("min-w-0 truncate", c, lt.title),
1354
1379
  children: p
1355
- }), /* @__PURE__ */ U("div", {
1380
+ }), /* @__PURE__ */ V("div", {
1356
1381
  role: "toolbar",
1357
1382
  "aria-label": i,
1358
1383
  className: "flex items-center gap-1",
1359
- children: /* @__PURE__ */ U(T, {
1360
- icon: /* @__PURE__ */ U(k, {
1384
+ children: /* @__PURE__ */ V(T, {
1385
+ icon: /* @__PURE__ */ V(k, {
1361
1386
  size: S.SM,
1362
1387
  stroke: C,
1363
1388
  "aria-hidden": !0
@@ -1367,10 +1392,10 @@ var ot = ({ children: e }) => {
1367
1392
  onClick: n
1368
1393
  })
1369
1394
  })]
1370
- }), /* @__PURE__ */ U("div", {
1395
+ }), /* @__PURE__ */ V("div", {
1371
1396
  className: "w-full",
1372
1397
  style: { height: `${t}px` },
1373
- children: /* @__PURE__ */ U(Fe, {
1398
+ children: /* @__PURE__ */ V(Fe, {
1374
1399
  content: e,
1375
1400
  loadingLabel: o,
1376
1401
  errorLabel: s,
@@ -1407,14 +1432,14 @@ var ot = ({ children: e }) => {
1407
1432
  let i = await e.resolveTextContent(t);
1408
1433
  if (i != null) return r(i, t.name, n);
1409
1434
  }
1410
- let l = Je("", a);
1435
+ let l = Q("", a);
1411
1436
  if (l != null) return r(await e.resolveOoxmlContent(t, l) ?? $(e.resolveContentUrl(t)), t.name, n);
1412
1437
  switch (a) {
1413
1438
  case f.PDF: return r(await e.resolvePdfContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1414
1439
  case f.Markdown: return r(await e.resolveMarkdownContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1415
1440
  case f.JSON: return r(await e.resolveJsonContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1416
1441
  }
1417
- let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h = Je(u);
1442
+ let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h = Q(u);
1418
1443
  if (h != null) return r(await e.resolveOoxmlContent(t, h) ?? $(e.resolveContentUrl(t)), t.name, n);
1419
1444
  switch (m) {
1420
1445
  case d.Markdown:
@@ -1431,8 +1456,8 @@ var ot = ({ children: e }) => {
1431
1456
  return i == null ? !1 : r(i, t.name, n);
1432
1457
  }
1433
1458
  }
1434
- let g = t.name != null && Q(t.name) || t.url != null && Q(dt(t.url));
1435
- if (t.name != null && !Ze(t.name) && !g) return r($(e.resolveContentUrl(t)), t.name, n);
1459
+ let g = t.name != null && Ze(t.name) || t.url != null && Ze(dt(t.url));
1460
+ if (t.name != null && !Xe(t.name) && !g) return r($(e.resolveContentUrl(t)), t.name, n);
1436
1461
  if (g) {
1437
1462
  let a = await e.resolveHtmlContent(t);
1438
1463
  return a == null ? e.hasTextSource(t) ? r($(e.resolveContentUrl(t)), t.name, n) : t.url == null ? !1 : r({
@@ -1485,4 +1510,4 @@ var ot = ({ children: e }) => {
1485
1510
  ]) };
1486
1511
  };
1487
1512
  //#endregion
1488
- export { de as ATTACHMENT_CANVAS_CLASS, He as AttachmentCanvas, ze as AttachmentCanvasBody, ct as AttachmentCanvasContainer, ot as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, me as CodeContent, he as HTML_PREVIEW_FRAME_RENDER_MESSAGE, ut as InlineGroupedVisualizer, Ce 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, Je as getOoxmlFileType, Xe as getOoxmlMimeType, je as groupedVisualizerCanvasKey, o as isDownloadable, Q as isHtmlPreviewable, Ye as isOoxmlPreviewable, Ze as isTextPreviewable, Me as partitionAttachmentsForApplicationVisualizer, st as useAttachmentCanvas, ft as useOpenAttachmentCanvas };
1513
+ export { K 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, Ce 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 };