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