@8wave/ai-elements 0.126.0-beta.22 → 0.126.0-beta.23

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 (83) hide show
  1. package/dist/_chunks/{PkChatbotFilePreview-jN3SAlut.js → PkChatbotFilePreview-B4vbUkNp.js} +2 -2
  2. package/dist/_chunks/{PkChatbotFilePreview-jN3SAlut.js.map → PkChatbotFilePreview-B4vbUkNp.js.map} +1 -1
  3. package/dist/_chunks/{PkStreamingMarkdown-qoTgaVHP.js → PkStreamingMarkdown-GRB3Gg_x.js} +2 -2
  4. package/dist/_chunks/{PkStreamingMarkdown-qoTgaVHP.js.map → PkStreamingMarkdown-GRB3Gg_x.js.map} +1 -1
  5. package/dist/_chunks/{PkToolChatFile-uAyCds1k.js → PkToolChatFile-DTm5-CE4.js} +2 -2
  6. package/dist/_chunks/{PkToolChatFile-uAyCds1k.js.map → PkToolChatFile-DTm5-CE4.js.map} +1 -1
  7. package/dist/_chunks/{PkToolShareDocument-NUMXFQ2e.js → PkToolShareDocument-DYr0Rq4D.js} +2 -2
  8. package/dist/_chunks/{PkToolShareDocument-NUMXFQ2e.js.map → PkToolShareDocument-DYr0Rq4D.js.map} +1 -1
  9. package/dist/_chunks/{PkToolShowArtifact-D1p76r2a.js → PkToolShowArtifact-C9_DHr5Y.js} +2 -2
  10. package/dist/_chunks/{PkToolShowArtifact-D1p76r2a.js.map → PkToolShowArtifact-C9_DHr5Y.js.map} +1 -1
  11. package/dist/_chunks/{PkToolShowContactForm-B4S4qtxp.js → PkToolShowContactForm-DhyelktO.js} +2 -2
  12. package/dist/_chunks/{PkToolShowContactForm-B4S4qtxp.js.map → PkToolShowContactForm-DhyelktO.js.map} +1 -1
  13. package/dist/_chunks/{PkToolShowDiagram-CauQT97Z.js → PkToolShowDiagram-DWVSCu33.js} +2 -2
  14. package/dist/_chunks/{PkToolShowDiagram-CauQT97Z.js.map → PkToolShowDiagram-DWVSCu33.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowForm-1sJBr8KY.js → PkToolShowForm-Dz2Hnzts.js} +2 -2
  16. package/dist/_chunks/{PkToolShowForm-1sJBr8KY.js.map → PkToolShowForm-Dz2Hnzts.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowImageGallery-DFhYCp-v.js → PkToolShowImageGallery-By-CPFS0.js} +2 -2
  18. package/dist/_chunks/{PkToolShowImageGallery-DFhYCp-v.js.map → PkToolShowImageGallery-By-CPFS0.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowSources-DFHejVc0.js → PkToolShowSources-YDHIZ6Ly.js} +2 -2
  20. package/dist/_chunks/{PkToolShowSources-DFHejVc0.js.map → PkToolShowSources-YDHIZ6Ly.js.map} +1 -1
  21. package/dist/_chunks/{useLightbox-CUT_xmuZ.js → useLightbox-Co8iz61W.js} +75 -58
  22. package/dist/_chunks/useLightbox-Co8iz61W.js.map +1 -0
  23. package/dist/ai-elements.es.js +12 -12
  24. package/dist-vue/PkChatbot.js +1 -1
  25. package/dist-vue/PkChatbotEmptyState.js +1 -1
  26. package/dist-vue/PkChatbotFilePreview.js +1 -1
  27. package/dist-vue/PkChatbotInput.js +1 -1
  28. package/dist-vue/PkChatbotMessages.js +1 -1
  29. package/dist-vue/PkChatbotSteps.js +1 -1
  30. package/dist-vue/PkChatbotViewChat.js +1 -1
  31. package/dist-vue/_chunks/{PkChatbot-VJorpNbU.js → PkChatbot-CwHVS4sT.js} +3 -3
  32. package/dist-vue/_chunks/{PkChatbot-VJorpNbU.js.map → PkChatbot-CwHVS4sT.js.map} +1 -1
  33. package/dist-vue/_chunks/{PkChatbotEmptyState-B9dYpXZm.js → PkChatbotEmptyState-BF3Odn3v.js} +2 -2
  34. package/dist-vue/_chunks/{PkChatbotEmptyState-B9dYpXZm.js.map → PkChatbotEmptyState-BF3Odn3v.js.map} +1 -1
  35. package/dist-vue/_chunks/{PkChatbotFilePreview-5_bih_vc.js → PkChatbotFilePreview-aKJBtw04.js} +2 -2
  36. package/dist-vue/_chunks/{PkChatbotFilePreview-5_bih_vc.js.map → PkChatbotFilePreview-aKJBtw04.js.map} +1 -1
  37. package/dist-vue/_chunks/{PkChatbotInput-BLKhf3WD.js → PkChatbotInput-DNXvFvyG.js} +3 -3
  38. package/dist-vue/_chunks/{PkChatbotInput-BLKhf3WD.js.map → PkChatbotInput-DNXvFvyG.js.map} +1 -1
  39. package/dist-vue/_chunks/{PkChatbotMessages-Dx_IIX0J.js → PkChatbotMessages-DOOQRLEc.js} +17 -17
  40. package/dist-vue/_chunks/{PkChatbotMessages-Dx_IIX0J.js.map → PkChatbotMessages-DOOQRLEc.js.map} +1 -1
  41. package/dist-vue/_chunks/{PkChatbotSteps-BAQ1LriG.js → PkChatbotSteps-BalLo6DZ.js} +2 -2
  42. package/dist-vue/_chunks/{PkChatbotSteps-BAQ1LriG.js.map → PkChatbotSteps-BalLo6DZ.js.map} +1 -1
  43. package/dist-vue/_chunks/{PkChatbotViewChat-1RqLcPl4.js → PkChatbotViewChat-BWdFuQ4P.js} +6 -6
  44. package/dist-vue/_chunks/{PkChatbotViewChat-1RqLcPl4.js.map → PkChatbotViewChat-BWdFuQ4P.js.map} +1 -1
  45. package/dist-vue/_chunks/{PkFilePreview-Dkm34tMI.js → PkFilePreview-B4LOpz5I.js} +2 -2
  46. package/dist-vue/_chunks/{PkFilePreview-Dkm34tMI.js.map → PkFilePreview-B4LOpz5I.js.map} +1 -1
  47. package/dist-vue/_chunks/{PkFilePreviewDialog-CZg7uqHL.js → PkFilePreviewDialog-C_JCOUKx.js} +2 -2
  48. package/dist-vue/_chunks/{PkFilePreviewDialog-CZg7uqHL.js.map → PkFilePreviewDialog-C_JCOUKx.js.map} +1 -1
  49. package/dist-vue/_chunks/{PkStreamingMarkdown-D6Qxwf47.js → PkStreamingMarkdown-CMxiJTMR.js} +2 -2
  50. package/dist-vue/_chunks/{PkStreamingMarkdown-D6Qxwf47.js.map → PkStreamingMarkdown-CMxiJTMR.js.map} +1 -1
  51. package/dist-vue/_chunks/{PkSvgViewer-jCi13HSd.js → PkSvgViewer-PAr87kCa.js} +2 -2
  52. package/dist-vue/_chunks/{PkSvgViewer-jCi13HSd.js.map → PkSvgViewer-PAr87kCa.js.map} +1 -1
  53. package/dist-vue/_chunks/{PkToolChatFile-uO6r1l6t.js → PkToolChatFile-Bd6Ci7i1.js} +2 -2
  54. package/dist-vue/_chunks/{PkToolChatFile-uO6r1l6t.js.map → PkToolChatFile-Bd6Ci7i1.js.map} +1 -1
  55. package/dist-vue/_chunks/{PkToolShareDocument-B7mMJJfn.js → PkToolShareDocument-Bkt9JVqk.js} +2 -2
  56. package/dist-vue/_chunks/{PkToolShareDocument-B7mMJJfn.js.map → PkToolShareDocument-Bkt9JVqk.js.map} +1 -1
  57. package/dist-vue/_chunks/{PkToolShowArtifact-VOfSN9nc.js → PkToolShowArtifact-rlZ-AGWh.js} +2 -2
  58. package/dist-vue/_chunks/{PkToolShowArtifact-VOfSN9nc.js.map → PkToolShowArtifact-rlZ-AGWh.js.map} +1 -1
  59. package/dist-vue/_chunks/{PkToolShowContactForm-D9J0B3C-.js → PkToolShowContactForm-BVBL7Unx.js} +2 -2
  60. package/dist-vue/_chunks/{PkToolShowContactForm-D9J0B3C-.js.map → PkToolShowContactForm-BVBL7Unx.js.map} +1 -1
  61. package/dist-vue/_chunks/{PkToolShowDiagram-BlV7ktLW.js → PkToolShowDiagram-Bs39QQZ3.js} +2 -2
  62. package/dist-vue/_chunks/{PkToolShowDiagram-BlV7ktLW.js.map → PkToolShowDiagram-Bs39QQZ3.js.map} +1 -1
  63. package/dist-vue/_chunks/{PkToolShowForm-BCvqIlt_.js → PkToolShowForm-D-RJeA2F.js} +2 -2
  64. package/dist-vue/_chunks/{PkToolShowForm-BCvqIlt_.js.map → PkToolShowForm-D-RJeA2F.js.map} +1 -1
  65. package/dist-vue/_chunks/{PkToolShowImageGallery-D2DrAB9v.js → PkToolShowImageGallery-8nTrgIRm.js} +3 -3
  66. package/dist-vue/_chunks/{PkToolShowImageGallery-D2DrAB9v.js.map → PkToolShowImageGallery-8nTrgIRm.js.map} +1 -1
  67. package/dist-vue/_chunks/{PkToolShowLocation-BhVcLnkV.js → PkToolShowLocation-CqqtwH_R.js} +2 -2
  68. package/dist-vue/_chunks/{PkToolShowLocation-BhVcLnkV.js.map → PkToolShowLocation-CqqtwH_R.js.map} +1 -1
  69. package/dist-vue/_chunks/{PkToolShowProductList--MBQ_ztM.js → PkToolShowProductList-BwfUG41_.js} +2 -2
  70. package/dist-vue/_chunks/{PkToolShowProductList--MBQ_ztM.js.map → PkToolShowProductList-BwfUG41_.js.map} +1 -1
  71. package/dist-vue/_chunks/{PkToolShowSources-D_KfNZ_Q.js → PkToolShowSources-ChGsGtb3.js} +2 -2
  72. package/dist-vue/_chunks/{PkToolShowSources-D_KfNZ_Q.js.map → PkToolShowSources-ChGsGtb3.js.map} +1 -1
  73. package/dist-vue/_chunks/{PkToolShowVideo-CS6iDwjn.js → PkToolShowVideo-BK-jDVJd.js} +2 -2
  74. package/dist-vue/_chunks/{PkToolShowVideo-CS6iDwjn.js.map → PkToolShowVideo-BK-jDVJd.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkToolShowWebPages-y3sajjCP.js → PkToolShowWebPages-K3Jml1f7.js} +2 -2
  76. package/dist-vue/_chunks/{PkToolShowWebPages-y3sajjCP.js.map → PkToolShowWebPages-K3Jml1f7.js.map} +1 -1
  77. package/dist-vue/_chunks/{useLightbox-BZN3tRGu.js → useLightbox-DrEFS3gx.js} +75 -58
  78. package/dist-vue/_chunks/useLightbox-DrEFS3gx.js.map +1 -0
  79. package/dist-vue/index.js +22 -22
  80. package/dist-vue/packages/components/src/composables/useLightbox.d.ts +12 -0
  81. package/package.json +1 -1
  82. package/dist/_chunks/useLightbox-CUT_xmuZ.js.map +0 -1
  83. package/dist-vue/_chunks/useLightbox-BZN3tRGu.js.map +0 -1
@@ -23,9 +23,9 @@ function v(e) {
23
23
  }
24
24
  var y = "a[data-pswp-src][data-pswp-shared], [data-pswp-images] img:not(a img)";
25
25
  function b(t) {
26
- let { gallery: r, children: a = "a[data-pswp-src]", loop: o = !0, downloadable: s = !0, openInNewTab: g = !0, shared: v = !1, annotatable: y = !1 } = t, b = c(null), S = v ? x() : void 0, C = y ? e(_, void 0) : void 0, { t: D } = l({ useScope: "global" }), O = !1;
26
+ let { gallery: r, children: a = "a[data-pswp-src]", loop: o = !0, downloadable: s = !0, openInNewTab: g = !0, shared: v = !1, annotatable: y = !1 } = t, b = c(null), S = v ? x() : void 0, C = y ? e(_, void 0) : void 0, { t: w } = l({ useScope: "global" }), k = !1;
27
27
  return n(() => {
28
- O = !0, b.value?.destroy(), b.value = null;
28
+ k = !0, b.value?.destroy(), b.value = null;
29
29
  }), {
30
30
  lightbox: b,
31
31
  init: async () => {
@@ -34,20 +34,20 @@ function b(t) {
34
34
  return;
35
35
  }
36
36
  if (!r.value) return;
37
- u(d), U();
37
+ u(d), G();
38
38
  let { default: e } = await import("https://cdn.jsdelivr.net/npm/photoswipe@5/dist/photoswipe-lightbox.esm.min.js");
39
- O || (b.value = new e({
39
+ k || (b.value = new e({
40
40
  gallery: r.value,
41
41
  children: a,
42
42
  pswpModule: () => import("https://cdn.jsdelivr.net/npm/photoswipe@5/dist/photoswipe.esm.min.js"),
43
43
  loop: o,
44
44
  wheelToZoom: !0,
45
45
  secondaryZoomLevel: (e) => Math.min(1, p / (e.elementSize?.x || p)),
46
- closeTitle: D("action.close"),
47
- zoomTitle: D("lightbox.zoom"),
48
- arrowPrevTitle: D("action.previous"),
49
- arrowNextTitle: D("action.next"),
50
- errorMsg: D("label.imageLoadError"),
46
+ closeTitle: w("action.close"),
47
+ zoomTitle: w("lightbox.zoom"),
48
+ arrowPrevTitle: w("action.previous"),
49
+ arrowNextTitle: w("action.next"),
50
+ errorMsg: w("label.imageLoadError"),
51
51
  arrowPrevSVG: "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m10.828 12l4.95 4.95l-1.414 1.415L8 12l6.364-6.364l1.414 1.414z\"/></svg>",
52
52
  arrowNextSVG: "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z\"/></svg>",
53
53
  closeSVG: "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z\"/></svg>",
@@ -68,6 +68,9 @@ function b(t) {
68
68
  alt: t.alt,
69
69
  caption: t.alt
70
70
  };
71
+ }), b.value.on("uiRegister", () => {
72
+ let e = b.value?.pswp?.ui;
73
+ e && (e.uiElementsData = e.uiElementsData.map(T));
71
74
  }), b.value.on("uiRegister", () => {
72
75
  b.value?.pswp?.ui?.registerElement({
73
76
  name: "caption",
@@ -85,41 +88,41 @@ function b(t) {
85
88
  name: "annotate-button",
86
89
  order: h.annotate,
87
90
  isButton: !0,
88
- html: T,
89
- title: D("lightbox.annotate"),
91
+ html: D,
92
+ title: w("lightbox.annotate"),
90
93
  onInit: (e, t) => {
91
94
  let n = () => {
92
- let n = w(t);
93
- e.hidden = !n || !N(n) || !C.available();
95
+ let n = E(t);
96
+ e.hidden = !n || !F(n) || !C.available();
94
97
  };
95
98
  t.on("change", n), t.on("destroy", i(C.available, n));
96
99
  },
97
100
  onClick: (e, t, n) => {
98
- let r = w(n), i = r && N(r);
101
+ let r = E(n), i = r && F(r);
99
102
  if (!i || !C.available()) return;
100
- let a = I(i, n.currSlide?.data.caption);
103
+ let a = R(i, n.currSlide?.data.caption);
101
104
  a.catch(() => void 0), n.opener.isOpen ? n.close() : n.on("openingAnimationEnd", () => n.close()), C.annotate(a);
102
105
  }
103
106
  });
104
- }), j() && b.value.on("uiRegister", () => {
107
+ }), N() && b.value.on("uiRegister", () => {
105
108
  b.value?.pswp?.ui?.registerElement({
106
109
  name: "copy-button",
107
110
  order: h.copy,
108
111
  isButton: !0,
109
- html: E,
110
- title: D("lightbox.copy"),
112
+ html: O,
113
+ title: w("lightbox.copy"),
111
114
  onInit: (e, t) => {
112
115
  t.on("change", () => {
113
- let n = w(t);
114
- e.hidden = !n || !M(n);
116
+ let n = E(t);
117
+ e.hidden = !n || !P(n);
115
118
  });
116
119
  },
117
120
  onClick: (e, t, n) => {
118
- let r = w(n), i = r && M(r);
119
- i && R(i, t, {
120
- copy: D("lightbox.copy"),
121
- copied: D("lightbox.copied"),
122
- failed: D("lightbox.copyFailed")
121
+ let r = E(n), i = r && P(r);
122
+ i && B(i, t, {
123
+ copy: w("lightbox.copy"),
124
+ copied: w("lightbox.copied"),
125
+ failed: w("lightbox.copyFailed")
123
126
  });
124
127
  }
125
128
  });
@@ -130,9 +133,9 @@ function b(t) {
130
133
  order: h.openInNewTab,
131
134
  isButton: !0,
132
135
  html: "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z\"/></svg>",
133
- title: D("lightbox.openInNewTab"),
136
+ title: w("lightbox.openInNewTab"),
134
137
  onClick: (e, t, n) => {
135
- let r = w(n);
138
+ let r = E(n);
136
139
  r && window.open(r, "_blank", "noopener,noreferrer");
137
140
  }
138
141
  }), s && e.registerElement({
@@ -140,10 +143,10 @@ function b(t) {
140
143
  order: h.download,
141
144
  isButton: !0,
142
145
  html: "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z\"/></svg>",
143
- title: D("action.download"),
146
+ title: w("action.download"),
144
147
  onClick: (e, t, n) => {
145
- let r = w(n);
146
- r && z(r);
148
+ let r = E(n);
149
+ r && V(r);
147
150
  }
148
151
  }));
149
152
  }), b.value.on("keydown", (e) => {
@@ -201,37 +204,51 @@ function C() {
201
204
  getSize: (t) => e.value.get(t) ?? f
202
205
  };
203
206
  }
204
- function w(e) {
207
+ var w = {
208
+ arrowPrev: "prev",
209
+ arrowNext: "next",
210
+ zoom: "toggleZoom"
211
+ };
212
+ function T(e) {
213
+ let t = w[e.name ?? ""];
214
+ return t ? {
215
+ ...e,
216
+ onClick: (e, n, r) => {
217
+ r.opener.isOpen && r[t]();
218
+ }
219
+ } : e;
220
+ }
221
+ function E(e) {
205
222
  return e.currSlide?.data?.src ?? e.currSlide?.data?.element?.querySelector("img")?.getAttribute("src") ?? e.currSlide?.data?.element?.querySelector("source")?.getAttribute("srcset") ?? e.currSlide?.data?.element?.getAttribute("src") ?? void 0;
206
223
  }
207
- var T = "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m15.243 4.512l-6.738 6.737l-.707 2.121l-1.04 1.041l2.828 2.828l1.04-1.04l2.122-.708l6.737-6.737zm6.364 3.535a1 1 0 0 1 0 1.414l-7.778 7.778l-2.122.707l-1.414 1.415a1 1 0 0 1-1.414 0l-4.243-4.243a1 1 0 0 1 0-1.414L6.05 12.29l.707-2.122l7.779-7.778a1 1 0 0 1 1.414 0zm-6.364-.707l1.414 1.414l-4.95 4.95l-1.414-1.414zm-10.96 9.546l2.828 2.828l-1.414 1.415l-4.243-1.415z\"/></svg>", E = "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z\"/></svg>", D = "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m10 15.172l9.192-9.193l1.415 1.414L10 18l-6.364-6.364l1.414-1.414z\"/></svg>", O = "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm0-8h2v6h-2z\"/></svg>", k = 1500, A = /* @__PURE__ */ new WeakMap();
208
- function j() {
224
+ var D = "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m15.243 4.512l-6.738 6.737l-.707 2.121l-1.04 1.041l2.828 2.828l1.04-1.04l2.122-.708l6.737-6.737zm6.364 3.535a1 1 0 0 1 0 1.414l-7.778 7.778l-2.122.707l-1.414 1.415a1 1 0 0 1-1.414 0l-4.243-4.243a1 1 0 0 1 0-1.414L6.05 12.29l.707-2.122l7.779-7.778a1 1 0 0 1 1.414 0zm-6.364-.707l1.414 1.414l-4.95 4.95l-1.414-1.414zm-10.96 9.546l2.828 2.828l-1.414 1.415l-4.243-1.415z\"/></svg>", O = "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z\"/></svg>", k = "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m10 15.172l9.192-9.193l1.415 1.414L10 18l-6.364-6.364l1.414-1.414z\"/></svg>", A = "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm0-8h2v6h-2z\"/></svg>", j = 1500, M = /* @__PURE__ */ new WeakMap();
225
+ function N() {
209
226
  return typeof ClipboardItem < "u" && typeof navigator.clipboard?.write == "function";
210
227
  }
211
- function M(e) {
228
+ function P(e) {
212
229
  if (e.startsWith("blob:") || e.startsWith("data:image/")) return e;
213
230
  if (/\/chats\/[^/]+\/media\/[^/]+\/view(\?|$)/.test(e)) return e.replace(/\/view(\?|$)/, "/content$1");
214
231
  }
215
- function N(e) {
216
- if (!e.startsWith("data:") || /^data:image\/(png|jpeg|webp|gif)[;,]/.test(e)) return M(e);
232
+ function F(e) {
233
+ if (!e.startsWith("data:") || /^data:image\/(png|jpeg|webp|gif)[;,]/.test(e)) return P(e);
217
234
  }
218
- function P(e, t) {
235
+ function I(e, t) {
219
236
  let n = e?.trim();
220
237
  if (n && /\.(png|jpe?g|webp|gif)$/i.test(n)) return n;
221
238
  let r = /^image\/(png|jpeg|webp|gif)$/.exec(t)?.[1];
222
239
  return `image.${r === "jpeg" ? "jpg" : r ?? "png"}`;
223
240
  }
224
- async function F(e) {
241
+ async function L(e) {
225
242
  let t = await fetch(e, { credentials: "include" });
226
243
  if (!t.ok) throw Error(`The image answered ${t.status}`);
227
244
  return t.blob();
228
245
  }
229
- async function I(e, t) {
230
- let n = await F(e);
231
- return new File([n], P(t, n.type), { type: n.type });
246
+ async function R(e, t) {
247
+ let n = await L(e);
248
+ return new File([n], I(t, n.type), { type: n.type });
232
249
  }
233
- async function L(e) {
234
- let t = await F(e);
250
+ async function z(e) {
251
+ let t = await L(e);
235
252
  if (t.type === "image/png") return t;
236
253
  let n = URL.createObjectURL(t);
237
254
  try {
@@ -245,26 +262,26 @@ async function L(e) {
245
262
  URL.revokeObjectURL(n);
246
263
  }
247
264
  }
248
- async function R(e, t, n) {
265
+ async function B(e, t, n) {
249
266
  let r = (e, n) => {
250
267
  t.innerHTML = e, t.title = n, t.setAttribute("aria-label", n);
251
- }, i = L(e);
268
+ }, i = z(e);
252
269
  i.catch(() => void 0);
253
270
  try {
254
- await navigator.clipboard.write([new ClipboardItem({ "image/png": i })]), r(D, n.copied);
271
+ await navigator.clipboard.write([new ClipboardItem({ "image/png": i })]), r(k, n.copied);
255
272
  } catch {
256
- r(O, n.failed);
273
+ r(A, n.failed);
257
274
  }
258
- clearTimeout(A.get(t)), A.set(t, setTimeout(() => r(E, n.copy), k));
275
+ clearTimeout(M.get(t)), M.set(t, setTimeout(() => r(O, n.copy), j));
259
276
  }
260
- function z(e) {
261
- let t = B(e), n = document.createElement("a");
262
- n.href = t, n.target = "_blank", n.rel = "noopener noreferrer", n.download = V(e), document.body.appendChild(n), n.click(), document.body.removeChild(n);
277
+ function V(e) {
278
+ let t = H(e), n = document.createElement("a");
279
+ n.href = t, n.target = "_blank", n.rel = "noopener noreferrer", n.download = U(e), document.body.appendChild(n), n.click(), document.body.removeChild(n);
263
280
  }
264
- function B(e) {
281
+ function H(e) {
265
282
  return e.replace(/\/view(\?|$)/, "/download$1");
266
283
  }
267
- function V(e) {
284
+ function U(e) {
268
285
  if (e.startsWith("data:image/svg+xml")) return "diagram.svg";
269
286
  if (e.startsWith("data:")) return `image.${e.split(":")[1].split(";")[0].split("/")[1] || "bin"}`;
270
287
  try {
@@ -274,13 +291,13 @@ function V(e) {
274
291
  return "image";
275
292
  }
276
293
  }
277
- var H = !1;
278
- function U() {
279
- if (H) return;
280
- H = !0;
294
+ var W = !1;
295
+ function G() {
296
+ if (W) return;
297
+ W = !0;
281
298
  let e = document.createElement("style");
282
299
  e.textContent = ".pswp__counter { font-family: sans-serif; } .pswp { z-index: 2147483647 !important; } .pswp__icn { width: 20px; height: 20px; } .pswp__button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; } .pswp__button[hidden] { display: none; } .pswp__button--zoom { display: none; } .pswp--zoom-allowed .pswp__button--zoom { display: flex; } .pswp__icn--zoom-out { display: none; } .pswp--zoomed-in .pswp__icn--zoom-in { display: none; } .pswp--zoomed-in .pswp__icn--zoom-out { display: block; } .pswp__button--arrow .pswp__icn {left: auto; right: auto; width: 40px; height: 40px; transform: none; margin-top: -20px; } .pswp__img { background: repeating-conic-gradient(#e6e6e6 0% 25%, #ffffff 0% 50%) 50% / 16px 16px; } .pswp__caption { position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(720px, calc(100% - 32px)); padding: 6px 12px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #ffffff; font: 14px/1.4 sans-serif; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; } .pswp__caption[hidden] { display: none; }", document.head.appendChild(e);
283
300
  }
284
301
  export { x as a, b as i, S as n, C as r, v as t };
285
302
 
286
- //# sourceMappingURL=useLightbox-CUT_xmuZ.js.map
303
+ //# sourceMappingURL=useLightbox-Co8iz61W.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLightbox-Co8iz61W.js","names":["inject","provide","onBeforeUnmount","onMounted","watch","ref","init_runtime_core_esm_bundler","init_reactivity_esm_bundler","shallowRef","useI18n","loadCdnCss","PHOTOSWIPE_CSS","DEFAULT_IMAGE_SIZE","MAX_ZOOM_LAYER_WIDTH","ZOOM_KEYS","TOOLBAR_ORDER","SHARED_LIGHTBOX","IMAGE_ANNOTATION","provideImageAnnotation","annotation","SHARED_ITEMS","useLightbox","options","lightbox","sharedLightbox","shared","useSharedLightbox","annotatable","$t","unmounted","gallery","injectPhotoSwipeOverrides","PhotoSwipeLightbox","zoomLevel","linkEl","itemData","element","src","ui","holdUntilOpen","caption","pswp","ANNOTATE_ICON","update","url","getCurrentSlideUrl","annotatableImageUrl","readable","file","readImageFile","canCopyImages","COPY_ICON","readableImageUrl","copyImage","openInNewTab","downloadable","downloadImage","event","factor","key","slide","ctrlKey","metaKey","altKey","provideSharedLightbox","container","joined","started","start","init","useImageSizes","sizes","image","images","img","HELD_UNTIL_OPEN","action","data","COPIED_ICON","COPY_FAILED_ICON","COPY_FEEDBACK_MS","copyFeedbackTimers","imageFileName","name","subtype","type","fetchImage","response","blob","readAsPng","objectUrl","canvas","png","resolve","reject","show","icon","label","button","labels","downloadUrl","toDownloadUrl","anchor","getFilenameFromUrl","overridesInjected","style"],"sources":["../../../../packages/components/src/composables/useLightbox.ts"],"sourcesContent":["import {\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n watch,\n type InjectionKey,\n type Ref,\n type ShallowRef,\n} from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport type PhotoSwipeLightbox from 'photoswipe/lightbox'\nimport type PhotoSwipe from 'photoswipe'\nimport type { UIElementData } from 'photoswipe'\nimport { loadCdnCss } from 'utils'\n\nconst PHOTOSWIPE_CSS =\n 'https://cdn.jsdelivr.net/npm/photoswipe@5/dist/photoswipe.css'\n\nconst DEFAULT_IMAGE_SIZE = { width: 1200, height: 800 }\n\n// The widest layer a zoom may draw, PhotoSwipe's own cap for its default\n// secondary zoom level: past it a very large image stops short of 100%.\nconst MAX_ZOOM_LAYER_WIDTH = 4000\n\n// The zoom factor of one press of `+` or `-`, with or without Shift.\nconst ZOOM_KEYS: Record<string, number | undefined> = {\n '+': 1.25,\n '=': 1.25,\n '-': 0.8,\n _: 0.8,\n}\n\n// PhotoSwipe's top bar runs by `order`: the counter (5) on the left, then the\n// preloader (7), whose `margin-right: auto` pushes everything after it to the\n// right, then zoom (10) and close (20). Our buttons sit between the preloader\n// and zoom, each with an order of its own: on a tie the bar falls back on the\n// order of registration.\nconst TOOLBAR_ORDER = {\n annotate: 8,\n copy: 8.5,\n openInNewTab: 9,\n download: 9.5,\n}\n\n/** The shared lightbox of a container, as the components inside see it. */\nexport interface SharedLightbox {\n /** An item joined: the first one starts the lightbox. */\n join: () => void\n}\n\n/** Lets the components inside a container join its shared lightbox. */\nconst SHARED_LIGHTBOX: InjectionKey<SharedLightbox> = Symbol('sharedLightbox')\n\n/**\n * \"Annota e chiedi\" (spec `chat-image-editor.md`, F3): a conversation with a\n * composer takes an annotated copy of one of its images as an attachment.\n */\nexport interface ImageAnnotation {\n /** The composer takes an image now: it is shown, uploads on, not full. */\n available: () => boolean\n /** Opens the editor on the image, whose bytes arrive in `file`. */\n annotate: (file: Promise<File>) => void\n}\n\n/** Offers \"Annota e chiedi\" to the lightboxes of the components inside. */\nconst IMAGE_ANNOTATION: InjectionKey<ImageAnnotation> =\n Symbol('imageAnnotation')\n\n/**\n * Gives the lightboxes inside the \"Annota e chiedi\" button: only the chat\n * with a composer calls it, so a log of conversations shows none.\n */\nexport function provideImageAnnotation(annotation: ImageAnnotation): void {\n provide(IMAGE_ANNOTATION, annotation)\n}\n\n/**\n * The items of a shared lightbox: the anchors of the components that joined\n * it, and the images of a markdown that joined it, except an image inside a\n * link, which opens the link.\n */\nconst SHARED_ITEMS =\n 'a[data-pswp-src][data-pswp-shared], [data-pswp-images] img:not(a img)'\n\nexport interface LightboxImage {\n url: string\n caption?: string\n alt?: string\n /** Natural width in px, used by PhotoSwipe for proper sizing. */\n width?: number\n /** Natural height in px, used by PhotoSwipe for proper sizing. */\n height?: number\n}\n\nexport interface LightboxOptions {\n /** Container element whose child anchors are the gallery items */\n gallery: Readonly<Ref<HTMLElement | null | undefined>>\n /** CSS selector for gallery items inside the container (default: `'a[data-pswp-src]'`) */\n children?: string\n loop?: boolean\n /** Show a download button in the lightbox toolbar */\n downloadable?: boolean\n /** Show an open-in-new-tab button in the lightbox toolbar */\n openInNewTab?: boolean\n /**\n * Hands the items to the shared lightbox of a container above\n * (`provideSharedLightbox`), when there is one.\n */\n shared?: boolean\n /**\n * Offers \"Annota e chiedi\" where a chat provides it\n * (`provideImageAnnotation`): the conversation's lightbox only, not the\n * one of an attachment still in the composer, which has its own editor.\n */\n annotatable?: boolean\n}\n\nexport interface UseLightboxReturn {\n lightbox: ShallowRef<PhotoSwipeLightbox | null>\n /** Initialises PhotoSwipe. Call this inside `onMounted`. */\n init: () => Promise<void>\n /**\n * The items went to a shared lightbox: their anchors carry\n * `data-pswp-shared`, and `init` starts that lightbox instead.\n */\n shared: boolean\n}\n\n/**\n * Encapsulates PhotoSwipe 5 initialisation, toolbar customisation, and lifecycle cleanup.\n * CSS is injected into `document.head` so the overlay works in both regular DOM and Shadow DOM.\n *\n * Usage:\n * ```ts\n * const { init } = useLightbox({ gallery: galleryRef, downloadable: true })\n * onMounted(init)\n * ```\n */\nexport function useLightbox(options: LightboxOptions): UseLightboxReturn {\n const {\n gallery,\n children = 'a[data-pswp-src]',\n loop = true,\n downloadable = true,\n openInNewTab = true,\n shared = false,\n annotatable = false,\n } = options\n\n const lightbox = shallowRef<PhotoSwipeLightbox | null>(null)\n const sharedLightbox = shared ? useSharedLightbox() : undefined\n const annotation = annotatable\n ? inject(IMAGE_ANNOTATION, undefined)\n : undefined\n const { t: $t } = useI18n({ useScope: 'global' })\n let unmounted = false\n\n const init = async () => {\n if (sharedLightbox) {\n sharedLightbox.join()\n return\n }\n if (!gallery.value) {\n return\n }\n\n // PhotoSwipe renders its overlay into document.body, so CSS must be in\n // document.head, not inside a shadow root.\n loadCdnCss(PHOTOSWIPE_CSS)\n injectPhotoSwipeOverrides()\n\n const { default: PhotoSwipeLightbox } =\n await import('photoswipe/lightbox')\n // Unmounted while PhotoSwipe loaded: nothing left to destroy it\n if (unmounted) {\n return\n }\n\n lightbox.value = new PhotoSwipeLightbox({\n gallery: gallery.value,\n children,\n pswpModule: () => import('photoswipe'),\n loop,\n // The wheel zooms around the pointer, as an image viewer does;\n // a drag pans\n wheelToZoom: true,\n // A click, a double tap, the zoom button and Z go from fit to the\n // real pixels, where PhotoSwipe stops at three times fit\n secondaryZoomLevel: (zoomLevel) =>\n Math.min(\n 1,\n MAX_ZOOM_LAYER_WIDTH /\n (zoomLevel.elementSize?.x || MAX_ZOOM_LAYER_WIDTH),\n ),\n closeTitle: $t('action.close'),\n zoomTitle: $t('lightbox.zoom'),\n arrowPrevTitle: $t('action.previous'),\n arrowNextTitle: $t('action.next'),\n errorMsg: $t('label.imageLoadError'),\n arrowPrevSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m10.828 12l4.95 4.95l-1.414 1.415L8 12l6.364-6.364l1.414 1.414z\"/></svg>',\n arrowNextSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z\"/></svg>',\n closeSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z\"/></svg>',\n zoomSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g class=\"pswp__icn--zoom-in\"><path fill=\"#ffffff\" d=\"m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975zM10 10V7h2v3h3v2h-3v3h-2v-3H7v-2z\"/></g><g class=\"pswp__icn--zoom-out\"><path fill=\"#ffffff\" d=\"m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975zM7 10h8v2H7z\"/></g></svg>',\n })\n\n // A markdown image is the `<img>` itself, already loaded: its source\n // and natural size stand in for the data attributes of an anchor\n lightbox.value.addFilter('domItemData', (itemData, element, linkEl) => {\n if (linkEl) {\n return { ...itemData, caption: linkEl.dataset.pswpCaption }\n }\n if (!(element instanceof HTMLImageElement)) {\n return itemData\n }\n const src = element.currentSrc || element.src\n return {\n ...itemData,\n src,\n msrc: src,\n width: element.naturalWidth || DEFAULT_IMAGE_SIZE.width,\n height: element.naturalHeight || DEFAULT_IMAGE_SIZE.height,\n alt: element.alt,\n caption: element.alt,\n }\n })\n\n // The arrows and the zoom button wait for the lightbox to open, as\n // the keyboard does\n lightbox.value.on('uiRegister', () => {\n const ui = lightbox.value?.pswp?.ui\n if (ui) {\n ui.uiElementsData = ui.uiElementsData.map(holdUntilOpen)\n }\n })\n\n // The caption under the image, as text: the agent or a page it read\n // may have written it\n lightbox.value.on('uiRegister', () => {\n lightbox.value?.pswp?.ui?.registerElement({\n name: 'caption',\n className: 'pswp__caption pswp__hide-on-close',\n appendTo: 'root',\n onInit: (element, pswp) => {\n pswp.on('change', () => {\n const caption = pswp.currSlide?.data.caption ?? ''\n element.textContent = caption\n element.hidden = !caption\n })\n },\n })\n })\n\n // Annotate the image and ask about it: the lightbox closes, the\n // editor opens while the bytes arrive, and the copy joins the\n // attachments of the composer\n if (annotation) {\n lightbox.value.on('uiRegister', () => {\n lightbox.value?.pswp?.ui?.registerElement({\n name: 'annotate-button',\n order: TOOLBAR_ORDER.annotate,\n isButton: true,\n html: ANNOTATE_ICON,\n title: $t('lightbox.annotate'),\n onInit: (element, pswp) => {\n const update = () => {\n const url = getCurrentSlideUrl(pswp)\n element.hidden =\n !url ||\n !annotatableImageUrl(url) ||\n !annotation.available()\n }\n pswp.on('change', update)\n // The composer fills up, or comes back as a call\n // ends, while the lightbox stays on one slide\n pswp.on('destroy', watch(annotation.available, update))\n },\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n const readable = url && annotatableImageUrl(url)\n if (!readable || !annotation.available()) {\n return\n }\n const file = readImageFile(\n readable,\n pswp.currSlide?.data.caption,\n )\n // The editor reads it; one that never opens must not\n // leave its failure unhandled\n void file.catch(() => undefined)\n // PhotoSwipe ignores a close while it opens: a quick\n // click left it over the page, trapping the focus\n if (pswp.opener.isOpen) {\n pswp.close()\n } else {\n pswp.on('openingAnimationEnd', () => pswp.close())\n }\n annotation.annotate(file)\n },\n })\n })\n }\n\n // Copy the image, on the slides whose bytes a page may read\n if (canCopyImages()) {\n lightbox.value.on('uiRegister', () => {\n lightbox.value?.pswp?.ui?.registerElement({\n name: 'copy-button',\n order: TOOLBAR_ORDER.copy,\n isButton: true,\n html: COPY_ICON,\n title: $t('lightbox.copy'),\n onInit: (element, pswp) => {\n pswp.on('change', () => {\n const url = getCurrentSlideUrl(pswp)\n element.hidden = !url || !readableImageUrl(url)\n })\n },\n onClick: (_, element, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n const readable = url && readableImageUrl(url)\n if (!readable) {\n return\n }\n void copyImage(readable, element, {\n copy: $t('lightbox.copy'),\n copied: $t('lightbox.copied'),\n failed: $t('lightbox.copyFailed'),\n })\n },\n })\n })\n }\n\n if (openInNewTab || downloadable) {\n lightbox.value.on('uiRegister', () => {\n const ui = lightbox.value!.pswp?.ui\n if (!ui) {\n return\n }\n\n if (openInNewTab) {\n ui.registerElement({\n name: 'open-in-new-tab-button',\n order: TOOLBAR_ORDER.openInNewTab,\n isButton: true,\n html: '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z\"/></svg>',\n title: $t('lightbox.openInNewTab'),\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n if (url) {\n window.open(\n url,\n '_blank',\n 'noopener,noreferrer',\n )\n }\n },\n })\n }\n\n if (downloadable) {\n ui.registerElement({\n name: 'download-button',\n order: TOOLBAR_ORDER.download,\n isButton: true,\n html: '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z\"/></svg>',\n title: $t('action.download'),\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n if (url) {\n downloadImage(url)\n }\n },\n })\n }\n })\n }\n\n // `+` and `-` zoom by a step around the center of the screen\n lightbox.value.on('keydown', (event) => {\n const { key, ctrlKey, metaKey, altKey } = event.originalEvent\n const factor = ZOOM_KEYS[key]\n const pswp = lightbox.value?.pswp\n const slide = pswp?.currSlide\n if (\n !factor ||\n ctrlKey ||\n metaKey ||\n altKey ||\n !slide?.isZoomable()\n ) {\n return\n }\n // The first stops PhotoSwipe's own handling, the second the browser's\n event.preventDefault()\n event.originalEvent.preventDefault()\n slide.zoomTo(\n slide.currZoomLevel * factor,\n undefined,\n pswp?.options.zoomAnimationDuration,\n )\n })\n\n lightbox.value.init()\n }\n\n onBeforeUnmount(() => {\n unmounted = true\n lightbox.value?.destroy()\n lightbox.value = null\n })\n\n return { lightbox, init, shared: Boolean(sharedLightbox) }\n}\n\n/**\n * The shared lightbox above that takes this component's images, if any: a\n * markdown marks its container with `data-pswp-images` and joins when it\n * shows an image.\n */\nexport function useSharedLightbox(): SharedLightbox | undefined {\n return inject(SHARED_LIGHTBOX, undefined)\n}\n\n/**\n * One lightbox over the images of a container, a conversation: the arrows go\n * through all of them in page order instead of stopping at the card that was\n * clicked. The components inside that pass `shared` to `useLightbox` skip a\n * lightbox of their own and mark their anchors with `data-pswp-shared`; the\n * others, such as a diagram's, keep theirs. It starts when the first image\n * joins, so a conversation without images loads no PhotoSwipe.\n */\nexport function provideSharedLightbox(\n container: Readonly<Ref<HTMLElement | null | undefined>>,\n): void {\n const { init } = useLightbox({\n gallery: container,\n children: SHARED_ITEMS,\n loop: false,\n annotatable: true,\n })\n let joined = false\n let started = false\n const start = async () => {\n if (!joined || started || !container.value) {\n return\n }\n started = true\n try {\n await init()\n } catch {\n // PhotoSwipe did not load: the next image that joins tries again\n started = false\n }\n }\n provide(SHARED_LIGHTBOX, {\n join: () => {\n joined = true\n void start()\n },\n })\n // An image may join before the container is in place\n onMounted(start)\n}\n\n// ---------------------------------------------------------------------------\n// Image size preloading\n// ---------------------------------------------------------------------------\n\nexport interface UseImageSizesReturn {\n preload: (\n images: Array<{ url: string; width?: number; height?: number }>,\n ) => void\n getSize: (url: string) => { width: number; height: number }\n}\n\n/**\n * Preloads natural image dimensions so PhotoSwipe can size its slides correctly.\n * When `width`/`height` are already provided they are used as-is;\n * otherwise the image is loaded in the background to read `naturalWidth`/`naturalHeight`.\n */\nexport function useImageSizes(): UseImageSizesReturn {\n const sizes = ref(new Map<string, { width: number; height: number }>())\n\n const preload = (\n images: Array<{ url: string; width?: number; height?: number }>,\n ) => {\n for (const image of images) {\n if (image.width && image.height) {\n sizes.value.set(image.url, {\n width: image.width,\n height: image.height,\n })\n continue\n }\n const img = new Image()\n img.onload = () => {\n sizes.value.set(image.url, {\n width: img.naturalWidth,\n height: img.naturalHeight,\n })\n }\n img.src = image.url\n }\n }\n\n const getSize = (url: string) => sizes.value.get(url) ?? DEFAULT_IMAGE_SIZE\n\n return { preload, getSize }\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n// PhotoSwipe's buttons that act on the slides, by the method they call.\nconst HELD_UNTIL_OPEN: Record<\n string,\n 'prev' | 'next' | 'toggleZoom' | undefined\n> = {\n arrowPrev: 'prev',\n arrowNext: 'next',\n zoom: 'toggleZoom',\n}\n\n/**\n * PhotoSwipe's arrows and zoom button, still until the lightbox has opened.\n * PhotoSwipe holds the keyboard and the gestures until its opening animation\n * ends, but not these buttons. An arrow pressed sooner landed on a slot the\n * end of the opening neither shows nor fills: empty, with no caption and\n * none of the buttons that read the slide. A zoom pressed sooner was still\n * animating when the opening's animation ended, which then never completed\n * the opening: the lightbox stayed over the page and no longer closed. Any\n * other element of the bar is returned as it is.\n */\nexport function holdUntilOpen(data: UIElementData): UIElementData {\n const action = HELD_UNTIL_OPEN[data.name ?? '']\n if (!action) {\n return data\n }\n return {\n ...data,\n onClick: (_, __, pswp) => {\n if (pswp.opener.isOpen) {\n pswp[action]()\n }\n },\n }\n}\n\nfunction getCurrentSlideUrl(pswp: PhotoSwipe): string | undefined {\n return (\n pswp.currSlide?.data?.src ??\n pswp.currSlide?.data?.element\n ?.querySelector('img')\n ?.getAttribute('src') ??\n pswp.currSlide?.data?.element\n ?.querySelector('source')\n ?.getAttribute('srcset') ??\n pswp.currSlide?.data?.element?.getAttribute('src') ??\n undefined\n )\n}\n\nconst ANNOTATE_ICON =\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m15.243 4.512l-6.738 6.737l-.707 2.121l-1.04 1.041l2.828 2.828l1.04-1.04l2.122-.708l6.737-6.737zm6.364 3.535a1 1 0 0 1 0 1.414l-7.778 7.778l-2.122.707l-1.414 1.415a1 1 0 0 1-1.414 0l-4.243-4.243a1 1 0 0 1 0-1.414L6.05 12.29l.707-2.122l7.779-7.778a1 1 0 0 1 1.414 0zm-6.364-.707l1.414 1.414l-4.95 4.95l-1.414-1.414zm-10.96 9.546l2.828 2.828l-1.414 1.415l-4.243-1.415z\"/></svg>'\nconst COPY_ICON =\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z\"/></svg>'\nconst COPIED_ICON =\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m10 15.172l9.192-9.193l1.415 1.414L10 18l-6.364-6.364l1.414-1.414z\"/></svg>'\nconst COPY_FAILED_ICON =\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm0-8h2v6h-2z\"/></svg>'\n\n// How long the button shows the outcome of a copy before it is a copy again.\nconst COPY_FEEDBACK_MS = 1500\nconst copyFeedbackTimers = new WeakMap<\n HTMLElement,\n ReturnType<typeof setTimeout>\n>()\n\n/** The browser can put an image on the clipboard. */\nfunction canCopyImages(): boolean {\n return (\n typeof ClipboardItem !== 'undefined' &&\n typeof navigator.clipboard?.write === 'function'\n )\n}\n\n/**\n * Where a page may read the bytes of a slide: a chat file through its\n * `/content` route, since its `/view` link redirects to the storage host,\n * which answers no page's CORS; an upload of this session or an inline image\n * as they are. Any other host would refuse the read, so that slide offers no\n * copy.\n */\nfunction readableImageUrl(url: string): string | undefined {\n if (url.startsWith('blob:') || url.startsWith('data:image/')) {\n return url\n }\n if (/\\/chats\\/[^/]+\\/media\\/[^/]+\\/view(\\?|$)/.test(url)) {\n return url.replace(/\\/view(\\?|$)/, '/content$1')\n }\n return undefined\n}\n\n/**\n * Where the editor may read the bytes of a slide: one a page may read\n * (`readableImageUrl`) that the canvas decodes, so not an inline drawing,\n * such as the SVG of a diagram.\n */\nexport function annotatableImageUrl(url: string): string | undefined {\n if (\n url.startsWith('data:') &&\n !/^data:image\\/(png|jpeg|webp|gif)[;,]/.test(url)\n ) {\n return undefined\n }\n return readableImageUrl(url)\n}\n\n/**\n * The name of the copy of an image: its caption when that is a file name,\n * as an attachment's is, else `image` with the extension of its type.\n */\nexport function imageFileName(\n caption: string | undefined,\n type: string,\n): string {\n const name = caption?.trim()\n if (name && /\\.(png|jpe?g|webp|gif)$/i.test(name)) {\n return name\n }\n const subtype = /^image\\/(png|jpeg|webp|gif)$/.exec(type)?.[1]\n return `image.${subtype === 'jpeg' ? 'jpg' : (subtype ?? 'png')}`\n}\n\n/** The bytes of the image at `url`, a readable one. */\nasync function fetchImage(url: string): Promise<Blob> {\n const response = await fetch(url, { credentials: 'include' })\n if (!response.ok) {\n throw new Error(`The image answered ${response.status}`)\n }\n return response.blob()\n}\n\n/** The image at `url` as a file, for the editor. */\nasync function readImageFile(url: string, caption?: string): Promise<File> {\n const blob = await fetchImage(url)\n return new File([blob], imageFileName(caption, blob.type), {\n type: blob.type,\n })\n}\n\n/**\n * The image at `url` as a PNG, the one type every browser puts on the\n * clipboard: another type is drawn on a canvas first.\n */\nasync function readAsPng(url: string): Promise<Blob> {\n const blob = await fetchImage(url)\n if (blob.type === 'image/png') {\n return blob\n }\n // An `<img>` and not `createImageBitmap`, which refuses an SVG\n const objectUrl = URL.createObjectURL(blob)\n try {\n const image = new Image()\n image.src = objectUrl\n await image.decode()\n const canvas = document.createElement('canvas')\n canvas.width = image.naturalWidth\n canvas.height = image.naturalHeight\n canvas.getContext('2d')?.drawImage(image, 0, 0)\n return await new Promise<Blob>((resolve, reject) => {\n canvas.toBlob(\n (png) =>\n png ? resolve(png) : reject(new Error('No PNG was drawn')),\n 'image/png',\n )\n })\n } finally {\n URL.revokeObjectURL(objectUrl)\n }\n}\n\n/**\n * Copies the image and shows on the button how it went. The PNG goes to the\n * clipboard as a promise, so Safari still counts the click as the gesture\n * while the bytes arrive.\n */\nasync function copyImage(\n url: string,\n button: HTMLElement,\n labels: { copy: string; copied: string; failed: string },\n): Promise<void> {\n const show = (icon: string, label: string) => {\n button.innerHTML = icon\n button.title = label\n button.setAttribute('aria-label', label)\n }\n const png = readAsPng(url)\n // The clipboard reads it below; a browser that refuses a promise in\n // `ClipboardItem` never does, and its failure must not go unhandled\n void png.catch(() => undefined)\n try {\n await navigator.clipboard.write([\n new ClipboardItem({ 'image/png': png }),\n ])\n show(COPIED_ICON, labels.copied)\n } catch {\n show(COPY_FAILED_ICON, labels.failed)\n }\n // A second copy restarts the wait instead of being cut short by the first\n clearTimeout(copyFeedbackTimers.get(button))\n copyFeedbackTimers.set(\n button,\n setTimeout(() => show(COPY_ICON, labels.copy), COPY_FEEDBACK_MS),\n )\n}\n\n/**\n * Triggers a client-side download for an image URL.\n *\n * For backend media URLs (.../media/:file/view), navigates to the\n * corresponding /download endpoint which redirects to an Azure SAS URL\n * with `Content-Disposition: attachment`, so no CORS issues.\n *\n * For blob: URLs (in-session uploads), uses the fetch → blob approach.\n *\n * For data: URLs (inline SVGs, etc.), use the download attribute.\n *\n * Falls back to opening in a new tab for all other cases.\n */\nfunction downloadImage(url: string): void {\n const downloadUrl = toDownloadUrl(url)\n\n const anchor = document.createElement('a')\n anchor.href = downloadUrl\n anchor.target = '_blank'\n anchor.rel = 'noopener noreferrer'\n // `download` attribute works for same-origin, data: and blob: URLs; for\n // cross-origin it is ignored but the browser still follows Content-Disposition.\n anchor.download = getFilenameFromUrl(url)\n document.body.appendChild(anchor)\n anchor.click()\n document.body.removeChild(anchor)\n}\n\n/**\n * Converts a `/view` media URL to its `/download` counterpart.\n * Leaves blob:, data: and all other URLs untouched.\n */\nfunction toDownloadUrl(url: string): string {\n return url.replace(/\\/view(\\?|$)/, '/download$1')\n}\n\nfunction getFilenameFromUrl(url: string): string {\n if (url.startsWith('data:image/svg+xml')) {\n return 'diagram.svg'\n }\n if (url.startsWith('data:')) {\n const mime = url.split(':')[1].split(';')[0]\n const ext = mime.split('/')[1] || 'bin'\n return `image.${ext}`\n }\n try {\n const pathname = new URL(url).pathname\n const name = pathname.split('/').pop()\n return name && name.includes('.') ? name : 'image'\n } catch {\n return 'image'\n }\n}\n\nlet overridesInjected = false\n\n/**\n * Injects a one-time `<style>` into `document.head` that raises\n * PhotoSwipe's z-index above any host UI (e.g. floating chat widgets\n * that use `z-index: 2147483647`), sizes its icons, lays a checkerboard\n * under transparent images and places the caption.\n */\nfunction injectPhotoSwipeOverrides(): void {\n if (overridesInjected) {\n return\n }\n overridesInjected = true\n const style = document.createElement('style')\n style.textContent = [\n '.pswp__counter { font-family: sans-serif; }',\n '.pswp { z-index: 2147483647 !important; }',\n '.pswp__icn { width: 20px; height: 20px; }',\n '.pswp__button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }',\n '.pswp__button[hidden] { display: none; }',\n // Zoom only where the slide zooms, as PhotoSwipe has it: the rule\n // above would show it on every slide\n '.pswp__button--zoom { display: none; }',\n '.pswp--zoom-allowed .pswp__button--zoom { display: flex; }',\n '.pswp__icn--zoom-out { display: none; }',\n '.pswp--zoomed-in .pswp__icn--zoom-in { display: none; }',\n '.pswp--zoomed-in .pswp__icn--zoom-out { display: block; }',\n '.pswp__button--arrow .pswp__icn {left: auto; right: auto; width: 40px; height: 40px; transform: none; margin-top: -20px; }',\n // A checkerboard under the transparent parts of an image, where a\n // dark logo would vanish into the dark backdrop\n '.pswp__img { background: repeating-conic-gradient(#e6e6e6 0% 25%, #ffffff 0% 50%) 50% / 16px 16px; }',\n '.pswp__caption { position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(720px, calc(100% - 32px)); padding: 6px 12px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #ffffff; font: 14px/1.4 sans-serif; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }',\n '.pswp__caption[hidden] { display: none; }',\n ].join(' ')\n document.head.appendChild(style)\n}\n"],"mappings":";;;;;;AAkBA,IAAMW,IACF,iEAEEC,IAAqB;CAAE,OAAO;CAAM,QAAQ;AAAI,GAIhDC,IAAuB,KAGvBC,IAAgD;CAClD,KAAK;CACL,KAAK;CACL,KAAK;CACL,GAAG;AACP,GAOMC,IAAgB;CAClB,UAAU;CACV,MAAM;CACN,cAAc;CACd,UAAU;AACd,GASMC,IAAgD,OAAO,gBAAgB,GAcvEC,IACF,OAAO,iBAAiB;AAM5B,SAAgBC,EAAuB,GAAmC;CACtE,EAAQD,GAAkBE,CAAU;AACxC;AAOA,IAAMC,IACF;AAwDJ,SAAgBC,EAAY,GAA6C;CACrE,IAAM,EACF,YACA,cAAW,oBACX,UAAO,IACP,kBAAe,IACf,kBAAe,IACf,YAAS,IACT,iBAAc,OACdC,GAEEC,IAAWf,EAAsC,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;AACJ;AAEA,IAAIqB,IAAoB;AAQxB,SAASzE,IAAkC;CACvC,IAAIyE,GACA;CAEJ,IAAoB;CACpB,IAAMC,IAAQ,SAAS,cAAc,OAAO;CAqB5C,AApBA,EAAM,cAAc,isCAoBpB,SAAS,KAAK,YAAYA,CAAK;AACnC"}
@@ -15,9 +15,9 @@ import { $ as On, A as kn, B as An, C as jn, D as Mn, E as Nn, F as Pn, H as Fn,
15
15
  import { t as xr } from "./_chunks/useShortUrlResolver-DAVZE_by.js";
16
16
  import { t as Sr } from "./_chunks/useImageFallback-DSKCe5aP.js";
17
17
  import { t as Cr } from "./_chunks/_plugin-vue_export-helper-Djzt4Yr7.js";
18
- import { t as wr } from "./_chunks/PkStreamingMarkdown-qoTgaVHP.js";
19
- import { t as Tr } from "./_chunks/PkChatbotFilePreview-jN3SAlut.js";
20
- import { n as Er, t as Dr } from "./_chunks/useLightbox-CUT_xmuZ.js";
18
+ import { t as wr } from "./_chunks/PkStreamingMarkdown-GRB3Gg_x.js";
19
+ import { t as Tr } from "./_chunks/PkChatbotFilePreview-B4vbUkNp.js";
20
+ import { n as Er, t as Dr } from "./_chunks/useLightbox-Co8iz61W.js";
21
21
  import { a as Or, i as kr, n as Ar, t as jr } from "./_chunks/markdown-BeFZwXWu.js";
22
22
  import { t as Mr } from "./_chunks/chatImagePolicy-Ckz-KAHA.js";
23
23
  // ../../node_modules/.pnpm/pinia@4.1.0_@vue+devtools-api@8.2.1_typescript@6.0.3_vue@3.5.45_typescript@6.0.3_/node_modules/pinia/dist/pinia.js
@@ -16610,22 +16610,22 @@ var lb = ["datetime"], ub = 6e4, db = /* @__PURE__ */ q({
16610
16610
  V();
16611
16611
  var fb = {
16612
16612
  requestOAuthConnection: j(() => import("./_chunks/PkToolRequestOAuthConnection-Dz0qfYu5.js")),
16613
- shareDocument: j(() => import("./_chunks/PkToolShareDocument-NUMXFQ2e.js")),
16614
- showArtifact: j(() => import("./_chunks/PkToolShowArtifact-D1p76r2a.js")),
16613
+ shareDocument: j(() => import("./_chunks/PkToolShareDocument-DYr0Rq4D.js")),
16614
+ showArtifact: j(() => import("./_chunks/PkToolShowArtifact-C9_DHr5Y.js")),
16615
16615
  showCalendarEvent: j(() => import("./_chunks/PkToolShowCalendarEvent-fMI-paCP.js")),
16616
16616
  showChart: j(() => import("./_chunks/PkToolShowChart-lLXuHRJu.js")),
16617
16617
  showComparison: j(() => import("./_chunks/PkToolShowComparison-CKSqPgJo.js")),
16618
- showContactForm: j(() => import("./_chunks/PkToolShowContactForm-B4S4qtxp.js")),
16619
- showDiagram: j(() => import("./_chunks/PkToolShowDiagram-CauQT97Z.js")),
16618
+ showContactForm: j(() => import("./_chunks/PkToolShowContactForm-DhyelktO.js")),
16619
+ showDiagram: j(() => import("./_chunks/PkToolShowDiagram-DWVSCu33.js")),
16620
16620
  showEmail: j(() => import("./_chunks/PkToolShowEmail-CClEA1rp.js")),
16621
- showImageGallery: j(() => import("./_chunks/PkToolShowImageGallery-DFhYCp-v.js")),
16621
+ showImageGallery: j(() => import("./_chunks/PkToolShowImageGallery-By-CPFS0.js")),
16622
16622
  showLocation: j(() => import("./_chunks/PkToolShowLocation-DaFjO8MV.js")),
16623
16623
  showMessage: j(() => import("./_chunks/PkToolShowMessage-DIDp9JCf.js")),
16624
- showForm: j(() => import("./_chunks/PkToolShowForm-1sJBr8KY.js")),
16625
- showMultipleChoice: j(() => import("./_chunks/PkToolShowForm-1sJBr8KY.js")),
16624
+ showForm: j(() => import("./_chunks/PkToolShowForm-Dz2Hnzts.js")),
16625
+ showMultipleChoice: j(() => import("./_chunks/PkToolShowForm-Dz2Hnzts.js")),
16626
16626
  showProductList: j(() => import("./_chunks/PkToolShowProductList-CY96IGWn.js")),
16627
16627
  showQrCode: j(() => import("./_chunks/PkToolShowQrCode-DZkJIyMF.js")),
16628
- showSources: j(() => import("./_chunks/PkToolShowSources-DFHejVc0.js")),
16628
+ showSources: j(() => import("./_chunks/PkToolShowSources-YDHIZ6Ly.js")),
16629
16629
  showSuggestedReply: j(() => import("./_chunks/PkToolShowSuggestedReply-DKuV4mmV.js")),
16630
16630
  showVideo: j(() => import("./_chunks/PkToolShowVideo-DI6ohcVU.js")),
16631
16631
  showWeather: j(() => import("./_chunks/PkToolShowWeather-HElfkyLV.js")),
@@ -19300,7 +19300,7 @@ var EC = { class: "pk-chatbot-view-chat__input-stage" }, DC = {
19300
19300
  "selection-action"
19301
19301
  ],
19302
19302
  setup(e, { emit: t }) {
19303
- let n = j(() => import("./_chunks/PkToolShowForm-1sJBr8KY.js")), r = j(() => import("./_chunks/PkToolShowContactForm-B4S4qtxp.js")), i = j(() => import("./_chunks/PkToolShowSuggestedReply-DKuV4mmV.js")), a = j(() => import("./_chunks/PkToolShowSources-DFHejVc0.js")), o = j(() => import("./_chunks/PkToolRequestGeolocation-DZenn1az.js")), s = j(() => import("./_chunks/PkToolRequestOAuthConnection-Dz0qfYu5.js")), c = j(() => import("./_chunks/PkToolShowLocation-DaFjO8MV.js")), l = j(() => import("./_chunks/PkToolShowChart-lLXuHRJu.js")), u = j(() => import("./_chunks/PkToolShowDiagram-CauQT97Z.js")), d = j(() => import("./_chunks/PkToolChatFile-uAyCds1k.js")), f = j(() => import("./_chunks/PkToolShareDocument-NUMXFQ2e.js")), p = j(() => import("./_chunks/PkFilePreview-SBGa95Ca.js").then((e) => e.n)), m = j(() => import("./_chunks/PkFilePreviewDialog-Cc7iZWCl.js")), h = e, g = t, _ = Up(h.agentId), { isReadOnlyChat: v, chatProjectId: y, agentInterface: b, agentFileUpload: x, agentType: S, agentVoice: C, actions: ee, revisedAnswers: w, messages: T, chat: E, messageFeedbacks: te, feedbackDialogMessage: ne, isFeedbackSubmitting: re, isFeedbackSubmitted: D, feedbackSubmitError: O, isLeadSubmitted: ie, isLoadingSubmitLead: ae, submitLeadError: k, input: oe, inputMessagePlaceholder: se, isConversationBlocked: ce, baseUrl: le, pendingAttachments: ue, isAttachmentLimitReached: de, fileLimitError: fe, apiClient: pe, isDark: me, hostToolsPending: he, pageNoticeLevel: A, hostConfirmation: ge, agentPageAccess: _e, hostStepTitles: ve, hostStepChanges: ye, confirmationMode: be, canQueue: xe, queuedMessages: Ce, backgroundAnswers: we, inputFocusRequest: Te, pagePointer: Ee, pagePointerAvailable: Oe, pagePointing: ke, agentSelectionActions: je } = di(_);
19303
+ let n = j(() => import("./_chunks/PkToolShowForm-Dz2Hnzts.js")), r = j(() => import("./_chunks/PkToolShowContactForm-DhyelktO.js")), i = j(() => import("./_chunks/PkToolShowSuggestedReply-DKuV4mmV.js")), a = j(() => import("./_chunks/PkToolShowSources-YDHIZ6Ly.js")), o = j(() => import("./_chunks/PkToolRequestGeolocation-DZenn1az.js")), s = j(() => import("./_chunks/PkToolRequestOAuthConnection-Dz0qfYu5.js")), c = j(() => import("./_chunks/PkToolShowLocation-DaFjO8MV.js")), l = j(() => import("./_chunks/PkToolShowChart-lLXuHRJu.js")), u = j(() => import("./_chunks/PkToolShowDiagram-DWVSCu33.js")), d = j(() => import("./_chunks/PkToolChatFile-DTm5-CE4.js")), f = j(() => import("./_chunks/PkToolShareDocument-DYr0Rq4D.js")), p = j(() => import("./_chunks/PkFilePreview-SBGa95Ca.js").then((e) => e.n)), m = j(() => import("./_chunks/PkFilePreviewDialog-Cc7iZWCl.js")), h = e, g = t, _ = Up(h.agentId), { isReadOnlyChat: v, chatProjectId: y, agentInterface: b, agentFileUpload: x, agentType: S, agentVoice: C, actions: ee, revisedAnswers: w, messages: T, chat: E, messageFeedbacks: te, feedbackDialogMessage: ne, isFeedbackSubmitting: re, isFeedbackSubmitted: D, feedbackSubmitError: O, isLeadSubmitted: ie, isLoadingSubmitLead: ae, submitLeadError: k, input: oe, inputMessagePlaceholder: se, isConversationBlocked: ce, baseUrl: le, pendingAttachments: ue, isAttachmentLimitReached: de, fileLimitError: fe, apiClient: pe, isDark: me, hostToolsPending: he, pageNoticeLevel: A, hostConfirmation: ge, agentPageAccess: _e, hostStepTitles: ve, hostStepChanges: ye, confirmationMode: be, canQueue: xe, queuedMessages: Ce, backgroundAnswers: we, inputFocusRequest: Te, pagePointer: Ee, pagePointerAvailable: Oe, pagePointing: ke, agentSelectionActions: je } = di(_);
19304
19304
  Se(pr, ve), Se(lr, ye);
19305
19305
  let Me = Ve("inputEl");
19306
19306
  N(Te, () => {
@@ -1 +1 @@
1
- export { t as default } from "./_chunks/PkChatbot-VJorpNbU.js";
1
+ export { t as default } from "./_chunks/PkChatbot-CwHVS4sT.js";
@@ -1 +1 @@
1
- export { t as default } from "./_chunks/PkChatbotEmptyState-B9dYpXZm.js";
1
+ export { t as default } from "./_chunks/PkChatbotEmptyState-BF3Odn3v.js";
@@ -1 +1 @@
1
- export { t as default } from "./_chunks/PkChatbotFilePreview-5_bih_vc.js";
1
+ export { t as default } from "./_chunks/PkChatbotFilePreview-aKJBtw04.js";
@@ -1 +1 @@
1
- export { t as default } from "./_chunks/PkChatbotInput-BLKhf3WD.js";
1
+ export { t as default } from "./_chunks/PkChatbotInput-DNXvFvyG.js";
@@ -1 +1 @@
1
- export { t as default } from "./_chunks/PkChatbotMessages-Dx_IIX0J.js";
1
+ export { t as default } from "./_chunks/PkChatbotMessages-DOOQRLEc.js";
@@ -1 +1 @@
1
- export { t as default } from "./_chunks/PkChatbotSteps-BAQ1LriG.js";
1
+ export { t as default } from "./_chunks/PkChatbotSteps-BalLo6DZ.js";
@@ -1 +1 @@
1
- export { t as default } from "./_chunks/PkChatbotViewChat-1RqLcPl4.js";
1
+ export { t as default } from "./_chunks/PkChatbotViewChat-BWdFuQ4P.js";
@@ -3,11 +3,11 @@ import { n as t } from "./useChatbotStore-ChrZVIDt.js";
3
3
  import { t as n } from "./useLocalizedString-Dmn92nix.js";
4
4
  import { t as r } from "./useShortUrlResolver-KJDk7QLj.js";
5
5
  import { t as ee } from "./PkAvatar-DwtZWSW4.js";
6
- import { t as te } from "./PkChatbotViewChat-1RqLcPl4.js";
6
+ import { t as te } from "./PkChatbotViewChat-BWdFuQ4P.js";
7
7
  import { t as ne } from "./PkChatbotViewConversations-D0vDYTyo.js";
8
8
  import { t as re } from "./PkChatbotViewFiles-Bj5Nkzst.js";
9
9
  import { t as ie } from "./PkChatbotViewProfile-GW0WuMOy.js";
10
- import { n as i, t as ae } from "./PkStreamingMarkdown-D6Qxwf47.js";
10
+ import { n as i, t as ae } from "./PkStreamingMarkdown-CMxiJTMR.js";
11
11
  import { t as a } from "./chatbotProfileContext-b-nve-mR.js";
12
12
  import { c as oe, z as se } from "./utils-Bdk5kFfi.js";
13
13
  import { VvAlert as ce, VvButtonGroup as le, VvDropdown as ue, VvDropdownAction as de, VvIcon as fe } from "@volverjs/ui-vue/components";
@@ -295,4 +295,4 @@ var Ce = { class: "pk-chatbot__header-start" }, we = ["title"], Te = { key: 1 },
295
295
  });
296
296
  export { O as t };
297
297
 
298
- //# sourceMappingURL=PkChatbot-VJorpNbU.js.map
298
+ //# sourceMappingURL=PkChatbot-CwHVS4sT.js.map