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