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