@8wave/ai-elements 0.126.0-beta.31 → 0.126.0-beta.33

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 (147) hide show
  1. package/dist/_chunks/{Agent-COa7L9GK.js → Agent-DZEyfr8D.js} +2 -1
  2. package/dist/_chunks/Agent-DZEyfr8D.js.map +1 -0
  3. package/dist/_chunks/{PkFilePreview-SBGa95Ca.js → PkFilePreview-C6ZZablL.js} +3 -3
  4. package/dist/_chunks/{PkFilePreview-SBGa95Ca.js.map → PkFilePreview-C6ZZablL.js.map} +1 -1
  5. package/dist/_chunks/{PkFilePreviewDialog-Cc7iZWCl.js → PkFilePreviewDialog-BzBHAt8l.js} +2 -2
  6. package/dist/_chunks/{PkFilePreviewDialog-Cc7iZWCl.js.map → PkFilePreviewDialog-BzBHAt8l.js.map} +1 -1
  7. package/dist/_chunks/{PkImageEditorDialog-D13bWv-N.js → PkImageEditorDialog-Dm34WFmS.js} +2 -2
  8. package/dist/_chunks/{PkImageEditorDialog-D13bWv-N.js.map → PkImageEditorDialog-Dm34WFmS.js.map} +1 -1
  9. package/dist/_chunks/{PkSelectionActions-BaX_rsCt.js → PkSelectionActions-CYqbMEjg.js} +2 -2
  10. package/dist/_chunks/{PkSelectionActions-BaX_rsCt.js.map → PkSelectionActions-CYqbMEjg.js.map} +1 -1
  11. package/dist/_chunks/{PkStreamingMarkdown-GRB3Gg_x.js → PkStreamingMarkdown-B8rZbprU.js} +3 -3
  12. package/dist/_chunks/{PkStreamingMarkdown-GRB3Gg_x.js.map → PkStreamingMarkdown-B8rZbprU.js.map} +1 -1
  13. package/dist/_chunks/{PkToolChatFile-DTm5-CE4.js → PkToolChatFile-C0emIVfS.js} +3 -3
  14. package/dist/_chunks/{PkToolChatFile-DTm5-CE4.js.map → PkToolChatFile-C0emIVfS.js.map} +1 -1
  15. package/dist/_chunks/{PkToolRequestGeolocation-DZenn1az.js → PkToolRequestGeolocation-DNzNRszE.js} +2 -2
  16. package/dist/_chunks/{PkToolRequestGeolocation-DZenn1az.js.map → PkToolRequestGeolocation-DNzNRszE.js.map} +1 -1
  17. package/dist/_chunks/{PkToolRequestOAuthConnection-Dz0qfYu5.js → PkToolRequestOAuthConnection-BDxYXz4s.js} +2 -2
  18. package/dist/_chunks/{PkToolRequestOAuthConnection-Dz0qfYu5.js.map → PkToolRequestOAuthConnection-BDxYXz4s.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowArtifact-C9_DHr5Y.js → PkToolShowArtifact-B_KIIjEn.js} +2 -2
  20. package/dist/_chunks/{PkToolShowArtifact-C9_DHr5Y.js.map → PkToolShowArtifact-B_KIIjEn.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowContactForm-DhyelktO.js → PkToolShowContactForm-DiHb3fRQ.js} +2 -2
  22. package/dist/_chunks/{PkToolShowContactForm-DhyelktO.js.map → PkToolShowContactForm-DiHb3fRQ.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowForm-Dz2Hnzts.js → PkToolShowForm-BmUAhIQy.js} +4 -4
  24. package/dist/_chunks/{PkToolShowForm-Dz2Hnzts.js.map → PkToolShowForm-BmUAhIQy.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowImageGallery-CiDfIboY.js → PkToolShowImageGallery-CZ394fdT.js} +2 -2
  26. package/dist/_chunks/{PkToolShowImageGallery-CiDfIboY.js.map → PkToolShowImageGallery-CZ394fdT.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowProductList-CY96IGWn.js → PkToolShowProductList-uNvUr2s9.js} +2 -2
  28. package/dist/_chunks/{PkToolShowProductList-CY96IGWn.js.map → PkToolShowProductList-uNvUr2s9.js.map} +1 -1
  29. package/dist/_chunks/{PkToolShowSources-CRk-MOoE.js → PkToolShowSources-Dm0L4prK.js} +3 -3
  30. package/dist/_chunks/{PkToolShowSources-CRk-MOoE.js.map → PkToolShowSources-Dm0L4prK.js.map} +1 -1
  31. package/dist/_chunks/{PkToolShowSuggestedReply-DKuV4mmV.js → PkToolShowSuggestedReply-B_dRrZfj.js} +2 -2
  32. package/dist/_chunks/{PkToolShowSuggestedReply-DKuV4mmV.js.map → PkToolShowSuggestedReply-B_dRrZfj.js.map} +1 -1
  33. package/dist/_chunks/{PkToolShowVideo-DI6ohcVU.js → PkToolShowVideo-DLgQjTq_.js} +2 -2
  34. package/dist/_chunks/{PkToolShowVideo-DI6ohcVU.js.map → PkToolShowVideo-DLgQjTq_.js.map} +1 -1
  35. package/dist/_chunks/{PkToolShowWebPages-Dh6L_n9T.js → PkToolShowWebPages-Cj2mJrs5.js} +2 -2
  36. package/dist/_chunks/{PkToolShowWebPages-Dh6L_n9T.js.map → PkToolShowWebPages-Cj2mJrs5.js.map} +1 -1
  37. package/dist/_chunks/{chatImagePolicy-Ckz-KAHA.js → chatImagePolicy-DMt6O5iK.js} +2 -2
  38. package/dist/_chunks/{chatImagePolicy-Ckz-KAHA.js.map → chatImagePolicy-DMt6O5iK.js.map} +1 -1
  39. package/dist/_chunks/{markdown-DHayRAiy.js → markdown-nw5sXwU0.js} +2 -2
  40. package/dist/_chunks/{markdown-DHayRAiy.js.map → markdown-nw5sXwU0.js.map} +1 -1
  41. package/dist/_chunks/{utils-3jpXeGGy.js → utils-DPGBO-HU.js} +2 -2
  42. package/dist/_chunks/{utils-3jpXeGGy.js.map → utils-DPGBO-HU.js.map} +1 -1
  43. package/dist/ai-elements.es.js +3927 -3858
  44. package/dist/ai-elements.es.js.map +1 -1
  45. package/dist-vue/PkChatbot.js +1 -1
  46. package/dist-vue/PkChatbotEmptyState.js +1 -1
  47. package/dist-vue/PkChatbotInput.js +1 -1
  48. package/dist-vue/PkChatbotMessages.js +1 -1
  49. package/dist-vue/PkChatbotStepPayload.js +1 -1
  50. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  51. package/dist-vue/PkChatbotSteps.js +1 -1
  52. package/dist-vue/PkChatbotViewChat.js +1 -1
  53. package/dist-vue/PkChatbotViewConversations.js +1 -1
  54. package/dist-vue/PkChatbotViewFiles.js +1 -1
  55. package/dist-vue/PkChatbotViewProfile.js +1 -1
  56. package/dist-vue/_chunks/{Agent-CRwhrv5Z.js → Agent-CBAd3F7k.js} +2 -1
  57. package/dist-vue/_chunks/Agent-CBAd3F7k.js.map +1 -0
  58. package/dist-vue/_chunks/{Document-Bp-qpa8v.js → Document-B3w5H0R0.js} +2 -2
  59. package/dist-vue/_chunks/{Document-Bp-qpa8v.js.map → Document-B3w5H0R0.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkChatbot-CtrcDgBe.js → PkChatbot-CXpftmWm.js} +8 -8
  61. package/dist-vue/_chunks/{PkChatbot-CtrcDgBe.js.map → PkChatbot-CXpftmWm.js.map} +1 -1
  62. package/dist-vue/_chunks/{PkChatbotEmptyState-BF3Odn3v.js → PkChatbotEmptyState-vA2v4FES.js} +2 -2
  63. package/dist-vue/_chunks/{PkChatbotEmptyState-BF3Odn3v.js.map → PkChatbotEmptyState-vA2v4FES.js.map} +1 -1
  64. package/dist-vue/_chunks/PkChatbotInput-CIIJ1bpF.js +584 -0
  65. package/dist-vue/_chunks/PkChatbotInput-CIIJ1bpF.js.map +1 -0
  66. package/dist-vue/_chunks/{PkChatbotMessages-10eBKpC5.js → PkChatbotMessages-15R8RxAq.js} +18 -18
  67. package/dist-vue/_chunks/{PkChatbotMessages-10eBKpC5.js.map → PkChatbotMessages-15R8RxAq.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkChatbotStepPayload-C4ahOq6Z.js → PkChatbotStepPayload-BbNSav-U.js} +2 -2
  69. package/dist-vue/_chunks/{PkChatbotStepPayload-C4ahOq6Z.js.map → PkChatbotStepPayload-BbNSav-U.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkChatbotStepToolDetail-CkIX0aKu.js → PkChatbotStepToolDetail-B_4pmbLe.js} +3 -3
  71. package/dist-vue/_chunks/{PkChatbotStepToolDetail-CkIX0aKu.js.map → PkChatbotStepToolDetail-B_4pmbLe.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkChatbotSteps-BalLo6DZ.js → PkChatbotSteps-h4E6DH_g.js} +5 -5
  73. package/dist-vue/_chunks/{PkChatbotSteps-BalLo6DZ.js.map → PkChatbotSteps-h4E6DH_g.js.map} +1 -1
  74. package/dist-vue/_chunks/PkChatbotViewChat-CLQ0J9_f.js +1382 -0
  75. package/dist-vue/_chunks/PkChatbotViewChat-CLQ0J9_f.js.map +1 -0
  76. package/dist-vue/_chunks/{PkChatbotViewConversations-D0vDYTyo.js → PkChatbotViewConversations-DFBbypGg.js} +3 -3
  77. package/dist-vue/_chunks/{PkChatbotViewConversations-D0vDYTyo.js.map → PkChatbotViewConversations-DFBbypGg.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkChatbotViewFiles-BwfAnywk.js → PkChatbotViewFiles-PHdrHZOf.js} +3 -3
  79. package/dist-vue/_chunks/{PkChatbotViewFiles-BwfAnywk.js.map → PkChatbotViewFiles-PHdrHZOf.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkChatbotViewProfile-GW0WuMOy.js → PkChatbotViewProfile-B0AZvHTr.js} +2 -2
  81. package/dist-vue/_chunks/{PkChatbotViewProfile-GW0WuMOy.js.map → PkChatbotViewProfile-B0AZvHTr.js.map} +1 -1
  82. package/dist-vue/_chunks/{PkFilePreview-qizsvSVW.js → PkFilePreview-Cb-1YRPN.js} +616 -666
  83. package/dist-vue/_chunks/PkFilePreview-Cb-1YRPN.js.map +1 -0
  84. package/dist-vue/_chunks/{PkFilePreviewDialog-WsVzH9hg.js → PkFilePreviewDialog-Bd7kEoCB.js} +2 -2
  85. package/dist-vue/_chunks/{PkFilePreviewDialog-WsVzH9hg.js.map → PkFilePreviewDialog-Bd7kEoCB.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkImageEditorDialog-NQFpdqCU.js → PkImageEditorDialog-Bj4sUHXM.js} +2 -2
  87. package/dist-vue/_chunks/{PkImageEditorDialog-NQFpdqCU.js.map → PkImageEditorDialog-Bj4sUHXM.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkStreamingMarkdown-CMxiJTMR.js → PkStreamingMarkdown-BcUq4ThC.js} +3 -3
  89. package/dist-vue/_chunks/{PkStreamingMarkdown-CMxiJTMR.js.map → PkStreamingMarkdown-BcUq4ThC.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolChatFile-Bd6Ci7i1.js → PkToolChatFile-BOexrlLt.js} +3 -3
  91. package/dist-vue/_chunks/{PkToolChatFile-Bd6Ci7i1.js.map → PkToolChatFile-BOexrlLt.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolRequestGeolocation-C2OmF31d.js → PkToolRequestGeolocation-CyL_M1Rm.js} +2 -2
  93. package/dist-vue/_chunks/{PkToolRequestGeolocation-C2OmF31d.js.map → PkToolRequestGeolocation-CyL_M1Rm.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-CgD-o99C.js → PkToolRequestOAuthConnection-DWkeVLpx.js} +2 -2
  95. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-CgD-o99C.js.map → PkToolRequestOAuthConnection-DWkeVLpx.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkToolShowArtifact-rlZ-AGWh.js → PkToolShowArtifact-C4gHB6lH.js} +2 -2
  97. package/dist-vue/_chunks/{PkToolShowArtifact-rlZ-AGWh.js.map → PkToolShowArtifact-C4gHB6lH.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowChart-B8xJi1yY.js → PkToolShowChart-CsPXNAb9.js} +2 -2
  99. package/dist-vue/_chunks/{PkToolShowChart-B8xJi1yY.js.map → PkToolShowChart-CsPXNAb9.js.map} +1 -1
  100. package/dist-vue/_chunks/{PkToolShowContactForm-BVBL7Unx.js → PkToolShowContactForm-2_HBPZaa.js} +2 -2
  101. package/dist-vue/_chunks/{PkToolShowContactForm-BVBL7Unx.js.map → PkToolShowContactForm-2_HBPZaa.js.map} +1 -1
  102. package/dist-vue/_chunks/{PkToolShowDiagram-Bs39QQZ3.js → PkToolShowDiagram-cCbeL6MK.js} +2 -2
  103. package/dist-vue/_chunks/{PkToolShowDiagram-Bs39QQZ3.js.map → PkToolShowDiagram-cCbeL6MK.js.map} +1 -1
  104. package/dist-vue/_chunks/{PkToolShowForm-D-RJeA2F.js → PkToolShowForm-DjB3fji5.js} +4 -4
  105. package/dist-vue/_chunks/{PkToolShowForm-D-RJeA2F.js.map → PkToolShowForm-DjB3fji5.js.map} +1 -1
  106. package/dist-vue/_chunks/{PkToolShowImageGallery-CrkkKCVI.js → PkToolShowImageGallery-C22TCUKW.js} +2 -2
  107. package/dist-vue/_chunks/{PkToolShowImageGallery-CrkkKCVI.js.map → PkToolShowImageGallery-C22TCUKW.js.map} +1 -1
  108. package/dist-vue/_chunks/{PkToolShowProductList-BwfUG41_.js → PkToolShowProductList-BvtmiHBf.js} +2 -2
  109. package/dist-vue/_chunks/{PkToolShowProductList-BwfUG41_.js.map → PkToolShowProductList-BvtmiHBf.js.map} +1 -1
  110. package/dist-vue/_chunks/{PkToolShowSources-q9gQIuam.js → PkToolShowSources-uKO4MQgd.js} +3 -3
  111. package/dist-vue/_chunks/{PkToolShowSources-q9gQIuam.js.map → PkToolShowSources-uKO4MQgd.js.map} +1 -1
  112. package/dist-vue/_chunks/{PkToolShowSuggestedReply-75Kc8-OQ.js → PkToolShowSuggestedReply-wKgwHTRO.js} +2 -2
  113. package/dist-vue/_chunks/{PkToolShowSuggestedReply-75Kc8-OQ.js.map → PkToolShowSuggestedReply-wKgwHTRO.js.map} +1 -1
  114. package/dist-vue/_chunks/{PkToolShowVideo-BK-jDVJd.js → PkToolShowVideo-DKj5N1vo.js} +2 -2
  115. package/dist-vue/_chunks/{PkToolShowVideo-BK-jDVJd.js.map → PkToolShowVideo-DKj5N1vo.js.map} +1 -1
  116. package/dist-vue/_chunks/{PkToolShowWebPages-K3Jml1f7.js → PkToolShowWebPages-BNZmbCSf.js} +2 -2
  117. package/dist-vue/_chunks/{PkToolShowWebPages-K3Jml1f7.js.map → PkToolShowWebPages-BNZmbCSf.js.map} +1 -1
  118. package/dist-vue/_chunks/{createChatbotApiClient-Pb7_cU2s.js → createChatbotApiClient-DBKfGL6y.js} +5 -2
  119. package/dist-vue/_chunks/{createChatbotApiClient-Pb7_cU2s.js.map → createChatbotApiClient-DBKfGL6y.js.map} +1 -1
  120. package/dist-vue/_chunks/{useChatbotStore-ChrZVIDt.js → useChatbotStore-Hb5EjISl.js} +94 -85
  121. package/dist-vue/_chunks/useChatbotStore-Hb5EjISl.js.map +1 -0
  122. package/dist-vue/_chunks/{utils-Bdk5kFfi.js → utils-waie4Gfn.js} +2 -2
  123. package/dist-vue/_chunks/{utils-Bdk5kFfi.js.map → utils-waie4Gfn.js.map} +1 -1
  124. package/dist-vue/api.js +1 -1
  125. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +2 -0
  126. package/dist-vue/composables.js +8 -8
  127. package/dist-vue/index.js +408 -389
  128. package/dist-vue/index.js.map +1 -1
  129. package/dist-vue/locales.js +6 -0
  130. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +9 -2
  131. package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +6 -0
  132. package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +5 -0
  133. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +10 -1
  134. package/dist-vue/packages/models/src/schema/Agent.d.ts +8 -0
  135. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +2 -0
  136. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +2 -0
  137. package/dist-vue/packages/models/src/schema/constants.d.ts +11 -2
  138. package/dist-vue/style.css +1 -1
  139. package/package.json +1 -1
  140. package/dist/_chunks/Agent-COa7L9GK.js.map +0 -1
  141. package/dist-vue/_chunks/Agent-CRwhrv5Z.js.map +0 -1
  142. package/dist-vue/_chunks/PkChatbotInput-DNXvFvyG.js +0 -520
  143. package/dist-vue/_chunks/PkChatbotInput-DNXvFvyG.js.map +0 -1
  144. package/dist-vue/_chunks/PkChatbotViewChat-U6T-gG-c.js +0 -1336
  145. package/dist-vue/_chunks/PkChatbotViewChat-U6T-gG-c.js.map +0 -1
  146. package/dist-vue/_chunks/PkFilePreview-qizsvSVW.js.map +0 -1
  147. package/dist-vue/_chunks/useChatbotStore-ChrZVIDt.js.map +0 -1
@@ -0,0 +1,584 @@
1
+ import { t as e } from "./VvButtonLocalized-C-vx25u4.js";
2
+ import { s as t } from "./Media-0U2B_qCS.js";
3
+ import { t as n } from "./PkStreamingMarkdown-BcUq4ThC.js";
4
+ import { t as r } from "./PkChatbotFilePreview-aKJBtw04.js";
5
+ import { j as i, k as a } from "./utils-waie4Gfn.js";
6
+ import { VvDropdown as o, VvDropdownAction as s, VvIcon as c } from "@volverjs/ui-vue/components";
7
+ import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as h, createVNode as g, defineAsyncComponent as _, defineComponent as v, mergeModels as y, mergeProps as ee, nextTick as b, normalizeClass as te, normalizeProps as ne, onBeforeUnmount as re, onMounted as ie, onScopeDispose as ae, openBlock as x, ref as S, renderList as oe, renderSlot as se, shallowRef as ce, toDisplayString as C, unref as w, useId as le, useModel as ue, useTemplateRef as T, watch as E, withCtx as D, withKeys as de, withModifiers as fe } from "vue";
8
+ import { useI18n as pe } from "vue-i18n";
9
+ import { useResizeObserver as me } from "@vueuse/core";
10
+ // ../../packages/composable/src/useSettledSelection.ts
11
+ var he = "(hover: hover) and (pointer: fine)", O = "(hover: none) and (pointer: coarse)", k = 400;
12
+ function A() {
13
+ return typeof matchMedia == "function" && matchMedia(O).matches;
14
+ }
15
+ function j(e) {
16
+ let t = document.getSelection();
17
+ if (!t || t.rangeCount === 0) return;
18
+ if (e.nodeType === Node.DOCUMENT_NODE) return t.getRangeAt(0).cloneRange();
19
+ let n = e;
20
+ if (t.getComposedRanges) {
21
+ let e;
22
+ try {
23
+ e = t.getComposedRanges({ shadowRoots: [n] });
24
+ } catch {
25
+ e = t.getComposedRanges(n);
26
+ }
27
+ let [r] = e;
28
+ if (!r) return;
29
+ let i = document.createRange();
30
+ return i.setStart(r.startContainer, r.startOffset), i.setEnd(r.endContainer, r.endOffset), i;
31
+ }
32
+ let r = n.getSelection?.();
33
+ return r && r.rangeCount > 0 ? r.getRangeAt(0).cloneRange() : void 0;
34
+ }
35
+ function M({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2, touch: i = !1 }) {
36
+ let a = ce(), o, s = () => {
37
+ clearTimeout(o), a.value = void 0;
38
+ }, c = () => {
39
+ let n = e();
40
+ if (!n || !t()) return;
41
+ let i = j(n);
42
+ if (!i || i.collapsed || i.toString().trim().length < r) return;
43
+ let a = i.getBoundingClientRect();
44
+ return {
45
+ range: i,
46
+ start: i.getClientRects()[0] ?? a,
47
+ box: a
48
+ };
49
+ }, l = typeof document < "u" && typeof matchMedia == "function" && matchMedia(he).matches, u = i && typeof document < "u" && A(), d = u ? Math.max(n, k) : n, f = () => {
50
+ s(), o = setTimeout(() => {
51
+ a.value = c();
52
+ }, d);
53
+ };
54
+ return (l || u) && (document.addEventListener("selectionchange", f), ae(() => {
55
+ clearTimeout(o), document.removeEventListener("selectionchange", f);
56
+ })), {
57
+ selection: a,
58
+ clear: s
59
+ };
60
+ }
61
+ // ../../node_modules/.pnpm/autosize@6.0.1/node_modules/autosize/dist/autosize.esm.js
62
+ var N = /* @__PURE__ */ new Map();
63
+ function P(e) {
64
+ var t = N.get(e);
65
+ t && t.destroy();
66
+ }
67
+ function F(e) {
68
+ var t = N.get(e);
69
+ t && t.update();
70
+ }
71
+ var I = null;
72
+ typeof window > "u" ? ((I = function(e) {
73
+ return e;
74
+ }).destroy = function(e) {
75
+ return e;
76
+ }, I.update = function(e) {
77
+ return e;
78
+ }) : ((I = function(e, t) {
79
+ return e && Array.prototype.forEach.call(e.length ? e : [e], function(e) {
80
+ return function(e) {
81
+ if (e && e.nodeName && e.nodeName === "TEXTAREA" && !N.has(e)) {
82
+ var t, n = null, r = window.getComputedStyle(e), i = (t = e.value, function() {
83
+ o({
84
+ testForHeightReduction: t === "" || !e.value.startsWith(t),
85
+ restoreTextAlign: null
86
+ }), t = e.value;
87
+ }), a = function(t) {
88
+ e.removeEventListener("autosize:destroy", a), e.removeEventListener("autosize:update", s), e.removeEventListener("input", i), window.removeEventListener("resize", s), Object.keys(t).forEach(function(n) {
89
+ return e.style[n] = t[n];
90
+ }), N.delete(e);
91
+ }.bind(e, {
92
+ height: e.style.height,
93
+ resize: e.style.resize,
94
+ textAlign: e.style.textAlign,
95
+ overflowY: e.style.overflowY,
96
+ overflowX: e.style.overflowX,
97
+ wordWrap: e.style.wordWrap
98
+ });
99
+ e.addEventListener("autosize:destroy", a), e.addEventListener("autosize:update", s), e.addEventListener("input", i), window.addEventListener("resize", s), e.style.overflowX = "hidden", e.style.wordWrap = "break-word", N.set(e, {
100
+ destroy: a,
101
+ update: s
102
+ }), s();
103
+ }
104
+ function o(t) {
105
+ var i, a, s = t.restoreTextAlign, c = s === void 0 ? null : s, l = t.testForHeightReduction, u = l === void 0 || l, d = r.overflowY;
106
+ if (e.scrollHeight !== 0 && (r.resize === "vertical" ? e.style.resize = "none" : r.resize === "both" && (e.style.resize = "horizontal"), u && (i = function(e) {
107
+ for (var t = []; e && e.parentNode && e.parentNode instanceof Element;) e.parentNode.scrollTop && t.push([e.parentNode, e.parentNode.scrollTop]), e = e.parentNode;
108
+ return function() {
109
+ return t.forEach(function(e) {
110
+ var t = e[0], n = e[1];
111
+ t.style.scrollBehavior = "auto", t.scrollTop = n, t.style.scrollBehavior = null;
112
+ });
113
+ };
114
+ }(e), e.style.height = ""), a = r.boxSizing === "content-box" ? e.scrollHeight - (parseFloat(r.paddingTop) + parseFloat(r.paddingBottom)) : e.scrollHeight + parseFloat(r.borderTopWidth) + parseFloat(r.borderBottomWidth), r.maxHeight !== "none" && a > parseFloat(r.maxHeight) ? (r.overflowY === "hidden" && (e.style.overflow = "scroll"), a = parseFloat(r.maxHeight)) : r.overflowY !== "hidden" && (e.style.overflow = "hidden"), e.style.height = a + "px", c && (e.style.textAlign = c), i && i(), n !== a && (e.dispatchEvent(new Event("autosize:resized", { bubbles: !0 })), n = a), d !== r.overflow && !c)) {
115
+ var f = r.textAlign;
116
+ r.overflow === "hidden" && (e.style.textAlign = f === "start" ? "end" : "start"), o({
117
+ restoreTextAlign: f,
118
+ testForHeightReduction: !0
119
+ });
120
+ }
121
+ }
122
+ function s() {
123
+ o({
124
+ testForHeightReduction: !0,
125
+ restoreTextAlign: null
126
+ });
127
+ }
128
+ }(e);
129
+ }), e;
130
+ }).destroy = function(e) {
131
+ return e && Array.prototype.forEach.call(e.length ? e : [e], P), e;
132
+ }, I.update = function(e) {
133
+ return e && Array.prototype.forEach.call(e.length ? e : [e], F), e;
134
+ });
135
+ var L = I, R = ["type"], z = {
136
+ key: 0,
137
+ class: "pk-chat-button__label"
138
+ }, B = /* @__PURE__ */ v({
139
+ __name: "PkChatButton",
140
+ props: {
141
+ icon: {},
142
+ label: { default: void 0 },
143
+ type: { default: "button" },
144
+ modifiers: { default: void 0 }
145
+ },
146
+ setup(e) {
147
+ return (t, n) => {
148
+ let r = c;
149
+ return x(), p("button", {
150
+ class: te(["pk-chat-button", [e.modifiers ? `pk-chat-button--${e.modifiers}` : void 0, { "pk-chat-button--labelled": e.label }]]),
151
+ type: e.type
152
+ }, [g(r, {
153
+ name: e.icon,
154
+ class: "pk-chat-button__icon"
155
+ }, null, 8, ["name"]), e.label ? (x(), p("span", z, C(e.label), 1)) : f("", !0)], 10, R);
156
+ };
157
+ }
158
+ }), ge = { class: "pk-chatbot-input" }, _e = {
159
+ key: 0,
160
+ class: "pk-chatbot-input__notice",
161
+ role: "status"
162
+ }, ve = {
163
+ key: 2,
164
+ class: "pk-chatbot-input__notice-text"
165
+ }, ye = ["title"], be = {
166
+ key: 1,
167
+ class: "pk-chatbot-input__pointer"
168
+ }, xe = { class: "pk-chatbot-input__pointer-label" }, Se = {
169
+ key: 2,
170
+ class: "pk-chatbot-input__attachments"
171
+ }, Ce = { class: "pk-chatbot-input__fieldset" }, we = [
172
+ "title",
173
+ "disabled",
174
+ "onClick"
175
+ ], Te = ["accept"], Ee = ["accept"], De = { class: "pk-chatbot-input__content" }, Oe = [
176
+ "value",
177
+ "aria-label",
178
+ "aria-describedby",
179
+ "aria-invalid",
180
+ "placeholder"
181
+ ], ke = {
182
+ key: 5,
183
+ class: "pk-chatbot-input__suggestion-key"
184
+ }, Ae = ["id"], je = ["id"], Me = { class: "opacity-60" }, V = /* @__PURE__ */ v({
185
+ __name: "PkChatbotInput",
186
+ props: /*@__PURE__*/ y({
187
+ placeholder: {},
188
+ suggestion: {},
189
+ dismissableNotice: {},
190
+ pageNotice: {},
191
+ status: {},
192
+ maxMessageLength: {},
193
+ fileUpload: {},
194
+ attachmentLimitReached: { type: Boolean },
195
+ attachmentNotice: {},
196
+ voiceEnabled: { type: Boolean },
197
+ queueEnabled: { type: Boolean },
198
+ answerNotices: {},
199
+ pointerAvailable: { type: Boolean },
200
+ pointing: { type: Boolean },
201
+ pointer: {},
202
+ automaticConfirmations: { type: Boolean },
203
+ editableImages: { type: Boolean },
204
+ retryableAttachments: { type: Boolean }
205
+ }, {
206
+ modelValue: { default: void 0 },
207
+ modelModifiers: {},
208
+ pendingAttachments: { default: () => [] },
209
+ pendingAttachmentsModifiers: {}
210
+ }),
211
+ emits: /*@__PURE__*/ y([
212
+ "submit",
213
+ "stop-generation",
214
+ "file-select",
215
+ "remove-attachment",
216
+ "replace-attachment",
217
+ "retry-attachment",
218
+ "dismiss-attachment-notice",
219
+ "dismiss-page-notice",
220
+ "open-answer-notice",
221
+ "dismiss-answer-notice",
222
+ "voice-start",
223
+ "point",
224
+ "remove-pointer",
225
+ "manual-confirmations"
226
+ ], ["update:modelValue", "update:pendingAttachments"]),
227
+ setup(v, { expose: y, emit: ae }) {
228
+ let he = _(() => import("./PkImageEditorDialog-Bj4sUHXM.js")), O = ue(v, "modelValue"), k = ue(v, "pendingAttachments"), j = ae, M = v, { t: N } = pe({ useScope: "global" }), P = T("textareaEl"), F = T("fileInputEl"), I = T("cameraInputEl"), R = T("formEl"), z = S(O.value ?? ""), V = null, H = () => {
229
+ V !== null && (clearTimeout(V), V = null);
230
+ }, Ne = () => {
231
+ H(), O.value = z.value;
232
+ }, Pe = () => {
233
+ H(), V = setTimeout(() => {
234
+ O.value = z.value, V = null;
235
+ }, 300);
236
+ }, Fe = () => {
237
+ z.value = P.value?.value ?? "", Pe();
238
+ };
239
+ E(O, (e) => {
240
+ e !== z.value && (z.value = e ?? "", b(() => {
241
+ P.value && L.update(P.value);
242
+ }));
243
+ });
244
+ let U = u(() => M.status === "streaming"), Ie = u(() => M.status === "submitted"), W = u(() => U.value || Ie.value), Le = le(), Re = u(() => z.value.length), G = u(() => M.maxMessageLength !== void 0 && Re.value > M.maxMessageLength), ze = u(() => k.value.some((e) => e.state === "uploading")), Be = u(() => k.value.some((e) => e.state === "error")), K = u(() => W.value && !M.queueEnabled || ze.value || Be.value || G.value ? !1 : z.value.trim().length > 0), Ve = u(() => W.value && K.value), He = !A(), Ue = le(), q = u(() => He && M.suggestion && !z.value && !W.value ? M.suggestion : void 0), We = u(() => [M.maxMessageLength ? Le : void 0, q.value ? Ue : void 0].filter(Boolean).join(" ") || void 0), Ge = "capture" in document.createElement("input"), Ke = u(() => {
245
+ let e = M.fileUpload?.allowedMimeTypes ?? [];
246
+ return [...e, ...t(e)].join(",");
247
+ }), qe = u(() => (M.fileUpload?.allowedMimeTypes ?? []).filter((e) => e.startsWith("image/")).join(",")), J = u(() => Ge && qe.value.length > 0), Je = () => {
248
+ F.value?.click();
249
+ }, Ye = () => {
250
+ I.value?.click();
251
+ }, Xe = (e) => {
252
+ for (let t of e) j("file-select", t);
253
+ }, Ze = (e) => {
254
+ let t = e.target;
255
+ Xe(Array.from(t.files ?? [])), t.value = "";
256
+ }, Qe = (e) => {
257
+ let t = k.value.find((t) => t.id === e);
258
+ t && (URL.revokeObjectURL(t.localUrl), k.value = k.value.filter((t) => t.id !== e), j("remove-attachment", t));
259
+ }, Y = S(), X = u(() => k.value.find((e) => e.id === Y.value)), Z = ce(), Q = u(() => X.value?.file ?? Z.value), $e = (e) => !!M.editableImages && e.state !== "uploading" && a(e.file.type), et = () => {
260
+ Y.value = void 0, Z.value = void 0;
261
+ }, tt = async (e) => {
262
+ let t = X.value, n = !t && !!Z.value;
263
+ if (et(), t) j("replace-attachment", t, e);
264
+ else if (n) j("file-select", e);
265
+ else return;
266
+ await b(), P.value?.focus();
267
+ }, nt = S(!0), rt = () => {
268
+ nt.value = !1;
269
+ }, it = u(() => {
270
+ if (M.attachmentNotice) return [{
271
+ id: "limit",
272
+ icon: "ri:information-line",
273
+ text: M.attachmentNotice,
274
+ dismiss: () => j("dismiss-attachment-notice")
275
+ }];
276
+ let e = [];
277
+ Be.value && e.push({
278
+ id: "upload-failed",
279
+ icon: "ri:error-warning-line",
280
+ text: N("message.attachmentUploadFailed")
281
+ });
282
+ for (let t of M.answerNotices ?? []) e.push({
283
+ id: `answer-${t.id}`,
284
+ icon: "ri:chat-check-line",
285
+ text: t.text,
286
+ open: () => j("open-answer-notice", t.id),
287
+ dismiss: () => j("dismiss-answer-notice", t.id)
288
+ });
289
+ return M.pageNotice && e.push({
290
+ id: "page",
291
+ icon: "ri:pages-line",
292
+ text: M.pageNotice,
293
+ dismiss: () => j("dismiss-page-notice")
294
+ }), M.dismissableNotice && nt.value && e.push({
295
+ id: "dismissable",
296
+ markdown: M.dismissableNotice,
297
+ dismiss: rt
298
+ }), e;
299
+ }), at = () => {
300
+ R.value?.querySelector("button:focus-visible") && P.value?.focus();
301
+ }, ot = () => {
302
+ at(), j("stop-generation");
303
+ }, st = () => {
304
+ K.value && (at(), Ne(), j("submit"), z.value = "", O.value = "", b(() => {
305
+ P.value && (P.value.value = "", L.update(P.value));
306
+ }));
307
+ }, ct = (e) => {
308
+ e.shiftKey || i(e) || (e.preventDefault(), st());
309
+ }, lt = (e) => {
310
+ let t = q.value;
311
+ !t || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || i(e) || (e.preventDefault(), z.value = t, Ne(), b(() => {
312
+ P.value && (L.update(P.value), P.value.setSelectionRange(t.length, t.length));
313
+ }));
314
+ };
315
+ ie(() => {
316
+ P.value && L(P.value);
317
+ });
318
+ let $ = 0;
319
+ return me(P, ([e]) => {
320
+ let t = e?.contentRect.width ?? 0;
321
+ P.value && t !== $ && ($ = t, L.update(P.value));
322
+ }), E(() => q.value ?? M.placeholder, async () => {
323
+ await b(), P.value && L.update(P.value);
324
+ }), re(() => {
325
+ H(), P.value && L.destroy(P.value);
326
+ for (let e of k.value) URL.revokeObjectURL(e.localUrl);
327
+ }), y({
328
+ focus: () => P.value?.focus(),
329
+ annotateImage: (e) => {
330
+ Y.value = void 0, Z.value = e;
331
+ }
332
+ }), (t, i) => {
333
+ let a = c, u = e, _ = s, y = o;
334
+ return x(), p("div", ge, [
335
+ it.value.length ? (x(), p("div", _e, [(x(!0), p(l, null, oe(it.value, (e) => (x(), p("div", {
336
+ key: e.id,
337
+ class: "pk-chatbot-input__notice-item"
338
+ }, [
339
+ e.icon ? (x(), d(a, {
340
+ key: 0,
341
+ name: e.icon,
342
+ class: "pk-chatbot-input__notice-icon"
343
+ }, null, 8, ["name"])) : f("", !0),
344
+ e.markdown ? (x(), d(n, {
345
+ key: 1,
346
+ markdown: e.markdown,
347
+ class: "wysiwyg pk-chatbot-input__notice-text"
348
+ }, null, 8, ["markdown"])) : (x(), p("span", ve, C(e.text), 1)),
349
+ e.open ? (x(), d(u, {
350
+ key: 3,
351
+ label: w(N)("action.open"),
352
+ modifiers: "link",
353
+ class: "pk-chatbot-input__notice-action",
354
+ onClick: (t) => e.open()
355
+ }, null, 8, ["label", "onClick"])) : f("", !0),
356
+ e.dismiss ? (x(), d(u, {
357
+ key: 4,
358
+ title: w(N)("action.close"),
359
+ modifiers: "action-quiet",
360
+ icon: "ri:close-line",
361
+ class: "w-18 h-18",
362
+ onClick: (t) => e.dismiss()
363
+ }, null, 8, ["title", "onClick"])) : f("", !0)
364
+ ]))), 128))])) : f("", !0),
365
+ m("form", {
366
+ ref_key: "formEl",
367
+ ref: R,
368
+ class: "pk-chatbot-input__form",
369
+ onSubmit: fe(st, ["prevent"])
370
+ }, [
371
+ v.automaticConfirmations ? (x(), p("button", {
372
+ key: 0,
373
+ type: "button",
374
+ class: "pk-chatbot-input__mode",
375
+ title: w(N)("action.manualConfirmations"),
376
+ onClick: i[0] ||= (e) => j("manual-confirmations")
377
+ }, [
378
+ g(a, {
379
+ name: "ri:flashlight-line",
380
+ class: "pk-chatbot-input__pointer-icon"
381
+ }),
382
+ h(" " + C(w(N)("label.automaticConfirmations")) + " ", 1),
383
+ g(a, {
384
+ name: "ri:close-line",
385
+ class: "pk-chatbot-input__pointer-icon"
386
+ })
387
+ ], 8, ye)) : f("", !0),
388
+ v.pointer ? (x(), p("div", be, [
389
+ g(a, {
390
+ name: v.pointer.kind === "text" ? "ri:double-quotes-l" : "ri:focus-3-line",
391
+ class: "pk-chatbot-input__pointer-icon"
392
+ }, null, 8, ["name"]),
393
+ m("span", xe, C(v.pointer.kind === "text" ? `«${v.pointer.label}»` : v.pointer.label), 1),
394
+ g(u, {
395
+ title: w(N)("pagePointer.remove"),
396
+ modifiers: "action-quiet",
397
+ icon: "ri:close-line",
398
+ class: "w-18 h-18",
399
+ onClick: i[1] ||= (e) => j("remove-pointer")
400
+ }, null, 8, ["title"])
401
+ ])) : f("", !0),
402
+ k.value.length ? (x(), p("div", Se, [(x(!0), p(l, null, oe(k.value, (e) => (x(), d(r, {
403
+ key: e.id,
404
+ "media-type": e.mediaSource?.mimeType ?? e.file.type,
405
+ url: e.localUrl,
406
+ filename: e.file.name,
407
+ size: e.file.size,
408
+ loading: e.state === "uploading",
409
+ error: e.state === "error" ? e.error : void 0,
410
+ removable: e.state !== "uploading",
411
+ editable: $e(e),
412
+ retryable: v.retryableAttachments && e.state === "error",
413
+ compact: "",
414
+ onRemove: (t) => Qe(e.id),
415
+ onEdit: (t) => Y.value = e.id,
416
+ onRetry: (t) => j("retry-attachment", e)
417
+ }, null, 8, [
418
+ "media-type",
419
+ "url",
420
+ "filename",
421
+ "size",
422
+ "loading",
423
+ "error",
424
+ "removable",
425
+ "editable",
426
+ "retryable",
427
+ "onRemove",
428
+ "onEdit",
429
+ "onRetry"
430
+ ]))), 128))])) : f("", !0),
431
+ m("div", Ce, [
432
+ se(t.$slots, "prepend"),
433
+ v.fileUpload && v.fileUpload.enabled && (J.value || t.$slots["additional-actions"]) ? (x(), d(y, ne(ee({ key: 0 }, {
434
+ placement: "top-start",
435
+ modifiers: "menu",
436
+ flip: !0,
437
+ offset: 3
438
+ })), {
439
+ default: D(({ init: e, toggle: t, aria: n }) => [m("button", ee({ ref: (t) => e(t) }, n, {
440
+ class: "pk-chat-button",
441
+ type: "button",
442
+ title: w(N)("action.attachFile"),
443
+ disabled: W.value,
444
+ onClick: t
445
+ }), [g(a, {
446
+ name: "ri:add-line",
447
+ class: "pk-chat-button__icon"
448
+ })], 16, we)]),
449
+ items: D(() => [
450
+ J.value ? (x(), d(_, {
451
+ key: 0,
452
+ disabled: W.value || v.attachmentLimitReached,
453
+ onClick: Ye
454
+ }, {
455
+ default: D(() => [g(a, {
456
+ name: "ri:camera-line",
457
+ class: "pk-chatbot-input__dropdown-icon"
458
+ }), h(" " + C(w(N)("action.takePhoto")), 1)]),
459
+ _: 1
460
+ }, 8, ["disabled"])) : f("", !0),
461
+ g(_, {
462
+ disabled: W.value || v.attachmentLimitReached,
463
+ onClick: Je
464
+ }, {
465
+ default: D(() => [g(a, {
466
+ name: "ri:attachment-line",
467
+ class: "pk-chatbot-input__dropdown-icon"
468
+ }), h(" " + C(w(N)("action.attachFile")), 1)]),
469
+ _: 1
470
+ }, 8, ["disabled"]),
471
+ se(t.$slots, "additional-actions")
472
+ ]),
473
+ _: 3
474
+ }, 16)) : v.fileUpload && v.fileUpload.enabled ? (x(), d(B, {
475
+ key: 1,
476
+ icon: "ri:add-line",
477
+ title: w(N)("action.attachFile"),
478
+ disabled: W.value || v.attachmentLimitReached,
479
+ onClick: Je
480
+ }, null, 8, ["title", "disabled"])) : f("", !0),
481
+ v.fileUpload && v.fileUpload.enabled ? (x(), p("input", {
482
+ key: 2,
483
+ ref_key: "fileInputEl",
484
+ ref: F,
485
+ type: "file",
486
+ hidden: "",
487
+ multiple: "",
488
+ accept: Ke.value,
489
+ onChange: Ze
490
+ }, null, 40, Te)) : f("", !0),
491
+ v.fileUpload && v.fileUpload.enabled && J.value ? (x(), p("input", {
492
+ key: 3,
493
+ ref_key: "cameraInputEl",
494
+ ref: I,
495
+ type: "file",
496
+ capture: "environment",
497
+ hidden: "",
498
+ accept: qe.value,
499
+ onChange: Ze
500
+ }, null, 40, Ee)) : f("", !0),
501
+ v.pointerAvailable ? (x(), d(B, {
502
+ key: 4,
503
+ icon: "ri:focus-3-line",
504
+ title: w(N)("pagePointer.start"),
505
+ "aria-pressed": v.pointing,
506
+ disabled: W.value,
507
+ onClick: i[2] ||= (e) => j("point")
508
+ }, null, 8, [
509
+ "title",
510
+ "aria-pressed",
511
+ "disabled"
512
+ ])) : f("", !0),
513
+ m("div", De, [m("textarea", {
514
+ ref_key: "textareaEl",
515
+ ref: P,
516
+ value: z.value,
517
+ class: "pk-chatbot-input__textarea",
518
+ name: "message",
519
+ rows: "1",
520
+ enterkeyhint: "send",
521
+ "aria-label": w(N)("label.message"),
522
+ "aria-describedby": We.value,
523
+ "aria-invalid": G.value || void 0,
524
+ placeholder: q.value ?? v.placeholder,
525
+ onInput: Fe,
526
+ onKeydown: [de(ct, ["enter"]), de(lt, ["tab"])]
527
+ }, null, 40, Oe)]),
528
+ q.value ? (x(), p("span", ke, [i[4] ||= m("kbd", { "aria-hidden": "true" }, "Tab", -1), m("span", {
529
+ id: w(Ue),
530
+ class: "u-visually-hidden"
531
+ }, C(w(N)("hint.suggestedNextMessage")), 9, Ae)])) : f("", !0),
532
+ v.maxMessageLength ? (x(), p("div", {
533
+ key: 6,
534
+ id: w(Le),
535
+ class: te(["pk-chatbot-input__counter", { "pk-chatbot-input__counter--over": G.value }])
536
+ }, [h(C(t.$n(Re.value, "integer")) + "/", 1), m("span", Me, C(t.$n(v.maxMessageLength, "integer")), 1)], 10, je)) : f("", !0),
537
+ v.voiceEnabled && !U.value ? (x(), d(B, {
538
+ key: 7,
539
+ icon: "ri:mic-line",
540
+ title: w(N)("action.talk"),
541
+ disabled: W.value,
542
+ onClick: i[3] ||= (e) => j("voice-start")
543
+ }, null, 8, ["title", "disabled"])) : f("", !0),
544
+ U.value ? (x(), d(B, {
545
+ key: 8,
546
+ icon: "ri:stop-fill",
547
+ modifiers: Ve.value ? void 0 : "primary",
548
+ title: w(N)("action.stop"),
549
+ onClick: ot
550
+ }, null, 8, ["modifiers", "title"])) : f("", !0),
551
+ Ve.value ? (x(), d(B, {
552
+ key: 9,
553
+ type: "submit",
554
+ modifiers: "primary",
555
+ icon: "ri:arrow-up-line",
556
+ title: w(N)("action.queueMessage")
557
+ }, null, 8, ["title"])) : U.value ? f("", !0) : (x(), d(B, {
558
+ key: 10,
559
+ type: "submit",
560
+ modifiers: "primary",
561
+ icon: Ie.value ? "loading-loop" : "ri:arrow-up-line",
562
+ title: w(N)("action.submit"),
563
+ disabled: !K.value
564
+ }, null, 8, [
565
+ "icon",
566
+ "title",
567
+ "disabled"
568
+ ]))
569
+ ])
570
+ ], 544),
571
+ Q.value ? (x(), d(w(he), {
572
+ key: X.value?.id ?? "annotating",
573
+ file: Q.value,
574
+ "initial-tool": X.value ? void 0 : "arrow",
575
+ onApply: tt,
576
+ onClose: et
577
+ }, null, 8, ["file", "initial-tool"])) : f("", !0)
578
+ ]);
579
+ };
580
+ }
581
+ });
582
+ export { M as i, B as n, A as r, V as t };
583
+
584
+ //# sourceMappingURL=PkChatbotInput-CIIJ1bpF.js.map