teodor-new-chat-ui 4.3.157 → 4.3.159
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 +633 -628
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,8 +2,8 @@ var ag = Object.defineProperty;
|
|
|
2
2
|
var lg = (e, t, n) => t in e ? ag(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var sc = (e, t, n) => lg(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import * as v from "react";
|
|
5
|
-
import V, { createContext as zo, useContext as ei, useReducer as cg, useRef as
|
|
6
|
-
import { Square as fg, Send as hg, ChevronRight as Xu, Check as Qa, Circle as pg, X as Yr, ExternalLink as mg, Download as gg, Image as xg, FileText as ic, Loader as el, Bot as zi, Wrench as yg, User as vg, Paperclip as xa, ChevronUp as tl, ChevronDown as ti, ChevronLeft as wg, Copy as ac, Edit as lc, RotateCcw as ya, Info as bg, Loader2 as gs, Edit3 as Ju, Plus as Sg, FileSpreadsheet as Cg, MessageSquarePlus as Tg, MessageSquare as kg, Calendar as
|
|
5
|
+
import V, { createContext as zo, useContext as ei, useReducer as cg, useRef as Re, useCallback as de, useEffect as St, useMemo as ct, useState as we, startTransition as es, useLayoutEffect as ug, createElement as ms, useImperativeHandle as dg } from "react";
|
|
6
|
+
import { Square as fg, Send as hg, ChevronRight as Xu, Check as Qa, Circle as pg, X as Yr, ExternalLink as mg, Download as gg, Image as xg, FileText as ic, Loader as el, Bot as zi, Wrench as yg, User as vg, Paperclip as xa, ChevronUp as tl, ChevronDown as ti, ChevronLeft as wg, Copy as ac, Edit as lc, RotateCcw as ya, Info as bg, Loader2 as gs, Edit3 as Ju, Plus as Sg, FileSpreadsheet as Cg, MessageSquarePlus as Tg, MessageSquare as kg, Calendar as Eg, Trash2 as Rg, Settings as Ig, Server as Ng, EyeOff as Ag, Eye as _g, Layout as jg, MessageCircle as Pg, Save as Og } from "lucide-react";
|
|
7
7
|
import { Slot as Mg, createSlot as to } from "@radix-ui/react-slot";
|
|
8
8
|
import { cva as ni } from "class-variance-authority";
|
|
9
9
|
import { clsx as Dg } from "clsx";
|
|
@@ -48,57 +48,57 @@ var uc;
|
|
|
48
48
|
function $g() {
|
|
49
49
|
return uc || (uc = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
50
|
var e = V, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), a = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), m = Symbol.iterator, g = "@@iterator";
|
|
51
|
-
function x(
|
|
52
|
-
if (
|
|
51
|
+
function x(R) {
|
|
52
|
+
if (R === null || typeof R != "object")
|
|
53
53
|
return null;
|
|
54
|
-
var Y = m &&
|
|
54
|
+
var Y = m && R[m] || R[g];
|
|
55
55
|
return typeof Y == "function" ? Y : null;
|
|
56
56
|
}
|
|
57
57
|
var y = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
58
|
-
function w(
|
|
58
|
+
function w(R) {
|
|
59
59
|
{
|
|
60
60
|
for (var Y = arguments.length, ae = new Array(Y > 1 ? Y - 1 : 0), Te = 1; Te < Y; Te++)
|
|
61
61
|
ae[Te - 1] = arguments[Te];
|
|
62
|
-
S("error",
|
|
62
|
+
S("error", R, ae);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
function S(
|
|
65
|
+
function S(R, Y, ae) {
|
|
66
66
|
{
|
|
67
67
|
var Te = y.ReactDebugCurrentFrame, Ye = Te.getStackAddendum();
|
|
68
68
|
Ye !== "" && (Y += "%s", ae = ae.concat([Ye]));
|
|
69
69
|
var Ge = ae.map(function(Ue) {
|
|
70
70
|
return String(Ue);
|
|
71
71
|
});
|
|
72
|
-
Ge.unshift("Warning: " + Y), Function.prototype.apply.call(console[
|
|
72
|
+
Ge.unshift("Warning: " + Y), Function.prototype.apply.call(console[R], console, Ge);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
var T = !1, C = !1, b = !1, k = !1, A = !1, N;
|
|
76
76
|
N = Symbol.for("react.module.reference");
|
|
77
|
-
function _(
|
|
78
|
-
return !!(typeof
|
|
77
|
+
function _(R) {
|
|
78
|
+
return !!(typeof R == "string" || typeof R == "function" || R === r || R === s || A || R === o || R === c || R === d || k || R === p || T || C || b || typeof R == "object" && R !== null && (R.$$typeof === h || R.$$typeof === f || R.$$typeof === i || R.$$typeof === a || R.$$typeof === l || // This needs to include all possible module reference object
|
|
79
79
|
// types supported by any Flight configuration anywhere since
|
|
80
80
|
// we don't know which Flight build this will end up being used
|
|
81
81
|
// with.
|
|
82
|
-
|
|
82
|
+
R.$$typeof === N || R.getModuleId !== void 0));
|
|
83
83
|
}
|
|
84
|
-
function M(
|
|
85
|
-
var Te =
|
|
84
|
+
function M(R, Y, ae) {
|
|
85
|
+
var Te = R.displayName;
|
|
86
86
|
if (Te)
|
|
87
87
|
return Te;
|
|
88
88
|
var Ye = Y.displayName || Y.name || "";
|
|
89
89
|
return Ye !== "" ? ae + "(" + Ye + ")" : ae;
|
|
90
90
|
}
|
|
91
|
-
function $(
|
|
92
|
-
return
|
|
91
|
+
function $(R) {
|
|
92
|
+
return R.displayName || "Context";
|
|
93
93
|
}
|
|
94
|
-
function z(
|
|
95
|
-
if (
|
|
94
|
+
function z(R) {
|
|
95
|
+
if (R == null)
|
|
96
96
|
return null;
|
|
97
|
-
if (typeof
|
|
98
|
-
return
|
|
99
|
-
if (typeof
|
|
100
|
-
return
|
|
101
|
-
switch (
|
|
97
|
+
if (typeof R.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof R == "function")
|
|
98
|
+
return R.displayName || R.name || null;
|
|
99
|
+
if (typeof R == "string")
|
|
100
|
+
return R;
|
|
101
|
+
switch (R) {
|
|
102
102
|
case r:
|
|
103
103
|
return "Fragment";
|
|
104
104
|
case n:
|
|
@@ -112,21 +112,21 @@ function $g() {
|
|
|
112
112
|
case d:
|
|
113
113
|
return "SuspenseList";
|
|
114
114
|
}
|
|
115
|
-
if (typeof
|
|
116
|
-
switch (
|
|
115
|
+
if (typeof R == "object")
|
|
116
|
+
switch (R.$$typeof) {
|
|
117
117
|
case a:
|
|
118
|
-
var Y =
|
|
118
|
+
var Y = R;
|
|
119
119
|
return $(Y) + ".Consumer";
|
|
120
120
|
case i:
|
|
121
|
-
var ae =
|
|
121
|
+
var ae = R;
|
|
122
122
|
return $(ae._context) + ".Provider";
|
|
123
123
|
case l:
|
|
124
|
-
return M(
|
|
124
|
+
return M(R, R.render, "ForwardRef");
|
|
125
125
|
case f:
|
|
126
|
-
var Te =
|
|
127
|
-
return Te !== null ? Te : z(
|
|
126
|
+
var Te = R.displayName || null;
|
|
127
|
+
return Te !== null ? Te : z(R.type) || "Memo";
|
|
128
128
|
case h: {
|
|
129
|
-
var Ye =
|
|
129
|
+
var Ye = R, Ge = Ye._payload, Ue = Ye._init;
|
|
130
130
|
try {
|
|
131
131
|
return z(Ue(Ge));
|
|
132
132
|
} catch {
|
|
@@ -144,20 +144,20 @@ function $g() {
|
|
|
144
144
|
{
|
|
145
145
|
if (B === 0) {
|
|
146
146
|
j = console.log, W = console.info, F = console.warn, L = console.error, ne = console.group, Q = console.groupCollapsed, ge = console.groupEnd;
|
|
147
|
-
var
|
|
147
|
+
var R = {
|
|
148
148
|
configurable: !0,
|
|
149
149
|
enumerable: !0,
|
|
150
150
|
value: _e,
|
|
151
151
|
writable: !0
|
|
152
152
|
};
|
|
153
153
|
Object.defineProperties(console, {
|
|
154
|
-
info:
|
|
155
|
-
log:
|
|
156
|
-
warn:
|
|
157
|
-
error:
|
|
158
|
-
group:
|
|
159
|
-
groupCollapsed:
|
|
160
|
-
groupEnd:
|
|
154
|
+
info: R,
|
|
155
|
+
log: R,
|
|
156
|
+
warn: R,
|
|
157
|
+
error: R,
|
|
158
|
+
group: R,
|
|
159
|
+
groupCollapsed: R,
|
|
160
|
+
groupEnd: R
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
B++;
|
|
@@ -166,31 +166,31 @@ function $g() {
|
|
|
166
166
|
function ue() {
|
|
167
167
|
{
|
|
168
168
|
if (B--, B === 0) {
|
|
169
|
-
var
|
|
169
|
+
var R = {
|
|
170
170
|
configurable: !0,
|
|
171
171
|
enumerable: !0,
|
|
172
172
|
writable: !0
|
|
173
173
|
};
|
|
174
174
|
Object.defineProperties(console, {
|
|
175
|
-
log: P({},
|
|
175
|
+
log: P({}, R, {
|
|
176
176
|
value: j
|
|
177
177
|
}),
|
|
178
|
-
info: P({},
|
|
178
|
+
info: P({}, R, {
|
|
179
179
|
value: W
|
|
180
180
|
}),
|
|
181
|
-
warn: P({},
|
|
181
|
+
warn: P({}, R, {
|
|
182
182
|
value: F
|
|
183
183
|
}),
|
|
184
|
-
error: P({},
|
|
184
|
+
error: P({}, R, {
|
|
185
185
|
value: L
|
|
186
186
|
}),
|
|
187
|
-
group: P({},
|
|
187
|
+
group: P({}, R, {
|
|
188
188
|
value: ne
|
|
189
189
|
}),
|
|
190
|
-
groupCollapsed: P({},
|
|
190
|
+
groupCollapsed: P({}, R, {
|
|
191
191
|
value: Q
|
|
192
192
|
}),
|
|
193
|
-
groupEnd: P({},
|
|
193
|
+
groupEnd: P({}, R, {
|
|
194
194
|
value: ge
|
|
195
195
|
})
|
|
196
196
|
});
|
|
@@ -199,7 +199,7 @@ function $g() {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
var ke = y.ReactCurrentDispatcher, ee;
|
|
202
|
-
function D(
|
|
202
|
+
function D(R, Y, ae) {
|
|
203
203
|
{
|
|
204
204
|
if (ee === void 0)
|
|
205
205
|
try {
|
|
@@ -209,7 +209,7 @@ function $g() {
|
|
|
209
209
|
ee = Te && Te[1] || "";
|
|
210
210
|
}
|
|
211
211
|
return `
|
|
212
|
-
` + ee +
|
|
212
|
+
` + ee + R;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
var q = !1, ie;
|
|
@@ -217,11 +217,11 @@ function $g() {
|
|
|
217
217
|
var ce = typeof WeakMap == "function" ? WeakMap : Map;
|
|
218
218
|
ie = new ce();
|
|
219
219
|
}
|
|
220
|
-
function H(
|
|
221
|
-
if (!
|
|
220
|
+
function H(R, Y) {
|
|
221
|
+
if (!R || q)
|
|
222
222
|
return "";
|
|
223
223
|
{
|
|
224
|
-
var ae = ie.get(
|
|
224
|
+
var ae = ie.get(R);
|
|
225
225
|
if (ae !== void 0)
|
|
226
226
|
return ae;
|
|
227
227
|
}
|
|
@@ -246,14 +246,14 @@ function $g() {
|
|
|
246
246
|
} catch (Ht) {
|
|
247
247
|
Te = Ht;
|
|
248
248
|
}
|
|
249
|
-
Reflect.construct(
|
|
249
|
+
Reflect.construct(R, [], Ue);
|
|
250
250
|
} else {
|
|
251
251
|
try {
|
|
252
252
|
Ue.call();
|
|
253
253
|
} catch (Ht) {
|
|
254
254
|
Te = Ht;
|
|
255
255
|
}
|
|
256
|
-
|
|
256
|
+
R.call(Ue.prototype);
|
|
257
257
|
}
|
|
258
258
|
} else {
|
|
259
259
|
try {
|
|
@@ -261,61 +261,61 @@ function $g() {
|
|
|
261
261
|
} catch (Ht) {
|
|
262
262
|
Te = Ht;
|
|
263
263
|
}
|
|
264
|
-
|
|
264
|
+
R();
|
|
265
265
|
}
|
|
266
266
|
} catch (Ht) {
|
|
267
267
|
if (Ht && Te && typeof Ht.stack == "string") {
|
|
268
268
|
for (var Oe = Ht.stack.split(`
|
|
269
269
|
`), _t = Te.stack.split(`
|
|
270
|
-
`), yt = Oe.length - 1,
|
|
271
|
-
|
|
272
|
-
for (; yt >= 1 &&
|
|
273
|
-
if (Oe[yt] !== _t[
|
|
274
|
-
if (yt !== 1 ||
|
|
270
|
+
`), yt = Oe.length - 1, Et = _t.length - 1; yt >= 1 && Et >= 0 && Oe[yt] !== _t[Et]; )
|
|
271
|
+
Et--;
|
|
272
|
+
for (; yt >= 1 && Et >= 0; yt--, Et--)
|
|
273
|
+
if (Oe[yt] !== _t[Et]) {
|
|
274
|
+
if (yt !== 1 || Et !== 1)
|
|
275
275
|
do
|
|
276
|
-
if (yt--,
|
|
276
|
+
if (yt--, Et--, Et < 0 || Oe[yt] !== _t[Et]) {
|
|
277
277
|
var Qt = `
|
|
278
278
|
` + Oe[yt].replace(" at new ", " at ");
|
|
279
|
-
return
|
|
279
|
+
return R.displayName && Qt.includes("<anonymous>") && (Qt = Qt.replace("<anonymous>", R.displayName)), typeof R == "function" && ie.set(R, Qt), Qt;
|
|
280
280
|
}
|
|
281
|
-
while (yt >= 1 &&
|
|
281
|
+
while (yt >= 1 && Et >= 0);
|
|
282
282
|
break;
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
} finally {
|
|
286
286
|
q = !1, ke.current = Ge, ue(), Error.prepareStackTrace = Ye;
|
|
287
287
|
}
|
|
288
|
-
var Pn =
|
|
289
|
-
return typeof
|
|
288
|
+
var Pn = R ? R.displayName || R.name : "", dn = Pn ? D(Pn) : "";
|
|
289
|
+
return typeof R == "function" && ie.set(R, dn), dn;
|
|
290
290
|
}
|
|
291
|
-
function We(
|
|
292
|
-
return H(
|
|
291
|
+
function We(R, Y, ae) {
|
|
292
|
+
return H(R, !1);
|
|
293
293
|
}
|
|
294
|
-
function re(
|
|
295
|
-
var Y =
|
|
294
|
+
function re(R) {
|
|
295
|
+
var Y = R.prototype;
|
|
296
296
|
return !!(Y && Y.isReactComponent);
|
|
297
297
|
}
|
|
298
|
-
function ye(
|
|
299
|
-
if (
|
|
298
|
+
function ye(R, Y, ae) {
|
|
299
|
+
if (R == null)
|
|
300
300
|
return "";
|
|
301
|
-
if (typeof
|
|
302
|
-
return H(
|
|
303
|
-
if (typeof
|
|
304
|
-
return D(
|
|
305
|
-
switch (
|
|
301
|
+
if (typeof R == "function")
|
|
302
|
+
return H(R, re(R));
|
|
303
|
+
if (typeof R == "string")
|
|
304
|
+
return D(R);
|
|
305
|
+
switch (R) {
|
|
306
306
|
case c:
|
|
307
307
|
return D("Suspense");
|
|
308
308
|
case d:
|
|
309
309
|
return D("SuspenseList");
|
|
310
310
|
}
|
|
311
|
-
if (typeof
|
|
312
|
-
switch (
|
|
311
|
+
if (typeof R == "object")
|
|
312
|
+
switch (R.$$typeof) {
|
|
313
313
|
case l:
|
|
314
|
-
return We(
|
|
314
|
+
return We(R.render);
|
|
315
315
|
case f:
|
|
316
|
-
return ye(
|
|
316
|
+
return ye(R.type, Y, ae);
|
|
317
317
|
case h: {
|
|
318
|
-
var Te =
|
|
318
|
+
var Te = R, Ye = Te._payload, Ge = Te._init;
|
|
319
319
|
try {
|
|
320
320
|
return ye(Ge(Ye), Y, ae);
|
|
321
321
|
} catch {
|
|
@@ -325,25 +325,25 @@ function $g() {
|
|
|
325
325
|
return "";
|
|
326
326
|
}
|
|
327
327
|
var Pe = Object.prototype.hasOwnProperty, $e = {}, ot = y.ReactDebugCurrentFrame;
|
|
328
|
-
function Ce(
|
|
329
|
-
if (
|
|
330
|
-
var Y =
|
|
328
|
+
function Ce(R) {
|
|
329
|
+
if (R) {
|
|
330
|
+
var Y = R._owner, ae = ye(R.type, R._source, Y ? Y.type : null);
|
|
331
331
|
ot.setExtraStackFrame(ae);
|
|
332
332
|
} else
|
|
333
333
|
ot.setExtraStackFrame(null);
|
|
334
334
|
}
|
|
335
|
-
function Xe(
|
|
335
|
+
function Xe(R, Y, ae, Te, Ye) {
|
|
336
336
|
{
|
|
337
337
|
var Ge = Function.call.bind(Pe);
|
|
338
|
-
for (var Ue in
|
|
339
|
-
if (Ge(
|
|
338
|
+
for (var Ue in R)
|
|
339
|
+
if (Ge(R, Ue)) {
|
|
340
340
|
var Oe = void 0;
|
|
341
341
|
try {
|
|
342
|
-
if (typeof
|
|
343
|
-
var _t = Error((Te || "React class") + ": " + ae + " type `" + Ue + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof
|
|
342
|
+
if (typeof R[Ue] != "function") {
|
|
343
|
+
var _t = Error((Te || "React class") + ": " + ae + " type `" + Ue + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[Ue] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
344
344
|
throw _t.name = "Invariant Violation", _t;
|
|
345
345
|
}
|
|
346
|
-
Oe =
|
|
346
|
+
Oe = R[Ue](Y, Ue, Te, ae, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
347
347
|
} catch (yt) {
|
|
348
348
|
Oe = yt;
|
|
349
349
|
}
|
|
@@ -352,28 +352,28 @@ function $g() {
|
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
var st = Array.isArray;
|
|
355
|
-
function Qe(
|
|
356
|
-
return st(
|
|
355
|
+
function Qe(R) {
|
|
356
|
+
return st(R);
|
|
357
357
|
}
|
|
358
|
-
function Je(
|
|
358
|
+
function Je(R) {
|
|
359
359
|
{
|
|
360
|
-
var Y = typeof Symbol == "function" && Symbol.toStringTag, ae = Y &&
|
|
360
|
+
var Y = typeof Symbol == "function" && Symbol.toStringTag, ae = Y && R[Symbol.toStringTag] || R.constructor.name || "Object";
|
|
361
361
|
return ae;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
function qe(
|
|
364
|
+
function qe(R) {
|
|
365
365
|
try {
|
|
366
|
-
return et(
|
|
366
|
+
return et(R), !1;
|
|
367
367
|
} catch {
|
|
368
368
|
return !0;
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
function et(
|
|
372
|
-
return "" +
|
|
371
|
+
function et(R) {
|
|
372
|
+
return "" + R;
|
|
373
373
|
}
|
|
374
|
-
function Mt(
|
|
375
|
-
if (qe(
|
|
376
|
-
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(
|
|
374
|
+
function Mt(R) {
|
|
375
|
+
if (qe(R))
|
|
376
|
+
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(R)), et(R);
|
|
377
377
|
}
|
|
378
378
|
var kt = y.ReactCurrentOwner, tt = {
|
|
379
379
|
key: !0,
|
|
@@ -381,53 +381,53 @@ function $g() {
|
|
|
381
381
|
__self: !0,
|
|
382
382
|
__source: !0
|
|
383
383
|
}, vt, At;
|
|
384
|
-
function it(
|
|
385
|
-
if (Pe.call(
|
|
386
|
-
var Y = Object.getOwnPropertyDescriptor(
|
|
384
|
+
function it(R) {
|
|
385
|
+
if (Pe.call(R, "ref")) {
|
|
386
|
+
var Y = Object.getOwnPropertyDescriptor(R, "ref").get;
|
|
387
387
|
if (Y && Y.isReactWarning)
|
|
388
388
|
return !1;
|
|
389
389
|
}
|
|
390
|
-
return
|
|
390
|
+
return R.ref !== void 0;
|
|
391
391
|
}
|
|
392
|
-
function Yt(
|
|
393
|
-
if (Pe.call(
|
|
394
|
-
var Y = Object.getOwnPropertyDescriptor(
|
|
392
|
+
function Yt(R) {
|
|
393
|
+
if (Pe.call(R, "key")) {
|
|
394
|
+
var Y = Object.getOwnPropertyDescriptor(R, "key").get;
|
|
395
395
|
if (Y && Y.isReactWarning)
|
|
396
396
|
return !1;
|
|
397
397
|
}
|
|
398
|
-
return
|
|
398
|
+
return R.key !== void 0;
|
|
399
399
|
}
|
|
400
|
-
function Xt(
|
|
401
|
-
typeof
|
|
400
|
+
function Xt(R, Y) {
|
|
401
|
+
typeof R.ref == "string" && kt.current;
|
|
402
402
|
}
|
|
403
|
-
function Jt(
|
|
403
|
+
function Jt(R, Y) {
|
|
404
404
|
{
|
|
405
405
|
var ae = function() {
|
|
406
406
|
vt || (vt = !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)", Y));
|
|
407
407
|
};
|
|
408
|
-
ae.isReactWarning = !0, Object.defineProperty(
|
|
408
|
+
ae.isReactWarning = !0, Object.defineProperty(R, "key", {
|
|
409
409
|
get: ae,
|
|
410
410
|
configurable: !0
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
function Zt(
|
|
414
|
+
function Zt(R, Y) {
|
|
415
415
|
{
|
|
416
416
|
var ae = function() {
|
|
417
417
|
At || (At = !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)", Y));
|
|
418
418
|
};
|
|
419
|
-
ae.isReactWarning = !0, Object.defineProperty(
|
|
419
|
+
ae.isReactWarning = !0, Object.defineProperty(R, "ref", {
|
|
420
420
|
get: ae,
|
|
421
421
|
configurable: !0
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
var ft = function(
|
|
425
|
+
var ft = function(R, Y, ae, Te, Ye, Ge, Ue) {
|
|
426
426
|
var Oe = {
|
|
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
|
-
type:
|
|
430
|
+
type: R,
|
|
431
431
|
key: Y,
|
|
432
432
|
ref: ae,
|
|
433
433
|
props: Ue,
|
|
@@ -451,58 +451,58 @@ function $g() {
|
|
|
451
451
|
value: Ye
|
|
452
452
|
}), Object.freeze && (Object.freeze(Oe.props), Object.freeze(Oe)), Oe;
|
|
453
453
|
};
|
|
454
|
-
function Ve(
|
|
454
|
+
function Ve(R, Y, ae, Te, Ye) {
|
|
455
455
|
{
|
|
456
456
|
var Ge, Ue = {}, Oe = null, _t = null;
|
|
457
457
|
ae !== void 0 && (Mt(ae), Oe = "" + ae), Yt(Y) && (Mt(Y.key), Oe = "" + Y.key), it(Y) && (_t = Y.ref, Xt(Y, Ye));
|
|
458
458
|
for (Ge in Y)
|
|
459
459
|
Pe.call(Y, Ge) && !tt.hasOwnProperty(Ge) && (Ue[Ge] = Y[Ge]);
|
|
460
|
-
if (
|
|
461
|
-
var yt =
|
|
460
|
+
if (R && R.defaultProps) {
|
|
461
|
+
var yt = R.defaultProps;
|
|
462
462
|
for (Ge in yt)
|
|
463
463
|
Ue[Ge] === void 0 && (Ue[Ge] = yt[Ge]);
|
|
464
464
|
}
|
|
465
465
|
if (Oe || _t) {
|
|
466
|
-
var
|
|
467
|
-
Oe && Jt(Ue,
|
|
466
|
+
var Et = typeof R == "function" ? R.displayName || R.name || "Unknown" : R;
|
|
467
|
+
Oe && Jt(Ue, Et), _t && Zt(Ue, Et);
|
|
468
468
|
}
|
|
469
|
-
return ft(
|
|
469
|
+
return ft(R, Oe, _t, Ye, Te, kt.current, Ue);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
var Dt = y.ReactCurrentOwner, Pt = y.ReactDebugCurrentFrame;
|
|
473
|
-
function G(
|
|
474
|
-
if (
|
|
475
|
-
var Y =
|
|
473
|
+
function G(R) {
|
|
474
|
+
if (R) {
|
|
475
|
+
var Y = R._owner, ae = ye(R.type, R._source, Y ? Y.type : null);
|
|
476
476
|
Pt.setExtraStackFrame(ae);
|
|
477
477
|
} else
|
|
478
478
|
Pt.setExtraStackFrame(null);
|
|
479
479
|
}
|
|
480
|
-
var
|
|
481
|
-
|
|
482
|
-
function ve(
|
|
483
|
-
return typeof
|
|
480
|
+
var Ee;
|
|
481
|
+
Ee = !1;
|
|
482
|
+
function ve(R) {
|
|
483
|
+
return typeof R == "object" && R !== null && R.$$typeof === t;
|
|
484
484
|
}
|
|
485
485
|
function gt() {
|
|
486
486
|
{
|
|
487
487
|
if (Dt.current) {
|
|
488
|
-
var
|
|
489
|
-
if (
|
|
488
|
+
var R = z(Dt.current.type);
|
|
489
|
+
if (R)
|
|
490
490
|
return `
|
|
491
491
|
|
|
492
|
-
Check the render method of \`` +
|
|
492
|
+
Check the render method of \`` + R + "`.";
|
|
493
493
|
}
|
|
494
494
|
return "";
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
function xt(
|
|
497
|
+
function xt(R) {
|
|
498
498
|
return "";
|
|
499
499
|
}
|
|
500
500
|
var dt = {};
|
|
501
|
-
function Me(
|
|
501
|
+
function Me(R) {
|
|
502
502
|
{
|
|
503
503
|
var Y = gt();
|
|
504
504
|
if (!Y) {
|
|
505
|
-
var ae = typeof
|
|
505
|
+
var ae = typeof R == "string" ? R : R.displayName || R.name;
|
|
506
506
|
ae && (Y = `
|
|
507
507
|
|
|
508
508
|
Check the top-level render call using <` + ae + ">.");
|
|
@@ -510,41 +510,41 @@ Check the top-level render call using <` + ae + ">.");
|
|
|
510
510
|
return Y;
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
function Kt(
|
|
513
|
+
function Kt(R, Y) {
|
|
514
514
|
{
|
|
515
|
-
if (!
|
|
515
|
+
if (!R._store || R._store.validated || R.key != null)
|
|
516
516
|
return;
|
|
517
|
-
|
|
517
|
+
R._store.validated = !0;
|
|
518
518
|
var ae = Me(Y);
|
|
519
519
|
if (dt[ae])
|
|
520
520
|
return;
|
|
521
521
|
dt[ae] = !0;
|
|
522
522
|
var Te = "";
|
|
523
|
-
|
|
523
|
+
R && R._owner && R._owner !== Dt.current && (Te = " It was passed a child from " + z(R._owner.type) + "."), G(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, Te), G(null);
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
|
-
function Le(
|
|
526
|
+
function Le(R, Y) {
|
|
527
527
|
{
|
|
528
|
-
if (typeof
|
|
528
|
+
if (typeof R != "object")
|
|
529
529
|
return;
|
|
530
|
-
if (Qe(
|
|
531
|
-
for (var ae = 0; ae <
|
|
532
|
-
var Te =
|
|
530
|
+
if (Qe(R))
|
|
531
|
+
for (var ae = 0; ae < R.length; ae++) {
|
|
532
|
+
var Te = R[ae];
|
|
533
533
|
ve(Te) && Kt(Te, Y);
|
|
534
534
|
}
|
|
535
|
-
else if (ve(
|
|
536
|
-
|
|
537
|
-
else if (
|
|
538
|
-
var Ye = x(
|
|
539
|
-
if (typeof Ye == "function" && Ye !==
|
|
540
|
-
for (var Ge = Ye.call(
|
|
535
|
+
else if (ve(R))
|
|
536
|
+
R._store && (R._store.validated = !0);
|
|
537
|
+
else if (R) {
|
|
538
|
+
var Ye = x(R);
|
|
539
|
+
if (typeof Ye == "function" && Ye !== R.entries)
|
|
540
|
+
for (var Ge = Ye.call(R), Ue; !(Ue = Ge.next()).done; )
|
|
541
541
|
ve(Ue.value) && Kt(Ue.value, Y);
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
function wt(
|
|
545
|
+
function wt(R) {
|
|
546
546
|
{
|
|
547
|
-
var Y =
|
|
547
|
+
var Y = R.type;
|
|
548
548
|
if (Y == null || typeof Y == "string")
|
|
549
549
|
return;
|
|
550
550
|
var ae;
|
|
@@ -558,57 +558,57 @@ Check the top-level render call using <` + ae + ">.");
|
|
|
558
558
|
return;
|
|
559
559
|
if (ae) {
|
|
560
560
|
var Te = z(Y);
|
|
561
|
-
Xe(ae,
|
|
562
|
-
} else if (Y.PropTypes !== void 0 && !
|
|
563
|
-
|
|
561
|
+
Xe(ae, R.props, "prop", Te, R);
|
|
562
|
+
} else if (Y.PropTypes !== void 0 && !Ee) {
|
|
563
|
+
Ee = !0;
|
|
564
564
|
var Ye = z(Y);
|
|
565
565
|
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Ye || "Unknown");
|
|
566
566
|
}
|
|
567
567
|
typeof Y.getDefaultProps == "function" && !Y.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
|
-
function jn(
|
|
570
|
+
function jn(R) {
|
|
571
571
|
{
|
|
572
|
-
for (var Y = Object.keys(
|
|
572
|
+
for (var Y = Object.keys(R.props), ae = 0; ae < Y.length; ae++) {
|
|
573
573
|
var Te = Y[ae];
|
|
574
574
|
if (Te !== "children" && Te !== "key") {
|
|
575
|
-
G(
|
|
575
|
+
G(R), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", Te), G(null);
|
|
576
576
|
break;
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
|
-
|
|
579
|
+
R.ref !== null && (G(R), w("Invalid attribute `ref` supplied to `React.Fragment`."), G(null));
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
582
|
var Lt = {};
|
|
583
|
-
function un(
|
|
583
|
+
function un(R, Y, ae, Te, Ye, Ge) {
|
|
584
584
|
{
|
|
585
|
-
var Ue = _(
|
|
585
|
+
var Ue = _(R);
|
|
586
586
|
if (!Ue) {
|
|
587
587
|
var Oe = "";
|
|
588
|
-
(
|
|
588
|
+
(R === void 0 || typeof R == "object" && R !== null && Object.keys(R).length === 0) && (Oe += " 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
589
|
var _t = xt();
|
|
590
590
|
_t ? Oe += _t : Oe += gt();
|
|
591
591
|
var yt;
|
|
592
|
-
|
|
592
|
+
R === null ? yt = "null" : Qe(R) ? yt = "array" : R !== void 0 && R.$$typeof === t ? (yt = "<" + (z(R.type) || "Unknown") + " />", Oe = " Did you accidentally export a JSX literal instead of a component?") : yt = 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", yt, Oe);
|
|
593
593
|
}
|
|
594
|
-
var
|
|
595
|
-
if (
|
|
596
|
-
return
|
|
594
|
+
var Et = Ve(R, Y, ae, Ye, Ge);
|
|
595
|
+
if (Et == null)
|
|
596
|
+
return Et;
|
|
597
597
|
if (Ue) {
|
|
598
598
|
var Qt = Y.children;
|
|
599
599
|
if (Qt !== void 0)
|
|
600
600
|
if (Te)
|
|
601
601
|
if (Qe(Qt)) {
|
|
602
602
|
for (var Pn = 0; Pn < Qt.length; Pn++)
|
|
603
|
-
Le(Qt[Pn],
|
|
603
|
+
Le(Qt[Pn], R);
|
|
604
604
|
Object.freeze && Object.freeze(Qt);
|
|
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
|
-
Le(Qt,
|
|
608
|
+
Le(Qt, R);
|
|
609
609
|
}
|
|
610
610
|
if (Pe.call(Y, "key")) {
|
|
611
|
-
var dn = z(
|
|
611
|
+
var dn = z(R), Ht = Object.keys(Y).filter(function(se) {
|
|
612
612
|
return se !== "key";
|
|
613
613
|
}), On = Ht.length > 0 ? "{key: someKey, " + Ht.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
614
614
|
if (!Lt[dn + On]) {
|
|
@@ -621,14 +621,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
621
621
|
<%s key={someKey} {...props} />`, On, dn, Z, dn), Lt[dn + On] = !0;
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
|
-
return
|
|
624
|
+
return R === r ? jn(Et) : wt(Et), Et;
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
function Ur(
|
|
628
|
-
return un(
|
|
627
|
+
function Ur(R, Y, ae) {
|
|
628
|
+
return un(R, Y, ae, !0);
|
|
629
629
|
}
|
|
630
|
-
function Wr(
|
|
631
|
-
return un(
|
|
630
|
+
function Wr(R, Y, ae) {
|
|
631
|
+
return un(R, Y, ae, !1);
|
|
632
632
|
}
|
|
633
633
|
var br = Wr, Sr = Ur;
|
|
634
634
|
xo.Fragment = r, xo.jsx = br, xo.jsxs = Sr;
|
|
@@ -698,7 +698,7 @@ function rd(e, t) {
|
|
|
698
698
|
return o;
|
|
699
699
|
return null;
|
|
700
700
|
}
|
|
701
|
-
const
|
|
701
|
+
const Er = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, od = (e) => !no(e) && e !== Er;
|
|
702
702
|
function wa() {
|
|
703
703
|
const { caseless: e, skipUndefined: t } = od(this) && this || {}, n = {}, r = (o, s) => {
|
|
704
704
|
const i = e && rd(n, s) || s;
|
|
@@ -807,14 +807,14 @@ const wx = (e) => {
|
|
|
807
807
|
return r;
|
|
808
808
|
};
|
|
809
809
|
return n(e, 0);
|
|
810
|
-
}, bx = Bn("AsyncFunction"), Sx = (e) => e && (Ho(e) || mn(e)) && mn(e.then) && mn(e.catch), id = ((e, t) => e ? setImmediate : t ? ((n, r) => (
|
|
811
|
-
o ===
|
|
810
|
+
}, bx = Bn("AsyncFunction"), Sx = (e) => e && (Ho(e) || mn(e)) && mn(e.then) && mn(e.catch), id = ((e, t) => e ? setImmediate : t ? ((n, r) => (Er.addEventListener("message", ({ source: o, data: s }) => {
|
|
811
|
+
o === Er && s === n && r.length && r.shift()();
|
|
812
812
|
}, !1), (o) => {
|
|
813
|
-
r.push(o),
|
|
813
|
+
r.push(o), Er.postMessage(n, "*");
|
|
814
814
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
815
815
|
typeof setImmediate == "function",
|
|
816
|
-
mn(
|
|
817
|
-
), Cx = typeof queueMicrotask < "u" ? queueMicrotask.bind(
|
|
816
|
+
mn(Er.postMessage)
|
|
817
|
+
), Cx = typeof queueMicrotask < "u" ? queueMicrotask.bind(Er) : typeof process < "u" && process.nextTick || id, Tx = (e) => e != null && mn(e[oi]), O = {
|
|
818
818
|
isArray: io,
|
|
819
819
|
isArrayBuffer: td,
|
|
820
820
|
isBuffer: Bo,
|
|
@@ -864,7 +864,7 @@ const wx = (e) => {
|
|
|
864
864
|
noop: xx,
|
|
865
865
|
toFiniteNumber: yx,
|
|
866
866
|
findKey: rd,
|
|
867
|
-
global:
|
|
867
|
+
global: Er,
|
|
868
868
|
isContextDefined: od,
|
|
869
869
|
isSpecCompliantForm: vx,
|
|
870
870
|
toJSONObject: wx,
|
|
@@ -938,10 +938,10 @@ function fc(e, t, n) {
|
|
|
938
938
|
return o = cd(o), !n && s ? "[" + o + "]" : o;
|
|
939
939
|
}).join(n ? "." : "") : t;
|
|
940
940
|
}
|
|
941
|
-
function
|
|
941
|
+
function Ex(e) {
|
|
942
942
|
return O.isArray(e) && !e.some(ba);
|
|
943
943
|
}
|
|
944
|
-
const
|
|
944
|
+
const Rx = O.toFlatObject(O, {}, null, function(t) {
|
|
945
945
|
return /^is[A-Z]/.test(t);
|
|
946
946
|
});
|
|
947
947
|
function ai(e, t, n) {
|
|
@@ -972,7 +972,7 @@ function ai(e, t, n) {
|
|
|
972
972
|
if (m && !x && typeof m == "object") {
|
|
973
973
|
if (O.endsWith(g, "{}"))
|
|
974
974
|
g = r ? g : g.slice(0, -2), m = JSON.stringify(m);
|
|
975
|
-
else if (O.isArray(m) &&
|
|
975
|
+
else if (O.isArray(m) && Ex(m) || (O.isFileList(m) || O.endsWith(g, "[]")) && (y = O.toArray(m)))
|
|
976
976
|
return g = cd(g), y.forEach(function(S, T) {
|
|
977
977
|
!(O.isUndefined(S) || S === null) && t.append(
|
|
978
978
|
// eslint-disable-next-line no-nested-ternary
|
|
@@ -983,7 +983,7 @@ function ai(e, t, n) {
|
|
|
983
983
|
}
|
|
984
984
|
return ba(m) ? !0 : (t.append(fc(x, g, s), c(m)), !1);
|
|
985
985
|
}
|
|
986
|
-
const f = [], h = Object.assign(
|
|
986
|
+
const f = [], h = Object.assign(Rx, {
|
|
987
987
|
defaultVisitor: d,
|
|
988
988
|
convertValue: c,
|
|
989
989
|
isVisitable: ba
|
|
@@ -2027,7 +2027,7 @@ const wd = "1.12.2", li = {};
|
|
|
2027
2027
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
2028
2028
|
};
|
|
2029
2029
|
});
|
|
2030
|
-
const
|
|
2030
|
+
const Ec = {};
|
|
2031
2031
|
li.transitional = function(t, n, r) {
|
|
2032
2032
|
function o(s, i) {
|
|
2033
2033
|
return "[Axios v" + wd + "] Transitional option '" + s + "'" + i + (r ? ". " + r : "");
|
|
@@ -2038,7 +2038,7 @@ li.transitional = function(t, n, r) {
|
|
|
2038
2038
|
o(i, " has been removed" + (n ? " in " + n : "")),
|
|
2039
2039
|
ze.ERR_DEPRECATED
|
|
2040
2040
|
);
|
|
2041
|
-
return n && !
|
|
2041
|
+
return n && !Ec[i] && (Ec[i] = !0, console.warn(
|
|
2042
2042
|
o(
|
|
2043
2043
|
i,
|
|
2044
2044
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
@@ -2370,23 +2370,23 @@ $t.getAdapter = vd.getAdapter;
|
|
|
2370
2370
|
$t.HttpStatusCode = Ta;
|
|
2371
2371
|
$t.default = $t;
|
|
2372
2372
|
const {
|
|
2373
|
-
Axios:
|
|
2374
|
-
AxiosError:
|
|
2375
|
-
CanceledError:
|
|
2376
|
-
isCancel:
|
|
2377
|
-
CancelToken:
|
|
2378
|
-
VERSION:
|
|
2379
|
-
all:
|
|
2380
|
-
Cancel:
|
|
2381
|
-
isAxiosError:
|
|
2382
|
-
spread:
|
|
2383
|
-
toFormData:
|
|
2384
|
-
AxiosHeaders:
|
|
2385
|
-
HttpStatusCode:
|
|
2386
|
-
formToJSON:
|
|
2387
|
-
getAdapter:
|
|
2388
|
-
mergeConfig:
|
|
2389
|
-
} = $t,
|
|
2373
|
+
Axios: SE,
|
|
2374
|
+
AxiosError: CE,
|
|
2375
|
+
CanceledError: TE,
|
|
2376
|
+
isCancel: kE,
|
|
2377
|
+
CancelToken: EE,
|
|
2378
|
+
VERSION: RE,
|
|
2379
|
+
all: IE,
|
|
2380
|
+
Cancel: NE,
|
|
2381
|
+
isAxiosError: AE,
|
|
2382
|
+
spread: _E,
|
|
2383
|
+
toFormData: jE,
|
|
2384
|
+
AxiosHeaders: PE,
|
|
2385
|
+
HttpStatusCode: OE,
|
|
2386
|
+
formToJSON: ME,
|
|
2387
|
+
getAdapter: DE,
|
|
2388
|
+
mergeConfig: LE
|
|
2389
|
+
} = $t, Rc = typeof window < "u" ? window.__API_BASE_URL__ : void 0, Ic = Rc ? or(Rc) : void 0;
|
|
2390
2390
|
function or(e) {
|
|
2391
2391
|
const n = (e != null && e.trim() ? e.trim() : "/api/chat").replace(/\/+$/, "");
|
|
2392
2392
|
return n ? n.endsWith("/chat") ? n : `${n}/chat` : "/api/chat";
|
|
@@ -2396,7 +2396,7 @@ const ka = /* @__PURE__ */ new Set();
|
|
|
2396
2396
|
function py() {
|
|
2397
2397
|
return Ps;
|
|
2398
2398
|
}
|
|
2399
|
-
function
|
|
2399
|
+
function Ea(e) {
|
|
2400
2400
|
Ps = e, ka.forEach((t) => t(e));
|
|
2401
2401
|
}
|
|
2402
2402
|
function my(e) {
|
|
@@ -2412,17 +2412,17 @@ const gy = 3e4, xy = 9e4, Nn = $t.create({
|
|
|
2412
2412
|
Nn.interceptors.request.use((e) => (Ps && (e.headers.Authorization = `Bearer ${Ps}`), e));
|
|
2413
2413
|
Nn.interceptors.response.use(
|
|
2414
2414
|
(e) => {
|
|
2415
|
-
var t;
|
|
2415
|
+
var t, n;
|
|
2416
2416
|
if (typeof window < "u" && (e != null && e.data))
|
|
2417
2417
|
try {
|
|
2418
|
-
const
|
|
2419
|
-
|
|
2418
|
+
const r = (t = e.data) == null ? void 0 : t.token, o = (n = e.data) == null ? void 0 : n.expires_at;
|
|
2419
|
+
r && typeof r == "string" && (localStorage.setItem("authToken", r), Ea(r)), o && typeof o == "number" && localStorage.setItem("authTokenExpiresAt", o.toString()), window.dispatchEvent(
|
|
2420
2420
|
new CustomEvent("smartorg:chat-token-updated", {
|
|
2421
|
-
detail: { token:
|
|
2421
|
+
detail: { token: r, expiresAt: o }
|
|
2422
2422
|
})
|
|
2423
|
-
)
|
|
2424
|
-
} catch (
|
|
2425
|
-
console.warn("[chat-api] Error storing token:",
|
|
2423
|
+
);
|
|
2424
|
+
} catch (r) {
|
|
2425
|
+
console.warn("[chat-api] Error storing token:", r);
|
|
2426
2426
|
}
|
|
2427
2427
|
return e;
|
|
2428
2428
|
},
|
|
@@ -2450,14 +2450,14 @@ class wy {
|
|
|
2450
2450
|
return t ? or(String(t)) : "";
|
|
2451
2451
|
}
|
|
2452
2452
|
updateConfig(t) {
|
|
2453
|
-
t.baseUrl && (Nn.defaults.baseURL = or(String(t.baseUrl))), t.authToken !== void 0 &&
|
|
2453
|
+
t.baseUrl && (Nn.defaults.baseURL = or(String(t.baseUrl))), t.authToken !== void 0 && Ea(t.authToken);
|
|
2454
2454
|
}
|
|
2455
2455
|
// ---- Token Management ----
|
|
2456
2456
|
getAuthToken() {
|
|
2457
2457
|
return py();
|
|
2458
2458
|
}
|
|
2459
2459
|
setAuthToken(t) {
|
|
2460
|
-
|
|
2460
|
+
Ea(t);
|
|
2461
2461
|
}
|
|
2462
2462
|
onTokenChange(t) {
|
|
2463
2463
|
return my(t);
|
|
@@ -2608,7 +2608,7 @@ function Os(e) {
|
|
|
2608
2608
|
interrupt: null,
|
|
2609
2609
|
snapshots: {}
|
|
2610
2610
|
};
|
|
2611
|
-
const { orderedSnapshots: o, snapshotMap: s } =
|
|
2611
|
+
const { orderedSnapshots: o, snapshotMap: s } = Ey(t), i = kd(r, 0);
|
|
2612
2612
|
return {
|
|
2613
2613
|
threadId: n,
|
|
2614
2614
|
latest: i,
|
|
@@ -2645,7 +2645,7 @@ function ky(e, t, n) {
|
|
|
2645
2645
|
const r = _y(e, n);
|
|
2646
2646
|
return r || Ay(t, n);
|
|
2647
2647
|
}
|
|
2648
|
-
function
|
|
2648
|
+
function Ey(e) {
|
|
2649
2649
|
const t = /* @__PURE__ */ new Map();
|
|
2650
2650
|
e.forEach((o, s) => {
|
|
2651
2651
|
if (!sl(o)) return;
|
|
@@ -2656,7 +2656,7 @@ function Ry(e) {
|
|
|
2656
2656
|
t.set(a, i);
|
|
2657
2657
|
return;
|
|
2658
2658
|
}
|
|
2659
|
-
t.set(a,
|
|
2659
|
+
t.set(a, Ry(l, i));
|
|
2660
2660
|
});
|
|
2661
2661
|
const n = Array.from(t.values());
|
|
2662
2662
|
n.sort((o, s) => Ac(s.createdAt ?? "") - Ac(o.createdAt ?? ""));
|
|
@@ -2665,7 +2665,7 @@ function Ry(e) {
|
|
|
2665
2665
|
r[o] = s;
|
|
2666
2666
|
return { orderedSnapshots: n, snapshotMap: r };
|
|
2667
2667
|
}
|
|
2668
|
-
function
|
|
2668
|
+
function Ry(e, t) {
|
|
2669
2669
|
return {
|
|
2670
2670
|
...e,
|
|
2671
2671
|
metadata: ns(e.metadata, t.metadata) ?? null,
|
|
@@ -2746,7 +2746,7 @@ function bo(e, t, n = 0, r = /* @__PURE__ */ new Set()) {
|
|
|
2746
2746
|
return null;
|
|
2747
2747
|
r.add(e);
|
|
2748
2748
|
}
|
|
2749
|
-
const o =
|
|
2749
|
+
const o = Ed(e, t);
|
|
2750
2750
|
if (o)
|
|
2751
2751
|
return o;
|
|
2752
2752
|
if (Array.isArray(e)) {
|
|
@@ -2784,7 +2784,7 @@ function bo(e, t, n = 0, r = /* @__PURE__ */ new Set()) {
|
|
|
2784
2784
|
}
|
|
2785
2785
|
return null;
|
|
2786
2786
|
}
|
|
2787
|
-
function
|
|
2787
|
+
function Ed(e, t) {
|
|
2788
2788
|
if (!e)
|
|
2789
2789
|
return null;
|
|
2790
2790
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
@@ -2796,7 +2796,7 @@ function Rd(e, t) {
|
|
|
2796
2796
|
}
|
|
2797
2797
|
if (Array.isArray(e)) {
|
|
2798
2798
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
2799
|
-
const r =
|
|
2799
|
+
const r = Ed(e[n], t);
|
|
2800
2800
|
if (r)
|
|
2801
2801
|
return r;
|
|
2802
2802
|
}
|
|
@@ -2876,7 +2876,7 @@ function _c(e) {
|
|
|
2876
2876
|
return typeof t.mimeType == "string" && (s.mimeType = t.mimeType), typeof t.name == "string" && (s.name = t.name), typeof t.size == "number" && (s.size = t.size), typeof t.sourceType == "string" && (s.sourceType = t.sourceType), s;
|
|
2877
2877
|
}
|
|
2878
2878
|
if (n === "tool_call")
|
|
2879
|
-
return
|
|
2879
|
+
return Rd(t) ?? null;
|
|
2880
2880
|
if (n === "tool_end") {
|
|
2881
2881
|
const o = "output" in t ? t.output : t.content;
|
|
2882
2882
|
return o ? { type: "text", text: typeof o == "string" ? o : JSON.stringify(o) } : null;
|
|
@@ -2895,7 +2895,7 @@ function _c(e) {
|
|
|
2895
2895
|
const r = typeof t.content == "string" ? t.content : typeof t.value == "string" ? t.value : JSON.stringify(t);
|
|
2896
2896
|
return r ? { type: "text", text: r } : null;
|
|
2897
2897
|
}
|
|
2898
|
-
function
|
|
2898
|
+
function Rd(e, t) {
|
|
2899
2899
|
var s;
|
|
2900
2900
|
const n = zt(e, ["id", "call_id"]) ?? t, r = zt(e, ["name"]) ?? zt(pn(e.function), ["name"]);
|
|
2901
2901
|
if (!n || !r) return null;
|
|
@@ -2903,7 +2903,7 @@ function Ed(e, t) {
|
|
|
2903
2903
|
return { type: "tool_call", id: n, name: r, args: o };
|
|
2904
2904
|
}
|
|
2905
2905
|
function My(e) {
|
|
2906
|
-
return Array.isArray(e) ? e.map((t, n) =>
|
|
2906
|
+
return Array.isArray(e) ? e.map((t, n) => Rd(t, `tool_call_${n}`)).filter((t) => !!t) : [];
|
|
2907
2907
|
}
|
|
2908
2908
|
function Dy(e, t) {
|
|
2909
2909
|
const n = e.content ?? e.output;
|
|
@@ -3012,7 +3012,7 @@ function By(e, t) {
|
|
|
3012
3012
|
}
|
|
3013
3013
|
}
|
|
3014
3014
|
function Hy(e = []) {
|
|
3015
|
-
const [t, n] = cg(By, { ...zy, messages: e }), r =
|
|
3015
|
+
const [t, n] = cg(By, { ...zy, messages: e }), r = Re([]), o = Re(null), s = Re(null), i = de(() => {
|
|
3016
3016
|
o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), o.current = null, s.current = null;
|
|
3017
3017
|
const d = r.current;
|
|
3018
3018
|
d.length && (r.current = [], n({ type: "batch", payload: { events: d } }));
|
|
@@ -3358,7 +3358,7 @@ function Ky(e) {
|
|
|
3358
3358
|
return t[t.length - 1] || null;
|
|
3359
3359
|
}
|
|
3360
3360
|
function qy(e = {}) {
|
|
3361
|
-
const t = ct(() => or(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = we(e.token ?? null), s =
|
|
3361
|
+
const t = ct(() => or(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = we(e.token ?? null), s = Re(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = we(!1), [c, d] = we(null), [f, h] = we(""), [p, m] = we(null), [g, x] = we(0), [y, w] = we(!1), S = Re(null), T = Re(!0), C = Re(0), b = Re(null), k = Re(null), A = Re(null), N = Re(null), _ = de((P) => {
|
|
3362
3362
|
o(P);
|
|
3363
3363
|
}, []), M = de(() => {
|
|
3364
3364
|
h(""), m(null), d(null), k.current = null, A.current = null, N.current = null;
|
|
@@ -3397,8 +3397,8 @@ function qy(e = {}) {
|
|
|
3397
3397
|
const Ve = window.__AUTH_TOKEN__, Dt = ((ge = window.localStorage) == null ? void 0 : ge.getItem("authToken")) || null;
|
|
3398
3398
|
let Pt = null;
|
|
3399
3399
|
try {
|
|
3400
|
-
const
|
|
3401
|
-
|
|
3400
|
+
const Ee = (_e = window.localStorage) == null ? void 0 : _e.getItem("chat-settings");
|
|
3401
|
+
Ee && (Pt = ((J = JSON.parse(Ee)) == null ? void 0 : J.apiKey) || null);
|
|
3402
3402
|
} catch {
|
|
3403
3403
|
}
|
|
3404
3404
|
const G = Ve || Dt || Pt || null;
|
|
@@ -3471,8 +3471,8 @@ function qy(e = {}) {
|
|
|
3471
3471
|
...b.current,
|
|
3472
3472
|
threadId: Dt
|
|
3473
3473
|
}), (ee = j == null ? void 0 : j.onOpen) == null || ee.call(j, { threadId: Dt, created: Pt }); ; ) {
|
|
3474
|
-
const { value: G, done:
|
|
3475
|
-
if (
|
|
3474
|
+
const { value: G, done: Ee } = await et.read();
|
|
3475
|
+
if (Ee) break;
|
|
3476
3476
|
kt += Mt.decode(G, { stream: !0 }), kt.length > Zt && (kt = "", console.warn("Stream buffer reset: exceeded 1MB"));
|
|
3477
3477
|
let ve;
|
|
3478
3478
|
for (; (ve = kt.indexOf(`
|
|
@@ -3639,7 +3639,7 @@ function Xy({
|
|
|
3639
3639
|
onAuthError: a,
|
|
3640
3640
|
onHeartbeat: l
|
|
3641
3641
|
}) {
|
|
3642
|
-
const c =
|
|
3642
|
+
const c = Re(null), d = Re(null), f = Re(/* @__PURE__ */ new Map()), h = Re(null), p = de((N) => {
|
|
3643
3643
|
try {
|
|
3644
3644
|
const _ = globalThis.structuredClone;
|
|
3645
3645
|
if (typeof _ == "function")
|
|
@@ -3843,7 +3843,7 @@ function al(e) {
|
|
|
3843
3843
|
return null;
|
|
3844
3844
|
}
|
|
3845
3845
|
}
|
|
3846
|
-
function
|
|
3846
|
+
function Ra(e, t) {
|
|
3847
3847
|
if (!jr()) return !1;
|
|
3848
3848
|
try {
|
|
3849
3849
|
return window.localStorage.setItem(e, t), !0;
|
|
@@ -3946,7 +3946,7 @@ function iv(e, t, n = 100) {
|
|
|
3946
3946
|
},
|
|
3947
3947
|
updatedAt: Date.now()
|
|
3948
3948
|
}, s = ll(e, t.threadId), i = JSON.stringify(o);
|
|
3949
|
-
if (!
|
|
3949
|
+
if (!Ra(s, i))
|
|
3950
3950
|
try {
|
|
3951
3951
|
const a = [];
|
|
3952
3952
|
for (let l = 0; l < window.localStorage.length; l++) {
|
|
@@ -3967,7 +3967,7 @@ function iv(e, t, n = 100) {
|
|
|
3967
3967
|
}
|
|
3968
3968
|
a.sort((l, c) => l.updatedAt - c.updatedAt);
|
|
3969
3969
|
for (const l of a)
|
|
3970
|
-
if (window.localStorage.removeItem(l.key),
|
|
3970
|
+
if (window.localStorage.removeItem(l.key), Ra(s, i))
|
|
3971
3971
|
break;
|
|
3972
3972
|
} catch {
|
|
3973
3973
|
}
|
|
@@ -4056,7 +4056,7 @@ function gv(e) {
|
|
|
4056
4056
|
}
|
|
4057
4057
|
}
|
|
4058
4058
|
function Aa(e, t) {
|
|
4059
|
-
|
|
4059
|
+
Ra(e, JSON.stringify(t));
|
|
4060
4060
|
}
|
|
4061
4061
|
function Xi(e) {
|
|
4062
4062
|
const t = gv(e);
|
|
@@ -4079,7 +4079,7 @@ function Ji(e) {
|
|
|
4079
4079
|
return e.order.map((t) => e.byId[t]).filter(Boolean);
|
|
4080
4080
|
}
|
|
4081
4081
|
function xv({ currentThreadId: e, currentThreadIdRef: t }) {
|
|
4082
|
-
const [n, r] = we([]), o =
|
|
4082
|
+
const [n, r] = we([]), o = Re(/* @__PURE__ */ new Map()), s = Re(/* @__PURE__ */ new Map()), i = de((m) => {
|
|
4083
4083
|
if (!m) {
|
|
4084
4084
|
r([]);
|
|
4085
4085
|
return;
|
|
@@ -4210,35 +4210,35 @@ function vv({
|
|
|
4210
4210
|
() => `threadPayload:${hv}:${h}:`,
|
|
4211
4211
|
[h]
|
|
4212
4212
|
), m = de(
|
|
4213
|
-
(
|
|
4213
|
+
(E) => sv(p, E),
|
|
4214
4214
|
[p]
|
|
4215
4215
|
), g = de(
|
|
4216
|
-
(
|
|
4217
|
-
iv(p,
|
|
4216
|
+
(E, I = 100) => {
|
|
4217
|
+
iv(p, E, I);
|
|
4218
4218
|
},
|
|
4219
4219
|
[p]
|
|
4220
4220
|
), x = de(
|
|
4221
|
-
(
|
|
4222
|
-
av(p,
|
|
4221
|
+
(E) => {
|
|
4222
|
+
av(p, E);
|
|
4223
4223
|
},
|
|
4224
4224
|
[p]
|
|
4225
4225
|
), y = de(() => {
|
|
4226
4226
|
lv(p);
|
|
4227
4227
|
}, [p]), [w, S] = we(
|
|
4228
4228
|
() => {
|
|
4229
|
-
var
|
|
4230
|
-
return Yi(h, (
|
|
4229
|
+
var E;
|
|
4230
|
+
return Yi(h, (E = c.getAuthToken) == null ? void 0 : E.call(c));
|
|
4231
4231
|
}
|
|
4232
4232
|
), [T, C] = we(() => {
|
|
4233
4233
|
var I;
|
|
4234
|
-
const
|
|
4234
|
+
const E = Xi(
|
|
4235
4235
|
Yi(h, (I = c.getAuthToken) == null ? void 0 : I.call(c))
|
|
4236
4236
|
);
|
|
4237
|
-
return os(
|
|
4237
|
+
return os(E);
|
|
4238
4238
|
}), b = ct(() => Ji(T), [T]), [k, A] = we(t), [N, _] = we(!1), [M, $] = we(!1), [z, P] = we(null), [B, j] = we(null), [W, F] = we(null), L = de(() => {
|
|
4239
|
-
const
|
|
4239
|
+
const E = Xi(w);
|
|
4240
4240
|
es(() => {
|
|
4241
|
-
C(os(
|
|
4241
|
+
C(os(E));
|
|
4242
4242
|
});
|
|
4243
4243
|
}, [w]), [ne, Q] = we(!1), [ge, _e] = we(!1), [J, ue] = we(null), [ke, ee] = we(void 0), [D, q] = we(void 0), [ie, ce] = we(void 0), {
|
|
4244
4244
|
state: H,
|
|
@@ -4248,11 +4248,11 @@ function vv({
|
|
|
4248
4248
|
pushUser: Pe,
|
|
4249
4249
|
onEvent: $e,
|
|
4250
4250
|
reset: ot
|
|
4251
|
-
} = Hy(), Ce =
|
|
4251
|
+
} = Hy(), Ce = Re(k);
|
|
4252
4252
|
St(() => {
|
|
4253
4253
|
Ce.current = k;
|
|
4254
4254
|
}, [k]);
|
|
4255
|
-
const Xe =
|
|
4255
|
+
const Xe = Re(!1), st = Re([]), Qe = Re(null), Je = Re(null), qe = Re(/* @__PURE__ */ new Map()), et = Re(k), Mt = Re(!1), kt = Re(null), tt = Re(/* @__PURE__ */ new Map()), vt = Re(/* @__PURE__ */ new Map()), {
|
|
4256
4256
|
threadCheckpoints: At,
|
|
4257
4257
|
syncActiveThreadCheckpoints: it,
|
|
4258
4258
|
updateCheckpointCache: Yt,
|
|
@@ -4264,35 +4264,35 @@ function vv({
|
|
|
4264
4264
|
getSnapshotFromCache: Dt
|
|
4265
4265
|
} = xv({ currentThreadId: k, currentThreadIdRef: Ce }), Pt = de(() => {
|
|
4266
4266
|
var K;
|
|
4267
|
-
const
|
|
4268
|
-
if (
|
|
4269
|
-
const I = Array.from(
|
|
4267
|
+
const E = vt.current;
|
|
4268
|
+
if (E.size <= Fc) return;
|
|
4269
|
+
const I = Array.from(E.entries()).sort((he, le) => he[1].timestamp - le[1].timestamp), U = E.size - Fc;
|
|
4270
4270
|
for (let he = 0; he < U; he++) {
|
|
4271
4271
|
const le = (K = I[he]) == null ? void 0 : K[0];
|
|
4272
|
-
le &&
|
|
4272
|
+
le && E.delete(le);
|
|
4273
4273
|
}
|
|
4274
4274
|
}, []), G = de(
|
|
4275
|
-
(
|
|
4276
|
-
if (!
|
|
4275
|
+
(E, I) => {
|
|
4276
|
+
if (!E)
|
|
4277
4277
|
return null;
|
|
4278
|
-
const U = Array.isArray(
|
|
4278
|
+
const U = Array.isArray(E.checkpoints) ? E.checkpoints : [];
|
|
4279
4279
|
return U.length === 0 ? null : {
|
|
4280
|
-
version:
|
|
4281
|
-
threadId:
|
|
4280
|
+
version: E.version === qi ? E.version : qi,
|
|
4281
|
+
threadId: E.threadId ?? I,
|
|
4282
4282
|
checkpoints: U
|
|
4283
4283
|
};
|
|
4284
4284
|
},
|
|
4285
4285
|
[]
|
|
4286
|
-
),
|
|
4287
|
-
(
|
|
4288
|
-
const { threadId: U, checkpointId: K = null, checkpointNs: he = null } =
|
|
4286
|
+
), Ee = de(
|
|
4287
|
+
(E, I) => {
|
|
4288
|
+
const { threadId: U, checkpointId: K = null, checkpointNs: he = null } = E, le = Bc(U, K, he);
|
|
4289
4289
|
if (I != null && I.force)
|
|
4290
4290
|
tt.current.delete(le), vt.current.delete(le);
|
|
4291
4291
|
else {
|
|
4292
4292
|
if (I != null && I.preferCache) {
|
|
4293
|
-
const
|
|
4294
|
-
if (
|
|
4295
|
-
return Promise.resolve(
|
|
4293
|
+
const Rt = vt.current.get(le);
|
|
4294
|
+
if (Rt)
|
|
4295
|
+
return Promise.resolve(Rt.result);
|
|
4296
4296
|
}
|
|
4297
4297
|
const Be = tt.current.get(le);
|
|
4298
4298
|
if (Be)
|
|
@@ -4304,13 +4304,13 @@ function vv({
|
|
|
4304
4304
|
threadId: U,
|
|
4305
4305
|
checkpointId: K ?? void 0,
|
|
4306
4306
|
checkpointNs: he ?? void 0
|
|
4307
|
-
}),
|
|
4308
|
-
if (
|
|
4309
|
-
return { payload:
|
|
4307
|
+
}), Rt = G(Be, U);
|
|
4308
|
+
if (Rt)
|
|
4309
|
+
return { payload: Rt, usedHistoryApi: !0 };
|
|
4310
4310
|
throw new Error("History response missing checkpoints");
|
|
4311
4311
|
} catch (Be) {
|
|
4312
4312
|
console.warn("[ChatSessionProvider] getStateHistory failed, falling back to getState:", Be);
|
|
4313
|
-
const
|
|
4313
|
+
const Rt = await c.getState({
|
|
4314
4314
|
threadId: U,
|
|
4315
4315
|
checkpointId: K ?? void 0,
|
|
4316
4316
|
checkpointNs: he ?? void 0
|
|
@@ -4319,7 +4319,7 @@ function vv({
|
|
|
4319
4319
|
payload: {
|
|
4320
4320
|
version: qi,
|
|
4321
4321
|
threadId: U,
|
|
4322
|
-
checkpoints: [
|
|
4322
|
+
checkpoints: [Rt]
|
|
4323
4323
|
},
|
|
4324
4324
|
usedHistoryApi: !1
|
|
4325
4325
|
};
|
|
@@ -4330,11 +4330,11 @@ function vv({
|
|
|
4330
4330
|
return tt.current.set(le, bt), bt;
|
|
4331
4331
|
},
|
|
4332
4332
|
[c, G, Pt]
|
|
4333
|
-
), ve = de((
|
|
4333
|
+
), ve = de((E, I) => new Promise((U, K) => {
|
|
4334
4334
|
const he = async () => {
|
|
4335
4335
|
Xe.current = !0;
|
|
4336
4336
|
try {
|
|
4337
|
-
await
|
|
4337
|
+
await E(), U();
|
|
4338
4338
|
} catch (le) {
|
|
4339
4339
|
K(le);
|
|
4340
4340
|
} finally {
|
|
@@ -4347,16 +4347,16 @@ function vv({
|
|
|
4347
4347
|
Xe.current ? st.current.push(he) : he().catch((le) => {
|
|
4348
4348
|
K(le);
|
|
4349
4349
|
});
|
|
4350
|
-
}), []), gt =
|
|
4350
|
+
}), []), gt = Re(b.length), xt = Re(!1);
|
|
4351
4351
|
St(() => {
|
|
4352
4352
|
gt.current = b.length;
|
|
4353
4353
|
}, [b.length]), St(() => {
|
|
4354
|
-
const
|
|
4355
|
-
zc(W,
|
|
4354
|
+
const E = H.pendingInterrupt ?? ov(H.messages);
|
|
4355
|
+
zc(W, E) || F(E ?? null);
|
|
4356
4356
|
}, [W, H.messages, H.pendingInterrupt]);
|
|
4357
4357
|
const dt = de(async () => {
|
|
4358
|
-
const
|
|
4359
|
-
|
|
4358
|
+
const E = gt.current > 0;
|
|
4359
|
+
E || _(!0);
|
|
4360
4360
|
try {
|
|
4361
4361
|
const I = await c.listThreads();
|
|
4362
4362
|
es(() => {
|
|
@@ -4368,31 +4368,31 @@ function vv({
|
|
|
4368
4368
|
} catch (I) {
|
|
4369
4369
|
i == null || i(String(I)), console.error("[ChatSessionProvider] Failed to refresh threads:", I), P(String(I));
|
|
4370
4370
|
} finally {
|
|
4371
|
-
|
|
4371
|
+
E || _(!1);
|
|
4372
4372
|
}
|
|
4373
|
-
}, [c, i]), Me =
|
|
4373
|
+
}, [c, i]), Me = Re(!1), Kt = Re(null), Le = Re(null), wt = Re(""), [jn, Lt] = we("idle"), un = Re({
|
|
4374
4374
|
attempts: 0,
|
|
4375
4375
|
timer: null,
|
|
4376
4376
|
reason: null
|
|
4377
|
-
}), Ur =
|
|
4378
|
-
}), Sr =
|
|
4379
|
-
}),
|
|
4380
|
-
}), Y = (
|
|
4381
|
-
if (!
|
|
4382
|
-
const I =
|
|
4377
|
+
}), Ur = Re(null), Wr = Re(0), br = Re(() => {
|
|
4378
|
+
}), Sr = Re(() => {
|
|
4379
|
+
}), R = Re(() => {
|
|
4380
|
+
}), Y = (E) => {
|
|
4381
|
+
if (!E || typeof E != "object") return !1;
|
|
4382
|
+
const I = E;
|
|
4383
4383
|
return I.code === "ECONNABORTED" ? !0 : (typeof I.message == "string" ? I.message.toLowerCase() : "").includes("timeout");
|
|
4384
4384
|
}, ae = de(
|
|
4385
|
-
async (
|
|
4386
|
-
const I = await c.listCheckpointSummaries(
|
|
4385
|
+
async (E) => {
|
|
4386
|
+
const I = await c.listCheckpointSummaries(E);
|
|
4387
4387
|
return _d(I ?? []);
|
|
4388
4388
|
},
|
|
4389
4389
|
[c]
|
|
4390
4390
|
), Te = de(
|
|
4391
|
-
(
|
|
4391
|
+
(E, I) => {
|
|
4392
4392
|
if (!jr()) return;
|
|
4393
4393
|
Le.current !== null && (window.clearTimeout(Le.current), Le.current = null);
|
|
4394
|
-
const U =
|
|
4395
|
-
if (
|
|
4394
|
+
const U = E.map((he) => `${he.threadId}:${he.updatedAt ?? ""}:${he.messageCount ?? ""}`).join("|");
|
|
4395
|
+
if (E.length === 0) {
|
|
4396
4396
|
try {
|
|
4397
4397
|
Ia(w);
|
|
4398
4398
|
} catch {
|
|
@@ -4404,7 +4404,7 @@ function vv({
|
|
|
4404
4404
|
return;
|
|
4405
4405
|
const K = () => {
|
|
4406
4406
|
try {
|
|
4407
|
-
const he =
|
|
4407
|
+
const he = E.slice(0, Na);
|
|
4408
4408
|
Aa(w, he), wt.current = U;
|
|
4409
4409
|
} catch {
|
|
4410
4410
|
} finally {
|
|
@@ -4423,17 +4423,17 @@ function vv({
|
|
|
4423
4423
|
), Ye = de(() => {
|
|
4424
4424
|
Te(b, { immediate: !0 });
|
|
4425
4425
|
}, [Te, b]), Ge = de(
|
|
4426
|
-
(
|
|
4426
|
+
(E, I, U, K) => {
|
|
4427
4427
|
var Fi;
|
|
4428
4428
|
const he = U ?? Ce.current;
|
|
4429
4429
|
if (!he)
|
|
4430
4430
|
return;
|
|
4431
|
-
const le = hn(
|
|
4431
|
+
const le = hn(E), ht = he === Ce.current, bt = (K == null ? void 0 : K.persist) !== !1;
|
|
4432
4432
|
if (I === "replace") {
|
|
4433
4433
|
if (bt) {
|
|
4434
4434
|
const Gt = {
|
|
4435
4435
|
threadId: he,
|
|
4436
|
-
snapshot: hn(
|
|
4436
|
+
snapshot: hn(E, { cloneMessages: !0 })
|
|
4437
4437
|
};
|
|
4438
4438
|
qe.current.set(he, Gt), et.current = he;
|
|
4439
4439
|
}
|
|
@@ -4446,7 +4446,7 @@ function vv({
|
|
|
4446
4446
|
}), F(le.interrupt ?? null), ue(le.nextCursor ?? null), Q(!!le.nextCursor), ee(le.checkpointId ?? void 0), q(le.checkpointNs ?? void 0), ce(le.nextCursorNs ?? void 0);
|
|
4447
4447
|
return;
|
|
4448
4448
|
}
|
|
4449
|
-
const Be = qe.current.get(he),
|
|
4449
|
+
const Be = qe.current.get(he), Rt = (Be == null ? void 0 : Be.snapshot) ?? null, Wt = Array.isArray(Rt == null ? void 0 : Rt.messages) ? Rt.messages : [], fn = hn(Rt), Wn = Array.isArray(E == null ? void 0 : E.messages) ? E.messages : [], qt = /* @__PURE__ */ new Set(), Ot = [...Wn, ...Wt].filter((Gt) => {
|
|
4450
4450
|
const $i = Gt == null ? void 0 : Gt.id;
|
|
4451
4451
|
return $i ? qt.has($i) ? !1 : (qt.add($i), !0) : !0;
|
|
4452
4452
|
}), tr = Ad(fn, le), Cr = {
|
|
@@ -4470,7 +4470,7 @@ function vv({
|
|
|
4470
4470
|
}), !ht)
|
|
4471
4471
|
return;
|
|
4472
4472
|
Wn.length && ye(Wn);
|
|
4473
|
-
const Vr =
|
|
4473
|
+
const Vr = E && Object.prototype.hasOwnProperty.call(E, "checkpointId") ? E.checkpointId : void 0, Cn = E && Object.prototype.hasOwnProperty.call(E, "checkpointNs") ? E.checkpointNs : void 0, Tr = E && Object.prototype.hasOwnProperty.call(E, "nextCursor") ? E.nextCursor : void 0, lr = E && Object.prototype.hasOwnProperty.call(E, "nextCursorNs") ? E.nextCursorNs : void 0;
|
|
4474
4474
|
ue(
|
|
4475
4475
|
(Gt) => Tr !== void 0 ? Tr ?? Gt ?? null : Gt ?? null
|
|
4476
4476
|
), Q(
|
|
@@ -4485,49 +4485,49 @@ function vv({
|
|
|
4485
4485
|
},
|
|
4486
4486
|
[ye, re, F]
|
|
4487
4487
|
), Ue = de(
|
|
4488
|
-
(
|
|
4489
|
-
if (
|
|
4488
|
+
(E) => {
|
|
4489
|
+
if (E.threadId != null && E.threadId !== Ce.current)
|
|
4490
4490
|
return;
|
|
4491
|
-
const I = hn(
|
|
4491
|
+
const I = hn(E.snapshot, { cloneMessages: !0 });
|
|
4492
4492
|
re(I.messages, {
|
|
4493
4493
|
checkpointId: I.checkpointId ?? null,
|
|
4494
4494
|
checkpointNs: I.checkpointNs ?? null,
|
|
4495
4495
|
pendingInterrupt: I.interrupt ?? null
|
|
4496
|
-
}), F(I.interrupt ?? null), ue(I.nextCursor ?? null), Q(!!I.nextCursor), ee(I.checkpointId ?? void 0), q(I.checkpointNs ?? void 0), ce(I.nextCursorNs ?? void 0), et.current =
|
|
4496
|
+
}), F(I.interrupt ?? null), ue(I.nextCursor ?? null), Q(!!I.nextCursor), ee(I.checkpointId ?? void 0), q(I.checkpointNs ?? void 0), ce(I.nextCursorNs ?? void 0), et.current = E.threadId, it(E.threadId ?? Ce.current ?? null);
|
|
4497
4497
|
},
|
|
4498
4498
|
[re, F, it]
|
|
4499
|
-
), Oe = de((
|
|
4500
|
-
if (!
|
|
4501
|
-
qe.current.delete(
|
|
4502
|
-
const I = `${
|
|
4499
|
+
), Oe = de((E) => {
|
|
4500
|
+
if (!E) return;
|
|
4501
|
+
qe.current.delete(E), x(E), Zt(E);
|
|
4502
|
+
const I = `${E}__`;
|
|
4503
4503
|
for (const U of tt.current.keys())
|
|
4504
4504
|
U.startsWith(I) && tt.current.delete(U);
|
|
4505
4505
|
for (const U of vt.current.keys())
|
|
4506
4506
|
U.startsWith(I) && vt.current.delete(U);
|
|
4507
|
-
et.current ===
|
|
4507
|
+
et.current === E && (et.current = null);
|
|
4508
4508
|
}, [Zt, x]), _t = de(() => {
|
|
4509
|
-
const
|
|
4510
|
-
|
|
4511
|
-
}, [Oe, ot]), yt = de(({ from:
|
|
4509
|
+
const E = Ce.current;
|
|
4510
|
+
E && Oe(E), ot([]), Q(!1), _e(!1), ue(null), ee(void 0), q(void 0), ce(void 0);
|
|
4511
|
+
}, [Oe, ot]), yt = de(({ from: E, to: I }) => {
|
|
4512
4512
|
const U = Ce.current;
|
|
4513
4513
|
U && console.warn(
|
|
4514
|
-
`[ChatSessionProvider] Stream sequence gap detected (${
|
|
4514
|
+
`[ChatSessionProvider] Stream sequence gap detected (${E} -> ${I}) for thread ${U}`
|
|
4515
4515
|
);
|
|
4516
|
-
}, []),
|
|
4517
|
-
(
|
|
4518
|
-
const I =
|
|
4516
|
+
}, []), Et = de(
|
|
4517
|
+
(E) => {
|
|
4518
|
+
const I = E.threadId;
|
|
4519
4519
|
console.log("[ChatSessionProvider] 📥 Handling thread_info event:", {
|
|
4520
4520
|
threadId: I,
|
|
4521
|
-
title:
|
|
4522
|
-
created:
|
|
4521
|
+
title: E.title,
|
|
4522
|
+
created: E.created,
|
|
4523
4523
|
currentThreads: b.length
|
|
4524
4524
|
});
|
|
4525
4525
|
const U = {
|
|
4526
4526
|
threadId: I,
|
|
4527
|
-
title:
|
|
4528
|
-
createdAt:
|
|
4529
|
-
updatedAt:
|
|
4530
|
-
messageCount:
|
|
4527
|
+
title: E.title || `Thread ${I.slice(0, 8)}`,
|
|
4528
|
+
createdAt: E.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
4529
|
+
updatedAt: E.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
4530
|
+
messageCount: E.messageCount || 0
|
|
4531
4531
|
};
|
|
4532
4532
|
Ce.current !== I && (!Ce.current && H.messages.length <= 1 && (Je.current = I), A(I)), es(() => {
|
|
4533
4533
|
C((K) => {
|
|
@@ -4545,28 +4545,28 @@ function vv({
|
|
|
4545
4545
|
[H.messages.length]
|
|
4546
4546
|
), { startStream: Qt, stop: Pn, isStreaming: dn, error: Ht, setAuthToken: On, replayBufferedEvents: Z } = Xy({
|
|
4547
4547
|
baseUrl: f,
|
|
4548
|
-
onThreadInfo:
|
|
4548
|
+
onThreadInfo: Et,
|
|
4549
4549
|
onMessageEvent: $e,
|
|
4550
|
-
onUnhandledEvent: (
|
|
4551
|
-
console.warn(`[ChatSessionProvider] Unhandled stream event: ${
|
|
4550
|
+
onUnhandledEvent: (E) => {
|
|
4551
|
+
console.warn(`[ChatSessionProvider] Unhandled stream event: ${E.type}`, E);
|
|
4552
4552
|
},
|
|
4553
4553
|
onSequenceGap: yt,
|
|
4554
|
-
onStreamClosed: (
|
|
4555
|
-
br.current(
|
|
4554
|
+
onStreamClosed: (E) => {
|
|
4555
|
+
br.current(E);
|
|
4556
4556
|
},
|
|
4557
|
-
onConnectionError: (
|
|
4558
|
-
Sr.current(
|
|
4557
|
+
onConnectionError: (E) => {
|
|
4558
|
+
Sr.current(E);
|
|
4559
4559
|
},
|
|
4560
4560
|
onAuthError: a,
|
|
4561
|
-
onHeartbeat: (
|
|
4562
|
-
|
|
4561
|
+
onHeartbeat: (E) => {
|
|
4562
|
+
R.current(E);
|
|
4563
4563
|
}
|
|
4564
4564
|
}), se = de(() => {
|
|
4565
|
-
const
|
|
4566
|
-
|
|
4565
|
+
const E = un.current;
|
|
4566
|
+
E.timer !== null && (window.clearTimeout(E.timer), E.timer = null), E.reason = null;
|
|
4567
4567
|
}, []), fe = de(
|
|
4568
|
-
(
|
|
4569
|
-
Lt("connecting"), Qt(
|
|
4568
|
+
(E, I) => {
|
|
4569
|
+
Lt("connecting"), Qt(E, {
|
|
4570
4570
|
onOpen: (U) => {
|
|
4571
4571
|
var K;
|
|
4572
4572
|
se(), un.current.attempts = 0, Lt("connected"), (K = I == null ? void 0 : I.onOpen) == null || K.call(I, U);
|
|
@@ -4582,7 +4582,7 @@ function vv({
|
|
|
4582
4582
|
},
|
|
4583
4583
|
onHeartbeat: (U) => {
|
|
4584
4584
|
var K;
|
|
4585
|
-
|
|
4585
|
+
R.current(U), (K = I == null ? void 0 : I.onHeartbeat) == null || K.call(I, U);
|
|
4586
4586
|
},
|
|
4587
4587
|
onClosed: (U) => {
|
|
4588
4588
|
var K;
|
|
@@ -4592,18 +4592,18 @@ function vv({
|
|
|
4592
4592
|
},
|
|
4593
4593
|
[se, yt, Lt, Qt]
|
|
4594
4594
|
), Ie = de(() => {
|
|
4595
|
-
const
|
|
4596
|
-
if (!
|
|
4595
|
+
const E = Ce.current;
|
|
4596
|
+
if (!E)
|
|
4597
4597
|
return null;
|
|
4598
4598
|
const I = Ur.current, U = H.lastCheckpointId ?? (I == null ? void 0 : I.lastCheckpointId) ?? null, K = H.lastCheckpointNs ?? (I == null ? void 0 : I.lastCheckpointNs) ?? null, he = {};
|
|
4599
4599
|
return U && (he.checkpointId = U), K && (he.checkpointNs = K), {
|
|
4600
|
-
threadId:
|
|
4600
|
+
threadId: E,
|
|
4601
4601
|
checkpointId: U,
|
|
4602
4602
|
checkpointNs: K,
|
|
4603
4603
|
command: { kind: "resume", value: he }
|
|
4604
4604
|
};
|
|
4605
4605
|
}, [H.lastCheckpointId, H.lastCheckpointNs]), lt = de(
|
|
4606
|
-
(
|
|
4606
|
+
(E) => {
|
|
4607
4607
|
const I = un.current;
|
|
4608
4608
|
if (I.timer !== null)
|
|
4609
4609
|
return;
|
|
@@ -4611,7 +4611,7 @@ function vv({
|
|
|
4611
4611
|
Lt("error");
|
|
4612
4612
|
return;
|
|
4613
4613
|
}
|
|
4614
|
-
I.attempts += 1, I.reason =
|
|
4614
|
+
I.attempts += 1, I.reason = E;
|
|
4615
4615
|
const U = Math.min(
|
|
4616
4616
|
Qy * Math.pow(2, I.attempts - 1),
|
|
4617
4617
|
ev
|
|
@@ -4628,39 +4628,39 @@ function vv({
|
|
|
4628
4628
|
},
|
|
4629
4629
|
[Ie, Z, Lt, fe]
|
|
4630
4630
|
), Ze = de(
|
|
4631
|
-
(
|
|
4631
|
+
(E) => {
|
|
4632
4632
|
var I;
|
|
4633
|
-
if (Ur.current =
|
|
4633
|
+
if (Ur.current = E, E.manualStop || E.reason === "complete") {
|
|
4634
4634
|
se(), un.current.attempts = 0, Lt("idle");
|
|
4635
4635
|
return;
|
|
4636
4636
|
}
|
|
4637
|
-
if (
|
|
4638
|
-
console.error("[ChatSessionProvider] Auth error detected:",
|
|
4637
|
+
if (E.error && (E.error.includes("token") || E.error.includes("401") || E.error.includes("unauthorized") || E.error.includes("Unauthorized") || E.error.includes("TOKEN_EXPIRED") || E.error.includes("auth_error"))) {
|
|
4638
|
+
console.error("[ChatSessionProvider] Auth error detected:", E.error);
|
|
4639
4639
|
try {
|
|
4640
|
-
a == null || a(
|
|
4640
|
+
a == null || a(E.error);
|
|
4641
4641
|
} catch (K) {
|
|
4642
4642
|
console.error("[ChatSessionProvider] Error in onAuthError handler:", K);
|
|
4643
4643
|
}
|
|
4644
4644
|
return;
|
|
4645
4645
|
}
|
|
4646
|
-
if (
|
|
4647
|
-
if ((I =
|
|
4646
|
+
if (E.reason === "error" || E.reason === "aborted") {
|
|
4647
|
+
if ((I = E.error) != null && I.includes("Stream idle timeout")) {
|
|
4648
4648
|
console.warn("[ChatSessionProvider] Idle timeout - not scheduling resume (watchdog is generous)");
|
|
4649
4649
|
return;
|
|
4650
4650
|
}
|
|
4651
|
-
lt(`closed:${
|
|
4651
|
+
lt(`closed:${E.reason}`);
|
|
4652
4652
|
}
|
|
4653
4653
|
},
|
|
4654
4654
|
[se, lt, Lt, a]
|
|
4655
4655
|
), at = de(
|
|
4656
|
-
(
|
|
4657
|
-
console.warn("[ChatSessionProvider] Stream connection error:",
|
|
4656
|
+
(E) => {
|
|
4657
|
+
console.warn("[ChatSessionProvider] Stream connection error:", E), lt("connection-error");
|
|
4658
4658
|
},
|
|
4659
4659
|
[lt]
|
|
4660
|
-
), Ut = de((
|
|
4660
|
+
), Ut = de((E) => {
|
|
4661
4661
|
Wr.current = Date.now(), Lt((I) => I === "reconnecting" ? "connected" : I);
|
|
4662
4662
|
}, [Lt]);
|
|
4663
|
-
br.current = Ze, Sr.current = at,
|
|
4663
|
+
br.current = Ze, Sr.current = at, R.current = Ut, St(() => () => {
|
|
4664
4664
|
se();
|
|
4665
4665
|
}, [se]);
|
|
4666
4666
|
const an = de(() => {
|
|
@@ -4671,7 +4671,7 @@ function vv({
|
|
|
4671
4671
|
}, [dn]), St(() => {
|
|
4672
4672
|
if (!jr()) return;
|
|
4673
4673
|
Le.current !== null && (window.clearTimeout(Le.current), Le.current = null);
|
|
4674
|
-
const
|
|
4674
|
+
const E = b.map((U) => `${U.threadId}:${U.updatedAt ?? ""}:${U.messageCount ?? ""}`).join("|");
|
|
4675
4675
|
if (b.length === 0) {
|
|
4676
4676
|
try {
|
|
4677
4677
|
Ia(w);
|
|
@@ -4680,12 +4680,12 @@ function vv({
|
|
|
4680
4680
|
wt.current = "";
|
|
4681
4681
|
return;
|
|
4682
4682
|
}
|
|
4683
|
-
if (
|
|
4683
|
+
if (E === wt.current)
|
|
4684
4684
|
return;
|
|
4685
4685
|
const I = () => {
|
|
4686
4686
|
try {
|
|
4687
4687
|
const U = b.slice(0, Na);
|
|
4688
|
-
Aa(w, U), wt.current =
|
|
4688
|
+
Aa(w, U), wt.current = E;
|
|
4689
4689
|
} catch {
|
|
4690
4690
|
} finally {
|
|
4691
4691
|
Le.current = null;
|
|
@@ -4698,8 +4698,8 @@ function vv({
|
|
|
4698
4698
|
};
|
|
4699
4699
|
}, [b, Te]), St(() => {
|
|
4700
4700
|
var K;
|
|
4701
|
-
const
|
|
4702
|
-
On(
|
|
4701
|
+
const E = c.getAuthToken();
|
|
4702
|
+
On(E);
|
|
4703
4703
|
const I = (he) => {
|
|
4704
4704
|
const le = Yi(h, he);
|
|
4705
4705
|
kt.current !== le && (kt.current = le, Mt.current = !1), S(le);
|
|
@@ -4708,20 +4708,20 @@ function vv({
|
|
|
4708
4708
|
C(os(ht));
|
|
4709
4709
|
}), he && !Mt.current && (Mt.current = !0);
|
|
4710
4710
|
};
|
|
4711
|
-
I(
|
|
4711
|
+
I(E);
|
|
4712
4712
|
const U = (K = c.onTokenChange) == null ? void 0 : K.call(c, (he) => {
|
|
4713
|
-
he !==
|
|
4713
|
+
he !== E && (On(he), y(), tt.current.clear(), vt.current.clear(), I(he));
|
|
4714
4714
|
});
|
|
4715
4715
|
return () => {
|
|
4716
4716
|
U == null || U();
|
|
4717
4717
|
};
|
|
4718
4718
|
}, [c, h, On, y]);
|
|
4719
4719
|
const Un = de(
|
|
4720
|
-
async (
|
|
4720
|
+
async (E) => {
|
|
4721
4721
|
var K;
|
|
4722
4722
|
const I = `Thread ${(K = crypto.randomUUID) == null ? void 0 : K.call(crypto)}`, U = {
|
|
4723
4723
|
threadId: I,
|
|
4724
|
-
title:
|
|
4724
|
+
title: E || "New Chat",
|
|
4725
4725
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4726
4726
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4727
4727
|
messageCount: 0
|
|
@@ -4731,14 +4731,14 @@ function vv({
|
|
|
4731
4731
|
order: [I, ...he.order]
|
|
4732
4732
|
})), A(I);
|
|
4733
4733
|
try {
|
|
4734
|
-
const he = await c.createThread(
|
|
4734
|
+
const he = await c.createThread(E), le = typeof he == "string" ? he : he.threadId;
|
|
4735
4735
|
return C((ht) => {
|
|
4736
4736
|
const bt = ht.byId[I];
|
|
4737
4737
|
if (!bt) return ht;
|
|
4738
4738
|
const Be = { ...ht.byId };
|
|
4739
4739
|
delete Be[I], Be[le] = { ...bt, threadId: le };
|
|
4740
|
-
const
|
|
4741
|
-
return { byId: Be, order:
|
|
4740
|
+
const Rt = ht.order.map((Wt) => Wt === I ? le : Wt);
|
|
4741
|
+
return { byId: Be, order: Rt };
|
|
4742
4742
|
}), A(le), setTimeout(() => dt(), 10), P(null), le;
|
|
4743
4743
|
} catch (he) {
|
|
4744
4744
|
throw C((le) => {
|
|
@@ -4752,29 +4752,29 @@ function vv({
|
|
|
4752
4752
|
},
|
|
4753
4753
|
[c, dt]
|
|
4754
4754
|
), po = de(
|
|
4755
|
-
async (
|
|
4755
|
+
async (E) => {
|
|
4756
4756
|
try {
|
|
4757
|
-
await c.deleteThread(
|
|
4757
|
+
await c.deleteThread(E);
|
|
4758
4758
|
let I = null;
|
|
4759
4759
|
C((U) => {
|
|
4760
|
-
if (!U.byId[
|
|
4760
|
+
if (!U.byId[E]) return U;
|
|
4761
4761
|
const K = { ...U.byId };
|
|
4762
|
-
delete K[
|
|
4763
|
-
const he = U.order.filter((ht) => ht !==
|
|
4762
|
+
delete K[E];
|
|
4763
|
+
const he = U.order.filter((ht) => ht !== E), le = { byId: K, order: he };
|
|
4764
4764
|
return I = Ji(le), le;
|
|
4765
|
-
}), I && Te(I, { immediate: !0 }), Oe(
|
|
4765
|
+
}), I && Te(I, { immediate: !0 }), Oe(E), Ce.current === E && (Je.current = E, A(null), Ce.current = null, et.current = null, _t()), await dt(), P(null);
|
|
4766
4766
|
} catch (I) {
|
|
4767
4767
|
throw P(String(I)), I;
|
|
4768
4768
|
}
|
|
4769
4769
|
},
|
|
4770
4770
|
[c, _t, Oe, dt, Te]
|
|
4771
4771
|
), Zo = de(
|
|
4772
|
-
async (
|
|
4772
|
+
async (E, I) => {
|
|
4773
4773
|
try {
|
|
4774
|
-
await c.updateThread(
|
|
4775
|
-
const K = U.byId[
|
|
4774
|
+
await c.updateThread(E, I), C((U) => {
|
|
4775
|
+
const K = U.byId[E];
|
|
4776
4776
|
return K ? {
|
|
4777
|
-
byId: { ...U.byId, [
|
|
4777
|
+
byId: { ...U.byId, [E]: { ...K, title: I } },
|
|
4778
4778
|
order: U.order
|
|
4779
4779
|
} : U;
|
|
4780
4780
|
}), P(null);
|
|
@@ -4784,46 +4784,46 @@ function vv({
|
|
|
4784
4784
|
},
|
|
4785
4785
|
[c, dt]
|
|
4786
4786
|
), Sn = de(
|
|
4787
|
-
async (
|
|
4787
|
+
async (E, I, U, K = !1) => {
|
|
4788
4788
|
await ve(async () => {
|
|
4789
|
-
if (Je.current ===
|
|
4789
|
+
if (Je.current === E && !K) {
|
|
4790
4790
|
Je.current = null;
|
|
4791
4791
|
return;
|
|
4792
4792
|
}
|
|
4793
|
-
if (Qe.current ===
|
|
4793
|
+
if (Qe.current === E && !K)
|
|
4794
4794
|
return;
|
|
4795
|
-
A((qt) => qt ===
|
|
4795
|
+
A((qt) => qt === E ? qt : E), Ce.current = E;
|
|
4796
4796
|
const ht = Bc(
|
|
4797
|
-
|
|
4797
|
+
E,
|
|
4798
4798
|
I ?? null,
|
|
4799
4799
|
U ?? null
|
|
4800
|
-
), bt = vt.current.get(ht), Be = !K && !I && !U && bt && Date.now() - bt.timestamp < Jy,
|
|
4800
|
+
), bt = vt.current.get(ht), Be = !K && !I && !U && bt && Date.now() - bt.timestamp < Jy, Rt = !K && !I && !U;
|
|
4801
4801
|
let Wt = !1;
|
|
4802
|
-
if (
|
|
4803
|
-
const qt = qe.current.get(
|
|
4802
|
+
if (Rt) {
|
|
4803
|
+
const qt = qe.current.get(E);
|
|
4804
4804
|
if (qt)
|
|
4805
4805
|
Ue(qt), Wt = !0;
|
|
4806
4806
|
else {
|
|
4807
|
-
const Ot = m(
|
|
4808
|
-
Ot && (qe.current.set(
|
|
4807
|
+
const Ot = m(E);
|
|
4808
|
+
Ot && (qe.current.set(E, Ot), Ue(Ot), Wt = !0);
|
|
4809
4809
|
}
|
|
4810
4810
|
}
|
|
4811
4811
|
const fn = K || !Wt || !!I || !!U, Wn = async (qt) => {
|
|
4812
|
-
qt && $(!0), Qe.current =
|
|
4812
|
+
qt && $(!0), Qe.current = E;
|
|
4813
4813
|
try {
|
|
4814
|
-
const Ot = await
|
|
4815
|
-
{ threadId:
|
|
4814
|
+
const Ot = await Ee(
|
|
4815
|
+
{ threadId: E, checkpointId: I, checkpointNs: U },
|
|
4816
4816
|
{ force: K }
|
|
4817
4817
|
), { latest: tr, checkpoints: Cr, snapshots: Vr } = Os(Ot.payload);
|
|
4818
|
-
Ge(tr, "replace",
|
|
4819
|
-
Jt(
|
|
4818
|
+
Ge(tr, "replace", E), Yt(E, Cr, "replace"), Xt(E, Vr, "replace"), j(null), Ot.usedHistoryApi || ae(E).then((Cn) => {
|
|
4819
|
+
Jt(E, Cn);
|
|
4820
4820
|
}).catch((Cn) => {
|
|
4821
4821
|
console.warn("[ChatSessionProvider] Failed to refresh checkpoint summaries:", Cn);
|
|
4822
4822
|
});
|
|
4823
4823
|
} catch (Ot) {
|
|
4824
4824
|
if (Y(Ot))
|
|
4825
4825
|
try {
|
|
4826
|
-
const tr = await ae(
|
|
4826
|
+
const tr = await ae(E), Cr = Jt(E, tr);
|
|
4827
4827
|
if (Q(!1), ue(null), ce(void 0), ee(void 0), q(void 0), Cr) {
|
|
4828
4828
|
j("History request timed out. Select a checkpoint to load manually.");
|
|
4829
4829
|
return;
|
|
@@ -4836,10 +4836,10 @@ function vv({
|
|
|
4836
4836
|
Qe.current = null, qt && $(!1);
|
|
4837
4837
|
}
|
|
4838
4838
|
};
|
|
4839
|
-
fn ? await Wn(!0) :
|
|
4839
|
+
fn ? await Wn(!0) : Rt && Wt && !Be && Wn(!1).catch((qt) => {
|
|
4840
4840
|
console.warn("[ChatSessionProvider] Background refresh failed:", qt);
|
|
4841
4841
|
});
|
|
4842
|
-
}, `loadThread-${
|
|
4842
|
+
}, `loadThread-${E}`);
|
|
4843
4843
|
},
|
|
4844
4844
|
[
|
|
4845
4845
|
Ue,
|
|
@@ -4847,7 +4847,7 @@ function vv({
|
|
|
4847
4847
|
Ge,
|
|
4848
4848
|
ve,
|
|
4849
4849
|
ae,
|
|
4850
|
-
|
|
4850
|
+
Ee,
|
|
4851
4851
|
Y,
|
|
4852
4852
|
i,
|
|
4853
4853
|
Yt,
|
|
@@ -4855,8 +4855,8 @@ function vv({
|
|
|
4855
4855
|
]
|
|
4856
4856
|
), Qo = de(async () => {
|
|
4857
4857
|
await ve(async () => {
|
|
4858
|
-
const
|
|
4859
|
-
|
|
4858
|
+
const E = Ce.current;
|
|
4859
|
+
E && Oe(E), Je.current = null, A(null), Ce.current = null, et.current = null, _t(), ee(void 0), q(void 0), ce(void 0), ft();
|
|
4860
4860
|
try {
|
|
4861
4861
|
localStorage.removeItem("lastThreadId");
|
|
4862
4862
|
} catch (I) {
|
|
@@ -4864,17 +4864,17 @@ function vv({
|
|
|
4864
4864
|
}
|
|
4865
4865
|
}, "clearCurrentThread");
|
|
4866
4866
|
}, [_t, Oe, ve, ft]), ec = de(
|
|
4867
|
-
async (
|
|
4867
|
+
async (E, I) => {
|
|
4868
4868
|
const U = Ce.current;
|
|
4869
4869
|
if (!U) throw new Error("No active thread");
|
|
4870
|
-
const K = Xr(
|
|
4870
|
+
const K = Xr(E, I ?? null), he = Dt(U, K);
|
|
4871
4871
|
if (he) {
|
|
4872
4872
|
await ve(async () => {
|
|
4873
4873
|
Ge(he, "replace", U, { persist: !1 });
|
|
4874
4874
|
}, `navigateToCheckpoint-${U}-${K}`);
|
|
4875
4875
|
return;
|
|
4876
4876
|
}
|
|
4877
|
-
await Sn(U,
|
|
4877
|
+
await Sn(U, E, I ?? void 0, !0);
|
|
4878
4878
|
},
|
|
4879
4879
|
[Ge, ve, Dt, Sn]
|
|
4880
4880
|
), tc = de(async () => {
|
|
@@ -4884,21 +4884,21 @@ function vv({
|
|
|
4884
4884
|
async () => {
|
|
4885
4885
|
if (!Ce.current) throw new Error("No active thread");
|
|
4886
4886
|
if (ge || !ne) return;
|
|
4887
|
-
const
|
|
4888
|
-
if (
|
|
4887
|
+
const E = J;
|
|
4888
|
+
if (E) {
|
|
4889
4889
|
_e(!0);
|
|
4890
4890
|
try {
|
|
4891
|
-
const I = Ce.current, U = await
|
|
4891
|
+
const I = Ce.current, U = await Ee({
|
|
4892
4892
|
threadId: I,
|
|
4893
|
-
checkpointId:
|
|
4893
|
+
checkpointId: E ?? ke ?? null,
|
|
4894
4894
|
checkpointNs: ie ?? D ?? null
|
|
4895
4895
|
}), { latest: K, checkpoints: he, snapshots: le } = Os(U.payload), ht = Ve(I);
|
|
4896
4896
|
let bt = he.length > 0;
|
|
4897
4897
|
if (bt && ht && ht.size > 0 && (bt = he.some((Be) => {
|
|
4898
4898
|
if (!(Be != null && Be.checkpointId))
|
|
4899
4899
|
return !1;
|
|
4900
|
-
const
|
|
4901
|
-
return !ht.has(
|
|
4900
|
+
const Rt = Xr(Be.checkpointId, Be.checkpointNs ?? null);
|
|
4901
|
+
return !ht.has(Rt);
|
|
4902
4902
|
})), !bt) {
|
|
4903
4903
|
ue(null), ce(void 0), Q(!1), j(null);
|
|
4904
4904
|
return;
|
|
@@ -4920,7 +4920,7 @@ function vv({
|
|
|
4920
4920
|
},
|
|
4921
4921
|
[
|
|
4922
4922
|
Ge,
|
|
4923
|
-
|
|
4923
|
+
Ee,
|
|
4924
4924
|
Ve,
|
|
4925
4925
|
ne,
|
|
4926
4926
|
ke,
|
|
@@ -4934,35 +4934,35 @@ function vv({
|
|
|
4934
4934
|
Xt
|
|
4935
4935
|
]
|
|
4936
4936
|
), rc = de(
|
|
4937
|
-
(
|
|
4938
|
-
if (
|
|
4939
|
-
if (
|
|
4940
|
-
const I = Xr(
|
|
4937
|
+
(E) => {
|
|
4938
|
+
if (E != null && E.threadId) {
|
|
4939
|
+
if (E.checkpointId) {
|
|
4940
|
+
const I = Xr(E.checkpointId, E.checkpointNs ?? null), U = hn(
|
|
4941
4941
|
{
|
|
4942
|
-
...
|
|
4943
|
-
interrupt:
|
|
4942
|
+
...E,
|
|
4943
|
+
interrupt: E.interrupt ?? null
|
|
4944
4944
|
},
|
|
4945
4945
|
{ cloneMessages: !0 }
|
|
4946
4946
|
);
|
|
4947
|
-
Xt(
|
|
4947
|
+
Xt(E.threadId, { [I]: U }, "prepend");
|
|
4948
4948
|
}
|
|
4949
|
-
Ge(
|
|
4949
|
+
Ge(E, "replace", E.threadId);
|
|
4950
4950
|
}
|
|
4951
4951
|
},
|
|
4952
4952
|
[Ge, Xt]
|
|
4953
4953
|
), mo = de(
|
|
4954
|
-
async (
|
|
4954
|
+
async (E, I) => {
|
|
4955
4955
|
var Tr;
|
|
4956
|
-
const U = Ce.current, K = (
|
|
4956
|
+
const U = Ce.current, K = (E == null ? void 0 : E.text) ?? "", he = (E == null ? void 0 : E.attachments) ?? [], le = he.length ? he : (I == null ? void 0 : I.attachments) ?? [], ht = E == null ? void 0 : E.messageAdditionalKwargs, bt = {
|
|
4957
4957
|
...(I == null ? void 0 : I.payloadExtras) ?? {},
|
|
4958
|
-
...(
|
|
4958
|
+
...(E == null ? void 0 : E.payload) ?? {}
|
|
4959
4959
|
};
|
|
4960
4960
|
if (!U && !Object.keys(bt).length && le.length === 0 && !K.trim()) {
|
|
4961
4961
|
console.warn("[ChatSessionProvider] Nothing to submit - skipping");
|
|
4962
4962
|
return;
|
|
4963
4963
|
}
|
|
4964
4964
|
!U && !bt.messages && console.warn("[ChatSessionProvider] No thread ID - message will create new thread");
|
|
4965
|
-
const { contentParts: Be, filesInfo:
|
|
4965
|
+
const { contentParts: Be, filesInfo: Rt } = await Cy(
|
|
4966
4966
|
c,
|
|
4967
4967
|
le
|
|
4968
4968
|
), Wt = [...Be];
|
|
@@ -4981,7 +4981,7 @@ function vv({
|
|
|
4981
4981
|
}), Wt.length > 0 && Pe(Ot);
|
|
4982
4982
|
const tr = { ...Ot, content: Wt }, Cr = le.length > 0, Vr = {
|
|
4983
4983
|
messages: Wt.length > 0 ? [tr] : [],
|
|
4984
|
-
files_info:
|
|
4984
|
+
files_info: Rt,
|
|
4985
4985
|
...o && Cr && s ? { active_agent: s } : {},
|
|
4986
4986
|
...bt
|
|
4987
4987
|
}, Cn = {
|
|
@@ -5018,13 +5018,13 @@ function vv({
|
|
|
5018
5018
|
fe
|
|
5019
5019
|
]
|
|
5020
5020
|
), oc = de(
|
|
5021
|
-
async (
|
|
5021
|
+
async (E, I, U) => {
|
|
5022
5022
|
if (!Ce.current)
|
|
5023
5023
|
throw new Error("No active thread to handle interrupt");
|
|
5024
5024
|
const he = I ? U ?? !0 : !1;
|
|
5025
5025
|
try {
|
|
5026
5026
|
try {
|
|
5027
|
-
We({ type: "interrupt_response", payload: { interruptId:
|
|
5027
|
+
We({ type: "interrupt_response", payload: { interruptId: E } });
|
|
5028
5028
|
} catch (le) {
|
|
5029
5029
|
console.warn("[ChatSessionProvider] optimistic interrupt_response dispatch failed:", le);
|
|
5030
5030
|
}
|
|
@@ -5037,7 +5037,7 @@ function vv({
|
|
|
5037
5037
|
}
|
|
5038
5038
|
), F(null);
|
|
5039
5039
|
} catch (le) {
|
|
5040
|
-
throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${
|
|
5040
|
+
throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${E}:`, le), le;
|
|
5041
5041
|
}
|
|
5042
5042
|
},
|
|
5043
5043
|
[We, H.lastCheckpointId, H.lastCheckpointNs, mo]
|
|
@@ -5046,28 +5046,33 @@ function vv({
|
|
|
5046
5046
|
if (l == null || l(k), k)
|
|
5047
5047
|
try {
|
|
5048
5048
|
localStorage.setItem("lastThreadId", k);
|
|
5049
|
-
} catch (
|
|
5050
|
-
console.warn("[ChatSessionProvider] Failed to persist lastThreadId:",
|
|
5049
|
+
} catch (E) {
|
|
5050
|
+
console.warn("[ChatSessionProvider] Failed to persist lastThreadId:", E);
|
|
5051
5051
|
}
|
|
5052
5052
|
}, [k, l]), St(() => ((async () => {
|
|
5053
5053
|
try {
|
|
5054
|
-
if (
|
|
5055
|
-
console.error("[ChatSessionProvider] Failed to refresh threads (background):", I), i == null || i(String(I));
|
|
5056
|
-
}), !r && !t)
|
|
5054
|
+
if (!r && !t)
|
|
5057
5055
|
try {
|
|
5058
5056
|
const I = localStorage.getItem("lastThreadId");
|
|
5059
5057
|
I && (A(I), n && await Sn(I));
|
|
5060
5058
|
} catch (I) {
|
|
5061
5059
|
console.warn("[ChatSessionProvider] Failed to restore last thread:", I);
|
|
5062
5060
|
}
|
|
5063
|
-
else t && n
|
|
5061
|
+
else if (t && n)
|
|
5062
|
+
await Sn(t);
|
|
5063
|
+
else
|
|
5064
|
+
try {
|
|
5065
|
+
await dt();
|
|
5066
|
+
} catch (I) {
|
|
5067
|
+
console.error("[ChatSessionProvider] Failed to refresh threads (background):", I);
|
|
5068
|
+
}
|
|
5064
5069
|
} catch (I) {
|
|
5065
5070
|
console.error("[ChatSessionProvider] Initialization failed:", I), i == null || i(String(I));
|
|
5066
5071
|
}
|
|
5067
5072
|
})(), () => {
|
|
5068
5073
|
}), []), St(() => {
|
|
5069
|
-
const
|
|
5070
|
-
if (!
|
|
5074
|
+
const E = Ce.current;
|
|
5075
|
+
if (!E || et.current !== E) return;
|
|
5071
5076
|
H.messages.length && H.messages[H.messages.length - 1];
|
|
5072
5077
|
const I = hn({
|
|
5073
5078
|
checkpointId: H.lastCheckpointId ?? null,
|
|
@@ -5076,23 +5081,23 @@ function vv({
|
|
|
5076
5081
|
nextCursor: J ?? null,
|
|
5077
5082
|
nextCursorNs: ie ?? null,
|
|
5078
5083
|
interrupt: H.pendingInterrupt ?? W ?? null
|
|
5079
|
-
}), U = qe.current.get(
|
|
5084
|
+
}), U = qe.current.get(E), K = U == null ? void 0 : U.snapshot, he = !K || K.messages.length !== I.messages.length || K.messages.some((Be, Rt) => {
|
|
5080
5085
|
var Wt;
|
|
5081
|
-
return (Be == null ? void 0 : Be.id) !== ((Wt = I.messages[
|
|
5086
|
+
return (Be == null ? void 0 : Be.id) !== ((Wt = I.messages[Rt]) == null ? void 0 : Wt.id);
|
|
5082
5087
|
}), le = ((K == null ? void 0 : K.checkpointId) ?? null) !== I.checkpointId || ((K == null ? void 0 : K.checkpointNs) ?? null) !== I.checkpointNs, ht = ((K == null ? void 0 : K.nextCursor) ?? null) !== I.nextCursor || ((K == null ? void 0 : K.nextCursorNs) ?? null) !== I.nextCursorNs, bt = !zc(
|
|
5083
5088
|
(K == null ? void 0 : K.interrupt) ?? null,
|
|
5084
5089
|
I.interrupt ?? null
|
|
5085
5090
|
);
|
|
5086
5091
|
if (he || le || ht || bt) {
|
|
5087
5092
|
const Be = {
|
|
5088
|
-
threadId:
|
|
5093
|
+
threadId: E,
|
|
5089
5094
|
snapshot: I
|
|
5090
5095
|
};
|
|
5091
|
-
qe.current.set(
|
|
5096
|
+
qe.current.set(E, Be), Kt.current && window.clearTimeout(Kt.current), Kt.current = window.setTimeout(() => {
|
|
5092
5097
|
try {
|
|
5093
5098
|
g(Be, 100);
|
|
5094
|
-
} catch (
|
|
5095
|
-
console.warn("[ChatSessionProvider] Failed to persist thread payload:",
|
|
5099
|
+
} catch (Rt) {
|
|
5100
|
+
console.warn("[ChatSessionProvider] Failed to persist thread payload:", Rt);
|
|
5096
5101
|
}
|
|
5097
5102
|
}, bs);
|
|
5098
5103
|
}
|
|
@@ -5136,9 +5141,9 @@ function vv({
|
|
|
5136
5141
|
A
|
|
5137
5142
|
]
|
|
5138
5143
|
), sg = ct(() => {
|
|
5139
|
-
const
|
|
5140
|
-
branchLabel: (
|
|
5141
|
-
lastBranch:
|
|
5144
|
+
const E = H.lastBranch ?? null, I = H.assemblingId ?? null, U = E || I ? {
|
|
5145
|
+
branchLabel: (E == null ? void 0 : E.branchLabel) ?? null,
|
|
5146
|
+
lastBranch: E,
|
|
5142
5147
|
assemblingMessageId: I
|
|
5143
5148
|
} : null;
|
|
5144
5149
|
return {
|
|
@@ -5507,7 +5512,7 @@ function kv(...e) {
|
|
|
5507
5512
|
return n.scopeName = t.scopeName, n;
|
|
5508
5513
|
}
|
|
5509
5514
|
var tn = globalThis != null && globalThis.document ? v.useLayoutEffect : () => {
|
|
5510
|
-
},
|
|
5515
|
+
}, Ev = v[" useInsertionEffect ".trim().toString()] || tn;
|
|
5511
5516
|
function ro({
|
|
5512
5517
|
prop: e,
|
|
5513
5518
|
defaultProp: t,
|
|
@@ -5515,7 +5520,7 @@ function ro({
|
|
|
5515
5520
|
},
|
|
5516
5521
|
caller: r
|
|
5517
5522
|
}) {
|
|
5518
|
-
const [o, s, i] =
|
|
5523
|
+
const [o, s, i] = Rv({
|
|
5519
5524
|
defaultProp: t,
|
|
5520
5525
|
onChange: n
|
|
5521
5526
|
}), a = e !== void 0, l = a ? e : o;
|
|
@@ -5541,12 +5546,12 @@ function ro({
|
|
|
5541
5546
|
);
|
|
5542
5547
|
return [l, c];
|
|
5543
5548
|
}
|
|
5544
|
-
function
|
|
5549
|
+
function Rv({
|
|
5545
5550
|
defaultProp: e,
|
|
5546
5551
|
onChange: t
|
|
5547
5552
|
}) {
|
|
5548
5553
|
const [n, r] = v.useState(e), o = v.useRef(n), s = v.useRef(t);
|
|
5549
|
-
return
|
|
5554
|
+
return Ev(() => {
|
|
5550
5555
|
s.current = t;
|
|
5551
5556
|
}, [t]), v.useEffect(() => {
|
|
5552
5557
|
var i;
|
|
@@ -6746,10 +6751,10 @@ function kw(e) {
|
|
|
6746
6751
|
y: n.y * c.y - l.scrollTop * c.y + d.y + h.y
|
|
6747
6752
|
};
|
|
6748
6753
|
}
|
|
6749
|
-
function
|
|
6754
|
+
function Ew(e) {
|
|
6750
6755
|
return Array.from(e.getClientRects());
|
|
6751
6756
|
}
|
|
6752
|
-
function
|
|
6757
|
+
function Rw(e) {
|
|
6753
6758
|
const t = Zn(e), n = pi(e), r = e.ownerDocument.body, o = yn(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = yn(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
|
|
6754
6759
|
let i = -n.scrollLeft + mi(e);
|
|
6755
6760
|
const a = -n.scrollTop;
|
|
@@ -6796,7 +6801,7 @@ function ru(e, t, n) {
|
|
|
6796
6801
|
if (t === "viewport")
|
|
6797
6802
|
r = Iw(e, n);
|
|
6798
6803
|
else if (t === "document")
|
|
6799
|
-
r =
|
|
6804
|
+
r = Rw(Zn(e));
|
|
6800
6805
|
else if (Fn(t))
|
|
6801
6806
|
r = Aw(t, n);
|
|
6802
6807
|
else {
|
|
@@ -6929,7 +6934,7 @@ const Lw = {
|
|
|
6929
6934
|
getClippingRect: jw,
|
|
6930
6935
|
getOffsetParent: Gd,
|
|
6931
6936
|
getElementRects: Mw,
|
|
6932
|
-
getClientRects:
|
|
6937
|
+
getClientRects: Ew,
|
|
6933
6938
|
getDimensions: Pw,
|
|
6934
6939
|
getScale: Jr,
|
|
6935
6940
|
isElement: Fn,
|
|
@@ -7697,7 +7702,7 @@ function yf(e, t = !1) {
|
|
|
7697
7702
|
function kb(e, t) {
|
|
7698
7703
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
7699
7704
|
}
|
|
7700
|
-
var
|
|
7705
|
+
var Eb = mf, Rb = xf, Ib = function(e) {
|
|
7701
7706
|
if (typeof document > "u")
|
|
7702
7707
|
return null;
|
|
7703
7708
|
var t = Array.isArray(e) ? e[0] : e;
|
|
@@ -8069,7 +8074,7 @@ var qr = Da ? { passive: !1 } : !1, e0 = function(e) {
|
|
|
8069
8074
|
typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
|
|
8070
8075
|
var o = kf(e, r);
|
|
8071
8076
|
if (o) {
|
|
8072
|
-
var s =
|
|
8077
|
+
var s = Ef(e, r), i = s[1], a = s[2];
|
|
8073
8078
|
if (i > a)
|
|
8074
8079
|
return !0;
|
|
8075
8080
|
}
|
|
@@ -8092,7 +8097,7 @@ var qr = Da ? { passive: !1 } : !1, e0 = function(e) {
|
|
|
8092
8097
|
];
|
|
8093
8098
|
}, kf = function(e, t) {
|
|
8094
8099
|
return e === "v" ? t0(t) : n0(t);
|
|
8095
|
-
},
|
|
8100
|
+
}, Ef = function(e, t) {
|
|
8096
8101
|
return e === "v" ? r0(t) : o0(t);
|
|
8097
8102
|
}, s0 = function(e, t) {
|
|
8098
8103
|
return e === "h" && t === "rtl" ? -1 : 1;
|
|
@@ -8101,7 +8106,7 @@ var qr = Da ? { passive: !1 } : !1, e0 = function(e) {
|
|
|
8101
8106
|
do {
|
|
8102
8107
|
if (!a)
|
|
8103
8108
|
break;
|
|
8104
|
-
var p =
|
|
8109
|
+
var p = Ef(e, a), m = p[0], g = p[1], x = p[2], y = g - x - s * m;
|
|
8105
8110
|
(m || y) && kf(e, a) && (f += y, h += m);
|
|
8106
8111
|
var w = a.parentNode;
|
|
8107
8112
|
a = w && w.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? w.host : w;
|
|
@@ -8217,7 +8222,7 @@ var vi = v.forwardRef(function(e, t) {
|
|
|
8217
8222
|
return v.createElement(yi, qn({}, e, { ref: t, sideCar: f0 }));
|
|
8218
8223
|
});
|
|
8219
8224
|
vi.classNames = yi.classNames;
|
|
8220
|
-
var La = ["Enter", " "], h0 = ["ArrowDown", "PageUp", "Home"],
|
|
8225
|
+
var La = ["Enter", " "], h0 = ["ArrowDown", "PageUp", "Home"], Rf = ["ArrowUp", "PageDown", "End"], p0 = [...h0, ...Rf], m0 = {
|
|
8221
8226
|
ltr: [...La, "ArrowRight"],
|
|
8222
8227
|
rtl: [...La, "ArrowLeft"]
|
|
8223
8228
|
}, g0 = {
|
|
@@ -8285,7 +8290,7 @@ var In = "MenuContent", [C0, kl] = Fr(In), Pf = v.forwardRef(
|
|
|
8285
8290
|
const s = r.current;
|
|
8286
8291
|
if (s) return Sl(s);
|
|
8287
8292
|
}, []), /* @__PURE__ */ u.jsx(
|
|
8288
|
-
|
|
8293
|
+
El,
|
|
8289
8294
|
{
|
|
8290
8295
|
...e,
|
|
8291
8296
|
ref: o,
|
|
@@ -8304,7 +8309,7 @@ var In = "MenuContent", [C0, kl] = Fr(In), Pf = v.forwardRef(
|
|
|
8304
8309
|
), k0 = v.forwardRef((e, t) => {
|
|
8305
8310
|
const n = $r(In, e.__scopeMenu);
|
|
8306
8311
|
return /* @__PURE__ */ u.jsx(
|
|
8307
|
-
|
|
8312
|
+
El,
|
|
8308
8313
|
{
|
|
8309
8314
|
...e,
|
|
8310
8315
|
ref: t,
|
|
@@ -8314,7 +8319,7 @@ var In = "MenuContent", [C0, kl] = Fr(In), Pf = v.forwardRef(
|
|
|
8314
8319
|
onDismiss: () => n.onOpenChange(!1)
|
|
8315
8320
|
}
|
|
8316
8321
|
);
|
|
8317
|
-
}),
|
|
8322
|
+
}), E0 = to("MenuContent.ScrollLock"), El = v.forwardRef(
|
|
8318
8323
|
(e, t) => {
|
|
8319
8324
|
const {
|
|
8320
8325
|
__scopeMenu: n,
|
|
@@ -8331,7 +8336,7 @@ var In = "MenuContent", [C0, kl] = Fr(In), Pf = v.forwardRef(
|
|
|
8331
8336
|
onDismiss: p,
|
|
8332
8337
|
disableOutsideScroll: m,
|
|
8333
8338
|
...g
|
|
8334
|
-
} = e, x = $r(In, n), y = Go(In, n), w = wi(n), S = Nf(n), T = x0(n), [C, b] = v.useState(null), k = v.useRef(null), A = rt(t, k, x.onContentChange), N = v.useRef(0), _ = v.useRef(""), M = v.useRef(0), $ = v.useRef(null), z = v.useRef("right"), P = v.useRef(0), B = m ? vi : v.Fragment, j = m ? { as:
|
|
8339
|
+
} = e, x = $r(In, n), y = Go(In, n), w = wi(n), S = Nf(n), T = x0(n), [C, b] = v.useState(null), k = v.useRef(null), A = rt(t, k, x.onContentChange), N = v.useRef(0), _ = v.useRef(""), M = v.useRef(0), $ = v.useRef(null), z = v.useRef("right"), P = v.useRef(0), B = m ? vi : v.Fragment, j = m ? { as: E0, allowPinchZoom: !0 } : void 0, W = (L) => {
|
|
8335
8340
|
var ee, D;
|
|
8336
8341
|
const ne = _.current + L, Q = T().filter((q) => !q.disabled), ge = document.activeElement, _e = (ee = Q.find((q) => q.ref.current === ge)) == null ? void 0 : ee.textValue, J = Q.map((q) => q.textValue), ue = F0(J, ne, _e), ke = (D = Q.find((q) => q.textValue === ue)) == null ? void 0 : D.ref.current;
|
|
8337
8342
|
(function q(ie) {
|
|
@@ -8392,7 +8397,7 @@ var In = "MenuContent", [C0, kl] = Fr(In), Pf = v.forwardRef(
|
|
|
8392
8397
|
onInteractOutside: h,
|
|
8393
8398
|
onDismiss: p,
|
|
8394
8399
|
children: /* @__PURE__ */ u.jsx(
|
|
8395
|
-
|
|
8400
|
+
Eb,
|
|
8396
8401
|
{
|
|
8397
8402
|
asChild: !0,
|
|
8398
8403
|
...S,
|
|
@@ -8424,7 +8429,7 @@ var In = "MenuContent", [C0, kl] = Fr(In), Pf = v.forwardRef(
|
|
|
8424
8429
|
if (L.target !== J || !p0.includes(L.key)) return;
|
|
8425
8430
|
L.preventDefault();
|
|
8426
8431
|
const ke = T().filter((ee) => !ee.disabled).map((ee) => ee.ref.current);
|
|
8427
|
-
|
|
8432
|
+
Rf.includes(L.key) && ke.reverse(), D0(ke);
|
|
8428
8433
|
}),
|
|
8429
8434
|
onBlur: xe(e.onBlur, (L) => {
|
|
8430
8435
|
L.currentTarget.contains(L.target) || (window.clearTimeout(N.current), _.current = "");
|
|
@@ -8452,13 +8457,13 @@ var In = "MenuContent", [C0, kl] = Fr(In), Pf = v.forwardRef(
|
|
|
8452
8457
|
}
|
|
8453
8458
|
);
|
|
8454
8459
|
Pf.displayName = In;
|
|
8455
|
-
var
|
|
8460
|
+
var R0 = "MenuGroup", Rl = v.forwardRef(
|
|
8456
8461
|
(e, t) => {
|
|
8457
8462
|
const { __scopeMenu: n, ...r } = e;
|
|
8458
8463
|
return /* @__PURE__ */ u.jsx(Fe.div, { role: "group", ...r, ref: t });
|
|
8459
8464
|
}
|
|
8460
8465
|
);
|
|
8461
|
-
|
|
8466
|
+
Rl.displayName = R0;
|
|
8462
8467
|
var I0 = "MenuLabel", Of = v.forwardRef(
|
|
8463
8468
|
(e, t) => {
|
|
8464
8469
|
const { __scopeMenu: n, ...r } = e;
|
|
@@ -8511,7 +8516,7 @@ var Mf = v.forwardRef(
|
|
|
8511
8516
|
scope: n,
|
|
8512
8517
|
disabled: r,
|
|
8513
8518
|
textValue: o ?? h,
|
|
8514
|
-
children: /* @__PURE__ */ u.jsx(
|
|
8519
|
+
children: /* @__PURE__ */ u.jsx(Rb, { asChild: !0, ...a, focusable: !r, children: /* @__PURE__ */ u.jsx(
|
|
8515
8520
|
Fe.div,
|
|
8516
8521
|
{
|
|
8517
8522
|
role: "menuitem",
|
|
@@ -8565,7 +8570,7 @@ var Lf = "MenuRadioGroup", [A0, _0] = Fr(
|
|
|
8565
8570
|
), Ff = v.forwardRef(
|
|
8566
8571
|
(e, t) => {
|
|
8567
8572
|
const { value: n, onValueChange: r, ...o } = e, s = en(r);
|
|
8568
|
-
return /* @__PURE__ */ u.jsx(A0, { scope: e.__scopeMenu, value: n, onValueChange: s, children: /* @__PURE__ */ u.jsx(
|
|
8573
|
+
return /* @__PURE__ */ u.jsx(A0, { scope: e.__scopeMenu, value: n, onValueChange: s, children: /* @__PURE__ */ u.jsx(Rl, { ...o, ref: t }) });
|
|
8569
8574
|
}
|
|
8570
8575
|
);
|
|
8571
8576
|
Ff.displayName = Lf;
|
|
@@ -8638,7 +8643,7 @@ var O0 = "MenuArrow", Wf = v.forwardRef(
|
|
|
8638
8643
|
}
|
|
8639
8644
|
);
|
|
8640
8645
|
Wf.displayName = O0;
|
|
8641
|
-
var M0 = "MenuSub", [
|
|
8646
|
+
var M0 = "MenuSub", [FE, Vf] = Fr(M0), vo = "MenuSubTrigger", Kf = v.forwardRef(
|
|
8642
8647
|
(e, t) => {
|
|
8643
8648
|
const n = $r(vo, e.__scopeMenu), r = Go(vo, e.__scopeMenu), o = Vf(vo, e.__scopeMenu), s = kl(vo, e.__scopeMenu), i = v.useRef(null), { pointerGraceTimerRef: a, onPointerGraceIntentChange: l } = s, c = { __scopeMenu: e.__scopeMenu }, d = v.useCallback(() => {
|
|
8644
8649
|
i.current && window.clearTimeout(i.current), i.current = null;
|
|
@@ -8713,7 +8718,7 @@ var qf = "MenuSubContent", Gf = v.forwardRef(
|
|
|
8713
8718
|
(e, t) => {
|
|
8714
8719
|
const n = _f(In, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = $r(In, e.__scopeMenu), i = Go(In, e.__scopeMenu), a = Vf(qf, e.__scopeMenu), l = v.useRef(null), c = rt(t, l);
|
|
8715
8720
|
return /* @__PURE__ */ u.jsx(_o.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u.jsx(An, { present: r || s.open, children: /* @__PURE__ */ u.jsx(_o.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ u.jsx(
|
|
8716
|
-
|
|
8721
|
+
El,
|
|
8717
8722
|
{
|
|
8718
8723
|
id: a.contentId,
|
|
8719
8724
|
"aria-labelledby": a.triggerId,
|
|
@@ -8788,7 +8793,7 @@ function z0(e, t) {
|
|
|
8788
8793
|
function jo(e) {
|
|
8789
8794
|
return (t) => t.pointerType === "mouse" ? e(t) : void 0;
|
|
8790
8795
|
}
|
|
8791
|
-
var B0 = Af, H0 = Cl, U0 = jf, W0 = Pf, V0 =
|
|
8796
|
+
var B0 = Af, H0 = Cl, U0 = jf, W0 = Pf, V0 = Rl, K0 = Of, q0 = bi, G0 = Df, Y0 = Ff, X0 = zf, J0 = Hf, Z0 = Uf, Q0 = Wf, eS = Kf, tS = Gf, Si = "DropdownMenu", [nS, $E] = ar(
|
|
8792
8797
|
Si,
|
|
8793
8798
|
[If]
|
|
8794
8799
|
), ln = If(), [rS, Xf] = nS(Si), Jf = (e) => {
|
|
@@ -9020,7 +9025,7 @@ const Fa = v.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
|
|
|
9020
9025
|
}
|
|
9021
9026
|
));
|
|
9022
9027
|
Fa.displayName = hh.displayName;
|
|
9023
|
-
const
|
|
9028
|
+
const ES = v.forwardRef(({ className: e, children: t, checked: n, ...r }, o) => /* @__PURE__ */ u.jsxs(
|
|
9024
9029
|
ph,
|
|
9025
9030
|
{
|
|
9026
9031
|
ref: o,
|
|
@@ -9036,8 +9041,8 @@ const RS = v.forwardRef(({ className: e, children: t, checked: n, ...r }, o) =>
|
|
|
9036
9041
|
]
|
|
9037
9042
|
}
|
|
9038
9043
|
));
|
|
9039
|
-
|
|
9040
|
-
const
|
|
9044
|
+
ES.displayName = ph.displayName;
|
|
9045
|
+
const RS = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ u.jsxs(
|
|
9041
9046
|
mh,
|
|
9042
9047
|
{
|
|
9043
9048
|
ref: r,
|
|
@@ -9052,7 +9057,7 @@ const ES = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
9052
9057
|
]
|
|
9053
9058
|
}
|
|
9054
9059
|
));
|
|
9055
|
-
|
|
9060
|
+
RS.displayName = mh.displayName;
|
|
9056
9061
|
const IS = v.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */ u.jsx(
|
|
9057
9062
|
fh,
|
|
9058
9063
|
{
|
|
@@ -9075,7 +9080,7 @@ const NS = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
9075
9080
|
}
|
|
9076
9081
|
));
|
|
9077
9082
|
NS.displayName = xh.displayName;
|
|
9078
|
-
const
|
|
9083
|
+
const Es = 1e4;
|
|
9079
9084
|
function AS(e) {
|
|
9080
9085
|
if (typeof e != "string")
|
|
9081
9086
|
return String(e);
|
|
@@ -9103,7 +9108,7 @@ function AS(e) {
|
|
|
9103
9108
|
`).replace(/<li>(.*?)<\/li>/gi, `- $1
|
|
9104
9109
|
`).trim() : n.replace(/</g, "<").replace(/>/g, ">").trim();
|
|
9105
9110
|
}
|
|
9106
|
-
function _S(e, t =
|
|
9111
|
+
function _S(e, t = Es) {
|
|
9107
9112
|
if (!e || typeof e != "string")
|
|
9108
9113
|
throw new Error("Invalid content: must be a non-empty string");
|
|
9109
9114
|
if (e.length > t)
|
|
@@ -9583,13 +9588,13 @@ function za(e, t) {
|
|
|
9583
9588
|
if (Ct(o))
|
|
9584
9589
|
return r;
|
|
9585
9590
|
{
|
|
9586
|
-
const [s, i] =
|
|
9587
|
-
return
|
|
9591
|
+
const [s, i] = Rh(r);
|
|
9592
|
+
return Rs(Vt(e, { k: s, l: Eh(r), v: i }));
|
|
9588
9593
|
}
|
|
9589
|
-
} else return t < n ?
|
|
9594
|
+
} else return t < n ? Rs(Vt(e, { l: za(r, t) })) : Rs(Vt(e, { r: za(o, t) }));
|
|
9590
9595
|
}
|
|
9591
|
-
function
|
|
9592
|
-
return Ct(e) ? [] : [...
|
|
9596
|
+
function Rr(e) {
|
|
9597
|
+
return Ct(e) ? [] : [...Rr(e.l), { k: e.k, v: e.v }, ...Rr(e.r)];
|
|
9593
9598
|
}
|
|
9594
9599
|
function Ba(e, t, n) {
|
|
9595
9600
|
if (Ct(e))
|
|
@@ -9598,7 +9603,7 @@ function Ba(e, t, n) {
|
|
|
9598
9603
|
let a = [];
|
|
9599
9604
|
return r > t && (a = a.concat(Ba(o, t, n))), r >= t && r <= n && a.push({ k: r, v: i }), r <= n && (a = a.concat(Ba(s, t, n))), a;
|
|
9600
9605
|
}
|
|
9601
|
-
function
|
|
9606
|
+
function Rs(e) {
|
|
9602
9607
|
const { l: t, lvl: n, r } = e;
|
|
9603
9608
|
if (r.lvl >= n - 1 && t.lvl >= n - 1)
|
|
9604
9609
|
return e;
|
|
@@ -9641,14 +9646,14 @@ function Vt(e, t) {
|
|
|
9641
9646
|
t.r !== void 0 ? t.r : e.r
|
|
9642
9647
|
);
|
|
9643
9648
|
}
|
|
9644
|
-
function
|
|
9645
|
-
return Ct(e.r) ? e.l :
|
|
9649
|
+
function Eh(e) {
|
|
9650
|
+
return Ct(e.r) ? e.l : Rs(Vt(e, { r: Eh(e.r) }));
|
|
9646
9651
|
}
|
|
9647
9652
|
function ca(e) {
|
|
9648
9653
|
return Ct(e) || e.lvl > e.r.lvl;
|
|
9649
9654
|
}
|
|
9650
|
-
function
|
|
9651
|
-
return Ct(e.r) ? [e.k, e.v] :
|
|
9655
|
+
function Rh(e) {
|
|
9656
|
+
return Ct(e.r) ? [e.k, e.v] : Rh(e.r);
|
|
9652
9657
|
}
|
|
9653
9658
|
function Ih(e, t, n, r = Po, o = Po) {
|
|
9654
9659
|
return { k: e, l: r, lvl: n, r: o, v: t };
|
|
@@ -9706,7 +9711,7 @@ function KS(e, t, n, r) {
|
|
|
9706
9711
|
function hr(e, t) {
|
|
9707
9712
|
return Math.round(e.getBoundingClientRect()[t]);
|
|
9708
9713
|
}
|
|
9709
|
-
function
|
|
9714
|
+
function Ei(e) {
|
|
9710
9715
|
return !Ct(e.groupOffsetTree);
|
|
9711
9716
|
}
|
|
9712
9717
|
function Ol({ index: e }, t) {
|
|
@@ -9754,7 +9759,7 @@ function Do(e, t, n) {
|
|
|
9754
9759
|
return a > 0 ? a + n : a;
|
|
9755
9760
|
}
|
|
9756
9761
|
function jh(e, t) {
|
|
9757
|
-
if (!
|
|
9762
|
+
if (!Ei(t))
|
|
9758
9763
|
return e;
|
|
9759
9764
|
let n = 0;
|
|
9760
9765
|
for (; t.groupIndices[n] <= e + n; )
|
|
@@ -9796,7 +9801,7 @@ function ZS(e, [t, n, r, o]) {
|
|
|
9796
9801
|
};
|
|
9797
9802
|
}
|
|
9798
9803
|
function QS(e) {
|
|
9799
|
-
return
|
|
9804
|
+
return Rr(e).map(({ k: t, v: n }, r, o) => {
|
|
9800
9805
|
const s = o[r + 1];
|
|
9801
9806
|
return { endIndex: s ? s.k - 1 : 1 / 0, size: n, startIndex: t };
|
|
9802
9807
|
});
|
|
@@ -9963,7 +9968,7 @@ const nC = {
|
|
|
9963
9968
|
startIndex: P + 1
|
|
9964
9969
|
}), $++, M += B + 1;
|
|
9965
9970
|
}
|
|
9966
|
-
const z =
|
|
9971
|
+
const z = Rr(b.sizeTree);
|
|
9967
9972
|
return M !== C && z.shift(), z.reduce(
|
|
9968
9973
|
(P, { k: B, v: j }) => {
|
|
9969
9974
|
let W = P.ranges;
|
|
@@ -9987,7 +9992,7 @@ const nC = {
|
|
|
9987
9992
|
}
|
|
9988
9993
|
).ranges;
|
|
9989
9994
|
}
|
|
9990
|
-
return
|
|
9995
|
+
return Rr(b.sizeTree).reduce(
|
|
9991
9996
|
(_, { k: M, v: $ }) => ({
|
|
9992
9997
|
prevIndex: M + C,
|
|
9993
9998
|
prevSize: $,
|
|
@@ -10029,7 +10034,7 @@ const nC = {
|
|
|
10029
10034
|
const z = N[M + 1] - $ - 1;
|
|
10030
10035
|
M++, _ += z + 1;
|
|
10031
10036
|
}
|
|
10032
|
-
if (A =
|
|
10037
|
+
if (A = Rr(b.sizeTree).reduce((z, { k: P, v: B }) => vn(z, Math.max(0, P + C), B), A), _ !== -C) {
|
|
10033
10038
|
const z = Oo(b.sizeTree, $);
|
|
10034
10039
|
A = vn(A, 0, z);
|
|
10035
10040
|
const P = zn(b.sizeTree, -C + 1)[1];
|
|
@@ -10041,7 +10046,7 @@ const nC = {
|
|
|
10041
10046
|
...Ua(b.offsetTree, 0, A, k)
|
|
10042
10047
|
};
|
|
10043
10048
|
} else {
|
|
10044
|
-
const A =
|
|
10049
|
+
const A = Rr(b.sizeTree).reduce((N, { k: _, v: M }) => vn(N, Math.max(0, _ + C), M), Qr());
|
|
10045
10050
|
return {
|
|
10046
10051
|
...b,
|
|
10047
10052
|
sizeTree: A,
|
|
@@ -10103,7 +10108,7 @@ const Oh = ut(
|
|
|
10103
10108
|
), be(
|
|
10104
10109
|
X(
|
|
10105
10110
|
Bt(o, t, r),
|
|
10106
|
-
je(([l, c]) =>
|
|
10111
|
+
je(([l, c]) => Ei(c)),
|
|
10107
10112
|
pe(([l, c, d]) => zn(c.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
|
|
10108
10113
|
It(),
|
|
10109
10114
|
pe((l) => [l])
|
|
@@ -10465,7 +10470,7 @@ const Ll = ut(
|
|
|
10465
10470
|
{ singleton: !0 }
|
|
10466
10471
|
);
|
|
10467
10472
|
function cC(e, t, n) {
|
|
10468
|
-
if (
|
|
10473
|
+
if (Ei(t)) {
|
|
10469
10474
|
const r = jh(e, t);
|
|
10470
10475
|
return [
|
|
10471
10476
|
{ index: zn(t.groupOffsetTree, r)[0], offset: 0, size: 0 },
|
|
@@ -10525,7 +10530,7 @@ function Lh(e, t, n, r, o, s) {
|
|
|
10525
10530
|
function Su(e, t, n) {
|
|
10526
10531
|
if (e.length === 0)
|
|
10527
10532
|
return [];
|
|
10528
|
-
if (!
|
|
10533
|
+
if (!Ei(t))
|
|
10529
10534
|
return e.map((c) => ({ ...c, index: c.index + n, originalIndex: c.index }));
|
|
10530
10535
|
const r = e[0].index, o = e[e.length - 1].index, s = [], i = ki(t.groupOffsetTree, r, o);
|
|
10531
10536
|
let a, l = 0;
|
|
@@ -11443,8 +11448,8 @@ const TC = /* @__PURE__ */ ut(() => {
|
|
|
11443
11448
|
}), kC = /* @__PURE__ */ ut(
|
|
11444
11449
|
([e, t]) => ({ ...e, ...t }),
|
|
11445
11450
|
Nt(Uh, TC)
|
|
11446
|
-
),
|
|
11447
|
-
const t = De("listState"), n =
|
|
11451
|
+
), EC = ({ height: e }) => /* @__PURE__ */ u.jsx("div", { style: { height: e } }), RC = { overflowAnchor: "none", position: $l(), zIndex: 1 }, Yh = { overflowAnchor: "none" }, IC = { ...Yh, display: "inline-block", height: "100%" }, ku = /* @__PURE__ */ V.memo(function({ showTopList: e = !1 }) {
|
|
11452
|
+
const t = De("listState"), n = En("sizeRanges"), r = De("useWindowScroll"), o = De("customScrollParent"), s = En("windowScrollContainerState"), i = En("scrollContainerState"), a = o || r ? s : i, l = De("itemContent"), c = De("context"), d = De("groupContent"), f = De("trackItemSizes"), h = De("itemSize"), p = De("log"), m = En("gap"), g = De("horizontalDirection"), { callbackRef: x } = US(
|
|
11448
11453
|
n,
|
|
11449
11454
|
h,
|
|
11450
11455
|
f,
|
|
@@ -11458,7 +11463,7 @@ const TC = /* @__PURE__ */ ut(() => {
|
|
|
11458
11463
|
Bl("deviation", (P) => {
|
|
11459
11464
|
y !== P && w(P);
|
|
11460
11465
|
});
|
|
11461
|
-
const S = De("EmptyPlaceholder"), T = De("ScrollSeekPlaceholder") ||
|
|
11466
|
+
const S = De("EmptyPlaceholder"), T = De("ScrollSeekPlaceholder") || EC, C = De("ListComponent"), b = De("ItemComponent"), k = De("GroupComponent"), A = De("computeItemKey"), N = De("isSeeking"), _ = De("groupIndices").length > 0, M = De("alignToBottom"), $ = De("initialItemFinalLocationReached"), z = e ? {} : {
|
|
11462
11467
|
boxSizing: "border-box",
|
|
11463
11468
|
...g ? {
|
|
11464
11469
|
display: "inline-block",
|
|
@@ -11501,7 +11506,7 @@ const TC = /* @__PURE__ */ ut(() => {
|
|
|
11501
11506
|
"data-item-index": P.index,
|
|
11502
11507
|
"data-known-size": P.size,
|
|
11503
11508
|
key: j,
|
|
11504
|
-
style:
|
|
11509
|
+
style: RC
|
|
11505
11510
|
},
|
|
11506
11511
|
d(P.index, c)
|
|
11507
11512
|
) : /* @__PURE__ */ ms(
|
|
@@ -11531,7 +11536,7 @@ const TC = /* @__PURE__ */ ut(() => {
|
|
|
11531
11536
|
outline: "none",
|
|
11532
11537
|
overflowX: "auto",
|
|
11533
11538
|
position: "relative"
|
|
11534
|
-
},
|
|
11539
|
+
}, Ri = (e) => ({
|
|
11535
11540
|
height: "100%",
|
|
11536
11541
|
position: "absolute",
|
|
11537
11542
|
top: 0,
|
|
@@ -11551,7 +11556,7 @@ function jC(e, t) {
|
|
|
11551
11556
|
return { item: typeof e == "string" ? void 0 : t };
|
|
11552
11557
|
}
|
|
11553
11558
|
const PC = /* @__PURE__ */ V.memo(function() {
|
|
11554
|
-
const e = De("HeaderComponent"), t =
|
|
11559
|
+
const e = De("HeaderComponent"), t = En("headerHeight"), n = De("HeaderFooterTag"), r = zr(
|
|
11555
11560
|
V.useMemo(
|
|
11556
11561
|
() => (s) => {
|
|
11557
11562
|
t(hr(s, "height"));
|
|
@@ -11563,7 +11568,7 @@ const PC = /* @__PURE__ */ V.memo(function() {
|
|
|
11563
11568
|
), o = De("context");
|
|
11564
11569
|
return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...on(e, o) }) }) : null;
|
|
11565
11570
|
}), OC = /* @__PURE__ */ V.memo(function() {
|
|
11566
|
-
const e = De("FooterComponent"), t =
|
|
11571
|
+
const e = De("FooterComponent"), t = En("footerHeight"), n = De("HeaderFooterTag"), r = zr(
|
|
11567
11572
|
V.useMemo(
|
|
11568
11573
|
() => (s) => {
|
|
11569
11574
|
t(hr(s, "height"));
|
|
@@ -11628,22 +11633,22 @@ function Jh({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
|
11628
11633
|
});
|
|
11629
11634
|
}
|
|
11630
11635
|
const MC = ({ children: e }) => {
|
|
11631
|
-
const t = V.useContext(Vh), n =
|
|
11636
|
+
const t = V.useContext(Vh), n = En("viewportHeight"), r = En("fixedItemHeight"), o = De("alignToBottom"), s = De("horizontalDirection"), i = V.useMemo(
|
|
11632
11637
|
() => Sh(n, (l) => hr(l, s ? "width" : "height")),
|
|
11633
11638
|
[n, s]
|
|
11634
11639
|
), a = zr(i, !0, De("skipAnimationFrameInResizeObserver"));
|
|
11635
11640
|
return V.useEffect(() => {
|
|
11636
11641
|
t && (n(t.viewportHeight), r(t.itemHeight));
|
|
11637
|
-
}, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "element", ref: a, style:
|
|
11642
|
+
}, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "element", ref: a, style: Ri(o), children: e });
|
|
11638
11643
|
}, DC = ({ children: e }) => {
|
|
11639
|
-
const t = V.useContext(Vh), n =
|
|
11644
|
+
const t = V.useContext(Vh), n = En("windowViewportRect"), r = En("fixedItemHeight"), o = De("customScrollParent"), s = Th(
|
|
11640
11645
|
n,
|
|
11641
11646
|
o,
|
|
11642
11647
|
De("skipAnimationFrameInResizeObserver")
|
|
11643
11648
|
), i = De("alignToBottom");
|
|
11644
11649
|
return V.useEffect(() => {
|
|
11645
11650
|
t && (r(t.itemHeight), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: 100 }));
|
|
11646
|
-
}, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "window", ref: s, style:
|
|
11651
|
+
}, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "window", ref: s, style: Ri(i), children: e });
|
|
11647
11652
|
}, LC = ({ children: e }) => {
|
|
11648
11653
|
const t = De("TopItemListComponent") || "div", n = De("headerHeight"), r = { ..._C, marginTop: `${n}px` }, o = De("context");
|
|
11649
11654
|
return /* @__PURE__ */ u.jsx(t, { style: r, ...on(t, o), children: e });
|
|
@@ -11661,7 +11666,7 @@ const MC = ({ children: e }) => {
|
|
|
11661
11666
|
Component: $C,
|
|
11662
11667
|
useEmitter: Bl,
|
|
11663
11668
|
useEmitterValue: De,
|
|
11664
|
-
usePublisher:
|
|
11669
|
+
usePublisher: En
|
|
11665
11670
|
} = /* @__PURE__ */ Wh(
|
|
11666
11671
|
kC,
|
|
11667
11672
|
{
|
|
@@ -11721,7 +11726,7 @@ const MC = ({ children: e }) => {
|
|
|
11721
11726
|
}
|
|
11722
11727
|
},
|
|
11723
11728
|
FC
|
|
11724
|
-
), zC = /* @__PURE__ */ Xh({ useEmitter: Bl, useEmitterValue: De, usePublisher:
|
|
11729
|
+
), zC = /* @__PURE__ */ Xh({ useEmitter: Bl, useEmitterValue: De, usePublisher: En }), BC = /* @__PURE__ */ Jh({ useEmitter: Bl, useEmitterValue: De, usePublisher: En }), HC = $C, UC = /* @__PURE__ */ ut(() => {
|
|
11725
11730
|
const e = te((c) => /* @__PURE__ */ u.jsxs("td", { children: [
|
|
11726
11731
|
"Item $",
|
|
11727
11732
|
c
|
|
@@ -11759,7 +11764,7 @@ const MC = ({ children: e }) => {
|
|
|
11759
11764
|
});
|
|
11760
11765
|
Nt(Uh, UC);
|
|
11761
11766
|
$l();
|
|
11762
|
-
const
|
|
11767
|
+
const Eu = {
|
|
11763
11768
|
bottom: 0,
|
|
11764
11769
|
itemHeight: 0,
|
|
11765
11770
|
items: [],
|
|
@@ -11775,7 +11780,7 @@ const Ru = {
|
|
|
11775
11780
|
offsetBottom: 0,
|
|
11776
11781
|
offsetTop: 0,
|
|
11777
11782
|
top: 0
|
|
11778
|
-
}, { ceil:
|
|
11783
|
+
}, { ceil: Ru, floor: Ws, max: Co, min: ha, round: Iu } = Math;
|
|
11779
11784
|
function Nu(e, t, n) {
|
|
11780
11785
|
return Array.from({ length: t - e + 1 }).map((r, o) => ({ data: n === null ? null : n[o + e], index: o + e }));
|
|
11781
11786
|
}
|
|
@@ -11801,7 +11806,7 @@ const qC = /* @__PURE__ */ ut(
|
|
|
11801
11806
|
{ customScrollParent: x, useWindowScroll: y, windowScrollContainerState: w, windowScrollTo: S, windowViewportRect: T },
|
|
11802
11807
|
C
|
|
11803
11808
|
]) => {
|
|
11804
|
-
const b = te(0), k = te(0), A = te(
|
|
11809
|
+
const b = te(0), k = te(0), A = te(Eu), N = te({ height: 0, width: 0 }), _ = te({ height: 0, width: 0 }), M = nt(), $ = nt(), z = te(0), P = te(null), B = te({ column: 0, row: 0 }), j = nt(), W = nt(), F = te(!1), L = te(0), ne = te(!0), Q = te(!1), ge = te(!1);
|
|
11805
11810
|
mt(
|
|
11806
11811
|
X(
|
|
11807
11812
|
m,
|
|
@@ -11893,15 +11898,15 @@ const qC = /* @__PURE__ */ ut(
|
|
|
11893
11898
|
]) => {
|
|
11894
11899
|
const { column: ot, row: Ce } = ce, { height: Xe, width: st } = H, { width: Qe } = We;
|
|
11895
11900
|
if (ye === 0 && (D === 0 || Qe === 0))
|
|
11896
|
-
return
|
|
11901
|
+
return Eu;
|
|
11897
11902
|
if (st === 0) {
|
|
11898
11903
|
const it = Dl($e, D), Yt = it + Math.max(ye - 1, 0);
|
|
11899
11904
|
return VC(Nu(it, Yt, re));
|
|
11900
11905
|
}
|
|
11901
11906
|
const Je = Zh(Qe, st, ot);
|
|
11902
11907
|
let qe, et;
|
|
11903
|
-
Pe ? q === 0 && ie === 0 && ye > 0 ? (qe = 0, et = ye - 1) : (qe = Je * Ws((q + Ce) / (Xe + Ce)), et = Je *
|
|
11904
|
-
const Mt = Nu(qe, et, re), { bottom: kt, top: tt } = Au(We, ce, H, Mt), vt =
|
|
11908
|
+
Pe ? q === 0 && ie === 0 && ye > 0 ? (qe = 0, et = ye - 1) : (qe = Je * Ws((q + Ce) / (Xe + Ce)), et = Je * Ru((ie + Ce) / (Xe + Ce)) - 1, et = ha(D - 1, Co(et, Je - 1)), qe = ha(et, Co(0, qe))) : (qe = 0, et = -1);
|
|
11909
|
+
const Mt = Nu(qe, et, re), { bottom: kt, top: tt } = Au(We, ce, H, Mt), vt = Ru(D / Je), At = vt * Xe + (vt - 1) * Ce - kt;
|
|
11905
11910
|
return { bottom: kt, itemHeight: Xe, items: Mt, itemWidth: st, offsetBottom: At, offsetTop: tt, top: tt };
|
|
11906
11911
|
}
|
|
11907
11912
|
)
|
|
@@ -12083,7 +12088,7 @@ const GC = /* @__PURE__ */ ut(() => {
|
|
|
12083
12088
|
([e, t]) => ({ ...e, ...t }),
|
|
12084
12089
|
Nt(qC, GC)
|
|
12085
12090
|
), XC = /* @__PURE__ */ V.memo(function() {
|
|
12086
|
-
const e = jt("gridState"), t = jt("listClassName"), n = jt("itemClassName"), r = jt("itemContent"), o = jt("computeItemKey"), s = jt("isSeeking"), i =
|
|
12091
|
+
const e = jt("gridState"), t = jt("listClassName"), n = jt("itemClassName"), r = jt("itemContent"), o = jt("computeItemKey"), s = jt("isSeeking"), i = Rn("scrollHeight"), a = jt("ItemComponent"), l = jt("ListComponent"), c = jt("ScrollSeekPlaceholder"), d = jt("context"), f = Rn("itemDimensions"), h = Rn("gap"), p = jt("log"), m = jt("stateRestoreInProgress"), g = Rn("reportReadyState"), x = zr(
|
|
12087
12092
|
V.useMemo(
|
|
12088
12093
|
() => (y) => {
|
|
12089
12094
|
const w = y.parentElement.parentElement.scrollHeight;
|
|
@@ -12138,7 +12143,7 @@ const GC = /* @__PURE__ */ ut(() => {
|
|
|
12138
12143
|
}
|
|
12139
12144
|
);
|
|
12140
12145
|
}), JC = V.memo(function() {
|
|
12141
|
-
const e = jt("HeaderComponent"), t =
|
|
12146
|
+
const e = jt("HeaderComponent"), t = Rn("headerHeight"), n = jt("headerFooterTag"), r = zr(
|
|
12142
12147
|
V.useMemo(
|
|
12143
12148
|
() => (s) => {
|
|
12144
12149
|
t(hr(s, "height"));
|
|
@@ -12150,7 +12155,7 @@ const GC = /* @__PURE__ */ ut(() => {
|
|
|
12150
12155
|
), o = jt("context");
|
|
12151
12156
|
return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...on(e, o) }) }) : null;
|
|
12152
12157
|
}), ZC = V.memo(function() {
|
|
12153
|
-
const e = jt("FooterComponent"), t =
|
|
12158
|
+
const e = jt("FooterComponent"), t = Rn("footerHeight"), n = jt("headerFooterTag"), r = zr(
|
|
12154
12159
|
V.useMemo(
|
|
12155
12160
|
() => (s) => {
|
|
12156
12161
|
t(hr(s, "height"));
|
|
@@ -12162,7 +12167,7 @@ const GC = /* @__PURE__ */ ut(() => {
|
|
|
12162
12167
|
), o = jt("context");
|
|
12163
12168
|
return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...on(e, o) }) }) : null;
|
|
12164
12169
|
}), QC = ({ children: e }) => {
|
|
12165
|
-
const t = V.useContext(Kh), n =
|
|
12170
|
+
const t = V.useContext(Kh), n = Rn("itemDimensions"), r = Rn("viewportDimensions"), o = zr(
|
|
12166
12171
|
V.useMemo(
|
|
12167
12172
|
() => (s) => {
|
|
12168
12173
|
r(s.getBoundingClientRect());
|
|
@@ -12174,12 +12179,12 @@ const GC = /* @__PURE__ */ ut(() => {
|
|
|
12174
12179
|
);
|
|
12175
12180
|
return V.useEffect(() => {
|
|
12176
12181
|
t && (r({ height: t.viewportHeight, width: t.viewportWidth }), n({ height: t.itemHeight, width: t.itemWidth }));
|
|
12177
|
-
}, [t, r, n]), /* @__PURE__ */ u.jsx("div", { ref: o, style:
|
|
12182
|
+
}, [t, r, n]), /* @__PURE__ */ u.jsx("div", { ref: o, style: Ri(!1), children: e });
|
|
12178
12183
|
}, eT = ({ children: e }) => {
|
|
12179
|
-
const t = V.useContext(Kh), n =
|
|
12184
|
+
const t = V.useContext(Kh), n = Rn("windowViewportRect"), r = Rn("itemDimensions"), o = jt("customScrollParent"), s = Th(n, o, !1);
|
|
12180
12185
|
return V.useEffect(() => {
|
|
12181
12186
|
t && (r({ height: t.itemHeight, width: t.itemWidth }), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: t.viewportWidth }));
|
|
12182
|
-
}, [t, n, r]), /* @__PURE__ */ u.jsx("div", { ref: s, style:
|
|
12187
|
+
}, [t, n, r]), /* @__PURE__ */ u.jsx("div", { ref: s, style: Ri(!1), children: e });
|
|
12183
12188
|
}, tT = /* @__PURE__ */ V.memo(function({ ...e }) {
|
|
12184
12189
|
const t = jt("useWindowScroll"), n = jt("customScrollParent"), r = n || t ? rT : nT, o = n || t ? eT : QC, s = jt("context");
|
|
12185
12190
|
return /* @__PURE__ */ u.jsx(r, { ...e, ...on(r, s), children: /* @__PURE__ */ u.jsxs(o, { children: [
|
|
@@ -12190,7 +12195,7 @@ const GC = /* @__PURE__ */ ut(() => {
|
|
|
12190
12195
|
}), {
|
|
12191
12196
|
useEmitter: Qh,
|
|
12192
12197
|
useEmitterValue: jt,
|
|
12193
|
-
usePublisher:
|
|
12198
|
+
usePublisher: Rn
|
|
12194
12199
|
} = /* @__PURE__ */ Wh(
|
|
12195
12200
|
YC,
|
|
12196
12201
|
{
|
|
@@ -12232,7 +12237,7 @@ const GC = /* @__PURE__ */ ut(() => {
|
|
|
12232
12237
|
}
|
|
12233
12238
|
},
|
|
12234
12239
|
tT
|
|
12235
|
-
), nT = /* @__PURE__ */ Xh({ useEmitter: Qh, useEmitterValue: jt, usePublisher:
|
|
12240
|
+
), nT = /* @__PURE__ */ Xh({ useEmitter: Qh, useEmitterValue: jt, usePublisher: Rn }), rT = /* @__PURE__ */ Jh({ useEmitter: Qh, useEmitterValue: jt, usePublisher: Rn });
|
|
12236
12241
|
function _u(e, t, n) {
|
|
12237
12242
|
return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, xn.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
|
|
12238
12243
|
}
|
|
@@ -12276,7 +12281,7 @@ const ko = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
12276
12281
|
}
|
|
12277
12282
|
));
|
|
12278
12283
|
ko.displayName = "CardHeader";
|
|
12279
|
-
const
|
|
12284
|
+
const Eo = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
12280
12285
|
"h3",
|
|
12281
12286
|
{
|
|
12282
12287
|
ref: n,
|
|
@@ -12287,7 +12292,7 @@ const Ro = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
12287
12292
|
...t
|
|
12288
12293
|
}
|
|
12289
12294
|
));
|
|
12290
|
-
|
|
12295
|
+
Eo.displayName = "CardTitle";
|
|
12291
12296
|
const tp = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
12292
12297
|
"p",
|
|
12293
12298
|
{
|
|
@@ -12297,8 +12302,8 @@ const tp = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
12297
12302
|
}
|
|
12298
12303
|
));
|
|
12299
12304
|
tp.displayName = "CardDescription";
|
|
12300
|
-
const
|
|
12301
|
-
|
|
12305
|
+
const Ro = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx("div", { ref: n, className: oe("p-6 pt-0", e), ...t }));
|
|
12306
|
+
Ro.displayName = "CardContent";
|
|
12302
12307
|
const np = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
12303
12308
|
"div",
|
|
12304
12309
|
{
|
|
@@ -12516,7 +12521,7 @@ function Vs(e) {
|
|
|
12516
12521
|
}
|
|
12517
12522
|
return typeof e == "object" && !Array.isArray(e) && e.content !== void 0 ? Vs(e.content) : e;
|
|
12518
12523
|
}
|
|
12519
|
-
var Ii = "Dialog", [sp,
|
|
12524
|
+
var Ii = "Dialog", [sp, zE] = ar(Ii), [pT, Hn] = sp(Ii), ip = (e) => {
|
|
12520
12525
|
const {
|
|
12521
12526
|
__scopeDialog: t,
|
|
12522
12527
|
children: n,
|
|
@@ -12721,7 +12726,7 @@ yp.displayName = xp;
|
|
|
12721
12726
|
function Kl(e) {
|
|
12722
12727
|
return e ? "open" : "closed";
|
|
12723
12728
|
}
|
|
12724
|
-
var vp = "DialogTitleWarning", [
|
|
12729
|
+
var vp = "DialogTitleWarning", [BE, wp] = Tv(vp, {
|
|
12725
12730
|
contentName: Mr,
|
|
12726
12731
|
titleName: Vl,
|
|
12727
12732
|
docsSlug: "dialog"
|
|
@@ -12794,7 +12799,7 @@ const kp = v.forwardRef(({ className: e, children: t, ...n }, r) => {
|
|
|
12794
12799
|
] });
|
|
12795
12800
|
});
|
|
12796
12801
|
kp.displayName = Ai.displayName;
|
|
12797
|
-
const
|
|
12802
|
+
const Ep = ({
|
|
12798
12803
|
className: e,
|
|
12799
12804
|
...t
|
|
12800
12805
|
}) => /* @__PURE__ */ u.jsx(
|
|
@@ -12807,8 +12812,8 @@ const Rp = ({
|
|
|
12807
12812
|
...t
|
|
12808
12813
|
}
|
|
12809
12814
|
);
|
|
12810
|
-
|
|
12811
|
-
const
|
|
12815
|
+
Ep.displayName = "DialogHeader";
|
|
12816
|
+
const Rp = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
12812
12817
|
Nr,
|
|
12813
12818
|
{
|
|
12814
12819
|
ref: n,
|
|
@@ -12819,8 +12824,8 @@ const Ep = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
12819
12824
|
...t
|
|
12820
12825
|
}
|
|
12821
12826
|
));
|
|
12822
|
-
|
|
12823
|
-
const
|
|
12827
|
+
Rp.displayName = Nr.displayName;
|
|
12828
|
+
const ET = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
12824
12829
|
_i,
|
|
12825
12830
|
{
|
|
12826
12831
|
ref: n,
|
|
@@ -12828,8 +12833,8 @@ const RT = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
12828
12833
|
...t
|
|
12829
12834
|
}
|
|
12830
12835
|
));
|
|
12831
|
-
|
|
12832
|
-
function
|
|
12836
|
+
ET.displayName = _i.displayName;
|
|
12837
|
+
function RT({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
12833
12838
|
const [s, i] = we(!1), [a, l] = we(null), [c, d] = we(null), { toast: f } = Hl(), h = V.useCallback(async () => {
|
|
12834
12839
|
if (n) {
|
|
12835
12840
|
i(!0), d(null), l(null);
|
|
@@ -12894,11 +12899,11 @@ function ET({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
12894
12899
|
/* @__PURE__ */ u.jsx("p", { className: "text-sm text-muted-foreground", children: "This file type cannot be previewed. Use download or external view." })
|
|
12895
12900
|
] }) : /* @__PURE__ */ u.jsx("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ u.jsx("p", { className: "text-muted-foreground", children: "No content to display" }) }), x = () => o.startsWith("image/") ? /* @__PURE__ */ u.jsx(xg, { className: "h-5 w-5" }) : /* @__PURE__ */ u.jsx(ic, { className: "h-5 w-5" });
|
|
12896
12901
|
return /* @__PURE__ */ u.jsx(TT, { open: e, onOpenChange: t, children: /* @__PURE__ */ u.jsxs(kp, { className: "max-w-4xl max-h-[90vh] overflow-hidden", children: [
|
|
12897
|
-
/* @__PURE__ */ u.jsx(
|
|
12902
|
+
/* @__PURE__ */ u.jsx(Ep, { children: /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
12898
12903
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
12899
12904
|
x(),
|
|
12900
12905
|
/* @__PURE__ */ u.jsxs("div", { children: [
|
|
12901
|
-
/* @__PURE__ */ u.jsx(
|
|
12906
|
+
/* @__PURE__ */ u.jsx(Rp, { className: "text-left", children: r }),
|
|
12902
12907
|
/* @__PURE__ */ u.jsxs("p", { className: "text-sm text-muted-foreground mt-1", children: [
|
|
12903
12908
|
o,
|
|
12904
12909
|
" • Click download or external view for full access"
|
|
@@ -14677,7 +14682,7 @@ const Bu = V.memo(function({
|
|
|
14677
14682
|
[Q, t]
|
|
14678
14683
|
), ye = (y == null ? void 0 : y.id) ?? (y == null ? void 0 : y.interrupt_id), Pe = ps(ye), $e = y == null ? void 0 : y.value, ot = ct(() => Q ? "" : qT(t.content), [Q, t]), Ce = V.useCallback(async () => {
|
|
14679
14684
|
const G = ne ? ot : ie;
|
|
14680
|
-
async function
|
|
14685
|
+
async function Ee(ve) {
|
|
14681
14686
|
if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
|
|
14682
14687
|
await navigator.clipboard.writeText(ve);
|
|
14683
14688
|
return;
|
|
@@ -14694,30 +14699,30 @@ const Bu = V.memo(function({
|
|
|
14694
14699
|
throw new Error("Clipboard API not supported in this context.");
|
|
14695
14700
|
}
|
|
14696
14701
|
try {
|
|
14697
|
-
await
|
|
14702
|
+
await Ee(G), M(!0), setTimeout(() => M(!1), 2e3), x == null || x(G);
|
|
14698
14703
|
} catch (ve) {
|
|
14699
14704
|
console.error("Failed to copy:", ve);
|
|
14700
14705
|
}
|
|
14701
14706
|
}, [ne, ot, ie, x]), Xe = V.useCallback(() => {
|
|
14702
14707
|
if (!p) return;
|
|
14703
|
-
const G = ne ? ot : ie,
|
|
14708
|
+
const G = ne ? ot : ie, Ee = "type" in t && t.type === "default_message" ? void 0 : {
|
|
14704
14709
|
checkpointId: t.checkpointId ?? null,
|
|
14705
14710
|
checkpointNs: t.checkpointNs ?? null
|
|
14706
14711
|
};
|
|
14707
|
-
p(t.id, G,
|
|
14712
|
+
p(t.id, G, Ee);
|
|
14708
14713
|
}, [p, t.id, ne, ot, ie, t]), st = V.useCallback(() => {
|
|
14709
14714
|
m == null || m(n);
|
|
14710
14715
|
}, [m, n]), Qe = V.useCallback(() => {
|
|
14711
|
-
const
|
|
14716
|
+
const Ee = oe(F ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", q);
|
|
14712
14717
|
switch (L) {
|
|
14713
14718
|
case "user":
|
|
14714
|
-
return /* @__PURE__ */ u.jsx(vg, { className:
|
|
14719
|
+
return /* @__PURE__ */ u.jsx(vg, { className: Ee });
|
|
14715
14720
|
case "assistant":
|
|
14716
|
-
return /* @__PURE__ */ u.jsx(zi, { className:
|
|
14721
|
+
return /* @__PURE__ */ u.jsx(zi, { className: Ee });
|
|
14717
14722
|
case "tool":
|
|
14718
|
-
return /* @__PURE__ */ u.jsx(yg, { className:
|
|
14723
|
+
return /* @__PURE__ */ u.jsx(yg, { className: Ee });
|
|
14719
14724
|
default:
|
|
14720
|
-
return /* @__PURE__ */ u.jsx(zi, { className:
|
|
14725
|
+
return /* @__PURE__ */ u.jsx(zi, { className: Ee });
|
|
14721
14726
|
}
|
|
14722
14727
|
}, [F, q, L]), Je = V.useCallback(() => {
|
|
14723
14728
|
const G = "group relative mb-4 flex w-full";
|
|
@@ -14788,15 +14793,15 @@ const Bu = V.memo(function({
|
|
|
14788
14793
|
const et = V.useCallback(async (G) => {
|
|
14789
14794
|
if (w)
|
|
14790
14795
|
return;
|
|
14791
|
-
const
|
|
14796
|
+
const Ee = ps(
|
|
14792
14797
|
(G == null ? void 0 : G.id) ?? (G == null ? void 0 : G.interrupt_id)
|
|
14793
14798
|
);
|
|
14794
|
-
if (!
|
|
14799
|
+
if (!Ee) {
|
|
14795
14800
|
console.warn("Interrupt part missing id", G);
|
|
14796
14801
|
return;
|
|
14797
14802
|
}
|
|
14798
14803
|
try {
|
|
14799
|
-
S == null || S(), await W(
|
|
14804
|
+
S == null || S(), await W(Ee, !0);
|
|
14800
14805
|
} catch (ve) {
|
|
14801
14806
|
console.error("Failed to approve interrupt:", ve);
|
|
14802
14807
|
} finally {
|
|
@@ -14805,24 +14810,24 @@ const Bu = V.memo(function({
|
|
|
14805
14810
|
}, [w, T, S, W]), Mt = V.useCallback(async (G) => {
|
|
14806
14811
|
if (w)
|
|
14807
14812
|
return;
|
|
14808
|
-
const
|
|
14813
|
+
const Ee = ps(
|
|
14809
14814
|
(G == null ? void 0 : G.id) ?? (G == null ? void 0 : G.interrupt_id)
|
|
14810
14815
|
);
|
|
14811
|
-
if (!
|
|
14816
|
+
if (!Ee) {
|
|
14812
14817
|
console.warn("Interrupt part missing id", G);
|
|
14813
14818
|
return;
|
|
14814
14819
|
}
|
|
14815
14820
|
try {
|
|
14816
|
-
S == null || S(), await W(
|
|
14821
|
+
S == null || S(), await W(Ee, !1);
|
|
14817
14822
|
} catch (ve) {
|
|
14818
14823
|
console.error("Failed to reject interrupt:", ve);
|
|
14819
14824
|
} finally {
|
|
14820
14825
|
T == null || T();
|
|
14821
14826
|
}
|
|
14822
|
-
}, [w, T, S, W]), kt = V.useCallback(({ part: G, i:
|
|
14827
|
+
}, [w, T, S, W]), kt = V.useCallback(({ part: G, i: Ee }) => {
|
|
14823
14828
|
if (G.type === "text") {
|
|
14824
14829
|
const ve = G.text ?? "", gt = ve.trim(), xt = Ul(gt);
|
|
14825
|
-
return xt && L !== "tool" ? /* @__PURE__ */ u.jsx(Dp, { data: xt },
|
|
14830
|
+
return xt && L !== "tool" ? /* @__PURE__ */ u.jsx(Dp, { data: xt }, Ee) : L === "user" && c && gt.length > d ? /* @__PURE__ */ u.jsx(
|
|
14826
14831
|
ZT,
|
|
14827
14832
|
{
|
|
14828
14833
|
text: gt,
|
|
@@ -14831,8 +14836,8 @@ const Bu = V.memo(function({
|
|
|
14831
14836
|
previewLength: d,
|
|
14832
14837
|
isCompact: F
|
|
14833
14838
|
},
|
|
14834
|
-
|
|
14835
|
-
) : /* @__PURE__ */ u.jsx(Ys, { content: ve, allowHtml: !1 },
|
|
14839
|
+
Ee
|
|
14840
|
+
) : /* @__PURE__ */ u.jsx(Ys, { content: ve, allowHtml: !1 }, Ee);
|
|
14836
14841
|
}
|
|
14837
14842
|
if (G.type === "image_url") {
|
|
14838
14843
|
const ve = G;
|
|
@@ -14844,7 +14849,7 @@ const Bu = V.memo(function({
|
|
|
14844
14849
|
loading: "lazy",
|
|
14845
14850
|
className: "border rounded max-h-[420px] w-auto object-contain"
|
|
14846
14851
|
}
|
|
14847
|
-
) },
|
|
14852
|
+
) }, Ee);
|
|
14848
14853
|
}
|
|
14849
14854
|
if (G.type === "file") {
|
|
14850
14855
|
const ve = G, gt = ve.name || "file";
|
|
@@ -14852,18 +14857,18 @@ const Bu = V.memo(function({
|
|
|
14852
14857
|
"a",
|
|
14853
14858
|
{
|
|
14854
14859
|
href: ve.url,
|
|
14855
|
-
onClick: (xt) => ue(xt, ve,
|
|
14860
|
+
onClick: (xt) => ue(xt, ve, Ee),
|
|
14856
14861
|
className: `inline-flex items-center gap-2 rounded px-2 py-1 text-xs bg-gray-100 border hover:bg-gray-200
|
|
14857
14862
|
dark:bg-background/10 dark:border-border/30 dark:hover:bg-background/20`,
|
|
14858
14863
|
children: [
|
|
14859
|
-
J[
|
|
14864
|
+
J[Ee] ? /* @__PURE__ */ u.jsx(el, { className: "h-4 w-4 animate-spin" }) : null,
|
|
14860
14865
|
/* @__PURE__ */ u.jsxs("span", { className: "truncate max-w-[180px]", children: [
|
|
14861
14866
|
gt,
|
|
14862
|
-
J[
|
|
14867
|
+
J[Ee] ? " (processing)" : ""
|
|
14863
14868
|
] })
|
|
14864
14869
|
]
|
|
14865
14870
|
},
|
|
14866
|
-
|
|
14871
|
+
Ee
|
|
14867
14872
|
);
|
|
14868
14873
|
}
|
|
14869
14874
|
if (G.type === "interrupt") {
|
|
@@ -14880,7 +14885,7 @@ const Bu = V.memo(function({
|
|
|
14880
14885
|
isActive: xt,
|
|
14881
14886
|
payload: dt
|
|
14882
14887
|
},
|
|
14883
|
-
|
|
14888
|
+
Ee
|
|
14884
14889
|
);
|
|
14885
14890
|
}
|
|
14886
14891
|
return null;
|
|
@@ -14918,7 +14923,7 @@ const Bu = V.memo(function({
|
|
|
14918
14923
|
t.id
|
|
14919
14924
|
);
|
|
14920
14925
|
if (!ne && !Q) {
|
|
14921
|
-
const
|
|
14926
|
+
const Ee = t, ve = /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: Ee.content.map((gt, xt) => /* @__PURE__ */ u.jsx(kt, { part: gt, i: xt }, xt)) });
|
|
14922
14927
|
return r ? /* @__PURE__ */ u.jsxs("div", { "aria-busy": "true", role: "status", children: [
|
|
14923
14928
|
ve,
|
|
14924
14929
|
/* @__PURE__ */ u.jsx(YT, { className: q })
|
|
@@ -14936,18 +14941,18 @@ const Bu = V.memo(function({
|
|
|
14936
14941
|
q
|
|
14937
14942
|
]), At = ct(() => Q ? "Assistant" : GT(t), [Q, t]), it = V.useMemo(() => Q ? [] : Array.isArray(C) ? C : [], [C, Q]), Yt = V.useMemo(() => {
|
|
14938
14943
|
var G;
|
|
14939
|
-
return it.length ? A && it.some((
|
|
14944
|
+
return it.length ? A && it.some((Ee) => Ee.id === A) ? A : ((G = it[0]) == null ? void 0 : G.id) ?? null : null;
|
|
14940
14945
|
}, [A, it]), Jt = V.useMemo(() => !it.length || !b ? null : it.some((G) => G.id === b) ? b : null, [b, it]) ?? Yt, Zt = L === "user" && it.length > 0 && typeof k == "function", ft = V.useCallback(
|
|
14941
14946
|
(G) => {
|
|
14942
14947
|
if (!k) return;
|
|
14943
|
-
const
|
|
14944
|
-
k(
|
|
14948
|
+
const Ee = (G == null ? void 0 : G.id) ?? null, ve = (G == null ? void 0 : G.parentId) ?? N ?? null;
|
|
14949
|
+
k(Ee, ve);
|
|
14945
14950
|
},
|
|
14946
14951
|
[N, k]
|
|
14947
14952
|
), Ve = V.useMemo(() => Jt ? it.findIndex((G) => G.id === Jt) : -1, [Jt, it]), Dt = V.useMemo(() => Ve < 0 ? null : it[Ve] ?? null, [Ve, it]), Pt = V.useCallback((G) => {
|
|
14948
|
-
const
|
|
14949
|
-
if (G.step !== null &&
|
|
14950
|
-
return
|
|
14953
|
+
const Ee = [];
|
|
14954
|
+
if (G.step !== null && Ee.push(`Step ${G.step}`), G.source && Ee.push(G.source), !G.createdAt)
|
|
14955
|
+
return Ee.length ? Ee.join(" • ") : G.id.slice(0, 8);
|
|
14951
14956
|
let ve = "";
|
|
14952
14957
|
try {
|
|
14953
14958
|
const gt = new Date(G.createdAt);
|
|
@@ -14990,7 +14995,7 @@ const Bu = V.memo(function({
|
|
|
14990
14995
|
"aria-expanded": $ === "expanded",
|
|
14991
14996
|
onClick: () => z((G) => G === "expanded" ? "preview" : "expanded"),
|
|
14992
14997
|
onKeyDown: (G) => {
|
|
14993
|
-
(G.key === "Enter" || G.key === " ") && (G.preventDefault(), z((
|
|
14998
|
+
(G.key === "Enter" || G.key === " ") && (G.preventDefault(), z((Ee) => Ee === "expanded" ? "preview" : "expanded"));
|
|
14994
14999
|
},
|
|
14995
15000
|
children: [
|
|
14996
15001
|
/* @__PURE__ */ u.jsx("span", { children: ce.name ?? "Tool Output" }),
|
|
@@ -15161,7 +15166,7 @@ const Bu = V.memo(function({
|
|
|
15161
15166
|
)
|
|
15162
15167
|
] }) }),
|
|
15163
15168
|
ee && /* @__PURE__ */ u.jsx(
|
|
15164
|
-
|
|
15169
|
+
RT,
|
|
15165
15170
|
{
|
|
15166
15171
|
isOpen: ke,
|
|
15167
15172
|
onClose: D,
|
|
@@ -15216,10 +15221,10 @@ function XT({
|
|
|
15216
15221
|
),
|
|
15217
15222
|
children: [
|
|
15218
15223
|
/* @__PURE__ */ u.jsxs(ko, { className: "pb-3", children: [
|
|
15219
|
-
/* @__PURE__ */ u.jsx(
|
|
15224
|
+
/* @__PURE__ */ u.jsx(Eo, { className: "text-blue-900 dark:text-blue-100 text-base", children: i }),
|
|
15220
15225
|
/* @__PURE__ */ u.jsx(tp, { className: "text-blue-700 dark:text-blue-300 text-sm", children: l })
|
|
15221
15226
|
] }),
|
|
15222
|
-
a && /* @__PURE__ */ u.jsx(
|
|
15227
|
+
a && /* @__PURE__ */ u.jsx(Ro, { className: "pt-0 pb-3", children: a }),
|
|
15223
15228
|
/* @__PURE__ */ u.jsx(np, { className: "pt-0", children: /* @__PURE__ */ u.jsxs("div", { className: "flex gap-2 ml-auto", children: [
|
|
15224
15229
|
/* @__PURE__ */ u.jsx(
|
|
15225
15230
|
pt,
|
|
@@ -15436,7 +15441,7 @@ const Hu = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, ek = (e) =>
|
|
|
15436
15441
|
onSelectCheckpoint: _,
|
|
15437
15442
|
timelineCheckpoints: M
|
|
15438
15443
|
}, $) => {
|
|
15439
|
-
const z =
|
|
15444
|
+
const z = Re(null), P = Re(null), B = Re(!1), [j, W] = we(!0), F = ct(() => w ? e.some((re) => "type" in re && re.type === "default_message" ? !1 : Array.isArray(re == null ? void 0 : re.content) && re.content.some(
|
|
15440
15445
|
(ye) => ye && ye.type === "interrupt" && (ye.id ?? ye.interrupt_id) === w.id
|
|
15441
15446
|
)) : !1, [w, e]), L = ct(() => {
|
|
15442
15447
|
if (!w || F)
|
|
@@ -15718,9 +15723,9 @@ function ga({
|
|
|
15718
15723
|
J(!0);
|
|
15719
15724
|
}, []), ke = de(() => {
|
|
15720
15725
|
J(!1);
|
|
15721
|
-
}, []), ee = !!ge || _e, [D, q] = we(null), [ie, ce] = we(""), [H, We] = we(null), [re, ye] = we(null), [Pe, $e] = we([]), [ot, Ce] = we(0), [Xe, st] = we(0), [Qe, Je] = we(!1), [qe, et] = we(null), [Mt, kt] = we(null), [tt, vt] = we(!1), [At, it] = we(null), [Yt, Xt] = we(!1), Jt =
|
|
15726
|
+
}, []), ee = !!ge || _e, [D, q] = we(null), [ie, ce] = we(""), [H, We] = we(null), [re, ye] = we(null), [Pe, $e] = we([]), [ot, Ce] = we(0), [Xe, st] = we(0), [Qe, Je] = we(!1), [qe, et] = we(null), [Mt, kt] = we(null), [tt, vt] = we(!1), [At, it] = we(null), [Yt, Xt] = we(!1), Jt = Re(!1), [Zt, ft] = we(() => Uu.value), Ve = Re(Zt), Dt = Re(null), Pt = de((Z) => {
|
|
15722
15727
|
Uu.value = Z, ft(Z);
|
|
15723
|
-
}, []), [G,
|
|
15728
|
+
}, []), [G, Ee] = we(!1), ve = Re(null), gt = de((Z) => {
|
|
15724
15729
|
if (!Array.isArray(Z))
|
|
15725
15730
|
return { text: null, messageId: null };
|
|
15726
15731
|
for (let se = Z.length - 1; se >= 0; se--) {
|
|
@@ -15842,14 +15847,14 @@ function ga({
|
|
|
15842
15847
|
at && !Ie.has(at.id) && (fe.push(at), Ie.add(at.id));
|
|
15843
15848
|
}
|
|
15844
15849
|
return fe;
|
|
15845
|
-
}, [Me, gt, xt, dt]), jn =
|
|
15850
|
+
}, [Me, gt, xt, dt]), jn = Re(null), Lt = Re(null), un = de(() => {
|
|
15846
15851
|
jn.current && (jn.current.value = ""), Lt.current && (Lt.current.value = ""), Ce((Z) => Z + 1), st((Z) => Z + 1);
|
|
15847
15852
|
}, []), Ur = de(
|
|
15848
15853
|
(Z) => {
|
|
15849
15854
|
Pt(Z);
|
|
15850
15855
|
},
|
|
15851
15856
|
[Pt]
|
|
15852
|
-
), Wr =
|
|
15857
|
+
), Wr = Re(!1);
|
|
15853
15858
|
St(() => {
|
|
15854
15859
|
Wr.current && !z && ($e([]), un()), Wr.current = z;
|
|
15855
15860
|
}, [z, un]);
|
|
@@ -15871,7 +15876,7 @@ function ga({
|
|
|
15871
15876
|
}
|
|
15872
15877
|
Dt.current === null && (Dt.current = Ve.current), Pt(ie ?? "");
|
|
15873
15878
|
}, [ie, D, Pt]);
|
|
15874
|
-
const
|
|
15879
|
+
const R = de(async () => {
|
|
15875
15880
|
if (!(!S || T || !Yt))
|
|
15876
15881
|
try {
|
|
15877
15882
|
await b();
|
|
@@ -15896,8 +15901,8 @@ function ga({
|
|
|
15896
15901
|
P && !tt && (m == null || m(P));
|
|
15897
15902
|
}, [P, tt, m]);
|
|
15898
15903
|
const Y = (Z) => {
|
|
15899
|
-
if (Z.length >
|
|
15900
|
-
return `Message too long (${Z.length}/${
|
|
15904
|
+
if (Z.length > Es)
|
|
15905
|
+
return `Message too long (${Z.length}/${Es} characters)`;
|
|
15901
15906
|
try {
|
|
15902
15907
|
return jS(Z), null;
|
|
15903
15908
|
} catch (se) {
|
|
@@ -15999,9 +16004,9 @@ function ga({
|
|
|
15999
16004
|
Je(!1), Z.target.value = "", un();
|
|
16000
16005
|
}
|
|
16001
16006
|
}
|
|
16002
|
-
},
|
|
16007
|
+
}, Et = async (Z) => {
|
|
16003
16008
|
if (x) {
|
|
16004
|
-
|
|
16009
|
+
Ee(!0);
|
|
16005
16010
|
try {
|
|
16006
16011
|
if (!Z) {
|
|
16007
16012
|
await A(), Xt(!1), requestAnimationFrame(() => {
|
|
@@ -16016,14 +16021,14 @@ function ga({
|
|
|
16016
16021
|
(Ie = ve.current) == null || Ie.scrollToTop();
|
|
16017
16022
|
});
|
|
16018
16023
|
} finally {
|
|
16019
|
-
|
|
16024
|
+
Ee(!1);
|
|
16020
16025
|
}
|
|
16021
16026
|
}
|
|
16022
16027
|
}, Qt = de(
|
|
16023
16028
|
async (Z) => {
|
|
16024
|
-
await
|
|
16029
|
+
await Et(Z);
|
|
16025
16030
|
},
|
|
16026
|
-
[
|
|
16031
|
+
[Et]
|
|
16027
16032
|
), Pn = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${f.container || ""}`, dn = `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 || ""}`, Ht = `flex-shrink-0 w-full border-t p-4 bg-transparent ${f.inputArea || ""}`, On = de(
|
|
16028
16033
|
(Z) => {
|
|
16029
16034
|
if (!Z)
|
|
@@ -16059,7 +16064,7 @@ function ga({
|
|
|
16059
16064
|
value: L ?? "",
|
|
16060
16065
|
onChange: (Z) => {
|
|
16061
16066
|
const se = Z.target.value || null;
|
|
16062
|
-
|
|
16067
|
+
Et(se);
|
|
16063
16068
|
},
|
|
16064
16069
|
children: [
|
|
16065
16070
|
/* @__PURE__ */ u.jsx("option", { value: "", children: "Latest" }),
|
|
@@ -16092,7 +16097,7 @@ function ga({
|
|
|
16092
16097
|
enableMessageEditing: c,
|
|
16093
16098
|
editingMessageId: D,
|
|
16094
16099
|
onStartReached: () => {
|
|
16095
|
-
Yt &&
|
|
16100
|
+
Yt && R();
|
|
16096
16101
|
},
|
|
16097
16102
|
onScrollAway: (Z) => {
|
|
16098
16103
|
if (!Jt.current) {
|
|
@@ -16245,7 +16250,7 @@ function ga({
|
|
|
16245
16250
|
placeholder: D ? "Edit your message..." : t,
|
|
16246
16251
|
isStreaming: z,
|
|
16247
16252
|
disabled: ee,
|
|
16248
|
-
maxLength:
|
|
16253
|
+
maxLength: Es,
|
|
16249
16254
|
onSend: ae,
|
|
16250
16255
|
onCancelEdit: Ye,
|
|
16251
16256
|
onStop: W,
|
|
@@ -16278,7 +16283,7 @@ function Va(e, [t, n]) {
|
|
|
16278
16283
|
function tk(e, t) {
|
|
16279
16284
|
return v.useReducer((n, r) => t[n][r] ?? n, e);
|
|
16280
16285
|
}
|
|
16281
|
-
var Yl = "ScrollArea", [Fp,
|
|
16286
|
+
var Yl = "ScrollArea", [Fp, HE] = ar(Yl), [nk, _n] = Fp(Yl), $p = v.forwardRef(
|
|
16282
16287
|
(e, t) => {
|
|
16283
16288
|
const {
|
|
16284
16289
|
__scopeScrollArea: n,
|
|
@@ -16835,7 +16840,7 @@ function Ku({
|
|
|
16835
16840
|
currentThreadId: h,
|
|
16836
16841
|
isLoading: p,
|
|
16837
16842
|
actions: m
|
|
16838
|
-
} = cl(), { loadThread: g } = ul(), { createThread: x, deleteThread: y, renameThread: w } = m, [S, T] = we(Array.isArray(f) ? f : []), C =
|
|
16843
|
+
} = cl(), { loadThread: g } = ul(), { createThread: x, deleteThread: y, renameThread: w } = m, [S, T] = we(Array.isArray(f) ? f : []), C = Re(S.length > 0), b = Re(null), k = Re(0), [A, N] = we(null), [_, M] = we(""), [$, z] = we(!1);
|
|
16839
16844
|
St(() => {
|
|
16840
16845
|
const J = Array.isArray(f) ? f : [];
|
|
16841
16846
|
if (J.length > 0) {
|
|
@@ -16950,7 +16955,7 @@ function Ku({
|
|
|
16950
16955
|
] }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
16951
16956
|
/* @__PURE__ */ u.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: _e(J) }),
|
|
16952
16957
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
|
|
16953
|
-
/* @__PURE__ */ u.jsx(
|
|
16958
|
+
/* @__PURE__ */ u.jsx(Eg, { size: 10 }),
|
|
16954
16959
|
/* @__PURE__ */ u.jsx("span", { children: Q(J.updatedAt || J.createdAt) })
|
|
16955
16960
|
] })
|
|
16956
16961
|
] }) }),
|
|
@@ -16964,7 +16969,7 @@ function Ku({
|
|
|
16964
16969
|
onClick: (ue) => j(J.threadId, ue),
|
|
16965
16970
|
className: "h-6 w-6 p-0 text-red-400 hover:text-red-300 hover:bg-red-900/20",
|
|
16966
16971
|
title: "Delete thread",
|
|
16967
|
-
children: /* @__PURE__ */ u.jsx(
|
|
16972
|
+
children: /* @__PURE__ */ u.jsx(Rg, { size: 12 })
|
|
16968
16973
|
}
|
|
16969
16974
|
)
|
|
16970
16975
|
] })
|
|
@@ -17059,7 +17064,7 @@ function yk(e) {
|
|
|
17059
17064
|
console.error("Failed to save settings:", t);
|
|
17060
17065
|
}
|
|
17061
17066
|
}
|
|
17062
|
-
function
|
|
17067
|
+
function UE() {
|
|
17063
17068
|
const e = gk(), t = xk(), n = _r.getAuthToken(), r = typeof t.apiBaseUrl == "string" ? t.apiBaseUrl : void 0;
|
|
17064
17069
|
return {
|
|
17065
17070
|
...e,
|
|
@@ -17074,7 +17079,7 @@ function UR() {
|
|
|
17074
17079
|
)
|
|
17075
17080
|
};
|
|
17076
17081
|
}
|
|
17077
|
-
function
|
|
17082
|
+
function WE(e) {
|
|
17078
17083
|
_r.updateConfig({
|
|
17079
17084
|
baseUrl: e.apiBaseUrl,
|
|
17080
17085
|
authToken: e.apiKey ?? void 0
|
|
@@ -17108,7 +17113,7 @@ function sm(e) {
|
|
|
17108
17113
|
const t = v.useRef({ value: e, previous: e });
|
|
17109
17114
|
return v.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
|
|
17110
17115
|
}
|
|
17111
|
-
var Oi = "Switch", [bk,
|
|
17116
|
+
var Oi = "Switch", [bk, VE] = ar(Oi), [Sk, Ck] = bk(Oi), im = v.forwardRef(
|
|
17112
17117
|
(e, t) => {
|
|
17113
17118
|
const {
|
|
17114
17119
|
__scopeSwitch: n,
|
|
@@ -17257,7 +17262,7 @@ var fm = Object.freeze({
|
|
|
17257
17262
|
clip: "rect(0, 0, 0, 0)",
|
|
17258
17263
|
whiteSpace: "nowrap",
|
|
17259
17264
|
wordWrap: "normal"
|
|
17260
|
-
}),
|
|
17265
|
+
}), Ek = "VisuallyHidden", Rk = v.forwardRef(
|
|
17261
17266
|
(e, t) => /* @__PURE__ */ u.jsx(
|
|
17262
17267
|
Fe.span,
|
|
17263
17268
|
{
|
|
@@ -17267,8 +17272,8 @@ var fm = Object.freeze({
|
|
|
17267
17272
|
}
|
|
17268
17273
|
)
|
|
17269
17274
|
);
|
|
17270
|
-
|
|
17271
|
-
var Ik = [" ", "Enter", "ArrowUp", "ArrowDown"], Nk = [" ", "Enter"], Dr = "Select", [Mi, Di, Ak] = fl(Dr), [ho,
|
|
17275
|
+
Rk.displayName = Ek;
|
|
17276
|
+
var Ik = [" ", "Enter", "ArrowUp", "ArrowDown"], Nk = [" ", "Enter"], Dr = "Select", [Mi, Di, Ak] = fl(Dr), [ho, KE] = ar(Dr, [
|
|
17272
17277
|
Ak,
|
|
17273
17278
|
gi
|
|
17274
17279
|
]), Li = gi(), [_k, vr] = ho(Dr), [jk, Pk] = ho(Dr), hm = (e) => {
|
|
@@ -17809,13 +17814,13 @@ var km = "SelectGroup", [Bk, Hk] = ho(km), Uk = v.forwardRef(
|
|
|
17809
17814
|
}
|
|
17810
17815
|
);
|
|
17811
17816
|
Uk.displayName = km;
|
|
17812
|
-
var
|
|
17817
|
+
var Em = "SelectLabel", Rm = v.forwardRef(
|
|
17813
17818
|
(e, t) => {
|
|
17814
|
-
const { __scopeSelect: n, ...r } = e, o = Hk(
|
|
17819
|
+
const { __scopeSelect: n, ...r } = e, o = Hk(Em, n);
|
|
17815
17820
|
return /* @__PURE__ */ u.jsx(Fe.div, { id: o.id, ...r, ref: t });
|
|
17816
17821
|
}
|
|
17817
17822
|
);
|
|
17818
|
-
|
|
17823
|
+
Rm.displayName = Em;
|
|
17819
17824
|
var Qs = "SelectItem", [Wk, Im] = ho(Qs), Nm = v.forwardRef(
|
|
17820
17825
|
(e, t) => {
|
|
17821
17826
|
const {
|
|
@@ -18072,7 +18077,7 @@ function zm(e, t, n) {
|
|
|
18072
18077
|
function Gk(e, t) {
|
|
18073
18078
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
18074
18079
|
}
|
|
18075
|
-
var Yk = hm, Bm = mm, Xk = xm, Jk = ym, Zk = vm, Hm = wm, Qk = Tm, Um =
|
|
18080
|
+
var Yk = hm, Bm = mm, Xk = xm, Jk = ym, Zk = vm, Hm = wm, Qk = Tm, Um = Rm, Wm = Nm, eE = Am, tE = jm, Vm = Pm, Km = Om, qm = Dm;
|
|
18076
18081
|
const qu = Yk, Gu = Xk, Ja = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ u.jsxs(
|
|
18077
18082
|
Bm,
|
|
18078
18083
|
{
|
|
@@ -18143,7 +18148,7 @@ const Za = v.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
18143
18148
|
}
|
|
18144
18149
|
) }));
|
|
18145
18150
|
Za.displayName = Hm.displayName;
|
|
18146
|
-
const
|
|
18151
|
+
const nE = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
18147
18152
|
Um,
|
|
18148
18153
|
{
|
|
18149
18154
|
ref: n,
|
|
@@ -18151,7 +18156,7 @@ const nR = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
18151
18156
|
...t
|
|
18152
18157
|
}
|
|
18153
18158
|
));
|
|
18154
|
-
|
|
18159
|
+
nE.displayName = Um.displayName;
|
|
18155
18160
|
const kr = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ u.jsxs(
|
|
18156
18161
|
Wm,
|
|
18157
18162
|
{
|
|
@@ -18162,13 +18167,13 @@ const kr = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
18162
18167
|
),
|
|
18163
18168
|
...n,
|
|
18164
18169
|
children: [
|
|
18165
|
-
/* @__PURE__ */ u.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ u.jsx(
|
|
18166
|
-
/* @__PURE__ */ u.jsx(
|
|
18170
|
+
/* @__PURE__ */ u.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ u.jsx(tE, { children: /* @__PURE__ */ u.jsx(Qa, { className: "h-4 w-4" }) }) }),
|
|
18171
|
+
/* @__PURE__ */ u.jsx(eE, { children: t })
|
|
18167
18172
|
]
|
|
18168
18173
|
}
|
|
18169
18174
|
));
|
|
18170
18175
|
kr.displayName = Wm.displayName;
|
|
18171
|
-
const
|
|
18176
|
+
const rE = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
18172
18177
|
qm,
|
|
18173
18178
|
{
|
|
18174
18179
|
ref: n,
|
|
@@ -18176,9 +18181,9 @@ const rR = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
18176
18181
|
...t
|
|
18177
18182
|
}
|
|
18178
18183
|
));
|
|
18179
|
-
|
|
18180
|
-
var
|
|
18181
|
-
const { decorative: n, orientation: r = Yu, ...o } = e, s =
|
|
18184
|
+
rE.displayName = qm.displayName;
|
|
18185
|
+
var oE = "Separator", Yu = "horizontal", sE = ["horizontal", "vertical"], Xm = v.forwardRef((e, t) => {
|
|
18186
|
+
const { decorative: n, orientation: r = Yu, ...o } = e, s = iE(r) ? r : Yu, a = n ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
|
|
18182
18187
|
return /* @__PURE__ */ u.jsx(
|
|
18183
18188
|
Fe.div,
|
|
18184
18189
|
{
|
|
@@ -18189,9 +18194,9 @@ var oR = "Separator", Yu = "horizontal", sR = ["horizontal", "vertical"], Xm = v
|
|
|
18189
18194
|
}
|
|
18190
18195
|
);
|
|
18191
18196
|
});
|
|
18192
|
-
Xm.displayName =
|
|
18193
|
-
function
|
|
18194
|
-
return
|
|
18197
|
+
Xm.displayName = oE;
|
|
18198
|
+
function iE(e) {
|
|
18199
|
+
return sE.includes(e);
|
|
18195
18200
|
}
|
|
18196
18201
|
var Jm = Xm;
|
|
18197
18202
|
const Zm = v.forwardRef(
|
|
@@ -18211,7 +18216,7 @@ const Zm = v.forwardRef(
|
|
|
18211
18216
|
)
|
|
18212
18217
|
);
|
|
18213
18218
|
Zm.displayName = Jm.displayName;
|
|
18214
|
-
const
|
|
18219
|
+
const aE = bp, lE = CT, cE = Sp, Qm = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
18215
18220
|
Ni,
|
|
18216
18221
|
{
|
|
18217
18222
|
className: oe(
|
|
@@ -18223,7 +18228,7 @@ const aR = bp, lR = CT, cR = Sp, Qm = v.forwardRef(({ className: e, ...t }, n) =
|
|
|
18223
18228
|
}
|
|
18224
18229
|
));
|
|
18225
18230
|
Qm.displayName = Ni.displayName;
|
|
18226
|
-
const
|
|
18231
|
+
const uE = ni(
|
|
18227
18232
|
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
18228
18233
|
{
|
|
18229
18234
|
variants: {
|
|
@@ -18238,13 +18243,13 @@ const uR = ni(
|
|
|
18238
18243
|
side: "right"
|
|
18239
18244
|
}
|
|
18240
18245
|
}
|
|
18241
|
-
), eg = v.forwardRef(({ side: e = "right", className: t, children: n, ...r }, o) => /* @__PURE__ */ u.jsxs(
|
|
18246
|
+
), eg = v.forwardRef(({ side: e = "right", className: t, children: n, ...r }, o) => /* @__PURE__ */ u.jsxs(cE, { children: [
|
|
18242
18247
|
/* @__PURE__ */ u.jsx(Qm, {}),
|
|
18243
18248
|
/* @__PURE__ */ u.jsxs(
|
|
18244
18249
|
Ai,
|
|
18245
18250
|
{
|
|
18246
18251
|
ref: o,
|
|
18247
|
-
className: oe(
|
|
18252
|
+
className: oe(uE({ side: e }), t),
|
|
18248
18253
|
...r,
|
|
18249
18254
|
children: [
|
|
18250
18255
|
n,
|
|
@@ -18289,7 +18294,7 @@ const rg = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
18289
18294
|
}
|
|
18290
18295
|
));
|
|
18291
18296
|
rg.displayName = _i.displayName;
|
|
18292
|
-
const
|
|
18297
|
+
const dE = {
|
|
18293
18298
|
api: {
|
|
18294
18299
|
baseUrl: "http://localhost:8000/api",
|
|
18295
18300
|
authToken: "",
|
|
@@ -18308,7 +18313,7 @@ const dR = {
|
|
|
18308
18313
|
showTypingIndicator: !0
|
|
18309
18314
|
}
|
|
18310
18315
|
};
|
|
18311
|
-
function
|
|
18316
|
+
function qE({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
18312
18317
|
const [r, o] = we(!1), [s, i] = we(!1), [a, l] = we(e), [c, d] = we(!1), { toast: f } = Hl();
|
|
18313
18318
|
St(() => {
|
|
18314
18319
|
const x = JSON.stringify(a) !== JSON.stringify(e);
|
|
@@ -18322,7 +18327,7 @@ function qR({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
18322
18327
|
description: "Your chat configuration has been updated successfully."
|
|
18323
18328
|
});
|
|
18324
18329
|
}, p = () => {
|
|
18325
|
-
l(
|
|
18330
|
+
l(dE), d(!0), f({
|
|
18326
18331
|
title: "Settings reset",
|
|
18327
18332
|
description: "Configuration has been reset to defaults."
|
|
18328
18333
|
});
|
|
@@ -18343,8 +18348,8 @@ function qR({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
18343
18348
|
});
|
|
18344
18349
|
}
|
|
18345
18350
|
};
|
|
18346
|
-
return /* @__PURE__ */ u.jsxs(
|
|
18347
|
-
/* @__PURE__ */ u.jsx(
|
|
18351
|
+
return /* @__PURE__ */ u.jsxs(aE, { open: r, onOpenChange: o, children: [
|
|
18352
|
+
/* @__PURE__ */ u.jsx(lE, { asChild: !0, children: /* @__PURE__ */ u.jsxs(pt, { variant: "outline", size: "sm", className: n, children: [
|
|
18348
18353
|
/* @__PURE__ */ u.jsx(Ig, { className: "h-4 w-4 mr-2" }),
|
|
18349
18354
|
"Settings",
|
|
18350
18355
|
c && /* @__PURE__ */ u.jsx(ep, { variant: "destructive", className: "ml-2 h-4 w-4 p-0" })
|
|
@@ -18356,11 +18361,11 @@ function qR({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
18356
18361
|
] }),
|
|
18357
18362
|
/* @__PURE__ */ u.jsxs("div", { className: "space-y-6 py-6", children: [
|
|
18358
18363
|
/* @__PURE__ */ u.jsxs(To, { children: [
|
|
18359
|
-
/* @__PURE__ */ u.jsx(ko, { className: "pb-3", children: /* @__PURE__ */ u.jsxs(
|
|
18364
|
+
/* @__PURE__ */ u.jsx(ko, { className: "pb-3", children: /* @__PURE__ */ u.jsxs(Eo, { className: "text-lg flex items-center gap-2", children: [
|
|
18360
18365
|
/* @__PURE__ */ u.jsx(Ng, { className: "h-5 w-5" }),
|
|
18361
18366
|
"API Configuration"
|
|
18362
18367
|
] }) }),
|
|
18363
|
-
/* @__PURE__ */ u.jsxs(
|
|
18368
|
+
/* @__PURE__ */ u.jsxs(Ro, { className: "space-y-4", children: [
|
|
18364
18369
|
/* @__PURE__ */ u.jsxs("div", { className: "space-y-2", children: [
|
|
18365
18370
|
/* @__PURE__ */ u.jsx(kn, { htmlFor: "api-url", children: "API Base URL" }),
|
|
18366
18371
|
/* @__PURE__ */ u.jsxs("div", { className: "flex gap-2", children: [
|
|
@@ -18423,11 +18428,11 @@ function qR({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
18423
18428
|
] })
|
|
18424
18429
|
] }),
|
|
18425
18430
|
/* @__PURE__ */ u.jsxs(To, { children: [
|
|
18426
|
-
/* @__PURE__ */ u.jsx(ko, { className: "pb-3", children: /* @__PURE__ */ u.jsxs(
|
|
18431
|
+
/* @__PURE__ */ u.jsx(ko, { className: "pb-3", children: /* @__PURE__ */ u.jsxs(Eo, { className: "text-lg flex items-center gap-2", children: [
|
|
18427
18432
|
/* @__PURE__ */ u.jsx(jg, { className: "h-5 w-5" }),
|
|
18428
18433
|
"Interface Settings"
|
|
18429
18434
|
] }) }),
|
|
18430
|
-
/* @__PURE__ */ u.jsxs(
|
|
18435
|
+
/* @__PURE__ */ u.jsxs(Ro, { className: "space-y-4", children: [
|
|
18431
18436
|
/* @__PURE__ */ u.jsxs("div", { className: "space-y-2", children: [
|
|
18432
18437
|
/* @__PURE__ */ u.jsx(kn, { htmlFor: "layout", children: "Layout Style" }),
|
|
18433
18438
|
/* @__PURE__ */ u.jsxs(
|
|
@@ -18518,11 +18523,11 @@ function qR({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
18518
18523
|
] })
|
|
18519
18524
|
] }),
|
|
18520
18525
|
/* @__PURE__ */ u.jsxs(To, { children: [
|
|
18521
|
-
/* @__PURE__ */ u.jsx(ko, { className: "pb-3", children: /* @__PURE__ */ u.jsxs(
|
|
18526
|
+
/* @__PURE__ */ u.jsx(ko, { className: "pb-3", children: /* @__PURE__ */ u.jsxs(Eo, { className: "text-lg flex items-center gap-2", children: [
|
|
18522
18527
|
/* @__PURE__ */ u.jsx(Pg, { className: "h-5 w-5" }),
|
|
18523
18528
|
"Behavior Settings"
|
|
18524
18529
|
] }) }),
|
|
18525
|
-
/* @__PURE__ */ u.jsxs(
|
|
18530
|
+
/* @__PURE__ */ u.jsxs(Ro, { className: "space-y-4", children: [
|
|
18526
18531
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
18527
18532
|
/* @__PURE__ */ u.jsxs("div", { children: [
|
|
18528
18533
|
/* @__PURE__ */ u.jsx(kn, { htmlFor: "auto-save", children: "Auto-save Conversations" }),
|
|
@@ -18593,7 +18598,7 @@ function qR({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
18593
18598
|
] })
|
|
18594
18599
|
] });
|
|
18595
18600
|
}
|
|
18596
|
-
function
|
|
18601
|
+
function GE({
|
|
18597
18602
|
layout: e = "sidebar",
|
|
18598
18603
|
layoutSize: t = "desktop",
|
|
18599
18604
|
showThreads: n = !0,
|
|
@@ -18672,24 +18677,24 @@ export {
|
|
|
18672
18677
|
Sv as ChatInput,
|
|
18673
18678
|
ga as ChatInterface,
|
|
18674
18679
|
Zi as ChatProviders,
|
|
18675
|
-
|
|
18680
|
+
qE as ChatSettings,
|
|
18676
18681
|
Ys as MarkdownContent,
|
|
18677
18682
|
Bu as MessageComponent,
|
|
18678
18683
|
Lp as MessageList,
|
|
18679
18684
|
Ku as ThreadManager,
|
|
18680
|
-
|
|
18685
|
+
WE as applySettings,
|
|
18681
18686
|
_r as chatApiClient,
|
|
18682
|
-
|
|
18687
|
+
GE as default,
|
|
18683
18688
|
vy as del,
|
|
18684
18689
|
Dn as get,
|
|
18685
18690
|
py as getChatToken,
|
|
18686
|
-
|
|
18691
|
+
UE as getCurrentSettings,
|
|
18687
18692
|
mk as getDefaultApiConfig,
|
|
18688
18693
|
gk as getDefaultChatSettings,
|
|
18689
18694
|
my as onChatTokenChanged,
|
|
18690
18695
|
Nc as post,
|
|
18691
18696
|
yy as put,
|
|
18692
|
-
|
|
18697
|
+
Ea as setChatToken,
|
|
18693
18698
|
Td as useApi,
|
|
18694
18699
|
qy as useChatStream,
|
|
18695
18700
|
Hy as useMessagesReducer,
|