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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/_chunks/{PkChatbotFilePreview-Dt0ygdJM.js → PkChatbotFilePreview-o0zIuCgN.js} +2 -2
  2. package/dist/_chunks/{PkChatbotFilePreview-Dt0ygdJM.js.map → PkChatbotFilePreview-o0zIuCgN.js.map} +1 -1
  3. package/dist/_chunks/{PkFilePreview-CT3_vRcU.js → PkFilePreview-D_1ZgiiA.js} +438 -438
  4. package/dist/_chunks/{PkFilePreview-CT3_vRcU.js.map → PkFilePreview-D_1ZgiiA.js.map} +1 -1
  5. package/dist/_chunks/{PkFilePreviewDialog-BOKJCapN.js → PkFilePreviewDialog-CI22huzK.js} +2 -2
  6. package/dist/_chunks/{PkFilePreviewDialog-BOKJCapN.js.map → PkFilePreviewDialog-CI22huzK.js.map} +1 -1
  7. package/dist/_chunks/{PkImageEditorDialog-D-ikpGo8.js → PkImageEditorDialog-CAEninFi.js} +152 -130
  8. package/dist/_chunks/PkImageEditorDialog-CAEninFi.js.map +1 -0
  9. package/dist/_chunks/{PkSelectionActions-CXQTnSXQ.js → PkSelectionActions-BriGyWCi.js} +2 -2
  10. package/dist/_chunks/{PkSelectionActions-CXQTnSXQ.js.map → PkSelectionActions-BriGyWCi.js.map} +1 -1
  11. package/dist/_chunks/{PkStreamingMarkdown-5fgxYt_s.js → PkStreamingMarkdown--9i0feuM.js} +3 -3
  12. package/dist/_chunks/{PkStreamingMarkdown-5fgxYt_s.js.map → PkStreamingMarkdown--9i0feuM.js.map} +1 -1
  13. package/dist/_chunks/{PkToolChatFile-Cbmu6I0S.js → PkToolChatFile-BKGUnWrj.js} +3 -3
  14. package/dist/_chunks/{PkToolChatFile-Cbmu6I0S.js.map → PkToolChatFile-BKGUnWrj.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShareDocument-Bxm1pSpj.js → PkToolShareDocument-BUg-uDTO.js} +2 -2
  16. package/dist/_chunks/{PkToolShareDocument-Bxm1pSpj.js.map → PkToolShareDocument-BUg-uDTO.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowArtifact-CGUmoTfN.js → PkToolShowArtifact-BfLpz2-W.js} +2 -2
  18. package/dist/_chunks/{PkToolShowArtifact-CGUmoTfN.js.map → PkToolShowArtifact-BfLpz2-W.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowContactForm-DZ-kgXa6.js → PkToolShowContactForm-BsF6DFzV.js} +2 -2
  20. package/dist/_chunks/{PkToolShowContactForm-DZ-kgXa6.js.map → PkToolShowContactForm-BsF6DFzV.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowDiagram-CwINVecL.js → PkToolShowDiagram-CcRJNDHo.js} +2 -2
  22. package/dist/_chunks/{PkToolShowDiagram-CwINVecL.js.map → PkToolShowDiagram-CcRJNDHo.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowForm-BrxNGFCH.js → PkToolShowForm-w6RvbKEB.js} +3 -3
  24. package/dist/_chunks/{PkToolShowForm-BrxNGFCH.js.map → PkToolShowForm-w6RvbKEB.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowImageGallery-BGTncXxq.js → PkToolShowImageGallery-BEddh4He.js} +2 -2
  26. package/dist/_chunks/{PkToolShowImageGallery-BGTncXxq.js.map → PkToolShowImageGallery-BEddh4He.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowSources-B3RSUWP7.js → PkToolShowSources-CGESvGrm.js} +2 -2
  28. package/dist/_chunks/{PkToolShowSources-B3RSUWP7.js.map → PkToolShowSources-CGESvGrm.js.map} +1 -1
  29. package/dist/_chunks/{useLightbox-C54BCSbU.js → useLightbox-TagJmiah.js} +38 -37
  30. package/dist/_chunks/useLightbox-TagJmiah.js.map +1 -0
  31. package/dist/_chunks/{utils-Do6urHUh.js → utils-zkq8kMz-.js} +7 -4
  32. package/{dist-vue/_chunks/utils-Do3JWPJe.js.map → dist/_chunks/utils-zkq8kMz-.js.map} +1 -1
  33. package/dist/ai-elements.es.js +2711 -2711
  34. package/dist/ai-elements.es.js.map +1 -1
  35. package/dist-vue/PkChatbot.js +1 -1
  36. package/dist-vue/PkChatbotEmptyState.js +1 -1
  37. package/dist-vue/PkChatbotFilePreview.js +1 -1
  38. package/dist-vue/PkChatbotInput.js +1 -1
  39. package/dist-vue/PkChatbotMessages.js +1 -1
  40. package/dist-vue/PkChatbotStepPayload.js +1 -1
  41. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  42. package/dist-vue/PkChatbotSteps.js +1 -1
  43. package/dist-vue/PkChatbotViewChat.js +1 -1
  44. package/dist-vue/PkChatbotViewConversations.js +1 -1
  45. package/dist-vue/_chunks/{PkChart-BsF3OtnS.js → PkChart-DyyBXkd3.js} +2 -2
  46. package/dist-vue/_chunks/{PkChart-BsF3OtnS.js.map → PkChart-DyyBXkd3.js.map} +1 -1
  47. package/dist-vue/_chunks/{PkChatbot-BIQh81cA.js → PkChatbot-wsqj3EpU.js} +5 -5
  48. package/dist-vue/_chunks/{PkChatbot-BIQh81cA.js.map → PkChatbot-wsqj3EpU.js.map} +1 -1
  49. package/dist-vue/_chunks/{PkChatbotEmptyState-pAeFPPQc.js → PkChatbotEmptyState-DcgIfNkX.js} +2 -2
  50. package/dist-vue/_chunks/{PkChatbotEmptyState-pAeFPPQc.js.map → PkChatbotEmptyState-DcgIfNkX.js.map} +1 -1
  51. package/dist-vue/_chunks/{PkChatbotFilePreview-BIta8Yg-.js → PkChatbotFilePreview-BDU2vY0F.js} +2 -2
  52. package/dist-vue/_chunks/{PkChatbotFilePreview-BIta8Yg-.js.map → PkChatbotFilePreview-BDU2vY0F.js.map} +1 -1
  53. package/dist-vue/_chunks/PkChatbotInput-CN4rmNgu.js +520 -0
  54. package/dist-vue/_chunks/PkChatbotInput-CN4rmNgu.js.map +1 -0
  55. package/dist-vue/_chunks/PkChatbotMessages-BlF4Xp0_.js +1054 -0
  56. package/dist-vue/_chunks/{PkChatbotMessages-CZu8feEz.js.map → PkChatbotMessages-BlF4Xp0_.js.map} +1 -1
  57. package/dist-vue/_chunks/{PkChatbotStepPayload-r25JHO7_.js → PkChatbotStepPayload-q9uXE5mr.js} +2 -2
  58. package/dist-vue/_chunks/{PkChatbotStepPayload-r25JHO7_.js.map → PkChatbotStepPayload-q9uXE5mr.js.map} +1 -1
  59. package/dist-vue/_chunks/{PkChatbotStepToolDetail-C897BpRX.js → PkChatbotStepToolDetail-BJz6Qwh3.js} +3 -3
  60. package/dist-vue/_chunks/{PkChatbotStepToolDetail-C897BpRX.js.map → PkChatbotStepToolDetail-BJz6Qwh3.js.map} +1 -1
  61. package/dist-vue/_chunks/{PkChatbotSteps-CRtIVwJV.js → PkChatbotSteps-DvJYNl_k.js} +5 -5
  62. package/dist-vue/_chunks/{PkChatbotSteps-CRtIVwJV.js.map → PkChatbotSteps-DvJYNl_k.js.map} +1 -1
  63. package/dist-vue/_chunks/{PkChatbotViewChat-BBCxj4Qz.js → PkChatbotViewChat-tmHyxxT3.js} +23 -23
  64. package/dist-vue/_chunks/{PkChatbotViewChat-BBCxj4Qz.js.map → PkChatbotViewChat-tmHyxxT3.js.map} +1 -1
  65. package/dist-vue/_chunks/{PkChatbotViewConversations-rXGl7NKA.js → PkChatbotViewConversations-DOzUh_A7.js} +2 -2
  66. package/dist-vue/_chunks/{PkChatbotViewConversations-rXGl7NKA.js.map → PkChatbotViewConversations-DOzUh_A7.js.map} +1 -1
  67. package/dist-vue/_chunks/{PkFilePreview-1ZNyDAo5.js → PkFilePreview-Bp5-Pl54.js} +227 -227
  68. package/dist-vue/_chunks/{PkFilePreview-1ZNyDAo5.js.map → PkFilePreview-Bp5-Pl54.js.map} +1 -1
  69. package/dist-vue/_chunks/{PkFilePreviewDialog-DnbUHGG2.js → PkFilePreviewDialog-CS885vBR.js} +2 -2
  70. package/dist-vue/_chunks/{PkFilePreviewDialog-DnbUHGG2.js.map → PkFilePreviewDialog-CS885vBR.js.map} +1 -1
  71. package/dist-vue/_chunks/{PkImageEditorDialog-Dn3HV_ny.js → PkImageEditorDialog-BhfdnsmX.js} +300 -278
  72. package/dist-vue/_chunks/PkImageEditorDialog-BhfdnsmX.js.map +1 -0
  73. package/dist-vue/_chunks/{PkStreamingMarkdown-COQLmP8b.js → PkStreamingMarkdown-NgrJUZPI.js} +3 -3
  74. package/dist-vue/_chunks/{PkStreamingMarkdown-COQLmP8b.js.map → PkStreamingMarkdown-NgrJUZPI.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkSvgViewer-vkd5Dluw.js → PkSvgViewer-CRNwb6Yn.js} +2 -2
  76. package/dist-vue/_chunks/{PkSvgViewer-vkd5Dluw.js.map → PkSvgViewer-CRNwb6Yn.js.map} +1 -1
  77. package/dist-vue/_chunks/{PkToolChatFile-e-7a0k7l.js → PkToolChatFile-DnmiNGF4.js} +3 -3
  78. package/dist-vue/_chunks/{PkToolChatFile-e-7a0k7l.js.map → PkToolChatFile-DnmiNGF4.js.map} +1 -1
  79. package/dist-vue/_chunks/{PkToolShareDocument-CspvFwRR.js → PkToolShareDocument-Bf7OE8XA.js} +2 -2
  80. package/dist-vue/_chunks/{PkToolShareDocument-CspvFwRR.js.map → PkToolShareDocument-Bf7OE8XA.js.map} +1 -1
  81. package/dist-vue/_chunks/{PkToolShowArtifact-CUP3VaC9.js → PkToolShowArtifact-C8ueuIGQ.js} +2 -2
  82. package/dist-vue/_chunks/{PkToolShowArtifact-CUP3VaC9.js.map → PkToolShowArtifact-C8ueuIGQ.js.map} +1 -1
  83. package/dist-vue/_chunks/{PkToolShowChart-X6JZDAWD.js → PkToolShowChart-BWO6Hzlq.js} +3 -3
  84. package/dist-vue/_chunks/{PkToolShowChart-X6JZDAWD.js.map → PkToolShowChart-BWO6Hzlq.js.map} +1 -1
  85. package/dist-vue/_chunks/{PkToolShowContactForm-BM8d9M5a.js → PkToolShowContactForm-BBcDsLEO.js} +2 -2
  86. package/dist-vue/_chunks/{PkToolShowContactForm-BM8d9M5a.js.map → PkToolShowContactForm-BBcDsLEO.js.map} +1 -1
  87. package/dist-vue/_chunks/{PkToolShowDiagram-DOdzpndK.js → PkToolShowDiagram-BzUcxOKy.js} +3 -3
  88. package/dist-vue/_chunks/{PkToolShowDiagram-DOdzpndK.js.map → PkToolShowDiagram-BzUcxOKy.js.map} +1 -1
  89. package/dist-vue/_chunks/{PkToolShowForm-TYBf8q6g.js → PkToolShowForm-B6uhHzJ8.js} +3 -3
  90. package/dist-vue/_chunks/{PkToolShowForm-TYBf8q6g.js.map → PkToolShowForm-B6uhHzJ8.js.map} +1 -1
  91. package/dist-vue/_chunks/{PkToolShowImageGallery-BvwuoyF6.js → PkToolShowImageGallery-C39nlJrJ.js} +3 -3
  92. package/dist-vue/_chunks/{PkToolShowImageGallery-BvwuoyF6.js.map → PkToolShowImageGallery-C39nlJrJ.js.map} +1 -1
  93. package/dist-vue/_chunks/{PkToolShowLocation-WdRqG8Wi.js → PkToolShowLocation-Nhh_LwmN.js} +2 -2
  94. package/dist-vue/_chunks/{PkToolShowLocation-WdRqG8Wi.js.map → PkToolShowLocation-Nhh_LwmN.js.map} +1 -1
  95. package/dist-vue/_chunks/{PkToolShowProductList-_MHBAgNI.js → PkToolShowProductList-FLLkRCnm.js} +2 -2
  96. package/dist-vue/_chunks/{PkToolShowProductList-_MHBAgNI.js.map → PkToolShowProductList-FLLkRCnm.js.map} +1 -1
  97. package/dist-vue/_chunks/{PkToolShowSources-CHw7qZtw.js → PkToolShowSources-Cb7r5jrX.js} +2 -2
  98. package/dist-vue/_chunks/{PkToolShowSources-CHw7qZtw.js.map → PkToolShowSources-Cb7r5jrX.js.map} +1 -1
  99. package/dist-vue/_chunks/{PkToolShowVideo-D7oiBe4p.js → PkToolShowVideo-QDLhVlau.js} +2 -2
  100. package/dist-vue/_chunks/{PkToolShowVideo-D7oiBe4p.js.map → PkToolShowVideo-QDLhVlau.js.map} +1 -1
  101. package/dist-vue/_chunks/{PkToolShowWebPages-CRq9Jhmw.js → PkToolShowWebPages-P6PdJTEE.js} +2 -2
  102. package/dist-vue/_chunks/{PkToolShowWebPages-CRq9Jhmw.js.map → PkToolShowWebPages-P6PdJTEE.js.map} +1 -1
  103. package/dist-vue/_chunks/{useLightbox-Ctl9zaMX.js → useLightbox-DmtNa8bJ.js} +38 -37
  104. package/dist-vue/_chunks/useLightbox-DmtNa8bJ.js.map +1 -0
  105. package/dist-vue/_chunks/{utils-Do3JWPJe.js → utils-D4B1FVGF.js} +6 -3
  106. package/dist-vue/_chunks/utils-D4B1FVGF.js.map +1 -0
  107. package/dist-vue/composables.js +1 -1
  108. package/dist-vue/index.js +61 -61
  109. package/dist-vue/index.js.map +1 -1
  110. package/dist-vue/packages/components/src/chat/imageEdits.d.ts +3 -1
  111. package/dist-vue/packages/components/src/chat/utils.d.ts +6 -0
  112. package/dist-vue/packages/components/src/composables/useLightbox.d.ts +6 -0
  113. package/package.json +1 -1
  114. package/dist/_chunks/PkImageEditorDialog-D-ikpGo8.js.map +0 -1
  115. package/dist/_chunks/useLightbox-C54BCSbU.js.map +0 -1
  116. package/dist/_chunks/utils-Do6urHUh.js.map +0 -1
  117. package/dist-vue/_chunks/PkChatbotInput-DSyIo0xB.js +0 -520
  118. package/dist-vue/_chunks/PkChatbotInput-DSyIo0xB.js.map +0 -1
  119. package/dist-vue/_chunks/PkChatbotMessages-CZu8feEz.js +0 -1054
  120. package/dist-vue/_chunks/PkImageEditorDialog-Dn3HV_ny.js.map +0 -1
  121. package/dist-vue/_chunks/useLightbox-Ctl9zaMX.js.map +0 -1
@@ -1,520 +0,0 @@
1
- import { s as e } from "./Media-DylqhvaF.js";
2
- import { t } from "./VvButtonLocalized-C-vx25u4.js";
3
- import { t as n } from "./PkStreamingMarkdown-COQLmP8b.js";
4
- import { O as r } from "./utils-Do3JWPJe.js";
5
- import { t as i } from "./PkChatbotFilePreview-BIta8Yg-.js";
6
- import { VvDropdown as a, VvDropdownAction as o, VvIcon as s } from "@volverjs/ui-vue/components";
7
- import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineAsyncComponent as g, defineComponent as _, mergeModels as v, mergeProps as ee, nextTick as y, normalizeClass as b, normalizeProps as te, onBeforeUnmount as ne, onMounted as re, openBlock as x, ref as S, renderList as C, renderSlot as w, shallowRef as ie, toDisplayString as T, unref as E, useId as ae, useModel as oe, useTemplateRef as D, watch as O, withCtx as k, withKeys as se, withModifiers as ce } from "vue";
8
- import { useI18n as le } from "vue-i18n";
9
- import { useResizeObserver as ue } from "@vueuse/core";
10
- // ../../node_modules/.pnpm/autosize@6.0.1/node_modules/autosize/dist/autosize.esm.js
11
- var A = /* @__PURE__ */ new Map();
12
- function de(e) {
13
- var t = A.get(e);
14
- t && t.destroy();
15
- }
16
- function j(e) {
17
- var t = A.get(e);
18
- t && t.update();
19
- }
20
- var M = null;
21
- typeof window > "u" ? ((M = function(e) {
22
- return e;
23
- }).destroy = function(e) {
24
- return e;
25
- }, M.update = function(e) {
26
- return e;
27
- }) : ((M = function(e, t) {
28
- return e && Array.prototype.forEach.call(e.length ? e : [e], function(e) {
29
- return function(e) {
30
- if (e && e.nodeName && e.nodeName === "TEXTAREA" && !A.has(e)) {
31
- var t, n = null, r = window.getComputedStyle(e), i = (t = e.value, function() {
32
- o({
33
- testForHeightReduction: t === "" || !e.value.startsWith(t),
34
- restoreTextAlign: null
35
- }), t = e.value;
36
- }), a = function(t) {
37
- e.removeEventListener("autosize:destroy", a), e.removeEventListener("autosize:update", s), e.removeEventListener("input", i), window.removeEventListener("resize", s), Object.keys(t).forEach(function(n) {
38
- return e.style[n] = t[n];
39
- }), A.delete(e);
40
- }.bind(e, {
41
- height: e.style.height,
42
- resize: e.style.resize,
43
- textAlign: e.style.textAlign,
44
- overflowY: e.style.overflowY,
45
- overflowX: e.style.overflowX,
46
- wordWrap: e.style.wordWrap
47
- });
48
- 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", A.set(e, {
49
- destroy: a,
50
- update: s
51
- }), s();
52
- }
53
- function o(t) {
54
- var i, a, s = t.restoreTextAlign, c = s === void 0 ? null : s, l = t.testForHeightReduction, u = l === void 0 || l, d = r.overflowY;
55
- if (e.scrollHeight !== 0 && (r.resize === "vertical" ? e.style.resize = "none" : r.resize === "both" && (e.style.resize = "horizontal"), u && (i = function(e) {
56
- for (var t = []; e && e.parentNode && e.parentNode instanceof Element;) e.parentNode.scrollTop && t.push([e.parentNode, e.parentNode.scrollTop]), e = e.parentNode;
57
- return function() {
58
- return t.forEach(function(e) {
59
- var t = e[0], n = e[1];
60
- t.style.scrollBehavior = "auto", t.scrollTop = n, t.style.scrollBehavior = null;
61
- });
62
- };
63
- }(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)) {
64
- var f = r.textAlign;
65
- r.overflow === "hidden" && (e.style.textAlign = f === "start" ? "end" : "start"), o({
66
- restoreTextAlign: f,
67
- testForHeightReduction: !0
68
- });
69
- }
70
- }
71
- function s() {
72
- o({
73
- testForHeightReduction: !0,
74
- restoreTextAlign: null
75
- });
76
- }
77
- }(e);
78
- }), e;
79
- }).destroy = function(e) {
80
- return e && Array.prototype.forEach.call(e.length ? e : [e], de), e;
81
- }, M.update = function(e) {
82
- return e && Array.prototype.forEach.call(e.length ? e : [e], j), e;
83
- });
84
- var N = M, P = ["type"], F = {
85
- key: 0,
86
- class: "pk-chat-button__label"
87
- }, I = /* @__PURE__ */ _({
88
- __name: "PkChatButton",
89
- props: {
90
- icon: {},
91
- label: { default: void 0 },
92
- type: { default: "button" },
93
- modifiers: { default: void 0 }
94
- },
95
- setup(e) {
96
- return (t, n) => {
97
- let r = s;
98
- return x(), f("button", {
99
- class: b(["pk-chat-button", [e.modifiers ? `pk-chat-button--${e.modifiers}` : void 0, { "pk-chat-button--labelled": e.label }]]),
100
- type: e.type
101
- }, [h(r, {
102
- name: e.icon,
103
- class: "pk-chat-button__icon"
104
- }, null, 8, ["name"]), e.label ? (x(), f("span", F, T(e.label), 1)) : d("", !0)], 10, P);
105
- };
106
- }
107
- }), fe = { class: "pk-chatbot-input" }, pe = {
108
- key: 0,
109
- class: "pk-chatbot-input__notice",
110
- role: "status"
111
- }, me = {
112
- key: 2,
113
- class: "pk-chatbot-input__notice-text"
114
- }, he = ["title"], ge = {
115
- key: 1,
116
- class: "pk-chatbot-input__pointer"
117
- }, _e = { class: "pk-chatbot-input__pointer-label" }, ve = {
118
- key: 2,
119
- class: "pk-chatbot-input__attachments"
120
- }, ye = { class: "pk-chatbot-input__fieldset" }, be = [
121
- "title",
122
- "disabled",
123
- "onClick"
124
- ], xe = ["accept"], Se = ["accept"], Ce = { class: "pk-chatbot-input__content" }, we = [
125
- "value",
126
- "aria-label",
127
- "aria-describedby",
128
- "aria-invalid",
129
- "placeholder"
130
- ], Te = ["id"], Ee = { class: "opacity-60" }, L = /* @__PURE__ */ _({
131
- __name: "PkChatbotInput",
132
- props: /*@__PURE__*/ v({
133
- placeholder: {},
134
- dismissableNotice: {},
135
- pageNotice: {},
136
- status: {},
137
- maxMessageLength: {},
138
- fileUpload: {},
139
- attachmentLimitReached: { type: Boolean },
140
- attachmentNotice: {},
141
- voiceEnabled: { type: Boolean },
142
- queueEnabled: { type: Boolean },
143
- answerNotices: {},
144
- pointerAvailable: { type: Boolean },
145
- pointing: { type: Boolean },
146
- pointer: {},
147
- automaticConfirmations: { type: Boolean },
148
- editableImages: { type: Boolean },
149
- retryableAttachments: { type: Boolean }
150
- }, {
151
- modelValue: { default: void 0 },
152
- modelModifiers: {},
153
- pendingAttachments: { default: () => [] },
154
- pendingAttachmentsModifiers: {}
155
- }),
156
- emits: /*@__PURE__*/ v([
157
- "submit",
158
- "stop-generation",
159
- "file-select",
160
- "remove-attachment",
161
- "replace-attachment",
162
- "retry-attachment",
163
- "dismiss-attachment-notice",
164
- "dismiss-page-notice",
165
- "open-answer-notice",
166
- "dismiss-answer-notice",
167
- "voice-start",
168
- "point",
169
- "remove-pointer",
170
- "manual-confirmations"
171
- ], ["update:modelValue", "update:pendingAttachments"]),
172
- setup(_, { expose: v, emit: A }) {
173
- let de = g(() => import("./PkImageEditorDialog-Dn3HV_ny.js")), j = oe(_, "modelValue"), M = oe(_, "pendingAttachments"), P = A, F = _, { t: L } = le({ useScope: "global" }), R = D("textareaEl"), De = D("fileInputEl"), z = D("cameraInputEl"), B = D("formEl"), V = S(j.value ?? ""), H = null, U = () => {
174
- H !== null && (clearTimeout(H), H = null);
175
- }, Oe = () => {
176
- U(), j.value = V.value;
177
- }, ke = () => {
178
- U(), H = setTimeout(() => {
179
- j.value = V.value, H = null;
180
- }, 300);
181
- }, Ae = () => {
182
- V.value = R.value?.value ?? "", ke();
183
- };
184
- O(j, (e) => {
185
- e !== V.value && (V.value = e ?? "", y(() => {
186
- R.value && N.update(R.value);
187
- }));
188
- });
189
- let W = l(() => F.status === "streaming"), G = l(() => F.status === "submitted"), K = l(() => W.value || G.value), q = ae(), je = l(() => V.value.length), J = l(() => F.maxMessageLength !== void 0 && je.value > F.maxMessageLength), Me = l(() => M.value.some((e) => e.state === "uploading")), Ne = l(() => M.value.some((e) => e.state === "error")), Y = l(() => K.value && !F.queueEnabled || Me.value || Ne.value || J.value ? !1 : V.value.trim().length > 0), Pe = l(() => K.value && Y.value), Fe = "capture" in document.createElement("input"), Ie = l(() => {
190
- let t = F.fileUpload?.allowedMimeTypes ?? [];
191
- return [...t, ...e(t)].join(",");
192
- }), Le = l(() => (F.fileUpload?.allowedMimeTypes ?? []).filter((e) => e.startsWith("image/")).join(",")), X = l(() => Fe && Le.value.length > 0), Re = () => {
193
- De.value?.click();
194
- }, ze = () => {
195
- z.value?.click();
196
- }, Be = (e) => {
197
- for (let t of e) P("file-select", t);
198
- }, Ve = (e) => {
199
- let t = e.target;
200
- Be(Array.from(t.files ?? [])), t.value = "";
201
- }, He = (e) => {
202
- let t = M.value.find((t) => t.id === e);
203
- t && (URL.revokeObjectURL(t.localUrl), M.value = M.value.filter((t) => t.id !== e), P("remove-attachment", t));
204
- }, Z = S(), Q = l(() => M.value.find((e) => e.id === Z.value)), $ = ie(), Ue = l(() => Q.value?.file ?? $.value), We = (e) => !!F.editableImages && e.state !== "uploading" && r(e.file.type), Ge = () => {
205
- Z.value = void 0, $.value = void 0;
206
- }, Ke = async (e) => {
207
- let t = Q.value, n = !t && !!$.value;
208
- if (Ge(), t) P("replace-attachment", t, e);
209
- else if (n) P("file-select", e);
210
- else return;
211
- await y(), R.value?.focus();
212
- }, qe = S(!0), Je = () => {
213
- qe.value = !1;
214
- }, Ye = l(() => {
215
- if (F.attachmentNotice) return [{
216
- id: "limit",
217
- icon: "ri:information-line",
218
- text: F.attachmentNotice,
219
- dismiss: () => P("dismiss-attachment-notice")
220
- }];
221
- let e = [];
222
- Ne.value && e.push({
223
- id: "upload-failed",
224
- icon: "ri:error-warning-line",
225
- text: L("message.attachmentUploadFailed")
226
- });
227
- for (let t of F.answerNotices ?? []) e.push({
228
- id: `answer-${t.id}`,
229
- icon: "ri:chat-check-line",
230
- text: t.text,
231
- open: () => P("open-answer-notice", t.id),
232
- dismiss: () => P("dismiss-answer-notice", t.id)
233
- });
234
- return F.pageNotice && e.push({
235
- id: "page",
236
- icon: "ri:pages-line",
237
- text: F.pageNotice,
238
- dismiss: () => P("dismiss-page-notice")
239
- }), F.dismissableNotice && qe.value && e.push({
240
- id: "dismissable",
241
- markdown: F.dismissableNotice,
242
- dismiss: Je
243
- }), e;
244
- }), Xe = () => {
245
- B.value?.querySelector("button:focus-visible") && R.value?.focus();
246
- }, Ze = () => {
247
- Xe(), P("stop-generation");
248
- }, Qe = () => {
249
- Y.value && (Xe(), Oe(), P("submit"), V.value = "", j.value = "", y(() => {
250
- R.value && (R.value.value = "", N.update(R.value));
251
- }));
252
- }, $e = (e) => {
253
- e.shiftKey || e.isComposing || e.keyCode === 229 || (e.preventDefault(), Qe());
254
- };
255
- re(() => {
256
- R.value && N(R.value);
257
- });
258
- let et = 0;
259
- return ue(R, ([e]) => {
260
- let t = e?.contentRect.width ?? 0;
261
- R.value && t !== et && (et = t, N.update(R.value));
262
- }), O(() => F.placeholder, async () => {
263
- await y(), R.value && N.update(R.value);
264
- }), ne(() => {
265
- U(), R.value && N.destroy(R.value);
266
- for (let e of M.value) URL.revokeObjectURL(e.localUrl);
267
- }), v({
268
- focus: () => R.value?.focus(),
269
- annotateImage: (e) => {
270
- Z.value = void 0, $.value = e;
271
- }
272
- }), (e, r) => {
273
- let l = s, g = t, v = o, y = a;
274
- return x(), f("div", fe, [
275
- Ye.value.length ? (x(), f("div", pe, [(x(!0), f(c, null, C(Ye.value, (e) => (x(), f("div", {
276
- key: e.id,
277
- class: "pk-chatbot-input__notice-item"
278
- }, [
279
- e.icon ? (x(), u(l, {
280
- key: 0,
281
- name: e.icon,
282
- class: "pk-chatbot-input__notice-icon"
283
- }, null, 8, ["name"])) : d("", !0),
284
- e.markdown ? (x(), u(n, {
285
- key: 1,
286
- markdown: e.markdown,
287
- class: "wysiwyg pk-chatbot-input__notice-text"
288
- }, null, 8, ["markdown"])) : (x(), f("span", me, T(e.text), 1)),
289
- e.open ? (x(), u(g, {
290
- key: 3,
291
- label: E(L)("action.open"),
292
- modifiers: "link",
293
- class: "pk-chatbot-input__notice-action",
294
- onClick: (t) => e.open()
295
- }, null, 8, ["label", "onClick"])) : d("", !0),
296
- e.dismiss ? (x(), u(g, {
297
- key: 4,
298
- title: E(L)("action.close"),
299
- modifiers: "action-quiet",
300
- icon: "ri:close-line",
301
- class: "w-18 h-18",
302
- onClick: (t) => e.dismiss()
303
- }, null, 8, ["title", "onClick"])) : d("", !0)
304
- ]))), 128))])) : d("", !0),
305
- p("form", {
306
- ref_key: "formEl",
307
- ref: B,
308
- class: "pk-chatbot-input__form",
309
- onSubmit: ce(Qe, ["prevent"])
310
- }, [
311
- _.automaticConfirmations ? (x(), f("button", {
312
- key: 0,
313
- type: "button",
314
- class: "pk-chatbot-input__mode",
315
- title: E(L)("action.manualConfirmations"),
316
- onClick: r[0] ||= (e) => P("manual-confirmations")
317
- }, [
318
- h(l, {
319
- name: "ri:flashlight-line",
320
- class: "pk-chatbot-input__pointer-icon"
321
- }),
322
- m(" " + T(E(L)("label.automaticConfirmations")) + " ", 1),
323
- h(l, {
324
- name: "ri:close-line",
325
- class: "pk-chatbot-input__pointer-icon"
326
- })
327
- ], 8, he)) : d("", !0),
328
- _.pointer ? (x(), f("div", ge, [
329
- h(l, {
330
- name: _.pointer.kind === "text" ? "ri:double-quotes-l" : "ri:focus-3-line",
331
- class: "pk-chatbot-input__pointer-icon"
332
- }, null, 8, ["name"]),
333
- p("span", _e, T(_.pointer.kind === "text" ? `«${_.pointer.label}»` : _.pointer.label), 1),
334
- h(g, {
335
- title: E(L)("pagePointer.remove"),
336
- modifiers: "action-quiet",
337
- icon: "ri:close-line",
338
- class: "w-18 h-18",
339
- onClick: r[1] ||= (e) => P("remove-pointer")
340
- }, null, 8, ["title"])
341
- ])) : d("", !0),
342
- M.value.length ? (x(), f("div", ve, [(x(!0), f(c, null, C(M.value, (e) => (x(), u(i, {
343
- key: e.id,
344
- "media-type": e.mediaSource?.mimeType ?? e.file.type,
345
- url: e.localUrl,
346
- filename: e.file.name,
347
- size: e.file.size,
348
- loading: e.state === "uploading",
349
- error: e.state === "error" ? e.error : void 0,
350
- removable: e.state !== "uploading",
351
- editable: We(e),
352
- retryable: _.retryableAttachments && e.state === "error",
353
- compact: "",
354
- onRemove: (t) => He(e.id),
355
- onEdit: (t) => Z.value = e.id,
356
- onRetry: (t) => P("retry-attachment", e)
357
- }, null, 8, [
358
- "media-type",
359
- "url",
360
- "filename",
361
- "size",
362
- "loading",
363
- "error",
364
- "removable",
365
- "editable",
366
- "retryable",
367
- "onRemove",
368
- "onEdit",
369
- "onRetry"
370
- ]))), 128))])) : d("", !0),
371
- p("div", ye, [
372
- w(e.$slots, "prepend"),
373
- _.fileUpload && _.fileUpload.enabled && (X.value || e.$slots["additional-actions"]) ? (x(), u(y, te(ee({ key: 0 }, {
374
- placement: "top-start",
375
- modifiers: "menu",
376
- flip: !0,
377
- offset: 3
378
- })), {
379
- default: k(({ init: e, toggle: t, aria: n }) => [p("button", ee({ ref: (t) => e(t) }, n, {
380
- class: "pk-chat-button",
381
- type: "button",
382
- title: E(L)("action.attachFile"),
383
- disabled: K.value,
384
- onClick: t
385
- }), [h(l, {
386
- name: "ri:add-line",
387
- class: "pk-chat-button__icon"
388
- })], 16, be)]),
389
- items: k(() => [
390
- X.value ? (x(), u(v, {
391
- key: 0,
392
- disabled: K.value || _.attachmentLimitReached,
393
- onClick: ze
394
- }, {
395
- default: k(() => [h(l, {
396
- name: "ri:camera-line",
397
- class: "pk-chatbot-input__dropdown-icon"
398
- }), m(" " + T(E(L)("action.takePhoto")), 1)]),
399
- _: 1
400
- }, 8, ["disabled"])) : d("", !0),
401
- h(v, {
402
- disabled: K.value || _.attachmentLimitReached,
403
- onClick: Re
404
- }, {
405
- default: k(() => [h(l, {
406
- name: "ri:attachment-line",
407
- class: "pk-chatbot-input__dropdown-icon"
408
- }), m(" " + T(E(L)("action.attachFile")), 1)]),
409
- _: 1
410
- }, 8, ["disabled"]),
411
- w(e.$slots, "additional-actions")
412
- ]),
413
- _: 3
414
- }, 16)) : _.fileUpload && _.fileUpload.enabled ? (x(), u(I, {
415
- key: 1,
416
- icon: "ri:add-line",
417
- title: E(L)("action.attachFile"),
418
- disabled: K.value || _.attachmentLimitReached,
419
- onClick: Re
420
- }, null, 8, ["title", "disabled"])) : d("", !0),
421
- _.fileUpload && _.fileUpload.enabled ? (x(), f("input", {
422
- key: 2,
423
- ref_key: "fileInputEl",
424
- ref: De,
425
- type: "file",
426
- hidden: "",
427
- multiple: "",
428
- accept: Ie.value,
429
- onChange: Ve
430
- }, null, 40, xe)) : d("", !0),
431
- _.fileUpload && _.fileUpload.enabled && X.value ? (x(), f("input", {
432
- key: 3,
433
- ref_key: "cameraInputEl",
434
- ref: z,
435
- type: "file",
436
- capture: "environment",
437
- hidden: "",
438
- accept: Le.value,
439
- onChange: Ve
440
- }, null, 40, Se)) : d("", !0),
441
- _.pointerAvailable ? (x(), u(I, {
442
- key: 4,
443
- icon: "ri:focus-3-line",
444
- title: E(L)("pagePointer.start"),
445
- "aria-pressed": _.pointing,
446
- disabled: K.value,
447
- onClick: r[2] ||= (e) => P("point")
448
- }, null, 8, [
449
- "title",
450
- "aria-pressed",
451
- "disabled"
452
- ])) : d("", !0),
453
- p("div", Ce, [p("textarea", {
454
- ref_key: "textareaEl",
455
- ref: R,
456
- value: V.value,
457
- class: "pk-chatbot-input__textarea",
458
- name: "message",
459
- rows: "1",
460
- enterkeyhint: "send",
461
- "aria-label": E(L)("label.message"),
462
- "aria-describedby": _.maxMessageLength ? E(q) : void 0,
463
- "aria-invalid": J.value || void 0,
464
- placeholder: _.placeholder,
465
- onInput: Ae,
466
- onKeydown: se($e, ["enter"])
467
- }, null, 40, we)]),
468
- _.maxMessageLength ? (x(), f("div", {
469
- key: 5,
470
- id: E(q),
471
- class: b(["pk-chatbot-input__counter", { "pk-chatbot-input__counter--over": J.value }])
472
- }, [m(T(e.$n(je.value, "integer")) + "/", 1), p("span", Ee, T(e.$n(_.maxMessageLength, "integer")), 1)], 10, Te)) : d("", !0),
473
- _.voiceEnabled && !W.value ? (x(), u(I, {
474
- key: 6,
475
- icon: "ri:mic-line",
476
- title: E(L)("action.talk"),
477
- disabled: K.value,
478
- onClick: r[3] ||= (e) => P("voice-start")
479
- }, null, 8, ["title", "disabled"])) : d("", !0),
480
- W.value ? (x(), u(I, {
481
- key: 7,
482
- icon: "ri:stop-fill",
483
- modifiers: Pe.value ? void 0 : "primary",
484
- title: E(L)("action.stop"),
485
- onClick: Ze
486
- }, null, 8, ["modifiers", "title"])) : d("", !0),
487
- Pe.value ? (x(), u(I, {
488
- key: 8,
489
- type: "submit",
490
- modifiers: "primary",
491
- icon: "ri:arrow-up-line",
492
- title: E(L)("action.queueMessage")
493
- }, null, 8, ["title"])) : W.value ? d("", !0) : (x(), u(I, {
494
- key: 9,
495
- type: "submit",
496
- modifiers: "primary",
497
- icon: G.value ? "loading-loop" : "ri:arrow-up-line",
498
- title: E(L)("action.submit"),
499
- disabled: !Y.value
500
- }, null, 8, [
501
- "icon",
502
- "title",
503
- "disabled"
504
- ]))
505
- ])
506
- ], 544),
507
- Ue.value ? (x(), u(E(de), {
508
- key: Q.value?.id ?? "annotating",
509
- file: Ue.value,
510
- "initial-tool": Q.value ? void 0 : "arrow",
511
- onApply: Ke,
512
- onClose: Ge
513
- }, null, 8, ["file", "initial-tool"])) : d("", !0)
514
- ]);
515
- };
516
- }
517
- });
518
- export { I as n, L as t };
519
-
520
- //# sourceMappingURL=PkChatbotInput-DSyIo0xB.js.map