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