@8wave/ai-elements 0.126.0-beta.32 → 0.126.0-beta.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/dist/_chunks/{Agent-COa7L9GK.js → Agent-DZEyfr8D.js} +2 -1
- package/dist/_chunks/Agent-DZEyfr8D.js.map +1 -0
- package/dist/_chunks/{PkFilePreview-SBGa95Ca.js → PkFilePreview-C6ZZablL.js} +3 -3
- package/dist/_chunks/{PkFilePreview-SBGa95Ca.js.map → PkFilePreview-C6ZZablL.js.map} +1 -1
- package/dist/_chunks/{PkFilePreviewDialog-Cc7iZWCl.js → PkFilePreviewDialog-BzBHAt8l.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-Cc7iZWCl.js.map → PkFilePreviewDialog-BzBHAt8l.js.map} +1 -1
- package/dist/_chunks/{PkImageEditorDialog-D13bWv-N.js → PkImageEditorDialog-Dm34WFmS.js} +2 -2
- package/dist/_chunks/{PkImageEditorDialog-D13bWv-N.js.map → PkImageEditorDialog-Dm34WFmS.js.map} +1 -1
- package/dist/_chunks/{PkSelectionActions-BaX_rsCt.js → PkSelectionActions-CYqbMEjg.js} +2 -2
- package/dist/_chunks/{PkSelectionActions-BaX_rsCt.js.map → PkSelectionActions-CYqbMEjg.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-GRB3Gg_x.js → PkStreamingMarkdown-B8rZbprU.js} +3 -3
- package/dist/_chunks/{PkStreamingMarkdown-GRB3Gg_x.js.map → PkStreamingMarkdown-B8rZbprU.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-DTm5-CE4.js → PkToolChatFile-C0emIVfS.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-DTm5-CE4.js.map → PkToolChatFile-C0emIVfS.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-DZenn1az.js → PkToolRequestGeolocation-DNzNRszE.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-DZenn1az.js.map → PkToolRequestGeolocation-DNzNRszE.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-Dz0qfYu5.js → PkToolRequestOAuthConnection-BDxYXz4s.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-Dz0qfYu5.js.map → PkToolRequestOAuthConnection-BDxYXz4s.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-C9_DHr5Y.js → PkToolShowArtifact-B_KIIjEn.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-C9_DHr5Y.js.map → PkToolShowArtifact-B_KIIjEn.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-DhyelktO.js → PkToolShowContactForm-DiHb3fRQ.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-DhyelktO.js.map → PkToolShowContactForm-DiHb3fRQ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-Dz2Hnzts.js → PkToolShowForm-BmUAhIQy.js} +4 -4
- package/dist/_chunks/{PkToolShowForm-Dz2Hnzts.js.map → PkToolShowForm-BmUAhIQy.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-CiDfIboY.js → PkToolShowImageGallery-CZ394fdT.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-CiDfIboY.js.map → PkToolShowImageGallery-CZ394fdT.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-CY96IGWn.js → PkToolShowProductList-uNvUr2s9.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-CY96IGWn.js.map → PkToolShowProductList-uNvUr2s9.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-CRk-MOoE.js → PkToolShowSources-Dm0L4prK.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-CRk-MOoE.js.map → PkToolShowSources-Dm0L4prK.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-DKuV4mmV.js → PkToolShowSuggestedReply-B_dRrZfj.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-DKuV4mmV.js.map → PkToolShowSuggestedReply-B_dRrZfj.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-DI6ohcVU.js → PkToolShowVideo-DLgQjTq_.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-DI6ohcVU.js.map → PkToolShowVideo-DLgQjTq_.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-Dh6L_n9T.js → PkToolShowWebPages-Cj2mJrs5.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-Dh6L_n9T.js.map → PkToolShowWebPages-Cj2mJrs5.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-Ckz-KAHA.js → chatImagePolicy-DMt6O5iK.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-Ckz-KAHA.js.map → chatImagePolicy-DMt6O5iK.js.map} +1 -1
- package/dist/_chunks/{markdown-DHayRAiy.js → markdown-nw5sXwU0.js} +2 -2
- package/dist/_chunks/{markdown-DHayRAiy.js.map → markdown-nw5sXwU0.js.map} +1 -1
- package/dist/_chunks/{utils-3jpXeGGy.js → utils-DPGBO-HU.js} +2 -2
- package/dist/_chunks/{utils-3jpXeGGy.js.map → utils-DPGBO-HU.js.map} +1 -1
- package/dist/ai-elements.es.js +3927 -3858
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{Agent-CRwhrv5Z.js → Agent-CBAd3F7k.js} +2 -1
- package/dist-vue/_chunks/Agent-CBAd3F7k.js.map +1 -0
- package/dist-vue/_chunks/{Document-Bp-qpa8v.js → Document-B3w5H0R0.js} +2 -2
- package/dist-vue/_chunks/{Document-Bp-qpa8v.js.map → Document-B3w5H0R0.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-CtrcDgBe.js → PkChatbot-CXpftmWm.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-CtrcDgBe.js.map → PkChatbot-CXpftmWm.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-BF3Odn3v.js → PkChatbotEmptyState-vA2v4FES.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-BF3Odn3v.js.map → PkChatbotEmptyState-vA2v4FES.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotInput-CIIJ1bpF.js +584 -0
- package/dist-vue/_chunks/PkChatbotInput-CIIJ1bpF.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotMessages-10eBKpC5.js → PkChatbotMessages-15R8RxAq.js} +18 -18
- package/dist-vue/_chunks/{PkChatbotMessages-10eBKpC5.js.map → PkChatbotMessages-15R8RxAq.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-C4ahOq6Z.js → PkChatbotStepPayload-BbNSav-U.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-C4ahOq6Z.js.map → PkChatbotStepPayload-BbNSav-U.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CkIX0aKu.js → PkChatbotStepToolDetail-B_4pmbLe.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CkIX0aKu.js.map → PkChatbotStepToolDetail-B_4pmbLe.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-BalLo6DZ.js → PkChatbotSteps-h4E6DH_g.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-BalLo6DZ.js.map → PkChatbotSteps-h4E6DH_g.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotViewChat-CLQ0J9_f.js +1382 -0
- package/dist-vue/_chunks/PkChatbotViewChat-CLQ0J9_f.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-D0vDYTyo.js → PkChatbotViewConversations-DFBbypGg.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-D0vDYTyo.js.map → PkChatbotViewConversations-DFBbypGg.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-BwfAnywk.js → PkChatbotViewFiles-PHdrHZOf.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-BwfAnywk.js.map → PkChatbotViewFiles-PHdrHZOf.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-GW0WuMOy.js → PkChatbotViewProfile-B0AZvHTr.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-GW0WuMOy.js.map → PkChatbotViewProfile-B0AZvHTr.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-qizsvSVW.js → PkFilePreview-Cb-1YRPN.js} +616 -666
- package/dist-vue/_chunks/PkFilePreview-Cb-1YRPN.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreviewDialog-WsVzH9hg.js → PkFilePreviewDialog-Bd7kEoCB.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-WsVzH9hg.js.map → PkFilePreviewDialog-Bd7kEoCB.js.map} +1 -1
- package/dist-vue/_chunks/{PkImageEditorDialog-NQFpdqCU.js → PkImageEditorDialog-Bj4sUHXM.js} +2 -2
- package/dist-vue/_chunks/{PkImageEditorDialog-NQFpdqCU.js.map → PkImageEditorDialog-Bj4sUHXM.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-CMxiJTMR.js → PkStreamingMarkdown-BcUq4ThC.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-CMxiJTMR.js.map → PkStreamingMarkdown-BcUq4ThC.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-Bd6Ci7i1.js → PkToolChatFile-BOexrlLt.js} +3 -3
- package/dist-vue/_chunks/{PkToolChatFile-Bd6Ci7i1.js.map → PkToolChatFile-BOexrlLt.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-C2OmF31d.js → PkToolRequestGeolocation-CyL_M1Rm.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-C2OmF31d.js.map → PkToolRequestGeolocation-CyL_M1Rm.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-CgD-o99C.js → PkToolRequestOAuthConnection-DWkeVLpx.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-CgD-o99C.js.map → PkToolRequestOAuthConnection-DWkeVLpx.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-rlZ-AGWh.js → PkToolShowArtifact-C4gHB6lH.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-rlZ-AGWh.js.map → PkToolShowArtifact-C4gHB6lH.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowChart-B8xJi1yY.js → PkToolShowChart-CsPXNAb9.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowChart-B8xJi1yY.js.map → PkToolShowChart-CsPXNAb9.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-BVBL7Unx.js → PkToolShowContactForm-2_HBPZaa.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-BVBL7Unx.js.map → PkToolShowContactForm-2_HBPZaa.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-Bs39QQZ3.js → PkToolShowDiagram-cCbeL6MK.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-Bs39QQZ3.js.map → PkToolShowDiagram-cCbeL6MK.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-D-RJeA2F.js → PkToolShowForm-DjB3fji5.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-D-RJeA2F.js.map → PkToolShowForm-DjB3fji5.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-CrkkKCVI.js → PkToolShowImageGallery-C22TCUKW.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-CrkkKCVI.js.map → PkToolShowImageGallery-C22TCUKW.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-BwfUG41_.js → PkToolShowProductList-BvtmiHBf.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-BwfUG41_.js.map → PkToolShowProductList-BvtmiHBf.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-q9gQIuam.js → PkToolShowSources-uKO4MQgd.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-q9gQIuam.js.map → PkToolShowSources-uKO4MQgd.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-75Kc8-OQ.js → PkToolShowSuggestedReply-wKgwHTRO.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-75Kc8-OQ.js.map → PkToolShowSuggestedReply-wKgwHTRO.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-BK-jDVJd.js → PkToolShowVideo-DKj5N1vo.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-BK-jDVJd.js.map → PkToolShowVideo-DKj5N1vo.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-K3Jml1f7.js → PkToolShowWebPages-BNZmbCSf.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-K3Jml1f7.js.map → PkToolShowWebPages-BNZmbCSf.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-Pb7_cU2s.js → createChatbotApiClient-DBKfGL6y.js} +5 -2
- package/dist-vue/_chunks/{createChatbotApiClient-Pb7_cU2s.js.map → createChatbotApiClient-DBKfGL6y.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-ChrZVIDt.js → useChatbotStore-Hb5EjISl.js} +94 -85
- package/dist-vue/_chunks/useChatbotStore-Hb5EjISl.js.map +1 -0
- package/dist-vue/_chunks/{utils-Bdk5kFfi.js → utils-waie4Gfn.js} +2 -2
- package/dist-vue/_chunks/{utils-Bdk5kFfi.js.map → utils-waie4Gfn.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +2 -0
- package/dist-vue/composables.js +8 -8
- package/dist-vue/index.js +408 -389
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +6 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +9 -2
- package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +6 -0
- package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +5 -0
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +10 -1
- package/dist-vue/packages/models/src/schema/Agent.d.ts +8 -0
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +2 -0
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +2 -0
- package/dist-vue/packages/models/src/schema/constants.d.ts +11 -2
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-COa7L9GK.js.map +0 -1
- package/dist-vue/_chunks/Agent-CRwhrv5Z.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-DNXvFvyG.js +0 -520
- package/dist-vue/_chunks/PkChatbotInput-DNXvFvyG.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-U6T-gG-c.js +0 -1336
- package/dist-vue/_chunks/PkChatbotViewChat-U6T-gG-c.js.map +0 -1
- package/dist-vue/_chunks/PkFilePreview-qizsvSVW.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-ChrZVIDt.js.map +0 -1
|
@@ -1,66 +1,16 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
2
|
import { t } from "./VvButtonLocalized-C-vx25u4.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
var de = "(hover: hover) and (pointer: fine)", fe = "(hover: none) and (pointer: coarse)", G = 400;
|
|
13
|
-
function pe() {
|
|
14
|
-
return typeof matchMedia == "function" && matchMedia(fe).matches;
|
|
15
|
-
}
|
|
16
|
-
function me(e) {
|
|
17
|
-
let t = document.getSelection();
|
|
18
|
-
if (!t || t.rangeCount === 0) return;
|
|
19
|
-
if (e.nodeType === Node.DOCUMENT_NODE) return t.getRangeAt(0).cloneRange();
|
|
20
|
-
let n = e;
|
|
21
|
-
if (t.getComposedRanges) {
|
|
22
|
-
let e;
|
|
23
|
-
try {
|
|
24
|
-
e = t.getComposedRanges({ shadowRoots: [n] });
|
|
25
|
-
} catch {
|
|
26
|
-
e = t.getComposedRanges(n);
|
|
27
|
-
}
|
|
28
|
-
let [r] = e;
|
|
29
|
-
if (!r) return;
|
|
30
|
-
let i = document.createRange();
|
|
31
|
-
return i.setStart(r.startContainer, r.startOffset), i.setEnd(r.endContainer, r.endOffset), i;
|
|
32
|
-
}
|
|
33
|
-
let r = n.getSelection?.();
|
|
34
|
-
return r && r.rangeCount > 0 ? r.getRangeAt(0).cloneRange() : void 0;
|
|
35
|
-
}
|
|
36
|
-
function he({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2, touch: i = !1 }) {
|
|
37
|
-
let a = ie(), o, s = () => {
|
|
38
|
-
clearTimeout(o), a.value = void 0;
|
|
39
|
-
}, c = () => {
|
|
40
|
-
let n = e();
|
|
41
|
-
if (!n || !t()) return;
|
|
42
|
-
let i = me(n);
|
|
43
|
-
if (!i || i.collapsed || i.toString().trim().length < r) return;
|
|
44
|
-
let a = i.getBoundingClientRect();
|
|
45
|
-
return {
|
|
46
|
-
range: i,
|
|
47
|
-
start: i.getClientRects()[0] ?? a,
|
|
48
|
-
box: a
|
|
49
|
-
};
|
|
50
|
-
}, l = typeof document < "u" && typeof matchMedia == "function" && matchMedia(de).matches, u = i && typeof document < "u" && pe(), d = u ? Math.max(n, G) : n, f = () => {
|
|
51
|
-
s(), o = setTimeout(() => {
|
|
52
|
-
a.value = c();
|
|
53
|
-
}, d);
|
|
54
|
-
};
|
|
55
|
-
return (l || u) && (document.addEventListener("selectionchange", f), P(() => {
|
|
56
|
-
clearTimeout(o), document.removeEventListener("selectionchange", f);
|
|
57
|
-
})), {
|
|
58
|
-
selection: a,
|
|
59
|
-
clear: s
|
|
60
|
-
};
|
|
61
|
-
}
|
|
3
|
+
import { i as n, r } from "./PkChatbotInput-CIIJ1bpF.js";
|
|
4
|
+
import { t as i } from "./PkEditorRadioButtons-Bw576DPQ.js";
|
|
5
|
+
import { G as a, J as o, K as s, V as c, W as l, X as u, Y as d, Z as f, o as p, q as m, s as h } from "./utils-waie4Gfn.js";
|
|
6
|
+
import { r as g } from "./PkChatbotViewChat-CLQ0J9_f.js";
|
|
7
|
+
import { i as _, n as v, r as y } from "./excelNumberFormat-CJwdxpPX.js";
|
|
8
|
+
import { VvIcon as b } from "@volverjs/ui-vue/components";
|
|
9
|
+
import { Fragment as x, computed as S, createBlock as C, createCommentVNode as w, createElementBlock as T, createElementVNode as E, createTextVNode as D, createVNode as O, defineAsyncComponent as ee, defineComponent as k, inject as A, isMemoSame as j, mergeModels as M, nextTick as te, normalizeClass as N, normalizeStyle as P, onBeforeUnmount as ne, onMounted as re, openBlock as F, provide as ie, ref as I, renderList as L, shallowRef as ae, toDisplayString as R, unref as z, useModel as B, useTemplateRef as oe, vModelText as V, watch as H, withCtx as se, withDirectives as U, withKeys as ce, withModifiers as W } from "vue";
|
|
10
|
+
import { useI18n as le } from "vue-i18n";
|
|
11
|
+
import { useElementSize as ue, useEventListener as de } from "@vueuse/core";
|
|
62
12
|
// ../../packages/components/src/chat/selectionActionIcons.ts
|
|
63
|
-
var
|
|
13
|
+
var fe = {
|
|
64
14
|
sparkles: "ri:sparkling-line",
|
|
65
15
|
magic: "ri:magic-line",
|
|
66
16
|
idea: "ri:lightbulb-line",
|
|
@@ -187,27 +137,27 @@ var K = {
|
|
|
187
137
|
music: "ri:music-2-line",
|
|
188
138
|
video: "ri:video-line",
|
|
189
139
|
microphone: "ri:mic-line"
|
|
190
|
-
},
|
|
191
|
-
let t = [...new Set(e)].sort((e, t) =>
|
|
140
|
+
}, pe = (e) => fe[e ?? "sparkles"], G = 2e3, me = 1e3, he = 60, K = 1400, ge = 20, _e = 100, q = (e) => Number(e.slice(1)), ve = (e) => {
|
|
141
|
+
let t = [...new Set(e)].sort((e, t) => q(e) - q(t)), n = [];
|
|
192
142
|
for (let e of t) {
|
|
193
143
|
let t = n[n.length - 1];
|
|
194
|
-
t &&
|
|
144
|
+
t && q(e) === q(t.to) + 1 ? t.to = e : n.push({
|
|
195
145
|
from: e,
|
|
196
146
|
to: e
|
|
197
147
|
});
|
|
198
148
|
}
|
|
199
149
|
return n.slice(0, 100);
|
|
200
|
-
},
|
|
150
|
+
}, ye = (e, t) => {
|
|
201
151
|
let n = [];
|
|
202
152
|
if (!t) return n;
|
|
203
153
|
for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + 1)) n.push(r);
|
|
204
154
|
return n;
|
|
205
|
-
},
|
|
206
|
-
let r =
|
|
155
|
+
}, be = (e, t, n) => {
|
|
156
|
+
let r = ye(e, e.slice(t, t + n));
|
|
207
157
|
if (r.length < 2) return {};
|
|
208
158
|
let i = t, a = t + n;
|
|
209
|
-
for (let t = !0; a - i <=
|
|
210
|
-
if (
|
|
159
|
+
for (let t = !0; a - i <= K; t = !t) {
|
|
160
|
+
if (ye(e, e.slice(i, a)).length === 1) return { find: e.slice(i, a) };
|
|
211
161
|
if (t && i > 0) i = e.slice(0, i).replace(/\S*\s*$/, "").length;
|
|
212
162
|
else if (a < e.length) {
|
|
213
163
|
let t = e.slice(a).match(/^\s*\S*/)?.[0] ?? "";
|
|
@@ -218,23 +168,23 @@ var K = {
|
|
|
218
168
|
index: r.indexOf(t) + 1 || 1,
|
|
219
169
|
of: r.length
|
|
220
170
|
} };
|
|
221
|
-
},
|
|
171
|
+
}, xe = (e) => (e.querySelectorAll("[data-quote-skip]").forEach((e) => e.remove()), e.querySelectorAll("[data-paragraph]").forEach((e) => e.append("\n")), e.textContent ?? ""), Se = (e) => e.length > me ? `${e.slice(0, me / 2)} […] ${e.slice(-500)}` : e, Ce = (e) => {
|
|
222
172
|
let t = e.startContainer.getRootNode().getSelection?.() ?? document.getSelection();
|
|
223
173
|
try {
|
|
224
174
|
t?.setBaseAndExtent(e.startContainer, e.startOffset, e.endContainer, e.endOffset);
|
|
225
175
|
} catch {}
|
|
226
|
-
},
|
|
176
|
+
}, we = (e, t, n) => {
|
|
227
177
|
let r = t.commonAncestorContainer;
|
|
228
178
|
if (!e.contains(r) || (r instanceof Element ? r : r.parentElement)?.closest("[data-quote-skip]")) return;
|
|
229
179
|
let i = [...e.querySelectorAll("[data-paragraph]")].filter((e) => !e.closest(n) && t.intersectsNode(e));
|
|
230
180
|
if (!i.length) return;
|
|
231
|
-
let a = i.flatMap((e) => e.dataset.paragraph.split(" ")), o =
|
|
181
|
+
let a = i.flatMap((e) => e.dataset.paragraph.split(" ")), o = xe(t.cloneContents()), s = o.trim();
|
|
232
182
|
if (s.length < 2) return;
|
|
233
183
|
let c = {
|
|
234
184
|
format: "docx",
|
|
235
|
-
runs:
|
|
185
|
+
runs: ve(a),
|
|
236
186
|
paragraphCount: new Set(a).size,
|
|
237
|
-
quote:
|
|
187
|
+
quote: Se(s),
|
|
238
188
|
measure: () => {
|
|
239
189
|
let e = t.getBoundingClientRect(), n = t.getClientRects()[0] ?? e;
|
|
240
190
|
return {
|
|
@@ -245,22 +195,22 @@ var K = {
|
|
|
245
195
|
bottom: e.bottom
|
|
246
196
|
};
|
|
247
197
|
},
|
|
248
|
-
restore: () =>
|
|
198
|
+
restore: () => Ce(t)
|
|
249
199
|
};
|
|
250
200
|
if (i.length === 1) {
|
|
251
201
|
let e = i[0], n = document.createRange();
|
|
252
202
|
n.selectNodeContents(e);
|
|
253
|
-
let r =
|
|
203
|
+
let r = xe(n.cloneContents()).replace(/\n$/, ""), a = document.createRange();
|
|
254
204
|
a.setStart(e, 0), a.setEnd(t.startContainer, t.startOffset);
|
|
255
|
-
let l =
|
|
256
|
-
c.before = r.slice(Math.max(0, l -
|
|
205
|
+
let l = xe(a.cloneContents()).length + (o.length - o.trimStart().length);
|
|
206
|
+
c.before = r.slice(Math.max(0, l - he), l), c.after = r.slice(l + s.length, l + s.length + he), Object.assign(c, be(r, l, s.length));
|
|
257
207
|
}
|
|
258
208
|
return c;
|
|
259
|
-
},
|
|
209
|
+
}, Te = (e) => {
|
|
260
210
|
let t = "";
|
|
261
211
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
262
212
|
return t;
|
|
263
|
-
},
|
|
213
|
+
}, Ee = (e, t) => {
|
|
264
214
|
let n = { ...t }, r = e.rows.flatMap((e) => e.cells.filter((e) => e.span).map((t) => ({
|
|
265
215
|
r1: e.row,
|
|
266
216
|
r2: e.row + t.span.rows - 1,
|
|
@@ -271,7 +221,7 @@ var K = {
|
|
|
271
221
|
e = !1;
|
|
272
222
|
for (let t of r) t.r1 <= n.r2 && t.r2 >= n.r1 && t.c1 <= n.c2 && t.c2 >= n.c1 && (t.r1 < n.r1 || t.r2 > n.r2 || t.c1 < n.c1 || t.c2 > n.c2) && (n.r1 = Math.min(n.r1, t.r1), n.r2 = Math.max(n.r2, t.r2), n.c1 = Math.min(n.c1, t.c1), n.c2 = Math.max(n.c2, t.c2), e = !0);
|
|
273
223
|
}
|
|
274
|
-
let i = `${
|
|
224
|
+
let i = `${Te(n.c1)}${n.r1}`, a = `${Te(n.c2)}${n.r2}`, o = (e.hiddenRows ?? []).filter((e) => e >= n.r1 && e <= n.r2).slice(0, _e), s = e.columns.filter((e) => e.hidden && e.col >= n.c1 && e.col <= n.c2).map((e) => Te(e.col)).slice(0, _e), c = e.rows.filter((e) => e.row >= n.r1 && e.row <= n.r2).flatMap((e) => e.cells.filter((e) => e.col >= n.c1 && e.col <= n.c2 && e.value !== void 0 && e.value !== "")).slice(0, ge).map((e) => String(e.value)).join("; ").slice(0, 500);
|
|
275
225
|
return {
|
|
276
226
|
format: "xlsx",
|
|
277
227
|
sheet: e.name,
|
|
@@ -281,12 +231,12 @@ var K = {
|
|
|
281
231
|
...s.length ? { hiddenColumns: s } : {},
|
|
282
232
|
...c ? { sample: c } : {}
|
|
283
233
|
};
|
|
284
|
-
},
|
|
234
|
+
}, De = ["placeholder", "aria-label"], Oe = ["disabled"], J = ["aria-label"], Y = { class: "pk-selection-actions__text" }, X = {
|
|
285
235
|
key: 0,
|
|
286
236
|
class: "pk-selection-actions__text"
|
|
287
|
-
},
|
|
237
|
+
}, Z = ["onClick", "onTouchend"], ke = /* @__PURE__ */ k({
|
|
288
238
|
__name: "PkSelectionActions",
|
|
289
|
-
props: /*@__PURE__*/
|
|
239
|
+
props: /*@__PURE__*/ M({
|
|
290
240
|
actions: {},
|
|
291
241
|
anchor: {},
|
|
292
242
|
strategy: {},
|
|
@@ -301,7 +251,7 @@ var K = {
|
|
|
301
251
|
},
|
|
302
252
|
askingModifiers: {}
|
|
303
253
|
}),
|
|
304
|
-
emits: /*@__PURE__*/
|
|
254
|
+
emits: /*@__PURE__*/ M([
|
|
305
255
|
"action",
|
|
306
256
|
"ask",
|
|
307
257
|
"note",
|
|
@@ -316,7 +266,7 @@ var K = {
|
|
|
316
266
|
proofread: "ri:check-double-line",
|
|
317
267
|
translate: "ri:translate-2",
|
|
318
268
|
chart: "ri:bar-chart-2-line"
|
|
319
|
-
}, r = e, i = t, a = B(e, "asking"), { t:
|
|
269
|
+
}, r = e, i = t, a = B(e, "asking"), { t: o } = le({ useScope: "global" }), s = oe("barEl"), l = oe("inputEl"), { width: u, height: d } = ue(s, void 0, { box: "border-box" }), f = S(() => c({
|
|
320
270
|
...r.anchor,
|
|
321
271
|
bar: {
|
|
322
272
|
width: u.value,
|
|
@@ -327,39 +277,39 @@ var K = {
|
|
|
327
277
|
p.value = {
|
|
328
278
|
id: e,
|
|
329
279
|
placeholder: t
|
|
330
|
-
}, m.value = "", a.value = !0, await
|
|
280
|
+
}, m.value = "", a.value = !0, await te(), l.value?.focus();
|
|
331
281
|
}, g = () => {
|
|
332
282
|
p.value = void 0, a.value = !1;
|
|
333
|
-
}, _ = () => h(void 0,
|
|
283
|
+
}, _ = () => h(void 0, o("selectionActions.askPlaceholder")), v = (e) => n[e.id] ?? pe(e.icon), y = (e) => {
|
|
334
284
|
e.asks ? h(e.id, e.asks) : i("action", e.id);
|
|
335
|
-
},
|
|
285
|
+
}, C = (e, t) => {
|
|
336
286
|
let n = e.currentTarget, r = e.changedTouches[0], i = n.getRootNode(), a = r && i.elementFromPoint(r.clientX, r.clientY);
|
|
337
287
|
a && n.contains(a) && t();
|
|
338
|
-
},
|
|
288
|
+
}, ee = () => {
|
|
339
289
|
let e = m.value.trim();
|
|
340
290
|
e && p.value && (p.value.id ? i("action", p.value.id, e) : i("ask", e), g());
|
|
341
|
-
},
|
|
291
|
+
}, k = (e) => {
|
|
342
292
|
e.isComposing || (e.stopPropagation(), e.preventDefault(), p.value ? g() : i("close"));
|
|
343
293
|
};
|
|
344
294
|
return (t, n) => {
|
|
345
|
-
let r =
|
|
346
|
-
return F(),
|
|
347
|
-
class:
|
|
295
|
+
let r = b;
|
|
296
|
+
return F(), T("div", {
|
|
297
|
+
class: N(["pk-selection-actions", {
|
|
348
298
|
"pk-selection-actions--fixed": e.strategy === "fixed",
|
|
349
299
|
"pk-selection-actions--asking": !!p.value
|
|
350
300
|
}]),
|
|
351
|
-
style:
|
|
301
|
+
style: P({
|
|
352
302
|
top: `${f.value.top}px`,
|
|
353
303
|
left: `${f.value.left}px`
|
|
354
304
|
}),
|
|
355
|
-
onKeydown:
|
|
356
|
-
}, [p.value ? (F(),
|
|
305
|
+
onKeydown: ce(k, ["esc"])
|
|
306
|
+
}, [p.value ? (F(), T("form", {
|
|
357
307
|
key: 0,
|
|
358
308
|
ref_key: "barEl",
|
|
359
|
-
ref:
|
|
309
|
+
ref: s,
|
|
360
310
|
class: "pk-selection-actions__menu pk-selection-actions__menu--field",
|
|
361
|
-
onSubmit:
|
|
362
|
-
}, [
|
|
311
|
+
onSubmit: W(ee, ["prevent"])
|
|
312
|
+
}, [U(E("input", {
|
|
363
313
|
ref_key: "inputEl",
|
|
364
314
|
ref: l,
|
|
365
315
|
"onUpdate:modelValue": n[0] ||= (e) => m.value = e,
|
|
@@ -368,70 +318,70 @@ var K = {
|
|
|
368
318
|
maxlength: "500",
|
|
369
319
|
placeholder: p.value.placeholder,
|
|
370
320
|
"aria-label": p.value.placeholder
|
|
371
|
-
}, null, 8,
|
|
321
|
+
}, null, 8, De), [[V, m.value]]), E("button", {
|
|
372
322
|
type: "submit",
|
|
373
323
|
class: "pk-selection-actions__button pk-selection-actions__button--send",
|
|
374
324
|
disabled: !m.value.trim()
|
|
375
|
-
}, R(z(
|
|
325
|
+
}, R(z(o)("action.send")), 9, Oe)], 544)) : (F(), T("div", {
|
|
376
326
|
key: 1,
|
|
377
327
|
ref_key: "barEl",
|
|
378
|
-
ref:
|
|
328
|
+
ref: s,
|
|
379
329
|
class: "pk-selection-actions__menu",
|
|
380
330
|
role: "toolbar",
|
|
381
331
|
"aria-orientation": "vertical",
|
|
382
|
-
"aria-label": z(
|
|
383
|
-
onTouchstart: n[7] ||=
|
|
384
|
-
}, [e.note ? (F(),
|
|
332
|
+
"aria-label": z(o)("selectionActions.label"),
|
|
333
|
+
onTouchstart: n[7] ||= W(() => {}, ["prevent"])
|
|
334
|
+
}, [e.note ? (F(), T(x, { key: 0 }, [E("p", Y, R(e.note), 1), e.noteAction ? (F(), T("button", {
|
|
385
335
|
key: 0,
|
|
386
336
|
type: "button",
|
|
387
337
|
class: "pk-selection-actions__button",
|
|
388
|
-
onMousedown: n[1] ||=
|
|
338
|
+
onMousedown: n[1] ||= W(() => {}, ["prevent"]),
|
|
389
339
|
onClick: n[2] ||= (e) => i("note"),
|
|
390
|
-
onTouchend: n[3] ||= (e) =>
|
|
391
|
-
}, [
|
|
340
|
+
onTouchend: n[3] ||= (e) => C(e, () => i("note"))
|
|
341
|
+
}, [O(r, {
|
|
392
342
|
name: "ri:arrow-right-line",
|
|
393
343
|
class: "pk-selection-actions__icon"
|
|
394
|
-
}),
|
|
395
|
-
e.hint ? (F(),
|
|
396
|
-
(F(!0),
|
|
344
|
+
}), D(" " + R(e.noteAction), 1)], 32)) : w("", !0)], 64)) : (F(), T(x, { key: 1 }, [
|
|
345
|
+
e.hint ? (F(), T("p", X, R(e.hint), 1)) : w("", !0),
|
|
346
|
+
(F(!0), T(x, null, L(e.actions, (e) => (F(), T("button", {
|
|
397
347
|
key: e.id,
|
|
398
348
|
type: "button",
|
|
399
349
|
class: "pk-selection-actions__button",
|
|
400
|
-
onMousedown: n[4] ||=
|
|
401
|
-
onClick: (t) =>
|
|
402
|
-
onTouchend: (t) =>
|
|
403
|
-
}, [
|
|
404
|
-
name:
|
|
350
|
+
onMousedown: n[4] ||= W(() => {}, ["prevent"]),
|
|
351
|
+
onClick: (t) => y(e),
|
|
352
|
+
onTouchend: (t) => C(t, () => y(e))
|
|
353
|
+
}, [O(r, {
|
|
354
|
+
name: v(e),
|
|
405
355
|
class: "pk-selection-actions__icon"
|
|
406
|
-
}, null, 8, ["name"]),
|
|
407
|
-
n[8] ||=
|
|
408
|
-
|
|
356
|
+
}, null, 8, ["name"]), D(" " + R(e.label), 1)], 40, Z))), 128)),
|
|
357
|
+
n[8] ||= E("hr", { class: "pk-selection-actions__rule" }, null, -1),
|
|
358
|
+
E("button", {
|
|
409
359
|
type: "button",
|
|
410
360
|
class: "pk-selection-actions__button",
|
|
411
|
-
onMousedown: n[5] ||=
|
|
361
|
+
onMousedown: n[5] ||= W(() => {}, ["prevent"]),
|
|
412
362
|
onClick: _,
|
|
413
|
-
onTouchend: n[6] ||= (e) =>
|
|
414
|
-
}, [
|
|
363
|
+
onTouchend: n[6] ||= (e) => C(e, _)
|
|
364
|
+
}, [O(r, {
|
|
415
365
|
name: "ri:chat-1-line",
|
|
416
366
|
class: "pk-selection-actions__icon"
|
|
417
|
-
}),
|
|
418
|
-
], 64))], 40,
|
|
367
|
+
}), D(" " + R(z(o)("selectionActions.ask")), 1)], 32)
|
|
368
|
+
], 64))], 40, J))], 38);
|
|
419
369
|
};
|
|
420
370
|
}
|
|
421
|
-
}),
|
|
371
|
+
}), Ae = {
|
|
422
372
|
class: "pk-file-chart",
|
|
423
373
|
"data-quote-skip": ""
|
|
424
|
-
},
|
|
374
|
+
}, je = {
|
|
425
375
|
key: 1,
|
|
426
376
|
class: "pk-file-chart__placeholder"
|
|
427
|
-
},
|
|
377
|
+
}, Q = { class: "pk-file-chart__title" }, Me = /* @__PURE__ */ k({
|
|
428
378
|
__name: "PkFileChart",
|
|
429
379
|
props: { preview: {} },
|
|
430
380
|
setup(e) {
|
|
431
|
-
let t =
|
|
381
|
+
let t = ee(() => import("./PkChart-CmrpyYAS.js")), { t: n } = le({ useScope: "global" });
|
|
432
382
|
return (r, i) => {
|
|
433
|
-
let a =
|
|
434
|
-
return F(),
|
|
383
|
+
let a = b;
|
|
384
|
+
return F(), T("div", Ae, [e.preview.chart ? (F(), C(z(t), {
|
|
435
385
|
key: 0,
|
|
436
386
|
chart: e.preview.chart,
|
|
437
387
|
colors: e.preview.colors,
|
|
@@ -441,28 +391,28 @@ var K = {
|
|
|
441
391
|
"chart",
|
|
442
392
|
"colors",
|
|
443
393
|
"legend"
|
|
444
|
-
])) : (F(),
|
|
445
|
-
|
|
394
|
+
])) : (F(), T("div", je, [
|
|
395
|
+
O(a, {
|
|
446
396
|
name: "ri:bar-chart-2-line",
|
|
447
397
|
class: "text-16"
|
|
448
398
|
}),
|
|
449
|
-
|
|
450
|
-
|
|
399
|
+
E("span", Q, R(e.preview.title || z(n)("chatFilePreview.chart")), 1),
|
|
400
|
+
E("span", null, R(z(n)("chatFilePreview.chartNotDrawn")), 1)
|
|
451
401
|
]))]);
|
|
452
402
|
};
|
|
453
403
|
}
|
|
454
|
-
}),
|
|
404
|
+
}), Ne = (e, t, n, r) => {
|
|
455
405
|
let i = e.numFmt === void 0 ? void 0 : n.numberFormats?.[e.numFmt];
|
|
456
406
|
if (i !== void 0) try {
|
|
457
|
-
return e.format === "date" ||
|
|
407
|
+
return e.format === "date" || _(i) ? v(i, t, r, n.date1904) : y(i, t, r);
|
|
458
408
|
} catch {
|
|
459
409
|
return;
|
|
460
410
|
}
|
|
461
|
-
},
|
|
411
|
+
}, Pe = (e, t, n) => {
|
|
462
412
|
let r = e.format === "date" ? e.serial : e.value;
|
|
463
|
-
return typeof r == "number" ?
|
|
464
|
-
},
|
|
465
|
-
let i =
|
|
413
|
+
return typeof r == "number" ? Ne(e, r, t, n) : void 0;
|
|
414
|
+
}, Fe = (e, t, n, r) => {
|
|
415
|
+
let i = Ne(e, t, n, r);
|
|
466
416
|
if (i) return i.text;
|
|
467
417
|
let a = e.decimals === void 0 ? { maximumFractionDigits: 10 } : {
|
|
468
418
|
minimumFractionDigits: e.decimals,
|
|
@@ -477,15 +427,15 @@ var K = {
|
|
|
477
427
|
currency: e.currency
|
|
478
428
|
} : {}
|
|
479
429
|
}).format(t);
|
|
480
|
-
},
|
|
430
|
+
}, Ie = (e, t, n) => {
|
|
481
431
|
let r = 0, i = 0, a = 0, o;
|
|
482
432
|
for (let t of e) t && (t.value !== void 0 || t.missing) && (r++, typeof t.value == "number" && (i += t.value, a++, o ??= t));
|
|
483
433
|
if (r) return {
|
|
484
434
|
count: r,
|
|
485
|
-
sum: o ?
|
|
486
|
-
average: o ?
|
|
435
|
+
sum: o ? Fe(o, i, t, n) : void 0,
|
|
436
|
+
average: o ? Fe(o, i / a, t, n) : void 0
|
|
487
437
|
};
|
|
488
|
-
},
|
|
438
|
+
}, Le = { class: "pk-spreadsheet-preview" }, Re = { class: "pk-spreadsheet-preview__bar" }, ze = ["aria-label"], Be = ["aria-label"], Ve = ["aria-label"], He = [
|
|
489
439
|
"rowspan",
|
|
490
440
|
"colspan",
|
|
491
441
|
"data-focus",
|
|
@@ -493,21 +443,21 @@ var K = {
|
|
|
493
443
|
"title",
|
|
494
444
|
"onMousedown",
|
|
495
445
|
"onMouseenter"
|
|
496
|
-
],
|
|
446
|
+
], Ue = {
|
|
497
447
|
key: 1,
|
|
498
448
|
class: "pk-spreadsheet-preview__charts"
|
|
499
|
-
},
|
|
449
|
+
}, We = {
|
|
500
450
|
key: 2,
|
|
501
451
|
class: "pk-spreadsheet-preview__more"
|
|
502
|
-
},
|
|
452
|
+
}, Ge = ["aria-label"], Ke = ["aria-current", "onClick"], qe = { class: "pk-spreadsheet-preview__status" }, Je = { class: "pk-spreadsheet-preview__info" }, Ye = ["title"], Xe = ["title"], Ze = {
|
|
503
453
|
key: 2,
|
|
504
454
|
class: "pk-spreadsheet-preview__stats"
|
|
505
|
-
},
|
|
455
|
+
}, Qe = {
|
|
506
456
|
key: 0,
|
|
507
457
|
class: "pk-spreadsheet-preview__average"
|
|
508
|
-
},
|
|
458
|
+
}, $e = { key: 1 }, et = { class: "pk-spreadsheet-preview__zoom" }, tt = { class: "pk-spreadsheet-preview__percent" }, nt = 64, rt = 20, it = 28, at = 44, ot = 400, st = 10, ct = /* @__PURE__ */ k({
|
|
509
459
|
__name: "PkSpreadsheetPreview",
|
|
510
|
-
props: /*@__PURE__*/
|
|
460
|
+
props: /*@__PURE__*/ M({
|
|
511
461
|
preview: {},
|
|
512
462
|
marked: {}
|
|
513
463
|
}, {
|
|
@@ -516,72 +466,72 @@ var K = {
|
|
|
516
466
|
zoom: { default: 1 },
|
|
517
467
|
zoomModifiers: {}
|
|
518
468
|
}),
|
|
519
|
-
emits: /*@__PURE__*/
|
|
469
|
+
emits: /*@__PURE__*/ M(["select"], ["update:sheet", "update:zoom"]),
|
|
520
470
|
setup(e, { emit: n }) {
|
|
521
|
-
let r = e, i = n, { t: a, locale: o } =
|
|
471
|
+
let r = e, i = n, { t: a, locale: o } = le({ useScope: "global" }), s = B(e, "sheet"), c = B(e, "zoom"), l = oe("scrollEl"), { width: u, height: d } = ue(l, {
|
|
522
472
|
width: 0,
|
|
523
473
|
height: 0
|
|
524
|
-
}, { box: "border-box" }), f =
|
|
474
|
+
}, { box: "border-box" }), f = S(() => r.preview.sheets[s.value] ?? r.preview.sheets[0]);
|
|
525
475
|
H(() => r.preview, () => {
|
|
526
476
|
s.value = 0;
|
|
527
477
|
});
|
|
528
|
-
let p =
|
|
478
|
+
let p = S(() => r.marked?.get(f.value?.name ?? "")), m = S(() => {
|
|
529
479
|
let e = /* @__PURE__ */ new Map();
|
|
530
480
|
for (let t of p.value ?? []) {
|
|
531
481
|
let [n, r] = t.split(":"), i = e.get(Number(n));
|
|
532
482
|
e.set(Number(n), i ? `${i},${r}` : r);
|
|
533
483
|
}
|
|
534
484
|
return e;
|
|
535
|
-
}),
|
|
485
|
+
}), h = (e, t) => !!p.value?.has(`${e}:${t}`);
|
|
536
486
|
H(() => r.marked, (e) => {
|
|
537
487
|
if (!e || p.value) return;
|
|
538
488
|
let t = r.preview.sheets.findIndex((t) => e.has(t.name));
|
|
539
489
|
t >= 0 && (s.value = t);
|
|
540
490
|
}, { immediate: !0 });
|
|
541
|
-
let _ = () =>
|
|
542
|
-
H(p, _, { flush: "post" }),
|
|
491
|
+
let _ = () => g(l.value, ".pk-spreadsheet-preview__cell--marked");
|
|
492
|
+
H(p, _, { flush: "post" }), re(_);
|
|
543
493
|
let v = (e) => {
|
|
544
494
|
let t = "";
|
|
545
495
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
546
496
|
return t;
|
|
547
|
-
},
|
|
497
|
+
}, y = S(() => (f.value?.charts ?? []).reduce((e, t) => ({
|
|
548
498
|
col: Math.max(e.col, t.lastCol),
|
|
549
499
|
row: Math.max(e.row, t.lastRow)
|
|
550
500
|
}), {
|
|
551
501
|
col: 0,
|
|
552
502
|
row: 0
|
|
553
|
-
})),
|
|
503
|
+
})), b = S(() => {
|
|
554
504
|
let e = f.value;
|
|
555
505
|
if (!e) return [];
|
|
556
|
-
let t = new Set(e.columns.filter((e) => e.hidden).map((e) => e.col)), n = new Map(e.columns.map((e) => [e.col, e.width])), r = [], i =
|
|
557
|
-
for (let o = 1; o <= e.lastColumn || o <=
|
|
506
|
+
let t = new Set(e.columns.filter((e) => e.hidden).map((e) => e.col)), n = new Map(e.columns.map((e) => [e.col, e.width])), r = [], i = at, a = u.value / c.value;
|
|
507
|
+
for (let o = 1; o <= e.lastColumn || o <= y.value.col || !e.moreColumns && (o <= e.lastColumn + 2 || i < a); o++) {
|
|
558
508
|
if (t.has(o)) continue;
|
|
559
|
-
let e = n.get(o) ??
|
|
509
|
+
let e = n.get(o) ?? nt;
|
|
560
510
|
r.push({
|
|
561
511
|
col: o,
|
|
562
512
|
width: e
|
|
563
513
|
}), i += e;
|
|
564
514
|
}
|
|
565
515
|
return r;
|
|
566
|
-
}),
|
|
516
|
+
}), C = S(() => b.value.reduce((e, t) => e + t.width, at)), ee = S(() => b.value.map((e) => `${e.col}:${e.width}`).join(",")), k = /* @__PURE__ */ new WeakMap(), A = S(() => {
|
|
567
517
|
let e = f.value;
|
|
568
518
|
if (!e) return [];
|
|
569
|
-
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((d.value / c.value -
|
|
570
|
-
a || (a = /* @__PURE__ */ new Map(),
|
|
519
|
+
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((d.value / c.value - it) / rt), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size, y.value.row), a = k.get(e);
|
|
520
|
+
a || (a = /* @__PURE__ */ new Map(), k.set(e, a));
|
|
571
521
|
let o = a;
|
|
572
522
|
return Array.from({ length: i }, (e, t) => t + 1).filter((e) => !t.has(e)).map((e) => {
|
|
573
523
|
let t = o.get(e);
|
|
574
524
|
return t || (t = {
|
|
575
525
|
row: e,
|
|
576
|
-
height: n.get(e) ??
|
|
526
|
+
height: n.get(e) ?? rt
|
|
577
527
|
}, o.set(e, t)), t;
|
|
578
528
|
});
|
|
579
|
-
}),
|
|
529
|
+
}), M = S(() => {
|
|
580
530
|
let e = f.value?.charts ?? [];
|
|
581
531
|
if (!e.length) return [];
|
|
582
532
|
let t = c.value;
|
|
583
533
|
return e.map((e, n) => {
|
|
584
|
-
let r =
|
|
534
|
+
let r = b.value.reduce((t, n) => n.col < e.col ? t + n.width : t, at + e.x), i = A.value.reduce((t, n) => n.row < e.row ? t + n.height : t, it + e.y);
|
|
585
535
|
return {
|
|
586
536
|
key: `${f.value?.name}:${n}`,
|
|
587
537
|
chart: e,
|
|
@@ -593,24 +543,24 @@ var K = {
|
|
|
593
543
|
}
|
|
594
544
|
};
|
|
595
545
|
});
|
|
596
|
-
}), ie =
|
|
546
|
+
}), ie = S(() => {
|
|
597
547
|
let e = /* @__PURE__ */ new Map();
|
|
598
548
|
for (let t of f.value?.rows ?? []) for (let n of t.cells) e.set(`${t.row},${n.col}`, n);
|
|
599
549
|
return e;
|
|
600
|
-
}),
|
|
550
|
+
}), ae = S(() => {
|
|
601
551
|
let e = /* @__PURE__ */ new Map();
|
|
602
552
|
for (let t of f.value?.rows ?? []) for (let n of t.cells) if (n.span) for (let r = 0; r < n.span.rows; r++) for (let i = 0; i < n.span.cols; i++) (r || i) && e.set(`${t.row + r},${n.col + i}`, {
|
|
603
553
|
row: t.row,
|
|
604
554
|
col: n.col
|
|
605
555
|
});
|
|
606
556
|
return e;
|
|
607
|
-
}),
|
|
608
|
-
let n =
|
|
557
|
+
}), V = (e, t) => ie.value.get(`${e},${t}`), se = (e, t) => {
|
|
558
|
+
let n = V(e, t)?.span;
|
|
609
559
|
if (n) return {
|
|
610
|
-
rows:
|
|
611
|
-
cols:
|
|
560
|
+
rows: A.value.filter((t) => t.row >= e && t.row < e + n.rows).length,
|
|
561
|
+
cols: b.value.filter((e) => e.col >= t && e.col < t + n.cols).length
|
|
612
562
|
};
|
|
613
|
-
},
|
|
563
|
+
}, U = (e) => e?.style === void 0 ? void 0 : r.preview.styles[e.style], ce = (e) => Pe(e, r.preview, o.value), de = (e) => {
|
|
614
564
|
let t = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
|
|
615
565
|
return Number.isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(o.value, {
|
|
616
566
|
dateStyle: "short",
|
|
@@ -620,8 +570,8 @@ var K = {
|
|
|
620
570
|
if (!e) return "";
|
|
621
571
|
if (e.missing) return "—";
|
|
622
572
|
let t = e.value;
|
|
623
|
-
return t === void 0 ? "" : typeof t == "boolean" ? a(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ?
|
|
624
|
-
},
|
|
573
|
+
return t === void 0 ? "" : typeof t == "boolean" ? a(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? ce(e)?.text ?? de(t) : typeof t == "number" ? Fe(e, t, r.preview, o.value) : t;
|
|
574
|
+
}, pe = (e) => {
|
|
625
575
|
if (!e) return "";
|
|
626
576
|
if (e.formula) return `=${e.formula}`;
|
|
627
577
|
let t = e.value;
|
|
@@ -630,8 +580,8 @@ var K = {
|
|
|
630
580
|
maximumFractionDigits: 15,
|
|
631
581
|
...e.format === "percent" ? { style: "percent" } : {}
|
|
632
582
|
}).format(t) : fe(e);
|
|
633
|
-
},
|
|
634
|
-
let r =
|
|
583
|
+
}, G = (e) => e ? `${e.width}px solid ${e.color}` : void 0, me = (e, t, n) => {
|
|
584
|
+
let r = U(e), i = e?.value, a = typeof i == "number" || e?.format === "date" || !!e?.missing, o = {
|
|
635
585
|
textAlign: r?.align ?? (a ? "right" : typeof i == "boolean" || e?.format === "error" ? "center" : "left"),
|
|
636
586
|
verticalAlign: r?.valign === "top" ? "top" : r?.valign === "middle" ? "middle" : "bottom",
|
|
637
587
|
whiteSpace: r?.wrap ? "pre-wrap" : "nowrap"
|
|
@@ -639,13 +589,13 @@ var K = {
|
|
|
639
589
|
r?.bold && (o.fontWeight = 700), r?.italic && (o.fontStyle = "italic");
|
|
640
590
|
let s = [r?.underline ? "underline" : "", r?.strike ? "line-through" : ""].filter(Boolean).join(" ");
|
|
641
591
|
s && (o.textDecoration = s), r?.size && (o.fontSize = `${r.size}pt`);
|
|
642
|
-
let c = e ?
|
|
592
|
+
let c = e ? ce(e)?.color : void 0;
|
|
643
593
|
if ((c ?? r?.color) && (o.color = c ?? r?.color), r?.fill && (o.backgroundColor = r.fill), r?.indent) {
|
|
644
594
|
let e = `${4 + r.indent * 9}px`;
|
|
645
595
|
o.textAlign === "right" ? o.paddingRight = e : o.paddingLeft = e;
|
|
646
596
|
}
|
|
647
597
|
let l = je(t, n);
|
|
648
|
-
return he(t, n) ? (o.borderStyle = "hidden", o.boxShadow = [...l, Ce(e, t, n)].filter(Boolean).join(", ")) : (o.borderTop =
|
|
598
|
+
return he(t, n) ? (o.borderStyle = "hidden", o.boxShadow = [...l, Ce(e, t, n)].filter(Boolean).join(", ")) : (o.borderTop = G(r?.borders?.top), o.borderRight = G(r?.borders?.right), o.borderBottom = G(r?.borders?.bottom), o.borderLeft = G(r?.borders?.left), o.boxShadow = [...l, ..._e(e, t, n)].join(", ")), Object.assign(o, Oe(t, n)), o;
|
|
649
599
|
}, he = (e, t) => {
|
|
650
600
|
let n = f.value?.frozen;
|
|
651
601
|
return !!n && (e <= n.rows || t <= n.cols);
|
|
@@ -654,10 +604,10 @@ var K = {
|
|
|
654
604
|
right: (e) => `inset -${e.width}px 0 0 ${e.color}`,
|
|
655
605
|
bottom: (e) => `inset 0 -${e.width}px 0 ${e.color}`,
|
|
656
606
|
left: (e) => `inset ${e.width}px 0 0 ${e.color}`
|
|
657
|
-
},
|
|
658
|
-
let r =
|
|
659
|
-
return [t ===
|
|
660
|
-
},
|
|
607
|
+
}, ge = (...e) => e.reduce((e, t) => t && (!e || t.width > e.width) ? t : e, void 0), _e = (e, t, n) => {
|
|
608
|
+
let r = U(e)?.borders;
|
|
609
|
+
return [t === A.value[0]?.row && r?.top && K.top(r.top), n === b.value[0]?.col && r?.left && K.left(r.left)].filter((e) => !!e);
|
|
610
|
+
}, q = S(() => A.value.map((e) => e.row)), ve = S(() => b.value.map((e) => e.col)), ye = S(() => new Map(q.value.map((e, t) => [e, t]))), be = S(() => new Map(ve.value.map((e, t) => [e, t]))), xe = (e, t, n, r) => {
|
|
661
611
|
let i = [], a = t.get(n) ?? e.length;
|
|
662
612
|
for (; a < e.length && e[a] < n + r; a++) i.push(e[a]);
|
|
663
613
|
return {
|
|
@@ -665,7 +615,7 @@ var K = {
|
|
|
665
615
|
next: e[a]
|
|
666
616
|
};
|
|
667
617
|
}, Se = (e, t, n, r) => {
|
|
668
|
-
let { spanned: i, next: a } = xe(
|
|
618
|
+
let { spanned: i, next: a } = xe(q.value, ye.value, t, e?.span?.rows ?? 1), { spanned: o, next: s } = xe(ve.value, be.value, n, e?.span?.cols ?? 1);
|
|
669
619
|
return (r === "right" ? s === void 0 ? [] : i.map((e) => ({
|
|
670
620
|
row: e,
|
|
671
621
|
col: s
|
|
@@ -673,23 +623,23 @@ var K = {
|
|
|
673
623
|
row: a,
|
|
674
624
|
col: e
|
|
675
625
|
}))).map((e) => {
|
|
676
|
-
let t =
|
|
677
|
-
return
|
|
626
|
+
let t = ae.value.get(`${e.row},${e.col}`) ?? e;
|
|
627
|
+
return V(t.row, t.col);
|
|
678
628
|
});
|
|
679
629
|
}, Ce = (e, t, n) => {
|
|
680
|
-
let r =
|
|
630
|
+
let r = U(e)?.borders, i = ge(r?.right, ...Se(e, t, n, "right").map((e) => U(e)?.borders?.left)), a = ge(r?.bottom, ...Se(e, t, n, "bottom").map((e) => U(e)?.borders?.top)), o = f.value?.gridlines;
|
|
681
631
|
return [
|
|
682
632
|
i ? K.right(i) : o && "inset calc(var(--border) * -1) 0 0 var(--pk-spreadsheet-gridline)",
|
|
683
633
|
a ? K.bottom(a) : o && "inset 0 calc(var(--border) * -1) 0 var(--pk-spreadsheet-gridline)",
|
|
684
|
-
...
|
|
634
|
+
..._e(e, t, n)
|
|
685
635
|
].filter(Boolean).join(", ");
|
|
686
|
-
}, we = (e) =>
|
|
636
|
+
}, we = (e) => it + A.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0), Te = (e) => at + b.value.filter((t) => t.col < e).reduce((e, t) => e + t.width, 0), De = S(() => {
|
|
687
637
|
let e = f.value?.frozen;
|
|
688
638
|
return {
|
|
689
639
|
top: we((e?.rows ?? 0) + 1),
|
|
690
640
|
left: Te((e?.cols ?? 0) + 1)
|
|
691
641
|
};
|
|
692
|
-
}),
|
|
642
|
+
}), Oe = (e, t) => {
|
|
693
643
|
let n = f.value?.frozen;
|
|
694
644
|
if (!n) return {};
|
|
695
645
|
let r = {};
|
|
@@ -710,7 +660,7 @@ var K = {
|
|
|
710
660
|
col: 1
|
|
711
661
|
};
|
|
712
662
|
});
|
|
713
|
-
let X =
|
|
663
|
+
let X = S(() => ({
|
|
714
664
|
r1: Math.min(J.value.row, Y.value.row),
|
|
715
665
|
r2: Math.max(J.value.row, Y.value.row),
|
|
716
666
|
c1: Math.min(J.value.col, Y.value.col),
|
|
@@ -718,14 +668,14 @@ var K = {
|
|
|
718
668
|
})), Z = (e, t) => e >= X.value.r1 && e <= X.value.r2 && t >= X.value.c1 && t <= X.value.c2, ke = (e, t) => Y.value.row === e && Y.value.col === t, Ae = (e) => e >= X.value.r1 && e <= X.value.r2 ? `${X.value.c1}:${X.value.c2}:${Y.value.row === e ? Y.value.col : 0}:${e === X.value.r1 ? "t" : ""}${e === X.value.r2 ? "b" : ""}` : "", je = (e, t) => {
|
|
719
669
|
let { r1: n, r2: r, c1: i, c2: a } = X.value;
|
|
720
670
|
if (n === r && i === a || !Z(e, t)) return [];
|
|
721
|
-
let o =
|
|
671
|
+
let o = V(e, t)?.span, s = e + (o?.rows ?? 1) - 1, c = t + (o?.cols ?? 1) - 1, l = "var(--spacing-2)", u = "var(--pk-spreadsheet-green)";
|
|
722
672
|
return [
|
|
723
673
|
e === n && `inset 0 ${l} 0 ${u}`,
|
|
724
674
|
s >= r && `inset 0 calc(${l} * -1) 0 ${u}`,
|
|
725
675
|
t === i && `inset ${l} 0 0 ${u}`,
|
|
726
676
|
c >= a && `inset calc(${l} * -1) 0 0 ${u}`
|
|
727
677
|
].filter((e) => !!e);
|
|
728
|
-
}, Q = I(!1),
|
|
678
|
+
}, Q = I(!1), Ne = (e, t, n) => {
|
|
729
679
|
l.value?.focus({ preventScroll: !0 }), Y.value = {
|
|
730
680
|
row: e,
|
|
731
681
|
col: t
|
|
@@ -733,12 +683,12 @@ var K = {
|
|
|
733
683
|
row: e,
|
|
734
684
|
col: t
|
|
735
685
|
}), Q.value = !0;
|
|
736
|
-
},
|
|
686
|
+
}, ct = (e, t) => {
|
|
737
687
|
Q.value && (Y.value = {
|
|
738
688
|
row: e,
|
|
739
689
|
col: t
|
|
740
690
|
});
|
|
741
|
-
},
|
|
691
|
+
}, lt, ut = () => {
|
|
742
692
|
let e = [...l.value?.querySelectorAll(".pk-spreadsheet-preview__cell--range, [data-focus]") ?? []].map((e) => e.getBoundingClientRect());
|
|
743
693
|
if (e.length) return {
|
|
744
694
|
start: {
|
|
@@ -747,18 +697,18 @@ var K = {
|
|
|
747
697
|
},
|
|
748
698
|
bottom: Math.max(...e.map((e) => e.bottom))
|
|
749
699
|
};
|
|
750
|
-
},
|
|
751
|
-
...
|
|
752
|
-
measure:
|
|
700
|
+
}, dt = () => f.value ? {
|
|
701
|
+
...Ee(f.value, X.value),
|
|
702
|
+
measure: ut
|
|
753
703
|
} : void 0;
|
|
754
704
|
H([X, Q], () => {
|
|
755
|
-
clearTimeout(
|
|
705
|
+
clearTimeout(lt), Q.value || (lt = setTimeout(() => {
|
|
756
706
|
let e = X.value, t = e.r2 > e.r1 || e.c2 > e.c1;
|
|
757
|
-
i("select", t ?
|
|
707
|
+
i("select", t ? dt() : void 0);
|
|
758
708
|
}, 150));
|
|
759
709
|
});
|
|
760
|
-
let
|
|
761
|
-
clearTimeout(
|
|
710
|
+
let ft = () => {
|
|
711
|
+
clearTimeout(lt), i("select", dt());
|
|
762
712
|
}, $, pt;
|
|
763
713
|
H(f, () => {
|
|
764
714
|
pt = void 0;
|
|
@@ -772,10 +722,10 @@ var K = {
|
|
|
772
722
|
}, ht = () => {
|
|
773
723
|
clearTimeout($?.timer), $?.active && (Q.value = !1), $ = void 0;
|
|
774
724
|
};
|
|
775
|
-
|
|
776
|
-
ht(), clearTimeout(
|
|
725
|
+
ne(() => {
|
|
726
|
+
ht(), clearTimeout(lt);
|
|
777
727
|
});
|
|
778
|
-
let gt = () => void
|
|
728
|
+
let gt = () => void te(ft), _t = (e) => {
|
|
779
729
|
ht();
|
|
780
730
|
let t = e.touches[0], n = e.touches.length === 1 ? mt(e.target) : void 0;
|
|
781
731
|
t && n && ($ = {
|
|
@@ -791,13 +741,13 @@ var K = {
|
|
|
791
741
|
row: $.row,
|
|
792
742
|
col: $.col
|
|
793
743
|
}, Q.value = !0);
|
|
794
|
-
},
|
|
744
|
+
}, ot)
|
|
795
745
|
});
|
|
796
746
|
}, vt = (e) => {
|
|
797
747
|
let t = e.touches[0];
|
|
798
748
|
if (!$ || !t) return;
|
|
799
749
|
if (!$.active) {
|
|
800
|
-
(!e.cancelable || Math.hypot(t.clientX - $.x, t.clientY - $.y) >
|
|
750
|
+
(!e.cancelable || Math.hypot(t.clientX - $.x, t.clientY - $.y) > st) && ht();
|
|
801
751
|
return;
|
|
802
752
|
}
|
|
803
753
|
e.preventDefault();
|
|
@@ -831,7 +781,7 @@ var K = {
|
|
|
831
781
|
}[e.key];
|
|
832
782
|
if (!t) return;
|
|
833
783
|
e.preventDefault();
|
|
834
|
-
let n =
|
|
784
|
+
let n = A.value.map((e) => e.row), r = b.value.map((e) => e.col), i = (e) => ae.value.get(`${e.row},${e.col}`) ?? e, a = i(Y.value), o = n.indexOf(Y.value.row), s = r.indexOf(Y.value.col), c = a;
|
|
835
785
|
for (;;) {
|
|
836
786
|
let e = Math.min(n.length - 1, Math.max(0, o + t[0])), l = Math.min(r.length - 1, Math.max(0, s + t[1]));
|
|
837
787
|
if (e === o && l === s || (o = e, s = l, c = i({
|
|
@@ -839,37 +789,37 @@ var K = {
|
|
|
839
789
|
col: r[s]
|
|
840
790
|
}), c.row !== a.row || c.col !== a.col)) break;
|
|
841
791
|
}
|
|
842
|
-
Y.value = c, e.shiftKey || (J.value = c),
|
|
792
|
+
Y.value = c, e.shiftKey || (J.value = c), te(() => l.value?.querySelector("[data-focus]")?.scrollIntoView({
|
|
843
793
|
block: "nearest",
|
|
844
794
|
inline: "nearest"
|
|
845
795
|
}));
|
|
846
|
-
}, xt =
|
|
796
|
+
}, xt = S(() => V(Y.value.row, Y.value.col)), St = S(() => {
|
|
847
797
|
let { r1: e, r2: t, c1: n, c2: i } = X.value;
|
|
848
798
|
if (e === t && n === i) return;
|
|
849
799
|
let a = [];
|
|
850
|
-
for (let r = e; r <= t; r++) for (let e = n; e <= i; e++) a.push(
|
|
851
|
-
return
|
|
800
|
+
for (let r = e; r <= t; r++) for (let e = n; e <= i; e++) a.push(V(r, e));
|
|
801
|
+
return Ie(a, r.preview, o.value);
|
|
852
802
|
}), Ct = (e) => {
|
|
853
803
|
c.value = Math.min(2, Math.max(.5, Math.round((c.value + e) * 10) / 10));
|
|
854
804
|
};
|
|
855
805
|
return (n, r) => {
|
|
856
806
|
let i = t;
|
|
857
|
-
return F(),
|
|
858
|
-
|
|
859
|
-
|
|
807
|
+
return F(), T("div", Le, [
|
|
808
|
+
E("div", Re, [
|
|
809
|
+
E("span", {
|
|
860
810
|
class: "pk-spreadsheet-preview__ref",
|
|
861
811
|
"aria-label": z(a)("chatFilePreview.cell")
|
|
862
|
-
}, R(v(Y.value.col)) + R(Y.value.row), 9,
|
|
863
|
-
r[6] ||=
|
|
812
|
+
}, R(v(Y.value.col)) + R(Y.value.row), 9, ze),
|
|
813
|
+
r[6] ||= E("span", {
|
|
864
814
|
class: "pk-spreadsheet-preview__fx",
|
|
865
815
|
"aria-hidden": "true"
|
|
866
816
|
}, "fx", -1),
|
|
867
|
-
|
|
817
|
+
E("output", {
|
|
868
818
|
class: "pk-spreadsheet-preview__formula",
|
|
869
819
|
"aria-label": z(a)("chatFilePreview.formulaBar")
|
|
870
|
-
}, R(
|
|
820
|
+
}, R(pe(xt.value)), 9, Be)
|
|
871
821
|
]),
|
|
872
|
-
|
|
822
|
+
E("div", {
|
|
873
823
|
ref_key: "scrollEl",
|
|
874
824
|
ref: l,
|
|
875
825
|
class: "pk-spreadsheet-preview__scroll",
|
|
@@ -884,109 +834,109 @@ var K = {
|
|
|
884
834
|
onTouchend: yt,
|
|
885
835
|
onTouchcancel: ht
|
|
886
836
|
}, [
|
|
887
|
-
f.value ? (F(),
|
|
837
|
+
f.value ? (F(), T("table", {
|
|
888
838
|
key: 0,
|
|
889
|
-
class:
|
|
890
|
-
style:
|
|
839
|
+
class: N(["pk-spreadsheet-preview__grid", { "pk-spreadsheet-preview__grid--lines": f.value.gridlines }]),
|
|
840
|
+
style: P({
|
|
891
841
|
zoom: c.value,
|
|
892
|
-
width: `${
|
|
893
|
-
"--pk-spreadsheet-stuck-top": `${
|
|
894
|
-
"--pk-spreadsheet-stuck-left": `${
|
|
842
|
+
width: `${C.value}px`,
|
|
843
|
+
"--pk-spreadsheet-stuck-top": `${De.value.top}px`,
|
|
844
|
+
"--pk-spreadsheet-stuck-left": `${De.value.left}px`
|
|
895
845
|
})
|
|
896
846
|
}, [
|
|
897
|
-
|
|
847
|
+
E("colgroup", null, [E("col", { style: P({ width: `${at}px` }) }, null, 4), (F(!0), T(x, null, L(b.value, (e) => (F(), T("col", {
|
|
898
848
|
key: e.col,
|
|
899
|
-
style:
|
|
849
|
+
style: P({ width: `${e.width}px` })
|
|
900
850
|
}, null, 4))), 128))]),
|
|
901
|
-
|
|
851
|
+
E("thead", null, [E("tr", { style: P({ height: `${it}px` }) }, [r[7] ||= E("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (F(!0), T(x, null, L(b.value, (e) => (F(), T("th", {
|
|
902
852
|
key: e.col,
|
|
903
853
|
scope: "col",
|
|
904
|
-
class:
|
|
905
|
-
style:
|
|
854
|
+
class: N(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >= X.value.c1 && e.col <= X.value.c2 }]),
|
|
855
|
+
style: P(f.value.frozen && e.col <= f.value.frozen.cols ? {
|
|
906
856
|
left: `${Te(e.col)}px`,
|
|
907
857
|
zIndex: 2
|
|
908
858
|
} : void 0)
|
|
909
859
|
}, R(v(e.col)), 7))), 128))], 4)]),
|
|
910
|
-
|
|
860
|
+
E("tbody", null, [(F(!0), T(x, null, L(A.value, (e, t, n, r) => {
|
|
911
861
|
let i = [
|
|
912
862
|
e,
|
|
913
863
|
f.value,
|
|
914
|
-
|
|
864
|
+
ee.value,
|
|
915
865
|
z(o),
|
|
916
866
|
Ae(e.row),
|
|
917
|
-
|
|
867
|
+
m.value.get(e.row)
|
|
918
868
|
];
|
|
919
|
-
if (r && r.el && r.key === e.row &&
|
|
920
|
-
let s = (F(),
|
|
869
|
+
if (r && r.el && r.key === e.row && j(r, i)) return r;
|
|
870
|
+
let s = (F(), T("tr", {
|
|
921
871
|
key: e.row,
|
|
922
|
-
style:
|
|
923
|
-
}, [
|
|
872
|
+
style: P({ height: `${e.height}px` })
|
|
873
|
+
}, [E("th", {
|
|
924
874
|
scope: "row",
|
|
925
|
-
class:
|
|
926
|
-
style:
|
|
927
|
-
...
|
|
875
|
+
class: N(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >= X.value.r1 && e.row <= X.value.r2 }]),
|
|
876
|
+
style: P(f.value.frozen && e.row <= f.value.frozen.rows ? {
|
|
877
|
+
...Oe(e.row, 0),
|
|
928
878
|
left: 0,
|
|
929
879
|
zIndex: 4
|
|
930
880
|
} : void 0)
|
|
931
|
-
}, R(e.row), 7), (F(!0),
|
|
881
|
+
}, R(e.row), 7), (F(!0), T(x, null, L(b.value, (t) => (F(), T(x, { key: t.col }, [ae.value.has(`${e.row},${t.col}`) ? w("", !0) : (F(), T("td", {
|
|
932
882
|
key: 0,
|
|
933
|
-
rowspan:
|
|
934
|
-
colspan:
|
|
935
|
-
class:
|
|
883
|
+
rowspan: se(e.row, t.col)?.rows,
|
|
884
|
+
colspan: se(e.row, t.col)?.cols,
|
|
885
|
+
class: N(["pk-spreadsheet-preview__cell", {
|
|
936
886
|
"pk-spreadsheet-preview__cell--range": Z(e.row, t.col) && !ke(e.row, t.col),
|
|
937
|
-
"pk-spreadsheet-preview__cell--missing":
|
|
938
|
-
"pk-spreadsheet-preview__cell--marked":
|
|
887
|
+
"pk-spreadsheet-preview__cell--missing": V(e.row, t.col)?.missing,
|
|
888
|
+
"pk-spreadsheet-preview__cell--marked": h(e.row, t.col)
|
|
939
889
|
}]),
|
|
940
|
-
style:
|
|
890
|
+
style: P(me(V(e.row, t.col), e.row, t.col)),
|
|
941
891
|
"data-focus": ke(e.row, t.col) ? "" : void 0,
|
|
942
892
|
"data-cell": `${e.row}:${t.col}`,
|
|
943
|
-
title:
|
|
944
|
-
onMousedown:
|
|
945
|
-
onMouseenter: (n) =>
|
|
946
|
-
onDblclick:
|
|
947
|
-
}, R(fe(
|
|
893
|
+
title: V(e.row, t.col)?.missing ? z(a)("chatFilePreview.missingValue") : void 0,
|
|
894
|
+
onMousedown: W((n) => Ne(e.row, t.col, n), ["prevent"]),
|
|
895
|
+
onMouseenter: (n) => ct(e.row, t.col),
|
|
896
|
+
onDblclick: ft
|
|
897
|
+
}, R(fe(V(e.row, t.col))), 47, He))], 64))), 128))], 4));
|
|
948
898
|
return s.memo = i, s;
|
|
949
899
|
}, r, 0), 128))])
|
|
950
|
-
], 6)) :
|
|
951
|
-
|
|
900
|
+
], 6)) : w("", !0),
|
|
901
|
+
M.value.length ? (F(), T("div", Ue, [(F(!0), T(x, null, L(M.value, (e) => (F(), T("div", {
|
|
952
902
|
key: e.key,
|
|
953
903
|
class: "pk-spreadsheet-preview__chart",
|
|
954
|
-
style:
|
|
955
|
-
}, [
|
|
956
|
-
f.value && (f.value.moreRows || f.value.moreColumns) ? (F(),
|
|
957
|
-
], 40,
|
|
958
|
-
|
|
904
|
+
style: P(e.css)
|
|
905
|
+
}, [O(Me, { preview: e.chart }, null, 8, ["preview"])], 4))), 128))])) : w("", !0),
|
|
906
|
+
f.value && (f.value.moreRows || f.value.moreColumns) ? (F(), T("p", We, [f.value.moreRows ? (F(), T(x, { key: 0 }, [D(R(z(a)("chatFilePreview.moreRows", f.value.moreRows)), 1)], 64)) : w("", !0), f.value.moreColumns ? (F(), T(x, { key: 1 }, [D(R(z(a)("chatFilePreview.moreColumns", f.value.moreColumns)), 1)], 64)) : w("", !0)])) : w("", !0)
|
|
907
|
+
], 40, Ve),
|
|
908
|
+
E("nav", {
|
|
959
909
|
class: "pk-spreadsheet-preview__sheets",
|
|
960
910
|
"aria-label": z(a)("chatFilePreview.sheets")
|
|
961
|
-
}, [(F(!0),
|
|
911
|
+
}, [(F(!0), T(x, null, L(e.preview.sheets, (e, t) => (F(), T("button", {
|
|
962
912
|
key: e.name,
|
|
963
913
|
type: "button",
|
|
964
914
|
class: "pk-spreadsheet-preview__sheet",
|
|
965
915
|
"aria-current": t === s.value ? "page" : void 0,
|
|
966
916
|
onClick: (e) => s.value = t
|
|
967
|
-
}, R(e.name), 9,
|
|
968
|
-
|
|
917
|
+
}, R(e.name), 9, Ke))), 128))], 8, Ge),
|
|
918
|
+
E("div", qe, [E("p", Je, [e.preview.staleFormulas ? (F(), T("span", {
|
|
969
919
|
key: 0,
|
|
970
920
|
class: "pk-spreadsheet-preview__note",
|
|
971
921
|
title: z(a)("chatFilePreview.staleFormulas")
|
|
972
|
-
}, R(z(a)("chatFilePreview.staleFormulas")), 9,
|
|
922
|
+
}, R(z(a)("chatFilePreview.staleFormulas")), 9, Ye)) : e.preview.computedFormulas ? (F(), T("span", {
|
|
973
923
|
key: 1,
|
|
974
924
|
class: "pk-spreadsheet-preview__note",
|
|
975
925
|
title: z(a)("chatFilePreview.computedFormulas")
|
|
976
|
-
}, R(z(a)("chatFilePreview.computedFormulas")), 9,
|
|
977
|
-
St.value.average ? (F(),
|
|
978
|
-
|
|
979
|
-
St.value.sum ? (F(),
|
|
980
|
-
])) :
|
|
981
|
-
|
|
926
|
+
}, R(z(a)("chatFilePreview.computedFormulas")), 9, Xe)) : w("", !0), St.value ? (F(), T("span", Ze, [
|
|
927
|
+
St.value.average ? (F(), T("span", Qe, R(z(a)("chatFilePreview.average")) + " " + R(St.value.average), 1)) : w("", !0),
|
|
928
|
+
E("span", null, R(z(a)("chatFilePreview.count")) + " " + R(St.value.count), 1),
|
|
929
|
+
St.value.sum ? (F(), T("span", $e, R(z(a)("chatFilePreview.sum")) + " " + R(St.value.sum), 1)) : w("", !0)
|
|
930
|
+
])) : w("", !0)]), E("div", et, [
|
|
931
|
+
O(i, {
|
|
982
932
|
modifiers: "action-quiet",
|
|
983
933
|
icon: "ri:subtract-line",
|
|
984
934
|
"aria-label": z(a)("chatFilePreview.zoomOut"),
|
|
985
935
|
disabled: c.value <= .5,
|
|
986
936
|
onClick: r[4] ||= (e) => Ct(-.1)
|
|
987
937
|
}, null, 8, ["aria-label", "disabled"]),
|
|
988
|
-
|
|
989
|
-
|
|
938
|
+
E("span", tt, R(Math.round(c.value * 100)) + "% ", 1),
|
|
939
|
+
O(i, {
|
|
990
940
|
modifiers: "action-quiet",
|
|
991
941
|
icon: "ri:add-line",
|
|
992
942
|
"aria-label": z(a)("chatFilePreview.zoomIn"),
|
|
@@ -997,11 +947,11 @@ var K = {
|
|
|
997
947
|
]);
|
|
998
948
|
};
|
|
999
949
|
}
|
|
1000
|
-
}),
|
|
950
|
+
}), lt = ["src"], ut = {
|
|
1001
951
|
key: 2,
|
|
1002
952
|
class: "pk-word-preview__image",
|
|
1003
953
|
"data-quote-skip": ""
|
|
1004
|
-
},
|
|
954
|
+
}, dt = ["title"], ft = ["title"], $ = ["data-quote-skip"], pt = /* @__PURE__ */ k({
|
|
1005
955
|
__name: "PkWordPreviewRuns",
|
|
1006
956
|
props: {
|
|
1007
957
|
runs: {},
|
|
@@ -1010,16 +960,16 @@ var K = {
|
|
|
1010
960
|
numbers: {}
|
|
1011
961
|
},
|
|
1012
962
|
setup(e) {
|
|
1013
|
-
let t = e, { t: n } =
|
|
963
|
+
let t = e, { t: n } = le({ useScope: "global" }), r = A(h, void 0), i = A(p, void 0), o = (e) => e.picture ? f(r?.value, e.picture.ref) : void 0, c = (e) => e.chart ? i?.value?.[e.chart.ref] : void 0, l = (e) => t.page ? u(e) : "inline", d = (e) => l(e) === "page" ? {
|
|
1014
964
|
...e,
|
|
1015
965
|
anchor: void 0
|
|
1016
|
-
} : e,
|
|
966
|
+
} : e, m = (e) => {
|
|
1017
967
|
let n = {
|
|
1018
968
|
width: `${e.width}pt`,
|
|
1019
969
|
aspectRatio: `${e.width} / ${e.height}`
|
|
1020
970
|
}, r = e.anchor, i = t.page;
|
|
1021
971
|
if (!r || !i) return n;
|
|
1022
|
-
let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o =
|
|
972
|
+
let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o = u(e);
|
|
1023
973
|
if (o === "around") {
|
|
1024
974
|
let t = i.width - i.margins.left - i.margins.right, o = a + e.width / 2 < t / 2;
|
|
1025
975
|
return {
|
|
@@ -1040,56 +990,56 @@ var K = {
|
|
|
1040
990
|
top: `${r.y}pt`,
|
|
1041
991
|
zIndex: r.wrap === "behind" ? -1 : 1
|
|
1042
992
|
};
|
|
1043
|
-
}, g = (e) => e.field && t.numbers ? String(t.numbers[e.field]) : e.text, _ =
|
|
1044
|
-
let e =
|
|
1045
|
-
let n = e.picture ?? (e.chart &&
|
|
1046
|
-
return !!n && !!t.page && ["around", "block"].includes(
|
|
993
|
+
}, g = (e) => e.field && t.numbers ? String(t.numbers[e.field]) : e.text, _ = S(() => {
|
|
994
|
+
let e = s(t.runs, t.mode ?? "markup"), n = (e) => {
|
|
995
|
+
let n = e.picture ?? (e.chart && d(e.chart));
|
|
996
|
+
return !!n && !!t.page && ["around", "block"].includes(u(n));
|
|
1047
997
|
};
|
|
1048
998
|
return [...e.filter(n), ...e.filter((e) => !n(e))];
|
|
1049
|
-
}), v =
|
|
999
|
+
}), v = S(() => !t.mode || t.mode === "markup"), y = (e) => {
|
|
1050
1000
|
let t = {};
|
|
1051
|
-
e.font && (t.fontFamily =
|
|
1001
|
+
e.font && (t.fontFamily = a(e.font)), t.fontSize = e.size ? `${e.size}pt` : "var(--pk-word-size)", e.color && (t.color = e.color), e.highlight && (t.backgroundColor = e.highlight), e.bold && (t.fontWeight = 700), e.italic && (t.fontStyle = "italic");
|
|
1052
1002
|
let n = [e.underline ? "underline" : "", e.strike ? "line-through" : ""].filter(Boolean).join(" ");
|
|
1053
1003
|
return n && (t.textDecoration = n), e.caps && (t.textTransform = "uppercase"), e.vertAlign && (t.verticalAlign = e.vertAlign, t.fontSize = `${(e.size ?? 11) * .65}pt`), t;
|
|
1054
|
-
},
|
|
1055
|
-
let t =
|
|
1004
|
+
}, b = (e) => {
|
|
1005
|
+
let t = y(e), n = new Set(String(t.textDecoration ?? "").split(" ").filter(Boolean));
|
|
1056
1006
|
return n.add(e.change === "deleted" ? "line-through" : "underline"), {
|
|
1057
1007
|
...t,
|
|
1058
1008
|
textDecoration: [...n].join(" ")
|
|
1059
1009
|
};
|
|
1060
|
-
},
|
|
1061
|
-
return (e, t) => (F(!0),
|
|
1010
|
+
}, C = (e) => e.author ? n("chatFilePreview.revisionBy", { author: e.author }) : void 0;
|
|
1011
|
+
return (e, t) => (F(!0), T(x, null, L(_.value, (e, t) => (F(), T(x, { key: t }, [e.image ? (F(), T(x, { key: 0 }, [e.chart && c(e) ? (F(), T("span", {
|
|
1062
1012
|
key: 0,
|
|
1063
|
-
class:
|
|
1064
|
-
style:
|
|
1065
|
-
}, [
|
|
1013
|
+
class: N(["pk-word-preview__chart", `pk-word-preview__chart--${l(d(e.chart))}`]),
|
|
1014
|
+
style: P(m(d(e.chart)))
|
|
1015
|
+
}, [O(Me, { preview: c(e) }, null, 8, ["preview"])], 6)) : e.picture && o(e) ? (F(), T(x, { key: 1 }, [l(e.picture) === "page" ? w("", !0) : (F(), T("img", {
|
|
1066
1016
|
key: 0,
|
|
1067
|
-
class:
|
|
1068
|
-
style:
|
|
1069
|
-
src:
|
|
1017
|
+
class: N(["pk-word-preview__picture", `pk-word-preview__picture--${l(e.picture)}`]),
|
|
1018
|
+
style: P(m(e.picture)),
|
|
1019
|
+
src: o(e),
|
|
1070
1020
|
alt: ""
|
|
1071
|
-
}, null, 14,
|
|
1021
|
+
}, null, 14, lt))], 64)) : (F(), T("span", ut, R(z(n)("chatFilePreview.image")), 1))], 64)) : v.value && e.change === "deleted" ? (F(), T("del", {
|
|
1072
1022
|
key: 1,
|
|
1073
1023
|
class: "pk-word-preview__removed",
|
|
1074
1024
|
"data-quote-skip": "",
|
|
1075
|
-
style:
|
|
1076
|
-
title:
|
|
1077
|
-
}, R(g(e)), 13,
|
|
1025
|
+
style: P(b(e)),
|
|
1026
|
+
title: C(e)
|
|
1027
|
+
}, R(g(e)), 13, dt)) : v.value && e.change === "inserted" ? (F(), T("ins", {
|
|
1078
1028
|
key: 2,
|
|
1079
1029
|
class: "pk-word-preview__added",
|
|
1080
|
-
style:
|
|
1081
|
-
title:
|
|
1082
|
-
}, R(g(e)), 13,
|
|
1030
|
+
style: P(b(e)),
|
|
1031
|
+
title: C(e)
|
|
1032
|
+
}, R(g(e)), 13, ft)) : (F(), T("span", {
|
|
1083
1033
|
key: 3,
|
|
1084
|
-
style:
|
|
1034
|
+
style: P(y(e)),
|
|
1085
1035
|
"data-quote-skip": e.label ? "" : void 0
|
|
1086
|
-
}, R(g(e)), 13,
|
|
1036
|
+
}, R(g(e)), 13, $))], 64))), 128));
|
|
1087
1037
|
}
|
|
1088
|
-
}),
|
|
1038
|
+
}), mt = { key: 0 }, ht = ["data-paragraph", "colspan"], gt = [
|
|
1089
1039
|
"data-paragraph",
|
|
1090
1040
|
"role",
|
|
1091
1041
|
"aria-level"
|
|
1092
|
-
],
|
|
1042
|
+
], _t = { key: 1 }, vt = /* @__PURE__ */ k({
|
|
1093
1043
|
__name: "PkWordPreviewBlock",
|
|
1094
1044
|
props: {
|
|
1095
1045
|
block: {},
|
|
@@ -1100,7 +1050,7 @@ var K = {
|
|
|
1100
1050
|
marked: {}
|
|
1101
1051
|
},
|
|
1102
1052
|
setup(e) {
|
|
1103
|
-
let t = e, n =
|
|
1053
|
+
let t = e, n = S(() => {
|
|
1104
1054
|
if (t.block.kind === "table") return {};
|
|
1105
1055
|
let e = t.block.style ?? {};
|
|
1106
1056
|
return {
|
|
@@ -1114,36 +1064,36 @@ var K = {
|
|
|
1114
1064
|
backgroundColor: e.shading,
|
|
1115
1065
|
fontSize: e.size ? `${e.size}pt` : void 0
|
|
1116
1066
|
};
|
|
1117
|
-
}), r =
|
|
1067
|
+
}), r = S(() => {
|
|
1118
1068
|
if (t.block.kind === "table") return {};
|
|
1119
1069
|
let e = -(t.block.style?.firstLine ?? 0);
|
|
1120
1070
|
return e > 0 ? { minWidth: `calc(${e}pt * var(--pk-word-indent-scale, 1))` } : { paddingRight: "6pt" };
|
|
1121
|
-
}), i =
|
|
1071
|
+
}), i = S(() => t.mode === "markup" && t.block.kind !== "table" && t.block.runs.some((e) => e.change)), a = S(() => t.block.kind === "table" && t.row !== void 0 ? t.block.rows[t.row] : void 0), o = S(() => {
|
|
1122
1072
|
if (t.block.kind !== "table") return [];
|
|
1123
1073
|
let e = t.block.widths ?? [], n = e.reduce((e, t) => e + t, 0);
|
|
1124
1074
|
return n ? e.map((e) => `${e / n * 100}%`) : [];
|
|
1125
|
-
}), s =
|
|
1126
|
-
return (t, u) => e.block.kind === "table" && a.value ? (F(),
|
|
1075
|
+
}), s = S(() => t.block.kind !== "table" && !!t.block.id && !!t.marked?.has(t.block.id)), c = (e) => !!e?.some((e) => t.marked?.has(e)), l = S(() => t.mode === "markup" && !!a.value?.some((e) => e.runs.some((e) => e.change)));
|
|
1076
|
+
return (t, u) => e.block.kind === "table" && a.value ? (F(), T("table", {
|
|
1127
1077
|
key: 0,
|
|
1128
|
-
class:
|
|
1078
|
+
class: N(["pk-word-preview__table", {
|
|
1129
1079
|
"pk-word-preview__table--lines": e.block.borders,
|
|
1130
1080
|
"pk-word-preview__table--next": e.row !== 0,
|
|
1131
1081
|
"pk-word-preview__changed": l.value
|
|
1132
1082
|
}])
|
|
1133
|
-
}, [o.value.length ? (F(),
|
|
1083
|
+
}, [o.value.length ? (F(), T("colgroup", mt, [(F(!0), T(x, null, L(o.value, (e, t) => (F(), T("col", {
|
|
1134
1084
|
key: t,
|
|
1135
|
-
style:
|
|
1136
|
-
}, null, 4))), 128))])) :
|
|
1085
|
+
style: P({ width: e })
|
|
1086
|
+
}, null, 4))), 128))])) : w("", !0), E("tbody", null, [E("tr", null, [(F(!0), T(x, null, L(a.value, (t, n) => (F(), T("td", {
|
|
1137
1087
|
key: n,
|
|
1138
1088
|
"data-paragraph": t.ids?.join(" "),
|
|
1139
|
-
class:
|
|
1089
|
+
class: N({ "pk-word-preview__marked": c(t.ids) }),
|
|
1140
1090
|
colspan: t.span,
|
|
1141
|
-
style:
|
|
1091
|
+
style: P({
|
|
1142
1092
|
backgroundColor: t.fill,
|
|
1143
1093
|
textAlign: t.align,
|
|
1144
1094
|
fontSize: t.size ? `${t.size}pt` : void 0
|
|
1145
1095
|
})
|
|
1146
|
-
}, [
|
|
1096
|
+
}, [O(pt, {
|
|
1147
1097
|
runs: t.runs,
|
|
1148
1098
|
mode: e.mode,
|
|
1149
1099
|
numbers: e.numbers
|
|
@@ -1151,24 +1101,24 @@ var K = {
|
|
|
1151
1101
|
"runs",
|
|
1152
1102
|
"mode",
|
|
1153
1103
|
"numbers"
|
|
1154
|
-
])], 14,
|
|
1104
|
+
])], 14, ht))), 128))])])], 2)) : e.block.kind === "table" ? w("", !0) : (F(), T("div", {
|
|
1155
1105
|
key: 1,
|
|
1156
|
-
class:
|
|
1106
|
+
class: N(["pk-word-preview__block", {
|
|
1157
1107
|
"pk-word-preview__changed": i.value,
|
|
1158
1108
|
"pk-word-preview__marked": s.value
|
|
1159
1109
|
}]),
|
|
1160
1110
|
"data-paragraph": e.block.id,
|
|
1161
1111
|
role: e.block.kind === "heading" ? "heading" : void 0,
|
|
1162
1112
|
"aria-level": e.block.kind === "heading" ? Math.max(1, e.block.level) : void 0,
|
|
1163
|
-
style:
|
|
1113
|
+
style: P(n.value)
|
|
1164
1114
|
}, [
|
|
1165
|
-
e.block.label ? (F(),
|
|
1115
|
+
e.block.label ? (F(), T("span", {
|
|
1166
1116
|
key: 0,
|
|
1167
1117
|
class: "pk-word-preview__label",
|
|
1168
1118
|
"data-quote-skip": "",
|
|
1169
|
-
style:
|
|
1170
|
-
}, R(e.block.label), 5)) :
|
|
1171
|
-
|
|
1119
|
+
style: P(r.value)
|
|
1120
|
+
}, R(e.block.label), 5)) : w("", !0),
|
|
1121
|
+
O(pt, {
|
|
1172
1122
|
runs: e.block.runs,
|
|
1173
1123
|
mode: e.mode,
|
|
1174
1124
|
page: e.page,
|
|
@@ -1179,10 +1129,10 @@ var K = {
|
|
|
1179
1129
|
"page",
|
|
1180
1130
|
"numbers"
|
|
1181
1131
|
]),
|
|
1182
|
-
!e.block.label && !e.block.runs.length ? (F(),
|
|
1183
|
-
], 14,
|
|
1132
|
+
!e.block.label && !e.block.runs.length ? (F(), T("br", _t)) : w("", !0)
|
|
1133
|
+
], 14, gt));
|
|
1184
1134
|
}
|
|
1185
|
-
}),
|
|
1135
|
+
}), yt = { class: "pk-word-preview__part" }, bt = ["src"], xt = /* @__PURE__ */ k({
|
|
1186
1136
|
__name: "PkWordPreviewPart",
|
|
1187
1137
|
props: {
|
|
1188
1138
|
blocks: {},
|
|
@@ -1192,13 +1142,13 @@ var K = {
|
|
|
1192
1142
|
numbers: {}
|
|
1193
1143
|
},
|
|
1194
1144
|
setup(e) {
|
|
1195
|
-
let t = e, n =
|
|
1196
|
-
let r =
|
|
1145
|
+
let t = e, n = A(h, void 0), r = S(() => l(t.blocks, t.mode)), i = S(() => d(t.blocks, t.mode).flatMap((e) => {
|
|
1146
|
+
let r = f(n?.value, e.ref);
|
|
1197
1147
|
return r ? [{
|
|
1198
1148
|
src: r,
|
|
1199
|
-
css:
|
|
1149
|
+
css: o(e, t.section.page)
|
|
1200
1150
|
}] : [];
|
|
1201
|
-
})),
|
|
1151
|
+
})), a = S(() => {
|
|
1202
1152
|
let { margins: e } = t.section.page;
|
|
1203
1153
|
return {
|
|
1204
1154
|
left: `${e.left}pt`,
|
|
@@ -1206,10 +1156,10 @@ var K = {
|
|
|
1206
1156
|
...t.where === "header" ? { top: `${t.section.headerDistance}pt` } : { bottom: `${t.section.footerDistance}pt` }
|
|
1207
1157
|
};
|
|
1208
1158
|
});
|
|
1209
|
-
return (t, n) => (F(),
|
|
1159
|
+
return (t, n) => (F(), T("div", yt, [E("div", {
|
|
1210
1160
|
class: "pk-word-preview__part-flow",
|
|
1211
|
-
style:
|
|
1212
|
-
}, [(F(!0),
|
|
1161
|
+
style: P(a.value)
|
|
1162
|
+
}, [(F(!0), T(x, null, L(r.value, (t) => (F(), C(vt, {
|
|
1213
1163
|
key: t.key,
|
|
1214
1164
|
block: e.blocks[t.block],
|
|
1215
1165
|
row: t.row,
|
|
@@ -1222,47 +1172,47 @@ var K = {
|
|
|
1222
1172
|
"mode",
|
|
1223
1173
|
"page",
|
|
1224
1174
|
"numbers"
|
|
1225
|
-
]))), 128))], 4), (F(!0),
|
|
1175
|
+
]))), 128))], 4), (F(!0), T(x, null, L(i.value, (e, t) => (F(), T("img", {
|
|
1226
1176
|
key: t,
|
|
1227
1177
|
class: "pk-word-preview__float",
|
|
1228
|
-
style:
|
|
1178
|
+
style: P(e.css),
|
|
1229
1179
|
src: e.src,
|
|
1230
1180
|
alt: ""
|
|
1231
|
-
}, null, 12,
|
|
1181
|
+
}, null, 12, bt))), 128))]));
|
|
1232
1182
|
}
|
|
1233
|
-
}),
|
|
1183
|
+
}), St = ["aria-label"], Ct = {
|
|
1234
1184
|
class: "pk-word-preview__tabs",
|
|
1235
1185
|
role: "tablist"
|
|
1236
|
-
},
|
|
1186
|
+
}, wt = ["aria-selected"], Tt = ["aria-selected"], Et = {
|
|
1237
1187
|
key: 0,
|
|
1238
1188
|
class: "pk-word-preview__list"
|
|
1239
|
-
},
|
|
1189
|
+
}, Dt = ["aria-current", "onClick"], Ot = { class: "pk-word-preview__entry-text" }, kt = {
|
|
1240
1190
|
key: 0,
|
|
1241
1191
|
class: "u-dot"
|
|
1242
|
-
},
|
|
1192
|
+
}, At = {
|
|
1243
1193
|
key: 0,
|
|
1244
1194
|
class: "pk-word-preview__none"
|
|
1245
|
-
},
|
|
1195
|
+
}, jt = {
|
|
1246
1196
|
key: 1,
|
|
1247
1197
|
class: "pk-word-preview__list"
|
|
1248
|
-
},
|
|
1198
|
+
}, Mt = ["onClick"], Nt = {
|
|
1249
1199
|
key: 0,
|
|
1250
1200
|
class: "pk-word-preview__removed"
|
|
1251
|
-
},
|
|
1201
|
+
}, Pt = {
|
|
1252
1202
|
key: 1,
|
|
1253
1203
|
class: "pk-word-preview__added"
|
|
1254
|
-
},
|
|
1204
|
+
}, Ft = { class: "pk-word-preview__main" }, It = ["aria-label"], Lt = ["src"], Rt = {
|
|
1255
1205
|
key: 2,
|
|
1256
1206
|
class: "pk-word-preview__truncated"
|
|
1257
|
-
},
|
|
1207
|
+
}, zt = { class: "pk-word-preview__status" }, Bt = {
|
|
1258
1208
|
key: 0,
|
|
1259
1209
|
class: "pk-word-preview__count"
|
|
1260
|
-
},
|
|
1210
|
+
}, Vt = { class: "pk-word-preview__count" }, Ht = {
|
|
1261
1211
|
key: 1,
|
|
1262
1212
|
class: "pk-word-preview__legend"
|
|
1263
|
-
},
|
|
1213
|
+
}, Ut = ["title"], Wt = { class: "pk-word-preview__removed" }, Gt = { class: "pk-word-preview__added" }, Kt = { class: "pk-word-preview__percent" }, qt = ["data-part"], Jt = 96 / 72, Yt = .5, Xt = /* @__PURE__ */ k({
|
|
1264
1214
|
__name: "PkWordPreview",
|
|
1265
|
-
props: /*@__PURE__*/
|
|
1215
|
+
props: /*@__PURE__*/ M({
|
|
1266
1216
|
preview: {},
|
|
1267
1217
|
mode: {},
|
|
1268
1218
|
marked: {}
|
|
@@ -1275,28 +1225,28 @@ var K = {
|
|
|
1275
1225
|
zoom: { default: 1 },
|
|
1276
1226
|
zoomModifiers: {}
|
|
1277
1227
|
}),
|
|
1278
|
-
emits: /*@__PURE__*/
|
|
1279
|
-
setup(e, { emit:
|
|
1280
|
-
let
|
|
1281
|
-
|
|
1282
|
-
let
|
|
1283
|
-
page:
|
|
1228
|
+
emits: /*@__PURE__*/ M(["select"], ["update:fit", "update:zoom"]),
|
|
1229
|
+
setup(e, { emit: r }) {
|
|
1230
|
+
let i = e, c = r, { t: u } = le({ useScope: "global" });
|
|
1231
|
+
ie(h, S(() => i.preview.images)), ie(p, S(() => i.preview.charts));
|
|
1232
|
+
let _ = (e) => s(e, i.mode), v = S(() => l(i.preview.blocks, i.mode)), y = oe("rootEl"), b = oe("scrollEl"), D = oe("measureEl"), { width: ee } = ue(y), { width: k } = ue(b), A = S(() => ee.value >= 1e3), j = S(() => i.preview.sections?.length ? i.preview.sections : [{
|
|
1233
|
+
page: i.preview.page,
|
|
1284
1234
|
headerDistance: 0,
|
|
1285
1235
|
footerDistance: 0,
|
|
1286
1236
|
headers: {},
|
|
1287
1237
|
footers: {}
|
|
1288
|
-
}]),
|
|
1289
|
-
fontFamily:
|
|
1290
|
-
fontSize: `${
|
|
1291
|
-
color:
|
|
1292
|
-
"--pk-word-line":
|
|
1293
|
-
"--pk-word-size": `${
|
|
1294
|
-
})),
|
|
1295
|
-
...
|
|
1296
|
-
width: `${
|
|
1297
|
-
})),
|
|
1238
|
+
}]), M = S(() => j.value[0].page), ae = S(() => (k.value - 48) / (M.value.width * Jt)), V = S(() => ee.value === 0 || k.value === 0 || ae.value >= Yt), se = S(() => ({
|
|
1239
|
+
fontFamily: a(i.preview.defaults.font),
|
|
1240
|
+
fontSize: `${i.preview.defaults.size}pt`,
|
|
1241
|
+
color: i.preview.defaults.color ?? "#000000",
|
|
1242
|
+
"--pk-word-line": m(i.preview.defaults.font),
|
|
1243
|
+
"--pk-word-size": `${i.preview.defaults.size}pt`
|
|
1244
|
+
})), U = S(() => M.value.width - M.value.margins.left - M.value.margins.right), ce = S(() => ({
|
|
1245
|
+
...se.value,
|
|
1246
|
+
width: `${U.value}pt`
|
|
1247
|
+
})), W = oe("flowEl"), { width: de } = ue(W), fe = S(() => {
|
|
1298
1248
|
let e = /* @__PURE__ */ new Map(), t = 0;
|
|
1299
|
-
for (let n of
|
|
1249
|
+
for (let n of i.preview.blocks) {
|
|
1300
1250
|
if (n.kind === "table") continue;
|
|
1301
1251
|
let r = n.runs.reduce((e, t) => e + t.text.trim().length, 0);
|
|
1302
1252
|
if (r) {
|
|
@@ -1307,62 +1257,62 @@ var K = {
|
|
|
1307
1257
|
let n = 0;
|
|
1308
1258
|
for (let [r, i] of [...e].sort((e, t) => e[0] - t[0])) if (n += i, n > t / 10) return r;
|
|
1309
1259
|
return 0;
|
|
1310
|
-
}),
|
|
1311
|
-
...
|
|
1312
|
-
"--pk-word-indent-shared": `${
|
|
1313
|
-
"--pk-word-indent-scale":
|
|
1314
|
-
})), G = I([]),
|
|
1315
|
-
await
|
|
1260
|
+
}), pe = S(() => ({
|
|
1261
|
+
...se.value,
|
|
1262
|
+
"--pk-word-indent-shared": `${fe.value}pt`,
|
|
1263
|
+
"--pk-word-indent-scale": de.value ? Math.min(1, de.value / (U.value * Jt)) : 1
|
|
1264
|
+
})), G = I([]), me = I({}), he = async () => {
|
|
1265
|
+
await te();
|
|
1316
1266
|
let e = D.value?.querySelectorAll("[data-item]");
|
|
1317
1267
|
G.value = [...e ?? []].map((e) => e.getBoundingClientRect().height);
|
|
1318
1268
|
let t = D.value?.querySelectorAll("[data-part]");
|
|
1319
|
-
|
|
1269
|
+
me.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
|
|
1320
1270
|
};
|
|
1321
1271
|
H([
|
|
1322
|
-
|
|
1272
|
+
v,
|
|
1323
1273
|
V,
|
|
1324
|
-
() =>
|
|
1325
|
-
],
|
|
1326
|
-
|
|
1274
|
+
() => i.preview.parts
|
|
1275
|
+
], he, { flush: "post" }), re(() => {
|
|
1276
|
+
he(), document.fonts?.ready.then(he);
|
|
1327
1277
|
});
|
|
1328
|
-
let K =
|
|
1329
|
-
if (!V.value || G.value.length !==
|
|
1330
|
-
items:
|
|
1278
|
+
let K = S(() => {
|
|
1279
|
+
if (!V.value || G.value.length !== v.value.length) return [{
|
|
1280
|
+
items: v.value.map((e, t) => t),
|
|
1331
1281
|
section: 0,
|
|
1332
1282
|
number: 1,
|
|
1333
|
-
top:
|
|
1334
|
-
bottom:
|
|
1283
|
+
top: M.value.margins.top,
|
|
1284
|
+
bottom: M.value.margins.bottom
|
|
1335
1285
|
}];
|
|
1336
|
-
let e = [], t = 0, n = !0, r = 0,
|
|
1286
|
+
let e = [], t = 0, n = !0, r = 0, a, o = () => {
|
|
1337
1287
|
let r = j.value[t];
|
|
1338
|
-
return n && r.pageStart !== void 0 ? r.pageStart : (
|
|
1288
|
+
return n && r.pageStart !== void 0 ? r.pageStart : (a ?? e[e.length - 1]?.number ?? 0) + 1;
|
|
1339
1289
|
}, s = (e) => {
|
|
1340
|
-
let r = j.value[t],
|
|
1290
|
+
let r = j.value[t], a = (t) => n && r.titlePage ? t.first : i.preview.evenAndOddHeaders && e % 2 == 0 ? t.even : t.default, o = a(r.headers), s = a(r.footers), c = (e) => e ? (me.value[e] ?? 0) / Jt : 0;
|
|
1341
1291
|
return {
|
|
1342
|
-
header:
|
|
1292
|
+
header: o,
|
|
1343
1293
|
footer: s,
|
|
1344
|
-
top: Math.max(r.page.margins.top,
|
|
1294
|
+
top: Math.max(r.page.margins.top, o ? r.headerDistance + c(o) : 0),
|
|
1345
1295
|
bottom: Math.max(r.page.margins.bottom, s ? r.footerDistance + c(s) : 0)
|
|
1346
1296
|
};
|
|
1347
1297
|
}, c = () => {
|
|
1348
|
-
let
|
|
1349
|
-
|
|
1298
|
+
let i = o();
|
|
1299
|
+
a = void 0, e.push({
|
|
1350
1300
|
items: [],
|
|
1351
1301
|
section: t,
|
|
1352
|
-
number:
|
|
1353
|
-
...s(
|
|
1302
|
+
number: i,
|
|
1303
|
+
...s(i)
|
|
1354
1304
|
}), n = !1, r = 0;
|
|
1355
1305
|
};
|
|
1356
|
-
return
|
|
1357
|
-
|
|
1358
|
-
let u = e[e.length - 1], d = u && j.value[u.section].page, f = d ? (d.height - u.top - u.bottom) *
|
|
1359
|
-
for (let e = l;
|
|
1360
|
-
(!u || u.items.length && (
|
|
1361
|
-
let e = s(
|
|
1362
|
-
return (j.value[t].page.height - e.top - e.bottom) *
|
|
1306
|
+
return v.value.forEach((i, l) => {
|
|
1307
|
+
i.section !== void 0 && i.section !== t && j.value[i.section] && (t = i.section, n = i.breakBefore || !e.length, n || (a = j.value[t].pageStart));
|
|
1308
|
+
let u = e[e.length - 1], d = u && j.value[u.section].page, f = d ? (d.height - u.top - u.bottom) * Jt : 0, p = G.value[l];
|
|
1309
|
+
for (let e = l; v.value[e]?.keepNext && e + 1 < v.value.length && !v.value[e + 1].breakBefore; e++) p += G.value[e + 1];
|
|
1310
|
+
(!u || u.items.length && (i.breakBefore || r + G.value[l] > f || r + p > f && p <= (() => {
|
|
1311
|
+
let e = s(o());
|
|
1312
|
+
return (j.value[t].page.height - e.top - e.bottom) * Jt;
|
|
1363
1313
|
})())) && c(), e[e.length - 1].items.push(l), r += G.value[l];
|
|
1364
1314
|
}), e.length || c(), e;
|
|
1365
|
-
}),
|
|
1315
|
+
}), ge = S(() => {
|
|
1366
1316
|
let e = /* @__PURE__ */ new Map();
|
|
1367
1317
|
for (let t of K.value) e.set(t.section, (e.get(t.section) ?? 0) + 1);
|
|
1368
1318
|
return K.value.map((t) => ({
|
|
@@ -1370,160 +1320,160 @@ var K = {
|
|
|
1370
1320
|
pages: K.value.length,
|
|
1371
1321
|
sectionPages: e.get(t.section) ?? 1
|
|
1372
1322
|
}));
|
|
1373
|
-
}),
|
|
1323
|
+
}), _e = (e) => {
|
|
1374
1324
|
let t = j.value[e.section].page;
|
|
1375
1325
|
return {
|
|
1376
|
-
...
|
|
1326
|
+
...se.value,
|
|
1377
1327
|
width: `${t.width}pt`,
|
|
1378
1328
|
minHeight: `${t.height}pt`,
|
|
1379
1329
|
padding: `${e.top}pt ${t.margins.right}pt ${e.bottom}pt ${t.margins.left}pt`
|
|
1380
1330
|
};
|
|
1381
|
-
},
|
|
1382
|
-
let t = [...new Set(e.items.map((e) =>
|
|
1383
|
-
return
|
|
1384
|
-
let n =
|
|
1331
|
+
}, q = (e) => {
|
|
1332
|
+
let t = [...new Set(e.items.map((e) => v.value[e].block))];
|
|
1333
|
+
return d(t.map((e) => i.preview.blocks[e]), i.mode).flatMap((t) => {
|
|
1334
|
+
let n = f(i.preview.images, t.ref);
|
|
1385
1335
|
return n ? [{
|
|
1386
1336
|
src: n,
|
|
1387
|
-
css:
|
|
1337
|
+
css: o(t, j.value[e.section].page)
|
|
1388
1338
|
}] : [];
|
|
1389
1339
|
});
|
|
1390
|
-
}, ve = B(e, "fit"), ye = B(e, "zoom"), be =
|
|
1340
|
+
}, ve = B(e, "fit"), ye = B(e, "zoom"), be = S(() => ve.value ? Math.min(1.25, Math.max(.3, ae.value)) : ye.value), xe = (e) => {
|
|
1391
1341
|
ye.value = Math.min(2, Math.max(.3, Math.round((be.value + e) * 10) / 10)), ve.value = !1;
|
|
1392
|
-
}, Se = I(0), Ce = I(),
|
|
1393
|
-
let e =
|
|
1342
|
+
}, Se = I(0), Ce = I(), Te = () => {
|
|
1343
|
+
let e = b.value?.getBoundingClientRect();
|
|
1394
1344
|
if (!e) return;
|
|
1395
|
-
let t =
|
|
1345
|
+
let t = b.value?.querySelectorAll("[data-page]") ?? [], n = 0;
|
|
1396
1346
|
for (let [r, i] of [...t].entries()) {
|
|
1397
1347
|
if (i.getBoundingClientRect().top - e.top > e.height / 3) break;
|
|
1398
1348
|
n = r;
|
|
1399
1349
|
}
|
|
1400
1350
|
Se.value = n;
|
|
1401
1351
|
let r;
|
|
1402
|
-
for (let t of
|
|
1403
|
-
let n =
|
|
1352
|
+
for (let t of Y.value) {
|
|
1353
|
+
let n = b.value?.querySelector(`[data-key="${t.key}"]`);
|
|
1404
1354
|
if (n) {
|
|
1405
1355
|
if (n.getBoundingClientRect().top - e.top > 48) break;
|
|
1406
1356
|
r = t.key;
|
|
1407
1357
|
}
|
|
1408
1358
|
}
|
|
1409
|
-
Ce.value = r ??
|
|
1410
|
-
},
|
|
1411
|
-
|
|
1412
|
-
|
|
1359
|
+
Ce.value = r ?? Y.value[0]?.key;
|
|
1360
|
+
}, Ee = 0, De = () => {
|
|
1361
|
+
Ee ||= requestAnimationFrame(() => {
|
|
1362
|
+
Ee = 0, Te();
|
|
1413
1363
|
});
|
|
1414
1364
|
};
|
|
1415
|
-
|
|
1416
|
-
let { selection:
|
|
1417
|
-
root: () =>
|
|
1365
|
+
ne(() => cancelAnimationFrame(Ee)), H(K, () => te(De));
|
|
1366
|
+
let { selection: Oe } = n({
|
|
1367
|
+
root: () => b.value?.getRootNode(),
|
|
1418
1368
|
touch: !0
|
|
1419
1369
|
});
|
|
1420
|
-
H(
|
|
1421
|
-
let t =
|
|
1422
|
-
c("select", e && t ?
|
|
1370
|
+
H(Oe, (e) => {
|
|
1371
|
+
let t = b.value;
|
|
1372
|
+
c("select", e && t ? we(t, e.range, ".pk-word-preview__measure, .pk-word-preview__part") : void 0);
|
|
1423
1373
|
});
|
|
1424
|
-
let J = (e) =>
|
|
1425
|
-
let t =
|
|
1374
|
+
let J = (e) => _(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), Y = S(() => v.value.flatMap((e) => {
|
|
1375
|
+
let t = i.preview.blocks[e.block], n = t.kind === "heading" ? [t.label, J(t.runs)].filter(Boolean).join(" ") : "";
|
|
1426
1376
|
return t.kind === "heading" && t.level <= 3 && n ? [{
|
|
1427
1377
|
key: e.key,
|
|
1428
1378
|
level: t.level,
|
|
1429
1379
|
text: n
|
|
1430
1380
|
}] : [];
|
|
1431
|
-
})),
|
|
1432
|
-
let t =
|
|
1433
|
-
return r ||
|
|
1381
|
+
})), X = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, Z = S(() => v.value.flatMap((e) => {
|
|
1382
|
+
let t = i.preview.blocks[e.block], n = t.kind === "table" ? (t.rows[e.row ?? 0] ?? []).flatMap((e) => e.runs) : t.runs, r = n.filter((e) => e.change === "deleted").map((e) => e.text).join(" ").trim(), a = n.filter((e) => e.change === "inserted").map((e) => e.text).join(" ").trim();
|
|
1383
|
+
return r || a ? [{
|
|
1434
1384
|
key: e.key,
|
|
1435
|
-
removed:
|
|
1436
|
-
added:
|
|
1385
|
+
removed: X(r),
|
|
1386
|
+
added: X(a)
|
|
1437
1387
|
}] : [];
|
|
1438
1388
|
})), ke;
|
|
1439
|
-
H([() =>
|
|
1440
|
-
!e || e === ke || V.value && G.value.length !==
|
|
1389
|
+
H([() => i.marked, K], ([e]) => {
|
|
1390
|
+
!e || e === ke || V.value && G.value.length !== v.value.length || g(b.value, ".pk-word-preview__marked") && (ke = e);
|
|
1441
1391
|
}, {
|
|
1442
1392
|
flush: "post",
|
|
1443
1393
|
immediate: !0
|
|
1444
1394
|
});
|
|
1445
1395
|
let Ae = I("outline"), je = I(!1), Q = (e) => {
|
|
1446
|
-
|
|
1396
|
+
b.value?.querySelector(`[data-key="${e}"]`)?.scrollIntoView({
|
|
1447
1397
|
block: "start",
|
|
1448
1398
|
behavior: "smooth"
|
|
1449
1399
|
}), A.value || (je.value = !1);
|
|
1450
|
-
}, Me =
|
|
1400
|
+
}, Me = S(() => i.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => J(e.runs)) : [J(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), Ne = S(() => i.preview.revisionAuthors.join(", "));
|
|
1451
1401
|
return (n, r) => {
|
|
1452
1402
|
let i = t;
|
|
1453
|
-
return F(),
|
|
1403
|
+
return F(), T("div", {
|
|
1454
1404
|
ref_key: "rootEl",
|
|
1455
|
-
ref:
|
|
1456
|
-
class:
|
|
1405
|
+
ref: y,
|
|
1406
|
+
class: N(["pk-word-preview", { "pk-word-preview--paged": V.value }])
|
|
1457
1407
|
}, [
|
|
1458
|
-
(A.value || je.value) && (
|
|
1408
|
+
(A.value || je.value) && (Y.value.length || Z.value.length) ? (F(), T("aside", {
|
|
1459
1409
|
key: 0,
|
|
1460
|
-
class:
|
|
1461
|
-
"aria-label": z(
|
|
1462
|
-
}, [
|
|
1410
|
+
class: N(["pk-word-preview__side", { "pk-word-preview__side--over": !A.value }]),
|
|
1411
|
+
"aria-label": z(u)("chatFilePreview.outline")
|
|
1412
|
+
}, [E("div", Ct, [E("button", {
|
|
1463
1413
|
type: "button",
|
|
1464
1414
|
role: "tab",
|
|
1465
1415
|
class: "pk-word-preview__tab",
|
|
1466
1416
|
"aria-selected": Ae.value === "outline",
|
|
1467
1417
|
onClick: r[0] ||= (e) => Ae.value = "outline"
|
|
1468
|
-
}, R(z(
|
|
1418
|
+
}, R(z(u)("chatFilePreview.outline")), 9, wt), Z.value.length ? (F(), T("button", {
|
|
1469
1419
|
key: 0,
|
|
1470
1420
|
type: "button",
|
|
1471
1421
|
role: "tab",
|
|
1472
1422
|
class: "pk-word-preview__tab",
|
|
1473
1423
|
"aria-selected": Ae.value === "changes",
|
|
1474
1424
|
onClick: r[1] ||= (e) => Ae.value = "changes"
|
|
1475
|
-
}, R(z(
|
|
1425
|
+
}, R(z(u)("chatFilePreview.changes", { count: Z.value.length })), 9, Tt)) : w("", !0)]), Ae.value === "outline" || !Z.value.length ? (F(), T("nav", Et, [(F(!0), T(x, null, L(Y.value, (e) => (F(), T("button", {
|
|
1476
1426
|
key: e.key,
|
|
1477
1427
|
type: "button",
|
|
1478
|
-
class:
|
|
1428
|
+
class: N(["pk-word-preview__entry", `pk-word-preview__entry--${Math.min(e.level, 3)}`]),
|
|
1479
1429
|
"aria-current": Ce.value === e.key ? "location" : void 0,
|
|
1480
1430
|
onClick: (t) => Q(e.key)
|
|
1481
|
-
}, [
|
|
1431
|
+
}, [E("span", Ot, R(e.text), 1), Z.value.some((t) => t.key === e.key) ? (F(), T("span", kt)) : w("", !0)], 10, Dt))), 128)), Y.value.length ? w("", !0) : (F(), T("p", At, R(z(u)("chatFilePreview.noHeadings")), 1))])) : (F(), T("nav", jt, [(F(!0), T(x, null, L(Z.value, (e) => (F(), T("button", {
|
|
1482
1432
|
key: e.key,
|
|
1483
1433
|
type: "button",
|
|
1484
1434
|
class: "pk-word-preview__entry pk-word-preview__entry--change",
|
|
1485
1435
|
onClick: (t) => Q(e.key)
|
|
1486
|
-
}, [e.removed ? (F(),
|
|
1487
|
-
|
|
1436
|
+
}, [e.removed ? (F(), T("del", Nt, R(e.removed), 1)) : w("", !0), e.added ? (F(), T("ins", Pt, R(e.added), 1)) : w("", !0)], 8, Mt))), 128))]))], 10, St)) : w("", !0),
|
|
1437
|
+
E("div", Ft, [E("div", {
|
|
1488
1438
|
ref_key: "scrollEl",
|
|
1489
|
-
ref:
|
|
1439
|
+
ref: b,
|
|
1490
1440
|
class: "pk-word-preview__scroll",
|
|
1491
|
-
onScroll:
|
|
1492
|
-
}, [V.value ? (F(),
|
|
1441
|
+
onScroll: De
|
|
1442
|
+
}, [V.value ? (F(), T("div", {
|
|
1493
1443
|
key: 0,
|
|
1494
1444
|
class: "pk-word-preview__pages",
|
|
1495
|
-
style:
|
|
1496
|
-
}, [(F(!0),
|
|
1445
|
+
style: P({ zoom: be.value })
|
|
1446
|
+
}, [(F(!0), T(x, null, L(K.value, (t, n) => (F(), T("article", {
|
|
1497
1447
|
key: n,
|
|
1498
1448
|
"data-page": "",
|
|
1499
1449
|
class: "pk-word-preview__page",
|
|
1500
|
-
"aria-label": z(
|
|
1450
|
+
"aria-label": z(u)("chatFilePreview.pageOf", {
|
|
1501
1451
|
page: n + 1,
|
|
1502
1452
|
count: K.value.length
|
|
1503
1453
|
}),
|
|
1504
|
-
style:
|
|
1454
|
+
style: P(_e(t))
|
|
1505
1455
|
}, [
|
|
1506
|
-
t.header && e.preview.parts?.[t.header] ? (F(),
|
|
1456
|
+
t.header && e.preview.parts?.[t.header] ? (F(), C(xt, {
|
|
1507
1457
|
key: 0,
|
|
1508
1458
|
blocks: e.preview.parts[t.header],
|
|
1509
1459
|
where: "header",
|
|
1510
1460
|
section: j.value[t.section],
|
|
1511
1461
|
mode: e.mode,
|
|
1512
|
-
numbers:
|
|
1462
|
+
numbers: ge.value[n]
|
|
1513
1463
|
}, null, 8, [
|
|
1514
1464
|
"blocks",
|
|
1515
1465
|
"section",
|
|
1516
1466
|
"mode",
|
|
1517
1467
|
"numbers"
|
|
1518
|
-
])) :
|
|
1519
|
-
(F(!0),
|
|
1520
|
-
key:
|
|
1521
|
-
"data-key":
|
|
1522
|
-
block: e.preview.blocks[
|
|
1523
|
-
row:
|
|
1468
|
+
])) : w("", !0),
|
|
1469
|
+
(F(!0), T(x, null, L(t.items, (r) => (F(), C(vt, {
|
|
1470
|
+
key: v.value[r].key,
|
|
1471
|
+
"data-key": v.value[r].key,
|
|
1472
|
+
block: e.preview.blocks[v.value[r].block],
|
|
1473
|
+
row: v.value[r].row,
|
|
1524
1474
|
mode: e.mode,
|
|
1525
1475
|
page: j.value[t.section].page,
|
|
1526
|
-
numbers:
|
|
1476
|
+
numbers: ge.value[n],
|
|
1527
1477
|
marked: e.marked
|
|
1528
1478
|
}, null, 8, [
|
|
1529
1479
|
"data-key",
|
|
@@ -1534,33 +1484,33 @@ var K = {
|
|
|
1534
1484
|
"numbers",
|
|
1535
1485
|
"marked"
|
|
1536
1486
|
]))), 128)),
|
|
1537
|
-
(F(!0),
|
|
1487
|
+
(F(!0), T(x, null, L(q(t), (e, t) => (F(), T("img", {
|
|
1538
1488
|
key: `image-${t}`,
|
|
1539
1489
|
class: "pk-word-preview__float",
|
|
1540
|
-
style:
|
|
1490
|
+
style: P(e.css),
|
|
1541
1491
|
src: e.src,
|
|
1542
1492
|
alt: ""
|
|
1543
|
-
}, null, 12,
|
|
1544
|
-
t.footer && e.preview.parts?.[t.footer] ? (F(),
|
|
1493
|
+
}, null, 12, Lt))), 128)),
|
|
1494
|
+
t.footer && e.preview.parts?.[t.footer] ? (F(), C(xt, {
|
|
1545
1495
|
key: 1,
|
|
1546
1496
|
blocks: e.preview.parts[t.footer],
|
|
1547
1497
|
where: "footer",
|
|
1548
1498
|
section: j.value[t.section],
|
|
1549
1499
|
mode: e.mode,
|
|
1550
|
-
numbers:
|
|
1500
|
+
numbers: ge.value[n]
|
|
1551
1501
|
}, null, 8, [
|
|
1552
1502
|
"blocks",
|
|
1553
1503
|
"section",
|
|
1554
1504
|
"mode",
|
|
1555
1505
|
"numbers"
|
|
1556
|
-
])) :
|
|
1557
|
-
], 12,
|
|
1506
|
+
])) : w("", !0)
|
|
1507
|
+
], 12, It))), 128))], 4)) : (F(), T("article", {
|
|
1558
1508
|
key: 1,
|
|
1559
1509
|
ref_key: "flowEl",
|
|
1560
|
-
ref:
|
|
1510
|
+
ref: W,
|
|
1561
1511
|
class: "pk-word-preview__page pk-word-preview__page--flow",
|
|
1562
|
-
style:
|
|
1563
|
-
}, [(F(!0),
|
|
1512
|
+
style: P(pe.value)
|
|
1513
|
+
}, [(F(!0), T(x, null, L(v.value, (t) => (F(), C(vt, {
|
|
1564
1514
|
key: t.key,
|
|
1565
1515
|
"data-key": t.key,
|
|
1566
1516
|
block: e.preview.blocks[t.block],
|
|
@@ -1573,29 +1523,29 @@ var K = {
|
|
|
1573
1523
|
"row",
|
|
1574
1524
|
"mode",
|
|
1575
1525
|
"marked"
|
|
1576
|
-
]))), 128))], 4)), e.preview.truncated ? (F(),
|
|
1577
|
-
V.value ? (F(),
|
|
1526
|
+
]))), 128))], 4)), e.preview.truncated ? (F(), T("p", Rt, R(z(u)("chatFilePreview.truncated")), 1)) : w("", !0)], 544), E("div", zt, [
|
|
1527
|
+
V.value ? (F(), T("span", Bt, R(z(u)("chatFilePreview.pageOf", {
|
|
1578
1528
|
page: Se.value + 1,
|
|
1579
1529
|
count: K.value.length
|
|
1580
|
-
})), 1)) :
|
|
1581
|
-
|
|
1582
|
-
e.mode === "markup" && e.preview.revisionAuthors.length ? (F(),
|
|
1583
|
-
|
|
1530
|
+
})), 1)) : w("", !0),
|
|
1531
|
+
E("span", Vt, R(z(u)("chatFilePreview.words", Me.value)), 1),
|
|
1532
|
+
e.mode === "markup" && e.preview.revisionAuthors.length ? (F(), T("span", Ht, [
|
|
1533
|
+
E("span", {
|
|
1584
1534
|
class: "pk-word-preview__legend-text",
|
|
1585
|
-
title: z(
|
|
1586
|
-
}, R(z(
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
])) :
|
|
1590
|
-
r[6] ||=
|
|
1591
|
-
!A.value && (
|
|
1535
|
+
title: z(u)("chatFilePreview.revisionsOf", { authors: Ne.value })
|
|
1536
|
+
}, R(z(u)("chatFilePreview.revisionsOf", { authors: Ne.value })), 9, Ut),
|
|
1537
|
+
E("del", Wt, R(z(u)("chatFilePreview.removed")), 1),
|
|
1538
|
+
E("ins", Gt, R(z(u)("chatFilePreview.added")), 1)
|
|
1539
|
+
])) : w("", !0),
|
|
1540
|
+
r[6] ||= E("span", { class: "pk-word-preview__spacer" }, null, -1),
|
|
1541
|
+
!A.value && (Y.value.length || Z.value.length) ? (F(), C(i, {
|
|
1592
1542
|
key: 2,
|
|
1593
1543
|
class: "pk-word-preview__outline-toggle",
|
|
1594
1544
|
modifiers: "action-quiet",
|
|
1595
1545
|
icon: "ri:list-unordered",
|
|
1596
|
-
label: z(
|
|
1597
|
-
title: z(
|
|
1598
|
-
"aria-label": z(
|
|
1546
|
+
label: z(u)("chatFilePreview.outline"),
|
|
1547
|
+
title: z(u)("chatFilePreview.outline"),
|
|
1548
|
+
"aria-label": z(u)("chatFilePreview.outline"),
|
|
1599
1549
|
"aria-expanded": je.value,
|
|
1600
1550
|
onClick: r[2] ||= (e) => je.value = !je.value
|
|
1601
1551
|
}, null, 8, [
|
|
@@ -1603,15 +1553,15 @@ var K = {
|
|
|
1603
1553
|
"title",
|
|
1604
1554
|
"aria-label",
|
|
1605
1555
|
"aria-expanded"
|
|
1606
|
-
])) :
|
|
1607
|
-
V.value ? (F(),
|
|
1608
|
-
|
|
1556
|
+
])) : w("", !0),
|
|
1557
|
+
V.value ? (F(), T(x, { key: 3 }, [
|
|
1558
|
+
O(i, {
|
|
1609
1559
|
class: "pk-word-preview__fit",
|
|
1610
1560
|
modifiers: "action-quiet",
|
|
1611
1561
|
icon: "ri:expand-width-line",
|
|
1612
|
-
label: z(
|
|
1613
|
-
title: z(
|
|
1614
|
-
"aria-label": z(
|
|
1562
|
+
label: z(u)("chatFilePreview.fitWidth"),
|
|
1563
|
+
title: z(u)("chatFilePreview.fitWidth"),
|
|
1564
|
+
"aria-label": z(u)("chatFilePreview.fitWidth"),
|
|
1615
1565
|
disabled: ve.value,
|
|
1616
1566
|
onClick: r[3] ||= (e) => ve.value = !0
|
|
1617
1567
|
}, null, 8, [
|
|
@@ -1620,83 +1570,83 @@ var K = {
|
|
|
1620
1570
|
"aria-label",
|
|
1621
1571
|
"disabled"
|
|
1622
1572
|
]),
|
|
1623
|
-
|
|
1573
|
+
O(i, {
|
|
1624
1574
|
modifiers: "action-quiet",
|
|
1625
1575
|
icon: "ri:subtract-line",
|
|
1626
|
-
"aria-label": z(
|
|
1576
|
+
"aria-label": z(u)("chatFilePreview.zoomOut"),
|
|
1627
1577
|
disabled: be.value <= .3,
|
|
1628
1578
|
onClick: r[4] ||= (e) => xe(-.1)
|
|
1629
1579
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1630
|
-
|
|
1631
|
-
|
|
1580
|
+
E("span", Kt, R(Math.round(be.value * 100)) + "% ", 1),
|
|
1581
|
+
O(i, {
|
|
1632
1582
|
modifiers: "action-quiet",
|
|
1633
1583
|
icon: "ri:add-line",
|
|
1634
|
-
"aria-label": z(
|
|
1584
|
+
"aria-label": z(u)("chatFilePreview.zoomIn"),
|
|
1635
1585
|
disabled: be.value >= 2,
|
|
1636
1586
|
onClick: r[5] ||= (e) => xe(.1)
|
|
1637
1587
|
}, null, 8, ["aria-label", "disabled"])
|
|
1638
|
-
], 64)) :
|
|
1588
|
+
], 64)) : w("", !0)
|
|
1639
1589
|
])]),
|
|
1640
|
-
V.value ? (F(),
|
|
1590
|
+
V.value ? (F(), T("div", {
|
|
1641
1591
|
key: 1,
|
|
1642
1592
|
ref_key: "measureEl",
|
|
1643
1593
|
ref: D,
|
|
1644
1594
|
class: "pk-word-preview__measure",
|
|
1645
1595
|
"aria-hidden": "true",
|
|
1646
|
-
style:
|
|
1647
|
-
}, [(F(!0),
|
|
1596
|
+
style: P(ce.value)
|
|
1597
|
+
}, [(F(!0), T(x, null, L(v.value, (t) => (F(), T("div", {
|
|
1648
1598
|
key: t.key,
|
|
1649
1599
|
"data-item": ""
|
|
1650
|
-
}, [
|
|
1600
|
+
}, [O(vt, {
|
|
1651
1601
|
block: e.preview.blocks[t.block],
|
|
1652
1602
|
row: t.row,
|
|
1653
1603
|
mode: e.mode,
|
|
1654
|
-
page:
|
|
1604
|
+
page: M.value
|
|
1655
1605
|
}, null, 8, [
|
|
1656
1606
|
"block",
|
|
1657
1607
|
"row",
|
|
1658
1608
|
"mode",
|
|
1659
1609
|
"page"
|
|
1660
|
-
])]))), 128)), (F(!0),
|
|
1610
|
+
])]))), 128)), (F(!0), T(x, null, L(e.preview.parts, (t, n) => (F(), T("div", {
|
|
1661
1611
|
key: n,
|
|
1662
1612
|
"data-part": n
|
|
1663
|
-
}, [(F(!0),
|
|
1613
|
+
}, [(F(!0), T(x, null, L(z(l)(t, e.mode), (n) => (F(), C(vt, {
|
|
1664
1614
|
key: n.key,
|
|
1665
1615
|
block: t[n.block],
|
|
1666
1616
|
row: n.row,
|
|
1667
1617
|
mode: e.mode,
|
|
1668
|
-
page:
|
|
1618
|
+
page: M.value
|
|
1669
1619
|
}, null, 8, [
|
|
1670
1620
|
"block",
|
|
1671
1621
|
"row",
|
|
1672
1622
|
"mode",
|
|
1673
1623
|
"page"
|
|
1674
|
-
]))), 128))], 8,
|
|
1624
|
+
]))), 128))], 8, qt))), 128))], 4)) : w("", !0)
|
|
1675
1625
|
], 2);
|
|
1676
1626
|
};
|
|
1677
1627
|
}
|
|
1678
|
-
}),
|
|
1628
|
+
}), Zt = ["aria-label"], Qt = { class: "pk-file-preview__head" }, $t = { class: "pk-file-preview__file" }, en = {
|
|
1679
1629
|
class: "pk-file-preview__tile",
|
|
1680
1630
|
"aria-hidden": "true"
|
|
1681
|
-
},
|
|
1631
|
+
}, tn = { class: "pk-file-preview__name" }, nn = { class: "pk-file-preview__title" }, rn = {
|
|
1682
1632
|
class: "pk-file-preview__note",
|
|
1683
1633
|
role: "status"
|
|
1684
|
-
},
|
|
1634
|
+
}, an = {
|
|
1685
1635
|
key: 0,
|
|
1686
1636
|
class: "pk-file-preview__progress",
|
|
1687
1637
|
"aria-hidden": "true"
|
|
1688
|
-
},
|
|
1638
|
+
}, on = {
|
|
1689
1639
|
key: 1,
|
|
1690
1640
|
class: "pk-file-preview__tools"
|
|
1691
|
-
},
|
|
1641
|
+
}, sn = ["aria-label"], cn = { class: "pk-file-preview__version" }, ln = { class: "pk-file-preview__mode-long" }, un = { class: "pk-file-preview__mode-short" }, dn = { class: "pk-file-preview__actions" }, fn = { class: "pk-file-preview__body" }, pn = {
|
|
1692
1642
|
key: 0,
|
|
1693
1643
|
class: "pk-file-preview__skeleton vv-skeleton"
|
|
1694
|
-
},
|
|
1644
|
+
}, mn = {
|
|
1695
1645
|
key: 1,
|
|
1696
1646
|
class: "pk-file-preview__empty"
|
|
1697
|
-
},
|
|
1647
|
+
}, hn = /*@__PURE__*/ k({
|
|
1698
1648
|
__name: "PkFilePreview",
|
|
1699
|
-
props: /*@__PURE__*/
|
|
1649
|
+
props: /*@__PURE__*/ M({
|
|
1700
1650
|
kind: {},
|
|
1701
1651
|
filename: {},
|
|
1702
1652
|
version: {},
|
|
@@ -1725,7 +1675,7 @@ var K = {
|
|
|
1725
1675
|
},
|
|
1726
1676
|
fitModifiers: {}
|
|
1727
1677
|
}),
|
|
1728
|
-
emits: /*@__PURE__*/
|
|
1678
|
+
emits: /*@__PURE__*/ M([
|
|
1729
1679
|
"close",
|
|
1730
1680
|
"version",
|
|
1731
1681
|
"restore",
|
|
@@ -1738,120 +1688,120 @@ var K = {
|
|
|
1738
1688
|
"update:zoom",
|
|
1739
1689
|
"update:fit"
|
|
1740
1690
|
]),
|
|
1741
|
-
setup(e, { emit:
|
|
1742
|
-
let
|
|
1743
|
-
H(() =>
|
|
1744
|
-
e ? (
|
|
1745
|
-
}, { immediate: !0 }), H(() => [
|
|
1746
|
-
|
|
1691
|
+
setup(e, { emit: n }) {
|
|
1692
|
+
let a = e, o = n, { t: s, locale: c } = le({ useScope: "global" }), l = I(!1), u;
|
|
1693
|
+
H(() => a.working, (e, t) => {
|
|
1694
|
+
e ? (u = t === void 0 ? void 0 : a.version, l.value = !1) : u !== void 0 && (l.value = a.version === u, u = void 0);
|
|
1695
|
+
}, { immediate: !0 }), H(() => [a.version, a.fileId], () => {
|
|
1696
|
+
a.working || (l.value = !1);
|
|
1747
1697
|
});
|
|
1748
|
-
let
|
|
1698
|
+
let d = S(() => a.versions ?? []), f = S(() => a.version ? d.value.indexOf(a.version) : -1), p = S(() => f.value > 0 ? d.value[f.value - 1] : void 0), m = S(() => f.value >= 0 && f.value < d.value.length - 1 ? d.value[f.value + 1] : void 0), h = B(e, "mode"), g = B(e, "sheet"), _ = B(e, "zoom"), v = B(e, "fit"), y = S(() => [
|
|
1749
1699
|
{
|
|
1750
1700
|
value: "markup",
|
|
1751
|
-
label:
|
|
1701
|
+
label: s("chatFilePreview.modeMarkup")
|
|
1752
1702
|
},
|
|
1753
1703
|
{
|
|
1754
1704
|
value: "accepted",
|
|
1755
|
-
label:
|
|
1705
|
+
label: s("chatFilePreview.modeAccepted")
|
|
1756
1706
|
},
|
|
1757
1707
|
{
|
|
1758
1708
|
value: "original",
|
|
1759
|
-
label:
|
|
1709
|
+
label: s("chatFilePreview.modeOriginal")
|
|
1760
1710
|
}
|
|
1761
|
-
]),
|
|
1762
|
-
H(() =>
|
|
1763
|
-
|
|
1711
|
+
]), ee = S(() => a.preview?.kind === "word" && a.preview.revisionAuthors.length > 0);
|
|
1712
|
+
H(() => a.version, () => {
|
|
1713
|
+
h.value = "markup";
|
|
1764
1714
|
});
|
|
1765
|
-
let k =
|
|
1715
|
+
let k = oe("rootEl"), A = ae(), j = I(!1), M = () => {
|
|
1766
1716
|
A.value = void 0, j.value = !1;
|
|
1767
1717
|
};
|
|
1768
1718
|
H(() => [
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
],
|
|
1774
|
-
let
|
|
1719
|
+
a.version,
|
|
1720
|
+
a.preview,
|
|
1721
|
+
h.value,
|
|
1722
|
+
g.value
|
|
1723
|
+
], M);
|
|
1724
|
+
let P = (e) => {
|
|
1775
1725
|
j.value || (A.value = e);
|
|
1776
|
-
}, ne =
|
|
1726
|
+
}, ne = S(() => A.value?.format === "docx" && r());
|
|
1777
1727
|
H(j, async (e, t) => {
|
|
1778
1728
|
let n = A.value;
|
|
1779
|
-
t && !e && n?.format === "docx" && (await
|
|
1729
|
+
t && !e && n?.format === "docx" && (await te(), n.restore());
|
|
1780
1730
|
});
|
|
1781
|
-
let
|
|
1782
|
-
let e =
|
|
1783
|
-
e &&
|
|
1784
|
-
}, V =
|
|
1731
|
+
let re = S(() => !a.version || a.version === d.value[d.value.length - 1]), ie = () => {
|
|
1732
|
+
let e = d.value[d.value.length - 1];
|
|
1733
|
+
e && o("version", e);
|
|
1734
|
+
}, V = S(() => {
|
|
1785
1735
|
let e = A.value;
|
|
1786
|
-
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) >
|
|
1787
|
-
}),
|
|
1788
|
-
let e = A.value, t =
|
|
1736
|
+
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) > G;
|
|
1737
|
+
}), U = S(() => A.value?.format === "docx" && h.value === "original"), ce = S(() => V.value || U.value), W = S(() => U.value ? s("selectionActions.hintOriginal") : V.value ? s(A.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: A.value?.format === "docx" ? 200 : G }) : void 0), ue = (e) => e[c.value] ?? e[c.value.split("-")[0]] ?? Object.values(e)[0] ?? "", fe = ["explain", "summarize"], pe = S(() => {
|
|
1738
|
+
let e = A.value, t = a.selectionActions;
|
|
1789
1739
|
if (!e || !t) return [];
|
|
1790
1740
|
let n = e.format;
|
|
1791
|
-
return [...(n === "docx" &&
|
|
1741
|
+
return [...(n === "docx" && ce.value ? fe : t.builtIns).map((e) => ({
|
|
1792
1742
|
id: e,
|
|
1793
|
-
label:
|
|
1794
|
-
...e === "translate" && { asks:
|
|
1795
|
-
prompt: (t) =>
|
|
1796
|
-
})), ...(
|
|
1743
|
+
label: s(`selectionActions.builtIn.${e}`),
|
|
1744
|
+
...e === "translate" && { asks: s("selectionActions.translateAsks") },
|
|
1745
|
+
prompt: (t) => s(`selectionActions.prompt.${n}.${e}`, { language: t ?? "" })
|
|
1746
|
+
})), ...(ce.value ? [] : t.actions).map((e) => ({
|
|
1797
1747
|
id: e.id,
|
|
1798
|
-
label:
|
|
1748
|
+
label: ue(e.label),
|
|
1799
1749
|
icon: e.icon,
|
|
1800
|
-
prompt: () =>
|
|
1750
|
+
prompt: () => ue(e.prompt)
|
|
1801
1751
|
}))];
|
|
1802
|
-
}),
|
|
1803
|
-
if (e.format === "docx") return
|
|
1804
|
-
file:
|
|
1752
|
+
}), me = (e) => {
|
|
1753
|
+
if (e.format === "docx") return s("selectionActions.labelParagraphs", {
|
|
1754
|
+
file: a.filename,
|
|
1805
1755
|
count: e.paragraphCount
|
|
1806
1756
|
}, e.paragraphCount);
|
|
1807
1757
|
let [t, n] = e.range.split(":");
|
|
1808
|
-
return n ?
|
|
1809
|
-
file:
|
|
1758
|
+
return n ? s("selectionActions.labelCells", {
|
|
1759
|
+
file: a.filename,
|
|
1810
1760
|
sheet: e.sheet,
|
|
1811
1761
|
from: t,
|
|
1812
1762
|
to: n
|
|
1813
|
-
}) :
|
|
1814
|
-
file:
|
|
1763
|
+
}) : s("selectionActions.labelCell", {
|
|
1764
|
+
file: a.filename,
|
|
1815
1765
|
sheet: e.sheet,
|
|
1816
1766
|
cell: t
|
|
1817
1767
|
});
|
|
1818
|
-
},
|
|
1819
|
-
if (!
|
|
1768
|
+
}, he = (e) => {
|
|
1769
|
+
if (!a.fileId || !a.storedFileName) return;
|
|
1820
1770
|
let t = {
|
|
1821
|
-
fileId:
|
|
1822
|
-
version:
|
|
1823
|
-
storedFileName:
|
|
1824
|
-
label:
|
|
1771
|
+
fileId: a.fileId,
|
|
1772
|
+
version: a.version ?? 1,
|
|
1773
|
+
storedFileName: a.storedFileName,
|
|
1774
|
+
label: me(e).slice(0, 200)
|
|
1825
1775
|
};
|
|
1826
1776
|
if (e.format === "docx") {
|
|
1827
1777
|
let { measure: n, ...r } = e;
|
|
1828
1778
|
return {
|
|
1829
1779
|
...t,
|
|
1830
1780
|
...r,
|
|
1831
|
-
...
|
|
1781
|
+
...U.value && { original: !0 }
|
|
1832
1782
|
};
|
|
1833
1783
|
}
|
|
1834
|
-
let { measure: n, cells: r, ...
|
|
1784
|
+
let { measure: n, cells: r, ...i } = e;
|
|
1835
1785
|
return {
|
|
1836
1786
|
...t,
|
|
1837
|
-
...
|
|
1787
|
+
...i
|
|
1838
1788
|
};
|
|
1839
|
-
},
|
|
1840
|
-
let n = A.value, r = n &&
|
|
1841
|
-
r && (
|
|
1789
|
+
}, K = (e, t) => {
|
|
1790
|
+
let n = A.value, r = n && he(n);
|
|
1791
|
+
r && (o("selectionSend", e, r, {
|
|
1842
1792
|
id: t,
|
|
1843
1793
|
size: n.format === "docx" ? n.paragraphCount : n.cells
|
|
1844
|
-
}),
|
|
1845
|
-
},
|
|
1846
|
-
let n =
|
|
1847
|
-
n &&
|
|
1848
|
-
},
|
|
1849
|
-
|
|
1794
|
+
}), M(), document.getSelection()?.removeAllRanges());
|
|
1795
|
+
}, ge = (e, t) => {
|
|
1796
|
+
let n = pe.value.find((t) => t.id === e);
|
|
1797
|
+
n && K(n.prompt(t), e);
|
|
1798
|
+
}, _e = I(0);
|
|
1799
|
+
de(k, "scroll", () => _e.value++, {
|
|
1850
1800
|
capture: !0,
|
|
1851
1801
|
passive: !0
|
|
1852
|
-
}),
|
|
1853
|
-
let
|
|
1854
|
-
|
|
1802
|
+
}), de(window, "resize", () => _e.value++, { passive: !0 });
|
|
1803
|
+
let q = S(() => {
|
|
1804
|
+
_e.value;
|
|
1855
1805
|
let e = A.value?.measure(), t = k.value?.getBoundingClientRect();
|
|
1856
1806
|
if (e && t) return {
|
|
1857
1807
|
start: {
|
|
@@ -1867,9 +1817,9 @@ var K = {
|
|
|
1867
1817
|
}
|
|
1868
1818
|
};
|
|
1869
1819
|
});
|
|
1870
|
-
return (
|
|
1871
|
-
let
|
|
1872
|
-
return F(),
|
|
1820
|
+
return (n, r) => {
|
|
1821
|
+
let a = b, c = t;
|
|
1822
|
+
return F(), T("section", {
|
|
1873
1823
|
ref_key: "rootEl",
|
|
1874
1824
|
ref: k,
|
|
1875
1825
|
class: "pk-file-preview",
|
|
@@ -1877,153 +1827,153 @@ var K = {
|
|
|
1877
1827
|
tabindex: "-1",
|
|
1878
1828
|
autofocus: ""
|
|
1879
1829
|
}, [
|
|
1880
|
-
|
|
1881
|
-
|
|
1830
|
+
E("header", Qt, [
|
|
1831
|
+
E("div", $t, [E("span", en, [O(a, {
|
|
1882
1832
|
name: e.kind === "word" ? "ri:file-word-2-line" : "ri:file-excel-2-line",
|
|
1883
|
-
class:
|
|
1884
|
-
}, null, 8, ["name", "class"])]),
|
|
1833
|
+
class: N(e.kind === "word" ? "pk-file-preview__icon--word" : "pk-file-preview__icon--sheet")
|
|
1834
|
+
}, null, 8, ["name", "class"])]), E("div", tn, [E("strong", nn, R(e.filename), 1), E("span", rn, [e.working ? (F(), T(x, { key: 0 }, [r[14] ||= E("span", {
|
|
1885
1835
|
class: "pk-file-preview__spinner",
|
|
1886
1836
|
"aria-hidden": "true"
|
|
1887
|
-
}, null, -1),
|
|
1837
|
+
}, null, -1), D(" " + R(z(s)("chatFilePreview.working")), 1)], 64)) : l.value ? (F(), T(x, { key: 1 }, [D(R(z(s)("chatFilePreview.answeredInChat")) + " ", 1), O(c, {
|
|
1888
1838
|
modifiers: "link",
|
|
1889
1839
|
class: "pk-file-preview__show-chat",
|
|
1890
|
-
label: z(
|
|
1891
|
-
onClick:
|
|
1892
|
-
}, null, 8, ["label"])], 64)) : (F(),
|
|
1893
|
-
e.working ? (F(),
|
|
1894
|
-
e.version &&
|
|
1840
|
+
label: z(s)("chatFilePreview.showChat"),
|
|
1841
|
+
onClick: r[0] ||= (e) => o("showChat")
|
|
1842
|
+
}, null, 8, ["label"])], 64)) : (F(), T(x, { key: 2 }, [D(R(z(s)("chatFilePreview.readOnly")), 1)], 64))])])]),
|
|
1843
|
+
e.working ? (F(), T("div", an)) : w("", !0),
|
|
1844
|
+
e.version && d.value.length > 1 || ee.value ? (F(), T("div", on, [e.version && d.value.length > 1 ? (F(), T("nav", {
|
|
1895
1845
|
key: 0,
|
|
1896
1846
|
class: "pk-file-preview__versions",
|
|
1897
|
-
"aria-label": z(
|
|
1847
|
+
"aria-label": z(s)("chatFilePreview.versions")
|
|
1898
1848
|
}, [
|
|
1899
|
-
|
|
1849
|
+
O(c, {
|
|
1900
1850
|
modifiers: "action-quiet",
|
|
1901
1851
|
icon: "ri:arrow-left-s-line",
|
|
1902
|
-
"aria-label": z(
|
|
1903
|
-
disabled: !
|
|
1904
|
-
onClick:
|
|
1852
|
+
"aria-label": z(s)("chatFilePreview.previousVersion"),
|
|
1853
|
+
disabled: !p.value,
|
|
1854
|
+
onClick: r[1] ||= (e) => p.value && o("version", p.value)
|
|
1905
1855
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1906
|
-
|
|
1856
|
+
E("span", cn, R(z(s)("chatFilePreview.versionOf", {
|
|
1907
1857
|
version: e.version,
|
|
1908
|
-
count:
|
|
1858
|
+
count: d.value.length
|
|
1909
1859
|
})), 1),
|
|
1910
|
-
|
|
1860
|
+
O(c, {
|
|
1911
1861
|
modifiers: "action-quiet",
|
|
1912
1862
|
icon: "ri:arrow-right-s-line",
|
|
1913
|
-
"aria-label": z(
|
|
1914
|
-
disabled: !
|
|
1915
|
-
onClick:
|
|
1863
|
+
"aria-label": z(s)("chatFilePreview.nextVersion"),
|
|
1864
|
+
disabled: !m.value,
|
|
1865
|
+
onClick: r[2] ||= (e) => m.value && o("version", m.value)
|
|
1916
1866
|
}, null, 8, ["aria-label", "disabled"])
|
|
1917
|
-
], 8,
|
|
1867
|
+
], 8, sn)) : w("", !0), ee.value ? (F(), C(i, {
|
|
1918
1868
|
key: 1,
|
|
1919
|
-
modelValue:
|
|
1920
|
-
"onUpdate:modelValue":
|
|
1869
|
+
modelValue: h.value,
|
|
1870
|
+
"onUpdate:modelValue": r[3] ||= (e) => h.value = e,
|
|
1921
1871
|
name: "revisions",
|
|
1922
1872
|
segmented: "",
|
|
1923
1873
|
class: "pk-file-preview__modes u-segmented-fit mb-0",
|
|
1924
|
-
"aria-label": z(
|
|
1925
|
-
options:
|
|
1874
|
+
"aria-label": z(s)("chatFilePreview.modes"),
|
|
1875
|
+
options: y.value
|
|
1926
1876
|
}, {
|
|
1927
|
-
markup:
|
|
1877
|
+
markup: se(() => [E("span", ln, R(z(s)("chatFilePreview.modeMarkup")), 1), E("span", un, R(z(s)("chatFilePreview.modeMarkupShort")), 1)]),
|
|
1928
1878
|
_: 1
|
|
1929
1879
|
}, 8, [
|
|
1930
1880
|
"modelValue",
|
|
1931
1881
|
"aria-label",
|
|
1932
1882
|
"options"
|
|
1933
|
-
])) :
|
|
1934
|
-
|
|
1935
|
-
e.restorable ? (F(),
|
|
1883
|
+
])) : w("", !0)])) : w("", !0),
|
|
1884
|
+
E("div", dn, [
|
|
1885
|
+
e.restorable ? (F(), C(c, {
|
|
1936
1886
|
key: 0,
|
|
1937
1887
|
modifiers: "action-quiet",
|
|
1938
1888
|
icon: "ri:arrow-go-back-line",
|
|
1939
|
-
label: z(
|
|
1940
|
-
onClick:
|
|
1941
|
-
}, null, 8, ["label"])) :
|
|
1942
|
-
|
|
1889
|
+
label: z(s)("chatFilePreview.restore"),
|
|
1890
|
+
onClick: r[4] ||= (e) => o("restore")
|
|
1891
|
+
}, null, 8, ["label"])) : w("", !0),
|
|
1892
|
+
O(c, {
|
|
1943
1893
|
href: e.downloadUrl,
|
|
1944
1894
|
download: "",
|
|
1945
1895
|
modifiers: "action-quiet",
|
|
1946
1896
|
icon: "ri:download-line",
|
|
1947
|
-
title: z(
|
|
1948
|
-
"aria-label": z(
|
|
1897
|
+
title: z(s)("chatFilePreview.download"),
|
|
1898
|
+
"aria-label": z(s)("chatFilePreview.download")
|
|
1949
1899
|
}, null, 8, [
|
|
1950
1900
|
"href",
|
|
1951
1901
|
"title",
|
|
1952
1902
|
"aria-label"
|
|
1953
1903
|
]),
|
|
1954
|
-
e.resize === "expand" ? (F(),
|
|
1904
|
+
e.resize === "expand" ? (F(), C(c, {
|
|
1955
1905
|
key: 1,
|
|
1956
1906
|
modifiers: "action-quiet",
|
|
1957
1907
|
icon: "ri:fullscreen-line",
|
|
1958
|
-
title: z(
|
|
1959
|
-
"aria-label": z(
|
|
1960
|
-
onClick:
|
|
1961
|
-
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (F(),
|
|
1908
|
+
title: z(s)("chatFilePreview.expand"),
|
|
1909
|
+
"aria-label": z(s)("chatFilePreview.expand"),
|
|
1910
|
+
onClick: r[5] ||= (e) => o("resize")
|
|
1911
|
+
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (F(), C(c, {
|
|
1962
1912
|
key: 2,
|
|
1963
1913
|
modifiers: "action-quiet",
|
|
1964
1914
|
icon: "ri:fullscreen-exit-line",
|
|
1965
|
-
title: z(
|
|
1966
|
-
"aria-label": z(
|
|
1967
|
-
onClick:
|
|
1968
|
-
}, null, 8, ["title", "aria-label"])) :
|
|
1969
|
-
|
|
1915
|
+
title: z(s)("chatFilePreview.shrink"),
|
|
1916
|
+
"aria-label": z(s)("chatFilePreview.shrink"),
|
|
1917
|
+
onClick: r[6] ||= (e) => o("resize")
|
|
1918
|
+
}, null, 8, ["title", "aria-label"])) : w("", !0),
|
|
1919
|
+
O(c, {
|
|
1970
1920
|
modifiers: "action-quiet",
|
|
1971
1921
|
icon: "ri:close-line",
|
|
1972
|
-
title: z(
|
|
1973
|
-
"aria-label": z(
|
|
1974
|
-
onClick:
|
|
1922
|
+
title: z(s)("chatFilePreview.close"),
|
|
1923
|
+
"aria-label": z(s)("chatFilePreview.close"),
|
|
1924
|
+
onClick: r[7] ||= (e) => o("close")
|
|
1975
1925
|
}, null, 8, ["title", "aria-label"])
|
|
1976
1926
|
])
|
|
1977
1927
|
]),
|
|
1978
|
-
|
|
1928
|
+
E("div", fn, [e.loading ? (F(), T("div", pn, [(F(), T(x, null, L(8, (e) => E("div", {
|
|
1979
1929
|
key: e,
|
|
1980
|
-
class:
|
|
1981
|
-
}, null, 2)), 64))])) : e.error || !e.preview ? (F(),
|
|
1930
|
+
class: N(["vv-skeleton__item pk-file-preview__skeleton-line", e % 3 ? "w-full" : "w-128"])
|
|
1931
|
+
}, null, 2)), 64))])) : e.error || !e.preview ? (F(), T("p", mn, R(z(s)("chatFilePreview.unavailable")), 1)) : e.preview.kind === "word" ? (F(), C(Xt, {
|
|
1982
1932
|
key: 2,
|
|
1983
|
-
zoom:
|
|
1984
|
-
"onUpdate:zoom":
|
|
1985
|
-
fit:
|
|
1986
|
-
"onUpdate:fit":
|
|
1933
|
+
zoom: _.value,
|
|
1934
|
+
"onUpdate:zoom": r[8] ||= (e) => _.value = e,
|
|
1935
|
+
fit: v.value,
|
|
1936
|
+
"onUpdate:fit": r[9] ||= (e) => v.value = e,
|
|
1987
1937
|
preview: e.preview,
|
|
1988
|
-
mode:
|
|
1938
|
+
mode: ee.value ? h.value : "markup",
|
|
1989
1939
|
marked: e.changes?.kind === "word" ? e.changes.paragraphs : void 0,
|
|
1990
|
-
onSelect:
|
|
1940
|
+
onSelect: P
|
|
1991
1941
|
}, null, 8, [
|
|
1992
1942
|
"zoom",
|
|
1993
1943
|
"fit",
|
|
1994
1944
|
"preview",
|
|
1995
1945
|
"mode",
|
|
1996
1946
|
"marked"
|
|
1997
|
-
])) : (F(),
|
|
1947
|
+
])) : (F(), C(ct, {
|
|
1998
1948
|
key: 3,
|
|
1999
|
-
sheet:
|
|
2000
|
-
"onUpdate:sheet":
|
|
2001
|
-
zoom:
|
|
2002
|
-
"onUpdate:zoom":
|
|
1949
|
+
sheet: g.value,
|
|
1950
|
+
"onUpdate:sheet": r[10] ||= (e) => g.value = e,
|
|
1951
|
+
zoom: _.value,
|
|
1952
|
+
"onUpdate:zoom": r[11] ||= (e) => _.value = e,
|
|
2003
1953
|
preview: e.preview,
|
|
2004
1954
|
marked: e.changes?.kind === "spreadsheet" ? e.changes.cells : void 0,
|
|
2005
|
-
onSelect:
|
|
1955
|
+
onSelect: P
|
|
2006
1956
|
}, null, 8, [
|
|
2007
1957
|
"sheet",
|
|
2008
1958
|
"zoom",
|
|
2009
1959
|
"preview",
|
|
2010
1960
|
"marked"
|
|
2011
1961
|
]))]),
|
|
2012
|
-
e.selectionActions && A.value &&
|
|
1962
|
+
e.selectionActions && A.value && q.value ? (F(), C(ke, {
|
|
2013
1963
|
key: 0,
|
|
2014
1964
|
asking: j.value,
|
|
2015
|
-
"onUpdate:asking":
|
|
1965
|
+
"onUpdate:asking": r[12] ||= (e) => j.value = e,
|
|
2016
1966
|
strategy: "absolute",
|
|
2017
|
-
anchor:
|
|
2018
|
-
actions:
|
|
2019
|
-
hint:
|
|
1967
|
+
anchor: q.value,
|
|
1968
|
+
actions: pe.value,
|
|
1969
|
+
hint: W.value,
|
|
2020
1970
|
touch: ne.value,
|
|
2021
|
-
note:
|
|
2022
|
-
"note-action": z(
|
|
2023
|
-
onAction:
|
|
2024
|
-
onAsk:
|
|
2025
|
-
onNote:
|
|
2026
|
-
onClose:
|
|
1971
|
+
note: re.value ? void 0 : z(s)("selectionActions.notLatest", { version: e.version }),
|
|
1972
|
+
"note-action": z(s)("selectionActions.openLatest"),
|
|
1973
|
+
onAction: ge,
|
|
1974
|
+
onAsk: r[13] ||= (e) => K(e, "ask"),
|
|
1975
|
+
onNote: ie,
|
|
1976
|
+
onClose: M
|
|
2027
1977
|
}, null, 8, [
|
|
2028
1978
|
"asking",
|
|
2029
1979
|
"anchor",
|
|
@@ -2032,11 +1982,11 @@ var K = {
|
|
|
2032
1982
|
"touch",
|
|
2033
1983
|
"note",
|
|
2034
1984
|
"note-action"
|
|
2035
|
-
])) :
|
|
2036
|
-
], 8,
|
|
1985
|
+
])) : w("", !0)
|
|
1986
|
+
], 8, Zt);
|
|
2037
1987
|
};
|
|
2038
1988
|
}
|
|
2039
|
-
}),
|
|
2040
|
-
export {
|
|
1989
|
+
}), gn = /* @__PURE__ */ e({ default: () => _n }), _n = hn;
|
|
1990
|
+
export { pe as i, gn as n, fe as r, _n as t };
|
|
2041
1991
|
|
|
2042
|
-
//# sourceMappingURL=PkFilePreview-
|
|
1992
|
+
//# sourceMappingURL=PkFilePreview-Cb-1YRPN.js.map
|