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