teodor-new-chat-ui 1.5.1 → 1.5.2
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 +600 -592
- package/dist/index.umd.js +7 -7
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as c, jsxs as C, Fragment as _e } from "react/jsx-runtime";
|
|
2
2
|
import * as l from "react";
|
|
3
|
-
import $e, { useState as
|
|
3
|
+
import $e, { useState as Q, useRef as We, useCallback as he, useEffect as ue, useReducer as Ai, useMemo as ke, createContext as Xr, useContext as Kr, useLayoutEffect as Ri } from "react";
|
|
4
4
|
import { ChevronUp as At, ChevronDown as ut, Copy as cr, Edit as lr, RotateCcw as En, GitBranch as Gr, ChevronLeft as Pi, ChevronRight as Ii, Bot as dr, Wrench as ki, User as _i, Image as Oi, X as ft, Edit3 as qr, Paperclip as ur, Square as Di, Send as Mi, Plus as Li, MessageSquare as $i, Check as Zr, Calendar as Fi, Trash2 as Bi, Settings as Wi, Server as zi, EyeOff as Hi, Eye as Ui, Layout as Vi, MessageCircle as ji, Save as Yi } from "lucide-react";
|
|
5
5
|
import { Slot as Xi, createSlot as mt } from "@radix-ui/react-slot";
|
|
6
6
|
import { cva as Xt } from "class-variance-authority";
|
|
@@ -107,7 +107,7 @@ function yt(e) {
|
|
|
107
107
|
return !!e && typeof e == "object" && e.protocolVersion === "v1" && "data" in e;
|
|
108
108
|
}
|
|
109
109
|
function Qi(e = {}) {
|
|
110
|
-
const t = e.baseUrl ?? "/api", n = e.streamPath ?? "/stream", [r, o] =
|
|
110
|
+
const t = e.baseUrl ?? "/api", n = e.streamPath ?? "/stream", [r, o] = Q(e.token ?? null), s = We(e.headers ?? {}), [i, a] = Q(!1), [d, u] = Q(null), [f, h] = Q(""), [m, w] = Q(null), y = We(null), p = he((x) => {
|
|
111
111
|
o(x);
|
|
112
112
|
}, []), g = he(() => {
|
|
113
113
|
var x;
|
|
@@ -117,11 +117,11 @@ function Qi(e = {}) {
|
|
|
117
117
|
}, []), b = he(
|
|
118
118
|
(x, S, E) => {
|
|
119
119
|
y.current && (y.current.abort(), y.current = null), a(!0), u(null), e.autoAppendAssistant !== !1 && h("");
|
|
120
|
-
const
|
|
121
|
-
return y.current =
|
|
120
|
+
const A = new AbortController();
|
|
121
|
+
return y.current = A, (async () => {
|
|
122
122
|
var N;
|
|
123
123
|
try {
|
|
124
|
-
const
|
|
124
|
+
const R = await fetch(t + n, {
|
|
125
125
|
method: "POST",
|
|
126
126
|
headers: {
|
|
127
127
|
"Content-Type": "application/json",
|
|
@@ -130,46 +130,46 @@ function Qi(e = {}) {
|
|
|
130
130
|
...s.current
|
|
131
131
|
},
|
|
132
132
|
body: JSON.stringify(x),
|
|
133
|
-
signal:
|
|
133
|
+
signal: A.signal
|
|
134
134
|
});
|
|
135
|
-
if (!
|
|
136
|
-
const _ =
|
|
137
|
-
let
|
|
135
|
+
if (!R.ok || !R.body) throw new Error(`stream ${R.status}`);
|
|
136
|
+
const _ = R.body.getReader(), D = new TextDecoder();
|
|
137
|
+
let B = "";
|
|
138
138
|
for (; ; ) {
|
|
139
|
-
const { value:
|
|
140
|
-
if (
|
|
141
|
-
|
|
139
|
+
const { value: j, done: Y } = await _.read();
|
|
140
|
+
if (Y) break;
|
|
141
|
+
B += D.decode(j, { stream: !0 });
|
|
142
142
|
let O;
|
|
143
|
-
for (; (O =
|
|
143
|
+
for (; (O = B.indexOf(`
|
|
144
144
|
|
|
145
145
|
`)) >= 0; ) {
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
if (!
|
|
146
|
+
const U = B.slice(0, O);
|
|
147
|
+
B = B.slice(O + 2);
|
|
148
|
+
const F = ta(U);
|
|
149
|
+
if (!F) continue;
|
|
150
150
|
let W;
|
|
151
151
|
try {
|
|
152
|
-
W = JSON.parse(
|
|
152
|
+
W = JSON.parse(F);
|
|
153
153
|
} catch {
|
|
154
154
|
continue;
|
|
155
155
|
}
|
|
156
156
|
const I = ea(W) ? W.data : W;
|
|
157
157
|
if (S == null || S(I), I.type === "token")
|
|
158
|
-
e.autoAppendAssistant !== !1 && h((
|
|
158
|
+
e.autoAppendAssistant !== !1 && h((X) => X + I.content);
|
|
159
159
|
else if (I.type === "message_delta") {
|
|
160
|
-
const
|
|
161
|
-
|
|
160
|
+
const X = I.delta.filter((V) => V.type === "text").map((V) => V.text).join("");
|
|
161
|
+
X && e.autoAppendAssistant !== !1 && h((V) => V + X);
|
|
162
162
|
} else I.type === "checkpoint" ? w(I.checkpointId) : I.type === "error" && u(I.message);
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
} catch (
|
|
166
|
-
if ((
|
|
167
|
-
const _ = (
|
|
165
|
+
} catch (R) {
|
|
166
|
+
if ((R == null ? void 0 : R.name) === "AbortError") return;
|
|
167
|
+
const _ = (R == null ? void 0 : R.message) || String(R);
|
|
168
168
|
u(_), (N = E == null ? void 0 : E.onError) == null || N.call(E, _);
|
|
169
169
|
} finally {
|
|
170
170
|
a(!1), y.current = null;
|
|
171
171
|
}
|
|
172
|
-
})(), { close: () =>
|
|
172
|
+
})(), { close: () => A.abort() };
|
|
173
173
|
},
|
|
174
174
|
[t, r, e.autoAppendAssistant]
|
|
175
175
|
);
|
|
@@ -385,97 +385,105 @@ function un({
|
|
|
385
385
|
onThreadChange: r,
|
|
386
386
|
initialThreadId: o = null
|
|
387
387
|
}) {
|
|
388
|
-
const s = ua(), i = (t == null ? void 0 : t.baseUrl) ?? s.baseUrl, [a, d] =
|
|
388
|
+
const s = ua(), i = (t == null ? void 0 : t.baseUrl) ?? s.baseUrl, [a, d] = Q((t == null ? void 0 : t.apiKey) ?? s.apiKey ?? null), u = ke(() => new Jr(i), [i]), { isStreaming: f, error: h, stream: m, stop: w, setToken: y } = Qi({ baseUrl: u.baseUrl, token: a, headers: t == null ? void 0 : t.headers, streamPath: "/stream" });
|
|
389
389
|
ue(() => y(a ?? null), [a, y]);
|
|
390
|
-
const { state: p, seed: g, pushUser: v, onEvent: b, reset: x } = oa(), [S, E] =
|
|
391
|
-
const
|
|
392
|
-
E(
|
|
390
|
+
const { state: p, seed: g, pushUser: v, onEvent: b, reset: x } = oa(), [S, E] = Q([]), [A, N] = Q(null), R = he(async () => {
|
|
391
|
+
const T = await u.listThreads();
|
|
392
|
+
E(T);
|
|
393
393
|
}, [u]);
|
|
394
394
|
ue(() => {
|
|
395
|
-
|
|
396
|
-
});
|
|
397
|
-
}, [A]), ue(() => {
|
|
398
|
-
r == null || r(T);
|
|
399
|
-
}, [T, r]), ue(() => {
|
|
400
|
-
o && _(o).catch(() => {
|
|
395
|
+
R().catch(() => {
|
|
401
396
|
});
|
|
397
|
+
}, [R]), ue(() => {
|
|
398
|
+
r == null || r(A);
|
|
399
|
+
}, [A, r]);
|
|
400
|
+
const _ = We(null);
|
|
401
|
+
ue(() => {
|
|
402
|
+
o && _.current !== o && (_.current = o, B(o).catch(() => {
|
|
403
|
+
}));
|
|
402
404
|
}, [o]);
|
|
403
|
-
const
|
|
404
|
-
async (
|
|
405
|
-
var
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
405
|
+
const D = We(null), B = he(
|
|
406
|
+
async (T, k, se) => {
|
|
407
|
+
var ae;
|
|
408
|
+
if (D.current !== T) {
|
|
409
|
+
D.current = T;
|
|
410
|
+
try {
|
|
411
|
+
const re = k ?? ((ae = (await u.listCheckpoints(T)).checkpoints.slice().sort((H, J) => new Date(J.createdAt).getTime() - new Date(H.createdAt).getTime())[0]) == null ? void 0 : ae.checkpointId), ie = await u.getMessages({ threadId: T, checkpointId: re, checkpointNs: se });
|
|
412
|
+
N(T), g(ie.messages);
|
|
413
|
+
} finally {
|
|
414
|
+
D.current = null;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
409
417
|
},
|
|
410
418
|
[u, g]
|
|
411
|
-
),
|
|
412
|
-
if (!
|
|
413
|
-
const k = await u.getMessages({ threadId:
|
|
419
|
+
), j = he(async (T) => u.listCheckpoints(T), [u]), Y = he(async (T) => {
|
|
420
|
+
if (!A) throw new Error("No active thread");
|
|
421
|
+
const k = await u.getMessages({ threadId: A, checkpointId: T });
|
|
414
422
|
g(k.messages);
|
|
415
|
-
}, [u,
|
|
416
|
-
if (!
|
|
417
|
-
await
|
|
418
|
-
}, [
|
|
423
|
+
}, [u, A, g]), O = he(async () => {
|
|
424
|
+
if (!A) throw new Error("No active thread");
|
|
425
|
+
await B(A);
|
|
426
|
+
}, [A, B]), U = We(!1);
|
|
419
427
|
ue(() => {
|
|
420
|
-
const
|
|
421
|
-
if (
|
|
428
|
+
const T = U.current;
|
|
429
|
+
if (U.current = f, T && !f && A) {
|
|
422
430
|
const k = p.lastCheckpointId ?? void 0;
|
|
423
|
-
u.getMessages({ threadId:
|
|
431
|
+
u.getMessages({ threadId: A, checkpointId: k }).then((se) => g(se.messages)).catch(() => {
|
|
424
432
|
});
|
|
425
433
|
}
|
|
426
|
-
}, [f,
|
|
427
|
-
const
|
|
428
|
-
const k = await u.createThread(
|
|
429
|
-
return await
|
|
430
|
-
}, [u,
|
|
431
|
-
await u.deleteThread(
|
|
432
|
-
}, [u,
|
|
433
|
-
await u.updateThread(
|
|
434
|
-
}, [u,
|
|
435
|
-
var
|
|
436
|
-
if (!
|
|
437
|
-
const
|
|
438
|
-
id: ((
|
|
434
|
+
}, [f, A, p.lastCheckpointId, u, g]);
|
|
435
|
+
const F = he(async (T) => {
|
|
436
|
+
const k = await u.createThread(T);
|
|
437
|
+
return await R(), await B(k.threadId), k.threadId;
|
|
438
|
+
}, [u, R, B]), W = he(async (T) => {
|
|
439
|
+
await u.deleteThread(T), await R(), A === T && (N(null), x([]));
|
|
440
|
+
}, [u, R, A, x]), I = he(async (T, k) => {
|
|
441
|
+
await u.updateThread(T, k), await R();
|
|
442
|
+
}, [u, R]), X = he(async (T, k) => {
|
|
443
|
+
var re;
|
|
444
|
+
if (!A) throw new Error("No active thread");
|
|
445
|
+
const se = {
|
|
446
|
+
id: ((re = crypto.randomUUID) == null ? void 0 : re.call(crypto)) || `user-${Date.now()}`,
|
|
439
447
|
role: "user",
|
|
440
|
-
content: [{ type: "text", text:
|
|
448
|
+
content: [{ type: "text", text: T }],
|
|
441
449
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
442
450
|
checkpointId: (k == null ? void 0 : k.checkpointId) ?? p.lastCheckpointId ?? void 0
|
|
443
451
|
};
|
|
444
|
-
v(
|
|
445
|
-
const
|
|
446
|
-
threadId:
|
|
447
|
-
payload: { messages: [
|
|
452
|
+
v(se);
|
|
453
|
+
const ae = {
|
|
454
|
+
threadId: A,
|
|
455
|
+
payload: { messages: [se], ...(k == null ? void 0 : k.payloadExtras) ?? {} },
|
|
448
456
|
checkpointId: (k == null ? void 0 : k.checkpointId) ?? p.lastCheckpointId ?? void 0,
|
|
449
457
|
checkpointNs: k == null ? void 0 : k.checkpointNs,
|
|
450
458
|
nodeFilter: k == null ? void 0 : k.nodeFilter,
|
|
451
459
|
config: k == null ? void 0 : k.config
|
|
452
460
|
};
|
|
453
|
-
m(
|
|
454
|
-
}, [
|
|
461
|
+
m(ae, (ie) => b(ie), { onError: (ie) => console.warn("stream error", ie) });
|
|
462
|
+
}, [A, v, m, b, p.lastCheckpointId]), V = {
|
|
455
463
|
baseUrl: u.baseUrl,
|
|
456
464
|
token: a,
|
|
457
465
|
setToken: d,
|
|
458
466
|
api: u,
|
|
459
467
|
threads: S,
|
|
460
|
-
currentThreadId:
|
|
468
|
+
currentThreadId: A,
|
|
461
469
|
setCurrentThreadId: N,
|
|
462
470
|
messages: p.messages,
|
|
463
471
|
isStreaming: f,
|
|
464
472
|
error: h,
|
|
465
473
|
lastCheckpointId: p.lastCheckpointId,
|
|
466
474
|
streamingAssistantId: p.assemblingId,
|
|
467
|
-
refreshThreads:
|
|
468
|
-
createThread:
|
|
469
|
-
deleteThread:
|
|
470
|
-
renameThread:
|
|
471
|
-
loadThread:
|
|
472
|
-
listCheckpoints:
|
|
473
|
-
navigateToCheckpoint:
|
|
474
|
-
returnToLatest:
|
|
475
|
-
send:
|
|
475
|
+
refreshThreads: R,
|
|
476
|
+
createThread: F,
|
|
477
|
+
deleteThread: W,
|
|
478
|
+
renameThread: I,
|
|
479
|
+
loadThread: B,
|
|
480
|
+
listCheckpoints: j,
|
|
481
|
+
navigateToCheckpoint: Y,
|
|
482
|
+
returnToLatest: O,
|
|
483
|
+
send: X,
|
|
476
484
|
stop: w
|
|
477
485
|
};
|
|
478
|
-
return /* @__PURE__ */ c(Qr.Provider, { value:
|
|
486
|
+
return /* @__PURE__ */ c(Qr.Provider, { value: V, children: e });
|
|
479
487
|
}
|
|
480
488
|
function eo() {
|
|
481
489
|
const e = Kr(Qr);
|
|
@@ -573,7 +581,7 @@ function pa(e, t) {
|
|
|
573
581
|
}
|
|
574
582
|
return [r, o];
|
|
575
583
|
}
|
|
576
|
-
function
|
|
584
|
+
function Ze(e, t = []) {
|
|
577
585
|
let n = [];
|
|
578
586
|
function r(s, i) {
|
|
579
587
|
const a = l.createContext(i), d = n.length;
|
|
@@ -623,8 +631,8 @@ function ma(...e) {
|
|
|
623
631
|
};
|
|
624
632
|
return n.scopeName = t.scopeName, n;
|
|
625
633
|
}
|
|
626
|
-
var
|
|
627
|
-
}, ga = l[" useInsertionEffect ".trim().toString()] ||
|
|
634
|
+
var ce = globalThis != null && globalThis.document ? l.useLayoutEffect : () => {
|
|
635
|
+
}, ga = l[" useInsertionEffect ".trim().toString()] || ce;
|
|
628
636
|
function gt({
|
|
629
637
|
prop: e,
|
|
630
638
|
defaultProp: t,
|
|
@@ -750,13 +758,13 @@ function Ca(e) {
|
|
|
750
758
|
return l.useEffect(() => {
|
|
751
759
|
const u = xt(r.current);
|
|
752
760
|
s.current = a === "mounted" ? u : "none";
|
|
753
|
-
}, [a]),
|
|
761
|
+
}, [a]), ce(() => {
|
|
754
762
|
const u = r.current, f = o.current;
|
|
755
763
|
if (f !== e) {
|
|
756
764
|
const m = s.current, w = xt(u);
|
|
757
765
|
e ? d("MOUNT") : w === "none" || (u == null ? void 0 : u.display) === "none" ? d("UNMOUNT") : d(f && m !== w ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
|
|
758
766
|
}
|
|
759
|
-
}, [e, d]),
|
|
767
|
+
}, [e, d]), ce(() => {
|
|
760
768
|
if (t) {
|
|
761
769
|
let u;
|
|
762
770
|
const f = t.ownerDocument.defaultView ?? window, h = (w) => {
|
|
@@ -792,13 +800,13 @@ function Na(e) {
|
|
|
792
800
|
}
|
|
793
801
|
var Ea = l[" useId ".trim().toString()] || (() => {
|
|
794
802
|
}), Ta = 0;
|
|
795
|
-
function
|
|
803
|
+
function Ye(e) {
|
|
796
804
|
const [t, n] = l.useState(Ea());
|
|
797
|
-
return
|
|
805
|
+
return ce(() => {
|
|
798
806
|
n((r) => r ?? String(Ta++));
|
|
799
807
|
}, [e]), t ? `radix-${t}` : "";
|
|
800
808
|
}
|
|
801
|
-
var Gt = "Collapsible", [Aa, nf] =
|
|
809
|
+
var Gt = "Collapsible", [Aa, nf] = Ze(Gt), [Ra, Bn] = Aa(Gt), ro = l.forwardRef(
|
|
802
810
|
(e, t) => {
|
|
803
811
|
const {
|
|
804
812
|
__scopeCollapsible: n,
|
|
@@ -818,7 +826,7 @@ var Gt = "Collapsible", [Aa, nf] = qe(Gt), [Ra, Bn] = Aa(Gt), ro = l.forwardRef(
|
|
|
818
826
|
{
|
|
819
827
|
scope: n,
|
|
820
828
|
disabled: s,
|
|
821
|
-
contentId:
|
|
829
|
+
contentId: Ye(),
|
|
822
830
|
open: d,
|
|
823
831
|
onOpenToggle: l.useCallback(() => u((f) => !f), [u]),
|
|
824
832
|
children: /* @__PURE__ */ c(
|
|
@@ -867,7 +875,7 @@ var Ia = l.forwardRef((e, t) => {
|
|
|
867
875
|
return l.useEffect(() => {
|
|
868
876
|
const b = requestAnimationFrame(() => g.current = !1);
|
|
869
877
|
return () => cancelAnimationFrame(b);
|
|
870
|
-
}, []),
|
|
878
|
+
}, []), ce(() => {
|
|
871
879
|
const b = u.current;
|
|
872
880
|
if (b) {
|
|
873
881
|
v.current = v.current || {
|
|
@@ -943,112 +951,112 @@ function Da({
|
|
|
943
951
|
onEdit: x,
|
|
944
952
|
onRegenerate: S,
|
|
945
953
|
onEditFromCheckpoint: E,
|
|
946
|
-
onCancelEdit:
|
|
954
|
+
onCancelEdit: A,
|
|
947
955
|
onCopy: N
|
|
948
956
|
}) {
|
|
949
|
-
const [
|
|
957
|
+
const [R, _] = Q(!1), [D, B] = Q(!1), [j, Y] = Q(!1), O = d === "phone" || d === "half-screen", U = e.role, F = U === "tool", W = ke(() => Ma(e.content), [e.content]), I = ke(() => za(e.content), [e.content]), X = ke(() => e.content.filter(($) => $.type === "image_url"), [e.content]), V = Va(W, n ? r : 0), T = async () => {
|
|
950
958
|
try {
|
|
951
|
-
const
|
|
952
|
-
await navigator.clipboard.writeText(
|
|
953
|
-
} catch (
|
|
954
|
-
console.error("Failed to copy:",
|
|
959
|
+
const $ = F ? lt(e.content) : W;
|
|
960
|
+
await navigator.clipboard.writeText($), _(!0), setTimeout(() => _(!1), 2e3), N == null || N($);
|
|
961
|
+
} catch ($) {
|
|
962
|
+
console.error("Failed to copy:", $);
|
|
955
963
|
}
|
|
956
|
-
},
|
|
964
|
+
}, k = () => {
|
|
957
965
|
if (!x) return;
|
|
958
|
-
const
|
|
959
|
-
x(e.id,
|
|
960
|
-
}, se = () => S == null ? void 0 : S(t),
|
|
961
|
-
const
|
|
962
|
-
switch (
|
|
966
|
+
const $ = F ? lt(e.content) : W;
|
|
967
|
+
x(e.id, $);
|
|
968
|
+
}, se = () => S == null ? void 0 : S(t), ae = () => {
|
|
969
|
+
const L = M(O ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0");
|
|
970
|
+
switch (U) {
|
|
963
971
|
case "user":
|
|
964
|
-
return /* @__PURE__ */ c(_i, { className:
|
|
972
|
+
return /* @__PURE__ */ c(_i, { className: L });
|
|
965
973
|
case "assistant":
|
|
966
|
-
return /* @__PURE__ */ c(dr, { className:
|
|
974
|
+
return /* @__PURE__ */ c(dr, { className: L });
|
|
967
975
|
case "tool":
|
|
968
|
-
return /* @__PURE__ */ c(ki, { className:
|
|
976
|
+
return /* @__PURE__ */ c(ki, { className: L });
|
|
969
977
|
default:
|
|
970
|
-
return /* @__PURE__ */ c(dr, { className:
|
|
978
|
+
return /* @__PURE__ */ c(dr, { className: L });
|
|
971
979
|
}
|
|
972
|
-
},
|
|
973
|
-
const
|
|
974
|
-
switch (
|
|
980
|
+
}, re = () => {
|
|
981
|
+
const $ = "group relative mb-4 max-w-full";
|
|
982
|
+
switch (U) {
|
|
975
983
|
case "user":
|
|
976
|
-
return M(
|
|
984
|
+
return M($, "flex justify-end");
|
|
977
985
|
case "assistant":
|
|
978
986
|
case "tool":
|
|
979
987
|
case "system":
|
|
980
|
-
return M(
|
|
988
|
+
return M($, "flex justify-start");
|
|
981
989
|
default:
|
|
982
|
-
return
|
|
990
|
+
return $;
|
|
983
991
|
}
|
|
984
|
-
},
|
|
985
|
-
const
|
|
992
|
+
}, ie = () => {
|
|
993
|
+
const $ = M(
|
|
986
994
|
"rounded-lg px-4 py-3 relative transition-all duration-200",
|
|
987
995
|
O && "px-3 py-2 text-sm"
|
|
988
996
|
);
|
|
989
|
-
switch (
|
|
997
|
+
switch (U) {
|
|
990
998
|
case "user":
|
|
991
|
-
return M(
|
|
999
|
+
return M($, "bg-primary text-primary-foreground max-w-[95%]", d === "phone" && "max-w-[98%]");
|
|
992
1000
|
case "assistant":
|
|
993
|
-
return M(
|
|
1001
|
+
return M($, "bg-muted text-muted-foreground max-w-[95%] border", d === "phone" && "max-w-[98%]");
|
|
994
1002
|
case "tool":
|
|
995
|
-
return M(
|
|
1003
|
+
return M($, "bg-secondary/50 text-secondary-foreground border border-dashed max-w-[95%]", d === "phone" && "max-w-[98%]");
|
|
996
1004
|
case "system":
|
|
997
|
-
return M(
|
|
1005
|
+
return M($, "bg-accent/40 text-muted-foreground max-w-[85%] border");
|
|
998
1006
|
default:
|
|
999
|
-
return
|
|
1007
|
+
return $;
|
|
1000
1008
|
}
|
|
1001
|
-
},
|
|
1002
|
-
if (
|
|
1009
|
+
}, H = ($) => {
|
|
1010
|
+
if (!$) return "";
|
|
1003
1011
|
try {
|
|
1004
|
-
return new Date(
|
|
1012
|
+
return new Date($).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
1005
1013
|
} catch {
|
|
1006
1014
|
return "";
|
|
1007
1015
|
}
|
|
1008
|
-
},
|
|
1009
|
-
if (
|
|
1010
|
-
const
|
|
1016
|
+
}, J = () => {
|
|
1017
|
+
if (F && !j) {
|
|
1018
|
+
const L = lt(e.content).slice(0, 80).replace(/\s+/g, " ");
|
|
1011
1019
|
return /* @__PURE__ */ c("div", { className: M("text-xs font-mono opacity-70 flex items-center justify-between gap-2", O && "text-[10px]"), children: /* @__PURE__ */ C("span", { className: "truncate max-w-full", children: [
|
|
1012
|
-
|
|
1013
|
-
|
|
1020
|
+
L,
|
|
1021
|
+
L.length >= 80 ? "…" : ""
|
|
1014
1022
|
] }) });
|
|
1015
1023
|
}
|
|
1016
|
-
if (
|
|
1017
|
-
const
|
|
1018
|
-
return /* @__PURE__ */ c(_a, { open: D, onOpenChange:
|
|
1019
|
-
/* @__PURE__ */ c("pre", { className: M("whitespace-pre-wrap break-words", O && "text-xs"), children: q && !D ?
|
|
1024
|
+
if (F && u) {
|
|
1025
|
+
const L = lt(e.content), q = L.length > f;
|
|
1026
|
+
return /* @__PURE__ */ c(_a, { open: D, onOpenChange: B, children: /* @__PURE__ */ C("div", { className: "font-mono text-sm", children: [
|
|
1027
|
+
/* @__PURE__ */ c("pre", { className: M("whitespace-pre-wrap break-words", O && "text-xs"), children: q && !D ? L.substring(0, f) + "..." : L }),
|
|
1020
1028
|
q && /* @__PURE__ */ c(Oa, { asChild: !0, children: /* @__PURE__ */ c(ne, { variant: "ghost", size: "sm", className: "h-6 text-xs", children: D ? /* @__PURE__ */ C(_e, { children: [
|
|
1021
1029
|
/* @__PURE__ */ c(At, { className: "h-3 w-3 mr-1" }),
|
|
1022
1030
|
"Show less"
|
|
1023
1031
|
] }) : /* @__PURE__ */ C(_e, { children: [
|
|
1024
1032
|
/* @__PURE__ */ c(ut, { className: "h-3 w-3 mr-1" }),
|
|
1025
1033
|
"Show more (",
|
|
1026
|
-
|
|
1034
|
+
L.length - f,
|
|
1027
1035
|
" chars)"
|
|
1028
1036
|
] }) }) })
|
|
1029
1037
|
] }) });
|
|
1030
1038
|
}
|
|
1031
|
-
if (
|
|
1032
|
-
const
|
|
1033
|
-
if (
|
|
1034
|
-
return /* @__PURE__ */ c(fn, { content:
|
|
1039
|
+
if (F && j && !u) {
|
|
1040
|
+
const L = Wa(e.content);
|
|
1041
|
+
if (L && La(L))
|
|
1042
|
+
return /* @__PURE__ */ c(fn, { content: L.trim() });
|
|
1035
1043
|
const q = lt(e.content);
|
|
1036
1044
|
return /* @__PURE__ */ c("div", { className: "font-mono text-sm", children: /* @__PURE__ */ c("pre", { className: M("whitespace-pre-wrap break-words", O && "text-xs"), children: q }) });
|
|
1037
1045
|
}
|
|
1038
|
-
const
|
|
1046
|
+
const $ = X.length > 0 && U !== "tool";
|
|
1039
1047
|
return /* @__PURE__ */ C("div", { children: [
|
|
1040
1048
|
n ? /* @__PURE__ */ C("div", { className: "relative", children: [
|
|
1041
1049
|
(() => {
|
|
1042
|
-
const
|
|
1043
|
-
return
|
|
1050
|
+
const L = gr(V);
|
|
1051
|
+
return L !== null ? /* @__PURE__ */ c(vr, { data: L }) : /* @__PURE__ */ c(fn, { content: Fa($a(V)) });
|
|
1044
1052
|
})(),
|
|
1045
1053
|
/* @__PURE__ */ c("span", { className: "inline-block w-[6px] h-[14px] align-baseline ml-0.5 bg-foreground/40 animate-pulse", style: { verticalAlign: "text-bottom" } })
|
|
1046
1054
|
] }) : (() => {
|
|
1047
|
-
const
|
|
1048
|
-
return
|
|
1055
|
+
const L = gr(W.trim());
|
|
1056
|
+
return L !== null ? /* @__PURE__ */ c(vr, { data: L }) : /* @__PURE__ */ c(fn, { content: W.trim() });
|
|
1049
1057
|
})(),
|
|
1050
|
-
|
|
1051
|
-
/* @__PURE__ */ c("img", { src:
|
|
1058
|
+
$ && /* @__PURE__ */ c("div", { className: "mt-2 grid grid-cols-2 gap-2", children: X.map((L, q) => /* @__PURE__ */ C("div", { className: "relative border rounded overflow-hidden", children: [
|
|
1059
|
+
/* @__PURE__ */ c("img", { src: L.url, alt: L.alt ?? "image", className: "w-full h-auto" }),
|
|
1052
1060
|
/* @__PURE__ */ C("div", { className: "absolute top-1 right-1 bg-background/70 rounded px-1 py-0.5 text-[10px] flex items-center gap-1", children: [
|
|
1053
1061
|
/* @__PURE__ */ c(Oi, { className: "h-3 w-3" }),
|
|
1054
1062
|
/* @__PURE__ */ c("span", { children: "image" })
|
|
@@ -1056,8 +1064,8 @@ function Da({
|
|
|
1056
1064
|
] }, q)) })
|
|
1057
1065
|
] });
|
|
1058
1066
|
}, oe = ke(() => Ha(e), [e]);
|
|
1059
|
-
return ke(() => Ua(e, w), [e, w]), /* @__PURE__ */ c("div", { className: M(
|
|
1060
|
-
(i || a ||
|
|
1067
|
+
return ke(() => Ua(e, w), [e, w]), /* @__PURE__ */ c("div", { className: M(re(), h.container), children: /* @__PURE__ */ C("div", { className: M(ie(), h.content), children: [
|
|
1068
|
+
(i || a || F) && /* @__PURE__ */ C(
|
|
1061
1069
|
"div",
|
|
1062
1070
|
{
|
|
1063
1071
|
className: M(
|
|
@@ -1067,27 +1075,27 @@ function Da({
|
|
|
1067
1075
|
),
|
|
1068
1076
|
children: [
|
|
1069
1077
|
/* @__PURE__ */ C("div", { className: "flex items-center gap-2", children: [
|
|
1070
|
-
|
|
1078
|
+
ae(),
|
|
1071
1079
|
a && oe && /* @__PURE__ */ c("span", { className: M("font-medium", O ? "text-xs" : "text-sm"), children: oe }),
|
|
1072
|
-
|
|
1080
|
+
F && I.name && /* @__PURE__ */ C(
|
|
1073
1081
|
no,
|
|
1074
1082
|
{
|
|
1075
1083
|
variant: "outline",
|
|
1076
1084
|
className: M("text-xs flex items-center gap-1 cursor-pointer", O && "text-xs h-4"),
|
|
1077
|
-
onClick: () =>
|
|
1085
|
+
onClick: () => Y(($) => !$),
|
|
1078
1086
|
children: [
|
|
1079
1087
|
/* @__PURE__ */ c("span", { children: I.name }),
|
|
1080
|
-
/* @__PURE__ */ c("span", { className: "inline-flex items-center", children:
|
|
1088
|
+
/* @__PURE__ */ c("span", { className: "inline-flex items-center", children: j ? /* @__PURE__ */ c(At, { className: "h-3 w-3" }) : /* @__PURE__ */ c(ut, { className: "h-3 w-3" }) })
|
|
1081
1089
|
]
|
|
1082
1090
|
}
|
|
1083
1091
|
),
|
|
1084
|
-
|
|
1092
|
+
F && !I.name && /* @__PURE__ */ c(ne, { variant: "ghost", size: "sm", className: "h-6 px-1", onClick: () => Y(($) => !$), children: /* @__PURE__ */ C("span", { className: "text-xs flex items-center gap-1", children: [
|
|
1085
1093
|
"Tool Output ",
|
|
1086
|
-
|
|
1094
|
+
j ? /* @__PURE__ */ c(At, { className: "h-3 w-3" }) : /* @__PURE__ */ c(ut, { className: "h-3 w-3" })
|
|
1087
1095
|
] }) })
|
|
1088
1096
|
] }),
|
|
1089
1097
|
/* @__PURE__ */ C("div", { className: "flex items-center gap-2", children: [
|
|
1090
|
-
i && /* @__PURE__ */ c("span", { className: M("text-xs opacity-60", O && "text-xs"), children:
|
|
1098
|
+
i && /* @__PURE__ */ c("span", { className: M("text-xs opacity-60", O && "text-xs"), children: H(e.createdAt) }),
|
|
1091
1099
|
s && !o && /* @__PURE__ */ C(
|
|
1092
1100
|
"div",
|
|
1093
1101
|
{
|
|
@@ -1102,22 +1110,22 @@ function Da({
|
|
|
1102
1110
|
{
|
|
1103
1111
|
variant: "ghost",
|
|
1104
1112
|
size: "sm",
|
|
1105
|
-
onClick:
|
|
1113
|
+
onClick: T,
|
|
1106
1114
|
className: M("h-6 w-6 p-0 hover:bg-background/50", O && "h-5 w-5"),
|
|
1107
|
-
children: /* @__PURE__ */ c(cr, { className: M(
|
|
1115
|
+
children: /* @__PURE__ */ c(cr, { className: M(R ? "text-success" : "", O ? "h-3 w-3" : "h-4 w-4") })
|
|
1108
1116
|
}
|
|
1109
1117
|
),
|
|
1110
|
-
|
|
1118
|
+
U === "user" && x && /* @__PURE__ */ c(
|
|
1111
1119
|
ne,
|
|
1112
1120
|
{
|
|
1113
1121
|
variant: "ghost",
|
|
1114
1122
|
size: "sm",
|
|
1115
|
-
onClick:
|
|
1123
|
+
onClick: k,
|
|
1116
1124
|
className: M("h-6 w-6 p-0 hover:bg-background/50", O && "h-5 w-5"),
|
|
1117
1125
|
children: /* @__PURE__ */ c(lr, { className: M(O ? "h-3 w-3" : "h-4 w-4") })
|
|
1118
1126
|
}
|
|
1119
1127
|
),
|
|
1120
|
-
|
|
1128
|
+
U === "assistant" && S && /* @__PURE__ */ c(
|
|
1121
1129
|
ne,
|
|
1122
1130
|
{
|
|
1123
1131
|
variant: "ghost",
|
|
@@ -1134,8 +1142,8 @@ function Da({
|
|
|
1134
1142
|
]
|
|
1135
1143
|
}
|
|
1136
1144
|
),
|
|
1137
|
-
/* @__PURE__ */ c("div", { className: "relative", children:
|
|
1138
|
-
|
|
1145
|
+
/* @__PURE__ */ c("div", { className: "relative", children: J() }),
|
|
1146
|
+
F && j && (I.toolCallId || I.name) && /* @__PURE__ */ C("div", { className: M("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", O && "text-xs"), children: [
|
|
1139
1147
|
I.name && /* @__PURE__ */ C("div", { children: [
|
|
1140
1148
|
"Function: ",
|
|
1141
1149
|
I.name
|
|
@@ -1145,7 +1153,7 @@ function Da({
|
|
|
1145
1153
|
I.toolCallId
|
|
1146
1154
|
] })
|
|
1147
1155
|
] }),
|
|
1148
|
-
s &&
|
|
1156
|
+
s && U === "user" && g && g.totalBranches > 1 && /* @__PURE__ */ C("div", { className: "flex items-center gap-2 mt-2 p-2 bg-muted/30 rounded border", children: [
|
|
1149
1157
|
/* @__PURE__ */ c(Gr, { className: "h-3 w-3 text-muted-foreground" }),
|
|
1150
1158
|
/* @__PURE__ */ C("span", { className: "text-xs text-muted-foreground", children: [
|
|
1151
1159
|
"Branch ",
|
|
@@ -1180,7 +1188,7 @@ function Da({
|
|
|
1180
1188
|
)
|
|
1181
1189
|
] })
|
|
1182
1190
|
] }),
|
|
1183
|
-
!(i || a ||
|
|
1191
|
+
!(i || a || F) && s && !o && /* @__PURE__ */ C(
|
|
1184
1192
|
"div",
|
|
1185
1193
|
{
|
|
1186
1194
|
className: M(
|
|
@@ -1194,22 +1202,22 @@ function Da({
|
|
|
1194
1202
|
{
|
|
1195
1203
|
variant: "ghost",
|
|
1196
1204
|
size: "sm",
|
|
1197
|
-
onClick:
|
|
1205
|
+
onClick: T,
|
|
1198
1206
|
className: M("h-6 w-6 p-0 hover:bg-background/50", O && "h-5 w-5"),
|
|
1199
|
-
children: /* @__PURE__ */ c(cr, { className: M(
|
|
1207
|
+
children: /* @__PURE__ */ c(cr, { className: M(R ? "text-success" : "", O ? "h-3 w-3" : "h-4 w-4") })
|
|
1200
1208
|
}
|
|
1201
1209
|
),
|
|
1202
|
-
|
|
1210
|
+
U === "user" && x && /* @__PURE__ */ c(
|
|
1203
1211
|
ne,
|
|
1204
1212
|
{
|
|
1205
1213
|
variant: "ghost",
|
|
1206
1214
|
size: "sm",
|
|
1207
|
-
onClick:
|
|
1215
|
+
onClick: k,
|
|
1208
1216
|
className: M("h-6 w-6 p-0 hover:bg-background/50", O && "h-5 w-5"),
|
|
1209
1217
|
children: /* @__PURE__ */ c(lr, { className: M(O ? "h-3 w-3" : "h-4 w-4") })
|
|
1210
1218
|
}
|
|
1211
1219
|
),
|
|
1212
|
-
|
|
1220
|
+
U === "assistant" && S && /* @__PURE__ */ c(
|
|
1213
1221
|
ne,
|
|
1214
1222
|
{
|
|
1215
1223
|
variant: "ghost",
|
|
@@ -1340,7 +1348,7 @@ function Ua(e, t) {
|
|
|
1340
1348
|
return e.checkpointId || t || null;
|
|
1341
1349
|
}
|
|
1342
1350
|
function Va(e, t) {
|
|
1343
|
-
const [n, r] =
|
|
1351
|
+
const [n, r] = Q(e);
|
|
1344
1352
|
return ue(() => {
|
|
1345
1353
|
if (!t) {
|
|
1346
1354
|
r(e);
|
|
@@ -1350,7 +1358,7 @@ function Va(e, t) {
|
|
|
1350
1358
|
return () => clearTimeout(o);
|
|
1351
1359
|
}, [e, t]), n;
|
|
1352
1360
|
}
|
|
1353
|
-
const
|
|
1361
|
+
const tt = 1e4;
|
|
1354
1362
|
function ja(e) {
|
|
1355
1363
|
if (typeof e != "string")
|
|
1356
1364
|
return String(e);
|
|
@@ -1378,7 +1386,7 @@ function ja(e) {
|
|
|
1378
1386
|
`).replace(/<li>(.*?)<\/li>/gi, `- $1
|
|
1379
1387
|
`).trim() : n.replace(/</g, "<").replace(/>/g, ">").trim();
|
|
1380
1388
|
}
|
|
1381
|
-
function Ya(e, t =
|
|
1389
|
+
function Ya(e, t = tt) {
|
|
1382
1390
|
if (!e || typeof e != "string")
|
|
1383
1391
|
throw new Error("Invalid content: must be a non-empty string");
|
|
1384
1392
|
if (e.length > t)
|
|
@@ -1413,7 +1421,7 @@ function hn({
|
|
|
1413
1421
|
listCheckpoints: b,
|
|
1414
1422
|
navigateToCheckpoint: x,
|
|
1415
1423
|
returnToLatest: S
|
|
1416
|
-
} = eo(), [E,
|
|
1424
|
+
} = eo(), [E, A] = Q(""), [N, R] = Q(null), [_, D] = Q(null), [B, j] = Q([]), [Y, O] = Q(!1), [U, F] = Q([]), [W, I] = Q(null), X = We(null), V = We(null), T = We(null), [k, se] = Q("desktop");
|
|
1417
1425
|
ue(() => {
|
|
1418
1426
|
const P = () => {
|
|
1419
1427
|
const z = window.innerWidth;
|
|
@@ -1422,24 +1430,24 @@ function hn({
|
|
|
1422
1430
|
return P(), window.addEventListener("resize", P), () => window.removeEventListener("resize", P);
|
|
1423
1431
|
}, []), ue(() => {
|
|
1424
1432
|
var P;
|
|
1425
|
-
(P =
|
|
1433
|
+
(P = X.current) == null || P.scrollIntoView({ behavior: "smooth" });
|
|
1426
1434
|
}, [h]), ue(() => {
|
|
1427
1435
|
var P;
|
|
1428
|
-
n && ((P =
|
|
1436
|
+
n && ((P = V.current) == null || P.focus());
|
|
1429
1437
|
}, [n]), ue(() => {
|
|
1430
|
-
y && !
|
|
1431
|
-
}, [y,
|
|
1438
|
+
y && !Y && (u == null || u(y));
|
|
1439
|
+
}, [y, Y, u]), ue(() => {
|
|
1432
1440
|
let P = !0;
|
|
1433
1441
|
if (!f) {
|
|
1434
|
-
|
|
1442
|
+
F([]), I(null);
|
|
1435
1443
|
return;
|
|
1436
1444
|
}
|
|
1437
1445
|
return b(f).then((z) => {
|
|
1438
1446
|
var te, de;
|
|
1439
1447
|
if (!P) return;
|
|
1440
|
-
|
|
1441
|
-
const K = ((de = (te = z.checkpoints) == null ? void 0 : te.slice().sort((
|
|
1442
|
-
I((
|
|
1448
|
+
F(z.checkpoints || []);
|
|
1449
|
+
const K = ((de = (te = z.checkpoints) == null ? void 0 : te.slice().sort((le, ln) => new Date(ln.createdAt).getTime() - new Date(le.createdAt).getTime())[0]) == null ? void 0 : de.checkpointId) || null;
|
|
1450
|
+
I((le) => le ?? K);
|
|
1443
1451
|
}).catch(() => {
|
|
1444
1452
|
}), () => {
|
|
1445
1453
|
P = !1;
|
|
@@ -1447,14 +1455,14 @@ function hn({
|
|
|
1447
1455
|
}, [f, b]), ue(() => {
|
|
1448
1456
|
v && I(v);
|
|
1449
1457
|
}, [v]);
|
|
1450
|
-
const
|
|
1451
|
-
if (P.length >
|
|
1458
|
+
const ae = (P) => {
|
|
1459
|
+
if (P.length > tt) return `Message too long (${P.length}/${tt} characters)`;
|
|
1452
1460
|
try {
|
|
1453
1461
|
return Xa(P), null;
|
|
1454
1462
|
} catch (z) {
|
|
1455
1463
|
return (z == null ? void 0 : z.message) || "Invalid message";
|
|
1456
1464
|
}
|
|
1457
|
-
},
|
|
1465
|
+
}, re = (P) => {
|
|
1458
1466
|
const z = P.content || [], K = z.filter((te) => te.type === "text").map((te) => te.text).join("");
|
|
1459
1467
|
if (K) return K;
|
|
1460
1468
|
try {
|
|
@@ -1462,72 +1470,72 @@ function hn({
|
|
|
1462
1470
|
} catch {
|
|
1463
1471
|
return String(z);
|
|
1464
1472
|
}
|
|
1465
|
-
},
|
|
1473
|
+
}, ie = (P) => {
|
|
1466
1474
|
var de;
|
|
1467
|
-
if (!
|
|
1475
|
+
if (!U.length) return [];
|
|
1468
1476
|
const z = (((de = h[P]) == null ? void 0 : de.role) ?? "user") === "user", K = z ? P + 2 : P + 1;
|
|
1469
|
-
return
|
|
1470
|
-
checkpoint_id:
|
|
1471
|
-
checkpoint_ns:
|
|
1472
|
-
message_count:
|
|
1473
|
-
last_message_preview:
|
|
1474
|
-
ts: new Date(
|
|
1475
|
-
isCurrent:
|
|
1476
|
-
})).sort((
|
|
1477
|
-
},
|
|
1477
|
+
return U.filter((le) => (le.messagesLen ?? -1) >= (z ? K : 0)).filter((le) => z ? (le.messagesLen ?? 0) >= K : (le.messagesLen ?? 0) === K).map((le) => ({
|
|
1478
|
+
checkpoint_id: le.checkpointId,
|
|
1479
|
+
checkpoint_ns: le.checkpointNs,
|
|
1480
|
+
message_count: le.messagesLen ?? 0,
|
|
1481
|
+
last_message_preview: le.preview ?? void 0,
|
|
1482
|
+
ts: new Date(le.createdAt).getTime(),
|
|
1483
|
+
isCurrent: le.checkpointId === W
|
|
1484
|
+
})).sort((le, ln) => (le.ts || 0) - (ln.ts || 0));
|
|
1485
|
+
}, H = (P) => {
|
|
1478
1486
|
if (P === void 0) return { canGoBack: !1, canGoForward: !1, currentIndex: 0, totalBranches: 0 };
|
|
1479
|
-
const z =
|
|
1487
|
+
const z = ie(P);
|
|
1480
1488
|
if (z.length <= 1) return { canGoBack: !1, canGoForward: !1, currentIndex: 0, totalBranches: z.length };
|
|
1481
1489
|
const K = Math.max(0, z.findIndex((te) => te.isCurrent));
|
|
1482
1490
|
return { canGoBack: K > 0, canGoForward: K < z.length - 1, currentIndex: K, totalBranches: z.length };
|
|
1483
|
-
},
|
|
1491
|
+
}, J = async () => {
|
|
1484
1492
|
const P = E.trim();
|
|
1485
1493
|
if (!P) return;
|
|
1486
|
-
const z =
|
|
1494
|
+
const z = ae(P);
|
|
1487
1495
|
if (z) {
|
|
1488
1496
|
D(z);
|
|
1489
1497
|
return;
|
|
1490
1498
|
}
|
|
1491
1499
|
try {
|
|
1492
1500
|
const K = window.__editingCheckpointId || W || void 0;
|
|
1493
|
-
await p(P, { checkpointId: K, payloadExtras: N ? { edit: !0, originalMessageId: N } : void 0 }), d == null || d(P),
|
|
1501
|
+
await p(P, { checkpointId: K, payloadExtras: N ? { edit: !0, originalMessageId: N } : void 0 }), d == null || d(P), A(""), D(null), j([]), delete window.__editingCheckpointId, R(null), V.current && (V.current.style.height = "auto");
|
|
1494
1502
|
} catch (K) {
|
|
1495
1503
|
const te = (K == null ? void 0 : K.message) || "Failed to send message";
|
|
1496
1504
|
D(te), u == null || u(te);
|
|
1497
1505
|
}
|
|
1498
1506
|
}, oe = (P, z) => {
|
|
1499
|
-
i && (
|
|
1500
|
-
|
|
1507
|
+
i && (R(P), A(z), D(null), setTimeout(() => {
|
|
1508
|
+
V.current && (V.current.focus(), V.current.style.height = "auto", V.current.style.height = V.current.scrollHeight + "px");
|
|
1501
1509
|
}, 0));
|
|
1502
|
-
},
|
|
1510
|
+
}, $ = async (P, z) => {
|
|
1503
1511
|
const K = h.find((de) => de.id === P);
|
|
1504
1512
|
if (!K) {
|
|
1505
1513
|
D("Message not found");
|
|
1506
1514
|
return;
|
|
1507
1515
|
}
|
|
1508
|
-
const te =
|
|
1509
|
-
|
|
1516
|
+
const te = re(K);
|
|
1517
|
+
R(P), A(te), window.__editingCheckpointId = z, setTimeout(() => {
|
|
1510
1518
|
var de;
|
|
1511
|
-
return (de =
|
|
1519
|
+
return (de = V.current) == null ? void 0 : de.focus();
|
|
1512
1520
|
}, 0);
|
|
1513
|
-
},
|
|
1514
|
-
|
|
1521
|
+
}, L = () => {
|
|
1522
|
+
R(null), A(""), D(null), delete window.__editingCheckpointId, V.current && (V.current.style.height = "auto");
|
|
1515
1523
|
}, q = (P) => {
|
|
1516
|
-
P.key === "Enter" && !P.shiftKey ? (P.preventDefault(),
|
|
1524
|
+
P.key === "Enter" && !P.shiftKey ? (P.preventDefault(), J()) : P.key === "Escape" && N && (P.preventDefault(), L());
|
|
1517
1525
|
}, fe = (P) => {
|
|
1518
1526
|
const z = Array.from(P.target.files || []);
|
|
1519
|
-
|
|
1520
|
-
}, ve = (P) =>
|
|
1527
|
+
j((K) => [...K, ...z]);
|
|
1528
|
+
}, ve = (P) => j((z) => z.filter((K, te) => P !== te)), Ne = async (P) => {
|
|
1521
1529
|
f && (await x(P), I(P));
|
|
1522
1530
|
}, Le = async () => {
|
|
1523
1531
|
await S(), I(null);
|
|
1524
1532
|
};
|
|
1525
1533
|
return /* @__PURE__ */ C("div", { className: `flex flex-col h-full ${e} ${a.container || ""}`, children: [
|
|
1526
|
-
!!y && !
|
|
1534
|
+
!!y && !Y && /* @__PURE__ */ C("div", { className: "bg-red-50 border border-red-200 text-red-800 px-4 py-2 text-sm flex items-center justify-between", children: [
|
|
1527
1535
|
/* @__PURE__ */ c("span", { children: y }),
|
|
1528
1536
|
/* @__PURE__ */ c(ne, { variant: "ghost", size: "sm", onClick: () => O(!0), className: "text-red-800 hover:bg-red-100", children: /* @__PURE__ */ c(ft, { size: 16 }) })
|
|
1529
1537
|
] }),
|
|
1530
|
-
f &&
|
|
1538
|
+
f && U.length > 0 && /* @__PURE__ */ C("div", { className: "flex items-center gap-2 px-4 py-2 border-b bg-background/50 text-xs", children: [
|
|
1531
1539
|
/* @__PURE__ */ c(Gr, { className: "h-4 w-4 opacity-70" }),
|
|
1532
1540
|
/* @__PURE__ */ c("span", { className: "opacity-70", children: "Checkpoint:" }),
|
|
1533
1541
|
/* @__PURE__ */ C(
|
|
@@ -1541,7 +1549,7 @@ function hn({
|
|
|
1541
1549
|
},
|
|
1542
1550
|
children: [
|
|
1543
1551
|
/* @__PURE__ */ c("option", { value: "", children: "Latest" }),
|
|
1544
|
-
|
|
1552
|
+
U.slice().sort((P, z) => new Date(z.createdAt).getTime() - new Date(P.createdAt).getTime()).map((P) => /* @__PURE__ */ C("option", { value: P.checkpointId, children: [
|
|
1545
1553
|
new Date(P.createdAt).toLocaleString(),
|
|
1546
1554
|
" ",
|
|
1547
1555
|
P.preview ? `— ${P.preview.slice(0, 30)}` : ""
|
|
@@ -1562,33 +1570,33 @@ function hn({
|
|
|
1562
1570
|
showActions: i,
|
|
1563
1571
|
showTimestamp: !1,
|
|
1564
1572
|
showAgentName: !0,
|
|
1565
|
-
layoutSize:
|
|
1573
|
+
layoutSize: k,
|
|
1566
1574
|
truncateToolMessages: !1,
|
|
1567
1575
|
toolMessagePreviewLength: 200,
|
|
1568
|
-
checkpointBranches:
|
|
1576
|
+
checkpointBranches: ie(z),
|
|
1569
1577
|
currentCheckpointId: W ?? void 0,
|
|
1570
|
-
temporalNavigation:
|
|
1578
|
+
temporalNavigation: H(z),
|
|
1571
1579
|
onSwitchToCheckpoint: Ne,
|
|
1572
1580
|
onReturnToMainThread: Le,
|
|
1573
1581
|
onNavigateToPreviousBranch: () => {
|
|
1574
|
-
const K =
|
|
1582
|
+
const K = ie(z), te = Math.max(0, K.findIndex((de) => de.isCurrent));
|
|
1575
1583
|
te > 0 && Ne(K[te - 1].checkpoint_id);
|
|
1576
1584
|
},
|
|
1577
1585
|
onNavigateToNextBranch: () => {
|
|
1578
|
-
const K =
|
|
1586
|
+
const K = ie(z), te = Math.max(0, K.findIndex((de) => de.isCurrent));
|
|
1579
1587
|
te >= 0 && te < K.length - 1 && Ne(K[te + 1].checkpoint_id);
|
|
1580
1588
|
},
|
|
1581
1589
|
onEdit: (K, te) => oe(K, te),
|
|
1582
|
-
onEditFromCheckpoint:
|
|
1590
|
+
onEditFromCheckpoint: $,
|
|
1583
1591
|
onRegenerate: () => {
|
|
1584
|
-
const K = [...h].reverse().find((de) => de.role === "user"), te = K ?
|
|
1592
|
+
const K = [...h].reverse().find((de) => de.role === "user"), te = K ? re(K) : "";
|
|
1585
1593
|
te && p(te, { checkpointId: W ?? void 0 });
|
|
1586
1594
|
},
|
|
1587
|
-
onCancelEdit:
|
|
1595
|
+
onCancelEdit: L
|
|
1588
1596
|
},
|
|
1589
1597
|
P.id || z
|
|
1590
1598
|
)),
|
|
1591
|
-
/* @__PURE__ */ c("div", { ref:
|
|
1599
|
+
/* @__PURE__ */ c("div", { ref: X })
|
|
1592
1600
|
] }),
|
|
1593
1601
|
/* @__PURE__ */ C("div", { className: `flex-shrink-0 border-t p-4 ${a.inputArea || ""}`, children: [
|
|
1594
1602
|
N && /* @__PURE__ */ c("div", { className: "mb-3 p-3 bg-blue-50 border border-blue-200 rounded-lg", children: /* @__PURE__ */ C("div", { className: "flex items-center justify-between", children: [
|
|
@@ -1596,11 +1604,11 @@ function hn({
|
|
|
1596
1604
|
/* @__PURE__ */ c(qr, { size: 16, className: "text-blue-600" }),
|
|
1597
1605
|
/* @__PURE__ */ c("span", { className: "text-sm font-medium text-blue-800", children: "Editing message" })
|
|
1598
1606
|
] }),
|
|
1599
|
-
/* @__PURE__ */ c(ne, { variant: "ghost", size: "sm", onClick:
|
|
1607
|
+
/* @__PURE__ */ c(ne, { variant: "ghost", size: "sm", onClick: L, className: "text-blue-600 hover:bg-blue-100", children: /* @__PURE__ */ c(ft, { size: 16 }) })
|
|
1600
1608
|
] }) }),
|
|
1601
1609
|
s && /* @__PURE__ */ C("div", { className: "mb-3", children: [
|
|
1602
|
-
/* @__PURE__ */ c("input", { ref:
|
|
1603
|
-
|
|
1610
|
+
/* @__PURE__ */ c("input", { ref: T, type: "file", multiple: !0, onChange: (P) => fe(P), className: "hidden" }),
|
|
1611
|
+
B.length > 0 && /* @__PURE__ */ c("div", { className: "mb-3 flex flex-wrap gap-2", children: B.map((P, z) => /* @__PURE__ */ C("div", { className: "flex items-center gap-2 bg-gray-100 rounded-lg px-3 py-2 text-sm", children: [
|
|
1604
1612
|
/* @__PURE__ */ c(ur, { size: 14 }),
|
|
1605
1613
|
/* @__PURE__ */ c("span", { className: "truncate max-w-[150px]", children: P.name }),
|
|
1606
1614
|
/* @__PURE__ */ c(ne, { variant: "ghost", size: "sm", onClick: () => ve(z), className: "h-4 w-4 p-0 text-gray-500 hover:text-red-500", children: /* @__PURE__ */ c(ft, { size: 12 }) })
|
|
@@ -1610,30 +1618,30 @@ function hn({
|
|
|
1610
1618
|
/* @__PURE__ */ C("div", { className: "flex items-end gap-2", children: [
|
|
1611
1619
|
s && /* @__PURE__ */ c(ne, { type: "button", onClick: () => {
|
|
1612
1620
|
var P;
|
|
1613
|
-
return (P =
|
|
1621
|
+
return (P = T.current) == null ? void 0 : P.click();
|
|
1614
1622
|
}, size: "icon", variant: "outline", disabled: m, title: "Attach files", children: /* @__PURE__ */ c(ur, { size: 16 }) }),
|
|
1615
1623
|
/* @__PURE__ */ c("div", { className: "flex-1", children: /* @__PURE__ */ c(
|
|
1616
1624
|
to,
|
|
1617
1625
|
{
|
|
1618
|
-
ref:
|
|
1626
|
+
ref: V,
|
|
1619
1627
|
value: E,
|
|
1620
1628
|
onChange: (P) => {
|
|
1621
|
-
|
|
1629
|
+
A(P.target.value), D(null), V.current && (V.current.style.height = "auto", V.current.style.height = V.current.scrollHeight + "px");
|
|
1622
1630
|
},
|
|
1623
1631
|
onKeyDown: q,
|
|
1624
1632
|
placeholder: N ? "Edit your message..." : t,
|
|
1625
1633
|
className: `resize-none min-h-[44px] max-h-[20rem] ${N ? "border-blue-400 bg-blue-50" : ""} ${_ ? "border-red-400" : ""}`,
|
|
1626
1634
|
disabled: !1,
|
|
1627
|
-
maxLength:
|
|
1635
|
+
maxLength: tt,
|
|
1628
1636
|
rows: 1
|
|
1629
1637
|
}
|
|
1630
1638
|
) }),
|
|
1631
|
-
/* @__PURE__ */ c("div", { children: m ? /* @__PURE__ */ c(ne, { type: "button", onClick: g, size: "icon", variant: "outline", className: "shrink-0", title: "Stop generating", children: /* @__PURE__ */ c(Di, { size: 16 }) }) : /* @__PURE__ */ c(ne, { type: "button", onClick:
|
|
1639
|
+
/* @__PURE__ */ c("div", { children: m ? /* @__PURE__ */ c(ne, { type: "button", onClick: g, size: "icon", variant: "outline", className: "shrink-0", title: "Stop generating", children: /* @__PURE__ */ c(Di, { size: 16 }) }) : /* @__PURE__ */ c(ne, { type: "button", onClick: J, size: "icon", disabled: !E.trim(), className: `shrink-0 ${a.sendButton || ""}`, title: N ? "Save changes" : "Send message", children: /* @__PURE__ */ c(Mi, { size: 16 }) }) })
|
|
1632
1640
|
] }),
|
|
1633
|
-
E.length >
|
|
1641
|
+
E.length > tt * 0.8 && /* @__PURE__ */ C("div", { className: "mt-2 text-xs text-gray-500 text-right", children: [
|
|
1634
1642
|
E.length,
|
|
1635
1643
|
"/",
|
|
1636
|
-
|
|
1644
|
+
tt
|
|
1637
1645
|
] })
|
|
1638
1646
|
] })
|
|
1639
1647
|
] });
|
|
@@ -1673,7 +1681,7 @@ function Tn(e, [t, n]) {
|
|
|
1673
1681
|
function Ga(e, t) {
|
|
1674
1682
|
return l.useReducer((n, r) => t[n][r] ?? n, e);
|
|
1675
1683
|
}
|
|
1676
|
-
var Hn = "ScrollArea", [ao, rf] =
|
|
1684
|
+
var Hn = "ScrollArea", [ao, rf] = Ze(Hn), [qa, be] = ao(Hn), co = l.forwardRef(
|
|
1677
1685
|
(e, t) => {
|
|
1678
1686
|
const {
|
|
1679
1687
|
__scopeScrollArea: n,
|
|
@@ -1681,7 +1689,7 @@ var Hn = "ScrollArea", [ao, rf] = qe(Hn), [qa, be] = ao(Hn), co = l.forwardRef(
|
|
|
1681
1689
|
dir: o,
|
|
1682
1690
|
scrollHideDelay: s = 600,
|
|
1683
1691
|
...i
|
|
1684
|
-
} = e, [a, d] = l.useState(null), [u, f] = l.useState(null), [h, m] = l.useState(null), [w, y] = l.useState(null), [p, g] = l.useState(null), [v, b] = l.useState(0), [x, S] = l.useState(0), [E,
|
|
1692
|
+
} = e, [a, d] = l.useState(null), [u, f] = l.useState(null), [h, m] = l.useState(null), [w, y] = l.useState(null), [p, g] = l.useState(null), [v, b] = l.useState(0), [x, S] = l.useState(0), [E, A] = l.useState(!1), [N, R] = l.useState(!1), _ = ee(t, (B) => d(B)), D = io(o);
|
|
1685
1693
|
return /* @__PURE__ */ c(
|
|
1686
1694
|
qa,
|
|
1687
1695
|
{
|
|
@@ -1697,11 +1705,11 @@ var Hn = "ScrollArea", [ao, rf] = qe(Hn), [qa, be] = ao(Hn), co = l.forwardRef(
|
|
|
1697
1705
|
scrollbarX: w,
|
|
1698
1706
|
onScrollbarXChange: y,
|
|
1699
1707
|
scrollbarXEnabled: E,
|
|
1700
|
-
onScrollbarXEnabledChange:
|
|
1708
|
+
onScrollbarXEnabledChange: A,
|
|
1701
1709
|
scrollbarY: p,
|
|
1702
1710
|
onScrollbarYChange: g,
|
|
1703
1711
|
scrollbarYEnabled: N,
|
|
1704
|
-
onScrollbarYEnabledChange:
|
|
1712
|
+
onScrollbarYEnabledChange: R,
|
|
1705
1713
|
onCornerWidthChange: b,
|
|
1706
1714
|
onCornerHeightChange: S,
|
|
1707
1715
|
children: /* @__PURE__ */ c(
|
|
@@ -2003,20 +2011,20 @@ var Za = l.forwardRef((e, t) => {
|
|
|
2003
2011
|
onWheelScroll: f,
|
|
2004
2012
|
onResize: h,
|
|
2005
2013
|
...m
|
|
2006
|
-
} = e, w = be(Pe, n), [y, p] = l.useState(null), g = ee(t, (_) => p(_)), v = l.useRef(null), b = l.useRef(""), x = w.viewport, S = r.content - r.viewport, E = pe(f),
|
|
2007
|
-
function
|
|
2014
|
+
} = e, w = be(Pe, n), [y, p] = l.useState(null), g = ee(t, (_) => p(_)), v = l.useRef(null), b = l.useRef(""), x = w.viewport, S = r.content - r.viewport, E = pe(f), A = pe(d), N = Zt(h, 10);
|
|
2015
|
+
function R(_) {
|
|
2008
2016
|
if (v.current) {
|
|
2009
|
-
const D = _.clientX - v.current.left,
|
|
2010
|
-
u({ x: D, y:
|
|
2017
|
+
const D = _.clientX - v.current.left, B = _.clientY - v.current.top;
|
|
2018
|
+
u({ x: D, y: B });
|
|
2011
2019
|
}
|
|
2012
2020
|
}
|
|
2013
2021
|
return l.useEffect(() => {
|
|
2014
2022
|
const _ = (D) => {
|
|
2015
|
-
const
|
|
2016
|
-
(y == null ? void 0 : y.contains(
|
|
2023
|
+
const B = D.target;
|
|
2024
|
+
(y == null ? void 0 : y.contains(B)) && E(D, S);
|
|
2017
2025
|
};
|
|
2018
2026
|
return document.addEventListener("wheel", _, { passive: !1 }), () => document.removeEventListener("wheel", _, { passive: !1 });
|
|
2019
|
-
}, [x, y, S, E]), l.useEffect(
|
|
2027
|
+
}, [x, y, S, E]), l.useEffect(A, [r, A]), ot(y, N), ot(w.content, N), /* @__PURE__ */ c(
|
|
2020
2028
|
tc,
|
|
2021
2029
|
{
|
|
2022
2030
|
scope: n,
|
|
@@ -2024,7 +2032,7 @@ var Za = l.forwardRef((e, t) => {
|
|
|
2024
2032
|
hasThumb: o,
|
|
2025
2033
|
onThumbChange: pe(s),
|
|
2026
2034
|
onThumbPointerUp: pe(i),
|
|
2027
|
-
onThumbPositionChange:
|
|
2035
|
+
onThumbPositionChange: A,
|
|
2028
2036
|
onThumbPointerDown: pe(a),
|
|
2029
2037
|
children: /* @__PURE__ */ c(
|
|
2030
2038
|
G.div,
|
|
@@ -2033,9 +2041,9 @@ var Za = l.forwardRef((e, t) => {
|
|
|
2033
2041
|
ref: g,
|
|
2034
2042
|
style: { position: "absolute", ...m.style },
|
|
2035
2043
|
onPointerDown: Z(e.onPointerDown, (_) => {
|
|
2036
|
-
_.button === 0 && (_.target.setPointerCapture(_.pointerId), v.current = y.getBoundingClientRect(), b.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", w.viewport && (w.viewport.style.scrollBehavior = "auto"),
|
|
2044
|
+
_.button === 0 && (_.target.setPointerCapture(_.pointerId), v.current = y.getBoundingClientRect(), b.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", w.viewport && (w.viewport.style.scrollBehavior = "auto"), R(_));
|
|
2037
2045
|
}),
|
|
2038
|
-
onPointerMove: Z(e.onPointerMove,
|
|
2046
|
+
onPointerMove: Z(e.onPointerMove, R),
|
|
2039
2047
|
onPointerUp: Z(e.onPointerUp, (_) => {
|
|
2040
2048
|
const D = _.target;
|
|
2041
2049
|
D.hasPointerCapture(_.pointerId) && D.releasePointerCapture(_.pointerId), document.body.style.webkitUserSelect = b.current, w.viewport && (w.viewport.style.scrollBehavior = ""), v.current = null;
|
|
@@ -2168,7 +2176,7 @@ function Zt(e, t) {
|
|
|
2168
2176
|
}
|
|
2169
2177
|
function ot(e, t) {
|
|
2170
2178
|
const n = pe(t);
|
|
2171
|
-
|
|
2179
|
+
ce(() => {
|
|
2172
2180
|
let r = 0;
|
|
2173
2181
|
if (e) {
|
|
2174
2182
|
const o = new ResizeObserver(() => {
|
|
@@ -2225,102 +2233,102 @@ function br({
|
|
|
2225
2233
|
onThreadCreate: f,
|
|
2226
2234
|
onThreadDelete: h
|
|
2227
2235
|
}) {
|
|
2228
|
-
const { api: m, loadThread: w } = eo(), y = ke(() => d ?? m ?? new Jr(), [d, m]), [p, g] =
|
|
2236
|
+
const { api: m, loadThread: w } = eo(), y = ke(() => d ?? m ?? new Jr(), [d, m]), [p, g] = Q([]), [v, b] = Q(!0), [x, S] = Q(null), [E, A] = Q(null), [N, R] = Q(""), [_, D] = Q(!1);
|
|
2229
2237
|
ue(() => {
|
|
2230
|
-
let
|
|
2231
|
-
return b(!0), y.listThreads().then((
|
|
2232
|
-
|
|
2238
|
+
let T = !0;
|
|
2239
|
+
return b(!0), y.listThreads().then((k) => T && g(k)).catch((k) => T && S((k == null ? void 0 : k.message) || String(k))).finally(() => T && b(!1)), () => {
|
|
2240
|
+
T = !1;
|
|
2233
2241
|
};
|
|
2234
2242
|
}, [y]);
|
|
2235
|
-
const
|
|
2243
|
+
const B = async () => {
|
|
2236
2244
|
b(!0);
|
|
2237
2245
|
try {
|
|
2238
|
-
const
|
|
2239
|
-
g(
|
|
2240
|
-
} catch (
|
|
2241
|
-
S((
|
|
2246
|
+
const T = await y.listThreads();
|
|
2247
|
+
g(T);
|
|
2248
|
+
} catch (T) {
|
|
2249
|
+
S((T == null ? void 0 : T.message) || String(T));
|
|
2242
2250
|
} finally {
|
|
2243
2251
|
b(!1);
|
|
2244
2252
|
}
|
|
2245
|
-
},
|
|
2253
|
+
}, j = async (T) => {
|
|
2246
2254
|
try {
|
|
2247
|
-
await w(
|
|
2248
|
-
} catch (
|
|
2249
|
-
console.error("Failed to select thread:",
|
|
2255
|
+
await w(T), a == null || a(T), u == null || u(T);
|
|
2256
|
+
} catch (k) {
|
|
2257
|
+
console.error("Failed to select thread:", k);
|
|
2250
2258
|
}
|
|
2251
|
-
},
|
|
2259
|
+
}, Y = async () => {
|
|
2252
2260
|
try {
|
|
2253
2261
|
D(!0);
|
|
2254
|
-
const
|
|
2255
|
-
await
|
|
2256
|
-
} catch (
|
|
2257
|
-
console.error("Failed to create thread:",
|
|
2262
|
+
const T = await y.createThread();
|
|
2263
|
+
await B(), await w(T.threadId), f == null || f(T.threadId), a == null || a(T.threadId);
|
|
2264
|
+
} catch (T) {
|
|
2265
|
+
console.error("Failed to create thread:", T);
|
|
2258
2266
|
} finally {
|
|
2259
2267
|
D(!1);
|
|
2260
2268
|
}
|
|
2261
|
-
}, O = async (
|
|
2262
|
-
if (
|
|
2269
|
+
}, O = async (T, k) => {
|
|
2270
|
+
if (k.stopPropagation(), !!confirm("Delete this thread?"))
|
|
2263
2271
|
try {
|
|
2264
|
-
await y.deleteThread(
|
|
2272
|
+
await y.deleteThread(T), await B(), h == null || h(T);
|
|
2265
2273
|
} catch (se) {
|
|
2266
2274
|
console.error("Failed to delete thread:", se);
|
|
2267
2275
|
}
|
|
2268
|
-
},
|
|
2269
|
-
|
|
2270
|
-
},
|
|
2276
|
+
}, U = (T, k) => {
|
|
2277
|
+
k.stopPropagation(), A(T.threadId), R(T.title || `Thread ${T.threadId.slice(0, 8)}`);
|
|
2278
|
+
}, F = async (T) => {
|
|
2271
2279
|
if (N.trim())
|
|
2272
2280
|
try {
|
|
2273
|
-
await y.updateThread(
|
|
2274
|
-
} catch (
|
|
2275
|
-
console.error("Failed to update title:",
|
|
2281
|
+
await y.updateThread(T, N.trim()), A(null), R(""), await B();
|
|
2282
|
+
} catch (k) {
|
|
2283
|
+
console.error("Failed to update title:", k);
|
|
2276
2284
|
}
|
|
2277
2285
|
}, W = () => {
|
|
2278
|
-
|
|
2279
|
-
}, I = (
|
|
2280
|
-
|
|
2281
|
-
},
|
|
2282
|
-
if (!
|
|
2286
|
+
A(null), R("");
|
|
2287
|
+
}, I = (T, k) => {
|
|
2288
|
+
T.key === "Enter" ? F(k) : T.key === "Escape" && W();
|
|
2289
|
+
}, X = (T) => {
|
|
2290
|
+
if (!T) return "";
|
|
2283
2291
|
try {
|
|
2284
|
-
const
|
|
2285
|
-
return
|
|
2292
|
+
const k = new Date(T), ae = (/* @__PURE__ */ new Date()).getTime() - k.getTime(), re = Math.floor(ae / (1e3 * 60 * 60 * 24));
|
|
2293
|
+
return re === 0 ? k.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : re === 1 ? "Yesterday" : re < 7 ? `${re} days ago` : k.toLocaleDateString();
|
|
2286
2294
|
} catch {
|
|
2287
2295
|
return "";
|
|
2288
2296
|
}
|
|
2289
|
-
},
|
|
2297
|
+
}, V = (T) => T.title || `Thread ${T.threadId.slice(0, 8)}`;
|
|
2290
2298
|
return /* @__PURE__ */ C("div", { className: `flex flex-col h-full ${e} ${s.container || ""}`, children: [
|
|
2291
|
-
t && /* @__PURE__ */ c("div", { className: "flex-shrink-0 p-4 border-b bg-white", children: /* @__PURE__ */ C(ne, { onClick:
|
|
2299
|
+
t && /* @__PURE__ */ c("div", { className: "flex-shrink-0 p-4 border-b bg-white", children: /* @__PURE__ */ C(ne, { onClick: Y, disabled: _ || v, className: `w-full ${s.createButton || ""}`, size: "sm", children: [
|
|
2292
2300
|
/* @__PURE__ */ c(Li, { size: 16, className: "mr-2" }),
|
|
2293
2301
|
_ ? "Creating..." : "New Conversation"
|
|
2294
2302
|
] }) }),
|
|
2295
2303
|
/* @__PURE__ */ c(xo, { className: `flex-1 ${s.threadList || ""}`, style: { maxHeight: o }, children: /* @__PURE__ */ c("div", { className: "p-2 space-y-1 pb-4", children: v ? /* @__PURE__ */ c("div", { className: "text-center py-8 text-gray-500", children: "Loading…" }) : p.length === 0 ? /* @__PURE__ */ C("div", { className: "text-center py-8 text-gray-500", children: [
|
|
2296
2304
|
/* @__PURE__ */ c($i, { className: "w-8 h-8 mx-auto mb-2 opacity-50" }),
|
|
2297
2305
|
/* @__PURE__ */ c("p", { className: "text-sm", children: "No conversations yet" })
|
|
2298
|
-
] }) : p.slice().sort((
|
|
2306
|
+
] }) : p.slice().sort((T, k) => new Date(k.updatedAt || k.createdAt || "").getTime() - new Date(T.updatedAt || T.createdAt || "").getTime()).map((T) => /* @__PURE__ */ C(
|
|
2299
2307
|
"div",
|
|
2300
2308
|
{
|
|
2301
|
-
onClick: () =>
|
|
2302
|
-
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${i ===
|
|
2309
|
+
onClick: () => j(T.threadId),
|
|
2310
|
+
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${i === T.threadId ? `bg-blue-50 border-blue-200 ${s.activeThread || ""}` : "bg-white border-gray-200 hover:bg-gray-50"} ${s.threadItem || ""}`,
|
|
2303
2311
|
children: [
|
|
2304
2312
|
/* @__PURE__ */ C("div", { className: "flex items-center justify-between", children: [
|
|
2305
|
-
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: E ===
|
|
2306
|
-
/* @__PURE__ */ c(Ft, { value: N, onChange: (
|
|
2307
|
-
/* @__PURE__ */ c(ne, { variant: "ghost", size: "sm", onClick: () =>
|
|
2313
|
+
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: E === T.threadId ? /* @__PURE__ */ C("div", { className: "flex items-center gap-2", onClick: (k) => k.stopPropagation(), children: [
|
|
2314
|
+
/* @__PURE__ */ c(Ft, { value: N, onChange: (k) => R(k.target.value), onKeyDown: (k) => I(k, T.threadId), className: "h-6 text-sm", autoFocus: !0 }),
|
|
2315
|
+
/* @__PURE__ */ c(ne, { variant: "ghost", size: "sm", onClick: () => F(T.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(Zr, { size: 12 }) }),
|
|
2308
2316
|
/* @__PURE__ */ c(ne, { variant: "ghost", size: "sm", onClick: W, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(ft, { size: 12 }) })
|
|
2309
2317
|
] }) : /* @__PURE__ */ C(_e, { children: [
|
|
2310
|
-
/* @__PURE__ */ c("div", { className: "font-medium text-sm truncate", children:
|
|
2318
|
+
/* @__PURE__ */ c("div", { className: "font-medium text-sm truncate", children: V(T) }),
|
|
2311
2319
|
/* @__PURE__ */ C("div", { className: "flex items-center gap-2 text-xs text-gray-500 mt-1", children: [
|
|
2312
2320
|
/* @__PURE__ */ c(Fi, { size: 10 }),
|
|
2313
|
-
/* @__PURE__ */ c("span", { children:
|
|
2321
|
+
/* @__PURE__ */ c("span", { children: X(T.updatedAt || T.createdAt) })
|
|
2314
2322
|
] })
|
|
2315
2323
|
] }) }),
|
|
2316
2324
|
/* @__PURE__ */ C("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
|
|
2317
|
-
r && E !==
|
|
2325
|
+
r && E !== T.threadId && /* @__PURE__ */ c(ne, { variant: "ghost", size: "sm", onClick: (k) => U(T, k), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ c(qr, { size: 12 }) }),
|
|
2318
2326
|
n && /* @__PURE__ */ c(
|
|
2319
2327
|
ne,
|
|
2320
2328
|
{
|
|
2321
2329
|
variant: "ghost",
|
|
2322
2330
|
size: "sm",
|
|
2323
|
-
onClick: (
|
|
2331
|
+
onClick: (k) => O(T.threadId, k),
|
|
2324
2332
|
className: "h-6 w-6 p-0 text-red-500 hover:text-red-700 hover:bg-red-50",
|
|
2325
2333
|
title: "Delete thread",
|
|
2326
2334
|
children: /* @__PURE__ */ c(Bi, { size: 12 })
|
|
@@ -2328,10 +2336,10 @@ function br({
|
|
|
2328
2336
|
)
|
|
2329
2337
|
] })
|
|
2330
2338
|
] }),
|
|
2331
|
-
i ===
|
|
2339
|
+
i === T.threadId && /* @__PURE__ */ c("div", { className: "absolute left-0 top-1/2 -translate-y-1/2 w-1 h-8 bg-blue-500 rounded-r" })
|
|
2332
2340
|
]
|
|
2333
2341
|
},
|
|
2334
|
-
|
|
2342
|
+
T.threadId
|
|
2335
2343
|
)) }) })
|
|
2336
2344
|
] });
|
|
2337
2345
|
}
|
|
@@ -2382,7 +2390,7 @@ function To(e) {
|
|
|
2382
2390
|
}
|
|
2383
2391
|
function Ao(e) {
|
|
2384
2392
|
const [t, n] = l.useState(void 0);
|
|
2385
|
-
return
|
|
2393
|
+
return ce(() => {
|
|
2386
2394
|
if (e) {
|
|
2387
2395
|
n({ width: e.offsetWidth, height: e.offsetHeight });
|
|
2388
2396
|
const r = new ResizeObserver((o) => {
|
|
@@ -2402,7 +2410,7 @@ function Ao(e) {
|
|
|
2402
2410
|
n(void 0);
|
|
2403
2411
|
}, [e]), t;
|
|
2404
2412
|
}
|
|
2405
|
-
var Jt = "Switch", [dc, af] =
|
|
2413
|
+
var Jt = "Switch", [dc, af] = Ze(Jt), [uc, fc] = dc(Jt), Ro = l.forwardRef(
|
|
2406
2414
|
(e, t) => {
|
|
2407
2415
|
const {
|
|
2408
2416
|
__scopeSwitch: n,
|
|
@@ -2540,7 +2548,7 @@ const Fe = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
2540
2548
|
));
|
|
2541
2549
|
Fe.displayName = Oo.displayName;
|
|
2542
2550
|
function mc(e) {
|
|
2543
|
-
const t = e + "CollectionProvider", [n, r] =
|
|
2551
|
+
const t = e + "CollectionProvider", [n, r] = Ze(t), [o, s] = n(
|
|
2544
2552
|
t,
|
|
2545
2553
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
2546
2554
|
), i = (p) => {
|
|
@@ -2557,8 +2565,8 @@ function mc(e) {
|
|
|
2557
2565
|
u.displayName = a;
|
|
2558
2566
|
const f = e + "CollectionItemSlot", h = "data-radix-collection-item", m = mt(f), w = $e.forwardRef(
|
|
2559
2567
|
(p, g) => {
|
|
2560
|
-
const { scope: v, children: b, ...x } = p, S = $e.useRef(null), E = ee(g, S),
|
|
2561
|
-
return $e.useEffect(() => (
|
|
2568
|
+
const { scope: v, children: b, ...x } = p, S = $e.useRef(null), E = ee(g, S), A = s(f, v);
|
|
2569
|
+
return $e.useEffect(() => (A.itemMap.set(S, { ref: S, ...x }), () => void A.itemMap.delete(S))), /* @__PURE__ */ c(m, { [h]: "", ref: E, children: b });
|
|
2562
2570
|
}
|
|
2563
2571
|
);
|
|
2564
2572
|
w.displayName = f;
|
|
@@ -2569,7 +2577,7 @@ function mc(e) {
|
|
|
2569
2577
|
if (!b) return [];
|
|
2570
2578
|
const x = Array.from(b.querySelectorAll(`[${h}]`));
|
|
2571
2579
|
return Array.from(g.itemMap.values()).sort(
|
|
2572
|
-
(
|
|
2580
|
+
(A, N) => x.indexOf(A.ref.current) - x.indexOf(N.ref.current)
|
|
2573
2581
|
);
|
|
2574
2582
|
}, [g.collectionRef, g.itemMap]);
|
|
2575
2583
|
}
|
|
@@ -2603,11 +2611,11 @@ var vc = "DismissableLayer", An = "dismissableLayer.update", wc = "dismissableLa
|
|
|
2603
2611
|
onDismiss: a,
|
|
2604
2612
|
...d
|
|
2605
2613
|
} = e, u = l.useContext(Do), [f, h] = l.useState(null), m = (f == null ? void 0 : f.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, w] = l.useState({}), y = ee(t, (N) => h(N)), p = Array.from(u.layers), [g] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), v = p.indexOf(g), b = f ? p.indexOf(f) : -1, x = u.layersWithOutsidePointerEventsDisabled.size > 0, S = b >= v, E = Sc((N) => {
|
|
2606
|
-
const
|
|
2614
|
+
const R = N.target, _ = [...u.branches].some((D) => D.contains(R));
|
|
2607
2615
|
!S || _ || (o == null || o(N), i == null || i(N), N.defaultPrevented || a == null || a());
|
|
2608
|
-
}, m),
|
|
2609
|
-
const
|
|
2610
|
-
[...u.branches].some((D) => D.contains(
|
|
2616
|
+
}, m), A = Cc((N) => {
|
|
2617
|
+
const R = N.target;
|
|
2618
|
+
[...u.branches].some((D) => D.contains(R)) || (s == null || s(N), i == null || i(N), N.defaultPrevented || a == null || a());
|
|
2611
2619
|
}, m);
|
|
2612
2620
|
return gc((N) => {
|
|
2613
2621
|
b === u.layers.size - 1 && (r == null || r(N), !N.defaultPrevented && a && (N.preventDefault(), a()));
|
|
@@ -2630,8 +2638,8 @@ var vc = "DismissableLayer", An = "dismissableLayer.update", wc = "dismissableLa
|
|
|
2630
2638
|
pointerEvents: x ? S ? "auto" : "none" : void 0,
|
|
2631
2639
|
...e.style
|
|
2632
2640
|
},
|
|
2633
|
-
onFocusCapture: Z(e.onFocusCapture,
|
|
2634
|
-
onBlurCapture: Z(e.onBlurCapture,
|
|
2641
|
+
onFocusCapture: Z(e.onFocusCapture, A.onFocusCapture),
|
|
2642
|
+
onBlurCapture: Z(e.onBlurCapture, A.onBlurCapture),
|
|
2635
2643
|
onPointerDownCapture: Z(
|
|
2636
2644
|
e.onPointerDownCapture,
|
|
2637
2645
|
E.onPointerDownCapture
|
|
@@ -2846,7 +2854,7 @@ function Tr(e, t) {
|
|
|
2846
2854
|
function Ic(e) {
|
|
2847
2855
|
return e.filter((t) => t.tagName !== "A");
|
|
2848
2856
|
}
|
|
2849
|
-
const kc = ["top", "right", "bottom", "left"],
|
|
2857
|
+
const kc = ["top", "right", "bottom", "left"], ze = Math.min, me = Math.max, zt = Math.round, St = Math.floor, Ae = (e) => ({
|
|
2850
2858
|
x: e,
|
|
2851
2859
|
y: e
|
|
2852
2860
|
}), _c = {
|
|
@@ -2859,7 +2867,7 @@ const kc = ["top", "right", "bottom", "left"], We = Math.min, me = Math.max, zt
|
|
|
2859
2867
|
end: "start"
|
|
2860
2868
|
};
|
|
2861
2869
|
function Rn(e, t, n) {
|
|
2862
|
-
return me(e,
|
|
2870
|
+
return me(e, ze(t, n));
|
|
2863
2871
|
}
|
|
2864
2872
|
function Oe(e, t) {
|
|
2865
2873
|
return typeof e == "function" ? e(t) : e;
|
|
@@ -3127,20 +3135,20 @@ const Uc = (e) => ({
|
|
|
3127
3135
|
const h = Fo(f), m = {
|
|
3128
3136
|
x: n,
|
|
3129
3137
|
y: r
|
|
3130
|
-
}, w = qn(o), y = Gn(w), p = await i.getDimensions(u), g = w === "y", v = g ? "top" : "left", b = g ? "bottom" : "right", x = g ? "clientHeight" : "clientWidth", S = s.reference[y] + s.reference[w] - m[w] - s.floating[y], E = m[w] - s.reference[w],
|
|
3131
|
-
let N =
|
|
3132
|
-
(!N || !await (i.isElement == null ? void 0 : i.isElement(
|
|
3133
|
-
const
|
|
3138
|
+
}, w = qn(o), y = Gn(w), p = await i.getDimensions(u), g = w === "y", v = g ? "top" : "left", b = g ? "bottom" : "right", x = g ? "clientHeight" : "clientWidth", S = s.reference[y] + s.reference[w] - m[w] - s.floating[y], E = m[w] - s.reference[w], A = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
|
|
3139
|
+
let N = A ? A[x] : 0;
|
|
3140
|
+
(!N || !await (i.isElement == null ? void 0 : i.isElement(A))) && (N = a.floating[x] || s.floating[y]);
|
|
3141
|
+
const R = S / 2 - E / 2, _ = N / 2 - p[y] / 2 - 1, D = ze(h[v], _), B = ze(h[b], _), j = D, Y = N - p[y] - B, O = N / 2 - p[y] / 2 + R, U = Rn(j, O, Y), F = !d.arrow && it(o) != null && O !== U && s.reference[y] / 2 - (O < j ? D : B) - p[y] / 2 < 0, W = F ? O < j ? O - j : O - Y : 0;
|
|
3134
3142
|
return {
|
|
3135
3143
|
[w]: m[w] + W,
|
|
3136
3144
|
data: {
|
|
3137
|
-
[w]:
|
|
3138
|
-
centerOffset: O -
|
|
3139
|
-
...
|
|
3145
|
+
[w]: U,
|
|
3146
|
+
centerOffset: O - U - W,
|
|
3147
|
+
...F && {
|
|
3140
3148
|
alignmentOffset: W
|
|
3141
3149
|
}
|
|
3142
3150
|
},
|
|
3143
|
-
reset:
|
|
3151
|
+
reset: F
|
|
3144
3152
|
};
|
|
3145
3153
|
}
|
|
3146
3154
|
}), Vc = function(e) {
|
|
@@ -3167,21 +3175,21 @@ const Uc = (e) => ({
|
|
|
3167
3175
|
} = Oe(e, t);
|
|
3168
3176
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
3169
3177
|
return {};
|
|
3170
|
-
const v = De(o), b = Te(a), x = De(a) === a, S = await (d.isRTL == null ? void 0 : d.isRTL(u.floating)), E = m || (x || !p ? [Ht(a)] : Lc(a)),
|
|
3171
|
-
!m &&
|
|
3172
|
-
const N = [a, ...E],
|
|
3178
|
+
const v = De(o), b = Te(a), x = De(a) === a, S = await (d.isRTL == null ? void 0 : d.isRTL(u.floating)), E = m || (x || !p ? [Ht(a)] : Lc(a)), A = y !== "none";
|
|
3179
|
+
!m && A && E.push(...Wc(a, p, y, S));
|
|
3180
|
+
const N = [a, ...E], R = await vt(t, g), _ = [];
|
|
3173
3181
|
let D = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
3174
|
-
if (f && _.push(
|
|
3182
|
+
if (f && _.push(R[v]), h) {
|
|
3175
3183
|
const O = Mc(o, i, S);
|
|
3176
|
-
_.push(
|
|
3184
|
+
_.push(R[O[0]], R[O[1]]);
|
|
3177
3185
|
}
|
|
3178
3186
|
if (D = [...D, {
|
|
3179
3187
|
placement: o,
|
|
3180
3188
|
overflows: _
|
|
3181
3189
|
}], !_.every((O) => O <= 0)) {
|
|
3182
|
-
var
|
|
3183
|
-
const O = (((
|
|
3184
|
-
if (
|
|
3190
|
+
var B, j;
|
|
3191
|
+
const O = (((B = s.flip) == null ? void 0 : B.index) || 0) + 1, U = N[O];
|
|
3192
|
+
if (U && (!(h === "alignment" ? b !== Te(U) : !1) || // We leave the current main axis only if every placement on that axis
|
|
3185
3193
|
// overflows the main axis.
|
|
3186
3194
|
D.every((I) => Te(I.placement) === b ? I.overflows[0] > 0 : !0)))
|
|
3187
3195
|
return {
|
|
@@ -3190,34 +3198,34 @@ const Uc = (e) => ({
|
|
|
3190
3198
|
overflows: D
|
|
3191
3199
|
},
|
|
3192
3200
|
reset: {
|
|
3193
|
-
placement:
|
|
3201
|
+
placement: U
|
|
3194
3202
|
}
|
|
3195
3203
|
};
|
|
3196
|
-
let
|
|
3197
|
-
if (!
|
|
3204
|
+
let F = (j = D.filter((W) => W.overflows[0] <= 0).sort((W, I) => W.overflows[1] - I.overflows[1])[0]) == null ? void 0 : j.placement;
|
|
3205
|
+
if (!F)
|
|
3198
3206
|
switch (w) {
|
|
3199
3207
|
case "bestFit": {
|
|
3200
|
-
var
|
|
3201
|
-
const W = (
|
|
3202
|
-
if (
|
|
3203
|
-
const
|
|
3204
|
-
return
|
|
3208
|
+
var Y;
|
|
3209
|
+
const W = (Y = D.filter((I) => {
|
|
3210
|
+
if (A) {
|
|
3211
|
+
const X = Te(I.placement);
|
|
3212
|
+
return X === b || // Create a bias to the `y` side axis due to horizontal
|
|
3205
3213
|
// reading directions favoring greater width.
|
|
3206
|
-
|
|
3214
|
+
X === "y";
|
|
3207
3215
|
}
|
|
3208
3216
|
return !0;
|
|
3209
|
-
}).map((I) => [I.placement, I.overflows.filter((
|
|
3210
|
-
W && (
|
|
3217
|
+
}).map((I) => [I.placement, I.overflows.filter((X) => X > 0).reduce((X, V) => X + V, 0)]).sort((I, X) => I[1] - X[1])[0]) == null ? void 0 : Y[0];
|
|
3218
|
+
W && (F = W);
|
|
3211
3219
|
break;
|
|
3212
3220
|
}
|
|
3213
3221
|
case "initialPlacement":
|
|
3214
|
-
|
|
3222
|
+
F = a;
|
|
3215
3223
|
break;
|
|
3216
3224
|
}
|
|
3217
|
-
if (o !==
|
|
3225
|
+
if (o !== F)
|
|
3218
3226
|
return {
|
|
3219
3227
|
reset: {
|
|
3220
|
-
placement:
|
|
3228
|
+
placement: F
|
|
3221
3229
|
}
|
|
3222
3230
|
};
|
|
3223
3231
|
}
|
|
@@ -3416,8 +3424,8 @@ const Xc = function(e) {
|
|
|
3416
3424
|
}
|
|
3417
3425
|
if (u) {
|
|
3418
3426
|
var v, b;
|
|
3419
|
-
const x = m === "y" ? "width" : "height", S = Bo.has(De(o)), E = s.reference[h] - s.floating[x] + (S && ((v = i.offset) == null ? void 0 : v[h]) || 0) + (S ? 0 : g.crossAxis),
|
|
3420
|
-
y < E ? y = E : y >
|
|
3427
|
+
const x = m === "y" ? "width" : "height", S = Bo.has(De(o)), E = s.reference[h] - s.floating[x] + (S && ((v = i.offset) == null ? void 0 : v[h]) || 0) + (S ? 0 : g.crossAxis), A = s.reference[h] + s.reference[x] + (S ? 0 : ((b = i.offset) == null ? void 0 : b[h]) || 0) - (S ? g.crossAxis : 0);
|
|
3428
|
+
y < E ? y = E : y > A && (y = A);
|
|
3421
3429
|
}
|
|
3422
3430
|
return {
|
|
3423
3431
|
[m]: w,
|
|
@@ -3446,15 +3454,15 @@ const Xc = function(e) {
|
|
|
3446
3454
|
} = s.floating;
|
|
3447
3455
|
let g, v;
|
|
3448
3456
|
h === "top" || h === "bottom" ? (g = h, v = m === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (v = h, g = m === "end" ? "top" : "bottom");
|
|
3449
|
-
const b = p - f.top - f.bottom, x = y - f.left - f.right, S =
|
|
3450
|
-
let N = S,
|
|
3451
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (
|
|
3452
|
-
const D = me(f.left, 0),
|
|
3453
|
-
w ?
|
|
3457
|
+
const b = p - f.top - f.bottom, x = y - f.left - f.right, S = ze(p - f[g], b), E = ze(y - f[v], x), A = !t.middlewareData.shift;
|
|
3458
|
+
let N = S, R = E;
|
|
3459
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (R = x), (r = t.middlewareData.shift) != null && r.enabled.y && (N = b), A && !m) {
|
|
3460
|
+
const D = me(f.left, 0), B = me(f.right, 0), j = me(f.top, 0), Y = me(f.bottom, 0);
|
|
3461
|
+
w ? R = y - 2 * (D !== 0 || B !== 0 ? D + B : me(f.left, f.right)) : N = p - 2 * (j !== 0 || Y !== 0 ? j + Y : me(f.top, f.bottom));
|
|
3454
3462
|
}
|
|
3455
3463
|
await d({
|
|
3456
3464
|
...t,
|
|
3457
|
-
availableWidth:
|
|
3465
|
+
availableWidth: R,
|
|
3458
3466
|
availableHeight: N
|
|
3459
3467
|
});
|
|
3460
3468
|
const _ = await i.getDimensions(a.floating);
|
|
@@ -3522,13 +3530,13 @@ function Zn(e) {
|
|
|
3522
3530
|
return tl.some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || nl.some((r) => (n.willChange || "").includes(r)) || rl.some((r) => (n.contain || "").includes(r));
|
|
3523
3531
|
}
|
|
3524
3532
|
function ol(e) {
|
|
3525
|
-
let t =
|
|
3533
|
+
let t = He(e);
|
|
3526
3534
|
for (; Re(t) && !st(t); ) {
|
|
3527
3535
|
if (Zn(t))
|
|
3528
3536
|
return t;
|
|
3529
3537
|
if (en(t))
|
|
3530
3538
|
return null;
|
|
3531
|
-
t =
|
|
3539
|
+
t = He(t);
|
|
3532
3540
|
}
|
|
3533
3541
|
return null;
|
|
3534
3542
|
}
|
|
@@ -3551,7 +3559,7 @@ function tn(e) {
|
|
|
3551
3559
|
scrollTop: e.scrollY
|
|
3552
3560
|
};
|
|
3553
3561
|
}
|
|
3554
|
-
function
|
|
3562
|
+
function He(e) {
|
|
3555
3563
|
if (at(e) === "html")
|
|
3556
3564
|
return e;
|
|
3557
3565
|
const t = (
|
|
@@ -3564,7 +3572,7 @@ function ze(e) {
|
|
|
3564
3572
|
return _r(t) ? t.host : t;
|
|
3565
3573
|
}
|
|
3566
3574
|
function zo(e) {
|
|
3567
|
-
const t =
|
|
3575
|
+
const t = He(e);
|
|
3568
3576
|
return st(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : Re(t) && bt(t) ? t : zo(t);
|
|
3569
3577
|
}
|
|
3570
3578
|
function wt(e, t, n) {
|
|
@@ -3619,7 +3627,7 @@ function Uo(e) {
|
|
|
3619
3627
|
function al(e, t, n) {
|
|
3620
3628
|
return t === void 0 && (t = !1), !n || t && n !== ge(e) ? !1 : t;
|
|
3621
3629
|
}
|
|
3622
|
-
function
|
|
3630
|
+
function Xe(e, t, n, r) {
|
|
3623
3631
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
3624
3632
|
const o = e.getBoundingClientRect(), s = Qn(e);
|
|
3625
3633
|
let i = Ae(1);
|
|
@@ -3643,7 +3651,7 @@ function Ye(e, t, n, r) {
|
|
|
3643
3651
|
}
|
|
3644
3652
|
function nn(e, t) {
|
|
3645
3653
|
const n = tn(e).scrollLeft;
|
|
3646
|
-
return t ? t.left + n :
|
|
3654
|
+
return t ? t.left + n : Xe(Ie(e)).left + n;
|
|
3647
3655
|
}
|
|
3648
3656
|
function Vo(e, t) {
|
|
3649
3657
|
const n = e.getBoundingClientRect(), r = n.left + t.scrollLeft - nn(e, n), o = n.top + t.scrollTop;
|
|
@@ -3668,7 +3676,7 @@ function cl(e) {
|
|
|
3668
3676
|
}, u = Ae(1);
|
|
3669
3677
|
const f = Ae(0), h = Re(r);
|
|
3670
3678
|
if ((h || !h && !s) && ((at(r) !== "body" || bt(i)) && (d = tn(r)), Re(r))) {
|
|
3671
|
-
const w =
|
|
3679
|
+
const w = Xe(r);
|
|
3672
3680
|
u = nt(r), f.x = w.x + r.clientLeft, f.y = w.y + r.clientTop;
|
|
3673
3681
|
}
|
|
3674
3682
|
const m = i && !h && !s ? Vo(i, d) : Ae(0);
|
|
@@ -3716,7 +3724,7 @@ function ul(e, t) {
|
|
|
3716
3724
|
}
|
|
3717
3725
|
const fl = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
3718
3726
|
function hl(e, t) {
|
|
3719
|
-
const n =
|
|
3727
|
+
const n = Xe(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = Re(e) ? nt(e) : Ae(1), i = e.clientWidth * s.x, a = e.clientHeight * s.y, d = o * s.x, u = r * s.y;
|
|
3720
3728
|
return {
|
|
3721
3729
|
width: i,
|
|
3722
3730
|
height: a,
|
|
@@ -3744,7 +3752,7 @@ function Dr(e, t, n) {
|
|
|
3744
3752
|
return Ut(r);
|
|
3745
3753
|
}
|
|
3746
3754
|
function jo(e, t) {
|
|
3747
|
-
const n =
|
|
3755
|
+
const n = He(e);
|
|
3748
3756
|
return n === t || !xe(n) || st(n) ? !1 : Se(n).position === "fixed" || jo(n, t);
|
|
3749
3757
|
}
|
|
3750
3758
|
function pl(e, t) {
|
|
@@ -3753,10 +3761,10 @@ function pl(e, t) {
|
|
|
3753
3761
|
return n;
|
|
3754
3762
|
let r = wt(e, [], !1).filter((a) => xe(a) && at(a) !== "body"), o = null;
|
|
3755
3763
|
const s = Se(e).position === "fixed";
|
|
3756
|
-
let i = s ?
|
|
3764
|
+
let i = s ? He(e) : e;
|
|
3757
3765
|
for (; xe(i) && !st(i); ) {
|
|
3758
3766
|
const a = Se(i), d = Zn(i);
|
|
3759
|
-
!d && a.position === "fixed" && (o = null), (s ? !d && !o : !d && a.position === "static" && !!o && fl.has(o.position) || bt(i) && !d && jo(e, i)) ? r = r.filter((f) => f !== i) : o = a, i =
|
|
3767
|
+
!d && a.position === "fixed" && (o = null), (s ? !d && !o : !d && a.position === "static" && !!o && fl.has(o.position) || bt(i) && !d && jo(e, i)) ? r = r.filter((f) => f !== i) : o = a, i = He(i);
|
|
3760
3768
|
}
|
|
3761
3769
|
return t.set(e, r), r;
|
|
3762
3770
|
}
|
|
@@ -3769,7 +3777,7 @@ function ml(e) {
|
|
|
3769
3777
|
} = e;
|
|
3770
3778
|
const i = [...n === "clippingAncestors" ? en(t) ? [] : pl(t, this._c) : [].concat(n), r], a = i[0], d = i.reduce((u, f) => {
|
|
3771
3779
|
const h = Dr(t, f, o);
|
|
3772
|
-
return u.top = me(h.top, u.top), u.right =
|
|
3780
|
+
return u.top = me(h.top, u.top), u.right = ze(h.right, u.right), u.bottom = ze(h.bottom, u.bottom), u.left = me(h.left, u.left), u;
|
|
3773
3781
|
}, Dr(t, a, o));
|
|
3774
3782
|
return {
|
|
3775
3783
|
width: d.right - d.left,
|
|
@@ -3789,7 +3797,7 @@ function gl(e) {
|
|
|
3789
3797
|
};
|
|
3790
3798
|
}
|
|
3791
3799
|
function vl(e, t, n) {
|
|
3792
|
-
const r = Re(t), o = Ie(t), s = n === "fixed", i =
|
|
3800
|
+
const r = Re(t), o = Ie(t), s = n === "fixed", i = Xe(e, !0, s, t);
|
|
3793
3801
|
let a = {
|
|
3794
3802
|
scrollLeft: 0,
|
|
3795
3803
|
scrollTop: 0
|
|
@@ -3800,7 +3808,7 @@ function vl(e, t, n) {
|
|
|
3800
3808
|
}
|
|
3801
3809
|
if (r || !r && !s)
|
|
3802
3810
|
if ((at(t) !== "body" || bt(o)) && (a = tn(t)), r) {
|
|
3803
|
-
const w =
|
|
3811
|
+
const w = Xe(t, !0, s, t);
|
|
3804
3812
|
d.x = w.x + t.clientLeft, d.y = w.y + t.clientTop;
|
|
3805
3813
|
} else o && u();
|
|
3806
3814
|
s && !r && o && u();
|
|
@@ -3828,11 +3836,11 @@ function Yo(e, t) {
|
|
|
3828
3836
|
if (en(e))
|
|
3829
3837
|
return n;
|
|
3830
3838
|
if (!Re(e)) {
|
|
3831
|
-
let o =
|
|
3839
|
+
let o = He(e);
|
|
3832
3840
|
for (; o && !st(o); ) {
|
|
3833
3841
|
if (xe(o) && !vn(o))
|
|
3834
3842
|
return o;
|
|
3835
|
-
o =
|
|
3843
|
+
o = He(o);
|
|
3836
3844
|
}
|
|
3837
3845
|
return n;
|
|
3838
3846
|
}
|
|
@@ -3890,11 +3898,11 @@ function xl(e, t) {
|
|
|
3890
3898
|
return;
|
|
3891
3899
|
const y = St(h), p = St(o.clientWidth - (f + m)), g = St(o.clientHeight - (h + w)), v = St(f), x = {
|
|
3892
3900
|
rootMargin: -y + "px " + -p + "px " + -g + "px " + -v + "px",
|
|
3893
|
-
threshold: me(0,
|
|
3901
|
+
threshold: me(0, ze(1, d)) || 1
|
|
3894
3902
|
};
|
|
3895
3903
|
let S = !0;
|
|
3896
|
-
function E(
|
|
3897
|
-
const N =
|
|
3904
|
+
function E(A) {
|
|
3905
|
+
const N = A[0].intersectionRatio;
|
|
3898
3906
|
if (N !== d) {
|
|
3899
3907
|
if (!S)
|
|
3900
3908
|
return i();
|
|
@@ -3940,10 +3948,10 @@ function Sl(e, t, n, r) {
|
|
|
3940
3948
|
(x = w) == null || x.observe(t);
|
|
3941
3949
|
})), n();
|
|
3942
3950
|
}), u && !d && w.observe(u), w.observe(t));
|
|
3943
|
-
let y, p = d ?
|
|
3951
|
+
let y, p = d ? Xe(e) : null;
|
|
3944
3952
|
d && g();
|
|
3945
3953
|
function g() {
|
|
3946
|
-
const v =
|
|
3954
|
+
const v = Xe(e);
|
|
3947
3955
|
p && !Xo(p, v) && n(), p = v, y = requestAnimationFrame(g);
|
|
3948
3956
|
}
|
|
3949
3957
|
return n(), () => {
|
|
@@ -4035,33 +4043,33 @@ function _l(e) {
|
|
|
4035
4043
|
}), [m, w] = l.useState(r);
|
|
4036
4044
|
Vt(m, r) || w(r);
|
|
4037
4045
|
const [y, p] = l.useState(null), [g, v] = l.useState(null), b = l.useCallback((I) => {
|
|
4038
|
-
I !==
|
|
4046
|
+
I !== A.current && (A.current = I, p(I));
|
|
4039
4047
|
}, []), x = l.useCallback((I) => {
|
|
4040
4048
|
I !== N.current && (N.current = I, v(I));
|
|
4041
|
-
}, []), S = s || y, E = i || g,
|
|
4042
|
-
if (!
|
|
4049
|
+
}, []), S = s || y, E = i || g, A = l.useRef(null), N = l.useRef(null), R = l.useRef(f), _ = d != null, D = wn(d), B = wn(o), j = wn(u), Y = l.useCallback(() => {
|
|
4050
|
+
if (!A.current || !N.current)
|
|
4043
4051
|
return;
|
|
4044
4052
|
const I = {
|
|
4045
4053
|
placement: t,
|
|
4046
4054
|
strategy: n,
|
|
4047
4055
|
middleware: m
|
|
4048
4056
|
};
|
|
4049
|
-
|
|
4050
|
-
const
|
|
4051
|
-
...
|
|
4057
|
+
B.current && (I.platform = B.current), Pl(A.current, N.current, I).then((X) => {
|
|
4058
|
+
const V = {
|
|
4059
|
+
...X,
|
|
4052
4060
|
// The floating element's position may be recomputed while it's closed
|
|
4053
4061
|
// but still mounted (such as when transitioning out). To ensure
|
|
4054
4062
|
// `isPositioned` will be `false` initially on the next open, avoid
|
|
4055
4063
|
// setting it to `true` when `open === false` (must be specified).
|
|
4056
|
-
isPositioned:
|
|
4064
|
+
isPositioned: j.current !== !1
|
|
4057
4065
|
};
|
|
4058
|
-
O.current && !Vt(
|
|
4059
|
-
h(
|
|
4066
|
+
O.current && !Vt(R.current, V) && (R.current = V, Kt.flushSync(() => {
|
|
4067
|
+
h(V);
|
|
4060
4068
|
}));
|
|
4061
4069
|
});
|
|
4062
|
-
}, [m, t, n,
|
|
4070
|
+
}, [m, t, n, B, j]);
|
|
4063
4071
|
Rt(() => {
|
|
4064
|
-
u === !1 &&
|
|
4072
|
+
u === !1 && R.current.isPositioned && (R.current.isPositioned = !1, h((I) => ({
|
|
4065
4073
|
...I,
|
|
4066
4074
|
isPositioned: !1
|
|
4067
4075
|
})));
|
|
@@ -4070,18 +4078,18 @@ function _l(e) {
|
|
|
4070
4078
|
Rt(() => (O.current = !0, () => {
|
|
4071
4079
|
O.current = !1;
|
|
4072
4080
|
}), []), Rt(() => {
|
|
4073
|
-
if (S && (
|
|
4081
|
+
if (S && (A.current = S), E && (N.current = E), S && E) {
|
|
4074
4082
|
if (D.current)
|
|
4075
|
-
return D.current(S, E,
|
|
4076
|
-
|
|
4083
|
+
return D.current(S, E, Y);
|
|
4084
|
+
Y();
|
|
4077
4085
|
}
|
|
4078
|
-
}, [S, E,
|
|
4079
|
-
const
|
|
4080
|
-
reference:
|
|
4086
|
+
}, [S, E, Y, D, _]);
|
|
4087
|
+
const U = l.useMemo(() => ({
|
|
4088
|
+
reference: A,
|
|
4081
4089
|
floating: N,
|
|
4082
4090
|
setReference: b,
|
|
4083
4091
|
setFloating: x
|
|
4084
|
-
}), [b, x]),
|
|
4092
|
+
}), [b, x]), F = l.useMemo(() => ({
|
|
4085
4093
|
reference: S,
|
|
4086
4094
|
floating: E
|
|
4087
4095
|
}), [S, E]), W = l.useMemo(() => {
|
|
@@ -4090,28 +4098,28 @@ function _l(e) {
|
|
|
4090
4098
|
left: 0,
|
|
4091
4099
|
top: 0
|
|
4092
4100
|
};
|
|
4093
|
-
if (!
|
|
4101
|
+
if (!F.floating)
|
|
4094
4102
|
return I;
|
|
4095
|
-
const
|
|
4103
|
+
const X = $r(F.floating, f.x), V = $r(F.floating, f.y);
|
|
4096
4104
|
return a ? {
|
|
4097
4105
|
...I,
|
|
4098
|
-
transform: "translate(" +
|
|
4099
|
-
...Ko(
|
|
4106
|
+
transform: "translate(" + X + "px, " + V + "px)",
|
|
4107
|
+
...Ko(F.floating) >= 1.5 && {
|
|
4100
4108
|
willChange: "transform"
|
|
4101
4109
|
}
|
|
4102
4110
|
} : {
|
|
4103
4111
|
position: n,
|
|
4104
|
-
left:
|
|
4105
|
-
top:
|
|
4112
|
+
left: X,
|
|
4113
|
+
top: V
|
|
4106
4114
|
};
|
|
4107
|
-
}, [n, a,
|
|
4115
|
+
}, [n, a, F.floating, f.x, f.y]);
|
|
4108
4116
|
return l.useMemo(() => ({
|
|
4109
4117
|
...f,
|
|
4110
|
-
update:
|
|
4111
|
-
refs:
|
|
4112
|
-
elements:
|
|
4118
|
+
update: Y,
|
|
4119
|
+
refs: U,
|
|
4120
|
+
elements: F,
|
|
4113
4121
|
floatingStyles: W
|
|
4114
|
-
}), [f,
|
|
4122
|
+
}), [f, Y, U, F, W]);
|
|
4115
4123
|
}
|
|
4116
4124
|
const Ol = (e) => {
|
|
4117
4125
|
function t(n) {
|
|
@@ -4172,7 +4180,7 @@ var zl = "Arrow", Go = l.forwardRef((e, t) => {
|
|
|
4172
4180
|
);
|
|
4173
4181
|
});
|
|
4174
4182
|
Go.displayName = zl;
|
|
4175
|
-
var Hl = Go, er = "Popper", [qo, Zo] =
|
|
4183
|
+
var Hl = Go, er = "Popper", [qo, Zo] = Ze(er), [Ul, Jo] = qo(er), Qo = (e) => {
|
|
4176
4184
|
const { __scopePopper: t, children: n } = e, [r, o] = l.useState(null);
|
|
4177
4185
|
return /* @__PURE__ */ c(Ul, { scope: t, anchor: r, onAnchorChange: o, children: n });
|
|
4178
4186
|
};
|
|
@@ -4189,7 +4197,7 @@ var es = "PopperAnchor", ts = l.forwardRef(
|
|
|
4189
4197
|
ts.displayName = es;
|
|
4190
4198
|
var tr = "PopperContent", [Vl, jl] = qo(tr), ns = l.forwardRef(
|
|
4191
4199
|
(e, t) => {
|
|
4192
|
-
var
|
|
4200
|
+
var H, J, oe, $, L, q;
|
|
4193
4201
|
const {
|
|
4194
4202
|
__scopePopper: n,
|
|
4195
4203
|
side: r = "bottom",
|
|
@@ -4205,12 +4213,12 @@ var tr = "PopperContent", [Vl, jl] = qo(tr), ns = l.forwardRef(
|
|
|
4205
4213
|
updatePositionStrategy: w = "optimized",
|
|
4206
4214
|
onPlaced: y,
|
|
4207
4215
|
...p
|
|
4208
|
-
} = e, g = Jo(tr, n), [v, b] = l.useState(null), x = ee(t, (fe) => b(fe)), [S, E] = l.useState(null),
|
|
4216
|
+
} = e, g = Jo(tr, n), [v, b] = l.useState(null), x = ee(t, (fe) => b(fe)), [S, E] = l.useState(null), A = Ao(S), N = (A == null ? void 0 : A.width) ?? 0, R = (A == null ? void 0 : A.height) ?? 0, _ = r + (s !== "center" ? "-" + s : ""), D = typeof f == "number" ? f : { top: 0, right: 0, bottom: 0, left: 0, ...f }, B = Array.isArray(u) ? u : [u], j = B.length > 0, Y = {
|
|
4209
4217
|
padding: D,
|
|
4210
|
-
boundary:
|
|
4218
|
+
boundary: B.filter(Xl),
|
|
4211
4219
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
4212
|
-
altBoundary:
|
|
4213
|
-
}, { refs: O, floatingStyles:
|
|
4220
|
+
altBoundary: j
|
|
4221
|
+
}, { refs: O, floatingStyles: U, placement: F, isPositioned: W, middlewareData: I } = _l({
|
|
4214
4222
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
4215
4223
|
strategy: "fixed",
|
|
4216
4224
|
placement: _,
|
|
@@ -4221,46 +4229,46 @@ var tr = "PopperContent", [Vl, jl] = qo(tr), ns = l.forwardRef(
|
|
|
4221
4229
|
reference: g.anchor
|
|
4222
4230
|
},
|
|
4223
4231
|
middleware: [
|
|
4224
|
-
Dl({ mainAxis: o +
|
|
4232
|
+
Dl({ mainAxis: o + R, alignmentAxis: i }),
|
|
4225
4233
|
d && Ml({
|
|
4226
4234
|
mainAxis: !0,
|
|
4227
4235
|
crossAxis: !1,
|
|
4228
4236
|
limiter: h === "partial" ? Ll() : void 0,
|
|
4229
|
-
...
|
|
4237
|
+
...Y
|
|
4230
4238
|
}),
|
|
4231
|
-
d && $l({ ...
|
|
4239
|
+
d && $l({ ...Y }),
|
|
4232
4240
|
Fl({
|
|
4233
|
-
...
|
|
4241
|
+
...Y,
|
|
4234
4242
|
apply: ({ elements: fe, rects: ve, availableWidth: Ne, availableHeight: Le }) => {
|
|
4235
4243
|
const { width: P, height: z } = ve.reference, K = fe.floating.style;
|
|
4236
4244
|
K.setProperty("--radix-popper-available-width", `${Ne}px`), K.setProperty("--radix-popper-available-height", `${Le}px`), K.setProperty("--radix-popper-anchor-width", `${P}px`), K.setProperty("--radix-popper-anchor-height", `${z}px`);
|
|
4237
4245
|
}
|
|
4238
4246
|
}),
|
|
4239
4247
|
S && Wl({ element: S, padding: a }),
|
|
4240
|
-
Kl({ arrowWidth: N, arrowHeight:
|
|
4241
|
-
m && Bl({ strategy: "referenceHidden", ...
|
|
4248
|
+
Kl({ arrowWidth: N, arrowHeight: R }),
|
|
4249
|
+
m && Bl({ strategy: "referenceHidden", ...Y })
|
|
4242
4250
|
]
|
|
4243
|
-
}), [
|
|
4244
|
-
|
|
4245
|
-
W && (
|
|
4246
|
-
}, [W,
|
|
4247
|
-
const
|
|
4248
|
-
return
|
|
4249
|
-
v &&
|
|
4251
|
+
}), [X, V] = ss(F), T = pe(y);
|
|
4252
|
+
ce(() => {
|
|
4253
|
+
W && (T == null || T());
|
|
4254
|
+
}, [W, T]);
|
|
4255
|
+
const k = (H = I.arrow) == null ? void 0 : H.x, se = (J = I.arrow) == null ? void 0 : J.y, ae = ((oe = I.arrow) == null ? void 0 : oe.centerOffset) !== 0, [re, ie] = l.useState();
|
|
4256
|
+
return ce(() => {
|
|
4257
|
+
v && ie(window.getComputedStyle(v).zIndex);
|
|
4250
4258
|
}, [v]), /* @__PURE__ */ c(
|
|
4251
4259
|
"div",
|
|
4252
4260
|
{
|
|
4253
4261
|
ref: O.setFloating,
|
|
4254
4262
|
"data-radix-popper-content-wrapper": "",
|
|
4255
4263
|
style: {
|
|
4256
|
-
...
|
|
4257
|
-
transform: W ?
|
|
4264
|
+
...U,
|
|
4265
|
+
transform: W ? U.transform : "translate(0, -200%)",
|
|
4258
4266
|
// keep off the page when measuring
|
|
4259
4267
|
minWidth: "max-content",
|
|
4260
|
-
zIndex:
|
|
4268
|
+
zIndex: re,
|
|
4261
4269
|
"--radix-popper-transform-origin": [
|
|
4262
|
-
(
|
|
4263
|
-
(
|
|
4270
|
+
($ = I.transformOrigin) == null ? void 0 : $.x,
|
|
4271
|
+
(L = I.transformOrigin) == null ? void 0 : L.y
|
|
4264
4272
|
].join(" "),
|
|
4265
4273
|
// hide the content if using the hide middleware and should be hidden
|
|
4266
4274
|
// set visibility to hidden and disable pointer events so the UI behaves
|
|
@@ -4275,16 +4283,16 @@ var tr = "PopperContent", [Vl, jl] = qo(tr), ns = l.forwardRef(
|
|
|
4275
4283
|
Vl,
|
|
4276
4284
|
{
|
|
4277
4285
|
scope: n,
|
|
4278
|
-
placedSide:
|
|
4286
|
+
placedSide: X,
|
|
4279
4287
|
onArrowChange: E,
|
|
4280
|
-
arrowX:
|
|
4288
|
+
arrowX: k,
|
|
4281
4289
|
arrowY: se,
|
|
4282
|
-
shouldHideArrow:
|
|
4290
|
+
shouldHideArrow: ae,
|
|
4283
4291
|
children: /* @__PURE__ */ c(
|
|
4284
4292
|
G.div,
|
|
4285
4293
|
{
|
|
4286
|
-
"data-side":
|
|
4287
|
-
"data-align":
|
|
4294
|
+
"data-side": X,
|
|
4295
|
+
"data-align": V,
|
|
4288
4296
|
...p,
|
|
4289
4297
|
ref: x,
|
|
4290
4298
|
style: {
|
|
@@ -4373,7 +4381,7 @@ function ss(e) {
|
|
|
4373
4381
|
var Gl = Qo, ql = ts, Zl = ns, Jl = os, Ql = "Portal", nr = l.forwardRef((e, t) => {
|
|
4374
4382
|
var a;
|
|
4375
4383
|
const { container: n, ...r } = e, [o, s] = l.useState(!1);
|
|
4376
|
-
|
|
4384
|
+
ce(() => s(!0), []);
|
|
4377
4385
|
const i = n || o && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
|
|
4378
4386
|
return i ? qi.createPortal(/* @__PURE__ */ c(G.div, { ...r, ref: t }), i) : null;
|
|
4379
4387
|
});
|
|
@@ -4406,7 +4414,7 @@ var nd = function(e) {
|
|
|
4406
4414
|
return null;
|
|
4407
4415
|
var t = Array.isArray(e) ? e[0] : e;
|
|
4408
4416
|
return t.ownerDocument.body;
|
|
4409
|
-
},
|
|
4417
|
+
}, Je = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakMap(), Nt = {}, bn = 0, as = function(e) {
|
|
4410
4418
|
return e && (e.host || as(e.parentNode));
|
|
4411
4419
|
}, rd = function(e, t) {
|
|
4412
4420
|
return t.map(function(n) {
|
|
@@ -4430,8 +4438,8 @@ var nd = function(e) {
|
|
|
4430
4438
|
f(m);
|
|
4431
4439
|
else
|
|
4432
4440
|
try {
|
|
4433
|
-
var w = m.getAttribute(r), y = w !== null && w !== "false", p = (
|
|
4434
|
-
|
|
4441
|
+
var w = m.getAttribute(r), y = w !== null && w !== "false", p = (Je.get(m) || 0) + 1, g = (s.get(m) || 0) + 1;
|
|
4442
|
+
Je.set(m, p), s.set(m, g), i.push(m), p === 1 && y && Ct.set(m, !0), g === 1 && m.setAttribute(n, "true"), y || m.setAttribute(r, "true");
|
|
4435
4443
|
} catch (v) {
|
|
4436
4444
|
console.error("aria-hidden: cannot operate on ", m, v);
|
|
4437
4445
|
}
|
|
@@ -4439,9 +4447,9 @@ var nd = function(e) {
|
|
|
4439
4447
|
};
|
|
4440
4448
|
return f(t), a.clear(), bn++, function() {
|
|
4441
4449
|
i.forEach(function(h) {
|
|
4442
|
-
var m =
|
|
4443
|
-
|
|
4444
|
-
}), bn--, bn || (
|
|
4450
|
+
var m = Je.get(h) - 1, w = s.get(h) - 1;
|
|
4451
|
+
Je.set(h, m), s.set(h, w), m || (Ct.has(h) || h.removeAttribute(r), Ct.delete(h)), w || h.removeAttribute(n);
|
|
4452
|
+
}), bn--, bn || (Je = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakMap(), Nt = {});
|
|
4445
4453
|
};
|
|
4446
4454
|
}, cs = function(e, t, n) {
|
|
4447
4455
|
n === void 0 && (n = "data-aria-hidden");
|
|
@@ -4476,7 +4484,7 @@ function yn(e, t) {
|
|
|
4476
4484
|
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
4477
4485
|
}
|
|
4478
4486
|
function cd(e, t) {
|
|
4479
|
-
var n =
|
|
4487
|
+
var n = Q(function() {
|
|
4480
4488
|
return {
|
|
4481
4489
|
// value
|
|
4482
4490
|
value: e,
|
|
@@ -4598,12 +4606,12 @@ var us = hd(), xn = function() {
|
|
|
4598
4606
|
onScrollCapture: xn,
|
|
4599
4607
|
onWheelCapture: xn,
|
|
4600
4608
|
onTouchMoveCapture: xn
|
|
4601
|
-
}), o = r[0], s = r[1], i = e.forwardProps, a = e.children, d = e.className, u = e.removeScrollBar, f = e.enabled, h = e.shards, m = e.sideCar, w = e.noRelative, y = e.noIsolation, p = e.inert, g = e.allowPinchZoom, v = e.as, b = v === void 0 ? "div" : v, x = e.gapMode, S = ls(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = m,
|
|
4609
|
+
}), o = r[0], s = r[1], i = e.forwardProps, a = e.children, d = e.className, u = e.removeScrollBar, f = e.enabled, h = e.shards, m = e.sideCar, w = e.noRelative, y = e.noIsolation, p = e.inert, g = e.allowPinchZoom, v = e.as, b = v === void 0 ? "div" : v, x = e.gapMode, S = ls(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = m, A = dd([n, t]), N = Ee(Ee({}, S), o);
|
|
4602
4610
|
return l.createElement(
|
|
4603
4611
|
l.Fragment,
|
|
4604
4612
|
null,
|
|
4605
4613
|
f && l.createElement(E, { sideCar: us, removeScrollBar: u, shards: h, noRelative: w, noIsolation: y, inert: p, setCallbacks: s, allowPinchZoom: !!g, lockRef: n, gapMode: x }),
|
|
4606
|
-
i ? l.cloneElement(l.Children.only(a), Ee(Ee({}, N), { ref:
|
|
4614
|
+
i ? l.cloneElement(l.Children.only(a), Ee(Ee({}, N), { ref: A })) : l.createElement(b, Ee({}, N, { className: d, ref: A }), a)
|
|
4607
4615
|
);
|
|
4608
4616
|
});
|
|
4609
4617
|
rn.defaultProps = {
|
|
@@ -4752,7 +4760,7 @@ if (typeof window < "u")
|
|
|
4752
4760
|
} catch {
|
|
4753
4761
|
kn = !1;
|
|
4754
4762
|
}
|
|
4755
|
-
var
|
|
4763
|
+
var Qe = kn ? { passive: !1 } : !1, Rd = function(e) {
|
|
4756
4764
|
return e.tagName === "TEXTAREA";
|
|
4757
4765
|
}, hs = function(e, t) {
|
|
4758
4766
|
if (!(e instanceof Element))
|
|
@@ -4828,7 +4836,7 @@ var Je = kn ? { passive: !1 } : !1, Rd = function(e) {
|
|
|
4828
4836
|
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
4829
4837
|
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
4830
4838
|
`);
|
|
4831
|
-
}, $d = 0,
|
|
4839
|
+
}, $d = 0, et = [];
|
|
4832
4840
|
function Fd(e) {
|
|
4833
4841
|
var t = l.useRef([]), n = l.useRef([0, 0]), r = l.useRef(), o = l.useState($d++)[0], s = l.useState(fs)[0], i = l.useRef(e);
|
|
4834
4842
|
l.useEffect(function() {
|
|
@@ -4849,13 +4857,13 @@ function Fd(e) {
|
|
|
4849
4857
|
var a = l.useCallback(function(p, g) {
|
|
4850
4858
|
if ("touches" in p && p.touches.length === 2 || p.type === "wheel" && p.ctrlKey)
|
|
4851
4859
|
return !i.current.allowPinchZoom;
|
|
4852
|
-
var v = Tt(p), b = n.current, x = "deltaX" in p ? p.deltaX : b[0] - v[0], S = "deltaY" in p ? p.deltaY : b[1] - v[1], E,
|
|
4853
|
-
if ("touches" in p && N === "h" &&
|
|
4860
|
+
var v = Tt(p), b = n.current, x = "deltaX" in p ? p.deltaX : b[0] - v[0], S = "deltaY" in p ? p.deltaY : b[1] - v[1], E, A = p.target, N = Math.abs(x) > Math.abs(S) ? "h" : "v";
|
|
4861
|
+
if ("touches" in p && N === "h" && A.type === "range")
|
|
4854
4862
|
return !1;
|
|
4855
|
-
var
|
|
4856
|
-
if (!
|
|
4863
|
+
var R = Wr(N, A);
|
|
4864
|
+
if (!R)
|
|
4857
4865
|
return !0;
|
|
4858
|
-
if (
|
|
4866
|
+
if (R ? E = N : (E = N === "v" ? "h" : "v", R = Wr(N, A)), !R)
|
|
4859
4867
|
return !1;
|
|
4860
4868
|
if (!r.current && "changedTouches" in p && (x || S) && (r.current = E), !E)
|
|
4861
4869
|
return !0;
|
|
@@ -4863,7 +4871,7 @@ function Fd(e) {
|
|
|
4863
4871
|
return Dd(_, g, p, _ === "h" ? x : S);
|
|
4864
4872
|
}, []), d = l.useCallback(function(p) {
|
|
4865
4873
|
var g = p;
|
|
4866
|
-
if (!(!
|
|
4874
|
+
if (!(!et.length || et[et.length - 1] !== s)) {
|
|
4867
4875
|
var v = "deltaY" in g ? zr(g) : Tt(g), b = t.current.filter(function(E) {
|
|
4868
4876
|
return E.name === g.type && (E.target === g.target || g.target === E.shadowParent) && Md(E.delta, v);
|
|
4869
4877
|
})[0];
|
|
@@ -4893,14 +4901,14 @@ function Fd(e) {
|
|
|
4893
4901
|
u(p.type, Tt(p), p.target, a(p, e.lockRef.current));
|
|
4894
4902
|
}, []);
|
|
4895
4903
|
l.useEffect(function() {
|
|
4896
|
-
return
|
|
4904
|
+
return et.push(s), e.setCallbacks({
|
|
4897
4905
|
onScrollCapture: h,
|
|
4898
4906
|
onWheelCapture: h,
|
|
4899
4907
|
onTouchMoveCapture: m
|
|
4900
|
-
}), document.addEventListener("wheel", d,
|
|
4901
|
-
|
|
4908
|
+
}), document.addEventListener("wheel", d, Qe), document.addEventListener("touchmove", d, Qe), document.addEventListener("touchstart", f, Qe), function() {
|
|
4909
|
+
et = et.filter(function(p) {
|
|
4902
4910
|
return p !== s;
|
|
4903
|
-
}), document.removeEventListener("wheel", d,
|
|
4911
|
+
}), document.removeEventListener("wheel", d, Qe), document.removeEventListener("touchmove", d, Qe), document.removeEventListener("touchstart", f, Qe);
|
|
4904
4912
|
};
|
|
4905
4913
|
}, []);
|
|
4906
4914
|
var w = e.removeScrollBar, y = e.inert;
|
|
@@ -4921,10 +4929,10 @@ var rr = l.forwardRef(function(e, t) {
|
|
|
4921
4929
|
return l.createElement(rn, Ee({}, e, { ref: t, sideCar: Wd }));
|
|
4922
4930
|
});
|
|
4923
4931
|
rr.classNames = rn.classNames;
|
|
4924
|
-
var zd = [" ", "Enter", "ArrowUp", "ArrowDown"], Hd = [" ", "Enter"],
|
|
4932
|
+
var zd = [" ", "Enter", "ArrowUp", "ArrowDown"], Hd = [" ", "Enter"], Ke = "Select", [on, sn, Ud] = mc(Ke), [ct, cf] = Ze(Ke, [
|
|
4925
4933
|
Ud,
|
|
4926
4934
|
Zo
|
|
4927
|
-
]), an = Zo(), [Vd,
|
|
4935
|
+
]), an = Zo(), [Vd, Ue] = ct(Ke), [jd, Yd] = ct(Ke), gs = (e) => {
|
|
4928
4936
|
const {
|
|
4929
4937
|
__scopeSelect: t,
|
|
4930
4938
|
children: n,
|
|
@@ -4940,17 +4948,17 @@ var zd = [" ", "Enter", "ArrowUp", "ArrowDown"], Hd = [" ", "Enter"], Xe = "Sele
|
|
|
4940
4948
|
disabled: m,
|
|
4941
4949
|
required: w,
|
|
4942
4950
|
form: y
|
|
4943
|
-
} = e, p = an(t), [g, v] = l.useState(null), [b, x] = l.useState(null), [S, E] = l.useState(!1),
|
|
4951
|
+
} = e, p = an(t), [g, v] = l.useState(null), [b, x] = l.useState(null), [S, E] = l.useState(!1), A = io(u), [N, R] = gt({
|
|
4944
4952
|
prop: r,
|
|
4945
4953
|
defaultProp: o ?? !1,
|
|
4946
4954
|
onChange: s,
|
|
4947
|
-
caller:
|
|
4955
|
+
caller: Ke
|
|
4948
4956
|
}), [_, D] = gt({
|
|
4949
4957
|
prop: i,
|
|
4950
4958
|
defaultProp: a,
|
|
4951
4959
|
onChange: d,
|
|
4952
|
-
caller:
|
|
4953
|
-
}),
|
|
4960
|
+
caller: Ke
|
|
4961
|
+
}), B = l.useRef(null), j = g ? y || !!g.closest("form") : !0, [Y, O] = l.useState(/* @__PURE__ */ new Set()), U = Array.from(Y).map((F) => F.props.value).join(";");
|
|
4954
4962
|
return /* @__PURE__ */ c(Gl, { ...p, children: /* @__PURE__ */ C(
|
|
4955
4963
|
Vd,
|
|
4956
4964
|
{
|
|
@@ -4962,32 +4970,32 @@ var zd = [" ", "Enter", "ArrowUp", "ArrowDown"], Hd = [" ", "Enter"], Xe = "Sele
|
|
|
4962
4970
|
onValueNodeChange: x,
|
|
4963
4971
|
valueNodeHasChildren: S,
|
|
4964
4972
|
onValueNodeHasChildrenChange: E,
|
|
4965
|
-
contentId:
|
|
4973
|
+
contentId: Ye(),
|
|
4966
4974
|
value: _,
|
|
4967
4975
|
onValueChange: D,
|
|
4968
4976
|
open: N,
|
|
4969
|
-
onOpenChange:
|
|
4970
|
-
dir:
|
|
4971
|
-
triggerPointerDownPosRef:
|
|
4977
|
+
onOpenChange: R,
|
|
4978
|
+
dir: A,
|
|
4979
|
+
triggerPointerDownPosRef: B,
|
|
4972
4980
|
disabled: m,
|
|
4973
4981
|
children: [
|
|
4974
4982
|
/* @__PURE__ */ c(on.Provider, { scope: t, children: /* @__PURE__ */ c(
|
|
4975
4983
|
jd,
|
|
4976
4984
|
{
|
|
4977
4985
|
scope: e.__scopeSelect,
|
|
4978
|
-
onNativeOptionAdd: l.useCallback((
|
|
4979
|
-
O((W) => new Set(W).add(
|
|
4986
|
+
onNativeOptionAdd: l.useCallback((F) => {
|
|
4987
|
+
O((W) => new Set(W).add(F));
|
|
4980
4988
|
}, []),
|
|
4981
|
-
onNativeOptionRemove: l.useCallback((
|
|
4989
|
+
onNativeOptionRemove: l.useCallback((F) => {
|
|
4982
4990
|
O((W) => {
|
|
4983
4991
|
const I = new Set(W);
|
|
4984
|
-
return I.delete(
|
|
4992
|
+
return I.delete(F), I;
|
|
4985
4993
|
});
|
|
4986
4994
|
}, []),
|
|
4987
4995
|
children: n
|
|
4988
4996
|
}
|
|
4989
4997
|
) }),
|
|
4990
|
-
|
|
4998
|
+
j ? /* @__PURE__ */ C(
|
|
4991
4999
|
Ws,
|
|
4992
5000
|
{
|
|
4993
5001
|
"aria-hidden": !0,
|
|
@@ -4996,24 +5004,24 @@ var zd = [" ", "Enter", "ArrowUp", "ArrowDown"], Hd = [" ", "Enter"], Xe = "Sele
|
|
|
4996
5004
|
name: f,
|
|
4997
5005
|
autoComplete: h,
|
|
4998
5006
|
value: _,
|
|
4999
|
-
onChange: (
|
|
5007
|
+
onChange: (F) => D(F.target.value),
|
|
5000
5008
|
disabled: m,
|
|
5001
5009
|
form: y,
|
|
5002
5010
|
children: [
|
|
5003
5011
|
_ === void 0 ? /* @__PURE__ */ c("option", { value: "" }) : null,
|
|
5004
|
-
Array.from(
|
|
5012
|
+
Array.from(Y)
|
|
5005
5013
|
]
|
|
5006
5014
|
},
|
|
5007
|
-
|
|
5015
|
+
U
|
|
5008
5016
|
) : null
|
|
5009
5017
|
]
|
|
5010
5018
|
}
|
|
5011
5019
|
) });
|
|
5012
5020
|
};
|
|
5013
|
-
gs.displayName =
|
|
5021
|
+
gs.displayName = Ke;
|
|
5014
5022
|
var vs = "SelectTrigger", ws = l.forwardRef(
|
|
5015
5023
|
(e, t) => {
|
|
5016
|
-
const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = an(n), i =
|
|
5024
|
+
const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = an(n), i = Ue(vs, n), a = i.disabled || r, d = ee(t, i.onTriggerChange), u = sn(n), f = l.useRef("touch"), [h, m, w] = Hs((p) => {
|
|
5017
5025
|
const g = u().filter((x) => !x.disabled), v = g.find((x) => x.value === i.value), b = Us(g, p, v);
|
|
5018
5026
|
b !== void 0 && i.onValueChange(b.value);
|
|
5019
5027
|
}), y = (p) => {
|
|
@@ -5057,8 +5065,8 @@ var vs = "SelectTrigger", ws = l.forwardRef(
|
|
|
5057
5065
|
ws.displayName = vs;
|
|
5058
5066
|
var bs = "SelectValue", ys = l.forwardRef(
|
|
5059
5067
|
(e, t) => {
|
|
5060
|
-
const { __scopeSelect: n, className: r, style: o, children: s, placeholder: i = "", ...a } = e, d =
|
|
5061
|
-
return
|
|
5068
|
+
const { __scopeSelect: n, className: r, style: o, children: s, placeholder: i = "", ...a } = e, d = Ue(bs, n), { onValueNodeHasChildrenChange: u } = d, f = s !== void 0, h = ee(t, d.onValueNodeChange);
|
|
5069
|
+
return ce(() => {
|
|
5062
5070
|
u(f);
|
|
5063
5071
|
}, [u, f]), /* @__PURE__ */ c(
|
|
5064
5072
|
G.span,
|
|
@@ -5081,10 +5089,10 @@ var Xd = "SelectIcon", xs = l.forwardRef(
|
|
|
5081
5089
|
xs.displayName = Xd;
|
|
5082
5090
|
var Kd = "SelectPortal", Ss = (e) => /* @__PURE__ */ c(nr, { asChild: !0, ...e });
|
|
5083
5091
|
Ss.displayName = Kd;
|
|
5084
|
-
var
|
|
5092
|
+
var Ge = "SelectContent", Cs = l.forwardRef(
|
|
5085
5093
|
(e, t) => {
|
|
5086
|
-
const n =
|
|
5087
|
-
if (
|
|
5094
|
+
const n = Ue(Ge, e.__scopeSelect), [r, o] = l.useState();
|
|
5095
|
+
if (ce(() => {
|
|
5088
5096
|
o(new DocumentFragment());
|
|
5089
5097
|
}, []), !n.open) {
|
|
5090
5098
|
const s = r;
|
|
@@ -5096,8 +5104,8 @@ var Ke = "SelectContent", Cs = l.forwardRef(
|
|
|
5096
5104
|
return /* @__PURE__ */ c(Es, { ...e, ref: t });
|
|
5097
5105
|
}
|
|
5098
5106
|
);
|
|
5099
|
-
Cs.displayName =
|
|
5100
|
-
var ye = 10, [Ns,
|
|
5107
|
+
Cs.displayName = Ge;
|
|
5108
|
+
var ye = 10, [Ns, Ve] = ct(Ge), Gd = "SelectContentImpl", qd = mt("SelectContent.RemoveScroll"), Es = l.forwardRef(
|
|
5101
5109
|
(e, t) => {
|
|
5102
5110
|
const {
|
|
5103
5111
|
__scopeSelect: n,
|
|
@@ -5119,65 +5127,65 @@ var ye = 10, [Ns, Ue] = ct(Ke), Gd = "SelectContentImpl", qd = mt("SelectContent
|
|
|
5119
5127
|
avoidCollisions: g,
|
|
5120
5128
|
//
|
|
5121
5129
|
...v
|
|
5122
|
-
} = e, b =
|
|
5130
|
+
} = e, b = Ue(Ge, n), [x, S] = l.useState(null), [E, A] = l.useState(null), N = ee(t, (H) => S(H)), [R, _] = l.useState(null), [D, B] = l.useState(
|
|
5123
5131
|
null
|
|
5124
|
-
),
|
|
5132
|
+
), j = sn(n), [Y, O] = l.useState(!1), U = l.useRef(!1);
|
|
5125
5133
|
l.useEffect(() => {
|
|
5126
5134
|
if (x) return cs(x);
|
|
5127
5135
|
}, [x]), Lo();
|
|
5128
|
-
const
|
|
5129
|
-
(
|
|
5130
|
-
const [
|
|
5131
|
-
for (const q of
|
|
5132
|
-
if (q ===
|
|
5136
|
+
const F = l.useCallback(
|
|
5137
|
+
(H) => {
|
|
5138
|
+
const [J, ...oe] = j().map((q) => q.ref.current), [$] = oe.slice(-1), L = document.activeElement;
|
|
5139
|
+
for (const q of H)
|
|
5140
|
+
if (q === L || (q == null || q.scrollIntoView({ block: "nearest" }), q === J && E && (E.scrollTop = 0), q === $ && E && (E.scrollTop = E.scrollHeight), q == null || q.focus(), document.activeElement !== L)) return;
|
|
5133
5141
|
},
|
|
5134
|
-
[
|
|
5142
|
+
[j, E]
|
|
5135
5143
|
), W = l.useCallback(
|
|
5136
|
-
() =>
|
|
5137
|
-
[
|
|
5144
|
+
() => F([R, x]),
|
|
5145
|
+
[F, R, x]
|
|
5138
5146
|
);
|
|
5139
5147
|
l.useEffect(() => {
|
|
5140
|
-
|
|
5141
|
-
}, [
|
|
5142
|
-
const { onOpenChange: I, triggerPointerDownPosRef:
|
|
5148
|
+
Y && W();
|
|
5149
|
+
}, [Y, W]);
|
|
5150
|
+
const { onOpenChange: I, triggerPointerDownPosRef: X } = b;
|
|
5143
5151
|
l.useEffect(() => {
|
|
5144
5152
|
if (x) {
|
|
5145
|
-
let
|
|
5146
|
-
const
|
|
5147
|
-
var
|
|
5148
|
-
|
|
5149
|
-
x: Math.abs(Math.round(
|
|
5150
|
-
y: Math.abs(Math.round(
|
|
5153
|
+
let H = { x: 0, y: 0 };
|
|
5154
|
+
const J = ($) => {
|
|
5155
|
+
var L, q;
|
|
5156
|
+
H = {
|
|
5157
|
+
x: Math.abs(Math.round($.pageX) - (((L = X.current) == null ? void 0 : L.x) ?? 0)),
|
|
5158
|
+
y: Math.abs(Math.round($.pageY) - (((q = X.current) == null ? void 0 : q.y) ?? 0))
|
|
5151
5159
|
};
|
|
5152
|
-
}, oe = (
|
|
5153
|
-
|
|
5160
|
+
}, oe = ($) => {
|
|
5161
|
+
H.x <= 10 && H.y <= 10 ? $.preventDefault() : x.contains($.target) || I(!1), document.removeEventListener("pointermove", J), X.current = null;
|
|
5154
5162
|
};
|
|
5155
|
-
return
|
|
5156
|
-
document.removeEventListener("pointermove",
|
|
5163
|
+
return X.current !== null && (document.addEventListener("pointermove", J), document.addEventListener("pointerup", oe, { capture: !0, once: !0 })), () => {
|
|
5164
|
+
document.removeEventListener("pointermove", J), document.removeEventListener("pointerup", oe, { capture: !0 });
|
|
5157
5165
|
};
|
|
5158
5166
|
}
|
|
5159
|
-
}, [x, I,
|
|
5160
|
-
const
|
|
5161
|
-
return window.addEventListener("blur",
|
|
5162
|
-
window.removeEventListener("blur",
|
|
5167
|
+
}, [x, I, X]), l.useEffect(() => {
|
|
5168
|
+
const H = () => I(!1);
|
|
5169
|
+
return window.addEventListener("blur", H), window.addEventListener("resize", H), () => {
|
|
5170
|
+
window.removeEventListener("blur", H), window.removeEventListener("resize", H);
|
|
5163
5171
|
};
|
|
5164
5172
|
}, [I]);
|
|
5165
|
-
const [
|
|
5166
|
-
const
|
|
5167
|
-
|
|
5168
|
-
}),
|
|
5169
|
-
(
|
|
5170
|
-
const
|
|
5171
|
-
(b.value !== void 0 && b.value ===
|
|
5173
|
+
const [V, T] = Hs((H) => {
|
|
5174
|
+
const J = j().filter((L) => !L.disabled), oe = J.find((L) => L.ref.current === document.activeElement), $ = Us(J, H, oe);
|
|
5175
|
+
$ && setTimeout(() => $.ref.current.focus());
|
|
5176
|
+
}), k = l.useCallback(
|
|
5177
|
+
(H, J, oe) => {
|
|
5178
|
+
const $ = !U.current && !oe;
|
|
5179
|
+
(b.value !== void 0 && b.value === J || $) && (_(H), $ && (U.current = !0));
|
|
5172
5180
|
},
|
|
5173
5181
|
[b.value]
|
|
5174
|
-
), se = l.useCallback(() => x == null ? void 0 : x.focus(), [x]),
|
|
5175
|
-
(
|
|
5176
|
-
const
|
|
5177
|
-
(b.value !== void 0 && b.value ===
|
|
5182
|
+
), se = l.useCallback(() => x == null ? void 0 : x.focus(), [x]), ae = l.useCallback(
|
|
5183
|
+
(H, J, oe) => {
|
|
5184
|
+
const $ = !U.current && !oe;
|
|
5185
|
+
(b.value !== void 0 && b.value === J || $) && B(H);
|
|
5178
5186
|
},
|
|
5179
5187
|
[b.value]
|
|
5180
|
-
),
|
|
5188
|
+
), re = r === "popper" ? _n : Ts, ie = re === _n ? {
|
|
5181
5189
|
side: a,
|
|
5182
5190
|
sideOffset: d,
|
|
5183
5191
|
align: u,
|
|
@@ -5195,27 +5203,27 @@ var ye = 10, [Ns, Ue] = ct(Ke), Gd = "SelectContentImpl", qd = mt("SelectContent
|
|
|
5195
5203
|
scope: n,
|
|
5196
5204
|
content: x,
|
|
5197
5205
|
viewport: E,
|
|
5198
|
-
onViewportChange:
|
|
5199
|
-
itemRefCallback:
|
|
5200
|
-
selectedItem:
|
|
5206
|
+
onViewportChange: A,
|
|
5207
|
+
itemRefCallback: k,
|
|
5208
|
+
selectedItem: R,
|
|
5201
5209
|
onItemLeave: se,
|
|
5202
|
-
itemTextRefCallback:
|
|
5210
|
+
itemTextRefCallback: ae,
|
|
5203
5211
|
focusSelectedItem: W,
|
|
5204
5212
|
selectedItemText: D,
|
|
5205
5213
|
position: r,
|
|
5206
|
-
isPositioned:
|
|
5207
|
-
searchRef:
|
|
5214
|
+
isPositioned: Y,
|
|
5215
|
+
searchRef: V,
|
|
5208
5216
|
children: /* @__PURE__ */ c(rr, { as: qd, allowPinchZoom: !0, children: /* @__PURE__ */ c(
|
|
5209
5217
|
Xn,
|
|
5210
5218
|
{
|
|
5211
5219
|
asChild: !0,
|
|
5212
5220
|
trapped: b.open,
|
|
5213
|
-
onMountAutoFocus: (
|
|
5214
|
-
|
|
5221
|
+
onMountAutoFocus: (H) => {
|
|
5222
|
+
H.preventDefault();
|
|
5215
5223
|
},
|
|
5216
|
-
onUnmountAutoFocus: Z(o, (
|
|
5217
|
-
var
|
|
5218
|
-
(
|
|
5224
|
+
onUnmountAutoFocus: Z(o, (H) => {
|
|
5225
|
+
var J;
|
|
5226
|
+
(J = b.trigger) == null || J.focus({ preventScroll: !0 }), H.preventDefault();
|
|
5219
5227
|
}),
|
|
5220
5228
|
children: /* @__PURE__ */ c(
|
|
5221
5229
|
Yn,
|
|
@@ -5224,18 +5232,18 @@ var ye = 10, [Ns, Ue] = ct(Ke), Gd = "SelectContentImpl", qd = mt("SelectContent
|
|
|
5224
5232
|
disableOutsidePointerEvents: !0,
|
|
5225
5233
|
onEscapeKeyDown: s,
|
|
5226
5234
|
onPointerDownOutside: i,
|
|
5227
|
-
onFocusOutside: (
|
|
5235
|
+
onFocusOutside: (H) => H.preventDefault(),
|
|
5228
5236
|
onDismiss: () => b.onOpenChange(!1),
|
|
5229
5237
|
children: /* @__PURE__ */ c(
|
|
5230
|
-
|
|
5238
|
+
re,
|
|
5231
5239
|
{
|
|
5232
5240
|
role: "listbox",
|
|
5233
5241
|
id: b.contentId,
|
|
5234
5242
|
"data-state": b.open ? "open" : "closed",
|
|
5235
5243
|
dir: b.dir,
|
|
5236
|
-
onContextMenu: (
|
|
5244
|
+
onContextMenu: (H) => H.preventDefault(),
|
|
5237
5245
|
...v,
|
|
5238
|
-
...
|
|
5246
|
+
...ie,
|
|
5239
5247
|
onPlaced: () => O(!0),
|
|
5240
5248
|
ref: N,
|
|
5241
5249
|
style: {
|
|
@@ -5246,15 +5254,15 @@ var ye = 10, [Ns, Ue] = ct(Ke), Gd = "SelectContentImpl", qd = mt("SelectContent
|
|
|
5246
5254
|
outline: "none",
|
|
5247
5255
|
...v.style
|
|
5248
5256
|
},
|
|
5249
|
-
onKeyDown: Z(v.onKeyDown, (
|
|
5250
|
-
const
|
|
5251
|
-
if (
|
|
5252
|
-
let
|
|
5253
|
-
if (["ArrowUp", "End"].includes(
|
|
5254
|
-
const
|
|
5255
|
-
|
|
5257
|
+
onKeyDown: Z(v.onKeyDown, (H) => {
|
|
5258
|
+
const J = H.ctrlKey || H.altKey || H.metaKey;
|
|
5259
|
+
if (H.key === "Tab" && H.preventDefault(), !J && H.key.length === 1 && T(H.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(H.key)) {
|
|
5260
|
+
let $ = j().filter((L) => !L.disabled).map((L) => L.ref.current);
|
|
5261
|
+
if (["ArrowUp", "End"].includes(H.key) && ($ = $.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(H.key)) {
|
|
5262
|
+
const L = H.target, q = $.indexOf(L);
|
|
5263
|
+
$ = $.slice(q + 1);
|
|
5256
5264
|
}
|
|
5257
|
-
setTimeout(() =>
|
|
5265
|
+
setTimeout(() => F($)), H.preventDefault();
|
|
5258
5266
|
}
|
|
5259
5267
|
})
|
|
5260
5268
|
}
|
|
@@ -5269,11 +5277,11 @@ var ye = 10, [Ns, Ue] = ct(Ke), Gd = "SelectContentImpl", qd = mt("SelectContent
|
|
|
5269
5277
|
);
|
|
5270
5278
|
Es.displayName = Gd;
|
|
5271
5279
|
var Zd = "SelectItemAlignedPosition", Ts = l.forwardRef((e, t) => {
|
|
5272
|
-
const { __scopeSelect: n, onPlaced: r, ...o } = e, s =
|
|
5280
|
+
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = Ue(Ge, n), i = Ve(Ge, n), [a, d] = l.useState(null), [u, f] = l.useState(null), h = ee(t, (N) => f(N)), m = sn(n), w = l.useRef(!1), y = l.useRef(!0), { viewport: p, selectedItem: g, selectedItemText: v, focusSelectedItem: b } = i, x = l.useCallback(() => {
|
|
5273
5281
|
if (s.trigger && s.valueNode && a && u && p && g && v) {
|
|
5274
|
-
const N = s.trigger.getBoundingClientRect(),
|
|
5282
|
+
const N = s.trigger.getBoundingClientRect(), R = u.getBoundingClientRect(), _ = s.valueNode.getBoundingClientRect(), D = v.getBoundingClientRect();
|
|
5275
5283
|
if (s.dir !== "rtl") {
|
|
5276
|
-
const
|
|
5284
|
+
const L = D.left - R.left, q = _.left - L, fe = N.left - q, ve = N.width + fe, Ne = Math.max(ve, R.width), Le = window.innerWidth - ye, P = Tn(q, [
|
|
5277
5285
|
ye,
|
|
5278
5286
|
// Prevents the content from going off the starting edge of the
|
|
5279
5287
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -5284,33 +5292,33 @@ var Zd = "SelectItemAlignedPosition", Ts = l.forwardRef((e, t) => {
|
|
|
5284
5292
|
]);
|
|
5285
5293
|
a.style.minWidth = ve + "px", a.style.left = P + "px";
|
|
5286
5294
|
} else {
|
|
5287
|
-
const
|
|
5295
|
+
const L = R.right - D.right, q = window.innerWidth - _.right - L, fe = window.innerWidth - N.right - q, ve = N.width + fe, Ne = Math.max(ve, R.width), Le = window.innerWidth - ye, P = Tn(q, [
|
|
5288
5296
|
ye,
|
|
5289
5297
|
Math.max(ye, Le - Ne)
|
|
5290
5298
|
]);
|
|
5291
5299
|
a.style.minWidth = ve + "px", a.style.right = P + "px";
|
|
5292
5300
|
}
|
|
5293
|
-
const
|
|
5294
|
-
if (
|
|
5295
|
-
const
|
|
5301
|
+
const B = m(), j = window.innerHeight - ye * 2, Y = p.scrollHeight, O = window.getComputedStyle(u), U = parseInt(O.borderTopWidth, 10), F = parseInt(O.paddingTop, 10), W = parseInt(O.borderBottomWidth, 10), I = parseInt(O.paddingBottom, 10), X = U + F + Y + I + W, V = Math.min(g.offsetHeight * 5, X), T = window.getComputedStyle(p), k = parseInt(T.paddingTop, 10), se = parseInt(T.paddingBottom, 10), ae = N.top + N.height / 2 - ye, re = j - ae, ie = g.offsetHeight / 2, H = g.offsetTop + ie, J = U + F + H, oe = X - J;
|
|
5302
|
+
if (J <= ae) {
|
|
5303
|
+
const L = B.length > 0 && g === B[B.length - 1].ref.current;
|
|
5296
5304
|
a.style.bottom = "0px";
|
|
5297
5305
|
const q = u.clientHeight - p.offsetTop - p.offsetHeight, fe = Math.max(
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
(
|
|
5301
|
-
), ve =
|
|
5306
|
+
re,
|
|
5307
|
+
ie + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
5308
|
+
(L ? se : 0) + q + W
|
|
5309
|
+
), ve = J + fe;
|
|
5302
5310
|
a.style.height = ve + "px";
|
|
5303
5311
|
} else {
|
|
5304
|
-
const
|
|
5312
|
+
const L = B.length > 0 && g === B[0].ref.current;
|
|
5305
5313
|
a.style.top = "0px";
|
|
5306
5314
|
const fe = Math.max(
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
(
|
|
5315
|
+
ae,
|
|
5316
|
+
U + p.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
5317
|
+
(L ? k : 0) + ie
|
|
5310
5318
|
) + oe;
|
|
5311
|
-
a.style.height = fe + "px", p.scrollTop =
|
|
5319
|
+
a.style.height = fe + "px", p.scrollTop = J - ae + p.offsetTop;
|
|
5312
5320
|
}
|
|
5313
|
-
a.style.margin = `${ye}px 0`, a.style.minHeight =
|
|
5321
|
+
a.style.margin = `${ye}px 0`, a.style.minHeight = V + "px", a.style.maxHeight = j + "px", r == null || r(), requestAnimationFrame(() => w.current = !0);
|
|
5314
5322
|
}
|
|
5315
5323
|
}, [
|
|
5316
5324
|
m,
|
|
@@ -5324,12 +5332,12 @@ var Zd = "SelectItemAlignedPosition", Ts = l.forwardRef((e, t) => {
|
|
|
5324
5332
|
s.dir,
|
|
5325
5333
|
r
|
|
5326
5334
|
]);
|
|
5327
|
-
|
|
5335
|
+
ce(() => x(), [x]);
|
|
5328
5336
|
const [S, E] = l.useState();
|
|
5329
|
-
|
|
5337
|
+
ce(() => {
|
|
5330
5338
|
u && E(window.getComputedStyle(u).zIndex);
|
|
5331
5339
|
}, [u]);
|
|
5332
|
-
const
|
|
5340
|
+
const A = l.useCallback(
|
|
5333
5341
|
(N) => {
|
|
5334
5342
|
N && y.current === !0 && (x(), b == null || b(), y.current = !1);
|
|
5335
5343
|
},
|
|
@@ -5341,7 +5349,7 @@ var Zd = "SelectItemAlignedPosition", Ts = l.forwardRef((e, t) => {
|
|
|
5341
5349
|
scope: n,
|
|
5342
5350
|
contentWrapper: a,
|
|
5343
5351
|
shouldExpandOnScrollRef: w,
|
|
5344
|
-
onScrollButtonChange:
|
|
5352
|
+
onScrollButtonChange: A,
|
|
5345
5353
|
children: /* @__PURE__ */ c(
|
|
5346
5354
|
"div",
|
|
5347
5355
|
{
|
|
@@ -5402,9 +5410,9 @@ var Jd = "SelectPopperPosition", _n = l.forwardRef((e, t) => {
|
|
|
5402
5410
|
);
|
|
5403
5411
|
});
|
|
5404
5412
|
_n.displayName = Jd;
|
|
5405
|
-
var [Qd, or] = ct(
|
|
5413
|
+
var [Qd, or] = ct(Ge, {}), On = "SelectViewport", As = l.forwardRef(
|
|
5406
5414
|
(e, t) => {
|
|
5407
|
-
const { __scopeSelect: n, nonce: r, ...o } = e, s =
|
|
5415
|
+
const { __scopeSelect: n, nonce: r, ...o } = e, s = Ve(On, n), i = or(On, n), a = ee(t, s.onViewportChange), d = l.useRef(0);
|
|
5408
5416
|
return /* @__PURE__ */ C(_e, { children: [
|
|
5409
5417
|
/* @__PURE__ */ c(
|
|
5410
5418
|
"style",
|
|
@@ -5457,7 +5465,7 @@ var [Qd, or] = ct(Ke, {}), On = "SelectViewport", As = l.forwardRef(
|
|
|
5457
5465
|
As.displayName = On;
|
|
5458
5466
|
var Rs = "SelectGroup", [eu, tu] = ct(Rs), nu = l.forwardRef(
|
|
5459
5467
|
(e, t) => {
|
|
5460
|
-
const { __scopeSelect: n, ...r } = e, o =
|
|
5468
|
+
const { __scopeSelect: n, ...r } = e, o = Ye();
|
|
5461
5469
|
return /* @__PURE__ */ c(eu, { scope: n, id: o, children: /* @__PURE__ */ c(G.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
|
|
5462
5470
|
}
|
|
5463
5471
|
);
|
|
@@ -5477,13 +5485,13 @@ var jt = "SelectItem", [ru, ks] = ct(jt), _s = l.forwardRef(
|
|
|
5477
5485
|
disabled: o = !1,
|
|
5478
5486
|
textValue: s,
|
|
5479
5487
|
...i
|
|
5480
|
-
} = e, a =
|
|
5488
|
+
} = e, a = Ue(jt, n), d = Ve(jt, n), u = a.value === r, [f, h] = l.useState(s ?? ""), [m, w] = l.useState(!1), y = ee(
|
|
5481
5489
|
t,
|
|
5482
5490
|
(b) => {
|
|
5483
5491
|
var x;
|
|
5484
5492
|
return (x = d.itemRefCallback) == null ? void 0 : x.call(d, b, r, o);
|
|
5485
5493
|
}
|
|
5486
|
-
), p =
|
|
5494
|
+
), p = Ye(), g = l.useRef("touch"), v = () => {
|
|
5487
5495
|
o || (a.onValueChange(r), a.onOpenChange(!1));
|
|
5488
5496
|
};
|
|
5489
5497
|
if (r === "")
|
|
@@ -5555,7 +5563,7 @@ var jt = "SelectItem", [ru, ks] = ct(jt), _s = l.forwardRef(
|
|
|
5555
5563
|
_s.displayName = jt;
|
|
5556
5564
|
var dt = "SelectItemText", Os = l.forwardRef(
|
|
5557
5565
|
(e, t) => {
|
|
5558
|
-
const { __scopeSelect: n, className: r, style: o, ...s } = e, i =
|
|
5566
|
+
const { __scopeSelect: n, className: r, style: o, ...s } = e, i = Ue(dt, n), a = Ve(dt, n), d = ks(dt, n), u = Yd(dt, n), [f, h] = l.useState(null), m = ee(
|
|
5559
5567
|
t,
|
|
5560
5568
|
(v) => h(v),
|
|
5561
5569
|
d.onItemTextChange,
|
|
@@ -5567,7 +5575,7 @@ var dt = "SelectItemText", Os = l.forwardRef(
|
|
|
5567
5575
|
() => /* @__PURE__ */ c("option", { value: d.value, disabled: d.disabled, children: w }, d.value),
|
|
5568
5576
|
[d.disabled, d.value, w]
|
|
5569
5577
|
), { onNativeOptionAdd: p, onNativeOptionRemove: g } = u;
|
|
5570
|
-
return
|
|
5578
|
+
return ce(() => (p(y), () => g(y)), [p, g, y]), /* @__PURE__ */ C(_e, { children: [
|
|
5571
5579
|
/* @__PURE__ */ c(G.span, { id: d.textId, ...s, ref: m }),
|
|
5572
5580
|
d.isSelected && i.valueNode && !i.valueNodeHasChildren ? Kt.createPortal(s.children, i.valueNode) : null
|
|
5573
5581
|
] });
|
|
@@ -5582,8 +5590,8 @@ var Ds = "SelectItemIndicator", Ms = l.forwardRef(
|
|
|
5582
5590
|
);
|
|
5583
5591
|
Ms.displayName = Ds;
|
|
5584
5592
|
var Dn = "SelectScrollUpButton", Ls = l.forwardRef((e, t) => {
|
|
5585
|
-
const n =
|
|
5586
|
-
return
|
|
5593
|
+
const n = Ve(Dn, e.__scopeSelect), r = or(Dn, e.__scopeSelect), [o, s] = l.useState(!1), i = ee(t, r.onScrollButtonChange);
|
|
5594
|
+
return ce(() => {
|
|
5587
5595
|
if (n.viewport && n.isPositioned) {
|
|
5588
5596
|
let a = function() {
|
|
5589
5597
|
const u = d.scrollTop > 0;
|
|
@@ -5606,8 +5614,8 @@ var Dn = "SelectScrollUpButton", Ls = l.forwardRef((e, t) => {
|
|
|
5606
5614
|
});
|
|
5607
5615
|
Ls.displayName = Dn;
|
|
5608
5616
|
var Mn = "SelectScrollDownButton", $s = l.forwardRef((e, t) => {
|
|
5609
|
-
const n =
|
|
5610
|
-
return
|
|
5617
|
+
const n = Ve(Mn, e.__scopeSelect), r = or(Mn, e.__scopeSelect), [o, s] = l.useState(!1), i = ee(t, r.onScrollButtonChange);
|
|
5618
|
+
return ce(() => {
|
|
5611
5619
|
if (n.viewport && n.isPositioned) {
|
|
5612
5620
|
let a = function() {
|
|
5613
5621
|
const u = d.scrollHeight - d.clientHeight, f = Math.ceil(d.scrollTop) < u;
|
|
@@ -5630,10 +5638,10 @@ var Mn = "SelectScrollDownButton", $s = l.forwardRef((e, t) => {
|
|
|
5630
5638
|
});
|
|
5631
5639
|
$s.displayName = Mn;
|
|
5632
5640
|
var Fs = l.forwardRef((e, t) => {
|
|
5633
|
-
const { __scopeSelect: n, onAutoScroll: r, ...o } = e, s =
|
|
5641
|
+
const { __scopeSelect: n, onAutoScroll: r, ...o } = e, s = Ve("SelectScrollButton", n), i = l.useRef(null), a = sn(n), d = l.useCallback(() => {
|
|
5634
5642
|
i.current !== null && (window.clearInterval(i.current), i.current = null);
|
|
5635
5643
|
}, []);
|
|
5636
|
-
return l.useEffect(() => () => d(), [d]),
|
|
5644
|
+
return l.useEffect(() => () => d(), [d]), ce(() => {
|
|
5637
5645
|
var f;
|
|
5638
5646
|
const u = a().find((h) => h.ref.current === document.activeElement);
|
|
5639
5647
|
(f = u == null ? void 0 : u.ref.current) == null || f.scrollIntoView({ block: "nearest" });
|
|
@@ -5665,7 +5673,7 @@ var Fs = l.forwardRef((e, t) => {
|
|
|
5665
5673
|
Bs.displayName = ou;
|
|
5666
5674
|
var Ln = "SelectArrow", su = l.forwardRef(
|
|
5667
5675
|
(e, t) => {
|
|
5668
|
-
const { __scopeSelect: n, ...r } = e, o = an(n), s =
|
|
5676
|
+
const { __scopeSelect: n, ...r } = e, o = an(n), s = Ue(Ln, n), i = Ve(Ln, n);
|
|
5669
5677
|
return s.open && i.position === "popper" ? /* @__PURE__ */ c(Jl, { ...o, ...r, ref: t }) : null;
|
|
5670
5678
|
}
|
|
5671
5679
|
);
|
|
@@ -5805,7 +5813,7 @@ const mu = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
5805
5813
|
}
|
|
5806
5814
|
));
|
|
5807
5815
|
mu.displayName = Ys.displayName;
|
|
5808
|
-
const
|
|
5816
|
+
const je = l.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ C(
|
|
5809
5817
|
Xs,
|
|
5810
5818
|
{
|
|
5811
5819
|
ref: r,
|
|
@@ -5820,7 +5828,7 @@ const Ve = l.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
5820
5828
|
]
|
|
5821
5829
|
}
|
|
5822
5830
|
));
|
|
5823
|
-
|
|
5831
|
+
je.displayName = Xs.displayName;
|
|
5824
5832
|
const gu = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
5825
5833
|
qs,
|
|
5826
5834
|
{
|
|
@@ -5917,7 +5925,7 @@ const ti = l.forwardRef(
|
|
|
5917
5925
|
)
|
|
5918
5926
|
);
|
|
5919
5927
|
ti.displayName = ei.displayName;
|
|
5920
|
-
var cn = "Dialog", [ni, lf] =
|
|
5928
|
+
var cn = "Dialog", [ni, lf] = Ze(cn), [Su, Ce] = ni(cn), ri = (e) => {
|
|
5921
5929
|
const {
|
|
5922
5930
|
__scopeDialog: t,
|
|
5923
5931
|
children: n,
|
|
@@ -5937,9 +5945,9 @@ var cn = "Dialog", [ni, lf] = qe(cn), [Su, Ce] = ni(cn), ri = (e) => {
|
|
|
5937
5945
|
scope: t,
|
|
5938
5946
|
triggerRef: a,
|
|
5939
5947
|
contentRef: d,
|
|
5940
|
-
contentId:
|
|
5941
|
-
titleId:
|
|
5942
|
-
descriptionId:
|
|
5948
|
+
contentId: Ye(),
|
|
5949
|
+
titleId: Ye(),
|
|
5950
|
+
descriptionId: Ye(),
|
|
5943
5951
|
open: u,
|
|
5944
5952
|
onOpenChange: f,
|
|
5945
5953
|
onOpenToggle: l.useCallback(() => f((h) => !h), [f]),
|
|
@@ -5999,16 +6007,16 @@ var Nu = mt("DialogOverlay.RemoveScroll"), Eu = l.forwardRef(
|
|
|
5999
6007
|
) })
|
|
6000
6008
|
);
|
|
6001
6009
|
}
|
|
6002
|
-
),
|
|
6010
|
+
), qe = "DialogContent", li = l.forwardRef(
|
|
6003
6011
|
(e, t) => {
|
|
6004
|
-
const n = ii(
|
|
6012
|
+
const n = ii(qe, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = Ce(qe, e.__scopeDialog);
|
|
6005
6013
|
return /* @__PURE__ */ c(Me, { present: r || s.open, children: s.modal ? /* @__PURE__ */ c(Tu, { ...o, ref: t }) : /* @__PURE__ */ c(Au, { ...o, ref: t }) });
|
|
6006
6014
|
}
|
|
6007
6015
|
);
|
|
6008
|
-
li.displayName =
|
|
6016
|
+
li.displayName = qe;
|
|
6009
6017
|
var Tu = l.forwardRef(
|
|
6010
6018
|
(e, t) => {
|
|
6011
|
-
const n = Ce(
|
|
6019
|
+
const n = Ce(qe, e.__scopeDialog), r = l.useRef(null), o = ee(t, n.contentRef, r);
|
|
6012
6020
|
return l.useEffect(() => {
|
|
6013
6021
|
const s = r.current;
|
|
6014
6022
|
if (s) return cs(s);
|
|
@@ -6036,7 +6044,7 @@ var Tu = l.forwardRef(
|
|
|
6036
6044
|
}
|
|
6037
6045
|
), Au = l.forwardRef(
|
|
6038
6046
|
(e, t) => {
|
|
6039
|
-
const n = Ce(
|
|
6047
|
+
const n = Ce(qe, e.__scopeDialog), r = l.useRef(!1), o = l.useRef(!1);
|
|
6040
6048
|
return /* @__PURE__ */ c(
|
|
6041
6049
|
di,
|
|
6042
6050
|
{
|
|
@@ -6059,7 +6067,7 @@ var Tu = l.forwardRef(
|
|
|
6059
6067
|
}
|
|
6060
6068
|
), di = l.forwardRef(
|
|
6061
6069
|
(e, t) => {
|
|
6062
|
-
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...i } = e, a = Ce(
|
|
6070
|
+
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...i } = e, a = Ce(qe, n), d = l.useRef(null), u = ee(t, d);
|
|
6063
6071
|
return Lo(), /* @__PURE__ */ C(_e, { children: [
|
|
6064
6072
|
/* @__PURE__ */ c(
|
|
6065
6073
|
Xn,
|
|
@@ -6123,7 +6131,7 @@ function ar(e) {
|
|
|
6123
6131
|
return e ? "open" : "closed";
|
|
6124
6132
|
}
|
|
6125
6133
|
var gi = "DialogTitleWarning", [df, vi] = pa(gi, {
|
|
6126
|
-
contentName:
|
|
6134
|
+
contentName: qe,
|
|
6127
6135
|
titleName: ir,
|
|
6128
6136
|
docsSlug: "dialog"
|
|
6129
6137
|
}), Ru = ({ titleId: e }) => {
|
|
@@ -6332,7 +6340,7 @@ const ju = {
|
|
|
6332
6340
|
}
|
|
6333
6341
|
};
|
|
6334
6342
|
function uf({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
6335
|
-
const [r, o] =
|
|
6343
|
+
const [r, o] = Q(!1), [s, i] = Q(!1), [a, d] = Q(e), [u, f] = Q(!1), { toast: h } = Vu();
|
|
6336
6344
|
ue(() => {
|
|
6337
6345
|
const g = JSON.stringify(a) !== JSON.stringify(e);
|
|
6338
6346
|
f(g);
|
|
@@ -6464,9 +6472,9 @@ function uf({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
6464
6472
|
children: [
|
|
6465
6473
|
/* @__PURE__ */ c($n, { children: /* @__PURE__ */ c(Vr, {}) }),
|
|
6466
6474
|
/* @__PURE__ */ C(Fn, { children: [
|
|
6467
|
-
/* @__PURE__ */ c(
|
|
6468
|
-
/* @__PURE__ */ c(
|
|
6469
|
-
/* @__PURE__ */ c(
|
|
6475
|
+
/* @__PURE__ */ c(je, { value: "sidebar", children: "Sidebar Layout" }),
|
|
6476
|
+
/* @__PURE__ */ c(je, { value: "fullscreen", children: "Fullscreen" }),
|
|
6477
|
+
/* @__PURE__ */ c(je, { value: "tabs", children: "Tabbed Interface" })
|
|
6470
6478
|
] })
|
|
6471
6479
|
]
|
|
6472
6480
|
}
|
|
@@ -6485,9 +6493,9 @@ function uf({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
6485
6493
|
children: [
|
|
6486
6494
|
/* @__PURE__ */ c($n, { children: /* @__PURE__ */ c(Vr, {}) }),
|
|
6487
6495
|
/* @__PURE__ */ C(Fn, { children: [
|
|
6488
|
-
/* @__PURE__ */ c(
|
|
6489
|
-
/* @__PURE__ */ c(
|
|
6490
|
-
/* @__PURE__ */ c(
|
|
6496
|
+
/* @__PURE__ */ c(je, { value: "light", children: "Light" }),
|
|
6497
|
+
/* @__PURE__ */ c(je, { value: "dark", children: "Dark" }),
|
|
6498
|
+
/* @__PURE__ */ c(je, { value: "system", children: "System" })
|
|
6491
6499
|
] })
|
|
6492
6500
|
]
|
|
6493
6501
|
}
|