@8wave/ai-elements 0.125.0-beta.39 → 0.125.0-beta.40

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.
Files changed (121) hide show
  1. package/dist/_chunks/{PkChatbotFilePreview-Dt0ygdJM.js → PkChatbotFilePreview-o0zIuCgN.js} +2 -2
  2. package/dist/_chunks/{PkChatbotFilePreview-Dt0ygdJM.js.map → PkChatbotFilePreview-o0zIuCgN.js.map} +1 -1
  3. package/dist/_chunks/{PkFilePreview-CT3_vRcU.js → PkFilePreview-D_1ZgiiA.js} +438 -438
  4. package/dist/_chunks/{PkFilePreview-CT3_vRcU.js.map → PkFilePreview-D_1ZgiiA.js.map} +1 -1
  5. package/dist/_chunks/{PkFilePreviewDialog-BOKJCapN.js → PkFilePreviewDialog-CI22huzK.js} +2 -2
  6. package/dist/_chunks/{PkFilePreviewDialog-BOKJCapN.js.map → PkFilePreviewDialog-CI22huzK.js.map} +1 -1
  7. package/dist/_chunks/{PkImageEditorDialog-D-ikpGo8.js → PkImageEditorDialog-CAEninFi.js} +152 -130
  8. package/dist/_chunks/PkImageEditorDialog-CAEninFi.js.map +1 -0
  9. package/dist/_chunks/{PkSelectionActions-CXQTnSXQ.js → PkSelectionActions-BriGyWCi.js} +2 -2
  10. package/dist/_chunks/{PkSelectionActions-CXQTnSXQ.js.map → PkSelectionActions-BriGyWCi.js.map} +1 -1
  11. package/dist/_chunks/{PkStreamingMarkdown-5fgxYt_s.js → PkStreamingMarkdown--9i0feuM.js} +3 -3
  12. package/dist/_chunks/{PkStreamingMarkdown-5fgxYt_s.js.map → PkStreamingMarkdown--9i0feuM.js.map} +1 -1
  13. package/dist/_chunks/{PkToolChatFile-Cbmu6I0S.js → PkToolChatFile-BKGUnWrj.js} +3 -3
  14. package/dist/_chunks/{PkToolChatFile-Cbmu6I0S.js.map → PkToolChatFile-BKGUnWrj.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShareDocument-Bxm1pSpj.js → PkToolShareDocument-BUg-uDTO.js} +2 -2
  16. package/dist/_chunks/{PkToolShareDocument-Bxm1pSpj.js.map → PkToolShareDocument-BUg-uDTO.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowArtifact-CGUmoTfN.js → PkToolShowArtifact-BfLpz2-W.js} +2 -2
  18. package/dist/_chunks/{PkToolShowArtifact-CGUmoTfN.js.map → PkToolShowArtifact-BfLpz2-W.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowContactForm-DZ-kgXa6.js → PkToolShowContactForm-BsF6DFzV.js} +2 -2
  20. package/dist/_chunks/{PkToolShowContactForm-DZ-kgXa6.js.map → PkToolShowContactForm-BsF6DFzV.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowDiagram-CwINVecL.js → PkToolShowDiagram-CcRJNDHo.js} +2 -2
  22. package/dist/_chunks/{PkToolShowDiagram-CwINVecL.js.map → PkToolShowDiagram-CcRJNDHo.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowForm-BrxNGFCH.js → PkToolShowForm-w6RvbKEB.js} +3 -3
  24. package/dist/_chunks/{PkToolShowForm-BrxNGFCH.js.map → PkToolShowForm-w6RvbKEB.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowImageGallery-BGTncXxq.js → PkToolShowImageGallery-BEddh4He.js} +2 -2
  26. package/dist/_chunks/{PkToolShowImageGallery-BGTncXxq.js.map → PkToolShowImageGallery-BEddh4He.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowSources-B3RSUWP7.js → PkToolShowSources-CGESvGrm.js} +2 -2
  28. package/dist/_chunks/{PkToolShowSources-B3RSUWP7.js.map → PkToolShowSources-CGESvGrm.js.map} +1 -1
  29. package/dist/_chunks/{useLightbox-C54BCSbU.js → useLightbox-TagJmiah.js} +38 -37
  30. package/dist/_chunks/useLightbox-TagJmiah.js.map +1 -0
  31. package/dist/_chunks/{utils-Do6urHUh.js → utils-zkq8kMz-.js} +7 -4
  32. package/{dist-vue/_chunks/utils-Do3JWPJe.js.map → dist/_chunks/utils-zkq8kMz-.js.map} +1 -1
  33. package/dist/ai-elements.es.js +2711 -2711
  34. package/dist/ai-elements.es.js.map +1 -1
  35. package/dist-vue/PkChatbot.js +1 -1
  36. package/dist-vue/PkChatbotEmptyState.js +1 -1
  37. package/dist-vue/PkChatbotFilePreview.js +1 -1
  38. package/dist-vue/PkChatbotInput.js +1 -1
  39. package/dist-vue/PkChatbotMessages.js +1 -1
  40. package/dist-vue/PkChatbotStepPayload.js +1 -1
  41. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  42. package/dist-vue/PkChatbotSteps.js +1 -1
  43. package/dist-vue/PkChatbotViewChat.js +1 -1
  44. package/dist-vue/PkChatbotViewConversations.js +1 -1
  45. package/dist-vue/_chunks/{PkChart-BsF3OtnS.js → PkChart-DyyBXkd3.js} +2 -2
  46. package/dist-vue/_chunks/{PkChart-BsF3OtnS.js.map → PkChart-DyyBXkd3.js.map} +1 -1
  47. package/dist-vue/_chunks/{PkChatbot-BIQh81cA.js → PkChatbot-wsqj3EpU.js} +5 -5
  48. package/dist-vue/_chunks/{PkChatbot-BIQh81cA.js.map → PkChatbot-wsqj3EpU.js.map} +1 -1
  49. package/dist-vue/_chunks/{PkChatbotEmptyState-pAeFPPQc.js → PkChatbotEmptyState-DcgIfNkX.js} +2 -2
  50. package/dist-vue/_chunks/{PkChatbotEmptyState-pAeFPPQc.js.map → PkChatbotEmptyState-DcgIfNkX.js.map} +1 -1
  51. package/dist-vue/_chunks/{PkChatbotFilePreview-BIta8Yg-.js → PkChatbotFilePreview-BDU2vY0F.js} +2 -2
  52. package/dist-vue/_chunks/{PkChatbotFilePreview-BIta8Yg-.js.map → PkChatbotFilePreview-BDU2vY0F.js.map} +1 -1
  53. package/dist-vue/_chunks/PkChatbotInput-CN4rmNgu.js +520 -0
  54. package/dist-vue/_chunks/PkChatbotInput-CN4rmNgu.js.map +1 -0
  55. package/dist-vue/_chunks/PkChatbotMessages-BlF4Xp0_.js +1054 -0
  56. package/dist-vue/_chunks/{PkChatbotMessages-CZu8feEz.js.map → PkChatbotMessages-BlF4Xp0_.js.map} +1 -1
  57. package/dist-vue/_chunks/{PkChatbotStepPayload-r25JHO7_.js → PkChatbotStepPayload-q9uXE5mr.js} +2 -2
  58. package/dist-vue/_chunks/{PkChatbotStepPayload-r25JHO7_.js.map → PkChatbotStepPayload-q9uXE5mr.js.map} +1 -1
  59. package/dist-vue/_chunks/{PkChatbotStepToolDetail-C897BpRX.js → PkChatbotStepToolDetail-BJz6Qwh3.js} +3 -3
  60. package/dist-vue/_chunks/{PkChatbotStepToolDetail-C897BpRX.js.map → PkChatbotStepToolDetail-BJz6Qwh3.js.map} +1 -1
  61. package/dist-vue/_chunks/{PkChatbotSteps-CRtIVwJV.js → PkChatbotSteps-DvJYNl_k.js} +5 -5
  62. package/dist-vue/_chunks/{PkChatbotSteps-CRtIVwJV.js.map → PkChatbotSteps-DvJYNl_k.js.map} +1 -1
  63. package/dist-vue/_chunks/{PkChatbotViewChat-BBCxj4Qz.js → PkChatbotViewChat-tmHyxxT3.js} +23 -23
  64. package/dist-vue/_chunks/{PkChatbotViewChat-BBCxj4Qz.js.map → PkChatbotViewChat-tmHyxxT3.js.map} +1 -1
  65. package/dist-vue/_chunks/{PkChatbotViewConversations-rXGl7NKA.js → PkChatbotViewConversations-DOzUh_A7.js} +2 -2
  66. package/dist-vue/_chunks/{PkChatbotViewConversations-rXGl7NKA.js.map → PkChatbotViewConversations-DOzUh_A7.js.map} +1 -1
  67. package/dist-vue/_chunks/{PkFilePreview-1ZNyDAo5.js → PkFilePreview-Bp5-Pl54.js} +227 -227
  68. package/dist-vue/_chunks/{PkFilePreview-1ZNyDAo5.js.map → PkFilePreview-Bp5-Pl54.js.map} +1 -1
  69. package/dist-vue/_chunks/{PkFilePreviewDialog-DnbUHGG2.js → PkFilePreviewDialog-CS885vBR.js} +2 -2
  70. package/dist-vue/_chunks/{PkFilePreviewDialog-DnbUHGG2.js.map → PkFilePreviewDialog-CS885vBR.js.map} +1 -1
  71. package/dist-vue/_chunks/{PkImageEditorDialog-Dn3HV_ny.js → PkImageEditorDialog-BhfdnsmX.js} +300 -278
  72. package/dist-vue/_chunks/PkImageEditorDialog-BhfdnsmX.js.map +1 -0
  73. package/dist-vue/_chunks/{PkStreamingMarkdown-COQLmP8b.js → PkStreamingMarkdown-NgrJUZPI.js} +3 -3
  74. package/dist-vue/_chunks/{PkStreamingMarkdown-COQLmP8b.js.map → PkStreamingMarkdown-NgrJUZPI.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkSvgViewer-vkd5Dluw.js → PkSvgViewer-CRNwb6Yn.js} +2 -2
  76. package/dist-vue/_chunks/{PkSvgViewer-vkd5Dluw.js.map → PkSvgViewer-CRNwb6Yn.js.map} +1 -1
  77. package/dist-vue/_chunks/{PkToolChatFile-e-7a0k7l.js → PkToolChatFile-DnmiNGF4.js} +3 -3
  78. package/dist-vue/_chunks/{PkToolChatFile-e-7a0k7l.js.map → PkToolChatFile-DnmiNGF4.js.map} +1 -1
  79. package/dist-vue/_chunks/{PkToolShareDocument-CspvFwRR.js → PkToolShareDocument-Bf7OE8XA.js} +2 -2
  80. package/dist-vue/_chunks/{PkToolShareDocument-CspvFwRR.js.map → PkToolShareDocument-Bf7OE8XA.js.map} +1 -1
  81. package/dist-vue/_chunks/{PkToolShowArtifact-CUP3VaC9.js → PkToolShowArtifact-C8ueuIGQ.js} +2 -2
  82. package/dist-vue/_chunks/{PkToolShowArtifact-CUP3VaC9.js.map → PkToolShowArtifact-C8ueuIGQ.js.map} +1 -1
  83. package/dist-vue/_chunks/{PkToolShowChart-X6JZDAWD.js → PkToolShowChart-BWO6Hzlq.js} +3 -3
  84. package/dist-vue/_chunks/{PkToolShowChart-X6JZDAWD.js.map → PkToolShowChart-BWO6Hzlq.js.map} +1 -1
  85. package/dist-vue/_chunks/{PkToolShowContactForm-BM8d9M5a.js → PkToolShowContactForm-BBcDsLEO.js} +2 -2
  86. package/dist-vue/_chunks/{PkToolShowContactForm-BM8d9M5a.js.map → PkToolShowContactForm-BBcDsLEO.js.map} +1 -1
  87. package/dist-vue/_chunks/{PkToolShowDiagram-DOdzpndK.js → PkToolShowDiagram-BzUcxOKy.js} +3 -3
  88. package/dist-vue/_chunks/{PkToolShowDiagram-DOdzpndK.js.map → PkToolShowDiagram-BzUcxOKy.js.map} +1 -1
  89. package/dist-vue/_chunks/{PkToolShowForm-TYBf8q6g.js → PkToolShowForm-B6uhHzJ8.js} +3 -3
  90. package/dist-vue/_chunks/{PkToolShowForm-TYBf8q6g.js.map → PkToolShowForm-B6uhHzJ8.js.map} +1 -1
  91. package/dist-vue/_chunks/{PkToolShowImageGallery-BvwuoyF6.js → PkToolShowImageGallery-C39nlJrJ.js} +3 -3
  92. package/dist-vue/_chunks/{PkToolShowImageGallery-BvwuoyF6.js.map → PkToolShowImageGallery-C39nlJrJ.js.map} +1 -1
  93. package/dist-vue/_chunks/{PkToolShowLocation-WdRqG8Wi.js → PkToolShowLocation-Nhh_LwmN.js} +2 -2
  94. package/dist-vue/_chunks/{PkToolShowLocation-WdRqG8Wi.js.map → PkToolShowLocation-Nhh_LwmN.js.map} +1 -1
  95. package/dist-vue/_chunks/{PkToolShowProductList-_MHBAgNI.js → PkToolShowProductList-FLLkRCnm.js} +2 -2
  96. package/dist-vue/_chunks/{PkToolShowProductList-_MHBAgNI.js.map → PkToolShowProductList-FLLkRCnm.js.map} +1 -1
  97. package/dist-vue/_chunks/{PkToolShowSources-CHw7qZtw.js → PkToolShowSources-Cb7r5jrX.js} +2 -2
  98. package/dist-vue/_chunks/{PkToolShowSources-CHw7qZtw.js.map → PkToolShowSources-Cb7r5jrX.js.map} +1 -1
  99. package/dist-vue/_chunks/{PkToolShowVideo-D7oiBe4p.js → PkToolShowVideo-QDLhVlau.js} +2 -2
  100. package/dist-vue/_chunks/{PkToolShowVideo-D7oiBe4p.js.map → PkToolShowVideo-QDLhVlau.js.map} +1 -1
  101. package/dist-vue/_chunks/{PkToolShowWebPages-CRq9Jhmw.js → PkToolShowWebPages-P6PdJTEE.js} +2 -2
  102. package/dist-vue/_chunks/{PkToolShowWebPages-CRq9Jhmw.js.map → PkToolShowWebPages-P6PdJTEE.js.map} +1 -1
  103. package/dist-vue/_chunks/{useLightbox-Ctl9zaMX.js → useLightbox-DmtNa8bJ.js} +38 -37
  104. package/dist-vue/_chunks/useLightbox-DmtNa8bJ.js.map +1 -0
  105. package/dist-vue/_chunks/{utils-Do3JWPJe.js → utils-D4B1FVGF.js} +6 -3
  106. package/dist-vue/_chunks/utils-D4B1FVGF.js.map +1 -0
  107. package/dist-vue/composables.js +1 -1
  108. package/dist-vue/index.js +61 -61
  109. package/dist-vue/index.js.map +1 -1
  110. package/dist-vue/packages/components/src/chat/imageEdits.d.ts +3 -1
  111. package/dist-vue/packages/components/src/chat/utils.d.ts +6 -0
  112. package/dist-vue/packages/components/src/composables/useLightbox.d.ts +6 -0
  113. package/package.json +1 -1
  114. package/dist/_chunks/PkImageEditorDialog-D-ikpGo8.js.map +0 -1
  115. package/dist/_chunks/useLightbox-C54BCSbU.js.map +0 -1
  116. package/dist/_chunks/utils-Do6urHUh.js.map +0 -1
  117. package/dist-vue/_chunks/PkChatbotInput-DSyIo0xB.js +0 -520
  118. package/dist-vue/_chunks/PkChatbotInput-DSyIo0xB.js.map +0 -1
  119. package/dist-vue/_chunks/PkChatbotMessages-CZu8feEz.js +0 -1054
  120. package/dist-vue/_chunks/PkImageEditorDialog-Dn3HV_ny.js.map +0 -1
  121. package/dist-vue/_chunks/useLightbox-Ctl9zaMX.js.map +0 -1
@@ -1,36 +1,36 @@
1
1
  import { r as e } from "./rolldown-runtime-9rEmUaIe.js";
2
- import { A as t, B as n, Et as r, F as i, I as a, J as o, L as s, N as c, Ot as l, Q as u, S as d, Tt as f, V as p, X as m, _ as h, d as g, f as _, g as v, gt as y, h as b, j as ee, k as x, kt as S, ot as C, r as w, tt as te, v as T, vt as ne, w as E, wt as D, x as re, y as O, z as k } from "./vue.runtime.esm-bundler-C2U5uTqB.js";
3
- import { r as ie } from "./vue-i18n-POtLvOl1.js";
4
- import { i as A, n as j, r as M } from "./excelNumberFormat-BhQjife9.js";
5
- import { B as N, G as ae, H as oe, K as P, U as se, V as F, W as ce, o as I, q as le } from "./utils-Do6urHUh.js";
6
- import { d as L, l as ue } from "./dist-D6oUr4J_.js";
7
- import { r as de } from "./index.es-DIHz5I8K.js";
8
- import { t as fe } from "./VvButtonLocalized-C8S7XJGv.js";
9
- import { a as pe, i as R, r as me, t as he } from "./PkSelectionActions-CXQTnSXQ.js";
10
- import { t as z } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
11
- import { t as ge } from "./PkEditorRadioButtons-Br4c42KS.js";
2
+ import { A as t, B as n, Et as r, F as i, I as a, J as o, L as s, N as c, Ot as l, Q as u, S as d, Tt as f, V as p, X as m, _ as h, d as g, f as _, g as v, gt as y, h as b, j as ee, k as x, kt as S, ot as C, r as w, tt as te, v as T, vt as ne, w as E, wt as D, x as O, y as k, z as A } from "./vue.runtime.esm-bundler-C2U5uTqB.js";
3
+ import { r as re } from "./vue-i18n-POtLvOl1.js";
4
+ import { i as j, n as M, r as N } from "./excelNumberFormat-BhQjife9.js";
5
+ import { G as P, H as ie, J as ae, K as oe, U as se, V as F, W as ce, o as I, q as L } from "./utils-zkq8kMz-.js";
6
+ import { d as R, l as le } from "./dist-D6oUr4J_.js";
7
+ import { r as ue } from "./index.es-DIHz5I8K.js";
8
+ import { t as de } from "./VvButtonLocalized-C8S7XJGv.js";
9
+ import { a as fe, i as z, r as pe, t as me } from "./PkSelectionActions-BriGyWCi.js";
10
+ import { t as B } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
11
+ import { t as he } from "./PkEditorRadioButtons-Br4c42KS.js";
12
12
  // ../../packages/components/src/chat/fileSelection.ts
13
- var _e = 2e3, B = 1e3, V = 60, H = 1400, U = 20, W = 100, G = (e) => Number(e.slice(1)), ve = (e) => {
14
- let t = [...new Set(e)].sort((e, t) => G(e) - G(t)), n = [];
13
+ var ge = 2e3, V = 1e3, _e = 60, ve = 1400, H = 20, U = 100, W = (e) => Number(e.slice(1)), ye = (e) => {
14
+ let t = [...new Set(e)].sort((e, t) => W(e) - W(t)), n = [];
15
15
  for (let e of t) {
16
16
  let t = n[n.length - 1];
17
- t && G(e) === G(t.to) + 1 ? t.to = e : n.push({
17
+ t && W(e) === W(t.to) + 1 ? t.to = e : n.push({
18
18
  from: e,
19
19
  to: e
20
20
  });
21
21
  }
22
22
  return n.slice(0, 100);
23
- }, K = (e, t) => {
23
+ }, G = (e, t) => {
24
24
  let n = [];
25
25
  if (!t) return n;
26
26
  for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + 1)) n.push(r);
27
27
  return n;
28
- }, ye = (e, t, n) => {
29
- let r = K(e, e.slice(t, t + n));
28
+ }, be = (e, t, n) => {
29
+ let r = G(e, e.slice(t, t + n));
30
30
  if (r.length < 2) return {};
31
31
  let i = t, a = t + n;
32
- for (let t = !0; a - i <= H; t = !t) {
33
- if (K(e, e.slice(i, a)).length === 1) return { find: e.slice(i, a) };
32
+ for (let t = !0; a - i <= ve; t = !t) {
33
+ if (G(e, e.slice(i, a)).length === 1) return { find: e.slice(i, a) };
34
34
  if (t && i > 0) i = e.slice(0, i).replace(/\S*\s*$/, "").length;
35
35
  else if (a < e.length) {
36
36
  let t = e.slice(a).match(/^\s*\S*/)?.[0] ?? "";
@@ -41,23 +41,23 @@ var _e = 2e3, B = 1e3, V = 60, H = 1400, U = 20, W = 100, G = (e) => Number(e.sl
41
41
  index: r.indexOf(t) + 1 || 1,
42
42
  of: r.length
43
43
  } };
44
- }, q = (e) => (e.querySelectorAll("[data-quote-skip]").forEach((e) => e.remove()), e.querySelectorAll("[data-paragraph]").forEach((e) => e.append("\n")), e.textContent ?? ""), be = (e) => e.length > B ? `${e.slice(0, B / 2)} […] ${e.slice(-500)}` : e, xe = (e) => {
44
+ }, K = (e) => (e.querySelectorAll("[data-quote-skip]").forEach((e) => e.remove()), e.querySelectorAll("[data-paragraph]").forEach((e) => e.append("\n")), e.textContent ?? ""), xe = (e) => e.length > V ? `${e.slice(0, V / 2)} […] ${e.slice(-500)}` : e, Se = (e) => {
45
45
  let t = e.startContainer.getRootNode().getSelection?.() ?? document.getSelection();
46
46
  try {
47
47
  t?.setBaseAndExtent(e.startContainer, e.startOffset, e.endContainer, e.endOffset);
48
48
  } catch {}
49
- }, Se = (e, t, n) => {
49
+ }, Ce = (e, t, n) => {
50
50
  let r = t.commonAncestorContainer;
51
51
  if (!e.contains(r) || (r instanceof Element ? r : r.parentElement)?.closest("[data-quote-skip]")) return;
52
52
  let i = [...e.querySelectorAll("[data-paragraph]")].filter((e) => !e.closest(n) && t.intersectsNode(e));
53
53
  if (!i.length) return;
54
- let a = i.flatMap((e) => e.dataset.paragraph.split(" ")), o = q(t.cloneContents()), s = o.trim();
54
+ let a = i.flatMap((e) => e.dataset.paragraph.split(" ")), o = K(t.cloneContents()), s = o.trim();
55
55
  if (s.length < 2) return;
56
56
  let c = {
57
57
  format: "docx",
58
- runs: ve(a),
58
+ runs: ye(a),
59
59
  paragraphCount: new Set(a).size,
60
- quote: be(s),
60
+ quote: xe(s),
61
61
  measure: () => {
62
62
  let e = t.getBoundingClientRect(), n = t.getClientRects()[0] ?? e;
63
63
  return {
@@ -68,22 +68,22 @@ var _e = 2e3, B = 1e3, V = 60, H = 1400, U = 20, W = 100, G = (e) => Number(e.sl
68
68
  bottom: e.bottom
69
69
  };
70
70
  },
71
- restore: () => xe(t)
71
+ restore: () => Se(t)
72
72
  };
73
73
  if (i.length === 1) {
74
74
  let e = i[0], n = document.createRange();
75
75
  n.selectNodeContents(e);
76
- let r = q(n.cloneContents()).replace(/\n$/, ""), a = document.createRange();
76
+ let r = K(n.cloneContents()).replace(/\n$/, ""), a = document.createRange();
77
77
  a.setStart(e, 0), a.setEnd(t.startContainer, t.startOffset);
78
- let l = q(a.cloneContents()).length + (o.length - o.trimStart().length);
79
- c.before = r.slice(Math.max(0, l - V), l), c.after = r.slice(l + s.length, l + s.length + V), Object.assign(c, ye(r, l, s.length));
78
+ let l = K(a.cloneContents()).length + (o.length - o.trimStart().length);
79
+ c.before = r.slice(Math.max(0, l - _e), l), c.after = r.slice(l + s.length, l + s.length + _e), Object.assign(c, be(r, l, s.length));
80
80
  }
81
81
  return c;
82
- }, Ce = (e) => {
82
+ }, we = (e) => {
83
83
  let t = "";
84
84
  for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
85
85
  return t;
86
- }, we = (e, t) => {
86
+ }, Te = (e, t) => {
87
87
  let n = { ...t }, r = e.rows.flatMap((e) => e.cells.filter((e) => e.span).map((t) => ({
88
88
  r1: e.row,
89
89
  r2: e.row + t.span.rows - 1,
@@ -94,7 +94,7 @@ var _e = 2e3, B = 1e3, V = 60, H = 1400, U = 20, W = 100, G = (e) => Number(e.sl
94
94
  e = !1;
95
95
  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);
96
96
  }
97
- let i = `${Ce(n.c1)}${n.r1}`, a = `${Ce(n.c2)}${n.r2}`, o = (e.hiddenRows ?? []).filter((e) => e >= n.r1 && e <= n.r2).slice(0, W), s = e.columns.filter((e) => e.hidden && e.col >= n.c1 && e.col <= n.c2).map((e) => Ce(e.col)).slice(0, W), 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, U).map((e) => String(e.value)).join("; ").slice(0, 500);
97
+ let i = `${we(n.c1)}${n.r1}`, a = `${we(n.c2)}${n.r2}`, o = (e.hiddenRows ?? []).filter((e) => e >= n.r1 && e <= n.r2).slice(0, U), s = e.columns.filter((e) => e.hidden && e.col >= n.c1 && e.col <= n.c2).map((e) => we(e.col)).slice(0, U), 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, H).map((e) => String(e.value)).join("; ").slice(0, 500);
98
98
  return {
99
99
  format: "xlsx",
100
100
  sheet: e.name,
@@ -107,7 +107,7 @@ var _e = 2e3, B = 1e3, V = 60, H = 1400, U = 20, W = 100, G = (e) => Number(e.sl
107
107
  };
108
108
  // ../../packages/components/src/chat/PkSpreadsheetPreview.vue?vue&type=script&setup=true&lang.ts
109
109
  x(), C(), f(), w();
110
- var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-preview__bar" }, De = ["aria-label"], Oe = ["aria-label"], ke = ["aria-label"], Ae = [
110
+ var Ee = { class: "pk-spreadsheet-preview" }, De = { class: "pk-spreadsheet-preview__bar" }, Oe = ["aria-label"], ke = ["aria-label"], Ae = ["aria-label"], je = [
111
111
  "rowspan",
112
112
  "colspan",
113
113
  "data-focus",
@@ -115,16 +115,16 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
115
115
  "title",
116
116
  "onMousedown",
117
117
  "onMouseenter"
118
- ], J = {
118
+ ], q = {
119
119
  key: 1,
120
120
  class: "pk-spreadsheet-preview__more"
121
- }, je = ["aria-label"], Me = ["aria-current", "onClick"], Ne = { class: "pk-spreadsheet-preview__status" }, Pe = { class: "pk-spreadsheet-preview__info" }, Fe = ["title"], Ie = ["title"], Le = {
121
+ }, Me = ["aria-label"], Ne = ["aria-current", "onClick"], Pe = { class: "pk-spreadsheet-preview__status" }, Fe = { class: "pk-spreadsheet-preview__info" }, Ie = ["title"], Le = ["title"], Re = {
122
122
  key: 2,
123
123
  class: "pk-spreadsheet-preview__stats"
124
- }, Re = {
124
+ }, ze = {
125
125
  key: 0,
126
126
  class: "pk-spreadsheet-preview__average"
127
- }, ze = { key: 1 }, Be = { class: "pk-spreadsheet-preview__zoom" }, Ve = { class: "pk-spreadsheet-preview__percent" }, He = 64, Ue = 20, We = 28, Ge = 44, Ke = 400, qe = 10, Je = /*#__PURE__*/ z(/* @__PURE__ */ E({
127
+ }, Be = { key: 1 }, Ve = { class: "pk-spreadsheet-preview__zoom" }, He = { class: "pk-spreadsheet-preview__percent" }, Ue = 64, We = 20, Ge = 28, Ke = 44, qe = 400, Je = 10, Ye = /*#__PURE__*/ B(/* @__PURE__ */ E({
128
128
  __name: "PkSpreadsheetPreview",
129
129
  props: /*@__PURE__*/ c({
130
130
  preview: { type: null },
@@ -137,28 +137,28 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
137
137
  }),
138
138
  emits: /*@__PURE__*/ c(["select"], ["update:sheet", "update:zoom"]),
139
139
  setup(e, { emit: t }) {
140
- let n = e, c = t, { t: f, locale: h } = ie({ useScope: "global" }), x = o(e, "sheet"), C = o(e, "zoom"), w = m("scrollEl"), { width: te, height: ne } = ue(w, {
140
+ let n = e, c = t, { t: f, locale: h } = re({ useScope: "global" }), x = o(e, "sheet"), C = o(e, "zoom"), w = m("scrollEl"), { width: te, height: ne } = le(w, {
141
141
  width: 0,
142
142
  height: 0
143
143
  }, { box: "border-box" }), E = b(() => n.preview.sheets[x.value] ?? n.preview.sheets[0]);
144
144
  u(() => n.preview, () => {
145
145
  x.value = 0;
146
146
  });
147
- let N = b(() => n.marked?.get(E.value?.name ?? "")), ae = b(() => {
147
+ let P = b(() => n.marked?.get(E.value?.name ?? "")), ie = b(() => {
148
148
  let e = /* @__PURE__ */ new Map();
149
- for (let t of N.value ?? []) {
149
+ for (let t of P.value ?? []) {
150
150
  let [n, r] = t.split(":"), i = e.get(Number(n));
151
151
  e.set(Number(n), i ? `${i},${r}` : r);
152
152
  }
153
153
  return e;
154
- }), oe = (e, t) => !!N.value?.has(`${e}:${t}`);
154
+ }), ae = (e, t) => !!P.value?.has(`${e}:${t}`);
155
155
  u(() => n.marked, (e) => {
156
- if (!e || N.value) return;
156
+ if (!e || P.value) return;
157
157
  let t = n.preview.sheets.findIndex((t) => e.has(t.name));
158
158
  t >= 0 && (x.value = t);
159
159
  }, { immediate: !0 });
160
- let P = () => me(w.value, ".pk-spreadsheet-preview__cell--marked");
161
- u(N, P, { flush: "post" }), s(P);
160
+ let oe = () => pe(w.value, ".pk-spreadsheet-preview__cell--marked");
161
+ u(P, oe, { flush: "post" }), s(oe);
162
162
  let se = (e) => {
163
163
  let t = "";
164
164
  for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
@@ -166,55 +166,55 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
166
166
  }, F = b(() => {
167
167
  let e = E.value;
168
168
  if (!e) return [];
169
- 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 = Ge, a = te.value / C.value;
169
+ 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 = Ke, a = te.value / C.value;
170
170
  for (let o = 1; o <= e.lastColumn || !e.moreColumns && (o <= e.lastColumn + 2 || i < a); o++) {
171
171
  if (t.has(o)) continue;
172
- let e = n.get(o) ?? He;
172
+ let e = n.get(o) ?? Ue;
173
173
  r.push({
174
174
  col: o,
175
175
  width: e
176
176
  }), i += e;
177
177
  }
178
178
  return r;
179
- }), ce = b(() => F.value.reduce((e, t) => e + t.width, Ge)), I = b(() => F.value.map((e) => `${e.col}:${e.width}`).join(",")), le = /* @__PURE__ */ new WeakMap(), L = b(() => {
179
+ }), ce = b(() => F.value.reduce((e, t) => e + t.width, Ke)), I = b(() => F.value.map((e) => `${e.col}:${e.width}`).join(",")), L = /* @__PURE__ */ new WeakMap(), R = b(() => {
180
180
  let e = E.value;
181
181
  if (!e) return [];
182
- let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((ne.value / C.value - We) / Ue), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size), a = le.get(e);
183
- a || (a = /* @__PURE__ */ new Map(), le.set(e, a));
182
+ let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((ne.value / C.value - Ge) / We), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size), a = L.get(e);
183
+ a || (a = /* @__PURE__ */ new Map(), L.set(e, a));
184
184
  let o = a;
185
185
  return Array.from({ length: i }, (e, t) => t + 1).filter((e) => !t.has(e)).map((e) => {
186
186
  let t = o.get(e);
187
187
  return t || (t = {
188
188
  row: e,
189
- height: n.get(e) ?? Ue
189
+ height: n.get(e) ?? We
190
190
  }, o.set(e, t)), t;
191
191
  });
192
- }), de = b(() => {
192
+ }), ue = b(() => {
193
193
  let e = /* @__PURE__ */ new Map();
194
194
  for (let t of E.value?.rows ?? []) for (let n of t.cells) e.set(`${t.row},${n.col}`, n);
195
195
  return e;
196
- }), pe = b(() => {
196
+ }), fe = b(() => {
197
197
  let e = /* @__PURE__ */ new Map();
198
198
  for (let t of E.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}`, {
199
199
  row: t.row,
200
200
  col: n.col
201
201
  });
202
202
  return e;
203
- }), R = (e, t) => de.value.get(`${e},${t}`), he = (e, t) => {
204
- let n = R(e, t)?.span;
203
+ }), z = (e, t) => ue.value.get(`${e},${t}`), me = (e, t) => {
204
+ let n = z(e, t)?.span;
205
205
  if (n) return {
206
- rows: L.value.filter((t) => t.row >= e && t.row < e + n.rows).length,
206
+ rows: R.value.filter((t) => t.row >= e && t.row < e + n.rows).length,
207
207
  cols: F.value.filter((e) => e.col >= t && e.col < t + n.cols).length
208
208
  };
209
- }, z = (e) => e?.style === void 0 ? void 0 : n.preview.styles[e.style], ge = (e) => {
209
+ }, B = (e) => e?.style === void 0 ? void 0 : n.preview.styles[e.style], he = (e) => {
210
210
  let t = e.numFmt === void 0 ? void 0 : n.preview.numberFormats?.[e.numFmt], r = e.value;
211
211
  if (t !== void 0) try {
212
- return e.format === "date" ? e.serial === void 0 ? void 0 : j(t, e.serial, h.value, n.preview.date1904) : typeof r == "number" ? A(t) ? j(t, r, h.value, n.preview.date1904) : M(t, r, h.value) : void 0;
212
+ return e.format === "date" ? e.serial === void 0 ? void 0 : M(t, e.serial, h.value, n.preview.date1904) : typeof r == "number" ? j(t) ? M(t, r, h.value, n.preview.date1904) : N(t, r, h.value) : void 0;
213
213
  } catch {
214
214
  return;
215
215
  }
216
- }, _e = (e, t) => {
217
- let n = ge(e);
216
+ }, ge = (e, t) => {
217
+ let n = he(e);
218
218
  if (n) return n.text;
219
219
  let r = e.decimals === void 0 ? { maximumFractionDigits: 10 } : {
220
220
  minimumFractionDigits: e.decimals,
@@ -229,18 +229,18 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
229
229
  currency: e.currency
230
230
  } : {}
231
231
  }).format(t);
232
- }, B = (e) => {
232
+ }, V = (e) => {
233
233
  let t = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
234
234
  return Number.isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(h.value, {
235
235
  dateStyle: "short",
236
236
  timeZone: "UTC"
237
237
  }).format(t);
238
- }, V = (e) => {
238
+ }, _e = (e) => {
239
239
  if (!e) return "";
240
240
  if (e.missing) return "—";
241
241
  let t = e.value;
242
- return t === void 0 ? "" : typeof t == "boolean" ? f(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? ge(e)?.text ?? B(t) : typeof t == "number" ? _e(e, t) : t;
243
- }, H = (e) => {
242
+ return t === void 0 ? "" : typeof t == "boolean" ? f(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? he(e)?.text ?? V(t) : typeof t == "number" ? ge(e, t) : t;
243
+ }, ve = (e) => {
244
244
  if (!e) return "";
245
245
  if (e.formula) return `=${e.formula}`;
246
246
  let t = e.value;
@@ -248,9 +248,9 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
248
248
  useGrouping: !1,
249
249
  maximumFractionDigits: 15,
250
250
  ...e.format === "percent" ? { style: "percent" } : {}
251
- }).format(t) : V(e);
252
- }, U = (e) => e ? `${e.width}px solid ${e.color}` : void 0, W = (e, t, n) => {
253
- let r = z(e), i = e?.value, a = typeof i == "number" || e?.format === "date" || !!e?.missing, o = {
251
+ }).format(t) : _e(e);
252
+ }, H = (e) => e ? `${e.width}px solid ${e.color}` : void 0, U = (e, t, n) => {
253
+ let r = B(e), i = e?.value, a = typeof i == "number" || e?.format === "date" || !!e?.missing, o = {
254
254
  textAlign: r?.align ?? (a ? "right" : typeof i == "boolean" || e?.format === "error" ? "center" : "left"),
255
255
  verticalAlign: r?.valign === "top" ? "top" : r?.valign === "middle" ? "middle" : "bottom",
256
256
  whiteSpace: r?.wrap ? "pre-wrap" : "nowrap"
@@ -258,33 +258,33 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
258
258
  r?.bold && (o.fontWeight = 700), r?.italic && (o.fontStyle = "italic");
259
259
  let s = [r?.underline ? "underline" : "", r?.strike ? "line-through" : ""].filter(Boolean).join(" ");
260
260
  s && (o.textDecoration = s), r?.size && (o.fontSize = `${r.size}pt`);
261
- let c = e ? ge(e)?.color : void 0;
261
+ let c = e ? he(e)?.color : void 0;
262
262
  if ((c ?? r?.color) && (o.color = c ?? r?.color), r?.fill && (o.backgroundColor = r.fill), r?.indent) {
263
263
  let e = `${4 + r.indent * 9}px`;
264
264
  o.textAlign === "right" ? o.paddingRight = e : o.paddingLeft = e;
265
265
  }
266
- let l = rt(t, n);
267
- return G(t, n) ? (o.borderStyle = "hidden", o.boxShadow = [...l, Ye(e, t, n)].filter(Boolean).join(", ")) : (o.borderTop = U(r?.borders?.top), o.borderRight = U(r?.borders?.right), o.borderBottom = U(r?.borders?.bottom), o.borderLeft = U(r?.borders?.left), o.boxShadow = [...l, ...ye(e, t, n)].join(", ")), Object.assign(o, $e(t, n)), o;
268
- }, G = (e, t) => {
266
+ let l = it(t, n);
267
+ return W(t, n) ? (o.borderStyle = "hidden", o.boxShadow = [...l, Xe(e, t, n)].filter(Boolean).join(", ")) : (o.borderTop = H(r?.borders?.top), o.borderRight = H(r?.borders?.right), o.borderBottom = H(r?.borders?.bottom), o.borderLeft = H(r?.borders?.left), o.boxShadow = [...l, ...be(e, t, n)].join(", ")), Object.assign(o, et(t, n)), o;
268
+ }, W = (e, t) => {
269
269
  let n = E.value?.frozen;
270
270
  return !!n && (e <= n.rows || t <= n.cols);
271
- }, ve = {
271
+ }, ye = {
272
272
  top: (e) => `inset 0 ${e.width}px 0 ${e.color}`,
273
273
  right: (e) => `inset -${e.width}px 0 0 ${e.color}`,
274
274
  bottom: (e) => `inset 0 -${e.width}px 0 ${e.color}`,
275
275
  left: (e) => `inset ${e.width}px 0 0 ${e.color}`
276
- }, K = (...e) => e.reduce((e, t) => t && (!e || t.width > e.width) ? t : e, void 0), ye = (e, t, n) => {
277
- let r = z(e)?.borders;
278
- return [t === L.value[0]?.row && r?.top && ve.top(r.top), n === F.value[0]?.col && r?.left && ve.left(r.left)].filter((e) => !!e);
279
- }, q = b(() => L.value.map((e) => e.row)), be = b(() => F.value.map((e) => e.col)), xe = b(() => new Map(q.value.map((e, t) => [e, t]))), Se = b(() => new Map(be.value.map((e, t) => [e, t]))), Ce = (e, t, n, r) => {
276
+ }, G = (...e) => e.reduce((e, t) => t && (!e || t.width > e.width) ? t : e, void 0), be = (e, t, n) => {
277
+ let r = B(e)?.borders;
278
+ return [t === R.value[0]?.row && r?.top && ye.top(r.top), n === F.value[0]?.col && r?.left && ye.left(r.left)].filter((e) => !!e);
279
+ }, K = b(() => R.value.map((e) => e.row)), xe = b(() => F.value.map((e) => e.col)), Se = b(() => new Map(K.value.map((e, t) => [e, t]))), Ce = b(() => new Map(xe.value.map((e, t) => [e, t]))), we = (e, t, n, r) => {
280
280
  let i = [], a = t.get(n) ?? e.length;
281
281
  for (; a < e.length && e[a] < n + r; a++) i.push(e[a]);
282
282
  return {
283
283
  spanned: i,
284
284
  next: e[a]
285
285
  };
286
- }, Je = (e, t, n, r) => {
287
- let { spanned: i, next: a } = Ce(q.value, xe.value, t, e?.span?.rows ?? 1), { spanned: o, next: s } = Ce(be.value, Se.value, n, e?.span?.cols ?? 1);
286
+ }, Ye = (e, t, n, r) => {
287
+ let { spanned: i, next: a } = we(K.value, Se.value, t, e?.span?.rows ?? 1), { spanned: o, next: s } = we(xe.value, Ce.value, n, e?.span?.cols ?? 1);
288
288
  return (r === "right" ? s === void 0 ? [] : i.map((e) => ({
289
289
  row: e,
290
290
  col: s
@@ -292,72 +292,72 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
292
292
  row: a,
293
293
  col: e
294
294
  }))).map((e) => {
295
- let t = pe.value.get(`${e.row},${e.col}`) ?? e;
296
- return R(t.row, t.col);
295
+ let t = fe.value.get(`${e.row},${e.col}`) ?? e;
296
+ return z(t.row, t.col);
297
297
  });
298
- }, Ye = (e, t, n) => {
299
- let r = z(e)?.borders, i = K(r?.right, ...Je(e, t, n, "right").map((e) => z(e)?.borders?.left)), a = K(r?.bottom, ...Je(e, t, n, "bottom").map((e) => z(e)?.borders?.top)), o = E.value?.gridlines;
298
+ }, Xe = (e, t, n) => {
299
+ let r = B(e)?.borders, i = G(r?.right, ...Ye(e, t, n, "right").map((e) => B(e)?.borders?.left)), a = G(r?.bottom, ...Ye(e, t, n, "bottom").map((e) => B(e)?.borders?.top)), o = E.value?.gridlines;
300
300
  return [
301
- i ? ve.right(i) : o && "inset calc(var(--border) * -1) 0 0 var(--pk-spreadsheet-gridline)",
302
- a ? ve.bottom(a) : o && "inset 0 calc(var(--border) * -1) 0 var(--pk-spreadsheet-gridline)",
303
- ...ye(e, t, n)
301
+ i ? ye.right(i) : o && "inset calc(var(--border) * -1) 0 0 var(--pk-spreadsheet-gridline)",
302
+ a ? ye.bottom(a) : o && "inset 0 calc(var(--border) * -1) 0 var(--pk-spreadsheet-gridline)",
303
+ ...be(e, t, n)
304
304
  ].filter(Boolean).join(", ");
305
- }, Xe = (e) => We + L.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0), Ze = (e) => Ge + F.value.filter((t) => t.col < e).reduce((e, t) => e + t.width, 0), Qe = b(() => {
305
+ }, Ze = (e) => Ge + R.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0), Qe = (e) => Ke + F.value.filter((t) => t.col < e).reduce((e, t) => e + t.width, 0), $e = b(() => {
306
306
  let e = E.value?.frozen;
307
307
  return {
308
- top: Xe((e?.rows ?? 0) + 1),
309
- left: Ze((e?.cols ?? 0) + 1)
308
+ top: Ze((e?.rows ?? 0) + 1),
309
+ left: Qe((e?.cols ?? 0) + 1)
310
310
  };
311
- }), $e = (e, t) => {
311
+ }), et = (e, t) => {
312
312
  let n = E.value?.frozen;
313
313
  if (!n) return {};
314
314
  let r = {};
315
- return e <= n.rows && (r.position = "sticky", r.top = `${Xe(e)}px`, r.scrollMarginTop = r.top, r.zIndex = 0), t <= n.cols && (r.position = "sticky", r.left = `${Ze(t)}px`, r.scrollMarginLeft = r.left, r.zIndex = +(e <= n.rows)), r;
316
- }, Y = y({
315
+ return e <= n.rows && (r.position = "sticky", r.top = `${Ze(e)}px`, r.scrollMarginTop = r.top, r.zIndex = 0), t <= n.cols && (r.position = "sticky", r.left = `${Qe(t)}px`, r.scrollMarginLeft = r.left, r.zIndex = +(e <= n.rows)), r;
316
+ }, J = y({
317
317
  row: 1,
318
318
  col: 1
319
- }), X = y({
319
+ }), Y = y({
320
320
  row: 1,
321
321
  col: 1
322
322
  });
323
323
  u(E, () => {
324
- Y.value = {
324
+ J.value = {
325
325
  row: 1,
326
326
  col: 1
327
- }, X.value = {
327
+ }, Y.value = {
328
328
  row: 1,
329
329
  col: 1
330
330
  };
331
331
  });
332
- let Z = b(() => ({
333
- r1: Math.min(Y.value.row, X.value.row),
334
- r2: Math.max(Y.value.row, X.value.row),
335
- c1: Math.min(Y.value.col, X.value.col),
336
- c2: Math.max(Y.value.col, X.value.col)
337
- })), et = (e, t) => e >= Z.value.r1 && e <= Z.value.r2 && t >= Z.value.c1 && t <= Z.value.c2, tt = (e, t) => X.value.row === e && X.value.col === t, nt = (e) => e >= Z.value.r1 && e <= Z.value.r2 ? `${Z.value.c1}:${Z.value.c2}:${X.value.row === e ? X.value.col : 0}:${e === Z.value.r1 ? "t" : ""}${e === Z.value.r2 ? "b" : ""}` : "", rt = (e, t) => {
338
- let { r1: n, r2: r, c1: i, c2: a } = Z.value;
339
- if (n === r && i === a || !et(e, t)) return [];
340
- let o = R(e, t)?.span, s = e + (o?.rows ?? 1) - 1, c = t + (o?.cols ?? 1) - 1, l = "var(--spacing-2)", u = "var(--pk-spreadsheet-green)";
332
+ let X = b(() => ({
333
+ r1: Math.min(J.value.row, Y.value.row),
334
+ r2: Math.max(J.value.row, Y.value.row),
335
+ c1: Math.min(J.value.col, Y.value.col),
336
+ c2: Math.max(J.value.col, Y.value.col)
337
+ })), tt = (e, t) => e >= X.value.r1 && e <= X.value.r2 && t >= X.value.c1 && t <= X.value.c2, nt = (e, t) => Y.value.row === e && Y.value.col === t, rt = (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" : ""}` : "", it = (e, t) => {
338
+ let { r1: n, r2: r, c1: i, c2: a } = X.value;
339
+ if (n === r && i === a || !tt(e, t)) return [];
340
+ let o = z(e, t)?.span, s = e + (o?.rows ?? 1) - 1, c = t + (o?.cols ?? 1) - 1, l = "var(--spacing-2)", u = "var(--pk-spreadsheet-green)";
341
341
  return [
342
342
  e === n && `inset 0 ${l} 0 ${u}`,
343
343
  s >= r && `inset 0 calc(${l} * -1) 0 ${u}`,
344
344
  t === i && `inset ${l} 0 0 ${u}`,
345
345
  c >= a && `inset calc(${l} * -1) 0 0 ${u}`
346
346
  ].filter((e) => !!e);
347
- }, Q = y(!1), it = (e, t, n) => {
348
- w.value?.focus({ preventScroll: !0 }), X.value = {
347
+ }, Z = y(!1), at = (e, t, n) => {
348
+ w.value?.focus({ preventScroll: !0 }), Y.value = {
349
349
  row: e,
350
350
  col: t
351
- }, n.shiftKey || (Y.value = {
351
+ }, n.shiftKey || (J.value = {
352
352
  row: e,
353
353
  col: t
354
- }), Q.value = !0;
355
- }, at = (e, t) => {
356
- Q.value && (X.value = {
354
+ }), Z.value = !0;
355
+ }, ot = (e, t) => {
356
+ Z.value && (Y.value = {
357
357
  row: e,
358
358
  col: t
359
359
  });
360
- }, ot, st = () => {
360
+ }, st, ct = () => {
361
361
  let e = [...w.value?.querySelectorAll(".pk-spreadsheet-preview__cell--range, [data-focus]") ?? []].map((e) => e.getBoundingClientRect());
362
362
  if (e.length) return {
363
363
  start: {
@@ -366,80 +366,80 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
366
366
  },
367
367
  bottom: Math.max(...e.map((e) => e.bottom))
368
368
  };
369
- }, ct = () => E.value ? {
370
- ...we(E.value, Z.value),
371
- measure: st
369
+ }, lt = () => E.value ? {
370
+ ...Te(E.value, X.value),
371
+ measure: ct
372
372
  } : void 0;
373
- u([Z, Q], () => {
374
- clearTimeout(ot), !Q.value && (ot = setTimeout(() => {
375
- let e = Z.value, t = e.r2 > e.r1 || e.c2 > e.c1;
376
- c("select", t ? ct() : void 0);
373
+ u([X, Z], () => {
374
+ clearTimeout(st), !Z.value && (st = setTimeout(() => {
375
+ let e = X.value, t = e.r2 > e.r1 || e.c2 > e.c1;
376
+ c("select", t ? lt() : void 0);
377
377
  }, 150));
378
378
  });
379
- let lt = () => {
380
- clearTimeout(ot), c("select", ct());
381
- }, $, ut;
379
+ let ut = () => {
380
+ clearTimeout(st), c("select", lt());
381
+ }, Q, dt;
382
382
  u(E, () => {
383
- ut = void 0;
383
+ dt = void 0;
384
384
  });
385
- let dt = (e) => {
385
+ let ft = (e) => {
386
386
  let [t, n] = ((e?.closest?.("[data-cell]"))?.dataset.cell ?? "").split(":").map(Number);
387
387
  return t && n ? {
388
388
  row: t,
389
389
  col: n
390
390
  } : void 0;
391
- }, ft = () => {
392
- clearTimeout($?.timer), $?.active && (Q.value = !1), $ = void 0;
391
+ }, pt = () => {
392
+ clearTimeout(Q?.timer), Q?.active && (Z.value = !1), Q = void 0;
393
393
  };
394
394
  a(() => {
395
- ft(), clearTimeout(ot);
395
+ pt(), clearTimeout(st);
396
396
  });
397
- let pt = () => void i(lt), mt = (e) => {
398
- ft();
399
- let t = e.touches[0], n = e.touches.length === 1 ? dt(e.target) : void 0;
400
- t && n && ($ = {
397
+ let mt = () => void i(ut), ht = (e) => {
398
+ pt();
399
+ let t = e.touches[0], n = e.touches.length === 1 ? ft(e.target) : void 0;
400
+ t && n && (Q = {
401
401
  ...n,
402
402
  x: t.clientX,
403
403
  y: t.clientY,
404
404
  active: !1,
405
405
  timer: setTimeout(() => {
406
- $ && ($.active = !0, w.value?.focus({ preventScroll: !0 }), Y.value = {
407
- row: $.row,
408
- col: $.col
409
- }, X.value = {
410
- row: $.row,
411
- col: $.col
412
- }, Q.value = !0);
413
- }, Ke)
406
+ Q && (Q.active = !0, w.value?.focus({ preventScroll: !0 }), J.value = {
407
+ row: Q.row,
408
+ col: Q.col
409
+ }, Y.value = {
410
+ row: Q.row,
411
+ col: Q.col
412
+ }, Z.value = !0);
413
+ }, qe)
414
414
  });
415
- }, ht = (e) => {
415
+ }, gt = (e) => {
416
416
  let t = e.touches[0];
417
- if (!$ || !t) return;
418
- if (!$.active) {
419
- (!e.cancelable || Math.hypot(t.clientX - $.x, t.clientY - $.y) > qe) && ft();
417
+ if (!Q || !t) return;
418
+ if (!Q.active) {
419
+ (!e.cancelable || Math.hypot(t.clientX - Q.x, t.clientY - Q.y) > Je) && pt();
420
420
  return;
421
421
  }
422
422
  e.preventDefault();
423
- let n = w.value?.getRootNode(), r = dt(n?.elementFromPoint(t.clientX, t.clientY) ?? null);
424
- r && (X.value = r);
425
- }, gt = (e) => {
426
- if (!$) return;
427
- let { row: t, col: n, active: r } = $;
428
- ft(), e.preventDefault();
429
- let i = Z.value, a = i.r1 === i.r2 && i.c1 === i.c2;
423
+ let n = w.value?.getRootNode(), r = ft(n?.elementFromPoint(t.clientX, t.clientY) ?? null);
424
+ r && (Y.value = r);
425
+ }, _t = (e) => {
426
+ if (!Q) return;
427
+ let { row: t, col: n, active: r } = Q;
428
+ pt(), e.preventDefault();
429
+ let i = X.value, a = i.r1 === i.r2 && i.c1 === i.c2;
430
430
  if (r) {
431
- a && pt();
431
+ a && mt();
432
432
  return;
433
433
  }
434
- let o = a && tt(t, n) && ut === `${t}:${n}`;
435
- ut = `${t}:${n}`, w.value?.focus({ preventScroll: !0 }), Y.value = {
434
+ let o = a && nt(t, n) && dt === `${t}:${n}`;
435
+ dt = `${t}:${n}`, w.value?.focus({ preventScroll: !0 }), J.value = {
436
436
  row: t,
437
437
  col: n
438
- }, X.value = {
438
+ }, Y.value = {
439
439
  row: t,
440
440
  col: n
441
- }, o && pt();
442
- }, _t = (e) => {
441
+ }, o && mt();
442
+ }, vt = (e) => {
443
443
  let t = {
444
444
  ArrowUp: [-1, 0],
445
445
  ArrowDown: [1, 0],
@@ -450,7 +450,7 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
450
450
  }[e.key];
451
451
  if (!t) return;
452
452
  e.preventDefault();
453
- let n = L.value.map((e) => e.row), r = F.value.map((e) => e.col), a = (e) => pe.value.get(`${e.row},${e.col}`) ?? e, o = a(X.value), s = n.indexOf(X.value.row), c = r.indexOf(X.value.col), l = o;
453
+ let n = R.value.map((e) => e.row), r = F.value.map((e) => e.col), a = (e) => fe.value.get(`${e.row},${e.col}`) ?? e, o = a(Y.value), s = n.indexOf(Y.value.row), c = r.indexOf(Y.value.col), l = o;
454
454
  for (;;) {
455
455
  let e = Math.min(n.length - 1, Math.max(0, s + t[0])), i = Math.min(r.length - 1, Math.max(0, c + t[1]));
456
456
  if (e === s && i === c || (s = e, c = i, l = a({
@@ -458,34 +458,34 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
458
458
  col: r[c]
459
459
  }), l.row !== o.row || l.col !== o.col)) break;
460
460
  }
461
- X.value = l, e.shiftKey || (Y.value = l), i(() => w.value?.querySelector("[data-focus]")?.scrollIntoView({
461
+ Y.value = l, e.shiftKey || (J.value = l), i(() => w.value?.querySelector("[data-focus]")?.scrollIntoView({
462
462
  block: "nearest",
463
463
  inline: "nearest"
464
464
  }));
465
- }, vt = b(() => R(X.value.row, X.value.col)), yt = b(() => {
466
- let { r1: e, r2: t, c1: n, c2: r } = Z.value;
465
+ }, yt = b(() => z(Y.value.row, Y.value.col)), $ = b(() => {
466
+ let { r1: e, r2: t, c1: n, c2: r } = X.value;
467
467
  if (e === t && n === r) return;
468
468
  let i = 0, a = 0, o = 0, s;
469
469
  for (let c = e; c <= t; c++) for (let e = n; e <= r; e++) {
470
- let t = R(c, e);
470
+ let t = z(c, e);
471
471
  t && (t.value !== void 0 || t.missing) && (i++, typeof t.value == "number" && (a += t.value, o++, s ??= t));
472
472
  }
473
473
  if (i) return {
474
474
  count: i,
475
- sum: s ? _e(s, a) : void 0,
476
- average: s ? _e(s, a / o) : void 0
475
+ sum: s ? ge(s, a) : void 0,
476
+ average: s ? ge(s, a / o) : void 0
477
477
  };
478
478
  }), bt = (e) => {
479
479
  C.value = Math.min(2, Math.max(.5, Math.round((C.value + e) * 10) / 10));
480
480
  };
481
481
  return (t, n) => {
482
- let i = fe;
483
- return k(), O("div", Te, [
484
- v("div", Ee, [
482
+ let i = de;
483
+ return A(), k("div", Ee, [
484
+ v("div", De, [
485
485
  v("span", {
486
486
  class: "pk-spreadsheet-preview__ref",
487
487
  "aria-label": D(f)("chatFilePreview.cell")
488
- }, S(se(X.value.col)) + S(X.value.row), 9, De),
488
+ }, S(se(Y.value.col)) + S(Y.value.row), 9, Oe),
489
489
  n[6] ||= v("span", {
490
490
  class: "pk-spreadsheet-preview__fx",
491
491
  "aria-hidden": "true"
@@ -493,7 +493,7 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
493
493
  v("output", {
494
494
  class: "pk-spreadsheet-preview__formula",
495
495
  "aria-label": D(f)("chatFilePreview.formulaBar")
496
- }, S(H(vt.value)), 9, Oe)
496
+ }, S(ve(yt.value)), 9, ke)
497
497
  ]),
498
498
  v("div", {
499
499
  ref_key: "scrollEl",
@@ -502,100 +502,100 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
502
502
  tabindex: "0",
503
503
  role: "grid",
504
504
  "aria-label": E.value?.name,
505
- onKeydown: _t,
506
- onMouseup: n[2] ||= (e) => Q.value = !1,
507
- onMouseleave: n[3] ||= (e) => Q.value = !1,
508
- onTouchstart: mt,
509
- onTouchmove: ht,
510
- onTouchend: gt,
511
- onTouchcancel: ft
512
- }, [E.value ? (k(), O("table", {
505
+ onKeydown: vt,
506
+ onMouseup: n[2] ||= (e) => Z.value = !1,
507
+ onMouseleave: n[3] ||= (e) => Z.value = !1,
508
+ onTouchstart: ht,
509
+ onTouchmove: gt,
510
+ onTouchend: _t,
511
+ onTouchcancel: pt
512
+ }, [E.value ? (A(), k("table", {
513
513
  key: 0,
514
514
  class: r(["pk-spreadsheet-preview__grid", { "pk-spreadsheet-preview__grid--lines": E.value.gridlines }]),
515
515
  style: l({
516
516
  zoom: C.value,
517
517
  width: `${ce.value}px`,
518
- "--pk-spreadsheet-stuck-top": `${Qe.value.top}px`,
519
- "--pk-spreadsheet-stuck-left": `${Qe.value.left}px`
518
+ "--pk-spreadsheet-stuck-top": `${$e.value.top}px`,
519
+ "--pk-spreadsheet-stuck-left": `${$e.value.left}px`
520
520
  })
521
521
  }, [
522
- v("colgroup", null, [v("col", { style: l({ width: `${Ge}px` }) }, null, 4), (k(!0), O(_, null, p(F.value, (e) => (k(), O("col", {
522
+ v("colgroup", null, [v("col", { style: l({ width: `${Ke}px` }) }, null, 4), (A(!0), k(_, null, p(F.value, (e) => (A(), k("col", {
523
523
  key: e.col,
524
524
  style: l({ width: `${e.width}px` })
525
525
  }, null, 4))), 128))]),
526
- v("thead", null, [v("tr", { style: l({ height: `${We}px` }) }, [n[7] ||= v("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (k(!0), O(_, null, p(F.value, (e) => (k(), O("th", {
526
+ v("thead", null, [v("tr", { style: l({ height: `${Ge}px` }) }, [n[7] ||= v("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (A(!0), k(_, null, p(F.value, (e) => (A(), k("th", {
527
527
  key: e.col,
528
528
  scope: "col",
529
- class: r(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >= Z.value.c1 && e.col <= Z.value.c2 }]),
529
+ class: r(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >= X.value.c1 && e.col <= X.value.c2 }]),
530
530
  style: l(E.value.frozen && e.col <= E.value.frozen.cols ? {
531
- left: `${Ze(e.col)}px`,
531
+ left: `${Qe(e.col)}px`,
532
532
  zIndex: 2
533
533
  } : void 0)
534
534
  }, S(se(e.col)), 7))), 128))], 4)]),
535
- v("tbody", null, [(k(!0), O(_, null, p(L.value, (e, t, n, i) => {
535
+ v("tbody", null, [(A(!0), k(_, null, p(R.value, (e, t, n, i) => {
536
536
  let a = [
537
537
  e,
538
538
  E.value,
539
539
  I.value,
540
540
  D(h),
541
- nt(e.row),
542
- ae.value.get(e.row)
541
+ rt(e.row),
542
+ ie.value.get(e.row)
543
543
  ];
544
544
  if (i && i.el && i.key === e.row && ee(i, a)) return i;
545
- let o = (k(), O("tr", {
545
+ let o = (A(), k("tr", {
546
546
  key: e.row,
547
547
  style: l({ height: `${e.height}px` })
548
548
  }, [v("th", {
549
549
  scope: "row",
550
- class: r(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >= Z.value.r1 && e.row <= Z.value.r2 }]),
550
+ class: r(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >= X.value.r1 && e.row <= X.value.r2 }]),
551
551
  style: l(E.value.frozen && e.row <= E.value.frozen.rows ? {
552
- ...$e(e.row, 0),
552
+ ...et(e.row, 0),
553
553
  left: 0,
554
554
  zIndex: 4
555
555
  } : void 0)
556
- }, S(e.row), 7), (k(!0), O(_, null, p(F.value, (t) => (k(), O(_, { key: t.col }, [pe.value.has(`${e.row},${t.col}`) ? T("", !0) : (k(), O("td", {
556
+ }, S(e.row), 7), (A(!0), k(_, null, p(F.value, (t) => (A(), k(_, { key: t.col }, [fe.value.has(`${e.row},${t.col}`) ? T("", !0) : (A(), k("td", {
557
557
  key: 0,
558
- rowspan: he(e.row, t.col)?.rows,
559
- colspan: he(e.row, t.col)?.cols,
558
+ rowspan: me(e.row, t.col)?.rows,
559
+ colspan: me(e.row, t.col)?.cols,
560
560
  class: r(["pk-spreadsheet-preview__cell", {
561
- "pk-spreadsheet-preview__cell--range": et(e.row, t.col) && !tt(e.row, t.col),
562
- "pk-spreadsheet-preview__cell--missing": R(e.row, t.col)?.missing,
563
- "pk-spreadsheet-preview__cell--marked": oe(e.row, t.col)
561
+ "pk-spreadsheet-preview__cell--range": tt(e.row, t.col) && !nt(e.row, t.col),
562
+ "pk-spreadsheet-preview__cell--missing": z(e.row, t.col)?.missing,
563
+ "pk-spreadsheet-preview__cell--marked": ae(e.row, t.col)
564
564
  }]),
565
- style: l(W(R(e.row, t.col), e.row, t.col)),
566
- "data-focus": tt(e.row, t.col) ? "" : void 0,
565
+ style: l(U(z(e.row, t.col), e.row, t.col)),
566
+ "data-focus": nt(e.row, t.col) ? "" : void 0,
567
567
  "data-cell": `${e.row}:${t.col}`,
568
- title: R(e.row, t.col)?.missing ? D(f)("chatFilePreview.missingValue") : void 0,
569
- onMousedown: g((n) => it(e.row, t.col, n), ["prevent"]),
570
- onMouseenter: (n) => at(e.row, t.col),
571
- onDblclick: lt
572
- }, S(V(R(e.row, t.col))), 47, Ae))], 64))), 128))], 4));
568
+ title: z(e.row, t.col)?.missing ? D(f)("chatFilePreview.missingValue") : void 0,
569
+ onMousedown: g((n) => at(e.row, t.col, n), ["prevent"]),
570
+ onMouseenter: (n) => ot(e.row, t.col),
571
+ onDblclick: ut
572
+ }, S(_e(z(e.row, t.col))), 47, je))], 64))), 128))], 4));
573
573
  return o.memo = a, o;
574
574
  }, n, 0), 128))])
575
- ], 6)) : T("", !0), E.value && (E.value.moreRows || E.value.moreColumns) ? (k(), O("p", J, [E.value.moreRows ? (k(), O(_, { key: 0 }, [re(S(D(f)("chatFilePreview.moreRows", E.value.moreRows)), 1)], 64)) : T("", !0), E.value.moreColumns ? (k(), O(_, { key: 1 }, [re(S(D(f)("chatFilePreview.moreColumns", E.value.moreColumns)), 1)], 64)) : T("", !0)])) : T("", !0)], 40, ke),
575
+ ], 6)) : T("", !0), E.value && (E.value.moreRows || E.value.moreColumns) ? (A(), k("p", q, [E.value.moreRows ? (A(), k(_, { key: 0 }, [O(S(D(f)("chatFilePreview.moreRows", E.value.moreRows)), 1)], 64)) : T("", !0), E.value.moreColumns ? (A(), k(_, { key: 1 }, [O(S(D(f)("chatFilePreview.moreColumns", E.value.moreColumns)), 1)], 64)) : T("", !0)])) : T("", !0)], 40, Ae),
576
576
  v("nav", {
577
577
  class: "pk-spreadsheet-preview__sheets",
578
578
  "aria-label": D(f)("chatFilePreview.sheets")
579
- }, [(k(!0), O(_, null, p(e.preview.sheets, (e, t) => (k(), O("button", {
579
+ }, [(A(!0), k(_, null, p(e.preview.sheets, (e, t) => (A(), k("button", {
580
580
  key: e.name,
581
581
  type: "button",
582
582
  class: "pk-spreadsheet-preview__sheet",
583
583
  "aria-current": t === x.value ? "page" : void 0,
584
584
  onClick: (e) => x.value = t
585
- }, S(e.name), 9, Me))), 128))], 8, je),
586
- v("div", Ne, [v("p", Pe, [e.preview.staleFormulas ? (k(), O("span", {
585
+ }, S(e.name), 9, Ne))), 128))], 8, Me),
586
+ v("div", Pe, [v("p", Fe, [e.preview.staleFormulas ? (A(), k("span", {
587
587
  key: 0,
588
588
  class: "pk-spreadsheet-preview__note",
589
589
  title: D(f)("chatFilePreview.staleFormulas")
590
- }, S(D(f)("chatFilePreview.staleFormulas")), 9, Fe)) : e.preview.computedFormulas ? (k(), O("span", {
590
+ }, S(D(f)("chatFilePreview.staleFormulas")), 9, Ie)) : e.preview.computedFormulas ? (A(), k("span", {
591
591
  key: 1,
592
592
  class: "pk-spreadsheet-preview__note",
593
593
  title: D(f)("chatFilePreview.computedFormulas")
594
- }, S(D(f)("chatFilePreview.computedFormulas")), 9, Ie)) : T("", !0), yt.value ? (k(), O("span", Le, [
595
- yt.value.average ? (k(), O("span", Re, S(D(f)("chatFilePreview.average")) + " " + S(yt.value.average), 1)) : T("", !0),
596
- v("span", null, S(D(f)("chatFilePreview.count")) + " " + S(yt.value.count), 1),
597
- yt.value.sum ? (k(), O("span", ze, S(D(f)("chatFilePreview.sum")) + " " + S(yt.value.sum), 1)) : T("", !0)
598
- ])) : T("", !0)]), v("div", Be, [
594
+ }, S(D(f)("chatFilePreview.computedFormulas")), 9, Le)) : T("", !0), $.value ? (A(), k("span", Re, [
595
+ $.value.average ? (A(), k("span", ze, S(D(f)("chatFilePreview.average")) + " " + S($.value.average), 1)) : T("", !0),
596
+ v("span", null, S(D(f)("chatFilePreview.count")) + " " + S($.value.count), 1),
597
+ $.value.sum ? (A(), k("span", Be, S(D(f)("chatFilePreview.sum")) + " " + S($.value.sum), 1)) : T("", !0)
598
+ ])) : T("", !0)]), v("div", Ve, [
599
599
  d(i, {
600
600
  modifiers: "action-quiet",
601
601
  icon: "ri:subtract-line",
@@ -603,7 +603,7 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
603
603
  disabled: C.value <= .5,
604
604
  onClick: n[4] ||= (e) => bt(-.1)
605
605
  }, null, 8, ["aria-label", "disabled"]),
606
- v("span", Ve, S(Math.round(C.value * 100)) + "% ", 1),
606
+ v("span", He, S(Math.round(C.value * 100)) + "% ", 1),
607
607
  d(i, {
608
608
  modifiers: "action-quiet",
609
609
  icon: "ri:add-line",
@@ -618,11 +618,11 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
618
618
  }), [["styles", [".pk-spreadsheet-preview{--pk-spreadsheet-green:#217346;--pk-spreadsheet-green-head:#217346;--pk-spreadsheet-gridline:#e1e1e1;flex-direction:column;flex:1;min-height:0;display:flex}.pk-spreadsheet-preview__bar{min-height:var(--spacing-40);border-bottom:var(--border) solid var(--color-surface-3);background-color:var(--color-surface);font-size:var(--text-14);align-items:stretch;display:flex}.pk-spreadsheet-preview__ref{width:var(--spacing-96);padding:0 var(--spacing-12);box-sizing:border-box;border-right:var(--border) solid var(--color-surface-3);font-variant-numeric:tabular-nums;flex-shrink:0;align-items:center;display:flex}.pk-spreadsheet-preview__fx{width:var(--spacing-40);border-right:var(--border) solid var(--color-surface-3);color:var(--color-word-3);flex-shrink:0;justify-content:center;align-items:center;font-family:Georgia,serif;font-style:italic;display:flex}.pk-spreadsheet-preview__formula{min-width:0;padding:0 var(--spacing-12);text-overflow:ellipsis;white-space:nowrap;flex:1;align-items:center;display:flex;overflow:hidden}.pk-spreadsheet-preview__scroll{cursor:cell;background-color:#fff;outline:none;flex:1;min-height:0;overflow:auto}.pk-spreadsheet-preview__scroll:focus-visible{box-shadow:inset 0 0 0 var(--spacing-2) var(--input-focus-color)}.pk-spreadsheet-preview__grid{border-collapse:collapse;table-layout:fixed;color:#000;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;font-family:Calibri,Carlito,Segoe UI,Arial,sans-serif;font-size:11pt}.pk-spreadsheet-preview__grid td{max-width:0;padding:0 var(--spacing-4);text-overflow:clip;background-color:#fff;line-height:1.2;overflow:hidden}.pk-spreadsheet-preview__grid--lines td{border:var(--border) solid var(--pk-spreadsheet-gridline)}.pk-spreadsheet-preview__corner,.pk-spreadsheet-preview__head,.pk-spreadsheet-preview__row{z-index:1;box-shadow:var(--pk-spreadsheet-lines);background-color:var(--color-surface-1);color:var(--color-word-3);font-family:var(--font-family-sans);font-size:var(--text-12);font-weight:var(--font-normal);text-align:center;border-style:hidden;position:sticky}.pk-spreadsheet-preview__corner,.pk-spreadsheet-preview__head{padding:var(--spacing-4) var(--spacing-4) var(--spacing-2);vertical-align:middle;line-height:1;top:0}.pk-spreadsheet-preview__row{vertical-align:middle}.pk-spreadsheet-preview__corner{--pk-spreadsheet-lines:inset 0 0 0 var(--border) var(--color-surface-3);z-index:5;left:0}.pk-spreadsheet-preview__head{--pk-spreadsheet-lines:inset 0 var(--border) 0 var(--color-surface-3), inset calc(var(--border) * -1) calc(var(--border) * -1) 0 var(--color-surface-3)}.pk-spreadsheet-preview__row{--pk-spreadsheet-lines:inset var(--border) 0 0 var(--color-surface-3), inset calc(var(--border) * -1) calc(var(--border) * -1) 0 var(--color-surface-3);padding:0 var(--spacing-4);font-variant-numeric:tabular-nums;left:0}.pk-spreadsheet-preview__head--current{background-color:var(--color-surface-2);box-shadow:var(--pk-spreadsheet-lines), inset 0 calc((var(--spacing-2) + var(--border)) * -1) 0 var(--pk-spreadsheet-green-head);color:var(--pk-spreadsheet-green-head);font-weight:var(--font-medium)}.pk-spreadsheet-preview__row--current{background-color:var(--color-surface-2);box-shadow:var(--pk-spreadsheet-lines), inset calc((var(--spacing-2) + var(--border)) * -1) 0 0 var(--pk-spreadsheet-green-head);color:var(--pk-spreadsheet-green-head);font-weight:var(--font-medium)}.pk-spreadsheet-preview__cell[data-focus]{scroll-margin-top:var(--pk-spreadsheet-stuck-top);scroll-margin-left:var(--pk-spreadsheet-stuck-left);outline:var(--spacing-2) solid var(--pk-spreadsheet-green);outline-offset:calc(var(--spacing-2) * -1)}.pk-spreadsheet-preview__cell--range{background-image:linear-gradient(#1f1d2b1f,#1f1d2b1f)}.pk-spreadsheet-preview__cell--missing{color:#6b6880}.pk-spreadsheet-preview__cell--marked{background-image:linear-gradient(var(--pk-spreadsheet-mark), var(--pk-spreadsheet-mark));animation:pk-spreadsheet-preview-marked 3.5s var(--ease-out) forwards}@media (prefers-reduced-motion:reduce){.pk-spreadsheet-preview__cell--marked{--pk-spreadsheet-mark:#facc1573;animation:none}}.pk-spreadsheet-preview__more{padding:var(--spacing-8) var(--spacing-12);color:#6b6880;font-size:var(--text-12);margin:0;position:sticky;left:0}.pk-spreadsheet-preview__sheets{min-height:var(--spacing-32);padding-left:var(--spacing-40);border-top:var(--border) solid var(--color-surface-3);background-color:var(--color-surface-1);flex-shrink:0;display:flex;overflow-x:auto}@media (pointer:coarse){.pk-spreadsheet-preview__sheets{min-height:var(--spacing-40)}}.pk-spreadsheet-preview__status{min-height:var(--spacing-40);border-top:var(--border) solid var(--color-surface-3);background-color:var(--color-surface-1);font-size:var(--text-12);flex-shrink:0;align-items:center;display:flex}.pk-spreadsheet-preview__sheet{padding:0 var(--spacing-16);border:0;border-right:var(--border) solid var(--color-surface-3);color:var(--color-word-2);font:inherit;font-size:var(--text-12);white-space:nowrap;cursor:pointer;background:0 0;flex-shrink:0}.pk-spreadsheet-preview__sheet:first-child{border-left:var(--border) solid var(--color-surface-3)}.pk-spreadsheet-preview__sheet:hover{background-color:var(--color-surface-2)}.pk-spreadsheet-preview__sheet[aria-current=page]{background-color:var(--color-surface);box-shadow:inset 0 calc(var(--spacing-2) * -1) 0 var(--pk-spreadsheet-green-head);color:var(--pk-spreadsheet-green-head);font-weight:var(--font-semibold)}.pk-spreadsheet-preview__info{align-items:center;gap:var(--spacing-16);min-width:0;padding:0 var(--spacing-12);color:var(--color-word-2);font-variant-numeric:tabular-nums;white-space:nowrap;flex:1;margin:0;display:flex;overflow:hidden}.pk-spreadsheet-preview__note{min-width:0;color:var(--color-word-3);text-overflow:ellipsis;overflow:hidden}.pk-spreadsheet-preview__stats{gap:var(--spacing-12);flex-shrink:0;margin-left:auto;display:flex}@container (width<26rem){.pk-spreadsheet-preview__average{display:none}}.pk-spreadsheet-preview__zoom{align-items:center;gap:var(--spacing-2);padding-right:var(--spacing-8);flex-shrink:0;display:flex}.pk-spreadsheet-preview__percent{min-width:var(--spacing-40);font-variant-numeric:tabular-nums;text-align:center}@media (prefers-color-scheme:dark){:where(:host,:root,.theme):not(.theme--light) .pk-spreadsheet-preview{--pk-spreadsheet-green-head:#5fbf8f}}:where(.theme.theme--dark) .pk-spreadsheet-preview{--pk-spreadsheet-green-head:#5fbf8f}@property --pk-spreadsheet-mark{syntax:\"<color>\";inherits:false;initial-value:#0000}@keyframes pk-spreadsheet-preview-marked{0%,30%{--pk-spreadsheet-mark:#facc1573}to{--pk-spreadsheet-mark:#facc1500}}"]]]);
619
619
  // ../../packages/components/src/chat/PkWordPreviewRuns.vue?vue&type=script&setup=true&lang.ts
620
620
  x(), f(), C();
621
- var Ye = ["src"], Xe = {
621
+ var Xe = ["src"], Ze = {
622
622
  key: 1,
623
623
  class: "pk-word-preview__image",
624
624
  "data-quote-skip": ""
625
- }, Ze = ["title"], Qe = ["title"], $e = ["data-quote-skip"], Y = /* @__PURE__ */ E({
625
+ }, Qe = ["title"], $e = ["title"], et = ["data-quote-skip"], J = /* @__PURE__ */ E({
626
626
  __name: "PkWordPreviewRuns",
627
627
  props: {
628
628
  runs: { type: Array },
@@ -631,13 +631,13 @@ var Ye = ["src"], Xe = {
631
631
  numbers: { type: Object }
632
632
  },
633
633
  setup(e) {
634
- let n = e, { t: i } = ie({ useScope: "global" }), a = t(I, void 0), o = (e) => e.picture ? le(a?.value, e.picture.ref) : void 0, s = (e) => n.page ? P(e) : "inline", c = (e) => {
634
+ let n = e, { t: i } = re({ useScope: "global" }), a = t(I, void 0), o = (e) => e.picture ? ae(a?.value, e.picture.ref) : void 0, s = (e) => n.page ? L(e) : "inline", c = (e) => {
635
635
  let t = {
636
636
  width: `${e.width}pt`,
637
637
  aspectRatio: `${e.width} / ${e.height}`
638
638
  }, r = e.anchor, i = n.page;
639
639
  if (!r || !i) return t;
640
- let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o = P(e);
640
+ let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o = L(e);
641
641
  if (o === "around") {
642
642
  let n = i.width - i.margins.left - i.margins.right, o = a + e.width / 2 < n / 2;
643
643
  return {
@@ -659,11 +659,11 @@ var Ye = ["src"], Xe = {
659
659
  zIndex: r.wrap === "behind" ? -1 : 1
660
660
  };
661
661
  }, u = (e) => e.field && n.numbers ? String(n.numbers[e.field]) : e.text, d = b(() => {
662
- let e = oe(n.runs, n.mode ?? "markup"), t = (e) => !!e.picture && !!n.page && ["around", "block"].includes(P(e.picture));
662
+ let e = se(n.runs, n.mode ?? "markup"), t = (e) => !!e.picture && !!n.page && ["around", "block"].includes(L(e.picture));
663
663
  return [...e.filter(t), ...e.filter((e) => !t(e))];
664
664
  }), f = b(() => !n.mode || n.mode === "markup"), m = (e) => {
665
665
  let t = {};
666
- e.font && (t.fontFamily = F(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");
666
+ e.font && (t.fontFamily = ie(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");
667
667
  let n = [e.underline ? "underline" : "", e.strike ? "line-through" : ""].filter(Boolean).join(" ");
668
668
  return n && (t.textDecoration = n), e.caps && (t.textTransform = "uppercase"), e.vertAlign && (t.verticalAlign = e.vertAlign, t.fontSize = `${(e.size ?? 11) * .65}pt`), t;
669
669
  }, h = (e) => {
@@ -673,37 +673,37 @@ var Ye = ["src"], Xe = {
673
673
  textDecoration: [...n].join(" ")
674
674
  };
675
675
  }, g = (e) => e.author ? i("chatFilePreview.revisionBy", { author: e.author }) : void 0;
676
- return (e, t) => (k(!0), O(_, null, p(d.value, (e, t) => (k(), O(_, { key: t }, [e.image ? (k(), O(_, { key: 0 }, [e.picture && o(e) ? (k(), O(_, { key: 0 }, [s(e.picture) === "page" ? T("", !0) : (k(), O("img", {
676
+ return (e, t) => (A(!0), k(_, null, p(d.value, (e, t) => (A(), k(_, { key: t }, [e.image ? (A(), k(_, { key: 0 }, [e.picture && o(e) ? (A(), k(_, { key: 0 }, [s(e.picture) === "page" ? T("", !0) : (A(), k("img", {
677
677
  key: 0,
678
678
  class: r(["pk-word-preview__picture", `pk-word-preview__picture--${s(e.picture)}`]),
679
679
  style: l(c(e.picture)),
680
680
  src: o(e),
681
681
  alt: ""
682
- }, null, 14, Ye))], 64)) : (k(), O("span", Xe, S(D(i)("chatFilePreview.image")), 1))], 64)) : f.value && e.change === "deleted" ? (k(), O("del", {
682
+ }, null, 14, Xe))], 64)) : (A(), k("span", Ze, S(D(i)("chatFilePreview.image")), 1))], 64)) : f.value && e.change === "deleted" ? (A(), k("del", {
683
683
  key: 1,
684
684
  class: "pk-word-preview__removed",
685
685
  "data-quote-skip": "",
686
686
  style: l(h(e)),
687
687
  title: g(e)
688
- }, S(u(e)), 13, Ze)) : f.value && e.change === "inserted" ? (k(), O("ins", {
688
+ }, S(u(e)), 13, Qe)) : f.value && e.change === "inserted" ? (A(), k("ins", {
689
689
  key: 2,
690
690
  class: "pk-word-preview__added",
691
691
  style: l(h(e)),
692
692
  title: g(e)
693
- }, S(u(e)), 13, Qe)) : (k(), O("span", {
693
+ }, S(u(e)), 13, $e)) : (A(), k("span", {
694
694
  key: 3,
695
695
  style: l(m(e)),
696
696
  "data-quote-skip": e.label ? "" : void 0
697
- }, S(u(e)), 13, $e))], 64))), 128));
697
+ }, S(u(e)), 13, et))], 64))), 128));
698
698
  }
699
699
  });
700
700
  // ../../packages/components/src/chat/PkWordPreviewBlock.vue?vue&type=script&setup=true&lang.ts
701
701
  x(), f();
702
- var X = { key: 0 }, Z = ["data-paragraph", "colspan"], et = [
702
+ var Y = { key: 0 }, X = ["data-paragraph", "colspan"], tt = [
703
703
  "data-paragraph",
704
704
  "role",
705
705
  "aria-level"
706
- ], tt = { key: 1 }, nt = /* @__PURE__ */ E({
706
+ ], nt = { key: 1 }, rt = /* @__PURE__ */ E({
707
707
  __name: "PkWordPreviewBlock",
708
708
  props: {
709
709
  block: { type: null },
@@ -737,17 +737,17 @@ var X = { key: 0 }, Z = ["data-paragraph", "colspan"], et = [
737
737
  let e = t.block.widths ?? [], n = e.reduce((e, t) => e + t, 0);
738
738
  return n ? e.map((e) => `${e / n * 100}%`) : [];
739
739
  }), c = b(() => t.block.kind !== "table" && !!t.block.id && !!t.marked?.has(t.block.id)), u = (e) => !!e?.some((e) => t.marked?.has(e)), f = b(() => t.mode === "markup" && !!o.value?.some((e) => e.runs.some((e) => e.change)));
740
- return (t, m) => e.block.kind === "table" && o.value ? (k(), O("table", {
740
+ return (t, m) => e.block.kind === "table" && o.value ? (A(), k("table", {
741
741
  key: 0,
742
742
  class: r(["pk-word-preview__table", {
743
743
  "pk-word-preview__table--lines": e.block.borders,
744
744
  "pk-word-preview__table--next": e.row !== 0,
745
745
  "pk-word-preview__changed": f.value
746
746
  }])
747
- }, [s.value.length ? (k(), O("colgroup", X, [(k(!0), O(_, null, p(s.value, (e, t) => (k(), O("col", {
747
+ }, [s.value.length ? (A(), k("colgroup", Y, [(A(!0), k(_, null, p(s.value, (e, t) => (A(), k("col", {
748
748
  key: t,
749
749
  style: l({ width: e })
750
- }, null, 4))), 128))])) : T("", !0), v("tbody", null, [v("tr", null, [(k(!0), O(_, null, p(o.value, (t, n) => (k(), O("td", {
750
+ }, null, 4))), 128))])) : T("", !0), v("tbody", null, [v("tr", null, [(A(!0), k(_, null, p(o.value, (t, n) => (A(), k("td", {
751
751
  key: n,
752
752
  "data-paragraph": t.ids?.join(" "),
753
753
  class: r({ "pk-word-preview__marked": u(t.ids) }),
@@ -757,7 +757,7 @@ var X = { key: 0 }, Z = ["data-paragraph", "colspan"], et = [
757
757
  textAlign: t.align,
758
758
  fontSize: t.size ? `${t.size}pt` : void 0
759
759
  })
760
- }, [d(Y, {
760
+ }, [d(J, {
761
761
  runs: t.runs,
762
762
  mode: e.mode,
763
763
  numbers: e.numbers
@@ -765,7 +765,7 @@ var X = { key: 0 }, Z = ["data-paragraph", "colspan"], et = [
765
765
  "runs",
766
766
  "mode",
767
767
  "numbers"
768
- ])], 14, Z))), 128))])])], 2)) : e.block.kind === "table" ? T("", !0) : (k(), O("div", {
768
+ ])], 14, X))), 128))])])], 2)) : e.block.kind === "table" ? T("", !0) : (A(), k("div", {
769
769
  key: 1,
770
770
  class: r(["pk-word-preview__block", {
771
771
  "pk-word-preview__changed": a.value,
@@ -776,13 +776,13 @@ var X = { key: 0 }, Z = ["data-paragraph", "colspan"], et = [
776
776
  "aria-level": e.block.kind === "heading" ? Math.max(1, e.block.level) : void 0,
777
777
  style: l(n.value)
778
778
  }, [
779
- e.block.label ? (k(), O("span", {
779
+ e.block.label ? (A(), k("span", {
780
780
  key: 0,
781
781
  class: "pk-word-preview__label",
782
782
  "data-quote-skip": "",
783
783
  style: l(i.value)
784
784
  }, S(e.block.label), 5)) : T("", !0),
785
- d(Y, {
785
+ d(J, {
786
786
  runs: e.block.runs,
787
787
  mode: e.mode,
788
788
  page: e.page,
@@ -793,13 +793,13 @@ var X = { key: 0 }, Z = ["data-paragraph", "colspan"], et = [
793
793
  "page",
794
794
  "numbers"
795
795
  ]),
796
- !e.block.label && !e.block.runs.length ? (k(), O("br", tt)) : T("", !0)
797
- ], 14, et));
796
+ !e.block.label && !e.block.runs.length ? (A(), k("br", nt)) : T("", !0)
797
+ ], 14, tt));
798
798
  }
799
799
  });
800
800
  // ../../packages/components/src/chat/PkWordPreviewPart.vue?vue&type=script&setup=true&lang.ts
801
801
  x(), f();
802
- var rt = { class: "pk-word-preview__part" }, Q = ["src"], it = /* @__PURE__ */ E({
802
+ var it = { class: "pk-word-preview__part" }, Z = ["src"], at = /* @__PURE__ */ E({
803
803
  __name: "PkWordPreviewPart",
804
804
  props: {
805
805
  blocks: { type: Array },
@@ -809,11 +809,11 @@ var rt = { class: "pk-word-preview__part" }, Q = ["src"], it = /* @__PURE__ */ E
809
809
  numbers: { type: Object }
810
810
  },
811
811
  setup(e) {
812
- let n = e, r = t(I, void 0), i = b(() => N(n.blocks, n.mode)), a = b(() => ae(n.blocks, n.mode).flatMap((e) => {
813
- let t = le(r?.value, e.ref);
812
+ let n = e, r = t(I, void 0), i = b(() => F(n.blocks, n.mode)), a = b(() => oe(n.blocks, n.mode).flatMap((e) => {
813
+ let t = ae(r?.value, e.ref);
814
814
  return t ? [{
815
815
  src: t,
816
- css: ce(e, n.section.page)
816
+ css: P(e, n.section.page)
817
817
  }] : [];
818
818
  })), o = b(() => {
819
819
  let { margins: e } = n.section.page;
@@ -823,10 +823,10 @@ var rt = { class: "pk-word-preview__part" }, Q = ["src"], it = /* @__PURE__ */ E
823
823
  ...n.where === "header" ? { top: `${n.section.headerDistance}pt` } : { bottom: `${n.section.footerDistance}pt` }
824
824
  };
825
825
  });
826
- return (t, n) => (k(), O("div", rt, [v("div", {
826
+ return (t, n) => (A(), k("div", it, [v("div", {
827
827
  class: "pk-word-preview__part-flow",
828
828
  style: l(o.value)
829
- }, [(k(!0), O(_, null, p(i.value, (t) => (k(), h(nt, {
829
+ }, [(A(!0), k(_, null, p(i.value, (t) => (A(), h(rt, {
830
830
  key: t.key,
831
831
  block: e.blocks[t.block],
832
832
  row: t.row,
@@ -839,39 +839,39 @@ var rt = { class: "pk-word-preview__part" }, Q = ["src"], it = /* @__PURE__ */ E
839
839
  "mode",
840
840
  "page",
841
841
  "numbers"
842
- ]))), 128))], 4), (k(!0), O(_, null, p(a.value, (e, t) => (k(), O("img", {
842
+ ]))), 128))], 4), (A(!0), k(_, null, p(a.value, (e, t) => (A(), k("img", {
843
843
  key: t,
844
844
  class: "pk-word-preview__float",
845
845
  style: l(e.css),
846
846
  src: e.src,
847
847
  alt: ""
848
- }, null, 12, Q))), 128))]));
848
+ }, null, 12, Z))), 128))]));
849
849
  }
850
850
  });
851
851
  // ../../packages/components/src/chat/PkWordPreview.vue?vue&type=script&setup=true&lang.ts
852
852
  x(), C(), f();
853
- var at = ["aria-label"], ot = {
853
+ var ot = ["aria-label"], st = {
854
854
  class: "pk-word-preview__tabs",
855
855
  role: "tablist"
856
- }, st = ["aria-selected"], ct = ["aria-selected"], lt = {
856
+ }, ct = ["aria-selected"], lt = ["aria-selected"], ut = {
857
857
  key: 0,
858
858
  class: "pk-word-preview__list"
859
- }, $ = ["aria-current", "onClick"], ut = { class: "pk-word-preview__entry-text" }, dt = {
859
+ }, Q = ["aria-current", "onClick"], dt = { class: "pk-word-preview__entry-text" }, ft = {
860
860
  key: 0,
861
861
  class: "u-dot"
862
- }, ft = {
862
+ }, pt = {
863
863
  key: 0,
864
864
  class: "pk-word-preview__none"
865
- }, pt = {
865
+ }, mt = {
866
866
  key: 1,
867
867
  class: "pk-word-preview__list"
868
- }, mt = ["onClick"], ht = {
868
+ }, ht = ["onClick"], gt = {
869
869
  key: 0,
870
870
  class: "pk-word-preview__removed"
871
- }, gt = {
871
+ }, _t = {
872
872
  key: 1,
873
873
  class: "pk-word-preview__added"
874
- }, _t = { class: "pk-word-preview__main" }, vt = ["aria-label"], yt = ["src"], bt = {
874
+ }, vt = { class: "pk-word-preview__main" }, yt = ["aria-label"], $ = ["src"], bt = {
875
875
  key: 2,
876
876
  class: "pk-word-preview__truncated"
877
877
  }, xt = { class: "pk-word-preview__status" }, St = {
@@ -880,7 +880,7 @@ var at = ["aria-label"], ot = {
880
880
  }, Ct = { class: "pk-word-preview__count" }, wt = {
881
881
  key: 1,
882
882
  class: "pk-word-preview__legend"
883
- }, Tt = ["title"], Et = { class: "pk-word-preview__removed" }, Dt = { class: "pk-word-preview__added" }, Ot = { class: "pk-word-preview__percent" }, kt = ["data-part"], At = 96 / 72, jt = .5, Mt = /*#__PURE__*/ z(/* @__PURE__ */ E({
883
+ }, Tt = ["title"], Et = { class: "pk-word-preview__removed" }, Dt = { class: "pk-word-preview__added" }, Ot = { class: "pk-word-preview__percent" }, kt = ["data-part"], At = 96 / 72, jt = .5, Mt = /*#__PURE__*/ B(/* @__PURE__ */ E({
884
884
  __name: "PkWordPreview",
885
885
  props: /*@__PURE__*/ c({
886
886
  preview: { type: null },
@@ -897,24 +897,24 @@ var at = ["aria-label"], ot = {
897
897
  }),
898
898
  emits: /*@__PURE__*/ c(["select"], ["update:fit", "update:zoom"]),
899
899
  setup(e, { emit: t }) {
900
- let c = e, f = t, { t: g } = ie({ useScope: "global" });
900
+ let c = e, f = t, { t: g } = re({ useScope: "global" });
901
901
  n(I, b(() => c.preview.images));
902
- let ee = (e) => oe(e, c.mode), x = b(() => N(c.preview.blocks, c.mode)), C = m("rootEl"), w = m("scrollEl"), te = m("measureEl"), { width: ne } = ue(C), { width: E } = ue(w), re = b(() => ne.value >= 1e3), A = b(() => c.preview.sections?.length ? c.preview.sections : [{
902
+ let ee = (e) => se(e, c.mode), x = b(() => F(c.preview.blocks, c.mode)), C = m("rootEl"), w = m("scrollEl"), te = m("measureEl"), { width: ne } = le(C), { width: E } = le(w), O = b(() => ne.value >= 1e3), j = b(() => c.preview.sections?.length ? c.preview.sections : [{
903
903
  page: c.preview.page,
904
904
  headerDistance: 0,
905
905
  footerDistance: 0,
906
906
  headers: {},
907
907
  footers: {}
908
- }]), j = b(() => A.value[0].page), M = b(() => (E.value - 48) / (j.value.width * At)), P = b(() => ne.value === 0 || E.value === 0 || M.value >= jt), L = b(() => ({
909
- fontFamily: F(c.preview.defaults.font),
908
+ }]), M = b(() => j.value[0].page), N = b(() => (E.value - 48) / (M.value.width * At)), L = b(() => ne.value === 0 || E.value === 0 || N.value >= jt), R = b(() => ({
909
+ fontFamily: ie(c.preview.defaults.font),
910
910
  fontSize: `${c.preview.defaults.size}pt`,
911
911
  color: c.preview.defaults.color ?? "#000000",
912
- "--pk-word-line": se(c.preview.defaults.font),
912
+ "--pk-word-line": ce(c.preview.defaults.font),
913
913
  "--pk-word-size": `${c.preview.defaults.size}pt`
914
- })), de = b(() => j.value.width - j.value.margins.left - j.value.margins.right), R = b(() => ({
915
- ...L.value,
916
- width: `${de.value}pt`
917
- })), he = m("flowEl"), { width: z } = ue(he), ge = b(() => {
914
+ })), ue = b(() => M.value.width - M.value.margins.left - M.value.margins.right), z = b(() => ({
915
+ ...R.value,
916
+ width: `${ue.value}pt`
917
+ })), me = m("flowEl"), { width: B } = le(me), he = b(() => {
918
918
  let e = /* @__PURE__ */ new Map(), t = 0;
919
919
  for (let n of c.preview.blocks) {
920
920
  if (n.kind === "table") continue;
@@ -927,37 +927,37 @@ var at = ["aria-label"], ot = {
927
927
  let n = 0;
928
928
  for (let [r, i] of [...e].sort((e, t) => e[0] - t[0])) if (n += i, n > t / 10) return r;
929
929
  return 0;
930
- }), _e = b(() => ({
931
- ...L.value,
932
- "--pk-word-indent-shared": `${ge.value}pt`,
933
- "--pk-word-indent-scale": z.value ? Math.min(1, z.value / (de.value * At)) : 1
934
- })), B = y([]), V = y({}), H = async () => {
930
+ }), ge = b(() => ({
931
+ ...R.value,
932
+ "--pk-word-indent-shared": `${he.value}pt`,
933
+ "--pk-word-indent-scale": B.value ? Math.min(1, B.value / (ue.value * At)) : 1
934
+ })), V = y([]), _e = y({}), ve = async () => {
935
935
  await i();
936
936
  let e = te.value?.querySelectorAll("[data-item]");
937
- B.value = [...e ?? []].map((e) => e.getBoundingClientRect().height);
937
+ V.value = [...e ?? []].map((e) => e.getBoundingClientRect().height);
938
938
  let t = te.value?.querySelectorAll("[data-part]");
939
- V.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
939
+ _e.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
940
940
  };
941
941
  u([
942
942
  x,
943
- P,
943
+ L,
944
944
  () => c.preview.parts
945
- ], H, { flush: "post" }), s(() => {
946
- H(), document.fonts?.ready.then(H);
945
+ ], ve, { flush: "post" }), s(() => {
946
+ ve(), document.fonts?.ready.then(ve);
947
947
  });
948
- let U = b(() => {
949
- if (!P.value || B.value.length !== x.value.length) return [{
948
+ let H = b(() => {
949
+ if (!L.value || V.value.length !== x.value.length) return [{
950
950
  items: x.value.map((e, t) => t),
951
951
  section: 0,
952
952
  number: 1,
953
- top: j.value.margins.top,
954
- bottom: j.value.margins.bottom
953
+ top: M.value.margins.top,
954
+ bottom: M.value.margins.bottom
955
955
  }];
956
956
  let e = [], t = 0, n = !0, r = 0, i, a = () => {
957
- let r = A.value[t];
957
+ let r = j.value[t];
958
958
  return n && r.pageStart !== void 0 ? r.pageStart : (i ?? e[e.length - 1]?.number ?? 0) + 1;
959
959
  }, o = (e) => {
960
- let r = A.value[t], i = (t) => n && r.titlePage ? t.first : c.preview.evenAndOddHeaders && e % 2 == 0 ? t.even : t.default, a = i(r.headers), o = i(r.footers), s = (e) => e ? (V.value[e] ?? 0) / At : 0;
960
+ let r = j.value[t], i = (t) => n && r.titlePage ? t.first : c.preview.evenAndOddHeaders && e % 2 == 0 ? t.even : t.default, a = i(r.headers), o = i(r.footers), s = (e) => e ? (_e.value[e] ?? 0) / At : 0;
961
961
  return {
962
962
  header: a,
963
963
  footer: o,
@@ -974,42 +974,42 @@ var at = ["aria-label"], ot = {
974
974
  }), n = !1, r = 0;
975
975
  };
976
976
  return x.value.forEach((c, l) => {
977
- c.section !== void 0 && c.section !== t && A.value[c.section] && (t = c.section, n = c.breakBefore || !e.length, n || (i = A.value[t].pageStart));
978
- let u = e[e.length - 1], d = u && A.value[u.section].page, f = d ? (d.height - u.top - u.bottom) * At : 0, p = B.value[l];
979
- for (let e = l; x.value[e]?.keepNext && e + 1 < x.value.length && !x.value[e + 1].breakBefore; e++) p += B.value[e + 1];
980
- (!u || u.items.length && (c.breakBefore || r + B.value[l] > f || r + p > f && p <= (() => {
977
+ c.section !== void 0 && c.section !== t && j.value[c.section] && (t = c.section, n = c.breakBefore || !e.length, n || (i = j.value[t].pageStart));
978
+ let u = e[e.length - 1], d = u && j.value[u.section].page, f = d ? (d.height - u.top - u.bottom) * At : 0, p = V.value[l];
979
+ for (let e = l; x.value[e]?.keepNext && e + 1 < x.value.length && !x.value[e + 1].breakBefore; e++) p += V.value[e + 1];
980
+ (!u || u.items.length && (c.breakBefore || r + V.value[l] > f || r + p > f && p <= (() => {
981
981
  let e = o(a());
982
- return (A.value[t].page.height - e.top - e.bottom) * At;
983
- })())) && s(), e[e.length - 1].items.push(l), r += B.value[l];
982
+ return (j.value[t].page.height - e.top - e.bottom) * At;
983
+ })())) && s(), e[e.length - 1].items.push(l), r += V.value[l];
984
984
  }), e.length || s(), e;
985
- }), W = b(() => {
985
+ }), U = b(() => {
986
986
  let e = /* @__PURE__ */ new Map();
987
- for (let t of U.value) e.set(t.section, (e.get(t.section) ?? 0) + 1);
988
- return U.value.map((t) => ({
987
+ for (let t of H.value) e.set(t.section, (e.get(t.section) ?? 0) + 1);
988
+ return H.value.map((t) => ({
989
989
  page: t.number,
990
- pages: U.value.length,
990
+ pages: H.value.length,
991
991
  sectionPages: e.get(t.section) ?? 1
992
992
  }));
993
- }), G = (e) => {
994
- let t = A.value[e.section].page;
993
+ }), W = (e) => {
994
+ let t = j.value[e.section].page;
995
995
  return {
996
- ...L.value,
996
+ ...R.value,
997
997
  width: `${t.width}pt`,
998
998
  minHeight: `${t.height}pt`,
999
999
  padding: `${e.top}pt ${t.margins.right}pt ${e.bottom}pt ${t.margins.left}pt`
1000
1000
  };
1001
- }, ve = (e) => {
1001
+ }, ye = (e) => {
1002
1002
  let t = [...new Set(e.items.map((e) => x.value[e].block))];
1003
- return ae(t.map((e) => c.preview.blocks[e]), c.mode).flatMap((t) => {
1004
- let n = le(c.preview.images, t.ref);
1003
+ return oe(t.map((e) => c.preview.blocks[e]), c.mode).flatMap((t) => {
1004
+ let n = ae(c.preview.images, t.ref);
1005
1005
  return n ? [{
1006
1006
  src: n,
1007
- css: ce(t, A.value[e.section].page)
1007
+ css: P(t, j.value[e.section].page)
1008
1008
  }] : [];
1009
1009
  });
1010
- }, K = o(e, "fit"), ye = o(e, "zoom"), q = b(() => K.value ? Math.min(1.25, Math.max(.3, M.value)) : ye.value), be = (e) => {
1011
- ye.value = Math.min(2, Math.max(.3, Math.round((q.value + e) * 10) / 10)), K.value = !1;
1012
- }, xe = y(0), Ce = y(), we = () => {
1010
+ }, G = o(e, "fit"), be = o(e, "zoom"), K = b(() => G.value ? Math.min(1.25, Math.max(.3, N.value)) : be.value), xe = (e) => {
1011
+ be.value = Math.min(2, Math.max(.3, Math.round((K.value + e) * 10) / 10)), G.value = !1;
1012
+ }, Se = y(0), we = y(), Te = () => {
1013
1013
  let e = w.value?.getBoundingClientRect();
1014
1014
  if (!e) return;
1015
1015
  let t = w.value?.querySelectorAll("[data-page]") ?? [], n = 0;
@@ -1017,133 +1017,133 @@ var at = ["aria-label"], ot = {
1017
1017
  if (i.getBoundingClientRect().top - e.top > e.height / 3) break;
1018
1018
  n = r;
1019
1019
  }
1020
- xe.value = n;
1020
+ Se.value = n;
1021
1021
  let r;
1022
- for (let t of ke.value) {
1022
+ for (let t of Ae.value) {
1023
1023
  let n = w.value?.querySelector(`[data-key="${t.key}"]`);
1024
1024
  if (n) {
1025
1025
  if (n.getBoundingClientRect().top - e.top > 48) break;
1026
1026
  r = t.key;
1027
1027
  }
1028
1028
  }
1029
- Ce.value = r ?? ke.value[0]?.key;
1030
- }, Te = 0, Ee = () => {
1031
- Te ||= requestAnimationFrame(() => {
1032
- Te = 0, we();
1029
+ we.value = r ?? Ae.value[0]?.key;
1030
+ }, Ee = 0, De = () => {
1031
+ Ee ||= requestAnimationFrame(() => {
1032
+ Ee = 0, Te();
1033
1033
  });
1034
1034
  };
1035
- a(() => cancelAnimationFrame(Te)), u(U, () => i(Ee));
1036
- let { selection: De } = pe({
1035
+ a(() => cancelAnimationFrame(Ee)), u(H, () => i(De));
1036
+ let { selection: Oe } = fe({
1037
1037
  root: () => w.value?.getRootNode(),
1038
1038
  touch: !0
1039
1039
  });
1040
- u(De, (e) => {
1040
+ u(Oe, (e) => {
1041
1041
  let t = w.value;
1042
- f("select", e && t ? Se(t, e.range, ".pk-word-preview__measure, .pk-word-preview__part") : void 0);
1042
+ f("select", e && t ? Ce(t, e.range, ".pk-word-preview__measure, .pk-word-preview__part") : void 0);
1043
1043
  });
1044
- let Oe = (e) => ee(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), ke = b(() => x.value.flatMap((e) => {
1045
- let t = c.preview.blocks[e.block], n = t.kind === "heading" ? [t.label, Oe(t.runs)].filter(Boolean).join(" ") : "";
1044
+ let ke = (e) => ee(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), Ae = b(() => x.value.flatMap((e) => {
1045
+ let t = c.preview.blocks[e.block], n = t.kind === "heading" ? [t.label, ke(t.runs)].filter(Boolean).join(" ") : "";
1046
1046
  return t.kind === "heading" && t.level <= 3 && n ? [{
1047
1047
  key: e.key,
1048
1048
  level: t.level,
1049
1049
  text: n
1050
1050
  }] : [];
1051
- })), Ae = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, J = b(() => x.value.flatMap((e) => {
1051
+ })), je = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, q = b(() => x.value.flatMap((e) => {
1052
1052
  let t = c.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(), i = n.filter((e) => e.change === "inserted").map((e) => e.text).join(" ").trim();
1053
1053
  return r || i ? [{
1054
1054
  key: e.key,
1055
- removed: Ae(r),
1056
- added: Ae(i)
1055
+ removed: je(r),
1056
+ added: je(i)
1057
1057
  }] : [];
1058
- })), je;
1059
- u([() => c.marked, U], ([e]) => {
1060
- !e || e === je || P.value && B.value.length !== x.value.length || me(w.value, ".pk-word-preview__marked") && (je = e);
1058
+ })), Me;
1059
+ u([() => c.marked, H], ([e]) => {
1060
+ !e || e === Me || L.value && V.value.length !== x.value.length || pe(w.value, ".pk-word-preview__marked") && (Me = e);
1061
1061
  }, {
1062
1062
  flush: "post",
1063
1063
  immediate: !0
1064
1064
  });
1065
- let Me = y("outline"), Ne = y(!1), Pe = (e) => {
1065
+ let Ne = y("outline"), Pe = y(!1), Fe = (e) => {
1066
1066
  w.value?.querySelector(`[data-key="${e}"]`)?.scrollIntoView({
1067
1067
  block: "start",
1068
1068
  behavior: "smooth"
1069
- }), re.value || (Ne.value = !1);
1070
- }, Fe = b(() => c.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => Oe(e.runs)) : [Oe(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), Ie = b(() => c.preview.revisionAuthors.join(", "));
1069
+ }), O.value || (Pe.value = !1);
1070
+ }, Ie = b(() => c.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => ke(e.runs)) : [ke(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), Le = b(() => c.preview.revisionAuthors.join(", "));
1071
1071
  return (t, n) => {
1072
- let i = fe;
1073
- return k(), O("div", {
1072
+ let i = de;
1073
+ return A(), k("div", {
1074
1074
  ref_key: "rootEl",
1075
1075
  ref: C,
1076
- class: r(["pk-word-preview", { "pk-word-preview--paged": P.value }])
1076
+ class: r(["pk-word-preview", { "pk-word-preview--paged": L.value }])
1077
1077
  }, [
1078
- (re.value || Ne.value) && (ke.value.length || J.value.length) ? (k(), O("aside", {
1078
+ (O.value || Pe.value) && (Ae.value.length || q.value.length) ? (A(), k("aside", {
1079
1079
  key: 0,
1080
- class: r(["pk-word-preview__side", { "pk-word-preview__side--over": !re.value }]),
1080
+ class: r(["pk-word-preview__side", { "pk-word-preview__side--over": !O.value }]),
1081
1081
  "aria-label": D(g)("chatFilePreview.outline")
1082
- }, [v("div", ot, [v("button", {
1082
+ }, [v("div", st, [v("button", {
1083
1083
  type: "button",
1084
1084
  role: "tab",
1085
1085
  class: "pk-word-preview__tab",
1086
- "aria-selected": Me.value === "outline",
1087
- onClick: n[0] ||= (e) => Me.value = "outline"
1088
- }, S(D(g)("chatFilePreview.outline")), 9, st), J.value.length ? (k(), O("button", {
1086
+ "aria-selected": Ne.value === "outline",
1087
+ onClick: n[0] ||= (e) => Ne.value = "outline"
1088
+ }, S(D(g)("chatFilePreview.outline")), 9, ct), q.value.length ? (A(), k("button", {
1089
1089
  key: 0,
1090
1090
  type: "button",
1091
1091
  role: "tab",
1092
1092
  class: "pk-word-preview__tab",
1093
- "aria-selected": Me.value === "changes",
1094
- onClick: n[1] ||= (e) => Me.value = "changes"
1095
- }, S(D(g)("chatFilePreview.changes", { count: J.value.length })), 9, ct)) : T("", !0)]), Me.value === "outline" || !J.value.length ? (k(), O("nav", lt, [(k(!0), O(_, null, p(ke.value, (e) => (k(), O("button", {
1093
+ "aria-selected": Ne.value === "changes",
1094
+ onClick: n[1] ||= (e) => Ne.value = "changes"
1095
+ }, S(D(g)("chatFilePreview.changes", { count: q.value.length })), 9, lt)) : T("", !0)]), Ne.value === "outline" || !q.value.length ? (A(), k("nav", ut, [(A(!0), k(_, null, p(Ae.value, (e) => (A(), k("button", {
1096
1096
  key: e.key,
1097
1097
  type: "button",
1098
1098
  class: r(["pk-word-preview__entry", `pk-word-preview__entry--${Math.min(e.level, 3)}`]),
1099
- "aria-current": Ce.value === e.key ? "location" : void 0,
1100
- onClick: (t) => Pe(e.key)
1101
- }, [v("span", ut, S(e.text), 1), J.value.some((t) => t.key === e.key) ? (k(), O("span", dt)) : T("", !0)], 10, $))), 128)), ke.value.length ? T("", !0) : (k(), O("p", ft, S(D(g)("chatFilePreview.noHeadings")), 1))])) : (k(), O("nav", pt, [(k(!0), O(_, null, p(J.value, (e) => (k(), O("button", {
1099
+ "aria-current": we.value === e.key ? "location" : void 0,
1100
+ onClick: (t) => Fe(e.key)
1101
+ }, [v("span", dt, S(e.text), 1), q.value.some((t) => t.key === e.key) ? (A(), k("span", ft)) : T("", !0)], 10, Q))), 128)), Ae.value.length ? T("", !0) : (A(), k("p", pt, S(D(g)("chatFilePreview.noHeadings")), 1))])) : (A(), k("nav", mt, [(A(!0), k(_, null, p(q.value, (e) => (A(), k("button", {
1102
1102
  key: e.key,
1103
1103
  type: "button",
1104
1104
  class: "pk-word-preview__entry pk-word-preview__entry--change",
1105
- onClick: (t) => Pe(e.key)
1106
- }, [e.removed ? (k(), O("del", ht, S(e.removed), 1)) : T("", !0), e.added ? (k(), O("ins", gt, S(e.added), 1)) : T("", !0)], 8, mt))), 128))]))], 10, at)) : T("", !0),
1107
- v("div", _t, [v("div", {
1105
+ onClick: (t) => Fe(e.key)
1106
+ }, [e.removed ? (A(), k("del", gt, S(e.removed), 1)) : T("", !0), e.added ? (A(), k("ins", _t, S(e.added), 1)) : T("", !0)], 8, ht))), 128))]))], 10, ot)) : T("", !0),
1107
+ v("div", vt, [v("div", {
1108
1108
  ref_key: "scrollEl",
1109
1109
  ref: w,
1110
1110
  class: "pk-word-preview__scroll",
1111
- onScroll: Ee
1112
- }, [P.value ? (k(), O("div", {
1111
+ onScroll: De
1112
+ }, [L.value ? (A(), k("div", {
1113
1113
  key: 0,
1114
1114
  class: "pk-word-preview__pages",
1115
- style: l({ zoom: q.value })
1116
- }, [(k(!0), O(_, null, p(U.value, (t, n) => (k(), O("article", {
1115
+ style: l({ zoom: K.value })
1116
+ }, [(A(!0), k(_, null, p(H.value, (t, n) => (A(), k("article", {
1117
1117
  key: n,
1118
1118
  "data-page": "",
1119
1119
  class: "pk-word-preview__page",
1120
1120
  "aria-label": D(g)("chatFilePreview.pageOf", {
1121
1121
  page: n + 1,
1122
- count: U.value.length
1122
+ count: H.value.length
1123
1123
  }),
1124
- style: l(G(t))
1124
+ style: l(W(t))
1125
1125
  }, [
1126
- t.header && e.preview.parts?.[t.header] ? (k(), h(it, {
1126
+ t.header && e.preview.parts?.[t.header] ? (A(), h(at, {
1127
1127
  key: 0,
1128
1128
  blocks: e.preview.parts[t.header],
1129
1129
  where: "header",
1130
- section: A.value[t.section],
1130
+ section: j.value[t.section],
1131
1131
  mode: e.mode,
1132
- numbers: W.value[n]
1132
+ numbers: U.value[n]
1133
1133
  }, null, 8, [
1134
1134
  "blocks",
1135
1135
  "section",
1136
1136
  "mode",
1137
1137
  "numbers"
1138
1138
  ])) : T("", !0),
1139
- (k(!0), O(_, null, p(t.items, (r) => (k(), h(nt, {
1139
+ (A(!0), k(_, null, p(t.items, (r) => (A(), h(rt, {
1140
1140
  key: x.value[r].key,
1141
1141
  "data-key": x.value[r].key,
1142
1142
  block: e.preview.blocks[x.value[r].block],
1143
1143
  row: x.value[r].row,
1144
1144
  mode: e.mode,
1145
- page: A.value[t.section].page,
1146
- numbers: W.value[n],
1145
+ page: j.value[t.section].page,
1146
+ numbers: U.value[n],
1147
1147
  marked: e.marked
1148
1148
  }, null, 8, [
1149
1149
  "data-key",
@@ -1154,33 +1154,33 @@ var at = ["aria-label"], ot = {
1154
1154
  "numbers",
1155
1155
  "marked"
1156
1156
  ]))), 128)),
1157
- (k(!0), O(_, null, p(ve(t), (e, t) => (k(), O("img", {
1157
+ (A(!0), k(_, null, p(ye(t), (e, t) => (A(), k("img", {
1158
1158
  key: `image-${t}`,
1159
1159
  class: "pk-word-preview__float",
1160
1160
  style: l(e.css),
1161
1161
  src: e.src,
1162
1162
  alt: ""
1163
- }, null, 12, yt))), 128)),
1164
- t.footer && e.preview.parts?.[t.footer] ? (k(), h(it, {
1163
+ }, null, 12, $))), 128)),
1164
+ t.footer && e.preview.parts?.[t.footer] ? (A(), h(at, {
1165
1165
  key: 1,
1166
1166
  blocks: e.preview.parts[t.footer],
1167
1167
  where: "footer",
1168
- section: A.value[t.section],
1168
+ section: j.value[t.section],
1169
1169
  mode: e.mode,
1170
- numbers: W.value[n]
1170
+ numbers: U.value[n]
1171
1171
  }, null, 8, [
1172
1172
  "blocks",
1173
1173
  "section",
1174
1174
  "mode",
1175
1175
  "numbers"
1176
1176
  ])) : T("", !0)
1177
- ], 12, vt))), 128))], 4)) : (k(), O("article", {
1177
+ ], 12, yt))), 128))], 4)) : (A(), k("article", {
1178
1178
  key: 1,
1179
1179
  ref_key: "flowEl",
1180
- ref: he,
1180
+ ref: me,
1181
1181
  class: "pk-word-preview__page pk-word-preview__page--flow",
1182
- style: l(_e.value)
1183
- }, [(k(!0), O(_, null, p(x.value, (t) => (k(), h(nt, {
1182
+ style: l(ge.value)
1183
+ }, [(A(!0), k(_, null, p(x.value, (t) => (A(), h(rt, {
1184
1184
  key: t.key,
1185
1185
  "data-key": t.key,
1186
1186
  block: e.preview.blocks[t.block],
@@ -1193,22 +1193,22 @@ var at = ["aria-label"], ot = {
1193
1193
  "row",
1194
1194
  "mode",
1195
1195
  "marked"
1196
- ]))), 128))], 4)), e.preview.truncated ? (k(), O("p", bt, S(D(g)("chatFilePreview.truncated")), 1)) : T("", !0)], 544), v("div", xt, [
1197
- P.value ? (k(), O("span", St, S(D(g)("chatFilePreview.pageOf", {
1198
- page: xe.value + 1,
1199
- count: U.value.length
1196
+ ]))), 128))], 4)), e.preview.truncated ? (A(), k("p", bt, S(D(g)("chatFilePreview.truncated")), 1)) : T("", !0)], 544), v("div", xt, [
1197
+ L.value ? (A(), k("span", St, S(D(g)("chatFilePreview.pageOf", {
1198
+ page: Se.value + 1,
1199
+ count: H.value.length
1200
1200
  })), 1)) : T("", !0),
1201
- v("span", Ct, S(D(g)("chatFilePreview.words", Fe.value)), 1),
1202
- e.mode === "markup" && e.preview.revisionAuthors.length ? (k(), O("span", wt, [
1201
+ v("span", Ct, S(D(g)("chatFilePreview.words", Ie.value)), 1),
1202
+ e.mode === "markup" && e.preview.revisionAuthors.length ? (A(), k("span", wt, [
1203
1203
  v("span", {
1204
1204
  class: "pk-word-preview__legend-text",
1205
- title: D(g)("chatFilePreview.revisionsOf", { authors: Ie.value })
1206
- }, S(D(g)("chatFilePreview.revisionsOf", { authors: Ie.value })), 9, Tt),
1205
+ title: D(g)("chatFilePreview.revisionsOf", { authors: Le.value })
1206
+ }, S(D(g)("chatFilePreview.revisionsOf", { authors: Le.value })), 9, Tt),
1207
1207
  v("del", Et, S(D(g)("chatFilePreview.removed")), 1),
1208
1208
  v("ins", Dt, S(D(g)("chatFilePreview.added")), 1)
1209
1209
  ])) : T("", !0),
1210
1210
  n[6] ||= v("span", { class: "pk-word-preview__spacer" }, null, -1),
1211
- !re.value && (ke.value.length || J.value.length) ? (k(), h(i, {
1211
+ !O.value && (Ae.value.length || q.value.length) ? (A(), h(i, {
1212
1212
  key: 2,
1213
1213
  class: "pk-word-preview__outline-toggle",
1214
1214
  modifiers: "action-quiet",
@@ -1216,15 +1216,15 @@ var at = ["aria-label"], ot = {
1216
1216
  label: D(g)("chatFilePreview.outline"),
1217
1217
  title: D(g)("chatFilePreview.outline"),
1218
1218
  "aria-label": D(g)("chatFilePreview.outline"),
1219
- "aria-expanded": Ne.value,
1220
- onClick: n[2] ||= (e) => Ne.value = !Ne.value
1219
+ "aria-expanded": Pe.value,
1220
+ onClick: n[2] ||= (e) => Pe.value = !Pe.value
1221
1221
  }, null, 8, [
1222
1222
  "label",
1223
1223
  "title",
1224
1224
  "aria-label",
1225
1225
  "aria-expanded"
1226
1226
  ])) : T("", !0),
1227
- P.value ? (k(), O(_, { key: 3 }, [
1227
+ L.value ? (A(), k(_, { key: 3 }, [
1228
1228
  d(i, {
1229
1229
  class: "pk-word-preview__fit",
1230
1230
  modifiers: "action-quiet",
@@ -1232,8 +1232,8 @@ var at = ["aria-label"], ot = {
1232
1232
  label: D(g)("chatFilePreview.fitWidth"),
1233
1233
  title: D(g)("chatFilePreview.fitWidth"),
1234
1234
  "aria-label": D(g)("chatFilePreview.fitWidth"),
1235
- disabled: K.value,
1236
- onClick: n[3] ||= (e) => K.value = !0
1235
+ disabled: G.value,
1236
+ onClick: n[3] ||= (e) => G.value = !0
1237
1237
  }, null, 8, [
1238
1238
  "label",
1239
1239
  "title",
@@ -1244,48 +1244,48 @@ var at = ["aria-label"], ot = {
1244
1244
  modifiers: "action-quiet",
1245
1245
  icon: "ri:subtract-line",
1246
1246
  "aria-label": D(g)("chatFilePreview.zoomOut"),
1247
- disabled: q.value <= .3,
1248
- onClick: n[4] ||= (e) => be(-.1)
1247
+ disabled: K.value <= .3,
1248
+ onClick: n[4] ||= (e) => xe(-.1)
1249
1249
  }, null, 8, ["aria-label", "disabled"]),
1250
- v("span", Ot, S(Math.round(q.value * 100)) + "% ", 1),
1250
+ v("span", Ot, S(Math.round(K.value * 100)) + "% ", 1),
1251
1251
  d(i, {
1252
1252
  modifiers: "action-quiet",
1253
1253
  icon: "ri:add-line",
1254
1254
  "aria-label": D(g)("chatFilePreview.zoomIn"),
1255
- disabled: q.value >= 2,
1256
- onClick: n[5] ||= (e) => be(.1)
1255
+ disabled: K.value >= 2,
1256
+ onClick: n[5] ||= (e) => xe(.1)
1257
1257
  }, null, 8, ["aria-label", "disabled"])
1258
1258
  ], 64)) : T("", !0)
1259
1259
  ])]),
1260
- P.value ? (k(), O("div", {
1260
+ L.value ? (A(), k("div", {
1261
1261
  key: 1,
1262
1262
  ref_key: "measureEl",
1263
1263
  ref: te,
1264
1264
  class: "pk-word-preview__measure",
1265
1265
  "aria-hidden": "true",
1266
- style: l(R.value)
1267
- }, [(k(!0), O(_, null, p(x.value, (t) => (k(), O("div", {
1266
+ style: l(z.value)
1267
+ }, [(A(!0), k(_, null, p(x.value, (t) => (A(), k("div", {
1268
1268
  key: t.key,
1269
1269
  "data-item": ""
1270
- }, [d(nt, {
1270
+ }, [d(rt, {
1271
1271
  block: e.preview.blocks[t.block],
1272
1272
  row: t.row,
1273
1273
  mode: e.mode,
1274
- page: j.value
1274
+ page: M.value
1275
1275
  }, null, 8, [
1276
1276
  "block",
1277
1277
  "row",
1278
1278
  "mode",
1279
1279
  "page"
1280
- ])]))), 128)), (k(!0), O(_, null, p(e.preview.parts, (t, n) => (k(), O("div", {
1280
+ ])]))), 128)), (A(!0), k(_, null, p(e.preview.parts, (t, n) => (A(), k("div", {
1281
1281
  key: n,
1282
1282
  "data-part": n
1283
- }, [(k(!0), O(_, null, p(D(N)(t, e.mode), (n) => (k(), h(nt, {
1283
+ }, [(A(!0), k(_, null, p(D(F)(t, e.mode), (n) => (A(), h(rt, {
1284
1284
  key: n.key,
1285
1285
  block: t[n.block],
1286
1286
  row: n.row,
1287
1287
  mode: e.mode,
1288
- page: j.value
1288
+ page: M.value
1289
1289
  }, null, 8, [
1290
1290
  "block",
1291
1291
  "row",
@@ -1353,7 +1353,7 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
1353
1353
  "update:fit"
1354
1354
  ]),
1355
1355
  setup(e, { emit: t }) {
1356
- let n = e, a = t, { t: s, locale: c } = ie({ useScope: "global" }), l = b(() => n.versions ?? []), f = b(() => n.version ? l.value.indexOf(n.version) : -1), g = b(() => f.value > 0 ? l.value[f.value - 1] : void 0), ee = b(() => f.value >= 0 && f.value < l.value.length - 1 ? l.value[f.value + 1] : void 0), x = o(e, "mode"), C = o(e, "sheet"), w = o(e, "zoom"), E = o(e, "fit"), re = b(() => [
1356
+ let n = e, a = t, { t: s, locale: c } = re({ useScope: "global" }), l = b(() => n.versions ?? []), f = b(() => n.version ? l.value.indexOf(n.version) : -1), g = b(() => f.value > 0 ? l.value[f.value - 1] : void 0), ee = b(() => f.value >= 0 && f.value < l.value.length - 1 ? l.value[f.value + 1] : void 0), x = o(e, "mode"), C = o(e, "sheet"), w = o(e, "zoom"), E = o(e, "fit"), O = b(() => [
1357
1357
  {
1358
1358
  value: "markup",
1359
1359
  label: s("chatFilePreview.modeMarkup")
@@ -1366,47 +1366,47 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
1366
1366
  value: "original",
1367
1367
  label: s("chatFilePreview.modeOriginal")
1368
1368
  }
1369
- ]), A = b(() => n.preview?.kind === "word" && n.preview.revisionAuthors.length > 0);
1369
+ ]), j = b(() => n.preview?.kind === "word" && n.preview.revisionAuthors.length > 0);
1370
1370
  u(() => n.version, () => {
1371
1371
  x.value = "markup";
1372
1372
  });
1373
- let j = m("rootEl"), M = ne(), N = y(!1), ae = () => {
1374
- M.value = void 0, N.value = !1;
1373
+ let M = m("rootEl"), N = ne(), P = y(!1), ie = () => {
1374
+ N.value = void 0, P.value = !1;
1375
1375
  };
1376
1376
  u(() => [
1377
1377
  n.version,
1378
1378
  n.preview,
1379
1379
  x.value,
1380
1380
  C.value
1381
- ], ae);
1382
- let oe = (e) => {
1383
- N.value || (M.value = e);
1384
- }, P = b(() => M.value?.format === "docx" && R());
1385
- u(N, async (e, t) => {
1386
- let n = M.value;
1381
+ ], ie);
1382
+ let ae = (e) => {
1383
+ P.value || (N.value = e);
1384
+ }, oe = b(() => N.value?.format === "docx" && z());
1385
+ u(P, async (e, t) => {
1386
+ let n = N.value;
1387
1387
  t && !e && n?.format === "docx" && (await i(), n.restore());
1388
1388
  });
1389
1389
  let se = b(() => !n.version || n.version === l.value[l.value.length - 1]), F = () => {
1390
1390
  let e = l.value[l.value.length - 1];
1391
1391
  e && a("version", e);
1392
1392
  }, ce = b(() => {
1393
- let e = M.value;
1394
- return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) > _e;
1395
- }), I = b(() => M.value?.format === "docx" && x.value === "original"), le = b(() => ce.value || I.value), ue = b(() => I.value ? s("selectionActions.hintOriginal") : ce.value ? s(M.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: M.value?.format === "docx" ? 200 : _e }) : void 0), pe = (e) => e[c.value] ?? e[c.value.split("-")[0]] ?? Object.values(e)[0] ?? "", me = ["explain", "summarize"], z = b(() => {
1396
- let e = M.value, t = n.selectionActions;
1393
+ let e = N.value;
1394
+ return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) > ge;
1395
+ }), I = b(() => N.value?.format === "docx" && x.value === "original"), L = b(() => ce.value || I.value), le = b(() => I.value ? s("selectionActions.hintOriginal") : ce.value ? s(N.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: N.value?.format === "docx" ? 200 : ge }) : void 0), fe = (e) => e[c.value] ?? e[c.value.split("-")[0]] ?? Object.values(e)[0] ?? "", pe = ["explain", "summarize"], B = b(() => {
1396
+ let e = N.value, t = n.selectionActions;
1397
1397
  if (!e || !t) return [];
1398
1398
  let r = e.format;
1399
- return [...(r === "docx" && le.value ? me : t.builtIns).map((e) => ({
1399
+ return [...(r === "docx" && L.value ? pe : t.builtIns).map((e) => ({
1400
1400
  id: e,
1401
1401
  label: s(`selectionActions.builtIn.${e}`),
1402
1402
  ...e === "translate" && { asks: s("selectionActions.translateAsks") },
1403
1403
  prompt: (t) => s(`selectionActions.prompt.${r}.${e}`, { language: t ?? "" })
1404
- })), ...(le.value ? [] : t.actions).map((e) => ({
1404
+ })), ...(L.value ? [] : t.actions).map((e) => ({
1405
1405
  id: e.id,
1406
- label: pe(e.label),
1407
- prompt: () => pe(e.prompt)
1406
+ label: fe(e.label),
1407
+ prompt: () => fe(e.prompt)
1408
1408
  }))];
1409
- }), B = (e) => {
1409
+ }), V = (e) => {
1410
1410
  if (e.format === "docx") return s("selectionActions.labelParagraphs", {
1411
1411
  file: n.filename,
1412
1412
  count: e.paragraphCount
@@ -1422,13 +1422,13 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
1422
1422
  sheet: e.sheet,
1423
1423
  cell: t
1424
1424
  });
1425
- }, V = (e) => {
1425
+ }, _e = (e) => {
1426
1426
  if (!n.fileId || !n.storedFileName) return;
1427
1427
  let t = {
1428
1428
  fileId: n.fileId,
1429
1429
  version: n.version ?? 1,
1430
1430
  storedFileName: n.storedFileName,
1431
- label: B(e).slice(0, 200)
1431
+ label: V(e).slice(0, 200)
1432
1432
  };
1433
1433
  if (e.format === "docx") {
1434
1434
  let { measure: n, ...r } = e;
@@ -1443,23 +1443,23 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
1443
1443
  ...t,
1444
1444
  ...a
1445
1445
  };
1446
- }, H = (e, t) => {
1447
- let n = M.value, r = n && V(n);
1446
+ }, ve = (e, t) => {
1447
+ let n = N.value, r = n && _e(n);
1448
1448
  r && (a("selectionSend", e, r, {
1449
1449
  id: t,
1450
1450
  size: n.format === "docx" ? n.paragraphCount : n.cells
1451
- }), ae(), document.getSelection()?.removeAllRanges());
1452
- }, U = (e, t) => {
1453
- let n = z.value.find((t) => t.id === e);
1454
- n && H(n.prompt(t), e);
1455
- }, W = y(0);
1456
- L(j, "scroll", () => W.value++, {
1451
+ }), ie(), document.getSelection()?.removeAllRanges());
1452
+ }, H = (e, t) => {
1453
+ let n = B.value.find((t) => t.id === e);
1454
+ n && ve(n.prompt(t), e);
1455
+ }, U = y(0);
1456
+ R(M, "scroll", () => U.value++, {
1457
1457
  capture: !0,
1458
1458
  passive: !0
1459
- }), L(window, "resize", () => W.value++, { passive: !0 });
1460
- let G = b(() => {
1461
- W.value;
1462
- let e = M.value?.measure(), t = j.value?.getBoundingClientRect();
1459
+ }), R(window, "resize", () => U.value++, { passive: !0 });
1460
+ let W = b(() => {
1461
+ U.value;
1462
+ let e = N.value?.measure(), t = M.value?.getBoundingClientRect();
1463
1463
  if (e && t) return {
1464
1464
  start: {
1465
1465
  top: e.start.top - t.top,
@@ -1475,10 +1475,10 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
1475
1475
  };
1476
1476
  });
1477
1477
  return (t, n) => {
1478
- let i = de, o = fe;
1479
- return k(), O("section", {
1478
+ let i = ue, o = de;
1479
+ return A(), k("section", {
1480
1480
  ref_key: "rootEl",
1481
- ref: j,
1481
+ ref: M,
1482
1482
  class: "pk-file-preview",
1483
1483
  "aria-label": e.filename,
1484
1484
  tabindex: "-1",
@@ -1489,7 +1489,7 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
1489
1489
  name: e.kind === "word" ? "ri:file-word-2-line" : "ri:file-excel-2-line",
1490
1490
  class: r(e.kind === "word" ? "pk-file-preview__icon--word" : "pk-file-preview__icon--sheet")
1491
1491
  }, null, 8, ["name", "class"])]), v("div", Lt, [v("strong", Rt, S(e.filename), 1), v("span", zt, S(D(s)("chatFilePreview.readOnly")), 1)])]),
1492
- e.version && l.value.length > 1 || A.value ? (k(), O("div", Bt, [e.version && l.value.length > 1 ? (k(), O("nav", {
1492
+ e.version && l.value.length > 1 || j.value ? (A(), k("div", Bt, [e.version && l.value.length > 1 ? (A(), k("nav", {
1493
1493
  key: 0,
1494
1494
  class: "pk-file-preview__versions",
1495
1495
  "aria-label": D(s)("chatFilePreview.versions")
@@ -1512,7 +1512,7 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
1512
1512
  disabled: !ee.value,
1513
1513
  onClick: n[1] ||= (e) => ee.value && a("version", ee.value)
1514
1514
  }, null, 8, ["aria-label", "disabled"])
1515
- ], 8, Vt)) : T("", !0), A.value ? (k(), h(ge, {
1515
+ ], 8, Vt)) : T("", !0), j.value ? (A(), h(he, {
1516
1516
  key: 1,
1517
1517
  modelValue: x.value,
1518
1518
  "onUpdate:modelValue": n[2] ||= (e) => x.value = e,
@@ -1520,7 +1520,7 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
1520
1520
  segmented: "",
1521
1521
  class: "pk-file-preview__modes u-segmented-fit mb-0",
1522
1522
  "aria-label": D(s)("chatFilePreview.modes"),
1523
- options: re.value
1523
+ options: O.value
1524
1524
  }, {
1525
1525
  markup: te(() => [v("span", Ut, S(D(s)("chatFilePreview.modeMarkup")), 1), v("span", Wt, S(D(s)("chatFilePreview.modeMarkupShort")), 1)]),
1526
1526
  _: 1
@@ -1530,7 +1530,7 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
1530
1530
  "options"
1531
1531
  ])) : T("", !0)])) : T("", !0),
1532
1532
  v("div", Gt, [
1533
- e.restorable ? (k(), h(o, {
1533
+ e.restorable ? (A(), h(o, {
1534
1534
  key: 0,
1535
1535
  modifiers: "action-quiet",
1536
1536
  icon: "ri:arrow-go-back-line",
@@ -1549,14 +1549,14 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
1549
1549
  "title",
1550
1550
  "aria-label"
1551
1551
  ]),
1552
- e.resize === "expand" ? (k(), h(o, {
1552
+ e.resize === "expand" ? (A(), h(o, {
1553
1553
  key: 1,
1554
1554
  modifiers: "action-quiet",
1555
1555
  icon: "ri:fullscreen-line",
1556
1556
  title: D(s)("chatFilePreview.expand"),
1557
1557
  "aria-label": D(s)("chatFilePreview.expand"),
1558
1558
  onClick: n[4] ||= (e) => a("resize")
1559
- }, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (k(), h(o, {
1559
+ }, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (A(), h(o, {
1560
1560
  key: 2,
1561
1561
  modifiers: "action-quiet",
1562
1562
  icon: "ri:fullscreen-exit-line",
@@ -1573,26 +1573,26 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
1573
1573
  }, null, 8, ["title", "aria-label"])
1574
1574
  ])
1575
1575
  ]),
1576
- v("div", Kt, [e.loading ? (k(), O("div", qt, [(k(), O(_, null, p(8, (e) => v("div", {
1576
+ v("div", Kt, [e.loading ? (A(), k("div", qt, [(A(), k(_, null, p(8, (e) => v("div", {
1577
1577
  key: e,
1578
1578
  class: r(["vv-skeleton__item pk-file-preview__skeleton-line", e % 3 ? "w-full" : "w-128"])
1579
- }, null, 2)), 64))])) : e.error || !e.preview ? (k(), O("p", Jt, S(D(s)("chatFilePreview.unavailable")), 1)) : e.preview.kind === "word" ? (k(), h(Mt, {
1579
+ }, null, 2)), 64))])) : e.error || !e.preview ? (A(), k("p", Jt, S(D(s)("chatFilePreview.unavailable")), 1)) : e.preview.kind === "word" ? (A(), h(Mt, {
1580
1580
  key: 2,
1581
1581
  zoom: w.value,
1582
1582
  "onUpdate:zoom": n[7] ||= (e) => w.value = e,
1583
1583
  fit: E.value,
1584
1584
  "onUpdate:fit": n[8] ||= (e) => E.value = e,
1585
1585
  preview: e.preview,
1586
- mode: A.value ? x.value : "markup",
1586
+ mode: j.value ? x.value : "markup",
1587
1587
  marked: e.changes?.kind === "word" ? e.changes.paragraphs : void 0,
1588
- onSelect: oe
1588
+ onSelect: ae
1589
1589
  }, null, 8, [
1590
1590
  "zoom",
1591
1591
  "fit",
1592
1592
  "preview",
1593
1593
  "mode",
1594
1594
  "marked"
1595
- ])) : (k(), h(Je, {
1595
+ ])) : (A(), h(Ye, {
1596
1596
  key: 3,
1597
1597
  sheet: C.value,
1598
1598
  "onUpdate:sheet": n[9] ||= (e) => C.value = e,
@@ -1600,28 +1600,28 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
1600
1600
  "onUpdate:zoom": n[10] ||= (e) => w.value = e,
1601
1601
  preview: e.preview,
1602
1602
  marked: e.changes?.kind === "spreadsheet" ? e.changes.cells : void 0,
1603
- onSelect: oe
1603
+ onSelect: ae
1604
1604
  }, null, 8, [
1605
1605
  "sheet",
1606
1606
  "zoom",
1607
1607
  "preview",
1608
1608
  "marked"
1609
1609
  ]))]),
1610
- e.selectionActions && M.value && G.value ? (k(), h(he, {
1610
+ e.selectionActions && N.value && W.value ? (A(), h(me, {
1611
1611
  key: 0,
1612
- asking: N.value,
1613
- "onUpdate:asking": n[11] ||= (e) => N.value = e,
1612
+ asking: P.value,
1613
+ "onUpdate:asking": n[11] ||= (e) => P.value = e,
1614
1614
  strategy: "absolute",
1615
- anchor: G.value,
1616
- actions: z.value,
1617
- hint: ue.value,
1618
- touch: P.value,
1615
+ anchor: W.value,
1616
+ actions: B.value,
1617
+ hint: le.value,
1618
+ touch: oe.value,
1619
1619
  note: se.value ? void 0 : D(s)("selectionActions.notLatest", { version: e.version }),
1620
1620
  "note-action": D(s)("selectionActions.openLatest"),
1621
- onAction: U,
1622
- onAsk: n[12] ||= (e) => H(e, "ask"),
1621
+ onAction: H,
1622
+ onAsk: n[12] ||= (e) => ve(e, "ask"),
1623
1623
  onNote: F,
1624
- onClose: ae
1624
+ onClose: ie
1625
1625
  }, null, 8, [
1626
1626
  "asking",
1627
1627
  "anchor",
@@ -1634,7 +1634,7 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
1634
1634
  ], 8, Nt);
1635
1635
  };
1636
1636
  }
1637
- }), Xt = ".pk-file-preview{background-color:var(--color-surface);height:100%;min-height:0;color:var(--color-word-1);outline:none;flex-direction:column;display:flex;position:relative;container-type:inline-size}.pk-file-preview__head{align-items:center;gap:var(--spacing-8) var(--spacing-12);padding:var(--spacing-12) var(--spacing-12) var(--spacing-12) var(--spacing-md);border-bottom:var(--border) solid var(--color-surface-3);flex-wrap:wrap;display:flex}.pk-file-preview__file{align-items:center;gap:var(--spacing-12);flex:12rem;min-width:0;display:flex}.pk-file-preview__tile{width:var(--spacing-32);height:var(--spacing-32);border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded);flex-shrink:0;justify-content:center;align-items:center;display:flex}.pk-file-preview__tile .vv-icon{width:var(--spacing-18);height:var(--spacing-18)}.pk-file-preview__icon--word{color:#2b7de9}.pk-file-preview__icon--sheet{color:#1f9d57}.pk-file-preview__name{flex-direction:column;min-width:0;display:flex}.pk-file-preview__title{font-size:var(--text-14);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pk-file-preview__note{color:var(--color-word-3);font-size:var(--text-12)}.pk-file-preview__tools{align-items:center;gap:var(--spacing-8) var(--spacing-12);flex-wrap:wrap;display:flex}.pk-file-preview__versions{align-items:center;gap:var(--spacing-2);display:flex}.pk-file-preview__version{font-size:var(--text-14);font-weight:var(--font-semibold);font-variant-numeric:tabular-nums;white-space:nowrap}.pk-file-preview__actions{align-items:center;gap:var(--spacing-8);margin-left:auto;display:flex}@container (width<52rem){.pk-file-preview__file{order:1}.pk-file-preview__actions{order:2}.pk-file-preview__tools{flex-basis:100%;order:3}.pk-file-preview__tools .pk-file-preview__modes{flex:auto}}.pk-file-preview__mode-short{display:none}@container (width<38rem){.pk-file-preview__mode-long{display:none}.pk-file-preview__mode-short{display:inline}}@container (width<30rem){.pk-file-preview__tools .pk-file-preview__modes{flex:100%}.pk-file-preview__tools .pk-file-preview__modes .vv-radio{padding-inline:var(--spacing-4)}}.pk-file-preview__body{background-color:var(--color-surface-1);flex-direction:column;flex:1;min-height:0;display:flex}.pk-file-preview__skeleton{width:min(42rem, 100% - 2 * var(--spacing-md));margin:var(--spacing-md) auto;padding:var(--spacing-lg);box-sizing:border-box;border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded);background-color:var(--color-surface)}.pk-file-preview__skeleton-line{height:var(--spacing-12);margin-bottom:var(--spacing-12);border-radius:var(--rounded)}.pk-file-preview__empty{margin:var(--spacing-lg) var(--spacing-md);color:var(--color-word-3);font-size:var(--text-14);text-align:center}", Zt = /* @__PURE__ */ e({ default: () => Qt }), Qt = /*#__PURE__*/ z(Yt, [["styles", [Xt]]]);
1637
+ }), Xt = ".pk-file-preview{background-color:var(--color-surface);height:100%;min-height:0;color:var(--color-word-1);outline:none;flex-direction:column;display:flex;position:relative;container-type:inline-size}.pk-file-preview__head{align-items:center;gap:var(--spacing-8) var(--spacing-12);padding:var(--spacing-12) var(--spacing-12) var(--spacing-12) var(--spacing-md);border-bottom:var(--border) solid var(--color-surface-3);flex-wrap:wrap;display:flex}.pk-file-preview__file{align-items:center;gap:var(--spacing-12);flex:12rem;min-width:0;display:flex}.pk-file-preview__tile{width:var(--spacing-32);height:var(--spacing-32);border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded);flex-shrink:0;justify-content:center;align-items:center;display:flex}.pk-file-preview__tile .vv-icon{width:var(--spacing-18);height:var(--spacing-18)}.pk-file-preview__icon--word{color:#2b7de9}.pk-file-preview__icon--sheet{color:#1f9d57}.pk-file-preview__name{flex-direction:column;min-width:0;display:flex}.pk-file-preview__title{font-size:var(--text-14);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pk-file-preview__note{color:var(--color-word-3);font-size:var(--text-12)}.pk-file-preview__tools{align-items:center;gap:var(--spacing-8) var(--spacing-12);flex-wrap:wrap;display:flex}.pk-file-preview__versions{align-items:center;gap:var(--spacing-2);display:flex}.pk-file-preview__version{font-size:var(--text-14);font-weight:var(--font-semibold);font-variant-numeric:tabular-nums;white-space:nowrap}.pk-file-preview__actions{align-items:center;gap:var(--spacing-8);margin-left:auto;display:flex}@container (width<52rem){.pk-file-preview__file{order:1}.pk-file-preview__actions{order:2}.pk-file-preview__tools{flex-basis:100%;order:3}.pk-file-preview__tools .pk-file-preview__modes{flex:auto}}.pk-file-preview__mode-short{display:none}@container (width<38rem){.pk-file-preview__mode-long{display:none}.pk-file-preview__mode-short{display:inline}}@container (width<30rem){.pk-file-preview__tools .pk-file-preview__modes{flex:100%}.pk-file-preview__tools .pk-file-preview__modes .vv-radio{padding-inline:var(--spacing-4)}}.pk-file-preview__body{background-color:var(--color-surface-1);flex-direction:column;flex:1;min-height:0;display:flex}.pk-file-preview__skeleton{width:min(42rem, 100% - 2 * var(--spacing-md));margin:var(--spacing-md) auto;padding:var(--spacing-lg);box-sizing:border-box;border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded);background-color:var(--color-surface)}.pk-file-preview__skeleton-line{height:var(--spacing-12);margin-bottom:var(--spacing-12);border-radius:var(--rounded)}.pk-file-preview__empty{margin:var(--spacing-lg) var(--spacing-md);color:var(--color-word-3);font-size:var(--text-14);text-align:center}", Zt = /* @__PURE__ */ e({ default: () => Qt }), Qt = /*#__PURE__*/ B(Yt, [["styles", [Xt]]]);
1638
1638
  export { Zt as n, Qt as t };
1639
1639
 
1640
- //# sourceMappingURL=PkFilePreview-CT3_vRcU.js.map
1640
+ //# sourceMappingURL=PkFilePreview-D_1ZgiiA.js.map