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