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