teodor-new-chat-ui 4.3.290 → 4.3.292
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/index.esm.js +879 -875
- package/dist/index.umd.js +16 -16
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ var Yh = Object.defineProperty;
|
|
|
2
2
|
var Xh = (e, t, n) => t in e ? Yh(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var nl = (e, t, n) => Xh(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import * as v from "react";
|
|
5
|
-
import z, { createContext as io, useContext as hs, useMemo as rt, useState as
|
|
5
|
+
import z, { createContext as io, useContext as hs, useMemo as rt, useState as be, useRef as He, useCallback as Te, useEffect as Et, useReducer as Jh, useLayoutEffect as Zh, createElement as Po, useImperativeHandle as Qh } from "react";
|
|
6
6
|
import { Square as em, Send as tm, ChevronRight as Uc, Check as ra, Circle as nm, X as gr, ExternalLink as rm, Download as om, Image as sm, FileText as rl, Loader as oa, Bot as Qs, Wrench as im, User as am, Paperclip as ki, ChevronUp as sa, ChevronDown as ms, ChevronLeft as lm, Copy as ol, Edit as sl, RotateCcw as Ri, Info as cm, Loader2 as $r, Edit3 as Wc, Plus as um, FileSpreadsheet as dm, MessageSquarePlus as fm, MessageSquare as pm, Calendar as hm, Trash2 as mm, Settings as gm, Server as xm, EyeOff as ym, Eye as vm, Layout as wm, MessageCircle as bm, Save as Sm } from "lucide-react";
|
|
7
7
|
import { Slot as Cm, createSlot as br } from "@radix-ui/react-slot";
|
|
8
8
|
import { cva as gs } from "class-variance-authority";
|
|
@@ -51,25 +51,25 @@ function Em() {
|
|
|
51
51
|
function y(R) {
|
|
52
52
|
if (R === null || typeof R != "object")
|
|
53
53
|
return null;
|
|
54
|
-
var
|
|
55
|
-
return typeof
|
|
54
|
+
var W = m && R[m] || R[x];
|
|
55
|
+
return typeof W == "function" ? W : null;
|
|
56
56
|
}
|
|
57
57
|
var g = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
58
58
|
function w(R) {
|
|
59
59
|
{
|
|
60
|
-
for (var
|
|
61
|
-
|
|
62
|
-
b("error", R,
|
|
60
|
+
for (var W = arguments.length, ae = new Array(W > 1 ? W - 1 : 0), Ee = 1; Ee < W; Ee++)
|
|
61
|
+
ae[Ee - 1] = arguments[Ee];
|
|
62
|
+
b("error", R, ae);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
function b(R,
|
|
65
|
+
function b(R, W, ae) {
|
|
66
66
|
{
|
|
67
67
|
var Ee = g.ReactDebugCurrentFrame, tt = Ee.getStackAddendum();
|
|
68
|
-
tt !== "" && (
|
|
69
|
-
var lt =
|
|
68
|
+
tt !== "" && (W += "%s", ae = ae.concat([tt]));
|
|
69
|
+
var lt = ae.map(function(Ke) {
|
|
70
70
|
return String(Ke);
|
|
71
71
|
});
|
|
72
|
-
lt.unshift("Warning: " +
|
|
72
|
+
lt.unshift("Warning: " + W), Function.prototype.apply.call(console[R], console, lt);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
var T = !1, C = !1, S = !1, k = !1, E = !1, N;
|
|
@@ -81,12 +81,12 @@ function Em() {
|
|
|
81
81
|
// with.
|
|
82
82
|
R.$$typeof === N || R.getModuleId !== void 0));
|
|
83
83
|
}
|
|
84
|
-
function j(R,
|
|
84
|
+
function j(R, W, ae) {
|
|
85
85
|
var Ee = R.displayName;
|
|
86
86
|
if (Ee)
|
|
87
87
|
return Ee;
|
|
88
|
-
var tt =
|
|
89
|
-
return tt !== "" ?
|
|
88
|
+
var tt = W.displayName || W.name || "";
|
|
89
|
+
return tt !== "" ? ae + "(" + tt + ")" : ae;
|
|
90
90
|
}
|
|
91
91
|
function P(R) {
|
|
92
92
|
return R.displayName || "Context";
|
|
@@ -115,11 +115,11 @@ function Em() {
|
|
|
115
115
|
if (typeof R == "object")
|
|
116
116
|
switch (R.$$typeof) {
|
|
117
117
|
case a:
|
|
118
|
-
var
|
|
119
|
-
return P(
|
|
118
|
+
var W = R;
|
|
119
|
+
return P(W) + ".Consumer";
|
|
120
120
|
case i:
|
|
121
|
-
var
|
|
122
|
-
return P(
|
|
121
|
+
var ae = R;
|
|
122
|
+
return P(ae._context) + ".Provider";
|
|
123
123
|
case l:
|
|
124
124
|
return j(R, R.render, "ForwardRef");
|
|
125
125
|
case f:
|
|
@@ -137,9 +137,9 @@ function Em() {
|
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
139
|
var I = Object.assign, F = 0, A, X, L, _, J, G, pe;
|
|
140
|
-
function
|
|
140
|
+
function ke() {
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
ke.__reactDisabledLog = !0;
|
|
143
143
|
function Ae() {
|
|
144
144
|
{
|
|
145
145
|
if (F === 0) {
|
|
@@ -147,7 +147,7 @@ function Em() {
|
|
|
147
147
|
var R = {
|
|
148
148
|
configurable: !0,
|
|
149
149
|
enumerable: !0,
|
|
150
|
-
value:
|
|
150
|
+
value: ke,
|
|
151
151
|
writable: !0
|
|
152
152
|
};
|
|
153
153
|
Object.defineProperties(console, {
|
|
@@ -163,7 +163,7 @@ function Em() {
|
|
|
163
163
|
F++;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function K() {
|
|
167
167
|
{
|
|
168
168
|
if (F--, F === 0) {
|
|
169
169
|
var R = {
|
|
@@ -199,7 +199,7 @@ function Em() {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
var oe = g.ReactCurrentDispatcher, Y;
|
|
202
|
-
function D(R,
|
|
202
|
+
function D(R, W, ae) {
|
|
203
203
|
{
|
|
204
204
|
if (Y === void 0)
|
|
205
205
|
try {
|
|
@@ -214,16 +214,16 @@ function Em() {
|
|
|
214
214
|
}
|
|
215
215
|
var H = !1, ne;
|
|
216
216
|
{
|
|
217
|
-
var
|
|
218
|
-
ne = new
|
|
217
|
+
var ie = typeof WeakMap == "function" ? WeakMap : Map;
|
|
218
|
+
ne = new ie();
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function V(R, W) {
|
|
221
221
|
if (!R || H)
|
|
222
222
|
return "";
|
|
223
223
|
{
|
|
224
|
-
var
|
|
225
|
-
if (
|
|
226
|
-
return
|
|
224
|
+
var ae = ne.get(R);
|
|
225
|
+
if (ae !== void 0)
|
|
226
|
+
return ae;
|
|
227
227
|
}
|
|
228
228
|
var Ee;
|
|
229
229
|
H = !0;
|
|
@@ -232,7 +232,7 @@ function Em() {
|
|
|
232
232
|
var lt;
|
|
233
233
|
lt = oe.current, oe.current = null, Ae();
|
|
234
234
|
try {
|
|
235
|
-
if (
|
|
235
|
+
if (W) {
|
|
236
236
|
var Ke = function() {
|
|
237
237
|
throw Error();
|
|
238
238
|
};
|
|
@@ -243,29 +243,29 @@ function Em() {
|
|
|
243
243
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
244
244
|
try {
|
|
245
245
|
Reflect.construct(Ke, []);
|
|
246
|
-
} catch (
|
|
247
|
-
Ee =
|
|
246
|
+
} catch (Se) {
|
|
247
|
+
Ee = Se;
|
|
248
248
|
}
|
|
249
249
|
Reflect.construct(R, [], Ke);
|
|
250
250
|
} else {
|
|
251
251
|
try {
|
|
252
252
|
Ke.call();
|
|
253
|
-
} catch (
|
|
254
|
-
Ee =
|
|
253
|
+
} catch (Se) {
|
|
254
|
+
Ee = Se;
|
|
255
255
|
}
|
|
256
256
|
R.call(Ke.prototype);
|
|
257
257
|
}
|
|
258
258
|
} else {
|
|
259
259
|
try {
|
|
260
260
|
throw Error();
|
|
261
|
-
} catch (
|
|
262
|
-
Ee =
|
|
261
|
+
} catch (Se) {
|
|
262
|
+
Ee = Se;
|
|
263
263
|
}
|
|
264
264
|
R();
|
|
265
265
|
}
|
|
266
|
-
} catch (
|
|
267
|
-
if (
|
|
268
|
-
for (var Be =
|
|
266
|
+
} catch (Se) {
|
|
267
|
+
if (Se && Ee && typeof Se.stack == "string") {
|
|
268
|
+
for (var Be = Se.stack.split(`
|
|
269
269
|
`), Pt = Ee.stack.split(`
|
|
270
270
|
`), wt = Be.length - 1, bt = Pt.length - 1; wt >= 1 && bt >= 0 && Be[wt] !== Pt[bt]; )
|
|
271
271
|
bt--;
|
|
@@ -283,23 +283,23 @@ function Em() {
|
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
} finally {
|
|
286
|
-
H = !1, oe.current = lt,
|
|
286
|
+
H = !1, oe.current = lt, K(), Error.prepareStackTrace = tt;
|
|
287
287
|
}
|
|
288
288
|
var de = R ? R.displayName || R.name : "", fe = de ? D(de) : "";
|
|
289
289
|
return typeof R == "function" && ne.set(R, fe), fe;
|
|
290
290
|
}
|
|
291
|
-
function Me(R,
|
|
292
|
-
return
|
|
291
|
+
function Me(R, W, ae) {
|
|
292
|
+
return V(R, !1);
|
|
293
293
|
}
|
|
294
294
|
function Ue(R) {
|
|
295
|
-
var
|
|
296
|
-
return !!(
|
|
295
|
+
var W = R.prototype;
|
|
296
|
+
return !!(W && W.isReactComponent);
|
|
297
297
|
}
|
|
298
|
-
function Ze(R,
|
|
298
|
+
function Ze(R, W, ae) {
|
|
299
299
|
if (R == null)
|
|
300
300
|
return "";
|
|
301
301
|
if (typeof R == "function")
|
|
302
|
-
return
|
|
302
|
+
return V(R, Ue(R));
|
|
303
303
|
if (typeof R == "string")
|
|
304
304
|
return D(R);
|
|
305
305
|
switch (R) {
|
|
@@ -313,26 +313,26 @@ function Em() {
|
|
|
313
313
|
case l:
|
|
314
314
|
return Me(R.render);
|
|
315
315
|
case f:
|
|
316
|
-
return Ze(R.type,
|
|
316
|
+
return Ze(R.type, W, ae);
|
|
317
317
|
case p: {
|
|
318
318
|
var Ee = R, tt = Ee._payload, lt = Ee._init;
|
|
319
319
|
try {
|
|
320
|
-
return Ze(lt(tt),
|
|
320
|
+
return Ze(lt(tt), W, ae);
|
|
321
321
|
} catch {
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
return "";
|
|
326
326
|
}
|
|
327
|
-
var re = Object.prototype.hasOwnProperty,
|
|
327
|
+
var re = Object.prototype.hasOwnProperty, ge = {}, Le = g.ReactDebugCurrentFrame;
|
|
328
328
|
function Fe(R) {
|
|
329
329
|
if (R) {
|
|
330
|
-
var
|
|
331
|
-
Le.setExtraStackFrame(
|
|
330
|
+
var W = R._owner, ae = Ze(R.type, R._source, W ? W.type : null);
|
|
331
|
+
Le.setExtraStackFrame(ae);
|
|
332
332
|
} else
|
|
333
333
|
Le.setExtraStackFrame(null);
|
|
334
334
|
}
|
|
335
|
-
function Pe(R,
|
|
335
|
+
function Pe(R, W, ae, Ee, tt) {
|
|
336
336
|
{
|
|
337
337
|
var lt = Function.call.bind(re);
|
|
338
338
|
for (var Ke in R)
|
|
@@ -340,14 +340,14 @@ function Em() {
|
|
|
340
340
|
var Be = void 0;
|
|
341
341
|
try {
|
|
342
342
|
if (typeof R[Ke] != "function") {
|
|
343
|
-
var Pt = Error((Ee || "React class") + ": " +
|
|
343
|
+
var Pt = Error((Ee || "React class") + ": " + ae + " type `" + Ke + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[Ke] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
344
344
|
throw Pt.name = "Invariant Violation", Pt;
|
|
345
345
|
}
|
|
346
|
-
Be = R[Ke](
|
|
346
|
+
Be = R[Ke](W, Ke, Ee, ae, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
347
347
|
} catch (wt) {
|
|
348
348
|
Be = wt;
|
|
349
349
|
}
|
|
350
|
-
Be && !(Be instanceof Error) && (Fe(tt), w("%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).", Ee || "React class",
|
|
350
|
+
Be && !(Be instanceof Error) && (Fe(tt), w("%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).", Ee || "React class", ae, Ke, typeof Be), Fe(null)), Be instanceof Error && !(Be.message in ge) && (ge[Be.message] = !0, Fe(tt), w("Failed %s type: %s", ae, Be.message), Fe(null));
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
}
|
|
@@ -357,8 +357,8 @@ function Em() {
|
|
|
357
357
|
}
|
|
358
358
|
function Ge(R) {
|
|
359
359
|
{
|
|
360
|
-
var
|
|
361
|
-
return
|
|
360
|
+
var W = typeof Symbol == "function" && Symbol.toStringTag, ae = W && R[Symbol.toStringTag] || R.constructor.name || "Object";
|
|
361
|
+
return ae;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
function qe(R) {
|
|
@@ -383,53 +383,53 @@ function Em() {
|
|
|
383
383
|
}, ft, it;
|
|
384
384
|
function Ve(R) {
|
|
385
385
|
if (re.call(R, "ref")) {
|
|
386
|
-
var
|
|
387
|
-
if (
|
|
386
|
+
var W = Object.getOwnPropertyDescriptor(R, "ref").get;
|
|
387
|
+
if (W && W.isReactWarning)
|
|
388
388
|
return !1;
|
|
389
389
|
}
|
|
390
390
|
return R.ref !== void 0;
|
|
391
391
|
}
|
|
392
392
|
function jt(R) {
|
|
393
393
|
if (re.call(R, "key")) {
|
|
394
|
-
var
|
|
395
|
-
if (
|
|
394
|
+
var W = Object.getOwnPropertyDescriptor(R, "key").get;
|
|
395
|
+
if (W && W.isReactWarning)
|
|
396
396
|
return !1;
|
|
397
397
|
}
|
|
398
398
|
return R.key !== void 0;
|
|
399
399
|
}
|
|
400
|
-
function Ct(R,
|
|
400
|
+
function Ct(R, W) {
|
|
401
401
|
typeof R.ref == "string" && mt.current;
|
|
402
402
|
}
|
|
403
|
-
function Zt(R,
|
|
403
|
+
function Zt(R, W) {
|
|
404
404
|
{
|
|
405
|
-
var
|
|
406
|
-
ft || (ft = !0, w("%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)",
|
|
405
|
+
var ae = function() {
|
|
406
|
+
ft || (ft = !0, w("%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)", W));
|
|
407
407
|
};
|
|
408
|
-
|
|
409
|
-
get:
|
|
408
|
+
ae.isReactWarning = !0, Object.defineProperty(R, "key", {
|
|
409
|
+
get: ae,
|
|
410
410
|
configurable: !0
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
function ln(R,
|
|
414
|
+
function ln(R, W) {
|
|
415
415
|
{
|
|
416
|
-
var
|
|
417
|
-
it || (it = !0, w("%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)",
|
|
416
|
+
var ae = function() {
|
|
417
|
+
it || (it = !0, w("%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)", W));
|
|
418
418
|
};
|
|
419
|
-
|
|
420
|
-
get:
|
|
419
|
+
ae.isReactWarning = !0, Object.defineProperty(R, "ref", {
|
|
420
|
+
get: ae,
|
|
421
421
|
configurable: !0
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
var Ye = function(R,
|
|
425
|
+
var Ye = function(R, W, ae, Ee, tt, lt, Ke) {
|
|
426
426
|
var Be = {
|
|
427
427
|
// This tag allows us to uniquely identify this as a React Element
|
|
428
428
|
$$typeof: t,
|
|
429
429
|
// Built-in properties that belong on the element
|
|
430
430
|
type: R,
|
|
431
|
-
key:
|
|
432
|
-
ref:
|
|
431
|
+
key: W,
|
|
432
|
+
ref: ae,
|
|
433
433
|
props: Ke,
|
|
434
434
|
// Record the component responsible for creating this element.
|
|
435
435
|
_owner: lt
|
|
@@ -451,12 +451,12 @@ function Em() {
|
|
|
451
451
|
value: tt
|
|
452
452
|
}), Object.freeze && (Object.freeze(Be.props), Object.freeze(Be)), Be;
|
|
453
453
|
};
|
|
454
|
-
function _e(R,
|
|
454
|
+
function _e(R, W, ae, Ee, tt) {
|
|
455
455
|
{
|
|
456
456
|
var lt, Ke = {}, Be = null, Pt = null;
|
|
457
|
-
|
|
458
|
-
for (lt in
|
|
459
|
-
re.call(
|
|
457
|
+
ae !== void 0 && (St(ae), Be = "" + ae), jt(W) && (St(W.key), Be = "" + W.key), Ve(W) && (Pt = W.ref, Ct(W, tt));
|
|
458
|
+
for (lt in W)
|
|
459
|
+
re.call(W, lt) && !gt.hasOwnProperty(lt) && (Ke[lt] = W[lt]);
|
|
460
460
|
if (R && R.defaultProps) {
|
|
461
461
|
var wt = R.defaultProps;
|
|
462
462
|
for (lt in wt)
|
|
@@ -472,14 +472,14 @@ function Em() {
|
|
|
472
472
|
var _t = g.ReactCurrentOwner, zt = g.ReactDebugCurrentFrame;
|
|
473
473
|
function B(R) {
|
|
474
474
|
if (R) {
|
|
475
|
-
var
|
|
476
|
-
zt.setExtraStackFrame(
|
|
475
|
+
var W = R._owner, ae = Ze(R.type, R._source, W ? W.type : null);
|
|
476
|
+
zt.setExtraStackFrame(ae);
|
|
477
477
|
} else
|
|
478
478
|
zt.setExtraStackFrame(null);
|
|
479
479
|
}
|
|
480
|
-
var
|
|
481
|
-
|
|
482
|
-
function
|
|
480
|
+
var ve;
|
|
481
|
+
ve = !1;
|
|
482
|
+
function we(R) {
|
|
483
483
|
return typeof R == "object" && R !== null && R.$$typeof === t;
|
|
484
484
|
}
|
|
485
485
|
function at() {
|
|
@@ -494,83 +494,83 @@ Check the render method of \`` + R + "`.";
|
|
|
494
494
|
return "";
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function q(R) {
|
|
498
498
|
return "";
|
|
499
499
|
}
|
|
500
|
-
var
|
|
501
|
-
function
|
|
500
|
+
var se = {};
|
|
501
|
+
function te(R) {
|
|
502
502
|
{
|
|
503
|
-
var
|
|
504
|
-
if (!
|
|
505
|
-
var
|
|
506
|
-
|
|
503
|
+
var W = at();
|
|
504
|
+
if (!W) {
|
|
505
|
+
var ae = typeof R == "string" ? R : R.displayName || R.name;
|
|
506
|
+
ae && (W = `
|
|
507
507
|
|
|
508
|
-
Check the top-level render call using <` +
|
|
508
|
+
Check the top-level render call using <` + ae + ">.");
|
|
509
509
|
}
|
|
510
|
-
return
|
|
510
|
+
return W;
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function me(R, W) {
|
|
514
514
|
{
|
|
515
515
|
if (!R._store || R._store.validated || R.key != null)
|
|
516
516
|
return;
|
|
517
517
|
R._store.validated = !0;
|
|
518
|
-
var
|
|
519
|
-
if (
|
|
518
|
+
var ae = te(W);
|
|
519
|
+
if (se[ae])
|
|
520
520
|
return;
|
|
521
|
-
|
|
521
|
+
se[ae] = !0;
|
|
522
522
|
var Ee = "";
|
|
523
|
-
R && R._owner && R._owner !== _t.current && (Ee = " It was passed a child from " + $(R._owner.type) + "."), B(R), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',
|
|
523
|
+
R && R._owner && R._owner !== _t.current && (Ee = " It was passed a child from " + $(R._owner.type) + "."), B(R), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ae, Ee), B(null);
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
|
-
function
|
|
526
|
+
function le(R, W) {
|
|
527
527
|
{
|
|
528
528
|
if (typeof R != "object")
|
|
529
529
|
return;
|
|
530
530
|
if (We(R))
|
|
531
|
-
for (var
|
|
532
|
-
var Ee = R[
|
|
533
|
-
|
|
531
|
+
for (var ae = 0; ae < R.length; ae++) {
|
|
532
|
+
var Ee = R[ae];
|
|
533
|
+
we(Ee) && me(Ee, W);
|
|
534
534
|
}
|
|
535
|
-
else if (
|
|
535
|
+
else if (we(R))
|
|
536
536
|
R._store && (R._store.validated = !0);
|
|
537
537
|
else if (R) {
|
|
538
538
|
var tt = y(R);
|
|
539
539
|
if (typeof tt == "function" && tt !== R.entries)
|
|
540
540
|
for (var lt = tt.call(R), Ke; !(Ke = lt.next()).done; )
|
|
541
|
-
|
|
541
|
+
we(Ke.value) && me(Ke.value, W);
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function Re(R) {
|
|
546
546
|
{
|
|
547
|
-
var
|
|
548
|
-
if (
|
|
547
|
+
var W = R.type;
|
|
548
|
+
if (W == null || typeof W == "string")
|
|
549
549
|
return;
|
|
550
|
-
var
|
|
551
|
-
if (typeof
|
|
552
|
-
|
|
553
|
-
else if (typeof
|
|
550
|
+
var ae;
|
|
551
|
+
if (typeof W == "function")
|
|
552
|
+
ae = W.propTypes;
|
|
553
|
+
else if (typeof W == "object" && (W.$$typeof === l || // Note: Memo only checks outer props here.
|
|
554
554
|
// Inner props are checked in the reconciler.
|
|
555
|
-
|
|
556
|
-
|
|
555
|
+
W.$$typeof === f))
|
|
556
|
+
ae = W.propTypes;
|
|
557
557
|
else
|
|
558
558
|
return;
|
|
559
|
-
if (
|
|
560
|
-
var Ee = $(
|
|
561
|
-
Pe(
|
|
562
|
-
} else if (
|
|
563
|
-
|
|
564
|
-
var tt = $(
|
|
559
|
+
if (ae) {
|
|
560
|
+
var Ee = $(W);
|
|
561
|
+
Pe(ae, R.props, "prop", Ee, R);
|
|
562
|
+
} else if (W.PropTypes !== void 0 && !ve) {
|
|
563
|
+
ve = !0;
|
|
564
|
+
var tt = $(W);
|
|
565
565
|
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", tt || "Unknown");
|
|
566
566
|
}
|
|
567
|
-
typeof
|
|
567
|
+
typeof W.getDefaultProps == "function" && !W.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
570
|
function Ut(R) {
|
|
571
571
|
{
|
|
572
|
-
for (var
|
|
573
|
-
var Ee =
|
|
572
|
+
for (var W = Object.keys(R.props), ae = 0; ae < W.length; ae++) {
|
|
573
|
+
var Ee = W[ae];
|
|
574
574
|
if (Ee !== "children" && Ee !== "key") {
|
|
575
575
|
B(R), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", Ee), B(null);
|
|
576
576
|
break;
|
|
@@ -580,39 +580,39 @@ Check the top-level render call using <` + le + ">.");
|
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
582
|
var Tt = {};
|
|
583
|
-
function cn(R,
|
|
583
|
+
function cn(R, W, ae, Ee, tt, lt) {
|
|
584
584
|
{
|
|
585
585
|
var Ke = M(R);
|
|
586
586
|
if (!Ke) {
|
|
587
587
|
var Be = "";
|
|
588
588
|
(R === void 0 || typeof R == "object" && R !== null && Object.keys(R).length === 0) && (Be += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
589
|
-
var Pt =
|
|
589
|
+
var Pt = q();
|
|
590
590
|
Pt ? Be += Pt : Be += at();
|
|
591
591
|
var wt;
|
|
592
592
|
R === null ? wt = "null" : We(R) ? wt = "array" : R !== void 0 && R.$$typeof === t ? (wt = "<" + ($(R.type) || "Unknown") + " />", Be = " Did you accidentally export a JSX literal instead of a component?") : wt = typeof R, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", wt, Be);
|
|
593
593
|
}
|
|
594
|
-
var bt = _e(R,
|
|
594
|
+
var bt = _e(R, W, ae, tt, lt);
|
|
595
595
|
if (bt == null)
|
|
596
596
|
return bt;
|
|
597
597
|
if (Ke) {
|
|
598
|
-
var Q =
|
|
598
|
+
var Q = W.children;
|
|
599
599
|
if (Q !== void 0)
|
|
600
600
|
if (Ee)
|
|
601
601
|
if (We(Q)) {
|
|
602
602
|
for (var de = 0; de < Q.length; de++)
|
|
603
|
-
|
|
603
|
+
le(Q[de], R);
|
|
604
604
|
Object.freeze && Object.freeze(Q);
|
|
605
605
|
} else
|
|
606
606
|
w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
607
607
|
else
|
|
608
|
-
|
|
608
|
+
le(Q, R);
|
|
609
609
|
}
|
|
610
|
-
if (re.call(
|
|
611
|
-
var fe = $(R),
|
|
610
|
+
if (re.call(W, "key")) {
|
|
611
|
+
var fe = $(R), Se = Object.keys(W).filter(function(un) {
|
|
612
612
|
return un !== "key";
|
|
613
|
-
}), ct =
|
|
613
|
+
}), ct = Se.length > 0 ? "{key: someKey, " + Se.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
614
614
|
if (!Tt[fe + ct]) {
|
|
615
|
-
var xt =
|
|
615
|
+
var xt = Se.length > 0 ? "{" + Se.join(": ..., ") + ": ...}" : "{}";
|
|
616
616
|
w(`A props object containing a "key" prop is being spread into JSX:
|
|
617
617
|
let props = %s;
|
|
618
618
|
<%s {...props} />
|
|
@@ -621,14 +621,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
621
621
|
<%s key={someKey} {...props} />`, ct, fe, xt, fe), Tt[fe + ct] = !0;
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
|
-
return R === r ? Ut(bt) :
|
|
624
|
+
return R === r ? Ut(bt) : Re(bt), bt;
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
function kt(R,
|
|
628
|
-
return cn(R,
|
|
627
|
+
function kt(R, W, ae) {
|
|
628
|
+
return cn(R, W, ae, !0);
|
|
629
629
|
}
|
|
630
|
-
function Mn(R,
|
|
631
|
-
return cn(R,
|
|
630
|
+
function Mn(R, W, ae) {
|
|
631
|
+
return cn(R, W, ae, !1);
|
|
632
632
|
}
|
|
633
633
|
var Zs = Mn, vo = kt;
|
|
634
634
|
Dr.Fragment = r, Dr.jsx = Zs, Dr.jsxs = vo;
|
|
@@ -1882,11 +1882,11 @@ const uu = (e) => {
|
|
|
1882
1882
|
duplex: "half"
|
|
1883
1883
|
}), pe;
|
|
1884
1884
|
if (O.isFormData(g) && (pe = G.headers.get("content-type")) && E.setContentType(pe), G.body) {
|
|
1885
|
-
const [
|
|
1885
|
+
const [ke, Ae] = pl(
|
|
1886
1886
|
F,
|
|
1887
1887
|
qo(hl(S))
|
|
1888
1888
|
);
|
|
1889
|
-
g = gl(G.body, xl,
|
|
1889
|
+
g = gl(G.body, xl, ke, Ae);
|
|
1890
1890
|
}
|
|
1891
1891
|
}
|
|
1892
1892
|
O.isString(N) || (N = N ? "include" : "omit");
|
|
@@ -1904,15 +1904,15 @@ const uu = (e) => {
|
|
|
1904
1904
|
const _ = d && (k === "stream" || k === "response");
|
|
1905
1905
|
if (d && (C || _ && I)) {
|
|
1906
1906
|
const G = {};
|
|
1907
|
-
["status", "statusText", "headers"].forEach((
|
|
1908
|
-
G[
|
|
1907
|
+
["status", "statusText", "headers"].forEach((K) => {
|
|
1908
|
+
G[K] = L[K];
|
|
1909
1909
|
});
|
|
1910
|
-
const pe = O.toFiniteNumber(L.headers.get("content-length")), [
|
|
1910
|
+
const pe = O.toFiniteNumber(L.headers.get("content-length")), [ke, Ae] = C && pl(
|
|
1911
1911
|
pe,
|
|
1912
1912
|
qo(hl(C), !0)
|
|
1913
1913
|
) || [];
|
|
1914
1914
|
L = new r(
|
|
1915
|
-
gl(L.body, xl,
|
|
1915
|
+
gl(L.body, xl, ke, () => {
|
|
1916
1916
|
Ae && Ae(), I && I();
|
|
1917
1917
|
}),
|
|
1918
1918
|
G
|
|
@@ -3031,14 +3031,14 @@ function Px(e) {
|
|
|
3031
3031
|
return t;
|
|
3032
3032
|
}
|
|
3033
3033
|
function Ox(e = {}) {
|
|
3034
|
-
const t = rt(() => _n(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] =
|
|
3034
|
+
const t = rt(() => _n(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = be(e.token ?? null), s = He(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = be(!1), [c, d] = be(null), [f, p] = be(""), [h, m] = be(null), [x, y] = be(0), [g, w] = be(!1), b = He(null), T = He(!0), C = He(0), S = He(null), k = He(null), E = He(null), N = He(null), M = Te((I) => {
|
|
3035
3035
|
o(I);
|
|
3036
|
-
}, []), j =
|
|
3036
|
+
}, []), j = Te(() => {
|
|
3037
3037
|
p(""), m(null), d(null), k.current = null, E.current = null, N.current = null;
|
|
3038
|
-
}, []), P =
|
|
3038
|
+
}, []), P = Te(() => {
|
|
3039
3039
|
var I;
|
|
3040
3040
|
console.debug("[use-chat] stop() invoked - aborting stream"), (I = b.current) == null || I.abort(), b.current = null, S.current = null, l(!1), w(!1), C.current = 0, y(0);
|
|
3041
|
-
}, []), $ =
|
|
3041
|
+
}, []), $ = Te(
|
|
3042
3042
|
(I, F, A) => {
|
|
3043
3043
|
b.current && (b.current.abort(), b.current = null), l(!0), d(null), e.autoAppendAssistant !== !1 && p(""), m(null), k.current = null, E.current = null, N.current = null;
|
|
3044
3044
|
const X = new AbortController();
|
|
@@ -3048,7 +3048,7 @@ function Ox(e = {}) {
|
|
|
3048
3048
|
threadId: I.threadId ?? null,
|
|
3049
3049
|
headers: {}
|
|
3050
3050
|
}, (async () => {
|
|
3051
|
-
var pe,
|
|
3051
|
+
var pe, ke, Ae, K, oe, Y, D, H, ne, ie, V, Me, Ue, Ze, re, ge, Le, Fe;
|
|
3052
3052
|
const G = (Pe) => {
|
|
3053
3053
|
var et;
|
|
3054
3054
|
try {
|
|
@@ -3070,8 +3070,8 @@ function Ox(e = {}) {
|
|
|
3070
3070
|
const _e = window.__AUTH_TOKEN__, _t = ((pe = window.localStorage) == null ? void 0 : pe.getItem("authToken")) || null;
|
|
3071
3071
|
let zt = null;
|
|
3072
3072
|
try {
|
|
3073
|
-
const
|
|
3074
|
-
|
|
3073
|
+
const ve = (ke = window.localStorage) == null ? void 0 : ke.getItem("chat-settings");
|
|
3074
|
+
ve && (zt = ((Ae = JSON.parse(ve)) == null ? void 0 : Ae.apiKey) || null);
|
|
3075
3075
|
} catch {
|
|
3076
3076
|
}
|
|
3077
3077
|
const B = _e || _t || zt || null;
|
|
@@ -3087,7 +3087,7 @@ function Ox(e = {}) {
|
|
|
3087
3087
|
let et = {};
|
|
3088
3088
|
if (typeof window < "u")
|
|
3089
3089
|
try {
|
|
3090
|
-
const Ye = (
|
|
3090
|
+
const Ye = (K = window.localStorage) == null ? void 0 : K.getItem("authSessionId");
|
|
3091
3091
|
Ye && (et = { "X-Session-Id": Ye });
|
|
3092
3092
|
} catch {
|
|
3093
3093
|
}
|
|
@@ -3144,81 +3144,81 @@ function Ox(e = {}) {
|
|
|
3144
3144
|
...S.current,
|
|
3145
3145
|
threadId: _t
|
|
3146
3146
|
}), (Y = A == null ? void 0 : A.onOpen) == null || Y.call(A, { threadId: _t, created: zt }); ; ) {
|
|
3147
|
-
const { value: B, done:
|
|
3148
|
-
if (
|
|
3147
|
+
const { value: B, done: ve } = await Qe.read();
|
|
3148
|
+
if (ve) break;
|
|
3149
3149
|
mt += St.decode(B, { stream: !0 }), mt.length > ln && (mt = "", console.warn("Stream buffer reset: exceeded 1MB"));
|
|
3150
|
-
let
|
|
3151
|
-
for (; (
|
|
3150
|
+
let we;
|
|
3151
|
+
for (; (we = mt.indexOf(`
|
|
3152
3152
|
|
|
3153
3153
|
`)) >= 0; ) {
|
|
3154
|
-
const at = mt.slice(0,
|
|
3155
|
-
mt = mt.slice(
|
|
3156
|
-
const
|
|
3157
|
-
if (!
|
|
3158
|
-
let
|
|
3154
|
+
const at = mt.slice(0, we);
|
|
3155
|
+
mt = mt.slice(we + 2);
|
|
3156
|
+
const q = Dx(at);
|
|
3157
|
+
if (!q) continue;
|
|
3158
|
+
let se;
|
|
3159
3159
|
try {
|
|
3160
|
-
|
|
3160
|
+
se = JSON.parse(q);
|
|
3161
3161
|
} catch {
|
|
3162
|
-
console.debug("[use-chat] malformed SSE:",
|
|
3162
|
+
console.debug("[use-chat] malformed SSE:", q.slice(0, 200));
|
|
3163
3163
|
continue;
|
|
3164
3164
|
}
|
|
3165
|
-
const
|
|
3165
|
+
const te = Mx(se) ? se.data : se;
|
|
3166
3166
|
Ct = Date.now();
|
|
3167
|
-
const
|
|
3168
|
-
if (
|
|
3169
|
-
if (
|
|
3170
|
-
console.debug("[use-chat] drop duplicate/out-of-order event", { seq:
|
|
3167
|
+
const me = te.seq;
|
|
3168
|
+
if (me !== void 0) {
|
|
3169
|
+
if (me <= ft) {
|
|
3170
|
+
console.debug("[use-chat] drop duplicate/out-of-order event", { seq: me, lastProcessedSeq: ft, type: te.type });
|
|
3171
3171
|
continue;
|
|
3172
3172
|
}
|
|
3173
|
-
ft > 0 &&
|
|
3173
|
+
ft > 0 && me > ft + 1 && ((D = A == null ? void 0 : A.onGap) == null || D.call(A, { from: ft, to: me })), ft = me, C.current = me, y(me);
|
|
3174
3174
|
}
|
|
3175
3175
|
if (console.debug("[use-chat] received event", {
|
|
3176
|
-
seq:
|
|
3177
|
-
type:
|
|
3176
|
+
seq: te.seq,
|
|
3177
|
+
type: te.type,
|
|
3178
3178
|
preview: (() => {
|
|
3179
|
-
var
|
|
3179
|
+
var le;
|
|
3180
3180
|
try {
|
|
3181
|
-
return
|
|
3182
|
-
} catch (
|
|
3183
|
-
return { err: String(
|
|
3181
|
+
return te.type === "message_delta" ? { deltaTypes: (le = te.delta) == null ? void 0 : le.map((Re) => Re.type), textLen: (te.delta || []).filter((Re) => Re.type === "text").map((Re) => String(Re.text || "").length) } : te.content || te.delta ? { hasContent: !0 } : {};
|
|
3182
|
+
} catch (Re) {
|
|
3183
|
+
return { err: String(Re) };
|
|
3184
3184
|
}
|
|
3185
3185
|
})()
|
|
3186
|
-
}),
|
|
3187
|
-
k.current =
|
|
3188
|
-
else if (
|
|
3189
|
-
N.current =
|
|
3186
|
+
}), te.type === "checkpoint")
|
|
3187
|
+
k.current = te.checkpointId ?? null, E.current = te.checkpointNs ?? null, m(te.checkpointId ?? null);
|
|
3188
|
+
else if (te.type === "state_history") {
|
|
3189
|
+
N.current = te;
|
|
3190
3190
|
try {
|
|
3191
|
-
const
|
|
3192
|
-
|
|
3193
|
-
} catch (
|
|
3194
|
-
console.warn("[use-chat] Failed to hydrate state_history payload",
|
|
3191
|
+
const Re = hr(te).latest;
|
|
3192
|
+
Re && (k.current = Re.checkpointId ?? null, E.current = Re.checkpointNs ?? null, m(Re.checkpointId ?? null));
|
|
3193
|
+
} catch (le) {
|
|
3194
|
+
console.warn("[use-chat] Failed to hydrate state_history payload", le);
|
|
3195
3195
|
}
|
|
3196
3196
|
}
|
|
3197
3197
|
try {
|
|
3198
|
-
F == null || F(
|
|
3199
|
-
} catch (
|
|
3200
|
-
console.error("[use-chat] Error in onEvent callback:",
|
|
3198
|
+
F == null || F(te);
|
|
3199
|
+
} catch (le) {
|
|
3200
|
+
console.error("[use-chat] Error in onEvent callback:", le, "for event:", te.type);
|
|
3201
3201
|
}
|
|
3202
|
-
if (
|
|
3203
|
-
gt.push(
|
|
3204
|
-
else if (
|
|
3205
|
-
const
|
|
3206
|
-
|
|
3207
|
-
} else if (
|
|
3202
|
+
if (te.type === "token" && e.autoAppendAssistant !== !1)
|
|
3203
|
+
gt.push(te.content), jt();
|
|
3204
|
+
else if (te.type === "message_delta") {
|
|
3205
|
+
const le = te.delta.filter((Re) => Re.type === "text").map((Re) => Re.text).join("");
|
|
3206
|
+
le && e.autoAppendAssistant !== !1 && (gt.push(le), jt());
|
|
3207
|
+
} else if (te.type === "heartbeat") {
|
|
3208
3208
|
console.debug("[use-chat] heartbeat received");
|
|
3209
3209
|
try {
|
|
3210
|
-
(H = A == null ? void 0 : A.onHeartbeat) == null || H.call(A,
|
|
3211
|
-
} catch (
|
|
3212
|
-
console.warn("[use-chat] heartbeat callback failed",
|
|
3210
|
+
(H = A == null ? void 0 : A.onHeartbeat) == null || H.call(A, te);
|
|
3211
|
+
} catch (le) {
|
|
3212
|
+
console.warn("[use-chat] heartbeat callback failed", le);
|
|
3213
3213
|
}
|
|
3214
|
-
} else if (it !== null && cancelAnimationFrame(it), Ve(),
|
|
3215
|
-
m(
|
|
3216
|
-
else if (
|
|
3217
|
-
const
|
|
3218
|
-
if (d(
|
|
3219
|
-
console.error("[use-chat] Auth error detected:",
|
|
3214
|
+
} else if (it !== null && cancelAnimationFrame(it), Ve(), te.type === "checkpoint")
|
|
3215
|
+
m(te.checkpointId);
|
|
3216
|
+
else if (te.type === "error") {
|
|
3217
|
+
const le = te;
|
|
3218
|
+
if (d(le.message), L = "error", _ = le.message, le.error_type === "auth_error" || le.code === "TOKEN_EXPIRED" || ((ne = le.message) == null ? void 0 : ne.includes("token")) || ((ie = le.message) == null ? void 0 : ie.includes("401")) || ((V = le.message) == null ? void 0 : V.includes("unauthorized")) || ((Me = le.message) == null ? void 0 : Me.includes("Unauthorized"))) {
|
|
3219
|
+
console.error("[use-chat] Auth error detected:", le.message);
|
|
3220
3220
|
try {
|
|
3221
|
-
(Ue = A == null ? void 0 : A.onAuthError) == null || Ue.call(A,
|
|
3221
|
+
(Ue = A == null ? void 0 : A.onAuthError) == null || Ue.call(A, le.message);
|
|
3222
3222
|
} catch (Ut) {
|
|
3223
3223
|
console.warn("[use-chat] onAuthError handler failed", Ut);
|
|
3224
3224
|
}
|
|
@@ -3249,7 +3249,7 @@ function Ox(e = {}) {
|
|
|
3249
3249
|
L = L ?? "aborted";
|
|
3250
3250
|
else {
|
|
3251
3251
|
const et = Pe.message || String(Pe);
|
|
3252
|
-
L = "error", _ = et, d(et), (
|
|
3252
|
+
L = "error", _ = et, d(et), (ge = A == null ? void 0 : A.onError) == null || ge.call(A, et), J || ((Le = A == null ? void 0 : A.onConnectionError) == null || Le.call(A, et), J = !0);
|
|
3253
3253
|
}
|
|
3254
3254
|
} finally {
|
|
3255
3255
|
const Pe = C.current, et = k.current, We = E.current, Ge = N.current, qe = L ?? (X.signal.aborted ? "aborted" : _ ? "error" : "complete");
|
|
@@ -3361,13 +3361,13 @@ function Fx(e, t) {
|
|
|
3361
3361
|
}
|
|
3362
3362
|
}
|
|
3363
3363
|
function zx(e = []) {
|
|
3364
|
-
const [t, n] = Jh(Fx, { ...$x, messages: e }), r = He([]), o = He(null), s = He(null), i =
|
|
3364
|
+
const [t, n] = Jh(Fx, { ...$x, messages: e }), r = He([]), o = He(null), s = He(null), i = Te(() => {
|
|
3365
3365
|
o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), o.current = null, s.current = null;
|
|
3366
3366
|
const d = r.current;
|
|
3367
3367
|
d.length && (r.current = [], n({ type: "batch", payload: { events: d } }));
|
|
3368
|
-
}, []), a =
|
|
3368
|
+
}, []), a = Te(() => {
|
|
3369
3369
|
typeof window < "u" && typeof window.requestAnimationFrame == "function" ? o.current === null && (o.current = window.requestAnimationFrame(() => i())) : s.current === null && (s.current = setTimeout(i, 8));
|
|
3370
|
-
}, [i]), l =
|
|
3370
|
+
}, [i]), l = Te((d) => {
|
|
3371
3371
|
r.current.push(d), a();
|
|
3372
3372
|
}, [a]);
|
|
3373
3373
|
Et(() => () => {
|
|
@@ -3719,7 +3719,7 @@ function Vx({
|
|
|
3719
3719
|
onAuthError: l,
|
|
3720
3720
|
onHeartbeat: c
|
|
3721
3721
|
}) {
|
|
3722
|
-
const d = He(null), f = He(null), p = He(/* @__PURE__ */ new Map()), h = He(null), m = He(null), x =
|
|
3722
|
+
const d = He(null), f = He(null), p = He(/* @__PURE__ */ new Map()), h = He(null), m = He(null), x = Te((j) => {
|
|
3723
3723
|
try {
|
|
3724
3724
|
const P = globalThis.structuredClone;
|
|
3725
3725
|
if (typeof P == "function")
|
|
@@ -3731,16 +3731,16 @@ function Vx({
|
|
|
3731
3731
|
} catch {
|
|
3732
3732
|
return j;
|
|
3733
3733
|
}
|
|
3734
|
-
}, []), y =
|
|
3734
|
+
}, []), y = Te(
|
|
3735
3735
|
(j, P) => {
|
|
3736
3736
|
if (!j) return;
|
|
3737
3737
|
const $ = p.current.get(j) ?? [], I = x(P), F = $.length >= Ol ? [...$.slice($.length - Ol + 1), I] : [...$, I];
|
|
3738
3738
|
p.current.set(j, F);
|
|
3739
3739
|
},
|
|
3740
3740
|
[x]
|
|
3741
|
-
), g =
|
|
3741
|
+
), g = Te((j) => {
|
|
3742
3742
|
j && p.current.set(j, []);
|
|
3743
|
-
}, []), w =
|
|
3743
|
+
}, []), w = Te(
|
|
3744
3744
|
(j) => {
|
|
3745
3745
|
const P = j ?? f.current;
|
|
3746
3746
|
if (!P) return;
|
|
@@ -3754,7 +3754,7 @@ function Vx({
|
|
|
3754
3754
|
});
|
|
3755
3755
|
},
|
|
3756
3756
|
[n]
|
|
3757
|
-
), b =
|
|
3757
|
+
), b = Te(
|
|
3758
3758
|
(j) => {
|
|
3759
3759
|
var I, F, A, X, L;
|
|
3760
3760
|
const P = j.seq ?? null;
|
|
@@ -3823,7 +3823,7 @@ function Vx({
|
|
|
3823
3823
|
), { stream: T, stop: C, isStreaming: S, error: k, setToken: E } = Ox({
|
|
3824
3824
|
baseUrl: e,
|
|
3825
3825
|
token: void 0
|
|
3826
|
-
}), N =
|
|
3826
|
+
}), N = Te(
|
|
3827
3827
|
(j, P) => {
|
|
3828
3828
|
d.current = null, m.current = null, f.current = j.threadId ?? null, h.current = {
|
|
3829
3829
|
request: j,
|
|
@@ -3897,7 +3897,7 @@ function Vx({
|
|
|
3897
3897
|
i,
|
|
3898
3898
|
T
|
|
3899
3899
|
]
|
|
3900
|
-
), M =
|
|
3900
|
+
), M = Te(() => {
|
|
3901
3901
|
h.current && (h.current.manualStop = !0), C();
|
|
3902
3902
|
}, [C]);
|
|
3903
3903
|
return rt(
|
|
@@ -3913,7 +3913,7 @@ function Vx({
|
|
|
3913
3913
|
);
|
|
3914
3914
|
}
|
|
3915
3915
|
function Kx() {
|
|
3916
|
-
const e = He(/* @__PURE__ */ new Map()), t =
|
|
3916
|
+
const e = He(/* @__PURE__ */ new Map()), t = Te(
|
|
3917
3917
|
(a, l) => {
|
|
3918
3918
|
const c = e.current.get(a), d = /* @__PURE__ */ new Map();
|
|
3919
3919
|
c && c.forEach((f) => {
|
|
@@ -3923,24 +3923,24 @@ function Kx() {
|
|
|
3923
3923
|
}), e.current.set(a, Array.from(d.values()));
|
|
3924
3924
|
},
|
|
3925
3925
|
[]
|
|
3926
|
-
), n =
|
|
3926
|
+
), n = Te(
|
|
3927
3927
|
(a, l) => {
|
|
3928
3928
|
const c = e.current.get(a);
|
|
3929
3929
|
return c == null ? void 0 : c.find((d) => d.checkpointId === l);
|
|
3930
3930
|
},
|
|
3931
3931
|
[]
|
|
3932
|
-
), r =
|
|
3932
|
+
), r = Te(
|
|
3933
3933
|
(a, l) => {
|
|
3934
3934
|
const c = e.current.get(a);
|
|
3935
3935
|
return (c == null ? void 0 : c.some((d) => d.checkpointId === l)) ?? !1;
|
|
3936
3936
|
},
|
|
3937
3937
|
[]
|
|
3938
|
-
), o =
|
|
3938
|
+
), o = Te(
|
|
3939
3939
|
(a) => e.current.get(a),
|
|
3940
3940
|
[]
|
|
3941
|
-
), s =
|
|
3941
|
+
), s = Te((a) => {
|
|
3942
3942
|
e.current.delete(a);
|
|
3943
|
-
}, []), i =
|
|
3943
|
+
}, []), i = Te(() => {
|
|
3944
3944
|
e.current.clear();
|
|
3945
3945
|
}, []);
|
|
3946
3946
|
return {
|
|
@@ -3966,142 +3966,146 @@ function qx({
|
|
|
3966
3966
|
onThreadChange: a,
|
|
3967
3967
|
checkpointMetadataCache: l
|
|
3968
3968
|
}) {
|
|
3969
|
-
const { api: c, baseUrl: d } = xu(), f = rt(() => _n(d), [d]), [p, h] =
|
|
3970
|
-
(
|
|
3971
|
-
if (!W.length) return;
|
|
3972
|
-
const ie = new Set(
|
|
3973
|
-
W.map((ee) => ee.checkpointId).filter((ee) => !!(ee != null && ee.trim()))
|
|
3974
|
-
);
|
|
3975
|
-
J((ee) => [...ee.filter((ae) => {
|
|
3976
|
-
const Te = ae.checkpointId;
|
|
3977
|
-
return Te ? !ie.has(Te) : !0;
|
|
3978
|
-
}), ...W]);
|
|
3979
|
-
},
|
|
3980
|
-
[]
|
|
3981
|
-
), oe = ke((W) => {
|
|
3982
|
-
if (!W.length) return;
|
|
3983
|
-
const ie = new Set(W.map((ee) => ee.id));
|
|
3984
|
-
pe((ee) => [...ee.filter((ae) => !ie.has(ae.id)), ...W]);
|
|
3985
|
-
}, []), Y = rt(
|
|
3986
|
-
() => _.flatMap((W) => W.messages ?? []),
|
|
3969
|
+
const { api: c, baseUrl: d } = xu(), f = rt(() => _n(d), [d]), [p, h] = be([]), [m, x] = be(t), [y, g] = be(!1), [w, b] = be(null), [T, C] = be(!1), [S, k] = be(null), { state: E, seed: N, prepend: M, pushUser: j, onEvent: P } = zx(), [$, I] = be(!1), [F, A] = be(!1), [X, L] = be(null), [_, J] = be([]), [G, pe] = be([]), [ke, Ae] = be(!1), K = rt(
|
|
3970
|
+
() => _.flatMap((q) => q.messages ?? []),
|
|
3987
3971
|
[_]
|
|
3988
|
-
),
|
|
3989
|
-
(
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3972
|
+
), oe = rt(() => Px(K), [K]), Y = Te((q) => {
|
|
3973
|
+
const se = /* @__PURE__ */ new Set(), te = [];
|
|
3974
|
+
for (const me of q) {
|
|
3975
|
+
if (!me.id) {
|
|
3976
|
+
te.push(me);
|
|
3977
|
+
continue;
|
|
3978
|
+
}
|
|
3979
|
+
se.has(me.id) || (se.add(me.id), te.push(me));
|
|
3980
|
+
}
|
|
3981
|
+
return te;
|
|
3982
|
+
}, []), D = Te((q) => {
|
|
3983
|
+
const se = /* @__PURE__ */ new Set(), te = [];
|
|
3984
|
+
for (const me of q) {
|
|
3985
|
+
if (!me.checkpointId) {
|
|
3986
|
+
te.push(me);
|
|
3987
|
+
continue;
|
|
3988
|
+
}
|
|
3989
|
+
se.has(me.checkpointId) || (se.add(me.checkpointId), te.push(me));
|
|
3990
|
+
}
|
|
3991
|
+
return te;
|
|
3992
|
+
}, []), H = l ?? Kx(), { setCacheForThread: ne } = H, ie = Te(
|
|
3993
|
+
(q, se, te) => {
|
|
3994
|
+
const me = se.filter((le) => le.checkpointId).map((le) => ({
|
|
3995
|
+
checkpointId: le.checkpointId,
|
|
3996
|
+
checkpointNs: le.checkpointNs ?? void 0,
|
|
3997
|
+
createdAt: le.createdAt ?? ""
|
|
3994
3998
|
}));
|
|
3995
|
-
console.log(`[ChatSessionProvider] Cached metadata for ${
|
|
3999
|
+
console.log(`[ChatSessionProvider] Cached metadata for ${me.length} checkpoints from ${te}`), ne(q, me);
|
|
3996
4000
|
},
|
|
3997
4001
|
[ne]
|
|
3998
|
-
),
|
|
4002
|
+
), V = He(m), Me = He(null), Ue = He(null), Ze = He(null), re = He(null), ge = He(!1), Le = He(null), Fe = He(/* @__PURE__ */ new Map());
|
|
3999
4003
|
Et(() => {
|
|
4000
|
-
|
|
4004
|
+
V.current = m;
|
|
4001
4005
|
}, [m]);
|
|
4002
|
-
const Pe =
|
|
4006
|
+
const Pe = Te(async () => {
|
|
4003
4007
|
g(!0), b(null);
|
|
4004
4008
|
try {
|
|
4005
|
-
const
|
|
4006
|
-
h(
|
|
4007
|
-
} catch (
|
|
4008
|
-
const
|
|
4009
|
-
b(
|
|
4009
|
+
const q = await c.listThreads();
|
|
4010
|
+
h(q ?? []);
|
|
4011
|
+
} catch (q) {
|
|
4012
|
+
const se = String(q);
|
|
4013
|
+
b(se), s == null || s(se);
|
|
4010
4014
|
} finally {
|
|
4011
4015
|
g(!1);
|
|
4012
4016
|
}
|
|
4013
|
-
}, [c, s]), et =
|
|
4014
|
-
if (!(
|
|
4015
|
-
const
|
|
4016
|
-
threadId:
|
|
4017
|
-
title:
|
|
4018
|
-
createdAt:
|
|
4019
|
-
updatedAt:
|
|
4020
|
-
messageCount:
|
|
4017
|
+
}, [c, s]), et = Te((q) => {
|
|
4018
|
+
if (!(q != null && q.threadId)) return;
|
|
4019
|
+
const se = {
|
|
4020
|
+
threadId: q.threadId,
|
|
4021
|
+
title: q.title || `Thread ${q.threadId.slice(0, 8)}`,
|
|
4022
|
+
createdAt: q.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
4023
|
+
updatedAt: q.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
4024
|
+
messageCount: q.messageCount ?? 1
|
|
4021
4025
|
};
|
|
4022
|
-
h((
|
|
4023
|
-
}, []), We =
|
|
4024
|
-
(
|
|
4025
|
-
const
|
|
4026
|
-
if (!
|
|
4026
|
+
h((te) => te.some((le) => le.threadId === se.threadId) ? (console.debug("[ChatSessionProvider] thread_info: thread already in list", se.threadId), te) : (console.debug("[ChatSessionProvider] thread_info: adding thread to list", se.threadId), [se, ...te]));
|
|
4027
|
+
}, []), We = Te(
|
|
4028
|
+
(q) => {
|
|
4029
|
+
const se = q.threadId ?? V.current;
|
|
4030
|
+
if (!se || V.current && V.current !== se)
|
|
4027
4031
|
return;
|
|
4028
|
-
const { checkpoints:
|
|
4029
|
-
if (!
|
|
4032
|
+
const { checkpoints: te, timeline: me } = hr(q);
|
|
4033
|
+
if (!te.length)
|
|
4030
4034
|
return;
|
|
4031
|
-
se
|
|
4032
|
-
const
|
|
4033
|
-
N((
|
|
4034
|
-
checkpointId: (
|
|
4035
|
-
checkpointNs: (
|
|
4036
|
-
}),
|
|
4035
|
+
ie(se, te, "stream state_history");
|
|
4036
|
+
const le = te.find((Re) => Re.messages && Re.messages.length > 0) ?? te.find((Re) => !!Re.checkpointId) ?? te[0];
|
|
4037
|
+
N((le == null ? void 0 : le.messages) ?? [], {
|
|
4038
|
+
checkpointId: (le == null ? void 0 : le.checkpointId) ?? null,
|
|
4039
|
+
checkpointNs: (le == null ? void 0 : le.checkpointNs) ?? null
|
|
4040
|
+
}), pe(Y(me)), J(D(te)), I(!!(le != null && le.nextCursor)), L((le == null ? void 0 : le.nextCursor) ?? null), Le.current = `${se}:latest`, Ue.current = null, Ze.current = null;
|
|
4037
4041
|
},
|
|
4038
|
-
[
|
|
4039
|
-
), Ge =
|
|
4040
|
-
console.log("[ChatSessionProvider] 🎯 Received thread_info:",
|
|
4042
|
+
[ie, D, Y, N]
|
|
4043
|
+
), Ge = Te((q) => {
|
|
4044
|
+
console.log("[ChatSessionProvider] 🎯 Received thread_info:", q.threadId), et(q), V.current !== q.threadId && ((q.created ?? !V.current) && (Ue.current = q.threadId), Ze.current = q.threadId, console.log("[ChatSessionProvider] thread_info: marking to skip auto-load for new thread"), x(q.threadId));
|
|
4041
4045
|
}, [et]), { startStream: qe, stop: Qe, isStreaming: St, error: mt, setAuthToken: gt } = Vx({
|
|
4042
4046
|
baseUrl: f,
|
|
4043
4047
|
onThreadInfo: Ge,
|
|
4044
4048
|
onMessageEvent: P,
|
|
4045
4049
|
onStateHistory: We,
|
|
4046
|
-
onUnhandledEvent: (
|
|
4047
|
-
console.warn("[ChatSessionProvider] Unhandled event:",
|
|
4050
|
+
onUnhandledEvent: (q) => {
|
|
4051
|
+
console.warn("[ChatSessionProvider] Unhandled event:", q.type);
|
|
4048
4052
|
},
|
|
4049
4053
|
onAuthError: i
|
|
4050
|
-
}), ft =
|
|
4051
|
-
async (
|
|
4054
|
+
}), ft = Te(
|
|
4055
|
+
async (q) => {
|
|
4052
4056
|
try {
|
|
4053
|
-
const
|
|
4054
|
-
return x(
|
|
4055
|
-
} catch (
|
|
4056
|
-
return s == null || s(String(
|
|
4057
|
+
const se = await c.createThread(q);
|
|
4058
|
+
return x(se.threadId), await Pe(), se.threadId;
|
|
4059
|
+
} catch (se) {
|
|
4060
|
+
return s == null || s(String(se)), null;
|
|
4057
4061
|
}
|
|
4058
4062
|
},
|
|
4059
4063
|
[c, Pe, s]
|
|
4060
|
-
), it =
|
|
4061
|
-
async (
|
|
4064
|
+
), it = Te(
|
|
4065
|
+
async (q) => {
|
|
4062
4066
|
try {
|
|
4063
|
-
await c.deleteThread(
|
|
4064
|
-
} catch (
|
|
4065
|
-
s == null || s(String(
|
|
4067
|
+
await c.deleteThread(q), V.current === q && (x(null), N([], {})), await Pe();
|
|
4068
|
+
} catch (se) {
|
|
4069
|
+
s == null || s(String(se));
|
|
4066
4070
|
}
|
|
4067
4071
|
},
|
|
4068
4072
|
[c, Pe, N, s]
|
|
4069
|
-
), Ve =
|
|
4070
|
-
async (
|
|
4073
|
+
), Ve = Te(
|
|
4074
|
+
async (q, se) => {
|
|
4071
4075
|
try {
|
|
4072
|
-
await c.updateThread(
|
|
4073
|
-
} catch (
|
|
4074
|
-
s == null || s(String(
|
|
4076
|
+
await c.updateThread(q, se), await Pe();
|
|
4077
|
+
} catch (te) {
|
|
4078
|
+
s == null || s(String(te));
|
|
4075
4079
|
}
|
|
4076
4080
|
},
|
|
4077
4081
|
[c, Pe, s]
|
|
4078
|
-
), jt =
|
|
4079
|
-
async (
|
|
4080
|
-
if (!
|
|
4081
|
-
const
|
|
4082
|
-
if (
|
|
4083
|
-
return
|
|
4084
|
-
const
|
|
4085
|
-
const
|
|
4082
|
+
), jt = Te(
|
|
4083
|
+
async (q, se) => {
|
|
4084
|
+
if (!q) return;
|
|
4085
|
+
const te = `${q}:${se ?? "latest"}`, me = Fe.current.get(te);
|
|
4086
|
+
if (me)
|
|
4087
|
+
return me;
|
|
4088
|
+
const le = (async () => {
|
|
4089
|
+
const Re = q;
|
|
4086
4090
|
C(!0), k(null);
|
|
4087
4091
|
try {
|
|
4088
4092
|
const Ut = await c.getStateHistory({
|
|
4089
|
-
threadId:
|
|
4090
|
-
checkpointId:
|
|
4093
|
+
threadId: Re,
|
|
4094
|
+
checkpointId: se || void 0
|
|
4091
4095
|
});
|
|
4092
|
-
if (
|
|
4093
|
-
console.log(`[ChatSessionProvider] Thread changed during load (was ${
|
|
4096
|
+
if (V.current !== Re) {
|
|
4097
|
+
console.log(`[ChatSessionProvider] Thread changed during load (was ${Re}, now ${V.current}), discarding stale data`);
|
|
4094
4098
|
return;
|
|
4095
4099
|
}
|
|
4096
4100
|
const { checkpoints: Tt, timeline: cn } = hr(Ut);
|
|
4097
|
-
|
|
4098
|
-
const kt = Tt.find((Mn) => Mn.messages && Mn.messages.length > 0) ?? (
|
|
4101
|
+
ie(Re, Tt, `thread load (requested: ${se})`);
|
|
4102
|
+
const kt = Tt.find((Mn) => Mn.messages && Mn.messages.length > 0) ?? (se ? Tt.find((Mn) => Mn.checkpointId === se) : null) ?? Tt[0];
|
|
4099
4103
|
N((kt == null ? void 0 : kt.messages) ?? [], {
|
|
4100
4104
|
checkpointId: (kt == null ? void 0 : kt.checkpointId) ?? null,
|
|
4101
4105
|
checkpointNs: (kt == null ? void 0 : kt.checkpointNs) ?? null
|
|
4102
4106
|
}), pe(cn), J(Tt), I(!!(kt != null && kt.nextCursor)), L((kt == null ? void 0 : kt.nextCursor) ?? null);
|
|
4103
4107
|
} catch (Ut) {
|
|
4104
|
-
if (
|
|
4108
|
+
if (V.current === Re) {
|
|
4105
4109
|
const Tt = String(Ut);
|
|
4106
4110
|
k(Tt), s == null || s(Tt);
|
|
4107
4111
|
}
|
|
@@ -4109,22 +4113,22 @@ function qx({
|
|
|
4109
4113
|
C(!1);
|
|
4110
4114
|
}
|
|
4111
4115
|
})();
|
|
4112
|
-
Fe.current.set(
|
|
4116
|
+
Fe.current.set(te, le);
|
|
4113
4117
|
try {
|
|
4114
|
-
await
|
|
4118
|
+
await le;
|
|
4115
4119
|
} finally {
|
|
4116
|
-
Fe.current.delete(
|
|
4120
|
+
Fe.current.delete(te);
|
|
4117
4121
|
}
|
|
4118
|
-
return
|
|
4122
|
+
return V.current === q && (Le.current = te), le;
|
|
4119
4123
|
},
|
|
4120
|
-
[c, N, s,
|
|
4121
|
-
), Ct =
|
|
4122
|
-
async (
|
|
4123
|
-
re.current =
|
|
4124
|
+
[c, N, s, ie]
|
|
4125
|
+
), Ct = Te(
|
|
4126
|
+
async (q, se) => {
|
|
4127
|
+
re.current = q;
|
|
4124
4128
|
try {
|
|
4125
|
-
await jt(
|
|
4129
|
+
await jt(q, se);
|
|
4126
4130
|
} finally {
|
|
4127
|
-
re.current ===
|
|
4131
|
+
re.current === q && (re.current = null);
|
|
4128
4132
|
}
|
|
4129
4133
|
},
|
|
4130
4134
|
[jt]
|
|
@@ -4147,15 +4151,15 @@ function qx({
|
|
|
4147
4151
|
if (Me.current === m)
|
|
4148
4152
|
return;
|
|
4149
4153
|
Me.current = m;
|
|
4150
|
-
const
|
|
4151
|
-
let
|
|
4152
|
-
|
|
4154
|
+
const q = !ge.current && !!n && m === t;
|
|
4155
|
+
let se;
|
|
4156
|
+
q && n ? (se = n, ge.current = !0, console.log(
|
|
4153
4157
|
"[ChatSessionProvider] Loading thread with checkpoint:",
|
|
4154
|
-
|
|
4158
|
+
se,
|
|
4155
4159
|
r ? `(ns: ${r})` : ""
|
|
4156
4160
|
)) : console.log("[ChatSessionProvider] Loading thread with latest checkpoint");
|
|
4157
|
-
const
|
|
4158
|
-
Le.current !==
|
|
4161
|
+
const te = `${m}:${se ?? "latest"}`;
|
|
4162
|
+
Le.current !== te && Ct(m, se);
|
|
4159
4163
|
}, [
|
|
4160
4164
|
o,
|
|
4161
4165
|
m,
|
|
@@ -4166,99 +4170,99 @@ function qx({
|
|
|
4166
4170
|
St,
|
|
4167
4171
|
Ct
|
|
4168
4172
|
]);
|
|
4169
|
-
const Zt =
|
|
4170
|
-
async (
|
|
4171
|
-
const
|
|
4172
|
-
if (!
|
|
4173
|
-
const
|
|
4173
|
+
const Zt = Te(
|
|
4174
|
+
async (q, se) => {
|
|
4175
|
+
const te = V.current;
|
|
4176
|
+
if (!te) return;
|
|
4177
|
+
const me = te;
|
|
4174
4178
|
Ae(!0);
|
|
4175
4179
|
try {
|
|
4176
|
-
const
|
|
4177
|
-
threadId:
|
|
4178
|
-
checkpointId:
|
|
4179
|
-
checkpointNs:
|
|
4180
|
+
const le = await c.getStateHistory({
|
|
4181
|
+
threadId: me,
|
|
4182
|
+
checkpointId: q,
|
|
4183
|
+
checkpointNs: se ?? void 0
|
|
4180
4184
|
});
|
|
4181
|
-
if (
|
|
4182
|
-
console.log(`[ChatSessionProvider] Thread changed during checkpoint navigation (was ${
|
|
4185
|
+
if (V.current !== me) {
|
|
4186
|
+
console.log(`[ChatSessionProvider] Thread changed during checkpoint navigation (was ${me}, now ${V.current}), discarding stale data`);
|
|
4183
4187
|
return;
|
|
4184
4188
|
}
|
|
4185
|
-
const { checkpoints:
|
|
4186
|
-
|
|
4187
|
-
const Tt =
|
|
4188
|
-
(cn) => cn.checkpointId ===
|
|
4189
|
+
const { checkpoints: Re, timeline: Ut } = hr(le);
|
|
4190
|
+
ie(me, Re, "checkpoint navigation");
|
|
4191
|
+
const Tt = Re.find(
|
|
4192
|
+
(cn) => cn.checkpointId === q && (se ? cn.checkpointNs === se : !0)
|
|
4189
4193
|
);
|
|
4190
4194
|
if (!Tt) {
|
|
4191
|
-
console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId:
|
|
4195
|
+
console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId: q, checkpointNs: se });
|
|
4192
4196
|
return;
|
|
4193
4197
|
}
|
|
4194
|
-
pe(Ut), J(
|
|
4198
|
+
pe(Ut), J(Re), N(Tt.messages ?? [], {
|
|
4195
4199
|
checkpointId: Tt.checkpointId ?? null,
|
|
4196
4200
|
checkpointNs: Tt.checkpointNs ?? null
|
|
4197
4201
|
});
|
|
4198
|
-
} catch (
|
|
4199
|
-
|
|
4202
|
+
} catch (le) {
|
|
4203
|
+
V.current === me && (s == null || s(String(le)));
|
|
4200
4204
|
} finally {
|
|
4201
4205
|
Ae(!1);
|
|
4202
4206
|
}
|
|
4203
4207
|
},
|
|
4204
|
-
[c, N, s,
|
|
4205
|
-
), ln =
|
|
4206
|
-
(
|
|
4208
|
+
[c, N, s, ie]
|
|
4209
|
+
), ln = Te(
|
|
4210
|
+
(q, se) => {
|
|
4207
4211
|
N(E.messages, {
|
|
4208
|
-
checkpointId:
|
|
4209
|
-
checkpointNs:
|
|
4212
|
+
checkpointId: q ?? null,
|
|
4213
|
+
checkpointNs: se ?? null
|
|
4210
4214
|
});
|
|
4211
4215
|
},
|
|
4212
4216
|
[N, E.messages]
|
|
4213
|
-
), Ye =
|
|
4214
|
-
|
|
4215
|
-
}, [Ct]), _e =
|
|
4216
|
-
if (!
|
|
4217
|
-
const
|
|
4217
|
+
), Ye = Te(async () => {
|
|
4218
|
+
V.current && await Ct(V.current);
|
|
4219
|
+
}, [Ct]), _e = Te(async () => {
|
|
4220
|
+
if (!V.current || !X) return;
|
|
4221
|
+
const q = V.current;
|
|
4218
4222
|
A(!0);
|
|
4219
4223
|
try {
|
|
4220
|
-
const
|
|
4221
|
-
threadId:
|
|
4224
|
+
const se = await c.getStateHistory({
|
|
4225
|
+
threadId: q,
|
|
4222
4226
|
checkpointId: X
|
|
4223
4227
|
});
|
|
4224
|
-
if (
|
|
4225
|
-
console.log(`[ChatSessionProvider] Thread changed during history load (was ${
|
|
4228
|
+
if (V.current !== q) {
|
|
4229
|
+
console.log(`[ChatSessionProvider] Thread changed during history load (was ${q}, now ${V.current}), discarding stale data`);
|
|
4226
4230
|
return;
|
|
4227
4231
|
}
|
|
4228
|
-
const { checkpoints:
|
|
4229
|
-
if (
|
|
4230
|
-
const
|
|
4231
|
-
M((
|
|
4232
|
+
const { checkpoints: te } = hr(se);
|
|
4233
|
+
if (te.length > 0) {
|
|
4234
|
+
const me = te[te.length - 1];
|
|
4235
|
+
M((me == null ? void 0 : me.messages) ?? []), I(!!(me != null && me.nextCursor)), L((me == null ? void 0 : me.nextCursor) ?? null);
|
|
4232
4236
|
}
|
|
4233
|
-
} catch (
|
|
4234
|
-
|
|
4237
|
+
} catch (se) {
|
|
4238
|
+
V.current === q && (s == null || s(String(se)));
|
|
4235
4239
|
} finally {
|
|
4236
4240
|
A(!1);
|
|
4237
4241
|
}
|
|
4238
|
-
}, [c, X, M, s]), _t =
|
|
4242
|
+
}, [c, X, M, s]), _t = Te(async () => {
|
|
4239
4243
|
N([], {}), x(null), Qe(), J([]), pe([]), I(!1), L(null), C(!1), Ae(!1), A(!1), k(null);
|
|
4240
4244
|
try {
|
|
4241
4245
|
await c.getAgent("default");
|
|
4242
|
-
} catch (
|
|
4243
|
-
console.warn("[ChatSessionProvider] Failed to refetch agent after clearing thread:",
|
|
4246
|
+
} catch (q) {
|
|
4247
|
+
console.warn("[ChatSessionProvider] Failed to refetch agent after clearing thread:", q);
|
|
4244
4248
|
}
|
|
4245
|
-
}, [N, Qe, c]), zt =
|
|
4246
|
-
async (
|
|
4247
|
-
const
|
|
4248
|
-
if (!
|
|
4249
|
+
}, [N, Qe, c]), zt = Te(
|
|
4250
|
+
async (q, se, te) => {
|
|
4251
|
+
const me = V.current;
|
|
4252
|
+
if (!me)
|
|
4249
4253
|
throw new Error("No active thread to handle interrupt");
|
|
4250
|
-
const
|
|
4254
|
+
const le = se ? te ?? !0 : !1;
|
|
4251
4255
|
try {
|
|
4252
|
-
const
|
|
4253
|
-
threadId:
|
|
4256
|
+
const Re = {
|
|
4257
|
+
threadId: me,
|
|
4254
4258
|
checkpointId: E.lastCheckpointId ?? void 0,
|
|
4255
4259
|
checkpointNs: E.lastCheckpointNs ?? void 0,
|
|
4256
4260
|
// The command is the key: backend extracts this and routes to LangGraph
|
|
4257
|
-
command: { kind: "resume", value:
|
|
4261
|
+
command: { kind: "resume", value: le }
|
|
4258
4262
|
};
|
|
4259
|
-
qe(
|
|
4260
|
-
} catch (
|
|
4261
|
-
throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${
|
|
4263
|
+
qe(Re);
|
|
4264
|
+
} catch (Re) {
|
|
4265
|
+
throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${q}:`, Re), Re;
|
|
4262
4266
|
}
|
|
4263
4267
|
},
|
|
4264
4268
|
[E.lastCheckpointId, E.lastCheckpointNs, qe]
|
|
@@ -4268,42 +4272,42 @@ function qx({
|
|
|
4268
4272
|
}, [Pe]), Et(() => {
|
|
4269
4273
|
a == null || a(m);
|
|
4270
4274
|
}, [m, a]);
|
|
4271
|
-
const B =
|
|
4272
|
-
async (
|
|
4273
|
-
let
|
|
4274
|
-
const
|
|
4275
|
-
if (!
|
|
4276
|
-
if (!
|
|
4275
|
+
const B = Te(
|
|
4276
|
+
async (q, se) => {
|
|
4277
|
+
let te = V.current;
|
|
4278
|
+
const me = (q == null ? void 0 : q.text) ?? "";
|
|
4279
|
+
if (!te && !me) return;
|
|
4280
|
+
if (!te && me) {
|
|
4277
4281
|
const cn = Math.floor(Date.now() / 1e3).toString(16).padStart(8, "0"), kt = Array.from(
|
|
4278
4282
|
{ length: 4 },
|
|
4279
4283
|
() => Math.floor(Math.random() * 4294967295).toString(16).padStart(8, "0")
|
|
4280
4284
|
).join("").slice(0, 16);
|
|
4281
|
-
|
|
4285
|
+
te = `${cn}${kt}`, Ue.current = te, x(te);
|
|
4282
4286
|
}
|
|
4283
|
-
const { contentParts:
|
|
4287
|
+
const { contentParts: le } = await dx(
|
|
4284
4288
|
c,
|
|
4285
|
-
(
|
|
4286
|
-
),
|
|
4287
|
-
|
|
4289
|
+
(q == null ? void 0 : q.attachments) ?? []
|
|
4290
|
+
), Re = [...le];
|
|
4291
|
+
me != null && me.trim() && Re.push({ type: "text", text: me });
|
|
4288
4292
|
const Ut = {
|
|
4289
4293
|
id: `msg-${Date.now()}`,
|
|
4290
4294
|
role: "user",
|
|
4291
|
-
content:
|
|
4295
|
+
content: Re,
|
|
4292
4296
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
4293
4297
|
};
|
|
4294
4298
|
j(Ut);
|
|
4295
4299
|
const Tt = {
|
|
4296
|
-
threadId:
|
|
4300
|
+
threadId: te,
|
|
4297
4301
|
payload: {
|
|
4298
4302
|
messages: [Ut]
|
|
4299
4303
|
},
|
|
4300
|
-
checkpointId: (
|
|
4301
|
-
checkpointNs: (
|
|
4304
|
+
checkpointId: (se == null ? void 0 : se.checkpointId) ?? E.lastCheckpointId ?? void 0,
|
|
4305
|
+
checkpointNs: (se == null ? void 0 : se.checkpointNs) ?? E.lastCheckpointNs ?? void 0
|
|
4302
4306
|
};
|
|
4303
4307
|
qe(Tt);
|
|
4304
4308
|
},
|
|
4305
4309
|
[c, ft, j, E, qe]
|
|
4306
|
-
),
|
|
4310
|
+
), ve = rt(
|
|
4307
4311
|
() => ({
|
|
4308
4312
|
threads: p,
|
|
4309
4313
|
currentThreadId: m,
|
|
@@ -4318,7 +4322,7 @@ function qx({
|
|
|
4318
4322
|
}
|
|
4319
4323
|
}),
|
|
4320
4324
|
[p, m, y, w, ft, it, Ve, Pe]
|
|
4321
|
-
),
|
|
4325
|
+
), we = rt(
|
|
4322
4326
|
() => ({
|
|
4323
4327
|
threadId: m,
|
|
4324
4328
|
messages: E.messages,
|
|
@@ -4332,7 +4336,7 @@ function qx({
|
|
|
4332
4336
|
metadata: null,
|
|
4333
4337
|
isLoading: T,
|
|
4334
4338
|
isHistoryLoading: F,
|
|
4335
|
-
isLoadingCheckpoint:
|
|
4339
|
+
isLoadingCheckpoint: ke,
|
|
4336
4340
|
error: S,
|
|
4337
4341
|
hasMore: $,
|
|
4338
4342
|
loadOlder: _e,
|
|
@@ -4343,7 +4347,7 @@ function qx({
|
|
|
4343
4347
|
loadThread: Ct,
|
|
4344
4348
|
clearThread: _t,
|
|
4345
4349
|
respondToInterrupt: zt,
|
|
4346
|
-
messagePreviews:
|
|
4350
|
+
messagePreviews: oe
|
|
4347
4351
|
}),
|
|
4348
4352
|
[
|
|
4349
4353
|
m,
|
|
@@ -4352,7 +4356,7 @@ function qx({
|
|
|
4352
4356
|
G,
|
|
4353
4357
|
T,
|
|
4354
4358
|
F,
|
|
4355
|
-
|
|
4359
|
+
ke,
|
|
4356
4360
|
S,
|
|
4357
4361
|
$,
|
|
4358
4362
|
_e,
|
|
@@ -4362,7 +4366,7 @@ function qx({
|
|
|
4362
4366
|
Ye,
|
|
4363
4367
|
Ct,
|
|
4364
4368
|
zt,
|
|
4365
|
-
|
|
4369
|
+
oe
|
|
4366
4370
|
]
|
|
4367
4371
|
), at = rt(
|
|
4368
4372
|
() => ({
|
|
@@ -4376,7 +4380,7 @@ function qx({
|
|
|
4376
4380
|
}),
|
|
4377
4381
|
[St, mt, B, Qe, gt]
|
|
4378
4382
|
);
|
|
4379
|
-
return /* @__PURE__ */ u.jsx(Cu.Provider, { value:
|
|
4383
|
+
return /* @__PURE__ */ u.jsx(Cu.Provider, { value: ve, children: /* @__PURE__ */ u.jsx(Tu.Provider, { value: we, children: /* @__PURE__ */ u.jsx(ku.Provider, { value: at, children: e }) }) });
|
|
4380
4384
|
}
|
|
4381
4385
|
function da() {
|
|
4382
4386
|
const e = hs(Cu);
|
|
@@ -4420,7 +4424,7 @@ function ii({
|
|
|
4420
4424
|
}
|
|
4421
4425
|
) });
|
|
4422
4426
|
}
|
|
4423
|
-
function
|
|
4427
|
+
function ee(...e) {
|
|
4424
4428
|
return km(Tm(e));
|
|
4425
4429
|
}
|
|
4426
4430
|
const Yx = gs(
|
|
@@ -4453,7 +4457,7 @@ const Yx = gs(
|
|
|
4453
4457
|
return /* @__PURE__ */ u.jsx(
|
|
4454
4458
|
i,
|
|
4455
4459
|
{
|
|
4456
|
-
className:
|
|
4460
|
+
className: ee(Yx({ variant: t, size: n, className: e })),
|
|
4457
4461
|
ref: s,
|
|
4458
4462
|
...o
|
|
4459
4463
|
}
|
|
@@ -4465,7 +4469,7 @@ const Ru = v.forwardRef(
|
|
|
4465
4469
|
({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
4466
4470
|
"textarea",
|
|
4467
4471
|
{
|
|
4468
|
-
className:
|
|
4472
|
+
className: ee(
|
|
4469
4473
|
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
4470
4474
|
e
|
|
4471
4475
|
),
|
|
@@ -4522,8 +4526,8 @@ function Xx({
|
|
|
4522
4526
|
try {
|
|
4523
4527
|
const G = l(A);
|
|
4524
4528
|
G && typeof G.then == "function" ? G.then(() => {
|
|
4525
|
-
var pe,
|
|
4526
|
-
((pe = S.current) == null ? void 0 : pe.id) === X && S.current.shouldClear && (m || (y(""), T.current && (T.current.style.height = "auto"), a == null || a(""))), ((
|
|
4529
|
+
var pe, ke;
|
|
4530
|
+
((pe = S.current) == null ? void 0 : pe.id) === X && S.current.shouldClear && (m || (y(""), T.current && (T.current.style.height = "auto"), a == null || a(""))), ((ke = S.current) == null ? void 0 : ke.id) === X && (S.current = null);
|
|
4527
4531
|
}).catch(() => {
|
|
4528
4532
|
var pe;
|
|
4529
4533
|
((pe = S.current) == null ? void 0 : pe.id) === X && (S.current = null);
|
|
@@ -6455,7 +6459,7 @@ var qu = "PopperAnchor", Gu = v.forwardRef(
|
|
|
6455
6459
|
Gu.displayName = qu;
|
|
6456
6460
|
var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
|
|
6457
6461
|
(e, t) => {
|
|
6458
|
-
var Y, D, H, ne,
|
|
6462
|
+
var Y, D, H, ne, ie, V;
|
|
6459
6463
|
const {
|
|
6460
6464
|
__scopePopper: n,
|
|
6461
6465
|
side: r = "bottom",
|
|
@@ -6498,8 +6502,8 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
|
|
|
6498
6502
|
Nv({
|
|
6499
6503
|
...$,
|
|
6500
6504
|
apply: ({ elements: Me, rects: Ue, availableWidth: Ze, availableHeight: re }) => {
|
|
6501
|
-
const { width:
|
|
6502
|
-
Fe.setProperty("--radix-popper-available-width", `${Ze}px`), Fe.setProperty("--radix-popper-available-height", `${re}px`), Fe.setProperty("--radix-popper-anchor-width", `${
|
|
6505
|
+
const { width: ge, height: Le } = Ue.reference, Fe = Me.floating.style;
|
|
6506
|
+
Fe.setProperty("--radix-popper-available-width", `${Ze}px`), Fe.setProperty("--radix-popper-available-height", `${re}px`), Fe.setProperty("--radix-popper-anchor-width", `${ge}px`), Fe.setProperty("--radix-popper-anchor-height", `${Le}px`);
|
|
6503
6507
|
}
|
|
6504
6508
|
}),
|
|
6505
6509
|
T && _v({ element: T, padding: a }),
|
|
@@ -6510,7 +6514,7 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
|
|
|
6510
6514
|
Mt(() => {
|
|
6511
6515
|
X && (G == null || G());
|
|
6512
6516
|
}, [X, G]);
|
|
6513
|
-
const pe = (Y = L.arrow) == null ? void 0 : Y.x,
|
|
6517
|
+
const pe = (Y = L.arrow) == null ? void 0 : Y.x, ke = (D = L.arrow) == null ? void 0 : D.y, Ae = ((H = L.arrow) == null ? void 0 : H.centerOffset) !== 0, [K, oe] = v.useState();
|
|
6514
6518
|
return Mt(() => {
|
|
6515
6519
|
g && oe(window.getComputedStyle(g).zIndex);
|
|
6516
6520
|
}, [g]), /* @__PURE__ */ u.jsx(
|
|
@@ -6523,15 +6527,15 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
|
|
|
6523
6527
|
transform: X ? F.transform : "translate(0, -200%)",
|
|
6524
6528
|
// keep off the page when measuring
|
|
6525
6529
|
minWidth: "max-content",
|
|
6526
|
-
zIndex:
|
|
6530
|
+
zIndex: K,
|
|
6527
6531
|
"--radix-popper-transform-origin": [
|
|
6528
6532
|
(ne = L.transformOrigin) == null ? void 0 : ne.x,
|
|
6529
|
-
(
|
|
6533
|
+
(ie = L.transformOrigin) == null ? void 0 : ie.y
|
|
6530
6534
|
].join(" "),
|
|
6531
6535
|
// hide the content if using the hide middleware and should be hidden
|
|
6532
6536
|
// set visibility to hidden and disable pointer events so the UI behaves
|
|
6533
6537
|
// as if the PopperContent isn't there at all
|
|
6534
|
-
...((
|
|
6538
|
+
...((V = L.hide) == null ? void 0 : V.referenceHidden) && {
|
|
6535
6539
|
visibility: "hidden",
|
|
6536
6540
|
pointerEvents: "none"
|
|
6537
6541
|
}
|
|
@@ -6544,7 +6548,7 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
|
|
|
6544
6548
|
placedSide: _,
|
|
6545
6549
|
onArrowChange: C,
|
|
6546
6550
|
arrowX: pe,
|
|
6547
|
-
arrowY:
|
|
6551
|
+
arrowY: ke,
|
|
6548
6552
|
shouldHideArrow: Ae,
|
|
6549
6553
|
children: /* @__PURE__ */ u.jsx(
|
|
6550
6554
|
Oe.div,
|
|
@@ -6948,7 +6952,7 @@ function hi(e, t) {
|
|
|
6948
6952
|
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
6949
6953
|
}
|
|
6950
6954
|
function lw(e, t) {
|
|
6951
|
-
var n =
|
|
6955
|
+
var n = be(function() {
|
|
6952
6956
|
return {
|
|
6953
6957
|
// value
|
|
6954
6958
|
value: e,
|
|
@@ -7509,7 +7513,7 @@ var rn = "MenuContent", [Jw, Ea] = ir(rn), Cd = v.forwardRef(
|
|
|
7509
7513
|
...x
|
|
7510
7514
|
} = e, y = ar(rn, n), g = mo(rn, n), w = Os(n), b = vd(n), T = Vw(n), [C, S] = v.useState(null), k = v.useRef(null), E = Je(t, k, y.onContentChange), N = v.useRef(0), M = v.useRef(""), j = v.useRef(0), P = v.useRef(null), $ = v.useRef("right"), I = v.useRef(0), F = m ? Ps : v.Fragment, A = m ? { as: eb, allowPinchZoom: !0 } : void 0, X = (_) => {
|
|
7511
7515
|
var Y, D;
|
|
7512
|
-
const J = M.current + _, G = T().filter((H) => !H.disabled), pe = document.activeElement,
|
|
7516
|
+
const J = M.current + _, G = T().filter((H) => !H.disabled), pe = document.activeElement, ke = (Y = G.find((H) => H.ref.current === pe)) == null ? void 0 : Y.textValue, Ae = G.map((H) => H.textValue), K = fb(Ae, J, ke), oe = (D = G.find((H) => H.textValue === K)) == null ? void 0 : D.ref.current;
|
|
7513
7517
|
(function H(ne) {
|
|
7514
7518
|
M.current = ne, window.clearTimeout(N.current), ne !== "" && (N.current = window.setTimeout(() => H(""), 1e3));
|
|
7515
7519
|
})(J), oe && setTimeout(() => oe.focus());
|
|
@@ -7594,8 +7598,8 @@ var rn = "MenuContent", [Jw, Ea] = ir(rn), Cd = v.forwardRef(
|
|
|
7594
7598
|
ref: E,
|
|
7595
7599
|
style: { outline: "none", ...x.style },
|
|
7596
7600
|
onKeyDown: he(x.onKeyDown, (_) => {
|
|
7597
|
-
const G = _.target.closest("[data-radix-menu-content]") === _.currentTarget, pe = _.ctrlKey || _.altKey || _.metaKey,
|
|
7598
|
-
G && (_.key === "Tab" && _.preventDefault(), !pe &&
|
|
7601
|
+
const G = _.target.closest("[data-radix-menu-content]") === _.currentTarget, pe = _.ctrlKey || _.altKey || _.metaKey, ke = _.key.length === 1;
|
|
7602
|
+
G && (_.key === "Tab" && _.preventDefault(), !pe && ke && X(_.key));
|
|
7599
7603
|
const Ae = k.current;
|
|
7600
7604
|
if (_.target !== Ae || !Hw.includes(_.key)) return;
|
|
7601
7605
|
_.preventDefault();
|
|
@@ -8145,7 +8149,7 @@ const Xb = qb, Jb = Gb, Zb = v.forwardRef(({ className: e, inset: t, children: n
|
|
|
8145
8149
|
cf,
|
|
8146
8150
|
{
|
|
8147
8151
|
ref: o,
|
|
8148
|
-
className:
|
|
8152
|
+
className: ee(
|
|
8149
8153
|
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
8150
8154
|
t && "pl-8",
|
|
8151
8155
|
e
|
|
@@ -8162,7 +8166,7 @@ const Qb = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
8162
8166
|
uf,
|
|
8163
8167
|
{
|
|
8164
8168
|
ref: n,
|
|
8165
|
-
className:
|
|
8169
|
+
className: ee(
|
|
8166
8170
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
8167
8171
|
e
|
|
8168
8172
|
),
|
|
@@ -8175,7 +8179,7 @@ const df = v.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__
|
|
|
8175
8179
|
{
|
|
8176
8180
|
ref: r,
|
|
8177
8181
|
sideOffset: t,
|
|
8178
|
-
className:
|
|
8182
|
+
className: ee(
|
|
8179
8183
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
8180
8184
|
e
|
|
8181
8185
|
),
|
|
@@ -8187,7 +8191,7 @@ const Hi = v.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
|
|
|
8187
8191
|
rf,
|
|
8188
8192
|
{
|
|
8189
8193
|
ref: r,
|
|
8190
|
-
className:
|
|
8194
|
+
className: ee(
|
|
8191
8195
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
8192
8196
|
t && "pl-8",
|
|
8193
8197
|
e
|
|
@@ -8200,7 +8204,7 @@ const e0 = v.forwardRef(({ className: e, children: t, checked: n, ...r }, o) =>
|
|
|
8200
8204
|
of,
|
|
8201
8205
|
{
|
|
8202
8206
|
ref: o,
|
|
8203
|
-
className:
|
|
8207
|
+
className: ee(
|
|
8204
8208
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
8205
8209
|
e
|
|
8206
8210
|
),
|
|
@@ -8217,7 +8221,7 @@ const t0 = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
8217
8221
|
sf,
|
|
8218
8222
|
{
|
|
8219
8223
|
ref: r,
|
|
8220
|
-
className:
|
|
8224
|
+
className: ee(
|
|
8221
8225
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
8222
8226
|
e
|
|
8223
8227
|
),
|
|
@@ -8233,7 +8237,7 @@ const n0 = v.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
|
|
|
8233
8237
|
nf,
|
|
8234
8238
|
{
|
|
8235
8239
|
ref: r,
|
|
8236
|
-
className:
|
|
8240
|
+
className: ee(
|
|
8237
8241
|
"px-2 py-1.5 text-sm font-semibold",
|
|
8238
8242
|
t && "pl-8",
|
|
8239
8243
|
e
|
|
@@ -8246,7 +8250,7 @@ const r0 = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
8246
8250
|
lf,
|
|
8247
8251
|
{
|
|
8248
8252
|
ref: n,
|
|
8249
|
-
className:
|
|
8253
|
+
className: ee("-mx-1 my-1 h-px bg-muted", e),
|
|
8250
8254
|
...t
|
|
8251
8255
|
}
|
|
8252
8256
|
));
|
|
@@ -8337,7 +8341,7 @@ function Pa(e) {
|
|
|
8337
8341
|
function Rt(e) {
|
|
8338
8342
|
return e(ff);
|
|
8339
8343
|
}
|
|
8340
|
-
function
|
|
8344
|
+
function xe(e, t) {
|
|
8341
8345
|
return st(e, l0(t, Ls));
|
|
8342
8346
|
}
|
|
8343
8347
|
function pn(e, t) {
|
|
@@ -8458,7 +8462,7 @@ function Z(e) {
|
|
|
8458
8462
|
};
|
|
8459
8463
|
}
|
|
8460
8464
|
function Ft(e, t) {
|
|
8461
|
-
return $s(Z(t), (n) =>
|
|
8465
|
+
return $s(Z(t), (n) => xe(e, n));
|
|
8462
8466
|
}
|
|
8463
8467
|
function Xe() {
|
|
8464
8468
|
const e = [];
|
|
@@ -8481,7 +8485,7 @@ function Xe() {
|
|
|
8481
8485
|
};
|
|
8482
8486
|
}
|
|
8483
8487
|
function Jt(e) {
|
|
8484
|
-
return $s(Xe(), (t) =>
|
|
8488
|
+
return $s(Xe(), (t) => xe(e, t));
|
|
8485
8489
|
}
|
|
8486
8490
|
function nt(e, t = [], { singleton: n } = { singleton: !0 }) {
|
|
8487
8491
|
return {
|
|
@@ -8671,19 +8675,19 @@ function mf(e, t, n) {
|
|
|
8671
8675
|
const Ht = nt(
|
|
8672
8676
|
() => {
|
|
8673
8677
|
const e = Xe(), t = Xe(), n = Z(0), r = Xe(), o = Z(0), s = Xe(), i = Xe(), a = Z(0), l = Z(0), c = Z(0), d = Z(0), f = Xe(), p = Xe(), h = Z(!1), m = Z(!1), x = Z(!1);
|
|
8674
|
-
return
|
|
8678
|
+
return xe(
|
|
8675
8679
|
U(
|
|
8676
8680
|
e,
|
|
8677
8681
|
ce(({ scrollTop: y }) => y)
|
|
8678
8682
|
),
|
|
8679
8683
|
t
|
|
8680
|
-
),
|
|
8684
|
+
), xe(
|
|
8681
8685
|
U(
|
|
8682
8686
|
e,
|
|
8683
8687
|
ce(({ scrollHeight: y }) => y)
|
|
8684
8688
|
),
|
|
8685
8689
|
i
|
|
8686
|
-
),
|
|
8690
|
+
), xe(t, o), {
|
|
8687
8691
|
deviation: n,
|
|
8688
8692
|
fixedFooterHeight: c,
|
|
8689
8693
|
fixedHeaderHeight: l,
|
|
@@ -9033,7 +9037,7 @@ const A0 = {
|
|
|
9033
9037
|
),
|
|
9034
9038
|
[]
|
|
9035
9039
|
);
|
|
9036
|
-
|
|
9040
|
+
xe(
|
|
9037
9041
|
U(
|
|
9038
9042
|
l,
|
|
9039
9043
|
Ne((C) => C.length > 0),
|
|
@@ -9048,7 +9052,7 @@ const A0 = {
|
|
|
9048
9052
|
})
|
|
9049
9053
|
),
|
|
9050
9054
|
x
|
|
9051
|
-
),
|
|
9055
|
+
), xe(
|
|
9052
9056
|
U(
|
|
9053
9057
|
r,
|
|
9054
9058
|
ze(x),
|
|
@@ -9062,7 +9066,7 @@ const A0 = {
|
|
|
9062
9066
|
])
|
|
9063
9067
|
),
|
|
9064
9068
|
n
|
|
9065
|
-
),
|
|
9069
|
+
), xe(c, d);
|
|
9066
9070
|
const g = Ft(
|
|
9067
9071
|
U(
|
|
9068
9072
|
c,
|
|
@@ -9070,7 +9074,7 @@ const A0 = {
|
|
|
9070
9074
|
),
|
|
9071
9075
|
!0
|
|
9072
9076
|
);
|
|
9073
|
-
|
|
9077
|
+
xe(
|
|
9074
9078
|
U(
|
|
9075
9079
|
d,
|
|
9076
9080
|
Ne((C) => C !== void 0 && ut(Rt(x).sizeTree)),
|
|
@@ -9118,7 +9122,7 @@ const A0 = {
|
|
|
9118
9122
|
);
|
|
9119
9123
|
});
|
|
9120
9124
|
const b = Jt(s);
|
|
9121
|
-
|
|
9125
|
+
xe(
|
|
9122
9126
|
U(
|
|
9123
9127
|
s,
|
|
9124
9128
|
ze(x),
|
|
@@ -9189,7 +9193,7 @@ const A0 = {
|
|
|
9189
9193
|
})
|
|
9190
9194
|
)
|
|
9191
9195
|
);
|
|
9192
|
-
return
|
|
9196
|
+
return xe(
|
|
9193
9197
|
U(
|
|
9194
9198
|
i,
|
|
9195
9199
|
ze(x, h),
|
|
@@ -9264,19 +9268,19 @@ function _0(e) {
|
|
|
9264
9268
|
const kf = nt(
|
|
9265
9269
|
([{ groupIndices: e, sizes: t, totalCount: n }, { headerHeight: r, scrollTop: o }]) => {
|
|
9266
9270
|
const s = Xe(), i = Xe(), a = Jt(U(s, ce(_0)));
|
|
9267
|
-
return
|
|
9271
|
+
return xe(
|
|
9268
9272
|
U(
|
|
9269
9273
|
a,
|
|
9270
9274
|
ce((l) => l.totalCount)
|
|
9271
9275
|
),
|
|
9272
9276
|
n
|
|
9273
|
-
),
|
|
9277
|
+
), xe(
|
|
9274
9278
|
U(
|
|
9275
9279
|
a,
|
|
9276
9280
|
ce((l) => l.groupIndices)
|
|
9277
9281
|
),
|
|
9278
9282
|
e
|
|
9279
|
-
),
|
|
9283
|
+
), xe(
|
|
9280
9284
|
U(
|
|
9281
9285
|
Nt(o, t, r),
|
|
9282
9286
|
Ne(([l, c]) => zs(c)),
|
|
@@ -9328,7 +9332,7 @@ const go = nt(
|
|
|
9328
9332
|
function b() {
|
|
9329
9333
|
y && (y(), y = null), w && (w(), w = null), g && (clearTimeout(g), g = null), $e(l, !1);
|
|
9330
9334
|
}
|
|
9331
|
-
return
|
|
9335
|
+
return xe(
|
|
9332
9336
|
U(
|
|
9333
9337
|
h,
|
|
9334
9338
|
ze(n, f, r, x, a, i, p),
|
|
@@ -9343,15 +9347,15 @@ const go = nt(
|
|
|
9343
9347
|
const F = Rf(T), { align: A, behavior: X, offset: L } = F, _ = k - 1, J = Tf(F, C, _);
|
|
9344
9348
|
let G = no(J, C.offsetTree, P) + N;
|
|
9345
9349
|
A === "end" ? (G += $ + gn(C.sizeTree, J)[1] - S + I, J === _ && (G += M)) : A === "center" ? G += ($ + gn(C.sizeTree, J)[1] - S + I) / 2 : G -= E, L && (G += L);
|
|
9346
|
-
const pe = (
|
|
9347
|
-
b(),
|
|
9350
|
+
const pe = (ke) => {
|
|
9351
|
+
b(), ke ? (j("retrying to scroll to", { location: T }, qt.DEBUG), $e(h, T)) : ($e(m, !0), j("list did not change, scroll successful", {}, qt.DEBUG));
|
|
9348
9352
|
};
|
|
9349
9353
|
if (b(), X === "smooth") {
|
|
9350
|
-
let
|
|
9354
|
+
let ke = !1;
|
|
9351
9355
|
w = st(t, (Ae) => {
|
|
9352
|
-
|
|
9356
|
+
ke = ke || Ae;
|
|
9353
9357
|
}), y = pn(d, () => {
|
|
9354
|
-
pe(
|
|
9358
|
+
pe(ke);
|
|
9355
9359
|
});
|
|
9356
9360
|
} else
|
|
9357
9361
|
y = pn(U(t, P0(150)), pe);
|
|
@@ -9393,7 +9397,7 @@ function $a(e, t) {
|
|
|
9393
9397
|
const xo = nt(
|
|
9394
9398
|
([{ defaultItemSize: e, listRefresh: t, sizes: n }, { scrollTop: r }, { scrollTargetReached: o, scrollToIndex: s }, { didMount: i }]) => {
|
|
9395
9399
|
const a = Z(!0), l = Z(0), c = Z(!0);
|
|
9396
|
-
return
|
|
9400
|
+
return xe(
|
|
9397
9401
|
U(
|
|
9398
9402
|
i,
|
|
9399
9403
|
ze(l),
|
|
@@ -9401,7 +9405,7 @@ const xo = nt(
|
|
|
9401
9405
|
wn(!1)
|
|
9402
9406
|
),
|
|
9403
9407
|
a
|
|
9404
|
-
),
|
|
9408
|
+
), xe(
|
|
9405
9409
|
U(
|
|
9406
9410
|
i,
|
|
9407
9411
|
ze(l),
|
|
@@ -9457,14 +9461,14 @@ const ro = "up", Hr = "down", O0 = "none", M0 = {
|
|
|
9457
9461
|
U(Ui(U(n, wn(!0)), U(n, wn(!1), lc(200))), pt()),
|
|
9458
9462
|
!1
|
|
9459
9463
|
);
|
|
9460
|
-
|
|
9464
|
+
xe(
|
|
9461
9465
|
U(
|
|
9462
9466
|
Nt(Ie(o), Ie(f)),
|
|
9463
9467
|
ce(([w, b]) => w <= b),
|
|
9464
9468
|
pt()
|
|
9465
9469
|
),
|
|
9466
9470
|
a
|
|
9467
|
-
),
|
|
9471
|
+
), xe(U(a, Nn(50)), c);
|
|
9468
9472
|
const m = Jt(
|
|
9469
9473
|
U(
|
|
9470
9474
|
Nt(r, Ie(s), Ie(t), Ie(e), Ie(d)),
|
|
@@ -9526,15 +9530,15 @@ const ro = "up", Hr = "down", O0 = "none", M0 = {
|
|
|
9526
9530
|
),
|
|
9527
9531
|
0
|
|
9528
9532
|
);
|
|
9529
|
-
|
|
9533
|
+
xe(
|
|
9530
9534
|
U(
|
|
9531
9535
|
m,
|
|
9532
9536
|
ce((w) => w.atBottom)
|
|
9533
9537
|
),
|
|
9534
9538
|
i
|
|
9535
|
-
),
|
|
9539
|
+
), xe(U(i, Nn(50)), l);
|
|
9536
9540
|
const y = Z(Hr);
|
|
9537
|
-
|
|
9541
|
+
xe(
|
|
9538
9542
|
U(
|
|
9539
9543
|
r,
|
|
9540
9544
|
ce(({ scrollTop: w }) => w),
|
|
@@ -9546,16 +9550,16 @@ const ro = "up", Hr = "down", O0 = "none", M0 = {
|
|
|
9546
9550
|
ce((w) => w.direction)
|
|
9547
9551
|
),
|
|
9548
9552
|
y
|
|
9549
|
-
),
|
|
9553
|
+
), xe(U(r, Nn(50), wn(O0)), y);
|
|
9550
9554
|
const g = Z(0);
|
|
9551
|
-
return
|
|
9555
|
+
return xe(
|
|
9552
9556
|
U(
|
|
9553
9557
|
p,
|
|
9554
9558
|
Ne((w) => !w),
|
|
9555
9559
|
wn(0)
|
|
9556
9560
|
),
|
|
9557
9561
|
g
|
|
9558
|
-
),
|
|
9562
|
+
), xe(
|
|
9559
9563
|
U(
|
|
9560
9564
|
o,
|
|
9561
9565
|
Nn(100),
|
|
@@ -9736,7 +9740,7 @@ const cr = nt(
|
|
|
9736
9740
|
{ recalcInProgress: m }
|
|
9737
9741
|
]) => {
|
|
9738
9742
|
const x = Z([]), y = Z(0), g = Xe();
|
|
9739
|
-
|
|
9743
|
+
xe(s.topItemsIndexes, x);
|
|
9740
9744
|
const w = Ft(
|
|
9741
9745
|
U(
|
|
9742
9746
|
Nt(
|
|
@@ -9786,12 +9790,12 @@ const cr = nt(
|
|
|
9786
9790
|
);
|
|
9787
9791
|
const J = [];
|
|
9788
9792
|
if (P.length > 0) {
|
|
9789
|
-
const
|
|
9793
|
+
const K = P[0], oe = P[P.length - 1];
|
|
9790
9794
|
let Y = 0;
|
|
9791
|
-
for (const D of Fs(L,
|
|
9792
|
-
const H = D.value, ne = Math.max(D.start,
|
|
9793
|
-
for (let
|
|
9794
|
-
J.push({ data: F == null ? void 0 : F[
|
|
9795
|
+
for (const D of Fs(L, K, oe)) {
|
|
9796
|
+
const H = D.value, ne = Math.max(D.start, K), ie = Math.min(D.end, oe);
|
|
9797
|
+
for (let V = ne; V <= ie; V++)
|
|
9798
|
+
J.push({ data: F == null ? void 0 : F[V], index: V, offset: Y, size: H }), Y += H;
|
|
9795
9799
|
}
|
|
9796
9800
|
}
|
|
9797
9801
|
if (!j)
|
|
@@ -9799,20 +9803,20 @@ const cr = nt(
|
|
|
9799
9803
|
const G = P.length > 0 ? P[P.length - 1] + 1 : 0, pe = k0(X, S, k, G);
|
|
9800
9804
|
if (pe.length === 0)
|
|
9801
9805
|
return null;
|
|
9802
|
-
const
|
|
9806
|
+
const ke = E - 1, Ae = $s([], (K) => {
|
|
9803
9807
|
for (const oe of pe) {
|
|
9804
9808
|
const Y = oe.value;
|
|
9805
9809
|
let D = Y.offset, H = oe.start;
|
|
9806
9810
|
const ne = Y.size;
|
|
9807
9811
|
if (Y.offset < S) {
|
|
9808
9812
|
H += Math.floor((S - Y.offset + I) / (ne + I));
|
|
9809
|
-
const
|
|
9810
|
-
D +=
|
|
9813
|
+
const V = H - oe.start;
|
|
9814
|
+
D += V * ne + V * I;
|
|
9811
9815
|
}
|
|
9812
9816
|
H < G && (D += (G - H) * ne, H = G);
|
|
9813
|
-
const
|
|
9814
|
-
for (let
|
|
9815
|
-
|
|
9817
|
+
const ie = Math.min(oe.end, ke);
|
|
9818
|
+
for (let V = H; V <= ie && !(D >= k); V++)
|
|
9819
|
+
K.push({ data: F == null ? void 0 : F[V], index: V, offset: D, size: ne }), D += ne + I;
|
|
9816
9820
|
}
|
|
9817
9821
|
});
|
|
9818
9822
|
return Uo(Ae, J, E, I, A, $);
|
|
@@ -9824,26 +9828,26 @@ const cr = nt(
|
|
|
9824
9828
|
),
|
|
9825
9829
|
yi
|
|
9826
9830
|
);
|
|
9827
|
-
|
|
9831
|
+
xe(
|
|
9828
9832
|
U(
|
|
9829
9833
|
e,
|
|
9830
9834
|
Ne(ja),
|
|
9831
9835
|
ce((S) => S == null ? void 0 : S.length)
|
|
9832
9836
|
),
|
|
9833
9837
|
o
|
|
9834
|
-
),
|
|
9838
|
+
), xe(
|
|
9835
9839
|
U(
|
|
9836
9840
|
w,
|
|
9837
9841
|
ce((S) => S.topListHeight)
|
|
9838
9842
|
),
|
|
9839
9843
|
f
|
|
9840
|
-
),
|
|
9844
|
+
), xe(f, a), xe(
|
|
9841
9845
|
U(
|
|
9842
9846
|
w,
|
|
9843
9847
|
ce((S) => [S.top, S.bottom])
|
|
9844
9848
|
),
|
|
9845
9849
|
i
|
|
9846
|
-
),
|
|
9850
|
+
), xe(
|
|
9847
9851
|
U(
|
|
9848
9852
|
w,
|
|
9849
9853
|
ce((S) => S.items)
|
|
@@ -9908,7 +9912,7 @@ const cr = nt(
|
|
|
9908
9912
|
),
|
|
9909
9913
|
0
|
|
9910
9914
|
);
|
|
9911
|
-
return
|
|
9915
|
+
return xe(Ie(i), s), { totalListHeight: i, totalListHeightChanged: s };
|
|
9912
9916
|
},
|
|
9913
9917
|
ht(Ht, cr),
|
|
9914
9918
|
{ singleton: !0 }
|
|
@@ -9943,7 +9947,7 @@ const cr = nt(
|
|
|
9943
9947
|
{ scrollToIndex: c }
|
|
9944
9948
|
]) => {
|
|
9945
9949
|
const d = Xe();
|
|
9946
|
-
return
|
|
9950
|
+
return xe(
|
|
9947
9951
|
U(
|
|
9948
9952
|
d,
|
|
9949
9953
|
ze(t, l, n, s, o, r, a),
|
|
@@ -10045,7 +10049,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = nt(
|
|
|
10045
10049
|
C && !S.atBottom && S.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && g("auto");
|
|
10046
10050
|
});
|
|
10047
10051
|
const b = Z(null), T = Xe();
|
|
10048
|
-
return
|
|
10052
|
+
return xe(
|
|
10049
10053
|
Ui(
|
|
10050
10054
|
U(
|
|
10051
10055
|
Ie(r),
|
|
@@ -10086,7 +10090,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = nt(
|
|
|
10086
10090
|
_f
|
|
10087
10091
|
)
|
|
10088
10092
|
), H0 = nt(
|
|
10089
|
-
([{ data: e, firstItemIndex: t, gap: n, sizes: r }, { initialTopMostItemIndex: o }, { initialItemCount: s, listState: i }, { didMount: a }]) => (
|
|
10093
|
+
([{ data: e, firstItemIndex: t, gap: n, sizes: r }, { initialTopMostItemIndex: o }, { initialItemCount: s, listState: i }, { didMount: a }]) => (xe(
|
|
10090
10094
|
U(
|
|
10091
10095
|
a,
|
|
10092
10096
|
ze(s),
|
|
@@ -10131,7 +10135,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = nt(
|
|
|
10131
10135
|
), jf = nt(
|
|
10132
10136
|
([{ scrollVelocity: e }]) => {
|
|
10133
10137
|
const t = Z(!1), n = Xe(), r = Z(!1);
|
|
10134
|
-
return
|
|
10138
|
+
return xe(
|
|
10135
10139
|
U(
|
|
10136
10140
|
e,
|
|
10137
10141
|
ze(r, t, n),
|
|
@@ -10159,7 +10163,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = nt(
|
|
|
10159
10163
|
{ singleton: !0 }
|
|
10160
10164
|
), za = nt(([{ scrollContainerState: e, scrollTo: t }]) => {
|
|
10161
10165
|
const n = Xe(), r = Xe(), o = Xe(), s = Z(!1), i = Z(void 0);
|
|
10162
|
-
return
|
|
10166
|
+
return xe(
|
|
10163
10167
|
U(
|
|
10164
10168
|
Nt(n, r),
|
|
10165
10169
|
ce(([{ scrollHeight: a, scrollTop: l, viewportHeight: c }, { offsetTop: d }]) => ({
|
|
@@ -10169,7 +10173,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = nt(
|
|
|
10169
10173
|
}))
|
|
10170
10174
|
),
|
|
10171
10175
|
e
|
|
10172
|
-
),
|
|
10176
|
+
), xe(
|
|
10173
10177
|
U(
|
|
10174
10178
|
t,
|
|
10175
10179
|
ze(r),
|
|
@@ -10198,7 +10202,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = nt(
|
|
|
10198
10202
|
{ useWindowScroll: i, windowScrollContainerState: a, windowViewportRect: l }
|
|
10199
10203
|
]) => {
|
|
10200
10204
|
const c = Xe(), d = Z(void 0), f = Z(null), p = Z(null);
|
|
10201
|
-
return
|
|
10205
|
+
return xe(a, f), xe(l, p), st(
|
|
10202
10206
|
U(
|
|
10203
10207
|
c,
|
|
10204
10208
|
ze(t, r, i, f, p, n)
|
|
@@ -10207,7 +10211,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = nt(
|
|
|
10207
10211
|
const T = E0(m.sizeTree);
|
|
10208
10212
|
y && g !== null && w !== null && (x = g.scrollTop - w.offsetTop), x -= b, h({ ranges: T, scrollTop: x });
|
|
10209
10213
|
}
|
|
10210
|
-
),
|
|
10214
|
+
), xe(U(d, Ne(ja), ce(V0)), o), xe(
|
|
10211
10215
|
U(
|
|
10212
10216
|
s,
|
|
10213
10217
|
ze(d),
|
|
@@ -10228,7 +10232,7 @@ function V0(e) {
|
|
|
10228
10232
|
}
|
|
10229
10233
|
const K0 = nt(([{ topItemsIndexes: e }]) => {
|
|
10230
10234
|
const t = Z(0);
|
|
10231
|
-
return
|
|
10235
|
+
return xe(
|
|
10232
10236
|
U(
|
|
10233
10237
|
t,
|
|
10234
10238
|
Ne((n) => n >= 0),
|
|
@@ -10281,7 +10285,7 @@ const q0 = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10281
10285
|
Nn(1)
|
|
10282
10286
|
),
|
|
10283
10287
|
y
|
|
10284
|
-
),
|
|
10288
|
+
), xe(
|
|
10285
10289
|
U(
|
|
10286
10290
|
f,
|
|
10287
10291
|
ce((g) => ({ top: -g }))
|
|
@@ -10385,7 +10389,7 @@ const q0 = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10385
10389
|
{ topItemCount: k },
|
|
10386
10390
|
{ groupCounts: E },
|
|
10387
10391
|
N
|
|
10388
|
-
]) => (
|
|
10392
|
+
]) => (xe(T.rangeChanged, N.scrollSeekRangeChanged), xe(
|
|
10389
10393
|
U(
|
|
10390
10394
|
N.windowViewportRect,
|
|
10391
10395
|
ce((M) => M.visibleHeight)
|
|
@@ -10990,7 +10994,7 @@ const bS = /* @__PURE__ */ nt(
|
|
|
10990
10994
|
), st(
|
|
10991
10995
|
U(
|
|
10992
10996
|
Nt(m, J, M, N, _, G),
|
|
10993
|
-
Ne(([D, H, ne,
|
|
10997
|
+
Ne(([D, H, ne, ie, , V]) => D && !H && ne.height !== 0 && ie.height !== 0 && !V)
|
|
10994
10998
|
),
|
|
10995
10999
|
([, , , , D]) => {
|
|
10996
11000
|
$e(G, !0), La(1, () => {
|
|
@@ -10999,7 +11003,7 @@ const bS = /* @__PURE__ */ nt(
|
|
|
10999
11003
|
$e(t, [0, 0]), $e(J, !0);
|
|
11000
11004
|
});
|
|
11001
11005
|
}
|
|
11002
|
-
),
|
|
11006
|
+
), xe(
|
|
11003
11007
|
U(
|
|
11004
11008
|
X,
|
|
11005
11009
|
Ne((D) => D != null && D.scrollTop > 0),
|
|
@@ -11017,13 +11021,13 @@ const bS = /* @__PURE__ */ nt(
|
|
|
11017
11021
|
$e(L, !1);
|
|
11018
11022
|
}), $e(l, { top: D.scrollTop })));
|
|
11019
11023
|
}
|
|
11020
|
-
),
|
|
11024
|
+
), xe(
|
|
11021
11025
|
U(
|
|
11022
11026
|
N,
|
|
11023
11027
|
ce(({ height: D }) => D)
|
|
11024
11028
|
),
|
|
11025
11029
|
f
|
|
11026
|
-
),
|
|
11030
|
+
), xe(
|
|
11027
11031
|
U(
|
|
11028
11032
|
Nt(
|
|
11029
11033
|
Ie(N, Ao),
|
|
@@ -11031,15 +11035,15 @@ const bS = /* @__PURE__ */ nt(
|
|
|
11031
11035
|
Ie(F, (D, H) => D && D.column === H.column && D.row === H.row),
|
|
11032
11036
|
Ie(c)
|
|
11033
11037
|
),
|
|
11034
|
-
ce(([D, H, ne,
|
|
11038
|
+
ce(([D, H, ne, ie]) => ({
|
|
11035
11039
|
gap: ne,
|
|
11036
11040
|
item: H,
|
|
11037
|
-
scrollTop:
|
|
11041
|
+
scrollTop: ie,
|
|
11038
11042
|
viewport: D
|
|
11039
11043
|
}))
|
|
11040
11044
|
),
|
|
11041
11045
|
A
|
|
11042
|
-
),
|
|
11046
|
+
), xe(
|
|
11043
11047
|
U(
|
|
11044
11048
|
Nt(
|
|
11045
11049
|
Ie(S),
|
|
@@ -11058,72 +11062,72 @@ const bS = /* @__PURE__ */ nt(
|
|
|
11058
11062
|
([
|
|
11059
11063
|
D,
|
|
11060
11064
|
[H, ne],
|
|
11061
|
-
|
|
11062
|
-
|
|
11065
|
+
ie,
|
|
11066
|
+
V,
|
|
11063
11067
|
Me,
|
|
11064
11068
|
Ue,
|
|
11065
11069
|
Ze,
|
|
11066
11070
|
,
|
|
11067
11071
|
re,
|
|
11068
|
-
|
|
11072
|
+
ge
|
|
11069
11073
|
]) => {
|
|
11070
|
-
const { column: Le, row: Fe } =
|
|
11074
|
+
const { column: Le, row: Fe } = ie, { height: Pe, width: et } = V, { width: We } = Me;
|
|
11071
11075
|
if (Ze === 0 && (D === 0 || We === 0))
|
|
11072
11076
|
return vc;
|
|
11073
11077
|
if (et === 0) {
|
|
11074
|
-
const Ve = $a(
|
|
11078
|
+
const Ve = $a(ge, D), jt = Ve + Math.max(Ze - 1, 0);
|
|
11075
11079
|
return vS(Sc(Ve, jt, Ue));
|
|
11076
11080
|
}
|
|
11077
11081
|
const Ge = Uf(We, et, Le);
|
|
11078
11082
|
let qe, Qe;
|
|
11079
11083
|
re ? H === 0 && ne === 0 && Ze > 0 ? (qe = 0, Qe = Ze - 1) : (qe = Ge * os((H + Fe) / (Pe + Fe)), Qe = Ge * wc((ne + Fe) / (Pe + Fe)) - 1, Qe = bi(D - 1, Ur(Qe, Ge - 1)), qe = bi(Qe, Ur(0, qe))) : (qe = 0, Qe = -1);
|
|
11080
|
-
const St = Sc(qe, Qe, Ue), { bottom: mt, top: gt } = Cc(Me,
|
|
11084
|
+
const St = Sc(qe, Qe, Ue), { bottom: mt, top: gt } = Cc(Me, ie, V, St), ft = wc(D / Ge), it = ft * Pe + (ft - 1) * Fe - mt;
|
|
11081
11085
|
return { bottom: mt, itemHeight: Pe, items: St, itemWidth: et, offsetBottom: it, offsetTop: gt, top: gt };
|
|
11082
11086
|
}
|
|
11083
11087
|
)
|
|
11084
11088
|
),
|
|
11085
11089
|
E
|
|
11086
|
-
),
|
|
11090
|
+
), xe(
|
|
11087
11091
|
U(
|
|
11088
11092
|
I,
|
|
11089
11093
|
Ne((D) => D !== null),
|
|
11090
11094
|
ce((D) => D.length)
|
|
11091
11095
|
),
|
|
11092
11096
|
S
|
|
11093
|
-
),
|
|
11097
|
+
), xe(
|
|
11094
11098
|
U(
|
|
11095
11099
|
Nt(N, M, E, F),
|
|
11096
11100
|
Ne(([D, H, { items: ne }]) => ne.length > 0 && H.height !== 0 && D.height !== 0),
|
|
11097
|
-
ce(([D, H, { items: ne },
|
|
11098
|
-
const { bottom:
|
|
11099
|
-
return [Me,
|
|
11101
|
+
ce(([D, H, { items: ne }, ie]) => {
|
|
11102
|
+
const { bottom: V, top: Me } = Cc(D, ie, H, ne);
|
|
11103
|
+
return [Me, V];
|
|
11100
11104
|
}),
|
|
11101
11105
|
pt(to)
|
|
11102
11106
|
),
|
|
11103
11107
|
t
|
|
11104
11108
|
);
|
|
11105
|
-
const
|
|
11106
|
-
|
|
11109
|
+
const ke = Z(!1);
|
|
11110
|
+
xe(
|
|
11107
11111
|
U(
|
|
11108
11112
|
c,
|
|
11109
|
-
ze(
|
|
11113
|
+
ze(ke),
|
|
11110
11114
|
ce(([D, H]) => H || D !== 0)
|
|
11111
11115
|
),
|
|
11112
|
-
|
|
11116
|
+
ke
|
|
11113
11117
|
);
|
|
11114
11118
|
const Ae = Jt(
|
|
11115
11119
|
U(
|
|
11116
11120
|
Nt(E, S),
|
|
11117
11121
|
Ne(([{ items: D }]) => D.length > 0),
|
|
11118
|
-
ze(
|
|
11122
|
+
ze(ke),
|
|
11119
11123
|
Ne(([[D, H], ne]) => {
|
|
11120
|
-
const
|
|
11121
|
-
return (ne || D.bottom > 0 && D.itemHeight > 0 && D.offsetBottom === 0 && D.items.length === H) &&
|
|
11124
|
+
const ie = D.items[D.items.length - 1].index === H - 1;
|
|
11125
|
+
return (ne || D.bottom > 0 && D.itemHeight > 0 && D.offsetBottom === 0 && D.items.length === H) && ie;
|
|
11122
11126
|
}),
|
|
11123
11127
|
ce(([[, D]]) => D - 1),
|
|
11124
11128
|
pt()
|
|
11125
11129
|
)
|
|
11126
|
-
),
|
|
11130
|
+
), K = Jt(
|
|
11127
11131
|
U(
|
|
11128
11132
|
Ie(E),
|
|
11129
11133
|
Ne(({ items: D }) => D.length > 0 && D[0].index === 0),
|
|
@@ -11143,15 +11147,15 @@ const bS = /* @__PURE__ */ nt(
|
|
|
11143
11147
|
Nn(0)
|
|
11144
11148
|
)
|
|
11145
11149
|
);
|
|
11146
|
-
|
|
11150
|
+
xe(oe, h.scrollSeekRangeChanged), xe(
|
|
11147
11151
|
U(
|
|
11148
11152
|
j,
|
|
11149
11153
|
ze(N, M, S, F),
|
|
11150
|
-
ce(([D, H, ne,
|
|
11154
|
+
ce(([D, H, ne, ie, V]) => {
|
|
11151
11155
|
const Me = Rf(D), { align: Ue, behavior: Ze, offset: re } = Me;
|
|
11152
|
-
let
|
|
11153
|
-
|
|
11154
|
-
let Le = Gi(H,
|
|
11156
|
+
let ge = Me.index;
|
|
11157
|
+
ge === "LAST" && (ge = ie - 1), ge = Ur(0, ge, bi(ie - 1, ge));
|
|
11158
|
+
let Le = Gi(H, V, ne, ge);
|
|
11155
11159
|
return Ue === "end" ? Le = bc(Le - H.height + ne.height) : Ue === "center" && (Le = bc(Le - H.height / 2 + ne.height / 2)), re && (Le += re), { behavior: Ze, top: Le };
|
|
11156
11160
|
})
|
|
11157
11161
|
),
|
|
@@ -11164,7 +11168,7 @@ const bS = /* @__PURE__ */ nt(
|
|
|
11164
11168
|
),
|
|
11165
11169
|
0
|
|
11166
11170
|
);
|
|
11167
|
-
return
|
|
11171
|
+
return xe(
|
|
11168
11172
|
U(
|
|
11169
11173
|
T,
|
|
11170
11174
|
ce((D) => ({ height: D.visibleHeight, width: D.visibleWidth }))
|
|
@@ -11206,7 +11210,7 @@ const bS = /* @__PURE__ */ nt(
|
|
|
11206
11210
|
endReached: Ae,
|
|
11207
11211
|
propsReady: x,
|
|
11208
11212
|
rangeChanged: oe,
|
|
11209
|
-
startReached:
|
|
11213
|
+
startReached: K,
|
|
11210
11214
|
stateChanged: A,
|
|
11211
11215
|
stateRestoreInProgress: L,
|
|
11212
11216
|
...C
|
|
@@ -11237,7 +11241,7 @@ const SS = /* @__PURE__ */ nt(() => {
|
|
|
11237
11241
|
),
|
|
11238
11242
|
p
|
|
11239
11243
|
), c = Z(!1), d = Z(!1);
|
|
11240
|
-
return
|
|
11244
|
+
return xe(Ie(d), c), {
|
|
11241
11245
|
components: t,
|
|
11242
11246
|
computeItemKey: s,
|
|
11243
11247
|
context: n,
|
|
@@ -11429,13 +11433,13 @@ const jS = gs(
|
|
|
11429
11433
|
}
|
|
11430
11434
|
);
|
|
11431
11435
|
function Vf({ className: e, variant: t, ...n }) {
|
|
11432
|
-
return /* @__PURE__ */ u.jsx("div", { className:
|
|
11436
|
+
return /* @__PURE__ */ u.jsx("div", { className: ee(jS({ variant: t }), e), ...n });
|
|
11433
11437
|
}
|
|
11434
11438
|
const Wr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
11435
11439
|
"div",
|
|
11436
11440
|
{
|
|
11437
11441
|
ref: n,
|
|
11438
|
-
className:
|
|
11442
|
+
className: ee(
|
|
11439
11443
|
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
11440
11444
|
e
|
|
11441
11445
|
),
|
|
@@ -11447,7 +11451,7 @@ const Vr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
11447
11451
|
"div",
|
|
11448
11452
|
{
|
|
11449
11453
|
ref: n,
|
|
11450
|
-
className:
|
|
11454
|
+
className: ee("flex flex-col space-y-1.5 p-6", e),
|
|
11451
11455
|
...t
|
|
11452
11456
|
}
|
|
11453
11457
|
));
|
|
@@ -11456,7 +11460,7 @@ const Kr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
11456
11460
|
"h3",
|
|
11457
11461
|
{
|
|
11458
11462
|
ref: n,
|
|
11459
|
-
className:
|
|
11463
|
+
className: ee(
|
|
11460
11464
|
"text-2xl font-semibold leading-none tracking-tight",
|
|
11461
11465
|
e
|
|
11462
11466
|
),
|
|
@@ -11468,18 +11472,18 @@ const Kf = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
11468
11472
|
"p",
|
|
11469
11473
|
{
|
|
11470
11474
|
ref: n,
|
|
11471
|
-
className:
|
|
11475
|
+
className: ee("text-sm text-muted-foreground", e),
|
|
11472
11476
|
...t
|
|
11473
11477
|
}
|
|
11474
11478
|
));
|
|
11475
11479
|
Kf.displayName = "CardDescription";
|
|
11476
|
-
const qr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx("div", { ref: n, className:
|
|
11480
|
+
const qr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx("div", { ref: n, className: ee("p-6 pt-0", e), ...t }));
|
|
11477
11481
|
qr.displayName = "CardContent";
|
|
11478
11482
|
const qf = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
11479
11483
|
"div",
|
|
11480
11484
|
{
|
|
11481
11485
|
ref: n,
|
|
11482
|
-
className:
|
|
11486
|
+
className: ee("flex items-center p-6 pt-0", e),
|
|
11483
11487
|
...t
|
|
11484
11488
|
}
|
|
11485
11489
|
));
|
|
@@ -11922,7 +11926,7 @@ const ZS = fp, QS = pp, mp = v.forwardRef(({ className: e, ...t }, n) => /* @__P
|
|
|
11922
11926
|
Us,
|
|
11923
11927
|
{
|
|
11924
11928
|
ref: n,
|
|
11925
|
-
className:
|
|
11929
|
+
className: ee(
|
|
11926
11930
|
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
11927
11931
|
e
|
|
11928
11932
|
),
|
|
@@ -11952,7 +11956,7 @@ const gp = v.forwardRef(({ className: e, children: t, ...n }, r) => {
|
|
|
11952
11956
|
Ws,
|
|
11953
11957
|
{
|
|
11954
11958
|
ref: r,
|
|
11955
|
-
className:
|
|
11959
|
+
className: ee(
|
|
11956
11960
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
11957
11961
|
e
|
|
11958
11962
|
),
|
|
@@ -11976,7 +11980,7 @@ const xp = ({
|
|
|
11976
11980
|
}) => /* @__PURE__ */ u.jsx(
|
|
11977
11981
|
"div",
|
|
11978
11982
|
{
|
|
11979
|
-
className:
|
|
11983
|
+
className: ee(
|
|
11980
11984
|
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
11981
11985
|
e
|
|
11982
11986
|
),
|
|
@@ -11988,7 +11992,7 @@ const yp = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
11988
11992
|
Zn,
|
|
11989
11993
|
{
|
|
11990
11994
|
ref: n,
|
|
11991
|
-
className:
|
|
11995
|
+
className: ee(
|
|
11992
11996
|
"text-lg font-semibold leading-none tracking-tight",
|
|
11993
11997
|
e
|
|
11994
11998
|
),
|
|
@@ -12000,13 +12004,13 @@ const eC = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
12000
12004
|
Vs,
|
|
12001
12005
|
{
|
|
12002
12006
|
ref: n,
|
|
12003
|
-
className:
|
|
12007
|
+
className: ee("text-sm text-muted-foreground", e),
|
|
12004
12008
|
...t
|
|
12005
12009
|
}
|
|
12006
12010
|
));
|
|
12007
12011
|
eC.displayName = Vs.displayName;
|
|
12008
12012
|
function tC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
12009
|
-
const [s, i] =
|
|
12013
|
+
const [s, i] = be(!1), [a, l] = be(null), [c, d] = be(null), { toast: f } = Wa(), p = z.useCallback(async () => {
|
|
12010
12014
|
if (n) {
|
|
12011
12015
|
i(!0), d(null), l(null);
|
|
12012
12016
|
try {
|
|
@@ -13495,7 +13499,7 @@ function kp(e, t) {
|
|
|
13495
13499
|
return (n, r, o) => {
|
|
13496
13500
|
typeof r == "function" && (o = r, r = null);
|
|
13497
13501
|
const s = { ...r };
|
|
13498
|
-
r = { ...
|
|
13502
|
+
r = { ...ye.defaults, ...s };
|
|
13499
13503
|
const i = yC(r.silent, r.async, o);
|
|
13500
13504
|
if (typeof n > "u" || n === null)
|
|
13501
13505
|
return i(new Error("marked(): input parameter is undefined or null"));
|
|
@@ -13513,7 +13517,7 @@ function kp(e, t) {
|
|
|
13513
13517
|
let p;
|
|
13514
13518
|
if (!f)
|
|
13515
13519
|
try {
|
|
13516
|
-
r.walkTokens &&
|
|
13520
|
+
r.walkTokens && ye.walkTokens(l, r.walkTokens), p = t(l, r), r.hooks && (p = r.hooks.postprocess(p));
|
|
13517
13521
|
} catch (h) {
|
|
13518
13522
|
f = h;
|
|
13519
13523
|
}
|
|
@@ -13521,7 +13525,7 @@ function kp(e, t) {
|
|
|
13521
13525
|
};
|
|
13522
13526
|
if (!a || a.length < 3 || (delete r.highlight, !l.length)) return c();
|
|
13523
13527
|
let d = 0;
|
|
13524
|
-
|
|
13528
|
+
ye.walkTokens(l, function(f) {
|
|
13525
13529
|
f.type === "code" && (d++, setTimeout(() => {
|
|
13526
13530
|
a(f.text, f.lang, function(p, h) {
|
|
13527
13531
|
if (p)
|
|
@@ -13533,11 +13537,11 @@ function kp(e, t) {
|
|
|
13533
13537
|
return;
|
|
13534
13538
|
}
|
|
13535
13539
|
if (r.async)
|
|
13536
|
-
return Promise.resolve(r.hooks ? r.hooks.preprocess(n) : n).then((a) => e(a, r)).then((a) => r.walkTokens ? Promise.all(
|
|
13540
|
+
return Promise.resolve(r.hooks ? r.hooks.preprocess(n) : n).then((a) => e(a, r)).then((a) => r.walkTokens ? Promise.all(ye.walkTokens(a, r.walkTokens)).then(() => a) : a).then((a) => t(a, r)).then((a) => r.hooks ? r.hooks.postprocess(a) : a).catch(i);
|
|
13537
13541
|
try {
|
|
13538
13542
|
r.hooks && (n = r.hooks.preprocess(n));
|
|
13539
13543
|
const a = e(n, r);
|
|
13540
|
-
r.walkTokens &&
|
|
13544
|
+
r.walkTokens && ye.walkTokens(a, r.walkTokens);
|
|
13541
13545
|
let l = t(a, r);
|
|
13542
13546
|
return r.hooks && (l = r.hooks.postprocess(l)), l;
|
|
13543
13547
|
} catch (a) {
|
|
@@ -13545,19 +13549,19 @@ function kp(e, t) {
|
|
|
13545
13549
|
}
|
|
13546
13550
|
};
|
|
13547
13551
|
}
|
|
13548
|
-
function
|
|
13552
|
+
function ye(e, t, n) {
|
|
13549
13553
|
return kp(Bn.lex, Hn.parse)(e, t, n);
|
|
13550
13554
|
}
|
|
13551
|
-
|
|
13552
|
-
return
|
|
13555
|
+
ye.options = ye.setOptions = function(e) {
|
|
13556
|
+
return ye.defaults = { ...ye.defaults, ...e }, nC(ye.defaults), ye;
|
|
13553
13557
|
};
|
|
13554
|
-
|
|
13555
|
-
|
|
13556
|
-
|
|
13557
|
-
const t =
|
|
13558
|
+
ye.getDefaults = vp;
|
|
13559
|
+
ye.defaults = ur;
|
|
13560
|
+
ye.use = function(...e) {
|
|
13561
|
+
const t = ye.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
13558
13562
|
e.forEach((n) => {
|
|
13559
13563
|
const r = { ...n };
|
|
13560
|
-
if (r.async =
|
|
13564
|
+
if (r.async = ye.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((o) => {
|
|
13561
13565
|
if (!o.name)
|
|
13562
13566
|
throw new Error("extension name required");
|
|
13563
13567
|
if (o.renderer) {
|
|
@@ -13574,7 +13578,7 @@ xe.use = function(...e) {
|
|
|
13574
13578
|
}
|
|
13575
13579
|
o.childTokens && (t.childTokens[o.name] = o.childTokens);
|
|
13576
13580
|
}), r.extensions = t), n.renderer) {
|
|
13577
|
-
const o =
|
|
13581
|
+
const o = ye.defaults.renderer || new Xa();
|
|
13578
13582
|
for (const s in n.renderer) {
|
|
13579
13583
|
const i = o[s];
|
|
13580
13584
|
o[s] = (...a) => {
|
|
@@ -13585,7 +13589,7 @@ xe.use = function(...e) {
|
|
|
13585
13589
|
r.renderer = o;
|
|
13586
13590
|
}
|
|
13587
13591
|
if (n.tokenizer) {
|
|
13588
|
-
const o =
|
|
13592
|
+
const o = ye.defaults.tokenizer || new Ya();
|
|
13589
13593
|
for (const s in n.tokenizer) {
|
|
13590
13594
|
const i = o[s];
|
|
13591
13595
|
o[s] = (...a) => {
|
|
@@ -13596,11 +13600,11 @@ xe.use = function(...e) {
|
|
|
13596
13600
|
r.tokenizer = o;
|
|
13597
13601
|
}
|
|
13598
13602
|
if (n.hooks) {
|
|
13599
|
-
const o =
|
|
13603
|
+
const o = ye.defaults.hooks || new ls();
|
|
13600
13604
|
for (const s in n.hooks) {
|
|
13601
13605
|
const i = o[s];
|
|
13602
13606
|
ls.passThroughHooks.has(s) ? o[s] = (a) => {
|
|
13603
|
-
if (
|
|
13607
|
+
if (ye.defaults.async)
|
|
13604
13608
|
return Promise.resolve(n.hooks[s].call(o, a)).then((c) => i.call(o, c));
|
|
13605
13609
|
const l = n.hooks[s].call(o, a);
|
|
13606
13610
|
return i.call(o, l);
|
|
@@ -13612,54 +13616,54 @@ xe.use = function(...e) {
|
|
|
13612
13616
|
r.hooks = o;
|
|
13613
13617
|
}
|
|
13614
13618
|
if (n.walkTokens) {
|
|
13615
|
-
const o =
|
|
13619
|
+
const o = ye.defaults.walkTokens;
|
|
13616
13620
|
r.walkTokens = function(s) {
|
|
13617
13621
|
let i = [];
|
|
13618
13622
|
return i.push(n.walkTokens.call(this, s)), o && (i = i.concat(o.call(this, s))), i;
|
|
13619
13623
|
};
|
|
13620
13624
|
}
|
|
13621
|
-
|
|
13625
|
+
ye.setOptions(r);
|
|
13622
13626
|
});
|
|
13623
13627
|
};
|
|
13624
|
-
|
|
13628
|
+
ye.walkTokens = function(e, t) {
|
|
13625
13629
|
let n = [];
|
|
13626
13630
|
for (const r of e)
|
|
13627
|
-
switch (n = n.concat(t.call(
|
|
13631
|
+
switch (n = n.concat(t.call(ye, r)), r.type) {
|
|
13628
13632
|
case "table": {
|
|
13629
13633
|
for (const o of r.header)
|
|
13630
|
-
n = n.concat(
|
|
13634
|
+
n = n.concat(ye.walkTokens(o.tokens, t));
|
|
13631
13635
|
for (const o of r.rows)
|
|
13632
13636
|
for (const s of o)
|
|
13633
|
-
n = n.concat(
|
|
13637
|
+
n = n.concat(ye.walkTokens(s.tokens, t));
|
|
13634
13638
|
break;
|
|
13635
13639
|
}
|
|
13636
13640
|
case "list": {
|
|
13637
|
-
n = n.concat(
|
|
13641
|
+
n = n.concat(ye.walkTokens(r.items, t));
|
|
13638
13642
|
break;
|
|
13639
13643
|
}
|
|
13640
13644
|
default:
|
|
13641
|
-
|
|
13642
|
-
n = n.concat(
|
|
13643
|
-
}) : r.tokens && (n = n.concat(
|
|
13645
|
+
ye.defaults.extensions && ye.defaults.extensions.childTokens && ye.defaults.extensions.childTokens[r.type] ? ye.defaults.extensions.childTokens[r.type].forEach(function(o) {
|
|
13646
|
+
n = n.concat(ye.walkTokens(r[o], t));
|
|
13647
|
+
}) : r.tokens && (n = n.concat(ye.walkTokens(r.tokens, t)));
|
|
13644
13648
|
}
|
|
13645
13649
|
return n;
|
|
13646
13650
|
};
|
|
13647
|
-
|
|
13648
|
-
|
|
13649
|
-
|
|
13650
|
-
|
|
13651
|
-
|
|
13652
|
-
|
|
13653
|
-
|
|
13654
|
-
|
|
13655
|
-
|
|
13656
|
-
|
|
13657
|
-
|
|
13658
|
-
|
|
13659
|
-
|
|
13660
|
-
|
|
13661
|
-
|
|
13662
|
-
|
|
13651
|
+
ye.parseInline = kp(Bn.lexInline, Hn.parseInline);
|
|
13652
|
+
ye.Parser = Hn;
|
|
13653
|
+
ye.parser = Hn.parse;
|
|
13654
|
+
ye.Renderer = Xa;
|
|
13655
|
+
ye.TextRenderer = Cp;
|
|
13656
|
+
ye.Lexer = Bn;
|
|
13657
|
+
ye.lexer = Bn.lex;
|
|
13658
|
+
ye.Tokenizer = Ya;
|
|
13659
|
+
ye.Slugger = Tp;
|
|
13660
|
+
ye.Hooks = ls;
|
|
13661
|
+
ye.parse = ye;
|
|
13662
|
+
ye.options;
|
|
13663
|
+
ye.setOptions;
|
|
13664
|
+
ye.use;
|
|
13665
|
+
ye.walkTokens;
|
|
13666
|
+
ye.parseInline;
|
|
13663
13667
|
Hn.parse;
|
|
13664
13668
|
Bn.lex;
|
|
13665
13669
|
function cs({
|
|
@@ -13672,9 +13676,9 @@ function cs({
|
|
|
13672
13676
|
try {
|
|
13673
13677
|
if (!n) {
|
|
13674
13678
|
const i = e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi, "").replace(/javascript:/gi, "").replace(/on\w+\s*=/gi, "");
|
|
13675
|
-
return typeof
|
|
13679
|
+
return typeof ye.parse == "function" ? ye.parse(i) : ye(i);
|
|
13676
13680
|
}
|
|
13677
|
-
return typeof
|
|
13681
|
+
return typeof ye.parse == "function" ? ye.parse(e) : ye(e);
|
|
13678
13682
|
} catch (i) {
|
|
13679
13683
|
return console.error("[MarkdownContent] parse error", i), `<pre class="font-mono text-xs bg-background/50 rounded border p-2 whitespace-pre-wrap break-words">Error rendering markdown: ${String(i)}</pre>`;
|
|
13680
13684
|
}
|
|
@@ -13709,7 +13713,7 @@ function cs({
|
|
|
13709
13713
|
return /* @__PURE__ */ u.jsx(
|
|
13710
13714
|
"div",
|
|
13711
13715
|
{
|
|
13712
|
-
className:
|
|
13716
|
+
className: ee(
|
|
13713
13717
|
"markdown prose prose-sm max-w-none break-words",
|
|
13714
13718
|
// In dark mode, use prose-invert for better contrast in dark bubbles
|
|
13715
13719
|
"dark:prose-invert",
|
|
@@ -13780,7 +13784,7 @@ function Pc(e) {
|
|
|
13780
13784
|
return `${e.id}:${t}:${n}`;
|
|
13781
13785
|
}
|
|
13782
13786
|
function CC({ className: e }) {
|
|
13783
|
-
const [t, n] =
|
|
13787
|
+
const [t, n] = be(0);
|
|
13784
13788
|
return Et(() => {
|
|
13785
13789
|
const r = setInterval(() => n((o) => (o + 1) % 4), 500);
|
|
13786
13790
|
return () => clearInterval(r);
|
|
@@ -13788,7 +13792,7 @@ function CC({ className: e }) {
|
|
|
13788
13792
|
"span",
|
|
13789
13793
|
{
|
|
13790
13794
|
"aria-live": "polite",
|
|
13791
|
-
className:
|
|
13795
|
+
className: ee("inline-block text-xs opacity-70 ml-1", e),
|
|
13792
13796
|
children: [
|
|
13793
13797
|
"Is thinking",
|
|
13794
13798
|
".".repeat(t)
|
|
@@ -13823,13 +13827,13 @@ const Oc = z.memo(function({
|
|
|
13823
13827
|
defaultCheckpointId: E = null,
|
|
13824
13828
|
messageParentCheckpointId: N = null
|
|
13825
13829
|
}) {
|
|
13826
|
-
const [M, j] =
|
|
13830
|
+
const [M, j] = be(!1), [P, $] = be("preview"), [I, F] = be(!1), { currentThreadId: A } = da(), { respondToInterrupt: X } = fa(), L = l === "phone" || l === "half-screen", _ = t.role, J = _ === "tool", G = rt(() => "type" in t && t.type === "default_message" ? t : null, [t]), pe = !!G, ke = !(r && _ !== "user"), {
|
|
13827
13831
|
uploadingFiles: Ae,
|
|
13828
|
-
handleFileClick:
|
|
13832
|
+
handleFileClick: K,
|
|
13829
13833
|
fileViewerOpen: oe,
|
|
13830
13834
|
currentFileInfo: Y,
|
|
13831
13835
|
closeFileViewer: D
|
|
13832
|
-
} = kC({ allowFileOpen:
|
|
13836
|
+
} = kC({ allowFileOpen: ke, currentThreadId: A }), H = z.useMemo(() => {
|
|
13833
13837
|
switch (_) {
|
|
13834
13838
|
case "user":
|
|
13835
13839
|
return "text-[hsl(var(--chat-bubble-user-text))]";
|
|
@@ -13842,7 +13846,7 @@ const Oc = z.memo(function({
|
|
|
13842
13846
|
default:
|
|
13843
13847
|
return "text-[hsl(var(--chat-bubble-ai-text))]";
|
|
13844
13848
|
}
|
|
13845
|
-
}, [_]), ne = rt(() => G ? "" : wC(t.content), [G, t]),
|
|
13849
|
+
}, [_]), ne = rt(() => G ? "" : wC(t.content), [G, t]), ie = rt(() => G ? {} : Rp(t), [G, t]), V = rt(
|
|
13846
13850
|
() => G ? [] : t.content.filter((B) => B.type === "image_url"),
|
|
13847
13851
|
[G, t]
|
|
13848
13852
|
), Me = rt(
|
|
@@ -13851,15 +13855,15 @@ const Oc = z.memo(function({
|
|
|
13851
13855
|
), Ue = rt(
|
|
13852
13856
|
() => G ? [] : t.content.filter((B) => B.type === "interrupt"),
|
|
13853
13857
|
[G, t]
|
|
13854
|
-
), Ze = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), re = jo(Ze),
|
|
13858
|
+
), Ze = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), re = jo(Ze), ge = g == null ? void 0 : g.value, Le = rt(() => G ? "" : bC(t.content), [G, t]), Fe = z.useCallback(async () => {
|
|
13855
13859
|
const B = J ? Le : ne;
|
|
13856
|
-
async function
|
|
13860
|
+
async function ve(we) {
|
|
13857
13861
|
if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
|
|
13858
|
-
await navigator.clipboard.writeText(
|
|
13862
|
+
await navigator.clipboard.writeText(we);
|
|
13859
13863
|
return;
|
|
13860
13864
|
}
|
|
13861
13865
|
if (navigator.clipboard && typeof navigator.clipboard.write == "function" && typeof ClipboardItem < "u") {
|
|
13862
|
-
const at = new Blob([
|
|
13866
|
+
const at = new Blob([we], { type: "text/plain" });
|
|
13863
13867
|
await navigator.clipboard.write([
|
|
13864
13868
|
new ClipboardItem({
|
|
13865
13869
|
"text/plain": at
|
|
@@ -13870,50 +13874,50 @@ const Oc = z.memo(function({
|
|
|
13870
13874
|
throw new Error("Clipboard API not supported in this context.");
|
|
13871
13875
|
}
|
|
13872
13876
|
try {
|
|
13873
|
-
await
|
|
13874
|
-
} catch (
|
|
13875
|
-
console.error("Failed to copy:",
|
|
13877
|
+
await ve(B), j(!0), setTimeout(() => j(!1), 2e3), y == null || y(B);
|
|
13878
|
+
} catch (we) {
|
|
13879
|
+
console.error("Failed to copy:", we);
|
|
13876
13880
|
}
|
|
13877
13881
|
}, [J, Le, ne, y]), Pe = z.useCallback(() => {
|
|
13878
13882
|
if (!h) return;
|
|
13879
|
-
const B = J ? Le : ne,
|
|
13883
|
+
const B = J ? Le : ne, ve = "type" in t && t.type === "default_message" ? void 0 : {
|
|
13880
13884
|
checkpointId: t.checkpointId ?? null,
|
|
13881
13885
|
checkpointNs: t.checkpointNs ?? null
|
|
13882
13886
|
};
|
|
13883
|
-
h(t.id, B,
|
|
13887
|
+
h(t.id, B, ve);
|
|
13884
13888
|
}, [h, t.id, J, Le, ne, t]), et = z.useCallback(() => {
|
|
13885
13889
|
m == null || m(n);
|
|
13886
13890
|
}, [m, n]), We = z.useCallback(() => {
|
|
13887
|
-
const
|
|
13891
|
+
const ve = ee(L ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", H);
|
|
13888
13892
|
switch (_) {
|
|
13889
13893
|
case "user":
|
|
13890
|
-
return /* @__PURE__ */ u.jsx(am, { className:
|
|
13894
|
+
return /* @__PURE__ */ u.jsx(am, { className: ve });
|
|
13891
13895
|
case "assistant":
|
|
13892
|
-
return /* @__PURE__ */ u.jsx(Qs, { className:
|
|
13896
|
+
return /* @__PURE__ */ u.jsx(Qs, { className: ve });
|
|
13893
13897
|
case "tool":
|
|
13894
|
-
return /* @__PURE__ */ u.jsx(im, { className:
|
|
13898
|
+
return /* @__PURE__ */ u.jsx(im, { className: ve });
|
|
13895
13899
|
default:
|
|
13896
|
-
return /* @__PURE__ */ u.jsx(Qs, { className:
|
|
13900
|
+
return /* @__PURE__ */ u.jsx(Qs, { className: ve });
|
|
13897
13901
|
}
|
|
13898
13902
|
}, [L, H, _]), Ge = z.useCallback(() => {
|
|
13899
13903
|
const B = "group relative mb-4 flex w-full";
|
|
13900
13904
|
switch (_) {
|
|
13901
13905
|
case "user":
|
|
13902
|
-
return
|
|
13906
|
+
return ee(B, "justify-end");
|
|
13903
13907
|
case "assistant":
|
|
13904
13908
|
case "tool":
|
|
13905
13909
|
case "system":
|
|
13906
|
-
return
|
|
13910
|
+
return ee(B, "justify-start");
|
|
13907
13911
|
default:
|
|
13908
13912
|
return B;
|
|
13909
13913
|
}
|
|
13910
13914
|
}, [_]), qe = z.useCallback(() => {
|
|
13911
|
-
const B =
|
|
13915
|
+
const B = ee(
|
|
13912
13916
|
"rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
|
|
13913
13917
|
L && "px-3 py-2 text-sm"
|
|
13914
13918
|
);
|
|
13915
13919
|
if (pe)
|
|
13916
|
-
return
|
|
13920
|
+
return ee(
|
|
13917
13921
|
B,
|
|
13918
13922
|
"w-full",
|
|
13919
13923
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
@@ -13921,25 +13925,25 @@ const Oc = z.memo(function({
|
|
|
13921
13925
|
);
|
|
13922
13926
|
switch (_) {
|
|
13923
13927
|
case "user":
|
|
13924
|
-
return
|
|
13928
|
+
return ee(
|
|
13925
13929
|
B,
|
|
13926
13930
|
"w-full md:max-w-[95%]",
|
|
13927
13931
|
"bg-[hsl(var(--chat-bubble-user))] text-[hsl(var(--chat-bubble-user-text))]",
|
|
13928
13932
|
"border border-transparent"
|
|
13929
13933
|
);
|
|
13930
13934
|
case "assistant":
|
|
13931
|
-
return
|
|
13935
|
+
return ee(
|
|
13932
13936
|
B,
|
|
13933
13937
|
"w-full md:max-w-[95%]",
|
|
13934
13938
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
13935
13939
|
"border border-border/60 dark:border-border/40"
|
|
13936
13940
|
);
|
|
13937
13941
|
case "tool":
|
|
13938
|
-
return
|
|
13942
|
+
return ee(B, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
|
|
13939
13943
|
case "system":
|
|
13940
|
-
return
|
|
13944
|
+
return ee(B, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
|
|
13941
13945
|
default:
|
|
13942
|
-
return
|
|
13946
|
+
return ee(
|
|
13943
13947
|
B,
|
|
13944
13948
|
"w-full md:max-w-[95%]",
|
|
13945
13949
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
@@ -13948,9 +13952,9 @@ const Oc = z.memo(function({
|
|
|
13948
13952
|
}
|
|
13949
13953
|
}, [L, pe, _]);
|
|
13950
13954
|
if (pe && G)
|
|
13951
|
-
return /* @__PURE__ */ u.jsx("div", { className:
|
|
13955
|
+
return /* @__PURE__ */ u.jsx("div", { className: ee(Ge(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: ee(qe(), p.content), children: [
|
|
13952
13956
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
|
|
13953
|
-
/* @__PURE__ */ u.jsx(Qs, { className:
|
|
13957
|
+
/* @__PURE__ */ u.jsx(Qs, { className: ee("h-4 w-4", H) }),
|
|
13954
13958
|
a && /* @__PURE__ */ u.jsx("span", { className: "font-medium text-sm", children: "Assistant" })
|
|
13955
13959
|
] }),
|
|
13956
13960
|
/* @__PURE__ */ u.jsx(
|
|
@@ -13964,41 +13968,41 @@ const Oc = z.memo(function({
|
|
|
13964
13968
|
const Qe = z.useCallback(async (B) => {
|
|
13965
13969
|
if (w)
|
|
13966
13970
|
return;
|
|
13967
|
-
const
|
|
13971
|
+
const ve = jo(
|
|
13968
13972
|
(B == null ? void 0 : B.id) ?? (B == null ? void 0 : B.interrupt_id)
|
|
13969
13973
|
);
|
|
13970
|
-
if (!
|
|
13974
|
+
if (!ve) {
|
|
13971
13975
|
console.warn("Interrupt part missing id", B);
|
|
13972
13976
|
return;
|
|
13973
13977
|
}
|
|
13974
13978
|
try {
|
|
13975
|
-
b == null || b(), await X(
|
|
13976
|
-
} catch (
|
|
13977
|
-
console.error("Failed to approve interrupt:",
|
|
13979
|
+
b == null || b(), await X(ve, !0);
|
|
13980
|
+
} catch (we) {
|
|
13981
|
+
console.error("Failed to approve interrupt:", we);
|
|
13978
13982
|
} finally {
|
|
13979
13983
|
T == null || T();
|
|
13980
13984
|
}
|
|
13981
13985
|
}, [w, T, b, X]), St = z.useCallback(async (B) => {
|
|
13982
13986
|
if (w)
|
|
13983
13987
|
return;
|
|
13984
|
-
const
|
|
13988
|
+
const ve = jo(
|
|
13985
13989
|
(B == null ? void 0 : B.id) ?? (B == null ? void 0 : B.interrupt_id)
|
|
13986
13990
|
);
|
|
13987
|
-
if (!
|
|
13991
|
+
if (!ve) {
|
|
13988
13992
|
console.warn("Interrupt part missing id", B);
|
|
13989
13993
|
return;
|
|
13990
13994
|
}
|
|
13991
13995
|
try {
|
|
13992
|
-
b == null || b(), await X(
|
|
13993
|
-
} catch (
|
|
13994
|
-
console.error("Failed to reject interrupt:",
|
|
13996
|
+
b == null || b(), await X(ve, !1);
|
|
13997
|
+
} catch (we) {
|
|
13998
|
+
console.error("Failed to reject interrupt:", we);
|
|
13995
13999
|
} finally {
|
|
13996
14000
|
T == null || T();
|
|
13997
14001
|
}
|
|
13998
|
-
}, [w, T, b, X]), mt = z.useCallback(({ part: B, i:
|
|
14002
|
+
}, [w, T, b, X]), mt = z.useCallback(({ part: B, i: ve }) => {
|
|
13999
14003
|
if (B.type === "text") {
|
|
14000
|
-
const
|
|
14001
|
-
return
|
|
14004
|
+
const we = B.text ?? "", at = we.trim(), q = Va(at);
|
|
14005
|
+
return q && _ !== "tool" ? /* @__PURE__ */ u.jsx(Ep, { data: q }, ve) : _ === "user" && c && at.length > d ? /* @__PURE__ */ u.jsx(
|
|
14002
14006
|
RC,
|
|
14003
14007
|
{
|
|
14004
14008
|
text: at,
|
|
@@ -14007,61 +14011,61 @@ const Oc = z.memo(function({
|
|
|
14007
14011
|
previewLength: d,
|
|
14008
14012
|
isCompact: L
|
|
14009
14013
|
},
|
|
14010
|
-
|
|
14011
|
-
) : /* @__PURE__ */ u.jsx(cs, { content:
|
|
14014
|
+
ve
|
|
14015
|
+
) : /* @__PURE__ */ u.jsx(cs, { content: we, allowHtml: !1 }, ve);
|
|
14012
14016
|
}
|
|
14013
14017
|
if (B.type === "image_url") {
|
|
14014
|
-
const
|
|
14018
|
+
const we = B;
|
|
14015
14019
|
return /* @__PURE__ */ u.jsx("div", { className: "my-2", children: /* @__PURE__ */ u.jsx(
|
|
14016
14020
|
"img",
|
|
14017
14021
|
{
|
|
14018
|
-
src:
|
|
14019
|
-
alt:
|
|
14022
|
+
src: we.url,
|
|
14023
|
+
alt: we.alt ?? "",
|
|
14020
14024
|
loading: "lazy",
|
|
14021
14025
|
className: "border rounded max-h-[420px] w-auto object-contain"
|
|
14022
14026
|
}
|
|
14023
|
-
) },
|
|
14027
|
+
) }, ve);
|
|
14024
14028
|
}
|
|
14025
14029
|
if (B.type === "file") {
|
|
14026
|
-
const
|
|
14030
|
+
const we = B, at = we.name || "file";
|
|
14027
14031
|
return /* @__PURE__ */ u.jsxs(
|
|
14028
14032
|
"a",
|
|
14029
14033
|
{
|
|
14030
|
-
href:
|
|
14031
|
-
onClick: (
|
|
14034
|
+
href: we.url,
|
|
14035
|
+
onClick: (q) => K(q, we, ve),
|
|
14032
14036
|
className: `inline-flex items-center gap-2 rounded px-2 py-1 text-xs bg-gray-100 border hover:bg-gray-200
|
|
14033
14037
|
dark:bg-background/10 dark:border-border/30 dark:hover:bg-background/20`,
|
|
14034
14038
|
children: [
|
|
14035
|
-
Ae[
|
|
14039
|
+
Ae[ve] ? /* @__PURE__ */ u.jsx(oa, { className: "h-4 w-4 animate-spin" }) : null,
|
|
14036
14040
|
/* @__PURE__ */ u.jsxs("span", { className: "truncate max-w-[180px]", children: [
|
|
14037
14041
|
at,
|
|
14038
|
-
Ae[
|
|
14042
|
+
Ae[ve] ? " (processing)" : ""
|
|
14039
14043
|
] })
|
|
14040
14044
|
]
|
|
14041
14045
|
},
|
|
14042
|
-
|
|
14046
|
+
ve
|
|
14043
14047
|
);
|
|
14044
14048
|
}
|
|
14045
14049
|
if (B.type === "interrupt") {
|
|
14046
|
-
const
|
|
14047
|
-
(
|
|
14048
|
-
),
|
|
14050
|
+
const we = B, at = jo(
|
|
14051
|
+
(we == null ? void 0 : we.id) ?? (we == null ? void 0 : we.interrupt_id)
|
|
14052
|
+
), q = !!(re && at && at === re), se = q ? ge ?? (we == null ? void 0 : we.value) : we == null ? void 0 : we.value, te = at ? { ...we, id: at, interrupt_id: at } : we;
|
|
14049
14053
|
return /* @__PURE__ */ u.jsx(
|
|
14050
14054
|
TC,
|
|
14051
14055
|
{
|
|
14052
|
-
interruptPart:
|
|
14056
|
+
interruptPart: te,
|
|
14053
14057
|
onApprove: Qe,
|
|
14054
14058
|
onReject: St,
|
|
14055
14059
|
disabled: w,
|
|
14056
|
-
isActive:
|
|
14057
|
-
payload:
|
|
14060
|
+
isActive: q,
|
|
14061
|
+
payload: se
|
|
14058
14062
|
},
|
|
14059
|
-
|
|
14063
|
+
ve
|
|
14060
14064
|
);
|
|
14061
14065
|
}
|
|
14062
14066
|
return null;
|
|
14063
14067
|
}, [
|
|
14064
|
-
|
|
14068
|
+
K,
|
|
14065
14069
|
Ae,
|
|
14066
14070
|
Qe,
|
|
14067
14071
|
St,
|
|
@@ -14071,7 +14075,7 @@ const Oc = z.memo(function({
|
|
|
14071
14075
|
I,
|
|
14072
14076
|
L,
|
|
14073
14077
|
re,
|
|
14074
|
-
|
|
14078
|
+
ge,
|
|
14075
14079
|
g,
|
|
14076
14080
|
w,
|
|
14077
14081
|
Ue
|
|
@@ -14079,7 +14083,7 @@ const Oc = z.memo(function({
|
|
|
14079
14083
|
/* @__PURE__ */ u.jsx(ki, { className: "h-4 w-4 text-muted-foreground" }),
|
|
14080
14084
|
/* @__PURE__ */ u.jsx("span", { className: "text-sm text-muted-foreground", children: "File upload" })
|
|
14081
14085
|
] }), []), ft = z.useCallback(() => {
|
|
14082
|
-
const B = ne.trim().length > 0 ||
|
|
14086
|
+
const B = ne.trim().length > 0 || V.length > 0 || Me.length > 0 || Ue.length > 0;
|
|
14083
14087
|
if (!J && Me.length > 0 && !r)
|
|
14084
14088
|
return gt();
|
|
14085
14089
|
if (!J && !B && !r)
|
|
@@ -14094,15 +14098,15 @@ const Oc = z.memo(function({
|
|
|
14094
14098
|
t.id
|
|
14095
14099
|
);
|
|
14096
14100
|
if (!J && !G) {
|
|
14097
|
-
const
|
|
14101
|
+
const ve = t, we = /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: ve.content.map((at, q) => /* @__PURE__ */ u.jsx(mt, { part: at, i: q }, q)) });
|
|
14098
14102
|
return r ? /* @__PURE__ */ u.jsxs("div", { "aria-busy": "true", role: "status", children: [
|
|
14099
|
-
|
|
14103
|
+
we,
|
|
14100
14104
|
/* @__PURE__ */ u.jsx(CC, { className: H })
|
|
14101
|
-
] }) :
|
|
14105
|
+
] }) : we;
|
|
14102
14106
|
}
|
|
14103
14107
|
}, [
|
|
14104
14108
|
ne,
|
|
14105
|
-
|
|
14109
|
+
V.length,
|
|
14106
14110
|
Me.length,
|
|
14107
14111
|
Ue.length,
|
|
14108
14112
|
r,
|
|
@@ -14112,36 +14116,36 @@ const Oc = z.memo(function({
|
|
|
14112
14116
|
H
|
|
14113
14117
|
]), it = rt(() => G ? "Assistant" : SC(t), [G, t]), Ve = z.useMemo(() => G ? [] : Array.isArray(C) ? C : [], [C, G]), jt = z.useMemo(() => {
|
|
14114
14118
|
var B;
|
|
14115
|
-
return Ve.length ? E && Ve.some((
|
|
14119
|
+
return Ve.length ? E && Ve.some((ve) => ve.id === E) ? E : ((B = Ve[0]) == null ? void 0 : B.id) ?? null : null;
|
|
14116
14120
|
}, [E, Ve]), Zt = z.useMemo(() => !Ve.length || !S ? null : Ve.some((B) => B.id === S) ? S : null, [S, Ve]) ?? jt, ln = _ === "user" && Ve.length > 0 && typeof k == "function", Ye = z.useCallback(
|
|
14117
14121
|
(B) => {
|
|
14118
14122
|
if (!k) return;
|
|
14119
|
-
const
|
|
14120
|
-
k(
|
|
14123
|
+
const ve = (B == null ? void 0 : B.id) ?? null, we = (B == null ? void 0 : B.parentId) ?? N ?? null;
|
|
14124
|
+
k(ve, we);
|
|
14121
14125
|
},
|
|
14122
14126
|
[N, k]
|
|
14123
14127
|
), _e = z.useMemo(() => Zt ? Ve.findIndex((B) => B.id === Zt) : -1, [Zt, Ve]), _t = z.useMemo(() => _e < 0 ? null : Ve[_e] ?? null, [_e, Ve]), zt = z.useCallback((B) => {
|
|
14124
|
-
const
|
|
14125
|
-
if (B.step !== null &&
|
|
14126
|
-
return
|
|
14127
|
-
let
|
|
14128
|
+
const ve = [];
|
|
14129
|
+
if (B.step !== null && ve.push(`Step ${B.step}`), B.source && ve.push(B.source), !B.createdAt)
|
|
14130
|
+
return ve.length ? ve.join(" • ") : B.id.slice(0, 8);
|
|
14131
|
+
let we = "";
|
|
14128
14132
|
try {
|
|
14129
14133
|
const at = new Date(B.createdAt);
|
|
14130
|
-
Number.isNaN(at.getTime()) || (
|
|
14134
|
+
Number.isNaN(at.getTime()) || (we = new Intl.DateTimeFormat(void 0, {
|
|
14131
14135
|
hour: "2-digit",
|
|
14132
14136
|
minute: "2-digit"
|
|
14133
14137
|
}).format(at));
|
|
14134
14138
|
} catch {
|
|
14135
|
-
|
|
14139
|
+
we = "";
|
|
14136
14140
|
}
|
|
14137
|
-
return `${
|
|
14141
|
+
return `${we}`;
|
|
14138
14142
|
}, []);
|
|
14139
14143
|
return J && !f ? null : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
14140
|
-
/* @__PURE__ */ u.jsx("div", { className:
|
|
14144
|
+
/* @__PURE__ */ u.jsx("div", { className: ee(Ge(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: ee(qe(), p.content), children: [
|
|
14141
14145
|
(i || a || J) && /* @__PURE__ */ u.jsxs(
|
|
14142
14146
|
"div",
|
|
14143
14147
|
{
|
|
14144
|
-
className:
|
|
14148
|
+
className: ee(
|
|
14145
14149
|
"flex items-center justify-between mb-2 pb-2 border-b border-current/10",
|
|
14146
14150
|
L && "mb-1 pb-1",
|
|
14147
14151
|
H,
|
|
@@ -14150,12 +14154,12 @@ const Oc = z.memo(function({
|
|
|
14150
14154
|
children: [
|
|
14151
14155
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
14152
14156
|
We(),
|
|
14153
|
-
a && it && /* @__PURE__ */ u.jsx("span", { className:
|
|
14157
|
+
a && it && /* @__PURE__ */ u.jsx("span", { className: ee("font-medium", L ? "text-xs" : "text-sm"), children: it }),
|
|
14154
14158
|
J && /* @__PURE__ */ u.jsxs(
|
|
14155
14159
|
Vf,
|
|
14156
14160
|
{
|
|
14157
14161
|
variant: "outline",
|
|
14158
|
-
className:
|
|
14162
|
+
className: ee(
|
|
14159
14163
|
"text-xs flex items-center gap-1 cursor-pointer select-none",
|
|
14160
14164
|
H,
|
|
14161
14165
|
"border border-current/40",
|
|
@@ -14166,11 +14170,11 @@ const Oc = z.memo(function({
|
|
|
14166
14170
|
"aria-expanded": P === "expanded",
|
|
14167
14171
|
onClick: () => $((B) => B === "expanded" ? "preview" : "expanded"),
|
|
14168
14172
|
onKeyDown: (B) => {
|
|
14169
|
-
(B.key === "Enter" || B.key === " ") && (B.preventDefault(), $((
|
|
14173
|
+
(B.key === "Enter" || B.key === " ") && (B.preventDefault(), $((ve) => ve === "expanded" ? "preview" : "expanded"));
|
|
14170
14174
|
},
|
|
14171
14175
|
children: [
|
|
14172
|
-
/* @__PURE__ */ u.jsx("span", { children:
|
|
14173
|
-
|
|
14176
|
+
/* @__PURE__ */ u.jsx("span", { children: ie.name ?? "Tool Output" }),
|
|
14177
|
+
ie.toolCallId && /* @__PURE__ */ u.jsx("span", { className: "opacity-70", children: ie.toolCallId.slice(0, 8) }),
|
|
14174
14178
|
P === "expanded" ? /* @__PURE__ */ u.jsx(sa, { className: "h-3 w-3" }) : /* @__PURE__ */ u.jsx(ms, { className: "h-3 w-3" })
|
|
14175
14179
|
]
|
|
14176
14180
|
}
|
|
@@ -14182,7 +14186,7 @@ const Oc = z.memo(function({
|
|
|
14182
14186
|
"button",
|
|
14183
14187
|
{
|
|
14184
14188
|
type: "button",
|
|
14185
|
-
className:
|
|
14189
|
+
className: ee(
|
|
14186
14190
|
"flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
|
|
14187
14191
|
_e > 0 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
|
|
14188
14192
|
),
|
|
@@ -14208,7 +14212,7 @@ const Oc = z.memo(function({
|
|
|
14208
14212
|
"button",
|
|
14209
14213
|
{
|
|
14210
14214
|
type: "button",
|
|
14211
|
-
className:
|
|
14215
|
+
className: ee(
|
|
14212
14216
|
"flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
|
|
14213
14217
|
_e < Ve.length - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
|
|
14214
14218
|
),
|
|
@@ -14226,7 +14230,7 @@ const Oc = z.memo(function({
|
|
|
14226
14230
|
i && t.createdAt && /* @__PURE__ */ u.jsx(
|
|
14227
14231
|
"time",
|
|
14228
14232
|
{
|
|
14229
|
-
className:
|
|
14233
|
+
className: ee("text-xs opacity-60", H, L && "text-xs"),
|
|
14230
14234
|
dateTime: new Date(t.createdAt).toISOString(),
|
|
14231
14235
|
title: new Date(t.createdAt).toLocaleString(),
|
|
14232
14236
|
children: new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit" }).format(new Date(t.createdAt))
|
|
@@ -14235,7 +14239,7 @@ const Oc = z.memo(function({
|
|
|
14235
14239
|
s && !o && /* @__PURE__ */ u.jsxs(
|
|
14236
14240
|
"div",
|
|
14237
14241
|
{
|
|
14238
|
-
className:
|
|
14242
|
+
className: ee(
|
|
14239
14243
|
"opacity-0 group-hover:opacity-100 transition-opacity",
|
|
14240
14244
|
"flex items-center gap-1",
|
|
14241
14245
|
p.actions
|
|
@@ -14247,10 +14251,10 @@ const Oc = z.memo(function({
|
|
|
14247
14251
|
variant: "ghost",
|
|
14248
14252
|
size: "sm",
|
|
14249
14253
|
onClick: () => Fe(),
|
|
14250
|
-
className:
|
|
14254
|
+
className: ee("h-6 w-6 p-0 hover:bg-foreground/10", H, L && "h-5 w-5"),
|
|
14251
14255
|
"aria-label": "Copy message",
|
|
14252
14256
|
title: "Copy message",
|
|
14253
|
-
children: /* @__PURE__ */ u.jsx(ol, { className:
|
|
14257
|
+
children: /* @__PURE__ */ u.jsx(ol, { className: ee(M ? "text-success" : H, L ? "h-3 w-3" : "h-4 w-4") })
|
|
14254
14258
|
}
|
|
14255
14259
|
) }),
|
|
14256
14260
|
_ === "user" && h && /* @__PURE__ */ u.jsx(
|
|
@@ -14259,9 +14263,9 @@ const Oc = z.memo(function({
|
|
|
14259
14263
|
variant: "ghost",
|
|
14260
14264
|
size: "sm",
|
|
14261
14265
|
onClick: Pe,
|
|
14262
|
-
className:
|
|
14266
|
+
className: ee("h-6 w-6 p-0 hover:bg-foreground/10", H, L && "h-5 w-5"),
|
|
14263
14267
|
"aria-label": "Edit message",
|
|
14264
|
-
children: /* @__PURE__ */ u.jsx(sl, { className:
|
|
14268
|
+
children: /* @__PURE__ */ u.jsx(sl, { className: ee(H, L ? "h-3 w-3" : "h-4 w-4") })
|
|
14265
14269
|
}
|
|
14266
14270
|
),
|
|
14267
14271
|
_ === "assistant" && m && /* @__PURE__ */ u.jsx(
|
|
@@ -14270,9 +14274,9 @@ const Oc = z.memo(function({
|
|
|
14270
14274
|
variant: "ghost",
|
|
14271
14275
|
size: "sm",
|
|
14272
14276
|
onClick: et,
|
|
14273
|
-
className:
|
|
14277
|
+
className: ee("h-6 w-6 p-0 hover:bg-foreground/10", H, L && "h-5 w-5"),
|
|
14274
14278
|
"aria-label": "Regenerate response",
|
|
14275
|
-
children: /* @__PURE__ */ u.jsx(Ri, { className:
|
|
14279
|
+
children: /* @__PURE__ */ u.jsx(Ri, { className: ee(H, L ? "h-3 w-3" : "h-4 w-4") })
|
|
14276
14280
|
}
|
|
14277
14281
|
)
|
|
14278
14282
|
]
|
|
@@ -14283,20 +14287,20 @@ const Oc = z.memo(function({
|
|
|
14283
14287
|
}
|
|
14284
14288
|
),
|
|
14285
14289
|
/* @__PURE__ */ u.jsx("div", { className: "relative", children: ft() }),
|
|
14286
|
-
J && P === "expanded" && (
|
|
14287
|
-
|
|
14290
|
+
J && P === "expanded" && (ie.toolCallId || ie.name) && /* @__PURE__ */ u.jsxs("div", { className: ee("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", L && "text-xs"), children: [
|
|
14291
|
+
ie.name && /* @__PURE__ */ u.jsxs("div", { children: [
|
|
14288
14292
|
"Function: ",
|
|
14289
|
-
|
|
14293
|
+
ie.name
|
|
14290
14294
|
] }),
|
|
14291
|
-
|
|
14295
|
+
ie.toolCallId && /* @__PURE__ */ u.jsxs("div", { children: [
|
|
14292
14296
|
"Call ID: ",
|
|
14293
|
-
|
|
14297
|
+
ie.toolCallId
|
|
14294
14298
|
] })
|
|
14295
14299
|
] }),
|
|
14296
14300
|
!(i || a || J) && s && !o && /* @__PURE__ */ u.jsxs(
|
|
14297
14301
|
"div",
|
|
14298
14302
|
{
|
|
14299
|
-
className:
|
|
14303
|
+
className: ee(
|
|
14300
14304
|
"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
14301
14305
|
"flex items-center gap-1",
|
|
14302
14306
|
p.actions
|
|
@@ -14308,8 +14312,8 @@ const Oc = z.memo(function({
|
|
|
14308
14312
|
variant: "ghost",
|
|
14309
14313
|
size: "sm",
|
|
14310
14314
|
onClick: () => Fe(),
|
|
14311
|
-
className:
|
|
14312
|
-
children: /* @__PURE__ */ u.jsx(ol, { className:
|
|
14315
|
+
className: ee("h-6 w-6 p-0 hover:bg-background/50 text-current", L && "h-5 w-5"),
|
|
14316
|
+
children: /* @__PURE__ */ u.jsx(ol, { className: ee(M ? "text-success" : "text-current", L ? "h-3 w-3" : "h-4 w-4") })
|
|
14313
14317
|
}
|
|
14314
14318
|
),
|
|
14315
14319
|
_ === "user" && h && /* @__PURE__ */ u.jsx(
|
|
@@ -14318,8 +14322,8 @@ const Oc = z.memo(function({
|
|
|
14318
14322
|
variant: "ghost",
|
|
14319
14323
|
size: "sm",
|
|
14320
14324
|
onClick: Pe,
|
|
14321
|
-
className:
|
|
14322
|
-
children: /* @__PURE__ */ u.jsx(sl, { className:
|
|
14325
|
+
className: ee("h-6 w-6 p-0 hover:bg-background/50 text-current", L && "h-5 w-5"),
|
|
14326
|
+
children: /* @__PURE__ */ u.jsx(sl, { className: ee("text-current", L ? "h-3 w-3" : "h-4 w-4") })
|
|
14323
14327
|
}
|
|
14324
14328
|
),
|
|
14325
14329
|
_ === "assistant" && m && /* @__PURE__ */ u.jsx(
|
|
@@ -14328,8 +14332,8 @@ const Oc = z.memo(function({
|
|
|
14328
14332
|
variant: "ghost",
|
|
14329
14333
|
size: "sm",
|
|
14330
14334
|
onClick: et,
|
|
14331
|
-
className:
|
|
14332
|
-
children: /* @__PURE__ */ u.jsx(Ri, { className:
|
|
14335
|
+
className: ee("h-6 w-6 p-0 hover:bg-background/50 text-current", L && "h-5 w-5"),
|
|
14336
|
+
children: /* @__PURE__ */ u.jsx(Ri, { className: ee("text-current", L ? "h-3 w-3" : "h-4 w-4") })
|
|
14333
14337
|
}
|
|
14334
14338
|
)
|
|
14335
14339
|
]
|
|
@@ -14386,7 +14390,7 @@ function TC({
|
|
|
14386
14390
|
return /* @__PURE__ */ u.jsxs(
|
|
14387
14391
|
Wr,
|
|
14388
14392
|
{
|
|
14389
|
-
className:
|
|
14393
|
+
className: ee(
|
|
14390
14394
|
"border-blue-200 dark:border-blue-800 bg-blue-50/50 dark:bg-blue-950/10 transition-shadow",
|
|
14391
14395
|
o ? "shadow-md ring-1 ring-blue-300 dark:ring-blue-500/70" : "opacity-80"
|
|
14392
14396
|
),
|
|
@@ -14424,7 +14428,7 @@ function TC({
|
|
|
14424
14428
|
);
|
|
14425
14429
|
}
|
|
14426
14430
|
function kC(e) {
|
|
14427
|
-
const { allowFileOpen: t, currentThreadId: n } = e, { toast: r } = Wa(), [o, s] =
|
|
14431
|
+
const { allowFileOpen: t, currentThreadId: n } = e, { toast: r } = Wa(), [o, s] = be({}), [i, a] = be(null), [l, c] = be(!1), d = z.useCallback(() => {
|
|
14428
14432
|
c(!1), a(null);
|
|
14429
14433
|
}, []), f = z.useCallback((h) => {
|
|
14430
14434
|
a(h), c(!0);
|
|
@@ -14504,10 +14508,10 @@ function RC({
|
|
|
14504
14508
|
}) {
|
|
14505
14509
|
const s = Math.max(e.length - r, 0), i = e.substring(0, r);
|
|
14506
14510
|
return /* @__PURE__ */ u.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
14507
|
-
/* @__PURE__ */ u.jsx("div", { className:
|
|
14511
|
+
/* @__PURE__ */ u.jsx("div", { className: ee("text-sm text-[hsl(var(--chat-bubble-user-text))]", o && "text-xs"), children: t ? /* @__PURE__ */ u.jsx(cs, { content: e, allowHtml: !1 }) : /* @__PURE__ */ u.jsxs(
|
|
14508
14512
|
"pre",
|
|
14509
14513
|
{
|
|
14510
|
-
className:
|
|
14514
|
+
className: ee(
|
|
14511
14515
|
"font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]",
|
|
14512
14516
|
o && "text-xs"
|
|
14513
14517
|
),
|
|
@@ -14688,17 +14692,17 @@ const IC = ({
|
|
|
14688
14692
|
messagePreviews: P,
|
|
14689
14693
|
createSyntheticThinkingMessage: $ = !1
|
|
14690
14694
|
}, I) => {
|
|
14691
|
-
const F = He(null), A = He(null), X = He(!1), [L, _] =
|
|
14692
|
-
(
|
|
14695
|
+
const F = He(null), A = He(null), X = He(!1), [L, _] = be(!0), J = rt(() => w ? e.some((re) => "type" in re && re.type === "default_message" ? !1 : Array.isArray(re == null ? void 0 : re.content) && re.content.some(
|
|
14696
|
+
(ge) => ge && ge.type === "interrupt" && (ge.id ?? ge.interrupt_id) === w.id
|
|
14693
14697
|
)) : !1, [w, e]), G = rt(() => {
|
|
14694
14698
|
if (!w || J)
|
|
14695
14699
|
return null;
|
|
14696
14700
|
const re = w.id && String(w.id).trim() ? String(w.id).trim() : "pending-interrupt";
|
|
14697
|
-
let
|
|
14701
|
+
let ge;
|
|
14698
14702
|
const Le = w.value;
|
|
14699
14703
|
if (Le && typeof Le == "object" && !Array.isArray(Le)) {
|
|
14700
14704
|
const Fe = Le.title;
|
|
14701
|
-
typeof Fe == "string" && Fe.trim() && (
|
|
14705
|
+
typeof Fe == "string" && Fe.trim() && (ge = Fe.trim());
|
|
14702
14706
|
}
|
|
14703
14707
|
return {
|
|
14704
14708
|
id: `interrupt-${re}`,
|
|
@@ -14709,11 +14713,11 @@ const IC = ({
|
|
|
14709
14713
|
type: "interrupt",
|
|
14710
14714
|
id: re,
|
|
14711
14715
|
value: Le,
|
|
14712
|
-
title:
|
|
14716
|
+
title: ge
|
|
14713
14717
|
}
|
|
14714
14718
|
]
|
|
14715
14719
|
};
|
|
14716
|
-
}, [w, J]), pe = rt(() => G ? [...e, G] : e, [e, G]),
|
|
14720
|
+
}, [w, J]), pe = rt(() => G ? [...e, G] : e, [e, G]), ke = rt(() => !$ || !t ? pe : !pe.some((ge) => ge.role === "assistant") && pe.length > 0 ? [
|
|
14717
14721
|
...pe,
|
|
14718
14722
|
{
|
|
14719
14723
|
id: "thinking-assistant",
|
|
@@ -14721,20 +14725,20 @@ const IC = ({
|
|
|
14721
14725
|
content: [],
|
|
14722
14726
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
14723
14727
|
}
|
|
14724
|
-
] : pe, [pe, t, $]), Ae = rt(() => S ?
|
|
14725
|
-
const re = /* @__PURE__ */ new Set(),
|
|
14728
|
+
] : pe, [pe, t, $]), Ae = rt(() => S ? ke : ke.filter((re) => (re == null ? void 0 : re.role) !== "tool"), [ke, S]), K = rt(() => {
|
|
14729
|
+
const re = /* @__PURE__ */ new Set(), ge = [];
|
|
14726
14730
|
for (let Le = Ae.length - 1; Le >= 0; Le--) {
|
|
14727
14731
|
const Fe = Ae[Le];
|
|
14728
14732
|
if (!Fe) continue;
|
|
14729
14733
|
if ("type" in Fe && Fe.type === "default_message") {
|
|
14730
|
-
|
|
14734
|
+
ge.push(Fe);
|
|
14731
14735
|
continue;
|
|
14732
14736
|
}
|
|
14733
14737
|
const Pe = Fe, et = NC(Pe);
|
|
14734
|
-
re.has(et) || (re.add(et),
|
|
14738
|
+
re.has(et) || (re.add(et), ge.push(Pe));
|
|
14735
14739
|
}
|
|
14736
|
-
return
|
|
14737
|
-
}, [Ae]), oe =
|
|
14740
|
+
return ge.reverse();
|
|
14741
|
+
}, [Ae]), oe = Te((re) => {
|
|
14738
14742
|
_(re), y && y(!re), g && g(re);
|
|
14739
14743
|
}, [y, g]), Y = rt(() => {
|
|
14740
14744
|
if (a)
|
|
@@ -14748,7 +14752,7 @@ const IC = ({
|
|
|
14748
14752
|
}
|
|
14749
14753
|
}
|
|
14750
14754
|
};
|
|
14751
|
-
}, [a]), D = rt(() => !m || x ? !1 : L ? "auto" : !1, [L, m, x]), H = j ?? [], ne = H.length > 0,
|
|
14755
|
+
}, [a]), D = rt(() => !m || x ? !1 : L ? "auto" : !1, [L, m, x]), H = j ?? [], ne = H.length > 0, ie = rt(() => {
|
|
14752
14756
|
if (typeof h != "string") return null;
|
|
14753
14757
|
const re = h.trim();
|
|
14754
14758
|
return re ? {
|
|
@@ -14758,7 +14762,7 @@ const IC = ({
|
|
|
14758
14762
|
content: re,
|
|
14759
14763
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
14760
14764
|
} : null;
|
|
14761
|
-
}, [h]),
|
|
14765
|
+
}, [h]), V = ne ? /* @__PURE__ */ u.jsx(
|
|
14762
14766
|
IC,
|
|
14763
14767
|
{
|
|
14764
14768
|
timelineEntries: H,
|
|
@@ -14766,10 +14770,10 @@ const IC = ({
|
|
|
14766
14770
|
onSelectCheckpoint: M,
|
|
14767
14771
|
messagePreviews: P
|
|
14768
14772
|
}
|
|
14769
|
-
) : null, Me = ["flex h-full flex-col md:flex-row", f].filter(Boolean).join(" "), Ue = () =>
|
|
14773
|
+
) : null, Me = ["flex h-full flex-col md:flex-row", f].filter(Boolean).join(" "), Ue = () => ie ? /* @__PURE__ */ u.jsx("div", { className: "p-6 h-full overflow-y-auto", children: /* @__PURE__ */ u.jsx("div", { className: "w-full max-w-full", children: /* @__PURE__ */ u.jsx(
|
|
14770
14774
|
Oc,
|
|
14771
14775
|
{
|
|
14772
|
-
message:
|
|
14776
|
+
message: ie,
|
|
14773
14777
|
messageIndex: 0,
|
|
14774
14778
|
isStreamingMessage: !1,
|
|
14775
14779
|
showActions: !1,
|
|
@@ -14783,15 +14787,15 @@ const IC = ({
|
|
|
14783
14787
|
onCancelEdit: () => {
|
|
14784
14788
|
}
|
|
14785
14789
|
}
|
|
14786
|
-
) }) }) : /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: h ?? "No messages yet. Start a conversation!" }), Ze =
|
|
14790
|
+
) }) }) : /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: h ?? "No messages yet. Start a conversation!" }), Ze = K.length > 0;
|
|
14787
14791
|
return Qh(
|
|
14788
14792
|
I,
|
|
14789
14793
|
() => ({
|
|
14790
14794
|
scrollToLatest: () => {
|
|
14791
|
-
var re,
|
|
14792
|
-
if (F.current &&
|
|
14793
|
-
const Le =
|
|
14794
|
-
(
|
|
14795
|
+
var re, ge;
|
|
14796
|
+
if (F.current && K.length > 0) {
|
|
14797
|
+
const Le = K.length - 1;
|
|
14798
|
+
(ge = (re = F.current).scrollToIndex) == null || ge.call(re, {
|
|
14795
14799
|
index: Le,
|
|
14796
14800
|
align: "end",
|
|
14797
14801
|
behavior: "auto"
|
|
@@ -14799,17 +14803,17 @@ const IC = ({
|
|
|
14799
14803
|
} else A.current && (A.current.scrollTop = A.current.scrollHeight);
|
|
14800
14804
|
},
|
|
14801
14805
|
scrollToTop: () => {
|
|
14802
|
-
var re,
|
|
14803
|
-
F.current &&
|
|
14806
|
+
var re, ge;
|
|
14807
|
+
F.current && K.length > 0 ? (ge = (re = F.current).scrollToIndex) == null || ge.call(re, {
|
|
14804
14808
|
index: 0,
|
|
14805
14809
|
align: "start",
|
|
14806
14810
|
behavior: "auto"
|
|
14807
14811
|
}) : A.current && (A.current.scrollTop = 0);
|
|
14808
14812
|
}
|
|
14809
14813
|
}),
|
|
14810
|
-
[
|
|
14814
|
+
[K]
|
|
14811
14815
|
), /* @__PURE__ */ u.jsxs("div", { className: Me, style: p, children: [
|
|
14812
|
-
|
|
14816
|
+
V,
|
|
14813
14817
|
/* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children: Ze ? /* @__PURE__ */ u.jsx(
|
|
14814
14818
|
gS,
|
|
14815
14819
|
{
|
|
@@ -14819,7 +14823,7 @@ const IC = ({
|
|
|
14819
14823
|
scrollerRef: (re) => {
|
|
14820
14824
|
A.current = re instanceof HTMLDivElement ? re : null;
|
|
14821
14825
|
},
|
|
14822
|
-
data:
|
|
14826
|
+
data: K,
|
|
14823
14827
|
followOutput: D,
|
|
14824
14828
|
overscan: 200,
|
|
14825
14829
|
increaseViewportBy: { top: 100, bottom: 200 },
|
|
@@ -14831,13 +14835,13 @@ const IC = ({
|
|
|
14831
14835
|
},
|
|
14832
14836
|
atBottomStateChange: oe,
|
|
14833
14837
|
style: { height: "100%", overscrollBehavior: "contain" },
|
|
14834
|
-
computeItemKey: (re,
|
|
14835
|
-
itemContent: (re,
|
|
14838
|
+
computeItemKey: (re, ge) => Mc(ge, re),
|
|
14839
|
+
itemContent: (re, ge) => {
|
|
14836
14840
|
var mt;
|
|
14837
|
-
const Le = Mc(
|
|
14841
|
+
const Le = Mc(ge, re), Fe = "type" in ge && ge.type === "default_message";
|
|
14838
14842
|
let Pe = [], et = null, We = {}, Ge = {}, qe = null, Qe = null;
|
|
14839
14843
|
if (!Fe) {
|
|
14840
|
-
const gt =
|
|
14844
|
+
const gt = ge, ft = gt.checkpointId ?? null;
|
|
14841
14845
|
We = gt.additionalKwargs ?? {}, Ge = gt.responseMetadata ?? {};
|
|
14842
14846
|
const it = ft && k ? k.get(ft) ?? null : null;
|
|
14843
14847
|
qe = typeof We.step == "number" ? We.step : typeof Ge.step == "number" ? Ge.step : (it == null ? void 0 : it.step) ?? null;
|
|
@@ -14864,11 +14868,11 @@ const IC = ({
|
|
|
14864
14868
|
children: /* @__PURE__ */ u.jsx(
|
|
14865
14869
|
Oc,
|
|
14866
14870
|
{
|
|
14867
|
-
message:
|
|
14871
|
+
message: ge,
|
|
14868
14872
|
messageIndex: re,
|
|
14869
|
-
isStreamingMessage: t && n ===
|
|
14873
|
+
isStreamingMessage: t && n === ge.id,
|
|
14870
14874
|
streamingDebounceMs: r,
|
|
14871
|
-
isEditing: i ===
|
|
14875
|
+
isEditing: i === ge.id,
|
|
14872
14876
|
showActions: s,
|
|
14873
14877
|
showTimestamp: !1,
|
|
14874
14878
|
showAgentName: !0,
|
|
@@ -14929,24 +14933,24 @@ function Ti({
|
|
|
14929
14933
|
metadata: M,
|
|
14930
14934
|
timelineCheckpoints: j,
|
|
14931
14935
|
messagePreviews: P
|
|
14932
|
-
} = fa(), { isStreaming: $, error: I, connectionState: F, submit: A, stop: X } = Gx(), L = g ?? y ?? null, _ = (k == null ? void 0 : k.id) ?? null, J = (k == null ? void 0 : k.namespace) ?? null, G = (M == null ? void 0 : M.assemblingMessageId) ?? null, pe = N, [
|
|
14936
|
+
} = fa(), { isStreaming: $, error: I, connectionState: F, submit: A, stop: X } = Gx(), L = g ?? y ?? null, _ = (k == null ? void 0 : k.id) ?? null, J = (k == null ? void 0 : k.namespace) ?? null, G = (M == null ? void 0 : M.assemblingMessageId) ?? null, pe = N, [ke, Ae] = be(!1);
|
|
14933
14937
|
Et(() => {
|
|
14934
14938
|
pe || Ae(!1);
|
|
14935
14939
|
}, [pe]);
|
|
14936
|
-
const
|
|
14940
|
+
const K = Te(() => {
|
|
14937
14941
|
Ae(!0);
|
|
14938
|
-
}, []), oe =
|
|
14942
|
+
}, []), oe = Te(() => {
|
|
14939
14943
|
Ae(!1);
|
|
14940
|
-
}, []), Y = !!pe ||
|
|
14944
|
+
}, []), Y = !!pe || ke, [D, H] = be(null), [ne, ie] = be(""), [V, Me] = be(null), [Ue, Ze] = be(null), [re, ge] = be([]), [Le, Fe] = be(0), [Pe, et] = be(0), [We, Ge] = be(!1), [qe, Qe] = be(null), [St, mt] = be(null), [gt, ft] = be(!1), [it, Ve] = be(null), jt = He(!1), [Ct, Zt] = be(() => Dc.value), ln = He(Ct), Ye = He(null), _e = Te((Q) => {
|
|
14941
14945
|
Dc.value = Q, Zt(Q);
|
|
14942
|
-
}, []), [_t, zt] =
|
|
14946
|
+
}, []), [_t, zt] = be(!1), B = He(null), ve = Te(
|
|
14943
14947
|
(Q, de) => {
|
|
14944
14948
|
if (!Q || typeof Q != "object") return null;
|
|
14945
14949
|
const fe = Q[de];
|
|
14946
14950
|
return typeof fe == "number" ? fe : null;
|
|
14947
14951
|
},
|
|
14948
14952
|
[]
|
|
14949
|
-
),
|
|
14953
|
+
), we = Te(
|
|
14950
14954
|
(Q, de) => {
|
|
14951
14955
|
if (!Q || typeof Q != "object") return null;
|
|
14952
14956
|
const fe = Q[de];
|
|
@@ -14954,10 +14958,10 @@ function Ti({
|
|
|
14954
14958
|
},
|
|
14955
14959
|
[]
|
|
14956
14960
|
), at = rt(() => {
|
|
14957
|
-
const Q = (
|
|
14958
|
-
if (!Array.isArray(
|
|
14961
|
+
const Q = (Se) => {
|
|
14962
|
+
if (!Array.isArray(Se) || Se.length === 0)
|
|
14959
14963
|
return null;
|
|
14960
|
-
const ct =
|
|
14964
|
+
const ct = Se.map((xt) => {
|
|
14961
14965
|
if (typeof xt == "string")
|
|
14962
14966
|
return xt.trim();
|
|
14963
14967
|
if (xt && typeof xt == "object" && "type" in xt) {
|
|
@@ -14968,59 +14972,59 @@ function Ti({
|
|
|
14968
14972
|
return null;
|
|
14969
14973
|
}).filter((xt) => !!(xt && xt.length));
|
|
14970
14974
|
return ct.length ? ct.join(", ") : null;
|
|
14971
|
-
}, de = Array.isArray(E) ? E.map((
|
|
14972
|
-
const ct = Q(
|
|
14975
|
+
}, de = Array.isArray(E) ? E.map((Se) => {
|
|
14976
|
+
const ct = Q(Se.next);
|
|
14973
14977
|
return ct ? {
|
|
14974
|
-
...
|
|
14978
|
+
...Se,
|
|
14975
14979
|
metadata: {
|
|
14976
|
-
...
|
|
14980
|
+
...Se.metadata ?? {},
|
|
14977
14981
|
next: ct
|
|
14978
14982
|
}
|
|
14979
|
-
} :
|
|
14983
|
+
} : Se;
|
|
14980
14984
|
}) : [];
|
|
14981
|
-
return de.some((
|
|
14982
|
-
const xt =
|
|
14985
|
+
return de.some((Se) => ve(Se.metadata, "step") !== null) && de.sort((Se, ct) => {
|
|
14986
|
+
const xt = ve(Se.metadata, "step"), un = ve(ct.metadata, "step");
|
|
14983
14987
|
if (xt !== null || un !== null)
|
|
14984
14988
|
return (un ?? Number.NEGATIVE_INFINITY) - (xt ?? Number.NEGATIVE_INFINITY);
|
|
14985
|
-
const Pr = Date.parse(
|
|
14989
|
+
const Pr = Date.parse(Se.createdAt ?? ""), Or = Date.parse(ct.createdAt ?? "");
|
|
14986
14990
|
return Number.isNaN(Pr) || Number.isNaN(Or) ? 0 : Or - Pr;
|
|
14987
14991
|
}), de;
|
|
14988
|
-
}, [E,
|
|
14992
|
+
}, [E, ve]), { checkpointMetaById: q, checkpointIndexByKey: se } = rt(() => {
|
|
14989
14993
|
const Q = /* @__PURE__ */ new Map(), de = /* @__PURE__ */ new Map();
|
|
14990
14994
|
for (const fe of at) {
|
|
14991
|
-
const
|
|
14992
|
-
if (!
|
|
14993
|
-
const ct =
|
|
14994
|
-
id:
|
|
14995
|
+
const Se = fe.checkpointId ?? null;
|
|
14996
|
+
if (!Se) continue;
|
|
14997
|
+
const ct = ve(fe.metadata, "step"), xt = we(fe.metadata, "source"), un = {
|
|
14998
|
+
id: Se,
|
|
14995
14999
|
step: ct,
|
|
14996
15000
|
source: xt,
|
|
14997
15001
|
createdAt: fe.createdAt ?? null,
|
|
14998
15002
|
namespace: fe.checkpointNs ?? null,
|
|
14999
15003
|
parentId: fe.parentId ?? null
|
|
15000
15004
|
};
|
|
15001
|
-
if (Q.set(
|
|
15005
|
+
if (Q.set(Se, un), ct !== null && xt) {
|
|
15002
15006
|
const Pr = `${ct}:${xt}`, Or = de.get(Pr) ?? [];
|
|
15003
15007
|
Or.push(un), de.set(Pr, Or);
|
|
15004
15008
|
}
|
|
15005
15009
|
}
|
|
15006
15010
|
for (const fe of de.values())
|
|
15007
|
-
fe.sort((
|
|
15008
|
-
const xt =
|
|
15011
|
+
fe.sort((Se, ct) => {
|
|
15012
|
+
const xt = Se.createdAt ?? "";
|
|
15009
15013
|
return (ct.createdAt ?? "").localeCompare(xt);
|
|
15010
15014
|
});
|
|
15011
15015
|
return { checkpointMetaById: Q, checkpointIndexByKey: de };
|
|
15012
|
-
}, [at,
|
|
15013
|
-
|
|
15014
|
-
}, []), Ut =
|
|
15016
|
+
}, [at, ve, we]), te = j ?? [], me = He(null), le = He(null), Re = Te(() => {
|
|
15017
|
+
me.current && (me.current.value = ""), le.current && (le.current.value = ""), Fe((Q) => Q + 1), et((Q) => Q + 1);
|
|
15018
|
+
}, []), Ut = Te(
|
|
15015
15019
|
(Q) => {
|
|
15016
15020
|
_e(Q);
|
|
15017
15021
|
},
|
|
15018
15022
|
[_e]
|
|
15019
15023
|
), Tt = He(!1);
|
|
15020
15024
|
Et(() => {
|
|
15021
|
-
Tt.current && !$ && (
|
|
15022
|
-
}, [$,
|
|
15023
|
-
const [cn, kt] =
|
|
15025
|
+
Tt.current && !$ && (ge([]), Re()), Tt.current = $;
|
|
15026
|
+
}, [$, Re]);
|
|
15027
|
+
const [cn, kt] = be("desktop");
|
|
15024
15028
|
Et(() => {
|
|
15025
15029
|
const Q = () => {
|
|
15026
15030
|
const de = window.innerWidth;
|
|
@@ -15072,11 +15076,11 @@ function Ti({
|
|
|
15072
15076
|
}
|
|
15073
15077
|
}
|
|
15074
15078
|
try {
|
|
15075
|
-
const fe = _ ?? void 0,
|
|
15079
|
+
const fe = _ ?? void 0, Se = J ?? void 0, ct = D ? {
|
|
15076
15080
|
edit: !0,
|
|
15077
15081
|
originalMessageId: D,
|
|
15078
|
-
...
|
|
15079
|
-
...
|
|
15082
|
+
...V != null && V.checkpointId ? { originalCheckpointId: V.checkpointId } : {},
|
|
15083
|
+
...V != null && V.checkpointNs ? { originalCheckpointNs: V.checkpointNs } : {}
|
|
15080
15084
|
} : void 0;
|
|
15081
15085
|
await A(
|
|
15082
15086
|
{
|
|
@@ -15086,30 +15090,30 @@ function Ti({
|
|
|
15086
15090
|
},
|
|
15087
15091
|
{
|
|
15088
15092
|
checkpointId: fe,
|
|
15089
|
-
checkpointNs:
|
|
15093
|
+
checkpointNs: Se
|
|
15090
15094
|
}
|
|
15091
|
-
), p == null || p(de), _e(""), Ze(null),
|
|
15095
|
+
), p == null || p(de), _e(""), Ze(null), ge([]), Re(), H(null), ie(""), Me(null);
|
|
15092
15096
|
} catch (fe) {
|
|
15093
|
-
const
|
|
15094
|
-
Ze(
|
|
15097
|
+
const Se = (fe == null ? void 0 : fe.message) || "Failed to send message";
|
|
15098
|
+
Ze(Se), m == null || m(Se);
|
|
15095
15099
|
}
|
|
15096
15100
|
}
|
|
15097
15101
|
}, vo = z.useCallback(
|
|
15098
15102
|
(Q, de, fe) => {
|
|
15099
|
-
c && (Ye.current = Ct, H(Q),
|
|
15103
|
+
c && (Ye.current = Ct, H(Q), ie(de), _e(de), Ze(null), Me({
|
|
15100
15104
|
checkpointId: (fe == null ? void 0 : fe.checkpointId) ?? null,
|
|
15101
15105
|
checkpointNs: (fe == null ? void 0 : fe.checkpointNs) ?? null
|
|
15102
15106
|
}));
|
|
15103
15107
|
},
|
|
15104
15108
|
[Ct, c, _e]
|
|
15105
15109
|
), R = z.useCallback(() => {
|
|
15106
|
-
H(null),
|
|
15107
|
-
}, [Ct, _e]),
|
|
15110
|
+
H(null), ie(""), Me(null), Ze(null), _e(Ye.current ?? Ct), Ye.current = null;
|
|
15111
|
+
}, [Ct, _e]), W = Te(
|
|
15108
15112
|
(Q, de, fe) => {
|
|
15109
15113
|
vo(Q, de, fe);
|
|
15110
15114
|
},
|
|
15111
15115
|
[vo]
|
|
15112
|
-
),
|
|
15116
|
+
), ae = Te((Q) => {
|
|
15113
15117
|
for (let de = Q - 1; de >= 0; de--)
|
|
15114
15118
|
if (w[de].role === "user") {
|
|
15115
15119
|
const fe = w[de].content || [], ct = fe.filter((xt) => xt.type === "text").map((xt) => xt.text).join("") || (() => {
|
|
@@ -15130,11 +15134,11 @@ function Ti({
|
|
|
15130
15134
|
}
|
|
15131
15135
|
}, [w, A, _, J]), Ee = (Q) => {
|
|
15132
15136
|
const de = Array.from(Q.target.files || []);
|
|
15133
|
-
|
|
15137
|
+
ge((fe) => [...fe, ...de]), Q.target.value = "";
|
|
15134
15138
|
}, tt = (Q) => {
|
|
15135
|
-
|
|
15136
|
-
const fe = de.filter((
|
|
15137
|
-
return fe.length === 0 &&
|
|
15139
|
+
ge((de) => {
|
|
15140
|
+
const fe = de.filter((Se, ct) => Q !== ct);
|
|
15141
|
+
return fe.length === 0 && Re(), fe;
|
|
15138
15142
|
});
|
|
15139
15143
|
}, lt = async (Q) => {
|
|
15140
15144
|
const de = (Q.target.files || [])[0];
|
|
@@ -15151,10 +15155,10 @@ function Ti({
|
|
|
15151
15155
|
const fe = `Uploaded ${de.name} - processing through chat stream`;
|
|
15152
15156
|
mt(fe);
|
|
15153
15157
|
} catch (fe) {
|
|
15154
|
-
const
|
|
15155
|
-
console.error("Excel upload failed", fe), Qe(
|
|
15158
|
+
const Se = fe instanceof Error ? fe.message : "Failed to upload Excel file";
|
|
15159
|
+
console.error("Excel upload failed", fe), Qe(Se), m == null || m(Se);
|
|
15156
15160
|
} finally {
|
|
15157
|
-
Ge(!1), Q.target.value = "",
|
|
15161
|
+
Ge(!1), Q.target.value = "", Re();
|
|
15158
15162
|
}
|
|
15159
15163
|
}
|
|
15160
15164
|
}, Ke = async (Q) => {
|
|
@@ -15163,34 +15167,34 @@ function Ti({
|
|
|
15163
15167
|
try {
|
|
15164
15168
|
if (!Q) {
|
|
15165
15169
|
await S(), requestAnimationFrame(() => {
|
|
15166
|
-
var
|
|
15167
|
-
(
|
|
15170
|
+
var Se;
|
|
15171
|
+
(Se = B.current) == null || Se.scrollToLatest();
|
|
15168
15172
|
});
|
|
15169
15173
|
return;
|
|
15170
15174
|
}
|
|
15171
|
-
const de = at.find((
|
|
15175
|
+
const de = at.find((Se) => Se.checkpointId === Q), fe = (de == null ? void 0 : de.checkpointNs) ?? null;
|
|
15172
15176
|
await C(Q, fe), requestAnimationFrame(() => {
|
|
15173
|
-
var
|
|
15174
|
-
(
|
|
15177
|
+
var Se;
|
|
15178
|
+
(Se = B.current) == null || Se.scrollToTop();
|
|
15175
15179
|
});
|
|
15176
15180
|
} finally {
|
|
15177
15181
|
zt(!1);
|
|
15178
15182
|
}
|
|
15179
15183
|
}
|
|
15180
|
-
}, Be =
|
|
15184
|
+
}, Be = Te(
|
|
15181
15185
|
async (Q) => {
|
|
15182
15186
|
await Ke(Q);
|
|
15183
15187
|
},
|
|
15184
15188
|
[Ke]
|
|
15185
15189
|
), Pt = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${f.container || ""}`, wt = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 bg-transparent ${f.messagesArea || ""}`, bt = `flex-shrink-0 w-full border-t p-4 bg-transparent ${f.inputArea || ""}`;
|
|
15186
|
-
return
|
|
15190
|
+
return Te(
|
|
15187
15191
|
(Q) => {
|
|
15188
15192
|
if (!Q)
|
|
15189
15193
|
return "Latest";
|
|
15190
15194
|
const de = [];
|
|
15191
15195
|
Q.step !== null && de.push(`Step ${Q.step}`), Q.source && de.push(Q.source);
|
|
15192
|
-
const fe = Q.createdAt ? new Date(Q.createdAt) : null,
|
|
15193
|
-
return `${
|
|
15196
|
+
const fe = Q.createdAt ? new Date(Q.createdAt) : null, Se = fe && !Number.isNaN(fe.getTime()) ? fe.toLocaleString() : Q.createdAt ?? Q.id, ct = de.length ? ` — ${de.join(" • ")}` : "";
|
|
15197
|
+
return `${Se}${ct}`;
|
|
15194
15198
|
},
|
|
15195
15199
|
[]
|
|
15196
15200
|
), /* @__PURE__ */ u.jsxs("div", { className: Pt, children: [
|
|
@@ -15228,21 +15232,21 @@ function Ti({
|
|
|
15228
15232
|
layoutSize: cn,
|
|
15229
15233
|
enableMessageEditing: c,
|
|
15230
15234
|
editingMessageId: D,
|
|
15231
|
-
onEdit:
|
|
15232
|
-
onRegenerate:
|
|
15235
|
+
onEdit: W,
|
|
15236
|
+
onRegenerate: ae,
|
|
15233
15237
|
onCancelEdit: R,
|
|
15234
15238
|
emptyMessage: it ?? void 0,
|
|
15235
15239
|
isNavigatingCheckpoint: _t,
|
|
15236
15240
|
activeInterrupt: pe,
|
|
15237
|
-
disableInterruptActions:
|
|
15238
|
-
onInterruptActionStart:
|
|
15241
|
+
disableInterruptActions: ke,
|
|
15242
|
+
onInterruptActionStart: K,
|
|
15239
15243
|
onInterruptActionEnd: oe,
|
|
15240
15244
|
showToolMessages: d,
|
|
15241
|
-
checkpointMetaById:
|
|
15242
|
-
checkpointIndexByKey:
|
|
15245
|
+
checkpointMetaById: q,
|
|
15246
|
+
checkpointIndexByKey: se,
|
|
15243
15247
|
activeCheckpointId: _,
|
|
15244
15248
|
onSelectCheckpoint: Be,
|
|
15245
|
-
timelineCheckpoints:
|
|
15249
|
+
timelineCheckpoints: te,
|
|
15246
15250
|
messagePreviews: P
|
|
15247
15251
|
}
|
|
15248
15252
|
),
|
|
@@ -15284,7 +15288,7 @@ function Ti({
|
|
|
15284
15288
|
/* @__PURE__ */ u.jsx(
|
|
15285
15289
|
"input",
|
|
15286
15290
|
{
|
|
15287
|
-
ref:
|
|
15291
|
+
ref: me,
|
|
15288
15292
|
type: "file",
|
|
15289
15293
|
multiple: !0,
|
|
15290
15294
|
onChange: (Q) => Ee(Q),
|
|
@@ -15312,7 +15316,7 @@ function Ti({
|
|
|
15312
15316
|
/* @__PURE__ */ u.jsx(
|
|
15313
15317
|
"input",
|
|
15314
15318
|
{
|
|
15315
|
-
ref:
|
|
15319
|
+
ref: le,
|
|
15316
15320
|
type: "file",
|
|
15317
15321
|
accept: ".xls,.xlsx,.xlsm",
|
|
15318
15322
|
onChange: lt,
|
|
@@ -15346,7 +15350,7 @@ function Ti({
|
|
|
15346
15350
|
/* @__PURE__ */ u.jsxs(df, { align: "start", sideOffset: 6, className: "w-52", children: [
|
|
15347
15351
|
a && /* @__PURE__ */ u.jsxs(Hi, { onClick: () => {
|
|
15348
15352
|
var Q;
|
|
15349
|
-
return (Q =
|
|
15353
|
+
return (Q = me.current) == null ? void 0 : Q.click();
|
|
15350
15354
|
}, className: "cursor-pointer", children: [
|
|
15351
15355
|
/* @__PURE__ */ u.jsx(ki, { className: "h-4 w-4 mr-2" }),
|
|
15352
15356
|
" Attach files or images"
|
|
@@ -15356,7 +15360,7 @@ function Ti({
|
|
|
15356
15360
|
{
|
|
15357
15361
|
onClick: () => {
|
|
15358
15362
|
var Q;
|
|
15359
|
-
We || (Q =
|
|
15363
|
+
We || (Q = le.current) == null || Q.click();
|
|
15360
15364
|
},
|
|
15361
15365
|
className: `cursor-pointer ${We ? "opacity-60 pointer-events-none" : ""}`,
|
|
15362
15366
|
children: [
|
|
@@ -15394,7 +15398,7 @@ const us = v.forwardRef(
|
|
|
15394
15398
|
"input",
|
|
15395
15399
|
{
|
|
15396
15400
|
type: t,
|
|
15397
|
-
className:
|
|
15401
|
+
className: ee(
|
|
15398
15402
|
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
15399
15403
|
e
|
|
15400
15404
|
),
|
|
@@ -15922,7 +15926,7 @@ const Hp = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
15922
15926
|
Bp,
|
|
15923
15927
|
{
|
|
15924
15928
|
ref: r,
|
|
15925
|
-
className:
|
|
15929
|
+
className: ee("relative overflow-hidden", e),
|
|
15926
15930
|
...n,
|
|
15927
15931
|
children: [
|
|
15928
15932
|
/* @__PURE__ */ u.jsx(BC, { className: "h-full w-full rounded-[inherit] overflow-auto", children: t }),
|
|
@@ -15937,7 +15941,7 @@ const Up = v.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r)
|
|
|
15937
15941
|
{
|
|
15938
15942
|
ref: r,
|
|
15939
15943
|
orientation: t,
|
|
15940
|
-
className:
|
|
15944
|
+
className: ee(
|
|
15941
15945
|
"flex touch-none select-none transition-colors",
|
|
15942
15946
|
t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
15943
15947
|
t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
@@ -15968,80 +15972,80 @@ function Fc({
|
|
|
15968
15972
|
setCurrentThreadId: h,
|
|
15969
15973
|
isLoading: m,
|
|
15970
15974
|
actions: x
|
|
15971
|
-
} = da(), { loadThread: y } = fa(), { createThread: g, deleteThread: w, renameThread: b } = x, [T, C] =
|
|
15975
|
+
} = da(), { loadThread: y } = fa(), { createThread: g, deleteThread: w, renameThread: b } = x, [T, C] = be(Array.isArray(f) ? f : []), S = He(T.length > 0), k = He(null), E = He(0), [N, M] = be(null), [j, P] = be(""), [$, I] = be(!1);
|
|
15972
15976
|
Et(() => {
|
|
15973
|
-
const
|
|
15974
|
-
if (
|
|
15975
|
-
S.current = !0, C(
|
|
15977
|
+
const K = Array.isArray(f) ? f : [];
|
|
15978
|
+
if (K.length > 0) {
|
|
15979
|
+
S.current = !0, C(K);
|
|
15976
15980
|
return;
|
|
15977
15981
|
}
|
|
15978
|
-
m || (S.current = !1, C(
|
|
15982
|
+
m || (S.current = !1, C(K));
|
|
15979
15983
|
}, [f, m]), Et(() => {
|
|
15980
15984
|
if (!k.current) return;
|
|
15981
|
-
const
|
|
15985
|
+
const K = k.current.querySelector(
|
|
15982
15986
|
"[data-radix-scroll-area-viewport]"
|
|
15983
15987
|
);
|
|
15984
|
-
if (!
|
|
15988
|
+
if (!K) return;
|
|
15985
15989
|
let oe = null, Y = null;
|
|
15986
15990
|
return oe = requestAnimationFrame(() => {
|
|
15987
15991
|
Y = requestAnimationFrame(() => {
|
|
15988
|
-
|
|
15992
|
+
K.scrollTop = E.current;
|
|
15989
15993
|
});
|
|
15990
15994
|
}), () => {
|
|
15991
15995
|
oe !== null && cancelAnimationFrame(oe), Y !== null && cancelAnimationFrame(Y);
|
|
15992
15996
|
};
|
|
15993
15997
|
}, [T]);
|
|
15994
|
-
const F = async (
|
|
15998
|
+
const F = async (K) => {
|
|
15995
15999
|
try {
|
|
15996
|
-
h(
|
|
16000
|
+
h(K), await y(K), a == null || a(K), l == null || l(K);
|
|
15997
16001
|
} catch (oe) {
|
|
15998
16002
|
console.error("Failed to select thread:", oe);
|
|
15999
16003
|
}
|
|
16000
16004
|
}, A = async () => {
|
|
16001
16005
|
try {
|
|
16002
16006
|
I(!0);
|
|
16003
|
-
const
|
|
16004
|
-
|
|
16005
|
-
} catch (
|
|
16006
|
-
console.error("Failed to create thread:",
|
|
16007
|
+
const K = await g();
|
|
16008
|
+
K && (c == null || c(K), a == null || a(K));
|
|
16009
|
+
} catch (K) {
|
|
16010
|
+
console.error("Failed to create thread:", K);
|
|
16007
16011
|
} finally {
|
|
16008
16012
|
I(!1);
|
|
16009
16013
|
}
|
|
16010
|
-
}, X = async (
|
|
16014
|
+
}, X = async (K, oe) => {
|
|
16011
16015
|
if (oe.stopPropagation(), !!confirm("Delete this thread?")) {
|
|
16012
16016
|
if (k.current) {
|
|
16013
16017
|
const Y = k.current.querySelector("[data-radix-scroll-area-viewport]");
|
|
16014
16018
|
Y && (E.current = Y.scrollTop);
|
|
16015
16019
|
}
|
|
16016
16020
|
try {
|
|
16017
|
-
await w(
|
|
16021
|
+
await w(K), d == null || d(K);
|
|
16018
16022
|
} catch (Y) {
|
|
16019
16023
|
console.error("Failed to delete thread:", Y);
|
|
16020
16024
|
}
|
|
16021
16025
|
}
|
|
16022
|
-
}, L = (
|
|
16023
|
-
oe.stopPropagation(), M(
|
|
16024
|
-
}, _ = async (
|
|
16026
|
+
}, L = (K, oe) => {
|
|
16027
|
+
oe.stopPropagation(), M(K.threadId), P(K.title || `Thread ${K.threadId.slice(0, 8)}`);
|
|
16028
|
+
}, _ = async (K) => {
|
|
16025
16029
|
if (j.trim())
|
|
16026
16030
|
try {
|
|
16027
|
-
await b(
|
|
16031
|
+
await b(K, j.trim()), M(null), P("");
|
|
16028
16032
|
} catch (oe) {
|
|
16029
16033
|
console.error("Failed to update title:", oe);
|
|
16030
16034
|
}
|
|
16031
16035
|
}, J = () => {
|
|
16032
16036
|
M(null), P("");
|
|
16033
|
-
}, G = (
|
|
16034
|
-
|
|
16035
|
-
}, pe = (
|
|
16036
|
-
if (!
|
|
16037
|
+
}, G = (K, oe) => {
|
|
16038
|
+
K.key === "Enter" ? _(oe) : K.key === "Escape" && J();
|
|
16039
|
+
}, pe = (K) => {
|
|
16040
|
+
if (!K) return "";
|
|
16037
16041
|
try {
|
|
16038
|
-
const oe = new Date(
|
|
16042
|
+
const oe = new Date(K), D = (/* @__PURE__ */ new Date()).getTime() - oe.getTime(), H = Math.floor(D / (1e3 * 60 * 60 * 24));
|
|
16039
16043
|
return H === 0 ? oe.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : H === 1 ? "Yesterday" : H < 7 ? `${H} days ago` : oe.toLocaleDateString();
|
|
16040
16044
|
} catch {
|
|
16041
16045
|
return "";
|
|
16042
16046
|
}
|
|
16043
|
-
},
|
|
16044
|
-
const oe =
|
|
16047
|
+
}, ke = (K) => K.title || `Thread ${K.threadId.slice(0, 8)}`, Ae = (K) => {
|
|
16048
|
+
const oe = ke(K);
|
|
16045
16049
|
return oe.length <= $c ? oe : `${oe.slice(0, $c)}...`;
|
|
16046
16050
|
};
|
|
16047
16051
|
return /* @__PURE__ */ u.jsxs("div", { className: `flex flex-col h-full ${e} ${s.container || ""}`, children: [
|
|
@@ -16069,32 +16073,32 @@ function Fc({
|
|
|
16069
16073
|
] }) : T.length === 0 ? /* @__PURE__ */ u.jsxs("div", { className: "text-center py-8 text-slate-400", children: [
|
|
16070
16074
|
/* @__PURE__ */ u.jsx(pm, { className: "w-8 h-8 mx-auto mb-2 opacity-40 text-slate-500" }),
|
|
16071
16075
|
/* @__PURE__ */ u.jsx("p", { className: "text-sm text-slate-500", children: "No conversations yet" })
|
|
16072
|
-
] }) : T.slice().sort((
|
|
16076
|
+
] }) : T.slice().sort((K, oe) => new Date(oe.updatedAt || oe.createdAt || "").getTime() - new Date(K.updatedAt || K.createdAt || "").getTime()).map((K) => /* @__PURE__ */ u.jsxs(
|
|
16073
16077
|
"div",
|
|
16074
16078
|
{
|
|
16075
|
-
onClick: () => F(
|
|
16076
|
-
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? p) ===
|
|
16079
|
+
onClick: () => F(K.threadId),
|
|
16080
|
+
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? p) === K.threadId ? `${s.activeThread || "bg-slate-600 border-slate-500"} ` : `${s.threadItem || "bg-slate-700 border-slate-600 hover:bg-slate-600 text-gray-900 dark:text-slate-100"}`} ${s.threadItem || ""} text-gray-900 dark:text-slate-100`,
|
|
16077
16081
|
children: [
|
|
16078
16082
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
16079
|
-
/* @__PURE__ */ u.jsx("div", { className: "flex-1 min-w-0", children: N ===
|
|
16080
|
-
/* @__PURE__ */ u.jsx(us, { value: j, onChange: (oe) => P(oe.target.value), onKeyDown: (oe) => G(oe,
|
|
16081
|
-
/* @__PURE__ */ u.jsx(ot, { variant: "ghost", size: "sm", onClick: () => _(
|
|
16083
|
+
/* @__PURE__ */ u.jsx("div", { className: "flex-1 min-w-0", children: N === K.threadId ? /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", onClick: (oe) => oe.stopPropagation(), children: [
|
|
16084
|
+
/* @__PURE__ */ u.jsx(us, { value: j, onChange: (oe) => P(oe.target.value), onKeyDown: (oe) => G(oe, K.threadId), className: "h-6 text-sm", autoFocus: !0 }),
|
|
16085
|
+
/* @__PURE__ */ u.jsx(ot, { variant: "ghost", size: "sm", onClick: () => _(K.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(ra, { size: 12 }) }),
|
|
16082
16086
|
/* @__PURE__ */ u.jsx(ot, { variant: "ghost", size: "sm", onClick: J, className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(gr, { size: 12 }) })
|
|
16083
16087
|
] }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
16084
|
-
/* @__PURE__ */ u.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: Ae(
|
|
16088
|
+
/* @__PURE__ */ u.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: Ae(K) }),
|
|
16085
16089
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
|
|
16086
16090
|
/* @__PURE__ */ u.jsx(hm, { size: 10 }),
|
|
16087
|
-
/* @__PURE__ */ u.jsx("span", { children: pe(
|
|
16091
|
+
/* @__PURE__ */ u.jsx("span", { children: pe(K.updatedAt || K.createdAt) })
|
|
16088
16092
|
] })
|
|
16089
16093
|
] }) }),
|
|
16090
16094
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
|
|
16091
|
-
r && N !==
|
|
16095
|
+
r && N !== K.threadId && /* @__PURE__ */ u.jsx(ot, { variant: "ghost", size: "sm", onClick: (oe) => L(K, oe), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ u.jsx(Wc, { size: 12 }) }),
|
|
16092
16096
|
n && /* @__PURE__ */ u.jsx(
|
|
16093
16097
|
ot,
|
|
16094
16098
|
{
|
|
16095
16099
|
variant: "ghost",
|
|
16096
16100
|
size: "sm",
|
|
16097
|
-
onClick: (oe) => X(
|
|
16101
|
+
onClick: (oe) => X(K.threadId, oe),
|
|
16098
16102
|
className: "h-6 w-6 p-0 text-red-400 hover:text-red-300 hover:bg-red-900/20",
|
|
16099
16103
|
title: "Delete thread",
|
|
16100
16104
|
children: /* @__PURE__ */ u.jsx(mm, { size: 12 })
|
|
@@ -16102,10 +16106,10 @@ function Fc({
|
|
|
16102
16106
|
)
|
|
16103
16107
|
] })
|
|
16104
16108
|
] }),
|
|
16105
|
-
i ===
|
|
16109
|
+
i === K.threadId && /* @__PURE__ */ u.jsx("div", { className: "absolute left-0 top-1/2 -translate-y-1/2 w-1 h-8 bg-blue-400 rounded-r" })
|
|
16106
16110
|
]
|
|
16107
16111
|
},
|
|
16108
|
-
|
|
16112
|
+
K.threadId
|
|
16109
16113
|
)) })
|
|
16110
16114
|
}
|
|
16111
16115
|
)
|
|
@@ -16232,7 +16236,7 @@ const YC = gs(
|
|
|
16232
16236
|
Yp,
|
|
16233
16237
|
{
|
|
16234
16238
|
ref: n,
|
|
16235
|
-
className:
|
|
16239
|
+
className: ee(YC(), e),
|
|
16236
16240
|
...t
|
|
16237
16241
|
}
|
|
16238
16242
|
));
|
|
@@ -16361,7 +16365,7 @@ var nh = Jp, eT = Qp;
|
|
|
16361
16365
|
const Ln = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
16362
16366
|
nh,
|
|
16363
16367
|
{
|
|
16364
|
-
className:
|
|
16368
|
+
className: ee(
|
|
16365
16369
|
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
16366
16370
|
e
|
|
16367
16371
|
),
|
|
@@ -16370,7 +16374,7 @@ const Ln = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
16370
16374
|
children: /* @__PURE__ */ u.jsx(
|
|
16371
16375
|
eT,
|
|
16372
16376
|
{
|
|
16373
|
-
className:
|
|
16377
|
+
className: ee(
|
|
16374
16378
|
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
16375
16379
|
)
|
|
16376
16380
|
}
|
|
@@ -16607,9 +16611,9 @@ var dn = 10, [fh, qn] = jr(sr), dT = "SelectContentImpl", fT = br("SelectContent
|
|
|
16607
16611
|
}, [b]), ma();
|
|
16608
16612
|
const A = v.useCallback(
|
|
16609
16613
|
(Y) => {
|
|
16610
|
-
const [D, ...H] = P().map((
|
|
16611
|
-
for (const
|
|
16612
|
-
if (
|
|
16614
|
+
const [D, ...H] = P().map((V) => V.ref.current), [ne] = H.slice(-1), ie = document.activeElement;
|
|
16615
|
+
for (const V of Y)
|
|
16616
|
+
if (V === ie || (V == null || V.scrollIntoView({ block: "nearest" }), V === D && C && (C.scrollTop = 0), V === ne && C && (C.scrollTop = C.scrollHeight), V == null || V.focus(), document.activeElement !== ie)) return;
|
|
16613
16617
|
},
|
|
16614
16618
|
[P, C]
|
|
16615
16619
|
), X = v.useCallback(
|
|
@@ -16624,10 +16628,10 @@ var dn = 10, [fh, qn] = jr(sr), dT = "SelectContentImpl", fT = br("SelectContent
|
|
|
16624
16628
|
if (b) {
|
|
16625
16629
|
let Y = { x: 0, y: 0 };
|
|
16626
16630
|
const D = (ne) => {
|
|
16627
|
-
var
|
|
16631
|
+
var ie, V;
|
|
16628
16632
|
Y = {
|
|
16629
|
-
x: Math.abs(Math.round(ne.pageX) - (((
|
|
16630
|
-
y: Math.abs(Math.round(ne.pageY) - (((
|
|
16633
|
+
x: Math.abs(Math.round(ne.pageX) - (((ie = _.current) == null ? void 0 : ie.x) ?? 0)),
|
|
16634
|
+
y: Math.abs(Math.round(ne.pageY) - (((V = _.current) == null ? void 0 : V.y) ?? 0))
|
|
16631
16635
|
};
|
|
16632
16636
|
}, H = (ne) => {
|
|
16633
16637
|
Y.x <= 10 && Y.y <= 10 ? ne.preventDefault() : b.contains(ne.target) || L(!1), document.removeEventListener("pointermove", D), _.current = null;
|
|
@@ -16643,7 +16647,7 @@ var dn = 10, [fh, qn] = jr(sr), dT = "SelectContentImpl", fT = br("SelectContent
|
|
|
16643
16647
|
};
|
|
16644
16648
|
}, [L]);
|
|
16645
16649
|
const [J, G] = Ah((Y) => {
|
|
16646
|
-
const D = P().filter((
|
|
16650
|
+
const D = P().filter((ie) => !ie.disabled), H = D.find((ie) => ie.ref.current === document.activeElement), ne = _h(D, Y, H);
|
|
16647
16651
|
ne && setTimeout(() => ne.ref.current.focus());
|
|
16648
16652
|
}), pe = v.useCallback(
|
|
16649
16653
|
(Y, D, H) => {
|
|
@@ -16651,13 +16655,13 @@ var dn = 10, [fh, qn] = jr(sr), dT = "SelectContentImpl", fT = br("SelectContent
|
|
|
16651
16655
|
(w.value !== void 0 && w.value === D || ne) && (N(Y), ne && (F.current = !0));
|
|
16652
16656
|
},
|
|
16653
16657
|
[w.value]
|
|
16654
|
-
),
|
|
16658
|
+
), ke = v.useCallback(() => b == null ? void 0 : b.focus(), [b]), Ae = v.useCallback(
|
|
16655
16659
|
(Y, D, H) => {
|
|
16656
16660
|
const ne = !F.current && !H;
|
|
16657
16661
|
(w.value !== void 0 && w.value === D || ne) && j(Y);
|
|
16658
16662
|
},
|
|
16659
16663
|
[w.value]
|
|
16660
|
-
),
|
|
16664
|
+
), K = r === "popper" ? Xi : hh, oe = K === Xi ? {
|
|
16661
16665
|
side: a,
|
|
16662
16666
|
sideOffset: l,
|
|
16663
16667
|
align: c,
|
|
@@ -16678,7 +16682,7 @@ var dn = 10, [fh, qn] = jr(sr), dT = "SelectContentImpl", fT = br("SelectContent
|
|
|
16678
16682
|
onViewportChange: S,
|
|
16679
16683
|
itemRefCallback: pe,
|
|
16680
16684
|
selectedItem: E,
|
|
16681
|
-
onItemLeave:
|
|
16685
|
+
onItemLeave: ke,
|
|
16682
16686
|
itemTextRefCallback: Ae,
|
|
16683
16687
|
focusSelectedItem: X,
|
|
16684
16688
|
selectedItemText: M,
|
|
@@ -16707,7 +16711,7 @@ var dn = 10, [fh, qn] = jr(sr), dT = "SelectContentImpl", fT = br("SelectContent
|
|
|
16707
16711
|
onFocusOutside: (Y) => Y.preventDefault(),
|
|
16708
16712
|
onDismiss: () => w.onOpenChange(!1),
|
|
16709
16713
|
children: /* @__PURE__ */ u.jsx(
|
|
16710
|
-
|
|
16714
|
+
K,
|
|
16711
16715
|
{
|
|
16712
16716
|
role: "listbox",
|
|
16713
16717
|
id: w.contentId,
|
|
@@ -16729,10 +16733,10 @@ var dn = 10, [fh, qn] = jr(sr), dT = "SelectContentImpl", fT = br("SelectContent
|
|
|
16729
16733
|
onKeyDown: he(g.onKeyDown, (Y) => {
|
|
16730
16734
|
const D = Y.ctrlKey || Y.altKey || Y.metaKey;
|
|
16731
16735
|
if (Y.key === "Tab" && Y.preventDefault(), !D && Y.key.length === 1 && G(Y.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(Y.key)) {
|
|
16732
|
-
let ne = P().filter((
|
|
16736
|
+
let ne = P().filter((ie) => !ie.disabled).map((ie) => ie.ref.current);
|
|
16733
16737
|
if (["ArrowUp", "End"].includes(Y.key) && (ne = ne.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(Y.key)) {
|
|
16734
|
-
const
|
|
16735
|
-
ne = ne.slice(
|
|
16738
|
+
const ie = Y.target, V = ne.indexOf(ie);
|
|
16739
|
+
ne = ne.slice(V + 1);
|
|
16736
16740
|
}
|
|
16737
16741
|
setTimeout(() => A(ne)), Y.preventDefault();
|
|
16738
16742
|
}
|
|
@@ -16753,7 +16757,7 @@ var pT = "SelectItemAlignedPosition", hh = v.forwardRef((e, t) => {
|
|
|
16753
16757
|
if (s.trigger && s.valueNode && a && c && x && y && g) {
|
|
16754
16758
|
const k = s.trigger.getBoundingClientRect(), E = c.getBoundingClientRect(), N = s.valueNode.getBoundingClientRect(), M = g.getBoundingClientRect();
|
|
16755
16759
|
if (s.dir !== "rtl") {
|
|
16756
|
-
const
|
|
16760
|
+
const ie = M.left - E.left, V = N.left - ie, Me = k.left - V, Ue = k.width + Me, Ze = Math.max(Ue, E.width), re = window.innerWidth - dn, ge = Yi(V, [
|
|
16757
16761
|
dn,
|
|
16758
16762
|
// Prevents the content from going off the starting edge of the
|
|
16759
16763
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -16762,31 +16766,31 @@ var pT = "SelectItemAlignedPosition", hh = v.forwardRef((e, t) => {
|
|
|
16762
16766
|
// https://github.com/radix-ui/primitives/issues/2049
|
|
16763
16767
|
Math.max(dn, re - Ze)
|
|
16764
16768
|
]);
|
|
16765
|
-
a.style.minWidth = Ue + "px", a.style.left =
|
|
16769
|
+
a.style.minWidth = Ue + "px", a.style.left = ge + "px";
|
|
16766
16770
|
} else {
|
|
16767
|
-
const
|
|
16771
|
+
const ie = E.right - M.right, V = window.innerWidth - N.right - ie, Me = window.innerWidth - k.right - V, Ue = k.width + Me, Ze = Math.max(Ue, E.width), re = window.innerWidth - dn, ge = Yi(V, [
|
|
16768
16772
|
dn,
|
|
16769
16773
|
Math.max(dn, re - Ze)
|
|
16770
16774
|
]);
|
|
16771
|
-
a.style.minWidth = Ue + "px", a.style.right =
|
|
16775
|
+
a.style.minWidth = Ue + "px", a.style.right = ge + "px";
|
|
16772
16776
|
}
|
|
16773
|
-
const j = p(), P = window.innerHeight - dn * 2, $ = x.scrollHeight, I = window.getComputedStyle(c), F = parseInt(I.borderTopWidth, 10), A = parseInt(I.paddingTop, 10), X = parseInt(I.borderBottomWidth, 10), L = parseInt(I.paddingBottom, 10), _ = F + A + $ + L + X, J = Math.min(y.offsetHeight * 5, _), G = window.getComputedStyle(x), pe = parseInt(G.paddingTop, 10),
|
|
16777
|
+
const j = p(), P = window.innerHeight - dn * 2, $ = x.scrollHeight, I = window.getComputedStyle(c), F = parseInt(I.borderTopWidth, 10), A = parseInt(I.paddingTop, 10), X = parseInt(I.borderBottomWidth, 10), L = parseInt(I.paddingBottom, 10), _ = F + A + $ + L + X, J = Math.min(y.offsetHeight * 5, _), G = window.getComputedStyle(x), pe = parseInt(G.paddingTop, 10), ke = parseInt(G.paddingBottom, 10), Ae = k.top + k.height / 2 - dn, K = P - Ae, oe = y.offsetHeight / 2, Y = y.offsetTop + oe, D = F + A + Y, H = _ - D;
|
|
16774
16778
|
if (D <= Ae) {
|
|
16775
|
-
const
|
|
16779
|
+
const ie = j.length > 0 && y === j[j.length - 1].ref.current;
|
|
16776
16780
|
a.style.bottom = "0px";
|
|
16777
|
-
const
|
|
16778
|
-
|
|
16781
|
+
const V = c.clientHeight - x.offsetTop - x.offsetHeight, Me = Math.max(
|
|
16782
|
+
K,
|
|
16779
16783
|
oe + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
16780
|
-
(
|
|
16784
|
+
(ie ? ke : 0) + V + X
|
|
16781
16785
|
), Ue = D + Me;
|
|
16782
16786
|
a.style.height = Ue + "px";
|
|
16783
16787
|
} else {
|
|
16784
|
-
const
|
|
16788
|
+
const ie = j.length > 0 && y === j[0].ref.current;
|
|
16785
16789
|
a.style.top = "0px";
|
|
16786
16790
|
const Me = Math.max(
|
|
16787
16791
|
Ae,
|
|
16788
16792
|
F + x.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
16789
|
-
(
|
|
16793
|
+
(ie ? pe : 0) + oe
|
|
16790
16794
|
) + H;
|
|
16791
16795
|
a.style.height = Me + "px", x.scrollTop = D - Ae + x.offsetTop;
|
|
16792
16796
|
}
|
|
@@ -17210,7 +17214,7 @@ const zc = TT, Bc = kT, ta = v.forwardRef(({ className: e, children: t, ...n },
|
|
|
17210
17214
|
jh,
|
|
17211
17215
|
{
|
|
17212
17216
|
ref: r,
|
|
17213
|
-
className:
|
|
17217
|
+
className: ee(
|
|
17214
17218
|
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
17215
17219
|
e
|
|
17216
17220
|
),
|
|
@@ -17226,7 +17230,7 @@ const Fh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
17226
17230
|
Dh,
|
|
17227
17231
|
{
|
|
17228
17232
|
ref: n,
|
|
17229
|
-
className:
|
|
17233
|
+
className: ee(
|
|
17230
17234
|
"flex cursor-default items-center justify-center py-1",
|
|
17231
17235
|
e
|
|
17232
17236
|
),
|
|
@@ -17239,7 +17243,7 @@ const zh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
17239
17243
|
Lh,
|
|
17240
17244
|
{
|
|
17241
17245
|
ref: n,
|
|
17242
|
-
className:
|
|
17246
|
+
className: ee(
|
|
17243
17247
|
"flex cursor-default items-center justify-center py-1",
|
|
17244
17248
|
e
|
|
17245
17249
|
),
|
|
@@ -17252,7 +17256,7 @@ const na = v.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
17252
17256
|
Ph,
|
|
17253
17257
|
{
|
|
17254
17258
|
ref: o,
|
|
17255
|
-
className:
|
|
17259
|
+
className: ee(
|
|
17256
17260
|
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
17257
17261
|
n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
17258
17262
|
e
|
|
@@ -17264,7 +17268,7 @@ const na = v.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
17264
17268
|
/* @__PURE__ */ u.jsx(
|
|
17265
17269
|
IT,
|
|
17266
17270
|
{
|
|
17267
|
-
className:
|
|
17271
|
+
className: ee(
|
|
17268
17272
|
"p-1",
|
|
17269
17273
|
n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
17270
17274
|
),
|
|
@@ -17280,7 +17284,7 @@ const _T = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
17280
17284
|
Oh,
|
|
17281
17285
|
{
|
|
17282
17286
|
ref: n,
|
|
17283
|
-
className:
|
|
17287
|
+
className: ee("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
|
|
17284
17288
|
...t
|
|
17285
17289
|
}
|
|
17286
17290
|
));
|
|
@@ -17289,7 +17293,7 @@ const Gn = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
17289
17293
|
Mh,
|
|
17290
17294
|
{
|
|
17291
17295
|
ref: r,
|
|
17292
|
-
className:
|
|
17296
|
+
className: ee(
|
|
17293
17297
|
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
17294
17298
|
e
|
|
17295
17299
|
),
|
|
@@ -17305,7 +17309,7 @@ const jT = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
17305
17309
|
$h,
|
|
17306
17310
|
{
|
|
17307
17311
|
ref: n,
|
|
17308
|
-
className:
|
|
17312
|
+
className: ee("-mx-1 my-1 h-px bg-muted", e),
|
|
17309
17313
|
...t
|
|
17310
17314
|
}
|
|
17311
17315
|
));
|
|
@@ -17334,7 +17338,7 @@ const Uh = v.forwardRef(
|
|
|
17334
17338
|
ref: o,
|
|
17335
17339
|
decorative: n,
|
|
17336
17340
|
orientation: t,
|
|
17337
|
-
className:
|
|
17341
|
+
className: ee(
|
|
17338
17342
|
"shrink-0 bg-border",
|
|
17339
17343
|
t === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
17340
17344
|
e
|
|
@@ -17347,7 +17351,7 @@ Uh.displayName = Hh.displayName;
|
|
|
17347
17351
|
const DT = fp, LT = JS, $T = pp, Wh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
17348
17352
|
Us,
|
|
17349
17353
|
{
|
|
17350
|
-
className:
|
|
17354
|
+
className: ee(
|
|
17351
17355
|
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
17352
17356
|
e
|
|
17353
17357
|
),
|
|
@@ -17377,7 +17381,7 @@ const FT = gs(
|
|
|
17377
17381
|
Ws,
|
|
17378
17382
|
{
|
|
17379
17383
|
ref: o,
|
|
17380
|
-
className:
|
|
17384
|
+
className: ee(FT({ side: e }), t),
|
|
17381
17385
|
...r,
|
|
17382
17386
|
children: [
|
|
17383
17387
|
n,
|
|
@@ -17396,7 +17400,7 @@ const Kh = ({
|
|
|
17396
17400
|
}) => /* @__PURE__ */ u.jsx(
|
|
17397
17401
|
"div",
|
|
17398
17402
|
{
|
|
17399
|
-
className:
|
|
17403
|
+
className: ee(
|
|
17400
17404
|
"flex flex-col space-y-2 text-center sm:text-left",
|
|
17401
17405
|
e
|
|
17402
17406
|
),
|
|
@@ -17408,7 +17412,7 @@ const qh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
17408
17412
|
Zn,
|
|
17409
17413
|
{
|
|
17410
17414
|
ref: n,
|
|
17411
|
-
className:
|
|
17415
|
+
className: ee("text-lg font-semibold text-foreground", e),
|
|
17412
17416
|
...t
|
|
17413
17417
|
}
|
|
17414
17418
|
));
|
|
@@ -17417,7 +17421,7 @@ const Gh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
17417
17421
|
Vs,
|
|
17418
17422
|
{
|
|
17419
17423
|
ref: n,
|
|
17420
|
-
className:
|
|
17424
|
+
className: ee("text-sm text-muted-foreground", e),
|
|
17421
17425
|
...t
|
|
17422
17426
|
}
|
|
17423
17427
|
));
|
|
@@ -17442,7 +17446,7 @@ const zT = {
|
|
|
17442
17446
|
}
|
|
17443
17447
|
};
|
|
17444
17448
|
function Sk({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
17445
|
-
const [r, o] =
|
|
17449
|
+
const [r, o] = be(!1), [s, i] = be(!1), [a, l] = be(e), [c, d] = be(!1), { toast: f } = Wa();
|
|
17446
17450
|
Et(() => {
|
|
17447
17451
|
const y = JSON.stringify(a) !== JSON.stringify(e);
|
|
17448
17452
|
d(y);
|