@8wave/ai-elements 0.125.0-beta.33 → 0.125.0-beta.34

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 (134) hide show
  1. package/dist/_chunks/{Agent-BZiorSrE.js → Agent-CnCu6gNx.js} +2 -1
  2. package/dist/_chunks/{Agent-BZiorSrE.js.map → Agent-CnCu6gNx.js.map} +1 -1
  3. package/dist/_chunks/{PkFilePreview-DCk2wnP9.js → PkFilePreview-Ctp30WJH.js} +3 -3
  4. package/dist/_chunks/{PkFilePreview-DCk2wnP9.js.map → PkFilePreview-Ctp30WJH.js.map} +1 -1
  5. package/dist/_chunks/{PkFilePreviewDialog-BFGUstHI.js → PkFilePreviewDialog-B8JKpCXy.js} +2 -2
  6. package/dist/_chunks/{PkFilePreviewDialog-BFGUstHI.js.map → PkFilePreviewDialog-B8JKpCXy.js.map} +1 -1
  7. package/dist/_chunks/{PkSelectionActions-DMqJYWem.js → PkSelectionActions-BOuC5Dvy.js} +2 -2
  8. package/dist/_chunks/{PkSelectionActions-DMqJYWem.js.map → PkSelectionActions-BOuC5Dvy.js.map} +1 -1
  9. package/dist/_chunks/{PkStreamingMarkdown-CjL7l_3E.js → PkStreamingMarkdown-B0iGNA8Y.js} +3 -3
  10. package/dist/_chunks/{PkStreamingMarkdown-CjL7l_3E.js.map → PkStreamingMarkdown-B0iGNA8Y.js.map} +1 -1
  11. package/dist/_chunks/{PkToolChatFile-weptM8iA.js → PkToolChatFile-DbmXl92B.js} +3 -3
  12. package/dist/_chunks/{PkToolChatFile-weptM8iA.js.map → PkToolChatFile-DbmXl92B.js.map} +1 -1
  13. package/dist/_chunks/{PkToolRequestGeolocation-BfwRKTYt.js → PkToolRequestGeolocation-DqrwL2xq.js} +2 -2
  14. package/dist/_chunks/{PkToolRequestGeolocation-BfwRKTYt.js.map → PkToolRequestGeolocation-DqrwL2xq.js.map} +1 -1
  15. package/dist/_chunks/{PkToolRequestOAuthConnection-BeNjHyE9.js → PkToolRequestOAuthConnection-CRHMFsVo.js} +2 -2
  16. package/dist/_chunks/{PkToolRequestOAuthConnection-BeNjHyE9.js.map → PkToolRequestOAuthConnection-CRHMFsVo.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowArtifact-Bm2zS5YS.js → PkToolShowArtifact-BiIFmeNh.js} +2 -2
  18. package/dist/_chunks/{PkToolShowArtifact-Bm2zS5YS.js.map → PkToolShowArtifact-BiIFmeNh.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowContactForm-BKJCv5To.js → PkToolShowContactForm-CNLEoesy.js} +2 -2
  20. package/dist/_chunks/{PkToolShowContactForm-BKJCv5To.js.map → PkToolShowContactForm-CNLEoesy.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowForm-DvAcJgDP.js → PkToolShowForm-DSUzABRs.js} +4 -4
  22. package/dist/_chunks/{PkToolShowForm-DvAcJgDP.js.map → PkToolShowForm-DSUzABRs.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowImageGallery-D0htuXNL.js → PkToolShowImageGallery-CuSEzHyb.js} +2 -2
  24. package/dist/_chunks/{PkToolShowImageGallery-D0htuXNL.js.map → PkToolShowImageGallery-CuSEzHyb.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowProductList-BQjFsiEo.js → PkToolShowProductList-BHV90ovg.js} +2 -2
  26. package/dist/_chunks/{PkToolShowProductList-BQjFsiEo.js.map → PkToolShowProductList-BHV90ovg.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowSources-Cfj6iRGj.js → PkToolShowSources-LxKdEl5a.js} +3 -3
  28. package/dist/_chunks/{PkToolShowSources-Cfj6iRGj.js.map → PkToolShowSources-LxKdEl5a.js.map} +1 -1
  29. package/dist/_chunks/{PkToolShowSuggestedReply-C9gtEyCy.js → PkToolShowSuggestedReply-DQ64E-n3.js} +2 -2
  30. package/dist/_chunks/{PkToolShowSuggestedReply-C9gtEyCy.js.map → PkToolShowSuggestedReply-DQ64E-n3.js.map} +1 -1
  31. package/dist/_chunks/{PkToolShowVideo-CxYRfgA5.js → PkToolShowVideo-m9TYCZU4.js} +2 -2
  32. package/dist/_chunks/{PkToolShowVideo-CxYRfgA5.js.map → PkToolShowVideo-m9TYCZU4.js.map} +1 -1
  33. package/dist/_chunks/{PkToolShowWebPages-CBkk8sYx.js → PkToolShowWebPages-D836KB_D.js} +2 -2
  34. package/dist/_chunks/{PkToolShowWebPages-CBkk8sYx.js.map → PkToolShowWebPages-D836KB_D.js.map} +1 -1
  35. package/dist/_chunks/{chatImagePolicy-NToILNOC.js → chatImagePolicy-DMvnRaBQ.js} +14 -8
  36. package/dist/_chunks/chatImagePolicy-DMvnRaBQ.js.map +1 -0
  37. package/dist/_chunks/{markdown-DqyUj6ze.js → markdown-BLSDivef.js} +2 -2
  38. package/dist/_chunks/{markdown-DqyUj6ze.js.map → markdown-BLSDivef.js.map} +1 -1
  39. package/dist/_chunks/{utils-BcIYGNLF.js → utils-BF9VwhRy.js} +2 -2
  40. package/dist/_chunks/{utils-BcIYGNLF.js.map → utils-BF9VwhRy.js.map} +1 -1
  41. package/dist/ai-elements.es.js +23 -23
  42. package/dist/ai-elements.es.js.map +1 -1
  43. package/dist-vue/PkChatbot.js +1 -1
  44. package/dist-vue/PkChatbotEmptyState.js +1 -1
  45. package/dist-vue/PkChatbotInput.js +1 -1
  46. package/dist-vue/PkChatbotMessages.js +1 -1
  47. package/dist-vue/PkChatbotStepPayload.js +1 -1
  48. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  49. package/dist-vue/PkChatbotSteps.js +1 -1
  50. package/dist-vue/PkChatbotViewChat.js +1 -1
  51. package/dist-vue/PkChatbotViewConversations.js +1 -1
  52. package/dist-vue/PkChatbotViewFiles.js +1 -1
  53. package/dist-vue/PkChatbotViewProfile.js +1 -1
  54. package/dist-vue/_chunks/{Agent-B55xNURC.js → Agent-DuB5Hh7M.js} +2 -1
  55. package/dist-vue/_chunks/{Agent-B55xNURC.js.map → Agent-DuB5Hh7M.js.map} +1 -1
  56. package/dist-vue/_chunks/{Document-BzJVMupn.js → Document-BJxoQzKV.js} +2 -2
  57. package/dist-vue/_chunks/{Document-BzJVMupn.js.map → Document-BJxoQzKV.js.map} +1 -1
  58. package/dist-vue/_chunks/{PkChatbot-Bc2hlwFO.js → PkChatbot-CXW3IFfs.js} +9 -9
  59. package/dist-vue/_chunks/PkChatbot-CXW3IFfs.js.map +1 -0
  60. package/dist-vue/_chunks/{PkChatbotEmptyState-NHarCaDm.js → PkChatbotEmptyState-CD6ehXRE.js} +2 -2
  61. package/dist-vue/_chunks/{PkChatbotEmptyState-NHarCaDm.js.map → PkChatbotEmptyState-CD6ehXRE.js.map} +1 -1
  62. package/dist-vue/_chunks/{PkChatbotInput-BSzDRoDD.js → PkChatbotInput-2zUenuUE.js} +3 -3
  63. package/dist-vue/_chunks/{PkChatbotInput-BSzDRoDD.js.map → PkChatbotInput-2zUenuUE.js.map} +1 -1
  64. package/dist-vue/_chunks/{PkChatbotMessages-DEMKZDCb.js → PkChatbotMessages-DbgmLmbz.js} +17 -17
  65. package/dist-vue/_chunks/{PkChatbotMessages-DEMKZDCb.js.map → PkChatbotMessages-DbgmLmbz.js.map} +1 -1
  66. package/dist-vue/_chunks/{PkChatbotStepPayload-DfLVMQrN.js → PkChatbotStepPayload-CkTJ1nFP.js} +2 -2
  67. package/dist-vue/_chunks/{PkChatbotStepPayload-DfLVMQrN.js.map → PkChatbotStepPayload-CkTJ1nFP.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkChatbotStepToolDetail-mwByeqKJ.js → PkChatbotStepToolDetail-DBi87nYU.js} +3 -3
  69. package/dist-vue/_chunks/{PkChatbotStepToolDetail-mwByeqKJ.js.map → PkChatbotStepToolDetail-DBi87nYU.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkChatbotSteps-DGQoYxJ9.js → PkChatbotSteps-BC2gLvzh.js} +5 -5
  71. package/dist-vue/_chunks/{PkChatbotSteps-DGQoYxJ9.js.map → PkChatbotSteps-BC2gLvzh.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkChatbotViewChat-aKi08vCz.js → PkChatbotViewChat-9BKIdCDD.js} +7 -7
  73. package/dist-vue/_chunks/{PkChatbotViewChat-aKi08vCz.js.map → PkChatbotViewChat-9BKIdCDD.js.map} +1 -1
  74. package/dist-vue/_chunks/{PkChatbotViewConversations-BPnPsRhJ.js → PkChatbotViewConversations-BWj_CaXs.js} +3 -3
  75. package/dist-vue/_chunks/{PkChatbotViewConversations-BPnPsRhJ.js.map → PkChatbotViewConversations-BWj_CaXs.js.map} +1 -1
  76. package/dist-vue/_chunks/{PkChatbotViewFiles-gYkXw8dc.js → PkChatbotViewFiles-9kcgLUrQ.js} +3 -3
  77. package/dist-vue/_chunks/{PkChatbotViewFiles-gYkXw8dc.js.map → PkChatbotViewFiles-9kcgLUrQ.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkChatbotViewProfile-PnHDQuuK.js → PkChatbotViewProfile-CJR38-Zw.js} +2 -2
  79. package/dist-vue/_chunks/{PkChatbotViewProfile-PnHDQuuK.js.map → PkChatbotViewProfile-CJR38-Zw.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkFilePreview-D2HInDoA.js → PkFilePreview-CmET6sdA.js} +3 -3
  81. package/dist-vue/_chunks/{PkFilePreview-D2HInDoA.js.map → PkFilePreview-CmET6sdA.js.map} +1 -1
  82. package/dist-vue/_chunks/{PkFilePreviewDialog-jxcUSzPx.js → PkFilePreviewDialog-CqQBzL5n.js} +2 -2
  83. package/dist-vue/_chunks/{PkFilePreviewDialog-jxcUSzPx.js.map → PkFilePreviewDialog-CqQBzL5n.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkStreamingMarkdown-DdOv86Eb.js → PkStreamingMarkdown-Db4sGE5U.js} +15 -9
  85. package/dist-vue/_chunks/PkStreamingMarkdown-Db4sGE5U.js.map +1 -0
  86. package/dist-vue/_chunks/{PkToolChatFile-8nx166iM.js → PkToolChatFile-CuilyyQV.js} +3 -3
  87. package/dist-vue/_chunks/{PkToolChatFile-8nx166iM.js.map → PkToolChatFile-CuilyyQV.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkToolRequestGeolocation-Bx2Vtb-5.js → PkToolRequestGeolocation-DBjweLxM.js} +2 -2
  89. package/dist-vue/_chunks/{PkToolRequestGeolocation-Bx2Vtb-5.js.map → PkToolRequestGeolocation-DBjweLxM.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-Dp_dx8cQ.js → PkToolRequestOAuthConnection-C3RPmvS9.js} +2 -2
  91. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-Dp_dx8cQ.js.map → PkToolRequestOAuthConnection-C3RPmvS9.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolShowArtifact-BppP_xSN.js → PkToolShowArtifact-BPM1M44f.js} +2 -2
  93. package/dist-vue/_chunks/{PkToolShowArtifact-BppP_xSN.js.map → PkToolShowArtifact-BPM1M44f.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolShowContactForm-Bm0icz24.js → PkToolShowContactForm-B3Um_vEc.js} +2 -2
  95. package/dist-vue/_chunks/{PkToolShowContactForm-Bm0icz24.js.map → PkToolShowContactForm-B3Um_vEc.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkToolShowDiagram-CgukB1Ss.js → PkToolShowDiagram-BDyGph2_.js} +2 -2
  97. package/dist-vue/_chunks/{PkToolShowDiagram-CgukB1Ss.js.map → PkToolShowDiagram-BDyGph2_.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowForm-CyyN7GQP.js → PkToolShowForm-D14J_UP1.js} +4 -4
  99. package/dist-vue/_chunks/{PkToolShowForm-CyyN7GQP.js.map → PkToolShowForm-D14J_UP1.js.map} +1 -1
  100. package/dist-vue/_chunks/{PkToolShowImageGallery-zQF_lsxI.js → PkToolShowImageGallery-BVrAQqq5.js} +2 -2
  101. package/dist-vue/_chunks/{PkToolShowImageGallery-zQF_lsxI.js.map → PkToolShowImageGallery-BVrAQqq5.js.map} +1 -1
  102. package/dist-vue/_chunks/{PkToolShowProductList-DW_P0gC2.js → PkToolShowProductList-DkDNFoIh.js} +2 -2
  103. package/dist-vue/_chunks/{PkToolShowProductList-DW_P0gC2.js.map → PkToolShowProductList-DkDNFoIh.js.map} +1 -1
  104. package/dist-vue/_chunks/{PkToolShowSources-BugMybUx.js → PkToolShowSources-BIsZaSr3.js} +3 -3
  105. package/dist-vue/_chunks/{PkToolShowSources-BugMybUx.js.map → PkToolShowSources-BIsZaSr3.js.map} +1 -1
  106. package/dist-vue/_chunks/{PkToolShowSuggestedReply-CXGpPEl-.js → PkToolShowSuggestedReply-qbQz8Ia2.js} +2 -2
  107. package/dist-vue/_chunks/{PkToolShowSuggestedReply-CXGpPEl-.js.map → PkToolShowSuggestedReply-qbQz8Ia2.js.map} +1 -1
  108. package/dist-vue/_chunks/{PkToolShowVideo-BW7aRKs_.js → PkToolShowVideo-BursN2E9.js} +2 -2
  109. package/dist-vue/_chunks/{PkToolShowVideo-BW7aRKs_.js.map → PkToolShowVideo-BursN2E9.js.map} +1 -1
  110. package/dist-vue/_chunks/{PkToolShowWebPages-DxKimT-2.js → PkToolShowWebPages-C2QqzOZx.js} +2 -2
  111. package/dist-vue/_chunks/{PkToolShowWebPages-DxKimT-2.js.map → PkToolShowWebPages-C2QqzOZx.js.map} +1 -1
  112. package/dist-vue/_chunks/{createChatbotApiClient-c3U4TXu2.js → createChatbotApiClient-CWQKS07V.js} +2 -2
  113. package/dist-vue/_chunks/{createChatbotApiClient-c3U4TXu2.js.map → createChatbotApiClient-CWQKS07V.js.map} +1 -1
  114. package/dist-vue/_chunks/{useChatbotStore-Kk3ioX3v.js → useChatbotStore-qgCC4aIL.js} +3 -3
  115. package/dist-vue/_chunks/{useChatbotStore-Kk3ioX3v.js.map → useChatbotStore-qgCC4aIL.js.map} +1 -1
  116. package/dist-vue/_chunks/{utils-DXOZ6zjh.js → utils-BcFZVBxd.js} +2 -2
  117. package/dist-vue/_chunks/{utils-DXOZ6zjh.js.map → utils-BcFZVBxd.js.map} +1 -1
  118. package/dist-vue/api.js +1 -1
  119. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +2 -0
  120. package/dist-vue/composables.js +8 -8
  121. package/dist-vue/composables.js.map +1 -1
  122. package/dist-vue/index.js +299 -283
  123. package/dist-vue/index.js.map +1 -1
  124. package/dist-vue/locales.js +4 -0
  125. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +6 -2
  126. package/dist-vue/packages/components/src/chat/chatImagePolicy.d.ts +17 -9
  127. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +6 -0
  128. package/dist-vue/packages/models/src/schema/Agent.d.ts +8 -0
  129. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +2 -0
  130. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +2 -0
  131. package/package.json +1 -1
  132. package/dist/_chunks/chatImagePolicy-NToILNOC.js.map +0 -1
  133. package/dist-vue/_chunks/PkChatbot-Bc2hlwFO.js.map +0 -1
  134. package/dist-vue/_chunks/PkStreamingMarkdown-DdOv86Eb.js.map +0 -1
@@ -327,6 +327,7 @@ var e = {
327
327
  monthRateLimit: "Month rate limit",
328
328
  trustedOrigins: "Trusted origins",
329
329
  origin: "Origine",
330
+ holdExternalImages: "Ask before loading images from other sites",
330
331
  imageHosts: "Image hosts",
331
332
  imageHost: "Host",
332
333
  imageHostsHint: "Answers and cards load images by themselves only from these hosts and from the platform.",
@@ -552,6 +553,7 @@ var e = {
552
553
  externalContextSchema: "Define which contextual data the hosting site can send to the agent.",
553
554
  externalContextSchemaToggle: "Enable receiving contextual data from the hosting site.",
554
555
  confirmationsAllowAutomatic: "In the chat the user chooses whether the agent asks before saving, sending or creating. Deletions, the site's own confirmations and leaving the site always ask.",
556
+ holdExternalImages: "On, an image from a site you do not list waits for a click, so an answer cannot carry the conversation out in the url of an image. Off, every image loads by itself.",
555
557
  userFeedbackPositive: "The user rated this answer positively",
556
558
  userFeedbackNegative: "The user rated this answer negatively",
557
559
  userFeedbackReaction: "The user reacted to this answer",
@@ -1328,6 +1330,7 @@ var e = {
1328
1330
  monthRateLimit: "Limite al mese",
1329
1331
  trustedOrigins: "Origini attendibili",
1330
1332
  origin: "Origine",
1333
+ holdExternalImages: "Chiedi prima di caricare immagini da altri siti",
1331
1334
  imageHosts: "Host delle immagini",
1332
1335
  imageHost: "Host",
1333
1336
  imageHostsHint: "Risposte e card caricano da sole solo le immagini di questi host e della piattaforma.",
@@ -1553,6 +1556,7 @@ var e = {
1553
1556
  externalContextSchema: "Definisci quali dati contestuali il sito ospitante può inviare all'agente.",
1554
1557
  externalContextSchemaToggle: "Abilita la ricezione di dati contestuali dal sito ospitante.",
1555
1558
  confirmationsAllowAutomatic: "Nella chat l'utente sceglie se l'agente chiede prima di salvare, inviare o creare. Le cancellazioni, le conferme del sito e l'uscita dal sito chiedono sempre.",
1559
+ holdExternalImages: "Acceso, un'immagine da un sito che non elenchi aspetta un clic, così una risposta non può portare fuori la conversazione nell'url di un'immagine. Spento, ogni immagine si carica da sola.",
1556
1560
  userFeedbackPositive: "L'utente ha valutato positivamente questa risposta",
1557
1561
  userFeedbackNegative: "L'utente ha valutato negativamente questa risposta",
1558
1562
  userFeedbackReaction: "L'utente ha reagito a questa risposta",
@@ -75,6 +75,8 @@ type __VLS_ModelProps = {
75
75
  'trustedOrigins'?: {
76
76
  origins?: string[];
77
77
  };
78
+ /** Whether images from other hosts wait for a click (hole 20). */
79
+ 'holdExternalImages'?: boolean | undefined;
78
80
  /** Hosts the answers may load images from by themselves (hole 20). */
79
81
  'imageHosts'?: string[] | undefined;
80
82
  'disabledTools'?: AgentBuiltInTool[];
@@ -157,9 +159,9 @@ type __VLS_ModelProps = {
157
159
  } | undefined;
158
160
  };
159
161
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
160
- declare var __VLS_914: {};
162
+ declare var __VLS_919: {};
161
163
  type __VLS_Slots = {} & {
162
- default?: (props: typeof __VLS_914) => any;
164
+ default?: (props: typeof __VLS_919) => any;
163
165
  };
164
166
  declare const __VLS_base: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
165
167
  "update:reasoning": (value: {
@@ -357,6 +359,7 @@ declare const __VLS_base: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, Com
357
359
  "update:trustedOrigins": (value: {
358
360
  origins?: string[];
359
361
  }) => any;
362
+ "update:holdExternalImages": (value: boolean | undefined) => any;
360
363
  "update:imageHosts": (value: string[] | undefined) => any;
361
364
  "update:disabledTools": (value: AgentBuiltInTool[]) => any;
362
365
  "update:shareDocumentEnabled": (value: boolean) => any;
@@ -639,6 +642,7 @@ declare const __VLS_base: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, Com
639
642
  "onUpdate:trustedOrigins"?: ((value: {
640
643
  origins?: string[];
641
644
  }) => any) | undefined;
645
+ "onUpdate:holdExternalImages"?: ((value: boolean | undefined) => any) | undefined;
642
646
  "onUpdate:imageHosts"?: ((value: string[] | undefined) => any) | undefined;
643
647
  "onUpdate:disabledTools"?: ((value: AgentBuiltInTool[]) => any) | undefined;
644
648
  "onUpdate:shareDocumentEnabled"?: ((value: boolean) => any) | undefined;
@@ -7,9 +7,11 @@ import { ComputedRef, InjectionKey } from 'vue';
7
7
  * cards (gallery, products, web pages), and a prompt injected through a
8
8
  * document, a page or a tool result can make it put the conversation in that
9
9
  * url. The browser fetches it as soon as it renders, and the text is gone.
10
- * So an image loads by itself only from the media of the platform and from
11
- * the hosts the agent lists (`interface.imageHosts`); any other shows its host
12
- * and loads on a click, a choice made by whoever reads it.
10
+ * An agent that turns `interface.holdExternalImages` on loads an image by
11
+ * itself only from the media of the platform and from the hosts it lists
12
+ * (`interface.imageHosts`); any other shows its host and loads on a click, a
13
+ * choice made by whoever reads it. Off, the default since 2026-11-04, every
14
+ * image loads by itself.
13
15
  *
14
16
  * Provided by `PkChatbot` (the app and the widget) and by the pages that show
15
17
  * an agent's answers; where nothing is provided, images load as before.
@@ -20,14 +22,20 @@ export interface ChatImagePolicy {
20
22
  /** Origins of the platform, which serve the media of a chat. */
21
23
  platformOrigins: string[];
22
24
  }
23
- export declare const ChatImagePolicyKey: InjectionKey<ComputedRef<ChatImagePolicy>>;
25
+ /** What the policy reads of the agent's interface settings. */
26
+ export interface ChatImageSettings {
27
+ holdExternalImages?: boolean;
28
+ imageHosts?: string[];
29
+ }
30
+ /** `undefined` while the agent does not hold any image. */
31
+ export declare const ChatImagePolicyKey: InjectionKey<ComputedRef<ChatImagePolicy | undefined>>;
24
32
  /**
25
- * Applies the policy of an agent to the answers rendered below: its listed
26
- * hosts, and the backend the page talks to, which serves the chat's media.
27
- * The hosts are normalized again because a preview passes them as typed,
28
- * before the schema does.
33
+ * Applies the policy of an agent to the answers rendered below, when the
34
+ * agent turns it on: its listed hosts, and the backend the page talks to,
35
+ * which serves the chat's media. The hosts are normalized again because a
36
+ * preview passes them as typed, before the schema does.
29
37
  */
30
- export declare function provideChatImagePolicy(hosts: () => string[] | undefined, backendUrl: () => string | undefined): void;
38
+ export declare function provideChatImagePolicy(settings: () => ChatImageSettings | undefined, backendUrl: () => string | undefined): void;
31
39
  /**
32
40
  * The host an image url points to, for the placeholder, or `undefined` when
33
41
  * it does not parse.
@@ -73,6 +73,7 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
73
73
  smoothStream: boolean;
74
74
  showExtendedSteps: boolean;
75
75
  showReasoning: boolean;
76
+ holdExternalImages: boolean;
76
77
  imageHosts: string[];
77
78
  media?: {
78
79
  name: string;
@@ -175,6 +176,7 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
175
176
  smoothStream: boolean;
176
177
  showExtendedSteps: boolean;
177
178
  showReasoning: boolean;
179
+ holdExternalImages: boolean;
178
180
  imageHosts: string[];
179
181
  media?: {
180
182
  name: string;
@@ -2219,6 +2221,7 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
2219
2221
  smoothStream: boolean;
2220
2222
  showExtendedSteps: boolean;
2221
2223
  showReasoning: boolean;
2224
+ holdExternalImages: boolean;
2222
2225
  imageHosts: string[];
2223
2226
  media?: {
2224
2227
  name: string;
@@ -2321,6 +2324,7 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
2321
2324
  smoothStream: boolean;
2322
2325
  showExtendedSteps: boolean;
2323
2326
  showReasoning: boolean;
2327
+ holdExternalImages: boolean;
2324
2328
  imageHosts: string[];
2325
2329
  media?: {
2326
2330
  name: string;
@@ -4365,6 +4369,7 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
4365
4369
  smoothStream: boolean;
4366
4370
  showExtendedSteps: boolean;
4367
4371
  showReasoning: boolean;
4372
+ holdExternalImages: boolean;
4368
4373
  imageHosts: string[];
4369
4374
  media?: {
4370
4375
  name: string;
@@ -4467,6 +4472,7 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
4467
4472
  smoothStream: boolean;
4468
4473
  showExtendedSteps: boolean;
4469
4474
  showReasoning: boolean;
4475
+ holdExternalImages: boolean;
4470
4476
  imageHosts: string[];
4471
4477
  media?: {
4472
4478
  name: string;
@@ -1242,6 +1242,7 @@ export declare const AgentInterfaceSchema: z.ZodObject<{
1242
1242
  smoothStream: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1243
1243
  showExtendedSteps: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1244
1244
  showReasoning: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1245
+ holdExternalImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1245
1246
  imageHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
1246
1247
  }, z.core.$strip>;
1247
1248
  export type AgentInterface = z.infer<typeof AgentInterfaceSchema>;
@@ -1766,6 +1767,7 @@ export declare const AgentSettingsSchema: z.ZodObject<{
1766
1767
  smoothStream: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1767
1768
  showExtendedSteps: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1768
1769
  showReasoning: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1770
+ holdExternalImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1769
1771
  imageHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
1770
1772
  }, z.core.$strip>;
1771
1773
  tools: z.ZodDefault<z.ZodOptional<z.ZodObject<{
@@ -2246,6 +2248,7 @@ export declare const AgentDtoSchema: z.ZodObject<{
2246
2248
  smoothStream: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2247
2249
  showExtendedSteps: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2248
2250
  showReasoning: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2251
+ holdExternalImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2249
2252
  imageHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
2250
2253
  }, z.core.$strip>;
2251
2254
  tools: z.ZodDefault<z.ZodOptional<z.ZodObject<{
@@ -2727,6 +2730,7 @@ export declare const AgentSchema: z.ZodLazy<z.ZodObject<{
2727
2730
  smoothStream: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2728
2731
  showExtendedSteps: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2729
2732
  showReasoning: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2733
+ holdExternalImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2730
2734
  imageHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
2731
2735
  }, z.core.$strip>;
2732
2736
  tools: z.ZodDefault<z.ZodOptional<z.ZodObject<{
@@ -3077,6 +3081,7 @@ export declare const AgentPublicSchema: z.ZodObject<{
3077
3081
  smoothStream: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3078
3082
  showExtendedSteps: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3079
3083
  showReasoning: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3084
+ holdExternalImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3080
3085
  imageHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
3081
3086
  }, z.core.$strip>;
3082
3087
  createdAt: z.ZodCoercedDate<unknown>;
@@ -3386,6 +3391,7 @@ export declare const AgentAccessGrantedSchema: z.ZodObject<{
3386
3391
  smoothStream: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3387
3392
  showExtendedSteps: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3388
3393
  showReasoning: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3394
+ holdExternalImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3389
3395
  imageHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
3390
3396
  }, z.core.$strip>;
3391
3397
  createdAt: z.ZodCoercedDate<unknown>;
@@ -3651,6 +3657,7 @@ export declare const AgentAccessDecisionSchema: z.ZodDiscriminatedUnion<[z.ZodOb
3651
3657
  smoothStream: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3652
3658
  showExtendedSteps: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3653
3659
  showReasoning: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3660
+ holdExternalImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3654
3661
  imageHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
3655
3662
  }, z.core.$strip>;
3656
3663
  createdAt: z.ZodCoercedDate<unknown>;
@@ -3935,6 +3942,7 @@ export declare const AgentAccessSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3935
3942
  smoothStream: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3936
3943
  showExtendedSteps: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3937
3944
  showReasoning: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3945
+ holdExternalImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3938
3946
  imageHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
3939
3947
  }, z.core.$strip>;
3940
3948
  createdAt: z.ZodCoercedDate<unknown>;
@@ -303,6 +303,7 @@ export declare const ReasoningChatSchema: z.ZodObject<{
303
303
  smoothStream: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
304
304
  showExtendedSteps: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
305
305
  showReasoning: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
306
+ holdExternalImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
306
307
  imageHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
307
308
  }, z.core.$strip>;
308
309
  tools: z.ZodDefault<z.ZodOptional<z.ZodObject<{
@@ -836,6 +837,7 @@ export declare const ReasoningChatSchema: z.ZodObject<{
836
837
  smoothStream: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
837
838
  showExtendedSteps: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
838
839
  showReasoning: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
840
+ holdExternalImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
839
841
  imageHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
840
842
  }, z.core.$strip>;
841
843
  tools: z.ZodDefault<z.ZodOptional<z.ZodObject<{
@@ -303,6 +303,7 @@ export declare const SubAgentSchema: z.ZodObject<{
303
303
  smoothStream: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
304
304
  showExtendedSteps: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
305
305
  showReasoning: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
306
+ holdExternalImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
306
307
  imageHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
307
308
  }, z.core.$strip>;
308
309
  tools: z.ZodDefault<z.ZodOptional<z.ZodObject<{
@@ -793,6 +794,7 @@ export declare const SubAgentSchema: z.ZodObject<{
793
794
  smoothStream: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
794
795
  showExtendedSteps: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
795
796
  showReasoning: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
797
+ holdExternalImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
796
798
  imageHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
797
799
  }, z.core.$strip>;
798
800
  tools: z.ZodDefault<z.ZodOptional<z.ZodObject<{
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8wave/ai-elements",
3
3
  "private": false,
4
- "version": "0.125.0-beta.33",
4
+ "version": "0.125.0-beta.34",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite --port 8082 --open --host",
@@ -1 +0,0 @@
1
- {"version":3,"file":"chatImagePolicy-NToILNOC.js","names":["inject","provide","ref","computed","init_runtime_core_esm_bundler","init_reactivity_esm_bundler","normalizeImageHost","urlOrigin","useShortUrlResolver","ChatImagePolicyKey","provideChatImagePolicy","hosts","backendUrl","origin","imageHostOf","src","pageUrl","PLATFORM_MEDIA_PATH","isImageAllowed","url","policy","useChatImageGate","shortUrls","released","target"],"sources":["../../../../packages/components/src/chat/chatImagePolicy.ts"],"sourcesContent":["import type { ComputedRef, InjectionKey } from 'vue'\nimport { computed, inject, provide, ref } from 'vue'\nimport { useShortUrlResolver } from 'composables'\nimport { normalizeImageHost } from 'models'\nimport { urlOrigin } from 'utils'\n\n/**\n * Which images a chat loads by itself: hole 20 of\n * docs/specs/organization-isolation.md.\n *\n * The model writes the url of every image in an answer and in the image tool\n * cards (gallery, products, web pages), and a prompt injected through a\n * document, a page or a tool result can make it put the conversation in that\n * url. The browser fetches it as soon as it renders, and the text is gone.\n * So an image loads by itself only from the media of the platform and from\n * the hosts the agent lists (`interface.imageHosts`); any other shows its host\n * and loads on a click, a choice made by whoever reads it.\n *\n * Provided by `PkChatbot` (the app and the widget) and by the pages that show\n * an agent's answers; where nothing is provided, images load as before.\n */\nexport interface ChatImagePolicy {\n /** Host names the agent lists, normalized (`normalizeImageHost`). */\n hosts: string[]\n /** Origins of the platform, which serve the media of a chat. */\n platformOrigins: string[]\n}\n\nexport const ChatImagePolicyKey: InjectionKey<ComputedRef<ChatImagePolicy>> =\n Symbol('ChatImagePolicy')\n\n/**\n * Applies the policy of an agent to the answers rendered below: its listed\n * hosts, and the backend the page talks to, which serves the chat's media.\n * The hosts are normalized again because a preview passes them as typed,\n * before the schema does.\n */\nexport function provideChatImagePolicy(\n hosts: () => string[] | undefined,\n backendUrl: () => string | undefined,\n) {\n provide(\n ChatImagePolicyKey,\n computed(() => ({\n hosts: (hosts() ?? []).map(normalizeImageHost),\n platformOrigins: [urlOrigin(backendUrl())].filter(\n (origin): origin is string => !!origin,\n ),\n })),\n )\n}\n\n/**\n * The host an image url points to, for the placeholder, or `undefined` when\n * it does not parse.\n */\nexport function imageHostOf(src: string, pageUrl: string): string | undefined {\n try {\n return new URL(src, pageUrl).hostname || undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * The paths the platform serves the media of a chat from (`media.service.ts`\n * and `chatMedia.service.ts` in the backend). Only these: the same origin\n * answers sign-in and OAuth routes that redirect to a url read from the query,\n * which would carry an answer anywhere. A short link (`/api/r/<hash>`) is not\n * among them either: `useChatImageGate` judges it by the url it stands for,\n * since a set of links prepared in advance could spell a secret out.\n */\nconst PLATFORM_MEDIA_PATH =\n /^\\/api\\/v1\\/(?:public\\/medias\\/[^/]+|[^/]+\\/agents\\/[^/]+\\/chats\\/[^/]+\\/media\\/[^/]+\\/(?:view|download))$/\n\n/**\n * Whether an image may load without a click. `data:` and `blob:` images never\n * reach the network; everything else needs the media of the platform or a\n * listed host, over https. The page's own origin gets no exception: a site,\n * the platform's included, often redirects wherever its query says.\n */\nexport function isImageAllowed(\n src: string,\n policy: ChatImagePolicy,\n pageUrl: string,\n): boolean {\n let url: URL\n try {\n url = new URL(src, pageUrl)\n } catch {\n return false\n }\n if (url.protocol === 'data:' || url.protocol === 'blob:') {\n return true\n }\n if (policy.platformOrigins.includes(url.origin)) {\n return PLATFORM_MEDIA_PATH.test(url.pathname)\n }\n return url.protocol === 'https:' && policy.hosts.includes(url.hostname)\n}\n\n/**\n * The policy of the surrounding chat, with the images released by a click.\n * A release is per url and lasts as long as the component that asked. A\n * short link of the platform is judged, and named, by the url it stands for:\n * it waits until the resolver brings that url back.\n */\nexport function useChatImageGate() {\n const policy = inject(ChatImagePolicyKey, undefined)\n const shortUrls = useShortUrlResolver()\n const released = ref(new Set<string>())\n const pageUrl = () =>\n typeof window === 'undefined'\n ? 'https://localhost/'\n : window.location.href\n const target = (src: string) => shortUrls.resolve(src).value.url ?? src\n\n const canLoad = (src: string | undefined): boolean =>\n !src ||\n !policy ||\n released.value.has(src) ||\n isImageAllowed(target(src), policy.value, pageUrl())\n\n const release = (src: string) => {\n released.value = new Set(released.value).add(src)\n }\n\n const hostOf = (src: string) => imageHostOf(target(src), pageUrl())\n\n return {\n /** Whether a policy applies here at all. */\n isGated: computed(() => !!policy),\n canLoad,\n release,\n hostOf,\n }\n}\n"],"mappings":";;;;;;;AA4BA,IAAaS,IACT,OAAO,iBAAiB;AAQ5B,SAAgBC,EACZ,GACA,GACF;CACE,EACID,GACAN,SAAgB;EACZ,QAAQQ,EAAM,KAAK,CAAC,EAAA,CAAG,IAAIL,CAAkB;EAC7C,iBAAiB,CAACC,EAAUK,EAAW,CAAC,CAAC,CAAC,CAAC,QACtC,MAA6B,CAAC,CAACC,CACpC;CACJ,EAAE,CACN;AACJ;AAMA,SAAgBC,EAAY,GAAa,GAAqC;CAC1E,IAAI;EACA,OAAO,IAAI,IAAIC,GAAKC,CAAO,CAAC,CAAC,YAAY,KAAA;CAC7C,QAAQ;EACJ;CACJ;AACJ;AAUA,IAAMC,IACF;AAQJ,SAAgBC,EACZ,GACA,GACA,GACO;CACP,IAAIC;CACJ,IAAI;EACA,IAAM,IAAI,IAAIJ,GAAKC,CAAO;CAC9B,QAAQ;EACJ,OAAO;CACX;CAOA,OANIG,EAAI,aAAa,WAAWA,EAAI,aAAa,UACtC,KAEPC,EAAO,gBAAgB,SAASD,EAAI,MAAM,IACnCF,EAAoB,KAAKE,EAAI,QAAQ,IAEzCA,EAAI,aAAa,YAAYC,EAAO,MAAM,SAASD,EAAI,QAAQ;AAC1E;AAQA,SAAgBE,IAAmB;CAC/B,IAAMD,IAASpB,EAAOS,GAAoB,KAAA,CAAS,GAC7Ca,IAAYd,EAAoB,GAChCe,IAAWrB,kBAAI,IAAI,IAAY,CAAC,GAChCc,UACF,OAAO,SAAW,MACZ,uBACA,OAAO,SAAS,MACpBQ,KAAU,MAAgBF,EAAU,QAAQP,CAAG,CAAC,CAAC,MAAM,OAAOA;CAcpE,OAAO;EAEH,SAASZ,QAAe,CAAC,CAACiB,CAAM;EAChC,UAfa,MACb,CAACL,KACD,CAACK,KACDG,EAAS,MAAM,IAAIR,CAAG,KACtBG,EAAeM,EAAOT,CAAG,GAAGK,EAAO,OAAOJ,EAAQ,CAAC;EAYnD,UAVa,MAAgB;GAC7B,EAAS,QAAQ,IAAI,IAAIO,EAAS,KAAK,CAAC,CAAC,IAAIR,CAAG;EACpD;EASI,SAPY,MAAgBD,EAAYU,EAAOT,CAAG,GAAGC,EAAQ,CAAC;CAQlE;AACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PkChatbot-Bc2hlwFO.js","names":["_useModel","__unplugin_components_0","__unplugin_components_1","__unplugin_components_2","__unplugin_components_3","__unplugin_components_4","__unplugin_components_5","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_createElementVNode","_unref","_Fragment","_createVNode","_mergeProps","_createBlock","PkAvatar","_createCommentVNode","_toDisplayString","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode","PkChatbotViewChat","_createSlots","_renderList","PkChatbotViewConversations","PkChatbotViewFiles","PkChatbotViewProfile","PkStreamingMarkdown","_sfc_main","VvButtonLocalized","provideChatImagePolicy","PkStreamingMarkdown_default","useChatbotStore","resolveContrastColor","agentThemeStyle","PkChatbotViewConversations_default","PkChatbotViewChat_default","provideShortUrlResolver","PkChatbotViewFiles_default","useLocalizedString","PkAvatar_default","ChatbotProfileContextKey","PkChatbotViewProfile_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","PkChatbot_default","defineComponent","\"chatId\"","\"chatIdModifiers\"","__expose","__emit","slots","useSlots","$t","useI18n","props","__props","emit","chatId","useModel","store","hashes","storeToRefs","storeAgentId","toRef","profile","inject","canManageProfile","computed","canSignIn","watch","canManage","activeView","navigate","watchEffect","id","localChatId","chatError","error","parsedError","isFullscreen","isPanel","chatbotEl","useTemplateRef","chatbotWidth","useElementSize","isPhoneWidth","isTightWidth","isWideWidth","isReasoningAgent","showReasoningNotice","messages","message","useColorsForAgentHeader","showHeaderMenu","pageAccessAvailable","confirmationsAvailable","themeClass","isDark","mainColor","contrastColor","themeStyle","footerMessage","title","activeMessage","newAgentId","newChatId","newView","_component_VvButton","_component_VvIcon","VvIcon","_component_VvDropdownAction","VvDropdownAction","_component_VvDropdown","VvDropdown","_component_VvButtonGroup","VvButtonGroup","_component_VvAlert","VvAlert","openBlock","createElementBlock","normalizeClass","normalizeStyle","createCommentVNode","createElementVNode","unref","createBlock","Fragment","createVNode","mergeProps","_cache","toDisplayString","withCtx","renderSlot","_ctx","normalizeProps","guardReactiveProps","startNewChat","stopGeneration","createTextVNode","setPageAccessOff","pageAccessOff","setConfirmationMode","confirmationMode","$event","createSlots","renderList","slotName","slotData"],"sources":["../../../../packages/components/src/chat/PkChatbot.vue","../../../../packages/components/src/chat/PkChatbot.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import {\n computed,\n inject,\n toRef,\n useTemplateRef,\n watch,\n watchEffect,\n useSlots,\n } from 'vue'\n import { useElementSize } from '@vueuse/core'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import type {\n AgentConfirmationsCapability,\n AgentInterface,\n AgentModel,\n AgentFileUpload,\n AgentGatewayOptions,\n AgentVoiceCapability,\n ChatMessageActions,\n RevisedAnswer,\n UIChatMessage,\n AgentTools,\n HostToolsCapability,\n PageAccessCapability,\n SelectionActionsCapability,\n } from 'models'\n import {\n type RegisteredHostTool,\n useChatbotStore,\n useLocalizedString,\n provideShortUrlResolver,\n } from 'composables'\n import PkAvatar from './PkAvatar.vue'\n import PkChatbotViewChat from './PkChatbotViewChat.vue'\n import PkChatbotViewConversations from './PkChatbotViewConversations.vue'\n import PkChatbotViewFiles from './PkChatbotViewFiles.vue'\n import PkChatbotViewProfile from './PkChatbotViewProfile.vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import { ChatbotProfileContextKey } from './chatbotProfileContext'\n import { provideChatImagePolicy } from './chatImagePolicy'\n import { agentThemeStyle, resolveContrastColor } from './utils'\n\n // Captured in script setup to avoid TS7022 circular inference in template\n const slots = useSlots()\n\n const { t: $t } = useI18n({\n useScope: 'global',\n })\n\n const props = defineProps<{\n baseUrl: string\n basePath?: string\n agentId: string\n agentType?: 'reasoning' | 'chat'\n userId?: string\n name?: string\n model?: string\n agentModel?: AgentModel\n agentTools?: AgentTools\n agentInterface?: AgentInterface\n actions?: ChatMessageActions[]\n revisedAnswers?: RevisedAnswer[]\n headers?: Record<string, string>\n systemTheme?: 'light' | 'dark'\n agentFileUpload?: AgentFileUpload\n /** Voice configuration from the agent settings: enables the talk button. */\n voice?: AgentVoiceCapability\n fallbackModels?: string[]\n gatewayOptions?: Partial<AgentGatewayOptions>\n externalContext?: Record<string, unknown>\n /** Host tools as the agent allows them (`capabilities.hostTools` of the public agent). */\n hostTools?: HostToolsCapability\n /** Tools the embedding app registered, with the function that runs each (spec `host-tools.md`). */\n hostToolRegistry?: RegisteredHostTool[]\n /** Page access as the agent allows it (`capabilities.pageAccess`, spec `page-tools.md`). */\n pageAccess?: PageAccessCapability\n /** Whether the user may choose automatic confirmations (`capabilities.confirmations`, spec `auto-confirmations.md`). */\n confirmations?: AgentConfirmationsCapability\n /** The selection bar's groups (`capabilities.selectionActions`, spec `selection-actions.md`). */\n selectionActions?: SelectionActionsCapability\n /** The widget's page tools: only the web component provides them. */\n pageToolRegistry?: RegisteredHostTool[]\n /** The tools of the forms annotated on the page now, read on every request. */\n pageForms?: () => RegisteredHostTool[]\n /** Layout modifier: `widget` (default) keeps the contained layout with header, `fullscreen` removes header/background for full-page usage (the page provides the chrome), `panel` keeps the header but slims it down for a docked side panel (the host provides background and border) */\n modifier?: 'widget' | 'fullscreen' | 'panel'\n /** Display name of the current user, used for the `{name}` placeholder in the fullscreen greeting */\n userName?: string\n /** Show the \"Files in this chat\" menu for hosts that don't provide the\n * profile context but whose user is authenticated (e.g. the backoffice\n * playground). The widget host relies on `canManageProfile` instead. */\n userFilesEnabled?: boolean\n /** The host can close the chat: the header menu offers \"Close\", which emits `close`. */\n closable?: boolean\n }>()\n const emit = defineEmits<{\n 'message-update': [message: UIChatMessage]\n 'show-info': [message: UIChatMessage]\n revise: [message: UIChatMessage]\n error: [error: { type: string; title: string; status: number }]\n /** That conversation is loaded: a message sent now lands in it. */\n loaded: [chatId: string]\n /** The user chose \"Close\" in the header menu. */\n close: []\n /** An action of a selection bar was sent: the telemetry's properties (spec `selection-actions.md`). */\n 'selection-action': [properties: Record<string, string>]\n }>()\n\n const chatId = defineModel<string | undefined>('chatId', {\n type: String,\n default: undefined,\n })\n\n const store = useChatbotStore(props.agentId)\n\n // Resolve backend short-urls (`/api/r/<hash>`) back to their real target\n // for display in tool components. Batched + cached across the chat tree.\n provideShortUrlResolver((hashes) =>\n store.apiClient.resolveShortUrls(hashes),\n )\n\n const {\n messages,\n localChatId,\n activeView,\n chatError,\n isDark,\n pageAccessAvailable,\n pageAccessOff,\n confirmationsAvailable,\n confirmationMode,\n } = storeToRefs(store)\n\n // Ref to store.agentId for watchers (avoids duplicate-key with agentId prop)\n const storeAgentId = toRef(store, 'agentId')\n\n const {\n startNewChat,\n stopGeneration,\n regenerate,\n navigate,\n sendMessage,\n setPageAccessOff,\n setConfirmationMode,\n } = store\n\n // Images in the answers and the tool cards load by themselves only from\n // the backend this chat talks to and from the hosts the agent lists.\n provideChatImagePolicy(\n () => props.agentInterface?.imageHosts,\n () => props.baseUrl,\n )\n\n // Optional profile-management context provided by the host widget.\n // Present only for authenticated, non-anonymous sessions.\n const profile = inject(ChatbotProfileContextKey, undefined)\n const canManageProfile = computed(\n () => profile?.canManageProfile.value ?? false,\n )\n // Anonymous users get a \"Sign in\" entry instead of the profile one,\n // provided the host filled the `view-auth` slot and the agent has at\n // least one auth method enabled.\n const canSignIn = computed(\n () =>\n !canManageProfile.value &&\n (profile?.canSignIn?.value ?? false) &&\n slots['view-auth'] !== undefined,\n )\n\n // Once the sign-in completes (the session becomes non-anonymous) leave\n // the auth view and return to the conversation.\n watch(canManageProfile, (canManage) => {\n if (canManage && activeView.value === 'auth') {\n navigate('chat')\n }\n })\n\n // Sync props → store reactively\n watchEffect(() => {\n store.baseUrl = props.baseUrl\n store.basePath = props.basePath\n store.name = props.name\n store.agentType = props.agentType\n store.userId = props.userId\n store.agentInterface = props.agentInterface\n store.agentModel = props.agentModel\n store.agentTools = props.agentTools\n store.headers = props.headers\n store.revisedAnswers = props.revisedAnswers\n store.model = props.model\n store.actionsInput = props.actions\n store.agentFileUpload = props.agentFileUpload\n store.agentVoice = props.voice\n store.fallbackModels = props.fallbackModels\n store.gatewayOptions = props.gatewayOptions\n store.externalContext = props.externalContext\n store.agentHostTools = props.hostTools\n store.hostToolRegistry = props.hostToolRegistry\n store.agentPageAccess = props.pageAccess\n store.agentConfirmations = props.confirmations\n store.agentSelectionActions = props.selectionActions\n store.pageToolRegistry = props.pageToolRegistry\n store.pageFormsProvider = props.pageForms\n store.systemTheme = props.systemTheme\n store.hideWelcomeMessage = props.modifier === 'fullscreen'\n })\n\n // Sync chatId v-model ↔ store (bidirectional)\n // Parent → store: if the parent provides an external chatId, push it into\n // the store so the Chat instance picks it up.\n watch(\n () => chatId.value,\n (id) => {\n if (id && id !== store.localChatId) {\n store.localChatId = id\n }\n },\n { immediate: true },\n )\n // Store → parent: keep the v-model in sync whenever the store changes\n // the chatId internally (e.g. startNewChat).\n watch(localChatId, (id) => {\n chatId.value = id\n })\n\n // Emit structured errors from chat to the parent component\n watch(chatError, (error) => {\n if (!error) {\n return\n }\n try {\n const parsedError = JSON.parse(error.message) as {\n type: string\n title: string\n status: number\n }\n emit('error', parsedError)\n } catch {\n // ignore non-JSON errors\n }\n })\n\n // ui\n const isFullscreen = computed(() => props.modifier === 'fullscreen')\n const isPanel = computed(() => props.modifier === 'panel')\n\n /**\n * How much room the chat has, measured on the chat and not on the window.\n *\n * The same chat renders in a phone page, in a 408px widget, in a docked\n * panel and in a preview frame that the side panels squeeze to phone width\n * on a desktop screen, so the viewport says nothing about the space the\n * layout actually has. A CSS container query would read the same number\n * with no JavaScript, but `container-type` makes the element a containing\n * block for `position: fixed` descendants on every engine except Chrome\n * 129 and later, which displaces every dropdown in the chat: see\n * docs/agents/gotchas.md, \"The chat measures its own width, and not with a\n * container query\".\n *\n * The thresholds carry the modifiers, so the CSS stays declarative:\n * `--phone` has as much room as a phone page, `--tight` is too tight for\n * the agent chip beside the field, `--wide` has room for the outline rail\n * beside the reading column. Before the first measurement the width is 0\n * and no modifier applies, which is the roomy layout the base CSS writes.\n */\n const chatbotEl = useTemplateRef<HTMLDivElement>('chatbotEl')\n const { width: chatbotWidth } = useElementSize(chatbotEl)\n const isPhoneWidth = computed(\n () => chatbotWidth.value > 0 && chatbotWidth.value < 576,\n )\n const isTightWidth = computed(\n () => chatbotWidth.value > 0 && chatbotWidth.value < 640,\n )\n const isWideWidth = computed(() => chatbotWidth.value >= 848)\n const isReasoningAgent = computed(() => props.agentType === 'reasoning')\n // The notice says how a reasoning agent reads a message: it stands before\n // the first one, then leaves the room to the answers (pinned, it took a\n // third of a phone screen in the reasoning playground)\n const showReasoningNotice = computed(\n () =>\n isReasoningAgent.value &&\n !messages.value.some((message) => message.role === 'user'),\n )\n // A docked panel keeps a neutral header whatever the agent asks: it sits\n // beside the site or the app as part of the frame, and a colored band\n // made it read as a second site next to the first one.\n const useColorsForAgentHeader = computed(\n () => !isPanel.value && props.agentInterface?.useColorsForAgentHeader,\n )\n // Panel mode promotes the everyday actions (new chat, history) from the\n // dropdown to direct header buttons: the dropdown then only remains for\n // the secondary entries (files, profile, sign-in) and disappears when\n // none of them applies.\n const showHeaderMenu = computed(\n () =>\n !isPanel.value ||\n canManageProfile.value ||\n canSignIn.value ||\n pageAccessAvailable.value ||\n confirmationsAvailable.value ||\n props.closable ||\n (!!props.userFilesEnabled && !!localChatId.value),\n )\n const themeClass = computed(() => [\n 'theme',\n `theme--${isDark.value ? 'dark' : 'light'}`,\n ])\n const mainColor = computed(() => props.agentInterface?.mainColor)\n const contrastColor = computed(() =>\n resolveContrastColor(props.agentInterface?.textColor, mainColor.value),\n )\n const themeStyle = computed(() =>\n agentThemeStyle(mainColor.value, contrastColor.value),\n )\n const footerMessage = useLocalizedString(\n () => props.agentInterface?.footerMessage,\n )\n const title = computed(() => {\n if (activeView.value === 'conversations') {\n return $t('label.conversations')\n }\n if (activeView.value === 'profile') {\n return $t('label.profile')\n }\n if (activeView.value === 'auth') {\n return $t('label.authentication')\n }\n if (activeView.value === 'files') {\n return $t('userFiles.chatFilesTitle')\n }\n return props.name\n })\n\n // state\n const activeMessage = computed(() => {\n return messages.value?.[messages.value.length - 1]\n })\n\n // expose\n defineExpose({\n startNewChat,\n regenerate,\n stopGeneration,\n sendMessage,\n sendSelection: store.sendSelection,\n })\n\n // load chat, conversations and feedbacks on agent or chat change\n watch(\n [storeAgentId, localChatId],\n async ([newAgentId, newChatId]) => {\n await store.initialize(newAgentId, newChatId)\n emit('loaded', newChatId)\n },\n {\n immediate: true,\n },\n )\n // load conversations when navigating to conversations view\n watch(activeView, (newView) => {\n if (newView === 'conversations') {\n store.loadConversations(storeAgentId.value)\n } else if (newView === 'files') {\n store.loadChatFiles()\n }\n })\n // emit message updates for up-to-date context in parent components\n watch(\n activeMessage,\n (message) => {\n if (message) {\n emit('message-update', message)\n }\n },\n {\n deep: true,\n immediate: true,\n },\n )\n</script>\n\n<template>\n <div\n ref=\"chatbotEl\"\n class=\"pk-chatbot\"\n :class=\"[\n themeClass,\n {\n 'pk-chatbot--fullscreen': isFullscreen,\n 'pk-chatbot--panel': isPanel,\n 'pk-chatbot--phone': isPhoneWidth,\n 'pk-chatbot--tight': isTightWidth,\n 'pk-chatbot--wide': isWideWidth,\n },\n ]\"\n :style=\"themeStyle\">\n <!-- #region title -->\n <div\n v-if=\"!isFullscreen\"\n class=\"pk-chatbot__header\"\n :style=\"\n useColorsForAgentHeader\n ? {\n backgroundColor: mainColor,\n }\n : undefined\n \">\n <div class=\"pk-chatbot__header-start\">\n <template v-if=\"activeView !== 'chat'\">\n <VvButton\n v-bind=\"{\n modifiers: useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet',\n icon: 'ri:arrow-left-s-line',\n title: $t('action.goBack'),\n }\"\n @click=\"navigate('chat')\" />\n <VvIcon\n :name=\"\n activeView === 'conversations'\n ? 'ri:history-line'\n : activeView === 'files'\n ? 'ri:attachment-2'\n : 'ri:user-line'\n \"\n class=\"pk-chatbot__nav-icon\"\n :style=\"\n useColorsForAgentHeader\n ? {\n color: contrastColor,\n }\n : undefined\n \" />\n </template>\n <!-- Panel mode: no avatar, the docked panel identifies the\n agent with the title alone -->\n <PkAvatar\n v-else-if=\"!isPanel\"\n class=\"pk-chatbot__avatar\"\n :name\n :img-src=\"agentInterface?.logo\" />\n <strong\n class=\"pk-chatbot__title\"\n :title=\"title\"\n :style=\"\n useColorsForAgentHeader\n ? {\n color: contrastColor,\n }\n : undefined\n \">\n {{ title }}\n </strong>\n </div>\n <VvButtonGroup class=\"pk-chatbot__header-end\" modifiers=\"compact\">\n <slot\n name=\"header-actions\"\n v-bind=\"{\n mainColor,\n useColorsForAgentHeader,\n contrastColor,\n startNewChat,\n stopGeneration,\n }\" />\n <template v-if=\"isPanel\">\n <VvButton\n :modifiers=\"\n useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet'\n \"\n icon=\"ri:edit-box-line\"\n :title=\"$t('action.startNewChat')\"\n @click=\"startNewChat()\" />\n <VvButton\n v-if=\"!isReasoningAgent\"\n :modifiers=\"\n useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet'\n \"\n icon=\"ri:history-line\"\n :title=\"$t('action.viewRecentChats')\"\n @click=\"navigate('conversations')\" />\n </template>\n <VvDropdown\n v-if=\"showHeaderMenu\"\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n v-bind=\"{\n modifiers: useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet',\n icon: 'ri:more-2-fill',\n title: $t('action.moreActions'),\n }\" />\n <template #items>\n <VvDropdownAction\n v-if=\"!isPanel\"\n @click=\"startNewChat()\">\n <VvIcon name=\"ri:edit-box-line\" />\n {{ $t('action.startNewChat') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"!isReasoningAgent && !isPanel\"\n @click=\"navigate('conversations')\">\n <VvIcon name=\"ri:history-line\" />\n {{ $t('action.viewRecentChats') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"\n (canManageProfile || userFilesEnabled) &&\n localChatId\n \"\n @click=\"navigate('files')\">\n <VvIcon name=\"ri:attachment-2\" />\n {{ $t('userFiles.chatFilesTitle') }}\n </VvDropdownAction>\n <!-- The user's own switch for the page tools, for\n this tab (spec page-tools.md) -->\n <VvDropdownAction\n v-if=\"pageAccessAvailable\"\n @click=\"setPageAccessOff(!pageAccessOff)\">\n <VvIcon\n :name=\"\n pageAccessOff\n ? 'ri:pages-line'\n : 'ri:forbid-line'\n \" />\n {{\n pageAccessOff\n ? $t('action.enablePageAccess')\n : $t('action.disablePageAccess')\n }}\n </VvDropdownAction>\n <!-- The user's choice of confirmations, where the\n agent allows it (spec auto-confirmations.md) -->\n <VvDropdownAction\n v-if=\"confirmationsAvailable\"\n @click=\"\n setConfirmationMode(\n confirmationMode === 'automatic'\n ? 'manual'\n : 'automatic',\n )\n \">\n <VvIcon\n :name=\"\n confirmationMode === 'automatic'\n ? 'ri:hand'\n : 'ri:flashlight-line'\n \" />\n {{\n confirmationMode === 'automatic'\n ? $t('action.manualConfirmations')\n : $t('action.automaticConfirmations')\n }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"canManageProfile\"\n @click=\"navigate('profile')\">\n <VvIcon name=\"ri:user-line\" />\n {{ $t('label.profile') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-else-if=\"canSignIn\"\n @click=\"navigate('auth')\">\n <VvIcon name=\"ri:account-circle-line\" />\n {{ $t('action.signIn') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"closable\"\n @click=\"emit('close')\">\n <VvIcon name=\"ri:close-line\" />\n {{ $t('action.close') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n <slot\n name=\"actions\"\n v-bind=\"{\n mainColor,\n useColorsForAgentHeader,\n contrastColor,\n startNewChat,\n stopGeneration,\n }\" />\n </VvButtonGroup>\n </div>\n <!-- #endregion -->\n\n <div v-if=\"showReasoningNotice\">\n <div class=\"pk-chatbot__warning-body\">\n <VvAlert modifiers=\"callout\">\n <div class=\"pk-chatbot__warning-header\">\n <VvIcon\n name=\"ri:alert-line\"\n class=\"pk-chatbot__warning-icon\" />\n <strong class=\"pk-chatbot__warning-title\">\n {{ $t('message.warning') }}\n </strong>\n </div>\n <p class=\"pk-chatbot__warning-text\">\n {{ $t('message.reasoningAgent') }}\n </p>\n </VvAlert>\n </div>\n </div>\n\n <!-- #region views -->\n <PkChatbotViewChat\n v-if=\"activeView === 'chat'\"\n :agent-id\n :modifier\n :user-name\n @show-info=\"emit('show-info', $event)\"\n @revise=\"emit('revise', $event)\"\n @selection-action=\"emit('selection-action', $event)\">\n <template\n v-for=\"slotName in Object.keys(slots)\"\n #[slotName]=\"slotData\"\n ><slot :name=\"slotName\" v-bind=\"slotData\"\n /></template>\n </PkChatbotViewChat>\n <PkChatbotViewConversations\n v-else-if=\"activeView === 'conversations'\"\n :agent-id>\n <template\n v-for=\"slotName in Object.keys(slots)\"\n #[slotName]=\"slotData\"\n ><slot :name=\"slotName\" v-bind=\"slotData\"\n /></template>\n </PkChatbotViewConversations>\n <PkChatbotViewFiles v-else-if=\"activeView === 'files'\" :agent-id />\n <div\n v-else-if=\"activeView === 'auth'\"\n class=\"pk-chatbot__view-auth flex-1 min-h-0 overflow-y-auto\">\n <!-- Sign-in form provided by the host widget (owns the auth client) -->\n <slot name=\"view-auth\" />\n </div>\n <PkChatbotViewProfile v-else :agent-id>\n <template\n v-for=\"slotName in Object.keys(slots)\"\n #[slotName]=\"slotData\"\n ><slot :name=\"slotName\" v-bind=\"slotData\"\n /></template>\n </PkChatbotViewProfile>\n <!-- #endregion -->\n\n <!-- #region footer -->\n <div v-if=\"footerMessage\" class=\"pk-chatbot__footer\">\n <PkStreamingMarkdown :markdown=\"footerMessage\" class=\"wysiwyg\" />\n </div>\n <!-- #endregion -->\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot {\n display: flex;\n flex-direction: column;\n position: relative;\n height: 100%;\n background-color: var(--color-surface);\n\n &__header {\n position: sticky;\n top: 0;\n z-index: 1;\n display: flex;\n justify-content: space-between;\n gap: var(--spacing-14);\n background-color: var(--color-surface-1);\n padding: var(--spacing-14);\n border-bottom: 1px solid var(--color-surface-3);\n }\n\n &__header-start {\n display: flex;\n align-items: center;\n gap: var(--spacing-sm);\n min-width: 0;\n }\n\n &__nav-icon {\n font-size: var(--text-18);\n }\n\n &__avatar {\n width: var(--spacing-24);\n height: var(--spacing-24);\n }\n\n &__title {\n font-size: var(--text-16);\n font-weight: var(--font-semibold);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &__header-end {\n flex-shrink: 0;\n }\n\n &__warning-body {\n padding: var(--spacing-md);\n border-bottom: 1px solid var(--color-surface-3);\n }\n\n &__warning-header {\n display: flex;\n align-items: center;\n gap: var(--spacing-4);\n margin-bottom: var(--spacing-4);\n }\n\n &__warning-icon {\n width: var(--spacing-16);\n height: var(--spacing-16);\n }\n\n &__warning-title {\n font-weight: 600;\n font-size: var(--text-14);\n }\n\n &__warning-text {\n font-size: var(--text-12);\n color: var(--color-word-3);\n }\n\n &__footer {\n padding: var(--spacing-md);\n border-top: 1px solid var(--color-surface-3);\n text-align: center;\n font-size: var(--text-12);\n color: var(--color-word-2);\n }\n\n // Modifier: fullscreen — layout full-page (Gemini-style): nessun\n // header interno, sfondo trasparente, input pill centrato.\n // Il chrome (sidebar, navigazione) è gestito dalla pagina ospite.\n &--fullscreen {\n // The dock, 60px. Declared rather than taken from the agent chip,\n // which the tight layout hides: the pill fell to 54px there and\n // the call bar that takes its place stayed at 60. There is no 60\n // in the spacing scale and a raw `60px` would stop following the\n // root font size, which the labels inside do follow.\n --pk-chat-fullscreen-dock-height: calc(\n var(--spacing-56) + var(--spacing-4)\n );\n\n // The pill, the notice that tucks into its top corners and the\n // call bar all round their ends on half of it.\n --pk-chat-dock-radius: calc(\n var(--pk-chat-fullscreen-dock-height) / 2\n );\n\n background-color: transparent;\n\n .pk-chatbot__footer {\n border-top: none;\n padding: 0 var(--spacing-md) var(--spacing-sm) var(--spacing-md);\n }\n\n // Reading column aligned with the input (Gemini-style). The\n // constraint lives on the inner wrapper so the scroll container\n // spans the page and the scrollbar sits at its edge.\n .pk-chatbot-messages {\n // Symmetric gutters: a visible scrollbar would otherwise\n // shrink the content box on one side only, shifting the\n // column off the input axis\n scrollbar-gutter: stable both-edges;\n\n // Dissolve the content at both edges (works on any page\n // background, dots included — a surface-colored fade band\n // would cut through the pattern instead)\n mask-image: linear-gradient(\n to bottom,\n transparent 0,\n #000 var(--spacing-40),\n #000 calc(100% - var(--spacing-40)),\n transparent 100%\n );\n\n // Resting clearance so the first/last lines sit inside the\n // fully opaque zone\n padding-block: var(--spacing-48);\n }\n\n .pk-chatbot-messages__wrapper {\n width: 100%;\n max-width: 768px;\n margin-inline: auto;\n }\n\n // Outline rail: wide chats only, measured on the chat and not on\n // the viewport, so a preview frame squeezed by side panels loses\n // it like a phone does. The rail sits at the edge of the scroll\n // area beside the reading column: below the `--wide` threshold\n // (768px column plus a 40px rail on each side) it would cover the\n // messages instead.\n .pk-chatbot-messages__outline {\n display: none;\n }\n\n &.pk-chatbot--wide .pk-chatbot-messages__outline {\n display: block;\n }\n\n .pk-chatbot-file-preview {\n background-color: var(--color-surface);\n }\n\n .pk-chatbot-input__notice {\n background-color: var(--color-surface);\n border-inline: 1px solid var(--color-surface-3);\n border-top: 1px solid var(--color-surface-2);\n padding: var(--spacing-10) var(--spacing-16);\n\n // As deep as the pill's corners, or the page shows through\n // where their curve leaves the side\n &::after {\n background-color: var(--color-surface);\n border-inline: 1px solid var(--color-surface-2);\n bottom: calc(-1 * var(--pk-chat-dock-radius));\n height: var(--pk-chat-dock-radius);\n left: -1px;\n right: -1px;\n }\n }\n\n .pk-chatbot-input {\n width: calc(100% - var(--spacing-sm) * 2);\n max-width: 768px;\n margin-inline: auto;\n\n &__form {\n // True semicircles at rest, concentric with the send\n // button, whose center sits 30px in. Not `rounded-full`:\n // once Shift+Enter grows the field the ends would swell\n // with it and cut into the first and last line.\n border-radius: var(--pk-chat-dock-radius);\n min-height: var(--pk-chat-fullscreen-dock-height);\n padding: var(--spacing-12) var(--spacing-16);\n background-color: var(--color-surface-1);\n border-color: var(--color-surface-2);\n box-shadow: none;\n transition:\n border-color var(--duration-200) var(--ease-in-out),\n box-shadow var(--duration-200) var(--ease-in-out);\n\n &:has(:focus-within) {\n border-color: var(--color-surface-4);\n box-shadow: var(--shadow-sm);\n }\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n }\n\n &__textarea {\n background-color: transparent;\n }\n }\n\n // A live call takes the place of the input, so it takes its shape,\n // its column and its height: full-bleed here would break the\n // reading axis, and a different height would make the dock jump\n // the moment the call starts.\n .pk-voice-session {\n --pk-chat-dock-height: var(--pk-chat-fullscreen-dock-height);\n --pk-voice-orb-size: var(--spacing-40);\n --pk-voice-orb-bars-height: var(--spacing-20);\n --pk-voice-session-surface: var(--color-surface-1);\n\n width: calc(100% - var(--spacing-sm) * 2);\n max-width: 768px;\n margin-inline: auto;\n padding-inline: var(--spacing-16);\n border-color: var(--color-surface-2);\n border-radius: var(--pk-chat-dock-radius);\n box-shadow: none;\n\n &__timer {\n font-size: var(--text-14);\n }\n }\n }\n\n // Modifier: panel — compact chrome for a docked side panel: the host\n // container owns background and border, the header slims down and\n // drops its own surface so the chat blends into the panel.\n &--panel {\n background-color: transparent;\n\n .pk-chatbot__header {\n background-color: transparent;\n\n // Fixed height so the panel header lines up with the host's\n // own chrome. Custom properties inherit through the shadow\n // root: an embedding host can override it to match its\n // header (the default matches the platform header, 50px).\n height: var(--pk-chatbot-panel-header-height, 50px);\n align-items: center;\n padding-block: 0;\n padding-inline: var(--spacing-10);\n border-bottom: 1px solid var(--color-surface-3);\n }\n\n .pk-chatbot__title {\n font-size: var(--text-14);\n }\n\n .pk-chatbot__footer {\n border-top: none;\n padding: var(--spacing-6) var(--spacing-md);\n }\n }\n\n // A chat given a whole page without the fullscreen layout (the page\n // an iframe embeds, a widget its host lets fill the screen) keeps the\n // reading column of the fullscreen one: at 1440px an answer ran\n // 1408px wide, some two hundred characters a line. Measured on the\n // chat, like `--wide` itself, so a narrow frame is left alone.\n &--wide:not(.pk-chatbot--fullscreen) {\n .pk-chatbot-messages__wrapper,\n .pk-chatbot-input {\n width: 100%;\n max-width: 768px;\n margin-inline: auto;\n }\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import {\n computed,\n inject,\n toRef,\n useTemplateRef,\n watch,\n watchEffect,\n useSlots,\n } from 'vue'\n import { useElementSize } from '@vueuse/core'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import type {\n AgentConfirmationsCapability,\n AgentInterface,\n AgentModel,\n AgentFileUpload,\n AgentGatewayOptions,\n AgentVoiceCapability,\n ChatMessageActions,\n RevisedAnswer,\n UIChatMessage,\n AgentTools,\n HostToolsCapability,\n PageAccessCapability,\n SelectionActionsCapability,\n } from 'models'\n import {\n type RegisteredHostTool,\n useChatbotStore,\n useLocalizedString,\n provideShortUrlResolver,\n } from 'composables'\n import PkAvatar from './PkAvatar.vue'\n import PkChatbotViewChat from './PkChatbotViewChat.vue'\n import PkChatbotViewConversations from './PkChatbotViewConversations.vue'\n import PkChatbotViewFiles from './PkChatbotViewFiles.vue'\n import PkChatbotViewProfile from './PkChatbotViewProfile.vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import { ChatbotProfileContextKey } from './chatbotProfileContext'\n import { provideChatImagePolicy } from './chatImagePolicy'\n import { agentThemeStyle, resolveContrastColor } from './utils'\n\n // Captured in script setup to avoid TS7022 circular inference in template\n const slots = useSlots()\n\n const { t: $t } = useI18n({\n useScope: 'global',\n })\n\n const props = defineProps<{\n baseUrl: string\n basePath?: string\n agentId: string\n agentType?: 'reasoning' | 'chat'\n userId?: string\n name?: string\n model?: string\n agentModel?: AgentModel\n agentTools?: AgentTools\n agentInterface?: AgentInterface\n actions?: ChatMessageActions[]\n revisedAnswers?: RevisedAnswer[]\n headers?: Record<string, string>\n systemTheme?: 'light' | 'dark'\n agentFileUpload?: AgentFileUpload\n /** Voice configuration from the agent settings: enables the talk button. */\n voice?: AgentVoiceCapability\n fallbackModels?: string[]\n gatewayOptions?: Partial<AgentGatewayOptions>\n externalContext?: Record<string, unknown>\n /** Host tools as the agent allows them (`capabilities.hostTools` of the public agent). */\n hostTools?: HostToolsCapability\n /** Tools the embedding app registered, with the function that runs each (spec `host-tools.md`). */\n hostToolRegistry?: RegisteredHostTool[]\n /** Page access as the agent allows it (`capabilities.pageAccess`, spec `page-tools.md`). */\n pageAccess?: PageAccessCapability\n /** Whether the user may choose automatic confirmations (`capabilities.confirmations`, spec `auto-confirmations.md`). */\n confirmations?: AgentConfirmationsCapability\n /** The selection bar's groups (`capabilities.selectionActions`, spec `selection-actions.md`). */\n selectionActions?: SelectionActionsCapability\n /** The widget's page tools: only the web component provides them. */\n pageToolRegistry?: RegisteredHostTool[]\n /** The tools of the forms annotated on the page now, read on every request. */\n pageForms?: () => RegisteredHostTool[]\n /** Layout modifier: `widget` (default) keeps the contained layout with header, `fullscreen` removes header/background for full-page usage (the page provides the chrome), `panel` keeps the header but slims it down for a docked side panel (the host provides background and border) */\n modifier?: 'widget' | 'fullscreen' | 'panel'\n /** Display name of the current user, used for the `{name}` placeholder in the fullscreen greeting */\n userName?: string\n /** Show the \"Files in this chat\" menu for hosts that don't provide the\n * profile context but whose user is authenticated (e.g. the backoffice\n * playground). The widget host relies on `canManageProfile` instead. */\n userFilesEnabled?: boolean\n /** The host can close the chat: the header menu offers \"Close\", which emits `close`. */\n closable?: boolean\n }>()\n const emit = defineEmits<{\n 'message-update': [message: UIChatMessage]\n 'show-info': [message: UIChatMessage]\n revise: [message: UIChatMessage]\n error: [error: { type: string; title: string; status: number }]\n /** That conversation is loaded: a message sent now lands in it. */\n loaded: [chatId: string]\n /** The user chose \"Close\" in the header menu. */\n close: []\n /** An action of a selection bar was sent: the telemetry's properties (spec `selection-actions.md`). */\n 'selection-action': [properties: Record<string, string>]\n }>()\n\n const chatId = defineModel<string | undefined>('chatId', {\n type: String,\n default: undefined,\n })\n\n const store = useChatbotStore(props.agentId)\n\n // Resolve backend short-urls (`/api/r/<hash>`) back to their real target\n // for display in tool components. Batched + cached across the chat tree.\n provideShortUrlResolver((hashes) =>\n store.apiClient.resolveShortUrls(hashes),\n )\n\n const {\n messages,\n localChatId,\n activeView,\n chatError,\n isDark,\n pageAccessAvailable,\n pageAccessOff,\n confirmationsAvailable,\n confirmationMode,\n } = storeToRefs(store)\n\n // Ref to store.agentId for watchers (avoids duplicate-key with agentId prop)\n const storeAgentId = toRef(store, 'agentId')\n\n const {\n startNewChat,\n stopGeneration,\n regenerate,\n navigate,\n sendMessage,\n setPageAccessOff,\n setConfirmationMode,\n } = store\n\n // Images in the answers and the tool cards load by themselves only from\n // the backend this chat talks to and from the hosts the agent lists.\n provideChatImagePolicy(\n () => props.agentInterface?.imageHosts,\n () => props.baseUrl,\n )\n\n // Optional profile-management context provided by the host widget.\n // Present only for authenticated, non-anonymous sessions.\n const profile = inject(ChatbotProfileContextKey, undefined)\n const canManageProfile = computed(\n () => profile?.canManageProfile.value ?? false,\n )\n // Anonymous users get a \"Sign in\" entry instead of the profile one,\n // provided the host filled the `view-auth` slot and the agent has at\n // least one auth method enabled.\n const canSignIn = computed(\n () =>\n !canManageProfile.value &&\n (profile?.canSignIn?.value ?? false) &&\n slots['view-auth'] !== undefined,\n )\n\n // Once the sign-in completes (the session becomes non-anonymous) leave\n // the auth view and return to the conversation.\n watch(canManageProfile, (canManage) => {\n if (canManage && activeView.value === 'auth') {\n navigate('chat')\n }\n })\n\n // Sync props → store reactively\n watchEffect(() => {\n store.baseUrl = props.baseUrl\n store.basePath = props.basePath\n store.name = props.name\n store.agentType = props.agentType\n store.userId = props.userId\n store.agentInterface = props.agentInterface\n store.agentModel = props.agentModel\n store.agentTools = props.agentTools\n store.headers = props.headers\n store.revisedAnswers = props.revisedAnswers\n store.model = props.model\n store.actionsInput = props.actions\n store.agentFileUpload = props.agentFileUpload\n store.agentVoice = props.voice\n store.fallbackModels = props.fallbackModels\n store.gatewayOptions = props.gatewayOptions\n store.externalContext = props.externalContext\n store.agentHostTools = props.hostTools\n store.hostToolRegistry = props.hostToolRegistry\n store.agentPageAccess = props.pageAccess\n store.agentConfirmations = props.confirmations\n store.agentSelectionActions = props.selectionActions\n store.pageToolRegistry = props.pageToolRegistry\n store.pageFormsProvider = props.pageForms\n store.systemTheme = props.systemTheme\n store.hideWelcomeMessage = props.modifier === 'fullscreen'\n })\n\n // Sync chatId v-model ↔ store (bidirectional)\n // Parent → store: if the parent provides an external chatId, push it into\n // the store so the Chat instance picks it up.\n watch(\n () => chatId.value,\n (id) => {\n if (id && id !== store.localChatId) {\n store.localChatId = id\n }\n },\n { immediate: true },\n )\n // Store → parent: keep the v-model in sync whenever the store changes\n // the chatId internally (e.g. startNewChat).\n watch(localChatId, (id) => {\n chatId.value = id\n })\n\n // Emit structured errors from chat to the parent component\n watch(chatError, (error) => {\n if (!error) {\n return\n }\n try {\n const parsedError = JSON.parse(error.message) as {\n type: string\n title: string\n status: number\n }\n emit('error', parsedError)\n } catch {\n // ignore non-JSON errors\n }\n })\n\n // ui\n const isFullscreen = computed(() => props.modifier === 'fullscreen')\n const isPanel = computed(() => props.modifier === 'panel')\n\n /**\n * How much room the chat has, measured on the chat and not on the window.\n *\n * The same chat renders in a phone page, in a 408px widget, in a docked\n * panel and in a preview frame that the side panels squeeze to phone width\n * on a desktop screen, so the viewport says nothing about the space the\n * layout actually has. A CSS container query would read the same number\n * with no JavaScript, but `container-type` makes the element a containing\n * block for `position: fixed` descendants on every engine except Chrome\n * 129 and later, which displaces every dropdown in the chat: see\n * docs/agents/gotchas.md, \"The chat measures its own width, and not with a\n * container query\".\n *\n * The thresholds carry the modifiers, so the CSS stays declarative:\n * `--phone` has as much room as a phone page, `--tight` is too tight for\n * the agent chip beside the field, `--wide` has room for the outline rail\n * beside the reading column. Before the first measurement the width is 0\n * and no modifier applies, which is the roomy layout the base CSS writes.\n */\n const chatbotEl = useTemplateRef<HTMLDivElement>('chatbotEl')\n const { width: chatbotWidth } = useElementSize(chatbotEl)\n const isPhoneWidth = computed(\n () => chatbotWidth.value > 0 && chatbotWidth.value < 576,\n )\n const isTightWidth = computed(\n () => chatbotWidth.value > 0 && chatbotWidth.value < 640,\n )\n const isWideWidth = computed(() => chatbotWidth.value >= 848)\n const isReasoningAgent = computed(() => props.agentType === 'reasoning')\n // The notice says how a reasoning agent reads a message: it stands before\n // the first one, then leaves the room to the answers (pinned, it took a\n // third of a phone screen in the reasoning playground)\n const showReasoningNotice = computed(\n () =>\n isReasoningAgent.value &&\n !messages.value.some((message) => message.role === 'user'),\n )\n // A docked panel keeps a neutral header whatever the agent asks: it sits\n // beside the site or the app as part of the frame, and a colored band\n // made it read as a second site next to the first one.\n const useColorsForAgentHeader = computed(\n () => !isPanel.value && props.agentInterface?.useColorsForAgentHeader,\n )\n // Panel mode promotes the everyday actions (new chat, history) from the\n // dropdown to direct header buttons: the dropdown then only remains for\n // the secondary entries (files, profile, sign-in) and disappears when\n // none of them applies.\n const showHeaderMenu = computed(\n () =>\n !isPanel.value ||\n canManageProfile.value ||\n canSignIn.value ||\n pageAccessAvailable.value ||\n confirmationsAvailable.value ||\n props.closable ||\n (!!props.userFilesEnabled && !!localChatId.value),\n )\n const themeClass = computed(() => [\n 'theme',\n `theme--${isDark.value ? 'dark' : 'light'}`,\n ])\n const mainColor = computed(() => props.agentInterface?.mainColor)\n const contrastColor = computed(() =>\n resolveContrastColor(props.agentInterface?.textColor, mainColor.value),\n )\n const themeStyle = computed(() =>\n agentThemeStyle(mainColor.value, contrastColor.value),\n )\n const footerMessage = useLocalizedString(\n () => props.agentInterface?.footerMessage,\n )\n const title = computed(() => {\n if (activeView.value === 'conversations') {\n return $t('label.conversations')\n }\n if (activeView.value === 'profile') {\n return $t('label.profile')\n }\n if (activeView.value === 'auth') {\n return $t('label.authentication')\n }\n if (activeView.value === 'files') {\n return $t('userFiles.chatFilesTitle')\n }\n return props.name\n })\n\n // state\n const activeMessage = computed(() => {\n return messages.value?.[messages.value.length - 1]\n })\n\n // expose\n defineExpose({\n startNewChat,\n regenerate,\n stopGeneration,\n sendMessage,\n sendSelection: store.sendSelection,\n })\n\n // load chat, conversations and feedbacks on agent or chat change\n watch(\n [storeAgentId, localChatId],\n async ([newAgentId, newChatId]) => {\n await store.initialize(newAgentId, newChatId)\n emit('loaded', newChatId)\n },\n {\n immediate: true,\n },\n )\n // load conversations when navigating to conversations view\n watch(activeView, (newView) => {\n if (newView === 'conversations') {\n store.loadConversations(storeAgentId.value)\n } else if (newView === 'files') {\n store.loadChatFiles()\n }\n })\n // emit message updates for up-to-date context in parent components\n watch(\n activeMessage,\n (message) => {\n if (message) {\n emit('message-update', message)\n }\n },\n {\n deep: true,\n immediate: true,\n },\n )\n</script>\n\n<template>\n <div\n ref=\"chatbotEl\"\n class=\"pk-chatbot\"\n :class=\"[\n themeClass,\n {\n 'pk-chatbot--fullscreen': isFullscreen,\n 'pk-chatbot--panel': isPanel,\n 'pk-chatbot--phone': isPhoneWidth,\n 'pk-chatbot--tight': isTightWidth,\n 'pk-chatbot--wide': isWideWidth,\n },\n ]\"\n :style=\"themeStyle\">\n <!-- #region title -->\n <div\n v-if=\"!isFullscreen\"\n class=\"pk-chatbot__header\"\n :style=\"\n useColorsForAgentHeader\n ? {\n backgroundColor: mainColor,\n }\n : undefined\n \">\n <div class=\"pk-chatbot__header-start\">\n <template v-if=\"activeView !== 'chat'\">\n <VvButton\n v-bind=\"{\n modifiers: useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet',\n icon: 'ri:arrow-left-s-line',\n title: $t('action.goBack'),\n }\"\n @click=\"navigate('chat')\" />\n <VvIcon\n :name=\"\n activeView === 'conversations'\n ? 'ri:history-line'\n : activeView === 'files'\n ? 'ri:attachment-2'\n : 'ri:user-line'\n \"\n class=\"pk-chatbot__nav-icon\"\n :style=\"\n useColorsForAgentHeader\n ? {\n color: contrastColor,\n }\n : undefined\n \" />\n </template>\n <!-- Panel mode: no avatar, the docked panel identifies the\n agent with the title alone -->\n <PkAvatar\n v-else-if=\"!isPanel\"\n class=\"pk-chatbot__avatar\"\n :name\n :img-src=\"agentInterface?.logo\" />\n <strong\n class=\"pk-chatbot__title\"\n :title=\"title\"\n :style=\"\n useColorsForAgentHeader\n ? {\n color: contrastColor,\n }\n : undefined\n \">\n {{ title }}\n </strong>\n </div>\n <VvButtonGroup class=\"pk-chatbot__header-end\" modifiers=\"compact\">\n <slot\n name=\"header-actions\"\n v-bind=\"{\n mainColor,\n useColorsForAgentHeader,\n contrastColor,\n startNewChat,\n stopGeneration,\n }\" />\n <template v-if=\"isPanel\">\n <VvButton\n :modifiers=\"\n useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet'\n \"\n icon=\"ri:edit-box-line\"\n :title=\"$t('action.startNewChat')\"\n @click=\"startNewChat()\" />\n <VvButton\n v-if=\"!isReasoningAgent\"\n :modifiers=\"\n useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet'\n \"\n icon=\"ri:history-line\"\n :title=\"$t('action.viewRecentChats')\"\n @click=\"navigate('conversations')\" />\n </template>\n <VvDropdown\n v-if=\"showHeaderMenu\"\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n v-bind=\"{\n modifiers: useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet',\n icon: 'ri:more-2-fill',\n title: $t('action.moreActions'),\n }\" />\n <template #items>\n <VvDropdownAction\n v-if=\"!isPanel\"\n @click=\"startNewChat()\">\n <VvIcon name=\"ri:edit-box-line\" />\n {{ $t('action.startNewChat') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"!isReasoningAgent && !isPanel\"\n @click=\"navigate('conversations')\">\n <VvIcon name=\"ri:history-line\" />\n {{ $t('action.viewRecentChats') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"\n (canManageProfile || userFilesEnabled) &&\n localChatId\n \"\n @click=\"navigate('files')\">\n <VvIcon name=\"ri:attachment-2\" />\n {{ $t('userFiles.chatFilesTitle') }}\n </VvDropdownAction>\n <!-- The user's own switch for the page tools, for\n this tab (spec page-tools.md) -->\n <VvDropdownAction\n v-if=\"pageAccessAvailable\"\n @click=\"setPageAccessOff(!pageAccessOff)\">\n <VvIcon\n :name=\"\n pageAccessOff\n ? 'ri:pages-line'\n : 'ri:forbid-line'\n \" />\n {{\n pageAccessOff\n ? $t('action.enablePageAccess')\n : $t('action.disablePageAccess')\n }}\n </VvDropdownAction>\n <!-- The user's choice of confirmations, where the\n agent allows it (spec auto-confirmations.md) -->\n <VvDropdownAction\n v-if=\"confirmationsAvailable\"\n @click=\"\n setConfirmationMode(\n confirmationMode === 'automatic'\n ? 'manual'\n : 'automatic',\n )\n \">\n <VvIcon\n :name=\"\n confirmationMode === 'automatic'\n ? 'ri:hand'\n : 'ri:flashlight-line'\n \" />\n {{\n confirmationMode === 'automatic'\n ? $t('action.manualConfirmations')\n : $t('action.automaticConfirmations')\n }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"canManageProfile\"\n @click=\"navigate('profile')\">\n <VvIcon name=\"ri:user-line\" />\n {{ $t('label.profile') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-else-if=\"canSignIn\"\n @click=\"navigate('auth')\">\n <VvIcon name=\"ri:account-circle-line\" />\n {{ $t('action.signIn') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"closable\"\n @click=\"emit('close')\">\n <VvIcon name=\"ri:close-line\" />\n {{ $t('action.close') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n <slot\n name=\"actions\"\n v-bind=\"{\n mainColor,\n useColorsForAgentHeader,\n contrastColor,\n startNewChat,\n stopGeneration,\n }\" />\n </VvButtonGroup>\n </div>\n <!-- #endregion -->\n\n <div v-if=\"showReasoningNotice\">\n <div class=\"pk-chatbot__warning-body\">\n <VvAlert modifiers=\"callout\">\n <div class=\"pk-chatbot__warning-header\">\n <VvIcon\n name=\"ri:alert-line\"\n class=\"pk-chatbot__warning-icon\" />\n <strong class=\"pk-chatbot__warning-title\">\n {{ $t('message.warning') }}\n </strong>\n </div>\n <p class=\"pk-chatbot__warning-text\">\n {{ $t('message.reasoningAgent') }}\n </p>\n </VvAlert>\n </div>\n </div>\n\n <!-- #region views -->\n <PkChatbotViewChat\n v-if=\"activeView === 'chat'\"\n :agent-id\n :modifier\n :user-name\n @show-info=\"emit('show-info', $event)\"\n @revise=\"emit('revise', $event)\"\n @selection-action=\"emit('selection-action', $event)\">\n <template\n v-for=\"slotName in Object.keys(slots)\"\n #[slotName]=\"slotData\"\n ><slot :name=\"slotName\" v-bind=\"slotData\"\n /></template>\n </PkChatbotViewChat>\n <PkChatbotViewConversations\n v-else-if=\"activeView === 'conversations'\"\n :agent-id>\n <template\n v-for=\"slotName in Object.keys(slots)\"\n #[slotName]=\"slotData\"\n ><slot :name=\"slotName\" v-bind=\"slotData\"\n /></template>\n </PkChatbotViewConversations>\n <PkChatbotViewFiles v-else-if=\"activeView === 'files'\" :agent-id />\n <div\n v-else-if=\"activeView === 'auth'\"\n class=\"pk-chatbot__view-auth flex-1 min-h-0 overflow-y-auto\">\n <!-- Sign-in form provided by the host widget (owns the auth client) -->\n <slot name=\"view-auth\" />\n </div>\n <PkChatbotViewProfile v-else :agent-id>\n <template\n v-for=\"slotName in Object.keys(slots)\"\n #[slotName]=\"slotData\"\n ><slot :name=\"slotName\" v-bind=\"slotData\"\n /></template>\n </PkChatbotViewProfile>\n <!-- #endregion -->\n\n <!-- #region footer -->\n <div v-if=\"footerMessage\" class=\"pk-chatbot__footer\">\n <PkStreamingMarkdown :markdown=\"footerMessage\" class=\"wysiwyg\" />\n </div>\n <!-- #endregion -->\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot {\n display: flex;\n flex-direction: column;\n position: relative;\n height: 100%;\n background-color: var(--color-surface);\n\n &__header {\n position: sticky;\n top: 0;\n z-index: 1;\n display: flex;\n justify-content: space-between;\n gap: var(--spacing-14);\n background-color: var(--color-surface-1);\n padding: var(--spacing-14);\n border-bottom: 1px solid var(--color-surface-3);\n }\n\n &__header-start {\n display: flex;\n align-items: center;\n gap: var(--spacing-sm);\n min-width: 0;\n }\n\n &__nav-icon {\n font-size: var(--text-18);\n }\n\n &__avatar {\n width: var(--spacing-24);\n height: var(--spacing-24);\n }\n\n &__title {\n font-size: var(--text-16);\n font-weight: var(--font-semibold);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &__header-end {\n flex-shrink: 0;\n }\n\n &__warning-body {\n padding: var(--spacing-md);\n border-bottom: 1px solid var(--color-surface-3);\n }\n\n &__warning-header {\n display: flex;\n align-items: center;\n gap: var(--spacing-4);\n margin-bottom: var(--spacing-4);\n }\n\n &__warning-icon {\n width: var(--spacing-16);\n height: var(--spacing-16);\n }\n\n &__warning-title {\n font-weight: 600;\n font-size: var(--text-14);\n }\n\n &__warning-text {\n font-size: var(--text-12);\n color: var(--color-word-3);\n }\n\n &__footer {\n padding: var(--spacing-md);\n border-top: 1px solid var(--color-surface-3);\n text-align: center;\n font-size: var(--text-12);\n color: var(--color-word-2);\n }\n\n // Modifier: fullscreen — layout full-page (Gemini-style): nessun\n // header interno, sfondo trasparente, input pill centrato.\n // Il chrome (sidebar, navigazione) è gestito dalla pagina ospite.\n &--fullscreen {\n // The dock, 60px. Declared rather than taken from the agent chip,\n // which the tight layout hides: the pill fell to 54px there and\n // the call bar that takes its place stayed at 60. There is no 60\n // in the spacing scale and a raw `60px` would stop following the\n // root font size, which the labels inside do follow.\n --pk-chat-fullscreen-dock-height: calc(\n var(--spacing-56) + var(--spacing-4)\n );\n\n // The pill, the notice that tucks into its top corners and the\n // call bar all round their ends on half of it.\n --pk-chat-dock-radius: calc(\n var(--pk-chat-fullscreen-dock-height) / 2\n );\n\n background-color: transparent;\n\n .pk-chatbot__footer {\n border-top: none;\n padding: 0 var(--spacing-md) var(--spacing-sm) var(--spacing-md);\n }\n\n // Reading column aligned with the input (Gemini-style). The\n // constraint lives on the inner wrapper so the scroll container\n // spans the page and the scrollbar sits at its edge.\n .pk-chatbot-messages {\n // Symmetric gutters: a visible scrollbar would otherwise\n // shrink the content box on one side only, shifting the\n // column off the input axis\n scrollbar-gutter: stable both-edges;\n\n // Dissolve the content at both edges (works on any page\n // background, dots included — a surface-colored fade band\n // would cut through the pattern instead)\n mask-image: linear-gradient(\n to bottom,\n transparent 0,\n #000 var(--spacing-40),\n #000 calc(100% - var(--spacing-40)),\n transparent 100%\n );\n\n // Resting clearance so the first/last lines sit inside the\n // fully opaque zone\n padding-block: var(--spacing-48);\n }\n\n .pk-chatbot-messages__wrapper {\n width: 100%;\n max-width: 768px;\n margin-inline: auto;\n }\n\n // Outline rail: wide chats only, measured on the chat and not on\n // the viewport, so a preview frame squeezed by side panels loses\n // it like a phone does. The rail sits at the edge of the scroll\n // area beside the reading column: below the `--wide` threshold\n // (768px column plus a 40px rail on each side) it would cover the\n // messages instead.\n .pk-chatbot-messages__outline {\n display: none;\n }\n\n &.pk-chatbot--wide .pk-chatbot-messages__outline {\n display: block;\n }\n\n .pk-chatbot-file-preview {\n background-color: var(--color-surface);\n }\n\n .pk-chatbot-input__notice {\n background-color: var(--color-surface);\n border-inline: 1px solid var(--color-surface-3);\n border-top: 1px solid var(--color-surface-2);\n padding: var(--spacing-10) var(--spacing-16);\n\n // As deep as the pill's corners, or the page shows through\n // where their curve leaves the side\n &::after {\n background-color: var(--color-surface);\n border-inline: 1px solid var(--color-surface-2);\n bottom: calc(-1 * var(--pk-chat-dock-radius));\n height: var(--pk-chat-dock-radius);\n left: -1px;\n right: -1px;\n }\n }\n\n .pk-chatbot-input {\n width: calc(100% - var(--spacing-sm) * 2);\n max-width: 768px;\n margin-inline: auto;\n\n &__form {\n // True semicircles at rest, concentric with the send\n // button, whose center sits 30px in. Not `rounded-full`:\n // once Shift+Enter grows the field the ends would swell\n // with it and cut into the first and last line.\n border-radius: var(--pk-chat-dock-radius);\n min-height: var(--pk-chat-fullscreen-dock-height);\n padding: var(--spacing-12) var(--spacing-16);\n background-color: var(--color-surface-1);\n border-color: var(--color-surface-2);\n box-shadow: none;\n transition:\n border-color var(--duration-200) var(--ease-in-out),\n box-shadow var(--duration-200) var(--ease-in-out);\n\n &:has(:focus-within) {\n border-color: var(--color-surface-4);\n box-shadow: var(--shadow-sm);\n }\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n }\n\n &__textarea {\n background-color: transparent;\n }\n }\n\n // A live call takes the place of the input, so it takes its shape,\n // its column and its height: full-bleed here would break the\n // reading axis, and a different height would make the dock jump\n // the moment the call starts.\n .pk-voice-session {\n --pk-chat-dock-height: var(--pk-chat-fullscreen-dock-height);\n --pk-voice-orb-size: var(--spacing-40);\n --pk-voice-orb-bars-height: var(--spacing-20);\n --pk-voice-session-surface: var(--color-surface-1);\n\n width: calc(100% - var(--spacing-sm) * 2);\n max-width: 768px;\n margin-inline: auto;\n padding-inline: var(--spacing-16);\n border-color: var(--color-surface-2);\n border-radius: var(--pk-chat-dock-radius);\n box-shadow: none;\n\n &__timer {\n font-size: var(--text-14);\n }\n }\n }\n\n // Modifier: panel — compact chrome for a docked side panel: the host\n // container owns background and border, the header slims down and\n // drops its own surface so the chat blends into the panel.\n &--panel {\n background-color: transparent;\n\n .pk-chatbot__header {\n background-color: transparent;\n\n // Fixed height so the panel header lines up with the host's\n // own chrome. Custom properties inherit through the shadow\n // root: an embedding host can override it to match its\n // header (the default matches the platform header, 50px).\n height: var(--pk-chatbot-panel-header-height, 50px);\n align-items: center;\n padding-block: 0;\n padding-inline: var(--spacing-10);\n border-bottom: 1px solid var(--color-surface-3);\n }\n\n .pk-chatbot__title {\n font-size: var(--text-14);\n }\n\n .pk-chatbot__footer {\n border-top: none;\n padding: var(--spacing-6) var(--spacing-md);\n }\n }\n\n // A chat given a whole page without the fullscreen layout (the page\n // an iframe embeds, a widget its host lets fill the screen) keeps the\n // reading column of the fullscreen one: at 1440px an answer ran\n // 1408px wide, some two hundred characters a line. Measured on the\n // chat, like `--wide` itself, so a narrow frame is left alone.\n &--wide:not(.pk-chatbot--fullscreen) {\n .pk-chatbot-messages__wrapper,\n .pk-chatbot-input {\n width: 100%;\n max-width: 768px;\n margin-inline: auto;\n }\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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