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