@8wave/ai-elements 0.125.0-beta.35 → 0.125.0-beta.36

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 (136) hide show
  1. package/dist/_chunks/{Agent-CnCu6gNx.js → Agent-D9MWMkLp.js} +15 -11
  2. package/dist/_chunks/Agent-D9MWMkLp.js.map +1 -0
  3. package/dist/_chunks/{PkFilePreview-Ctp30WJH.js → PkFilePreview-Bic0SA47.js} +524 -450
  4. package/dist/_chunks/PkFilePreview-Bic0SA47.js.map +1 -0
  5. package/dist/_chunks/{PkFilePreviewDialog-B8JKpCXy.js → PkFilePreviewDialog-WKJ0Zm3O.js} +2 -2
  6. package/dist/_chunks/{PkFilePreviewDialog-B8JKpCXy.js.map → PkFilePreviewDialog-WKJ0Zm3O.js.map} +1 -1
  7. package/dist/_chunks/{PkSelectionActions-BOuC5Dvy.js → PkSelectionActions-mna8QQGY.js} +66 -56
  8. package/dist/_chunks/PkSelectionActions-mna8QQGY.js.map +1 -0
  9. package/dist/_chunks/{PkStreamingMarkdown-B0iGNA8Y.js → PkStreamingMarkdown-DKTxy47I.js} +3 -3
  10. package/dist/_chunks/{PkStreamingMarkdown-B0iGNA8Y.js.map → PkStreamingMarkdown-DKTxy47I.js.map} +1 -1
  11. package/dist/_chunks/{PkToolChatFile-DbmXl92B.js → PkToolChatFile-CTBwDxvV.js} +3 -3
  12. package/dist/_chunks/{PkToolChatFile-DbmXl92B.js.map → PkToolChatFile-CTBwDxvV.js.map} +1 -1
  13. package/dist/_chunks/{PkToolRequestGeolocation-DqrwL2xq.js → PkToolRequestGeolocation-XmQTnuwg.js} +2 -2
  14. package/dist/_chunks/{PkToolRequestGeolocation-DqrwL2xq.js.map → PkToolRequestGeolocation-XmQTnuwg.js.map} +1 -1
  15. package/dist/_chunks/{PkToolRequestOAuthConnection-CRHMFsVo.js → PkToolRequestOAuthConnection-BSKa66Nf.js} +2 -2
  16. package/dist/_chunks/{PkToolRequestOAuthConnection-CRHMFsVo.js.map → PkToolRequestOAuthConnection-BSKa66Nf.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowArtifact-BiIFmeNh.js → PkToolShowArtifact-C27hZNJd.js} +2 -2
  18. package/dist/_chunks/{PkToolShowArtifact-BiIFmeNh.js.map → PkToolShowArtifact-C27hZNJd.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowContactForm-CNLEoesy.js → PkToolShowContactForm-VVgxhvQd.js} +2 -2
  20. package/dist/_chunks/{PkToolShowContactForm-CNLEoesy.js.map → PkToolShowContactForm-VVgxhvQd.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowForm-DSUzABRs.js → PkToolShowForm-C4t_v1ps.js} +4 -4
  22. package/dist/_chunks/{PkToolShowForm-DSUzABRs.js.map → PkToolShowForm-C4t_v1ps.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowImageGallery-CuSEzHyb.js → PkToolShowImageGallery-y3iOOanc.js} +2 -2
  24. package/dist/_chunks/{PkToolShowImageGallery-CuSEzHyb.js.map → PkToolShowImageGallery-y3iOOanc.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowProductList-BHV90ovg.js → PkToolShowProductList-CTB2wcrz.js} +2 -2
  26. package/dist/_chunks/{PkToolShowProductList-BHV90ovg.js.map → PkToolShowProductList-CTB2wcrz.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowSources-LxKdEl5a.js → PkToolShowSources-Byv7DkHR.js} +3 -3
  28. package/dist/_chunks/{PkToolShowSources-LxKdEl5a.js.map → PkToolShowSources-Byv7DkHR.js.map} +1 -1
  29. package/dist/_chunks/{PkToolShowSuggestedReply-DQ64E-n3.js → PkToolShowSuggestedReply-D8FQu6Pd.js} +2 -2
  30. package/dist/_chunks/{PkToolShowSuggestedReply-DQ64E-n3.js.map → PkToolShowSuggestedReply-D8FQu6Pd.js.map} +1 -1
  31. package/dist/_chunks/{PkToolShowVideo-m9TYCZU4.js → PkToolShowVideo-B8Ql2lYD.js} +2 -2
  32. package/dist/_chunks/{PkToolShowVideo-m9TYCZU4.js.map → PkToolShowVideo-B8Ql2lYD.js.map} +1 -1
  33. package/dist/_chunks/{PkToolShowWebPages-D836KB_D.js → PkToolShowWebPages-CR-eQrdv.js} +2 -2
  34. package/dist/_chunks/{PkToolShowWebPages-D836KB_D.js.map → PkToolShowWebPages-CR-eQrdv.js.map} +1 -1
  35. package/dist/_chunks/{chatImagePolicy-DMvnRaBQ.js → chatImagePolicy-XBxAhi8o.js} +2 -2
  36. package/dist/_chunks/{chatImagePolicy-DMvnRaBQ.js.map → chatImagePolicy-XBxAhi8o.js.map} +1 -1
  37. package/dist/_chunks/{markdown-BLSDivef.js → markdown-DGKSBppG.js} +2 -2
  38. package/dist/_chunks/{markdown-BLSDivef.js.map → markdown-DGKSBppG.js.map} +1 -1
  39. package/dist/_chunks/{utils-BF9VwhRy.js → utils-DYtnrtNk.js} +2 -2
  40. package/dist/_chunks/{utils-BF9VwhRy.js.map → utils-DYtnrtNk.js.map} +1 -1
  41. package/dist/ai-elements.es.js +37 -31
  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-DuB5Hh7M.js → Agent-hvrlDtLK.js} +15 -11
  55. package/dist-vue/_chunks/Agent-hvrlDtLK.js.map +1 -0
  56. package/dist-vue/_chunks/{Document-BJxoQzKV.js → Document-DXSWegFn.js} +2 -2
  57. package/dist-vue/_chunks/{Document-BJxoQzKV.js.map → Document-DXSWegFn.js.map} +1 -1
  58. package/dist-vue/_chunks/{PkChatbot-CXW3IFfs.js → PkChatbot-BtJsIn4h.js} +8 -8
  59. package/dist-vue/_chunks/{PkChatbot-CXW3IFfs.js.map → PkChatbot-BtJsIn4h.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkChatbotEmptyState-CD6ehXRE.js → PkChatbotEmptyState-BYrTqidA.js} +2 -2
  61. package/dist-vue/_chunks/{PkChatbotEmptyState-CD6ehXRE.js.map → PkChatbotEmptyState-BYrTqidA.js.map} +1 -1
  62. package/dist-vue/_chunks/{PkChatbotInput-2zUenuUE.js → PkChatbotInput-Cwkz19oM.js} +3 -3
  63. package/dist-vue/_chunks/{PkChatbotInput-2zUenuUE.js.map → PkChatbotInput-Cwkz19oM.js.map} +1 -1
  64. package/dist-vue/_chunks/{PkChatbotMessages-DbgmLmbz.js → PkChatbotMessages-Bmrvz0Nv.js} +17 -17
  65. package/dist-vue/_chunks/{PkChatbotMessages-DbgmLmbz.js.map → PkChatbotMessages-Bmrvz0Nv.js.map} +1 -1
  66. package/dist-vue/_chunks/{PkChatbotStepPayload-CkTJ1nFP.js → PkChatbotStepPayload-C4yEGoXA.js} +2 -2
  67. package/dist-vue/_chunks/{PkChatbotStepPayload-CkTJ1nFP.js.map → PkChatbotStepPayload-C4yEGoXA.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkChatbotStepToolDetail-DBi87nYU.js → PkChatbotStepToolDetail-DnGYrFSt.js} +3 -3
  69. package/dist-vue/_chunks/{PkChatbotStepToolDetail-DBi87nYU.js.map → PkChatbotStepToolDetail-DnGYrFSt.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkChatbotSteps-BC2gLvzh.js → PkChatbotSteps-CoP1JyWG.js} +5 -5
  71. package/dist-vue/_chunks/{PkChatbotSteps-BC2gLvzh.js.map → PkChatbotSteps-CoP1JyWG.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkChatbotViewChat-9BKIdCDD.js → PkChatbotViewChat-B14w_WuO.js} +7 -7
  73. package/dist-vue/_chunks/{PkChatbotViewChat-9BKIdCDD.js.map → PkChatbotViewChat-B14w_WuO.js.map} +1 -1
  74. package/dist-vue/_chunks/{PkChatbotViewConversations-BWj_CaXs.js → PkChatbotViewConversations-oYUIHDwb.js} +3 -3
  75. package/dist-vue/_chunks/{PkChatbotViewConversations-BWj_CaXs.js.map → PkChatbotViewConversations-oYUIHDwb.js.map} +1 -1
  76. package/dist-vue/_chunks/{PkChatbotViewFiles-9kcgLUrQ.js → PkChatbotViewFiles-C1ggPJvX.js} +3 -3
  77. package/dist-vue/_chunks/{PkChatbotViewFiles-9kcgLUrQ.js.map → PkChatbotViewFiles-C1ggPJvX.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkChatbotViewProfile-CJR38-Zw.js → PkChatbotViewProfile-BZJ8OZ9h.js} +2 -2
  79. package/dist-vue/_chunks/{PkChatbotViewProfile-CJR38-Zw.js.map → PkChatbotViewProfile-BZJ8OZ9h.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkFilePreview-CmET6sdA.js → PkFilePreview-CTsoIgC0.js} +516 -432
  81. package/dist-vue/_chunks/PkFilePreview-CTsoIgC0.js.map +1 -0
  82. package/dist-vue/_chunks/{PkFilePreviewDialog-CqQBzL5n.js → PkFilePreviewDialog-DbTpN0hb.js} +2 -2
  83. package/dist-vue/_chunks/{PkFilePreviewDialog-CqQBzL5n.js.map → PkFilePreviewDialog-DbTpN0hb.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkStreamingMarkdown-Db4sGE5U.js → PkStreamingMarkdown-BiS7Huii.js} +3 -3
  85. package/dist-vue/_chunks/{PkStreamingMarkdown-Db4sGE5U.js.map → PkStreamingMarkdown-BiS7Huii.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkToolChatFile-CuilyyQV.js → PkToolChatFile-DJouw7ft.js} +3 -3
  87. package/dist-vue/_chunks/{PkToolChatFile-CuilyyQV.js.map → PkToolChatFile-DJouw7ft.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkToolRequestGeolocation-DBjweLxM.js → PkToolRequestGeolocation-Du8b17X9.js} +2 -2
  89. package/dist-vue/_chunks/{PkToolRequestGeolocation-DBjweLxM.js.map → PkToolRequestGeolocation-Du8b17X9.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C3RPmvS9.js → PkToolRequestOAuthConnection-X00hZZJe.js} +2 -2
  91. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C3RPmvS9.js.map → PkToolRequestOAuthConnection-X00hZZJe.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolShowArtifact-BPM1M44f.js → PkToolShowArtifact-BAfGUGM4.js} +2 -2
  93. package/dist-vue/_chunks/{PkToolShowArtifact-BPM1M44f.js.map → PkToolShowArtifact-BAfGUGM4.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolShowContactForm-B3Um_vEc.js → PkToolShowContactForm-BEWOoCVa.js} +2 -2
  95. package/dist-vue/_chunks/{PkToolShowContactForm-B3Um_vEc.js.map → PkToolShowContactForm-BEWOoCVa.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkToolShowDiagram-BDyGph2_.js → PkToolShowDiagram-CgOAGQCq.js} +2 -2
  97. package/dist-vue/_chunks/{PkToolShowDiagram-BDyGph2_.js.map → PkToolShowDiagram-CgOAGQCq.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowForm-D14J_UP1.js → PkToolShowForm-BXpPnVzJ.js} +4 -4
  99. package/dist-vue/_chunks/{PkToolShowForm-D14J_UP1.js.map → PkToolShowForm-BXpPnVzJ.js.map} +1 -1
  100. package/dist-vue/_chunks/{PkToolShowImageGallery-BVrAQqq5.js → PkToolShowImageGallery-DOsnvy1W.js} +2 -2
  101. package/dist-vue/_chunks/{PkToolShowImageGallery-BVrAQqq5.js.map → PkToolShowImageGallery-DOsnvy1W.js.map} +1 -1
  102. package/dist-vue/_chunks/{PkToolShowProductList-DkDNFoIh.js → PkToolShowProductList-Buw-GpNJ.js} +2 -2
  103. package/dist-vue/_chunks/{PkToolShowProductList-DkDNFoIh.js.map → PkToolShowProductList-Buw-GpNJ.js.map} +1 -1
  104. package/dist-vue/_chunks/{PkToolShowSources-BIsZaSr3.js → PkToolShowSources-CPvjMvqB.js} +3 -3
  105. package/dist-vue/_chunks/{PkToolShowSources-BIsZaSr3.js.map → PkToolShowSources-CPvjMvqB.js.map} +1 -1
  106. package/dist-vue/_chunks/{PkToolShowSuggestedReply-qbQz8Ia2.js → PkToolShowSuggestedReply-HLFecN53.js} +2 -2
  107. package/dist-vue/_chunks/{PkToolShowSuggestedReply-qbQz8Ia2.js.map → PkToolShowSuggestedReply-HLFecN53.js.map} +1 -1
  108. package/dist-vue/_chunks/{PkToolShowVideo-BursN2E9.js → PkToolShowVideo-DPZtAuLl.js} +2 -2
  109. package/dist-vue/_chunks/{PkToolShowVideo-BursN2E9.js.map → PkToolShowVideo-DPZtAuLl.js.map} +1 -1
  110. package/dist-vue/_chunks/{PkToolShowWebPages-C2QqzOZx.js → PkToolShowWebPages-DXjDxztJ.js} +2 -2
  111. package/dist-vue/_chunks/{PkToolShowWebPages-C2QqzOZx.js.map → PkToolShowWebPages-DXjDxztJ.js.map} +1 -1
  112. package/dist-vue/_chunks/{createChatbotApiClient-CWQKS07V.js → createChatbotApiClient-CWLca1yc.js} +2 -2
  113. package/dist-vue/_chunks/{createChatbotApiClient-CWQKS07V.js.map → createChatbotApiClient-CWLca1yc.js.map} +1 -1
  114. package/dist-vue/_chunks/{useChatbotStore-qgCC4aIL.js → useChatbotStore-CNQ8lTub.js} +3 -3
  115. package/dist-vue/_chunks/{useChatbotStore-qgCC4aIL.js.map → useChatbotStore-CNQ8lTub.js.map} +1 -1
  116. package/dist-vue/_chunks/{utils-BcFZVBxd.js → utils-Dqyng-2B.js} +2 -2
  117. package/dist-vue/_chunks/{utils-BcFZVBxd.js.map → utils-Dqyng-2B.js.map} +1 -1
  118. package/dist-vue/api.js +1 -1
  119. package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +4 -4
  120. package/dist-vue/composables.js +10 -10
  121. package/dist-vue/composables.js.map +1 -1
  122. package/dist-vue/index.js +2915 -2895
  123. package/dist-vue/index.js.map +1 -1
  124. package/dist-vue/locales.js +6 -6
  125. package/dist-vue/packages/components/src/chat/PkAgentSelectionActionsSettings.d.ts +6 -0
  126. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +42 -2
  127. package/dist-vue/packages/composable/src/useSettledSelection.d.ts +13 -4
  128. package/dist-vue/packages/models/src/schema/Agent.d.ts +1 -1
  129. package/dist-vue/packages/models/src/schema/SelectionAction.d.ts +5 -2
  130. package/dist-vue/style.css +1 -1
  131. package/package.json +1 -1
  132. package/dist/_chunks/Agent-CnCu6gNx.js.map +0 -1
  133. package/dist/_chunks/PkFilePreview-Ctp30WJH.js.map +0 -1
  134. package/dist/_chunks/PkSelectionActions-BOuC5Dvy.js.map +0 -1
  135. package/dist-vue/_chunks/Agent-DuB5Hh7M.js.map +0 -1
  136. package/dist-vue/_chunks/PkFilePreview-CmET6sdA.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { J as e, N as t, S as n, _ as r, k as i, tt as a, w as o, z as s } from "./vue.runtime.esm-bundler-C2U5uTqB.js";
2
2
  import { d as c } from "./index.es-D-aOuzzp.js";
3
3
  import { t as l } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
4
- import { t as u } from "./PkFilePreview-Ctp30WJH.js";
4
+ import { t as u } from "./PkFilePreview-Bic0SA47.js";
5
5
  // ../../packages/components/src/chat/PkFilePreviewDialog.vue?vue&type=script&setup=true&lang.ts
6
6
  i();
7
7
  // ../../packages/components/src/chat/PkFilePreviewDialog.vue
@@ -110,4 +110,4 @@ var d = /*#__PURE__*/ l(/* @__PURE__ */ o({
110
110
  }), [["styles", [".pk-file-preview-dialog:not(.vv-dialog--fullscreen)>article{width:min(90rem,94dvw);height:92dvh}.pk-file-preview-dialog.vv-dialog--fullscreen>article{max-height:none}.pk-file-preview-dialog .vv-dialog__content{flex-direction:column;flex:1;min-height:0;padding:0;display:flex}"]]]);
111
111
  export { d as default };
112
112
 
113
- //# sourceMappingURL=PkFilePreviewDialog-B8JKpCXy.js.map
113
+ //# sourceMappingURL=PkFilePreviewDialog-WKJ0Zm3O.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PkFilePreviewDialog-B8JKpCXy.js","names":["_useModel","__unplugin_components_0","_openBlock","_createBlock","_withCtx","_createVNode","PkFilePreview","_sfc_main","_style_0","useModel","mergeModels","createVNode","createBlock","init_runtime_core_esm_bundler","withCtx","defineComponent","openBlock","nu","_plugin_vue_export_helper_default","PkFilePreview_default","PkFilePreviewDialog_default","\"mode\"","\"modeModifiers\"","\"sheet\"","\"sheetModifiers\"","\"zoom\"","\"zoomModifiers\"","\"fit\"","\"fitModifiers\"","__emit","emit","mode","__props","sheet","zoom","fit","_component_VvDialog","_cache","$event","text","pointer","action"],"sources":["../../../../packages/components/src/chat/PkFilePreviewDialog.vue","../../../../packages/components/src/chat/PkFilePreviewDialog.vue","../../../../packages/components/src/chat/PkFilePreviewDialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import type {\n ChatFilePreview,\n FilePointer,\n SelectionGroupCapability,\n } from 'models'\n import PkFilePreview from './PkFilePreview.vue'\n import type { ChatFilePreviewChanges } from './previewChanges'\n import type { ChatFilePreviewTarget, WordPreviewMode } from './utils'\n\n /**\n * The viewer of a file stored in a chat in a dialog over the page: the\n * chat's when it has no room for the panel beside it or the reader\n * expands it, the chat log's always. Open while it is mounted: `close`\n * asks the host to drop it. The viewer draws its own head, with the file\n * and the close button, so the dialog has no title and takes its name.\n */\n defineProps<{\n target: ChatFilePreviewTarget\n /** The authenticated download URL of the same version. */\n downloadUrl: string\n preview?: ChatFilePreview\n /** What the version changed from the one shown before, for a moment. */\n changes?: ChatFilePreviewChanges\n loading?: boolean\n error?: boolean\n /** Covers the screen, for a phone. */\n fullscreen?: boolean\n /** The versions of the file in the conversation, from 1. */\n versions?: number[]\n /** The shown version can be written again as the newest one. */\n restorable?: boolean\n /** Offers to go back to the panel beside the chat. */\n resize?: 'shrink'\n /** The selection bar's actions for this format: absent in the chat logs. */\n selectionActions?: SelectionGroupCapability\n }>()\n\n const emit = defineEmits<{\n close: []\n version: [version: number]\n restore: []\n resize: []\n selectionSend: [\n text: string,\n pointer: FilePointer,\n action: { id: string; size: number },\n ]\n }>()\n\n // How the file is shown, kept by the host across panel and dialog\n const mode = defineModel<WordPreviewMode>('mode')\n const sheet = defineModel<number>('sheet')\n const zoom = defineModel<number>('zoom')\n // A boolean prop left out is false, not the viewer's default: the chat\n // logs keep no zoom, and their pages opened at 100% instead of fitted\n const fit = defineModel<boolean>('fit', { default: true })\n</script>\n\n<template>\n <VvDialog\n :model-value=\"true\"\n :aria-label=\"target.filename\"\n :modifiers=\"fullscreen ? 'fullscreen' : undefined\"\n class=\"pk-file-preview-dialog\"\n @update:model-value=\"!$event && emit('close')\">\n <PkFilePreview\n v-model:mode=\"mode\"\n v-model:sheet=\"sheet\"\n v-model:zoom=\"zoom\"\n v-model:fit=\"fit\"\n :kind=\"target.kind\"\n :filename=\"target.filename\"\n :version=\"target.version\"\n :versions\n :download-url\n :preview\n :changes\n :loading\n :error\n :restorable\n :resize\n :file-id=\"target.fileId\"\n :stored-file-name=\"target.storedFileName\"\n :selection-actions\n @version=\"emit('version', $event)\"\n @restore=\"emit('restore')\"\n @resize=\"emit('resize')\"\n @selection-send=\"\n (text, pointer, action) =>\n emit('selectionSend', text, pointer, action)\n \"\n @close=\"emit('close')\" />\n </VvDialog>\n</template>\n\n<style lang=\"scss\">\n // Almost the whole window, room for a page of Word and a grid of Excel;\n // the viewer scrolls in its own box, so the content does not pad it.\n .pk-file-preview-dialog {\n &:not(.vv-dialog--fullscreen) > article {\n width: min(90rem, 94dvw);\n height: 92dvh;\n }\n\n // The library writes `max-height: auto`, which is no value: the\n // wrapper kept its 90dvh and the phone saw the chat around it\n &.vv-dialog--fullscreen > article {\n max-height: none;\n }\n\n .vv-dialog__content {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n padding: 0;\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import type {\n ChatFilePreview,\n FilePointer,\n SelectionGroupCapability,\n } from 'models'\n import PkFilePreview from './PkFilePreview.vue'\n import type { ChatFilePreviewChanges } from './previewChanges'\n import type { ChatFilePreviewTarget, WordPreviewMode } from './utils'\n\n /**\n * The viewer of a file stored in a chat in a dialog over the page: the\n * chat's when it has no room for the panel beside it or the reader\n * expands it, the chat log's always. Open while it is mounted: `close`\n * asks the host to drop it. The viewer draws its own head, with the file\n * and the close button, so the dialog has no title and takes its name.\n */\n defineProps<{\n target: ChatFilePreviewTarget\n /** The authenticated download URL of the same version. */\n downloadUrl: string\n preview?: ChatFilePreview\n /** What the version changed from the one shown before, for a moment. */\n changes?: ChatFilePreviewChanges\n loading?: boolean\n error?: boolean\n /** Covers the screen, for a phone. */\n fullscreen?: boolean\n /** The versions of the file in the conversation, from 1. */\n versions?: number[]\n /** The shown version can be written again as the newest one. */\n restorable?: boolean\n /** Offers to go back to the panel beside the chat. */\n resize?: 'shrink'\n /** The selection bar's actions for this format: absent in the chat logs. */\n selectionActions?: SelectionGroupCapability\n }>()\n\n const emit = defineEmits<{\n close: []\n version: [version: number]\n restore: []\n resize: []\n selectionSend: [\n text: string,\n pointer: FilePointer,\n action: { id: string; size: number },\n ]\n }>()\n\n // How the file is shown, kept by the host across panel and dialog\n const mode = defineModel<WordPreviewMode>('mode')\n const sheet = defineModel<number>('sheet')\n const zoom = defineModel<number>('zoom')\n // A boolean prop left out is false, not the viewer's default: the chat\n // logs keep no zoom, and their pages opened at 100% instead of fitted\n const fit = defineModel<boolean>('fit', { default: true })\n</script>\n\n<template>\n <VvDialog\n :model-value=\"true\"\n :aria-label=\"target.filename\"\n :modifiers=\"fullscreen ? 'fullscreen' : undefined\"\n class=\"pk-file-preview-dialog\"\n @update:model-value=\"!$event && emit('close')\">\n <PkFilePreview\n v-model:mode=\"mode\"\n v-model:sheet=\"sheet\"\n v-model:zoom=\"zoom\"\n v-model:fit=\"fit\"\n :kind=\"target.kind\"\n :filename=\"target.filename\"\n :version=\"target.version\"\n :versions\n :download-url\n :preview\n :changes\n :loading\n :error\n :restorable\n :resize\n :file-id=\"target.fileId\"\n :stored-file-name=\"target.storedFileName\"\n :selection-actions\n @version=\"emit('version', $event)\"\n @restore=\"emit('restore')\"\n @resize=\"emit('resize')\"\n @selection-send=\"\n (text, pointer, action) =>\n emit('selectionSend', text, pointer, action)\n \"\n @close=\"emit('close')\" />\n </VvDialog>\n</template>\n\n<style lang=\"scss\">\n // Almost the whole window, room for a page of Word and a grid of Excel;\n // the viewer scrolls in its own box, so the content does not pad it.\n .pk-file-preview-dialog {\n &:not(.vv-dialog--fullscreen) > article {\n width: min(90rem, 94dvw);\n height: 92dvh;\n }\n\n // The library writes `max-height: auto`, which is no value: the\n // wrapper kept its 90dvh and the phone saw the chat around it\n &.vv-dialog--fullscreen > article {\n max-height: none;\n }\n\n .vv-dialog__content {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n padding: 0;\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import type {\n ChatFilePreview,\n FilePointer,\n SelectionGroupCapability,\n } from 'models'\n import PkFilePreview from './PkFilePreview.vue'\n import type { ChatFilePreviewChanges } from './previewChanges'\n import type { ChatFilePreviewTarget, WordPreviewMode } from './utils'\n\n /**\n * The viewer of a file stored in a chat in a dialog over the page: the\n * chat's when it has no room for the panel beside it or the reader\n * expands it, the chat log's always. Open while it is mounted: `close`\n * asks the host to drop it. The viewer draws its own head, with the file\n * and the close button, so the dialog has no title and takes its name.\n */\n defineProps<{\n target: ChatFilePreviewTarget\n /** The authenticated download URL of the same version. */\n downloadUrl: string\n preview?: ChatFilePreview\n /** What the version changed from the one shown before, for a moment. */\n changes?: ChatFilePreviewChanges\n loading?: boolean\n error?: boolean\n /** Covers the screen, for a phone. */\n fullscreen?: boolean\n /** The versions of the file in the conversation, from 1. */\n versions?: number[]\n /** The shown version can be written again as the newest one. */\n restorable?: boolean\n /** Offers to go back to the panel beside the chat. */\n resize?: 'shrink'\n /** The selection bar's actions for this format: absent in the chat logs. */\n selectionActions?: SelectionGroupCapability\n }>()\n\n const emit = defineEmits<{\n close: []\n version: [version: number]\n restore: []\n resize: []\n selectionSend: [\n text: string,\n pointer: FilePointer,\n action: { id: string; size: number },\n ]\n }>()\n\n // How the file is shown, kept by the host across panel and dialog\n const mode = defineModel<WordPreviewMode>('mode')\n const sheet = defineModel<number>('sheet')\n const zoom = defineModel<number>('zoom')\n // A boolean prop left out is false, not the viewer's default: the chat\n // logs keep no zoom, and their pages opened at 100% instead of fitted\n const fit = defineModel<boolean>('fit', { default: true })\n</script>\n\n<template>\n <VvDialog\n :model-value=\"true\"\n :aria-label=\"target.filename\"\n :modifiers=\"fullscreen ? 'fullscreen' : undefined\"\n class=\"pk-file-preview-dialog\"\n @update:model-value=\"!$event && emit('close')\">\n <PkFilePreview\n v-model:mode=\"mode\"\n v-model:sheet=\"sheet\"\n v-model:zoom=\"zoom\"\n v-model:fit=\"fit\"\n :kind=\"target.kind\"\n :filename=\"target.filename\"\n :version=\"target.version\"\n :versions\n :download-url\n :preview\n :changes\n :loading\n :error\n :restorable\n :resize\n :file-id=\"target.fileId\"\n :stored-file-name=\"target.storedFileName\"\n :selection-actions\n @version=\"emit('version', $event)\"\n @restore=\"emit('restore')\"\n @resize=\"emit('resize')\"\n @selection-send=\"\n (text, pointer, action) =>\n emit('selectionSend', text, pointer, action)\n \"\n @close=\"emit('close')\" />\n </VvDialog>\n</template>\n\n<style lang=\"scss\">\n // Almost the whole window, room for a page of Word and a grid of Excel;\n // the viewer scrolls in its own box, so the content does not pad it.\n .pk-file-preview-dialog {\n &:not(.vv-dialog--fullscreen) > article {\n width: min(90rem, 94dvw);\n height: 92dvh;\n }\n\n // The library writes `max-height: auto`, which is no value: the\n // wrapper kept its 90dvh and the phone saw the chat around it\n &.vv-dialog--fullscreen > article {\n max-height: none;\n }\n\n .vv-dialog__content {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n padding: 0;\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCI,IAAM8B,IAAOD,GAaPE,IAAO/B,EAA4BgC,GAAC,MAAM,GAC1CC,IAAQjC,EAAmBgC,GAAC,OAAO,GACnCE,IAAOlC,EAAmBgC,GAAC,MAAM,GAGjCG,IAAMnC,EAAoBgC,GAAC,KAAwB;;;GAIzD,OAAA9B,EAAA,GAAAC,EAiCWiC,GAAA;IAhCN,eAAa;IACb,cAAYJ,EAAA,OAAO;IACnB,WAAWA,EAAA,aAAU,eAAkB,KAAA;IACxC,OAAM;IACL,uBAAkB,AAAAK,EAAA,QAAA,MAAA,CAAGC,KAAUR,EAAI,OAAA;;IACpC,SAAA1B,QA0B6B,CA1B7BC,EA0B6BC,GAAA;KAzBjB,MAAMyB,EAAA;KAAA,iBAAA,AAAAM,EAAA,QAAA,MAAA,EAAI,QAAAC;KACV,OAAOL,EAAA;KAAA,kBAAA,AAAAI,EAAA,QAAA,MAAA,EAAK,QAAAC;KACZ,MAAMJ,EAAA;KAAA,iBAAA,AAAAG,EAAA,QAAA,MAAA,EAAI,QAAAC;KACV,KAAKH,EAAA;KAAA,gBAAA,AAAAE,EAAA,QAAA,MAAA,EAAG,QAAAC;KACf,MAAMN,EAAA,OAAO;KACb,UAAUA,EAAA,OAAO;KACjB,SAASA,EAAA,OAAO;KAChB,UAAAA,EAAA;KACA,gBAAAA,EAAA;KACA,SAAAA,EAAA;KACA,SAAAA,EAAA;KACA,SAAAA,EAAA;KACA,OAAAA,EAAA;KACA,YAAAA,EAAA;KACA,QAAAA,EAAA;KACA,WAASA,EAAA,OAAO;KAChB,oBAAkBA,EAAA,OAAO;KACzB,qBAAAA,EAAA;KACA,WAAO,AAAAK,EAAA,QAAA,MAAEP,EAAI,WAAYQ,CAAM;KAC/B,WAAO,AAAAD,EAAA,QAAA,MAAEP,EAAI,SAAA;KACb,UAAM,AAAAO,EAAA,QAAA,MAAEP,EAAI,QAAA;KACZ,iBAAc,AAAAO,EAAA,QAAoB,GAAM,GAAS,MAA+BP,EAAI,iBAAkBS,GAAMC,GAASC,CAAM;KAI3H,SAAK,AAAAJ,EAAA,QAAA,MAAEP,EAAI,OAAA"}
1
+ {"version":3,"file":"PkFilePreviewDialog-WKJ0Zm3O.js","names":["_useModel","__unplugin_components_0","_openBlock","_createBlock","_withCtx","_createVNode","PkFilePreview","_sfc_main","_style_0","useModel","mergeModels","createVNode","createBlock","init_runtime_core_esm_bundler","withCtx","defineComponent","openBlock","nu","_plugin_vue_export_helper_default","PkFilePreview_default","PkFilePreviewDialog_default","\"mode\"","\"modeModifiers\"","\"sheet\"","\"sheetModifiers\"","\"zoom\"","\"zoomModifiers\"","\"fit\"","\"fitModifiers\"","__emit","emit","mode","__props","sheet","zoom","fit","_component_VvDialog","_cache","$event","text","pointer","action"],"sources":["../../../../packages/components/src/chat/PkFilePreviewDialog.vue","../../../../packages/components/src/chat/PkFilePreviewDialog.vue","../../../../packages/components/src/chat/PkFilePreviewDialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import type {\n ChatFilePreview,\n FilePointer,\n SelectionGroupCapability,\n } from 'models'\n import PkFilePreview from './PkFilePreview.vue'\n import type { ChatFilePreviewChanges } from './previewChanges'\n import type { ChatFilePreviewTarget, WordPreviewMode } from './utils'\n\n /**\n * The viewer of a file stored in a chat in a dialog over the page: the\n * chat's when it has no room for the panel beside it or the reader\n * expands it, the chat log's always. Open while it is mounted: `close`\n * asks the host to drop it. The viewer draws its own head, with the file\n * and the close button, so the dialog has no title and takes its name.\n */\n defineProps<{\n target: ChatFilePreviewTarget\n /** The authenticated download URL of the same version. */\n downloadUrl: string\n preview?: ChatFilePreview\n /** What the version changed from the one shown before, for a moment. */\n changes?: ChatFilePreviewChanges\n loading?: boolean\n error?: boolean\n /** Covers the screen, for a phone. */\n fullscreen?: boolean\n /** The versions of the file in the conversation, from 1. */\n versions?: number[]\n /** The shown version can be written again as the newest one. */\n restorable?: boolean\n /** Offers to go back to the panel beside the chat. */\n resize?: 'shrink'\n /** The selection bar's actions for this format: absent in the chat logs. */\n selectionActions?: SelectionGroupCapability\n }>()\n\n const emit = defineEmits<{\n close: []\n version: [version: number]\n restore: []\n resize: []\n selectionSend: [\n text: string,\n pointer: FilePointer,\n action: { id: string; size: number },\n ]\n }>()\n\n // How the file is shown, kept by the host across panel and dialog\n const mode = defineModel<WordPreviewMode>('mode')\n const sheet = defineModel<number>('sheet')\n const zoom = defineModel<number>('zoom')\n // A boolean prop left out is false, not the viewer's default: the chat\n // logs keep no zoom, and their pages opened at 100% instead of fitted\n const fit = defineModel<boolean>('fit', { default: true })\n</script>\n\n<template>\n <VvDialog\n :model-value=\"true\"\n :aria-label=\"target.filename\"\n :modifiers=\"fullscreen ? 'fullscreen' : undefined\"\n class=\"pk-file-preview-dialog\"\n @update:model-value=\"!$event && emit('close')\">\n <PkFilePreview\n v-model:mode=\"mode\"\n v-model:sheet=\"sheet\"\n v-model:zoom=\"zoom\"\n v-model:fit=\"fit\"\n :kind=\"target.kind\"\n :filename=\"target.filename\"\n :version=\"target.version\"\n :versions\n :download-url\n :preview\n :changes\n :loading\n :error\n :restorable\n :resize\n :file-id=\"target.fileId\"\n :stored-file-name=\"target.storedFileName\"\n :selection-actions\n @version=\"emit('version', $event)\"\n @restore=\"emit('restore')\"\n @resize=\"emit('resize')\"\n @selection-send=\"\n (text, pointer, action) =>\n emit('selectionSend', text, pointer, action)\n \"\n @close=\"emit('close')\" />\n </VvDialog>\n</template>\n\n<style lang=\"scss\">\n // Almost the whole window, room for a page of Word and a grid of Excel;\n // the viewer scrolls in its own box, so the content does not pad it.\n .pk-file-preview-dialog {\n &:not(.vv-dialog--fullscreen) > article {\n width: min(90rem, 94dvw);\n height: 92dvh;\n }\n\n // The library writes `max-height: auto`, which is no value: the\n // wrapper kept its 90dvh and the phone saw the chat around it\n &.vv-dialog--fullscreen > article {\n max-height: none;\n }\n\n .vv-dialog__content {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n padding: 0;\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import type {\n ChatFilePreview,\n FilePointer,\n SelectionGroupCapability,\n } from 'models'\n import PkFilePreview from './PkFilePreview.vue'\n import type { ChatFilePreviewChanges } from './previewChanges'\n import type { ChatFilePreviewTarget, WordPreviewMode } from './utils'\n\n /**\n * The viewer of a file stored in a chat in a dialog over the page: the\n * chat's when it has no room for the panel beside it or the reader\n * expands it, the chat log's always. Open while it is mounted: `close`\n * asks the host to drop it. The viewer draws its own head, with the file\n * and the close button, so the dialog has no title and takes its name.\n */\n defineProps<{\n target: ChatFilePreviewTarget\n /** The authenticated download URL of the same version. */\n downloadUrl: string\n preview?: ChatFilePreview\n /** What the version changed from the one shown before, for a moment. */\n changes?: ChatFilePreviewChanges\n loading?: boolean\n error?: boolean\n /** Covers the screen, for a phone. */\n fullscreen?: boolean\n /** The versions of the file in the conversation, from 1. */\n versions?: number[]\n /** The shown version can be written again as the newest one. */\n restorable?: boolean\n /** Offers to go back to the panel beside the chat. */\n resize?: 'shrink'\n /** The selection bar's actions for this format: absent in the chat logs. */\n selectionActions?: SelectionGroupCapability\n }>()\n\n const emit = defineEmits<{\n close: []\n version: [version: number]\n restore: []\n resize: []\n selectionSend: [\n text: string,\n pointer: FilePointer,\n action: { id: string; size: number },\n ]\n }>()\n\n // How the file is shown, kept by the host across panel and dialog\n const mode = defineModel<WordPreviewMode>('mode')\n const sheet = defineModel<number>('sheet')\n const zoom = defineModel<number>('zoom')\n // A boolean prop left out is false, not the viewer's default: the chat\n // logs keep no zoom, and their pages opened at 100% instead of fitted\n const fit = defineModel<boolean>('fit', { default: true })\n</script>\n\n<template>\n <VvDialog\n :model-value=\"true\"\n :aria-label=\"target.filename\"\n :modifiers=\"fullscreen ? 'fullscreen' : undefined\"\n class=\"pk-file-preview-dialog\"\n @update:model-value=\"!$event && emit('close')\">\n <PkFilePreview\n v-model:mode=\"mode\"\n v-model:sheet=\"sheet\"\n v-model:zoom=\"zoom\"\n v-model:fit=\"fit\"\n :kind=\"target.kind\"\n :filename=\"target.filename\"\n :version=\"target.version\"\n :versions\n :download-url\n :preview\n :changes\n :loading\n :error\n :restorable\n :resize\n :file-id=\"target.fileId\"\n :stored-file-name=\"target.storedFileName\"\n :selection-actions\n @version=\"emit('version', $event)\"\n @restore=\"emit('restore')\"\n @resize=\"emit('resize')\"\n @selection-send=\"\n (text, pointer, action) =>\n emit('selectionSend', text, pointer, action)\n \"\n @close=\"emit('close')\" />\n </VvDialog>\n</template>\n\n<style lang=\"scss\">\n // Almost the whole window, room for a page of Word and a grid of Excel;\n // the viewer scrolls in its own box, so the content does not pad it.\n .pk-file-preview-dialog {\n &:not(.vv-dialog--fullscreen) > article {\n width: min(90rem, 94dvw);\n height: 92dvh;\n }\n\n // The library writes `max-height: auto`, which is no value: the\n // wrapper kept its 90dvh and the phone saw the chat around it\n &.vv-dialog--fullscreen > article {\n max-height: none;\n }\n\n .vv-dialog__content {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n padding: 0;\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import type {\n ChatFilePreview,\n FilePointer,\n SelectionGroupCapability,\n } from 'models'\n import PkFilePreview from './PkFilePreview.vue'\n import type { ChatFilePreviewChanges } from './previewChanges'\n import type { ChatFilePreviewTarget, WordPreviewMode } from './utils'\n\n /**\n * The viewer of a file stored in a chat in a dialog over the page: the\n * chat's when it has no room for the panel beside it or the reader\n * expands it, the chat log's always. Open while it is mounted: `close`\n * asks the host to drop it. The viewer draws its own head, with the file\n * and the close button, so the dialog has no title and takes its name.\n */\n defineProps<{\n target: ChatFilePreviewTarget\n /** The authenticated download URL of the same version. */\n downloadUrl: string\n preview?: ChatFilePreview\n /** What the version changed from the one shown before, for a moment. */\n changes?: ChatFilePreviewChanges\n loading?: boolean\n error?: boolean\n /** Covers the screen, for a phone. */\n fullscreen?: boolean\n /** The versions of the file in the conversation, from 1. */\n versions?: number[]\n /** The shown version can be written again as the newest one. */\n restorable?: boolean\n /** Offers to go back to the panel beside the chat. */\n resize?: 'shrink'\n /** The selection bar's actions for this format: absent in the chat logs. */\n selectionActions?: SelectionGroupCapability\n }>()\n\n const emit = defineEmits<{\n close: []\n version: [version: number]\n restore: []\n resize: []\n selectionSend: [\n text: string,\n pointer: FilePointer,\n action: { id: string; size: number },\n ]\n }>()\n\n // How the file is shown, kept by the host across panel and dialog\n const mode = defineModel<WordPreviewMode>('mode')\n const sheet = defineModel<number>('sheet')\n const zoom = defineModel<number>('zoom')\n // A boolean prop left out is false, not the viewer's default: the chat\n // logs keep no zoom, and their pages opened at 100% instead of fitted\n const fit = defineModel<boolean>('fit', { default: true })\n</script>\n\n<template>\n <VvDialog\n :model-value=\"true\"\n :aria-label=\"target.filename\"\n :modifiers=\"fullscreen ? 'fullscreen' : undefined\"\n class=\"pk-file-preview-dialog\"\n @update:model-value=\"!$event && emit('close')\">\n <PkFilePreview\n v-model:mode=\"mode\"\n v-model:sheet=\"sheet\"\n v-model:zoom=\"zoom\"\n v-model:fit=\"fit\"\n :kind=\"target.kind\"\n :filename=\"target.filename\"\n :version=\"target.version\"\n :versions\n :download-url\n :preview\n :changes\n :loading\n :error\n :restorable\n :resize\n :file-id=\"target.fileId\"\n :stored-file-name=\"target.storedFileName\"\n :selection-actions\n @version=\"emit('version', $event)\"\n @restore=\"emit('restore')\"\n @resize=\"emit('resize')\"\n @selection-send=\"\n (text, pointer, action) =>\n emit('selectionSend', text, pointer, action)\n \"\n @close=\"emit('close')\" />\n </VvDialog>\n</template>\n\n<style lang=\"scss\">\n // Almost the whole window, room for a page of Word and a grid of Excel;\n // the viewer scrolls in its own box, so the content does not pad it.\n .pk-file-preview-dialog {\n &:not(.vv-dialog--fullscreen) > article {\n width: min(90rem, 94dvw);\n height: 92dvh;\n }\n\n // The library writes `max-height: auto`, which is no value: the\n // wrapper kept its 90dvh and the phone saw the chat around it\n &.vv-dialog--fullscreen > article {\n max-height: none;\n }\n\n .vv-dialog__content {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n padding: 0;\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCI,IAAM8B,IAAOD,GAaPE,IAAO/B,EAA4BgC,GAAC,MAAM,GAC1CC,IAAQjC,EAAmBgC,GAAC,OAAO,GACnCE,IAAOlC,EAAmBgC,GAAC,MAAM,GAGjCG,IAAMnC,EAAoBgC,GAAC,KAAwB;;;GAIzD,OAAA9B,EAAA,GAAAC,EAiCWiC,GAAA;IAhCN,eAAa;IACb,cAAYJ,EAAA,OAAO;IACnB,WAAWA,EAAA,aAAU,eAAkB,KAAA;IACxC,OAAM;IACL,uBAAkB,AAAAK,EAAA,QAAA,MAAA,CAAGC,KAAUR,EAAI,OAAA;;IACpC,SAAA1B,QA0B6B,CA1B7BC,EA0B6BC,GAAA;KAzBjB,MAAMyB,EAAA;KAAA,iBAAA,AAAAM,EAAA,QAAA,MAAA,EAAI,QAAAC;KACV,OAAOL,EAAA;KAAA,kBAAA,AAAAI,EAAA,QAAA,MAAA,EAAK,QAAAC;KACZ,MAAMJ,EAAA;KAAA,iBAAA,AAAAG,EAAA,QAAA,MAAA,EAAI,QAAAC;KACV,KAAKH,EAAA;KAAA,gBAAA,AAAAE,EAAA,QAAA,MAAA,EAAG,QAAAC;KACf,MAAMN,EAAA,OAAO;KACb,UAAUA,EAAA,OAAO;KACjB,SAASA,EAAA,OAAO;KAChB,UAAAA,EAAA;KACA,gBAAAA,EAAA;KACA,SAAAA,EAAA;KACA,SAAAA,EAAA;KACA,SAAAA,EAAA;KACA,OAAAA,EAAA;KACA,YAAAA,EAAA;KACA,QAAAA,EAAA;KACA,WAASA,EAAA,OAAO;KAChB,oBAAkBA,EAAA,OAAO;KACzB,qBAAAA,EAAA;KACA,WAAO,AAAAK,EAAA,QAAA,MAAEP,EAAI,WAAYQ,CAAM;KAC/B,WAAO,AAAAD,EAAA,QAAA,MAAEP,EAAI,SAAA;KACb,UAAM,AAAAO,EAAA,QAAA,MAAEP,EAAI,QAAA;KACZ,iBAAc,AAAAO,EAAA,QAAoB,GAAM,GAAS,MAA+BP,EAAI,iBAAkBS,GAAMC,GAASC,CAAM;KAI3H,SAAK,AAAAJ,EAAA,QAAA,MAAEP,EAAI,OAAA"}
@@ -1,13 +1,16 @@
1
1
  import { Et as e, F as t, J as n, N as r, Ot as i, S as a, Tt as o, V as s, X as c, c as l, d as u, f as d, g as f, gt as p, h as m, k as h, kt as g, nt as _, ot as v, pt as y, r as b, u as x, v as S, vt as C, w, wt as T, x as E, y as D, z as O } from "./vue.runtime.esm-bundler-C2U5uTqB.js";
2
2
  import { r as k } from "./vue-i18n-POtLvOl1.js";
3
- import { L as A } from "./utils-BF9VwhRy.js";
3
+ import { L as A } from "./utils-DYtnrtNk.js";
4
4
  import { l as j } from "./dist-D6oUr4J_.js";
5
5
  import { t as M } from "./index.es-D-aOuzzp.js";
6
6
  import { t as N } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
7
7
  // ../../packages/composable/src/useSettledSelection.ts
8
8
  v();
9
- var P = "(hover: hover) and (pointer: fine)";
10
- function F(e) {
9
+ var P = "(hover: hover) and (pointer: fine)", F = "(hover: none) and (pointer: coarse)", I = 400;
10
+ function L() {
11
+ return typeof matchMedia == "function" && matchMedia(F).matches;
12
+ }
13
+ function R(e) {
11
14
  let t = document.getSelection();
12
15
  if (!t || t.rangeCount === 0) return;
13
16
  if (e.nodeType === Node.DOCUMENT_NODE) return t.getRangeAt(0).cloneRange();
@@ -27,13 +30,13 @@ function F(e) {
27
30
  let r = n.getSelection?.();
28
31
  return r && r.rangeCount > 0 ? r.getRangeAt(0).cloneRange() : void 0;
29
32
  }
30
- function I({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2 }) {
31
- let i = C(), a, o = () => {
32
- clearTimeout(a), i.value = void 0;
33
- }, s = () => {
33
+ function z({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2, touch: i = !1 }) {
34
+ let a = C(), o, s = () => {
35
+ clearTimeout(o), a.value = void 0;
36
+ }, c = () => {
34
37
  let n = e();
35
38
  if (!n || !t()) return;
36
- let i = F(n);
39
+ let i = R(n);
37
40
  if (!i || i.collapsed || i.toString().trim().length < r) return;
38
41
  let a = i.getBoundingClientRect();
39
42
  return {
@@ -41,20 +44,20 @@ function I({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2 })
41
44
  start: i.getClientRects()[0] ?? a,
42
45
  box: a
43
46
  };
44
- }, c = () => {
45
- o(), a = setTimeout(() => {
46
- i.value = s();
47
- }, n);
47
+ }, l = typeof document < "u" && typeof matchMedia == "function" && matchMedia(P).matches, u = i && typeof document < "u" && L(), d = u ? Math.max(n, I) : n, f = () => {
48
+ s(), o = setTimeout(() => {
49
+ a.value = c();
50
+ }, d);
48
51
  };
49
- return typeof document < "u" && typeof matchMedia == "function" && matchMedia(P).matches && (document.addEventListener("selectionchange", c), y(() => {
50
- clearTimeout(a), document.removeEventListener("selectionchange", c);
52
+ return (l || u) && (document.addEventListener("selectionchange", f), y(() => {
53
+ clearTimeout(o), document.removeEventListener("selectionchange", f);
51
54
  })), {
52
- selection: i,
53
- clear: o
55
+ selection: a,
56
+ clear: s
54
57
  };
55
58
  }
56
59
  // ../../packages/components/src/chat/previewChanges.ts
57
- var L = 1e6, R = (e, t) => {
60
+ var B = 1e6, V = (e, t) => {
58
61
  let n = 0;
59
62
  for (; n < e.length && n < t.length && e[n] === t[n];) n += 1;
60
63
  let r = 0;
@@ -66,29 +69,29 @@ var L = 1e6, R = (e, t) => {
66
69
  }
67
70
  };
68
71
  if (!a) return o;
69
- if (!i || i * a > L) return s(n, n + i, n, n + a), o;
72
+ if (!i || i * a > B) return s(n, n + i, n, n + a), o;
70
73
  let c = new Uint32Array((i + 1) * (a + 1));
71
74
  for (let r = i - 1; r >= 0; r--) for (let i = a - 1; i >= 0; i--) c[r * (a + 1) + i] = e[n + r] === t[n + i] ? c[(r + 1) * (a + 1) + i + 1] + 1 : Math.max(c[(r + 1) * (a + 1) + i], c[r * (a + 1) + i + 1]);
72
75
  let l = 0, u = 0, d = 0, f = 0;
73
76
  for (; l < i && u < a;) e[n + l] === t[n + u] ? (s(n + d, n + l, n + f, n + u), l += 1, u += 1, d = l, f = u) : c[(l + 1) * (a + 1) + u] >= c[l * (a + 1) + u + 1] ? l += 1 : u += 1;
74
77
  return s(n + d, n + i, n + f, n + a), o;
75
- }, z = (e, t) => e === "id" || e === "ids" ? void 0 : t, B = (e) => JSON.stringify(e, z), V = (e, t) => {
78
+ }, H = (e, t) => e === "id" || e === "ids" ? void 0 : t, U = (e) => JSON.stringify(e, H), W = (e, t) => {
76
79
  let n = (e) => e.flatMap((e) => e.ids ?? []);
77
- return t?.kind === "table" ? [...R(t.rows.map(B), e.rows.map(B))].flatMap(([r, i]) => {
80
+ return t?.kind === "table" ? [...V(t.rows.map(U), e.rows.map(U))].flatMap(([r, i]) => {
78
81
  let a = i === void 0 ? void 0 : t.rows[i];
79
- return n(e.rows[r].filter((e, t) => !a?.[t] || B(a[t]) !== B(e)));
82
+ return n(e.rows[r].filter((e, t) => !a?.[t] || U(a[t]) !== U(e)));
80
83
  }) : n(e.rows.flat());
81
- }, H = (e, t) => {
82
- let n = /* @__PURE__ */ new Set(), r = R(e.blocks.map(B), t.blocks.map(B));
84
+ }, G = (e, t) => {
85
+ let n = /* @__PURE__ */ new Set(), r = V(e.blocks.map(U), t.blocks.map(U));
83
86
  for (let [i, a] of r) {
84
87
  let r = t.blocks[i];
85
88
  if (r.kind === "table") {
86
89
  let t = a === void 0 ? void 0 : e.blocks[a];
87
- for (let e of V(r, t)) n.add(e);
90
+ for (let e of W(r, t)) n.add(e);
88
91
  } else r.id && n.add(r.id);
89
92
  }
90
93
  return n;
91
- }, U = (e, t) => {
94
+ }, K = (e, t) => {
92
95
  let n = /* @__PURE__ */ new Map();
93
96
  for (let r of t.rows) for (let t of r.cells) n.set(`${r.row}:${t.col}`, JSON.stringify({
94
97
  ...t,
@@ -96,31 +99,31 @@ var L = 1e6, R = (e, t) => {
96
99
  numFmt: t.numFmt === void 0 ? void 0 : e.numberFormats?.[t.numFmt]
97
100
  }));
98
101
  return n;
99
- }, W = (e, t) => {
102
+ }, q = (e, t) => {
100
103
  let n = /* @__PURE__ */ new Map();
101
104
  for (let r of t.sheets) {
102
- let i = e.sheets.find((e) => e.name === r.name), a = U(t, r), o = i ? U(e, i) : /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
105
+ let i = e.sheets.find((e) => e.name === r.name), a = K(t, r), o = i ? K(e, i) : /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
103
106
  for (let [e, t] of a) o.get(e) !== t && s.add(e);
104
107
  for (let e of o.keys()) a.has(e) || s.add(e);
105
108
  s.size && n.set(r.name, s);
106
109
  }
107
110
  return n;
108
- }, G = (e, t) => {
111
+ }, J = (e, t) => {
109
112
  if (e.kind === "word" && t.kind === "word") {
110
- let n = H(e, t);
113
+ let n = G(e, t);
111
114
  return n.size ? {
112
115
  kind: "word",
113
116
  paragraphs: n
114
117
  } : void 0;
115
118
  }
116
119
  if (e.kind === "spreadsheet" && t.kind === "spreadsheet") {
117
- let n = W(e, t);
120
+ let n = q(e, t);
118
121
  return n.size ? {
119
122
  kind: "spreadsheet",
120
123
  cells: n
121
124
  } : void 0;
122
125
  }
123
- }, K = (e, t) => {
126
+ }, Y = (e, t) => {
124
127
  let n = e?.querySelector(t);
125
128
  if (!e || !n) return !1;
126
129
  let r = e.getBoundingClientRect(), i = n.getBoundingClientRect();
@@ -128,10 +131,10 @@ var L = 1e6, R = (e, t) => {
128
131
  };
129
132
  // ../../packages/components/src/chat/PkSelectionActions.vue?vue&type=script&setup=true&lang.ts
130
133
  h(), b(), v(), o();
131
- var q = ["onKeydown"], J = ["placeholder", "aria-label"], Y = ["disabled"], X = ["aria-label"], Z = { class: "pk-selection-actions__text" }, Q = {
134
+ var X = ["placeholder", "aria-label"], Z = ["disabled"], Q = ["aria-label"], $ = { class: "pk-selection-actions__text" }, ee = {
132
135
  key: 0,
133
136
  class: "pk-selection-actions__text"
134
- }, $ = ["onClick"], ee = "ri:sparkling-line", te = /*#__PURE__*/ N(/* @__PURE__ */ w({
137
+ }, te = ["onClick", "onTouchend"], ne = "ri:sparkling-line", re = /*#__PURE__*/ N(/* @__PURE__ */ w({
135
138
  __name: "PkSelectionActions",
136
139
  props: /*@__PURE__*/ r({
137
140
  actions: { type: Array },
@@ -177,13 +180,16 @@ var q = ["onKeydown"], J = ["placeholder", "aria-label"], Y = ["disabled"], X =
177
180
  }, R.value = "", b.value = !0, await t(), N.value?.focus();
178
181
  }, B = () => {
179
182
  L.value = void 0, b.value = !1;
180
- }, V = (e) => h[e.id] ?? ee, H = (e) => {
183
+ }, V = () => z(void 0, C("selectionActions.askPlaceholder")), H = (e) => h[e.id] ?? ne, U = (e) => {
181
184
  e.asks ? z(e.id, e.asks) : y("action", e.id);
182
- }, U = () => {
185
+ }, W = (e, t) => {
186
+ let n = e.currentTarget, r = e.changedTouches[0], i = n.getRootNode(), a = r && i.elementFromPoint(r.clientX, r.clientY);
187
+ a && n.contains(a) && t();
188
+ }, G = () => {
183
189
  let e = R.value.trim();
184
190
  e && L.value && (L.value.id ? y("action", L.value.id, e) : y("ask", e), B());
185
- }, W = () => {
186
- L.value ? B() : y("close");
191
+ }, K = (e) => {
192
+ e.isComposing || (e.stopPropagation(), e.preventDefault(), L.value ? B() : y("close"));
187
193
  };
188
194
  return (t, n) => {
189
195
  let o = M;
@@ -196,13 +202,13 @@ var q = ["onKeydown"], J = ["placeholder", "aria-label"], Y = ["disabled"], X =
196
202
  top: `${I.value.top}px`,
197
203
  left: `${I.value.left}px`
198
204
  }),
199
- onKeydown: x(u(W, ["stop"]), ["esc"])
205
+ onKeydown: x(K, ["esc"])
200
206
  }, [L.value ? (O(), D("form", {
201
207
  key: 0,
202
208
  ref_key: "barEl",
203
209
  ref: w,
204
210
  class: "pk-selection-actions__menu pk-selection-actions__menu--field",
205
- onSubmit: u(U, ["prevent"])
211
+ onSubmit: u(G, ["prevent"])
206
212
  }, [_(f("input", {
207
213
  ref_key: "inputEl",
208
214
  ref: N,
@@ -212,53 +218,57 @@ var q = ["onKeydown"], J = ["placeholder", "aria-label"], Y = ["disabled"], X =
212
218
  maxlength: "500",
213
219
  placeholder: L.value.placeholder,
214
220
  "aria-label": L.value.placeholder
215
- }, null, 8, J), [[l, R.value]]), f("button", {
221
+ }, null, 8, X), [[l, R.value]]), f("button", {
216
222
  type: "submit",
217
223
  class: "pk-selection-actions__button pk-selection-actions__button--send",
218
224
  disabled: !R.value.trim()
219
- }, g(T(C)("action.send")), 9, Y)], 544)) : (O(), D("div", {
225
+ }, g(T(C)("action.send")), 9, Z)], 544)) : (O(), D("div", {
220
226
  key: 1,
221
227
  ref_key: "barEl",
222
228
  ref: w,
223
229
  class: "pk-selection-actions__menu",
224
230
  role: "toolbar",
225
231
  "aria-orientation": "vertical",
226
- "aria-label": T(C)("selectionActions.label")
227
- }, [r.note ? (O(), D(d, { key: 0 }, [f("p", Z, g(r.note), 1), r.noteAction ? (O(), D("button", {
232
+ "aria-label": T(C)("selectionActions.label"),
233
+ onTouchstart: n[7] ||= u(() => {}, ["prevent"])
234
+ }, [r.note ? (O(), D(d, { key: 0 }, [f("p", $, g(r.note), 1), r.noteAction ? (O(), D("button", {
228
235
  key: 0,
229
236
  type: "button",
230
237
  class: "pk-selection-actions__button",
231
238
  onMousedown: n[1] ||= u(() => {}, ["prevent"]),
232
- onClick: n[2] ||= (e) => y("note")
239
+ onClick: n[2] ||= (e) => y("note"),
240
+ onTouchend: n[3] ||= (e) => W(e, () => y("note"))
233
241
  }, [a(o, {
234
242
  name: "ri:arrow-right-line",
235
243
  class: "pk-selection-actions__icon"
236
244
  }), E(" " + g(r.noteAction), 1)], 32)) : S("", !0)], 64)) : (O(), D(d, { key: 1 }, [
237
- r.hint ? (O(), D("p", Q, g(r.hint), 1)) : S("", !0),
245
+ r.hint ? (O(), D("p", ee, g(r.hint), 1)) : S("", !0),
238
246
  (O(!0), D(d, null, s(r.actions, (e) => (O(), D("button", {
239
247
  key: e.id,
240
248
  type: "button",
241
249
  class: "pk-selection-actions__button",
242
- onMousedown: n[3] ||= u(() => {}, ["prevent"]),
243
- onClick: (t) => H(e)
250
+ onMousedown: n[4] ||= u(() => {}, ["prevent"]),
251
+ onClick: (t) => U(e),
252
+ onTouchend: (t) => W(t, () => U(e))
244
253
  }, [a(o, {
245
- name: V(e),
254
+ name: H(e),
246
255
  class: "pk-selection-actions__icon"
247
- }, null, 8, ["name"]), E(" " + g(e.label), 1)], 40, $))), 128)),
248
- n[6] ||= f("hr", { class: "pk-selection-actions__rule" }, null, -1),
256
+ }, null, 8, ["name"]), E(" " + g(e.label), 1)], 40, te))), 128)),
257
+ n[8] ||= f("hr", { class: "pk-selection-actions__rule" }, null, -1),
249
258
  f("button", {
250
259
  type: "button",
251
260
  class: "pk-selection-actions__button",
252
- onMousedown: n[4] ||= u(() => {}, ["prevent"]),
253
- onClick: n[5] ||= (e) => z(void 0, T(C)("selectionActions.askPlaceholder"))
261
+ onMousedown: n[5] ||= u(() => {}, ["prevent"]),
262
+ onClick: V,
263
+ onTouchend: n[6] ||= (e) => W(e, V)
254
264
  }, [a(o, {
255
265
  name: "ri:chat-1-line",
256
266
  class: "pk-selection-actions__icon"
257
267
  }), E(" " + g(T(C)("selectionActions.ask")), 1)], 32)
258
- ], 64))], 8, X))], 46, q);
268
+ ], 64))], 40, Q))], 38);
259
269
  };
260
270
  }
261
- }), [["styles", [".pk-selection-actions{z-index:10;max-width:min(20rem, 100% - var(--spacing-16));position:absolute}.pk-selection-actions--fixed{z-index:2147483647;position:fixed}.pk-selection-actions--asking{width:min(var(--spacing-384), 100% - var(--spacing-16));max-width:none}.pk-selection-actions__menu{width:max-content;min-width:11rem;max-width:100%;padding:var(--spacing-4);border:var(--spacing-1) solid var(--color-surface-5);border-radius:var(--rounded-lg);background-color:var(--color-surface);color:var(--color-word-2);font-family:var(--font-sans);font-size:var(--text-12);box-shadow:var(--shadow-lg);flex-direction:column;display:flex}.pk-selection-actions__menu--field{align-items:center;gap:var(--spacing-4);flex-direction:row;width:100%}.pk-selection-actions__text{max-width:16rem;padding:var(--spacing-4) var(--spacing-8) var(--spacing-6);color:var(--color-word-3);font-size:var(--text-12);margin:0}.pk-selection-actions__button{align-items:center;gap:var(--spacing-8);border-radius:var(--rounded);padding:var(--spacing-6) var(--spacing-12) var(--spacing-6) var(--spacing-8);color:inherit;font:inherit;text-align:start;white-space:nowrap;cursor:pointer;background-color:#0000;border:0;flex-shrink:0;display:flex}.pk-selection-actions__button:hover{background-color:var(--color-surface-1);color:var(--color-word-1)}.pk-selection-actions__button:focus-visible{outline:var(--spacing-2) solid var(--color-brand);outline-offset:calc(-1 * var(--spacing-2))}.pk-selection-actions__button--send{padding:var(--spacing-6) var(--spacing-10);background-color:var(--color-word-1);color:var(--color-surface);font-weight:var(--font-medium)}.pk-selection-actions__button--send:hover{background-color:var(--color-word-1);color:var(--color-surface)}.pk-selection-actions__button--send:disabled{opacity:.5;cursor:default}.pk-selection-actions__icon{width:var(--spacing-16);height:var(--spacing-16);color:var(--color-word-3);flex-shrink:0}.pk-selection-actions__rule{margin:var(--spacing-4) 0;border:0;border-top:var(--spacing-1) solid var(--color-surface-3)}.pk-selection-actions__input{border-radius:var(--rounded);min-width:0;padding:var(--spacing-6) var(--spacing-8);background-color:var(--color-surface-1);color:var(--color-word-1);font:inherit;border:0;flex:1}.pk-selection-actions__input::placeholder{color:var(--color-word-3)}.pk-selection-actions__input:focus-visible{outline:var(--spacing-2) solid var(--color-brand);outline-offset:calc(-1 * var(--spacing-2))}"]]]);
262
- export { I as i, G as n, K as r, te as t };
271
+ }), [["styles", [".pk-selection-actions{z-index:10;max-width:min(20rem, 100% - var(--spacing-16));position:absolute}.pk-selection-actions--fixed{z-index:2147483647;position:fixed}.pk-selection-actions--asking{width:min(var(--spacing-384), 100% - var(--spacing-16));max-width:none}.pk-selection-actions__menu{width:max-content;min-width:11rem;max-width:100%;padding:var(--spacing-4);border:var(--spacing-1) solid var(--color-surface-5);border-radius:var(--rounded-lg);background-color:var(--color-surface);color:var(--color-word-2);font-family:var(--font-sans);font-size:var(--text-12);box-shadow:var(--shadow-lg);flex-direction:column;display:flex}.pk-selection-actions__menu--field{align-items:center;gap:var(--spacing-4);flex-direction:row;width:100%}.pk-selection-actions__text{max-width:16rem;padding:var(--spacing-4) var(--spacing-8) var(--spacing-6);color:var(--color-word-3);font-size:var(--text-12);margin:0}.pk-selection-actions__button{align-items:center;gap:var(--spacing-8);border-radius:var(--rounded);padding:var(--spacing-6) var(--spacing-12) var(--spacing-6) var(--spacing-8);color:inherit;font:inherit;text-align:start;white-space:nowrap;cursor:pointer;background-color:#0000;border:0;flex-shrink:0;display:flex}@media (pointer:coarse){.pk-selection-actions__button{min-height:var(--spacing-40)}}.pk-selection-actions__button:hover{background-color:var(--color-surface-1);color:var(--color-word-1)}.pk-selection-actions__button:focus-visible{outline:var(--spacing-2) solid var(--color-brand);outline-offset:calc(-1 * var(--spacing-2))}.pk-selection-actions__button--send{padding:var(--spacing-6) var(--spacing-10);background-color:var(--color-word-1);color:var(--color-surface);font-weight:var(--font-medium)}.pk-selection-actions__button--send:hover{background-color:var(--color-word-1);color:var(--color-surface)}.pk-selection-actions__button--send:disabled{opacity:.5;cursor:default}.pk-selection-actions__icon{width:var(--spacing-16);height:var(--spacing-16);color:var(--color-word-3);flex-shrink:0}.pk-selection-actions__rule{margin:var(--spacing-4) 0;border:0;border-top:var(--spacing-1) solid var(--color-surface-3)}.pk-selection-actions__input{border-radius:var(--rounded);min-width:0;padding:var(--spacing-6) var(--spacing-8);background-color:var(--color-surface-1);color:var(--color-word-1);font:inherit;border:0;flex:1}@media (pointer:coarse){.pk-selection-actions__input{min-height:var(--spacing-40);font-size:var(--text-16)}}.pk-selection-actions__input::placeholder{color:var(--color-word-3)}.pk-selection-actions__input:focus-visible{outline:var(--spacing-2) solid var(--color-brand);outline-offset:calc(-1 * var(--spacing-2))}"]]]);
272
+ export { z as a, L as i, J as n, Y as r, re as t };
263
273
 
264
- //# sourceMappingURL=PkSelectionActions-BOuC5Dvy.js.map
274
+ //# sourceMappingURL=PkSelectionActions-mna8QQGY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PkSelectionActions-mna8QQGY.js","names":["settled","_useModel","__unplugin_components_0","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_withKeys","_withModifiers","_withDirectives","_createElementVNode","_vModelText","_toDisplayString","_unref","_Fragment","_createVNode","_createTextVNode","_createCommentVNode","_renderList","_sfc_main","_style_0","normalizeClass","nextTick","useModel","mergeModels","normalizeStyle","createVNode","init_shared_esm_bundler","renderList","useTemplateRef","vModelText","withModifiers","Fragment","createBaseVNode","ref","computed","init_runtime_core_esm_bundler","toDisplayString","withDirectives","init_reactivity_esm_bundler","onScopeDispose","init_runtime_dom_esm_bundler","withKeys","createCommentVNode","shallowRef","unref","createTextVNode","createElementBlock","openBlock","useI18n","selectionBarPosition","useElementSize","Ce","_plugin_vue_export_helper_default","FINE_POINTER","TOUCH_SCREEN","TOUCH_DELAY","isTouchScreen","rangeIn","selection","root","shadow","ranges","first","range","own","useSettledSelection","timer","clear","read","node","enabled","minChars","box","finePointer","byTouch","touch","wait","delay","onChange","MAX_ALIGNED_PAIRS","unmatchedItems","start","before","after","end","n","m","out","gap","j","j0","j1","i","i0","i1","lengths","withoutIds","key","value","contentOf","changedCellIds","idsOf","cells","c","was","old","cell","wordChanges","paragraphs","blocks","b","block","id","cellContents","sheet","preview","spreadsheetChanges","s","now","changed","at","content","chatFilePreviewChanges","revealFirstChange","el","scroller","selector","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","AGENT_ACTION_ICON","PkSelectionActions_default","defineComponent","\"asking\"","\"askingModifiers\"","__emit","BUILT_IN_ICONS","props","__props","emit","asking","$t","barEl","inputEl","position","width","height","field","text","openField","closeField","openAsk","iconOf","action","run","onTap","row","event","under","act","submit","onEscape","_component_VvIcon","_cache","$event"],"sources":["../../../../packages/composable/src/useSettledSelection.ts","../../../../packages/components/src/chat/previewChanges.ts","../../../../packages/components/src/chat/PkSelectionActions.vue","../../../../packages/components/src/chat/PkSelectionActions.vue","../../../../packages/components/src/chat/PkSelectionActions.vue"],"sourcesContent":["import { onScopeDispose, shallowRef, type ShallowRef } from 'vue'\n\n/** A selection that stayed still: its range and where it is on screen. */\nexport interface SettledSelection {\n range: Range\n /** The box of its first line: a bar goes above the start of a selection. */\n start: DOMRect\n /** The box of the whole selection. */\n box: DOMRect\n}\n\nexport interface UseSettledSelectionOptions {\n /** Where the range is read: the document, or the shadow root the selection is in. */\n root: () => Document | ShadowRoot | null | undefined\n /** Held off while false: the page while the user points, under a modal, during a turn. */\n enabled?: () => boolean\n /** How long the selection stays still before it counts, in ms. */\n delay?: number\n /** The shortest text that counts. */\n minChars?: number\n /**\n * Also on a touch screen, where the bar goes below the selection, away\n * from the system's menu: the chat's file viewer (spec\n * `chat-file-selection-edit.md`, F4). The page leaves a touch selection\n * to the system's menu (spec `selection-actions.md`, F3).\n */\n touch?: boolean\n}\n\n/** A pointer that hovers: on a touch screen the system has its own menu on a selection. */\nconst FINE_POINTER = '(hover: hover) and (pointer: fine)'\n/** A screen read by touch: no hover, a coarse pointer. */\nconst TOUCH_SCREEN = '(hover: none) and (pointer: coarse)'\n/**\n * How long a touch selection stays still before it counts: the finger rests\n * between two moves of a handle, and the bar would flash below it.\n */\nconst TOUCH_DELAY = 400\n\n/** True on a touch screen, where a selection's bar goes below it. */\nexport function isTouchScreen(): boolean {\n return typeof matchMedia === 'function' && matchMedia(TOUCH_SCREEN).matches\n}\n\ntype ComposedSelection = Selection & {\n getComposedRanges?: (\n ...args: [{ shadowRoots: ShadowRoot[] }] | ShadowRoot[]\n ) => StaticRange[]\n}\n\n/**\n * The first range of the selection, read inside `root`, as a copy: the\n * selection's own range is live, and Chrome collapses it as soon as the\n * focus moves into the bar's field. In a shadow root the document's\n * selection stops at its host: the composed range reads past it (Chrome 137,\n * Safari 17, Firefox 142; Safari took the roots as arguments before the\n * options object), and Chromium's own selection of the root is the fallback.\n * Without either nothing is read, and no bar appears.\n */\nfunction rangeIn(root: Document | ShadowRoot): Range | undefined {\n const selection = document.getSelection() as ComposedSelection | null\n if (!selection || selection.rangeCount === 0) {\n return undefined\n }\n if (root.nodeType === Node.DOCUMENT_NODE) {\n return selection.getRangeAt(0).cloneRange()\n }\n const shadow = root as ShadowRoot\n if (selection.getComposedRanges) {\n let ranges: StaticRange[]\n try {\n ranges = selection.getComposedRanges({ shadowRoots: [shadow] })\n } catch {\n ranges = selection.getComposedRanges(shadow)\n }\n const [first] = ranges\n if (!first) {\n return undefined\n }\n const range = document.createRange()\n range.setStart(first.startContainer, first.startOffset)\n range.setEnd(first.endContainer, first.endOffset)\n return range\n }\n const own = (\n shadow as ShadowRoot & { getSelection?: () => Selection | null }\n ).getSelection?.()\n return own && own.rangeCount > 0\n ? own.getRangeAt(0).cloneRange()\n : undefined\n}\n\n/**\n * The selection once it stays still (spec `selection-actions.md`, \"Cosa è\n * comune\"): what the bar of actions appears on, on the page that embeds the\n * widget and in the chat's file viewer. `selectionchange` fires on the\n * document wherever the selection is, so the document is always listened to\n * and `root` only says where the range is read. Nothing on a touch screen\n * unless `touch`. Undefined while the selection moves, is collapsed or\n * shorter than `minChars`; each reader then checks that the range is its own.\n */\nexport function useSettledSelection({\n root,\n enabled = () => true,\n delay = 150,\n minChars = 2,\n touch = false,\n}: UseSettledSelectionOptions) {\n const selection = shallowRef<SettledSelection | undefined>()\n let timer: ReturnType<typeof setTimeout> | undefined\n\n const clear = () => {\n clearTimeout(timer)\n selection.value = undefined\n }\n\n const read = (): SettledSelection | undefined => {\n const node = root()\n if (!node || !enabled()) {\n return undefined\n }\n const range = rangeIn(node)\n if (\n !range ||\n range.collapsed ||\n range.toString().trim().length < minChars\n ) {\n return undefined\n }\n const box = range.getBoundingClientRect()\n return { range, start: range.getClientRects()[0] ?? box, box }\n }\n\n const finePointer =\n typeof document !== 'undefined' &&\n typeof matchMedia === 'function' &&\n matchMedia(FINE_POINTER).matches\n const byTouch = touch && typeof document !== 'undefined' && isTouchScreen()\n const wait = byTouch ? Math.max(delay, TOUCH_DELAY) : delay\n\n const onChange = () => {\n clear()\n timer = setTimeout(() => {\n selection.value = read()\n }, wait)\n }\n\n if (finePointer || byTouch) {\n document.addEventListener('selectionchange', onChange)\n onScopeDispose(() => {\n clearTimeout(timer)\n document.removeEventListener('selectionchange', onChange)\n })\n }\n\n // Not `readonly()`: its deep proxy around a Range breaks the Range's methods\n const settled: Readonly<ShallowRef<SettledSelection | undefined>> =\n selection\n return { selection: settled, clear }\n}\n","import type {\n ChatFilePreview,\n SpreadsheetPreview,\n SpreadsheetPreviewSheet,\n WordPreview,\n WordPreviewBlock,\n WordPreviewCell,\n} from 'models'\n\n/**\n * What a version of a file changed from the one the viewer showed before it\n * (spec `chat-file-selection-edit.md`): the paragraphs of a Word document by\n * their ids in the new version, or the cells of each sheet, by its name, as\n * `row:col`. The viewer marks them for a moment when it follows an edit.\n */\nexport type ChatFilePreviewChanges =\n | { kind: 'word'; paragraphs: ReadonlySet<string> }\n | {\n kind: 'spreadsheet'\n cells: ReadonlyMap<string, ReadonlySet<string>>\n }\n\n/**\n * Past this many pairs the middle of the two lists is not aligned: all of\n * the new one there counts as changed. A thousand paragraphs each side.\n */\nconst MAX_ALIGNED_PAIRS = 1_000_000\n\n/**\n * The items of `after` that `before` does not hold in the same order, each\n * with the item of `before` it took the place of, if any: the one at the\n * same distance from the start of the stretch both lists differ in. The\n * common start and end are skipped, the middle is aligned by its longest\n * common subsequence.\n */\nexport const unmatchedItems = (\n before: readonly string[],\n after: readonly string[],\n): Map<number, number | undefined> => {\n let start = 0\n while (\n start < before.length &&\n start < after.length &&\n before[start] === after[start]\n ) {\n start += 1\n }\n let end = 0\n while (\n end < before.length - start &&\n end < after.length - start &&\n before[before.length - 1 - end] === after[after.length - 1 - end]\n ) {\n end += 1\n }\n const n = before.length - start - end\n const m = after.length - start - end\n const out = new Map<number, number | undefined>()\n // Each stretch between two kept items: its new items stand for its old\n // ones in order\n const gap = (i0: number, i1: number, j0: number, j1: number) => {\n for (let j = j0; j < j1; j++) {\n const i = i0 + (j - j0)\n out.set(j, i < i1 ? i : undefined)\n }\n }\n if (!m) {\n return out\n }\n if (!n || n * m > MAX_ALIGNED_PAIRS) {\n gap(start, start + n, start, start + m)\n return out\n }\n // lengths[i * (m + 1) + j]: the longest common subsequence of the old\n // middle from i and the new one from j\n const lengths = new Uint32Array((n + 1) * (m + 1))\n for (let i = n - 1; i >= 0; i--) {\n for (let j = m - 1; j >= 0; j--) {\n lengths[i * (m + 1) + j] =\n before[start + i] === after[start + j]\n ? lengths[(i + 1) * (m + 1) + j + 1] + 1\n : Math.max(\n lengths[(i + 1) * (m + 1) + j],\n lengths[i * (m + 1) + j + 1],\n )\n }\n }\n let i = 0\n let j = 0\n let i0 = 0\n let j0 = 0\n while (i < n && j < m) {\n if (before[start + i] === after[start + j]) {\n gap(start + i0, start + i, start + j0, start + j)\n i += 1\n j += 1\n i0 = i\n j0 = j\n } else if (\n lengths[(i + 1) * (m + 1) + j] >= lengths[i * (m + 1) + j + 1]\n ) {\n i += 1\n } else {\n j += 1\n }\n }\n gap(start + i0, start + n, start + j0, start + m)\n return out\n}\n\n/** A paragraph's id moves when one is added before it: it is not its content. */\nconst withoutIds = (key: string, value: unknown) =>\n key === 'id' || key === 'ids' ? undefined : value\n\nconst contentOf = (value: unknown) => JSON.stringify(value, withoutIds)\n\n/** The ids of a table's cells that differ from the table it took the place of. */\nconst changedCellIds = (\n after: WordPreviewBlock & { kind: 'table' },\n before: WordPreviewBlock | undefined,\n): string[] => {\n const idsOf = (cells: WordPreviewCell[]) =>\n cells.flatMap((c) => c.ids ?? [])\n if (before?.kind !== 'table') {\n return idsOf(after.rows.flat())\n }\n const rows = unmatchedItems(\n before.rows.map(contentOf),\n after.rows.map(contentOf),\n )\n return [...rows].flatMap(([r, was]) => {\n const old = was === undefined ? undefined : before.rows[was]\n return idsOf(\n after.rows[r].filter(\n (cell, c) => !old?.[c] || contentOf(old[c]) !== contentOf(cell),\n ),\n )\n })\n}\n\nconst wordChanges = (before: WordPreview, after: WordPreview) => {\n const paragraphs = new Set<string>()\n const blocks = unmatchedItems(\n before.blocks.map(contentOf),\n after.blocks.map(contentOf),\n )\n for (const [b, was] of blocks) {\n const block = after.blocks[b]\n if (block.kind === 'table') {\n const old = was === undefined ? undefined : before.blocks[was]\n for (const id of changedCellIds(block, old)) {\n paragraphs.add(id)\n }\n } else if (block.id) {\n paragraphs.add(block.id)\n }\n }\n return paragraphs\n}\n\n/**\n * A cell as it shows: its look and number format by what they are, as each\n * version numbers its own lists of them.\n */\nconst cellContents = (\n preview: SpreadsheetPreview,\n sheet: SpreadsheetPreviewSheet,\n) => {\n const out = new Map<string, string>()\n for (const r of sheet.rows) {\n for (const cell of r.cells) {\n out.set(\n `${r.row}:${cell.col}`,\n JSON.stringify({\n ...cell,\n style:\n cell.style === undefined\n ? undefined\n : preview.styles[cell.style],\n numFmt:\n cell.numFmt === undefined\n ? undefined\n : preview.numberFormats?.[cell.numFmt],\n }),\n )\n }\n }\n return out\n}\n\nconst spreadsheetChanges = (\n before: SpreadsheetPreview,\n after: SpreadsheetPreview,\n) => {\n const cells = new Map<string, ReadonlySet<string>>()\n for (const sheet of after.sheets) {\n const old = before.sheets.find((s) => s.name === sheet.name)\n const now = cellContents(after, sheet)\n const was = old ? cellContents(before, old) : new Map<string, string>()\n const changed = new Set<string>()\n for (const [at, content] of now) {\n if (was.get(at) !== content) {\n changed.add(at)\n }\n }\n // A cell emptied is gone from the new version's list\n for (const at of was.keys()) {\n if (!now.has(at)) {\n changed.add(at)\n }\n }\n if (changed.size) {\n cells.set(sheet.name, changed)\n }\n }\n return cells\n}\n\n/**\n * What `after` changed from `before`, two versions of the same file: none\n * when nothing the viewer draws differs, or the two are not of one format.\n */\nexport const chatFilePreviewChanges = (\n before: ChatFilePreview,\n after: ChatFilePreview,\n): ChatFilePreviewChanges | undefined => {\n if (before.kind === 'word' && after.kind === 'word') {\n const paragraphs = wordChanges(before, after)\n return paragraphs.size ? { kind: 'word', paragraphs } : undefined\n }\n if (before.kind === 'spreadsheet' && after.kind === 'spreadsheet') {\n const cells = spreadsheetChanges(before, after)\n return cells.size ? { kind: 'spreadsheet', cells } : undefined\n }\n return undefined\n}\n\n/**\n * Brings the first marked change into the middle of the viewer's own scroll\n * box, when it is not in sight already. Not `scrollIntoView`: it would scroll\n * the page around the viewer too. False while there is none drawn yet.\n */\nexport const revealFirstChange = (\n scroller: HTMLElement | null | undefined,\n selector: string,\n): boolean => {\n const el = scroller?.querySelector(selector)\n if (!scroller || !el) {\n return false\n }\n const box = scroller.getBoundingClientRect()\n const at = el.getBoundingClientRect()\n if (at.top < box.top || at.bottom > box.bottom) {\n scroller.scrollTop += at.top - box.top - (box.height - at.height) / 2\n }\n if (at.left < box.left || at.right > box.right) {\n scroller.scrollLeft += at.left - box.left - (box.width - at.width) / 2\n }\n return true\n}\n","<script setup lang=\"ts\">\n import { computed, nextTick, ref, useTemplateRef } from 'vue'\n import { useElementSize } from '@vueuse/core'\n import { useI18n } from 'vue-i18n'\n import { selectionBarPosition } from './utils'\n\n /**\n * The menu of actions on a selection (spec `selection-actions.md`, \"Cosa\n * è comune\"), on the page that embeds the widget and in the chat's file\n * viewer: a row per action with its icon, the agent's after the built-in\n * ones, then \"Ask…\" below a rule, which turns the menu into a field. An\n * action may ask for a word first (`asks`: \"Translate\" asks the\n * language). It sits above the start of the selection, below it without\n * room there (`selectionBarPosition`). Its rows take no focus on a click,\n * so the selection stays and Cmd+C still copies it; the keyboard reaches\n * them with Tab.\n */\n\n /**\n * The built-in actions by their icon, from the Remix set the app's menus\n * use; an action of the agent has the one of `AGENT_ACTION_ICON`.\n */\n const BUILT_IN_ICONS: Record<string, string> = {\n explain: 'ri:question-line',\n summarize: 'ri:file-list-3-line',\n rewrite: 'ri:edit-line',\n shorten: 'ri:scissors-cut-line',\n proofread: 'ri:check-double-line',\n translate: 'ri:translate-2',\n chart: 'ri:bar-chart-2-line',\n }\n const AGENT_ACTION_ICON = 'ri:sparkling-line'\n\n export type SelectionBarAction = {\n id: string\n label: string\n /** The placeholder of a field the action opens before it is sent. */\n asks?: string\n }\n\n const props = defineProps<{\n actions: SelectionBarAction[]\n /** The selection, in the coordinates of the box the bar is positioned in. */\n anchor: {\n start: { top: number; left: number }\n bottom: number\n bounds: { top: number; left: number; width: number; height: number }\n }\n /** `fixed` over the page, `absolute` inside the file viewer. */\n strategy?: 'fixed' | 'absolute'\n /** A line before the actions: why some are missing. */\n hint?: string\n /** In place of the actions: why there are none, with `noteAction` to act on it. */\n note?: string\n noteAction?: string\n /** On a touch screen the bar goes below, away from the system's menu. */\n touch?: boolean\n }>()\n\n const emit = defineEmits<{\n action: [id: string, value?: string]\n ask: [text: string]\n note: []\n close: []\n }>()\n\n /** The field is open: the selection may move into it, and the bar stays. */\n const asking = defineModel<boolean>('asking', { default: false })\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const barEl = useTemplateRef<HTMLElement>('barEl')\n const inputEl = useTemplateRef<HTMLInputElement>('inputEl')\n const { width, height } = useElementSize(barEl, undefined, {\n box: 'border-box',\n })\n const position = computed(() =>\n selectionBarPosition({\n ...props.anchor,\n bar: { width: width.value, height: height.value },\n touch: props.touch,\n }),\n )\n\n /** The action whose field is open, or \"Ask…\" (no id). */\n const field = ref<{ id?: string; placeholder: string }>()\n const text = ref('')\n\n const openField = async (id: string | undefined, placeholder: string) => {\n field.value = { id, placeholder }\n text.value = ''\n asking.value = true\n await nextTick()\n inputEl.value?.focus()\n }\n const closeField = () => {\n field.value = undefined\n asking.value = false\n }\n const openAsk = () =>\n openField(undefined, $t('selectionActions.askPlaceholder'))\n\n const iconOf = (action: SelectionBarAction) =>\n BUILT_IN_ICONS[action.id] ?? AGENT_ACTION_ICON\n\n const run = (action: SelectionBarAction) => {\n if (action.asks) {\n void openField(action.id, action.asks)\n } else {\n emit('action', action.id)\n }\n }\n\n /**\n * A finger lifted on the row it touched. The menu turns the touch's\n * default off as it starts: on a phone a tap outside the text clears\n * the selection before the click, and the menu went with it. With the\n * default off no click follows, so the row acts here.\n */\n const onTap = (event: TouchEvent, act: () => void) => {\n const row = event.currentTarget as HTMLElement\n const touch = event.changedTouches[0]\n const root = row.getRootNode() as Document | ShadowRoot\n const under =\n touch && root.elementFromPoint(touch.clientX, touch.clientY)\n if (under && row.contains(under)) {\n act()\n }\n }\n\n const submit = () => {\n const value = text.value.trim()\n if (!value || !field.value) {\n return\n }\n if (field.value.id) {\n emit('action', field.value.id, value)\n } else {\n emit('ask', value)\n }\n closeField()\n }\n\n /**\n * Esc closes the field, or the menu, and nothing else: its default would\n * also close the dialog the file viewer is in. Not while an input method\n * composes: there Esc cancels the composition.\n */\n const onEscape = (event: KeyboardEvent) => {\n if (event.isComposing) {\n return\n }\n event.stopPropagation()\n event.preventDefault()\n if (field.value) {\n closeField()\n } else {\n emit('close')\n }\n }\n</script>\n\n<template>\n <div\n class=\"pk-selection-actions\"\n :class=\"{\n 'pk-selection-actions--fixed': strategy === 'fixed',\n 'pk-selection-actions--asking': !!field,\n }\"\n :style=\"{\n top: `${position.top}px`,\n left: `${position.left}px`,\n }\"\n @keydown.esc=\"onEscape\">\n <form\n v-if=\"field\"\n ref=\"barEl\"\n class=\"pk-selection-actions__menu pk-selection-actions__menu--field\"\n @submit.prevent=\"submit\">\n <input\n ref=\"inputEl\"\n v-model=\"text\"\n class=\"pk-selection-actions__input\"\n type=\"text\"\n maxlength=\"500\"\n :placeholder=\"field.placeholder\"\n :aria-label=\"field.placeholder\" />\n <button\n type=\"submit\"\n class=\"pk-selection-actions__button pk-selection-actions__button--send\"\n :disabled=\"!text.trim()\">\n {{ $t('action.send') }}\n </button>\n </form>\n <div\n v-else\n ref=\"barEl\"\n class=\"pk-selection-actions__menu\"\n role=\"toolbar\"\n aria-orientation=\"vertical\"\n :aria-label=\"$t('selectionActions.label')\"\n @touchstart.prevent>\n <template v-if=\"note\">\n <p class=\"pk-selection-actions__text\">{{ note }}</p>\n <button\n v-if=\"noteAction\"\n type=\"button\"\n class=\"pk-selection-actions__button\"\n @mousedown.prevent\n @click=\"emit('note')\"\n @touchend=\"onTap($event, () => emit('note'))\">\n <VvIcon\n name=\"ri:arrow-right-line\"\n class=\"pk-selection-actions__icon\" />\n {{ noteAction }}\n </button>\n </template>\n <template v-else>\n <p v-if=\"hint\" class=\"pk-selection-actions__text\">\n {{ hint }}\n </p>\n <button\n v-for=\"action in actions\"\n :key=\"action.id\"\n type=\"button\"\n class=\"pk-selection-actions__button\"\n @mousedown.prevent\n @click=\"run(action)\"\n @touchend=\"onTap($event, () => run(action))\">\n <VvIcon\n :name=\"iconOf(action)\"\n class=\"pk-selection-actions__icon\" />\n {{ action.label }}\n </button>\n <hr class=\"pk-selection-actions__rule\" />\n <button\n type=\"button\"\n class=\"pk-selection-actions__button\"\n @mousedown.prevent\n @click=\"openAsk\"\n @touchend=\"onTap($event, openAsk)\">\n <VvIcon\n name=\"ri:chat-1-line\"\n class=\"pk-selection-actions__icon\" />\n {{ $t('selectionActions.ask') }}\n </button>\n </template>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-selection-actions {\n position: absolute;\n z-index: 10;\n\n // The widths go here: a box placed absolutely takes its width from\n // its content, so a percentage inside it measured the content, and\n // the field shrank to a few words. Here 100% is the box it is in.\n max-width: min(20rem, calc(100% - var(--spacing-16)));\n\n &--fixed {\n position: fixed;\n\n // Above the site's own layers, as the page pointer's bar\n z-index: 2147483647;\n }\n\n &--asking {\n width: min(var(--spacing-384), calc(100% - var(--spacing-16)));\n max-width: none;\n }\n\n // As the app's menus (the ⋮ of a conversation): the surface, its\n // hairline and its shadow, readable over a document and over a page\n &__menu {\n display: flex;\n flex-direction: column;\n min-width: 11rem;\n width: max-content;\n max-width: 100%;\n padding: var(--spacing-4);\n border: var(--spacing-1) solid var(--color-surface-5);\n border-radius: var(--rounded-lg);\n background-color: var(--color-surface);\n color: var(--color-word-2);\n font-family: var(--font-sans);\n font-size: var(--text-12);\n box-shadow: var(--shadow-lg);\n\n &--field {\n flex-direction: row;\n align-items: center;\n gap: var(--spacing-4);\n width: 100%;\n }\n }\n\n &__text {\n max-width: 16rem;\n margin: 0;\n padding: var(--spacing-4) var(--spacing-8) var(--spacing-6);\n color: var(--color-word-3);\n font-size: var(--text-12);\n }\n\n &__button {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n gap: var(--spacing-8);\n border: 0;\n border-radius: var(--rounded);\n padding: var(--spacing-6) var(--spacing-12) var(--spacing-6)\n var(--spacing-8);\n background-color: transparent;\n color: inherit;\n font: inherit;\n text-align: start;\n white-space: nowrap;\n cursor: pointer;\n\n // A finger gets 40px (DESIGN.md, principle 15): the row grows,\n // the text keeps its size\n @media (pointer: coarse) {\n min-height: var(--spacing-40);\n }\n\n &:hover {\n background-color: var(--color-surface-1);\n color: var(--color-word-1);\n }\n\n &:focus-visible {\n outline: var(--spacing-2) solid var(--color-brand);\n outline-offset: calc(-1 * var(--spacing-2));\n }\n\n &--send {\n padding: var(--spacing-6) var(--spacing-10);\n background-color: var(--color-word-1);\n color: var(--color-surface);\n font-weight: var(--font-medium);\n\n &:hover {\n background-color: var(--color-word-1);\n color: var(--color-surface);\n }\n\n &:disabled {\n opacity: 0.5;\n cursor: default;\n }\n }\n }\n\n &__icon {\n flex-shrink: 0;\n width: var(--spacing-16);\n height: var(--spacing-16);\n color: var(--color-word-3);\n }\n\n &__rule {\n margin: var(--spacing-4) 0;\n border: 0;\n border-top: var(--spacing-1) solid var(--color-surface-3);\n }\n\n &__input {\n flex: 1;\n min-width: 0;\n border: 0;\n border-radius: var(--rounded);\n padding: var(--spacing-6) var(--spacing-8);\n background-color: var(--color-surface-1);\n color: var(--color-word-1);\n font: inherit;\n\n @media (pointer: coarse) {\n min-height: var(--spacing-40);\n\n // Below 16px Safari on iOS zooms the page on the focus\n font-size: var(--text-16);\n }\n\n &::placeholder {\n color: var(--color-word-3);\n }\n\n &:focus-visible {\n outline: var(--spacing-2) solid var(--color-brand);\n outline-offset: calc(-1 * var(--spacing-2));\n }\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { computed, nextTick, ref, useTemplateRef } from 'vue'\n import { useElementSize } from '@vueuse/core'\n import { useI18n } from 'vue-i18n'\n import { selectionBarPosition } from './utils'\n\n /**\n * The menu of actions on a selection (spec `selection-actions.md`, \"Cosa\n * è comune\"), on the page that embeds the widget and in the chat's file\n * viewer: a row per action with its icon, the agent's after the built-in\n * ones, then \"Ask…\" below a rule, which turns the menu into a field. An\n * action may ask for a word first (`asks`: \"Translate\" asks the\n * language). It sits above the start of the selection, below it without\n * room there (`selectionBarPosition`). Its rows take no focus on a click,\n * so the selection stays and Cmd+C still copies it; the keyboard reaches\n * them with Tab.\n */\n\n /**\n * The built-in actions by their icon, from the Remix set the app's menus\n * use; an action of the agent has the one of `AGENT_ACTION_ICON`.\n */\n const BUILT_IN_ICONS: Record<string, string> = {\n explain: 'ri:question-line',\n summarize: 'ri:file-list-3-line',\n rewrite: 'ri:edit-line',\n shorten: 'ri:scissors-cut-line',\n proofread: 'ri:check-double-line',\n translate: 'ri:translate-2',\n chart: 'ri:bar-chart-2-line',\n }\n const AGENT_ACTION_ICON = 'ri:sparkling-line'\n\n export type SelectionBarAction = {\n id: string\n label: string\n /** The placeholder of a field the action opens before it is sent. */\n asks?: string\n }\n\n const props = defineProps<{\n actions: SelectionBarAction[]\n /** The selection, in the coordinates of the box the bar is positioned in. */\n anchor: {\n start: { top: number; left: number }\n bottom: number\n bounds: { top: number; left: number; width: number; height: number }\n }\n /** `fixed` over the page, `absolute` inside the file viewer. */\n strategy?: 'fixed' | 'absolute'\n /** A line before the actions: why some are missing. */\n hint?: string\n /** In place of the actions: why there are none, with `noteAction` to act on it. */\n note?: string\n noteAction?: string\n /** On a touch screen the bar goes below, away from the system's menu. */\n touch?: boolean\n }>()\n\n const emit = defineEmits<{\n action: [id: string, value?: string]\n ask: [text: string]\n note: []\n close: []\n }>()\n\n /** The field is open: the selection may move into it, and the bar stays. */\n const asking = defineModel<boolean>('asking', { default: false })\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const barEl = useTemplateRef<HTMLElement>('barEl')\n const inputEl = useTemplateRef<HTMLInputElement>('inputEl')\n const { width, height } = useElementSize(barEl, undefined, {\n box: 'border-box',\n })\n const position = computed(() =>\n selectionBarPosition({\n ...props.anchor,\n bar: { width: width.value, height: height.value },\n touch: props.touch,\n }),\n )\n\n /** The action whose field is open, or \"Ask…\" (no id). */\n const field = ref<{ id?: string; placeholder: string }>()\n const text = ref('')\n\n const openField = async (id: string | undefined, placeholder: string) => {\n field.value = { id, placeholder }\n text.value = ''\n asking.value = true\n await nextTick()\n inputEl.value?.focus()\n }\n const closeField = () => {\n field.value = undefined\n asking.value = false\n }\n const openAsk = () =>\n openField(undefined, $t('selectionActions.askPlaceholder'))\n\n const iconOf = (action: SelectionBarAction) =>\n BUILT_IN_ICONS[action.id] ?? AGENT_ACTION_ICON\n\n const run = (action: SelectionBarAction) => {\n if (action.asks) {\n void openField(action.id, action.asks)\n } else {\n emit('action', action.id)\n }\n }\n\n /**\n * A finger lifted on the row it touched. The menu turns the touch's\n * default off as it starts: on a phone a tap outside the text clears\n * the selection before the click, and the menu went with it. With the\n * default off no click follows, so the row acts here.\n */\n const onTap = (event: TouchEvent, act: () => void) => {\n const row = event.currentTarget as HTMLElement\n const touch = event.changedTouches[0]\n const root = row.getRootNode() as Document | ShadowRoot\n const under =\n touch && root.elementFromPoint(touch.clientX, touch.clientY)\n if (under && row.contains(under)) {\n act()\n }\n }\n\n const submit = () => {\n const value = text.value.trim()\n if (!value || !field.value) {\n return\n }\n if (field.value.id) {\n emit('action', field.value.id, value)\n } else {\n emit('ask', value)\n }\n closeField()\n }\n\n /**\n * Esc closes the field, or the menu, and nothing else: its default would\n * also close the dialog the file viewer is in. Not while an input method\n * composes: there Esc cancels the composition.\n */\n const onEscape = (event: KeyboardEvent) => {\n if (event.isComposing) {\n return\n }\n event.stopPropagation()\n event.preventDefault()\n if (field.value) {\n closeField()\n } else {\n emit('close')\n }\n }\n</script>\n\n<template>\n <div\n class=\"pk-selection-actions\"\n :class=\"{\n 'pk-selection-actions--fixed': strategy === 'fixed',\n 'pk-selection-actions--asking': !!field,\n }\"\n :style=\"{\n top: `${position.top}px`,\n left: `${position.left}px`,\n }\"\n @keydown.esc=\"onEscape\">\n <form\n v-if=\"field\"\n ref=\"barEl\"\n class=\"pk-selection-actions__menu pk-selection-actions__menu--field\"\n @submit.prevent=\"submit\">\n <input\n ref=\"inputEl\"\n v-model=\"text\"\n class=\"pk-selection-actions__input\"\n type=\"text\"\n maxlength=\"500\"\n :placeholder=\"field.placeholder\"\n :aria-label=\"field.placeholder\" />\n <button\n type=\"submit\"\n class=\"pk-selection-actions__button pk-selection-actions__button--send\"\n :disabled=\"!text.trim()\">\n {{ $t('action.send') }}\n </button>\n </form>\n <div\n v-else\n ref=\"barEl\"\n class=\"pk-selection-actions__menu\"\n role=\"toolbar\"\n aria-orientation=\"vertical\"\n :aria-label=\"$t('selectionActions.label')\"\n @touchstart.prevent>\n <template v-if=\"note\">\n <p class=\"pk-selection-actions__text\">{{ note }}</p>\n <button\n v-if=\"noteAction\"\n type=\"button\"\n class=\"pk-selection-actions__button\"\n @mousedown.prevent\n @click=\"emit('note')\"\n @touchend=\"onTap($event, () => emit('note'))\">\n <VvIcon\n name=\"ri:arrow-right-line\"\n class=\"pk-selection-actions__icon\" />\n {{ noteAction }}\n </button>\n </template>\n <template v-else>\n <p v-if=\"hint\" class=\"pk-selection-actions__text\">\n {{ hint }}\n </p>\n <button\n v-for=\"action in actions\"\n :key=\"action.id\"\n type=\"button\"\n class=\"pk-selection-actions__button\"\n @mousedown.prevent\n @click=\"run(action)\"\n @touchend=\"onTap($event, () => run(action))\">\n <VvIcon\n :name=\"iconOf(action)\"\n class=\"pk-selection-actions__icon\" />\n {{ action.label }}\n </button>\n <hr class=\"pk-selection-actions__rule\" />\n <button\n type=\"button\"\n class=\"pk-selection-actions__button\"\n @mousedown.prevent\n @click=\"openAsk\"\n @touchend=\"onTap($event, openAsk)\">\n <VvIcon\n name=\"ri:chat-1-line\"\n class=\"pk-selection-actions__icon\" />\n {{ $t('selectionActions.ask') }}\n </button>\n </template>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-selection-actions {\n position: absolute;\n z-index: 10;\n\n // The widths go here: a box placed absolutely takes its width from\n // its content, so a percentage inside it measured the content, and\n // the field shrank to a few words. Here 100% is the box it is in.\n max-width: min(20rem, calc(100% - var(--spacing-16)));\n\n &--fixed {\n position: fixed;\n\n // Above the site's own layers, as the page pointer's bar\n z-index: 2147483647;\n }\n\n &--asking {\n width: min(var(--spacing-384), calc(100% - var(--spacing-16)));\n max-width: none;\n }\n\n // As the app's menus (the ⋮ of a conversation): the surface, its\n // hairline and its shadow, readable over a document and over a page\n &__menu {\n display: flex;\n flex-direction: column;\n min-width: 11rem;\n width: max-content;\n max-width: 100%;\n padding: var(--spacing-4);\n border: var(--spacing-1) solid var(--color-surface-5);\n border-radius: var(--rounded-lg);\n background-color: var(--color-surface);\n color: var(--color-word-2);\n font-family: var(--font-sans);\n font-size: var(--text-12);\n box-shadow: var(--shadow-lg);\n\n &--field {\n flex-direction: row;\n align-items: center;\n gap: var(--spacing-4);\n width: 100%;\n }\n }\n\n &__text {\n max-width: 16rem;\n margin: 0;\n padding: var(--spacing-4) var(--spacing-8) var(--spacing-6);\n color: var(--color-word-3);\n font-size: var(--text-12);\n }\n\n &__button {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n gap: var(--spacing-8);\n border: 0;\n border-radius: var(--rounded);\n padding: var(--spacing-6) var(--spacing-12) var(--spacing-6)\n var(--spacing-8);\n background-color: transparent;\n color: inherit;\n font: inherit;\n text-align: start;\n white-space: nowrap;\n cursor: pointer;\n\n // A finger gets 40px (DESIGN.md, principle 15): the row grows,\n // the text keeps its size\n @media (pointer: coarse) {\n min-height: var(--spacing-40);\n }\n\n &:hover {\n background-color: var(--color-surface-1);\n color: var(--color-word-1);\n }\n\n &:focus-visible {\n outline: var(--spacing-2) solid var(--color-brand);\n outline-offset: calc(-1 * var(--spacing-2));\n }\n\n &--send {\n padding: var(--spacing-6) var(--spacing-10);\n background-color: var(--color-word-1);\n color: var(--color-surface);\n font-weight: var(--font-medium);\n\n &:hover {\n background-color: var(--color-word-1);\n color: var(--color-surface);\n }\n\n &:disabled {\n opacity: 0.5;\n cursor: default;\n }\n }\n }\n\n &__icon {\n flex-shrink: 0;\n width: var(--spacing-16);\n height: var(--spacing-16);\n color: var(--color-word-3);\n }\n\n &__rule {\n margin: var(--spacing-4) 0;\n border: 0;\n border-top: var(--spacing-1) solid var(--color-surface-3);\n }\n\n &__input {\n flex: 1;\n min-width: 0;\n border: 0;\n border-radius: var(--rounded);\n padding: var(--spacing-6) var(--spacing-8);\n background-color: var(--color-surface-1);\n color: var(--color-word-1);\n font: inherit;\n\n @media (pointer: coarse) {\n min-height: var(--spacing-40);\n\n // Below 16px Safari on iOS zooms the page on the focus\n font-size: var(--text-16);\n }\n\n &::placeholder {\n color: var(--color-word-3);\n }\n\n &:focus-visible {\n outline: var(--spacing-2) solid var(--color-brand);\n outline-offset: calc(-1 * var(--spacing-2));\n }\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { computed, nextTick, ref, useTemplateRef } from 'vue'\n import { useElementSize } from '@vueuse/core'\n import { useI18n } from 'vue-i18n'\n import { selectionBarPosition } from './utils'\n\n /**\n * The menu of actions on a selection (spec `selection-actions.md`, \"Cosa\n * è comune\"), on the page that embeds the widget and in the chat's file\n * viewer: a row per action with its icon, the agent's after the built-in\n * ones, then \"Ask…\" below a rule, which turns the menu into a field. An\n * action may ask for a word first (`asks`: \"Translate\" asks the\n * language). It sits above the start of the selection, below it without\n * room there (`selectionBarPosition`). Its rows take no focus on a click,\n * so the selection stays and Cmd+C still copies it; the keyboard reaches\n * them with Tab.\n */\n\n /**\n * The built-in actions by their icon, from the Remix set the app's menus\n * use; an action of the agent has the one of `AGENT_ACTION_ICON`.\n */\n const BUILT_IN_ICONS: Record<string, string> = {\n explain: 'ri:question-line',\n summarize: 'ri:file-list-3-line',\n rewrite: 'ri:edit-line',\n shorten: 'ri:scissors-cut-line',\n proofread: 'ri:check-double-line',\n translate: 'ri:translate-2',\n chart: 'ri:bar-chart-2-line',\n }\n const AGENT_ACTION_ICON = 'ri:sparkling-line'\n\n export type SelectionBarAction = {\n id: string\n label: string\n /** The placeholder of a field the action opens before it is sent. */\n asks?: string\n }\n\n const props = defineProps<{\n actions: SelectionBarAction[]\n /** The selection, in the coordinates of the box the bar is positioned in. */\n anchor: {\n start: { top: number; left: number }\n bottom: number\n bounds: { top: number; left: number; width: number; height: number }\n }\n /** `fixed` over the page, `absolute` inside the file viewer. */\n strategy?: 'fixed' | 'absolute'\n /** A line before the actions: why some are missing. */\n hint?: string\n /** In place of the actions: why there are none, with `noteAction` to act on it. */\n note?: string\n noteAction?: string\n /** On a touch screen the bar goes below, away from the system's menu. */\n touch?: boolean\n }>()\n\n const emit = defineEmits<{\n action: [id: string, value?: string]\n ask: [text: string]\n note: []\n close: []\n }>()\n\n /** The field is open: the selection may move into it, and the bar stays. */\n const asking = defineModel<boolean>('asking', { default: false })\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const barEl = useTemplateRef<HTMLElement>('barEl')\n const inputEl = useTemplateRef<HTMLInputElement>('inputEl')\n const { width, height } = useElementSize(barEl, undefined, {\n box: 'border-box',\n })\n const position = computed(() =>\n selectionBarPosition({\n ...props.anchor,\n bar: { width: width.value, height: height.value },\n touch: props.touch,\n }),\n )\n\n /** The action whose field is open, or \"Ask…\" (no id). */\n const field = ref<{ id?: string; placeholder: string }>()\n const text = ref('')\n\n const openField = async (id: string | undefined, placeholder: string) => {\n field.value = { id, placeholder }\n text.value = ''\n asking.value = true\n await nextTick()\n inputEl.value?.focus()\n }\n const closeField = () => {\n field.value = undefined\n asking.value = false\n }\n const openAsk = () =>\n openField(undefined, $t('selectionActions.askPlaceholder'))\n\n const iconOf = (action: SelectionBarAction) =>\n BUILT_IN_ICONS[action.id] ?? AGENT_ACTION_ICON\n\n const run = (action: SelectionBarAction) => {\n if (action.asks) {\n void openField(action.id, action.asks)\n } else {\n emit('action', action.id)\n }\n }\n\n /**\n * A finger lifted on the row it touched. The menu turns the touch's\n * default off as it starts: on a phone a tap outside the text clears\n * the selection before the click, and the menu went with it. With the\n * default off no click follows, so the row acts here.\n */\n const onTap = (event: TouchEvent, act: () => void) => {\n const row = event.currentTarget as HTMLElement\n const touch = event.changedTouches[0]\n const root = row.getRootNode() as Document | ShadowRoot\n const under =\n touch && root.elementFromPoint(touch.clientX, touch.clientY)\n if (under && row.contains(under)) {\n act()\n }\n }\n\n const submit = () => {\n const value = text.value.trim()\n if (!value || !field.value) {\n return\n }\n if (field.value.id) {\n emit('action', field.value.id, value)\n } else {\n emit('ask', value)\n }\n closeField()\n }\n\n /**\n * Esc closes the field, or the menu, and nothing else: its default would\n * also close the dialog the file viewer is in. Not while an input method\n * composes: there Esc cancels the composition.\n */\n const onEscape = (event: KeyboardEvent) => {\n if (event.isComposing) {\n return\n }\n event.stopPropagation()\n event.preventDefault()\n if (field.value) {\n closeField()\n } else {\n emit('close')\n }\n }\n</script>\n\n<template>\n <div\n class=\"pk-selection-actions\"\n :class=\"{\n 'pk-selection-actions--fixed': strategy === 'fixed',\n 'pk-selection-actions--asking': !!field,\n }\"\n :style=\"{\n top: `${position.top}px`,\n left: `${position.left}px`,\n }\"\n @keydown.esc=\"onEscape\">\n <form\n v-if=\"field\"\n ref=\"barEl\"\n class=\"pk-selection-actions__menu pk-selection-actions__menu--field\"\n @submit.prevent=\"submit\">\n <input\n ref=\"inputEl\"\n v-model=\"text\"\n class=\"pk-selection-actions__input\"\n type=\"text\"\n maxlength=\"500\"\n :placeholder=\"field.placeholder\"\n :aria-label=\"field.placeholder\" />\n <button\n type=\"submit\"\n class=\"pk-selection-actions__button pk-selection-actions__button--send\"\n :disabled=\"!text.trim()\">\n {{ $t('action.send') }}\n </button>\n </form>\n <div\n v-else\n ref=\"barEl\"\n class=\"pk-selection-actions__menu\"\n role=\"toolbar\"\n aria-orientation=\"vertical\"\n :aria-label=\"$t('selectionActions.label')\"\n @touchstart.prevent>\n <template v-if=\"note\">\n <p class=\"pk-selection-actions__text\">{{ note }}</p>\n <button\n v-if=\"noteAction\"\n type=\"button\"\n class=\"pk-selection-actions__button\"\n @mousedown.prevent\n @click=\"emit('note')\"\n @touchend=\"onTap($event, () => emit('note'))\">\n <VvIcon\n name=\"ri:arrow-right-line\"\n class=\"pk-selection-actions__icon\" />\n {{ noteAction }}\n </button>\n </template>\n <template v-else>\n <p v-if=\"hint\" class=\"pk-selection-actions__text\">\n {{ hint }}\n </p>\n <button\n v-for=\"action in actions\"\n :key=\"action.id\"\n type=\"button\"\n class=\"pk-selection-actions__button\"\n @mousedown.prevent\n @click=\"run(action)\"\n @touchend=\"onTap($event, () => run(action))\">\n <VvIcon\n :name=\"iconOf(action)\"\n class=\"pk-selection-actions__icon\" />\n {{ action.label }}\n </button>\n <hr class=\"pk-selection-actions__rule\" />\n <button\n type=\"button\"\n class=\"pk-selection-actions__button\"\n @mousedown.prevent\n @click=\"openAsk\"\n @touchend=\"onTap($event, openAsk)\">\n <VvIcon\n name=\"ri:chat-1-line\"\n class=\"pk-selection-actions__icon\" />\n {{ $t('selectionActions.ask') }}\n </button>\n </template>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-selection-actions {\n position: absolute;\n z-index: 10;\n\n // The widths go here: a box placed absolutely takes its width from\n // its content, so a percentage inside it measured the content, and\n // the field shrank to a few words. Here 100% is the box it is in.\n max-width: min(20rem, calc(100% - var(--spacing-16)));\n\n &--fixed {\n position: fixed;\n\n // Above the site's own layers, as the page pointer's bar\n z-index: 2147483647;\n }\n\n &--asking {\n width: min(var(--spacing-384), calc(100% - var(--spacing-16)));\n max-width: none;\n }\n\n // As the app's menus (the ⋮ of a conversation): the surface, its\n // hairline and its shadow, readable over a document and over a page\n &__menu {\n display: flex;\n flex-direction: column;\n min-width: 11rem;\n width: max-content;\n max-width: 100%;\n padding: var(--spacing-4);\n border: var(--spacing-1) solid var(--color-surface-5);\n border-radius: var(--rounded-lg);\n background-color: var(--color-surface);\n color: var(--color-word-2);\n font-family: var(--font-sans);\n font-size: var(--text-12);\n box-shadow: var(--shadow-lg);\n\n &--field {\n flex-direction: row;\n align-items: center;\n gap: var(--spacing-4);\n width: 100%;\n }\n }\n\n &__text {\n max-width: 16rem;\n margin: 0;\n padding: var(--spacing-4) var(--spacing-8) var(--spacing-6);\n color: var(--color-word-3);\n font-size: var(--text-12);\n }\n\n &__button {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n gap: var(--spacing-8);\n border: 0;\n border-radius: var(--rounded);\n padding: var(--spacing-6) var(--spacing-12) var(--spacing-6)\n var(--spacing-8);\n background-color: transparent;\n color: inherit;\n font: inherit;\n text-align: start;\n white-space: nowrap;\n cursor: pointer;\n\n // A finger gets 40px (DESIGN.md, principle 15): the row grows,\n // the text keeps its size\n @media (pointer: coarse) {\n min-height: var(--spacing-40);\n }\n\n &:hover {\n background-color: var(--color-surface-1);\n color: var(--color-word-1);\n }\n\n &:focus-visible {\n outline: var(--spacing-2) solid var(--color-brand);\n outline-offset: calc(-1 * var(--spacing-2));\n }\n\n &--send {\n padding: var(--spacing-6) var(--spacing-10);\n background-color: var(--color-word-1);\n color: var(--color-surface);\n font-weight: var(--font-medium);\n\n &:hover {\n background-color: var(--color-word-1);\n color: var(--color-surface);\n }\n\n &:disabled {\n opacity: 0.5;\n cursor: default;\n }\n }\n }\n\n &__icon {\n flex-shrink: 0;\n width: var(--spacing-16);\n height: var(--spacing-16);\n color: var(--color-word-3);\n }\n\n &__rule {\n margin: var(--spacing-4) 0;\n border: 0;\n border-top: var(--spacing-1) solid var(--color-surface-3);\n }\n\n &__input {\n flex: 1;\n min-width: 0;\n border: 0;\n border-radius: var(--rounded);\n padding: var(--spacing-6) var(--spacing-8);\n background-color: var(--color-surface-1);\n color: var(--color-word-1);\n font: inherit;\n\n @media (pointer: coarse) {\n min-height: var(--spacing-40);\n\n // Below 16px Safari on iOS zooms the page on the focus\n font-size: var(--text-16);\n }\n\n &::placeholder {\n color: var(--color-word-3);\n }\n\n &:focus-visible {\n outline: var(--spacing-2) solid var(--color-brand);\n outline-offset: calc(-1 * var(--spacing-2));\n }\n }\n }\n</style>\n"],"mappings":";;;;;;;;AA8BA,IAAMsD,IAAe,sCAEfC,IAAe,uCAKfC,IAAc;AAGpB,SAAgBC,IAAyB;CACrC,OAAO,OAAO,cAAe,cAAc,WAAWF,CAAY,CAAC,CAAC;AACxE;AAiBA,SAASG,EAAQ,GAAgD;CAC7D,IAAMC,IAAY,SAAS,aAAa;CACxC,IAAI,CAACA,KAAaA,EAAU,eAAe,GACvC;CAEJ,IAAIC,EAAK,aAAa,KAAK,eACvB,OAAOD,EAAU,WAAW,CAAC,CAAC,CAAC,WAAW;CAE9C,IAAME,IAASD;CACf,IAAID,EAAU,mBAAmB;EAC7B,IAAIG;EACJ,IAAI;GACA,IAASH,EAAU,kBAAkB,EAAE,aAAa,CAACE,CAAM,EAAE,CAAC;EAClE,QAAQ;GACJ,IAASF,EAAU,kBAAkBE,CAAM;EAC/C;EACA,IAAM,CAACE,KAASD;EAChB,IAAI,CAACC,GACD;EAEJ,IAAMC,IAAQ,SAAS,YAAY;EAGnC,OAFAA,EAAM,SAASD,EAAM,gBAAgBA,EAAM,WAAW,GACtDC,EAAM,OAAOD,EAAM,cAAc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 -2,12 +2,12 @@ import { F as e, I as t, L as n, Q as r, X as i, bt as a, h as o, k as s, ot as
2
2
  import { r as p } from "./vue-i18n-POtLvOl1.js";
3
3
  import { n as ee, t as m } from "./cdn-css-C3_zuSx6.js";
4
4
  import "./src-JJyCGvqH.js";
5
- import { _ as h } from "./utils-BF9VwhRy.js";
5
+ import { _ as h } from "./utils-DYtnrtNk.js";
6
6
  import { n as te } from "./url-validation-CJV9pp4v.js";
7
7
  import { T as ne } from "./dist-D6oUr4J_.js";
8
8
  import { n as re } from "./useShortUrlResolver-C30QRypC.js";
9
9
  import { t as g } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
10
- import { n as ie } from "./chatImagePolicy-DMvnRaBQ.js";
10
+ import { n as ie } from "./chatImagePolicy-XBxAhi8o.js";
11
11
  import { a as ae } from "./useLightbox-C54BCSbU.js";
12
12
  // ../../packages/utils/src/citations.ts
13
13
  var _ = /[ \t]*\uE200[^\uE201]*\uE201/g, oe = /(?<![ \t])[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, se = /[\uE200-\uE20F]/g;
@@ -3405,4 +3405,4 @@ var wa = ["data-pswp-images", "innerHTML"], Ta = 100, Ea = /*#__PURE__*/ g(/* @_
3405
3405
  }), [["styles", [".markdown-held-image{max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-3);font:inherit;font-size:var(--text-12);vertical-align:middle;cursor:pointer;align-items:center;display:inline-flex}.markdown-held-image:hover,.markdown-held-image:focus-visible{background-color:var(--color-surface-2);color:var(--color-word-2)}.markdown-broken-image{align-items:center;gap:var(--spacing-4);max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-4);font-size:var(--text-12);vertical-align:middle;display:inline-flex}[data-pswp-images] img:not(a img){cursor:zoom-in}@keyframes pk-streaming-markdown-fade-in{0%{opacity:0}to{opacity:1}}@keyframes pk-streaming-markdown-blur-in{0%{opacity:0;filter:blur(4px)}to{opacity:1;filter:blur()}}@keyframes pk-streaming-markdown-drop-in{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes pk-streaming-markdown-slide-up{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes pk-streaming-markdown-fade-and-scale{0%{opacity:0;transform:scale(.85)}to{opacity:1;transform:scale(1)}}"]]]);
3406
3406
  export { Ea as t };
3407
3407
 
3408
- //# sourceMappingURL=PkStreamingMarkdown-B0iGNA8Y.js.map
3408
+ //# sourceMappingURL=PkStreamingMarkdown-DKTxy47I.js.map