@8wave/ai-elements 0.121.0-beta.31 → 0.121.0-beta.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{Agent-wvUJZjp3.js → Agent-BPIcUM9P.js} +145 -144
- package/dist/_chunks/Agent-BPIcUM9P.js.map +1 -0
- package/dist/_chunks/{PkChatbotFilePreview-dtGYHgFN.js → PkChatbotFilePreview-CpFXWpU7.js} +48 -35
- package/dist/_chunks/PkChatbotFilePreview-CpFXWpU7.js.map +1 -0
- package/dist/_chunks/{PkHeldImage-yQVzab3w.js → PkHeldImage-DvHKY7Vh.js} +2 -2
- package/dist/_chunks/{PkHeldImage-yQVzab3w.js.map → PkHeldImage-DvHKY7Vh.js.map} +1 -1
- package/dist/_chunks/{PkLazyImg-KPWpt_yW.js → PkLazyImg-BBFsS16D.js} +2 -2
- package/dist/_chunks/{PkLazyImg-KPWpt_yW.js.map → PkLazyImg-BBFsS16D.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-DeZn-hPo.js → PkStreamingMarkdown-C8_9bk_Y.js} +8 -8
- package/dist/_chunks/PkStreamingMarkdown-C8_9bk_Y.js.map +1 -0
- package/dist/_chunks/{PkToolEditSpreadsheet-BJEWc_nV.js → PkToolEditSpreadsheet-DM5BCKd2.js} +3 -3
- package/dist/_chunks/{PkToolEditSpreadsheet-BJEWc_nV.js.map → PkToolEditSpreadsheet-DM5BCKd2.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-CPU3e3iJ.js → PkToolRequestGeolocation-DnZFIG1Q.js} +3 -3
- package/dist/_chunks/{PkToolRequestGeolocation-CPU3e3iJ.js.map → PkToolRequestGeolocation-DnZFIG1Q.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-C8nfpS3d.js → PkToolRequestOAuthConnection-9LX5kQ43.js} +4 -4
- package/dist/_chunks/{PkToolRequestOAuthConnection-C8nfpS3d.js.map → PkToolRequestOAuthConnection-9LX5kQ43.js.map} +1 -1
- package/dist/_chunks/PkToolShareDocument-BhT59J9o.js +64 -0
- package/dist/_chunks/PkToolShareDocument-BhT59J9o.js.map +1 -0
- package/dist/_chunks/{PkToolShowArtifact-Bt_qBvdI.js → PkToolShowArtifact-2ovT7cCd.js} +4 -4
- package/dist/_chunks/{PkToolShowArtifact-Bt_qBvdI.js.map → PkToolShowArtifact-2ovT7cCd.js.map} +1 -1
- package/dist/_chunks/{PkToolShowCalendarEvent-K4_7WrtL.js → PkToolShowCalendarEvent-Dzh4JURs.js} +4 -4
- package/dist/_chunks/{PkToolShowCalendarEvent-K4_7WrtL.js.map → PkToolShowCalendarEvent-Dzh4JURs.js.map} +1 -1
- package/dist/_chunks/{PkToolShowComparison-whPYJiI5.js → PkToolShowComparison-CFHrXnaB.js} +4 -4
- package/dist/_chunks/{PkToolShowComparison-whPYJiI5.js.map → PkToolShowComparison-CFHrXnaB.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-BwKW5txM.js → PkToolShowContactForm-Bkoa-XYM.js} +5 -5
- package/dist/_chunks/{PkToolShowContactForm-BwKW5txM.js.map → PkToolShowContactForm-Bkoa-XYM.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-CXpSKtDS.js → PkToolShowDiagram-DGnIuRst.js} +4 -4
- package/dist/_chunks/{PkToolShowDiagram-CXpSKtDS.js.map → PkToolShowDiagram-DGnIuRst.js.map} +1 -1
- package/dist/_chunks/{PkToolShowEmail-w6YoMH75.js → PkToolShowEmail-C3jped-R.js} +4 -4
- package/dist/_chunks/{PkToolShowEmail-w6YoMH75.js.map → PkToolShowEmail-C3jped-R.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-DJhe2pV3.js → PkToolShowForm-CvAgDlx8.js} +5 -5
- package/dist/_chunks/{PkToolShowForm-DJhe2pV3.js.map → PkToolShowForm-CvAgDlx8.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-DPEIoeDc.js → PkToolShowImageGallery-CjA-r8o5.js} +4 -4
- package/dist/_chunks/{PkToolShowImageGallery-DPEIoeDc.js.map → PkToolShowImageGallery-CjA-r8o5.js.map} +1 -1
- package/dist/_chunks/{PkToolShowLocation-CPFldsb9.js → PkToolShowLocation-gyMiVjhi.js} +4 -4
- package/dist/_chunks/{PkToolShowLocation-CPFldsb9.js.map → PkToolShowLocation-gyMiVjhi.js.map} +1 -1
- package/dist/_chunks/{PkToolShowMessage-CLoGgUhg.js → PkToolShowMessage-wGPPnOAM.js} +4 -4
- package/dist/_chunks/{PkToolShowMessage-CLoGgUhg.js.map → PkToolShowMessage-wGPPnOAM.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-C5alYUrB.js → PkToolShowProductList-DGPs57sX.js} +5 -5
- package/dist/_chunks/{PkToolShowProductList-C5alYUrB.js.map → PkToolShowProductList-DGPs57sX.js.map} +1 -1
- package/dist/_chunks/{PkToolShowQrCode-CBPbE62N.js → PkToolShowQrCode-CeZsvZvb.js} +4 -4
- package/dist/_chunks/{PkToolShowQrCode-CBPbE62N.js.map → PkToolShowQrCode-CeZsvZvb.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-CkwbyMdU.js → PkToolShowSources-BVuYkrXs.js} +5 -5
- package/dist/_chunks/{PkToolShowSources-CkwbyMdU.js.map → PkToolShowSources-BVuYkrXs.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-C-yCzH_d.js → PkToolShowSuggestedReply-B869o1YP.js} +3 -3
- package/dist/_chunks/{PkToolShowSuggestedReply-C-yCzH_d.js.map → PkToolShowSuggestedReply-B869o1YP.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-DL554qVB.js → PkToolShowVideo-DayRkHzW.js} +4 -4
- package/dist/_chunks/{PkToolShowVideo-DL554qVB.js.map → PkToolShowVideo-DayRkHzW.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWeather-BKFV5n-r.js → PkToolShowWeather-BgS4_SWb.js} +2 -2
- package/dist/_chunks/{PkToolShowWeather-BKFV5n-r.js.map → PkToolShowWeather-BgS4_SWb.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-D35l7s9P.js → PkToolShowWebPages-DTwnqmP-.js} +5 -5
- package/dist/_chunks/{PkToolShowWebPages-D35l7s9P.js.map → PkToolShowWebPages-DTwnqmP-.js.map} +1 -1
- package/dist/_chunks/{VvButtonLocalized-Y9bOC2EC.js → VvButtonLocalized-B6igS2e0.js} +2 -2
- package/dist/_chunks/{VvButtonLocalized-Y9bOC2EC.js.map → VvButtonLocalized-B6igS2e0.js.map} +1 -1
- package/dist/_chunks/{VvCheckboxGroup.es-BeN3V7ep.js → VvCheckboxGroup.es-OXhptnPU.js} +2 -2
- package/dist/_chunks/{VvCheckboxGroup.es-BeN3V7ep.js.map → VvCheckboxGroup.es-OXhptnPU.js.map} +1 -1
- package/dist/_chunks/{VvCombobox.es-6MTBCvkm.js → VvCombobox.es-SLzX9VnX.js} +100 -100
- package/dist/_chunks/{VvCombobox.es-6MTBCvkm.js.map → VvCombobox.es-SLzX9VnX.js.map} +1 -1
- package/dist/_chunks/{VvInputText.es-CM9r6IbN.js → VvInputText.es-CETcNKlr.js} +47 -47
- package/dist/_chunks/{VvInputText.es-CM9r6IbN.js.map → VvInputText.es-CETcNKlr.js.map} +1 -1
- package/dist/_chunks/{VvRadioGroup.es-BypimFIS.js → VvRadioGroup.es-UBZBB89A.js} +2 -2
- package/dist/_chunks/{VvRadioGroup.es-BypimFIS.js.map → VvRadioGroup.es-UBZBB89A.js.map} +1 -1
- package/dist/_chunks/{VvSelect.es-BoYULWyZ.js → VvSelect.es-B_MShGnJ.js} +2 -2
- package/dist/_chunks/{VvSelect.es-BoYULWyZ.js.map → VvSelect.es-B_MShGnJ.js.map} +1 -1
- package/dist/_chunks/{VvTextarea.es-BSI_b-bF.js → VvTextarea.es-Dm2Yq3WM.js} +308 -308
- package/dist/_chunks/{VvTextarea.es-BSI_b-bF.js.map → VvTextarea.es-Dm2Yq3WM.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-Caj4GsFN.js → chatImagePolicy-IKP98mdB.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-Caj4GsFN.js.map → chatImagePolicy-IKP98mdB.js.map} +1 -1
- package/dist/_chunks/{dist---RigjU4.js → dist-Do_Ac5Yv.js} +102 -48
- package/dist/_chunks/dist-Do_Ac5Yv.js.map +1 -0
- package/dist/_chunks/{index.es-Cn-q-Lal.js → index.es-BTDKU45u.js} +93 -93
- package/dist/_chunks/{index.es-Cn-q-Lal.js.map → index.es-BTDKU45u.js.map} +1 -1
- package/dist/_chunks/{index.es-CtWcRpZ7.js → index.es-BZS9Cscn.js} +11 -11
- package/dist/_chunks/{index.es-CtWcRpZ7.js.map → index.es-BZS9Cscn.js.map} +1 -1
- package/dist/_chunks/{markdown-DzN3Q-au.js → markdown-D7lXKAr4.js} +2 -2
- package/dist/_chunks/{markdown-DzN3Q-au.js.map → markdown-D7lXKAr4.js.map} +1 -1
- package/dist/ai-elements.es.js +356 -342
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotFilePreview.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{Agent-ywfLo1Hg.js → Agent-D70vAgX4.js} +112 -110
- package/dist-vue/_chunks/Agent-D70vAgX4.js.map +1 -0
- package/dist-vue/_chunks/{Document-DqkgJZNx.js → Document-Bo4xInDb.js} +2 -2
- package/dist-vue/_chunks/{Document-DqkgJZNx.js.map → Document-Bo4xInDb.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-CLy8LgF8.js → PkChatbot-65tNfhpY.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-CLy8LgF8.js.map → PkChatbot-65tNfhpY.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-DLg5tLl5.js → PkChatbotEmptyState-CcRoSIb7.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-DLg5tLl5.js.map → PkChatbotEmptyState-CcRoSIb7.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFilePreview-D8XyjDPJ.js → PkChatbotFilePreview-Btv20Ive.js} +57 -44
- package/dist-vue/_chunks/PkChatbotFilePreview-Btv20Ive.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotInput-CjE0vZAK.js → PkChatbotInput-BeXWvNLw.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotInput-CjE0vZAK.js.map → PkChatbotInput-BeXWvNLw.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-Dzc0kzyo.js → PkChatbotMessages-BGOyBww5.js} +19 -18
- package/dist-vue/_chunks/PkChatbotMessages-BGOyBww5.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-DjGNmloY.js → PkChatbotStepPayload-DsqiKy3M.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-DjGNmloY.js.map → PkChatbotStepPayload-DsqiKy3M.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CUIWz1nJ.js → PkChatbotStepToolDetail-Bg4IBzGh.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CUIWz1nJ.js.map → PkChatbotStepToolDetail-Bg4IBzGh.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-B4r68w6z.js → PkChatbotSteps-DfeBzC1S.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-B4r68w6z.js.map → PkChatbotSteps-DfeBzC1S.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-B1iNTeQm.js → PkChatbotViewChat-Cj3MKRFE.js} +195 -190
- package/dist-vue/_chunks/PkChatbotViewChat-Cj3MKRFE.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-D608ghH3.js → PkChatbotViewConversations-GqapFcx3.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-D608ghH3.js.map → PkChatbotViewConversations-GqapFcx3.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-CTg7R5HF.js → PkChatbotViewFiles-B-P6z7eN.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-CTg7R5HF.js.map → PkChatbotViewFiles-B-P6z7eN.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-HBgg-zuj.js → PkChatbotViewProfile-Bbu10IMd.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-HBgg-zuj.js.map → PkChatbotViewProfile-Bbu10IMd.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-O7p8Vyju.js → PkStreamingMarkdown-BFrymqYD.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-O7p8Vyju.js.map → PkStreamingMarkdown-BFrymqYD.js.map} +1 -1
- package/dist-vue/_chunks/{PkSvgViewer-CZASatr4.js → PkSvgViewer-BKygi00X.js} +2 -2
- package/dist-vue/_chunks/{PkSvgViewer-CZASatr4.js.map → PkSvgViewer-BKygi00X.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-B_Ge2pGx.js → PkToolEditSpreadsheet-CfNQMSWR.js} +3 -3
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-B_Ge2pGx.js.map → PkToolEditSpreadsheet-CfNQMSWR.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-D0FIRJk2.js → PkToolRequestGeolocation-DvO0z7sQ.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-D0FIRJk2.js.map → PkToolRequestGeolocation-DvO0z7sQ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DFlZkvLP.js → PkToolRequestOAuthConnection-CTqtzwJm.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DFlZkvLP.js.map → PkToolRequestOAuthConnection-CTqtzwJm.js.map} +1 -1
- package/dist-vue/_chunks/PkToolShareDocument-C8sPmh0k.js +64 -0
- package/dist-vue/_chunks/PkToolShareDocument-C8sPmh0k.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowArtifact-BTY19659.js → PkToolShowArtifact-BKZKi6J4.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-BTY19659.js.map → PkToolShowArtifact-BKZKi6J4.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-D82n3tZ4.js → PkToolShowContactForm-CWpQaNOh.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-D82n3tZ4.js.map → PkToolShowContactForm-CWpQaNOh.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-BlIarn5u.js → PkToolShowDiagram-DElkZZVV.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowDiagram-BlIarn5u.js.map → PkToolShowDiagram-DElkZZVV.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-b5m2ahty.js → PkToolShowForm-BnM1fsi4.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-b5m2ahty.js.map → PkToolShowForm-BnM1fsi4.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-CtIphioH.js → PkToolShowImageGallery-CzcPqcoS.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowImageGallery-CtIphioH.js.map → PkToolShowImageGallery-CzcPqcoS.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-Vq4zUoN5.js → PkToolShowProductList-Cpf5SLLk.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-Vq4zUoN5.js.map → PkToolShowProductList-Cpf5SLLk.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-B-r0dOgi.js → PkToolShowSources-E7BcGvof.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-B-r0dOgi.js.map → PkToolShowSources-E7BcGvof.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-Dl2VLfJk.js → PkToolShowSuggestedReply-JTMiOpHZ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-Dl2VLfJk.js.map → PkToolShowSuggestedReply-JTMiOpHZ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-CssORBGr.js → PkToolShowVideo-DFdmzUkS.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-CssORBGr.js.map → PkToolShowVideo-DFdmzUkS.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-Bhpc1HA2.js → PkToolShowWebPages-CG_Mq77j.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-Bhpc1HA2.js.map → PkToolShowWebPages-CG_Mq77j.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-DN6SHs1X.js → createChatbotApiClient-BTrOwIYi.js} +2 -2
- package/dist-vue/_chunks/{createChatbotApiClient-DN6SHs1X.js.map → createChatbotApiClient-BTrOwIYi.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-BlIWevWi.js → useChatbotStore-KjeThRAo.js} +3 -3
- package/dist-vue/_chunks/{useChatbotStore-BlIWevWi.js.map → useChatbotStore-KjeThRAo.js.map} +1 -1
- package/dist-vue/_chunks/{utils-FkhB6Tl2.js → utils-Bf29zWlC.js} +6 -6
- package/dist-vue/_chunks/utils-Bf29zWlC.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +14 -6
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +3290 -3283
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +6 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +7 -0
- package/dist-vue/packages/components/src/chat/PkChatbotFilePreview.d.ts +12 -0
- package/dist-vue/packages/components/src/chat/PkToolShareDocument.d.ts +16 -0
- package/dist-vue/packages/components/src/chat/index.d.ts +2 -1
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +18 -0
- package/dist-vue/packages/models/src/schema/Agent.d.ts +30 -0
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +6 -0
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +6 -0
- package/package.json +1 -1
- package/dist/_chunks/Agent-wvUJZjp3.js.map +0 -1
- package/dist/_chunks/PkChatbotFilePreview-dtGYHgFN.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown-DeZn-hPo.js.map +0 -1
- package/dist/_chunks/dist---RigjU4.js.map +0 -1
- package/dist-vue/_chunks/Agent-ywfLo1Hg.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotFilePreview-D8XyjDPJ.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-Dzc0kzyo.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-B1iNTeQm.js.map +0 -1
- package/dist-vue/_chunks/utils-FkhB6Tl2.js.map +0 -1
package/dist-vue/_chunks/{PkChatbotFilePreview-D8XyjDPJ.js → PkChatbotFilePreview-Btv20Ive.js}
RENAMED
|
@@ -115,27 +115,27 @@ function j() {
|
|
|
115
115
|
}
|
|
116
116
|
//#endregion
|
|
117
117
|
//#region ../../packages/components/src/chat/PkChatbotFilePreview.vue?vue&type=script&setup=true&lang.ts
|
|
118
|
-
var
|
|
118
|
+
var M = [
|
|
119
119
|
"href",
|
|
120
120
|
"data-pswp-src",
|
|
121
121
|
"data-pswp-width",
|
|
122
122
|
"data-pswp-height",
|
|
123
123
|
"data-pswp-caption",
|
|
124
124
|
"aria-label"
|
|
125
|
-
],
|
|
125
|
+
], N = ["src", "alt"], P = {
|
|
126
126
|
key: 0,
|
|
127
127
|
class: "pk-chatbot-file-preview__status pk-chatbot-file-preview__status--overlay"
|
|
128
|
-
},
|
|
128
|
+
}, F = {
|
|
129
129
|
key: 1,
|
|
130
130
|
class: "pk-chatbot-file-preview__status pk-chatbot-file-preview__status--overlay pk-chatbot-file-preview__status--error"
|
|
131
|
-
},
|
|
131
|
+
}, I = {
|
|
132
132
|
key: 0,
|
|
133
133
|
class: "pk-chatbot-file-preview__caption"
|
|
134
|
-
},
|
|
134
|
+
}, L = ["title"], R = { class: "pk-chatbot-file-preview__meta" }, z = ["title"], B = ["title", "aria-label"], V = { class: "pk-chatbot-file-preview__body" }, H = ["title"], U = { class: "pk-chatbot-file-preview__meta" }, W = ["title"], G = [
|
|
135
135
|
"href",
|
|
136
136
|
"title",
|
|
137
137
|
"aria-label"
|
|
138
|
-
],
|
|
138
|
+
], K = ["title", "aria-label"], q = 300, J = /* @__PURE__ */ u({
|
|
139
139
|
__name: "PkChatbotFilePreview",
|
|
140
140
|
props: {
|
|
141
141
|
mediaType: {},
|
|
@@ -146,14 +146,18 @@ var ee = [
|
|
|
146
146
|
error: {},
|
|
147
147
|
removable: { type: Boolean },
|
|
148
148
|
compact: { type: Boolean },
|
|
149
|
-
showDownload: { type: Boolean }
|
|
149
|
+
showDownload: { type: Boolean },
|
|
150
|
+
onDownload: { type: Function },
|
|
151
|
+
asFile: { type: Boolean }
|
|
150
152
|
},
|
|
151
153
|
emits: ["remove"],
|
|
152
154
|
setup(e) {
|
|
153
|
-
let u = e, p =
|
|
155
|
+
let u = e, p = (e) => {
|
|
156
|
+
u.onDownload && (e.preventDefault(), u.onDownload());
|
|
157
|
+
}, _ = r(() => !u.asFile && u.mediaType.startsWith("image/")), S = r(() => {
|
|
154
158
|
let e = u.filename ?? "", t = e.lastIndexOf(".");
|
|
155
159
|
return t > 0 ? e.slice(t + 1).toLowerCase() : "";
|
|
156
|
-
}),
|
|
160
|
+
}), C = r(() => u.mediaType.split("/")[1]?.split(";")[0] ?? ""), T = [
|
|
157
161
|
{
|
|
158
162
|
test: /pdf/,
|
|
159
163
|
kind: {
|
|
@@ -194,6 +198,14 @@ var ee = [
|
|
|
194
198
|
label: "Archive"
|
|
195
199
|
}
|
|
196
200
|
},
|
|
201
|
+
{
|
|
202
|
+
test: /^image\//,
|
|
203
|
+
kind: {
|
|
204
|
+
icon: "ri:image-2-line",
|
|
205
|
+
accent: "#0ea5e9",
|
|
206
|
+
label: "Image"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
197
209
|
{
|
|
198
210
|
test: /^audio\//,
|
|
199
211
|
kind: {
|
|
@@ -226,15 +238,15 @@ var ee = [
|
|
|
226
238
|
label: "Text"
|
|
227
239
|
}
|
|
228
240
|
}
|
|
229
|
-
],
|
|
230
|
-
let e = `${u.mediaType} ${
|
|
231
|
-
for (let { test: t, kind: n } of
|
|
241
|
+
], E = r(() => {
|
|
242
|
+
let e = `${u.mediaType} ${S.value}`;
|
|
243
|
+
for (let { test: t, kind: n } of T) if (t.test(e)) return n;
|
|
232
244
|
return {
|
|
233
245
|
icon: "ri:file-line",
|
|
234
246
|
accent: "#64748b",
|
|
235
247
|
label: "File"
|
|
236
248
|
};
|
|
237
|
-
}),
|
|
249
|
+
}), D = r(() => (S.value || C.value || E.value.label).toUpperCase()), O = r(() => {
|
|
238
250
|
let e = u.size;
|
|
239
251
|
if (e === void 0 || e < 0) return;
|
|
240
252
|
if (e < 1024) return `${e} B`;
|
|
@@ -246,31 +258,31 @@ var ee = [
|
|
|
246
258
|
], n = e / 1024, r = 0;
|
|
247
259
|
for (; n >= 1024 && r < t.length - 1;) n /= 1024, r += 1;
|
|
248
260
|
return `${n < 10 ? n.toFixed(1) : Math.round(n)} ${t[r]}`;
|
|
249
|
-
}),
|
|
250
|
-
|
|
251
|
-
},
|
|
261
|
+
}), k = /* @__PURE__ */ new Map(), A = (e, t) => {
|
|
262
|
+
k.delete(e), k.set(e, t), k.size > q && k.delete(k.keys().next().value);
|
|
263
|
+
}, j = k.get(u.url), J = g(j?.status ?? "loading"), Y = g(j?.dimensions), X = (e) => {
|
|
252
264
|
let t = e.target;
|
|
253
|
-
t.naturalWidth && t.naturalHeight && (
|
|
265
|
+
t.naturalWidth && t.naturalHeight && (Y.value = {
|
|
254
266
|
width: t.naturalWidth,
|
|
255
267
|
height: t.naturalHeight
|
|
256
|
-
}),
|
|
268
|
+
}), J.value = "loaded", A(u.url, {
|
|
257
269
|
status: "loaded",
|
|
258
|
-
dimensions:
|
|
270
|
+
dimensions: Y.value
|
|
259
271
|
});
|
|
260
|
-
},
|
|
261
|
-
|
|
262
|
-
},
|
|
272
|
+
}, Z = () => {
|
|
273
|
+
J.value = "error", A(u.url, { status: "error" });
|
|
274
|
+
}, Q = r(() => Y.value ?? ne), ee = r(() => [Y.value && `${Y.value.width}×${Y.value.height}`, O.value].filter(Boolean)), te = r(() => [D.value, O.value].filter(Boolean)), ne = {
|
|
263
275
|
width: 1200,
|
|
264
276
|
height: 800
|
|
265
|
-
}, $ = g(), { init:
|
|
277
|
+
}, $ = g(), { init: re } = w({
|
|
266
278
|
gallery: $,
|
|
267
279
|
loop: !1
|
|
268
280
|
});
|
|
269
281
|
return m(async () => {
|
|
270
|
-
|
|
282
|
+
_.value && await re();
|
|
271
283
|
}), (r, u) => {
|
|
272
284
|
let m = t;
|
|
273
|
-
return
|
|
285
|
+
return _.value ? (h(), o("figure", {
|
|
274
286
|
key: 0,
|
|
275
287
|
class: d(["pk-chatbot-file-preview pk-chatbot-file-preview--image", { "pk-chatbot-file-preview--compact": e.compact }])
|
|
276
288
|
}, [
|
|
@@ -281,8 +293,8 @@ var ee = [
|
|
|
281
293
|
}, [s("a", {
|
|
282
294
|
href: e.url,
|
|
283
295
|
"data-pswp-src": e.url,
|
|
284
|
-
"data-pswp-width":
|
|
285
|
-
"data-pswp-height":
|
|
296
|
+
"data-pswp-width": Q.value.width,
|
|
297
|
+
"data-pswp-height": Q.value.height,
|
|
286
298
|
"data-pswp-caption": e.filename ?? "",
|
|
287
299
|
class: "pk-chatbot-file-preview__thumb-link",
|
|
288
300
|
"aria-label": e.filename ?? r.$t("label.file")
|
|
@@ -291,18 +303,18 @@ var ee = [
|
|
|
291
303
|
alt: e.filename,
|
|
292
304
|
decoding: "async",
|
|
293
305
|
class: "pk-chatbot-file-preview__thumb",
|
|
294
|
-
onLoad:
|
|
295
|
-
onError:
|
|
296
|
-
}, null, 40,
|
|
297
|
-
e.compact ? a("", !0) : (h(), o("figcaption",
|
|
306
|
+
onLoad: X,
|
|
307
|
+
onError: Z
|
|
308
|
+
}, null, 40, N), [[y, J.value === "loaded"]])], 8, M), e.loading || J.value === "loading" ? (h(), o("span", P, [l(m, { name: "loading-loop" })])) : J.value === "error" ? (h(), o("span", F, [l(m, { name: "ri:image-2-line" })])) : a("", !0)], 512),
|
|
309
|
+
e.compact ? a("", !0) : (h(), o("figcaption", I, [e.filename ? (h(), o("span", {
|
|
298
310
|
key: 0,
|
|
299
311
|
class: "pk-chatbot-file-preview__name",
|
|
300
312
|
title: e.filename
|
|
301
|
-
}, v(e.filename), 9,
|
|
313
|
+
}, v(e.filename), 9, L)) : a("", !0), s("span", R, [e.error ? (h(), o("span", {
|
|
302
314
|
key: 0,
|
|
303
315
|
class: "pk-chatbot-file-preview__error",
|
|
304
316
|
title: e.error
|
|
305
|
-
}, [l(m, { name: "ri:error-warning-line" }), c(" " + v(e.error), 1)], 8,
|
|
317
|
+
}, [l(m, { name: "ri:error-warning-line" }), c(" " + v(e.error), 1)], 8, z)) : (h(), o(n, { key: 1 }, [c(v(ee.value.join(" · ")), 1)], 64))])])),
|
|
306
318
|
e.removable && !e.loading ? (h(), o("button", {
|
|
307
319
|
key: 1,
|
|
308
320
|
type: "button",
|
|
@@ -310,7 +322,7 @@ var ee = [
|
|
|
310
322
|
title: r.$t("action.remove"),
|
|
311
323
|
"aria-label": r.$t("action.remove"),
|
|
312
324
|
onClick: u[0] ||= x((e) => r.$emit("remove"), ["prevent"])
|
|
313
|
-
}, [l(m, { name: "ri:close-line" })], 8,
|
|
325
|
+
}, [l(m, { name: "ri:close-line" })], 8, B)) : a("", !0)
|
|
314
326
|
], 2)) : (h(), o("div", {
|
|
315
327
|
key: 1,
|
|
316
328
|
class: d(["pk-chatbot-file-preview pk-chatbot-file-preview--doc", {
|
|
@@ -321,25 +333,25 @@ var ee = [
|
|
|
321
333
|
}, [
|
|
322
334
|
s("span", {
|
|
323
335
|
class: "pk-chatbot-file-preview__icon-tile",
|
|
324
|
-
style: f({ "--file-accent":
|
|
336
|
+
style: f({ "--file-accent": E.value.accent })
|
|
325
337
|
}, [e.loading ? (h(), i(m, {
|
|
326
338
|
key: 0,
|
|
327
339
|
name: "loading-loop",
|
|
328
340
|
class: "pk-chatbot-file-preview__icon"
|
|
329
341
|
})) : (h(), i(m, {
|
|
330
342
|
key: 1,
|
|
331
|
-
name:
|
|
343
|
+
name: E.value.icon,
|
|
332
344
|
class: "pk-chatbot-file-preview__icon"
|
|
333
345
|
}, null, 8, ["name"]))], 4),
|
|
334
|
-
s("span",
|
|
346
|
+
s("span", V, [e.filename ? (h(), o("span", {
|
|
335
347
|
key: 0,
|
|
336
348
|
class: "pk-chatbot-file-preview__name",
|
|
337
349
|
title: e.filename
|
|
338
|
-
}, v(e.filename), 9,
|
|
350
|
+
}, v(e.filename), 9, H)) : a("", !0), s("span", U, [e.error ? (h(), o("span", {
|
|
339
351
|
key: 0,
|
|
340
352
|
class: "pk-chatbot-file-preview__error",
|
|
341
353
|
title: e.error
|
|
342
|
-
}, [l(m, { name: "ri:error-warning-line" }), c(" " + v(e.error), 1)], 8,
|
|
354
|
+
}, [l(m, { name: "ri:error-warning-line" }), c(" " + v(e.error), 1)], 8, W)) : (h(), o(n, { key: 1 }, [c(v(te.value.join(" · ")), 1)], 64))])]),
|
|
343
355
|
!e.loading && !e.error && !e.compact ? (h(), o("a", {
|
|
344
356
|
key: 0,
|
|
345
357
|
href: e.url,
|
|
@@ -347,8 +359,9 @@ var ee = [
|
|
|
347
359
|
rel: "noopener noreferrer",
|
|
348
360
|
class: "pk-chatbot-file-preview__open",
|
|
349
361
|
title: r.$t("action.download"),
|
|
350
|
-
"aria-label": `${r.$t("action.download")}${e.filename ? ` — ${e.filename}` : ""}
|
|
351
|
-
|
|
362
|
+
"aria-label": `${r.$t("action.download")}${e.filename ? ` — ${e.filename}` : ""}`,
|
|
363
|
+
onClick: p
|
|
364
|
+
}, [l(m, { name: "ri:download-2-line" })], 8, G)) : a("", !0),
|
|
352
365
|
e.removable && !e.loading ? (h(), o("button", {
|
|
353
366
|
key: 1,
|
|
354
367
|
type: "button",
|
|
@@ -356,12 +369,12 @@ var ee = [
|
|
|
356
369
|
title: r.$t("action.remove"),
|
|
357
370
|
"aria-label": r.$t("action.remove"),
|
|
358
371
|
onClick: u[1] ||= (e) => r.$emit("remove")
|
|
359
|
-
}, [l(m, { name: "ri:close-line" })], 10,
|
|
372
|
+
}, [l(m, { name: "ri:close-line" })], 10, K)) : a("", !0)
|
|
360
373
|
], 2));
|
|
361
374
|
};
|
|
362
375
|
}
|
|
363
376
|
});
|
|
364
377
|
//#endregion
|
|
365
|
-
export { T as n, w as r,
|
|
378
|
+
export { T as n, w as r, J as t };
|
|
366
379
|
|
|
367
|
-
//# sourceMappingURL=PkChatbotFilePreview-
|
|
380
|
+
//# sourceMappingURL=PkChatbotFilePreview-Btv20Ive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PkChatbotFilePreview-Btv20Ive.js","names":["$t","$emit","__unplugin_components_0","_openBlock","_createElementBlock","_normalizeClass","_createElementVNode","_withDirectives","_vShow","_createVNode","_createCommentVNode","_toDisplayString","_createTextVNode","_Fragment","_withModifiers","_normalizeStyle","_createBlock","_sfc_main","loadCdnCss","PHOTOSWIPE_CSS","DEFAULT_IMAGE_SIZE","useLightbox","options","lightbox","shallowRef","onBeforeUnmount","gallery","injectPhotoSwipeOverrides","PhotoSwipeLightbox","openInNewTab","downloadable","ui","url","getCurrentSlideUrl","pswp","downloadImage","useImageSizes","sizes","ref","image","images","img","downloadUrl","toDownloadUrl","anchor","getFilenameFromUrl","name","overridesInjected","style","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","THUMB_CACHE_MAX","PkChatbotFilePreview_default","defineComponent","props","__props","onOpenClick","event","isImage","computed","extension","dot","subtype","KINDS","fileKind","haystack","test","kind","typeTag","formattedSize","bytes","units","value","unitIndex","thumbCache","setThumbCache","entry","cached","thumbStatus","dimensions","onImageLoad","onImageError","pswpSize","DEFAULT_PSWP_SIZE","imageMeta","docMeta","galleryRef","onMounted","init","_component_VvIcon","VvIcon","openBlock","createElementBlock","normalizeClass","createElementVNode","_ctx","withDirectives","vShow","createVNode","createCommentVNode","toDisplayString","createTextVNode","Fragment","_cache","withModifiers","normalizeStyle","createBlock"],"sources":["../../../../packages/components/src/composables/useLightbox.ts","../../../../packages/components/src/chat/PkChatbotFilePreview.vue","../../../../packages/components/src/chat/PkChatbotFilePreview.vue"],"sourcesContent":["import {\n onBeforeUnmount,\n ref,\n shallowRef,\n type Ref,\n type ShallowRef,\n} from 'vue'\nimport type PhotoSwipeLightbox from 'photoswipe/lightbox'\nimport type PhotoSwipe from 'photoswipe'\nimport { loadCdnCss } from 'utils'\n\nconst PHOTOSWIPE_CSS =\n 'https://cdn.jsdelivr.net/npm/photoswipe@5/dist/photoswipe.css'\n\nconst DEFAULT_IMAGE_SIZE = { width: 1200, height: 800 }\n\nexport interface LightboxImage {\n url: string\n caption?: string\n alt?: string\n /** Natural width in px — used by PhotoSwipe for proper sizing. */\n width?: number\n /** Natural height in px — used by PhotoSwipe for proper sizing. */\n height?: number\n}\n\nexport interface LightboxOptions {\n /** Container element whose child anchors are the gallery items */\n gallery: Ref<HTMLElement | undefined>\n /** CSS selector for gallery items inside the container (default: `'a[data-pswp-src]'`) */\n children?: string\n loop?: boolean\n /** Show a download button in the lightbox toolbar */\n downloadable?: boolean\n /** Show an open-in-new-tab button in the lightbox toolbar */\n openInNewTab?: boolean\n}\n\nexport interface UseLightboxReturn {\n lightbox: ShallowRef<PhotoSwipeLightbox | null>\n /** Initialises PhotoSwipe. Call this inside `onMounted`. */\n init: () => Promise<void>\n}\n\n/**\n * Encapsulates PhotoSwipe 5 initialisation, toolbar customisation, and lifecycle cleanup.\n * CSS is injected into `document.head` so the overlay works in both regular DOM and Shadow DOM.\n *\n * Usage:\n * ```ts\n * const { init } = useLightbox({ gallery: galleryRef, downloadable: true })\n * onMounted(init)\n * ```\n */\nexport function useLightbox(options: LightboxOptions): UseLightboxReturn {\n const {\n gallery,\n children = 'a[data-pswp-src]',\n loop = true,\n downloadable = true,\n openInNewTab = true,\n } = options\n\n const lightbox = shallowRef<PhotoSwipeLightbox | null>(null)\n\n const init = async () => {\n if (!gallery.value) {\n return\n }\n\n // PhotoSwipe renders its overlay into document.body, so CSS must be in\n // document.head — not inside a shadow root.\n loadCdnCss(PHOTOSWIPE_CSS)\n injectPhotoSwipeOverrides()\n\n const { default: PhotoSwipeLightbox } =\n await import('photoswipe/lightbox')\n\n lightbox.value = new PhotoSwipeLightbox({\n gallery: gallery.value,\n children,\n pswpModule: () => import('photoswipe'),\n loop,\n arrowPrevSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m10.828 12l4.95 4.95l-1.414 1.415L8 12l6.364-6.364l1.414 1.414z\"/></svg>',\n arrowNextSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z\"/></svg>',\n closeSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z\"/></svg>',\n zoomSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g class=\"pswp__icn--zoom-in\"><path fill=\"#ffffff\" d=\"m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975zM10 10V7h2v3h3v2h-3v3h-2v-3H7v-2z\"/></g><g class=\"pswp__icn--zoom-out\"><path fill=\"#ffffff\" d=\"m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975zM7 10h8v2H7z\"/></g></svg>',\n })\n\n if (openInNewTab || downloadable) {\n lightbox.value.on('uiRegister', () => {\n const ui = lightbox.value!.pswp?.ui\n if (!ui) {\n return\n }\n\n if (openInNewTab) {\n ui.registerElement({\n name: 'open-in-new-tab-button',\n order: 8,\n isButton: true,\n html: '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z\"/></svg>',\n title: 'Open in new tab',\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n if (url) {\n window.open(\n url,\n '_blank',\n 'noopener,noreferrer',\n )\n }\n },\n })\n }\n\n if (downloadable) {\n ui.registerElement({\n name: 'download-button',\n order: 9,\n isButton: true,\n html: '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z\"/></svg>',\n title: 'Download',\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n if (url) {\n downloadImage(url)\n }\n },\n })\n }\n })\n }\n\n lightbox.value.init()\n }\n\n onBeforeUnmount(() => {\n lightbox.value?.destroy()\n lightbox.value = null\n })\n\n return { lightbox, init }\n}\n\n// ---------------------------------------------------------------------------\n// Image size preloading\n// ---------------------------------------------------------------------------\n\nexport interface UseImageSizesReturn {\n preload: (\n images: Array<{ url: string; width?: number; height?: number }>,\n ) => void\n getSize: (url: string) => { width: number; height: number }\n}\n\n/**\n * Preloads natural image dimensions so PhotoSwipe can size its slides correctly.\n * When `width`/`height` are already provided they are used as-is;\n * otherwise the image is loaded in the background to read `naturalWidth`/`naturalHeight`.\n */\nexport function useImageSizes(): UseImageSizesReturn {\n const sizes = ref(new Map<string, { width: number; height: number }>())\n\n const preload = (\n images: Array<{ url: string; width?: number; height?: number }>,\n ) => {\n for (const image of images) {\n if (image.width && image.height) {\n sizes.value.set(image.url, {\n width: image.width,\n height: image.height,\n })\n continue\n }\n const img = new Image()\n img.onload = () => {\n sizes.value.set(image.url, {\n width: img.naturalWidth,\n height: img.naturalHeight,\n })\n }\n img.src = image.url\n }\n }\n\n const getSize = (url: string) => sizes.value.get(url) ?? DEFAULT_IMAGE_SIZE\n\n return { preload, getSize }\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction getCurrentSlideUrl(pswp: PhotoSwipe): string | undefined {\n return (\n pswp.currSlide?.data?.src ??\n pswp.currSlide?.data?.element\n ?.querySelector('img')\n ?.getAttribute('src') ??\n pswp.currSlide?.data?.element\n ?.querySelector('source')\n ?.getAttribute('srcset') ??\n pswp.currSlide?.data?.element?.getAttribute('src') ??\n undefined\n )\n}\n\n/**\n * Triggers a client-side download for an image URL.\n *\n * For backend media URLs (.../media/:file/view), navigates to the\n * corresponding /download endpoint which redirects to an Azure SAS URL\n * with `Content-Disposition: attachment` — no CORS issues.\n *\n * For blob: URLs (in-session uploads), uses the fetch → blob approach.\n *\n * For data: URLs (inline SVGs, etc.), use the download attribute.\n *\n * Falls back to opening in a new tab for all other cases.\n */\nfunction downloadImage(url: string): void {\n const downloadUrl = toDownloadUrl(url)\n\n const anchor = document.createElement('a')\n anchor.href = downloadUrl\n anchor.target = '_blank'\n anchor.rel = 'noopener noreferrer'\n // `download` attribute works for same-origin, data: and blob: URLs; for\n // cross-origin it is ignored but the browser still follows Content-Disposition.\n anchor.download = getFilenameFromUrl(url)\n document.body.appendChild(anchor)\n anchor.click()\n document.body.removeChild(anchor)\n}\n\n/**\n * Converts a `/view` media URL to its `/download` counterpart.\n * Leaves blob:, data: and all other URLs untouched.\n */\nfunction toDownloadUrl(url: string): string {\n return url.replace(/\\/view(\\?|$)/, '/download$1')\n}\n\nfunction getFilenameFromUrl(url: string): string {\n if (url.startsWith('data:image/svg+xml')) {\n return 'diagram.svg'\n }\n if (url.startsWith('data:')) {\n const mime = url.split(':')[1].split(';')[0]\n const ext = mime.split('/')[1] || 'bin'\n return `image.${ext}`\n }\n try {\n const pathname = new URL(url).pathname\n const name = pathname.split('/').pop()\n return name && name.includes('.') ? name : 'image'\n } catch {\n return 'image'\n }\n}\n\nlet overridesInjected = false\n\n/**\n * Injects a one-time `<style>` into `document.head` that raises\n * PhotoSwipe's z-index above any host UI (e.g. floating chat widgets\n * that use `z-index: 2147483647`).\n */\nfunction injectPhotoSwipeOverrides(): void {\n if (overridesInjected) {\n return\n }\n overridesInjected = true\n const style = document.createElement('style')\n style.textContent = [\n '.pswp__counter { font-family: sans-serif; }',\n '.pswp { z-index: 2147483647 !important; }',\n '.pswp__icn { width: 20px; height: 20px; }',\n '.pswp__button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }',\n '.pswp__icn--zoom-out { display: none; }',\n '.pswp--zoomed-in .pswp__icn--zoom-in { display: none; }',\n '.pswp--zoomed-in .pswp__icn--zoom-out { display: block; }',\n '.pswp__button--arrow .pswp__icn {left: auto; right: auto; width: 40px; height: 40px; transform: none; margin-top: -20px; }',\n ].join(' ')\n document.head.appendChild(style)\n}\n","<script lang=\"ts\" setup>\n import { computed, ref, onMounted } from 'vue'\n import { useLightbox } from '../composables/useLightbox'\n\n const props = defineProps<{\n mediaType: string\n url: string\n filename?: string\n /** Size in bytes, when known (e.g. local uploads). */\n size?: number\n loading?: boolean\n error?: string\n removable?: boolean\n /**\n * Dense layout for the composer: a small square thumbnail / slim row,\n * without the metadata caption. The full card is reserved for the\n * message log where the details matter.\n */\n compact?: boolean\n /**\n * Keeps the download button visible instead of revealing it on hover:\n * for a file the agent wrote, which the user is there to download.\n */\n showDownload?: boolean\n /**\n * Replaces the download link of a document with a call, for a file\n * whose download URL is minted on demand (a knowledge base document\n * shared in the chat). `url` stays the link's `href`.\n */\n onDownload?: () => void | Promise<void>\n /**\n * Draws an image as a file row, with its download button, instead of\n * a thumbnail: for an image whose `url` stops working while its\n * download keeps going (a shared document after its link expires).\n */\n asFile?: boolean\n }>()\n\n defineEmits<{\n remove: []\n }>()\n\n const onOpenClick = (event: MouseEvent) => {\n if (!props.onDownload) {\n return\n }\n event.preventDefault()\n void props.onDownload()\n }\n\n const isImage = computed(\n () => !props.asFile && props.mediaType.startsWith('image/'),\n )\n\n // --- File-type identity (icon + accent + human kind label) ---\n\n const extension = computed(() => {\n const name = props.filename ?? ''\n const dot = name.lastIndexOf('.')\n return dot > 0 ? name.slice(dot + 1).toLowerCase() : ''\n })\n\n // mediaType subtype, e.g. \"pdf\" from \"application/pdf\"\n const subtype = computed(\n () => props.mediaType.split('/')[1]?.split(';')[0] ?? '',\n )\n\n type FileKind = {\n icon: string\n // CSS color driving the icon glyph + tile tint\n accent: string\n label: string\n }\n\n const KINDS: Array<{ test: RegExp; kind: FileKind }> = [\n {\n test: /pdf/,\n kind: {\n icon: 'ri:file-pdf-2-line',\n accent: '#e2483d',\n label: 'PDF',\n },\n },\n {\n // Match Word specifically: the generic `document` substring also\n // appears in the XLSX/PPTX OOXML mime types (…officedocument…), so\n // matching it here would mis-label spreadsheets/decks as Word.\n test: /msword|wordprocessingml/,\n kind: {\n icon: 'ri:file-word-2-line',\n accent: '#2b7de9',\n label: 'Word',\n },\n },\n {\n test: /sheet|excel|csv/,\n kind: {\n icon: 'ri:file-excel-2-line',\n accent: '#1f9d57',\n label: 'Spreadsheet',\n },\n },\n {\n test: /presentation|powerpoint/,\n kind: {\n icon: 'ri:file-ppt-2-line',\n accent: '#d98324',\n label: 'Presentation',\n },\n },\n {\n test: /zip|compressed|x-7z|x-rar|x-tar|gzip/,\n kind: {\n icon: 'ri:file-zip-line',\n accent: '#c08a1e',\n label: 'Archive',\n },\n },\n {\n // Reached only by an image drawn as a file (`asFile`).\n test: /^image\\//,\n kind: {\n icon: 'ri:image-2-line',\n accent: '#0ea5e9',\n label: 'Image',\n },\n },\n {\n test: /^audio\\//,\n kind: {\n icon: 'ri:file-music-line',\n accent: '#8b5cf6',\n label: 'Audio',\n },\n },\n {\n test: /^video\\//,\n kind: {\n icon: 'ri:film-line',\n accent: '#6366f1',\n label: 'Video',\n },\n },\n {\n // The code an agent can take (`SUPPORTED_CODE_TYPES`).\n test: /json|javascript|typescript|xml|html|css|yaml|toml|sql|x-(?:sh|python|java|kotlin|c|csharp|go|rust|ruby|php|swift|vue)\\b/,\n kind: {\n icon: 'ri:file-code-line',\n accent: '#0d9488',\n label: 'Code',\n },\n },\n {\n test: /^text\\//,\n kind: {\n icon: 'ri:file-text-line',\n accent: '#64748b',\n label: 'Text',\n },\n },\n ]\n\n const fileKind = computed<FileKind>(() => {\n const haystack = `${props.mediaType} ${extension.value}`\n for (const { test, kind } of KINDS) {\n if (test.test(haystack)) {\n return kind\n }\n }\n return {\n icon: 'ri:file-line',\n accent: '#64748b',\n label: 'File',\n }\n })\n\n // Short type tag shown in the meta line: prefer the real extension, fall\n // back to the mime subtype, then the generic kind label.\n const typeTag = computed(() =>\n (\n extension.value ||\n subtype.value ||\n fileKind.value.label\n ).toUpperCase(),\n )\n\n // --- Size & dimensions ---\n\n const formattedSize = computed(() => {\n const bytes = props.size\n if (bytes === undefined || bytes < 0) {\n return undefined\n }\n if (bytes < 1024) {\n return `${bytes} B`\n }\n const units = ['KB', 'MB', 'GB', 'TB']\n let value = bytes / 1024\n let unitIndex = 0\n while (value >= 1024 && unitIndex < units.length - 1) {\n value /= 1024\n unitIndex += 1\n }\n return `${value < 10 ? value.toFixed(1) : Math.round(value)} ${units[unitIndex]}`\n })\n\n // Thumbnail load lifecycle. Driving the spinner and the error fallback\n // off the real <img> events (not a second background fetch) means the\n // image is requested exactly once and reuses the browser cache on any\n // later re-render, instead of re-downloading every time the message list\n // repaints.\n // Not `useImageFallback`: this tile also needs `loading` vs `loaded` and the\n // decoded dimensions, cached across remounts, so the error flag is one field\n // of a richer per-url entry rather than a standalone broken-url set.\n type ThumbStatus = 'loading' | 'loaded' | 'error'\n\n // Module-level, keyed by URL: survives component recreation. In polled\n // views (e.g. admin chat-logs, refreshed every few seconds) the whole\n // message array is replaced on each poll, so this component can be torn\n // down and rebuilt. Seeding from the cache means a URL that already\n // decoded starts in `loaded` (no spinner flash, no re-decode) instead of\n // flickering back through `loading`. This is a client-side, per-session\n // cache (no server/Redis involved); bounded to a max size so a long-lived\n // session browsing many images can't grow it without limit — the oldest\n // entry is evicted first (Map preserves insertion order).\n type ThumbEntry = {\n status: ThumbStatus\n dimensions?: { width: number; height: number }\n }\n const THUMB_CACHE_MAX = 300\n const thumbCache = new Map<string, ThumbEntry>()\n const setThumbCache = (url: string, entry: ThumbEntry) => {\n // Re-insert to mark as most-recently used, then trim from the front.\n thumbCache.delete(url)\n thumbCache.set(url, entry)\n if (thumbCache.size > THUMB_CACHE_MAX) {\n thumbCache.delete(thumbCache.keys().next().value as string)\n }\n }\n\n const cached = thumbCache.get(props.url)\n const thumbStatus = ref<ThumbStatus>(cached?.status ?? 'loading')\n\n // Natural pixel dimensions, captured once the thumbnail decodes. Doubles\n // as the size hint PhotoSwipe needs for its slide (falls back until known).\n const dimensions = ref<{ width: number; height: number } | undefined>(\n cached?.dimensions,\n )\n const onImageLoad = (event: Event) => {\n const img = event.target as HTMLImageElement\n if (img.naturalWidth && img.naturalHeight) {\n dimensions.value = {\n width: img.naturalWidth,\n height: img.naturalHeight,\n }\n }\n thumbStatus.value = 'loaded'\n setThumbCache(props.url, {\n status: 'loaded',\n dimensions: dimensions.value,\n })\n }\n const onImageError = () => {\n thumbStatus.value = 'error'\n setThumbCache(props.url, { status: 'error' })\n }\n\n const pswpSize = computed(() => dimensions.value ?? DEFAULT_PSWP_SIZE)\n\n // Meta fragments joined with \" · \" for the caption / doc subtitle.\n const imageMeta = computed(() =>\n [\n dimensions.value &&\n `${dimensions.value.width}×${dimensions.value.height}`,\n formattedSize.value,\n ].filter(Boolean),\n )\n const docMeta = computed(() =>\n [typeTag.value, formattedSize.value].filter(Boolean),\n )\n\n // --- Lightbox ---\n\n // Slide size PhotoSwipe assumes before the real dimensions are known.\n const DEFAULT_PSWP_SIZE = { width: 1200, height: 800 }\n\n const galleryRef = ref<HTMLElement>()\n const { init } = useLightbox({ gallery: galleryRef, loop: false })\n\n onMounted(async () => {\n if (!isImage.value) {\n return\n }\n await init()\n })\n</script>\n\n<template>\n <!-- Image attachment: a thumbnail tile with a metadata caption -->\n <figure\n v-if=\"isImage\"\n class=\"pk-chatbot-file-preview pk-chatbot-file-preview--image\"\n :class=\"{ 'pk-chatbot-file-preview--compact': compact }\">\n <div ref=\"galleryRef\" class=\"pk-chatbot-file-preview__thumb-wrap\">\n <a\n :href=\"url\"\n :data-pswp-src=\"url\"\n :data-pswp-width=\"pswpSize.width\"\n :data-pswp-height=\"pswpSize.height\"\n :data-pswp-caption=\"filename ?? ''\"\n class=\"pk-chatbot-file-preview__thumb-link\"\n :aria-label=\"filename ?? $t('label.file')\">\n <img\n v-show=\"thumbStatus === 'loaded'\"\n :src=\"url\"\n :alt=\"filename\"\n decoding=\"async\"\n class=\"pk-chatbot-file-preview__thumb\"\n @load=\"onImageLoad\"\n @error=\"onImageError\" />\n </a>\n <!-- Spinner until the thumbnail decodes (or while an upload is in\n flight); a fixed box keeps this from shifting the layout. -->\n <span\n v-if=\"loading || thumbStatus === 'loading'\"\n class=\"pk-chatbot-file-preview__status pk-chatbot-file-preview__status--overlay\">\n <VvIcon name=\"loading-loop\" />\n </span>\n <!-- Failed to load: a quiet icon instead of the browser's broken\n image glyph. -->\n <span\n v-else-if=\"thumbStatus === 'error'\"\n class=\"pk-chatbot-file-preview__status pk-chatbot-file-preview__status--overlay pk-chatbot-file-preview__status--error\">\n <VvIcon name=\"ri:image-2-line\" />\n </span>\n </div>\n <figcaption v-if=\"!compact\" class=\"pk-chatbot-file-preview__caption\">\n <span\n v-if=\"filename\"\n class=\"pk-chatbot-file-preview__name\"\n :title=\"filename\"\n >{{ filename }}</span\n >\n <span class=\"pk-chatbot-file-preview__meta\">\n <span\n v-if=\"error\"\n class=\"pk-chatbot-file-preview__error\"\n :title=\"error\">\n <VvIcon name=\"ri:error-warning-line\" />\n {{ error }}\n </span>\n <template v-else>{{ imageMeta.join(' · ') }}</template>\n </span>\n </figcaption>\n <button\n v-if=\"removable && !loading\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__remove\"\n :title=\"$t('action.remove')\"\n :aria-label=\"$t('action.remove')\"\n @click.prevent=\"$emit('remove')\">\n <VvIcon name=\"ri:close-line\" />\n </button>\n </figure>\n\n <!-- Document attachment: an icon tile + name + type · size -->\n <div\n v-else\n class=\"pk-chatbot-file-preview pk-chatbot-file-preview--doc\"\n :class=\"{\n 'pk-chatbot-file-preview--error': error,\n 'pk-chatbot-file-preview--compact': compact,\n 'pk-chatbot-file-preview--show-download': showDownload,\n }\">\n <span\n class=\"pk-chatbot-file-preview__icon-tile\"\n :style=\"{ '--file-accent': fileKind.accent }\">\n <VvIcon\n v-if=\"loading\"\n name=\"loading-loop\"\n class=\"pk-chatbot-file-preview__icon\" />\n <VvIcon\n v-else\n :name=\"fileKind.icon\"\n class=\"pk-chatbot-file-preview__icon\" />\n </span>\n <span class=\"pk-chatbot-file-preview__body\">\n <span\n v-if=\"filename\"\n class=\"pk-chatbot-file-preview__name\"\n :title=\"filename\"\n >{{ filename }}</span\n >\n <span class=\"pk-chatbot-file-preview__meta\">\n <span\n v-if=\"error\"\n class=\"pk-chatbot-file-preview__error\"\n :title=\"error\">\n <VvIcon name=\"ri:error-warning-line\" />\n {{ error }}\n </span>\n <template v-else>{{ docMeta.join(' · ') }}</template>\n </span>\n </span>\n <a\n v-if=\"!loading && !error && !compact\"\n :href=\"url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"pk-chatbot-file-preview__open\"\n :title=\"$t('action.download')\"\n :aria-label=\"`${$t('action.download')}${filename ? ` — ${filename}` : ''}`\"\n @click=\"onOpenClick\">\n <VvIcon name=\"ri:download-2-line\" />\n </a>\n <button\n v-if=\"removable && !loading\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__remove\"\n :class=\"{ 'pk-chatbot-file-preview__remove--inline': !compact }\"\n :title=\"$t('action.remove')\"\n :aria-label=\"$t('action.remove')\"\n @click=\"$emit('remove')\">\n <VvIcon name=\"ri:close-line\" />\n </button>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-file-preview {\n // Concentric radii: outer card and inner tiles share an 8px step.\n --file-radius: var(--rounded-lg, 12px);\n position: relative;\n max-width: 280px;\n background-color: var(--color-surface-1);\n border: 1px solid var(--color-surface-3);\n border-radius: var(--file-radius);\n color: var(--color-word-2);\n font-size: var(--text-12);\n\n &--error {\n border-color: var(--color-danger);\n }\n\n // --- Document card ---\n &--doc {\n display: flex;\n align-items: center;\n gap: var(--spacing-8);\n padding: var(--spacing-8);\n min-width: 0;\n transition:\n border-color 0.18s var(--ease-out),\n background-color 0.18s var(--ease-out),\n box-shadow 0.18s var(--ease-out);\n\n &:hover {\n border-color: var(--color-surface-4);\n background-color: var(--color-surface-2);\n box-shadow: var(--shadow-sm);\n }\n }\n\n &__icon-tile {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--spacing-36);\n height: var(--spacing-36);\n // One step down from the card radius keeps the nested tile concentric.\n border-radius: var(--rounded-md, 6px);\n // Tint derived from the file-type accent; glyph sits at full accent.\n background-color: color-mix(\n in srgb,\n var(--file-accent) 14%,\n transparent\n );\n color: var(--file-accent);\n }\n\n &__icon {\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n\n &__body {\n display: flex;\n flex-direction: column;\n gap: 1px;\n min-width: 0;\n flex: 1;\n }\n\n &__open {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--spacing-28);\n height: var(--spacing-28);\n margin-inline-start: var(--spacing-4);\n border-radius: var(--rounded);\n color: var(--color-word-3);\n text-decoration: none;\n opacity: 0;\n transition:\n opacity 0.18s var(--ease-out),\n color 0.18s var(--ease-out),\n background-color 0.18s var(--ease-out);\n\n &:hover {\n background-color: var(--color-surface-3);\n color: var(--color-word-1);\n }\n }\n\n &--doc:hover &__open,\n &--doc:focus-within &__open,\n &--show-download &__open {\n opacity: 1;\n }\n\n // Touch devices have no hover: keep the open affordance visible.\n @media (hover: none) {\n &--doc &__open {\n opacity: 1;\n }\n }\n\n // --- Image card ---\n &--image {\n display: inline-flex;\n flex-direction: column;\n margin: 0;\n }\n\n &__thumb-wrap {\n position: relative;\n display: flex;\n // Fixed box: the card claims its final footprint before the\n // image decodes, so the message log never shifts on load.\n width: 280px;\n max-width: 100%;\n height: 200px;\n background-color: var(--color-surface);\n border-radius: var(--file-radius);\n overflow: hidden;\n }\n\n &__thumb-link {\n display: flex;\n width: 100%;\n height: 100%;\n cursor: pointer;\n }\n\n &__thumb {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n &__caption {\n display: flex;\n flex-direction: column;\n gap: 1px;\n padding: var(--spacing-8);\n min-width: 0;\n }\n\n &__name {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-weight: var(--font-medium, 500);\n color: var(--color-word-1);\n }\n\n &__meta {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: var(--text-10);\n line-height: var(--leading-normal);\n // Reserve the line even while empty: image dimensions arrive\n // only after decode and must not grow the caption.\n min-height: 1.4em;\n color: var(--color-word-4);\n // Stable column for the dimensions/size figures.\n font-variant-numeric: tabular-nums;\n }\n\n &__error {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-4);\n color: var(--u-danger-text, var(--color-danger));\n\n .vv-icon {\n flex-shrink: 0;\n }\n }\n\n &__status {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n .vv-icon {\n width: var(--spacing-32);\n height: var(--spacing-32);\n }\n\n &--overlay {\n position: absolute;\n inset: 0;\n background-color: color-mix(\n in srgb,\n var(--color-surface-1) 70%,\n transparent\n );\n color: var(--color-word-1);\n }\n\n &--error {\n color: var(--color-word-4);\n }\n }\n\n // --- Remove button (input context) ---\n &__remove {\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n display: flex;\n align-items: center;\n justify-content: center;\n // Visible glyph is 18px but the hit area stays a comfortable 28px.\n width: var(--spacing-28);\n height: var(--spacing-28);\n padding: 0;\n border: none;\n border-radius: var(--rounded-full, 9999px);\n background-color: color-mix(\n in srgb,\n var(--color-surface-1) 85%,\n transparent\n );\n color: var(--color-word-2);\n cursor: pointer;\n line-height: 1;\n box-shadow: var(--shadow-sm);\n transition:\n background-color 0.18s var(--ease-out),\n color 0.18s var(--ease-out),\n scale 0.12s var(--ease-out);\n\n &:hover {\n background-color: var(--color-surface-2);\n color: var(--color-word-1);\n }\n\n &:active {\n scale: 0.96;\n }\n\n // Inside the document row the button rides inline, not overlaid\n // (size is inherited from the base).\n &--inline {\n position: static;\n flex-shrink: 0;\n box-shadow: none;\n background-color: transparent;\n color: var(--color-word-4);\n\n &:hover {\n background-color: var(--color-surface-3);\n color: var(--color-word-1);\n }\n }\n }\n\n // --- Compact (composer) chips ---\n // ChatGPT/Gemini-style: every attachment is the SAME height and carries\n // an always-visible round remove control in the top-right corner — no\n // hover-revealed actions, no size mismatch between image and file chips.\n &--compact {\n // Shared chip height so image and file chips align in the row.\n --chip-size: var(--spacing-56);\n max-width: 240px;\n\n &.pk-chatbot-file-preview--image {\n width: var(--chip-size);\n height: var(--chip-size);\n border-radius: var(--rounded-md, 6px);\n }\n\n // Fill the square; the root's `overflow: hidden` rounds the corners.\n .pk-chatbot-file-preview__thumb-wrap,\n .pk-chatbot-file-preview__thumb-link {\n width: 100%;\n height: 100%;\n }\n\n &.pk-chatbot-file-preview--doc {\n height: var(--chip-size);\n gap: var(--spacing-8);\n padding: var(--spacing-8);\n // Reserve room so the corner remove button never overlaps the\n // name/meta text.\n padding-inline-end: var(--spacing-28);\n }\n\n // Square icon tile that fills the chip height, so file chips read at\n // the same scale as image thumbnails: the chip less its padding and\n // its two 1px borders. Not `align-self: stretch` with `aspect-ratio`,\n // which Safari sizes from the chip's outer height, so the tile ran\n // past the chip's bottom edge.\n .pk-chatbot-file-preview__icon-tile {\n --chip-tile-size: calc(\n var(--chip-size) - 2 * var(--spacing-8) - 2px\n );\n width: var(--chip-tile-size);\n height: var(--chip-tile-size);\n }\n\n .pk-chatbot-file-preview__icon {\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n }\n\n // Always-visible round remove control in the top-right corner. Sits\n // just inside the chip (an ancestor clips overflow), bigger than before,\n // with an extended hit area for easy tapping.\n &--compact &__remove {\n top: var(--spacing-4);\n right: var(--spacing-4);\n width: var(--spacing-24);\n height: var(--spacing-24);\n border: 1px solid var(--color-surface-4);\n background-color: var(--color-surface);\n color: var(--color-word-1);\n font-size: var(--text-16);\n box-shadow: var(--shadow-sm);\n\n // Comfortable touch/click target beyond the small visible glyph.\n &::after {\n content: '';\n position: absolute;\n inset: calc(-1 * var(--spacing-4));\n }\n\n &:hover {\n background-color: var(--color-surface-2);\n color: var(--color-word-1);\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n &--doc,\n &__open,\n &__remove {\n transition: none;\n }\n }\n }\n</style>\n","<script lang=\"ts\" setup>\n import { computed, ref, onMounted } from 'vue'\n import { useLightbox } from '../composables/useLightbox'\n\n const props = defineProps<{\n mediaType: string\n url: string\n filename?: string\n /** Size in bytes, when known (e.g. local uploads). */\n size?: number\n loading?: boolean\n error?: string\n removable?: boolean\n /**\n * Dense layout for the composer: a small square thumbnail / slim row,\n * without the metadata caption. The full card is reserved for the\n * message log where the details matter.\n */\n compact?: boolean\n /**\n * Keeps the download button visible instead of revealing it on hover:\n * for a file the agent wrote, which the user is there to download.\n */\n showDownload?: boolean\n /**\n * Replaces the download link of a document with a call, for a file\n * whose download URL is minted on demand (a knowledge base document\n * shared in the chat). `url` stays the link's `href`.\n */\n onDownload?: () => void | Promise<void>\n /**\n * Draws an image as a file row, with its download button, instead of\n * a thumbnail: for an image whose `url` stops working while its\n * download keeps going (a shared document after its link expires).\n */\n asFile?: boolean\n }>()\n\n defineEmits<{\n remove: []\n }>()\n\n const onOpenClick = (event: MouseEvent) => {\n if (!props.onDownload) {\n return\n }\n event.preventDefault()\n void props.onDownload()\n }\n\n const isImage = computed(\n () => !props.asFile && props.mediaType.startsWith('image/'),\n )\n\n // --- File-type identity (icon + accent + human kind label) ---\n\n const extension = computed(() => {\n const name = props.filename ?? ''\n const dot = name.lastIndexOf('.')\n return dot > 0 ? name.slice(dot + 1).toLowerCase() : ''\n })\n\n // mediaType subtype, e.g. \"pdf\" from \"application/pdf\"\n const subtype = computed(\n () => props.mediaType.split('/')[1]?.split(';')[0] ?? '',\n )\n\n type FileKind = {\n icon: string\n // CSS color driving the icon glyph + tile tint\n accent: string\n label: string\n }\n\n const KINDS: Array<{ test: RegExp; kind: FileKind }> = [\n {\n test: /pdf/,\n kind: {\n icon: 'ri:file-pdf-2-line',\n accent: '#e2483d',\n label: 'PDF',\n },\n },\n {\n // Match Word specifically: the generic `document` substring also\n // appears in the XLSX/PPTX OOXML mime types (…officedocument…), so\n // matching it here would mis-label spreadsheets/decks as Word.\n test: /msword|wordprocessingml/,\n kind: {\n icon: 'ri:file-word-2-line',\n accent: '#2b7de9',\n label: 'Word',\n },\n },\n {\n test: /sheet|excel|csv/,\n kind: {\n icon: 'ri:file-excel-2-line',\n accent: '#1f9d57',\n label: 'Spreadsheet',\n },\n },\n {\n test: /presentation|powerpoint/,\n kind: {\n icon: 'ri:file-ppt-2-line',\n accent: '#d98324',\n label: 'Presentation',\n },\n },\n {\n test: /zip|compressed|x-7z|x-rar|x-tar|gzip/,\n kind: {\n icon: 'ri:file-zip-line',\n accent: '#c08a1e',\n label: 'Archive',\n },\n },\n {\n // Reached only by an image drawn as a file (`asFile`).\n test: /^image\\//,\n kind: {\n icon: 'ri:image-2-line',\n accent: '#0ea5e9',\n label: 'Image',\n },\n },\n {\n test: /^audio\\//,\n kind: {\n icon: 'ri:file-music-line',\n accent: '#8b5cf6',\n label: 'Audio',\n },\n },\n {\n test: /^video\\//,\n kind: {\n icon: 'ri:film-line',\n accent: '#6366f1',\n label: 'Video',\n },\n },\n {\n // The code an agent can take (`SUPPORTED_CODE_TYPES`).\n test: /json|javascript|typescript|xml|html|css|yaml|toml|sql|x-(?:sh|python|java|kotlin|c|csharp|go|rust|ruby|php|swift|vue)\\b/,\n kind: {\n icon: 'ri:file-code-line',\n accent: '#0d9488',\n label: 'Code',\n },\n },\n {\n test: /^text\\//,\n kind: {\n icon: 'ri:file-text-line',\n accent: '#64748b',\n label: 'Text',\n },\n },\n ]\n\n const fileKind = computed<FileKind>(() => {\n const haystack = `${props.mediaType} ${extension.value}`\n for (const { test, kind } of KINDS) {\n if (test.test(haystack)) {\n return kind\n }\n }\n return {\n icon: 'ri:file-line',\n accent: '#64748b',\n label: 'File',\n }\n })\n\n // Short type tag shown in the meta line: prefer the real extension, fall\n // back to the mime subtype, then the generic kind label.\n const typeTag = computed(() =>\n (\n extension.value ||\n subtype.value ||\n fileKind.value.label\n ).toUpperCase(),\n )\n\n // --- Size & dimensions ---\n\n const formattedSize = computed(() => {\n const bytes = props.size\n if (bytes === undefined || bytes < 0) {\n return undefined\n }\n if (bytes < 1024) {\n return `${bytes} B`\n }\n const units = ['KB', 'MB', 'GB', 'TB']\n let value = bytes / 1024\n let unitIndex = 0\n while (value >= 1024 && unitIndex < units.length - 1) {\n value /= 1024\n unitIndex += 1\n }\n return `${value < 10 ? value.toFixed(1) : Math.round(value)} ${units[unitIndex]}`\n })\n\n // Thumbnail load lifecycle. Driving the spinner and the error fallback\n // off the real <img> events (not a second background fetch) means the\n // image is requested exactly once and reuses the browser cache on any\n // later re-render, instead of re-downloading every time the message list\n // repaints.\n // Not `useImageFallback`: this tile also needs `loading` vs `loaded` and the\n // decoded dimensions, cached across remounts, so the error flag is one field\n // of a richer per-url entry rather than a standalone broken-url set.\n type ThumbStatus = 'loading' | 'loaded' | 'error'\n\n // Module-level, keyed by URL: survives component recreation. In polled\n // views (e.g. admin chat-logs, refreshed every few seconds) the whole\n // message array is replaced on each poll, so this component can be torn\n // down and rebuilt. Seeding from the cache means a URL that already\n // decoded starts in `loaded` (no spinner flash, no re-decode) instead of\n // flickering back through `loading`. This is a client-side, per-session\n // cache (no server/Redis involved); bounded to a max size so a long-lived\n // session browsing many images can't grow it without limit — the oldest\n // entry is evicted first (Map preserves insertion order).\n type ThumbEntry = {\n status: ThumbStatus\n dimensions?: { width: number; height: number }\n }\n const THUMB_CACHE_MAX = 300\n const thumbCache = new Map<string, ThumbEntry>()\n const setThumbCache = (url: string, entry: ThumbEntry) => {\n // Re-insert to mark as most-recently used, then trim from the front.\n thumbCache.delete(url)\n thumbCache.set(url, entry)\n if (thumbCache.size > THUMB_CACHE_MAX) {\n thumbCache.delete(thumbCache.keys().next().value as string)\n }\n }\n\n const cached = thumbCache.get(props.url)\n const thumbStatus = ref<ThumbStatus>(cached?.status ?? 'loading')\n\n // Natural pixel dimensions, captured once the thumbnail decodes. Doubles\n // as the size hint PhotoSwipe needs for its slide (falls back until known).\n const dimensions = ref<{ width: number; height: number } | undefined>(\n cached?.dimensions,\n )\n const onImageLoad = (event: Event) => {\n const img = event.target as HTMLImageElement\n if (img.naturalWidth && img.naturalHeight) {\n dimensions.value = {\n width: img.naturalWidth,\n height: img.naturalHeight,\n }\n }\n thumbStatus.value = 'loaded'\n setThumbCache(props.url, {\n status: 'loaded',\n dimensions: dimensions.value,\n })\n }\n const onImageError = () => {\n thumbStatus.value = 'error'\n setThumbCache(props.url, { status: 'error' })\n }\n\n const pswpSize = computed(() => dimensions.value ?? DEFAULT_PSWP_SIZE)\n\n // Meta fragments joined with \" · \" for the caption / doc subtitle.\n const imageMeta = computed(() =>\n [\n dimensions.value &&\n `${dimensions.value.width}×${dimensions.value.height}`,\n formattedSize.value,\n ].filter(Boolean),\n )\n const docMeta = computed(() =>\n [typeTag.value, formattedSize.value].filter(Boolean),\n )\n\n // --- Lightbox ---\n\n // Slide size PhotoSwipe assumes before the real dimensions are known.\n const DEFAULT_PSWP_SIZE = { width: 1200, height: 800 }\n\n const galleryRef = ref<HTMLElement>()\n const { init } = useLightbox({ gallery: galleryRef, loop: false })\n\n onMounted(async () => {\n if (!isImage.value) {\n return\n }\n await init()\n })\n</script>\n\n<template>\n <!-- Image attachment: a thumbnail tile with a metadata caption -->\n <figure\n v-if=\"isImage\"\n class=\"pk-chatbot-file-preview pk-chatbot-file-preview--image\"\n :class=\"{ 'pk-chatbot-file-preview--compact': compact }\">\n <div ref=\"galleryRef\" class=\"pk-chatbot-file-preview__thumb-wrap\">\n <a\n :href=\"url\"\n :data-pswp-src=\"url\"\n :data-pswp-width=\"pswpSize.width\"\n :data-pswp-height=\"pswpSize.height\"\n :data-pswp-caption=\"filename ?? ''\"\n class=\"pk-chatbot-file-preview__thumb-link\"\n :aria-label=\"filename ?? $t('label.file')\">\n <img\n v-show=\"thumbStatus === 'loaded'\"\n :src=\"url\"\n :alt=\"filename\"\n decoding=\"async\"\n class=\"pk-chatbot-file-preview__thumb\"\n @load=\"onImageLoad\"\n @error=\"onImageError\" />\n </a>\n <!-- Spinner until the thumbnail decodes (or while an upload is in\n flight); a fixed box keeps this from shifting the layout. -->\n <span\n v-if=\"loading || thumbStatus === 'loading'\"\n class=\"pk-chatbot-file-preview__status pk-chatbot-file-preview__status--overlay\">\n <VvIcon name=\"loading-loop\" />\n </span>\n <!-- Failed to load: a quiet icon instead of the browser's broken\n image glyph. -->\n <span\n v-else-if=\"thumbStatus === 'error'\"\n class=\"pk-chatbot-file-preview__status pk-chatbot-file-preview__status--overlay pk-chatbot-file-preview__status--error\">\n <VvIcon name=\"ri:image-2-line\" />\n </span>\n </div>\n <figcaption v-if=\"!compact\" class=\"pk-chatbot-file-preview__caption\">\n <span\n v-if=\"filename\"\n class=\"pk-chatbot-file-preview__name\"\n :title=\"filename\"\n >{{ filename }}</span\n >\n <span class=\"pk-chatbot-file-preview__meta\">\n <span\n v-if=\"error\"\n class=\"pk-chatbot-file-preview__error\"\n :title=\"error\">\n <VvIcon name=\"ri:error-warning-line\" />\n {{ error }}\n </span>\n <template v-else>{{ imageMeta.join(' · ') }}</template>\n </span>\n </figcaption>\n <button\n v-if=\"removable && !loading\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__remove\"\n :title=\"$t('action.remove')\"\n :aria-label=\"$t('action.remove')\"\n @click.prevent=\"$emit('remove')\">\n <VvIcon name=\"ri:close-line\" />\n </button>\n </figure>\n\n <!-- Document attachment: an icon tile + name + type · size -->\n <div\n v-else\n class=\"pk-chatbot-file-preview pk-chatbot-file-preview--doc\"\n :class=\"{\n 'pk-chatbot-file-preview--error': error,\n 'pk-chatbot-file-preview--compact': compact,\n 'pk-chatbot-file-preview--show-download': showDownload,\n }\">\n <span\n class=\"pk-chatbot-file-preview__icon-tile\"\n :style=\"{ '--file-accent': fileKind.accent }\">\n <VvIcon\n v-if=\"loading\"\n name=\"loading-loop\"\n class=\"pk-chatbot-file-preview__icon\" />\n <VvIcon\n v-else\n :name=\"fileKind.icon\"\n class=\"pk-chatbot-file-preview__icon\" />\n </span>\n <span class=\"pk-chatbot-file-preview__body\">\n <span\n v-if=\"filename\"\n class=\"pk-chatbot-file-preview__name\"\n :title=\"filename\"\n >{{ filename }}</span\n >\n <span class=\"pk-chatbot-file-preview__meta\">\n <span\n v-if=\"error\"\n class=\"pk-chatbot-file-preview__error\"\n :title=\"error\">\n <VvIcon name=\"ri:error-warning-line\" />\n {{ error }}\n </span>\n <template v-else>{{ docMeta.join(' · ') }}</template>\n </span>\n </span>\n <a\n v-if=\"!loading && !error && !compact\"\n :href=\"url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"pk-chatbot-file-preview__open\"\n :title=\"$t('action.download')\"\n :aria-label=\"`${$t('action.download')}${filename ? ` — ${filename}` : ''}`\"\n @click=\"onOpenClick\">\n <VvIcon name=\"ri:download-2-line\" />\n </a>\n <button\n v-if=\"removable && !loading\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__remove\"\n :class=\"{ 'pk-chatbot-file-preview__remove--inline': !compact }\"\n :title=\"$t('action.remove')\"\n :aria-label=\"$t('action.remove')\"\n @click=\"$emit('remove')\">\n <VvIcon name=\"ri:close-line\" />\n </button>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-file-preview {\n // Concentric radii: outer card and inner tiles share an 8px step.\n --file-radius: var(--rounded-lg, 12px);\n position: relative;\n max-width: 280px;\n background-color: var(--color-surface-1);\n border: 1px solid var(--color-surface-3);\n border-radius: var(--file-radius);\n color: var(--color-word-2);\n font-size: var(--text-12);\n\n &--error {\n border-color: var(--color-danger);\n }\n\n // --- Document card ---\n &--doc {\n display: flex;\n align-items: center;\n gap: var(--spacing-8);\n padding: var(--spacing-8);\n min-width: 0;\n transition:\n border-color 0.18s var(--ease-out),\n background-color 0.18s var(--ease-out),\n box-shadow 0.18s var(--ease-out);\n\n &:hover {\n border-color: var(--color-surface-4);\n background-color: var(--color-surface-2);\n box-shadow: var(--shadow-sm);\n }\n }\n\n &__icon-tile {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--spacing-36);\n height: var(--spacing-36);\n // One step down from the card radius keeps the nested tile concentric.\n border-radius: var(--rounded-md, 6px);\n // Tint derived from the file-type accent; glyph sits at full accent.\n background-color: color-mix(\n in srgb,\n var(--file-accent) 14%,\n transparent\n );\n color: var(--file-accent);\n }\n\n &__icon {\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n\n &__body {\n display: flex;\n flex-direction: column;\n gap: 1px;\n min-width: 0;\n flex: 1;\n }\n\n &__open {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--spacing-28);\n height: var(--spacing-28);\n margin-inline-start: var(--spacing-4);\n border-radius: var(--rounded);\n color: var(--color-word-3);\n text-decoration: none;\n opacity: 0;\n transition:\n opacity 0.18s var(--ease-out),\n color 0.18s var(--ease-out),\n background-color 0.18s var(--ease-out);\n\n &:hover {\n background-color: var(--color-surface-3);\n color: var(--color-word-1);\n }\n }\n\n &--doc:hover &__open,\n &--doc:focus-within &__open,\n &--show-download &__open {\n opacity: 1;\n }\n\n // Touch devices have no hover: keep the open affordance visible.\n @media (hover: none) {\n &--doc &__open {\n opacity: 1;\n }\n }\n\n // --- Image card ---\n &--image {\n display: inline-flex;\n flex-direction: column;\n margin: 0;\n }\n\n &__thumb-wrap {\n position: relative;\n display: flex;\n // Fixed box: the card claims its final footprint before the\n // image decodes, so the message log never shifts on load.\n width: 280px;\n max-width: 100%;\n height: 200px;\n background-color: var(--color-surface);\n border-radius: var(--file-radius);\n overflow: hidden;\n }\n\n &__thumb-link {\n display: flex;\n width: 100%;\n height: 100%;\n cursor: pointer;\n }\n\n &__thumb {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n &__caption {\n display: flex;\n flex-direction: column;\n gap: 1px;\n padding: var(--spacing-8);\n min-width: 0;\n }\n\n &__name {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-weight: var(--font-medium, 500);\n color: var(--color-word-1);\n }\n\n &__meta {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: var(--text-10);\n line-height: var(--leading-normal);\n // Reserve the line even while empty: image dimensions arrive\n // only after decode and must not grow the caption.\n min-height: 1.4em;\n color: var(--color-word-4);\n // Stable column for the dimensions/size figures.\n font-variant-numeric: tabular-nums;\n }\n\n &__error {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-4);\n color: var(--u-danger-text, var(--color-danger));\n\n .vv-icon {\n flex-shrink: 0;\n }\n }\n\n &__status {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n .vv-icon {\n width: var(--spacing-32);\n height: var(--spacing-32);\n }\n\n &--overlay {\n position: absolute;\n inset: 0;\n background-color: color-mix(\n in srgb,\n var(--color-surface-1) 70%,\n transparent\n );\n color: var(--color-word-1);\n }\n\n &--error {\n color: var(--color-word-4);\n }\n }\n\n // --- Remove button (input context) ---\n &__remove {\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n display: flex;\n align-items: center;\n justify-content: center;\n // Visible glyph is 18px but the hit area stays a comfortable 28px.\n width: var(--spacing-28);\n height: var(--spacing-28);\n padding: 0;\n border: none;\n border-radius: var(--rounded-full, 9999px);\n background-color: color-mix(\n in srgb,\n var(--color-surface-1) 85%,\n transparent\n );\n color: var(--color-word-2);\n cursor: pointer;\n line-height: 1;\n box-shadow: var(--shadow-sm);\n transition:\n background-color 0.18s var(--ease-out),\n color 0.18s var(--ease-out),\n scale 0.12s var(--ease-out);\n\n &:hover {\n background-color: var(--color-surface-2);\n color: var(--color-word-1);\n }\n\n &:active {\n scale: 0.96;\n }\n\n // Inside the document row the button rides inline, not overlaid\n // (size is inherited from the base).\n &--inline {\n position: static;\n flex-shrink: 0;\n box-shadow: none;\n background-color: transparent;\n color: var(--color-word-4);\n\n &:hover {\n background-color: var(--color-surface-3);\n color: var(--color-word-1);\n }\n }\n }\n\n // --- Compact (composer) chips ---\n // ChatGPT/Gemini-style: every attachment is the SAME height and carries\n // an always-visible round remove control in the top-right corner — no\n // hover-revealed actions, no size mismatch between image and file chips.\n &--compact {\n // Shared chip height so image and file chips align in the row.\n --chip-size: var(--spacing-56);\n max-width: 240px;\n\n &.pk-chatbot-file-preview--image {\n width: var(--chip-size);\n height: var(--chip-size);\n border-radius: var(--rounded-md, 6px);\n }\n\n // Fill the square; the root's `overflow: hidden` rounds the corners.\n .pk-chatbot-file-preview__thumb-wrap,\n .pk-chatbot-file-preview__thumb-link {\n width: 100%;\n height: 100%;\n }\n\n &.pk-chatbot-file-preview--doc {\n height: var(--chip-size);\n gap: var(--spacing-8);\n padding: var(--spacing-8);\n // Reserve room so the corner remove button never overlaps the\n // name/meta text.\n padding-inline-end: var(--spacing-28);\n }\n\n // Square icon tile that fills the chip height, so file chips read at\n // the same scale as image thumbnails: the chip less its padding and\n // its two 1px borders. Not `align-self: stretch` with `aspect-ratio`,\n // which Safari sizes from the chip's outer height, so the tile ran\n // past the chip's bottom edge.\n .pk-chatbot-file-preview__icon-tile {\n --chip-tile-size: calc(\n var(--chip-size) - 2 * var(--spacing-8) - 2px\n );\n width: var(--chip-tile-size);\n height: var(--chip-tile-size);\n }\n\n .pk-chatbot-file-preview__icon {\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n }\n\n // Always-visible round remove control in the top-right corner. Sits\n // just inside the chip (an ancestor clips overflow), bigger than before,\n // with an extended hit area for easy tapping.\n &--compact &__remove {\n top: var(--spacing-4);\n right: var(--spacing-4);\n width: var(--spacing-24);\n height: var(--spacing-24);\n border: 1px solid var(--color-surface-4);\n background-color: var(--color-surface);\n color: var(--color-word-1);\n font-size: var(--text-16);\n box-shadow: var(--shadow-sm);\n\n // Comfortable touch/click target beyond the small visible glyph.\n &::after {\n content: '';\n position: absolute;\n inset: calc(-1 * var(--spacing-4));\n }\n\n &:hover {\n background-color: var(--color-surface-2);\n color: var(--color-word-1);\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n &--doc,\n &__open,\n &__remove {\n transition: none;\n }\n }\n }\n</style>\n"],"mappings":";;;;;AAWA,IAAMmB,IACF,iEAEEC,IAAqB;CAAE,OAAO;CAAM,QAAQ;AAAI;AAwCtD,SAAgBC,EAAY,GAA6C;CACrE,IAAM,EACF,YACA,cAAW,oBACX,UAAO,IACP,kBAAe,IACf,kBAAe,OACfC,GAEEC,IAAWC,EAAsC,IAAI;CAmF3D,OALAC,QAAsB;EAElB,AADAF,EAAS,OAAO,QAAQ,GACxB,EAAS,QAAQ;CACrB,CAAC,GAEM;EAAE;EAAU,kBAjFM;GACrB,IAAI,CAACG,EAAQ,OACT;GAMJ,AADAR,EAAWC,CAAc,GACzBQ,EAA0B;GAE1B,IAAM,EAAE,SAASC,MACb,MAAM,OAAO;GA8DjB,AA5DA,EAAS,QAAQ,IAAIA,EAAmB;IACpC,SAASF,EAAQ;IACjB;IACA,kBAAkB,OAAO;IACzB;IACA,cACI;IACJ,cACI;IACJ,UACI;IACJ,SACI;GACR,CAAC,IAEGG,KAAgBC,MAChBP,EAAS,MAAM,GAAG,oBAAoB;IAClC,IAAMQ,IAAKR,EAAS,MAAO,MAAM;IACjC,AAAKQ,MAIDF,KACAE,EAAG,gBAAg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E,iBAAA,IAAsBoE,EAAA,WAAQ,MAASA,EAAA,aAAQ;KAChE,SAAOC;IACR5D,GAAAA,CAAAA,EAAoC6F,GAAA,EAA5B,MAAK,qBAAoB,CAAA,CAAA,GAAA,GAAAxC,CAAA,KAAAkD,EAAA,IAAA,EAAA;IAG3B5C,EAAA,aAAS,CAAKA,EAAA,WADxBjE,EAAA,GAAAC,EASS,UAAA;;KAPL,MAAK;KACL,OAAKC,EAAA,CAAC,mCAAiC,EAAA,2CAAA,CACe+D,EAAA,QAAO,CAAA,CAAA;KAC5D,OAAOpE,EAAAA,GAAE,eAAA;KACT,cAAYA,EAAAA,GAAE,eAAA;KACd,SAAK,AAAAoH,EAAA,QAAA,MAAEnH,EAAAA,MAAK,QAAA;IACbQ,GAAAA,CAAAA,EAA+B6F,GAAA,EAAvB,MAAK,gBAAe,CAAA,CAAA,GAAA,IAAAvC,CAAA,KAAAiD,EAAA,IAAA,EAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as e } from "./Media-D-UGzdcW.js";
|
|
2
2
|
import { t } from "./VvButtonLocalized-BuzLsXp3.js";
|
|
3
|
-
import { t as n } from "./PkStreamingMarkdown-
|
|
4
|
-
import { t as r } from "./PkChatbotFilePreview-
|
|
3
|
+
import { t as n } from "./PkStreamingMarkdown-BFrymqYD.js";
|
|
4
|
+
import { t as r } from "./PkChatbotFilePreview-Btv20Ive.js";
|
|
5
5
|
import { VvDropdown as i, VvDropdownAction as a, VvIcon as o } from "@volverjs/ui-vue/components";
|
|
6
6
|
import { Fragment 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, mergeModels as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeProps as ee, onBeforeUnmount as b, onMounted as x, openBlock as S, ref as C, renderList as te, renderSlot as ne, toDisplayString as w, unref as T, useId as re, useModel as E, useTemplateRef as D, watch as O, withCtx as k, withKeys as ie, withModifiers as ae } from "vue";
|
|
7
7
|
import { useResizeObserver as oe } from "@vueuse/core";
|
|
@@ -394,4 +394,4 @@ var P = N, F = ["type"], I = {
|
|
|
394
394
|
//#endregion
|
|
395
395
|
export { L as n, R as t };
|
|
396
396
|
|
|
397
|
-
//# sourceMappingURL=PkChatbotInput-
|
|
397
|
+
//# sourceMappingURL=PkChatbotInput-BeXWvNLw.js.map
|