@8wave/ai-elements 0.125.0-beta.1 → 0.125.0-beta.10

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 (173) hide show
  1. package/dist/_chunks/{Agent-BBWFD4nI.js → Agent-DZhK49jg.js} +99 -96
  2. package/dist/_chunks/Agent-DZhK49jg.js.map +1 -0
  3. package/dist/_chunks/{PkFilePreview-BwHe4-m1.js → PkFilePreview-C3R3jrNi.js} +31 -31
  4. package/dist/_chunks/{PkFilePreview-BwHe4-m1.js.map → PkFilePreview-C3R3jrNi.js.map} +1 -1
  5. package/dist/_chunks/{PkFilePreviewDialog-LWxNgkzk.js → PkFilePreviewDialog-BAKFOnPI.js} +2 -2
  6. package/dist/_chunks/{PkFilePreviewDialog-LWxNgkzk.js.map → PkFilePreviewDialog-BAKFOnPI.js.map} +1 -1
  7. package/dist/_chunks/{PkStreamingMarkdown-BvgO6aHe.js → PkStreamingMarkdown-BM-DSTPr.js} +3 -3
  8. package/dist/_chunks/{PkStreamingMarkdown-BvgO6aHe.js.map → PkStreamingMarkdown-BM-DSTPr.js.map} +1 -1
  9. package/dist/_chunks/{PkToolChatFile-OuaeZTxw.js → PkToolChatFile-DbeOmRPh.js} +3 -3
  10. package/dist/_chunks/{PkToolChatFile-OuaeZTxw.js.map → PkToolChatFile-DbeOmRPh.js.map} +1 -1
  11. package/dist/_chunks/{PkToolRequestGeolocation-C9PSITRU.js → PkToolRequestGeolocation-CCz4REP9.js} +2 -2
  12. package/dist/_chunks/{PkToolRequestGeolocation-C9PSITRU.js.map → PkToolRequestGeolocation-CCz4REP9.js.map} +1 -1
  13. package/dist/_chunks/{PkToolRequestOAuthConnection-CWi5SeCi.js → PkToolRequestOAuthConnection-BU-4Sm3z.js} +2 -2
  14. package/dist/_chunks/{PkToolRequestOAuthConnection-CWi5SeCi.js.map → PkToolRequestOAuthConnection-BU-4Sm3z.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowArtifact-BqgW3E6D.js → PkToolShowArtifact-utxGuLLt.js} +2 -2
  16. package/dist/_chunks/{PkToolShowArtifact-BqgW3E6D.js.map → PkToolShowArtifact-utxGuLLt.js.map} +1 -1
  17. package/dist/_chunks/PkToolShowCalendarEvent-DWtTo28t.js +148 -0
  18. package/dist/_chunks/PkToolShowCalendarEvent-DWtTo28t.js.map +1 -0
  19. package/dist/_chunks/{PkToolShowContactForm-DDDXopZp.js → PkToolShowContactForm-DTtE93D3.js} +2 -2
  20. package/dist/_chunks/{PkToolShowContactForm-DDDXopZp.js.map → PkToolShowContactForm-DTtE93D3.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowForm-D2LZ8Kkl.js → PkToolShowForm-I4pKopEI.js} +6 -6
  22. package/dist/_chunks/{PkToolShowForm-D2LZ8Kkl.js.map → PkToolShowForm-I4pKopEI.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowImageGallery-DAcW2Dau.js → PkToolShowImageGallery-skV87BlD.js} +2 -2
  24. package/dist/_chunks/{PkToolShowImageGallery-DAcW2Dau.js.map → PkToolShowImageGallery-skV87BlD.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowProductList-OYwQCHar.js → PkToolShowProductList-CcdOQoxf.js} +2 -2
  26. package/dist/_chunks/{PkToolShowProductList-OYwQCHar.js.map → PkToolShowProductList-CcdOQoxf.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowQrCode-e6DxEcWY.js → PkToolShowQrCode-DGMhVUbp.js} +28 -22
  28. package/dist/_chunks/PkToolShowQrCode-DGMhVUbp.js.map +1 -0
  29. package/dist/_chunks/{PkToolShowSources-DA4SOt-H.js → PkToolShowSources-DLmVS3bL.js} +3 -3
  30. package/dist/_chunks/{PkToolShowSources-DA4SOt-H.js.map → PkToolShowSources-DLmVS3bL.js.map} +1 -1
  31. package/dist/_chunks/{PkToolShowSuggestedReply-BTE7TZ4Z.js → PkToolShowSuggestedReply-Cv-WVCFN.js} +2 -2
  32. package/dist/_chunks/{PkToolShowSuggestedReply-BTE7TZ4Z.js.map → PkToolShowSuggestedReply-Cv-WVCFN.js.map} +1 -1
  33. package/dist/_chunks/{PkToolShowVideo-bTWeXtZd.js → PkToolShowVideo-D_K95gTR.js} +2 -2
  34. package/dist/_chunks/{PkToolShowVideo-bTWeXtZd.js.map → PkToolShowVideo-D_K95gTR.js.map} +1 -1
  35. package/dist/_chunks/{PkToolShowWebPages-DNbdkSSz.js → PkToolShowWebPages-DsfMacw-.js} +2 -2
  36. package/dist/_chunks/{PkToolShowWebPages-DNbdkSSz.js.map → PkToolShowWebPages-DsfMacw-.js.map} +1 -1
  37. package/dist/_chunks/{chatImagePolicy-C4jFnVQl.js → chatImagePolicy-BfgdFbm_.js} +2 -2
  38. package/dist/_chunks/{chatImagePolicy-C4jFnVQl.js.map → chatImagePolicy-BfgdFbm_.js.map} +1 -1
  39. package/dist/_chunks/{markdown-DDYeZICP.js → markdown-CrMYpY8l.js} +10 -10
  40. package/dist/_chunks/{markdown-DDYeZICP.js.map → markdown-CrMYpY8l.js.map} +1 -1
  41. package/dist/_chunks/{utils-euH8esYP.js → utils-CbhqxYyx.js} +57 -57
  42. package/dist/_chunks/utils-CbhqxYyx.js.map +1 -0
  43. package/dist/ai-elements.es.js +4310 -4198
  44. package/dist/ai-elements.es.js.map +1 -1
  45. package/dist-vue/PkChatbot.js +1 -1
  46. package/dist-vue/PkChatbotEmptyState.js +1 -1
  47. package/dist-vue/PkChatbotInput.js +1 -1
  48. package/dist-vue/PkChatbotMessages.js +1 -1
  49. package/dist-vue/PkChatbotStepPayload.js +1 -1
  50. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  51. package/dist-vue/PkChatbotSteps.js +1 -1
  52. package/dist-vue/PkChatbotViewChat.js +1 -1
  53. package/dist-vue/PkChatbotViewConversations.js +1 -1
  54. package/dist-vue/PkChatbotViewFiles.js +1 -1
  55. package/dist-vue/PkChatbotViewProfile.js +1 -1
  56. package/dist-vue/_chunks/{Agent-DQl-tv4S.js → Agent-BtXBSGy6.js} +34 -31
  57. package/dist-vue/_chunks/Agent-BtXBSGy6.js.map +1 -0
  58. package/dist-vue/_chunks/{Document-DXDifFZE.js → Document-DERAWuR0.js} +10 -10
  59. package/dist-vue/_chunks/{Document-DXDifFZE.js.map → Document-DERAWuR0.js.map} +1 -1
  60. package/dist-vue/_chunks/PkChatbot-CLOfTLQy.js +294 -0
  61. package/dist-vue/_chunks/PkChatbot-CLOfTLQy.js.map +1 -0
  62. package/dist-vue/_chunks/{PkChatbotEmptyState-CLOH5Z2d.js → PkChatbotEmptyState-C9aUiynZ.js} +2 -2
  63. package/dist-vue/_chunks/{PkChatbotEmptyState-CLOH5Z2d.js.map → PkChatbotEmptyState-C9aUiynZ.js.map} +1 -1
  64. package/dist-vue/_chunks/{PkChatbotInput-BK7f1jFE.js → PkChatbotInput-Bs8nn-Jz.js} +154 -135
  65. package/dist-vue/_chunks/PkChatbotInput-Bs8nn-Jz.js.map +1 -0
  66. package/dist-vue/_chunks/PkChatbotMessages-BxkCGmqV.js +1039 -0
  67. package/dist-vue/_chunks/PkChatbotMessages-BxkCGmqV.js.map +1 -0
  68. package/dist-vue/_chunks/{PkChatbotStepPayload-D682n3VR.js → PkChatbotStepPayload-C45aVagz.js} +2 -2
  69. package/dist-vue/_chunks/{PkChatbotStepPayload-D682n3VR.js.map → PkChatbotStepPayload-C45aVagz.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkChatbotStepToolDetail-D5c8rqj9.js → PkChatbotStepToolDetail-B0tC33x6.js} +16 -16
  71. package/dist-vue/_chunks/{PkChatbotStepToolDetail-D5c8rqj9.js.map → PkChatbotStepToolDetail-B0tC33x6.js.map} +1 -1
  72. package/dist-vue/_chunks/PkChatbotSteps-MTSA_RrY.js +215 -0
  73. package/dist-vue/_chunks/PkChatbotSteps-MTSA_RrY.js.map +1 -0
  74. package/dist-vue/_chunks/{PkChatbotViewChat-D8depeWQ.js → PkChatbotViewChat-BwXOt2WW.js} +450 -446
  75. package/dist-vue/_chunks/PkChatbotViewChat-BwXOt2WW.js.map +1 -0
  76. package/dist-vue/_chunks/{PkChatbotViewConversations-B-dmLi-8.js → PkChatbotViewConversations-CtxE_a1O.js} +3 -3
  77. package/dist-vue/_chunks/{PkChatbotViewConversations-B-dmLi-8.js.map → PkChatbotViewConversations-CtxE_a1O.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkChatbotViewFiles-Du5AAS4v.js → PkChatbotViewFiles-B51zU374.js} +3 -3
  79. package/dist-vue/_chunks/{PkChatbotViewFiles-Du5AAS4v.js.map → PkChatbotViewFiles-B51zU374.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkChatbotViewProfile-UZrZdOyM.js → PkChatbotViewProfile-BSKRU7Ae.js} +2 -2
  81. package/dist-vue/_chunks/{PkChatbotViewProfile-UZrZdOyM.js.map → PkChatbotViewProfile-BSKRU7Ae.js.map} +1 -1
  82. package/dist-vue/_chunks/{PkFilePreview-B54Dp_Rs.js → PkFilePreview-p-AGDrXi.js} +30 -30
  83. package/dist-vue/_chunks/{PkFilePreview-B54Dp_Rs.js.map → PkFilePreview-p-AGDrXi.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkFilePreviewDialog-QDPoZh1v.js → PkFilePreviewDialog-BpeeWS6d.js} +2 -2
  85. package/dist-vue/_chunks/{PkFilePreviewDialog-QDPoZh1v.js.map → PkFilePreviewDialog-BpeeWS6d.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkStreamingMarkdown-qnKwvrCg.js → PkStreamingMarkdown-DlcTV5je.js} +3 -3
  87. package/dist-vue/_chunks/{PkStreamingMarkdown-qnKwvrCg.js.map → PkStreamingMarkdown-DlcTV5je.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkToolChatFile-i0rHgFxB.js → PkToolChatFile-HWGjtuaT.js} +3 -3
  89. package/dist-vue/_chunks/{PkToolChatFile-i0rHgFxB.js.map → PkToolChatFile-HWGjtuaT.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolRequestGeolocation-SDzM1-Wl.js → PkToolRequestGeolocation-euI4VBVe.js} +2 -2
  91. package/dist-vue/_chunks/{PkToolRequestGeolocation-SDzM1-Wl.js.map → PkToolRequestGeolocation-euI4VBVe.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DNrlGxMX.js → PkToolRequestOAuthConnection-DAAYyufP.js} +2 -2
  93. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DNrlGxMX.js.map → PkToolRequestOAuthConnection-DAAYyufP.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolShowArtifact-Dh4ogn6A.js → PkToolShowArtifact-C8OIF_sy.js} +2 -2
  95. package/dist-vue/_chunks/{PkToolShowArtifact-Dh4ogn6A.js.map → PkToolShowArtifact-C8OIF_sy.js.map} +1 -1
  96. package/dist-vue/_chunks/PkToolShowCalendarEvent-CAejFLQI.js +148 -0
  97. package/dist-vue/_chunks/PkToolShowCalendarEvent-CAejFLQI.js.map +1 -0
  98. package/dist-vue/_chunks/{PkToolShowContactForm-BGTI1sio.js → PkToolShowContactForm-K6Z5MUXk.js} +2 -2
  99. package/dist-vue/_chunks/{PkToolShowContactForm-BGTI1sio.js.map → PkToolShowContactForm-K6Z5MUXk.js.map} +1 -1
  100. package/dist-vue/_chunks/{PkToolShowDiagram-xef3wJb0.js → PkToolShowDiagram-DrlGh_v6.js} +2 -2
  101. package/dist-vue/_chunks/{PkToolShowDiagram-xef3wJb0.js.map → PkToolShowDiagram-DrlGh_v6.js.map} +1 -1
  102. package/dist-vue/_chunks/{PkToolShowForm-Crg4Kl6v.js → PkToolShowForm-DzsXJfOl.js} +6 -6
  103. package/dist-vue/_chunks/{PkToolShowForm-Crg4Kl6v.js.map → PkToolShowForm-DzsXJfOl.js.map} +1 -1
  104. package/dist-vue/_chunks/{PkToolShowImageGallery-D9hdGBHK.js → PkToolShowImageGallery-sCyrPOIT.js} +2 -2
  105. package/dist-vue/_chunks/{PkToolShowImageGallery-D9hdGBHK.js.map → PkToolShowImageGallery-sCyrPOIT.js.map} +1 -1
  106. package/dist-vue/_chunks/{PkToolShowProductList-SC5aKDCw.js → PkToolShowProductList-DPDDeVu4.js} +2 -2
  107. package/dist-vue/_chunks/{PkToolShowProductList-SC5aKDCw.js.map → PkToolShowProductList-DPDDeVu4.js.map} +1 -1
  108. package/dist-vue/_chunks/PkToolShowQrCode-96KzD1rX.js +78 -0
  109. package/dist-vue/_chunks/PkToolShowQrCode-96KzD1rX.js.map +1 -0
  110. package/dist-vue/_chunks/{PkToolShowSources-Bf9_JwFL.js → PkToolShowSources-D4zjssdh.js} +3 -3
  111. package/dist-vue/_chunks/{PkToolShowSources-Bf9_JwFL.js.map → PkToolShowSources-D4zjssdh.js.map} +1 -1
  112. package/dist-vue/_chunks/{PkToolShowSuggestedReply-BlcEfMx8.js → PkToolShowSuggestedReply-smfC1hlT.js} +2 -2
  113. package/dist-vue/_chunks/{PkToolShowSuggestedReply-BlcEfMx8.js.map → PkToolShowSuggestedReply-smfC1hlT.js.map} +1 -1
  114. package/dist-vue/_chunks/{PkToolShowVideo-C2ITZDNo.js → PkToolShowVideo-C77DAqoZ.js} +2 -2
  115. package/dist-vue/_chunks/{PkToolShowVideo-C2ITZDNo.js.map → PkToolShowVideo-C77DAqoZ.js.map} +1 -1
  116. package/dist-vue/_chunks/{PkToolShowWebPages-BrefGxKQ.js → PkToolShowWebPages-D_tqGI6o.js} +2 -2
  117. package/dist-vue/_chunks/{PkToolShowWebPages-BrefGxKQ.js.map → PkToolShowWebPages-D_tqGI6o.js.map} +1 -1
  118. package/dist-vue/_chunks/{createChatbotApiClient-Bukf58dz.js → createChatbotApiClient-CO6l0P79.js} +87 -85
  119. package/dist-vue/_chunks/createChatbotApiClient-CO6l0P79.js.map +1 -0
  120. package/dist-vue/_chunks/{useChatbotStore-DcvdWkgq.js → useChatbotStore-CY1gAHOh.js} +1224 -1201
  121. package/dist-vue/_chunks/useChatbotStore-CY1gAHOh.js.map +1 -0
  122. package/dist-vue/_chunks/{utils-B0PnU1Rk.js → utils-CX4JuhXz.js} +66 -66
  123. package/dist-vue/_chunks/utils-CX4JuhXz.js.map +1 -0
  124. package/dist-vue/api.js +1 -1
  125. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +6 -0
  126. package/dist-vue/composables.js +20 -8
  127. package/dist-vue/composables.js.map +1 -1
  128. package/dist-vue/index.js +3394 -3359
  129. package/dist-vue/index.js.map +1 -1
  130. package/dist-vue/locales.js +20 -4
  131. package/dist-vue/packages/components/src/chat/PkAgentPageAccessSettings.d.ts +5 -0
  132. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +6 -2
  133. package/dist-vue/packages/components/src/chat/PkChatbot.d.ts +10 -8
  134. package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +11 -3
  135. package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +2 -2
  136. package/dist-vue/packages/components/src/chat/PkFieldChanges.d.ts +15 -0
  137. package/dist-vue/packages/components/src/chat/PkHostCallConfirmCard.d.ts +1 -2
  138. package/dist-vue/packages/components/src/chat/index.d.ts +1 -1
  139. package/dist-vue/packages/components/src/chat/utils.d.ts +18 -0
  140. package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +2 -0
  141. package/dist-vue/packages/composable/src/chatbot/appTools.d.ts +11 -5
  142. package/dist-vue/packages/composable/src/chatbot/fieldChanges.d.ts +56 -0
  143. package/dist-vue/packages/composable/src/chatbot/hostTools.d.ts +19 -0
  144. package/dist-vue/packages/composable/src/chatbot/index.d.ts +1 -0
  145. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +31 -4
  146. package/dist-vue/packages/models/src/schema/Agent.d.ts +50 -0
  147. package/dist-vue/packages/models/src/schema/Chat.d.ts +1 -0
  148. package/dist-vue/packages/models/src/schema/Organization.d.ts +9 -0
  149. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +6 -0
  150. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +6 -0
  151. package/dist-vue/style.css +1 -1
  152. package/package.json +1 -1
  153. package/dist/_chunks/Agent-BBWFD4nI.js.map +0 -1
  154. package/dist/_chunks/PkToolShowCalendarEvent-mVY2FS24.js +0 -148
  155. package/dist/_chunks/PkToolShowCalendarEvent-mVY2FS24.js.map +0 -1
  156. package/dist/_chunks/PkToolShowQrCode-e6DxEcWY.js.map +0 -1
  157. package/dist/_chunks/utils-euH8esYP.js.map +0 -1
  158. package/dist-vue/_chunks/Agent-DQl-tv4S.js.map +0 -1
  159. package/dist-vue/_chunks/PkChatbot-BRttF7Lo.js +0 -286
  160. package/dist-vue/_chunks/PkChatbot-BRttF7Lo.js.map +0 -1
  161. package/dist-vue/_chunks/PkChatbotInput-BK7f1jFE.js.map +0 -1
  162. package/dist-vue/_chunks/PkChatbotMessages-Ck0ofhtK.js +0 -1041
  163. package/dist-vue/_chunks/PkChatbotMessages-Ck0ofhtK.js.map +0 -1
  164. package/dist-vue/_chunks/PkChatbotSteps-CtKRHqaG.js +0 -189
  165. package/dist-vue/_chunks/PkChatbotSteps-CtKRHqaG.js.map +0 -1
  166. package/dist-vue/_chunks/PkChatbotViewChat-D8depeWQ.js.map +0 -1
  167. package/dist-vue/_chunks/PkToolShowCalendarEvent-BsAOYLjp.js +0 -148
  168. package/dist-vue/_chunks/PkToolShowCalendarEvent-BsAOYLjp.js.map +0 -1
  169. package/dist-vue/_chunks/PkToolShowQrCode-skWaARYV.js +0 -72
  170. package/dist-vue/_chunks/PkToolShowQrCode-skWaARYV.js.map +0 -1
  171. package/dist-vue/_chunks/createChatbotApiClient-Bukf58dz.js.map +0 -1
  172. package/dist-vue/_chunks/useChatbotStore-DcvdWkgq.js.map +0 -1
  173. package/dist-vue/_chunks/utils-B0PnU1Rk.js.map +0 -1
@@ -1,15 +1,15 @@
1
1
  import { C as e, D as t, O as n, S as r, _ as i, a, g as o, h as s, i as c, l, m as u, o as d, p as f, r as p, s as m, u as h, v as g, w as _, x as v } from "./schemas-BO5QlXAp.js";
2
- import { $ as ee, B as y, G as te, Q as ne, W as re, Y as ie, et as ae, q as oe } from "./Agent-DQl-tv4S.js";
3
- import { r as se, t as ce } from "./createChatbotApiClient-Bukf58dz.js";
4
- import { n as le } from "./src-nb8MU1sh.js";
5
- import { d as ue, r as de } from "./message-DuibQyHy.js";
6
- import { n as fe, t as pe } from "./useSafeLocalStorage-Bn4SsL8C.js";
7
- import { computed as b, getCurrentScope as me, isReadonly as he, nextTick as ge, onScopeDispose as _e, reactive as ve, ref as x, shallowRef as S, toRefs as ye, toValue as be, watch as C, watchEffect as xe } from "vue";
8
- import { useI18n as Se } from "vue-i18n";
9
- import { useDocumentVisibility as Ce, usePreferredDark as we } from "@vueuse/core";
10
- import { defineStore as Te } from "pinia";
2
+ import { $ as y, G as b, J as ee, K as te, V as ne, X as re, et as ie, tt as ae } from "./Agent-BtXBSGy6.js";
3
+ import { r as oe, t as se } from "./createChatbotApiClient-CO6l0P79.js";
4
+ import { n as ce } from "./src-nb8MU1sh.js";
5
+ import { d as le, r as ue } from "./message-DuibQyHy.js";
6
+ import { n as de, t as fe } from "./useSafeLocalStorage-Bn4SsL8C.js";
7
+ import { computed as x, getCurrentScope as pe, isReadonly as me, nextTick as he, onScopeDispose as ge, reactive as _e, ref as S, shallowRef as C, toRefs as ve, toValue as ye, watch as w, watchEffect as be } from "vue";
8
+ import { useI18n as xe } from "vue-i18n";
9
+ import { useDocumentVisibility as Se, usePreferredDark as Ce } from "@vueuse/core";
10
+ import { defineStore as we } from "pinia";
11
11
  // ../../packages/utils/src/device-context.ts
12
- function Ee() {
12
+ function Te() {
13
13
  let e = navigator.connection, t = navigator.userAgentData;
14
14
  return {
15
15
  dateTime: (/* @__PURE__ */ new Date()).toISOString(),
@@ -39,7 +39,7 @@ function Ee() {
39
39
  historyLength: window.history.length
40
40
  };
41
41
  }
42
- async function De(e) {
42
+ async function Ee(e) {
43
43
  if (!navigator.geolocation || !navigator.permissions) return null;
44
44
  try {
45
45
  if ((await navigator.permissions.query({ name: "geolocation" })).state !== "granted") return null;
@@ -57,16 +57,16 @@ async function De(e) {
57
57
  }
58
58
  }
59
59
  // ../../packages/composable/src/chatbot/hostTools.ts
60
- var Oe = "agentstudio:page-navigation", ke = (e) => typeof e?.afterOutput == "function", Ae = (e) => e.toolMetadata?.source === ne, je = (e, t) => {
60
+ var De = "agentstudio:page-navigation", Oe = (e) => typeof e?.afterOutput == "function", ke = (e) => e.toolMetadata?.source === y, Ae = (e, t) => {
61
61
  if (!t || !e?.length) return;
62
- let n = new Set(t.allowed), r = e.filter((e) => n.has(e.name) && !oe(e.name)).map(({ execute: e, confirmation: t, policy: n, ...r }) => r);
62
+ let n = new Set(t.allowed), r = e.filter((e) => n.has(e.name) && !ee(e.name)).map(({ execute: e, confirmation: t, policy: n, ...r }) => r);
63
63
  return r.length > 0 ? r : void 0;
64
64
  };
65
- function Me(e) {
65
+ function je(e) {
66
66
  let t = 0, n = 0, r = (t) => {
67
67
  n = t, e.onPendingChange?.(n);
68
68
  }, i = Promise.resolve(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), s = (e) => {
69
- ke(e) && e.abandon?.();
69
+ Oe(e) && e.abandon?.();
70
70
  }, c = (e, t) => t.requireConfirmation.includes(e.name) || t.confirmDestructive && e.annotations?.destructiveHint === !0, l = (t, n) => e.addToolOutput({
71
71
  tool: t.toolName,
72
72
  toolCallId: t.toolCallId,
@@ -80,7 +80,7 @@ function Me(e) {
80
80
  async function d(n, r) {
81
81
  let i = () => r === t, d = e.capability(), f = e.registry()?.find((e) => e.name === n.toolName), p = f?.policy?.timeoutMs ?? d?.timeoutMs;
82
82
  if (!f || p === void 0) {
83
- u(n, ee(n.readOnly));
83
+ u(n, ie(n.readOnly));
84
84
  return;
85
85
  }
86
86
  let m;
@@ -91,8 +91,9 @@ function Me(e) {
91
91
  u(n, "The host app could not prepare this call.");
92
92
  return;
93
93
  }
94
- let h = d !== void 0 && c(f, d);
95
- if (f.policy && f.confirmation ? m !== void 0 : m !== void 0 || h) {
94
+ let h = d !== void 0 && c(f, d), g = f.policy && f.confirmation ? m !== void 0 : m !== void 0 || h, _ = m?.keep === !0 || !f.policy && h && f.annotations?.destructiveHint === !0;
95
+ if (g && !_ && e.mode?.() === "automatic") m && e.onSkip?.(n, m);
96
+ else if (g) {
96
97
  let t = await e.confirm(n, m);
97
98
  if (!i()) return;
98
99
  if (!t) {
@@ -100,24 +101,24 @@ function Me(e) {
100
101
  return;
101
102
  }
102
103
  }
103
- let g = new AbortController();
104
- a.set(n.toolCallId, g), e.onActivity?.(n);
105
- let _ = setTimeout(() => g.abort(/* @__PURE__ */ Error("timeout")), p), v;
104
+ let v = new AbortController();
105
+ a.set(n.toolCallId, v), e.onActivity?.(n);
106
+ let y = setTimeout(() => v.abort(/* @__PURE__ */ Error("timeout")), p), b;
106
107
  try {
107
108
  let t = new Promise((e, t) => {
108
- g.signal.addEventListener("abort", () => t(g.signal.reason), { once: !0 });
109
+ v.signal.addEventListener("abort", () => t(v.signal.reason), { once: !0 });
109
110
  });
110
- v = Promise.resolve(f.execute(n.input, {
111
- signal: g.signal,
111
+ b = Promise.resolve(f.execute(n.input, {
112
+ signal: v.signal,
112
113
  callId: n.toolCallId,
113
114
  messageId: n.messageId
114
115
  }));
115
- let r = await Promise.race([v, t]);
116
+ let r = await Promise.race([b, t]);
116
117
  if (!i()) {
117
118
  s(r);
118
119
  return;
119
120
  }
120
- if (ke(r)) {
121
+ if (Oe(r)) {
121
122
  l(n, r.result ?? null);
122
123
  let t = !1, a = () => {
123
124
  t || (t = !0, o.delete(a), r.abandon?.());
@@ -127,11 +128,11 @@ function Me(e) {
127
128
  });
128
129
  } else l(n, r ?? null);
129
130
  } catch (e) {
130
- if (v?.then(s, () => void 0), !i()) return;
131
- let t = g.signal.aborted;
132
- u(n, t ? ee(n.readOnly) : e instanceof Error && e.message ? e.message : "The host app failed to run this call.");
131
+ if (b?.then(s, () => void 0), !i()) return;
132
+ let t = v.signal.aborted;
133
+ u(n, t ? ie(n.readOnly) : e instanceof Error && e.message ? e.message : "The host app failed to run this call.");
133
134
  } finally {
134
- clearTimeout(_), a.delete(n.toolCallId), e.onActivity?.(void 0);
135
+ clearTimeout(y), a.delete(n.toolCallId), e.onActivity?.(void 0);
135
136
  }
136
137
  }
137
138
  return {
@@ -150,65 +151,65 @@ function Me(e) {
150
151
  };
151
152
  }
152
153
  // ../../node_modules/.pnpm/@ai-sdk+provider@4.0.34/node_modules/@ai-sdk/provider/dist/index.js
153
- var Ne = "vercel.ai.error", Pe = Symbol.for(Ne), w = class e extends Error {
154
+ var Me = "vercel.ai.error", Ne = Symbol.for(Me), T = class e extends Error {
154
155
  constructor({ name: e, message: t, cause: n }) {
155
- super(t), this[Pe] = !0, this.name = e, this.cause = n;
156
+ super(t), this[Ne] = !0, this.name = e, this.cause = n;
156
157
  }
157
158
  static isInstance(t) {
158
- return e.hasMarker(t, Ne);
159
+ return e.hasMarker(t, Me);
159
160
  }
160
161
  static hasMarker(e, t) {
161
162
  let n = Symbol.for(t);
162
163
  return typeof e == "object" && !!e && n in e && typeof e[n] == "boolean" && e[n] === !0;
163
164
  }
164
- }, Fe = "AI_APICallError", Ie = `vercel.ai.error.${Fe}`, Le = Symbol.for(Ie), Re = class extends w {
165
+ }, Pe = "AI_APICallError", Fe = `vercel.ai.error.${Pe}`, Ie = Symbol.for(Fe), Le = class extends T {
165
166
  constructor({ message: e, url: t, requestBodyValues: n, statusCode: r, responseHeaders: i, responseBody: a, cause: o, isRetryable: s = r != null && (r === 408 || r === 409 || r === 429 || r >= 500), data: c }) {
166
167
  super({
167
- name: Fe,
168
+ name: Pe,
168
169
  message: e,
169
170
  cause: o
170
- }), this[Le] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
171
+ }), this[Ie] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
171
172
  }
172
173
  static isInstance(e) {
173
- return w.hasMarker(e, Ie);
174
+ return T.hasMarker(e, Fe);
174
175
  }
175
- }, ze = "AI_EmptyResponseBodyError", Be = `vercel.ai.error.${ze}`, Ve = Symbol.for(Be), He = class extends w {
176
+ }, Re = "AI_EmptyResponseBodyError", ze = `vercel.ai.error.${Re}`, Be = Symbol.for(ze), Ve = class extends T {
176
177
  constructor({ message: e = "Empty response body" } = {}) {
177
178
  super({
178
- name: ze,
179
+ name: Re,
179
180
  message: e
180
- }), this[Ve] = !0;
181
+ }), this[Be] = !0;
181
182
  }
182
183
  static isInstance(e) {
183
- return w.hasMarker(e, Be);
184
+ return T.hasMarker(e, ze);
184
185
  }
185
186
  };
186
- function T(e) {
187
+ function He(e) {
187
188
  return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.toString() : JSON.stringify(e);
188
189
  }
189
- var Ue = "AI_InvalidArgumentError", We = `vercel.ai.error.${Ue}`, E = Symbol.for(We), Ge = class extends w {
190
+ var Ue = "AI_InvalidArgumentError", E = `vercel.ai.error.${Ue}`, We = Symbol.for(E), Ge = class extends T {
190
191
  constructor({ message: e, cause: t, argument: n }) {
191
192
  super({
192
193
  name: Ue,
193
194
  message: e,
194
195
  cause: t
195
- }), this[E] = !0, this.argument = n;
196
+ }), this[We] = !0, this.argument = n;
196
197
  }
197
198
  static isInstance(e) {
198
- return w.hasMarker(e, We);
199
+ return T.hasMarker(e, E);
199
200
  }
200
- }, D = "AI_JSONParseError", Ke = `vercel.ai.error.${D}`, qe = Symbol.for(Ke), Je = class extends w {
201
+ }, D = "AI_JSONParseError", Ke = `vercel.ai.error.${D}`, qe = Symbol.for(Ke), Je = class extends T {
201
202
  constructor({ text: e, cause: t }) {
202
203
  super({
203
204
  name: D,
204
- message: `JSON parsing failed: Text: ${e}.\nError message: ${T(t)}`,
205
+ message: `JSON parsing failed: Text: ${e}.\nError message: ${He(t)}`,
205
206
  cause: t
206
207
  }), this[qe] = !0, this.text = e;
207
208
  }
208
209
  static isInstance(e) {
209
- return w.hasMarker(e, Ke);
210
+ return T.hasMarker(e, Ke);
210
211
  }
211
- }, Ye = "AI_TypeValidationError", Xe = `vercel.ai.error.${Ye}`, Ze = Symbol.for(Xe), O = class e extends w {
212
+ }, Ye = "AI_TypeValidationError", Xe = `vercel.ai.error.${Ye}`, Ze = Symbol.for(Xe), Qe = class e extends T {
212
213
  constructor({ value: e, cause: t, context: n }) {
213
214
  let r = "Type validation failed";
214
215
  if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
@@ -218,12 +219,12 @@ var Ue = "AI_InvalidArgumentError", We = `vercel.ai.error.${Ue}`, E = Symbol.for
218
219
  }
219
220
  super({
220
221
  name: Ye,
221
- message: `${r}: Value: ${JSON.stringify(e)}.\nError message: ${T(t)}`,
222
+ message: `${r}: Value: ${JSON.stringify(e)}.\nError message: ${He(t)}`,
222
223
  cause: t
223
224
  }), this[Ze] = !0, this.value = e, this.context = n;
224
225
  }
225
226
  static isInstance(e) {
226
- return w.hasMarker(e, Xe);
227
+ return T.hasMarker(e, Xe);
227
228
  }
228
229
  static wrap({ value: t, cause: n, context: r }) {
229
230
  return e.isInstance(n) && n.value === t && n.context?.field === r?.field && n.context?.entityName === r?.entityName && n.context?.entityId === r?.entityId ? n : new e({
@@ -232,25 +233,25 @@ var Ue = "AI_InvalidArgumentError", We = `vercel.ai.error.${Ue}`, E = Symbol.for
232
233
  context: r
233
234
  });
234
235
  }
235
- }, Qe = "AI_UnsupportedFunctionalityError", $e = `vercel.ai.error.${Qe}`, et = Symbol.for($e), tt = class extends w {
236
+ }, $e = "AI_UnsupportedFunctionalityError", et = `vercel.ai.error.${$e}`, tt = Symbol.for(et), nt = class extends T {
236
237
  constructor({ functionality: e, message: t = `'${e}' functionality not supported.` }) {
237
238
  super({
238
- name: Qe,
239
+ name: $e,
239
240
  message: t
240
- }), this[et] = !0, this.functionality = e;
241
+ }), this[tt] = !0, this.functionality = e;
241
242
  }
242
243
  static isInstance(e) {
243
- return w.hasMarker(e, $e);
244
+ return T.hasMarker(e, et);
244
245
  }
245
- }, k = class extends Error {
246
+ }, rt = class extends Error {
246
247
  constructor(e, t) {
247
248
  super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
248
249
  }
249
- }, nt = 10, rt = 13, it = 32;
250
- function A(e) {}
251
- function at(e) {
250
+ }, it = 10, at = 13, ot = 32;
251
+ function st(e) {}
252
+ function ct(e) {
252
253
  if (typeof e == "function") throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");
253
- let { onEvent: t = A, onError: n = A, onRetry: r = A, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
254
+ let { onEvent: t = st, onError: n = st, onRetry: r = st, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
254
255
  function m(e) {
255
256
  if (p) throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");
256
257
  if (c && (c = !1, e.charCodeAt(0) === 239 && e.charCodeAt(1) === 187 && e.charCodeAt(2) === 191 && (e = e.slice(3))), o.length === 0) {
@@ -269,7 +270,7 @@ function at(e) {
269
270
  n !== "" && (o.push(n), s = n.length), h();
270
271
  }
271
272
  function h() {
272
- a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new k(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
273
+ a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new rt(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
273
274
  }
274
275
  function g(e) {
275
276
  let n = 0;
@@ -285,9 +286,9 @@ function at(e) {
285
286
  continue;
286
287
  }
287
288
  let i = e.charCodeAt(n);
288
- if (ot(e, n, i)) {
289
- let i = e.charCodeAt(n + 5) === it ? n + 6 : n + 5, a = e.slice(i, r);
290
- if (d === 0 && e.charCodeAt(r + 1) === nt) {
289
+ if (O(e, n, i)) {
290
+ let i = e.charCodeAt(n + 5) === ot ? n + 6 : n + 5, a = e.slice(i, r);
291
+ if (d === 0 && e.charCodeAt(r + 1) === it) {
291
292
  t({
292
293
  id: l,
293
294
  event: f,
@@ -297,7 +298,7 @@ function at(e) {
297
298
  }
298
299
  u = d === 0 ? a : `${u}
299
300
  ${a}`, d++;
300
- } else st(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === it ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
301
+ } else lt(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === ot ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
301
302
  n = r + 1, r = e.indexOf("\n", n);
302
303
  }
303
304
  return e.slice(n);
@@ -305,35 +306,35 @@ ${a}`, d++;
305
306
  for (; n < e.length;) {
306
307
  let t = e.indexOf("\r", n), r = e.indexOf("\n", n), i = -1;
307
308
  if (t !== -1 && r !== -1 ? i = t < r ? t : r : t === -1 ? r !== -1 && (i = r) : i = t === e.length - 1 ? -1 : t, i === -1) break;
308
- _(e, n, i), n = i + 1, e.charCodeAt(n - 1) === rt && e.charCodeAt(n) === nt && n++;
309
+ _(e, n, i), n = i + 1, e.charCodeAt(n - 1) === at && e.charCodeAt(n) === it && n++;
309
310
  }
310
311
  return e.slice(n);
311
312
  }
312
313
  function _(e, t, n) {
313
314
  if (t === n) {
314
- ee();
315
+ y();
315
316
  return;
316
317
  }
317
318
  let r = e.charCodeAt(t);
318
- if (ot(e, t, r)) {
319
- let r = e.charCodeAt(t + 5) === it ? t + 6 : t + 5, i = e.slice(r, n);
319
+ if (O(e, t, r)) {
320
+ let r = e.charCodeAt(t + 5) === ot ? t + 6 : t + 5, i = e.slice(r, n);
320
321
  u = d === 0 ? i : `${u}
321
322
  ${i}`, d++;
322
323
  return;
323
324
  }
324
- if (st(e, t, r)) {
325
- f = e.slice(e.charCodeAt(t + 6) === it ? t + 7 : t + 6, n) || void 0;
325
+ if (lt(e, t, r)) {
326
+ f = e.slice(e.charCodeAt(t + 6) === ot ? t + 7 : t + 6, n) || void 0;
326
327
  return;
327
328
  }
328
329
  if (r === 105 && e.charCodeAt(t + 1) === 100 && e.charCodeAt(t + 2) === 58) {
329
- let r = e.slice(e.charCodeAt(t + 3) === it ? t + 4 : t + 3, n);
330
+ let r = e.slice(e.charCodeAt(t + 3) === ot ? t + 4 : t + 3, n);
330
331
  l = r.includes("\0") ? void 0 : r;
331
332
  return;
332
333
  }
333
334
  if (r === 58) {
334
335
  if (i) {
335
336
  let r = e.slice(t, n);
336
- i(r.slice(e.charCodeAt(t + 1) === it ? 2 : 1));
337
+ i(r.slice(e.charCodeAt(t + 1) === ot ? 2 : 1));
337
338
  }
338
339
  return;
339
340
  }
@@ -342,7 +343,7 @@ ${i}`, d++;
342
343
  v(a, "", a);
343
344
  return;
344
345
  }
345
- let s = a.slice(0, o), c = a.charCodeAt(o + 1) === it ? 2 : 1;
346
+ let s = a.slice(0, o), c = a.charCodeAt(o + 1) === ot ? 2 : 1;
346
347
  v(s, a.slice(o + c), a);
347
348
  }
348
349
  function v(e, t, i) {
@@ -358,13 +359,13 @@ ${t}`, d++;
358
359
  l = t.includes("\0") ? void 0 : t;
359
360
  break;
360
361
  case "retry":
361
- /^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new k(`Invalid \`retry\` value: "${t}"`, {
362
+ /^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new rt(`Invalid \`retry\` value: "${t}"`, {
362
363
  type: "invalid-retry",
363
364
  value: t,
364
365
  line: i
365
366
  }));
366
367
  break;
367
- default: n(new k(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
368
+ default: n(new rt(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
368
369
  type: "unknown-field",
369
370
  field: e,
370
371
  value: t,
@@ -372,14 +373,14 @@ ${t}`, d++;
372
373
  }));
373
374
  }
374
375
  }
375
- function ee() {
376
+ function y() {
376
377
  d > 0 && t({
377
378
  id: l,
378
379
  event: f,
379
380
  data: u
380
381
  }), l = void 0, u = "", d = 0, f = void 0;
381
382
  }
382
- function y(e = {}) {
383
+ function b(e = {}) {
383
384
  if (e.consume && o.length > 0) {
384
385
  let e = o.join("");
385
386
  _(e, 0, e.length);
@@ -388,22 +389,22 @@ ${t}`, d++;
388
389
  }
389
390
  return {
390
391
  feed: m,
391
- reset: y
392
+ reset: b
392
393
  };
393
394
  }
394
- function ot(e, t, n) {
395
+ function O(e, t, n) {
395
396
  return n === 100 && e.charCodeAt(t + 1) === 97 && e.charCodeAt(t + 2) === 116 && e.charCodeAt(t + 3) === 97 && e.charCodeAt(t + 4) === 58;
396
397
  }
397
- function st(e, t, n) {
398
+ function lt(e, t, n) {
398
399
  return n === 101 && e.charCodeAt(t + 1) === 118 && e.charCodeAt(t + 2) === 101 && e.charCodeAt(t + 3) === 110 && e.charCodeAt(t + 4) === 116 && e.charCodeAt(t + 5) === 58;
399
400
  }
400
401
  // ../../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
401
- var ct = class extends TransformStream {
402
+ var ut = class extends TransformStream {
402
403
  constructor({ onError: e, onRetry: t, onComment: n, maxBufferSize: r } = {}) {
403
404
  let i;
404
405
  super({
405
406
  start(a) {
406
- i = at({
407
+ i = ct({
407
408
  onEvent: (e) => {
408
409
  a.enqueue(e);
409
410
  },
@@ -422,8 +423,8 @@ var ct = class extends TransformStream {
422
423
  }
423
424
  };
424
425
  new TextDecoder();
425
- var { btoa: lt, atob: ut } = globalThis;
426
- function dt(e) {
426
+ var { btoa: dt, atob: k } = globalThis;
427
+ function ft(e) {
427
428
  if (e == null) return {};
428
429
  let t = {};
429
430
  if (e instanceof Headers) e.forEach((e, n) => {
@@ -435,7 +436,7 @@ function dt(e) {
435
436
  }
436
437
  return t;
437
438
  }
438
- var j = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
439
+ var A = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
439
440
  let i = () => {
440
441
  let e = n.length, r = Array(t);
441
442
  for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0];
@@ -447,16 +448,16 @@ var j = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRS
447
448
  message: `The separator "${r}" must not be part of the alphabet "${n}".`
448
449
  });
449
450
  return () => `${e}${r}${i()}`;
450
- }, ft = j();
451
- function pt(e) {
451
+ }, pt = A();
452
+ function mt(e) {
452
453
  return globalThis.Buffer?.isBuffer(e) ?? !1;
453
454
  }
454
- var mt = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, ht = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
455
- function gt(e) {
455
+ var ht = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, gt = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
456
+ function _t(e) {
456
457
  let t = JSON.parse(e);
457
- return typeof t != "object" || !t || mt.test(e) === !1 && ht.test(e) === !1 ? t : _t(t);
458
+ return typeof t != "object" || !t || ht.test(e) === !1 && gt.test(e) === !1 ? t : j(t);
458
459
  }
459
- function _t(e) {
460
+ function j(e) {
460
461
  let t = [e];
461
462
  for (; t.length;) {
462
463
  let e = t;
@@ -476,10 +477,10 @@ function vt(e) {
476
477
  try {
477
478
  Error.stackTraceLimit = 0;
478
479
  } catch {
479
- return gt(e);
480
+ return _t(e);
480
481
  }
481
482
  try {
482
- return gt(e);
483
+ return _t(e);
483
484
  } finally {
484
485
  Error.stackTraceLimit = t;
485
486
  }
@@ -529,14 +530,14 @@ var bt = Symbol("Let zodToJsonSchema decide on which parser to use"), xt = {
529
530
  function N() {
530
531
  return {};
531
532
  }
532
- function P(e, t) {
533
+ function Ct(e, t) {
533
534
  let n = { type: "array" };
534
- return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = G(e.type._def, {
535
+ return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = q(e.type._def, {
535
536
  ...t,
536
537
  currentPath: [...t.currentPath, "items"]
537
538
  })), e.minLength && (n.minItems = e.minLength.value), e.maxLength && (n.maxItems = e.maxLength.value), e.exactLength && (n.minItems = e.exactLength.value, n.maxItems = e.exactLength.value), n;
538
539
  }
539
- function F(e) {
540
+ function wt(e) {
540
541
  let t = {
541
542
  type: "integer",
542
543
  format: "int64"
@@ -553,16 +554,16 @@ function F(e) {
553
554
  }
554
555
  return t;
555
556
  }
556
- function Ct() {
557
+ function Tt() {
557
558
  return { type: "boolean" };
558
559
  }
559
- function wt(e, t) {
560
- return G(e.type._def, t);
560
+ function P(e, t) {
561
+ return q(e.type._def, t);
561
562
  }
562
- var Tt = (e, t) => G(e.innerType._def, t);
563
- function Et(e, t, n) {
563
+ var Et = (e, t) => q(e.innerType._def, t);
564
+ function Dt(e, t, n) {
564
565
  let r = n ?? t.dateStrategy;
565
- if (Array.isArray(r)) return { anyOf: r.map((n) => Et(e, t, n)) };
566
+ if (Array.isArray(r)) return { anyOf: r.map((n) => Dt(e, t, n)) };
566
567
  switch (r) {
567
568
  case "string":
568
569
  case "format:date-time": return {
@@ -573,10 +574,10 @@ function Et(e, t, n) {
573
574
  type: "string",
574
575
  format: "date"
575
576
  };
576
- case "integer": return Dt(e);
577
+ case "integer": return Ot(e);
577
578
  }
578
579
  }
579
- var Dt = (e) => {
580
+ var Ot = (e) => {
580
581
  let t = {
581
582
  type: "integer",
582
583
  format: "unix-time"
@@ -589,31 +590,31 @@ var Dt = (e) => {
589
590
  }
590
591
  return t;
591
592
  };
592
- function Ot(e, t) {
593
+ function F(e, t) {
593
594
  return {
594
- ...G(e.innerType._def, t),
595
+ ...q(e.innerType._def, t),
595
596
  default: e.defaultValue()
596
597
  };
597
598
  }
598
599
  function I(e, t) {
599
- return t.effectStrategy === "input" ? G(e.schema._def, t) : N();
600
+ return t.effectStrategy === "input" ? q(e.schema._def, t) : N();
600
601
  }
601
- function kt(e) {
602
+ function L(e) {
602
603
  return {
603
604
  type: "string",
604
605
  enum: Array.from(e.values)
605
606
  };
606
607
  }
607
- var At = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
608
- function jt(e, t) {
609
- let n = [G(e.left._def, {
608
+ var kt = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
609
+ function At(e, t) {
610
+ let n = [q(e.left._def, {
610
611
  ...t,
611
612
  currentPath: [
612
613
  ...t.currentPath,
613
614
  "allOf",
614
615
  "0"
615
616
  ]
616
- }), G(e.right._def, {
617
+ }), q(e.right._def, {
617
618
  ...t,
618
619
  currentPath: [
619
620
  ...t.currentPath,
@@ -622,7 +623,7 @@ function jt(e, t) {
622
623
  ]
623
624
  })].filter((e) => !!e), r = [];
624
625
  return n.forEach((e) => {
625
- if (At(e)) r.push(...e.allOf);
626
+ if (kt(e)) r.push(...e.allOf);
626
627
  else {
627
628
  let t = e;
628
629
  if ("additionalProperties" in e && e.additionalProperties === !1) {
@@ -633,19 +634,19 @@ function jt(e, t) {
633
634
  }
634
635
  }), r.length ? { allOf: r } : void 0;
635
636
  }
636
- function Mt(e) {
637
+ function jt(e) {
637
638
  let t = typeof e.value;
638
639
  return t !== "bigint" && t !== "number" && t !== "boolean" && t !== "string" ? { type: Array.isArray(e.value) ? "array" : "object" } : {
639
640
  type: t === "bigint" ? "integer" : t,
640
641
  const: e.value
641
642
  };
642
643
  }
643
- var Nt = void 0, L = {
644
+ var Mt = void 0, R = {
644
645
  cuid: /^[cC][^\s-]{8,}$/,
645
646
  cuid2: /^[0-9a-z]+$/,
646
647
  ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
647
648
  email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}$/,
648
- emoji: () => (Nt === void 0 && (Nt = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), Nt),
649
+ emoji: () => (Mt === void 0 && (Mt = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), Mt),
649
650
  uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
650
651
  ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
651
652
  ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
@@ -656,7 +657,7 @@ var Nt = void 0, L = {
656
657
  nanoid: /^[a-zA-Z0-9_-]{21}$/,
657
658
  jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
658
659
  };
659
- function R(e, t) {
660
+ function Nt(e, t) {
660
661
  let n = { type: "string" };
661
662
  if (e.checks) for (let r of e.checks) switch (r.kind) {
662
663
  case "min":
@@ -668,108 +669,108 @@ function R(e, t) {
668
669
  case "email":
669
670
  switch (t.emailStrategy) {
670
671
  case "format:email":
671
- z(n, "email", r.message, t);
672
+ B(n, "email", r.message, t);
672
673
  break;
673
674
  case "format:idn-email":
674
- z(n, "idn-email", r.message, t);
675
+ B(n, "idn-email", r.message, t);
675
676
  break;
676
- case "pattern:zod": B(n, L.email, r.message, t);
677
+ case "pattern:zod": V(n, R.email, r.message, t);
677
678
  }
678
679
  break;
679
680
  case "url":
680
- z(n, "uri", r.message, t);
681
+ B(n, "uri", r.message, t);
681
682
  break;
682
683
  case "uuid":
683
- z(n, "uuid", r.message, t);
684
+ B(n, "uuid", r.message, t);
684
685
  break;
685
686
  case "regex":
686
- B(n, r.regex, r.message, t);
687
+ V(n, r.regex, r.message, t);
687
688
  break;
688
689
  case "cuid":
689
- B(n, L.cuid, r.message, t);
690
+ V(n, R.cuid, r.message, t);
690
691
  break;
691
692
  case "cuid2":
692
- B(n, L.cuid2, r.message, t);
693
+ V(n, R.cuid2, r.message, t);
693
694
  break;
694
695
  case "startsWith":
695
- B(n, RegExp(`^${Pt(r.value, t)}`), r.message, t);
696
+ V(n, RegExp(`^${z(r.value, t)}`), r.message, t);
696
697
  break;
697
698
  case "endsWith":
698
- B(n, RegExp(`${Pt(r.value, t)}$`), r.message, t);
699
+ V(n, RegExp(`${z(r.value, t)}$`), r.message, t);
699
700
  break;
700
701
  case "datetime":
701
- z(n, "date-time", r.message, t);
702
+ B(n, "date-time", r.message, t);
702
703
  break;
703
704
  case "date":
704
- z(n, "date", r.message, t);
705
+ B(n, "date", r.message, t);
705
706
  break;
706
707
  case "time":
707
- z(n, "time", r.message, t);
708
+ B(n, "time", r.message, t);
708
709
  break;
709
710
  case "duration":
710
- z(n, "duration", r.message, t);
711
+ B(n, "duration", r.message, t);
711
712
  break;
712
713
  case "length":
713
714
  n.minLength = typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, n.maxLength = typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value;
714
715
  break;
715
716
  case "includes":
716
- B(n, RegExp(Pt(r.value, t)), r.message, t);
717
+ V(n, RegExp(z(r.value, t)), r.message, t);
717
718
  break;
718
719
  case "ip":
719
- r.version !== "v6" && z(n, "ipv4", r.message, t), r.version !== "v4" && z(n, "ipv6", r.message, t);
720
+ r.version !== "v6" && B(n, "ipv4", r.message, t), r.version !== "v4" && B(n, "ipv6", r.message, t);
720
721
  break;
721
722
  case "base64url":
722
- B(n, L.base64url, r.message, t);
723
+ V(n, R.base64url, r.message, t);
723
724
  break;
724
725
  case "jwt":
725
- B(n, L.jwt, r.message, t);
726
+ V(n, R.jwt, r.message, t);
726
727
  break;
727
728
  case "cidr":
728
- r.version !== "v6" && B(n, L.ipv4Cidr, r.message, t), r.version !== "v4" && B(n, L.ipv6Cidr, r.message, t);
729
+ r.version !== "v6" && V(n, R.ipv4Cidr, r.message, t), r.version !== "v4" && V(n, R.ipv6Cidr, r.message, t);
729
730
  break;
730
731
  case "emoji":
731
- B(n, L.emoji(), r.message, t);
732
+ V(n, R.emoji(), r.message, t);
732
733
  break;
733
734
  case "ulid":
734
- B(n, L.ulid, r.message, t);
735
+ V(n, R.ulid, r.message, t);
735
736
  break;
736
737
  case "base64":
737
738
  switch (t.base64Strategy) {
738
739
  case "format:binary":
739
- z(n, "binary", r.message, t);
740
+ B(n, "binary", r.message, t);
740
741
  break;
741
742
  case "contentEncoding:base64":
742
743
  n.contentEncoding = "base64";
743
744
  break;
744
- case "pattern:zod": B(n, L.base64, r.message, t);
745
+ case "pattern:zod": V(n, R.base64, r.message, t);
745
746
  }
746
747
  break;
747
- case "nanoid": B(n, L.nanoid, r.message, t);
748
+ case "nanoid": V(n, R.nanoid, r.message, t);
748
749
  }
749
750
  return n;
750
751
  }
751
- function Pt(e, t) {
752
- return t.patternStrategy === "escape" ? It(e) : e;
752
+ function z(e, t) {
753
+ return t.patternStrategy === "escape" ? Ft(e) : e;
753
754
  }
754
- var Ft = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
755
- function It(e) {
755
+ var Pt = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
756
+ function Ft(e) {
756
757
  let t = "";
757
- for (let n = 0; n < e.length; n++) Ft.has(e[n]) || (t += "\\"), t += e[n];
758
+ for (let n = 0; n < e.length; n++) Pt.has(e[n]) || (t += "\\"), t += e[n];
758
759
  return t;
759
760
  }
760
- function z(e, t, n, r) {
761
+ function B(e, t, n, r) {
761
762
  e.format || e.anyOf?.some((e) => e.format) ? (e.anyOf ||= [], e.format && (e.anyOf.push({ format: e.format }), delete e.format), e.anyOf.push({
762
763
  format: t,
763
764
  ...n && r.errorMessages && { errorMessage: { format: n } }
764
765
  })) : e.format = t;
765
766
  }
766
- function B(e, t, n, r) {
767
+ function V(e, t, n, r) {
767
768
  e.pattern || e.allOf?.some((e) => e.pattern) ? (e.allOf ||= [], e.pattern && (e.allOf.push({ pattern: e.pattern }), delete e.pattern), e.allOf.push({
768
- pattern: V(t, r),
769
+ pattern: It(t, r),
769
770
  ...n && r.errorMessages && { errorMessage: { pattern: n } }
770
- })) : e.pattern = V(t, r);
771
+ })) : e.pattern = It(t, r);
771
772
  }
772
- function V(e, t) {
773
+ function It(e, t) {
773
774
  if (!t.applyRegexFlags || !e.flags) return e.source;
774
775
  let n = {
775
776
  i: e.flags.includes("i"),
@@ -811,13 +812,13 @@ function V(e, t) {
811
812
  function Lt(e, t) {
812
813
  let n = {
813
814
  type: "object",
814
- additionalProperties: G(e.valueType._def, {
815
+ additionalProperties: q(e.valueType._def, {
815
816
  ...t,
816
817
  currentPath: [...t.currentPath, "additionalProperties"]
817
818
  }) ?? t.allowedAdditionalProperties
818
819
  };
819
820
  if (e.keyType?._def.typeName === "ZodString" && e.keyType._def.checks?.length) {
820
- let { type: r, ...i } = R(e.keyType._def, t);
821
+ let { type: r, ...i } = Nt(e.keyType._def, t);
821
822
  return {
822
823
  ...n,
823
824
  propertyNames: i
@@ -828,7 +829,7 @@ function Lt(e, t) {
828
829
  propertyNames: { enum: e.keyType._def.values }
829
830
  };
830
831
  if (e.keyType?._def.typeName === "ZodBranded" && e.keyType._def.type._def.typeName === "ZodString" && e.keyType._def.type._def.checks?.length) {
831
- let { type: r, ...i } = wt(e.keyType._def, t);
832
+ let { type: r, ...i } = P(e.keyType._def, t);
832
833
  return {
833
834
  ...n,
834
835
  propertyNames: i
@@ -836,13 +837,13 @@ function Lt(e, t) {
836
837
  }
837
838
  return n;
838
839
  }
839
- function Rt(e, t) {
840
+ function H(e, t) {
840
841
  return t.mapStrategy === "record" ? Lt(e, t) : {
841
842
  type: "array",
842
843
  maxItems: 125,
843
844
  items: {
844
845
  type: "array",
845
- items: [G(e.keyType._def, {
846
+ items: [q(e.keyType._def, {
846
847
  ...t,
847
848
  currentPath: [
848
849
  ...t.currentPath,
@@ -850,7 +851,7 @@ function Rt(e, t) {
850
851
  "items",
851
852
  "0"
852
853
  ]
853
- }) || N(), G(e.valueType._def, {
854
+ }) || N(), q(e.valueType._def, {
854
855
  ...t,
855
856
  currentPath: [
856
857
  ...t.currentPath,
@@ -864,31 +865,31 @@ function Rt(e, t) {
864
865
  }
865
866
  };
866
867
  }
867
- function zt(e) {
868
+ function Rt(e) {
868
869
  let t = e.values, n = Object.keys(e.values).filter((e) => typeof t[t[e]] != "number").map((e) => t[e]), r = Array.from(new Set(n.map((e) => typeof e)));
869
870
  return {
870
871
  type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
871
872
  enum: n
872
873
  };
873
874
  }
874
- function Bt() {
875
+ function zt() {
875
876
  return { not: N() };
876
877
  }
877
- function Vt() {
878
+ function Bt() {
878
879
  return { type: "null" };
879
880
  }
880
- var Ht = {
881
+ var Vt = {
881
882
  ZodString: "string",
882
883
  ZodNumber: "number",
883
884
  ZodBigInt: "integer",
884
885
  ZodBoolean: "boolean",
885
886
  ZodNull: "null"
886
887
  };
887
- function Ut(e, t) {
888
+ function Ht(e, t) {
888
889
  let n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
889
- if (n.every((e) => e._def.typeName in Ht && (!e._def.checks || !e._def.checks.length))) {
890
+ if (n.every((e) => e._def.typeName in Vt && (!e._def.checks || !e._def.checks.length))) {
890
891
  let e = n.reduce((e, t) => {
891
- let n = Ht[t._def.typeName];
892
+ let n = Vt[t._def.typeName];
892
893
  return n && !e.includes(n) ? [...e, n] : e;
893
894
  }, []);
894
895
  return { type: e.length > 1 ? e : e[0] };
@@ -916,10 +917,10 @@ function Ut(e, t) {
916
917
  type: "string",
917
918
  enum: n.reduce((e, t) => [...e, ...t._def.values.filter((t) => !e.includes(t))], [])
918
919
  };
919
- return Wt(e, t);
920
+ return U(e, t);
920
921
  }
921
- var Wt = (e, t) => {
922
- let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => G(e._def, {
922
+ var U = (e, t) => {
923
+ let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => q(e._def, {
923
924
  ...t,
924
925
  currentPath: [
925
926
  ...t.currentPath,
@@ -929,15 +930,15 @@ var Wt = (e, t) => {
929
930
  })).filter((e) => !!e && (!t.strictUnions || typeof e == "object" && Object.keys(e).length > 0));
930
931
  return n.length ? { anyOf: n } : void 0;
931
932
  };
932
- function Gt(e, t) {
933
+ function Ut(e, t) {
933
934
  if ([
934
935
  "ZodString",
935
936
  "ZodNumber",
936
937
  "ZodBigInt",
937
938
  "ZodBoolean",
938
939
  "ZodNull"
939
- ].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [Ht[e.innerType._def.typeName], "null"] };
940
- let n = G(e.innerType._def, {
940
+ ].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [Vt[e.innerType._def.typeName], "null"] };
941
+ let n = q(e.innerType._def, {
941
942
  ...t,
942
943
  currentPath: [
943
944
  ...t.currentPath,
@@ -947,7 +948,7 @@ function Gt(e, t) {
947
948
  });
948
949
  return n && { anyOf: [n, { type: "null" }] };
949
950
  }
950
- function Kt(e) {
951
+ function Wt(e) {
951
952
  let t = { type: "number" };
952
953
  if (!e.checks) return t;
953
954
  for (let n of e.checks) switch (n.kind) {
@@ -964,7 +965,7 @@ function Kt(e) {
964
965
  }
965
966
  return t;
966
967
  }
967
- function qt(e, t) {
968
+ function Gt(e, t) {
968
969
  let n = {
969
970
  type: "object",
970
971
  properties: {}
@@ -972,7 +973,7 @@ function qt(e, t) {
972
973
  for (let e in i) {
973
974
  let a = i[e];
974
975
  if (a === void 0 || a._def === void 0) continue;
975
- let o = U(a), s = G(a._def, {
976
+ let o = qt(a), s = q(a._def, {
976
977
  ...t,
977
978
  currentPath: [
978
979
  ...t.currentPath,
@@ -988,11 +989,11 @@ function qt(e, t) {
988
989
  s !== void 0 && (n.properties[e] = s, o || r.push(e));
989
990
  }
990
991
  r.length && (n.required = r);
991
- let a = H(e, t);
992
+ let a = Kt(e, t);
992
993
  return a !== void 0 && (n.additionalProperties = a), n;
993
994
  }
994
- function H(e, t) {
995
- if (e.catchall._def.typeName !== "ZodNever") return G(e.catchall._def, {
995
+ function Kt(e, t) {
996
+ if (e.catchall._def.typeName !== "ZodNever") return q(e.catchall._def, {
996
997
  ...t,
997
998
  currentPath: [...t.currentPath, "additionalProperties"]
998
999
  });
@@ -1002,16 +1003,16 @@ function H(e, t) {
1002
1003
  case "strip": return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
1003
1004
  }
1004
1005
  }
1005
- function U(e) {
1006
+ function qt(e) {
1006
1007
  try {
1007
1008
  return e.isOptional();
1008
1009
  } catch {
1009
1010
  return !0;
1010
1011
  }
1011
1012
  }
1012
- var W = (e, t) => {
1013
- if (t.currentPath.toString() === t.propertyPath?.toString()) return G(e.innerType._def, t);
1014
- let n = G(e.innerType._def, {
1013
+ var Jt = (e, t) => {
1014
+ if (t.currentPath.toString() === t.propertyPath?.toString()) return q(e.innerType._def, t);
1015
+ let n = q(e.innerType._def, {
1015
1016
  ...t,
1016
1017
  currentPath: [
1017
1018
  ...t.currentPath,
@@ -1020,10 +1021,10 @@ var W = (e, t) => {
1020
1021
  ]
1021
1022
  });
1022
1023
  return n ? { anyOf: [{ not: N() }, n] } : N();
1023
- }, Jt = (e, t) => {
1024
- if (t.pipeStrategy === "input") return G(e.in._def, t);
1025
- if (t.pipeStrategy === "output") return G(e.out._def, t);
1026
- let n = G(e.in._def, {
1024
+ }, Yt = (e, t) => {
1025
+ if (t.pipeStrategy === "input") return q(e.in._def, t);
1026
+ if (t.pipeStrategy === "output") return q(e.out._def, t);
1027
+ let n = q(e.in._def, {
1027
1028
  ...t,
1028
1029
  currentPath: [
1029
1030
  ...t.currentPath,
@@ -1031,7 +1032,7 @@ var W = (e, t) => {
1031
1032
  "0"
1032
1033
  ]
1033
1034
  });
1034
- return { allOf: [n, G(e.out._def, {
1035
+ return { allOf: [n, q(e.out._def, {
1035
1036
  ...t,
1036
1037
  currentPath: [
1037
1038
  ...t.currentPath,
@@ -1040,25 +1041,25 @@ var W = (e, t) => {
1040
1041
  ]
1041
1042
  })].filter((e) => e !== void 0) };
1042
1043
  };
1043
- function Yt(e, t) {
1044
- return G(e.type._def, t);
1045
- }
1046
1044
  function Xt(e, t) {
1045
+ return q(e.type._def, t);
1046
+ }
1047
+ function Zt(e, t) {
1047
1048
  let n = {
1048
1049
  type: "array",
1049
1050
  uniqueItems: !0,
1050
- items: G(e.valueType._def, {
1051
+ items: q(e.valueType._def, {
1051
1052
  ...t,
1052
1053
  currentPath: [...t.currentPath, "items"]
1053
1054
  })
1054
1055
  };
1055
1056
  return e.minSize && (n.minItems = e.minSize.value), e.maxSize && (n.maxItems = e.maxSize.value), n;
1056
1057
  }
1057
- function Zt(e, t) {
1058
+ function Qt(e, t) {
1058
1059
  return e.rest ? {
1059
1060
  type: "array",
1060
1061
  minItems: e.items.length,
1061
- items: e.items.map((e, n) => G(e._def, {
1062
+ items: e.items.map((e, n) => q(e._def, {
1062
1063
  ...t,
1063
1064
  currentPath: [
1064
1065
  ...t.currentPath,
@@ -1066,7 +1067,7 @@ function Zt(e, t) {
1066
1067
  `${n}`
1067
1068
  ]
1068
1069
  })).reduce((e, t) => t === void 0 ? e : [...e, t], []),
1069
- additionalItems: G(e.rest._def, {
1070
+ additionalItems: q(e.rest._def, {
1070
1071
  ...t,
1071
1072
  currentPath: [...t.currentPath, "additionalItems"]
1072
1073
  })
@@ -1074,7 +1075,7 @@ function Zt(e, t) {
1074
1075
  type: "array",
1075
1076
  minItems: e.items.length,
1076
1077
  maxItems: e.items.length,
1077
- items: e.items.map((e, n) => G(e._def, {
1078
+ items: e.items.map((e, n) => q(e._def, {
1078
1079
  ...t,
1079
1080
  currentPath: [
1080
1081
  ...t.currentPath,
@@ -1084,47 +1085,47 @@ function Zt(e, t) {
1084
1085
  })).reduce((e, t) => t === void 0 ? e : [...e, t], [])
1085
1086
  };
1086
1087
  }
1087
- function Qt() {
1088
+ function $t() {
1088
1089
  return { not: N() };
1089
1090
  }
1090
- function $t() {
1091
+ function W() {
1091
1092
  return N();
1092
1093
  }
1093
- var en = (e, t) => G(e.innerType._def, t), tn = (e, t, n) => {
1094
+ var G = (e, t) => q(e.innerType._def, t), K = (e, t, n) => {
1094
1095
  switch (t) {
1095
- case "ZodString": return R(e, n);
1096
- case "ZodNumber": return Kt(e);
1097
- case "ZodObject": return qt(e, n);
1098
- case "ZodBigInt": return F(e);
1099
- case "ZodBoolean": return Ct();
1100
- case "ZodDate": return Et(e, n);
1101
- case "ZodUndefined": return Qt();
1102
- case "ZodNull": return Vt();
1103
- case "ZodArray": return P(e, n);
1096
+ case "ZodString": return Nt(e, n);
1097
+ case "ZodNumber": return Wt(e);
1098
+ case "ZodObject": return Gt(e, n);
1099
+ case "ZodBigInt": return wt(e);
1100
+ case "ZodBoolean": return Tt();
1101
+ case "ZodDate": return Dt(e, n);
1102
+ case "ZodUndefined": return $t();
1103
+ case "ZodNull": return Bt();
1104
+ case "ZodArray": return Ct(e, n);
1104
1105
  case "ZodUnion":
1105
- case "ZodDiscriminatedUnion": return Ut(e, n);
1106
- case "ZodIntersection": return jt(e, n);
1107
- case "ZodTuple": return Zt(e, n);
1106
+ case "ZodDiscriminatedUnion": return Ht(e, n);
1107
+ case "ZodIntersection": return At(e, n);
1108
+ case "ZodTuple": return Qt(e, n);
1108
1109
  case "ZodRecord": return Lt(e, n);
1109
- case "ZodLiteral": return Mt(e);
1110
- case "ZodEnum": return kt(e);
1111
- case "ZodNativeEnum": return zt(e);
1112
- case "ZodNullable": return Gt(e, n);
1113
- case "ZodOptional": return W(e, n);
1114
- case "ZodMap": return Rt(e, n);
1115
- case "ZodSet": return Xt(e, n);
1110
+ case "ZodLiteral": return jt(e);
1111
+ case "ZodEnum": return L(e);
1112
+ case "ZodNativeEnum": return Rt(e);
1113
+ case "ZodNullable": return Ut(e, n);
1114
+ case "ZodOptional": return Jt(e, n);
1115
+ case "ZodMap": return H(e, n);
1116
+ case "ZodSet": return Zt(e, n);
1116
1117
  case "ZodLazy": return () => e.getter()._def;
1117
- case "ZodPromise": return Yt(e, n);
1118
+ case "ZodPromise": return Xt(e, n);
1118
1119
  case "ZodNaN":
1119
- case "ZodNever": return Bt();
1120
+ case "ZodNever": return zt();
1120
1121
  case "ZodEffects": return I(e, n);
1121
1122
  case "ZodAny": return N();
1122
- case "ZodUnknown": return $t();
1123
- case "ZodDefault": return Ot(e, n);
1124
- case "ZodBranded": return wt(e, n);
1125
- case "ZodReadonly": return en(e, n);
1126
- case "ZodCatch": return Tt(e, n);
1127
- case "ZodPipeline": return Jt(e, n);
1123
+ case "ZodUnknown": return W();
1124
+ case "ZodDefault": return F(e, n);
1125
+ case "ZodBranded": return P(e, n);
1126
+ case "ZodReadonly": return G(e, n);
1127
+ case "ZodCatch": return Et(e, n);
1128
+ case "ZodPipeline": return Yt(e, n);
1128
1129
  case "ZodFunction":
1129
1130
  case "ZodVoid":
1130
1131
  case "ZodSymbol": return;
@@ -1132,19 +1133,19 @@ var en = (e, t) => G(e.innerType._def, t), tn = (e, t, n) => {
1132
1133
  /* c8 ignore next */
1133
1134
  return ((e) => void 0)(t);
1134
1135
  }
1135
- }, nn = (e, t) => {
1136
+ }, en = (e, t) => {
1136
1137
  let n = 0;
1137
1138
  for (; n < e.length && n < t.length && e[n] === t[n]; n++);
1138
1139
  return [(e.length - n).toString(), ...t.slice(n)].join("/");
1139
1140
  };
1140
- function G(e, t, n = !1) {
1141
+ function q(e, t, n = !1) {
1141
1142
  let r = t.seen.get(e);
1142
1143
  if (t.override) {
1143
1144
  let i = t.override?.(e, t, r, n);
1144
1145
  if (i !== bt) return i;
1145
1146
  }
1146
1147
  if (r && !n) {
1147
- let e = rn(r, t);
1148
+ let e = tn(r, t);
1148
1149
  if (e !== void 0) return e;
1149
1150
  }
1150
1151
  let i = {
@@ -1153,21 +1154,21 @@ function G(e, t, n = !1) {
1153
1154
  jsonSchema: void 0
1154
1155
  };
1155
1156
  t.seen.set(e, i);
1156
- let a = tn(e, e.typeName, t), o = typeof a == "function" ? G(a(), t) : a;
1157
- if (o && an(e, t, o), t.postProcess) {
1157
+ let a = K(e, e.typeName, t), o = typeof a == "function" ? q(a(), t) : a;
1158
+ if (o && nn(e, t, o), t.postProcess) {
1158
1159
  let n = t.postProcess(o, e, t);
1159
1160
  return i.jsonSchema = o, n;
1160
1161
  }
1161
1162
  return i.jsonSchema = o, o;
1162
1163
  }
1163
- var rn = (e, t) => {
1164
+ var tn = (e, t) => {
1164
1165
  switch (t.$refStrategy) {
1165
1166
  case "root": return { $ref: e.path.join("/") };
1166
- case "relative": return { $ref: nn(t.currentPath, e.path) };
1167
+ case "relative": return { $ref: en(t.currentPath, e.path) };
1167
1168
  case "none":
1168
1169
  case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), N()) : t.$refStrategy === "seen" ? N() : void 0;
1169
1170
  }
1170
- }, an = (e, t, n) => (e.description && (n.description = e.description), n), on = (e) => {
1171
+ }, nn = (e, t, n) => (e.description && (n.description = e.description), n), rn = (e) => {
1171
1172
  let t = St(e), n = t.name === void 0 ? t.basePath : [
1172
1173
  ...t.basePath,
1173
1174
  t.definitionPath,
@@ -1187,10 +1188,10 @@ var rn = (e, t) => {
1187
1188
  jsonSchema: void 0
1188
1189
  }]))
1189
1190
  };
1190
- }, sn = (e, t) => {
1191
- let n = on(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
1191
+ }, an = (e, t) => {
1192
+ let n = rn(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
1192
1193
  ...e,
1193
- [t]: G(r._def, {
1194
+ [t]: q(r._def, {
1194
1195
  ...n,
1195
1196
  currentPath: [
1196
1197
  ...n.basePath,
@@ -1198,7 +1199,7 @@ var rn = (e, t) => {
1198
1199
  t
1199
1200
  ]
1200
1201
  }, !0) ?? N()
1201
- }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = G(e._def, i === void 0 ? n : {
1202
+ }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = q(e._def, i === void 0 ? n : {
1202
1203
  ...n,
1203
1204
  currentPath: [
1204
1205
  ...n.basePath,
@@ -1222,14 +1223,14 @@ var rn = (e, t) => {
1222
1223
  }
1223
1224
  };
1224
1225
  return s.$schema = "http://json-schema.org/draft-07/schema#", s;
1225
- }, cn = Symbol.for("vercel.ai.schema");
1226
- function ln(e) {
1226
+ }, on = Symbol.for("vercel.ai.schema");
1227
+ function sn(e) {
1227
1228
  let t;
1228
1229
  return () => (t ??= e(), t);
1229
1230
  }
1230
- function un(e, { validate: t } = {}) {
1231
+ function cn(e, { validate: t } = {}) {
1231
1232
  return {
1232
- [cn]: !0,
1233
+ [on]: !0,
1233
1234
  _type: void 0,
1234
1235
  get jsonSchema() {
1235
1236
  return typeof e == "function" && (e = e()), e;
@@ -1237,19 +1238,19 @@ function un(e, { validate: t } = {}) {
1237
1238
  validate: t
1238
1239
  };
1239
1240
  }
1240
- function dn(e) {
1241
- return typeof e == "object" && !!e && cn in e && e[cn] === !0 && "jsonSchema" in e && "validate" in e;
1241
+ function ln(e) {
1242
+ return typeof e == "object" && !!e && on in e && e[on] === !0 && "jsonSchema" in e && "validate" in e;
1242
1243
  }
1243
- function fn(e) {
1244
- return e == null ? un({
1244
+ function un(e) {
1245
+ return e == null ? cn({
1245
1246
  type: "object",
1246
1247
  properties: {},
1247
1248
  additionalProperties: !1
1248
- }) : dn(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? _n(e) : pn(e) : e();
1249
+ }) : ln(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? gn(e) : dn(e) : e();
1249
1250
  }
1250
- function pn(e) {
1251
- return un(() => {
1252
- if (!mn(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
1251
+ function dn(e) {
1252
+ return cn(() => {
1253
+ if (!fn(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
1253
1254
  return yt(e["~standard"].jsonSchema.input({ target: "draft-07" }));
1254
1255
  }, { validate: async (t) => {
1255
1256
  let n = await e["~standard"].validate(t);
@@ -1258,19 +1259,19 @@ function pn(e) {
1258
1259
  value: n.value
1259
1260
  } : {
1260
1261
  success: !1,
1261
- error: new O({
1262
+ error: new Qe({
1262
1263
  value: t,
1263
1264
  cause: n.issues
1264
1265
  })
1265
1266
  };
1266
1267
  } });
1267
1268
  }
1268
- function mn(e) {
1269
+ function fn(e) {
1269
1270
  return e["~standard"].jsonSchema != null;
1270
1271
  }
1271
- function K(e, t) {
1272
+ function pn(e, t) {
1272
1273
  let n = t?.useReferences ?? !1;
1273
- return un(() => sn(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
1274
+ return cn(() => an(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
1274
1275
  let n = await e.safeParseAsync(t);
1275
1276
  return n.success ? {
1276
1277
  success: !0,
@@ -1281,9 +1282,9 @@ function K(e, t) {
1281
1282
  };
1282
1283
  } });
1283
1284
  }
1284
- function hn(e, r) {
1285
+ function mn(e, r) {
1285
1286
  let i = r?.useReferences ?? !1;
1286
- return un(() => yt(n(e, {
1287
+ return cn(() => yt(n(e, {
1287
1288
  target: "draft-7",
1288
1289
  io: "input",
1289
1290
  reused: i ? "ref" : "inline"
@@ -1298,27 +1299,27 @@ function hn(e, r) {
1298
1299
  };
1299
1300
  } });
1300
1301
  }
1301
- function gn(e) {
1302
+ function hn(e) {
1302
1303
  return "_zod" in e;
1303
1304
  }
1304
- function _n(e, t) {
1305
- return gn(e) ? hn(e, t) : K(e, t);
1305
+ function gn(e, t) {
1306
+ return hn(e) ? mn(e, t) : pn(e, t);
1306
1307
  }
1307
- async function vn({ value: e, schema: t, context: n }) {
1308
- let r = await yn({
1308
+ async function _n({ value: e, schema: t, context: n }) {
1309
+ let r = await vn({
1309
1310
  value: e,
1310
1311
  schema: t,
1311
1312
  context: n
1312
1313
  });
1313
- if (!r.success) throw O.wrap({
1314
+ if (!r.success) throw Qe.wrap({
1314
1315
  value: e,
1315
1316
  cause: r.error,
1316
1317
  context: n
1317
1318
  });
1318
1319
  return r.value;
1319
1320
  }
1320
- async function yn({ value: e, schema: t, context: n }) {
1321
- let r = fn(t);
1321
+ async function vn({ value: e, schema: t, context: n }) {
1322
+ let r = un(t);
1322
1323
  try {
1323
1324
  if (r.validate == null) return {
1324
1325
  success: !0,
@@ -1332,7 +1333,7 @@ async function yn({ value: e, schema: t, context: n }) {
1332
1333
  rawValue: e
1333
1334
  } : {
1334
1335
  success: !1,
1335
- error: O.wrap({
1336
+ error: Qe.wrap({
1336
1337
  value: e,
1337
1338
  cause: t.error,
1338
1339
  context: n
@@ -1342,7 +1343,7 @@ async function yn({ value: e, schema: t, context: n }) {
1342
1343
  } catch (t) {
1343
1344
  return {
1344
1345
  success: !1,
1345
- error: O.wrap({
1346
+ error: Qe.wrap({
1346
1347
  value: e,
1347
1348
  cause: t,
1348
1349
  context: n
@@ -1351,14 +1352,14 @@ async function yn({ value: e, schema: t, context: n }) {
1351
1352
  };
1352
1353
  }
1353
1354
  }
1354
- async function bn({ text: e, schema: t }) {
1355
+ async function yn({ text: e, schema: t }) {
1355
1356
  try {
1356
1357
  let n = vt(e);
1357
1358
  return t == null ? {
1358
1359
  success: !0,
1359
1360
  value: n,
1360
1361
  rawValue: n
1361
- } : await yn({
1362
+ } : await vn({
1362
1363
  value: n,
1363
1364
  schema: t
1364
1365
  });
@@ -1373,41 +1374,41 @@ async function bn({ text: e, schema: t }) {
1373
1374
  };
1374
1375
  }
1375
1376
  }
1376
- function xn({ stream: e, schema: t }) {
1377
- return e.pipeThrough(new TextDecoderStream()).pipeThrough(new ct()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
1378
- e !== "[DONE]" && n.enqueue(await bn({
1377
+ function bn({ stream: e, schema: t }) {
1378
+ return e.pipeThrough(new TextDecoderStream()).pipeThrough(new ut()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
1379
+ e !== "[DONE]" && n.enqueue(await yn({
1379
1380
  text: e,
1380
1381
  schema: t
1381
1382
  }));
1382
1383
  } }));
1383
1384
  }
1384
- async function Sn(e) {
1385
+ async function J(e) {
1385
1386
  return typeof e == "function" && (e = e()), e;
1386
1387
  }
1387
1388
  new TextDecoder();
1388
1389
  // ../../node_modules/.pnpm/ai@7.0.154_zod@4.6.7/node_modules/ai/dist/index.js
1389
- var Cn = "AI_InvalidArgumentError", wn = `vercel.ai.error.${Cn}`, Tn = Symbol.for(wn), En = class extends w {
1390
+ var xn = "AI_InvalidArgumentError", Sn = `vercel.ai.error.${xn}`, Cn = Symbol.for(Sn), wn = class extends T {
1390
1391
  constructor({ parameter: e, value: t, message: n }) {
1391
1392
  super({
1392
- name: Cn,
1393
+ name: xn,
1393
1394
  message: `Invalid argument for parameter ${e}: ${n}`
1394
- }), this[Tn] = !0, this.parameter = e, this.value = t;
1395
+ }), this[Cn] = !0, this.parameter = e, this.value = t;
1395
1396
  }
1396
1397
  static isInstance(e) {
1397
- return w.hasMarker(e, wn);
1398
+ return T.hasMarker(e, Sn);
1398
1399
  }
1399
- }, Dn = "AI_UIMessageStreamError", On = `vercel.ai.error.${Dn}`, kn = Symbol.for(On), An = class extends w {
1400
+ }, Tn = "AI_UIMessageStreamError", En = `vercel.ai.error.${Tn}`, Dn = Symbol.for(En), On = class extends T {
1400
1401
  constructor({ chunkType: e, chunkId: t, message: n }) {
1401
1402
  super({
1402
- name: Dn,
1403
+ name: Tn,
1403
1404
  message: n
1404
- }), this[kn] = !0, this.chunkType = e, this.chunkId = t;
1405
+ }), this[Dn] = !0, this.chunkType = e, this.chunkId = t;
1405
1406
  }
1406
1407
  static isInstance(e) {
1407
- return w.hasMarker(e, On);
1408
+ return T.hasMarker(e, En);
1408
1409
  }
1409
1410
  };
1410
- function jn(e, t) {
1411
+ function kn(e, t) {
1411
1412
  if (e === void 0 && t === void 0) return;
1412
1413
  if (e === void 0) return t;
1413
1414
  if (t === void 0) return e;
@@ -1416,11 +1417,11 @@ function jn(e, t) {
1416
1417
  let i = t[r];
1417
1418
  if (i === void 0) continue;
1418
1419
  let a = r in e ? e[r] : void 0, o = typeof i == "object" && !!i && !Array.isArray(i) && !(i instanceof Date) && !(i instanceof RegExp), s = typeof a == "object" && !!a && !Array.isArray(a) && !(a instanceof Date) && !(a instanceof RegExp);
1419
- n[r] = o && s ? jn(a, i) : i;
1420
+ n[r] = o && s ? kn(a, i) : i;
1420
1421
  }
1421
1422
  return n;
1422
1423
  }
1423
- var q = {
1424
+ var Y = {
1424
1425
  array: d,
1425
1426
  boolean: m,
1426
1427
  custom: l,
@@ -1438,215 +1439,215 @@ var q = {
1438
1439
  string: r,
1439
1440
  union: e,
1440
1441
  unknown: _
1441
- }, J = q.lazy(() => q.union([
1442
- q.null(),
1443
- q.string(),
1444
- q.number(),
1445
- q.boolean(),
1446
- q.record(q.string(), J.optional()),
1447
- q.array(J)
1448
- ])), Y = q.record(q.string(), q.record(q.string(), J.optional())), X = q.union([
1449
- q.string(),
1450
- q.instanceof(Uint8Array),
1451
- q.instanceof(ArrayBuffer),
1452
- q.custom(pt, { message: "Must be a Buffer" })
1453
- ]), Mn = q.record(q.string(), q.string()), Z = q.object({
1454
- type: q.literal("text"),
1455
- text: q.string(),
1456
- providerOptions: Y.optional()
1457
- }), Nn = q.object({
1458
- type: q.literal("image"),
1459
- image: q.union([
1460
- X,
1461
- q.instanceof(URL),
1462
- Mn
1442
+ }, X = Y.lazy(() => Y.union([
1443
+ Y.null(),
1444
+ Y.string(),
1445
+ Y.number(),
1446
+ Y.boolean(),
1447
+ Y.record(Y.string(), X.optional()),
1448
+ Y.array(X)
1449
+ ])), Z = Y.record(Y.string(), Y.record(Y.string(), X.optional())), An = Y.union([
1450
+ Y.string(),
1451
+ Y.instanceof(Uint8Array),
1452
+ Y.instanceof(ArrayBuffer),
1453
+ Y.custom(mt, { message: "Must be a Buffer" })
1454
+ ]), jn = Y.record(Y.string(), Y.string()), Mn = Y.object({
1455
+ type: Y.literal("text"),
1456
+ text: Y.string(),
1457
+ providerOptions: Z.optional()
1458
+ }), Nn = Y.object({
1459
+ type: Y.literal("image"),
1460
+ image: Y.union([
1461
+ An,
1462
+ Y.instanceof(URL),
1463
+ jn
1463
1464
  ]),
1464
- mediaType: q.string().optional(),
1465
- providerOptions: Y.optional()
1466
- }), Pn = q.discriminatedUnion("type", [
1467
- q.object({
1468
- type: q.literal("data"),
1469
- data: X
1465
+ mediaType: Y.string().optional(),
1466
+ providerOptions: Z.optional()
1467
+ }), Pn = Y.discriminatedUnion("type", [
1468
+ Y.object({
1469
+ type: Y.literal("data"),
1470
+ data: An
1470
1471
  }),
1471
- q.object({
1472
- type: q.literal("url"),
1473
- url: q.instanceof(URL)
1472
+ Y.object({
1473
+ type: Y.literal("url"),
1474
+ url: Y.instanceof(URL)
1474
1475
  }),
1475
- q.object({
1476
- type: q.literal("reference"),
1477
- reference: Mn
1476
+ Y.object({
1477
+ type: Y.literal("reference"),
1478
+ reference: jn
1478
1479
  }),
1479
- q.object({
1480
- type: q.literal("text"),
1481
- text: q.string()
1480
+ Y.object({
1481
+ type: Y.literal("text"),
1482
+ text: Y.string()
1482
1483
  })
1483
- ]), Fn = q.discriminatedUnion("type", [q.object({
1484
- type: q.literal("data"),
1485
- data: X
1486
- }), q.object({
1487
- type: q.literal("url"),
1488
- url: q.instanceof(URL)
1489
- })]), In = q.object({
1490
- type: q.literal("file"),
1491
- data: q.union([
1484
+ ]), Fn = Y.discriminatedUnion("type", [Y.object({
1485
+ type: Y.literal("data"),
1486
+ data: An
1487
+ }), Y.object({
1488
+ type: Y.literal("url"),
1489
+ url: Y.instanceof(URL)
1490
+ })]), In = Y.object({
1491
+ type: Y.literal("file"),
1492
+ data: Y.union([
1492
1493
  Pn,
1493
- X,
1494
- q.instanceof(URL),
1495
- Mn
1494
+ An,
1495
+ Y.instanceof(URL),
1496
+ jn
1496
1497
  ]),
1497
- filename: q.string().optional(),
1498
- mediaType: q.string(),
1499
- providerOptions: Y.optional()
1500
- }), Ln = q.object({
1501
- type: q.literal("reasoning"),
1502
- text: q.string(),
1503
- providerOptions: Y.optional()
1504
- }), Rn = q.object({
1505
- type: q.literal("custom"),
1506
- kind: q.string().transform((e) => e),
1507
- providerOptions: Y.optional()
1508
- }), zn = q.object({
1509
- type: q.literal("reasoning-file"),
1510
- data: q.union([
1498
+ filename: Y.string().optional(),
1499
+ mediaType: Y.string(),
1500
+ providerOptions: Z.optional()
1501
+ }), Ln = Y.object({
1502
+ type: Y.literal("reasoning"),
1503
+ text: Y.string(),
1504
+ providerOptions: Z.optional()
1505
+ }), Rn = Y.object({
1506
+ type: Y.literal("custom"),
1507
+ kind: Y.string().transform((e) => e),
1508
+ providerOptions: Z.optional()
1509
+ }), zn = Y.object({
1510
+ type: Y.literal("reasoning-file"),
1511
+ data: Y.union([
1511
1512
  Fn,
1512
- X,
1513
- q.instanceof(URL)
1513
+ An,
1514
+ Y.instanceof(URL)
1514
1515
  ]),
1515
- mediaType: q.string(),
1516
- providerOptions: Y.optional()
1517
- }), Bn = q.object({
1518
- type: q.literal("tool-call"),
1519
- toolCallId: q.string(),
1520
- toolName: q.string(),
1521
- input: q.unknown(),
1522
- providerOptions: Y.optional(),
1523
- providerExecuted: q.boolean().optional()
1524
- }), Vn = q.discriminatedUnion("type", [
1525
- q.object({
1526
- type: q.literal("text"),
1527
- value: q.string(),
1528
- providerOptions: Y.optional()
1516
+ mediaType: Y.string(),
1517
+ providerOptions: Z.optional()
1518
+ }), Bn = Y.object({
1519
+ type: Y.literal("tool-call"),
1520
+ toolCallId: Y.string(),
1521
+ toolName: Y.string(),
1522
+ input: Y.unknown(),
1523
+ providerOptions: Z.optional(),
1524
+ providerExecuted: Y.boolean().optional()
1525
+ }), Vn = Y.discriminatedUnion("type", [
1526
+ Y.object({
1527
+ type: Y.literal("text"),
1528
+ value: Y.string(),
1529
+ providerOptions: Z.optional()
1529
1530
  }),
1530
- q.object({
1531
- type: q.literal("json"),
1532
- value: J,
1533
- providerOptions: Y.optional()
1531
+ Y.object({
1532
+ type: Y.literal("json"),
1533
+ value: X,
1534
+ providerOptions: Z.optional()
1534
1535
  }),
1535
- q.object({
1536
- type: q.literal("execution-denied"),
1537
- reason: q.string().optional(),
1538
- providerOptions: Y.optional()
1536
+ Y.object({
1537
+ type: Y.literal("execution-denied"),
1538
+ reason: Y.string().optional(),
1539
+ providerOptions: Z.optional()
1539
1540
  }),
1540
- q.object({
1541
- type: q.literal("error-text"),
1542
- value: q.string(),
1543
- providerOptions: Y.optional()
1541
+ Y.object({
1542
+ type: Y.literal("error-text"),
1543
+ value: Y.string(),
1544
+ providerOptions: Z.optional()
1544
1545
  }),
1545
- q.object({
1546
- type: q.literal("error-json"),
1547
- value: J,
1548
- providerOptions: Y.optional()
1546
+ Y.object({
1547
+ type: Y.literal("error-json"),
1548
+ value: X,
1549
+ providerOptions: Z.optional()
1549
1550
  }),
1550
- q.object({
1551
- type: q.literal("content"),
1552
- value: q.array(q.union([
1553
- q.object({
1554
- type: q.literal("text"),
1555
- text: q.string(),
1556
- providerOptions: Y.optional()
1551
+ Y.object({
1552
+ type: Y.literal("content"),
1553
+ value: Y.array(Y.union([
1554
+ Y.object({
1555
+ type: Y.literal("text"),
1556
+ text: Y.string(),
1557
+ providerOptions: Z.optional()
1557
1558
  }),
1558
- q.object({
1559
- type: q.literal("file"),
1559
+ Y.object({
1560
+ type: Y.literal("file"),
1560
1561
  data: Pn,
1561
- mediaType: q.string(),
1562
- filename: q.string().optional(),
1563
- providerOptions: Y.optional()
1562
+ mediaType: Y.string(),
1563
+ filename: Y.string().optional(),
1564
+ providerOptions: Z.optional()
1564
1565
  }),
1565
- q.object({
1566
- type: q.literal("file-data"),
1567
- data: q.string(),
1568
- mediaType: q.string(),
1569
- filename: q.string().optional(),
1570
- providerOptions: Y.optional()
1566
+ Y.object({
1567
+ type: Y.literal("file-data"),
1568
+ data: Y.string(),
1569
+ mediaType: Y.string(),
1570
+ filename: Y.string().optional(),
1571
+ providerOptions: Z.optional()
1571
1572
  }),
1572
- q.object({
1573
- type: q.literal("file-url"),
1574
- url: q.string(),
1575
- mediaType: q.string().optional(),
1576
- providerOptions: Y.optional()
1573
+ Y.object({
1574
+ type: Y.literal("file-url"),
1575
+ url: Y.string(),
1576
+ mediaType: Y.string().optional(),
1577
+ providerOptions: Z.optional()
1577
1578
  }),
1578
- q.object({
1579
- type: q.literal("file-id"),
1580
- fileId: q.union([q.string(), q.record(q.string(), q.string())]),
1581
- providerOptions: Y.optional()
1579
+ Y.object({
1580
+ type: Y.literal("file-id"),
1581
+ fileId: Y.union([Y.string(), Y.record(Y.string(), Y.string())]),
1582
+ providerOptions: Z.optional()
1582
1583
  }),
1583
- q.object({
1584
- type: q.literal("file-reference"),
1585
- providerReference: q.record(q.string(), q.string()),
1586
- providerOptions: Y.optional()
1584
+ Y.object({
1585
+ type: Y.literal("file-reference"),
1586
+ providerReference: Y.record(Y.string(), Y.string()),
1587
+ providerOptions: Z.optional()
1587
1588
  }),
1588
- q.object({
1589
- type: q.literal("image-data"),
1590
- data: q.string(),
1591
- mediaType: q.string(),
1592
- providerOptions: Y.optional()
1589
+ Y.object({
1590
+ type: Y.literal("image-data"),
1591
+ data: Y.string(),
1592
+ mediaType: Y.string(),
1593
+ providerOptions: Z.optional()
1593
1594
  }),
1594
- q.object({
1595
- type: q.literal("image-url"),
1596
- url: q.string(),
1597
- providerOptions: Y.optional()
1595
+ Y.object({
1596
+ type: Y.literal("image-url"),
1597
+ url: Y.string(),
1598
+ providerOptions: Z.optional()
1598
1599
  }),
1599
- q.object({
1600
- type: q.literal("image-file-id"),
1601
- fileId: q.union([q.string(), q.record(q.string(), q.string())]),
1602
- providerOptions: Y.optional()
1600
+ Y.object({
1601
+ type: Y.literal("image-file-id"),
1602
+ fileId: Y.union([Y.string(), Y.record(Y.string(), Y.string())]),
1603
+ providerOptions: Z.optional()
1603
1604
  }),
1604
- q.object({
1605
- type: q.literal("image-file-reference"),
1606
- providerReference: q.record(q.string(), q.string()),
1607
- providerOptions: Y.optional()
1605
+ Y.object({
1606
+ type: Y.literal("image-file-reference"),
1607
+ providerReference: Y.record(Y.string(), Y.string()),
1608
+ providerOptions: Z.optional()
1608
1609
  }),
1609
- q.object({
1610
- type: q.literal("custom"),
1611
- providerOptions: Y.optional()
1610
+ Y.object({
1611
+ type: Y.literal("custom"),
1612
+ providerOptions: Z.optional()
1612
1613
  })
1613
1614
  ]))
1614
1615
  })
1615
- ]), Hn = q.object({
1616
- type: q.literal("tool-result"),
1617
- toolCallId: q.string(),
1618
- toolName: q.string(),
1616
+ ]), Hn = Y.object({
1617
+ type: Y.literal("tool-result"),
1618
+ toolCallId: Y.string(),
1619
+ toolName: Y.string(),
1619
1620
  output: Vn,
1620
- providerOptions: Y.optional()
1621
- }), Un = q.object({
1622
- type: q.literal("tool-approval-request"),
1623
- approvalId: q.string(),
1624
- toolCallId: q.string(),
1625
- reason: q.string().optional(),
1626
- isAutomatic: q.boolean().optional(),
1627
- signature: q.string().optional(),
1628
- inputSchemaInput: q.unknown().optional()
1629
- }), Wn = q.object({
1630
- type: q.literal("tool-approval-response"),
1631
- approvalId: q.string(),
1632
- approved: q.boolean(),
1633
- reason: q.string().optional()
1634
- }), Gn = q.object({
1635
- role: q.literal("system"),
1636
- content: q.string(),
1637
- providerOptions: Y.optional()
1638
- }), Kn = q.object({
1639
- role: q.literal("user"),
1640
- content: q.union([q.string(), q.array(q.union([
1641
- Z,
1621
+ providerOptions: Z.optional()
1622
+ }), Un = Y.object({
1623
+ type: Y.literal("tool-approval-request"),
1624
+ approvalId: Y.string(),
1625
+ toolCallId: Y.string(),
1626
+ reason: Y.string().optional(),
1627
+ isAutomatic: Y.boolean().optional(),
1628
+ signature: Y.string().optional(),
1629
+ inputSchemaInput: Y.unknown().optional()
1630
+ }), Wn = Y.object({
1631
+ type: Y.literal("tool-approval-response"),
1632
+ approvalId: Y.string(),
1633
+ approved: Y.boolean(),
1634
+ reason: Y.string().optional()
1635
+ }), Gn = Y.object({
1636
+ role: Y.literal("system"),
1637
+ content: Y.string(),
1638
+ providerOptions: Z.optional()
1639
+ }), Kn = Y.object({
1640
+ role: Y.literal("user"),
1641
+ content: Y.union([Y.string(), Y.array(Y.union([
1642
+ Mn,
1642
1643
  Nn,
1643
1644
  In
1644
1645
  ]))]),
1645
- providerOptions: Y.optional()
1646
- }), qn = q.object({
1647
- role: q.literal("assistant"),
1648
- content: q.union([q.string(), q.array(q.union([
1649
- Z,
1646
+ providerOptions: Z.optional()
1647
+ }), qn = Y.object({
1648
+ role: Y.literal("assistant"),
1649
+ content: Y.union([Y.string(), Y.array(Y.union([
1650
+ Mn,
1650
1651
  Rn,
1651
1652
  In,
1652
1653
  Ln,
@@ -1655,13 +1656,13 @@ var q = {
1655
1656
  Hn,
1656
1657
  Un
1657
1658
  ]))]),
1658
- providerOptions: Y.optional()
1659
- }), Jn = q.object({
1660
- role: q.literal("tool"),
1661
- content: q.array(q.union([Hn, Wn])),
1662
- providerOptions: Y.optional()
1659
+ providerOptions: Z.optional()
1660
+ }), Jn = Y.object({
1661
+ role: Y.literal("tool"),
1662
+ content: Y.array(Y.union([Hn, Wn])),
1663
+ providerOptions: Z.optional()
1663
1664
  });
1664
- q.union([
1665
+ Y.union([
1665
1666
  Gn,
1666
1667
  Kn,
1667
1668
  qn,
@@ -1854,11 +1855,11 @@ async function Xn(e) {
1854
1855
  value: void 0,
1855
1856
  state: "undefined-input"
1856
1857
  };
1857
- let t = await bn({ text: e });
1858
+ let t = await yn({ text: e });
1858
1859
  return t.success ? {
1859
1860
  value: t.value,
1860
1861
  state: "successful-parse"
1861
- } : (t = await bn({ text: Yn(e) }), t.success ? {
1862
+ } : (t = await yn({ text: Yn(e) }), t.success ? {
1862
1863
  value: t.value,
1863
1864
  state: "repaired-parse"
1864
1865
  } : {
@@ -1866,203 +1867,203 @@ async function Xn(e) {
1866
1867
  state: "failed-parse"
1867
1868
  });
1868
1869
  }
1869
- j({
1870
+ A({
1870
1871
  prefix: "steer",
1871
1872
  size: 24
1872
- }), new TextEncoder(), new TextEncoder(), j({
1873
+ }), new TextEncoder(), new TextEncoder(), A({
1873
1874
  prefix: "aitxt",
1874
1875
  size: 24
1875
- }), j({
1876
+ }), A({
1876
1877
  prefix: "call",
1877
1878
  size: 24
1878
1879
  }), TransformStream;
1879
- var Zn = q.object({
1880
- source: q.discriminatedUnion("sourceType", [q.object({
1881
- type: q.literal("source"),
1882
- sourceType: q.literal("url"),
1883
- id: q.string(),
1884
- url: q.string(),
1885
- title: q.string().optional(),
1886
- providerMetadata: Y.optional()
1887
- }), q.object({
1888
- type: q.literal("source"),
1889
- sourceType: q.literal("document"),
1890
- id: q.string(),
1891
- mediaType: q.string(),
1892
- title: q.string(),
1893
- filename: q.string().optional(),
1894
- providerMetadata: Y.optional()
1880
+ var Zn = Y.object({
1881
+ source: Y.discriminatedUnion("sourceType", [Y.object({
1882
+ type: Y.literal("source"),
1883
+ sourceType: Y.literal("url"),
1884
+ id: Y.string(),
1885
+ url: Y.string(),
1886
+ title: Y.string().optional(),
1887
+ providerMetadata: Z.optional()
1888
+ }), Y.object({
1889
+ type: Y.literal("source"),
1890
+ sourceType: Y.literal("document"),
1891
+ id: Y.string(),
1892
+ mediaType: Y.string(),
1893
+ title: Y.string(),
1894
+ filename: Y.string().optional(),
1895
+ providerMetadata: Z.optional()
1895
1896
  })]),
1896
- startIndex: q.number().int().nonnegative().optional(),
1897
- endIndex: q.number().int().nonnegative().optional(),
1898
- citedText: q.string().optional()
1899
- }), Qn = q.record(q.string(), J.optional()), $n = ln(() => _n(q.union([
1900
- q.looseObject({
1901
- type: q.literal("text-start"),
1902
- id: q.string(),
1903
- providerMetadata: Y.optional()
1897
+ startIndex: Y.number().int().nonnegative().optional(),
1898
+ endIndex: Y.number().int().nonnegative().optional(),
1899
+ citedText: Y.string().optional()
1900
+ }), Qn = Y.record(Y.string(), X.optional()), $n = sn(() => gn(Y.union([
1901
+ Y.looseObject({
1902
+ type: Y.literal("text-start"),
1903
+ id: Y.string(),
1904
+ providerMetadata: Z.optional()
1904
1905
  }),
1905
- q.looseObject({
1906
- type: q.literal("text-delta"),
1907
- id: q.string(),
1908
- delta: q.string(),
1909
- providerMetadata: Y.optional()
1906
+ Y.looseObject({
1907
+ type: Y.literal("text-delta"),
1908
+ id: Y.string(),
1909
+ delta: Y.string(),
1910
+ providerMetadata: Z.optional()
1910
1911
  }),
1911
- q.looseObject({
1912
- type: q.literal("text-end"),
1913
- id: q.string(),
1914
- citations: q.array(Zn).optional(),
1915
- providerMetadata: Y.optional()
1912
+ Y.looseObject({
1913
+ type: Y.literal("text-end"),
1914
+ id: Y.string(),
1915
+ citations: Y.array(Zn).optional(),
1916
+ providerMetadata: Z.optional()
1916
1917
  }),
1917
- q.looseObject({
1918
- type: q.literal("error"),
1919
- errorText: q.string()
1918
+ Y.looseObject({
1919
+ type: Y.literal("error"),
1920
+ errorText: Y.string()
1920
1921
  }),
1921
- q.looseObject({
1922
- type: q.literal("tool-input-start"),
1923
- toolCallId: q.string(),
1924
- toolName: q.string(),
1925
- inputEncoding: q.enum(["json", "text"]).optional(),
1926
- providerExecuted: q.boolean().optional(),
1927
- providerMetadata: Y.optional(),
1922
+ Y.looseObject({
1923
+ type: Y.literal("tool-input-start"),
1924
+ toolCallId: Y.string(),
1925
+ toolName: Y.string(),
1926
+ inputEncoding: Y.enum(["json", "text"]).optional(),
1927
+ providerExecuted: Y.boolean().optional(),
1928
+ providerMetadata: Z.optional(),
1928
1929
  toolMetadata: Qn.optional(),
1929
- dynamic: q.boolean().optional(),
1930
- title: q.string().optional()
1930
+ dynamic: Y.boolean().optional(),
1931
+ title: Y.string().optional()
1931
1932
  }),
1932
- q.looseObject({
1933
- type: q.literal("tool-input-delta"),
1934
- toolCallId: q.string(),
1935
- inputTextDelta: q.string()
1933
+ Y.looseObject({
1934
+ type: Y.literal("tool-input-delta"),
1935
+ toolCallId: Y.string(),
1936
+ inputTextDelta: Y.string()
1936
1937
  }),
1937
- q.looseObject({
1938
- type: q.literal("tool-input-available"),
1939
- toolCallId: q.string(),
1940
- toolName: q.string(),
1941
- input: q.unknown(),
1942
- providerExecuted: q.boolean().optional(),
1943
- providerMetadata: Y.optional(),
1938
+ Y.looseObject({
1939
+ type: Y.literal("tool-input-available"),
1940
+ toolCallId: Y.string(),
1941
+ toolName: Y.string(),
1942
+ input: Y.unknown(),
1943
+ providerExecuted: Y.boolean().optional(),
1944
+ providerMetadata: Z.optional(),
1944
1945
  toolMetadata: Qn.optional(),
1945
- dynamic: q.boolean().optional(),
1946
- title: q.string().optional()
1946
+ dynamic: Y.boolean().optional(),
1947
+ title: Y.string().optional()
1947
1948
  }),
1948
- q.looseObject({
1949
- type: q.literal("tool-input-error"),
1950
- toolCallId: q.string(),
1951
- toolName: q.string(),
1952
- input: q.unknown(),
1953
- providerExecuted: q.boolean().optional(),
1954
- providerMetadata: Y.optional(),
1949
+ Y.looseObject({
1950
+ type: Y.literal("tool-input-error"),
1951
+ toolCallId: Y.string(),
1952
+ toolName: Y.string(),
1953
+ input: Y.unknown(),
1954
+ providerExecuted: Y.boolean().optional(),
1955
+ providerMetadata: Z.optional(),
1955
1956
  toolMetadata: Qn.optional(),
1956
- dynamic: q.boolean().optional(),
1957
- errorText: q.string(),
1958
- title: q.string().optional()
1957
+ dynamic: Y.boolean().optional(),
1958
+ errorText: Y.string(),
1959
+ title: Y.string().optional()
1959
1960
  }),
1960
- q.looseObject({
1961
- type: q.literal("tool-approval-request"),
1962
- approvalId: q.string(),
1963
- toolCallId: q.string(),
1964
- approvalDescriptor: q.unknown().optional(),
1965
- inputSchemaInput: q.unknown().optional(),
1966
- reason: q.string().optional(),
1967
- isAutomatic: q.boolean().optional(),
1968
- signature: q.string().optional()
1961
+ Y.looseObject({
1962
+ type: Y.literal("tool-approval-request"),
1963
+ approvalId: Y.string(),
1964
+ toolCallId: Y.string(),
1965
+ approvalDescriptor: Y.unknown().optional(),
1966
+ inputSchemaInput: Y.unknown().optional(),
1967
+ reason: Y.string().optional(),
1968
+ isAutomatic: Y.boolean().optional(),
1969
+ signature: Y.string().optional()
1969
1970
  }),
1970
- q.looseObject({
1971
- type: q.literal("tool-approval-response"),
1972
- approvalId: q.string(),
1973
- approved: q.boolean(),
1974
- reason: q.string().optional(),
1975
- providerExecuted: q.boolean().optional(),
1976
- providerMetadata: Y.optional()
1971
+ Y.looseObject({
1972
+ type: Y.literal("tool-approval-response"),
1973
+ approvalId: Y.string(),
1974
+ approved: Y.boolean(),
1975
+ reason: Y.string().optional(),
1976
+ providerExecuted: Y.boolean().optional(),
1977
+ providerMetadata: Z.optional()
1977
1978
  }),
1978
- q.looseObject({
1979
- type: q.literal("tool-output-available"),
1980
- toolCallId: q.string(),
1981
- output: q.unknown(),
1982
- providerExecuted: q.boolean().optional(),
1983
- providerMetadata: Y.optional(),
1979
+ Y.looseObject({
1980
+ type: Y.literal("tool-output-available"),
1981
+ toolCallId: Y.string(),
1982
+ output: Y.unknown(),
1983
+ providerExecuted: Y.boolean().optional(),
1984
+ providerMetadata: Z.optional(),
1984
1985
  toolMetadata: Qn.optional(),
1985
- dynamic: q.boolean().optional(),
1986
- preliminary: q.boolean().optional()
1986
+ dynamic: Y.boolean().optional(),
1987
+ preliminary: Y.boolean().optional()
1987
1988
  }),
1988
- q.looseObject({
1989
- type: q.literal("tool-output-error"),
1990
- toolCallId: q.string(),
1991
- errorText: q.string(),
1992
- providerExecuted: q.boolean().optional(),
1993
- providerMetadata: Y.optional(),
1989
+ Y.looseObject({
1990
+ type: Y.literal("tool-output-error"),
1991
+ toolCallId: Y.string(),
1992
+ errorText: Y.string(),
1993
+ providerExecuted: Y.boolean().optional(),
1994
+ providerMetadata: Z.optional(),
1994
1995
  toolMetadata: Qn.optional(),
1995
- dynamic: q.boolean().optional()
1996
+ dynamic: Y.boolean().optional()
1996
1997
  }),
1997
- q.looseObject({
1998
- type: q.literal("tool-output-denied"),
1999
- toolCallId: q.string()
1998
+ Y.looseObject({
1999
+ type: Y.literal("tool-output-denied"),
2000
+ toolCallId: Y.string()
2000
2001
  }),
2001
- q.looseObject({
2002
- type: q.literal("reasoning-start"),
2003
- id: q.string(),
2004
- providerMetadata: Y.optional()
2002
+ Y.looseObject({
2003
+ type: Y.literal("reasoning-start"),
2004
+ id: Y.string(),
2005
+ providerMetadata: Z.optional()
2005
2006
  }),
2006
- q.looseObject({
2007
- type: q.literal("reasoning-delta"),
2008
- id: q.string(),
2009
- delta: q.string(),
2010
- providerMetadata: Y.optional()
2007
+ Y.looseObject({
2008
+ type: Y.literal("reasoning-delta"),
2009
+ id: Y.string(),
2010
+ delta: Y.string(),
2011
+ providerMetadata: Z.optional()
2011
2012
  }),
2012
- q.looseObject({
2013
- type: q.literal("reasoning-end"),
2014
- id: q.string(),
2015
- providerMetadata: Y.optional()
2013
+ Y.looseObject({
2014
+ type: Y.literal("reasoning-end"),
2015
+ id: Y.string(),
2016
+ providerMetadata: Z.optional()
2016
2017
  }),
2017
- q.looseObject({
2018
- type: q.literal("custom"),
2019
- kind: q.string().transform((e) => e),
2020
- providerMetadata: Y.optional()
2018
+ Y.looseObject({
2019
+ type: Y.literal("custom"),
2020
+ kind: Y.string().transform((e) => e),
2021
+ providerMetadata: Z.optional()
2021
2022
  }),
2022
- q.looseObject({
2023
- type: q.literal("source-url"),
2024
- sourceId: q.string(),
2025
- url: q.string(),
2026
- title: q.string().optional(),
2027
- providerMetadata: Y.optional()
2023
+ Y.looseObject({
2024
+ type: Y.literal("source-url"),
2025
+ sourceId: Y.string(),
2026
+ url: Y.string(),
2027
+ title: Y.string().optional(),
2028
+ providerMetadata: Z.optional()
2028
2029
  }),
2029
- q.looseObject({
2030
- type: q.literal("source-document"),
2031
- sourceId: q.string(),
2032
- mediaType: q.string(),
2033
- title: q.string(),
2034
- filename: q.string().optional(),
2035
- providerMetadata: Y.optional()
2030
+ Y.looseObject({
2031
+ type: Y.literal("source-document"),
2032
+ sourceId: Y.string(),
2033
+ mediaType: Y.string(),
2034
+ title: Y.string(),
2035
+ filename: Y.string().optional(),
2036
+ providerMetadata: Z.optional()
2036
2037
  }),
2037
- q.looseObject({
2038
- type: q.literal("file"),
2039
- url: q.string(),
2040
- mediaType: q.string(),
2041
- providerMetadata: Y.optional()
2038
+ Y.looseObject({
2039
+ type: Y.literal("file"),
2040
+ url: Y.string(),
2041
+ mediaType: Y.string(),
2042
+ providerMetadata: Z.optional()
2042
2043
  }),
2043
- q.looseObject({
2044
- type: q.literal("reasoning-file"),
2045
- url: q.string(),
2046
- mediaType: q.string(),
2047
- providerMetadata: Y.optional()
2044
+ Y.looseObject({
2045
+ type: Y.literal("reasoning-file"),
2046
+ url: Y.string(),
2047
+ mediaType: Y.string(),
2048
+ providerMetadata: Z.optional()
2048
2049
  }),
2049
- q.looseObject({
2050
- type: q.custom((e) => typeof e == "string" && e.startsWith("data-"), { message: "Type must start with \"data-\"" }),
2051
- id: q.string().optional(),
2052
- data: q.unknown(),
2053
- transient: q.boolean().optional()
2050
+ Y.looseObject({
2051
+ type: Y.custom((e) => typeof e == "string" && e.startsWith("data-"), { message: "Type must start with \"data-\"" }),
2052
+ id: Y.string().optional(),
2053
+ data: Y.unknown(),
2054
+ transient: Y.boolean().optional()
2054
2055
  }),
2055
- q.looseObject({ type: q.literal("start-step") }),
2056
- q.looseObject({ type: q.literal("finish-step") }),
2057
- q.looseObject({ type: q.literal("reset-step") }),
2058
- q.looseObject({
2059
- type: q.literal("start"),
2060
- messageId: q.string().optional(),
2061
- messageMetadata: q.unknown().optional()
2056
+ Y.looseObject({ type: Y.literal("start-step") }),
2057
+ Y.looseObject({ type: Y.literal("finish-step") }),
2058
+ Y.looseObject({ type: Y.literal("reset-step") }),
2059
+ Y.looseObject({
2060
+ type: Y.literal("start"),
2061
+ messageId: Y.string().optional(),
2062
+ messageMetadata: Y.unknown().optional()
2062
2063
  }),
2063
- q.looseObject({
2064
- type: q.literal("finish"),
2065
- finishReason: q.enum([
2064
+ Y.looseObject({
2065
+ type: Y.literal("finish"),
2066
+ finishReason: Y.enum([
2066
2067
  "stop",
2067
2068
  "length",
2068
2069
  "content-filter",
@@ -2071,15 +2072,15 @@ var Zn = q.object({
2071
2072
  "interrupted",
2072
2073
  "other"
2073
2074
  ]).optional(),
2074
- messageMetadata: q.unknown().optional()
2075
+ messageMetadata: Y.unknown().optional()
2075
2076
  }),
2076
- q.looseObject({
2077
- type: q.literal("abort"),
2078
- reason: q.string().optional()
2077
+ Y.looseObject({
2078
+ type: Y.literal("abort"),
2079
+ reason: Y.string().optional()
2079
2080
  }),
2080
- q.looseObject({
2081
- type: q.literal("message-metadata"),
2082
- messageMetadata: q.unknown()
2081
+ Y.looseObject({
2082
+ type: Y.literal("message-metadata"),
2083
+ messageMetadata: Y.unknown()
2083
2084
  })
2084
2085
  ])));
2085
2086
  function er(e) {
@@ -2151,7 +2152,7 @@ function or({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2151
2152
  }
2152
2153
  }
2153
2154
  }
2154
- if (t == null) throw new An({
2155
+ if (t == null) throw new On({
2155
2156
  chunkType: "tool-invocation",
2156
2157
  chunkId: e,
2157
2158
  message: `No tool invocation found for tool call ID "${e}".`
@@ -2160,7 +2161,7 @@ function or({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2160
2161
  }
2161
2162
  function h(e) {
2162
2163
  let t = r.message.parts.filter(Q).find((t) => t.approval?.id === e);
2163
- if (t == null) throw new An({
2164
+ if (t == null) throw new On({
2164
2165
  chunkType: "tool-approval-response",
2165
2166
  chunkId: e,
2166
2167
  message: `No tool invocation found for approval ID "${e}".`
@@ -2225,8 +2226,8 @@ function or({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2225
2226
  }
2226
2227
  async function v(e) {
2227
2228
  if (e != null) {
2228
- let n = r.message.metadata == null ? e : jn(r.message.metadata, e);
2229
- t != null && await vn({
2229
+ let n = r.message.metadata == null ? e : kn(r.message.metadata, e);
2230
+ t != null && await _n({
2230
2231
  value: n,
2231
2232
  schema: t,
2232
2233
  context: {
@@ -2249,7 +2250,7 @@ function or({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2249
2250
  }
2250
2251
  case "text-delta": {
2251
2252
  let t = r.activeTextParts[e.id];
2252
- if (t == null) throw new An({
2253
+ if (t == null) throw new On({
2253
2254
  chunkType: "text-delta",
2254
2255
  chunkId: e.id,
2255
2256
  message: `Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`
@@ -2259,7 +2260,7 @@ function or({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2259
2260
  }
2260
2261
  case "text-end": {
2261
2262
  let t = r.activeTextParts[e.id];
2262
- if (t == null) throw new An({
2263
+ if (t == null) throw new On({
2263
2264
  chunkType: "text-end",
2264
2265
  chunkId: e.id,
2265
2266
  message: `Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`
@@ -2289,7 +2290,7 @@ function or({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2289
2290
  }
2290
2291
  case "reasoning-delta": {
2291
2292
  let t = r.activeReasoningParts[e.id];
2292
- if (t == null) throw new An({
2293
+ if (t == null) throw new On({
2293
2294
  chunkType: "reasoning-delta",
2294
2295
  chunkId: e.id,
2295
2296
  message: `Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`
@@ -2299,7 +2300,7 @@ function or({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2299
2300
  }
2300
2301
  case "reasoning-end": {
2301
2302
  let t = r.activeReasoningParts[e.id];
2302
- if (t == null) throw new An({
2303
+ if (t == null) throw new On({
2303
2304
  chunkType: "reasoning-end",
2304
2305
  chunkId: e.id,
2305
2306
  message: `Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`
@@ -2370,7 +2371,7 @@ function or({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2370
2371
  }
2371
2372
  case "tool-input-delta": {
2372
2373
  let t = r.partialToolCalls[e.toolCallId];
2373
- if (t == null) throw new An({
2374
+ if (t == null) throw new On({
2374
2375
  chunkType: "tool-input-delta",
2375
2376
  chunkId: e.toolCallId,
2376
2377
  message: `Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`
@@ -2551,7 +2552,7 @@ function or({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2551
2552
  default: if (er(e)) {
2552
2553
  if (n?.[e.type] != null) {
2553
2554
  let t = r.message.parts.findIndex((t) => "id" in t && "data" in t && t.id === e.id && t.type === e.type), i = t >= 0 ? t : r.message.parts.length;
2554
- await vn({
2555
+ await _n({
2555
2556
  value: e.data,
2556
2557
  schema: n[e.type],
2557
2558
  context: {
@@ -2600,28 +2601,28 @@ function cr() {
2600
2601
  reject: t
2601
2602
  };
2602
2603
  }
2603
- j({
2604
+ A({
2604
2605
  prefix: "aitxt",
2605
2606
  size: 24
2606
- }), j({
2607
+ }), A({
2607
2608
  prefix: "call",
2608
2609
  size: 24
2609
- }), j({
2610
+ }), A({
2610
2611
  prefix: "aitxt",
2611
2612
  size: 24
2612
- }), j({
2613
+ }), A({
2613
2614
  prefix: "call",
2614
2615
  size: 24
2615
- }), q.record(q.string(), J.optional()), q.record(q.string(), q.string()), j({
2616
+ }), Y.record(Y.string(), X.optional()), Y.record(Y.string(), Y.string()), A({
2616
2617
  prefix: "call",
2617
2618
  size: 24
2618
- }), j({
2619
+ }), A({
2619
2620
  prefix: "call",
2620
2621
  size: 24
2621
- }), new TextEncoder(), j({
2622
+ }), new TextEncoder(), A({
2622
2623
  prefix: "call",
2623
2624
  size: 24
2624
- }), j({
2625
+ }), A({
2625
2626
  prefix: "aiobj",
2626
2627
  size: 24
2627
2628
  });
@@ -2657,15 +2658,15 @@ var { atob: lr } = globalThis, ur = class {
2657
2658
  });
2658
2659
  }
2659
2660
  };
2660
- j({
2661
+ A({
2661
2662
  prefix: "aiobj",
2662
2663
  size: 24
2663
- }), j({
2664
+ }), A({
2664
2665
  prefix: "call",
2665
2666
  size: 24
2666
- }), q.object({
2667
- token: q.string().refine((e) => e.trim().length > 0),
2668
- url: q.string().refine((e) => {
2667
+ }), Y.object({
2668
+ token: Y.string().refine((e) => e.trim().length > 0),
2669
+ url: Y.string().refine((e) => {
2669
2670
  try {
2670
2671
  let t = new URL(e);
2671
2672
  return (t.protocol === "ws:" || t.protocol === "wss:") && t.hostname !== "";
@@ -2673,26 +2674,26 @@ j({
2673
2674
  return !1;
2674
2675
  }
2675
2676
  }),
2676
- expiresAt: q.number().positive().max(2 ** 53 - 1).optional(),
2677
- tools: q.array(q.object({
2678
- type: q.literal("function"),
2679
- name: q.string().min(1),
2680
- description: q.string().optional(),
2681
- parameters: q.record(q.string(), q.unknown())
2677
+ expiresAt: Y.number().positive().max(2 ** 53 - 1).optional(),
2678
+ tools: Y.array(Y.object({
2679
+ type: Y.literal("function"),
2680
+ name: Y.string().min(1),
2681
+ description: Y.string().optional(),
2682
+ parameters: Y.record(Y.string(), Y.unknown())
2682
2683
  })).optional()
2683
- }), j({
2684
+ }), A({
2684
2685
  prefix: "call",
2685
2686
  size: 24
2686
- }), j({
2687
+ }), A({
2687
2688
  prefix: "call",
2688
2689
  size: 24
2689
- }), j({
2690
+ }), A({
2690
2691
  prefix: "call",
2691
2692
  size: 24
2692
2693
  });
2693
2694
  async function dr({ response: e, url: t, fallbackMessage: n }) {
2694
2695
  let r = await e.text();
2695
- return new Re({
2696
+ return new Le({
2696
2697
  message: r || n,
2697
2698
  url: t,
2698
2699
  requestBodyValues: void 0,
@@ -2702,7 +2703,7 @@ async function dr({ response: e, url: t, fallbackMessage: n }) {
2702
2703
  }
2703
2704
  async function fr(e) {
2704
2705
  if (e == null) return [];
2705
- if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new tt({
2706
+ if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new nt({
2706
2707
  functionality: "FileList",
2707
2708
  message: "FileList is not supported in the current environment"
2708
2709
  });
@@ -2730,9 +2731,9 @@ var mr = class {
2730
2731
  this.api = e, this.credentials = t, this.headers = n, this.body = r, this.fetch = i, this.prepareSendMessagesRequest = a, this.prepareReconnectToStreamRequest = o;
2731
2732
  }
2732
2733
  async sendMessages({ abortSignal: e, ...t }) {
2733
- let n = await Sn(this.body), r = await Sn(this.headers), i = await Sn(this.credentials), a = {
2734
- ...dt(r),
2735
- ...dt(t.headers)
2734
+ let n = await J(this.body), r = await J(this.headers), i = await J(this.credentials), a = {
2735
+ ...ft(r),
2736
+ ...ft(t.headers)
2736
2737
  }, o = await this.prepareSendMessagesRequest?.({
2737
2738
  api: this.api,
2738
2739
  id: t.chatId,
@@ -2746,7 +2747,7 @@ var mr = class {
2746
2747
  requestMetadata: t.metadata,
2747
2748
  trigger: t.trigger,
2748
2749
  messageId: t.messageId
2749
- }), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : dt(o.headers), l = o?.body === void 0 ? {
2750
+ }), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : ft(o.headers), l = o?.body === void 0 ? {
2750
2751
  ...n,
2751
2752
  ...t.body,
2752
2753
  id: t.chatId,
@@ -2768,13 +2769,13 @@ var mr = class {
2768
2769
  url: s,
2769
2770
  fallbackMessage: "Failed to fetch the chat response."
2770
2771
  });
2771
- if (!d.body) throw new He({ message: "The response body is empty." });
2772
+ if (!d.body) throw new Ve({ message: "The response body is empty." });
2772
2773
  return this.processResponseStream(d.body);
2773
2774
  }
2774
2775
  async reconnectToStream(e) {
2775
- let t = await Sn(this.body), n = await Sn(this.headers), r = await Sn(this.credentials), i = {
2776
- ...dt(n),
2777
- ...dt(e.headers)
2776
+ let t = await J(this.body), n = await J(this.headers), r = await J(this.credentials), i = {
2777
+ ...ft(n),
2778
+ ...ft(e.headers)
2778
2779
  }, a = await this.prepareReconnectToStreamRequest?.({
2779
2780
  api: this.api,
2780
2781
  id: e.chatId,
@@ -2787,14 +2788,14 @@ var mr = class {
2787
2788
  requestMetadata: e.metadata
2788
2789
  }), o = a?.api;
2789
2790
  if (o == null) {
2790
- if (e.chatId === "." || e.chatId === "..") throw new En({
2791
+ if (e.chatId === "." || e.chatId === "..") throw new wn({
2791
2792
  parameter: "chatId",
2792
2793
  value: e.chatId,
2793
2794
  message: "Chat IDs must not be \".\" or \"..\" when using the default reconnect URL."
2794
2795
  });
2795
2796
  o = pr(this.api, `/${encodeURIComponent(e.chatId)}/stream`);
2796
2797
  }
2797
- let s = a?.headers === void 0 ? i : dt(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
2798
+ let s = a?.headers === void 0 ? i : ft(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
2798
2799
  method: "GET",
2799
2800
  headers: s,
2800
2801
  credentials: c,
@@ -2806,7 +2807,7 @@ var mr = class {
2806
2807
  url: o,
2807
2808
  fallbackMessage: "Failed to fetch the chat response."
2808
2809
  });
2809
- if (!l.body) throw new He({ message: "The response body is empty." });
2810
+ if (!l.body) throw new Ve({ message: "The response body is empty." });
2810
2811
  return this.processResponseStream(l.body);
2811
2812
  }
2812
2813
  }, hr = class extends mr {
@@ -2814,7 +2815,7 @@ var mr = class {
2814
2815
  super(t), this.resumeStreamIsReplay = e;
2815
2816
  }
2816
2817
  processResponseStream(e) {
2817
- return xn({
2818
+ return bn({
2818
2819
  stream: e,
2819
2820
  schema: $n
2820
2821
  }).pipeThrough(new TransformStream({ async transform(e, t) {
@@ -2826,7 +2827,7 @@ var mr = class {
2826
2827
  get id() {
2827
2828
  return this._id ??= this.generateId();
2828
2829
  }
2829
- constructor({ generateId: e = ft, id: t, transport: n = new hr(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
2830
+ constructor({ generateId: e = pt, id: t, transport: n = new hr(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
2830
2831
  this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.interruptedMessageIds = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.resumableStreamState = void 0, this.jobExecutor = new ur(), this.activeStopCount = 0, this.stopGeneration = 0, this.sendMessage = async (e, t) => {
2831
2832
  if (e == null) {
2832
2833
  let e = this.pendingApprovalMessageId;
@@ -2866,12 +2867,12 @@ var mr = class {
2866
2867
  } else n = e;
2867
2868
  if (e.messageId != null) {
2868
2869
  let t = this.state.messages.findIndex((t) => t.id === e.messageId);
2869
- if (t === -1) throw new En({
2870
+ if (t === -1) throw new wn({
2870
2871
  parameter: "message.messageId",
2871
2872
  value: e.messageId,
2872
2873
  message: `message with id ${e.messageId} not found`
2873
2874
  });
2874
- if (this.state.messages[t].role !== "user") throw new En({
2875
+ if (this.state.messages[t].role !== "user") throw new wn({
2875
2876
  parameter: "message.messageId",
2876
2877
  value: e.messageId,
2877
2878
  message: `message with id ${e.messageId} is not a user message`
@@ -2895,7 +2896,7 @@ var mr = class {
2895
2896
  });
2896
2897
  }, this.regenerate = async ({ messageId: e, ...t } = {}) => {
2897
2898
  let n = e == null ? this.state.messages.length - 1 : this.state.messages.findIndex((t) => t.id === e);
2898
- if (n === -1) throw new En({
2899
+ if (n === -1) throw new wn({
2899
2900
  parameter: "messageId",
2900
2901
  value: e,
2901
2902
  message: `message ${e} not found`
@@ -3083,7 +3084,7 @@ var mr = class {
3083
3084
  status: "submitted",
3084
3085
  error: void 0
3085
3086
  });
3086
- let d = this.lastMessage, f = e === "submit-message" && i != null ? this.state.messages.findIndex((e) => e.id === i) : this.state.messages.length - 1, p = f === -1 ? d : this.state.messages[f], m = p?.id, h = e === "resume-stream" && p?.role === "assistant" && p.parts.some((e) => Q(e) && (e.state === "input-streaming" || e.state === "input-available" && e.providerExecuted || e.state === "approval-responded")) ? this.state.snapshot(p) : void 0, g = f !== -1 && f < this.state.messages.length - 1 && p?.role === "assistant", _ = !1, v = !1, ee = !1, y;
3087
+ let d = this.lastMessage, f = e === "submit-message" && i != null ? this.state.messages.findIndex((e) => e.id === i) : this.state.messages.length - 1, p = f === -1 ? d : this.state.messages[f], m = p?.id, h = e === "resume-stream" && p?.role === "assistant" && p.parts.some((e) => Q(e) && (e.state === "input-streaming" || e.state === "input-available" && e.providerExecuted || e.state === "approval-responded")) ? this.state.snapshot(p) : void 0, g = f !== -1 && f < this.state.messages.length - 1 && p?.role === "assistant", _ = !1, v = !1, y = !1, b;
3087
3088
  try {
3088
3089
  let s = {
3089
3090
  state: e === "resume-stream" && this.resumableStreamState != null ? this.resumableStreamState : ar({
@@ -3093,7 +3094,7 @@ var mr = class {
3093
3094
  abortController: o,
3094
3095
  completionPromise: a
3095
3096
  };
3096
- y = s, s.abortController.signal.addEventListener("abort", () => {
3097
+ b = s, s.abortController.signal.addEventListener("abort", () => {
3097
3098
  _ = !0;
3098
3099
  }), this.activeResponse = s;
3099
3100
  let l;
@@ -3139,34 +3140,34 @@ var mr = class {
3139
3140
  }), _) return c() && (this.setStatus({ status: "ready" }), this.resumableStreamState === s.state && (this.resumableStreamState = void 0)), null;
3140
3141
  c() && (this.setStatus({ status: "ready" }), this.resumableStreamState === s.state && (this.resumableStreamState = void 0));
3141
3142
  } catch (e) {
3142
- if (_ || e.name === "AbortError") return _ = !0, c() && (this.setStatus({ status: "ready" }), this.resumableStreamState === y?.state && (this.resumableStreamState = void 0)), null;
3143
+ if (_ || e.name === "AbortError") return _ = !0, c() && (this.setStatus({ status: "ready" }), this.resumableStreamState === b?.state && (this.resumableStreamState = void 0)), null;
3143
3144
  if (!c()) return null;
3144
- if (ee = !0, e instanceof TypeError) {
3145
+ if (y = !0, e instanceof TypeError) {
3145
3146
  let t = e.message.toLowerCase();
3146
3147
  v = t.includes("fetch") || t.includes("network") || t === "load failed";
3147
3148
  }
3148
- v ? this.resumableStreamState = y?.state : this.resumableStreamState === y?.state && (this.resumableStreamState = void 0), this.onError && e instanceof Error && this.onError(e), this.setStatus({
3149
+ v ? this.resumableStreamState = b?.state : this.resumableStreamState === b?.state && (this.resumableStreamState = void 0), this.onError && e instanceof Error && this.onError(e), this.setStatus({
3149
3150
  status: "error",
3150
3151
  error: e
3151
3152
  });
3152
3153
  } finally {
3153
3154
  try {
3154
- if (y) {
3155
- let { message: e, finishReason: t } = y.state;
3156
- t === "interrupted" ? this.interruptedMessageIds.add(e.id) : !_ && !ee && this.interruptedMessageIds.delete(e.id), this.onFinish?.({
3157
- message: y.state.message,
3155
+ if (b) {
3156
+ let { message: e, finishReason: t } = b.state;
3157
+ t === "interrupted" ? this.interruptedMessageIds.add(e.id) : !_ && !y && this.interruptedMessageIds.delete(e.id), this.onFinish?.({
3158
+ message: b.state.message,
3158
3159
  messages: this.state.messages,
3159
3160
  isAbort: _,
3160
3161
  isDisconnect: v,
3161
- isError: ee,
3162
- finishReason: y.state.finishReason
3162
+ isError: y,
3163
+ finishReason: b.state.finishReason
3163
3164
  });
3164
3165
  }
3165
3166
  } finally {
3166
- this.activeResponse === y && (this.activeResponse = void 0), l();
3167
+ this.activeResponse === b && (this.activeResponse = void 0), l();
3167
3168
  }
3168
3169
  }
3169
- !_ && !ee && y?.state.finishReason !== "interrupted" && await this.runAutomaticRequest(() => this.makeRequest({
3170
+ !_ && !y && b?.state.finishReason !== "interrupted" && await this.runAutomaticRequest(() => this.makeRequest({
3170
3171
  trigger: "submit-message",
3171
3172
  messageId: this.lastMessage?.id,
3172
3173
  metadata: t,
@@ -3437,13 +3438,13 @@ var Lr = function(e, t, n, r) {
3437
3438
  function Rr() {
3438
3439
  for (var e = this, t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];
3439
3440
  var r, i, a = $({}, Nr), o = !1, s = !1;
3440
- if (!me()) return console.error("useSWRV must be called inside setup() or an active effectScope()."), null;
3441
+ if (!pe()) return console.error("useSWRV must be called inside setup() or an active effectScope()."), null;
3441
3442
  var c = typeof window > "u" || typeof document > "u";
3442
3443
  t.length >= 1 && (r = t[0]), t.length >= 2 && (i = t[1]), t.length > 2 && (a = $($({}, a), t[2]));
3443
- var l = c ? a.serverTTL : a.ttl, u = typeof r == "function" ? r : x(r);
3444
+ var l = c ? a.serverTTL : a.ttl, u = typeof r == "function" ? r : S(r);
3444
3445
  i === void 0 && (i = a.fetcher);
3445
3446
  var d = null;
3446
- d ||= ve({
3447
+ d ||= _e({
3447
3448
  data: void 0,
3448
3449
  error: void 0,
3449
3450
  isValidating: !0,
@@ -3513,7 +3514,7 @@ function Rr() {
3513
3514
  };
3514
3515
  a.refreshInterval && (m = setTimeout(h, a.refreshInterval)), a.revalidateOnFocus && (document.addEventListener("visibilitychange", p, !1), window.addEventListener("focus", p, !1));
3515
3516
  }
3516
- _e(function() {
3517
+ ge(function() {
3517
3518
  o = !0, m &&= (clearTimeout(m), null), !c && a.revalidateOnFocus && (document.removeEventListener("visibilitychange", p, !1), window.removeEventListener("focus", p, !1));
3518
3519
  var e = jr.get(u.value);
3519
3520
  e && (e.data = e.data.filter(function(e) {
@@ -3521,11 +3522,11 @@ function Rr() {
3521
3522
  }));
3522
3523
  });
3523
3524
  try {
3524
- C(u, function(e) {
3525
- he(u) || (u.value = e), d.key = e, d.isValidating = !!e, Pr(u.value, d, l), !c && !s && u.value && f(), s = !1;
3525
+ w(u, function(e) {
3526
+ me(u) || (u.value = e), d.key = e, d.isValidating = !!e, Pr(u.value, d, l), !c && !s && u.value && f(), s = !1;
3526
3527
  }, { immediate: !0 });
3527
3528
  } catch {}
3528
- return $($({}, ye(d)), { mutate: function(e, t) {
3529
+ return $($({}, ve(d)), { mutate: function(e, t) {
3529
3530
  return f(e, $($({}, t), { forceRevalidate: !0 }));
3530
3531
  } });
3531
3532
  }
@@ -3613,10 +3614,10 @@ var Ur = class {
3613
3614
  }
3614
3615
  };
3615
3616
  function Gr(e) {
3616
- let t = S([]), n = S("ready"), r = S(), i = S(), a;
3617
- return C(t, (e) => {
3617
+ let t = C([]), n = C("ready"), r = C(), i = C(), a;
3618
+ return w(t, (e) => {
3618
3619
  a != null && !a.isPublishing && a.setMessagesFromConsumer(e);
3619
- }, { flush: "sync" }), C(() => be(e), (e) => {
3620
+ }, { flush: "sync" }), w(() => ye(e), (e) => {
3620
3621
  a?.dispose();
3621
3622
  let { throttle: o, ...s } = e ?? {}, c = new Ur({
3622
3623
  initialMessages: s.messages ?? [],
@@ -3629,10 +3630,10 @@ function Gr(e) {
3629
3630
  ...s,
3630
3631
  state: c
3631
3632
  });
3632
- }, { immediate: !0 }), me() != null && _e(() => {
3633
+ }, { immediate: !0 }), pe() != null && ge(() => {
3633
3634
  a?.dispose();
3634
3635
  }), {
3635
- id: b(() => i.value.id),
3636
+ id: x(() => i.value.id),
3636
3637
  status: n,
3637
3638
  messages: t,
3638
3639
  error: r,
@@ -3659,43 +3660,47 @@ var Kr = "voice-", qr = 300, Jr = (e) => e?.role === "assistant" && e.parts.some
3659
3660
  }, $r = 12e4, ei = 1e3, ti = 5e3, ni = 100, ri = 3e4, ii = 5e3, ai = 250, oi = 1e3, si = "\n\n", ci = (e) => {
3660
3661
  let t = e.type ?? "";
3661
3662
  return t === "dynamic-tool" ? e.toolName ?? "" : t.startsWith("tool-") ? t.slice(5) : "";
3662
- }, li = (e) => e?.role === "assistant" && e.parts.some((e) => y(ci(e)) && !e.providerExecuted && !se.has(e.state ?? "")), ui = ({ messages: e }) => {
3663
+ }, li = (e) => e?.role === "assistant" && e.parts.some((e) => ne(ci(e)) && !e.providerExecuted && !oe.has(e.state ?? "")), ui = ({ messages: e }) => {
3663
3664
  let t = e[e.length - 1];
3664
3665
  if (!t || t.role !== "assistant") return !1;
3665
- let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter((e) => !e.providerExecuted && (y(ci(e)) || ae(e)));
3666
- return r.length > 0 && r.every((e) => se.has(e.state ?? ""));
3666
+ let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter((e) => !e.providerExecuted && (ne(ci(e)) || ae(e)));
3667
+ return r.length > 0 && r.every((e) => oe.has(e.state ?? ""));
3667
3668
  };
3668
3669
  function di(e) {
3669
- return Te(`chatbot-${e}`, () => {
3670
- let { t, te: n, locale: r } = Se({ useScope: "global" }), i = x(""), a = x(), o = x(e), s = x(), c = x(), l = x(), u = x(), d = x(), f = x(), p = x(), m = x(), h = x(), g = x(), _ = x(), v = x(), ee = x(), y = x(), ne = x(), se = x(), me = S(), he = x(0), ye = x(0), be = x(), Te = S(), ke = S(), Ne = x(), Pe = x(), w = S(), Fe = x(!1), Ie = x({}), Le = x(!1), Re = x(0), ze = x(), Be = x(!1), Ve = we(), He = b(() => {
3670
+ return we(`chatbot-${e}`, () => {
3671
+ let { t, te: n, locale: r } = xe({ useScope: "global" }), i = S(""), a = S(), o = S(e), s = S(), c = S(), l = S(), u = S(), d = S(), f = S(), p = S(), m = S(), h = S(), g = S(), _ = S(), v = S(), y = S(), ne = S(), ie = S(), oe = S(), pe = C(), me = S(0), ve = S(0), ye = S(), we = S(), Oe = C(), Me = C(), Ne = S(), T = S(), Pe = C(), Fe = S(!1), Ie = S({}), Le = S({}), Re = S(!1), ze = S(0), Be = S(), Ve = S(!1), He = Ce(), Ue = x(() => {
3671
3672
  let e = u.value?.theme;
3672
- return e && e !== "auto" || (e = ze.value), e ? e === "dark" : Ve.value;
3673
- }), T = b(() => c.value === "reasoning"), Ue = b(() => T.value ? g.value?.filter((e) => ![
3673
+ return e && e !== "auto" || (e = Be.value), e ? e === "dark" : He.value;
3674
+ }), E = x(() => c.value === "reasoning"), We = x(() => E.value ? g.value?.filter((e) => ![
3674
3675
  "upvote",
3675
3676
  "downvote",
3676
3677
  "feedback"
3677
- ].includes(e)) : g.value), We = pe(b(() => `${o.value}-chatId`), null);
3678
- xe(() => {
3679
- We.value ||= ft();
3678
+ ].includes(e)) : g.value), Ge = fe(x(() => `${o.value}-chatId`), null);
3679
+ be(() => {
3680
+ Ge.value ||= pt();
3680
3681
  });
3681
- let E = b({
3682
- get: () => We.value,
3682
+ let D = x({
3683
+ get: () => Ge.value,
3683
3684
  set: (e) => {
3684
- We.value = e;
3685
+ Ge.value = e;
3685
3686
  }
3686
- }), Ge = fe(b(() => `${o.value}-pageAccessOff`), !1), D = b(() => Ge.value ? [] : Te.value ?? []), Ke = () => Ge.value ? [] : ke.value?.() ?? [], qe = b(() => !!(be.value && Te.value?.length)), Je = b(() => !!w.value && be.value?.pointer === !0 && D.value.length > 0);
3687
- C(Je, (e) => {
3688
- e || (Pe.value = void 0);
3687
+ }), Ke = de(x(() => `${o.value}-pageAccessOff`), !1), qe = x(() => Ke.value ? [] : Oe.value ?? []), Je = () => Ke.value ? [] : Me.value?.() ?? [], Ye = x(() => !!(ye.value && Oe.value?.length)), Xe = fe(x(() => `${o.value}-${l.value ?? "anonymous"}-confirmations`), "manual"), Ze = x(() => we.value?.allowAutomatic === !0), Qe = x(() => Ze.value && Xe.value === "automatic" ? "automatic" : "manual");
3688
+ function $e(e) {
3689
+ Xe.value = e;
3690
+ }
3691
+ let et = x(() => !!Pe.value && ye.value?.pointer === !0 && qe.value.length > 0);
3692
+ w(et, (e) => {
3693
+ e || (T.value = void 0);
3689
3694
  });
3690
- let Ye = pe(b(() => `${o.value}-pageNotice`), null), Xe = b(() => {
3691
- let e = be.value?.level;
3692
- return e && e !== te.Off && D.value.length && !ie(Ye.value ?? void 0, e) ? e : void 0;
3695
+ let tt = fe(x(() => `${o.value}-pageNotice`), null), nt = x(() => {
3696
+ let e = ye.value?.level;
3697
+ return e && e !== te.Off && qe.value.length && !re(tt.value ?? void 0, e) ? e : void 0;
3693
3698
  });
3694
- function Ze() {
3695
- Ye.value = be.value?.level ?? null;
3699
+ function rt() {
3700
+ tt.value = ye.value?.level ?? null;
3696
3701
  }
3697
- let O = x(), Qe = x(!1), $e = b(() => O.value?.message?.toLowerCase().includes("conversation-blocked") ?? !1);
3698
- function et(e) {
3702
+ let it = S(), at = S(!1), ot = x(() => it.value?.message?.toLowerCase().includes("conversation-blocked") ?? !1);
3703
+ function st(e) {
3699
3704
  try {
3700
3705
  let t = JSON.parse(e.message);
3701
3706
  return t.status === 404 || t.type?.includes("entity-not-found");
@@ -3703,59 +3708,67 @@ function di(e) {
3703
3708
  return !1;
3704
3709
  }
3705
3710
  }
3706
- function tt(e) {
3707
- if (et(e)) {
3708
- let e = I.value.messages.filter((e) => e.role === "user"), t = e[e.length - 1], n = t ? de(t) : void 0;
3709
- E.value = ft(), O.value = void 0, ge(() => {
3710
- I.value.clearError(), n && I.value.sendMessage({ text: n });
3711
+ function ct(e) {
3712
+ if (st(e)) {
3713
+ let e = z.value.messages.filter((e) => e.role === "user"), t = e[e.length - 1], n = t ? ue(t) : void 0;
3714
+ D.value = pt(), it.value = void 0, he(() => {
3715
+ z.value.clearError(), n && z.value.sendMessage({ text: n });
3711
3716
  });
3712
- } else le.error(e), O.value = e, $e.value && (Qe.value = !0);
3717
+ } else ce.error(e), it.value = e, ot.value && (at.value = !0);
3713
3718
  }
3714
- let k = b(() => ce({
3719
+ let O = x(() => se({
3715
3720
  baseUrl: i.value,
3716
3721
  basePath: a.value,
3717
3722
  headers: () => p.value
3718
- })), nt = x(null), rt = () => ({
3719
- ...Ee(),
3720
- ...nt.value ?? {}
3721
- }), it = () => {
3722
- let e = Re.value;
3723
+ })), lt = S(null), ut = () => ({
3724
+ ...Te(),
3725
+ ...lt.value ?? {}
3726
+ }), dt = () => {
3727
+ let e = ze.value;
3723
3728
  return new Promise((t) => {
3724
3729
  let n = setTimeout(() => {
3725
3730
  r(), t(!1);
3726
- }, 3e4), r = C(() => [Re.value, I.value.status], ([i, a]) => {
3731
+ }, 3e4), r = w(() => [ze.value, z.value.status], ([i, a]) => {
3727
3732
  i > e && a === "streaming" && (clearTimeout(n), r(), t(!0));
3728
3733
  });
3729
3734
  });
3730
- }, A = S(), at = (e, t) => new Promise((n) => {
3731
- A.value?.answer(!1), A.value = {
3735
+ }, k = C(), ft = (e, t) => new Promise((n) => {
3736
+ k.value?.answer(!1), k.value = {
3732
3737
  toolCallId: e.toolCallId,
3733
3738
  question: t?.question,
3734
3739
  details: t?.details,
3735
3740
  unchanged: t?.unchanged,
3736
3741
  answer: (e) => {
3737
- A.value = void 0, n(e);
3742
+ k.value = void 0, n(e);
3738
3743
  }
3739
3744
  };
3740
3745
  });
3741
- function ot(e) {
3742
- A.value?.answer(e);
3746
+ function A(e) {
3747
+ k.value?.answer(e);
3743
3748
  }
3744
- let st = ({ forms: e }) => be.value && D.value.length ? {
3749
+ let mt = (e, t) => {
3750
+ t.details?.some((e) => e.before !== void 0) && (Le.value = {
3751
+ ...Le.value,
3752
+ [e.toolCallId]: {
3753
+ details: t.details,
3754
+ unchanged: t.unchanged
3755
+ }
3756
+ });
3757
+ }, ht = ({ forms: e }) => ye.value && qe.value.length ? {
3745
3758
  version: 1,
3746
- features: [...re],
3747
- forms: e ? Ke().map(({ name: e, description: t, inputSchema: n, annotations: r }) => ({
3759
+ features: [...b],
3760
+ forms: e ? Je().map(({ name: e, description: t, inputSchema: n, annotations: r }) => ({
3748
3761
  name: e,
3749
3762
  description: t,
3750
3763
  inputSchema: n,
3751
3764
  annotations: r
3752
3765
  })) : []
3753
- } : void 0, ct = (e) => {
3766
+ } : void 0, gt = (e) => {
3754
3767
  if (e?.provider !== "page") {
3755
3768
  Ne.value = void 0;
3756
3769
  return;
3757
3770
  }
3758
- let t = [...D.value, ...Ke()].find((t) => t.name === e.toolName), n;
3771
+ let t = [...qe.value, ...Je()].find((t) => t.name === e.toolName), n;
3759
3772
  try {
3760
3773
  n = t?.describe?.(e.input);
3761
3774
  } catch {
@@ -3764,28 +3777,30 @@ function di(e) {
3764
3777
  n && (Ie.value = {
3765
3778
  ...Ie.value,
3766
3779
  [e.toolCallId]: n
3767
- }), e.readOnly ? Ne.value = void 0 : (Ne.value = { title: n ?? t?.annotations?.title ?? e.toolName }, Le.value = !0);
3768
- }, lt = Me({
3780
+ }), e.readOnly ? Ne.value = void 0 : (Ne.value = { title: n ?? t?.annotations?.title ?? e.toolName }, Re.value = !0);
3781
+ }, _t = je({
3769
3782
  registry: () => [
3770
- ...(me.value ?? []).filter((e) => !oe(e.name)),
3771
- ...D.value,
3772
- ...Ke()
3783
+ ...(pe.value ?? []).filter((e) => !ee(e.name)),
3784
+ ...qe.value,
3785
+ ...Je()
3773
3786
  ],
3774
- capability: () => se.value,
3775
- addToolOutput: (e) => void I.value.addToolOutput(e),
3776
- confirm: at,
3777
- waitForResume: it,
3787
+ capability: () => oe.value,
3788
+ addToolOutput: (e) => void z.value.addToolOutput(e),
3789
+ confirm: ft,
3790
+ waitForResume: dt,
3778
3791
  onPendingChange: (e) => {
3779
- he.value = e;
3792
+ me.value = e;
3780
3793
  },
3781
- onActivity: ct
3782
- }), ut = /* @__PURE__ */ new Map(), dt = 0, j = (e, t) => {
3783
- let n = ut.get(e);
3784
- ut.delete(e), n?.(JSON.stringify(t));
3785
- }, pt = Me({
3786
- registry: () => D.value,
3787
- capability: () => se.value,
3788
- addToolOutput: (e) => j(e.toolCallId, "output" in e ? e.output : {
3794
+ onActivity: gt,
3795
+ mode: () => Qe.value,
3796
+ onSkip: mt
3797
+ }), j = /* @__PURE__ */ new Map(), vt = 0, yt = (e, t) => {
3798
+ let n = j.get(e);
3799
+ j.delete(e), n?.(JSON.stringify(t));
3800
+ }, M = je({
3801
+ registry: () => qe.value,
3802
+ capability: () => oe.value,
3803
+ addToolOutput: (e) => yt(e.toolCallId, "output" in e ? e.output : {
3789
3804
  content: [{
3790
3805
  type: "text",
3791
3806
  text: e.errorText
@@ -3793,40 +3808,42 @@ function di(e) {
3793
3808
  isError: !0
3794
3809
  }),
3795
3810
  confirm: async (e, t) => {
3796
- for (; A.value;) await new Promise((e) => {
3797
- let t = C(A, (n) => {
3811
+ for (; k.value;) await new Promise((e) => {
3812
+ let t = w(k, (n) => {
3798
3813
  n || (t(), e());
3799
3814
  });
3800
3815
  });
3801
- return ut.has(e.toolCallId) ? at(e, t) : !1;
3816
+ return j.has(e.toolCallId) ? ft(e, t) : !1;
3802
3817
  },
3803
3818
  waitForResume: () => new Promise((e) => setTimeout(() => e(!0), qr)),
3804
3819
  onPendingChange: (e) => {
3805
- ye.value = e;
3820
+ ve.value = e;
3806
3821
  },
3807
- onActivity: ct
3808
- });
3809
- function mt() {
3810
- let e = st({ forms: !1 });
3822
+ onActivity: gt,
3823
+ mode: () => bt
3824
+ }), bt = "manual";
3825
+ function xt() {
3826
+ bt = Qe.value;
3827
+ let e = ht({ forms: !1 });
3811
3828
  if (e) return {
3812
3829
  declaration: e,
3813
- clientTools: Object.fromEntries(D.value.map((e) => [e.name, (t) => new Promise((n) => {
3814
- dt += 1;
3815
- let r = `page-call-${dt}`;
3816
- ut.set(r, n), pt.enqueue({
3830
+ clientTools: Object.fromEntries(qe.value.map((e) => [e.name, (t) => new Promise((n) => {
3831
+ vt += 1;
3832
+ let r = `page-call-${vt}`;
3833
+ j.set(r, n), M.enqueue({
3817
3834
  toolCallId: r,
3818
3835
  toolName: e.name,
3819
3836
  input: t ?? {},
3820
- messageId: kt()?.id ?? "",
3837
+ messageId: Pt()?.id ?? "",
3821
3838
  readOnly: e.annotations?.readOnlyHint === !0,
3822
3839
  provider: "page"
3823
3840
  });
3824
3841
  })]))
3825
3842
  };
3826
3843
  }
3827
- function ht() {
3828
- pt.cancelAll(), A.value && ut.has(A.value.toolCallId) && A.value.answer(!1);
3829
- for (let e of [...ut.keys()]) j(e, {
3844
+ function St() {
3845
+ M.cancelAll(), k.value && j.has(k.value.toolCallId) && k.value.answer(!1);
3846
+ for (let e of [...j.keys()]) yt(e, {
3830
3847
  content: [{
3831
3848
  type: "text",
3832
3849
  text: "Stopped by the user."
@@ -3834,34 +3851,34 @@ function di(e) {
3834
3851
  isError: !0
3835
3852
  });
3836
3853
  }
3837
- async function gt() {
3838
- _t(), ht(), Ne.value = void 0, Le.value = !1, W.value = "", await I.value.stop();
3854
+ async function N() {
3855
+ Ct(), St(), Ne.value = void 0, Re.value = !1, K.value = "", await z.value.stop();
3839
3856
  }
3840
- function _t() {
3841
- lt.cancelAll(), A.value && !ut.has(A.value.toolCallId) && A.value.answer(!1);
3857
+ function Ct() {
3858
+ _t.cancelAll(), k.value && !j.has(k.value.toolCallId) && k.value.answer(!1);
3842
3859
  }
3843
- async function vt(e) {
3844
- Ge.value = e, e && await gt();
3860
+ async function wt(e) {
3861
+ Ke.value = e, e && await N();
3845
3862
  }
3846
- C(E, () => _t(), { flush: "sync" });
3847
- let yt = !1, M, bt = x(), xt, St = x([]), N = x([]), P = x([]), F = x({}), Ct = /* @__PURE__ */ new Map(), wt = /* @__PURE__ */ new Set();
3848
- function Tt(e, t, n) {
3849
- N.value.includes(e) || (N.value = [...N.value, e]), Ct.set(e, Date.now()), n ? wt.add(e) : wt.delete(e), t && (F.value = {
3850
- ...F.value,
3863
+ w(D, () => Ct(), { flush: "sync" });
3864
+ let Tt = !1, P, Et = S(), Dt, Ot = S([]), F = S([]), I = S([]), L = S({}), kt = /* @__PURE__ */ new Map(), At = /* @__PURE__ */ new Set();
3865
+ function jt(e, t, n) {
3866
+ F.value.includes(e) || (F.value = [...F.value, e]), kt.set(e, Date.now()), n ? At.add(e) : At.delete(e), t && (L.value = {
3867
+ ...L.value,
3851
3868
  [e]: t
3852
- }), Z || Fn();
3869
+ }), Bn || Un();
3853
3870
  }
3854
- function Et(e) {
3855
- F.value = Object.fromEntries(Object.entries(F.value).filter(([t]) => t !== e));
3871
+ function Mt(e) {
3872
+ L.value = Object.fromEntries(Object.entries(L.value).filter(([t]) => t !== e));
3856
3873
  }
3857
- function Dt(e) {
3858
- Ct.delete(e), N.value = N.value.filter((t) => t !== e), P.value = P.value.filter((t) => t !== e), Et(e);
3874
+ function R(e) {
3875
+ kt.delete(e), F.value = F.value.filter((t) => t !== e), I.value = I.value.filter((t) => t !== e), Mt(e);
3859
3876
  }
3860
- let Ot = Gr(() => ({
3861
- id: E.value,
3877
+ let Nt = Gr(() => ({
3878
+ id: D.value,
3862
3879
  transport: new hr({
3863
- api: k.value.getChatEndpoint(o.value, T.value ? "reasoning" : "chat"),
3864
- prepareReconnectToStreamRequest: ({ id: e }) => ({ api: k.value.getChatStreamEndpoint(o.value, e) }),
3880
+ api: O.value.getChatEndpoint(o.value, E.value ? "reasoning" : "chat"),
3881
+ prepareReconnectToStreamRequest: ({ id: e }) => ({ api: O.value.getChatStreamEndpoint(o.value, e) }),
3865
3882
  prepareSendMessagesRequest: ({ messages: e, id: t }) => ({ body: {
3866
3883
  id: t,
3867
3884
  messages: [e[e.length - 1]],
@@ -3876,59 +3893,60 @@ function di(e) {
3876
3893
  reasoning: d.value?.reasoning,
3877
3894
  webSearch: f.value?.webSearch,
3878
3895
  smoothStream: u.value?.smoothStream,
3879
- deviceContext: rt(),
3880
- externalContext: ne.value,
3896
+ deviceContext: ut(),
3897
+ externalContext: ie.value,
3881
3898
  disabledTools: f.value?.disabled,
3882
- fallbackModels: ee.value,
3883
- gatewayOptions: y.value,
3884
- hostTools: je(me.value, se.value),
3885
- pageTools: st({ forms: !0 })
3899
+ fallbackModels: y.value,
3900
+ gatewayOptions: ne.value,
3901
+ hostTools: Ae(pe.value, oe.value),
3902
+ pageTools: ht({ forms: !0 }),
3903
+ ...Qe.value === "automatic" && { confirmations: "automatic" }
3886
3904
  } }),
3887
3905
  credentials: "include",
3888
3906
  headers: () => p.value ?? {}
3889
3907
  }),
3890
3908
  sendAutomaticallyWhen: (e) => ui(e) || _r(e),
3891
3909
  onError: (e) => {
3892
- yt ? le.warn(e) : tt(e);
3910
+ Tt ? ce.warn(e) : ct(e);
3893
3911
  },
3894
3912
  onToolCall: ({ toolCall: e }) => {
3895
- if (!Ae(e) || yt) return;
3913
+ if (!ke(e) || Tt) return;
3896
3914
  let t = e;
3897
- lt.enqueue({
3915
+ _t.enqueue({
3898
3916
  toolCallId: t.toolCallId,
3899
3917
  toolName: t.toolName,
3900
3918
  input: t.input,
3901
- messageId: kt()?.id ?? "",
3919
+ messageId: Pt()?.id ?? "",
3902
3920
  readOnly: t.toolMetadata?.readOnly === !0,
3903
3921
  provider: t.toolMetadata?.provider === "page" ? "page" : "app"
3904
3922
  });
3905
3923
  },
3906
3924
  onData: (e) => {
3907
- e.type === "data-turnStream" ? xt = e.data.streamId : e.type === "data-audioTranscripts" && (I.value.messages = ue(I.value.messages, e.data));
3925
+ e.type === "data-turnStream" ? Dt = e.data.streamId : e.type === "data-audioTranscripts" && (z.value.messages = le(z.value.messages, e.data));
3908
3926
  },
3909
3927
  onFinish: () => {
3910
- let e = E.value;
3911
- !T.value && !R.value.some((t) => t.id === e) && rn(o.value);
3928
+ let e = D.value;
3929
+ !E.value && !H.value.some((t) => t.id === e) && un(o.value);
3912
3930
  }
3913
- })), I = b(() => ve(Ot)), kt = () => I.value.messages[I.value.messages.length - 1];
3914
- C(E, (e, t) => {
3915
- if (t && !T.value && (K() || M?.chatId === t)) {
3916
- let e = I.value.messages.filter((e) => e.role === "user"), n = e[e.length - 1];
3917
- Tt(t, n ? de(n) ?? "" : "", I.value.status === "streaming" || M?.chatId === t);
3931
+ })), z = x(() => _e(Nt)), Pt = () => z.value.messages[z.value.messages.length - 1];
3932
+ w(D, (e, t) => {
3933
+ if (t && !E.value && (J() || P?.chatId === t)) {
3934
+ let e = z.value.messages.filter((e) => e.role === "user"), n = e[e.length - 1];
3935
+ jt(t, n ? ue(n) ?? "" : "", z.value.status === "streaming" || P?.chatId === t);
3918
3936
  }
3919
- Dt(e), xt = void 0, clearTimeout(J), q.value = !1, I.value.stop();
3937
+ R(e), Dt = void 0, clearTimeout(In), Fn.value = !1, z.value.stop();
3920
3938
  }, { flush: "sync" });
3921
- let At = b(() => {
3939
+ let Ft = x(() => {
3922
3940
  let e = u.value?.initialMessage;
3923
3941
  return e?.[r.value] ? e[r.value] : n("message.defaultAgentWelcome") ? t("message.defaultAgentWelcome") : "";
3924
- }), jt = ft(), Mt = b(() => ({
3925
- id: jt,
3942
+ }), B = pt(), V = x(() => ({
3943
+ id: B,
3926
3944
  role: "assistant",
3927
3945
  parts: [{
3928
3946
  type: "text",
3929
- text: At.value
3947
+ text: Ft.value
3930
3948
  }]
3931
- })), Nt = b(() => {
3949
+ })), It = x(() => {
3932
3950
  let e = (e) => e.map((e) => e.role !== "user" || !e.parts.some((e) => e.type === "file") ? e : {
3933
3951
  ...e,
3934
3952
  parts: e.parts.map((e) => {
@@ -3938,160 +3956,160 @@ function di(e) {
3938
3956
  let e = t.url.slice(13);
3939
3957
  return {
3940
3958
  ...t,
3941
- url: k.value.getMediaUrl(o.value, E.value, e)
3959
+ url: O.value.getMediaUrl(o.value, D.value, e)
3942
3960
  };
3943
3961
  }
3944
3962
  return t.url.startsWith("blob:") ? t : {
3945
3963
  ...t,
3946
- url: k.value.appendAuthToken(t.url)
3964
+ url: O.value.appendAuthToken(t.url)
3947
3965
  };
3948
3966
  })
3949
- }), t = I.value.id === E.value ? I.value.messages : [];
3950
- return T.value ? e(t) : !Be.value && t[0]?.role !== "assistant" ? [Mt.value, ...e(t)] : e(t);
3951
- }), L = b(() => {
3967
+ }), t = z.value.id === D.value ? z.value.messages : [];
3968
+ return E.value ? e(t) : !Ve.value && t[0]?.role !== "assistant" ? [V.value, ...e(t)] : e(t);
3969
+ }), Lt = x(() => {
3952
3970
  let e = u.value?.messagePlaceholder;
3953
3971
  return e?.[r.value] ? e[r.value] : n("placeholder.askAnything") ? t("placeholder.askAnything") : "";
3954
- }), R = x([]), Pt = x(!1), Ft = x(1), It = x(!1), z = x(!1), B, V = x([]), Lt = x(!1), Rt = x("chat"), zt = x(0), Bt = x([]), Vt = x(), Ht = x(!1), Ut = x(!1), Wt = x(), Gt = x(!1), Kt = x(!1), qt = x(), H = x(""), U = x([]), W = x(""), Jt = S(), Yt = x(0), Xt = fe(b(() => `${o.value}-queue`), {}), Zt = b(() => Xt.value[E.value] ?? []), Qt = b(() => !T.value);
3955
- function $t(e, t) {
3956
- let n = Object.fromEntries(Object.entries(Xt.value).filter(([t]) => t !== e));
3957
- Xt.value = t.length > 0 ? {
3972
+ }), H = S([]), Rt = S(!1), zt = S(1), Bt = S(!1), Vt = S(!1), Ht, U = S([]), Ut = S(!1), Wt = S("chat"), Gt = S(0), Kt = S([]), qt = S(), Jt = S(!1), Yt = S(!1), Xt = S(), Zt = S(!1), Qt = S(!1), $t = S(), W = S(""), G = S([]), K = S(""), en = C(), q = S(0), tn = de(x(() => `${o.value}-queue`), {}), nn = x(() => tn.value[D.value] ?? []), rn = x(() => !E.value);
3973
+ function an(e, t) {
3974
+ let n = Object.fromEntries(Object.entries(tn.value).filter(([t]) => t !== e));
3975
+ tn.value = t.length > 0 ? {
3958
3976
  ...n,
3959
3977
  [e]: t
3960
3978
  } : n;
3961
3979
  }
3962
- function en(e) {
3963
- let t = (Xt.value[e] ?? []).join(si);
3964
- return $t(e, []), t;
3980
+ function on(e) {
3981
+ let t = (tn.value[e] ?? []).join(si);
3982
+ return an(e, []), t;
3965
3983
  }
3966
- function tn(e) {
3967
- e && (H.value = H.value ? `${H.value}${si}${e}` : e);
3984
+ function sn(e) {
3985
+ e && (W.value = W.value ? `${W.value}${si}${e}` : e);
3968
3986
  }
3969
- function nn(e) {
3970
- $t(E.value, Zt.value.filter((t, n) => n !== e));
3987
+ function cn(e) {
3988
+ an(D.value, nn.value.filter((t, n) => n !== e));
3971
3989
  }
3972
- function G(e) {
3973
- let t = Zt.value[e];
3974
- nn(e), tn(t ?? "");
3990
+ function ln(e) {
3991
+ let t = nn.value[e];
3992
+ cn(e), sn(t ?? "");
3975
3993
  }
3976
- async function rn(e) {
3977
- if (T.value) R.value = [];
3994
+ async function un(e) {
3995
+ if (E.value) H.value = [];
3978
3996
  else {
3979
- Pt.value = !0;
3997
+ Rt.value = !0;
3980
3998
  try {
3981
- let t = await k.value.getConversations(e, l.value), n = new Set(t.map((e) => e.id)), r = N.value.filter((e) => !n.has(e) && F.value[e]).map((t) => ({
3999
+ let t = await O.value.getConversations(e, l.value), n = new Set(t.map((e) => e.id)), r = F.value.filter((e) => !n.has(e) && L.value[e]).map((t) => ({
3982
4000
  id: t,
3983
4001
  agentId: e,
3984
- title: F.value[t],
4002
+ title: L.value[t],
3985
4003
  summary: null,
3986
4004
  messages: [],
3987
4005
  lastMessageAt: /* @__PURE__ */ new Date()
3988
4006
  })), i = `${e}:${l.value ?? ""}`;
3989
- i !== B && (Ft.value = 1);
3990
- let a = new Set(r.map((e) => e.id)), o = Ft.value > 1 ? R.value.filter((e) => !n.has(e.id) && !a.has(e.id)) : [];
3991
- R.value = [
4007
+ i !== Ht && (zt.value = 1);
4008
+ let a = new Set(r.map((e) => e.id)), o = zt.value > 1 ? H.value.filter((e) => !n.has(e.id) && !a.has(e.id)) : [];
4009
+ H.value = [
3992
4010
  ...r,
3993
4011
  ...t,
3994
4012
  ...o
3995
- ], B = i, Ft.value === 1 && (It.value = t.length >= 100);
4013
+ ], Ht = i, zt.value === 1 && (Bt.value = t.length >= 100);
3996
4014
  } catch {
3997
- R.value = [], Ft.value = 1, B = void 0, It.value = !1;
4015
+ H.value = [], zt.value = 1, Ht = void 0, Bt.value = !1;
3998
4016
  return;
3999
4017
  } finally {
4000
- Pt.value = !1;
4018
+ Rt.value = !1;
4001
4019
  }
4002
- In([.../* @__PURE__ */ new Set([...X(), ...R.value.map((e) => e.id)])]);
4020
+ Wn([.../* @__PURE__ */ new Set([...Rn(), ...H.value.map((e) => e.id)])]);
4003
4021
  }
4004
4022
  }
4005
- async function an() {
4006
- if (!It.value || z.value || T.value) return;
4007
- z.value = !0;
4008
- let e = B;
4023
+ async function dn() {
4024
+ if (!Bt.value || Vt.value || E.value) return;
4025
+ Vt.value = !0;
4026
+ let e = Ht;
4009
4027
  try {
4010
- let t = Ft.value + 1, n = await k.value.getConversations(o.value, l.value, { page: t });
4011
- if (e !== B) return;
4012
- let r = new Set(R.value.map((e) => e.id));
4013
- R.value = [...R.value, ...n.filter((e) => !r.has(e.id))], Ft.value = t, It.value = n.length >= 100;
4028
+ let t = zt.value + 1, n = await O.value.getConversations(o.value, l.value, { page: t });
4029
+ if (e !== Ht) return;
4030
+ let r = new Set(H.value.map((e) => e.id));
4031
+ H.value = [...H.value, ...n.filter((e) => !r.has(e.id))], zt.value = t, Bt.value = n.length >= 100;
4014
4032
  } catch {} finally {
4015
- z.value = !1;
4033
+ Vt.value = !1;
4016
4034
  }
4017
4035
  }
4018
- async function on(e) {
4019
- return T.value ? [] : k.value.getConversations(o.value, l.value, { search: e });
4036
+ async function fn(e) {
4037
+ return E.value ? [] : O.value.getConversations(o.value, l.value, { search: e });
4020
4038
  }
4021
- async function sn() {
4022
- let e = E.value;
4023
- if (!e) V.value = [];
4039
+ async function pn() {
4040
+ let e = D.value;
4041
+ if (!e) U.value = [];
4024
4042
  else {
4025
- Lt.value = !0;
4043
+ Ut.value = !0;
4026
4044
  try {
4027
- V.value = await k.value.getChatFiles(e);
4045
+ U.value = await O.value.getChatFiles(e);
4028
4046
  } catch {
4029
- V.value = [];
4047
+ U.value = [];
4030
4048
  } finally {
4031
- Lt.value = !1;
4049
+ Ut.value = !1;
4032
4050
  }
4033
4051
  }
4034
4052
  }
4035
- function cn(e, t = !1) {
4036
- return k.value.getChatFileDownloadUrl(e, t);
4053
+ function mn(e, t = !1) {
4054
+ return O.value.getChatFileDownloadUrl(e, t);
4037
4055
  }
4038
- function ln(e) {
4039
- return k.value.getChatFilePreviewUrl(e);
4056
+ function hn(e) {
4057
+ return O.value.getChatFilePreviewUrl(e);
4040
4058
  }
4041
- async function un(e) {
4042
- await k.value.deleteChatFile(e);
4043
- let t = V.value.find((t) => t.documentId === e), n = t?.kind === "spreadsheet" ? t.sourceAttachmentId ?? t.documentId : void 0;
4044
- V.value = V.value.filter((t) => t.documentId !== e && (!n || t.documentId !== n && t.sourceAttachmentId !== n));
4059
+ async function gn(e) {
4060
+ await O.value.deleteChatFile(e);
4061
+ let t = U.value.find((t) => t.documentId === e), n = t?.kind === "spreadsheet" ? t.sourceAttachmentId ?? t.documentId : void 0;
4062
+ U.value = U.value.filter((t) => t.documentId !== e && (!n || t.documentId !== n && t.sourceAttachmentId !== n));
4045
4063
  }
4046
- async function dn(e, t) {
4047
- if (!T.value) try {
4048
- let n = await k.value.getChat(e, t);
4049
- if (t !== E.value || I.value.status !== "ready" || I.value.messages.length > 0) return;
4050
- n && (I.value.messages = n.messages, Qe.value = n.blocked ?? !1, fn(e, t, n.turnInProgress === !0));
4064
+ async function _n(e, t) {
4065
+ if (!E.value) try {
4066
+ let n = await O.value.getChat(e, t);
4067
+ if (t !== D.value || z.value.status !== "ready" || z.value.messages.length > 0) return;
4068
+ n && (z.value.messages = n.messages, at.value = n.blocked ?? !1, vn(e, t, n.turnInProgress === !0));
4051
4069
  } catch {}
4052
4070
  }
4053
- async function fn(e, t, n) {
4054
- n && (await pn(t), t !== E.value || K()) || (await mn(e, t), t === E.value && await vn());
4071
+ async function vn(e, t, n) {
4072
+ n && (await yn(t), t !== D.value || J()) || (await bn(e, t), t === D.value && await wn());
4055
4073
  }
4056
- async function pn(e) {
4074
+ async function yn(e) {
4057
4075
  let t = { chatId: e };
4058
- M = t, bt.value = e;
4059
- let n = () => M === t && e === E.value, r = Date.now() + $r;
4076
+ P = t, Et.value = e;
4077
+ let n = () => P === t && e === D.value, r = Date.now() + $r;
4060
4078
  try {
4061
- for (; n() && !K() && Date.now() < r;) {
4062
- yt = !0;
4079
+ for (; n() && !J() && Date.now() < r;) {
4080
+ Tt = !0;
4063
4081
  try {
4064
- await I.value.resumeStream();
4082
+ await z.value.resumeStream();
4065
4083
  } finally {
4066
- yt = !1;
4084
+ Tt = !1;
4067
4085
  }
4068
4086
  if (!n()) return;
4069
- I.value.clearError();
4070
- let t = await k.value.getChat(o.value, e).catch(() => null);
4071
- if (!t || !n() || K()) return;
4087
+ z.value.clearError();
4088
+ let t = await O.value.getChat(o.value, e).catch(() => null);
4089
+ if (!t || !n() || J()) return;
4072
4090
  if (!t.turnInProgress) {
4073
- I.value.messages = t.messages;
4091
+ z.value.messages = t.messages;
4074
4092
  return;
4075
4093
  }
4076
4094
  await new Promise((e) => setTimeout(e, ei));
4077
4095
  }
4078
4096
  } finally {
4079
- M === t && (M = void 0, bt.value = void 0);
4097
+ P === t && (P = void 0, Et.value = void 0);
4080
4098
  }
4081
4099
  }
4082
- async function mn(e, t) {
4100
+ async function bn(e, t) {
4083
4101
  let n;
4084
4102
  try {
4085
- n = Number(sessionStorage.getItem(Oe)), sessionStorage.removeItem(Oe);
4103
+ n = Number(sessionStorage.getItem(De)), sessionStorage.removeItem(De);
4086
4104
  } catch {
4087
4105
  return;
4088
4106
  }
4089
- if (!(!n || Date.now() - n > 6e4 || Ge.value)) for (let n = 0; n < 12; n++) {
4090
- let n = I.value.messages[I.value.messages.length - 1];
4107
+ if (!(!n || Date.now() - n > 6e4 || Ke.value)) for (let n = 0; n < 12; n++) {
4108
+ let n = z.value.messages[z.value.messages.length - 1];
4091
4109
  if (n?.role === "assistant") {
4092
4110
  let e = n.parts.filter((e) => ae(e) && e.state === "input-available"), t = e.filter((e) => e.toolMetadata?.provider === "page" && e.toolMetadata.readOnly === !0);
4093
4111
  if (e.length > 0) {
4094
- if (t.length === e.length && !Ge.value) for (let e of t) lt.enqueue({
4112
+ if (t.length === e.length && !Ke.value) for (let e of t) _t.enqueue({
4095
4113
  toolCallId: e.toolCallId,
4096
4114
  toolName: e.toolName,
4097
4115
  input: e.input,
@@ -4103,359 +4121,359 @@ function di(e) {
4103
4121
  }
4104
4122
  if (n.parts[n.parts.length - 1]?.type === "text") return;
4105
4123
  }
4106
- if (await new Promise((e) => setTimeout(e, 1500)), t !== E.value || I.value.status !== "ready") return;
4124
+ if (await new Promise((e) => setTimeout(e, 1500)), t !== D.value || z.value.status !== "ready") return;
4107
4125
  try {
4108
- let n = await k.value.getChat(e, t);
4109
- n && t === E.value && (I.value.messages = n.messages);
4126
+ let n = await O.value.getChat(e, t);
4127
+ n && t === D.value && (z.value.messages = n.messages);
4110
4128
  } catch {
4111
4129
  return;
4112
4130
  }
4113
4131
  }
4114
4132
  }
4115
- let K = () => {
4116
- let e = I.value.status;
4133
+ let J = () => {
4134
+ let e = z.value.status;
4117
4135
  return e === "submitted" || e === "streaming";
4118
- }, hn = () => K() || M?.chatId === E.value || he.value > 0, gn = () => {
4119
- let e = kt();
4120
- return A.value !== void 0 || Jr(e) || li(e);
4121
- }, _n = /* @__PURE__ */ new Set();
4122
- async function vn() {
4123
- let e = E.value;
4124
- if (!(_n.has(e) || Zt.value.length === 0 || hn() || O.value)) {
4125
- if (gn()) tn(en(e));
4136
+ }, xn = () => J() || P?.chatId === D.value || me.value > 0, Sn = () => {
4137
+ let e = Pt();
4138
+ return k.value !== void 0 || Jr(e) || li(e);
4139
+ }, Cn = /* @__PURE__ */ new Set();
4140
+ async function wn() {
4141
+ let e = D.value;
4142
+ if (!(Cn.has(e) || nn.value.length === 0 || xn() || it.value)) {
4143
+ if (Sn()) sn(on(e));
4126
4144
  else {
4127
- _n.add(e);
4145
+ Cn.add(e);
4128
4146
  try {
4129
4147
  let t = Date.now() + ii;
4130
- for (; Date.now() < t && (await Promise.race([k.value.getRunningTurns(o.value, [e]).catch(() => []), new Promise((t) => setTimeout(() => t([e]), oi))])).includes(e);) await new Promise((e) => setTimeout(e, ai));
4131
- if (e !== E.value || hn()) return;
4132
- let n = en(e);
4133
- n && On(n);
4148
+ for (; Date.now() < t && (await Promise.race([O.value.getRunningTurns(o.value, [e]).catch(() => []), new Promise((t) => setTimeout(() => t([e]), oi))])).includes(e);) await new Promise((e) => setTimeout(e, ai));
4149
+ if (e !== D.value || xn()) return;
4150
+ let n = on(e);
4151
+ n && jn(n);
4134
4152
  } finally {
4135
- _n.delete(e);
4153
+ Cn.delete(e);
4136
4154
  }
4137
4155
  }
4138
4156
  }
4139
4157
  }
4140
- let yn = 0, bn = 0;
4141
- async function xn() {
4142
- if (T.value || K()) return "indeterminate";
4143
- let e = E.value, t = yn += 1;
4158
+ let Tn = 0, En = 0;
4159
+ async function Dn() {
4160
+ if (E.value || J()) return "indeterminate";
4161
+ let e = D.value, t = Tn += 1;
4144
4162
  try {
4145
- let n = await k.value.getChat(o.value, e);
4146
- if (!n || e !== E.value || K() || t <= bn) return "indeterminate";
4147
- bn = t;
4148
- let r = n.messages, i = Qr(r, I.value.messages);
4149
- return I.value.messages = [...r, ...i], Qe.value = n.blocked ?? !1, i.length > 0 ? "pending" : "caught-up";
4163
+ let n = await O.value.getChat(o.value, e);
4164
+ if (!n || e !== D.value || J() || t <= En) return "indeterminate";
4165
+ En = t;
4166
+ let r = n.messages, i = Qr(r, z.value.messages);
4167
+ return z.value.messages = [...r, ...i], at.value = n.blocked ?? !1, i.length > 0 ? "pending" : "caught-up";
4150
4168
  } catch {}
4151
4169
  return "indeterminate";
4152
4170
  }
4153
- function Sn(e) {
4154
- I.value.messages = [...I.value.messages, e];
4171
+ function On(e) {
4172
+ z.value.messages = [...z.value.messages, e];
4155
4173
  }
4156
- async function Cn(e) {
4174
+ async function kn(e) {
4157
4175
  try {
4158
- Bt.value = await k.value.getMessageFeedbacks(e);
4176
+ Kt.value = await O.value.getMessageFeedbacks(e);
4159
4177
  } catch {
4160
- Bt.value = [];
4178
+ Kt.value = [];
4161
4179
  }
4162
4180
  }
4163
- function wn(e) {
4164
- let t = Bt.value.findIndex((t) => t.messageId === e.messageId);
4165
- t >= 0 ? Bt.value[t] = e : Bt.value.push(e);
4181
+ function Y(e) {
4182
+ let t = Kt.value.findIndex((t) => t.messageId === e.messageId);
4183
+ t >= 0 ? Kt.value[t] = e : Kt.value.push(e);
4166
4184
  }
4167
- function Tn(e) {
4168
- let t = Nt.value, n = t.findIndex((t) => t.id === e.id), r = de(e) ?? "", i = t.slice(0, n).reverse().find((e) => e.role === "user");
4185
+ function X(e) {
4186
+ let t = It.value, n = t.findIndex((t) => t.id === e.id), r = ue(e) ?? "", i = t.slice(0, n).reverse().find((e) => e.role === "user");
4169
4187
  return {
4170
- userQuestion: de(i ?? e) ?? "",
4188
+ userQuestion: ue(i ?? e) ?? "",
4171
4189
  assistantMessage: r
4172
4190
  };
4173
4191
  }
4174
- async function En(e, t) {
4192
+ async function Z(e, t) {
4175
4193
  await Promise.all([
4176
- dn(e, t),
4177
- rn(e),
4178
- Cn(t)
4179
- ]), nt.value || De((e, t) => k.value.reverseGeocode(e, t, r.value)).then((e) => {
4180
- e && (nt.value = e);
4194
+ _n(e, t),
4195
+ un(e),
4196
+ kn(t)
4197
+ ]), lt.value || Ee((e, t) => O.value.reverseGeocode(e, t, r.value)).then((e) => {
4198
+ e && (lt.value = e);
4181
4199
  });
4182
4200
  }
4183
- async function Dn() {
4184
- let e = H.value.trim(), t = U.value.filter((e) => e.state === "done" && e.mediaSource !== void 0).map((e) => ({
4201
+ async function An() {
4202
+ let e = W.value.trim(), t = G.value.filter((e) => e.state === "done" && e.mediaSource !== void 0).map((e) => ({
4185
4203
  type: "file",
4186
4204
  mediaType: e.mediaSource.mimeType,
4187
4205
  url: e.localUrl,
4188
4206
  filename: e.mediaSource.name,
4189
4207
  providerMetadata: { "8bot": { media: e.mediaSource } }
4190
- })), n = Je.value ? Pe.value : void 0;
4191
- !T.value && hn() ? e && t.length === 0 && !n && ($t(E.value, [...Zt.value, e]), H.value = "") : (T.value && Nt.value.length > 0 && await Vn(), On(e, t, n), H.value = "", Pe.value = void 0, Bn());
4208
+ })), n = et.value ? T.value : void 0;
4209
+ !E.value && xn() ? e && t.length === 0 && !n && (an(D.value, [...nn.value, e]), W.value = "") : (E.value && It.value.length > 0 && await Yn(), jn(e, t, n), W.value = "", T.value = void 0, Jn());
4192
4210
  }
4193
- function On(e, t = [], n) {
4194
- _t(), W.value = e, Jt.value = n, Yt.value = I.value.messages.length;
4195
- let r = I.value.sendMessage;
4211
+ function jn(e, t = [], n) {
4212
+ Ct(), K.value = e, en.value = n, q.value = z.value.messages.length;
4213
+ let r = z.value.sendMessage;
4196
4214
  r({
4197
4215
  text: e,
4198
4216
  files: t.length > 0 ? t : void 0,
4199
4217
  ...n && { metadata: { pagePointer: n } }
4200
4218
  });
4201
4219
  }
4202
- function kn(e) {
4220
+ function Mn(e) {
4203
4221
  let t = e.trim();
4204
4222
  if (!t) return;
4205
- if (I.value.status !== "ready") {
4206
- le.warn("[useChatbotStore] sendMessage called before chat is ready. Listen for the \"ready\" event on the widget element.");
4223
+ if (z.value.status !== "ready") {
4224
+ ce.warn("[useChatbotStore] sendMessage called before chat is ready. Listen for the \"ready\" event on the widget element.");
4207
4225
  return;
4208
4226
  }
4209
- let n = I.value.sendMessage;
4210
- _t(), n({ text: t });
4227
+ let n = z.value.sendMessage;
4228
+ Ct(), n({ text: t });
4211
4229
  }
4212
- async function An() {
4213
- let e = I.value.messages.slice(Yt.value).some((e) => e.parts.some(ae)), t = W.value, n = Jt.value, r = t.length > 0 && !e, i = E.value, a = Yt.value, s = M?.chatId === i, c = xt, l = en(i), u = (e = "") => {
4214
- H.value = [
4230
+ async function Nn() {
4231
+ let e = z.value.messages.slice(q.value).some((e) => e.parts.some(ae)), t = K.value, n = en.value, r = t.length > 0 && !e, i = D.value, a = q.value, s = P?.chatId === i, c = Dt, l = on(i), u = (e = "") => {
4232
+ W.value = [
4215
4233
  e,
4216
4234
  l,
4217
- H.value
4235
+ W.value
4218
4236
  ].filter(Boolean).join(si);
4219
- }, d = () => i === E.value && !K() && Yt.value === a ? !1 : (l && $t(i, [l, ...Xt.value[i] ?? []]), !0);
4220
- M = void 0, bt.value = void 0, _t(), await I.value.stop();
4221
- let f = T.value || e && !s || await k.value.stopChatTurn(o.value, i, c).catch(() => !0);
4237
+ }, d = () => i === D.value && !J() && q.value === a ? !1 : (l && an(i, [l, ...tn.value[i] ?? []]), !0);
4238
+ P = void 0, Et.value = void 0, Ct(), await z.value.stop();
4239
+ let f = E.value || e && !s || await O.value.stopChatTurn(o.value, i, c).catch(() => !0);
4222
4240
  if (!d()) {
4223
4241
  if (s || !f) {
4224
- if (await xn(), d()) return;
4225
- if (s || I.value.messages.length > Yt.value) {
4226
- W.value = "", u();
4242
+ if (await Dn(), d()) return;
4243
+ if (s || z.value.messages.length > q.value) {
4244
+ K.value = "", u();
4227
4245
  return;
4228
4246
  }
4229
4247
  }
4230
- r ? (u(t), Pe.value ??= n, I.value.messages = I.value.messages.slice(0, Yt.value), W.value = "") : u();
4248
+ r ? (u(t), T.value ??= n, z.value.messages = z.value.messages.slice(0, q.value), K.value = "") : u();
4231
4249
  }
4232
4250
  }
4233
- C(() => I.value.messages, (e) => {
4234
- let t = A.value?.toolCallId;
4235
- t && !ut.has(t) && !e.some((e) => e.parts.some((e) => e.toolCallId === t)) && _t();
4236
- }), C(() => I.value.status, (e) => {
4237
- e === "submitted" && (Re.value++, xt = void 0);
4251
+ w(() => z.value.messages, (e) => {
4252
+ let t = k.value?.toolCallId;
4253
+ t && !j.has(t) && !e.some((e) => e.parts.some((e) => e.toolCallId === t)) && Ct();
4254
+ }), w(() => z.value.status, (e) => {
4255
+ e === "submitted" && (ze.value++, Dt = void 0);
4238
4256
  });
4239
- let jn;
4240
- C(() => [
4241
- I.value.status,
4242
- he.value,
4243
- ye.value
4257
+ let Pn;
4258
+ w(() => [
4259
+ z.value.status,
4260
+ me.value,
4261
+ ve.value
4244
4262
  ], ([e, t, n]) => {
4245
- clearTimeout(jn), e === "ready" && t === 0 && n === 0 && (jn = setTimeout(() => {
4246
- Le.value = !1;
4263
+ clearTimeout(Pn), e === "ready" && t === 0 && n === 0 && (Pn = setTimeout(() => {
4264
+ Re.value = !1;
4247
4265
  }, 1500));
4248
4266
  });
4249
- let q = x(!1), J;
4250
- C(() => !A.value && !Jr(kt()) && (K() || he.value > 0), (e) => {
4251
- clearTimeout(J), e ? q.value = !0 : J = setTimeout(() => {
4252
- q.value = !1;
4267
+ let Fn = S(!1), In;
4268
+ w(() => !k.value && !Jr(Pt()) && (J() || me.value > 0), (e) => {
4269
+ clearTimeout(In), e ? Fn.value = !0 : In = setTimeout(() => {
4270
+ Fn.value = !1;
4253
4271
  }, 400);
4254
4272
  }, { immediate: !0 });
4255
- let Y = b(() => {
4256
- let e = St.value.filter((e) => e !== E.value);
4257
- return q.value || bt.value === E.value ? [...e, E.value] : e;
4258
- }), X = () => [.../* @__PURE__ */ new Set([...St.value, ...N.value])], Mn = Ce(), Z, Nn = 0, Pn = 0;
4259
- function Fn() {
4260
- clearTimeout(Z), Z = void 0, X().length !== 0 && Mn.value === "visible" && (Z = setTimeout(() => {
4261
- Z = void 0, In(X());
4273
+ let Ln = x(() => {
4274
+ let e = Ot.value.filter((e) => e !== D.value);
4275
+ return Fn.value || Et.value === D.value ? [...e, D.value] : e;
4276
+ }), Rn = () => [.../* @__PURE__ */ new Set([...Ot.value, ...F.value])], zn = Se(), Bn, Vn = 0, Hn = 0;
4277
+ function Un() {
4278
+ clearTimeout(Bn), Bn = void 0, Rn().length !== 0 && zn.value === "visible" && (Bn = setTimeout(() => {
4279
+ Bn = void 0, Wn(Rn());
4262
4280
  }, ti));
4263
4281
  }
4264
- async function In(e) {
4282
+ async function Wn(e) {
4265
4283
  let t = e.slice(0, ni);
4266
- if (T.value || t.length === 0) {
4267
- Fn();
4284
+ if (E.value || t.length === 0) {
4285
+ Un();
4268
4286
  return;
4269
4287
  }
4270
- let n = Nn += 1, r;
4288
+ let n = Vn += 1, r;
4271
4289
  try {
4272
- r = await k.value.getRunningTurns(o.value, t);
4290
+ r = await O.value.getRunningTurns(o.value, t);
4273
4291
  } catch {
4274
- Fn();
4292
+ Un();
4275
4293
  return;
4276
4294
  }
4277
- if (n <= Pn) return;
4278
- Pn = n;
4279
- for (let e of r) wt.add(e);
4280
- let i = new Set(t), a = X().filter((e) => i.has(e) && !r.includes(e)), s = (e) => N.value.includes(e) && !wt.has(e), c = a.filter((e) => s(e) && Date.now() - (Ct.get(e) ?? 0) > ri), l = a.filter((e) => !s(e));
4281
- St.value = [...St.value.filter((e) => !i.has(e)), ...r];
4282
- let u = l.filter((e) => N.value.includes(e));
4283
- (u.length > 0 || c.length > 0) && (N.value = N.value.filter((e) => !u.includes(e) && !c.includes(e)), P.value = [...P.value, ...u.filter((e) => e !== E.value && !P.value.includes(e))]), l.length > 0 && rn(o.value), Fn();
4295
+ if (n <= Hn) return;
4296
+ Hn = n;
4297
+ for (let e of r) At.add(e);
4298
+ let i = new Set(t), a = Rn().filter((e) => i.has(e) && !r.includes(e)), s = (e) => F.value.includes(e) && !At.has(e), c = a.filter((e) => s(e) && Date.now() - (kt.get(e) ?? 0) > ri), l = a.filter((e) => !s(e));
4299
+ Ot.value = [...Ot.value.filter((e) => !i.has(e)), ...r];
4300
+ let u = l.filter((e) => F.value.includes(e));
4301
+ (u.length > 0 || c.length > 0) && (F.value = F.value.filter((e) => !u.includes(e) && !c.includes(e)), I.value = [...I.value, ...u.filter((e) => e !== D.value && !I.value.includes(e))]), l.length > 0 && un(o.value), Un();
4284
4302
  }
4285
- C(Mn, (e) => {
4286
- e === "visible" ? In(X()) : (clearTimeout(Z), Z = void 0);
4287
- }), _e(() => clearTimeout(Z));
4288
- let Ln = b(() => P.value.map((e) => ({
4303
+ w(zn, (e) => {
4304
+ e === "visible" ? Wn(Rn()) : (clearTimeout(Bn), Bn = void 0);
4305
+ }), ge(() => clearTimeout(Bn));
4306
+ let Gn = x(() => I.value.map((e) => ({
4289
4307
  chatId: e,
4290
- title: R.value.find((t) => t.id === e)?.title || F.value[e] || void 0
4308
+ title: H.value.find((t) => t.id === e)?.title || L.value[e] || void 0
4291
4309
  })));
4292
- function Rn(e) {
4293
- Dt(e), E.value = e, or("chat");
4310
+ function Kn(e) {
4311
+ R(e), D.value = e, mr("chat");
4294
4312
  }
4295
- function zn(e) {
4296
- P.value = P.value.filter((t) => t !== e), Et(e);
4313
+ function qn(e) {
4314
+ I.value = I.value.filter((t) => t !== e), Mt(e);
4297
4315
  }
4298
- C(() => [I.value.status, I.value.id], ([e, t], [n, r]) => {
4316
+ w(() => [z.value.status, z.value.id], ([e, t], [n, r]) => {
4299
4317
  if (t === r) {
4300
- if (e === "error") M?.chatId !== E.value && tn(en(E.value));
4318
+ if (e === "error") P?.chatId !== D.value && sn(on(D.value));
4301
4319
  else if (e === "ready" && (n === "streaming" || n === "submitted")) {
4302
- if (gn()) {
4303
- tn(en(E.value));
4320
+ if (Sn()) {
4321
+ sn(on(D.value));
4304
4322
  return;
4305
4323
  }
4306
- vn();
4324
+ wn();
4307
4325
  }
4308
4326
  }
4309
- }), C(he, (e) => {
4310
- e === 0 && I.value.status === "ready" && vn();
4311
- }), C(() => I.value.status, (e) => {
4312
- e === "ready" && W.value.length > 0 && (W.value = "");
4327
+ }), w(me, (e) => {
4328
+ e === 0 && z.value.status === "ready" && wn();
4329
+ }), w(() => z.value.status, (e) => {
4330
+ e === "ready" && K.value.length > 0 && (K.value = "");
4313
4331
  });
4314
- function Bn(e = !1) {
4315
- for (let t of U.value) (e || t.state !== "done") && URL.revokeObjectURL(t.localUrl);
4316
- U.value = [], Xn.value = null;
4332
+ function Jn(e = !1) {
4333
+ for (let t of G.value) (e || t.state !== "done") && URL.revokeObjectURL(t.localUrl);
4334
+ G.value = [], Q.value = null;
4317
4335
  }
4318
- async function Vn() {
4319
- return W.value = "", Ie.value = {}, E.value = ft(), await ge(), I.value.clearError(), O.value = void 0, Qe.value = !1, Bn(!0), or("chat"), E.value;
4336
+ async function Yn() {
4337
+ return K.value = "", Ie.value = {}, Le.value = {}, D.value = pt(), await he(), z.value.clearError(), it.value = void 0, at.value = !1, Jn(!0), mr("chat"), D.value;
4320
4338
  }
4321
- async function Hn(e) {
4322
- I.value.status !== "ready" && (W.value = "", await An()), _t(), await I.value.regenerate(e);
4339
+ async function Xn(e) {
4340
+ z.value.status !== "ready" && (K.value = "", await Nn()), Ct(), await z.value.regenerate(e);
4323
4341
  }
4324
- function Un(e) {
4342
+ function Zn(e) {
4325
4343
  if (e.tool === "requestGeolocation") {
4326
4344
  let t = e.output;
4327
- "latitude" in t && (nt.value = {
4345
+ "latitude" in t && (lt.value = {
4328
4346
  geolocationLatitude: t.latitude,
4329
4347
  geolocationLongitude: t.longitude,
4330
4348
  geolocationAccuracy: t.accuracy,
4331
4349
  geolocationCity: t.city
4332
4350
  });
4333
4351
  }
4334
- I.value.addToolOutput(e);
4352
+ z.value.addToolOutput(e);
4335
4353
  }
4336
- function Wn(e) {
4337
- I.value.addToolApprovalResponse(e);
4354
+ function Qn(e) {
4355
+ z.value.addToolApprovalResponse(e);
4338
4356
  }
4339
- let Gn = b(() => I.value.messages.reduce((e, t) => e + t.parts.filter((e) => e.type === "file").length, 0)), Kn = b(() => _.value?.maxFilesPerMessage ?? 5), qn = b(() => _.value?.maxFilesPerChat ?? 20), Jn = b(() => Math.max(0, Math.min(Kn.value - U.value.length, qn.value - Gn.value - U.value.length))), Yn = b(() => Jn.value <= 0), Xn = x(null), Zn = () => {
4340
- Xn.value = null;
4357
+ let $n = x(() => z.value.messages.reduce((e, t) => e + t.parts.filter((e) => e.type === "file").length, 0)), er = x(() => _.value?.maxFilesPerMessage ?? 5), tr = x(() => _.value?.maxFilesPerChat ?? 20), nr = x(() => Math.max(0, Math.min(er.value - G.value.length, tr.value - $n.value - G.value.length))), rr = x(() => nr.value <= 0), Q = S(null), ir = () => {
4358
+ Q.value = null;
4341
4359
  };
4342
- C(Yn, (e) => {
4343
- e || (Xn.value = null);
4360
+ w(rr, (e) => {
4361
+ e || (Q.value = null);
4344
4362
  });
4345
- async function Qn(e) {
4346
- if (Yn.value) {
4347
- Xn.value = qn.value - Gn.value - U.value.length <= Kn.value - U.value.length ? {
4363
+ async function ar(e) {
4364
+ if (rr.value) {
4365
+ Q.value = tr.value - $n.value - G.value.length <= er.value - G.value.length ? {
4348
4366
  reason: "per-chat",
4349
- max: qn.value
4367
+ max: tr.value
4350
4368
  } : {
4351
4369
  reason: "per-message",
4352
- max: Kn.value
4370
+ max: er.value
4353
4371
  };
4354
4372
  return;
4355
4373
  }
4356
- let t = ft(), n = {
4374
+ let t = pt(), n = {
4357
4375
  id: t,
4358
4376
  file: e,
4359
4377
  localUrl: URL.createObjectURL(e),
4360
4378
  state: "uploading"
4361
4379
  };
4362
- U.value = [...U.value, n];
4380
+ G.value = [...G.value, n];
4363
4381
  try {
4364
- let n = await k.value.uploadMedia(o.value, E.value, e);
4365
- U.value = U.value.map((e) => e.id === t ? {
4382
+ let n = await O.value.uploadMedia(o.value, D.value, e);
4383
+ G.value = G.value.map((e) => e.id === t ? {
4366
4384
  ...e,
4367
4385
  state: "done",
4368
4386
  mediaSource: n
4369
4387
  } : e);
4370
4388
  } catch (e) {
4371
4389
  let n = e instanceof Error ? e.message : "Upload failed";
4372
- U.value = U.value.map((e) => e.id === t ? {
4390
+ G.value = G.value.map((e) => e.id === t ? {
4373
4391
  ...e,
4374
4392
  state: "error",
4375
4393
  error: n
4376
4394
  } : e);
4377
4395
  }
4378
4396
  }
4379
- async function $n(e, t) {
4380
- let { userQuestion: n, assistantMessage: r } = Tn(e);
4381
- wn(await k.value.submitMessageFeedback({
4397
+ async function or(e, t) {
4398
+ let { userQuestion: n, assistantMessage: r } = X(e);
4399
+ Y(await O.value.submitMessageFeedback({
4382
4400
  messageId: e.id,
4383
- chatId: E.value,
4401
+ chatId: D.value,
4384
4402
  agentId: o.value,
4385
4403
  vote: t,
4386
4404
  userQuestion: n,
4387
4405
  assistantMessage: r
4388
4406
  }));
4389
4407
  }
4390
- async function er(e) {
4391
- await $n(e, "upvote");
4408
+ async function sr(e) {
4409
+ await or(e, "upvote");
4392
4410
  }
4393
- async function tr(e) {
4394
- await $n(e, "downvote");
4411
+ async function cr(e) {
4412
+ await or(e, "downvote");
4395
4413
  }
4396
- function nr(e) {
4397
- Ut.value = !1, Wt.value = void 0, Vt.value = e;
4414
+ function lr(e) {
4415
+ Yt.value = !1, Xt.value = void 0, qt.value = e;
4398
4416
  }
4399
- async function rr(e) {
4400
- if (Vt.value) try {
4401
- Ht.value = !0, Ut.value = !1, Wt.value = void 0;
4402
- let { userQuestion: t, assistantMessage: n } = Tn(Vt.value);
4403
- wn(await k.value.submitMessageFeedback({
4404
- messageId: Vt.value.id,
4405
- chatId: E.value,
4417
+ async function ur(e) {
4418
+ if (qt.value) try {
4419
+ Jt.value = !0, Yt.value = !1, Xt.value = void 0;
4420
+ let { userQuestion: t, assistantMessage: n } = X(qt.value);
4421
+ Y(await O.value.submitMessageFeedback({
4422
+ messageId: qt.value.id,
4423
+ chatId: D.value,
4406
4424
  agentId: o.value,
4407
4425
  userQuestion: t,
4408
4426
  assistantMessage: n,
4409
4427
  comment: e
4410
- })), Ut.value = !0, await Cn(E.value);
4428
+ })), Yt.value = !0, await kn(D.value);
4411
4429
  } catch {
4412
- Wt.value = n("message.feedbackSubmitError") ? t("message.feedbackSubmitError") : "Failed to submit feedback";
4430
+ Xt.value = n("message.feedbackSubmitError") ? t("message.feedbackSubmitError") : "Failed to submit feedback";
4413
4431
  } finally {
4414
- Ht.value = !1;
4432
+ Jt.value = !1;
4415
4433
  }
4416
4434
  }
4417
- async function Q(e) {
4435
+ async function dr(e) {
4418
4436
  try {
4419
- Kt.value = !0, Gt.value = !1, qt.value = void 0, await k.value.submitLead({
4437
+ Qt.value = !0, Zt.value = !1, $t.value = void 0, await O.value.submitLead({
4420
4438
  agentId: o.value,
4421
- chatId: E.value,
4439
+ chatId: D.value,
4422
4440
  ...e
4423
- }), Gt.value = !0;
4441
+ }), Zt.value = !0;
4424
4442
  } catch {
4425
- qt.value = n("message.leadSubmitError") ? t("message.leadSubmitError") : "Failed to submit lead";
4443
+ $t.value = n("message.leadSubmitError") ? t("message.leadSubmitError") : "Failed to submit lead";
4426
4444
  } finally {
4427
- Kt.value = !1;
4445
+ Qt.value = !1;
4428
4446
  }
4429
4447
  }
4430
- async function ir(e, t) {
4431
- let n = await k.value.updateChatTitle(o.value, e, t);
4432
- R.value = R.value.map((t) => t.id === e ? {
4448
+ async function fr(e, t) {
4449
+ let n = await O.value.updateChatTitle(o.value, e, t);
4450
+ H.value = H.value.map((t) => t.id === e ? {
4433
4451
  ...t,
4434
4452
  title: n.title
4435
4453
  } : t);
4436
4454
  }
4437
- async function ar(e) {
4438
- await k.value.deleteChat(o.value, e), R.value = R.value.filter((t) => t.id !== e), E.value === e && await Vn();
4455
+ async function pr(e) {
4456
+ await O.value.deleteChat(o.value, e), H.value = H.value.filter((t) => t.id !== e), D.value === e && await Yn();
4439
4457
  }
4440
- function or(e) {
4441
- Rt.value = e;
4458
+ function mr(e) {
4459
+ Wt.value = e;
4442
4460
  }
4443
- function sr() {
4444
- or("chat"), zt.value++;
4461
+ function gr() {
4462
+ mr("chat"), Gt.value++;
4445
4463
  }
4446
- let cr;
4447
- function lr(e) {
4448
- let t = () => k.value.getChat(o.value, e).then((e) => e !== null);
4464
+ let vr;
4465
+ function yr(e) {
4466
+ let t = () => O.value.getChat(o.value, e).then((e) => e !== null);
4449
4467
  return t().catch(() => t().catch(() => !1));
4450
4468
  }
4451
- return C(l, async (e) => {
4452
- if (!e || e === cr) return;
4453
- let t = cr;
4454
- if (cr = e, t === void 0) return;
4455
- let n = E.value, r = !T.value && await lr(n);
4456
- l.value === e && E.value === n && (r ? rn(o.value) : (R.value = [], Bt.value = [], V.value = [], St.value = [], N.value = [], P.value = [], F.value = {}, await Vn(), H.value = ""));
4469
+ return w(l, async (e) => {
4470
+ if (!e || e === vr) return;
4471
+ let t = vr;
4472
+ if (vr = e, t === void 0) return;
4473
+ let n = D.value, r = !E.value && await yr(n);
4474
+ l.value === e && D.value === n && (r ? un(o.value) : (H.value = [], Kt.value = [], U.value = [], Ot.value = [], F.value = [], I.value = [], L.value = {}, await Yn(), W.value = ""));
4457
4475
  }), {
4458
- apiClient: k,
4476
+ apiClient: O,
4459
4477
  baseUrl: i,
4460
4478
  basePath: a,
4461
4479
  agentId: o,
@@ -4469,106 +4487,111 @@ function di(e) {
4469
4487
  revisedAnswers: m,
4470
4488
  model: h,
4471
4489
  actionsInput: g,
4472
- actions: Ue,
4490
+ actions: We,
4473
4491
  agentFileUpload: _,
4474
4492
  agentVoice: v,
4475
- fallbackModels: ee,
4476
- gatewayOptions: y,
4477
- externalContext: ne,
4478
- agentHostTools: se,
4479
- hostToolRegistry: me,
4480
- hostToolsPending: he,
4481
- agentPageAccess: be,
4482
- pageToolRegistry: Te,
4483
- pageFormsProvider: ke,
4493
+ fallbackModels: y,
4494
+ gatewayOptions: ne,
4495
+ externalContext: ie,
4496
+ agentHostTools: oe,
4497
+ hostToolRegistry: pe,
4498
+ hostToolsPending: me,
4499
+ agentPageAccess: ye,
4500
+ pageToolRegistry: Oe,
4501
+ pageFormsProvider: Me,
4484
4502
  pageAction: Ne,
4485
4503
  hostStepTitles: Ie,
4486
- pageControlActive: Le,
4487
- isWorking: q,
4488
- stopHostActions: gt,
4489
- voicePageTools: mt,
4490
- cancelVoicePageCalls: ht,
4491
- pageNoticeLevel: Xe,
4492
- closePageNotice: Ze,
4493
- hostConfirmation: A,
4494
- respondHostConfirmation: ot,
4495
- pageAccessAvailable: qe,
4496
- pageAccessOff: Ge,
4497
- setPageAccessOff: vt,
4498
- pagePointer: Pe,
4499
- pagePointerStart: w,
4504
+ hostStepChanges: Le,
4505
+ pageControlActive: Re,
4506
+ isWorking: Fn,
4507
+ stopHostActions: N,
4508
+ voicePageTools: xt,
4509
+ cancelVoicePageCalls: St,
4510
+ pageNoticeLevel: nt,
4511
+ closePageNotice: rt,
4512
+ hostConfirmation: k,
4513
+ respondHostConfirmation: A,
4514
+ pageAccessAvailable: Ye,
4515
+ pageAccessOff: Ke,
4516
+ setPageAccessOff: wt,
4517
+ agentConfirmations: we,
4518
+ confirmationsAvailable: Ze,
4519
+ confirmationMode: Qe,
4520
+ setConfirmationMode: $e,
4521
+ pagePointer: T,
4522
+ pagePointerStart: Pe,
4500
4523
  pagePointing: Fe,
4501
- pagePointerAvailable: Je,
4502
- systemTheme: ze,
4503
- hideWelcomeMessage: Be,
4504
- isDark: He,
4505
- chat: I,
4506
- messages: Nt,
4507
- conversations: R,
4508
- isLoadingConversations: Pt,
4509
- hasMoreConversations: It,
4510
- isLoadingMoreConversations: z,
4511
- chatFiles: V,
4512
- isLoadingChatFiles: Lt,
4513
- input: H,
4514
- pendingAttachments: U,
4515
- isAttachmentLimitReached: Yn,
4516
- fileLimitError: Xn,
4517
- localChatId: E,
4518
- isConversationBlocked: Qe,
4519
- inputMessagePlaceholder: L,
4520
- chatError: O,
4521
- runningChatIds: Y,
4522
- backgroundAnswers: Ln,
4523
- openBackgroundAnswer: Rn,
4524
- dismissBackgroundAnswer: zn,
4525
- canQueue: Qt,
4526
- queuedMessages: Zt,
4527
- removeQueuedMessage: nn,
4528
- editQueuedMessage: G,
4529
- activeView: Rt,
4530
- inputFocusRequest: zt,
4531
- messageFeedbacks: Bt,
4532
- feedbackDialogMessage: Vt,
4533
- isFeedbackSubmitting: Ht,
4534
- isFeedbackSubmitted: Ut,
4535
- feedbackSubmitError: Wt,
4536
- isLeadSubmitted: Gt,
4537
- isLoadingSubmitLead: Kt,
4538
- submitLeadError: qt,
4539
- buildDeviceContext: rt,
4540
- initialize: En,
4541
- loadConversations: rn,
4542
- loadMoreConversations: an,
4543
- searchConversations: on,
4544
- loadChatFiles: sn,
4545
- refreshMessages: xn,
4546
- appendMessage: Sn,
4547
- getChatFileUrl: cn,
4548
- getChatFilePreviewUrl: ln,
4549
- deleteChatFile: un,
4550
- handleSubmit: Dn,
4551
- sendMessage: kn,
4552
- stopGeneration: An,
4553
- startNewChat: Vn,
4554
- regenerate: Hn,
4555
- addToolOutput: Un,
4556
- addToolApprovalResponse: Wn,
4557
- handleFileSelect: Qn,
4558
- clearFileLimitError: Zn,
4559
- clearPendingAttachments: Bn,
4560
- onUpvote: er,
4561
- onDownvote: tr,
4562
- onFeedback: nr,
4563
- onFeedbackSubmit: rr,
4564
- onLeadSubmit: Q,
4565
- navigate: or,
4566
- focusInput: sr,
4567
- renameChatTitle: ir,
4568
- deleteChat: ar
4524
+ pagePointerAvailable: et,
4525
+ systemTheme: Be,
4526
+ hideWelcomeMessage: Ve,
4527
+ isDark: Ue,
4528
+ chat: z,
4529
+ messages: It,
4530
+ conversations: H,
4531
+ isLoadingConversations: Rt,
4532
+ hasMoreConversations: Bt,
4533
+ isLoadingMoreConversations: Vt,
4534
+ chatFiles: U,
4535
+ isLoadingChatFiles: Ut,
4536
+ input: W,
4537
+ pendingAttachments: G,
4538
+ isAttachmentLimitReached: rr,
4539
+ fileLimitError: Q,
4540
+ localChatId: D,
4541
+ isConversationBlocked: at,
4542
+ inputMessagePlaceholder: Lt,
4543
+ chatError: it,
4544
+ runningChatIds: Ln,
4545
+ backgroundAnswers: Gn,
4546
+ openBackgroundAnswer: Kn,
4547
+ dismissBackgroundAnswer: qn,
4548
+ canQueue: rn,
4549
+ queuedMessages: nn,
4550
+ removeQueuedMessage: cn,
4551
+ editQueuedMessage: ln,
4552
+ activeView: Wt,
4553
+ inputFocusRequest: Gt,
4554
+ messageFeedbacks: Kt,
4555
+ feedbackDialogMessage: qt,
4556
+ isFeedbackSubmitting: Jt,
4557
+ isFeedbackSubmitted: Yt,
4558
+ feedbackSubmitError: Xt,
4559
+ isLeadSubmitted: Zt,
4560
+ isLoadingSubmitLead: Qt,
4561
+ submitLeadError: $t,
4562
+ buildDeviceContext: ut,
4563
+ initialize: Z,
4564
+ loadConversations: un,
4565
+ loadMoreConversations: dn,
4566
+ searchConversations: fn,
4567
+ loadChatFiles: pn,
4568
+ refreshMessages: Dn,
4569
+ appendMessage: On,
4570
+ getChatFileUrl: mn,
4571
+ getChatFilePreviewUrl: hn,
4572
+ deleteChatFile: gn,
4573
+ handleSubmit: An,
4574
+ sendMessage: Mn,
4575
+ stopGeneration: Nn,
4576
+ startNewChat: Yn,
4577
+ regenerate: Xn,
4578
+ addToolOutput: Zn,
4579
+ addToolApprovalResponse: Qn,
4580
+ handleFileSelect: ar,
4581
+ clearFileLimitError: ir,
4582
+ clearPendingAttachments: Jn,
4583
+ onUpvote: sr,
4584
+ onDownvote: cr,
4585
+ onFeedback: lr,
4586
+ onFeedbackSubmit: ur,
4587
+ onLeadSubmit: dr,
4588
+ navigate: mr,
4589
+ focusInput: gr,
4590
+ renameChatTitle: fr,
4591
+ deleteChat: pr
4569
4592
  };
4570
4593
  })();
4571
4594
  }
4572
- export { ft as a, hr as i, di as n, Gr as r, Kr as t };
4595
+ export { pt as a, hr as i, di as n, Gr as r, Kr as t };
4573
4596
 
4574
- //# sourceMappingURL=useChatbotStore-DcvdWkgq.js.map
4597
+ //# sourceMappingURL=useChatbotStore-CY1gAHOh.js.map