teodor-new-chat-ui 4.1.33 → 4.1.34
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 +536 -535
- package/dist/index.umd.js +22 -22
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -72,10 +72,10 @@ function pm() {
|
|
|
72
72
|
Se.unshift("Warning: " + N), Function.prototype.apply.call(console[b], console, Se);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
var R = !1, C = !1, T = !1,
|
|
75
|
+
var R = !1, C = !1, T = !1, E = !1, I = !1, A;
|
|
76
76
|
A = Symbol.for("react.module.reference");
|
|
77
77
|
function _(b) {
|
|
78
|
-
return !!(typeof b == "string" || typeof b == "function" || b === r || b === s || I || b === o || b === u || b === d ||
|
|
78
|
+
return !!(typeof b == "string" || typeof b == "function" || b === r || b === s || I || b === o || b === u || b === d || E || b === p || R || C || T || typeof b == "object" && b !== null && (b.$$typeof === h || b.$$typeof === f || b.$$typeof === i || b.$$typeof === a || b.$$typeof === l || // This needs to include all possible module reference object
|
|
79
79
|
// types supported by any Flight configuration anywhere since
|
|
80
80
|
// we don't know which Flight build this will end up being used
|
|
81
81
|
// with.
|
|
@@ -615,8 +615,8 @@ Check the top-level render call using <` + M + ">.");
|
|
|
615
615
|
function $n(b, N, M) {
|
|
616
616
|
return xt(b, N, M, !1);
|
|
617
617
|
}
|
|
618
|
-
var ar = $n,
|
|
619
|
-
Ar.Fragment = r, Ar.jsx = ar, Ar.jsxs =
|
|
618
|
+
var ar = $n, k = Vt;
|
|
619
|
+
Ar.Fragment = r, Ar.jsx = ar, Ar.jsxs = k;
|
|
620
620
|
}()), Ar;
|
|
621
621
|
}
|
|
622
622
|
process.env.NODE_ENV === "production" ? wi.exports = hm() : wi.exports = pm();
|
|
@@ -655,7 +655,7 @@ const xm = is("string"), Rt = is("function"), zc = is("number"), Qr = (e) => e !
|
|
|
655
655
|
let t;
|
|
656
656
|
return e && (typeof FormData == "function" && e instanceof FormData || Rt(e.append) && ((t = ss(e)) === "formdata" || // detect form-data instance
|
|
657
657
|
t === "object" && Rt(e.toString) && e.toString() === "[object FormData]"));
|
|
658
|
-
},
|
|
658
|
+
}, Em = Jt("URLSearchParams"), [km, Im, Nm, Am] = ["ReadableStream", "Request", "Response", "Headers"].map(Jt), _m = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
659
659
|
function eo(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
660
660
|
if (e === null || typeof e > "u")
|
|
661
661
|
return;
|
|
@@ -811,7 +811,7 @@ const Ym = (e) => {
|
|
|
811
811
|
isObject: Qr,
|
|
812
812
|
isPlainObject: yo,
|
|
813
813
|
isEmptyObject: wm,
|
|
814
|
-
isReadableStream:
|
|
814
|
+
isReadableStream: km,
|
|
815
815
|
isRequest: Im,
|
|
816
816
|
isResponse: Nm,
|
|
817
817
|
isHeaders: Am,
|
|
@@ -822,7 +822,7 @@ const Ym = (e) => {
|
|
|
822
822
|
isRegExp: Um,
|
|
823
823
|
isFunction: Rt,
|
|
824
824
|
isStream: Tm,
|
|
825
|
-
isURLSearchParams:
|
|
825
|
+
isURLSearchParams: Em,
|
|
826
826
|
isTypedArray: $m,
|
|
827
827
|
isFileList: Cm,
|
|
828
828
|
forEach: eo,
|
|
@@ -1295,7 +1295,7 @@ function yg(e, t) {
|
|
|
1295
1295
|
});
|
|
1296
1296
|
});
|
|
1297
1297
|
}
|
|
1298
|
-
let
|
|
1298
|
+
let Et = class {
|
|
1299
1299
|
constructor(t) {
|
|
1300
1300
|
t && this.set(t);
|
|
1301
1301
|
}
|
|
@@ -1421,8 +1421,8 @@ let kt = class {
|
|
|
1421
1421
|
return j.isArray(t) ? t.forEach(s) : s(t), this;
|
|
1422
1422
|
}
|
|
1423
1423
|
};
|
|
1424
|
-
|
|
1425
|
-
j.reduceDescriptors(
|
|
1424
|
+
Et.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
1425
|
+
j.reduceDescriptors(Et.prototype, ({ value: e }, t) => {
|
|
1426
1426
|
let n = t[0].toUpperCase() + t.slice(1);
|
|
1427
1427
|
return {
|
|
1428
1428
|
get: () => e,
|
|
@@ -1431,9 +1431,9 @@ j.reduceDescriptors(kt.prototype, ({ value: e }, t) => {
|
|
|
1431
1431
|
}
|
|
1432
1432
|
};
|
|
1433
1433
|
});
|
|
1434
|
-
j.freezeMethods(
|
|
1434
|
+
j.freezeMethods(Et);
|
|
1435
1435
|
function Hs(e, t) {
|
|
1436
|
-
const n = this || to, r = t || n, o =
|
|
1436
|
+
const n = this || to, r = t || n, o = Et.from(r.headers);
|
|
1437
1437
|
let s = r.data;
|
|
1438
1438
|
return j.forEach(e, function(a) {
|
|
1439
1439
|
s = a.call(n, s, o.normalize(), t ? t.status : void 0);
|
|
@@ -1519,7 +1519,7 @@ const Do = (e, t, n = 3) => {
|
|
|
1519
1519
|
}, ll = (e) => (...t) => j.asap(() => e(...t)), Rg = wt.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, wt.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
1520
1520
|
new URL(wt.origin),
|
|
1521
1521
|
wt.navigator && /(msie|trident)/i.test(wt.navigator.userAgent)
|
|
1522
|
-
) : () => !0,
|
|
1522
|
+
) : () => !0, Eg = wt.hasStandardBrowserEnv ? (
|
|
1523
1523
|
// Standard browser envs support document.cookie
|
|
1524
1524
|
{
|
|
1525
1525
|
write(e, t, n, r, o, s) {
|
|
@@ -1546,17 +1546,17 @@ const Do = (e, t, n = 3) => {
|
|
|
1546
1546
|
}
|
|
1547
1547
|
}
|
|
1548
1548
|
);
|
|
1549
|
-
function
|
|
1549
|
+
function kg(e) {
|
|
1550
1550
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
1551
1551
|
}
|
|
1552
1552
|
function Ig(e, t) {
|
|
1553
1553
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
1554
1554
|
}
|
|
1555
1555
|
function eu(e, t, n) {
|
|
1556
|
-
let r = !
|
|
1556
|
+
let r = !kg(t);
|
|
1557
1557
|
return e && (r || n == !1) ? Ig(e, t) : t;
|
|
1558
1558
|
}
|
|
1559
|
-
const cl = (e) => e instanceof
|
|
1559
|
+
const cl = (e) => e instanceof Et ? { ...e } : e;
|
|
1560
1560
|
function Vn(e, t) {
|
|
1561
1561
|
t = t || {};
|
|
1562
1562
|
const n = {};
|
|
@@ -1624,7 +1624,7 @@ function Vn(e, t) {
|
|
|
1624
1624
|
const tu = (e) => {
|
|
1625
1625
|
const t = Vn({}, e);
|
|
1626
1626
|
let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers: i, auth: a } = t;
|
|
1627
|
-
if (t.headers = i =
|
|
1627
|
+
if (t.headers = i = Et.from(i), t.url = Yc(eu(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
|
|
1628
1628
|
"Authorization",
|
|
1629
1629
|
"Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
|
|
1630
1630
|
), j.isFormData(n)) {
|
|
@@ -1638,7 +1638,7 @@ const tu = (e) => {
|
|
|
1638
1638
|
}
|
|
1639
1639
|
}
|
|
1640
1640
|
if (wt.hasStandardBrowserEnv && (r && j.isFunction(r) && (r = r(t)), r || r !== !1 && Rg(t.url))) {
|
|
1641
|
-
const l = o && s &&
|
|
1641
|
+
const l = o && s && Eg.read(s);
|
|
1642
1642
|
l && i.set(o, l);
|
|
1643
1643
|
}
|
|
1644
1644
|
return t;
|
|
@@ -1646,7 +1646,7 @@ const tu = (e) => {
|
|
|
1646
1646
|
return new Promise(function(n, r) {
|
|
1647
1647
|
const o = tu(e);
|
|
1648
1648
|
let s = o.data;
|
|
1649
|
-
const i =
|
|
1649
|
+
const i = Et.from(o.headers).normalize();
|
|
1650
1650
|
let { responseType: a, onUploadProgress: l, onDownloadProgress: u } = o, d, f, h, p, w;
|
|
1651
1651
|
function v() {
|
|
1652
1652
|
p && p(), w && w(), o.cancelToken && o.cancelToken.unsubscribe(d), o.signal && o.signal.removeEventListener("abort", d);
|
|
@@ -1656,7 +1656,7 @@ const tu = (e) => {
|
|
|
1656
1656
|
function x() {
|
|
1657
1657
|
if (!g)
|
|
1658
1658
|
return;
|
|
1659
|
-
const S =
|
|
1659
|
+
const S = Et.from(
|
|
1660
1660
|
"getAllResponseHeaders" in g && g.getAllResponseHeaders()
|
|
1661
1661
|
), C = {
|
|
1662
1662
|
data: !a || a === "text" || a === "json" ? g.responseText : g.response,
|
|
@@ -1666,10 +1666,10 @@ const tu = (e) => {
|
|
|
1666
1666
|
config: e,
|
|
1667
1667
|
request: g
|
|
1668
1668
|
};
|
|
1669
|
-
Qc(function(
|
|
1670
|
-
n(
|
|
1671
|
-
}, function(
|
|
1672
|
-
r(
|
|
1669
|
+
Qc(function(E) {
|
|
1670
|
+
n(E), v();
|
|
1671
|
+
}, function(E) {
|
|
1672
|
+
r(E), v();
|
|
1673
1673
|
}, C), g = null;
|
|
1674
1674
|
}
|
|
1675
1675
|
"onloadend" in g ? g.onloadend = x : g.onreadystatechange = function() {
|
|
@@ -1848,12 +1848,12 @@ const tu = (e) => {
|
|
|
1848
1848
|
timeout: R,
|
|
1849
1849
|
onDownloadProgress: C,
|
|
1850
1850
|
onUploadProgress: T,
|
|
1851
|
-
responseType:
|
|
1851
|
+
responseType: E,
|
|
1852
1852
|
headers: I,
|
|
1853
1853
|
withCredentials: A = "same-origin",
|
|
1854
1854
|
fetchOptions: _
|
|
1855
1855
|
} = tu(w), D = t || fetch;
|
|
1856
|
-
|
|
1856
|
+
E = E ? (E + "").toLowerCase() : "text";
|
|
1857
1857
|
let L = _g([y, S && S.toAbortSignal()], R), W = null;
|
|
1858
1858
|
const P = L && L.unsubscribe && (() => {
|
|
1859
1859
|
L.unsubscribe();
|
|
@@ -1886,7 +1886,7 @@ const tu = (e) => {
|
|
|
1886
1886
|
};
|
|
1887
1887
|
W = s && new n(v, J);
|
|
1888
1888
|
let z = await (s ? D(W, _) : D(v, J));
|
|
1889
|
-
const $ = d && (
|
|
1889
|
+
const $ = d && (E === "stream" || E === "response");
|
|
1890
1890
|
if (d && (C || $ && P)) {
|
|
1891
1891
|
const B = {};
|
|
1892
1892
|
["status", "statusText", "headers"].forEach((Ie) => {
|
|
@@ -1903,12 +1903,12 @@ const tu = (e) => {
|
|
|
1903
1903
|
B
|
|
1904
1904
|
);
|
|
1905
1905
|
}
|
|
1906
|
-
|
|
1907
|
-
let F = await f[j.findKey(f,
|
|
1906
|
+
E = E || "text";
|
|
1907
|
+
let F = await f[j.findKey(f, E) || "text"](z, w);
|
|
1908
1908
|
return !$ && P && P(), await new Promise((B, pe) => {
|
|
1909
1909
|
Qc(B, pe, {
|
|
1910
1910
|
data: F,
|
|
1911
|
-
headers:
|
|
1911
|
+
headers: Et.from(z.headers),
|
|
1912
1912
|
status: z.status,
|
|
1913
1913
|
statusText: z.statusText,
|
|
1914
1914
|
config: w,
|
|
@@ -1989,7 +1989,7 @@ function Us(e) {
|
|
|
1989
1989
|
throw new Cr(null, e);
|
|
1990
1990
|
}
|
|
1991
1991
|
function gl(e) {
|
|
1992
|
-
return Us(e), e.headers =
|
|
1992
|
+
return Us(e), e.headers = Et.from(e.headers), e.data = Hs.call(
|
|
1993
1993
|
e,
|
|
1994
1994
|
e.transformRequest
|
|
1995
1995
|
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), ru.getAdapter(e.adapter || to.adapter, e)(e).then(function(r) {
|
|
@@ -1997,13 +1997,13 @@ function gl(e) {
|
|
|
1997
1997
|
e,
|
|
1998
1998
|
e.transformResponse,
|
|
1999
1999
|
r
|
|
2000
|
-
), r.headers =
|
|
2000
|
+
), r.headers = Et.from(r.headers), r;
|
|
2001
2001
|
}, function(r) {
|
|
2002
2002
|
return Zc(r) || (Us(e), r && r.response && (r.response.data = Hs.call(
|
|
2003
2003
|
e,
|
|
2004
2004
|
e.transformResponse,
|
|
2005
2005
|
r.response
|
|
2006
|
-
), r.response.headers =
|
|
2006
|
+
), r.response.headers = Et.from(r.response.headers))), Promise.reject(r);
|
|
2007
2007
|
});
|
|
2008
2008
|
}
|
|
2009
2009
|
const ou = "1.12.2", ls = {};
|
|
@@ -2112,7 +2112,7 @@ let Un = class {
|
|
|
2112
2112
|
(w) => {
|
|
2113
2113
|
delete s[w];
|
|
2114
2114
|
}
|
|
2115
|
-
), n.headers =
|
|
2115
|
+
), n.headers = Et.concat(i, s);
|
|
2116
2116
|
const a = [];
|
|
2117
2117
|
let l = !0;
|
|
2118
2118
|
this.interceptors.request.forEach(function(v) {
|
|
@@ -2349,7 +2349,7 @@ ut.all = function(t) {
|
|
|
2349
2349
|
ut.spread = Bg;
|
|
2350
2350
|
ut.isAxiosError = Hg;
|
|
2351
2351
|
ut.mergeConfig = Vn;
|
|
2352
|
-
ut.AxiosHeaders =
|
|
2352
|
+
ut.AxiosHeaders = Et;
|
|
2353
2353
|
ut.formToJSON = (e) => Jc(j.isHTMLForm(e) ? new FormData(e) : e);
|
|
2354
2354
|
ut.getAdapter = ru.getAdapter;
|
|
2355
2355
|
ut.HttpStatusCode = Ti;
|
|
@@ -2845,19 +2845,20 @@ function ox(e, t) {
|
|
|
2845
2845
|
if (!s) continue;
|
|
2846
2846
|
if ((o == null ? void 0 : o.type) === "text") {
|
|
2847
2847
|
const i = o, a = i.text ?? "";
|
|
2848
|
-
if (!a) {
|
|
2848
|
+
if (console.debug("[MessageReducer] mergeParts", { incomingLength: s.length, previousLength: a.length, incomingSnippet: s.slice(0, 100), previousSnippet: a.slice(-100) }), !a) {
|
|
2849
2849
|
i.text = s;
|
|
2850
2850
|
continue;
|
|
2851
2851
|
}
|
|
2852
2852
|
if (s.startsWith(a)) {
|
|
2853
|
-
i.text = s;
|
|
2853
|
+
console.debug("[MessageReducer] incoming startsWith previous - replacing", { incomingLength: s.length, previousLength: a.length }), i.text = s;
|
|
2854
2854
|
continue;
|
|
2855
2855
|
}
|
|
2856
|
-
|
|
2857
|
-
|
|
2856
|
+
if (a.includes(s) && s.length <= 3) {
|
|
2857
|
+
console.debug("[MessageReducer] previous includes incoming - skipping trivial incoming", { incomingLength: s.length, previousLength: a.length });
|
|
2858
2858
|
continue;
|
|
2859
|
-
|
|
2860
|
-
|
|
2859
|
+
}
|
|
2860
|
+
const u = sx(a, s);
|
|
2861
|
+
u ? (console.debug("[MessageReducer] suffix computed", { suffixLength: u.length }), i.text = a + u) : (console.debug("[MessageReducer] no overlap detected - appending incoming", { incomingLength: s.length }), i.text = a + s);
|
|
2861
2862
|
} else
|
|
2862
2863
|
n.push({ type: "text", text: s });
|
|
2863
2864
|
} else
|
|
@@ -2890,7 +2891,7 @@ function ax(e) {
|
|
|
2890
2891
|
function lx(e = {}) {
|
|
2891
2892
|
const t = at(() => gn(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = xe(e.token ?? null), s = Ge(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = xe(!1), [u, d] = xe(null), [f, h] = xe(""), [p, w] = xe(null), [v, g] = xe(0), [x, y] = xe(!1), S = Ge(null), R = Ge(!0), C = Ge(0), T = Me((_) => {
|
|
2892
2893
|
o(_);
|
|
2893
|
-
}, []),
|
|
2894
|
+
}, []), E = Me(() => {
|
|
2894
2895
|
var _;
|
|
2895
2896
|
(_ = S.current) == null || _.abort(), S.current = null, l(!1), y(!1), C.current = 0, g(0);
|
|
2896
2897
|
}, []), I = Me(() => {
|
|
@@ -3064,7 +3065,7 @@ function lx(e = {}) {
|
|
|
3064
3065
|
lastSeq: v,
|
|
3065
3066
|
connected: x,
|
|
3066
3067
|
stream: A,
|
|
3067
|
-
stop:
|
|
3068
|
+
stop: E,
|
|
3068
3069
|
clear: I,
|
|
3069
3070
|
setToken: T
|
|
3070
3071
|
};
|
|
@@ -3143,7 +3144,7 @@ function dx({
|
|
|
3143
3144
|
[h, l, u, d, f]
|
|
3144
3145
|
);
|
|
3145
3146
|
}
|
|
3146
|
-
const cu = Jr(null), uu = Jr(null), du = Jr(null), fx = Jr(!1), hx = 20, px = "cachedThreads", mx = "v1", To = 300,
|
|
3147
|
+
const cu = Jr(null), uu = Jr(null), du = Jr(null), fx = Jr(!1), hx = 20, px = "cachedThreads", mx = "v1", To = 300, Ei = 200;
|
|
3147
3148
|
function Cl(e) {
|
|
3148
3149
|
if (typeof window < "u" && "requestIdleCallback" in window)
|
|
3149
3150
|
try {
|
|
@@ -3215,7 +3216,7 @@ function vx(e) {
|
|
|
3215
3216
|
return [];
|
|
3216
3217
|
}
|
|
3217
3218
|
}
|
|
3218
|
-
function
|
|
3219
|
+
function ki(e, t) {
|
|
3219
3220
|
try {
|
|
3220
3221
|
fu(e, JSON.stringify(t));
|
|
3221
3222
|
} catch {
|
|
@@ -3227,7 +3228,7 @@ function Tl(e) {
|
|
|
3227
3228
|
const n = gx();
|
|
3228
3229
|
if (n.length > 0)
|
|
3229
3230
|
try {
|
|
3230
|
-
|
|
3231
|
+
ki(e, n.slice(0, Ei));
|
|
3231
3232
|
} catch {
|
|
3232
3233
|
}
|
|
3233
3234
|
return n;
|
|
@@ -3257,9 +3258,9 @@ function wx({
|
|
|
3257
3258
|
} catch {
|
|
3258
3259
|
return "unknown";
|
|
3259
3260
|
}
|
|
3260
|
-
}, [u]), h = at(() => `threadPayload:${mx}:${f}:`, [f]), p = Me((
|
|
3261
|
-
if (!
|
|
3262
|
-
const b =
|
|
3261
|
+
}, [u]), h = at(() => `threadPayload:${mx}:${f}:`, [f]), p = Me((k) => `${h}${k}`, [h]), w = Me((k) => {
|
|
3262
|
+
if (!k || typeof k != "object") return null;
|
|
3263
|
+
const b = k;
|
|
3263
3264
|
return typeof b.threadId != "string" || !Array.isArray(b.messages) ? null : {
|
|
3264
3265
|
threadId: b.threadId,
|
|
3265
3266
|
messages: b.messages,
|
|
@@ -3268,8 +3269,8 @@ function wx({
|
|
|
3268
3269
|
checkpointId: b.checkpointId ?? null,
|
|
3269
3270
|
checkpointNs: b.checkpointNs ?? null
|
|
3270
3271
|
};
|
|
3271
|
-
}, []), v = Me((
|
|
3272
|
-
const b = na(p(
|
|
3272
|
+
}, []), v = Me((k) => {
|
|
3273
|
+
const b = na(p(k));
|
|
3273
3274
|
if (!b) return null;
|
|
3274
3275
|
try {
|
|
3275
3276
|
const N = JSON.parse(b);
|
|
@@ -3277,39 +3278,39 @@ function wx({
|
|
|
3277
3278
|
} catch {
|
|
3278
3279
|
return null;
|
|
3279
3280
|
}
|
|
3280
|
-
}, [p, w]), g = Me((
|
|
3281
|
+
}, [p, w]), g = Me((k, b = 100) => {
|
|
3281
3282
|
const N = {
|
|
3282
|
-
...
|
|
3283
|
-
messages: Array.isArray(
|
|
3283
|
+
...k,
|
|
3284
|
+
messages: Array.isArray(k.messages) ? k.messages.slice(-b) : []
|
|
3284
3285
|
};
|
|
3285
3286
|
try {
|
|
3286
|
-
fu(p(
|
|
3287
|
+
fu(p(k.threadId), JSON.stringify(N));
|
|
3287
3288
|
} catch {
|
|
3288
3289
|
}
|
|
3289
|
-
}, [p]), x = Me((
|
|
3290
|
-
qs(p(
|
|
3290
|
+
}, [p]), x = Me((k) => {
|
|
3291
|
+
qs(p(k));
|
|
3291
3292
|
}, [p]), y = Me(() => {
|
|
3292
3293
|
if (hr())
|
|
3293
3294
|
try {
|
|
3294
|
-
const
|
|
3295
|
+
const k = h;
|
|
3295
3296
|
for (let b = 0; b < window.localStorage.length; b++) {
|
|
3296
3297
|
const N = window.localStorage.key(b);
|
|
3297
|
-
N && N.startsWith(
|
|
3298
|
+
N && N.startsWith(k) && window.localStorage.removeItem(N);
|
|
3298
3299
|
}
|
|
3299
3300
|
} catch {
|
|
3300
3301
|
}
|
|
3301
3302
|
}, [h]), [S, R] = xe(
|
|
3302
3303
|
() => {
|
|
3303
|
-
var
|
|
3304
|
-
return Gs(f, (
|
|
3304
|
+
var k;
|
|
3305
|
+
return Gs(f, (k = l.getAuthToken) == null ? void 0 : k.call(l));
|
|
3305
3306
|
}
|
|
3306
3307
|
), [C, T] = xe(() => {
|
|
3307
3308
|
var b;
|
|
3308
|
-
const
|
|
3309
|
+
const k = Tl(
|
|
3309
3310
|
Gs(f, (b = l.getAuthToken) == null ? void 0 : b.call(l))
|
|
3310
3311
|
);
|
|
3311
|
-
return Ys(
|
|
3312
|
-
}),
|
|
3312
|
+
return Ys(k);
|
|
3313
|
+
}), E = at(() => Xs(C), [C]), [I, A] = xe(t), [_, D] = xe(!1), [L, W] = xe(!1), [P, Y] = xe(!1), [K, J] = xe(!1), [z, $] = xe(null), [F, B] = xe(void 0), [pe, ue] = xe(void 0), {
|
|
3313
3314
|
state: ee,
|
|
3314
3315
|
seed: Ie,
|
|
3315
3316
|
prepend: Ce,
|
|
@@ -3320,11 +3321,11 @@ function wx({
|
|
|
3320
3321
|
ct(() => {
|
|
3321
3322
|
q.current = I;
|
|
3322
3323
|
}, [I]);
|
|
3323
|
-
const ce = Ge(!1), ie = Ge([]), $e = Ge(null), Ke = Ge(null), We = Ge(/* @__PURE__ */ new Map()), Te = Ge(I), Pe = Ge(!1), et = Ge(null), Fe = Me((
|
|
3324
|
+
const ce = Ge(!1), ie = Ge([]), $e = Ge(null), Ke = Ge(null), We = Ge(/* @__PURE__ */ new Map()), Te = Ge(I), Pe = Ge(!1), et = Ge(null), Fe = Me((k, b) => new Promise((N, M) => {
|
|
3324
3325
|
const H = async () => {
|
|
3325
3326
|
ce.current = !0;
|
|
3326
3327
|
try {
|
|
3327
|
-
await
|
|
3328
|
+
await k(), N();
|
|
3328
3329
|
} catch (X) {
|
|
3329
3330
|
M(X);
|
|
3330
3331
|
} finally {
|
|
@@ -3337,13 +3338,13 @@ function wx({
|
|
|
3337
3338
|
ce.current ? ie.current.push(H) : H().catch((X) => {
|
|
3338
3339
|
M(X);
|
|
3339
3340
|
});
|
|
3340
|
-
}), []), it = Ge(
|
|
3341
|
+
}), []), it = Ge(E.length), [ft, ne] = xe(!1), ae = Ge(!1);
|
|
3341
3342
|
ct(() => {
|
|
3342
|
-
it.current =
|
|
3343
|
-
}, [
|
|
3343
|
+
it.current = E.length;
|
|
3344
|
+
}, [E.length]);
|
|
3344
3345
|
const de = Me(async () => {
|
|
3345
|
-
const
|
|
3346
|
-
|
|
3346
|
+
const k = it.current > 0;
|
|
3347
|
+
k || D(!0);
|
|
3347
3348
|
try {
|
|
3348
3349
|
const b = await l.listThreads();
|
|
3349
3350
|
zs(() => {
|
|
@@ -3355,14 +3356,14 @@ function wx({
|
|
|
3355
3356
|
} catch (b) {
|
|
3356
3357
|
i == null || i(String(b)), console.error("[ChatSessionProvider] Failed to refresh threads:", b);
|
|
3357
3358
|
} finally {
|
|
3358
|
-
|
|
3359
|
+
k || D(!1);
|
|
3359
3360
|
}
|
|
3360
3361
|
}, [l, i]), Ne = Ge(!1), he = Ge(null), me = Ge(null), He = Ge(""), Oe = Me(
|
|
3361
|
-
(
|
|
3362
|
+
(k, b) => {
|
|
3362
3363
|
if (!hr()) return;
|
|
3363
3364
|
me.current !== null && (window.clearTimeout(me.current), me.current = null);
|
|
3364
|
-
const N =
|
|
3365
|
-
if (
|
|
3365
|
+
const N = k.map((H) => `${H.threadId}:${H.updatedAt ?? ""}:${H.messageCount ?? ""}`).join("|");
|
|
3366
|
+
if (k.length === 0) {
|
|
3366
3367
|
try {
|
|
3367
3368
|
qs(S);
|
|
3368
3369
|
} catch {
|
|
@@ -3374,8 +3375,8 @@ function wx({
|
|
|
3374
3375
|
return;
|
|
3375
3376
|
const M = () => {
|
|
3376
3377
|
try {
|
|
3377
|
-
const H =
|
|
3378
|
-
|
|
3378
|
+
const H = k.slice(0, Ei);
|
|
3379
|
+
ki(S, H), He.current = N;
|
|
3379
3380
|
} catch {
|
|
3380
3381
|
} finally {
|
|
3381
3382
|
me.current = null;
|
|
@@ -3391,23 +3392,23 @@ function wx({
|
|
|
3391
3392
|
},
|
|
3392
3393
|
[S]
|
|
3393
3394
|
), ot = Me(
|
|
3394
|
-
(
|
|
3395
|
-
const M = Array.isArray(
|
|
3395
|
+
(k, b, N) => {
|
|
3396
|
+
const M = Array.isArray(k == null ? void 0 : k.messages) ? k.messages : [], H = N ?? (k == null ? void 0 : k.threadId) ?? q.current;
|
|
3396
3397
|
if (b === "replace") {
|
|
3397
3398
|
if (H) {
|
|
3398
3399
|
const X = {
|
|
3399
3400
|
threadId: H,
|
|
3400
3401
|
messages: M.slice(),
|
|
3401
|
-
hasMore: !!(
|
|
3402
|
-
nextCursor: (
|
|
3403
|
-
checkpointId: (
|
|
3404
|
-
checkpointNs: (
|
|
3402
|
+
hasMore: !!(k != null && k.hasMore),
|
|
3403
|
+
nextCursor: (k == null ? void 0 : k.nextCursor) ?? null,
|
|
3404
|
+
checkpointId: (k == null ? void 0 : k.checkpointId) ?? null,
|
|
3405
|
+
checkpointNs: (k == null ? void 0 : k.checkpointNs) ?? null
|
|
3405
3406
|
};
|
|
3406
3407
|
We.current.set(H, X), Te.current = H;
|
|
3407
3408
|
}
|
|
3408
3409
|
Ie(M, {
|
|
3409
|
-
checkpointId: (
|
|
3410
|
-
checkpointNs: (
|
|
3410
|
+
checkpointId: (k == null ? void 0 : k.checkpointId) ?? null,
|
|
3411
|
+
checkpointNs: (k == null ? void 0 : k.checkpointNs) ?? null
|
|
3411
3412
|
});
|
|
3412
3413
|
} else if (b === "prepend" && M.length && H) {
|
|
3413
3414
|
const X = We.current.get(H), Se = (X == null ? void 0 : X.messages) ?? [], we = /* @__PURE__ */ new Set(), ge = [...M, ...Se].filter((Je) => {
|
|
@@ -3416,49 +3417,49 @@ function wx({
|
|
|
3416
3417
|
}), qe = {
|
|
3417
3418
|
threadId: H,
|
|
3418
3419
|
messages: ge,
|
|
3419
|
-
hasMore: (
|
|
3420
|
-
nextCursor: (
|
|
3421
|
-
checkpointId: (X == null ? void 0 : X.checkpointId) ?? (
|
|
3422
|
-
checkpointNs: (X == null ? void 0 : X.checkpointNs) ?? (
|
|
3420
|
+
hasMore: (k == null ? void 0 : k.hasMore) ?? (X == null ? void 0 : X.hasMore) ?? !1,
|
|
3421
|
+
nextCursor: (k == null ? void 0 : k.nextCursor) ?? (X == null ? void 0 : X.nextCursor) ?? null,
|
|
3422
|
+
checkpointId: (X == null ? void 0 : X.checkpointId) ?? (k == null ? void 0 : k.checkpointId) ?? null,
|
|
3423
|
+
checkpointNs: (X == null ? void 0 : X.checkpointNs) ?? (k == null ? void 0 : k.checkpointNs) ?? null
|
|
3423
3424
|
};
|
|
3424
3425
|
We.current.set(H, qe), Ce(M);
|
|
3425
3426
|
} else b === "prepend" && M.length && Ce(M);
|
|
3426
|
-
b === "replace" ? ($((
|
|
3427
|
+
b === "replace" ? ($((k == null ? void 0 : k.nextCursor) ?? null), Y(!!(k != null && k.hasMore)), B((k == null ? void 0 : k.checkpointId) ?? void 0), ue((k == null ? void 0 : k.checkpointNs) ?? void 0)) : ($((X) => (k == null ? void 0 : k.nextCursor) ?? X ?? null), Y((X) => (k == null ? void 0 : k.hasMore) !== void 0 ? !!(k != null && k.hasMore) : X), B((X) => (k == null ? void 0 : k.checkpointId) ?? X ?? void 0), ue((X) => (k == null ? void 0 : k.checkpointNs) ?? X ?? void 0));
|
|
3427
3428
|
},
|
|
3428
3429
|
[Ce, Ie]
|
|
3429
3430
|
), gt = Me(
|
|
3430
|
-
(
|
|
3431
|
-
Ie(
|
|
3432
|
-
checkpointId:
|
|
3433
|
-
checkpointNs:
|
|
3434
|
-
}), $(
|
|
3431
|
+
(k) => {
|
|
3432
|
+
Ie(k.messages, {
|
|
3433
|
+
checkpointId: k.checkpointId,
|
|
3434
|
+
checkpointNs: k.checkpointNs
|
|
3435
|
+
}), $(k.nextCursor), Y(k.hasMore), B(k.checkpointId ?? void 0), ue(k.checkpointNs ?? void 0), Te.current = k.threadId;
|
|
3435
3436
|
},
|
|
3436
3437
|
[Ie]
|
|
3437
|
-
), It = Me((
|
|
3438
|
-
|
|
3438
|
+
), It = Me((k) => {
|
|
3439
|
+
k && (We.current.delete(k), x(k), Te.current === k && (Te.current = null));
|
|
3439
3440
|
}, [x]), Qt = Me(() => {
|
|
3440
|
-
const
|
|
3441
|
-
|
|
3442
|
-
}, [It, Q]), On = Me(({ from:
|
|
3441
|
+
const k = q.current;
|
|
3442
|
+
k && It(k), Q([]), Y(!1), J(!1), $(null), B(void 0), ue(void 0);
|
|
3443
|
+
}, [It, Q]), On = Me(({ from: k, to: b }) => {
|
|
3443
3444
|
const N = q.current;
|
|
3444
3445
|
N && console.warn(
|
|
3445
|
-
`[ChatSessionProvider] Stream sequence gap detected (${
|
|
3446
|
+
`[ChatSessionProvider] Stream sequence gap detected (${k} -> ${b}) for thread ${N}`
|
|
3446
3447
|
);
|
|
3447
3448
|
}, []), or = Me(
|
|
3448
|
-
(
|
|
3449
|
-
const b =
|
|
3449
|
+
(k) => {
|
|
3450
|
+
const b = k.threadId;
|
|
3450
3451
|
console.log("[ChatSessionProvider] 📥 Handling thread_info event:", {
|
|
3451
3452
|
threadId: b,
|
|
3452
|
-
title:
|
|
3453
|
-
created:
|
|
3454
|
-
currentThreads:
|
|
3453
|
+
title: k.title,
|
|
3454
|
+
created: k.created,
|
|
3455
|
+
currentThreads: E.length
|
|
3455
3456
|
});
|
|
3456
3457
|
const N = {
|
|
3457
3458
|
threadId: b,
|
|
3458
|
-
title:
|
|
3459
|
-
createdAt:
|
|
3460
|
-
updatedAt:
|
|
3461
|
-
messageCount:
|
|
3459
|
+
title: k.title || `Thread ${b.slice(0, 8)}`,
|
|
3460
|
+
createdAt: k.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
3461
|
+
updatedAt: k.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
3462
|
+
messageCount: k.messageCount || 0
|
|
3462
3463
|
};
|
|
3463
3464
|
q.current !== b && (!q.current && ee.messages.length <= 1 && (Ke.current = b), A(b)), zs(() => {
|
|
3464
3465
|
T((M) => {
|
|
@@ -3478,8 +3479,8 @@ function wx({
|
|
|
3478
3479
|
baseUrl: d,
|
|
3479
3480
|
onThreadInfo: or,
|
|
3480
3481
|
onMessageEvent: O,
|
|
3481
|
-
onUnhandledEvent: (
|
|
3482
|
-
console.warn(`[ChatSessionProvider] Unhandled stream event: ${
|
|
3482
|
+
onUnhandledEvent: (k) => {
|
|
3483
|
+
console.warn(`[ChatSessionProvider] Unhandled stream event: ${k.type}`, k);
|
|
3483
3484
|
},
|
|
3484
3485
|
onSequenceGap: On
|
|
3485
3486
|
});
|
|
@@ -3488,8 +3489,8 @@ function wx({
|
|
|
3488
3489
|
}, [en]), ct(() => {
|
|
3489
3490
|
if (!hr()) return;
|
|
3490
3491
|
me.current !== null && (window.clearTimeout(me.current), me.current = null);
|
|
3491
|
-
const
|
|
3492
|
-
if (
|
|
3492
|
+
const k = E.map((N) => `${N.threadId}:${N.updatedAt ?? ""}:${N.messageCount ?? ""}`).join("|");
|
|
3493
|
+
if (E.length === 0) {
|
|
3493
3494
|
try {
|
|
3494
3495
|
qs(S);
|
|
3495
3496
|
} catch {
|
|
@@ -3497,12 +3498,12 @@ function wx({
|
|
|
3497
3498
|
He.current = "";
|
|
3498
3499
|
return;
|
|
3499
3500
|
}
|
|
3500
|
-
if (
|
|
3501
|
+
if (k === He.current)
|
|
3501
3502
|
return;
|
|
3502
3503
|
const b = () => {
|
|
3503
3504
|
try {
|
|
3504
|
-
const N =
|
|
3505
|
-
|
|
3505
|
+
const N = E.slice(0, Ei);
|
|
3506
|
+
ki(S, N), He.current = k;
|
|
3506
3507
|
} catch {
|
|
3507
3508
|
} finally {
|
|
3508
3509
|
me.current = null;
|
|
@@ -3513,10 +3514,10 @@ function wx({
|
|
|
3513
3514
|
}, To), () => {
|
|
3514
3515
|
me.current !== null && (window.clearTimeout(me.current), me.current = null);
|
|
3515
3516
|
};
|
|
3516
|
-
}, [
|
|
3517
|
+
}, [E, Oe]), ct(() => {
|
|
3517
3518
|
var M;
|
|
3518
|
-
const
|
|
3519
|
-
Mt(
|
|
3519
|
+
const k = l.getAuthToken();
|
|
3520
|
+
Mt(k);
|
|
3520
3521
|
const b = (H) => {
|
|
3521
3522
|
const X = Gs(f, H);
|
|
3522
3523
|
et.current !== X && (et.current = X, Pe.current = !1), R(X);
|
|
@@ -3526,7 +3527,7 @@ function wx({
|
|
|
3526
3527
|
}), Pe.current || (Pe.current = !0, de().catch(() => {
|
|
3527
3528
|
}));
|
|
3528
3529
|
};
|
|
3529
|
-
b(
|
|
3530
|
+
b(k);
|
|
3530
3531
|
const N = (M = l.onTokenChange) == null ? void 0 : M.call(l, (H) => {
|
|
3531
3532
|
Mt(H), y(), b(H);
|
|
3532
3533
|
});
|
|
@@ -3535,10 +3536,10 @@ function wx({
|
|
|
3535
3536
|
};
|
|
3536
3537
|
}, [l, f, Mt, y, de]);
|
|
3537
3538
|
const bn = Me(
|
|
3538
|
-
async (
|
|
3539
|
+
async (k) => {
|
|
3539
3540
|
const b = `temp-${Date.now()}`, N = {
|
|
3540
3541
|
threadId: b,
|
|
3541
|
-
title:
|
|
3542
|
+
title: k || "New Chat",
|
|
3542
3543
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3543
3544
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3544
3545
|
messageCount: 0
|
|
@@ -3548,7 +3549,7 @@ function wx({
|
|
|
3548
3549
|
order: [b, ...M.order]
|
|
3549
3550
|
})), A(b);
|
|
3550
3551
|
try {
|
|
3551
|
-
const M = await l.createThread(
|
|
3552
|
+
const M = await l.createThread(k), H = typeof M == "string" ? M : M.threadId;
|
|
3552
3553
|
return T((X) => {
|
|
3553
3554
|
const Se = X.byId[b];
|
|
3554
3555
|
if (!Se) return X;
|
|
@@ -3569,25 +3570,25 @@ function wx({
|
|
|
3569
3570
|
},
|
|
3570
3571
|
[l, de]
|
|
3571
3572
|
), yn = Me(
|
|
3572
|
-
async (
|
|
3573
|
-
await l.deleteThread(
|
|
3573
|
+
async (k) => {
|
|
3574
|
+
await l.deleteThread(k);
|
|
3574
3575
|
let b = null;
|
|
3575
3576
|
T((N) => {
|
|
3576
|
-
if (!N.byId[
|
|
3577
|
+
if (!N.byId[k]) return N;
|
|
3577
3578
|
const M = { ...N.byId };
|
|
3578
|
-
delete M[
|
|
3579
|
-
const H = N.order.filter((Se) => Se !==
|
|
3579
|
+
delete M[k];
|
|
3580
|
+
const H = N.order.filter((Se) => Se !== k), X = { byId: M, order: H };
|
|
3580
3581
|
return b = Xs(X), X;
|
|
3581
|
-
}), b && Oe(b, { immediate: !0 }), It(
|
|
3582
|
+
}), b && Oe(b, { immediate: !0 }), It(k), q.current === k && (Ke.current = k, A(null), q.current = null, Te.current = null, Qt()), await de();
|
|
3582
3583
|
},
|
|
3583
3584
|
[l, Qt, It, de, Oe]
|
|
3584
3585
|
), Dn = Me(
|
|
3585
|
-
async (
|
|
3586
|
+
async (k, b) => {
|
|
3586
3587
|
try {
|
|
3587
|
-
await l.updateThread(
|
|
3588
|
-
const M = N.byId[
|
|
3588
|
+
await l.updateThread(k, b), T((N) => {
|
|
3589
|
+
const M = N.byId[k];
|
|
3589
3590
|
return M ? {
|
|
3590
|
-
byId: { ...N.byId, [
|
|
3591
|
+
byId: { ...N.byId, [k]: { ...M, title: b } },
|
|
3591
3592
|
order: N.order
|
|
3592
3593
|
} : N;
|
|
3593
3594
|
});
|
|
@@ -3597,35 +3598,35 @@ function wx({
|
|
|
3597
3598
|
},
|
|
3598
3599
|
[l, de]
|
|
3599
3600
|
), Dt = Me(
|
|
3600
|
-
async (
|
|
3601
|
+
async (k, b, N, M = !1) => {
|
|
3601
3602
|
await Fe(async () => {
|
|
3602
|
-
if (Ke.current ===
|
|
3603
|
+
if (Ke.current === k && !M) {
|
|
3603
3604
|
Ke.current = null;
|
|
3604
3605
|
return;
|
|
3605
3606
|
}
|
|
3606
|
-
if ($e.current ===
|
|
3607
|
+
if ($e.current === k && !M)
|
|
3607
3608
|
return;
|
|
3608
|
-
A((ge) => ge ===
|
|
3609
|
+
A((ge) => ge === k ? ge : k), q.current = k;
|
|
3609
3610
|
const H = !M && !b && !N;
|
|
3610
3611
|
let X = !1;
|
|
3611
3612
|
if (H) {
|
|
3612
|
-
const ge = We.current.get(
|
|
3613
|
+
const ge = We.current.get(k);
|
|
3613
3614
|
if (ge)
|
|
3614
3615
|
gt(ge), X = !0;
|
|
3615
3616
|
else {
|
|
3616
|
-
const qe = v(
|
|
3617
|
-
qe && (We.current.set(
|
|
3617
|
+
const qe = v(k);
|
|
3618
|
+
qe && (We.current.set(k, qe), gt(qe), X = !0);
|
|
3618
3619
|
}
|
|
3619
3620
|
}
|
|
3620
3621
|
const Se = M || !X || !!b || !!N, we = async (ge) => {
|
|
3621
|
-
ge && W(!0), $e.current =
|
|
3622
|
+
ge && W(!0), $e.current = k;
|
|
3622
3623
|
try {
|
|
3623
3624
|
const qe = await l.getMessages({
|
|
3624
|
-
threadId:
|
|
3625
|
+
threadId: k,
|
|
3625
3626
|
checkpointId: b,
|
|
3626
3627
|
checkpointNs: N
|
|
3627
3628
|
});
|
|
3628
|
-
ot(qe, "replace",
|
|
3629
|
+
ot(qe, "replace", k);
|
|
3629
3630
|
} catch (qe) {
|
|
3630
3631
|
throw (!X || M || ge) && (i == null || i(String(qe))), qe;
|
|
3631
3632
|
} finally {
|
|
@@ -3635,13 +3636,13 @@ function wx({
|
|
|
3635
3636
|
Se ? await we(!0) : H && X && we(!1).catch((ge) => {
|
|
3636
3637
|
console.warn("[ChatSessionProvider] Background refresh failed:", ge);
|
|
3637
3638
|
});
|
|
3638
|
-
}, `loadThread-${
|
|
3639
|
+
}, `loadThread-${k}`);
|
|
3639
3640
|
},
|
|
3640
3641
|
[l, gt, ot, Fe, i]
|
|
3641
3642
|
), Ln = Me(async () => {
|
|
3642
3643
|
await Fe(async () => {
|
|
3643
|
-
const
|
|
3644
|
-
|
|
3644
|
+
const k = q.current;
|
|
3645
|
+
k && It(k), Ke.current = null, A(null), q.current = null, Te.current = null, Qt(), B(void 0), ue(void 0);
|
|
3645
3646
|
try {
|
|
3646
3647
|
localStorage.removeItem("lastThreadId");
|
|
3647
3648
|
} catch (b) {
|
|
@@ -3649,22 +3650,22 @@ function wx({
|
|
|
3649
3650
|
}
|
|
3650
3651
|
}, "clearCurrentThread");
|
|
3651
3652
|
}, [Qt, It, Fe]), ir = Me(
|
|
3652
|
-
async (
|
|
3653
|
-
const b = await l.listCheckpoints(
|
|
3654
|
-
return Yg(b,
|
|
3653
|
+
async (k) => {
|
|
3654
|
+
const b = await l.listCheckpoints(k);
|
|
3655
|
+
return Yg(b, k);
|
|
3655
3656
|
},
|
|
3656
3657
|
[l]
|
|
3657
3658
|
), re = Me(
|
|
3658
|
-
async (
|
|
3659
|
+
async (k, b) => {
|
|
3659
3660
|
if (!q.current) throw new Error("No active thread");
|
|
3660
|
-
await Dt(q.current,
|
|
3661
|
+
await Dt(q.current, k, b ?? void 0, !0);
|
|
3661
3662
|
},
|
|
3662
3663
|
[Dt]
|
|
3663
3664
|
), ve = Me(async () => {
|
|
3664
3665
|
if (!q.current) throw new Error("No active thread");
|
|
3665
3666
|
await Dt(q.current, void 0, void 0, !0);
|
|
3666
3667
|
}, [Dt]), Le = Me(
|
|
3667
|
-
async (
|
|
3668
|
+
async (k) => {
|
|
3668
3669
|
if (!q.current) throw new Error("No active thread");
|
|
3669
3670
|
if (K || !P) return;
|
|
3670
3671
|
const b = z;
|
|
@@ -3675,7 +3676,7 @@ function wx({
|
|
|
3675
3676
|
threadId: N,
|
|
3676
3677
|
checkpointId: F,
|
|
3677
3678
|
checkpointNs: pe,
|
|
3678
|
-
limit: (
|
|
3679
|
+
limit: (k == null ? void 0 : k.limit) ?? hx,
|
|
3679
3680
|
beforeId: b
|
|
3680
3681
|
});
|
|
3681
3682
|
ot(M, "prepend", N ?? void 0);
|
|
@@ -3694,7 +3695,7 @@ function wx({
|
|
|
3694
3695
|
K
|
|
3695
3696
|
]
|
|
3696
3697
|
), Xe = Me(
|
|
3697
|
-
async (
|
|
3698
|
+
async (k, b) => {
|
|
3698
3699
|
var St;
|
|
3699
3700
|
const N = q.current;
|
|
3700
3701
|
!N && !(b != null && b.payloadExtras) && console.warn("[ChatSessionProvider] No thread ID - message will create new thread");
|
|
@@ -3702,7 +3703,7 @@ function wx({
|
|
|
3702
3703
|
l,
|
|
3703
3704
|
M
|
|
3704
3705
|
), Se = [...H];
|
|
3705
|
-
|
|
3706
|
+
k && k.trim() && Se.push({ type: "text", text: k.trim() });
|
|
3706
3707
|
const we = {
|
|
3707
3708
|
id: ((St = crypto.randomUUID) == null ? void 0 : St.call(crypto)) || `user-${Date.now()}`,
|
|
3708
3709
|
role: "user",
|
|
@@ -3747,7 +3748,7 @@ function wx({
|
|
|
3747
3748
|
wn
|
|
3748
3749
|
]
|
|
3749
3750
|
), xt = Me(
|
|
3750
|
-
async (
|
|
3751
|
+
async (k, b, N) => {
|
|
3751
3752
|
const M = q.current;
|
|
3752
3753
|
if (!M)
|
|
3753
3754
|
throw new Error("No active thread to handle interrupt");
|
|
@@ -3755,7 +3756,7 @@ function wx({
|
|
|
3755
3756
|
const H = b ? N ?? !0 : !1;
|
|
3756
3757
|
await l.resume({ threadId: M, value: H });
|
|
3757
3758
|
} catch (H) {
|
|
3758
|
-
throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${
|
|
3759
|
+
throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${k}:`, H), H;
|
|
3759
3760
|
}
|
|
3760
3761
|
},
|
|
3761
3762
|
[l]
|
|
@@ -3764,8 +3765,8 @@ function wx({
|
|
|
3764
3765
|
if (a == null || a(I), I)
|
|
3765
3766
|
try {
|
|
3766
3767
|
localStorage.setItem("lastThreadId", I);
|
|
3767
|
-
} catch (
|
|
3768
|
-
console.warn("[ChatSessionProvider] Failed to persist lastThreadId:",
|
|
3768
|
+
} catch (k) {
|
|
3769
|
+
console.warn("[ChatSessionProvider] Failed to persist lastThreadId:", k);
|
|
3769
3770
|
}
|
|
3770
3771
|
}, [I, a]), ct(() => ((async () => {
|
|
3771
3772
|
try {
|
|
@@ -3784,20 +3785,20 @@ function wx({
|
|
|
3784
3785
|
}
|
|
3785
3786
|
})(), () => {
|
|
3786
3787
|
}), []), ct(() => {
|
|
3787
|
-
const
|
|
3788
|
-
if (!
|
|
3788
|
+
const k = q.current;
|
|
3789
|
+
if (!k || Te.current !== k) return;
|
|
3789
3790
|
const b = {
|
|
3790
|
-
threadId:
|
|
3791
|
+
threadId: k,
|
|
3791
3792
|
messages: ee.messages.slice(),
|
|
3792
3793
|
hasMore: P,
|
|
3793
3794
|
nextCursor: z,
|
|
3794
3795
|
checkpointId: ee.lastCheckpointId ?? null,
|
|
3795
3796
|
checkpointNs: ee.lastCheckpointNs ?? null
|
|
3796
|
-
}, N = We.current.get(
|
|
3797
|
+
}, N = We.current.get(k);
|
|
3797
3798
|
(!N || N.messages.length !== b.messages.length || N.messages.some((H, X) => {
|
|
3798
3799
|
var Se;
|
|
3799
3800
|
return (H == null ? void 0 : H.id) !== ((Se = b.messages[X]) == null ? void 0 : Se.id);
|
|
3800
|
-
}) || (N == null ? void 0 : N.hasMore) !== b.hasMore || (N == null ? void 0 : N.nextCursor) !== b.nextCursor || (N == null ? void 0 : N.checkpointId) !== b.checkpointId || (N == null ? void 0 : N.checkpointNs) !== b.checkpointNs) && (We.current.set(
|
|
3801
|
+
}) || (N == null ? void 0 : N.hasMore) !== b.hasMore || (N == null ? void 0 : N.nextCursor) !== b.nextCursor || (N == null ? void 0 : N.checkpointId) !== b.checkpointId || (N == null ? void 0 : N.checkpointNs) !== b.checkpointNs) && (We.current.set(k, b), he.current && window.clearTimeout(he.current), he.current = window.setTimeout(() => {
|
|
3801
3802
|
try {
|
|
3802
3803
|
g(b, 100);
|
|
3803
3804
|
} catch (H) {
|
|
@@ -3813,7 +3814,7 @@ function wx({
|
|
|
3813
3814
|
]);
|
|
3814
3815
|
const Vt = at(
|
|
3815
3816
|
() => ({
|
|
3816
|
-
threads:
|
|
3817
|
+
threads: E,
|
|
3817
3818
|
currentThreadId: I,
|
|
3818
3819
|
isLoadingThreads: _,
|
|
3819
3820
|
isLoadingThread: L,
|
|
@@ -3841,7 +3842,7 @@ function wx({
|
|
|
3841
3842
|
de,
|
|
3842
3843
|
Dn,
|
|
3843
3844
|
ve,
|
|
3844
|
-
|
|
3845
|
+
E
|
|
3845
3846
|
]
|
|
3846
3847
|
), $n = at(
|
|
3847
3848
|
() => ({
|
|
@@ -4031,7 +4032,7 @@ function Sx({
|
|
|
4031
4032
|
I.key === "Enter" && !I.shiftKey ? (I.preventDefault(), y()) : I.key === "Escape" && t && (I.preventDefault(), a == null || a());
|
|
4032
4033
|
},
|
|
4033
4034
|
[y, t, a]
|
|
4034
|
-
),
|
|
4035
|
+
), E = `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${t ? "border-[hsl(var(--ring))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] dark:bg-[hsl(var(--card))] dark:text-[hsl(var(--card-foreground))]" : ""} ${d}`;
|
|
4035
4036
|
return /* @__PURE__ */ c.jsx("form", { onSubmit: (I) => void y(I), className: `w-full ${u}`, children: /* @__PURE__ */ c.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
4036
4037
|
/* @__PURE__ */ c.jsx("div", { className: "flex-1", children: /* @__PURE__ */ c.jsx(
|
|
4037
4038
|
pu,
|
|
@@ -4041,7 +4042,7 @@ function Sx({
|
|
|
4041
4042
|
onChange: S,
|
|
4042
4043
|
onKeyDown: R,
|
|
4043
4044
|
placeholder: t ? "Edit your message..." : n,
|
|
4044
|
-
className:
|
|
4045
|
+
className: E,
|
|
4045
4046
|
disabled: o,
|
|
4046
4047
|
maxLength: s,
|
|
4047
4048
|
rows: 1,
|
|
@@ -4086,7 +4087,7 @@ function Tx(e) {
|
|
|
4086
4087
|
function gu(e, t) {
|
|
4087
4088
|
return (n) => e(t(n));
|
|
4088
4089
|
}
|
|
4089
|
-
function
|
|
4090
|
+
function El(e, t) {
|
|
4090
4091
|
return () => e(t);
|
|
4091
4092
|
}
|
|
4092
4093
|
function Rx(e, t) {
|
|
@@ -4095,7 +4096,7 @@ function Rx(e, t) {
|
|
|
4095
4096
|
function oa(e) {
|
|
4096
4097
|
return e !== void 0;
|
|
4097
4098
|
}
|
|
4098
|
-
function
|
|
4099
|
+
function Ex(...e) {
|
|
4099
4100
|
return () => {
|
|
4100
4101
|
e.map(Tx);
|
|
4101
4102
|
};
|
|
@@ -4105,7 +4106,7 @@ function Rr() {
|
|
|
4105
4106
|
function us(e, t) {
|
|
4106
4107
|
return t(e), e;
|
|
4107
4108
|
}
|
|
4108
|
-
function
|
|
4109
|
+
function kx(e, t) {
|
|
4109
4110
|
return t(e);
|
|
4110
4111
|
}
|
|
4111
4112
|
function rt(...e) {
|
|
@@ -4132,7 +4133,7 @@ function qt(e, t) {
|
|
|
4132
4133
|
});
|
|
4133
4134
|
return n;
|
|
4134
4135
|
}
|
|
4135
|
-
function
|
|
4136
|
+
function kl(e) {
|
|
4136
4137
|
let t, n;
|
|
4137
4138
|
return (r) => (o) => {
|
|
4138
4139
|
t = o, n && clearTimeout(n), n = setTimeout(() => {
|
|
@@ -4149,7 +4150,7 @@ function nt(e = xu) {
|
|
|
4149
4150
|
e(t, r) || (t = r, n(r));
|
|
4150
4151
|
};
|
|
4151
4152
|
}
|
|
4152
|
-
function
|
|
4153
|
+
function Ee(e) {
|
|
4153
4154
|
return (t) => (n) => {
|
|
4154
4155
|
e(n) && t(n);
|
|
4155
4156
|
};
|
|
@@ -4210,7 +4211,7 @@ function De(...e) {
|
|
|
4210
4211
|
};
|
|
4211
4212
|
}
|
|
4212
4213
|
function Ix(...e) {
|
|
4213
|
-
return (t) => e.reduceRight(
|
|
4214
|
+
return (t) => e.reduceRight(kx, t);
|
|
4214
4215
|
}
|
|
4215
4216
|
function Nx(e) {
|
|
4216
4217
|
let t, n;
|
|
@@ -4316,11 +4317,11 @@ function Ii(...e) {
|
|
|
4316
4317
|
case Tr:
|
|
4317
4318
|
return;
|
|
4318
4319
|
case Nn:
|
|
4319
|
-
return
|
|
4320
|
+
return Ex(...e.map((r) => Ye(r, n)));
|
|
4320
4321
|
}
|
|
4321
4322
|
};
|
|
4322
4323
|
}
|
|
4323
|
-
var
|
|
4324
|
+
var kt = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e))(kt || {});
|
|
4324
4325
|
const jx = {
|
|
4325
4326
|
0: "debug",
|
|
4326
4327
|
3: "error",
|
|
@@ -4401,7 +4402,7 @@ function Mx(e, t, n, r) {
|
|
|
4401
4402
|
if (a.dataset.index === void 0)
|
|
4402
4403
|
continue;
|
|
4403
4404
|
const l = parseInt(a.dataset.index), u = parseFloat(a.dataset.knownSize), d = t(a, n);
|
|
4404
|
-
if (d === 0 && r("Zero-sized element, this should not happen", { child: a },
|
|
4405
|
+
if (d === 0 && r("Zero-sized element, this should not happen", { child: a }, kt.ERROR), d === u)
|
|
4405
4406
|
continue;
|
|
4406
4407
|
const f = s[s.length - 1];
|
|
4407
4408
|
s.length === 0 || f.size !== d || f.endIndex !== l - 1 ? s.push({ endIndex: l, size: d, startIndex: l }) : s[s.length - 1].endIndex++;
|
|
@@ -4409,7 +4410,7 @@ function Mx(e, t, n, r) {
|
|
|
4409
4410
|
return s;
|
|
4410
4411
|
}
|
|
4411
4412
|
function Il(e, t, n) {
|
|
4412
|
-
return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t,
|
|
4413
|
+
return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, kt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
|
|
4413
4414
|
}
|
|
4414
4415
|
function vu(e, t, n) {
|
|
4415
4416
|
const r = V.useRef(null), o = V.useCallback(
|
|
@@ -4715,7 +4716,7 @@ function Wr(e, t, n) {
|
|
|
4715
4716
|
const { index: r, offset: o, size: s } = Ru(t, e, la), i = e - r, a = s * i + (i - 1) * n + o;
|
|
4716
4717
|
return a > 0 ? a + n : a;
|
|
4717
4718
|
}
|
|
4718
|
-
function
|
|
4719
|
+
function Eu(e, t) {
|
|
4719
4720
|
if (!fs(t))
|
|
4720
4721
|
return e;
|
|
4721
4722
|
let n = 0;
|
|
@@ -4723,12 +4724,12 @@ function ku(e, t) {
|
|
|
4723
4724
|
n++;
|
|
4724
4725
|
return e + n;
|
|
4725
4726
|
}
|
|
4726
|
-
function
|
|
4727
|
+
function ku(e, t, n) {
|
|
4727
4728
|
if (zx(e))
|
|
4728
4729
|
return t.groupIndices[e.groupIndex] + 1;
|
|
4729
4730
|
{
|
|
4730
4731
|
const r = e.index === "LAST" ? n : e.index;
|
|
4731
|
-
let o =
|
|
4732
|
+
let o = Eu(r, t);
|
|
4732
4733
|
return o = Math.max(0, o, Math.min(n, o)), o;
|
|
4733
4734
|
}
|
|
4734
4735
|
}
|
|
@@ -4736,7 +4737,7 @@ function Hx(e, t, n, r = 0) {
|
|
|
4736
4737
|
return r > 0 && (t = Math.max(t, Ru(e, r, la).offset)), wu(Lx(e, t, n, Bx), Vx);
|
|
4737
4738
|
}
|
|
4738
4739
|
function Ux(e, [t, n, r, o]) {
|
|
4739
|
-
t.length > 0 && r("received item sizes", t,
|
|
4740
|
+
t.length > 0 && r("received item sizes", t, kt.DEBUG);
|
|
4740
4741
|
const s = e.sizeTree;
|
|
4741
4742
|
let i = s, a = 0;
|
|
4742
4743
|
if (n.length > 0 && Ze(s) && t.length === 2) {
|
|
@@ -4822,10 +4823,10 @@ const qx = {
|
|
|
4822
4823
|
fe(
|
|
4823
4824
|
U(
|
|
4824
4825
|
l,
|
|
4825
|
-
|
|
4826
|
+
Ee((C) => C.length > 0),
|
|
4826
4827
|
De(v, p),
|
|
4827
|
-
oe(([C, T,
|
|
4828
|
-
const I = C.reduce((A, _, D) => _t(A, _, Wr(_, T.offsetTree,
|
|
4828
|
+
oe(([C, T, E]) => {
|
|
4829
|
+
const I = C.reduce((A, _, D) => _t(A, _, Wr(_, T.offsetTree, E) || D), pr());
|
|
4829
4830
|
return {
|
|
4830
4831
|
...T,
|
|
4831
4832
|
groupIndices: C,
|
|
@@ -4838,11 +4839,11 @@ const qx = {
|
|
|
4838
4839
|
U(
|
|
4839
4840
|
r,
|
|
4840
4841
|
De(v),
|
|
4841
|
-
|
|
4842
|
-
oe(([C, { lastIndex: T, lastSize:
|
|
4842
|
+
Ee(([C, { lastIndex: T }]) => C < T),
|
|
4843
|
+
oe(([C, { lastIndex: T, lastSize: E }]) => [
|
|
4843
4844
|
{
|
|
4844
4845
|
endIndex: T,
|
|
4845
|
-
size:
|
|
4846
|
+
size: E,
|
|
4846
4847
|
startIndex: C
|
|
4847
4848
|
}
|
|
4848
4849
|
])
|
|
@@ -4859,7 +4860,7 @@ const qx = {
|
|
|
4859
4860
|
fe(
|
|
4860
4861
|
U(
|
|
4861
4862
|
d,
|
|
4862
|
-
|
|
4863
|
+
Ee((C) => C !== void 0 && Ze(lt(v).sizeTree)),
|
|
4863
4864
|
oe((C) => [{ endIndex: 0, size: C, startIndex: 0 }])
|
|
4864
4865
|
),
|
|
4865
4866
|
n
|
|
@@ -4869,9 +4870,9 @@ const qx = {
|
|
|
4869
4870
|
n,
|
|
4870
4871
|
De(v),
|
|
4871
4872
|
sn(
|
|
4872
|
-
({ sizes: C }, [T,
|
|
4873
|
-
changed:
|
|
4874
|
-
sizes:
|
|
4873
|
+
({ sizes: C }, [T, E]) => ({
|
|
4874
|
+
changed: E !== C,
|
|
4875
|
+
sizes: E
|
|
4875
4876
|
}),
|
|
4876
4877
|
{ changed: !1, sizes: w }
|
|
4877
4878
|
),
|
|
@@ -4892,15 +4893,15 @@ const qx = {
|
|
|
4892
4893
|
if (C > 0)
|
|
4893
4894
|
je(t, !0), je(s, C + Al(C, T));
|
|
4894
4895
|
else if (C < 0) {
|
|
4895
|
-
const
|
|
4896
|
-
|
|
4896
|
+
const E = lt(g);
|
|
4897
|
+
E.length > 0 && (C -= Al(-C, E)), je(i, C);
|
|
4897
4898
|
}
|
|
4898
4899
|
}
|
|
4899
4900
|
), Ye(U(a, De(e)), ([C, T]) => {
|
|
4900
4901
|
C < 0 && T(
|
|
4901
4902
|
"`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
|
|
4902
4903
|
{ firstItemIndex: a },
|
|
4903
|
-
|
|
4904
|
+
kt.ERROR
|
|
4904
4905
|
);
|
|
4905
4906
|
});
|
|
4906
4907
|
const S = jt(s);
|
|
@@ -4909,8 +4910,8 @@ const qx = {
|
|
|
4909
4910
|
s,
|
|
4910
4911
|
De(v),
|
|
4911
4912
|
oe(([C, T]) => {
|
|
4912
|
-
const
|
|
4913
|
-
if (
|
|
4913
|
+
const E = T.groupIndices.length > 0, I = [], A = T.lastSize;
|
|
4914
|
+
if (E) {
|
|
4914
4915
|
const _ = Hr(T.sizeTree, 0);
|
|
4915
4916
|
let D = 0, L = 0;
|
|
4916
4917
|
for (; D < C; ) {
|
|
@@ -4969,9 +4970,9 @@ const qx = {
|
|
|
4969
4970
|
U(
|
|
4970
4971
|
i,
|
|
4971
4972
|
De(v, p),
|
|
4972
|
-
oe(([C, { offsetTree: T },
|
|
4973
|
+
oe(([C, { offsetTree: T }, E]) => {
|
|
4973
4974
|
const I = -C;
|
|
4974
|
-
return Wr(I, T,
|
|
4975
|
+
return Wr(I, T, E);
|
|
4975
4976
|
})
|
|
4976
4977
|
)
|
|
4977
4978
|
);
|
|
@@ -4979,7 +4980,7 @@ const qx = {
|
|
|
4979
4980
|
U(
|
|
4980
4981
|
i,
|
|
4981
4982
|
De(v, p),
|
|
4982
|
-
oe(([C, T,
|
|
4983
|
+
oe(([C, T, E]) => {
|
|
4983
4984
|
if (T.groupIndices.length > 0) {
|
|
4984
4985
|
if (Ze(T.sizeTree))
|
|
4985
4986
|
return T;
|
|
@@ -5000,14 +5001,14 @@ const qx = {
|
|
|
5000
5001
|
return {
|
|
5001
5002
|
...T,
|
|
5002
5003
|
sizeTree: I,
|
|
5003
|
-
...ji(T.offsetTree, 0, I,
|
|
5004
|
+
...ji(T.offsetTree, 0, I, E)
|
|
5004
5005
|
};
|
|
5005
5006
|
} else {
|
|
5006
5007
|
const I = Hn(T.sizeTree).reduce((A, { k: _, v: D }) => _t(A, Math.max(0, _ + C), D), pr());
|
|
5007
5008
|
return {
|
|
5008
5009
|
...T,
|
|
5009
5010
|
sizeTree: I,
|
|
5010
|
-
...ji(T.offsetTree, 0, I,
|
|
5011
|
+
...ji(T.offsetTree, 0, I, E)
|
|
5011
5012
|
};
|
|
5012
5013
|
}
|
|
5013
5014
|
})
|
|
@@ -5065,7 +5066,7 @@ const Iu = Ve(
|
|
|
5065
5066
|
), fe(
|
|
5066
5067
|
U(
|
|
5067
5068
|
dt(o, t, r),
|
|
5068
|
-
|
|
5069
|
+
Ee(([l, u]) => fs(u)),
|
|
5069
5070
|
oe(([l, u, d]) => Gt(u.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
|
|
5070
5071
|
nt(),
|
|
5071
5072
|
oe((l) => [l])
|
|
@@ -5079,12 +5080,12 @@ const Iu = Ve(
|
|
|
5079
5080
|
const t = Z(!1), n = jt(
|
|
5080
5081
|
U(
|
|
5081
5082
|
t,
|
|
5082
|
-
|
|
5083
|
+
Ee((r) => r),
|
|
5083
5084
|
nt()
|
|
5084
5085
|
)
|
|
5085
5086
|
);
|
|
5086
5087
|
return Ye(t, (r) => {
|
|
5087
|
-
r && lt(e)("props updated", {},
|
|
5088
|
+
r && lt(e)("props updated", {}, kt.DEBUG);
|
|
5088
5089
|
}), { didMount: n, propsReady: t };
|
|
5089
5090
|
},
|
|
5090
5091
|
rt(An),
|
|
@@ -5121,16 +5122,16 @@ const no = Ve(
|
|
|
5121
5122
|
De(e, s, o),
|
|
5122
5123
|
oe(
|
|
5123
5124
|
([
|
|
5124
|
-
[R, C, T,
|
|
5125
|
+
[R, C, T, E, I, A, _, D],
|
|
5125
5126
|
L,
|
|
5126
5127
|
W,
|
|
5127
5128
|
P
|
|
5128
5129
|
]) => {
|
|
5129
|
-
const Y = Nu(R), { align: K, behavior: J, offset: z } = Y, $ =
|
|
5130
|
+
const Y = Nu(R), { align: K, behavior: J, offset: z } = Y, $ = E - 1, F = ku(Y, C, $);
|
|
5130
5131
|
let B = Wr(F, C.offsetTree, L) + A;
|
|
5131
5132
|
K === "end" ? (B += W + Gt(C.sizeTree, F)[1] - T + P, F === $ && (B += _)) : K === "center" ? B += (W + Gt(C.sizeTree, F)[1] - T + P) / 2 : B -= I, z && (B += z);
|
|
5132
5133
|
const pe = (ue) => {
|
|
5133
|
-
S(), ue ? (D("retrying to scroll to", { location: R },
|
|
5134
|
+
S(), ue ? (D("retrying to scroll to", { location: R }, kt.DEBUG), je(p, R)) : (je(w, !0), D("list did not change, scroll successful", {}, kt.DEBUG));
|
|
5134
5135
|
};
|
|
5135
5136
|
if (S(), J === "smooth") {
|
|
5136
5137
|
let ue = !1;
|
|
@@ -5143,7 +5144,7 @@ const no = Ve(
|
|
|
5143
5144
|
g = qt(U(t, Xx(150)), pe);
|
|
5144
5145
|
return x = setTimeout(() => {
|
|
5145
5146
|
S();
|
|
5146
|
-
}, 1200), je(l, !0), D("scrolling from index to", { behavior: J, index: F, top: B },
|
|
5147
|
+
}, 1200), je(l, !0), D("scrolling from index to", { behavior: J, index: F, top: B }, kt.DEBUG), { behavior: J, top: B };
|
|
5147
5148
|
}
|
|
5148
5149
|
)
|
|
5149
5150
|
),
|
|
@@ -5183,7 +5184,7 @@ const ro = Ve(
|
|
|
5183
5184
|
U(
|
|
5184
5185
|
i,
|
|
5185
5186
|
De(l),
|
|
5186
|
-
|
|
5187
|
+
Ee(([d, f]) => !!f),
|
|
5187
5188
|
rn(!1)
|
|
5188
5189
|
),
|
|
5189
5190
|
a
|
|
@@ -5191,7 +5192,7 @@ const ro = Ve(
|
|
|
5191
5192
|
U(
|
|
5192
5193
|
i,
|
|
5193
5194
|
De(l),
|
|
5194
|
-
|
|
5195
|
+
Ee(([d, f]) => !!f),
|
|
5195
5196
|
rn(!1)
|
|
5196
5197
|
),
|
|
5197
5198
|
u
|
|
@@ -5199,7 +5200,7 @@ const ro = Ve(
|
|
|
5199
5200
|
U(
|
|
5200
5201
|
dt(t, i),
|
|
5201
5202
|
De(a, n, e, u),
|
|
5202
|
-
|
|
5203
|
+
Ee(([[, d], f, { sizeTree: h }, p, w]) => d && (!Ze(h) || oa(p)) && !f && !w),
|
|
5203
5204
|
De(l)
|
|
5204
5205
|
),
|
|
5205
5206
|
([, d]) => {
|
|
@@ -5235,12 +5236,12 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
|
|
|
5235
5236
|
}, Qx = 0, oo = Ve(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
|
|
5236
5237
|
const i = Z(!1), a = Z(!0), l = Be(), u = Be(), d = Z(4), f = Z(Qx), h = yt(
|
|
5237
5238
|
U(
|
|
5238
|
-
Ii(U(Re(o), qn(1), rn(!0)), U(Re(o), qn(1), rn(!1),
|
|
5239
|
+
Ii(U(Re(o), qn(1), rn(!0)), U(Re(o), qn(1), rn(!1), kl(100))),
|
|
5239
5240
|
nt()
|
|
5240
5241
|
),
|
|
5241
5242
|
!1
|
|
5242
5243
|
), p = yt(
|
|
5243
|
-
U(Ii(U(n, rn(!0)), U(n, rn(!1),
|
|
5244
|
+
U(Ii(U(n, rn(!0)), U(n, rn(!1), kl(200))), nt()),
|
|
5244
5245
|
!1
|
|
5245
5246
|
);
|
|
5246
5247
|
fe(
|
|
@@ -5254,7 +5255,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
|
|
|
5254
5255
|
const w = jt(
|
|
5255
5256
|
U(
|
|
5256
5257
|
dt(r, Re(s), Re(t), Re(e), Re(d)),
|
|
5257
|
-
sn((y, [{ scrollHeight: S, scrollTop: R }, C, T,
|
|
5258
|
+
sn((y, [{ scrollHeight: S, scrollTop: R }, C, T, E, I]) => {
|
|
5258
5259
|
const A = R + C - S > -I, _ = {
|
|
5259
5260
|
scrollHeight: S,
|
|
5260
5261
|
scrollTop: R,
|
|
@@ -5307,7 +5308,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
|
|
|
5307
5308
|
},
|
|
5308
5309
|
{ changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
|
|
5309
5310
|
),
|
|
5310
|
-
|
|
5311
|
+
Ee((y) => y.changed),
|
|
5311
5312
|
oe((y) => y.jump)
|
|
5312
5313
|
),
|
|
5313
5314
|
0
|
|
@@ -5337,7 +5338,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
|
|
|
5337
5338
|
return fe(
|
|
5338
5339
|
U(
|
|
5339
5340
|
h,
|
|
5340
|
-
|
|
5341
|
+
Ee((y) => !y),
|
|
5341
5342
|
rn(0)
|
|
5342
5343
|
),
|
|
5343
5344
|
x
|
|
@@ -5346,7 +5347,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
|
|
|
5346
5347
|
o,
|
|
5347
5348
|
mn(100),
|
|
5348
5349
|
De(h),
|
|
5349
|
-
|
|
5350
|
+
Ee(([y, S]) => !!S),
|
|
5350
5351
|
sn(([y, S], [R]) => [S, R], [0, 0]),
|
|
5351
5352
|
oe(([y, S]) => S - y)
|
|
5352
5353
|
),
|
|
@@ -5400,15 +5401,15 @@ const da = Ve(
|
|
|
5400
5401
|
S
|
|
5401
5402
|
]) => {
|
|
5402
5403
|
const R = d - y, C = g + x, T = Math.max(h - R, 0);
|
|
5403
|
-
let
|
|
5404
|
+
let E = _l;
|
|
5404
5405
|
const I = Pl(S, Fo), A = Pl(S, zo);
|
|
5405
|
-
return p -= y, p += h + x, w += h + x, w -= y, p > d + C - I && (
|
|
5406
|
-
Math.max(R - h - jl(v, Fo,
|
|
5407
|
-
R - T - x + f + jl(v, zo,
|
|
5406
|
+
return p -= y, p += h + x, w += h + x, w -= y, p > d + C - I && (E = Vr), w < d - T + f + A && (E = Mr), E !== _l ? [
|
|
5407
|
+
Math.max(R - h - jl(v, Fo, E) - I, 0),
|
|
5408
|
+
R - T - x + f + jl(v, zo, E) + A
|
|
5408
5409
|
] : null;
|
|
5409
5410
|
}
|
|
5410
5411
|
),
|
|
5411
|
-
|
|
5412
|
+
Ee((d) => d != null),
|
|
5412
5413
|
nt(Ur)
|
|
5413
5414
|
),
|
|
5414
5415
|
[0, 0]
|
|
@@ -5428,7 +5429,7 @@ const da = Ve(
|
|
|
5428
5429
|
);
|
|
5429
5430
|
function ev(e, t, n) {
|
|
5430
5431
|
if (fs(t)) {
|
|
5431
|
-
const r =
|
|
5432
|
+
const r = Eu(e, t);
|
|
5432
5433
|
return [
|
|
5433
5434
|
{ index: Gt(t.groupOffsetTree, r)[0], offset: 0, size: 0 },
|
|
5434
5435
|
{ data: n == null ? void 0 : n[0], index: r, offset: 0, size: 0 }
|
|
@@ -5447,7 +5448,7 @@ const Qs = {
|
|
|
5447
5448
|
topListHeight: 0,
|
|
5448
5449
|
totalCount: 0
|
|
5449
5450
|
};
|
|
5450
|
-
function
|
|
5451
|
+
function Eo(e, t, n, r, o, s) {
|
|
5451
5452
|
const { lastIndex: i, lastOffset: a, lastSize: l } = o;
|
|
5452
5453
|
let u = 0, d = 0;
|
|
5453
5454
|
if (e.length > 0) {
|
|
@@ -5482,7 +5483,7 @@ function _u(e, t, n, r, o, s) {
|
|
|
5482
5483
|
offset: 0,
|
|
5483
5484
|
size: 0
|
|
5484
5485
|
}));
|
|
5485
|
-
return
|
|
5486
|
+
return Eo(u, [], a, o, n, r);
|
|
5486
5487
|
}
|
|
5487
5488
|
function Ol(e, t, n) {
|
|
5488
5489
|
if (e.length === 0)
|
|
@@ -5538,15 +5539,15 @@ const er = Ve(
|
|
|
5538
5539
|
Re(n),
|
|
5539
5540
|
e
|
|
5540
5541
|
),
|
|
5541
|
-
|
|
5542
|
+
Ee(([T, E, , I, , , , , , , A]) => {
|
|
5542
5543
|
const _ = A && A.length !== I;
|
|
5543
|
-
return T && !
|
|
5544
|
+
return T && !E && !_;
|
|
5544
5545
|
}),
|
|
5545
5546
|
oe(
|
|
5546
5547
|
([
|
|
5547
5548
|
,
|
|
5548
5549
|
,
|
|
5549
|
-
[T,
|
|
5550
|
+
[T, E],
|
|
5550
5551
|
I,
|
|
5551
5552
|
A,
|
|
5552
5553
|
_,
|
|
@@ -5559,10 +5560,10 @@ const er = Ve(
|
|
|
5559
5560
|
const K = A, { offsetTree: J, sizeTree: z } = K, $ = lt(g);
|
|
5560
5561
|
if (I === 0)
|
|
5561
5562
|
return { ...Qs, totalCount: I };
|
|
5562
|
-
if (T === 0 &&
|
|
5563
|
+
if (T === 0 && E === 0)
|
|
5563
5564
|
return $ === 0 ? { ...Qs, totalCount: I } : _u($, _, A, W, P, Y || []);
|
|
5564
5565
|
if (Ze(z))
|
|
5565
|
-
return $ > 0 ? null :
|
|
5566
|
+
return $ > 0 ? null : Eo(
|
|
5566
5567
|
ev(ua(_, I), K, Y),
|
|
5567
5568
|
[],
|
|
5568
5569
|
I,
|
|
@@ -5581,8 +5582,8 @@ const er = Ve(
|
|
|
5581
5582
|
}
|
|
5582
5583
|
}
|
|
5583
5584
|
if (!D)
|
|
5584
|
-
return
|
|
5585
|
-
const B = L.length > 0 ? L[L.length - 1] + 1 : 0, pe = Hx(J, T,
|
|
5585
|
+
return Eo([], F, I, P, K, W);
|
|
5586
|
+
const B = L.length > 0 ? L[L.length - 1] + 1 : 0, pe = Hx(J, T, E, B);
|
|
5586
5587
|
if (pe.length === 0)
|
|
5587
5588
|
return null;
|
|
5588
5589
|
const ue = I - 1, ee = us([], (Ie) => {
|
|
@@ -5597,15 +5598,15 @@ const er = Ve(
|
|
|
5597
5598
|
}
|
|
5598
5599
|
Q < B && (O += (B - Q) * q, Q = B);
|
|
5599
5600
|
const ce = Math.min(Ce.end, ue);
|
|
5600
|
-
for (let ie = Q; ie <= ce && !(O >=
|
|
5601
|
+
for (let ie = Q; ie <= ce && !(O >= E); ie++)
|
|
5601
5602
|
Ie.push({ data: Y == null ? void 0 : Y[ie], index: ie, offset: O, size: q }), O += q + P;
|
|
5602
5603
|
}
|
|
5603
5604
|
});
|
|
5604
|
-
return
|
|
5605
|
+
return Eo(ee, F, I, P, K, W);
|
|
5605
5606
|
}
|
|
5606
5607
|
),
|
|
5607
5608
|
//@ts-expect-error filter needs to be fixed
|
|
5608
|
-
|
|
5609
|
+
Ee((T) => T !== null),
|
|
5609
5610
|
nt()
|
|
5610
5611
|
),
|
|
5611
5612
|
Qs
|
|
@@ -5613,7 +5614,7 @@ const er = Ve(
|
|
|
5613
5614
|
fe(
|
|
5614
5615
|
U(
|
|
5615
5616
|
e,
|
|
5616
|
-
|
|
5617
|
+
Ee(oa),
|
|
5617
5618
|
oe((T) => T == null ? void 0 : T.length)
|
|
5618
5619
|
),
|
|
5619
5620
|
o
|
|
@@ -5639,10 +5640,10 @@ const er = Ve(
|
|
|
5639
5640
|
const S = jt(
|
|
5640
5641
|
U(
|
|
5641
5642
|
y,
|
|
5642
|
-
|
|
5643
|
+
Ee(({ items: T }) => T.length > 0),
|
|
5643
5644
|
De(o, e),
|
|
5644
|
-
|
|
5645
|
-
oe(([, T,
|
|
5645
|
+
Ee(([{ items: T }, E]) => T[T.length - 1].originalIndex === E - 1),
|
|
5646
|
+
oe(([, T, E]) => [T - 1, E]),
|
|
5646
5647
|
nt(Ur),
|
|
5647
5648
|
oe(([T]) => T)
|
|
5648
5649
|
)
|
|
@@ -5650,23 +5651,23 @@ const er = Ve(
|
|
|
5650
5651
|
U(
|
|
5651
5652
|
y,
|
|
5652
5653
|
mn(200),
|
|
5653
|
-
|
|
5654
|
+
Ee(({ items: T, topItems: E }) => T.length > 0 && T[0].originalIndex === E.length),
|
|
5654
5655
|
oe(({ items: T }) => T[0].index),
|
|
5655
5656
|
nt()
|
|
5656
5657
|
)
|
|
5657
5658
|
), C = jt(
|
|
5658
5659
|
U(
|
|
5659
5660
|
y,
|
|
5660
|
-
|
|
5661
|
+
Ee(({ items: T }) => T.length > 0),
|
|
5661
5662
|
oe(({ items: T }) => {
|
|
5662
|
-
let
|
|
5663
|
-
for (; T[
|
|
5664
|
-
|
|
5665
|
-
for (; T[I].type === "group" && I >
|
|
5663
|
+
let E = 0, I = T.length - 1;
|
|
5664
|
+
for (; T[E].type === "group" && E < I; )
|
|
5665
|
+
E++;
|
|
5666
|
+
for (; T[I].type === "group" && I > E; )
|
|
5666
5667
|
I--;
|
|
5667
5668
|
return {
|
|
5668
5669
|
endIndex: T[I].index,
|
|
5669
|
-
startIndex: T[
|
|
5670
|
+
startIndex: T[E].index
|
|
5670
5671
|
};
|
|
5671
5672
|
}),
|
|
5672
5673
|
nt(Tu)
|
|
@@ -5703,7 +5704,7 @@ const er = Ve(
|
|
|
5703
5704
|
const n = Z(!1), r = yt(
|
|
5704
5705
|
U(
|
|
5705
5706
|
dt(n, e, t),
|
|
5706
|
-
|
|
5707
|
+
Ee(([o]) => o),
|
|
5707
5708
|
oe(([, o, s]) => Math.max(0, o - s)),
|
|
5708
5709
|
mn(0),
|
|
5709
5710
|
nt()
|
|
@@ -5735,25 +5736,25 @@ const er = Ve(
|
|
|
5735
5736
|
De(t, l, n, s, o, r, a),
|
|
5736
5737
|
De(e),
|
|
5737
5738
|
oe(([[f, h, p, w, v, g, x, y], S]) => {
|
|
5738
|
-
const { align: R, behavior: C, calculateViewLocation: T = nv, done:
|
|
5739
|
+
const { align: R, behavior: C, calculateViewLocation: T = nv, done: E, ...I } = f, A = ku(f, h, w - 1), _ = Wr(A, h.offsetTree, S) + v + g, D = _ + Gt(h.sizeTree, A)[1], L = y + g, W = y + p - x, P = T({
|
|
5739
5740
|
itemBottom: D,
|
|
5740
5741
|
itemTop: _,
|
|
5741
5742
|
locationParams: { align: R, behavior: C, ...I },
|
|
5742
5743
|
viewportBottom: W,
|
|
5743
5744
|
viewportTop: L
|
|
5744
5745
|
});
|
|
5745
|
-
return P ?
|
|
5746
|
+
return P ? E && qt(
|
|
5746
5747
|
U(
|
|
5747
5748
|
i,
|
|
5748
|
-
|
|
5749
|
+
Ee((Y) => !Y),
|
|
5749
5750
|
// skips the initial publish of false, and the cleanup call.
|
|
5750
5751
|
// but if scrollingInProgress is true, we skip the initial publish.
|
|
5751
5752
|
qn(lt(i) ? 1 : 2)
|
|
5752
5753
|
),
|
|
5753
|
-
|
|
5754
|
-
) :
|
|
5754
|
+
E
|
|
5755
|
+
) : E && E(), P;
|
|
5755
5756
|
}),
|
|
5756
|
-
|
|
5757
|
+
Ee((f) => f !== null)
|
|
5757
5758
|
),
|
|
5758
5759
|
u
|
|
5759
5760
|
), {
|
|
@@ -5791,35 +5792,35 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
|
|
|
5791
5792
|
U(
|
|
5792
5793
|
dt(U(Re(t), qn(1)), l),
|
|
5793
5794
|
De(Re(w), s, a, f),
|
|
5794
|
-
oe(([[C, T],
|
|
5795
|
+
oe(([[C, T], E, I, A, _]) => {
|
|
5795
5796
|
let D = T && A, L = "auto";
|
|
5796
|
-
return D && (L = rv(
|
|
5797
|
+
return D && (L = rv(E, I || _), D = D && !!L), { followOutputBehavior: L, shouldFollow: D, totalCount: C };
|
|
5797
5798
|
}),
|
|
5798
|
-
|
|
5799
|
+
Ee(({ shouldFollow: C }) => C)
|
|
5799
5800
|
),
|
|
5800
5801
|
({ followOutputBehavior: C, totalCount: T }) => {
|
|
5801
5802
|
g && (g(), g = null), lt(n) ? requestAnimationFrame(() => {
|
|
5802
|
-
lt(d)("following output to ", { totalCount: T },
|
|
5803
|
+
lt(d)("following output to ", { totalCount: T }, kt.DEBUG), x(C);
|
|
5803
5804
|
}) : g = qt(e, () => {
|
|
5804
|
-
lt(d)("following output to ", { totalCount: T },
|
|
5805
|
+
lt(d)("following output to ", { totalCount: T }, kt.DEBUG), x(C), g = null;
|
|
5805
5806
|
});
|
|
5806
5807
|
}
|
|
5807
5808
|
);
|
|
5808
5809
|
function y(C) {
|
|
5809
|
-
const T = qt(o, (
|
|
5810
|
-
C && !
|
|
5810
|
+
const T = qt(o, (E) => {
|
|
5811
|
+
C && !E.atBottom && E.notAtBottomBecause === "SIZE_INCREASED" && !g && (lt(d)("scrolling to bottom due to increased size", {}, kt.DEBUG), x("auto"));
|
|
5811
5812
|
});
|
|
5812
5813
|
setTimeout(T, 100);
|
|
5813
5814
|
}
|
|
5814
5815
|
Ye(
|
|
5815
5816
|
U(
|
|
5816
5817
|
dt(Re(w), t, u),
|
|
5817
|
-
|
|
5818
|
+
Ee(([C, , T]) => C && T),
|
|
5818
5819
|
sn(
|
|
5819
5820
|
({ value: C }, [, T]) => ({ refreshed: C === T, value: T }),
|
|
5820
5821
|
{ refreshed: !1, value: 0 }
|
|
5821
5822
|
),
|
|
5822
|
-
|
|
5823
|
+
Ee(({ refreshed: C }) => C),
|
|
5823
5824
|
De(w, t)
|
|
5824
5825
|
),
|
|
5825
5826
|
([, C]) => {
|
|
@@ -5847,8 +5848,8 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
|
|
|
5847
5848
|
U(
|
|
5848
5849
|
dt(U(R, qn(1)), l),
|
|
5849
5850
|
De(Re(S), a, f, h),
|
|
5850
|
-
oe(([[C, T],
|
|
5851
|
-
|
|
5851
|
+
oe(([[C, T], E, I, A, _]) => T && I && (E == null ? void 0 : E({ context: _, totalCount: C, scrollingInProgress: A }))),
|
|
5852
|
+
Ee((C) => !!C),
|
|
5852
5853
|
mn(0)
|
|
5853
5854
|
),
|
|
5854
5855
|
(C) => {
|
|
@@ -5876,7 +5877,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
|
|
|
5876
5877
|
U(
|
|
5877
5878
|
a,
|
|
5878
5879
|
De(s),
|
|
5879
|
-
|
|
5880
|
+
Ee(([, l]) => l !== 0),
|
|
5880
5881
|
De(o, r, t, n, e),
|
|
5881
5882
|
oe(([[, l], u, d, f, h, p = []]) => _u(l, u, d, f, h, p))
|
|
5882
5883
|
),
|
|
@@ -5891,7 +5892,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
|
|
|
5891
5892
|
U(
|
|
5892
5893
|
e,
|
|
5893
5894
|
De(r),
|
|
5894
|
-
|
|
5895
|
+
Ee(([, o]) => o !== 0),
|
|
5895
5896
|
oe(([, o]) => ({ top: o }))
|
|
5896
5897
|
),
|
|
5897
5898
|
(o) => {
|
|
@@ -5899,7 +5900,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
|
|
|
5899
5900
|
U(
|
|
5900
5901
|
n,
|
|
5901
5902
|
qn(1),
|
|
5902
|
-
|
|
5903
|
+
Ee((s) => s.items.length > 1)
|
|
5903
5904
|
),
|
|
5904
5905
|
() => {
|
|
5905
5906
|
requestAnimationFrame(() => {
|
|
@@ -5921,7 +5922,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
|
|
|
5921
5922
|
U(
|
|
5922
5923
|
e,
|
|
5923
5924
|
De(r, t, n),
|
|
5924
|
-
|
|
5925
|
+
Ee(([o, s]) => !!s),
|
|
5925
5926
|
oe(([o, s, i, a]) => {
|
|
5926
5927
|
const { enter: l, exit: u } = s;
|
|
5927
5928
|
if (i) {
|
|
@@ -5993,11 +5994,11 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
|
|
|
5993
5994
|
const R = Wx(w.sizeTree);
|
|
5994
5995
|
g && x !== null && y !== null && (v = x.scrollTop - y.offsetTop), v -= S, p({ ranges: R, scrollTop: v });
|
|
5995
5996
|
}
|
|
5996
|
-
), fe(U(d,
|
|
5997
|
+
), fe(U(d, Ee(oa), oe(lv)), o), fe(
|
|
5997
5998
|
U(
|
|
5998
5999
|
s,
|
|
5999
6000
|
De(d),
|
|
6000
|
-
|
|
6001
|
+
Ee(([, p]) => p !== void 0),
|
|
6001
6002
|
nt(),
|
|
6002
6003
|
oe(([, p]) => p.ranges)
|
|
6003
6004
|
),
|
|
@@ -6017,7 +6018,7 @@ const cv = Ve(([{ topItemsIndexes: e }]) => {
|
|
|
6017
6018
|
return fe(
|
|
6018
6019
|
U(
|
|
6019
6020
|
t,
|
|
6020
|
-
|
|
6021
|
+
Ee((n) => n >= 0),
|
|
6021
6022
|
oe((n) => Array.from({ length: n }).map((r, o) => o))
|
|
6022
6023
|
),
|
|
6023
6024
|
e
|
|
@@ -6041,17 +6042,17 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
6041
6042
|
l,
|
|
6042
6043
|
De(i),
|
|
6043
6044
|
sn(
|
|
6044
|
-
([, x, y, S], [{ bottom: R, items: C, offsetBottom: T, totalCount:
|
|
6045
|
+
([, x, y, S], [{ bottom: R, items: C, offsetBottom: T, totalCount: E }, I]) => {
|
|
6045
6046
|
const A = R + T;
|
|
6046
6047
|
let _ = 0;
|
|
6047
|
-
return y ===
|
|
6048
|
+
return y === E && x.length > 0 && C.length > 0 && (C[0].originalIndex === 0 && x[0].originalIndex === 0 || (_ = A - S, _ !== 0 && (_ += I))), [_, C, E, A];
|
|
6048
6049
|
},
|
|
6049
6050
|
[0, [], 0, 0]
|
|
6050
6051
|
),
|
|
6051
|
-
|
|
6052
|
+
Ee(([x]) => x !== 0),
|
|
6052
6053
|
De(r, a, n, o, p, w),
|
|
6053
|
-
|
|
6054
|
-
oe(([[x], , , , , y]) => (y("Upward scrolling compensation", { amount: x },
|
|
6054
|
+
Ee(([, x, y, S, , , R]) => !R && !S && x !== 0 && y === Vr),
|
|
6055
|
+
oe(([[x], , , , , y]) => (y("Upward scrolling compensation", { amount: x }, kt.DEBUG), x))
|
|
6055
6056
|
)
|
|
6056
6057
|
);
|
|
6057
6058
|
function g(x) {
|
|
@@ -6062,7 +6063,7 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
6062
6063
|
}), Ye(
|
|
6063
6064
|
U(
|
|
6064
6065
|
dt(yt(s, !1), e, w),
|
|
6065
|
-
|
|
6066
|
+
Ee(([x, y, S]) => !x && !S && y !== 0),
|
|
6066
6067
|
oe(([x, y]) => y),
|
|
6067
6068
|
mn(1)
|
|
6068
6069
|
),
|
|
@@ -6078,21 +6079,21 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
6078
6079
|
u,
|
|
6079
6080
|
De(h, d),
|
|
6080
6081
|
oe(([x, { groupIndices: y, lastSize: S, sizeTree: R }, C]) => {
|
|
6081
|
-
function T(
|
|
6082
|
-
return
|
|
6082
|
+
function T(E) {
|
|
6083
|
+
return E * (S + C);
|
|
6083
6084
|
}
|
|
6084
6085
|
if (y.length === 0)
|
|
6085
6086
|
return T(x);
|
|
6086
6087
|
{
|
|
6087
|
-
let
|
|
6088
|
+
let E = 0;
|
|
6088
6089
|
const I = Hr(R, 0);
|
|
6089
6090
|
let A = 0, _ = 0;
|
|
6090
6091
|
for (; A < x; ) {
|
|
6091
|
-
A++,
|
|
6092
|
+
A++, E += I;
|
|
6092
6093
|
let D = y.length === _ + 1 ? 1 / 0 : y[_ + 1] - y[_] - 1;
|
|
6093
|
-
A + D > x && (
|
|
6094
|
+
A + D > x && (E -= I, D = x - A + 1), A += D, E += T(D), _++;
|
|
6094
6095
|
}
|
|
6095
|
-
return
|
|
6096
|
+
return E;
|
|
6096
6097
|
}
|
|
6097
6098
|
})
|
|
6098
6099
|
),
|
|
@@ -6168,7 +6169,7 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
6168
6169
|
{ listState: y, topItemsIndexes: S, ...R },
|
|
6169
6170
|
{ scrollToIndex: C },
|
|
6170
6171
|
T,
|
|
6171
|
-
{ topItemCount:
|
|
6172
|
+
{ topItemCount: E },
|
|
6172
6173
|
{ groupCounts: I },
|
|
6173
6174
|
A
|
|
6174
6175
|
]) => (fe(R.rangeChanged, A.scrollSeekRangeChanged), fe(
|
|
@@ -6188,7 +6189,7 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
6188
6189
|
initialTopMostItemIndex: p,
|
|
6189
6190
|
scrolledToInitialItem: w,
|
|
6190
6191
|
sizeRanges: a,
|
|
6191
|
-
topItemCount:
|
|
6192
|
+
topItemCount: E,
|
|
6192
6193
|
topItemsIndexes: S,
|
|
6193
6194
|
// input
|
|
6194
6195
|
totalCount: d,
|
|
@@ -6258,12 +6259,12 @@ function $u(e, t, n) {
|
|
|
6258
6259
|
return i.reduce((x, y) => (x[y] = Nx(g[t.events[y]]), x), {});
|
|
6259
6260
|
}
|
|
6260
6261
|
const f = V.forwardRef((g, x) => {
|
|
6261
|
-
const { children: y, ...S } = g, [R] = V.useState(() => us(_x(e), (
|
|
6262
|
-
l(
|
|
6263
|
-
})), [C] = V.useState(
|
|
6262
|
+
const { children: y, ...S } = g, [R] = V.useState(() => us(_x(e), (E) => {
|
|
6263
|
+
l(E, S);
|
|
6264
|
+
})), [C] = V.useState(El(d, R));
|
|
6264
6265
|
uo(() => {
|
|
6265
|
-
for (const
|
|
6266
|
-
|
|
6266
|
+
for (const E of i)
|
|
6267
|
+
E in S && Ye(C[E], S[E]);
|
|
6267
6268
|
return () => {
|
|
6268
6269
|
Object.values(C).map(sa);
|
|
6269
6270
|
};
|
|
@@ -6291,7 +6292,7 @@ function $u(e, t, n) {
|
|
|
6291
6292
|
() => lt(x)
|
|
6292
6293
|
);
|
|
6293
6294
|
}, w = (g) => {
|
|
6294
|
-
const x = V.useContext(a)[g], [y, S] = V.useState(
|
|
6295
|
+
const x = V.useContext(a)[g], [y, S] = V.useState(El(lt, x));
|
|
6295
6296
|
return uo(
|
|
6296
6297
|
() => Ye(x, (R) => {
|
|
6297
6298
|
R !== y && S(Rl(R));
|
|
@@ -6420,7 +6421,7 @@ const mv = /* @__PURE__ */ Ve(() => {
|
|
|
6420
6421
|
ma("deviation", (P) => {
|
|
6421
6422
|
x !== P && y(P);
|
|
6422
6423
|
});
|
|
6423
|
-
const S = Ae("EmptyPlaceholder"), R = Ae("ScrollSeekPlaceholder") || xv, C = Ae("ListComponent"), T = Ae("ItemComponent"),
|
|
6424
|
+
const S = Ae("EmptyPlaceholder"), R = Ae("ScrollSeekPlaceholder") || xv, C = Ae("ListComponent"), T = Ae("ItemComponent"), E = Ae("GroupComponent"), I = Ae("computeItemKey"), A = Ae("isSeeking"), _ = Ae("groupIndices").length > 0, D = Ae("alignToBottom"), L = Ae("initialItemFinalLocationReached"), W = e ? {} : {
|
|
6424
6425
|
boxSizing: "border-box",
|
|
6425
6426
|
...v ? {
|
|
6426
6427
|
display: "inline-block",
|
|
@@ -6456,9 +6457,9 @@ const mv = /* @__PURE__ */ Ve(() => {
|
|
|
6456
6457
|
...P.type === "group" ? {} : { groupIndex: P.groupIndex }
|
|
6457
6458
|
}
|
|
6458
6459
|
) : P.type === "group" ? /* @__PURE__ */ bo(
|
|
6459
|
-
|
|
6460
|
+
E,
|
|
6460
6461
|
{
|
|
6461
|
-
...bt(
|
|
6462
|
+
...bt(E, u),
|
|
6462
6463
|
"data-index": Y,
|
|
6463
6464
|
"data-item-index": P.index,
|
|
6464
6465
|
"data-known-size": P.size,
|
|
@@ -6589,7 +6590,7 @@ function Vu({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
|
6589
6590
|
);
|
|
6590
6591
|
});
|
|
6591
6592
|
}
|
|
6592
|
-
const
|
|
6593
|
+
const Ev = ({ children: e }) => {
|
|
6593
6594
|
const t = V.useContext(Fu), n = zt("viewportHeight"), r = zt("fixedItemHeight"), o = Ae("alignToBottom"), s = Ae("horizontalDirection"), i = V.useMemo(
|
|
6594
6595
|
() => gu(n, (l) => Tn(l, s ? "width" : "height")),
|
|
6595
6596
|
[n, s]
|
|
@@ -6597,7 +6598,7 @@ const kv = ({ children: e }) => {
|
|
|
6597
6598
|
return V.useEffect(() => {
|
|
6598
6599
|
t && (n(t.viewportHeight), r(t.itemHeight));
|
|
6599
6600
|
}, [t, n, r]), /* @__PURE__ */ c.jsx("div", { "data-viewport-type": "element", ref: a, style: hs(o), children: e });
|
|
6600
|
-
},
|
|
6601
|
+
}, kv = ({ children: e }) => {
|
|
6601
6602
|
const t = V.useContext(Fu), n = zt("windowViewportRect"), r = zt("fixedItemHeight"), o = Ae("customScrollParent"), s = vu(
|
|
6602
6603
|
n,
|
|
6603
6604
|
o,
|
|
@@ -6613,7 +6614,7 @@ const kv = ({ children: e }) => {
|
|
|
6613
6614
|
const t = Ae("useWindowScroll"), n = Ae("topItemsIndexes").length > 0, r = Ae("customScrollParent"), o = Ae("context");
|
|
6614
6615
|
return /* @__PURE__ */ c.jsxs(r || t ? jv : _v, { ...e, context: o, children: [
|
|
6615
6616
|
n && /* @__PURE__ */ c.jsx(Iv, { children: /* @__PURE__ */ c.jsx(Ll, { showTopList: !0 }) }),
|
|
6616
|
-
/* @__PURE__ */ c.jsxs(r || t ?
|
|
6617
|
+
/* @__PURE__ */ c.jsxs(r || t ? kv : Ev, { children: [
|
|
6617
6618
|
/* @__PURE__ */ c.jsx(Tv, {}),
|
|
6618
6619
|
/* @__PURE__ */ c.jsx(Ll, {}),
|
|
6619
6620
|
/* @__PURE__ */ c.jsx(Rv, {})
|
|
@@ -6763,12 +6764,12 @@ const $v = /* @__PURE__ */ Ve(
|
|
|
6763
6764
|
{ customScrollParent: g, useWindowScroll: x, windowScrollContainerState: y, windowScrollTo: S, windowViewportRect: R },
|
|
6764
6765
|
C
|
|
6765
6766
|
]) => {
|
|
6766
|
-
const T = Z(0),
|
|
6767
|
+
const T = Z(0), E = Z(0), I = Z($l), A = Z({ height: 0, width: 0 }), _ = Z({ height: 0, width: 0 }), D = Be(), L = Be(), W = Z(0), P = Z(null), Y = Z({ column: 0, row: 0 }), K = Be(), J = Be(), z = Z(!1), $ = Z(0), F = Z(!0), B = Z(!1), pe = Z(!1);
|
|
6767
6768
|
Ye(
|
|
6768
6769
|
U(
|
|
6769
6770
|
w,
|
|
6770
6771
|
De($),
|
|
6771
|
-
|
|
6772
|
+
Ee(([O, Q]) => !!Q)
|
|
6772
6773
|
),
|
|
6773
6774
|
() => {
|
|
6774
6775
|
je(F, !1);
|
|
@@ -6776,7 +6777,7 @@ const $v = /* @__PURE__ */ Ve(
|
|
|
6776
6777
|
), Ye(
|
|
6777
6778
|
U(
|
|
6778
6779
|
dt(w, F, _, A, $, B),
|
|
6779
|
-
|
|
6780
|
+
Ee(([O, Q, q, ce, , ie]) => O && !Q && q.height !== 0 && ce.height !== 0 && !ie)
|
|
6780
6781
|
),
|
|
6781
6782
|
([, , , , O]) => {
|
|
6782
6783
|
je(B, !0), ca(1, () => {
|
|
@@ -6788,15 +6789,15 @@ const $v = /* @__PURE__ */ Ve(
|
|
|
6788
6789
|
), fe(
|
|
6789
6790
|
U(
|
|
6790
6791
|
J,
|
|
6791
|
-
|
|
6792
|
+
Ee((O) => O != null && O.scrollTop > 0),
|
|
6792
6793
|
rn(0)
|
|
6793
6794
|
),
|
|
6794
|
-
|
|
6795
|
+
E
|
|
6795
6796
|
), Ye(
|
|
6796
6797
|
U(
|
|
6797
6798
|
w,
|
|
6798
6799
|
De(J),
|
|
6799
|
-
|
|
6800
|
+
Ee(([, O]) => O != null)
|
|
6800
6801
|
),
|
|
6801
6802
|
([, O]) => {
|
|
6802
6803
|
O && (je(A, O.viewport), je(_, O.item), je(Y, O.gap), O.scrollTop > 0 && (je(z, !0), qt(U(u, qn(1)), (Q) => {
|
|
@@ -6834,12 +6835,12 @@ const $v = /* @__PURE__ */ Ve(
|
|
|
6834
6835
|
Re(_, fo),
|
|
6835
6836
|
Re(A, fo),
|
|
6836
6837
|
Re(P),
|
|
6837
|
-
Re(
|
|
6838
|
+
Re(E),
|
|
6838
6839
|
Re(z),
|
|
6839
6840
|
Re(F),
|
|
6840
6841
|
Re($)
|
|
6841
6842
|
),
|
|
6842
|
-
|
|
6843
|
+
Ee(([, , , , , , , O]) => !O),
|
|
6843
6844
|
oe(
|
|
6844
6845
|
([
|
|
6845
6846
|
O,
|
|
@@ -6872,14 +6873,14 @@ const $v = /* @__PURE__ */ Ve(
|
|
|
6872
6873
|
), fe(
|
|
6873
6874
|
U(
|
|
6874
6875
|
P,
|
|
6875
|
-
|
|
6876
|
+
Ee((O) => O !== null),
|
|
6876
6877
|
oe((O) => O.length)
|
|
6877
6878
|
),
|
|
6878
6879
|
T
|
|
6879
6880
|
), fe(
|
|
6880
6881
|
U(
|
|
6881
6882
|
dt(A, _, I, Y),
|
|
6882
|
-
|
|
6883
|
+
Ee(([O, Q, { items: q }]) => q.length > 0 && Q.height !== 0 && O.height !== 0),
|
|
6883
6884
|
oe(([O, Q, { items: q }, ce]) => {
|
|
6884
6885
|
const { bottom: ie, top: $e } = Hl(O, ce, Q, q);
|
|
6885
6886
|
return [$e, ie];
|
|
@@ -6900,9 +6901,9 @@ const $v = /* @__PURE__ */ Ve(
|
|
|
6900
6901
|
const ee = jt(
|
|
6901
6902
|
U(
|
|
6902
6903
|
dt(I, T),
|
|
6903
|
-
|
|
6904
|
+
Ee(([{ items: O }]) => O.length > 0),
|
|
6904
6905
|
De(ue),
|
|
6905
|
-
|
|
6906
|
+
Ee(([[O, Q], q]) => {
|
|
6906
6907
|
const ce = O.items[O.items.length - 1].index === Q - 1;
|
|
6907
6908
|
return (q || O.bottom > 0 && O.itemHeight > 0 && O.offsetBottom === 0 && O.items.length === Q) && ce;
|
|
6908
6909
|
}),
|
|
@@ -6912,7 +6913,7 @@ const $v = /* @__PURE__ */ Ve(
|
|
|
6912
6913
|
), Ie = jt(
|
|
6913
6914
|
U(
|
|
6914
6915
|
Re(I),
|
|
6915
|
-
|
|
6916
|
+
Ee(({ items: O }) => O.length > 0 && O[0].index === 0),
|
|
6916
6917
|
rn(0),
|
|
6917
6918
|
nt()
|
|
6918
6919
|
)
|
|
@@ -6920,7 +6921,7 @@ const $v = /* @__PURE__ */ Ve(
|
|
|
6920
6921
|
U(
|
|
6921
6922
|
Re(I),
|
|
6922
6923
|
De(z),
|
|
6923
|
-
|
|
6924
|
+
Ee(([{ items: O }, Q]) => O.length > 0 && !Q),
|
|
6924
6925
|
oe(([{ items: O }]) => ({
|
|
6925
6926
|
endIndex: O[O.length - 1].index,
|
|
6926
6927
|
startIndex: O[0].index
|
|
@@ -6965,7 +6966,7 @@ const $v = /* @__PURE__ */ Ve(
|
|
|
6965
6966
|
gap: Y,
|
|
6966
6967
|
headerHeight: s,
|
|
6967
6968
|
increaseViewportBy: e,
|
|
6968
|
-
initialItemCount:
|
|
6969
|
+
initialItemCount: E,
|
|
6969
6970
|
itemDimensions: _,
|
|
6970
6971
|
overscan: n,
|
|
6971
6972
|
restoreStateFrom: J,
|
|
@@ -7196,7 +7197,7 @@ const Fv = /* @__PURE__ */ Ve(() => {
|
|
|
7196
7197
|
Kv
|
|
7197
7198
|
), qv = /* @__PURE__ */ Wu({ useEmitter: qu, useEmitterValue: st, usePublisher: Bt }), Gv = /* @__PURE__ */ Vu({ useEmitter: qu, useEmitterValue: st, usePublisher: Bt });
|
|
7198
7199
|
function Ul(e, t, n) {
|
|
7199
|
-
return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t,
|
|
7200
|
+
return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, kt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
|
|
7200
7201
|
}
|
|
7201
7202
|
const Yv = ns(
|
|
7202
7203
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
@@ -7379,7 +7380,7 @@ var tw = [
|
|
|
7379
7380
|
"span",
|
|
7380
7381
|
"svg",
|
|
7381
7382
|
"ul"
|
|
7382
|
-
],
|
|
7383
|
+
], ke = tw.reduce((e, t) => {
|
|
7383
7384
|
const n = vr(`Primitive.${t}`), r = m.forwardRef((o, s) => {
|
|
7384
7385
|
const { asChild: i, ...a } = o, l = i ? n : t;
|
|
7385
7386
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ c.jsx(l, { ...a, ref: s });
|
|
@@ -7486,7 +7487,7 @@ var ps = "Collapsible", [aw, WT] = fn(ps), [lw, xa] = aw(ps), Yu = m.forwardRef(
|
|
|
7486
7487
|
open: l,
|
|
7487
7488
|
onOpenToggle: m.useCallback(() => u((d) => !d), [u]),
|
|
7488
7489
|
children: /* @__PURE__ */ c.jsx(
|
|
7489
|
-
|
|
7490
|
+
ke.div,
|
|
7490
7491
|
{
|
|
7491
7492
|
"data-state": wa(l),
|
|
7492
7493
|
"data-disabled": s ? "" : void 0,
|
|
@@ -7503,7 +7504,7 @@ var Xu = "CollapsibleTrigger", Ju = m.forwardRef(
|
|
|
7503
7504
|
(e, t) => {
|
|
7504
7505
|
const { __scopeCollapsible: n, ...r } = e, o = xa(Xu, n);
|
|
7505
7506
|
return /* @__PURE__ */ c.jsx(
|
|
7506
|
-
|
|
7507
|
+
ke.button,
|
|
7507
7508
|
{
|
|
7508
7509
|
type: "button",
|
|
7509
7510
|
"aria-controls": o.contentId,
|
|
@@ -7542,7 +7543,7 @@ var uw = m.forwardRef((e, t) => {
|
|
|
7542
7543
|
f.current = S.height, p.current = S.width, g.current || (y.style.transitionDuration = x.current.transitionDuration, y.style.animationName = x.current.animationName), l(r);
|
|
7543
7544
|
}
|
|
7544
7545
|
}, [i.open, r]), /* @__PURE__ */ c.jsx(
|
|
7545
|
-
|
|
7546
|
+
ke.div,
|
|
7546
7547
|
{
|
|
7547
7548
|
"data-state": wa(i.open),
|
|
7548
7549
|
"data-disabled": i.disabled ? "" : void 0,
|
|
@@ -7605,8 +7606,8 @@ const Zu = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
|
7605
7606
|
}
|
|
7606
7607
|
));
|
|
7607
7608
|
Zu.displayName = "CardDescription";
|
|
7608
|
-
const
|
|
7609
|
-
|
|
7609
|
+
const ko = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx("div", { ref: n, className: te("p-6 pt-0", e), ...t }));
|
|
7610
|
+
ko.displayName = "CardContent";
|
|
7610
7611
|
const Qu = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
7611
7612
|
"div",
|
|
7612
7613
|
{
|
|
@@ -7778,7 +7779,7 @@ function Jl(e, t, n, r) {
|
|
|
7778
7779
|
text: vt(i)
|
|
7779
7780
|
};
|
|
7780
7781
|
}
|
|
7781
|
-
function
|
|
7782
|
+
function Ew(e, t) {
|
|
7782
7783
|
const n = e.match(/^(\s+)(?:```)/);
|
|
7783
7784
|
if (n === null)
|
|
7784
7785
|
return t;
|
|
@@ -7821,7 +7822,7 @@ class ba {
|
|
|
7821
7822
|
fences(t) {
|
|
7822
7823
|
const n = this.rules.block.fences.exec(t);
|
|
7823
7824
|
if (n) {
|
|
7824
|
-
const r = n[0], o =
|
|
7825
|
+
const r = n[0], o = Ew(r, n[3] || "");
|
|
7825
7826
|
return {
|
|
7826
7827
|
type: "code",
|
|
7827
7828
|
raw: r,
|
|
@@ -7888,14 +7889,14 @@ class ba {
|
|
|
7888
7889
|
`, 1)[0].replace(/^\t+/, (R) => " ".repeat(3 * R.length)), f = t.split(`
|
|
7889
7890
|
`, 1)[0], this.options.pedantic ? (i = 2, p = d.trimLeft()) : (i = n[2].search(/[^ ]/), i = i > 4 ? 1 : i, p = d.slice(i), i += n[1].length), l = !1, !d && /^ *$/.test(f) && (r += f + `
|
|
7890
7891
|
`, t = t.substring(f.length + 1), w = !0), !w) {
|
|
7891
|
-
const R = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), C = new RegExp(`^ {0,${Math.min(3, i - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), T = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:\`\`\`|~~~)`),
|
|
7892
|
+
const R = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), C = new RegExp(`^ {0,${Math.min(3, i - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), T = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:\`\`\`|~~~)`), E = new RegExp(`^ {0,${Math.min(3, i - 1)}}#`);
|
|
7892
7893
|
for (; t && (h = t.split(`
|
|
7893
|
-
`, 1)[0], f = h, this.options.pedantic && (f = f.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(T.test(f) ||
|
|
7894
|
+
`, 1)[0], f = h, this.options.pedantic && (f = f.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(T.test(f) || E.test(f) || R.test(f) || C.test(t))); ) {
|
|
7894
7895
|
if (f.search(/[^ ]/) >= i || !f.trim())
|
|
7895
7896
|
p += `
|
|
7896
7897
|
` + f.slice(i);
|
|
7897
7898
|
else {
|
|
7898
|
-
if (l || d.search(/[^ ]/) >= 4 || T.test(d) ||
|
|
7899
|
+
if (l || d.search(/[^ ]/) >= 4 || T.test(d) || E.test(d) || C.test(d))
|
|
7899
7900
|
break;
|
|
7900
7901
|
p += `
|
|
7901
7902
|
` + f;
|
|
@@ -8334,7 +8335,7 @@ se.breaks = {
|
|
|
8334
8335
|
br: Qe(se.br).replace("{2,}", "*").getRegex(),
|
|
8335
8336
|
text: Qe(se.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
8336
8337
|
};
|
|
8337
|
-
function
|
|
8338
|
+
function kw(e) {
|
|
8338
8339
|
return e.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");
|
|
8339
8340
|
}
|
|
8340
8341
|
function Zl(e) {
|
|
@@ -8548,7 +8549,7 @@ class Rn {
|
|
|
8548
8549
|
h = p.call({ lexer: this }, f), typeof h == "number" && h >= 0 && (d = Math.min(d, h));
|
|
8549
8550
|
}), d < 1 / 0 && d >= 0 && (s = t.substring(0, d + 1));
|
|
8550
8551
|
}
|
|
8551
|
-
if (r = this.tokenizer.inlineText(s,
|
|
8552
|
+
if (r = this.tokenizer.inlineText(s, kw)) {
|
|
8552
8553
|
t = t.substring(r.raw.length), r.raw.slice(-1) !== "_" && (u = r.raw.slice(-1)), l = !0, o = n[n.length - 1], o && o.type === "text" ? (o.raw += r.raw, o.text += r.text) : n.push(r);
|
|
8553
8554
|
continue;
|
|
8554
8555
|
}
|
|
@@ -8777,7 +8778,7 @@ class sd {
|
|
|
8777
8778
|
return this.getNextSafeSlug(r, n.dryrun);
|
|
8778
8779
|
}
|
|
8779
8780
|
}
|
|
8780
|
-
class
|
|
8781
|
+
class En {
|
|
8781
8782
|
constructor(t) {
|
|
8782
8783
|
this.options = t || tr, this.options.renderer = this.options.renderer || new ya(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new od(), this.slugger = new sd();
|
|
8783
8784
|
}
|
|
@@ -8785,21 +8786,21 @@ class kn {
|
|
|
8785
8786
|
* Static Parse Method
|
|
8786
8787
|
*/
|
|
8787
8788
|
static parse(t, n) {
|
|
8788
|
-
return new
|
|
8789
|
+
return new En(n).parse(t);
|
|
8789
8790
|
}
|
|
8790
8791
|
/**
|
|
8791
8792
|
* Static Parse Inline Method
|
|
8792
8793
|
*/
|
|
8793
8794
|
static parseInline(t, n) {
|
|
8794
|
-
return new
|
|
8795
|
+
return new En(n).parseInline(t);
|
|
8795
8796
|
}
|
|
8796
8797
|
/**
|
|
8797
8798
|
* Parse Loop
|
|
8798
8799
|
*/
|
|
8799
8800
|
parse(t, n = !0) {
|
|
8800
8801
|
let r = "", o, s, i, a, l, u, d, f, h, p, w, v, g, x, y, S, R, C, T;
|
|
8801
|
-
const
|
|
8802
|
-
for (o = 0; o <
|
|
8802
|
+
const E = t.length;
|
|
8803
|
+
for (o = 0; o < E; o++) {
|
|
8803
8804
|
if (p = t[o], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[p.type] && (T = this.options.extensions.renderers[p.type].call({ parser: this }, p), T !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(p.type))) {
|
|
8804
8805
|
r += T || "";
|
|
8805
8806
|
continue;
|
|
@@ -8867,7 +8868,7 @@ class kn {
|
|
|
8867
8868
|
continue;
|
|
8868
8869
|
}
|
|
8869
8870
|
case "text": {
|
|
8870
|
-
for (h = p.tokens ? this.parseInline(p.tokens) : p.text; o + 1 <
|
|
8871
|
+
for (h = p.tokens ? this.parseInline(p.tokens) : p.text; o + 1 < E && t[o + 1].type === "text"; )
|
|
8871
8872
|
p = t[++o], h += `
|
|
8872
8873
|
` + (p.tokens ? this.parseInline(p.tokens) : p.text);
|
|
8873
8874
|
r += n ? this.renderer.paragraph(h) : h;
|
|
@@ -9049,7 +9050,7 @@ function id(e, t) {
|
|
|
9049
9050
|
};
|
|
9050
9051
|
}
|
|
9051
9052
|
function be(e, t, n) {
|
|
9052
|
-
return id(Rn.lex,
|
|
9053
|
+
return id(Rn.lex, En.parse)(e, t, n);
|
|
9053
9054
|
}
|
|
9054
9055
|
be.options = be.setOptions = function(e) {
|
|
9055
9056
|
return be.defaults = { ...be.defaults, ...e }, fw(be.defaults), be;
|
|
@@ -9147,9 +9148,9 @@ be.walkTokens = function(e, t) {
|
|
|
9147
9148
|
}
|
|
9148
9149
|
return n;
|
|
9149
9150
|
};
|
|
9150
|
-
be.parseInline = id(Rn.lexInline,
|
|
9151
|
-
be.Parser =
|
|
9152
|
-
be.parser =
|
|
9151
|
+
be.parseInline = id(Rn.lexInline, En.parseInline);
|
|
9152
|
+
be.Parser = En;
|
|
9153
|
+
be.parser = En.parse;
|
|
9153
9154
|
be.Renderer = ya;
|
|
9154
9155
|
be.TextRenderer = od;
|
|
9155
9156
|
be.Lexer = Rn;
|
|
@@ -9163,7 +9164,7 @@ be.setOptions;
|
|
|
9163
9164
|
be.use;
|
|
9164
9165
|
be.walkTokens;
|
|
9165
9166
|
be.parseInline;
|
|
9166
|
-
|
|
9167
|
+
En.parse;
|
|
9167
9168
|
Rn.lex;
|
|
9168
9169
|
function Ql({
|
|
9169
9170
|
content: e,
|
|
@@ -9343,15 +9344,15 @@ var Lw = "DismissableLayer", Mi = "dismissableLayer.update", $w = "dismissableLa
|
|
|
9343
9344
|
onInteractOutside: i,
|
|
9344
9345
|
onDismiss: a,
|
|
9345
9346
|
...l
|
|
9346
|
-
} = e, u = m.useContext(ld), [d, f] = m.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = m.useState({}), w = ze(t, (
|
|
9347
|
-
const I =
|
|
9348
|
-
!R || A || (o == null || o(
|
|
9349
|
-
}, h), T = Uw((
|
|
9350
|
-
const I =
|
|
9351
|
-
[...u.branches].some((_) => _.contains(I)) || (s == null || s(
|
|
9347
|
+
} = e, u = m.useContext(ld), [d, f] = m.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = m.useState({}), w = ze(t, (E) => f(E)), v = Array.from(u.layers), [g] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), x = v.indexOf(g), y = d ? v.indexOf(d) : -1, S = u.layersWithOutsidePointerEventsDisabled.size > 0, R = y >= x, C = Hw((E) => {
|
|
9348
|
+
const I = E.target, A = [...u.branches].some((_) => _.contains(I));
|
|
9349
|
+
!R || A || (o == null || o(E), i == null || i(E), E.defaultPrevented || a == null || a());
|
|
9350
|
+
}, h), T = Uw((E) => {
|
|
9351
|
+
const I = E.target;
|
|
9352
|
+
[...u.branches].some((_) => _.contains(I)) || (s == null || s(E), i == null || i(E), E.defaultPrevented || a == null || a());
|
|
9352
9353
|
}, h);
|
|
9353
|
-
return Dw((
|
|
9354
|
-
y === u.layers.size - 1 && (r == null || r(
|
|
9354
|
+
return Dw((E) => {
|
|
9355
|
+
y === u.layers.size - 1 && (r == null || r(E), !E.defaultPrevented && a && (E.preventDefault(), a()));
|
|
9355
9356
|
}, h), m.useEffect(() => {
|
|
9356
9357
|
if (d)
|
|
9357
9358
|
return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (nc = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), rc(), () => {
|
|
@@ -9360,10 +9361,10 @@ var Lw = "DismissableLayer", Mi = "dismissableLayer.update", $w = "dismissableLa
|
|
|
9360
9361
|
}, [d, h, n, u]), m.useEffect(() => () => {
|
|
9361
9362
|
d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), rc());
|
|
9362
9363
|
}, [d, u]), m.useEffect(() => {
|
|
9363
|
-
const
|
|
9364
|
-
return document.addEventListener(Mi,
|
|
9364
|
+
const E = () => p({});
|
|
9365
|
+
return document.addEventListener(Mi, E), () => document.removeEventListener(Mi, E);
|
|
9365
9366
|
}, []), /* @__PURE__ */ c.jsx(
|
|
9366
|
-
|
|
9367
|
+
ke.div,
|
|
9367
9368
|
{
|
|
9368
9369
|
...l,
|
|
9369
9370
|
ref: w,
|
|
@@ -9390,7 +9391,7 @@ var zw = "DismissableLayerBranch", Bw = m.forwardRef((e, t) => {
|
|
|
9390
9391
|
return n.branches.add(s), () => {
|
|
9391
9392
|
n.branches.delete(s);
|
|
9392
9393
|
};
|
|
9393
|
-
}, [n.branches]), /* @__PURE__ */ c.jsx(
|
|
9394
|
+
}, [n.branches]), /* @__PURE__ */ c.jsx(ke.div, { ...e, ref: o });
|
|
9394
9395
|
});
|
|
9395
9396
|
Bw.displayName = zw;
|
|
9396
9397
|
function Hw(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
@@ -9509,7 +9510,7 @@ var si = "focusScope.autoFocusOnMount", ii = "focusScope.autoFocusOnUnmount", oc
|
|
|
9509
9510
|
},
|
|
9510
9511
|
[n, r, p.paused]
|
|
9511
9512
|
);
|
|
9512
|
-
return /* @__PURE__ */ c.jsx(
|
|
9513
|
+
return /* @__PURE__ */ c.jsx(ke.div, { tabIndex: -1, ...i, ref: h, onKeyDown: w });
|
|
9513
9514
|
});
|
|
9514
9515
|
gs.displayName = Ww;
|
|
9515
9516
|
function Vw(e, { select: t = !1 } = {}) {
|
|
@@ -9579,7 +9580,7 @@ var Jw = "Portal", xs = m.forwardRef((e, t) => {
|
|
|
9579
9580
|
const { container: n, ...r } = e, [o, s] = m.useState(!1);
|
|
9580
9581
|
pt(() => s(!0), []);
|
|
9581
9582
|
const i = n || o && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
|
|
9582
|
-
return i ? Dc.createPortal(/* @__PURE__ */ c.jsx(
|
|
9583
|
+
return i ? Dc.createPortal(/* @__PURE__ */ c.jsx(ke.div, { ...r, ref: t }), i) : null;
|
|
9583
9584
|
});
|
|
9584
9585
|
xs.displayName = Jw;
|
|
9585
9586
|
var ai = 0;
|
|
@@ -9744,12 +9745,12 @@ var hd = ib(), ci = function() {
|
|
|
9744
9745
|
onScrollCapture: ci,
|
|
9745
9746
|
onWheelCapture: ci,
|
|
9746
9747
|
onTouchMoveCapture: ci
|
|
9747
|
-
}), o = r[0], s = r[1], i = e.forwardProps, a = e.children, l = e.className, u = e.removeScrollBar, d = e.enabled, f = e.shards, h = e.sideCar, p = e.noRelative, w = e.noIsolation, v = e.inert, g = e.allowPinchZoom, x = e.as, y = x === void 0 ? "div" : x, S = e.gapMode, R = dd(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = h, T = rb([n, t]),
|
|
9748
|
+
}), o = r[0], s = r[1], i = e.forwardProps, a = e.children, l = e.className, u = e.removeScrollBar, d = e.enabled, f = e.shards, h = e.sideCar, p = e.noRelative, w = e.noIsolation, v = e.inert, g = e.allowPinchZoom, x = e.as, y = x === void 0 ? "div" : x, S = e.gapMode, R = dd(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = h, T = rb([n, t]), E = on(on({}, R), o);
|
|
9748
9749
|
return m.createElement(
|
|
9749
9750
|
m.Fragment,
|
|
9750
9751
|
null,
|
|
9751
9752
|
d && m.createElement(C, { sideCar: hd, removeScrollBar: u, shards: f, noRelative: p, noIsolation: w, inert: v, setCallbacks: s, allowPinchZoom: !!g, lockRef: n, gapMode: S }),
|
|
9752
|
-
i ? m.cloneElement(m.Children.only(a), on(on({},
|
|
9753
|
+
i ? m.cloneElement(m.Children.only(a), on(on({}, E), { ref: T })) : m.createElement(y, on({}, E, { className: l, ref: T }), a)
|
|
9753
9754
|
);
|
|
9754
9755
|
});
|
|
9755
9756
|
vs.defaultProps = {
|
|
@@ -9944,10 +9945,10 @@ var lr = Di ? { passive: !1 } : !1, yb = function(e) {
|
|
|
9944
9945
|
return e === "v" ? Sb(t) : Cb(t);
|
|
9945
9946
|
}, xd = function(e, t) {
|
|
9946
9947
|
return e === "v" ? Tb(t) : Rb(t);
|
|
9947
|
-
},
|
|
9948
|
+
}, Eb = function(e, t) {
|
|
9948
9949
|
return e === "h" && t === "rtl" ? -1 : 1;
|
|
9949
|
-
},
|
|
9950
|
-
var s =
|
|
9950
|
+
}, kb = function(e, t, n, r, o) {
|
|
9951
|
+
var s = Eb(e, window.getComputedStyle(t).direction), i = s * r, a = n.target, l = t.contains(a), u = !1, d = i > 0, f = 0, h = 0;
|
|
9951
9952
|
do {
|
|
9952
9953
|
if (!a)
|
|
9953
9954
|
break;
|
|
@@ -9995,18 +9996,18 @@ function _b(e) {
|
|
|
9995
9996
|
var a = m.useCallback(function(v, g) {
|
|
9996
9997
|
if ("touches" in v && v.touches.length === 2 || v.type === "wheel" && v.ctrlKey)
|
|
9997
9998
|
return !i.current.allowPinchZoom;
|
|
9998
|
-
var x = go(v), y = n.current, S = "deltaX" in v ? v.deltaX : y[0] - x[0], R = "deltaY" in v ? v.deltaY : y[1] - x[1], C, T = v.target,
|
|
9999
|
-
if ("touches" in v &&
|
|
9999
|
+
var x = go(v), y = n.current, S = "deltaX" in v ? v.deltaX : y[0] - x[0], R = "deltaY" in v ? v.deltaY : y[1] - x[1], C, T = v.target, E = Math.abs(S) > Math.abs(R) ? "h" : "v";
|
|
10000
|
+
if ("touches" in v && E === "h" && T.type === "range")
|
|
10000
10001
|
return !1;
|
|
10001
|
-
var I = dc(
|
|
10002
|
+
var I = dc(E, T);
|
|
10002
10003
|
if (!I)
|
|
10003
10004
|
return !0;
|
|
10004
|
-
if (I ? C =
|
|
10005
|
+
if (I ? C = E : (C = E === "v" ? "h" : "v", I = dc(E, T)), !I)
|
|
10005
10006
|
return !1;
|
|
10006
10007
|
if (!r.current && "changedTouches" in v && (S || R) && (r.current = C), !C)
|
|
10007
10008
|
return !0;
|
|
10008
10009
|
var A = r.current || C;
|
|
10009
|
-
return
|
|
10010
|
+
return kb(A, g, v, A === "h" ? S : R);
|
|
10010
10011
|
}, []), l = m.useCallback(function(v) {
|
|
10011
10012
|
var g = v;
|
|
10012
10013
|
if (!(!cr.length || cr[cr.length - 1] !== s)) {
|
|
@@ -10151,13 +10152,13 @@ var yd = "DialogTrigger", Sd = m.forwardRef(
|
|
|
10151
10152
|
(e, t) => {
|
|
10152
10153
|
const { __scopeDialog: n, ...r } = e, o = Zt(yd, n), s = ze(t, o.triggerRef);
|
|
10153
10154
|
return /* @__PURE__ */ c.jsx(
|
|
10154
|
-
|
|
10155
|
+
ke.button,
|
|
10155
10156
|
{
|
|
10156
10157
|
type: "button",
|
|
10157
10158
|
"aria-haspopup": "dialog",
|
|
10158
10159
|
"aria-expanded": o.open,
|
|
10159
10160
|
"aria-controls": o.contentId,
|
|
10160
|
-
"data-state":
|
|
10161
|
+
"data-state": ka(o.open),
|
|
10161
10162
|
...r,
|
|
10162
10163
|
ref: s,
|
|
10163
10164
|
onClick: le(e.onClick, o.onOpenToggle)
|
|
@@ -10187,9 +10188,9 @@ var Fb = vr("DialogOverlay.RemoveScroll"), zb = m.forwardRef(
|
|
|
10187
10188
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
10188
10189
|
// ie. when `Overlay` and `Content` are siblings
|
|
10189
10190
|
/* @__PURE__ */ c.jsx(ws, { as: Fb, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ c.jsx(
|
|
10190
|
-
|
|
10191
|
+
ke.div,
|
|
10191
10192
|
{
|
|
10192
|
-
"data-state":
|
|
10193
|
+
"data-state": ka(o.open),
|
|
10193
10194
|
...r,
|
|
10194
10195
|
ref: t,
|
|
10195
10196
|
style: { pointerEvents: "auto", ...r.style }
|
|
@@ -10197,13 +10198,13 @@ var Fb = vr("DialogOverlay.RemoveScroll"), zb = m.forwardRef(
|
|
|
10197
10198
|
) })
|
|
10198
10199
|
);
|
|
10199
10200
|
}
|
|
10200
|
-
), Yn = "DialogContent",
|
|
10201
|
+
), Yn = "DialogContent", Ed = m.forwardRef(
|
|
10201
10202
|
(e, t) => {
|
|
10202
10203
|
const n = Cd(Yn, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = Zt(Yn, e.__scopeDialog);
|
|
10203
10204
|
return /* @__PURE__ */ c.jsx(Ot, { present: r || s.open, children: s.modal ? /* @__PURE__ */ c.jsx(Bb, { ...o, ref: t }) : /* @__PURE__ */ c.jsx(Hb, { ...o, ref: t }) });
|
|
10204
10205
|
}
|
|
10205
10206
|
);
|
|
10206
|
-
|
|
10207
|
+
Ed.displayName = Yn;
|
|
10207
10208
|
var Bb = m.forwardRef(
|
|
10208
10209
|
(e, t) => {
|
|
10209
10210
|
const n = Zt(Yn, e.__scopeDialog), r = m.useRef(null), o = ze(t, n.contentRef, r);
|
|
@@ -10211,7 +10212,7 @@ var Bb = m.forwardRef(
|
|
|
10211
10212
|
const s = r.current;
|
|
10212
10213
|
if (s) return Ta(s);
|
|
10213
10214
|
}, []), /* @__PURE__ */ c.jsx(
|
|
10214
|
-
|
|
10215
|
+
kd,
|
|
10215
10216
|
{
|
|
10216
10217
|
...e,
|
|
10217
10218
|
ref: o,
|
|
@@ -10236,7 +10237,7 @@ var Bb = m.forwardRef(
|
|
|
10236
10237
|
(e, t) => {
|
|
10237
10238
|
const n = Zt(Yn, e.__scopeDialog), r = m.useRef(!1), o = m.useRef(!1);
|
|
10238
10239
|
return /* @__PURE__ */ c.jsx(
|
|
10239
|
-
|
|
10240
|
+
kd,
|
|
10240
10241
|
{
|
|
10241
10242
|
...e,
|
|
10242
10243
|
ref: t,
|
|
@@ -10255,7 +10256,7 @@ var Bb = m.forwardRef(
|
|
|
10255
10256
|
}
|
|
10256
10257
|
);
|
|
10257
10258
|
}
|
|
10258
|
-
),
|
|
10259
|
+
), kd = m.forwardRef(
|
|
10259
10260
|
(e, t) => {
|
|
10260
10261
|
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...i } = e, a = Zt(Yn, n), l = m.useRef(null), u = ze(t, l);
|
|
10261
10262
|
return Ca(), /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
@@ -10274,7 +10275,7 @@ var Bb = m.forwardRef(
|
|
|
10274
10275
|
id: a.contentId,
|
|
10275
10276
|
"aria-describedby": a.descriptionId,
|
|
10276
10277
|
"aria-labelledby": a.titleId,
|
|
10277
|
-
"data-state":
|
|
10278
|
+
"data-state": ka(a.open),
|
|
10278
10279
|
...i,
|
|
10279
10280
|
ref: u,
|
|
10280
10281
|
onDismiss: () => a.onOpenChange(!1)
|
|
@@ -10288,17 +10289,17 @@ var Bb = m.forwardRef(
|
|
|
10288
10289
|
] })
|
|
10289
10290
|
] });
|
|
10290
10291
|
}
|
|
10291
|
-
),
|
|
10292
|
+
), Ea = "DialogTitle", Id = m.forwardRef(
|
|
10292
10293
|
(e, t) => {
|
|
10293
|
-
const { __scopeDialog: n, ...r } = e, o = Zt(
|
|
10294
|
-
return /* @__PURE__ */ c.jsx(
|
|
10294
|
+
const { __scopeDialog: n, ...r } = e, o = Zt(Ea, n);
|
|
10295
|
+
return /* @__PURE__ */ c.jsx(ke.h2, { id: o.titleId, ...r, ref: t });
|
|
10295
10296
|
}
|
|
10296
10297
|
);
|
|
10297
|
-
Id.displayName =
|
|
10298
|
+
Id.displayName = Ea;
|
|
10298
10299
|
var Nd = "DialogDescription", Ad = m.forwardRef(
|
|
10299
10300
|
(e, t) => {
|
|
10300
10301
|
const { __scopeDialog: n, ...r } = e, o = Zt(Nd, n);
|
|
10301
|
-
return /* @__PURE__ */ c.jsx(
|
|
10302
|
+
return /* @__PURE__ */ c.jsx(ke.p, { id: o.descriptionId, ...r, ref: t });
|
|
10302
10303
|
}
|
|
10303
10304
|
);
|
|
10304
10305
|
Ad.displayName = Nd;
|
|
@@ -10306,7 +10307,7 @@ var _d = "DialogClose", jd = m.forwardRef(
|
|
|
10306
10307
|
(e, t) => {
|
|
10307
10308
|
const { __scopeDialog: n, ...r } = e, o = Zt(_d, n);
|
|
10308
10309
|
return /* @__PURE__ */ c.jsx(
|
|
10309
|
-
|
|
10310
|
+
ke.button,
|
|
10310
10311
|
{
|
|
10311
10312
|
type: "button",
|
|
10312
10313
|
...r,
|
|
@@ -10317,12 +10318,12 @@ var _d = "DialogClose", jd = m.forwardRef(
|
|
|
10317
10318
|
}
|
|
10318
10319
|
);
|
|
10319
10320
|
jd.displayName = _d;
|
|
10320
|
-
function
|
|
10321
|
+
function ka(e) {
|
|
10321
10322
|
return e ? "open" : "closed";
|
|
10322
10323
|
}
|
|
10323
10324
|
var Pd = "DialogTitleWarning", [KT, Od] = Xv(Pd, {
|
|
10324
10325
|
contentName: Yn,
|
|
10325
|
-
titleName:
|
|
10326
|
+
titleName: Ea,
|
|
10326
10327
|
docsSlug: "dialog"
|
|
10327
10328
|
}), Ub = ({ titleId: e }) => {
|
|
10328
10329
|
const t = Od(Pd), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
@@ -10340,7 +10341,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
10340
10341
|
const o = (s = e.current) == null ? void 0 : s.getAttribute("aria-describedby");
|
|
10341
10342
|
t && o && (document.getElementById(t) || console.warn(r));
|
|
10342
10343
|
}, [r, e, t]), null;
|
|
10343
|
-
}, Md = bd, Kb = Sd, Dd = Td, ys = Rd, Ss =
|
|
10344
|
+
}, Md = bd, Kb = Sd, Dd = Td, ys = Rd, Ss = Ed, Wn = Id, Cs = Ad, Ld = jd;
|
|
10344
10345
|
const qb = Md, Gb = Dd, $d = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
10345
10346
|
ys,
|
|
10346
10347
|
{
|
|
@@ -10746,7 +10747,7 @@ const oy = V.memo(function({
|
|
|
10746
10747
|
onCancelEdit: g,
|
|
10747
10748
|
onCopy: x
|
|
10748
10749
|
}) {
|
|
10749
|
-
const [y, S] = xe(!1), [R, C] = xe("collapsed"), [T,
|
|
10750
|
+
const [y, S] = xe(!1), [R, C] = xe("collapsed"), [T, E] = xe(!1), { currentThreadId: I } = ra(), { handleInterrupt: A } = hu(), { toast: _ } = Sa(), [D, L] = xe({}), [W, P] = xe(!1), [Y, K] = xe(null), J = l === "phone" || l === "half-screen", z = t.role, $ = z === "tool", F = !(r && z !== "user"), B = V.useMemo(() => {
|
|
10750
10751
|
switch (z) {
|
|
10751
10752
|
case "user":
|
|
10752
10753
|
return "text-[hsl(var(--chat-bubble-user-text))]";
|
|
@@ -10918,7 +10919,7 @@ const oy = V.memo(function({
|
|
|
10918
10919
|
}, [A]), et = V.useCallback(({ part: ne, i: ae }) => {
|
|
10919
10920
|
if (ne.type === "text") {
|
|
10920
10921
|
const de = ne.text ?? "", Ne = de.trim(), he = pc(Ne);
|
|
10921
|
-
return he && z !== "tool" ? /* @__PURE__ */ c.jsx(sy, { data: he }, ae) : z === "user" && f && Ne.length > h ? /* @__PURE__ */ c.jsxs(Vl, { open: T, onOpenChange:
|
|
10922
|
+
return he && z !== "tool" ? /* @__PURE__ */ c.jsx(sy, { data: he }, ae) : z === "user" && f && Ne.length > h ? /* @__PURE__ */ c.jsxs(Vl, { open: T, onOpenChange: E, children: [
|
|
10922
10923
|
/* @__PURE__ */ c.jsx("div", { className: te("text-sm text-[hsl(var(--chat-bubble-user-text))]", J && "text-xs"), children: T ? /* @__PURE__ */ c.jsx(Ql, { content: Ne, allowHtml: !1 }) : /* @__PURE__ */ c.jsxs("pre", { className: te("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", J && "text-xs"), children: [
|
|
10923
10924
|
Ne.substring(0, h),
|
|
10924
10925
|
"..."
|
|
@@ -11393,8 +11394,8 @@ const gc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Wd = V.forwa
|
|
|
11393
11394
|
onScrollAway: g,
|
|
11394
11395
|
onAtBottom: x
|
|
11395
11396
|
}, y) => {
|
|
11396
|
-
const S = Ge(null), R = Ge(null), C = Ge(!1), [T,
|
|
11397
|
-
|
|
11397
|
+
const S = Ge(null), R = Ge(null), C = Ge(!1), [T, E] = xe(!0), I = Me((D) => {
|
|
11398
|
+
E(D), g && g(!D), x && x(D);
|
|
11398
11399
|
}, [g, x]), A = at(() => {
|
|
11399
11400
|
if (a)
|
|
11400
11401
|
return async () => {
|
|
@@ -11536,7 +11537,7 @@ function Ia(e) {
|
|
|
11536
11537
|
if (!y) return [];
|
|
11537
11538
|
const S = Array.from(y.querySelectorAll(`[${f}]`));
|
|
11538
11539
|
return Array.from(g.itemMap.values()).sort(
|
|
11539
|
-
(T,
|
|
11540
|
+
(T, E) => S.indexOf(T.ref.current) - S.indexOf(E.ref.current)
|
|
11540
11541
|
);
|
|
11541
11542
|
}, [g.collectionRef, g.itemMap]);
|
|
11542
11543
|
}
|
|
@@ -11551,7 +11552,7 @@ function Ts(e) {
|
|
|
11551
11552
|
const t = m.useContext(hy);
|
|
11552
11553
|
return e || t || "ltr";
|
|
11553
11554
|
}
|
|
11554
|
-
const py = ["top", "right", "bottom", "left"],
|
|
11555
|
+
const py = ["top", "right", "bottom", "left"], kn = Math.min, At = Math.max, Vo = Math.round, wo = Math.floor, cn = (e) => ({
|
|
11555
11556
|
x: e,
|
|
11556
11557
|
y: e
|
|
11557
11558
|
}), my = {
|
|
@@ -11564,7 +11565,7 @@ const py = ["top", "right", "bottom", "left"], En = Math.min, At = Math.max, Vo
|
|
|
11564
11565
|
end: "start"
|
|
11565
11566
|
};
|
|
11566
11567
|
function $i(e, t, n) {
|
|
11567
|
-
return At(e,
|
|
11568
|
+
return At(e, kn(t, n));
|
|
11568
11569
|
}
|
|
11569
11570
|
function xn(e, t) {
|
|
11570
11571
|
return typeof e == "function" ? e(t) : e;
|
|
@@ -11572,7 +11573,7 @@ function xn(e, t) {
|
|
|
11572
11573
|
function vn(e) {
|
|
11573
11574
|
return e.split("-")[0];
|
|
11574
11575
|
}
|
|
11575
|
-
function
|
|
11576
|
+
function Er(e) {
|
|
11576
11577
|
return e.split("-")[1];
|
|
11577
11578
|
}
|
|
11578
11579
|
function Na(e) {
|
|
@@ -11590,7 +11591,7 @@ function _a(e) {
|
|
|
11590
11591
|
}
|
|
11591
11592
|
function vy(e, t, n) {
|
|
11592
11593
|
n === void 0 && (n = !1);
|
|
11593
|
-
const r =
|
|
11594
|
+
const r = Er(e), o = _a(e), s = Aa(o);
|
|
11594
11595
|
let i = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
11595
11596
|
return t.reference[s] > t.floating[s] && (i = Ko(i)), [i, Ko(i)];
|
|
11596
11597
|
}
|
|
@@ -11615,7 +11616,7 @@ function Sy(e, t, n) {
|
|
|
11615
11616
|
}
|
|
11616
11617
|
}
|
|
11617
11618
|
function Cy(e, t, n, r) {
|
|
11618
|
-
const o =
|
|
11619
|
+
const o = Er(e);
|
|
11619
11620
|
let s = Sy(vn(e), n === "start", r);
|
|
11620
11621
|
return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map(Fi)))), s;
|
|
11621
11622
|
}
|
|
@@ -11695,7 +11696,7 @@ function wc(e, t, n) {
|
|
|
11695
11696
|
y: r.y
|
|
11696
11697
|
};
|
|
11697
11698
|
}
|
|
11698
|
-
switch (
|
|
11699
|
+
switch (Er(t)) {
|
|
11699
11700
|
case "start":
|
|
11700
11701
|
p[i] -= h * (n && u ? -1 : 1);
|
|
11701
11702
|
break;
|
|
@@ -11811,7 +11812,7 @@ async function qr(e, t) {
|
|
|
11811
11812
|
right: (C.right - x.right + w.right) / R.x
|
|
11812
11813
|
};
|
|
11813
11814
|
}
|
|
11814
|
-
const
|
|
11815
|
+
const Ey = (e) => ({
|
|
11815
11816
|
name: "arrow",
|
|
11816
11817
|
options: e,
|
|
11817
11818
|
async fn(t) {
|
|
@@ -11833,9 +11834,9 @@ const ky = (e) => ({
|
|
|
11833
11834
|
x: n,
|
|
11834
11835
|
y: r
|
|
11835
11836
|
}, p = _a(o), w = Aa(p), v = await i.getDimensions(u), g = p === "y", x = g ? "top" : "left", y = g ? "bottom" : "right", S = g ? "clientHeight" : "clientWidth", R = s.reference[w] + s.reference[p] - h[p] - s.floating[w], C = h[p] - s.reference[p], T = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
|
|
11836
|
-
let
|
|
11837
|
-
(!
|
|
11838
|
-
const I = R / 2 - C / 2, A =
|
|
11837
|
+
let E = T ? T[S] : 0;
|
|
11838
|
+
(!E || !await (i.isElement == null ? void 0 : i.isElement(T))) && (E = a.floating[S] || s.floating[w]);
|
|
11839
|
+
const I = R / 2 - C / 2, A = E / 2 - v[w] / 2 - 1, _ = kn(f[x], A), D = kn(f[y], A), L = _, W = E - v[w] - D, P = E / 2 - v[w] / 2 + I, Y = $i(L, P, W), K = !l.arrow && Er(o) != null && P !== Y && s.reference[w] / 2 - (P < L ? _ : D) - v[w] / 2 < 0, J = K ? P < L ? P - L : P - W : 0;
|
|
11839
11840
|
return {
|
|
11840
11841
|
[p]: h[p] + J,
|
|
11841
11842
|
data: {
|
|
@@ -11848,7 +11849,7 @@ const ky = (e) => ({
|
|
|
11848
11849
|
reset: K
|
|
11849
11850
|
};
|
|
11850
11851
|
}
|
|
11851
|
-
}),
|
|
11852
|
+
}), ky = function(e) {
|
|
11852
11853
|
return e === void 0 && (e = {}), {
|
|
11853
11854
|
name: "flip",
|
|
11854
11855
|
options: e,
|
|
@@ -11874,7 +11875,7 @@ const ky = (e) => ({
|
|
|
11874
11875
|
return {};
|
|
11875
11876
|
const x = vn(o), y = an(a), S = vn(a) === a, R = await (l.isRTL == null ? void 0 : l.isRTL(u.floating)), C = h || (S || !v ? [Ko(a)] : wy(a)), T = w !== "none";
|
|
11876
11877
|
!h && T && C.push(...Cy(a, v, w, R));
|
|
11877
|
-
const
|
|
11878
|
+
const E = [a, ...C], I = await qr(t, g), A = [];
|
|
11878
11879
|
let _ = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
11879
11880
|
if (d && A.push(I[x]), f) {
|
|
11880
11881
|
const P = vy(o, i, R);
|
|
@@ -11885,7 +11886,7 @@ const ky = (e) => ({
|
|
|
11885
11886
|
overflows: A
|
|
11886
11887
|
}], !A.every((P) => P <= 0)) {
|
|
11887
11888
|
var D, L;
|
|
11888
|
-
const P = (((D = s.flip) == null ? void 0 : D.index) || 0) + 1, Y =
|
|
11889
|
+
const P = (((D = s.flip) == null ? void 0 : D.index) || 0) + 1, Y = E[P];
|
|
11889
11890
|
if (Y && (!(f === "alignment" ? y !== an(Y) : !1) || // We leave the current main axis only if every placement on that axis
|
|
11890
11891
|
// overflows the main axis.
|
|
11891
11892
|
_.every((z) => an(z.placement) === y ? z.overflows[0] > 0 : !0)))
|
|
@@ -11988,7 +11989,7 @@ async function Ny(e, t) {
|
|
|
11988
11989
|
placement: n,
|
|
11989
11990
|
platform: r,
|
|
11990
11991
|
elements: o
|
|
11991
|
-
} = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = vn(n), a =
|
|
11992
|
+
} = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = vn(n), a = Er(n), l = an(n) === "y", u = Kd.has(i) ? -1 : 1, d = s && l ? -1 : 1, f = xn(t, e);
|
|
11992
11993
|
let {
|
|
11993
11994
|
mainAxis: h,
|
|
11994
11995
|
crossAxis: p,
|
|
@@ -12145,22 +12146,22 @@ const Ay = function(e) {
|
|
|
12145
12146
|
apply: l = () => {
|
|
12146
12147
|
},
|
|
12147
12148
|
...u
|
|
12148
|
-
} = xn(e, t), d = await qr(t, u), f = vn(o), h =
|
|
12149
|
+
} = xn(e, t), d = await qr(t, u), f = vn(o), h = Er(o), p = an(o) === "y", {
|
|
12149
12150
|
width: w,
|
|
12150
12151
|
height: v
|
|
12151
12152
|
} = s.floating;
|
|
12152
12153
|
let g, x;
|
|
12153
12154
|
f === "top" || f === "bottom" ? (g = f, x = h === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (x = f, g = h === "end" ? "top" : "bottom");
|
|
12154
|
-
const y = v - d.top - d.bottom, S = w - d.left - d.right, R =
|
|
12155
|
-
let
|
|
12156
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (I = S), (r = t.middlewareData.shift) != null && r.enabled.y && (
|
|
12155
|
+
const y = v - d.top - d.bottom, S = w - d.left - d.right, R = kn(v - d[g], y), C = kn(w - d[x], S), T = !t.middlewareData.shift;
|
|
12156
|
+
let E = R, I = C;
|
|
12157
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (I = S), (r = t.middlewareData.shift) != null && r.enabled.y && (E = y), T && !h) {
|
|
12157
12158
|
const _ = At(d.left, 0), D = At(d.right, 0), L = At(d.top, 0), W = At(d.bottom, 0);
|
|
12158
|
-
p ? I = w - 2 * (_ !== 0 || D !== 0 ? _ + D : At(d.left, d.right)) :
|
|
12159
|
+
p ? I = w - 2 * (_ !== 0 || D !== 0 ? _ + D : At(d.left, d.right)) : E = v - 2 * (L !== 0 || W !== 0 ? L + W : At(d.top, d.bottom));
|
|
12159
12160
|
}
|
|
12160
12161
|
await l({
|
|
12161
12162
|
...t,
|
|
12162
12163
|
availableWidth: I,
|
|
12163
|
-
availableHeight:
|
|
12164
|
+
availableHeight: E
|
|
12164
12165
|
});
|
|
12165
12166
|
const A = await i.getDimensions(a.floating);
|
|
12166
12167
|
return w !== A.width || v !== A.height ? {
|
|
@@ -12174,7 +12175,7 @@ const Ay = function(e) {
|
|
|
12174
12175
|
function Rs() {
|
|
12175
12176
|
return typeof window < "u";
|
|
12176
12177
|
}
|
|
12177
|
-
function
|
|
12178
|
+
function kr(e) {
|
|
12178
12179
|
return qd(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
12179
12180
|
}
|
|
12180
12181
|
function Pt(e) {
|
|
@@ -12209,10 +12210,10 @@ function so(e) {
|
|
|
12209
12210
|
}
|
|
12210
12211
|
const My = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
12211
12212
|
function Dy(e) {
|
|
12212
|
-
return My.has(
|
|
12213
|
+
return My.has(kr(e));
|
|
12213
12214
|
}
|
|
12214
12215
|
const Ly = [":popover-open", ":modal"];
|
|
12215
|
-
function
|
|
12216
|
+
function Es(e) {
|
|
12216
12217
|
return Ly.some((t) => {
|
|
12217
12218
|
try {
|
|
12218
12219
|
return e.matches(t);
|
|
@@ -12231,7 +12232,7 @@ function By(e) {
|
|
|
12231
12232
|
for (; un(t) && !br(t); ) {
|
|
12232
12233
|
if (ja(t))
|
|
12233
12234
|
return t;
|
|
12234
|
-
if (
|
|
12235
|
+
if (Es(t))
|
|
12235
12236
|
return null;
|
|
12236
12237
|
t = In(t);
|
|
12237
12238
|
}
|
|
@@ -12242,12 +12243,12 @@ function Pa() {
|
|
|
12242
12243
|
}
|
|
12243
12244
|
const Hy = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
12244
12245
|
function br(e) {
|
|
12245
|
-
return Hy.has(
|
|
12246
|
+
return Hy.has(kr(e));
|
|
12246
12247
|
}
|
|
12247
12248
|
function Xt(e) {
|
|
12248
12249
|
return Pt(e).getComputedStyle(e);
|
|
12249
12250
|
}
|
|
12250
|
-
function
|
|
12251
|
+
function ks(e) {
|
|
12251
12252
|
return Yt(e) ? {
|
|
12252
12253
|
scrollLeft: e.scrollLeft,
|
|
12253
12254
|
scrollTop: e.scrollTop
|
|
@@ -12257,7 +12258,7 @@ function Es(e) {
|
|
|
12257
12258
|
};
|
|
12258
12259
|
}
|
|
12259
12260
|
function In(e) {
|
|
12260
|
-
if (
|
|
12261
|
+
if (kr(e) === "html")
|
|
12261
12262
|
return e;
|
|
12262
12263
|
const t = (
|
|
12263
12264
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
@@ -12347,7 +12348,7 @@ function Xn(e, t, n, r) {
|
|
|
12347
12348
|
});
|
|
12348
12349
|
}
|
|
12349
12350
|
function Is(e, t) {
|
|
12350
|
-
const n =
|
|
12351
|
+
const n = ks(e).scrollLeft;
|
|
12351
12352
|
return t ? t.left + n : Xn(hn(e)).left + n;
|
|
12352
12353
|
}
|
|
12353
12354
|
function Jd(e, t) {
|
|
@@ -12364,7 +12365,7 @@ function Vy(e) {
|
|
|
12364
12365
|
offsetParent: r,
|
|
12365
12366
|
strategy: o
|
|
12366
12367
|
} = e;
|
|
12367
|
-
const s = o === "fixed", i = hn(r), a = t ?
|
|
12368
|
+
const s = o === "fixed", i = hn(r), a = t ? Es(t.floating) : !1;
|
|
12368
12369
|
if (r === i || a && s)
|
|
12369
12370
|
return n;
|
|
12370
12371
|
let l = {
|
|
@@ -12372,7 +12373,7 @@ function Vy(e) {
|
|
|
12372
12373
|
scrollTop: 0
|
|
12373
12374
|
}, u = cn(1);
|
|
12374
12375
|
const d = cn(0), f = un(r);
|
|
12375
|
-
if ((f || !f && !s) && ((
|
|
12376
|
+
if ((f || !f && !s) && ((kr(r) !== "body" || so(i)) && (l = ks(r)), un(r))) {
|
|
12376
12377
|
const p = Xn(r);
|
|
12377
12378
|
u = gr(r), d.x = p.x + r.clientLeft, d.y = p.y + r.clientTop;
|
|
12378
12379
|
}
|
|
@@ -12388,7 +12389,7 @@ function Ky(e) {
|
|
|
12388
12389
|
return Array.from(e.getClientRects());
|
|
12389
12390
|
}
|
|
12390
12391
|
function qy(e) {
|
|
12391
|
-
const t = hn(e), n =
|
|
12392
|
+
const t = hn(e), n = ks(e), r = e.ownerDocument.body, o = At(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = At(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
|
|
12392
12393
|
let i = -n.scrollLeft + Is(e);
|
|
12393
12394
|
const a = -n.scrollTop;
|
|
12394
12395
|
return Xt(r).direction === "rtl" && (i += At(t.clientWidth, r.clientWidth) - o), {
|
|
@@ -12456,7 +12457,7 @@ function Jy(e, t) {
|
|
|
12456
12457
|
const n = t.get(e);
|
|
12457
12458
|
if (n)
|
|
12458
12459
|
return n;
|
|
12459
|
-
let r = Gr(e, [], !1).filter((a) => Yt(a) &&
|
|
12460
|
+
let r = Gr(e, [], !1).filter((a) => Yt(a) && kr(a) !== "body"), o = null;
|
|
12460
12461
|
const s = Xt(e).position === "fixed";
|
|
12461
12462
|
let i = s ? In(e) : e;
|
|
12462
12463
|
for (; Yt(i) && !br(i); ) {
|
|
@@ -12472,9 +12473,9 @@ function Zy(e) {
|
|
|
12472
12473
|
rootBoundary: r,
|
|
12473
12474
|
strategy: o
|
|
12474
12475
|
} = e;
|
|
12475
|
-
const i = [...n === "clippingAncestors" ?
|
|
12476
|
+
const i = [...n === "clippingAncestors" ? Es(t) ? [] : Jy(t, this._c) : [].concat(n), r], a = i[0], l = i.reduce((u, d) => {
|
|
12476
12477
|
const f = Tc(t, d, o);
|
|
12477
|
-
return u.top = At(f.top, u.top), u.right =
|
|
12478
|
+
return u.top = At(f.top, u.top), u.right = kn(f.right, u.right), u.bottom = kn(f.bottom, u.bottom), u.left = At(f.left, u.left), u;
|
|
12478
12479
|
}, Tc(t, a, o));
|
|
12479
12480
|
return {
|
|
12480
12481
|
width: l.right - l.left,
|
|
@@ -12504,7 +12505,7 @@ function e0(e, t, n) {
|
|
|
12504
12505
|
l.x = Is(o);
|
|
12505
12506
|
}
|
|
12506
12507
|
if (r || !r && !s)
|
|
12507
|
-
if ((
|
|
12508
|
+
if ((kr(t) !== "body" || so(o)) && (a = ks(t)), r) {
|
|
12508
12509
|
const p = Xn(t, !0, s, t);
|
|
12509
12510
|
l.x = p.x + t.clientLeft, l.y = p.y + t.clientTop;
|
|
12510
12511
|
} else o && u();
|
|
@@ -12530,7 +12531,7 @@ function Rc(e, t) {
|
|
|
12530
12531
|
}
|
|
12531
12532
|
function Qd(e, t) {
|
|
12532
12533
|
const n = Pt(e);
|
|
12533
|
-
if (
|
|
12534
|
+
if (Es(e))
|
|
12534
12535
|
return n;
|
|
12535
12536
|
if (!un(e)) {
|
|
12536
12537
|
let o = In(e);
|
|
@@ -12595,19 +12596,19 @@ function o0(e, t) {
|
|
|
12595
12596
|
return;
|
|
12596
12597
|
const w = wo(f), v = wo(o.clientWidth - (d + h)), g = wo(o.clientHeight - (f + p)), x = wo(d), S = {
|
|
12597
12598
|
rootMargin: -w + "px " + -v + "px " + -g + "px " + -x + "px",
|
|
12598
|
-
threshold: At(0,
|
|
12599
|
+
threshold: At(0, kn(1, l)) || 1
|
|
12599
12600
|
};
|
|
12600
12601
|
let R = !0;
|
|
12601
12602
|
function C(T) {
|
|
12602
|
-
const
|
|
12603
|
-
if (
|
|
12603
|
+
const E = T[0].intersectionRatio;
|
|
12604
|
+
if (E !== l) {
|
|
12604
12605
|
if (!R)
|
|
12605
12606
|
return i();
|
|
12606
|
-
|
|
12607
|
+
E ? i(!1, E) : r = setTimeout(() => {
|
|
12607
12608
|
i(!1, 1e-7);
|
|
12608
12609
|
}, 1e3);
|
|
12609
12610
|
}
|
|
12610
|
-
|
|
12611
|
+
E === 1 && !ef(u, e.getBoundingClientRect()) && i(), R = !1;
|
|
12611
12612
|
}
|
|
12612
12613
|
try {
|
|
12613
12614
|
n = new IntersectionObserver(C, {
|
|
@@ -12658,7 +12659,7 @@ function s0(e, t, n, r) {
|
|
|
12658
12659
|
}), f == null || f(), (x = p) == null || x.disconnect(), p = null, l && cancelAnimationFrame(w);
|
|
12659
12660
|
};
|
|
12660
12661
|
}
|
|
12661
|
-
const i0 = Ay, a0 = _y, l0 =
|
|
12662
|
+
const i0 = Ay, a0 = _y, l0 = ky, c0 = Py, u0 = Iy, Ec = Ey, d0 = jy, f0 = (e, t, n) => {
|
|
12662
12663
|
const r = /* @__PURE__ */ new Map(), o = {
|
|
12663
12664
|
platform: r0,
|
|
12664
12665
|
...n
|
|
@@ -12706,7 +12707,7 @@ function Go(e, t) {
|
|
|
12706
12707
|
function tf(e) {
|
|
12707
12708
|
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
12708
12709
|
}
|
|
12709
|
-
function
|
|
12710
|
+
function kc(e, t) {
|
|
12710
12711
|
const n = tf(e);
|
|
12711
12712
|
return Math.round(t * n) / n;
|
|
12712
12713
|
}
|
|
@@ -12742,16 +12743,16 @@ function m0(e) {
|
|
|
12742
12743
|
const [w, v] = m.useState(null), [g, x] = m.useState(null), y = m.useCallback((z) => {
|
|
12743
12744
|
z !== T.current && (T.current = z, v(z));
|
|
12744
12745
|
}, []), S = m.useCallback((z) => {
|
|
12745
|
-
z !==
|
|
12746
|
-
}, []), R = s || w, C = i || g, T = m.useRef(null),
|
|
12747
|
-
if (!T.current || !
|
|
12746
|
+
z !== E.current && (E.current = z, x(z));
|
|
12747
|
+
}, []), R = s || w, C = i || g, T = m.useRef(null), E = m.useRef(null), I = m.useRef(d), A = l != null, _ = hi(l), D = hi(o), L = hi(u), W = m.useCallback(() => {
|
|
12748
|
+
if (!T.current || !E.current)
|
|
12748
12749
|
return;
|
|
12749
12750
|
const z = {
|
|
12750
12751
|
placement: t,
|
|
12751
12752
|
strategy: n,
|
|
12752
12753
|
middleware: h
|
|
12753
12754
|
};
|
|
12754
|
-
D.current && (z.platform = D.current), f0(T.current,
|
|
12755
|
+
D.current && (z.platform = D.current), f0(T.current, E.current, z).then(($) => {
|
|
12755
12756
|
const F = {
|
|
12756
12757
|
...$,
|
|
12757
12758
|
// The floating element's position may be recomputed while it's closed
|
|
@@ -12775,7 +12776,7 @@ function m0(e) {
|
|
|
12775
12776
|
Mo(() => (P.current = !0, () => {
|
|
12776
12777
|
P.current = !1;
|
|
12777
12778
|
}), []), Mo(() => {
|
|
12778
|
-
if (R && (T.current = R), C && (
|
|
12779
|
+
if (R && (T.current = R), C && (E.current = C), R && C) {
|
|
12779
12780
|
if (_.current)
|
|
12780
12781
|
return _.current(R, C, W);
|
|
12781
12782
|
W();
|
|
@@ -12783,7 +12784,7 @@ function m0(e) {
|
|
|
12783
12784
|
}, [R, C, W, _, A]);
|
|
12784
12785
|
const Y = m.useMemo(() => ({
|
|
12785
12786
|
reference: T,
|
|
12786
|
-
floating:
|
|
12787
|
+
floating: E,
|
|
12787
12788
|
setReference: y,
|
|
12788
12789
|
setFloating: S
|
|
12789
12790
|
}), [y, S]), K = m.useMemo(() => ({
|
|
@@ -12797,7 +12798,7 @@ function m0(e) {
|
|
|
12797
12798
|
};
|
|
12798
12799
|
if (!K.floating)
|
|
12799
12800
|
return z;
|
|
12800
|
-
const $ =
|
|
12801
|
+
const $ = kc(K.floating, d.x), F = kc(K.floating, d.y);
|
|
12801
12802
|
return a ? {
|
|
12802
12803
|
...z,
|
|
12803
12804
|
transform: "translate(" + $ + "px, " + F + "px)",
|
|
@@ -12830,10 +12831,10 @@ const g0 = (e) => {
|
|
|
12830
12831
|
element: r,
|
|
12831
12832
|
padding: o
|
|
12832
12833
|
} = typeof e == "function" ? e(n) : e;
|
|
12833
|
-
return r && t(r) ? r.current != null ?
|
|
12834
|
+
return r && t(r) ? r.current != null ? Ec({
|
|
12834
12835
|
element: r.current,
|
|
12835
12836
|
padding: o
|
|
12836
|
-
}).fn(n) : {} : r ?
|
|
12837
|
+
}).fn(n) : {} : r ? Ec({
|
|
12837
12838
|
element: r,
|
|
12838
12839
|
padding: o
|
|
12839
12840
|
}).fn(n) : {};
|
|
@@ -12864,7 +12865,7 @@ const g0 = (e) => {
|
|
|
12864
12865
|
var T0 = "Arrow", nf = m.forwardRef((e, t) => {
|
|
12865
12866
|
const { children: n, width: r = 10, height: o = 5, ...s } = e;
|
|
12866
12867
|
return /* @__PURE__ */ c.jsx(
|
|
12867
|
-
|
|
12868
|
+
ke.svg,
|
|
12868
12869
|
{
|
|
12869
12870
|
...s,
|
|
12870
12871
|
ref: t,
|
|
@@ -12900,9 +12901,9 @@ function rf(e) {
|
|
|
12900
12901
|
n(void 0);
|
|
12901
12902
|
}, [e]), t;
|
|
12902
12903
|
}
|
|
12903
|
-
var Ma = "Popper", [of, Ns] = fn(Ma), [
|
|
12904
|
+
var Ma = "Popper", [of, Ns] = fn(Ma), [E0, sf] = of(Ma), af = (e) => {
|
|
12904
12905
|
const { __scopePopper: t, children: n } = e, [r, o] = m.useState(null);
|
|
12905
|
-
return /* @__PURE__ */ c.jsx(
|
|
12906
|
+
return /* @__PURE__ */ c.jsx(E0, { scope: t, anchor: r, onAnchorChange: o, children: n });
|
|
12906
12907
|
};
|
|
12907
12908
|
af.displayName = Ma;
|
|
12908
12909
|
var lf = "PopperAnchor", cf = m.forwardRef(
|
|
@@ -12911,11 +12912,11 @@ var lf = "PopperAnchor", cf = m.forwardRef(
|
|
|
12911
12912
|
return m.useEffect(() => {
|
|
12912
12913
|
const u = l.current;
|
|
12913
12914
|
l.current = (r == null ? void 0 : r.current) || i.current, u !== l.current && s.onAnchorChange(l.current);
|
|
12914
|
-
}), r ? null : /* @__PURE__ */ c.jsx(
|
|
12915
|
+
}), r ? null : /* @__PURE__ */ c.jsx(ke.div, { ...o, ref: a });
|
|
12915
12916
|
}
|
|
12916
12917
|
);
|
|
12917
12918
|
cf.displayName = lf;
|
|
12918
|
-
var Da = "PopperContent", [
|
|
12919
|
+
var Da = "PopperContent", [k0, I0] = of(Da), uf = m.forwardRef(
|
|
12919
12920
|
(e, t) => {
|
|
12920
12921
|
var G, O, Q, q, ce, ie;
|
|
12921
12922
|
const {
|
|
@@ -12933,7 +12934,7 @@ var Da = "PopperContent", [E0, I0] = of(Da), uf = m.forwardRef(
|
|
|
12933
12934
|
updatePositionStrategy: p = "optimized",
|
|
12934
12935
|
onPlaced: w,
|
|
12935
12936
|
...v
|
|
12936
|
-
} = e, g = sf(Da, n), [x, y] = m.useState(null), S = ze(t, ($e) => y($e)), [R, C] = m.useState(null), T = rf(R),
|
|
12937
|
+
} = e, g = sf(Da, n), [x, y] = m.useState(null), S = ze(t, ($e) => y($e)), [R, C] = m.useState(null), T = rf(R), E = (T == null ? void 0 : T.width) ?? 0, I = (T == null ? void 0 : T.height) ?? 0, A = r + (s !== "center" ? "-" + s : ""), _ = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, D = Array.isArray(u) ? u : [u], L = D.length > 0, W = {
|
|
12937
12938
|
padding: _,
|
|
12938
12939
|
boundary: D.filter(A0),
|
|
12939
12940
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
@@ -12965,7 +12966,7 @@ var Da = "PopperContent", [E0, I0] = of(Da), uf = m.forwardRef(
|
|
|
12965
12966
|
}
|
|
12966
12967
|
}),
|
|
12967
12968
|
R && C0({ element: R, padding: a }),
|
|
12968
|
-
_0({ arrowWidth:
|
|
12969
|
+
_0({ arrowWidth: E, arrowHeight: I }),
|
|
12969
12970
|
h && S0({ strategy: "referenceHidden", ...W })
|
|
12970
12971
|
]
|
|
12971
12972
|
}), [$, F] = hf(K), B = mt(w);
|
|
@@ -13000,7 +13001,7 @@ var Da = "PopperContent", [E0, I0] = of(Da), uf = m.forwardRef(
|
|
|
13000
13001
|
},
|
|
13001
13002
|
dir: e.dir,
|
|
13002
13003
|
children: /* @__PURE__ */ c.jsx(
|
|
13003
|
-
|
|
13004
|
+
k0,
|
|
13004
13005
|
{
|
|
13005
13006
|
scope: n,
|
|
13006
13007
|
placedSide: $,
|
|
@@ -13009,7 +13010,7 @@ var Da = "PopperContent", [E0, I0] = of(Da), uf = m.forwardRef(
|
|
|
13009
13010
|
arrowY: ue,
|
|
13010
13011
|
shouldHideArrow: ee,
|
|
13011
13012
|
children: /* @__PURE__ */ c.jsx(
|
|
13012
|
-
|
|
13013
|
+
ke.div,
|
|
13013
13014
|
{
|
|
13014
13015
|
"data-side": $,
|
|
13015
13016
|
"data-align": F,
|
|
@@ -13122,7 +13123,7 @@ var L0 = m.forwardRef((e, t) => {
|
|
|
13122
13123
|
defaultProp: a ?? null,
|
|
13123
13124
|
onChange: l,
|
|
13124
13125
|
caller: io
|
|
13125
|
-
}), [x, y] = m.useState(!1), S = mt(u), R = vf(n), C = m.useRef(!1), [T,
|
|
13126
|
+
}), [x, y] = m.useState(!1), S = mt(u), R = vf(n), C = m.useRef(!1), [T, E] = m.useState(0);
|
|
13126
13127
|
return m.useEffect(() => {
|
|
13127
13128
|
const I = h.current;
|
|
13128
13129
|
if (I)
|
|
@@ -13141,15 +13142,15 @@ var L0 = m.forwardRef((e, t) => {
|
|
|
13141
13142
|
),
|
|
13142
13143
|
onItemShiftTab: m.useCallback(() => y(!0), []),
|
|
13143
13144
|
onFocusableItemAdd: m.useCallback(
|
|
13144
|
-
() =>
|
|
13145
|
+
() => E((I) => I + 1),
|
|
13145
13146
|
[]
|
|
13146
13147
|
),
|
|
13147
13148
|
onFocusableItemRemove: m.useCallback(
|
|
13148
|
-
() =>
|
|
13149
|
+
() => E((I) => I - 1),
|
|
13149
13150
|
[]
|
|
13150
13151
|
),
|
|
13151
13152
|
children: /* @__PURE__ */ c.jsx(
|
|
13152
|
-
|
|
13153
|
+
ke.div,
|
|
13153
13154
|
{
|
|
13154
13155
|
tabIndex: x || T === 0 ? -1 : 0,
|
|
13155
13156
|
"data-orientation": r,
|
|
@@ -13198,7 +13199,7 @@ var L0 = m.forwardRef((e, t) => {
|
|
|
13198
13199
|
focusable: r,
|
|
13199
13200
|
active: o,
|
|
13200
13201
|
children: /* @__PURE__ */ c.jsx(
|
|
13201
|
-
|
|
13202
|
+
ke.span,
|
|
13202
13203
|
{
|
|
13203
13204
|
tabIndex: f ? 0 : -1,
|
|
13204
13205
|
"data-orientation": d.orientation,
|
|
@@ -13272,7 +13273,7 @@ var H0 = bf, U0 = Sf, Hi = ["Enter", " "], W0 = ["ArrowDown", "PageUp", "Home"],
|
|
|
13272
13273
|
Y0,
|
|
13273
13274
|
Ns,
|
|
13274
13275
|
wf
|
|
13275
|
-
]), As = Ns(),
|
|
13276
|
+
]), As = Ns(), Ef = wf(), [X0, rr] = nr(ao), [J0, lo] = nr(ao), kf = (e) => {
|
|
13276
13277
|
const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: i = !0 } = e, a = As(t), [l, u] = m.useState(null), d = m.useRef(!1), f = mt(s), h = Ts(o);
|
|
13277
13278
|
return m.useEffect(() => {
|
|
13278
13279
|
const p = () => {
|
|
@@ -13303,7 +13304,7 @@ var H0 = bf, U0 = Sf, Hi = ["Enter", " "], W0 = ["ArrowDown", "PageUp", "Home"],
|
|
|
13303
13304
|
}
|
|
13304
13305
|
) });
|
|
13305
13306
|
};
|
|
13306
|
-
|
|
13307
|
+
kf.displayName = ao;
|
|
13307
13308
|
var Z0 = "MenuAnchor", La = m.forwardRef(
|
|
13308
13309
|
(e, t) => {
|
|
13309
13310
|
const { __scopeMenu: n, ...r } = e, o = As(n);
|
|
@@ -13376,7 +13377,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
|
|
|
13376
13377
|
onDismiss: p,
|
|
13377
13378
|
disableOutsideScroll: w,
|
|
13378
13379
|
...v
|
|
13379
|
-
} = e, g = rr(Ht, n), x = lo(Ht, n), y = As(n), S =
|
|
13380
|
+
} = e, g = rr(Ht, n), x = lo(Ht, n), y = As(n), S = Ef(n), R = G0(n), [C, T] = m.useState(null), E = m.useRef(null), I = ze(t, E, g.onContentChange), A = m.useRef(0), _ = m.useRef(""), D = m.useRef(0), L = m.useRef(null), W = m.useRef("right"), P = m.useRef(0), Y = w ? ws : m.Fragment, K = w ? { as: rS, allowPinchZoom: !0 } : void 0, J = ($) => {
|
|
13380
13381
|
var G, O;
|
|
13381
13382
|
const F = _.current + $, B = R().filter((Q) => !Q.disabled), pe = document.activeElement, ue = (G = B.find((Q) => Q.ref.current === pe)) == null ? void 0 : G.textValue, ee = B.map((Q) => Q.textValue), Ie = mS(ee, F, ue), Ce = (O = B.find((Q) => Q.textValue === Ie)) == null ? void 0 : O.ref.current;
|
|
13382
13383
|
(function Q(q) {
|
|
@@ -13402,7 +13403,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
|
|
|
13402
13403
|
onItemLeave: m.useCallback(
|
|
13403
13404
|
($) => {
|
|
13404
13405
|
var F;
|
|
13405
|
-
z($) || ((F =
|
|
13406
|
+
z($) || ((F = E.current) == null || F.focus(), T(null));
|
|
13406
13407
|
},
|
|
13407
13408
|
[z]
|
|
13408
13409
|
),
|
|
@@ -13423,7 +13424,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
|
|
|
13423
13424
|
trapped: o,
|
|
13424
13425
|
onMountAutoFocus: le(s, ($) => {
|
|
13425
13426
|
var F;
|
|
13426
|
-
$.preventDefault(), (F =
|
|
13427
|
+
$.preventDefault(), (F = E.current) == null || F.focus({ preventScroll: !0 });
|
|
13427
13428
|
}),
|
|
13428
13429
|
onUnmountAutoFocus: i,
|
|
13429
13430
|
children: /* @__PURE__ */ c.jsx(
|
|
@@ -13465,7 +13466,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
|
|
|
13465
13466
|
onKeyDown: le(v.onKeyDown, ($) => {
|
|
13466
13467
|
const B = $.target.closest("[data-radix-menu-content]") === $.currentTarget, pe = $.ctrlKey || $.altKey || $.metaKey, ue = $.key.length === 1;
|
|
13467
13468
|
B && ($.key === "Tab" && $.preventDefault(), !pe && ue && J($.key));
|
|
13468
|
-
const ee =
|
|
13469
|
+
const ee = E.current;
|
|
13469
13470
|
if ($.target !== ee || !V0.includes($.key)) return;
|
|
13470
13471
|
$.preventDefault();
|
|
13471
13472
|
const Ce = R().filter((G) => !G.disabled).map((G) => G.ref.current);
|
|
@@ -13500,14 +13501,14 @@ Af.displayName = Ht;
|
|
|
13500
13501
|
var oS = "MenuGroup", Ba = m.forwardRef(
|
|
13501
13502
|
(e, t) => {
|
|
13502
13503
|
const { __scopeMenu: n, ...r } = e;
|
|
13503
|
-
return /* @__PURE__ */ c.jsx(
|
|
13504
|
+
return /* @__PURE__ */ c.jsx(ke.div, { role: "group", ...r, ref: t });
|
|
13504
13505
|
}
|
|
13505
13506
|
);
|
|
13506
13507
|
Ba.displayName = oS;
|
|
13507
13508
|
var sS = "MenuLabel", _f = m.forwardRef(
|
|
13508
13509
|
(e, t) => {
|
|
13509
13510
|
const { __scopeMenu: n, ...r } = e;
|
|
13510
|
-
return /* @__PURE__ */ c.jsx(
|
|
13511
|
+
return /* @__PURE__ */ c.jsx(ke.div, { ...r, ref: t });
|
|
13511
13512
|
}
|
|
13512
13513
|
);
|
|
13513
13514
|
_f.displayName = sS;
|
|
@@ -13546,7 +13547,7 @@ var Yo = "MenuItem", Ic = "menu.itemSelect", _s = m.forwardRef(
|
|
|
13546
13547
|
_s.displayName = Yo;
|
|
13547
13548
|
var jf = m.forwardRef(
|
|
13548
13549
|
(e, t) => {
|
|
13549
|
-
const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Fa(Yo, n), a =
|
|
13550
|
+
const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Fa(Yo, n), a = Ef(n), l = m.useRef(null), u = ze(t, l), [d, f] = m.useState(!1), [h, p] = m.useState("");
|
|
13550
13551
|
return m.useEffect(() => {
|
|
13551
13552
|
const w = l.current;
|
|
13552
13553
|
w && p((w.textContent ?? "").trim());
|
|
@@ -13557,7 +13558,7 @@ var jf = m.forwardRef(
|
|
|
13557
13558
|
disabled: r,
|
|
13558
13559
|
textValue: o ?? h,
|
|
13559
13560
|
children: /* @__PURE__ */ c.jsx(U0, { asChild: !0, ...a, focusable: !r, children: /* @__PURE__ */ c.jsx(
|
|
13560
|
-
|
|
13561
|
+
ke.div,
|
|
13561
13562
|
{
|
|
13562
13563
|
role: "menuitem",
|
|
13563
13564
|
"data-highlighted": d ? "" : void 0,
|
|
@@ -13649,7 +13650,7 @@ var Ha = "MenuItemIndicator", [$f, cS] = nr(
|
|
|
13649
13650
|
{
|
|
13650
13651
|
present: r || Xo(s.checked) || s.checked === !0,
|
|
13651
13652
|
children: /* @__PURE__ */ c.jsx(
|
|
13652
|
-
|
|
13653
|
+
ke.span,
|
|
13653
13654
|
{
|
|
13654
13655
|
...o,
|
|
13655
13656
|
ref: t,
|
|
@@ -13665,7 +13666,7 @@ var uS = "MenuSeparator", zf = m.forwardRef(
|
|
|
13665
13666
|
(e, t) => {
|
|
13666
13667
|
const { __scopeMenu: n, ...r } = e;
|
|
13667
13668
|
return /* @__PURE__ */ c.jsx(
|
|
13668
|
-
|
|
13669
|
+
ke.div,
|
|
13669
13670
|
{
|
|
13670
13671
|
role: "separator",
|
|
13671
13672
|
"aria-orientation": "horizontal",
|
|
@@ -13833,7 +13834,7 @@ function xS(e, t) {
|
|
|
13833
13834
|
function Xr(e) {
|
|
13834
13835
|
return (t) => t.pointerType === "mouse" ? e(t) : void 0;
|
|
13835
13836
|
}
|
|
13836
|
-
var vS =
|
|
13837
|
+
var vS = kf, wS = La, bS = Nf, yS = Af, SS = Ba, CS = _f, TS = _s, RS = Pf, ES = Mf, kS = Lf, IS = Ff, NS = zf, AS = Bf, _S = Uf, jS = Vf, js = "DropdownMenu", [PS, GT] = fn(
|
|
13837
13838
|
js,
|
|
13838
13839
|
[Rf]
|
|
13839
13840
|
), Tt = Rf(), [OS, qf] = PS(js), Gf = (e) => {
|
|
@@ -13871,7 +13872,7 @@ var Yf = "DropdownMenuTrigger", Xf = m.forwardRef(
|
|
|
13871
13872
|
(e, t) => {
|
|
13872
13873
|
const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = qf(Yf, n), i = Tt(n);
|
|
13873
13874
|
return /* @__PURE__ */ c.jsx(wS, { asChild: !0, ...i, children: /* @__PURE__ */ c.jsx(
|
|
13874
|
-
|
|
13875
|
+
ke.button,
|
|
13875
13876
|
{
|
|
13876
13877
|
type: "button",
|
|
13877
13878
|
id: s.triggerId,
|
|
@@ -13959,12 +13960,12 @@ var zS = "DropdownMenuCheckboxItem", nh = m.forwardRef((e, t) => {
|
|
|
13959
13960
|
nh.displayName = zS;
|
|
13960
13961
|
var BS = "DropdownMenuRadioGroup", HS = m.forwardRef((e, t) => {
|
|
13961
13962
|
const { __scopeDropdownMenu: n, ...r } = e, o = Tt(n);
|
|
13962
|
-
return /* @__PURE__ */ c.jsx(
|
|
13963
|
+
return /* @__PURE__ */ c.jsx(ES, { ...o, ...r, ref: t });
|
|
13963
13964
|
});
|
|
13964
13965
|
HS.displayName = BS;
|
|
13965
13966
|
var US = "DropdownMenuRadioItem", rh = m.forwardRef((e, t) => {
|
|
13966
13967
|
const { __scopeDropdownMenu: n, ...r } = e, o = Tt(n);
|
|
13967
|
-
return /* @__PURE__ */ c.jsx(
|
|
13968
|
+
return /* @__PURE__ */ c.jsx(kS, { ...o, ...r, ref: t });
|
|
13968
13969
|
});
|
|
13969
13970
|
rh.displayName = US;
|
|
13970
13971
|
var WS = "DropdownMenuItemIndicator", oh = m.forwardRef((e, t) => {
|
|
@@ -14146,7 +14147,7 @@ function mi({
|
|
|
14146
14147
|
messages: R,
|
|
14147
14148
|
hasMoreHistory: C,
|
|
14148
14149
|
isLoadingHistory: T,
|
|
14149
|
-
send:
|
|
14150
|
+
send: E,
|
|
14150
14151
|
stop: I,
|
|
14151
14152
|
loadOlderMessages: A
|
|
14152
14153
|
} = hu(), {
|
|
@@ -14181,11 +14182,11 @@ function mi({
|
|
|
14181
14182
|
}, Le = me.current;
|
|
14182
14183
|
if (!(Le && Le.threadId === ve.threadId && Le.checkpointId === ve.checkpointId && Le.checkpointNs === ve.checkpointNs))
|
|
14183
14184
|
return x(v).then((Xe) => {
|
|
14184
|
-
var
|
|
14185
|
+
var k;
|
|
14185
14186
|
if (re) return;
|
|
14186
14187
|
const xt = ((Xe == null ? void 0 : Xe.checkpoints) ?? []).slice().sort((b, N) => new Date(N.createdAt).getTime() - new Date(b.createdAt).getTime());
|
|
14187
14188
|
et(xt);
|
|
14188
|
-
const Vt = Fe, $n = Vt && xt.some((b) => b.checkpointId === Vt) ? Vt : ((
|
|
14189
|
+
const Vt = Fe, $n = Vt && xt.some((b) => b.checkpointId === Vt) ? Vt : ((k = xt[0]) == null ? void 0 : k.checkpointId) ?? null;
|
|
14189
14190
|
let ar = null;
|
|
14190
14191
|
if ($n) {
|
|
14191
14192
|
const b = xt.find((N) => N.checkpointId === $n);
|
|
@@ -14243,7 +14244,7 @@ function mi({
|
|
|
14243
14244
|
}
|
|
14244
14245
|
}
|
|
14245
14246
|
try {
|
|
14246
|
-
await
|
|
14247
|
+
await E(ve || "", {
|
|
14247
14248
|
checkpointId: Fe ?? W ?? void 0,
|
|
14248
14249
|
checkpointNs: ft ?? P ?? void 0,
|
|
14249
14250
|
payloadExtras: Y ? { edit: !0, originalMessageId: Y } : void 0,
|
|
@@ -14273,13 +14274,13 @@ function mi({
|
|
|
14273
14274
|
for (let Le = re - 1; Le >= 0; Le--)
|
|
14274
14275
|
if (R[Le].role === "user") {
|
|
14275
14276
|
const Xe = ve(R[Le]);
|
|
14276
|
-
Xe &&
|
|
14277
|
+
Xe && E(Xe, {
|
|
14277
14278
|
checkpointId: Fe ?? W ?? void 0,
|
|
14278
14279
|
checkpointNs: ft ?? P ?? void 0
|
|
14279
14280
|
});
|
|
14280
14281
|
break;
|
|
14281
14282
|
}
|
|
14282
|
-
}, [R,
|
|
14283
|
+
}, [R, E, Fe, ft, W, P]), Mn = (re) => {
|
|
14283
14284
|
const ve = Array.from(re.target.files || []);
|
|
14284
14285
|
pe((Le) => [...Le, ...ve]), re.target.value = "";
|
|
14285
14286
|
}, Mt = (re) => {
|
|
@@ -14292,7 +14293,7 @@ function mi({
|
|
|
14292
14293
|
if (ve) {
|
|
14293
14294
|
q(null), ie(null), O(!0);
|
|
14294
14295
|
try {
|
|
14295
|
-
await
|
|
14296
|
+
await E("", {
|
|
14296
14297
|
checkpointId: Fe ?? W ?? void 0,
|
|
14297
14298
|
checkpointNs: ft ?? P ?? void 0,
|
|
14298
14299
|
attachments: [ve]
|
|
@@ -14551,7 +14552,7 @@ var Wa = "ScrollArea", [vh, YT] = fn(Wa), [lC, Wt] = vh(Wa), wh = m.forwardRef(
|
|
|
14551
14552
|
dir: o,
|
|
14552
14553
|
scrollHideDelay: s = 600,
|
|
14553
14554
|
...i
|
|
14554
|
-
} = e, [a, l] = m.useState(null), [u, d] = m.useState(null), [f, h] = m.useState(null), [p, w] = m.useState(null), [v, g] = m.useState(null), [x, y] = m.useState(0), [S, R] = m.useState(0), [C, T] = m.useState(!1), [
|
|
14555
|
+
} = e, [a, l] = m.useState(null), [u, d] = m.useState(null), [f, h] = m.useState(null), [p, w] = m.useState(null), [v, g] = m.useState(null), [x, y] = m.useState(0), [S, R] = m.useState(0), [C, T] = m.useState(!1), [E, I] = m.useState(!1), A = ze(t, (D) => l(D)), _ = Ts(o);
|
|
14555
14556
|
return /* @__PURE__ */ c.jsx(
|
|
14556
14557
|
lC,
|
|
14557
14558
|
{
|
|
@@ -14570,12 +14571,12 @@ var Wa = "ScrollArea", [vh, YT] = fn(Wa), [lC, Wt] = vh(Wa), wh = m.forwardRef(
|
|
|
14570
14571
|
onScrollbarXEnabledChange: T,
|
|
14571
14572
|
scrollbarY: v,
|
|
14572
14573
|
onScrollbarYChange: g,
|
|
14573
|
-
scrollbarYEnabled:
|
|
14574
|
+
scrollbarYEnabled: E,
|
|
14574
14575
|
onScrollbarYEnabledChange: I,
|
|
14575
14576
|
onCornerWidthChange: y,
|
|
14576
14577
|
onCornerHeightChange: R,
|
|
14577
14578
|
children: /* @__PURE__ */ c.jsx(
|
|
14578
|
-
|
|
14579
|
+
ke.div,
|
|
14579
14580
|
{
|
|
14580
14581
|
dir: _,
|
|
14581
14582
|
...i,
|
|
@@ -14608,7 +14609,7 @@ var bh = "ScrollAreaViewport", yh = m.forwardRef(
|
|
|
14608
14609
|
}
|
|
14609
14610
|
),
|
|
14610
14611
|
/* @__PURE__ */ c.jsx(
|
|
14611
|
-
|
|
14612
|
+
ke.div,
|
|
14612
14613
|
{
|
|
14613
14614
|
"data-radix-scroll-area-viewport": "",
|
|
14614
14615
|
...s,
|
|
@@ -14732,7 +14733,7 @@ var cC = m.forwardRef((e, t) => {
|
|
|
14732
14733
|
content: 0,
|
|
14733
14734
|
viewport: 0,
|
|
14734
14735
|
scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
|
|
14735
|
-
}), u =
|
|
14736
|
+
}), u = kh(a.viewport, a.content), d = {
|
|
14736
14737
|
...r,
|
|
14737
14738
|
sizes: a,
|
|
14738
14739
|
onSizesChange: l,
|
|
@@ -14873,7 +14874,7 @@ var cC = m.forwardRef((e, t) => {
|
|
|
14873
14874
|
onWheelScroll: d,
|
|
14874
14875
|
onResize: f,
|
|
14875
14876
|
...h
|
|
14876
|
-
} = e, p = Wt(pn, n), [w, v] = m.useState(null), g = ze(t, (A) => v(A)), x = m.useRef(null), y = m.useRef(""), S = p.viewport, R = r.content - r.viewport, C = mt(d), T = mt(l),
|
|
14877
|
+
} = e, p = Wt(pn, n), [w, v] = m.useState(null), g = ze(t, (A) => v(A)), x = m.useRef(null), y = m.useRef(""), S = p.viewport, R = r.content - r.viewport, C = mt(d), T = mt(l), E = Os(f, 10);
|
|
14877
14878
|
function I(A) {
|
|
14878
14879
|
if (x.current) {
|
|
14879
14880
|
const _ = A.clientX - x.current.left, D = A.clientY - x.current.top;
|
|
@@ -14886,7 +14887,7 @@ var cC = m.forwardRef((e, t) => {
|
|
|
14886
14887
|
(w == null ? void 0 : w.contains(D)) && C(_, R);
|
|
14887
14888
|
};
|
|
14888
14889
|
return document.addEventListener("wheel", A, { passive: !1 }), () => document.removeEventListener("wheel", A, { passive: !1 });
|
|
14889
|
-
}, [S, w, R, C]), m.useEffect(T, [r, T]), yr(w,
|
|
14890
|
+
}, [S, w, R, C]), m.useEffect(T, [r, T]), yr(w, E), yr(p.content, E), /* @__PURE__ */ c.jsx(
|
|
14890
14891
|
hC,
|
|
14891
14892
|
{
|
|
14892
14893
|
scope: n,
|
|
@@ -14897,7 +14898,7 @@ var cC = m.forwardRef((e, t) => {
|
|
|
14897
14898
|
onThumbPositionChange: T,
|
|
14898
14899
|
onThumbPointerDown: mt(a),
|
|
14899
14900
|
children: /* @__PURE__ */ c.jsx(
|
|
14900
|
-
|
|
14901
|
+
ke.div,
|
|
14901
14902
|
{
|
|
14902
14903
|
...h,
|
|
14903
14904
|
ref: g,
|
|
@@ -14939,7 +14940,7 @@ var cC = m.forwardRef((e, t) => {
|
|
|
14939
14940
|
return a(), f.addEventListener("scroll", h), () => f.removeEventListener("scroll", h);
|
|
14940
14941
|
}
|
|
14941
14942
|
}, [s.viewport, d, a]), /* @__PURE__ */ c.jsx(
|
|
14942
|
-
|
|
14943
|
+
ke.div,
|
|
14943
14944
|
{
|
|
14944
14945
|
"data-state": i.hasThumb ? "visible" : "hidden",
|
|
14945
14946
|
...o,
|
|
@@ -14959,13 +14960,13 @@ var cC = m.forwardRef((e, t) => {
|
|
|
14959
14960
|
}
|
|
14960
14961
|
);
|
|
14961
14962
|
Rh.displayName = Zo;
|
|
14962
|
-
var qa = "ScrollAreaCorner",
|
|
14963
|
+
var qa = "ScrollAreaCorner", Eh = m.forwardRef(
|
|
14963
14964
|
(e, t) => {
|
|
14964
14965
|
const n = Wt(qa, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
|
|
14965
14966
|
return n.type !== "scroll" && r ? /* @__PURE__ */ c.jsx(mC, { ...e, ref: t }) : null;
|
|
14966
14967
|
}
|
|
14967
14968
|
);
|
|
14968
|
-
|
|
14969
|
+
Eh.displayName = qa;
|
|
14969
14970
|
var mC = m.forwardRef((e, t) => {
|
|
14970
14971
|
const { __scopeScrollArea: n, ...r } = e, o = Wt(qa, n), [s, i] = m.useState(0), [a, l] = m.useState(0), u = !!(s && a);
|
|
14971
14972
|
return yr(o.scrollbarX, () => {
|
|
@@ -14977,7 +14978,7 @@ var mC = m.forwardRef((e, t) => {
|
|
|
14977
14978
|
const d = ((f = o.scrollbarY) == null ? void 0 : f.offsetWidth) || 0;
|
|
14978
14979
|
o.onCornerWidthChange(d), i(d);
|
|
14979
14980
|
}), u ? /* @__PURE__ */ c.jsx(
|
|
14980
|
-
|
|
14981
|
+
ke.div,
|
|
14981
14982
|
{
|
|
14982
14983
|
...r,
|
|
14983
14984
|
ref: t,
|
|
@@ -14996,12 +14997,12 @@ var mC = m.forwardRef((e, t) => {
|
|
|
14996
14997
|
function Qo(e) {
|
|
14997
14998
|
return e ? parseInt(e, 10) : 0;
|
|
14998
14999
|
}
|
|
14999
|
-
function
|
|
15000
|
+
function kh(e, t) {
|
|
15000
15001
|
const n = e / t;
|
|
15001
15002
|
return isNaN(n) ? 0 : n;
|
|
15002
15003
|
}
|
|
15003
15004
|
function Ps(e) {
|
|
15004
|
-
const t =
|
|
15005
|
+
const t = kh(e.viewport, e.content), n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, r = (e.scrollbar.size - n) * t;
|
|
15005
15006
|
return Math.max(r, 18);
|
|
15006
15007
|
}
|
|
15007
15008
|
function gC(e, t, n, r = "ltr") {
|
|
@@ -15050,7 +15051,7 @@ function yr(e, t) {
|
|
|
15050
15051
|
}
|
|
15051
15052
|
}, [e, n]);
|
|
15052
15053
|
}
|
|
15053
|
-
var Ah = wh, vC = yh, wC =
|
|
15054
|
+
var Ah = wh, vC = yh, wC = Eh;
|
|
15054
15055
|
const _h = m.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ c.jsxs(
|
|
15055
15056
|
Ah,
|
|
15056
15057
|
{
|
|
@@ -15102,7 +15103,7 @@ function Ac({
|
|
|
15102
15103
|
deleteThread: v,
|
|
15103
15104
|
renameThread: g,
|
|
15104
15105
|
isLoadingThreads: x
|
|
15105
|
-
} = ra(), [y, S] = xe(Array.isArray(h) ? h : []), R = Ge(y.length > 0), [C, T] = xe(null), [
|
|
15106
|
+
} = ra(), [y, S] = xe(Array.isArray(h) ? h : []), R = Ge(y.length > 0), [C, T] = xe(null), [E, I] = xe(""), [A, _] = xe(!1);
|
|
15106
15107
|
ct(() => {
|
|
15107
15108
|
const F = Array.isArray(h) ? h : [];
|
|
15108
15109
|
if (F.length > 0) {
|
|
@@ -15137,9 +15138,9 @@ function Ac({
|
|
|
15137
15138
|
}, P = (F, B) => {
|
|
15138
15139
|
B.stopPropagation(), T(F.threadId), I(F.title || `Thread ${F.threadId.slice(0, 8)}`);
|
|
15139
15140
|
}, Y = async (F) => {
|
|
15140
|
-
if (
|
|
15141
|
+
if (E.trim())
|
|
15141
15142
|
try {
|
|
15142
|
-
await g(F,
|
|
15143
|
+
await g(F, E.trim()), T(null), I("");
|
|
15143
15144
|
} catch (B) {
|
|
15144
15145
|
console.error("Failed to update title:", B);
|
|
15145
15146
|
}
|
|
@@ -15188,7 +15189,7 @@ function Ac({
|
|
|
15188
15189
|
children: [
|
|
15189
15190
|
/* @__PURE__ */ c.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
15190
15191
|
/* @__PURE__ */ c.jsx("div", { className: "flex-1 min-w-0", children: C === F.threadId ? /* @__PURE__ */ c.jsxs("div", { className: "flex items-center gap-2", onClick: (B) => B.stopPropagation(), children: [
|
|
15191
|
-
/* @__PURE__ */ c.jsx(Jo, { value:
|
|
15192
|
+
/* @__PURE__ */ c.jsx(Jo, { value: E, onChange: (B) => I(B.target.value), onKeyDown: (B) => J(B, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
|
|
15192
15193
|
/* @__PURE__ */ c.jsx(Ue, { variant: "ghost", size: "sm", onClick: () => Y(F.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ c.jsx(Zi, { size: 12 }) }),
|
|
15193
15194
|
/* @__PURE__ */ c.jsx(Ue, { variant: "ghost", size: "sm", onClick: K, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c.jsx(fr, { size: 12 }) })
|
|
15194
15195
|
] }) : /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
@@ -15327,7 +15328,7 @@ function JT(e) {
|
|
|
15327
15328
|
}), TC(e);
|
|
15328
15329
|
}
|
|
15329
15330
|
var RC = "Label", Lh = m.forwardRef((e, t) => /* @__PURE__ */ c.jsx(
|
|
15330
|
-
|
|
15331
|
+
ke.label,
|
|
15331
15332
|
{
|
|
15332
15333
|
...e,
|
|
15333
15334
|
ref: t,
|
|
@@ -15339,13 +15340,13 @@ var RC = "Label", Lh = m.forwardRef((e, t) => /* @__PURE__ */ c.jsx(
|
|
|
15339
15340
|
));
|
|
15340
15341
|
Lh.displayName = RC;
|
|
15341
15342
|
var $h = Lh;
|
|
15342
|
-
const
|
|
15343
|
+
const EC = ns(
|
|
15343
15344
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
15344
15345
|
), $t = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
15345
15346
|
$h,
|
|
15346
15347
|
{
|
|
15347
15348
|
ref: n,
|
|
15348
|
-
className: te(
|
|
15349
|
+
className: te(EC(), e),
|
|
15349
15350
|
...t
|
|
15350
15351
|
}
|
|
15351
15352
|
));
|
|
@@ -15354,7 +15355,7 @@ function Fh(e) {
|
|
|
15354
15355
|
const t = m.useRef({ value: e, previous: e });
|
|
15355
15356
|
return m.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
|
|
15356
15357
|
}
|
|
15357
|
-
var Ms = "Switch", [
|
|
15358
|
+
var Ms = "Switch", [kC, ZT] = fn(Ms), [IC, NC] = kC(Ms), zh = m.forwardRef(
|
|
15358
15359
|
(e, t) => {
|
|
15359
15360
|
const {
|
|
15360
15361
|
__scopeSwitch: n,
|
|
@@ -15375,7 +15376,7 @@ var Ms = "Switch", [EC, ZT] = fn(Ms), [IC, NC] = EC(Ms), zh = m.forwardRef(
|
|
|
15375
15376
|
});
|
|
15376
15377
|
return /* @__PURE__ */ c.jsxs(IC, { scope: n, checked: x, disabled: a, children: [
|
|
15377
15378
|
/* @__PURE__ */ c.jsx(
|
|
15378
|
-
|
|
15379
|
+
ke.button,
|
|
15379
15380
|
{
|
|
15380
15381
|
type: "button",
|
|
15381
15382
|
role: "switch",
|
|
@@ -15414,7 +15415,7 @@ var Bh = "SwitchThumb", Hh = m.forwardRef(
|
|
|
15414
15415
|
(e, t) => {
|
|
15415
15416
|
const { __scopeSwitch: n, ...r } = e, o = NC(Bh, n);
|
|
15416
15417
|
return /* @__PURE__ */ c.jsx(
|
|
15417
|
-
|
|
15418
|
+
ke.span,
|
|
15418
15419
|
{
|
|
15419
15420
|
"data-state": Wh(o.checked),
|
|
15420
15421
|
"data-disabled": o.disabled ? "" : void 0,
|
|
@@ -15505,7 +15506,7 @@ var Kh = Object.freeze({
|
|
|
15505
15506
|
wordWrap: "normal"
|
|
15506
15507
|
}), jC = "VisuallyHidden", PC = m.forwardRef(
|
|
15507
15508
|
(e, t) => /* @__PURE__ */ c.jsx(
|
|
15508
|
-
|
|
15509
|
+
ke.span,
|
|
15509
15510
|
{
|
|
15510
15511
|
...e,
|
|
15511
15512
|
ref: t,
|
|
@@ -15533,7 +15534,7 @@ var OC = [" ", "Enter", "ArrowUp", "ArrowDown"], MC = [" ", "Enter"], Jn = "Sele
|
|
|
15533
15534
|
disabled: h,
|
|
15534
15535
|
required: p,
|
|
15535
15536
|
form: w
|
|
15536
|
-
} = e, v = $s(t), [g, x] = m.useState(null), [y, S] = m.useState(null), [R, C] = m.useState(!1), T = Ts(u), [
|
|
15537
|
+
} = e, v = $s(t), [g, x] = m.useState(null), [y, S] = m.useState(null), [R, C] = m.useState(!1), T = Ts(u), [E, I] = Gn({
|
|
15537
15538
|
prop: r,
|
|
15538
15539
|
defaultProp: o ?? !1,
|
|
15539
15540
|
onChange: s,
|
|
@@ -15558,7 +15559,7 @@ var OC = [" ", "Enter", "ArrowUp", "ArrowDown"], MC = [" ", "Enter"], Jn = "Sele
|
|
|
15558
15559
|
contentId: ln(),
|
|
15559
15560
|
value: A,
|
|
15560
15561
|
onValueChange: _,
|
|
15561
|
-
open:
|
|
15562
|
+
open: E,
|
|
15562
15563
|
onOpenChange: I,
|
|
15563
15564
|
dir: T,
|
|
15564
15565
|
triggerPointerDownPosRef: D,
|
|
@@ -15616,7 +15617,7 @@ var Gh = "SelectTrigger", Yh = m.forwardRef(
|
|
|
15616
15617
|
});
|
|
15617
15618
|
};
|
|
15618
15619
|
return /* @__PURE__ */ c.jsx(mf, { asChild: !0, ...s, children: /* @__PURE__ */ c.jsx(
|
|
15619
|
-
|
|
15620
|
+
ke.button,
|
|
15620
15621
|
{
|
|
15621
15622
|
type: "button",
|
|
15622
15623
|
role: "combobox",
|
|
@@ -15654,7 +15655,7 @@ var Xh = "SelectValue", Jh = m.forwardRef(
|
|
|
15654
15655
|
return pt(() => {
|
|
15655
15656
|
u(d);
|
|
15656
15657
|
}, [u, d]), /* @__PURE__ */ c.jsx(
|
|
15657
|
-
|
|
15658
|
+
ke.span,
|
|
15658
15659
|
{
|
|
15659
15660
|
...a,
|
|
15660
15661
|
ref: f,
|
|
@@ -15668,7 +15669,7 @@ Jh.displayName = Xh;
|
|
|
15668
15669
|
var zC = "SelectIcon", Zh = m.forwardRef(
|
|
15669
15670
|
(e, t) => {
|
|
15670
15671
|
const { __scopeSelect: n, children: r, ...o } = e;
|
|
15671
|
-
return /* @__PURE__ */ c.jsx(
|
|
15672
|
+
return /* @__PURE__ */ c.jsx(ke.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
|
|
15672
15673
|
}
|
|
15673
15674
|
);
|
|
15674
15675
|
Zh.displayName = zC;
|
|
@@ -15712,7 +15713,7 @@ var Kt = 10, [tp, Pn] = Ir(Zn), HC = "SelectContentImpl", UC = vr("SelectContent
|
|
|
15712
15713
|
avoidCollisions: g,
|
|
15713
15714
|
//
|
|
15714
15715
|
...x
|
|
15715
|
-
} = e, y = jn(Zn, n), [S, R] = m.useState(null), [C, T] = m.useState(null),
|
|
15716
|
+
} = e, y = jn(Zn, n), [S, R] = m.useState(null), [C, T] = m.useState(null), E = ze(t, (G) => R(G)), [I, A] = m.useState(null), [_, D] = m.useState(
|
|
15716
15717
|
null
|
|
15717
15718
|
), L = Ls(n), [W, P] = m.useState(!1), Y = m.useRef(!1);
|
|
15718
15719
|
m.useEffect(() => {
|
|
@@ -15830,7 +15831,7 @@ var Kt = 10, [tp, Pn] = Ir(Zn), HC = "SelectContentImpl", UC = vr("SelectContent
|
|
|
15830
15831
|
...x,
|
|
15831
15832
|
...Ce,
|
|
15832
15833
|
onPlaced: () => P(!0),
|
|
15833
|
-
ref:
|
|
15834
|
+
ref: E,
|
|
15834
15835
|
style: {
|
|
15835
15836
|
// flex layout so we can place the scroll buttons properly
|
|
15836
15837
|
display: "flex",
|
|
@@ -15862,11 +15863,11 @@ var Kt = 10, [tp, Pn] = Ir(Zn), HC = "SelectContentImpl", UC = vr("SelectContent
|
|
|
15862
15863
|
);
|
|
15863
15864
|
np.displayName = HC;
|
|
15864
15865
|
var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
|
|
15865
|
-
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = jn(Zn, n), i = Pn(Zn, n), [a, l] = m.useState(null), [u, d] = m.useState(null), f = ze(t, (
|
|
15866
|
+
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = jn(Zn, n), i = Pn(Zn, n), [a, l] = m.useState(null), [u, d] = m.useState(null), f = ze(t, (E) => d(E)), h = Ls(n), p = m.useRef(!1), w = m.useRef(!0), { viewport: v, selectedItem: g, selectedItemText: x, focusSelectedItem: y } = i, S = m.useCallback(() => {
|
|
15866
15867
|
if (s.trigger && s.valueNode && a && u && v && g && x) {
|
|
15867
|
-
const
|
|
15868
|
+
const E = s.trigger.getBoundingClientRect(), I = u.getBoundingClientRect(), A = s.valueNode.getBoundingClientRect(), _ = x.getBoundingClientRect();
|
|
15868
15869
|
if (s.dir !== "rtl") {
|
|
15869
|
-
const ce = _.left - I.left, ie = A.left - ce, $e =
|
|
15870
|
+
const ce = _.left - I.left, ie = A.left - ce, $e = E.left - ie, Ke = E.width + $e, We = Math.max(Ke, I.width), Te = window.innerWidth - Kt, Pe = Wi(ie, [
|
|
15870
15871
|
Kt,
|
|
15871
15872
|
// Prevents the content from going off the starting edge of the
|
|
15872
15873
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -15877,13 +15878,13 @@ var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
|
|
|
15877
15878
|
]);
|
|
15878
15879
|
a.style.minWidth = Ke + "px", a.style.left = Pe + "px";
|
|
15879
15880
|
} else {
|
|
15880
|
-
const ce = I.right - _.right, ie = window.innerWidth - A.right - ce, $e = window.innerWidth -
|
|
15881
|
+
const ce = I.right - _.right, ie = window.innerWidth - A.right - ce, $e = window.innerWidth - E.right - ie, Ke = E.width + $e, We = Math.max(Ke, I.width), Te = window.innerWidth - Kt, Pe = Wi(ie, [
|
|
15881
15882
|
Kt,
|
|
15882
15883
|
Math.max(Kt, Te - We)
|
|
15883
15884
|
]);
|
|
15884
15885
|
a.style.minWidth = Ke + "px", a.style.right = Pe + "px";
|
|
15885
15886
|
}
|
|
15886
|
-
const D = h(), L = window.innerHeight - Kt * 2, W = v.scrollHeight, P = window.getComputedStyle(u), Y = parseInt(P.borderTopWidth, 10), K = parseInt(P.paddingTop, 10), J = parseInt(P.borderBottomWidth, 10), z = parseInt(P.paddingBottom, 10), $ = Y + K + W + z + J, F = Math.min(g.offsetHeight * 5, $), B = window.getComputedStyle(v), pe = parseInt(B.paddingTop, 10), ue = parseInt(B.paddingBottom, 10), ee =
|
|
15887
|
+
const D = h(), L = window.innerHeight - Kt * 2, W = v.scrollHeight, P = window.getComputedStyle(u), Y = parseInt(P.borderTopWidth, 10), K = parseInt(P.paddingTop, 10), J = parseInt(P.borderBottomWidth, 10), z = parseInt(P.paddingBottom, 10), $ = Y + K + W + z + J, F = Math.min(g.offsetHeight * 5, $), B = window.getComputedStyle(v), pe = parseInt(B.paddingTop, 10), ue = parseInt(B.paddingBottom, 10), ee = E.top + E.height / 2 - Kt, Ie = L - ee, Ce = g.offsetHeight / 2, G = g.offsetTop + Ce, O = Y + K + G, Q = $ - O;
|
|
15887
15888
|
if (O <= ee) {
|
|
15888
15889
|
const ce = D.length > 0 && g === D[D.length - 1].ref.current;
|
|
15889
15890
|
a.style.bottom = "0px";
|
|
@@ -15923,8 +15924,8 @@ var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
|
|
|
15923
15924
|
u && C(window.getComputedStyle(u).zIndex);
|
|
15924
15925
|
}, [u]);
|
|
15925
15926
|
const T = m.useCallback(
|
|
15926
|
-
(
|
|
15927
|
-
|
|
15927
|
+
(E) => {
|
|
15928
|
+
E && w.current === !0 && (S(), y == null || y(), w.current = !1);
|
|
15928
15929
|
},
|
|
15929
15930
|
[S, y]
|
|
15930
15931
|
);
|
|
@@ -15946,7 +15947,7 @@ var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
|
|
|
15946
15947
|
zIndex: R
|
|
15947
15948
|
},
|
|
15948
15949
|
children: /* @__PURE__ */ c.jsx(
|
|
15949
|
-
|
|
15950
|
+
ke.div,
|
|
15950
15951
|
{
|
|
15951
15952
|
...o,
|
|
15952
15953
|
ref: f,
|
|
@@ -16009,7 +16010,7 @@ var [KC, Ga] = Ir(Zn, {}), Ki = "SelectViewport", op = m.forwardRef(
|
|
|
16009
16010
|
}
|
|
16010
16011
|
),
|
|
16011
16012
|
/* @__PURE__ */ c.jsx(Ds.Slot, { scope: n, children: /* @__PURE__ */ c.jsx(
|
|
16012
|
-
|
|
16013
|
+
ke.div,
|
|
16013
16014
|
{
|
|
16014
16015
|
"data-radix-select-viewport": "",
|
|
16015
16016
|
role: "presentation",
|
|
@@ -16051,14 +16052,14 @@ op.displayName = Ki;
|
|
|
16051
16052
|
var sp = "SelectGroup", [qC, GC] = Ir(sp), YC = m.forwardRef(
|
|
16052
16053
|
(e, t) => {
|
|
16053
16054
|
const { __scopeSelect: n, ...r } = e, o = ln();
|
|
16054
|
-
return /* @__PURE__ */ c.jsx(qC, { scope: n, id: o, children: /* @__PURE__ */ c.jsx(
|
|
16055
|
+
return /* @__PURE__ */ c.jsx(qC, { scope: n, id: o, children: /* @__PURE__ */ c.jsx(ke.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
|
|
16055
16056
|
}
|
|
16056
16057
|
);
|
|
16057
16058
|
YC.displayName = sp;
|
|
16058
16059
|
var ip = "SelectLabel", ap = m.forwardRef(
|
|
16059
16060
|
(e, t) => {
|
|
16060
16061
|
const { __scopeSelect: n, ...r } = e, o = GC(ip, n);
|
|
16061
|
-
return /* @__PURE__ */ c.jsx(
|
|
16062
|
+
return /* @__PURE__ */ c.jsx(ke.div, { id: o.id, ...r, ref: t });
|
|
16062
16063
|
}
|
|
16063
16064
|
);
|
|
16064
16065
|
ap.displayName = ip;
|
|
@@ -16102,7 +16103,7 @@ var es = "SelectItem", [XC, lp] = Ir(es), cp = m.forwardRef(
|
|
|
16102
16103
|
disabled: o,
|
|
16103
16104
|
textValue: d,
|
|
16104
16105
|
children: /* @__PURE__ */ c.jsx(
|
|
16105
|
-
|
|
16106
|
+
ke.div,
|
|
16106
16107
|
{
|
|
16107
16108
|
role: "option",
|
|
16108
16109
|
"aria-labelledby": v,
|
|
@@ -16161,7 +16162,7 @@ var Or = "SelectItemText", up = m.forwardRef(
|
|
|
16161
16162
|
[l.disabled, l.value, p]
|
|
16162
16163
|
), { onNativeOptionAdd: v, onNativeOptionRemove: g } = u;
|
|
16163
16164
|
return pt(() => (v(w), () => g(w)), [v, g, w]), /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
16164
|
-
/* @__PURE__ */ c.jsx(
|
|
16165
|
+
/* @__PURE__ */ c.jsx(ke.span, { id: l.textId, ...s, ref: h }),
|
|
16165
16166
|
l.isSelected && i.valueNode && !i.valueNodeHasChildren ? rs.createPortal(s.children, i.valueNode) : null
|
|
16166
16167
|
] });
|
|
16167
16168
|
}
|
|
@@ -16170,7 +16171,7 @@ up.displayName = Or;
|
|
|
16170
16171
|
var dp = "SelectItemIndicator", fp = m.forwardRef(
|
|
16171
16172
|
(e, t) => {
|
|
16172
16173
|
const { __scopeSelect: n, ...r } = e;
|
|
16173
|
-
return lp(dp, n).isSelected ? /* @__PURE__ */ c.jsx(
|
|
16174
|
+
return lp(dp, n).isSelected ? /* @__PURE__ */ c.jsx(ke.span, { "aria-hidden": !0, ...r, ref: t }) : null;
|
|
16174
16175
|
}
|
|
16175
16176
|
);
|
|
16176
16177
|
fp.displayName = dp;
|
|
@@ -16231,7 +16232,7 @@ var mp = m.forwardRef((e, t) => {
|
|
|
16231
16232
|
const u = a().find((f) => f.ref.current === document.activeElement);
|
|
16232
16233
|
(d = u == null ? void 0 : u.ref.current) == null || d.scrollIntoView({ block: "nearest" });
|
|
16233
16234
|
}, [a]), /* @__PURE__ */ c.jsx(
|
|
16234
|
-
|
|
16235
|
+
ke.div,
|
|
16235
16236
|
{
|
|
16236
16237
|
"aria-hidden": !0,
|
|
16237
16238
|
...o,
|
|
@@ -16252,7 +16253,7 @@ var mp = m.forwardRef((e, t) => {
|
|
|
16252
16253
|
}), JC = "SelectSeparator", gp = m.forwardRef(
|
|
16253
16254
|
(e, t) => {
|
|
16254
16255
|
const { __scopeSelect: n, ...r } = e;
|
|
16255
|
-
return /* @__PURE__ */ c.jsx(
|
|
16256
|
+
return /* @__PURE__ */ c.jsx(ke.div, { "aria-hidden": !0, ...r, ref: t });
|
|
16256
16257
|
}
|
|
16257
16258
|
);
|
|
16258
16259
|
gp.displayName = JC;
|
|
@@ -16278,7 +16279,7 @@ var QC = "SelectBubbleInput", xp = m.forwardRef(
|
|
|
16278
16279
|
d.call(a, t), a.dispatchEvent(f);
|
|
16279
16280
|
}
|
|
16280
16281
|
}, [i, t]), /* @__PURE__ */ c.jsx(
|
|
16281
|
-
|
|
16282
|
+
ke.select,
|
|
16282
16283
|
{
|
|
16283
16284
|
...n,
|
|
16284
16285
|
style: { ...Kh, ...n.style },
|
|
@@ -16318,7 +16319,7 @@ function bp(e, t, n) {
|
|
|
16318
16319
|
function eT(e, t) {
|
|
16319
16320
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
16320
16321
|
}
|
|
16321
|
-
var tT = qh, yp = Yh, nT = Jh, rT = Zh, oT = Qh, Sp = ep, sT = op, Cp = ap, Tp = cp, iT = up, aT = fp, Rp = hp,
|
|
16322
|
+
var tT = qh, yp = Yh, nT = Jh, rT = Zh, oT = Qh, Sp = ep, sT = op, Cp = ap, Tp = cp, iT = up, aT = fp, Rp = hp, Ep = pp, kp = gp;
|
|
16322
16323
|
const _c = tT, jc = nT, Xi = m.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ c.jsxs(
|
|
16323
16324
|
yp,
|
|
16324
16325
|
{
|
|
@@ -16349,7 +16350,7 @@ const Ip = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
|
16349
16350
|
));
|
|
16350
16351
|
Ip.displayName = Rp.displayName;
|
|
16351
16352
|
const Np = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
16352
|
-
|
|
16353
|
+
Ep,
|
|
16353
16354
|
{
|
|
16354
16355
|
ref: n,
|
|
16355
16356
|
className: te(
|
|
@@ -16360,7 +16361,7 @@ const Np = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
|
16360
16361
|
children: /* @__PURE__ */ c.jsx(dr, { className: "h-4 w-4" })
|
|
16361
16362
|
}
|
|
16362
16363
|
));
|
|
16363
|
-
Np.displayName =
|
|
16364
|
+
Np.displayName = Ep.displayName;
|
|
16364
16365
|
const Ji = m.forwardRef(({ className: e, children: t, position: n = "popper", ...r }, o) => /* @__PURE__ */ c.jsx(oT, { children: /* @__PURE__ */ c.jsxs(
|
|
16365
16366
|
Sp,
|
|
16366
16367
|
{
|
|
@@ -16415,18 +16416,18 @@ const zn = m.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
16415
16416
|
));
|
|
16416
16417
|
zn.displayName = Tp.displayName;
|
|
16417
16418
|
const cT = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
16418
|
-
|
|
16419
|
+
kp,
|
|
16419
16420
|
{
|
|
16420
16421
|
ref: n,
|
|
16421
16422
|
className: te("-mx-1 my-1 h-px bg-muted", e),
|
|
16422
16423
|
...t
|
|
16423
16424
|
}
|
|
16424
16425
|
));
|
|
16425
|
-
cT.displayName =
|
|
16426
|
+
cT.displayName = kp.displayName;
|
|
16426
16427
|
var uT = "Separator", Pc = "horizontal", dT = ["horizontal", "vertical"], Ap = m.forwardRef((e, t) => {
|
|
16427
16428
|
const { decorative: n, orientation: r = Pc, ...o } = e, s = fT(r) ? r : Pc, a = n ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
|
|
16428
16429
|
return /* @__PURE__ */ c.jsx(
|
|
16429
|
-
|
|
16430
|
+
ke.div,
|
|
16430
16431
|
{
|
|
16431
16432
|
"data-orientation": s,
|
|
16432
16433
|
...a,
|
|
@@ -16606,7 +16607,7 @@ function eR({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
16606
16607
|
/* @__PURE__ */ c.jsx(om, { className: "h-5 w-5" }),
|
|
16607
16608
|
"API Configuration"
|
|
16608
16609
|
] }) }),
|
|
16609
|
-
/* @__PURE__ */ c.jsxs(
|
|
16610
|
+
/* @__PURE__ */ c.jsxs(ko, { className: "space-y-4", children: [
|
|
16610
16611
|
/* @__PURE__ */ c.jsxs("div", { className: "space-y-2", children: [
|
|
16611
16612
|
/* @__PURE__ */ c.jsx($t, { htmlFor: "api-url", children: "API Base URL" }),
|
|
16612
16613
|
/* @__PURE__ */ c.jsxs("div", { className: "flex gap-2", children: [
|
|
@@ -16673,7 +16674,7 @@ function eR({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
16673
16674
|
/* @__PURE__ */ c.jsx(am, { className: "h-5 w-5" }),
|
|
16674
16675
|
"Interface Settings"
|
|
16675
16676
|
] }) }),
|
|
16676
|
-
/* @__PURE__ */ c.jsxs(
|
|
16677
|
+
/* @__PURE__ */ c.jsxs(ko, { className: "space-y-4", children: [
|
|
16677
16678
|
/* @__PURE__ */ c.jsxs("div", { className: "space-y-2", children: [
|
|
16678
16679
|
/* @__PURE__ */ c.jsx($t, { htmlFor: "layout", children: "Layout Style" }),
|
|
16679
16680
|
/* @__PURE__ */ c.jsxs(
|
|
@@ -16768,7 +16769,7 @@ function eR({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
16768
16769
|
/* @__PURE__ */ c.jsx(lm, { className: "h-5 w-5" }),
|
|
16769
16770
|
"Behavior Settings"
|
|
16770
16771
|
] }) }),
|
|
16771
|
-
/* @__PURE__ */ c.jsxs(
|
|
16772
|
+
/* @__PURE__ */ c.jsxs(ko, { className: "space-y-4", children: [
|
|
16772
16773
|
/* @__PURE__ */ c.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
16773
16774
|
/* @__PURE__ */ c.jsxs("div", { children: [
|
|
16774
16775
|
/* @__PURE__ */ c.jsx($t, { htmlFor: "auto-save", children: "Auto-save Conversations" }),
|