@8wave/ai-elements 0.111.0-beta.3 → 0.111.0-beta.7

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 (150) hide show
  1. package/dist/_chunks/{Agent-Su_LDF9_.js → Agent-tE7ZJPxG.js} +80 -78
  2. package/dist/_chunks/Agent-tE7ZJPxG.js.map +1 -0
  3. package/dist/_chunks/{Document-DecVclEe.js → Document-Bmx6774B.js} +33 -21
  4. package/dist/_chunks/Document-Bmx6774B.js.map +1 -0
  5. package/dist/_chunks/Media-Cft7Pwrh.js +108 -0
  6. package/dist/_chunks/Media-Cft7Pwrh.js.map +1 -0
  7. package/dist/_chunks/{PkStreamingMarkdown-CwqsJnJJ.js → PkStreamingMarkdown-DgBS4Ebc.js} +69 -59
  8. package/dist/_chunks/PkStreamingMarkdown-DgBS4Ebc.js.map +1 -0
  9. package/dist/_chunks/{PkToolRequestGeolocation-OokLeTf1.js → PkToolRequestGeolocation-pVys3x9M.js} +2 -2
  10. package/dist/_chunks/{PkToolRequestGeolocation-OokLeTf1.js.map → PkToolRequestGeolocation-pVys3x9M.js.map} +1 -1
  11. package/dist/_chunks/{PkToolRequestOAuthConnection-CtqKG6Yb.js → PkToolRequestOAuthConnection-BGChb_eC.js} +2 -2
  12. package/dist/_chunks/{PkToolRequestOAuthConnection-CtqKG6Yb.js.map → PkToolRequestOAuthConnection-BGChb_eC.js.map} +1 -1
  13. package/dist/_chunks/{PkToolShowArtifact-M6jlSmyJ.js → PkToolShowArtifact-CkTBIdQd.js} +2 -2
  14. package/dist/_chunks/{PkToolShowArtifact-M6jlSmyJ.js.map → PkToolShowArtifact-CkTBIdQd.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowContactForm-D_dW59Dl.js → PkToolShowContactForm-Du7jX7K5.js} +2 -2
  16. package/dist/_chunks/{PkToolShowContactForm-D_dW59Dl.js.map → PkToolShowContactForm-Du7jX7K5.js.map} +1 -1
  17. package/dist/_chunks/PkToolShowDiagram-BdmG9gm8.js.map +1 -1
  18. package/dist/_chunks/{PkToolShowForm-DbJHMDbt.js → PkToolShowForm-Du2nk7pq.js} +3 -3
  19. package/dist/_chunks/PkToolShowForm-Du2nk7pq.js.map +1 -0
  20. package/dist/_chunks/{PkToolShowSources-Dot-W0Mj.js → PkToolShowSources-CsHLUF4L.js} +3 -3
  21. package/dist/_chunks/{PkToolShowSources-Dot-W0Mj.js.map → PkToolShowSources-CsHLUF4L.js.map} +1 -1
  22. package/dist/_chunks/{PkToolShowSuggestedReply-CKxSH0Y9.js → PkToolShowSuggestedReply-D7g_qymH.js} +2 -2
  23. package/dist/_chunks/{PkToolShowSuggestedReply-CKxSH0Y9.js.map → PkToolShowSuggestedReply-D7g_qymH.js.map} +1 -1
  24. package/dist/_chunks/PkToolShowWeather-LPd3tC77.js.map +1 -1
  25. package/dist/_chunks/PkUrl-BPbjZJ1A.js.map +1 -1
  26. package/dist/_chunks/{browser-NgY6LXg-.js → browser-B0Xnbqi7.js} +726 -751
  27. package/dist/_chunks/browser-B0Xnbqi7.js.map +1 -0
  28. package/dist/_chunks/text-DbSEK8si.js.map +1 -1
  29. package/dist/_chunks/utils-YJ0ZOLDG.js.map +1 -1
  30. package/dist/ai-elements.es.js +3010 -3052
  31. package/dist/ai-elements.es.js.map +1 -1
  32. package/dist-vue/PkChatbot.js +1 -1
  33. package/dist-vue/PkChatbotEmptyState.js +1 -1
  34. package/dist-vue/PkChatbotError.js +1 -1
  35. package/dist-vue/PkChatbotInput.js +1 -1
  36. package/dist-vue/PkChatbotMessages.js +1 -1
  37. package/dist-vue/PkChatbotSteps.js +1 -1
  38. package/dist-vue/PkChatbotViewChat.js +1 -1
  39. package/dist-vue/PkChatbotViewConversations.js +1 -1
  40. package/dist-vue/PkChatbotViewFiles.js +1 -1
  41. package/dist-vue/PkChatbotViewProfile.js +1 -1
  42. package/dist-vue/_chunks/{Agent-C8BsTAxk.js → Agent-De2gFNjR.js} +165 -176
  43. package/dist-vue/_chunks/Agent-De2gFNjR.js.map +1 -0
  44. package/dist-vue/_chunks/{Document-CaUfI_SZ.js → Document-8umjeTVS.js} +84 -72
  45. package/dist-vue/_chunks/Document-8umjeTVS.js.map +1 -0
  46. package/dist-vue/_chunks/Media-_HfFLHGD.js.map +1 -1
  47. package/dist-vue/_chunks/{PkChatbot-BPKSPIeC.js → PkChatbot-Di7R2CWN.js} +7 -7
  48. package/dist-vue/_chunks/PkChatbot-Di7R2CWN.js.map +1 -0
  49. package/dist-vue/_chunks/{PkChatbotEmptyState-BvaeBxhx.js → PkChatbotEmptyState-C_ITdvH7.js} +2 -2
  50. package/dist-vue/_chunks/{PkChatbotEmptyState-BvaeBxhx.js.map → PkChatbotEmptyState-C_ITdvH7.js.map} +1 -1
  51. package/dist-vue/_chunks/{PkChatbotError-CBP2mf-n.js → PkChatbotError-gvDpRcEz.js} +21 -19
  52. package/dist-vue/_chunks/PkChatbotError-gvDpRcEz.js.map +1 -0
  53. package/dist-vue/_chunks/{PkChatbotInput-JnHaRlfk.js → PkChatbotInput-pEl3D2O-.js} +139 -124
  54. package/dist-vue/_chunks/PkChatbotInput-pEl3D2O-.js.map +1 -0
  55. package/dist-vue/_chunks/{PkChatbotMessages-DAlkoMkY.js → PkChatbotMessages-CGALOKwe.js} +17 -17
  56. package/dist-vue/_chunks/PkChatbotMessages-CGALOKwe.js.map +1 -0
  57. package/dist-vue/_chunks/{PkChatbotSteps-rommD48p.js → PkChatbotSteps-BhFupvbz.js} +2 -2
  58. package/dist-vue/_chunks/{PkChatbotSteps-rommD48p.js.map → PkChatbotSteps-BhFupvbz.js.map} +1 -1
  59. package/dist-vue/_chunks/{PkChatbotViewChat-CEqzF1G9.js → PkChatbotViewChat-DT-rAU_r.js} +6 -6
  60. package/dist-vue/_chunks/{PkChatbotViewChat-CEqzF1G9.js.map → PkChatbotViewChat-DT-rAU_r.js.map} +1 -1
  61. package/dist-vue/_chunks/{PkChatbotViewConversations-C787v5ll.js → PkChatbotViewConversations-3LaZPFyw.js} +2 -2
  62. package/dist-vue/_chunks/{PkChatbotViewConversations-C787v5ll.js.map → PkChatbotViewConversations-3LaZPFyw.js.map} +1 -1
  63. package/dist-vue/_chunks/{PkChatbotViewFiles-CNFLt8YO.js → PkChatbotViewFiles-CTqnbsCj.js} +3 -3
  64. package/dist-vue/_chunks/{PkChatbotViewFiles-CNFLt8YO.js.map → PkChatbotViewFiles-CTqnbsCj.js.map} +1 -1
  65. package/dist-vue/_chunks/{PkChatbotViewProfile-7p0ci3qm.js → PkChatbotViewProfile-B-Mp1jGQ.js} +2 -2
  66. package/dist-vue/_chunks/{PkChatbotViewProfile-7p0ci3qm.js.map → PkChatbotViewProfile-B-Mp1jGQ.js.map} +1 -1
  67. package/dist-vue/_chunks/PkRelativeTime--1cIphlA.js.map +1 -1
  68. package/dist-vue/_chunks/{PkStreamingMarkdown-D8_LwZMR.js → PkStreamingMarkdown-DIaZEedG.js} +406 -396
  69. package/dist-vue/_chunks/PkStreamingMarkdown-DIaZEedG.js.map +1 -0
  70. package/dist-vue/_chunks/PkSvgViewer-D-0M5bqg.js.map +1 -1
  71. package/dist-vue/_chunks/{PkToolRequestGeolocation-Bxqz9oSo.js → PkToolRequestGeolocation-Q3N3jlO8.js} +2 -2
  72. package/dist-vue/_chunks/{PkToolRequestGeolocation-Bxqz9oSo.js.map → PkToolRequestGeolocation-Q3N3jlO8.js.map} +1 -1
  73. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C6rXgb0s.js → PkToolRequestOAuthConnection-C0LW5Evp.js} +2 -2
  74. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C6rXgb0s.js.map → PkToolRequestOAuthConnection-C0LW5Evp.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkToolShowArtifact-CEXdfOGG.js → PkToolShowArtifact-BCCUucVQ.js} +2 -2
  76. package/dist-vue/_chunks/{PkToolShowArtifact-CEXdfOGG.js.map → PkToolShowArtifact-BCCUucVQ.js.map} +1 -1
  77. package/dist-vue/_chunks/{PkToolShowContactForm-DHmzAIVF.js → PkToolShowContactForm-BXGxWSc2.js} +2 -2
  78. package/dist-vue/_chunks/{PkToolShowContactForm-DHmzAIVF.js.map → PkToolShowContactForm-BXGxWSc2.js.map} +1 -1
  79. package/dist-vue/_chunks/{PkToolShowDiagram-dwCVZ1up.js → PkToolShowDiagram-CZgrWvBr.js} +2 -2
  80. package/dist-vue/_chunks/PkToolShowDiagram-CZgrWvBr.js.map +1 -0
  81. package/dist-vue/_chunks/{PkToolShowEmail-CavhsPvi.js → PkToolShowEmail-DpC517Vn.js} +2 -2
  82. package/dist-vue/_chunks/{PkToolShowEmail-CavhsPvi.js.map → PkToolShowEmail-DpC517Vn.js.map} +1 -1
  83. package/dist-vue/_chunks/{PkToolShowForm-CO5A_j9L.js → PkToolShowForm-CIZpfAGK.js} +3 -3
  84. package/dist-vue/_chunks/PkToolShowForm-CIZpfAGK.js.map +1 -0
  85. package/dist-vue/_chunks/{PkToolShowMessage-DQojxDiV.js → PkToolShowMessage-B7flxVCU.js} +2 -2
  86. package/dist-vue/_chunks/{PkToolShowMessage-DQojxDiV.js.map → PkToolShowMessage-B7flxVCU.js.map} +1 -1
  87. package/dist-vue/_chunks/{PkToolShowProductList-Cn0yewM3.js → PkToolShowProductList-B6fRtIpx.js} +2 -2
  88. package/dist-vue/_chunks/{PkToolShowProductList-Cn0yewM3.js.map → PkToolShowProductList-B6fRtIpx.js.map} +1 -1
  89. package/dist-vue/_chunks/{PkToolShowSources-7Q5Iogxi.js → PkToolShowSources-DDZokZow.js} +4 -4
  90. package/dist-vue/_chunks/{PkToolShowSources-7Q5Iogxi.js.map → PkToolShowSources-DDZokZow.js.map} +1 -1
  91. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DQFOVonE.js → PkToolShowSuggestedReply-DWLkUh2L.js} +2 -2
  92. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DQFOVonE.js.map → PkToolShowSuggestedReply-DWLkUh2L.js.map} +1 -1
  93. package/dist-vue/_chunks/PkToolShowWeather-Bzqalzh8.js.map +1 -1
  94. package/dist-vue/_chunks/{PkToolShowWebPages-Bzkkn9GV.js → PkToolShowWebPages-DY48ee6V.js} +2 -2
  95. package/dist-vue/_chunks/{PkToolShowWebPages-Bzkkn9GV.js.map → PkToolShowWebPages-DY48ee6V.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkUrl-xUBKVJCv.js → PkUrl-DSGxrEM7.js} +2 -2
  97. package/dist-vue/_chunks/PkUrl-DSGxrEM7.js.map +1 -0
  98. package/dist-vue/_chunks/{createChatbotApiClient-D9f69brW.js → createChatbotApiClient-MkaPbGWB.js} +2 -2
  99. package/dist-vue/_chunks/createChatbotApiClient-MkaPbGWB.js.map +1 -0
  100. package/dist-vue/_chunks/{useChatbotStore-9Cw_oR6J.js → useChatbotStore-BzfqjiYz.js} +6 -3
  101. package/dist-vue/_chunks/useChatbotStore-BzfqjiYz.js.map +1 -0
  102. package/dist-vue/_chunks/useDialogConfirm-KWz0ohCQ.js.map +1 -1
  103. package/dist-vue/_chunks/utils-Coqik0XI.js.map +1 -1
  104. package/dist-vue/api.js +1 -1
  105. package/dist-vue/composables.js +2 -2
  106. package/dist-vue/index.js +3858 -3490
  107. package/dist-vue/index.js.map +1 -1
  108. package/dist-vue/locales.js +36 -8
  109. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +20 -3
  110. package/dist-vue/packages/components/src/chat/PkChatButton.d.ts +3 -2
  111. package/dist-vue/packages/components/src/chat/PkLanguageModel.d.ts +26 -2
  112. package/dist-vue/packages/components/src/chat/PkLanguageModelCombobox.d.ts +53 -1
  113. package/dist-vue/packages/components/src/chat/PkModelOption.d.ts +19 -0
  114. package/dist-vue/packages/components/src/chat/PkReasoningSettings.d.ts +6 -0
  115. package/dist-vue/packages/components/src/chat/constants.d.ts +5 -18
  116. package/dist-vue/packages/components/src/chat/index.d.ts +3 -1
  117. package/dist-vue/packages/components/src/chat/modelCatalog.d.ts +46 -0
  118. package/dist-vue/packages/components/src/table/PkTableSortable.d.ts +5 -1
  119. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +18 -0
  120. package/dist-vue/packages/composable/src/useChatbotError.d.ts +2 -0
  121. package/dist-vue/packages/models/src/schema/Agent.d.ts +70 -10
  122. package/dist-vue/packages/models/src/schema/Chat.d.ts +10 -0
  123. package/dist-vue/packages/models/src/schema/ModelProvider.d.ts +316 -0
  124. package/dist-vue/packages/models/src/schema/Organization.d.ts +142 -2
  125. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +20 -0
  126. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +20 -0
  127. package/dist-vue/packages/models/src/schema/UserOverview.d.ts +41 -0
  128. package/dist-vue/packages/models/src/schema/constants.d.ts +56 -91
  129. package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
  130. package/dist-vue/style.css +1 -1
  131. package/package.json +1 -1
  132. package/dist/_chunks/Agent-Su_LDF9_.js.map +0 -1
  133. package/dist/_chunks/Document-DecVclEe.js.map +0 -1
  134. package/dist/_chunks/Media-C6SOQfJZ.js +0 -122
  135. package/dist/_chunks/Media-C6SOQfJZ.js.map +0 -1
  136. package/dist/_chunks/PkStreamingMarkdown-CwqsJnJJ.js.map +0 -1
  137. package/dist/_chunks/PkToolShowForm-DbJHMDbt.js.map +0 -1
  138. package/dist/_chunks/browser-NgY6LXg-.js.map +0 -1
  139. package/dist-vue/_chunks/Agent-C8BsTAxk.js.map +0 -1
  140. package/dist-vue/_chunks/Document-CaUfI_SZ.js.map +0 -1
  141. package/dist-vue/_chunks/PkChatbot-BPKSPIeC.js.map +0 -1
  142. package/dist-vue/_chunks/PkChatbotError-CBP2mf-n.js.map +0 -1
  143. package/dist-vue/_chunks/PkChatbotInput-JnHaRlfk.js.map +0 -1
  144. package/dist-vue/_chunks/PkChatbotMessages-DAlkoMkY.js.map +0 -1
  145. package/dist-vue/_chunks/PkStreamingMarkdown-D8_LwZMR.js.map +0 -1
  146. package/dist-vue/_chunks/PkToolShowDiagram-dwCVZ1up.js.map +0 -1
  147. package/dist-vue/_chunks/PkToolShowForm-CO5A_j9L.js.map +0 -1
  148. package/dist-vue/_chunks/PkUrl-xUBKVJCv.js.map +0 -1
  149. package/dist-vue/_chunks/createChatbotApiClient-D9f69brW.js.map +0 -1
  150. package/dist-vue/_chunks/useChatbotStore-9Cw_oR6J.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"PkToolShowEmail-CavhsPvi.js","names":["$t"],"sources":["../../../../packages/components/src/chat/PkToolShowEmail.vue","../../../../packages/components/src/chat/PkToolShowEmail.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { useShortUrlResolver } from 'composables'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n subject: string\n body: string\n }\n }\n return part\n })\n\n // Emails leave the app (mailto/webmail/clipboard), so expand short urls to\n // their real target rather than keeping the fragile `/api/r/` redirect.\n const { resolveText } = useShortUrlResolver()\n const subject = resolveText(() => toolPart.value.input?.subject)\n const body = resolveText(() => toolPart.value.input?.body)\n\n const openInMailApp = () => {\n if (!toolPart.value.input) {\n return\n }\n const mailtoLink = `mailto:?subject=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(mailtoLink)\n }\n\n const openInOutlook = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://outlook.office.com/mail/deeplink/compose?to=&subject=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInGmail = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://mail.google.com/mail/u/0/?tf=cm&to=&su=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInYahooMail = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://compose.mail.yahoo.com/?to=&subject=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:mail-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.email') }}\n </strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copy(`${subject}\\n\\n${body}`)\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:mail-send-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.send')\" />\n <template #items>\n <VvDropdownAction @click=\"openInOutlook\">\n <VvIcon name=\"mdi:outlook\" />\n {{ $t('action.openInOutlook') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInGmail\">\n <VvIcon name=\"mdi:gmail\" />\n {{ $t('action.openInGmail') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInYahooMail\">\n <VvIcon name=\"mdi:yahoo\" />\n {{ $t('action.openInYahooMail') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInMailApp\">\n <VvIcon name=\"ri:mail-open-line\" />\n {{ $t('action.openInMailApp') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"border-b border-surface-3 p-sm\">\n <div class=\"text-12 text-word-4 mb-4\">\n {{ $t('label.subject') }}\n </div>\n <div class=\"text-word-2 font-semibold\">\n {{ subject }}\n </div>\n </div>\n <div class=\"p-sm\">\n <div class=\"text-12 text-word-4 mb-4\">\n {{ $t('label.body') }}\n </div>\n <pre class=\"text-word-2 whitespace-pre-wrap break-words\">{{\n body\n }}</pre>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { useShortUrlResolver } from 'composables'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n subject: string\n body: string\n }\n }\n return part\n })\n\n // Emails leave the app (mailto/webmail/clipboard), so expand short urls to\n // their real target rather than keeping the fragile `/api/r/` redirect.\n const { resolveText } = useShortUrlResolver()\n const subject = resolveText(() => toolPart.value.input?.subject)\n const body = resolveText(() => toolPart.value.input?.body)\n\n const openInMailApp = () => {\n if (!toolPart.value.input) {\n return\n }\n const mailtoLink = `mailto:?subject=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(mailtoLink)\n }\n\n const openInOutlook = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://outlook.office.com/mail/deeplink/compose?to=&subject=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInGmail = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://mail.google.com/mail/u/0/?tf=cm&to=&su=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInYahooMail = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://compose.mail.yahoo.com/?to=&subject=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:mail-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.email') }}\n </strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copy(`${subject}\\n\\n${body}`)\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:mail-send-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.send')\" />\n <template #items>\n <VvDropdownAction @click=\"openInOutlook\">\n <VvIcon name=\"mdi:outlook\" />\n {{ $t('action.openInOutlook') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInGmail\">\n <VvIcon name=\"mdi:gmail\" />\n {{ $t('action.openInGmail') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInYahooMail\">\n <VvIcon name=\"mdi:yahoo\" />\n {{ $t('action.openInYahooMail') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInMailApp\">\n <VvIcon name=\"ri:mail-open-line\" />\n {{ $t('action.openInMailApp') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"border-b border-surface-3 p-sm\">\n <div class=\"text-12 text-word-4 mb-4\">\n {{ $t('label.subject') }}\n </div>\n <div class=\"text-word-2 font-semibold\">\n {{ subject }}\n </div>\n </div>\n <div class=\"p-sm\">\n <div class=\"text-12 text-word-4 mb-4\">\n {{ $t('label.body') }}\n </div>\n <pre class=\"text-word-2 whitespace-pre-wrap break-words\">{{\n body\n }}</pre>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;EAKI,IAAM,IAAQ,GAIR,EAAE,SAAM,cAAW,EAAa,GAEhC,IAAW,QACA,EAAM,IAOtB,GAIK,EAAE,mBAAgB,EAAoB,GACtC,IA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AAA,GAAE,YAAA,CAAA,GAAA,CAAA,GAET,EAEQ,OAFR,GAEQ,EADJ,EAAA,CAAA,CAAI,GAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"PkToolShowEmail-DpC517Vn.js","names":["$t"],"sources":["../../../../packages/components/src/chat/PkToolShowEmail.vue","../../../../packages/components/src/chat/PkToolShowEmail.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { useShortUrlResolver } from 'composables'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n subject: string\n body: string\n }\n }\n return part\n })\n\n // Emails leave the app (mailto/webmail/clipboard), so expand short urls to\n // their real target rather than keeping the fragile `/api/r/` redirect.\n const { resolveText } = useShortUrlResolver()\n const subject = resolveText(() => toolPart.value.input?.subject)\n const body = resolveText(() => toolPart.value.input?.body)\n\n const openInMailApp = () => {\n if (!toolPart.value.input) {\n return\n }\n const mailtoLink = `mailto:?subject=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(mailtoLink)\n }\n\n const openInOutlook = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://outlook.office.com/mail/deeplink/compose?to=&subject=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInGmail = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://mail.google.com/mail/u/0/?tf=cm&to=&su=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInYahooMail = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://compose.mail.yahoo.com/?to=&subject=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:mail-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.email') }}\n </strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copy(`${subject}\\n\\n${body}`)\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:mail-send-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.send')\" />\n <template #items>\n <VvDropdownAction @click=\"openInOutlook\">\n <VvIcon name=\"mdi:outlook\" />\n {{ $t('action.openInOutlook') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInGmail\">\n <VvIcon name=\"mdi:gmail\" />\n {{ $t('action.openInGmail') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInYahooMail\">\n <VvIcon name=\"mdi:yahoo\" />\n {{ $t('action.openInYahooMail') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInMailApp\">\n <VvIcon name=\"ri:mail-open-line\" />\n {{ $t('action.openInMailApp') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"border-b border-surface-3 p-sm\">\n <div class=\"text-12 text-word-4 mb-4\">\n {{ $t('label.subject') }}\n </div>\n <div class=\"text-word-2 font-semibold\">\n {{ subject }}\n </div>\n </div>\n <div class=\"p-sm\">\n <div class=\"text-12 text-word-4 mb-4\">\n {{ $t('label.body') }}\n </div>\n <pre class=\"text-word-2 whitespace-pre-wrap break-words\">{{\n body\n }}</pre>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { useShortUrlResolver } from 'composables'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n subject: string\n body: string\n }\n }\n return part\n })\n\n // Emails leave the app (mailto/webmail/clipboard), so expand short urls to\n // their real target rather than keeping the fragile `/api/r/` redirect.\n const { resolveText } = useShortUrlResolver()\n const subject = resolveText(() => toolPart.value.input?.subject)\n const body = resolveText(() => toolPart.value.input?.body)\n\n const openInMailApp = () => {\n if (!toolPart.value.input) {\n return\n }\n const mailtoLink = `mailto:?subject=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(mailtoLink)\n }\n\n const openInOutlook = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://outlook.office.com/mail/deeplink/compose?to=&subject=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInGmail = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://mail.google.com/mail/u/0/?tf=cm&to=&su=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInYahooMail = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://compose.mail.yahoo.com/?to=&subject=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:mail-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.email') }}\n </strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copy(`${subject}\\n\\n${body}`)\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:mail-send-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.send')\" />\n <template #items>\n <VvDropdownAction @click=\"openInOutlook\">\n <VvIcon name=\"mdi:outlook\" />\n {{ $t('action.openInOutlook') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInGmail\">\n <VvIcon name=\"mdi:gmail\" />\n {{ $t('action.openInGmail') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInYahooMail\">\n <VvIcon name=\"mdi:yahoo\" />\n {{ $t('action.openInYahooMail') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInMailApp\">\n <VvIcon name=\"ri:mail-open-line\" />\n {{ $t('action.openInMailApp') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"border-b border-surface-3 p-sm\">\n <div class=\"text-12 text-word-4 mb-4\">\n {{ $t('label.subject') }}\n </div>\n <div class=\"text-word-2 font-semibold\">\n {{ subject }}\n </div>\n </div>\n <div class=\"p-sm\">\n <div class=\"text-12 text-word-4 mb-4\">\n {{ $t('label.body') }}\n </div>\n <pre class=\"text-word-2 whitespace-pre-wrap break-words\">{{\n body\n }}</pre>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;EAKI,IAAM,IAAQ,GAIR,EAAE,SAAM,cAAW,EAAa,GAEhC,IAAW,QACA,EAAM,IAOtB,GAIK,EAAE,mBAAgB,EAAoB,GACtC,IAAU,QAAkB,EAAS,MAAM,OAAO,OAAO,GACzD,IAAO,QAAkB,EAAS,MAAM,OAAO,IAAI,GAEnD,UAAsB;GACxB,IAAI,CAAC,EAAS,MAAM,OAChB;GAEJ,IAAM,I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from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { D as t } from "./Agent-C8BsTAxk.js";
3
- import { t as n } from "./PkStreamingMarkdown-D8_LwZMR.js";
2
+ import { D as t } from "./Agent-De2gFNjR.js";
3
+ import { t as n } from "./PkStreamingMarkdown-DIaZEedG.js";
4
4
  import { a as r, i } from "./utils-Coqik0XI.js";
5
5
  import { VvButton as a, VvCheckbox as o, VvCheckboxGroup as s, VvIcon as ee, VvInputText as te, VvRadio as c, VvRadioGroup as l } from "@volverjs/ui-vue/components";
6
6
  import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createSlots as g, createTextVNode as _, createVNode as v, defineComponent as y, mergeModels as b, mergeProps as x, normalizeClass as ne, normalizeStyle as re, openBlock as S, reactive as ie, ref as C, renderList as w, renderSlot as T, toDisplayString as E, unref as D, useId as O, useModel as k, watch as A, withCtx as j, withKeys as ae, withModifiers as M } from "vue";
@@ -362,4 +362,4 @@ var N = /* @__PURE__ */ y({
362
362
  //#endregion
363
363
  export { N as i, z as n, P as r, B as t };
364
364
 
365
- //# sourceMappingURL=PkToolShowForm-CO5A_j9L.js.map
365
+ //# sourceMappingURL=PkToolShowForm-CIZpfAGK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PkToolShowForm-CIZpfAGK.js","names":[],"sources":["../../../../packages/components/src/PkEditorRadioButtons.vue","../../../../packages/components/src/PkEditorRadioButtons.vue","../../../../packages/components/src/PkEditorCheckboxButtons.vue","../../../../packages/components/src/PkEditorCheckboxButtons.vue","../../../../packages/components/src/chat/PkToolShowForm.vue","../../../../packages/components/src/chat/PkToolShowForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import type { Option } from '@volverjs/ui-vue'\n import { computed, useId } from 'vue'\n\n const props = defineProps<{\n name: string\n label?: string\n hintLabel?: string\n invalid?: boolean\n invalidLabel?: string | string[]\n required?: boolean\n options: Option[]\n readonly?: boolean\n disabled?: boolean\n modifiers?: string | string[]\n /**\n * Render the options as one segmented control (a recessed track with\n * the chosen option raised) instead of a row of boxed cards. Suits a\n * choice between a few short named states, such as a level or a mode.\n */\n segmented?: boolean\n }>()\n\n const modelValue = defineModel<\n string | number | boolean | symbol | unknown[] | undefined\n >({ default: undefined })\n\n // Native radios group by their name attribute across the whole document, so\n // two instances sharing one name become a single group: the browser unchecks\n // the other instance's inputs and Vue never puts them back, because its own\n // model did not change. It happened with \"theme\", offered by the profile\n // menu and the agent settings panel at the same time, and it can happen to\n // any two tool forms with the same step id. Scope the name to the instance.\n const uid = useId()\n const groupName = computed(() => `${props.name}-${uid}`)\n\n const radioModifiers = computed(() => {\n const toReturn = props.modifiers\n ? Array.isArray(props.modifiers)\n ? props.modifiers\n : [props.modifiers]\n : []\n return [...toReturn, props.segmented ? 'segment' : 'button']\n })\n</script>\n\n<template>\n <VvRadioGroup\n v-model=\"modelValue\"\n :name=\"groupName\"\n :label\n :hint-label=\"hintLabel\"\n :invalid\n :invalid-label=\"invalidLabel\"\n :modifiers=\"segmented ? 'segmented' : 'buttons'\">\n <VvRadio\n v-for=\"(option, key) in options\"\n :key\n :name=\"groupName\"\n :required\n :readonly\n :disabled\n :value=\"option.value\"\n :modifiers=\"radioModifiers\">\n <slot :name=\"option.value\" v-bind=\"{ option }\">\n {{ option.label }}\n </slot>\n </VvRadio>\n </VvRadioGroup>\n</template>\n","<script setup lang=\"ts\">\n import type { Option } from '@volverjs/ui-vue'\n import { computed, useId } from 'vue'\n\n const props = defineProps<{\n name: string\n label?: string\n hintLabel?: string\n invalid?: boolean\n invalidLabel?: string | string[]\n required?: boolean\n options: Option[]\n readonly?: boolean\n disabled?: boolean\n modifiers?: string | string[]\n /**\n * Render the options as one segmented control (a recessed track with\n * the chosen option raised) instead of a row of boxed cards. Suits a\n * choice between a few short named states, such as a level or a mode.\n */\n segmented?: boolean\n }>()\n\n const modelValue = defineModel<\n string | number | boolean | symbol | unknown[] | undefined\n >({ default: undefined })\n\n // Native radios group by their name attribute across the whole document, so\n // two instances sharing one name become a single group: the browser unchecks\n // the other instance's inputs and Vue never puts them back, because its own\n // model did not change. It happened with \"theme\", offered by the profile\n // menu and the agent settings panel at the same time, and it can happen to\n // any two tool forms with the same step id. Scope the name to the instance.\n const uid = useId()\n const groupName = computed(() => `${props.name}-${uid}`)\n\n const radioModifiers = computed(() => {\n const toReturn = props.modifiers\n ? Array.isArray(props.modifiers)\n ? props.modifiers\n : [props.modifiers]\n : []\n return [...toReturn, props.segmented ? 'segment' : 'button']\n })\n</script>\n\n<template>\n <VvRadioGroup\n v-model=\"modelValue\"\n :name=\"groupName\"\n :label\n :hint-label=\"hintLabel\"\n :invalid\n :invalid-label=\"invalidLabel\"\n :modifiers=\"segmented ? 'segmented' : 'buttons'\">\n <VvRadio\n v-for=\"(option, key) in options\"\n :key\n :name=\"groupName\"\n :required\n :readonly\n :disabled\n :value=\"option.value\"\n :modifiers=\"radioModifiers\">\n <slot :name=\"option.value\" v-bind=\"{ option }\">\n {{ option.label }}\n </slot>\n </VvRadio>\n </VvRadioGroup>\n</template>\n","<script setup lang=\"ts\">\n import type { Option } from '@volverjs/ui-vue'\n\n defineProps<{\n name: string\n required?: boolean\n options: Option[]\n readonly?: boolean\n disabled?: boolean\n }>()\n\n const modelValue = defineModel<unknown[] | undefined>({\n default: undefined,\n })\n</script>\n\n<template>\n <VvCheckboxGroup v-model=\"modelValue\" :name modifiers=\"buttons\">\n <VvCheckbox\n v-for=\"(option, key) in options\"\n :key\n :name\n :required\n :readonly\n :disabled\n :value=\"option.value\"\n modifiers=\"button\">\n <slot :name=\"String(option.value)\" v-bind=\"{ option }\">\n {{ option.label }}\n </slot>\n </VvCheckbox>\n </VvCheckboxGroup>\n</template>\n","<script setup lang=\"ts\">\n import type { Option } from '@volverjs/ui-vue'\n\n defineProps<{\n name: string\n required?: boolean\n options: Option[]\n readonly?: boolean\n disabled?: boolean\n }>()\n\n const modelValue = defineModel<unknown[] | undefined>({\n default: undefined,\n })\n</script>\n\n<template>\n <VvCheckboxGroup v-model=\"modelValue\" :name modifiers=\"buttons\">\n <VvCheckbox\n v-for=\"(option, key) in options\"\n :key\n :name\n :required\n :readonly\n :disabled\n :value=\"option.value\"\n modifiers=\"button\">\n <slot :name=\"String(option.value)\" v-bind=\"{ option }\">\n {{ option.label }}\n </slot>\n </VvCheckbox>\n </VvCheckboxGroup>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, reactive, watch } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { isVoiceRenderAck } from 'models'\n import { formAnswerSlots, formStepOptions } from './utils'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkEditorRadioButtons from '../PkEditorRadioButtons.vue'\n import PkEditorCheckboxButtons from '../PkEditorCheckboxButtons.vue'\n\n // --- Types ---\n\n interface FormOption {\n label: string\n description?: string\n }\n\n interface FormStep {\n id: string\n question: string\n message?: string\n type?: 'text' | 'number' | 'date'\n options?: FormOption[]\n multiSelect?: boolean\n allowFreeformInput?: boolean\n placeholder?: string\n }\n\n interface FormAnswer {\n id: string\n value: string | string[] | number | null\n }\n\n interface ToolPartShape {\n state?: 'input-available' | 'output-available' | 'output-error'\n toolCallId?: string\n // AI SDK v5 encodes the tool name in `type` (e.g. 'tool-showMultipleChoice').\n // `toolName` is kept for backward compatibility but is normally absent.\n type?: string\n toolName?: string\n input?: {\n title?: string\n steps?: FormStep[]\n // Legacy showMultipleChoice fields\n question?: string\n options?: (string | FormOption)[]\n }\n // The web card submits `{ answers: [...] }`; the platform channels\n // (Teams modal) submit a flat record keyed by step id.\n output?: string | { answers: FormAnswer[] } | Record<string, unknown>\n }\n\n type AnswerValue = string | string[] | number | null\n\n // --- Props & Emits ---\n\n const props = defineProps<{\n part: unknown\n allowCustomAnswer?: boolean\n /**\n * Answered during a call. Nothing in the part says so (the answer went\n * to the agent as speech, not to the tool call), so the surface that\n * sent it is the only one that knows, and without it the same form\n * could be submitted again and again.\n */\n answered?: boolean\n }>()\n\n const emit = defineEmits<{\n select: [answer: string | { answers: FormAnswer[] }]\n }>()\n\n const { t: $t, d: $d } = useI18n({ useScope: 'global' })\n\n // --- Parsed tool part ---\n\n const toolPart = computed(\n () => JSON.parse(JSON.stringify(props.part)) as ToolPartShape,\n )\n\n const isLegacy = computed(\n () =>\n toolPart.value.toolName === 'showMultipleChoice' ||\n toolPart.value.type === 'tool-showMultipleChoice',\n )\n\n /**\n * A form drawn during a CALL is already \"answered\" as far as the tool loop\n * is concerned: the turn could not wait for it, so the backend closed it\n * with a note saying the widget was drawn (see `isVoiceRenderAck`). That\n * note is not an answer, and the caller still has to give one.\n */\n const isRenderAck = computed(() => isVoiceRenderAck(toolPart.value.output))\n\n const isInteractive = computed(\n () =>\n !props.answered &&\n (toolPart.value.state === 'input-available' || isRenderAck.value),\n )\n\n /** Single-step with no custom-answer and no freeform → auto-submit on option pick */\n const isAutoSubmitStep = computed(() => {\n const step = currentStep.value\n if (!step) {\n return false\n }\n return (\n steps.value.length === 1 &&\n !step.allowFreeformInput &&\n !props.allowCustomAnswer\n )\n })\n\n /** Legacy tool should auto-submit on option pick regardless of allowCustomAnswer */\n const isLegacyAutoSubmit = computed(\n () =>\n isLegacy.value &&\n steps.value.length === 1 &&\n !currentStep.value?.multiSelect,\n )\n\n /**\n * True only for the steps that send themselves as soon as an option is\n * picked: the single case where the footer button would be redundant.\n * Every other shape needs it, single-step forms included: with\n * `allowFreeformInput` (or `allowCustomAnswer`) the radio pick no longer\n * auto-submits, so without the footer the user was left with a chosen\n * option and no way to send it.\n */\n const isSelfSubmitting = computed(\n () =>\n Boolean(currentStep.value?.options) &&\n !currentStep.value?.multiSelect &&\n (isAutoSubmitStep.value || isLegacyAutoSubmit.value),\n )\n\n // --- Steps ---\n\n const steps = computed<FormStep[]>(() => {\n const input = toolPart.value.input\n if (input?.steps?.length) {\n return input.steps\n }\n // Legacy showMultipleChoice → normalize into a single step\n if (input?.question && input?.options) {\n return [\n {\n id: 'legacy',\n question: input.question,\n options: input.options.map((o) =>\n typeof o === 'string' ? { label: o } : o,\n ),\n },\n ]\n }\n return []\n })\n\n /**\n * The reason the card has nothing to draw. A call the SDK rejected keeps\n * `state: 'output-error'` and moves the arguments it could not validate to\n * `rawInput`, so `input` is empty and there are no steps: without this the\n * component rendered NOTHING, and the user was left with a question that\n * had been announced and never appeared.\n */\n const hasFailed = computed(\n () => toolPart.value.state === 'output-error' && !steps.value.length,\n )\n\n // --- Navigation state ---\n\n const currentStepIndex = ref(0)\n const currentStep = computed(() => steps.value[currentStepIndex.value])\n const canGoBack = computed(() => currentStepIndex.value > 0)\n const canGoNext = computed(\n () => currentStepIndex.value < steps.value.length - 1,\n )\n const isMultiStep = computed(() => steps.value.length > 1)\n\n const progress = computed(() => {\n if (!isMultiStep.value) {\n return null\n }\n return Math.round(\n ((currentStepIndex.value + 1) / steps.value.length) * 100,\n )\n })\n\n // --- Answers ---\n\n /**\n * One slot PER STEP, keyed by position and not by step id: the ids come\n * from the model and nothing enforces they are unique, and keyed by id two\n * steps sharing one collapsed onto a single answer. See `formAnswerSlots`.\n */\n const answers = reactive<Record<number, AnswerValue>>({})\n const customAnswer = ref('')\n\n // The freeform field belongs to the step showing it: text left behind\n // (unsubmitted, or arriving from a late input update) must not follow the\n // user to the next or previous question.\n watch(currentStepIndex, () => {\n customAnswer.value = ''\n })\n\n // Single scalar answer shared by radio buttons and freeform text/number/date inputs.\n const scalarValue = computed<string | number | undefined>({\n get: () => {\n const val = currentStep.value\n ? answers[currentStepIndex.value]\n : undefined\n if (val == null || Array.isArray(val)) {\n return undefined\n }\n return val\n },\n set: (val) => {\n if (currentStep.value) {\n answers[currentStepIndex.value] = val ?? null\n }\n },\n })\n\n const activeCheckboxValue = computed<unknown[] | undefined>({\n get: () => {\n const val = currentStep.value\n ? answers[currentStepIndex.value]\n : undefined\n return Array.isArray(val) ? val : []\n },\n set: (val) => {\n if (currentStep.value) {\n answers[currentStepIndex.value] = (val as string[]) ?? []\n }\n },\n })\n\n // --- Initialize answers from existing output ---\n\n /** The `{ answers: [...] }` list, when the output carries one. */\n function outputAnswers(output: ToolPartShape['output']) {\n if (!output || typeof output === 'string') {\n return undefined\n }\n const list = (output as { answers?: unknown }).answers\n return Array.isArray(list) ? (list as FormAnswer[]) : undefined\n }\n\n watch(\n () => toolPart.value.output,\n (output) => {\n if (!output || isVoiceRenderAck(output)) {\n return\n }\n // Every shape an answered form comes back in (the web card's list,\n // a legacy plain string, the flat record a platform channel posts)\n // lands on the same per-position slots: see `formAnswerSlots`.\n Object.assign(\n answers,\n formAnswerSlots(steps.value, output) as Record<\n number,\n AnswerValue\n >,\n )\n },\n { immediate: true },\n )\n\n // --- Restore custom answer from output when it doesn't match any option ---\n\n const normalizedOutput = computed(() => {\n const out = toolPart.value.output\n if (!out || isVoiceRenderAck(out)) {\n return undefined\n }\n if (typeof out === 'string') {\n return out\n }\n const list = outputAnswers(out)\n if (list?.length === 1) {\n const val = list[0].value\n return Array.isArray(val) ? val.join(', ') : String(val)\n }\n return undefined\n })\n\n watch(\n normalizedOutput,\n (value) => {\n if (!value || !currentStep.value) {\n return\n }\n const optionLabels = (currentStep.value.options ?? []).map(\n (o) => o.label,\n )\n if (!optionLabels.includes(value)) {\n customAnswer.value = value\n }\n },\n { immediate: true },\n )\n\n // --- Option mapping for radio/checkbox components ---\n\n const radioOptions = computed(() => formStepOptions(currentStep.value))\n\n // --- Navigation & Submission ---\n\n /** Footer button, and Enter on a pure freeform step. */\n function goNext() {\n // A typed freeform answer wins over the picked option: it is the more\n // recent intent, and the footer button is now the visible way to send\n // it (the freeform field only submits on Enter).\n if (customAnswer.value.trim()) {\n submitCustomAnswer()\n return\n }\n if (canGoNext.value) {\n currentStepIndex.value++\n } else {\n submitForm()\n }\n }\n\n function goBack() {\n if (canGoBack.value) {\n currentStepIndex.value--\n }\n }\n\n function submitForm() {\n if (!isInteractive.value) {\n return\n }\n\n const finalAnswers: FormAnswer[] = steps.value.map((step, index) => ({\n id: step.id,\n value: answers[index] ?? null,\n }))\n\n // Legacy backward compatibility: single-step, single-select → return plain string\n if (\n isLegacyAutoSubmit.value &&\n !currentStep.value?.allowFreeformInput\n ) {\n const val = finalAnswers[0].value\n emit('select', Array.isArray(val) ? val[0] : (val as string))\n } else {\n emit('select', { answers: finalAnswers })\n }\n }\n\n /** Enter inside the freeform field shown alongside the options. */\n function submitCustomAnswer() {\n const value = customAnswer.value.trim()\n if (!value) {\n return\n }\n\n answers[currentStepIndex.value] = value\n // Cleared before navigating: `goNext()` reads it back to route a typed\n // answer here, so leaving it set would recurse.\n customAnswer.value = ''\n if (steps.value.length === 1) {\n submitForm()\n } else {\n goNext()\n }\n }\n\n function onRadioChange() {\n if (!isInteractive.value) {\n return\n }\n if (isAutoSubmitStep.value || isLegacyAutoSubmit.value) {\n submitForm()\n }\n }\n\n // --- Summary helpers ---\n\n function getSummaryValue(step: FormStep, index: number) {\n const val = answers[index]\n if (val == null) {\n return '—'\n }\n if (Array.isArray(val)) {\n return val.join(', ')\n }\n if (step.type === 'date') {\n return $d(new Date(val), 'short')\n }\n return val\n }\n</script>\n\n<template>\n <div\n v-if=\"hasFailed\"\n class=\"text-12 text-danger flex items-center gap-6 py-8\">\n <span class=\"i-vv-alert-circle text-16 shrink-0\" />\n <span>{{ $t('message.formRenderError') }}</span>\n </div>\n <div\n v-else-if=\"steps.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden flex flex-col bg-surface\">\n <!-- Header -->\n <div\n v-if=\"toolPart.input?.title || (isInteractive && steps.length > 1)\"\n class=\"text-12 border-b border-surface-3 text-word-3 bg-surface-1\">\n <div\n v-if=\"toolPart.input?.title\"\n class=\"px-sm py-10 font-bold\"\n :class=\"{\n 'border-b border-surface-3':\n isInteractive && steps.length > 1,\n }\">\n {{ toolPart.input?.title }}\n </div>\n <!-- Progress for multi-step -->\n <div\n v-if=\"isInteractive && steps.length > 1\"\n class=\"flex flex-col gap-4 p-sm\">\n <div class=\"flex justify-between text-10 text-word-3\">\n <span>\n {{\n $t('showForm.step', {\n current: currentStepIndex + 1,\n total: steps.length,\n })\n }}\n </span>\n <span>{{ progress }}%</span>\n </div>\n <div class=\"h-4 bg-surface-3 rounded-full overflow-hidden\">\n <div\n class=\"h-full bg-word-4 transition-all duration-300\"\n :style=\"{ width: `${progress}%` }\"></div>\n </div>\n </div>\n </div>\n\n <!-- Input Available State -->\n <template v-if=\"isInteractive\">\n <!-- Current Step Content -->\n <div class=\"px-sm py-16 flex flex-col gap-12\">\n <div class=\"leading-normal text-12\">\n <strong class=\"font-semibold\">\n {{ currentStep.question }}\n </strong>\n <PkStreamingMarkdown\n v-if=\"currentStep.message\"\n :markdown=\"currentStep.message\"\n class=\"text-word-2 mt-4\" />\n </div>\n\n <!-- Checkbox list for multi-select -->\n <PkEditorCheckboxButtons\n v-if=\"currentStep.options && currentStep.multiSelect\"\n v-model=\"activeCheckboxValue\"\n :name=\"currentStep.id\"\n :options=\"radioOptions\"\n :readonly=\"!isInteractive\"\n class=\"mb-0\"\n vertical>\n <template\n v-for=\"option in radioOptions\"\n :key=\"option.value\"\n #[option.value]>\n <!-- Shared option layout: label + optional description -->\n <div class=\"text-12\">\n <div class=\"font-semibold\">{{ option.label }}</div>\n <div v-if=\"option.description\" class=\"text-word-3\">\n {{ option.description }}\n </div>\n </div>\n </template>\n </PkEditorCheckboxButtons>\n\n <!-- Radio buttons for single-select -->\n <PkEditorRadioButtons\n v-else-if=\"currentStep.options && !currentStep.multiSelect\"\n v-model=\"scalarValue\"\n :name=\"currentStep.id\"\n :options=\"radioOptions\"\n :readonly=\"!isInteractive\"\n vertical\n class=\"mb-0\"\n @update:model-value=\"onRadioChange\">\n <template\n v-for=\"option in radioOptions\"\n :key=\"option.value\"\n #[option.value]>\n <!-- Shared option layout: label + optional description -->\n <div class=\"text-12\">\n <div class=\"font-semibold\">{{ option.label }}</div>\n <div v-if=\"option.description\" class=\"text-word-3\">\n {{ option.description }}\n </div>\n </div>\n </template>\n </PkEditorRadioButtons>\n\n <!-- Pure Freeform Input (text, number, date) -->\n <div\n v-else-if=\"!currentStep.options\"\n class=\"flex flex-col gap-6 w-full\">\n <VvInputText\n :key=\"currentStep.id\"\n v-model=\"scalarValue\"\n :placeholder=\"\n currentStep.placeholder || $t('placeholder.insert')\n \"\n :type=\"currentStep.type\"\n class=\"w-full\"\n :name=\"currentStep.id\"\n modifiers=\"compact\"\n :disabled=\"!isInteractive\"\n @keyup.enter=\"goNext\" />\n </div>\n </div>\n\n <!-- Custom footer freeform input (shown alongside options when allowFreeformInput) -->\n <div\n v-if=\"currentStep.allowFreeformInput && currentStep.options\"\n class=\"px-sm pb-sm border-t border-surface-3\">\n <form\n class=\"flex gap-xs pt-sm\"\n @submit.prevent=\"submitCustomAnswer\">\n <VvInputText\n :key=\"`${currentStep.id}-custom`\"\n v-model=\"customAnswer\"\n class=\"flex-1\"\n :name=\"`${currentStep.id}-custom`\"\n modifiers=\"compact\"\n :disabled=\"!isInteractive\"\n :placeholder=\"\n currentStep.placeholder ||\n $t('showForm.otherPlaceholder')\n \" />\n </form>\n </div>\n\n <!-- Footer navigation: shown for every step that does not submit\n itself on option pick (see `isSelfSubmitting`). -->\n <div\n v-if=\"!isSelfSubmitting\"\n class=\"px-sm py-10 bg-surface border-t border-surface-3 flex justify-between gap-12\">\n <VvButton\n v-if=\"canGoBack\"\n modifiers=\"action-quiet\"\n icon=\"ri:arrow-left-s-line\"\n :label=\"$t('action.back')\"\n @click.stop=\"goBack\" />\n <div v-else></div>\n\n <VvButton\n :modifiers=\"canGoNext ? 'action-quiet' : 'action-primary'\"\n :icon=\"\n canGoNext\n ? 'ri:arrow-right-s-line'\n : 'ri:send-plane-2-line'\n \"\n icon-position=\"right\"\n :label=\"canGoNext ? $t('action.next') : $t('action.submit')\"\n @click.stop=\"goNext\" />\n </div>\n </template>\n\n <!-- Output Available State (Multi-step Summary) -->\n <template v-else>\n <div class=\"px-sm py-12 bg-surface space-y-10\">\n <ul class=\"flex flex-col gap-8\">\n <li\n v-for=\"(step, index) in steps\"\n :key=\"index\"\n class=\"leading-normal\">\n <div class=\"text-12 text-word-3\">\n {{ step.question }}\n </div>\n <span class=\"text-12 text-word-2 font-semibold\">\n {{ getSummaryValue(step, index) }}\n </span>\n </li>\n </ul>\n </div>\n <div\n class=\"px-sm py-12 bg-surface border-t border-surface-3 flex items-center gap-10\">\n <VvIcon name=\"ri:check-line\" class=\"text-16 text-word-3\" />\n <div class=\"flex flex-col\">\n <span class=\"font-medium text-12 text-word-1 leading-tight\">\n {{ $t('showForm.completed') }}\n </span>\n </div>\n </div>\n </template>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, reactive, watch } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { isVoiceRenderAck } from 'models'\n import { formAnswerSlots, formStepOptions } from './utils'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkEditorRadioButtons from '../PkEditorRadioButtons.vue'\n import PkEditorCheckboxButtons from '../PkEditorCheckboxButtons.vue'\n\n // --- Types ---\n\n interface FormOption {\n label: string\n description?: string\n }\n\n interface FormStep {\n id: string\n question: string\n message?: string\n type?: 'text' | 'number' | 'date'\n options?: FormOption[]\n multiSelect?: boolean\n allowFreeformInput?: boolean\n placeholder?: string\n }\n\n interface FormAnswer {\n id: string\n value: string | string[] | number | null\n }\n\n interface ToolPartShape {\n state?: 'input-available' | 'output-available' | 'output-error'\n toolCallId?: string\n // AI SDK v5 encodes the tool name in `type` (e.g. 'tool-showMultipleChoice').\n // `toolName` is kept for backward compatibility but is normally absent.\n type?: string\n toolName?: string\n input?: {\n title?: string\n steps?: FormStep[]\n // Legacy showMultipleChoice fields\n question?: string\n options?: (string | FormOption)[]\n }\n // The web card submits `{ answers: [...] }`; the platform channels\n // (Teams modal) submit a flat record keyed by step id.\n output?: string | { answers: FormAnswer[] } | Record<string, unknown>\n }\n\n type AnswerValue = string | string[] | number | null\n\n // --- Props & Emits ---\n\n const props = defineProps<{\n part: unknown\n allowCustomAnswer?: boolean\n /**\n * Answered during a call. Nothing in the part says so (the answer went\n * to the agent as speech, not to the tool call), so the surface that\n * sent it is the only one that knows, and without it the same form\n * could be submitted again and again.\n */\n answered?: boolean\n }>()\n\n const emit = defineEmits<{\n select: [answer: string | { answers: FormAnswer[] }]\n }>()\n\n const { t: $t, d: $d } = useI18n({ useScope: 'global' })\n\n // --- Parsed tool part ---\n\n const toolPart = computed(\n () => JSON.parse(JSON.stringify(props.part)) as ToolPartShape,\n )\n\n const isLegacy = computed(\n () =>\n toolPart.value.toolName === 'showMultipleChoice' ||\n toolPart.value.type === 'tool-showMultipleChoice',\n )\n\n /**\n * A form drawn during a CALL is already \"answered\" as far as the tool loop\n * is concerned: the turn could not wait for it, so the backend closed it\n * with a note saying the widget was drawn (see `isVoiceRenderAck`). That\n * note is not an answer, and the caller still has to give one.\n */\n const isRenderAck = computed(() => isVoiceRenderAck(toolPart.value.output))\n\n const isInteractive = computed(\n () =>\n !props.answered &&\n (toolPart.value.state === 'input-available' || isRenderAck.value),\n )\n\n /** Single-step with no custom-answer and no freeform → auto-submit on option pick */\n const isAutoSubmitStep = computed(() => {\n const step = currentStep.value\n if (!step) {\n return false\n }\n return (\n steps.value.length === 1 &&\n !step.allowFreeformInput &&\n !props.allowCustomAnswer\n )\n })\n\n /** Legacy tool should auto-submit on option pick regardless of allowCustomAnswer */\n const isLegacyAutoSubmit = computed(\n () =>\n isLegacy.value &&\n steps.value.length === 1 &&\n !currentStep.value?.multiSelect,\n )\n\n /**\n * True only for the steps that send themselves as soon as an option is\n * picked: the single case where the footer button would be redundant.\n * Every other shape needs it, single-step forms included: with\n * `allowFreeformInput` (or `allowCustomAnswer`) the radio pick no longer\n * auto-submits, so without the footer the user was left with a chosen\n * option and no way to send it.\n */\n const isSelfSubmitting = computed(\n () =>\n Boolean(currentStep.value?.options) &&\n !currentStep.value?.multiSelect &&\n (isAutoSubmitStep.value || isLegacyAutoSubmit.value),\n )\n\n // --- Steps ---\n\n const steps = computed<FormStep[]>(() => {\n const input = toolPart.value.input\n if (input?.steps?.length) {\n return input.steps\n }\n // Legacy showMultipleChoice → normalize into a single step\n if (input?.question && input?.options) {\n return [\n {\n id: 'legacy',\n question: input.question,\n options: input.options.map((o) =>\n typeof o === 'string' ? { label: o } : o,\n ),\n },\n ]\n }\n return []\n })\n\n /**\n * The reason the card has nothing to draw. A call the SDK rejected keeps\n * `state: 'output-error'` and moves the arguments it could not validate to\n * `rawInput`, so `input` is empty and there are no steps: without this the\n * component rendered NOTHING, and the user was left with a question that\n * had been announced and never appeared.\n */\n const hasFailed = computed(\n () => toolPart.value.state === 'output-error' && !steps.value.length,\n )\n\n // --- Navigation state ---\n\n const currentStepIndex = ref(0)\n const currentStep = computed(() => steps.value[currentStepIndex.value])\n const canGoBack = computed(() => currentStepIndex.value > 0)\n const canGoNext = computed(\n () => currentStepIndex.value < steps.value.length - 1,\n )\n const isMultiStep = computed(() => steps.value.length > 1)\n\n const progress = computed(() => {\n if (!isMultiStep.value) {\n return null\n }\n return Math.round(\n ((currentStepIndex.value + 1) / steps.value.length) * 100,\n )\n })\n\n // --- Answers ---\n\n /**\n * One slot PER STEP, keyed by position and not by step id: the ids come\n * from the model and nothing enforces they are unique, and keyed by id two\n * steps sharing one collapsed onto a single answer. See `formAnswerSlots`.\n */\n const answers = reactive<Record<number, AnswerValue>>({})\n const customAnswer = ref('')\n\n // The freeform field belongs to the step showing it: text left behind\n // (unsubmitted, or arriving from a late input update) must not follow the\n // user to the next or previous question.\n watch(currentStepIndex, () => {\n customAnswer.value = ''\n })\n\n // Single scalar answer shared by radio buttons and freeform text/number/date inputs.\n const scalarValue = computed<string | number | undefined>({\n get: () => {\n const val = currentStep.value\n ? answers[currentStepIndex.value]\n : undefined\n if (val == null || Array.isArray(val)) {\n return undefined\n }\n return val\n },\n set: (val) => {\n if (currentStep.value) {\n answers[currentStepIndex.value] = val ?? null\n }\n },\n })\n\n const activeCheckboxValue = computed<unknown[] | undefined>({\n get: () => {\n const val = currentStep.value\n ? answers[currentStepIndex.value]\n : undefined\n return Array.isArray(val) ? val : []\n },\n set: (val) => {\n if (currentStep.value) {\n answers[currentStepIndex.value] = (val as string[]) ?? []\n }\n },\n })\n\n // --- Initialize answers from existing output ---\n\n /** The `{ answers: [...] }` list, when the output carries one. */\n function outputAnswers(output: ToolPartShape['output']) {\n if (!output || typeof output === 'string') {\n return undefined\n }\n const list = (output as { answers?: unknown }).answers\n return Array.isArray(list) ? (list as FormAnswer[]) : undefined\n }\n\n watch(\n () => toolPart.value.output,\n (output) => {\n if (!output || isVoiceRenderAck(output)) {\n return\n }\n // Every shape an answered form comes back in (the web card's list,\n // a legacy plain string, the flat record a platform channel posts)\n // lands on the same per-position slots: see `formAnswerSlots`.\n Object.assign(\n answers,\n formAnswerSlots(steps.value, output) as Record<\n number,\n AnswerValue\n >,\n )\n },\n { immediate: true },\n )\n\n // --- Restore custom answer from output when it doesn't match any option ---\n\n const normalizedOutput = computed(() => {\n const out = toolPart.value.output\n if (!out || isVoiceRenderAck(out)) {\n return undefined\n }\n if (typeof out === 'string') {\n return out\n }\n const list = outputAnswers(out)\n if (list?.length === 1) {\n const val = list[0].value\n return Array.isArray(val) ? val.join(', ') : String(val)\n }\n return undefined\n })\n\n watch(\n normalizedOutput,\n (value) => {\n if (!value || !currentStep.value) {\n return\n }\n const optionLabels = (currentStep.value.options ?? []).map(\n (o) => o.label,\n )\n if (!optionLabels.includes(value)) {\n customAnswer.value = value\n }\n },\n { immediate: true },\n )\n\n // --- Option mapping for radio/checkbox components ---\n\n const radioOptions = computed(() => formStepOptions(currentStep.value))\n\n // --- Navigation & Submission ---\n\n /** Footer button, and Enter on a pure freeform step. */\n function goNext() {\n // A typed freeform answer wins over the picked option: it is the more\n // recent intent, and the footer button is now the visible way to send\n // it (the freeform field only submits on Enter).\n if (customAnswer.value.trim()) {\n submitCustomAnswer()\n return\n }\n if (canGoNext.value) {\n currentStepIndex.value++\n } else {\n submitForm()\n }\n }\n\n function goBack() {\n if (canGoBack.value) {\n currentStepIndex.value--\n }\n }\n\n function submitForm() {\n if (!isInteractive.value) {\n return\n }\n\n const finalAnswers: FormAnswer[] = steps.value.map((step, index) => ({\n id: step.id,\n value: answers[index] ?? null,\n }))\n\n // Legacy backward compatibility: single-step, single-select → return plain string\n if (\n isLegacyAutoSubmit.value &&\n !currentStep.value?.allowFreeformInput\n ) {\n const val = finalAnswers[0].value\n emit('select', Array.isArray(val) ? val[0] : (val as string))\n } else {\n emit('select', { answers: finalAnswers })\n }\n }\n\n /** Enter inside the freeform field shown alongside the options. */\n function submitCustomAnswer() {\n const value = customAnswer.value.trim()\n if (!value) {\n return\n }\n\n answers[currentStepIndex.value] = value\n // Cleared before navigating: `goNext()` reads it back to route a typed\n // answer here, so leaving it set would recurse.\n customAnswer.value = ''\n if (steps.value.length === 1) {\n submitForm()\n } else {\n goNext()\n }\n }\n\n function onRadioChange() {\n if (!isInteractive.value) {\n return\n }\n if (isAutoSubmitStep.value || isLegacyAutoSubmit.value) {\n submitForm()\n }\n }\n\n // --- Summary helpers ---\n\n function getSummaryValue(step: FormStep, index: number) {\n const val = answers[index]\n if (val == null) {\n return '—'\n }\n if (Array.isArray(val)) {\n return val.join(', ')\n }\n if (step.type === 'date') {\n return $d(new Date(val), 'short')\n }\n return val\n }\n</script>\n\n<template>\n <div\n v-if=\"hasFailed\"\n class=\"text-12 text-danger flex items-center gap-6 py-8\">\n <span class=\"i-vv-alert-circle text-16 shrink-0\" />\n <span>{{ $t('message.formRenderError') }}</span>\n </div>\n <div\n v-else-if=\"steps.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden flex flex-col bg-surface\">\n <!-- Header -->\n <div\n v-if=\"toolPart.input?.title || (isInteractive && steps.length > 1)\"\n class=\"text-12 border-b border-surface-3 text-word-3 bg-surface-1\">\n <div\n v-if=\"toolPart.input?.title\"\n class=\"px-sm py-10 font-bold\"\n :class=\"{\n 'border-b border-surface-3':\n isInteractive && steps.length > 1,\n }\">\n {{ toolPart.input?.title }}\n </div>\n <!-- Progress for multi-step -->\n <div\n v-if=\"isInteractive && steps.length > 1\"\n class=\"flex flex-col gap-4 p-sm\">\n <div class=\"flex justify-between text-10 text-word-3\">\n <span>\n {{\n $t('showForm.step', {\n current: currentStepIndex + 1,\n total: steps.length,\n })\n }}\n </span>\n <span>{{ progress }}%</span>\n </div>\n <div class=\"h-4 bg-surface-3 rounded-full overflow-hidden\">\n <div\n class=\"h-full bg-word-4 transition-all duration-300\"\n :style=\"{ width: `${progress}%` }\"></div>\n </div>\n </div>\n </div>\n\n <!-- Input Available State -->\n <template v-if=\"isInteractive\">\n <!-- Current Step Content -->\n <div class=\"px-sm py-16 flex flex-col gap-12\">\n <div class=\"leading-normal text-12\">\n <strong class=\"font-semibold\">\n {{ currentStep.question }}\n </strong>\n <PkStreamingMarkdown\n v-if=\"currentStep.message\"\n :markdown=\"currentStep.message\"\n class=\"text-word-2 mt-4\" />\n </div>\n\n <!-- Checkbox list for multi-select -->\n <PkEditorCheckboxButtons\n v-if=\"currentStep.options && currentStep.multiSelect\"\n v-model=\"activeCheckboxValue\"\n :name=\"currentStep.id\"\n :options=\"radioOptions\"\n :readonly=\"!isInteractive\"\n class=\"mb-0\"\n vertical>\n <template\n v-for=\"option in radioOptions\"\n :key=\"option.value\"\n #[option.value]>\n <!-- Shared option layout: label + optional description -->\n <div class=\"text-12\">\n <div class=\"font-semibold\">{{ option.label }}</div>\n <div v-if=\"option.description\" class=\"text-word-3\">\n {{ option.description }}\n </div>\n </div>\n </template>\n </PkEditorCheckboxButtons>\n\n <!-- Radio buttons for single-select -->\n <PkEditorRadioButtons\n v-else-if=\"currentStep.options && !currentStep.multiSelect\"\n v-model=\"scalarValue\"\n :name=\"currentStep.id\"\n :options=\"radioOptions\"\n :readonly=\"!isInteractive\"\n vertical\n class=\"mb-0\"\n @update:model-value=\"onRadioChange\">\n <template\n v-for=\"option in radioOptions\"\n :key=\"option.value\"\n #[option.value]>\n <!-- Shared option layout: label + optional description -->\n <div class=\"text-12\">\n <div class=\"font-semibold\">{{ option.label }}</div>\n <div v-if=\"option.description\" class=\"text-word-3\">\n {{ option.description }}\n </div>\n </div>\n </template>\n </PkEditorRadioButtons>\n\n <!-- Pure Freeform Input (text, number, date) -->\n <div\n v-else-if=\"!currentStep.options\"\n class=\"flex flex-col gap-6 w-full\">\n <VvInputText\n :key=\"currentStep.id\"\n v-model=\"scalarValue\"\n :placeholder=\"\n currentStep.placeholder || $t('placeholder.insert')\n \"\n :type=\"currentStep.type\"\n class=\"w-full\"\n :name=\"currentStep.id\"\n modifiers=\"compact\"\n :disabled=\"!isInteractive\"\n @keyup.enter=\"goNext\" />\n </div>\n </div>\n\n <!-- Custom footer freeform input (shown alongside options when allowFreeformInput) -->\n <div\n v-if=\"currentStep.allowFreeformInput && currentStep.options\"\n class=\"px-sm pb-sm border-t border-surface-3\">\n <form\n class=\"flex gap-xs pt-sm\"\n @submit.prevent=\"submitCustomAnswer\">\n <VvInputText\n :key=\"`${currentStep.id}-custom`\"\n v-model=\"customAnswer\"\n class=\"flex-1\"\n :name=\"`${currentStep.id}-custom`\"\n modifiers=\"compact\"\n :disabled=\"!isInteractive\"\n :placeholder=\"\n currentStep.placeholder ||\n $t('showForm.otherPlaceholder')\n \" />\n </form>\n </div>\n\n <!-- Footer navigation: shown for every step that does not submit\n itself on option pick (see `isSelfSubmitting`). -->\n <div\n v-if=\"!isSelfSubmitting\"\n class=\"px-sm py-10 bg-surface border-t border-surface-3 flex justify-between gap-12\">\n <VvButton\n v-if=\"canGoBack\"\n modifiers=\"action-quiet\"\n icon=\"ri:arrow-left-s-line\"\n :label=\"$t('action.back')\"\n @click.stop=\"goBack\" />\n <div v-else></div>\n\n <VvButton\n :modifiers=\"canGoNext ? 'action-quiet' : 'action-primary'\"\n :icon=\"\n canGoNext\n ? 'ri:arrow-right-s-line'\n : 'ri:send-plane-2-line'\n \"\n icon-position=\"right\"\n :label=\"canGoNext ? $t('action.next') : $t('action.submit')\"\n @click.stop=\"goNext\" />\n </div>\n </template>\n\n <!-- Output Available State (Multi-step Summary) -->\n <template v-else>\n <div class=\"px-sm py-12 bg-surface space-y-10\">\n <ul class=\"flex flex-col gap-8\">\n <li\n v-for=\"(step, index) in steps\"\n :key=\"index\"\n class=\"leading-normal\">\n <div class=\"text-12 text-word-3\">\n {{ step.question }}\n </div>\n <span class=\"text-12 text-word-2 font-semibold\">\n {{ getSummaryValue(step, index) }}\n </span>\n </li>\n </ul>\n </div>\n <div\n class=\"px-sm py-12 bg-surface border-t border-surface-3 flex items-center gap-10\">\n <VvIcon name=\"ri:check-line\" class=\"text-16 text-word-3\" />\n <div class=\"flex flex-col\">\n <span class=\"font-medium text-12 text-word-1 leading-tight\">\n {{ $t('showForm.completed') }}\n </span>\n </div>\n </div>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAII,IAAM,IAAQ,GAmBR,IAAa,EAElB,GAAA,YAAuB,GAQlB,IAAM,EAAM,GACZ,IAAY,QAAe,GAAG,EAAM,KAAK,GAAG,GAAK,GAEjD,IAAiB,QAMZ,CAAC,GALS,EAAM,YACjB,MAAM,QAAQ,EAAM,SAAS,IACzB,EAAM,YACN,CAAC,EAAM,SAAS,IACpB,CAAC,GACc,EAAM,YAAY,YAAY,QAAQ,CAC9D;;;GAID,OAAA,EAAA,GAAA,EAqBe,GAAA;IApBF,YAAA,EAAA;IAAA,uBAAA,AAAA,EAAA,QAAA,MAAA,EAAU,QAAA;IAClB,MAAM,EAAA;IACN,OAAA,EAAA;IACA,cAAY,EAAA;IACZ,SAAA,EAAA;IACA,iBAAe,EAAA;IACf,WAAW,EAAA,YAAS,cAAA;;IAEjB,SAAA,QAAgC,EADpC,EAAA,EAAA,GAAA,EAYU,GAAA,MAAA,EAXkB,EAAA,UAAhB,GAAQ,OADpB,EAAA,GAAA,EAYU,GAAA;KAVL;KACA,MAAM,EAAA;KACN,UAAA,EAAA;KACA,UAAA,EAAA;KACA,UAAA,EAAA;KACA,OAAO,EAAO;KACd,WAAW,EAAA;;KACZ,S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K/B,GAAA,EAAA,MAAA,EAAA,GAAA,EAyBW,GAAA,EAAA,KAAA,EAAA,GAAA,CAxBP,EAcM,OAdN,IAcM,CAbF,EAYK,MAZL,IAYK,EAXD,EAAA,EAAA,GAAA,EAUK,GAAA,MAAA,EATuB,EAAA,QAAhB,GAAM,OADlB,EAAA,GAAA,EAUK,MAAA;IARA,KAAK;IACN,OAAM;GACN,GAAA,CAAA,EAEM,OAFN,IAEM,EADC,EAAK,QAAQ,GAAA,CAAA,GAEpB,EAEO,QAFP,IAEO,EADA,GAAgB,GAAM,CAAK,CAAA,GAAA,CAAA,CAAA,CAAA,EAK9C,GAAA,GAAA,EAAA,CAAA,CAAA,CAAA,GAAA,EAQM,OARN,IAQM,CANF,EAA2D,GAAA;IAAnD,MAAK;IAAgB,OAAM;GACnC,CAAA,GAAA,EAIM,OAJN,GAIM,CAHF,EAEO,QAFP,IAEO,EADA,EAAA,CAAA,CAAE,CAAA,oBAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA"}
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { r as t } from "./PkStreamingMarkdown-D8_LwZMR.js";
2
+ import { r as t } from "./PkStreamingMarkdown-DIaZEedG.js";
3
3
  import { VvButton as n, VvButtonGroup as r, VvDropdown as i, VvDropdownAction as a, VvIcon as o } from "@volverjs/ui-vue/components";
4
4
  import { computed as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, guardReactiveProps as p, normalizeProps as m, openBlock as h, toDisplayString as g, unref as _, withCtx as v } from "vue";
5
5
  import { useClipboard as y } from "@vueuse/core";
@@ -75,4 +75,4 @@ var b = { class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-s
75
75
  //#endregion
76
76
  export { D as n, O as t };
77
77
 
78
- //# sourceMappingURL=PkToolShowMessage-DQojxDiV.js.map
78
+ //# sourceMappingURL=PkToolShowMessage-B7flxVCU.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PkToolShowMessage-DQojxDiV.js","names":["$t"],"sources":["../../../../packages/components/src/chat/PkToolShowMessage.vue","../../../../packages/components/src/chat/PkToolShowMessage.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { useShortUrlResolver } from 'composables'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n body: string\n }\n }\n return part\n })\n\n // Messages leave the app (WhatsApp/Telegram/SMS/clipboard), so expand short\n // urls to their real target rather than keeping the fragile `/api/r/` link.\n const { resolveText } = useShortUrlResolver()\n const body = resolveText(() => toolPart.value.input?.body)\n\n const openInWhatsApp = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://wa.me/?text=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInTelegram = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://t.me/share/url?text=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInSms = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `sms:?body=${encodeURIComponent(body.value)}`\n window.open(url)\n }\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:chat-1-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.message') }}\n </strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copy(body)\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:send-plane-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.send')\" />\n <template #items>\n <VvDropdownAction @click=\"openInWhatsApp\">\n <VvIcon name=\"ri:whatsapp-line\" />\n {{ $t('action.openInWhatsApp') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInTelegram\">\n <VvIcon name=\"ri:telegram-line\" />\n {{ $t('action.openInTelegram') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInSms\">\n <VvIcon name=\"ri:message-2-line\" />\n {{ $t('action.openInSms') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"p-sm\">\n <div class=\"text-12 text-word-4 mb-4\">\n {{ $t('label.body') }}\n </div>\n <pre class=\"text-word-2 whitespace-pre-wrap break-words\">{{\n body\n }}</pre>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { useShortUrlResolver } from 'composables'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n body: string\n }\n }\n return part\n })\n\n // Messages leave the app (WhatsApp/Telegram/SMS/clipboard), so expand short\n // urls to their real target rather than keeping the fragile `/api/r/` link.\n const { resolveText } = useShortUrlResolver()\n const body = resolveText(() => toolPart.value.input?.body)\n\n const openInWhatsApp = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://wa.me/?text=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInTelegram = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://t.me/share/url?text=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInSms = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `sms:?body=${encodeURIComponent(body.value)}`\n window.open(url)\n }\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:chat-1-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.message') }}\n </strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copy(body)\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:send-plane-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.send')\" />\n <template #items>\n <VvDropdownAction @click=\"openInWhatsApp\">\n <VvIcon name=\"ri:whatsapp-line\" />\n {{ $t('action.openInWhatsApp') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInTelegram\">\n <VvIcon name=\"ri:telegram-line\" />\n {{ $t('action.openInTelegram') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInSms\">\n <VvIcon name=\"ri:message-2-line\" />\n {{ $t('action.openInSms') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"p-sm\">\n <div class=\"text-12 text-word-4 mb-4\">\n {{ $t('label.body') }}\n </div>\n <pre class=\"text-word-2 whitespace-pre-wrap break-words\">{{\n body\n }}</pre>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;EAKI,IAAM,IAAQ,GAIR,EAAE,SAAM,cAAW,EAAa,GAEhC,IAAW,QACA,EAAM,IAMtB,GAIK,EAAE,mBAAgB,EAAoB,GACtC,IAAO,QAAkB,EAAS,MAAM,OAAO,IAAI,GAEnD,UAAuB;GACzB,IAAI,CAAC,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lC,EAAkC,GAAA,EAA1B,MAAK,mBAAkB,CAAA,GAAG,EAAA,MAClC,EAAGA,EAAAA,GAAE,uBAAA,CAAA,GAAA,CAAA,CAAA,CAAA;;;OAET,EAGmB,GAAA,EAHA,SAAO,EAAS,GAAA;QAC/B,SAAA,QAAmC,CAAnC,EAAmC,GAAA,EAA3B,MAAK,oBAAmB,CAAA,GAAG,EAAA,MACnC,EAAGA,EAAAA,GAAE,kBAAA,CAAA,GAAA,CAAA,CAAA,CAAA;;;;MAfb,SAAA,QAGiC,CAHjC,EAGiC,GAAA;OAF7B,MAAK;OACL,WAAU;OACT,OAAOA,EAAAA,GAAE,aAAA;;;;;;GAkB1B,CAAA,GAAA,EAOM,OAPN,GAOM,CANF,EAEM,OAFN,GAEM,EADCA,EAAAA,GAAE,YAAA,CAAA,GAAA,CAAA,GAET,EAEQ,OAFR,GAEQ,EADJ,EAAA,CAAA,CAAI,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"PkToolShowMessage-B7flxVCU.js","names":["$t"],"sources":["../../../../packages/components/src/chat/PkToolShowMessage.vue","../../../../packages/components/src/chat/PkToolShowMessage.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { useShortUrlResolver } from 'composables'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n body: string\n }\n }\n return part\n })\n\n // Messages leave the app (WhatsApp/Telegram/SMS/clipboard), so expand short\n // urls to their real target rather than keeping the fragile `/api/r/` link.\n const { resolveText } = useShortUrlResolver()\n const body = resolveText(() => toolPart.value.input?.body)\n\n const openInWhatsApp = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://wa.me/?text=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInTelegram = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://t.me/share/url?text=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInSms = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `sms:?body=${encodeURIComponent(body.value)}`\n window.open(url)\n }\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:chat-1-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.message') }}\n </strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copy(body)\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:send-plane-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.send')\" />\n <template #items>\n <VvDropdownAction @click=\"openInWhatsApp\">\n <VvIcon name=\"ri:whatsapp-line\" />\n {{ $t('action.openInWhatsApp') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInTelegram\">\n <VvIcon name=\"ri:telegram-line\" />\n {{ $t('action.openInTelegram') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInSms\">\n <VvIcon name=\"ri:message-2-line\" />\n {{ $t('action.openInSms') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"p-sm\">\n <div class=\"text-12 text-word-4 mb-4\">\n {{ $t('label.body') }}\n </div>\n <pre class=\"text-word-2 whitespace-pre-wrap break-words\">{{\n body\n }}</pre>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { useShortUrlResolver } from 'composables'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n body: string\n }\n }\n return part\n })\n\n // Messages leave the app (WhatsApp/Telegram/SMS/clipboard), so expand short\n // urls to their real target rather than keeping the fragile `/api/r/` link.\n const { resolveText } = useShortUrlResolver()\n const body = resolveText(() => toolPart.value.input?.body)\n\n const openInWhatsApp = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://wa.me/?text=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInTelegram = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://t.me/share/url?text=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInSms = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `sms:?body=${encodeURIComponent(body.value)}`\n window.open(url)\n }\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:chat-1-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.message') }}\n </strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copy(body)\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:send-plane-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.send')\" />\n <template #items>\n <VvDropdownAction @click=\"openInWhatsApp\">\n <VvIcon name=\"ri:whatsapp-line\" />\n {{ $t('action.openInWhatsApp') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInTelegram\">\n <VvIcon name=\"ri:telegram-line\" />\n {{ $t('action.openInTelegram') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInSms\">\n <VvIcon name=\"ri:message-2-line\" />\n {{ $t('action.openInSms') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"p-sm\">\n <div class=\"text-12 text-word-4 mb-4\">\n {{ $t('label.body') }}\n </div>\n <pre class=\"text-word-2 whitespace-pre-wrap break-words\">{{\n body\n }}</pre>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;EAKI,IAAM,IAAQ,GAIR,EAAE,SAAM,cAAW,EAAa,GAEhC,IAAW,QACA,EAAM,IAMtB,GAIK,EAAE,mBAAgB,EAAoB,GACtC,IAAO,QAAkB,EAAS,MAAM,OAAO,IAAI,GAEnD,UAAuB;GACzB,IAAI,CAAC,EAAS,MAAM,OAChB;GAEJ,IAAM,IAAM,uBAAuB,mBAAmB,EAAK,KAAK;GAChE,OAAO,KAAK,GAAK,QAAQ;EAC7B,GAEM,UAAuB;GACzB,IAAI,CAAC,EAAS,MAAM,OAChB;GAEJ,IAAM,IAAM,+BAA+B,mBAAmB,EAAK,KAAK;GACxE,OAAO,KAAK,GAAK,QAAQ;EAC7B,GAEM,UAAkB;GACpB,IAAI,CAAC,EAAS,MAAM,OAChB;GAEJ,IAAM,IAAM,aAAa,mBAAmB,EAAK,KAAK;GACtD,OAAO,KAAK,CAAG;EACnB;;;GAIA,OAAA,EAAA,GAAA,EAmDM,OAnDN,GAmDM,CAjDF,EAwCM,OAxCN,GAwCM;IAtCF,EAAgD,GAAA;KAAxC,MAAK;KAAiB,OAAM;;IACpC,EAES,UAFT,GAES,EADFA,EAAAA,GAAE,eAAA,CAAA,GAAA,CAAA;IAET,EAiCgB,GAAA;KAjCD,WAAU;KAAU,OAAM;;KACrC,SAAA,QAI0B,CAJ1B,EAI0B,GAAA;MAHtB,WAAU;MACT,MAAM,EAAA,CAAA,IAA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./PkLazyImg-CDxX9xnq.js";
3
- import { t as n } from "./PkUrl-xUBKVJCv.js";
3
+ import { t as n } from "./PkUrl-DSGxrEM7.js";
4
4
  import { VvIcon as r } from "@volverjs/ui-vue/components";
5
5
  import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, openBlock as f, renderList as p, resolveDynamicComponent as m, toDisplayString as h, withCtx as g } from "vue";
6
6
  //#region ../../packages/components/src/chat/PkToolShowProductList.vue?vue&type=script&setup=true&lang.ts
@@ -62,4 +62,4 @@ var _ = {
62
62
  //#endregion
63
63
  export { E as n, D as t };
64
64
 
65
- //# sourceMappingURL=PkToolShowProductList-Cn0yewM3.js.map
65
+ //# sourceMappingURL=PkToolShowProductList-B6fRtIpx.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PkToolShowProductList-Cn0yewM3.js","names":[],"sources":["../../../../packages/components/src/chat/PkToolShowProductList.vue","../../../../packages/components/src/chat/PkToolShowProductList.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import PkLazyImg from '../PkLazyImg.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n products: Array<{\n name: string\n url?: string\n image?: string\n price?: string\n availability?: string\n description?: string\n }>\n }\n }\n return part\n })\n</script>\n\n<template>\n <ul v-if=\"toolPart?.input?.products?.length\" class=\"u-pick-list w-full\">\n <li\n v-for=\"(product, index) in toolPart.input.products\"\n :key=\"index\"\n class=\"u-pick-list__row\">\n <component\n :is=\"product.url ? 'a' : 'div'\"\n :href=\"product.url\"\n :target=\"product.url ? '_blank' : undefined\"\n :rel=\"product.url ? 'noopener noreferrer' : undefined\"\n class=\"u-pick-list__entry\">\n <!-- Merchant images rot over time: a dead one degrades to an icon\n so the row keeps its thumbnail slot -->\n <PkLazyImg\n v-if=\"product.image\"\n :src=\"product.image\"\n :alt=\"product.name\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate\">\n {{ product.name }}\n </strong>\n <span\n v-if=\"product.url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"product.url\" />\n </span>\n <div class=\"flex items-center gap-sm flex-wrap text-12\">\n <span\n v-if=\"product.price\"\n class=\"font-semibold text-word-1\">\n {{ product.price }}\n </span>\n <!-- Free text from the merchant: it was colour-coded by\n substring, which only ever matched English and\n Italian. It reads as the note it is. -->\n <span\n v-if=\"product.availability\"\n class=\"text-10 text-word-3\">\n {{ product.availability }}\n </span>\n </div>\n <p\n v-if=\"product.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ product.description }}\n </p>\n </div>\n </component>\n </li>\n </ul>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import PkLazyImg from '../PkLazyImg.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n products: Array<{\n name: string\n url?: string\n image?: string\n price?: string\n availability?: string\n description?: string\n }>\n }\n }\n return part\n })\n</script>\n\n<template>\n <ul v-if=\"toolPart?.input?.products?.length\" class=\"u-pick-list w-full\">\n <li\n v-for=\"(product, index) in toolPart.input.products\"\n :key=\"index\"\n class=\"u-pick-list__row\">\n <component\n :is=\"product.url ? 'a' : 'div'\"\n :href=\"product.url\"\n :target=\"product.url ? '_blank' : undefined\"\n :rel=\"product.url ? 'noopener noreferrer' : undefined\"\n class=\"u-pick-list__entry\">\n <!-- Merchant images rot over time: a dead one degrades to an icon\n so the row keeps its thumbnail slot -->\n <PkLazyImg\n v-if=\"product.image\"\n :src=\"product.image\"\n :alt=\"product.name\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate\">\n {{ product.name }}\n </strong>\n <span\n v-if=\"product.url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"product.url\" />\n </span>\n <div class=\"flex items-center gap-sm flex-wrap text-12\">\n <span\n v-if=\"product.price\"\n class=\"font-semibold text-word-1\">\n {{ product.price }}\n </span>\n <!-- Free text from the merchant: it was colour-coded by\n substring, which only ever matched English and\n Italian. It reads as the note it is. -->\n <span\n v-if=\"product.availability\"\n class=\"text-10 text-word-3\">\n {{ product.availability }}\n </span>\n </div>\n <p\n v-if=\"product.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ product.description }}\n </p>\n </div>\n </component>\n </li>\n </ul>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAKI,IAAM,IAAQ,GAIR,IAAW,QACA,EAAM,IAatB;;;GAIS,OAAA,EAAA,OAAU,OAAO,UAAU,UAArC,EAAA,GAAA,EAoDK,MApDL,GAoDK,EAnDD,EAAA,EAAA,GAAA,EAkDK,GAAA,MAAA,EAjD0B,EAAA,MAAS,MAAM,WAAlC,GAAS,OADrB,EAAA,GAAA,EAkDK,MAAA;IAhDA,KAAK;IACN,OAAM;GACN,GAAA,EAAA,EAAA,GAAA,EA6CY,EA5CH,EAAQ,MAAG,MAAA,KAAA,GAAA;IACf,MAAM,EAAQ;IACd,QAAQ,EAAQ,MAAG,WAAc,KAAA;IACjC,KAAK,EAAQ,MAAG,wBAA2B,KAAA;IAC5C,OAAM;;IAGN,SAAA,QAK8F,CAJpF,EAAQ,SADlB,EAAA,GAAA,EAK8F,GAAA;;KAHzF,KAAK,EAAQ;KACb,KAAK,EAAQ;KACd,iBAAc;KACd,OAAM;IACV,GAAA,MAAA,GAAA,CAAA,OAAA,KAAA,CAAA,KAAA,EAAA,IAAA,EAAA,GAAA,EA8BM,OA9BN,GA8BM;KA7BF,EAES,UAFT,GAES,EADF,EAAQ,IAAI,GAAA,CAAA;KAGT,EAAQ,OADlB,EAAA,GAAA,EAKO,QALP,GAKO,CAFH,EAAkD,GAAA;MAA1C,MAAK;MAAU,OAAM;KAC7B,CAAA,GAAA,EAA4B,GAAA,EAApB,KAAK,EAAQ,IAAA,GAAA,MAAA,GAAA,CAAA,KAAA,CAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;KAEzB,EAcM,OAdN,GAcM,CAZQ,EAAQ,SADlB,EAAA,GAAA,EAIO,QAJP,GAIO,EADA,EAAQ,KAAK,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,GAMV,EAAQ,gBADlB,EAAA,GAAA,EAIO,QAJP,GAIO,EADA,EAAQ,YAAY,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA;KAIrB,EAAQ,eADlB,EAAA,GAAA,EAII,KAJJ,GAII,EADG,EAAQ,WAAW,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA"}
1
+ {"version":3,"file":"PkToolShowProductList-B6fRtIpx.js","names":[],"sources":["../../../../packages/components/src/chat/PkToolShowProductList.vue","../../../../packages/components/src/chat/PkToolShowProductList.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import PkLazyImg from '../PkLazyImg.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n products: Array<{\n name: string\n url?: string\n image?: string\n price?: string\n availability?: string\n description?: string\n }>\n }\n }\n return part\n })\n</script>\n\n<template>\n <ul v-if=\"toolPart?.input?.products?.length\" class=\"u-pick-list w-full\">\n <li\n v-for=\"(product, index) in toolPart.input.products\"\n :key=\"index\"\n class=\"u-pick-list__row\">\n <component\n :is=\"product.url ? 'a' : 'div'\"\n :href=\"product.url\"\n :target=\"product.url ? '_blank' : undefined\"\n :rel=\"product.url ? 'noopener noreferrer' : undefined\"\n class=\"u-pick-list__entry\">\n <!-- Merchant images rot over time: a dead one degrades to an icon\n so the row keeps its thumbnail slot -->\n <PkLazyImg\n v-if=\"product.image\"\n :src=\"product.image\"\n :alt=\"product.name\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate\">\n {{ product.name }}\n </strong>\n <span\n v-if=\"product.url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"product.url\" />\n </span>\n <div class=\"flex items-center gap-sm flex-wrap text-12\">\n <span\n v-if=\"product.price\"\n class=\"font-semibold text-word-1\">\n {{ product.price }}\n </span>\n <!-- Free text from the merchant: it was colour-coded by\n substring, which only ever matched English and\n Italian. It reads as the note it is. -->\n <span\n v-if=\"product.availability\"\n class=\"text-10 text-word-3\">\n {{ product.availability }}\n </span>\n </div>\n <p\n v-if=\"product.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ product.description }}\n </p>\n </div>\n </component>\n </li>\n </ul>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import PkLazyImg from '../PkLazyImg.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n products: Array<{\n name: string\n url?: string\n image?: string\n price?: string\n availability?: string\n description?: string\n }>\n }\n }\n return part\n })\n</script>\n\n<template>\n <ul v-if=\"toolPart?.input?.products?.length\" class=\"u-pick-list w-full\">\n <li\n v-for=\"(product, index) in toolPart.input.products\"\n :key=\"index\"\n class=\"u-pick-list__row\">\n <component\n :is=\"product.url ? 'a' : 'div'\"\n :href=\"product.url\"\n :target=\"product.url ? '_blank' : undefined\"\n :rel=\"product.url ? 'noopener noreferrer' : undefined\"\n class=\"u-pick-list__entry\">\n <!-- Merchant images rot over time: a dead one degrades to an icon\n so the row keeps its thumbnail slot -->\n <PkLazyImg\n v-if=\"product.image\"\n :src=\"product.image\"\n :alt=\"product.name\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate\">\n {{ product.name }}\n </strong>\n <span\n v-if=\"product.url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"product.url\" />\n </span>\n <div class=\"flex items-center gap-sm flex-wrap text-12\">\n <span\n v-if=\"product.price\"\n class=\"font-semibold text-word-1\">\n {{ product.price }}\n </span>\n <!-- Free text from the merchant: it was colour-coded by\n substring, which only ever matched English and\n Italian. It reads as the note it is. -->\n <span\n v-if=\"product.availability\"\n class=\"text-10 text-word-3\">\n {{ product.availability }}\n </span>\n </div>\n <p\n v-if=\"product.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ product.description }}\n </p>\n </div>\n </component>\n </li>\n </ul>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAKI,IAAM,IAAQ,GAIR,IAAW,QACA,EAAM,IAatB;;;GAIS,OAAA,EAAA,OAAU,OAAO,UAAU,UAArC,EAAA,GAAA,EAoDK,MApDL,GAoDK,EAnDD,EAAA,EAAA,GAAA,EAkDK,GAAA,MAAA,EAjD0B,EAAA,MAAS,MAAM,WAAlC,GAAS,OADrB,EAAA,GAAA,EAkDK,MAAA;IAhDA,KAAK;IACN,OAAM;GACN,GAAA,EAAA,EAAA,GAAA,EA6CY,EA5CH,EAAQ,MAAG,MAAA,KAAA,GAAA;IACf,MAAM,EAAQ;IACd,QAAQ,EAAQ,MAAG,WAAc,KAAA;IACjC,KAAK,EAAQ,MAAG,wBAA2B,KAAA;IAC5C,OAAM;;IAGN,SAAA,QAK8F,CAJpF,EAAQ,SADlB,EAAA,GAAA,EAK8F,GAAA;;KAHzF,KAAK,EAAQ;KACb,KAAK,EAAQ;KACd,iBAAc;KACd,OAAM;IACV,GAAA,MAAA,GAAA,CAAA,OAAA,KAAA,CAAA,KAAA,EAAA,IAAA,EAAA,GAAA,EA8BM,OA9BN,GA8BM;KA7BF,EAES,UAFT,GAES,EADF,EAAQ,IAAI,GAAA,CAAA;KAGT,EAAQ,OADlB,EAAA,GAAA,EAKO,QALP,GAKO,CAFH,EAAkD,GAAA;MAA1C,MAAK;MAAU,OAAM;KAC7B,CAAA,GAAA,EAA4B,GAAA,EAApB,KAAK,EAAQ,IAAA,GAAA,MAAA,GAAA,CAAA,KAAA,CAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;KAEzB,EAcM,OAdN,GAcM,CAZQ,EAAQ,SADlB,EAAA,GAAA,EAIO,QAJP,GAIO,EADA,EAAQ,KAAK,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,GAMV,EAAQ,gBADlB,EAAA,GAAA,EAIO,QAJP,GAIO,EADA,EAAQ,YAAY,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA;KAIrB,EAAQ,eADlB,EAAA,GAAA,EAII,KAJJ,GAII,EADG,EAAQ,WAAW,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA"}
@@ -1,9 +1,9 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { i as t } from "./Document-CaUfI_SZ.js";
3
- import { t as n } from "./PkStreamingMarkdown-D8_LwZMR.js";
2
+ import { i as t } from "./Document-8umjeTVS.js";
3
+ import { t as n } from "./PkStreamingMarkdown-DIaZEedG.js";
4
4
  import "./src-DT8FLE4_.js";
5
5
  import { t as r } from "./markdown-CCMpGUA7.js";
6
- import { t as i } from "./PkUrl-xUBKVJCv.js";
6
+ import { t as i } from "./PkUrl-DSGxrEM7.js";
7
7
  import { VvIcon as a } from "@volverjs/ui-vue/components";
8
8
  import { Fragment as o, Transition as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, normalizeClass as g, openBlock as _, reactive as v, ref as y, renderList as b, toDisplayString as x, unref as S, withCtx as C } from "vue";
9
9
  //#region ../../packages/components/src/chat/PkChunkPreview.vue?vue&type=script&setup=true&lang.ts
@@ -239,4 +239,4 @@ var w = ["title"], T = {
239
239
  //#endregion
240
240
  export { E as i, X as n, j as r, Z as t };
241
241
 
242
- //# sourceMappingURL=PkToolShowSources-7Q5Iogxi.js.map
242
+ //# sourceMappingURL=PkToolShowSources-DDZokZow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PkToolShowSources-7Q5Iogxi.js","names":["$t"],"sources":["../../../../packages/components/src/chat/PkChunkPreview.vue","../../../../packages/components/src/chat/PkChunkPreview.vue","../../../../packages/components/src/chat/PkDocumentHeader.vue","../../../../packages/components/src/chat/PkDocumentHeader.vue","../../../../packages/components/src/chat/PkToolShowSources.vue","../../../../packages/components/src/chat/PkToolShowSources.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { stripMarkdown } from 'utils'\n\n const props = defineProps<{\n content: string\n similarity?: number\n maxSimilarity?: number\n expanded: boolean\n }>()\n\n const similarityPercent = computed(() => {\n if (props.similarity == null) {\n return null\n }\n const max =\n props.maxSimilarity && props.maxSimilarity > 0\n ? props.maxSimilarity\n : 1\n return Math.round((props.similarity / max) * 100)\n })\n</script>\n\n<template>\n <VvIcon name=\"ri:text-snippet\" class=\"shrink-0 text-12 text-word-4\" />\n <span class=\"text-10 text-word-2 truncate flex-1\" :title=\"content\">\n {{ stripMarkdown(content) }}\n </span>\n <span v-if=\"similarityPercent != null\" class=\"text-10 text-word-4 shrink-0\">\n {{ similarityPercent }}%\n </span>\n <VvIcon\n :name=\"expanded ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-14 text-word-4 shrink-0\" />\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { stripMarkdown } from 'utils'\n\n const props = defineProps<{\n content: string\n similarity?: number\n maxSimilarity?: number\n expanded: boolean\n }>()\n\n const similarityPercent = computed(() => {\n if (props.similarity == null) {\n return null\n }\n const max =\n props.maxSimilarity && props.maxSimilarity > 0\n ? props.maxSimilarity\n : 1\n return Math.round((props.similarity / max) * 100)\n })\n</script>\n\n<template>\n <VvIcon name=\"ri:text-snippet\" class=\"shrink-0 text-12 text-word-4\" />\n <span class=\"text-10 text-word-2 truncate flex-1\" :title=\"content\">\n {{ stripMarkdown(content) }}\n </span>\n <span v-if=\"similarityPercent != null\" class=\"text-10 text-word-4 shrink-0\">\n {{ similarityPercent }}%\n </span>\n <VvIcon\n :name=\"expanded ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-14 text-word-4 shrink-0\" />\n</template>\n","<script setup lang=\"ts\">\n import type { DocumentType } from 'models'\n import { getTypeIcon } from 'models'\n import PkUrl from '../PkUrl.vue'\n\n defineProps<{\n type: string\n name: string\n url?: string\n filename?: string\n }>()\n</script>\n\n<template>\n <VvIcon\n :name=\"getTypeIcon(type as DocumentType)\"\n class=\"shrink-0 text-14 text-word-3\" />\n <div class=\"flex flex-col gap-2 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate block\">\n {{ name }}\n </strong>\n <span v-if=\"filename\" class=\"text-10 text-word-4 truncate\">\n {{ filename }}\n </span>\n <span\n v-if=\"url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-10\" />\n <PkUrl :url=\"url\" />\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import type { DocumentType } from 'models'\n import { getTypeIcon } from 'models'\n import PkUrl from '../PkUrl.vue'\n\n defineProps<{\n type: string\n name: string\n url?: string\n filename?: string\n }>()\n</script>\n\n<template>\n <VvIcon\n :name=\"getTypeIcon(type as DocumentType)\"\n class=\"shrink-0 text-14 text-word-3\" />\n <div class=\"flex flex-col gap-2 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate block\">\n {{ name }}\n </strong>\n <span v-if=\"filename\" class=\"text-10 text-word-4 truncate\">\n {{ filename }}\n </span>\n <span\n v-if=\"url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-10\" />\n <PkUrl :url=\"url\" />\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, reactive } from 'vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkChunkPreview from './PkChunkPreview.vue'\n import PkDocumentHeader from './PkDocumentHeader.vue'\n\n interface SourceItem {\n chunkId: string\n documentId: string\n documentName: string\n documentType: string\n language: string\n content: string\n chunkIndex?: number | null\n similarity?: number\n sourceUrl?: string\n sourceFilename?: string\n sourceDescription?: string\n sourceImageUrl?: string\n }\n\n const props = defineProps<{\n part: unknown\n onExpandContext?: (payload: {\n documentId: string\n chunkIndex: number\n }) => Promise<string>\n onDownload?: (documentId: string) => void\n }>()\n\n const toolPart = computed(() => {\n return props.part as {\n input?: {\n sources: SourceItem[]\n }\n }\n })\n\n const sources = computed(() => toolPart.value.input?.sources || [])\n\n const groupedSources = computed(() => {\n const groups = new Map<\n string,\n { document: SourceItem; chunks: SourceItem[] }\n >()\n for (const source of sources.value) {\n const existing = groups.get(source.documentId)\n if (existing) {\n existing.chunks.push(source)\n } else {\n groups.set(source.documentId, {\n document: source,\n chunks: [source],\n })\n }\n }\n return [...groups.values()]\n })\n\n const maxSimilarity = computed(() => {\n return Math.max(...sources.value.map((s) => s.similarity ?? 0), 0)\n })\n\n const expandedDocuments = reactive(new Set<string>())\n const expandedChunks = reactive(new Set<string>())\n const contextData = reactive(new Map<string, string>())\n const loadingContext = reactive(new Set<string>())\n\n const toggleDocument = (documentId: string) => {\n if (expandedDocuments.has(documentId)) {\n expandedDocuments.delete(documentId)\n } else {\n expandedDocuments.add(documentId)\n }\n }\n\n const toggleChunk = (chunkId: string) => {\n if (expandedChunks.has(chunkId)) {\n expandedChunks.delete(chunkId)\n } else {\n expandedChunks.add(chunkId)\n }\n }\n\n const handleExpandContext = async (source: SourceItem) => {\n if (source.chunkIndex == null || !props.onExpandContext) {\n return\n }\n loadingContext.add(source.chunkId)\n try {\n const content = await props.onExpandContext({\n documentId: source.documentId,\n chunkIndex: source.chunkIndex,\n })\n contextData.set(source.chunkId, content)\n } finally {\n loadingContext.delete(source.chunkId)\n }\n }\n\n const clearContext = (chunkId: string) => {\n contextData.delete(chunkId)\n }\n\n const showMore = ref(false)\n const visibleGroups = computed(() => {\n if (showMore.value) {\n return groupedSources.value\n }\n return groupedSources.value.slice(0, 3)\n })\n const hasMore = computed(() => groupedSources.value.length > 3)\n</script>\n\n<template>\n <div v-if=\"sources.length\" class=\"flex flex-col gap-xs w-full\">\n <div class=\"flex items-center gap-4 text-12 text-word-3 font-semibold\">\n <VvIcon name=\"ri:article-line\" class=\"text-14\" />\n {{ $t('label.sources') }}\n <span class=\"text-word-4 font-normal\">\n ({{ groupedSources.length }})\n </span>\n </div>\n\n <ul class=\"flex flex-col gap-xs\">\n <li\n v-for=\"group in visibleGroups\"\n :key=\"group.document.documentId\"\n class=\"border border-surface-3 rounded-xl overflow-hidden\">\n <!-- Document header -->\n <button\n class=\"flex items-center gap-8 p-8 w-full text-left hover:bg-surface-1 transition-colors cursor-pointer\"\n @click=\"toggleDocument(group.document.documentId)\">\n <PkDocumentHeader\n :type=\"group.document.documentType\"\n :name=\"group.document.documentName\"\n :url=\"group.document.sourceUrl\"\n :filename=\"group.document.sourceFilename\" />\n <div class=\"flex items-center gap-4 shrink-0\">\n <span\n v-if=\"group.chunks.length > 1\"\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2\">\n {{ group.chunks.length }}\n </span>\n <span\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2 uppercase\">\n {{ group.document.language }}\n </span>\n <VvIcon\n :name=\"\n expandedDocuments.has(group.document.documentId)\n ? 'ri:arrow-up-s-line'\n : 'ri:arrow-down-s-line'\n \"\n class=\"text-16 text-word-3\" />\n </div>\n </button>\n\n <!-- Expanded content -->\n <div\n v-if=\"expandedDocuments.has(group.document.documentId)\"\n class=\"border-t border-surface-3\">\n <PkStreamingMarkdown\n v-if=\"group.document.sourceDescription\"\n :markdown=\"group.document.sourceDescription\"\n class=\"px-8 py-4 text-10 text-word-3 bg-surface-1 border-b border-surface-3\" />\n\n <!-- Chunk excerpts -->\n <div\n v-for=\"chunk in group.chunks\"\n :key=\"chunk.chunkId\"\n class=\"border-b border-surface-3 last:border-b-0\">\n <button\n class=\"flex items-center gap-8 px-8 py-6 w-full text-left hover:bg-surface-1 transition-colors cursor-pointer\"\n @click=\"toggleChunk(chunk.chunkId)\">\n <PkChunkPreview\n :content=\"chunk.content\"\n :similarity=\"chunk.similarity\"\n :max-similarity=\"maxSimilarity\"\n :expanded=\"expandedChunks.has(chunk.chunkId)\" />\n </button>\n\n <!-- Expanded chunk content -->\n <div\n v-if=\"expandedChunks.has(chunk.chunkId)\"\n class=\"bg-surface-1 border-t border-surface-3\">\n <div class=\"p-8 text-10 text-word-3\">\n <transition mode=\"out-in\">\n <!-- Context expansion -->\n <PkStreamingMarkdown\n v-if=\"contextData.has(chunk.chunkId)\"\n :markdown=\"\n contextData.get(chunk.chunkId)!\n \"\n class=\"wysiwyg\" />\n\n <!-- Chunk content -->\n <PkStreamingMarkdown\n v-else\n :markdown=\"chunk.content\"\n class=\"wysiwyg\" />\n </transition>\n </div>\n\n <!-- Actions bar -->\n <div\n class=\"flex items-center gap-8 px-8 py-6 border-t border-surface-3 bg-surface\">\n <!-- Expand / collapse context -->\n <button\n v-if=\"\n onExpandContext &&\n chunk.chunkIndex != null &&\n !contextData.has(chunk.chunkId)\n \"\n class=\"text-10 text-word-3 hover:text-word flex items-center gap-4 cursor-pointer\"\n :disabled=\"\n loadingContext.has(chunk.chunkId)\n \"\n @click=\"handleExpandContext(chunk)\">\n <VvIcon\n :name=\"\n loadingContext.has(chunk.chunkId)\n ? 'loading-loop'\n : 'ri:expand-up-down-line'\n \"\n class=\"text-12\" />\n {{ $t('label.expandContext') }}\n </button>\n <button\n v-else-if=\"contextData.has(chunk.chunkId)\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n @click=\"clearContext(chunk.chunkId)\">\n <VvIcon\n name=\"ri:collapse-vertical-line\"\n class=\"text-12\" />\n {{ $t('label.collapseContext') }}\n </button>\n\n <!-- Open source URL -->\n <a\n v-if=\"chunk.sourceUrl\"\n :href=\"chunk.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 ml-auto\">\n <VvIcon\n name=\"ri:external-link-line\"\n class=\"text-12\" />\n {{ $t('label.openSource') }}\n </a>\n\n <!-- Download file -->\n <button\n v-if=\"\n onDownload &&\n chunk.documentType === 'file'\n \"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n :class=\"{\n 'ml-auto': !chunk.sourceUrl,\n }\"\n @click=\"onDownload(chunk.documentId)\">\n <VvIcon\n name=\"ri:download-line\"\n class=\"text-12\" />\n {{ $t('label.downloadFile') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </li>\n </ul>\n\n <!-- Show more -->\n <button\n v-if=\"hasMore\"\n class=\"text-12 text-word-3 cursor-pointer hover:underline flex items-center gap-4 mx-auto\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: groupedSources.length - 3,\n })\n }}\n </button>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, reactive } from 'vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkChunkPreview from './PkChunkPreview.vue'\n import PkDocumentHeader from './PkDocumentHeader.vue'\n\n interface SourceItem {\n chunkId: string\n documentId: string\n documentName: string\n documentType: string\n language: string\n content: string\n chunkIndex?: number | null\n similarity?: number\n sourceUrl?: string\n sourceFilename?: string\n sourceDescription?: string\n sourceImageUrl?: string\n }\n\n const props = defineProps<{\n part: unknown\n onExpandContext?: (payload: {\n documentId: string\n chunkIndex: number\n }) => Promise<string>\n onDownload?: (documentId: string) => void\n }>()\n\n const toolPart = computed(() => {\n return props.part as {\n input?: {\n sources: SourceItem[]\n }\n }\n })\n\n const sources = computed(() => toolPart.value.input?.sources || [])\n\n const groupedSources = computed(() => {\n const groups = new Map<\n string,\n { document: SourceItem; chunks: SourceItem[] }\n >()\n for (const source of sources.value) {\n const existing = groups.get(source.documentId)\n if (existing) {\n existing.chunks.push(source)\n } else {\n groups.set(source.documentId, {\n document: source,\n chunks: [source],\n })\n }\n }\n return [...groups.values()]\n })\n\n const maxSimilarity = computed(() => {\n return Math.max(...sources.value.map((s) => s.similarity ?? 0), 0)\n })\n\n const expandedDocuments = reactive(new Set<string>())\n const expandedChunks = reactive(new Set<string>())\n const contextData = reactive(new Map<string, string>())\n const loadingContext = reactive(new Set<string>())\n\n const toggleDocument = (documentId: string) => {\n if (expandedDocuments.has(documentId)) {\n expandedDocuments.delete(documentId)\n } else {\n expandedDocuments.add(documentId)\n }\n }\n\n const toggleChunk = (chunkId: string) => {\n if (expandedChunks.has(chunkId)) {\n expandedChunks.delete(chunkId)\n } else {\n expandedChunks.add(chunkId)\n }\n }\n\n const handleExpandContext = async (source: SourceItem) => {\n if (source.chunkIndex == null || !props.onExpandContext) {\n return\n }\n loadingContext.add(source.chunkId)\n try {\n const content = await props.onExpandContext({\n documentId: source.documentId,\n chunkIndex: source.chunkIndex,\n })\n contextData.set(source.chunkId, content)\n } finally {\n loadingContext.delete(source.chunkId)\n }\n }\n\n const clearContext = (chunkId: string) => {\n contextData.delete(chunkId)\n }\n\n const showMore = ref(false)\n const visibleGroups = computed(() => {\n if (showMore.value) {\n return groupedSources.value\n }\n return groupedSources.value.slice(0, 3)\n })\n const hasMore = computed(() => groupedSources.value.length > 3)\n</script>\n\n<template>\n <div v-if=\"sources.length\" class=\"flex flex-col gap-xs w-full\">\n <div class=\"flex items-center gap-4 text-12 text-word-3 font-semibold\">\n <VvIcon name=\"ri:article-line\" class=\"text-14\" />\n {{ $t('label.sources') }}\n <span class=\"text-word-4 font-normal\">\n ({{ groupedSources.length }})\n </span>\n </div>\n\n <ul class=\"flex flex-col gap-xs\">\n <li\n v-for=\"group in visibleGroups\"\n :key=\"group.document.documentId\"\n class=\"border border-surface-3 rounded-xl overflow-hidden\">\n <!-- Document header -->\n <button\n class=\"flex items-center gap-8 p-8 w-full text-left hover:bg-surface-1 transition-colors cursor-pointer\"\n @click=\"toggleDocument(group.document.documentId)\">\n <PkDocumentHeader\n :type=\"group.document.documentType\"\n :name=\"group.document.documentName\"\n :url=\"group.document.sourceUrl\"\n :filename=\"group.document.sourceFilename\" />\n <div class=\"flex items-center gap-4 shrink-0\">\n <span\n v-if=\"group.chunks.length > 1\"\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2\">\n {{ group.chunks.length }}\n </span>\n <span\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2 uppercase\">\n {{ group.document.language }}\n </span>\n <VvIcon\n :name=\"\n expandedDocuments.has(group.document.documentId)\n ? 'ri:arrow-up-s-line'\n : 'ri:arrow-down-s-line'\n \"\n class=\"text-16 text-word-3\" />\n </div>\n </button>\n\n <!-- Expanded content -->\n <div\n v-if=\"expandedDocuments.has(group.document.documentId)\"\n class=\"border-t border-surface-3\">\n <PkStreamingMarkdown\n v-if=\"group.document.sourceDescription\"\n :markdown=\"group.document.sourceDescription\"\n class=\"px-8 py-4 text-10 text-word-3 bg-surface-1 border-b border-surface-3\" />\n\n <!-- Chunk excerpts -->\n <div\n v-for=\"chunk in group.chunks\"\n :key=\"chunk.chunkId\"\n class=\"border-b border-surface-3 last:border-b-0\">\n <button\n class=\"flex items-center gap-8 px-8 py-6 w-full text-left hover:bg-surface-1 transition-colors cursor-pointer\"\n @click=\"toggleChunk(chunk.chunkId)\">\n <PkChunkPreview\n :content=\"chunk.content\"\n :similarity=\"chunk.similarity\"\n :max-similarity=\"maxSimilarity\"\n :expanded=\"expandedChunks.has(chunk.chunkId)\" />\n </button>\n\n <!-- Expanded chunk content -->\n <div\n v-if=\"expandedChunks.has(chunk.chunkId)\"\n class=\"bg-surface-1 border-t border-surface-3\">\n <div class=\"p-8 text-10 text-word-3\">\n <transition mode=\"out-in\">\n <!-- Context expansion -->\n <PkStreamingMarkdown\n v-if=\"contextData.has(chunk.chunkId)\"\n :markdown=\"\n contextData.get(chunk.chunkId)!\n \"\n class=\"wysiwyg\" />\n\n <!-- Chunk content -->\n <PkStreamingMarkdown\n v-else\n :markdown=\"chunk.content\"\n class=\"wysiwyg\" />\n </transition>\n </div>\n\n <!-- Actions bar -->\n <div\n class=\"flex items-center gap-8 px-8 py-6 border-t border-surface-3 bg-surface\">\n <!-- Expand / collapse context -->\n <button\n v-if=\"\n onExpandContext &&\n chunk.chunkIndex != null &&\n !contextData.has(chunk.chunkId)\n \"\n class=\"text-10 text-word-3 hover:text-word flex items-center gap-4 cursor-pointer\"\n :disabled=\"\n loadingContext.has(chunk.chunkId)\n \"\n @click=\"handleExpandContext(chunk)\">\n <VvIcon\n :name=\"\n loadingContext.has(chunk.chunkId)\n ? 'loading-loop'\n : 'ri:expand-up-down-line'\n \"\n class=\"text-12\" />\n {{ $t('label.expandContext') }}\n </button>\n <button\n v-else-if=\"contextData.has(chunk.chunkId)\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n @click=\"clearContext(chunk.chunkId)\">\n <VvIcon\n name=\"ri:collapse-vertical-line\"\n class=\"text-12\" />\n {{ $t('label.collapseContext') }}\n </button>\n\n <!-- Open source URL -->\n <a\n v-if=\"chunk.sourceUrl\"\n :href=\"chunk.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 ml-auto\">\n <VvIcon\n name=\"ri:external-link-line\"\n class=\"text-12\" />\n {{ $t('label.openSource') }}\n </a>\n\n <!-- Download file -->\n <button\n v-if=\"\n onDownload &&\n chunk.documentType === 'file'\n \"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n :class=\"{\n 'ml-auto': !chunk.sourceUrl,\n }\"\n @click=\"onDownload(chunk.documentId)\">\n <VvIcon\n name=\"ri:download-line\"\n class=\"text-12\" />\n {{ $t('label.downloadFile') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </li>\n </ul>\n\n <!-- Show more -->\n <button\n v-if=\"hasMore\"\n class=\"text-12 text-word-3 cursor-pointer hover:underline flex items-center gap-4 mx-auto\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: groupedSources.length - 3,\n })\n }}\n </button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAII,IAAM,IAAQ,GAOR,IAAoB,QAAe;GACrC,IAAI,EAAM,cAAc,MACpB,OAAO;GAEX,IAAM,IACF,EAAM,iBAAiB,EAAM,gBAAgB,IACvC,EAAM,gBACN;GACV,OAAO,KAAK,MAAO,EAAM,aAAa,IAAO,GAAG;EACpD,CAAC;;;;IAID,EAAsE,GAAA;KAA9D,MAAK;KAAkB,OAAM;;IACrC,EAEO,QAAA;KAFD,OAAM;KAAuC,OAAO,EAAA;IACnD,GAAA,EAAA,EAAA,CAAA,CAAa,CAAC,EAAA,OAA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A,IAAA,EAAA;KAKC,EAAM,aADhB,EAAA,GAAA,EAUI,KAAA;;MARC,MAAM,EAAM;MACb,QAAO;MACP,KAAI;MACJ,OAAM;KACN,GAAA,CAAA,EAEsB,GAAA;MADlB,MAAK;MACL,OAAM;KAAY,CAAA,GAAA,EAAA,MACtB,EAAGA,EAAAA,GAAE,kBAAA,CAAA,GAAA,CAAA,CAAA,GAAA,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA;KAK0C,EAAA,cAAsD,EAAM,iBAAY,UAD3H,EAAA,GAAA,EAcS,UAAA;;MATL,OAAK,EAAA,CAAC,gFAA8E,EACtB,WAAA,CAAA,EAAM,UAAA,CAAA,CAAA;MAGnE,UAAK,MAAE,EAAA,WAAW,EAAM,UAAU;KACnC,GAAA,CAAA,EAEsB,GAAA;MADlB,MAAK;MACL,OAAM;KAAY,CAAA,GAAA,EAAA,MACtB,EAAGA,EAAAA,GAAE,oBAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAA,CAAA,KAAA,EAAA,IAAA,EAAA;;IAWvB,EAAA,SADV,EAAA,GAAA,EAcS,UAAA;;KAZL,OAAM;KACL,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAQ,CAAI,EAAA;IACpB,GAAA,CAAA,EAEsB,GAAA;KADjB,MAAM,EAAA,QAAQ,uBAAA;KACf,OAAM;IAAY,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,GAAA,EAAA,MACtB,EACI,EAAA,QAA+BA,EAAAA,GAAE,iBAAA,IAA0CA,EAAAA,GAAE,mBAAA,EAAuD,OAAA,EAAA,MAAe,SAAM,EAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA"}
1
+ {"version":3,"file":"PkToolShowSources-DDZokZow.js","names":["$t"],"sources":["../../../../packages/components/src/chat/PkChunkPreview.vue","../../../../packages/components/src/chat/PkChunkPreview.vue","../../../../packages/components/src/chat/PkDocumentHeader.vue","../../../../packages/components/src/chat/PkDocumentHeader.vue","../../../../packages/components/src/chat/PkToolShowSources.vue","../../../../packages/components/src/chat/PkToolShowSources.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { stripMarkdown } from 'utils'\n\n const props = defineProps<{\n content: string\n similarity?: number\n maxSimilarity?: number\n expanded: boolean\n }>()\n\n const similarityPercent = computed(() => {\n if (props.similarity == null) {\n return null\n }\n const max =\n props.maxSimilarity && props.maxSimilarity > 0\n ? props.maxSimilarity\n : 1\n return Math.round((props.similarity / max) * 100)\n })\n</script>\n\n<template>\n <VvIcon name=\"ri:text-snippet\" class=\"shrink-0 text-12 text-word-4\" />\n <span class=\"text-10 text-word-2 truncate flex-1\" :title=\"content\">\n {{ stripMarkdown(content) }}\n </span>\n <span v-if=\"similarityPercent != null\" class=\"text-10 text-word-4 shrink-0\">\n {{ similarityPercent }}%\n </span>\n <VvIcon\n :name=\"expanded ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-14 text-word-4 shrink-0\" />\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { stripMarkdown } from 'utils'\n\n const props = defineProps<{\n content: string\n similarity?: number\n maxSimilarity?: number\n expanded: boolean\n }>()\n\n const similarityPercent = computed(() => {\n if (props.similarity == null) {\n return null\n }\n const max =\n props.maxSimilarity && props.maxSimilarity > 0\n ? props.maxSimilarity\n : 1\n return Math.round((props.similarity / max) * 100)\n })\n</script>\n\n<template>\n <VvIcon name=\"ri:text-snippet\" class=\"shrink-0 text-12 text-word-4\" />\n <span class=\"text-10 text-word-2 truncate flex-1\" :title=\"content\">\n {{ stripMarkdown(content) }}\n </span>\n <span v-if=\"similarityPercent != null\" class=\"text-10 text-word-4 shrink-0\">\n {{ similarityPercent }}%\n </span>\n <VvIcon\n :name=\"expanded ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-14 text-word-4 shrink-0\" />\n</template>\n","<script setup lang=\"ts\">\n import type { DocumentType } from 'models'\n import { getTypeIcon } from 'models'\n import PkUrl from '../PkUrl.vue'\n\n defineProps<{\n type: string\n name: string\n url?: string\n filename?: string\n }>()\n</script>\n\n<template>\n <VvIcon\n :name=\"getTypeIcon(type as DocumentType)\"\n class=\"shrink-0 text-14 text-word-3\" />\n <div class=\"flex flex-col gap-2 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate block\">\n {{ name }}\n </strong>\n <span v-if=\"filename\" class=\"text-10 text-word-4 truncate\">\n {{ filename }}\n </span>\n <span\n v-if=\"url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-10\" />\n <PkUrl :url=\"url\" />\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import type { DocumentType } from 'models'\n import { getTypeIcon } from 'models'\n import PkUrl from '../PkUrl.vue'\n\n defineProps<{\n type: string\n name: string\n url?: string\n filename?: string\n }>()\n</script>\n\n<template>\n <VvIcon\n :name=\"getTypeIcon(type as DocumentType)\"\n class=\"shrink-0 text-14 text-word-3\" />\n <div class=\"flex flex-col gap-2 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate block\">\n {{ name }}\n </strong>\n <span v-if=\"filename\" class=\"text-10 text-word-4 truncate\">\n {{ filename }}\n </span>\n <span\n v-if=\"url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-10\" />\n <PkUrl :url=\"url\" />\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, reactive } from 'vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkChunkPreview from './PkChunkPreview.vue'\n import PkDocumentHeader from './PkDocumentHeader.vue'\n\n interface SourceItem {\n chunkId: string\n documentId: string\n documentName: string\n documentType: string\n language: string\n content: string\n chunkIndex?: number | null\n similarity?: number\n sourceUrl?: string\n sourceFilename?: string\n sourceDescription?: string\n sourceImageUrl?: string\n }\n\n const props = defineProps<{\n part: unknown\n onExpandContext?: (payload: {\n documentId: string\n chunkIndex: number\n }) => Promise<string>\n onDownload?: (documentId: string) => void\n }>()\n\n const toolPart = computed(() => {\n return props.part as {\n input?: {\n sources: SourceItem[]\n }\n }\n })\n\n const sources = computed(() => toolPart.value.input?.sources || [])\n\n const groupedSources = computed(() => {\n const groups = new Map<\n string,\n { document: SourceItem; chunks: SourceItem[] }\n >()\n for (const source of sources.value) {\n const existing = groups.get(source.documentId)\n if (existing) {\n existing.chunks.push(source)\n } else {\n groups.set(source.documentId, {\n document: source,\n chunks: [source],\n })\n }\n }\n return [...groups.values()]\n })\n\n const maxSimilarity = computed(() => {\n return Math.max(...sources.value.map((s) => s.similarity ?? 0), 0)\n })\n\n const expandedDocuments = reactive(new Set<string>())\n const expandedChunks = reactive(new Set<string>())\n const contextData = reactive(new Map<string, string>())\n const loadingContext = reactive(new Set<string>())\n\n const toggleDocument = (documentId: string) => {\n if (expandedDocuments.has(documentId)) {\n expandedDocuments.delete(documentId)\n } else {\n expandedDocuments.add(documentId)\n }\n }\n\n const toggleChunk = (chunkId: string) => {\n if (expandedChunks.has(chunkId)) {\n expandedChunks.delete(chunkId)\n } else {\n expandedChunks.add(chunkId)\n }\n }\n\n const handleExpandContext = async (source: SourceItem) => {\n if (source.chunkIndex == null || !props.onExpandContext) {\n return\n }\n loadingContext.add(source.chunkId)\n try {\n const content = await props.onExpandContext({\n documentId: source.documentId,\n chunkIndex: source.chunkIndex,\n })\n contextData.set(source.chunkId, content)\n } finally {\n loadingContext.delete(source.chunkId)\n }\n }\n\n const clearContext = (chunkId: string) => {\n contextData.delete(chunkId)\n }\n\n const showMore = ref(false)\n const visibleGroups = computed(() => {\n if (showMore.value) {\n return groupedSources.value\n }\n return groupedSources.value.slice(0, 3)\n })\n const hasMore = computed(() => groupedSources.value.length > 3)\n</script>\n\n<template>\n <div v-if=\"sources.length\" class=\"flex flex-col gap-xs w-full\">\n <div class=\"flex items-center gap-4 text-12 text-word-3 font-semibold\">\n <VvIcon name=\"ri:article-line\" class=\"text-14\" />\n {{ $t('label.sources') }}\n <span class=\"text-word-4 font-normal\">\n ({{ groupedSources.length }})\n </span>\n </div>\n\n <ul class=\"flex flex-col gap-xs\">\n <li\n v-for=\"group in visibleGroups\"\n :key=\"group.document.documentId\"\n class=\"border border-surface-3 rounded-xl overflow-hidden\">\n <!-- Document header -->\n <button\n class=\"flex items-center gap-8 p-8 w-full text-left hover:bg-surface-1 transition-colors cursor-pointer\"\n @click=\"toggleDocument(group.document.documentId)\">\n <PkDocumentHeader\n :type=\"group.document.documentType\"\n :name=\"group.document.documentName\"\n :url=\"group.document.sourceUrl\"\n :filename=\"group.document.sourceFilename\" />\n <div class=\"flex items-center gap-4 shrink-0\">\n <span\n v-if=\"group.chunks.length > 1\"\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2\">\n {{ group.chunks.length }}\n </span>\n <span\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2 uppercase\">\n {{ group.document.language }}\n </span>\n <VvIcon\n :name=\"\n expandedDocuments.has(group.document.documentId)\n ? 'ri:arrow-up-s-line'\n : 'ri:arrow-down-s-line'\n \"\n class=\"text-16 text-word-3\" />\n </div>\n </button>\n\n <!-- Expanded content -->\n <div\n v-if=\"expandedDocuments.has(group.document.documentId)\"\n class=\"border-t border-surface-3\">\n <PkStreamingMarkdown\n v-if=\"group.document.sourceDescription\"\n :markdown=\"group.document.sourceDescription\"\n class=\"px-8 py-4 text-10 text-word-3 bg-surface-1 border-b border-surface-3\" />\n\n <!-- Chunk excerpts -->\n <div\n v-for=\"chunk in group.chunks\"\n :key=\"chunk.chunkId\"\n class=\"border-b border-surface-3 last:border-b-0\">\n <button\n class=\"flex items-center gap-8 px-8 py-6 w-full text-left hover:bg-surface-1 transition-colors cursor-pointer\"\n @click=\"toggleChunk(chunk.chunkId)\">\n <PkChunkPreview\n :content=\"chunk.content\"\n :similarity=\"chunk.similarity\"\n :max-similarity=\"maxSimilarity\"\n :expanded=\"expandedChunks.has(chunk.chunkId)\" />\n </button>\n\n <!-- Expanded chunk content -->\n <div\n v-if=\"expandedChunks.has(chunk.chunkId)\"\n class=\"bg-surface-1 border-t border-surface-3\">\n <div class=\"p-8 text-10 text-word-3\">\n <transition mode=\"out-in\">\n <!-- Context expansion -->\n <PkStreamingMarkdown\n v-if=\"contextData.has(chunk.chunkId)\"\n :markdown=\"\n contextData.get(chunk.chunkId)!\n \"\n class=\"wysiwyg\" />\n\n <!-- Chunk content -->\n <PkStreamingMarkdown\n v-else\n :markdown=\"chunk.content\"\n class=\"wysiwyg\" />\n </transition>\n </div>\n\n <!-- Actions bar -->\n <div\n class=\"flex items-center gap-8 px-8 py-6 border-t border-surface-3 bg-surface\">\n <!-- Expand / collapse context -->\n <button\n v-if=\"\n onExpandContext &&\n chunk.chunkIndex != null &&\n !contextData.has(chunk.chunkId)\n \"\n class=\"text-10 text-word-3 hover:text-word flex items-center gap-4 cursor-pointer\"\n :disabled=\"\n loadingContext.has(chunk.chunkId)\n \"\n @click=\"handleExpandContext(chunk)\">\n <VvIcon\n :name=\"\n loadingContext.has(chunk.chunkId)\n ? 'loading-loop'\n : 'ri:expand-up-down-line'\n \"\n class=\"text-12\" />\n {{ $t('label.expandContext') }}\n </button>\n <button\n v-else-if=\"contextData.has(chunk.chunkId)\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n @click=\"clearContext(chunk.chunkId)\">\n <VvIcon\n name=\"ri:collapse-vertical-line\"\n class=\"text-12\" />\n {{ $t('label.collapseContext') }}\n </button>\n\n <!-- Open source URL -->\n <a\n v-if=\"chunk.sourceUrl\"\n :href=\"chunk.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 ml-auto\">\n <VvIcon\n name=\"ri:external-link-line\"\n class=\"text-12\" />\n {{ $t('label.openSource') }}\n </a>\n\n <!-- Download file -->\n <button\n v-if=\"\n onDownload &&\n chunk.documentType === 'file'\n \"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n :class=\"{\n 'ml-auto': !chunk.sourceUrl,\n }\"\n @click=\"onDownload(chunk.documentId)\">\n <VvIcon\n name=\"ri:download-line\"\n class=\"text-12\" />\n {{ $t('label.downloadFile') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </li>\n </ul>\n\n <!-- Show more -->\n <button\n v-if=\"hasMore\"\n class=\"text-12 text-word-3 cursor-pointer hover:underline flex items-center gap-4 mx-auto\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: groupedSources.length - 3,\n })\n }}\n </button>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, reactive } from 'vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkChunkPreview from './PkChunkPreview.vue'\n import PkDocumentHeader from './PkDocumentHeader.vue'\n\n interface SourceItem {\n chunkId: string\n documentId: string\n documentName: string\n documentType: string\n language: string\n content: string\n chunkIndex?: number | null\n similarity?: number\n sourceUrl?: string\n sourceFilename?: string\n sourceDescription?: string\n sourceImageUrl?: string\n }\n\n const props = defineProps<{\n part: unknown\n onExpandContext?: (payload: {\n documentId: string\n chunkIndex: number\n }) => Promise<string>\n onDownload?: (documentId: string) => void\n }>()\n\n const toolPart = computed(() => {\n return props.part as {\n input?: {\n sources: SourceItem[]\n }\n }\n })\n\n const sources = computed(() => toolPart.value.input?.sources || [])\n\n const groupedSources = computed(() => {\n const groups = new Map<\n string,\n { document: SourceItem; chunks: SourceItem[] }\n >()\n for (const source of sources.value) {\n const existing = groups.get(source.documentId)\n if (existing) {\n existing.chunks.push(source)\n } else {\n groups.set(source.documentId, {\n document: source,\n chunks: [source],\n })\n }\n }\n return [...groups.values()]\n })\n\n const maxSimilarity = computed(() => {\n return Math.max(...sources.value.map((s) => s.similarity ?? 0), 0)\n })\n\n const expandedDocuments = reactive(new Set<string>())\n const expandedChunks = reactive(new Set<string>())\n const contextData = reactive(new Map<string, string>())\n const loadingContext = reactive(new Set<string>())\n\n const toggleDocument = (documentId: string) => {\n if (expandedDocuments.has(documentId)) {\n expandedDocuments.delete(documentId)\n } else {\n expandedDocuments.add(documentId)\n }\n }\n\n const toggleChunk = (chunkId: string) => {\n if (expandedChunks.has(chunkId)) {\n expandedChunks.delete(chunkId)\n } else {\n expandedChunks.add(chunkId)\n }\n }\n\n const handleExpandContext = async (source: SourceItem) => {\n if (source.chunkIndex == null || !props.onExpandContext) {\n return\n }\n loadingContext.add(source.chunkId)\n try {\n const content = await props.onExpandContext({\n documentId: source.documentId,\n chunkIndex: source.chunkIndex,\n })\n contextData.set(source.chunkId, content)\n } finally {\n loadingContext.delete(source.chunkId)\n }\n }\n\n const clearContext = (chunkId: string) => {\n contextData.delete(chunkId)\n }\n\n const showMore = ref(false)\n const visibleGroups = computed(() => {\n if (showMore.value) {\n return groupedSources.value\n }\n return groupedSources.value.slice(0, 3)\n })\n const hasMore = computed(() => groupedSources.value.length > 3)\n</script>\n\n<template>\n <div v-if=\"sources.length\" class=\"flex flex-col gap-xs w-full\">\n <div class=\"flex items-center gap-4 text-12 text-word-3 font-semibold\">\n <VvIcon name=\"ri:article-line\" class=\"text-14\" />\n {{ $t('label.sources') }}\n <span class=\"text-word-4 font-normal\">\n ({{ groupedSources.length }})\n </span>\n </div>\n\n <ul class=\"flex flex-col gap-xs\">\n <li\n v-for=\"group in visibleGroups\"\n :key=\"group.document.documentId\"\n class=\"border border-surface-3 rounded-xl overflow-hidden\">\n <!-- Document header -->\n <button\n class=\"flex items-center gap-8 p-8 w-full text-left hover:bg-surface-1 transition-colors cursor-pointer\"\n @click=\"toggleDocument(group.document.documentId)\">\n <PkDocumentHeader\n :type=\"group.document.documentType\"\n :name=\"group.document.documentName\"\n :url=\"group.document.sourceUrl\"\n :filename=\"group.document.sourceFilename\" />\n <div class=\"flex items-center gap-4 shrink-0\">\n <span\n v-if=\"group.chunks.length > 1\"\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2\">\n {{ group.chunks.length }}\n </span>\n <span\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2 uppercase\">\n {{ group.document.language }}\n </span>\n <VvIcon\n :name=\"\n expandedDocuments.has(group.document.documentId)\n ? 'ri:arrow-up-s-line'\n : 'ri:arrow-down-s-line'\n \"\n class=\"text-16 text-word-3\" />\n </div>\n </button>\n\n <!-- Expanded content -->\n <div\n v-if=\"expandedDocuments.has(group.document.documentId)\"\n class=\"border-t border-surface-3\">\n <PkStreamingMarkdown\n v-if=\"group.document.sourceDescription\"\n :markdown=\"group.document.sourceDescription\"\n class=\"px-8 py-4 text-10 text-word-3 bg-surface-1 border-b border-surface-3\" />\n\n <!-- Chunk excerpts -->\n <div\n v-for=\"chunk in group.chunks\"\n :key=\"chunk.chunkId\"\n class=\"border-b border-surface-3 last:border-b-0\">\n <button\n class=\"flex items-center gap-8 px-8 py-6 w-full text-left hover:bg-surface-1 transition-colors cursor-pointer\"\n @click=\"toggleChunk(chunk.chunkId)\">\n <PkChunkPreview\n :content=\"chunk.content\"\n :similarity=\"chunk.similarity\"\n :max-similarity=\"maxSimilarity\"\n :expanded=\"expandedChunks.has(chunk.chunkId)\" />\n </button>\n\n <!-- Expanded chunk content -->\n <div\n v-if=\"expandedChunks.has(chunk.chunkId)\"\n class=\"bg-surface-1 border-t border-surface-3\">\n <div class=\"p-8 text-10 text-word-3\">\n <transition mode=\"out-in\">\n <!-- Context expansion -->\n <PkStreamingMarkdown\n v-if=\"contextData.has(chunk.chunkId)\"\n :markdown=\"\n contextData.get(chunk.chunkId)!\n \"\n class=\"wysiwyg\" />\n\n <!-- Chunk content -->\n <PkStreamingMarkdown\n v-else\n :markdown=\"chunk.content\"\n class=\"wysiwyg\" />\n </transition>\n </div>\n\n <!-- Actions bar -->\n <div\n class=\"flex items-center gap-8 px-8 py-6 border-t border-surface-3 bg-surface\">\n <!-- Expand / collapse context -->\n <button\n v-if=\"\n onExpandContext &&\n chunk.chunkIndex != null &&\n !contextData.has(chunk.chunkId)\n \"\n class=\"text-10 text-word-3 hover:text-word flex items-center gap-4 cursor-pointer\"\n :disabled=\"\n loadingContext.has(chunk.chunkId)\n \"\n @click=\"handleExpandContext(chunk)\">\n <VvIcon\n :name=\"\n loadingContext.has(chunk.chunkId)\n ? 'loading-loop'\n : 'ri:expand-up-down-line'\n \"\n class=\"text-12\" />\n {{ $t('label.expandContext') }}\n </button>\n <button\n v-else-if=\"contextData.has(chunk.chunkId)\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n @click=\"clearContext(chunk.chunkId)\">\n <VvIcon\n name=\"ri:collapse-vertical-line\"\n class=\"text-12\" />\n {{ $t('label.collapseContext') }}\n </button>\n\n <!-- Open source URL -->\n <a\n v-if=\"chunk.sourceUrl\"\n :href=\"chunk.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 ml-auto\">\n <VvIcon\n name=\"ri:external-link-line\"\n class=\"text-12\" />\n {{ $t('label.openSource') }}\n </a>\n\n <!-- Download file -->\n <button\n v-if=\"\n onDownload &&\n chunk.documentType === 'file'\n \"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n :class=\"{\n 'ml-auto': !chunk.sourceUrl,\n }\"\n @click=\"onDownload(chunk.documentId)\">\n <VvIcon\n name=\"ri:download-line\"\n class=\"text-12\" />\n {{ $t('label.downloadFile') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </li>\n </ul>\n\n <!-- Show more -->\n <button\n v-if=\"hasMore\"\n class=\"text-12 text-word-3 cursor-pointer hover:underline flex items-center gap-4 mx-auto\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: groupedSources.length - 3,\n })\n }}\n </button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAII,IAAM,IAAQ,GAOR,IAAoB,QAAe;GACrC,IAAI,EAAM,cAAc,MACpB,OAAO;GAEX,IAAM,IACF,EAAM,iBAAiB,EAAM,gBAAgB,IACvC,EAAM,gBACN;GACV,OAAO,KAAK,MAAO,EAAM,aAAa,IAAO,GAAG;EACpD,CAAC;;;;IAID,EAAsE,GAAA;KAA9D,MAAK;KAAkB,OAAM;;IACrC,EAEO,QAAA;KAFD,OAAM;KAAuC,OAAO,EAAA;IACnD,GAAA,EAAA,EAAA,CAAA,CAAa,CAAC,EAAA,OAAO,CAAA,GAAA,GAAA,CAAA;IAEhB,EAAA,SAAiB,OAE7B,EAAA,IAAA,EAAA,KAFA,EAAA,GAAA,EAEO,QAFP,GAEO,EADA,EAAA,KAAiB,IAAG,MAC3B,CAAA;IACA,EAE2C,GAAA;KADtC,MAAM,EAAA,WAAQ,uBAAA;KACf,OAAM;;;;;;;;;;;;;;;;;;;;;;GEnBV,OAAA,EAAA,GAAA,EAAA,GAAA,MAAA,CAAA,EAE2C,GAAA;IADtC,MAAM,EAAA,CAAA,CAAW,CAAC,EAAA,IAAI;IACvB,OAAM;GACV,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,GAAA,EAaM,OAbN,GAaM;IAZF,EAES,UAFT,GAES,EADF,EAAA,IAAI,GAAA,CAAA;IAEC,EAAA,YAAZ,EAAA,GAAA,EAEO,QAFP,GAEO,EADA,EAAA,QAAQ,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA;IAGL,EAAA,OADV,EAAA,GAAA,EAKO,QALP,GAKO,CAFH,EAAkD,GAAA;KAA1C,MAAK;KAAU,OAAM;IAC7B,CAAA,GAAA,EAAoB,GAAA,EAAZ,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