@redocly/replay 0.27.0-next.9 → 0.27.0

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 (69) hide show
  1. package/dist/{replay-AiChatProvider-B94RnQsz.js → replay-AiChatProvider-LQhrLIDL.js} +44 -44
  2. package/dist/{replay-AiChatProvider-P2u2MtTk.js → replay-AiChatProvider-Oms5CFgT.js} +1 -1
  3. package/dist/{replay-AiChatSqliteDBStorage-z_QUPu2M.js → replay-AiChatSqliteDBStorage-3-p1mthX.js} +1 -1
  4. package/dist/{replay-AiChatSqliteDBStorage-BtTa9KkQ.js → replay-AiChatSqliteDBStorage-GZibdHOQ.js} +1 -1
  5. package/dist/replay-AiPanel-BvwwBTh1.js +742 -0
  6. package/dist/{replay-AiPanel-BCkDovN_.js → replay-AiPanel-lcDNvgo0.js} +973 -1176
  7. package/dist/replay-FileWatcher-ClVd_wG0.js +1 -0
  8. package/dist/replay-FileWatcher-DR-wJLe2.js +343 -0
  9. package/dist/replay-Observable-D6wKbFwB.js +31 -0
  10. package/dist/replay-Observable-bjJ6wkRB.js +1 -0
  11. package/dist/replay-SemanticSearchService-CCqwCRo6.js +1 -0
  12. package/dist/replay-SemanticSearchService-U1eXQGfF.js +723 -0
  13. package/dist/{replay-SqliteDBStorage-DMxFWJQ7.js → replay-SqliteDBStorage-Dn6DoVWW.js} +1 -1
  14. package/dist/{replay-SqliteDBStorage-D9b6LAKr.js → replay-SqliteDBStorage-d_ZK6ScA.js} +1 -1
  15. package/dist/replay-TauriFileSystemAdapter-CpiUuG3T.js +99 -0
  16. package/dist/replay-TauriFileSystemAdapter-dwJ0xBYr.js +1 -0
  17. package/dist/replay-TauriRootStorage-CuVbYMXX.js +605 -0
  18. package/dist/replay-TauriRootStorage-DhzbAahU.js +1 -0
  19. package/dist/{replay-agent-loop-C2QNfRSA.js → replay-agent-loop-BLSu4v_O.js} +1 -1
  20. package/dist/{replay-agent-loop-C8ERLqB5.js → replay-agent-loop-DgEHdXUt.js} +11 -11
  21. package/dist/{replay-ai-chat-mappers-fViZvzIy.js → replay-ai-chat-mappers-BvfcEubB.js} +5 -5
  22. package/dist/{replay-ai-chat-mappers-BMhtm64Y.js → replay-ai-chat-mappers-Dy2kJ7ZG.js} +1 -1
  23. package/dist/replay-core-BJmXmoC5.js +1 -0
  24. package/dist/replay-core-B_hiOZZr.js +10 -0
  25. package/dist/{replay-create-model-BhuazQ2q.js → replay-create-model-DNPFcOIp.js} +579 -578
  26. package/dist/{replay-create-model-BgR6vFGV.js → replay-create-model-bOIDB-e8.js} +10 -10
  27. package/dist/{replay-db-DAiJFj0l.js → replay-db-BQGv3PGw.js} +1 -1
  28. package/dist/{replay-db-DKzJowQC.js → replay-db-CMXZZs9v.js} +1 -1
  29. package/dist/{replay-external-resolver-UONYkON2.js → replay-external-resolver-mrykFC2h.js} +2 -2
  30. package/dist/{replay-external-resolver-BY6AAeGp.js → replay-external-resolver-n5OvQMRF.js} +1 -1
  31. package/dist/replay-index-3lwhSmvi.js +1 -0
  32. package/dist/{replay-index-BowK-_3Z.js → replay-index-Bc5RHu5L.js} +23698 -25407
  33. package/dist/replay-index-CFLu-XMV.js +25 -0
  34. package/dist/{replay-index-DWKlhkdU.js → replay-index-CHGVyIdG.js} +1 -1
  35. package/dist/replay-index-CSR_qlua.js +1 -0
  36. package/dist/replay-index-CepJ5Z0m.js +6875 -0
  37. package/dist/{replay-index-amF_dPN8.js → replay-index-CgCGhu4l.js} +6 -6
  38. package/dist/replay-index-DDjmUXWm.js +1 -0
  39. package/dist/{replay-index-DM12kT-D.js → replay-index-DiSy_1OY.js} +1 -1
  40. package/dist/replay-index-Oct6Dygd.js +1 -0
  41. package/dist/{replay-index-BubK_s3I.js → replay-index-QXosJxRc.js} +18 -18
  42. package/dist/replay-index-jkDlU0Lx.js +32 -0
  43. package/dist/{replay-lint-CAN3a2zf.js → replay-lint-DoHQIATV.js} +3 -3
  44. package/dist/{replay-lint-a0aMVdOC.js → replay-lint-PWaLESz5.js} +3 -3
  45. package/dist/{replay-lint-graphql-C3aqm51r.js → replay-lint-graphql-xh8VoAwd.js} +1 -1
  46. package/dist/{replay-lint-graphql-DnztHI0i.js → replay-lint-graphql-zO8zunug.js} +1 -1
  47. package/dist/replay-periodic-revalidation-BoyLQHtg.js +1 -0
  48. package/dist/replay-periodic-revalidation-Dsp-n7ui.js +21 -0
  49. package/dist/replay-promise-map-limit-DRDkHc-b.js +1 -0
  50. package/dist/replay-promise-map-limit-Db_42GvV.js +14 -0
  51. package/dist/replay-resolve-B0AjmaE9.js +47 -0
  52. package/dist/{replay-resolve-LjvT95Yw.js → replay-resolve-MVe_8Ube.js} +1104 -1094
  53. package/dist/{replay-respect-run-DLSZ4d4p.js → replay-respect-run-BJsR4a4m.js} +1 -1
  54. package/dist/{replay-respect-run-wqqp8WHA.js → replay-respect-run-X4PSO6Fj.js} +3 -3
  55. package/dist/{replay-tauri-path-Bg-T0cwI.js → replay-tauri-path-CkGiQWsb.js} +2 -2
  56. package/dist/{replay-tauri-path-DHZlqqfb.js → replay-tauri-path-D8FJsoZb.js} +1 -1
  57. package/dist/replay-useAiChatQueries-BXL-_N2Q.js +215 -0
  58. package/dist/{replay-useAiChatQueries-Dy-kPGKF.js → replay-useAiChatQueries-D7sHNAfV.js} +1078 -1022
  59. package/dist/{replay-validate-key-B2N6AiQk.js → replay-validate-key-CmzSfORv.js} +1 -1
  60. package/dist/{replay-validate-key-B7RBY-6z.js → replay-validate-key-CtZEJRP7.js} +2 -2
  61. package/dist/replay.cjs +1 -1
  62. package/dist/replay.js +12 -12
  63. package/package.json +5 -4
  64. package/dist/replay-AiPanel-COL9ADyD.js +0 -868
  65. package/dist/replay-index-ClVtMDHn.js +0 -6899
  66. package/dist/replay-index-F528jCaH.js +0 -1
  67. package/dist/replay-index-fpeoVNQb.js +0 -1
  68. package/dist/replay-resolve-BoryNVbu.js +0 -47
  69. package/dist/replay-useAiChatQueries-DuNxx5rQ.js +0 -215
@@ -1,110 +1,101 @@
1
- import { jsx as i, jsxs as h, Fragment as Ne } from "react/jsx-runtime";
2
- import { useCallback as D, useMemo as A, useState as G, Fragment as mt, useRef as N, useEffect as H, useLayoutEffect as Fe, createContext as yt, useContext as xt } from "react";
3
- import c, { css as X, keyframes as bt } from "styled-components";
4
- import { G as je, T as te, H as Ce, J as wt, b as Ct, m as We, i as kt, j as Tt, K as It, L as ge, N as ve, O as M, P as be, Q as At, U as St, V as Ue, W as Lt, X as Pt, R as me, E as pe, Y as ke, Z as Ye, p as Ge, _ as we, $ as W, a0 as Et } from "./replay-index-BowK-_3Z.js";
5
- import { l as Rt, n as Ot, p as $t, q as Dt, T as zt, t as Mt, v as _t, x as qe, C as k, y as Vt, z as Ke, L as Bt, B as Q, D as Ht, E as Nt, F as Ft, G as jt, H as F } from "./replay-useAiChatQueries-Dy-kPGKF.js";
6
- import { AI_SEARCH_MAX_MESSAGE_LENGTH as Wt, Button as B, SubtractIcon as Ut, AddIcon as Yt, CheckmarkFilledIcon as Gt, CloseFilledIcon as qt, CheckboxIcon as Kt, capitalize as re, ChevronDownIcon as Zt, ChevronRightIcon as Jt, SettingsCogIcon as Xt, Dropdown as Qt, DropdownMenu as en, DropdownMenuItem as Ze, CheckmarkIcon as tn, ClaudeIcon as nn, GeminiIcon as on, ChatGptIcon as rn, Tooltip as U, Typography as se, TrashCanIcon as an, AiStarsGradientIcon as sn, NewChatIcon as cn, RecentlyViewedIcon as ln, CloseIcon as dn, ArrowLeftIcon as un } from "@redocly/theme";
7
- import { M as z } from "./replay-db-DKzJowQC.js";
1
+ import { jsxs as h, jsx as i, Fragment as Ne } from "react/jsx-runtime";
2
+ import { useCallback as _, useMemo as A, useState as G, Fragment as gt, useRef as F, useEffect as B, useLayoutEffect as je } from "react";
3
+ import c, { css as pe } from "styled-components";
4
+ import { T as te, a3 as Te, a4 as mt, h as vt, x as Ue, q as yt, s as xt, a5 as wt, a6 as he, a7 as ge, a8 as V, a9 as be, aa as bt, ab as Ct, ac as We, ad as Tt, ae as kt, F as me, V as ue, af as Ye, C as Ge, ag as Ce, ah as U, ai as It } from "./replay-index-Bc5RHu5L.js";
5
+ import { l as At, n as St, p as Lt, q as Pt, T as Et, t as Rt, v as Ot, x as qe, C as I, y as Dt, z as Ke, L as Mt, B as Q, D as _t, E as zt, F as Vt, G as $t, H as N } from "./replay-useAiChatQueries-D7sHNAfV.js";
6
+ import { AI_SEARCH_MAX_MESSAGE_LENGTH as Ht } from "@redocly/theme/core/constants/search";
7
+ import { Button as P } from "@redocly/theme/components/Button/Button";
8
+ import { SendIcon as Bt } from "@redocly/theme/icons/SendIcon/SendIcon";
9
+ import { StopIcon as Ft } from "@redocly/theme/icons/StopIcon/StopIcon";
10
+ import { M as z } from "./replay-db-CMXZZs9v.js";
11
+ import { CheckboxIcon as Nt } from "@redocly/theme/icons/CheckboxIcon/CheckboxIcon";
12
+ import { CheckmarkFilledIcon as jt } from "@redocly/theme/icons/CheckmarkFilledIcon/CheckmarkFilledIcon";
13
+ import { CloseFilledIcon as Ut } from "@redocly/theme/icons/CloseFilledIcon/CloseFilledIcon";
14
+ import { AddIcon as Wt } from "@redocly/theme/icons/AddIcon/AddIcon";
15
+ import { SubtractIcon as Yt } from "@redocly/theme/icons/SubtractIcon/SubtractIcon";
16
+ import { capitalize as oe } from "@redocly/theme/core/utils";
17
+ import { ChevronDownIcon as Gt } from "@redocly/theme/icons/ChevronDownIcon/ChevronDownIcon";
18
+ import { ChevronRightIcon as qt } from "@redocly/theme/icons/ChevronRightIcon/ChevronRightIcon";
19
+ import { Dropdown as Kt } from "@redocly/theme/components/Dropdown/Dropdown";
20
+ import { DropdownMenu as Jt } from "@redocly/theme/components/Dropdown/DropdownMenu";
21
+ import { DropdownMenuItem as Je } from "@redocly/theme/components/Dropdown/DropdownMenuItem";
22
+ import { CheckmarkIcon as Xt } from "@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon";
23
+ import { SettingsCogIcon as Zt } from "@redocly/theme/icons/SettingsCogIcon/SettingsCogIcon";
24
+ import { ChatGptIcon as Qt } from "@redocly/theme/icons/ChatGptIcon/ChatGptIcon";
25
+ import { GeminiIcon as en } from "@redocly/theme/icons/GeminiIcon/GeminiIcon";
26
+ import { ClaudeIcon as tn } from "@redocly/theme/icons/ClaudeIcon/ClaudeIcon";
27
+ import { Tooltip as W } from "@redocly/theme/components/Tooltip/Tooltip";
28
+ import { g as ke } from "./replay-SemanticSearchService-U1eXQGfF.js";
8
29
  import "@tanstack/react-query";
9
- import { Link as fn } from "react-router";
10
- const pn = (e) => /* @__PURE__ */ i(
11
- "svg",
12
- {
13
- width: "16",
14
- height: "16",
15
- viewBox: "0 0 16 16",
16
- fill: "none",
17
- xmlns: "http://www.w3.org/2000/svg",
18
- ...e,
19
- children: /* @__PURE__ */ i(
20
- "path",
21
- {
22
- d: "M13.0094 7.61066L3.38435 2.79816C3.30892 2.76043 3.22418 2.74532 3.14035 2.75463C3.05652 2.76394 2.97717 2.79729 2.91186 2.85066C2.84948 2.90294 2.80292 2.97158 2.77742 3.04886C2.75191 3.12615 2.74847 3.20902 2.76748 3.28816L3.92685 7.56253H8.87498V8.43753H3.92685L2.74998 12.6988C2.73214 12.7649 2.73006 12.8342 2.7439 12.9013C2.75774 12.9683 2.78712 13.0312 2.82968 13.0848C2.87223 13.1384 2.92677 13.1813 2.98891 13.21C3.05106 13.2387 3.11907 13.2524 3.18748 13.25C3.25597 13.2496 3.3234 13.2331 3.38435 13.2019L13.0094 8.38941C13.081 8.35269 13.1412 8.29692 13.1832 8.22821C13.2252 8.15951 13.2474 8.08055 13.2474 8.00003C13.2474 7.91951 13.2252 7.84056 13.1832 7.77185C13.1412 7.70315 13.081 7.64737 13.0094 7.61066Z",
23
- fill: "white"
24
- }
25
- )
26
- }
27
- ), hn = c(pn).attrs({
28
- "data-component-name": "icons/SendIcon/SendIcon"
29
- })`
30
- path {
31
- fill: ${({ color: e }) => je(e)};
32
- }
33
-
34
- height: ${({ size: e }) => e || "16px"};
35
- width: ${({ size: e }) => e || "16px"};
36
- `, gn = (e) => /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 14 14", fill: "none", ...e, children: /* @__PURE__ */ i("path", { d: "M10.5 3.5V10.5H3.5V3.5H10.5ZM10.5 2.625H3.5C3.26794 2.625 3.04538 2.71719 2.88128 2.88128C2.71719 3.04538 2.625 3.26794 2.625 3.5V10.5C2.625 10.7321 2.71719 10.9546 2.88128 11.1187C3.04538 11.2828 3.26794 11.375 3.5 11.375H10.5C10.7321 11.375 10.9546 11.2828 11.1187 11.1187C11.2828 10.9546 11.375 10.7321 11.375 10.5V3.5C11.375 3.26794 11.2828 3.04538 11.1187 2.88128C10.9546 2.71719 10.7321 2.625 10.5 2.625Z" }) }), vn = c(gn).attrs({
37
- "data-component-name": "icons/StopIcon/StopIcon"
38
- })`
39
- path {
40
- fill: ${({ color: e }) => je(e)};
41
- }
42
-
43
- height: ${({ size: e }) => e || "16px"};
44
- width: ${({ size: e }) => e || "16px"};
45
- `;
46
- function mn({
30
+ import { Typography as Z } from "@redocly/theme/components/Typography/Typography";
31
+ import { TrashCanIcon as nn } from "@redocly/theme/icons/TrashCanIcon/TrashCanIcon";
32
+ import { AiStarsGradientIcon as rn } from "@redocly/theme/icons/AiStarsGradientIcon/AiStarsGradientIcon";
33
+ import { CloseIcon as on } from "@redocly/theme/icons/CloseIcon/CloseIcon";
34
+ import { NewChatIcon as an } from "@redocly/theme/icons/NewChatIcon/NewChatIcon";
35
+ import { RecentlyViewedIcon as sn } from "@redocly/theme/icons/RecentlyViewedIcon/RecentlyViewedIcon";
36
+ import { ArrowLeftIcon as cn } from "@redocly/theme/icons/ArrowLeftIcon/ArrowLeftIcon";
37
+ function ln({
47
38
  placeholder: e = "Ask anything...",
48
39
  className: t,
49
40
  disabled: n,
50
- isStreaming: o = !1,
51
- onStop: r,
41
+ isStreaming: r = !1,
42
+ onStop: o,
52
43
  modelSelector: a,
53
44
  value: s,
54
45
  onValueChange: d,
55
46
  onSubmit: l,
56
47
  textareaRef: u
57
48
  }) {
58
- const f = s.trim(), p = !n && f.length > 0 && !o, g = !n && f.length > 0, m = (w) => {
49
+ const f = s.trim(), p = !n && f.length > 0 && !r, g = !n && f.length > 0, y = (w) => {
59
50
  d(w.target.value);
60
- }, v = () => {
61
- !f || n || o || l();
51
+ }, m = () => {
52
+ !f || n || r || l();
62
53
  }, x = () => {
63
- !o || !r || r();
54
+ !r || !o || o();
64
55
  };
65
- return /* @__PURE__ */ h(yn, { className: t, $isActive: g, children: [
56
+ return /* @__PURE__ */ h(dn, { className: t, $isActive: g, children: [
66
57
  /* @__PURE__ */ i(
67
- xn,
58
+ un,
68
59
  {
69
60
  ref: u,
70
61
  rows: 1,
71
- maxLength: Wt,
62
+ maxLength: Ht,
72
63
  placeholder: e,
73
64
  value: s,
74
65
  disabled: n,
75
66
  spellCheck: !1,
76
- onChange: m,
67
+ onChange: y,
77
68
  onKeyDown: (w) => {
78
- w.key === "Enter" && !w.shiftKey && !w.nativeEvent.isComposing && (w.preventDefault(), o && r ? x() : v());
69
+ w.key === "Enter" && !w.shiftKey && !w.nativeEvent.isComposing && (w.preventDefault(), r && o ? x() : m());
79
70
  }
80
71
  }
81
72
  ),
82
- /* @__PURE__ */ h(bn, { children: [
73
+ /* @__PURE__ */ h(fn, { children: [
83
74
  a,
84
- o && r ? /* @__PURE__ */ i(
85
- Cn,
75
+ r && o ? /* @__PURE__ */ i(
76
+ hn,
86
77
  {
87
78
  type: "button",
88
79
  size: "small",
89
80
  "aria-label": "Stop generating",
90
- icon: /* @__PURE__ */ i(vn, { color: "var(--icon-color-on-color)" }),
81
+ icon: /* @__PURE__ */ i(Ft, { color: "var(--icon-color-on-color)" }),
91
82
  onClick: x
92
83
  }
93
84
  ) : /* @__PURE__ */ i(
94
- wn,
85
+ pn,
95
86
  {
96
87
  type: "button",
97
88
  size: "small",
98
89
  "aria-label": "Send message",
99
- icon: /* @__PURE__ */ i(hn, { color: "var(--icon-color-on-color)" }),
100
- onClick: v,
90
+ icon: /* @__PURE__ */ i(Bt, { color: "var(--icon-color-on-color)" }),
91
+ onClick: m,
101
92
  disabled: !p
102
93
  }
103
94
  )
104
95
  ] })
105
96
  ] });
106
97
  }
107
- const yn = c.div`
98
+ const dn = c.div`
108
99
  display: flex;
109
100
  flex-direction: column;
110
101
  gap: var(--spacing-xs);
@@ -123,13 +114,13 @@ const yn = c.div`
123
114
  var(--replay-ai-gradient-soft) border-box;
124
115
  }
125
116
 
126
- ${({ $isActive: e }) => e && X`
117
+ ${({ $isActive: e }) => e && pe`
127
118
  border-color: transparent;
128
119
  background:
129
120
  linear-gradient(var(--layer-color), var(--layer-color)) padding-box,
130
121
  var(--replay-ai-gradient-soft) border-box;
131
122
  `}
132
- `, xn = c.textarea`
123
+ `, un = c.textarea`
133
124
  max-height: 150px;
134
125
  min-height: var(--search-ai-conversation-input-min-height);
135
126
 
@@ -149,12 +140,12 @@ const yn = c.div`
149
140
  color: var(--text-color-helper);
150
141
  text-indent: 2px;
151
142
  }
152
- `, bn = c.div`
143
+ `, fn = c.div`
153
144
  display: flex;
154
145
  justify-content: space-between;
155
146
  align-items: center;
156
147
  gap: var(--spacing-xs);
157
- `, wn = c(B)`
148
+ `, pn = c(P)`
158
149
  box-sizing: border-box;
159
150
  background: var(--search-ai-gradient);
160
151
 
@@ -164,26 +155,26 @@ const yn = c.div`
164
155
  width: 24px;
165
156
  height: 24px;
166
157
  }
167
- `, Cn = c(B)`
158
+ `, hn = c(P)`
168
159
  box-sizing: border-box;
169
160
  background: var(--color-warm-grey-9);
170
161
  border-radius: var(--border-radius-xxl);
171
- `, kn = /* @__PURE__ */ new Set(["collection", "workflow", "step", "operation", "workflow-run"]);
172
- function Je(e) {
162
+ `, gn = /* @__PURE__ */ new Set(["collection", "workflow", "step", "operation", "workflow-run"]);
163
+ function ve(e) {
173
164
  return `replay://step?${new URLSearchParams({
174
165
  collectionId: e.collectionId.trim(),
175
166
  workflowId: e.workflowId.trim(),
176
167
  stepId: e.stepId.trim()
177
168
  }).toString()}`;
178
169
  }
179
- function O(e, t) {
170
+ function D(e, t) {
180
171
  const n = e.get(t);
181
172
  if (n == null)
182
173
  return null;
183
- const o = n.trim();
184
- return o.length > 0 ? o : null;
174
+ const r = n.trim();
175
+ return r.length > 0 ? r : null;
185
176
  }
186
- function Tn(e) {
177
+ function mn(e) {
187
178
  let t;
188
179
  try {
189
180
  t = new URL(e);
@@ -193,33 +184,33 @@ function Tn(e) {
193
184
  if (t.protocol !== "replay:")
194
185
  return null;
195
186
  const n = t.hostname.toLowerCase();
196
- if (!kn.has(n))
187
+ if (!gn.has(n))
197
188
  return null;
198
- const o = t.searchParams;
189
+ const r = t.searchParams;
199
190
  switch (n) {
200
191
  case "collection": {
201
- const r = O(o, "collectionId");
202
- return r ? { kind: "collection", collectionId: r } : null;
192
+ const o = D(r, "collectionId");
193
+ return o ? { kind: "collection", collectionId: o } : null;
203
194
  }
204
195
  case "workflow": {
205
- const r = O(o, "collectionId"), a = O(o, "workflowId");
206
- return !r || !a ? null : { kind: "workflow", collectionId: r, workflowId: a };
196
+ const o = D(r, "collectionId"), a = D(r, "workflowId");
197
+ return !o || !a ? null : { kind: "workflow", collectionId: o, workflowId: a };
207
198
  }
208
199
  case "step": {
209
- const r = O(o, "collectionId"), a = O(o, "workflowId"), s = O(o, "stepId");
210
- return !r || !a || !s ? null : { kind: "step", collectionId: r, workflowId: a, stepId: s };
200
+ const o = D(r, "collectionId"), a = D(r, "workflowId"), s = D(r, "stepId");
201
+ return !o || !a || !s ? null : { kind: "step", collectionId: o, workflowId: a, stepId: s };
211
202
  }
212
203
  case "operation": {
213
- const r = O(o, "operationId");
214
- return r ? { kind: "operation", operationId: r } : null;
204
+ const o = D(r, "operationId");
205
+ return o ? { kind: "operation", operationId: o } : null;
215
206
  }
216
207
  case "workflow-run": {
217
- const r = O(o, "collectionId"), a = O(o, "workflowId");
218
- if (!r || !a) return null;
219
- const s = O(o, "historyId"), d = s === "null" || s === "undefined" ? null : s;
208
+ const o = D(r, "collectionId"), a = D(r, "workflowId");
209
+ if (!o || !a) return null;
210
+ const s = D(r, "historyId"), d = s === "null" || s === "undefined" ? null : s;
220
211
  return {
221
212
  kind: "workflow-run",
222
- collectionId: r,
213
+ collectionId: o,
223
214
  workflowId: a,
224
215
  ...d ? { historyId: d } : {}
225
216
  };
@@ -228,22 +219,22 @@ function Tn(e) {
228
219
  return null;
229
220
  }
230
221
  }
231
- function In(e, t, n) {
232
- return e.tabsState.tabs.get({ noproxy: !0 }).findIndex(({ data: o }) => wt(o, Ct.WorkflowRun) && o.collectionId === t && o.workflowId === n);
222
+ function vn(e, t, n) {
223
+ return e.tabsState.tabs.get({ noproxy: !0 }).findIndex(({ data: r }) => mt(r, vt.WorkflowRun) && r.collectionId === t && r.workflowId === n);
233
224
  }
234
- function An(e, t, n, o = {}) {
225
+ function yn(e, t, n, r = {}) {
235
226
  switch (n.kind) {
236
227
  case "collection":
237
228
  t.openCollectionTab({
238
229
  collectionId: n.collectionId,
239
- activeTabName: Ce.COLLECTION_SETTINGS
230
+ activeTabName: Te.COLLECTION_SETTINGS
240
231
  });
241
232
  break;
242
233
  case "workflow":
243
234
  t.openWorkflowTab({
244
235
  collectionId: n.collectionId,
245
236
  workflowId: n.workflowId,
246
- activeTabName: Ce.WORKFLOW_SETTINGS
237
+ activeTabName: Te.WORKFLOW_SETTINGS
247
238
  });
248
239
  break;
249
240
  case "step":
@@ -255,12 +246,12 @@ function An(e, t, n, o = {}) {
255
246
  });
256
247
  break;
257
248
  case "workflow-run": {
258
- const r = o.workflowRunHistoryIds?.[Dt(n.collectionId, n.workflowId)] ?? [], a = n.historyId && r.includes(n.historyId) ? n.historyId : r.at(-1) ?? n.historyId;
249
+ const o = r.workflowRunHistoryIds?.[Pt(n.collectionId, n.workflowId)] ?? [], a = n.historyId && o.includes(n.historyId) ? n.historyId : o.at(-1) ?? n.historyId;
259
250
  if (a) {
260
251
  t.openWorkflowRunTabFromHistory(a, { state: te.Normal });
261
252
  break;
262
253
  }
263
- const s = In(
254
+ const s = vn(
264
255
  e,
265
256
  n.collectionId,
266
257
  n.workflowId
@@ -276,55 +267,55 @@ function An(e, t, n, o = {}) {
276
267
  break;
277
268
  }
278
269
  case "operation": {
279
- const r = Rt(e, n.operationId);
280
- if (!r.ok) {
270
+ const o = At(e, n.operationId);
271
+ if (!o.ok) {
281
272
  console.warn("[executeReplayChatLink] Operation not resolved", {
282
273
  operationId: n.operationId,
283
- message: r.message
274
+ message: o.message
284
275
  });
285
276
  return;
286
277
  }
287
- Ot(
278
+ St(
288
279
  e,
289
- $t(r.value),
280
+ Lt(o.value),
290
281
  t
291
282
  );
292
283
  break;
293
284
  }
294
285
  }
295
286
  }
296
- function Sn(e, t, n, o = {}) {
297
- const r = Tn(n);
298
- r && An(e, t, r, o);
287
+ function xn(e, t, n, r = {}) {
288
+ const o = mn(n);
289
+ o && yn(e, t, o, r);
299
290
  }
300
291
  function Xe({
301
292
  workflowRunHistoryIds: e
302
293
  } = {}) {
303
- const t = We(), { getApiOperation: n } = kt(), {
304
- handleTabChange: o,
305
- addNewTab: r,
294
+ const t = Ue(), { getApiOperation: n } = yt(), {
295
+ handleTabChange: r,
296
+ addNewTab: o,
306
297
  openCollectionTab: a,
307
298
  openWorkflowTab: s,
308
299
  openStepTabFromCollection: d,
309
300
  openWorkflowRunTab: l,
310
301
  openWorkflowRunTabFromHistory: u,
311
302
  changeTabState: f
312
- } = Tt();
313
- return D(
303
+ } = xt();
304
+ return _(
314
305
  (p) => {
315
306
  const g = p.target;
316
307
  if (!(g instanceof Element))
317
308
  return;
318
- const m = g.closest("a[href]");
319
- if (!(m instanceof HTMLAnchorElement))
309
+ const y = g.closest("a[href]");
310
+ if (!(y instanceof HTMLAnchorElement))
320
311
  return;
321
- const v = m.getAttribute("href");
322
- v?.startsWith("replay:") && (p.preventDefault(), p.stopPropagation(), Sn(
312
+ const m = y.getAttribute("href");
313
+ m?.startsWith("replay:") && (p.preventDefault(), p.stopPropagation(), xn(
323
314
  t,
324
315
  {
325
316
  getApiOperation: n,
326
- handleTabChange: o,
327
- addNewTab: r,
317
+ handleTabChange: r,
318
+ addNewTab: o,
328
319
  openCollectionTab: a,
329
320
  openWorkflowTab: s,
330
321
  openStepTabFromCollection: d,
@@ -332,7 +323,7 @@ function Xe({
332
323
  openWorkflowRunTabFromHistory: u,
333
324
  changeTabState: f
334
325
  },
335
- v,
326
+ m,
336
327
  { workflowRunHistoryIds: e }
337
328
  ));
338
329
  },
@@ -340,8 +331,8 @@ function Xe({
340
331
  e,
341
332
  t,
342
333
  n,
343
- o,
344
334
  r,
335
+ o,
345
336
  a,
346
337
  s,
347
338
  d,
@@ -351,91 +342,91 @@ function Xe({
351
342
  ]
352
343
  );
353
344
  }
354
- class Ln {
355
- diff(t, n, o = {}) {
356
- let r;
357
- typeof o == "function" ? (r = o, o = {}) : "callback" in o && (r = o.callback);
358
- const a = this.castInput(t, o), s = this.castInput(n, o), d = this.removeEmpty(this.tokenize(a, o)), l = this.removeEmpty(this.tokenize(s, o));
359
- return this.diffWithOptionsObj(d, l, o, r);
345
+ class wn {
346
+ diff(t, n, r = {}) {
347
+ let o;
348
+ typeof r == "function" ? (o = r, r = {}) : "callback" in r && (o = r.callback);
349
+ const a = this.castInput(t, r), s = this.castInput(n, r), d = this.removeEmpty(this.tokenize(a, r)), l = this.removeEmpty(this.tokenize(s, r));
350
+ return this.diffWithOptionsObj(d, l, r, o);
360
351
  }
361
- diffWithOptionsObj(t, n, o, r) {
352
+ diffWithOptionsObj(t, n, r, o) {
362
353
  var a;
363
- const s = (y) => {
364
- if (y = this.postProcess(y, o), r) {
354
+ const s = (v) => {
355
+ if (v = this.postProcess(v, r), o) {
365
356
  setTimeout(function() {
366
- r(y);
357
+ o(v);
367
358
  }, 0);
368
359
  return;
369
360
  } else
370
- return y;
361
+ return v;
371
362
  }, d = n.length, l = t.length;
372
363
  let u = 1, f = d + l;
373
- o.maxEditLength != null && (f = Math.min(f, o.maxEditLength));
374
- const p = (a = o.timeout) !== null && a !== void 0 ? a : 1 / 0, g = Date.now() + p, m = [{ oldPos: -1, lastComponent: void 0 }];
375
- let v = this.extractCommon(m[0], n, t, 0, o);
376
- if (m[0].oldPos + 1 >= l && v + 1 >= d)
377
- return s(this.buildValues(m[0].lastComponent, n, t));
364
+ r.maxEditLength != null && (f = Math.min(f, r.maxEditLength));
365
+ const p = (a = r.timeout) !== null && a !== void 0 ? a : 1 / 0, g = Date.now() + p, y = [{ oldPos: -1, lastComponent: void 0 }];
366
+ let m = this.extractCommon(y[0], n, t, 0, r);
367
+ if (y[0].oldPos + 1 >= l && m + 1 >= d)
368
+ return s(this.buildValues(y[0].lastComponent, n, t));
378
369
  let x = -1 / 0, b = 1 / 0;
379
370
  const w = () => {
380
- for (let y = Math.max(x, -u); y <= Math.min(b, u); y += 2) {
371
+ for (let v = Math.max(x, -u); v <= Math.min(b, u); v += 2) {
381
372
  let S;
382
- const E = m[y - 1], R = m[y + 1];
383
- E && (m[y - 1] = void 0);
373
+ const R = y[v - 1], O = y[v + 1];
374
+ R && (y[v - 1] = void 0);
384
375
  let q = !1;
385
- if (R) {
386
- const ee = R.oldPos - y;
387
- q = R && 0 <= ee && ee < d;
376
+ if (O) {
377
+ const ee = O.oldPos - v;
378
+ q = O && 0 <= ee && ee < d;
388
379
  }
389
- const _ = E && E.oldPos + 1 < l;
390
- if (!q && !_) {
391
- m[y] = void 0;
380
+ const $ = R && R.oldPos + 1 < l;
381
+ if (!q && !$) {
382
+ y[v] = void 0;
392
383
  continue;
393
384
  }
394
- if (!_ || q && E.oldPos < R.oldPos ? S = this.addToPath(R, !0, !1, 0, o) : S = this.addToPath(E, !1, !0, 1, o), v = this.extractCommon(S, n, t, y, o), S.oldPos + 1 >= l && v + 1 >= d)
385
+ if (!$ || q && R.oldPos < O.oldPos ? S = this.addToPath(O, !0, !1, 0, r) : S = this.addToPath(R, !1, !0, 1, r), m = this.extractCommon(S, n, t, v, r), S.oldPos + 1 >= l && m + 1 >= d)
395
386
  return s(this.buildValues(S.lastComponent, n, t)) || !0;
396
- m[y] = S, S.oldPos + 1 >= l && (b = Math.min(b, y - 1)), v + 1 >= d && (x = Math.max(x, y + 1));
387
+ y[v] = S, S.oldPos + 1 >= l && (b = Math.min(b, v - 1)), m + 1 >= d && (x = Math.max(x, v + 1));
397
388
  }
398
389
  u++;
399
390
  };
400
- if (r)
401
- (function y() {
391
+ if (o)
392
+ (function v() {
402
393
  setTimeout(function() {
403
394
  if (u > f || Date.now() > g)
404
- return r(void 0);
405
- w() || y();
395
+ return o(void 0);
396
+ w() || v();
406
397
  }, 0);
407
398
  })();
408
399
  else
409
400
  for (; u <= f && Date.now() <= g; ) {
410
- const y = w();
411
- if (y)
412
- return y;
401
+ const v = w();
402
+ if (v)
403
+ return v;
413
404
  }
414
405
  }
415
- addToPath(t, n, o, r, a) {
406
+ addToPath(t, n, r, o, a) {
416
407
  const s = t.lastComponent;
417
- return s && !a.oneChangePerToken && s.added === n && s.removed === o ? {
418
- oldPos: t.oldPos + r,
419
- lastComponent: { count: s.count + 1, added: n, removed: o, previousComponent: s.previousComponent }
408
+ return s && !a.oneChangePerToken && s.added === n && s.removed === r ? {
409
+ oldPos: t.oldPos + o,
410
+ lastComponent: { count: s.count + 1, added: n, removed: r, previousComponent: s.previousComponent }
420
411
  } : {
421
- oldPos: t.oldPos + r,
422
- lastComponent: { count: 1, added: n, removed: o, previousComponent: s }
412
+ oldPos: t.oldPos + o,
413
+ lastComponent: { count: 1, added: n, removed: r, previousComponent: s }
423
414
  };
424
415
  }
425
- extractCommon(t, n, o, r, a) {
426
- const s = n.length, d = o.length;
427
- let l = t.oldPos, u = l - r, f = 0;
428
- for (; u + 1 < s && l + 1 < d && this.equals(o[l + 1], n[u + 1], a); )
416
+ extractCommon(t, n, r, o, a) {
417
+ const s = n.length, d = r.length;
418
+ let l = t.oldPos, u = l - o, f = 0;
419
+ for (; u + 1 < s && l + 1 < d && this.equals(r[l + 1], n[u + 1], a); )
429
420
  u++, l++, f++, a.oneChangePerToken && (t.lastComponent = { count: 1, previousComponent: t.lastComponent, added: !1, removed: !1 });
430
421
  return f && !a.oneChangePerToken && (t.lastComponent = { count: f, previousComponent: t.lastComponent, added: !1, removed: !1 }), t.oldPos = l, u;
431
422
  }
432
- equals(t, n, o) {
433
- return o.comparator ? o.comparator(t, n) : t === n || !!o.ignoreCase && t.toLowerCase() === n.toLowerCase();
423
+ equals(t, n, r) {
424
+ return r.comparator ? r.comparator(t, n) : t === n || !!r.ignoreCase && t.toLowerCase() === n.toLowerCase();
434
425
  }
435
426
  removeEmpty(t) {
436
427
  const n = [];
437
- for (let o = 0; o < t.length; o++)
438
- t[o] && n.push(t[o]);
428
+ for (let r = 0; r < t.length; r++)
429
+ t[r] && n.push(t[r]);
439
430
  return n;
440
431
  }
441
432
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -455,94 +446,94 @@ class Ln {
455
446
  get useLongestToken() {
456
447
  return !1;
457
448
  }
458
- buildValues(t, n, o) {
459
- const r = [];
449
+ buildValues(t, n, r) {
450
+ const o = [];
460
451
  let a;
461
452
  for (; t; )
462
- r.push(t), a = t.previousComponent, delete t.previousComponent, t = a;
463
- r.reverse();
464
- const s = r.length;
453
+ o.push(t), a = t.previousComponent, delete t.previousComponent, t = a;
454
+ o.reverse();
455
+ const s = o.length;
465
456
  let d = 0, l = 0, u = 0;
466
457
  for (; d < s; d++) {
467
- const f = r[d];
458
+ const f = o[d];
468
459
  if (f.removed)
469
- f.value = this.join(o.slice(u, u + f.count)), u += f.count;
460
+ f.value = this.join(r.slice(u, u + f.count)), u += f.count;
470
461
  else {
471
462
  if (!f.added && this.useLongestToken) {
472
463
  let p = n.slice(l, l + f.count);
473
- p = p.map(function(g, m) {
474
- const v = o[u + m];
475
- return v.length > g.length ? v : g;
464
+ p = p.map(function(g, y) {
465
+ const m = r[u + y];
466
+ return m.length > g.length ? m : g;
476
467
  }), f.value = this.join(p);
477
468
  } else
478
469
  f.value = this.join(n.slice(l, l + f.count));
479
470
  l += f.count, f.added || (u += f.count);
480
471
  }
481
472
  }
482
- return r;
473
+ return o;
483
474
  }
484
475
  }
485
- class Pn extends Ln {
476
+ class bn extends wn {
486
477
  constructor() {
487
- super(...arguments), this.tokenize = On;
478
+ super(...arguments), this.tokenize = kn;
488
479
  }
489
- equals(t, n, o) {
490
- return o.ignoreWhitespace ? ((!o.newlineIsToken || !t.includes(`
491
- `)) && (t = t.trim()), (!o.newlineIsToken || !n.includes(`
492
- `)) && (n = n.trim())) : o.ignoreNewlineAtEof && !o.newlineIsToken && (t.endsWith(`
480
+ equals(t, n, r) {
481
+ return r.ignoreWhitespace ? ((!r.newlineIsToken || !t.includes(`
482
+ `)) && (t = t.trim()), (!r.newlineIsToken || !n.includes(`
483
+ `)) && (n = n.trim())) : r.ignoreNewlineAtEof && !r.newlineIsToken && (t.endsWith(`
493
484
  `) && (t = t.slice(0, -1)), n.endsWith(`
494
- `) && (n = n.slice(0, -1))), super.equals(t, n, o);
485
+ `) && (n = n.slice(0, -1))), super.equals(t, n, r);
495
486
  }
496
487
  }
497
- const En = new Pn();
498
- function Rn(e, t, n) {
499
- return En.diff(e, t, n);
488
+ const Cn = new bn();
489
+ function Tn(e, t, n) {
490
+ return Cn.diff(e, t, n);
500
491
  }
501
- function On(e, t) {
492
+ function kn(e, t) {
502
493
  t.stripTrailingCr && (e = e.replace(/\r\n/g, `
503
494
  `));
504
- const n = [], o = e.split(/(\n|\r\n)/);
505
- o[o.length - 1] || o.pop();
506
- for (let r = 0; r < o.length; r++) {
507
- const a = o[r];
508
- r % 2 && !t.newlineIsToken ? n[n.length - 1] += a : n.push(a);
495
+ const n = [], r = e.split(/(\n|\r\n)/);
496
+ r[r.length - 1] || r.pop();
497
+ for (let o = 0; o < r.length; o++) {
498
+ const a = r[o];
499
+ o % 2 && !t.newlineIsToken ? n[n.length - 1] += a : n.push(a);
509
500
  }
510
501
  return n;
511
502
  }
512
- const $n = 500;
513
- function Dn(e, t) {
514
- const n = zn(e, t);
503
+ const In = 500;
504
+ function An(e, t) {
505
+ const n = Sn(e, t);
515
506
  if (n.length === 0) return [];
516
- const o = [];
517
- let r = 0;
518
- for (; r < n.length; ) {
519
- let a = r;
520
- const s = n[r].type === "context";
507
+ const r = [];
508
+ let o = 0;
509
+ for (; o < n.length; ) {
510
+ let a = o;
511
+ const s = n[o].type === "context";
521
512
  for (; a < n.length && n[a].type === "context" === s; ) a++;
522
- const d = n.slice(r, a);
523
- o.push({
524
- start: r,
513
+ const d = n.slice(o, a);
514
+ r.push({
515
+ start: o,
525
516
  end: a,
526
517
  rows: d,
527
518
  hasAdditions: d.some((l) => l.type === "add"),
528
519
  hasRemovals: d.some((l) => l.type === "remove")
529
- }), r = a;
520
+ }), o = a;
530
521
  }
531
- return o;
522
+ return r;
532
523
  }
533
- function zn(e, t) {
524
+ function Sn(e, t) {
534
525
  if (e === void 0)
535
526
  return t === void 0 ? [] : j(t, "add");
536
527
  if (t === void 0) return j(e, "remove");
537
528
  if (e === t) return j(t, "context");
538
- const n = Mn(e, t);
529
+ const n = Ln(e, t);
539
530
  return n ? n.flatMap(
540
- (o) => j(o.value, o.added ? "add" : o.removed ? "remove" : "context")
531
+ (r) => j(r.value, r.added ? "add" : r.removed ? "remove" : "context")
541
532
  ) : [...j(e, "remove"), ...j(t, "add")];
542
533
  }
543
- function Mn(e, t) {
534
+ function Ln(e, t) {
544
535
  try {
545
- return Rn(e, t, { timeout: $n });
536
+ return Tn(e, t, { timeout: In });
546
537
  } catch {
547
538
  return;
548
539
  }
@@ -550,16 +541,16 @@ function Mn(e, t) {
550
541
  function j(e, t) {
551
542
  const n = e.split(`
552
543
  `);
553
- return n.length > 1 && n[n.length - 1] === "" && n.pop(), n.map((o) => ({ type: t, text: o }));
544
+ return n.length > 1 && n[n.length - 1] === "" && n.pop(), n.map((r) => ({ type: t, text: r }));
554
545
  }
555
- const Te = 1, Ie = (e) => e && e.hasAdditions !== e.hasRemovals, Ae = (e) => e && (e.hasAdditions || e.hasRemovals);
556
- function _n(e, t, n) {
546
+ const Ie = 1, Ae = (e) => e && e.hasAdditions !== e.hasRemovals, Se = (e) => e && (e.hasAdditions || e.hasRemovals);
547
+ function Pn(e, t, n) {
557
548
  if (e.hasAdditions || e.hasRemovals)
558
549
  return ne(e.rows);
559
- const o = n[t - 1], r = n[t + 1], a = Ie(o) ? Te : 0, s = Ie(r) ? Te : 0;
550
+ const r = n[t - 1], o = n[t + 1], a = Ae(r) ? Ie : 0, s = Ae(o) ? Ie : 0;
560
551
  if (a + s >= e.rows.length) return ne(e.rows);
561
552
  const d = e.rows.slice(0, a), l = s > 0 ? e.rows.slice(-s) : [], u = [];
562
- return u.push(...ne(d)), Ae(o) && Ae(r) && u.push({ kind: "separator" }), u.push(...ne(l)), u;
553
+ return u.push(...ne(d)), Se(r) && Se(o) && u.push({ kind: "separator" }), u.push(...ne(l)), u;
563
554
  }
564
555
  function ne(e) {
565
556
  return e.map((t) => ({
@@ -567,26 +558,26 @@ function ne(e) {
567
558
  row: t
568
559
  }));
569
560
  }
570
- const Vn = 200;
571
- function Se({ oldValue: e, newValue: t }) {
572
- const n = A(() => Dn(e, t), [e, t]), o = A(() => n.flatMap(_n), [n]);
573
- return A(() => n.some((a) => a.hasAdditions || a.hasRemovals), [n]) ? /* @__PURE__ */ i(Hn, { $maxHeight: Vn, children: o.map((a, s) => {
561
+ const En = 200;
562
+ function Le({ oldValue: e, newValue: t }) {
563
+ const n = A(() => An(e, t), [e, t]), r = A(() => n.flatMap(Pn), [n]);
564
+ return A(() => n.some((a) => a.hasAdditions || a.hasRemovals), [n]) ? /* @__PURE__ */ i(On, { $maxHeight: En, children: r.map((a, s) => {
574
565
  if (a.kind === "separator")
575
- return /* @__PURE__ */ i(Un, { children: /* @__PURE__ */ i(Le, { children: "···" }) }, s);
576
- const { row: d } = a, l = Bn(d.type);
566
+ return /* @__PURE__ */ i(Vn, { children: /* @__PURE__ */ i(Pe, { children: "···" }) }, s);
567
+ const { row: d } = a, l = Rn(d.type);
577
568
  return /* @__PURE__ */ h(l, { children: [
578
- /* @__PURE__ */ h(Wn, { children: [
579
- d.type === "remove" && /* @__PURE__ */ i(Ut, { size: "12px" }),
580
- d.type === "add" && /* @__PURE__ */ i(Yt, { size: "12px" })
569
+ /* @__PURE__ */ h(zn, { children: [
570
+ d.type === "remove" && /* @__PURE__ */ i(Yt, { size: "12px" }),
571
+ d.type === "add" && /* @__PURE__ */ i(Wt, { size: "12px" })
581
572
  ] }),
582
- /* @__PURE__ */ i(Le, { children: d.text === "" ? " " : d.text })
573
+ /* @__PURE__ */ i(Pe, { children: d.text === "" ? " " : d.text })
583
574
  ] }, s);
584
575
  }) }) : null;
585
576
  }
586
- function Bn(e) {
587
- return e === "remove" ? Nn : e === "add" ? Fn : jn;
577
+ function Rn(e) {
578
+ return e === "remove" ? Dn : e === "add" ? Mn : _n;
588
579
  }
589
- const Hn = c.div`
580
+ const On = c.div`
590
581
  display: flex;
591
582
  flex-direction: column;
592
583
  width: 100%;
@@ -597,29 +588,29 @@ const Hn = c.div`
597
588
  &::-webkit-scrollbar-track {
598
589
  margin: var(--spacing-xxs) 0;
599
590
  }
600
- `, ue = c.div`
591
+ `, le = c.div`
601
592
  display: flex;
602
593
  font-size: var(--font-size-sm);
603
594
  line-height: var(--line-height-sm);
604
595
  font-weight: var(--font-weight-regular);
605
596
  padding-right: var(--spacing-xxs);
606
- `, Nn = c(ue)`
597
+ `, Dn = c(le)`
607
598
  background: var(--admonition-danger-bg-color);
608
599
  color: var(--color-raspberry-7);
609
- `, Fn = c(ue)`
600
+ `, Mn = c(le)`
610
601
  background: var(--admonition-success-bg-color);
611
602
  color: var(--color-green-7);
612
- `, jn = c(ue)`
603
+ `, _n = c(le)`
613
604
  background: transparent;
614
605
  color: var(--text-color-secondary);
615
- `, Wn = c.span`
606
+ `, zn = c.span`
616
607
  display: flex;
617
608
  align-items: center;
618
609
  justify-content: center;
619
610
  min-width: 16px;
620
611
  height: 20px;
621
612
  flex-shrink: 0;
622
- `, Le = c.span`
613
+ `, Pe = c.span`
623
614
  width: 100%;
624
615
  min-width: 0;
625
616
  line-height: var(--line-height-sm);
@@ -627,112 +618,112 @@ const Hn = c.div`
627
618
  font-weight: var(--font-weight-regular);
628
619
  white-space: pre-wrap;
629
620
  word-break: break-all;
630
- `, Un = c(ue)`
621
+ `, Vn = c(le)`
631
622
  user-select: none;
632
- `, Yn = (e) => typeof e != "object" || e === null ? !1 : "kind" in e && e.kind === "batch" ? "changes" in e ? Array.isArray(e.changes) && e.changes.every(Pe) : !1 : Pe(e);
633
- function Pe(e) {
623
+ `, $n = (e) => typeof e != "object" || e === null ? !1 : "kind" in e && e.kind === "batch" ? "changes" in e ? Array.isArray(e.changes) && e.changes.every(Ee) : !1 : Ee(e);
624
+ function Ee(e) {
634
625
  return typeof e != "object" || e === null || !("id" in e) || !("target" in e) || !("included" in e) || !("kind" in e) ? !1 : e.kind === "single";
635
626
  }
636
- const Gn = {
627
+ const Hn = {
637
628
  approveLabel: "Approve",
638
629
  denyLabel: "Deny"
639
630
  };
640
- function qn(e, t) {
641
- const n = T(t, "action");
631
+ function Bn(e, t) {
632
+ const n = C(t, "action");
642
633
  if (n) {
643
- const r = zt[n];
644
- if (r) return r;
634
+ const o = Et[n];
635
+ if (o) return o;
645
636
  }
646
- const o = Mt[e];
647
- return o || Gn;
637
+ const r = Rt[e];
638
+ return r || Hn;
648
639
  }
649
- function T(e, t) {
640
+ function C(e, t) {
650
641
  if (!e || typeof e != "object") return null;
651
642
  const n = e.payload;
652
643
  if (!n || typeof n != "object") return null;
653
- const o = n[t];
654
- return typeof o != "string" ? null : o.trim() || null;
644
+ const r = n[t];
645
+ return typeof r != "string" ? null : r.trim() || null;
655
646
  }
656
- function oe(e, t) {
647
+ function re(e, t) {
657
648
  if (!(typeof t > "u"))
658
649
  return e ? `${e}: ${t}` : t;
659
650
  }
660
- function Kn(e) {
651
+ function Fn(e) {
661
652
  return e ? "changes" in e ? Array.isArray(e.changes) ? e.changes.map((t) => !t || typeof t != "object" || !("approved" in t) ? !1 : t.approved === !0) : [] : [] : [];
662
653
  }
663
- function Zn(e, t) {
654
+ function Nn(e, t) {
664
655
  if (!e || typeof e != "object") return;
665
- const n = ce(e, ge), o = ce(n, ve);
666
- if (!(t in o)) return;
667
- const r = o[t];
668
- if (Array.isArray(r) && r.length !== 0 && r.every(Yn))
669
- return r;
656
+ const n = ae(e, he), r = ae(n, ge);
657
+ if (!(t in r)) return;
658
+ const o = r[t];
659
+ if (Array.isArray(o) && o.length !== 0 && o.every($n))
660
+ return o;
670
661
  }
671
- function Qe(e, t) {
672
- return _t(e) && qe(e) && e.toolCallId === t;
662
+ function Ze(e, t) {
663
+ return Ot(e) && qe(e) && e.toolCallId === t;
673
664
  }
674
- function Jn(e, t, n) {
675
- const o = e.parts.map((l) => Qe(l, t) ? { ...l, input: Xn(l.input, n) } : l), r = e.metadata && typeof e.metadata == "object" ? e.metadata : {}, a = ce(r, ge), d = { ...ce(a, ve), [t]: It(n) };
665
+ function jn(e, t, n) {
666
+ const r = e.parts.map((l) => Ze(l, t) ? { ...l, input: Un(l.input, n) } : l), o = e.metadata && typeof e.metadata == "object" ? e.metadata : {}, a = ae(o, he), d = { ...ae(a, ge), [t]: wt(n) };
676
667
  return {
677
668
  ...e,
678
- parts: o,
669
+ parts: r,
679
670
  metadata: {
680
- ...r,
681
- [ge]: {
671
+ ...o,
672
+ [he]: {
682
673
  ...a,
683
- [ve]: d
674
+ [ge]: d
684
675
  }
685
676
  }
686
677
  };
687
678
  }
688
- function ce(e, t) {
679
+ function ae(e, t) {
689
680
  const n = e[t];
690
681
  return typeof n == "object" && n !== null ? n : {};
691
682
  }
692
- function Xn(e, t) {
683
+ function Un(e, t) {
693
684
  if (!e || !("changes" in e) || !Array.isArray(e.changes)) return e;
694
- const { changes: n, ...o } = e;
685
+ const { changes: n, ...r } = e;
695
686
  return {
696
- ...o,
697
- changes: n.map((r, a) => ({
698
- ...r,
687
+ ...r,
688
+ changes: n.map((o, a) => ({
689
+ ...o,
699
690
  approved: t[a]?.included ?? !1
700
691
  }))
701
692
  };
702
693
  }
703
- function Qn({
694
+ function Wn({
704
695
  preview: e,
705
696
  isIncluded: t,
706
697
  onToggle: n,
707
- readOnly: o
698
+ readOnly: r
708
699
  }) {
709
- const { primaryLabel: r, categoryLabel: a, diffLineKey: s } = eo(e.target);
700
+ const { primaryLabel: o, categoryLabel: a, diffLineKey: s } = Yn(e.target);
710
701
  return /* @__PURE__ */ i(
711
- to,
702
+ Gn,
712
703
  {
713
704
  isIncluded: t,
714
705
  onToggle: n,
715
- readOnly: o,
716
- primaryLabel: r,
706
+ readOnly: r,
707
+ primaryLabel: o,
717
708
  categoryLabel: a,
718
- children: e.kind === "batch" ? /* @__PURE__ */ i(po, { children: e.changes.map((d) => /* @__PURE__ */ i(
719
- Se,
709
+ children: e.kind === "batch" ? /* @__PURE__ */ i(or, { children: e.changes.map((d) => /* @__PURE__ */ i(
710
+ Le,
720
711
  {
721
- oldValue: oe(d.target.key, d.oldValue),
722
- newValue: oe(d.target.key, d.newValue)
712
+ oldValue: re(d.target.key, d.oldValue),
713
+ newValue: re(d.target.key, d.newValue)
723
714
  },
724
715
  d.id
725
716
  )) }) : /* @__PURE__ */ i(
726
- Se,
717
+ Le,
727
718
  {
728
- oldValue: oe(s, e.oldValue),
729
- newValue: oe(s, e.newValue)
719
+ oldValue: re(s, e.oldValue),
720
+ newValue: re(s, e.newValue)
730
721
  }
731
722
  )
732
723
  }
733
724
  );
734
725
  }
735
- function eo(e) {
726
+ function Yn(e) {
736
727
  const t = e.schemeId ?? e.type;
737
728
  return e.stepId || e.schemeId ? {
738
729
  primaryLabel: e.stepId ?? t,
@@ -744,27 +735,27 @@ function eo(e) {
744
735
  diffLineKey: void 0
745
736
  };
746
737
  }
747
- function to({
738
+ function Gn({
748
739
  isIncluded: e,
749
740
  onToggle: t,
750
741
  readOnly: n,
751
- primaryLabel: o,
752
- categoryLabel: r,
742
+ primaryLabel: r,
743
+ categoryLabel: o,
753
744
  children: a
754
745
  }) {
755
- return /* @__PURE__ */ h(no, { $dimmed: n && !e, children: [
756
- /* @__PURE__ */ h(oo, { children: [
757
- n ? /* @__PURE__ */ i(lo, { children: e ? /* @__PURE__ */ i(uo, { size: "16px" }) : /* @__PURE__ */ i(fo, { size: "16px" }) }) : /* @__PURE__ */ h(so, { children: [
758
- /* @__PURE__ */ i(ao, { checked: e }),
759
- /* @__PURE__ */ i(co, { type: "checkbox", checked: e, onChange: t })
746
+ return /* @__PURE__ */ h(qn, { $dimmed: n && !e, children: [
747
+ /* @__PURE__ */ h(Kn, { children: [
748
+ n ? /* @__PURE__ */ i(tr, { children: e ? /* @__PURE__ */ i(nr, { size: "16px" }) : /* @__PURE__ */ i(rr, { size: "16px" }) }) : /* @__PURE__ */ h(Qn, { children: [
749
+ /* @__PURE__ */ i(Zn, { checked: e }),
750
+ /* @__PURE__ */ i(er, { type: "checkbox", checked: e, onChange: t })
760
751
  ] }),
761
- /* @__PURE__ */ i(ro, { children: o }),
762
- r ? /* @__PURE__ */ i(io, { children: r }) : null
752
+ /* @__PURE__ */ i(Jn, { children: r }),
753
+ o ? /* @__PURE__ */ i(Xn, { children: o }) : null
763
754
  ] }),
764
755
  a
765
756
  ] });
766
757
  }
767
- const no = c.div`
758
+ const qn = c.div`
768
759
  display: flex;
769
760
  flex-direction: column;
770
761
  gap: var(--spacing-xs);
@@ -776,12 +767,12 @@ const no = c.div`
776
767
  &:last-child {
777
768
  border-bottom: none;
778
769
  }
779
- `, oo = c.div`
770
+ `, Kn = c.div`
780
771
  display: flex;
781
772
  align-items: center;
782
773
  gap: var(--spacing-xs);
783
774
  min-width: 0;
784
- `, ro = c.span`
775
+ `, Jn = c.span`
785
776
  flex: 1;
786
777
  min-width: 0;
787
778
  color: var(--text-color-primary);
@@ -791,24 +782,24 @@ const no = c.div`
791
782
  overflow: hidden;
792
783
  text-overflow: ellipsis;
793
784
  white-space: nowrap;
794
- `, io = c.span`
785
+ `, Xn = c.span`
795
786
  flex-shrink: 0;
796
787
  font-family: var(--code-block-font-family, var(--font-family-monospace, monospace));
797
788
  font-size: var(--font-size-sm);
798
789
  font-weight: var(--font-weight-regular);
799
790
  line-height: var(--line-height-sm);
800
791
  color: var(--text-color-secondary);
801
- `, ao = c(Kt).attrs({ "aria-hidden": !0 })`
792
+ `, Zn = c(Nt).attrs({ "aria-hidden": !0 })`
802
793
  --checkbox-border-color: var(--color-blueberry-6);
803
794
  --checkbox-box-color: var(--color-blueberry-6);
804
795
  --checkbox-box-color-active: var(--color-blueberry-6);
805
- `, so = c.span`
796
+ `, Qn = c.span`
806
797
  position: relative;
807
798
  display: inline-flex;
808
799
  flex-shrink: 0;
809
800
  width: 16px;
810
801
  height: 16px;
811
- `, co = c.input`
802
+ `, er = c.input`
812
803
  position: absolute;
813
804
  inset: 0;
814
805
  width: 16px;
@@ -816,151 +807,159 @@ const no = c.div`
816
807
  margin: 0;
817
808
  opacity: 0;
818
809
  cursor: pointer;
819
- `, lo = c.span`
810
+ `, tr = c.span`
820
811
  display: inline-flex;
821
812
  flex-shrink: 0;
822
813
  width: 16px;
823
814
  height: 16px;
824
815
  align-items: center;
825
816
  justify-content: center;
826
- `, uo = c(Gt)`
817
+ `, nr = c(jt)`
827
818
  color: var(--color-success-base);
828
- `, fo = c(qt)`
819
+ `, rr = c(Ut)`
829
820
  color: var(--text-color-description);
830
- `, po = c.div`
821
+ `, or = c.div`
831
822
  display: flex;
832
823
  flex-direction: column;
833
824
  gap: var(--spacing-xxs);
834
825
  min-width: 0;
835
826
  `;
836
- function et({
827
+ function Qe({
837
828
  previews: e,
838
829
  handleToggle: t,
839
830
  readOnly: n
840
831
  }) {
841
- return e.length === 0 ? null : /* @__PURE__ */ i(ho, { children: e.map((o, r) => /* @__PURE__ */ i(
842
- Qn,
832
+ return e.length === 0 ? null : /* @__PURE__ */ i(ir, { children: e.map((r, o) => /* @__PURE__ */ i(
833
+ Wn,
843
834
  {
844
- preview: o,
845
- isIncluded: o.included,
846
- onToggle: t ? () => t(r) : void 0,
835
+ preview: r,
836
+ isIncluded: r.included,
837
+ onToggle: t ? () => t(o) : void 0,
847
838
  readOnly: n
848
839
  },
849
- o.id
840
+ r.id
850
841
  )) });
851
842
  }
852
- const ho = c.div`
843
+ const ir = c.div`
853
844
  display: flex;
854
845
  flex-direction: column;
855
- `, go = {
856
- update_step: yo,
857
- update_security: xo,
858
- run_request: ko,
859
- web_search: To,
860
- manage_environment: wo,
861
- manage_collection: Co
846
+ `, ar = {
847
+ update_step: lr,
848
+ update_security: dr,
849
+ run_request: hr,
850
+ web_search: gr,
851
+ manage_environment: fr,
852
+ manage_collection: pr
862
853
  };
863
- function vo(e, t) {
864
- const n = go[e];
865
- return n ? n(t) : mo(e);
854
+ function sr(e, t) {
855
+ const n = ar[e];
856
+ return n ? n(t) : cr(e);
866
857
  }
867
- function mo(e) {
858
+ function cr(e) {
868
859
  return [{ kind: "text", text: e.split("_").map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join(" ") }];
869
860
  }
870
- function yo(e) {
871
- return tt(e, "Update step");
861
+ function lr(e) {
862
+ return et(e, "Update step");
872
863
  }
873
- function xo(e) {
874
- const t = bo(e);
875
- if (t.size > 1) return I("Update security");
864
+ function dr(e) {
865
+ const t = ur(e);
866
+ if (t.size > 1) return k("Update security");
876
867
  const [n] = t;
877
- return tt(e, "Update security", n);
868
+ return et(e, "Update security", n);
878
869
  }
879
- function bo(e) {
870
+ function ur(e) {
880
871
  const t = e && "changes" in e ? e.changes : void 0;
881
872
  if (!Array.isArray(t)) return /* @__PURE__ */ new Set();
882
- const n = Z(e, "stepId"), o = t.map((r) => Z(r, "stepId") ?? n);
883
- return new Set(o.filter((r) => !!r));
873
+ const n = J(e, "stepId"), r = t.map((o) => J(o, "stepId") ?? n);
874
+ return new Set(r.filter((o) => !!o));
884
875
  }
885
- function tt(e, t, n) {
886
- const { collectionId: o, workflowId: r, stepId: a } = Io(e), s = n ?? a;
887
- return !o || !r || !s ? I(t) : nt(
876
+ function et(e, t, n) {
877
+ const { collectionId: r, workflowId: o, stepId: a } = mr(e), s = n ?? a;
878
+ return !r || !o || !s ? k(t) : ye(
888
879
  `${t} `,
889
- Je({ collectionId: o, workflowId: r, stepId: s }),
880
+ ve({ collectionId: r, workflowId: o, stepId: s }),
890
881
  s
891
882
  );
892
883
  }
893
- function I(e) {
884
+ function k(e) {
894
885
  return [{ kind: "text", text: e }];
895
886
  }
896
- function P(e, t) {
887
+ function E(e, t) {
897
888
  return t ? `${e} "${t}"` : e;
898
889
  }
899
- function nt(e, t, n) {
890
+ function ye(e, t, n) {
900
891
  return [
901
892
  { kind: "text", text: e },
902
893
  { kind: "link", href: t, label: n }
903
894
  ];
904
895
  }
905
- function wo(e) {
906
- const t = T(e, "action"), n = T(e, "environment"), o = n ? ` in environment "${n}"` : "";
896
+ function fr(e) {
897
+ const t = C(e, "action"), n = C(e, "environment"), r = n ? ` in environment "${n}"` : "";
907
898
  switch (t) {
908
899
  case "add_environment":
909
- return I(P("Add environment", n));
900
+ return k(E("Add environment", n));
910
901
  case "set_active_environment":
911
- return I(
902
+ return k(
912
903
  n ? `Switch active environment to ${n}` : "Switch active environment"
913
904
  );
914
905
  case "upsert_input":
915
- return I(P("Set input", T(e, "name")) + o);
906
+ return k(E("Set input", C(e, "name")) + r);
916
907
  case "remove_input":
917
- return I(
918
- P("Remove input", T(e, "inputName")) + o
908
+ return k(
909
+ E("Remove input", C(e, "inputName")) + r
919
910
  );
920
911
  case "upsert_server":
921
- return I(P("Set server", T(e, "apiId")) + o);
912
+ return k(E("Set server", C(e, "apiId")) + r);
922
913
  case "remove_server":
923
- return I(
924
- P("Remove server", T(e, "apiId")) + o
914
+ return k(
915
+ E("Remove server", C(e, "apiId")) + r
925
916
  );
926
917
  default:
927
- return I("Manage environment");
918
+ return k("Manage environment");
928
919
  }
929
920
  }
930
- function Co(e) {
931
- switch (T(e, "action")) {
921
+ function pr(e) {
922
+ switch (C(e, "action")) {
932
923
  case "create_collection":
933
- return I(P("Create collection", T(e, "title")));
924
+ return k(E("Create collection", C(e, "title")));
934
925
  case "delete_collection":
935
- return I(
936
- P("Delete collection", T(e, "collectionId"))
926
+ return k(
927
+ E("Delete collection", C(e, "collectionId"))
937
928
  );
938
929
  case "create_workflow":
939
- return I(P("Create workflow", T(e, "name")));
930
+ return k(E("Create workflow", C(e, "name")));
940
931
  case "delete_workflow":
941
- return I(P("Delete workflow", T(e, "workflowId")));
932
+ return k(E("Delete workflow", C(e, "workflowId")));
942
933
  case "create_step":
943
- return I(P("Create step", T(e, "stepName")));
934
+ return k(E("Create step", C(e, "stepName")));
944
935
  case "delete_step": {
945
- const n = T(e, "collectionId"), o = T(e, "workflowId"), r = T(e, "stepId");
946
- return !n || !o || !r ? I("Delete step") : nt(
936
+ const n = C(e, "collectionId"), r = C(e, "workflowId"), o = C(e, "stepId");
937
+ return !n || !r || !o ? k("Delete step") : ye(
947
938
  "Delete step ",
948
- Je({ collectionId: n, workflowId: o, stepId: r }),
949
- r
939
+ ve({ collectionId: n, workflowId: r, stepId: o }),
940
+ o
941
+ );
942
+ }
943
+ case "move_step": {
944
+ const n = C(e, "collectionId"), r = C(e, "workflowId"), o = C(e, "stepId");
945
+ return !n || !r || !o ? k("Move step") : ye(
946
+ "Move step ",
947
+ ve({ collectionId: n, workflowId: r, stepId: o }),
948
+ o
950
949
  );
951
950
  }
952
951
  case "save_tab_to_collection":
953
- return I(
954
- P("Save tab as step", T(e, "newStepName"))
952
+ return k(
953
+ E("Save tab as step", C(e, "newStepName"))
955
954
  );
956
955
  default:
957
- return I("Manage collection");
956
+ return k("Manage collection");
958
957
  }
959
958
  }
960
- function ko() {
959
+ function hr() {
961
960
  return [{ kind: "text", text: "Run current request" }];
962
961
  }
963
- function To(e) {
962
+ function gr(e) {
964
963
  return [
965
964
  {
966
965
  kind: "text",
@@ -973,25 +972,25 @@ function To(e) {
973
972
  }
974
973
  ];
975
974
  }
976
- function Io(e) {
975
+ function mr(e) {
977
976
  return {
978
- collectionId: Z(e, "collectionId"),
979
- workflowId: Z(e, "workflowId"),
980
- stepId: Z(e, "stepId")
977
+ collectionId: J(e, "collectionId"),
978
+ workflowId: J(e, "workflowId"),
979
+ stepId: J(e, "stepId")
981
980
  };
982
981
  }
983
- function Z(e, t) {
982
+ function J(e, t) {
984
983
  if (typeof e != "object" || e === null || !(t in e)) return null;
985
984
  const n = e[t];
986
985
  return typeof n == "string" && n.trim() || null;
987
986
  }
988
- function ot({ toolName: e, input: t }) {
989
- const n = vo(e, t), o = Xe();
990
- return /* @__PURE__ */ i(Ao, { onClick: o, children: /* @__PURE__ */ i(So, { children: n.map(
991
- (r, a) => r.kind === "text" ? /* @__PURE__ */ i("span", { children: r.text }, a) : /* @__PURE__ */ i(Lo, { href: r.href, children: r.label }, a)
987
+ function tt({ toolName: e, input: t }) {
988
+ const n = sr(e, t), r = Xe();
989
+ return /* @__PURE__ */ i(vr, { onClick: r, children: /* @__PURE__ */ i(yr, { children: n.map(
990
+ (o, a) => o.kind === "text" ? /* @__PURE__ */ i("span", { children: o.text }, a) : /* @__PURE__ */ i(xr, { href: o.href, children: o.label }, a)
992
991
  ) }) });
993
992
  }
994
- const Ao = c.div`
993
+ const vr = c.div`
995
994
  display: flex;
996
995
  flex-direction: column;
997
996
  gap: 0;
@@ -1001,13 +1000,13 @@ const Ao = c.div`
1001
1000
  &:not(:last-child) {
1002
1001
  border-bottom: 1px solid var(--border-color-secondary);
1003
1002
  }
1004
- `, So = c.span`
1003
+ `, yr = c.span`
1005
1004
  font-family: var(--font-family-base);
1006
1005
  font-size: var(--font-size-sm);
1007
1006
  font-weight: var(--font-weight-regular);
1008
1007
  line-height: var(--line-height-sm);
1009
1008
  color: var(--text-color-primary);
1010
- `, Lo = c.a`
1009
+ `, xr = c.a`
1011
1010
  color: var(--link-color-primary);
1012
1011
  cursor: pointer;
1013
1012
  text-decoration: none;
@@ -1016,102 +1015,102 @@ const Ao = c.div`
1016
1015
  color: var(--link-color-primary, var(--text-color-link));
1017
1016
  }
1018
1017
  `;
1019
- function rt(e, t, n) {
1020
- const o = { type: e };
1021
- return t !== void 0 && (o.key = t), n && (o.stepId = n), o;
1018
+ function nt(e, t, n) {
1019
+ const r = { type: e };
1020
+ return t !== void 0 && (r.key = t), n && (r.stepId = n), r;
1022
1021
  }
1023
- function C({
1022
+ function T({
1024
1023
  id: e,
1025
1024
  targetType: t,
1026
1025
  targetKey: n,
1027
- targetStepId: o,
1028
- oldValue: r,
1026
+ targetStepId: r,
1027
+ oldValue: o,
1029
1028
  newValue: a
1030
1029
  }) {
1031
1030
  return {
1032
1031
  kind: "single",
1033
1032
  id: e,
1034
- target: rt(t, n, o),
1035
- oldValue: r,
1033
+ target: nt(t, n, r),
1034
+ oldValue: o,
1036
1035
  newValue: a,
1037
1036
  included: !0
1038
1037
  };
1039
1038
  }
1040
- function V(e, t, n) {
1041
- return C({ id: e, targetType: t, targetStepId: n, oldValue: void 0, newValue: void 0 });
1039
+ function H(e, t, n) {
1040
+ return T({ id: e, targetType: t, targetStepId: n, oldValue: void 0, newValue: void 0 });
1042
1041
  }
1043
1042
  function Y({
1044
1043
  data: e,
1045
1044
  baseId: t,
1046
1045
  targetType: n,
1047
- batchTargetKey: o,
1048
- targetStepId: r,
1046
+ batchTargetKey: r,
1047
+ targetStepId: o,
1049
1048
  getOldValue: a,
1050
1049
  getNewValue: s = (l, u) => String(u ?? ""),
1051
1050
  resolveTargetKey: d = (l) => l
1052
1051
  }) {
1053
1052
  const l = Object.entries(e).filter(([, p]) => p !== void 0);
1054
1053
  if (l.length === 0)
1055
- return V(t, n, r);
1054
+ return H(t, n, o);
1056
1055
  if (l.length >= 2) {
1057
1056
  const p = l.map(
1058
- ([g, m]) => C({
1057
+ ([g, y]) => T({
1059
1058
  id: `${t}:${g}`,
1060
1059
  targetType: n,
1061
1060
  targetKey: d(g),
1062
1061
  oldValue: a(g),
1063
- newValue: s(g, m)
1062
+ newValue: s(g, y)
1064
1063
  })
1065
1064
  );
1066
1065
  return {
1067
1066
  kind: "batch",
1068
1067
  id: t,
1069
- target: rt(n, o, r),
1068
+ target: nt(n, r, o),
1070
1069
  changes: p,
1071
1070
  included: !0
1072
1071
  };
1073
1072
  }
1074
1073
  const [u, f] = l[0];
1075
- return C({
1074
+ return T({
1076
1075
  id: t,
1077
1076
  targetType: n,
1078
1077
  targetKey: d(u),
1079
- targetStepId: r,
1078
+ targetStepId: o,
1080
1079
  oldValue: a(u),
1081
1080
  newValue: s(u, f)
1082
1081
  });
1083
1082
  }
1084
- function Po({
1083
+ function wr({
1085
1084
  store: e,
1086
1085
  input: t
1087
1086
  }) {
1088
- if (!Eo(t)) return [];
1089
- const n = /* @__PURE__ */ new Map(), o = (r) => {
1090
- const a = n.get(r);
1087
+ if (!br(t)) return [];
1088
+ const n = /* @__PURE__ */ new Map(), r = (o) => {
1089
+ const a = n.get(o);
1091
1090
  if (a) return a;
1092
- const s = Ke(e, t.collectionId, t.workflowId, r), d = s.ok ? s.value : null, l = d ? Array.from(d.security.get({ noproxy: !0 })) : [];
1093
- return n.set(r, l), l;
1091
+ const s = Ke(e, t.collectionId, t.workflowId, o), d = s.ok ? s.value : null, l = d ? Array.from(d.security.get({ noproxy: !0 })) : [];
1092
+ return n.set(o, l), l;
1094
1093
  };
1095
- return t.changes.map((r, a) => {
1096
- const s = r.stepId?.trim(), d = s || t.stepId;
1097
- return Ro(o(d), r, a, s);
1094
+ return t.changes.map((o, a) => {
1095
+ const s = o.stepId?.trim(), d = s || t.stepId;
1096
+ return Cr(r(d), o, a, s);
1098
1097
  });
1099
1098
  }
1100
- function Eo(e) {
1099
+ function br(e) {
1101
1100
  if (typeof e != "object" || e === null) return !1;
1102
1101
  const t = e;
1103
1102
  return typeof t.collectionId == "string" && typeof t.workflowId == "string" && typeof t.stepId == "string" && Array.isArray(t.changes) && t.changes.length > 0;
1104
1103
  }
1105
- function Ro(e, t, n, o) {
1106
- const r = `security[${n}]`;
1104
+ function Cr(e, t, n, r) {
1105
+ const o = `security[${n}]`;
1107
1106
  switch (t.action) {
1108
- case k.ADD: {
1107
+ case I.ADD: {
1109
1108
  const { type: a, schemeId: s, data: d } = t;
1110
1109
  return !d || Object.keys(d).length === 0 ? K(
1111
- C({
1112
- id: r,
1110
+ T({
1111
+ id: o,
1113
1112
  targetType: a,
1114
- targetStepId: o,
1113
+ targetStepId: r,
1115
1114
  oldValue: void 0,
1116
1115
  newValue: a
1117
1116
  }),
@@ -1119,48 +1118,48 @@ function Ro(e, t, n, o) {
1119
1118
  ) : K(
1120
1119
  Y({
1121
1120
  data: d,
1122
- baseId: r,
1121
+ baseId: o,
1123
1122
  targetType: a,
1124
- targetStepId: o,
1123
+ targetStepId: r,
1125
1124
  getOldValue: () => {
1126
1125
  }
1127
1126
  }),
1128
1127
  s
1129
1128
  );
1130
1129
  }
1131
- case k.UPDATE: {
1132
- const { type: a, data: s } = t, d = t.index !== void 0 ? e[t.index] : void 0, l = t.schemeId || ye(d);
1130
+ case I.UPDATE: {
1131
+ const { type: a, data: s } = t, d = t.index !== void 0 ? e[t.index] : void 0, l = t.schemeId || xe(d);
1133
1132
  return !s || Object.keys(s).length === 0 ? K(
1134
- C({
1135
- id: r,
1133
+ T({
1134
+ id: o,
1136
1135
  targetType: a,
1137
- targetStepId: o,
1138
- oldValue: Re(d),
1136
+ targetStepId: r,
1137
+ oldValue: Oe(d),
1139
1138
  newValue: a
1140
1139
  }),
1141
1140
  l
1142
1141
  ) : K(
1143
1142
  Y({
1144
1143
  data: s,
1145
- baseId: r,
1144
+ baseId: o,
1146
1145
  targetType: a,
1147
- targetStepId: o,
1148
- getOldValue: (u) => d ? Oo(d, u) : void 0
1146
+ targetStepId: r,
1147
+ getOldValue: (u) => d ? Tr(d, u) : void 0
1149
1148
  }),
1150
1149
  l
1151
1150
  );
1152
1151
  }
1153
- case k.REMOVE: {
1154
- const a = Vt(e, t), s = a.ok ? a.entry : void 0;
1152
+ case I.REMOVE: {
1153
+ const a = Dt(e, t), s = a.ok ? a.entry : void 0;
1155
1154
  return K(
1156
- C({
1157
- id: r,
1155
+ T({
1156
+ id: o,
1158
1157
  targetType: s?.securityType ?? "Security",
1159
- targetStepId: o,
1160
- oldValue: Re(s),
1158
+ targetStepId: r,
1159
+ oldValue: Oe(s),
1161
1160
  newValue: void 0
1162
1161
  }),
1163
- ye(s)
1162
+ xe(s)
1164
1163
  );
1165
1164
  }
1166
1165
  }
@@ -1168,18 +1167,18 @@ function Ro(e, t, n, o) {
1168
1167
  function K(e, t) {
1169
1168
  return t ? { ...e, target: { ...e.target, schemeId: t } } : e;
1170
1169
  }
1171
- function Oo(e, t) {
1170
+ function Tr(e, t) {
1172
1171
  switch (e.securityType) {
1173
- case M.NoAuth:
1172
+ case V.NoAuth:
1174
1173
  return;
1175
- case M.OAuth2:
1176
- return Ee(e[M.OAuth2], t);
1177
- case M.OpenIDConnect: {
1178
- const n = e[M.OpenIDConnect];
1179
- return t === "openIdConnectUrl" ? n.openIdConnectUrl || void 0 : t === "userInfoUrl" ? n.userInfoUrl || void 0 : Ee(n, t);
1174
+ case V.OAuth2:
1175
+ return Re(e[V.OAuth2], t);
1176
+ case V.OpenIDConnect: {
1177
+ const n = e[V.OpenIDConnect];
1178
+ return t === "openIdConnectUrl" ? n.openIdConnectUrl || void 0 : t === "userInfoUrl" ? n.userInfoUrl || void 0 : Re(n, t);
1180
1179
  }
1181
- case M.APIKey: {
1182
- const n = e[M.APIKey];
1180
+ case V.APIKey: {
1181
+ const n = e[V.APIKey];
1183
1182
  return t === "location" ? ie(n, t)?.toLowerCase() : ie(n, t);
1184
1183
  }
1185
1184
  default: {
@@ -1188,7 +1187,7 @@ function Oo(e, t) {
1188
1187
  }
1189
1188
  }
1190
1189
  }
1191
- function Ee(e, t) {
1190
+ function Re(e, t) {
1192
1191
  if (t === "grantType") return e.grantType || void 0;
1193
1192
  if (!e.grantType) return;
1194
1193
  const n = e[e.grantType];
@@ -1198,236 +1197,236 @@ function ie(e, t) {
1198
1197
  const n = e[t];
1199
1198
  return n !== void 0 && n !== "" ? String(n) : void 0;
1200
1199
  }
1201
- function Re(e) {
1202
- if (!e || e.securityType === M.NoAuth) return;
1203
- const t = ye(e);
1200
+ function Oe(e) {
1201
+ if (!e || e.securityType === V.NoAuth) return;
1202
+ const t = xe(e);
1204
1203
  return t ? `${e.securityType} (${t})` : e.securityType;
1205
1204
  }
1206
- function ye(e) {
1207
- return !e || e.securityType === M.NoAuth ? void 0 : e[e.securityType]?.schemeName || void 0;
1205
+ function xe(e) {
1206
+ return !e || e.securityType === V.NoAuth ? void 0 : e[e.securityType]?.schemeName || void 0;
1208
1207
  }
1209
- function $o({
1208
+ function kr({
1210
1209
  store: e,
1211
1210
  input: t
1212
1211
  }) {
1213
- if (!Do(t)) return [];
1214
- const n = Ke(e, t.collectionId, t.workflowId, t.stepId), o = n.ok ? n.value : null;
1215
- return t.changes.map((r, a) => zo(o, r, a));
1212
+ if (!Ir(t)) return [];
1213
+ const n = Ke(e, t.collectionId, t.workflowId, t.stepId), r = n.ok ? n.value : null;
1214
+ return t.changes.map((o, a) => Ar(r, o, a));
1216
1215
  }
1217
- function Do(e) {
1216
+ function Ir(e) {
1218
1217
  return typeof e != "object" || e === null ? !1 : "collectionId" in e && "workflowId" in e && "stepId" in e && "changes" in e && Array.isArray(e.changes) && e.changes.length > 0 && typeof e.collectionId == "string" && typeof e.workflowId == "string" && typeof e.stepId == "string";
1219
1218
  }
1220
- function zo(e, t, n) {
1221
- const o = t.id ?? `${t.field}[${n}]`;
1219
+ function Ar(e, t, n) {
1220
+ const r = t.id ?? `${t.field}[${n}]`;
1222
1221
  switch (t.field) {
1223
1222
  case "method":
1224
1223
  case "url":
1225
1224
  case "description":
1226
- return Mo(e, t, o);
1225
+ return Sr(e, t, r);
1227
1226
  case "parameters":
1228
- return _o(e, t, o);
1227
+ return Lr(e, t, r);
1229
1228
  case "outputs":
1230
- return Vo(e, t, o);
1229
+ return Pr(e, t, r);
1231
1230
  case "body":
1232
- return Bo(e, t, o);
1231
+ return Er(e, t, r);
1233
1232
  case "successCriteria":
1234
- return Ho(e, t, o);
1233
+ return Rr(e, t, r);
1235
1234
  }
1236
1235
  }
1237
- function Mo(e, t, n) {
1238
- const o = re(t.field);
1236
+ function Sr(e, t, n) {
1237
+ const r = oe(t.field);
1239
1238
  switch (t.action) {
1240
- case k.ADD:
1241
- return C({
1239
+ case I.ADD:
1240
+ return T({
1242
1241
  id: n,
1243
- targetType: o,
1242
+ targetType: r,
1244
1243
  oldValue: void 0,
1245
1244
  newValue: t.data
1246
1245
  });
1247
- case k.UPDATE:
1248
- return C({
1246
+ case I.UPDATE:
1247
+ return T({
1249
1248
  id: n,
1250
- targetType: o,
1251
- oldValue: Oe(e, t.field),
1249
+ targetType: r,
1250
+ oldValue: De(e, t.field),
1252
1251
  newValue: t.data
1253
1252
  });
1254
- case k.REMOVE:
1255
- return C({
1253
+ case I.REMOVE:
1254
+ return T({
1256
1255
  id: n,
1257
- targetType: o,
1258
- oldValue: Oe(e, t.field),
1256
+ targetType: r,
1257
+ oldValue: De(e, t.field),
1259
1258
  newValue: void 0
1260
1259
  });
1261
1260
  }
1262
1261
  }
1263
- function _o(e, t, n) {
1262
+ function Lr(e, t, n) {
1264
1263
  switch (t.action) {
1265
- case k.ADD: {
1266
- if (!t.data) return V(n, "parameter");
1267
- const { in: o, name: r, value: a } = t.data;
1268
- return C({
1264
+ case I.ADD: {
1265
+ if (!t.data) return H(n, "parameter");
1266
+ const { in: r, name: o, value: a } = t.data;
1267
+ return T({
1269
1268
  id: n,
1270
- targetType: re(o),
1271
- targetKey: r,
1269
+ targetType: oe(r),
1270
+ targetKey: o,
1272
1271
  oldValue: void 0,
1273
1272
  newValue: a
1274
1273
  });
1275
1274
  }
1276
- case k.UPDATE: {
1277
- if (!t.id && !t.data?.name) return V(n, "parameter");
1278
- const o = $e(e, t), r = t.data?.in ?? o?.in ?? "parameter";
1279
- return C({
1275
+ case I.UPDATE: {
1276
+ if (!t.id && !t.data?.name) return H(n, "parameter");
1277
+ const r = Me(e, t), o = t.data?.in ?? r?.in ?? "parameter";
1278
+ return T({
1280
1279
  id: n,
1281
- targetType: re(r),
1282
- targetKey: t.data?.name ?? o?.key,
1283
- oldValue: o ? o.value ?? "" : void 0,
1280
+ targetType: oe(o),
1281
+ targetKey: t.data?.name ?? r?.key,
1282
+ oldValue: r ? r.value ?? "" : void 0,
1284
1283
  newValue: t.data?.value
1285
1284
  });
1286
1285
  }
1287
- case k.REMOVE: {
1288
- if (!t.id && !t.data?.name) return V(n, "parameter");
1289
- const o = $e(e, t), r = t.data?.in ?? o?.in ?? "parameter";
1290
- return C({
1286
+ case I.REMOVE: {
1287
+ if (!t.id && !t.data?.name) return H(n, "parameter");
1288
+ const r = Me(e, t), o = t.data?.in ?? r?.in ?? "parameter";
1289
+ return T({
1291
1290
  id: n,
1292
- targetType: re(r),
1293
- targetKey: o?.key ?? t.data?.name,
1294
- oldValue: o ? o.value ?? "" : void 0,
1291
+ targetType: oe(o),
1292
+ targetKey: r?.key ?? t.data?.name,
1293
+ oldValue: r ? r.value ?? "" : void 0,
1295
1294
  newValue: void 0
1296
1295
  });
1297
1296
  }
1298
1297
  }
1299
1298
  }
1300
- function Vo(e, t, n) {
1299
+ function Pr(e, t, n) {
1301
1300
  switch (t.action) {
1302
- case k.ADD:
1303
- return t.data ? C({
1301
+ case I.ADD:
1302
+ return t.data ? T({
1304
1303
  id: n,
1305
1304
  targetType: "Output",
1306
1305
  targetKey: t.data.name,
1307
1306
  oldValue: void 0,
1308
1307
  newValue: t.data.expression
1309
- }) : C({
1308
+ }) : T({
1310
1309
  id: n,
1311
1310
  targetType: "Output",
1312
1311
  oldValue: void 0,
1313
1312
  newValue: void 0
1314
1313
  });
1315
- case k.UPDATE: {
1314
+ case I.UPDATE: {
1316
1315
  if (!t.data)
1317
- return C({
1316
+ return T({
1318
1317
  id: n,
1319
1318
  targetType: "Output",
1320
1319
  oldValue: void 0,
1321
1320
  newValue: void 0
1322
1321
  });
1323
- const o = t.id && e ? ze(e, t.id) : void 0;
1324
- return C({
1322
+ const r = t.id && e ? ze(e, t.id) : void 0;
1323
+ return T({
1325
1324
  id: n,
1326
1325
  targetType: "Output",
1327
1326
  targetKey: t.data.name,
1328
- oldValue: o?.value,
1327
+ oldValue: r?.value,
1329
1328
  newValue: t.data.expression
1330
1329
  });
1331
1330
  }
1332
- case k.REMOVE: {
1333
- if (!t.id && !t.data?.name) return V(n, "Output");
1334
- let o = t.id && e ? ze(e, t.id) : void 0;
1335
- return !o && e && t.data?.name && (o = jo(e, t.data.name)), C({
1331
+ case I.REMOVE: {
1332
+ if (!t.id && !t.data?.name) return H(n, "Output");
1333
+ let r = t.id && e ? ze(e, t.id) : void 0;
1334
+ return !r && e && t.data?.name && (r = Mr(e, t.data.name)), T({
1336
1335
  id: n,
1337
1336
  targetType: "Output",
1338
- targetKey: o?.key ?? t.data?.name,
1339
- oldValue: o?.value,
1337
+ targetKey: r?.key ?? t.data?.name,
1338
+ oldValue: r?.value,
1340
1339
  newValue: void 0
1341
1340
  });
1342
1341
  }
1343
1342
  }
1344
1343
  }
1345
- function Bo(e, t, n) {
1346
- const { data: o } = t;
1344
+ function Er(e, t, n) {
1345
+ const { data: r } = t;
1347
1346
  switch (t.action) {
1348
- case k.ADD:
1347
+ case I.ADD:
1349
1348
  return Y({
1350
- data: o,
1349
+ data: r,
1351
1350
  baseId: n,
1352
1351
  targetType: "Body",
1353
1352
  getOldValue: () => {
1354
1353
  },
1355
- getNewValue: (r) => r === "content" ? he(o.content, o.contentType) : de(o[r]),
1356
- resolveTargetKey: (r) => r === "content" ? void 0 : r
1354
+ getNewValue: (o) => o === "content" ? fe(r.content, r.contentType) : ce(r[o]),
1355
+ resolveTargetKey: (o) => o === "content" ? void 0 : o
1357
1356
  });
1358
- case k.UPDATE: {
1359
- const r = e?.requestBody.type.get(), a = o.contentType ?? r;
1357
+ case I.UPDATE: {
1358
+ const o = e?.requestBody.type.get(), a = r.contentType ?? o;
1360
1359
  return Y({
1361
- data: o,
1360
+ data: r,
1362
1361
  baseId: n,
1363
1362
  targetType: "Body",
1364
1363
  getOldValue: (s) => {
1365
1364
  if (e) {
1366
1365
  if (s === "content")
1367
- return he(e.requestBody.content.get(), r) || void 0;
1368
- if (s === "contentType") return r;
1366
+ return fe(e.requestBody.content.get(), o) || void 0;
1367
+ if (s === "contentType") return o;
1369
1368
  }
1370
1369
  },
1371
- getNewValue: (s) => s === "content" ? he(o.content, a) : de(o[s]),
1370
+ getNewValue: (s) => s === "content" ? fe(r.content, a) : ce(r[s]),
1372
1371
  resolveTargetKey: (s) => s === "content" ? void 0 : s
1373
1372
  });
1374
1373
  }
1375
- case k.REMOVE: {
1376
- const r = e ? be({
1374
+ case I.REMOVE: {
1375
+ const o = e ? be({
1377
1376
  contentType: e.requestBody.type.get(),
1378
1377
  content: e.requestBody.content.get()
1379
1378
  }) : void 0;
1380
- return C({
1379
+ return T({
1381
1380
  id: n,
1382
1381
  targetType: "Body",
1383
- oldValue: r,
1382
+ oldValue: o,
1384
1383
  newValue: void 0
1385
1384
  });
1386
1385
  }
1387
1386
  }
1388
1387
  }
1389
- function Ho(e, t, n) {
1388
+ function Rr(e, t, n) {
1390
1389
  switch (t.action) {
1391
- case k.ADD:
1390
+ case I.ADD:
1392
1391
  return t.data ? Y({
1393
1392
  data: t.data,
1394
1393
  baseId: n,
1395
1394
  targetType: "successCriteria",
1396
1395
  getOldValue: () => {
1397
1396
  },
1398
- getNewValue: (o) => de(t.data[o])
1399
- }) : V(n, "successCriteria");
1400
- case k.UPDATE: {
1401
- if (!t.data) return V(n, "successCriteria");
1402
- const o = typeof t.id == "string" && e ? De(e, t.id) : void 0;
1397
+ getNewValue: (r) => ce(t.data[r])
1398
+ }) : H(n, "successCriteria");
1399
+ case I.UPDATE: {
1400
+ if (!t.data) return H(n, "successCriteria");
1401
+ const r = typeof t.id == "string" && e ? _e(e, t.id) : void 0;
1403
1402
  return Y({
1404
1403
  data: t.data,
1405
1404
  baseId: n,
1406
1405
  targetType: "successCriteria",
1407
- getOldValue: (r) => {
1408
- if (o) {
1409
- if (r === "condition") return o.condition;
1410
- if (r === "context") return o.context ?? void 0;
1411
- if (r === "type") return o.type;
1406
+ getOldValue: (o) => {
1407
+ if (r) {
1408
+ if (o === "condition") return r.condition;
1409
+ if (o === "context") return r.context ?? void 0;
1410
+ if (o === "type") return r.type;
1412
1411
  }
1413
1412
  },
1414
- getNewValue: (r) => de(t.data[r])
1413
+ getNewValue: (o) => ce(t.data[o])
1415
1414
  });
1416
1415
  }
1417
- case k.REMOVE: {
1418
- if (typeof t.id != "string") return V(n, "successCriteria");
1419
- const o = e ? De(e, t.id) : void 0;
1420
- return C({
1416
+ case I.REMOVE: {
1417
+ if (typeof t.id != "string") return H(n, "successCriteria");
1418
+ const r = e ? _e(e, t.id) : void 0;
1419
+ return T({
1421
1420
  id: n,
1422
1421
  targetType: "successCriteria",
1423
- targetKey: o?.condition,
1424
- oldValue: o ? be(o) : void 0,
1422
+ targetKey: r?.condition,
1423
+ oldValue: r ? be(r) : void 0,
1425
1424
  newValue: void 0
1426
1425
  });
1427
1426
  }
1428
1427
  }
1429
1428
  }
1430
- function Oe(e, t) {
1429
+ function De(e, t) {
1431
1430
  if (e)
1432
1431
  switch (t) {
1433
1432
  case "method":
@@ -1438,140 +1437,140 @@ function Oe(e, t) {
1438
1437
  return e.description.get();
1439
1438
  }
1440
1439
  }
1441
- function $e(e, t) {
1442
- let n = t.id && e ? No(e, t.id) : null;
1443
- return !n && e && t.data?.name && (n = Fo(e, t.data.name)), n;
1440
+ function Me(e, t) {
1441
+ let n = t.id && e ? Or(e, t.id) : null;
1442
+ return !n && e && t.data?.name && (n = Dr(e, t.data.name)), n;
1444
1443
  }
1445
- function it(e, t) {
1444
+ function rt(e, t) {
1446
1445
  for (const n of ["path", "query", "header", "cookie"]) {
1447
- const o = e.parameters[Bt[n]].get().find((r) => At(r) && t(r));
1448
- if (o) return o;
1446
+ const r = e.parameters[Mt[n]].get().find((o) => bt(o) && t(o));
1447
+ if (r) return r;
1449
1448
  }
1450
1449
  return null;
1451
1450
  }
1452
- function No(e, t) {
1453
- return it(e, (n) => n.id === t);
1451
+ function Or(e, t) {
1452
+ return rt(e, (n) => n.id === t);
1454
1453
  }
1455
- function Fo(e, t) {
1456
- return it(e, (n) => n.key === t);
1454
+ function Dr(e, t) {
1455
+ return rt(e, (n) => n.key === t);
1457
1456
  }
1458
- function De(e, t) {
1457
+ function _e(e, t) {
1459
1458
  return e.successCriteria.get().find((n) => n.condition === t);
1460
1459
  }
1461
- function at(e, t) {
1460
+ function ot(e, t) {
1462
1461
  for (const n of e.outputs.get())
1463
1462
  if (t(n))
1464
1463
  return {
1465
- key: le(n.key),
1466
- value: le(n.value)
1464
+ key: se(n.key),
1465
+ value: se(n.value)
1467
1466
  };
1468
1467
  }
1469
1468
  function ze(e, t) {
1470
- return at(e, (n) => le(n.id) === t);
1469
+ return ot(e, (n) => se(n.id) === t);
1471
1470
  }
1472
- function jo(e, t) {
1473
- return at(e, (n) => le(n.key) === t);
1471
+ function Mr(e, t) {
1472
+ return ot(e, (n) => se(n.key) === t);
1474
1473
  }
1475
- function le(e) {
1474
+ function se(e) {
1476
1475
  return typeof e == "string" ? e : e.get();
1477
1476
  }
1478
- function de(e) {
1477
+ function ce(e) {
1479
1478
  return e == null ? "" : typeof e == "string" ? e : be(e);
1480
1479
  }
1481
- function he(e, t) {
1482
- if (!e || t !== St.JSON) return e;
1480
+ function fe(e, t) {
1481
+ if (!e || t !== Ct.JSON) return e;
1483
1482
  try {
1484
1483
  return JSON.stringify(JSON.parse(e), null, 2);
1485
1484
  } catch {
1486
1485
  return e;
1487
1486
  }
1488
1487
  }
1489
- const Wo = {
1490
- update_security: Po,
1491
- update_step: $o
1488
+ const _r = {
1489
+ update_security: wr,
1490
+ update_step: kr
1492
1491
  };
1493
- function st(e, t) {
1494
- const n = We(), o = A(() => {
1495
- const l = e ? Wo[e] : void 0;
1492
+ function it(e, t) {
1493
+ const n = Ue(), r = A(() => {
1494
+ const l = e ? _r[e] : void 0;
1496
1495
  if (!l) return [];
1497
1496
  try {
1498
1497
  return l({ store: n, input: t });
1499
1498
  } catch (u) {
1500
1499
  return console.error("Unable to build change previews", u), [];
1501
1500
  }
1502
- }, [e, n, t]), [r, a] = G(
1503
- () => Object.fromEntries(o.map((l) => [l.id, l.included]))
1501
+ }, [e, n, t]), [o, a] = G(
1502
+ () => Object.fromEntries(r.map((l) => [l.id, l.included]))
1504
1503
  ), s = A(
1505
- () => o.map((l) => ({ ...l, included: r[l.id] ?? l.included })),
1506
- [o, r]
1507
- ), d = D(
1504
+ () => r.map((l) => ({ ...l, included: o[l.id] ?? l.included })),
1505
+ [r, o]
1506
+ ), d = _(
1508
1507
  (l) => {
1509
1508
  a(typeof l == "function" ? (u) => {
1510
- const f = o.map((p) => ({
1509
+ const f = r.map((p) => ({
1511
1510
  ...p,
1512
1511
  included: u[p.id] ?? p.included
1513
1512
  }));
1514
1513
  return Object.fromEntries(l(f).map((p) => [p.id, p.included]));
1515
1514
  } : Object.fromEntries(l.map((u) => [u.id, u.included])));
1516
1515
  },
1517
- [o]
1516
+ [r]
1518
1517
  );
1519
1518
  return { previews: s, setPreviews: d };
1520
1519
  }
1521
- function Uo({
1520
+ function zr({
1522
1521
  toolCallId: e,
1523
1522
  toolName: t,
1524
1523
  input: n,
1525
- onApprove: o,
1526
- onDeny: r
1524
+ onApprove: r,
1525
+ onDeny: o
1527
1526
  }) {
1528
- const { updateMessages: a } = Q(), { previews: s, setPreviews: d } = st(t, n), { includedCount: l, totalCount: u } = A(
1527
+ const { updateMessages: a } = Q(), { previews: s, setPreviews: d } = it(t, n), { includedCount: l, totalCount: u } = A(
1529
1528
  () => ({
1530
- includedCount: s.filter((v) => v.included).length,
1529
+ includedCount: s.filter((m) => m.included).length,
1531
1530
  totalCount: s.length
1532
1531
  }),
1533
1532
  [s]
1534
1533
  ), { approveLabel: f, denyLabel: p } = A(
1535
- () => qn(t, n),
1534
+ () => Bn(t, n),
1536
1535
  [t, n]
1537
- ), g = D(() => {
1538
- a((v) => {
1536
+ ), g = _(() => {
1537
+ a((m) => {
1539
1538
  const x = [];
1540
- for (let b = 0; b < v.length; b++) {
1541
- const w = v[b], { parts: y } = w, S = w.role === "assistant", E = y.some(
1542
- (R) => Qe(R, e)
1539
+ for (let b = 0; b < m.length; b++) {
1540
+ const w = m[b], { parts: v } = w, S = w.role === "assistant", R = v.some(
1541
+ (O) => Ze(O, e)
1543
1542
  );
1544
- if (S && E) {
1545
- const R = Jn(w, e, s);
1546
- x.push({ index: b, message: R });
1543
+ if (S && R) {
1544
+ const O = jn(w, e, s);
1545
+ x.push({ index: b, message: O });
1547
1546
  }
1548
1547
  }
1549
1548
  return x;
1550
- }), o();
1551
- }, [s, o, a, e]), m = D(
1552
- (v) => {
1549
+ }), r();
1550
+ }, [s, r, a, e]), y = _(
1551
+ (m) => {
1553
1552
  d(
1554
1553
  (x) => x.map(
1555
- (b, w) => w === v ? { ...b, included: !b.included } : b
1554
+ (b, w) => w === m ? { ...b, included: !b.included } : b
1556
1555
  )
1557
1556
  );
1558
1557
  },
1559
1558
  [d]
1560
1559
  );
1561
- return /* @__PURE__ */ h(Yo, { children: [
1562
- /* @__PURE__ */ i(ot, { toolName: t, input: n }),
1563
- s.length ? /* @__PURE__ */ i(Go, { children: /* @__PURE__ */ i(et, { previews: s, handleToggle: m }) }) : null,
1564
- s.length ? /* @__PURE__ */ i(Ue, {}) : null,
1565
- /* @__PURE__ */ h(qo, { children: [
1566
- u > 1 ? /* @__PURE__ */ h(Ko, { children: [
1560
+ return /* @__PURE__ */ h(Vr, { children: [
1561
+ /* @__PURE__ */ i(tt, { toolName: t, input: n }),
1562
+ s.length ? /* @__PURE__ */ i($r, { children: /* @__PURE__ */ i(Qe, { previews: s, handleToggle: y }) }) : null,
1563
+ s.length ? /* @__PURE__ */ i(We, {}) : null,
1564
+ /* @__PURE__ */ h(Hr, { children: [
1565
+ u > 1 ? /* @__PURE__ */ h(Br, { children: [
1567
1566
  l,
1568
1567
  " of ",
1569
1568
  u,
1570
1569
  " selected"
1571
1570
  ] }) : null,
1572
- /* @__PURE__ */ i(Zo, { size: "small", variant: "secondary", onClick: r, children: p }),
1571
+ /* @__PURE__ */ i(Fr, { size: "small", variant: "secondary", onClick: o, children: p }),
1573
1572
  /* @__PURE__ */ i(
1574
- Jo,
1573
+ Nr,
1575
1574
  {
1576
1575
  size: "small",
1577
1576
  variant: "primary",
@@ -1583,7 +1582,7 @@ function Uo({
1583
1582
  ] })
1584
1583
  ] });
1585
1584
  }
1586
- const Yo = c.div`
1585
+ const Vr = c.div`
1587
1586
  display: flex;
1588
1587
  color: var(--text-color-primary);
1589
1588
  flex-direction: column;
@@ -1594,27 +1593,27 @@ const Yo = c.div`
1594
1593
  border: 1px solid var(--border-color-secondary);
1595
1594
  background: var(--layer-color);
1596
1595
  line-height: var(--line-height-sm);
1597
- `, Go = c.div`
1596
+ `, $r = c.div`
1598
1597
  display: flex;
1599
1598
  flex-direction: column;
1600
1599
  gap: var(--spacing-xs);
1601
1600
  min-width: 0;
1602
- `, qo = c.div`
1601
+ `, Hr = c.div`
1603
1602
  display: flex;
1604
1603
  flex-wrap: wrap;
1605
1604
  justify-content: flex-end;
1606
1605
  align-items: center;
1607
1606
  padding: 0 var(--spacing-sm) var(--spacing-xs) var(--spacing-sm);
1608
1607
  gap: var(--spacing-xxs);
1609
- `, Ko = c.span`
1608
+ `, Br = c.span`
1610
1609
  flex: 1;
1611
1610
  font-size: var(--font-size-sm);
1612
1611
  font-weight: var(--font-weight-regular);
1613
1612
  line-height: var(--line-height-sm);
1614
1613
  color: var(--text-color-secondary);
1615
- `, Zo = c(B)`
1614
+ `, Fr = c(P)`
1616
1615
  background: none;
1617
- `, Jo = c(B)`
1616
+ `, Nr = c(P)`
1618
1617
  border: 1px solid var(--button-bg-color);
1619
1618
  padding-top: 0;
1620
1619
  padding-bottom: 0;
@@ -1622,66 +1621,66 @@ const Yo = c.div`
1622
1621
  border: 1px solid var(--button-border-color-disabled);
1623
1622
  }
1624
1623
  `;
1625
- function Xo({
1624
+ function jr({
1626
1625
  approvalId: e,
1627
1626
  toolCallId: t,
1628
1627
  toolName: n,
1629
- input: o
1628
+ input: r
1630
1629
  }) {
1631
- const { addToolApprovalResponse: r } = Q(), a = D(() => {
1632
- r({ id: e, approved: !0 });
1633
- }, [e, r]), s = D(() => {
1634
- r({ id: e, approved: !1 });
1635
- }, [e, r]);
1630
+ const { addToolApprovalResponse: o } = Q(), a = _(() => {
1631
+ o({ id: e, approved: !0 });
1632
+ }, [e, o]), s = _(() => {
1633
+ o({ id: e, approved: !1 });
1634
+ }, [e, o]);
1636
1635
  return /* @__PURE__ */ i(
1637
- Uo,
1636
+ zr,
1638
1637
  {
1639
1638
  onApprove: a,
1640
1639
  onDeny: s,
1641
1640
  toolCallId: t,
1642
1641
  toolName: n,
1643
- input: o
1642
+ input: r
1644
1643
  }
1645
1644
  );
1646
1645
  }
1647
- function Qo({
1646
+ function Ur({
1648
1647
  toolName: e,
1649
1648
  toolCallId: t,
1650
1649
  input: n,
1651
- isDenied: o,
1652
- messageMetadata: r,
1650
+ isDenied: r,
1651
+ messageMetadata: o,
1653
1652
  onUndo: a
1654
1653
  }) {
1655
1654
  const s = A(
1656
- () => Zn(r, t),
1657
- [r, t]
1658
- ), { previews: d } = st(
1655
+ () => Nn(o, t),
1656
+ [o, t]
1657
+ ), { previews: d } = it(
1659
1658
  s ? void 0 : e,
1660
1659
  n
1661
1660
  ), l = A(() => {
1662
1661
  const g = s ?? d;
1663
- if (o)
1664
- return g.map((v) => ({ ...v, included: !1 }));
1665
- const m = Kn(n);
1666
- return g.map((v, x) => ({
1667
- ...v,
1668
- included: m[x] ?? v.included
1662
+ if (r)
1663
+ return g.map((m) => ({ ...m, included: !1 }));
1664
+ const y = Fn(n);
1665
+ return g.map((m, x) => ({
1666
+ ...m,
1667
+ included: y[x] ?? m.included
1669
1668
  }));
1670
- }, [s, d, n, o]);
1669
+ }, [s, d, n, r]);
1671
1670
  if (l.length === 0)
1672
1671
  return null;
1673
1672
  const u = l.filter((g) => g.included).length, p = u === 0 ? "Nothing applied" : `${u} ${u === 1 ? "change" : "changes"} applied`;
1674
- return /* @__PURE__ */ h(er, { children: [
1675
- /* @__PURE__ */ i(ot, { toolName: e, input: n }),
1676
- /* @__PURE__ */ i(tr, { children: /* @__PURE__ */ i(et, { previews: l, readOnly: !0 }) }),
1677
- /* @__PURE__ */ i(Ue, {}),
1678
- /* @__PURE__ */ h(nr, { children: [
1679
- /* @__PURE__ */ i(or, { children: p }),
1680
- a ? /* @__PURE__ */ i(rr, { size: "small", variant: "outlined", onClick: a, children: "Undo" }) : null
1673
+ return /* @__PURE__ */ h(Wr, { children: [
1674
+ /* @__PURE__ */ i(tt, { toolName: e, input: n }),
1675
+ /* @__PURE__ */ i(Yr, { children: /* @__PURE__ */ i(Qe, { previews: l, readOnly: !0 }) }),
1676
+ /* @__PURE__ */ i(We, {}),
1677
+ /* @__PURE__ */ h(Gr, { children: [
1678
+ /* @__PURE__ */ i(qr, { children: p }),
1679
+ a ? /* @__PURE__ */ i(Kr, { size: "small", variant: "outlined", onClick: a, children: "Undo" }) : null
1681
1680
  ] })
1682
1681
  ] });
1683
1682
  }
1684
- const er = c.div`
1683
+ const Wr = c.div`
1685
1684
  display: flex;
1686
1685
  color: var(--text-color-primary);
1687
1686
  flex-direction: column;
@@ -1691,77 +1690,77 @@ const er = c.div`
1691
1690
  border: 1px solid var(--border-color-secondary);
1692
1691
  background: var(--layer-color);
1693
1692
  line-height: var(--line-height-sm);
1694
- `, tr = c.div`
1693
+ `, Yr = c.div`
1695
1694
  display: flex;
1696
1695
  flex-direction: column;
1697
1696
  min-width: 0;
1698
- `, nr = c.div`
1697
+ `, Gr = c.div`
1699
1698
  display: flex;
1700
1699
  justify-content: space-between;
1701
1700
  align-items: center;
1702
1701
  padding: var(--spacing-xs) var(--spacing-sm);
1703
1702
  gap: var(--spacing-xs);
1704
- `, or = c.span`
1703
+ `, qr = c.span`
1705
1704
  font-size: var(--font-size-sm);
1706
1705
  font-weight: var(--font-weight-regular);
1707
1706
  line-height: var(--line-height-sm);
1708
1707
  color: var(--text-color-secondary);
1709
- `, rr = c(B)`
1708
+ `, Kr = c(P)`
1710
1709
  padding-top: 0;
1711
1710
  padding-bottom: 0;
1712
1711
  `;
1713
- function ir({ items: e, isLast: t }) {
1714
- const [n, o] = G(t), r = D(() => {
1715
- o((s) => !s);
1712
+ function Jr({ items: e, isLast: t }) {
1713
+ const [n, r] = G(t), o = _(() => {
1714
+ r((s) => !s);
1716
1715
  }, []), a = A(() => e.filter((s) => s.kind === "action"), [e]);
1717
- return /* @__PURE__ */ h(sr, { children: [
1718
- /* @__PURE__ */ h(cr, { type: "button", onClick: r, "aria-expanded": n, children: [
1719
- /* @__PURE__ */ i(lr, { children: n ? /* @__PURE__ */ i(Zt, { size: "12px", color: "var(--icon-color-additional)" }) : /* @__PURE__ */ i(Jt, { size: "12px", color: "var(--icon-color-additional)" }) }),
1720
- /* @__PURE__ */ h(dr, { children: [
1716
+ return /* @__PURE__ */ h(Zr, { children: [
1717
+ /* @__PURE__ */ h(Qr, { type: "button", onClick: o, "aria-expanded": n, children: [
1718
+ /* @__PURE__ */ i(eo, { children: n ? /* @__PURE__ */ i(Gt, { size: "12px", color: "var(--icon-color-additional)" }) : /* @__PURE__ */ i(qt, { size: "12px", color: "var(--icon-color-additional)" }) }),
1719
+ /* @__PURE__ */ h(to, { children: [
1721
1720
  a.length,
1722
1721
  " ",
1723
1722
  a.length === 1 ? "action" : "actions"
1724
1723
  ] })
1725
1724
  ] }),
1726
- n && /* @__PURE__ */ i(ur, { children: a.map((s, d) => /* @__PURE__ */ i(ar, { text: s.text }, d)) })
1725
+ n && /* @__PURE__ */ i(no, { children: a.map((s, d) => /* @__PURE__ */ i(Xr, { text: s.text }, d)) })
1727
1726
  ] });
1728
1727
  }
1729
- function ar({ text: e }) {
1730
- return /* @__PURE__ */ h(fr, { children: [
1731
- /* @__PURE__ */ h(pr, { children: [
1732
- /* @__PURE__ */ i(hr, { "aria-hidden": !0 }),
1733
- /* @__PURE__ */ i(gr, { children: /* @__PURE__ */ i(vr, { "aria-hidden": !0 }) }),
1734
- /* @__PURE__ */ i(ct, { "aria-hidden": !0 })
1728
+ function Xr({ text: e }) {
1729
+ return /* @__PURE__ */ h(ro, { children: [
1730
+ /* @__PURE__ */ h(oo, { children: [
1731
+ /* @__PURE__ */ i(io, { "aria-hidden": !0 }),
1732
+ /* @__PURE__ */ i(ao, { children: /* @__PURE__ */ i(so, { "aria-hidden": !0 }) }),
1733
+ /* @__PURE__ */ i(at, { "aria-hidden": !0 })
1735
1734
  ] }),
1736
- /* @__PURE__ */ i(mr, { children: e })
1735
+ /* @__PURE__ */ i(co, { children: e })
1737
1736
  ] });
1738
1737
  }
1739
- const sr = c.div`
1738
+ const Zr = c.div`
1740
1739
  display: flex;
1741
1740
  flex-direction: column;
1742
1741
  width: 100%;
1743
1742
  min-width: 0;
1744
- `, cr = c.button`
1743
+ `, Qr = c.button`
1745
1744
  display: flex;
1746
1745
  align-items: center;
1747
1746
  cursor: pointer;
1748
1747
  user-select: none;
1749
1748
  width: fit-content;
1750
1749
  padding: 0;
1751
- `, lr = c.span`
1750
+ `, eo = c.span`
1752
1751
  display: flex;
1753
1752
  align-items: center;
1754
1753
  flex-shrink: 0;
1755
- `, dr = c.span`
1754
+ `, to = c.span`
1756
1755
  font-size: var(--font-size-sm);
1757
1756
  font-weight: var(--font-weight-regular);
1758
1757
  line-height: var(--line-height-sm);
1759
1758
  color: var(--text-color-description);
1760
- `, ur = c.div`
1759
+ `, no = c.div`
1761
1760
  display: flex;
1762
1761
  flex-direction: column;
1763
1762
  gap: 0;
1764
- `, ct = c.span`
1763
+ `, at = c.span`
1765
1764
  display: block;
1766
1765
  width: 1px;
1767
1766
  flex-shrink: 0;
@@ -1769,7 +1768,7 @@ const sr = c.div`
1769
1768
  background: var(--border-color-secondary);
1770
1769
  flex: 1 1 auto;
1771
1770
  min-height: 8px;
1772
- `, fr = c.div`
1771
+ `, ro = c.div`
1773
1772
  display: flex;
1774
1773
  flex-direction: row;
1775
1774
  align-items: stretch;
@@ -1777,11 +1776,11 @@ const sr = c.div`
1777
1776
  min-width: 0;
1778
1777
 
1779
1778
  &:last-child {
1780
- ${ct} {
1779
+ ${at} {
1781
1780
  display: none;
1782
1781
  }
1783
1782
  }
1784
- `, pr = c.div`
1783
+ `, oo = c.div`
1785
1784
  display: flex;
1786
1785
  flex-direction: column;
1787
1786
  align-items: center;
@@ -1790,14 +1789,14 @@ const sr = c.div`
1790
1789
  flex: 0 0 auto;
1791
1790
  align-self: stretch;
1792
1791
  min-height: 0;
1793
- `, hr = c.span`
1792
+ `, io = c.span`
1794
1793
  display: block;
1795
1794
  width: 1px;
1796
1795
  height: 4px;
1797
1796
  flex: 0 0 auto;
1798
1797
  flex-shrink: 0;
1799
1798
  background: var(--border-color-secondary);
1800
- `, gr = c.div`
1799
+ `, ao = c.div`
1801
1800
  width: 12px;
1802
1801
  height: 12px;
1803
1802
  flex: 0 0 auto;
@@ -1805,7 +1804,7 @@ const sr = c.div`
1805
1804
  display: flex;
1806
1805
  align-items: center;
1807
1806
  justify-content: center;
1808
- `, vr = c.span`
1807
+ `, so = c.span`
1809
1808
  width: 4px;
1810
1809
  height: 4px;
1811
1810
  flex-shrink: 0;
@@ -1813,7 +1812,7 @@ const sr = c.div`
1813
1812
  box-sizing: border-box;
1814
1813
  border: 1px solid var(--border-color-secondary);
1815
1814
  background: transparent;
1816
- `, mr = c.span`
1815
+ `, co = c.span`
1817
1816
  flex: 1;
1818
1817
  min-width: 0;
1819
1818
  align-self: flex-start;
@@ -1822,59 +1821,59 @@ const sr = c.div`
1822
1821
  line-height: var(--line-height-sm);
1823
1822
  color: var(--text-color-helper);
1824
1823
  `;
1825
- function yr({
1824
+ function lo({
1826
1825
  items: e,
1827
1826
  messageMetadata: t
1828
1827
  }) {
1829
- return /* @__PURE__ */ i(br, { children: e.map((n, o) => {
1828
+ return /* @__PURE__ */ i(fo, { children: e.map((n, r) => {
1830
1829
  if (n.kind === "reasoning-block") {
1831
- const s = o === e.length - 1;
1832
- return /* @__PURE__ */ i(ir, { items: n.items, isLast: s }, n.key);
1830
+ const s = r === e.length - 1;
1831
+ return /* @__PURE__ */ i(Jr, { items: n.items, isLast: s }, n.key);
1833
1832
  }
1834
1833
  if (n.kind === "text")
1835
1834
  return /* @__PURE__ */ i(
1836
- xr,
1835
+ uo,
1837
1836
  {
1838
1837
  rawMarkdown: n.text,
1839
1838
  workflowRunHistoryIds: n.workflowRunHistoryIds
1840
1839
  },
1841
1840
  n.key
1842
1841
  );
1843
- const { part: r } = n, a = Ht(r.type);
1844
- return a && qe(r) ? /* @__PURE__ */ i(
1845
- Xo,
1842
+ const { part: o } = n, a = _t(o.type);
1843
+ return a && qe(o) ? /* @__PURE__ */ i(
1844
+ jr,
1846
1845
  {
1847
- approvalId: r.approval.id,
1848
- toolCallId: r.toolCallId,
1846
+ approvalId: o.approval.id,
1847
+ toolCallId: o.toolCallId,
1849
1848
  toolName: a,
1850
- input: r.input
1849
+ input: o.input
1851
1850
  },
1852
1851
  n.key
1853
- ) : a && Nt(r) ? /* @__PURE__ */ i(
1854
- Qo,
1852
+ ) : a && zt(o) ? /* @__PURE__ */ i(
1853
+ Ur,
1855
1854
  {
1856
1855
  toolName: a,
1857
- toolCallId: r.toolCallId,
1858
- input: r.input,
1859
- isDenied: r.state === "output-denied",
1856
+ toolCallId: o.toolCallId,
1857
+ input: o.input,
1858
+ isDenied: o.state === "output-denied",
1860
1859
  messageMetadata: t
1861
1860
  },
1862
1861
  n.key
1863
1862
  ) : null;
1864
1863
  }) });
1865
1864
  }
1866
- function xr({
1865
+ function uo({
1867
1866
  rawMarkdown: e,
1868
1867
  workflowRunHistoryIds: t
1869
1868
  }) {
1870
1869
  const n = Xe({ workflowRunHistoryIds: t });
1871
- return /* @__PURE__ */ i(wr, { onClick: n, children: /* @__PURE__ */ i(Lt, { rawMarkdown: e, parser: Pt }) });
1870
+ return /* @__PURE__ */ i(po, { onClick: n, children: /* @__PURE__ */ i(Tt, { rawMarkdown: e, parser: kt }) });
1872
1871
  }
1873
- const br = c.div`
1872
+ const fo = c.div`
1874
1873
  display: flex;
1875
1874
  flex-direction: column;
1876
1875
  gap: var(--spacing-xs);
1877
- `, wr = c.div`
1876
+ `, po = c.div`
1878
1877
  white-space: normal;
1879
1878
 
1880
1879
  max-width: 100%;
@@ -1887,12 +1886,12 @@ const br = c.div`
1887
1886
  p:last-child {
1888
1887
  margin-bottom: 0;
1889
1888
  }
1890
- `, lt = c.div`
1889
+ `, st = c.div`
1891
1890
  font-family: var(--font-family-base);
1892
1891
  font-size: var(--font-size-sm);
1893
1892
  line-height: var(--line-height-sm);
1894
1893
  color: var(--text-color-primary);
1895
- `, J = c.div`
1894
+ `, X = c.div`
1896
1895
  width: var(--search-ai-thinking-dot-size);
1897
1896
  height: var(--search-ai-thinking-dot-size);
1898
1897
  border-radius: 50%;
@@ -1924,70 +1923,70 @@ const br = c.div`
1924
1923
  }
1925
1924
  }
1926
1925
  `;
1927
- function Cr() {
1928
- return /* @__PURE__ */ h(kr, { children: [
1929
- /* @__PURE__ */ i(J, {}),
1930
- /* @__PURE__ */ i(J, {}),
1931
- /* @__PURE__ */ i(J, {})
1926
+ function ho() {
1927
+ return /* @__PURE__ */ h(go, { children: [
1928
+ /* @__PURE__ */ i(X, {}),
1929
+ /* @__PURE__ */ i(X, {}),
1930
+ /* @__PURE__ */ i(X, {})
1932
1931
  ] });
1933
1932
  }
1934
- const kr = c.div`
1933
+ const go = c.div`
1935
1934
  display: flex;
1936
1935
  align-items: center;
1937
1936
  justify-content: space-between;
1938
1937
  width: 24px;
1939
1938
  height: 24px;
1940
1939
  `;
1941
- function Tr() {
1942
- return /* @__PURE__ */ h(Ir, { children: [
1943
- /* @__PURE__ */ i(Cr, {}),
1944
- /* @__PURE__ */ i(Ar, { children: "Thinking" })
1940
+ function mo() {
1941
+ return /* @__PURE__ */ h(vo, { children: [
1942
+ /* @__PURE__ */ i(ho, {}),
1943
+ /* @__PURE__ */ i(yo, { children: "Thinking" })
1945
1944
  ] });
1946
1945
  }
1947
- const Ir = c.div`
1946
+ const vo = c.div`
1948
1947
  display: flex;
1949
1948
  align-items: center;
1950
1949
  gap: var(--spacing-xxs);
1951
- `, Ar = c.span`
1950
+ `, yo = c.span`
1952
1951
  font-family: var(--font-family-base);
1953
1952
  font-size: var(--font-size-sm);
1954
1953
  line-height: var(--line-height-sm);
1955
1954
  color: var(--text-color-helper);
1956
1955
  `;
1957
- function Sr({ items: e }) {
1958
- return /* @__PURE__ */ i(mt, { children: e.map((t) => t.kind !== "text" ? null : /* @__PURE__ */ i(lt, { children: t.text }, t.key)) });
1956
+ function xo({ items: e }) {
1957
+ return /* @__PURE__ */ i(gt, { children: e.map((t) => t.kind !== "text" ? null : /* @__PURE__ */ i(st, { children: t.text }, t.key)) });
1959
1958
  }
1960
- const Lr = "Something went wrong. Please try again.";
1961
- function Pr(e) {
1959
+ const wo = "Something went wrong. Please try again.";
1960
+ function bo(e) {
1962
1961
  const t = e?.message?.trim();
1963
- return t || Lr;
1962
+ return t || wo;
1964
1963
  }
1965
- function Er({ message: e, isLastMessage: t }) {
1966
- const { chatStatus: n, chatError: o } = Q(), { role: r, parts: a } = e, s = r === z.ASSISTANT, d = A(() => Ft(a), [a]), l = d.length > 0, u = n === "error" && t && s && !l;
1967
- return !l && !u ? null : /* @__PURE__ */ i(dt, { $role: r, children: /* @__PURE__ */ i(
1968
- Or,
1964
+ function Co({ message: e, isLastMessage: t }) {
1965
+ const { chatStatus: n, chatError: r } = Q(), { role: o, parts: a } = e, s = o === z.ASSISTANT, d = A(() => Vt(a), [a]), l = d.length > 0, u = n === "error" && t && s && !l;
1966
+ return !l && !u ? null : /* @__PURE__ */ i(ct, { $role: o, children: /* @__PURE__ */ i(
1967
+ ko,
1969
1968
  {
1970
1969
  isFailedEmptyAssistant: u,
1971
- chatError: o,
1970
+ chatError: r,
1972
1971
  isAssistant: s,
1973
1972
  contentItems: d,
1974
1973
  messageMetadata: e.metadata
1975
1974
  }
1976
1975
  ) });
1977
1976
  }
1978
- function Rr() {
1979
- return /* @__PURE__ */ i(dt, { $role: z.ASSISTANT, children: /* @__PURE__ */ i(xe, { children: /* @__PURE__ */ i(Tr, {}) }) });
1977
+ function To() {
1978
+ return /* @__PURE__ */ i(ct, { $role: z.ASSISTANT, children: /* @__PURE__ */ i(we, { children: /* @__PURE__ */ i(mo, {}) }) });
1980
1979
  }
1981
- function Or({
1980
+ function ko({
1982
1981
  isFailedEmptyAssistant: e,
1983
1982
  chatError: t,
1984
1983
  isAssistant: n,
1985
- contentItems: o,
1986
- messageMetadata: r
1984
+ contentItems: r,
1985
+ messageMetadata: o
1987
1986
  }) {
1988
- return e ? /* @__PURE__ */ i(xe, { children: /* @__PURE__ */ i(lt, { children: Pr(t) }) }) : /* @__PURE__ */ i(xe, { children: n ? /* @__PURE__ */ i(yr, { items: o, messageMetadata: r }) : /* @__PURE__ */ i(Sr, { items: o }) });
1987
+ return e ? /* @__PURE__ */ i(we, { children: /* @__PURE__ */ i(st, { children: bo(t) }) }) : /* @__PURE__ */ i(we, { children: n ? /* @__PURE__ */ i(lo, { items: r, messageMetadata: o }) : /* @__PURE__ */ i(xo, { items: r }) });
1989
1988
  }
1990
- const dt = c.div`
1989
+ const ct = c.div`
1991
1990
  display: flex;
1992
1991
  flex-direction: column;
1993
1992
  padding: var(--spacing-xs) var(--spacing-sm);
@@ -2002,33 +2001,33 @@ const dt = c.div`
2002
2001
  word-wrap: break-word;
2003
2002
  white-space: pre-wrap;
2004
2003
  max-width: 100%;
2005
- `, xe = c.div`
2004
+ `, we = c.div`
2006
2005
  display: flex;
2007
2006
  flex-direction: column;
2008
2007
  gap: var(--spacing-xxs);
2009
2008
  min-width: 0;
2010
2009
  width: 100%;
2011
2010
  `;
2012
- function $r() {
2013
- const { messages: e, isStreaming: t } = Q(), n = e.at(-1), o = A(() => {
2014
- const r = n?.role === z.ASSISTANT, a = n?.parts.at(-1)?.type === "text";
2015
- return t && !(r && a);
2011
+ function Io() {
2012
+ const { messages: e, isStreaming: t } = Q(), n = e.at(-1), r = A(() => {
2013
+ const o = n?.role === z.ASSISTANT, a = n?.parts.at(-1)?.type === "text";
2014
+ return t && !(o && a);
2016
2015
  }, [t, n?.parts, n?.role]);
2017
- return /* @__PURE__ */ h(Dr, { children: [
2018
- e.map((r, a) => /* @__PURE__ */ i(Me, { $role: r.role, children: /* @__PURE__ */ i(_e, { $role: r.role, children: /* @__PURE__ */ i(Er, { message: r, isLastMessage: a === e.length - 1 }) }) }, r.id)),
2019
- o && /* @__PURE__ */ i(Me, { $role: z.ASSISTANT, children: /* @__PURE__ */ i(_e, { $role: z.ASSISTANT, children: /* @__PURE__ */ i(Rr, {}) }) })
2016
+ return /* @__PURE__ */ h(Ao, { children: [
2017
+ e.map((o, a) => /* @__PURE__ */ i(Ve, { $role: o.role, children: /* @__PURE__ */ i($e, { $role: o.role, children: /* @__PURE__ */ i(Co, { message: o, isLastMessage: a === e.length - 1 }) }) }, o.id)),
2018
+ r && /* @__PURE__ */ i(Ve, { $role: z.ASSISTANT, children: /* @__PURE__ */ i($e, { $role: z.ASSISTANT, children: /* @__PURE__ */ i(To, {}) }) })
2020
2019
  ] });
2021
2020
  }
2022
- const Dr = c.div`
2021
+ const Ao = c.div`
2023
2022
  display: flex;
2024
2023
  flex-direction: column;
2025
2024
  gap: var(--spacing-xs);
2026
2025
  width: 100%;
2027
- `, Me = c.div`
2026
+ `, Ve = c.div`
2028
2027
  display: flex;
2029
2028
  width: 100%;
2030
2029
  justify-content: ${({ $role: e }) => e === z.USER ? "flex-end" : "flex-start"};
2031
- `, _e = c.div`
2030
+ `, $e = c.div`
2032
2031
  display: flex;
2033
2032
  flex-direction: column;
2034
2033
  align-items: ${({ $role: e }) => e === z.USER ? "flex-end" : "stretch"};
@@ -2037,20 +2036,20 @@ const Dr = c.div`
2037
2036
  width: 100%;
2038
2037
  max-width: 100%;
2039
2038
  `;
2040
- function zr(e) {
2041
- const t = N(void 0);
2042
- return H(() => {
2039
+ function So(e) {
2040
+ const t = F(void 0);
2041
+ return B(() => {
2043
2042
  t.current = e;
2044
2043
  }), t.current;
2045
2044
  }
2046
- const ut = c.div`
2045
+ const lt = c.div`
2047
2046
  display: flex;
2048
2047
  flex-direction: column;
2049
2048
  flex: 1;
2050
2049
  width: 100%;
2051
2050
  overflow: auto;
2052
2051
  padding: var(--spacing-xs);
2053
- `, Mr = (e) => /* @__PURE__ */ h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 14 14", fill: "none", ...e, children: [
2052
+ `, Lo = (e) => /* @__PURE__ */ h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 14 14", fill: "none", ...e, children: [
2054
2053
  /* @__PURE__ */ i(
2055
2054
  "path",
2056
2055
  {
@@ -2082,98 +2081,98 @@ const ut = c.div`
2082
2081
  ]
2083
2082
  }
2084
2083
  ) })
2085
- ] }), _r = c(Mr)`
2084
+ ] }), Po = c(Lo)`
2086
2085
  height: ${({ size: e }) => e || "14px"};
2087
2086
  width: ${({ size: e }) => e || "14px"};
2088
2087
  `;
2089
- function Vr(e) {
2088
+ function Eo(e) {
2090
2089
  const t = "var(--font-size-base)";
2091
2090
  switch (e) {
2092
2091
  case me:
2093
- return /* @__PURE__ */ i(_r, { size: t });
2094
- case pe.OPENAI:
2095
- return /* @__PURE__ */ i(rn, { size: t, color: "var(--text-color-primary)" });
2096
- case pe.GEMINI:
2097
- return /* @__PURE__ */ i(on, { size: t });
2098
- case pe.ANTHROPIC:
2099
- return /* @__PURE__ */ i(nn, { size: t, color: "var(--replay-claude-icon-color)" });
2092
+ return /* @__PURE__ */ i(Po, { size: t });
2093
+ case ue.OPENAI:
2094
+ return /* @__PURE__ */ i(Qt, { size: t, color: "var(--text-color-primary)" });
2095
+ case ue.GEMINI:
2096
+ return /* @__PURE__ */ i(en, { size: t });
2097
+ case ue.ANTHROPIC:
2098
+ return /* @__PURE__ */ i(tn, { size: t, color: "var(--replay-claude-icon-color)" });
2100
2099
  }
2101
2100
  }
2102
- function Br({
2101
+ function Ro({
2103
2102
  models: e,
2104
2103
  selectedModelId: t,
2105
2104
  placement: n,
2106
- onModelSelect: o,
2107
- onSettingsOpen: r
2105
+ onModelSelect: r,
2106
+ onSettingsOpen: o
2108
2107
  }) {
2109
2108
  const a = e.find((p) => p.id === t), s = a?.label ?? "Replay AI", d = a?.id, l = e.filter((p) => p.provider === me), u = e.filter((p) => p.provider !== me), f = l.length > 0 && u.length > 0;
2110
- return /* @__PURE__ */ i(jr, { children: /* @__PURE__ */ i(
2111
- Wr,
2109
+ return /* @__PURE__ */ i(_o, { children: /* @__PURE__ */ i(
2110
+ zo,
2112
2111
  {
2113
- trigger: /* @__PURE__ */ i(Hr, { label: s }),
2112
+ trigger: /* @__PURE__ */ i(Oo, { label: s }),
2114
2113
  placement: n,
2115
2114
  alignment: "start",
2116
2115
  withArrow: !0,
2117
- children: /* @__PURE__ */ h(Ur, { children: [
2118
- /* @__PURE__ */ h(qr, { children: [
2116
+ children: /* @__PURE__ */ h(Vo, { children: [
2117
+ /* @__PURE__ */ h(Bo, { children: [
2119
2118
  l.map((p) => /* @__PURE__ */ i(
2120
- Ve,
2119
+ He,
2121
2120
  {
2122
2121
  model: p,
2123
2122
  activeModelId: d,
2124
- onModelSelect: o
2123
+ onModelSelect: r
2125
2124
  },
2126
2125
  p.id
2127
2126
  )),
2128
2127
  f && /* @__PURE__ */ i(Be, { "aria-hidden": !0 }),
2129
2128
  u.length > 0 && /* @__PURE__ */ i(Ne, { children: u.map((p) => /* @__PURE__ */ i(
2130
- Ve,
2129
+ He,
2131
2130
  {
2132
2131
  model: p,
2133
2132
  activeModelId: d,
2134
- onModelSelect: o
2133
+ onModelSelect: r
2135
2134
  },
2136
2135
  p.id
2137
2136
  )) })
2138
2137
  ] }),
2139
- r && e.length > 0 && /* @__PURE__ */ i(Be, { "aria-hidden": !0 }),
2140
- r && /* @__PURE__ */ i(
2141
- Kr,
2138
+ o && e.length > 0 && /* @__PURE__ */ i(Be, { "aria-hidden": !0 }),
2139
+ o && /* @__PURE__ */ i(
2140
+ Fo,
2142
2141
  {
2143
- prefix: /* @__PURE__ */ i(Xt, { size: "var(--font-size-base)", color: "var(--text-color-secondary)" }),
2142
+ prefix: /* @__PURE__ */ i(Zt, { size: "var(--font-size-base)", color: "var(--text-color-secondary)" }),
2144
2143
  content: "Manage models",
2145
- onAction: () => r("ai-providers")
2144
+ onAction: () => o("ai-providers")
2146
2145
  }
2147
2146
  )
2148
2147
  ] })
2149
2148
  }
2150
2149
  ) });
2151
2150
  }
2152
- function Hr({
2151
+ function Oo({
2153
2152
  label: e,
2154
2153
  icon: t,
2155
2154
  onClick: n,
2156
- onKeyDown: o
2155
+ onKeyDown: r
2157
2156
  }) {
2158
- return /* @__PURE__ */ h(Nr, { onClick: n, onKeyDown: o, children: [
2159
- /* @__PURE__ */ i(Fr, { children: e }),
2157
+ return /* @__PURE__ */ h(Do, { onClick: n, onKeyDown: r, children: [
2158
+ /* @__PURE__ */ i(Mo, { children: e }),
2160
2159
  t
2161
2160
  ] });
2162
2161
  }
2163
- function Ve({ model: e, activeModelId: t, onModelSelect: n }) {
2164
- const o = e.id === t;
2162
+ function He({ model: e, activeModelId: t, onModelSelect: n }) {
2163
+ const r = e.id === t;
2165
2164
  return /* @__PURE__ */ i(
2166
- Ze,
2165
+ Je,
2167
2166
  {
2168
- prefix: Vr(e.provider),
2169
- suffix: o ? /* @__PURE__ */ i(Gr, { size: "var(--font-size-base)", color: "var(--text-color-primary)" }) : void 0,
2167
+ prefix: Eo(e.provider),
2168
+ suffix: r ? /* @__PURE__ */ i(Ho, { size: "var(--font-size-base)", color: "var(--text-color-primary)" }) : void 0,
2170
2169
  onAction: () => n(e.id),
2171
- active: o,
2172
- children: /* @__PURE__ */ i(Yr, { children: e.label })
2170
+ active: r,
2171
+ children: /* @__PURE__ */ i($o, { children: e.label })
2173
2172
  }
2174
2173
  );
2175
2174
  }
2176
- const Nr = c.div`
2175
+ const Do = c.div`
2177
2176
  display: flex;
2178
2177
  align-items: center;
2179
2178
  min-width: 0;
@@ -2188,7 +2187,7 @@ const Nr = c.div`
2188
2187
  &:hover {
2189
2188
  background: var(--layer-color-active);
2190
2189
  }
2191
- `, Fr = c.span`
2190
+ `, Mo = c.span`
2192
2191
  overflow: hidden;
2193
2192
  text-overflow: ellipsis;
2194
2193
  font-family: var(--font-family-base);
@@ -2197,13 +2196,13 @@ const Nr = c.div`
2197
2196
  line-height: var(--line-height-base);
2198
2197
  color: var(--text-color-primary);
2199
2198
  white-space: nowrap;
2200
- `, jr = c.div`
2199
+ `, _o = c.div`
2201
2200
  --dropdown-menu-padding-top: 0;
2202
2201
 
2203
2202
  min-width: 0;
2204
2203
  flex: 1;
2205
2204
  position: relative;
2206
- `, Wr = c(Qt)`
2205
+ `, zo = c(Kt)`
2207
2206
  width: 100%;
2208
2207
  min-width: 0;
2209
2208
  flex: 1;
@@ -2212,7 +2211,7 @@ const Nr = c.div`
2212
2211
  width: 100%;
2213
2212
  max-width: 200px;
2214
2213
  }
2215
- `, Ur = c(en)`
2214
+ `, Vo = c(Jt)`
2216
2215
  --dropdown-menu-item-gap: calc(var(--spacing-unit) / 2);
2217
2216
  --dropdown-menu-item-padding-vertical: var(--spacing-xxs);
2218
2217
  --dropdown-menu-item-padding-horizontal: var(--spacing-xs);
@@ -2221,13 +2220,13 @@ const Nr = c.div`
2221
2220
  margin: 5px 0;
2222
2221
  border-radius: var(--border-radius-lg);
2223
2222
  background: var(--bg-color);
2224
- `, Yr = c.span`
2223
+ `, $o = c.span`
2225
2224
  flex: 1;
2226
2225
  min-width: 0;
2227
2226
  overflow: hidden;
2228
2227
  text-overflow: ellipsis;
2229
2228
  white-space: nowrap;
2230
- `, Gr = c(tn)`
2229
+ `, Ho = c(Xt)`
2231
2230
  margin-left: var(--spacing-xxs);
2232
2231
  `, Be = c.li`
2233
2232
  flex-shrink: 0;
@@ -2236,44 +2235,44 @@ const Nr = c.div`
2236
2235
  height: 1px;
2237
2236
  margin: 0;
2238
2237
  background: var(--border-color-secondary);
2239
- `, qr = c.li`
2238
+ `, Bo = c.li`
2240
2239
  display: flex;
2241
2240
  flex-direction: column;
2242
2241
  gap: var(--dropdown-menu-item-gap);
2243
2242
  list-style: none;
2244
2243
  min-height: 0;
2245
2244
  overflow-y: auto;
2246
- `, Kr = c(Ze)`
2245
+ `, Fo = c(Je)`
2247
2246
  flex-shrink: 0;
2248
- `, Zr = 280;
2249
- function ft({ pinToBottom: e = !1 }) {
2247
+ `, No = 280;
2248
+ function dt({ pinToBottom: e = !1 }) {
2250
2249
  const [t, n] = G(
2251
2250
  () => ke().getIndexingActivityState().inProgress
2252
2251
  );
2253
- return H(() => ke().subscribe("indexing-activity", (r) => {
2254
- n(r.inProgress);
2255
- }), []), /* @__PURE__ */ i(Jr, { $open: t, $pinToBottom: e, "aria-hidden": !t, children: /* @__PURE__ */ i(
2256
- U,
2252
+ return B(() => ke().subscribe("indexing-activity", (o) => {
2253
+ n(o.inProgress);
2254
+ }), []), /* @__PURE__ */ i(jo, { $open: t, $pinToBottom: e, "aria-hidden": !t, children: /* @__PURE__ */ i(
2255
+ W,
2257
2256
  {
2258
2257
  tip: "We're building a search index of your project. Until it's ready, the assistant may need more context in each reply to stay accurate, which can use more tokens.",
2259
2258
  placement: "top",
2260
2259
  width: "240px",
2261
2260
  arrowPosition: "left",
2262
- children: /* @__PURE__ */ h(Xr, { role: "status", "aria-live": "polite", "aria-label": "Indexing in progress...", children: [
2263
- /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(J, {}) }),
2264
- /* @__PURE__ */ i(Qr, { children: "Indexing in progress..." })
2261
+ children: /* @__PURE__ */ h(Uo, { role: "status", "aria-live": "polite", "aria-label": "Indexing in progress...", children: [
2262
+ /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(X, {}) }),
2263
+ /* @__PURE__ */ i(Wo, { children: "Indexing in progress..." })
2265
2264
  ] })
2266
2265
  }
2267
2266
  ) });
2268
2267
  }
2269
- const Jr = c.div`
2268
+ const jo = c.div`
2270
2269
  width: 100%;
2271
2270
  display: block;
2272
2271
 
2273
- ${({ $pinToBottom: e }) => e ? X`
2272
+ ${({ $pinToBottom: e }) => e ? pe`
2274
2273
  order: 1;
2275
2274
  margin-top: auto;
2276
- ` : X`
2275
+ ` : pe`
2277
2276
  position: absolute;
2278
2277
  left: 0;
2279
2278
  right: 0;
@@ -2283,13 +2282,13 @@ const Jr = c.div`
2283
2282
  `}
2284
2283
 
2285
2284
  opacity: ${({ $open: e }) => e ? 1 : 0};
2286
- transition: opacity ${Zr}ms ease-out;
2285
+ transition: opacity ${No}ms ease-out;
2287
2286
  pointer-events: ${({ $open: e }) => e ? "auto" : "none"};
2288
2287
 
2289
- ${J} {
2288
+ ${X} {
2290
2289
  animation-play-state: ${({ $open: e }) => e ? "running" : "paused"};
2291
2290
  }
2292
- `, Xr = c.div`
2291
+ `, Uo = c.div`
2293
2292
  width: 100%;
2294
2293
  display: flex;
2295
2294
  align-items: center;
@@ -2299,83 +2298,83 @@ const Jr = c.div`
2299
2298
  border-radius: 4px;
2300
2299
  font-size: var(--font-size-sm);
2301
2300
  line-height: 12px;
2302
- `, Qr = c.div`
2301
+ `, Wo = c.div`
2303
2302
  flex: 1;
2304
2303
  min-width: 0;
2305
2304
  `;
2306
- function ei() {
2305
+ function Yo() {
2307
2306
  const {
2308
2307
  chatId: e,
2309
2308
  isLoading: t,
2310
2309
  pendingComposerPreset: n,
2311
- clearPendingComposerPreset: o,
2312
- availableModels: r,
2310
+ clearPendingComposerPreset: r,
2311
+ availableModels: o,
2313
2312
  selectedModelId: a,
2314
2313
  selectModel: s,
2315
2314
  onSettingsOpen: d
2316
- } = Ye(), { messages: l, isStreaming: u, sendMessage: f, stopGeneration: p } = Q(), { isOpen: g } = Ge(), [m, v] = G(""), x = N(null), b = N(null), w = N(!0), y = l.length > 0, S = t || y, E = zr(l.length), q = E !== void 0 && E > 0 && !y, _ = D((L = "smooth") => {
2315
+ } = Ye(), { messages: l, isStreaming: u, sendMessage: f, stopGeneration: p } = Q(), { isOpen: g } = Ge(), [y, m] = G(""), x = F(null), b = F(null), w = F(!0), v = l.length > 0, S = t || v, R = So(l.length), q = R !== void 0 && R > 0 && !v, $ = _((L = "smooth") => {
2317
2316
  b.current && b.current.scrollTo({
2318
2317
  top: b.current.scrollHeight,
2319
2318
  behavior: L
2320
2319
  });
2321
- }, []), ee = D(() => {
2320
+ }, []), ee = _(() => {
2322
2321
  const L = b.current;
2323
2322
  if (!L) return;
2324
2323
  L.scrollHeight - L.scrollTop - L.clientHeight < 50 && (w.current = !0);
2325
2324
  }, []);
2326
- H(() => {
2325
+ B(() => {
2327
2326
  const L = b.current;
2328
2327
  if (!L) return;
2329
- const fe = (vt) => {
2330
- vt.deltaY < 0 && (w.current = !1);
2328
+ const de = (ht) => {
2329
+ ht.deltaY < 0 && (w.current = !1);
2331
2330
  };
2332
- return L.addEventListener("wheel", fe, { passive: !0 }), () => L.removeEventListener("wheel", fe);
2331
+ return L.addEventListener("wheel", de, { passive: !0 }), () => L.removeEventListener("wheel", de);
2333
2332
  }, []);
2334
- const gt = D(async () => {
2335
- m && (v(""), w.current = !0, await f(m), x.current && requestAnimationFrame(() => x.current?.focus()));
2336
- }, [f, m]);
2337
- return H(() => {
2338
- g && (x.current && x.current.focus(), w.current = !0, _());
2339
- }, [g, l.length, _]), H(() => {
2340
- u && w.current && _();
2341
- }), H(
2333
+ const pt = _(async () => {
2334
+ y && (m(""), w.current = !0, await f(y), x.current && requestAnimationFrame(() => x.current?.focus()));
2335
+ }, [f, y]);
2336
+ return B(() => {
2337
+ g && (x.current && x.current.focus(), w.current = !0, $());
2338
+ }, [g, l.length, $]), B(() => {
2339
+ u && w.current && $();
2340
+ }), B(
2342
2341
  function() {
2343
- g && x.current && (x.current.focus(), _("instant"));
2342
+ g && x.current && (x.current.focus(), $("instant"));
2344
2343
  },
2345
- [e, g, _]
2346
- ), H(
2344
+ [e, g, $]
2345
+ ), B(
2347
2346
  function() {
2348
- !g || n === null || (v(n), o());
2347
+ !g || n === null || (m(n), r());
2349
2348
  },
2350
- [g, n, o]
2351
- ), /* @__PURE__ */ h(ut, { children: [
2349
+ [g, n, r]
2350
+ ), /* @__PURE__ */ h(lt, { children: [
2352
2351
  /* @__PURE__ */ i(
2353
- ti,
2352
+ Go,
2354
2353
  {
2355
2354
  ref: b,
2356
2355
  $isExpanded: S,
2357
2356
  $isAnimated: u || q,
2358
2357
  onScroll: ee,
2359
- children: t ? /* @__PURE__ */ i(oi, { children: /* @__PURE__ */ i(we, { size: "20px" }) }) : /* @__PURE__ */ i($r, {})
2358
+ children: t ? /* @__PURE__ */ i(Ko, { children: /* @__PURE__ */ i(Ce, { size: "20px" }) }) : /* @__PURE__ */ i(Io, {})
2360
2359
  }
2361
2360
  ),
2362
- /* @__PURE__ */ h(ni, { $isExpanded: !S, children: [
2363
- /* @__PURE__ */ i(ft, { pinToBottom: !S }),
2361
+ /* @__PURE__ */ h(qo, { $isExpanded: !S, children: [
2362
+ /* @__PURE__ */ i(dt, { pinToBottom: !S }),
2364
2363
  /* @__PURE__ */ i(
2365
- mn,
2364
+ ln,
2366
2365
  {
2367
- value: m,
2368
- onValueChange: v,
2369
- onSubmit: gt,
2366
+ value: y,
2367
+ onValueChange: m,
2368
+ onSubmit: pt,
2370
2369
  isStreaming: u,
2371
2370
  onStop: p,
2372
2371
  textareaRef: x,
2373
2372
  modelSelector: /* @__PURE__ */ i(
2374
- Br,
2373
+ Ro,
2375
2374
  {
2376
- models: r,
2375
+ models: o,
2377
2376
  selectedModelId: a,
2378
- placement: y ? "top" : "bottom",
2377
+ placement: v ? "top" : "bottom",
2379
2378
  onModelSelect: s,
2380
2379
  onSettingsOpen: d
2381
2380
  }
@@ -2385,7 +2384,7 @@ function ei() {
2385
2384
  ] })
2386
2385
  ] });
2387
2386
  }
2388
- const ti = c.div`
2387
+ const Go = c.div`
2389
2388
  flex: ${({ $isExpanded: e }) => e ? 1 : 0};
2390
2389
  width: 100%;
2391
2390
  overflow: auto;
@@ -2393,103 +2392,103 @@ const ti = c.div`
2393
2392
  transition-property: flex;
2394
2393
  transition-duration: ${(e) => e.$isAnimated ? "var(--replay-transition-duration)" : "0s"};
2395
2394
  transition-timing-function: var(--replay-transition-timing-function);
2396
- `, ni = c.div`
2395
+ `, qo = c.div`
2397
2396
  position: relative;
2398
2397
  display: flex;
2399
2398
  flex-direction: column;
2400
2399
  width: 100%;
2401
2400
  flex: ${({ $isExpanded: e }) => e ? 1 : 0};
2402
- `, oi = c.div`
2401
+ `, Ko = c.div`
2403
2402
  display: flex;
2404
2403
  justify-content: center;
2405
2404
  height: 100%;
2406
2405
  padding-top: var(--spacing-lg);
2407
- `, $ = {
2406
+ `, M = {
2408
2407
  TODAY: "today",
2409
2408
  YESTERDAY: "yesterday",
2410
2409
  LAST_WEEK: "last_week",
2411
2410
  LAST_MONTH: "last_month",
2412
2411
  OLDER: "older"
2413
- }, ri = {
2414
- [$.TODAY]: "Today",
2415
- [$.YESTERDAY]: "Yesterday",
2416
- [$.LAST_WEEK]: "Last 7 days",
2417
- [$.LAST_MONTH]: "Last 30 days",
2418
- [$.OLDER]: "Older"
2412
+ }, Jo = {
2413
+ [M.TODAY]: "Today",
2414
+ [M.YESTERDAY]: "Yesterday",
2415
+ [M.LAST_WEEK]: "Last 7 days",
2416
+ [M.LAST_MONTH]: "Last 30 days",
2417
+ [M.OLDER]: "Older"
2419
2418
  };
2420
- function ii(e, t = Date.now()) {
2421
- const n = W(e).startOf("day"), o = W(t).startOf("day"), r = W(t).subtract(1, "day").startOf("day"), a = W(t).subtract(7, "day").startOf("day"), s = W(t).subtract(30, "day").startOf("day");
2422
- return n.isSame(o, "day") ? $.TODAY : n.isSame(r, "day") ? $.YESTERDAY : !n.isBefore(a, "day") && n.isBefore(r, "day") ? $.LAST_WEEK : !n.isBefore(s, "day") && n.isBefore(a, "day") ? $.LAST_MONTH : $.OLDER;
2419
+ function Xo(e, t = Date.now()) {
2420
+ const n = U(e).startOf("day"), r = U(t).startOf("day"), o = U(t).subtract(1, "day").startOf("day"), a = U(t).subtract(7, "day").startOf("day"), s = U(t).subtract(30, "day").startOf("day");
2421
+ return n.isSame(r, "day") ? M.TODAY : n.isSame(o, "day") ? M.YESTERDAY : !n.isBefore(a, "day") && n.isBefore(o, "day") ? M.LAST_WEEK : !n.isBefore(s, "day") && n.isBefore(a, "day") ? M.LAST_MONTH : M.OLDER;
2423
2422
  }
2424
- function ai(e) {
2423
+ function Zo(e) {
2425
2424
  const t = [];
2426
2425
  for (const n of e) {
2427
- const o = ii(n.updatedAt), r = t[t.length - 1];
2428
- !r || r.bucket !== o ? t.push({ bucket: o, chats: [n] }) : r.chats.push(n);
2426
+ const r = Xo(n.updatedAt), o = t[t.length - 1];
2427
+ !o || o.bucket !== r ? t.push({ bucket: r, chats: [n] }) : o.chats.push(n);
2429
2428
  }
2430
2429
  return t;
2431
2430
  }
2432
- function si(e) {
2431
+ function Qo(e) {
2433
2432
  const {
2434
2433
  scrollRef: t,
2435
2434
  sentinelRef: n,
2436
- hasNextPage: o,
2437
- isFetchingNextPage: r,
2435
+ hasNextPage: r,
2436
+ isFetchingNextPage: o,
2438
2437
  fetchNextPage: a,
2439
2438
  observerResetKey: s
2440
2439
  } = e;
2441
- Fe(() => {
2440
+ je(() => {
2442
2441
  const d = t.current, l = n.current;
2443
2442
  if (!d || !l) return;
2444
2443
  const u = new IntersectionObserver(
2445
2444
  (f) => {
2446
2445
  const p = f[0];
2447
- p && p.isIntersecting && o && (r || a());
2446
+ p && p.isIntersecting && r && (o || a());
2448
2447
  },
2449
2448
  { root: d, rootMargin: "80px" }
2450
2449
  );
2451
2450
  return u.observe(l), () => {
2452
2451
  u.disconnect();
2453
2452
  };
2454
- }, [s, a, o, r, t, n]);
2453
+ }, [s, a, r, o, t, n]);
2455
2454
  }
2456
- const pt = c(ut)`
2455
+ const ut = c(lt)`
2457
2456
  gap: var(--spacing-xxs);
2458
2457
  user-select: none;
2459
- `, ci = c.div`
2458
+ `, ei = c.div`
2460
2459
  display: flex;
2461
2460
  flex-direction: column;
2462
2461
  gap: var(--spacing-xs);
2463
- `, li = c.div`
2462
+ `, ti = c.div`
2464
2463
  display: flex;
2465
2464
  flex-direction: column;
2466
2465
  gap: var(--spacing-xxs);
2467
- `, di = c(pt)`
2466
+ `, ni = c(ut)`
2468
2467
  display: flex;
2469
2468
  flex-grow: 1;
2470
2469
  align-items: center;
2471
2470
  flex-direction: column;
2472
2471
  padding: var(--spacing-md);
2473
- `, ui = c.div`
2472
+ `, ri = c.div`
2474
2473
  display: flex;
2475
2474
  flex-grow: 1;
2476
2475
  align-items: center;
2477
2476
  justify-content: center;
2478
- `, fi = c.div`
2477
+ `, oi = c.div`
2479
2478
  display: flex;
2480
2479
  flex-direction: column;
2481
2480
  align-items: center;
2482
2481
  max-width: 75%;
2483
2482
  gap: var(--spacing-xxs);
2484
- `, pi = c.div`
2483
+ `, ii = c.div`
2485
2484
  display: flex;
2486
2485
  justify-content: center;
2487
2486
  padding: var(--spacing-xs);
2488
- `, hi = c(se)`
2487
+ `, ai = c(Z)`
2489
2488
  padding-left: var(--spacing-xs);
2490
2489
  font-size: var(--font-size-sm);
2491
2490
  color: var(--color-warm-grey-7);
2492
- `, gi = c.div`
2491
+ `, si = c.div`
2493
2492
  display: flex;
2494
2493
  flex-grow: 1;
2495
2494
 
@@ -2497,7 +2496,7 @@ const pt = c(ut)`
2497
2496
  flex-grow: 1;
2498
2497
  min-width: 0;
2499
2498
  }
2500
- `, vi = c.div`
2499
+ `, ci = c.div`
2501
2500
  display: flex;
2502
2501
  align-items: center;
2503
2502
  justify-content: space-between;
@@ -2508,7 +2507,7 @@ const pt = c(ut)`
2508
2507
  gap: calc(var(--spacing-xxs) * 2.5);
2509
2508
  cursor: pointer;
2510
2509
 
2511
- ${B} {
2510
+ ${P} {
2512
2511
  display: none;
2513
2512
  }
2514
2513
 
@@ -2516,73 +2515,73 @@ const pt = c(ut)`
2516
2515
  &:hover {
2517
2516
  background-color: var(--color-hover-base);
2518
2517
 
2519
- ${B} {
2518
+ ${P} {
2520
2519
  display: inline-flex;
2521
2520
  }
2522
2521
  }
2523
- `, mi = c(se)`
2522
+ `, li = c(Z)`
2524
2523
  overflow: hidden;
2525
2524
  white-space: nowrap;
2526
2525
  text-overflow: ellipsis;
2527
- `, yi = c.div`
2526
+ `, di = c.div`
2528
2527
  height: 1px;
2529
2528
  flex-shrink: 0;
2530
2529
  `;
2531
- function xi(e) {
2532
- const { chat: t, onSelect: n, onRemove: o } = e;
2533
- return /* @__PURE__ */ i(gi, { children: /* @__PURE__ */ i(U, { tip: W(t.updatedAt).format("MMM DD, YYYY, hh:mm:ss A"), className: "expanded", children: /* @__PURE__ */ h(vi, { role: "button", onClick: () => n?.(t.id), children: [
2534
- /* @__PURE__ */ i(mi, { children: t.title ?? "New chat" }),
2530
+ function ui(e) {
2531
+ const { chat: t, onSelect: n, onRemove: r } = e;
2532
+ return /* @__PURE__ */ i(si, { children: /* @__PURE__ */ i(W, { tip: U(t.updatedAt).format("MMM DD, YYYY, hh:mm:ss A"), className: "expanded", children: /* @__PURE__ */ h(ci, { role: "button", onClick: () => n?.(t.id), children: [
2533
+ /* @__PURE__ */ i(li, { children: t.title ?? "New chat" }),
2535
2534
  /* @__PURE__ */ i(
2536
- B,
2535
+ P,
2537
2536
  {
2538
2537
  variant: "ghost",
2539
2538
  size: "small",
2540
2539
  tone: "danger",
2541
- icon: /* @__PURE__ */ i(an, {}),
2542
- onClick: (r) => {
2543
- r.stopPropagation(), o?.(t.id);
2540
+ icon: /* @__PURE__ */ i(nn, {}),
2541
+ onClick: (o) => {
2542
+ o.stopPropagation(), r?.(t.id);
2544
2543
  }
2545
2544
  }
2546
2545
  )
2547
2546
  ] }) }) });
2548
2547
  }
2549
- function bi(e) {
2550
- const { group: t, onChatSelect: n, onChatRemove: o } = e;
2551
- return /* @__PURE__ */ h(li, { children: [
2552
- /* @__PURE__ */ i(hi, { children: ri[t.bucket] }),
2553
- t.chats.map((r) => /* @__PURE__ */ i(
2554
- xi,
2548
+ function fi(e) {
2549
+ const { group: t, onChatSelect: n, onChatRemove: r } = e;
2550
+ return /* @__PURE__ */ h(ti, { children: [
2551
+ /* @__PURE__ */ i(ai, { children: Jo[t.bucket] }),
2552
+ t.chats.map((o) => /* @__PURE__ */ i(
2553
+ ui,
2555
2554
  {
2556
- chat: r,
2555
+ chat: o,
2557
2556
  onSelect: n,
2558
- onRemove: o
2557
+ onRemove: r
2559
2558
  },
2560
- r.id
2559
+ o.id
2561
2560
  ))
2562
2561
  ] });
2563
2562
  }
2564
- function wi() {
2565
- return /* @__PURE__ */ i(ui, { children: /* @__PURE__ */ h(fi, { children: [
2566
- /* @__PURE__ */ i(se, { textAlign: "center", fontWeight: "var(--font-weight-semibold)", children: "No chat history" }),
2567
- /* @__PURE__ */ i(se, { textAlign: "center", children: "Ask questions or let the assistant take action for you." })
2563
+ function pi() {
2564
+ return /* @__PURE__ */ i(ri, { children: /* @__PURE__ */ h(oi, { children: [
2565
+ /* @__PURE__ */ i(Z, { textAlign: "center", fontWeight: "var(--font-weight-semibold)", children: "No chat history" }),
2566
+ /* @__PURE__ */ i(Z, { textAlign: "center", children: "Ask questions or let the assistant take action for you." })
2568
2567
  ] }) });
2569
2568
  }
2570
- function Ci() {
2571
- return /* @__PURE__ */ i(di, { children: /* @__PURE__ */ i(we, {}) });
2569
+ function hi() {
2570
+ return /* @__PURE__ */ i(ni, { children: /* @__PURE__ */ i(Ce, {}) });
2572
2571
  }
2573
- const ki = 50;
2574
- function Ti(e) {
2575
- const { onChatSelect: t, onChatRemove: n } = e, o = N(null), r = N(null), { data: a, isPending: s, hasNextPage: d, isFetchingNextPage: l, fetchNextPage: u } = jt(ki), f = A(() => (a?.pages ?? []).flatMap((g) => g.items), [a?.pages]), p = A(() => ai(f), [f]);
2576
- return si({
2577
- scrollRef: o,
2578
- sentinelRef: r,
2572
+ const gi = 50;
2573
+ function mi(e) {
2574
+ const { onChatSelect: t, onChatRemove: n } = e, r = F(null), o = F(null), { data: a, isPending: s, hasNextPage: d, isFetchingNextPage: l, fetchNextPage: u } = $t(gi), f = A(() => (a?.pages ?? []).flatMap((g) => g.items), [a?.pages]), p = A(() => Zo(f), [f]);
2575
+ return Qo({
2576
+ scrollRef: r,
2577
+ sentinelRef: o,
2579
2578
  hasNextPage: d,
2580
2579
  isFetchingNextPage: l,
2581
2580
  fetchNextPage: u,
2582
2581
  observerResetKey: a?.pages.length
2583
- }), s && !a ? /* @__PURE__ */ i(Ci, {}) : f.length === 0 ? /* @__PURE__ */ i(wi, {}) : /* @__PURE__ */ h(pt, { ref: o, children: [
2584
- /* @__PURE__ */ i(ci, { children: p.map((g) => /* @__PURE__ */ i(
2585
- bi,
2582
+ }), s && !a ? /* @__PURE__ */ i(hi, {}) : f.length === 0 ? /* @__PURE__ */ i(pi, {}) : /* @__PURE__ */ h(ut, { ref: r, children: [
2583
+ /* @__PURE__ */ i(ei, { children: p.map((g) => /* @__PURE__ */ i(
2584
+ fi,
2586
2585
  {
2587
2586
  group: g,
2588
2587
  onChatSelect: t,
@@ -2590,212 +2589,36 @@ function Ti(e) {
2590
2589
  },
2591
2590
  `${g.bucket}-${g.chats[0]?.id ?? ""}`
2592
2591
  )) }),
2593
- d && /* @__PURE__ */ i(yi, { ref: r, "aria-hidden": !0 }),
2594
- l && /* @__PURE__ */ i(pi, { children: /* @__PURE__ */ i(we, {}) })
2592
+ d && /* @__PURE__ */ i(di, { ref: o, "aria-hidden": !0 }),
2593
+ l && /* @__PURE__ */ i(ii, { children: /* @__PURE__ */ i(Ce, {}) })
2595
2594
  ] });
2596
2595
  }
2597
- const Ii = yt(null);
2598
- function Ai(e) {
2599
- const t = xt(Ii);
2600
- if (t?.components) {
2601
- const { LinkComponent: s } = t.components;
2602
- return /* @__PURE__ */ i(s, { ...e });
2603
- }
2604
- const { external: n, languageInsensitive: o, innerRef: r, ...a } = e;
2605
- return /* @__PURE__ */ i(fn, { ref: r, ...a });
2606
- }
2607
- const Si = () => bt`
2608
- 0% {
2609
- color: var(--button-content-color);
2610
- background-color: var(--button-bg-color-active);
2611
- }
2612
-
2613
- 50% {
2614
- background-color: var(--button-bg-color);
2615
- }
2616
-
2617
- 100% {
2618
- color: var(--button-content-color);
2619
- background-color: var(--button-bg-color-active);
2620
- }
2621
- `, Li = c(Ai)`
2622
- text-decoration: none;
2623
- &:focus-visible {
2624
- outline: 1px solid var(--button-border-color-focused);
2625
- }
2626
- border-radius: var(--button-border-radius);
2627
- `;
2628
- function Pi({
2629
- variant: e = "secondary",
2630
- tone: t = "default",
2631
- size: n = "medium",
2632
- extraClass: o = "",
2633
- className: r = ""
2634
- }) {
2635
- return [
2636
- "button",
2637
- o,
2638
- `button-tone-${t}`,
2639
- `button-variant-${e}`,
2640
- `button-size-${n}`,
2641
- r
2642
- ].filter((s) => s).join(" ").trim();
2643
- }
2644
- const Ei = c.button`
2645
- width: ${({ $fullWidth: e }) => e ? "100%" : "auto"};
2646
-
2647
- display: inline-flex;
2648
- align-items: center;
2649
- justify-content: center;
2650
- gap: var(--button-gap);
2651
- margin: var(--button-margin);
2652
- cursor: pointer;
2653
- text-wrap: var(--button-text-wrap);
2654
-
2655
- color: var(--button-color);
2656
- background-color: var(--button-bg-color);
2657
- border: var(--button-border-width) var(--button-border-style) var(--button-border-color);
2658
- box-shadow: var(--button-box-shadow);
2659
- backdrop-filter: var(--button-backdrop-filter, none);
2660
-
2661
- font-weight: var(--button-font-weight);
2662
- font-size: var(--button-font-size);
2663
- line-height: var(--button-line-height);
2664
- padding: ${({ $icon: e, $iconPosition: t, $iconOnly: n }) => e ? `var(--button-icon-${n ? "" : `${t || "left"}-`}padding)` : "var(--button-padding)"};
2665
- border-radius: var(--button-border-radius);
2666
-
2667
- svg {
2668
- width: var(--button-icon-size);
2669
- height: var(--button-icon-size);
2670
- }
2671
-
2672
- &:hover {
2673
- background-color: var(--button-bg-color-hover);
2674
- color: var(--button-color-hover);
2675
- border-color: var(--button-border-color-hover);
2676
- }
2677
-
2678
- &:active,
2679
- &.active {
2680
- background-color: var(--button-bg-color-active);
2681
- border-color: var(--button-border-color-active);
2682
- color: var(--button-color-active);
2683
- }
2684
-
2685
- &:focus-visible {
2686
- outline: 1px solid var(--button-border-color-focused);
2687
- }
2688
-
2689
- &.button-tone-danger {
2690
- color: var(--button-content-color-danger);
2691
- border-color: var(--button-border-color-danger);
2692
- background-color: var(--button-bg-color-danger);
2693
-
2694
- &:hover {
2695
- color: var(--button-content-color-danger-hover);
2696
- border-color: var(--button-border-color-danger-hover);
2697
- background-color: var(--button-bg-color-danger-hover);
2698
- }
2699
-
2700
- &:active {
2701
- color: var(--button-content-color-danger-pressed);
2702
- border-color: var(--button-border-color-danger-pressed);
2703
- background-color: var(--button-bg-color-danger-pressed);
2704
- }
2705
- }
2706
-
2707
- &:disabled {
2708
- pointer-events: none;
2709
- background-color: var(--button-bg-color-disabled);
2710
- color: var(--button-content-color-disabled);
2711
- border-color: var(--button-border-color-disabled);
2712
- border-width: var(--button-border-width-disabled);
2713
- }
2714
-
2715
- ${({ $variant: e, $size: t }) => (e === "link" || e === "ghost") && t === "small" && X`
2716
- --button-font-size: var(--font-size-sm);
2717
- --button-line-height: var(--line-height-sm);
2718
- --button-icon-padding: var(--button-icon-padding-small) !important;
2719
- `}
2720
-
2721
- ${({ $blinking: e }) => e && X`
2722
- pointer-events: none;
2723
- animation: ${Si()} 1.2s infinite;
2724
- `}
2725
- `, Ri = (e) => {
2726
- const {
2727
- languageInsensitive: t,
2728
- fullWidth: n,
2729
- blinking: o,
2730
- iconPosition: r,
2731
- icon: a,
2732
- children: s,
2733
- variant: d,
2734
- tone: l,
2735
- size: u,
2736
- extraClass: f,
2737
- to: p,
2738
- external: g,
2739
- className: m,
2740
- ...v
2741
- } = e, x = "tabIndex" in e ? e.tabIndex : e.to ? -1 : void 0, b = /* @__PURE__ */ h(
2742
- Ei,
2743
- {
2744
- "data-component-name": "Button/Button",
2745
- ...v,
2746
- className: Pi({ variant: d, tone: l, size: u, extraClass: f, className: m }),
2747
- $fullWidth: n,
2748
- $blinking: o,
2749
- $iconPosition: r,
2750
- $icon: a,
2751
- $iconOnly: !s && a != null,
2752
- $variant: d,
2753
- $size: u,
2754
- tabIndex: x,
2755
- children: [
2756
- a && r !== "right" && a,
2757
- s,
2758
- a && r === "right" && a
2759
- ]
2760
- }
2761
- );
2762
- return p ? /* @__PURE__ */ i(
2763
- Li,
2764
- {
2765
- to: p,
2766
- external: g,
2767
- languageInsensitive: t,
2768
- onClick: e.onClick,
2769
- children: b
2770
- }
2771
- ) : b;
2772
- }, ae = c(Ri)``;
2773
- function Oi() {
2774
- const e = N(null), [t, n] = G(!1);
2775
- return Fe(() => {
2596
+ function vi() {
2597
+ const e = F(null), [t, n] = G(!1);
2598
+ return je(() => {
2776
2599
  if (!e.current) return;
2777
- const o = e.current;
2778
- function r() {
2779
- n(o.scrollWidth > o.clientWidth);
2600
+ const r = e.current;
2601
+ function o() {
2602
+ n(r.scrollWidth > r.clientWidth);
2780
2603
  }
2781
- r();
2782
- const a = new ResizeObserver(r);
2783
- return a.observe(o), () => a.disconnect();
2604
+ o();
2605
+ const a = new ResizeObserver(o);
2606
+ return a.observe(r), () => a.disconnect();
2784
2607
  }, []), {
2785
2608
  ref: e,
2786
2609
  value: t
2787
2610
  };
2788
2611
  }
2789
- function $i(e) {
2790
- const { ref: t, value: n } = Oi();
2791
- return /* @__PURE__ */ i(Di, { children: /* @__PURE__ */ i(U, { tip: e.value, className: "no-overflow", disabled: !n, children: /* @__PURE__ */ i(zi, { ref: t, children: e.value }) }) });
2612
+ function yi(e) {
2613
+ const { ref: t, value: n } = vi();
2614
+ return /* @__PURE__ */ i(xi, { children: /* @__PURE__ */ i(W, { tip: e.value, className: "no-overflow", disabled: !n, children: /* @__PURE__ */ i(wi, { ref: t, children: e.value }) }) });
2792
2615
  }
2793
- const Di = c.div`
2616
+ const xi = c.div`
2794
2617
  overflow: hidden;
2795
2618
  .tooltip-no-overflow {
2796
2619
  overflow: hidden;
2797
2620
  }
2798
- `, zi = c.div`
2621
+ `, wi = c.div`
2799
2622
  color: var(--text-color-primary);
2800
2623
  font-size: var(--font-size-base);
2801
2624
  line-height: var(--line-height-base);
@@ -2804,14 +2627,14 @@ const Di = c.div`
2804
2627
  text-overflow: ellipsis;
2805
2628
  user-select: none;
2806
2629
  `;
2807
- function ht(e) {
2630
+ function ft(e) {
2808
2631
  const { children: t, buttons: n } = e;
2809
- return /* @__PURE__ */ h(Mi, { children: [
2810
- /* @__PURE__ */ i(_i, { children: t }),
2811
- n && /* @__PURE__ */ i(Vi, { children: n })
2632
+ return /* @__PURE__ */ h(bi, { children: [
2633
+ /* @__PURE__ */ i(Ci, { children: t }),
2634
+ n && /* @__PURE__ */ i(Ti, { children: n })
2812
2635
  ] });
2813
2636
  }
2814
- const Mi = c.div`
2637
+ const bi = c.div`
2815
2638
  display: flex;
2816
2639
  flex-direction: row;
2817
2640
  align-items: center;
@@ -2819,144 +2642,118 @@ const Mi = c.div`
2819
2642
  gap: var(--spacing-xs);
2820
2643
  width: 100%;
2821
2644
  flex-shrink: 0;
2822
- `, _i = c.div`
2645
+ `, Ci = c.div`
2823
2646
  display: flex;
2824
2647
  align-items: center;
2825
2648
  gap: var(--spacing-xs);
2826
2649
  min-width: 0;
2827
2650
  flex: 1;
2828
- `, Vi = c.div`
2651
+ `, Ti = c.div`
2829
2652
  display: flex;
2830
2653
  align-items: center;
2831
2654
  gap: 2px;
2832
2655
  `;
2833
- function Bi(e) {
2834
- const { title: t, onCreateNewChat: n, onViewHistory: o, onClose: r } = e;
2835
- return /* @__PURE__ */ h(ht, { buttons: /* @__PURE__ */ h(Ne, { children: [
2836
- /* @__PURE__ */ i(U, { tip: "New chat", children: /* @__PURE__ */ i(
2837
- ae,
2656
+ function ki(e) {
2657
+ const { title: t, onCreateNewChat: n, onViewHistory: r, onClose: o } = e;
2658
+ return /* @__PURE__ */ h(ft, { buttons: /* @__PURE__ */ h(Ne, { children: [
2659
+ /* @__PURE__ */ i(W, { tip: "New chat", children: /* @__PURE__ */ i(
2660
+ P,
2838
2661
  {
2839
2662
  size: "small",
2840
2663
  variant: "text",
2841
2664
  "aria-label": "Create new chat",
2842
2665
  onClick: n,
2843
- icon: /* @__PURE__ */ i(cn, {})
2666
+ icon: /* @__PURE__ */ i(an, {})
2844
2667
  }
2845
2668
  ) }),
2846
- /* @__PURE__ */ i(U, { tip: "Chat history", children: /* @__PURE__ */ i(
2847
- ae,
2669
+ /* @__PURE__ */ i(W, { tip: "Chat history", children: /* @__PURE__ */ i(
2670
+ P,
2848
2671
  {
2849
2672
  size: "small",
2850
2673
  variant: "text",
2851
2674
  "aria-label": "View chat history",
2852
- onClick: o,
2853
- icon: /* @__PURE__ */ i(ln, {})
2675
+ onClick: r,
2676
+ icon: /* @__PURE__ */ i(sn, {})
2854
2677
  }
2855
2678
  ) }),
2856
- /* @__PURE__ */ i(Ni, { children: /* @__PURE__ */ i(Et, {}) }),
2857
- /* @__PURE__ */ i(U, { tip: "Close", arrowPosition: "left", children: /* @__PURE__ */ i(
2858
- ae,
2679
+ /* @__PURE__ */ i(Ai, { children: /* @__PURE__ */ i(It, {}) }),
2680
+ /* @__PURE__ */ i(W, { tip: "Close", arrowPosition: "left", children: /* @__PURE__ */ i(
2681
+ P,
2859
2682
  {
2860
2683
  variant: "text",
2861
2684
  size: "small",
2862
2685
  "aria-label": "Close panel",
2863
- icon: /* @__PURE__ */ i(dn, {}),
2864
- onClick: r
2686
+ icon: /* @__PURE__ */ i(on, {}),
2687
+ onClick: o
2865
2688
  }
2866
2689
  ) })
2867
2690
  ] }), children: [
2868
- /* @__PURE__ */ i(Hi, { children: /* @__PURE__ */ i(sn, { size: "14px" }) }),
2869
- /* @__PURE__ */ i($i, { value: t })
2691
+ /* @__PURE__ */ i(Ii, { children: /* @__PURE__ */ i(rn, { size: "14px" }) }),
2692
+ /* @__PURE__ */ i(yi, { value: t })
2870
2693
  ] });
2871
2694
  }
2872
- const Hi = c.div`
2695
+ const Ii = c.div`
2873
2696
  display: flex;
2874
- `, Ni = c.div`
2697
+ `, Ai = c.div`
2875
2698
  display: flex;
2876
2699
  height: 14px;
2877
- `, Fi = /* @__PURE__ */ new Set([
2878
- "color",
2879
- "fontFamily",
2880
- "fontSize",
2881
- "fontStyle",
2882
- "fontWeight",
2883
- "lineHeight",
2884
- "letterSpacing",
2885
- "marginBottom",
2886
- "marginTop",
2887
- "textAlign"
2888
- ]), ji = c.span.withConfig({
2889
- shouldForwardProp: (e) => !Fi.has(e)
2890
- }).attrs({
2891
- "data-component-name": "Typography/Typography"
2892
- })`
2893
- color: ${({ color: e }) => e || "var(--text-color-primary)"};
2894
- font-family: ${({ fontFamily: e }) => e || "var(--font-family-base)"};
2895
- font-size: ${({ fontSize: e }) => e || "var(--font-size-base)"};
2896
- font-style: ${({ fontStyle: e }) => e};
2897
- font-weight: ${({ fontWeight: e }) => e || "var(--font-weight-regular)"};
2898
- line-height: ${({ lineHeight: e }) => e || "var(--line-height-base)"};
2899
- letter-spacing: ${({ letterSpacing: e }) => e};
2900
- margin-bottom: ${({ marginBottom: e }) => e};
2901
- margin-top: ${({ marginTop: e }) => e};
2902
- text-align: ${({ textAlign: e }) => e};
2903
2700
  `;
2904
- function Wi(e) {
2701
+ function Si(e) {
2905
2702
  const { onReturnFromHistory: t } = e;
2906
- return /* @__PURE__ */ h(ht, { children: [
2703
+ return /* @__PURE__ */ h(ft, { children: [
2907
2704
  /* @__PURE__ */ i(
2908
- ae,
2705
+ P,
2909
2706
  {
2910
2707
  size: "small",
2911
2708
  variant: "text",
2912
2709
  "aria-label": "Return to chat",
2913
2710
  onClick: t,
2914
- icon: /* @__PURE__ */ i(un, {})
2711
+ icon: /* @__PURE__ */ i(cn, {})
2915
2712
  }
2916
2713
  ),
2917
- /* @__PURE__ */ i(Ui, { children: /* @__PURE__ */ i(ji, { children: "Chat history" }) })
2714
+ /* @__PURE__ */ i(Li, { children: /* @__PURE__ */ i(Z, { children: "Chat history" }) })
2918
2715
  ] });
2919
2716
  }
2920
- const Ui = c.div`
2717
+ const Li = c.div`
2921
2718
  user-select: none;
2922
2719
  `;
2923
- function aa() {
2924
- const [e, t] = G(F.CHAT), n = Ge(), o = Ye(), r = () => {
2925
- t(F.HISTORY);
2720
+ function ma() {
2721
+ const [e, t] = G(N.CHAT), n = Ge(), r = Ye(), o = () => {
2722
+ t(N.HISTORY);
2926
2723
  }, a = () => {
2927
- t(F.CHAT);
2724
+ t(N.CHAT);
2928
2725
  }, s = async (d) => {
2929
- o.selectChat(d), t(F.CHAT);
2726
+ r.selectChat(d), t(N.CHAT);
2930
2727
  };
2931
- return /* @__PURE__ */ h(Yi, { children: [
2932
- /* @__PURE__ */ h(He, { isActive: e === F.CHAT, children: [
2728
+ return /* @__PURE__ */ h(Pi, { children: [
2729
+ /* @__PURE__ */ h(Fe, { isActive: e === N.CHAT, children: [
2933
2730
  /* @__PURE__ */ i(
2934
- Bi,
2731
+ ki,
2935
2732
  {
2936
- title: o.title,
2937
- onCreateNewChat: o.createNewChat,
2938
- onViewHistory: r,
2733
+ title: r.title,
2734
+ onCreateNewChat: r.createNewChat,
2735
+ onViewHistory: o,
2939
2736
  onClose: n.closePanel
2940
2737
  }
2941
2738
  ),
2942
- /* @__PURE__ */ i(ei, {})
2739
+ /* @__PURE__ */ i(Yo, {})
2943
2740
  ] }),
2944
- /* @__PURE__ */ h(He, { isActive: e === F.HISTORY, isSliding: !0, children: [
2945
- /* @__PURE__ */ i(Wi, { onReturnFromHistory: a }),
2946
- /* @__PURE__ */ i(Ti, { onChatSelect: s, onChatRemove: o.removeChat }),
2947
- /* @__PURE__ */ i(qi, { children: /* @__PURE__ */ i(ft, { pinToBottom: !0 }) })
2741
+ /* @__PURE__ */ h(Fe, { isActive: e === N.HISTORY, isSliding: !0, children: [
2742
+ /* @__PURE__ */ i(Si, { onReturnFromHistory: a }),
2743
+ /* @__PURE__ */ i(mi, { onChatSelect: s, onChatRemove: r.removeChat }),
2744
+ /* @__PURE__ */ i(Ri, { children: /* @__PURE__ */ i(dt, { pinToBottom: !0 }) })
2948
2745
  ] })
2949
2746
  ] });
2950
2747
  }
2951
- function He(e) {
2952
- const { children: t, isActive: n, isSliding: o = !1 } = e, r = /* @__PURE__ */ i(Gi, { inert: !n, children: t });
2953
- return o ? /* @__PURE__ */ i(Ki, { $isExpanded: n, children: r }) : r;
2748
+ function Fe(e) {
2749
+ const { children: t, isActive: n, isSliding: r = !1 } = e, o = /* @__PURE__ */ i(Ei, { inert: !n, children: t });
2750
+ return r ? /* @__PURE__ */ i(Oi, { $isExpanded: n, children: o }) : o;
2954
2751
  }
2955
- const Yi = c.div`
2752
+ const Pi = c.div`
2956
2753
  position: relative;
2957
2754
  height: 100%;
2958
2755
  overflow: clip;
2959
- `, Gi = c.div`
2756
+ `, Ei = c.div`
2960
2757
  display: flex;
2961
2758
  height: 100%;
2962
2759
  flex-direction: column;
@@ -2964,12 +2761,12 @@ const Yi = c.div`
2964
2761
  border-radius: var(--border-radius-md);
2965
2762
  background: var(--bg-color);
2966
2763
  margin-left: var(--spacing-xxs);
2967
- `, qi = c.div`
2764
+ `, Ri = c.div`
2968
2765
  display: flex;
2969
2766
  flex-direction: column;
2970
2767
  width: 100%;
2971
2768
  padding: 0 var(--spacing-xs) var(--spacing-xs);
2972
- `, Ki = c.div`
2769
+ `, Oi = c.div`
2973
2770
  position: absolute;
2974
2771
  inset: 0;
2975
2772
  transform: translateX(${(e) => e.$isExpanded ? "0%" : "100%"});
@@ -2981,5 +2778,5 @@ const Yi = c.div`
2981
2778
  }
2982
2779
  `;
2983
2780
  export {
2984
- aa as AiPanel
2781
+ ma as AiPanel
2985
2782
  };