@epam/ai-dial-attachment-canvas 1.2.0-dev.318 → 1.2.0-dev.321
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/PdfContent-ELaDSyFF.js +266 -0
- package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts.map +1 -1
- package/components/PdfContent/PdfContent.d.ts +2 -0
- package/components/PdfContent/PdfContent.d.ts.map +1 -1
- package/index.js +306 -296
- package/package.json +4 -4
- package/PdfContent-BoAtghsO.js +0 -260
package/index.js
CHANGED
|
@@ -3,41 +3,41 @@ import { i as a, o, t as s } from "./LazyContentBoundary-tNE1ExbI.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
5
|
import { DIAL_ICON_SIZE as S, DIAL_KIT_ICON_STROKE as C, ElementSize as w, GhostIconButton as T, LinkButton as E, Spinner as D } from "@epam/ai-dial-ui-kit";
|
|
6
|
-
import { IconAlertTriangle as O, IconArrowsMaximize as k, IconCheck as A, IconCode as
|
|
7
|
-
import { createContext as
|
|
8
|
-
import { JsonView as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { AppBridge as
|
|
6
|
+
import { IconAlertTriangle as O, IconArrowsMaximize as k, IconCheck as A, IconCode as ee, IconCopy as te, IconDownload as ne, IconEye as j, IconLock as re, IconMarkdown as ie, IconRefresh as ae } from "@tabler/icons-react";
|
|
7
|
+
import { createContext as M, lazy as N, memo as P, useCallback as F, useContext as oe, useEffect as I, useMemo as L, useRef as R, useState as z } from "react";
|
|
8
|
+
import { JsonView as se, defaultStyles as ce } from "react-json-view-lite";
|
|
9
|
+
import { Fragment as le, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
10
|
+
import { AppBridge as H, AppFrame as ue } from "@mcp-ui/client";
|
|
11
11
|
import { McpUiHostContextChangedNotificationSchema as U } from "@modelcontextprotocol/ext-apps/app-bridge";
|
|
12
12
|
import { VisualizerConnectorEvents as W, VisualizerConnectorRequests as de } from "@epam/ai-dial-shared";
|
|
13
|
-
import { VisualizerConnector as
|
|
13
|
+
import { VisualizerConnector as fe } from "@epam/ai-dial-visualizer-connector";
|
|
14
14
|
//#region src/constants/public-class-names.ts
|
|
15
|
-
var
|
|
15
|
+
var pe = { panel: "dial-attachment-canvas-panel" }, G = {
|
|
16
16
|
container: "_container_1nhig_1",
|
|
17
17
|
containerLight: "_containerLight_1nhig_5"
|
|
18
|
-
},
|
|
18
|
+
}, K = {
|
|
19
19
|
[l.Dark]: v,
|
|
20
20
|
[l.Light]: v
|
|
21
|
-
}, me = () =>
|
|
21
|
+
}, me = () => N(async () => {
|
|
22
22
|
let { Prism: e } = await import("react-syntax-highlighter");
|
|
23
23
|
return { default: e };
|
|
24
|
-
}), he =
|
|
25
|
-
let { text: r, language: i } = e, a =
|
|
24
|
+
}), he = P(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
|
|
25
|
+
let { text: r, language: i } = e, a = L(() => g(r), [r]), o = i == null || i === "plaintext" || !a, c = K[t], u = t === l.Light, [d, f] = z(0), p = L(me, [d]), m = F(() => {
|
|
26
26
|
f((e) => e + 1);
|
|
27
|
-
}, []), h = /* @__PURE__ */
|
|
27
|
+
}, []), h = /* @__PURE__ */ B("pre", {
|
|
28
28
|
className: "whitespace-pre-wrap break-words p-4",
|
|
29
29
|
children: r
|
|
30
30
|
});
|
|
31
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ B("div", {
|
|
32
32
|
dir: "ltr",
|
|
33
|
-
className: _("h-full overflow-auto",
|
|
34
|
-
children: o ? h : /* @__PURE__ */
|
|
33
|
+
className: _("h-full overflow-auto", G.container, u && G.containerLight),
|
|
34
|
+
children: o ? h : /* @__PURE__ */ B(s, {
|
|
35
35
|
retryKey: d,
|
|
36
36
|
onRetry: m,
|
|
37
37
|
pendingContent: h,
|
|
38
38
|
errorContent: h,
|
|
39
39
|
labels: n,
|
|
40
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ B(p, {
|
|
41
41
|
language: i,
|
|
42
42
|
style: c,
|
|
43
43
|
customStyle: {
|
|
@@ -54,8 +54,8 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
54
54
|
})
|
|
55
55
|
})
|
|
56
56
|
});
|
|
57
|
-
}), ge = "dial-html-preview:render", _e = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, ve =
|
|
58
|
-
let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] =
|
|
57
|
+
}), ge = "dial-html-preview:render", _e = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, ve = P(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
|
|
58
|
+
let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = z(!0), [d, f] = z(!1), [p, m] = z(void 0), [h, g] = z(!1), [v, y] = z(!1), b = R(null), x = R(null), S = R(!1), C = R({
|
|
59
59
|
content: e,
|
|
60
60
|
generation: 0
|
|
61
61
|
});
|
|
@@ -64,11 +64,11 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
64
64
|
generation: C.current.generation + 1
|
|
65
65
|
});
|
|
66
66
|
let w = C.current.generation;
|
|
67
|
-
|
|
67
|
+
I(() => {
|
|
68
68
|
u(!0), f(!1), m(void 0), g(!1), y(!1);
|
|
69
69
|
}, [e]);
|
|
70
|
-
let T =
|
|
71
|
-
T.current !== n && (T.current = n, n && v && y(!1), !n && S.current && (S.current = !1, u(!0))),
|
|
70
|
+
let T = R(n);
|
|
71
|
+
T.current !== n && (T.current = n, n && v && y(!1), !n && S.current && (S.current = !1, u(!0))), I(() => {
|
|
72
72
|
if (!n || e.srcdoc != null || e.resolveSourceText == null || p != null) return;
|
|
73
73
|
let t = !1, r = e.resolveSourceText;
|
|
74
74
|
return (async () => {
|
|
@@ -89,12 +89,12 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
89
89
|
e,
|
|
90
90
|
p
|
|
91
91
|
]);
|
|
92
|
-
let O = e.isSameOriginUrl === !0 && e.url != null, k = !O && e.srcdoc != null, A = k ? e.srcdocHostUrl : void 0,
|
|
92
|
+
let O = e.isSameOriginUrl === !0 && e.url != null, k = !O && e.srcdoc != null, A = k ? e.srcdocHostUrl : void 0, ee = e.srcdoc, te = F((e) => {
|
|
93
93
|
if (u(!1), A != null) {
|
|
94
94
|
let e = b.current?.contentWindow;
|
|
95
|
-
e != null && e !== x.current &&
|
|
95
|
+
e != null && e !== x.current && ee != null && (x.current = e, e.postMessage({
|
|
96
96
|
type: ge,
|
|
97
|
-
html:
|
|
97
|
+
html: ee
|
|
98
98
|
}, "*"));
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
@@ -107,27 +107,27 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
107
107
|
k,
|
|
108
108
|
O,
|
|
109
109
|
A,
|
|
110
|
-
|
|
111
|
-
]),
|
|
110
|
+
ee
|
|
111
|
+
]), ne = F(() => {
|
|
112
112
|
u(!1), f(!0);
|
|
113
|
-
}, []),
|
|
114
|
-
if (n &&
|
|
113
|
+
}, []), j = e.srcdoc ?? p, re = e.srcdoc != null || e.resolveSourceText != null, ie = e.srcdoc == null && e.resolveSourceText != null && p == null && !v;
|
|
114
|
+
if (n && re && (j != null || h || ie)) return S.current = !0, j == null ? /* @__PURE__ */ B("div", {
|
|
115
115
|
className: "flex h-full items-center justify-center",
|
|
116
|
-
children: /* @__PURE__ */
|
|
117
|
-
}) : /* @__PURE__ */
|
|
116
|
+
children: /* @__PURE__ */ B(D, {})
|
|
117
|
+
}) : /* @__PURE__ */ B(he, {
|
|
118
118
|
content: {
|
|
119
119
|
type: i.Code,
|
|
120
|
-
text:
|
|
120
|
+
text: j,
|
|
121
121
|
language: "html"
|
|
122
122
|
},
|
|
123
123
|
codeBlockTheme: a
|
|
124
124
|
});
|
|
125
|
-
if (d) return /* @__PURE__ */
|
|
125
|
+
if (d) return /* @__PURE__ */ V("div", {
|
|
126
126
|
className: "flex h-full flex-col items-center justify-center gap-3 p-4",
|
|
127
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ B("p", {
|
|
128
128
|
className: "text-center",
|
|
129
129
|
children: s
|
|
130
|
-
}), e.url != null && /* @__PURE__ */
|
|
130
|
+
}), e.url != null && /* @__PURE__ */ B(E, {
|
|
131
131
|
href: e.url,
|
|
132
132
|
target: "_blank",
|
|
133
133
|
label: c,
|
|
@@ -135,27 +135,27 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
135
135
|
textClassName: o
|
|
136
136
|
})]
|
|
137
137
|
});
|
|
138
|
-
let
|
|
139
|
-
return /* @__PURE__ */
|
|
138
|
+
let ae = k ? A : e.url, M = k && A == null ? e.srcdoc : void 0;
|
|
139
|
+
return /* @__PURE__ */ V("div", {
|
|
140
140
|
className: "relative h-full",
|
|
141
|
-
children: [l && /* @__PURE__ */
|
|
141
|
+
children: [l && /* @__PURE__ */ B("div", {
|
|
142
142
|
className: "absolute inset-0 flex items-center justify-center",
|
|
143
|
-
children: /* @__PURE__ */
|
|
144
|
-
}), /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ B(D, {})
|
|
144
|
+
}), /* @__PURE__ */ B("iframe", {
|
|
145
145
|
ref: b,
|
|
146
146
|
title: r,
|
|
147
|
-
src:
|
|
148
|
-
srcDoc:
|
|
147
|
+
src: ae,
|
|
148
|
+
srcDoc: M,
|
|
149
149
|
sandbox: k || O ? "allow-scripts" : "allow-scripts allow-same-origin",
|
|
150
150
|
className: _("h-full w-full border-none", l ? "invisible" : ""),
|
|
151
|
-
onLoad:
|
|
152
|
-
onError:
|
|
151
|
+
onLoad: te,
|
|
152
|
+
onError: ne
|
|
153
153
|
}, w)]
|
|
154
154
|
});
|
|
155
155
|
}), ye = {
|
|
156
156
|
name: "MCP-UI Host",
|
|
157
157
|
version: "1.0.0"
|
|
158
|
-
},
|
|
158
|
+
}, be = { openLinks: {} }, xe = (e) => {
|
|
159
159
|
let t;
|
|
160
160
|
try {
|
|
161
161
|
t = new URL(e);
|
|
@@ -169,20 +169,20 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
169
169
|
return !1;
|
|
170
170
|
}
|
|
171
171
|
return !0;
|
|
172
|
-
},
|
|
172
|
+
}, Se = (e, t, n) => {
|
|
173
173
|
if (n) {
|
|
174
174
|
e.style.maxWidth = "", e.style.maxHeight = "";
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
177
|
let r = t;
|
|
178
178
|
r != null && (r.width != null && (e.style.width = `${r.width}px`), r.maxWidth != null && (e.style.maxWidth = `${r.maxWidth}px`), r.height != null && (e.style.height = `${r.height}px`), r.maxHeight != null && (e.style.maxHeight = `${r.maxHeight}px`));
|
|
179
|
-
},
|
|
180
|
-
let r =
|
|
181
|
-
|
|
179
|
+
}, Ce = (e, t, n) => {
|
|
180
|
+
let r = R(e);
|
|
181
|
+
I(() => {
|
|
182
182
|
r.current = e;
|
|
183
183
|
});
|
|
184
|
-
let [i, a] =
|
|
185
|
-
return
|
|
184
|
+
let [i, a] = z(null), [o, s] = z(!1);
|
|
185
|
+
return I(() => {
|
|
186
186
|
let e = null;
|
|
187
187
|
try {
|
|
188
188
|
let n = t.current?.getBoundingClientRect(), i = n != null && n.width > 0 && n.height > 0 ? {
|
|
@@ -192,15 +192,15 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
192
192
|
height: Math.round(n.height)
|
|
193
193
|
}
|
|
194
194
|
} : r.current.hostContext;
|
|
195
|
-
e = new
|
|
195
|
+
e = new H(null, r.current.hostInfo ?? ye, be, { hostContext: i }), e.onopenlink = async ({ url: e }) => {
|
|
196
196
|
let t = r.current.onOpenLink;
|
|
197
|
-
return (t == null ?
|
|
197
|
+
return (t == null ? xe(e) : t(e)) === !1 ? { isError: !0 } : {};
|
|
198
198
|
}, e.onrequestdisplaymode = async ({ mode: e }) => {
|
|
199
199
|
let t = r.current.onRequestDisplayMode, n = r.current.hostContext?.displayMode ?? "inline";
|
|
200
200
|
return { mode: t?.(e) ?? n };
|
|
201
201
|
}, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(U, ({ params: e }) => {
|
|
202
202
|
let n = t.current?.querySelector("iframe");
|
|
203
|
-
n != null &&
|
|
203
|
+
n != null && Se(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
|
|
204
204
|
}), a(e);
|
|
205
205
|
} catch (e) {
|
|
206
206
|
console.error("[useMcpAppBridge] Error creating AppBridge:", e), s(!0);
|
|
@@ -208,22 +208,22 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
208
208
|
return () => {
|
|
209
209
|
e?.close().catch((e) => console.error("[useMcpAppBridge] Error closing AppBridge:", e));
|
|
210
210
|
};
|
|
211
|
-
}, [t]),
|
|
211
|
+
}, [t]), I(() => {
|
|
212
212
|
i != null && i.transport != null && n != null && i.setHostContext(n);
|
|
213
213
|
}, [i, n]), {
|
|
214
214
|
appBridge: i,
|
|
215
215
|
hasFailed: o
|
|
216
216
|
};
|
|
217
|
-
},
|
|
217
|
+
}, q = {
|
|
218
218
|
loadingOverlay: "_loadingOverlay_sqrel_2",
|
|
219
219
|
fullscreenFrame: "_fullscreenFrame_sqrel_21",
|
|
220
220
|
loadingFrame: "_loadingFrame_sqrel_29",
|
|
221
221
|
statusLabel: "_statusLabel_sqrel_33",
|
|
222
222
|
statusDetail: "_statusDetail_sqrel_38",
|
|
223
223
|
errorIcon: "_errorIcon_sqrel_42"
|
|
224
|
-
},
|
|
225
|
-
let [r, i] =
|
|
226
|
-
|
|
224
|
+
}, we = ({ content: e, errorLabel: t = "Failed to load app", onAppInfo: n }) => {
|
|
225
|
+
let [r, i] = z("loading"), [a, o] = z(), { html: s, sandboxUrl: c, toolInput: l, toolResult: u, hostContext: d } = e, f = L(() => ({ url: new URL(c) }), [c]), p = d?.displayMode === "fullscreen", m = R(null), [h, g] = z();
|
|
226
|
+
I(() => {
|
|
227
227
|
let e = m.current;
|
|
228
228
|
if (!e) return;
|
|
229
229
|
let t = new ResizeObserver(([e]) => {
|
|
@@ -236,15 +236,15 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
236
236
|
});
|
|
237
237
|
return t.observe(e), () => t.disconnect();
|
|
238
238
|
}, []);
|
|
239
|
-
let { appBridge: v, hasFailed: y } =
|
|
239
|
+
let { appBridge: v, hasFailed: y } = Ce(e, m, L(() => d == null || h == null ? d : {
|
|
240
240
|
...d,
|
|
241
241
|
containerDimensions: h
|
|
242
242
|
}, [d, h])), b = y || r === "error";
|
|
243
|
-
return /* @__PURE__ */
|
|
243
|
+
return /* @__PURE__ */ V("div", {
|
|
244
244
|
ref: m,
|
|
245
|
-
className: _("relative h-full min-h-[200px] w-full", p &&
|
|
245
|
+
className: _("relative h-full min-h-[200px] w-full", p && q.fullscreenFrame, !p && r === "loading" && q.loadingFrame),
|
|
246
246
|
children: [
|
|
247
|
-
v != null && !b && /* @__PURE__ */
|
|
247
|
+
v != null && !b && /* @__PURE__ */ B(ue, {
|
|
248
248
|
html: s,
|
|
249
249
|
sandbox: f,
|
|
250
250
|
appBridge: v,
|
|
@@ -258,29 +258,29 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
258
258
|
o(e.message), i("error");
|
|
259
259
|
}
|
|
260
260
|
}),
|
|
261
|
-
!b && r === "loading" && /* @__PURE__ */
|
|
262
|
-
className: _("absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
263
|
-
children: /* @__PURE__ */
|
|
261
|
+
!b && r === "loading" && /* @__PURE__ */ B("div", {
|
|
262
|
+
className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", q.loadingOverlay),
|
|
263
|
+
children: /* @__PURE__ */ B(D, {})
|
|
264
264
|
}),
|
|
265
|
-
b && /* @__PURE__ */
|
|
265
|
+
b && /* @__PURE__ */ V("div", {
|
|
266
266
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-2 p-4",
|
|
267
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ B(O, {
|
|
268
268
|
size: 60,
|
|
269
269
|
stroke: C,
|
|
270
270
|
"aria-hidden": !0,
|
|
271
|
-
className:
|
|
272
|
-
}), /* @__PURE__ */
|
|
271
|
+
className: q.errorIcon
|
|
272
|
+
}), /* @__PURE__ */ V("p", {
|
|
273
273
|
role: "alert",
|
|
274
|
-
className: _("text-center",
|
|
275
|
-
children: [t, a && /* @__PURE__ */
|
|
276
|
-
className:
|
|
274
|
+
className: _("text-center", q.statusLabel),
|
|
275
|
+
children: [t, a && /* @__PURE__ */ V(le, { children: [/* @__PURE__ */ B("br", {}), /* @__PURE__ */ B("span", {
|
|
276
|
+
className: q.statusDetail,
|
|
277
277
|
children: a
|
|
278
278
|
})] })]
|
|
279
279
|
})]
|
|
280
280
|
})
|
|
281
281
|
]
|
|
282
282
|
});
|
|
283
|
-
},
|
|
283
|
+
}, J = {
|
|
284
284
|
viewer: "_viewer_sdlt9_2",
|
|
285
285
|
spreadsheetCanvas: "_spreadsheetCanvas_sdlt9_6",
|
|
286
286
|
formulaPanel: "_formulaPanel_sdlt9_12",
|
|
@@ -288,7 +288,7 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
288
288
|
statusOverlay: "_statusOverlay_sdlt9_24",
|
|
289
289
|
errorIcon: "_errorIcon_sdlt9_29",
|
|
290
290
|
highlight: "_highlight_sdlt9_37"
|
|
291
|
-
},
|
|
291
|
+
}, Y = (e) => {
|
|
292
292
|
if (e?.kind !== "range") return "";
|
|
293
293
|
let { activeCell: t } = e.selection, n = e.cells.find(({ address: e }) => e.row === t.row && e.col === t.col);
|
|
294
294
|
if (n == null) return "";
|
|
@@ -316,7 +316,7 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
316
316
|
}
|
|
317
317
|
case r.Csv: {
|
|
318
318
|
let { XlsxSheetViewer: t } = await import("@silurus/ooxml/xlsx"), r = document.createElement("canvas");
|
|
319
|
-
r.className =
|
|
319
|
+
r.className = J.spreadsheetCanvas, e.replaceChildren(r);
|
|
320
320
|
let i = new t(r, {
|
|
321
321
|
showScrollbars: !0,
|
|
322
322
|
onError: n
|
|
@@ -408,10 +408,10 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
}, De = class extends Error {}, Oe = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, highlightsLabel: s = "Cited locations", highlightNavigatedLabel: c = "Scrolled to the cited location" }) => {
|
|
411
|
-
let l =
|
|
411
|
+
let l = R(null), [u, d] = z(!0), [f, p] = z(!1), [m, h] = z(""), [g, v] = z([]), [y, b] = z(!1), { highlights: x, selectedHighlightId: S } = t, w = x != null && x.length > 0, T = R(void 0), E = R(x);
|
|
412
412
|
E.current = x;
|
|
413
|
-
let k =
|
|
414
|
-
return
|
|
413
|
+
let k = R(void 0);
|
|
414
|
+
return I(() => {
|
|
415
415
|
let e = l.current;
|
|
416
416
|
if (e == null) return;
|
|
417
417
|
let n, r, i = !1, a, o = () => i;
|
|
@@ -433,7 +433,7 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
433
433
|
i || (d(!1), p(!0));
|
|
434
434
|
},
|
|
435
435
|
onXlsxSelectionContextChange: (e) => {
|
|
436
|
-
i || h(
|
|
436
|
+
i || h(Y(e));
|
|
437
437
|
},
|
|
438
438
|
onGeometryInvalidated: s
|
|
439
439
|
}, f = () => {
|
|
@@ -472,9 +472,9 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
472
472
|
t.format,
|
|
473
473
|
t.url,
|
|
474
474
|
w
|
|
475
|
-
]),
|
|
475
|
+
]), I(() => {
|
|
476
476
|
k.current?.();
|
|
477
|
-
}, [x]),
|
|
477
|
+
}, [x]), I(() => {
|
|
478
478
|
b(!1);
|
|
479
479
|
let t = T.current;
|
|
480
480
|
if (t == null || u) return;
|
|
@@ -492,38 +492,38 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
492
492
|
})(), () => {
|
|
493
493
|
r = !0;
|
|
494
494
|
};
|
|
495
|
-
}, [S, u]), /* @__PURE__ */
|
|
495
|
+
}, [S, u]), /* @__PURE__ */ V("div", {
|
|
496
496
|
className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
|
|
497
497
|
children: [
|
|
498
|
-
t.format === r.Xlsx && /* @__PURE__ */
|
|
498
|
+
t.format === r.Xlsx && /* @__PURE__ */ V("div", {
|
|
499
499
|
role: "region",
|
|
500
500
|
"aria-label": a,
|
|
501
|
-
className: _("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2",
|
|
502
|
-
children: [/* @__PURE__ */
|
|
501
|
+
className: _("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", J.formulaPanel),
|
|
502
|
+
children: [/* @__PURE__ */ B("span", {
|
|
503
503
|
"aria-hidden": "true",
|
|
504
504
|
className: _("shrink-0", o),
|
|
505
505
|
children: "fx"
|
|
506
|
-
}), /* @__PURE__ */
|
|
506
|
+
}), /* @__PURE__ */ B("code", {
|
|
507
507
|
dir: "ltr",
|
|
508
508
|
tabIndex: 0,
|
|
509
509
|
"aria-live": "polite",
|
|
510
|
-
className: _("h-8 min-w-0 flex-1 overflow-x-auto whitespace-nowrap rounded border px-2 py-1 text-sm focus-visible:outline focus-visible:outline-focus",
|
|
510
|
+
className: _("h-8 min-w-0 flex-1 overflow-x-auto whitespace-nowrap rounded border px-2 py-1 text-sm focus-visible:outline focus-visible:outline-focus", J.formulaValue),
|
|
511
511
|
children: m
|
|
512
512
|
})]
|
|
513
513
|
}),
|
|
514
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ V("div", {
|
|
515
515
|
className: "relative min-h-0 w-full flex-1",
|
|
516
|
-
children: [/* @__PURE__ */
|
|
516
|
+
children: [/* @__PURE__ */ B("div", {
|
|
517
517
|
ref: l,
|
|
518
518
|
role: "document",
|
|
519
519
|
"aria-label": n,
|
|
520
520
|
"aria-busy": u,
|
|
521
|
-
className: _("h-full w-full overflow-hidden",
|
|
522
|
-
}), g.length > 0 && /* @__PURE__ */
|
|
521
|
+
className: _("h-full w-full overflow-hidden", J.viewer)
|
|
522
|
+
}), g.length > 0 && /* @__PURE__ */ B("div", {
|
|
523
523
|
role: "region",
|
|
524
524
|
"aria-label": s,
|
|
525
525
|
className: "pointer-events-none absolute inset-0 overflow-hidden",
|
|
526
|
-
children: g.map((e, t) => /* @__PURE__ */
|
|
526
|
+
children: g.map((e, t) => /* @__PURE__ */ B("div", {
|
|
527
527
|
"aria-hidden": "true",
|
|
528
528
|
style: {
|
|
529
529
|
left: `${e.left}px`,
|
|
@@ -533,28 +533,28 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
533
533
|
},
|
|
534
534
|
"data-selected": e.highlightId === S,
|
|
535
535
|
"data-clipped": e.isClippedAtEnd === !0,
|
|
536
|
-
className: _("absolute",
|
|
536
|
+
className: _("absolute", J.highlight)
|
|
537
537
|
}, `${e.highlightId}-${t}`))
|
|
538
538
|
})]
|
|
539
539
|
}),
|
|
540
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ B("div", {
|
|
541
541
|
role: "status",
|
|
542
542
|
"aria-live": "polite",
|
|
543
543
|
className: "sr-only",
|
|
544
544
|
children: y ? c : ""
|
|
545
545
|
}),
|
|
546
|
-
(u || f) && /* @__PURE__ */
|
|
546
|
+
(u || f) && /* @__PURE__ */ B("div", {
|
|
547
547
|
role: f ? "alert" : void 0,
|
|
548
548
|
"aria-live": "polite",
|
|
549
|
-
className: _("absolute inset-0 flex items-center justify-center",
|
|
550
|
-
children: u ? /* @__PURE__ */
|
|
549
|
+
className: _("absolute inset-0 flex items-center justify-center", J.statusOverlay),
|
|
550
|
+
children: u ? /* @__PURE__ */ B(D, { size: 48 }) : /* @__PURE__ */ V("div", {
|
|
551
551
|
className: "flex flex-col items-center gap-2",
|
|
552
|
-
children: [/* @__PURE__ */
|
|
552
|
+
children: [/* @__PURE__ */ B(O, {
|
|
553
553
|
"aria-hidden": "true",
|
|
554
554
|
size: 60,
|
|
555
555
|
stroke: C,
|
|
556
|
-
className:
|
|
557
|
-
}), /* @__PURE__ */
|
|
556
|
+
className: J.errorIcon
|
|
557
|
+
}), /* @__PURE__ */ B("p", {
|
|
558
558
|
className: "text-center",
|
|
559
559
|
children: i
|
|
560
560
|
})]
|
|
@@ -588,14 +588,14 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
588
588
|
statusLabel: "_statusLabel_12637_5",
|
|
589
589
|
errorIcon: "_errorIcon_12637_9"
|
|
590
590
|
}, Fe = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a, onSendMessage: o }) => {
|
|
591
|
-
let s =
|
|
591
|
+
let s = R(null), [c, l] = z("loading"), { url: u, visualizerName: d, requestTimeout: f } = e, p = R(e);
|
|
592
592
|
p.current = e;
|
|
593
|
-
let h =
|
|
594
|
-
return h.current = o,
|
|
593
|
+
let h = R(o);
|
|
594
|
+
return h.current = o, I(() => {
|
|
595
595
|
let e = s.current;
|
|
596
596
|
if (!e) return;
|
|
597
597
|
l("loading");
|
|
598
|
-
let t = new
|
|
598
|
+
let t = new fe(e, {
|
|
599
599
|
domain: u,
|
|
600
600
|
hostDomain: window.location.origin,
|
|
601
601
|
visualizerName: d,
|
|
@@ -631,7 +631,7 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
631
631
|
u,
|
|
632
632
|
d,
|
|
633
633
|
f
|
|
634
|
-
]),
|
|
634
|
+
]), I(() => {
|
|
635
635
|
let e = r ?? d.trim();
|
|
636
636
|
e !== "" && s.current?.querySelector("iframe")?.setAttribute("title", e);
|
|
637
637
|
}, [
|
|
@@ -639,7 +639,7 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
639
639
|
d,
|
|
640
640
|
u,
|
|
641
641
|
f
|
|
642
|
-
]), /* @__PURE__ */
|
|
642
|
+
]), /* @__PURE__ */ V("div", {
|
|
643
643
|
className: "relative h-full w-full",
|
|
644
644
|
style: m({
|
|
645
645
|
"--vs-loading-bg": a?.loadingBackground,
|
|
@@ -647,25 +647,25 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
647
647
|
"--vs-error-icon": a?.errorIcon
|
|
648
648
|
}),
|
|
649
649
|
children: [
|
|
650
|
-
/* @__PURE__ */
|
|
650
|
+
/* @__PURE__ */ B("div", {
|
|
651
651
|
ref: s,
|
|
652
652
|
className: "h-full w-full"
|
|
653
653
|
}),
|
|
654
|
-
c === "loading" && /* @__PURE__ */
|
|
654
|
+
c === "loading" && /* @__PURE__ */ V("div", {
|
|
655
655
|
className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", Pe.loadingOverlay),
|
|
656
|
-
children: [/* @__PURE__ */
|
|
656
|
+
children: [/* @__PURE__ */ B(D, {}), t && /* @__PURE__ */ B("p", {
|
|
657
657
|
className: _("text-center", Pe.statusLabel),
|
|
658
658
|
children: t
|
|
659
659
|
})]
|
|
660
660
|
}),
|
|
661
|
-
c === "error" && /* @__PURE__ */
|
|
661
|
+
c === "error" && /* @__PURE__ */ V("div", {
|
|
662
662
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
663
|
-
children: [/* @__PURE__ */
|
|
663
|
+
children: [/* @__PURE__ */ B(O, {
|
|
664
664
|
size: 60,
|
|
665
665
|
stroke: C,
|
|
666
666
|
"aria-hidden": !0,
|
|
667
667
|
className: Pe.errorIcon
|
|
668
|
-
}), /* @__PURE__ */
|
|
668
|
+
}), /* @__PURE__ */ B("p", {
|
|
669
669
|
role: "alert",
|
|
670
670
|
className: _("text-center", Pe.statusLabel),
|
|
671
671
|
children: n
|
|
@@ -688,21 +688,21 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
688
688
|
jsonExpandIcon: "_jsonExpandIcon_13ogb_54",
|
|
689
689
|
jsonCollapseIcon: "_jsonCollapseIcon_13ogb_67",
|
|
690
690
|
jsonCollapsedContent: "_jsonCollapsedContent_13ogb_84"
|
|
691
|
-
}, Ie = () =>
|
|
692
|
-
let [r, i] =
|
|
693
|
-
return
|
|
691
|
+
}, Ie = () => N(async () => ({ default: (await import("./PdfContent-ELaDSyFF.js")).PdfContent })), Le = ({ url: e, fileName: t, loadErrorLabel: n }) => {
|
|
692
|
+
let [r, i] = z(!1);
|
|
693
|
+
return I(() => {
|
|
694
694
|
i(!1);
|
|
695
|
-
}, [e]), r ? /* @__PURE__ */
|
|
695
|
+
}, [e]), r ? /* @__PURE__ */ V("div", {
|
|
696
696
|
className: "flex flex-col items-center gap-2",
|
|
697
|
-
children: [/* @__PURE__ */
|
|
697
|
+
children: [/* @__PURE__ */ B(O, {
|
|
698
698
|
size: 60,
|
|
699
699
|
stroke: C,
|
|
700
700
|
className: X.errorIcon
|
|
701
|
-
}), /* @__PURE__ */
|
|
701
|
+
}), /* @__PURE__ */ B("p", {
|
|
702
702
|
className: _("text-center", X.statusLabel),
|
|
703
703
|
children: n
|
|
704
704
|
})]
|
|
705
|
-
}) : /* @__PURE__ */
|
|
705
|
+
}) : /* @__PURE__ */ B("img", {
|
|
706
706
|
src: e,
|
|
707
707
|
alt: t ?? "",
|
|
708
708
|
className: "max-h-full max-w-full object-contain",
|
|
@@ -712,10 +712,17 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
712
712
|
i.PlainText,
|
|
713
713
|
i.Code,
|
|
714
714
|
i.Ooxml
|
|
715
|
-
]), ze =
|
|
716
|
-
let { colors: G, typography: K, bodyClassName:
|
|
717
|
-
|
|
718
|
-
}, []),
|
|
715
|
+
]), ze = P(({ content: e, isLoading: t = !1, fileName: r, isHtmlSourceView: a = !1, labels: { unsupportedLabel: o = "Preview is not supported for this file", loadErrorLabel: c = "Failed to load file", forbiddenErrorLabel: l = "You don't have permission to access this file", visualizerErrorLabel: d, htmlFrameBlockedLabel: f = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: h = "Open in new tab", pdfThumbnailsLabel: g, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: S, pdfContentRetryLabel: w, xlsxFormulaLabel: T = "Formula", codeContentLoadingLabel: E, codeContentErrorLabel: k, codeContentRetryLabel: A, tableCopyLabel: ee, tableCopiedLabel: te, tableDownloadCsvLabel: ne, codeBlockCopyLabel: j, codeBlockCopiedLabel: ie, codeBlockDownloadLabel: ae, tableScrollRegionAriaLabel: M, mathScrollRegionAriaLabel: N, ooxmlHighlightsLabel: P, ooxmlHighlightNavigatedLabel: oe } = {}, styles: le, codeBlockTheme: H, tableDownloadFilename: ue, loadPdf: U, hidePdfToolbar: W = !1, configurePdfWorker: de, onAppInfo: fe, onVisualizerSendMessage: pe }) => {
|
|
716
|
+
let { colors: G, typography: K, bodyClassName: me, cssVars: ge } = le ?? {}, [_e, ye] = z(0), be = L(Ie, [_e]), xe = F(() => {
|
|
717
|
+
ye((e) => e + 1);
|
|
718
|
+
}, []), Se = R(void 0), [Ce, q] = z(0), J = F((e) => {
|
|
719
|
+
Se.current = e;
|
|
720
|
+
}, []);
|
|
721
|
+
I(() => {
|
|
722
|
+
let t = Se.current;
|
|
723
|
+
t != null && (Se.current = void 0, e.type === i.Pdf && e.url === t && q((e) => e + 1));
|
|
724
|
+
}, [e]);
|
|
725
|
+
let Y = K?.fontClassName != null, Te = L(() => ({
|
|
719
726
|
...m({
|
|
720
727
|
"--ac-text": G?.text,
|
|
721
728
|
"--ac-status-text": G?.statusText,
|
|
@@ -740,14 +747,14 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
740
747
|
"--ac-ooxml-highlight-bg": G?.ooxmlHighlightBackground,
|
|
741
748
|
"--ac-json-collapsed-text": G?.jsonCollapsedText,
|
|
742
749
|
"--ac-json-collapsed-bg": G?.jsonCollapsedBackground,
|
|
743
|
-
"--ac-font-family":
|
|
744
|
-
"--ac-font-size":
|
|
745
|
-
"--ac-font-weight":
|
|
746
|
-
"--ac-line-height":
|
|
747
|
-
"--ac-letter-spacing":
|
|
750
|
+
"--ac-font-family": Y ? void 0 : K?.fontFamily,
|
|
751
|
+
"--ac-font-size": Y ? void 0 : K?.fontSize,
|
|
752
|
+
"--ac-font-weight": Y ? void 0 : K?.fontWeight,
|
|
753
|
+
"--ac-line-height": Y ? void 0 : K?.lineHeight,
|
|
754
|
+
"--ac-letter-spacing": Y ? void 0 : K?.letterSpacing
|
|
748
755
|
}),
|
|
749
|
-
...
|
|
750
|
-
}), [
|
|
756
|
+
...ge
|
|
757
|
+
}), [le]), Ee = L(() => {
|
|
751
758
|
switch (e.type) {
|
|
752
759
|
case i.Image:
|
|
753
760
|
case i.Audio:
|
|
@@ -765,49 +772,49 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
765
772
|
case i.MarkdownTable: return "flex h-full min-h-0 flex-col overflow-hidden p-4";
|
|
766
773
|
default: return "h-full overflow-auto p-4";
|
|
767
774
|
}
|
|
768
|
-
}, [e.type]),
|
|
775
|
+
}, [e.type]), De = L(() => {
|
|
769
776
|
switch (e.type) {
|
|
770
|
-
case i.PlainText: return /* @__PURE__ */
|
|
777
|
+
case i.PlainText: return /* @__PURE__ */ B("pre", {
|
|
771
778
|
className: _("whitespace-pre-wrap break-words", X.body, K?.fontClassName),
|
|
772
779
|
children: e.text
|
|
773
780
|
});
|
|
774
|
-
case i.Image: return /* @__PURE__ */
|
|
781
|
+
case i.Image: return /* @__PURE__ */ B(Le, {
|
|
775
782
|
url: e.url,
|
|
776
783
|
fileName: r,
|
|
777
784
|
loadErrorLabel: c
|
|
778
785
|
});
|
|
779
|
-
case i.Audio: return /* @__PURE__ */
|
|
786
|
+
case i.Audio: return /* @__PURE__ */ B("audio", {
|
|
780
787
|
controls: !0,
|
|
781
788
|
controlsList: "nodownload",
|
|
782
789
|
src: e.url,
|
|
783
790
|
"aria-label": r ?? "Audio attachment",
|
|
784
791
|
className: "w-full max-w-sm",
|
|
785
792
|
preload: "metadata",
|
|
786
|
-
children: e.mimeType && /* @__PURE__ */
|
|
793
|
+
children: e.mimeType && /* @__PURE__ */ B("source", {
|
|
787
794
|
src: e.url,
|
|
788
795
|
type: e.mimeType
|
|
789
796
|
})
|
|
790
797
|
});
|
|
791
|
-
case i.Markdown: return /* @__PURE__ */
|
|
798
|
+
case i.Markdown: return /* @__PURE__ */ B(p, {
|
|
792
799
|
content: e.text,
|
|
793
800
|
isStreaming: !1,
|
|
794
|
-
codeBlockTheme:
|
|
795
|
-
codeBlockCopyLabel:
|
|
796
|
-
codeBlockCopiedLabel:
|
|
797
|
-
codeBlockDownloadLabel:
|
|
798
|
-
tableScrollRegionAriaLabel:
|
|
799
|
-
mathScrollRegionAriaLabel:
|
|
801
|
+
codeBlockTheme: H,
|
|
802
|
+
codeBlockCopyLabel: j,
|
|
803
|
+
codeBlockCopiedLabel: ie,
|
|
804
|
+
codeBlockDownloadLabel: ae,
|
|
805
|
+
tableScrollRegionAriaLabel: M,
|
|
806
|
+
mathScrollRegionAriaLabel: N,
|
|
800
807
|
classNames: u
|
|
801
808
|
});
|
|
802
|
-
case i.MarkdownTable: return /* @__PURE__ */
|
|
809
|
+
case i.MarkdownTable: return /* @__PURE__ */ B(p, {
|
|
803
810
|
content: e.text,
|
|
804
811
|
isStreaming: !1,
|
|
805
|
-
codeBlockTheme:
|
|
806
|
-
codeBlockCopyLabel:
|
|
807
|
-
codeBlockCopiedLabel:
|
|
808
|
-
codeBlockDownloadLabel:
|
|
809
|
-
tableScrollRegionAriaLabel:
|
|
810
|
-
mathScrollRegionAriaLabel:
|
|
812
|
+
codeBlockTheme: H,
|
|
813
|
+
codeBlockCopyLabel: j,
|
|
814
|
+
codeBlockCopiedLabel: ie,
|
|
815
|
+
codeBlockDownloadLabel: ae,
|
|
816
|
+
tableScrollRegionAriaLabel: M,
|
|
817
|
+
mathScrollRegionAriaLabel: N,
|
|
811
818
|
containerClassName: "flex h-full min-h-0 flex-col",
|
|
812
819
|
classNames: {
|
|
813
820
|
...u,
|
|
@@ -815,22 +822,22 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
815
822
|
tableScrollContainer: "max-h-full"
|
|
816
823
|
},
|
|
817
824
|
tableActionLabels: {
|
|
818
|
-
copyLabel:
|
|
819
|
-
copiedLabel:
|
|
820
|
-
downloadCsvLabel:
|
|
825
|
+
copyLabel: ee,
|
|
826
|
+
copiedLabel: te,
|
|
827
|
+
downloadCsvLabel: ne
|
|
821
828
|
},
|
|
822
|
-
tableDownloadFilename:
|
|
829
|
+
tableDownloadFilename: ue
|
|
823
830
|
});
|
|
824
|
-
case i.Json: return /* @__PURE__ */
|
|
831
|
+
case i.Json: return /* @__PURE__ */ B("div", {
|
|
825
832
|
dir: "ltr",
|
|
826
833
|
className: "h-full overflow-auto",
|
|
827
|
-
children: /* @__PURE__ */
|
|
834
|
+
children: /* @__PURE__ */ B("div", {
|
|
828
835
|
className: _("m-3 overflow-auto rounded-md border", X.jsonWrapper),
|
|
829
|
-
children: /* @__PURE__ */
|
|
836
|
+
children: /* @__PURE__ */ B(se, {
|
|
830
837
|
data: e.value,
|
|
831
838
|
style: {
|
|
832
839
|
container: _("whitespace-pre-wrap break-words p-2", K?.jsonClassName ?? "dial-code-text"),
|
|
833
|
-
basicChildStyle:
|
|
840
|
+
basicChildStyle: ce.basicChildStyle,
|
|
834
841
|
childFieldsContainer: "m-0 ps-3",
|
|
835
842
|
label: _("me-1 font-semibold", X.jsonLabel),
|
|
836
843
|
clickableLabel: _("me-1 cursor-pointer font-semibold hover:underline", X.jsonClickableLabel),
|
|
@@ -848,16 +855,16 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
848
855
|
})
|
|
849
856
|
})
|
|
850
857
|
});
|
|
851
|
-
case i.Code: return /* @__PURE__ */
|
|
858
|
+
case i.Code: return /* @__PURE__ */ B(he, {
|
|
852
859
|
content: e,
|
|
853
|
-
codeBlockTheme:
|
|
860
|
+
codeBlockTheme: H,
|
|
854
861
|
labels: {
|
|
855
862
|
loadingLabel: E,
|
|
856
863
|
errorLabel: k,
|
|
857
864
|
retryLabel: A
|
|
858
865
|
}
|
|
859
866
|
});
|
|
860
|
-
case i.Html: return /* @__PURE__ */
|
|
867
|
+
case i.Html: return /* @__PURE__ */ B(ve, {
|
|
861
868
|
content: e,
|
|
862
869
|
labels: {
|
|
863
870
|
htmlFrameBlockedLabel: f,
|
|
@@ -865,25 +872,26 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
865
872
|
},
|
|
866
873
|
isSourceView: a,
|
|
867
874
|
title: r,
|
|
868
|
-
codeBlockTheme:
|
|
875
|
+
codeBlockTheme: H
|
|
869
876
|
});
|
|
870
|
-
case i.Pdf: return /* @__PURE__ */
|
|
871
|
-
retryKey:
|
|
872
|
-
onRetry:
|
|
877
|
+
case i.Pdf: return /* @__PURE__ */ B(s, {
|
|
878
|
+
retryKey: _e,
|
|
879
|
+
onRetry: xe,
|
|
873
880
|
labels: {
|
|
874
881
|
loadingLabel: x,
|
|
875
882
|
errorLabel: S,
|
|
876
883
|
retryLabel: w
|
|
877
884
|
},
|
|
878
|
-
children: /* @__PURE__ */
|
|
885
|
+
children: /* @__PURE__ */ B(be, {
|
|
879
886
|
fileName: r,
|
|
880
887
|
url: e.url,
|
|
881
888
|
highlights: e.highlights ?? [],
|
|
882
889
|
selectedHighlightId: e.selectedHighlightId,
|
|
883
890
|
selectedPageNumber: e.page,
|
|
884
|
-
loadPdf:
|
|
885
|
-
|
|
886
|
-
|
|
891
|
+
loadPdf: U,
|
|
892
|
+
onLoadError: J,
|
|
893
|
+
hideHeader: W,
|
|
894
|
+
configurePdfWorker: de,
|
|
887
895
|
labels: {
|
|
888
896
|
thumbnailsLabel: g,
|
|
889
897
|
showThumbnailsLabel: v,
|
|
@@ -894,39 +902,39 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
894
902
|
retryLabel: w
|
|
895
903
|
}
|
|
896
904
|
})
|
|
897
|
-
}, e.url);
|
|
898
|
-
case i.Ooxml: return /* @__PURE__ */
|
|
905
|
+
}, `${e.url}#${Ce}`);
|
|
906
|
+
case i.Ooxml: return /* @__PURE__ */ B(Oe, {
|
|
899
907
|
content: e,
|
|
900
908
|
fileName: r,
|
|
901
909
|
loadErrorLabel: c,
|
|
902
910
|
formulaLabel: T,
|
|
903
911
|
formulaLabelClassName: K?.xlsxFormulaLabelClassName ?? "dial-italic-text",
|
|
904
|
-
highlightsLabel:
|
|
905
|
-
highlightNavigatedLabel:
|
|
912
|
+
highlightsLabel: P,
|
|
913
|
+
highlightNavigatedLabel: oe
|
|
906
914
|
});
|
|
907
915
|
case i.Visualizer:
|
|
908
|
-
case i.GroupedVisualizer: return /* @__PURE__ */
|
|
916
|
+
case i.GroupedVisualizer: return /* @__PURE__ */ B(Fe, {
|
|
909
917
|
content: e,
|
|
910
918
|
errorLabel: d,
|
|
911
|
-
onSendMessage:
|
|
919
|
+
onSendMessage: pe
|
|
912
920
|
});
|
|
913
|
-
case i.McpApp: return /* @__PURE__ */
|
|
921
|
+
case i.McpApp: return /* @__PURE__ */ B(we, {
|
|
914
922
|
content: e,
|
|
915
|
-
onAppInfo:
|
|
923
|
+
onAppInfo: fe
|
|
916
924
|
});
|
|
917
|
-
case i.Unsupported: return /* @__PURE__ */
|
|
925
|
+
case i.Unsupported: return /* @__PURE__ */ B("p", {
|
|
918
926
|
className: _("text-center", X.statusLabel),
|
|
919
927
|
children: o
|
|
920
928
|
});
|
|
921
929
|
case i.Error: {
|
|
922
930
|
let t = e.errorType === n.Forbidden;
|
|
923
|
-
return /* @__PURE__ */
|
|
931
|
+
return /* @__PURE__ */ V("div", {
|
|
924
932
|
className: "flex flex-col items-center gap-2",
|
|
925
|
-
children: [
|
|
933
|
+
children: [B(t ? re : O, {
|
|
926
934
|
size: 60,
|
|
927
935
|
stroke: C,
|
|
928
936
|
className: X.errorIcon
|
|
929
|
-
}), /* @__PURE__ */
|
|
937
|
+
}), /* @__PURE__ */ B("p", {
|
|
930
938
|
className: _("text-center", X.statusLabel),
|
|
931
939
|
children: t ? l : c
|
|
932
940
|
})]
|
|
@@ -939,20 +947,20 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
939
947
|
K?.jsonClassName,
|
|
940
948
|
K?.xlsxFormulaLabelClassName,
|
|
941
949
|
r,
|
|
942
|
-
|
|
950
|
+
H,
|
|
943
951
|
o,
|
|
944
952
|
c,
|
|
945
953
|
l,
|
|
946
954
|
d,
|
|
947
|
-
|
|
955
|
+
pe,
|
|
948
956
|
f,
|
|
949
957
|
h,
|
|
950
958
|
a,
|
|
951
|
-
ce,
|
|
952
|
-
le,
|
|
953
959
|
ue,
|
|
954
960
|
U,
|
|
955
961
|
W,
|
|
962
|
+
de,
|
|
963
|
+
fe,
|
|
956
964
|
g,
|
|
957
965
|
v,
|
|
958
966
|
y,
|
|
@@ -964,64 +972,66 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
964
972
|
E,
|
|
965
973
|
k,
|
|
966
974
|
A,
|
|
975
|
+
be,
|
|
967
976
|
_e,
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
977
|
+
xe,
|
|
978
|
+
Ce,
|
|
979
|
+
J,
|
|
971
980
|
ee,
|
|
972
981
|
te,
|
|
973
|
-
|
|
974
|
-
|
|
982
|
+
ne,
|
|
983
|
+
j,
|
|
975
984
|
ie,
|
|
985
|
+
ae,
|
|
986
|
+
M,
|
|
976
987
|
N,
|
|
977
988
|
P,
|
|
978
|
-
|
|
979
|
-
ae
|
|
989
|
+
oe
|
|
980
990
|
]);
|
|
981
|
-
return /* @__PURE__ */
|
|
982
|
-
style: !t && Re.has(e.type) ?
|
|
983
|
-
className: _(t ? "flex h-full items-center justify-center" :
|
|
984
|
-
children: t ? /* @__PURE__ */
|
|
991
|
+
return /* @__PURE__ */ B("div", {
|
|
992
|
+
style: !t && Re.has(e.type) ? Te : void 0,
|
|
993
|
+
className: _(t ? "flex h-full items-center justify-center" : Ee, me),
|
|
994
|
+
children: t ? /* @__PURE__ */ B(D, {}) : De
|
|
985
995
|
});
|
|
986
996
|
}), Be = {
|
|
987
997
|
mcpAppDivider: "_mcpAppDivider_1jh5p_1",
|
|
988
998
|
mcpAppVersion: "_mcpAppVersion_1jh5p_5"
|
|
989
|
-
}, Ve = 2e3, He =
|
|
990
|
-
let [X, Ie] =
|
|
991
|
-
|
|
992
|
-
}, [
|
|
993
|
-
|
|
994
|
-
}, [
|
|
995
|
-
|
|
996
|
-
}, [
|
|
997
|
-
|
|
999
|
+
}, Ve = 2e3, He = P(({ isOpen: e, isLoading: t = !1, onClose: n, content: r, fileName: a, leftActions: s, labels: { ariaLabel: c, closeLabel: l = "Close", resizeLabel: u = "Resize panel", downloadLabel: d = "Download", copyTextLabel: f = "Copy text", copiedTextLabel: p = "Copied!", copyMarkdownLabel: h = "Copy as Markdown", copiedMarkdownLabel: g = "Copied!", copyJsonLabel: v = "Copy as JSON", copiedJsonLabel: y = "Copied!", visualizerErrorLabel: w, unsupportedLabel: E = "Preview is not supported for this file", loadErrorLabel: D = "Failed to load file", forbiddenErrorLabel: O = "You don't have permission to access this file", htmlFrameBlockedLabel: k = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: re = "Open in new tab", htmlViewSourceLabel: M = "View source", htmlViewRenderedLabel: N = "View rendered", mcpAppReloadLabel: P = "Reload", pdfThumbnailsLabel: oe, pdfShowThumbnailsLabel: se, pdfHideThumbnailsLabel: ce, pdfPageNumberLabel: H, pdfContentLoadingLabel: ue, pdfContentErrorLabel: U, pdfContentRetryLabel: W, xlsxFormulaLabel: de, codeContentLoadingLabel: fe, codeContentErrorLabel: G, codeContentRetryLabel: K, tableCopyLabel: me, tableCopiedLabel: he, tableDownloadCsvLabel: ge, codeBlockCopyLabel: _e, codeBlockCopiedLabel: ve, codeBlockDownloadLabel: ye, tableScrollRegionAriaLabel: be, mathScrollRegionAriaLabel: xe, ooxmlHighlightsLabel: Se, ooxmlHighlightNavigatedLabel: Ce }, onDownload: q, onCopyText: we, onCopyMarkdown: J, onCopyJson: Y, tableDownloadFilename: Te, isMobile: Ee = !1, defaultWidth: De, minWidth: Oe = 600, maxWidth: ke = 1500, onResizeStop: Ae, styles: je, codeBlockTheme: Me, loadPdf: Ne, configurePdfWorker: Pe, onVisualizerSendMessage: Fe }) => {
|
|
1000
|
+
let [X, Ie] = z(!1), [Le, Re] = z(!1), [He, Ue] = z(!1), [Z, We] = z(!1), [Ge, Ke] = z(void 0), qe = R(null), Q = R(null), Je = R(null), Ye = F(() => {
|
|
1001
|
+
we?.(), qe.current != null && clearTimeout(qe.current), Ie(!0), qe.current = setTimeout(() => Ie(!1), Ve);
|
|
1002
|
+
}, [we]), Xe = F(() => {
|
|
1003
|
+
J?.(), Q.current != null && clearTimeout(Q.current), Re(!0), Q.current = setTimeout(() => Re(!1), Ve);
|
|
1004
|
+
}, [J]), Ze = F(() => {
|
|
1005
|
+
Y?.(), Je.current != null && clearTimeout(Je.current), Ue(!0), Je.current = setTimeout(() => Ue(!1), Ve);
|
|
1006
|
+
}, [Y]);
|
|
1007
|
+
I(() => () => {
|
|
998
1008
|
qe.current != null && clearTimeout(qe.current), Q.current != null && clearTimeout(Q.current), Je.current != null && clearTimeout(Je.current);
|
|
999
1009
|
}, []);
|
|
1000
|
-
let Qe =
|
|
1010
|
+
let Qe = F(() => {
|
|
1001
1011
|
We((e) => !e);
|
|
1002
1012
|
}, []);
|
|
1003
|
-
|
|
1013
|
+
I(() => {
|
|
1004
1014
|
We(!1), Ke(void 0);
|
|
1005
1015
|
}, [r]);
|
|
1006
|
-
let { className: $e, panelStyles: $, ...et } = je ?? {}, { colors: tt, typography: nt } = et, rt =
|
|
1016
|
+
let { className: $e, panelStyles: $, ...et } = je ?? {}, { colors: tt, typography: nt } = et, rt = L(() => m({
|
|
1007
1017
|
"--ac-mcp-app-divider": tt?.mcpAppDividerColor,
|
|
1008
1018
|
"--ac-mcp-app-version": tt?.mcpAppVersionColor
|
|
1009
|
-
}), [tt?.mcpAppDividerColor, tt?.mcpAppVersionColor]), it = r.type === i.McpApp && Ge != null ? /* @__PURE__ */
|
|
1019
|
+
}), [tt?.mcpAppDividerColor, tt?.mcpAppVersionColor]), it = r.type === i.McpApp && Ge != null ? /* @__PURE__ */ V("span", {
|
|
1010
1020
|
style: rt,
|
|
1011
1021
|
children: [
|
|
1012
|
-
/* @__PURE__ */
|
|
1013
|
-
/* @__PURE__ */
|
|
1022
|
+
/* @__PURE__ */ B("span", { children: a }),
|
|
1023
|
+
/* @__PURE__ */ B("span", {
|
|
1014
1024
|
"aria-hidden": !0,
|
|
1015
1025
|
className: _("mx-1.5 inline-block h-3 w-0 border-s align-middle", Be.mcpAppDivider)
|
|
1016
1026
|
}),
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
Ge.version && /* @__PURE__ */
|
|
1027
|
+
/* @__PURE__ */ B("span", { children: Ge.name }),
|
|
1028
|
+
Ge.version && /* @__PURE__ */ B("span", {
|
|
1019
1029
|
className: _("ms-2", nt?.mcpAppVersionClassName ?? "dial-caption-text", Be.mcpAppVersion),
|
|
1020
1030
|
children: Ge.version
|
|
1021
1031
|
})
|
|
1022
1032
|
]
|
|
1023
|
-
}) : a, at = !t && r.type === i.Html && (r.srcdoc != null || r.resolveSourceText != null), ot = !t &&
|
|
1024
|
-
return /* @__PURE__ */
|
|
1033
|
+
}) : a, at = !t && r.type === i.Html && (r.srcdoc != null || r.resolveSourceText != null), ot = !t && we != null && (r.type === i.PlainText || r.type === i.Code), st = !t && J != null && r.type === i.Markdown, ct = !t && Y != null && r.type === i.Json, lt = !t && q != null && o(r), ut = !t && r.type === i.McpApp && r.onReload != null;
|
|
1034
|
+
return /* @__PURE__ */ B(x, {
|
|
1025
1035
|
isOpen: e,
|
|
1026
1036
|
orientation: b.Right,
|
|
1027
1037
|
title: it,
|
|
@@ -1040,33 +1050,33 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
1040
1050
|
...$,
|
|
1041
1051
|
titleClassName: $?.titleClassName ?? "dial-h3-text",
|
|
1042
1052
|
headerClassName: _("border-b border-tertiary", $?.headerClassName),
|
|
1043
|
-
className: _(e ? "mobile:w-full mobile:max-w-full" : "w-0", $e, $?.className,
|
|
1053
|
+
className: _(e ? "mobile:w-full mobile:max-w-full" : "w-0", $e, $?.className, pe.panel)
|
|
1044
1054
|
},
|
|
1045
1055
|
leftActions: s,
|
|
1046
|
-
rightActions: at || ot || st || ct || lt || ut ? /* @__PURE__ */
|
|
1047
|
-
ut && /* @__PURE__ */
|
|
1048
|
-
icon: /* @__PURE__ */
|
|
1056
|
+
rightActions: at || ot || st || ct || lt || ut ? /* @__PURE__ */ V(le, { children: [
|
|
1057
|
+
ut && /* @__PURE__ */ B(T, {
|
|
1058
|
+
icon: /* @__PURE__ */ B(ae, {
|
|
1049
1059
|
size: S.LG,
|
|
1050
1060
|
stroke: C,
|
|
1051
1061
|
"aria-hidden": !0
|
|
1052
1062
|
}),
|
|
1053
|
-
"aria-label":
|
|
1054
|
-
tooltipProps: { tooltip:
|
|
1063
|
+
"aria-label": P,
|
|
1064
|
+
tooltipProps: { tooltip: P },
|
|
1055
1065
|
onClick: r.type === i.McpApp ? r.onReload : void 0
|
|
1056
1066
|
}),
|
|
1057
|
-
at && /* @__PURE__ */
|
|
1058
|
-
icon:
|
|
1067
|
+
at && /* @__PURE__ */ B(T, {
|
|
1068
|
+
icon: B(Z ? j : ee, {
|
|
1059
1069
|
size: S.LG,
|
|
1060
1070
|
stroke: C,
|
|
1061
1071
|
"aria-hidden": !0
|
|
1062
1072
|
}),
|
|
1063
|
-
"aria-label": Z ?
|
|
1073
|
+
"aria-label": Z ? N : M,
|
|
1064
1074
|
"aria-pressed": Z,
|
|
1065
|
-
tooltipProps: { tooltip: Z ?
|
|
1075
|
+
tooltipProps: { tooltip: Z ? N : M },
|
|
1066
1076
|
onClick: Qe
|
|
1067
1077
|
}),
|
|
1068
|
-
ot && /* @__PURE__ */
|
|
1069
|
-
icon:
|
|
1078
|
+
ot && /* @__PURE__ */ B(T, {
|
|
1079
|
+
icon: B(X ? A : te, {
|
|
1070
1080
|
size: S.LG,
|
|
1071
1081
|
stroke: C,
|
|
1072
1082
|
"aria-hidden": !0
|
|
@@ -1075,8 +1085,8 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
1075
1085
|
tooltipProps: { tooltip: X ? p : f },
|
|
1076
1086
|
onClick: Ye
|
|
1077
1087
|
}),
|
|
1078
|
-
st && /* @__PURE__ */
|
|
1079
|
-
icon:
|
|
1088
|
+
st && /* @__PURE__ */ B(T, {
|
|
1089
|
+
icon: B(Le ? A : ie, {
|
|
1080
1090
|
size: S.LG,
|
|
1081
1091
|
stroke: C,
|
|
1082
1092
|
"aria-hidden": !0
|
|
@@ -1085,8 +1095,8 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
1085
1095
|
tooltipProps: { tooltip: Le ? g : h },
|
|
1086
1096
|
onClick: Xe
|
|
1087
1097
|
}),
|
|
1088
|
-
ct && /* @__PURE__ */
|
|
1089
|
-
icon:
|
|
1098
|
+
ct && /* @__PURE__ */ B(T, {
|
|
1099
|
+
icon: B(He ? A : te, {
|
|
1090
1100
|
size: S.LG,
|
|
1091
1101
|
stroke: C,
|
|
1092
1102
|
"aria-hidden": !0
|
|
@@ -1095,17 +1105,17 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
1095
1105
|
tooltipProps: { tooltip: He ? y : v },
|
|
1096
1106
|
onClick: Ze
|
|
1097
1107
|
}),
|
|
1098
|
-
lt && /* @__PURE__ */
|
|
1099
|
-
icon: /* @__PURE__ */
|
|
1108
|
+
lt && /* @__PURE__ */ B(T, {
|
|
1109
|
+
icon: /* @__PURE__ */ B(ne, {
|
|
1100
1110
|
size: S.LG,
|
|
1101
1111
|
stroke: C
|
|
1102
1112
|
}),
|
|
1103
1113
|
"aria-label": d,
|
|
1104
1114
|
tooltipProps: { tooltip: d },
|
|
1105
|
-
onClick:
|
|
1115
|
+
onClick: q
|
|
1106
1116
|
})
|
|
1107
1117
|
] }) : null,
|
|
1108
|
-
children: /* @__PURE__ */
|
|
1118
|
+
children: /* @__PURE__ */ B(ze, {
|
|
1109
1119
|
content: r,
|
|
1110
1120
|
isLoading: t,
|
|
1111
1121
|
fileName: a,
|
|
@@ -1117,28 +1127,28 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
1117
1127
|
forbiddenErrorLabel: O,
|
|
1118
1128
|
visualizerErrorLabel: w,
|
|
1119
1129
|
htmlFrameBlockedLabel: k,
|
|
1120
|
-
htmlOpenInNewTabLabel:
|
|
1121
|
-
pdfThumbnailsLabel:
|
|
1122
|
-
pdfShowThumbnailsLabel:
|
|
1123
|
-
pdfHideThumbnailsLabel:
|
|
1124
|
-
pdfPageNumberLabel:
|
|
1130
|
+
htmlOpenInNewTabLabel: re,
|
|
1131
|
+
pdfThumbnailsLabel: oe,
|
|
1132
|
+
pdfShowThumbnailsLabel: se,
|
|
1133
|
+
pdfHideThumbnailsLabel: ce,
|
|
1134
|
+
pdfPageNumberLabel: H,
|
|
1125
1135
|
pdfContentLoadingLabel: ue,
|
|
1126
1136
|
pdfContentErrorLabel: U,
|
|
1127
1137
|
pdfContentRetryLabel: W,
|
|
1128
1138
|
xlsxFormulaLabel: de,
|
|
1129
|
-
codeContentLoadingLabel:
|
|
1130
|
-
codeContentErrorLabel:
|
|
1131
|
-
codeContentRetryLabel:
|
|
1139
|
+
codeContentLoadingLabel: fe,
|
|
1140
|
+
codeContentErrorLabel: G,
|
|
1141
|
+
codeContentRetryLabel: K,
|
|
1132
1142
|
tableCopyLabel: me,
|
|
1133
1143
|
tableCopiedLabel: he,
|
|
1134
1144
|
tableDownloadCsvLabel: ge,
|
|
1135
1145
|
codeBlockCopyLabel: _e,
|
|
1136
1146
|
codeBlockCopiedLabel: ve,
|
|
1137
1147
|
codeBlockDownloadLabel: ye,
|
|
1138
|
-
tableScrollRegionAriaLabel:
|
|
1139
|
-
mathScrollRegionAriaLabel:
|
|
1140
|
-
ooxmlHighlightsLabel:
|
|
1141
|
-
ooxmlHighlightNavigatedLabel:
|
|
1148
|
+
tableScrollRegionAriaLabel: be,
|
|
1149
|
+
mathScrollRegionAriaLabel: xe,
|
|
1150
|
+
ooxmlHighlightsLabel: Se,
|
|
1151
|
+
ooxmlHighlightNavigatedLabel: Ce
|
|
1142
1152
|
},
|
|
1143
1153
|
styles: et,
|
|
1144
1154
|
codeBlockTheme: Me,
|
|
@@ -1251,21 +1261,21 @@ var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
1251
1261
|
}, it = {
|
|
1252
1262
|
type: i.PlainText,
|
|
1253
1263
|
text: ""
|
|
1254
|
-
}, at =
|
|
1264
|
+
}, at = M(void 0);
|
|
1255
1265
|
at.displayName = "AttachmentCanvasContext";
|
|
1256
1266
|
var ot = ({ children: e }) => {
|
|
1257
|
-
let [t, n] =
|
|
1267
|
+
let [t, n] = z(!1), [r, i] = z(!1), [a, o] = z(it), [s, c] = z(void 0), [l, u] = z(void 0), d = F((e, t) => {
|
|
1258
1268
|
c(e), u(t), i(!0), n(!0);
|
|
1259
|
-
}, []), f =
|
|
1269
|
+
}, []), f = F((e, t, r) => {
|
|
1260
1270
|
o(e), c(t), u(r), i(!1), n(!0);
|
|
1261
|
-
}, []), p =
|
|
1271
|
+
}, []), p = F(() => {
|
|
1262
1272
|
o(it), n(!1), i(!1), u(void 0);
|
|
1263
1273
|
}, []);
|
|
1264
|
-
return
|
|
1274
|
+
return I(() => () => {
|
|
1265
1275
|
let e = nt(a);
|
|
1266
1276
|
e != null && URL.revokeObjectURL(e);
|
|
1267
|
-
}, [a]), /* @__PURE__ */
|
|
1268
|
-
value:
|
|
1277
|
+
}, [a]), /* @__PURE__ */ B(at.Provider, {
|
|
1278
|
+
value: L(() => ({
|
|
1269
1279
|
isOpen: t,
|
|
1270
1280
|
isLoading: r,
|
|
1271
1281
|
content: a,
|
|
@@ -1287,21 +1297,21 @@ var ot = ({ children: e }) => {
|
|
|
1287
1297
|
children: e
|
|
1288
1298
|
});
|
|
1289
1299
|
}, st = () => {
|
|
1290
|
-
let e =
|
|
1300
|
+
let e = oe(at);
|
|
1291
1301
|
if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
|
|
1292
1302
|
return e;
|
|
1293
|
-
}, ct =
|
|
1294
|
-
let { ariaLabel: f = "Attachment preview", closeLabel: p = "Close", downloadLabel: m = "Download", unsupportedLabel: g = "Preview is not supported for this file", loadErrorLabel: _ = "Failed to load file", forbiddenErrorLabel: v = "You don't have permission to access this file", copyTextLabel: y, copiedTextLabel: b, copyMarkdownLabel: x, copiedMarkdownLabel: S, copyJsonLabel: C, copiedJsonLabel: w, htmlFrameBlockedLabel: T, htmlOpenInNewTabLabel: E, htmlViewSourceLabel: D, htmlViewRenderedLabel: O, pdfThumbnailsLabel: k, pdfShowThumbnailsLabel: A, pdfHideThumbnailsLabel:
|
|
1303
|
+
}, ct = P(({ labels: e, leftActions: t, isMobile: n = !1, defaultWidth: r, maxWidth: o, codeBlockTheme: s, tableDownloadFilename: c, loadPdf: l, configurePdfWorker: u, onVisualizerSendMessage: d }) => {
|
|
1304
|
+
let { ariaLabel: f = "Attachment preview", closeLabel: p = "Close", downloadLabel: m = "Download", unsupportedLabel: g = "Preview is not supported for this file", loadErrorLabel: _ = "Failed to load file", forbiddenErrorLabel: v = "You don't have permission to access this file", copyTextLabel: y, copiedTextLabel: b, copyMarkdownLabel: x, copiedMarkdownLabel: S, copyJsonLabel: C, copiedJsonLabel: w, htmlFrameBlockedLabel: T, htmlOpenInNewTabLabel: E, htmlViewSourceLabel: D, htmlViewRenderedLabel: O, pdfThumbnailsLabel: k, pdfShowThumbnailsLabel: A, pdfHideThumbnailsLabel: ee, pdfPageNumberLabel: te, pdfContentLoadingLabel: ne, pdfContentErrorLabel: j, pdfContentRetryLabel: re, xlsxFormulaLabel: ie, codeContentLoadingLabel: ae, codeContentErrorLabel: M, codeContentRetryLabel: N, tableCopyLabel: P, tableCopiedLabel: oe, tableDownloadCsvLabel: I, codeBlockCopyLabel: L, codeBlockCopiedLabel: R, codeBlockDownloadLabel: z, tableScrollRegionAriaLabel: se, mathScrollRegionAriaLabel: ce, ooxmlHighlightsLabel: le, ooxmlHighlightNavigatedLabel: V } = e ?? {}, { isOpen: H, isLoading: ue, content: U, fileName: W, closeCanvas: de } = st(), fe = F(() => {
|
|
1295
1305
|
a(U, W);
|
|
1296
|
-
}, [U, W]),
|
|
1306
|
+
}, [U, W]), pe = F(() => {
|
|
1297
1307
|
(U.type === i.PlainText || U.type === i.Code) && h(U.text);
|
|
1298
|
-
}, [U]),
|
|
1308
|
+
}, [U]), G = F(() => {
|
|
1299
1309
|
U.type === i.Markdown && h(U.text);
|
|
1300
|
-
}, [U]),
|
|
1310
|
+
}, [U]), K = F(() => {
|
|
1301
1311
|
U.type === i.Json && h(JSON.stringify(U.value, null, 2));
|
|
1302
1312
|
}, [U]);
|
|
1303
|
-
return /* @__PURE__ */
|
|
1304
|
-
isOpen:
|
|
1313
|
+
return /* @__PURE__ */ B(He, {
|
|
1314
|
+
isOpen: H,
|
|
1305
1315
|
isLoading: ue,
|
|
1306
1316
|
onClose: de,
|
|
1307
1317
|
content: U,
|
|
@@ -1326,30 +1336,30 @@ var ot = ({ children: e }) => {
|
|
|
1326
1336
|
htmlViewRenderedLabel: O,
|
|
1327
1337
|
pdfThumbnailsLabel: k,
|
|
1328
1338
|
pdfShowThumbnailsLabel: A,
|
|
1329
|
-
pdfHideThumbnailsLabel:
|
|
1330
|
-
pdfPageNumberLabel:
|
|
1331
|
-
pdfContentLoadingLabel:
|
|
1332
|
-
pdfContentErrorLabel:
|
|
1333
|
-
pdfContentRetryLabel:
|
|
1334
|
-
xlsxFormulaLabel:
|
|
1335
|
-
codeContentLoadingLabel:
|
|
1336
|
-
codeContentErrorLabel:
|
|
1337
|
-
codeContentRetryLabel:
|
|
1338
|
-
tableCopyLabel:
|
|
1339
|
-
tableCopiedLabel:
|
|
1340
|
-
tableDownloadCsvLabel:
|
|
1341
|
-
codeBlockCopyLabel:
|
|
1342
|
-
codeBlockCopiedLabel:
|
|
1343
|
-
codeBlockDownloadLabel:
|
|
1344
|
-
tableScrollRegionAriaLabel:
|
|
1345
|
-
mathScrollRegionAriaLabel:
|
|
1346
|
-
ooxmlHighlightsLabel:
|
|
1347
|
-
ooxmlHighlightNavigatedLabel:
|
|
1339
|
+
pdfHideThumbnailsLabel: ee,
|
|
1340
|
+
pdfPageNumberLabel: te,
|
|
1341
|
+
pdfContentLoadingLabel: ne,
|
|
1342
|
+
pdfContentErrorLabel: j,
|
|
1343
|
+
pdfContentRetryLabel: re,
|
|
1344
|
+
xlsxFormulaLabel: ie,
|
|
1345
|
+
codeContentLoadingLabel: ae,
|
|
1346
|
+
codeContentErrorLabel: M,
|
|
1347
|
+
codeContentRetryLabel: N,
|
|
1348
|
+
tableCopyLabel: P,
|
|
1349
|
+
tableCopiedLabel: oe,
|
|
1350
|
+
tableDownloadCsvLabel: I,
|
|
1351
|
+
codeBlockCopyLabel: L,
|
|
1352
|
+
codeBlockCopiedLabel: R,
|
|
1353
|
+
codeBlockDownloadLabel: z,
|
|
1354
|
+
tableScrollRegionAriaLabel: se,
|
|
1355
|
+
mathScrollRegionAriaLabel: ce,
|
|
1356
|
+
ooxmlHighlightsLabel: le,
|
|
1357
|
+
ooxmlHighlightNavigatedLabel: V
|
|
1348
1358
|
},
|
|
1349
|
-
onDownload:
|
|
1350
|
-
onCopyText: U.type === i.PlainText || U.type === i.Code ?
|
|
1351
|
-
onCopyMarkdown: U.type === i.Markdown ?
|
|
1352
|
-
onCopyJson: U.type === i.Json ?
|
|
1359
|
+
onDownload: fe,
|
|
1360
|
+
onCopyText: U.type === i.PlainText || U.type === i.Code ? pe : void 0,
|
|
1361
|
+
onCopyMarkdown: U.type === i.Markdown ? G : void 0,
|
|
1362
|
+
onCopyJson: U.type === i.Json ? K : void 0,
|
|
1353
1363
|
tableDownloadFilename: c,
|
|
1354
1364
|
isMobile: n,
|
|
1355
1365
|
defaultWidth: r,
|
|
@@ -1363,26 +1373,26 @@ var ot = ({ children: e }) => {
|
|
|
1363
1373
|
frame: "_frame_1ys0b_1",
|
|
1364
1374
|
header: "_header_1ys0b_6",
|
|
1365
1375
|
title: "_title_1ys0b_10"
|
|
1366
|
-
}, ut =
|
|
1376
|
+
}, ut = P(({ content: e, height: t, onExpand: n, expandAriaLabel: r, actionsGroupAriaLabel: i = "Visualizer actions", frameTitle: a, loadingLabel: o, errorLabel: s, titleClassName: c = "dial-small-semi-text", isBorderless: l = !1, isTitleHidden: u = !1, colors: d, onVisualizerSendMessage: f }) => {
|
|
1367
1377
|
let p = e.visualizerName.trim(), h = !u && p !== "";
|
|
1368
|
-
return /* @__PURE__ */
|
|
1378
|
+
return /* @__PURE__ */ V("div", {
|
|
1369
1379
|
className: _("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border", lt.frame]),
|
|
1370
1380
|
style: m({
|
|
1371
1381
|
"--igv-bg": d?.background,
|
|
1372
1382
|
"--igv-border": d?.border,
|
|
1373
1383
|
"--igv-title-text": d?.titleText
|
|
1374
1384
|
}),
|
|
1375
|
-
children: [/* @__PURE__ */
|
|
1385
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1376
1386
|
className: _("flex min-h-10 items-center gap-2 py-2", h ? "justify-between" : "justify-end", !l && ["border-b px-4", lt.header]),
|
|
1377
|
-
children: [h && /* @__PURE__ */
|
|
1387
|
+
children: [h && /* @__PURE__ */ B("span", {
|
|
1378
1388
|
className: _("min-w-0 truncate", c, lt.title),
|
|
1379
1389
|
children: p
|
|
1380
|
-
}), /* @__PURE__ */
|
|
1390
|
+
}), /* @__PURE__ */ B("div", {
|
|
1381
1391
|
role: "toolbar",
|
|
1382
1392
|
"aria-label": i,
|
|
1383
1393
|
className: "flex items-center gap-1",
|
|
1384
|
-
children: /* @__PURE__ */
|
|
1385
|
-
icon: /* @__PURE__ */
|
|
1394
|
+
children: /* @__PURE__ */ B(T, {
|
|
1395
|
+
icon: /* @__PURE__ */ B(k, {
|
|
1386
1396
|
size: S.SM,
|
|
1387
1397
|
stroke: C,
|
|
1388
1398
|
"aria-hidden": !0
|
|
@@ -1392,10 +1402,10 @@ var ot = ({ children: e }) => {
|
|
|
1392
1402
|
onClick: n
|
|
1393
1403
|
})
|
|
1394
1404
|
})]
|
|
1395
|
-
}), /* @__PURE__ */
|
|
1405
|
+
}), /* @__PURE__ */ B("div", {
|
|
1396
1406
|
className: "w-full",
|
|
1397
1407
|
style: { height: `${t}px` },
|
|
1398
|
-
children: /* @__PURE__ */
|
|
1408
|
+
children: /* @__PURE__ */ B(Fe, {
|
|
1399
1409
|
content: e,
|
|
1400
1410
|
loadingLabel: o,
|
|
1401
1411
|
errorLabel: s,
|
|
@@ -1418,7 +1428,7 @@ var ot = ({ children: e }) => {
|
|
|
1418
1428
|
return n;
|
|
1419
1429
|
}
|
|
1420
1430
|
}, ft = (e, t) => {
|
|
1421
|
-
let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = st(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u =
|
|
1431
|
+
let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = st(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u = F(async (t, n, r) => {
|
|
1422
1432
|
if (t.url == null && t.referenceUrl != null) {
|
|
1423
1433
|
let i = e.resolveReferencePdfContent(t);
|
|
1424
1434
|
if (i != null) return r(i, t.name, n);
|
|
@@ -1472,7 +1482,7 @@ var ot = ({ children: e }) => {
|
|
|
1472
1482
|
s,
|
|
1473
1483
|
e
|
|
1474
1484
|
]);
|
|
1475
|
-
return { openAttachmentCanvas:
|
|
1485
|
+
return { openAttachmentCanvas: F(async (t, o = t.id, s) => {
|
|
1476
1486
|
let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (rt(e), !1);
|
|
1477
1487
|
switch (t.type) {
|
|
1478
1488
|
case c.Image: {
|
|
@@ -1510,4 +1520,4 @@ var ot = ({ children: e }) => {
|
|
|
1510
1520
|
]) };
|
|
1511
1521
|
};
|
|
1512
1522
|
//#endregion
|
|
1513
|
-
export {
|
|
1523
|
+
export { pe as ATTACHMENT_CANVAS_CLASS, He as AttachmentCanvas, ze as AttachmentCanvasBody, ct as AttachmentCanvasContainer, ot as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, he as CodeContent, ge as HTML_PREVIEW_FRAME_RENDER_MESSAGE, ut as InlineGroupedVisualizer, we as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, tt as createForbiddenCanvasContent, et as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, $e as extensionToLanguage, Ae as findVisualizerForApplication, ke as findVisualizerForMime, Q as getOoxmlFileType, Ye as getOoxmlMimeType, je as groupedVisualizerCanvasKey, o as isDownloadable, Ze as isHtmlPreviewable, Je as isOoxmlPreviewable, Xe as isTextPreviewable, Me as partitionAttachmentsForApplicationVisualizer, st as useAttachmentCanvas, ft as useOpenAttachmentCanvas };
|