@marimo-team/islands 0.25.3-dev4 → 0.25.3-dev6

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 (90) hide show
  1. package/dist/{ConnectedDataExplorerComponent-CNSxdKyJ.js → ConnectedDataExplorerComponent-CNMliVzw.js} +1 -1
  2. package/dist/{ErrorBoundary-CuU5CuVr.js → ErrorBoundary-Ca-Sa492.js} +1 -1
  3. package/dist/{abnfDiagram-VCTEODGH-DQDjNXt3.js → abnfDiagram-VCTEODGH-D-Ez91gV.js} +2 -2
  4. package/dist/{any-language-editor-B9REGlD9.js → any-language-editor-DZ_YTVus.js} +1 -1
  5. package/dist/{architectureDiagram-5GKGNRK7-Nmls7Wxn.js → architectureDiagram-5GKGNRK7-CTpcNtO8.js} +1 -1
  6. package/dist/{chat-ui-BDpymeoe.js → chat-ui-0lKdOoQ3.js} +436 -437
  7. package/dist/{chunk-IMKFNOWR-CoIFEo-1.js → chunk-IMKFNOWR-DGxi-zeo.js} +1 -1
  8. package/dist/{chunk-SHT3W25Y-lHiGx3ZC.js → chunk-SHT3W25Y-CV9J3rAB.js} +1 -1
  9. package/dist/{chunk-SVP7TREG-BvsHIrY_.js → chunk-SVP7TREG-BL-9Fqgg.js} +1 -1
  10. package/dist/{chunk-TICWLB2K-BC8YIm_n.js → chunk-TICWLB2K-Cu_XMjDM.js} +1 -1
  11. package/dist/{classDiagram-ZZMXUADV-Bt98lkkv.js → classDiagram-ZZMXUADV-BXXV13Hq.js} +2 -2
  12. package/dist/{classDiagram-v2-VYDZK3BY-D9bfbcC3.js → classDiagram-v2-VYDZK3BY-B7FXJ1Cp.js} +2 -2
  13. package/dist/{code-visibility-Lu0dkrFO.js → code-visibility-NGRjhbtA.js} +14 -14
  14. package/dist/{common-DiWGWDIM.js → common-B7_ZSg0P.js} +6426 -6256
  15. package/dist/{cynefinDiagram-5FMLGOSQ-CgWra7wt.js → cynefinDiagram-5FMLGOSQ-CH96rwba.js} +1 -1
  16. package/dist/{dagre-GXQ25YYZ-CFZ8-35c.js → dagre-GXQ25YYZ-BD3PmpFY.js} +1 -1
  17. package/dist/{data-grid-overlay-editor-ga7ytgbj.js → data-grid-overlay-editor-B_cmrkBm.js} +1 -1
  18. package/dist/{diagram-S7CK7UJ4-lCNQrW7d.js → diagram-S7CK7UJ4-BsSJJldB.js} +1 -1
  19. package/dist/{diagram-UQ7AKVKN-CQPQ6pP_.js → diagram-UQ7AKVKN-muQtNZc4.js} +1 -1
  20. package/dist/{diagram-VX7I27RA-Cf3b0llz.js → diagram-VX7I27RA-CdhuZAqR.js} +1 -1
  21. package/dist/{diagram-Z3DM3KII-Bt4QLrpn.js → diagram-Z3DM3KII-BD8mXjOj.js} +1 -1
  22. package/dist/{ebnfDiagram-PWID7BFC-D3NAyPFY.js → ebnfDiagram-PWID7BFC-BIN1sweE.js} +2 -2
  23. package/dist/{erDiagram-RLTQ6QDP-Tlu09_Nm.js → erDiagram-RLTQ6QDP-Ctp5cfoN.js} +1 -1
  24. package/dist/{error-banner-Da600cwz.js → error-banner-D-WCIiMt.js} +10 -5
  25. package/dist/{cells-C8iCYvLU.js → error-entries-DSvFWT_M.js} +2262 -2206
  26. package/dist/{feedback-button-DQA-pzxi.js → feedback-button-CTF2Nj9s.js} +115 -116
  27. package/dist/{flowDiagram-HODETNUW-CAYbpJmV.js → flowDiagram-HODETNUW-3EfLrlFb.js} +2 -2
  28. package/dist/{formats-BGh2thRc.js → formats-CeOmU1MU.js} +1 -1
  29. package/dist/{glide-data-editor-Bv75MH6g.js → glide-data-editor-BQHF9puC.js} +3 -3
  30. package/dist/{globals-EDQGFIvi.js → globals-Cj8iqMEp.js} +1 -1
  31. package/dist/{html-to-image-CZY1pIZH.js → html-to-image-B8s5SgGm.js} +23 -23
  32. package/dist/{infoDiagram-27XIBGKW-XrDxhr0x.js → infoDiagram-27XIBGKW-DipQoHxl.js} +1 -1
  33. package/dist/{ishikawaDiagram-5VMMS53U-CD1muzov.js → ishikawaDiagram-5VMMS53U-DgFMjSGz.js} +1 -1
  34. package/dist/{kanban-definition-UXKFOSKX-Dg9W142_.js → kanban-definition-UXKFOSKX-w1ACVjgl.js} +1 -1
  35. package/dist/main.js +164 -163
  36. package/dist/{mermaid-CiAXjLpA.js → mermaid-CHo49Yv-.js} +33 -33
  37. package/dist/{mindmap-definition-YA3MSWOX-DgCidgYJ.js → mindmap-definition-YA3MSWOX-CrT0KSfX.js} +1 -1
  38. package/dist/{number-overlay-editor-BCP3MxhC.js → number-overlay-editor-DBcnm0SY.js} +1 -1
  39. package/dist/{pegDiagram-XKGWAZYB-coOYYKB6.js → pegDiagram-XKGWAZYB-BqvywNJA.js} +2 -2
  40. package/dist/{pieDiagram-E7YTZNPT-BnXTc3bj.js → pieDiagram-E7YTZNPT-BfxJ_XCc.js} +1 -1
  41. package/dist/{process-output-e4jj9Ijt.js → process-output-CKRXyszb.js} +3 -3
  42. package/dist/{railroadDiagram-O6MQD6OU-B28-u83n.js → railroadDiagram-O6MQD6OU-8vFLVTPu.js} +2 -2
  43. package/dist/{requirementDiagram-BXWQKSXE-CdYCTMu0.js → requirementDiagram-BXWQKSXE-a_MxGvxe.js} +1 -1
  44. package/dist/{reveal-component-DO5BJB9l.js → reveal-component-DTBSuGkC.js} +4 -4
  45. package/dist/{sequenceDiagram-WJ2MYXX4-CM3aRAe_.js → sequenceDiagram-WJ2MYXX4-CXFMnxGh.js} +1 -1
  46. package/dist/{stateDiagram-D77RDMKH-DOZUMVj8.js → stateDiagram-D77RDMKH-DQeA_CwI.js} +2 -2
  47. package/dist/{stateDiagram-v2-MP3YSRHH-CISYxma6.js → stateDiagram-v2-MP3YSRHH-BxxQucm1.js} +2 -2
  48. package/dist/style.css +1 -1
  49. package/dist/{swimlanes-42K2YHIH-BkSppxp8.js → swimlanes-42K2YHIH-Do6L-cYg.js} +1 -1
  50. package/dist/{swimlanesDiagram-VR7AAH4N-c8G5pGxC.js → swimlanesDiagram-VR7AAH4N-DUzPvSVU.js} +2 -2
  51. package/dist/{timeline-definition-24CTP7MA-CaMQayqK.js → timeline-definition-24CTP7MA-D3c46WM5.js} +1 -1
  52. package/dist/{toDate-BNJf01u1.js → toDate-vIXljnsr.js} +39 -38
  53. package/dist/{vega-component-DG29TAB7.js → vega-component-DTG6zxaY.js} +3 -3
  54. package/dist/{vennDiagram-4TSXK5OY-CF8pfaK3.js → vennDiagram-4TSXK5OY-BSZD8JcZ.js} +1 -1
  55. package/dist/{wardleyDiagram-VM6X3IG4-dGPu39d-.js → wardleyDiagram-VM6X3IG4-48cUWkfA.js} +1 -1
  56. package/dist/{xychartDiagram-S5SC5T6Z-CP6-9q56.js → xychartDiagram-S5SC5T6Z-CswYgYeu.js} +1 -1
  57. package/package.json +1 -1
  58. package/src/__tests__/fixtures/{pair-preview.ts → pair-config.ts} +3 -2
  59. package/src/__tests__/mount.test.ts +8 -8
  60. package/src/components/editor/Output.tsx +9 -2
  61. package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +80 -252
  62. package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +186 -34
  63. package/src/components/editor/actions/pair-with-agent-commands.ts +42 -51
  64. package/src/components/editor/actions/pair-with-agent-modal.tsx +96 -36
  65. package/src/components/editor/chrome/panels/error-panel.tsx +1 -0
  66. package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +372 -0
  67. package/src/components/editor/chrome/wrapper/footer-item.tsx +32 -24
  68. package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +237 -0
  69. package/src/components/editor/chrome/wrapper/footer.tsx +2 -0
  70. package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +548 -0
  71. package/src/components/editor/errors/send-error-report-button.tsx +69 -0
  72. package/src/components/editor/output/MarimoErrorOutput.tsx +21 -5
  73. package/src/components/editor/output/MarimoTracebackOutput.tsx +35 -20
  74. package/src/components/editor/output/__tests__/ansi-reduce.test.ts +18 -0
  75. package/src/components/editor/output/ansi-reduce.ts +6 -0
  76. package/src/core/attachments/__tests__/toast.test.tsx +58 -0
  77. package/src/core/attachments/state.ts +21 -0
  78. package/src/core/attachments/toast.ts +15 -0
  79. package/src/core/cells/__tests__/cells.test.ts +52 -0
  80. package/src/core/cells/__tests__/error-report.test.ts +139 -0
  81. package/src/core/cells/__tests__/session.test.ts +50 -1
  82. package/src/core/cells/error-report.ts +63 -0
  83. package/src/core/cells/session.ts +28 -1
  84. package/src/core/config/pair.ts +5 -3
  85. package/src/core/islands/__tests__/bootstrap.test.ts +26 -0
  86. package/src/core/islands/bootstrap.ts +1 -0
  87. package/src/core/websocket/__tests__/useMarimoKernelConnection.hook.test.tsx +193 -0
  88. package/src/core/websocket/useMarimoKernelConnection.tsx +9 -0
  89. package/src/mount.tsx +3 -3
  90. package/dist/error-entries-CzoYkIQZ.js +0 -56
@@ -3,26 +3,25 @@ import { c as n, g as r, h as i, t as a } from "./button-CvjkwdSk.js";
3
3
  import { t as o } from "./react-sHtZdjeP.js";
4
4
  import { t as s } from "./compiler-runtime-CldRdSsv.js";
5
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";
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-B8s5SgGm.js";
7
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";
8
+ import { Ct as re, Dt as ie, L as ae, Pt as oe, Rt as se, St as ce, Ut as le, Z as ue, ct as de, fn as fe, h as pe, hn as me, ht as he, i as ge, it as _e, ln as ve, lt as ye, r as be, t as xe, tn as Se, tt as Ce, un as we, w as Te, wt as Ee } from "./error-entries-DSvFWT_M.js";
9
+ import { A as De, C as Oe, M as ke, b as Ae } from "./select-BButFi-d.js";
10
+ import { _ as je, f as Me, h as Ne, i as Pe, n as Fe, t as Ie } from "./dropdown-menu-CP_qCYHC.js";
11
+ import { C as Le, d as Re } from "./toDate-vIXljnsr.js";
12
+ import { d as ze, f as Be, i as Ve, n as He, t as Ue, u as We } from "./process-output-CKRXyszb.js";
13
+ import { t as Ge } from "./jsx-runtime-3BD1kT0s.js";
14
+ import { A as Ke, C as qe, D as Je, E as Ye, F as Xe, L as Ze, M as Qe, O as $e, P as et, R as tt, S as nt, T as rt, V as it, b as at, j as ot, v as st, w as ct, x as lt, y as ut, z as dt } from "./use-restore-focus-BEM7sFWl.js";
15
+ import { n as ft } from "./error-banner-D-WCIiMt.js";
16
+ import { t as pt } from "./label-BDKF3Afc.js";
17
+ import { t as mt } from "./isEmpty-BSZ1LaUo.js";
18
+ import { A as ht, T as gt, n as _t } from "./useTheme-CRnjkku0.js";
19
+ import { $ as vt, Mt as yt, Pt as bt, Rt as xt, Vt as St, Z as Ct, ht as wt, jt as Tt, mt as Et, nt as Dt, tt as Ot, zt as kt } from "./dist-DoE4XJBC.js";
20
+ import { t as At } from "./objects-CzUgoMIF.js";
21
+ import { n as jt, o as Mt, r as Nt } from "./dist-CkTTIdBe.js";
22
+ import { n as Pt } from "./dist-CrSP_H1M.js";
23
+ import { n as Ft, t as It } from "./esm-AMFssoNp.js";
24
+ import { t as Lt } from "./useAsyncData-Deh5kszT.js";
26
25
  var Rt = M("ban", [["circle", {
27
26
  cx: "12",
28
27
  cy: "12",
@@ -168,7 +167,7 @@ Error message: ${un(t)}`,
168
167
  static isInstance(e) {
169
168
  return P.hasMarker(e, vn);
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
+ }, Cn = "AI_TypeValidationError", wn = `vercel.ai.error.${Cn}`, Tn = Symbol.for(wn), En, Dn, On = class e extends (Dn = P, En = Tn, Dn) {
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) {
@@ -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 = P, 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 P.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,7 +396,7 @@ 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];
@@ -409,16 +408,16 @@ var I = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRS
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" && I(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] = I(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(I) : I(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(I)), e.allOf != null && (e.allOf = e.allOf.map(I)), e.oneOf != null && (e.oneOf = e.oneOf.map(I));
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] = I(t[e]);
459
458
  return e;
460
459
  }
461
- function L(e) {
462
- return typeof e == "boolean" ? e : $n(e);
460
+ function I(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 tr = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), nr = {
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
+ }, rr = (e) => typeof e == "string" ? {
484
+ ...nr,
486
485
  name: e
487
486
  } : {
488
- ...tr,
487
+ ...nr,
489
488
  ...e
490
489
  };
491
- function R() {
490
+ function L() {
492
491
  return {};
493
492
  }
494
- function rr(e, t) {
493
+ function ir(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 = V(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 ar(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 or() {
519
518
  return { type: "boolean" };
520
519
  }
521
- function or(e, t) {
522
- return H(e.type._def, t);
520
+ function sr(e, t) {
521
+ return V(e.type._def, t);
523
522
  }
524
- var sr = (e, t) => H(e.innerType._def, t);
525
- function cr(e, t, n) {
523
+ var cr = (e, t) => V(e.innerType._def, t);
524
+ function lr(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) => lr(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 ur(e);
539
538
  }
540
539
  }
541
- var lr = (e) => {
540
+ var ur = (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 dr(e, t) {
555
554
  return {
556
- ...H(e.innerType._def, t),
555
+ ...V(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 fr(e, t) {
560
+ return t.effectStrategy === "input" ? V(e.schema._def, t) : L();
562
561
  }
563
- function fr(e) {
562
+ function pr(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 mr = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
569
+ function hr(e, t) {
570
+ let n = [V(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
+ }), V(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 (mr(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 gr(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 _r = void 0, R = {
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: () => (_r === void 0 && (_r = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), _r),
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 vr(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
+ z(n, "email", r.message, t);
634
633
  break;
635
634
  case "format:idn-email":
636
- B(n, "idn-email", r.message, t);
635
+ z(n, "idn-email", r.message, t);
637
636
  break;
638
- case "pattern:zod": V(n, z.email, r.message, t);
637
+ case "pattern:zod": B(n, R.email, r.message, t);
639
638
  }
640
639
  break;
641
640
  case "url":
642
- B(n, "uri", r.message, t);
641
+ z(n, "uri", r.message, t);
643
642
  break;
644
643
  case "uuid":
645
- B(n, "uuid", r.message, t);
644
+ z(n, "uuid", r.message, t);
646
645
  break;
647
646
  case "regex":
648
- V(n, r.regex, r.message, t);
647
+ B(n, r.regex, r.message, t);
649
648
  break;
650
649
  case "cuid":
651
- V(n, z.cuid, r.message, t);
650
+ B(n, R.cuid, r.message, t);
652
651
  break;
653
652
  case "cuid2":
654
- V(n, z.cuid2, r.message, t);
653
+ B(n, R.cuid2, r.message, t);
655
654
  break;
656
655
  case "startsWith":
657
- V(n, RegExp(`^${vr(r.value, t)}`), r.message, t);
656
+ B(n, RegExp(`^${yr(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
+ B(n, RegExp(`${yr(r.value, t)}$`), r.message, t);
661
660
  break;
662
661
  case "datetime":
663
- B(n, "date-time", r.message, t);
662
+ z(n, "date-time", r.message, t);
664
663
  break;
665
664
  case "date":
666
- B(n, "date", r.message, t);
665
+ z(n, "date", r.message, t);
667
666
  break;
668
667
  case "time":
669
- B(n, "time", r.message, t);
668
+ z(n, "time", r.message, t);
670
669
  break;
671
670
  case "duration":
672
- B(n, "duration", r.message, t);
671
+ z(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
+ B(n, RegExp(yr(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" && z(n, "ipv4", r.message, t), r.version !== "v4" && z(n, "ipv6", r.message, t);
682
681
  break;
683
682
  case "base64url":
684
- V(n, z.base64url, r.message, t);
683
+ B(n, R.base64url, r.message, t);
685
684
  break;
686
685
  case "jwt":
687
- V(n, z.jwt, r.message, t);
686
+ B(n, R.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" && B(n, R.ipv4Cidr, r.message, t), r.version !== "v4" && B(n, R.ipv6Cidr, r.message, t);
691
690
  break;
692
691
  case "emoji":
693
- V(n, z.emoji(), r.message, t);
692
+ B(n, R.emoji(), r.message, t);
694
693
  break;
695
694
  case "ulid":
696
- V(n, z.ulid, r.message, t);
695
+ B(n, R.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
+ z(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": B(n, R.base64, r.message, t);
707
706
  }
708
707
  break;
709
- case "nanoid": V(n, z.nanoid, r.message, t);
708
+ case "nanoid": B(n, R.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 yr(e, t) {
713
+ return t.patternStrategy === "escape" ? xr(e) : e;
715
714
  }
716
- var yr = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
717
- function br(e) {
715
+ var br = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
716
+ function xr(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++) br.has(e[n]) || (t += "\\"), t += e[n];
720
719
  return t;
721
720
  }
722
- function B(e, t, n, r) {
721
+ function z(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 B(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: Sr(t, r),
731
730
  ...n && r.errorMessages && { errorMessage: { pattern: n } }
732
- })) : e.pattern = xr(t, r);
731
+ })) : e.pattern = Sr(t, r);
733
732
  }
734
- function xr(e, t) {
733
+ function Sr(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 Cr(e, t) {
783
782
  let n = {
784
783
  type: "object",
785
- additionalProperties: H(e.valueType._def, {
784
+ additionalProperties: V(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 } = vr(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 } = sr(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 wr(e, t) {
810
+ return t.mapStrategy === "record" ? Cr(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: [V(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
+ }) || L(), V(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
+ }) || L()],
833
832
  minItems: 2,
834
833
  maxItems: 2
835
834
  }
836
835
  };
837
836
  }
838
- function wr(e) {
837
+ function Tr(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() };
847
- }
848
844
  function Er() {
845
+ return { not: L() };
846
+ }
847
+ function Dr() {
849
848
  return { type: "null" };
850
849
  }
851
- var Dr = {
850
+ var Or = {
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 kr(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 Or && (!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 = Or[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 Ar(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 Ar = (e, t) => {
892
+ let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => V(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 jr(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: [Or[e.innerType._def.typeName], "null"] };
910
+ let n = V(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 Mr(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 Nr(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 = Fr(a), s = V(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 = Pr(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 Pr(e, t) {
965
+ if (e.catchall._def.typeName !== "ZodNever") return V(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 Fr(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 Ir = (e, t) => {
983
+ if (t.currentPath.toString() === t.propertyPath?.toString()) return V(e.innerType._def, t);
984
+ let n = V(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: L() }, n] } : L();
993
+ }, Lr = (e, t) => {
994
+ if (t.pipeStrategy === "input") return V(e.in._def, t);
995
+ if (t.pipeStrategy === "output") return V(e.out._def, t);
996
+ let n = V(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, V(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);
1016
- }
1017
1013
  function Rr(e, t) {
1014
+ return V(e.type._def, t);
1015
+ }
1016
+ function zr(e, t) {
1018
1017
  let n = {
1019
1018
  type: "array",
1020
1019
  uniqueItems: !0,
1021
- items: H(e.valueType._def, {
1020
+ items: V(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 Br(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) => V(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: V(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) => V(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() };
1060
- }
1061
1057
  function Vr() {
1062
- return R();
1058
+ return { not: L() };
1059
+ }
1060
+ function Hr() {
1061
+ return L();
1063
1062
  }
1064
- var Hr = (e, t) => H(e.innerType._def, t), Ur = (e, t, n) => {
1063
+ var Ur = (e, t) => V(e.innerType._def, t), Wr = (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 vr(e, n);
1066
+ case "ZodNumber": return Mr(e);
1067
+ case "ZodObject": return Nr(e, n);
1068
+ case "ZodBigInt": return ar(e);
1069
+ case "ZodBoolean": return or();
1070
+ case "ZodDate": return lr(e, n);
1071
+ case "ZodUndefined": return Vr();
1072
+ case "ZodNull": return Dr();
1073
+ case "ZodArray": return ir(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 kr(e, n);
1076
+ case "ZodIntersection": return hr(e, n);
1077
+ case "ZodTuple": return Br(e, n);
1078
+ case "ZodRecord": return Cr(e, n);
1079
+ case "ZodLiteral": return gr(e);
1080
+ case "ZodEnum": return pr(e);
1081
+ case "ZodNativeEnum": return Tr(e);
1082
+ case "ZodNullable": return jr(e, n);
1083
+ case "ZodOptional": return Ir(e, n);
1084
+ case "ZodMap": return wr(e, n);
1085
+ case "ZodSet": return zr(e, n);
1087
1086
  case "ZodLazy": return () => e.getter()._def;
1088
- case "ZodPromise": return Lr(e, n);
1087
+ case "ZodPromise": return Rr(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 Er();
1090
+ case "ZodEffects": return fr(e, n);
1091
+ case "ZodAny": return L();
1092
+ case "ZodUnknown": return Hr();
1093
+ case "ZodDefault": return dr(e, n);
1094
+ case "ZodBranded": return sr(e, n);
1095
+ case "ZodReadonly": return Ur(e, n);
1096
+ case "ZodCatch": return cr(e, n);
1097
+ case "ZodPipeline": return Lr(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
+ }, Gr = (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 V(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 !== tr) return i;
1114
1113
  }
1115
1114
  if (r && !n) {
1116
- let e = Gr(r, t);
1115
+ let e = Kr(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 = Wr(e, e.typeName, t), o = typeof a == "function" ? V(a(), t) : a;
1125
+ if (o && qr(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 Kr = (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: Gr(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`), L()) : t.$refStrategy === "seen" ? L() : 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
+ }, qr = (e, t, n) => (e.description && (n.description = e.description), n), Jr = (e) => {
1139
+ let t = rr(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
+ }, Yr = (e, t) => {
1159
+ let n = Jr(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]: V(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) ?? L()
1169
+ }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = V(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) ?? L(), 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
+ }, Xr = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
1194
+ function Zr(e) {
1196
1195
  let t;
1197
1196
  return () => (t ??= e(), t);
1198
1197
  }
1199
- function Zr(e, { validate: t } = {}) {
1198
+ function Qr(e, { validate: t } = {}) {
1200
1199
  return {
1201
- [Yr]: !0,
1200
+ [Xr]: !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;
1211
- }
1212
1208
  function $r(e) {
1213
- return e == null ? Zr({
1209
+ return typeof e == "object" && !!e && Xr in e && e[Xr] === !0 && "jsonSchema" in e && "validate" in e;
1210
+ }
1211
+ function ei(e) {
1212
+ return e == null ? Qr({
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
+ }) : $r(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? oi(e) : ti(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 ti(e) {
1219
+ return Qr(() => {
1220
+ if (!ni(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 On({
1231
1230
  value: t,
1232
1231
  cause: n.issues
1233
1232
  })
1234
1233
  };
1235
1234
  } });
1236
1235
  }
1237
- function ti(e) {
1236
+ function ni(e) {
1238
1237
  return e["~standard"].jsonSchema != null;
1239
1238
  }
1240
- function ni(e, t) {
1239
+ function ri(e, t) {
1241
1240
  let n = t?.useReferences ?? !1;
1242
- return Zr(() => Jr(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
1241
+ return Qr(() => Yr(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 ii(e, t) {
1254
1253
  let n = t?.useReferences ?? !1;
1255
- return Zr(() => $n(tt(e, {
1254
+ return Qr(() => er(it(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 dt(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 ai(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 oi(e, t) {
1273
+ return ai(e) ? ii(e, t) : ri(e, t);
1275
1274
  }
1276
- async function oi({ value: e, schema: t, context: n }) {
1277
- let r = await si({
1275
+ async function si({ value: e, schema: t, context: n }) {
1276
+ let r = await ci({
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 On.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 ci({ value: e, schema: t, context: n }) {
1289
+ let r = ei(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: On.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: On.wrap({
1315
1314
  value: e,
1316
1315
  cause: t,
1317
1316
  context: n
@@ -1320,14 +1319,14 @@ 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 li({ 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 ci({
1331
1330
  value: n,
1332
1331
  schema: t
1333
1332
  });
@@ -1342,15 +1341,15 @@ 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 ui({ 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 li({
1348
1347
  text: e,
1349
1348
  schema: t
1350
1349
  }));
1351
1350
  } }));
1352
1351
  }
1353
- async function ui(e) {
1352
+ async function H(e) {
1354
1353
  return typeof e == "function" && (e = e()), Promise.resolve(e);
1355
1354
  }
1356
1355
  new TextDecoder();
@@ -1447,23 +1446,23 @@ function Fi(e, t) {
1447
1446
  return n;
1448
1447
  }
1449
1448
  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
1449
+ array: nt,
1450
+ boolean: qe,
1451
+ custom: ct,
1452
+ discriminatedUnion: rt,
1453
+ enum: st,
1454
+ instanceof: ut,
1455
+ lazy: Ye,
1456
+ literal: Je,
1457
+ looseObject: $e,
1458
+ never: Ke,
1459
+ null: at,
1460
+ number: ot,
1461
+ object: Qe,
1462
+ record: et,
1463
+ string: Xe,
1464
+ union: Ze,
1465
+ unknown: tt
1467
1466
  }, Ii = W.lazy(() => W.union([
1468
1467
  W.null(),
1469
1468
  W.string(),
@@ -1475,7 +1474,7 @@ var W = {
1475
1474
  W.string(),
1476
1475
  W.instanceof(Uint8Array),
1477
1476
  W.instanceof(ArrayBuffer),
1478
- W.custom(qn, { message: "Must be a Buffer" })
1477
+ W.custom(Jn, { message: "Must be a Buffer" })
1479
1478
  ]), Ri = W.record(W.string(), W.string()), zi = W.object({
1480
1479
  type: W.literal("text"),
1481
1480
  text: W.string(),
@@ -1883,11 +1882,11 @@ async function ra(e) {
1883
1882
  value: void 0,
1884
1883
  state: "undefined-input"
1885
1884
  };
1886
- let t = await ci({ text: e });
1885
+ let t = await li({ 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 li({ text: na(e) }), t.success ? {
1891
1890
  value: t.value,
1892
1891
  state: "repaired-parse"
1893
1892
  } : {
@@ -1906,17 +1905,17 @@ var ia = () => ({
1906
1905
  },
1907
1906
  createElementStreamTransform() {}
1908
1907
  }), aa = ({ schema: e, name: t, description: n }) => {
1909
- let r = $r(e);
1908
+ let r = ei(e);
1910
1909
  return {
1911
1910
  name: "object",
1912
- responseFormat: ui(r.jsonSchema).then((e) => ({
1911
+ responseFormat: H(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 });
1918
+ let n = await li({ text: e });
1920
1919
  if (!n.success) throw new U({
1921
1920
  message: "No object generated: could not parse the response.",
1922
1921
  cause: n.error,
@@ -1925,7 +1924,7 @@ var ia = () => ({
1925
1924
  usage: t.usage,
1926
1925
  finishReason: t.finishReason
1927
1926
  });
1928
- let i = await si({
1927
+ let i = await ci({
1929
1928
  value: n.value,
1930
1929
  schema: r
1931
1930
  });
@@ -1962,10 +1961,10 @@ var ia = () => ({
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 = ei(e);
1966
1965
  return {
1967
1966
  name: "array",
1968
- responseFormat: ui(a.jsonSchema).then((e) => {
1967
+ responseFormat: H(a.jsonSchema).then((e) => {
1969
1968
  let { $schema: a, definitions: o, $defs: s, ...c } = e;
1970
1969
  return {
1971
1970
  type: "json",
@@ -1988,7 +1987,7 @@ var ia = () => ({
1988
1987
  };
1989
1988
  }),
1990
1989
  async parseCompleteOutput({ text: e }, r) {
1991
- let i = await ci({ text: e });
1990
+ let i = await li({ text: e });
1992
1991
  if (!i.success) throw new U({
1993
1992
  message: "No object generated: could not parse the response.",
1994
1993
  cause: i.error,
@@ -2000,7 +1999,7 @@ var ia = () => ({
2000
1999
  let o = i.value;
2001
2000
  if (typeof o != "object" || !o || !("elements" in o) || !Array.isArray(o.elements)) throw new U({
2002
2001
  message: "No object generated: response did not match schema.",
2003
- cause: new F({
2002
+ cause: new On({
2004
2003
  value: o,
2005
2004
  cause: "response must be an object with an elements array"
2006
2005
  }),
@@ -2024,7 +2023,7 @@ 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 ci({
2028
2027
  value: t,
2029
2028
  schema: a
2030
2029
  });
@@ -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 ci({
2055
2054
  value: e,
2056
2055
  schema: a
2057
2056
  });
@@ -2093,11 +2092,11 @@ function sa({ name: e, value: t }) {
2093
2092
  }
2094
2093
  }
2095
2094
  function ca({ value: e, minItems: t, maxItems: n }) {
2096
- if (t != null && e.length < t) return new F({
2095
+ if (t != null && e.length < t) return new On({
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 On({
2101
2100
  value: e,
2102
2101
  cause: `elements array must contain at most ${n} items`
2103
2102
  });
@@ -2120,7 +2119,7 @@ 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 });
2122
+ let r = await li({ text: t });
2124
2123
  if (!r.success) throw new U({
2125
2124
  message: "No object generated: could not parse the response.",
2126
2125
  cause: r.error,
@@ -2132,7 +2131,7 @@ var la = ({ options: e, name: t, description: n }) => ({
2132
2131
  let i = r.value;
2133
2132
  if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new U({
2134
2133
  message: "No object generated: response did not match schema.",
2135
- cause: new F({
2134
+ cause: new On({
2136
2135
  value: i,
2137
2136
  cause: "response must be an object that contains a choice value."
2138
2137
  }),
@@ -2166,7 +2165,7 @@ 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 });
2168
+ let n = await li({ text: e });
2170
2169
  if (!n.success) throw new U({
2171
2170
  message: "No object generated: could not parse the response.",
2172
2171
  cause: n.error,
@@ -2188,10 +2187,10 @@ 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
  });
@@ -2232,7 +2231,7 @@ function ma({ status: e, statusText: t, headers: n, stream: r, consumeSseStream:
2232
2231
  headers: da(n, pa)
2233
2232
  });
2234
2233
  }
2235
- var ha = W.record(W.string(), Ii.optional()), ga = Xr(() => ai(W.union([
2234
+ var ha = W.record(W.string(), Ii.optional()), ga = Zr(() => oi(W.union([
2236
2235
  W.looseObject({
2237
2236
  type: W.literal("text-start"),
2238
2237
  id: W.string(),
@@ -2549,7 +2548,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2549
2548
  async function h(e) {
2550
2549
  if (e != null) {
2551
2550
  let n = r.message.metadata == null ? e : Fi(r.message.metadata, e);
2552
- t != null && await oi({
2551
+ t != null && await si({
2553
2552
  value: n,
2554
2553
  schema: t,
2555
2554
  context: {
@@ -2862,7 +2861,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2862
2861
  default: if (_a(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 si({
2866
2865
  value: e.data,
2867
2866
  schema: n[e.type],
2868
2867
  context: {
@@ -2901,25 +2900,25 @@ 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
+ }), W.record(W.string(), Ii.optional()), W.record(W.string(), W.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
  });
@@ -2945,7 +2944,7 @@ 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
2950
  }), W.object({
@@ -2965,7 +2964,7 @@ I({
2965
2964
  description: W.string().optional(),
2966
2965
  parameters: W.record(W.string(), W.unknown())
2967
2966
  })).optional()
2968
- }), I({
2967
+ }), F({
2969
2968
  prefix: "call",
2970
2969
  size: 24
2971
2970
  });
@@ -2981,7 +2980,7 @@ async function ka({ response: e, url: t, fallbackMessage: n }) {
2981
2980
  }
2982
2981
  async function Aa(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
  });
@@ -3009,9 +3008,9 @@ var Ma = class {
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 H(this.body), r = await H(this.headers), i = await H(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,
@@ -3051,9 +3050,9 @@ var Ma = class {
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 H(this.body), n = await H(this.headers), r = await H(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,7 +3063,7 @@ 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 ?? ja(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,
@@ -3084,7 +3083,7 @@ var Ma = class {
3084
3083
  super(e);
3085
3084
  }
3086
3085
  processResponseStream(e) {
3087
- return li({
3086
+ return ui({
3088
3087
  stream: e,
3089
3088
  schema: ga
3090
3089
  }).pipeThrough(new TransformStream({ async transform(e, t) {
@@ -3093,7 +3092,7 @@ var Ma = class {
3093
3092
  } }));
3094
3093
  }
3095
3094
  }, 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 }) {
3095
+ constructor({ generateId: e = qn, id: t = e(), transport: n = new Na(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
3097
3096
  this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new Oa(), this.sendMessage = async (e, t) => {
3098
3097
  if (e == null) {
3099
3098
  await this.makeRequest({
@@ -3376,7 +3375,7 @@ 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
+ })), q = /* @__PURE__ */ e(o(), 1), Ra = /* @__PURE__ */ e(La(), 1), J = Ge(), za = (e, t, n) => {
3380
3379
  if (!t.has(e)) throw TypeError("Cannot " + n);
3381
3380
  }, Y = (e, t, n) => (za(e, t, "read from private field"), n ? n.call(e) : t.get(e)), X = (e, t, n) => {
3382
3381
  if (t.has(e)) throw TypeError("Cannot add the same private member more than once");
@@ -3576,7 +3575,7 @@ var oo = class extends T {
3576
3575
  super(), this.store = e;
3577
3576
  }
3578
3577
  getItems() {
3579
- let e = this.store.get(he), t = [];
3578
+ let e = this.store.get(pe), t = [];
3580
3579
  for (let n of e.cellIds.inOrderIds) {
3581
3580
  let r = lo(n, e), i = r.cellOutput;
3582
3581
  if (!i) continue;
@@ -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(le.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 = Ue(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 = ae(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${Te(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => be(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 ? xe(e.errorData[0]) : e.errorData.length > 1 ? `${e.errorData.length} errors` : e.tracebackHtml ? Te(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 he("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 = ge(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 = We({
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
+ } }), Mt(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: Ee(n),
4001
4000
  apply: `@${t}`,
4002
4001
  section: {
4003
- name: Ce(n) === "dataframe" ? "Dataframe" : "Table",
4002
+ name: Ee(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: () => ue(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(re), n = e.get(ce), r = e.get(ye);
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(ie());
4113
4112
  }
4114
4113
  //#endregion
4115
4114
  //#region src/components/editor/ai/completion-utils.ts
@@ -4129,7 +4128,7 @@ 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 He(e, "dataUrl")
4133
4132
  })));
4134
4133
  }
4135
4134
  function Eo(e) {
@@ -4151,7 +4150,7 @@ var Do = (e) => {
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, J.jsx)(Be, { className: "h-3 w-3 mt-0.5" }), t[3] = r) : r = t[3];
4155
4154
  let i = n.filename || "Attachment", a;
4156
4155
  return t[4] === i ? a = t[5] : (a = /* @__PURE__ */ (0, J.jsxs)("div", {
4157
4156
  className: "flex flex-row gap-1 items-center text-xs",
@@ -4179,7 +4178,7 @@ var Do = (e) => {
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 && Re(a)) {
4183
4182
  let e = i ?? r, n;
4184
4183
  return t[8] !== l || t[9] !== a || t[10] !== e ? (n = /* @__PURE__ */ (0, J.jsx)("a", {
4185
4184
  href: a,
@@ -4343,7 +4342,7 @@ var jo = (e) => {
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, J.jsx)(me, { className: "h-3.5 w-3.5 shrink-0" }), t[6] = h) : h = t[6];
4347
4346
  let g;
4348
4347
  t[7] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ (0, J.jsx)("span", {
4349
4348
  className: "font-semibold",
@@ -4366,7 +4365,7 @@ 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, J.jsx)(ke, { className: b }), t[14] = b, t[15] = x);
4370
4369
  let S;
4371
4370
  t[16] !== c || t[17] !== x || t[18] !== v ? (S = /* @__PURE__ */ (0, J.jsxs)("button", {
4372
4371
  type: "button",
@@ -4402,15 +4401,15 @@ 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" && mt(e);
4405
+ }
4406
+ var Io = $e({
4407
+ status: Xe().default("success"),
4408
+ auth_required: qe().default(!1),
4409
+ action_url: lt().optional(),
4410
+ next_steps: lt().optional(),
4411
+ meta: lt().optional(),
4412
+ message: Xe().nullish()
4414
4413
  }), Lo = (e) => {
4415
4414
  let t = (0, N.c)(12), { data: n } = e, r;
4416
4415
  if (t[0] !== n) {
@@ -4440,7 +4439,7 @@ var Io = Xe({
4440
4439
  let m;
4441
4440
  t[10] === c ? m = t[11] : (m = c && /* @__PURE__ */ (0, J.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, J.jsx)(ve, { className: "h-3 w-3 text-(--blue-11) mt-0.5 shrink-0" }), /* @__PURE__ */ (0, J.jsx)("div", {
4444
4443
  className: "text-xs text-foreground",
4445
4444
  children: c
4446
4445
  })]
@@ -4520,7 +4519,7 @@ var Bo = {
4520
4519
  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;
4521
4520
  }
4522
4521
  default: {
4523
- Te(n);
4522
+ Oe(n);
4524
4523
  let e;
4525
4524
  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;
4526
4525
  }
@@ -4533,7 +4532,7 @@ 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 Oe(e), "";
4537
4536
  }
4538
4537
  }
4539
4538
  var Wo = (e) => {
@@ -4627,7 +4626,7 @@ var Wo = (e) => {
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 Oe(n), null;
4631
4630
  }
4632
4631
  }, Ko = (e) => {
4633
4632
  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;
@@ -4680,7 +4679,7 @@ 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 Oe(r), null;
4684
4683
  }
4685
4684
  }, qo = ({ message: e, isStreamingReasoning: t, isLast: n, isActive: i, addToolApprovalResponse: a }) => {
4686
4685
  return /* @__PURE__ */ (0, J.jsx)(J.Fragment, { children: e.parts.map((e, t) => o(e, t)) });
@@ -4724,12 +4723,12 @@ var Wo = (e) => {
4724
4723
  isActive: i
4725
4724
  }, s);
4726
4725
  case "source-document": return /* @__PURE__ */ (0, J.jsx)(Oo, {
4727
- icon: /* @__PURE__ */ (0, J.jsx)(me, { className: "h-3 w-3 shrink-0" }),
4726
+ icon: /* @__PURE__ */ (0, J.jsx)(we, { className: "h-3 w-3 shrink-0" }),
4728
4727
  title: o.title,
4729
4728
  subtitle: o.filename
4730
4729
  }, s);
4731
4730
  case "source-url": return /* @__PURE__ */ (0, J.jsx)(Oo, {
4732
- icon: /* @__PURE__ */ (0, J.jsx)(be, { className: "h-3 w-3 shrink-0" }),
4731
+ icon: /* @__PURE__ */ (0, J.jsx)(fe, { 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
@@ -4739,7 +4738,7 @@ var Wo = (e) => {
4739
4738
  children: o.kind
4740
4739
  }, s);
4741
4740
  case "step-start": return null;
4742
- default: return Te(o), null;
4741
+ default: return Oe(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 yt.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 = xt.define(), $o = xt.define(), es = 50, ts = kt.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(wt.of([{
4819
4818
  key: "ArrowUp",
4820
4819
  run: ns
4821
4820
  }, {
@@ -4825,7 +4824,7 @@ function is(e = {}) {
4825
4824
  }
4826
4825
  //#endregion
4827
4826
  //#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({
4827
+ var as = xt.define(), Q = kt.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 = kt.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 = xt.define();
4852
+ kt.define({
4854
4853
  create() {
4855
4854
  return /* @__PURE__ */ new Map();
4856
4855
  },
@@ -4898,7 +4897,7 @@ function $(e) {
4898
4897
  }
4899
4898
  //#endregion
4900
4899
  //#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 {
4900
+ var us = class extends Dt {
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 Dt {
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(Ct.replace({ widget: new us(s, e) }).range(a, a + i[0].length)) : n.push(Ct.replace({ widget: new ds(o, e) }).range(a, a + i[0].length));
4943
4942
  }
4944
4943
  }
4945
- return bt.set(n);
4944
+ return Ct.set(n);
4946
4945
  }
4947
- var ps = Tt.fromClass(class {
4946
+ var ps = Ot.fromClass(class {
4948
4947
  decorations;
4949
4948
  constructor(e) {
4950
4949
  this.decorations = fs(e);
@@ -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 Et((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,
@@ -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 = Tt.transactionFilter.of((e) => {
5057
+ let t = e.annotation(St.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 Ot.fromClass(Os(e, t));
5241
5240
  }
5242
5241
  //#endregion
5243
5242
  //#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({
5243
+ var As = vt.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
+ bt.high(wt.of([{
5278
5277
  key: "Tab",
5279
5278
  preventDefault: !0,
5280
- run: (e) => Ot(e)
5279
+ run: (e) => jt(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
+ Se("marimo:ai-language", "python", de);
5307
+ var Ls = "marimo:ai-prompt-history", Rs = new se(nt(Xe()), () => []), zs = (e) => {
5308
+ 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 = gt(), { theme: _ } = _t(), 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 = ht(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 = Pt();
5313
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (b = Nt({}), 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 = Ft(), 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 = bt.highest(wt.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 = wt.of([{
5353
5352
  key: "Escape",
5354
5353
  preventDefault: !0,
5355
5354
  stopPropagation: !0,
@@ -5362,7 +5361,7 @@ 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
+ vt.lineWrapping,
5366
5365
  T,
5367
5366
  E,
5368
5367
  D
@@ -5370,7 +5369,7 @@ var Ls = "marimo:ai-prompt-history", Rs = new ae($e(qe()), () => []), zs = (e) =
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
5371
  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, {
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] !== j || t[33] !== n ? (te = /* @__PURE__ */ (0, J.jsx)(It, {
5374
5373
  ref: a,
5375
5374
  className: A,
5376
5375
  width: "100%",
@@ -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 = Qe({
5395
+ type: Je("stream_chunk"),
5396
+ message_id: Xe(),
5397
+ content: lt().nullable().transform((e) => e),
5398
+ is_final: qe().optional()
5400
5399
  });
5401
5400
  function Ws(e, t) {
5402
5401
  let { controllerRef: n, activeRequestIdRef: i } = t, a = n.current;
@@ -5414,7 +5413,7 @@ var Gs = (e) => {
5414
5413
  y.current = s;
5415
5414
  let b = (0, q.useRef)(null), x = (0, q.useRef)(null), S = (0, q.useRef)(null), [C, w] = (0, q.useState)(null), T = () => {
5416
5415
  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({
5416
+ }, { data: D } = Lt(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: re, clearError: ie, addToolApprovalResponse: ae } = eo({
5418
5417
  sendAutomaticallyWhen: ({ messages: e }) => Eo(e),
5419
5418
  transport: new Na({ fetch: async (t, n) => {
5420
5419
  if (n === void 0) return fetch(t);
@@ -5430,7 +5429,7 @@ var Gs = (e) => {
5430
5429
  let t = i.messages.map((e) => ({
5431
5430
  ...e,
5432
5431
  content: e.parts?.map((e) => "text" in e ? e.text : "").join("\n")
5433
- })), n = re();
5432
+ })), n = _e();
5434
5433
  T();
5435
5434
  let s = new ReadableStream({
5436
5435
  start(t) {
@@ -5490,7 +5489,7 @@ var Gs = (e) => {
5490
5489
  r.error("An error occurred:", e);
5491
5490
  }
5492
5491
  });
5493
- n(e.host, Re.TYPE, (e) => {
5492
+ n(e.host, Ve.TYPE, (e) => {
5494
5493
  let t = Us.safeParse(e.detail.message);
5495
5494
  if (t.success) {
5496
5495
  if (t.data.content && t.data.message_id === x.current) {
@@ -5503,30 +5502,30 @@ var Gs = (e) => {
5503
5502
  });
5504
5503
  }
5505
5504
  });
5506
- let se = j === "submitted" || j === "streaming", ce = (t) => {
5505
+ let oe = j === "submitted" || j === "streaming", se = (t) => {
5507
5506
  let n = k.findIndex((e) => e.id === t);
5508
5507
  if (n !== -1) {
5509
5508
  let r = k.filter((e) => e.id !== t);
5510
5509
  e.delete_chat_message({ index: n }), ee(r), e.setValue(r), r.length === 0 && T();
5511
5510
  }
5512
- }, le = Array.isArray(e.allowAttachments) && e.allowAttachments.length > 0 || e.allowAttachments === !0, ue = {
5511
+ }, ce = Array.isArray(e.allowAttachments) && e.allowAttachments.length > 0 || e.allowAttachments === !0, le = {
5513
5512
  triggerCompletionRegex: /^\/(\w+)?/,
5514
5513
  completions: e.prompts.map((e) => ({
5515
5514
  label: `/${e}`,
5516
5515
  displayLabel: e,
5517
5516
  apply: e
5518
5517
  }))
5519
- }, fe = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
5518
+ }, ue = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
5520
5519
  (0, q.useEffect)(() => {
5521
5520
  v.current?.scrollTo({
5522
5521
  top: v.current.scrollHeight,
5523
5522
  behavior: "smooth"
5524
5523
  });
5525
5524
  }, [k.length, v]);
5526
- let pe = _.current?.view, me = () => {
5527
- if (pe) {
5528
- let e = pe.state.doc.length;
5529
- pe.dispatch({ changes: {
5525
+ let de = _.current?.view, fe = () => {
5526
+ if (de) {
5527
+ let e = de.state.doc.length;
5528
+ de.dispatch({ changes: {
5530
5529
  from: 0,
5531
5530
  to: e,
5532
5531
  insert: ""
@@ -5545,7 +5544,7 @@ var Gs = (e) => {
5545
5544
  size: "icon",
5546
5545
  disabled: k.length === 0,
5547
5546
  onClick: () => {
5548
- ee([]), e.setValue([]), e.delete_chat_history({}), ae(), T();
5547
+ ee([]), e.setValue([]), e.delete_chat_history({}), ie(), T();
5549
5548
  },
5550
5549
  children: /* @__PURE__ */ (0, J.jsx)(Ut, { className: "h-3 w-3" })
5551
5550
  })
@@ -5578,8 +5577,8 @@ var Gs = (e) => {
5578
5577
  message: e,
5579
5578
  isStreamingReasoning: j === "streaming",
5580
5579
  isLast: r,
5581
- isActive: se,
5582
- addToolApprovalResponse: r ? oe : void 0
5580
+ isActive: oe,
5581
+ addToolApprovalResponse: r ? ae : void 0
5583
5582
  })
5584
5583
  }), /* @__PURE__ */ (0, J.jsxs)("div", {
5585
5584
  className: "flex justify-end text-xs gap-2 invisible group-hover:visible",
@@ -5589,27 +5588,27 @@ var Gs = (e) => {
5589
5588
  buttonClassName: "text-xs text-(--slate-9) hover:text-(--slate-11)"
5590
5589
  }), /* @__PURE__ */ (0, J.jsx)("button", {
5591
5590
  type: "button",
5592
- onClick: () => ce(e.id),
5591
+ onClick: () => se(e.id),
5593
5592
  className: "text-xs text-(--slate-9) hover:text-(--slate-11)",
5594
5593
  children: /* @__PURE__ */ (0, J.jsx)(m, { className: "h-3 w-3 text-(--red-9)" })
5595
5594
  })]
5596
5595
  })]
5597
5596
  }, `${e.id}-${t}`);
5598
5597
  }),
5599
- se && /* @__PURE__ */ (0, J.jsx)("div", {
5598
+ oe && /* @__PURE__ */ (0, J.jsx)("div", {
5600
5599
  className: "flex items-center justify-center mb-4",
5601
5600
  children: /* @__PURE__ */ (0, J.jsx)(E, { size: "small" })
5602
5601
  }),
5603
5602
  M && /* @__PURE__ */ (0, J.jsxs)("div", {
5604
5603
  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, {
5604
+ children: [/* @__PURE__ */ (0, J.jsx)(ft, { error: M }), /* @__PURE__ */ (0, J.jsx)(a, {
5606
5605
  variant: "outline",
5607
5606
  size: "sm",
5608
- onClick: () => ie(),
5607
+ onClick: () => re(),
5609
5608
  children: "Retry"
5610
5609
  })]
5611
5610
  }),
5612
- C && !se && !M && /* @__PURE__ */ (0, J.jsx)("div", {
5611
+ C && !oe && !M && /* @__PURE__ */ (0, J.jsx)("div", {
5613
5612
  className: "flex justify-center py-2",
5614
5613
  children: /* @__PURE__ */ (0, J.jsx)("span", {
5615
5614
  className: "text-xs text-muted-foreground",
@@ -5628,7 +5627,7 @@ var Gs = (e) => {
5628
5627
  type: "text",
5629
5628
  text: t
5630
5629
  }, ...r ?? []]
5631
- }), me();
5630
+ }), fe();
5632
5631
  },
5633
5632
  ref: g,
5634
5633
  inert: e.disabled || void 0,
@@ -5642,13 +5641,13 @@ var Gs = (e) => {
5642
5641
  prompts: e.prompts,
5643
5642
  onSelect: (e) => {
5644
5643
  o(e), requestAnimationFrame(() => {
5645
- pe?.focus(), de(pe);
5644
+ de?.focus(), Ce(de);
5646
5645
  });
5647
5646
  }
5648
5647
  }),
5649
5648
  /* @__PURE__ */ (0, J.jsx)(zs, {
5650
5649
  className: "rounded-sm mr-2",
5651
- placeholder: fe,
5650
+ placeholder: ue,
5652
5651
  value: t,
5653
5652
  inputRef: _,
5654
5653
  maxHeight: e.maxHeight ? `${e.maxHeight / 2}px` : void 0,
@@ -5657,7 +5656,7 @@ var Gs = (e) => {
5657
5656
  t.trim() && g.current?.requestSubmit();
5658
5657
  },
5659
5658
  onClose: () => {},
5660
- additionalCompletions: ue
5659
+ additionalCompletions: le
5661
5660
  }),
5662
5661
  f && f.length === 1 && /* @__PURE__ */ (0, J.jsx)("span", {
5663
5662
  title: f[0].name,
@@ -5676,9 +5675,9 @@ var Gs = (e) => {
5676
5675
  onClick: () => {
5677
5676
  p(void 0), h.current && (h.current.value = "");
5678
5677
  },
5679
- children: /* @__PURE__ */ (0, J.jsx)(we, { className: "size-3" })
5678
+ children: /* @__PURE__ */ (0, J.jsx)(De, { className: "size-3" })
5680
5679
  }),
5681
- le && /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [/* @__PURE__ */ (0, J.jsx)(a, {
5680
+ ce && /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [/* @__PURE__ */ (0, J.jsx)(a, {
5682
5681
  type: "button",
5683
5682
  variant: "text",
5684
5683
  size: "sm",
@@ -5694,7 +5693,7 @@ var Gs = (e) => {
5694
5693
  e.target.files && p([...e.target.files]);
5695
5694
  }
5696
5695
  })] }),
5697
- se ? /* @__PURE__ */ (0, J.jsx)(ne, {
5696
+ oe ? /* @__PURE__ */ (0, J.jsx)(ne, {
5698
5697
  content: "Stop generating",
5699
5698
  children: /* @__PURE__ */ (0, J.jsx)(a, {
5700
5699
  type: "button",
@@ -5702,7 +5701,7 @@ var Gs = (e) => {
5702
5701
  size: "xs",
5703
5702
  onClick: () => te(),
5704
5703
  className: "text-(--red-9) hover:text-(--red-11)",
5705
- children: /* @__PURE__ */ (0, J.jsx)(Ie, { className: "h-4 w-4 fill-current" })
5704
+ children: /* @__PURE__ */ (0, J.jsx)(ze, { className: "h-4 w-4 fill-current" })
5706
5705
  })
5707
5706
  }) : /* @__PURE__ */ (0, J.jsx)(a, {
5708
5707
  type: "submit",
@@ -5793,19 +5792,19 @@ var Gs = (e) => {
5793
5792
  let [t, n] = e;
5794
5793
  return /* @__PURE__ */ (0, J.jsxs)("div", {
5795
5794
  className: "grid grid-cols-3 items-center gap-1",
5796
- children: [/* @__PURE__ */ (0, J.jsxs)(ut, {
5795
+ children: [/* @__PURE__ */ (0, J.jsxs)(pt, {
5797
5796
  htmlFor: t,
5798
5797
  className: "flex w-full justify-between col-span-3 align-end",
5799
- children: [De.startCase(t), /* @__PURE__ */ (0, J.jsx)(ne, {
5798
+ children: [Ae.startCase(t), /* @__PURE__ */ (0, J.jsx)(ne, {
5800
5799
  delayDuration: 200,
5801
5800
  side: "top",
5802
5801
  content: /* @__PURE__ */ (0, J.jsx)("div", {
5803
5802
  className: "text-xs flex flex-col",
5804
5803
  children: Ks[t].description
5805
5804
  }),
5806
- children: /* @__PURE__ */ (0, J.jsx)(Pe, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
5805
+ children: /* @__PURE__ */ (0, J.jsx)(Le, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
5807
5806
  })]
5808
- }), /* @__PURE__ */ (0, J.jsx)(Oe, {
5807
+ }), /* @__PURE__ */ (0, J.jsx)(je, {
5809
5808
  id: t,
5810
5809
  "aria-label": t,
5811
5810
  value: n ?? NaN,
@@ -5818,7 +5817,7 @@ var Gs = (e) => {
5818
5817
  className: "col-span-3"
5819
5818
  })]
5820
5819
  }, t);
5821
- }, t[9] = c, t[10] = e), h = Dt.entries(n).map(e), t[6] = n, t[7] = c, t[8] = h;
5820
+ }, t[9] = c, t[10] = e), h = At.entries(n).map(e), t[6] = n, t[7] = c, t[8] = h;
5822
5821
  } else h = t[8];
5823
5822
  let g;
5824
5823
  t[11] === h ? g = t[12] : (g = /* @__PURE__ */ (0, J.jsx)(p, {
@@ -5842,7 +5841,7 @@ var Gs = (e) => {
5842
5841
  let u = l, d;
5843
5842
  t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, J.jsx)(ne, {
5844
5843
  content: "Select a prompt",
5845
- children: /* @__PURE__ */ (0, J.jsx)(ke, {
5844
+ children: /* @__PURE__ */ (0, J.jsx)(Me, {
5846
5845
  asChild: !0,
5847
5846
  children: /* @__PURE__ */ (0, J.jsx)(a, {
5848
5847
  variant: "outline",
@@ -5855,14 +5854,14 @@ var Gs = (e) => {
5855
5854
  let f;
5856
5855
  if (t[3] !== u || t[4] !== n) {
5857
5856
  let e;
5858
- t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, J.jsx)(je, {
5857
+ t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, J.jsx)(Pe, {
5859
5858
  onSelect: () => u(e),
5860
5859
  className: "whitespace-normal text-left",
5861
5860
  children: e
5862
5861
  }, t), t[6] = u, t[7] = e), f = n.map(e), t[3] = u, t[4] = n, t[5] = f;
5863
5862
  } else f = t[5];
5864
5863
  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, {
5864
+ t[8] === f ? m = t[9] : (m = /* @__PURE__ */ (0, J.jsx)(Hs, { children: /* @__PURE__ */ (0, J.jsxs)(Ie, { children: [d, /* @__PURE__ */ (0, J.jsx)(Fe, {
5866
5865
  side: "right",
5867
5866
  align: "end",
5868
5867
  onCloseAutoFocus: Xs,
@@ -5923,11 +5922,11 @@ var Gs = (e) => {
5923
5922
  let [n, r] = e;
5924
5923
  return /* @__PURE__ */ (0, J.jsxs)("div", {
5925
5924
  className: "grid grid-cols-4 items-center gap-2",
5926
- children: [/* @__PURE__ */ (0, J.jsx)(ut, {
5925
+ children: [/* @__PURE__ */ (0, J.jsx)(pt, {
5927
5926
  htmlFor: n,
5928
5927
  className: "font-semibold text-base",
5929
5928
  children: n
5930
- }), /* @__PURE__ */ (0, J.jsx)(Ae, {
5929
+ }), /* @__PURE__ */ (0, J.jsx)(Ne, {
5931
5930
  id: n,
5932
5931
  value: r,
5933
5932
  onChange: (e) => f(n, e.target.value),