@8wave/ai-elements 0.127.0-beta.1 → 0.127.0-beta.2
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-DytagI8S.js → Agent-nB9V45mr.js} +354 -276
- package/dist/_chunks/Agent-nB9V45mr.js.map +1 -0
- package/dist/_chunks/{Document-BdWEd1tb.js → Document-Dm5GM40t.js} +7 -7
- package/dist/_chunks/{Document-BdWEd1tb.js.map → Document-Dm5GM40t.js.map} +1 -1
- package/dist/_chunks/{PkFilePreview-C3BxAdui.js → PkFilePreview-qTCDbut0.js} +3 -3
- package/dist/_chunks/{PkFilePreview-C3BxAdui.js.map → PkFilePreview-qTCDbut0.js.map} +1 -1
- package/dist/_chunks/{PkFilePreviewDialog-WAm7QSvT.js → PkFilePreviewDialog-m5d4zZDi.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-WAm7QSvT.js.map → PkFilePreviewDialog-m5d4zZDi.js.map} +1 -1
- package/dist/_chunks/{PkImageEditorDialog-DM-d0hCD.js → PkImageEditorDialog-aekpEqWD.js} +2 -2
- package/dist/_chunks/{PkImageEditorDialog-DM-d0hCD.js.map → PkImageEditorDialog-aekpEqWD.js.map} +1 -1
- package/dist/_chunks/{PkSelectionActions-Bl1KbGOj.js → PkSelectionActions-DDhRX6cs.js} +2 -2
- package/dist/_chunks/{PkSelectionActions-Bl1KbGOj.js.map → PkSelectionActions-DDhRX6cs.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-CU1ZUUCf.js → PkStreamingMarkdown-5WfFCjFv.js} +3 -3
- package/dist/_chunks/{PkStreamingMarkdown-CU1ZUUCf.js.map → PkStreamingMarkdown-5WfFCjFv.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-B-Y47Q_K.js → PkToolChatFile-C3B9q2OL.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-B-Y47Q_K.js.map → PkToolChatFile-C3B9q2OL.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-B41xrF8k.js → PkToolRequestGeolocation-D4pYnCW5.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-B41xrF8k.js.map → PkToolRequestGeolocation-D4pYnCW5.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-BuCGuHwd.js → PkToolRequestOAuthConnection-DnnRY2rt.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-BuCGuHwd.js.map → PkToolRequestOAuthConnection-DnnRY2rt.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-Bjm6uhOK.js → PkToolShowArtifact-DQln7TsF.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-Bjm6uhOK.js.map → PkToolShowArtifact-DQln7TsF.js.map} +1 -1
- package/dist/_chunks/{PkToolShowChart-B6TKQ3aT.js → PkToolShowChart-DfDB9BeZ.js} +2 -2
- package/dist/_chunks/{PkToolShowChart-B6TKQ3aT.js.map → PkToolShowChart-DfDB9BeZ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-5tg4xbrh.js → PkToolShowContactForm-Dkb8AiqL.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-5tg4xbrh.js.map → PkToolShowContactForm-Dkb8AiqL.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-CiNtS-vX.js → PkToolShowDiagram-B2dBogUW.js} +2 -2
- package/dist/_chunks/{PkToolShowDiagram-CiNtS-vX.js.map → PkToolShowDiagram-B2dBogUW.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-eh8mXr6u.js → PkToolShowForm-CtDcwJs4.js} +4 -4
- package/dist/_chunks/{PkToolShowForm-eh8mXr6u.js.map → PkToolShowForm-CtDcwJs4.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-DedpXD-b.js → PkToolShowImageGallery-dLMI3SM7.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-DedpXD-b.js.map → PkToolShowImageGallery-dLMI3SM7.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-D24EIc4v.js → PkToolShowProductList-DE6BEdr_.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-D24EIc4v.js.map → PkToolShowProductList-DE6BEdr_.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-Dnw1x7dT.js → PkToolShowSources-vSr080EU.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-Dnw1x7dT.js.map → PkToolShowSources-vSr080EU.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-CxNx1Uf6.js → PkToolShowSuggestedReply-HuKn3loC.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-CxNx1Uf6.js.map → PkToolShowSuggestedReply-HuKn3loC.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-CDcJiprr.js → PkToolShowVideo-BL-9CiYe.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-CDcJiprr.js.map → PkToolShowVideo-BL-9CiYe.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-UXqb0XEJ.js → PkToolShowWebPages-DQfODZdD.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-UXqb0XEJ.js.map → PkToolShowWebPages-DQfODZdD.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-DJAB0Bgw.js → chatImagePolicy-Cj5lkTVq.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-DJAB0Bgw.js.map → chatImagePolicy-Cj5lkTVq.js.map} +1 -1
- package/dist/_chunks/text-CCurUhdH.js +13 -0
- package/dist/_chunks/text-CCurUhdH.js.map +1 -0
- package/dist/_chunks/{utils-78zQeKDO.js → utils-CRy3kzE3.js} +458 -160
- package/dist/_chunks/utils-CRy3kzE3.js.map +1 -0
- package/dist/ai-elements.es.js +5971 -5636
- 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/PkChatbotLocalFolders.d.ts +2 -0
- package/dist-vue/PkChatbotLocalFolders.js +1 -0
- 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-Da4XChe8.js → Agent-DKefaJeG.js} +445 -377
- package/dist-vue/_chunks/Agent-DKefaJeG.js.map +1 -0
- package/dist-vue/_chunks/{Document-CsQsUQYa.js → Document-B49E_gxT.js} +18 -18
- package/dist-vue/_chunks/{Document-CsQsUQYa.js.map → Document-B49E_gxT.js.map} +1 -1
- package/dist-vue/_chunks/{Media-CMiWEpdQ.js → Media-DtudATme.js} +12 -2
- package/dist-vue/_chunks/Media-DtudATme.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbot-CITKd3qD.js → PkChatbot-8Fqlhwq5.js} +10 -9
- package/dist-vue/_chunks/PkChatbot-8Fqlhwq5.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotAuth-SfTyFbq1.js → PkChatbotAuth-CIK2CFy-.js} +8 -8
- package/dist-vue/_chunks/{PkChatbotAuth-SfTyFbq1.js.map → PkChatbotAuth-CIK2CFy-.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-DI_8T5a4.js → PkChatbotEmptyState-C_htXOSW.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-DI_8T5a4.js.map → PkChatbotEmptyState-C_htXOSW.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotInput-CJ5lPtpH.js +658 -0
- package/dist-vue/_chunks/PkChatbotInput-CJ5lPtpH.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotLocalFolders-CSvqh_Cx.js +126 -0
- package/dist-vue/_chunks/PkChatbotLocalFolders-CSvqh_Cx.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotMessages-BWdINCAX.js → PkChatbotMessages-DY8r4UKe.js} +49 -49
- package/dist-vue/_chunks/{PkChatbotMessages-BWdINCAX.js.map → PkChatbotMessages-DY8r4UKe.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-CTwsRpkv.js → PkChatbotStepPayload-BLjH1pkP.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-CTwsRpkv.js.map → PkChatbotStepPayload-BLjH1pkP.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-C9xeMg-k.js → PkChatbotStepToolDetail-wIZmkvr-.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-C9xeMg-k.js.map → PkChatbotStepToolDetail-wIZmkvr-.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-DsubpIKa.js → PkChatbotSteps-DG09GyCb.js} +7 -7
- package/dist-vue/_chunks/{PkChatbotSteps-DsubpIKa.js.map → PkChatbotSteps-DG09GyCb.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-DW1a9ZNl.js → PkChatbotViewChat-DTKfW1kr.js} +684 -666
- package/dist-vue/_chunks/PkChatbotViewChat-DTKfW1kr.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-DdniYy1b.js → PkChatbotViewConversations-NA_PCvZR.js} +4 -4
- package/dist-vue/_chunks/{PkChatbotViewConversations-DdniYy1b.js.map → PkChatbotViewConversations-NA_PCvZR.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-CMoromsf.js → PkChatbotViewFiles-D8_Khdu2.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-CMoromsf.js.map → PkChatbotViewFiles-D8_Khdu2.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-BT7I3GhB.js → PkChatbotViewProfile-iTBiQVsZ.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-BT7I3GhB.js.map → PkChatbotViewProfile-iTBiQVsZ.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-Dxp-U8QU.js → PkFilePreview-sSb1Mmr2.js} +4 -4
- package/dist-vue/_chunks/{PkFilePreview-Dxp-U8QU.js.map → PkFilePreview-sSb1Mmr2.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-BE-NpN18.js → PkFilePreviewDialog-DquXMRJD.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-BE-NpN18.js.map → PkFilePreviewDialog-DquXMRJD.js.map} +1 -1
- package/dist-vue/_chunks/{PkImageEditorDialog-BiuOD6Hr.js → PkImageEditorDialog-CrjpCier.js} +2 -2
- package/dist-vue/_chunks/{PkImageEditorDialog-BiuOD6Hr.js.map → PkImageEditorDialog-CrjpCier.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-DMmt35Mq.js → PkStreamingMarkdown-CgKFdzCI.js} +23 -23
- package/dist-vue/_chunks/{PkStreamingMarkdown-DMmt35Mq.js.map → PkStreamingMarkdown-CgKFdzCI.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-BdNron14.js → PkToolChatFile-IEQxfzjM.js} +3 -3
- package/dist-vue/_chunks/{PkToolChatFile-BdNron14.js.map → PkToolChatFile-IEQxfzjM.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DeI7kLlR.js → PkToolRequestGeolocation-BmrbMPke.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DeI7kLlR.js.map → PkToolRequestGeolocation-BmrbMPke.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C0lE3Qbk.js → PkToolRequestOAuthConnection-yKgXyOUN.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C0lE3Qbk.js.map → PkToolRequestOAuthConnection-yKgXyOUN.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-C0Gb-LW2.js → PkToolShowArtifact-CF90yFCe.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-C0Gb-LW2.js.map → PkToolShowArtifact-CF90yFCe.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowChart-oJmzU10F.js → PkToolShowChart-CDR8ag4q.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowChart-oJmzU10F.js.map → PkToolShowChart-CDR8ag4q.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-D4IAna-K.js → PkToolShowContactForm-DAdKUU4X.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-D4IAna-K.js.map → PkToolShowContactForm-DAdKUU4X.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-ClGpv5Cr.js → PkToolShowDiagram-Do20AvFb.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-ClGpv5Cr.js.map → PkToolShowDiagram-Do20AvFb.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-ByfNodNh.js → PkToolShowForm-DfFmPOt6.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-ByfNodNh.js.map → PkToolShowForm-DfFmPOt6.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-DJ9JNDWK.js → PkToolShowImageGallery-DA6KW2g_.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-DJ9JNDWK.js.map → PkToolShowImageGallery-DA6KW2g_.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-CcFseg28.js → PkToolShowProductList-FcDDabPI.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-CcFseg28.js.map → PkToolShowProductList-FcDDabPI.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-DznWqWK3.js → PkToolShowSources-afCYBONq.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-DznWqWK3.js.map → PkToolShowSources-afCYBONq.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-BZqnfpwO.js → PkToolShowSuggestedReply-C863wgtU.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-BZqnfpwO.js.map → PkToolShowSuggestedReply-C863wgtU.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-niwkzqTN.js → PkToolShowVideo-kUiwxRlz.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-niwkzqTN.js.map → PkToolShowVideo-kUiwxRlz.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-BsMVJ6c7.js → PkToolShowWebPages-Dw9D1__u.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-BsMVJ6c7.js.map → PkToolShowWebPages-Dw9D1__u.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-Cd_2UI_O.js → createChatbotApiClient-DzrHp52e.js} +66 -65
- package/dist-vue/_chunks/createChatbotApiClient-DzrHp52e.js.map +1 -0
- package/dist-vue/_chunks/localFolders-ChZp8dLu.js +353 -0
- package/dist-vue/_chunks/localFolders-ChZp8dLu.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-Dir9Rc7K.js → useChatbotStore-DZlc7dzK.js} +1289 -1152
- package/dist-vue/_chunks/useChatbotStore-DZlc7dzK.js.map +1 -0
- package/dist-vue/_chunks/useSettledSelection-1bfM1fzx.js +55 -0
- package/dist-vue/_chunks/useSettledSelection-1bfM1fzx.js.map +1 -0
- package/dist-vue/_chunks/{utils-CibsowVe.js → utils-CY0jFRnG.js} +126 -107
- package/dist-vue/_chunks/utils-CY0jFRnG.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +6 -0
- package/dist-vue/composables.js +62 -10
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +4100 -4086
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +32 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +6 -2
- package/dist-vue/packages/components/src/chat/PkChatbot.d.ts +7 -1
- package/dist-vue/packages/components/src/chat/PkChatbotLocalFolders.d.ts +31 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +3 -2
- package/dist-vue/packages/composable/src/chatbot/hostTools.d.ts +1 -1
- package/dist-vue/packages/composable/src/chatbot/index.d.ts +1 -0
- package/dist-vue/packages/composable/src/chatbot/localFolders.d.ts +137 -0
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +46 -3
- package/dist-vue/packages/models/src/schema/Agent.d.ts +24 -0
- package/dist-vue/packages/models/src/schema/Chat.d.ts +1 -0
- package/dist-vue/packages/models/src/schema/HostTool.d.ts +5 -2
- package/dist-vue/packages/models/src/schema/LocalFolder.d.ts +78 -0
- package/dist-vue/packages/models/src/schema/Organization.d.ts +10 -0
- package/dist-vue/packages/models/src/schema/PageAccess.d.ts +4 -1
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +8 -0
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +8 -0
- package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-DytagI8S.js.map +0 -1
- package/dist/_chunks/text-5F7L8EHi.js +0 -5
- package/dist/_chunks/text-5F7L8EHi.js.map +0 -1
- package/dist/_chunks/utils-78zQeKDO.js.map +0 -1
- package/dist-vue/_chunks/Agent-Da4XChe8.js.map +0 -1
- package/dist-vue/_chunks/Media-CMiWEpdQ.js.map +0 -1
- package/dist-vue/_chunks/PkChatbot-CITKd3qD.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-UqcSEi8l.js +0 -708
- package/dist-vue/_chunks/PkChatbotInput-UqcSEi8l.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-DW1a9ZNl.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-Cd_2UI_O.js.map +0 -1
- package/dist-vue/_chunks/message-DuibQyHy.js +0 -61
- package/dist-vue/_chunks/message-DuibQyHy.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-Dir9Rc7K.js.map +0 -1
- package/dist-vue/_chunks/utils-CibsowVe.js.map +0 -1
|
@@ -1,708 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./VvButtonLocalized-C-vx25u4.js";
|
|
2
|
-
import { c as t, s as n } from "./Media-CMiWEpdQ.js";
|
|
3
|
-
import { t as r } from "./PkStreamingMarkdown-DMmt35Mq.js";
|
|
4
|
-
import { t as i } from "./PkChatbotFilePreview-BbytSmUB.js";
|
|
5
|
-
import { j as a, k as o } from "./utils-CibsowVe.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-BiuOD6Hr.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-UqcSEi8l.js.map
|