@marimo-team/islands 0.25.3-dev141 → 0.25.3-dev142

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 (472) hide show
  1. package/dist/{ConnectedDataExplorerComponent-CNSxdKyJ.js → ConnectedDataExplorerComponent-BAiSVaHj.js} +17 -15
  2. package/dist/{ErrorBoundary-Cg59O3xL.js → ErrorBoundary-DxdeETpm.js} +16 -16
  3. package/dist/{abnfDiagram-VCTEODGH-DQDjNXt3.js → abnfDiagram-VCTEODGH-BBHN92-F.js} +2 -2
  4. package/dist/any-language-editor-3E24SnCV.js +75 -0
  5. package/dist/{architectureDiagram-5GKGNRK7-Nmls7Wxn.js → architectureDiagram-5GKGNRK7-C0Rd64qh.js} +1 -1
  6. package/dist/{arrays-CN1djC4k.js → arrays-R6JsImiT.js} +8 -0
  7. package/dist/assets/__vite-browser-external-BgQNn4dS.js +1 -0
  8. package/dist/assets/worker-FKe3RHT4.js +113 -0
  9. package/dist/{button-CvjkwdSk.js → button-BQRdqQi1.js} +199 -192
  10. package/dist/{capabilities-CQ5IjhzL.js → capabilities-CI4xUPsp.js} +2 -2
  11. package/dist/{chat-ui-BDpymeoe.js → chat-ui-CvB8Map3.js} +1195 -1195
  12. package/dist/{check-EDwSwP89.js → check-SpOMoCLP.js} +1 -1
  13. package/dist/{chunk-IMKFNOWR-CoIFEo-1.js → chunk-IMKFNOWR-hJXey5p2.js} +1 -1
  14. package/dist/{chunk-SHT3W25Y-lHiGx3ZC.js → chunk-SHT3W25Y-JMzTmmVW.js} +1 -1
  15. package/dist/{chunk-SVP7TREG-BvsHIrY_.js → chunk-SVP7TREG-BIyoHTXi.js} +1 -1
  16. package/dist/{chunk-TICWLB2K-BC8YIm_n.js → chunk-TICWLB2K-CCzH2Uwa.js} +1 -1
  17. package/dist/{chunk-YOKDWASO-DPZk8vhS.js → chunk-YOKDWASO-DKplTrBY.js} +20 -20
  18. package/dist/{classDiagram-ZZMXUADV-Bt98lkkv.js → classDiagram-ZZMXUADV-DB1kOPS6.js} +2 -2
  19. package/dist/{classDiagram-v2-VYDZK3BY-D9bfbcC3.js → classDiagram-v2-VYDZK3BY-CPaFL0OB.js} +2 -2
  20. package/dist/{code-visibility-Da3iitn_.js → code-visibility-CO8abjLo.js} +17 -17
  21. package/dist/{common-C6FHcu5p.js → common-CbFJQhaI.js} +6341 -5870
  22. package/dist/{copy-icon-Ft7t9bqz.js → copy-icon-C1trdvVt.js} +3 -3
  23. package/dist/{cynefinDiagram-5FMLGOSQ-CgWra7wt.js → cynefinDiagram-5FMLGOSQ-CF93uliH.js} +1 -1
  24. package/dist/{dagre-GXQ25YYZ-CFZ8-35c.js → dagre-GXQ25YYZ-BBB-_p9D.js} +1 -1
  25. package/dist/{data-grid-overlay-editor-mJt3Pg4S.js → data-grid-overlay-editor-DBjVUS2K.js} +5 -5
  26. package/dist/{data-grid-types-BH_r7g7l.js → data-grid-types-0PJ-9N5n.js} +1 -1
  27. package/dist/{diagram-S7CK7UJ4-lCNQrW7d.js → diagram-S7CK7UJ4-BynCnbyt.js} +1 -1
  28. package/dist/{diagram-UQ7AKVKN-CQPQ6pP_.js → diagram-UQ7AKVKN-svOxikMa.js} +1 -1
  29. package/dist/{diagram-VX7I27RA-Cf3b0llz.js → diagram-VX7I27RA-BVQSnPx0.js} +1 -1
  30. package/dist/{diagram-Z3DM3KII-Bt4QLrpn.js → diagram-Z3DM3KII-nR1J0BH5.js} +1 -1
  31. package/dist/{dialog-CEBFZNyc.js → dialog-DgeqyrEZ.js} +3 -3
  32. package/dist/{dist-DpBpA_n1.js → dist-Lm-D-Vr6.js} +3 -3
  33. package/dist/{dropdown-menu-CP_qCYHC.js → dropdown-menu-GWcGCcxE.js} +1277 -1229
  34. package/dist/{ebnfDiagram-PWID7BFC-D3NAyPFY.js → ebnfDiagram-PWID7BFC-C9tq9-Qo.js} +2 -2
  35. package/dist/{erDiagram-RLTQ6QDP-Tlu09_Nm.js → erDiagram-RLTQ6QDP-BiaeB7Fi.js} +1 -1
  36. package/dist/{error-banner-Da600cwz.js → error-banner-D40pmfQQ.js} +86 -81
  37. package/dist/{cells-C8iCYvLU.js → error-entries-CmFDQ9CA.js} +1718 -1621
  38. package/dist/{feedback-button-DaPwHIdM.js → feedback-button-CWQoIUKQ.js} +122 -123
  39. package/dist/{flowDiagram-HODETNUW-CAYbpJmV.js → flowDiagram-HODETNUW-f-sLm87k.js} +2 -2
  40. package/dist/{formats-BGh2thRc.js → formats-CCxaLPNs.js} +3 -3
  41. package/dist/{ganttDiagram-EL5Y4UJY-BQT16JSc.js → ganttDiagram-EL5Y4UJY-Dh_4cBJZ.js} +2 -2
  42. package/dist/{glide-data-editor-Ctz2mH6k.js → glide-data-editor-BxT8eGip.js} +370 -368
  43. package/dist/{glide-utils-DJyqh0EM.js → glide-utils-Dz_F4pAY.js} +16 -16
  44. package/dist/{globals-EpFoRj_E.js → globals-f0UxWZkr.js} +3 -3
  45. package/dist/{highlighted-body-KPVGNVTW-zwjq21tf.js → highlighted-body-KPVGNVTW-3Ziwfz-V.js} +2 -2
  46. package/dist/{html-to-image-CZY1pIZH.js → html-to-image-BrC8OJcj.js} +634 -597
  47. package/dist/{infoDiagram-27XIBGKW-XrDxhr0x.js → infoDiagram-27XIBGKW-BHrWywBe.js} +1 -1
  48. package/dist/{ishikawaDiagram-5VMMS53U-CD1muzov.js → ishikawaDiagram-5VMMS53U-Da4s0Reg.js} +1 -1
  49. package/dist/{kanban-definition-UXKFOSKX-Dg9W142_.js → kanban-definition-UXKFOSKX-DDf1GVLj.js} +1 -1
  50. package/dist/{label-BDKF3Afc.js → label-D9_-zSg-.js} +3 -3
  51. package/dist/{linear-Cnaq3Tfb.js → linear-DWERh7eI.js} +121 -73
  52. package/dist/{loader-BQOfjTIJ.js → loader-DOVB0Syl.js} +12 -12
  53. package/dist/main.js +7548 -7226
  54. package/dist/{mermaid-CiAXjLpA.js → mermaid-ClwTt7OD.js} +38 -38
  55. package/dist/mermaid-HWGCJPDP-Du3-HPQA.js +2 -0
  56. package/dist/{mindmap-definition-YA3MSWOX-DgCidgYJ.js → mindmap-definition-YA3MSWOX-D60oMZtT.js} +1 -1
  57. package/dist/{number-overlay-editor-CtxrummL.js → number-overlay-editor-Dso2H7DV.js} +3 -3
  58. package/dist/{objects-CzUgoMIF.js → objects-DCmMvZtn.js} +1 -3
  59. package/dist/{once-BtE-wKRL.js → once-eG8Vmvjd.js} +1 -1
  60. package/dist/{pegDiagram-XKGWAZYB-coOYYKB6.js → pegDiagram-XKGWAZYB-B9wFpMga.js} +2 -2
  61. package/dist/{pieDiagram-E7YTZNPT-BnXTc3bj.js → pieDiagram-E7YTZNPT-BZwvMuBT.js} +1 -1
  62. package/dist/precisionRound-DhAzeRcm.js +49 -0
  63. package/dist/{process-output-e4jj9Ijt.js → process-output-Bw-vzyoy.js} +4 -4
  64. package/dist/{quadrantDiagram-AXDQQJYC-Ccw0xMjN.js → quadrantDiagram-AXDQQJYC-Blrm7V7_.js} +1 -1
  65. package/dist/{railroadDiagram-O6MQD6OU-B28-u83n.js → railroadDiagram-O6MQD6OU-DqhZGsN2.js} +2 -2
  66. package/dist/{react-vega-BED0DjiB.js → react-vega-C4T9Rb_w.js} +12284 -12270
  67. package/dist/{requirementDiagram-BXWQKSXE-CdYCTMu0.js → requirementDiagram-BXWQKSXE-CL5dYARV.js} +1 -1
  68. package/dist/{reveal-component-DrIXvR_7.js → reveal-component-DMglhlng.js} +14 -14
  69. package/dist/{select-BButFi-d.js → select-CkF_GBxO.js} +537 -458
  70. package/dist/{sequenceDiagram-WJ2MYXX4-CM3aRAe_.js → sequenceDiagram-WJ2MYXX4-BSUCRd2x.js} +1 -1
  71. package/dist/{spec-BwarBpUJ.js → spec-DiSh_qJC.js} +41 -11
  72. package/dist/{stateDiagram-D77RDMKH-DOZUMVj8.js → stateDiagram-D77RDMKH-B-1Hvyb0.js} +2 -2
  73. package/dist/{stateDiagram-v2-MP3YSRHH-CISYxma6.js → stateDiagram-v2-MP3YSRHH--HtiR4yB.js} +2 -2
  74. package/dist/style.css +1 -1
  75. package/dist/{swimlanes-42K2YHIH-BkSppxp8.js → swimlanes-42K2YHIH-Bdfhrd-2.js} +1 -1
  76. package/dist/{swimlanesDiagram-VR7AAH4N-c8G5pGxC.js → swimlanesDiagram-VR7AAH4N-BJIfxSz0.js} +2 -2
  77. package/dist/{swiper-component-DKntyn8p.js → swiper-component-BkCm-kLg.js} +2 -2
  78. package/dist/{time-BieKwdYS.js → time-BaMbJs4z.js} +18 -18
  79. package/dist/{timeline-definition-24CTP7MA-CaMQayqK.js → timeline-definition-24CTP7MA-Cs4EfFD3.js} +1 -1
  80. package/dist/{toDate-BNJf01u1.js → toDate-DGvRHwTk.js} +57 -54
  81. package/dist/{toast-B9UMEi8u.js → toast-Btbve3Lm.js} +231 -213
  82. package/dist/{tooltip-BO1REbqs.js → tooltip-CJ4Rqasp.js} +327 -303
  83. package/dist/{use-restore-focus-BEM7sFWl.js → use-restore-focus-CmGwRNId.js} +1482 -1433
  84. package/dist/{useAsyncData-Deh5kszT.js → useAsyncData-BmVgnMP5.js} +15 -14
  85. package/dist/{useDateFormatter-D8XruNGG.js → useDateFormatter-eCL_SdeG.js} +2 -2
  86. package/dist/{useDeepCompareMemoize-DXwzRINI.js → useDeepCompareMemoize-Ch_AeGu6.js} +1 -1
  87. package/dist/{useIframeCapabilities-DBETvvPl.js → useIframeCapabilities-CSdWn6NP.js} +1 -1
  88. package/dist/{useLifecycle-j7D9uD1o.js → useLifecycle-B5BX921H.js} +3 -3
  89. package/dist/{useTheme-CRnjkku0.js → useTheme-Bq9pi_vz.js} +6 -6
  90. package/dist/{vega-component-DG29TAB7.js → vega-component-BgyZ-COt.js} +147 -147
  91. package/dist/{vega-embed-container-BNHE18G9.js → vega-embed-container--LYZqguO.js} +2 -2
  92. package/dist/{vega-loader.browser-DNST6uVf.js → vega-loader.browser-B9Pz0EGP.js} +298 -507
  93. package/dist/{vennDiagram-4TSXK5OY-CF8pfaK3.js → vennDiagram-4TSXK5OY-DRu0vRjO.js} +1 -1
  94. package/dist/{wardleyDiagram-VM6X3IG4-dGPu39d-.js → wardleyDiagram-VM6X3IG4-DzbDxwDY.js} +1 -1
  95. package/dist/{xychartDiagram-S5SC5T6Z-CP6-9q56.js → xychartDiagram-S5SC5T6Z-CLWj6ZFQ.js} +2 -2
  96. package/package.json +15 -12
  97. package/src/__tests__/fixtures/{pair-preview.ts → pair-config.ts} +3 -2
  98. package/src/__tests__/host-imports.test.ts +101 -0
  99. package/src/__tests__/module-entry.test.ts +32 -0
  100. package/src/__tests__/mount.test.ts +8 -8
  101. package/src/components/ai/__tests__/ai-model-dropdown.test.tsx +63 -0
  102. package/src/components/ai/ai-model-dropdown.tsx +11 -6
  103. package/src/components/app-config/ai-config.tsx +7 -2
  104. package/src/components/chat/__tests__/message-queue.test.tsx +17 -0
  105. package/src/components/chat/acp/__tests__/session-tabs.test.tsx +43 -0
  106. package/src/components/chat/acp/__tests__/state.test.ts +2 -2
  107. package/src/components/chat/acp/blocks.tsx +3 -2
  108. package/src/components/chat/acp/session-tabs.tsx +8 -3
  109. package/src/components/chat/chat-components.tsx +2 -0
  110. package/src/components/chat/chat-panel.tsx +9 -8
  111. package/src/components/chat/chat-utils.ts +4 -8
  112. package/src/components/data-table/TableTopBar.tsx +2 -0
  113. package/src/components/data-table/__tests__/chart-spec-model.test.ts +195 -195
  114. package/src/components/data-table/__tests__/column-explorer.test.tsx +27 -1
  115. package/src/components/data-table/__tests__/columns.test.tsx +105 -0
  116. package/src/components/data-table/__tests__/context-menu-interaction.test.tsx +130 -0
  117. package/src/components/data-table/__tests__/context-menu.test.ts +176 -0
  118. package/src/components/data-table/__tests__/data-table.test.tsx +1 -0
  119. package/src/components/data-table/__tests__/date-filter-inputs.test.tsx +24 -1
  120. package/src/components/data-table/__tests__/date-popover.test.tsx +72 -0
  121. package/src/components/data-table/__tests__/export-actions.test.tsx +434 -6
  122. package/src/components/data-table/__tests__/keyboard-selection.test.tsx +188 -0
  123. package/src/components/data-table/__tests__/search-highlight.test.tsx +109 -0
  124. package/src/components/data-table/__tests__/url-detector.test.tsx +74 -0
  125. package/src/components/data-table/cell-selection/feature.ts +2 -2
  126. package/src/components/data-table/cell-selection/types.ts +2 -2
  127. package/src/components/data-table/charts/__tests__/chart-panel.test.tsx +74 -1
  128. package/src/components/data-table/charts/__tests__/spec-snapshot.test.ts +20 -20
  129. package/src/components/data-table/charts/__tests__/spec.test.ts +78 -52
  130. package/src/components/data-table/charts/__tests__/storage.test.ts +4 -1
  131. package/src/components/data-table/charts/chart-spec/spec.ts +68 -43
  132. package/src/components/data-table/charts/charts.tsx +40 -30
  133. package/src/components/data-table/charts/storage.ts +16 -5
  134. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +1 -1
  135. package/src/components/data-table/column-summary/chart-spec-model.tsx +23 -16
  136. package/src/components/data-table/column-summary/column-summary.tsx +2 -4
  137. package/src/components/data-table/column-visibility-dropdown.tsx +8 -13
  138. package/src/components/data-table/columns.tsx +45 -46
  139. package/src/components/data-table/context-menu.tsx +161 -46
  140. package/src/components/data-table/data-table.tsx +13 -1
  141. package/src/components/data-table/date-filter-inputs.tsx +15 -42
  142. package/src/components/data-table/date-popover.tsx +6 -4
  143. package/src/components/data-table/export-actions.tsx +267 -163
  144. package/src/components/data-table/range-focus/atoms.ts +4 -6
  145. package/src/components/data-table/range-focus/use-cell-range-selection.ts +65 -38
  146. package/src/components/data-table/range-focus/use-scroll-into-view.ts +21 -2
  147. package/src/components/data-table/renderers.tsx +16 -7
  148. package/src/components/data-table/row-viewer-panel/__tests__/row-viewer.test.tsx +24 -1
  149. package/src/components/data-table/row-viewer-panel/row-viewer.tsx +4 -4
  150. package/src/components/data-table/schemas.ts +14 -36
  151. package/src/components/data-table/search-highlight.tsx +79 -0
  152. package/src/components/data-table/types.ts +1 -0
  153. package/src/components/data-table/url-detector.tsx +49 -9
  154. package/src/components/data-table/utils.ts +18 -0
  155. package/src/components/datasources/__tests__/column-actions.test.tsx +97 -0
  156. package/src/components/datasources/__tests__/column-preview.test.tsx +98 -5
  157. package/src/components/datasources/__tests__/datasources-interactions.test.tsx +181 -0
  158. package/src/components/datasources/__tests__/table-list.test.tsx +118 -0
  159. package/src/components/datasources/__tests__/utils.test.ts +57 -6
  160. package/src/components/datasources/column-preview.tsx +13 -4
  161. package/src/components/datasources/datasources.tsx +51 -39
  162. package/src/components/datasources/utils.ts +32 -23
  163. package/src/components/debugger/debugger-code.tsx +5 -0
  164. package/src/components/dependency-graph/dependency-graph-tree.tsx +8 -8
  165. package/src/components/dependency-graph/elements.ts +24 -21
  166. package/src/components/dependency-graph/panels.tsx +2 -1
  167. package/src/components/dependency-graph/utils/__tests__/layout.test.ts +18 -11
  168. package/src/components/editor/Output.tsx +9 -2
  169. package/src/components/editor/SortableCell.tsx +1 -3
  170. package/src/components/editor/__tests__/dynamic-favicon.test.tsx +111 -18
  171. package/src/components/editor/__tests__/package-alert.test.tsx +22 -1
  172. package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +80 -252
  173. package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +210 -34
  174. package/src/components/editor/actions/pair-with-agent-commands.ts +42 -51
  175. package/src/components/editor/actions/pair-with-agent-modal.tsx +100 -37
  176. package/src/components/editor/ai/add-cell-with-ai.tsx +3 -3
  177. package/src/components/editor/ai/ai-completion-editor.tsx +1 -0
  178. package/src/components/editor/alerts/startup-logs-alert.tsx +1 -0
  179. package/src/components/editor/cell/CreateCellButton.tsx +8 -10
  180. package/src/components/editor/cell/DeleteButton.tsx +1 -0
  181. package/src/components/editor/cell/__tests__/useShouldShowInterrupt.test.ts +39 -0
  182. package/src/components/editor/cell/code/__tests__/language-toggle.test.tsx +54 -0
  183. package/src/components/editor/cell/code/cell-editor.tsx +1 -1
  184. package/src/components/editor/cell/code/language-toggle.tsx +8 -7
  185. package/src/components/editor/cell/collapse.tsx +5 -3
  186. package/src/components/editor/cell/useShouldShowInterrupt.ts +2 -12
  187. package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +30 -1
  188. package/src/components/editor/chrome/panels/cache-panel.tsx +1 -0
  189. package/src/components/editor/chrome/panels/error-panel.tsx +1 -0
  190. package/src/components/editor/chrome/panels/outline/__tests__/outline-keyboard.test.tsx +84 -0
  191. package/src/components/editor/chrome/panels/outline/floating-outline.tsx +39 -14
  192. package/src/components/editor/chrome/panels/outline/useActiveOutline.tsx +3 -2
  193. package/src/components/editor/chrome/panels/packages-panel.tsx +4 -7
  194. package/src/components/editor/chrome/panels/secrets-panel.tsx +1 -0
  195. package/src/components/editor/chrome/panels/snippets-panel.tsx +5 -1
  196. package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +366 -0
  197. package/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx +58 -1
  198. package/src/components/editor/chrome/wrapper/footer-item.tsx +32 -24
  199. package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +237 -0
  200. package/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx +1 -7
  201. package/src/components/editor/chrome/wrapper/footer.tsx +2 -0
  202. package/src/components/editor/chrome/wrapper/pending-ai-cells.tsx +12 -2
  203. package/src/components/editor/chrome/wrapper/storage.ts +1 -1
  204. package/src/components/editor/connections/components.tsx +1 -1
  205. package/src/components/editor/controls/__tests__/command-palette.test.tsx +53 -0
  206. package/src/components/editor/controls/__tests__/keyboard-shortcuts.test.tsx +61 -0
  207. package/src/components/editor/controls/command-palette.tsx +22 -10
  208. package/src/components/editor/controls/keyboard-shortcuts.tsx +14 -5
  209. package/src/components/editor/dynamic-favicon.tsx +21 -40
  210. package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +537 -0
  211. package/src/components/editor/errors/send-error-report-button.tsx +69 -0
  212. package/src/components/editor/file-tree/__tests__/file-explorer-interactions.test.tsx +6 -0
  213. package/src/components/editor/file-tree/__tests__/file-explorer-navigation.test.tsx +47 -0
  214. package/src/components/editor/file-tree/__tests__/use-file-search.test.tsx +91 -0
  215. package/src/components/editor/file-tree/file-explorer.tsx +45 -8
  216. package/src/components/editor/file-tree/file-name-input.tsx +1 -0
  217. package/src/components/editor/file-tree/file-viewer.tsx +4 -2
  218. package/src/components/editor/file-tree/use-file-search.ts +35 -21
  219. package/src/components/editor/header/status.tsx +28 -5
  220. package/src/components/editor/links/__tests__/cell-link.test.tsx +146 -0
  221. package/src/components/editor/links/cell-link.tsx +14 -5
  222. package/src/components/editor/navigation/focus-utils.ts +4 -4
  223. package/src/components/editor/notebook-banner.tsx +1 -0
  224. package/src/components/editor/notebook-cell.tsx +11 -2
  225. package/src/components/editor/output/MarimoErrorOutput.tsx +21 -5
  226. package/src/components/editor/output/MarimoTracebackOutput.tsx +54 -37
  227. package/src/components/editor/output/__tests__/ansi-reduce.test.ts +18 -0
  228. package/src/components/editor/output/__tests__/traceback.test.tsx +27 -1
  229. package/src/components/editor/output/ansi-reduce.ts +36 -17
  230. package/src/components/editor/output/console/ConsoleOutput.tsx +19 -25
  231. package/src/components/editor/package-alert.tsx +14 -7
  232. package/src/components/editor/renderers/grid-layout/grid-layout.tsx +12 -6
  233. package/src/components/editor/renderers/vertical-layout/sidebar/toggle.tsx +7 -1
  234. package/src/components/home/components.tsx +17 -31
  235. package/src/components/icons/__tests__/large-spinner.test.tsx +39 -0
  236. package/src/components/icons/large-spinner.tsx +3 -14
  237. package/src/components/icons/spinner.tsx +1 -1
  238. package/src/components/mcp/mcp-status-indicator.tsx +1 -1
  239. package/src/components/pages/__tests__/home-page.test.tsx +116 -0
  240. package/src/components/pages/home-page.tsx +164 -91
  241. package/src/components/scratchpad/scratchpad.test.tsx +95 -0
  242. package/src/components/scratchpad/scratchpad.tsx +16 -3
  243. package/src/components/slides/reveal-component.tsx +4 -2
  244. package/src/components/slides/slide-cell-view.tsx +1 -1
  245. package/src/components/slides/slide-form.tsx +1 -0
  246. package/src/components/tracing/tracing-keyboard.test.tsx +85 -0
  247. package/src/components/tracing/tracing.tsx +45 -41
  248. package/src/components/ui/__tests__/draggable-popover.test.tsx +24 -0
  249. package/src/components/ui/__tests__/range-slider.test.tsx +165 -0
  250. package/src/components/ui/alert-dialog.tsx +1 -1
  251. package/src/components/ui/draggable-popover.tsx +24 -2
  252. package/src/components/ui/range-slider.tsx +22 -9
  253. package/src/core/ai/context/providers/datasource.ts +6 -2
  254. package/src/core/ai/tools/base.ts +16 -7
  255. package/src/core/ai/tools/edit-notebook-tool.ts +47 -45
  256. package/src/core/ai/tools/registry.ts +13 -8
  257. package/src/core/ai/tools/sample-tool.ts +6 -7
  258. package/src/core/attachments/__tests__/toast.test.tsx +58 -0
  259. package/src/core/attachments/state.ts +18 -0
  260. package/src/core/attachments/toast.ts +15 -0
  261. package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +4 -0
  262. package/src/core/cells/__tests__/cell.test.ts +39 -0
  263. package/src/core/cells/__tests__/cells.test.ts +55 -1
  264. package/src/core/cells/__tests__/collapseConsoleOutputs.test.ts +54 -0
  265. package/src/core/cells/__tests__/error-report.test.ts +139 -0
  266. package/src/core/cells/__tests__/notebook-outline.test.ts +113 -0
  267. package/src/core/cells/__tests__/session.test.ts +167 -37
  268. package/src/core/cells/cell.ts +14 -3
  269. package/src/core/cells/cells.ts +3 -1
  270. package/src/core/cells/error-report.ts +63 -0
  271. package/src/core/cells/pending-delete-service.ts +2 -6
  272. package/src/core/cells/session.ts +29 -2
  273. package/src/core/cells/types.ts +10 -1
  274. package/src/core/codemirror/__tests__/setup.test.ts +29 -29
  275. package/src/core/codemirror/cells/__tests__/extensions.test.ts +15 -0
  276. package/src/core/codemirror/cells/extensions.ts +7 -3
  277. package/src/core/codemirror/keymaps/vim.ts +2 -6
  278. package/src/core/codemirror/language/__tests__/sql.test.ts +22 -20
  279. package/src/core/codemirror/language/extension.ts +8 -8
  280. package/src/core/codemirror/language/languages/markdown.ts +8 -6
  281. package/src/core/codemirror/language/languages/python.ts +16 -10
  282. package/src/core/codemirror/language/languages/sql/sql.ts +9 -7
  283. package/src/core/codemirror/language/panel/panel.tsx +1 -0
  284. package/src/core/codemirror/language/types.ts +7 -7
  285. package/src/core/codemirror/rtc/extension.ts +24 -12
  286. package/src/core/codemirror/rtc/loro/awareness.ts +34 -19
  287. package/src/core/codemirror/rtc/loro/sync.ts +1 -0
  288. package/src/core/codemirror/utils.ts +1 -0
  289. package/src/core/config/pair.ts +5 -3
  290. package/src/core/datasets/__tests__/data-source-discovery.test.ts +4 -4
  291. package/src/core/datasets/data-source-discovery.ts +4 -6
  292. package/src/core/document/__tests__/codemirror.test.ts +485 -0
  293. package/src/core/document/__tests__/draft.test.ts +322 -0
  294. package/src/core/document/__tests__/fixtures.ts +92 -0
  295. package/src/core/document/__tests__/hooks.test.tsx +386 -0
  296. package/src/core/document/__tests__/lifecycle-scenarios.test.ts +61 -0
  297. package/src/core/document/__tests__/model.test.ts +191 -0
  298. package/src/core/document/__tests__/protocol-fixtures.ts +38 -0
  299. package/src/core/document/__tests__/recovery-scenarios.test.ts +230 -0
  300. package/src/core/document/__tests__/scenario-fixture.ts +43 -0
  301. package/src/core/document/__tests__/scenarios.test.ts +205 -0
  302. package/src/core/document/__tests__/state.test.ts +438 -0
  303. package/src/core/document/__tests__/submission.test.ts +203 -0
  304. package/src/core/document/__tests__/test-host.test.ts +92 -0
  305. package/src/core/document/__tests__/test-host.ts +247 -0
  306. package/src/core/document/__tests__/test-notebook.ts +149 -0
  307. package/src/core/document/__tests__/user.ts +61 -0
  308. package/src/core/document/codemirror.ts +311 -0
  309. package/src/core/document/draft.ts +472 -0
  310. package/src/core/document/hooks.tsx +118 -0
  311. package/src/core/document/index.ts +15 -0
  312. package/src/core/document/model.ts +55 -0
  313. package/src/core/document/select.ts +41 -0
  314. package/src/core/document/state.ts +374 -0
  315. package/src/core/document/sync.ts +369 -0
  316. package/src/core/edit-app.tsx +2 -2
  317. package/src/core/host/AGENTS.md +12 -0
  318. package/src/core/host/__tests__/attachments.test.ts +56 -0
  319. package/src/core/host/__tests__/document.test.ts +126 -0
  320. package/src/core/host/__tests__/fixtures.ts +79 -0
  321. package/src/core/host/__tests__/replica.test.ts +550 -0
  322. package/src/core/host/__tests__/static.test.ts +175 -0
  323. package/src/core/host/__tests__/wasm.test.ts +166 -0
  324. package/src/core/host/backend.ts +19 -0
  325. package/src/core/host/connection.ts +42 -0
  326. package/src/core/host/index.ts +14 -0
  327. package/src/core/host/replica.ts +286 -0
  328. package/src/core/host/resources/attachments.ts +22 -0
  329. package/src/core/host/resources/document.ts +101 -0
  330. package/src/core/host/static.ts +77 -0
  331. package/src/core/host/wasm.ts +97 -0
  332. package/src/core/hotkeys/actions.ts +2 -4
  333. package/src/core/islands/__tests__/bootstrap.test.ts +17 -17
  334. package/src/core/islands/__tests__/bridge.test.ts +31 -26
  335. package/src/core/islands/bootstrap.ts +22 -51
  336. package/src/core/islands/bridge.ts +31 -20
  337. package/src/core/islands/components/__tests__/IslandControls.test.tsx +7 -5
  338. package/src/core/islands/worker/__tests__/controller.test.ts +62 -4
  339. package/src/core/islands/worker/controller.ts +4 -10
  340. package/src/core/islands/worker/worker.tsx +33 -33
  341. package/src/core/kernel/__tests__/RuntimeState.test.ts +1 -1
  342. package/src/core/network/connection.ts +4 -2
  343. package/src/core/network/useConnectionNotice.ts +8 -2
  344. package/src/core/run-app.tsx +2 -2
  345. package/src/core/runtime/__tests__/createWsUrl.test.ts +77 -7
  346. package/src/core/runtime/__tests__/runtime.test.ts +33 -15
  347. package/src/core/runtime/runtime.ts +39 -30
  348. package/src/core/saving/save-component.tsx +12 -3
  349. package/src/core/state/__tests__/jotai.test.tsx +108 -0
  350. package/src/core/state/jotai.ts +1 -1
  351. package/src/core/static/__tests__/files.test.ts +38 -10
  352. package/src/core/static/files.ts +2 -0
  353. package/src/core/wasm/__tests__/bridge.test.ts +213 -50
  354. package/src/core/wasm/__tests__/worker.test.ts +187 -0
  355. package/src/core/wasm/bridge.ts +81 -52
  356. package/src/core/wasm/rpc.ts +15 -3
  357. package/src/core/wasm/store.ts +3 -3
  358. package/src/core/wasm/worker/bootstrap.ts +55 -51
  359. package/src/core/wasm/worker/getMarimoWheel.ts +1 -1
  360. package/src/core/wasm/worker/save-worker.ts +9 -10
  361. package/src/core/wasm/worker/types.ts +29 -18
  362. package/src/core/wasm/worker/worker.ts +97 -44
  363. package/src/core/websocket/__tests__/backend.test.ts +235 -0
  364. package/src/core/websocket/__tests__/{useMarimoKernelConnection.test.ts → connection-state.test.ts} +15 -29
  365. package/src/core/websocket/__tests__/useNotebookReplica.hook.test.tsx +141 -0
  366. package/src/core/websocket/__tests__/{useMarimoKernelConnection.hook.test.tsx → useNotebookSession.hook.test.tsx} +197 -184
  367. package/src/core/websocket/backend.ts +129 -0
  368. package/src/core/websocket/connection-state.ts +60 -0
  369. package/src/core/websocket/state.ts +7 -0
  370. package/src/core/websocket/transports/__tests__/notebook.test.ts +405 -0
  371. package/src/core/websocket/transports/notebook.ts +159 -0
  372. package/src/core/websocket/types.ts +9 -39
  373. package/src/core/websocket/useNotebookReplica.ts +69 -0
  374. package/src/core/websocket/{useMarimoKernelConnection.tsx → useNotebookSession.tsx} +63 -228
  375. package/src/css/globals.css +5 -0
  376. package/src/hooks/__tests__/useAsyncData.test.tsx +148 -0
  377. package/src/hooks/__tests__/useDebounce.test.tsx +51 -0
  378. package/src/hooks/__tests__/useDeepCompareMemoize.test.tsx +39 -0
  379. package/src/hooks/__tests__/useDelayElapsed.test.tsx +28 -0
  380. package/src/hooks/__tests__/useInternalStateWithSync.test.tsx +20 -0
  381. package/src/hooks/__tests__/useScript.test.tsx +77 -0
  382. package/src/hooks/__tests__/useStateForKey.test.tsx +257 -0
  383. package/src/hooks/useAsyncData.ts +3 -3
  384. package/src/hooks/useDataSourceDiscovery.ts +6 -4
  385. package/src/hooks/useDebounce.ts +6 -10
  386. package/src/hooks/useDeepCompareMemoize.ts +1 -1
  387. package/src/hooks/useDelayElapsed.ts +14 -10
  388. package/src/hooks/useElapsedTime.ts +3 -3
  389. package/src/hooks/useEventListener.ts +1 -2
  390. package/src/hooks/useInputHistory.ts +4 -7
  391. package/src/hooks/useInternalStateWithSync.ts +6 -6
  392. package/src/hooks/useResizeObserver.ts +4 -7
  393. package/src/hooks/useScript.ts +67 -70
  394. package/src/hooks/useStateForKey.ts +93 -0
  395. package/src/mount.tsx +3 -3
  396. package/src/plugins/__tests__/plugin-object-schemas.test.ts +104 -0
  397. package/src/plugins/core/registerReactComponent.tsx +1 -1
  398. package/src/plugins/impl/CodeEditorPlugin.tsx +1 -1
  399. package/src/plugins/impl/DataEditorPlugin.tsx +1 -1
  400. package/src/plugins/impl/DataTablePlugin.tsx +29 -33
  401. package/src/plugins/impl/DropdownPlugin.tsx +2 -6
  402. package/src/plugins/impl/FileBrowserPlugin.tsx +4 -16
  403. package/src/plugins/impl/FormPlugin.tsx +1 -1
  404. package/src/plugins/impl/RangeSliderPlugin.tsx +16 -2
  405. package/src/plugins/impl/RefreshPlugin.tsx +1 -0
  406. package/src/plugins/impl/SliderPlugin.tsx +6 -8
  407. package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +201 -1
  408. package/src/plugins/impl/__tests__/FileBrowserPlugin.test.tsx +45 -0
  409. package/src/plugins/impl/__tests__/RangeSliderPlugin.test.tsx +109 -0
  410. package/src/plugins/impl/__tests__/SliderPlugin.test.tsx +24 -3
  411. package/src/plugins/impl/anywidget/__tests__/registry.test.ts +2 -0
  412. package/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts +241 -2
  413. package/src/plugins/impl/anywidget/runtime.ts +21 -9
  414. package/src/plugins/impl/anywidget/widget-binding.ts +160 -82
  415. package/src/plugins/impl/chat/__tests__/chat-prompts.test.tsx +93 -0
  416. package/src/plugins/impl/chat/chat-ui.tsx +14 -11
  417. package/src/plugins/impl/code/any-language-editor.tsx +2 -2
  418. package/src/plugins/impl/data-editor/glide-data-editor.tsx +8 -5
  419. package/src/plugins/impl/data-editor/glide-utils.ts +3 -1
  420. package/src/plugins/impl/data-explorer/ConnectedDataExplorerComponent.tsx +1 -1
  421. package/src/plugins/impl/data-explorer/components/column-summary.tsx +4 -2
  422. package/src/plugins/impl/data-explorer/state/reducer.ts +1 -1
  423. package/src/plugins/impl/data-frames/DataFramePlugin.tsx +1 -2
  424. package/src/plugins/impl/data-frames/__tests__/sidebar.test.tsx +160 -0
  425. package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +66 -66
  426. package/src/plugins/impl/data-frames/panel.tsx +43 -16
  427. package/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx +5 -3
  428. package/src/plugins/impl/panel/PanelPlugin.tsx +16 -17
  429. package/src/plugins/impl/panel/__tests__/utils.test.ts +39 -1
  430. package/src/plugins/impl/panel/utils.ts +17 -0
  431. package/src/plugins/impl/plotly/PlotlyPlugin.tsx +2 -5
  432. package/src/plugins/impl/plotly/selection.ts +25 -19
  433. package/src/plugins/impl/vega/VegaPlugin.tsx +2 -3
  434. package/src/plugins/impl/vega/make-selectable.ts +4 -7
  435. package/src/plugins/layout/RoutesPlugin.tsx +1 -1
  436. package/src/stories/__tests__/editor-story.test.tsx +33 -0
  437. package/src/stories/button.stories.tsx +1 -0
  438. package/src/stories/editor.stories.tsx +24 -17
  439. package/src/stories/form-wrapper.stories.tsx +2 -2
  440. package/src/stories/select.stories.tsx +2 -2
  441. package/src/stories/switchable-multi-select.stories.tsx +1 -1
  442. package/src/utils/__tests__/arrays.test.ts +35 -0
  443. package/src/utils/__tests__/batch-requests.test.ts +3 -3
  444. package/src/utils/__tests__/dates.test.ts +116 -0
  445. package/src/utils/__tests__/numbers.test.ts +105 -1
  446. package/src/utils/__tests__/objects.test.ts +21 -0
  447. package/src/utils/arrays.ts +10 -0
  448. package/src/utils/blob.ts +1 -1
  449. package/src/utils/dates.ts +94 -0
  450. package/src/utils/numbers.ts +79 -18
  451. package/src/utils/objects.ts +3 -7
  452. package/src/utils/once.ts +19 -19
  453. package/src/utils/tracer.ts +9 -5
  454. package/src/utils/zod-utils.ts +1 -3
  455. package/dist/any-language-editor-B9REGlD9.js +0 -76
  456. package/dist/assets/__vite-browser-external-BXYkiFsk.js +0 -1
  457. package/dist/assets/worker-HPY9fbhz.js +0 -114
  458. package/dist/error-entries-CzoYkIQZ.js +0 -56
  459. package/dist/mermaid-HWGCJPDP-ByCsZnYF.js +0 -2
  460. package/dist/precisionRound-DMIVQrt2.js +0 -97
  461. package/src/core/state/__tests__/jotai.test.ts +0 -25
  462. package/src/core/wasm/worker/message-buffer.ts +0 -33
  463. package/src/core/websocket/__tests__/useWebSocket.test.ts +0 -49
  464. package/src/core/websocket/transports/__tests__/basic.test.ts +0 -275
  465. package/src/core/websocket/transports/__tests__/sse.test.ts +0 -338
  466. package/src/core/websocket/transports/__tests__/transport.test.ts +0 -308
  467. package/src/core/websocket/transports/__tests__/ws.test.ts +0 -125
  468. package/src/core/websocket/transports/basic.ts +0 -102
  469. package/src/core/websocket/transports/sse.ts +0 -308
  470. package/src/core/websocket/transports/transport.ts +0 -61
  471. package/src/core/websocket/transports/ws.ts +0 -98
  472. package/src/core/websocket/useWebSocket.tsx +0 -88
@@ -1,29 +1,28 @@
1
1
  import { a as e, t } from "./rolldown-runtime-Cb76FRpK.js";
2
- import { c as n, g as r, h as i, t as a } from "./button-CvjkwdSk.js";
2
+ import { c as n, g as r, h as i, t as a } from "./button-BQRdqQi1.js";
3
3
  import { t as o } from "./react-sHtZdjeP.js";
4
4
  import { t as s } from "./compiler-runtime-CldRdSsv.js";
5
- import { i as c, t as l } from "./copy-icon-Ft7t9bqz.js";
6
- import { F as u, H as d, U as f, V as p, X as m, Y as h, Z as g, _, a as v, c as y, d as b, f as x, g as S, h as C, l as w, m as T, n as E, p as D, r as O, t as k, v as A, x as ee, y as j, z as te } from "./html-to-image-CZY1pIZH.js";
7
- import { h as M, t as ne } from "./tooltip-BO1REbqs.js";
8
- import { $ as re, $t as ie, It as ae, K as oe, Mt as se, N as ce, St as le, Vt as ue, X as de, _t as fe, b as pe, cn as me, d as he, it as ge, pn as _e, rt as ve, sn as ye, un as be, ut as xe, vt as Se, yt as Ce } from "./cells-C8iCYvLU.js";
9
- import { A as we, C as Te, M as Ee, b as De } from "./select-BButFi-d.js";
10
- import { _ as Oe, f as ke, h as Ae, i as je, n as Me, t as Ne } from "./dropdown-menu-CP_qCYHC.js";
11
- import { S as Pe, u as Fe } from "./toDate-BNJf01u1.js";
12
- import { d as Ie, f as Le, i as Re, n as ze, t as Be, u as Ve } from "./process-output-e4jj9Ijt.js";
13
- import { t as He } from "./jsx-runtime-3BD1kT0s.js";
14
- import { A as Ue, C as We, D as Ge, E as Ke, F as qe, L as Je, M as Ye, O as Xe, P as Ze, R as Qe, S as $e, T as et, V as tt, b as nt, j as rt, v as it, w as at, x as ot, y as st, z as ct } from "./use-restore-focus-BEM7sFWl.js";
15
- import { n as lt } from "./error-banner-Da600cwz.js";
16
- import { t as ut } from "./label-BDKF3Afc.js";
17
- import { t as dt } from "./isEmpty-BSZ1LaUo.js";
18
- import { A as ft, T as pt, n as mt } from "./useTheme-CRnjkku0.js";
19
- import { $ as ht, Mt as gt, Pt as _t, Rt as vt, Vt as yt, Z as bt, ht as xt, jt as St, mt as Ct, nt as wt, tt as Tt, zt as Et } from "./dist-DoE4XJBC.js";
20
- import { t as Dt } from "./objects-CzUgoMIF.js";
21
- import { n as Ot, o as kt, r as At } from "./dist-CkTTIdBe.js";
22
- import { n as jt } from "./dist-CrSP_H1M.js";
23
- import { n as Mt, t as Nt } from "./esm-AMFssoNp.js";
24
- import { t as Pt } from "./useAsyncData-Deh5kszT.js";
25
- import { i as Ft, r as It, t as Lt } from "./error-entries-CzoYkIQZ.js";
26
- var Rt = M("ban", [["circle", {
5
+ import { i as c, t as l } from "./copy-icon-C1trdvVt.js";
6
+ import { F as u, H as d, U as f, V as p, X as m, Y as h, Z as g, _, a as v, c as y, d as b, f as x, g as S, h as C, l as w, m as T, n as E, p as D, r as O, t as k, v as A, x as ee, y as te, z as ne } from "./html-to-image-BrC8OJcj.js";
7
+ import { m as j, t as re } from "./tooltip-CJ4Rqasp.js";
8
+ import { Ct as ie, Dt as ae, Pt as oe, R as se, Rt as ce, St as le, T as ue, Ut as de, Z as fe, ct as pe, fn as me, h as he, hn as ge, ht as _e, i as ve, it as ye, ln as be, lt as xe, r as Se, t as Ce, tn as we, tt as Te, un as Ee, wt as De } from "./error-entries-CmFDQ9CA.js";
9
+ import { A as Oe, C as ke, M as Ae, b as je } from "./select-CkF_GBxO.js";
10
+ import { _ as Me, f as Ne, h as Pe, i as Fe, n as Ie, t as Le } from "./dropdown-menu-GWcGCcxE.js";
11
+ import { C as Re, d as ze } from "./toDate-DGvRHwTk.js";
12
+ import { d as Be, f as Ve, i as He, n as Ue, t as We, u as Ge } from "./process-output-Bw-vzyoy.js";
13
+ import { t as Ke } from "./jsx-runtime-3BD1kT0s.js";
14
+ import { A as qe, C as Je, D as Ye, E as Xe, F as Ze, L as Qe, M as $e, O as et, P as tt, R as nt, S as rt, T as it, V as at, b as ot, j as st, v as ct, w as lt, x as ut, y as dt, z as ft } from "./use-restore-focus-CmGwRNId.js";
15
+ import { n as pt } from "./error-banner-D40pmfQQ.js";
16
+ import { t as mt } from "./label-D9_-zSg-.js";
17
+ import { t as ht } from "./isEmpty-BSZ1LaUo.js";
18
+ import { A as gt, T as _t, n as vt } from "./useTheme-Bq9pi_vz.js";
19
+ import { $ as yt, Mt as bt, Pt as xt, Rt as St, Vt as Ct, Z as wt, ht as Tt, jt as Et, mt as Dt, nt as Ot, tt as kt, zt as At } from "./dist-DoE4XJBC.js";
20
+ import { t as jt } from "./objects-DCmMvZtn.js";
21
+ import { n as Mt, o as Nt, r as Pt } from "./dist-CkTTIdBe.js";
22
+ import { n as Ft } from "./dist-CrSP_H1M.js";
23
+ import { n as It, t as Lt } from "./esm-AMFssoNp.js";
24
+ import { t as Rt } from "./useAsyncData-BmVgnMP5.js";
25
+ var zt = j("ban", [["circle", {
27
26
  cx: "12",
28
27
  cy: "12",
29
28
  r: "10",
@@ -31,7 +30,7 @@ var Rt = M("ban", [["circle", {
31
30
  }], ["path", {
32
31
  d: "M4.929 4.929 19.07 19.071",
33
32
  key: "196cmz"
34
- }]]), zt = M("bot-message-square", [
33
+ }]]), Bt = j("bot-message-square", [
35
34
  ["path", {
36
35
  d: "M12 6V2H8",
37
36
  key: "1155em"
@@ -56,13 +55,13 @@ var Rt = M("ban", [["circle", {
56
55
  d: "M9 11v2",
57
56
  key: "1ueba0"
58
57
  }]
59
- ]), Bt = M("circle-check-big", [["path", {
58
+ ]), Vt = j("circle-check-big", [["path", {
60
59
  d: "M21.801 10A10 10 0 1 1 17 3.335",
61
60
  key: "yps3ct"
62
61
  }], ["path", {
63
62
  d: "m9 11 3 3L22 4",
64
63
  key: "1pflzl"
65
- }]]), Vt = M("circle-slash", [["circle", {
64
+ }]]), Ht = j("circle-slash", [["circle", {
66
65
  cx: "12",
67
66
  cy: "12",
68
67
  r: "10",
@@ -73,22 +72,22 @@ var Rt = M("ban", [["circle", {
73
72
  y1: "15",
74
73
  y2: "9",
75
74
  key: "1dfufj"
76
- }]]), Ht = M("paperclip", [["path", {
75
+ }]]), Ut = j("paperclip", [["path", {
77
76
  d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
78
77
  key: "1miecu"
79
- }]]), Ut = M("rotate-cw", [["path", {
78
+ }]]), Wt = j("rotate-cw", [["path", {
80
79
  d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",
81
80
  key: "1p45f6"
82
81
  }], ["path", {
83
82
  d: "M21 3v5h-5",
84
83
  key: "1q7to0"
85
- }]]), Wt = M("send-horizontal", [["path", {
84
+ }]]), Gt = j("send-horizontal", [["path", {
86
85
  d: "M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",
87
86
  key: "117uat"
88
87
  }], ["path", {
89
88
  d: "M6 12h16",
90
89
  key: "s4cdu5"
91
- }]]), Gt = M("settings", [["path", {
90
+ }]]), Kt = j("settings", [["path", {
92
91
  d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
93
92
  key: "1i5ecw"
94
93
  }], ["circle", {
@@ -96,7 +95,7 @@ var Rt = M("ban", [["circle", {
96
95
  cy: "12",
97
96
  r: "3",
98
97
  key: "1v7zrd"
99
- }]]), Kt = M("shield-question-mark", [
98
+ }]]), qt = j("shield-question-mark", [
100
99
  ["path", {
101
100
  d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
102
101
  key: "oel41y"
@@ -109,66 +108,66 @@ var Rt = M("ban", [["circle", {
109
108
  d: "M12 17h.01",
110
109
  key: "p32p05"
111
110
  }]
112
- ]), N = s(), qt = "vercel.ai.error", Jt = Symbol.for(qt), Yt, Xt, P = class e extends (Xt = Error, Yt = Jt, Xt) {
111
+ ]), M = s(), Jt = "vercel.ai.error", Yt = Symbol.for(Jt), Xt, Zt, N = class e extends (Zt = Error, Xt = Yt, Zt) {
113
112
  constructor({ name: e, message: t, cause: n }) {
114
- super(t), this[Yt] = !0, this.name = e, this.cause = n;
113
+ super(t), this[Xt] = !0, this.name = e, this.cause = n;
115
114
  }
116
115
  static isInstance(t) {
117
- return e.hasMarker(t, qt);
116
+ return e.hasMarker(t, Jt);
118
117
  }
119
118
  static hasMarker(e, t) {
120
119
  let n = Symbol.for(t);
121
120
  return typeof e == "object" && !!e && n in e && typeof e[n] == "boolean" && e[n] === !0;
122
121
  }
123
- }, Zt = "AI_APICallError", Qt = `vercel.ai.error.${Zt}`, $t = Symbol.for(Qt), en, tn, nn = class extends (tn = P, en = $t, tn) {
122
+ }, Qt = "AI_APICallError", $t = `vercel.ai.error.${Qt}`, en = Symbol.for($t), tn, nn, rn = class extends (nn = N, tn = en, nn) {
124
123
  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 }) {
125
124
  super({
126
- name: Zt,
125
+ name: Qt,
127
126
  message: e,
128
127
  cause: o
129
- }), this[en] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
128
+ }), this[tn] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
130
129
  }
131
130
  static isInstance(e) {
132
- return P.hasMarker(e, Qt);
131
+ return N.hasMarker(e, $t);
133
132
  }
134
- }, rn = "AI_EmptyResponseBodyError", an = `vercel.ai.error.${rn}`, on = Symbol.for(an), sn, cn, ln = class extends (cn = P, sn = on, cn) {
133
+ }, an = "AI_EmptyResponseBodyError", on = `vercel.ai.error.${an}`, sn = Symbol.for(on), cn, ln, un = class extends (ln = N, cn = sn, ln) {
135
134
  constructor({ message: e = "Empty response body" } = {}) {
136
135
  super({
137
- name: rn,
136
+ name: an,
138
137
  message: e
139
- }), this[sn] = !0;
138
+ }), this[cn] = !0;
140
139
  }
141
140
  static isInstance(e) {
142
- return P.hasMarker(e, an);
141
+ return N.hasMarker(e, on);
143
142
  }
144
143
  };
145
- function un(e) {
144
+ function dn(e) {
146
145
  return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.toString() : JSON.stringify(e);
147
146
  }
148
- var dn = "AI_InvalidArgumentError", fn = `vercel.ai.error.${dn}`, pn = Symbol.for(fn), mn, hn, gn = class extends (hn = P, mn = pn, hn) {
147
+ var fn = "AI_InvalidArgumentError", pn = `vercel.ai.error.${fn}`, mn = Symbol.for(pn), hn, gn, _n = class extends (gn = N, hn = mn, gn) {
149
148
  constructor({ message: e, cause: t, argument: n }) {
150
149
  super({
151
- name: dn,
150
+ name: fn,
152
151
  message: e,
153
152
  cause: t
154
- }), this[mn] = !0, this.argument = n;
153
+ }), this[hn] = !0, this.argument = n;
155
154
  }
156
155
  static isInstance(e) {
157
- return P.hasMarker(e, fn);
156
+ return N.hasMarker(e, pn);
158
157
  }
159
- }, _n = "AI_JSONParseError", vn = `vercel.ai.error.${_n}`, yn = Symbol.for(vn), bn, xn, Sn = class extends (xn = P, bn = yn, xn) {
158
+ }, vn = "AI_JSONParseError", yn = `vercel.ai.error.${vn}`, bn = Symbol.for(yn), xn, Sn, Cn = class extends (Sn = N, xn = bn, Sn) {
160
159
  constructor({ text: e, cause: t }) {
161
160
  super({
162
- name: _n,
161
+ name: vn,
163
162
  message: `JSON parsing failed: Text: ${e}.
164
- Error message: ${un(t)}`,
163
+ Error message: ${dn(t)}`,
165
164
  cause: t
166
- }), this[bn] = !0, this.text = e;
165
+ }), this[xn] = !0, this.text = e;
167
166
  }
168
167
  static isInstance(e) {
169
- return P.hasMarker(e, vn);
168
+ return N.hasMarker(e, yn);
170
169
  }
171
- }, Cn = "AI_TypeValidationError", wn = `vercel.ai.error.${Cn}`, Tn = Symbol.for(wn), En, Dn, F = class e extends (Dn = P, En = Tn, Dn) {
170
+ }, wn = "AI_TypeValidationError", Tn = `vercel.ai.error.${wn}`, En = Symbol.for(Tn), Dn, On, P = class e extends (On = N, Dn = En, On) {
172
171
  constructor({ value: e, cause: t, context: n }) {
173
172
  let r = "Type validation failed";
174
173
  if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
@@ -177,14 +176,14 @@ Error message: ${un(t)}`,
177
176
  n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
178
177
  }
179
178
  super({
180
- name: Cn,
179
+ name: wn,
181
180
  message: `${r}: Value: ${JSON.stringify(e)}.
182
- Error message: ${un(t)}`,
181
+ Error message: ${dn(t)}`,
183
182
  cause: t
184
- }), this[En] = !0, this.value = e, this.context = n;
183
+ }), this[Dn] = !0, this.value = e, this.context = n;
185
184
  }
186
185
  static isInstance(e) {
187
- return P.hasMarker(e, wn);
186
+ return N.hasMarker(e, Tn);
188
187
  }
189
188
  static wrap({ value: t, cause: n, context: r }) {
190
189
  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({
@@ -193,25 +192,25 @@ Error message: ${un(t)}`,
193
192
  context: r
194
193
  });
195
194
  }
196
- }, On = "AI_UnsupportedFunctionalityError", kn = `vercel.ai.error.${On}`, An = Symbol.for(kn), jn, Mn, Nn = class extends (Mn = P, jn = An, Mn) {
195
+ }, kn = "AI_UnsupportedFunctionalityError", An = `vercel.ai.error.${kn}`, jn = Symbol.for(An), Mn, Nn, Pn = class extends (Nn = N, Mn = jn, Nn) {
197
196
  constructor({ functionality: e, message: t = `'${e}' functionality not supported.` }) {
198
197
  super({
199
- name: On,
198
+ name: kn,
200
199
  message: t
201
- }), this[jn] = !0, this.functionality = e;
200
+ }), this[Mn] = !0, this.functionality = e;
202
201
  }
203
202
  static isInstance(e) {
204
- return P.hasMarker(e, kn);
203
+ return N.hasMarker(e, An);
205
204
  }
206
- }, Pn = class extends Error {
205
+ }, Fn = class extends Error {
207
206
  constructor(e, t) {
208
207
  super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
209
208
  }
210
- }, Fn = 10, In = 13, Ln = 32;
211
- function Rn(e) {}
212
- function zn(e) {
209
+ }, In = 10, Ln = 13, Rn = 32;
210
+ function zn(e) {}
211
+ function Bn(e) {
213
212
  if (typeof e == "function") throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");
214
- let { onEvent: t = Rn, onError: n = Rn, onRetry: r = Rn, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
213
+ let { onEvent: t = zn, onError: n = zn, onRetry: r = zn, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
215
214
  function m(e) {
216
215
  if (p) throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");
217
216
  if (c && (c = !1, e.charCodeAt(0) === 239 && e.charCodeAt(1) === 187 && e.charCodeAt(2) === 191 && (e = e.slice(3))), o.length === 0) {
@@ -230,7 +229,7 @@ function zn(e) {
230
229
  n !== "" && (o.push(n), s = n.length), h();
231
230
  }
232
231
  function h() {
233
- 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 Pn(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
232
+ 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 Fn(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
234
233
  }
235
234
  function g(e) {
236
235
  let n = 0;
@@ -246,9 +245,9 @@ function zn(e) {
246
245
  continue;
247
246
  }
248
247
  let i = e.charCodeAt(n);
249
- if (Bn(e, n, i)) {
250
- let i = e.charCodeAt(n + 5) === Ln ? n + 6 : n + 5, a = e.slice(i, r);
251
- if (d === 0 && e.charCodeAt(r + 1) === Fn) {
248
+ if (Vn(e, n, i)) {
249
+ let i = e.charCodeAt(n + 5) === Rn ? n + 6 : n + 5, a = e.slice(i, r);
250
+ if (d === 0 && e.charCodeAt(r + 1) === In) {
252
251
  t({
253
252
  id: l,
254
253
  event: f,
@@ -258,7 +257,7 @@ function zn(e) {
258
257
  }
259
258
  u = d === 0 ? a : `${u}
260
259
  ${a}`, d++;
261
- } else Vn(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === Ln ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
260
+ } else Hn(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === Rn ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
262
261
  n = r + 1, r = e.indexOf("\n", n);
263
262
  }
264
263
  return e.slice(n);
@@ -266,7 +265,7 @@ ${a}`, d++;
266
265
  for (; n < e.length;) {
267
266
  let t = e.indexOf("\r", n), r = e.indexOf("\n", n), i = -1;
268
267
  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;
269
- _(e, n, i), n = i + 1, e.charCodeAt(n - 1) === In && e.charCodeAt(n) === Fn && n++;
268
+ _(e, n, i), n = i + 1, e.charCodeAt(n - 1) === Ln && e.charCodeAt(n) === In && n++;
270
269
  }
271
270
  return e.slice(n);
272
271
  }
@@ -276,25 +275,25 @@ ${a}`, d++;
276
275
  return;
277
276
  }
278
277
  let r = e.charCodeAt(t);
279
- if (Bn(e, t, r)) {
280
- let r = e.charCodeAt(t + 5) === Ln ? t + 6 : t + 5, i = e.slice(r, n);
278
+ if (Vn(e, t, r)) {
279
+ let r = e.charCodeAt(t + 5) === Rn ? t + 6 : t + 5, i = e.slice(r, n);
281
280
  u = d === 0 ? i : `${u}
282
281
  ${i}`, d++;
283
282
  return;
284
283
  }
285
- if (Vn(e, t, r)) {
286
- f = e.slice(e.charCodeAt(t + 6) === Ln ? t + 7 : t + 6, n) || void 0;
284
+ if (Hn(e, t, r)) {
285
+ f = e.slice(e.charCodeAt(t + 6) === Rn ? t + 7 : t + 6, n) || void 0;
287
286
  return;
288
287
  }
289
288
  if (r === 105 && e.charCodeAt(t + 1) === 100 && e.charCodeAt(t + 2) === 58) {
290
- let r = e.slice(e.charCodeAt(t + 3) === Ln ? t + 4 : t + 3, n);
289
+ let r = e.slice(e.charCodeAt(t + 3) === Rn ? t + 4 : t + 3, n);
291
290
  l = r.includes("\0") ? void 0 : r;
292
291
  return;
293
292
  }
294
293
  if (r === 58) {
295
294
  if (i) {
296
295
  let r = e.slice(t, n);
297
- i(r.slice(e.charCodeAt(t + 1) === Ln ? 2 : 1));
296
+ i(r.slice(e.charCodeAt(t + 1) === Rn ? 2 : 1));
298
297
  }
299
298
  return;
300
299
  }
@@ -303,7 +302,7 @@ ${i}`, d++;
303
302
  v(a, "", a);
304
303
  return;
305
304
  }
306
- let s = a.slice(0, o), c = a.charCodeAt(o + 1) === Ln ? 2 : 1;
305
+ let s = a.slice(0, o), c = a.charCodeAt(o + 1) === Rn ? 2 : 1;
307
306
  v(s, a.slice(o + c), a);
308
307
  }
309
308
  function v(e, t, i) {
@@ -319,13 +318,13 @@ ${t}`, d++;
319
318
  l = t.includes("\0") ? void 0 : t;
320
319
  break;
321
320
  case "retry":
322
- /^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Pn(`Invalid \`retry\` value: "${t}"`, {
321
+ /^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Fn(`Invalid \`retry\` value: "${t}"`, {
323
322
  type: "invalid-retry",
324
323
  value: t,
325
324
  line: i
326
325
  }));
327
326
  break;
328
- default: n(new Pn(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
327
+ default: n(new Fn(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
329
328
  type: "unknown-field",
330
329
  field: e,
331
330
  value: t,
@@ -352,20 +351,20 @@ ${t}`, d++;
352
351
  reset: b
353
352
  };
354
353
  }
355
- function Bn(e, t, n) {
354
+ function Vn(e, t, n) {
356
355
  return n === 100 && e.charCodeAt(t + 1) === 97 && e.charCodeAt(t + 2) === 116 && e.charCodeAt(t + 3) === 97 && e.charCodeAt(t + 4) === 58;
357
356
  }
358
- function Vn(e, t, n) {
357
+ function Hn(e, t, n) {
359
358
  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;
360
359
  }
361
360
  //#endregion
362
361
  //#region ../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
363
- var Hn = class extends TransformStream {
362
+ var Un = class extends TransformStream {
364
363
  constructor({ onError: e, onRetry: t, onComment: n, maxBufferSize: r } = {}) {
365
364
  let i;
366
365
  super({
367
366
  start(a) {
368
- i = zn({
367
+ i = Bn({
369
368
  onEvent: (e) => {
370
369
  a.enqueue(e);
371
370
  },
@@ -384,8 +383,8 @@ var Hn = class extends TransformStream {
384
383
  }
385
384
  };
386
385
  new TextDecoder();
387
- var { btoa: Un, atob: Wn } = globalThis;
388
- function Gn(e) {
386
+ var { btoa: Wn, atob: Gn } = globalThis;
387
+ function Kn(e) {
389
388
  if (e == null) return {};
390
389
  let t = {};
391
390
  if (e instanceof Headers) e.forEach((e, n) => {
@@ -397,28 +396,28 @@ function Gn(e) {
397
396
  }
398
397
  return t;
399
398
  }
400
- var I = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
399
+ var F = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
401
400
  let i = () => {
402
401
  let e = n.length, r = Array(t);
403
402
  for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0];
404
403
  return r.join("");
405
404
  };
406
405
  if (e == null) return i;
407
- if (n.includes(r)) throw new gn({
406
+ if (n.includes(r)) throw new _n({
408
407
  argument: "separator",
409
408
  message: `The separator "${r}" must not be part of the alphabet "${n}".`
410
409
  });
411
410
  return () => `${e}${r}${i()}`;
412
- }, Kn = I();
413
- function qn(e) {
411
+ }, qn = F();
412
+ function Jn(e) {
414
413
  return globalThis.Buffer?.isBuffer(e) ?? !1;
415
414
  }
416
- var Jn = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, Yn = /"(?: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*:/;
417
- function Xn(e) {
415
+ var Yn = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, Xn = /"(?: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*:/;
416
+ function Zn(e) {
418
417
  let t = JSON.parse(e);
419
- return typeof t != "object" || !t || Jn.test(e) === !1 && Yn.test(e) === !1 ? t : Zn(t);
418
+ return typeof t != "object" || !t || Yn.test(e) === !1 && Xn.test(e) === !1 ? t : Qn(t);
420
419
  }
421
- function Zn(e) {
420
+ function Qn(e) {
422
421
  let t = [e];
423
422
  for (; t.length;) {
424
423
  let e = t;
@@ -433,35 +432,35 @@ function Zn(e) {
433
432
  }
434
433
  return e;
435
434
  }
436
- function Qn(e) {
435
+ function $n(e) {
437
436
  let { stackTraceLimit: t } = Error;
438
437
  try {
439
438
  Error.stackTraceLimit = 0;
440
439
  } catch {
441
- return Xn(e);
440
+ return Zn(e);
442
441
  }
443
442
  try {
444
- return Xn(e);
443
+ return Zn(e);
445
444
  } finally {
446
445
  Error.stackTraceLimit = t;
447
446
  }
448
447
  }
449
- function $n(e) {
448
+ function er(e) {
450
449
  if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
451
450
  let { additionalProperties: t } = e;
452
- e.additionalProperties = t != null && typeof t != "boolean" && L(t);
451
+ e.additionalProperties = t != null && typeof t != "boolean" && tr(t);
453
452
  let { properties: n } = e;
454
- if (n != null) for (let e of Object.keys(n)) n[e] = L(n[e]);
453
+ if (n != null) for (let e of Object.keys(n)) n[e] = tr(n[e]);
455
454
  }
456
- e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(L) : L(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(L)), e.allOf != null && (e.allOf = e.allOf.map(L)), e.oneOf != null && (e.oneOf = e.oneOf.map(L));
455
+ e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(tr) : tr(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(tr)), e.allOf != null && (e.allOf = e.allOf.map(tr)), e.oneOf != null && (e.oneOf = e.oneOf.map(tr));
457
456
  let { definitions: t } = e;
458
- if (t != null) for (let e of Object.keys(t)) t[e] = L(t[e]);
457
+ if (t != null) for (let e of Object.keys(t)) t[e] = tr(t[e]);
459
458
  return e;
460
459
  }
461
- function L(e) {
462
- return typeof e == "boolean" ? e : $n(e);
460
+ function tr(e) {
461
+ return typeof e == "boolean" ? e : er(e);
463
462
  }
464
- var er = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), tr = {
463
+ var nr = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), rr = {
465
464
  name: void 0,
466
465
  $refStrategy: "root",
467
466
  basePath: ["#"],
@@ -481,24 +480,24 @@ var er = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to u
481
480
  emailStrategy: "format:email",
482
481
  base64Strategy: "contentEncoding:base64",
483
482
  nameStrategy: "ref"
484
- }, nr = (e) => typeof e == "string" ? {
485
- ...tr,
483
+ }, ir = (e) => typeof e == "string" ? {
484
+ ...rr,
486
485
  name: e
487
486
  } : {
488
- ...tr,
487
+ ...rr,
489
488
  ...e
490
489
  };
491
- function R() {
490
+ function I() {
492
491
  return {};
493
492
  }
494
- function rr(e, t) {
493
+ function ar(e, t) {
495
494
  let n = { type: "array" };
496
- return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = H(e.type._def, {
495
+ return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = B(e.type._def, {
497
496
  ...t,
498
497
  currentPath: [...t.currentPath, "items"]
499
498
  })), 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;
500
499
  }
501
- function ir(e) {
500
+ function or(e) {
502
501
  let t = {
503
502
  type: "integer",
504
503
  format: "int64"
@@ -515,16 +514,16 @@ function ir(e) {
515
514
  }
516
515
  return t;
517
516
  }
518
- function ar() {
517
+ function sr() {
519
518
  return { type: "boolean" };
520
519
  }
521
- function or(e, t) {
522
- return H(e.type._def, t);
520
+ function cr(e, t) {
521
+ return B(e.type._def, t);
523
522
  }
524
- var sr = (e, t) => H(e.innerType._def, t);
525
- function cr(e, t, n) {
523
+ var lr = (e, t) => B(e.innerType._def, t);
524
+ function ur(e, t, n) {
526
525
  let r = n ?? t.dateStrategy;
527
- if (Array.isArray(r)) return { anyOf: r.map((n) => cr(e, t, n)) };
526
+ if (Array.isArray(r)) return { anyOf: r.map((n) => ur(e, t, n)) };
528
527
  switch (r) {
529
528
  case "string":
530
529
  case "format:date-time": return {
@@ -535,10 +534,10 @@ function cr(e, t, n) {
535
534
  type: "string",
536
535
  format: "date"
537
536
  };
538
- case "integer": return lr(e);
537
+ case "integer": return dr(e);
539
538
  }
540
539
  }
541
- var lr = (e) => {
540
+ var dr = (e) => {
542
541
  let t = {
543
542
  type: "integer",
544
543
  format: "unix-time"
@@ -551,31 +550,31 @@ var lr = (e) => {
551
550
  }
552
551
  return t;
553
552
  };
554
- function ur(e, t) {
553
+ function fr(e, t) {
555
554
  return {
556
- ...H(e.innerType._def, t),
555
+ ...B(e.innerType._def, t),
557
556
  default: e.defaultValue()
558
557
  };
559
558
  }
560
- function dr(e, t) {
561
- return t.effectStrategy === "input" ? H(e.schema._def, t) : R();
559
+ function pr(e, t) {
560
+ return t.effectStrategy === "input" ? B(e.schema._def, t) : I();
562
561
  }
563
- function fr(e) {
562
+ function mr(e) {
564
563
  return {
565
564
  type: "string",
566
565
  enum: Array.from(e.values)
567
566
  };
568
567
  }
569
- var pr = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
570
- function mr(e, t) {
571
- let n = [H(e.left._def, {
568
+ var hr = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
569
+ function gr(e, t) {
570
+ let n = [B(e.left._def, {
572
571
  ...t,
573
572
  currentPath: [
574
573
  ...t.currentPath,
575
574
  "allOf",
576
575
  "0"
577
576
  ]
578
- }), H(e.right._def, {
577
+ }), B(e.right._def, {
579
578
  ...t,
580
579
  currentPath: [
581
580
  ...t.currentPath,
@@ -584,7 +583,7 @@ function mr(e, t) {
584
583
  ]
585
584
  })].filter((e) => !!e), r = [];
586
585
  return n.forEach((e) => {
587
- if (pr(e)) r.push(...e.allOf);
586
+ if (hr(e)) r.push(...e.allOf);
588
587
  else {
589
588
  let t = e;
590
589
  if ("additionalProperties" in e && e.additionalProperties === !1) {
@@ -595,19 +594,19 @@ function mr(e, t) {
595
594
  }
596
595
  }), r.length ? { allOf: r } : void 0;
597
596
  }
598
- function hr(e) {
597
+ function _r(e) {
599
598
  let t = typeof e.value;
600
599
  return t !== "bigint" && t !== "number" && t !== "boolean" && t !== "string" ? { type: Array.isArray(e.value) ? "array" : "object" } : {
601
600
  type: t === "bigint" ? "integer" : t,
602
601
  const: e.value
603
602
  };
604
603
  }
605
- var gr = void 0, z = {
604
+ var vr = void 0, L = {
606
605
  cuid: /^[cC][^\s-]{8,}$/,
607
606
  cuid2: /^[0-9a-z]+$/,
608
607
  ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
609
608
  email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
610
- emoji: () => (gr === void 0 && (gr = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), gr),
609
+ emoji: () => (vr === void 0 && (vr = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), vr),
611
610
  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}$/,
612
611
  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])$/,
613
612
  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])$/,
@@ -618,7 +617,7 @@ var gr = void 0, z = {
618
617
  nanoid: /^[a-zA-Z0-9_-]{21}$/,
619
618
  jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
620
619
  };
621
- function _r(e, t) {
620
+ function yr(e, t) {
622
621
  let n = { type: "string" };
623
622
  if (e.checks) for (let r of e.checks) switch (r.kind) {
624
623
  case "min":
@@ -630,108 +629,108 @@ function _r(e, t) {
630
629
  case "email":
631
630
  switch (t.emailStrategy) {
632
631
  case "format:email":
633
- B(n, "email", r.message, t);
632
+ R(n, "email", r.message, t);
634
633
  break;
635
634
  case "format:idn-email":
636
- B(n, "idn-email", r.message, t);
635
+ R(n, "idn-email", r.message, t);
637
636
  break;
638
- case "pattern:zod": V(n, z.email, r.message, t);
637
+ case "pattern:zod": z(n, L.email, r.message, t);
639
638
  }
640
639
  break;
641
640
  case "url":
642
- B(n, "uri", r.message, t);
641
+ R(n, "uri", r.message, t);
643
642
  break;
644
643
  case "uuid":
645
- B(n, "uuid", r.message, t);
644
+ R(n, "uuid", r.message, t);
646
645
  break;
647
646
  case "regex":
648
- V(n, r.regex, r.message, t);
647
+ z(n, r.regex, r.message, t);
649
648
  break;
650
649
  case "cuid":
651
- V(n, z.cuid, r.message, t);
650
+ z(n, L.cuid, r.message, t);
652
651
  break;
653
652
  case "cuid2":
654
- V(n, z.cuid2, r.message, t);
653
+ z(n, L.cuid2, r.message, t);
655
654
  break;
656
655
  case "startsWith":
657
- V(n, RegExp(`^${vr(r.value, t)}`), r.message, t);
656
+ z(n, RegExp(`^${br(r.value, t)}`), r.message, t);
658
657
  break;
659
658
  case "endsWith":
660
- V(n, RegExp(`${vr(r.value, t)}$`), r.message, t);
659
+ z(n, RegExp(`${br(r.value, t)}$`), r.message, t);
661
660
  break;
662
661
  case "datetime":
663
- B(n, "date-time", r.message, t);
662
+ R(n, "date-time", r.message, t);
664
663
  break;
665
664
  case "date":
666
- B(n, "date", r.message, t);
665
+ R(n, "date", r.message, t);
667
666
  break;
668
667
  case "time":
669
- B(n, "time", r.message, t);
668
+ R(n, "time", r.message, t);
670
669
  break;
671
670
  case "duration":
672
- B(n, "duration", r.message, t);
671
+ R(n, "duration", r.message, t);
673
672
  break;
674
673
  case "length":
675
674
  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;
676
675
  break;
677
676
  case "includes":
678
- V(n, RegExp(vr(r.value, t)), r.message, t);
677
+ z(n, RegExp(br(r.value, t)), r.message, t);
679
678
  break;
680
679
  case "ip":
681
- r.version !== "v6" && B(n, "ipv4", r.message, t), r.version !== "v4" && B(n, "ipv6", r.message, t);
680
+ r.version !== "v6" && R(n, "ipv4", r.message, t), r.version !== "v4" && R(n, "ipv6", r.message, t);
682
681
  break;
683
682
  case "base64url":
684
- V(n, z.base64url, r.message, t);
683
+ z(n, L.base64url, r.message, t);
685
684
  break;
686
685
  case "jwt":
687
- V(n, z.jwt, r.message, t);
686
+ z(n, L.jwt, r.message, t);
688
687
  break;
689
688
  case "cidr":
690
- r.version !== "v6" && V(n, z.ipv4Cidr, r.message, t), r.version !== "v4" && V(n, z.ipv6Cidr, r.message, t);
689
+ r.version !== "v6" && z(n, L.ipv4Cidr, r.message, t), r.version !== "v4" && z(n, L.ipv6Cidr, r.message, t);
691
690
  break;
692
691
  case "emoji":
693
- V(n, z.emoji(), r.message, t);
692
+ z(n, L.emoji(), r.message, t);
694
693
  break;
695
694
  case "ulid":
696
- V(n, z.ulid, r.message, t);
695
+ z(n, L.ulid, r.message, t);
697
696
  break;
698
697
  case "base64":
699
698
  switch (t.base64Strategy) {
700
699
  case "format:binary":
701
- B(n, "binary", r.message, t);
700
+ R(n, "binary", r.message, t);
702
701
  break;
703
702
  case "contentEncoding:base64":
704
703
  n.contentEncoding = "base64";
705
704
  break;
706
- case "pattern:zod": V(n, z.base64, r.message, t);
705
+ case "pattern:zod": z(n, L.base64, r.message, t);
707
706
  }
708
707
  break;
709
- case "nanoid": V(n, z.nanoid, r.message, t);
708
+ case "nanoid": z(n, L.nanoid, r.message, t);
710
709
  }
711
710
  return n;
712
711
  }
713
- function vr(e, t) {
714
- return t.patternStrategy === "escape" ? br(e) : e;
712
+ function br(e, t) {
713
+ return t.patternStrategy === "escape" ? Sr(e) : e;
715
714
  }
716
- var yr = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
717
- function br(e) {
715
+ var xr = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
716
+ function Sr(e) {
718
717
  let t = "";
719
- for (let n = 0; n < e.length; n++) yr.has(e[n]) || (t += "\\"), t += e[n];
718
+ for (let n = 0; n < e.length; n++) xr.has(e[n]) || (t += "\\"), t += e[n];
720
719
  return t;
721
720
  }
722
- function B(e, t, n, r) {
721
+ function R(e, t, n, r) {
723
722
  e.format || e.anyOf?.some((e) => e.format) ? (e.anyOf ||= [], e.format && (e.anyOf.push({ format: e.format }), delete e.format), e.anyOf.push({
724
723
  format: t,
725
724
  ...n && r.errorMessages && { errorMessage: { format: n } }
726
725
  })) : e.format = t;
727
726
  }
728
- function V(e, t, n, r) {
727
+ function z(e, t, n, r) {
729
728
  e.pattern || e.allOf?.some((e) => e.pattern) ? (e.allOf ||= [], e.pattern && (e.allOf.push({ pattern: e.pattern }), delete e.pattern), e.allOf.push({
730
- pattern: xr(t, r),
729
+ pattern: Cr(t, r),
731
730
  ...n && r.errorMessages && { errorMessage: { pattern: n } }
732
- })) : e.pattern = xr(t, r);
731
+ })) : e.pattern = Cr(t, r);
733
732
  }
734
- function xr(e, t) {
733
+ function Cr(e, t) {
735
734
  if (!t.applyRegexFlags || !e.flags) return e.source;
736
735
  let n = {
737
736
  i: e.flags.includes("i"),
@@ -779,16 +778,16 @@ function xr(e, t) {
779
778
  }
780
779
  return i;
781
780
  }
782
- function Sr(e, t) {
781
+ function wr(e, t) {
783
782
  let n = {
784
783
  type: "object",
785
- additionalProperties: H(e.valueType._def, {
784
+ additionalProperties: B(e.valueType._def, {
786
785
  ...t,
787
786
  currentPath: [...t.currentPath, "additionalProperties"]
788
787
  }) ?? t.allowedAdditionalProperties
789
788
  };
790
789
  if (e.keyType?._def.typeName === "ZodString" && e.keyType._def.checks?.length) {
791
- let { type: r, ...i } = _r(e.keyType._def, t);
790
+ let { type: r, ...i } = yr(e.keyType._def, t);
792
791
  return {
793
792
  ...n,
794
793
  propertyNames: i
@@ -799,7 +798,7 @@ function Sr(e, t) {
799
798
  propertyNames: { enum: e.keyType._def.values }
800
799
  };
801
800
  if (e.keyType?._def.typeName === "ZodBranded" && e.keyType._def.type._def.typeName === "ZodString" && e.keyType._def.type._def.checks?.length) {
802
- let { type: r, ...i } = or(e.keyType._def, t);
801
+ let { type: r, ...i } = cr(e.keyType._def, t);
803
802
  return {
804
803
  ...n,
805
804
  propertyNames: i
@@ -807,13 +806,13 @@ function Sr(e, t) {
807
806
  }
808
807
  return n;
809
808
  }
810
- function Cr(e, t) {
811
- return t.mapStrategy === "record" ? Sr(e, t) : {
809
+ function Tr(e, t) {
810
+ return t.mapStrategy === "record" ? wr(e, t) : {
812
811
  type: "array",
813
812
  maxItems: 125,
814
813
  items: {
815
814
  type: "array",
816
- items: [H(e.keyType._def, {
815
+ items: [B(e.keyType._def, {
817
816
  ...t,
818
817
  currentPath: [
819
818
  ...t.currentPath,
@@ -821,7 +820,7 @@ function Cr(e, t) {
821
820
  "items",
822
821
  "0"
823
822
  ]
824
- }) || R(), H(e.valueType._def, {
823
+ }) || I(), B(e.valueType._def, {
825
824
  ...t,
826
825
  currentPath: [
827
826
  ...t.currentPath,
@@ -829,37 +828,37 @@ function Cr(e, t) {
829
828
  "items",
830
829
  "1"
831
830
  ]
832
- }) || R()],
831
+ }) || I()],
833
832
  minItems: 2,
834
833
  maxItems: 2
835
834
  }
836
835
  };
837
836
  }
838
- function wr(e) {
837
+ function Er(e) {
839
838
  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)));
840
839
  return {
841
840
  type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
842
841
  enum: n
843
842
  };
844
843
  }
845
- function Tr() {
846
- return { not: R() };
844
+ function Dr() {
845
+ return { not: I() };
847
846
  }
848
- function Er() {
847
+ function Or() {
849
848
  return { type: "null" };
850
849
  }
851
- var Dr = {
850
+ var kr = {
852
851
  ZodString: "string",
853
852
  ZodNumber: "number",
854
853
  ZodBigInt: "integer",
855
854
  ZodBoolean: "boolean",
856
855
  ZodNull: "null"
857
856
  };
858
- function Or(e, t) {
857
+ function Ar(e, t) {
859
858
  let n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
860
- if (n.every((e) => e._def.typeName in Dr && (!e._def.checks || !e._def.checks.length))) {
859
+ if (n.every((e) => e._def.typeName in kr && (!e._def.checks || !e._def.checks.length))) {
861
860
  let e = n.reduce((e, t) => {
862
- let n = Dr[t._def.typeName];
861
+ let n = kr[t._def.typeName];
863
862
  return n && !e.includes(n) ? [...e, n] : e;
864
863
  }, []);
865
864
  return { type: e.length > 1 ? e : e[0] };
@@ -887,10 +886,10 @@ function Or(e, t) {
887
886
  type: "string",
888
887
  enum: n.reduce((e, t) => [...e, ...t._def.values.filter((t) => !e.includes(t))], [])
889
888
  };
890
- return kr(e, t);
889
+ return jr(e, t);
891
890
  }
892
- var kr = (e, t) => {
893
- let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => H(e._def, {
891
+ var jr = (e, t) => {
892
+ let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => B(e._def, {
894
893
  ...t,
895
894
  currentPath: [
896
895
  ...t.currentPath,
@@ -900,15 +899,15 @@ var kr = (e, t) => {
900
899
  })).filter((e) => !!e && (!t.strictUnions || typeof e == "object" && Object.keys(e).length > 0));
901
900
  return n.length ? { anyOf: n } : void 0;
902
901
  };
903
- function Ar(e, t) {
902
+ function Mr(e, t) {
904
903
  if ([
905
904
  "ZodString",
906
905
  "ZodNumber",
907
906
  "ZodBigInt",
908
907
  "ZodBoolean",
909
908
  "ZodNull"
910
- ].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [Dr[e.innerType._def.typeName], "null"] };
911
- let n = H(e.innerType._def, {
909
+ ].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [kr[e.innerType._def.typeName], "null"] };
910
+ let n = B(e.innerType._def, {
912
911
  ...t,
913
912
  currentPath: [
914
913
  ...t.currentPath,
@@ -918,7 +917,7 @@ function Ar(e, t) {
918
917
  });
919
918
  return n && { anyOf: [n, { type: "null" }] };
920
919
  }
921
- function jr(e) {
920
+ function Nr(e) {
922
921
  let t = { type: "number" };
923
922
  if (!e.checks) return t;
924
923
  for (let n of e.checks) switch (n.kind) {
@@ -935,7 +934,7 @@ function jr(e) {
935
934
  }
936
935
  return t;
937
936
  }
938
- function Mr(e, t) {
937
+ function Pr(e, t) {
939
938
  let n = {
940
939
  type: "object",
941
940
  properties: {}
@@ -943,7 +942,7 @@ function Mr(e, t) {
943
942
  for (let e in i) {
944
943
  let a = i[e];
945
944
  if (a === void 0 || a._def === void 0) continue;
946
- let o = Pr(a), s = H(a._def, {
945
+ let o = Ir(a), s = B(a._def, {
947
946
  ...t,
948
947
  currentPath: [
949
948
  ...t.currentPath,
@@ -959,11 +958,11 @@ function Mr(e, t) {
959
958
  s !== void 0 && (n.properties[e] = s, o || r.push(e));
960
959
  }
961
960
  r.length && (n.required = r);
962
- let a = Nr(e, t);
961
+ let a = Fr(e, t);
963
962
  return a !== void 0 && (n.additionalProperties = a), n;
964
963
  }
965
- function Nr(e, t) {
966
- if (e.catchall._def.typeName !== "ZodNever") return H(e.catchall._def, {
964
+ function Fr(e, t) {
965
+ if (e.catchall._def.typeName !== "ZodNever") return B(e.catchall._def, {
967
966
  ...t,
968
967
  currentPath: [...t.currentPath, "additionalProperties"]
969
968
  });
@@ -973,16 +972,16 @@ function Nr(e, t) {
973
972
  case "strip": return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
974
973
  }
975
974
  }
976
- function Pr(e) {
975
+ function Ir(e) {
977
976
  try {
978
977
  return e.isOptional();
979
978
  } catch {
980
979
  return !0;
981
980
  }
982
981
  }
983
- var Fr = (e, t) => {
984
- if (t.currentPath.toString() === t.propertyPath?.toString()) return H(e.innerType._def, t);
985
- let n = H(e.innerType._def, {
982
+ var Lr = (e, t) => {
983
+ if (t.currentPath.toString() === t.propertyPath?.toString()) return B(e.innerType._def, t);
984
+ let n = B(e.innerType._def, {
986
985
  ...t,
987
986
  currentPath: [
988
987
  ...t.currentPath,
@@ -990,11 +989,11 @@ var Fr = (e, t) => {
990
989
  "1"
991
990
  ]
992
991
  });
993
- return n ? { anyOf: [{ not: R() }, n] } : R();
994
- }, Ir = (e, t) => {
995
- if (t.pipeStrategy === "input") return H(e.in._def, t);
996
- if (t.pipeStrategy === "output") return H(e.out._def, t);
997
- let n = H(e.in._def, {
992
+ return n ? { anyOf: [{ not: I() }, n] } : I();
993
+ }, Rr = (e, t) => {
994
+ if (t.pipeStrategy === "input") return B(e.in._def, t);
995
+ if (t.pipeStrategy === "output") return B(e.out._def, t);
996
+ let n = B(e.in._def, {
998
997
  ...t,
999
998
  currentPath: [
1000
999
  ...t.currentPath,
@@ -1002,7 +1001,7 @@ var Fr = (e, t) => {
1002
1001
  "0"
1003
1002
  ]
1004
1003
  });
1005
- return { allOf: [n, H(e.out._def, {
1004
+ return { allOf: [n, B(e.out._def, {
1006
1005
  ...t,
1007
1006
  currentPath: [
1008
1007
  ...t.currentPath,
@@ -1011,25 +1010,25 @@ var Fr = (e, t) => {
1011
1010
  ]
1012
1011
  })].filter((e) => e !== void 0) };
1013
1012
  };
1014
- function Lr(e, t) {
1015
- return H(e.type._def, t);
1013
+ function zr(e, t) {
1014
+ return B(e.type._def, t);
1016
1015
  }
1017
- function Rr(e, t) {
1016
+ function Br(e, t) {
1018
1017
  let n = {
1019
1018
  type: "array",
1020
1019
  uniqueItems: !0,
1021
- items: H(e.valueType._def, {
1020
+ items: B(e.valueType._def, {
1022
1021
  ...t,
1023
1022
  currentPath: [...t.currentPath, "items"]
1024
1023
  })
1025
1024
  };
1026
1025
  return e.minSize && (n.minItems = e.minSize.value), e.maxSize && (n.maxItems = e.maxSize.value), n;
1027
1026
  }
1028
- function zr(e, t) {
1027
+ function Vr(e, t) {
1029
1028
  return e.rest ? {
1030
1029
  type: "array",
1031
1030
  minItems: e.items.length,
1032
- items: e.items.map((e, n) => H(e._def, {
1031
+ items: e.items.map((e, n) => B(e._def, {
1033
1032
  ...t,
1034
1033
  currentPath: [
1035
1034
  ...t.currentPath,
@@ -1037,7 +1036,7 @@ function zr(e, t) {
1037
1036
  `${n}`
1038
1037
  ]
1039
1038
  })).reduce((e, t) => t === void 0 ? e : [...e, t], []),
1040
- additionalItems: H(e.rest._def, {
1039
+ additionalItems: B(e.rest._def, {
1041
1040
  ...t,
1042
1041
  currentPath: [...t.currentPath, "additionalItems"]
1043
1042
  })
@@ -1045,7 +1044,7 @@ function zr(e, t) {
1045
1044
  type: "array",
1046
1045
  minItems: e.items.length,
1047
1046
  maxItems: e.items.length,
1048
- items: e.items.map((e, n) => H(e._def, {
1047
+ items: e.items.map((e, n) => B(e._def, {
1049
1048
  ...t,
1050
1049
  currentPath: [
1051
1050
  ...t.currentPath,
@@ -1055,65 +1054,65 @@ function zr(e, t) {
1055
1054
  })).reduce((e, t) => t === void 0 ? e : [...e, t], [])
1056
1055
  };
1057
1056
  }
1058
- function Br() {
1059
- return { not: R() };
1057
+ function Hr() {
1058
+ return { not: I() };
1060
1059
  }
1061
- function Vr() {
1062
- return R();
1060
+ function Ur() {
1061
+ return I();
1063
1062
  }
1064
- var Hr = (e, t) => H(e.innerType._def, t), Ur = (e, t, n) => {
1063
+ var Wr = (e, t) => B(e.innerType._def, t), Gr = (e, t, n) => {
1065
1064
  switch (t) {
1066
- case "ZodString": return _r(e, n);
1067
- case "ZodNumber": return jr(e);
1068
- case "ZodObject": return Mr(e, n);
1069
- case "ZodBigInt": return ir(e);
1070
- case "ZodBoolean": return ar();
1071
- case "ZodDate": return cr(e, n);
1072
- case "ZodUndefined": return Br();
1073
- case "ZodNull": return Er();
1074
- case "ZodArray": return rr(e, n);
1065
+ case "ZodString": return yr(e, n);
1066
+ case "ZodNumber": return Nr(e);
1067
+ case "ZodObject": return Pr(e, n);
1068
+ case "ZodBigInt": return or(e);
1069
+ case "ZodBoolean": return sr();
1070
+ case "ZodDate": return ur(e, n);
1071
+ case "ZodUndefined": return Hr();
1072
+ case "ZodNull": return Or();
1073
+ case "ZodArray": return ar(e, n);
1075
1074
  case "ZodUnion":
1076
- case "ZodDiscriminatedUnion": return Or(e, n);
1077
- case "ZodIntersection": return mr(e, n);
1078
- case "ZodTuple": return zr(e, n);
1079
- case "ZodRecord": return Sr(e, n);
1080
- case "ZodLiteral": return hr(e);
1081
- case "ZodEnum": return fr(e);
1082
- case "ZodNativeEnum": return wr(e);
1083
- case "ZodNullable": return Ar(e, n);
1084
- case "ZodOptional": return Fr(e, n);
1085
- case "ZodMap": return Cr(e, n);
1086
- case "ZodSet": return Rr(e, n);
1075
+ case "ZodDiscriminatedUnion": return Ar(e, n);
1076
+ case "ZodIntersection": return gr(e, n);
1077
+ case "ZodTuple": return Vr(e, n);
1078
+ case "ZodRecord": return wr(e, n);
1079
+ case "ZodLiteral": return _r(e);
1080
+ case "ZodEnum": return mr(e);
1081
+ case "ZodNativeEnum": return Er(e);
1082
+ case "ZodNullable": return Mr(e, n);
1083
+ case "ZodOptional": return Lr(e, n);
1084
+ case "ZodMap": return Tr(e, n);
1085
+ case "ZodSet": return Br(e, n);
1087
1086
  case "ZodLazy": return () => e.getter()._def;
1088
- case "ZodPromise": return Lr(e, n);
1087
+ case "ZodPromise": return zr(e, n);
1089
1088
  case "ZodNaN":
1090
- case "ZodNever": return Tr();
1091
- case "ZodEffects": return dr(e, n);
1092
- case "ZodAny": return R();
1093
- case "ZodUnknown": return Vr();
1094
- case "ZodDefault": return ur(e, n);
1095
- case "ZodBranded": return or(e, n);
1096
- case "ZodReadonly": return Hr(e, n);
1097
- case "ZodCatch": return sr(e, n);
1098
- case "ZodPipeline": return Ir(e, n);
1089
+ case "ZodNever": return Dr();
1090
+ case "ZodEffects": return pr(e, n);
1091
+ case "ZodAny": return I();
1092
+ case "ZodUnknown": return Ur();
1093
+ case "ZodDefault": return fr(e, n);
1094
+ case "ZodBranded": return cr(e, n);
1095
+ case "ZodReadonly": return Wr(e, n);
1096
+ case "ZodCatch": return lr(e, n);
1097
+ case "ZodPipeline": return Rr(e, n);
1099
1098
  case "ZodFunction":
1100
1099
  case "ZodVoid":
1101
1100
  case "ZodSymbol": return;
1102
1101
  default: return /* @__PURE__ */ ((e) => void 0)(t);
1103
1102
  }
1104
- }, Wr = (e, t) => {
1103
+ }, Kr = (e, t) => {
1105
1104
  let n = 0;
1106
1105
  for (; n < e.length && n < t.length && e[n] === t[n]; n++);
1107
1106
  return [(e.length - n).toString(), ...t.slice(n)].join("/");
1108
1107
  };
1109
- function H(e, t, n = !1) {
1108
+ function B(e, t, n = !1) {
1110
1109
  let r = t.seen.get(e);
1111
1110
  if (t.override) {
1112
1111
  let i = t.override?.call(t, e, t, r, n);
1113
- if (i !== er) return i;
1112
+ if (i !== nr) return i;
1114
1113
  }
1115
1114
  if (r && !n) {
1116
- let e = Gr(r, t);
1115
+ let e = qr(r, t);
1117
1116
  if (e !== void 0) return e;
1118
1117
  }
1119
1118
  let i = {
@@ -1122,22 +1121,22 @@ function H(e, t, n = !1) {
1122
1121
  jsonSchema: void 0
1123
1122
  };
1124
1123
  t.seen.set(e, i);
1125
- let a = Ur(e, e.typeName, t), o = typeof a == "function" ? H(a(), t) : a;
1126
- if (o && Kr(e, t, o), t.postProcess) {
1124
+ let a = Gr(e, e.typeName, t), o = typeof a == "function" ? B(a(), t) : a;
1125
+ if (o && Jr(e, t, o), t.postProcess) {
1127
1126
  let n = t.postProcess(o, e, t);
1128
1127
  return i.jsonSchema = o, n;
1129
1128
  }
1130
1129
  return i.jsonSchema = o, o;
1131
1130
  }
1132
- var Gr = (e, t) => {
1131
+ var qr = (e, t) => {
1133
1132
  switch (t.$refStrategy) {
1134
1133
  case "root": return { $ref: e.path.join("/") };
1135
- case "relative": return { $ref: Wr(t.currentPath, e.path) };
1134
+ case "relative": return { $ref: Kr(t.currentPath, e.path) };
1136
1135
  case "none":
1137
- 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`), R()) : t.$refStrategy === "seen" ? R() : void 0;
1136
+ 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`), I()) : t.$refStrategy === "seen" ? I() : void 0;
1138
1137
  }
1139
- }, Kr = (e, t, n) => (e.description && (n.description = e.description), n), qr = (e) => {
1140
- let t = nr(e), n = t.name === void 0 ? t.basePath : [
1138
+ }, Jr = (e, t, n) => (e.description && (n.description = e.description), n), Yr = (e) => {
1139
+ let t = ir(e), n = t.name === void 0 ? t.basePath : [
1141
1140
  ...t.basePath,
1142
1141
  t.definitionPath,
1143
1142
  t.name
@@ -1156,25 +1155,25 @@ var Gr = (e, t) => {
1156
1155
  jsonSchema: void 0
1157
1156
  }]))
1158
1157
  };
1159
- }, Jr = (e, t) => {
1160
- let n = qr(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
1158
+ }, Xr = (e, t) => {
1159
+ let n = Yr(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
1161
1160
  ...e,
1162
- [t]: H(r._def, {
1161
+ [t]: B(r._def, {
1163
1162
  ...n,
1164
1163
  currentPath: [
1165
1164
  ...n.basePath,
1166
1165
  n.definitionPath,
1167
1166
  t
1168
1167
  ]
1169
- }, !0) ?? R()
1170
- }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = H(e._def, i === void 0 ? n : {
1168
+ }, !0) ?? I()
1169
+ }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = B(e._def, i === void 0 ? n : {
1171
1170
  ...n,
1172
1171
  currentPath: [
1173
1172
  ...n.basePath,
1174
1173
  n.definitionPath,
1175
1174
  i
1176
1175
  ]
1177
- }, !1) ?? R(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
1176
+ }, !1) ?? I(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
1178
1177
  o !== void 0 && (a.title = o);
1179
1178
  let s = i === void 0 ? r ? {
1180
1179
  ...a,
@@ -1191,14 +1190,14 @@ var Gr = (e, t) => {
1191
1190
  }
1192
1191
  };
1193
1192
  return s.$schema = "http://json-schema.org/draft-07/schema#", s;
1194
- }, Yr = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
1195
- function Xr(e) {
1193
+ }, Zr = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
1194
+ function Qr(e) {
1196
1195
  let t;
1197
1196
  return () => (t ??= e(), t);
1198
1197
  }
1199
- function Zr(e, { validate: t } = {}) {
1198
+ function $r(e, { validate: t } = {}) {
1200
1199
  return {
1201
- [Yr]: !0,
1200
+ [Zr]: !0,
1202
1201
  _type: void 0,
1203
1202
  get jsonSchema() {
1204
1203
  return typeof e == "function" && (e = e()), e;
@@ -1206,20 +1205,20 @@ function Zr(e, { validate: t } = {}) {
1206
1205
  validate: t
1207
1206
  };
1208
1207
  }
1209
- function Qr(e) {
1210
- return typeof e == "object" && !!e && Yr in e && e[Yr] === !0 && "jsonSchema" in e && "validate" in e;
1208
+ function ei(e) {
1209
+ return typeof e == "object" && !!e && Zr in e && e[Zr] === !0 && "jsonSchema" in e && "validate" in e;
1211
1210
  }
1212
- function $r(e) {
1213
- return e == null ? Zr({
1211
+ function ti(e) {
1212
+ return e == null ? $r({
1214
1213
  type: "object",
1215
1214
  properties: {},
1216
1215
  additionalProperties: !1
1217
- }) : Qr(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? ai(e) : ei(e) : e();
1216
+ }) : ei(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? si(e) : ni(e) : e();
1218
1217
  }
1219
- function ei(e) {
1220
- return Zr(() => {
1221
- if (!ti(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
1222
- return $n(e["~standard"].jsonSchema.input({ target: "draft-07" }));
1218
+ function ni(e) {
1219
+ return $r(() => {
1220
+ if (!ri(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
1221
+ return er(e["~standard"].jsonSchema.input({ target: "draft-07" }));
1223
1222
  }, { validate: async (t) => {
1224
1223
  let n = await e["~standard"].validate(t);
1225
1224
  return "value" in n ? {
@@ -1227,19 +1226,19 @@ function ei(e) {
1227
1226
  value: n.value
1228
1227
  } : {
1229
1228
  success: !1,
1230
- error: new F({
1229
+ error: new P({
1231
1230
  value: t,
1232
1231
  cause: n.issues
1233
1232
  })
1234
1233
  };
1235
1234
  } });
1236
1235
  }
1237
- function ti(e) {
1236
+ function ri(e) {
1238
1237
  return e["~standard"].jsonSchema != null;
1239
1238
  }
1240
- function ni(e, t) {
1239
+ function ii(e, t) {
1241
1240
  let n = t?.useReferences ?? !1;
1242
- return Zr(() => Jr(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
1241
+ return $r(() => Xr(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
1243
1242
  let n = await e.safeParseAsync(t);
1244
1243
  return n.success ? {
1245
1244
  success: !0,
@@ -1250,14 +1249,14 @@ function ni(e, t) {
1250
1249
  };
1251
1250
  } });
1252
1251
  }
1253
- function ri(e, t) {
1252
+ function ai(e, t) {
1254
1253
  let n = t?.useReferences ?? !1;
1255
- return Zr(() => $n(tt(e, {
1254
+ return $r(() => er(at(e, {
1256
1255
  target: "draft-7",
1257
1256
  io: "input",
1258
1257
  reused: n ? "ref" : "inline"
1259
1258
  })), { validate: async (t) => {
1260
- let n = await ct(e, t);
1259
+ let n = await ft(e, t);
1261
1260
  return n.success ? {
1262
1261
  success: !0,
1263
1262
  value: n.data
@@ -1267,27 +1266,27 @@ function ri(e, t) {
1267
1266
  };
1268
1267
  } });
1269
1268
  }
1270
- function ii(e) {
1269
+ function oi(e) {
1271
1270
  return "_zod" in e;
1272
1271
  }
1273
- function ai(e, t) {
1274
- return ii(e) ? ri(e, t) : ni(e, t);
1272
+ function si(e, t) {
1273
+ return oi(e) ? ai(e, t) : ii(e, t);
1275
1274
  }
1276
- async function oi({ value: e, schema: t, context: n }) {
1277
- let r = await si({
1275
+ async function ci({ value: e, schema: t, context: n }) {
1276
+ let r = await li({
1278
1277
  value: e,
1279
1278
  schema: t,
1280
1279
  context: n
1281
1280
  });
1282
- if (!r.success) throw F.wrap({
1281
+ if (!r.success) throw P.wrap({
1283
1282
  value: e,
1284
1283
  cause: r.error,
1285
1284
  context: n
1286
1285
  });
1287
1286
  return r.value;
1288
1287
  }
1289
- async function si({ value: e, schema: t, context: n }) {
1290
- let r = $r(t);
1288
+ async function li({ value: e, schema: t, context: n }) {
1289
+ let r = ti(t);
1291
1290
  try {
1292
1291
  if (r.validate == null) return {
1293
1292
  success: !0,
@@ -1301,7 +1300,7 @@ async function si({ value: e, schema: t, context: n }) {
1301
1300
  rawValue: e
1302
1301
  } : {
1303
1302
  success: !1,
1304
- error: F.wrap({
1303
+ error: P.wrap({
1305
1304
  value: e,
1306
1305
  cause: t.error,
1307
1306
  context: n
@@ -1311,7 +1310,7 @@ async function si({ value: e, schema: t, context: n }) {
1311
1310
  } catch (t) {
1312
1311
  return {
1313
1312
  success: !1,
1314
- error: F.wrap({
1313
+ error: P.wrap({
1315
1314
  value: e,
1316
1315
  cause: t,
1317
1316
  context: n
@@ -1320,21 +1319,21 @@ async function si({ value: e, schema: t, context: n }) {
1320
1319
  };
1321
1320
  }
1322
1321
  }
1323
- async function ci({ text: e, schema: t }) {
1322
+ async function ui({ text: e, schema: t }) {
1324
1323
  try {
1325
- let n = Qn(e);
1324
+ let n = $n(e);
1326
1325
  return t == null ? {
1327
1326
  success: !0,
1328
1327
  value: n,
1329
1328
  rawValue: n
1330
- } : await si({
1329
+ } : await li({
1331
1330
  value: n,
1332
1331
  schema: t
1333
1332
  });
1334
1333
  } catch (t) {
1335
1334
  return {
1336
1335
  success: !1,
1337
- error: Sn.isInstance(t) ? t : new Sn({
1336
+ error: Cn.isInstance(t) ? t : new Cn({
1338
1337
  text: e,
1339
1338
  cause: t
1340
1339
  }),
@@ -1342,56 +1341,56 @@ async function ci({ text: e, schema: t }) {
1342
1341
  };
1343
1342
  }
1344
1343
  }
1345
- function li({ stream: e, schema: t }) {
1346
- return e.pipeThrough(new TextDecoderStream()).pipeThrough(new Hn()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
1347
- e !== "[DONE]" && n.enqueue(await ci({
1344
+ function di({ stream: e, schema: t }) {
1345
+ return e.pipeThrough(new TextDecoderStream()).pipeThrough(new Un()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
1346
+ e !== "[DONE]" && n.enqueue(await ui({
1348
1347
  text: e,
1349
1348
  schema: t
1350
1349
  }));
1351
1350
  } }));
1352
1351
  }
1353
- async function ui(e) {
1352
+ async function V(e) {
1354
1353
  return typeof e == "function" && (e = e()), Promise.resolve(e);
1355
1354
  }
1356
1355
  new TextDecoder();
1357
- var di = Object.defineProperty, fi = (e, t) => {
1358
- for (var n in t) di(e, n, {
1356
+ var fi = Object.defineProperty, pi = (e, t) => {
1357
+ for (var n in t) fi(e, n, {
1359
1358
  get: t[n],
1360
1359
  enumerable: !0
1361
1360
  });
1362
- }, pi = "AI_InvalidArgumentError", mi = `vercel.ai.error.${pi}`, hi = Symbol.for(mi), gi, _i, vi = class extends (_i = P, gi = hi, _i) {
1361
+ }, mi = "AI_InvalidArgumentError", hi = `vercel.ai.error.${mi}`, gi = Symbol.for(hi), _i, vi, yi = class extends (vi = N, _i = gi, vi) {
1363
1362
  constructor({ parameter: e, value: t, message: n }) {
1364
1363
  super({
1365
- name: pi,
1364
+ name: mi,
1366
1365
  message: `Invalid argument for parameter ${e}: ${n}`
1367
- }), this[gi] = !0, this.parameter = e, this.value = t;
1366
+ }), this[_i] = !0, this.parameter = e, this.value = t;
1368
1367
  }
1369
1368
  static isInstance(e) {
1370
- return P.hasMarker(e, mi);
1369
+ return N.hasMarker(e, hi);
1371
1370
  }
1372
- }, yi = "AI_NoObjectGeneratedError", bi = `vercel.ai.error.${yi}`, xi = Symbol.for(bi), Si, Ci, U = class extends (Ci = P, Si = xi, Ci) {
1371
+ }, bi = "AI_NoObjectGeneratedError", xi = `vercel.ai.error.${bi}`, Si = Symbol.for(xi), Ci, wi, H = class extends (wi = N, Ci = Si, wi) {
1373
1372
  constructor({ message: e = "No object generated.", cause: t, text: n, response: r, usage: i, finishReason: a }) {
1374
1373
  super({
1375
- name: yi,
1374
+ name: bi,
1376
1375
  message: e,
1377
1376
  cause: t
1378
- }), this[Si] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
1377
+ }), this[Ci] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
1379
1378
  }
1380
1379
  static isInstance(e) {
1381
- return P.hasMarker(e, bi);
1380
+ return N.hasMarker(e, xi);
1382
1381
  }
1383
- }, wi = "AI_UIMessageStreamError", Ti = `vercel.ai.error.${wi}`, Ei = Symbol.for(Ti), Di, Oi, ki = class extends (Oi = P, Di = Ei, Oi) {
1382
+ }, Ti = "AI_UIMessageStreamError", Ei = `vercel.ai.error.${Ti}`, Di = Symbol.for(Ei), Oi, ki, Ai = class extends (ki = N, Oi = Di, ki) {
1384
1383
  constructor({ chunkType: e, chunkId: t, message: n }) {
1385
1384
  super({
1386
- name: wi,
1385
+ name: Ti,
1387
1386
  message: n
1388
- }), this[Di] = !0, this.chunkType = e, this.chunkId = t;
1387
+ }), this[Oi] = !0, this.chunkType = e, this.chunkId = t;
1389
1388
  }
1390
1389
  static isInstance(e) {
1391
- return P.hasMarker(e, Ti);
1390
+ return N.hasMarker(e, Ei);
1392
1391
  }
1393
1392
  };
1394
- function Ai({ warning: e, provider: t, model: n }) {
1393
+ function ji({ warning: e, provider: t, model: n }) {
1395
1394
  let r = `AI SDK Warning${t != null && n != null ? ` (${t} / ${n})` : ""}:`;
1396
1395
  switch (e.type) {
1397
1396
  case "unsupported": {
@@ -1407,11 +1406,11 @@ function Ai({ warning: e, provider: t, model: n }) {
1407
1406
  default: return `${r} ${JSON.stringify(e, null, 2)}`;
1408
1407
  }
1409
1408
  }
1410
- var ji = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.", Mi = !1;
1411
- function Ni({ message: e, type: t }) {
1409
+ var Mi = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.", Ni = !1;
1410
+ function Pi({ message: e, type: t }) {
1412
1411
  typeof process < "u" && typeof process.emitWarning == "function" ? process.emitWarning(e, { type: t }) : console.warn(e);
1413
1412
  }
1414
- var Pi = (e) => {
1413
+ var Fi = (e) => {
1415
1414
  if (e.warnings.length === 0) return;
1416
1415
  let t = globalThis.AI_SDK_LOG_WARNINGS;
1417
1416
  if (t !== !1) {
@@ -1419,12 +1418,12 @@ var Pi = (e) => {
1419
1418
  t(e);
1420
1419
  return;
1421
1420
  }
1422
- Mi || (Mi = !0, Ni({
1423
- message: ji,
1421
+ Ni || (Ni = !0, Pi({
1422
+ message: Mi,
1424
1423
  type: "Warning"
1425
1424
  }));
1426
- for (let t of e.warnings) Ni({
1427
- message: Ai({
1425
+ for (let t of e.warnings) Pi({
1426
+ message: ji({
1428
1427
  warning: t,
1429
1428
  provider: e.provider,
1430
1429
  model: e.model
@@ -1433,7 +1432,7 @@ var Pi = (e) => {
1433
1432
  });
1434
1433
  }
1435
1434
  };
1436
- function Fi(e, t) {
1435
+ function Ii(e, t) {
1437
1436
  if (e === void 0 && t === void 0) return;
1438
1437
  if (e === void 0) return t;
1439
1438
  if (t === void 0) return e;
@@ -1442,261 +1441,261 @@ function Fi(e, t) {
1442
1441
  let i = t[r];
1443
1442
  if (i === void 0) continue;
1444
1443
  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);
1445
- n[r] = o && s ? Fi(a, i) : i;
1444
+ n[r] = o && s ? Ii(a, i) : i;
1446
1445
  }
1447
1446
  return n;
1448
1447
  }
1449
- var W = {
1450
- array: $e,
1451
- boolean: We,
1452
- custom: at,
1453
- discriminatedUnion: et,
1454
- enum: it,
1455
- instanceof: st,
1456
- lazy: Ke,
1457
- literal: Ge,
1458
- looseObject: Xe,
1459
- never: Ue,
1460
- null: nt,
1461
- number: rt,
1462
- object: Ye,
1463
- record: Ze,
1464
- string: qe,
1465
- union: Je,
1466
- unknown: Qe
1467
- }, Ii = W.lazy(() => W.union([
1468
- W.null(),
1469
- W.string(),
1470
- W.number(),
1471
- W.boolean(),
1472
- W.record(W.string(), Ii.optional()),
1473
- W.array(Ii)
1474
- ])), G = W.record(W.string(), W.record(W.string(), Ii.optional())), Li = W.union([
1475
- W.string(),
1476
- W.instanceof(Uint8Array),
1477
- W.instanceof(ArrayBuffer),
1478
- W.custom(qn, { message: "Must be a Buffer" })
1479
- ]), Ri = W.record(W.string(), W.string()), zi = W.object({
1480
- type: W.literal("text"),
1481
- text: W.string(),
1482
- providerOptions: G.optional()
1483
- }), Bi = W.object({
1484
- type: W.literal("image"),
1485
- image: W.union([
1486
- Li,
1487
- W.instanceof(URL),
1488
- Ri
1448
+ var U = {
1449
+ array: rt,
1450
+ boolean: Je,
1451
+ custom: lt,
1452
+ discriminatedUnion: it,
1453
+ enum: ct,
1454
+ instanceof: dt,
1455
+ lazy: Xe,
1456
+ literal: Ye,
1457
+ looseObject: et,
1458
+ never: qe,
1459
+ null: ot,
1460
+ number: st,
1461
+ object: $e,
1462
+ record: tt,
1463
+ string: Ze,
1464
+ union: Qe,
1465
+ unknown: nt
1466
+ }, Li = U.lazy(() => U.union([
1467
+ U.null(),
1468
+ U.string(),
1469
+ U.number(),
1470
+ U.boolean(),
1471
+ U.record(U.string(), Li.optional()),
1472
+ U.array(Li)
1473
+ ])), W = U.record(U.string(), U.record(U.string(), Li.optional())), Ri = U.union([
1474
+ U.string(),
1475
+ U.instanceof(Uint8Array),
1476
+ U.instanceof(ArrayBuffer),
1477
+ U.custom(Jn, { message: "Must be a Buffer" })
1478
+ ]), zi = U.record(U.string(), U.string()), Bi = U.object({
1479
+ type: U.literal("text"),
1480
+ text: U.string(),
1481
+ providerOptions: W.optional()
1482
+ }), Vi = U.object({
1483
+ type: U.literal("image"),
1484
+ image: U.union([
1485
+ Ri,
1486
+ U.instanceof(URL),
1487
+ zi
1489
1488
  ]),
1490
- mediaType: W.string().optional(),
1491
- providerOptions: G.optional()
1492
- }), Vi = W.discriminatedUnion("type", [
1493
- W.object({
1494
- type: W.literal("data"),
1495
- data: Li
1489
+ mediaType: U.string().optional(),
1490
+ providerOptions: W.optional()
1491
+ }), Hi = U.discriminatedUnion("type", [
1492
+ U.object({
1493
+ type: U.literal("data"),
1494
+ data: Ri
1496
1495
  }),
1497
- W.object({
1498
- type: W.literal("url"),
1499
- url: W.instanceof(URL)
1496
+ U.object({
1497
+ type: U.literal("url"),
1498
+ url: U.instanceof(URL)
1500
1499
  }),
1501
- W.object({
1502
- type: W.literal("reference"),
1503
- reference: Ri
1500
+ U.object({
1501
+ type: U.literal("reference"),
1502
+ reference: zi
1504
1503
  }),
1505
- W.object({
1506
- type: W.literal("text"),
1507
- text: W.string()
1504
+ U.object({
1505
+ type: U.literal("text"),
1506
+ text: U.string()
1508
1507
  })
1509
- ]), Hi = W.discriminatedUnion("type", [W.object({
1510
- type: W.literal("data"),
1511
- data: Li
1512
- }), W.object({
1513
- type: W.literal("url"),
1514
- url: W.instanceof(URL)
1515
- })]), Ui = W.object({
1516
- type: W.literal("file"),
1517
- data: W.union([
1518
- Vi,
1519
- Li,
1520
- W.instanceof(URL),
1521
- Ri
1522
- ]),
1523
- filename: W.string().optional(),
1524
- mediaType: W.string(),
1525
- providerOptions: G.optional()
1526
- }), Wi = W.object({
1527
- type: W.literal("reasoning"),
1528
- text: W.string(),
1529
- providerOptions: G.optional()
1530
- }), Gi = W.object({
1531
- type: W.literal("custom"),
1532
- kind: W.string().transform((e) => e),
1533
- providerOptions: G.optional()
1534
- }), Ki = W.object({
1535
- type: W.literal("reasoning-file"),
1536
- data: W.union([
1508
+ ]), Ui = U.discriminatedUnion("type", [U.object({
1509
+ type: U.literal("data"),
1510
+ data: Ri
1511
+ }), U.object({
1512
+ type: U.literal("url"),
1513
+ url: U.instanceof(URL)
1514
+ })]), Wi = U.object({
1515
+ type: U.literal("file"),
1516
+ data: U.union([
1537
1517
  Hi,
1538
- Li,
1539
- W.instanceof(URL)
1518
+ Ri,
1519
+ U.instanceof(URL),
1520
+ zi
1521
+ ]),
1522
+ filename: U.string().optional(),
1523
+ mediaType: U.string(),
1524
+ providerOptions: W.optional()
1525
+ }), Gi = U.object({
1526
+ type: U.literal("reasoning"),
1527
+ text: U.string(),
1528
+ providerOptions: W.optional()
1529
+ }), Ki = U.object({
1530
+ type: U.literal("custom"),
1531
+ kind: U.string().transform((e) => e),
1532
+ providerOptions: W.optional()
1533
+ }), qi = U.object({
1534
+ type: U.literal("reasoning-file"),
1535
+ data: U.union([
1536
+ Ui,
1537
+ Ri,
1538
+ U.instanceof(URL)
1540
1539
  ]),
1541
- mediaType: W.string(),
1542
- providerOptions: G.optional()
1543
- }), qi = W.object({
1544
- type: W.literal("tool-call"),
1545
- toolCallId: W.string(),
1546
- toolName: W.string(),
1547
- input: W.unknown(),
1548
- providerOptions: G.optional(),
1549
- providerExecuted: W.boolean().optional()
1550
- }), Ji = W.discriminatedUnion("type", [
1551
- W.object({
1552
- type: W.literal("text"),
1553
- value: W.string(),
1554
- providerOptions: G.optional()
1540
+ mediaType: U.string(),
1541
+ providerOptions: W.optional()
1542
+ }), Ji = U.object({
1543
+ type: U.literal("tool-call"),
1544
+ toolCallId: U.string(),
1545
+ toolName: U.string(),
1546
+ input: U.unknown(),
1547
+ providerOptions: W.optional(),
1548
+ providerExecuted: U.boolean().optional()
1549
+ }), Yi = U.discriminatedUnion("type", [
1550
+ U.object({
1551
+ type: U.literal("text"),
1552
+ value: U.string(),
1553
+ providerOptions: W.optional()
1555
1554
  }),
1556
- W.object({
1557
- type: W.literal("json"),
1558
- value: Ii,
1559
- providerOptions: G.optional()
1555
+ U.object({
1556
+ type: U.literal("json"),
1557
+ value: Li,
1558
+ providerOptions: W.optional()
1560
1559
  }),
1561
- W.object({
1562
- type: W.literal("execution-denied"),
1563
- reason: W.string().optional(),
1564
- providerOptions: G.optional()
1560
+ U.object({
1561
+ type: U.literal("execution-denied"),
1562
+ reason: U.string().optional(),
1563
+ providerOptions: W.optional()
1565
1564
  }),
1566
- W.object({
1567
- type: W.literal("error-text"),
1568
- value: W.string(),
1569
- providerOptions: G.optional()
1565
+ U.object({
1566
+ type: U.literal("error-text"),
1567
+ value: U.string(),
1568
+ providerOptions: W.optional()
1570
1569
  }),
1571
- W.object({
1572
- type: W.literal("error-json"),
1573
- value: Ii,
1574
- providerOptions: G.optional()
1570
+ U.object({
1571
+ type: U.literal("error-json"),
1572
+ value: Li,
1573
+ providerOptions: W.optional()
1575
1574
  }),
1576
- W.object({
1577
- type: W.literal("content"),
1578
- value: W.array(W.union([
1579
- W.object({
1580
- type: W.literal("text"),
1581
- text: W.string(),
1582
- providerOptions: G.optional()
1575
+ U.object({
1576
+ type: U.literal("content"),
1577
+ value: U.array(U.union([
1578
+ U.object({
1579
+ type: U.literal("text"),
1580
+ text: U.string(),
1581
+ providerOptions: W.optional()
1583
1582
  }),
1584
- W.object({
1585
- type: W.literal("file"),
1586
- data: Vi,
1587
- mediaType: W.string(),
1588
- filename: W.string().optional(),
1589
- providerOptions: G.optional()
1583
+ U.object({
1584
+ type: U.literal("file"),
1585
+ data: Hi,
1586
+ mediaType: U.string(),
1587
+ filename: U.string().optional(),
1588
+ providerOptions: W.optional()
1590
1589
  }),
1591
- W.object({
1592
- type: W.literal("file-data"),
1593
- data: W.string(),
1594
- mediaType: W.string(),
1595
- filename: W.string().optional(),
1596
- providerOptions: G.optional()
1590
+ U.object({
1591
+ type: U.literal("file-data"),
1592
+ data: U.string(),
1593
+ mediaType: U.string(),
1594
+ filename: U.string().optional(),
1595
+ providerOptions: W.optional()
1597
1596
  }),
1598
- W.object({
1599
- type: W.literal("file-url"),
1600
- url: W.string(),
1601
- mediaType: W.string().optional(),
1602
- providerOptions: G.optional()
1597
+ U.object({
1598
+ type: U.literal("file-url"),
1599
+ url: U.string(),
1600
+ mediaType: U.string().optional(),
1601
+ providerOptions: W.optional()
1603
1602
  }),
1604
- W.object({
1605
- type: W.literal("file-id"),
1606
- fileId: W.union([W.string(), W.record(W.string(), W.string())]),
1607
- providerOptions: G.optional()
1603
+ U.object({
1604
+ type: U.literal("file-id"),
1605
+ fileId: U.union([U.string(), U.record(U.string(), U.string())]),
1606
+ providerOptions: W.optional()
1608
1607
  }),
1609
- W.object({
1610
- type: W.literal("file-reference"),
1611
- providerReference: W.record(W.string(), W.string()),
1612
- providerOptions: G.optional()
1608
+ U.object({
1609
+ type: U.literal("file-reference"),
1610
+ providerReference: U.record(U.string(), U.string()),
1611
+ providerOptions: W.optional()
1613
1612
  }),
1614
- W.object({
1615
- type: W.literal("image-data"),
1616
- data: W.string(),
1617
- mediaType: W.string(),
1618
- providerOptions: G.optional()
1613
+ U.object({
1614
+ type: U.literal("image-data"),
1615
+ data: U.string(),
1616
+ mediaType: U.string(),
1617
+ providerOptions: W.optional()
1619
1618
  }),
1620
- W.object({
1621
- type: W.literal("image-url"),
1622
- url: W.string(),
1623
- providerOptions: G.optional()
1619
+ U.object({
1620
+ type: U.literal("image-url"),
1621
+ url: U.string(),
1622
+ providerOptions: W.optional()
1624
1623
  }),
1625
- W.object({
1626
- type: W.literal("image-file-id"),
1627
- fileId: W.union([W.string(), W.record(W.string(), W.string())]),
1628
- providerOptions: G.optional()
1624
+ U.object({
1625
+ type: U.literal("image-file-id"),
1626
+ fileId: U.union([U.string(), U.record(U.string(), U.string())]),
1627
+ providerOptions: W.optional()
1629
1628
  }),
1630
- W.object({
1631
- type: W.literal("image-file-reference"),
1632
- providerReference: W.record(W.string(), W.string()),
1633
- providerOptions: G.optional()
1629
+ U.object({
1630
+ type: U.literal("image-file-reference"),
1631
+ providerReference: U.record(U.string(), U.string()),
1632
+ providerOptions: W.optional()
1634
1633
  }),
1635
- W.object({
1636
- type: W.literal("custom"),
1637
- providerOptions: G.optional()
1634
+ U.object({
1635
+ type: U.literal("custom"),
1636
+ providerOptions: W.optional()
1638
1637
  })
1639
1638
  ]))
1640
1639
  })
1641
- ]), Yi = W.object({
1642
- type: W.literal("tool-result"),
1643
- toolCallId: W.string(),
1644
- toolName: W.string(),
1645
- output: Ji,
1646
- providerOptions: G.optional()
1647
- }), Xi = W.object({
1648
- type: W.literal("tool-approval-request"),
1649
- approvalId: W.string(),
1650
- toolCallId: W.string(),
1651
- reason: W.string().optional()
1652
- }), Zi = W.object({
1653
- type: W.literal("tool-approval-response"),
1654
- approvalId: W.string(),
1655
- approved: W.boolean(),
1656
- reason: W.string().optional()
1657
- }), Qi = W.object({
1658
- role: W.literal("system"),
1659
- content: W.string(),
1660
- providerOptions: G.optional()
1661
- }), $i = W.object({
1662
- role: W.literal("user"),
1663
- content: W.union([W.string(), W.array(W.union([
1664
- zi,
1640
+ ]), Xi = U.object({
1641
+ type: U.literal("tool-result"),
1642
+ toolCallId: U.string(),
1643
+ toolName: U.string(),
1644
+ output: Yi,
1645
+ providerOptions: W.optional()
1646
+ }), Zi = U.object({
1647
+ type: U.literal("tool-approval-request"),
1648
+ approvalId: U.string(),
1649
+ toolCallId: U.string(),
1650
+ reason: U.string().optional()
1651
+ }), Qi = U.object({
1652
+ type: U.literal("tool-approval-response"),
1653
+ approvalId: U.string(),
1654
+ approved: U.boolean(),
1655
+ reason: U.string().optional()
1656
+ }), $i = U.object({
1657
+ role: U.literal("system"),
1658
+ content: U.string(),
1659
+ providerOptions: W.optional()
1660
+ }), ea = U.object({
1661
+ role: U.literal("user"),
1662
+ content: U.union([U.string(), U.array(U.union([
1665
1663
  Bi,
1666
- Ui
1664
+ Vi,
1665
+ Wi
1667
1666
  ]))]),
1668
- providerOptions: G.optional()
1669
- }), ea = W.object({
1670
- role: W.literal("assistant"),
1671
- content: W.union([W.string(), W.array(W.union([
1672
- zi,
1673
- Gi,
1674
- Ui,
1675
- Wi,
1667
+ providerOptions: W.optional()
1668
+ }), ta = U.object({
1669
+ role: U.literal("assistant"),
1670
+ content: U.union([U.string(), U.array(U.union([
1671
+ Bi,
1676
1672
  Ki,
1673
+ Wi,
1674
+ Gi,
1677
1675
  qi,
1678
- Yi,
1679
- Xi
1676
+ Ji,
1677
+ Xi,
1678
+ Zi
1680
1679
  ]))]),
1681
- providerOptions: G.optional()
1682
- }), ta = W.object({
1683
- role: W.literal("tool"),
1684
- content: W.array(W.union([Yi, Zi])),
1685
- providerOptions: G.optional()
1680
+ providerOptions: W.optional()
1681
+ }), na = U.object({
1682
+ role: U.literal("tool"),
1683
+ content: U.array(U.union([Xi, Qi])),
1684
+ providerOptions: W.optional()
1686
1685
  });
1687
- W.union([
1688
- Qi,
1686
+ U.union([
1689
1687
  $i,
1690
1688
  ea,
1691
- ta
1692
- ]), fi({}, {
1693
- array: () => oa,
1694
- choice: () => la,
1695
- json: () => ua,
1696
- object: () => aa,
1697
- text: () => ia
1689
+ ta,
1690
+ na
1691
+ ]), pi({}, {
1692
+ array: () => sa,
1693
+ choice: () => ua,
1694
+ json: () => da,
1695
+ object: () => oa,
1696
+ text: () => aa
1698
1697
  });
1699
- function na(e) {
1698
+ function ra(e) {
1700
1699
  let t = ["ROOT"], n = -1, r = null, i = 0;
1701
1700
  function a(e) {
1702
1701
  return e >= "0" && e <= "9" || e >= "A" && e <= "F" || e >= "a" && e <= "f";
@@ -1878,16 +1877,16 @@ function na(e) {
1878
1877
  }
1879
1878
  return l;
1880
1879
  }
1881
- async function ra(e) {
1880
+ async function ia(e) {
1882
1881
  if (e === void 0) return {
1883
1882
  value: void 0,
1884
1883
  state: "undefined-input"
1885
1884
  };
1886
- let t = await ci({ text: e });
1885
+ let t = await ui({ text: e });
1887
1886
  return t.success ? {
1888
1887
  value: t.value,
1889
1888
  state: "successful-parse"
1890
- } : (t = await ci({ text: na(e) }), t.success ? {
1889
+ } : (t = await ui({ text: ra(e) }), t.success ? {
1891
1890
  value: t.value,
1892
1891
  state: "repaired-parse"
1893
1892
  } : {
@@ -1895,7 +1894,7 @@ async function ra(e) {
1895
1894
  state: "failed-parse"
1896
1895
  });
1897
1896
  }
1898
- var ia = () => ({
1897
+ var aa = () => ({
1899
1898
  name: "text",
1900
1899
  responseFormat: Promise.resolve({ type: "text" }),
1901
1900
  async parseCompleteOutput({ text: e }) {
@@ -1905,19 +1904,19 @@ var ia = () => ({
1905
1904
  return { partial: e };
1906
1905
  },
1907
1906
  createElementStreamTransform() {}
1908
- }), aa = ({ schema: e, name: t, description: n }) => {
1909
- let r = $r(e);
1907
+ }), oa = ({ schema: e, name: t, description: n }) => {
1908
+ let r = ti(e);
1910
1909
  return {
1911
1910
  name: "object",
1912
- responseFormat: ui(r.jsonSchema).then((e) => ({
1911
+ responseFormat: V(r.jsonSchema).then((e) => ({
1913
1912
  type: "json",
1914
1913
  schema: e,
1915
1914
  ...t != null && { name: t },
1916
1915
  ...n != null && { description: n }
1917
1916
  })),
1918
1917
  async parseCompleteOutput({ text: e }, t) {
1919
- let n = await ci({ text: e });
1920
- if (!n.success) throw new U({
1918
+ let n = await ui({ text: e });
1919
+ if (!n.success) throw new H({
1921
1920
  message: "No object generated: could not parse the response.",
1922
1921
  cause: n.error,
1923
1922
  text: e,
@@ -1925,11 +1924,11 @@ var ia = () => ({
1925
1924
  usage: t.usage,
1926
1925
  finishReason: t.finishReason
1927
1926
  });
1928
- let i = await si({
1927
+ let i = await li({
1929
1928
  value: n.value,
1930
1929
  schema: r
1931
1930
  });
1932
- if (!i.success) throw new U({
1931
+ if (!i.success) throw new H({
1933
1932
  message: "No object generated: response did not match schema.",
1934
1933
  cause: i.error,
1935
1934
  text: e,
@@ -1940,7 +1939,7 @@ var ia = () => ({
1940
1939
  return i.value;
1941
1940
  },
1942
1941
  async parsePartialOutput({ text: e }) {
1943
- let t = await ra(e);
1942
+ let t = await ia(e);
1944
1943
  switch (t.state) {
1945
1944
  case "failed-parse":
1946
1945
  case "undefined-input": return;
@@ -1950,22 +1949,22 @@ var ia = () => ({
1950
1949
  },
1951
1950
  createElementStreamTransform() {}
1952
1951
  };
1953
- }, oa = ({ element: e, minItems: t, maxItems: n, name: r, description: i }) => {
1954
- if (sa({
1952
+ }, sa = ({ element: e, minItems: t, maxItems: n, name: r, description: i }) => {
1953
+ if (ca({
1955
1954
  name: "minItems",
1956
1955
  value: t
1957
- }), sa({
1956
+ }), ca({
1958
1957
  name: "maxItems",
1959
1958
  value: n
1960
- }), t != null && n != null && t > n) throw new vi({
1959
+ }), t != null && n != null && t > n) throw new yi({
1961
1960
  parameter: "minItems",
1962
1961
  value: t,
1963
1962
  message: "minItems must be less than or equal to maxItems"
1964
1963
  });
1965
- let a = $r(e);
1964
+ let a = ti(e);
1966
1965
  return {
1967
1966
  name: "array",
1968
- responseFormat: ui(a.jsonSchema).then((e) => {
1967
+ responseFormat: V(a.jsonSchema).then((e) => {
1969
1968
  let { $schema: a, definitions: o, $defs: s, ...c } = e;
1970
1969
  return {
1971
1970
  type: "json",
@@ -1988,8 +1987,8 @@ var ia = () => ({
1988
1987
  };
1989
1988
  }),
1990
1989
  async parseCompleteOutput({ text: e }, r) {
1991
- let i = await ci({ text: e });
1992
- if (!i.success) throw new U({
1990
+ let i = await ui({ text: e });
1991
+ if (!i.success) throw new H({
1993
1992
  message: "No object generated: could not parse the response.",
1994
1993
  cause: i.error,
1995
1994
  text: e,
@@ -1998,9 +1997,9 @@ var ia = () => ({
1998
1997
  finishReason: r.finishReason
1999
1998
  });
2000
1999
  let o = i.value;
2001
- if (typeof o != "object" || !o || !("elements" in o) || !Array.isArray(o.elements)) throw new U({
2000
+ if (typeof o != "object" || !o || !("elements" in o) || !Array.isArray(o.elements)) throw new H({
2002
2001
  message: "No object generated: response did not match schema.",
2003
- cause: new F({
2002
+ cause: new P({
2004
2003
  value: o,
2005
2004
  cause: "response must be an object with an elements array"
2006
2005
  }),
@@ -2009,12 +2008,12 @@ var ia = () => ({
2009
2008
  usage: r.usage,
2010
2009
  finishReason: r.finishReason
2011
2010
  });
2012
- let s = ca({
2011
+ let s = la({
2013
2012
  value: o.elements,
2014
2013
  minItems: t,
2015
2014
  maxItems: n
2016
2015
  });
2017
- if (s != null) throw new U({
2016
+ if (s != null) throw new H({
2018
2017
  message: "No object generated: response did not match schema.",
2019
2018
  cause: s,
2020
2019
  text: e,
@@ -2024,11 +2023,11 @@ var ia = () => ({
2024
2023
  });
2025
2024
  let c = [];
2026
2025
  for (let t of o.elements) {
2027
- let n = await si({
2026
+ let n = await li({
2028
2027
  value: t,
2029
2028
  schema: a
2030
2029
  });
2031
- if (!n.success) throw new U({
2030
+ if (!n.success) throw new H({
2032
2031
  message: "No object generated: response did not match schema.",
2033
2032
  cause: n.error,
2034
2033
  text: e,
@@ -2041,7 +2040,7 @@ var ia = () => ({
2041
2040
  return c;
2042
2041
  },
2043
2042
  async parsePartialOutput({ text: e }) {
2044
- let t = await ra(e);
2043
+ let t = await ia(e);
2045
2044
  switch (t.state) {
2046
2045
  case "failed-parse":
2047
2046
  case "undefined-input": return;
@@ -2051,7 +2050,7 @@ var ia = () => ({
2051
2050
  if (typeof e != "object" || !e || !("elements" in e) || !Array.isArray(e.elements)) return;
2052
2051
  let n = t.state === "repaired-parse" && e.elements.length > 0 ? e.elements.slice(0, -1) : e.elements, r = [];
2053
2052
  for (let e of n) {
2054
- let t = await si({
2053
+ let t = await li({
2055
2054
  value: e,
2056
2055
  schema: a
2057
2056
  });
@@ -2066,7 +2065,7 @@ var ia = () => ({
2066
2065
  return new TransformStream({ transform({ partialOutput: t }, r) {
2067
2066
  if (t != null) for (; e < t.length; e++) {
2068
2067
  if (n != null && e >= n) {
2069
- r.error(ca({
2068
+ r.error(la({
2070
2069
  value: t,
2071
2070
  maxItems: n
2072
2071
  }));
@@ -2078,31 +2077,31 @@ var ia = () => ({
2078
2077
  }
2079
2078
  };
2080
2079
  };
2081
- function sa({ name: e, value: t }) {
2080
+ function ca({ name: e, value: t }) {
2082
2081
  if (t != null) {
2083
- if (!Number.isInteger(t)) throw new vi({
2082
+ if (!Number.isInteger(t)) throw new yi({
2084
2083
  parameter: e,
2085
2084
  value: t,
2086
2085
  message: `${e} must be an integer`
2087
2086
  });
2088
- if (t < 0) throw new vi({
2087
+ if (t < 0) throw new yi({
2089
2088
  parameter: e,
2090
2089
  value: t,
2091
2090
  message: `${e} must be greater than or equal to 0`
2092
2091
  });
2093
2092
  }
2094
2093
  }
2095
- function ca({ value: e, minItems: t, maxItems: n }) {
2096
- if (t != null && e.length < t) return new F({
2094
+ function la({ value: e, minItems: t, maxItems: n }) {
2095
+ if (t != null && e.length < t) return new P({
2097
2096
  value: e,
2098
2097
  cause: `elements array must contain at least ${t} items`
2099
2098
  });
2100
- if (n != null && e.length > n) return new F({
2099
+ if (n != null && e.length > n) return new P({
2101
2100
  value: e,
2102
2101
  cause: `elements array must contain at most ${n} items`
2103
2102
  });
2104
2103
  }
2105
- var la = ({ options: e, name: t, description: n }) => ({
2104
+ var ua = ({ options: e, name: t, description: n }) => ({
2106
2105
  name: "choice",
2107
2106
  responseFormat: Promise.resolve({
2108
2107
  type: "json",
@@ -2120,8 +2119,8 @@ var la = ({ options: e, name: t, description: n }) => ({
2120
2119
  ...n != null && { description: n }
2121
2120
  }),
2122
2121
  async parseCompleteOutput({ text: t }, n) {
2123
- let r = await ci({ text: t });
2124
- if (!r.success) throw new U({
2122
+ let r = await ui({ text: t });
2123
+ if (!r.success) throw new H({
2125
2124
  message: "No object generated: could not parse the response.",
2126
2125
  cause: r.error,
2127
2126
  text: t,
@@ -2130,9 +2129,9 @@ var la = ({ options: e, name: t, description: n }) => ({
2130
2129
  finishReason: n.finishReason
2131
2130
  });
2132
2131
  let i = r.value;
2133
- if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new U({
2132
+ if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new H({
2134
2133
  message: "No object generated: response did not match schema.",
2135
- cause: new F({
2134
+ cause: new P({
2136
2135
  value: i,
2137
2136
  cause: "response must be an object that contains a choice value."
2138
2137
  }),
@@ -2144,7 +2143,7 @@ var la = ({ options: e, name: t, description: n }) => ({
2144
2143
  return i.result;
2145
2144
  },
2146
2145
  async parsePartialOutput({ text: t }) {
2147
- let n = await ra(t);
2146
+ let n = await ia(t);
2148
2147
  switch (n.state) {
2149
2148
  case "failed-parse":
2150
2149
  case "undefined-input": return;
@@ -2158,7 +2157,7 @@ var la = ({ options: e, name: t, description: n }) => ({
2158
2157
  }
2159
2158
  },
2160
2159
  createElementStreamTransform() {}
2161
- }), ua = ({ name: e, description: t } = {}) => ({
2160
+ }), da = ({ name: e, description: t } = {}) => ({
2162
2161
  name: "json",
2163
2162
  responseFormat: Promise.resolve({
2164
2163
  type: "json",
@@ -2166,8 +2165,8 @@ var la = ({ options: e, name: t, description: n }) => ({
2166
2165
  ...t != null && { description: t }
2167
2166
  }),
2168
2167
  async parseCompleteOutput({ text: e }, t) {
2169
- let n = await ci({ text: e });
2170
- if (!n.success) throw new U({
2168
+ let n = await ui({ text: e });
2169
+ if (!n.success) throw new H({
2171
2170
  message: "No object generated: could not parse the response.",
2172
2171
  cause: n.error,
2173
2172
  text: e,
@@ -2178,7 +2177,7 @@ var la = ({ options: e, name: t, description: n }) => ({
2178
2177
  return n.value;
2179
2178
  },
2180
2179
  async parsePartialOutput({ text: e }) {
2181
- let t = await ra(e);
2180
+ let t = await ia(e);
2182
2181
  switch (t.state) {
2183
2182
  case "failed-parse":
2184
2183
  case "undefined-input": return;
@@ -2188,19 +2187,19 @@ var la = ({ options: e, name: t, description: n }) => ({
2188
2187
  },
2189
2188
  createElementStreamTransform() {}
2190
2189
  });
2191
- new TextEncoder(), new TextEncoder(), I({
2190
+ new TextEncoder(), new TextEncoder(), F({
2192
2191
  prefix: "aitxt",
2193
2192
  size: 24
2194
- }), I({
2193
+ }), F({
2195
2194
  prefix: "call",
2196
2195
  size: 24
2197
2196
  });
2198
- function da(e, t) {
2197
+ function fa(e, t) {
2199
2198
  let n = new Headers(e ?? {});
2200
2199
  for (let [e, r] of Object.entries(t)) n.has(e) || n.set(e, r);
2201
2200
  return n;
2202
2201
  }
2203
- var fa = class extends TransformStream {
2202
+ var pa = class extends TransformStream {
2204
2203
  constructor() {
2205
2204
  super({
2206
2205
  transform(e, t) {
@@ -2213,15 +2212,15 @@ var fa = class extends TransformStream {
2213
2212
  }
2214
2213
  });
2215
2214
  }
2216
- }, pa = {
2215
+ }, ma = {
2217
2216
  "content-type": "text/event-stream",
2218
2217
  "cache-control": "no-cache",
2219
2218
  connection: "keep-alive",
2220
2219
  "x-vercel-ai-ui-message-stream": "v1",
2221
2220
  "x-accel-buffering": "no"
2222
2221
  };
2223
- function ma({ status: e, statusText: t, headers: n, stream: r, consumeSseStream: i }) {
2224
- let a = r.pipeThrough(new fa());
2222
+ function ha({ status: e, statusText: t, headers: n, stream: r, consumeSseStream: i }) {
2223
+ let a = r.pipeThrough(new pa());
2225
2224
  if (i) {
2226
2225
  let [e, t] = a.tee();
2227
2226
  a = e, i({ stream: t });
@@ -2229,173 +2228,173 @@ function ma({ status: e, statusText: t, headers: n, stream: r, consumeSseStream:
2229
2228
  return new Response(a.pipeThrough(new TextEncoderStream()), {
2230
2229
  status: e,
2231
2230
  statusText: t,
2232
- headers: da(n, pa)
2231
+ headers: fa(n, ma)
2233
2232
  });
2234
2233
  }
2235
- var ha = W.record(W.string(), Ii.optional()), ga = Xr(() => ai(W.union([
2236
- W.looseObject({
2237
- type: W.literal("text-start"),
2238
- id: W.string(),
2239
- providerMetadata: G.optional()
2234
+ var ga = U.record(U.string(), Li.optional()), _a = Qr(() => si(U.union([
2235
+ U.looseObject({
2236
+ type: U.literal("text-start"),
2237
+ id: U.string(),
2238
+ providerMetadata: W.optional()
2240
2239
  }),
2241
- W.looseObject({
2242
- type: W.literal("text-delta"),
2243
- id: W.string(),
2244
- delta: W.string(),
2245
- providerMetadata: G.optional()
2240
+ U.looseObject({
2241
+ type: U.literal("text-delta"),
2242
+ id: U.string(),
2243
+ delta: U.string(),
2244
+ providerMetadata: W.optional()
2246
2245
  }),
2247
- W.looseObject({
2248
- type: W.literal("text-end"),
2249
- id: W.string(),
2250
- providerMetadata: G.optional()
2246
+ U.looseObject({
2247
+ type: U.literal("text-end"),
2248
+ id: U.string(),
2249
+ providerMetadata: W.optional()
2251
2250
  }),
2252
- W.looseObject({
2253
- type: W.literal("error"),
2254
- errorText: W.string()
2251
+ U.looseObject({
2252
+ type: U.literal("error"),
2253
+ errorText: U.string()
2255
2254
  }),
2256
- W.looseObject({
2257
- type: W.literal("tool-input-start"),
2258
- toolCallId: W.string(),
2259
- toolName: W.string(),
2260
- providerExecuted: W.boolean().optional(),
2261
- providerMetadata: G.optional(),
2262
- toolMetadata: ha.optional(),
2263
- dynamic: W.boolean().optional(),
2264
- title: W.string().optional()
2255
+ U.looseObject({
2256
+ type: U.literal("tool-input-start"),
2257
+ toolCallId: U.string(),
2258
+ toolName: U.string(),
2259
+ providerExecuted: U.boolean().optional(),
2260
+ providerMetadata: W.optional(),
2261
+ toolMetadata: ga.optional(),
2262
+ dynamic: U.boolean().optional(),
2263
+ title: U.string().optional()
2265
2264
  }),
2266
- W.looseObject({
2267
- type: W.literal("tool-input-delta"),
2268
- toolCallId: W.string(),
2269
- inputTextDelta: W.string()
2265
+ U.looseObject({
2266
+ type: U.literal("tool-input-delta"),
2267
+ toolCallId: U.string(),
2268
+ inputTextDelta: U.string()
2270
2269
  }),
2271
- W.looseObject({
2272
- type: W.literal("tool-input-available"),
2273
- toolCallId: W.string(),
2274
- toolName: W.string(),
2275
- input: W.unknown(),
2276
- providerExecuted: W.boolean().optional(),
2277
- providerMetadata: G.optional(),
2278
- toolMetadata: ha.optional(),
2279
- dynamic: W.boolean().optional(),
2280
- title: W.string().optional()
2270
+ U.looseObject({
2271
+ type: U.literal("tool-input-available"),
2272
+ toolCallId: U.string(),
2273
+ toolName: U.string(),
2274
+ input: U.unknown(),
2275
+ providerExecuted: U.boolean().optional(),
2276
+ providerMetadata: W.optional(),
2277
+ toolMetadata: ga.optional(),
2278
+ dynamic: U.boolean().optional(),
2279
+ title: U.string().optional()
2281
2280
  }),
2282
- W.looseObject({
2283
- type: W.literal("tool-input-error"),
2284
- toolCallId: W.string(),
2285
- toolName: W.string(),
2286
- input: W.unknown(),
2287
- providerExecuted: W.boolean().optional(),
2288
- providerMetadata: G.optional(),
2289
- toolMetadata: ha.optional(),
2290
- dynamic: W.boolean().optional(),
2291
- errorText: W.string(),
2292
- title: W.string().optional()
2281
+ U.looseObject({
2282
+ type: U.literal("tool-input-error"),
2283
+ toolCallId: U.string(),
2284
+ toolName: U.string(),
2285
+ input: U.unknown(),
2286
+ providerExecuted: U.boolean().optional(),
2287
+ providerMetadata: W.optional(),
2288
+ toolMetadata: ga.optional(),
2289
+ dynamic: U.boolean().optional(),
2290
+ errorText: U.string(),
2291
+ title: U.string().optional()
2293
2292
  }),
2294
- W.looseObject({
2295
- type: W.literal("tool-approval-request"),
2296
- approvalId: W.string(),
2297
- toolCallId: W.string(),
2298
- approvalDescriptor: W.unknown().optional(),
2299
- reason: W.string().optional(),
2300
- isAutomatic: W.boolean().optional(),
2301
- signature: W.string().optional()
2293
+ U.looseObject({
2294
+ type: U.literal("tool-approval-request"),
2295
+ approvalId: U.string(),
2296
+ toolCallId: U.string(),
2297
+ approvalDescriptor: U.unknown().optional(),
2298
+ reason: U.string().optional(),
2299
+ isAutomatic: U.boolean().optional(),
2300
+ signature: U.string().optional()
2302
2301
  }),
2303
- W.looseObject({
2304
- type: W.literal("tool-approval-response"),
2305
- approvalId: W.string(),
2306
- approved: W.boolean(),
2307
- reason: W.string().optional(),
2308
- providerExecuted: W.boolean().optional(),
2309
- providerMetadata: G.optional()
2302
+ U.looseObject({
2303
+ type: U.literal("tool-approval-response"),
2304
+ approvalId: U.string(),
2305
+ approved: U.boolean(),
2306
+ reason: U.string().optional(),
2307
+ providerExecuted: U.boolean().optional(),
2308
+ providerMetadata: W.optional()
2310
2309
  }),
2311
- W.looseObject({
2312
- type: W.literal("tool-output-available"),
2313
- toolCallId: W.string(),
2314
- output: W.unknown(),
2315
- providerExecuted: W.boolean().optional(),
2316
- providerMetadata: G.optional(),
2317
- toolMetadata: ha.optional(),
2318
- dynamic: W.boolean().optional(),
2319
- preliminary: W.boolean().optional()
2310
+ U.looseObject({
2311
+ type: U.literal("tool-output-available"),
2312
+ toolCallId: U.string(),
2313
+ output: U.unknown(),
2314
+ providerExecuted: U.boolean().optional(),
2315
+ providerMetadata: W.optional(),
2316
+ toolMetadata: ga.optional(),
2317
+ dynamic: U.boolean().optional(),
2318
+ preliminary: U.boolean().optional()
2320
2319
  }),
2321
- W.looseObject({
2322
- type: W.literal("tool-output-error"),
2323
- toolCallId: W.string(),
2324
- errorText: W.string(),
2325
- providerExecuted: W.boolean().optional(),
2326
- providerMetadata: G.optional(),
2327
- toolMetadata: ha.optional(),
2328
- dynamic: W.boolean().optional()
2320
+ U.looseObject({
2321
+ type: U.literal("tool-output-error"),
2322
+ toolCallId: U.string(),
2323
+ errorText: U.string(),
2324
+ providerExecuted: U.boolean().optional(),
2325
+ providerMetadata: W.optional(),
2326
+ toolMetadata: ga.optional(),
2327
+ dynamic: U.boolean().optional()
2329
2328
  }),
2330
- W.looseObject({
2331
- type: W.literal("tool-output-denied"),
2332
- toolCallId: W.string()
2329
+ U.looseObject({
2330
+ type: U.literal("tool-output-denied"),
2331
+ toolCallId: U.string()
2333
2332
  }),
2334
- W.looseObject({
2335
- type: W.literal("reasoning-start"),
2336
- id: W.string(),
2337
- providerMetadata: G.optional()
2333
+ U.looseObject({
2334
+ type: U.literal("reasoning-start"),
2335
+ id: U.string(),
2336
+ providerMetadata: W.optional()
2338
2337
  }),
2339
- W.looseObject({
2340
- type: W.literal("reasoning-delta"),
2341
- id: W.string(),
2342
- delta: W.string(),
2343
- providerMetadata: G.optional()
2338
+ U.looseObject({
2339
+ type: U.literal("reasoning-delta"),
2340
+ id: U.string(),
2341
+ delta: U.string(),
2342
+ providerMetadata: W.optional()
2344
2343
  }),
2345
- W.looseObject({
2346
- type: W.literal("reasoning-end"),
2347
- id: W.string(),
2348
- providerMetadata: G.optional()
2344
+ U.looseObject({
2345
+ type: U.literal("reasoning-end"),
2346
+ id: U.string(),
2347
+ providerMetadata: W.optional()
2349
2348
  }),
2350
- W.looseObject({
2351
- type: W.literal("custom"),
2352
- kind: W.string().transform((e) => e),
2353
- providerMetadata: G.optional()
2349
+ U.looseObject({
2350
+ type: U.literal("custom"),
2351
+ kind: U.string().transform((e) => e),
2352
+ providerMetadata: W.optional()
2354
2353
  }),
2355
- W.looseObject({
2356
- type: W.literal("source-url"),
2357
- sourceId: W.string(),
2358
- url: W.string(),
2359
- title: W.string().optional(),
2360
- providerMetadata: G.optional()
2354
+ U.looseObject({
2355
+ type: U.literal("source-url"),
2356
+ sourceId: U.string(),
2357
+ url: U.string(),
2358
+ title: U.string().optional(),
2359
+ providerMetadata: W.optional()
2361
2360
  }),
2362
- W.looseObject({
2363
- type: W.literal("source-document"),
2364
- sourceId: W.string(),
2365
- mediaType: W.string(),
2366
- title: W.string(),
2367
- filename: W.string().optional(),
2368
- providerMetadata: G.optional()
2361
+ U.looseObject({
2362
+ type: U.literal("source-document"),
2363
+ sourceId: U.string(),
2364
+ mediaType: U.string(),
2365
+ title: U.string(),
2366
+ filename: U.string().optional(),
2367
+ providerMetadata: W.optional()
2369
2368
  }),
2370
- W.looseObject({
2371
- type: W.literal("file"),
2372
- url: W.string(),
2373
- mediaType: W.string(),
2374
- providerMetadata: G.optional()
2369
+ U.looseObject({
2370
+ type: U.literal("file"),
2371
+ url: U.string(),
2372
+ mediaType: U.string(),
2373
+ providerMetadata: W.optional()
2375
2374
  }),
2376
- W.looseObject({
2377
- type: W.literal("reasoning-file"),
2378
- url: W.string(),
2379
- mediaType: W.string(),
2380
- providerMetadata: G.optional()
2375
+ U.looseObject({
2376
+ type: U.literal("reasoning-file"),
2377
+ url: U.string(),
2378
+ mediaType: U.string(),
2379
+ providerMetadata: W.optional()
2381
2380
  }),
2382
- W.looseObject({
2383
- type: W.custom((e) => typeof e == "string" && e.startsWith("data-"), { message: "Type must start with \"data-\"" }),
2384
- id: W.string().optional(),
2385
- data: W.unknown(),
2386
- transient: W.boolean().optional()
2381
+ U.looseObject({
2382
+ type: U.custom((e) => typeof e == "string" && e.startsWith("data-"), { message: "Type must start with \"data-\"" }),
2383
+ id: U.string().optional(),
2384
+ data: U.unknown(),
2385
+ transient: U.boolean().optional()
2387
2386
  }),
2388
- W.looseObject({ type: W.literal("start-step") }),
2389
- W.looseObject({ type: W.literal("finish-step") }),
2390
- W.looseObject({ type: W.literal("reset-step") }),
2391
- W.looseObject({
2392
- type: W.literal("start"),
2393
- messageId: W.string().optional(),
2394
- messageMetadata: W.unknown().optional()
2387
+ U.looseObject({ type: U.literal("start-step") }),
2388
+ U.looseObject({ type: U.literal("finish-step") }),
2389
+ U.looseObject({ type: U.literal("reset-step") }),
2390
+ U.looseObject({
2391
+ type: U.literal("start"),
2392
+ messageId: U.string().optional(),
2393
+ messageMetadata: U.unknown().optional()
2395
2394
  }),
2396
- W.looseObject({
2397
- type: W.literal("finish"),
2398
- finishReason: W.enum([
2395
+ U.looseObject({
2396
+ type: U.literal("finish"),
2397
+ finishReason: U.enum([
2399
2398
  "stop",
2400
2399
  "length",
2401
2400
  "content-filter",
@@ -2403,44 +2402,44 @@ var ha = W.record(W.string(), Ii.optional()), ga = Xr(() => ai(W.union([
2403
2402
  "error",
2404
2403
  "other"
2405
2404
  ]).optional(),
2406
- messageMetadata: W.unknown().optional()
2405
+ messageMetadata: U.unknown().optional()
2407
2406
  }),
2408
- W.looseObject({
2409
- type: W.literal("abort"),
2410
- reason: W.string().optional()
2407
+ U.looseObject({
2408
+ type: U.literal("abort"),
2409
+ reason: U.string().optional()
2411
2410
  }),
2412
- W.looseObject({
2413
- type: W.literal("message-metadata"),
2414
- messageMetadata: W.unknown()
2411
+ U.looseObject({
2412
+ type: U.literal("message-metadata"),
2413
+ messageMetadata: U.unknown()
2415
2414
  })
2416
2415
  ])));
2417
- function _a(e) {
2416
+ function va(e) {
2418
2417
  return e.type.startsWith("data-");
2419
2418
  }
2420
- function va() {
2419
+ function ya() {
2421
2420
  return /* @__PURE__ */ Object.create(null);
2422
2421
  }
2423
- function ya(e) {
2422
+ function ba(e) {
2424
2423
  return e.type.startsWith("tool-");
2425
2424
  }
2426
- function ba(e) {
2425
+ function xa(e) {
2427
2426
  return e.type === "dynamic-tool";
2428
2427
  }
2429
- function K(e) {
2430
- return ya(e) || ba(e);
2428
+ function G(e) {
2429
+ return ba(e) || xa(e);
2431
2430
  }
2432
- function xa(e) {
2431
+ function Sa(e) {
2433
2432
  return e.type.split("-").slice(1).join("-");
2434
2433
  }
2435
- var Sa = {
2434
+ var Ca = {
2436
2435
  type: "deprecated",
2437
2436
  setting: "rawInput in output-error UI message parts",
2438
2437
  message: "Use the \"input\" field instead. The \"rawInput\" field will be removed in the next major version."
2439
2438
  };
2440
- function Ca(e) {
2441
- e.some((e) => e.parts.some((e) => typeof e == "object" && !!e && "type" in e && typeof e.type == "string" && (e.type === "dynamic-tool" || e.type.startsWith("tool-")) && "state" in e && e.state === "output-error" && Object.prototype.hasOwnProperty.call(e, "rawInput") && "rawInput" in e && e.rawInput !== void 0)) && Pi({ warnings: [Sa] });
2439
+ function wa(e) {
2440
+ e.some((e) => e.parts.some((e) => typeof e == "object" && !!e && "type" in e && typeof e.type == "string" && (e.type === "dynamic-tool" || e.type.startsWith("tool-")) && "state" in e && e.state === "output-error" && Object.prototype.hasOwnProperty.call(e, "rawInput") && "rawInput" in e && e.rawInput !== void 0)) && Fi({ warnings: [Ca] });
2442
2441
  }
2443
- function wa({ lastMessage: e, messageId: t }) {
2442
+ function Ta({ lastMessage: e, messageId: t }) {
2444
2443
  return {
2445
2444
  message: e?.role === "assistant" ? e : {
2446
2445
  id: t,
@@ -2448,12 +2447,12 @@ function wa({ lastMessage: e, messageId: t }) {
2448
2447
  role: "assistant",
2449
2448
  parts: []
2450
2449
  },
2451
- activeTextParts: va(),
2452
- activeReasoningParts: va(),
2453
- partialToolCalls: va()
2450
+ activeTextParts: ya(),
2451
+ activeReasoningParts: ya(),
2452
+ partialToolCalls: ya()
2454
2453
  };
2455
2454
  }
2456
- function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdateMessageJob: r, onError: i, onToolCall: a, onData: o }) {
2455
+ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdateMessageJob: r, onError: i, onToolCall: a, onData: o }) {
2457
2456
  return e.pipeThrough(new TransformStream({ async transform(e, s) {
2458
2457
  await r(async ({ state: r, write: c }) => {
2459
2458
  function l() {
@@ -2462,7 +2461,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2462
2461
  return e.slice(t + 1);
2463
2462
  }
2464
2463
  function u() {
2465
- return l().filter(K);
2464
+ return l().filter(G);
2466
2465
  }
2467
2466
  function d(e) {
2468
2467
  let t = u().find((t) => t.toolCallId === e);
@@ -2470,13 +2469,13 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2470
2469
  let n = r.message.parts;
2471
2470
  for (let r = n.length - 1; r >= 0; r--) {
2472
2471
  let i = n[r];
2473
- if (K(i) && i.toolCallId === e) {
2472
+ if (G(i) && i.toolCallId === e) {
2474
2473
  t = i;
2475
2474
  break;
2476
2475
  }
2477
2476
  }
2478
2477
  }
2479
- if (t == null) throw new ki({
2478
+ if (t == null) throw new Ai({
2480
2479
  chunkType: "tool-invocation",
2481
2480
  chunkId: e,
2482
2481
  message: `No tool invocation found for tool call ID "${e}".`
@@ -2484,8 +2483,8 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2484
2483
  return t;
2485
2484
  }
2486
2485
  function f(e) {
2487
- let t = r.message.parts.filter(K).find((t) => t.approval?.id === e);
2488
- if (t == null) throw new ki({
2486
+ let t = r.message.parts.filter(G).find((t) => t.approval?.id === e);
2487
+ if (t == null) throw new Ai({
2489
2488
  chunkType: "tool-approval-response",
2490
2489
  chunkId: e,
2491
2490
  message: `No tool invocation found for approval ID "${e}".`
@@ -2493,7 +2492,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2493
2492
  return t;
2494
2493
  }
2495
2494
  function p(e, t) {
2496
- let n = t ?? l().find((t) => ya(t) && t.toolCallId === e.toolCallId), i = e, a = n;
2495
+ let n = t ?? l().find((t) => ba(t) && t.toolCallId === e.toolCallId), i = e, a = n;
2497
2496
  if (n != null) {
2498
2497
  n.state = e.state, a.input = i.input, a.output = i.output, a.errorText = i.errorText, a.rawInput = i.rawInput, a.preliminary = i.preliminary, e.title !== void 0 && (a.title = e.title), e.toolMetadata !== void 0 && (a.toolMetadata = e.toolMetadata), a.providerExecuted = i.providerExecuted ?? n.providerExecuted;
2499
2498
  let t = i.providerMetadata;
@@ -2548,8 +2547,8 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2548
2547
  }
2549
2548
  async function h(e) {
2550
2549
  if (e != null) {
2551
- let n = r.message.metadata == null ? e : Fi(r.message.metadata, e);
2552
- t != null && await oi({
2550
+ let n = r.message.metadata == null ? e : Ii(r.message.metadata, e);
2551
+ t != null && await ci({
2553
2552
  value: n,
2554
2553
  schema: t,
2555
2554
  context: {
@@ -2572,7 +2571,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2572
2571
  }
2573
2572
  case "text-delta": {
2574
2573
  let t = r.activeTextParts[e.id];
2575
- if (t == null) throw new ki({
2574
+ if (t == null) throw new Ai({
2576
2575
  chunkType: "text-delta",
2577
2576
  chunkId: e.id,
2578
2577
  message: `Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`
@@ -2582,7 +2581,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2582
2581
  }
2583
2582
  case "text-end": {
2584
2583
  let t = r.activeTextParts[e.id];
2585
- if (t == null) throw new ki({
2584
+ if (t == null) throw new Ai({
2586
2585
  chunkType: "text-end",
2587
2586
  chunkId: e.id,
2588
2587
  message: `Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`
@@ -2612,7 +2611,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2612
2611
  }
2613
2612
  case "reasoning-delta": {
2614
2613
  let t = r.activeReasoningParts[e.id];
2615
- if (t == null) throw new ki({
2614
+ if (t == null) throw new Ai({
2616
2615
  chunkType: "reasoning-delta",
2617
2616
  chunkId: e.id,
2618
2617
  message: `Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`
@@ -2622,7 +2621,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2622
2621
  }
2623
2622
  case "reasoning-end": {
2624
2623
  let t = r.activeReasoningParts[e.id];
2625
- if (t == null) throw new ki({
2624
+ if (t == null) throw new Ai({
2626
2625
  chunkType: "reasoning-end",
2627
2626
  chunkId: e.id,
2628
2627
  message: `Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`
@@ -2659,7 +2658,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2659
2658
  }), c();
2660
2659
  break;
2661
2660
  case "tool-input-start": {
2662
- let t = l().filter(ya);
2661
+ let t = l().filter(ba);
2663
2662
  r.partialToolCalls[e.toolCallId] = {
2664
2663
  text: "",
2665
2664
  toolName: e.toolName,
@@ -2690,13 +2689,13 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2690
2689
  }
2691
2690
  case "tool-input-delta": {
2692
2691
  let t = r.partialToolCalls[e.toolCallId];
2693
- if (t == null) throw new ki({
2692
+ if (t == null) throw new Ai({
2694
2693
  chunkType: "tool-input-delta",
2695
2694
  chunkId: e.toolCallId,
2696
2695
  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.`
2697
2696
  });
2698
2697
  t.text += e.inputTextDelta;
2699
- let { value: n } = await ra(t.text);
2698
+ let { value: n } = await ia(t.text);
2700
2699
  t.dynamic ? m({
2701
2700
  toolCallId: e.toolCallId,
2702
2701
  toolName: t.toolName,
@@ -2736,7 +2735,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2736
2735
  }), c(), a && !e.providerExecuted && await a({ toolCall: e });
2737
2736
  break;
2738
2737
  case "tool-input-error": {
2739
- let t = l().filter(K).find((t) => t.toolCallId === e.toolCallId);
2738
+ let t = l().filter(G).find((t) => t.toolCallId === e.toolCallId);
2740
2739
  (t == null ? e.dynamic : t.type === "dynamic-tool") ? m({
2741
2740
  toolCallId: e.toolCallId,
2742
2741
  toolName: e.toolName,
@@ -2756,7 +2755,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2756
2755
  providerExecuted: e.providerExecuted,
2757
2756
  providerMetadata: e.providerMetadata,
2758
2757
  toolMetadata: e.toolMetadata
2759
- }), Ca([r.message])), c();
2758
+ }), wa([r.message])), c();
2760
2759
  break;
2761
2760
  }
2762
2761
  case "tool-approval-request": {
@@ -2800,7 +2799,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2800
2799
  toolMetadata: t.toolMetadata
2801
2800
  }, t) : p({
2802
2801
  toolCallId: e.toolCallId,
2803
- toolName: xa(t),
2802
+ toolName: Sa(t),
2804
2803
  state: "output-available",
2805
2804
  input: t.input,
2806
2805
  output: e.output,
@@ -2826,7 +2825,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2826
2825
  toolMetadata: t.toolMetadata
2827
2826
  }, t) : p({
2828
2827
  toolCallId: e.toolCallId,
2829
- toolName: xa(t),
2828
+ toolName: Sa(t),
2830
2829
  state: "output-error",
2831
2830
  input: t.input,
2832
2831
  rawInput: t.rawInput,
@@ -2844,7 +2843,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2844
2843
  case "finish-step": break;
2845
2844
  case "reset-step": {
2846
2845
  let e = l();
2847
- r.activeTextParts = va(), r.activeReasoningParts = va(), r.partialToolCalls = va(), e.length > 0 && (r.message.parts.splice(r.message.parts.length - e.length, e.length), c());
2846
+ r.activeTextParts = ya(), r.activeReasoningParts = ya(), r.partialToolCalls = ya(), e.length > 0 && (r.message.parts.splice(r.message.parts.length - e.length, e.length), c());
2848
2847
  break;
2849
2848
  }
2850
2849
  case "start":
@@ -2859,10 +2858,10 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2859
2858
  case "error":
2860
2859
  i?.(Error(e.errorText));
2861
2860
  break;
2862
- default: if (_a(e)) {
2861
+ default: if (va(e)) {
2863
2862
  if (n?.[e.type] != null) {
2864
2863
  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;
2865
- await oi({
2864
+ await ci({
2866
2865
  value: e.data,
2867
2866
  schema: n[e.type],
2868
2867
  context: {
@@ -2885,7 +2884,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2885
2884
  });
2886
2885
  } }));
2887
2886
  }
2888
- async function Ea({ stream: e, onError: t, abortSignal: n }) {
2887
+ async function Da({ stream: e, onError: t, abortSignal: n }) {
2889
2888
  let r = e.getReader(), i = () => {
2890
2889
  r.cancel().catch(() => {});
2891
2890
  };
@@ -2901,29 +2900,29 @@ async function Ea({ stream: e, onError: t, abortSignal: n }) {
2901
2900
  n?.removeEventListener("abort", i), r.releaseLock();
2902
2901
  }
2903
2902
  }
2904
- I({
2903
+ F({
2905
2904
  prefix: "aitxt",
2906
2905
  size: 24
2907
- }), I({
2906
+ }), F({
2908
2907
  prefix: "call",
2909
2908
  size: 24
2910
- }), I({
2909
+ }), F({
2911
2910
  prefix: "aitxt",
2912
2911
  size: 24
2913
- }), I({
2912
+ }), F({
2914
2913
  prefix: "call",
2915
2914
  size: 24
2916
- }), W.record(W.string(), Ii.optional()), W.record(W.string(), W.string()), I({
2915
+ }), U.record(U.string(), Li.optional()), U.record(U.string(), U.string()), F({
2917
2916
  prefix: "call",
2918
2917
  size: 24
2919
- }), I({
2918
+ }), F({
2920
2919
  prefix: "call",
2921
2920
  size: 24
2922
- }), new TextEncoder(), I({
2921
+ }), new TextEncoder(), F({
2923
2922
  prefix: "aiobj",
2924
2923
  size: 24
2925
2924
  });
2926
- var { atob: Da } = globalThis, Oa = class {
2925
+ var { atob: Oa } = globalThis, ka = class {
2927
2926
  constructor() {
2928
2927
  this.queue = [], this.isProcessing = !1;
2929
2928
  }
@@ -2945,12 +2944,12 @@ var { atob: Da } = globalThis, Oa = class {
2945
2944
  });
2946
2945
  }
2947
2946
  };
2948
- I({
2947
+ F({
2949
2948
  prefix: "aiobj",
2950
2949
  size: 24
2951
- }), W.object({
2952
- token: W.string().refine((e) => e.trim().length > 0),
2953
- url: W.string().refine((e) => {
2950
+ }), U.object({
2951
+ token: U.string().refine((e) => e.trim().length > 0),
2952
+ url: U.string().refine((e) => {
2954
2953
  try {
2955
2954
  let t = new URL(e);
2956
2955
  return (t.protocol === "ws:" || t.protocol === "wss:") && t.hostname !== "";
@@ -2958,20 +2957,20 @@ I({
2958
2957
  return !1;
2959
2958
  }
2960
2959
  }),
2961
- expiresAt: W.number().positive().max(2 ** 53 - 1).optional(),
2962
- tools: W.array(W.object({
2963
- type: W.literal("function"),
2964
- name: W.string().min(1),
2965
- description: W.string().optional(),
2966
- parameters: W.record(W.string(), W.unknown())
2960
+ expiresAt: U.number().positive().max(2 ** 53 - 1).optional(),
2961
+ tools: U.array(U.object({
2962
+ type: U.literal("function"),
2963
+ name: U.string().min(1),
2964
+ description: U.string().optional(),
2965
+ parameters: U.record(U.string(), U.unknown())
2967
2966
  })).optional()
2968
- }), I({
2967
+ }), F({
2969
2968
  prefix: "call",
2970
2969
  size: 24
2971
2970
  });
2972
- async function ka({ response: e, url: t, fallbackMessage: n }) {
2971
+ async function Aa({ response: e, url: t, fallbackMessage: n }) {
2973
2972
  let r = await e.text();
2974
- return new nn({
2973
+ return new rn({
2975
2974
  message: r || n,
2976
2975
  url: t,
2977
2976
  requestBodyValues: void 0,
@@ -2979,9 +2978,9 @@ async function ka({ response: e, url: t, fallbackMessage: n }) {
2979
2978
  responseBody: r
2980
2979
  });
2981
2980
  }
2982
- async function Aa(e) {
2981
+ async function ja(e) {
2983
2982
  if (e == null) return [];
2984
- if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new Nn({
2983
+ if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new Pn({
2985
2984
  functionality: "FileList",
2986
2985
  message: "FileList is not supported in the current environment"
2987
2986
  });
@@ -3000,18 +2999,18 @@ async function Aa(e) {
3000
2999
  };
3001
3000
  }));
3002
3001
  }
3003
- function ja(e, t) {
3002
+ function Ma(e, t) {
3004
3003
  let n = e.search(/[?#]/);
3005
3004
  return n === -1 ? `${e}${t}` : `${e.slice(0, n)}${t}${e.slice(n)}`;
3006
3005
  }
3007
- var Ma = class {
3006
+ var Na = class {
3008
3007
  constructor({ api: e = "/api/chat", credentials: t, headers: n, body: r, fetch: i, prepareSendMessagesRequest: a, prepareReconnectToStreamRequest: o }) {
3009
3008
  this.api = e, this.credentials = t, this.headers = n, this.body = r, this.fetch = i, this.prepareSendMessagesRequest = a, this.prepareReconnectToStreamRequest = o;
3010
3009
  }
3011
3010
  async sendMessages({ abortSignal: e, ...t }) {
3012
- let n = await ui(this.body), r = await ui(this.headers), i = await ui(this.credentials), a = {
3013
- ...Gn(r),
3014
- ...Gn(t.headers)
3011
+ let n = await V(this.body), r = await V(this.headers), i = await V(this.credentials), a = {
3012
+ ...Kn(r),
3013
+ ...Kn(t.headers)
3015
3014
  }, o = await this.prepareSendMessagesRequest?.call(this, {
3016
3015
  api: this.api,
3017
3016
  id: t.chatId,
@@ -3025,7 +3024,7 @@ var Ma = class {
3025
3024
  requestMetadata: t.metadata,
3026
3025
  trigger: t.trigger,
3027
3026
  messageId: t.messageId
3028
- }), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : Gn(o.headers), l = o?.body === void 0 ? {
3027
+ }), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : Kn(o.headers), l = o?.body === void 0 ? {
3029
3028
  ...n,
3030
3029
  ...t.body,
3031
3030
  id: t.chatId,
@@ -3042,18 +3041,18 @@ var Ma = class {
3042
3041
  credentials: u,
3043
3042
  signal: e
3044
3043
  });
3045
- if (!d.ok) throw await ka({
3044
+ if (!d.ok) throw await Aa({
3046
3045
  response: d,
3047
3046
  url: s,
3048
3047
  fallbackMessage: "Failed to fetch the chat response."
3049
3048
  });
3050
- if (!d.body) throw new ln({ message: "The response body is empty." });
3049
+ if (!d.body) throw new un({ message: "The response body is empty." });
3051
3050
  return this.processResponseStream(d.body);
3052
3051
  }
3053
3052
  async reconnectToStream(e) {
3054
- let t = await ui(this.body), n = await ui(this.headers), r = await ui(this.credentials), i = {
3055
- ...Gn(n),
3056
- ...Gn(e.headers)
3053
+ let t = await V(this.body), n = await V(this.headers), r = await V(this.credentials), i = {
3054
+ ...Kn(n),
3055
+ ...Kn(e.headers)
3057
3056
  }, a = await this.prepareReconnectToStreamRequest?.call(this, {
3058
3057
  api: this.api,
3059
3058
  id: e.chatId,
@@ -3064,37 +3063,37 @@ var Ma = class {
3064
3063
  headers: i,
3065
3064
  credentials: r,
3066
3065
  requestMetadata: e.metadata
3067
- }), o = a?.api ?? ja(this.api, `/${e.chatId}/stream`), s = a?.headers === void 0 ? i : Gn(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
3066
+ }), o = a?.api ?? Ma(this.api, `/${e.chatId}/stream`), s = a?.headers === void 0 ? i : Kn(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
3068
3067
  method: "GET",
3069
3068
  headers: s,
3070
3069
  credentials: c,
3071
3070
  signal: e.abortSignal
3072
3071
  });
3073
3072
  if (l.status === 204) return null;
3074
- if (!l.ok) throw await ka({
3073
+ if (!l.ok) throw await Aa({
3075
3074
  response: l,
3076
3075
  url: o,
3077
3076
  fallbackMessage: "Failed to fetch the chat response."
3078
3077
  });
3079
- if (!l.body) throw new ln({ message: "The response body is empty." });
3078
+ if (!l.body) throw new un({ message: "The response body is empty." });
3080
3079
  return this.processResponseStream(l.body);
3081
3080
  }
3082
- }, Na = class extends Ma {
3081
+ }, Pa = class extends Na {
3083
3082
  constructor(e = {}) {
3084
3083
  super(e);
3085
3084
  }
3086
3085
  processResponseStream(e) {
3087
- return li({
3086
+ return di({
3088
3087
  stream: e,
3089
- schema: ga
3088
+ schema: _a
3090
3089
  }).pipeThrough(new TransformStream({ async transform(e, t) {
3091
3090
  if (!e.success) throw e.error;
3092
3091
  t.enqueue(e.value);
3093
3092
  } }));
3094
3093
  }
3095
- }, Pa = class {
3096
- constructor({ generateId: e = Kn, id: t = e(), transport: n = new Na(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
3097
- this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new Oa(), this.sendMessage = async (e, t) => {
3094
+ }, Fa = class {
3095
+ constructor({ generateId: e = qn, id: t = e(), transport: n = new Pa(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
3096
+ this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new ka(), this.sendMessage = async (e, t) => {
3098
3097
  if (e == null) {
3099
3098
  await this.makeRequest({
3100
3099
  trigger: "submit-message",
@@ -3109,7 +3108,7 @@ var Ma = class {
3109
3108
  this.pendingMessagePreparations.add(t);
3110
3109
  let r;
3111
3110
  try {
3112
- r = Array.isArray(e.files) ? e.files : await Aa(e.files);
3111
+ r = Array.isArray(e.files) ? e.files : await ja(e.files);
3113
3112
  } finally {
3114
3113
  this.pendingMessagePreparations.delete(t);
3115
3114
  }
@@ -3121,12 +3120,12 @@ var Ma = class {
3121
3120
  } else n = e;
3122
3121
  if (e.messageId != null) {
3123
3122
  let t = this.state.messages.findIndex((t) => t.id === e.messageId);
3124
- if (t === -1) throw new vi({
3123
+ if (t === -1) throw new yi({
3125
3124
  parameter: "message.messageId",
3126
3125
  value: e.messageId,
3127
3126
  message: `message with id ${e.messageId} not found`
3128
3127
  });
3129
- if (this.state.messages[t].role !== "user") throw new vi({
3128
+ if (this.state.messages[t].role !== "user") throw new yi({
3130
3129
  parameter: "message.messageId",
3131
3130
  value: e.messageId,
3132
3131
  message: `message with id ${e.messageId} is not a user message`
@@ -3150,7 +3149,7 @@ var Ma = class {
3150
3149
  });
3151
3150
  }, this.regenerate = async ({ messageId: e, ...t } = {}) => {
3152
3151
  let n = e == null ? this.state.messages.length - 1 : this.state.messages.findIndex((t) => t.id === e);
3153
- if (n === -1) throw new vi({
3152
+ if (n === -1) throw new yi({
3154
3153
  parameter: "messageId",
3155
3154
  value: e,
3156
3155
  message: `message ${e} not found`
@@ -3168,7 +3167,7 @@ var Ma = class {
3168
3167
  }, this.clearError = () => {
3169
3168
  this.status === "error" && (this.state.error = void 0, this.setStatus({ status: "ready" }));
3170
3169
  }, this.addToolApprovalResponse = async ({ id: e, approved: t, reason: n, options: r }) => this.jobExecutor.run(async () => {
3171
- let i = this.state.messages, a = i[i.length - 1], o = (r) => K(r) && r.state === "approval-requested" && r.approval.id === e ? {
3170
+ let i = this.state.messages, a = i[i.length - 1], o = (r) => G(r) && r.state === "approval-requested" && r.approval.id === e ? {
3172
3171
  ...r,
3173
3172
  state: "approval-responded",
3174
3173
  approval: {
@@ -3189,7 +3188,7 @@ var Ma = class {
3189
3188
  });
3190
3189
  });
3191
3190
  }), this.addToolOutput = async ({ state: e = "output-available", toolCallId: t, output: n, errorText: r, options: i }) => this.jobExecutor.run(async () => {
3192
- let a = this.state.messages, o = a[a.length - 1], s = (i) => K(i) && i.toolCallId === t ? {
3191
+ let a = this.state.messages, o = a[a.length - 1], s = (i) => G(i) && i.toolCallId === t ? {
3193
3192
  ...i,
3194
3193
  state: e,
3195
3194
  output: n,
@@ -3277,7 +3276,7 @@ var Ma = class {
3277
3276
  let f = this.lastMessage, p = !1, m = !1, h = !1, g;
3278
3277
  try {
3279
3278
  let a = {
3280
- state: wa({
3279
+ state: Ta({
3281
3280
  lastMessage: e === "resume-stream" || e === "regenerate-message" ? void 0 : this.state.snapshot(f),
3282
3281
  messageId: this.generateId()
3283
3282
  }),
@@ -3296,8 +3295,8 @@ var Ma = class {
3296
3295
  body: r,
3297
3296
  trigger: e,
3298
3297
  messageId: i
3299
- }), await Ea({
3300
- stream: Ta({
3298
+ }), await Da({
3299
+ stream: Ea({
3301
3300
  stream: o,
3302
3301
  onToolCall: this.onToolCall,
3303
3302
  onData: this.onData,
@@ -3349,21 +3348,21 @@ var Ma = class {
3349
3348
  });
3350
3349
  }
3351
3350
  };
3352
- function Fa({ messages: e }) {
3351
+ function Ia({ messages: e }) {
3353
3352
  let t = e[e.length - 1];
3354
3353
  if (!t || t.role !== "assistant") return !1;
3355
- let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(K);
3354
+ let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(G);
3356
3355
  return r.filter((e) => e.state === "approval-responded").length > 0 && r.every((e) => e.state === "output-available" && e.preliminary !== !0 || e.state === "output-error" || e.state === "output-denied" || e.state === "approval-responded");
3357
3356
  }
3358
- function Ia({ messages: e }) {
3357
+ function La({ messages: e }) {
3359
3358
  let t = e[e.length - 1];
3360
3359
  if (!t || t.role !== "assistant") return !1;
3361
- let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(K).filter((e) => !e.providerExecuted);
3360
+ let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(G).filter((e) => !e.providerExecuted);
3362
3361
  return r.length > 0 && r.every((e) => e.state === "output-available" && e.preliminary !== !0 || e.state === "output-error");
3363
3362
  }
3364
3363
  //#endregion
3365
3364
  //#region ../node_modules/.pnpm/throttleit@2.1.0/node_modules/throttleit/index.js
3366
- var La = /* @__PURE__ */ t(((e, t) => {
3365
+ var Ra = /* @__PURE__ */ t(((e, t) => {
3367
3366
  function n(e, t) {
3368
3367
  if (typeof e != "function") throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);
3369
3368
  let n, r = 0;
@@ -3376,30 +3375,30 @@ var La = /* @__PURE__ */ t(((e, t) => {
3376
3375
  };
3377
3376
  }
3378
3377
  t.exports = n;
3379
- })), q = /* @__PURE__ */ e(o(), 1), Ra = /* @__PURE__ */ e(La(), 1), J = He(), za = (e, t, n) => {
3378
+ })), K = /* @__PURE__ */ e(o(), 1), za = /* @__PURE__ */ e(Ra(), 1), q = Ke(), Ba = (e, t, n) => {
3380
3379
  if (!t.has(e)) throw TypeError("Cannot " + n);
3381
- }, Y = (e, t, n) => (za(e, t, "read from private field"), n ? n.call(e) : t.get(e)), X = (e, t, n) => {
3380
+ }, J = (e, t, n) => (Ba(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Y = (e, t, n) => {
3382
3381
  if (t.has(e)) throw TypeError("Cannot add the same private member more than once");
3383
3382
  t instanceof WeakSet ? t.add(e) : t.set(e, n);
3384
- }, Ba = (e, t, n, r) => (za(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);
3383
+ }, X = (e, t, n, r) => (Ba(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);
3385
3384
  function Va(e, t) {
3386
- return t == null ? e : (0, Ra.default)(e, t);
3385
+ return t == null ? e : (0, za.default)(e, t);
3387
3386
  }
3388
3387
  function Ha(e) {
3389
3388
  return Array.isArray(e) ? [...e] : typeof e == "object" && e && (Object.getPrototypeOf(e) === Object.prototype || Object.getPrototypeOf(e) === null) ? { ...e } : e;
3390
3389
  }
3391
3390
  var Z, Ua, Wa, Ga, Ka, qa, Ja, Ya, Xa, Za = class {
3392
3391
  constructor(e = []) {
3393
- X(this, Z, void 0), X(this, Ua, "ready"), X(this, Wa, void 0), X(this, Ga, /* @__PURE__ */ new Set()), X(this, Ka, /* @__PURE__ */ new Set()), X(this, qa, /* @__PURE__ */ new Set()), this.pushMessage = (e) => {
3394
- Ba(this, Z, Y(this, Z).concat(e)), Y(this, Ja).call(this);
3392
+ Y(this, Z, void 0), Y(this, Ua, "ready"), Y(this, Wa, void 0), Y(this, Ga, /* @__PURE__ */ new Set()), Y(this, Ka, /* @__PURE__ */ new Set()), Y(this, qa, /* @__PURE__ */ new Set()), this.pushMessage = (e) => {
3393
+ X(this, Z, J(this, Z).concat(e)), J(this, Ja).call(this);
3395
3394
  }, this.popMessage = () => {
3396
- Ba(this, Z, Y(this, Z).slice(0, -1)), Y(this, Ja).call(this);
3395
+ X(this, Z, J(this, Z).slice(0, -1)), J(this, Ja).call(this);
3397
3396
  }, this.replaceMessage = (e, t) => {
3398
- Ba(this, Z, [
3399
- ...Y(this, Z).slice(0, e),
3397
+ X(this, Z, [
3398
+ ...J(this, Z).slice(0, e),
3400
3399
  this.snapshot(t),
3401
- ...Y(this, Z).slice(e + 1)
3402
- ]), Y(this, Ja).call(this);
3400
+ ...J(this, Z).slice(e + 1)
3401
+ ]), J(this, Ja).call(this);
3403
3402
  }, this.snapshot = (e) => {
3404
3403
  if (typeof e != "object" || !e || !("parts" in e) || !Array.isArray(e.parts)) return e;
3405
3404
  let t = e, n = {
@@ -3409,53 +3408,53 @@ var Z, Ua, Wa, Ga, Ka, qa, Ja, Ya, Xa, Za = class {
3409
3408
  return "metadata" in t && (n.metadata = Ha(t.metadata)), n;
3410
3409
  }, this["~registerMessagesCallback"] = (e, t) => {
3411
3410
  let n = t ? Va(e, t) : e;
3412
- return Y(this, Ga).add(n), () => {
3413
- Y(this, Ga).delete(n);
3411
+ return J(this, Ga).add(n), () => {
3412
+ J(this, Ga).delete(n);
3414
3413
  };
3415
- }, this["~registerStatusCallback"] = (e) => (Y(this, Ka).add(e), () => {
3416
- Y(this, Ka).delete(e);
3417
- }), this["~registerErrorCallback"] = (e) => (Y(this, qa).add(e), () => {
3418
- Y(this, qa).delete(e);
3419
- }), X(this, Ja, () => {
3420
- Y(this, Ga).forEach((e) => e());
3421
- }), X(this, Ya, () => {
3422
- Y(this, Ka).forEach((e) => e());
3423
- }), X(this, Xa, () => {
3424
- Y(this, qa).forEach((e) => e());
3425
- }), Ba(this, Z, e);
3414
+ }, this["~registerStatusCallback"] = (e) => (J(this, Ka).add(e), () => {
3415
+ J(this, Ka).delete(e);
3416
+ }), this["~registerErrorCallback"] = (e) => (J(this, qa).add(e), () => {
3417
+ J(this, qa).delete(e);
3418
+ }), Y(this, Ja, () => {
3419
+ J(this, Ga).forEach((e) => e());
3420
+ }), Y(this, Ya, () => {
3421
+ J(this, Ka).forEach((e) => e());
3422
+ }), Y(this, Xa, () => {
3423
+ J(this, qa).forEach((e) => e());
3424
+ }), X(this, Z, e);
3426
3425
  }
3427
3426
  get status() {
3428
- return Y(this, Ua);
3427
+ return J(this, Ua);
3429
3428
  }
3430
3429
  set status(e) {
3431
- Ba(this, Ua, e), Y(this, Ya).call(this);
3430
+ X(this, Ua, e), J(this, Ya).call(this);
3432
3431
  }
3433
3432
  get error() {
3434
- return Y(this, Wa);
3433
+ return J(this, Wa);
3435
3434
  }
3436
3435
  set error(e) {
3437
- Ba(this, Wa, e), Y(this, Xa).call(this);
3436
+ X(this, Wa, e), J(this, Xa).call(this);
3438
3437
  }
3439
3438
  get messages() {
3440
- return Y(this, Z);
3439
+ return J(this, Z);
3441
3440
  }
3442
3441
  set messages(e) {
3443
- Ba(this, Z, [...e]), Y(this, Ja).call(this);
3442
+ X(this, Z, [...e]), J(this, Ja).call(this);
3444
3443
  }
3445
3444
  };
3446
3445
  Z = /* @__PURE__ */ new WeakMap(), Ua = /* @__PURE__ */ new WeakMap(), Wa = /* @__PURE__ */ new WeakMap(), Ga = /* @__PURE__ */ new WeakMap(), Ka = /* @__PURE__ */ new WeakMap(), qa = /* @__PURE__ */ new WeakMap(), Ja = /* @__PURE__ */ new WeakMap(), Ya = /* @__PURE__ */ new WeakMap(), Xa = /* @__PURE__ */ new WeakMap();
3447
- var Qa, $a = class extends Pa {
3446
+ var Qa, $a = class extends Fa {
3448
3447
  constructor({ messages: e, ...t }) {
3449
3448
  let n = new Za(e);
3450
3449
  super({
3451
3450
  ...t,
3452
3451
  state: n
3453
- }), X(this, Qa, void 0), this["~registerMessagesCallback"] = (e, t) => Y(this, Qa)["~registerMessagesCallback"](e, t), this["~registerStatusCallback"] = (e) => Y(this, Qa)["~registerStatusCallback"](e), this["~registerErrorCallback"] = (e) => Y(this, Qa)["~registerErrorCallback"](e), Ba(this, Qa, n);
3452
+ }), Y(this, Qa, void 0), this["~registerMessagesCallback"] = (e, t) => J(this, Qa)["~registerMessagesCallback"](e, t), this["~registerStatusCallback"] = (e) => J(this, Qa)["~registerStatusCallback"](e), this["~registerErrorCallback"] = (e) => J(this, Qa)["~registerErrorCallback"](e), X(this, Qa, n);
3454
3453
  }
3455
3454
  };
3456
3455
  Qa = /* @__PURE__ */ new WeakMap();
3457
3456
  function eo({ throttle: e, experimental_throttle: t, resume: n = !1, ...r } = {}) {
3458
- let i = e ?? t, a = (0, q.useRef)({});
3457
+ let i = e ?? t, a = (0, K.useRef)({});
3459
3458
  "chat" in r || (a.current = {
3460
3459
  onToolCall: r.onToolCall,
3461
3460
  onData: r.onData,
@@ -3464,7 +3463,7 @@ function eo({ throttle: e, experimental_throttle: t, resume: n = !1, ...r } = {}
3464
3463
  sendAutomaticallyWhen: r.sendAutomaticallyWhen,
3465
3464
  transport: r.transport
3466
3465
  });
3467
- let o, s = () => a.current.transport ?? (o ??= new Na()), c = {
3466
+ let o, s = () => a.current.transport ?? (o ??= new Pa()), c = {
3468
3467
  ...r,
3469
3468
  transport: {
3470
3469
  sendMessages: (e) => s().sendMessages(e),
@@ -3490,16 +3489,16 @@ function eo({ throttle: e, experimental_throttle: t, resume: n = !1, ...r } = {}
3490
3489
  var t;
3491
3490
  return (t = a.current).sendAutomaticallyWhen?.call(t, e) ?? !1;
3492
3491
  }
3493
- }, l = "chat" in r ? r.chat : r.id, { chat: u, isExternallyManaged: d } = (0, q.useMemo)(() => ({
3492
+ }, l = "chat" in r ? r.chat : r.id, { chat: u, isExternallyManaged: d } = (0, K.useMemo)(() => ({
3494
3493
  chat: "chat" in r ? r.chat : new $a(c),
3495
3494
  isExternallyManaged: "chat" in r
3496
3495
  }), [l]);
3497
- (0, q.useEffect)(() => {
3496
+ (0, K.useEffect)(() => {
3498
3497
  if (!d) return () => {
3499
3498
  u.stop();
3500
3499
  };
3501
3500
  }, [u, d]);
3502
- let f = (0, q.useMemo)(() => ({ messages: u.messages }), [u]), p = (0, q.useCallback)((e) => {
3501
+ let f = (0, K.useMemo)(() => ({ messages: u.messages }), [u]), p = (0, K.useCallback)((e) => {
3503
3502
  let t = !0, n = u["~registerMessagesCallback"](() => {
3504
3503
  t && (f.messages = u.messages, e());
3505
3504
  }, i);
@@ -3510,12 +3509,12 @@ function eo({ throttle: e, experimental_throttle: t, resume: n = !1, ...r } = {}
3510
3509
  u,
3511
3510
  f,
3512
3511
  i
3513
- ]), m = (0, q.useCallback)(() => f.messages, [f]), h = (0, q.useSyncExternalStore)(p, m, m), g = (0, q.useCallback)((e) => u["~registerStatusCallback"](() => {
3512
+ ]), m = (0, K.useCallback)(() => f.messages, [f]), h = (0, K.useSyncExternalStore)(p, m, m), g = (0, K.useCallback)((e) => u["~registerStatusCallback"](() => {
3514
3513
  (u.status === "ready" || u.status === "error") && (f.messages = u.messages), e();
3515
- }), [u, f]), _ = (0, q.useCallback)(() => u.status, [u]), v = (0, q.useSyncExternalStore)(g, _, _), y = (0, q.useSyncExternalStore)(u["~registerErrorCallback"], () => u.error, () => u.error), b = (0, q.useCallback)((e) => {
3514
+ }), [u, f]), _ = (0, K.useCallback)(() => u.status, [u]), v = (0, K.useSyncExternalStore)(g, _, _), y = (0, K.useSyncExternalStore)(u["~registerErrorCallback"], () => u.error, () => u.error), b = (0, K.useCallback)((e) => {
3516
3515
  typeof e == "function" && (e = e(u.messages)), u.messages = e;
3517
3516
  }, [u]);
3518
- return (0, q.useEffect)(() => {
3517
+ return (0, K.useEffect)(() => {
3519
3518
  n && u.resumeStream();
3520
3519
  }, [n, u]), {
3521
3520
  id: u.id,
@@ -3654,7 +3653,7 @@ async function so(e, t, n) {
3654
3653
  let i = e.filter((e) => e.shouldDownloadImage && e.outputType === "media");
3655
3654
  if (i.length === 0) return [];
3656
3655
  let a = i.flatMap((e) => {
3657
- let i = document.getElementById(ue.create(t));
3656
+ let i = document.getElementById(de.create(t));
3658
3657
  return i ? {
3659
3658
  cellId: t,
3660
3659
  cellName: n,
@@ -3675,7 +3674,7 @@ async function so(e, t, n) {
3675
3674
  }
3676
3675
  function co(e) {
3677
3676
  if (v(e)) return null;
3678
- let t = e.mimetype, n = ao(t, String(e.data)) ? "media" : "text", r = Be(e), i, a = !1;
3677
+ let t = e.mimetype, n = ao(t, String(e.data)) ? "media" : "text", r = We(e), i, a = !1;
3679
3678
  return n === "media" && (typeof e.data == "string" && e.data.startsWith("data:") || typeof e.data == "string" && e.data.startsWith("http") ? i = e.data : a = !0), {
3680
3679
  processedContent: r,
3681
3680
  imageUrl: i,
@@ -3685,7 +3684,7 @@ function co(e) {
3685
3684
  };
3686
3685
  }
3687
3686
  function lo(e, t, n) {
3688
- let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.inOrderIds.indexOf(e), s = ce(a.name, o), c;
3687
+ let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.inOrderIds.indexOf(e), s = se(a.name, o), c;
3689
3688
  r && (c = i.consoleOutputs.map((e) => co(e)).filter((e) => e !== null));
3690
3689
  let l, u = i.output;
3691
3690
  return u && !v(u) && (l = co(u) ?? void 0), {
@@ -3700,7 +3699,7 @@ function lo(e, t, n) {
3700
3699
  //#region src/core/ai/context/providers/error.ts
3701
3700
  function uo(e, t) {
3702
3701
  let n = [`Code:\n${e.cellCode}`];
3703
- if (e.tracebackHtml && n.push(`Traceback:\n${pe(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => It(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
3702
+ if (e.tracebackHtml && n.push(`Traceback:\n${ue(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => Se(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
3704
3703
  let r = w(e.cellId, t);
3705
3704
  r && n.push(`Database schema:\n${r}`);
3706
3705
  }
@@ -3717,12 +3716,12 @@ function fo(e, t) {
3717
3716
  });
3718
3717
  }
3719
3718
  function po(e) {
3720
- return e.errorData.length === 1 ? Lt(e.errorData[0]) : e.errorData.length > 1 ? `${e.errorData.length} errors` : e.tracebackHtml ? pe(e.tracebackHtml).trim().split("\n").find((e) => e.trim())?.trim() || "traceback" : "error";
3719
+ return e.errorData.length === 1 ? Ce(e.errorData[0]) : e.errorData.length > 1 ? `${e.errorData.length} errors` : e.tracebackHtml ? ue(e.tracebackHtml).trim().split("\n").find((e) => e.trim())?.trim() || "traceback" : "error";
3721
3720
  }
3722
3721
  function mo(e) {
3723
3722
  return `Error: ${e.cellName || `Cell ${e.cellId}`}`;
3724
3723
  }
3725
- var ho = new xe("error", "errors"), go = class extends T {
3724
+ var ho = new _e("error", "errors"), go = class extends T {
3726
3725
  title = "Errors";
3727
3726
  mentionPrefix = "@";
3728
3727
  contextType = "error";
@@ -3731,7 +3730,7 @@ var ho = new xe("error", "errors"), go = class extends T {
3731
3730
  super(), this.store = e;
3732
3731
  }
3733
3732
  getItems() {
3734
- let e = Ft(this.store);
3733
+ let e = ve(this.store);
3735
3734
  if (e.length === 0) return [];
3736
3735
  let t = [{
3737
3736
  uri: this.asURI("all"),
@@ -3796,7 +3795,7 @@ var ho = new xe("error", "errors"), go = class extends T {
3796
3795
  formatContext(e) {
3797
3796
  return (e.data.type === "all-errors" ? e.data.errors : [e.data.error]).map((e) => fo(e, this.store)).join("\n\n");
3798
3797
  }
3799
- }, _o = se(), vo = {
3798
+ }, _o = oe(), vo = {
3800
3799
  maxDepth: 3,
3801
3800
  maxResults: 20,
3802
3801
  defaultResultsLimit: 5,
@@ -3918,7 +3917,7 @@ var ho = new xe("error", "errors"), go = class extends T {
3918
3917
  description: e.message
3919
3918
  }), null));
3920
3919
  if (!l) return;
3921
- let u = l.mimeType || "text/plain", d = Ve({
3920
+ let u = l.mimeType || "text/plain", d = Ge({
3922
3921
  contents: l.contents ?? "",
3923
3922
  mimeType: u,
3924
3923
  isBase64: l.isBase64 ?? !1
@@ -3927,7 +3926,7 @@ var ho = new xe("error", "errors"), go = class extends T {
3927
3926
  from: a,
3928
3927
  to: o,
3929
3928
  insert: ""
3930
- } }), kt(e);
3929
+ } }), Nt(e);
3931
3930
  },
3932
3931
  info: () => {
3933
3932
  let e = document.createElement("div");
@@ -3997,10 +3996,10 @@ var ho = new xe("error", "errors"), go = class extends T {
3997
3996
  displayLabel: t,
3998
3997
  detail: n.source === "memory" ? "in-memory" : n.source,
3999
3998
  boost: n.source_type === "local" ? b.LOCAL_TABLE : b.REMOTE_TABLE,
4000
- type: Ce(n),
3999
+ type: De(n),
4001
4000
  apply: `@${t}`,
4002
4001
  section: {
4003
- name: Ce(n) === "dataframe" ? "Dataframe" : "Table",
4002
+ name: De(n) === "dataframe" ? "Dataframe" : "Table",
4004
4003
  rank: x.TABLE.rank
4005
4004
  },
4006
4005
  info: () => this.createTableInfoElement(t, n)
@@ -4087,7 +4086,7 @@ var ho = new xe("error", "errors"), go = class extends T {
4087
4086
  detail: n.dataType ?? "",
4088
4087
  type: this.contextType,
4089
4088
  section: x.VARIABLE,
4090
- info: () => oe(n)
4089
+ info: () => fe(n)
4091
4090
  };
4092
4091
  }
4093
4092
  formatContext(e) {
@@ -4105,11 +4104,11 @@ var ho = new xe("error", "errors"), go = class extends T {
4105
4104
  //#endregion
4106
4105
  //#region src/core/ai/context/context.ts
4107
4106
  function So(e) {
4108
- let t = e.get(Se), n = e.get(fe), r = e.get(ge);
4107
+ let t = e.get(ie), n = e.get(le), r = e.get(xe);
4109
4108
  return new C().register(new bo(n)).register(new xo(r, n)).register(new go(e)).register(new oo(e)).register(new y(t.connectionsMap, n));
4110
4109
  }
4111
4110
  function Co() {
4112
- return new yo(le());
4111
+ return new yo(ae());
4113
4112
  }
4114
4113
  //#endregion
4115
4114
  //#region src/components/editor/ai/completion-utils.ts
@@ -4129,42 +4128,42 @@ async function To(e) {
4129
4128
  type: "file",
4130
4129
  mediaType: e.type,
4131
4130
  filename: e.name,
4132
- url: await ze(e, "dataUrl")
4131
+ url: await Ue(e, "dataUrl")
4133
4132
  })));
4134
4133
  }
4135
4134
  function Eo(e) {
4136
4135
  let t = e.at(-1);
4137
4136
  if (!t || t.role !== "assistant") return !1;
4138
4137
  let n = t.parts.at(-1);
4139
- return !n || !K(n) ? !1 : Ia({ messages: e }) || Fa({ messages: e }) || n.state === "output-denied" && !n.providerExecuted;
4138
+ return !n || !G(n) ? !1 : La({ messages: e }) || Ia({ messages: e }) || n.state === "output-denied" && !n.providerExecuted;
4140
4139
  }
4141
4140
  //#endregion
4142
4141
  //#region src/components/chat/chat-components.tsx
4143
4142
  var Do = (e) => {
4144
- let t = (0, N.c)(6), { attachment: n } = e;
4143
+ let t = (0, M.c)(6), { attachment: n } = e;
4145
4144
  if (n.mediaType?.startsWith("image/")) {
4146
4145
  let e = n.filename || "Attachment", r;
4147
- return t[0] !== n.url || t[1] !== e ? (r = /* @__PURE__ */ (0, J.jsx)("img", {
4146
+ return t[0] !== n.url || t[1] !== e ? (r = /* @__PURE__ */ (0, q.jsx)("img", {
4148
4147
  src: n.url,
4149
4148
  alt: e,
4150
4149
  className: "max-h-[100px] max-w-[100px] object-contain mb-1.5"
4151
4150
  }), t[0] = n.url, t[1] = e, t[2] = r) : r = t[2], r;
4152
4151
  }
4153
4152
  let r;
4154
- t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, J.jsx)(Le, { className: "h-3 w-3 mt-0.5" }), t[3] = r) : r = t[3];
4153
+ t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, q.jsx)(Ve, { className: "h-3 w-3 mt-0.5" }), t[3] = r) : r = t[3];
4155
4154
  let i = n.filename || "Attachment", a;
4156
- return t[4] === i ? a = t[5] : (a = /* @__PURE__ */ (0, J.jsxs)("div", {
4155
+ return t[4] === i ? a = t[5] : (a = /* @__PURE__ */ (0, q.jsxs)("div", {
4157
4156
  className: "flex flex-row gap-1 items-center text-xs",
4158
4157
  children: [r, i]
4159
4158
  }), t[4] = i, t[5] = a), a;
4160
4159
  }, Oo = (e) => {
4161
- let t = (0, N.c)(15), { icon: n, title: r, subtitle: i, href: a } = e, o;
4162
- t[0] === r ? o = t[1] : (o = /* @__PURE__ */ (0, J.jsx)("span", {
4160
+ let t = (0, M.c)(15), { icon: n, title: r, subtitle: i, href: a } = e, o;
4161
+ t[0] === r ? o = t[1] : (o = /* @__PURE__ */ (0, q.jsx)("span", {
4163
4162
  className: "truncate font-medium",
4164
4163
  children: r
4165
4164
  }), t[0] = r, t[1] = o);
4166
4165
  let s;
4167
- t[2] === i ? s = t[3] : (s = i && /* @__PURE__ */ (0, J.jsxs)("span", {
4166
+ t[2] === i ? s = t[3] : (s = i && /* @__PURE__ */ (0, q.jsxs)("span", {
4168
4167
  className: "truncate opacity-70",
4169
4168
  children: [
4170
4169
  "(",
@@ -4173,15 +4172,15 @@ var Do = (e) => {
4173
4172
  ]
4174
4173
  }), t[2] = i, t[3] = s);
4175
4174
  let c;
4176
- t[4] !== n || t[5] !== o || t[6] !== s ? (c = /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [
4175
+ t[4] !== n || t[5] !== o || t[6] !== s ? (c = /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [
4177
4176
  n,
4178
4177
  o,
4179
4178
  s
4180
4179
  ] }), t[4] = n, t[5] = o, t[6] = s, t[7] = c) : c = t[7];
4181
4180
  let l = c;
4182
- if (a && Fe(a)) {
4181
+ if (a && ze(a)) {
4183
4182
  let e = i ?? r, n;
4184
- return t[8] !== l || t[9] !== a || t[10] !== e ? (n = /* @__PURE__ */ (0, J.jsx)("a", {
4183
+ return t[8] !== l || t[9] !== a || t[10] !== e ? (n = /* @__PURE__ */ (0, q.jsx)("a", {
4185
4184
  href: a,
4186
4185
  target: "_blank",
4187
4186
  rel: "noopener noreferrer",
@@ -4191,20 +4190,20 @@ var Do = (e) => {
4191
4190
  }), t[8] = l, t[9] = a, t[10] = e, t[11] = n) : n = t[11], n;
4192
4191
  }
4193
4192
  let u = i ?? r, d;
4194
- return t[12] !== l || t[13] !== u ? (d = /* @__PURE__ */ (0, J.jsx)("div", {
4193
+ return t[12] !== l || t[13] !== u ? (d = /* @__PURE__ */ (0, q.jsx)("div", {
4195
4194
  className: "inline-flex max-w-full items-center gap-1.5 rounded-md border bg-muted/50 px-2 py-1 my-1 text-xs text-muted-foreground",
4196
4195
  title: u,
4197
4196
  children: l
4198
4197
  }), t[12] = l, t[13] = u, t[14] = d) : d = t[14], d;
4199
4198
  }, ko = (e) => {
4200
- let t = (0, N.c)(13), { reasoning: n, index: r, isStreaming: i } = e, a = r === void 0 ? 0 : r, o = i !== void 0 && i, [s, c] = q.useState("");
4199
+ let t = (0, M.c)(13), { reasoning: n, index: r, isStreaming: i } = e, a = r === void 0 ? 0 : r, o = i !== void 0 && i, [s, c] = K.useState("");
4201
4200
  if (!n && !o) return null;
4202
4201
  let l = o ? "reasoning" : s, u;
4203
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, J.jsx)(zt, { className: "h-3 w-3" }), t[0] = u) : u = t[0];
4202
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, q.jsx)(Bt, { className: "h-3 w-3" }), t[0] = u) : u = t[0];
4204
4203
  let d = o ? "Thinking" : "View reasoning", f = n.length > 0 && ` (${n.length} chars)`, p;
4205
- t[1] !== d || t[2] !== f ? (p = /* @__PURE__ */ (0, J.jsx)(j, {
4204
+ t[1] !== d || t[2] !== f ? (p = /* @__PURE__ */ (0, q.jsx)(te, {
4206
4205
  className: "text-xs text-muted-foreground hover:bg-muted/50 px-2 py-1 h-auto rounded-sm [&[data-state=open]>svg]:rotate-180",
4207
- children: /* @__PURE__ */ (0, J.jsxs)("span", {
4206
+ children: /* @__PURE__ */ (0, q.jsxs)("span", {
4208
4207
  className: "flex items-center gap-2",
4209
4208
  children: [
4210
4209
  u,
@@ -4214,24 +4213,24 @@ var Do = (e) => {
4214
4213
  })
4215
4214
  }), t[1] = d, t[2] = f, t[3] = p) : p = t[3];
4216
4215
  let m;
4217
- t[4] === n ? m = t[5] : (m = /* @__PURE__ */ (0, J.jsx)(_, {
4216
+ t[4] === n ? m = t[5] : (m = /* @__PURE__ */ (0, q.jsx)(_, {
4218
4217
  className: "pb-2 px-2",
4219
- children: /* @__PURE__ */ (0, J.jsx)("div", {
4218
+ children: /* @__PURE__ */ (0, q.jsx)("div", {
4220
4219
  className: "bg-muted/30 border border-muted/50 rounded-md p-3 italic text-muted-foreground/90 relative",
4221
- children: /* @__PURE__ */ (0, J.jsx)("div", {
4220
+ children: /* @__PURE__ */ (0, q.jsx)("div", {
4222
4221
  className: "pr-6",
4223
- children: /* @__PURE__ */ (0, J.jsx)(O, { content: n })
4222
+ children: /* @__PURE__ */ (0, q.jsx)(O, { content: n })
4224
4223
  })
4225
4224
  })
4226
4225
  }), t[4] = n, t[5] = m);
4227
4226
  let h;
4228
- t[6] !== p || t[7] !== m ? (h = /* @__PURE__ */ (0, J.jsxs)(A, {
4227
+ t[6] !== p || t[7] !== m ? (h = /* @__PURE__ */ (0, q.jsxs)(A, {
4229
4228
  value: "reasoning",
4230
4229
  className: "border-0",
4231
4230
  children: [p, m]
4232
4231
  }), t[6] = p, t[7] = m, t[8] = h) : h = t[8];
4233
4232
  let g;
4234
- return t[9] !== a || t[10] !== l || t[11] !== h ? (g = /* @__PURE__ */ (0, J.jsx)(S, {
4233
+ return t[9] !== a || t[10] !== l || t[11] !== h ? (g = /* @__PURE__ */ (0, q.jsx)(S, {
4235
4234
  type: "single",
4236
4235
  collapsible: !0,
4237
4236
  className: "w-full mb-2",
@@ -4248,48 +4247,48 @@ function Ao(e) {
4248
4247
  //#endregion
4249
4248
  //#region src/components/chat/tool-call/tool-args.tsx
4250
4249
  var jo = (e) => {
4251
- let t = (0, N.c)(9), { input: n, label: r } = e, i = r === void 0 ? "Tool Request" : r;
4250
+ let t = (0, M.c)(9), { input: n, label: r } = e, i = r === void 0 ? "Tool Request" : r;
4252
4251
  if (n == null) return null;
4253
4252
  let a;
4254
- t[0] === i ? a = t[1] : (a = /* @__PURE__ */ (0, J.jsx)("h3", {
4253
+ t[0] === i ? a = t[1] : (a = /* @__PURE__ */ (0, q.jsx)("h3", {
4255
4254
  className: "text-xs font-semibold text-muted-foreground",
4256
4255
  children: i
4257
4256
  }), t[0] = i, t[1] = a);
4258
4257
  let o;
4259
4258
  t[2] === n ? o = t[3] : (o = JSON.stringify(n, null, 2), t[2] = n, t[3] = o);
4260
4259
  let s;
4261
- t[4] === o ? s = t[5] : (s = /* @__PURE__ */ (0, J.jsx)("pre", {
4260
+ t[4] === o ? s = t[5] : (s = /* @__PURE__ */ (0, q.jsx)("pre", {
4262
4261
  className: "bg-(--slate-2) p-2 text-muted-foreground border border-(--slate-4) rounded text-xs overflow-auto scrollbar-thin max-h-64",
4263
4262
  children: o
4264
4263
  }), t[4] = o, t[5] = s);
4265
4264
  let c;
4266
- return t[6] !== a || t[7] !== s ? (c = /* @__PURE__ */ (0, J.jsxs)("div", {
4265
+ return t[6] !== a || t[7] !== s ? (c = /* @__PURE__ */ (0, q.jsxs)("div", {
4267
4266
  className: "space-y-2",
4268
4267
  children: [a, s]
4269
4268
  }), t[6] = a, t[7] = s, t[8] = c) : c = t[8], c;
4270
4269
  }, Mo = (e) => {
4271
- let t = (0, N.c)(27), { toolName: n, input: r, approval: o, onApprove: s, className: c } = e, l;
4270
+ let t = (0, M.c)(27), { toolName: n, input: r, approval: o, onApprove: s, className: c } = e, l;
4272
4271
  t[0] === c ? l = t[1] : (l = i("rounded-md border border-(--amber-6) bg-(--amber-2) p-3 space-y-3", c), t[0] = c, t[1] = l);
4273
4272
  let u;
4274
4273
  t[2] === n ? u = t[3] : (u = Ao(n), t[2] = n, t[3] = u);
4275
4274
  let d = `Approval required for ${u}`, f;
4276
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, J.jsx)(Kt, { className: "h-4 w-4 text-(--amber-11) mt-0.5 shrink-0" }), t[4] = f) : f = t[4];
4275
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, q.jsx)(qt, { className: "h-4 w-4 text-(--amber-11) mt-0.5 shrink-0" }), t[4] = f) : f = t[4];
4277
4276
  let p;
4278
- t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, J.jsx)("span", {
4277
+ t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, q.jsx)("span", {
4279
4278
  className: "font-semibold",
4280
4279
  children: "Approval required:"
4281
4280
  }), t[5] = p) : p = t[5];
4282
4281
  let m;
4283
4282
  t[6] === n ? m = t[7] : (m = Ao(n), t[6] = n, t[7] = m);
4284
4283
  let h;
4285
- t[8] === m ? h = t[9] : (h = /* @__PURE__ */ (0, J.jsxs)("div", {
4284
+ t[8] === m ? h = t[9] : (h = /* @__PURE__ */ (0, q.jsxs)("div", {
4286
4285
  className: "flex items-start gap-2",
4287
- children: [f, /* @__PURE__ */ (0, J.jsxs)("div", {
4286
+ children: [f, /* @__PURE__ */ (0, q.jsxs)("div", {
4288
4287
  className: "text-xs text-(--amber-11) leading-relaxed",
4289
4288
  children: [
4290
4289
  p,
4291
4290
  " ",
4292
- /* @__PURE__ */ (0, J.jsx)("code", {
4291
+ /* @__PURE__ */ (0, q.jsx)("code", {
4293
4292
  className: "font-mono",
4294
4293
  children: m
4295
4294
  })
@@ -4297,9 +4296,9 @@ var jo = (e) => {
4297
4296
  })]
4298
4297
  }), t[8] = m, t[9] = h);
4299
4298
  let g;
4300
- t[10] === r ? g = t[11] : (g = /* @__PURE__ */ (0, J.jsx)(jo, { input: r }), t[10] = r, t[11] = g);
4299
+ t[10] === r ? g = t[11] : (g = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[10] = r, t[11] = g);
4301
4300
  let _;
4302
- t[12] !== o.id || t[13] !== s ? (_ = /* @__PURE__ */ (0, J.jsx)(a, {
4301
+ t[12] !== o.id || t[13] !== s ? (_ = /* @__PURE__ */ (0, q.jsx)(a, {
4303
4302
  size: "xs",
4304
4303
  variant: "outline",
4305
4304
  onClick: () => s({
@@ -4309,7 +4308,7 @@ var jo = (e) => {
4309
4308
  children: "Deny"
4310
4309
  }), t[12] = o.id, t[13] = s, t[14] = _) : _ = t[14];
4311
4310
  let v;
4312
- t[15] !== o.id || t[16] !== s ? (v = /* @__PURE__ */ (0, J.jsx)(a, {
4311
+ t[15] !== o.id || t[16] !== s ? (v = /* @__PURE__ */ (0, q.jsx)(a, {
4313
4312
  size: "xs",
4314
4313
  onClick: () => s({
4315
4314
  id: o.id,
@@ -4318,12 +4317,12 @@ var jo = (e) => {
4318
4317
  children: "Approve"
4319
4318
  }), t[15] = o.id, t[16] = s, t[17] = v) : v = t[17];
4320
4319
  let y;
4321
- t[18] !== v || t[19] !== _ ? (y = /* @__PURE__ */ (0, J.jsxs)("div", {
4320
+ t[18] !== v || t[19] !== _ ? (y = /* @__PURE__ */ (0, q.jsxs)("div", {
4322
4321
  className: "flex items-center justify-end gap-2",
4323
4322
  children: [_, v]
4324
4323
  }), t[18] = v, t[19] = _, t[20] = y) : y = t[20];
4325
4324
  let b;
4326
- return t[21] !== l || t[22] !== y || t[23] !== d || t[24] !== h || t[25] !== g ? (b = /* @__PURE__ */ (0, J.jsxs)("div", {
4325
+ return t[21] !== l || t[22] !== y || t[23] !== d || t[24] !== h || t[25] !== g ? (b = /* @__PURE__ */ (0, q.jsxs)("div", {
4327
4326
  className: l,
4328
4327
  role: "alertdialog",
4329
4328
  "aria-label": d,
@@ -4334,30 +4333,30 @@ var jo = (e) => {
4334
4333
  ]
4335
4334
  }), t[21] = l, t[22] = y, t[23] = d, t[24] = h, t[25] = g, t[26] = b) : b = t[26], b;
4336
4335
  }, No = (e) => {
4337
- let t = (0, N.c)(28), { toolName: n, input: r, errorText: a, isLive: o, className: s } = e, [c, l] = q.useState(o), u = q.useRef(o), d, f;
4336
+ let t = (0, M.c)(28), { toolName: n, input: r, errorText: a, isLive: o, className: s } = e, [c, l] = K.useState(o), u = K.useRef(o), d, f;
4338
4337
  t[0] === o ? (d = t[1], f = t[2]) : (d = () => {
4339
4338
  u.current && !o && l(!1), u.current = o;
4340
- }, f = [o], t[0] = o, t[1] = d, t[2] = f), q.useEffect(d, f);
4339
+ }, f = [o], t[0] = o, t[1] = d, t[2] = f), K.useEffect(d, f);
4341
4340
  let p;
4342
4341
  t[3] === s ? p = t[4] : (p = i("rounded-md border border-(--red-6) bg-(--red-2)", s), t[3] = s, t[4] = p);
4343
4342
  let m;
4344
4343
  t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = () => l(Po), t[5] = m) : m = t[5];
4345
4344
  let h;
4346
- t[6] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ (0, J.jsx)(_e, { className: "h-3.5 w-3.5 shrink-0" }), t[6] = h) : h = t[6];
4345
+ t[6] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ (0, q.jsx)(ge, { className: "h-3.5 w-3.5 shrink-0" }), t[6] = h) : h = t[6];
4347
4346
  let g;
4348
- t[7] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ (0, J.jsx)("span", {
4347
+ t[7] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ (0, q.jsx)("span", {
4349
4348
  className: "font-semibold",
4350
4349
  children: "Failed:"
4351
4350
  }), t[7] = g) : g = t[7];
4352
4351
  let _;
4353
4352
  t[8] === n ? _ = t[9] : (_ = Ao(n), t[8] = n, t[9] = _);
4354
4353
  let v;
4355
- t[10] === _ ? v = t[11] : (v = /* @__PURE__ */ (0, J.jsxs)("span", {
4354
+ t[10] === _ ? v = t[11] : (v = /* @__PURE__ */ (0, q.jsxs)("span", {
4356
4355
  className: "flex-1 text-left",
4357
4356
  children: [
4358
4357
  g,
4359
4358
  " ",
4360
- /* @__PURE__ */ (0, J.jsx)("code", {
4359
+ /* @__PURE__ */ (0, q.jsx)("code", {
4361
4360
  className: "font-mono",
4362
4361
  children: _
4363
4362
  })
@@ -4366,9 +4365,9 @@ var jo = (e) => {
4366
4365
  let y = c && "rotate-180", b;
4367
4366
  t[12] === y ? b = t[13] : (b = i("h-3.5 w-3.5 shrink-0 transition-transform", y), t[12] = y, t[13] = b);
4368
4367
  let x;
4369
- t[14] === b ? x = t[15] : (x = /* @__PURE__ */ (0, J.jsx)(Ee, { className: b }), t[14] = b, t[15] = x);
4368
+ t[14] === b ? x = t[15] : (x = /* @__PURE__ */ (0, q.jsx)(Ae, { className: b }), t[14] = b, t[15] = x);
4370
4369
  let S;
4371
- t[16] !== c || t[17] !== x || t[18] !== v ? (S = /* @__PURE__ */ (0, J.jsxs)("button", {
4370
+ t[16] !== c || t[17] !== x || t[18] !== v ? (S = /* @__PURE__ */ (0, q.jsxs)("button", {
4372
4371
  type: "button",
4373
4372
  onClick: m,
4374
4373
  className: "w-full flex items-center gap-2 px-3 py-2 text-xs text-(--red-11) hover:bg-(--red-3) rounded-md transition-colors",
@@ -4380,18 +4379,18 @@ var jo = (e) => {
4380
4379
  ]
4381
4380
  }), t[16] = c, t[17] = x, t[18] = v, t[19] = S) : S = t[19];
4382
4381
  let C;
4383
- t[20] !== a || t[21] !== r || t[22] !== c ? (C = c && /* @__PURE__ */ (0, J.jsxs)("div", {
4382
+ t[20] !== a || t[21] !== r || t[22] !== c ? (C = c && /* @__PURE__ */ (0, q.jsxs)("div", {
4384
4383
  className: "px-3 pb-3 space-y-3 border-t border-(--red-6)/40 pt-3",
4385
- children: [/* @__PURE__ */ (0, J.jsx)(jo, { input: r }), a && /* @__PURE__ */ (0, J.jsxs)("div", { children: [/* @__PURE__ */ (0, J.jsx)("h3", {
4384
+ children: [/* @__PURE__ */ (0, q.jsx)(jo, { input: r }), a && /* @__PURE__ */ (0, q.jsxs)("div", { children: [/* @__PURE__ */ (0, q.jsx)("h3", {
4386
4385
  className: "text-xs font-semibold text-(--red-11) mb-1",
4387
4386
  children: "Error"
4388
- }), /* @__PURE__ */ (0, J.jsx)("pre", {
4387
+ }), /* @__PURE__ */ (0, q.jsx)("pre", {
4389
4388
  className: "bg-(--red-2) border border-(--red-6) rounded p-2 text-xs text-(--red-11) leading-relaxed overflow-auto scrollbar-thin max-h-64 whitespace-pre-wrap",
4390
4389
  children: a
4391
4390
  })] })]
4392
4391
  }), t[20] = a, t[21] = r, t[22] = c, t[23] = C) : C = t[23];
4393
4392
  let w;
4394
- return t[24] !== S || t[25] !== C || t[26] !== p ? (w = /* @__PURE__ */ (0, J.jsxs)("div", {
4393
+ return t[24] !== S || t[25] !== C || t[26] !== p ? (w = /* @__PURE__ */ (0, q.jsxs)("div", {
4395
4394
  className: p,
4396
4395
  children: [S, C]
4397
4396
  }), t[24] = S, t[25] = C, t[26] = p, t[27] = w) : w = t[27], w;
@@ -4402,54 +4401,54 @@ function Po(e) {
4402
4401
  //#endregion
4403
4402
  //#region src/components/chat/tool-call/tool-result.tsx
4404
4403
  function Fo(e) {
4405
- return e == null || typeof e == "object" && dt(e);
4406
- }
4407
- var Io = Xe({
4408
- status: qe().default("success"),
4409
- auth_required: We().default(!1),
4410
- action_url: ot().optional(),
4411
- next_steps: ot().optional(),
4412
- meta: ot().optional(),
4413
- message: qe().nullish()
4404
+ return e == null || typeof e == "object" && ht(e);
4405
+ }
4406
+ var Io = et({
4407
+ status: Ze().default("success"),
4408
+ auth_required: Je().default(!1),
4409
+ action_url: ut().optional(),
4410
+ next_steps: ut().optional(),
4411
+ meta: ut().optional(),
4412
+ message: Ze().nullish()
4414
4413
  }), Lo = (e) => {
4415
- let t = (0, N.c)(12), { data: n } = e, r;
4414
+ let t = (0, M.c)(12), { data: n } = e, r;
4416
4415
  if (t[0] !== n) {
4417
4416
  let { status: e, auth_required: i, action_url: a, meta: o, next_steps: s, message: c, ...l } = n, u;
4418
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, J.jsx)("h3", {
4417
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, q.jsx)("h3", {
4419
4418
  className: "text-xs font-semibold text-muted-foreground",
4420
4419
  children: "Tool Result"
4421
4420
  }), t[2] = u) : u = t[2];
4422
4421
  let d;
4423
- t[3] === e ? d = t[4] : (d = /* @__PURE__ */ (0, J.jsx)("span", {
4422
+ t[3] === e ? d = t[4] : (d = /* @__PURE__ */ (0, q.jsx)("span", {
4424
4423
  className: "text-xs px-2 py-0.5 bg-(--grass-2) text-(--grass-11) rounded-full font-medium capitalize",
4425
4424
  children: e
4426
4425
  }), t[3] = e, t[4] = d);
4427
4426
  let f;
4428
- t[5] === i ? f = t[6] : (f = i && /* @__PURE__ */ (0, J.jsx)("span", {
4427
+ t[5] === i ? f = t[6] : (f = i && /* @__PURE__ */ (0, q.jsx)("span", {
4429
4428
  className: "text-xs px-2 py-0.5 bg-(--amber-2) text-(--amber-11) rounded-full",
4430
4429
  children: "Auth Required"
4431
4430
  }), t[5] = i, t[6] = f);
4432
4431
  let p;
4433
- t[7] !== d || t[8] !== f ? (p = /* @__PURE__ */ (0, J.jsxs)("div", {
4432
+ t[7] !== d || t[8] !== f ? (p = /* @__PURE__ */ (0, q.jsxs)("div", {
4434
4433
  className: "flex items-center justify-between",
4435
- children: [u, /* @__PURE__ */ (0, J.jsxs)("div", {
4434
+ children: [u, /* @__PURE__ */ (0, q.jsxs)("div", {
4436
4435
  className: "flex items-center gap-2",
4437
4436
  children: [d, f]
4438
4437
  })]
4439
4438
  }), t[7] = d, t[8] = f, t[9] = p) : p = t[9];
4440
4439
  let m;
4441
- t[10] === c ? m = t[11] : (m = c && /* @__PURE__ */ (0, J.jsxs)("div", {
4440
+ t[10] === c ? m = t[11] : (m = c && /* @__PURE__ */ (0, q.jsxs)("div", {
4442
4441
  className: "flex items-start gap-2",
4443
- children: [/* @__PURE__ */ (0, J.jsx)(ye, { className: "h-3 w-3 text-(--blue-11) mt-0.5 shrink-0" }), /* @__PURE__ */ (0, J.jsx)("div", {
4442
+ children: [/* @__PURE__ */ (0, q.jsx)(be, { className: "h-3 w-3 text-(--blue-11) mt-0.5 shrink-0" }), /* @__PURE__ */ (0, q.jsx)("div", {
4444
4443
  className: "text-xs text-foreground",
4445
4444
  children: c
4446
4445
  })]
4447
- }), t[10] = c, t[11] = m), r = /* @__PURE__ */ (0, J.jsxs)("div", {
4446
+ }), t[10] = c, t[11] = m), r = /* @__PURE__ */ (0, q.jsxs)("div", {
4448
4447
  className: "flex flex-col gap-1.5",
4449
4448
  children: [
4450
4449
  p,
4451
4450
  m,
4452
- l && /* @__PURE__ */ (0, J.jsx)("div", {
4451
+ l && /* @__PURE__ */ (0, q.jsx)("div", {
4453
4452
  className: "space-y-3",
4454
4453
  children: Object.entries(l).map(zo)
4455
4454
  })
@@ -4458,29 +4457,29 @@ var Io = Xe({
4458
4457
  } else r = t[1];
4459
4458
  return r;
4460
4459
  }, Ro = (e) => {
4461
- let t = (0, N.c)(8), { result: n } = e, r;
4460
+ let t = (0, M.c)(8), { result: n } = e, r;
4462
4461
  t[0] === n ? r = t[1] : (r = Io.safeParse(n), t[0] = n, t[1] = r);
4463
4462
  let i = r;
4464
4463
  if (i.success) {
4465
4464
  let e;
4466
- return t[2] === i.data ? e = t[3] : (e = /* @__PURE__ */ (0, J.jsx)(Lo, { data: i.data }), t[2] = i.data, t[3] = e), e;
4465
+ return t[2] === i.data ? e = t[3] : (e = /* @__PURE__ */ (0, q.jsx)(Lo, { data: i.data }), t[2] = i.data, t[3] = e), e;
4467
4466
  }
4468
4467
  let a;
4469
4468
  t[4] === n ? a = t[5] : (a = typeof n == "string" ? n : JSON.stringify(n, null, 2), t[4] = n, t[5] = a);
4470
4469
  let o;
4471
- return t[6] === a ? o = t[7] : (o = /* @__PURE__ */ (0, J.jsx)("div", {
4470
+ return t[6] === a ? o = t[7] : (o = /* @__PURE__ */ (0, q.jsx)("div", {
4472
4471
  className: "text-xs font-medium text-muted-foreground mb-1 max-h-64 overflow-y-auto scrollbar-thin",
4473
4472
  children: a
4474
4473
  }), t[6] = a, t[7] = o), o;
4475
4474
  };
4476
4475
  function zo(e) {
4477
4476
  let [t, n] = e;
4478
- return Fo(n) ? null : /* @__PURE__ */ (0, J.jsxs)("div", {
4477
+ return Fo(n) ? null : /* @__PURE__ */ (0, q.jsxs)("div", {
4479
4478
  className: "space-y-1.5",
4480
- children: [/* @__PURE__ */ (0, J.jsx)("span", {
4479
+ children: [/* @__PURE__ */ (0, q.jsx)("span", {
4481
4480
  className: "text-xs text-muted-foreground",
4482
4481
  children: t
4483
- }), /* @__PURE__ */ (0, J.jsx)("pre", {
4482
+ }), /* @__PURE__ */ (0, q.jsx)("pre", {
4484
4483
  className: "bg-(--slate-2) p-2 text-muted-foreground border border-(--slate-4) rounded text-xs overflow-auto scrollbar-thin max-h-64",
4485
4484
  children: JSON.stringify(n, null, 2)
4486
4485
  })]
@@ -4499,30 +4498,30 @@ var Bo = {
4499
4498
  "input-available",
4500
4499
  "approval-responded"
4501
4500
  ]), Ho = (e) => {
4502
- let t = (0, N.c)(5), { state: n, interrupted: r } = e;
4501
+ let t = (0, M.c)(5), { state: n, interrupted: r } = e;
4503
4502
  if (r) {
4504
4503
  let e;
4505
- return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(Vt, { className: "h-3 w-3 text-muted-foreground" }), t[0] = e) : e = t[0], e;
4504
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(Ht, { className: "h-3 w-3 text-muted-foreground" }), t[0] = e) : e = t[0], e;
4506
4505
  }
4507
4506
  switch (n) {
4508
4507
  case "input-streaming":
4509
4508
  case "input-available":
4510
4509
  case "approval-responded": {
4511
4510
  let e;
4512
- return t[1] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(g, { className: "h-3 w-3 animate-spin" }), t[1] = e) : e = t[1], e;
4511
+ return t[1] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(g, { className: "h-3 w-3 animate-spin" }), t[1] = e) : e = t[1], e;
4513
4512
  }
4514
4513
  case "output-available": {
4515
4514
  let e;
4516
- return t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(Bt, { className: "h-3 w-3 text-(--grass-11)" }), t[2] = e) : e = t[2], e;
4515
+ return t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(Vt, { className: "h-3 w-3 text-(--grass-11)" }), t[2] = e) : e = t[2], e;
4517
4516
  }
4518
4517
  case "output-denied": {
4519
4518
  let e;
4520
- return t[3] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(Rt, { className: "h-3 w-3 text-muted-foreground" }), t[3] = e) : e = t[3], e;
4519
+ return t[3] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(zt, { className: "h-3 w-3 text-muted-foreground" }), t[3] = e) : e = t[3], e;
4521
4520
  }
4522
4521
  default: {
4523
- Te(n);
4522
+ ke(n);
4524
4523
  let e;
4525
- return t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(h, { className: "h-3 w-3" }), t[4] = e) : e = t[4], e;
4524
+ return t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(h, { className: "h-3 w-3" }), t[4] = e) : e = t[4], e;
4526
4525
  }
4527
4526
  }
4528
4527
  };
@@ -4533,30 +4532,30 @@ function Uo(e) {
4533
4532
  case "input-streaming":
4534
4533
  case "input-available":
4535
4534
  case "approval-responded": return "";
4536
- default: return Te(e), "";
4535
+ default: return ke(e), "";
4537
4536
  }
4538
4537
  }
4539
4538
  var Wo = (e) => {
4540
- let t = (0, N.c)(34), { toolName: n, state: r, input: a, result: o, approval: s, index: c, className: l, isActive: u } = e, d = c === void 0 ? 0 : c, f = u === void 0 || u, p;
4539
+ let t = (0, M.c)(34), { toolName: n, state: r, input: a, result: o, approval: s, index: c, className: l, isActive: u } = e, d = c === void 0 ? 0 : c, f = u === void 0 || u, p;
4541
4540
  t[0] !== f || t[1] !== r ? (p = !f && Vo.has(r), t[0] = f, t[1] = r, t[2] = p) : p = t[2];
4542
4541
  let m = p, h = `tool-${d}`, g;
4543
4542
  t[3] === l ? g = t[4] : (g = i("w-full", l), t[3] = l, t[4] = g);
4544
4543
  let v;
4545
4544
  t[5] !== m || t[6] !== r ? (v = i("h-6 text-xs border-border shadow-none! ring-0! bg-muted/60 hover:bg-muted py-0 px-2 gap-1 rounded-sm [&[data-state=open]>svg]:rotate-180 hover:no-underline", m ? "text-muted-foreground" : Uo(r)), t[5] = m, t[6] = r, t[7] = v) : v = t[7];
4546
4545
  let y;
4547
- t[8] !== m || t[9] !== r ? (y = /* @__PURE__ */ (0, J.jsx)(Ho, {
4546
+ t[8] !== m || t[9] !== r ? (y = /* @__PURE__ */ (0, q.jsx)(Ho, {
4548
4547
  state: r,
4549
4548
  interrupted: m
4550
4549
  }), t[8] = m, t[9] = r, t[10] = y) : y = t[10];
4551
4550
  let b = m ? "Interrupted" : Bo[r], x;
4552
4551
  t[11] === n ? x = t[12] : (x = Ao(n), t[11] = n, t[12] = x);
4553
4552
  let C;
4554
- t[13] === x ? C = t[14] : (C = /* @__PURE__ */ (0, J.jsx)("code", {
4553
+ t[13] === x ? C = t[14] : (C = /* @__PURE__ */ (0, q.jsx)("code", {
4555
4554
  className: "font-mono text-xs",
4556
4555
  children: x
4557
4556
  }), t[13] = x, t[14] = C);
4558
4557
  let w;
4559
- t[15] !== C || t[16] !== y || t[17] !== b ? (w = /* @__PURE__ */ (0, J.jsxs)("span", {
4558
+ t[15] !== C || t[16] !== y || t[17] !== b ? (w = /* @__PURE__ */ (0, q.jsxs)("span", {
4560
4559
  className: "flex items-center gap-1",
4561
4560
  children: [
4562
4561
  y,
@@ -4566,14 +4565,14 @@ var Wo = (e) => {
4566
4565
  ]
4567
4566
  }), t[15] = C, t[16] = y, t[17] = b, t[18] = w) : w = t[18];
4568
4567
  let T;
4569
- t[19] !== w || t[20] !== v ? (T = /* @__PURE__ */ (0, J.jsx)(j, {
4568
+ t[19] !== w || t[20] !== v ? (T = /* @__PURE__ */ (0, q.jsx)(te, {
4570
4569
  className: v,
4571
4570
  children: w
4572
4571
  }), t[19] = w, t[20] = v, t[21] = T) : T = t[21];
4573
4572
  let E;
4574
- t[22] !== s || t[23] !== a || t[24] !== o || t[25] !== r ? (E = /* @__PURE__ */ (0, J.jsx)(_, {
4573
+ t[22] !== s || t[23] !== a || t[24] !== o || t[25] !== r ? (E = /* @__PURE__ */ (0, q.jsx)(_, {
4575
4574
  className: "py-2 px-2",
4576
- children: /* @__PURE__ */ (0, J.jsx)(Go, {
4575
+ children: /* @__PURE__ */ (0, q.jsx)(Go, {
4577
4576
  state: r,
4578
4577
  input: a,
4579
4578
  result: o,
@@ -4581,61 +4580,61 @@ var Wo = (e) => {
4581
4580
  })
4582
4581
  }), t[22] = s, t[23] = a, t[24] = o, t[25] = r, t[26] = E) : E = t[26];
4583
4582
  let D;
4584
- t[27] !== T || t[28] !== E ? (D = /* @__PURE__ */ (0, J.jsxs)(A, {
4583
+ t[27] !== T || t[28] !== E ? (D = /* @__PURE__ */ (0, q.jsxs)(A, {
4585
4584
  value: "tool-call",
4586
4585
  className: "border-0",
4587
4586
  children: [T, E]
4588
4587
  }), t[27] = T, t[28] = E, t[29] = D) : D = t[29];
4589
4588
  let O;
4590
- return t[30] !== D || t[31] !== h || t[32] !== g ? (O = /* @__PURE__ */ (0, J.jsx)(S, {
4589
+ return t[30] !== D || t[31] !== h || t[32] !== g ? (O = /* @__PURE__ */ (0, q.jsx)(S, {
4591
4590
  type: "single",
4592
4591
  collapsible: !0,
4593
4592
  className: g,
4594
4593
  children: D
4595
4594
  }, h), t[30] = D, t[31] = h, t[32] = g, t[33] = O) : O = t[33], O;
4596
4595
  }, Go = (e) => {
4597
- let t = (0, N.c)(16), { state: n, input: r, result: i, approval: a } = e;
4596
+ let t = (0, M.c)(16), { state: n, input: r, result: i, approval: a } = e;
4598
4597
  switch (n) {
4599
4598
  case "input-streaming":
4600
4599
  case "input-available":
4601
4600
  case "approval-responded": {
4602
4601
  let e;
4603
- return t[0] === r ? e = t[1] : (e = /* @__PURE__ */ (0, J.jsx)(jo, { input: r }), t[0] = r, t[1] = e), e;
4602
+ return t[0] === r ? e = t[1] : (e = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[0] = r, t[1] = e), e;
4604
4603
  }
4605
4604
  case "output-available": {
4606
4605
  let e;
4607
- t[2] === r ? e = t[3] : (e = /* @__PURE__ */ (0, J.jsx)(jo, { input: r }), t[2] = r, t[3] = e);
4606
+ t[2] === r ? e = t[3] : (e = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[2] = r, t[3] = e);
4608
4607
  let n;
4609
- t[4] === i ? n = t[5] : (n = i != null && /* @__PURE__ */ (0, J.jsx)(Ro, { result: i }), t[4] = i, t[5] = n);
4608
+ t[4] === i ? n = t[5] : (n = i != null && /* @__PURE__ */ (0, q.jsx)(Ro, { result: i }), t[4] = i, t[5] = n);
4610
4609
  let a;
4611
- return t[6] !== e || t[7] !== n ? (a = /* @__PURE__ */ (0, J.jsxs)("div", {
4610
+ return t[6] !== e || t[7] !== n ? (a = /* @__PURE__ */ (0, q.jsxs)("div", {
4612
4611
  className: "space-y-3",
4613
4612
  children: [e, n]
4614
4613
  }), t[6] = e, t[7] = n, t[8] = a) : a = t[8], a;
4615
4614
  }
4616
4615
  case "output-denied": {
4617
4616
  let e;
4618
- t[9] === r ? e = t[10] : (e = /* @__PURE__ */ (0, J.jsx)(jo, { input: r }), t[9] = r, t[10] = e);
4617
+ t[9] === r ? e = t[10] : (e = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[9] = r, t[10] = e);
4619
4618
  let n = a?.reason ? `: ${a.reason}` : ".", i;
4620
- t[11] === n ? i = t[12] : (i = /* @__PURE__ */ (0, J.jsxs)("div", {
4619
+ t[11] === n ? i = t[12] : (i = /* @__PURE__ */ (0, q.jsxs)("div", {
4621
4620
  className: "bg-muted/40 border border-border rounded-md p-3 text-xs text-muted-foreground leading-relaxed",
4622
4621
  children: ["Tool execution was denied", n]
4623
4622
  }), t[11] = n, t[12] = i);
4624
4623
  let o;
4625
- return t[13] !== e || t[14] !== i ? (o = /* @__PURE__ */ (0, J.jsxs)("div", {
4624
+ return t[13] !== e || t[14] !== i ? (o = /* @__PURE__ */ (0, q.jsxs)("div", {
4626
4625
  className: "space-y-3",
4627
4626
  children: [e, i]
4628
4627
  }), t[13] = e, t[14] = i, t[15] = o) : o = t[15], o;
4629
4628
  }
4630
- default: return Te(n), null;
4629
+ default: return ke(n), null;
4631
4630
  }
4632
4631
  }, Ko = (e) => {
4633
- let t = (0, N.c)(27), { toolName: n, state: r, result: i, errorText: a, input: o, approval: s, onApprove: c, index: l, className: u, isLive: d, isActive: f } = e, p = d === void 0 || d, m = f === void 0 || f;
4632
+ let t = (0, M.c)(27), { toolName: n, state: r, result: i, errorText: a, input: o, approval: s, onApprove: c, index: l, className: u, isLive: d, isActive: f } = e, p = d === void 0 || d, m = f === void 0 || f;
4634
4633
  switch (r) {
4635
4634
  case "approval-requested": {
4636
4635
  if (s != null && c != null) {
4637
4636
  let e;
4638
- return t[0] !== s || t[1] !== u || t[2] !== o || t[3] !== c || t[4] !== n ? (e = /* @__PURE__ */ (0, J.jsx)(Mo, {
4637
+ return t[0] !== s || t[1] !== u || t[2] !== o || t[3] !== c || t[4] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Mo, {
4639
4638
  toolName: n,
4640
4639
  input: o,
4641
4640
  approval: s,
@@ -4644,7 +4643,7 @@ var Wo = (e) => {
4644
4643
  }), t[0] = s, t[1] = u, t[2] = o, t[3] = c, t[4] = n, t[5] = e) : e = t[5], e;
4645
4644
  }
4646
4645
  let e;
4647
- return t[6] !== u || t[7] !== l || t[8] !== o || t[9] !== m || t[10] !== n ? (e = /* @__PURE__ */ (0, J.jsx)(Wo, {
4646
+ return t[6] !== u || t[7] !== l || t[8] !== o || t[9] !== m || t[10] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Wo, {
4648
4647
  toolName: n,
4649
4648
  state: "input-available",
4650
4649
  input: o,
@@ -4655,7 +4654,7 @@ var Wo = (e) => {
4655
4654
  }
4656
4655
  case "output-error": {
4657
4656
  let e;
4658
- return t[12] !== u || t[13] !== a || t[14] !== o || t[15] !== p || t[16] !== n ? (e = /* @__PURE__ */ (0, J.jsx)(No, {
4657
+ return t[12] !== u || t[13] !== a || t[14] !== o || t[15] !== p || t[16] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(No, {
4659
4658
  toolName: n,
4660
4659
  input: o,
4661
4660
  errorText: a,
@@ -4669,7 +4668,7 @@ var Wo = (e) => {
4669
4668
  case "output-available":
4670
4669
  case "output-denied": {
4671
4670
  let e;
4672
- return t[18] !== s || t[19] !== u || t[20] !== l || t[21] !== o || t[22] !== m || t[23] !== i || t[24] !== r || t[25] !== n ? (e = /* @__PURE__ */ (0, J.jsx)(Wo, {
4671
+ return t[18] !== s || t[19] !== u || t[20] !== l || t[21] !== o || t[22] !== m || t[23] !== i || t[24] !== r || t[25] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Wo, {
4673
4672
  toolName: n,
4674
4673
  state: r,
4675
4674
  input: o,
@@ -4680,12 +4679,12 @@ var Wo = (e) => {
4680
4679
  isActive: m
4681
4680
  }), t[18] = s, t[19] = u, t[20] = l, t[21] = o, t[22] = m, t[23] = i, t[24] = r, t[25] = n, t[26] = e) : e = t[26], e;
4682
4681
  }
4683
- default: return Te(r), null;
4682
+ default: return ke(r), null;
4684
4683
  }
4685
4684
  }, qo = ({ message: e, isStreamingReasoning: t, isLast: n, isActive: i, addToolApprovalResponse: a }) => {
4686
- return /* @__PURE__ */ (0, J.jsx)(J.Fragment, { children: e.parts.map((e, t) => o(e, t)) });
4685
+ return /* @__PURE__ */ (0, q.jsx)(q.Fragment, { children: e.parts.map((e, t) => o(e, t)) });
4687
4686
  function o(o, s) {
4688
- if (Jo(o)) return /* @__PURE__ */ (0, J.jsx)(Ko, {
4687
+ if (Jo(o)) return /* @__PURE__ */ (0, q.jsx)(Ko, {
4689
4688
  index: s,
4690
4689
  toolName: o.type,
4691
4690
  result: o.output,
@@ -4700,19 +4699,19 @@ var Wo = (e) => {
4700
4699
  }, s);
4701
4700
  if (Yo(o)) return r.debug("Found data part", o), null;
4702
4701
  switch (o.type) {
4703
- case "text": return o.text.includes("<marimo-") ? /* @__PURE__ */ (0, J.jsx)(q.Fragment, { children: u({ html: o.text }) }, s) : /* @__PURE__ */ (0, J.jsx)(O, { content: o.text }, s);
4704
- case "reasoning": return /* @__PURE__ */ (0, J.jsx)(ko, {
4702
+ case "text": return o.text.includes("<marimo-") ? /* @__PURE__ */ (0, q.jsx)(K.Fragment, { children: u({ html: o.text }) }, s) : /* @__PURE__ */ (0, q.jsx)(O, { content: o.text }, s);
4703
+ case "reasoning": return /* @__PURE__ */ (0, q.jsx)(ko, {
4705
4704
  reasoning: o.text,
4706
4705
  index: s,
4707
4706
  isStreaming: t && n && s === (e.parts.length || 0) - 1
4708
4707
  }, s);
4709
- case "file": return /* @__PURE__ */ (0, J.jsx)(Do, { attachment: o }, s);
4710
- case "reasoning-file": return /* @__PURE__ */ (0, J.jsx)(Do, { attachment: {
4708
+ case "file": return /* @__PURE__ */ (0, q.jsx)(Do, { attachment: o }, s);
4709
+ case "reasoning-file": return /* @__PURE__ */ (0, q.jsx)(Do, { attachment: {
4711
4710
  type: "file",
4712
4711
  mediaType: o.mediaType,
4713
4712
  url: o.url
4714
4713
  } }, s);
4715
- case "dynamic-tool": return /* @__PURE__ */ (0, J.jsx)(Ko, {
4714
+ case "dynamic-tool": return /* @__PURE__ */ (0, q.jsx)(Ko, {
4716
4715
  toolName: o.toolName,
4717
4716
  result: o.output,
4718
4717
  errorText: o.state === "output-error" ? o.errorText : void 0,
@@ -4723,23 +4722,23 @@ var Wo = (e) => {
4723
4722
  isLive: n,
4724
4723
  isActive: i
4725
4724
  }, s);
4726
- case "source-document": return /* @__PURE__ */ (0, J.jsx)(Oo, {
4727
- icon: /* @__PURE__ */ (0, J.jsx)(me, { className: "h-3 w-3 shrink-0" }),
4725
+ case "source-document": return /* @__PURE__ */ (0, q.jsx)(Oo, {
4726
+ icon: /* @__PURE__ */ (0, q.jsx)(Ee, { className: "h-3 w-3 shrink-0" }),
4728
4727
  title: o.title,
4729
4728
  subtitle: o.filename
4730
4729
  }, s);
4731
- case "source-url": return /* @__PURE__ */ (0, J.jsx)(Oo, {
4732
- icon: /* @__PURE__ */ (0, J.jsx)(be, { className: "h-3 w-3 shrink-0" }),
4730
+ case "source-url": return /* @__PURE__ */ (0, q.jsx)(Oo, {
4731
+ icon: /* @__PURE__ */ (0, q.jsx)(me, { className: "h-3 w-3 shrink-0" }),
4733
4732
  title: o.title ?? o.url,
4734
4733
  subtitle: o.title ? o.url : void 0,
4735
4734
  href: o.url
4736
4735
  }, s);
4737
- case "custom": return /* @__PURE__ */ (0, J.jsx)("div", {
4736
+ case "custom": return /* @__PURE__ */ (0, q.jsx)("div", {
4738
4737
  className: "text-sm text-muted-foreground",
4739
4738
  children: o.kind
4740
4739
  }, s);
4741
4740
  case "step-start": return null;
4742
- default: return Te(o), null;
4741
+ default: return ke(o), null;
4743
4742
  }
4744
4743
  }
4745
4744
  };
@@ -4752,11 +4751,11 @@ function Yo(e) {
4752
4751
  //#endregion
4753
4752
  //#region ../node_modules/.pnpm/@marimo-team+codemirror-ai@0.3.10_@codemirror+state@6.7.6_@codemirror+view@6.43.13/node_modules/@marimo-team/codemirror-ai/dist/utils/facet.js
4754
4753
  function Xo(e) {
4755
- return gt.define({ combine: (t) => t[0] ?? e });
4754
+ return bt.define({ combine: (t) => t[0] ?? e });
4756
4755
  }
4757
4756
  //#endregion
4758
4757
  //#region ../node_modules/.pnpm/@marimo-team+codemirror-ai@0.3.10_@codemirror+state@6.7.6_@codemirror+view@6.43.13/node_modules/@marimo-team/codemirror-ai/dist/prompt-history/extension.js
4759
- var Zo = Xo({}), Qo = vt.define(), $o = vt.define(), es = 50, ts = Et.define({
4758
+ var Zo = Xo({}), Qo = St.define(), $o = St.define(), es = 50, ts = At.define({
4760
4759
  create() {
4761
4760
  return {
4762
4761
  prompts: [],
@@ -4815,7 +4814,7 @@ function is(e = {}) {
4815
4814
  navigationIndex: -1,
4816
4815
  originalText: ""
4817
4816
  })), Zo.of(t ?? {})];
4818
- return n && r.push(xt.of([{
4817
+ return n && r.push(Tt.of([{
4819
4818
  key: "ArrowUp",
4820
4819
  run: ns
4821
4820
  }, {
@@ -4824,8 +4823,8 @@ function is(e = {}) {
4824
4823
  }])), r;
4825
4824
  }
4826
4825
  //#endregion
4827
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/state.js
4828
- var as = vt.define(), Q = Et.define({
4826
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/state.js
4827
+ var as = St.define(), Q = At.define({
4829
4828
  create() {
4830
4829
  return /* @__PURE__ */ new Map();
4831
4830
  },
@@ -4837,7 +4836,7 @@ var as = vt.define(), Q = Et.define({
4837
4836
  }
4838
4837
  return r;
4839
4838
  }
4840
- }), os = Et.define({
4839
+ }), os = At.define({
4841
4840
  create() {
4842
4841
  return {
4843
4842
  onResourceClick: void 0,
@@ -4849,8 +4848,8 @@ var as = vt.define(), Q = Et.define({
4849
4848
  update(e) {
4850
4849
  return e;
4851
4850
  }
4852
- }), ss = vt.define();
4853
- Et.define({
4851
+ }), ss = St.define();
4852
+ At.define({
4854
4853
  create() {
4855
4854
  return /* @__PURE__ */ new Map();
4856
4855
  },
@@ -4864,7 +4863,7 @@ Et.define({
4864
4863
  }
4865
4864
  });
4866
4865
  //#endregion
4867
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/completion.js
4866
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/completion.js
4868
4867
  var cs = (e, t) => async (n) => {
4869
4868
  let r = n.matchBefore(/@(\w+)?/);
4870
4869
  if (!r || r.from === r.to && !n.explicit) return null;
@@ -4897,8 +4896,8 @@ function $(e) {
4897
4896
  return e.matchAll(new RegExp(ls.source, "g"));
4898
4897
  }
4899
4898
  //#endregion
4900
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/decoration.js
4901
- var us = class extends wt {
4899
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/decoration.js
4900
+ var us = class extends Ot {
4902
4901
  resource;
4903
4902
  view;
4904
4903
  constructor(e, t) {
@@ -4919,7 +4918,7 @@ var us = class extends wt {
4919
4918
  e.preventDefault(), e.stopPropagation(), i(this.resource);
4920
4919
  }), e;
4921
4920
  }
4922
- }, ds = class extends wt {
4921
+ }, ds = class extends Ot {
4923
4922
  uri;
4924
4923
  view;
4925
4924
  constructor(e, t) {
@@ -4939,12 +4938,12 @@ function fs(e) {
4939
4938
  let a = e.state.doc.sliceString(r, i);
4940
4939
  for (let i of $(a)) {
4941
4940
  let a = r + i.index, o = i[0].slice(1), s = t.get(o);
4942
- s ? n.push(bt.replace({ widget: new us(s, e) }).range(a, a + i[0].length)) : n.push(bt.replace({ widget: new ds(o, e) }).range(a, a + i[0].length));
4941
+ s ? n.push(wt.replace({ widget: new us(s, e) }).range(a, a + i[0].length)) : n.push(wt.replace({ widget: new ds(o, e) }).range(a, a + i[0].length));
4943
4942
  }
4944
4943
  }
4945
- return bt.set(n);
4944
+ return wt.set(n);
4946
4945
  }
4947
- var ps = Tt.fromClass(class {
4946
+ var ps = kt.fromClass(class {
4948
4947
  decorations;
4949
4948
  constructor(e) {
4950
4949
  this.decorations = fs(e);
@@ -4954,7 +4953,7 @@ var ps = Tt.fromClass(class {
4954
4953
  }
4955
4954
  }, { decorations: (e) => e.decorations });
4956
4955
  //#endregion
4957
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/hover.js
4956
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/hover.js
4958
4957
  function ms(e) {
4959
4958
  let t = document.createElement("div");
4960
4959
  t.className = "cm-tooltip-cursor";
@@ -4984,7 +4983,7 @@ function hs(e, t, n, r = 0) {
4984
4983
  return null;
4985
4984
  }
4986
4985
  function gs(e) {
4987
- return Ct((t, n) => {
4986
+ return Dt((t, n) => {
4988
4987
  let { from: r, text: i } = t.state.doc.lineAt(n), a = hs(i, n, t.state.field(Q), r);
4989
4988
  return a ? {
4990
4989
  pos: a.start,
@@ -4997,7 +4996,7 @@ function gs(e) {
4997
4996
  });
4998
4997
  }
4999
4998
  //#endregion
5000
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/input-filter.js
4999
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/input-filter.js
5001
5000
  function _s(e, t) {
5002
5001
  let n = e.field(Q), r = e.doc, i = r.lineAt(t), a = r.sliceString(i.from, i.to), o = Array.from($(a));
5003
5002
  if (o.length === 0) return null;
@@ -5054,8 +5053,8 @@ function xs(e, t) {
5054
5053
  }
5055
5054
  return null;
5056
5055
  }
5057
- var Ss = St.transactionFilter.of((e) => {
5058
- let t = e.annotation(yt.userEvent);
5056
+ var Ss = Et.transactionFilter.of((e) => {
5057
+ let t = e.annotation(Ct.userEvent);
5059
5058
  if (!t) return e;
5060
5059
  let n = e.startState.selection.main;
5061
5060
  if (!n.empty) return e;
@@ -5237,11 +5236,11 @@ function Os(e, t) {
5237
5236
  };
5238
5237
  }
5239
5238
  function ks(e, t = {}) {
5240
- return Tt.fromClass(Os(e, t));
5239
+ return kt.fromClass(Os(e, t));
5241
5240
  }
5242
5241
  //#endregion
5243
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/theme.js
5244
- var As = ht.baseTheme({
5242
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/theme.js
5243
+ var As = yt.baseTheme({
5245
5244
  ".cm-resource-widget": {
5246
5245
  background: "light-dark(rgba(86,156,214,0.08),rgba(86,156,214,0.18))",
5247
5246
  borderRadius: "4px",
@@ -5274,10 +5273,10 @@ function Fs(e) {
5274
5273
  let { language: t, store: n, onAddFiles: i } = e, a = () => Ps(n);
5275
5274
  return [
5276
5275
  t.data.of({ autocomplete: cs(async () => a(), (e) => e.type === js ? Ns : So(n).getProvider(e.type)?.formatCompletion(e) || {}) }),
5277
- _t.high(xt.of([{
5276
+ xt.high(Tt.of([{
5278
5277
  key: "Tab",
5279
5278
  preventDefault: !0,
5280
- run: (e) => Ot(e)
5279
+ run: (e) => Mt(e)
5281
5280
  }])),
5282
5281
  _o.of({ addAttachment: (e) => i?.([e]) }),
5283
5282
  ...i ? [t.data.of({ autocomplete: Co().createCompletionSource() })] : [],
@@ -5304,14 +5303,14 @@ function Is(e) {
5304
5303
  let t = document.createElement("div");
5305
5304
  return t.innerHTML = e, { dom: t };
5306
5305
  }
5307
- ie("marimo:ai-language", "python", ve);
5308
- var Ls = "marimo:ai-prompt-history", Rs = new ae($e(qe()), () => []), zs = (e) => {
5309
- let t = (0, N.c)(35), { value: n, placeholder: r, inputRef: a, className: o, onChange: s, onSubmit: c, onKeyDown: l, onClose: u, onAddFiles: d, additionalCompletions: f, maxHeight: p } = e, m = c, h = u, g = pt(), { theme: _ } = mt(), v;
5306
+ we("marimo:ai-language", "python", pe);
5307
+ var Ls = "marimo:ai-prompt-history", Rs = new ce(rt(Ze()), () => []), zs = (e) => {
5308
+ let t = (0, M.c)(35), { value: n, placeholder: r, inputRef: a, className: o, onChange: s, onSubmit: c, onKeyDown: l, onClose: u, onAddFiles: d, additionalCompletions: f, maxHeight: p } = e, m = c, h = u, g = _t(), { theme: _ } = vt(), v;
5310
5309
  t[0] === f ? v = t[1] : (v = (e) => f ? wo([f.triggerCompletionRegex], f.completions)(e) : null, t[0] = f, t[1] = v);
5311
- let y = ft(v), b, x, S, C;
5310
+ let y = gt(v), b, x, S, C;
5312
5311
  if (t[2] !== y || t[3] !== d || t[4] !== g) {
5313
- let e = jt();
5314
- t[9] === Symbol.for("react.memo_cache_sentinel") ? (b = At({}), t[9] = b) : b = t[9], x = e, S = Fs({
5312
+ let e = Ft();
5313
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (b = Pt({}), t[9] = b) : b = t[9], x = e, S = Fs({
5315
5314
  language: e.language,
5316
5315
  store: g,
5317
5316
  onAddFiles: d
@@ -5323,9 +5322,9 @@ var Ls = "marimo:ai-prompt-history", Rs = new ae($e(qe()), () => []), zs = (e) =
5323
5322
  save: Vs
5324
5323
  } }), t[10] = w) : w = t[10];
5325
5324
  let T;
5326
- t[11] === Symbol.for("react.memo_cache_sentinel") ? (T = Mt(), t[11] = T) : T = t[11];
5325
+ t[11] === Symbol.for("react.memo_cache_sentinel") ? (T = It(), t[11] = T) : T = t[11];
5327
5326
  let E;
5328
- t[12] === m ? E = t[13] : (E = _t.highest(xt.of([{
5327
+ t[12] === m ? E = t[13] : (E = xt.highest(Tt.of([{
5329
5328
  preventDefault: !0,
5330
5329
  stopPropagation: !0,
5331
5330
  any: (e, t) => {
@@ -5349,7 +5348,7 @@ var Ls = "marimo:ai-prompt-history", Rs = new ae($e(qe()), () => []), zs = (e) =
5349
5348
  }
5350
5349
  }])), t[12] = m, t[13] = E);
5351
5350
  let D;
5352
- t[14] === h ? D = t[15] : (D = xt.of([{
5351
+ t[14] === h ? D = t[15] : (D = Tt.of([{
5353
5352
  key: "Escape",
5354
5353
  preventDefault: !0,
5355
5354
  stopPropagation: !0,
@@ -5362,15 +5361,15 @@ var Ls = "marimo:ai-prompt-history", Rs = new ae($e(qe()), () => []), zs = (e) =
5362
5361
  S,
5363
5362
  C,
5364
5363
  w,
5365
- ht.lineWrapping,
5364
+ yt.lineWrapping,
5366
5365
  T,
5367
5366
  E,
5368
5367
  D
5369
5368
  ], t[16] = b, t[17] = x, t[18] = S, t[19] = C, t[20] = E, t[21] = D, t[22] = O) : O = t[22];
5370
5369
  let k = O, A;
5371
5370
  t[23] === o ? A = t[24] : (A = i("flex-1 font-sans overflow-auto my-1", o), t[23] = o, t[24] = A);
5372
- let ee = _ === "dark" ? "dark" : "light", j = r || "Generate with AI, @ to include context", te;
5373
- return t[25] !== k || t[26] !== a || t[27] !== p || t[28] !== s || t[29] !== l || t[30] !== A || t[31] !== ee || t[32] !== j || t[33] !== n ? (te = /* @__PURE__ */ (0, J.jsx)(Nt, {
5371
+ let ee = _ === "dark" ? "dark" : "light", te = r || "Generate with AI, @ to include context", ne;
5372
+ return t[25] !== k || t[26] !== a || t[27] !== p || t[28] !== s || t[29] !== l || t[30] !== A || t[31] !== ee || t[32] !== te || t[33] !== n ? (ne = /* @__PURE__ */ (0, q.jsx)(Lt, {
5374
5373
  ref: a,
5375
5374
  className: A,
5376
5375
  width: "100%",
@@ -5381,8 +5380,8 @@ var Ls = "marimo:ai-prompt-history", Rs = new ae($e(qe()), () => []), zs = (e) =
5381
5380
  onChange: s,
5382
5381
  onKeyDown: l,
5383
5382
  theme: ee,
5384
- placeholder: j
5385
- }), t[25] = k, t[26] = a, t[27] = p, t[28] = s, t[29] = l, t[30] = A, t[31] = ee, t[32] = j, t[33] = n, t[34] = te) : te = t[34], te;
5383
+ placeholder: te
5384
+ }), t[25] = k, t[26] = a, t[27] = p, t[28] = s, t[29] = l, t[30] = A, t[31] = ee, t[32] = te, t[33] = n, t[34] = ne) : ne = t[34], ne;
5386
5385
  };
5387
5386
  function Bs() {
5388
5387
  return Rs.get(Ls);
@@ -5392,11 +5391,11 @@ function Vs(e) {
5392
5391
  }
5393
5392
  //#endregion
5394
5393
  //#region src/plugins/impl/chat/chat-ui.tsx
5395
- var Hs = f, Us = Ye({
5396
- type: Ge("stream_chunk"),
5397
- message_id: qe(),
5398
- content: ot().nullable().transform((e) => e),
5399
- is_final: We().optional()
5394
+ var Hs = f, Us = $e({
5395
+ type: Ye("stream_chunk"),
5396
+ message_id: Ze(),
5397
+ content: ut().nullable().transform((e) => e),
5398
+ is_final: Je().optional()
5400
5399
  });
5401
5400
  function Ws(e, t) {
5402
5401
  let { controllerRef: n, activeRequestIdRef: i } = t, a = n.current;
@@ -5408,15 +5407,17 @@ function Ws(e, t) {
5408
5407
  }), "dropped-stale") : (e.content && a.enqueue(e.content), e.is_final ? (a.close(), n.current = null, i.current = null, "closed") : "enqueued");
5409
5408
  }
5410
5409
  var Gs = (e) => {
5411
- let [t, o] = (0, q.useState)(""), [s, c] = (0, q.useState)(e.config), [u, d] = (0, q.useState)(e.config), [f, p] = (0, q.useState)(void 0), h = (0, q.useRef)(null), g = (0, q.useRef)(null), _ = (0, q.useRef)(null), v = (0, q.useRef)(null);
5410
+ let [t, o] = (0, K.useState)(""), [s, c] = (0, K.useState)(e.config), [u, d] = (0, K.useState)(e.config), [f, p] = (0, K.useState)(void 0), h = (0, K.useRef)(null), g = (0, K.useRef)(null), _ = (0, K.useRef)(null), v = (0, K.useRef)(null);
5412
5411
  Object.keys(e.config).some((t) => e.config[t] !== u[t]) && (c(e.config), d(e.config));
5413
- let y = (0, q.useRef)(s);
5414
- y.current = s;
5415
- let b = (0, q.useRef)(null), x = (0, q.useRef)(null), S = (0, q.useRef)(null), [C, w] = (0, q.useState)(null), T = () => {
5412
+ let y = (0, K.useRef)(s);
5413
+ (0, K.useLayoutEffect)(() => {
5414
+ y.current = s;
5415
+ }, [s]);
5416
+ let b = (0, K.useRef)(null), x = (0, K.useRef)(null), S = (0, K.useRef)(null), [C, w] = (0, K.useState)(null), T = () => {
5416
5417
  S.current = null, w(null);
5417
- }, { data: D } = Pt(async () => (await e.get_chat_history({})).messages, []), O = e.value.length > 0 ? e.value : D, { messages: k, sendMessage: A, setMessages: ee, status: j, stop: te, error: M, regenerate: ie, clearError: ae, addToolApprovalResponse: oe } = eo({
5418
+ }, { data: D } = Rt(async () => (await e.get_chat_history({})).messages, []), O = e.value.length > 0 ? e.value : D, { messages: k, sendMessage: A, setMessages: ee, status: te, stop: ne, error: j, regenerate: ie, clearError: ae, addToolApprovalResponse: oe } = eo({
5418
5419
  sendAutomaticallyWhen: ({ messages: e }) => Eo(e),
5419
- transport: new Na({ fetch: async (t, n) => {
5420
+ transport: new Pa({ fetch: async (t, n) => {
5420
5421
  if (n === void 0) return fetch(t);
5421
5422
  let i = JSON.parse(n.body), a = n.signal, o = {
5422
5423
  max_tokens: y.current.max_tokens,
@@ -5430,7 +5431,7 @@ var Gs = (e) => {
5430
5431
  let t = i.messages.map((e) => ({
5431
5432
  ...e,
5432
5433
  content: e.parts?.map((e) => "text" in e ? e.text : "").join("\n")
5433
- })), n = re();
5434
+ })), n = ye();
5434
5435
  T();
5435
5436
  let s = new ReadableStream({
5436
5437
  start(t) {
@@ -5459,7 +5460,7 @@ var Gs = (e) => {
5459
5460
  config: o
5460
5461
  }).catch((e) => {
5461
5462
  b.current?.error(e), b.current = null, x.current = null;
5462
- }), ma({ stream: s });
5463
+ }), ha({ stream: s });
5463
5464
  } catch (e) {
5464
5465
  if (e instanceof Error && e.name === "AbortError") return new Response("Aborted", { status: 499 });
5465
5466
  let t = e.message?.split("failed with exception ").pop();
@@ -5490,7 +5491,7 @@ var Gs = (e) => {
5490
5491
  r.error("An error occurred:", e);
5491
5492
  }
5492
5493
  });
5493
- n(e.host, Re.TYPE, (e) => {
5494
+ n(e.host, He.TYPE, (e) => {
5494
5495
  let t = Us.safeParse(e.detail.message);
5495
5496
  if (t.success) {
5496
5497
  if (t.data.content && t.data.message_id === x.current) {
@@ -5503,7 +5504,7 @@ var Gs = (e) => {
5503
5504
  });
5504
5505
  }
5505
5506
  });
5506
- let se = j === "submitted" || j === "streaming", ce = (t) => {
5507
+ let se = te === "submitted" || te === "streaming", ce = (t) => {
5507
5508
  let n = k.findIndex((e) => e.id === t);
5508
5509
  if (n !== -1) {
5509
5510
  let r = k.filter((e) => e.id !== t);
@@ -5516,53 +5517,55 @@ var Gs = (e) => {
5516
5517
  displayLabel: e,
5517
5518
  apply: e
5518
5519
  }))
5519
- }, fe = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
5520
- (0, q.useEffect)(() => {
5520
+ }, de = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
5521
+ (0, K.useEffect)(() => {
5521
5522
  v.current?.scrollTo({
5522
5523
  top: v.current.scrollHeight,
5523
5524
  behavior: "smooth"
5524
5525
  });
5525
5526
  }, [k.length, v]);
5526
- let pe = _.current?.view, me = () => {
5527
- if (pe) {
5528
- let e = pe.state.doc.length;
5529
- pe.dispatch({ changes: {
5527
+ let fe = () => {
5528
+ let e = _.current?.view;
5529
+ if (e) {
5530
+ let t = e.state.doc.length;
5531
+ e.dispatch({ changes: {
5530
5532
  from: 0,
5531
- to: e,
5533
+ to: t,
5532
5534
  insert: ""
5533
5535
  } });
5534
5536
  }
5535
5537
  o("");
5536
5538
  };
5537
- return /* @__PURE__ */ (0, J.jsxs)("div", {
5539
+ return /* @__PURE__ */ (0, q.jsxs)("div", {
5538
5540
  className: "flex flex-col h-full bg-(--slate-1) rounded-lg shadow border border-(--slate-6) overflow-hidden relative",
5539
5541
  style: { maxHeight: e.maxHeight },
5540
5542
  children: [
5541
- /* @__PURE__ */ (0, J.jsx)("div", {
5543
+ /* @__PURE__ */ (0, q.jsx)("div", {
5542
5544
  className: "absolute top-0 right-0 flex justify-end z-10 border border-(--slate-6) bg-inherit rounded-bl-lg",
5543
- children: /* @__PURE__ */ (0, J.jsx)(a, {
5545
+ children: /* @__PURE__ */ (0, q.jsx)(a, {
5546
+ "aria-label": "Reset chat",
5544
5547
  variant: "text",
5545
5548
  size: "icon",
5546
5549
  disabled: k.length === 0,
5547
5550
  onClick: () => {
5548
5551
  ee([]), e.setValue([]), e.delete_chat_history({}), ae(), T();
5549
5552
  },
5550
- children: /* @__PURE__ */ (0, J.jsx)(Ut, { className: "h-3 w-3" })
5553
+ children: /* @__PURE__ */ (0, q.jsx)(Wt, { className: "h-3 w-3" })
5551
5554
  })
5552
5555
  }),
5553
- /* @__PURE__ */ (0, J.jsxs)("div", {
5556
+ /* @__PURE__ */ (0, q.jsxs)("div", {
5554
5557
  className: "grow overflow-y-auto gap-4 pt-8 pb-4 px-2 flex flex-col",
5555
5558
  ref: v,
5556
5559
  children: [
5557
- k.length === 0 && /* @__PURE__ */ (0, J.jsxs)("div", {
5560
+ k.length === 0 && /* @__PURE__ */ (0, q.jsxs)("div", {
5558
5561
  className: "flex flex-col items-center justify-center h-full text-muted-foreground text-center p-4",
5559
5562
  children: [
5560
- /* @__PURE__ */ (0, J.jsx)(zt, { className: "h-12 w-12 mb-4" }),
5561
- /* @__PURE__ */ (0, J.jsx)("h3", {
5563
+ /* @__PURE__ */ (0, q.jsx)(Bt, { className: "h-12 w-12 mb-4" }),
5564
+ /* @__PURE__ */ (0, q.jsx)("h3", {
5562
5565
  className: "text-lg font-semibold mb-2",
5563
5566
  children: "No messages yet"
5564
5567
  }),
5565
- /* @__PURE__ */ (0, J.jsx)("p", {
5568
+ /* @__PURE__ */ (0, q.jsx)("p", {
5566
5569
  className: "text-sm",
5567
5570
  children: "Start a conversation by typing a message below."
5568
5571
  })
@@ -5570,55 +5573,56 @@ var Gs = (e) => {
5570
5573
  }),
5571
5574
  k.map((e, t) => {
5572
5575
  let n = e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n"), r = t === k.length - 1;
5573
- return /* @__PURE__ */ (0, J.jsxs)("div", {
5576
+ return /* @__PURE__ */ (0, q.jsxs)("div", {
5574
5577
  className: i("flex flex-col group gap-2", e.role === "user" ? "items-end" : "items-start"),
5575
- children: [/* @__PURE__ */ (0, J.jsx)("div", {
5578
+ children: [/* @__PURE__ */ (0, q.jsx)("div", {
5576
5579
  className: `max-w-[80%] p-3 rounded-lg ${e.role === "user" ? "bg-(--sky-11) text-(--slate-1) whitespace-pre-wrap" : "bg-(--slate-4) text-(--slate-12)"}`,
5577
5580
  children: qo({
5578
5581
  message: e,
5579
- isStreamingReasoning: j === "streaming",
5582
+ isStreamingReasoning: te === "streaming",
5580
5583
  isLast: r,
5581
5584
  isActive: se,
5582
5585
  addToolApprovalResponse: r ? oe : void 0
5583
5586
  })
5584
- }), /* @__PURE__ */ (0, J.jsxs)("div", {
5585
- className: "flex justify-end text-xs gap-2 invisible group-hover:visible",
5586
- children: [/* @__PURE__ */ (0, J.jsx)(l, {
5587
+ }), /* @__PURE__ */ (0, q.jsxs)("div", {
5588
+ className: "flex justify-end text-xs gap-2 opacity-0 group-hover:opacity-100 focus-within:opacity-100",
5589
+ children: [/* @__PURE__ */ (0, q.jsx)(l, {
5587
5590
  value: n,
5588
5591
  className: "h-3 w-3",
5589
5592
  buttonClassName: "text-xs text-(--slate-9) hover:text-(--slate-11)"
5590
- }), /* @__PURE__ */ (0, J.jsx)("button", {
5593
+ }), /* @__PURE__ */ (0, q.jsx)("button", {
5591
5594
  type: "button",
5595
+ "aria-label": "Delete message",
5592
5596
  onClick: () => ce(e.id),
5593
5597
  className: "text-xs text-(--slate-9) hover:text-(--slate-11)",
5594
- children: /* @__PURE__ */ (0, J.jsx)(m, { className: "h-3 w-3 text-(--red-9)" })
5598
+ children: /* @__PURE__ */ (0, q.jsx)(m, { className: "h-3 w-3 text-(--red-9)" })
5595
5599
  })]
5596
5600
  })]
5597
- }, `${e.id}-${t}`);
5601
+ }, e.id);
5598
5602
  }),
5599
- se && /* @__PURE__ */ (0, J.jsx)("div", {
5603
+ se && /* @__PURE__ */ (0, q.jsx)("div", {
5600
5604
  className: "flex items-center justify-center mb-4",
5601
- children: /* @__PURE__ */ (0, J.jsx)(E, { size: "small" })
5605
+ children: /* @__PURE__ */ (0, q.jsx)(E, { size: "small" })
5602
5606
  }),
5603
- M && /* @__PURE__ */ (0, J.jsxs)("div", {
5607
+ j && /* @__PURE__ */ (0, q.jsxs)("div", {
5604
5608
  className: "flex items-center justify-center space-x-2 mb-4",
5605
- children: [/* @__PURE__ */ (0, J.jsx)(lt, { error: M }), /* @__PURE__ */ (0, J.jsx)(a, {
5609
+ children: [/* @__PURE__ */ (0, q.jsx)(pt, { error: j }), /* @__PURE__ */ (0, q.jsx)(a, {
5606
5610
  variant: "outline",
5607
5611
  size: "sm",
5608
5612
  onClick: () => ie(),
5609
5613
  children: "Retry"
5610
5614
  })]
5611
5615
  }),
5612
- C && !se && !M && /* @__PURE__ */ (0, J.jsx)("div", {
5616
+ C && !se && !j && /* @__PURE__ */ (0, q.jsx)("div", {
5613
5617
  className: "flex justify-center py-2",
5614
- children: /* @__PURE__ */ (0, J.jsx)("span", {
5618
+ children: /* @__PURE__ */ (0, q.jsx)("span", {
5615
5619
  className: "text-xs text-muted-foreground",
5616
5620
  children: C
5617
5621
  })
5618
5622
  })
5619
5623
  ]
5620
5624
  }),
5621
- /* @__PURE__ */ (0, J.jsxs)("form", {
5625
+ /* @__PURE__ */ (0, q.jsxs)("form", {
5622
5626
  onSubmit: async (n) => {
5623
5627
  if (n.preventDefault(), e.disabled) return;
5624
5628
  let r = f ? await To(f) : void 0;
@@ -5628,27 +5632,28 @@ var Gs = (e) => {
5628
5632
  type: "text",
5629
5633
  text: t
5630
5634
  }, ...r ?? []]
5631
- }), me();
5635
+ }), fe();
5632
5636
  },
5633
5637
  ref: g,
5634
5638
  inert: e.disabled || void 0,
5635
5639
  className: i("flex w-full border-t border-(--slate-6) px-2 py-1 items-center", e.disabled && "opacity-50 cursor-not-allowed"),
5636
5640
  children: [
5637
- e.showConfigurationControls && /* @__PURE__ */ (0, J.jsx)(qs, {
5641
+ e.showConfigurationControls && /* @__PURE__ */ (0, q.jsx)(qs, {
5638
5642
  config: s,
5639
5643
  onChange: c
5640
5644
  }),
5641
- e.prompts.length > 0 && /* @__PURE__ */ (0, J.jsx)(Js, {
5645
+ e.prompts.length > 0 && /* @__PURE__ */ (0, q.jsx)(Js, {
5642
5646
  prompts: e.prompts,
5643
5647
  onSelect: (e) => {
5644
5648
  o(e), requestAnimationFrame(() => {
5645
- pe?.focus(), de(pe);
5649
+ let e = _.current?.view;
5650
+ e?.focus(), Te(e);
5646
5651
  });
5647
5652
  }
5648
5653
  }),
5649
- /* @__PURE__ */ (0, J.jsx)(zs, {
5654
+ /* @__PURE__ */ (0, q.jsx)(zs, {
5650
5655
  className: "rounded-sm mr-2",
5651
- placeholder: fe,
5656
+ placeholder: de,
5652
5657
  value: t,
5653
5658
  inputRef: _,
5654
5659
  maxHeight: e.maxHeight ? `${e.maxHeight / 2}px` : void 0,
@@ -5659,32 +5664,32 @@ var Gs = (e) => {
5659
5664
  onClose: () => {},
5660
5665
  additionalCompletions: ue
5661
5666
  }),
5662
- f && f.length === 1 && /* @__PURE__ */ (0, J.jsx)("span", {
5667
+ f && f.length === 1 && /* @__PURE__ */ (0, q.jsx)("span", {
5663
5668
  title: f[0].name,
5664
5669
  className: "text-sm text-(--slate-11) truncate shrink-0 w-fit max-w-24",
5665
5670
  children: f[0].name
5666
5671
  }),
5667
- f && f.length > 1 && /* @__PURE__ */ (0, J.jsxs)("span", {
5672
+ f && f.length > 1 && /* @__PURE__ */ (0, q.jsxs)("span", {
5668
5673
  title: [...f].map((e) => e.name).join("\n"),
5669
5674
  className: "text-sm text-(--slate-11) truncate shrink-0",
5670
5675
  children: [f.length, " files"]
5671
5676
  }),
5672
- f && f.length > 0 && /* @__PURE__ */ (0, J.jsx)(a, {
5677
+ f && f.length > 0 && /* @__PURE__ */ (0, q.jsx)(a, {
5673
5678
  type: "button",
5674
5679
  variant: "text",
5675
5680
  size: "sm",
5676
5681
  onClick: () => {
5677
5682
  p(void 0), h.current && (h.current.value = "");
5678
5683
  },
5679
- children: /* @__PURE__ */ (0, J.jsx)(we, { className: "size-3" })
5684
+ children: /* @__PURE__ */ (0, q.jsx)(Oe, { className: "size-3" })
5680
5685
  }),
5681
- le && /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [/* @__PURE__ */ (0, J.jsx)(a, {
5686
+ le && /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [/* @__PURE__ */ (0, q.jsx)(a, {
5682
5687
  type: "button",
5683
5688
  variant: "text",
5684
5689
  size: "sm",
5685
5690
  onClick: () => h.current?.click(),
5686
- children: /* @__PURE__ */ (0, J.jsx)(Ht, { className: "h-4" })
5687
- }), /* @__PURE__ */ (0, J.jsx)("input", {
5691
+ children: /* @__PURE__ */ (0, q.jsx)(Ut, { className: "h-4" })
5692
+ }), /* @__PURE__ */ (0, q.jsx)("input", {
5688
5693
  type: "file",
5689
5694
  ref: h,
5690
5695
  className: "hidden",
@@ -5694,24 +5699,24 @@ var Gs = (e) => {
5694
5699
  e.target.files && p([...e.target.files]);
5695
5700
  }
5696
5701
  })] }),
5697
- se ? /* @__PURE__ */ (0, J.jsx)(ne, {
5702
+ se ? /* @__PURE__ */ (0, q.jsx)(re, {
5698
5703
  content: "Stop generating",
5699
- children: /* @__PURE__ */ (0, J.jsx)(a, {
5704
+ children: /* @__PURE__ */ (0, q.jsx)(a, {
5700
5705
  type: "button",
5701
5706
  variant: "link",
5702
5707
  size: "xs",
5703
- onClick: () => te(),
5708
+ onClick: () => ne(),
5704
5709
  className: "text-(--red-9) hover:text-(--red-11)",
5705
- children: /* @__PURE__ */ (0, J.jsx)(Ie, { className: "h-4 w-4 fill-current" })
5710
+ children: /* @__PURE__ */ (0, q.jsx)(Be, { className: "h-4 w-4 fill-current" })
5706
5711
  })
5707
- }) : /* @__PURE__ */ (0, J.jsx)(a, {
5712
+ }) : /* @__PURE__ */ (0, q.jsx)(a, {
5708
5713
  type: "submit",
5709
5714
  disabled: !t,
5710
5715
  variant: "outline",
5711
5716
  size: "xs",
5712
5717
  className: "text-(--slate-11)",
5713
5718
  "aria-label": "Send message",
5714
- children: /* @__PURE__ */ (0, J.jsx)(Wt, { className: "h-4 w-4" })
5719
+ children: /* @__PURE__ */ (0, q.jsx)(Gt, { className: "h-4 w-4" })
5715
5720
  })
5716
5721
  ]
5717
5722
  })
@@ -5751,7 +5756,7 @@ var Gs = (e) => {
5751
5756
  description: "Penalizes new tokens (-2: favor, 2: avoid)"
5752
5757
  }
5753
5758
  }, qs = (e) => {
5754
- let t = (0, N.c)(16), { config: n, onChange: r } = e, [i, o] = (0, q.useState)(!1), s;
5759
+ let t = (0, M.c)(16), { config: n, onChange: r } = e, [i, o] = (0, K.useState)(!1), s;
5755
5760
  t[0] !== n || t[1] !== r ? (s = (e, t) => {
5756
5761
  let i = t === null || Number.isNaN(t) ? null : t;
5757
5762
  if (i !== null) {
@@ -5769,20 +5774,20 @@ var Gs = (e) => {
5769
5774
  e.key === "Enter" && (e.preventDefault(), o(!1));
5770
5775
  }, t[3] = l) : l = t[3];
5771
5776
  let u = l, f;
5772
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, J.jsx)(ne, {
5777
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, q.jsx)(re, {
5773
5778
  content: "Configuration",
5774
- children: /* @__PURE__ */ (0, J.jsx)(d, {
5779
+ children: /* @__PURE__ */ (0, q.jsx)(d, {
5775
5780
  asChild: !0,
5776
- children: /* @__PURE__ */ (0, J.jsx)(a, {
5781
+ children: /* @__PURE__ */ (0, q.jsx)(a, {
5777
5782
  variant: "outline",
5778
5783
  size: "sm",
5779
5784
  className: "border-none shadow-none hover:bg-transparent",
5780
- children: /* @__PURE__ */ (0, J.jsx)(Gt, { className: "h-3 w-3" })
5785
+ children: /* @__PURE__ */ (0, q.jsx)(Kt, { className: "h-3 w-3" })
5781
5786
  })
5782
5787
  })
5783
5788
  }), t[4] = f) : f = t[4];
5784
5789
  let m;
5785
- t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ (0, J.jsx)("h4", {
5790
+ t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ (0, q.jsx)("h4", {
5786
5791
  className: "font-bold leading-none",
5787
5792
  children: "Configuration"
5788
5793
  }), t[5] = m) : m = t[5];
@@ -5791,21 +5796,21 @@ var Gs = (e) => {
5791
5796
  let e;
5792
5797
  t[9] === c ? e = t[10] : (e = (e) => {
5793
5798
  let [t, n] = e;
5794
- return /* @__PURE__ */ (0, J.jsxs)("div", {
5799
+ return /* @__PURE__ */ (0, q.jsxs)("div", {
5795
5800
  className: "grid grid-cols-3 items-center gap-1",
5796
- children: [/* @__PURE__ */ (0, J.jsxs)(ut, {
5801
+ children: [/* @__PURE__ */ (0, q.jsxs)(mt, {
5797
5802
  htmlFor: t,
5798
5803
  className: "flex w-full justify-between col-span-3 align-end",
5799
- children: [De.startCase(t), /* @__PURE__ */ (0, J.jsx)(ne, {
5804
+ children: [je.startCase(t), /* @__PURE__ */ (0, q.jsx)(re, {
5800
5805
  delayDuration: 200,
5801
5806
  side: "top",
5802
- content: /* @__PURE__ */ (0, J.jsx)("div", {
5807
+ content: /* @__PURE__ */ (0, q.jsx)("div", {
5803
5808
  className: "text-xs flex flex-col",
5804
5809
  children: Ks[t].description
5805
5810
  }),
5806
- children: /* @__PURE__ */ (0, J.jsx)(Pe, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
5811
+ children: /* @__PURE__ */ (0, q.jsx)(Re, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
5807
5812
  })]
5808
- }), /* @__PURE__ */ (0, J.jsx)(Oe, {
5813
+ }), /* @__PURE__ */ (0, q.jsx)(Me, {
5809
5814
  id: t,
5810
5815
  "aria-label": t,
5811
5816
  value: n ?? NaN,
@@ -5818,51 +5823,51 @@ var Gs = (e) => {
5818
5823
  className: "col-span-3"
5819
5824
  })]
5820
5825
  }, t);
5821
- }, t[9] = c, t[10] = e), h = Dt.entries(n).map(e), t[6] = n, t[7] = c, t[8] = h;
5826
+ }, t[9] = c, t[10] = e), h = jt.entries(n).map(e), t[6] = n, t[7] = c, t[8] = h;
5822
5827
  } else h = t[8];
5823
5828
  let g;
5824
- t[11] === h ? g = t[12] : (g = /* @__PURE__ */ (0, J.jsx)(p, {
5829
+ t[11] === h ? g = t[12] : (g = /* @__PURE__ */ (0, q.jsx)(p, {
5825
5830
  className: "w-70 border",
5826
- children: /* @__PURE__ */ (0, J.jsxs)("div", {
5831
+ children: /* @__PURE__ */ (0, q.jsxs)("div", {
5827
5832
  className: "grid gap-3",
5828
5833
  children: [m, h]
5829
5834
  })
5830
5835
  }), t[11] = h, t[12] = g);
5831
5836
  let _;
5832
- return t[13] !== i || t[14] !== g ? (_ = /* @__PURE__ */ (0, J.jsxs)(te, {
5837
+ return t[13] !== i || t[14] !== g ? (_ = /* @__PURE__ */ (0, q.jsxs)(ne, {
5833
5838
  open: i,
5834
5839
  onOpenChange: o,
5835
5840
  children: [f, g]
5836
5841
  }), t[13] = i, t[14] = g, t[15] = _) : _ = t[15], _;
5837
5842
  }, Js = (e) => {
5838
- let t = (0, N.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, q.useState)(!1), [s, c] = (0, q.useState)(""), l;
5843
+ let t = (0, M.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, K.useState)(!1), [s, c] = (0, K.useState)(""), l;
5839
5844
  t[0] === r ? l = t[1] : (l = (e) => {
5840
5845
  [...e.matchAll(/{{(\w+)}}/g)].length > 0 ? (c(e), o(!0)) : r(e);
5841
5846
  }, t[0] = r, t[1] = l);
5842
5847
  let u = l, d;
5843
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, J.jsx)(ne, {
5848
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, q.jsx)(re, {
5844
5849
  content: "Select a prompt",
5845
- children: /* @__PURE__ */ (0, J.jsx)(ke, {
5850
+ children: /* @__PURE__ */ (0, q.jsx)(Ne, {
5846
5851
  asChild: !0,
5847
- children: /* @__PURE__ */ (0, J.jsx)(a, {
5852
+ children: /* @__PURE__ */ (0, q.jsx)(a, {
5848
5853
  variant: "outline",
5849
5854
  size: "sm",
5850
5855
  className: "border-none shadow-none hover:bg-transparent",
5851
- children: /* @__PURE__ */ (0, J.jsx)(ee, { className: "h-3 w-3" })
5856
+ children: /* @__PURE__ */ (0, q.jsx)(ee, { className: "h-3 w-3" })
5852
5857
  })
5853
5858
  })
5854
5859
  }), t[2] = d) : d = t[2];
5855
5860
  let f;
5856
5861
  if (t[3] !== u || t[4] !== n) {
5857
5862
  let e;
5858
- t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, J.jsx)(je, {
5863
+ t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, q.jsx)(Fe, {
5859
5864
  onSelect: () => u(e),
5860
5865
  className: "whitespace-normal text-left",
5861
5866
  children: e
5862
5867
  }, t), t[6] = u, t[7] = e), f = n.map(e), t[3] = u, t[4] = n, t[5] = f;
5863
5868
  } else f = t[5];
5864
5869
  let m;
5865
- t[8] === f ? m = t[9] : (m = /* @__PURE__ */ (0, J.jsx)(Hs, { children: /* @__PURE__ */ (0, J.jsxs)(Ne, { children: [d, /* @__PURE__ */ (0, J.jsx)(Me, {
5870
+ t[8] === f ? m = t[9] : (m = /* @__PURE__ */ (0, q.jsx)(Hs, { children: /* @__PURE__ */ (0, q.jsxs)(Le, { children: [d, /* @__PURE__ */ (0, q.jsx)(Ie, {
5866
5871
  side: "right",
5867
5872
  align: "end",
5868
5873
  onCloseAutoFocus: Xs,
@@ -5872,99 +5877,94 @@ var Gs = (e) => {
5872
5877
  let h;
5873
5878
  t[10] === Symbol.for("react.memo_cache_sentinel") ? (h = () => o(!1), t[10] = h) : h = t[10];
5874
5879
  let g;
5875
- t[11] !== r || t[12] !== s ? (g = /* @__PURE__ */ (0, J.jsx)(p, {
5880
+ t[11] !== r || t[12] !== s ? (g = /* @__PURE__ */ (0, q.jsx)(p, {
5876
5881
  side: "right",
5877
5882
  align: "end",
5878
5883
  className: "min-w-80 px-2",
5879
- children: /* @__PURE__ */ (0, J.jsx)(Ys, {
5884
+ children: /* @__PURE__ */ (0, q.jsx)(Ys, {
5880
5885
  prompt: s,
5881
5886
  onClose: h,
5882
5887
  onSelect: r
5883
- })
5888
+ }, s)
5884
5889
  }), t[11] = r, t[12] = s, t[13] = g) : g = t[13];
5885
5890
  let _;
5886
- return t[14] !== i || t[15] !== m || t[16] !== g ? (_ = /* @__PURE__ */ (0, J.jsxs)(te, {
5891
+ return t[14] !== i || t[15] !== m || t[16] !== g ? (_ = /* @__PURE__ */ (0, q.jsxs)(ne, {
5887
5892
  open: i,
5888
5893
  onOpenChange: o,
5889
5894
  children: [m, g]
5890
5895
  }), t[14] = i, t[15] = m, t[16] = g, t[17] = _) : _ = t[17], _;
5891
5896
  }, Ys = (e) => {
5892
- let t = (0, N.c)(32), { prompt: n, onClose: r, onSelect: i } = e, o;
5893
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = {}, t[0] = o) : o = t[0];
5894
- let [s, c] = (0, q.useState)(o), l, u;
5895
- t[1] === n ? (l = t[2], u = t[3]) : (l = () => {
5896
- let e = [...n.matchAll(/{{(\w+)}}/g)].reduce(Zs, {});
5897
- c(e);
5898
- }, u = [n], t[1] = n, t[2] = l, t[3] = u), (0, q.useEffect)(l, u);
5899
- let d;
5900
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (d = (e, t) => {
5897
+ let t = (0, M.c)(30), { prompt: n, onClose: r, onSelect: i } = e, o;
5898
+ t[0] === n ? o = t[1] : (o = () => [...n.matchAll(/{{(\w+)}}/g)].reduce(Zs, {}), t[0] = n, t[1] = o);
5899
+ let [s, c] = (0, K.useState)(o), l;
5900
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (l = (e, t) => {
5901
5901
  c((n) => ({
5902
5902
  ...n,
5903
5903
  [e]: t
5904
5904
  }));
5905
- }, t[4] = d) : d = t[4];
5906
- let f = d, p;
5907
- if (t[5] !== n || t[6] !== s) {
5905
+ }, t[2] = l) : l = t[2];
5906
+ let u = l, d;
5907
+ if (t[3] !== n || t[4] !== s) {
5908
5908
  let e;
5909
- t[8] === Symbol.for("react.memo_cache_sentinel") ? (e = /{{(\w+)}}/g, t[8] = e) : e = t[8];
5909
+ t[6] === Symbol.for("react.memo_cache_sentinel") ? (e = /{{(\w+)}}/g, t[6] = e) : e = t[6];
5910
5910
  let r;
5911
- t[9] === s ? r = t[10] : (r = (e, t) => s[t] || `{{${t}}}`, t[9] = s, t[10] = r), p = n.replaceAll(e, r), t[5] = n, t[6] = s, t[7] = p;
5912
- } else p = t[7];
5911
+ t[7] === s ? r = t[8] : (r = (e, t) => s[t] || `{{${t}}}`, t[7] = s, t[8] = r), d = n.replaceAll(e, r), t[3] = n, t[4] = s, t[5] = d;
5912
+ } else d = t[5];
5913
+ let f = d, p;
5914
+ t[9] === s ? p = t[10] : (p = Object.values(s).some(Qs), t[9] = s, t[10] = p);
5913
5915
  let m = p, h;
5914
- t[11] === s ? h = t[12] : (h = Object.values(s).some(Qs), t[11] = s, t[12] = h);
5916
+ t[11] !== r || t[12] !== i || t[13] !== f ? (h = () => {
5917
+ i(f), r();
5918
+ }, t[11] = r, t[12] = i, t[13] = f, t[14] = h) : h = t[14];
5915
5919
  let g = h, _;
5916
- t[13] !== r || t[14] !== i || t[15] !== m ? (_ = () => {
5917
- i(m), r();
5918
- }, t[13] = r, t[14] = i, t[15] = m, t[16] = _) : _ = t[16];
5919
- let v = _, y;
5920
- t[17] === s ? y = t[18] : (y = Object.entries(s), t[17] = s, t[18] = y);
5921
- let b;
5922
- t[19] !== v || t[20] !== g || t[21] !== y ? (b = y.map((e, t) => {
5920
+ t[15] === s ? _ = t[16] : (_ = Object.entries(s), t[15] = s, t[16] = _);
5921
+ let v;
5922
+ t[17] !== g || t[18] !== m || t[19] !== _ ? (v = _.map((e, t) => {
5923
5923
  let [n, r] = e;
5924
- return /* @__PURE__ */ (0, J.jsxs)("div", {
5924
+ return /* @__PURE__ */ (0, q.jsxs)("div", {
5925
5925
  className: "grid grid-cols-4 items-center gap-2",
5926
- children: [/* @__PURE__ */ (0, J.jsx)(ut, {
5926
+ children: [/* @__PURE__ */ (0, q.jsx)(mt, {
5927
5927
  htmlFor: n,
5928
5928
  className: "font-semibold text-base",
5929
5929
  children: n
5930
- }), /* @__PURE__ */ (0, J.jsx)(Ae, {
5930
+ }), /* @__PURE__ */ (0, q.jsx)(Pe, {
5931
5931
  id: n,
5932
5932
  value: r,
5933
- onChange: (e) => f(n, e.target.value),
5933
+ onChange: (e) => u(n, e.target.value),
5934
5934
  rootClassName: "col-span-3 w-full",
5935
5935
  className: "m-0",
5936
5936
  placeholder: `Enter value for ${n}`,
5937
5937
  autoFocus: t === 0,
5938
5938
  onKeyDown: (e) => {
5939
- e.key === "Enter" && !g && v();
5939
+ e.key === "Enter" && !m && g();
5940
5940
  }
5941
5941
  })]
5942
5942
  }, n);
5943
- }), t[19] = v, t[20] = g, t[21] = y, t[22] = b) : b = t[22];
5944
- let x;
5945
- t[23] === m ? x = t[24] : (x = /* @__PURE__ */ (0, J.jsx)("div", {
5943
+ }), t[17] = g, t[18] = m, t[19] = _, t[20] = v) : v = t[20];
5944
+ let y;
5945
+ t[21] === f ? y = t[22] : (y = /* @__PURE__ */ (0, q.jsx)("div", {
5946
5946
  className: "grid gap-2 prose dark:prose-invert",
5947
- children: /* @__PURE__ */ (0, J.jsx)("blockquote", {
5947
+ children: /* @__PURE__ */ (0, q.jsx)("blockquote", {
5948
5948
  className: "text-sm",
5949
- children: m
5949
+ children: f
5950
5950
  })
5951
- }), t[23] = m, t[24] = x);
5952
- let S;
5953
- t[25] !== v || t[26] !== g ? (S = /* @__PURE__ */ (0, J.jsx)(a, {
5954
- onClick: v,
5951
+ }), t[21] = f, t[22] = y);
5952
+ let b;
5953
+ t[23] !== g || t[24] !== m ? (b = /* @__PURE__ */ (0, q.jsx)(a, {
5954
+ onClick: g,
5955
5955
  size: "xs",
5956
- disabled: g,
5956
+ disabled: m,
5957
5957
  children: "Submit"
5958
- }), t[25] = v, t[26] = g, t[27] = S) : S = t[27];
5959
- let C;
5960
- return t[28] !== x || t[29] !== S || t[30] !== b ? (C = /* @__PURE__ */ (0, J.jsxs)("div", {
5958
+ }), t[23] = g, t[24] = m, t[25] = b) : b = t[25];
5959
+ let x;
5960
+ return t[26] !== v || t[27] !== y || t[28] !== b ? (x = /* @__PURE__ */ (0, q.jsxs)("div", {
5961
5961
  className: "grid gap-4",
5962
5962
  children: [
5963
- b,
5964
- x,
5965
- S
5963
+ v,
5964
+ y,
5965
+ b
5966
5966
  ]
5967
- }), t[28] = x, t[29] = S, t[30] = b, t[31] = C) : C = t[31], C;
5967
+ }), t[26] = v, t[27] = y, t[28] = b, t[29] = x) : x = t[29], x;
5968
5968
  };
5969
5969
  function Xs(e) {
5970
5970
  return e.preventDefault();