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