@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.
- package/dist/_chunks/{Agent-DZEyfr8D.js → Agent-DJ6TBi6l.js} +143 -138
- package/dist/_chunks/Agent-DJ6TBi6l.js.map +1 -0
- package/dist/_chunks/{PkFilePreview-BHqmp1EW.js → PkFilePreview-BrWWeK4E.js} +3 -3
- package/dist/_chunks/{PkFilePreview-BHqmp1EW.js.map → PkFilePreview-BrWWeK4E.js.map} +1 -1
- package/dist/_chunks/{PkFilePreviewDialog-BHAgVlKs.js → PkFilePreviewDialog-BRZH_LxY.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-BHAgVlKs.js.map → PkFilePreviewDialog-BRZH_LxY.js.map} +1 -1
- package/dist/_chunks/{PkImageEditorDialog-BDwL39Du.js → PkImageEditorDialog-D21ggZkD.js} +6 -5
- package/dist/_chunks/{PkImageEditorDialog-BDwL39Du.js.map → PkImageEditorDialog-D21ggZkD.js.map} +1 -1
- package/dist/_chunks/{PkSelectionActions-DLsZ8-gW.js → PkSelectionActions-BLfFobXb.js} +2 -2
- package/dist/_chunks/{PkSelectionActions-DLsZ8-gW.js.map → PkSelectionActions-BLfFobXb.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-14rJ_FK2.js → PkStreamingMarkdown-Bekhx_vG.js} +300 -213
- package/dist/_chunks/PkStreamingMarkdown-Bekhx_vG.js.map +1 -0
- package/dist/_chunks/{PkToolChatFile-62j1S0Pq.js → PkToolChatFile-BzN4fMaY.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-62j1S0Pq.js.map → PkToolChatFile-BzN4fMaY.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-B9EM_K6O.js → PkToolRequestGeolocation-Dj5OxEMP.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-B9EM_K6O.js.map → PkToolRequestGeolocation-Dj5OxEMP.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-CfjfqCHX.js → PkToolRequestOAuthConnection-Cj_IYnrW.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-CfjfqCHX.js.map → PkToolRequestOAuthConnection-Cj_IYnrW.js.map} +1 -1
- package/dist/_chunks/PkToolShowArtifact-BkGtejtb.js +110 -0
- package/dist/_chunks/PkToolShowArtifact-BkGtejtb.js.map +1 -0
- package/dist/_chunks/{PkToolShowContactForm-BeJ5GR6t.js → PkToolShowContactForm-BXsvfCKR.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-BeJ5GR6t.js.map → PkToolShowContactForm-BXsvfCKR.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-B9VDoS_W.js → PkToolShowForm-DeG_AzO9.js} +4 -4
- package/dist/_chunks/{PkToolShowForm-B9VDoS_W.js.map → PkToolShowForm-DeG_AzO9.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-DFuc5IJ1.js → PkToolShowImageGallery-Dri9KUNg.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-DFuc5IJ1.js.map → PkToolShowImageGallery-Dri9KUNg.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-C2EJKYOV.js → PkToolShowProductList-C-XQdsus.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-C2EJKYOV.js.map → PkToolShowProductList-C-XQdsus.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-BL3DnfcN.js → PkToolShowSources-DMDML2kQ.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-BL3DnfcN.js.map → PkToolShowSources-DMDML2kQ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-DLgtjBJ1.js → PkToolShowSuggestedReply-BYoW-L6k.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-DLgtjBJ1.js.map → PkToolShowSuggestedReply-BYoW-L6k.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-DcWXDcOZ.js → PkToolShowVideo-C_1ziurv.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-DcWXDcOZ.js.map → PkToolShowVideo-C_1ziurv.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-CPqMC6qt.js → PkToolShowWebPages-yFdm0n0F.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-CPqMC6qt.js.map → PkToolShowWebPages-yFdm0n0F.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-DMt6O5iK.js → chatImagePolicy-Dqke0kDv.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-DMt6O5iK.js.map → chatImagePolicy-Dqke0kDv.js.map} +1 -1
- package/dist/_chunks/{markdown-nw5sXwU0.js → markdown-Z_eeOlvv.js} +16 -16
- package/dist/_chunks/{markdown-nw5sXwU0.js.map → markdown-Z_eeOlvv.js.map} +1 -1
- package/dist/_chunks/{utils-DE4cAz37.js → utils-C1JaUBI_.js} +2 -2
- package/dist/_chunks/{utils-DE4cAz37.js.map → utils-C1JaUBI_.js.map} +1 -1
- package/dist/ai-elements.es.js +3754 -3573
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotAuth.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{Agent-CBAd3F7k.js → Agent-DrnYCRFA.js} +2 -2
- package/dist-vue/_chunks/{Agent-CBAd3F7k.js.map → Agent-DrnYCRFA.js.map} +1 -1
- package/dist-vue/_chunks/{Document-B3w5H0R0.js → Document-CA7c3oZE.js} +11 -11
- package/dist-vue/_chunks/{Document-B3w5H0R0.js.map → Document-CA7c3oZE.js.map} +1 -1
- package/dist-vue/_chunks/{Media-0U2B_qCS.js → Media-BIlhY_h6.js} +31 -26
- package/dist-vue/_chunks/Media-BIlhY_h6.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbot-aCgj2DMu.js → PkChatbot-QjeNY0h6.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-aCgj2DMu.js.map → PkChatbot-QjeNY0h6.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotAuth-C5agN8ht.js → PkChatbotAuth-C8ZjLNFY.js} +8 -8
- package/dist-vue/_chunks/{PkChatbotAuth-C5agN8ht.js.map → PkChatbotAuth-C8ZjLNFY.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-CLfzcH_t.js → PkChatbotEmptyState-D6S0iYe3.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-CLfzcH_t.js.map → PkChatbotEmptyState-D6S0iYe3.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotInput-CunAf5Rq.js +708 -0
- package/dist-vue/_chunks/PkChatbotInput-CunAf5Rq.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotMessages-CG3UZYcP.js → PkChatbotMessages-CzPsgCAN.js} +351 -326
- package/dist-vue/_chunks/PkChatbotMessages-CzPsgCAN.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-fyrbP7yS.js → PkChatbotStepPayload-BQDpTDgn.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-fyrbP7yS.js.map → PkChatbotStepPayload-BQDpTDgn.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-Drhc6X-x.js → PkChatbotStepToolDetail-Dsf9t1B6.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-Drhc6X-x.js.map → PkChatbotStepToolDetail-Dsf9t1B6.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-DZwV7UVr.js → PkChatbotSteps-HACZ1RrB.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-DZwV7UVr.js.map → PkChatbotSteps-HACZ1RrB.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-IU3HJpxG.js → PkChatbotViewChat-BpDCX_72.js} +107 -107
- package/dist-vue/_chunks/PkChatbotViewChat-BpDCX_72.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-4zGrp7Fo.js → PkChatbotViewConversations-B0nUFwuu.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-4zGrp7Fo.js.map → PkChatbotViewConversations-B0nUFwuu.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-PHdrHZOf.js → PkChatbotViewFiles-gGshDAPk.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-PHdrHZOf.js.map → PkChatbotViewFiles-gGshDAPk.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-BrZ7oiUY.js → PkChatbotViewProfile-BuJtqq8F.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-BrZ7oiUY.js.map → PkChatbotViewProfile-BuJtqq8F.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-WqS-s3vk.js → PkFilePreview-0p50S8Km.js} +4 -4
- package/dist-vue/_chunks/{PkFilePreview-WqS-s3vk.js.map → PkFilePreview-0p50S8Km.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-BIaTAK05.js → PkFilePreviewDialog-B1N4xDEu.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-BIaTAK05.js.map → PkFilePreviewDialog-B1N4xDEu.js.map} +1 -1
- package/dist-vue/_chunks/{PkImageEditorDialog-_-UkV0CO.js → PkImageEditorDialog-B-jW5yE8.js} +6 -5
- package/dist-vue/_chunks/{PkImageEditorDialog-_-UkV0CO.js.map → PkImageEditorDialog-B-jW5yE8.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-ha0V58V9.js → PkStreamingMarkdown-WIueQOg3.js} +530 -445
- package/dist-vue/_chunks/PkStreamingMarkdown-WIueQOg3.js.map +1 -0
- package/dist-vue/_chunks/{PkToolChatFile-OusYITiO.js → PkToolChatFile-W6OJP7HH.js} +3 -3
- package/dist-vue/_chunks/{PkToolChatFile-OusYITiO.js.map → PkToolChatFile-W6OJP7HH.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-CyL_M1Rm.js → PkToolRequestGeolocation-BPZfJfR1.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-CyL_M1Rm.js.map → PkToolRequestGeolocation-BPZfJfR1.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DWkeVLpx.js → PkToolRequestOAuthConnection-BaMZkvU5.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DWkeVLpx.js.map → PkToolRequestOAuthConnection-BaMZkvU5.js.map} +1 -1
- package/dist-vue/_chunks/PkToolShowArtifact-CPBFsUrY.js +107 -0
- package/dist-vue/_chunks/PkToolShowArtifact-CPBFsUrY.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowChart-BSnYmoJJ.js → PkToolShowChart-BaUS47YU.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowChart-BSnYmoJJ.js.map → PkToolShowChart-BaUS47YU.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-DFufPNnQ.js → PkToolShowContactForm-6OQ-hjCt.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-DFufPNnQ.js.map → PkToolShowContactForm-6OQ-hjCt.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-BR4fE_be.js → PkToolShowDiagram-D6hPQVoe.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-BR4fE_be.js.map → PkToolShowDiagram-D6hPQVoe.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-yh0YAXcg.js → PkToolShowForm-CAadu_Pq.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-yh0YAXcg.js.map → PkToolShowForm-CAadu_Pq.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-mmUY1Yfg.js → PkToolShowImageGallery-BlTyCF8h.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-mmUY1Yfg.js.map → PkToolShowImageGallery-BlTyCF8h.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-B-ya1TDt.js → PkToolShowProductList-CZFkf9UD.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-B-ya1TDt.js.map → PkToolShowProductList-CZFkf9UD.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-DYkHkVdX.js → PkToolShowSources-Bci0Ab2u.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-DYkHkVdX.js.map → PkToolShowSources-Bci0Ab2u.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-wKgwHTRO.js → PkToolShowSuggestedReply-DCZbwFhR.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-wKgwHTRO.js.map → PkToolShowSuggestedReply-DCZbwFhR.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-CRg2lAY8.js → PkToolShowVideo-BnSYdoTJ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-CRg2lAY8.js.map → PkToolShowVideo-BnSYdoTJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-C_pWag94.js → PkToolShowWebPages-CHrHuFZI.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-C_pWag94.js.map → PkToolShowWebPages-CHrHuFZI.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-DBKfGL6y.js → createChatbotApiClient-_gh3Y1rl.js} +3 -3
- package/dist-vue/_chunks/createChatbotApiClient-_gh3Y1rl.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-Hb5EjISl.js → useChatbotStore-CjFPM9Q5.js} +3 -3
- package/dist-vue/_chunks/{useChatbotStore-Hb5EjISl.js.map → useChatbotStore-CjFPM9Q5.js.map} +1 -1
- package/dist-vue/_chunks/{utils-Df5n2cDc.js → utils-BYvQMZLG.js} +2 -2
- package/dist-vue/_chunks/{utils-Df5n2cDc.js.map → utils-BYvQMZLG.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +40 -8
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +71 -71
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +10 -0
- package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +2 -2
- package/dist-vue/packages/components/src/chat/PkImageEditorDialog.d.ts +5 -0
- package/dist-vue/packages/components/src/chat/PkStreamingMarkdown.d.ts +6 -0
- package/dist-vue/packages/components/src/chat/richCopy.d.ts +33 -0
- package/dist-vue/packages/components/src/chat/screenshot.d.ts +38 -0
- package/dist-vue/packages/models/src/schema/Chat.d.ts +1 -1
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-DZEyfr8D.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown-14rJ_FK2.js.map +0 -1
- package/dist/_chunks/PkToolShowArtifact-I_QZS7Pf.js +0 -94
- package/dist/_chunks/PkToolShowArtifact-I_QZS7Pf.js.map +0 -1
- package/dist-vue/_chunks/Media-0U2B_qCS.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-C9l_1I3d.js +0 -584
- package/dist-vue/_chunks/PkChatbotInput-C9l_1I3d.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-CG3UZYcP.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-IU3HJpxG.js.map +0 -1
- package/dist-vue/_chunks/PkStreamingMarkdown-ha0V58V9.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowArtifact-x57Gri2a.js +0 -91
- package/dist-vue/_chunks/PkToolShowArtifact-x57Gri2a.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-DBKfGL6y.js.map +0 -1
|
@@ -0,0 +1,708 @@
|
|
|
1
|
+
import { t as e } from "./VvButtonLocalized-C-vx25u4.js";
|
|
2
|
+
import { c as t, s as n } from "./Media-BIlhY_h6.js";
|
|
3
|
+
import { t as r } from "./PkStreamingMarkdown-WIueQOg3.js";
|
|
4
|
+
import { t as i } from "./PkChatbotFilePreview-aKJBtw04.js";
|
|
5
|
+
import { j as a, k as o } from "./utils-BYvQMZLG.js";
|
|
6
|
+
import { VvDropdown as s, VvDropdownAction as c, VvIcon as l } from "@volverjs/ui-vue/components";
|
|
7
|
+
import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, createVNode as _, defineAsyncComponent as ee, defineComponent as v, mergeModels as y, mergeProps as te, nextTick as b, normalizeClass as ne, normalizeProps as re, onBeforeUnmount as ie, onMounted as ae, onScopeDispose as oe, openBlock as x, ref as S, renderList as se, renderSlot as ce, shallowRef as le, toDisplayString as C, unref as w, useId as ue, useModel as de, useTemplateRef as T, watch as fe, withCtx as E, withKeys as pe, withModifiers as me } from "vue";
|
|
8
|
+
import { useI18n as he } from "vue-i18n";
|
|
9
|
+
import { useResizeObserver as ge } from "@vueuse/core";
|
|
10
|
+
// ../../packages/composable/src/useSettledSelection.ts
|
|
11
|
+
var _e = "(hover: hover) and (pointer: fine)", D = "(hover: none) and (pointer: coarse)", O = 400;
|
|
12
|
+
function k() {
|
|
13
|
+
return typeof matchMedia == "function" && matchMedia(D).matches;
|
|
14
|
+
}
|
|
15
|
+
function A(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 j({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2, touch: i = !1 }) {
|
|
36
|
+
let a = le(), o, s = () => {
|
|
37
|
+
clearTimeout(o), a.value = void 0;
|
|
38
|
+
}, c = () => {
|
|
39
|
+
let n = e();
|
|
40
|
+
if (!n || !t()) return;
|
|
41
|
+
let i = A(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(_e).matches, u = i && typeof document < "u" && k(), d = u ? Math.max(n, O) : n, f = () => {
|
|
50
|
+
s(), o = setTimeout(() => {
|
|
51
|
+
a.value = c();
|
|
52
|
+
}, d);
|
|
53
|
+
};
|
|
54
|
+
return (l || u) && (document.addEventListener("selectionchange", f), oe(() => {
|
|
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 M = /* @__PURE__ */ new Map();
|
|
63
|
+
function N(e) {
|
|
64
|
+
var t = M.get(e);
|
|
65
|
+
t && t.destroy();
|
|
66
|
+
}
|
|
67
|
+
function P(e) {
|
|
68
|
+
var t = M.get(e);
|
|
69
|
+
t && t.update();
|
|
70
|
+
}
|
|
71
|
+
var F = null;
|
|
72
|
+
typeof window > "u" ? ((F = function(e) {
|
|
73
|
+
return e;
|
|
74
|
+
}).destroy = function(e) {
|
|
75
|
+
return e;
|
|
76
|
+
}, F.update = function(e) {
|
|
77
|
+
return e;
|
|
78
|
+
}) : ((F = 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" && !M.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
|
+
}), M.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", M.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], N), e;
|
|
132
|
+
}, F.update = function(e) {
|
|
133
|
+
return e && Array.prototype.forEach.call(e.length ? e : [e], P), e;
|
|
134
|
+
});
|
|
135
|
+
var I = F, L = ["type"], R = {
|
|
136
|
+
key: 0,
|
|
137
|
+
class: "pk-chat-button__label"
|
|
138
|
+
}, z = /* @__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 = l;
|
|
149
|
+
return x(), m("button", {
|
|
150
|
+
class: ne(["pk-chat-button", [e.modifiers ? `pk-chat-button--${e.modifiers}` : void 0, { "pk-chat-button--labelled": e.label }]]),
|
|
151
|
+
type: e.type
|
|
152
|
+
}, [_(r, {
|
|
153
|
+
name: e.icon,
|
|
154
|
+
class: "pk-chat-button__icon"
|
|
155
|
+
}, null, 8, ["name"]), e.label ? (x(), m("span", R, C(e.label), 1)) : p("", !0)], 10, L);
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}), B = 1568, V = 115e4, H = .85, ve = 300;
|
|
159
|
+
function ye() {
|
|
160
|
+
if (typeof navigator.mediaDevices?.getDisplayMedia != "function") return !1;
|
|
161
|
+
let e = document.featurePolicy;
|
|
162
|
+
return !e || e.allowsFeature("display-capture");
|
|
163
|
+
}
|
|
164
|
+
var be = (e, t) => {
|
|
165
|
+
let n = Math.min(1, B / Math.max(e, t), Math.sqrt(V / (e * t)));
|
|
166
|
+
return {
|
|
167
|
+
width: Math.round(e * n),
|
|
168
|
+
height: Math.round(t * n)
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
async function U(e, t) {
|
|
172
|
+
let n, r, i, a;
|
|
173
|
+
if (typeof ImageCapture == "function") {
|
|
174
|
+
let e = await new ImageCapture(t).grabFrame();
|
|
175
|
+
n = e, r = e.width, i = e.height, a = () => e.close();
|
|
176
|
+
} else {
|
|
177
|
+
let t = document.createElement("video");
|
|
178
|
+
t.muted = !0, t.playsInline = !0, t.srcObject = e, await t.play(), await new Promise((e) => {
|
|
179
|
+
let n = setTimeout(e, ve);
|
|
180
|
+
t.requestVideoFrameCallback?.(() => {
|
|
181
|
+
clearTimeout(n), e();
|
|
182
|
+
});
|
|
183
|
+
}), n = t, r = t.videoWidth, i = t.videoHeight, a = () => {
|
|
184
|
+
t.srcObject = null;
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
try {
|
|
188
|
+
let e = be(r, i), t = document.createElement("canvas");
|
|
189
|
+
t.width = e.width, t.height = e.height;
|
|
190
|
+
let a = t.getContext("2d");
|
|
191
|
+
if (!a) throw Error("No 2D context");
|
|
192
|
+
return a.imageSmoothingQuality = "high", a.drawImage(n, 0, 0, e.width, e.height), t;
|
|
193
|
+
} finally {
|
|
194
|
+
a();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
var xe = [
|
|
198
|
+
"image/jpeg",
|
|
199
|
+
"image/webp",
|
|
200
|
+
"image/png"
|
|
201
|
+
];
|
|
202
|
+
async function W(e, t) {
|
|
203
|
+
for (let n of xe) {
|
|
204
|
+
if (!t.includes(n)) continue;
|
|
205
|
+
let r = await new Promise((t) => e.toBlob(t, n, H));
|
|
206
|
+
if (r?.type === n) return r;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
var G = {
|
|
210
|
+
"image/jpeg": "jpg",
|
|
211
|
+
"image/webp": "webp",
|
|
212
|
+
"image/png": "png"
|
|
213
|
+
}, K = (e) => String(e).padStart(2, "0");
|
|
214
|
+
async function Se(e, t) {
|
|
215
|
+
let n = typeof CaptureController == "function" ? new CaptureController() : void 0, r;
|
|
216
|
+
try {
|
|
217
|
+
r = await navigator.mediaDevices.getDisplayMedia({
|
|
218
|
+
video: { displaySurface: "window" },
|
|
219
|
+
audio: !1,
|
|
220
|
+
selfBrowserSurface: "exclude",
|
|
221
|
+
...n && { controller: n }
|
|
222
|
+
});
|
|
223
|
+
} catch (e) {
|
|
224
|
+
return { status: e instanceof DOMException && e.name === "NotAllowedError" ? "cancelled" : "failed" };
|
|
225
|
+
}
|
|
226
|
+
try {
|
|
227
|
+
try {
|
|
228
|
+
n?.setFocusBehavior?.("focus-capturing-application");
|
|
229
|
+
} catch {}
|
|
230
|
+
let i = r.getVideoTracks()[0];
|
|
231
|
+
if (!i) return { status: "failed" };
|
|
232
|
+
let a = await W(await U(r, i), e);
|
|
233
|
+
if (!a) return { status: "failed" };
|
|
234
|
+
let o = /* @__PURE__ */ new Date(), s = `${o.getFullYear()}-${K(o.getMonth() + 1)}-${K(o.getDate())} ${K(o.getHours())}.${K(o.getMinutes())}.${K(o.getSeconds())}`;
|
|
235
|
+
return {
|
|
236
|
+
status: "taken",
|
|
237
|
+
file: new File([a], `${t} ${s}.${G[a.type]}`, {
|
|
238
|
+
type: a.type,
|
|
239
|
+
lastModified: o.getTime()
|
|
240
|
+
})
|
|
241
|
+
};
|
|
242
|
+
} catch {
|
|
243
|
+
return { status: "failed" };
|
|
244
|
+
} finally {
|
|
245
|
+
r.getTracks().forEach((e) => e.stop());
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
// ../../packages/components/src/chat/PkChatbotInput.vue?vue&type=script&setup=true&lang.ts
|
|
249
|
+
var Ce = { class: "pk-chatbot-input" }, we = {
|
|
250
|
+
key: 0,
|
|
251
|
+
class: "pk-chatbot-input__notice",
|
|
252
|
+
role: "status"
|
|
253
|
+
}, Te = {
|
|
254
|
+
key: 2,
|
|
255
|
+
class: "pk-chatbot-input__notice-text"
|
|
256
|
+
}, Ee = ["title"], De = {
|
|
257
|
+
key: 1,
|
|
258
|
+
class: "pk-chatbot-input__pointer"
|
|
259
|
+
}, Oe = { class: "pk-chatbot-input__pointer-label" }, ke = {
|
|
260
|
+
key: 2,
|
|
261
|
+
class: "pk-chatbot-input__attachments"
|
|
262
|
+
}, Ae = { class: "pk-chatbot-input__fieldset" }, je = [
|
|
263
|
+
"title",
|
|
264
|
+
"disabled",
|
|
265
|
+
"onClick"
|
|
266
|
+
], Me = ["accept"], Ne = ["accept"], Pe = { class: "pk-chatbot-input__content" }, Fe = [
|
|
267
|
+
"value",
|
|
268
|
+
"aria-label",
|
|
269
|
+
"aria-describedby",
|
|
270
|
+
"aria-invalid",
|
|
271
|
+
"placeholder"
|
|
272
|
+
], Ie = {
|
|
273
|
+
key: 5,
|
|
274
|
+
class: "pk-chatbot-input__suggestion-key"
|
|
275
|
+
}, Le = ["id"], Re = ["id"], ze = { class: "opacity-60" }, q = /* @__PURE__ */ v({
|
|
276
|
+
__name: "PkChatbotInput",
|
|
277
|
+
props: /*@__PURE__*/ y({
|
|
278
|
+
placeholder: {},
|
|
279
|
+
suggestion: {},
|
|
280
|
+
dismissableNotice: {},
|
|
281
|
+
pageNotice: {},
|
|
282
|
+
status: {},
|
|
283
|
+
maxMessageLength: {},
|
|
284
|
+
fileUpload: {},
|
|
285
|
+
attachmentLimitReached: { type: Boolean },
|
|
286
|
+
attachmentNotice: {},
|
|
287
|
+
voiceEnabled: { type: Boolean },
|
|
288
|
+
queueEnabled: { type: Boolean },
|
|
289
|
+
answerNotices: {},
|
|
290
|
+
pointerAvailable: { type: Boolean },
|
|
291
|
+
pointing: { type: Boolean },
|
|
292
|
+
pointer: {},
|
|
293
|
+
automaticConfirmations: { type: Boolean },
|
|
294
|
+
editableImages: { type: Boolean },
|
|
295
|
+
retryableAttachments: { type: Boolean }
|
|
296
|
+
}, {
|
|
297
|
+
modelValue: { default: void 0 },
|
|
298
|
+
modelModifiers: {},
|
|
299
|
+
pendingAttachments: { default: () => [] },
|
|
300
|
+
pendingAttachmentsModifiers: {}
|
|
301
|
+
}),
|
|
302
|
+
emits: /*@__PURE__*/ y([
|
|
303
|
+
"submit",
|
|
304
|
+
"stop-generation",
|
|
305
|
+
"file-select",
|
|
306
|
+
"remove-attachment",
|
|
307
|
+
"replace-attachment",
|
|
308
|
+
"retry-attachment",
|
|
309
|
+
"dismiss-attachment-notice",
|
|
310
|
+
"dismiss-page-notice",
|
|
311
|
+
"open-answer-notice",
|
|
312
|
+
"dismiss-answer-notice",
|
|
313
|
+
"voice-start",
|
|
314
|
+
"point",
|
|
315
|
+
"remove-pointer",
|
|
316
|
+
"manual-confirmations"
|
|
317
|
+
], ["update:modelValue", "update:pendingAttachments"]),
|
|
318
|
+
setup(v, { expose: y, emit: oe }) {
|
|
319
|
+
let _e = ee(() => import("./PkImageEditorDialog-B-jW5yE8.js")), D = de(v, "modelValue"), O = de(v, "pendingAttachments"), A = oe, j = v, { t: M } = he({ useScope: "global" }), N = T("textareaEl"), P = T("fileInputEl"), F = T("cameraInputEl"), L = T("formEl"), R = S(D.value ?? ""), B = null, V = () => {
|
|
320
|
+
B !== null && (clearTimeout(B), B = null);
|
|
321
|
+
}, H = () => {
|
|
322
|
+
V(), D.value = R.value;
|
|
323
|
+
}, ve = () => {
|
|
324
|
+
V(), B = setTimeout(() => {
|
|
325
|
+
D.value = R.value, B = null;
|
|
326
|
+
}, 300);
|
|
327
|
+
}, be = () => {
|
|
328
|
+
R.value = N.value?.value ?? "", ve();
|
|
329
|
+
};
|
|
330
|
+
fe(D, (e) => {
|
|
331
|
+
e !== R.value && (R.value = e ?? "", b(() => {
|
|
332
|
+
N.value && I.update(N.value);
|
|
333
|
+
}));
|
|
334
|
+
});
|
|
335
|
+
let U = d(() => j.status === "streaming"), W = d(() => j.status === "submitted"), G = d(() => U.value || W.value), K = ue(), q = d(() => R.value.length), Be = d(() => j.maxMessageLength !== void 0 && q.value > j.maxMessageLength), Ve = d(() => O.value.some((e) => e.state === "uploading")), He = d(() => O.value.some((e) => e.state === "error")), Ue = d(() => G.value && !j.queueEnabled || Ve.value || He.value || Be.value ? !1 : R.value.trim().length > 0), We = d(() => G.value && Ue.value), Ge = !k(), Ke = ue(), J = d(() => Ge && j.suggestion && !R.value && !G.value ? j.suggestion : void 0), qe = d(() => [j.maxMessageLength ? K : void 0, J.value ? Ke : void 0].filter(Boolean).join(" ") || void 0), Je = "capture" in document.createElement("input"), Ye = d(() => {
|
|
336
|
+
let e = j.fileUpload?.allowedMimeTypes ?? [];
|
|
337
|
+
return [...e, ...t(e)].join(",");
|
|
338
|
+
}), Xe = d(() => (j.fileUpload?.allowedMimeTypes ?? []).filter((e) => e.startsWith("image/")).join(",")), Ze = d(() => Je && Xe.value.length > 0), Qe = () => {
|
|
339
|
+
P.value?.click();
|
|
340
|
+
}, $e = () => {
|
|
341
|
+
F.value?.click();
|
|
342
|
+
}, et = !k() && ye(), tt = d(() => et && xe.some((e) => j.fileUpload?.allowedMimeTypes?.includes(e))), Y = S(!1), nt = (e) => {
|
|
343
|
+
for (let t of e) A("file-select", t);
|
|
344
|
+
}, rt = (e) => {
|
|
345
|
+
let t = e.target;
|
|
346
|
+
nt(Array.from(t.files ?? [])), t.value = "";
|
|
347
|
+
}, it = (e) => {
|
|
348
|
+
let t = e.clipboardData;
|
|
349
|
+
if (!t?.files.length || !j.fileUpload?.enabled || t.getData("text/plain") && t.types.includes("text/html")) return;
|
|
350
|
+
let r = j.fileUpload.allowedMimeTypes ?? [], i = Array.from(t.files).filter((e) => !r.length || r.includes(n(e.name, e.type, r)));
|
|
351
|
+
i.length && !G.value && (e.preventDefault(), nt(i));
|
|
352
|
+
}, at = (e) => {
|
|
353
|
+
let t = O.value.find((t) => t.id === e);
|
|
354
|
+
t && (URL.revokeObjectURL(t.localUrl), O.value = O.value.filter((t) => t.id !== e), A("remove-attachment", t));
|
|
355
|
+
}, X = S(), Z = d(() => O.value.find((e) => e.id === X.value)), Q = le(), $ = S(!1), ot = d(() => Z.value?.file ?? Q.value), st = (e) => !!j.editableImages && e.state !== "uploading" && o(e.file.type), ct = () => {
|
|
356
|
+
X.value = void 0, Q.value = void 0, $.value = !1;
|
|
357
|
+
}, lt = async () => {
|
|
358
|
+
Y.value = !1;
|
|
359
|
+
let e = await Se(j.fileUpload?.allowedMimeTypes ?? [], M("label.screenshotFileName"));
|
|
360
|
+
e.status === "failed" ? Y.value = !0 : e.status === "taken" && (X.value = void 0, Q.value = Promise.resolve(e.file), $.value = !0);
|
|
361
|
+
}, ut = async (e) => {
|
|
362
|
+
let t = Z.value, n = !t && !!Q.value;
|
|
363
|
+
if (ct(), t) A("replace-attachment", t, e);
|
|
364
|
+
else if (n) A("file-select", e);
|
|
365
|
+
else return;
|
|
366
|
+
await b(), N.value?.focus();
|
|
367
|
+
}, dt = S(!0), ft = () => {
|
|
368
|
+
dt.value = !1;
|
|
369
|
+
}, pt = d(() => {
|
|
370
|
+
if (j.attachmentNotice) return [{
|
|
371
|
+
id: "limit",
|
|
372
|
+
icon: "ri:information-line",
|
|
373
|
+
text: j.attachmentNotice,
|
|
374
|
+
dismiss: () => A("dismiss-attachment-notice")
|
|
375
|
+
}];
|
|
376
|
+
let e = [];
|
|
377
|
+
He.value && e.push({
|
|
378
|
+
id: "upload-failed",
|
|
379
|
+
icon: "ri:error-warning-line",
|
|
380
|
+
text: M("message.attachmentUploadFailed")
|
|
381
|
+
}), Y.value && e.push({
|
|
382
|
+
id: "screenshot-failed",
|
|
383
|
+
icon: "ri:error-warning-line",
|
|
384
|
+
text: M("message.screenshotFailed"),
|
|
385
|
+
dismiss: () => {
|
|
386
|
+
Y.value = !1;
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
for (let t of j.answerNotices ?? []) e.push({
|
|
390
|
+
id: `answer-${t.id}`,
|
|
391
|
+
icon: "ri:chat-check-line",
|
|
392
|
+
text: t.text,
|
|
393
|
+
open: () => A("open-answer-notice", t.id),
|
|
394
|
+
dismiss: () => A("dismiss-answer-notice", t.id)
|
|
395
|
+
});
|
|
396
|
+
return j.pageNotice && e.push({
|
|
397
|
+
id: "page",
|
|
398
|
+
icon: "ri:pages-line",
|
|
399
|
+
text: j.pageNotice,
|
|
400
|
+
dismiss: () => A("dismiss-page-notice")
|
|
401
|
+
}), j.dismissableNotice && dt.value && e.push({
|
|
402
|
+
id: "dismissable",
|
|
403
|
+
markdown: j.dismissableNotice,
|
|
404
|
+
dismiss: ft
|
|
405
|
+
}), e;
|
|
406
|
+
}), mt = () => {
|
|
407
|
+
L.value?.querySelector("button:focus-visible") && N.value?.focus();
|
|
408
|
+
}, ht = () => {
|
|
409
|
+
mt(), A("stop-generation");
|
|
410
|
+
}, gt = () => {
|
|
411
|
+
Ue.value && (mt(), H(), A("submit"), R.value = "", D.value = "", b(() => {
|
|
412
|
+
N.value && (N.value.value = "", I.update(N.value));
|
|
413
|
+
}));
|
|
414
|
+
}, _t = (e) => {
|
|
415
|
+
e.shiftKey || a(e) || (e.preventDefault(), gt());
|
|
416
|
+
}, vt = (e) => {
|
|
417
|
+
let t = J.value;
|
|
418
|
+
!t || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || a(e) || (e.preventDefault(), R.value = t, H(), b(() => {
|
|
419
|
+
N.value && (I.update(N.value), N.value.setSelectionRange(t.length, t.length));
|
|
420
|
+
}));
|
|
421
|
+
};
|
|
422
|
+
ae(() => {
|
|
423
|
+
N.value && I(N.value);
|
|
424
|
+
});
|
|
425
|
+
let yt = 0;
|
|
426
|
+
return ge(N, ([e]) => {
|
|
427
|
+
let t = e?.contentRect.width ?? 0;
|
|
428
|
+
N.value && t !== yt && (yt = t, I.update(N.value));
|
|
429
|
+
}), fe(() => J.value ?? j.placeholder, async () => {
|
|
430
|
+
await b(), N.value && I.update(N.value);
|
|
431
|
+
}), ie(() => {
|
|
432
|
+
V(), N.value && I.destroy(N.value);
|
|
433
|
+
for (let e of O.value) URL.revokeObjectURL(e.localUrl);
|
|
434
|
+
}), y({
|
|
435
|
+
focus: () => N.value?.focus(),
|
|
436
|
+
annotateImage: (e) => {
|
|
437
|
+
X.value = void 0, Q.value = e, $.value = !1;
|
|
438
|
+
}
|
|
439
|
+
}), (t, n) => {
|
|
440
|
+
let a = l, o = e, d = c, ee = s;
|
|
441
|
+
return x(), m("div", Ce, [
|
|
442
|
+
pt.value.length ? (x(), m("div", we, [(x(!0), m(u, null, se(pt.value, (e) => (x(), m("div", {
|
|
443
|
+
key: e.id,
|
|
444
|
+
class: "pk-chatbot-input__notice-item"
|
|
445
|
+
}, [
|
|
446
|
+
e.icon ? (x(), f(a, {
|
|
447
|
+
key: 0,
|
|
448
|
+
name: e.icon,
|
|
449
|
+
class: "pk-chatbot-input__notice-icon"
|
|
450
|
+
}, null, 8, ["name"])) : p("", !0),
|
|
451
|
+
e.markdown ? (x(), f(r, {
|
|
452
|
+
key: 1,
|
|
453
|
+
markdown: e.markdown,
|
|
454
|
+
class: "wysiwyg pk-chatbot-input__notice-text"
|
|
455
|
+
}, null, 8, ["markdown"])) : (x(), m("span", Te, C(e.text), 1)),
|
|
456
|
+
e.open ? (x(), f(o, {
|
|
457
|
+
key: 3,
|
|
458
|
+
label: w(M)("action.open"),
|
|
459
|
+
modifiers: "link",
|
|
460
|
+
class: "pk-chatbot-input__notice-action",
|
|
461
|
+
onClick: (t) => e.open()
|
|
462
|
+
}, null, 8, ["label", "onClick"])) : p("", !0),
|
|
463
|
+
e.dismiss ? (x(), f(o, {
|
|
464
|
+
key: 4,
|
|
465
|
+
title: w(M)("action.close"),
|
|
466
|
+
modifiers: "action-quiet",
|
|
467
|
+
icon: "ri:close-line",
|
|
468
|
+
class: "w-18 h-18",
|
|
469
|
+
onClick: (t) => e.dismiss()
|
|
470
|
+
}, null, 8, ["title", "onClick"])) : p("", !0)
|
|
471
|
+
]))), 128))])) : p("", !0),
|
|
472
|
+
h("form", {
|
|
473
|
+
ref_key: "formEl",
|
|
474
|
+
ref: L,
|
|
475
|
+
class: "pk-chatbot-input__form",
|
|
476
|
+
onSubmit: me(gt, ["prevent"])
|
|
477
|
+
}, [
|
|
478
|
+
v.automaticConfirmations ? (x(), m("button", {
|
|
479
|
+
key: 0,
|
|
480
|
+
type: "button",
|
|
481
|
+
class: "pk-chatbot-input__mode",
|
|
482
|
+
title: w(M)("action.manualConfirmations"),
|
|
483
|
+
onClick: n[0] ||= (e) => A("manual-confirmations")
|
|
484
|
+
}, [
|
|
485
|
+
_(a, {
|
|
486
|
+
name: "ri:flashlight-line",
|
|
487
|
+
class: "pk-chatbot-input__pointer-icon"
|
|
488
|
+
}),
|
|
489
|
+
g(" " + C(w(M)("label.automaticConfirmations")) + " ", 1),
|
|
490
|
+
_(a, {
|
|
491
|
+
name: "ri:close-line",
|
|
492
|
+
class: "pk-chatbot-input__pointer-icon"
|
|
493
|
+
})
|
|
494
|
+
], 8, Ee)) : p("", !0),
|
|
495
|
+
v.pointer ? (x(), m("div", De, [
|
|
496
|
+
_(a, {
|
|
497
|
+
name: v.pointer.kind === "text" ? "ri:double-quotes-l" : "ri:focus-3-line",
|
|
498
|
+
class: "pk-chatbot-input__pointer-icon"
|
|
499
|
+
}, null, 8, ["name"]),
|
|
500
|
+
h("span", Oe, C(v.pointer.kind === "text" ? `«${v.pointer.label}»` : v.pointer.label), 1),
|
|
501
|
+
_(o, {
|
|
502
|
+
title: w(M)("pagePointer.remove"),
|
|
503
|
+
modifiers: "action-quiet",
|
|
504
|
+
icon: "ri:close-line",
|
|
505
|
+
class: "w-18 h-18",
|
|
506
|
+
onClick: n[1] ||= (e) => A("remove-pointer")
|
|
507
|
+
}, null, 8, ["title"])
|
|
508
|
+
])) : p("", !0),
|
|
509
|
+
O.value.length ? (x(), m("div", ke, [(x(!0), m(u, null, se(O.value, (e) => (x(), f(i, {
|
|
510
|
+
key: e.id,
|
|
511
|
+
"media-type": e.mediaSource?.mimeType ?? e.file.type,
|
|
512
|
+
url: e.localUrl,
|
|
513
|
+
filename: e.file.name,
|
|
514
|
+
size: e.file.size,
|
|
515
|
+
loading: e.state === "uploading",
|
|
516
|
+
error: e.state === "error" ? e.error : void 0,
|
|
517
|
+
removable: e.state !== "uploading",
|
|
518
|
+
editable: st(e),
|
|
519
|
+
retryable: v.retryableAttachments && e.state === "error",
|
|
520
|
+
compact: "",
|
|
521
|
+
onRemove: (t) => at(e.id),
|
|
522
|
+
onEdit: (t) => X.value = e.id,
|
|
523
|
+
onRetry: (t) => A("retry-attachment", e)
|
|
524
|
+
}, null, 8, [
|
|
525
|
+
"media-type",
|
|
526
|
+
"url",
|
|
527
|
+
"filename",
|
|
528
|
+
"size",
|
|
529
|
+
"loading",
|
|
530
|
+
"error",
|
|
531
|
+
"removable",
|
|
532
|
+
"editable",
|
|
533
|
+
"retryable",
|
|
534
|
+
"onRemove",
|
|
535
|
+
"onEdit",
|
|
536
|
+
"onRetry"
|
|
537
|
+
]))), 128))])) : p("", !0),
|
|
538
|
+
h("div", Ae, [
|
|
539
|
+
ce(t.$slots, "prepend"),
|
|
540
|
+
v.fileUpload && v.fileUpload.enabled && (Ze.value || tt.value || t.$slots["additional-actions"]) ? (x(), f(ee, re(te({ key: 0 }, {
|
|
541
|
+
placement: "top-start",
|
|
542
|
+
modifiers: "menu",
|
|
543
|
+
flip: !0,
|
|
544
|
+
offset: 3
|
|
545
|
+
})), {
|
|
546
|
+
default: E(({ init: e, toggle: t, aria: n }) => [h("button", te({ ref: (t) => e(t) }, n, {
|
|
547
|
+
class: "pk-chat-button",
|
|
548
|
+
type: "button",
|
|
549
|
+
title: w(M)("action.attachFile"),
|
|
550
|
+
disabled: G.value,
|
|
551
|
+
onClick: t
|
|
552
|
+
}), [_(a, {
|
|
553
|
+
name: "ri:add-line",
|
|
554
|
+
class: "pk-chat-button__icon"
|
|
555
|
+
})], 16, je)]),
|
|
556
|
+
items: E(() => [
|
|
557
|
+
Ze.value ? (x(), f(d, {
|
|
558
|
+
key: 0,
|
|
559
|
+
disabled: G.value || v.attachmentLimitReached,
|
|
560
|
+
onClick: $e
|
|
561
|
+
}, {
|
|
562
|
+
default: E(() => [_(a, {
|
|
563
|
+
name: "ri:camera-line",
|
|
564
|
+
class: "pk-chatbot-input__dropdown-icon"
|
|
565
|
+
}), g(" " + C(w(M)("action.takePhoto")), 1)]),
|
|
566
|
+
_: 1
|
|
567
|
+
}, 8, ["disabled"])) : p("", !0),
|
|
568
|
+
tt.value ? (x(), f(d, {
|
|
569
|
+
key: 1,
|
|
570
|
+
disabled: G.value || v.attachmentLimitReached,
|
|
571
|
+
onClick: lt
|
|
572
|
+
}, {
|
|
573
|
+
default: E(() => [_(a, {
|
|
574
|
+
name: "ri:screenshot-2-line",
|
|
575
|
+
class: "pk-chatbot-input__dropdown-icon"
|
|
576
|
+
}), g(" " + C(w(M)("action.attachScreenshot")), 1)]),
|
|
577
|
+
_: 1
|
|
578
|
+
}, 8, ["disabled"])) : p("", !0),
|
|
579
|
+
_(d, {
|
|
580
|
+
disabled: G.value || v.attachmentLimitReached,
|
|
581
|
+
onClick: Qe
|
|
582
|
+
}, {
|
|
583
|
+
default: E(() => [_(a, {
|
|
584
|
+
name: "ri:attachment-line",
|
|
585
|
+
class: "pk-chatbot-input__dropdown-icon"
|
|
586
|
+
}), g(" " + C(w(M)("action.attachFile")), 1)]),
|
|
587
|
+
_: 1
|
|
588
|
+
}, 8, ["disabled"]),
|
|
589
|
+
ce(t.$slots, "additional-actions")
|
|
590
|
+
]),
|
|
591
|
+
_: 3
|
|
592
|
+
}, 16)) : v.fileUpload && v.fileUpload.enabled ? (x(), f(z, {
|
|
593
|
+
key: 1,
|
|
594
|
+
icon: "ri:add-line",
|
|
595
|
+
title: w(M)("action.attachFile"),
|
|
596
|
+
disabled: G.value || v.attachmentLimitReached,
|
|
597
|
+
onClick: Qe
|
|
598
|
+
}, null, 8, ["title", "disabled"])) : p("", !0),
|
|
599
|
+
v.fileUpload && v.fileUpload.enabled ? (x(), m("input", {
|
|
600
|
+
key: 2,
|
|
601
|
+
ref_key: "fileInputEl",
|
|
602
|
+
ref: P,
|
|
603
|
+
type: "file",
|
|
604
|
+
hidden: "",
|
|
605
|
+
multiple: "",
|
|
606
|
+
accept: Ye.value,
|
|
607
|
+
onChange: rt
|
|
608
|
+
}, null, 40, Me)) : p("", !0),
|
|
609
|
+
v.fileUpload && v.fileUpload.enabled && Ze.value ? (x(), m("input", {
|
|
610
|
+
key: 3,
|
|
611
|
+
ref_key: "cameraInputEl",
|
|
612
|
+
ref: F,
|
|
613
|
+
type: "file",
|
|
614
|
+
capture: "environment",
|
|
615
|
+
hidden: "",
|
|
616
|
+
accept: Xe.value,
|
|
617
|
+
onChange: rt
|
|
618
|
+
}, null, 40, Ne)) : p("", !0),
|
|
619
|
+
v.pointerAvailable ? (x(), f(z, {
|
|
620
|
+
key: 4,
|
|
621
|
+
icon: "ri:focus-3-line",
|
|
622
|
+
title: w(M)("pagePointer.start"),
|
|
623
|
+
"aria-pressed": v.pointing,
|
|
624
|
+
disabled: G.value,
|
|
625
|
+
onClick: n[2] ||= (e) => A("point")
|
|
626
|
+
}, null, 8, [
|
|
627
|
+
"title",
|
|
628
|
+
"aria-pressed",
|
|
629
|
+
"disabled"
|
|
630
|
+
])) : p("", !0),
|
|
631
|
+
h("div", Pe, [h("textarea", {
|
|
632
|
+
ref_key: "textareaEl",
|
|
633
|
+
ref: N,
|
|
634
|
+
value: R.value,
|
|
635
|
+
class: "pk-chatbot-input__textarea",
|
|
636
|
+
name: "message",
|
|
637
|
+
rows: "1",
|
|
638
|
+
enterkeyhint: "send",
|
|
639
|
+
"aria-label": w(M)("label.message"),
|
|
640
|
+
"aria-describedby": qe.value,
|
|
641
|
+
"aria-invalid": Be.value || void 0,
|
|
642
|
+
placeholder: J.value ?? v.placeholder,
|
|
643
|
+
onInput: be,
|
|
644
|
+
onKeydown: [pe(_t, ["enter"]), pe(vt, ["tab"])],
|
|
645
|
+
onPaste: it
|
|
646
|
+
}, null, 40, Fe)]),
|
|
647
|
+
J.value ? (x(), m("span", Ie, [n[4] ||= h("kbd", { "aria-hidden": "true" }, "Tab", -1), h("span", {
|
|
648
|
+
id: w(Ke),
|
|
649
|
+
class: "u-visually-hidden"
|
|
650
|
+
}, C(w(M)("hint.suggestedNextMessage")), 9, Le)])) : p("", !0),
|
|
651
|
+
v.maxMessageLength ? (x(), m("div", {
|
|
652
|
+
key: 6,
|
|
653
|
+
id: w(K),
|
|
654
|
+
class: ne(["pk-chatbot-input__counter", { "pk-chatbot-input__counter--over": Be.value }])
|
|
655
|
+
}, [g(C(t.$n(q.value, "integer")) + "/", 1), h("span", ze, C(t.$n(v.maxMessageLength, "integer")), 1)], 10, Re)) : p("", !0),
|
|
656
|
+
v.voiceEnabled && !U.value ? (x(), f(z, {
|
|
657
|
+
key: 7,
|
|
658
|
+
icon: "ri:mic-line",
|
|
659
|
+
title: w(M)("action.talk"),
|
|
660
|
+
disabled: G.value,
|
|
661
|
+
onClick: n[3] ||= (e) => A("voice-start")
|
|
662
|
+
}, null, 8, ["title", "disabled"])) : p("", !0),
|
|
663
|
+
U.value ? (x(), f(z, {
|
|
664
|
+
key: 8,
|
|
665
|
+
icon: "ri:stop-fill",
|
|
666
|
+
modifiers: We.value ? void 0 : "primary",
|
|
667
|
+
title: w(M)("action.stop"),
|
|
668
|
+
onClick: ht
|
|
669
|
+
}, null, 8, ["modifiers", "title"])) : p("", !0),
|
|
670
|
+
We.value ? (x(), f(z, {
|
|
671
|
+
key: 9,
|
|
672
|
+
type: "submit",
|
|
673
|
+
modifiers: "primary",
|
|
674
|
+
icon: "ri:arrow-up-line",
|
|
675
|
+
title: w(M)("action.queueMessage")
|
|
676
|
+
}, null, 8, ["title"])) : U.value ? p("", !0) : (x(), f(z, {
|
|
677
|
+
key: 10,
|
|
678
|
+
type: "submit",
|
|
679
|
+
modifiers: "primary",
|
|
680
|
+
icon: W.value ? "loading-loop" : "ri:arrow-up-line",
|
|
681
|
+
title: w(M)("action.submit"),
|
|
682
|
+
disabled: !Ue.value
|
|
683
|
+
}, null, 8, [
|
|
684
|
+
"icon",
|
|
685
|
+
"title",
|
|
686
|
+
"disabled"
|
|
687
|
+
]))
|
|
688
|
+
])
|
|
689
|
+
], 544),
|
|
690
|
+
ot.value ? (x(), f(w(_e), {
|
|
691
|
+
key: Z.value?.id ?? "annotating",
|
|
692
|
+
file: ot.value,
|
|
693
|
+
"initial-tool": Z.value ? void 0 : "arrow",
|
|
694
|
+
"keep-unchanged": $.value,
|
|
695
|
+
onApply: ut,
|
|
696
|
+
onClose: ct
|
|
697
|
+
}, null, 8, [
|
|
698
|
+
"file",
|
|
699
|
+
"initial-tool",
|
|
700
|
+
"keep-unchanged"
|
|
701
|
+
])) : p("", !0)
|
|
702
|
+
]);
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
export { j as i, z as n, k as r, q as t };
|
|
707
|
+
|
|
708
|
+
//# sourceMappingURL=PkChatbotInput-CunAf5Rq.js.map
|