teodor-new-chat-ui 4.3.488 → 4.3.489
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 +268 -266
- package/dist/index.umd.js +11 -11
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -370,7 +370,7 @@ function Tx() {
|
|
|
370
370
|
}
|
|
371
371
|
var C = !1, y = !1, T = !1, E = !1, N = !1, _;
|
|
372
372
|
_ = Symbol.for("react.module.reference");
|
|
373
|
-
function
|
|
373
|
+
function D(R) {
|
|
374
374
|
return !!(typeof R == "string" || typeof R == "function" || R === r || R === s || N || R === o || R === c || R === d || E || R === p || C || y || T || typeof R == "object" && R !== null && (R.$$typeof === m || R.$$typeof === f || R.$$typeof === i || R.$$typeof === a || R.$$typeof === l || // This needs to include all possible module reference object
|
|
375
375
|
// types supported by any Flight configuration anywhere since
|
|
376
376
|
// we don't know which Flight build this will end up being used
|
|
@@ -494,18 +494,18 @@ function Tx() {
|
|
|
494
494
|
V < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
var U = b.ReactCurrentDispatcher,
|
|
497
|
+
var U = b.ReactCurrentDispatcher, O;
|
|
498
498
|
function j(R, ee, ue) {
|
|
499
499
|
{
|
|
500
|
-
if (
|
|
500
|
+
if (O === void 0)
|
|
501
501
|
try {
|
|
502
502
|
throw Error();
|
|
503
503
|
} catch (Ze) {
|
|
504
504
|
var Ee = Ze.stack.trim().match(/\n( *(at )?)/);
|
|
505
|
-
|
|
505
|
+
O = Ee && Ee[1] || "";
|
|
506
506
|
}
|
|
507
507
|
return `
|
|
508
|
-
` +
|
|
508
|
+
` + O + R;
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
var q = !1, J;
|
|
@@ -878,7 +878,7 @@ Check the top-level render call using <` + ue + ">.");
|
|
|
878
878
|
var ze = {};
|
|
879
879
|
function xe(R, ee, ue, Ee, Ze, st) {
|
|
880
880
|
{
|
|
881
|
-
var qe =
|
|
881
|
+
var qe = D(R);
|
|
882
882
|
if (!qe) {
|
|
883
883
|
var He = "";
|
|
884
884
|
(R === void 0 || typeof R == "object" && R !== null && Object.keys(R).length === 0) && (He += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
@@ -2236,7 +2236,7 @@ const ld = (e) => {
|
|
|
2236
2236
|
responseType: E,
|
|
2237
2237
|
headers: N,
|
|
2238
2238
|
withCredentials: _ = "same-origin",
|
|
2239
|
-
fetchOptions:
|
|
2239
|
+
fetchOptions: D
|
|
2240
2240
|
} = ld(v), $ = t || fetch;
|
|
2241
2241
|
E = E ? (E + "").toLowerCase() : "text";
|
|
2242
2242
|
let H = Bv([w, S && S.toAbortSignal()], C), Y = null;
|
|
@@ -2261,7 +2261,7 @@ const ld = (e) => {
|
|
|
2261
2261
|
}
|
|
2262
2262
|
W.isString(_) || (_ = _ ? "include" : "omit");
|
|
2263
2263
|
const K = s && "credentials" in n.prototype, z = {
|
|
2264
|
-
...
|
|
2264
|
+
...D,
|
|
2265
2265
|
signal: H,
|
|
2266
2266
|
method: x.toUpperCase(),
|
|
2267
2267
|
headers: N.normalize().toJSON(),
|
|
@@ -2270,7 +2270,7 @@ const ld = (e) => {
|
|
|
2270
2270
|
credentials: K ? _ : void 0
|
|
2271
2271
|
};
|
|
2272
2272
|
Y = s && new n(g, z);
|
|
2273
|
-
let M = await (s ? $(Y,
|
|
2273
|
+
let M = await (s ? $(Y, D) : $(g, z));
|
|
2274
2274
|
const k = d && (E === "stream" || E === "response");
|
|
2275
2275
|
if (d && (y || k && P)) {
|
|
2276
2276
|
const X = {};
|
|
@@ -3097,14 +3097,14 @@ function xd(e) {
|
|
|
3097
3097
|
return t[t.length - 1] || null;
|
|
3098
3098
|
}
|
|
3099
3099
|
function fw(e = {}) {
|
|
3100
|
-
const t = Be(() => An(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = pe(e.token ?? null), s = Pe(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = pe(!1), [c, d] = pe(null), [f, m] = pe(""), [p, v] = pe(null), [g, x] = pe(0), [b, w] = pe(!1), [S, C] = pe(null), y = Pe(null), T = Pe(!0), E = Pe(0), N = Pe(null), _ = Pe(null),
|
|
3100
|
+
const t = Be(() => An(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = pe(e.token ?? null), s = Pe(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = pe(!1), [c, d] = pe(null), [f, m] = pe(""), [p, v] = pe(null), [g, x] = pe(0), [b, w] = pe(!1), [S, C] = pe(null), y = Pe(null), T = Pe(!0), E = Pe(0), N = Pe(null), _ = Pe(null), D = Pe(null), $ = Pe(null), H = Pe({
|
|
3101
3101
|
messageId: null,
|
|
3102
3102
|
lastSeq: null,
|
|
3103
3103
|
lastText: ""
|
|
3104
3104
|
}), Y = le((z) => {
|
|
3105
3105
|
o(z);
|
|
3106
3106
|
}, []), P = le(() => {
|
|
3107
|
-
m(""), v(null), d(null), _.current = null,
|
|
3107
|
+
m(""), v(null), d(null), _.current = null, D.current = null, $.current = null, C(null), H.current = {
|
|
3108
3108
|
messageId: null,
|
|
3109
3109
|
lastSeq: null,
|
|
3110
3110
|
lastText: ""
|
|
@@ -3121,7 +3121,7 @@ function fw(e = {}) {
|
|
|
3121
3121
|
}) : Promise.resolve()).finally(M);
|
|
3122
3122
|
}, []), K = le(
|
|
3123
3123
|
(z, M, k) => {
|
|
3124
|
-
y.current && (y.current.abort(), y.current = null), l(!0), d(null), e.autoAppendAssistant !== !1 && m(""), v(null), _.current = null,
|
|
3124
|
+
y.current && (y.current.abort(), y.current = null), l(!0), d(null), e.autoAppendAssistant !== !1 && m(""), v(null), _.current = null, D.current = null, $.current = null, C(null), H.current = {
|
|
3125
3125
|
messageId: null,
|
|
3126
3126
|
lastSeq: null,
|
|
3127
3127
|
lastText: ""
|
|
@@ -3133,7 +3133,7 @@ function fw(e = {}) {
|
|
|
3133
3133
|
threadId: z.threadId ?? null,
|
|
3134
3134
|
headers: {}
|
|
3135
3135
|
}, (async () => {
|
|
3136
|
-
var F, U,
|
|
3136
|
+
var F, U, O, j, q, J, ne, re, se, ae, be, Oe, We, je, Fe, ut, mt, Ct;
|
|
3137
3137
|
const I = (Ge) => {
|
|
3138
3138
|
var Je;
|
|
3139
3139
|
try {
|
|
@@ -3156,7 +3156,7 @@ function fw(e = {}) {
|
|
|
3156
3156
|
let Z = null;
|
|
3157
3157
|
try {
|
|
3158
3158
|
const ot = (U = window.localStorage) == null ? void 0 : U.getItem("chat-settings");
|
|
3159
|
-
ot && (Z = ((
|
|
3159
|
+
ot && (Z = ((O = JSON.parse(ot)) == null ? void 0 : O.apiKey) || null);
|
|
3160
3160
|
} catch {
|
|
3161
3161
|
}
|
|
3162
3162
|
const he = Ke || Et || Z || null;
|
|
@@ -3285,12 +3285,12 @@ function fw(e = {}) {
|
|
|
3285
3285
|
});
|
|
3286
3286
|
}
|
|
3287
3287
|
if (xe.type === "checkpoint")
|
|
3288
|
-
_.current = xe.checkpointId ?? null,
|
|
3288
|
+
_.current = xe.checkpointId ?? null, D.current = xe.checkpointNs ?? null, v(xe.checkpointId ?? null);
|
|
3289
3289
|
else if (xe.type === "state_history") {
|
|
3290
3290
|
$.current = xe;
|
|
3291
3291
|
try {
|
|
3292
3292
|
const xt = Cr(xe).latest;
|
|
3293
|
-
xt && (_.current = xt.checkpointId ?? null,
|
|
3293
|
+
xt && (_.current = xt.checkpointId ?? null, D.current = xt.checkpointNs ?? null, v(xt.checkpointId ?? null));
|
|
3294
3294
|
} catch (Me) {
|
|
3295
3295
|
console.warn("[use-chat] Failed to hydrate state_history payload", Me);
|
|
3296
3296
|
}
|
|
@@ -3366,7 +3366,7 @@ function fw(e = {}) {
|
|
|
3366
3366
|
X = "error", A = Je, d(Je), (ut = k == null ? void 0 : k.onError) == null || ut.call(k, Je), B || ((mt = k == null ? void 0 : k.onConnectionError) == null || mt.call(k, Je), B = !0);
|
|
3367
3367
|
}
|
|
3368
3368
|
} finally {
|
|
3369
|
-
const Ge = E.current, Je = _.current, Ve =
|
|
3369
|
+
const Ge = E.current, Je = _.current, Ve = D.current, De = $.current, Ne = X ?? (G.signal.aborted ? "aborted" : A ? "error" : "complete");
|
|
3370
3370
|
try {
|
|
3371
3371
|
(Ct = k == null ? void 0 : k.onClosed) == null || Ct.call(k, {
|
|
3372
3372
|
reason: Ne,
|
|
@@ -3486,7 +3486,7 @@ function mw({
|
|
|
3486
3486
|
}, [_]), Qe(() => {
|
|
3487
3487
|
r == null || r(a);
|
|
3488
3488
|
}, [a, r]);
|
|
3489
|
-
const
|
|
3489
|
+
const D = le(
|
|
3490
3490
|
async (M) => {
|
|
3491
3491
|
try {
|
|
3492
3492
|
const k = await e.createThread(M);
|
|
@@ -3548,7 +3548,7 @@ function mw({
|
|
|
3548
3548
|
[e, n, _]
|
|
3549
3549
|
), V = Be(
|
|
3550
3550
|
() => ({
|
|
3551
|
-
createThread:
|
|
3551
|
+
createThread: D,
|
|
3552
3552
|
deleteThread: $,
|
|
3553
3553
|
renameThread: H,
|
|
3554
3554
|
refreshThreads: N,
|
|
@@ -3556,7 +3556,7 @@ function mw({
|
|
|
3556
3556
|
shareThread: Y,
|
|
3557
3557
|
unshareThread: P
|
|
3558
3558
|
}),
|
|
3559
|
-
[
|
|
3559
|
+
[D, $, H, N, _, Y, P]
|
|
3560
3560
|
), K = le((M) => {
|
|
3561
3561
|
if (!(M != null && M.threadId)) return;
|
|
3562
3562
|
const k = {
|
|
@@ -4164,13 +4164,13 @@ function Mw({
|
|
|
4164
4164
|
const [d, f] = pe(null), p = Be(
|
|
4165
4165
|
() => Cr(d),
|
|
4166
4166
|
[d]
|
|
4167
|
-
).checkpoints, v = dx(p), g = v.timeline, [x, b] = pe(!1), [w, S] = pe(!1), [C, y] = pe(null), T = Pe(r), E = Pe(null), N = Pe(null), _ = Pe(null),
|
|
4167
|
+
).checkpoints, v = dx(p), g = v.timeline, [x, b] = pe(!1), [w, S] = pe(!1), [C, y] = pe(null), T = Pe(r), E = Pe(null), N = Pe(null), _ = Pe(null), D = Pe(null), $ = Pe(null), H = Pe(/* @__PURE__ */ new Map()), Y = Pe(null);
|
|
4168
4168
|
Qe(() => {
|
|
4169
4169
|
T.current = r;
|
|
4170
4170
|
}, [r]);
|
|
4171
4171
|
const P = le(
|
|
4172
4172
|
async (I) => {
|
|
4173
|
-
var U,
|
|
4173
|
+
var U, O;
|
|
4174
4174
|
if (!I.threadId) return;
|
|
4175
4175
|
const F = I.threadId;
|
|
4176
4176
|
(U = I.onStart) == null || U.call(I), I.setLoading(!0);
|
|
@@ -4179,7 +4179,7 @@ function Mw({
|
|
|
4179
4179
|
} catch (j) {
|
|
4180
4180
|
if (!gc(j) && T.current === F) {
|
|
4181
4181
|
const J = String(j);
|
|
4182
|
-
(
|
|
4182
|
+
(O = I.handleError) == null || O.call(I, J), n == null || n(J);
|
|
4183
4183
|
}
|
|
4184
4184
|
throw j;
|
|
4185
4185
|
} finally {
|
|
@@ -4191,9 +4191,9 @@ function Mw({
|
|
|
4191
4191
|
async (I, F) => {
|
|
4192
4192
|
var J;
|
|
4193
4193
|
if (!I) return;
|
|
4194
|
-
const U = `${I}:${F ?? "latest"}`,
|
|
4195
|
-
if (
|
|
4196
|
-
return
|
|
4194
|
+
const U = `${I}:${F ?? "latest"}`, O = H.current.get(U);
|
|
4195
|
+
if (O)
|
|
4196
|
+
return O;
|
|
4197
4197
|
(J = Y.current) == null || J.abort();
|
|
4198
4198
|
const j = new AbortController();
|
|
4199
4199
|
Y.current = j;
|
|
@@ -4217,7 +4217,8 @@ function Mw({
|
|
|
4217
4217
|
const { checkpoints: se } = Cr(re), ae = se.find((be) => be.messages && be.messages.length > 0) ?? (F ? se.find((be) => be.checkpointId === F) : null) ?? se[0];
|
|
4218
4218
|
t((ae == null ? void 0 : ae.messages) ?? [], {
|
|
4219
4219
|
checkpointId: (ae == null ? void 0 : ae.checkpointId) ?? null,
|
|
4220
|
-
checkpointNs: (ae == null ? void 0 : ae.checkpointNs) ?? null
|
|
4220
|
+
checkpointNs: (ae == null ? void 0 : ae.checkpointNs) ?? null,
|
|
4221
|
+
pendingInterrupt: (ae == null ? void 0 : ae.interrupt) ?? null
|
|
4221
4222
|
}), f(re);
|
|
4222
4223
|
}
|
|
4223
4224
|
});
|
|
@@ -4232,14 +4233,14 @@ function Mw({
|
|
|
4232
4233
|
[e, t, P]
|
|
4233
4234
|
), K = le(
|
|
4234
4235
|
async (I, F) => {
|
|
4235
|
-
|
|
4236
|
+
D.current = I;
|
|
4236
4237
|
try {
|
|
4237
4238
|
await V(I, F);
|
|
4238
4239
|
} catch (U) {
|
|
4239
4240
|
if (!gc(U))
|
|
4240
4241
|
throw U;
|
|
4241
4242
|
} finally {
|
|
4242
|
-
|
|
4243
|
+
D.current === I && (D.current = null);
|
|
4243
4244
|
}
|
|
4244
4245
|
},
|
|
4245
4246
|
[V]
|
|
@@ -4255,10 +4256,11 @@ function Mw({
|
|
|
4255
4256
|
const { checkpoints: U } = Cr(I);
|
|
4256
4257
|
if (!U.length)
|
|
4257
4258
|
return;
|
|
4258
|
-
const
|
|
4259
|
-
!l && !j && t((
|
|
4260
|
-
checkpointId: (
|
|
4261
|
-
checkpointNs: (
|
|
4259
|
+
const O = U.find((q) => q.messages && q.messages.length > 0) ?? U.find((q) => !!q.checkpointId) ?? U[0], j = _.current === F;
|
|
4260
|
+
!l && !j && t((O == null ? void 0 : O.messages) ?? [], {
|
|
4261
|
+
checkpointId: (O == null ? void 0 : O.checkpointId) ?? null,
|
|
4262
|
+
checkpointNs: (O == null ? void 0 : O.checkpointNs) ?? null,
|
|
4263
|
+
pendingInterrupt: (O == null ? void 0 : O.interrupt) ?? null
|
|
4262
4264
|
}), f(I), $.current = `${F}:latest`, N.current = null, _.current === F && (_.current = null);
|
|
4263
4265
|
},
|
|
4264
4266
|
[t, l]
|
|
@@ -4268,13 +4270,13 @@ function Mw({
|
|
|
4268
4270
|
await P({
|
|
4269
4271
|
threadId: U,
|
|
4270
4272
|
setLoading: S,
|
|
4271
|
-
action: async (
|
|
4273
|
+
action: async (O) => {
|
|
4272
4274
|
const j = await e.getStateHistory({
|
|
4273
|
-
threadId:
|
|
4275
|
+
threadId: O,
|
|
4274
4276
|
checkpointId: I,
|
|
4275
4277
|
checkpointNs: F ?? void 0
|
|
4276
4278
|
});
|
|
4277
|
-
if (T.current !==
|
|
4279
|
+
if (T.current !== O)
|
|
4278
4280
|
return;
|
|
4279
4281
|
const { checkpoints: q } = Cr(j), J = q.find(
|
|
4280
4282
|
(ne) => ne.checkpointId === I && (F ? ne.checkpointNs === F : !0)
|
|
@@ -4314,8 +4316,8 @@ function Mw({
|
|
|
4314
4316
|
E.current = r;
|
|
4315
4317
|
return;
|
|
4316
4318
|
}
|
|
4317
|
-
if (
|
|
4318
|
-
|
|
4319
|
+
if (D.current === r) {
|
|
4320
|
+
D.current = null, E.current = r;
|
|
4319
4321
|
return;
|
|
4320
4322
|
}
|
|
4321
4323
|
if (E.current === r)
|
|
@@ -4335,7 +4337,7 @@ function Mw({
|
|
|
4335
4337
|
K
|
|
4336
4338
|
]);
|
|
4337
4339
|
const B = le(() => {
|
|
4338
|
-
f(null), b(!1), S(!1), y(null), N.current = null, _.current = null, E.current = null, $.current = null,
|
|
4340
|
+
f(null), b(!1), S(!1), y(null), N.current = null, _.current = null, E.current = null, $.current = null, D.current = null;
|
|
4339
4341
|
}, []);
|
|
4340
4342
|
return {
|
|
4341
4343
|
threadCheckpoints: p,
|
|
@@ -4389,7 +4391,7 @@ function Dw({
|
|
|
4389
4391
|
handleStateHistoryEvent: E,
|
|
4390
4392
|
markSkipNextLoad: N,
|
|
4391
4393
|
markStreamPendingThread: _,
|
|
4392
|
-
resetHistoryState:
|
|
4394
|
+
resetHistoryState: D
|
|
4393
4395
|
} = Mw({
|
|
4394
4396
|
api: a,
|
|
4395
4397
|
seed: d,
|
|
@@ -4411,8 +4413,8 @@ function Dw({
|
|
|
4411
4413
|
}
|
|
4412
4414
|
);
|
|
4413
4415
|
Qe(() => {
|
|
4414
|
-
l || (d([], {}),
|
|
4415
|
-
}, [l, d,
|
|
4416
|
+
l || (d([], {}), D());
|
|
4417
|
+
}, [l, d, D]);
|
|
4416
4418
|
const V = le(
|
|
4417
4419
|
(G) => H(() => G),
|
|
4418
4420
|
[]
|
|
@@ -4446,7 +4448,7 @@ function Dw({
|
|
|
4446
4448
|
handleStateHistoryEvent: E,
|
|
4447
4449
|
markSkipNextLoad: N,
|
|
4448
4450
|
markStreamPendingThread: _,
|
|
4449
|
-
resetHistoryState:
|
|
4451
|
+
resetHistoryState: D,
|
|
4450
4452
|
pushUser: f,
|
|
4451
4453
|
onEvent: m
|
|
4452
4454
|
}),
|
|
@@ -4470,7 +4472,7 @@ function Dw({
|
|
|
4470
4472
|
E,
|
|
4471
4473
|
N,
|
|
4472
4474
|
_,
|
|
4473
|
-
|
|
4475
|
+
D,
|
|
4474
4476
|
f,
|
|
4475
4477
|
m
|
|
4476
4478
|
]
|
|
@@ -4584,14 +4586,14 @@ function zw({
|
|
|
4584
4586
|
v(z), p.current !== z.threadId && ((z.created ?? !p.current) && w(z.threadId), S(z.threadId), m(z.threadId));
|
|
4585
4587
|
},
|
|
4586
4588
|
[v, w, S, m, p]
|
|
4587
|
-
),
|
|
4589
|
+
), D = le(
|
|
4588
4590
|
(z) => {
|
|
4589
4591
|
z.type === "thread_info" ? _(z) : z.type === "state_history" ? b(z) : z.type === "tool.end" ? i == null || i(z) : T(z);
|
|
4590
4592
|
},
|
|
4591
4593
|
[_, b, T, i]
|
|
4592
4594
|
), $ = le(
|
|
4593
4595
|
(z) => {
|
|
4594
|
-
a(z,
|
|
4596
|
+
a(z, D, {
|
|
4595
4597
|
onError: (M) => {
|
|
4596
4598
|
console.error("[StreamingProvider] Stream error:", M), r == null || r(M);
|
|
4597
4599
|
},
|
|
@@ -4603,7 +4605,7 @@ function zw({
|
|
|
4603
4605
|
}
|
|
4604
4606
|
});
|
|
4605
4607
|
},
|
|
4606
|
-
[a,
|
|
4608
|
+
[a, D, r, o, s]
|
|
4607
4609
|
), H = Pe(g);
|
|
4608
4610
|
Qe(() => {
|
|
4609
4611
|
H.current = g;
|
|
@@ -4643,7 +4645,7 @@ function zw({
|
|
|
4643
4645
|
const je = Math.floor(Date.now() / 1e3).toString(16).padStart(8, "0"), Fe = Array.from({ length: 4 }, () => Math.floor(Math.random() * 4294967295).toString(16).padStart(8, "0")).join("").slice(0, 16);
|
|
4644
4646
|
k = `${je}${Fe}`, w(k), m(k);
|
|
4645
4647
|
}
|
|
4646
|
-
const { contentParts: U, filesInfo:
|
|
4648
|
+
const { contentParts: U, filesInfo: O } = await aw(X), j = [...U];
|
|
4647
4649
|
A && j.push({ type: "text", text: G });
|
|
4648
4650
|
const q = M == null ? void 0 : M.originalMessageId, J = !!(M != null && M.edit && q), ne = !F && j.length > 0;
|
|
4649
4651
|
let re = null;
|
|
@@ -4655,7 +4657,7 @@ function zw({
|
|
|
4655
4657
|
}, J ? y(re, q) : y(re));
|
|
4656
4658
|
const se = F ? I : re ? [re] : [], ae = {
|
|
4657
4659
|
...B,
|
|
4658
|
-
...
|
|
4660
|
+
...O.length ? { files_info: O } : {}
|
|
4659
4661
|
};
|
|
4660
4662
|
se.length ? ae.messages = se : "messages" in ae || (ae.messages = []);
|
|
4661
4663
|
let be = (M == null ? void 0 : M.checkpointId) ?? g.id ?? void 0, Oe = (M == null ? void 0 : M.checkpointNs) ?? g.namespace ?? void 0;
|
|
@@ -5155,11 +5157,11 @@ var sb = "DismissableLayer", na = "dismissableLayer.update", ib = "dismissableLa
|
|
|
5155
5157
|
onDismiss: a,
|
|
5156
5158
|
...l
|
|
5157
5159
|
} = e, c = h.useContext(jd), [d, f] = h.useState(null), m = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = h.useState({}), v = $e(t, (E) => f(E)), g = Array.from(c.layers), [x] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), b = g.indexOf(x), w = d ? g.indexOf(d) : -1, S = c.layersWithOutsidePointerEventsDisabled.size > 0, C = w >= b, y = cb((E) => {
|
|
5158
|
-
const N = E.target, _ = [...c.branches].some((
|
|
5160
|
+
const N = E.target, _ = [...c.branches].some((D) => D.contains(N));
|
|
5159
5161
|
!C || _ || (o == null || o(E), i == null || i(E), E.defaultPrevented || a == null || a());
|
|
5160
5162
|
}, m), T = ub((E) => {
|
|
5161
5163
|
const N = E.target;
|
|
5162
|
-
[...c.branches].some((
|
|
5164
|
+
[...c.branches].some((D) => D.contains(N)) || (s == null || s(E), i == null || i(E), E.defaultPrevented || a == null || a());
|
|
5163
5165
|
}, m);
|
|
5164
5166
|
return ob((E) => {
|
|
5165
5167
|
w === c.layers.size - 1 && (r == null || r(E), !E.defaultPrevented && a && (E.preventDefault(), a()));
|
|
@@ -5690,7 +5692,7 @@ const Mb = (e) => ({
|
|
|
5690
5692
|
}, p = Ka(o), v = Va(p), g = await i.getDimensions(c), x = p === "y", b = x ? "top" : "left", w = x ? "bottom" : "right", S = x ? "clientHeight" : "clientWidth", C = s.reference[v] + s.reference[p] - m[p] - s.floating[v], y = m[p] - s.reference[p], T = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c));
|
|
5691
5693
|
let E = T ? T[S] : 0;
|
|
5692
5694
|
(!E || !await (i.isElement == null ? void 0 : i.isElement(T))) && (E = a.floating[S] || s.floating[v]);
|
|
5693
|
-
const N = C / 2 - y / 2, _ = E / 2 - g[v] / 2 - 1,
|
|
5695
|
+
const N = C / 2 - y / 2, _ = E / 2 - g[v] / 2 - 1, D = Ln(f[b], _), $ = Ln(f[w], _), H = D, Y = E - g[v] - $, P = E / 2 - g[v] / 2 + N, V = ra(H, P, Y), K = !l.arrow && Hr(o) != null && P !== V && s.reference[v] / 2 - (P < H ? D : $) - g[v] / 2 < 0, z = K ? P < H ? P - H : P - Y : 0;
|
|
5694
5696
|
return {
|
|
5695
5697
|
[p]: m[p] + z,
|
|
5696
5698
|
data: {
|
|
@@ -5730,12 +5732,12 @@ const Mb = (e) => ({
|
|
|
5730
5732
|
const b = _n(o), w = Sn(a), S = _n(a) === a, C = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), y = m || (S || !g ? [gs(a)] : Rb(a)), T = v !== "none";
|
|
5731
5733
|
!m && T && y.push(...jb(a, g, v, C));
|
|
5732
5734
|
const E = [a, ...y], N = await lo(t, x), _ = [];
|
|
5733
|
-
let
|
|
5735
|
+
let D = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
5734
5736
|
if (d && _.push(N[b]), f) {
|
|
5735
5737
|
const P = kb(o, i, C);
|
|
5736
5738
|
_.push(N[P[0]], N[P[1]]);
|
|
5737
5739
|
}
|
|
5738
|
-
if (
|
|
5740
|
+
if (D = [...D, {
|
|
5739
5741
|
placement: o,
|
|
5740
5742
|
overflows: _
|
|
5741
5743
|
}], !_.every((P) => P <= 0)) {
|
|
@@ -5743,22 +5745,22 @@ const Mb = (e) => ({
|
|
|
5743
5745
|
const P = ((($ = s.flip) == null ? void 0 : $.index) || 0) + 1, V = E[P];
|
|
5744
5746
|
if (V && (!(f === "alignment" ? w !== Sn(V) : !1) || // We leave the current main axis only if every placement on that axis
|
|
5745
5747
|
// overflows the main axis.
|
|
5746
|
-
|
|
5748
|
+
D.every((M) => Sn(M.placement) === w ? M.overflows[0] > 0 : !0)))
|
|
5747
5749
|
return {
|
|
5748
5750
|
data: {
|
|
5749
5751
|
index: P,
|
|
5750
|
-
overflows:
|
|
5752
|
+
overflows: D
|
|
5751
5753
|
},
|
|
5752
5754
|
reset: {
|
|
5753
5755
|
placement: V
|
|
5754
5756
|
}
|
|
5755
5757
|
};
|
|
5756
|
-
let K = (H =
|
|
5758
|
+
let K = (H = D.filter((z) => z.overflows[0] <= 0).sort((z, M) => z.overflows[1] - M.overflows[1])[0]) == null ? void 0 : H.placement;
|
|
5757
5759
|
if (!K)
|
|
5758
5760
|
switch (p) {
|
|
5759
5761
|
case "bestFit": {
|
|
5760
5762
|
var Y;
|
|
5761
|
-
const z = (Y =
|
|
5763
|
+
const z = (Y = D.filter((M) => {
|
|
5762
5764
|
if (T) {
|
|
5763
5765
|
const k = Sn(M.placement);
|
|
5764
5766
|
return k === w || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -6009,8 +6011,8 @@ const $b = function(e) {
|
|
|
6009
6011
|
const w = g - d.top - d.bottom, S = v - d.left - d.right, C = Ln(g - d[x], w), y = Ln(v - d[b], S), T = !t.middlewareData.shift;
|
|
6010
6012
|
let E = C, N = y;
|
|
6011
6013
|
if ((n = t.middlewareData.shift) != null && n.enabled.x && (N = S), (r = t.middlewareData.shift) != null && r.enabled.y && (E = w), T && !m) {
|
|
6012
|
-
const
|
|
6013
|
-
p ? N = v - 2 * (
|
|
6014
|
+
const D = Yt(d.left, 0), $ = Yt(d.right, 0), H = Yt(d.top, 0), Y = Yt(d.bottom, 0);
|
|
6015
|
+
p ? N = v - 2 * (D !== 0 || $ !== 0 ? D + $ : Yt(d.left, d.right)) : E = g - 2 * (H !== 0 || Y !== 0 ? H + Y : Yt(d.top, d.bottom));
|
|
6014
6016
|
}
|
|
6015
6017
|
await l({
|
|
6016
6018
|
...t,
|
|
@@ -6598,7 +6600,7 @@ function Ty(e) {
|
|
|
6598
6600
|
M !== T.current && (T.current = M, g(M));
|
|
6599
6601
|
}, []), S = h.useCallback((M) => {
|
|
6600
6602
|
M !== E.current && (E.current = M, b(M));
|
|
6601
|
-
}, []), C = s || v, y = i || x, T = h.useRef(null), E = h.useRef(null), N = h.useRef(d), _ = l != null,
|
|
6603
|
+
}, []), C = s || v, y = i || x, T = h.useRef(null), E = h.useRef(null), N = h.useRef(d), _ = l != null, D = Ai(l), $ = Ai(o), H = Ai(c), Y = h.useCallback(() => {
|
|
6602
6604
|
if (!T.current || !E.current)
|
|
6603
6605
|
return;
|
|
6604
6606
|
const M = {
|
|
@@ -6631,11 +6633,11 @@ function Ty(e) {
|
|
|
6631
6633
|
P.current = !1;
|
|
6632
6634
|
}), []), os(() => {
|
|
6633
6635
|
if (C && (T.current = C), y && (E.current = y), C && y) {
|
|
6634
|
-
if (
|
|
6635
|
-
return
|
|
6636
|
+
if (D.current)
|
|
6637
|
+
return D.current(C, y, Y);
|
|
6636
6638
|
Y();
|
|
6637
6639
|
}
|
|
6638
|
-
}, [C, y, Y,
|
|
6640
|
+
}, [C, y, Y, D, _]);
|
|
6639
6641
|
const V = h.useMemo(() => ({
|
|
6640
6642
|
reference: T,
|
|
6641
6643
|
floating: E,
|
|
@@ -6772,7 +6774,7 @@ var Jd = "PopperAnchor", Zd = h.forwardRef(
|
|
|
6772
6774
|
Zd.displayName = Jd;
|
|
6773
6775
|
var Ja = "PopperContent", [Oy, Dy] = Gd(Ja), Qd = h.forwardRef(
|
|
6774
6776
|
(e, t) => {
|
|
6775
|
-
var
|
|
6777
|
+
var O, j, q, J, ne, re;
|
|
6776
6778
|
const {
|
|
6777
6779
|
__scopePopper: n,
|
|
6778
6780
|
side: r = "bottom",
|
|
@@ -6788,8 +6790,8 @@ var Ja = "PopperContent", [Oy, Dy] = Gd(Ja), Qd = h.forwardRef(
|
|
|
6788
6790
|
updatePositionStrategy: p = "optimized",
|
|
6789
6791
|
onPlaced: v,
|
|
6790
6792
|
...g
|
|
6791
|
-
} = e, x = Yd(Ja, n), [b, w] = h.useState(null), S = $e(t, (se) => w(se)), [C, y] = h.useState(null), T = qd(C), E = (T == null ? void 0 : T.width) ?? 0, N = (T == null ? void 0 : T.height) ?? 0, _ = r + (s !== "center" ? "-" + s : ""),
|
|
6792
|
-
padding:
|
|
6793
|
+
} = e, x = Yd(Ja, n), [b, w] = h.useState(null), S = $e(t, (se) => w(se)), [C, y] = h.useState(null), T = qd(C), E = (T == null ? void 0 : T.width) ?? 0, N = (T == null ? void 0 : T.height) ?? 0, _ = r + (s !== "center" ? "-" + s : ""), D = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, $ = Array.isArray(c) ? c : [c], H = $.length > 0, Y = {
|
|
6794
|
+
padding: D,
|
|
6793
6795
|
boundary: $.filter($y),
|
|
6794
6796
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
6795
6797
|
altBoundary: H
|
|
@@ -6827,7 +6829,7 @@ var Ja = "PopperContent", [Oy, Dy] = Gd(Ja), Qd = h.forwardRef(
|
|
|
6827
6829
|
Nt(() => {
|
|
6828
6830
|
z && (X == null || X());
|
|
6829
6831
|
}, [z, X]);
|
|
6830
|
-
const A = (
|
|
6832
|
+
const A = (O = M.arrow) == null ? void 0 : O.x, B = (j = M.arrow) == null ? void 0 : j.y, I = ((q = M.arrow) == null ? void 0 : q.centerOffset) !== 0, [F, U] = h.useState();
|
|
6831
6833
|
return Nt(() => {
|
|
6832
6834
|
b && U(window.getComputedStyle(b).zIndex);
|
|
6833
6835
|
}, [b]), /* @__PURE__ */ u.jsx(
|
|
@@ -7090,8 +7092,8 @@ var Yy = h.forwardRef((e, t) => {
|
|
|
7090
7092
|
onFocus: ie(e.onFocus, (N) => {
|
|
7091
7093
|
const _ = !y.current;
|
|
7092
7094
|
if (N.target === N.currentTarget && _ && !b) {
|
|
7093
|
-
const
|
|
7094
|
-
if (N.currentTarget.dispatchEvent(
|
|
7095
|
+
const D = new CustomEvent(ji, Wy);
|
|
7096
|
+
if (N.currentTarget.dispatchEvent(D), !D.defaultPrevented) {
|
|
7095
7097
|
const $ = C().filter((K) => K.focusable), H = $.find((K) => K.active), Y = $.find((K) => K.id === g), V = [H, Y, ...$].filter(
|
|
7096
7098
|
Boolean
|
|
7097
7099
|
).map((K) => K.ref.current);
|
|
@@ -7824,11 +7826,11 @@ var on = "MenuContent", [J0, sl] = dr(on), Cf = h.forwardRef(
|
|
|
7824
7826
|
onDismiss: p,
|
|
7825
7827
|
disableOutsideScroll: v,
|
|
7826
7828
|
...g
|
|
7827
|
-
} = e, x = fr(on, n), b = Po(on, n), w = Ys(n), S = bf(n), C = V0(n), [y, T] = h.useState(null), E = h.useRef(null), N = $e(t, E, x.onContentChange), _ = h.useRef(0),
|
|
7828
|
-
var
|
|
7829
|
-
const G =
|
|
7829
|
+
} = e, x = fr(on, n), b = Po(on, n), w = Ys(n), S = bf(n), C = V0(n), [y, T] = h.useState(null), E = h.useRef(null), N = $e(t, E, x.onContentChange), _ = h.useRef(0), D = h.useRef(""), $ = h.useRef(0), H = h.useRef(null), Y = h.useRef("right"), P = h.useRef(0), V = v ? Gs : h.Fragment, K = v ? { as: eS, allowPinchZoom: !0 } : void 0, z = (k) => {
|
|
7830
|
+
var O, j;
|
|
7831
|
+
const G = D.current + k, X = C().filter((q) => !q.disabled), A = document.activeElement, B = (O = X.find((q) => q.ref.current === A)) == null ? void 0 : O.textValue, I = X.map((q) => q.textValue), F = fS(I, G, B), U = (j = X.find((q) => q.textValue === F)) == null ? void 0 : j.ref.current;
|
|
7830
7832
|
(function q(J) {
|
|
7831
|
-
|
|
7833
|
+
D.current = J, window.clearTimeout(_.current), J !== "" && (_.current = window.setTimeout(() => q(""), 1e3));
|
|
7832
7834
|
})(G), U && setTimeout(() => U.focus());
|
|
7833
7835
|
};
|
|
7834
7836
|
h.useEffect(() => () => window.clearTimeout(_.current), []), Ua();
|
|
@@ -7840,7 +7842,7 @@ var on = "MenuContent", [J0, sl] = dr(on), Cf = h.forwardRef(
|
|
|
7840
7842
|
J0,
|
|
7841
7843
|
{
|
|
7842
7844
|
scope: n,
|
|
7843
|
-
searchRef:
|
|
7845
|
+
searchRef: D,
|
|
7844
7846
|
onItemEnter: h.useCallback(
|
|
7845
7847
|
(k) => {
|
|
7846
7848
|
M(k) && k.preventDefault();
|
|
@@ -7916,11 +7918,11 @@ var on = "MenuContent", [J0, sl] = dr(on), Cf = h.forwardRef(
|
|
|
7916
7918
|
const I = E.current;
|
|
7917
7919
|
if (k.target !== I || !H0.includes(k.key)) return;
|
|
7918
7920
|
k.preventDefault();
|
|
7919
|
-
const U = C().filter((
|
|
7921
|
+
const U = C().filter((O) => !O.disabled).map((O) => O.ref.current);
|
|
7920
7922
|
vf.includes(k.key) && U.reverse(), uS(U);
|
|
7921
7923
|
}),
|
|
7922
7924
|
onBlur: ie(e.onBlur, (k) => {
|
|
7923
|
-
k.currentTarget.contains(k.target) || (window.clearTimeout(_.current),
|
|
7925
|
+
k.currentTarget.contains(k.target) || (window.clearTimeout(_.current), D.current = "");
|
|
7924
7926
|
}),
|
|
7925
7927
|
onPointerMove: ie(
|
|
7926
7928
|
e.onPointerMove,
|
|
@@ -8602,7 +8604,7 @@ function rT({
|
|
|
8602
8604
|
validate: g,
|
|
8603
8605
|
onValidationError: x
|
|
8604
8606
|
}) {
|
|
8605
|
-
const b = i !== void 0, [w, S] = L.useState(e), C = (b ? i : w) ?? "", [y, T] = L.useTransition(), E = L.useRef(null), N = L.useRef(0), _ = L.useRef(null),
|
|
8607
|
+
const b = i !== void 0, [w, S] = L.useState(e), C = (b ? i : w) ?? "", [y, T] = L.useTransition(), E = L.useRef(null), N = L.useRef(0), _ = L.useRef(null), D = L.useRef("");
|
|
8606
8608
|
L.useEffect(() => {
|
|
8607
8609
|
b || (S(e ?? ""), _.current = null, E.current && (E.current.style.height = "auto", E.current.style.height = `${E.current.scrollHeight}px`));
|
|
8608
8610
|
}, [e, t, b]);
|
|
@@ -8612,7 +8614,7 @@ function rT({
|
|
|
8612
8614
|
), P = L.useMemo(() => g ?? Y, [g, Y]), V = L.useCallback(
|
|
8613
8615
|
(I) => {
|
|
8614
8616
|
const F = P(I);
|
|
8615
|
-
return H(F), x == null || x(F),
|
|
8617
|
+
return H(F), x == null || x(F), D.current = I, F;
|
|
8616
8618
|
},
|
|
8617
8619
|
[P, x]
|
|
8618
8620
|
), K = L.useCallback(() => {
|
|
@@ -8625,7 +8627,7 @@ function rT({
|
|
|
8625
8627
|
if (!$)
|
|
8626
8628
|
return;
|
|
8627
8629
|
const I = (C ?? "").trim();
|
|
8628
|
-
|
|
8630
|
+
D.current !== I && V(I);
|
|
8629
8631
|
}, [C, $, V]);
|
|
8630
8632
|
const z = L.useCallback(
|
|
8631
8633
|
(I, { fromUser: F }) => {
|
|
@@ -8643,7 +8645,7 @@ function rT({
|
|
|
8643
8645
|
id: U,
|
|
8644
8646
|
shouldClear: !0
|
|
8645
8647
|
}, T(() => {
|
|
8646
|
-
var
|
|
8648
|
+
var O, j, q;
|
|
8647
8649
|
try {
|
|
8648
8650
|
const J = l(F);
|
|
8649
8651
|
J && typeof J.then == "function" ? J.then(() => {
|
|
@@ -8652,7 +8654,7 @@ function rT({
|
|
|
8652
8654
|
}).catch(() => {
|
|
8653
8655
|
var ne;
|
|
8654
8656
|
((ne = _.current) == null ? void 0 : ne.id) === U && (_.current = null);
|
|
8655
|
-
}) : (((
|
|
8657
|
+
}) : (((O = _.current) == null ? void 0 : O.id) === U && _.current.shouldClear && (b || (S(""), E.current && (E.current.style.height = "auto"), a == null || a(""))), ((j = _.current) == null ? void 0 : j.id) === U && (_.current = null));
|
|
8656
8658
|
} catch {
|
|
8657
8659
|
((q = _.current) == null ? void 0 : q.id) === U && (_.current = null);
|
|
8658
8660
|
}
|
|
@@ -8736,7 +8738,7 @@ function sT({
|
|
|
8736
8738
|
allowEmptySend: x = !1,
|
|
8737
8739
|
inputError: b = null
|
|
8738
8740
|
}) {
|
|
8739
|
-
const [w, S] = pe([]), C = Pe(null), y = Pe(null), [T, E] = pe(0), [N, _] = pe(0), [
|
|
8741
|
+
const [w, S] = pe([]), C = Pe(null), y = Pe(null), [T, E] = pe(0), [N, _] = pe(0), [D, $] = pe(!1), [H, Y] = pe(null), [P, V] = pe(null), K = le(() => {
|
|
8740
8742
|
C.current && (C.current.value = ""), y.current && (y.current.value = ""), E((I) => I + 1), _((I) => I + 1);
|
|
8741
8743
|
}, []), z = le((I) => {
|
|
8742
8744
|
S((F) => [...F, ...I]);
|
|
@@ -8748,7 +8750,7 @@ function sT({
|
|
|
8748
8750
|
[z]
|
|
8749
8751
|
), k = le((I) => {
|
|
8750
8752
|
S((F) => {
|
|
8751
|
-
const U = F.filter((
|
|
8753
|
+
const U = F.filter((O, j) => j !== I);
|
|
8752
8754
|
return U.length === 0 && K(), U;
|
|
8753
8755
|
});
|
|
8754
8756
|
}, [K]), G = le(
|
|
@@ -8759,8 +8761,8 @@ function sT({
|
|
|
8759
8761
|
try {
|
|
8760
8762
|
await v(F), Y(`Uploaded ${F.name} - processing through chat stream`);
|
|
8761
8763
|
} catch (U) {
|
|
8762
|
-
const
|
|
8763
|
-
V(
|
|
8764
|
+
const O = U instanceof Error ? U.message : "Failed to upload Excel file";
|
|
8765
|
+
V(O), g == null || g(O);
|
|
8764
8766
|
} finally {
|
|
8765
8767
|
$(!1), I.target.value = "", K();
|
|
8766
8768
|
}
|
|
@@ -8823,12 +8825,12 @@ function sT({
|
|
|
8823
8825
|
},
|
|
8824
8826
|
N
|
|
8825
8827
|
),
|
|
8826
|
-
|
|
8828
|
+
D && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
8827
8829
|
/* @__PURE__ */ u.jsx(Zn, { className: "h-4 w-4 animate-spin" }),
|
|
8828
8830
|
" Uploading Excel file..."
|
|
8829
8831
|
] }),
|
|
8830
|
-
H && !
|
|
8831
|
-
P && !
|
|
8832
|
+
H && !D && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: H }),
|
|
8833
|
+
P && !D && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: P })
|
|
8832
8834
|
] })
|
|
8833
8835
|
] }),
|
|
8834
8836
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
@@ -8865,9 +8867,9 @@ function sT({
|
|
|
8865
8867
|
{
|
|
8866
8868
|
onClick: () => {
|
|
8867
8869
|
var I;
|
|
8868
|
-
|
|
8870
|
+
D || (I = y.current) == null || I.click();
|
|
8869
8871
|
},
|
|
8870
|
-
className: `cursor-pointer ${
|
|
8872
|
+
className: `cursor-pointer ${D ? "opacity-60 pointer-events-none" : ""}`,
|
|
8871
8873
|
children: [
|
|
8872
8874
|
/* @__PURE__ */ u.jsx(Gg, { className: "h-4 w-4 mr-2" }),
|
|
8873
8875
|
" Upload Excel file"
|
|
@@ -9646,7 +9648,7 @@ const AT = {
|
|
|
9646
9648
|
Ce((y) => y.length > 0),
|
|
9647
9649
|
Le(g, p),
|
|
9648
9650
|
de(([y, T, E]) => {
|
|
9649
|
-
const N = y.reduce((_,
|
|
9651
|
+
const N = y.reduce((_, D, $) => Xt(_, D, go(D, T.offsetTree, E) || $), Ir());
|
|
9650
9652
|
return {
|
|
9651
9653
|
...T,
|
|
9652
9654
|
groupIndices: y,
|
|
@@ -9732,13 +9734,13 @@ const AT = {
|
|
|
9732
9734
|
de(([y, T]) => {
|
|
9733
9735
|
const E = T.groupIndices.length > 0, N = [], _ = T.lastSize;
|
|
9734
9736
|
if (E) {
|
|
9735
|
-
const
|
|
9737
|
+
const D = ho(T.sizeTree, 0);
|
|
9736
9738
|
let $ = 0, H = 0;
|
|
9737
9739
|
for (; $ < y; ) {
|
|
9738
9740
|
const P = T.groupIndices[H], V = T.groupIndices.length === H + 1 ? 1 / 0 : T.groupIndices[H + 1] - P - 1;
|
|
9739
9741
|
N.push({
|
|
9740
9742
|
endIndex: P,
|
|
9741
|
-
size:
|
|
9743
|
+
size: D,
|
|
9742
9744
|
startIndex: P
|
|
9743
9745
|
}), N.push({
|
|
9744
9746
|
endIndex: P + 1 + V - 1,
|
|
@@ -9771,10 +9773,10 @@ const AT = {
|
|
|
9771
9773
|
).ranges;
|
|
9772
9774
|
}
|
|
9773
9775
|
return Jn(T.sizeTree).reduce(
|
|
9774
|
-
(
|
|
9776
|
+
(D, { k: $, v: H }) => ({
|
|
9775
9777
|
prevIndex: $ + y,
|
|
9776
9778
|
prevSize: H,
|
|
9777
|
-
ranges: [...
|
|
9779
|
+
ranges: [...D.ranges, { endIndex: $ + y - 1, size: D.prevSize, startIndex: D.prevIndex }]
|
|
9778
9780
|
}),
|
|
9779
9781
|
{
|
|
9780
9782
|
prevIndex: 0,
|
|
@@ -9806,13 +9808,13 @@ const AT = {
|
|
|
9806
9808
|
return T;
|
|
9807
9809
|
let N = Ir();
|
|
9808
9810
|
const _ = yt(x);
|
|
9809
|
-
let
|
|
9810
|
-
for (;
|
|
9811
|
+
let D = 0, $ = 0, H = 0;
|
|
9812
|
+
for (; D < -y; ) {
|
|
9811
9813
|
H = _[$];
|
|
9812
9814
|
const Y = _[$ + 1] - H - 1;
|
|
9813
|
-
$++,
|
|
9815
|
+
$++, D += Y + 1;
|
|
9814
9816
|
}
|
|
9815
|
-
if (N = Jn(T.sizeTree).reduce((Y, { k: P, v: V }) => Xt(Y, Math.max(0, P + y), V), N),
|
|
9817
|
+
if (N = Jn(T.sizeTree).reduce((Y, { k: P, v: V }) => Xt(Y, Math.max(0, P + y), V), N), D !== -y) {
|
|
9816
9818
|
const Y = ho(T.sizeTree, H);
|
|
9817
9819
|
N = Xt(N, 0, Y);
|
|
9818
9820
|
const P = hn(T.sizeTree, -y + 1)[1];
|
|
@@ -9824,7 +9826,7 @@ const AT = {
|
|
|
9824
9826
|
...pa(T.offsetTree, 0, N, E)
|
|
9825
9827
|
};
|
|
9826
9828
|
} else {
|
|
9827
|
-
const N = Jn(T.sizeTree).reduce((_, { k:
|
|
9829
|
+
const N = Jn(T.sizeTree).reduce((_, { k: D, v: $ }) => Xt(_, Math.max(0, D + y), $), Ir());
|
|
9828
9830
|
return {
|
|
9829
9831
|
...T,
|
|
9830
9832
|
sizeTree: N,
|
|
@@ -9942,14 +9944,14 @@ const Mo = Xe(
|
|
|
9942
9944
|
Le(e, s, o),
|
|
9943
9945
|
de(
|
|
9944
9946
|
([
|
|
9945
|
-
[C, y, T, E, N, _,
|
|
9947
|
+
[C, y, T, E, N, _, D, $],
|
|
9946
9948
|
H,
|
|
9947
9949
|
Y,
|
|
9948
9950
|
P
|
|
9949
9951
|
]) => {
|
|
9950
9952
|
const V = kp(C), { align: K, behavior: z, offset: M } = V, k = E - 1, G = Cp(V, y, k);
|
|
9951
9953
|
let X = go(G, y.offsetTree, H) + _;
|
|
9952
|
-
K === "end" ? (X += Y + hn(y.sizeTree, G)[1] - T + P, G === k && (X +=
|
|
9954
|
+
K === "end" ? (X += Y + hn(y.sizeTree, G)[1] - T + P, G === k && (X += D)) : K === "center" ? X += (Y + hn(y.sizeTree, G)[1] - T + P) / 2 : X -= N, M && (X += M);
|
|
9953
9955
|
const A = (B) => {
|
|
9954
9956
|
S(), B ? ($("retrying to scroll to", { location: C }, Vt.DEBUG), _e(p, C)) : (_e(v, !0), $("list did not change, scroll successful", {}, Vt.DEBUG));
|
|
9955
9957
|
};
|
|
@@ -10076,7 +10078,7 @@ const xo = "up", ro = "down", MT = "none", OT = {
|
|
|
10076
10078
|
Q(
|
|
10077
10079
|
Rt(r, Te(s), Te(t), Te(e), Te(d)),
|
|
10078
10080
|
Tn((w, [{ scrollHeight: S, scrollTop: C }, y, T, E, N]) => {
|
|
10079
|
-
const _ = C + y - S > -N,
|
|
10081
|
+
const _ = C + y - S > -N, D = {
|
|
10080
10082
|
scrollHeight: S,
|
|
10081
10083
|
scrollTop: C,
|
|
10082
10084
|
viewportHeight: y
|
|
@@ -10087,14 +10089,14 @@ const xo = "up", ro = "down", MT = "none", OT = {
|
|
|
10087
10089
|
atBottom: !0,
|
|
10088
10090
|
atBottomBecause: H,
|
|
10089
10091
|
scrollTopDelta: Y,
|
|
10090
|
-
state:
|
|
10092
|
+
state: D
|
|
10091
10093
|
};
|
|
10092
10094
|
}
|
|
10093
10095
|
let $;
|
|
10094
|
-
return
|
|
10096
|
+
return D.scrollHeight > w.state.scrollHeight ? $ = "SIZE_INCREASED" : y < w.state.viewportHeight ? $ = "VIEWPORT_HEIGHT_DECREASING" : C < w.state.scrollTop ? $ = "SCROLLING_UPWARDS" : $ = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
|
|
10095
10097
|
atBottom: !1,
|
|
10096
10098
|
notAtBottomBecause: $,
|
|
10097
|
-
state:
|
|
10099
|
+
state: D
|
|
10098
10100
|
};
|
|
10099
10101
|
}, OT),
|
|
10100
10102
|
ft((w, S) => w && w.atBottom === S.atBottom)
|
|
@@ -10360,8 +10362,8 @@ const hr = Xe(
|
|
|
10360
10362
|
e
|
|
10361
10363
|
),
|
|
10362
10364
|
Ce(([T, E, , N, , , , , , , _]) => {
|
|
10363
|
-
const
|
|
10364
|
-
return T && !E && !
|
|
10365
|
+
const D = _ && _.length !== N;
|
|
10366
|
+
return T && !E && !D;
|
|
10365
10367
|
}),
|
|
10366
10368
|
de(
|
|
10367
10369
|
([
|
|
@@ -10370,7 +10372,7 @@ const hr = Xe(
|
|
|
10370
10372
|
[T, E],
|
|
10371
10373
|
N,
|
|
10372
10374
|
_,
|
|
10373
|
-
|
|
10375
|
+
D,
|
|
10374
10376
|
$,
|
|
10375
10377
|
H,
|
|
10376
10378
|
Y,
|
|
@@ -10381,10 +10383,10 @@ const hr = Xe(
|
|
|
10381
10383
|
if (N === 0)
|
|
10382
10384
|
return { ...Li, totalCount: N };
|
|
10383
10385
|
if (T === 0 && E === 0)
|
|
10384
|
-
return k === 0 ? { ...Li, totalCount: N } : Ip(k,
|
|
10386
|
+
return k === 0 ? { ...Li, totalCount: N } : Ip(k, D, _, Y, P, V || []);
|
|
10385
10387
|
if (it(M))
|
|
10386
10388
|
return k > 0 ? null : ls(
|
|
10387
|
-
LT(vl(
|
|
10389
|
+
LT(vl(D, N), K, V),
|
|
10388
10390
|
[],
|
|
10389
10391
|
N,
|
|
10390
10392
|
P,
|
|
@@ -10394,11 +10396,11 @@ const hr = Xe(
|
|
|
10394
10396
|
const G = [];
|
|
10395
10397
|
if (H.length > 0) {
|
|
10396
10398
|
const F = H[0], U = H[H.length - 1];
|
|
10397
|
-
let
|
|
10399
|
+
let O = 0;
|
|
10398
10400
|
for (const j of ti(M, F, U)) {
|
|
10399
10401
|
const q = j.value, J = Math.max(j.start, F), ne = Math.min(j.end, U);
|
|
10400
10402
|
for (let re = J; re <= ne; re++)
|
|
10401
|
-
G.push({ data: V == null ? void 0 : V[re], index: re, offset:
|
|
10403
|
+
G.push({ data: V == null ? void 0 : V[re], index: re, offset: O, size: q }), O += q;
|
|
10402
10404
|
}
|
|
10403
10405
|
}
|
|
10404
10406
|
if (!$)
|
|
@@ -10408,11 +10410,11 @@ const hr = Xe(
|
|
|
10408
10410
|
return null;
|
|
10409
10411
|
const B = N - 1, I = ei([], (F) => {
|
|
10410
10412
|
for (const U of A) {
|
|
10411
|
-
const
|
|
10412
|
-
let j =
|
|
10413
|
-
const J =
|
|
10414
|
-
if (
|
|
10415
|
-
q += Math.floor((T -
|
|
10413
|
+
const O = U.value;
|
|
10414
|
+
let j = O.offset, q = U.start;
|
|
10415
|
+
const J = O.size;
|
|
10416
|
+
if (O.offset < T) {
|
|
10417
|
+
q += Math.floor((T - O.offset + P) / (J + P));
|
|
10416
10418
|
const re = q - U.start;
|
|
10417
10419
|
j += re * J + re * P;
|
|
10418
10420
|
}
|
|
@@ -10556,9 +10558,9 @@ const hr = Xe(
|
|
|
10556
10558
|
Le(t, l, n, s, o, r, a),
|
|
10557
10559
|
Le(e),
|
|
10558
10560
|
de(([[f, m, p, v, g, x, b, w], S]) => {
|
|
10559
|
-
const { align: C, behavior: y, calculateViewLocation: T = FT, done: E, ...N } = f, _ = Cp(f, m, v - 1),
|
|
10561
|
+
const { align: C, behavior: y, calculateViewLocation: T = FT, done: E, ...N } = f, _ = Cp(f, m, v - 1), D = go(_, m.offsetTree, S) + g + x, $ = D + hn(m.sizeTree, _)[1], H = w + x, Y = w + p - b, P = T({
|
|
10560
10562
|
itemBottom: $,
|
|
10561
|
-
itemTop:
|
|
10563
|
+
itemTop: D,
|
|
10562
10564
|
locationParams: { align: C, behavior: y, ...N },
|
|
10563
10565
|
viewportBottom: Y,
|
|
10564
10566
|
viewportTop: H
|
|
@@ -10612,9 +10614,9 @@ const BT = (e, t) => typeof e == "function" ? cu(e(t)) : t && cu(e), zT = Xe(
|
|
|
10612
10614
|
Q(
|
|
10613
10615
|
Rt(Q(Te(t), ir(1)), l),
|
|
10614
10616
|
Le(Te(v), s, a, f),
|
|
10615
|
-
de(([[y, T], E, N, _,
|
|
10617
|
+
de(([[y, T], E, N, _, D]) => {
|
|
10616
10618
|
let $ = T && _, H = "auto";
|
|
10617
|
-
return $ && (H = BT(E, N ||
|
|
10619
|
+
return $ && (H = BT(E, N || D), $ = $ && !!H), { followOutputBehavior: H, shouldFollow: $, totalCount: y };
|
|
10618
10620
|
}),
|
|
10619
10621
|
Ce(({ shouldFollow: y }) => y)
|
|
10620
10622
|
),
|
|
@@ -10668,7 +10670,7 @@ const BT = (e, t) => typeof e == "function" ? cu(e(t)) : t && cu(e), zT = Xe(
|
|
|
10668
10670
|
Q(
|
|
10669
10671
|
Rt(Q(C, ir(1)), l),
|
|
10670
10672
|
Le(Te(S), a, f, m),
|
|
10671
|
-
de(([[y, T], E, N, _,
|
|
10673
|
+
de(([[y, T], E, N, _, D]) => T && N && (E == null ? void 0 : E({ context: D, totalCount: y, scrollingInProgress: _ }))),
|
|
10672
10674
|
Ce((y) => !!y),
|
|
10673
10675
|
Nn(0)
|
|
10674
10676
|
),
|
|
@@ -10864,8 +10866,8 @@ const qT = Pp(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10864
10866
|
Tn(
|
|
10865
10867
|
([, b, w, S], [{ bottom: C, items: y, offsetBottom: T, totalCount: E }, N]) => {
|
|
10866
10868
|
const _ = C + T;
|
|
10867
|
-
let
|
|
10868
|
-
return w === E && b.length > 0 && y.length > 0 && (y[0].originalIndex === 0 && b[0].originalIndex === 0 || (
|
|
10869
|
+
let D = 0;
|
|
10870
|
+
return w === E && b.length > 0 && y.length > 0 && (y[0].originalIndex === 0 && b[0].originalIndex === 0 || (D = _ - S, D !== 0 && (D += N))), [D, y, E, _];
|
|
10869
10871
|
},
|
|
10870
10872
|
[0, [], 0, 0]
|
|
10871
10873
|
),
|
|
@@ -10907,11 +10909,11 @@ const qT = Pp(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10907
10909
|
{
|
|
10908
10910
|
let E = 0;
|
|
10909
10911
|
const N = ho(C, 0);
|
|
10910
|
-
let _ = 0,
|
|
10912
|
+
let _ = 0, D = 0;
|
|
10911
10913
|
for (; _ < b; ) {
|
|
10912
10914
|
_++, E += N;
|
|
10913
|
-
let $ = w.length ===
|
|
10914
|
-
_ + $ > b && (E -= N, $ = b - _ + 1), _ += $, E += T($),
|
|
10915
|
+
let $ = w.length === D + 1 ? 1 / 0 : w[D + 1] - w[D] - 1;
|
|
10916
|
+
_ + $ > b && (E -= N, $ = b - _ + 1), _ += $, E += T($), D++;
|
|
10915
10917
|
}
|
|
10916
10918
|
return E;
|
|
10917
10919
|
}
|
|
@@ -10995,7 +10997,7 @@ const qT = Pp(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10995
10997
|
]) => (ve(C.rangeChanged, _.scrollSeekRangeChanged), ve(
|
|
10996
10998
|
Q(
|
|
10997
10999
|
_.windowViewportRect,
|
|
10998
|
-
de((
|
|
11000
|
+
de((D) => D.visibleHeight)
|
|
10999
11001
|
),
|
|
11000
11002
|
g.viewportHeight
|
|
11001
11003
|
), {
|
|
@@ -11241,7 +11243,7 @@ const ZT = /* @__PURE__ */ Xe(() => {
|
|
|
11241
11243
|
Tl("deviation", (P) => {
|
|
11242
11244
|
b !== P && w(P);
|
|
11243
11245
|
});
|
|
11244
|
-
const S = Re("EmptyPlaceholder"), C = Re("ScrollSeekPlaceholder") || eC, y = Re("ListComponent"), T = Re("ItemComponent"), E = Re("GroupComponent"), N = Re("computeItemKey"), _ = Re("isSeeking"),
|
|
11246
|
+
const S = Re("EmptyPlaceholder"), C = Re("ScrollSeekPlaceholder") || eC, y = Re("ListComponent"), T = Re("ItemComponent"), E = Re("GroupComponent"), N = Re("computeItemKey"), _ = Re("isSeeking"), D = Re("groupIndices").length > 0, $ = Re("alignToBottom"), H = Re("initialItemFinalLocationReached"), Y = e ? {} : {
|
|
11245
11247
|
boxSizing: "border-box",
|
|
11246
11248
|
...g ? {
|
|
11247
11249
|
display: "inline-block",
|
|
@@ -11299,7 +11301,7 @@ const ZT = /* @__PURE__ */ Xe(() => {
|
|
|
11299
11301
|
key: K,
|
|
11300
11302
|
style: g ? nC : Bp
|
|
11301
11303
|
},
|
|
11302
|
-
|
|
11304
|
+
D ? l(P.index, P.groupIndex, P.data, c) : l(P.index, P.data, c)
|
|
11303
11305
|
);
|
|
11304
11306
|
})
|
|
11305
11307
|
}
|
|
@@ -11584,7 +11586,7 @@ const yC = /* @__PURE__ */ Xe(
|
|
|
11584
11586
|
{ customScrollParent: x, useWindowScroll: b, windowScrollContainerState: w, windowScrollTo: S, windowViewportRect: C },
|
|
11585
11587
|
y
|
|
11586
11588
|
]) => {
|
|
11587
|
-
const T = oe(0), E = oe(0), N = oe(fu), _ = oe({ height: 0, width: 0 }),
|
|
11589
|
+
const T = oe(0), E = oe(0), N = oe(fu), _ = oe({ height: 0, width: 0 }), D = oe({ height: 0, width: 0 }), $ = Ue(), H = Ue(), Y = oe(0), P = oe(null), V = oe({ column: 0, row: 0 }), K = Ue(), z = Ue(), M = oe(!1), k = oe(0), G = oe(!0), X = oe(!1), A = oe(!1);
|
|
11588
11590
|
et(
|
|
11589
11591
|
Q(
|
|
11590
11592
|
v,
|
|
@@ -11596,7 +11598,7 @@ const yC = /* @__PURE__ */ Xe(
|
|
|
11596
11598
|
}
|
|
11597
11599
|
), et(
|
|
11598
11600
|
Q(
|
|
11599
|
-
Rt(v, G,
|
|
11601
|
+
Rt(v, G, D, _, k, X),
|
|
11600
11602
|
Ce(([j, q, J, ne, , re]) => j && !q && J.height !== 0 && ne.height !== 0 && !re)
|
|
11601
11603
|
),
|
|
11602
11604
|
([, , , , j]) => {
|
|
@@ -11620,7 +11622,7 @@ const yC = /* @__PURE__ */ Xe(
|
|
|
11620
11622
|
Ce(([, j]) => j != null)
|
|
11621
11623
|
),
|
|
11622
11624
|
([, j]) => {
|
|
11623
|
-
j && (_e(_, j.viewport), _e(
|
|
11625
|
+
j && (_e(_, j.viewport), _e(D, j.item), _e(V, j.gap), j.scrollTop > 0 && (_e(M, !0), dn(Q(c, ir(1)), (q) => {
|
|
11624
11626
|
_e(M, !1);
|
|
11625
11627
|
}), _e(l, { top: j.scrollTop })));
|
|
11626
11628
|
}
|
|
@@ -11634,7 +11636,7 @@ const yC = /* @__PURE__ */ Xe(
|
|
|
11634
11636
|
Q(
|
|
11635
11637
|
Rt(
|
|
11636
11638
|
Te(_, Yo),
|
|
11637
|
-
Te(
|
|
11639
|
+
Te(D, Yo),
|
|
11638
11640
|
Te(V, (j, q) => j && j.column === q.column && j.row === q.row),
|
|
11639
11641
|
Te(c)
|
|
11640
11642
|
),
|
|
@@ -11652,7 +11654,7 @@ const yC = /* @__PURE__ */ Xe(
|
|
|
11652
11654
|
Te(T),
|
|
11653
11655
|
r,
|
|
11654
11656
|
Te(V, bC),
|
|
11655
|
-
Te(
|
|
11657
|
+
Te(D, Yo),
|
|
11656
11658
|
Te(_, Yo),
|
|
11657
11659
|
Te(P),
|
|
11658
11660
|
Te(E),
|
|
@@ -11699,7 +11701,7 @@ const yC = /* @__PURE__ */ Xe(
|
|
|
11699
11701
|
T
|
|
11700
11702
|
), ve(
|
|
11701
11703
|
Q(
|
|
11702
|
-
Rt(_,
|
|
11704
|
+
Rt(_, D, N, V),
|
|
11703
11705
|
Ce(([j, q, { items: J }]) => J.length > 0 && q.height !== 0 && j.height !== 0),
|
|
11704
11706
|
de(([j, q, { items: J }, ne]) => {
|
|
11705
11707
|
const { bottom: re, top: se } = gu(j, ne, q, J);
|
|
@@ -11753,7 +11755,7 @@ const yC = /* @__PURE__ */ Xe(
|
|
|
11753
11755
|
ve(U, p.scrollSeekRangeChanged), ve(
|
|
11754
11756
|
Q(
|
|
11755
11757
|
$,
|
|
11756
|
-
Le(_,
|
|
11758
|
+
Le(_, D, T, V),
|
|
11757
11759
|
de(([j, q, J, ne, re]) => {
|
|
11758
11760
|
const se = kp(j), { align: ae, behavior: be, offset: Oe } = se;
|
|
11759
11761
|
let We = se.index;
|
|
@@ -11764,7 +11766,7 @@ const yC = /* @__PURE__ */ Xe(
|
|
|
11764
11766
|
),
|
|
11765
11767
|
l
|
|
11766
11768
|
);
|
|
11767
|
-
const
|
|
11769
|
+
const O = Ot(
|
|
11768
11770
|
Q(
|
|
11769
11771
|
N,
|
|
11770
11772
|
de((j) => j.offsetBottom + j.bottom)
|
|
@@ -11787,7 +11789,7 @@ const yC = /* @__PURE__ */ Xe(
|
|
|
11787
11789
|
headerHeight: s,
|
|
11788
11790
|
increaseViewportBy: e,
|
|
11789
11791
|
initialItemCount: E,
|
|
11790
|
-
itemDimensions:
|
|
11792
|
+
itemDimensions: D,
|
|
11791
11793
|
overscan: n,
|
|
11792
11794
|
restoreStateFrom: z,
|
|
11793
11795
|
scrollBy: i,
|
|
@@ -11808,7 +11810,7 @@ const yC = /* @__PURE__ */ Xe(
|
|
|
11808
11810
|
gridState: N,
|
|
11809
11811
|
horizontalDirection: A,
|
|
11810
11812
|
initialTopMostItemIndex: k,
|
|
11811
|
-
totalListHeight:
|
|
11813
|
+
totalListHeight: O,
|
|
11812
11814
|
...m,
|
|
11813
11815
|
endReached: I,
|
|
11814
11816
|
propsReady: g,
|
|
@@ -14710,9 +14712,9 @@ const IE = {
|
|
|
14710
14712
|
toolRenderers: C,
|
|
14711
14713
|
toolArtifactRenderers: y
|
|
14712
14714
|
}) {
|
|
14713
|
-
const T = Sh(t, n), E = t.role === "default_message", _ = !!t.__syntheticStreaming,
|
|
14714
|
-
() => ux(t.id, $,
|
|
14715
|
-
[t.id, $,
|
|
14715
|
+
const T = Sh(t, n), E = t.role === "default_message", _ = !!t.__syntheticStreaming, D = b ?? IE, $ = !E && "checkpointId" in t ? t.checkpointId ?? null : null, { attemptCount: H, attemptIndex: Y, attempts: P } = Be(
|
|
14716
|
+
() => ux(t.id, $, D),
|
|
14717
|
+
[t.id, $, D]
|
|
14716
14718
|
), V = S == null ? void 0 : S(t);
|
|
14717
14719
|
return /* @__PURE__ */ u.jsx(
|
|
14718
14720
|
"div",
|
|
@@ -14801,7 +14803,7 @@ function AE({
|
|
|
14801
14803
|
isUserExpanded: E,
|
|
14802
14804
|
setIsUserExpanded: N,
|
|
14803
14805
|
isCompactLayout: _,
|
|
14804
|
-
activeInterruptId:
|
|
14806
|
+
activeInterruptId: D,
|
|
14805
14807
|
activeInterruptValue: $,
|
|
14806
14808
|
iconForeground: H,
|
|
14807
14809
|
toolRenderers: Y,
|
|
@@ -14830,34 +14832,34 @@ function AE({
|
|
|
14830
14832
|
};
|
|
14831
14833
|
}, [k, m]), X = Be(() => {
|
|
14832
14834
|
if (!G) return null;
|
|
14833
|
-
const { stablePart: U, tailPart:
|
|
14834
|
-
return !U && !
|
|
14835
|
+
const { stablePart: U, tailPart: O } = G;
|
|
14836
|
+
return !U && !O ? null : /* @__PURE__ */ u.jsxs("div", { className: "space-y-2", children: [
|
|
14835
14837
|
U ? /* @__PURE__ */ u.jsx(Nr, { content: U, allowHtml: !1 }) : null,
|
|
14836
|
-
|
|
14838
|
+
O ? /* @__PURE__ */ u.jsx(Nr, { content: O, allowHtml: !1 }) : null
|
|
14837
14839
|
] });
|
|
14838
14840
|
}, [G]), A = Be(() => {
|
|
14839
14841
|
if (!m)
|
|
14840
14842
|
return z;
|
|
14841
14843
|
const U = [];
|
|
14842
|
-
let
|
|
14844
|
+
let O = !1;
|
|
14843
14845
|
for (const j of z) {
|
|
14844
14846
|
if (j.type === "text") {
|
|
14845
|
-
|
|
14847
|
+
O || (U.push({
|
|
14846
14848
|
type: "text",
|
|
14847
14849
|
text: "",
|
|
14848
14850
|
__streamingMarkdownAggregate: !0
|
|
14849
|
-
}),
|
|
14851
|
+
}), O = !0);
|
|
14850
14852
|
continue;
|
|
14851
14853
|
}
|
|
14852
14854
|
U.push(j);
|
|
14853
14855
|
}
|
|
14854
14856
|
return U;
|
|
14855
|
-
}, [z, m]), B = m ? A : z, I = le(({ part: U, i:
|
|
14857
|
+
}, [z, m]), B = m ? A : z, I = le(({ part: U, i: O }) => {
|
|
14856
14858
|
if (U.type === "text") {
|
|
14857
14859
|
if (m)
|
|
14858
14860
|
return null;
|
|
14859
14861
|
const j = U.text ?? "", q = j.trim(), J = Io(q);
|
|
14860
|
-
return J && C !== "tool" ? /* @__PURE__ */ u.jsx(ma, { data: J },
|
|
14862
|
+
return J && C !== "tool" ? /* @__PURE__ */ u.jsx(ma, { data: J }, O) : C === "user" && y && q.length > T ? /* @__PURE__ */ u.jsx(
|
|
14861
14863
|
bE,
|
|
14862
14864
|
{
|
|
14863
14865
|
text: q,
|
|
@@ -14866,8 +14868,8 @@ function AE({
|
|
|
14866
14868
|
previewLength: T,
|
|
14867
14869
|
isCompact: _
|
|
14868
14870
|
},
|
|
14869
|
-
|
|
14870
|
-
) : /* @__PURE__ */ u.jsx(Nr, { content: j, allowHtml: !1 },
|
|
14871
|
+
O
|
|
14872
|
+
) : /* @__PURE__ */ u.jsx(Nr, { content: j, allowHtml: !1 }, O);
|
|
14871
14873
|
}
|
|
14872
14874
|
if (U.type === "image_url") {
|
|
14873
14875
|
const j = U;
|
|
@@ -14879,7 +14881,7 @@ function AE({
|
|
|
14879
14881
|
loading: "lazy",
|
|
14880
14882
|
className: "border rounded max-h-[420px] w-auto object-contain"
|
|
14881
14883
|
}
|
|
14882
|
-
) },
|
|
14884
|
+
) }, O);
|
|
14883
14885
|
}
|
|
14884
14886
|
if (U.type === "file") {
|
|
14885
14887
|
const j = U, q = j.name || "file";
|
|
@@ -14887,24 +14889,24 @@ function AE({
|
|
|
14887
14889
|
"a",
|
|
14888
14890
|
{
|
|
14889
14891
|
href: j.url,
|
|
14890
|
-
onClick: (J) => v(J, j,
|
|
14892
|
+
onClick: (J) => v(J, j, O),
|
|
14891
14893
|
className: `inline-flex items-center gap-2 rounded px-2 py-1 text-xs bg-gray-100 border hover:bg-gray-200
|
|
14892
14894
|
dark:bg-background/10 dark:border-border/30 dark:hover:bg-background/20`,
|
|
14893
14895
|
children: [
|
|
14894
|
-
g[
|
|
14896
|
+
g[O] ? /* @__PURE__ */ u.jsx(fs, { className: "h-4 w-4 animate-spin" }) : null,
|
|
14895
14897
|
/* @__PURE__ */ u.jsxs("span", { className: "truncate max-w-[180px]", children: [
|
|
14896
14898
|
q,
|
|
14897
|
-
g[
|
|
14899
|
+
g[O] ? " (processing)" : ""
|
|
14898
14900
|
] })
|
|
14899
14901
|
]
|
|
14900
14902
|
},
|
|
14901
|
-
|
|
14903
|
+
O
|
|
14902
14904
|
);
|
|
14903
14905
|
}
|
|
14904
14906
|
if (U.type === "interrupt") {
|
|
14905
14907
|
const j = U, q = ta(
|
|
14906
14908
|
(j == null ? void 0 : j.id) ?? (j == null ? void 0 : j.interrupt_id)
|
|
14907
|
-
), J = !!(
|
|
14909
|
+
), J = !!(D && q && q === D), ne = J ? $ ?? (j == null ? void 0 : j.value) : j == null ? void 0 : j.value, re = q ? { ...j, id: q, interrupt_id: q } : j;
|
|
14908
14910
|
return /* @__PURE__ */ u.jsx(
|
|
14909
14911
|
vE,
|
|
14910
14912
|
{
|
|
@@ -14916,12 +14918,12 @@ function AE({
|
|
|
14916
14918
|
isActive: J,
|
|
14917
14919
|
payload: ne
|
|
14918
14920
|
},
|
|
14919
|
-
|
|
14921
|
+
O
|
|
14920
14922
|
);
|
|
14921
14923
|
}
|
|
14922
14924
|
return null;
|
|
14923
14925
|
}, [
|
|
14924
|
-
|
|
14926
|
+
D,
|
|
14925
14927
|
$,
|
|
14926
14928
|
S,
|
|
14927
14929
|
v,
|
|
@@ -14954,7 +14956,7 @@ function AE({
|
|
|
14954
14956
|
e.id
|
|
14955
14957
|
) : null;
|
|
14956
14958
|
if (!p) {
|
|
14957
|
-
const U = /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: B.map((
|
|
14959
|
+
const U = /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: B.map((O, j) => m && _E(O) ? X ? /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: X }, `streaming-md-${j}`) : null : /* @__PURE__ */ u.jsx(I, { part: O, i: j }, j)) });
|
|
14958
14960
|
return d ? /* @__PURE__ */ u.jsxs("div", { "aria-busy": "true", role: "status", children: [
|
|
14959
14961
|
U,
|
|
14960
14962
|
/* @__PURE__ */ u.jsx(wE, { className: H })
|
|
@@ -15189,12 +15191,12 @@ const Ol = Lg(function({
|
|
|
15189
15191
|
onInterruptActionStart: E,
|
|
15190
15192
|
onInterruptActionEnd: N,
|
|
15191
15193
|
attemptCount: _ = 1,
|
|
15192
|
-
attemptIndex:
|
|
15194
|
+
attemptIndex: D = 0,
|
|
15193
15195
|
onSelectCheckpoint: $,
|
|
15194
15196
|
attemptMetas: H = []
|
|
15195
15197
|
}) {
|
|
15196
15198
|
const [Y, P] = pe(!1), [V, K] = pe("preview"), [z, M] = pe(!1), { currentThreadId: k } = Ro(), { respondToInterrupt: G } = Fs(), X = l === "phone" || l === "half-screen", A = t.role, B = A === "tool", I = Be(() => t.role === "default_message" ? t : null, [t]), F = !!I, U = !(r && A !== "user"), {
|
|
15197
|
-
uploadingFiles:
|
|
15199
|
+
uploadingFiles: O,
|
|
15198
15200
|
handleFileClick: j,
|
|
15199
15201
|
fileViewerOpen: q,
|
|
15200
15202
|
currentFileInfo: J,
|
|
@@ -15371,7 +15373,7 @@ const Ol = Lg(function({
|
|
|
15371
15373
|
enableStreamingMarkdownBuffer: Ct,
|
|
15372
15374
|
renderStreamingMarkdown: x,
|
|
15373
15375
|
handleFileClick: j,
|
|
15374
|
-
uploadingFiles:
|
|
15376
|
+
uploadingFiles: O,
|
|
15375
15377
|
handleInterruptApprove: wt,
|
|
15376
15378
|
handleInterruptReject: Qt,
|
|
15377
15379
|
handleInterruptAlternative: At,
|
|
@@ -15388,7 +15390,7 @@ const Ol = Lg(function({
|
|
|
15388
15390
|
toolRenderers: m,
|
|
15389
15391
|
toolArtifactRenderers: p
|
|
15390
15392
|
}
|
|
15391
|
-
), Gt = Be(() => I ? "Assistant" : Sw(t), [I, t]), Ye = rt(), Ke = A === "user" && (_ ?? 1) > 1 && typeof $ == "function", Et = (H == null ? void 0 : H.length) ?? 0, Z = Et > 0 &&
|
|
15393
|
+
), Gt = Be(() => I ? "Assistant" : Sw(t), [I, t]), Ye = rt(), Ke = A === "user" && (_ ?? 1) > 1 && typeof $ == "function", Et = (H == null ? void 0 : H.length) ?? 0, Z = Et > 0 && D < Et - 1 ? H[D + 1] : void 0, he = Et > 0 && D > 0 ? H[D - 1] : void 0, ot = le(() => {
|
|
15392
15394
|
!Z || !$ || $(Z.id, void 0, !!Z.isLatestAttempt);
|
|
15393
15395
|
}, [Z, $]), ge = le(() => {
|
|
15394
15396
|
!he || !$ || $(he.id, void 0, !!he.isLatestAttempt);
|
|
@@ -15430,7 +15432,7 @@ const Ol = Lg(function({
|
|
|
15430
15432
|
onRegenerate: gt,
|
|
15431
15433
|
showCheckpointControls: Ke,
|
|
15432
15434
|
attemptCount: _,
|
|
15433
|
-
attemptIndex:
|
|
15435
|
+
attemptIndex: D,
|
|
15434
15436
|
handleOlderAttemptSelect: ot,
|
|
15435
15437
|
handleNewerAttemptSelect: ge,
|
|
15436
15438
|
messageCreatedAt: t.createdAt,
|
|
@@ -15550,7 +15552,7 @@ const Eh = L.forwardRef(({
|
|
|
15550
15552
|
toolRenderers: E,
|
|
15551
15553
|
toolArtifactRenderers: N,
|
|
15552
15554
|
checkpointIndex: _,
|
|
15553
|
-
activeCheckpointId:
|
|
15555
|
+
activeCheckpointId: D,
|
|
15554
15556
|
onSelectCheckpoint: $,
|
|
15555
15557
|
createSyntheticThinkingMessage: H = !0,
|
|
15556
15558
|
forceSyntheticThinking: Y = !1,
|
|
@@ -15607,7 +15609,7 @@ const Eh = L.forwardRef(({
|
|
|
15607
15609
|
}
|
|
15608
15610
|
}
|
|
15609
15611
|
};
|
|
15610
|
-
}, [a]),
|
|
15612
|
+
}, [a]), O = Be(() => !v || g ? !1 : "auto", [v, g]), j = Be(() => {
|
|
15611
15613
|
if (typeof p != "string") return null;
|
|
15612
15614
|
const se = p.trim();
|
|
15613
15615
|
return !se || I && I.length > 0 ? null : {
|
|
@@ -15686,7 +15688,7 @@ const Eh = L.forwardRef(({
|
|
|
15686
15688
|
z.current = se instanceof HTMLDivElement ? se : null;
|
|
15687
15689
|
},
|
|
15688
15690
|
data: I,
|
|
15689
|
-
followOutput:
|
|
15691
|
+
followOutput: O,
|
|
15690
15692
|
overscan: 200,
|
|
15691
15693
|
increaseViewportBy: { top: 100, bottom: 200 },
|
|
15692
15694
|
defaultItemHeight: 80,
|
|
@@ -15719,7 +15721,7 @@ const Eh = L.forwardRef(({
|
|
|
15719
15721
|
toolRenderers: E,
|
|
15720
15722
|
toolArtifactRenderers: N,
|
|
15721
15723
|
checkpointIndex: _,
|
|
15722
|
-
activeCheckpointId:
|
|
15724
|
+
activeCheckpointId: D,
|
|
15723
15725
|
onSelectCheckpoint: $,
|
|
15724
15726
|
getMessageCustomStyles: P
|
|
15725
15727
|
}
|
|
@@ -15757,14 +15759,14 @@ function io({
|
|
|
15757
15759
|
threadId: E,
|
|
15758
15760
|
messages: N,
|
|
15759
15761
|
isLoading: _,
|
|
15760
|
-
navigateToCheckpoint:
|
|
15762
|
+
navigateToCheckpoint: D,
|
|
15761
15763
|
returnToLatest: $,
|
|
15762
15764
|
checkpoint: H,
|
|
15763
15765
|
checkpoints: Y,
|
|
15764
15766
|
interrupt: P,
|
|
15765
15767
|
metadata: V,
|
|
15766
15768
|
checkpointIndex: K
|
|
15767
|
-
} = Fs(), { isStreaming: z, error: M, connectionState: k, submit: G, stop: X } = Hw(), A = E ?? T ?? null, B = (H == null ? void 0 : H.id) ?? null, I = (H == null ? void 0 : H.namespace) ?? null, F = (V == null ? void 0 : V.assemblingMessageId) ?? null, U = P, [
|
|
15769
|
+
} = Fs(), { isStreaming: z, error: M, connectionState: k, submit: G, stop: X } = Hw(), A = E ?? T ?? null, B = (H == null ? void 0 : H.id) ?? null, I = (H == null ? void 0 : H.namespace) ?? null, F = (V == null ? void 0 : V.assemblingMessageId) ?? null, U = P, [O, j] = pe(!1), [q, J] = pe(!1);
|
|
15768
15770
|
Qe(() => {
|
|
15769
15771
|
U || j(!1);
|
|
15770
15772
|
}, [U]);
|
|
@@ -15772,7 +15774,7 @@ function io({
|
|
|
15772
15774
|
j(!0);
|
|
15773
15775
|
}, []), re = le(() => {
|
|
15774
15776
|
j(!1);
|
|
15775
|
-
}, []), se = !!U ||
|
|
15777
|
+
}, []), se = !!U || O, [ae, be] = pe(null), [Oe, We] = pe(""), [je, Fe] = pe(null), [ut, mt] = pe(null), [Ct, Ge] = pe(!1), [Je, Ve] = pe(null), De = Pe(!1), [Ne, gt] = pe(() => ku.value), jt = Pe(Ne), rt = Pe(null), lt = le((Se) => {
|
|
15776
15778
|
ku.value = Se, gt(Se);
|
|
15777
15779
|
}, []), [vt, dt] = pe(!1), wt = Pe(null), Qt = le(
|
|
15778
15780
|
(Se) => {
|
|
@@ -15907,7 +15909,7 @@ function io({
|
|
|
15907
15909
|
return;
|
|
15908
15910
|
}
|
|
15909
15911
|
const Ie = Y.find((xe) => xe.checkpointId === Se), ze = (Ie == null ? void 0 : Ie.checkpointNs) ?? null;
|
|
15910
|
-
await
|
|
15912
|
+
await D(Se, ze), requestAnimationFrame(() => {
|
|
15911
15913
|
var xe;
|
|
15912
15914
|
(xe = wt.current) == null || xe.scrollToTop();
|
|
15913
15915
|
});
|
|
@@ -15920,7 +15922,7 @@ function io({
|
|
|
15920
15922
|
Y,
|
|
15921
15923
|
T,
|
|
15922
15924
|
wt,
|
|
15923
|
-
|
|
15925
|
+
D,
|
|
15924
15926
|
$
|
|
15925
15927
|
]
|
|
15926
15928
|
), ge = le(
|
|
@@ -15970,7 +15972,7 @@ function io({
|
|
|
15970
15972
|
emptyMessage: Je ?? void 0,
|
|
15971
15973
|
isNavigatingCheckpoint: vt,
|
|
15972
15974
|
activeInterrupt: U,
|
|
15973
|
-
disableInterruptActions:
|
|
15975
|
+
disableInterruptActions: O,
|
|
15974
15976
|
onInterruptActionStart: ne,
|
|
15975
15977
|
onInterruptActionEnd: re,
|
|
15976
15978
|
showToolMessages: d,
|
|
@@ -16072,9 +16074,9 @@ var Qr = '[cmdk-group=""]', Vi = '[cmdk-group-items=""]', VE = '[cmdk-group-head
|
|
|
16072
16074
|
T(6, Y);
|
|
16073
16075
|
}, []);
|
|
16074
16076
|
let E = h.useMemo(() => ({ subscribe: (A) => (i.current.add(A), () => i.current.delete(A)), snapshot: () => n.current, setState: (A, B, I) => {
|
|
16075
|
-
var F, U,
|
|
16077
|
+
var F, U, O, j;
|
|
16076
16078
|
if (!Object.is(n.current[A], B)) {
|
|
16077
|
-
if (n.current[A] = B, A === "search") H(),
|
|
16079
|
+
if (n.current[A] = B, A === "search") H(), D(), T(1, $);
|
|
16078
16080
|
else if (A === "value") {
|
|
16079
16081
|
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
16080
16082
|
let q = document.getElementById(C);
|
|
@@ -16085,7 +16087,7 @@ var Qr = '[cmdk-group=""]', Vi = '[cmdk-group-items=""]', VE = '[cmdk-group-head
|
|
|
16085
16087
|
n.current.selectedItemId = (q = P()) == null ? void 0 : q.id, E.emit();
|
|
16086
16088
|
}), I || T(5, Y), ((U = a.current) == null ? void 0 : U.value) !== void 0) {
|
|
16087
16089
|
let q = B ?? "";
|
|
16088
|
-
(j = (
|
|
16090
|
+
(j = (O = a.current).onValueChange) == null || j.call(O, q);
|
|
16089
16091
|
return;
|
|
16090
16092
|
}
|
|
16091
16093
|
}
|
|
@@ -16096,10 +16098,10 @@ var Qr = '[cmdk-group=""]', Vi = '[cmdk-group-items=""]', VE = '[cmdk-group-head
|
|
|
16096
16098
|
} }), []), N = h.useMemo(() => ({ value: (A, B, I) => {
|
|
16097
16099
|
var F;
|
|
16098
16100
|
B !== ((F = s.current.get(A)) == null ? void 0 : F.value) && (s.current.set(A, { value: B, keywords: I }), n.current.filtered.items.set(A, _(B, I)), T(2, () => {
|
|
16099
|
-
|
|
16101
|
+
D(), E.emit();
|
|
16100
16102
|
}));
|
|
16101
16103
|
}, item: (A, B) => (r.current.add(A), B && (o.current.has(B) ? o.current.get(B).add(A) : o.current.set(B, /* @__PURE__ */ new Set([A]))), T(3, () => {
|
|
16102
|
-
H(),
|
|
16104
|
+
H(), D(), n.current.value || $(), E.emit();
|
|
16103
16105
|
}), () => {
|
|
16104
16106
|
s.current.delete(A), r.current.delete(A), n.current.filtered.items.delete(A);
|
|
16105
16107
|
let I = P();
|
|
@@ -16114,28 +16116,28 @@ var Qr = '[cmdk-group=""]', Vi = '[cmdk-group-items=""]', VE = '[cmdk-group-head
|
|
|
16114
16116
|
let U = (F = (I = a.current) == null ? void 0 : I.filter) != null ? F : KE;
|
|
16115
16117
|
return A ? U(A, n.current.search, B) : 0;
|
|
16116
16118
|
}
|
|
16117
|
-
function
|
|
16119
|
+
function D() {
|
|
16118
16120
|
if (!n.current.search || a.current.shouldFilter === !1) return;
|
|
16119
16121
|
let A = n.current.filtered.items, B = [];
|
|
16120
16122
|
n.current.filtered.groups.forEach((F) => {
|
|
16121
|
-
let U = o.current.get(F),
|
|
16123
|
+
let U = o.current.get(F), O = 0;
|
|
16122
16124
|
U.forEach((j) => {
|
|
16123
16125
|
let q = A.get(j);
|
|
16124
|
-
|
|
16125
|
-
}), B.push([F,
|
|
16126
|
+
O = Math.max(q, O);
|
|
16127
|
+
}), B.push([F, O]);
|
|
16126
16128
|
});
|
|
16127
16129
|
let I = y.current;
|
|
16128
16130
|
V().sort((F, U) => {
|
|
16129
|
-
var
|
|
16131
|
+
var O, j;
|
|
16130
16132
|
let q = F.getAttribute("id"), J = U.getAttribute("id");
|
|
16131
|
-
return ((
|
|
16133
|
+
return ((O = A.get(J)) != null ? O : 0) - ((j = A.get(q)) != null ? j : 0);
|
|
16132
16134
|
}).forEach((F) => {
|
|
16133
16135
|
let U = F.closest(Vi);
|
|
16134
16136
|
U ? U.appendChild(F.parentElement === U ? F : F.closest(`${Vi} > *`)) : I.appendChild(F.parentElement === I ? F : F.closest(`${Vi} > *`));
|
|
16135
16137
|
}), B.sort((F, U) => U[1] - F[1]).forEach((F) => {
|
|
16136
16138
|
var U;
|
|
16137
|
-
let
|
|
16138
|
-
|
|
16139
|
+
let O = (U = y.current) == null ? void 0 : U.querySelector(`${Qr}[${Sr}="${encodeURIComponent(F[0])}"]`);
|
|
16140
|
+
O == null || O.parentElement.appendChild(O);
|
|
16139
16141
|
});
|
|
16140
16142
|
}
|
|
16141
16143
|
function $() {
|
|
@@ -16150,12 +16152,12 @@ var Qr = '[cmdk-group=""]', Vi = '[cmdk-group-items=""]', VE = '[cmdk-group-head
|
|
|
16150
16152
|
}
|
|
16151
16153
|
n.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
16152
16154
|
let U = 0;
|
|
16153
|
-
for (let
|
|
16154
|
-
let j = (B = (A = s.current.get(
|
|
16155
|
-
n.current.filtered.items.set(
|
|
16155
|
+
for (let O of r.current) {
|
|
16156
|
+
let j = (B = (A = s.current.get(O)) == null ? void 0 : A.value) != null ? B : "", q = (F = (I = s.current.get(O)) == null ? void 0 : I.keywords) != null ? F : [], J = _(j, q);
|
|
16157
|
+
n.current.filtered.items.set(O, J), J > 0 && U++;
|
|
16156
16158
|
}
|
|
16157
|
-
for (let [
|
|
16158
|
-
n.current.filtered.groups.add(
|
|
16159
|
+
for (let [O, j] of o.current) for (let q of j) if (n.current.filtered.items.get(q) > 0) {
|
|
16160
|
+
n.current.filtered.groups.add(O);
|
|
16159
16161
|
break;
|
|
16160
16162
|
}
|
|
16161
16163
|
n.current.filtered.count = U;
|
|
@@ -16179,8 +16181,8 @@ var Qr = '[cmdk-group=""]', Vi = '[cmdk-group-items=""]', VE = '[cmdk-group-head
|
|
|
16179
16181
|
}
|
|
16180
16182
|
function z(A) {
|
|
16181
16183
|
var B;
|
|
16182
|
-
let I = P(), F = V(), U = F.findIndex((j) => j === I),
|
|
16183
|
-
(B = a.current) != null && B.loop && (
|
|
16184
|
+
let I = P(), F = V(), U = F.findIndex((j) => j === I), O = F[U + A];
|
|
16185
|
+
(B = a.current) != null && B.loop && (O = U + A < 0 ? F[F.length - 1] : U + A === F.length ? F[0] : F[U + A]), O && E.setState("value", O.getAttribute(Sr));
|
|
16184
16186
|
}
|
|
16185
16187
|
function M(A) {
|
|
16186
16188
|
let B = P(), I = B == null ? void 0 : B.closest(Qr), F;
|
|
@@ -16442,13 +16444,13 @@ var Ll = "ScrollArea", [Bh, _N] = gn(Ll), [lk, an] = Bh(Ll), zh = h.forwardRef(
|
|
|
16442
16444
|
dir: o,
|
|
16443
16445
|
scrollHideDelay: s = 600,
|
|
16444
16446
|
...i
|
|
16445
|
-
} = e, [a, l] = h.useState(null), [c, d] = h.useState(null), [f, m] = h.useState(null), [p, v] = h.useState(null), [g, x] = h.useState(null), [b, w] = h.useState(0), [S, C] = h.useState(0), [y, T] = h.useState(!1), [E, N] = h.useState(!1), _ = $e(t, ($) => l($)),
|
|
16447
|
+
} = e, [a, l] = h.useState(null), [c, d] = h.useState(null), [f, m] = h.useState(null), [p, v] = h.useState(null), [g, x] = h.useState(null), [b, w] = h.useState(0), [S, C] = h.useState(0), [y, T] = h.useState(!1), [E, N] = h.useState(!1), _ = $e(t, ($) => l($)), D = zs(o);
|
|
16446
16448
|
return /* @__PURE__ */ u.jsx(
|
|
16447
16449
|
lk,
|
|
16448
16450
|
{
|
|
16449
16451
|
scope: n,
|
|
16450
16452
|
type: r,
|
|
16451
|
-
dir:
|
|
16453
|
+
dir: D,
|
|
16452
16454
|
scrollHideDelay: s,
|
|
16453
16455
|
scrollArea: a,
|
|
16454
16456
|
viewport: c,
|
|
@@ -16468,7 +16470,7 @@ var Ll = "ScrollArea", [Bh, _N] = gn(Ll), [lk, an] = Bh(Ll), zh = h.forwardRef(
|
|
|
16468
16470
|
children: /* @__PURE__ */ u.jsx(
|
|
16469
16471
|
me.div,
|
|
16470
16472
|
{
|
|
16471
|
-
dir:
|
|
16473
|
+
dir: D,
|
|
16472
16474
|
...i,
|
|
16473
16475
|
ref: _,
|
|
16474
16476
|
style: {
|
|
@@ -16767,14 +16769,14 @@ var ck = h.forwardRef((e, t) => {
|
|
|
16767
16769
|
} = e, p = an(In, n), [v, g] = h.useState(null), x = $e(t, (_) => g(_)), b = h.useRef(null), w = h.useRef(""), S = p.viewport, C = r.content - r.viewport, y = St(d), T = St(l), E = li(f, 10);
|
|
16768
16770
|
function N(_) {
|
|
16769
16771
|
if (b.current) {
|
|
16770
|
-
const
|
|
16771
|
-
c({ x:
|
|
16772
|
+
const D = _.clientX - b.current.left, $ = _.clientY - b.current.top;
|
|
16773
|
+
c({ x: D, y: $ });
|
|
16772
16774
|
}
|
|
16773
16775
|
}
|
|
16774
16776
|
return h.useEffect(() => {
|
|
16775
|
-
const _ = (
|
|
16776
|
-
const $ =
|
|
16777
|
-
(v == null ? void 0 : v.contains($)) && y(
|
|
16777
|
+
const _ = (D) => {
|
|
16778
|
+
const $ = D.target;
|
|
16779
|
+
(v == null ? void 0 : v.contains($)) && y(D, C);
|
|
16778
16780
|
};
|
|
16779
16781
|
return document.addEventListener("wheel", _, { passive: !1 }), () => document.removeEventListener("wheel", _, { passive: !1 });
|
|
16780
16782
|
}, [S, v, C, y]), h.useEffect(T, [r, T]), Or(v, E), Or(p.content, E), /* @__PURE__ */ u.jsx(
|
|
@@ -16798,8 +16800,8 @@ var ck = h.forwardRef((e, t) => {
|
|
|
16798
16800
|
}),
|
|
16799
16801
|
onPointerMove: ie(e.onPointerMove, N),
|
|
16800
16802
|
onPointerUp: ie(e.onPointerUp, (_) => {
|
|
16801
|
-
const
|
|
16802
|
-
|
|
16803
|
+
const D = _.target;
|
|
16804
|
+
D.hasPointerCapture(_.pointerId) && D.releasePointerCapture(_.pointerId), document.body.style.webkitUserSelect = w.current, p.viewport && (p.viewport.style.scrollBehavior = ""), b.current = null;
|
|
16803
16805
|
})
|
|
16804
16806
|
}
|
|
16805
16807
|
)
|
|
@@ -17158,11 +17160,11 @@ function ba({
|
|
|
17158
17160
|
setCurrentThreadId: E,
|
|
17159
17161
|
isLoading: N,
|
|
17160
17162
|
isLoadingSharedThreads: _,
|
|
17161
|
-
actions:
|
|
17163
|
+
actions: D,
|
|
17162
17164
|
shareInFlight: $,
|
|
17163
17165
|
shareStatus: H,
|
|
17164
17166
|
clearShareStatus: Y
|
|
17165
|
-
} = Ro(), { createThread: P, deleteThread: V, renameThread: K, shareThread: z } =
|
|
17167
|
+
} = Ro(), { createThread: P, deleteThread: V, renameThread: K, shareThread: z } = D, { loadThread: M } = Fs(), k = i ?? T, [G, X] = pe(Array.isArray(C) ? C : []), A = Pe(G.length > 0), B = Pe(null), I = Pe(0), [F, U] = pe(null), [O, j] = pe(""), [q, J] = pe(!1), [ne, re] = pe(!1), [se, ae] = pe(null), [be, Oe] = pe(""), We = v && v.length > 0 ? v : Rk, je = kk({ defaultView: m }), Fe = g ?? je, ut = f ?? Fe.view, mt = le(
|
|
17166
17168
|
(Z) => {
|
|
17167
17169
|
f || Fe.setView(Z), p == null || p(Z);
|
|
17168
17170
|
},
|
|
@@ -17241,9 +17243,9 @@ function ba({
|
|
|
17241
17243
|
}, At = (Z, he) => {
|
|
17242
17244
|
he.stopPropagation(), U(Z.threadId), j(Z.title || `Thread ${Z.threadId.slice(0, 8)}`);
|
|
17243
17245
|
}, ln = async (Z) => {
|
|
17244
|
-
if (
|
|
17246
|
+
if (O.trim())
|
|
17245
17247
|
try {
|
|
17246
|
-
await K(Z,
|
|
17248
|
+
await K(Z, O.trim()), U(null), j("");
|
|
17247
17249
|
} catch (he) {
|
|
17248
17250
|
console.error("Failed to update title:", he);
|
|
17249
17251
|
}
|
|
@@ -17331,7 +17333,7 @@ function ba({
|
|
|
17331
17333
|
thread: Z,
|
|
17332
17334
|
isActive: k === Z.threadId,
|
|
17333
17335
|
editingThreadId: F,
|
|
17334
|
-
editingTitle:
|
|
17336
|
+
editingTitle: O,
|
|
17335
17337
|
onSelect: dt,
|
|
17336
17338
|
onStartEditing: At,
|
|
17337
17339
|
onEditingTitleChange: (he) => j(he),
|
|
@@ -17683,7 +17685,7 @@ var Pk = ci, Mk = [" ", "Enter", "ArrowUp", "ArrowDown"], Ok = [" ", "Enter"], c
|
|
|
17683
17685
|
defaultProp: o ?? !1,
|
|
17684
17686
|
onChange: s,
|
|
17685
17687
|
caller: cr
|
|
17686
|
-
}), [_,
|
|
17688
|
+
}), [_, D] = Dn({
|
|
17687
17689
|
prop: i,
|
|
17688
17690
|
defaultProp: a,
|
|
17689
17691
|
onChange: l,
|
|
@@ -17702,7 +17704,7 @@ var Pk = ci, Mk = [" ", "Enter", "ArrowUp", "ArrowDown"], Ok = [" ", "Enter"], c
|
|
|
17702
17704
|
onValueNodeHasChildrenChange: y,
|
|
17703
17705
|
contentId: Dt(),
|
|
17704
17706
|
value: _,
|
|
17705
|
-
onValueChange:
|
|
17707
|
+
onValueChange: D,
|
|
17706
17708
|
open: E,
|
|
17707
17709
|
onOpenChange: N,
|
|
17708
17710
|
dir: T,
|
|
@@ -17734,7 +17736,7 @@ var Pk = ci, Mk = [" ", "Enter", "ArrowUp", "ArrowDown"], Ok = [" ", "Enter"], c
|
|
|
17734
17736
|
name: d,
|
|
17735
17737
|
autoComplete: f,
|
|
17736
17738
|
value: _,
|
|
17737
|
-
onChange: (K) =>
|
|
17739
|
+
onChange: (K) => D(K.target.value),
|
|
17738
17740
|
disabled: m,
|
|
17739
17741
|
form: v,
|
|
17740
17742
|
children: [
|
|
@@ -17857,16 +17859,16 @@ var un = 10, [mm, qn] = qr(ur), Hk = "SelectContentImpl", Uk = Ar("SelectContent
|
|
|
17857
17859
|
avoidCollisions: x,
|
|
17858
17860
|
//
|
|
17859
17861
|
...b
|
|
17860
|
-
} = e, w = Kn(ur, n), [S, C] = h.useState(null), [y, T] = h.useState(null), E = $e(t, (
|
|
17862
|
+
} = e, w = Kn(ur, n), [S, C] = h.useState(null), [y, T] = h.useState(null), E = $e(t, (O) => C(O)), [N, _] = h.useState(null), [D, $] = h.useState(
|
|
17861
17863
|
null
|
|
17862
17864
|
), H = di(n), [Y, P] = h.useState(!1), V = h.useRef(!1);
|
|
17863
17865
|
h.useEffect(() => {
|
|
17864
17866
|
if (S) return nl(S);
|
|
17865
17867
|
}, [S]), Ua();
|
|
17866
17868
|
const K = h.useCallback(
|
|
17867
|
-
(
|
|
17869
|
+
(O) => {
|
|
17868
17870
|
const [j, ...q] = H().map((re) => re.ref.current), [J] = q.slice(-1), ne = document.activeElement;
|
|
17869
|
-
for (const re of
|
|
17871
|
+
for (const re of O)
|
|
17870
17872
|
if (re === ne || (re == null || re.scrollIntoView({ block: "nearest" }), re === j && y && (y.scrollTop = 0), re === J && y && (y.scrollTop = y.scrollHeight), re == null || re.focus(), document.activeElement !== ne)) return;
|
|
17871
17873
|
},
|
|
17872
17874
|
[H, y]
|
|
@@ -17880,39 +17882,39 @@ var un = 10, [mm, qn] = qr(ur), Hk = "SelectContentImpl", Uk = Ar("SelectContent
|
|
|
17880
17882
|
const { onOpenChange: M, triggerPointerDownPosRef: k } = w;
|
|
17881
17883
|
h.useEffect(() => {
|
|
17882
17884
|
if (S) {
|
|
17883
|
-
let
|
|
17885
|
+
let O = { x: 0, y: 0 };
|
|
17884
17886
|
const j = (J) => {
|
|
17885
17887
|
var ne, re;
|
|
17886
|
-
|
|
17888
|
+
O = {
|
|
17887
17889
|
x: Math.abs(Math.round(J.pageX) - (((ne = k.current) == null ? void 0 : ne.x) ?? 0)),
|
|
17888
17890
|
y: Math.abs(Math.round(J.pageY) - (((re = k.current) == null ? void 0 : re.y) ?? 0))
|
|
17889
17891
|
};
|
|
17890
17892
|
}, q = (J) => {
|
|
17891
|
-
|
|
17893
|
+
O.x <= 10 && O.y <= 10 ? J.preventDefault() : S.contains(J.target) || M(!1), document.removeEventListener("pointermove", j), k.current = null;
|
|
17892
17894
|
};
|
|
17893
17895
|
return k.current !== null && (document.addEventListener("pointermove", j), document.addEventListener("pointerup", q, { capture: !0, once: !0 })), () => {
|
|
17894
17896
|
document.removeEventListener("pointermove", j), document.removeEventListener("pointerup", q, { capture: !0 });
|
|
17895
17897
|
};
|
|
17896
17898
|
}
|
|
17897
17899
|
}, [S, M, k]), h.useEffect(() => {
|
|
17898
|
-
const
|
|
17899
|
-
return window.addEventListener("blur",
|
|
17900
|
-
window.removeEventListener("blur",
|
|
17900
|
+
const O = () => M(!1);
|
|
17901
|
+
return window.addEventListener("blur", O), window.addEventListener("resize", O), () => {
|
|
17902
|
+
window.removeEventListener("blur", O), window.removeEventListener("resize", O);
|
|
17901
17903
|
};
|
|
17902
17904
|
}, [M]);
|
|
17903
|
-
const [G, X] = Pm((
|
|
17904
|
-
const j = H().filter((ne) => !ne.disabled), q = j.find((ne) => ne.ref.current === document.activeElement), J = Mm(j,
|
|
17905
|
+
const [G, X] = Pm((O) => {
|
|
17906
|
+
const j = H().filter((ne) => !ne.disabled), q = j.find((ne) => ne.ref.current === document.activeElement), J = Mm(j, O, q);
|
|
17905
17907
|
J && setTimeout(() => J.ref.current.focus());
|
|
17906
17908
|
}), A = h.useCallback(
|
|
17907
|
-
(
|
|
17909
|
+
(O, j, q) => {
|
|
17908
17910
|
const J = !V.current && !q;
|
|
17909
|
-
(w.value !== void 0 && w.value === j || J) && (_(
|
|
17911
|
+
(w.value !== void 0 && w.value === j || J) && (_(O), J && (V.current = !0));
|
|
17910
17912
|
},
|
|
17911
17913
|
[w.value]
|
|
17912
17914
|
), B = h.useCallback(() => S == null ? void 0 : S.focus(), [S]), I = h.useCallback(
|
|
17913
|
-
(
|
|
17915
|
+
(O, j, q) => {
|
|
17914
17916
|
const J = !V.current && !q;
|
|
17915
|
-
(w.value !== void 0 && w.value === j || J) && $(
|
|
17917
|
+
(w.value !== void 0 && w.value === j || J) && $(O);
|
|
17916
17918
|
},
|
|
17917
17919
|
[w.value]
|
|
17918
17920
|
), F = r === "popper" ? ya : xm, U = F === ya ? {
|
|
@@ -17939,7 +17941,7 @@ var un = 10, [mm, qn] = qr(ur), Hk = "SelectContentImpl", Uk = Ar("SelectContent
|
|
|
17939
17941
|
onItemLeave: B,
|
|
17940
17942
|
itemTextRefCallback: I,
|
|
17941
17943
|
focusSelectedItem: z,
|
|
17942
|
-
selectedItemText:
|
|
17944
|
+
selectedItemText: D,
|
|
17943
17945
|
position: r,
|
|
17944
17946
|
isPositioned: Y,
|
|
17945
17947
|
searchRef: G,
|
|
@@ -17948,12 +17950,12 @@ var un = 10, [mm, qn] = qr(ur), Hk = "SelectContentImpl", Uk = Ar("SelectContent
|
|
|
17948
17950
|
{
|
|
17949
17951
|
asChild: !0,
|
|
17950
17952
|
trapped: w.open,
|
|
17951
|
-
onMountAutoFocus: (
|
|
17952
|
-
|
|
17953
|
+
onMountAutoFocus: (O) => {
|
|
17954
|
+
O.preventDefault();
|
|
17953
17955
|
},
|
|
17954
|
-
onUnmountAutoFocus: ie(o, (
|
|
17956
|
+
onUnmountAutoFocus: ie(o, (O) => {
|
|
17955
17957
|
var j;
|
|
17956
|
-
(j = w.trigger) == null || j.focus({ preventScroll: !0 }),
|
|
17958
|
+
(j = w.trigger) == null || j.focus({ preventScroll: !0 }), O.preventDefault();
|
|
17957
17959
|
}),
|
|
17958
17960
|
children: /* @__PURE__ */ u.jsx(
|
|
17959
17961
|
zr,
|
|
@@ -17962,7 +17964,7 @@ var un = 10, [mm, qn] = qr(ur), Hk = "SelectContentImpl", Uk = Ar("SelectContent
|
|
|
17962
17964
|
disableOutsidePointerEvents: !0,
|
|
17963
17965
|
onEscapeKeyDown: s,
|
|
17964
17966
|
onPointerDownOutside: i,
|
|
17965
|
-
onFocusOutside: (
|
|
17967
|
+
onFocusOutside: (O) => O.preventDefault(),
|
|
17966
17968
|
onDismiss: () => w.onOpenChange(!1),
|
|
17967
17969
|
children: /* @__PURE__ */ u.jsx(
|
|
17968
17970
|
F,
|
|
@@ -17971,7 +17973,7 @@ var un = 10, [mm, qn] = qr(ur), Hk = "SelectContentImpl", Uk = Ar("SelectContent
|
|
|
17971
17973
|
id: w.contentId,
|
|
17972
17974
|
"data-state": w.open ? "open" : "closed",
|
|
17973
17975
|
dir: w.dir,
|
|
17974
|
-
onContextMenu: (
|
|
17976
|
+
onContextMenu: (O) => O.preventDefault(),
|
|
17975
17977
|
...b,
|
|
17976
17978
|
...U,
|
|
17977
17979
|
onPlaced: () => P(!0),
|
|
@@ -17984,15 +17986,15 @@ var un = 10, [mm, qn] = qr(ur), Hk = "SelectContentImpl", Uk = Ar("SelectContent
|
|
|
17984
17986
|
outline: "none",
|
|
17985
17987
|
...b.style
|
|
17986
17988
|
},
|
|
17987
|
-
onKeyDown: ie(b.onKeyDown, (
|
|
17988
|
-
const j =
|
|
17989
|
-
if (
|
|
17989
|
+
onKeyDown: ie(b.onKeyDown, (O) => {
|
|
17990
|
+
const j = O.ctrlKey || O.altKey || O.metaKey;
|
|
17991
|
+
if (O.key === "Tab" && O.preventDefault(), !j && O.key.length === 1 && X(O.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(O.key)) {
|
|
17990
17992
|
let J = H().filter((ne) => !ne.disabled).map((ne) => ne.ref.current);
|
|
17991
|
-
if (["ArrowUp", "End"].includes(
|
|
17992
|
-
const ne =
|
|
17993
|
+
if (["ArrowUp", "End"].includes(O.key) && (J = J.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(O.key)) {
|
|
17994
|
+
const ne = O.target, re = J.indexOf(ne);
|
|
17993
17995
|
J = J.slice(re + 1);
|
|
17994
17996
|
}
|
|
17995
|
-
setTimeout(() => K(J)),
|
|
17997
|
+
setTimeout(() => K(J)), O.preventDefault();
|
|
17996
17998
|
}
|
|
17997
17999
|
})
|
|
17998
18000
|
}
|
|
@@ -18009,9 +18011,9 @@ gm.displayName = Hk;
|
|
|
18009
18011
|
var Wk = "SelectItemAlignedPosition", xm = h.forwardRef((e, t) => {
|
|
18010
18012
|
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = Kn(ur, n), i = qn(ur, n), [a, l] = h.useState(null), [c, d] = h.useState(null), f = $e(t, (E) => d(E)), m = di(n), p = h.useRef(!1), v = h.useRef(!0), { viewport: g, selectedItem: x, selectedItemText: b, focusSelectedItem: w } = i, S = h.useCallback(() => {
|
|
18011
18013
|
if (s.trigger && s.valueNode && a && c && g && x && b) {
|
|
18012
|
-
const E = s.trigger.getBoundingClientRect(), N = c.getBoundingClientRect(), _ = s.valueNode.getBoundingClientRect(),
|
|
18014
|
+
const E = s.trigger.getBoundingClientRect(), N = c.getBoundingClientRect(), _ = s.valueNode.getBoundingClientRect(), D = b.getBoundingClientRect();
|
|
18013
18015
|
if (s.dir !== "rtl") {
|
|
18014
|
-
const ne =
|
|
18016
|
+
const ne = D.left - N.left, re = _.left - ne, se = E.left - re, ae = E.width + se, be = Math.max(ae, N.width), Oe = window.innerWidth - un, We = wa(re, [
|
|
18015
18017
|
un,
|
|
18016
18018
|
// Prevents the content from going off the starting edge of the
|
|
18017
18019
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -18022,13 +18024,13 @@ var Wk = "SelectItemAlignedPosition", xm = h.forwardRef((e, t) => {
|
|
|
18022
18024
|
]);
|
|
18023
18025
|
a.style.minWidth = ae + "px", a.style.left = We + "px";
|
|
18024
18026
|
} else {
|
|
18025
|
-
const ne = N.right -
|
|
18027
|
+
const ne = N.right - D.right, re = window.innerWidth - _.right - ne, se = window.innerWidth - E.right - re, ae = E.width + se, be = Math.max(ae, N.width), Oe = window.innerWidth - un, We = wa(re, [
|
|
18026
18028
|
un,
|
|
18027
18029
|
Math.max(un, Oe - be)
|
|
18028
18030
|
]);
|
|
18029
18031
|
a.style.minWidth = ae + "px", a.style.right = We + "px";
|
|
18030
18032
|
}
|
|
18031
|
-
const $ = m(), H = window.innerHeight - un * 2, Y = g.scrollHeight, P = window.getComputedStyle(c), V = parseInt(P.borderTopWidth, 10), K = parseInt(P.paddingTop, 10), z = parseInt(P.borderBottomWidth, 10), M = parseInt(P.paddingBottom, 10), k = V + K + Y + M + z, G = Math.min(x.offsetHeight * 5, k), X = window.getComputedStyle(g), A = parseInt(X.paddingTop, 10), B = parseInt(X.paddingBottom, 10), I = E.top + E.height / 2 - un, F = H - I, U = x.offsetHeight / 2,
|
|
18033
|
+
const $ = m(), H = window.innerHeight - un * 2, Y = g.scrollHeight, P = window.getComputedStyle(c), V = parseInt(P.borderTopWidth, 10), K = parseInt(P.paddingTop, 10), z = parseInt(P.borderBottomWidth, 10), M = parseInt(P.paddingBottom, 10), k = V + K + Y + M + z, G = Math.min(x.offsetHeight * 5, k), X = window.getComputedStyle(g), A = parseInt(X.paddingTop, 10), B = parseInt(X.paddingBottom, 10), I = E.top + E.height / 2 - un, F = H - I, U = x.offsetHeight / 2, O = x.offsetTop + U, j = V + K + O, q = k - j;
|
|
18032
18034
|
if (j <= I) {
|
|
18033
18035
|
const ne = $.length > 0 && x === $[$.length - 1].ref.current;
|
|
18034
18036
|
a.style.bottom = "0px";
|
|
@@ -19347,7 +19349,7 @@ var [rI, oI] = ag(Bo, {
|
|
|
19347
19349
|
onSwipeCancel: m,
|
|
19348
19350
|
onSwipeEnd: p,
|
|
19349
19351
|
...v
|
|
19350
|
-
} = e, g = xi(Bo, n), [x, b] = h.useState(null), w = $e(t, (P) => b(P)), S = h.useRef(null), C = h.useRef(null), y = o || g.duration, T = h.useRef(0), E = h.useRef(y), N = h.useRef(0), { onToastAdd: _, onToastRemove:
|
|
19352
|
+
} = e, g = xi(Bo, n), [x, b] = h.useState(null), w = $e(t, (P) => b(P)), S = h.useRef(null), C = h.useRef(null), y = o || g.duration, T = h.useRef(0), E = h.useRef(y), N = h.useRef(0), { onToastAdd: _, onToastRemove: D } = g, $ = St(() => {
|
|
19351
19353
|
var V;
|
|
19352
19354
|
(x == null ? void 0 : x.contains(document.activeElement)) && ((V = g.viewport) == null || V.focus()), i();
|
|
19353
19355
|
}), H = h.useCallback(
|
|
@@ -19371,7 +19373,7 @@ var [rI, oI] = ag(Bo, {
|
|
|
19371
19373
|
}
|
|
19372
19374
|
}, [g.viewport, y, l, c, H]), h.useEffect(() => {
|
|
19373
19375
|
s && !g.isClosePausedRef.current && H(y);
|
|
19374
|
-
}, [s, y, g.isClosePausedRef, H]), h.useEffect(() => (_(), () =>
|
|
19376
|
+
}, [s, y, g.isClosePausedRef, H]), h.useEffect(() => (_(), () => D()), [_, D]);
|
|
19375
19377
|
const Y = h.useMemo(() => x ? wg(x) : null, [x]);
|
|
19376
19378
|
return g.viewport ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
19377
19379
|
Y && /* @__PURE__ */ u.jsx(
|
|
@@ -19766,7 +19768,7 @@ function UI(e) {
|
|
|
19766
19768
|
}
|
|
19767
19769
|
var WI = (e) => {
|
|
19768
19770
|
var t, n, r, o, s, i, a, l, c, d, f;
|
|
19769
|
-
let { invert: m, toast: p, unstyled: v, interacting: g, setHeights: x, visibleToasts: b, heights: w, index: S, toasts: C, expanded: y, removeToast: T, defaultRichColors: E, closeButton: N, style: _, cancelButtonStyle:
|
|
19771
|
+
let { invert: m, toast: p, unstyled: v, interacting: g, setHeights: x, visibleToasts: b, heights: w, index: S, toasts: C, expanded: y, removeToast: T, defaultRichColors: E, closeButton: N, style: _, cancelButtonStyle: D, actionButtonStyle: $, className: H = "", descriptionClassName: Y = "", duration: P, position: V, gap: K, loadingIcon: z, expandByDefault: M, classNames: k, icons: G, closeButtonAriaLabel: X = "Close toast", pauseWhenPageIsHidden: A } = e, [B, I] = L.useState(null), [F, U] = L.useState(null), [O, j] = L.useState(!1), [q, J] = L.useState(!1), [ne, re] = L.useState(!1), [se, ae] = L.useState(!1), [be, Oe] = L.useState(!1), [We, je] = L.useState(0), [Fe, ut] = L.useState(0), mt = L.useRef(p.duration || P || Mu), Ct = L.useRef(null), Ge = L.useRef(null), Je = S === 0, Ve = S + 1 <= b, De = p.type, Ne = p.dismissible !== !1, gt = p.className || "", jt = p.descriptionClassName || "", rt = L.useMemo(() => w.findIndex((ge) => ge.toastId === p.id) || 0, [w, p.id]), lt = L.useMemo(() => {
|
|
19770
19772
|
var ge;
|
|
19771
19773
|
return (ge = p.closeButton) != null ? ge : N;
|
|
19772
19774
|
}, [p.closeButton, N]), vt = L.useMemo(() => p.duration || P || Mu, [p.duration, P]), dt = L.useRef(0), wt = L.useRef(0), Qt = L.useRef(0), At = L.useRef(null), [ln, Gt] = V.split("-"), Ye = L.useMemo(() => w.reduce((ge, ce, ke) => ke >= rt ? ge : ge + ce.height, 0), [w, rt]), Ke = II(), Et = p.invert || m, Z = De === "loading";
|
|
@@ -19781,12 +19783,12 @@ var WI = (e) => {
|
|
|
19781
19783
|
return ut(ce), x((ke) => [{ toastId: p.id, height: ce, position: p.position }, ...ke]), () => x((ke) => ke.filter((ct) => ct.toastId !== p.id));
|
|
19782
19784
|
}
|
|
19783
19785
|
}, [x, p.id]), L.useLayoutEffect(() => {
|
|
19784
|
-
if (!
|
|
19786
|
+
if (!O) return;
|
|
19785
19787
|
let ge = Ge.current, ce = ge.style.height;
|
|
19786
19788
|
ge.style.height = "auto";
|
|
19787
19789
|
let ke = ge.getBoundingClientRect().height;
|
|
19788
19790
|
ge.style.height = ce, ut(ke), x((ct) => ct.find((Se) => Se.toastId === p.id) ? ct.map((Se) => Se.toastId === p.id ? { ...Se, height: ke } : Se) : [{ toastId: p.id, height: ke, position: p.position }, ...ct]);
|
|
19789
|
-
}, [
|
|
19791
|
+
}, [O, p.title, p.description, x, p.id]);
|
|
19790
19792
|
let he = L.useCallback(() => {
|
|
19791
19793
|
J(!0), je(wt.current), x((ge) => ge.filter((ce) => ce.toastId !== p.id)), setTimeout(() => {
|
|
19792
19794
|
T(p);
|
|
@@ -19812,7 +19814,7 @@ var WI = (e) => {
|
|
|
19812
19814
|
var ge, ce, ke;
|
|
19813
19815
|
return G != null && G.loading ? L.createElement("div", { className: cn(k == null ? void 0 : k.loader, (ge = p == null ? void 0 : p.classNames) == null ? void 0 : ge.loader, "sonner-loader"), "data-visible": De === "loading" }, G.loading) : z ? L.createElement("div", { className: cn(k == null ? void 0 : k.loader, (ce = p == null ? void 0 : p.classNames) == null ? void 0 : ce.loader, "sonner-loader"), "data-visible": De === "loading" }, z) : L.createElement(SI, { className: cn(k == null ? void 0 : k.loader, (ke = p == null ? void 0 : p.classNames) == null ? void 0 : ke.loader), visible: De === "loading" });
|
|
19814
19816
|
}
|
|
19815
|
-
return L.createElement("li", { tabIndex: 0, ref: Ge, className: cn(H, gt, k == null ? void 0 : k.toast, (t = p == null ? void 0 : p.classNames) == null ? void 0 : t.toast, k == null ? void 0 : k.default, k == null ? void 0 : k[De], (n = p == null ? void 0 : p.classNames) == null ? void 0 : n[De]), "data-sonner-toast": "", "data-rich-colors": (r = p.richColors) != null ? r : E, "data-styled": !(p.jsx || p.unstyled || v), "data-mounted":
|
|
19817
|
+
return L.createElement("li", { tabIndex: 0, ref: Ge, className: cn(H, gt, k == null ? void 0 : k.toast, (t = p == null ? void 0 : p.classNames) == null ? void 0 : t.toast, k == null ? void 0 : k.default, k == null ? void 0 : k[De], (n = p == null ? void 0 : p.classNames) == null ? void 0 : n[De]), "data-sonner-toast": "", "data-rich-colors": (r = p.richColors) != null ? r : E, "data-styled": !(p.jsx || p.unstyled || v), "data-mounted": O, "data-promise": !!p.promise, "data-swiped": be, "data-removed": q, "data-visible": Ve, "data-y-position": ln, "data-x-position": Gt, "data-index": S, "data-front": Je, "data-swiping": ne, "data-dismissible": Ne, "data-type": De, "data-invert": Et, "data-swipe-out": se, "data-swipe-direction": F, "data-expanded": !!(y || M && O), style: { "--index": S, "--toasts-before": S, "--z-index": C.length - S, "--offset": `${q ? We : wt.current}px`, "--initial-height": M ? "auto" : `${Fe}px`, ..._, ...p.style }, onDragEnd: () => {
|
|
19816
19818
|
re(!1), I(null), At.current = null;
|
|
19817
19819
|
}, onPointerDown: (ge) => {
|
|
19818
19820
|
Z || !Ne || (Ct.current = /* @__PURE__ */ new Date(), je(wt.current), ge.target.setPointerCapture(ge.pointerId), ge.target.tagName !== "BUTTON" && (re(!0), At.current = { x: ge.clientX, y: ge.clientY }));
|
|
@@ -19837,7 +19839,7 @@ var WI = (e) => {
|
|
|
19837
19839
|
} : () => {
|
|
19838
19840
|
var ge;
|
|
19839
19841
|
he(), (ge = p.onDismiss) == null || ge.call(p, p);
|
|
19840
|
-
}, className: cn(k == null ? void 0 : k.closeButton, (o = p == null ? void 0 : p.classNames) == null ? void 0 : o.closeButton) }, (s = G == null ? void 0 : G.close) != null ? s : RI) : null, p.jsx || wi(p.title) ? p.jsx ? p.jsx : typeof p.title == "function" ? p.title() : p.title : L.createElement(L.Fragment, null, De || p.icon || p.promise ? L.createElement("div", { "data-icon": "", className: cn(k == null ? void 0 : k.icon, (i = p == null ? void 0 : p.classNames) == null ? void 0 : i.icon) }, p.promise || p.type === "loading" && !p.icon ? p.icon || ot() : null, p.type !== "loading" ? p.icon || (G == null ? void 0 : G[De]) || bI(De) : null) : null, L.createElement("div", { "data-content": "", className: cn(k == null ? void 0 : k.content, (a = p == null ? void 0 : p.classNames) == null ? void 0 : a.content) }, L.createElement("div", { "data-title": "", className: cn(k == null ? void 0 : k.title, (l = p == null ? void 0 : p.classNames) == null ? void 0 : l.title) }, typeof p.title == "function" ? p.title() : p.title), p.description ? L.createElement("div", { "data-description": "", className: cn(Y, jt, k == null ? void 0 : k.description, (c = p == null ? void 0 : p.classNames) == null ? void 0 : c.description) }, typeof p.description == "function" ? p.description() : p.description) : null), wi(p.cancel) ? p.cancel : p.cancel && Zo(p.cancel) ? L.createElement("button", { "data-button": !0, "data-cancel": !0, style: p.cancelButtonStyle ||
|
|
19842
|
+
}, className: cn(k == null ? void 0 : k.closeButton, (o = p == null ? void 0 : p.classNames) == null ? void 0 : o.closeButton) }, (s = G == null ? void 0 : G.close) != null ? s : RI) : null, p.jsx || wi(p.title) ? p.jsx ? p.jsx : typeof p.title == "function" ? p.title() : p.title : L.createElement(L.Fragment, null, De || p.icon || p.promise ? L.createElement("div", { "data-icon": "", className: cn(k == null ? void 0 : k.icon, (i = p == null ? void 0 : p.classNames) == null ? void 0 : i.icon) }, p.promise || p.type === "loading" && !p.icon ? p.icon || ot() : null, p.type !== "loading" ? p.icon || (G == null ? void 0 : G[De]) || bI(De) : null) : null, L.createElement("div", { "data-content": "", className: cn(k == null ? void 0 : k.content, (a = p == null ? void 0 : p.classNames) == null ? void 0 : a.content) }, L.createElement("div", { "data-title": "", className: cn(k == null ? void 0 : k.title, (l = p == null ? void 0 : p.classNames) == null ? void 0 : l.title) }, typeof p.title == "function" ? p.title() : p.title), p.description ? L.createElement("div", { "data-description": "", className: cn(Y, jt, k == null ? void 0 : k.description, (c = p == null ? void 0 : p.classNames) == null ? void 0 : c.description) }, typeof p.description == "function" ? p.description() : p.description) : null), wi(p.cancel) ? p.cancel : p.cancel && Zo(p.cancel) ? L.createElement("button", { "data-button": !0, "data-cancel": !0, style: p.cancelButtonStyle || D, onClick: (ge) => {
|
|
19841
19843
|
var ce, ke;
|
|
19842
19844
|
Zo(p.cancel) && Ne && ((ke = (ce = p.cancel).onClick) == null || ke.call(ce, ge), he());
|
|
19843
19845
|
}, className: cn(k == null ? void 0 : k.cancelButton, (d = p == null ? void 0 : p.classNames) == null ? void 0 : d.cancelButton) }, p.cancel.label) : null, wi(p.action) ? p.action : p.action && Zo(p.action) ? L.createElement("button", { "data-button": !0, "data-action": !0, style: p.actionButtonStyle || $, onClick: (ge) => {
|
|
@@ -19865,7 +19867,7 @@ function VI(e, t) {
|
|
|
19865
19867
|
}), n;
|
|
19866
19868
|
}
|
|
19867
19869
|
var KI = Fg(function(e, t) {
|
|
19868
|
-
let { invert: n, position: r = "bottom-right", hotkey: o = ["altKey", "KeyT"], expand: s, closeButton: i, className: a, offset: l, mobileOffset: c, theme: d = "light", richColors: f, duration: m, style: p, visibleToasts: v = DI, toastOptions: g, dir: x = Ou(), gap: b = BI, loadingIcon: w, icons: S, containerAriaLabel: C = "Notifications", pauseWhenPageIsHidden: y } = e, [T, E] = L.useState([]), N = L.useMemo(() => Array.from(new Set([r].concat(T.filter((A) => A.position).map((A) => A.position)))), [T, r]), [_,
|
|
19870
|
+
let { invert: n, position: r = "bottom-right", hotkey: o = ["altKey", "KeyT"], expand: s, closeButton: i, className: a, offset: l, mobileOffset: c, theme: d = "light", richColors: f, duration: m, style: p, visibleToasts: v = DI, toastOptions: g, dir: x = Ou(), gap: b = BI, loadingIcon: w, icons: S, containerAriaLabel: C = "Notifications", pauseWhenPageIsHidden: y } = e, [T, E] = L.useState([]), N = L.useMemo(() => Array.from(new Set([r].concat(T.filter((A) => A.position).map((A) => A.position)))), [T, r]), [_, D] = L.useState([]), [$, H] = L.useState(!1), [Y, P] = L.useState(!1), [V, K] = L.useState(d !== "system" ? d : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), z = L.useRef(null), M = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), k = L.useRef(null), G = L.useRef(!1), X = L.useCallback((A) => {
|
|
19869
19871
|
E((B) => {
|
|
19870
19872
|
var I;
|
|
19871
19873
|
return (I = B.find((F) => F.id === A.id)) != null && I.delete || Ht.dismiss(A.id), B.filter(({ id: F }) => F !== A.id);
|
|
@@ -19919,17 +19921,17 @@ var KI = Fg(function(e, t) {
|
|
|
19919
19921
|
}, [z.current]), L.createElement("section", { ref: t, "aria-label": `${C} ${M}`, tabIndex: -1, "aria-live": "polite", "aria-relevant": "additions text", "aria-atomic": "false", suppressHydrationWarning: !0 }, N.map((A, B) => {
|
|
19920
19922
|
var I;
|
|
19921
19923
|
let [F, U] = A.split("-");
|
|
19922
|
-
return T.length ? L.createElement("ol", { key: A, dir: x === "auto" ? Ou() : x, tabIndex: -1, ref: z, className: a, "data-sonner-toaster": !0, "data-theme": V, "data-y-position": F, "data-lifted": $ && T.length > 1 && !s, "data-x-position": U, style: { "--front-toast-height": `${((I = _[0]) == null ? void 0 : I.height) || 0}px`, "--width": `${FI}px`, "--gap": `${b}px`, ...p, ...VI(l, c) }, onBlur: (
|
|
19923
|
-
G.current && !
|
|
19924
|
-
}, onFocus: (
|
|
19925
|
-
|
|
19924
|
+
return T.length ? L.createElement("ol", { key: A, dir: x === "auto" ? Ou() : x, tabIndex: -1, ref: z, className: a, "data-sonner-toaster": !0, "data-theme": V, "data-y-position": F, "data-lifted": $ && T.length > 1 && !s, "data-x-position": U, style: { "--front-toast-height": `${((I = _[0]) == null ? void 0 : I.height) || 0}px`, "--width": `${FI}px`, "--gap": `${b}px`, ...p, ...VI(l, c) }, onBlur: (O) => {
|
|
19925
|
+
G.current && !O.currentTarget.contains(O.relatedTarget) && (G.current = !1, k.current && (k.current.focus({ preventScroll: !0 }), k.current = null));
|
|
19926
|
+
}, onFocus: (O) => {
|
|
19927
|
+
O.target instanceof HTMLElement && O.target.dataset.dismissible === "false" || G.current || (G.current = !0, k.current = O.relatedTarget);
|
|
19926
19928
|
}, onMouseEnter: () => H(!0), onMouseMove: () => H(!0), onMouseLeave: () => {
|
|
19927
19929
|
Y || H(!1);
|
|
19928
|
-
}, onDragEnd: () => H(!1), onPointerDown: (
|
|
19929
|
-
|
|
19930
|
-
}, onPointerUp: () => P(!1) }, T.filter((
|
|
19930
|
+
}, onDragEnd: () => H(!1), onPointerDown: (O) => {
|
|
19931
|
+
O.target instanceof HTMLElement && O.target.dataset.dismissible === "false" || P(!0);
|
|
19932
|
+
}, onPointerUp: () => P(!1) }, T.filter((O) => !O.position && B === 0 || O.position === A).map((O, j) => {
|
|
19931
19933
|
var q, J;
|
|
19932
|
-
return L.createElement(WI, { key:
|
|
19934
|
+
return L.createElement(WI, { key: O.id, icons: S, index: j, toast: O, defaultRichColors: f, duration: (q = g == null ? void 0 : g.duration) != null ? q : m, className: g == null ? void 0 : g.className, descriptionClassName: g == null ? void 0 : g.descriptionClassName, invert: n, visibleToasts: v, closeButton: (J = g == null ? void 0 : g.closeButton) != null ? J : i, interacting: Y, position: A, style: g == null ? void 0 : g.style, unstyled: g == null ? void 0 : g.unstyled, classNames: g == null ? void 0 : g.classNames, cancelButtonStyle: g == null ? void 0 : g.cancelButtonStyle, actionButtonStyle: g == null ? void 0 : g.actionButtonStyle, removeToast: X, toasts: T.filter((ne) => ne.position == O.position), heights: _.filter((ne) => ne.position == O.position), setHeights: D, expandByDefault: s, gap: b, loadingIcon: w, expanded: $, pauseWhenPageIsHidden: y, swipeDirections: e.swipeDirections });
|
|
19933
19935
|
})) : null;
|
|
19934
19936
|
}));
|
|
19935
19937
|
});
|