@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.
Files changed (183) hide show
  1. package/dist/_chunks/{Agent-DytagI8S.js → Agent-nB9V45mr.js} +354 -276
  2. package/dist/_chunks/Agent-nB9V45mr.js.map +1 -0
  3. package/dist/_chunks/{Document-BdWEd1tb.js → Document-Dm5GM40t.js} +7 -7
  4. package/dist/_chunks/{Document-BdWEd1tb.js.map → Document-Dm5GM40t.js.map} +1 -1
  5. package/dist/_chunks/{PkFilePreview-C3BxAdui.js → PkFilePreview-qTCDbut0.js} +3 -3
  6. package/dist/_chunks/{PkFilePreview-C3BxAdui.js.map → PkFilePreview-qTCDbut0.js.map} +1 -1
  7. package/dist/_chunks/{PkFilePreviewDialog-WAm7QSvT.js → PkFilePreviewDialog-m5d4zZDi.js} +2 -2
  8. package/dist/_chunks/{PkFilePreviewDialog-WAm7QSvT.js.map → PkFilePreviewDialog-m5d4zZDi.js.map} +1 -1
  9. package/dist/_chunks/{PkImageEditorDialog-DM-d0hCD.js → PkImageEditorDialog-aekpEqWD.js} +2 -2
  10. package/dist/_chunks/{PkImageEditorDialog-DM-d0hCD.js.map → PkImageEditorDialog-aekpEqWD.js.map} +1 -1
  11. package/dist/_chunks/{PkSelectionActions-Bl1KbGOj.js → PkSelectionActions-DDhRX6cs.js} +2 -2
  12. package/dist/_chunks/{PkSelectionActions-Bl1KbGOj.js.map → PkSelectionActions-DDhRX6cs.js.map} +1 -1
  13. package/dist/_chunks/{PkStreamingMarkdown-CU1ZUUCf.js → PkStreamingMarkdown-5WfFCjFv.js} +3 -3
  14. package/dist/_chunks/{PkStreamingMarkdown-CU1ZUUCf.js.map → PkStreamingMarkdown-5WfFCjFv.js.map} +1 -1
  15. package/dist/_chunks/{PkToolChatFile-B-Y47Q_K.js → PkToolChatFile-C3B9q2OL.js} +3 -3
  16. package/dist/_chunks/{PkToolChatFile-B-Y47Q_K.js.map → PkToolChatFile-C3B9q2OL.js.map} +1 -1
  17. package/dist/_chunks/{PkToolRequestGeolocation-B41xrF8k.js → PkToolRequestGeolocation-D4pYnCW5.js} +2 -2
  18. package/dist/_chunks/{PkToolRequestGeolocation-B41xrF8k.js.map → PkToolRequestGeolocation-D4pYnCW5.js.map} +1 -1
  19. package/dist/_chunks/{PkToolRequestOAuthConnection-BuCGuHwd.js → PkToolRequestOAuthConnection-DnnRY2rt.js} +2 -2
  20. package/dist/_chunks/{PkToolRequestOAuthConnection-BuCGuHwd.js.map → PkToolRequestOAuthConnection-DnnRY2rt.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowArtifact-Bjm6uhOK.js → PkToolShowArtifact-DQln7TsF.js} +2 -2
  22. package/dist/_chunks/{PkToolShowArtifact-Bjm6uhOK.js.map → PkToolShowArtifact-DQln7TsF.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowChart-B6TKQ3aT.js → PkToolShowChart-DfDB9BeZ.js} +2 -2
  24. package/dist/_chunks/{PkToolShowChart-B6TKQ3aT.js.map → PkToolShowChart-DfDB9BeZ.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowContactForm-5tg4xbrh.js → PkToolShowContactForm-Dkb8AiqL.js} +2 -2
  26. package/dist/_chunks/{PkToolShowContactForm-5tg4xbrh.js.map → PkToolShowContactForm-Dkb8AiqL.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowDiagram-CiNtS-vX.js → PkToolShowDiagram-B2dBogUW.js} +2 -2
  28. package/dist/_chunks/{PkToolShowDiagram-CiNtS-vX.js.map → PkToolShowDiagram-B2dBogUW.js.map} +1 -1
  29. package/dist/_chunks/{PkToolShowForm-eh8mXr6u.js → PkToolShowForm-CtDcwJs4.js} +4 -4
  30. package/dist/_chunks/{PkToolShowForm-eh8mXr6u.js.map → PkToolShowForm-CtDcwJs4.js.map} +1 -1
  31. package/dist/_chunks/{PkToolShowImageGallery-DedpXD-b.js → PkToolShowImageGallery-dLMI3SM7.js} +2 -2
  32. package/dist/_chunks/{PkToolShowImageGallery-DedpXD-b.js.map → PkToolShowImageGallery-dLMI3SM7.js.map} +1 -1
  33. package/dist/_chunks/{PkToolShowProductList-D24EIc4v.js → PkToolShowProductList-DE6BEdr_.js} +2 -2
  34. package/dist/_chunks/{PkToolShowProductList-D24EIc4v.js.map → PkToolShowProductList-DE6BEdr_.js.map} +1 -1
  35. package/dist/_chunks/{PkToolShowSources-Dnw1x7dT.js → PkToolShowSources-vSr080EU.js} +3 -3
  36. package/dist/_chunks/{PkToolShowSources-Dnw1x7dT.js.map → PkToolShowSources-vSr080EU.js.map} +1 -1
  37. package/dist/_chunks/{PkToolShowSuggestedReply-CxNx1Uf6.js → PkToolShowSuggestedReply-HuKn3loC.js} +2 -2
  38. package/dist/_chunks/{PkToolShowSuggestedReply-CxNx1Uf6.js.map → PkToolShowSuggestedReply-HuKn3loC.js.map} +1 -1
  39. package/dist/_chunks/{PkToolShowVideo-CDcJiprr.js → PkToolShowVideo-BL-9CiYe.js} +2 -2
  40. package/dist/_chunks/{PkToolShowVideo-CDcJiprr.js.map → PkToolShowVideo-BL-9CiYe.js.map} +1 -1
  41. package/dist/_chunks/{PkToolShowWebPages-UXqb0XEJ.js → PkToolShowWebPages-DQfODZdD.js} +2 -2
  42. package/dist/_chunks/{PkToolShowWebPages-UXqb0XEJ.js.map → PkToolShowWebPages-DQfODZdD.js.map} +1 -1
  43. package/dist/_chunks/{chatImagePolicy-DJAB0Bgw.js → chatImagePolicy-Cj5lkTVq.js} +2 -2
  44. package/dist/_chunks/{chatImagePolicy-DJAB0Bgw.js.map → chatImagePolicy-Cj5lkTVq.js.map} +1 -1
  45. package/dist/_chunks/text-CCurUhdH.js +13 -0
  46. package/dist/_chunks/text-CCurUhdH.js.map +1 -0
  47. package/dist/_chunks/{utils-78zQeKDO.js → utils-CRy3kzE3.js} +458 -160
  48. package/dist/_chunks/utils-CRy3kzE3.js.map +1 -0
  49. package/dist/ai-elements.es.js +5971 -5636
  50. package/dist/ai-elements.es.js.map +1 -1
  51. package/dist-vue/PkChatbot.js +1 -1
  52. package/dist-vue/PkChatbotAuth.js +1 -1
  53. package/dist-vue/PkChatbotEmptyState.js +1 -1
  54. package/dist-vue/PkChatbotInput.js +1 -1
  55. package/dist-vue/PkChatbotLocalFolders.d.ts +2 -0
  56. package/dist-vue/PkChatbotLocalFolders.js +1 -0
  57. package/dist-vue/PkChatbotMessages.js +1 -1
  58. package/dist-vue/PkChatbotStepPayload.js +1 -1
  59. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  60. package/dist-vue/PkChatbotSteps.js +1 -1
  61. package/dist-vue/PkChatbotViewChat.js +1 -1
  62. package/dist-vue/PkChatbotViewConversations.js +1 -1
  63. package/dist-vue/PkChatbotViewFiles.js +1 -1
  64. package/dist-vue/PkChatbotViewProfile.js +1 -1
  65. package/dist-vue/_chunks/{Agent-Da4XChe8.js → Agent-DKefaJeG.js} +445 -377
  66. package/dist-vue/_chunks/Agent-DKefaJeG.js.map +1 -0
  67. package/dist-vue/_chunks/{Document-CsQsUQYa.js → Document-B49E_gxT.js} +18 -18
  68. package/dist-vue/_chunks/{Document-CsQsUQYa.js.map → Document-B49E_gxT.js.map} +1 -1
  69. package/dist-vue/_chunks/{Media-CMiWEpdQ.js → Media-DtudATme.js} +12 -2
  70. package/dist-vue/_chunks/Media-DtudATme.js.map +1 -0
  71. package/dist-vue/_chunks/{PkChatbot-CITKd3qD.js → PkChatbot-8Fqlhwq5.js} +10 -9
  72. package/dist-vue/_chunks/PkChatbot-8Fqlhwq5.js.map +1 -0
  73. package/dist-vue/_chunks/{PkChatbotAuth-SfTyFbq1.js → PkChatbotAuth-CIK2CFy-.js} +8 -8
  74. package/dist-vue/_chunks/{PkChatbotAuth-SfTyFbq1.js.map → PkChatbotAuth-CIK2CFy-.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkChatbotEmptyState-DI_8T5a4.js → PkChatbotEmptyState-C_htXOSW.js} +2 -2
  76. package/dist-vue/_chunks/{PkChatbotEmptyState-DI_8T5a4.js.map → PkChatbotEmptyState-C_htXOSW.js.map} +1 -1
  77. package/dist-vue/_chunks/PkChatbotInput-CJ5lPtpH.js +658 -0
  78. package/dist-vue/_chunks/PkChatbotInput-CJ5lPtpH.js.map +1 -0
  79. package/dist-vue/_chunks/PkChatbotLocalFolders-CSvqh_Cx.js +126 -0
  80. package/dist-vue/_chunks/PkChatbotLocalFolders-CSvqh_Cx.js.map +1 -0
  81. package/dist-vue/_chunks/{PkChatbotMessages-BWdINCAX.js → PkChatbotMessages-DY8r4UKe.js} +49 -49
  82. package/dist-vue/_chunks/{PkChatbotMessages-BWdINCAX.js.map → PkChatbotMessages-DY8r4UKe.js.map} +1 -1
  83. package/dist-vue/_chunks/{PkChatbotStepPayload-CTwsRpkv.js → PkChatbotStepPayload-BLjH1pkP.js} +2 -2
  84. package/dist-vue/_chunks/{PkChatbotStepPayload-CTwsRpkv.js.map → PkChatbotStepPayload-BLjH1pkP.js.map} +1 -1
  85. package/dist-vue/_chunks/{PkChatbotStepToolDetail-C9xeMg-k.js → PkChatbotStepToolDetail-wIZmkvr-.js} +3 -3
  86. package/dist-vue/_chunks/{PkChatbotStepToolDetail-C9xeMg-k.js.map → PkChatbotStepToolDetail-wIZmkvr-.js.map} +1 -1
  87. package/dist-vue/_chunks/{PkChatbotSteps-DsubpIKa.js → PkChatbotSteps-DG09GyCb.js} +7 -7
  88. package/dist-vue/_chunks/{PkChatbotSteps-DsubpIKa.js.map → PkChatbotSteps-DG09GyCb.js.map} +1 -1
  89. package/dist-vue/_chunks/{PkChatbotViewChat-DW1a9ZNl.js → PkChatbotViewChat-DTKfW1kr.js} +684 -666
  90. package/dist-vue/_chunks/PkChatbotViewChat-DTKfW1kr.js.map +1 -0
  91. package/dist-vue/_chunks/{PkChatbotViewConversations-DdniYy1b.js → PkChatbotViewConversations-NA_PCvZR.js} +4 -4
  92. package/dist-vue/_chunks/{PkChatbotViewConversations-DdniYy1b.js.map → PkChatbotViewConversations-NA_PCvZR.js.map} +1 -1
  93. package/dist-vue/_chunks/{PkChatbotViewFiles-CMoromsf.js → PkChatbotViewFiles-D8_Khdu2.js} +3 -3
  94. package/dist-vue/_chunks/{PkChatbotViewFiles-CMoromsf.js.map → PkChatbotViewFiles-D8_Khdu2.js.map} +1 -1
  95. package/dist-vue/_chunks/{PkChatbotViewProfile-BT7I3GhB.js → PkChatbotViewProfile-iTBiQVsZ.js} +2 -2
  96. package/dist-vue/_chunks/{PkChatbotViewProfile-BT7I3GhB.js.map → PkChatbotViewProfile-iTBiQVsZ.js.map} +1 -1
  97. package/dist-vue/_chunks/{PkFilePreview-Dxp-U8QU.js → PkFilePreview-sSb1Mmr2.js} +4 -4
  98. package/dist-vue/_chunks/{PkFilePreview-Dxp-U8QU.js.map → PkFilePreview-sSb1Mmr2.js.map} +1 -1
  99. package/dist-vue/_chunks/{PkFilePreviewDialog-BE-NpN18.js → PkFilePreviewDialog-DquXMRJD.js} +2 -2
  100. package/dist-vue/_chunks/{PkFilePreviewDialog-BE-NpN18.js.map → PkFilePreviewDialog-DquXMRJD.js.map} +1 -1
  101. package/dist-vue/_chunks/{PkImageEditorDialog-BiuOD6Hr.js → PkImageEditorDialog-CrjpCier.js} +2 -2
  102. package/dist-vue/_chunks/{PkImageEditorDialog-BiuOD6Hr.js.map → PkImageEditorDialog-CrjpCier.js.map} +1 -1
  103. package/dist-vue/_chunks/{PkStreamingMarkdown-DMmt35Mq.js → PkStreamingMarkdown-CgKFdzCI.js} +23 -23
  104. package/dist-vue/_chunks/{PkStreamingMarkdown-DMmt35Mq.js.map → PkStreamingMarkdown-CgKFdzCI.js.map} +1 -1
  105. package/dist-vue/_chunks/{PkToolChatFile-BdNron14.js → PkToolChatFile-IEQxfzjM.js} +3 -3
  106. package/dist-vue/_chunks/{PkToolChatFile-BdNron14.js.map → PkToolChatFile-IEQxfzjM.js.map} +1 -1
  107. package/dist-vue/_chunks/{PkToolRequestGeolocation-DeI7kLlR.js → PkToolRequestGeolocation-BmrbMPke.js} +2 -2
  108. package/dist-vue/_chunks/{PkToolRequestGeolocation-DeI7kLlR.js.map → PkToolRequestGeolocation-BmrbMPke.js.map} +1 -1
  109. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C0lE3Qbk.js → PkToolRequestOAuthConnection-yKgXyOUN.js} +2 -2
  110. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C0lE3Qbk.js.map → PkToolRequestOAuthConnection-yKgXyOUN.js.map} +1 -1
  111. package/dist-vue/_chunks/{PkToolShowArtifact-C0Gb-LW2.js → PkToolShowArtifact-CF90yFCe.js} +2 -2
  112. package/dist-vue/_chunks/{PkToolShowArtifact-C0Gb-LW2.js.map → PkToolShowArtifact-CF90yFCe.js.map} +1 -1
  113. package/dist-vue/_chunks/{PkToolShowChart-oJmzU10F.js → PkToolShowChart-CDR8ag4q.js} +2 -2
  114. package/dist-vue/_chunks/{PkToolShowChart-oJmzU10F.js.map → PkToolShowChart-CDR8ag4q.js.map} +1 -1
  115. package/dist-vue/_chunks/{PkToolShowContactForm-D4IAna-K.js → PkToolShowContactForm-DAdKUU4X.js} +2 -2
  116. package/dist-vue/_chunks/{PkToolShowContactForm-D4IAna-K.js.map → PkToolShowContactForm-DAdKUU4X.js.map} +1 -1
  117. package/dist-vue/_chunks/{PkToolShowDiagram-ClGpv5Cr.js → PkToolShowDiagram-Do20AvFb.js} +2 -2
  118. package/dist-vue/_chunks/{PkToolShowDiagram-ClGpv5Cr.js.map → PkToolShowDiagram-Do20AvFb.js.map} +1 -1
  119. package/dist-vue/_chunks/{PkToolShowForm-ByfNodNh.js → PkToolShowForm-DfFmPOt6.js} +4 -4
  120. package/dist-vue/_chunks/{PkToolShowForm-ByfNodNh.js.map → PkToolShowForm-DfFmPOt6.js.map} +1 -1
  121. package/dist-vue/_chunks/{PkToolShowImageGallery-DJ9JNDWK.js → PkToolShowImageGallery-DA6KW2g_.js} +2 -2
  122. package/dist-vue/_chunks/{PkToolShowImageGallery-DJ9JNDWK.js.map → PkToolShowImageGallery-DA6KW2g_.js.map} +1 -1
  123. package/dist-vue/_chunks/{PkToolShowProductList-CcFseg28.js → PkToolShowProductList-FcDDabPI.js} +2 -2
  124. package/dist-vue/_chunks/{PkToolShowProductList-CcFseg28.js.map → PkToolShowProductList-FcDDabPI.js.map} +1 -1
  125. package/dist-vue/_chunks/{PkToolShowSources-DznWqWK3.js → PkToolShowSources-afCYBONq.js} +3 -3
  126. package/dist-vue/_chunks/{PkToolShowSources-DznWqWK3.js.map → PkToolShowSources-afCYBONq.js.map} +1 -1
  127. package/dist-vue/_chunks/{PkToolShowSuggestedReply-BZqnfpwO.js → PkToolShowSuggestedReply-C863wgtU.js} +2 -2
  128. package/dist-vue/_chunks/{PkToolShowSuggestedReply-BZqnfpwO.js.map → PkToolShowSuggestedReply-C863wgtU.js.map} +1 -1
  129. package/dist-vue/_chunks/{PkToolShowVideo-niwkzqTN.js → PkToolShowVideo-kUiwxRlz.js} +2 -2
  130. package/dist-vue/_chunks/{PkToolShowVideo-niwkzqTN.js.map → PkToolShowVideo-kUiwxRlz.js.map} +1 -1
  131. package/dist-vue/_chunks/{PkToolShowWebPages-BsMVJ6c7.js → PkToolShowWebPages-Dw9D1__u.js} +2 -2
  132. package/dist-vue/_chunks/{PkToolShowWebPages-BsMVJ6c7.js.map → PkToolShowWebPages-Dw9D1__u.js.map} +1 -1
  133. package/dist-vue/_chunks/{createChatbotApiClient-Cd_2UI_O.js → createChatbotApiClient-DzrHp52e.js} +66 -65
  134. package/dist-vue/_chunks/createChatbotApiClient-DzrHp52e.js.map +1 -0
  135. package/dist-vue/_chunks/localFolders-ChZp8dLu.js +353 -0
  136. package/dist-vue/_chunks/localFolders-ChZp8dLu.js.map +1 -0
  137. package/dist-vue/_chunks/{useChatbotStore-Dir9Rc7K.js → useChatbotStore-DZlc7dzK.js} +1289 -1152
  138. package/dist-vue/_chunks/useChatbotStore-DZlc7dzK.js.map +1 -0
  139. package/dist-vue/_chunks/useSettledSelection-1bfM1fzx.js +55 -0
  140. package/dist-vue/_chunks/useSettledSelection-1bfM1fzx.js.map +1 -0
  141. package/dist-vue/_chunks/{utils-CibsowVe.js → utils-CY0jFRnG.js} +126 -107
  142. package/dist-vue/_chunks/utils-CY0jFRnG.js.map +1 -0
  143. package/dist-vue/api.js +1 -1
  144. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +6 -0
  145. package/dist-vue/composables.js +62 -10
  146. package/dist-vue/composables.js.map +1 -1
  147. package/dist-vue/index.js +4100 -4086
  148. package/dist-vue/index.js.map +1 -1
  149. package/dist-vue/locales.js +32 -0
  150. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +6 -2
  151. package/dist-vue/packages/components/src/chat/PkChatbot.d.ts +7 -1
  152. package/dist-vue/packages/components/src/chat/PkChatbotLocalFolders.d.ts +31 -0
  153. package/dist-vue/packages/components/src/chat/utils.d.ts +3 -2
  154. package/dist-vue/packages/composable/src/chatbot/hostTools.d.ts +1 -1
  155. package/dist-vue/packages/composable/src/chatbot/index.d.ts +1 -0
  156. package/dist-vue/packages/composable/src/chatbot/localFolders.d.ts +137 -0
  157. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +46 -3
  158. package/dist-vue/packages/models/src/schema/Agent.d.ts +24 -0
  159. package/dist-vue/packages/models/src/schema/Chat.d.ts +1 -0
  160. package/dist-vue/packages/models/src/schema/HostTool.d.ts +5 -2
  161. package/dist-vue/packages/models/src/schema/LocalFolder.d.ts +78 -0
  162. package/dist-vue/packages/models/src/schema/Organization.d.ts +10 -0
  163. package/dist-vue/packages/models/src/schema/PageAccess.d.ts +4 -1
  164. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +8 -0
  165. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +8 -0
  166. package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
  167. package/dist-vue/style.css +1 -1
  168. package/package.json +1 -1
  169. package/dist/_chunks/Agent-DytagI8S.js.map +0 -1
  170. package/dist/_chunks/text-5F7L8EHi.js +0 -5
  171. package/dist/_chunks/text-5F7L8EHi.js.map +0 -1
  172. package/dist/_chunks/utils-78zQeKDO.js.map +0 -1
  173. package/dist-vue/_chunks/Agent-Da4XChe8.js.map +0 -1
  174. package/dist-vue/_chunks/Media-CMiWEpdQ.js.map +0 -1
  175. package/dist-vue/_chunks/PkChatbot-CITKd3qD.js.map +0 -1
  176. package/dist-vue/_chunks/PkChatbotInput-UqcSEi8l.js +0 -708
  177. package/dist-vue/_chunks/PkChatbotInput-UqcSEi8l.js.map +0 -1
  178. package/dist-vue/_chunks/PkChatbotViewChat-DW1a9ZNl.js.map +0 -1
  179. package/dist-vue/_chunks/createChatbotApiClient-Cd_2UI_O.js.map +0 -1
  180. package/dist-vue/_chunks/message-DuibQyHy.js +0 -61
  181. package/dist-vue/_chunks/message-DuibQyHy.js.map +0 -1
  182. package/dist-vue/_chunks/useChatbotStore-Dir9Rc7K.js.map +0 -1
  183. package/dist-vue/_chunks/utils-CibsowVe.js.map +0 -1
@@ -0,0 +1,658 @@
1
+ import { t as e } from "./VvButtonLocalized-C-vx25u4.js";
2
+ import { c as t, s as n } from "./Media-DtudATme.js";
3
+ import { t as r } from "./useSettledSelection-1bfM1fzx.js";
4
+ import { t as i } from "./PkStreamingMarkdown-CgKFdzCI.js";
5
+ import { t as a } from "./PkChatbotFilePreview-BbytSmUB.js";
6
+ import { j as o, k as s } from "./utils-CY0jFRnG.js";
7
+ import { VvDropdown as c, VvDropdownAction as l, VvIcon as u } from "@volverjs/ui-vue/components";
8
+ import { Fragment as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createTextVNode as _, createVNode as v, defineAsyncComponent as ee, defineComponent as y, mergeModels as b, mergeProps as te, nextTick as x, normalizeClass as ne, normalizeProps as re, onBeforeUnmount as ie, onMounted as ae, openBlock as S, ref as C, renderList as oe, renderSlot as se, shallowRef as ce, toDisplayString as w, unref as T, useId as le, useModel as ue, useTemplateRef as E, watch as de, withCtx as D, withKeys as fe, withModifiers as pe } from "vue";
9
+ import { useI18n as me } from "vue-i18n";
10
+ import { useResizeObserver as he } from "@vueuse/core";
11
+ // ../../node_modules/.pnpm/autosize@6.0.1/node_modules/autosize/dist/autosize.esm.js
12
+ var O = /* @__PURE__ */ new Map();
13
+ function ge(e) {
14
+ var t = O.get(e);
15
+ t && t.destroy();
16
+ }
17
+ function k(e) {
18
+ var t = O.get(e);
19
+ t && t.update();
20
+ }
21
+ var A = null;
22
+ typeof window > "u" ? ((A = function(e) {
23
+ return e;
24
+ }).destroy = function(e) {
25
+ return e;
26
+ }, A.update = function(e) {
27
+ return e;
28
+ }) : ((A = function(e, t) {
29
+ return e && Array.prototype.forEach.call(e.length ? e : [e], function(e) {
30
+ return function(e) {
31
+ if (e && e.nodeName && e.nodeName === "TEXTAREA" && !O.has(e)) {
32
+ var t, n = null, r = window.getComputedStyle(e), i = (t = e.value, function() {
33
+ o({
34
+ testForHeightReduction: t === "" || !e.value.startsWith(t),
35
+ restoreTextAlign: null
36
+ }), t = e.value;
37
+ }), a = function(t) {
38
+ e.removeEventListener("autosize:destroy", a), e.removeEventListener("autosize:update", s), e.removeEventListener("input", i), window.removeEventListener("resize", s), Object.keys(t).forEach(function(n) {
39
+ return e.style[n] = t[n];
40
+ }), O.delete(e);
41
+ }.bind(e, {
42
+ height: e.style.height,
43
+ resize: e.style.resize,
44
+ textAlign: e.style.textAlign,
45
+ overflowY: e.style.overflowY,
46
+ overflowX: e.style.overflowX,
47
+ wordWrap: e.style.wordWrap
48
+ });
49
+ 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", O.set(e, {
50
+ destroy: a,
51
+ update: s
52
+ }), s();
53
+ }
54
+ function o(t) {
55
+ var i, a, s = t.restoreTextAlign, c = s === void 0 ? null : s, l = t.testForHeightReduction, u = l === void 0 || l, d = r.overflowY;
56
+ if (e.scrollHeight !== 0 && (r.resize === "vertical" ? e.style.resize = "none" : r.resize === "both" && (e.style.resize = "horizontal"), u && (i = function(e) {
57
+ for (var t = []; e && e.parentNode && e.parentNode instanceof Element;) e.parentNode.scrollTop && t.push([e.parentNode, e.parentNode.scrollTop]), e = e.parentNode;
58
+ return function() {
59
+ return t.forEach(function(e) {
60
+ var t = e[0], n = e[1];
61
+ t.style.scrollBehavior = "auto", t.scrollTop = n, t.style.scrollBehavior = null;
62
+ });
63
+ };
64
+ }(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)) {
65
+ var f = r.textAlign;
66
+ r.overflow === "hidden" && (e.style.textAlign = f === "start" ? "end" : "start"), o({
67
+ restoreTextAlign: f,
68
+ testForHeightReduction: !0
69
+ });
70
+ }
71
+ }
72
+ function s() {
73
+ o({
74
+ testForHeightReduction: !0,
75
+ restoreTextAlign: null
76
+ });
77
+ }
78
+ }(e);
79
+ }), e;
80
+ }).destroy = function(e) {
81
+ return e && Array.prototype.forEach.call(e.length ? e : [e], ge), e;
82
+ }, A.update = function(e) {
83
+ return e && Array.prototype.forEach.call(e.length ? e : [e], k), e;
84
+ });
85
+ var j = A, M = ["type"], N = {
86
+ key: 0,
87
+ class: "pk-chat-button__label"
88
+ }, P = /* @__PURE__ */ y({
89
+ __name: "PkChatButton",
90
+ props: {
91
+ icon: {},
92
+ label: { default: void 0 },
93
+ type: { default: "button" },
94
+ modifiers: { default: void 0 }
95
+ },
96
+ setup(e) {
97
+ return (t, n) => {
98
+ let r = u;
99
+ return S(), h("button", {
100
+ class: ne(["pk-chat-button", [e.modifiers ? `pk-chat-button--${e.modifiers}` : void 0, { "pk-chat-button--labelled": e.label }]]),
101
+ type: e.type
102
+ }, [v(r, {
103
+ name: e.icon,
104
+ class: "pk-chat-button__icon"
105
+ }, null, 8, ["name"]), e.label ? (S(), h("span", N, w(e.label), 1)) : m("", !0)], 10, M);
106
+ };
107
+ }
108
+ }), F = 1568, I = 115e4, _e = .85, L = 300;
109
+ function ve() {
110
+ if (typeof navigator.mediaDevices?.getDisplayMedia != "function") return !1;
111
+ let e = document.featurePolicy;
112
+ return !e || e.allowsFeature("display-capture");
113
+ }
114
+ var R = (e, t) => {
115
+ let n = Math.min(1, F / Math.max(e, t), Math.sqrt(I / (e * t)));
116
+ return {
117
+ width: Math.round(e * n),
118
+ height: Math.round(t * n)
119
+ };
120
+ };
121
+ async function z(e, t) {
122
+ let n, r, i, a;
123
+ if (typeof ImageCapture == "function") {
124
+ let e = await new ImageCapture(t).grabFrame();
125
+ n = e, r = e.width, i = e.height, a = () => e.close();
126
+ } else {
127
+ let t = document.createElement("video");
128
+ t.muted = !0, t.playsInline = !0, t.srcObject = e, await t.play(), await new Promise((e) => {
129
+ let n = setTimeout(e, L);
130
+ t.requestVideoFrameCallback?.(() => {
131
+ clearTimeout(n), e();
132
+ });
133
+ }), n = t, r = t.videoWidth, i = t.videoHeight, a = () => {
134
+ t.srcObject = null;
135
+ };
136
+ }
137
+ try {
138
+ let e = R(r, i), t = document.createElement("canvas");
139
+ t.width = e.width, t.height = e.height;
140
+ let a = t.getContext("2d");
141
+ if (!a) throw Error("No 2D context");
142
+ return a.imageSmoothingQuality = "high", a.drawImage(n, 0, 0, e.width, e.height), t;
143
+ } finally {
144
+ a();
145
+ }
146
+ }
147
+ var ye = [
148
+ "image/jpeg",
149
+ "image/webp",
150
+ "image/png"
151
+ ];
152
+ async function B(e, t) {
153
+ for (let n of ye) {
154
+ if (!t.includes(n)) continue;
155
+ let r = await new Promise((t) => e.toBlob(t, n, _e));
156
+ if (r?.type === n) return r;
157
+ }
158
+ }
159
+ var V = {
160
+ "image/jpeg": "jpg",
161
+ "image/webp": "webp",
162
+ "image/png": "png"
163
+ }, H = (e) => String(e).padStart(2, "0");
164
+ async function be(e, t) {
165
+ let n = typeof CaptureController == "function" ? new CaptureController() : void 0, r;
166
+ try {
167
+ r = await navigator.mediaDevices.getDisplayMedia({
168
+ video: { displaySurface: "window" },
169
+ audio: !1,
170
+ selfBrowserSurface: "exclude",
171
+ ...n && { controller: n }
172
+ });
173
+ } catch (e) {
174
+ return { status: e instanceof DOMException && e.name === "NotAllowedError" ? "cancelled" : "failed" };
175
+ }
176
+ try {
177
+ try {
178
+ n?.setFocusBehavior?.("focus-capturing-application");
179
+ } catch {}
180
+ let i = r.getVideoTracks()[0];
181
+ if (!i) return { status: "failed" };
182
+ let a = await B(await z(r, i), e);
183
+ if (!a) return { status: "failed" };
184
+ let o = /* @__PURE__ */ new Date(), s = `${o.getFullYear()}-${H(o.getMonth() + 1)}-${H(o.getDate())} ${H(o.getHours())}.${H(o.getMinutes())}.${H(o.getSeconds())}`;
185
+ return {
186
+ status: "taken",
187
+ file: new File([a], `${t} ${s}.${V[a.type]}`, {
188
+ type: a.type,
189
+ lastModified: o.getTime()
190
+ })
191
+ };
192
+ } catch {
193
+ return { status: "failed" };
194
+ } finally {
195
+ r.getTracks().forEach((e) => e.stop());
196
+ }
197
+ }
198
+ // ../../packages/components/src/chat/PkChatbotInput.vue?vue&type=script&setup=true&lang.ts
199
+ var xe = { class: "pk-chatbot-input" }, Se = {
200
+ key: 0,
201
+ class: "pk-chatbot-input__notice",
202
+ role: "status"
203
+ }, Ce = {
204
+ key: 2,
205
+ class: "pk-chatbot-input__notice-text"
206
+ }, we = ["title"], Te = {
207
+ key: 1,
208
+ class: "pk-chatbot-input__pointer"
209
+ }, Ee = { class: "pk-chatbot-input__pointer-label" }, De = {
210
+ key: 2,
211
+ class: "pk-chatbot-input__attachments"
212
+ }, Oe = { class: "pk-chatbot-input__fieldset" }, ke = [
213
+ "title",
214
+ "disabled",
215
+ "onClick"
216
+ ], Ae = ["accept"], je = ["accept"], Me = { class: "pk-chatbot-input__content" }, Ne = [
217
+ "value",
218
+ "aria-label",
219
+ "aria-describedby",
220
+ "aria-invalid",
221
+ "placeholder"
222
+ ], Pe = {
223
+ key: 5,
224
+ class: "pk-chatbot-input__suggestion-key"
225
+ }, Fe = ["id"], Ie = ["id"], Le = { class: "opacity-60" }, Re = /* @__PURE__ */ y({
226
+ __name: "PkChatbotInput",
227
+ props: /*@__PURE__*/ b({
228
+ placeholder: {},
229
+ suggestion: {},
230
+ dismissableNotice: {},
231
+ pageNotice: {},
232
+ status: {},
233
+ maxMessageLength: {},
234
+ fileUpload: {},
235
+ attachmentLimitReached: { type: Boolean },
236
+ attachmentNotice: {},
237
+ voiceEnabled: { type: Boolean },
238
+ queueEnabled: { type: Boolean },
239
+ answerNotices: {},
240
+ pointerAvailable: { type: Boolean },
241
+ pointing: { type: Boolean },
242
+ pointer: {},
243
+ automaticConfirmations: { type: Boolean },
244
+ editableImages: { type: Boolean },
245
+ retryableAttachments: { type: Boolean }
246
+ }, {
247
+ modelValue: { default: void 0 },
248
+ modelModifiers: {},
249
+ pendingAttachments: { default: () => [] },
250
+ pendingAttachmentsModifiers: {}
251
+ }),
252
+ emits: /*@__PURE__*/ b([
253
+ "submit",
254
+ "stop-generation",
255
+ "file-select",
256
+ "remove-attachment",
257
+ "replace-attachment",
258
+ "retry-attachment",
259
+ "dismiss-attachment-notice",
260
+ "dismiss-page-notice",
261
+ "open-answer-notice",
262
+ "dismiss-answer-notice",
263
+ "voice-start",
264
+ "point",
265
+ "remove-pointer",
266
+ "manual-confirmations"
267
+ ], ["update:modelValue", "update:pendingAttachments"]),
268
+ setup(y, { expose: b, emit: O }) {
269
+ let ge = ee(() => import("./PkImageEditorDialog-CrjpCier.js")), k = ue(y, "modelValue"), A = ue(y, "pendingAttachments"), M = O, N = y, { t: F } = me({ useScope: "global" }), I = E("textareaEl"), _e = E("fileInputEl"), L = E("cameraInputEl"), R = E("formEl"), z = C(k.value ?? ""), B = null, V = () => {
270
+ B !== null && (clearTimeout(B), B = null);
271
+ }, H = () => {
272
+ V(), k.value = z.value;
273
+ }, Re = () => {
274
+ V(), B = setTimeout(() => {
275
+ k.value = z.value, B = null;
276
+ }, 300);
277
+ }, ze = () => {
278
+ z.value = I.value?.value ?? "", Re();
279
+ };
280
+ de(k, (e) => {
281
+ e !== z.value && (z.value = e ?? "", x(() => {
282
+ I.value && j.update(I.value);
283
+ }));
284
+ });
285
+ let U = f(() => N.status === "streaming"), Be = f(() => N.status === "submitted"), W = f(() => U.value || Be.value), Ve = le(), He = f(() => z.value.length), G = f(() => N.maxMessageLength !== void 0 && He.value > N.maxMessageLength), Ue = f(() => A.value.some((e) => e.state === "uploading")), We = f(() => A.value.some((e) => e.state === "error")), K = f(() => W.value && !N.queueEnabled || Ue.value || We.value || G.value ? !1 : z.value.trim().length > 0), Ge = f(() => W.value && K.value), Ke = !r(), qe = le(), q = f(() => Ke && N.suggestion && !z.value && !W.value ? N.suggestion : void 0), Je = f(() => [N.maxMessageLength ? Ve : void 0, q.value ? qe : void 0].filter(Boolean).join(" ") || void 0), Ye = "capture" in document.createElement("input"), Xe = f(() => {
286
+ let e = N.fileUpload?.allowedMimeTypes ?? [];
287
+ return [...e, ...t(e)].join(",");
288
+ }), Ze = f(() => (N.fileUpload?.allowedMimeTypes ?? []).filter((e) => e.startsWith("image/")).join(",")), J = f(() => Ye && Ze.value.length > 0), Qe = () => {
289
+ _e.value?.click();
290
+ }, $e = () => {
291
+ L.value?.click();
292
+ }, et = !r() && ve(), tt = f(() => et && ye.some((e) => N.fileUpload?.allowedMimeTypes?.includes(e))), Y = C(!1), nt = (e) => {
293
+ for (let t of e) M("file-select", t);
294
+ }, rt = (e) => {
295
+ let t = e.target;
296
+ nt(Array.from(t.files ?? [])), t.value = "";
297
+ }, it = (e) => {
298
+ let t = e.clipboardData;
299
+ if (!t?.files.length || !N.fileUpload?.enabled || t.getData("text/plain") && t.types.includes("text/html")) return;
300
+ let r = N.fileUpload.allowedMimeTypes ?? [], i = Array.from(t.files).filter((e) => !r.length || r.includes(n(e.name, e.type, r)));
301
+ i.length && !W.value && (e.preventDefault(), nt(i));
302
+ }, at = (e) => {
303
+ let t = A.value.find((t) => t.id === e);
304
+ t && (URL.revokeObjectURL(t.localUrl), A.value = A.value.filter((t) => t.id !== e), M("remove-attachment", t));
305
+ }, X = C(), Z = f(() => A.value.find((e) => e.id === X.value)), Q = ce(), $ = C(!1), ot = f(() => Z.value?.file ?? Q.value), st = (e) => !!N.editableImages && e.state !== "uploading" && s(e.file.type), ct = () => {
306
+ X.value = void 0, Q.value = void 0, $.value = !1;
307
+ }, lt = async () => {
308
+ Y.value = !1;
309
+ let e = await be(N.fileUpload?.allowedMimeTypes ?? [], F("label.screenshotFileName"));
310
+ e.status === "failed" ? Y.value = !0 : e.status === "taken" && (X.value = void 0, Q.value = Promise.resolve(e.file), $.value = !0);
311
+ }, ut = async (e) => {
312
+ let t = Z.value, n = !t && !!Q.value;
313
+ if (ct(), t) M("replace-attachment", t, e);
314
+ else if (n) M("file-select", e);
315
+ else return;
316
+ await x(), I.value?.focus();
317
+ }, dt = C(!0), ft = () => {
318
+ dt.value = !1;
319
+ }, pt = f(() => {
320
+ if (N.attachmentNotice) return [{
321
+ id: "limit",
322
+ icon: "ri:information-line",
323
+ text: N.attachmentNotice,
324
+ dismiss: () => M("dismiss-attachment-notice")
325
+ }];
326
+ let e = [];
327
+ We.value && e.push({
328
+ id: "upload-failed",
329
+ icon: "ri:error-warning-line",
330
+ text: F("message.attachmentUploadFailed")
331
+ }), Y.value && e.push({
332
+ id: "screenshot-failed",
333
+ icon: "ri:error-warning-line",
334
+ text: F("message.screenshotFailed"),
335
+ dismiss: () => {
336
+ Y.value = !1;
337
+ }
338
+ });
339
+ for (let t of N.answerNotices ?? []) e.push({
340
+ id: `answer-${t.id}`,
341
+ icon: "ri:chat-check-line",
342
+ text: t.text,
343
+ open: () => M("open-answer-notice", t.id),
344
+ dismiss: () => M("dismiss-answer-notice", t.id)
345
+ });
346
+ return N.pageNotice && e.push({
347
+ id: "page",
348
+ icon: "ri:pages-line",
349
+ text: N.pageNotice,
350
+ dismiss: () => M("dismiss-page-notice")
351
+ }), N.dismissableNotice && dt.value && e.push({
352
+ id: "dismissable",
353
+ markdown: N.dismissableNotice,
354
+ dismiss: ft
355
+ }), e;
356
+ }), mt = () => {
357
+ R.value?.querySelector("button:focus-visible") && I.value?.focus();
358
+ }, ht = () => {
359
+ mt(), M("stop-generation");
360
+ }, gt = () => {
361
+ K.value && (mt(), H(), M("submit"), z.value = "", k.value = "", x(() => {
362
+ I.value && (I.value.value = "", j.update(I.value));
363
+ }));
364
+ }, _t = (e) => {
365
+ e.shiftKey || o(e) || (e.preventDefault(), gt());
366
+ }, vt = (e) => {
367
+ let t = q.value;
368
+ !t || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || o(e) || (e.preventDefault(), z.value = t, H(), x(() => {
369
+ I.value && (j.update(I.value), I.value.setSelectionRange(t.length, t.length));
370
+ }));
371
+ };
372
+ ae(() => {
373
+ I.value && j(I.value);
374
+ });
375
+ let yt = 0;
376
+ return he(I, ([e]) => {
377
+ let t = e?.contentRect.width ?? 0;
378
+ I.value && t !== yt && (yt = t, j.update(I.value));
379
+ }), de(() => q.value ?? N.placeholder, async () => {
380
+ await x(), I.value && j.update(I.value);
381
+ }), ie(() => {
382
+ V(), I.value && j.destroy(I.value);
383
+ for (let e of A.value) URL.revokeObjectURL(e.localUrl);
384
+ }), b({
385
+ focus: () => I.value?.focus(),
386
+ annotateImage: (e) => {
387
+ X.value = void 0, Q.value = e, $.value = !1;
388
+ }
389
+ }), (t, n) => {
390
+ let r = u, o = e, s = l, f = c;
391
+ return S(), h("div", xe, [
392
+ pt.value.length ? (S(), h("div", Se, [(S(!0), h(d, null, oe(pt.value, (e) => (S(), h("div", {
393
+ key: e.id,
394
+ class: "pk-chatbot-input__notice-item"
395
+ }, [
396
+ e.icon ? (S(), p(r, {
397
+ key: 0,
398
+ name: e.icon,
399
+ class: "pk-chatbot-input__notice-icon"
400
+ }, null, 8, ["name"])) : m("", !0),
401
+ e.markdown ? (S(), p(i, {
402
+ key: 1,
403
+ markdown: e.markdown,
404
+ class: "wysiwyg pk-chatbot-input__notice-text"
405
+ }, null, 8, ["markdown"])) : (S(), h("span", Ce, w(e.text), 1)),
406
+ e.open ? (S(), p(o, {
407
+ key: 3,
408
+ label: T(F)("action.open"),
409
+ modifiers: "link",
410
+ class: "pk-chatbot-input__notice-action",
411
+ onClick: (t) => e.open()
412
+ }, null, 8, ["label", "onClick"])) : m("", !0),
413
+ e.dismiss ? (S(), p(o, {
414
+ key: 4,
415
+ title: T(F)("action.close"),
416
+ modifiers: "action-quiet",
417
+ icon: "ri:close-line",
418
+ class: "w-18 h-18",
419
+ onClick: (t) => e.dismiss()
420
+ }, null, 8, ["title", "onClick"])) : m("", !0)
421
+ ]))), 128))])) : m("", !0),
422
+ g("form", {
423
+ ref_key: "formEl",
424
+ ref: R,
425
+ class: "pk-chatbot-input__form",
426
+ onSubmit: pe(gt, ["prevent"])
427
+ }, [
428
+ y.automaticConfirmations ? (S(), h("button", {
429
+ key: 0,
430
+ type: "button",
431
+ class: "pk-chatbot-input__mode",
432
+ title: T(F)("action.manualConfirmations"),
433
+ onClick: n[0] ||= (e) => M("manual-confirmations")
434
+ }, [
435
+ v(r, {
436
+ name: "ri:flashlight-line",
437
+ class: "pk-chatbot-input__pointer-icon"
438
+ }),
439
+ _(" " + w(T(F)("label.automaticConfirmations")) + " ", 1),
440
+ v(r, {
441
+ name: "ri:close-line",
442
+ class: "pk-chatbot-input__pointer-icon"
443
+ })
444
+ ], 8, we)) : m("", !0),
445
+ y.pointer ? (S(), h("div", Te, [
446
+ v(r, {
447
+ name: y.pointer.kind === "text" ? "ri:double-quotes-l" : "ri:focus-3-line",
448
+ class: "pk-chatbot-input__pointer-icon"
449
+ }, null, 8, ["name"]),
450
+ g("span", Ee, w(y.pointer.kind === "text" ? `«${y.pointer.label}»` : y.pointer.label), 1),
451
+ v(o, {
452
+ title: T(F)("pagePointer.remove"),
453
+ modifiers: "action-quiet",
454
+ icon: "ri:close-line",
455
+ class: "w-18 h-18",
456
+ onClick: n[1] ||= (e) => M("remove-pointer")
457
+ }, null, 8, ["title"])
458
+ ])) : m("", !0),
459
+ A.value.length ? (S(), h("div", De, [(S(!0), h(d, null, oe(A.value, (e) => (S(), p(a, {
460
+ key: e.id,
461
+ "media-type": e.mediaSource?.mimeType ?? e.file.type,
462
+ url: e.localUrl,
463
+ filename: e.file.name,
464
+ size: e.file.size,
465
+ loading: e.state === "uploading",
466
+ error: e.state === "error" ? e.error : void 0,
467
+ removable: e.state !== "uploading",
468
+ editable: st(e),
469
+ retryable: y.retryableAttachments && e.state === "error",
470
+ compact: "",
471
+ onRemove: (t) => at(e.id),
472
+ onEdit: (t) => X.value = e.id,
473
+ onRetry: (t) => M("retry-attachment", e)
474
+ }, null, 8, [
475
+ "media-type",
476
+ "url",
477
+ "filename",
478
+ "size",
479
+ "loading",
480
+ "error",
481
+ "removable",
482
+ "editable",
483
+ "retryable",
484
+ "onRemove",
485
+ "onEdit",
486
+ "onRetry"
487
+ ]))), 128))])) : m("", !0),
488
+ g("div", Oe, [
489
+ se(t.$slots, "prepend"),
490
+ y.fileUpload && y.fileUpload.enabled && (J.value || tt.value || t.$slots["additional-actions"]) ? (S(), p(f, re(te({ key: 0 }, {
491
+ placement: "top-start",
492
+ modifiers: "menu",
493
+ flip: !0,
494
+ offset: 3
495
+ })), {
496
+ default: D(({ init: e, toggle: t, aria: n }) => [g("button", te({ ref: (t) => e(t) }, n, {
497
+ class: "pk-chat-button",
498
+ type: "button",
499
+ title: T(F)("action.attachFile"),
500
+ disabled: W.value,
501
+ onClick: t
502
+ }), [v(r, {
503
+ name: "ri:add-line",
504
+ class: "pk-chat-button__icon"
505
+ })], 16, ke)]),
506
+ items: D(() => [
507
+ J.value ? (S(), p(s, {
508
+ key: 0,
509
+ disabled: W.value || y.attachmentLimitReached,
510
+ onClick: $e
511
+ }, {
512
+ default: D(() => [v(r, {
513
+ name: "ri:camera-line",
514
+ class: "pk-chatbot-input__dropdown-icon"
515
+ }), _(" " + w(T(F)("action.takePhoto")), 1)]),
516
+ _: 1
517
+ }, 8, ["disabled"])) : m("", !0),
518
+ tt.value ? (S(), p(s, {
519
+ key: 1,
520
+ disabled: W.value || y.attachmentLimitReached,
521
+ onClick: lt
522
+ }, {
523
+ default: D(() => [v(r, {
524
+ name: "ri:screenshot-2-line",
525
+ class: "pk-chatbot-input__dropdown-icon"
526
+ }), _(" " + w(T(F)("action.attachScreenshot")), 1)]),
527
+ _: 1
528
+ }, 8, ["disabled"])) : m("", !0),
529
+ v(s, {
530
+ disabled: W.value || y.attachmentLimitReached,
531
+ onClick: Qe
532
+ }, {
533
+ default: D(() => [v(r, {
534
+ name: "ri:attachment-line",
535
+ class: "pk-chatbot-input__dropdown-icon"
536
+ }), _(" " + w(T(F)("action.attachFile")), 1)]),
537
+ _: 1
538
+ }, 8, ["disabled"]),
539
+ se(t.$slots, "additional-actions")
540
+ ]),
541
+ _: 3
542
+ }, 16)) : y.fileUpload && y.fileUpload.enabled ? (S(), p(P, {
543
+ key: 1,
544
+ icon: "ri:add-line",
545
+ title: T(F)("action.attachFile"),
546
+ disabled: W.value || y.attachmentLimitReached,
547
+ onClick: Qe
548
+ }, null, 8, ["title", "disabled"])) : m("", !0),
549
+ y.fileUpload && y.fileUpload.enabled ? (S(), h("input", {
550
+ key: 2,
551
+ ref_key: "fileInputEl",
552
+ ref: _e,
553
+ type: "file",
554
+ hidden: "",
555
+ multiple: "",
556
+ accept: Xe.value,
557
+ onChange: rt
558
+ }, null, 40, Ae)) : m("", !0),
559
+ y.fileUpload && y.fileUpload.enabled && J.value ? (S(), h("input", {
560
+ key: 3,
561
+ ref_key: "cameraInputEl",
562
+ ref: L,
563
+ type: "file",
564
+ capture: "environment",
565
+ hidden: "",
566
+ accept: Ze.value,
567
+ onChange: rt
568
+ }, null, 40, je)) : m("", !0),
569
+ y.pointerAvailable ? (S(), p(P, {
570
+ key: 4,
571
+ icon: "ri:focus-3-line",
572
+ title: T(F)("pagePointer.start"),
573
+ "aria-pressed": y.pointing,
574
+ disabled: W.value,
575
+ onClick: n[2] ||= (e) => M("point")
576
+ }, null, 8, [
577
+ "title",
578
+ "aria-pressed",
579
+ "disabled"
580
+ ])) : m("", !0),
581
+ g("div", Me, [g("textarea", {
582
+ ref_key: "textareaEl",
583
+ ref: I,
584
+ value: z.value,
585
+ class: "pk-chatbot-input__textarea",
586
+ name: "message",
587
+ rows: "1",
588
+ enterkeyhint: "send",
589
+ "aria-label": T(F)("label.message"),
590
+ "aria-describedby": Je.value,
591
+ "aria-invalid": G.value || void 0,
592
+ placeholder: q.value ?? y.placeholder,
593
+ onInput: ze,
594
+ onKeydown: [fe(_t, ["enter"]), fe(vt, ["tab"])],
595
+ onPaste: it
596
+ }, null, 40, Ne)]),
597
+ q.value ? (S(), h("span", Pe, [n[4] ||= g("kbd", { "aria-hidden": "true" }, "Tab", -1), g("span", {
598
+ id: T(qe),
599
+ class: "u-visually-hidden"
600
+ }, w(T(F)("hint.suggestedNextMessage")), 9, Fe)])) : m("", !0),
601
+ y.maxMessageLength ? (S(), h("div", {
602
+ key: 6,
603
+ id: T(Ve),
604
+ class: ne(["pk-chatbot-input__counter", { "pk-chatbot-input__counter--over": G.value }])
605
+ }, [_(w(t.$n(He.value, "integer")) + "/", 1), g("span", Le, w(t.$n(y.maxMessageLength, "integer")), 1)], 10, Ie)) : m("", !0),
606
+ y.voiceEnabled && !U.value ? (S(), p(P, {
607
+ key: 7,
608
+ icon: "ri:mic-line",
609
+ title: T(F)("action.talk"),
610
+ disabled: W.value,
611
+ onClick: n[3] ||= (e) => M("voice-start")
612
+ }, null, 8, ["title", "disabled"])) : m("", !0),
613
+ U.value ? (S(), p(P, {
614
+ key: 8,
615
+ icon: "ri:stop-fill",
616
+ modifiers: Ge.value ? void 0 : "primary",
617
+ title: T(F)("action.stop"),
618
+ onClick: ht
619
+ }, null, 8, ["modifiers", "title"])) : m("", !0),
620
+ Ge.value ? (S(), p(P, {
621
+ key: 9,
622
+ type: "submit",
623
+ modifiers: "primary",
624
+ icon: "ri:arrow-up-line",
625
+ title: T(F)("action.queueMessage")
626
+ }, null, 8, ["title"])) : U.value ? m("", !0) : (S(), p(P, {
627
+ key: 10,
628
+ type: "submit",
629
+ modifiers: "primary",
630
+ icon: Be.value ? "loading-loop" : "ri:arrow-up-line",
631
+ title: T(F)("action.submit"),
632
+ disabled: !K.value
633
+ }, null, 8, [
634
+ "icon",
635
+ "title",
636
+ "disabled"
637
+ ]))
638
+ ])
639
+ ], 544),
640
+ ot.value ? (S(), p(T(ge), {
641
+ key: Z.value?.id ?? "annotating",
642
+ file: ot.value,
643
+ "initial-tool": Z.value ? void 0 : "arrow",
644
+ "keep-unchanged": $.value,
645
+ onApply: ut,
646
+ onClose: ct
647
+ }, null, 8, [
648
+ "file",
649
+ "initial-tool",
650
+ "keep-unchanged"
651
+ ])) : m("", !0)
652
+ ]);
653
+ };
654
+ }
655
+ });
656
+ export { P as n, Re as t };
657
+
658
+ //# sourceMappingURL=PkChatbotInput-CJ5lPtpH.js.map