@8wave/ai-elements 0.126.0-beta.40 → 0.126.0-beta.42

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 (155) hide show
  1. package/dist/_chunks/{Agent-DZEyfr8D.js → Agent-DJ6TBi6l.js} +143 -138
  2. package/dist/_chunks/Agent-DJ6TBi6l.js.map +1 -0
  3. package/dist/_chunks/{PkFilePreview-BHqmp1EW.js → PkFilePreview-BrWWeK4E.js} +3 -3
  4. package/dist/_chunks/{PkFilePreview-BHqmp1EW.js.map → PkFilePreview-BrWWeK4E.js.map} +1 -1
  5. package/dist/_chunks/{PkFilePreviewDialog-BHAgVlKs.js → PkFilePreviewDialog-BRZH_LxY.js} +2 -2
  6. package/dist/_chunks/{PkFilePreviewDialog-BHAgVlKs.js.map → PkFilePreviewDialog-BRZH_LxY.js.map} +1 -1
  7. package/dist/_chunks/{PkImageEditorDialog-BDwL39Du.js → PkImageEditorDialog-D21ggZkD.js} +6 -5
  8. package/dist/_chunks/{PkImageEditorDialog-BDwL39Du.js.map → PkImageEditorDialog-D21ggZkD.js.map} +1 -1
  9. package/dist/_chunks/{PkSelectionActions-DLsZ8-gW.js → PkSelectionActions-BLfFobXb.js} +2 -2
  10. package/dist/_chunks/{PkSelectionActions-DLsZ8-gW.js.map → PkSelectionActions-BLfFobXb.js.map} +1 -1
  11. package/dist/_chunks/{PkStreamingMarkdown-14rJ_FK2.js → PkStreamingMarkdown-Bekhx_vG.js} +300 -213
  12. package/dist/_chunks/PkStreamingMarkdown-Bekhx_vG.js.map +1 -0
  13. package/dist/_chunks/{PkToolChatFile-62j1S0Pq.js → PkToolChatFile-BzN4fMaY.js} +3 -3
  14. package/dist/_chunks/{PkToolChatFile-62j1S0Pq.js.map → PkToolChatFile-BzN4fMaY.js.map} +1 -1
  15. package/dist/_chunks/{PkToolRequestGeolocation-B9EM_K6O.js → PkToolRequestGeolocation-Dj5OxEMP.js} +2 -2
  16. package/dist/_chunks/{PkToolRequestGeolocation-B9EM_K6O.js.map → PkToolRequestGeolocation-Dj5OxEMP.js.map} +1 -1
  17. package/dist/_chunks/{PkToolRequestOAuthConnection-CfjfqCHX.js → PkToolRequestOAuthConnection-Cj_IYnrW.js} +2 -2
  18. package/dist/_chunks/{PkToolRequestOAuthConnection-CfjfqCHX.js.map → PkToolRequestOAuthConnection-Cj_IYnrW.js.map} +1 -1
  19. package/dist/_chunks/PkToolShowArtifact-BkGtejtb.js +110 -0
  20. package/dist/_chunks/PkToolShowArtifact-BkGtejtb.js.map +1 -0
  21. package/dist/_chunks/{PkToolShowContactForm-BeJ5GR6t.js → PkToolShowContactForm-BXsvfCKR.js} +2 -2
  22. package/dist/_chunks/{PkToolShowContactForm-BeJ5GR6t.js.map → PkToolShowContactForm-BXsvfCKR.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowForm-B9VDoS_W.js → PkToolShowForm-DeG_AzO9.js} +4 -4
  24. package/dist/_chunks/{PkToolShowForm-B9VDoS_W.js.map → PkToolShowForm-DeG_AzO9.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowImageGallery-DFuc5IJ1.js → PkToolShowImageGallery-Dri9KUNg.js} +2 -2
  26. package/dist/_chunks/{PkToolShowImageGallery-DFuc5IJ1.js.map → PkToolShowImageGallery-Dri9KUNg.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowProductList-C2EJKYOV.js → PkToolShowProductList-C-XQdsus.js} +2 -2
  28. package/dist/_chunks/{PkToolShowProductList-C2EJKYOV.js.map → PkToolShowProductList-C-XQdsus.js.map} +1 -1
  29. package/dist/_chunks/{PkToolShowSources-BL3DnfcN.js → PkToolShowSources-DMDML2kQ.js} +3 -3
  30. package/dist/_chunks/{PkToolShowSources-BL3DnfcN.js.map → PkToolShowSources-DMDML2kQ.js.map} +1 -1
  31. package/dist/_chunks/{PkToolShowSuggestedReply-DLgtjBJ1.js → PkToolShowSuggestedReply-BYoW-L6k.js} +2 -2
  32. package/dist/_chunks/{PkToolShowSuggestedReply-DLgtjBJ1.js.map → PkToolShowSuggestedReply-BYoW-L6k.js.map} +1 -1
  33. package/dist/_chunks/{PkToolShowVideo-DcWXDcOZ.js → PkToolShowVideo-C_1ziurv.js} +2 -2
  34. package/dist/_chunks/{PkToolShowVideo-DcWXDcOZ.js.map → PkToolShowVideo-C_1ziurv.js.map} +1 -1
  35. package/dist/_chunks/{PkToolShowWebPages-CPqMC6qt.js → PkToolShowWebPages-yFdm0n0F.js} +2 -2
  36. package/dist/_chunks/{PkToolShowWebPages-CPqMC6qt.js.map → PkToolShowWebPages-yFdm0n0F.js.map} +1 -1
  37. package/dist/_chunks/{chatImagePolicy-DMt6O5iK.js → chatImagePolicy-Dqke0kDv.js} +2 -2
  38. package/dist/_chunks/{chatImagePolicy-DMt6O5iK.js.map → chatImagePolicy-Dqke0kDv.js.map} +1 -1
  39. package/dist/_chunks/{markdown-nw5sXwU0.js → markdown-Z_eeOlvv.js} +16 -16
  40. package/dist/_chunks/{markdown-nw5sXwU0.js.map → markdown-Z_eeOlvv.js.map} +1 -1
  41. package/dist/_chunks/{utils-DE4cAz37.js → utils-C1JaUBI_.js} +2 -2
  42. package/dist/_chunks/{utils-DE4cAz37.js.map → utils-C1JaUBI_.js.map} +1 -1
  43. package/dist/ai-elements.es.js +3754 -3573
  44. package/dist/ai-elements.es.js.map +1 -1
  45. package/dist-vue/PkChatbot.js +1 -1
  46. package/dist-vue/PkChatbotAuth.js +1 -1
  47. package/dist-vue/PkChatbotEmptyState.js +1 -1
  48. package/dist-vue/PkChatbotInput.js +1 -1
  49. package/dist-vue/PkChatbotMessages.js +1 -1
  50. package/dist-vue/PkChatbotStepPayload.js +1 -1
  51. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  52. package/dist-vue/PkChatbotSteps.js +1 -1
  53. package/dist-vue/PkChatbotViewChat.js +1 -1
  54. package/dist-vue/PkChatbotViewConversations.js +1 -1
  55. package/dist-vue/PkChatbotViewFiles.js +1 -1
  56. package/dist-vue/PkChatbotViewProfile.js +1 -1
  57. package/dist-vue/_chunks/{Agent-CBAd3F7k.js → Agent-DrnYCRFA.js} +2 -2
  58. package/dist-vue/_chunks/{Agent-CBAd3F7k.js.map → Agent-DrnYCRFA.js.map} +1 -1
  59. package/dist-vue/_chunks/{Document-B3w5H0R0.js → Document-CA7c3oZE.js} +11 -11
  60. package/dist-vue/_chunks/{Document-B3w5H0R0.js.map → Document-CA7c3oZE.js.map} +1 -1
  61. package/dist-vue/_chunks/{Media-0U2B_qCS.js → Media-BIlhY_h6.js} +31 -26
  62. package/dist-vue/_chunks/Media-BIlhY_h6.js.map +1 -0
  63. package/dist-vue/_chunks/{PkChatbot-aCgj2DMu.js → PkChatbot-QjeNY0h6.js} +8 -8
  64. package/dist-vue/_chunks/{PkChatbot-aCgj2DMu.js.map → PkChatbot-QjeNY0h6.js.map} +1 -1
  65. package/dist-vue/_chunks/{PkChatbotAuth-C5agN8ht.js → PkChatbotAuth-C8ZjLNFY.js} +8 -8
  66. package/dist-vue/_chunks/{PkChatbotAuth-C5agN8ht.js.map → PkChatbotAuth-C8ZjLNFY.js.map} +1 -1
  67. package/dist-vue/_chunks/{PkChatbotEmptyState-CLfzcH_t.js → PkChatbotEmptyState-D6S0iYe3.js} +2 -2
  68. package/dist-vue/_chunks/{PkChatbotEmptyState-CLfzcH_t.js.map → PkChatbotEmptyState-D6S0iYe3.js.map} +1 -1
  69. package/dist-vue/_chunks/PkChatbotInput-CunAf5Rq.js +708 -0
  70. package/dist-vue/_chunks/PkChatbotInput-CunAf5Rq.js.map +1 -0
  71. package/dist-vue/_chunks/{PkChatbotMessages-CG3UZYcP.js → PkChatbotMessages-CzPsgCAN.js} +351 -326
  72. package/dist-vue/_chunks/PkChatbotMessages-CzPsgCAN.js.map +1 -0
  73. package/dist-vue/_chunks/{PkChatbotStepPayload-fyrbP7yS.js → PkChatbotStepPayload-BQDpTDgn.js} +2 -2
  74. package/dist-vue/_chunks/{PkChatbotStepPayload-fyrbP7yS.js.map → PkChatbotStepPayload-BQDpTDgn.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkChatbotStepToolDetail-Drhc6X-x.js → PkChatbotStepToolDetail-Dsf9t1B6.js} +3 -3
  76. package/dist-vue/_chunks/{PkChatbotStepToolDetail-Drhc6X-x.js.map → PkChatbotStepToolDetail-Dsf9t1B6.js.map} +1 -1
  77. package/dist-vue/_chunks/{PkChatbotSteps-DZwV7UVr.js → PkChatbotSteps-HACZ1RrB.js} +5 -5
  78. package/dist-vue/_chunks/{PkChatbotSteps-DZwV7UVr.js.map → PkChatbotSteps-HACZ1RrB.js.map} +1 -1
  79. package/dist-vue/_chunks/{PkChatbotViewChat-IU3HJpxG.js → PkChatbotViewChat-BpDCX_72.js} +107 -107
  80. package/dist-vue/_chunks/PkChatbotViewChat-BpDCX_72.js.map +1 -0
  81. package/dist-vue/_chunks/{PkChatbotViewConversations-4zGrp7Fo.js → PkChatbotViewConversations-B0nUFwuu.js} +3 -3
  82. package/dist-vue/_chunks/{PkChatbotViewConversations-4zGrp7Fo.js.map → PkChatbotViewConversations-B0nUFwuu.js.map} +1 -1
  83. package/dist-vue/_chunks/{PkChatbotViewFiles-PHdrHZOf.js → PkChatbotViewFiles-gGshDAPk.js} +3 -3
  84. package/dist-vue/_chunks/{PkChatbotViewFiles-PHdrHZOf.js.map → PkChatbotViewFiles-gGshDAPk.js.map} +1 -1
  85. package/dist-vue/_chunks/{PkChatbotViewProfile-BrZ7oiUY.js → PkChatbotViewProfile-BuJtqq8F.js} +2 -2
  86. package/dist-vue/_chunks/{PkChatbotViewProfile-BrZ7oiUY.js.map → PkChatbotViewProfile-BuJtqq8F.js.map} +1 -1
  87. package/dist-vue/_chunks/{PkFilePreview-WqS-s3vk.js → PkFilePreview-0p50S8Km.js} +4 -4
  88. package/dist-vue/_chunks/{PkFilePreview-WqS-s3vk.js.map → PkFilePreview-0p50S8Km.js.map} +1 -1
  89. package/dist-vue/_chunks/{PkFilePreviewDialog-BIaTAK05.js → PkFilePreviewDialog-B1N4xDEu.js} +2 -2
  90. package/dist-vue/_chunks/{PkFilePreviewDialog-BIaTAK05.js.map → PkFilePreviewDialog-B1N4xDEu.js.map} +1 -1
  91. package/dist-vue/_chunks/{PkImageEditorDialog-_-UkV0CO.js → PkImageEditorDialog-B-jW5yE8.js} +6 -5
  92. package/dist-vue/_chunks/{PkImageEditorDialog-_-UkV0CO.js.map → PkImageEditorDialog-B-jW5yE8.js.map} +1 -1
  93. package/dist-vue/_chunks/{PkStreamingMarkdown-ha0V58V9.js → PkStreamingMarkdown-WIueQOg3.js} +530 -445
  94. package/dist-vue/_chunks/PkStreamingMarkdown-WIueQOg3.js.map +1 -0
  95. package/dist-vue/_chunks/{PkToolChatFile-OusYITiO.js → PkToolChatFile-W6OJP7HH.js} +3 -3
  96. package/dist-vue/_chunks/{PkToolChatFile-OusYITiO.js.map → PkToolChatFile-W6OJP7HH.js.map} +1 -1
  97. package/dist-vue/_chunks/{PkToolRequestGeolocation-CyL_M1Rm.js → PkToolRequestGeolocation-BPZfJfR1.js} +2 -2
  98. package/dist-vue/_chunks/{PkToolRequestGeolocation-CyL_M1Rm.js.map → PkToolRequestGeolocation-BPZfJfR1.js.map} +1 -1
  99. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DWkeVLpx.js → PkToolRequestOAuthConnection-BaMZkvU5.js} +2 -2
  100. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DWkeVLpx.js.map → PkToolRequestOAuthConnection-BaMZkvU5.js.map} +1 -1
  101. package/dist-vue/_chunks/PkToolShowArtifact-CPBFsUrY.js +107 -0
  102. package/dist-vue/_chunks/PkToolShowArtifact-CPBFsUrY.js.map +1 -0
  103. package/dist-vue/_chunks/{PkToolShowChart-BSnYmoJJ.js → PkToolShowChart-BaUS47YU.js} +2 -2
  104. package/dist-vue/_chunks/{PkToolShowChart-BSnYmoJJ.js.map → PkToolShowChart-BaUS47YU.js.map} +1 -1
  105. package/dist-vue/_chunks/{PkToolShowContactForm-DFufPNnQ.js → PkToolShowContactForm-6OQ-hjCt.js} +2 -2
  106. package/dist-vue/_chunks/{PkToolShowContactForm-DFufPNnQ.js.map → PkToolShowContactForm-6OQ-hjCt.js.map} +1 -1
  107. package/dist-vue/_chunks/{PkToolShowDiagram-BR4fE_be.js → PkToolShowDiagram-D6hPQVoe.js} +2 -2
  108. package/dist-vue/_chunks/{PkToolShowDiagram-BR4fE_be.js.map → PkToolShowDiagram-D6hPQVoe.js.map} +1 -1
  109. package/dist-vue/_chunks/{PkToolShowForm-yh0YAXcg.js → PkToolShowForm-CAadu_Pq.js} +4 -4
  110. package/dist-vue/_chunks/{PkToolShowForm-yh0YAXcg.js.map → PkToolShowForm-CAadu_Pq.js.map} +1 -1
  111. package/dist-vue/_chunks/{PkToolShowImageGallery-mmUY1Yfg.js → PkToolShowImageGallery-BlTyCF8h.js} +2 -2
  112. package/dist-vue/_chunks/{PkToolShowImageGallery-mmUY1Yfg.js.map → PkToolShowImageGallery-BlTyCF8h.js.map} +1 -1
  113. package/dist-vue/_chunks/{PkToolShowProductList-B-ya1TDt.js → PkToolShowProductList-CZFkf9UD.js} +2 -2
  114. package/dist-vue/_chunks/{PkToolShowProductList-B-ya1TDt.js.map → PkToolShowProductList-CZFkf9UD.js.map} +1 -1
  115. package/dist-vue/_chunks/{PkToolShowSources-DYkHkVdX.js → PkToolShowSources-Bci0Ab2u.js} +3 -3
  116. package/dist-vue/_chunks/{PkToolShowSources-DYkHkVdX.js.map → PkToolShowSources-Bci0Ab2u.js.map} +1 -1
  117. package/dist-vue/_chunks/{PkToolShowSuggestedReply-wKgwHTRO.js → PkToolShowSuggestedReply-DCZbwFhR.js} +2 -2
  118. package/dist-vue/_chunks/{PkToolShowSuggestedReply-wKgwHTRO.js.map → PkToolShowSuggestedReply-DCZbwFhR.js.map} +1 -1
  119. package/dist-vue/_chunks/{PkToolShowVideo-CRg2lAY8.js → PkToolShowVideo-BnSYdoTJ.js} +2 -2
  120. package/dist-vue/_chunks/{PkToolShowVideo-CRg2lAY8.js.map → PkToolShowVideo-BnSYdoTJ.js.map} +1 -1
  121. package/dist-vue/_chunks/{PkToolShowWebPages-C_pWag94.js → PkToolShowWebPages-CHrHuFZI.js} +2 -2
  122. package/dist-vue/_chunks/{PkToolShowWebPages-C_pWag94.js.map → PkToolShowWebPages-CHrHuFZI.js.map} +1 -1
  123. package/dist-vue/_chunks/{createChatbotApiClient-DBKfGL6y.js → createChatbotApiClient-_gh3Y1rl.js} +3 -3
  124. package/dist-vue/_chunks/createChatbotApiClient-_gh3Y1rl.js.map +1 -0
  125. package/dist-vue/_chunks/{useChatbotStore-Hb5EjISl.js → useChatbotStore-CjFPM9Q5.js} +3 -3
  126. package/dist-vue/_chunks/{useChatbotStore-Hb5EjISl.js.map → useChatbotStore-CjFPM9Q5.js.map} +1 -1
  127. package/dist-vue/_chunks/{utils-Df5n2cDc.js → utils-BYvQMZLG.js} +2 -2
  128. package/dist-vue/_chunks/{utils-Df5n2cDc.js.map → utils-BYvQMZLG.js.map} +1 -1
  129. package/dist-vue/api.js +1 -1
  130. package/dist-vue/composables.js +40 -8
  131. package/dist-vue/composables.js.map +1 -1
  132. package/dist-vue/index.js +71 -71
  133. package/dist-vue/index.js.map +1 -1
  134. package/dist-vue/locales.js +10 -0
  135. package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +2 -2
  136. package/dist-vue/packages/components/src/chat/PkImageEditorDialog.d.ts +5 -0
  137. package/dist-vue/packages/components/src/chat/PkStreamingMarkdown.d.ts +6 -0
  138. package/dist-vue/packages/components/src/chat/richCopy.d.ts +33 -0
  139. package/dist-vue/packages/components/src/chat/screenshot.d.ts +38 -0
  140. package/dist-vue/packages/models/src/schema/Chat.d.ts +1 -1
  141. package/dist-vue/style.css +1 -1
  142. package/package.json +1 -1
  143. package/dist/_chunks/Agent-DZEyfr8D.js.map +0 -1
  144. package/dist/_chunks/PkStreamingMarkdown-14rJ_FK2.js.map +0 -1
  145. package/dist/_chunks/PkToolShowArtifact-I_QZS7Pf.js +0 -94
  146. package/dist/_chunks/PkToolShowArtifact-I_QZS7Pf.js.map +0 -1
  147. package/dist-vue/_chunks/Media-0U2B_qCS.js.map +0 -1
  148. package/dist-vue/_chunks/PkChatbotInput-C9l_1I3d.js +0 -584
  149. package/dist-vue/_chunks/PkChatbotInput-C9l_1I3d.js.map +0 -1
  150. package/dist-vue/_chunks/PkChatbotMessages-CG3UZYcP.js.map +0 -1
  151. package/dist-vue/_chunks/PkChatbotViewChat-IU3HJpxG.js.map +0 -1
  152. package/dist-vue/_chunks/PkStreamingMarkdown-ha0V58V9.js.map +0 -1
  153. package/dist-vue/_chunks/PkToolShowArtifact-x57Gri2a.js +0 -91
  154. package/dist-vue/_chunks/PkToolShowArtifact-x57Gri2a.js.map +0 -1
  155. package/dist-vue/_chunks/createChatbotApiClient-DBKfGL6y.js.map +0 -1
@@ -1,584 +0,0 @@
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-ha0V58V9.js";
4
- import { t as r } from "./PkChatbotFilePreview-aKJBtw04.js";
5
- import { j as i, k as a } from "./utils-Df5n2cDc.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-_-UkV0CO.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-C9l_1I3d.js.map