flowdit-chatbot-library 1.3.2 → 1.3.4
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/components/ChatContainer/ChatContainer.d.ts +3 -1
- package/dist/components/ChatLauncher/ChatLauncher.d.ts +2 -1
- package/dist/components/Composer/Composer.d.ts +2 -1
- package/dist/components/ComposerMenu/ComposerMenu.d.ts +2 -1
- package/dist/components/ConfirmButtons/ConfirmButtons.d.ts +2 -1
- package/dist/components/MessageBubble/MessageBubble.d.ts +2 -1
- package/dist/components/NavigationSidebar/NavigationSidebar.d.ts +2 -1
- package/dist/components/PendingMessageList/PendingMessageList.d.ts +2 -1
- package/dist/components/ThinkingIndicator/ThinkingIndicator.d.ts +2 -1
- package/dist/components/ToolInvocation/ToolInvocation.d.ts +2 -1
- package/dist/components/WelcomeScreen/WelcomeScreen.d.ts +2 -1
- package/dist/index.mjs +356 -353
- package/dist/index.umd.js +22 -22
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var F = (a, s, i) =>
|
|
4
|
-
import
|
|
5
|
-
import Ye from "react";
|
|
1
|
+
var yt = Object.defineProperty;
|
|
2
|
+
var wt = (a, s, i) => s in a ? yt(a, s, { enumerable: !0, configurable: !0, writable: !0, value: i }) : a[s] = i;
|
|
3
|
+
var F = (a, s, i) => wt(a, typeof s != "symbol" ? s + "" : s, i);
|
|
4
|
+
import W from "react";
|
|
6
5
|
var xe = { exports: {} }, H = {};
|
|
7
6
|
/**
|
|
8
7
|
* @license React
|
|
@@ -14,14 +13,14 @@ var xe = { exports: {} }, H = {};
|
|
|
14
13
|
* LICENSE file in the root directory of this source tree.
|
|
15
14
|
*/
|
|
16
15
|
var We;
|
|
17
|
-
function
|
|
16
|
+
function kt() {
|
|
18
17
|
if (We) return H;
|
|
19
18
|
We = 1;
|
|
20
|
-
var a =
|
|
19
|
+
var a = W, s = Symbol.for("react.element"), i = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, n = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
21
20
|
function m(h, f, w) {
|
|
22
21
|
var p, y = {}, v = null, o = null;
|
|
23
22
|
w !== void 0 && (v = "" + w), f.key !== void 0 && (v = "" + f.key), f.ref !== void 0 && (o = f.ref);
|
|
24
|
-
for (p in f) c.call(f, p) && !
|
|
23
|
+
for (p in f) c.call(f, p) && !d.hasOwnProperty(p) && (y[p] = f[p]);
|
|
25
24
|
if (h && h.defaultProps) for (p in f = h.defaultProps, f) y[p] === void 0 && (y[p] = f[p]);
|
|
26
25
|
return { $$typeof: s, type: h, key: v, ref: o, props: y, _owner: n.current };
|
|
27
26
|
}
|
|
@@ -38,41 +37,41 @@ var K = {};
|
|
|
38
37
|
* LICENSE file in the root directory of this source tree.
|
|
39
38
|
*/
|
|
40
39
|
var De;
|
|
41
|
-
function
|
|
40
|
+
function Nt() {
|
|
42
41
|
return De || (De = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var a =
|
|
42
|
+
var a = W, s = Symbol.for("react.element"), i = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), h = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), o = Symbol.for("react.offscreen"), u = Symbol.iterator, N = "@@iterator";
|
|
44
43
|
function g(t) {
|
|
45
44
|
if (t === null || typeof t != "object")
|
|
46
45
|
return null;
|
|
47
|
-
var r =
|
|
46
|
+
var r = u && t[u] || t[N];
|
|
48
47
|
return typeof r == "function" ? r : null;
|
|
49
48
|
}
|
|
50
|
-
var
|
|
51
|
-
function
|
|
49
|
+
var T = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
50
|
+
function E(t) {
|
|
52
51
|
{
|
|
53
52
|
for (var r = arguments.length, l = new Array(r > 1 ? r - 1 : 0), x = 1; x < r; x++)
|
|
54
53
|
l[x - 1] = arguments[x];
|
|
55
|
-
|
|
54
|
+
S("error", t, l);
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
|
-
function
|
|
57
|
+
function S(t, r, l) {
|
|
59
58
|
{
|
|
60
|
-
var x =
|
|
59
|
+
var x = T.ReactDebugCurrentFrame, k = x.getStackAddendum();
|
|
61
60
|
k !== "" && (r += "%s", l = l.concat([k]));
|
|
62
|
-
var
|
|
61
|
+
var C = l.map(function(b) {
|
|
63
62
|
return String(b);
|
|
64
63
|
});
|
|
65
|
-
|
|
64
|
+
C.unshift("Warning: " + r), Function.prototype.apply.call(console[t], console, C);
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
function
|
|
71
|
-
return !!(typeof t == "string" || typeof t == "function" || t === c || t ===
|
|
67
|
+
var A = !1, M = !1, V = !1, ne = !1, Y = !1, G;
|
|
68
|
+
G = Symbol.for("react.module.reference");
|
|
69
|
+
function I(t) {
|
|
70
|
+
return !!(typeof t == "string" || typeof t == "function" || t === c || t === d || Y || t === n || t === w || t === p || ne || t === o || A || M || V || typeof t == "object" && t !== null && (t.$$typeof === v || t.$$typeof === y || t.$$typeof === m || t.$$typeof === h || t.$$typeof === f || // This needs to include all possible module reference object
|
|
72
71
|
// types supported by any Flight configuration anywhere since
|
|
73
72
|
// we don't know which Flight build this will end up being used
|
|
74
73
|
// with.
|
|
75
|
-
t.$$typeof ===
|
|
74
|
+
t.$$typeof === G || t.getModuleId !== void 0));
|
|
76
75
|
}
|
|
77
76
|
function re(t, r, l) {
|
|
78
77
|
var x = t.displayName;
|
|
@@ -81,13 +80,13 @@ function Ct() {
|
|
|
81
80
|
var k = r.displayName || r.name || "";
|
|
82
81
|
return k !== "" ? l + "(" + k + ")" : l;
|
|
83
82
|
}
|
|
84
|
-
function
|
|
83
|
+
function X(t) {
|
|
85
84
|
return t.displayName || "Context";
|
|
86
85
|
}
|
|
87
|
-
function
|
|
86
|
+
function B(t) {
|
|
88
87
|
if (t == null)
|
|
89
88
|
return null;
|
|
90
|
-
if (typeof t.tag == "number" &&
|
|
89
|
+
if (typeof t.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
|
|
91
90
|
return t.displayName || t.name || null;
|
|
92
91
|
if (typeof t == "string")
|
|
93
92
|
return t;
|
|
@@ -96,7 +95,7 @@ function Ct() {
|
|
|
96
95
|
return "Fragment";
|
|
97
96
|
case i:
|
|
98
97
|
return "Portal";
|
|
99
|
-
case
|
|
98
|
+
case d:
|
|
100
99
|
return "Profiler";
|
|
101
100
|
case n:
|
|
102
101
|
return "StrictMode";
|
|
@@ -109,19 +108,19 @@ function Ct() {
|
|
|
109
108
|
switch (t.$$typeof) {
|
|
110
109
|
case h:
|
|
111
110
|
var r = t;
|
|
112
|
-
return
|
|
111
|
+
return X(r) + ".Consumer";
|
|
113
112
|
case m:
|
|
114
113
|
var l = t;
|
|
115
|
-
return
|
|
114
|
+
return X(l._context) + ".Provider";
|
|
116
115
|
case f:
|
|
117
116
|
return re(t, t.render, "ForwardRef");
|
|
118
117
|
case y:
|
|
119
118
|
var x = t.displayName || null;
|
|
120
|
-
return x !== null ? x :
|
|
119
|
+
return x !== null ? x : B(t.type) || "Memo";
|
|
121
120
|
case v: {
|
|
122
|
-
var k = t,
|
|
121
|
+
var k = t, C = k._payload, b = k._init;
|
|
123
122
|
try {
|
|
124
|
-
return
|
|
123
|
+
return B(b(C));
|
|
125
124
|
} catch {
|
|
126
125
|
return null;
|
|
127
126
|
}
|
|
@@ -129,11 +128,11 @@ function Ct() {
|
|
|
129
128
|
}
|
|
130
129
|
return null;
|
|
131
130
|
}
|
|
132
|
-
var
|
|
131
|
+
var D = Object.assign, q = 0, ve, ge, pe, je, be, ye, we;
|
|
133
132
|
function ke() {
|
|
134
133
|
}
|
|
135
134
|
ke.__reactDisabledLog = !0;
|
|
136
|
-
function
|
|
135
|
+
function He() {
|
|
137
136
|
{
|
|
138
137
|
if (q === 0) {
|
|
139
138
|
ve = console.log, ge = console.info, pe = console.warn, je = console.error, be = console.group, ye = console.groupCollapsed, we = console.groupEnd;
|
|
@@ -156,7 +155,7 @@ function Ct() {
|
|
|
156
155
|
q++;
|
|
157
156
|
}
|
|
158
157
|
}
|
|
159
|
-
function
|
|
158
|
+
function Ke() {
|
|
160
159
|
{
|
|
161
160
|
if (q--, q === 0) {
|
|
162
161
|
var t = {
|
|
@@ -165,34 +164,34 @@ function Ct() {
|
|
|
165
164
|
writable: !0
|
|
166
165
|
};
|
|
167
166
|
Object.defineProperties(console, {
|
|
168
|
-
log:
|
|
167
|
+
log: D({}, t, {
|
|
169
168
|
value: ve
|
|
170
169
|
}),
|
|
171
|
-
info:
|
|
170
|
+
info: D({}, t, {
|
|
172
171
|
value: ge
|
|
173
172
|
}),
|
|
174
|
-
warn:
|
|
173
|
+
warn: D({}, t, {
|
|
175
174
|
value: pe
|
|
176
175
|
}),
|
|
177
|
-
error:
|
|
176
|
+
error: D({}, t, {
|
|
178
177
|
value: je
|
|
179
178
|
}),
|
|
180
|
-
group:
|
|
179
|
+
group: D({}, t, {
|
|
181
180
|
value: be
|
|
182
181
|
}),
|
|
183
|
-
groupCollapsed:
|
|
182
|
+
groupCollapsed: D({}, t, {
|
|
184
183
|
value: ye
|
|
185
184
|
}),
|
|
186
|
-
groupEnd:
|
|
185
|
+
groupEnd: D({}, t, {
|
|
187
186
|
value: we
|
|
188
187
|
})
|
|
189
188
|
});
|
|
190
189
|
}
|
|
191
|
-
q < 0 &&
|
|
190
|
+
q < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
191
|
}
|
|
193
192
|
}
|
|
194
|
-
var ie =
|
|
195
|
-
function
|
|
193
|
+
var ie = T.ReactCurrentDispatcher, ae;
|
|
194
|
+
function Z(t, r, l) {
|
|
196
195
|
{
|
|
197
196
|
if (ae === void 0)
|
|
198
197
|
try {
|
|
@@ -205,16 +204,16 @@ function Ct() {
|
|
|
205
204
|
` + ae + t;
|
|
206
205
|
}
|
|
207
206
|
}
|
|
208
|
-
var oe = !1,
|
|
207
|
+
var oe = !1, Q;
|
|
209
208
|
{
|
|
210
|
-
var
|
|
211
|
-
|
|
209
|
+
var Ge = typeof WeakMap == "function" ? WeakMap : Map;
|
|
210
|
+
Q = new Ge();
|
|
212
211
|
}
|
|
213
212
|
function Ne(t, r) {
|
|
214
213
|
if (!t || oe)
|
|
215
214
|
return "";
|
|
216
215
|
{
|
|
217
|
-
var l =
|
|
216
|
+
var l = Q.get(t);
|
|
218
217
|
if (l !== void 0)
|
|
219
218
|
return l;
|
|
220
219
|
}
|
|
@@ -222,8 +221,8 @@ function Ct() {
|
|
|
222
221
|
oe = !0;
|
|
223
222
|
var k = Error.prepareStackTrace;
|
|
224
223
|
Error.prepareStackTrace = void 0;
|
|
225
|
-
var
|
|
226
|
-
|
|
224
|
+
var C;
|
|
225
|
+
C = ie.current, ie.current = null, He();
|
|
227
226
|
try {
|
|
228
227
|
if (r) {
|
|
229
228
|
var b = function() {
|
|
@@ -259,102 +258,102 @@ function Ct() {
|
|
|
259
258
|
} catch ($) {
|
|
260
259
|
if ($ && x && typeof $.stack == "string") {
|
|
261
260
|
for (var j = $.stack.split(`
|
|
262
|
-
`),
|
|
263
|
-
`),
|
|
264
|
-
|
|
265
|
-
for (;
|
|
266
|
-
if (j[
|
|
267
|
-
if (
|
|
261
|
+
`), O = x.stack.split(`
|
|
262
|
+
`), R = j.length - 1, _ = O.length - 1; R >= 1 && _ >= 0 && j[R] !== O[_]; )
|
|
263
|
+
_--;
|
|
264
|
+
for (; R >= 1 && _ >= 0; R--, _--)
|
|
265
|
+
if (j[R] !== O[_]) {
|
|
266
|
+
if (R !== 1 || _ !== 1)
|
|
268
267
|
do
|
|
269
|
-
if (
|
|
270
|
-
var
|
|
271
|
-
` + j[
|
|
272
|
-
return t.displayName &&
|
|
268
|
+
if (R--, _--, _ < 0 || j[R] !== O[_]) {
|
|
269
|
+
var P = `
|
|
270
|
+
` + j[R].replace(" at new ", " at ");
|
|
271
|
+
return t.displayName && P.includes("<anonymous>") && (P = P.replace("<anonymous>", t.displayName)), typeof t == "function" && Q.set(t, P), P;
|
|
273
272
|
}
|
|
274
|
-
while (
|
|
273
|
+
while (R >= 1 && _ >= 0);
|
|
275
274
|
break;
|
|
276
275
|
}
|
|
277
276
|
}
|
|
278
277
|
} finally {
|
|
279
|
-
oe = !1, ie.current =
|
|
278
|
+
oe = !1, ie.current = C, Ke(), Error.prepareStackTrace = k;
|
|
280
279
|
}
|
|
281
|
-
var
|
|
282
|
-
return typeof t == "function" &&
|
|
280
|
+
var z = t ? t.displayName || t.name : "", L = z ? Z(z) : "";
|
|
281
|
+
return typeof t == "function" && Q.set(t, L), L;
|
|
283
282
|
}
|
|
284
|
-
function
|
|
283
|
+
function Xe(t, r, l) {
|
|
285
284
|
return Ne(t, !1);
|
|
286
285
|
}
|
|
287
|
-
function
|
|
286
|
+
function Ze(t) {
|
|
288
287
|
var r = t.prototype;
|
|
289
288
|
return !!(r && r.isReactComponent);
|
|
290
289
|
}
|
|
291
|
-
function
|
|
290
|
+
function ee(t, r, l) {
|
|
292
291
|
if (t == null)
|
|
293
292
|
return "";
|
|
294
293
|
if (typeof t == "function")
|
|
295
|
-
return Ne(t,
|
|
294
|
+
return Ne(t, Ze(t));
|
|
296
295
|
if (typeof t == "string")
|
|
297
|
-
return
|
|
296
|
+
return Z(t);
|
|
298
297
|
switch (t) {
|
|
299
298
|
case w:
|
|
300
|
-
return
|
|
299
|
+
return Z("Suspense");
|
|
301
300
|
case p:
|
|
302
|
-
return
|
|
301
|
+
return Z("SuspenseList");
|
|
303
302
|
}
|
|
304
303
|
if (typeof t == "object")
|
|
305
304
|
switch (t.$$typeof) {
|
|
306
305
|
case f:
|
|
307
|
-
return
|
|
306
|
+
return Xe(t.render);
|
|
308
307
|
case y:
|
|
309
|
-
return
|
|
308
|
+
return ee(t.type, r, l);
|
|
310
309
|
case v: {
|
|
311
|
-
var x = t, k = x._payload,
|
|
310
|
+
var x = t, k = x._payload, C = x._init;
|
|
312
311
|
try {
|
|
313
|
-
return
|
|
312
|
+
return ee(C(k), r, l);
|
|
314
313
|
} catch {
|
|
315
314
|
}
|
|
316
315
|
}
|
|
317
316
|
}
|
|
318
317
|
return "";
|
|
319
318
|
}
|
|
320
|
-
var U = Object.prototype.hasOwnProperty, Ce = {}, Te =
|
|
321
|
-
function
|
|
319
|
+
var U = Object.prototype.hasOwnProperty, Ce = {}, Te = T.ReactDebugCurrentFrame;
|
|
320
|
+
function te(t) {
|
|
322
321
|
if (t) {
|
|
323
|
-
var r = t._owner, l =
|
|
322
|
+
var r = t._owner, l = ee(t.type, t._source, r ? r.type : null);
|
|
324
323
|
Te.setExtraStackFrame(l);
|
|
325
324
|
} else
|
|
326
325
|
Te.setExtraStackFrame(null);
|
|
327
326
|
}
|
|
328
|
-
function
|
|
327
|
+
function Qe(t, r, l, x, k) {
|
|
329
328
|
{
|
|
330
|
-
var
|
|
329
|
+
var C = Function.call.bind(U);
|
|
331
330
|
for (var b in t)
|
|
332
|
-
if (
|
|
331
|
+
if (C(t, b)) {
|
|
333
332
|
var j = void 0;
|
|
334
333
|
try {
|
|
335
334
|
if (typeof t[b] != "function") {
|
|
336
|
-
var
|
|
337
|
-
throw
|
|
335
|
+
var O = Error((x || "React class") + ": " + l + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
336
|
+
throw O.name = "Invariant Violation", O;
|
|
338
337
|
}
|
|
339
338
|
j = t[b](r, b, x, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
-
} catch (
|
|
341
|
-
j =
|
|
339
|
+
} catch (R) {
|
|
340
|
+
j = R;
|
|
342
341
|
}
|
|
343
|
-
j && !(j instanceof Error) && (
|
|
342
|
+
j && !(j instanceof Error) && (te(k), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", x || "React class", l, b, typeof j), te(null)), j instanceof Error && !(j.message in Ce) && (Ce[j.message] = !0, te(k), E("Failed %s type: %s", l, j.message), te(null));
|
|
344
343
|
}
|
|
345
344
|
}
|
|
346
345
|
}
|
|
347
|
-
var
|
|
346
|
+
var et = Array.isArray;
|
|
348
347
|
function ce(t) {
|
|
349
|
-
return
|
|
348
|
+
return et(t);
|
|
350
349
|
}
|
|
351
|
-
function
|
|
350
|
+
function tt(t) {
|
|
352
351
|
{
|
|
353
352
|
var r = typeof Symbol == "function" && Symbol.toStringTag, l = r && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
354
353
|
return l;
|
|
355
354
|
}
|
|
356
355
|
}
|
|
357
|
-
function
|
|
356
|
+
function st(t) {
|
|
358
357
|
try {
|
|
359
358
|
return Ee(t), !1;
|
|
360
359
|
} catch {
|
|
@@ -364,17 +363,17 @@ function Ct() {
|
|
|
364
363
|
function Ee(t) {
|
|
365
364
|
return "" + t;
|
|
366
365
|
}
|
|
367
|
-
function
|
|
368
|
-
if (
|
|
369
|
-
return
|
|
366
|
+
function Re(t) {
|
|
367
|
+
if (st(t))
|
|
368
|
+
return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", tt(t)), Ee(t);
|
|
370
369
|
}
|
|
371
|
-
var
|
|
370
|
+
var _e = T.ReactCurrentOwner, nt = {
|
|
372
371
|
key: !0,
|
|
373
372
|
ref: !0,
|
|
374
373
|
__self: !0,
|
|
375
374
|
__source: !0
|
|
376
375
|
}, Se, Oe;
|
|
377
|
-
function
|
|
376
|
+
function rt(t) {
|
|
378
377
|
if (U.call(t, "ref")) {
|
|
379
378
|
var r = Object.getOwnPropertyDescriptor(t, "ref").get;
|
|
380
379
|
if (r && r.isReactWarning)
|
|
@@ -382,7 +381,7 @@ function Ct() {
|
|
|
382
381
|
}
|
|
383
382
|
return t.ref !== void 0;
|
|
384
383
|
}
|
|
385
|
-
function
|
|
384
|
+
function it(t) {
|
|
386
385
|
if (U.call(t, "key")) {
|
|
387
386
|
var r = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
388
387
|
if (r && r.isReactWarning)
|
|
@@ -390,13 +389,13 @@ function Ct() {
|
|
|
390
389
|
}
|
|
391
390
|
return t.key !== void 0;
|
|
392
391
|
}
|
|
393
|
-
function
|
|
394
|
-
typeof t.ref == "string" &&
|
|
392
|
+
function at(t, r) {
|
|
393
|
+
typeof t.ref == "string" && _e.current;
|
|
395
394
|
}
|
|
396
|
-
function
|
|
395
|
+
function ot(t, r) {
|
|
397
396
|
{
|
|
398
397
|
var l = function() {
|
|
399
|
-
Se || (Se = !0,
|
|
398
|
+
Se || (Se = !0, E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
400
399
|
};
|
|
401
400
|
l.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
402
401
|
get: l,
|
|
@@ -404,10 +403,10 @@ function Ct() {
|
|
|
404
403
|
});
|
|
405
404
|
}
|
|
406
405
|
}
|
|
407
|
-
function
|
|
406
|
+
function ct(t, r) {
|
|
408
407
|
{
|
|
409
408
|
var l = function() {
|
|
410
|
-
Oe || (Oe = !0,
|
|
409
|
+
Oe || (Oe = !0, E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
411
410
|
};
|
|
412
411
|
l.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
413
412
|
get: l,
|
|
@@ -415,7 +414,7 @@ function Ct() {
|
|
|
415
414
|
});
|
|
416
415
|
}
|
|
417
416
|
}
|
|
418
|
-
var
|
|
417
|
+
var lt = function(t, r, l, x, k, C, b) {
|
|
419
418
|
var j = {
|
|
420
419
|
// This tag allows us to uniquely identify this as a React Element
|
|
421
420
|
$$typeof: s,
|
|
@@ -425,7 +424,7 @@ function Ct() {
|
|
|
425
424
|
ref: l,
|
|
426
425
|
props: b,
|
|
427
426
|
// Record the component responsible for creating this element.
|
|
428
|
-
_owner:
|
|
427
|
+
_owner: C
|
|
429
428
|
};
|
|
430
429
|
return j._store = {}, Object.defineProperty(j._store, "validated", {
|
|
431
430
|
configurable: !1,
|
|
@@ -444,28 +443,28 @@ function Ct() {
|
|
|
444
443
|
value: k
|
|
445
444
|
}), Object.freeze && (Object.freeze(j.props), Object.freeze(j)), j;
|
|
446
445
|
};
|
|
447
|
-
function
|
|
446
|
+
function dt(t, r, l, x, k) {
|
|
448
447
|
{
|
|
449
|
-
var
|
|
450
|
-
l !== void 0 && (
|
|
451
|
-
for (
|
|
452
|
-
U.call(r,
|
|
448
|
+
var C, b = {}, j = null, O = null;
|
|
449
|
+
l !== void 0 && (Re(l), j = "" + l), it(r) && (Re(r.key), j = "" + r.key), rt(r) && (O = r.ref, at(r, k));
|
|
450
|
+
for (C in r)
|
|
451
|
+
U.call(r, C) && !nt.hasOwnProperty(C) && (b[C] = r[C]);
|
|
453
452
|
if (t && t.defaultProps) {
|
|
454
|
-
var
|
|
455
|
-
for (
|
|
456
|
-
b[
|
|
453
|
+
var R = t.defaultProps;
|
|
454
|
+
for (C in R)
|
|
455
|
+
b[C] === void 0 && (b[C] = R[C]);
|
|
457
456
|
}
|
|
458
|
-
if (j ||
|
|
459
|
-
var
|
|
460
|
-
j &&
|
|
457
|
+
if (j || O) {
|
|
458
|
+
var _ = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
459
|
+
j && ot(b, _), O && ct(b, _);
|
|
461
460
|
}
|
|
462
|
-
return
|
|
461
|
+
return lt(t, j, O, k, x, _e.current, b);
|
|
463
462
|
}
|
|
464
463
|
}
|
|
465
|
-
var le =
|
|
466
|
-
function
|
|
464
|
+
var le = T.ReactCurrentOwner, $e = T.ReactDebugCurrentFrame;
|
|
465
|
+
function J(t) {
|
|
467
466
|
if (t) {
|
|
468
|
-
var r = t._owner, l =
|
|
467
|
+
var r = t._owner, l = ee(t.type, t._source, r ? r.type : null);
|
|
469
468
|
$e.setExtraStackFrame(l);
|
|
470
469
|
} else
|
|
471
470
|
$e.setExtraStackFrame(null);
|
|
@@ -478,7 +477,7 @@ function Ct() {
|
|
|
478
477
|
function Ae() {
|
|
479
478
|
{
|
|
480
479
|
if (le.current) {
|
|
481
|
-
var t =
|
|
480
|
+
var t = B(le.current.type);
|
|
482
481
|
if (t)
|
|
483
482
|
return `
|
|
484
483
|
|
|
@@ -487,11 +486,11 @@ Check the render method of \`` + t + "`.";
|
|
|
487
486
|
return "";
|
|
488
487
|
}
|
|
489
488
|
}
|
|
490
|
-
function
|
|
489
|
+
function ut(t) {
|
|
491
490
|
return "";
|
|
492
491
|
}
|
|
493
492
|
var Pe = {};
|
|
494
|
-
function
|
|
493
|
+
function ht(t) {
|
|
495
494
|
{
|
|
496
495
|
var r = Ae();
|
|
497
496
|
if (!r) {
|
|
@@ -508,12 +507,12 @@ Check the top-level render call using <` + l + ">.");
|
|
|
508
507
|
if (!t._store || t._store.validated || t.key != null)
|
|
509
508
|
return;
|
|
510
509
|
t._store.validated = !0;
|
|
511
|
-
var l =
|
|
510
|
+
var l = ht(r);
|
|
512
511
|
if (Pe[l])
|
|
513
512
|
return;
|
|
514
513
|
Pe[l] = !0;
|
|
515
514
|
var x = "";
|
|
516
|
-
t && t._owner && t._owner !== le.current && (x = " It was passed a child from " +
|
|
515
|
+
t && t._owner && t._owner !== le.current && (x = " It was passed a child from " + B(t._owner.type) + "."), J(t), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', l, x), J(null);
|
|
517
516
|
}
|
|
518
517
|
}
|
|
519
518
|
function Me(t, r) {
|
|
@@ -530,12 +529,12 @@ Check the top-level render call using <` + l + ">.");
|
|
|
530
529
|
else if (t) {
|
|
531
530
|
var k = g(t);
|
|
532
531
|
if (typeof k == "function" && k !== t.entries)
|
|
533
|
-
for (var
|
|
532
|
+
for (var C = k.call(t), b; !(b = C.next()).done; )
|
|
534
533
|
ue(b.value) && Be(b.value, r);
|
|
535
534
|
}
|
|
536
535
|
}
|
|
537
536
|
}
|
|
538
|
-
function
|
|
537
|
+
function ft(t) {
|
|
539
538
|
{
|
|
540
539
|
var r = t.type;
|
|
541
540
|
if (r == null || typeof r == "string")
|
|
@@ -550,143 +549,147 @@ Check the top-level render call using <` + l + ">.");
|
|
|
550
549
|
else
|
|
551
550
|
return;
|
|
552
551
|
if (l) {
|
|
553
|
-
var x =
|
|
554
|
-
|
|
552
|
+
var x = B(r);
|
|
553
|
+
Qe(l, t.props, "prop", x, t);
|
|
555
554
|
} else if (r.PropTypes !== void 0 && !de) {
|
|
556
555
|
de = !0;
|
|
557
|
-
var k =
|
|
558
|
-
|
|
556
|
+
var k = B(r);
|
|
557
|
+
E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", k || "Unknown");
|
|
559
558
|
}
|
|
560
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
559
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
561
560
|
}
|
|
562
561
|
}
|
|
563
|
-
function
|
|
562
|
+
function xt(t) {
|
|
564
563
|
{
|
|
565
564
|
for (var r = Object.keys(t.props), l = 0; l < r.length; l++) {
|
|
566
565
|
var x = r[l];
|
|
567
566
|
if (x !== "children" && x !== "key") {
|
|
568
|
-
|
|
567
|
+
J(t), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", x), J(null);
|
|
569
568
|
break;
|
|
570
569
|
}
|
|
571
570
|
}
|
|
572
|
-
t.ref !== null && (
|
|
571
|
+
t.ref !== null && (J(t), E("Invalid attribute `ref` supplied to `React.Fragment`."), J(null));
|
|
573
572
|
}
|
|
574
573
|
}
|
|
575
574
|
var Ie = {};
|
|
576
|
-
function Fe(t, r, l, x, k,
|
|
575
|
+
function Fe(t, r, l, x, k, C) {
|
|
577
576
|
{
|
|
578
|
-
var b =
|
|
577
|
+
var b = I(t);
|
|
579
578
|
if (!b) {
|
|
580
579
|
var j = "";
|
|
581
580
|
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (j += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
582
|
-
var
|
|
583
|
-
|
|
584
|
-
var
|
|
585
|
-
t === null ?
|
|
581
|
+
var O = ut();
|
|
582
|
+
O ? j += O : j += Ae();
|
|
583
|
+
var R;
|
|
584
|
+
t === null ? R = "null" : ce(t) ? R = "array" : t !== void 0 && t.$$typeof === s ? (R = "<" + (B(t.type) || "Unknown") + " />", j = " Did you accidentally export a JSX literal instead of a component?") : R = typeof t, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, j);
|
|
586
585
|
}
|
|
587
|
-
var
|
|
588
|
-
if (
|
|
589
|
-
return
|
|
586
|
+
var _ = dt(t, r, l, k, C);
|
|
587
|
+
if (_ == null)
|
|
588
|
+
return _;
|
|
590
589
|
if (b) {
|
|
591
|
-
var
|
|
592
|
-
if (
|
|
590
|
+
var P = r.children;
|
|
591
|
+
if (P !== void 0)
|
|
593
592
|
if (x)
|
|
594
|
-
if (ce(
|
|
595
|
-
for (var
|
|
596
|
-
Me(
|
|
597
|
-
Object.freeze && Object.freeze(
|
|
593
|
+
if (ce(P)) {
|
|
594
|
+
for (var z = 0; z < P.length; z++)
|
|
595
|
+
Me(P[z], t);
|
|
596
|
+
Object.freeze && Object.freeze(P);
|
|
598
597
|
} else
|
|
599
|
-
|
|
598
|
+
E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
600
599
|
else
|
|
601
|
-
Me(
|
|
600
|
+
Me(P, t);
|
|
602
601
|
}
|
|
603
602
|
if (U.call(r, "key")) {
|
|
604
|
-
var
|
|
605
|
-
return
|
|
603
|
+
var L = B(t), $ = Object.keys(r).filter(function(bt) {
|
|
604
|
+
return bt !== "key";
|
|
606
605
|
}), he = $.length > 0 ? "{key: someKey, " + $.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
607
|
-
if (!Ie[
|
|
608
|
-
var
|
|
609
|
-
|
|
606
|
+
if (!Ie[L + he]) {
|
|
607
|
+
var jt = $.length > 0 ? "{" + $.join(": ..., ") + ": ...}" : "{}";
|
|
608
|
+
E(`A props object containing a "key" prop is being spread into JSX:
|
|
610
609
|
let props = %s;
|
|
611
610
|
<%s {...props} />
|
|
612
611
|
React keys must be passed directly to JSX without using spread:
|
|
613
612
|
let props = %s;
|
|
614
|
-
<%s key={someKey} {...props} />`, he,
|
|
613
|
+
<%s key={someKey} {...props} />`, he, L, jt, L), Ie[L + he] = !0;
|
|
615
614
|
}
|
|
616
615
|
}
|
|
617
|
-
return t === c ?
|
|
616
|
+
return t === c ? xt(_) : ft(_), _;
|
|
618
617
|
}
|
|
619
618
|
}
|
|
620
|
-
function
|
|
619
|
+
function mt(t, r, l) {
|
|
621
620
|
return Fe(t, r, l, !0);
|
|
622
621
|
}
|
|
623
|
-
function
|
|
622
|
+
function vt(t, r, l) {
|
|
624
623
|
return Fe(t, r, l, !1);
|
|
625
624
|
}
|
|
626
|
-
var
|
|
627
|
-
K.Fragment = c, K.jsx =
|
|
625
|
+
var gt = vt, pt = mt;
|
|
626
|
+
K.Fragment = c, K.jsx = gt, K.jsxs = pt;
|
|
628
627
|
}()), K;
|
|
629
628
|
}
|
|
630
|
-
process.env.NODE_ENV === "production" ? xe.exports =
|
|
629
|
+
process.env.NODE_ENV === "production" ? xe.exports = kt() : xe.exports = Nt();
|
|
631
630
|
var e = xe.exports;
|
|
632
|
-
const
|
|
631
|
+
const Ct = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-chat-launcher", onClick: a, children: /* @__PURE__ */ e.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ e.jsx("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) }) }), { useState: se, useEffect: Tt, useRef: Le, useLayoutEffect: Je } = W, Dt = ({
|
|
633
632
|
mode: a = "floating",
|
|
634
633
|
isOpen: s = !0,
|
|
635
634
|
embedded: i = !1,
|
|
636
635
|
onClose: c,
|
|
637
636
|
onOpen: n,
|
|
638
|
-
children:
|
|
637
|
+
children: d,
|
|
639
638
|
drawerContent: m,
|
|
640
639
|
footer: h,
|
|
641
640
|
isDrawerOpen: f,
|
|
642
|
-
onDrawerOpenChange: w
|
|
641
|
+
onDrawerOpenChange: w,
|
|
642
|
+
headerActions: p
|
|
643
643
|
}) => {
|
|
644
|
-
const [
|
|
645
|
-
|
|
646
|
-
}, [
|
|
647
|
-
|
|
648
|
-
|
|
644
|
+
const [y, v] = se(!1), [o, u] = se(!1), N = f !== void 0 ? f : o, g = (I) => {
|
|
645
|
+
u(I), w == null || w(I);
|
|
646
|
+
}, [T, E] = se(!1), S = Le(null), [A, M] = se(!0);
|
|
647
|
+
Tt(() => {
|
|
648
|
+
v(!0);
|
|
649
649
|
}, []);
|
|
650
|
-
const
|
|
651
|
-
|
|
652
|
-
},
|
|
653
|
-
if (!
|
|
654
|
-
const { scrollTop:
|
|
655
|
-
E(
|
|
656
|
-
},
|
|
650
|
+
const V = () => {
|
|
651
|
+
S.current && (S.current.scrollTop = S.current.scrollHeight);
|
|
652
|
+
}, ne = () => {
|
|
653
|
+
if (!S.current) return;
|
|
654
|
+
const { scrollTop: I, scrollHeight: re, clientHeight: X } = S.current, B = re - I - X;
|
|
655
|
+
E(B > 100), M(B < 50);
|
|
656
|
+
}, Y = Le(null);
|
|
657
657
|
if (Je(() => {
|
|
658
|
-
|
|
659
|
-
}, [
|
|
660
|
-
if (!
|
|
661
|
-
const
|
|
662
|
-
|
|
658
|
+
A && V();
|
|
659
|
+
}, [d, A]), Je(() => {
|
|
660
|
+
if (!Y.current) return;
|
|
661
|
+
const I = new ResizeObserver(() => {
|
|
662
|
+
A && V();
|
|
663
663
|
});
|
|
664
|
-
return
|
|
665
|
-
}, [
|
|
664
|
+
return I.observe(Y.current), () => I.disconnect();
|
|
665
|
+
}, [A]), !y) return null;
|
|
666
666
|
if (!s && a === "floating" && !i)
|
|
667
|
-
return /* @__PURE__ */ e.jsx(
|
|
668
|
-
const
|
|
667
|
+
return /* @__PURE__ */ e.jsx(Ct, { onClick: () => n == null ? void 0 : n() });
|
|
668
|
+
const G = [
|
|
669
669
|
"cb-chat-container",
|
|
670
670
|
`cb-mode-${a}`,
|
|
671
671
|
s ? "cb-open" : "cb-closed",
|
|
672
672
|
i ? "cb-embedded" : null
|
|
673
673
|
].filter(Boolean).join(" ");
|
|
674
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
674
|
+
return /* @__PURE__ */ e.jsxs("div", { className: G, children: [
|
|
675
675
|
/* @__PURE__ */ e.jsxs("div", { className: "cb-chat-header", children: [
|
|
676
676
|
/* @__PURE__ */ e.jsxs("div", { className: "cb-header-left", children: [
|
|
677
|
-
/* @__PURE__ */ e.jsx("button", { className: "cb-header-btn", onClick: () =>
|
|
677
|
+
/* @__PURE__ */ e.jsx("button", { className: "cb-header-btn", onClick: () => g(!N), children: /* @__PURE__ */ e.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
678
678
|
/* @__PURE__ */ e.jsx("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
|
|
679
679
|
/* @__PURE__ */ e.jsx("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
|
|
680
680
|
/* @__PURE__ */ e.jsx("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
|
|
681
681
|
] }) }),
|
|
682
682
|
/* @__PURE__ */ e.jsx("span", { className: "cb-brand", children: "AI Assistant" })
|
|
683
683
|
] }),
|
|
684
|
-
/* @__PURE__ */ e.
|
|
684
|
+
/* @__PURE__ */ e.jsxs("div", { className: "cb-actions", children: [
|
|
685
|
+
p,
|
|
686
|
+
/* @__PURE__ */ e.jsx("button", { className: "cb-minimize-btn", onClick: c, children: /* @__PURE__ */ e.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ e.jsx("path", { d: "M18 6L6 18M6 6l12 12" }) }) })
|
|
687
|
+
] })
|
|
685
688
|
] }),
|
|
686
689
|
/* @__PURE__ */ e.jsxs("div", { className: "cb-chat-body-wrapper", children: [
|
|
687
|
-
/* @__PURE__ */ e.jsxs("div", { className: `cb-drawer-wrapper ${
|
|
690
|
+
/* @__PURE__ */ e.jsxs("div", { className: `cb-drawer-wrapper ${N ? "open" : ""}`, children: [
|
|
688
691
|
/* @__PURE__ */ e.jsx("div", { className: "cb-drawer-content", children: m }),
|
|
689
|
-
/* @__PURE__ */ e.jsx("div", { className: "cb-drawer-backdrop", onClick: () =>
|
|
692
|
+
/* @__PURE__ */ e.jsx("div", { className: "cb-drawer-backdrop", onClick: () => g(!1) })
|
|
690
693
|
] }),
|
|
691
694
|
/* @__PURE__ */ e.jsxs("div", { className: "cb-chat-content", children: [
|
|
692
695
|
/* @__PURE__ */ e.jsxs("div", { className: "cb-messages-area", children: [
|
|
@@ -694,16 +697,16 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
694
697
|
"div",
|
|
695
698
|
{
|
|
696
699
|
className: "cb-scroll-view",
|
|
697
|
-
ref:
|
|
698
|
-
onScroll:
|
|
699
|
-
children: /* @__PURE__ */ e.jsx("div", { ref:
|
|
700
|
+
ref: S,
|
|
701
|
+
onScroll: ne,
|
|
702
|
+
children: /* @__PURE__ */ e.jsx("div", { ref: Y, children: d })
|
|
700
703
|
}
|
|
701
704
|
),
|
|
702
705
|
/* @__PURE__ */ e.jsx(
|
|
703
706
|
"button",
|
|
704
707
|
{
|
|
705
|
-
className: `cb-scroll-bottom-btn ${
|
|
706
|
-
onClick:
|
|
708
|
+
className: `cb-scroll-bottom-btn ${T ? "visible" : ""}`,
|
|
709
|
+
onClick: V,
|
|
707
710
|
children: /* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ e.jsx("path", { d: "M12 5v14M19 12l-7 7-7-7" }) })
|
|
708
711
|
}
|
|
709
712
|
)
|
|
@@ -712,14 +715,14 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
712
715
|
] })
|
|
713
716
|
] })
|
|
714
717
|
] });
|
|
715
|
-
}, { useState: ze } =
|
|
718
|
+
}, { useState: ze } = W, Et = ({
|
|
716
719
|
onClose: a,
|
|
717
720
|
webSearchEnabled: s = !1,
|
|
718
721
|
onWebSearchChange: i,
|
|
719
722
|
pageContextEnabled: c = !1,
|
|
720
723
|
onPageContextChange: n
|
|
721
724
|
}) => {
|
|
722
|
-
const [
|
|
725
|
+
const [d, m] = ze("rovo"), [h, f] = ze({
|
|
723
726
|
knowledge: !0,
|
|
724
727
|
autoApply: !0
|
|
725
728
|
}), w = (v) => {
|
|
@@ -732,15 +735,15 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
732
735
|
return /* @__PURE__ */ e.jsx("div", { className: "cb-menu-overlay", onClick: a, children: /* @__PURE__ */ e.jsxs("div", { className: "cb-menu-content reasoning", onClick: (v) => v.stopPropagation(), children: [
|
|
733
736
|
/* @__PURE__ */ e.jsx("div", { className: "cb-menu-header", children: /* @__PURE__ */ e.jsx("span", { children: "Reasoning" }) }),
|
|
734
737
|
/* @__PURE__ */ e.jsxs("div", { className: "cb-menu-section", children: [
|
|
735
|
-
/* @__PURE__ */ e.jsxs("div", { className: `cb-menu-item ${
|
|
738
|
+
/* @__PURE__ */ e.jsxs("div", { className: `cb-menu-item ${d === "rovo" ? "active" : ""}`, onClick: () => m("rovo"), children: [
|
|
736
739
|
/* @__PURE__ */ e.jsx("div", { className: "cb-menu-icon-circle", children: /* @__PURE__ */ e.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ e.jsx("path", { d: "M13 2L3 14h9l-1 8 10-12h-9l1-8z" }) }) }),
|
|
737
740
|
/* @__PURE__ */ e.jsxs("div", { className: "cb-menu-info", children: [
|
|
738
741
|
/* @__PURE__ */ e.jsx("span", { className: "cb-menu-title", children: "Let Rovo decide" }),
|
|
739
742
|
/* @__PURE__ */ e.jsx("span", { className: "cb-menu-desc", children: "Rovo picks the best reasoning" })
|
|
740
743
|
] }),
|
|
741
|
-
|
|
744
|
+
d === "rovo" && /* @__PURE__ */ e.jsx("div", { className: "cb-check", children: /* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ e.jsx("polyline", { points: "20 6 9 17 4 12" }) }) })
|
|
742
745
|
] }),
|
|
743
|
-
/* @__PURE__ */ e.jsxs("div", { className: `cb-menu-item ${
|
|
746
|
+
/* @__PURE__ */ e.jsxs("div", { className: `cb-menu-item ${d === "deep" ? "active" : ""}`, onClick: () => m("deep"), children: [
|
|
744
747
|
/* @__PURE__ */ e.jsx("div", { className: "cb-menu-icon-circle", children: /* @__PURE__ */ e.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
745
748
|
/* @__PURE__ */ e.jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
746
749
|
/* @__PURE__ */ e.jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
@@ -749,9 +752,9 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
749
752
|
/* @__PURE__ */ e.jsx("span", { className: "cb-menu-title", children: "Think deeper" }),
|
|
750
753
|
/* @__PURE__ */ e.jsx("span", { className: "cb-menu-desc", children: "Longer thinking for robust responses" })
|
|
751
754
|
] }),
|
|
752
|
-
|
|
755
|
+
d === "deep" && /* @__PURE__ */ e.jsx("div", { className: "cb-check", children: /* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ e.jsx("polyline", { points: "20 6 9 17 4 12" }) }) })
|
|
753
756
|
] }),
|
|
754
|
-
/* @__PURE__ */ e.jsxs("div", { className: `cb-menu-item ${
|
|
757
|
+
/* @__PURE__ */ e.jsxs("div", { className: `cb-menu-item ${d === "research" ? "active" : ""}`, onClick: () => m("research"), children: [
|
|
755
758
|
/* @__PURE__ */ e.jsx("div", { className: "cb-menu-icon-circle", children: /* @__PURE__ */ e.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
756
759
|
/* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
757
760
|
/* @__PURE__ */ e.jsx("path", { d: "M16.2 7.8l-2 6.3-6.4 2.1 2-6.3z" })
|
|
@@ -760,7 +763,7 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
760
763
|
/* @__PURE__ */ e.jsx("span", { className: "cb-menu-title", children: "Deep research" }),
|
|
761
764
|
/* @__PURE__ */ e.jsx("span", { className: "cb-menu-desc", children: "Synthesize insights and create reports" })
|
|
762
765
|
] }),
|
|
763
|
-
|
|
766
|
+
d === "research" && /* @__PURE__ */ e.jsx("div", { className: "cb-check", children: /* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ e.jsx("polyline", { points: "20 6 9 17 4 12" }) }) })
|
|
764
767
|
] })
|
|
765
768
|
] }),
|
|
766
769
|
/* @__PURE__ */ e.jsx("div", { className: "cb-menu-header", children: /* @__PURE__ */ e.jsx("span", { children: "Sources" }) }),
|
|
@@ -842,35 +845,35 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
842
845
|
] }),
|
|
843
846
|
/* @__PURE__ */ e.jsx("span", { className: "cb-menu-title", children: "More formatting" })
|
|
844
847
|
] })
|
|
845
|
-
] }) }) }), { useState: Ve, useRef:
|
|
848
|
+
] }) }) }), { useState: Ve, useRef: _t, useEffect: St } = W, Lt = ({
|
|
846
849
|
onSend: a,
|
|
847
850
|
disabled: s = !1,
|
|
848
851
|
placeholder: i = "Ask, @mention, or / for actions",
|
|
849
852
|
webSearchEnabled: c = !1,
|
|
850
853
|
onWebSearchChange: n,
|
|
851
|
-
pageContextEnabled:
|
|
854
|
+
pageContextEnabled: d = !1,
|
|
852
855
|
onPageContextChange: m
|
|
853
856
|
}) => {
|
|
854
|
-
const [h, f] = Ve(""), [w, p] = Ve(null), y =
|
|
855
|
-
|
|
856
|
-
const
|
|
857
|
-
y.current && !y.current.contains(
|
|
857
|
+
const [h, f] = Ve(""), [w, p] = Ve(null), y = _t(null);
|
|
858
|
+
St(() => {
|
|
859
|
+
const u = (N) => {
|
|
860
|
+
y.current && !y.current.contains(N.target) && p(null);
|
|
858
861
|
};
|
|
859
|
-
return document.addEventListener("mousedown",
|
|
862
|
+
return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
|
|
860
863
|
}, []);
|
|
861
|
-
const v = (
|
|
862
|
-
|
|
863
|
-
}, o = (
|
|
864
|
-
p(w ===
|
|
864
|
+
const v = (u) => {
|
|
865
|
+
u.key === "Enter" && !u.shiftKey && (u.preventDefault(), h.trim() && !s && (a == null || a(h), f("")));
|
|
866
|
+
}, o = (u) => {
|
|
867
|
+
p(w === u ? null : u);
|
|
865
868
|
};
|
|
866
869
|
return /* @__PURE__ */ e.jsxs("div", { className: "cb-composer", ref: y, children: [
|
|
867
870
|
w === "reasoning" && /* @__PURE__ */ e.jsx(
|
|
868
|
-
|
|
871
|
+
Et,
|
|
869
872
|
{
|
|
870
873
|
onClose: () => p(null),
|
|
871
874
|
webSearchEnabled: c,
|
|
872
875
|
onWebSearchChange: n,
|
|
873
|
-
pageContextEnabled:
|
|
876
|
+
pageContextEnabled: d,
|
|
874
877
|
onPageContextChange: m
|
|
875
878
|
}
|
|
876
879
|
),
|
|
@@ -881,7 +884,7 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
881
884
|
{
|
|
882
885
|
className: "cb-composer-textarea",
|
|
883
886
|
value: h,
|
|
884
|
-
onChange: (
|
|
887
|
+
onChange: (u) => f(u.target.value),
|
|
885
888
|
onKeyDown: v,
|
|
886
889
|
onFocus: () => p(null),
|
|
887
890
|
placeholder: i,
|
|
@@ -944,15 +947,15 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
944
947
|
] }),
|
|
945
948
|
/* @__PURE__ */ e.jsx("div", { className: "cb-composer-footer", children: /* @__PURE__ */ e.jsx("span", { children: "Uses AI. Verify results." }) })
|
|
946
949
|
] });
|
|
947
|
-
}, { useState:
|
|
950
|
+
}, { useState: Ot } = W, Ye = ({
|
|
948
951
|
toolName: a,
|
|
949
952
|
status: s,
|
|
950
953
|
args: i,
|
|
951
954
|
result: c
|
|
952
955
|
}) => {
|
|
953
|
-
const [n,
|
|
956
|
+
const [n, d] = Ot(!1), m = a === "web_search" || a === "search_web";
|
|
954
957
|
return /* @__PURE__ */ e.jsxs("div", { className: `cb-tool-invocation ${s}`, children: [
|
|
955
|
-
/* @__PURE__ */ e.jsxs("div", { className: "cb-tool-header", onClick: () =>
|
|
958
|
+
/* @__PURE__ */ e.jsxs("div", { className: "cb-tool-header", onClick: () => d(!n), children: [
|
|
956
959
|
/* @__PURE__ */ e.jsx("div", { className: "cb-tool-icon", children: s === "running" ? /* @__PURE__ */ e.jsx("div", { className: "cb-spinner-sm" }) : /* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", className: "cb-icon-check", children: /* @__PURE__ */ e.jsx("polyline", { points: "20 6 9 17 4 12" }) }) }),
|
|
957
960
|
/* @__PURE__ */ e.jsxs("span", { className: "cb-tool-name", children: [
|
|
958
961
|
/* @__PURE__ */ e.jsx("span", { style: { opacity: 0.7 }, children: s === "running" ? "Calling" : "Used tool" }),
|
|
@@ -984,13 +987,13 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
984
987
|
] })
|
|
985
988
|
] }) })
|
|
986
989
|
] });
|
|
987
|
-
},
|
|
990
|
+
}, $t = ({
|
|
988
991
|
toolCallId: a,
|
|
989
992
|
label: s,
|
|
990
993
|
description: i,
|
|
991
994
|
status: c,
|
|
992
995
|
onConfirm: n,
|
|
993
|
-
onReject:
|
|
996
|
+
onReject: d
|
|
994
997
|
}) => c !== "pending" ? /* @__PURE__ */ e.jsxs("div", { className: "cb-confirm-status", children: [
|
|
995
998
|
c === "confirmed" && /* @__PURE__ */ e.jsxs("div", { className: "cb-confirm-status-confirmed", children: [
|
|
996
999
|
/* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ e.jsx("polyline", { points: "20 6 9 17 4 12" }) }),
|
|
@@ -1033,7 +1036,7 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
1033
1036
|
"button",
|
|
1034
1037
|
{
|
|
1035
1038
|
className: "cb-btn-reject",
|
|
1036
|
-
onClick: () =>
|
|
1039
|
+
onClick: () => d(a),
|
|
1037
1040
|
children: [
|
|
1038
1041
|
/* @__PURE__ */ e.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
1039
1042
|
/* @__PURE__ */ e.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
@@ -1044,7 +1047,7 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
1044
1047
|
}
|
|
1045
1048
|
)
|
|
1046
1049
|
] })
|
|
1047
|
-
] }), { useState: me, useEffect:
|
|
1050
|
+
] }), { useState: me, useEffect: qe, useRef: Ue } = W, Jt = (a) => {
|
|
1048
1051
|
const {
|
|
1049
1052
|
role: s,
|
|
1050
1053
|
steps: i,
|
|
@@ -1059,16 +1062,16 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
1059
1062
|
] }) }) }),
|
|
1060
1063
|
/* @__PURE__ */ e.jsxs("div", { className: "cb-message-content-wrapper", style: { width: "100%" }, children: [
|
|
1061
1064
|
s === "user" ? null : /* @__PURE__ */ e.jsx("div", { className: "cb-sender-name", children: "Assistant" }),
|
|
1062
|
-
/* @__PURE__ */ e.jsx("div", { className: "cb-steps-container", children: i.map((n,
|
|
1063
|
-
const m =
|
|
1065
|
+
/* @__PURE__ */ e.jsx("div", { className: "cb-steps-container", children: i.map((n, d) => {
|
|
1066
|
+
const m = d === i.length - 1;
|
|
1064
1067
|
return n.type === "thinking" ? /* @__PURE__ */ e.jsx(
|
|
1065
|
-
|
|
1068
|
+
At,
|
|
1066
1069
|
{
|
|
1067
1070
|
step: n
|
|
1068
1071
|
},
|
|
1069
1072
|
n.id
|
|
1070
1073
|
) : n.type === "tool-call" ? /* @__PURE__ */ e.jsx("div", { className: "cb-step-tool", style: { marginBottom: 8 }, children: /* @__PURE__ */ e.jsx(
|
|
1071
|
-
|
|
1074
|
+
Ye,
|
|
1072
1075
|
{
|
|
1073
1076
|
toolName: n.toolName || "Tool",
|
|
1074
1077
|
args: n.toolArgs,
|
|
@@ -1076,7 +1079,7 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
1076
1079
|
result: n.toolResult
|
|
1077
1080
|
}
|
|
1078
1081
|
) }, n.id) : n.type === "confirm-request" ? /* @__PURE__ */ e.jsx("div", { className: "cb-step-confirm", style: { marginBottom: 8 }, children: /* @__PURE__ */ e.jsx(
|
|
1079
|
-
|
|
1082
|
+
$t,
|
|
1080
1083
|
{
|
|
1081
1084
|
toolCallId: n.toolCallId || n.id,
|
|
1082
1085
|
toolName: n.toolName || "Tool",
|
|
@@ -1089,7 +1092,7 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
1089
1092
|
})
|
|
1090
1093
|
}
|
|
1091
1094
|
) }, n.id) : n.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: `cb-message-bubble ${s}`, style: { marginBottom: 8, maxWidth: "100%" }, children: /* @__PURE__ */ e.jsx(
|
|
1092
|
-
|
|
1095
|
+
Pt,
|
|
1093
1096
|
{
|
|
1094
1097
|
content: n.content || "",
|
|
1095
1098
|
shouldAnimate: c && m,
|
|
@@ -1098,8 +1101,8 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
1098
1101
|
) }, n.id) : null;
|
|
1099
1102
|
}) })
|
|
1100
1103
|
] })
|
|
1101
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
1102
|
-
},
|
|
1104
|
+
] }) : /* @__PURE__ */ e.jsx(Bt, { ...a });
|
|
1105
|
+
}, At = ({ step: a }) => {
|
|
1103
1106
|
const [s, i] = me(!1), c = a.isFinished;
|
|
1104
1107
|
return /* @__PURE__ */ e.jsxs("div", { className: "cb-step-thinking-block", style: { marginBottom: 8, border: "1px solid rgba(255,255,255,0.1)", borderRadius: 8, overflow: "hidden" }, children: [
|
|
1105
1108
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -1140,25 +1143,25 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
1140
1143
|
]
|
|
1141
1144
|
}
|
|
1142
1145
|
),
|
|
1143
|
-
s && a.thoughts && a.thoughts.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "cb-thinking-logs", style: { padding: "8px 12px", background: "rgba(0,0,0,0.2)", borderTop: "1px solid rgba(255,255,255,0.05)" }, children: a.thoughts.map((n,
|
|
1146
|
+
s && a.thoughts && a.thoughts.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "cb-thinking-logs", style: { padding: "8px 12px", background: "rgba(0,0,0,0.2)", borderTop: "1px solid rgba(255,255,255,0.05)" }, children: a.thoughts.map((n, d) => /* @__PURE__ */ e.jsx("div", { style: { fontSize: "12px", fontFamily: "monospace", color: "rgba(255,255,255,0.5)", marginBottom: 4 }, children: n }, d)) }),
|
|
1144
1147
|
/* @__PURE__ */ e.jsx("style", { children: `
|
|
1145
1148
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
1146
1149
|
` })
|
|
1147
1150
|
] });
|
|
1148
|
-
},
|
|
1149
|
-
const [c, n] = me(s ? "" : a),
|
|
1150
|
-
return
|
|
1151
|
-
if (
|
|
1152
|
-
n(a),
|
|
1151
|
+
}, Pt = ({ content: a, shouldAnimate: s, onComplete: i }) => {
|
|
1152
|
+
const [c, n] = me(s ? "" : a), d = Ue(!1);
|
|
1153
|
+
return qe(() => {
|
|
1154
|
+
if (d.current = !1, !s || !a) {
|
|
1155
|
+
n(a), d.current || (d.current = !0, i == null || i());
|
|
1153
1156
|
return;
|
|
1154
1157
|
}
|
|
1155
1158
|
let m, h;
|
|
1156
1159
|
const f = Date.now(), w = 15, p = a.length * w, y = () => {
|
|
1157
|
-
const o = Date.now() - f,
|
|
1158
|
-
|
|
1160
|
+
const o = Date.now() - f, u = Math.floor(o / w);
|
|
1161
|
+
u < a.length ? (n(a.substring(0, u + 1)), m = requestAnimationFrame(y)) : (n(a), d.current || (d.current = !0, i == null || i()));
|
|
1159
1162
|
};
|
|
1160
1163
|
return m = requestAnimationFrame(y), h = setTimeout(() => {
|
|
1161
|
-
|
|
1164
|
+
d.current || (n(a), d.current = !0, i == null || i());
|
|
1162
1165
|
}, p + 100), () => {
|
|
1163
1166
|
cancelAnimationFrame(m), clearTimeout(h);
|
|
1164
1167
|
};
|
|
@@ -1166,36 +1169,36 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
1166
1169
|
c,
|
|
1167
1170
|
s && a && c.length < a.length && /* @__PURE__ */ e.jsx("span", { className: "cb-cursor", children: "|" })
|
|
1168
1171
|
] });
|
|
1169
|
-
},
|
|
1172
|
+
}, Bt = (a) => {
|
|
1170
1173
|
const {
|
|
1171
1174
|
role: s,
|
|
1172
1175
|
content: i,
|
|
1173
1176
|
attachments: c,
|
|
1174
1177
|
toolInvocation: n,
|
|
1175
|
-
shouldAnimate:
|
|
1176
|
-
} = a, [m, h] = me(""), f =
|
|
1177
|
-
return
|
|
1178
|
-
var
|
|
1179
|
-
if (f.current = !1, s !== "assistant" || !i || !
|
|
1180
|
-
h(i || ""), f.current || (f.current = !0, (
|
|
1178
|
+
shouldAnimate: d = !0
|
|
1179
|
+
} = a, [m, h] = me(""), f = Ue(!1);
|
|
1180
|
+
return qe(() => {
|
|
1181
|
+
var N;
|
|
1182
|
+
if (f.current = !1, s !== "assistant" || !i || !d) {
|
|
1183
|
+
h(i || ""), f.current || (f.current = !0, (N = a.onAnimationComplete) == null || N.call(a));
|
|
1181
1184
|
return;
|
|
1182
1185
|
}
|
|
1183
1186
|
let w, p;
|
|
1184
|
-
const y = Date.now(), v = 15, o = i.length * v,
|
|
1185
|
-
var
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1187
|
+
const y = Date.now(), v = 15, o = i.length * v, u = () => {
|
|
1188
|
+
var S;
|
|
1189
|
+
const T = Date.now() - y, E = Math.floor(T / v);
|
|
1190
|
+
E < i.length ? (h(i.substring(0, E + 1)), w = requestAnimationFrame(u)) : (h(i), f.current || (f.current = !0, (S = a.onAnimationComplete) == null || S.call(a)));
|
|
1188
1191
|
};
|
|
1189
|
-
return w = requestAnimationFrame(
|
|
1192
|
+
return w = requestAnimationFrame(u), p = setTimeout(() => {
|
|
1190
1193
|
var g;
|
|
1191
1194
|
f.current || (h(i), f.current = !0, (g = a.onAnimationComplete) == null || g.call(a));
|
|
1192
1195
|
}, o + 100), () => {
|
|
1193
1196
|
cancelAnimationFrame(w), clearTimeout(p);
|
|
1194
1197
|
};
|
|
1195
|
-
}, [i, s,
|
|
1198
|
+
}, [i, s, d]), n ? /* @__PURE__ */ e.jsxs("div", { className: "cb-message-row cb-row-assistant", style: { marginBottom: "8px" }, children: [
|
|
1196
1199
|
/* @__PURE__ */ e.jsx("div", { className: "cb-avatar-container", children: /* @__PURE__ */ e.jsx("div", { className: "cb-avatar-assistant", style: { background: "#333" }, children: /* @__PURE__ */ e.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ e.jsx("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z" }) }) }) }),
|
|
1197
1200
|
/* @__PURE__ */ e.jsx("div", { className: "cb-message-content-wrapper", children: /* @__PURE__ */ e.jsx(
|
|
1198
|
-
|
|
1201
|
+
Ye,
|
|
1199
1202
|
{
|
|
1200
1203
|
toolName: n.toolName,
|
|
1201
1204
|
args: n.args,
|
|
@@ -1215,20 +1218,20 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
1215
1218
|
/* @__PURE__ */ e.jsxs("div", { className: `cb-message-bubble ${s}`, children: [
|
|
1216
1219
|
/* @__PURE__ */ e.jsxs("div", { className: "cb-markdown-content", children: [
|
|
1217
1220
|
m,
|
|
1218
|
-
s === "assistant" &&
|
|
1221
|
+
s === "assistant" && d && i && m.length < i.length && /* @__PURE__ */ e.jsx("span", { className: "cb-cursor", children: "|" })
|
|
1219
1222
|
] }),
|
|
1220
1223
|
c && c.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "cb-attachments-grid" })
|
|
1221
1224
|
] })
|
|
1222
1225
|
] })
|
|
1223
1226
|
] });
|
|
1224
|
-
},
|
|
1227
|
+
}, zt = () => /* @__PURE__ */ e.jsxs("div", { className: "cb-thinking-container", children: [
|
|
1225
1228
|
/* @__PURE__ */ e.jsxs("div", { className: "cb-thinking-dots", children: [
|
|
1226
1229
|
/* @__PURE__ */ e.jsx("div", { className: "cb-dot" }),
|
|
1227
1230
|
/* @__PURE__ */ e.jsx("div", { className: "cb-dot" }),
|
|
1228
1231
|
/* @__PURE__ */ e.jsx("div", { className: "cb-dot" })
|
|
1229
1232
|
] }),
|
|
1230
1233
|
/* @__PURE__ */ e.jsx("span", { className: "cb-thinking-text", children: "Thinking..." })
|
|
1231
|
-
] }),
|
|
1234
|
+
] }), Vt = ({
|
|
1232
1235
|
userName: a = "User",
|
|
1233
1236
|
actions: s = []
|
|
1234
1237
|
}) => /* @__PURE__ */ e.jsxs("div", { className: "cb-welcome-container", children: [
|
|
@@ -1247,7 +1250,7 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
1247
1250
|
/* @__PURE__ */ e.jsx("div", { className: "cb-action-icon", children: i.icon }),
|
|
1248
1251
|
/* @__PURE__ */ e.jsx("span", { className: "cb-action-label", children: i.label })
|
|
1249
1252
|
] }, i.id)) })
|
|
1250
|
-
] }),
|
|
1253
|
+
] }), Yt = ({
|
|
1251
1254
|
onNewChat: a,
|
|
1252
1255
|
agents: s,
|
|
1253
1256
|
chatHistory: i
|
|
@@ -1289,8 +1292,8 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
1289
1292
|
/* @__PURE__ */ e.jsx("span", { className: "cb-item-label", children: "View all conversations" })
|
|
1290
1293
|
] })
|
|
1291
1294
|
] })
|
|
1292
|
-
] }), { useState:
|
|
1293
|
-
const [i, c] =
|
|
1295
|
+
] }), { useState: Mt } = W, qt = ({ queue: a, onDelete: s }) => {
|
|
1296
|
+
const [i, c] = Mt(!1);
|
|
1294
1297
|
if (a.length === 0) return null;
|
|
1295
1298
|
const n = () => c(!i);
|
|
1296
1299
|
return /* @__PURE__ */ e.jsxs("div", { className: `cb-pending-messages ${i ? "expanded" : "collapsed"}`, children: [
|
|
@@ -1301,10 +1304,10 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
1301
1304
|
/* @__PURE__ */ e.jsx("span", { className: "cb-pending-preview-text", children: i ? "Pending Messages" : a[0] })
|
|
1302
1305
|
] })
|
|
1303
1306
|
] }),
|
|
1304
|
-
i && /* @__PURE__ */ e.jsx("div", { className: "cb-pending-list", children: a.map((
|
|
1307
|
+
i && /* @__PURE__ */ e.jsx("div", { className: "cb-pending-list", children: a.map((d, m) => /* @__PURE__ */ e.jsxs("div", { className: "cb-pending-item", children: [
|
|
1305
1308
|
/* @__PURE__ */ e.jsxs("div", { className: "cb-pending-content", children: [
|
|
1306
1309
|
/* @__PURE__ */ e.jsx("span", { className: "cb-status-label", children: m === 0 ? "NEXT" : "WAIT" }),
|
|
1307
|
-
/* @__PURE__ */ e.jsx("span", { className: "cb-pending-text", style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children:
|
|
1310
|
+
/* @__PURE__ */ e.jsx("span", { className: "cb-pending-text", style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: d })
|
|
1308
1311
|
] }),
|
|
1309
1312
|
s && /* @__PURE__ */ e.jsx(
|
|
1310
1313
|
"button",
|
|
@@ -1323,7 +1326,7 @@ const Tt = ({ onClick: a }) => /* @__PURE__ */ e.jsx("button", { className: "cb-
|
|
|
1323
1326
|
] }, m)) })
|
|
1324
1327
|
] });
|
|
1325
1328
|
}, fe = "http://localhost:8000/api";
|
|
1326
|
-
class
|
|
1329
|
+
class Ut {
|
|
1327
1330
|
constructor(s) {
|
|
1328
1331
|
F(this, "accessToken", null);
|
|
1329
1332
|
F(this, "messages", []);
|
|
@@ -1361,7 +1364,7 @@ class Ht {
|
|
|
1361
1364
|
const n = this.messages.map((v) => ({
|
|
1362
1365
|
role: v.role,
|
|
1363
1366
|
content: v.content
|
|
1364
|
-
})),
|
|
1367
|
+
})), d = await fetch(`${fe}/v1/chat/completions`, {
|
|
1365
1368
|
method: "POST",
|
|
1366
1369
|
headers: {
|
|
1367
1370
|
"Content-Type": "application/json",
|
|
@@ -1377,16 +1380,16 @@ class Ht {
|
|
|
1377
1380
|
}
|
|
1378
1381
|
})
|
|
1379
1382
|
});
|
|
1380
|
-
if (!
|
|
1381
|
-
let v =
|
|
1383
|
+
if (!d.ok) {
|
|
1384
|
+
let v = d.statusText;
|
|
1382
1385
|
try {
|
|
1383
|
-
const o = await
|
|
1386
|
+
const o = await d.json();
|
|
1384
1387
|
v = JSON.stringify(o);
|
|
1385
1388
|
} catch {
|
|
1386
1389
|
}
|
|
1387
|
-
throw new Error(`Gateway Request Failed: ${
|
|
1390
|
+
throw new Error(`Gateway Request Failed: ${d.status} - ${v}`);
|
|
1388
1391
|
}
|
|
1389
|
-
const { stream_url: m, job_id: h } = await
|
|
1392
|
+
const { stream_url: m, job_id: h } = await d.json();
|
|
1390
1393
|
if (this.currentJobId = h, !m)
|
|
1391
1394
|
throw new Error("No stream URL received from gateway");
|
|
1392
1395
|
const f = (Date.now() + 1).toString(), w = {
|
|
@@ -1400,23 +1403,23 @@ class Ht {
|
|
|
1400
1403
|
p.addEventListener("delta", (v) => {
|
|
1401
1404
|
try {
|
|
1402
1405
|
const o = JSON.parse(v.data);
|
|
1403
|
-
o.content && (y += o.content, this.messages = this.messages.map((
|
|
1404
|
-
if (
|
|
1405
|
-
let
|
|
1406
|
-
if (
|
|
1407
|
-
const g = [...
|
|
1408
|
-
|
|
1409
|
-
...
|
|
1410
|
-
content: (
|
|
1406
|
+
o.content && (y += o.content, this.messages = this.messages.map((u) => {
|
|
1407
|
+
if (u.id === f) {
|
|
1408
|
+
let N = { ...u, content: y };
|
|
1409
|
+
if (u.steps && u.steps.length > 0) {
|
|
1410
|
+
const g = [...u.steps], T = g[g.length - 1];
|
|
1411
|
+
T && T.type === "text" ? g[g.length - 1] = {
|
|
1412
|
+
...T,
|
|
1413
|
+
content: (T.content || "") + o.content
|
|
1411
1414
|
} : g.push({
|
|
1412
1415
|
id: `text-${Date.now()}`,
|
|
1413
1416
|
type: "text",
|
|
1414
1417
|
content: o.content
|
|
1415
|
-
}),
|
|
1418
|
+
}), N.steps = g;
|
|
1416
1419
|
}
|
|
1417
|
-
return
|
|
1420
|
+
return N;
|
|
1418
1421
|
}
|
|
1419
|
-
return
|
|
1422
|
+
return u;
|
|
1420
1423
|
}), i({ messages: this.messages, isThinking: !0 }));
|
|
1421
1424
|
} catch (o) {
|
|
1422
1425
|
console.warn("Failed to parse delta event data", o);
|
|
@@ -1424,10 +1427,10 @@ class Ht {
|
|
|
1424
1427
|
}), p.addEventListener("tool_call", (v) => {
|
|
1425
1428
|
try {
|
|
1426
1429
|
const o = JSON.parse(v.data);
|
|
1427
|
-
console.log("Tool call received:", o), this.messages = this.messages.map((
|
|
1428
|
-
if (
|
|
1429
|
-
let
|
|
1430
|
-
|
|
1430
|
+
console.log("Tool call received:", o), this.messages = this.messages.map((u) => {
|
|
1431
|
+
if (u.id === f) {
|
|
1432
|
+
let N = u.steps ? [...u.steps] : [];
|
|
1433
|
+
N.length === 0 && y && N.push({
|
|
1431
1434
|
id: `text-pre-${Date.now()}`,
|
|
1432
1435
|
type: "text",
|
|
1433
1436
|
content: y
|
|
@@ -1439,9 +1442,9 @@ class Ht {
|
|
|
1439
1442
|
toolArgs: o.arguments,
|
|
1440
1443
|
toolStatus: "running"
|
|
1441
1444
|
};
|
|
1442
|
-
return { ...
|
|
1445
|
+
return { ...u, steps: [...N, g] };
|
|
1443
1446
|
}
|
|
1444
|
-
return
|
|
1447
|
+
return u;
|
|
1445
1448
|
}), i({ messages: this.messages, isThinking: !0 });
|
|
1446
1449
|
} catch (o) {
|
|
1447
1450
|
console.warn("Failed to parse tool_call event data", o);
|
|
@@ -1449,16 +1452,16 @@ class Ht {
|
|
|
1449
1452
|
}), p.addEventListener("tool_result", (v) => {
|
|
1450
1453
|
try {
|
|
1451
1454
|
const o = JSON.parse(v.data);
|
|
1452
|
-
console.log("Tool result received:", o), this.messages = this.messages.map((
|
|
1453
|
-
if (
|
|
1454
|
-
const
|
|
1455
|
+
console.log("Tool result received:", o), this.messages = this.messages.map((u) => {
|
|
1456
|
+
if (u.id === f && u.steps) {
|
|
1457
|
+
const N = u.steps.map((g) => g.type === "tool-call" && (g.id === o.tool_call_id || g.toolName === o.tool_name) ? {
|
|
1455
1458
|
...g,
|
|
1456
1459
|
toolStatus: "completed",
|
|
1457
1460
|
toolResult: o.result
|
|
1458
1461
|
} : g);
|
|
1459
|
-
return { ...
|
|
1462
|
+
return { ...u, steps: N };
|
|
1460
1463
|
}
|
|
1461
|
-
return
|
|
1464
|
+
return u;
|
|
1462
1465
|
}), i({ messages: this.messages, isThinking: !0 });
|
|
1463
1466
|
} catch (o) {
|
|
1464
1467
|
console.warn("Failed to parse tool_result event data", o);
|
|
@@ -1466,14 +1469,14 @@ class Ht {
|
|
|
1466
1469
|
}), p.addEventListener("confirm_request", (v) => {
|
|
1467
1470
|
try {
|
|
1468
1471
|
const o = JSON.parse(v.data);
|
|
1469
|
-
console.log("Confirm request received:", o), this.messages = this.messages.map((
|
|
1470
|
-
if (
|
|
1471
|
-
let
|
|
1472
|
-
return
|
|
1472
|
+
console.log("Confirm request received:", o), this.messages = this.messages.map((u) => {
|
|
1473
|
+
if (u.id === f) {
|
|
1474
|
+
let N = u.steps ? [...u.steps] : [];
|
|
1475
|
+
return N.length === 0 && y && N.push({
|
|
1473
1476
|
id: `text-pre-${Date.now()}`,
|
|
1474
1477
|
type: "text",
|
|
1475
1478
|
content: y
|
|
1476
|
-
}),
|
|
1479
|
+
}), N.push({
|
|
1477
1480
|
id: o.tool_call_id,
|
|
1478
1481
|
type: "confirm-request",
|
|
1479
1482
|
toolCallId: o.tool_call_id,
|
|
@@ -1481,9 +1484,9 @@ class Ht {
|
|
|
1481
1484
|
confirmLabel: o.label,
|
|
1482
1485
|
confirmDescription: o.description,
|
|
1483
1486
|
confirmStatus: "pending"
|
|
1484
|
-
}), { ...
|
|
1487
|
+
}), { ...u, steps: N };
|
|
1485
1488
|
}
|
|
1486
|
-
return
|
|
1489
|
+
return u;
|
|
1487
1490
|
}), i({ messages: this.messages, isThinking: !0 });
|
|
1488
1491
|
} catch (o) {
|
|
1489
1492
|
console.warn("Failed to parse confirm_request event data", o);
|
|
@@ -1491,15 +1494,15 @@ class Ht {
|
|
|
1491
1494
|
}), p.addEventListener("confirm_response", (v) => {
|
|
1492
1495
|
try {
|
|
1493
1496
|
const o = JSON.parse(v.data);
|
|
1494
|
-
console.log("Confirm response received:", o), this.messages = this.messages.map((
|
|
1495
|
-
if (
|
|
1496
|
-
const
|
|
1497
|
+
console.log("Confirm response received:", o), this.messages = this.messages.map((u) => {
|
|
1498
|
+
if (u.id === f && u.steps) {
|
|
1499
|
+
const N = u.steps.map((g) => g.type === "confirm-request" && g.toolCallId === o.tool_call_id ? {
|
|
1497
1500
|
...g,
|
|
1498
1501
|
confirmStatus: o.confirmed ? "confirmed" : "rejected"
|
|
1499
1502
|
} : g);
|
|
1500
|
-
return { ...
|
|
1503
|
+
return { ...u, steps: N };
|
|
1501
1504
|
}
|
|
1502
|
-
return
|
|
1505
|
+
return u;
|
|
1503
1506
|
}), i({ messages: this.messages, isThinking: o.confirmed });
|
|
1504
1507
|
} catch (o) {
|
|
1505
1508
|
console.warn("Failed to parse confirm_response event data", o);
|
|
@@ -1509,8 +1512,8 @@ class Ht {
|
|
|
1509
1512
|
const o = JSON.parse(v.data);
|
|
1510
1513
|
console.log("Client tool call received:", o), this.executeClientTool(o.tool_call_id, o.tool_name, o.arguments).then(() => {
|
|
1511
1514
|
console.log("Client tool executed successfully:", o.tool_name);
|
|
1512
|
-
}).catch((
|
|
1513
|
-
console.error("Client tool execution failed:",
|
|
1515
|
+
}).catch((u) => {
|
|
1516
|
+
console.error("Client tool execution failed:", u);
|
|
1514
1517
|
});
|
|
1515
1518
|
} catch (o) {
|
|
1516
1519
|
console.warn("Failed to parse client_tool_call event data", o);
|
|
@@ -1531,12 +1534,12 @@ class Ht {
|
|
|
1531
1534
|
};
|
|
1532
1535
|
} catch (n) {
|
|
1533
1536
|
console.error("RealChatClient Error:", n);
|
|
1534
|
-
const
|
|
1537
|
+
const d = {
|
|
1535
1538
|
id: (Date.now() + 1).toString(),
|
|
1536
1539
|
role: "assistant",
|
|
1537
1540
|
content: `Error: ${n.message || "Unknown error occurred."}`
|
|
1538
1541
|
};
|
|
1539
|
-
this.messages = [...this.messages,
|
|
1542
|
+
this.messages = [...this.messages, d], i({ messages: this.messages, isThinking: !1 });
|
|
1540
1543
|
}
|
|
1541
1544
|
}
|
|
1542
1545
|
reset(s) {
|
|
@@ -1582,13 +1585,13 @@ class Ht {
|
|
|
1582
1585
|
});
|
|
1583
1586
|
}
|
|
1584
1587
|
await this.submitToolResult(s, i, n);
|
|
1585
|
-
} catch (
|
|
1586
|
-
console.error("Client tool execution error:",
|
|
1588
|
+
} catch (d) {
|
|
1589
|
+
console.error("Client tool execution error:", d), await this.submitToolResult(
|
|
1587
1590
|
s,
|
|
1588
1591
|
i,
|
|
1589
1592
|
JSON.stringify({
|
|
1590
1593
|
error: "execution_failed",
|
|
1591
|
-
message:
|
|
1594
|
+
message: d.message || "Unknown error"
|
|
1592
1595
|
})
|
|
1593
1596
|
);
|
|
1594
1597
|
} finally {
|
|
@@ -1630,8 +1633,8 @@ class Ht {
|
|
|
1630
1633
|
max_length: n = 5e4
|
|
1631
1634
|
} = s;
|
|
1632
1635
|
try {
|
|
1633
|
-
const
|
|
1634
|
-
if (!
|
|
1636
|
+
const d = document.querySelector(i);
|
|
1637
|
+
if (!d)
|
|
1635
1638
|
return JSON.stringify({
|
|
1636
1639
|
error: "element_not_found",
|
|
1637
1640
|
message: `No element found for selector: ${i}`
|
|
@@ -1643,7 +1646,7 @@ class Ht {
|
|
|
1643
1646
|
|
|
1644
1647
|
`, m += `--- PAGE CONTENT ---
|
|
1645
1648
|
|
|
1646
|
-
`), m += this.extractElementContent(
|
|
1649
|
+
`), m += this.extractElementContent(d, 0), m.length > n && (m = m.substring(0, n) + `
|
|
1647
1650
|
|
|
1648
1651
|
[Content truncated]`), JSON.stringify({
|
|
1649
1652
|
success: !0,
|
|
@@ -1651,24 +1654,24 @@ class Ht {
|
|
|
1651
1654
|
length: m.length,
|
|
1652
1655
|
truncated: m.length > n
|
|
1653
1656
|
});
|
|
1654
|
-
} catch (
|
|
1657
|
+
} catch (d) {
|
|
1655
1658
|
return JSON.stringify({
|
|
1656
1659
|
error: "extraction_failed",
|
|
1657
|
-
message:
|
|
1660
|
+
message: d.message || "Unknown error during DOM extraction"
|
|
1658
1661
|
});
|
|
1659
1662
|
}
|
|
1660
1663
|
}
|
|
1661
1664
|
extractElementContent(s, i) {
|
|
1662
|
-
var p, y, v, o,
|
|
1665
|
+
var p, y, v, o, u, N;
|
|
1663
1666
|
const c = " ".repeat(i);
|
|
1664
1667
|
let n = "";
|
|
1665
|
-
const
|
|
1666
|
-
if (
|
|
1668
|
+
const d = window.getComputedStyle(s);
|
|
1669
|
+
if (d.display === "none" || d.visibility === "hidden" || d.opacity === "0" || ["SCRIPT", "STYLE", "NOSCRIPT", "SVG", "IFRAME"].includes(s.tagName))
|
|
1667
1670
|
return "";
|
|
1668
1671
|
const h = s.tagName;
|
|
1669
1672
|
if (/^H[1-6]$/.test(h)) {
|
|
1670
|
-
const g = parseInt(h[1]),
|
|
1671
|
-
return
|
|
1673
|
+
const g = parseInt(h[1]), T = (p = s.textContent) == null ? void 0 : p.trim();
|
|
1674
|
+
return T && (n += `${c}${"#".repeat(g)} ${T}
|
|
1672
1675
|
|
|
1673
1676
|
`), n;
|
|
1674
1677
|
}
|
|
@@ -1679,21 +1682,21 @@ class Ht {
|
|
|
1679
1682
|
`), n;
|
|
1680
1683
|
}
|
|
1681
1684
|
if (h === "UL" || h === "OL")
|
|
1682
|
-
return s.querySelectorAll(":scope > li").forEach((
|
|
1683
|
-
var
|
|
1684
|
-
const
|
|
1685
|
-
|
|
1685
|
+
return s.querySelectorAll(":scope > li").forEach((T, E) => {
|
|
1686
|
+
var M;
|
|
1687
|
+
const S = h === "OL" ? `${E + 1}.` : "-", A = (M = T.textContent) == null ? void 0 : M.trim();
|
|
1688
|
+
A && (n += `${c}${S} ${A}
|
|
1686
1689
|
`);
|
|
1687
1690
|
}), n += `
|
|
1688
1691
|
`, n;
|
|
1689
1692
|
if (h === "TABLE")
|
|
1690
1693
|
return n += `${c}[Table]
|
|
1691
|
-
`, s.querySelectorAll("tr").forEach((
|
|
1692
|
-
const
|
|
1693
|
-
var
|
|
1694
|
-
return (
|
|
1695
|
-
}).filter((
|
|
1696
|
-
|
|
1694
|
+
`, s.querySelectorAll("tr").forEach((T) => {
|
|
1695
|
+
const E = T.querySelectorAll("td, th"), S = Array.from(E).map((A) => {
|
|
1696
|
+
var M;
|
|
1697
|
+
return (M = A.textContent) == null ? void 0 : M.trim();
|
|
1698
|
+
}).filter((A) => A).join(" | ");
|
|
1699
|
+
S && (n += `${c} ${S}
|
|
1697
1700
|
`);
|
|
1698
1701
|
}), n += `
|
|
1699
1702
|
`, n;
|
|
@@ -1704,30 +1707,30 @@ class Ht {
|
|
|
1704
1707
|
}), n += `
|
|
1705
1708
|
`, n;
|
|
1706
1709
|
if (h === "A") {
|
|
1707
|
-
const g = (v = s.textContent) == null ? void 0 : v.trim(),
|
|
1708
|
-
return g &&
|
|
1710
|
+
const g = (v = s.textContent) == null ? void 0 : v.trim(), T = s.getAttribute("href");
|
|
1711
|
+
return g && T && (n += `${c}[${g}](${T})
|
|
1709
1712
|
`), n;
|
|
1710
1713
|
}
|
|
1711
1714
|
if (["BUTTON", "INPUT", "SELECT", "TEXTAREA"].includes(h)) {
|
|
1712
|
-
const g = ((o = s.textContent) == null ? void 0 : o.trim()) || ((
|
|
1715
|
+
const g = ((o = s.textContent) == null ? void 0 : o.trim()) || ((u = s.value) == null ? void 0 : u.trim());
|
|
1713
1716
|
return g && (n += `${c}[${h}] ${g}
|
|
1714
1717
|
`), n;
|
|
1715
1718
|
}
|
|
1716
|
-
const f = s.children.length > 0, w = f ? "" : (
|
|
1719
|
+
const f = s.children.length > 0, w = f ? "" : (N = s.textContent) == null ? void 0 : N.trim();
|
|
1717
1720
|
return !f && w ? (n += `${c}${w}
|
|
1718
1721
|
`, n) : (f && Array.from(s.children).forEach((g) => {
|
|
1719
1722
|
n += this.extractElementContent(g, i);
|
|
1720
1723
|
}), n);
|
|
1721
1724
|
}
|
|
1722
1725
|
}
|
|
1723
|
-
const
|
|
1724
|
-
class
|
|
1726
|
+
const It = "http://localhost:11700";
|
|
1727
|
+
class Ht {
|
|
1725
1728
|
/**
|
|
1726
1729
|
* Fetches a new access token from the auth broker.
|
|
1727
1730
|
*/
|
|
1728
1731
|
static async getInitialToken() {
|
|
1729
1732
|
try {
|
|
1730
|
-
const s = await fetch(`${
|
|
1733
|
+
const s = await fetch(`${It}/request-token`, {
|
|
1731
1734
|
method: "POST",
|
|
1732
1735
|
headers: {
|
|
1733
1736
|
"Content-Type": "application/json"
|
|
@@ -1751,16 +1754,16 @@ class Kt {
|
|
|
1751
1754
|
}
|
|
1752
1755
|
}
|
|
1753
1756
|
export {
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1757
|
+
Ht as AuthClient,
|
|
1758
|
+
Dt as ChatContainer,
|
|
1759
|
+
Ct as ChatLauncher,
|
|
1760
|
+
Lt as Composer,
|
|
1761
|
+
$t as ConfirmButtons,
|
|
1762
|
+
Jt as MessageBubble,
|
|
1763
|
+
Yt as NavigationSidebar,
|
|
1764
|
+
qt as PendingMessageList,
|
|
1765
|
+
Ut as RealChatClient,
|
|
1766
|
+
zt as ThinkingIndicator,
|
|
1767
|
+
Ye as ToolInvocation,
|
|
1768
|
+
Vt as WelcomeScreen
|
|
1766
1769
|
};
|