@multiplayer-app/ai-agent-react 0.4.8 → 0.4.10
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/ai-agent-react.cjs.js +15 -15
- package/dist/ai-agent-react.cjs.js.map +1 -1
- package/dist/ai-agent-react.es.js +440 -429
- package/dist/ai-agent-react.es.js.map +1 -1
- package/dist/components/ChatWindow/MessageList/ToolCallCard/SubagentToolCall.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z as U } from "zod";
|
|
2
2
|
import { jsx as T, Fragment as Rt, jsxs as re } from "react/jsx-runtime";
|
|
3
3
|
import * as ee from "react";
|
|
4
|
-
import tr, { forwardRef as ho, createElement as hd, useMemo as
|
|
4
|
+
import tr, { forwardRef as ho, createElement as hd, useMemo as ot, useState as Ze, useEffect as Fe, useLayoutEffect as mo, memo as ft, useCallback as Ge, useRef as Ve, createContext as ip, useContext as op, useImperativeHandle as z7, isValidElement as T5 } from "react";
|
|
5
5
|
import { useInfiniteQuery as sp, useQuery as mr, useQueryClient as $7, useMutation as r2, QueryClient as F7, QueryClientProvider as P7 } from "@tanstack/react-query";
|
|
6
6
|
import { create as q7, useStore as B7 } from "zustand";
|
|
7
7
|
import { nanoid as Tt } from "nanoid";
|
|
@@ -237,10 +237,10 @@ var _t;
|
|
|
237
237
|
(function(e) {
|
|
238
238
|
e.File = "file", e.Link = "link", e.Artifact = "artifact", e.Context = "context";
|
|
239
239
|
})(_t || (_t = {}));
|
|
240
|
-
var
|
|
240
|
+
var rt;
|
|
241
241
|
(function(e) {
|
|
242
242
|
e.Pending = "pending", e.Running = "running", e.Succeeded = "succeeded", e.Failed = "failed";
|
|
243
|
-
})(
|
|
243
|
+
})(rt || (rt = {}));
|
|
244
244
|
var o2;
|
|
245
245
|
(function(e) {
|
|
246
246
|
e.Queued = "queued", e.ApprovalRequired = "approvalRequired", e.Running = "running", e.Paused = "paused", e.Error = "error", e.Complete = "complete";
|
|
@@ -1395,13 +1395,13 @@ class c_ {
|
|
|
1395
1395
|
id: Tt(),
|
|
1396
1396
|
name: t,
|
|
1397
1397
|
input: n,
|
|
1398
|
-
status:
|
|
1398
|
+
status: rt.Running
|
|
1399
1399
|
};
|
|
1400
1400
|
try {
|
|
1401
1401
|
const s = await i.handler(n, r);
|
|
1402
|
-
o.status =
|
|
1402
|
+
o.status = rt.Succeeded, o.output = s ?? {};
|
|
1403
1403
|
} catch (s) {
|
|
1404
|
-
throw o.status =
|
|
1404
|
+
throw o.status = rt.Failed, o.error = s.message, s;
|
|
1405
1405
|
}
|
|
1406
1406
|
return o;
|
|
1407
1407
|
}
|
|
@@ -27760,8 +27760,8 @@ const Qve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
|
|
|
27760
27760
|
const d = Math.round(l / 365);
|
|
27761
27761
|
return i.format(d, "year");
|
|
27762
27762
|
}, t6e = ({ date: e, refreshMs: t = 3e4, emptyText: n = "" }) => {
|
|
27763
|
-
const r =
|
|
27764
|
-
return
|
|
27763
|
+
const r = ot(() => Jve(e), [e]), [a, i] = Ze(() => /* @__PURE__ */ new Date());
|
|
27764
|
+
return Fe(() => {
|
|
27765
27765
|
if (!r)
|
|
27766
27766
|
return;
|
|
27767
27767
|
const o = window.setInterval(() => i(/* @__PURE__ */ new Date()), t);
|
|
@@ -27785,7 +27785,7 @@ function Wn(e) {
|
|
|
27785
27785
|
function mp(e) {
|
|
27786
27786
|
return bo() ? e instanceof Node || e instanceof Pt(e).Node : !1;
|
|
27787
27787
|
}
|
|
27788
|
-
function
|
|
27788
|
+
function st(e) {
|
|
27789
27789
|
return bo() ? e instanceof Element || e instanceof Pt(e).Element : !1;
|
|
27790
27790
|
}
|
|
27791
27791
|
function Gt(e) {
|
|
@@ -27821,7 +27821,7 @@ function vo(e) {
|
|
|
27821
27821
|
const r6e = /transform|translate|scale|rotate|perspective|filter/, a6e = /paint|layout|strict|content/, br = (e) => !!e && e !== "none";
|
|
27822
27822
|
let ns;
|
|
27823
27823
|
function fp(e) {
|
|
27824
|
-
const t =
|
|
27824
|
+
const t = st(e) ? wn(e) : e;
|
|
27825
27825
|
return br(t.transform) || br(t.translate) || br(t.scale) || br(t.rotate) || br(t.perspective) || !_o() && (br(t.backdropFilter) || br(t.filter)) || r6e.test(t.willChange || "") || a6e.test(t.contain || "");
|
|
27826
27826
|
}
|
|
27827
27827
|
function i6e(e) {
|
|
@@ -27845,7 +27845,7 @@ function wn(e) {
|
|
|
27845
27845
|
return Pt(e).getComputedStyle(e);
|
|
27846
27846
|
}
|
|
27847
27847
|
function wo(e) {
|
|
27848
|
-
return
|
|
27848
|
+
return st(e) ? {
|
|
27849
27849
|
scrollLeft: e.scrollLeft,
|
|
27850
27850
|
scrollTop: e.scrollTop
|
|
27851
27851
|
} : {
|
|
@@ -28850,7 +28850,7 @@ function d3(e) {
|
|
|
28850
28850
|
};
|
|
28851
28851
|
}
|
|
28852
28852
|
function yp(e) {
|
|
28853
|
-
return
|
|
28853
|
+
return st(e) ? e : e.contextElement;
|
|
28854
28854
|
}
|
|
28855
28855
|
function Zr(e) {
|
|
28856
28856
|
const t = yp(e);
|
|
@@ -28882,11 +28882,11 @@ function Cr(e, t, n, r) {
|
|
|
28882
28882
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
28883
28883
|
const a = e.getBoundingClientRect(), i = yp(e);
|
|
28884
28884
|
let o = Bn(1);
|
|
28885
|
-
t && (r ?
|
|
28885
|
+
t && (r ? st(r) && (o = Zr(r)) : o = Zr(e));
|
|
28886
28886
|
const s = u8e(i, n, r) ? p3(i) : Bn(0);
|
|
28887
28887
|
let l = (a.left + s.x) / o.x, u = (a.top + s.y) / o.y, d = a.width / o.x, p = a.height / o.y;
|
|
28888
28888
|
if (i && r) {
|
|
28889
|
-
const h = Pt(i), m =
|
|
28889
|
+
const h = Pt(i), m = st(r) ? Pt(r) : r;
|
|
28890
28890
|
let f = h, g = vd(f);
|
|
28891
28891
|
for (; g && m !== f; ) {
|
|
28892
28892
|
const _ = Zr(g), k = g.getBoundingClientRect(), b = wn(g), w = k.left + (g.clientLeft + parseFloat(b.paddingLeft)) * _.x, E = k.top + (g.clientTop + parseFloat(b.paddingTop)) * _.y;
|
|
@@ -28987,7 +28987,7 @@ function v2(e, t, n) {
|
|
|
28987
28987
|
r = f8e(e, n, t);
|
|
28988
28988
|
else if (t === "document")
|
|
28989
28989
|
r = h8e(Wn(e));
|
|
28990
|
-
else if (
|
|
28990
|
+
else if (st(t))
|
|
28991
28991
|
r = g8e(t, n);
|
|
28992
28992
|
else {
|
|
28993
28993
|
const a = p3(e);
|
|
@@ -29004,10 +29004,10 @@ function y8e(e, t) {
|
|
|
29004
29004
|
const n = t.get(e);
|
|
29005
29005
|
if (n)
|
|
29006
29006
|
return n;
|
|
29007
|
-
let r = or(e, [], !1).filter((s) =>
|
|
29007
|
+
let r = or(e, [], !1).filter((s) => st(s) && na(s) !== "body"), a = null;
|
|
29008
29008
|
const i = wn(e).position === "fixed";
|
|
29009
29009
|
let o = i ? lr(e) : e;
|
|
29010
|
-
for (;
|
|
29010
|
+
for (; st(o) && !ir(o); ) {
|
|
29011
29011
|
const s = wn(o), l = fp(o), u = a ? a.position : i ? "fixed" : "";
|
|
29012
29012
|
!l && (u === "fixed" || u === "absolute" && s.position === "static") ? r = r.filter((p) => p !== o) : a = s, o = lr(o);
|
|
29013
29013
|
}
|
|
@@ -29081,7 +29081,7 @@ function m3(e, t) {
|
|
|
29081
29081
|
if (!Gt(e)) {
|
|
29082
29082
|
let a = lr(e);
|
|
29083
29083
|
for (; a && !ir(a); ) {
|
|
29084
|
-
if (
|
|
29084
|
+
if (st(a) && !ls(a))
|
|
29085
29085
|
return a;
|
|
29086
29086
|
a = lr(a);
|
|
29087
29087
|
}
|
|
@@ -29116,7 +29116,7 @@ const x8e = {
|
|
|
29116
29116
|
getClientRects: p8e,
|
|
29117
29117
|
getDimensions: k8e,
|
|
29118
29118
|
getScale: Zr,
|
|
29119
|
-
isElement:
|
|
29119
|
+
isElement: st,
|
|
29120
29120
|
isRTL: w8e
|
|
29121
29121
|
};
|
|
29122
29122
|
function f3(e, t) {
|
|
@@ -29575,7 +29575,7 @@ function B8e(e, t) {
|
|
|
29575
29575
|
function K(J) {
|
|
29576
29576
|
R() || Y(J, !1);
|
|
29577
29577
|
}
|
|
29578
|
-
if (
|
|
29578
|
+
if (st(o.domReference)) {
|
|
29579
29579
|
const J = o.domReference, L = o.floating;
|
|
29580
29580
|
return n && J.addEventListener("mouseleave", V), h && J.addEventListener("mousemove", j, {
|
|
29581
29581
|
once: !0
|
|
@@ -29588,7 +29588,7 @@ function B8e(e, t) {
|
|
|
29588
29588
|
if (s && n && (j = g.current) != null && (j = j.__options) != null && j.blockPointerEvents && q()) {
|
|
29589
29589
|
P.current = !0;
|
|
29590
29590
|
const V = o.floating;
|
|
29591
|
-
if (
|
|
29591
|
+
if (st(o.domReference) && V) {
|
|
29592
29592
|
var z;
|
|
29593
29593
|
const N = kn(o.floating).body;
|
|
29594
29594
|
N.setAttribute(N2, "");
|
|
@@ -29894,20 +29894,20 @@ function xp(e, t) {
|
|
|
29894
29894
|
if (b.current = !1, u === "click" && j || H || typeof k == "function" && !k(W))
|
|
29895
29895
|
return;
|
|
29896
29896
|
const z = Br(W), V = "[" + Va("inert") + "]", N = kn(a.floating).querySelectorAll(V);
|
|
29897
|
-
let K =
|
|
29897
|
+
let K = st(z) ? z : null;
|
|
29898
29898
|
for (; K && !ir(K); ) {
|
|
29899
29899
|
const ye = lr(K);
|
|
29900
|
-
if (ir(ye) || !
|
|
29900
|
+
if (ir(ye) || !st(ye))
|
|
29901
29901
|
break;
|
|
29902
29902
|
K = ye;
|
|
29903
29903
|
}
|
|
29904
|
-
if (N.length &&
|
|
29904
|
+
if (N.length && st(z) && !z6e(z) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
29905
29905
|
!Tr(z, a.floating) && // If the target root element contains none of the markers, then the
|
|
29906
29906
|
// element was injected after the floating element rendered.
|
|
29907
29907
|
Array.from(N).every((ye) => !Tr(K, ye)))
|
|
29908
29908
|
return;
|
|
29909
29909
|
if (Gt(z) && Z) {
|
|
29910
|
-
const ye = ir(z), ke = wn(z), Ie = /auto|scroll/,
|
|
29910
|
+
const ye = ir(z), ke = wn(z), Ie = /auto|scroll/, qe = ye || Ie.test(ke.overflowX), Je = ye || Ie.test(ke.overflowY), Xe = qe && z.clientWidth > 0 && z.scrollWidth > z.clientWidth, ct = Je && z.clientHeight > 0 && z.scrollHeight > z.clientHeight, xt = ke.direction === "rtl", et = ct && (xt ? W.offsetX <= z.offsetWidth - z.clientWidth : W.offsetX > z.clientWidth), ie = Xe && W.offsetY > z.clientHeight;
|
|
29911
29911
|
if (et || ie)
|
|
29912
29912
|
return;
|
|
29913
29913
|
}
|
|
@@ -29962,7 +29962,7 @@ function xp(e, t) {
|
|
|
29962
29962
|
const z = kn(a.floating);
|
|
29963
29963
|
s && (z.addEventListener("keydown", S ? C : P, S), z.addEventListener("compositionstart", H), z.addEventListener("compositionend", j)), k && z.addEventListener(u, x ? q : I, x);
|
|
29964
29964
|
let V = [];
|
|
29965
|
-
return h && (
|
|
29965
|
+
return h && (st(a.domReference) && (V = or(a.domReference)), st(a.floating) && (V = V.concat(or(a.floating))), !st(a.reference) && a.reference && a.reference.contextElement && (V = V.concat(or(a.reference.contextElement)))), V = V.filter((N) => {
|
|
29966
29966
|
var K;
|
|
29967
29967
|
return N !== ((K = z.defaultView) == null ? void 0 : K.visualViewport);
|
|
29968
29968
|
}), V.forEach((N) => {
|
|
@@ -30013,7 +30013,7 @@ function X8e(e) {
|
|
|
30013
30013
|
} = e, a = wp(), i = ee.useRef({}), [o] = ee.useState(() => F8e()), s = No() != null;
|
|
30014
30014
|
if (process.env.NODE_ENV !== "production") {
|
|
30015
30015
|
const m = r.reference;
|
|
30016
|
-
m && !
|
|
30016
|
+
m && !st(m) && $8e("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
30017
30017
|
}
|
|
30018
30018
|
const [l, u] = ee.useState(r.reference), d = Jt((m, f, g) => {
|
|
30019
30019
|
i.current.openEvent = m ? f : void 0, o.emit("openchange", {
|
|
@@ -30066,17 +30066,17 @@ function Ep(e) {
|
|
|
30066
30066
|
}
|
|
30067
30067
|
}
|
|
30068
30068
|
}), b = ee.useCallback((D) => {
|
|
30069
|
-
const P =
|
|
30069
|
+
const P = st(D) ? {
|
|
30070
30070
|
getBoundingClientRect: () => D.getBoundingClientRect(),
|
|
30071
30071
|
getClientRects: () => D.getClientRects(),
|
|
30072
30072
|
contextElement: D
|
|
30073
30073
|
} : D;
|
|
30074
30074
|
h(P), k.refs.setReference(P);
|
|
30075
30075
|
}, [k.refs]), w = ee.useCallback((D) => {
|
|
30076
|
-
(
|
|
30076
|
+
(st(D) || D === null) && (g.current = D, d(D)), (st(k.refs.reference.current) || k.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
30077
30077
|
// `null` to support `positionReference` + an unstable `reference`
|
|
30078
30078
|
// callback ref.
|
|
30079
|
-
D !== null && !
|
|
30079
|
+
D !== null && !st(D)) && k.refs.setReference(D);
|
|
30080
30080
|
}, [k.refs]), E = ee.useMemo(() => ({
|
|
30081
30081
|
...k.refs,
|
|
30082
30082
|
setReference: w,
|
|
@@ -30157,7 +30157,7 @@ function Q8e(e, t) {
|
|
|
30157
30157
|
if (u.current)
|
|
30158
30158
|
return;
|
|
30159
30159
|
const f = Br(m.nativeEvent);
|
|
30160
|
-
if (l &&
|
|
30160
|
+
if (l && st(f)) {
|
|
30161
30161
|
if (hs() && !m.relatedTarget) {
|
|
30162
30162
|
if (!p.current && !gp(f))
|
|
30163
30163
|
return;
|
|
@@ -30168,7 +30168,7 @@ function Q8e(e, t) {
|
|
|
30168
30168
|
},
|
|
30169
30169
|
onBlur(m) {
|
|
30170
30170
|
u.current = !1;
|
|
30171
|
-
const f = m.relatedTarget, g = m.nativeEvent, _ =
|
|
30171
|
+
const f = m.relatedTarget, g = m.nativeEvent, _ = st(f) && f.hasAttribute(Va("focus-guard")) && f.getAttribute("data-type") === "outside";
|
|
30172
30172
|
d.current = window.setTimeout(() => {
|
|
30173
30173
|
var k;
|
|
30174
30174
|
const b = Ta(o.domReference ? o.domReference.ownerDocument : document);
|
|
@@ -30299,11 +30299,11 @@ function e7e(e, t) {
|
|
|
30299
30299
|
}, [e, E]);
|
|
30300
30300
|
const R = Jt(() => {
|
|
30301
30301
|
l(z.current === -1 ? null : z.current);
|
|
30302
|
-
}), H = $6e(a.domReference), j = ee.useRef(_), z = ee.useRef(d ?? -1), V = ee.useRef(null), N = ee.useRef(!0), K = ee.useRef(R), J = ee.useRef(!!a.floating), L = ee.useRef(n), se = ee.useRef(!1), ye = ee.useRef(!1), ke = Fn(w), Ie = Fn(n),
|
|
30302
|
+
}), H = $6e(a.domReference), j = ee.useRef(_), z = ee.useRef(d ?? -1), V = ee.useRef(null), N = ee.useRef(!0), K = ee.useRef(R), J = ee.useRef(!!a.floating), L = ee.useRef(n), se = ee.useRef(!1), ye = ee.useRef(!1), ke = Fn(w), Ie = Fn(n), qe = Fn(D), Je = Fn(d), [Xe, ct] = ee.useState(), [xt, et] = ee.useState(), ie = Jt(() => {
|
|
30303
30303
|
function ve(B) {
|
|
30304
30304
|
if (g) {
|
|
30305
30305
|
var X;
|
|
30306
|
-
(X = B.id) != null && X.endsWith("-fui-option") && (B.id = i + "-" + Math.random().toString(16).slice(2, 10)),
|
|
30306
|
+
(X = B.id) != null && X.endsWith("-fui-option") && (B.id = i + "-" + Math.random().toString(16).slice(2, 10)), ct(B.id), W?.events.emit("virtualfocus", B), P && (P.current = B);
|
|
30307
30307
|
} else
|
|
30308
30308
|
U8e(B, {
|
|
30309
30309
|
sync: se.current,
|
|
@@ -30316,7 +30316,7 @@ function e7e(e, t) {
|
|
|
30316
30316
|
if (!B)
|
|
30317
30317
|
return;
|
|
30318
30318
|
pe || ve(B);
|
|
30319
|
-
const X =
|
|
30319
|
+
const X = qe.current;
|
|
30320
30320
|
X && xe && (be || !N.current) && (B.scrollIntoView == null || B.scrollIntoView(typeof X == "boolean" ? {
|
|
30321
30321
|
block: "nearest",
|
|
30322
30322
|
inline: "nearest"
|
|
@@ -30419,8 +30419,8 @@ function e7e(e, t) {
|
|
|
30419
30419
|
}, () => ({
|
|
30420
30420
|
width: 1,
|
|
30421
30421
|
height: 1
|
|
30422
|
-
})), X = Y6e(B, x, I), oe = X.findIndex((
|
|
30423
|
-
current: X.map((
|
|
30422
|
+
})), X = Y6e(B, x, I), oe = X.findIndex((Be) => Be != null && !Ci(o, Be, w)), ne = X.reduce((Be, pt, Nt) => pt != null && !Ci(o, pt, w) ? Nt : Be, -1), _e = X[K6e({
|
|
30423
|
+
current: X.map((Be) => Be != null ? o.current[Be] : null)
|
|
30424
30424
|
}, {
|
|
30425
30425
|
event: ve,
|
|
30426
30426
|
orientation: E,
|
|
@@ -30429,7 +30429,7 @@ function e7e(e, t) {
|
|
|
30429
30429
|
cols: x,
|
|
30430
30430
|
// treat undefined (empty grid spaces) as disabled indices so we
|
|
30431
30431
|
// don't end up in them
|
|
30432
|
-
disabledIndices: X6e([...(typeof w != "function" ? w : null) || o.current.map((
|
|
30432
|
+
disabledIndices: X6e([...(typeof w != "function" ? w : null) || o.current.map((Be, pt) => Ci(o, pt, w) ? pt : void 0), void 0], X),
|
|
30433
30433
|
minIndex: oe,
|
|
30434
30434
|
maxIndex: ne,
|
|
30435
30435
|
prevIndex: Z6e(
|
|
@@ -30468,16 +30468,16 @@ function e7e(e, t) {
|
|
|
30468
30468
|
disabledIndices: w
|
|
30469
30469
|
})), wa(o, z.current) && (z.current = -1), R();
|
|
30470
30470
|
}
|
|
30471
|
-
}),
|
|
30471
|
+
}), De = ee.useMemo(() => g && n && we && {
|
|
30472
30472
|
"aria-activedescendant": xt || Xe
|
|
30473
30473
|
}, [g, n, we, xt, Xe]), Ue = ee.useMemo(() => ({
|
|
30474
30474
|
"aria-orientation": E === "both" ? void 0 : E,
|
|
30475
|
-
...H ? {} :
|
|
30475
|
+
...H ? {} : De,
|
|
30476
30476
|
onKeyDown: ue,
|
|
30477
30477
|
onPointerMove() {
|
|
30478
30478
|
N.current = !0;
|
|
30479
30479
|
}
|
|
30480
|
-
}), [
|
|
30480
|
+
}), [De, ue, E, H]), Ce = ee.useMemo(() => {
|
|
30481
30481
|
function ve(be) {
|
|
30482
30482
|
_ === "auto" && B6e(be.nativeEvent) && (j.current = !0);
|
|
30483
30483
|
}
|
|
@@ -30485,10 +30485,10 @@ function e7e(e, t) {
|
|
|
30485
30485
|
j.current = _, _ === "auto" && U6e(be.nativeEvent) && (j.current = !0);
|
|
30486
30486
|
}
|
|
30487
30487
|
return {
|
|
30488
|
-
...
|
|
30488
|
+
...De,
|
|
30489
30489
|
onKeyDown(be) {
|
|
30490
30490
|
N.current = !1;
|
|
30491
|
-
const Re = be.key.startsWith("Arrow"), B = ["Home", "End"].includes(be.key), X = Re || B, oe = L2(be.key, E, f), ne = D2(be.key, E, f, x), _e = L2(be.key, Ye(), f),
|
|
30491
|
+
const Re = be.key.startsWith("Arrow"), B = ["Home", "End"].includes(be.key), X = Re || B, oe = L2(be.key, E, f), ne = D2(be.key, E, f, x), _e = L2(be.key, Ye(), f), Be = ai(be.key, E), pt = (m ? _e : Be) || be.key === "Enter" || be.key.trim() === "";
|
|
30492
30492
|
if (g && n) {
|
|
30493
30493
|
const Et = W?.nodesRef.current.find((Bt) => Bt.parentId == null), Ot = W && Et ? P6e(W.nodesRef.current, Et.id) : null;
|
|
30494
30494
|
if (X && Ot && P) {
|
|
@@ -30501,7 +30501,7 @@ function e7e(e, t) {
|
|
|
30501
30501
|
const D7 = ((Nt = Ot.context) == null ? void 0 : Nt.elements.domReference) === be.currentTarget, t2 = ne && !D7 ? (Zn = Ot.context) == null ? void 0 : Zn.elements.domReference : oe ? o.current.find((n2) => n2?.id === Xe) : null;
|
|
30502
30502
|
t2 && (on(be), t2.dispatchEvent(Bt), et(void 0));
|
|
30503
30503
|
}
|
|
30504
|
-
if ((
|
|
30504
|
+
if ((Be || B) && Ot.context && Ot.context.open && Ot.parentId && be.currentTarget !== Ot.context.elements.domReference) {
|
|
30505
30505
|
var Xn;
|
|
30506
30506
|
on(be), (Xn = Ot.context.elements.domReference) == null || Xn.dispatchEvent(Bt);
|
|
30507
30507
|
return;
|
|
@@ -30510,7 +30510,7 @@ function e7e(e, t) {
|
|
|
30510
30510
|
return ue(be);
|
|
30511
30511
|
}
|
|
30512
30512
|
if (!(!n && !b && Re)) {
|
|
30513
|
-
if (
|
|
30513
|
+
if (pt) {
|
|
30514
30514
|
const Et = ai(be.key, Ye());
|
|
30515
30515
|
V.current = m && Et ? null : be.key;
|
|
30516
30516
|
}
|
|
@@ -30518,7 +30518,7 @@ function e7e(e, t) {
|
|
|
30518
30518
|
_e && (on(be), n ? (z.current = os(o, ke.current), R()) : r(!0, be.nativeEvent, "list-navigation"));
|
|
30519
30519
|
return;
|
|
30520
30520
|
}
|
|
30521
|
-
|
|
30521
|
+
Be && (d != null && (z.current = d), on(be), !n && b ? r(!0, be.nativeEvent, "list-navigation") : ue(be), n && R());
|
|
30522
30522
|
}
|
|
30523
30523
|
},
|
|
30524
30524
|
onFocus() {
|
|
@@ -30529,7 +30529,7 @@ function e7e(e, t) {
|
|
|
30529
30529
|
onMouseDown: ve,
|
|
30530
30530
|
onClick: ve
|
|
30531
30531
|
};
|
|
30532
|
-
}, [Xe,
|
|
30532
|
+
}, [Xe, De, x, ue, ke, _, o, m, R, r, n, b, E, Ye, f, d, W, g, P]);
|
|
30533
30533
|
return ee.useMemo(() => u ? {
|
|
30534
30534
|
reference: Ce,
|
|
30535
30535
|
floating: Ue,
|
|
@@ -30638,7 +30638,7 @@ const Pn = ({
|
|
|
30638
30638
|
escapeKey: !0,
|
|
30639
30639
|
ancestorScroll: !0
|
|
30640
30640
|
}), g = Sp(d, { role: "tooltip" }), { getReferenceProps: _, getFloatingProps: k } = Mp([h, m, f, g]);
|
|
30641
|
-
return
|
|
30641
|
+
return Fe(() => {
|
|
30642
30642
|
if (!o || a)
|
|
30643
30643
|
return;
|
|
30644
30644
|
const b = () => {
|
|
@@ -30687,7 +30687,7 @@ const Pn = ({
|
|
|
30687
30687
|
}
|
|
30688
30688
|
}, "aria-label": "Copy message", size: "sm" }) });
|
|
30689
30689
|
}, fn = () => {
|
|
30690
|
-
const e =
|
|
30690
|
+
const e = Pe();
|
|
30691
30691
|
return { ...md, ...e.config.translations ?? {} };
|
|
30692
30692
|
}, z2 = 300, v3 = ft(({ field: e, isExpanded: t, canApply: n, onToggleExpand: r, onApply: a }) => {
|
|
30693
30693
|
const i = fn(), o = e.value.length > z2, s = o && !t ? `${e.value.slice(0, z2)}...` : e.value, l = Ge(() => {
|
|
@@ -30745,7 +30745,7 @@ const ja = 30 * 1e3, Ga = 5 * 60 * 1e3, _3 = 20, sn = {
|
|
|
30745
30745
|
data: [],
|
|
30746
30746
|
cursor: { total: 0, skip: 0, limit: e }
|
|
30747
30747
|
}), VVe = (e) => {
|
|
30748
|
-
const t =
|
|
30748
|
+
const t = Pe(), {
|
|
30749
30749
|
groupId: n,
|
|
30750
30750
|
parentId: r,
|
|
30751
30751
|
sourceType: a,
|
|
@@ -30788,7 +30788,7 @@ const ja = 30 * 1e3, Ga = 5 * 60 * 1e3, _3 = 20, sn = {
|
|
|
30788
30788
|
gcTime: Ga
|
|
30789
30789
|
});
|
|
30790
30790
|
}, jVe = (e) => {
|
|
30791
|
-
const t =
|
|
30791
|
+
const t = Pe(), {
|
|
30792
30792
|
groupId: n,
|
|
30793
30793
|
parentId: r,
|
|
30794
30794
|
sourceType: a,
|
|
@@ -30832,7 +30832,7 @@ const ja = 30 * 1e3, Ga = 5 * 60 * 1e3, _3 = 20, sn = {
|
|
|
30832
30832
|
hasPreviousPage: i > 1
|
|
30833
30833
|
};
|
|
30834
30834
|
}, GVe = (e) => {
|
|
30835
|
-
const t =
|
|
30835
|
+
const t = Pe();
|
|
30836
30836
|
return mr({
|
|
30837
30837
|
queryKey: sn.detail(e),
|
|
30838
30838
|
queryFn: async () => !e || !t.transport.getActivity ? null : t.transport.getActivity(e),
|
|
@@ -30841,7 +30841,7 @@ const ja = 30 * 1e3, Ga = 5 * 60 * 1e3, _3 = 20, sn = {
|
|
|
30841
30841
|
gcTime: Ga
|
|
30842
30842
|
});
|
|
30843
30843
|
}, WVe = (e) => {
|
|
30844
|
-
const t =
|
|
30844
|
+
const t = Pe(), { enabled: n = !0, ...r } = e ?? {};
|
|
30845
30845
|
return mr({
|
|
30846
30846
|
queryKey: sn.summary(r),
|
|
30847
30847
|
queryFn: async () => t.transport.getActivitySummary ? t.transport.getActivitySummary(r) : [],
|
|
@@ -30850,7 +30850,7 @@ const ja = 30 * 1e3, Ga = 5 * 60 * 1e3, _3 = 20, sn = {
|
|
|
30850
30850
|
gcTime: Ga
|
|
30851
30851
|
});
|
|
30852
30852
|
}, KVe = (e) => {
|
|
30853
|
-
const t =
|
|
30853
|
+
const t = Pe(), { enabled: n = !0, groupId: r, parentId: a, from: i, to: o, tenant: s, ownerId: l } = e ?? {}, u = i instanceof Date ? i.toISOString() : i, d = o instanceof Date ? o.toISOString() : o;
|
|
30854
30854
|
return mr({
|
|
30855
30855
|
queryKey: sn.sourceTypes({ groupId: r, parentId: a, from: u, to: d, tenant: s, ownerId: l }),
|
|
30856
30856
|
queryFn: async () => t.transport.listActivitySourceTypes ? t.transport.listActivitySourceTypes({
|
|
@@ -30883,7 +30883,7 @@ const E3 = 30 * 1e3, M3 = 5 * 60 * 1e3, S3 = 20, Er = {
|
|
|
30883
30883
|
infinite: (e) => [...Er.infinites(), e],
|
|
30884
30884
|
detail: (e) => [...Er.all, "detail", e]
|
|
30885
30885
|
}, YVe = (e) => e?.pages.flatMap((t) => t.data) ?? [], n7e = (e) => {
|
|
30886
|
-
const t =
|
|
30886
|
+
const t = Pe(), n = t.config.user?.id ?? ra(), r = t.config.appId, {
|
|
30887
30887
|
pageSize: a = S3,
|
|
30888
30888
|
sortOrder: i = "desc",
|
|
30889
30889
|
sortField: o = "updatedAt",
|
|
@@ -30910,7 +30910,7 @@ const E3 = 30 * 1e3, M3 = 5 * 60 * 1e3, S3 = 20, Er = {
|
|
|
30910
30910
|
gcTime: M3
|
|
30911
30911
|
});
|
|
30912
30912
|
}, r7e = n7e, ZVe = (e) => {
|
|
30913
|
-
const t =
|
|
30913
|
+
const t = Pe(), n = t.config.user?.id ?? ra(), r = t.config.appId, {
|
|
30914
30914
|
page: a,
|
|
30915
30915
|
pageSize: i = S3,
|
|
30916
30916
|
sortOrder: o = "desc",
|
|
@@ -30942,7 +30942,7 @@ const E3 = 30 * 1e3, M3 = 5 * 60 * 1e3, S3 = 20, Er = {
|
|
|
30942
30942
|
};
|
|
30943
30943
|
}, N3 = (e) => {
|
|
30944
30944
|
const t = r7e(e), n = fe((r) => r.hydrateChats);
|
|
30945
|
-
return
|
|
30945
|
+
return Fe(() => {
|
|
30946
30946
|
if (t.data?.pages) {
|
|
30947
30947
|
const r = t.data.pages.flatMap((a) => a.data);
|
|
30948
30948
|
n(r);
|
|
@@ -30962,7 +30962,7 @@ const E3 = 30 * 1e3, M3 = 5 * 60 * 1e3, S3 = 20, Er = {
|
|
|
30962
30962
|
const g = h();
|
|
30963
30963
|
l(g), g && (u.current = !1);
|
|
30964
30964
|
}, [h]);
|
|
30965
|
-
return
|
|
30965
|
+
return Fe(() => {
|
|
30966
30966
|
const g = i.current;
|
|
30967
30967
|
if (!g)
|
|
30968
30968
|
return;
|
|
@@ -30980,7 +30980,7 @@ const E3 = 30 * 1e3, M3 = 5 * 60 * 1e3, S3 = 20, Er = {
|
|
|
30980
30980
|
return g.addEventListener("scroll", b, { passive: !0 }), () => {
|
|
30981
30981
|
g.removeEventListener("scroll", b), k && clearTimeout(k);
|
|
30982
30982
|
};
|
|
30983
|
-
}, [h, f]),
|
|
30983
|
+
}, [h, f]), Fe(() => {
|
|
30984
30984
|
if (!a)
|
|
30985
30985
|
return;
|
|
30986
30986
|
const g = i.current;
|
|
@@ -31001,13 +31001,13 @@ const E3 = 30 * 1e3, M3 = 5 * 60 * 1e3, S3 = 20, Er = {
|
|
|
31001
31001
|
}), () => {
|
|
31002
31002
|
_.disconnect(), p.current && cancelAnimationFrame(p.current);
|
|
31003
31003
|
};
|
|
31004
|
-
}, [s, a, m, f]),
|
|
31004
|
+
}, [s, a, m, f]), Fe(() => {
|
|
31005
31005
|
t.length !== 0 && !u.current && s && (p.current && cancelAnimationFrame(p.current), p.current = requestAnimationFrame(() => {
|
|
31006
31006
|
d.current = !0, m(), setTimeout(() => {
|
|
31007
31007
|
d.current = !1;
|
|
31008
31008
|
}, 50);
|
|
31009
31009
|
}));
|
|
31010
|
-
}, [...t]),
|
|
31010
|
+
}, [...t]), Fe(() => {
|
|
31011
31011
|
if (r && i.current) {
|
|
31012
31012
|
const g = window.setTimeout(() => {
|
|
31013
31013
|
d.current = !0, m(), setTimeout(() => {
|
|
@@ -31026,7 +31026,7 @@ const E3 = 30 * 1e3, M3 = 5 * 60 * 1e3, S3 = 20, Er = {
|
|
|
31026
31026
|
checkIsNearBottom: h
|
|
31027
31027
|
};
|
|
31028
31028
|
}, a7e = () => {
|
|
31029
|
-
const e =
|
|
31029
|
+
const e = Pe();
|
|
31030
31030
|
return mr({
|
|
31031
31031
|
queryKey: ["mp-agents", "models"],
|
|
31032
31032
|
queryFn: async () => e.transport.listModels ? await e.transport.listModels() : [],
|
|
@@ -31047,7 +31047,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31047
31047
|
pageContextDismissed: !1,
|
|
31048
31048
|
status: "idle"
|
|
31049
31049
|
/* Idle */
|
|
31050
|
-
}), i7e = Object.freeze(A3()),
|
|
31050
|
+
}), i7e = Object.freeze(A3()), Oe = (e, t) => e.chatState[t] ?? i7e, o7e = (e) => q7()((t, n) => ({
|
|
31051
31051
|
contextKey: e,
|
|
31052
31052
|
activeChatId: void 0,
|
|
31053
31053
|
draftChatKey: `draft-${Tt()}`,
|
|
@@ -31083,7 +31083,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31083
31083
|
};
|
|
31084
31084
|
}),
|
|
31085
31085
|
upsertChatState: (r, a) => t((i) => {
|
|
31086
|
-
const o =
|
|
31086
|
+
const o = Oe(i, r), s = typeof a == "function" ? a(o) : a, l = { ...o, ...s };
|
|
31087
31087
|
return {
|
|
31088
31088
|
chatState: { ...i.chatState, [r]: l }
|
|
31089
31089
|
};
|
|
@@ -31113,7 +31113,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31113
31113
|
};
|
|
31114
31114
|
}),
|
|
31115
31115
|
pushReasoning: (r, a) => t((i) => {
|
|
31116
|
-
const o =
|
|
31116
|
+
const o = Oe(i, r);
|
|
31117
31117
|
return {
|
|
31118
31118
|
chatState: {
|
|
31119
31119
|
...i.chatState,
|
|
@@ -31122,7 +31122,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31122
31122
|
};
|
|
31123
31123
|
}),
|
|
31124
31124
|
setArtifacts: (r, a) => t((i) => {
|
|
31125
|
-
const o =
|
|
31125
|
+
const o = Oe(i, r);
|
|
31126
31126
|
return {
|
|
31127
31127
|
chatState: {
|
|
31128
31128
|
...i.chatState,
|
|
@@ -31137,7 +31137,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31137
31137
|
}
|
|
31138
31138
|
})),
|
|
31139
31139
|
setComposerDraft: (r, a) => t((i) => {
|
|
31140
|
-
const o =
|
|
31140
|
+
const o = Oe(i, r);
|
|
31141
31141
|
return {
|
|
31142
31142
|
chatState: {
|
|
31143
31143
|
...i.chatState,
|
|
@@ -31149,7 +31149,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31149
31149
|
};
|
|
31150
31150
|
}),
|
|
31151
31151
|
setComposerValue: (r, a) => t((i) => {
|
|
31152
|
-
const o =
|
|
31152
|
+
const o = Oe(i, r);
|
|
31153
31153
|
return {
|
|
31154
31154
|
chatState: {
|
|
31155
31155
|
...i.chatState,
|
|
@@ -31161,7 +31161,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31161
31161
|
};
|
|
31162
31162
|
}),
|
|
31163
31163
|
addComposerAttachments: (r, a) => t((i) => {
|
|
31164
|
-
const o =
|
|
31164
|
+
const o = Oe(i, r), s = o.composerDraft.attachments ?? [];
|
|
31165
31165
|
if (!a || a.length === 0)
|
|
31166
31166
|
return i;
|
|
31167
31167
|
const l = s.find(ii), u = a.find(ii);
|
|
@@ -31193,7 +31193,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31193
31193
|
};
|
|
31194
31194
|
}),
|
|
31195
31195
|
removeComposerAttachment: (r, a) => t((i) => {
|
|
31196
|
-
const o =
|
|
31196
|
+
const o = Oe(i, r);
|
|
31197
31197
|
return {
|
|
31198
31198
|
chatState: {
|
|
31199
31199
|
...i.chatState,
|
|
@@ -31208,7 +31208,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31208
31208
|
};
|
|
31209
31209
|
}),
|
|
31210
31210
|
clearComposerDraft: (r) => t((a) => {
|
|
31211
|
-
const i =
|
|
31211
|
+
const i = Oe(a, r);
|
|
31212
31212
|
return {
|
|
31213
31213
|
chatState: {
|
|
31214
31214
|
...a.chatState,
|
|
@@ -31220,7 +31220,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31220
31220
|
};
|
|
31221
31221
|
}),
|
|
31222
31222
|
setComposerError: (r, a) => t((i) => {
|
|
31223
|
-
const o =
|
|
31223
|
+
const o = Oe(i, r);
|
|
31224
31224
|
return {
|
|
31225
31225
|
chatState: {
|
|
31226
31226
|
...i.chatState,
|
|
@@ -31229,7 +31229,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31229
31229
|
};
|
|
31230
31230
|
}),
|
|
31231
31231
|
setPageContextDismissed: (r, a) => t((i) => {
|
|
31232
|
-
const o =
|
|
31232
|
+
const o = Oe(i, r);
|
|
31233
31233
|
return {
|
|
31234
31234
|
chatState: {
|
|
31235
31235
|
...i.chatState,
|
|
@@ -31238,7 +31238,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31238
31238
|
};
|
|
31239
31239
|
}),
|
|
31240
31240
|
setChatStatus: (r, a) => t((i) => {
|
|
31241
|
-
const o =
|
|
31241
|
+
const o = Oe(i, r);
|
|
31242
31242
|
return {
|
|
31243
31243
|
chatState: {
|
|
31244
31244
|
...i.chatState,
|
|
@@ -31247,7 +31247,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31247
31247
|
};
|
|
31248
31248
|
}),
|
|
31249
31249
|
setPendingAssistant: (r, a) => t((i) => {
|
|
31250
|
-
const o =
|
|
31250
|
+
const o = Oe(i, r);
|
|
31251
31251
|
return {
|
|
31252
31252
|
chatState: {
|
|
31253
31253
|
...i.chatState,
|
|
@@ -31256,7 +31256,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31256
31256
|
};
|
|
31257
31257
|
}),
|
|
31258
31258
|
commitPendingAssistant: (r) => t((a) => {
|
|
31259
|
-
const i =
|
|
31259
|
+
const i = Oe(a, r), o = i.pendingAssistant;
|
|
31260
31260
|
if (!o)
|
|
31261
31261
|
return a;
|
|
31262
31262
|
if (!a.chats[r])
|
|
@@ -31284,7 +31284,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31284
31284
|
};
|
|
31285
31285
|
}),
|
|
31286
31286
|
enqueueQueuedMessage: (r, a, i) => t((o) => {
|
|
31287
|
-
const s =
|
|
31287
|
+
const s = Oe(o, r), l = {
|
|
31288
31288
|
id: Tt(),
|
|
31289
31289
|
content: a,
|
|
31290
31290
|
...i && i.length > 0 ? { attachments: i } : {},
|
|
@@ -31298,7 +31298,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31298
31298
|
};
|
|
31299
31299
|
}),
|
|
31300
31300
|
removeQueuedMessage: (r, a) => t((i) => {
|
|
31301
|
-
const o =
|
|
31301
|
+
const o = Oe(i, r);
|
|
31302
31302
|
if (o.messageQueue.length === 0)
|
|
31303
31303
|
return i;
|
|
31304
31304
|
const s = o.messageQueue.filter((l) => l.id !== a);
|
|
@@ -31309,7 +31309,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31309
31309
|
moveChatKeyState: (r, a) => t((i) => {
|
|
31310
31310
|
if (r === a)
|
|
31311
31311
|
return i;
|
|
31312
|
-
const o =
|
|
31312
|
+
const o = Oe(i, r), s = Oe(i, a);
|
|
31313
31313
|
if (!(o.messageQueue.length > 0 || !!o.pendingAssistant || o.status !== "idle" || o.composerDraft.value.length > 0 || o.composerDraft.attachments.length > 0 || !!o.composerError))
|
|
31314
31314
|
return i;
|
|
31315
31315
|
const u = o.composerDraft.value.length > 0 || o.composerDraft.attachments.length > 0, d = s.composerDraft.value.length > 0 || s.composerDraft.attachments.length > 0, p = {
|
|
@@ -31332,7 +31332,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31332
31332
|
};
|
|
31333
31333
|
}),
|
|
31334
31334
|
appendSystemMessage: (r, a) => t((i) => {
|
|
31335
|
-
const o =
|
|
31335
|
+
const o = Oe(i, r), s = {
|
|
31336
31336
|
id: Tt(),
|
|
31337
31337
|
chat: r,
|
|
31338
31338
|
content: a,
|
|
@@ -31347,7 +31347,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31347
31347
|
};
|
|
31348
31348
|
}),
|
|
31349
31349
|
upsertToolCall: (r, a) => t((i) => {
|
|
31350
|
-
const o =
|
|
31350
|
+
const o = Oe(i, r), s = [...o.messages], l = s.findIndex(
|
|
31351
31351
|
(u) => u.role === We.Tool && u.toolCalls?.some((d) => d.id === a.id)
|
|
31352
31352
|
);
|
|
31353
31353
|
if (l >= 0) {
|
|
@@ -31377,13 +31377,13 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31377
31377
|
isChatHistoryOpen: !r.isChatHistoryOpen
|
|
31378
31378
|
})),
|
|
31379
31379
|
setChatMessages: (r, a) => t((i) => {
|
|
31380
|
-
const o =
|
|
31380
|
+
const o = Oe(i, r), s = o.messages ?? [], l = typeof a == "function" ? a(s) : a;
|
|
31381
31381
|
return {
|
|
31382
31382
|
chatState: { ...i.chatState, [r]: { ...o, messages: l } }
|
|
31383
31383
|
};
|
|
31384
31384
|
}),
|
|
31385
31385
|
appendMessagesToChat: (r, a) => t((i) => {
|
|
31386
|
-
const o =
|
|
31386
|
+
const o = Oe(i, r);
|
|
31387
31387
|
if (a.length === 0)
|
|
31388
31388
|
return i;
|
|
31389
31389
|
const s = new Set(a.map((d) => d.id)), u = [...o.messages.filter((d) => !s.has(d.id)), ...a].sort((d, p) => d.createdAt.localeCompare(p.createdAt));
|
|
@@ -31395,7 +31395,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31395
31395
|
};
|
|
31396
31396
|
})
|
|
31397
31397
|
})), s7e = () => {
|
|
31398
|
-
const e = fe((s) => s.activeChatId ?? s.draftChatKey), t = fe((s) =>
|
|
31398
|
+
const e = fe((s) => s.activeChatId ?? s.draftChatKey), t = fe((s) => Oe(s, e).composerDraft), n = fe((s) => s.setComposerValue), r = fe((s) => s.setComposerDraft), a = fe((s) => s.clearComposerDraft), i = fe((s) => s.addComposerAttachments), o = fe((s) => s.removeComposerAttachment);
|
|
31399
31399
|
return {
|
|
31400
31400
|
chatKey: e,
|
|
31401
31401
|
draft: t,
|
|
@@ -31406,7 +31406,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31406
31406
|
removeAttachment: (s) => o(e, s)
|
|
31407
31407
|
};
|
|
31408
31408
|
}, l7e = (e) => {
|
|
31409
|
-
const t =
|
|
31409
|
+
const t = Pe();
|
|
31410
31410
|
return mr({
|
|
31411
31411
|
queryKey: ["mp-agents", "configurations", e ?? "all"],
|
|
31412
31412
|
queryFn: async () => t.transport.listAgentConfigurations ? t.transport.listAgentConfigurations(e) : [],
|
|
@@ -31414,17 +31414,17 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31414
31414
|
refetchOnWindowFocus: !1
|
|
31415
31415
|
});
|
|
31416
31416
|
}, QVe = (e, t = []) => {
|
|
31417
|
-
const n =
|
|
31417
|
+
const n = Pe(), r = Ve(e), a = Ge(e, t);
|
|
31418
31418
|
r.current = a;
|
|
31419
31419
|
const i = Ge((o) => r.current(o), []);
|
|
31420
|
-
|
|
31420
|
+
Fe(() => n.registerPageContextProvider(i), [n, i]);
|
|
31421
31421
|
}, JVe = (e, t = []) => {
|
|
31422
|
-
const n =
|
|
31422
|
+
const n = Pe(), r = Ve(e), a = Ge(e, t);
|
|
31423
31423
|
r.current = a;
|
|
31424
31424
|
const i = Ge((o) => r.current(o), []);
|
|
31425
|
-
|
|
31425
|
+
Fe(() => n.registerChatMetadataProvider(i), [n, i]);
|
|
31426
31426
|
}, c7e = (e) => {
|
|
31427
|
-
const t =
|
|
31427
|
+
const t = Pe();
|
|
31428
31428
|
return Ge(
|
|
31429
31429
|
(r) => {
|
|
31430
31430
|
t.events.dispatchEvent(
|
|
@@ -31436,12 +31436,12 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31436
31436
|
[t, e]
|
|
31437
31437
|
);
|
|
31438
31438
|
}, u7e = (e, t, n = [], r) => {
|
|
31439
|
-
const a =
|
|
31439
|
+
const a = Pe(), i = Ve(t), o = Ge(t, n);
|
|
31440
31440
|
i.current = o;
|
|
31441
31441
|
const s = Ge((u) => {
|
|
31442
31442
|
i.current(u);
|
|
31443
31443
|
}, []), l = typeof r == "boolean" ? r : r?.capture;
|
|
31444
|
-
|
|
31444
|
+
Fe(() => (a.events.addEventListener(e, s, r), () => {
|
|
31445
31445
|
a.events.removeEventListener(e, s, l);
|
|
31446
31446
|
}), [a, e, s, l]);
|
|
31447
31447
|
}, eje = ({ formId: e, onApply: t, enabled: n = !0 }) => {
|
|
@@ -31453,7 +31453,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31453
31453
|
[n, e, t]
|
|
31454
31454
|
);
|
|
31455
31455
|
}, d7e = ["mp-agents", "configurations"], p7e = () => {
|
|
31456
|
-
const e =
|
|
31456
|
+
const e = Pe(), t = $7(), n = () => t.invalidateQueries({
|
|
31457
31457
|
queryKey: d7e
|
|
31458
31458
|
}), r = r2({
|
|
31459
31459
|
mutationFn: async ({ agentName: i, input: o }) => {
|
|
@@ -31475,20 +31475,20 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31475
31475
|
upsertBatch: a
|
|
31476
31476
|
};
|
|
31477
31477
|
}, h7e = () => {
|
|
31478
|
-
const e =
|
|
31478
|
+
const e = Pe(), t = fe((s) => s.activeChatId), n = fe((s) => s.upsertChat), r = fe((s) => s.setActiveChat), a = fe((s) => s.setChatStatus), o = mr({
|
|
31479
31479
|
queryKey: ["mp-agents", "chat", t],
|
|
31480
31480
|
queryFn: () => e.transport.getChat(t),
|
|
31481
31481
|
enabled: !!t,
|
|
31482
31482
|
staleTime: 6e4,
|
|
31483
31483
|
retry: !1
|
|
31484
31484
|
});
|
|
31485
|
-
return
|
|
31485
|
+
return Fe(() => {
|
|
31486
31486
|
o.data && (n(o.data), a(o.data.id, Ia(o.data.status)));
|
|
31487
|
-
}, [o.data, n, a]),
|
|
31487
|
+
}, [o.data, n, a]), Fe(() => {
|
|
31488
31488
|
o.isError && t && r(void 0);
|
|
31489
31489
|
}, [o.isError, t, r]), o;
|
|
31490
31490
|
}, m7e = 20, T3 = (e, t) => {
|
|
31491
|
-
const n = t?.requireRegisteredChat ?? !0, r =
|
|
31491
|
+
const n = t?.requireRegisteredChat ?? !0, r = Pe(), a = r.config.messagesPageSize ?? m7e, i = fe((l) => l.setChatMessages), o = fe((l) => !!(e && l.chats[e])), s = sp({
|
|
31492
31492
|
queryKey: ["mp-agents", "messages", e, a],
|
|
31493
31493
|
queryFn: async ({ pageParam: l }) => {
|
|
31494
31494
|
if (!e || !r.transport.getMessages)
|
|
@@ -31503,7 +31503,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31503
31503
|
enabled: (t?.enabled ?? !0) && !!e && !!r.transport.getMessages && (!n || o),
|
|
31504
31504
|
retry: !1
|
|
31505
31505
|
});
|
|
31506
|
-
return
|
|
31506
|
+
return Fe(() => {
|
|
31507
31507
|
if (!e || !s.data?.pages)
|
|
31508
31508
|
return;
|
|
31509
31509
|
const u = s.data.pages.slice().reverse().flatMap((p) => p.messages), d = new Set(u.map((p) => p.id));
|
|
@@ -31513,7 +31513,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31513
31513
|
});
|
|
31514
31514
|
}, [e, s.data, i]), s;
|
|
31515
31515
|
}, f7e = () => {
|
|
31516
|
-
const e =
|
|
31516
|
+
const e = Pe(), t = e.config.user?.id ?? ra(), n = fe((u) => u.activeChatId), r = fe((u) => u.removeChat), a = fe((u) => u.setActiveChat), [i, o] = Ze(/* @__PURE__ */ new Set()), s = Ge(
|
|
31517
31517
|
async (u) => {
|
|
31518
31518
|
o((d) => new Set(d).add(u));
|
|
31519
31519
|
try {
|
|
@@ -31562,15 +31562,15 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31562
31562
|
applyAllButtonText: n,
|
|
31563
31563
|
showStatus: r = !0
|
|
31564
31564
|
}) => {
|
|
31565
|
-
const a =
|
|
31565
|
+
const a = Pe(), i = c7e(W5), o = fn(), s = ot(() => y7e(e), [e]), [l, u] = Ze(/* @__PURE__ */ new Set()), d = ot(() => {
|
|
31566
31566
|
const x = (e.output ?? {})?._mp?.lastAction, D = typeof x?.action == "string" ? x.action : void 0, P = typeof x?.at == "string" ? x.at : void 0;
|
|
31567
31567
|
return { action: D, at: P };
|
|
31568
|
-
}, [e.output]), p =
|
|
31569
|
-
() => e.status ===
|
|
31568
|
+
}, [e.output]), p = ot(() => d.action === "apply", [d.action]), h = ot(() => d.action === "reject", [d.action]), m = ot(
|
|
31569
|
+
() => e.status === rt.Succeeded && !!s.formId && s.fields.length > 0 && !p,
|
|
31570
31570
|
[e.status, s.formId, s.fields.length, p]
|
|
31571
31571
|
);
|
|
31572
|
-
|
|
31573
|
-
() => e.status ===
|
|
31572
|
+
ot(
|
|
31573
|
+
() => e.status === rt.Succeeded && !!s.formId && s.fields.length > 0 && !p && !h,
|
|
31574
31574
|
[e.status, s.formId, s.fields.length, p, h]
|
|
31575
31575
|
);
|
|
31576
31576
|
const f = Ge(
|
|
@@ -31639,7 +31639,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31639
31639
|
), b = Ge(() => {
|
|
31640
31640
|
g(s.fields);
|
|
31641
31641
|
}, [g, s.fields]), w = s.formName ? `${o.formProposalHeaderPrefix} ${s.formName}` : `${o.formProposalHeaderPrefix} ${s.formId}`;
|
|
31642
|
-
return e.status ===
|
|
31642
|
+
return e.status === rt.Failed && e.error ? /* @__PURE__ */ T("div", { className: "mp-agent-tool-body", children: /* @__PURE__ */ T("div", { className: "mp-agent-tool-simple-message", children: o.formProposalFailed }) }) : e.status !== rt.Succeeded ? /* @__PURE__ */ T("div", { className: "mp-agent-tool-simple-message", children: o.formProposalPreparing }) : !s.formId || s.fields.length === 0 ? /* @__PURE__ */ T("div", { className: "mp-agent-tool-simple-message", children: o.formProposalNone }) : /* @__PURE__ */ re("div", { className: "mp-agent-tool-body", children: [
|
|
31643
31643
|
/* @__PURE__ */ T("div", { className: "mp-agent-tool-simple-message", children: w }),
|
|
31644
31644
|
s.notes ? /* @__PURE__ */ T("div", { className: "mp-agent-tool-simple-message", children: s.notes }) : null,
|
|
31645
31645
|
/* @__PURE__ */ T("div", { className: "mp-agent-form-proposal-fields", children: s.fields.map((E) => /* @__PURE__ */ T(
|
|
@@ -31681,7 +31681,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31681
31681
|
images: n
|
|
31682
31682
|
};
|
|
31683
31683
|
}, v7e = ({ call: e }) => {
|
|
31684
|
-
const t =
|
|
31684
|
+
const t = Pe(), n = fn(), r = ot(() => k7e(e), [e]), [a, i] = Ze({}), o = Ve(/* @__PURE__ */ new Set()), s = Ge(
|
|
31685
31685
|
async (u) => {
|
|
31686
31686
|
if (!u.s3Key || o.current.has(u.attachmentId))
|
|
31687
31687
|
return;
|
|
@@ -31705,7 +31705,7 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31705
31705
|
},
|
|
31706
31706
|
[t.config.transport]
|
|
31707
31707
|
);
|
|
31708
|
-
|
|
31708
|
+
Fe(() => {
|
|
31709
31709
|
r.images.filter((u) => !u.url).forEach((u) => void s(u));
|
|
31710
31710
|
}, [r.images, s]);
|
|
31711
31711
|
const l = Ge(async (u, d) => {
|
|
@@ -31716,10 +31716,10 @@ const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingF
|
|
|
31716
31716
|
window.open(d, "_blank", "noreferrer");
|
|
31717
31717
|
}
|
|
31718
31718
|
}, []);
|
|
31719
|
-
return e.status ===
|
|
31719
|
+
return e.status === rt.Failed || r.error ? /* @__PURE__ */ re("div", { className: "mp-agent-tool-body", children: [
|
|
31720
31720
|
/* @__PURE__ */ T("div", { className: "mp-agent-tool-simple-message", children: n.imageGenerationFailed }),
|
|
31721
31721
|
r.error ? /* @__PURE__ */ T("div", { className: "mp-agent-tool-error", children: r.error }) : null
|
|
31722
|
-
] }) : e.status !==
|
|
31722
|
+
] }) : e.status !== rt.Succeeded ? /* @__PURE__ */ T("div", { className: "mp-agent-tool-body mp-agent-image-tool", children: /* @__PURE__ */ re("div", { className: "mp-agent-image-tool-loading", children: [
|
|
31723
31723
|
/* @__PURE__ */ T(bd, { size: 16 }),
|
|
31724
31724
|
/* @__PURE__ */ T("span", { children: n.imageGenerationGenerating })
|
|
31725
31725
|
] }) }) : r.images.length ? /* @__PURE__ */ T("div", { className: "mp-agent-tool-body mp-agent-image-tool", children: /* @__PURE__ */ T("div", { className: "mp-agent-image-tool-grid", children: r.images.map((u) => {
|
|
@@ -32128,7 +32128,7 @@ class M7e {
|
|
|
32128
32128
|
id: Tt(),
|
|
32129
32129
|
name: t,
|
|
32130
32130
|
input: n,
|
|
32131
|
-
status:
|
|
32131
|
+
status: rt.Running
|
|
32132
32132
|
};
|
|
32133
32133
|
this.writeToolCall(a, i);
|
|
32134
32134
|
const o = this.buildToolContext(a);
|
|
@@ -32138,7 +32138,7 @@ class M7e {
|
|
|
32138
32138
|
} catch (s) {
|
|
32139
32139
|
const l = {
|
|
32140
32140
|
...i,
|
|
32141
|
-
status:
|
|
32141
|
+
status: rt.Failed,
|
|
32142
32142
|
error: s instanceof Error ? s.message : "Unknown tool error"
|
|
32143
32143
|
};
|
|
32144
32144
|
throw this.writeToolCall(a, l), s;
|
|
@@ -32175,7 +32175,7 @@ const S7e = {
|
|
|
32175
32175
|
"--mp-agents-radius": e.radius,
|
|
32176
32176
|
"--mp-agents-font-size": e.fontSize
|
|
32177
32177
|
}), A7e = ({ value: e, children: t }) => {
|
|
32178
|
-
const n =
|
|
32178
|
+
const n = ot(() => C3(e), [e]);
|
|
32179
32179
|
return /* @__PURE__ */ re(R3.Provider, { value: n, children: [
|
|
32180
32180
|
/* @__PURE__ */ T("style", { children: `:root {
|
|
32181
32181
|
${Object.entries(N7e(n)).map(([r, a]) => `${r}: ${a};`).join(`
|
|
@@ -34550,10 +34550,10 @@ Object.assign(zi, {
|
|
|
34550
34550
|
connect: zi
|
|
34551
34551
|
});
|
|
34552
34552
|
const A_e = ip(null), T_e = ({ children: e }) => {
|
|
34553
|
-
const t =
|
|
34554
|
-
|
|
34553
|
+
const t = Pe(), n = fe((k) => k.upsertChat), r = fe((k) => k.upsertChatState), a = fe((k) => k.contextKey), i = fe((k) => k.activeChatId), o = ot(() => t.config.user?.id ?? ra(), [t.config.user?.id]), s = t.config.transport, [l, u] = Ze(null), [d, p] = Ze(void 0), h = Ve(a), m = Ve(n), f = Ve(r), g = Ve(void 0);
|
|
34554
|
+
Fe(() => {
|
|
34555
34555
|
h.current = a, m.current = n, f.current = r;
|
|
34556
|
-
}, [a, n, r]),
|
|
34556
|
+
}, [a, n, r]), Fe(() => {
|
|
34557
34557
|
if (s.mode !== "proxy") {
|
|
34558
34558
|
u(null), p(void 0), t.setSocketClient(null), t.transport instanceof Gr && t.transport.setSocketId(void 0);
|
|
34559
34559
|
return;
|
|
@@ -34577,14 +34577,14 @@ const A_e = ip(null), T_e = ({ children: e }) => {
|
|
|
34577
34577
|
}, W = (j) => {
|
|
34578
34578
|
if (j.contextKey === h.current) {
|
|
34579
34579
|
m.current(j);
|
|
34580
|
-
const z = t.store.getState(), V =
|
|
34580
|
+
const z = t.store.getState(), V = Oe(z, j.id);
|
|
34581
34581
|
f.current(j.id, {
|
|
34582
34582
|
...V,
|
|
34583
34583
|
status: Ia(j.status)
|
|
34584
34584
|
});
|
|
34585
34585
|
}
|
|
34586
34586
|
}, R = (j) => {
|
|
34587
|
-
const z = t.store.getState(), V =
|
|
34587
|
+
const z = t.store.getState(), V = Oe(z, j.chat), N = V.messages.findIndex((K) => K.id === j.id);
|
|
34588
34588
|
if (N >= 0) {
|
|
34589
34589
|
const K = [...V.messages];
|
|
34590
34590
|
K[N] = j, f.current(j.chat, {
|
|
@@ -34599,7 +34599,7 @@ const A_e = ip(null), T_e = ({ children: e }) => {
|
|
|
34599
34599
|
});
|
|
34600
34600
|
}, H = (j) => {
|
|
34601
34601
|
m.current(j);
|
|
34602
|
-
const z = t.store.getState(), V =
|
|
34602
|
+
const z = t.store.getState(), V = Oe(z, j.id);
|
|
34603
34603
|
f.current(j.id, {
|
|
34604
34604
|
...V,
|
|
34605
34605
|
status: Ia(j.status)
|
|
@@ -34620,19 +34620,19 @@ const A_e = ip(null), T_e = ({ children: e }) => {
|
|
|
34620
34620
|
s.mode === "proxy" ? s.socketNamespace : void 0,
|
|
34621
34621
|
s.mode === "proxy" ? JSON.stringify(s.headers ?? {}) : "",
|
|
34622
34622
|
o
|
|
34623
|
-
]),
|
|
34623
|
+
]), Fe(() => {
|
|
34624
34624
|
if (!l)
|
|
34625
34625
|
return;
|
|
34626
34626
|
const k = g.current;
|
|
34627
34627
|
k && k !== i && l.emit("chat:unsubscribe", { chatId: k }), i && i !== k && (l.emit("chat:subscribe", { chatId: i }), g.current = i), i || (g.current = void 0);
|
|
34628
34628
|
}, [l, i]);
|
|
34629
|
-
const _ =
|
|
34629
|
+
const _ = ot(() => ({ socket: l, socketId: d }), [l, d]);
|
|
34630
34630
|
return /* @__PURE__ */ T(A_e.Provider, { value: _, children: e });
|
|
34631
34631
|
}, Lp = ip(null), nje = ({ config: e, children: t }) => {
|
|
34632
34632
|
const n = Ve();
|
|
34633
34633
|
n.current || (n.current = new M7e(e));
|
|
34634
34634
|
const [, r] = Ze(0);
|
|
34635
|
-
|
|
34635
|
+
Fe(() => {
|
|
34636
34636
|
const o = n.current, s = () => r((l) => l + 1);
|
|
34637
34637
|
return o.events.addEventListener("runtime:transport-config-changed", s), () => {
|
|
34638
34638
|
o.events.removeEventListener("runtime:transport-config-changed", s);
|
|
@@ -34648,8 +34648,8 @@ const A_e = ip(null), T_e = ({ children: e }) => {
|
|
|
34648
34648
|
);
|
|
34649
34649
|
a.current.getState().setComposerOptions({ model: s });
|
|
34650
34650
|
}
|
|
34651
|
-
const i =
|
|
34652
|
-
return
|
|
34651
|
+
const i = ot(() => ({ runtime: n.current, store: a.current }), []);
|
|
34652
|
+
return Fe(() => {
|
|
34653
34653
|
const o = a.current;
|
|
34654
34654
|
if (!o)
|
|
34655
34655
|
return;
|
|
@@ -34663,7 +34663,7 @@ const A_e = ip(null), T_e = ({ children: e }) => {
|
|
|
34663
34663
|
L7e(u, l);
|
|
34664
34664
|
});
|
|
34665
34665
|
}, []), /* @__PURE__ */ T(Lp.Provider, { value: i, children: /* @__PURE__ */ T(P7, { client: i.runtime.queryClient, children: /* @__PURE__ */ T(A7e, { value: i.runtime.config.theme, children: /* @__PURE__ */ T(T_e, { children: t }) }) }) });
|
|
34666
|
-
},
|
|
34666
|
+
}, Pe = () => {
|
|
34667
34667
|
const e = op(Lp);
|
|
34668
34668
|
if (!e)
|
|
34669
34669
|
throw new Error("useAgentRuntime must be used inside <AgentProvider />");
|
|
@@ -34679,7 +34679,7 @@ const A_e = ip(null), T_e = ({ children: e }) => {
|
|
|
34679
34679
|
multiUser: n = !1,
|
|
34680
34680
|
participantIds: r = []
|
|
34681
34681
|
}) => {
|
|
34682
|
-
const a =
|
|
34682
|
+
const a = Pe(), {
|
|
34683
34683
|
composer: i,
|
|
34684
34684
|
contextKey: o,
|
|
34685
34685
|
activeChatId: s,
|
|
@@ -34698,7 +34698,7 @@ const A_e = ip(null), T_e = ({ children: e }) => {
|
|
|
34698
34698
|
commitPendingAssistant: E,
|
|
34699
34699
|
setPageContextDismissed: S
|
|
34700
34700
|
} = fe((V) => {
|
|
34701
|
-
const N = V.activeChatId ?? V.draftChatKey, K =
|
|
34701
|
+
const N = V.activeChatId ?? V.draftChatKey, K = Oe(V, N);
|
|
34702
34702
|
return {
|
|
34703
34703
|
composer: V.composer,
|
|
34704
34704
|
contextKey: V.contextKey,
|
|
@@ -34751,7 +34751,7 @@ const A_e = ip(null), T_e = ({ children: e }) => {
|
|
|
34751
34751
|
}
|
|
34752
34752
|
const Ie = a.getChatMetadata({ contextKey: o });
|
|
34753
34753
|
Ie && (ke = { ...ke ?? {}, ...Ie });
|
|
34754
|
-
const
|
|
34754
|
+
const qe = a.store.getState(), Je = s ? qe.chats[s] : void 0, ct = (s ? qe.chatState[s] : void 0)?.messages ?? [], xt = N.filter((pe) => Y3(pe) ? !R_e(ct, pe) : !0), et = Je?.model, ie = i.model !== et;
|
|
34755
34755
|
let we, xe = !1;
|
|
34756
34756
|
ie ? (we = i.model, xe = !0) : et ? (we = et, xe = !1) : (we = void 0, xe = !1);
|
|
34757
34757
|
const Ye = I_e(V), ue = {
|
|
@@ -34768,12 +34768,12 @@ const A_e = ip(null), T_e = ({ children: e }) => {
|
|
|
34768
34768
|
senderDisplayName: a.config.user?.displayName,
|
|
34769
34769
|
senderAvatarUrl: a.config.user?.avatarUrl
|
|
34770
34770
|
} : {}
|
|
34771
|
-
},
|
|
34771
|
+
}, De = () => {
|
|
34772
34772
|
k(se.current, void 0);
|
|
34773
34773
|
}, Ue = (pe) => {
|
|
34774
34774
|
if (pe?.name === "AbortError") {
|
|
34775
34775
|
const be = C.current ?? se.current;
|
|
34776
|
-
return I.current.has(be) ? (E(se.current), I.current.delete(be)) : (
|
|
34776
|
+
return I.current.has(be) ? (E(se.current), I.current.delete(be)) : (De(), t.current?.setDraft(ye)), { type: "aborted" };
|
|
34777
34777
|
}
|
|
34778
34778
|
throw pe;
|
|
34779
34779
|
}, Ce = async () => {
|
|
@@ -34782,7 +34782,7 @@ const A_e = ip(null), T_e = ({ children: e }) => {
|
|
|
34782
34782
|
if (!a.transport.sendMultiUserMessage)
|
|
34783
34783
|
throw new Error("Multi-user chat requires a transport that supports sendMultiUserMessage");
|
|
34784
34784
|
const pe = await a.transport.sendMultiUserMessage(ue);
|
|
34785
|
-
return p(pe.chat), J && (g(se.current, pe.chat.id), se.current = pe.chat.id, C.current = pe.chat.id, m(pe.chat.id)), w(pe.chat.id, [pe.message]), h(pe.chat.id, Ia(pe.chat.status)),
|
|
34785
|
+
return p(pe.chat), J && (g(se.current, pe.chat.id), se.current = pe.chat.id, C.current = pe.chat.id, m(pe.chat.id)), w(pe.chat.id, [pe.message]), h(pe.chat.id, Ia(pe.chat.status)), De(), { type: "success" };
|
|
34786
34786
|
} catch (pe) {
|
|
34787
34787
|
return Ue(pe);
|
|
34788
34788
|
}
|
|
@@ -34816,14 +34816,14 @@ const A_e = ip(null), T_e = ({ children: e }) => {
|
|
|
34816
34816
|
return;
|
|
34817
34817
|
}
|
|
34818
34818
|
if (ne.type === en.Error && ne.error) {
|
|
34819
|
-
const _e = typeof ne.error == "string" ? ne.error : String(ne.error),
|
|
34819
|
+
const _e = typeof ne.error == "string" ? ne.error : String(ne.error), Be = Re ?? {
|
|
34820
34820
|
id: pe,
|
|
34821
34821
|
chat: B || se.current,
|
|
34822
34822
|
role: We.Assistant,
|
|
34823
34823
|
content: _e,
|
|
34824
34824
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
34825
34825
|
};
|
|
34826
|
-
w(se.current, [{ ...
|
|
34826
|
+
w(se.current, [{ ...Be, content: _e }]), h(se.current, yt.Idle), De();
|
|
34827
34827
|
return;
|
|
34828
34828
|
}
|
|
34829
34829
|
if (ne.message && ne.message.role === We.User) {
|
|
@@ -34833,7 +34833,7 @@ const A_e = ip(null), T_e = ({ children: e }) => {
|
|
|
34833
34833
|
ne.message && (pe = ne.message.id, Re = {
|
|
34834
34834
|
...ne.message,
|
|
34835
34835
|
reasoning: be || ne.message.reasoning
|
|
34836
|
-
}, k(se.current, Re)), ne.done && (Re && w(se.current, [Re]), h(se.current, yt.Idle),
|
|
34836
|
+
}, k(se.current, Re)), ne.done && (Re && w(se.current, [Re]), h(se.current, yt.Idle), De());
|
|
34837
34837
|
}, oe = await a.transport.streamMessage(
|
|
34838
34838
|
ue,
|
|
34839
34839
|
X,
|
|
@@ -34841,13 +34841,13 @@ const A_e = ip(null), T_e = ({ children: e }) => {
|
|
|
34841
34841
|
);
|
|
34842
34842
|
if (oe) {
|
|
34843
34843
|
const ne = oe.messages.map(
|
|
34844
|
-
(
|
|
34844
|
+
(pt) => Re && pt.id === Re.id && pt.role === We.Assistant ? { ...pt, reasoning: be } : pt
|
|
34845
34845
|
);
|
|
34846
34846
|
w(oe.id, ne);
|
|
34847
34847
|
const _e = a.store.getState();
|
|
34848
|
-
return (_e.activeChatId ?? _e.draftChatKey) === se.current && m(oe.id),
|
|
34848
|
+
return (_e.activeChatId ?? _e.draftChatKey) === se.current && m(oe.id), De(), { type: "success" };
|
|
34849
34849
|
}
|
|
34850
|
-
return
|
|
34850
|
+
return De(), { type: "success" };
|
|
34851
34851
|
} catch (B) {
|
|
34852
34852
|
return Ue(B);
|
|
34853
34853
|
}
|
|
@@ -34856,7 +34856,7 @@ const A_e = ip(null), T_e = ({ children: e }) => {
|
|
|
34856
34856
|
const pe = await (n ? Ce() : ve());
|
|
34857
34857
|
return pe.type === "success" && (D.current = !1), pe;
|
|
34858
34858
|
} catch (pe) {
|
|
34859
|
-
|
|
34859
|
+
De();
|
|
34860
34860
|
const be = pe?.chat;
|
|
34861
34861
|
be && (p(be), m(be.id));
|
|
34862
34862
|
const Re = pe instanceof Error ? pe : new Error("Failed to send message");
|
|
@@ -34896,7 +34896,7 @@ const A_e = ip(null), T_e = ({ children: e }) => {
|
|
|
34896
34896
|
P.current = !1;
|
|
34897
34897
|
}
|
|
34898
34898
|
}, [d, u, q, Z, _]);
|
|
34899
|
-
|
|
34899
|
+
Fe(() => {
|
|
34900
34900
|
W();
|
|
34901
34901
|
}, [W]);
|
|
34902
34902
|
const R = Ge(
|
|
@@ -35089,7 +35089,7 @@ const Z3 = (e, t) => {
|
|
|
35089
35089
|
return /* @__PURE__ */ T(F5, { size: 12 });
|
|
35090
35090
|
}
|
|
35091
35091
|
}, $_e = ({ attachments: e }) => {
|
|
35092
|
-
const { config: t } =
|
|
35092
|
+
const { config: t } = Pe();
|
|
35093
35093
|
return !e || e.length === 0 ? null : /* @__PURE__ */ T("div", { className: "mp-agent-message-attachments", "aria-label": "Message attachments", children: e.map((n, r) => {
|
|
35094
35094
|
const a = /* @__PURE__ */ re(Rt, { children: [
|
|
35095
35095
|
/* @__PURE__ */ T("span", { className: "mp-agent-message-attachment-icon", children: Z3(n, t.contextAttachmentIcons) }),
|
|
@@ -35109,7 +35109,7 @@ const Z3 = (e, t) => {
|
|
|
35109
35109
|
) : /* @__PURE__ */ T("span", { className: "mp-agent-message-attachment", title: n.mimeType ?? n.name, children: a }, n.id || r);
|
|
35110
35110
|
}) });
|
|
35111
35111
|
}, F_e = ({ attachments: e, onRemove: t, uploadProgress: n, uploadErrors: r }) => {
|
|
35112
|
-
const a = fn(), { config: i } =
|
|
35112
|
+
const a = fn(), { config: i } = Pe();
|
|
35113
35113
|
return !e || e.length === 0 ? null : /* @__PURE__ */ T("div", { className: "mp-agent-composer-attachments", "aria-label": a.attachments, children: e.map((o) => {
|
|
35114
35114
|
const s = n?.get(o.id), l = r?.get(o.name), u = o.metadata?.size || o.size, d = u ? ` (${Dp(u)})` : "";
|
|
35115
35115
|
return /* @__PURE__ */ re(
|
|
@@ -35328,14 +35328,14 @@ const W_e = ({
|
|
|
35328
35328
|
virtual: !1
|
|
35329
35329
|
}), { getReferenceProps: Y, getFloatingProps: Z, getItemProps: W } = Mp(
|
|
35330
35330
|
l ? [D, P, C] : [D, P, C, q]
|
|
35331
|
-
), R = e.findIndex((K) => K.value === t), H = R >= 0 ? e[R] : void 0, j =
|
|
35331
|
+
), R = e.findIndex((K) => K.value === t), H = R >= 0 ? e[R] : void 0, j = ot(() => {
|
|
35332
35332
|
const K = g.trim().toLowerCase();
|
|
35333
35333
|
if (!l || !K)
|
|
35334
35334
|
return e;
|
|
35335
35335
|
const L = d ? (se) => d(se, K) : (se) => `${se.label} ${se.description ?? ""}`.toLowerCase().includes(K);
|
|
35336
35336
|
return e.filter(L);
|
|
35337
35337
|
}, [e, g, l, d]);
|
|
35338
|
-
|
|
35338
|
+
Fe(() => {
|
|
35339
35339
|
if (!p) {
|
|
35340
35340
|
f(null), _("");
|
|
35341
35341
|
return;
|
|
@@ -35343,7 +35343,7 @@ const W_e = ({
|
|
|
35343
35343
|
l && setTimeout(() => b.current?.focus(), 0);
|
|
35344
35344
|
const K = j.findIndex((J) => J.value === t);
|
|
35345
35345
|
f(K >= 0 ? K : 0);
|
|
35346
|
-
}, [p, l, t, j]),
|
|
35346
|
+
}, [p, l, t, j]), Fe(() => {
|
|
35347
35347
|
p && f(j.length > 0 ? 0 : null);
|
|
35348
35348
|
}, [g, j.length, p]);
|
|
35349
35349
|
const z = (K) => j.length === 0 ? null : K < 0 ? j.length - 1 : K >= j.length ? 0 : K, V = (K) => {
|
|
@@ -35452,13 +35452,13 @@ const W_e = ({
|
|
|
35452
35452
|
)
|
|
35453
35453
|
] });
|
|
35454
35454
|
}, K_e = ft(() => {
|
|
35455
|
-
const e =
|
|
35455
|
+
const e = Pe(), t = fe((p) => p.composer), n = fe((p) => p.contextKey), r = fe((p) => p.setComposerOptions), a = e.config.models, { data: i, isLoading: o } = a7e(), s = ot(() => {
|
|
35456
35456
|
const p = i && i.length > 0 ? i : a;
|
|
35457
35457
|
return O3(p, e.config.transport).filter((m) => !m.contexts?.length || m.contexts.includes(n));
|
|
35458
|
-
}, [i, a, e.config.transport, n]), l =
|
|
35458
|
+
}, [i, a, e.config.transport, n]), l = ot(() => {
|
|
35459
35459
|
const p = s.slice().sort((h, m) => h.label.localeCompare(m.label, void 0, { sensitivity: "base" })).map((h) => ({ value: h.id, label: h.label }));
|
|
35460
35460
|
return [{ value: ga, label: "Auto" }, ...p];
|
|
35461
|
-
}, [s]), u =
|
|
35461
|
+
}, [s]), u = ot(
|
|
35462
35462
|
() => t.model !== void 0 ? t.model : ga,
|
|
35463
35463
|
[t.model]
|
|
35464
35464
|
), d = Ge(
|
|
@@ -35506,10 +35506,10 @@ const W_e = ({
|
|
|
35506
35506
|
const n = fn(), { upsertSingle: r } = p7e(), [a, i] = Ze(
|
|
35507
35507
|
() => K2(e)
|
|
35508
35508
|
), [o, s] = Ze({});
|
|
35509
|
-
|
|
35509
|
+
Fe(() => {
|
|
35510
35510
|
i(K2(e));
|
|
35511
35511
|
}, [e]);
|
|
35512
|
-
const l = r.error?.message, u =
|
|
35512
|
+
const l = r.error?.message, u = ot(() => e.some((p) => Object.keys(p.tools).length > 0), [e]), d = (p, h, m) => {
|
|
35513
35513
|
i((f) => {
|
|
35514
35514
|
const g = f[p] ?? {}, _ = g, k = {
|
|
35515
35515
|
...g,
|
|
@@ -35588,7 +35588,7 @@ function Q_e(e) {
|
|
|
35588
35588
|
});
|
|
35589
35589
|
}
|
|
35590
35590
|
const J_e = () => {
|
|
35591
|
-
const e = fn(), t =
|
|
35591
|
+
const e = fn(), t = Pe(), n = fe((l) => l.contextKey), { data: r, isLoading: a, isError: i } = l7e(n), o = ot(() => Q_e(r ?? []), [r]), s = !!t.transport.upsertAgentPreferences && !!t.transport.upsertAgentPreferencesBatch;
|
|
35592
35592
|
return a ? /* @__PURE__ */ T(Rt, { children: e.agentSettingsLoading }) : i ? /* @__PURE__ */ T(Rt, { children: e.agentSettingsError }) : /* @__PURE__ */ T(X_e, { preferences: o, disabled: !s });
|
|
35593
35593
|
}, ewe = () => {
|
|
35594
35594
|
const [e, t] = Ze(!1), n = fn(), { refs: r, floatingStyles: a, context: i, isPositioned: o } = Ep({
|
|
@@ -35635,22 +35635,22 @@ const J_e = () => {
|
|
|
35635
35635
|
] });
|
|
35636
35636
|
}, twe = ho(
|
|
35637
35637
|
({ autoFocus: e, activeChatId: t, status: n, onStop: r, onSubmit: a }, i) => {
|
|
35638
|
-
const o = fn(), s =
|
|
35638
|
+
const o = fn(), s = Pe(), l = Ve(null), u = Ve(null), d = fe((ie) => ie.activeChatId ?? ie.draftChatKey), p = fe((ie) => Oe(ie, d).composerDraft), h = fe((ie) => Oe(ie, d).composerError), m = fe((ie) => Oe(ie, d).pageContextDismissed), f = fe((ie) => ie.setComposerValue), g = fe((ie) => ie.setComposerDraft), _ = fe((ie) => ie.clearComposerDraft), k = fe((ie) => ie.setComposerError), b = fe((ie) => ie.addComposerAttachments), w = fe((ie) => ie.removeComposerAttachment), E = fe((ie) => ie.setPageContextDismissed), S = p.value, x = p.attachments, [D, P] = Ze(/* @__PURE__ */ new Map()), [C, I] = Ze(/* @__PURE__ */ new Map()), q = Ve(S), Y = Ve(x), Z = Ve(m), W = s.config.features?.pageContextAttachments !== !1, R = s.config.composerAttachmentActions, j = `Attach ${s.config.pageContext?.name?.trim() || "Page context"}`, z = s.config.contextAttachmentIcons?.pageContext ?? /* @__PURE__ */ T(pp, { size: 16 }), V = (ie) => ie.type === _t.Context && ie?.metadata?.kind === "pageContext", N = x.some(V), K = () => {
|
|
35639
35639
|
if (W)
|
|
35640
35640
|
return s.buildPageContextAttachment();
|
|
35641
35641
|
};
|
|
35642
|
-
|
|
35642
|
+
Fe(() => {
|
|
35643
35643
|
Y.current = x;
|
|
35644
|
-
}, [x]),
|
|
35644
|
+
}, [x]), Fe(() => {
|
|
35645
35645
|
q.current = S;
|
|
35646
|
-
}, [S]),
|
|
35646
|
+
}, [S]), Fe(() => {
|
|
35647
35647
|
Z.current = m;
|
|
35648
|
-
}, [m]),
|
|
35648
|
+
}, [m]), Fe(() => {
|
|
35649
35649
|
if (!W || m || N)
|
|
35650
35650
|
return;
|
|
35651
35651
|
const ie = K();
|
|
35652
35652
|
ie && b(d, [ie]);
|
|
35653
|
-
}, [W, m, N, d, b]),
|
|
35653
|
+
}, [W, m, N, d, b]), Fe(() => {
|
|
35654
35654
|
if (W && !(typeof window > "u"))
|
|
35655
35655
|
return U_e(() => {
|
|
35656
35656
|
if (Z.current)
|
|
@@ -35661,7 +35661,7 @@ const J_e = () => {
|
|
|
35661
35661
|
const xe = K();
|
|
35662
35662
|
if (!xe)
|
|
35663
35663
|
return;
|
|
35664
|
-
const Ye = { ...xe, id: we.id }, ue = ie.map((
|
|
35664
|
+
const Ye = { ...xe, id: we.id }, ue = ie.map((De) => De.id === we.id ? Ye : De);
|
|
35665
35665
|
g(d, { value: q.current, attachments: ue });
|
|
35666
35666
|
});
|
|
35667
35667
|
}, [W, d, g]), z7(i, () => ({
|
|
@@ -35676,7 +35676,7 @@ const J_e = () => {
|
|
|
35676
35676
|
_(d);
|
|
35677
35677
|
},
|
|
35678
35678
|
buildPageContextAttachment: () => K()
|
|
35679
|
-
})),
|
|
35679
|
+
})), Fe(() => {
|
|
35680
35680
|
const ie = l.current;
|
|
35681
35681
|
ie && (ie.style.height = "auto", ie.style.height = `${Math.min(ie.scrollHeight, 200)}px`);
|
|
35682
35682
|
}, [S]);
|
|
@@ -35686,28 +35686,28 @@ const J_e = () => {
|
|
|
35686
35686
|
const we = Array.from(ie), xe = z_e(), Ye = D_e(we, x, xe);
|
|
35687
35687
|
if (Ye) {
|
|
35688
35688
|
I((ue) => {
|
|
35689
|
-
const
|
|
35689
|
+
const De = new Map(ue);
|
|
35690
35690
|
return we.forEach((Ue) => {
|
|
35691
|
-
|
|
35692
|
-
}),
|
|
35691
|
+
De.set(Ue.name, Ye.message);
|
|
35692
|
+
}), De;
|
|
35693
35693
|
});
|
|
35694
35694
|
return;
|
|
35695
35695
|
}
|
|
35696
35696
|
I((ue) => {
|
|
35697
|
-
const
|
|
35698
|
-
return we.forEach((Ue) =>
|
|
35697
|
+
const De = new Map(ue);
|
|
35698
|
+
return we.forEach((Ue) => De.delete(Ue.name)), De;
|
|
35699
35699
|
});
|
|
35700
35700
|
try {
|
|
35701
35701
|
const ue = s.config.transport;
|
|
35702
35702
|
if (ue.mode !== "proxy")
|
|
35703
35703
|
throw new Error("File uploads are only supported with proxy transport");
|
|
35704
|
-
const
|
|
35704
|
+
const De = {
|
|
35705
35705
|
presignedUrlEndpoint: `${ue.baseUrl}/files/upload/presigned`,
|
|
35706
35706
|
getAuthHeaders: () => {
|
|
35707
35707
|
const Ce = {};
|
|
35708
35708
|
return ue.headers ? ue.headers : (ue.apiKey && (Ce.Authorization = `Bearer ${ue.apiKey}`), Ce);
|
|
35709
35709
|
}
|
|
35710
|
-
}, Ue = await G_e(we,
|
|
35710
|
+
}, Ue = await G_e(we, De, {
|
|
35711
35711
|
chatId: t,
|
|
35712
35712
|
userId: s.config.user?.id,
|
|
35713
35713
|
onProgress: (Ce) => {
|
|
@@ -35724,11 +35724,11 @@ const J_e = () => {
|
|
|
35724
35724
|
});
|
|
35725
35725
|
}, 2e3);
|
|
35726
35726
|
} catch (ue) {
|
|
35727
|
-
const
|
|
35727
|
+
const De = ue instanceof Error ? ue.message : "Failed to upload files";
|
|
35728
35728
|
I((Ue) => {
|
|
35729
35729
|
const Ce = new Map(Ue);
|
|
35730
35730
|
return we.forEach((ve) => {
|
|
35731
|
-
Ce.set(ve.name,
|
|
35731
|
+
Ce.set(ve.name, De);
|
|
35732
35732
|
}), Ce;
|
|
35733
35733
|
});
|
|
35734
35734
|
}
|
|
@@ -35758,7 +35758,7 @@ const J_e = () => {
|
|
|
35758
35758
|
const ie = x7e(), we = ie?.selectedText ?? window.getSelection?.()?.toString()?.trim() ?? "";
|
|
35759
35759
|
if (!we)
|
|
35760
35760
|
return !1;
|
|
35761
|
-
const xe = window.location?.href, Ye = we.slice(0, 20), ue = we.length > 20 ? Ye + "..." : we,
|
|
35761
|
+
const xe = window.location?.href, Ye = we.slice(0, 20), ue = we.length > 20 ? Ye + "..." : we, De = Ap({
|
|
35762
35762
|
kind: "webSnippet",
|
|
35763
35763
|
url: xe,
|
|
35764
35764
|
title: ue,
|
|
@@ -35766,16 +35766,16 @@ const J_e = () => {
|
|
|
35766
35766
|
source: { app: "browser", url: xe },
|
|
35767
35767
|
...ie?.target ? { target: ie.target } : {}
|
|
35768
35768
|
});
|
|
35769
|
-
return b(d, [
|
|
35770
|
-
},
|
|
35769
|
+
return b(d, [De]), !0;
|
|
35770
|
+
}, qe = (ie) => {
|
|
35771
35771
|
ie.preventDefault();
|
|
35772
35772
|
const we = S.trim();
|
|
35773
35773
|
we && (k(d, void 0), a(we));
|
|
35774
35774
|
}, Je = (ie) => {
|
|
35775
|
-
ie.key === "Enter" && !ie.shiftKey && (ie.preventDefault(),
|
|
35775
|
+
ie.key === "Enter" && !ie.shiftKey && (ie.preventDefault(), qe(ie));
|
|
35776
35776
|
}, Xe = (ie) => {
|
|
35777
35777
|
h && k(d, void 0), f(d, ie.target.value);
|
|
35778
|
-
},
|
|
35778
|
+
}, ct = (ie) => {
|
|
35779
35779
|
if (ie.nativeEvent.shiftKey)
|
|
35780
35780
|
return;
|
|
35781
35781
|
const we = ie.clipboardData?.getData("text/plain") ?? "";
|
|
@@ -35784,7 +35784,7 @@ const J_e = () => {
|
|
|
35784
35784
|
se(we) && ie.preventDefault();
|
|
35785
35785
|
}, et = !!S.trim();
|
|
35786
35786
|
return /* @__PURE__ */ re(Rt, { children: [
|
|
35787
|
-
/* @__PURE__ */ re("form", { onSubmit:
|
|
35787
|
+
/* @__PURE__ */ re("form", { onSubmit: qe, className: "mp-agent-composer-input-wrapper", id: "composer-form", children: [
|
|
35788
35788
|
/* @__PURE__ */ T("input", { ref: u, type: "file", multiple: !0, style: { display: "none" }, onChange: ye }),
|
|
35789
35789
|
/* @__PURE__ */ T(
|
|
35790
35790
|
F_e,
|
|
@@ -35807,7 +35807,7 @@ const J_e = () => {
|
|
|
35807
35807
|
placeholder: t ? o.followUp : o.newChat,
|
|
35808
35808
|
onChange: Xe,
|
|
35809
35809
|
onKeyDown: Je,
|
|
35810
|
-
onPaste:
|
|
35810
|
+
onPaste: ct
|
|
35811
35811
|
}
|
|
35812
35812
|
)
|
|
35813
35813
|
] }),
|
|
@@ -36888,19 +36888,19 @@ function kwe(e) {
|
|
|
36888
36888
|
});
|
|
36889
36889
|
}
|
|
36890
36890
|
const Q3 = ft(() => {
|
|
36891
|
-
const e = fe((n) => n.activeChatId ?? n.draftChatKey), t = fe((n) =>
|
|
36891
|
+
const e = fe((n) => n.activeChatId ?? n.draftChatKey), t = fe((n) => Oe(n, e).composerError);
|
|
36892
36892
|
return t ? /* @__PURE__ */ T("div", { className: "mp-agent-composer-error", children: t }) : null;
|
|
36893
36893
|
});
|
|
36894
36894
|
Q3.displayName = "ComposerError";
|
|
36895
36895
|
const vwe = (e, t) => {
|
|
36896
36896
|
switch (e.status) {
|
|
36897
|
-
case
|
|
36897
|
+
case rt.Running:
|
|
36898
36898
|
return `Running ${t}...`;
|
|
36899
|
-
case
|
|
36899
|
+
case rt.Succeeded:
|
|
36900
36900
|
return `Completed ${t}`;
|
|
36901
|
-
case
|
|
36901
|
+
case rt.Failed:
|
|
36902
36902
|
return `Failed to run ${t}`;
|
|
36903
|
-
case
|
|
36903
|
+
case rt.Pending:
|
|
36904
36904
|
return `Preparing ${t}...`;
|
|
36905
36905
|
default:
|
|
36906
36906
|
return `Running ${t}...`;
|
|
@@ -36917,7 +36917,7 @@ const vwe = (e, t) => {
|
|
|
36917
36917
|
return "[unserializable]";
|
|
36918
36918
|
}
|
|
36919
36919
|
}
|
|
36920
|
-
}, X2 = ({ call: e }) =>
|
|
36920
|
+
}, X2 = ({ call: e }) => Pe().config.debug ? /* @__PURE__ */ re("details", { className: "mp-agent-tool-debug-details", children: [
|
|
36921
36921
|
/* @__PURE__ */ T("summary", { className: "mp-agent-tool-debug-summary", children: "Details" }),
|
|
36922
36922
|
/* @__PURE__ */ re("div", { className: "mp-agent-tool-debug-body", children: [
|
|
36923
36923
|
/* @__PURE__ */ re("div", { className: "mp-agent-tool-debug-row", children: [
|
|
@@ -36942,7 +36942,7 @@ const vwe = (e, t) => {
|
|
|
36942
36942
|
] })
|
|
36943
36943
|
] })
|
|
36944
36944
|
] }) : null, J3 = ft(({ call: e }) => {
|
|
36945
|
-
const t =
|
|
36945
|
+
const t = Pe(), n = e.status === rt.Succeeded || e.status === rt.Failed;
|
|
36946
36946
|
if (!t.config.debug || n)
|
|
36947
36947
|
return null;
|
|
36948
36948
|
const a = t.tools.get(e.name)?.label ?? e.name;
|
|
@@ -36998,8 +36998,8 @@ const ev = ({ call: e }) => {
|
|
|
36998
36998
|
allowFreeText: typeof a == "boolean" ? a : !1
|
|
36999
36999
|
};
|
|
37000
37000
|
}, xwe = ({ callId: e, input: t, isSubmitting: n, onSubmit: r }) => {
|
|
37001
|
-
const [a, i] = Ze([]), [o, s] = Ze(""), [l, u] = Ze(void 0), d =
|
|
37002
|
-
|
|
37001
|
+
const [a, i] = Ze([]), [o, s] = Ze(""), [l, u] = Ze(void 0), d = ot(() => wwe(t), [t]);
|
|
37002
|
+
Fe(() => {
|
|
37003
37003
|
i([]), s(""), u(void 0);
|
|
37004
37004
|
}, [e, t]);
|
|
37005
37005
|
const p = (m) => {
|
|
@@ -37068,8 +37068,8 @@ const ev = ({ call: e }) => {
|
|
|
37068
37068
|
/* @__PURE__ */ T("div", { className: "mp-agent-tool-approval-actions", children: /* @__PURE__ */ T("button", { className: "mp-agent-tool-approve-button", onClick: h, disabled: n, children: n ? "Submitting..." : "Submit response" }) })
|
|
37069
37069
|
] }) : /* @__PURE__ */ T("div", { className: "mp-agent-tool-user-action-form", children: /* @__PURE__ */ T("div", { className: "mp-agent-tool-input-error", children: "Invalid user action input schema in tool call." }) });
|
|
37070
37070
|
}, Ewe = ({ call: e, messageId: t, chatId: n, onApprovalSent: r }) => {
|
|
37071
|
-
const a =
|
|
37072
|
-
|
|
37071
|
+
const a = Pe(), i = a.tools.get(e.name)?.label ?? e.name, o = fe((q) => q.appendMessagesToChat), s = fe((q) => q.setChatMessages), l = fe((q) => q.setChatStatus), u = fe((q) => q.setPendingAssistant), [d, p] = Ze(!1), [h, m] = Ze(!1), [f, g] = Ze(!1), [_, k] = Ze(JSON.stringify(e.input ?? {}, null, 2)), [b, w] = Ze(void 0), E = a.config.user?.id ?? "guest", S = e.requiresUserAction;
|
|
37072
|
+
Fe(() => {
|
|
37073
37073
|
h || (k(JSON.stringify(e.input ?? {}, null, 2)), w(void 0));
|
|
37074
37074
|
}, [e.id, e.input, h]);
|
|
37075
37075
|
const x = () => {
|
|
@@ -37222,7 +37222,7 @@ const ev = ({ call: e }) => {
|
|
|
37222
37222
|
] })
|
|
37223
37223
|
] });
|
|
37224
37224
|
}, Q2 = ({ call: e, messageId: t, chatId: n }) => {
|
|
37225
|
-
const r =
|
|
37225
|
+
const r = Pe(), a = fe((p) => p.upsertChat), i = fe((p) => p.setChatStatus), o = r.config.debug && !!e.approvalId, s = e.requiresConfirmation && e.approvalId || o, l = s && e.approved === void 0, u = s && e.approved !== void 0, d = async () => {
|
|
37226
37226
|
try {
|
|
37227
37227
|
const p = await r.transport.getChat(n);
|
|
37228
37228
|
a(p), i(n, Ia(p.status));
|
|
@@ -37235,9 +37235,9 @@ const ev = ({ call: e }) => {
|
|
|
37235
37235
|
u && /* @__PURE__ */ T(ev, { call: e })
|
|
37236
37236
|
] });
|
|
37237
37237
|
}, tv = ft(({ chatId: e, isExpanded: t }) => {
|
|
37238
|
-
const n =
|
|
37238
|
+
const n = Pe(), r = fe((d) => Oe(d, e).messages), a = fe((d) => Oe(d, e).pendingAssistant), i = fe((d) => d.chats[e]?.contextKey ?? d.contextKey), [o, s] = Ze(t);
|
|
37239
37239
|
t && !o && s(!0);
|
|
37240
|
-
const l = T3(e, { requireRegisteredChat: !1, enabled: o }), u =
|
|
37240
|
+
const l = T3(e, { requireRegisteredChat: !1, enabled: o }), u = ot(() => {
|
|
37241
37241
|
const d = [...r].sort((h, m) => h.createdAt.localeCompare(m.createdAt));
|
|
37242
37242
|
if (n.config.debug)
|
|
37243
37243
|
return d;
|
|
@@ -37252,27 +37252,38 @@ const ev = ({ call: e }) => {
|
|
|
37252
37252
|
tv.displayName = "SubagentChatPreview";
|
|
37253
37253
|
const Mwe = (e) => {
|
|
37254
37254
|
switch (e) {
|
|
37255
|
-
case
|
|
37255
|
+
case rt.Succeeded:
|
|
37256
37256
|
return { key: "succeeded", label: "Done", icon: /* @__PURE__ */ T(cp, { size: 12 }) };
|
|
37257
|
-
case
|
|
37257
|
+
case rt.Failed:
|
|
37258
37258
|
return { key: "failed", label: "Failed", icon: /* @__PURE__ */ T(G5, { size: 12 }) };
|
|
37259
|
-
case
|
|
37259
|
+
case rt.Pending:
|
|
37260
37260
|
return { key: "running", label: "Preparing", icon: /* @__PURE__ */ T(Na, { size: 12, className: "mp-agent-subagent-spinner" }) };
|
|
37261
37261
|
default:
|
|
37262
37262
|
return { key: "running", label: "Running", icon: /* @__PURE__ */ T(Na, { size: 12, className: "mp-agent-subagent-spinner" }) };
|
|
37263
37263
|
}
|
|
37264
37264
|
}, nv = ft(({ call: e, subagentChatId: t }) => {
|
|
37265
|
-
const [n, r] = Ze(!1), a = fe((
|
|
37266
|
-
const { messages:
|
|
37267
|
-
return
|
|
37268
|
-
}), i =
|
|
37265
|
+
const [n, r] = Ze(!1), a = fe((l) => {
|
|
37266
|
+
const { messages: u, pendingAssistant: d } = Oe(l, t), p = u.find((h) => h.agentName || h.sender?.type === "agent") ?? d;
|
|
37267
|
+
return p?.agentName || p?.sender?.displayName || void 0;
|
|
37268
|
+
}), i = fe((l) => {
|
|
37269
|
+
const { messages: u, pendingAssistant: d } = Oe(l, t);
|
|
37270
|
+
return (d ? [...u, d] : u).some(
|
|
37271
|
+
(h) => h.toolCalls?.some(
|
|
37272
|
+
(m) => (m.requiresConfirmation || m.requiresUserAction) && m.approved === void 0 && m.status !== rt.Succeeded && m.status !== rt.Failed
|
|
37273
|
+
)
|
|
37274
|
+
);
|
|
37275
|
+
}), o = e.status === rt.Succeeded || e.status === rt.Failed;
|
|
37276
|
+
Fe(() => {
|
|
37277
|
+
i && !o && r(!0);
|
|
37278
|
+
}, [i, o]);
|
|
37279
|
+
const s = Mwe(e.status);
|
|
37269
37280
|
return /* @__PURE__ */ re("div", { className: "mp-agent-subagent", children: [
|
|
37270
37281
|
/* @__PURE__ */ re(
|
|
37271
37282
|
"button",
|
|
37272
37283
|
{
|
|
37273
37284
|
className: "mp-agent-subagent-row",
|
|
37274
37285
|
type: "button",
|
|
37275
|
-
onClick: () => r((
|
|
37286
|
+
onClick: () => r((l) => !l),
|
|
37276
37287
|
"aria-expanded": n,
|
|
37277
37288
|
children: [
|
|
37278
37289
|
/* @__PURE__ */ T("span", { className: "mp-agent-subagent-row-icon", children: /* @__PURE__ */ T(I5, { size: 14 }) }),
|
|
@@ -37281,9 +37292,9 @@ const Mwe = (e) => {
|
|
|
37281
37292
|
" ",
|
|
37282
37293
|
a
|
|
37283
37294
|
] }) : "Subagent" }),
|
|
37284
|
-
/* @__PURE__ */ re("span", { className: `mp-agent-subagent-row-status is-${
|
|
37285
|
-
|
|
37286
|
-
|
|
37295
|
+
/* @__PURE__ */ re("span", { className: `mp-agent-subagent-row-status is-${s.key}`, children: [
|
|
37296
|
+
s.icon,
|
|
37297
|
+
s.label
|
|
37287
37298
|
] }),
|
|
37288
37299
|
/* @__PURE__ */ T("span", { className: "mp-agent-subagent-row-chevron", children: n ? /* @__PURE__ */ T(up, { size: 14 }) : /* @__PURE__ */ T(go, { size: 14 }) })
|
|
37289
37300
|
]
|
|
@@ -37294,7 +37305,7 @@ const Mwe = (e) => {
|
|
|
37294
37305
|
});
|
|
37295
37306
|
nv.displayName = "SubagentToolCall";
|
|
37296
37307
|
const zp = ft(({ call: e, contextKey: t, messageId: n, chatId: r }) => {
|
|
37297
|
-
const a =
|
|
37308
|
+
const a = Pe(), i = e.subagentChatId || (typeof e.input?.subagentChatId == "string" ? e.input.subagentChatId : void 0), o = ot(() => a.getToolRenderer(e), [a, e.name]), s = i ? /* @__PURE__ */ T(nv, { call: e, subagentChatId: i }) : null;
|
|
37298
37309
|
if (!o) {
|
|
37299
37310
|
const l = !!(e.requiresConfirmation && e.approvalId);
|
|
37300
37311
|
return !!i || a.config.debug || l ? /* @__PURE__ */ re("div", { className: "mp-agent-tool-panel", children: [
|
|
@@ -41186,14 +41197,14 @@ function AEe(e, t, n) {
|
|
|
41186
41197
|
) : K(W);
|
|
41187
41198
|
function K(ke) {
|
|
41188
41199
|
return Ie;
|
|
41189
|
-
function Ie(
|
|
41190
|
-
const Je =
|
|
41200
|
+
function Ie(qe) {
|
|
41201
|
+
const Je = qe !== null && ke[qe], Xe = qe !== null && ke.null, ct = [
|
|
41191
41202
|
// To do: add more extension tests.
|
|
41192
41203
|
/* c8 ignore next 2 */
|
|
41193
41204
|
...Array.isArray(Je) ? Je : Je ? [Je] : [],
|
|
41194
41205
|
...Array.isArray(Xe) ? Xe : Xe ? [Xe] : []
|
|
41195
41206
|
];
|
|
41196
|
-
return J(
|
|
41207
|
+
return J(ct)(qe);
|
|
41197
41208
|
}
|
|
41198
41209
|
}
|
|
41199
41210
|
function J(ke) {
|
|
@@ -41201,7 +41212,7 @@ function AEe(e, t, n) {
|
|
|
41201
41212
|
}
|
|
41202
41213
|
function L(ke) {
|
|
41203
41214
|
return Ie;
|
|
41204
|
-
function Ie(
|
|
41215
|
+
function Ie(qe) {
|
|
41205
41216
|
return N = C(), V = ke, ke.partial || (u.currentConstruct = ke), ke.name && u.parser.constructs.disable.null.includes(ke.name) ? ye() : ke.tokenize.call(
|
|
41206
41217
|
// If we do have fields, create an object w/ `context` as its
|
|
41207
41218
|
// prototype.
|
|
@@ -41210,7 +41221,7 @@ function AEe(e, t, n) {
|
|
|
41210
41221
|
l,
|
|
41211
41222
|
se,
|
|
41212
41223
|
ye
|
|
41213
|
-
)(
|
|
41224
|
+
)(qe);
|
|
41214
41225
|
}
|
|
41215
41226
|
}
|
|
41216
41227
|
function se(ke) {
|
|
@@ -41380,17 +41391,17 @@ function FEe(e) {
|
|
|
41380
41391
|
transforms: [],
|
|
41381
41392
|
canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
|
|
41382
41393
|
enter: {
|
|
41383
|
-
autolink: i(
|
|
41394
|
+
autolink: i(De),
|
|
41384
41395
|
autolinkProtocol: C,
|
|
41385
41396
|
autolinkEmail: C,
|
|
41386
41397
|
atxHeading: i(we),
|
|
41387
41398
|
blockQuote: i(Xe),
|
|
41388
41399
|
characterEscape: C,
|
|
41389
41400
|
characterReference: C,
|
|
41390
|
-
codeFenced: i(
|
|
41401
|
+
codeFenced: i(ct),
|
|
41391
41402
|
codeFencedFenceInfo: o,
|
|
41392
41403
|
codeFencedFenceMeta: o,
|
|
41393
|
-
codeIndented: i(
|
|
41404
|
+
codeIndented: i(ct, o),
|
|
41394
41405
|
codeText: i(xt, o),
|
|
41395
41406
|
codeTextData: C,
|
|
41396
41407
|
data: C,
|
|
@@ -41408,7 +41419,7 @@ function FEe(e) {
|
|
|
41408
41419
|
htmlTextData: C,
|
|
41409
41420
|
image: i(ue),
|
|
41410
41421
|
label: o,
|
|
41411
|
-
link: i(
|
|
41422
|
+
link: i(De),
|
|
41412
41423
|
listItem: i(Ce),
|
|
41413
41424
|
listItemValue: h,
|
|
41414
41425
|
listOrdered: i(Ue, p),
|
|
@@ -41427,7 +41438,7 @@ function FEe(e) {
|
|
|
41427
41438
|
atxHeadingSequence: S,
|
|
41428
41439
|
autolink: l(),
|
|
41429
41440
|
autolinkEmail: Je,
|
|
41430
|
-
autolinkProtocol:
|
|
41441
|
+
autolinkProtocol: qe,
|
|
41431
41442
|
blockQuote: l(),
|
|
41432
41443
|
characterEscapeValue: I,
|
|
41433
41444
|
characterReferenceMarkerHexadecimal: ye,
|
|
@@ -41498,18 +41509,18 @@ function FEe(e) {
|
|
|
41498
41509
|
if (B[_e][0] === "enter")
|
|
41499
41510
|
ne.push(_e);
|
|
41500
41511
|
else {
|
|
41501
|
-
const
|
|
41502
|
-
_e = a(B,
|
|
41512
|
+
const Be = ne.pop();
|
|
41513
|
+
_e = a(B, Be, _e);
|
|
41503
41514
|
}
|
|
41504
41515
|
for (_e = -1; ++_e < B.length; ) {
|
|
41505
|
-
const
|
|
41506
|
-
Iv.call(
|
|
41516
|
+
const Be = t[B[_e][0]];
|
|
41517
|
+
Iv.call(Be, B[_e][1].type) && Be[B[_e][1].type].call(Object.assign({
|
|
41507
41518
|
sliceSerialize: B[_e][2].sliceSerialize
|
|
41508
41519
|
}, oe), B[_e][1]);
|
|
41509
41520
|
}
|
|
41510
41521
|
if (oe.tokenStack.length > 0) {
|
|
41511
|
-
const
|
|
41512
|
-
(
|
|
41522
|
+
const Be = oe.tokenStack[oe.tokenStack.length - 1];
|
|
41523
|
+
(Be[1] || wm).call(oe, void 0, Be[0]);
|
|
41513
41524
|
}
|
|
41514
41525
|
for (X.position = {
|
|
41515
41526
|
start: Qn(B.length > 0 ? B[0][1].start : {
|
|
@@ -41527,7 +41538,7 @@ function FEe(e) {
|
|
|
41527
41538
|
return X;
|
|
41528
41539
|
}
|
|
41529
41540
|
function a(B, X, oe) {
|
|
41530
|
-
let ne = X - 1, _e = -1,
|
|
41541
|
+
let ne = X - 1, _e = -1, Be = !1, pt, Nt, Zn, Xn;
|
|
41531
41542
|
for (; ++ne <= oe; ) {
|
|
41532
41543
|
const Et = B[ne];
|
|
41533
41544
|
switch (Et[1].type) {
|
|
@@ -41538,7 +41549,7 @@ function FEe(e) {
|
|
|
41538
41549
|
break;
|
|
41539
41550
|
}
|
|
41540
41551
|
case "lineEndingBlank": {
|
|
41541
|
-
Et[0] === "enter" && (
|
|
41552
|
+
Et[0] === "enter" && (pt && !Xn && !_e && !Zn && (Zn = ne), Xn = void 0);
|
|
41542
41553
|
break;
|
|
41543
41554
|
}
|
|
41544
41555
|
case "linePrefix":
|
|
@@ -41551,18 +41562,18 @@ function FEe(e) {
|
|
|
41551
41562
|
Xn = void 0;
|
|
41552
41563
|
}
|
|
41553
41564
|
if (!_e && Et[0] === "enter" && Et[1].type === "listItemPrefix" || _e === -1 && Et[0] === "exit" && (Et[1].type === "listUnordered" || Et[1].type === "listOrdered")) {
|
|
41554
|
-
if (
|
|
41565
|
+
if (pt) {
|
|
41555
41566
|
let Ot = ne;
|
|
41556
41567
|
for (Nt = void 0; Ot--; ) {
|
|
41557
41568
|
const Bt = B[Ot];
|
|
41558
41569
|
if (Bt[1].type === "lineEnding" || Bt[1].type === "lineEndingBlank") {
|
|
41559
41570
|
if (Bt[0] === "exit")
|
|
41560
41571
|
continue;
|
|
41561
|
-
Nt && (B[Nt][1].type = "lineEndingBlank",
|
|
41572
|
+
Nt && (B[Nt][1].type = "lineEndingBlank", Be = !0), Bt[1].type = "lineEnding", Nt = Ot;
|
|
41562
41573
|
} else if (!(Bt[1].type === "linePrefix" || Bt[1].type === "blockQuotePrefix" || Bt[1].type === "blockQuotePrefixWhitespace" || Bt[1].type === "blockQuoteMarker" || Bt[1].type === "listItemIndent"))
|
|
41563
41574
|
break;
|
|
41564
41575
|
}
|
|
41565
|
-
Zn && (!Nt || Zn < Nt) && (
|
|
41576
|
+
Zn && (!Nt || Zn < Nt) && (pt._spread = !0), pt.end = Object.assign({}, Nt ? B[Nt][1].start : Et[1].end), B.splice(Nt || ne, 0, ["exit", pt, Et[2]]), ne++, oe++;
|
|
41566
41577
|
}
|
|
41567
41578
|
if (Et[1].type === "listItemPrefix") {
|
|
41568
41579
|
const Ot = {
|
|
@@ -41572,11 +41583,11 @@ function FEe(e) {
|
|
|
41572
41583
|
// @ts-expect-error: we’ll add `end` in a second.
|
|
41573
41584
|
end: void 0
|
|
41574
41585
|
};
|
|
41575
|
-
|
|
41586
|
+
pt = Ot, B.splice(ne, 0, ["enter", Ot, Et[2]]), ne++, oe++, Zn = void 0, Xn = !0;
|
|
41576
41587
|
}
|
|
41577
41588
|
}
|
|
41578
41589
|
}
|
|
41579
|
-
return B[X][1]._spread =
|
|
41590
|
+
return B[X][1]._spread = Be, oe;
|
|
41580
41591
|
}
|
|
41581
41592
|
function i(B, X) {
|
|
41582
41593
|
return oe;
|
|
@@ -41773,7 +41784,7 @@ function FEe(e) {
|
|
|
41773
41784
|
const X = this.stack.pop();
|
|
41774
41785
|
X.position.end = Qn(B.end);
|
|
41775
41786
|
}
|
|
41776
|
-
function
|
|
41787
|
+
function qe(B) {
|
|
41777
41788
|
I.call(this, B);
|
|
41778
41789
|
const X = this.stack[this.stack.length - 1];
|
|
41779
41790
|
X.url = this.sliceSerialize(B);
|
|
@@ -41789,7 +41800,7 @@ function FEe(e) {
|
|
|
41789
41800
|
children: []
|
|
41790
41801
|
};
|
|
41791
41802
|
}
|
|
41792
|
-
function
|
|
41803
|
+
function ct() {
|
|
41793
41804
|
return {
|
|
41794
41805
|
type: "code",
|
|
41795
41806
|
lang: null,
|
|
@@ -41845,7 +41856,7 @@ function FEe(e) {
|
|
|
41845
41856
|
alt: null
|
|
41846
41857
|
};
|
|
41847
41858
|
}
|
|
41848
|
-
function
|
|
41859
|
+
function De() {
|
|
41849
41860
|
return {
|
|
41850
41861
|
type: "link",
|
|
41851
41862
|
title: null,
|
|
@@ -49644,7 +49655,7 @@ var Hd = {
|
|
|
49644
49655
|
mu: !0
|
|
49645
49656
|
}, g6 = function(t) {
|
|
49646
49657
|
return typeof t != "string" && (t = t.unit), t in Hd || t in JAe || t === "ex";
|
|
49647
|
-
},
|
|
49658
|
+
}, dt = function(t, n) {
|
|
49648
49659
|
var r;
|
|
49649
49660
|
if (t.unit in Hd)
|
|
49650
49661
|
r = Hd[t.unit] / n.fontMetrics().ptPerEm / n.sizeMultiplier;
|
|
@@ -49871,18 +49882,18 @@ var rTe = {
|
|
|
49871
49882
|
"op-token": 1,
|
|
49872
49883
|
spacing: 1,
|
|
49873
49884
|
textord: 1
|
|
49874
|
-
},
|
|
49885
|
+
}, at = {
|
|
49875
49886
|
math: {},
|
|
49876
49887
|
text: {}
|
|
49877
49888
|
};
|
|
49878
49889
|
function y(e, t, n, r, a, i) {
|
|
49879
|
-
|
|
49890
|
+
at[e][a] = {
|
|
49880
49891
|
font: t,
|
|
49881
49892
|
group: n,
|
|
49882
49893
|
replace: r
|
|
49883
|
-
}, i && r && (
|
|
49894
|
+
}, i && r && (at[e][r] = at[e][a]);
|
|
49884
49895
|
}
|
|
49885
|
-
var v = "math", te = "text", M = "main", $ = "ams",
|
|
49896
|
+
var v = "math", te = "text", M = "main", $ = "ams", lt = "accent-token", ge = "bin", qt = "close", sa = "inner", Me = "mathord", vt = "op-token", nn = "open", qo = "punct", F = "rel", Yn = "spacing", G = "textord";
|
|
49886
49897
|
y(v, M, F, "≡", "\\equiv", !0);
|
|
49887
49898
|
y(v, M, F, "≺", "\\prec", !0);
|
|
49888
49899
|
y(v, M, F, "≻", "\\succ", !0);
|
|
@@ -50416,17 +50427,17 @@ y(v, M, sa, "…", "\\ldots", !0);
|
|
|
50416
50427
|
y(v, M, sa, "⋯", "\\@cdots", !0);
|
|
50417
50428
|
y(v, M, sa, "⋱", "\\ddots", !0);
|
|
50418
50429
|
y(v, M, G, "⋮", "\\varvdots");
|
|
50419
|
-
y(v, M,
|
|
50420
|
-
y(v, M,
|
|
50421
|
-
y(v, M,
|
|
50422
|
-
y(v, M,
|
|
50423
|
-
y(v, M,
|
|
50424
|
-
y(v, M,
|
|
50425
|
-
y(v, M,
|
|
50426
|
-
y(v, M,
|
|
50427
|
-
y(v, M,
|
|
50428
|
-
y(v, M,
|
|
50429
|
-
y(v, M,
|
|
50430
|
+
y(v, M, lt, "ˊ", "\\acute");
|
|
50431
|
+
y(v, M, lt, "ˋ", "\\grave");
|
|
50432
|
+
y(v, M, lt, "¨", "\\ddot");
|
|
50433
|
+
y(v, M, lt, "~", "\\tilde");
|
|
50434
|
+
y(v, M, lt, "ˉ", "\\bar");
|
|
50435
|
+
y(v, M, lt, "˘", "\\breve");
|
|
50436
|
+
y(v, M, lt, "ˇ", "\\check");
|
|
50437
|
+
y(v, M, lt, "^", "\\hat");
|
|
50438
|
+
y(v, M, lt, "⃗", "\\vec");
|
|
50439
|
+
y(v, M, lt, "˙", "\\dot");
|
|
50440
|
+
y(v, M, lt, "˚", "\\mathring");
|
|
50430
50441
|
y(v, M, Me, "", "\\@imath");
|
|
50431
50442
|
y(v, M, Me, "", "\\@jmath");
|
|
50432
50443
|
y(v, M, G, "ı", "ı");
|
|
@@ -50440,19 +50451,19 @@ y(te, M, G, "ø", "\\o", !0);
|
|
|
50440
50451
|
y(te, M, G, "Æ", "\\AE", !0);
|
|
50441
50452
|
y(te, M, G, "Œ", "\\OE", !0);
|
|
50442
50453
|
y(te, M, G, "Ø", "\\O", !0);
|
|
50443
|
-
y(te, M,
|
|
50444
|
-
y(te, M,
|
|
50445
|
-
y(te, M,
|
|
50446
|
-
y(te, M,
|
|
50447
|
-
y(te, M,
|
|
50448
|
-
y(te, M,
|
|
50449
|
-
y(te, M,
|
|
50450
|
-
y(te, M,
|
|
50451
|
-
y(te, M,
|
|
50452
|
-
y(te, M,
|
|
50453
|
-
y(te, M,
|
|
50454
|
-
y(te, M,
|
|
50455
|
-
y(te, M,
|
|
50454
|
+
y(te, M, lt, "ˊ", "\\'");
|
|
50455
|
+
y(te, M, lt, "ˋ", "\\`");
|
|
50456
|
+
y(te, M, lt, "ˆ", "\\^");
|
|
50457
|
+
y(te, M, lt, "˜", "\\~");
|
|
50458
|
+
y(te, M, lt, "ˉ", "\\=");
|
|
50459
|
+
y(te, M, lt, "˘", "\\u");
|
|
50460
|
+
y(te, M, lt, "˙", "\\.");
|
|
50461
|
+
y(te, M, lt, "¸", "\\c");
|
|
50462
|
+
y(te, M, lt, "˚", "\\r");
|
|
50463
|
+
y(te, M, lt, "ˇ", "\\v");
|
|
50464
|
+
y(te, M, lt, "¨", '\\"');
|
|
50465
|
+
y(te, M, lt, "˝", "\\H");
|
|
50466
|
+
y(te, M, lt, "◯", "\\textcircled");
|
|
50456
50467
|
var v6 = {
|
|
50457
50468
|
"--": !0,
|
|
50458
50469
|
"---": !0,
|
|
@@ -50513,8 +50524,8 @@ y(v, M, Me, "h", "ℎ");
|
|
|
50513
50524
|
y(te, M, Me, "h", "ℎ");
|
|
50514
50525
|
var Ne = "";
|
|
50515
50526
|
for (var Lt = 0; Lt < ro.length; Lt++) {
|
|
50516
|
-
var
|
|
50517
|
-
Ne = String.fromCharCode(55349, 56320 + Lt), y(v, M, Me,
|
|
50527
|
+
var ht = ro.charAt(Lt);
|
|
50528
|
+
Ne = String.fromCharCode(55349, 56320 + Lt), y(v, M, Me, ht, Ne), y(te, M, G, ht, Ne), Ne = String.fromCharCode(55349, 56372 + Lt), y(v, M, Me, ht, Ne), y(te, M, G, ht, Ne), Ne = String.fromCharCode(55349, 56424 + Lt), y(v, M, Me, ht, Ne), y(te, M, G, ht, Ne), Ne = String.fromCharCode(55349, 56580 + Lt), y(v, M, Me, ht, Ne), y(te, M, G, ht, Ne), Ne = String.fromCharCode(55349, 56684 + Lt), y(v, M, Me, ht, Ne), y(te, M, G, ht, Ne), Ne = String.fromCharCode(55349, 56736 + Lt), y(v, M, Me, ht, Ne), y(te, M, G, ht, Ne), Ne = String.fromCharCode(55349, 56788 + Lt), y(v, M, Me, ht, Ne), y(te, M, G, ht, Ne), Ne = String.fromCharCode(55349, 56840 + Lt), y(v, M, Me, ht, Ne), y(te, M, G, ht, Ne), Ne = String.fromCharCode(55349, 56944 + Lt), y(v, M, Me, ht, Ne), y(te, M, G, ht, Ne), Lt < 26 && (Ne = String.fromCharCode(55349, 56632 + Lt), y(v, M, Me, ht, Ne), y(te, M, G, ht, Ne), Ne = String.fromCharCode(55349, 56476 + Lt), y(v, M, Me, ht, Ne), y(te, M, G, ht, Ne));
|
|
50518
50529
|
}
|
|
50519
50530
|
Ne = "𝕜";
|
|
50520
50531
|
y(v, M, Me, "k", Ne);
|
|
@@ -50611,7 +50622,7 @@ var fi = [
|
|
|
50611
50622
|
throw new ce("Unsupported character: " + t);
|
|
50612
50623
|
}
|
|
50613
50624
|
}, Bo = function(t, n, r) {
|
|
50614
|
-
return
|
|
50625
|
+
return at[r][t] && at[r][t].replace && (t = at[r][t].replace), {
|
|
50615
50626
|
value: t,
|
|
50616
50627
|
metrics: th(t, n, r)
|
|
50617
50628
|
};
|
|
@@ -50631,7 +50642,7 @@ var fi = [
|
|
|
50631
50642
|
}
|
|
50632
50643
|
return l;
|
|
50633
50644
|
}, oTe = function(t, n, r, a) {
|
|
50634
|
-
return a === void 0 && (a = []), r.font === "boldsymbol" && Bo(t, "Main-Bold", n).metrics ? bn(t, "Main-Bold", n, r, a.concat(["mathbf"])) : t === "\\" ||
|
|
50645
|
+
return a === void 0 && (a = []), r.font === "boldsymbol" && Bo(t, "Main-Bold", n).metrics ? bn(t, "Main-Bold", n, r, a.concat(["mathbf"])) : t === "\\" || at[n][t].font === "main" ? bn(t, "Main-Regular", n, r, a) : bn(t, "AMS-Regular", n, r, a.concat(["amsrm"]));
|
|
50635
50646
|
}, sTe = function(t, n, r, a, i) {
|
|
50636
50647
|
return i !== "textord" && Bo(t, "Math-BoldItalic", n).metrics ? {
|
|
50637
50648
|
fontName: "Math-BoldItalic",
|
|
@@ -50662,7 +50673,7 @@ var fi = [
|
|
|
50662
50673
|
if (r === "mathord")
|
|
50663
50674
|
return bn(i, "Math-Italic", a, n, o.concat(["mathnormal"]));
|
|
50664
50675
|
if (r === "textord") {
|
|
50665
|
-
var _ =
|
|
50676
|
+
var _ = at[a][i] && at[a][i].font;
|
|
50666
50677
|
if (_ === "ams") {
|
|
50667
50678
|
var k = gi("amsrm", n.fontWeight, n.fontShape);
|
|
50668
50679
|
return bn(i, k, a, n, o.concat("amsrm", n.fontWeight, n.fontShape));
|
|
@@ -50791,7 +50802,7 @@ var fi = [
|
|
|
50791
50802
|
var C = jt(["vlist-t"], S);
|
|
50792
50803
|
return S.length === 2 && C.classes.push("vlist-t2"), C.height = h, C.depth = -p, C;
|
|
50793
50804
|
}, gTe = (e, t) => {
|
|
50794
|
-
var n = jt(["mspace"], [], t), r =
|
|
50805
|
+
var n = jt(["mspace"], [], t), r = dt(e, t);
|
|
50795
50806
|
return n.style.marginRight = de(r), n;
|
|
50796
50807
|
}, gi = function(t, n, r) {
|
|
50797
50808
|
var a = "";
|
|
@@ -50898,7 +50909,7 @@ var fi = [
|
|
|
50898
50909
|
staticSvg: yTe,
|
|
50899
50910
|
svgData: E6,
|
|
50900
50911
|
tryCombineChars: uTe
|
|
50901
|
-
},
|
|
50912
|
+
}, ut = {
|
|
50902
50913
|
number: 3,
|
|
50903
50914
|
unit: "mu"
|
|
50904
50915
|
}, _r = {
|
|
@@ -50909,16 +50920,16 @@ var fi = [
|
|
|
50909
50920
|
unit: "mu"
|
|
50910
50921
|
}, bTe = {
|
|
50911
50922
|
mord: {
|
|
50912
|
-
mop:
|
|
50923
|
+
mop: ut,
|
|
50913
50924
|
mbin: _r,
|
|
50914
50925
|
mrel: zn,
|
|
50915
|
-
minner:
|
|
50926
|
+
minner: ut
|
|
50916
50927
|
},
|
|
50917
50928
|
mop: {
|
|
50918
|
-
mord:
|
|
50919
|
-
mop:
|
|
50929
|
+
mord: ut,
|
|
50930
|
+
mop: ut,
|
|
50920
50931
|
mrel: zn,
|
|
50921
|
-
minner:
|
|
50932
|
+
minner: ut
|
|
50922
50933
|
},
|
|
50923
50934
|
mbin: {
|
|
50924
50935
|
mord: _r,
|
|
@@ -50934,46 +50945,46 @@ var fi = [
|
|
|
50934
50945
|
},
|
|
50935
50946
|
mopen: {},
|
|
50936
50947
|
mclose: {
|
|
50937
|
-
mop:
|
|
50948
|
+
mop: ut,
|
|
50938
50949
|
mbin: _r,
|
|
50939
50950
|
mrel: zn,
|
|
50940
|
-
minner:
|
|
50951
|
+
minner: ut
|
|
50941
50952
|
},
|
|
50942
50953
|
mpunct: {
|
|
50943
|
-
mord:
|
|
50944
|
-
mop:
|
|
50954
|
+
mord: ut,
|
|
50955
|
+
mop: ut,
|
|
50945
50956
|
mrel: zn,
|
|
50946
|
-
mopen:
|
|
50947
|
-
mclose:
|
|
50948
|
-
mpunct:
|
|
50949
|
-
minner:
|
|
50957
|
+
mopen: ut,
|
|
50958
|
+
mclose: ut,
|
|
50959
|
+
mpunct: ut,
|
|
50960
|
+
minner: ut
|
|
50950
50961
|
},
|
|
50951
50962
|
minner: {
|
|
50952
|
-
mord:
|
|
50953
|
-
mop:
|
|
50963
|
+
mord: ut,
|
|
50964
|
+
mop: ut,
|
|
50954
50965
|
mbin: _r,
|
|
50955
50966
|
mrel: zn,
|
|
50956
|
-
mopen:
|
|
50957
|
-
mpunct:
|
|
50958
|
-
minner:
|
|
50967
|
+
mopen: ut,
|
|
50968
|
+
mpunct: ut,
|
|
50969
|
+
minner: ut
|
|
50959
50970
|
}
|
|
50960
50971
|
}, kTe = {
|
|
50961
50972
|
mord: {
|
|
50962
|
-
mop:
|
|
50973
|
+
mop: ut
|
|
50963
50974
|
},
|
|
50964
50975
|
mop: {
|
|
50965
|
-
mord:
|
|
50966
|
-
mop:
|
|
50976
|
+
mord: ut,
|
|
50977
|
+
mop: ut
|
|
50967
50978
|
},
|
|
50968
50979
|
mbin: {},
|
|
50969
50980
|
mrel: {},
|
|
50970
50981
|
mopen: {},
|
|
50971
50982
|
mclose: {
|
|
50972
|
-
mop:
|
|
50983
|
+
mop: ut
|
|
50973
50984
|
},
|
|
50974
50985
|
mpunct: {},
|
|
50975
50986
|
minner: {
|
|
50976
|
-
mop:
|
|
50987
|
+
mop: ut
|
|
50977
50988
|
}
|
|
50978
50989
|
}, M6 = {}, ao = {}, io = {};
|
|
50979
50990
|
function me(e) {
|
|
@@ -51254,7 +51265,7 @@ var ae = {
|
|
|
51254
51265
|
SpaceNode: MTe,
|
|
51255
51266
|
newDocumentFragment: N6
|
|
51256
51267
|
}, mn = function(t, n, r) {
|
|
51257
|
-
return
|
|
51268
|
+
return at[n][t] && at[n][t].replace && t.charCodeAt(0) !== 55349 && !(v6.hasOwnProperty(t) && r && (r.fontFamily && r.fontFamily.slice(4, 6) === "tt" || r.font && r.font.slice(4, 6) === "tt")) && (t = at[n][t].replace), new ae.TextNode(t);
|
|
51258
51269
|
}, ah = function(t) {
|
|
51259
51270
|
return t.length === 1 ? t[0] : new ae.MathNode("mrow", t);
|
|
51260
51271
|
}, ih = function(t, n) {
|
|
@@ -51291,7 +51302,7 @@ var ae = {
|
|
|
51291
51302
|
var i = t.text;
|
|
51292
51303
|
if (Ee.contains(["\\imath", "\\jmath"], i))
|
|
51293
51304
|
return null;
|
|
51294
|
-
|
|
51305
|
+
at[a][i] && at[a][i].replace && (i = at[a][i].replace);
|
|
51295
51306
|
var o = Q.fontMap[r].fontName;
|
|
51296
51307
|
return th(i, o, a) ? Q.fontMap[r].variant : null;
|
|
51297
51308
|
}, Kt = function(t, n, r) {
|
|
@@ -51566,7 +51577,7 @@ var A6 = function(t) {
|
|
|
51566
51577
|
mathMLnode: TTe,
|
|
51567
51578
|
svgSpan: ITe
|
|
51568
51579
|
};
|
|
51569
|
-
function
|
|
51580
|
+
function Le(e, t) {
|
|
51570
51581
|
if (!e || e.type !== t)
|
|
51571
51582
|
throw new Error("Expected node of type " + t + ", but got " + (e ? "node of type " + e.type : String(e)));
|
|
51572
51583
|
return e;
|
|
@@ -51582,7 +51593,7 @@ function Uo(e) {
|
|
|
51582
51593
|
}
|
|
51583
51594
|
var sh = (e, t) => {
|
|
51584
51595
|
var n, r, a;
|
|
51585
|
-
e && e.type === "supsub" ? (r =
|
|
51596
|
+
e && e.type === "supsub" ? (r = Le(e.base, "accent"), n = r.base, e.base = n, a = nTe(Ke(e, t)), e.base = r) : (r = Le(e, "accent"), n = r.base);
|
|
51586
51597
|
var i = Ke(n, t.havingCrampedStyle()), o = r.isShifty && Ee.isCharacterBox(n), s = 0;
|
|
51587
51598
|
if (o) {
|
|
51588
51599
|
var l = Ee.getBaseElem(n), u = Ke(l, t.havingCrampedStyle());
|
|
@@ -52146,8 +52157,8 @@ me({
|
|
|
52146
52157
|
handler(e, t) {
|
|
52147
52158
|
for (var {
|
|
52148
52159
|
parser: n
|
|
52149
|
-
} = e, r =
|
|
52150
|
-
var s =
|
|
52160
|
+
} = e, r = Le(t[0], "ordgroup"), a = r.body, i = "", o = 0; o < a.length; o++) {
|
|
52161
|
+
var s = Le(a[o], "textord");
|
|
52151
52162
|
i += s.text;
|
|
52152
52163
|
}
|
|
52153
52164
|
var l = parseInt(i), u;
|
|
@@ -52180,7 +52191,7 @@ me({
|
|
|
52180
52191
|
handler(e, t) {
|
|
52181
52192
|
var {
|
|
52182
52193
|
parser: n
|
|
52183
|
-
} = e, r =
|
|
52194
|
+
} = e, r = Le(t[0], "color-token").color, a = t[1];
|
|
52184
52195
|
return {
|
|
52185
52196
|
type: "color",
|
|
52186
52197
|
mode: n.mode,
|
|
@@ -52203,7 +52214,7 @@ me({
|
|
|
52203
52214
|
var {
|
|
52204
52215
|
parser: n,
|
|
52205
52216
|
breakOnTokenText: r
|
|
52206
|
-
} = e, a =
|
|
52217
|
+
} = e, a = Le(t[0], "color-token").color;
|
|
52207
52218
|
n.gullet.macros.set("\\current@color", a);
|
|
52208
52219
|
var i = n.parseExpression(!0, r);
|
|
52209
52220
|
return {
|
|
@@ -52232,18 +52243,18 @@ me({
|
|
|
52232
52243
|
type: "cr",
|
|
52233
52244
|
mode: r.mode,
|
|
52234
52245
|
newLine: i,
|
|
52235
|
-
size: a &&
|
|
52246
|
+
size: a && Le(a, "size").value
|
|
52236
52247
|
};
|
|
52237
52248
|
},
|
|
52238
52249
|
// The following builders are called only at the top level,
|
|
52239
52250
|
// not within tabular/array environments.
|
|
52240
52251
|
htmlBuilder(e, t) {
|
|
52241
52252
|
var n = Q.makeSpan(["mspace"], [], t);
|
|
52242
|
-
return e.newLine && (n.classes.push("newline"), e.size && (n.style.marginTop = de(
|
|
52253
|
+
return e.newLine && (n.classes.push("newline"), e.size && (n.style.marginTop = de(dt(e.size, t)))), n;
|
|
52243
52254
|
},
|
|
52244
52255
|
mathmlBuilder(e, t) {
|
|
52245
52256
|
var n = new ae.MathNode("mspace");
|
|
52246
|
-
return e.newLine && (n.setAttribute("linebreak", "newline"), e.size && n.setAttribute("height", de(
|
|
52257
|
+
return e.newLine && (n.setAttribute("linebreak", "newline"), e.size && n.setAttribute("height", de(dt(e.size, t)))), n;
|
|
52247
52258
|
}
|
|
52248
52259
|
});
|
|
52249
52260
|
var Kd = {
|
|
@@ -52293,7 +52304,7 @@ me({
|
|
|
52293
52304
|
t.consumeSpaces();
|
|
52294
52305
|
var r = t.fetch();
|
|
52295
52306
|
if (Kd[r.text])
|
|
52296
|
-
return (n === "\\global" || n === "\\\\globallong") && (r.text = Kd[r.text]),
|
|
52307
|
+
return (n === "\\global" || n === "\\\\globallong") && (r.text = Kd[r.text]), Le(t.parseFunction(), "internal");
|
|
52297
52308
|
throw new ce("Invalid token after macro prefix", r);
|
|
52298
52309
|
}
|
|
52299
52310
|
});
|
|
@@ -52390,7 +52401,7 @@ me({
|
|
|
52390
52401
|
}
|
|
52391
52402
|
});
|
|
52392
52403
|
var ba = function(t, n, r) {
|
|
52393
|
-
var a =
|
|
52404
|
+
var a = at.math[t] && at.math[t].replace, i = th(a || t, n, r);
|
|
52394
52405
|
if (!i)
|
|
52395
52406
|
throw new Error("Unsupported symbol " + t + " and font size " + n + ".");
|
|
52396
52407
|
return i;
|
|
@@ -52733,7 +52744,7 @@ me({
|
|
|
52733
52744
|
++r.leftrightDepth;
|
|
52734
52745
|
var a = r.parseExpression(!1);
|
|
52735
52746
|
--r.leftrightDepth, r.expect("\\right", !1);
|
|
52736
|
-
var i =
|
|
52747
|
+
var i = Le(r.parseFunction(), "leftright-right");
|
|
52737
52748
|
return {
|
|
52738
52749
|
type: "leftright",
|
|
52739
52750
|
mode: r.mode,
|
|
@@ -52818,10 +52829,10 @@ var ch = (e, t) => {
|
|
|
52818
52829
|
if (r === "sout")
|
|
52819
52830
|
i = Q.makeSpan(["stretchy", "sout"]), i.height = t.fontMetrics().defaultRuleThickness / a, o = -0.5 * t.fontMetrics().xHeight;
|
|
52820
52831
|
else if (r === "phase") {
|
|
52821
|
-
var l =
|
|
52832
|
+
var l = dt({
|
|
52822
52833
|
number: 0.6,
|
|
52823
52834
|
unit: "pt"
|
|
52824
|
-
}, t), u =
|
|
52835
|
+
}, t), u = dt({
|
|
52825
52836
|
number: 0.35,
|
|
52826
52837
|
unit: "ex"
|
|
52827
52838
|
}, t), d = t.havingBaseSizing();
|
|
@@ -52935,7 +52946,7 @@ me({
|
|
|
52935
52946
|
var {
|
|
52936
52947
|
parser: r,
|
|
52937
52948
|
funcName: a
|
|
52938
|
-
} = e, i =
|
|
52949
|
+
} = e, i = Le(t[0], "color-token").color, o = t[1];
|
|
52939
52950
|
return {
|
|
52940
52951
|
type: "enclose",
|
|
52941
52952
|
mode: r.mode,
|
|
@@ -52959,7 +52970,7 @@ me({
|
|
|
52959
52970
|
var {
|
|
52960
52971
|
parser: r,
|
|
52961
52972
|
funcName: a
|
|
52962
|
-
} = e, i =
|
|
52973
|
+
} = e, i = Le(t[0], "color-token").color, o = Le(t[1], "color-token").color, s = t[2];
|
|
52963
52974
|
return {
|
|
52964
52975
|
type: "enclose",
|
|
52965
52976
|
mode: r.mode,
|
|
@@ -53160,15 +53171,15 @@ var On = function(t, n) {
|
|
|
53160
53171
|
var m = n.havingStyle(Se.SCRIPT).sizeMultiplier;
|
|
53161
53172
|
h = 0.2778 * (m / n.sizeMultiplier);
|
|
53162
53173
|
}
|
|
53163
|
-
var f = t.colSeparationType === "CD" ?
|
|
53174
|
+
var f = t.colSeparationType === "CD" ? dt({
|
|
53164
53175
|
number: 3,
|
|
53165
53176
|
unit: "ex"
|
|
53166
53177
|
}, n) : 12 * p, g = 3 * p, _ = t.arraystretch * f, k = 0.7 * _, b = 0.3 * _, w = 0;
|
|
53167
53178
|
function E(ue) {
|
|
53168
|
-
for (var
|
|
53169
|
-
|
|
53179
|
+
for (var De = 0; De < ue.length; ++De)
|
|
53180
|
+
De > 0 && (w += 0.25), u.push({
|
|
53170
53181
|
pos: w,
|
|
53171
|
-
isDashed: ue[
|
|
53182
|
+
isDashed: ue[De]
|
|
53172
53183
|
});
|
|
53173
53184
|
}
|
|
53174
53185
|
for (E(o[0]), r = 0; r < t.body.length; ++r) {
|
|
@@ -53180,7 +53191,7 @@ var On = function(t, n) {
|
|
|
53180
53191
|
D < C.depth && (D = C.depth), x < C.height && (x = C.height), P[a] = C;
|
|
53181
53192
|
}
|
|
53182
53193
|
var I = t.rowGaps[r], q = 0;
|
|
53183
|
-
I && (q =
|
|
53194
|
+
I && (q = dt(I, n), q > 0 && (q += b, D < q && (D = q), q = 0)), t.addJot && (D += g), P.height = x, P.depth = D, w += x, P.pos = w, w += D + q, l[r] = P, E(o[r + 1]);
|
|
53184
53195
|
}
|
|
53185
53196
|
var Y = w / 2 + n.fontMetrics().axisHeight, Z = t.cols || [], W = [], R, H, j = [];
|
|
53186
53197
|
if (t.tags && t.tags.some((ue) => ue))
|
|
@@ -53212,22 +53223,22 @@ var On = function(t, n) {
|
|
|
53212
53223
|
if (!(a >= s)) {
|
|
53213
53224
|
var Ie = void 0;
|
|
53214
53225
|
(a > 0 || t.hskipBeforeAndAfter) && (Ie = Ee.deflt(J.pregap, h), Ie !== 0 && (R = Q.makeSpan(["arraycolsep"], []), R.style.width = de(Ie), W.push(R)));
|
|
53215
|
-
var
|
|
53226
|
+
var qe = [];
|
|
53216
53227
|
for (r = 0; r < i; ++r) {
|
|
53217
53228
|
var Je = l[r], Xe = Je[a];
|
|
53218
53229
|
if (Xe) {
|
|
53219
|
-
var
|
|
53220
|
-
Xe.depth = Je.depth, Xe.height = Je.height,
|
|
53230
|
+
var ct = Je.pos - Y;
|
|
53231
|
+
Xe.depth = Je.depth, Xe.height = Je.height, qe.push({
|
|
53221
53232
|
type: "elem",
|
|
53222
53233
|
elem: Xe,
|
|
53223
|
-
shift:
|
|
53234
|
+
shift: ct
|
|
53224
53235
|
});
|
|
53225
53236
|
}
|
|
53226
53237
|
}
|
|
53227
|
-
|
|
53238
|
+
qe = Q.makeVList({
|
|
53228
53239
|
positionType: "individualShift",
|
|
53229
|
-
children:
|
|
53230
|
-
}, n),
|
|
53240
|
+
children: qe
|
|
53241
|
+
}, n), qe = Q.makeSpan(["col-align-" + (J.align || "c")], [qe]), W.push(qe), (a < s - 1 || t.hskipBeforeAndAfter) && (Ie = Ee.deflt(J.postgap, h), Ie !== 0 && (R = Q.makeSpan(["arraycolsep"], []), R.style.width = de(Ie), W.push(R)));
|
|
53231
53242
|
}
|
|
53232
53243
|
}
|
|
53233
53244
|
if (l = Q.makeSpan(["mtable"], W), u.length > 0) {
|
|
@@ -53307,7 +53318,7 @@ var On = function(t, n) {
|
|
|
53307
53318
|
};
|
|
53308
53319
|
if (n[0] && n[0].type === "ordgroup") {
|
|
53309
53320
|
for (var d = "", p = 0; p < n[0].body.length; p++) {
|
|
53310
|
-
var h =
|
|
53321
|
+
var h = Le(n[0].body[p], "textord");
|
|
53311
53322
|
d += h.text;
|
|
53312
53323
|
}
|
|
53313
53324
|
s = Number(d), l = s * 2;
|
|
@@ -53315,7 +53326,7 @@ var On = function(t, n) {
|
|
|
53315
53326
|
var m = !l;
|
|
53316
53327
|
o.body.forEach(function(k) {
|
|
53317
53328
|
for (var b = 1; b < k.length; b += 2) {
|
|
53318
|
-
var w =
|
|
53329
|
+
var w = Le(k[b], "styling"), E = Le(w.body[0], "ordgroup");
|
|
53319
53330
|
E.body.unshift(u);
|
|
53320
53331
|
}
|
|
53321
53332
|
if (m)
|
|
@@ -53344,7 +53355,7 @@ In({
|
|
|
53344
53355
|
numArgs: 1
|
|
53345
53356
|
},
|
|
53346
53357
|
handler(e, t) {
|
|
53347
|
-
var n = Uo(t[0]), r = n ? [t[0]] :
|
|
53358
|
+
var n = Uo(t[0]), r = n ? [t[0]] : Le(t[0], "ordgroup").body, a = r.map(function(o) {
|
|
53348
53359
|
var s = oh(o), l = s.text;
|
|
53349
53360
|
if ("lcr".indexOf(l) !== -1)
|
|
53350
53361
|
return {
|
|
@@ -53444,7 +53455,7 @@ In({
|
|
|
53444
53455
|
numArgs: 1
|
|
53445
53456
|
},
|
|
53446
53457
|
handler(e, t) {
|
|
53447
|
-
var n = Uo(t[0]), r = n ? [t[0]] :
|
|
53458
|
+
var n = Uo(t[0]), r = n ? [t[0]] : Le(t[0], "ordgroup").body, a = r.map(function(o) {
|
|
53448
53459
|
var s = oh(o), l = s.text;
|
|
53449
53460
|
if ("lc".indexOf(l) !== -1)
|
|
53450
53461
|
return {
|
|
@@ -53612,7 +53623,7 @@ me({
|
|
|
53612
53623
|
if (a.type !== "ordgroup")
|
|
53613
53624
|
throw new ce("Invalid environment name", a);
|
|
53614
53625
|
for (var i = "", o = 0; o < a.body.length; ++o)
|
|
53615
|
-
i +=
|
|
53626
|
+
i += Le(a.body[o], "textord").text;
|
|
53616
53627
|
if (r === "\\begin") {
|
|
53617
53628
|
if (!mf.hasOwnProperty(i))
|
|
53618
53629
|
throw new ce("No such environment: " + i, a);
|
|
@@ -53625,7 +53636,7 @@ me({
|
|
|
53625
53636
|
parser: n
|
|
53626
53637
|
}, p = s.handler(d, l, u);
|
|
53627
53638
|
n.expect("\\end", !1);
|
|
53628
|
-
var h = n.nextToken, m =
|
|
53639
|
+
var h = n.nextToken, m = Le(n.parseFunction(), "environment");
|
|
53629
53640
|
if (m.name !== i)
|
|
53630
53641
|
throw new ce("Mismatch: \\begin{" + i + "} matched by \\end{" + m.name + "}", h);
|
|
53631
53642
|
return p;
|
|
@@ -53755,7 +53766,7 @@ var Z6 = (e, t) => {
|
|
|
53755
53766
|
}
|
|
53756
53767
|
i = t.havingStyle(a);
|
|
53757
53768
|
var u = Ke(e.denom, i, t), d, p, h;
|
|
53758
|
-
e.hasBarLine ? (e.barSize ? (p =
|
|
53769
|
+
e.hasBarLine ? (e.barSize ? (p = dt(e.barSize, t), d = Q.makeLineSpan("frac-line", t, p)) : d = Q.makeLineSpan("frac-line", t), p = d.height, h = d.height) : (d = null, p = 0, h = t.fontMetrics().defaultRuleThickness);
|
|
53759
53770
|
var m, f, g;
|
|
53760
53771
|
n.size === Se.DISPLAY.size || e.size === "display" ? (m = t.fontMetrics().num1, p > 0 ? f = 3 * h : f = 7 * h, g = t.fontMetrics().denom1) : (p > 0 ? (m = t.fontMetrics().num2, f = h) : (m = t.fontMetrics().num3, f = 3 * h), g = t.fontMetrics().denom2);
|
|
53761
53772
|
var _;
|
|
@@ -53804,7 +53815,7 @@ var Z6 = (e, t) => {
|
|
|
53804
53815
|
if (!e.hasBarLine)
|
|
53805
53816
|
n.setAttribute("linethickness", "0px");
|
|
53806
53817
|
else if (e.barSize) {
|
|
53807
|
-
var r =
|
|
53818
|
+
var r = dt(e.barSize, t);
|
|
53808
53819
|
n.setAttribute("linethickness", de(r));
|
|
53809
53820
|
}
|
|
53810
53821
|
var a = Z6(e.size, t.style);
|
|
@@ -53980,16 +53991,16 @@ me({
|
|
|
53980
53991
|
handler(e, t) {
|
|
53981
53992
|
var {
|
|
53982
53993
|
parser: n
|
|
53983
|
-
} = e, r = t[4], a = t[5], i = oo(t[0]), o = i.type === "atom" && i.family === "open" ? yf(i.text) : null, s = oo(t[1]), l = s.type === "atom" && s.family === "close" ? yf(s.text) : null, u =
|
|
53994
|
+
} = e, r = t[4], a = t[5], i = oo(t[0]), o = i.type === "atom" && i.family === "open" ? yf(i.text) : null, s = oo(t[1]), l = s.type === "atom" && s.family === "close" ? yf(s.text) : null, u = Le(t[2], "size"), d, p = null;
|
|
53984
53995
|
u.isBlank ? d = !0 : (p = u.value, d = p.number > 0);
|
|
53985
53996
|
var h = "auto", m = t[3];
|
|
53986
53997
|
if (m.type === "ordgroup") {
|
|
53987
53998
|
if (m.body.length > 0) {
|
|
53988
|
-
var f =
|
|
53999
|
+
var f = Le(m.body[0], "textord");
|
|
53989
54000
|
h = gf[Number(f.text)];
|
|
53990
54001
|
}
|
|
53991
54002
|
} else
|
|
53992
|
-
m =
|
|
54003
|
+
m = Le(m, "textord"), h = gf[Number(m.text)];
|
|
53993
54004
|
return {
|
|
53994
54005
|
type: "genfrac",
|
|
53995
54006
|
mode: n.mode,
|
|
@@ -54024,7 +54035,7 @@ me({
|
|
|
54024
54035
|
type: "infix",
|
|
54025
54036
|
mode: n.mode,
|
|
54026
54037
|
replaceWith: "\\\\abovefrac",
|
|
54027
|
-
size:
|
|
54038
|
+
size: Le(t[0], "size").value,
|
|
54028
54039
|
token: a
|
|
54029
54040
|
};
|
|
54030
54041
|
}
|
|
@@ -54040,7 +54051,7 @@ me({
|
|
|
54040
54051
|
var {
|
|
54041
54052
|
parser: n,
|
|
54042
54053
|
funcName: r
|
|
54043
|
-
} = e, a = t[0], i = CAe(
|
|
54054
|
+
} = e, a = t[0], i = CAe(Le(t[1], "infix").size), o = t[2], s = i.number > 0;
|
|
54044
54055
|
return {
|
|
54045
54056
|
type: "genfrac",
|
|
54046
54057
|
mode: n.mode,
|
|
@@ -54059,7 +54070,7 @@ me({
|
|
|
54059
54070
|
});
|
|
54060
54071
|
var X6 = (e, t) => {
|
|
54061
54072
|
var n = t.style, r, a;
|
|
54062
|
-
e.type === "supsub" ? (r = e.sup ? Ke(e.sup, t.havingStyle(n.sup()), t) : Ke(e.sub, t.havingStyle(n.sub()), t), a =
|
|
54073
|
+
e.type === "supsub" ? (r = e.sup ? Ke(e.sup, t.havingStyle(n.sup()), t) : Ke(e.sub, t.havingStyle(n.sub()), t), a = Le(e.base, "horizBrace")) : a = Le(e, "horizBrace");
|
|
54063
54074
|
var i = Ke(a.base, t.havingBaseStyle(Se.DISPLAY)), o = Gn.svgSpan(a, t), s;
|
|
54064
54075
|
if (a.isOver ? (s = Q.makeVList({
|
|
54065
54076
|
positionType: "firstBaseline",
|
|
@@ -54153,7 +54164,7 @@ me({
|
|
|
54153
54164
|
handler: (e, t) => {
|
|
54154
54165
|
var {
|
|
54155
54166
|
parser: n
|
|
54156
|
-
} = e, r = t[1], a =
|
|
54167
|
+
} = e, r = t[1], a = Le(t[0], "url").url;
|
|
54157
54168
|
return n.settings.isTrusted({
|
|
54158
54169
|
command: "\\href",
|
|
54159
54170
|
url: a
|
|
@@ -54184,7 +54195,7 @@ me({
|
|
|
54184
54195
|
handler: (e, t) => {
|
|
54185
54196
|
var {
|
|
54186
54197
|
parser: n
|
|
54187
|
-
} = e, r =
|
|
54198
|
+
} = e, r = Le(t[0], "url").url;
|
|
54188
54199
|
if (!n.settings.isTrusted({
|
|
54189
54200
|
command: "\\url",
|
|
54190
54201
|
url: r
|
|
@@ -54252,7 +54263,7 @@ me({
|
|
|
54252
54263
|
parser: n,
|
|
54253
54264
|
funcName: r,
|
|
54254
54265
|
token: a
|
|
54255
|
-
} = e, i =
|
|
54266
|
+
} = e, i = Le(t[0], "raw").string, o = t[1];
|
|
54256
54267
|
n.settings.strict && n.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode");
|
|
54257
54268
|
var s, l = {};
|
|
54258
54269
|
switch (r) {
|
|
@@ -54372,7 +54383,7 @@ me({
|
|
|
54372
54383
|
unit: "em"
|
|
54373
54384
|
}, s = "";
|
|
54374
54385
|
if (n[0])
|
|
54375
|
-
for (var l =
|
|
54386
|
+
for (var l = Le(n[0], "raw").string, u = l.split(","), d = 0; d < u.length; d++) {
|
|
54376
54387
|
var p = u[d].split("=");
|
|
54377
54388
|
if (p.length === 2) {
|
|
54378
54389
|
var h = p[1].trim();
|
|
@@ -54394,7 +54405,7 @@ me({
|
|
|
54394
54405
|
}
|
|
54395
54406
|
}
|
|
54396
54407
|
}
|
|
54397
|
-
var m =
|
|
54408
|
+
var m = Le(t[0], "url").url;
|
|
54398
54409
|
return s === "" && (s = m, s = s.replace(/^.*[\\/]/, ""), s = s.substring(0, s.lastIndexOf("."))), r.settings.isTrusted({
|
|
54399
54410
|
command: "\\includegraphics",
|
|
54400
54411
|
url: m
|
|
@@ -54409,10 +54420,10 @@ me({
|
|
|
54409
54420
|
} : r.formatUnsupportedCmd("\\includegraphics");
|
|
54410
54421
|
},
|
|
54411
54422
|
htmlBuilder: (e, t) => {
|
|
54412
|
-
var n =
|
|
54413
|
-
e.totalheight.number > 0 && (r =
|
|
54423
|
+
var n = dt(e.height, t), r = 0;
|
|
54424
|
+
e.totalheight.number > 0 && (r = dt(e.totalheight, t) - n);
|
|
54414
54425
|
var a = 0;
|
|
54415
|
-
e.width.number > 0 && (a =
|
|
54426
|
+
e.width.number > 0 && (a = dt(e.width, t));
|
|
54416
54427
|
var i = {
|
|
54417
54428
|
height: de(n + r)
|
|
54418
54429
|
};
|
|
@@ -54423,9 +54434,9 @@ me({
|
|
|
54423
54434
|
mathmlBuilder: (e, t) => {
|
|
54424
54435
|
var n = new ae.MathNode("mglyph", []);
|
|
54425
54436
|
n.setAttribute("alt", e.alt);
|
|
54426
|
-
var r =
|
|
54427
|
-
if (e.totalheight.number > 0 && (a =
|
|
54428
|
-
var i =
|
|
54437
|
+
var r = dt(e.height, t), a = 0;
|
|
54438
|
+
if (e.totalheight.number > 0 && (a = dt(e.totalheight, t) - r, n.setAttribute("valign", de(-a))), n.setAttribute("height", de(r + a)), e.width.number > 0) {
|
|
54439
|
+
var i = dt(e.width, t);
|
|
54429
54440
|
n.setAttribute("width", de(i));
|
|
54430
54441
|
}
|
|
54431
54442
|
return n.setAttribute("src", e.src), n;
|
|
@@ -54444,7 +54455,7 @@ me({
|
|
|
54444
54455
|
var {
|
|
54445
54456
|
parser: n,
|
|
54446
54457
|
funcName: r
|
|
54447
|
-
} = e, a =
|
|
54458
|
+
} = e, a = Le(t[0], "size");
|
|
54448
54459
|
if (n.settings.strict) {
|
|
54449
54460
|
var i = r[1] === "m", o = a.value.unit === "mu";
|
|
54450
54461
|
i ? (o || n.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + r + " supports only mu units, " + ("not " + a.value.unit + " units")), n.mode !== "math" && n.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + r + " works only in math mode")) : o && n.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + r + " doesn't support mu units");
|
|
@@ -54459,7 +54470,7 @@ me({
|
|
|
54459
54470
|
return Q.makeGlue(e.dimension, t);
|
|
54460
54471
|
},
|
|
54461
54472
|
mathmlBuilder(e, t) {
|
|
54462
|
-
var n =
|
|
54473
|
+
var n = dt(e.dimension, t);
|
|
54463
54474
|
return new ae.SpaceNode(n);
|
|
54464
54475
|
}
|
|
54465
54476
|
});
|
|
@@ -54674,7 +54685,7 @@ var Q6 = (e, t, n, r, a, i, o) => {
|
|
|
54674
54685
|
return Q.makeSpan(["mop", "op-limits"], _, r);
|
|
54675
54686
|
}, J6 = ["\\smallint"], la = (e, t) => {
|
|
54676
54687
|
var n, r, a = !1, i;
|
|
54677
|
-
e.type === "supsub" ? (n = e.sup, r = e.sub, i =
|
|
54688
|
+
e.type === "supsub" ? (n = e.sup, r = e.sub, i = Le(e.base, "op"), a = !0) : i = Le(e, "op");
|
|
54678
54689
|
var o = t.style, s = !1;
|
|
54679
54690
|
o.size === Se.DISPLAY.size && i.symbol && !Ee.contains(J6, i.name) && (s = !0);
|
|
54680
54691
|
var l;
|
|
@@ -54856,7 +54867,7 @@ me({
|
|
|
54856
54867
|
});
|
|
54857
54868
|
var e8 = (e, t) => {
|
|
54858
54869
|
var n, r, a = !1, i;
|
|
54859
|
-
e.type === "supsub" ? (n = e.sup, r = e.sub, i =
|
|
54870
|
+
e.type === "supsub" ? (n = e.sup, r = e.sub, i = Le(e.base, "operatorname"), a = !0) : i = Le(e, "operatorname");
|
|
54860
54871
|
var o;
|
|
54861
54872
|
if (i.body.length > 0) {
|
|
54862
54873
|
for (var s = i.body.map((p) => {
|
|
@@ -55079,7 +55090,7 @@ me({
|
|
|
55079
55090
|
handler(e, t) {
|
|
55080
55091
|
var {
|
|
55081
55092
|
parser: n
|
|
55082
|
-
} = e, r =
|
|
55093
|
+
} = e, r = Le(t[0], "size").value, a = t[1];
|
|
55083
55094
|
return {
|
|
55084
55095
|
type: "raisebox",
|
|
55085
55096
|
mode: n.mode,
|
|
@@ -55088,7 +55099,7 @@ me({
|
|
|
55088
55099
|
};
|
|
55089
55100
|
},
|
|
55090
55101
|
htmlBuilder(e, t) {
|
|
55091
|
-
var n = Ke(e.body, t), r =
|
|
55102
|
+
var n = Ke(e.body, t), r = dt(e.dy, t);
|
|
55092
55103
|
return Q.makeVList({
|
|
55093
55104
|
positionType: "shift",
|
|
55094
55105
|
positionData: -r,
|
|
@@ -55131,21 +55142,21 @@ me({
|
|
|
55131
55142
|
handler(e, t, n) {
|
|
55132
55143
|
var {
|
|
55133
55144
|
parser: r
|
|
55134
|
-
} = e, a = n[0], i =
|
|
55145
|
+
} = e, a = n[0], i = Le(t[0], "size"), o = Le(t[1], "size");
|
|
55135
55146
|
return {
|
|
55136
55147
|
type: "rule",
|
|
55137
55148
|
mode: r.mode,
|
|
55138
|
-
shift: a &&
|
|
55149
|
+
shift: a && Le(a, "size").value,
|
|
55139
55150
|
width: i.value,
|
|
55140
55151
|
height: o.value
|
|
55141
55152
|
};
|
|
55142
55153
|
},
|
|
55143
55154
|
htmlBuilder(e, t) {
|
|
55144
|
-
var n = Q.makeSpan(["mord", "rule"], [], t), r =
|
|
55155
|
+
var n = Q.makeSpan(["mord", "rule"], [], t), r = dt(e.width, t), a = dt(e.height, t), i = e.shift ? dt(e.shift, t) : 0;
|
|
55145
55156
|
return n.style.borderRightWidth = de(r), n.style.borderTopWidth = de(a), n.style.bottom = de(i), n.width = r, n.height = a + i, n.depth = -i, n.maxFontSize = a * 1.125 * t.sizeMultiplier, n;
|
|
55146
55157
|
},
|
|
55147
55158
|
mathmlBuilder(e, t) {
|
|
55148
|
-
var n =
|
|
55159
|
+
var n = dt(e.width, t), r = dt(e.height, t), a = e.shift ? dt(e.shift, t) : 0, i = t.color && t.getColor() || "black", o = new ae.MathNode("mspace");
|
|
55149
55160
|
o.setAttribute("mathbackground", i), o.setAttribute("width", de(n)), o.setAttribute("height", de(r));
|
|
55150
55161
|
var s = new ae.MathNode("mpadded", [o]);
|
|
55151
55162
|
return a >= 0 ? s.setAttribute("height", de(a)) : (s.setAttribute("height", de(a)), s.setAttribute("depth", de(-a))), s.setAttribute("voffset", de(a)), s;
|
|
@@ -55200,7 +55211,7 @@ me({
|
|
|
55200
55211
|
handler: (e, t, n) => {
|
|
55201
55212
|
var {
|
|
55202
55213
|
parser: r
|
|
55203
|
-
} = e, a = !1, i = !1, o = n[0] &&
|
|
55214
|
+
} = e, a = !1, i = !1, o = n[0] && Le(n[0], "ordgroup");
|
|
55204
55215
|
if (o)
|
|
55205
55216
|
for (var s = "", l = 0; l < o.body.length; ++l) {
|
|
55206
55217
|
var u = o.body[l];
|
|
@@ -55996,7 +56007,7 @@ A("\\errmessage", (e) => {
|
|
|
55996
56007
|
});
|
|
55997
56008
|
A("\\show", (e) => {
|
|
55998
56009
|
var t = e.popToken(), n = t.text;
|
|
55999
|
-
return console.log(t, e.macros.get(n), rr[n],
|
|
56010
|
+
return console.log(t, e.macros.get(n), rr[n], at.math[n], at.text[n]), "";
|
|
56000
56011
|
});
|
|
56001
56012
|
A("\\bgroup", "{");
|
|
56002
56013
|
A("\\egroup", "}");
|
|
@@ -56129,7 +56140,7 @@ var Af = {
|
|
|
56129
56140
|
};
|
|
56130
56141
|
A("\\dots", function(e) {
|
|
56131
56142
|
var t = "\\dotso", n = e.expandAfterFuture().text;
|
|
56132
|
-
return n in Af ? t = Af[n] : (n.slice(0, 4) === "\\not" || n in
|
|
56143
|
+
return n in Af ? t = Af[n] : (n.slice(0, 4) === "\\not" || n in at.math && Ee.contains(["bin", "rel"], at.math[n].group)) && (t = "\\dotsb"), t;
|
|
56133
56144
|
});
|
|
56134
56145
|
var gh = {
|
|
56135
56146
|
// \rightdelim@ checks for the following:
|
|
@@ -56734,7 +56745,7 @@ class fCe {
|
|
|
56734
56745
|
* `implicitCommands`.
|
|
56735
56746
|
*/
|
|
56736
56747
|
isDefined(t) {
|
|
56737
|
-
return this.macros.has(t) || rr.hasOwnProperty(t) ||
|
|
56748
|
+
return this.macros.has(t) || rr.hasOwnProperty(t) || at.math.hasOwnProperty(t) || at.text.hasOwnProperty(t) || o8.hasOwnProperty(t);
|
|
56738
56749
|
}
|
|
56739
56750
|
/**
|
|
56740
56751
|
* Determine whether a command is expandable.
|
|
@@ -57752,13 +57763,13 @@ class Go {
|
|
|
57752
57763
|
star: a
|
|
57753
57764
|
};
|
|
57754
57765
|
}
|
|
57755
|
-
Cf.hasOwnProperty(n[0]) && !
|
|
57766
|
+
Cf.hasOwnProperty(n[0]) && !at[this.mode][n[0]] && (this.settings.strict && this.mode === "math" && this.settings.reportNonstrict("unicodeTextInMathMode", 'Accented Unicode text character "' + n[0] + '" used in math mode', t), n = Cf[n[0]] + n.slice(1));
|
|
57756
57767
|
var i = dCe.exec(n);
|
|
57757
57768
|
i && (n = n.substring(0, i.index), n === "i" ? n = "ı" : n === "j" && (n = "ȷ"));
|
|
57758
57769
|
var o;
|
|
57759
|
-
if (
|
|
57770
|
+
if (at[this.mode][n]) {
|
|
57760
57771
|
this.settings.strict && this.mode === "math" && jd.indexOf(n) >= 0 && this.settings.reportNonstrict("unicodeTextInMathMode", 'Latin-1/Unicode text character "' + n[0] + '" used in math mode', t);
|
|
57761
|
-
var s =
|
|
57772
|
+
var s = at[this.mode][n].group, l = Qt.range(t), u;
|
|
57762
57773
|
if (rTe.hasOwnProperty(s)) {
|
|
57763
57774
|
var d = s;
|
|
57764
57775
|
u = {
|
|
@@ -70624,7 +70635,7 @@ function yOe(e) {
|
|
|
70624
70635
|
match: En
|
|
70625
70636
|
}
|
|
70626
70637
|
]
|
|
70627
|
-
},
|
|
70638
|
+
}, qe = {
|
|
70628
70639
|
begin: /\(/,
|
|
70629
70640
|
end: /\)/,
|
|
70630
70641
|
keywords: u,
|
|
@@ -70653,7 +70664,7 @@ function yOe(e) {
|
|
|
70653
70664
|
},
|
|
70654
70665
|
contains: [
|
|
70655
70666
|
ke,
|
|
70656
|
-
|
|
70667
|
+
qe,
|
|
70657
70668
|
t
|
|
70658
70669
|
],
|
|
70659
70670
|
illegal: [
|
|
@@ -70668,11 +70679,11 @@ function yOe(e) {
|
|
|
70668
70679
|
className: { 1: "keyword" },
|
|
70669
70680
|
contains: [
|
|
70670
70681
|
ke,
|
|
70671
|
-
|
|
70682
|
+
qe,
|
|
70672
70683
|
t
|
|
70673
70684
|
],
|
|
70674
70685
|
illegal: /\[|%/
|
|
70675
|
-
},
|
|
70686
|
+
}, ct = {
|
|
70676
70687
|
match: [
|
|
70677
70688
|
/operator/,
|
|
70678
70689
|
/\s+/,
|
|
@@ -70752,7 +70763,7 @@ function yOe(e) {
|
|
|
70752
70763
|
]
|
|
70753
70764
|
};
|
|
70754
70765
|
for (const xe of C.variants) {
|
|
70755
|
-
const Ye = xe.contains.find((
|
|
70766
|
+
const Ye = xe.contains.find((De) => De.label === "interpol");
|
|
70756
70767
|
Ye.keywords = u;
|
|
70757
70768
|
const ue = [
|
|
70758
70769
|
...d,
|
|
@@ -70784,7 +70795,7 @@ function yOe(e) {
|
|
|
70784
70795
|
et,
|
|
70785
70796
|
ie,
|
|
70786
70797
|
we,
|
|
70787
|
-
|
|
70798
|
+
ct,
|
|
70788
70799
|
xt,
|
|
70789
70800
|
{
|
|
70790
70801
|
beginKeywords: "import",
|
|
@@ -72930,11 +72941,11 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, V = j), z ===
|
|
|
72930
72941
|
oe += Ce.substring(B, X.index);
|
|
72931
72942
|
const ne = we.case_insensitive ? X[0].toLowerCase() : X[0], _e = K(ue, ne);
|
|
72932
72943
|
if (_e) {
|
|
72933
|
-
const [
|
|
72934
|
-
if (Ue.addText(oe), oe = "", N[ne] = (N[ne] || 0) + 1, N[ne] <= gLe && (ve +=
|
|
72944
|
+
const [Be, pt] = _e;
|
|
72945
|
+
if (Ue.addText(oe), oe = "", N[ne] = (N[ne] || 0) + 1, N[ne] <= gLe && (ve += pt), Be.startsWith("_"))
|
|
72935
72946
|
oe += X[0];
|
|
72936
72947
|
else {
|
|
72937
|
-
const Nt = we.classNameAliases[
|
|
72948
|
+
const Nt = we.classNameAliases[Be] || Be;
|
|
72938
72949
|
ye(X[0], Nt);
|
|
72939
72950
|
}
|
|
72940
72951
|
} else
|
|
@@ -72952,7 +72963,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, V = j), z ===
|
|
|
72952
72963
|
Ue.addText(Ce);
|
|
72953
72964
|
return;
|
|
72954
72965
|
}
|
|
72955
|
-
B = p(ue.subLanguage, Ce, !0,
|
|
72966
|
+
B = p(ue.subLanguage, Ce, !0, De[ue.subLanguage]), De[ue.subLanguage] = /** @type {CompiledMode} */
|
|
72956
72967
|
B._top;
|
|
72957
72968
|
} else
|
|
72958
72969
|
B = m(Ce, ue.subLanguage.length ? ue.subLanguage : null);
|
|
@@ -72972,14 +72983,14 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, V = j), z ===
|
|
|
72972
72983
|
oe++;
|
|
72973
72984
|
continue;
|
|
72974
72985
|
}
|
|
72975
|
-
const _e = we.classNameAliases[B[oe]] || B[oe],
|
|
72976
|
-
_e ? ye(
|
|
72986
|
+
const _e = we.classNameAliases[B[oe]] || B[oe], Be = X[oe];
|
|
72987
|
+
_e ? ye(Be, _e) : (Ce = Be, J(), Ce = ""), oe++;
|
|
72977
72988
|
}
|
|
72978
72989
|
}
|
|
72979
72990
|
function Ie(B, X) {
|
|
72980
72991
|
return B.scope && typeof B.scope == "string" && Ue.openNode(we.classNameAliases[B.scope] || B.scope), B.beginScope && (B.beginScope._wrap ? (ye(Ce, we.classNameAliases[B.beginScope._wrap] || B.beginScope._wrap), Ce = "") : B.beginScope._multi && (ke(B.beginScope, X), Ce = "")), ue = Object.create(B, { parent: { value: ue } }), ue;
|
|
72981
72992
|
}
|
|
72982
|
-
function
|
|
72993
|
+
function qe(B, X, oe) {
|
|
72983
72994
|
let ne = IOe(B.endRe, oe);
|
|
72984
72995
|
if (ne) {
|
|
72985
72996
|
if (B["on:end"]) {
|
|
@@ -72993,20 +73004,20 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, V = j), z ===
|
|
|
72993
73004
|
}
|
|
72994
73005
|
}
|
|
72995
73006
|
if (B.endsWithParent)
|
|
72996
|
-
return
|
|
73007
|
+
return qe(B.parent, X, oe);
|
|
72997
73008
|
}
|
|
72998
73009
|
function Je(B) {
|
|
72999
73010
|
return ue.matcher.regexIndex === 0 ? (Ce += B[0], 1) : (Re = !0, 0);
|
|
73000
73011
|
}
|
|
73001
73012
|
function Xe(B) {
|
|
73002
73013
|
const X = B[0], oe = B.rule, ne = new Qf(oe), _e = [oe.__beforeBegin, oe["on:begin"]];
|
|
73003
|
-
for (const
|
|
73004
|
-
if (
|
|
73014
|
+
for (const Be of _e)
|
|
73015
|
+
if (Be && (Be(B, ne), ne.isMatchIgnored))
|
|
73005
73016
|
return Je(X);
|
|
73006
73017
|
return oe.skip ? Ce += X : (oe.excludeBegin && (Ce += X), se(), !oe.returnBegin && !oe.excludeBegin && (Ce = X)), Ie(oe, B), oe.returnBegin ? 0 : X.length;
|
|
73007
73018
|
}
|
|
73008
|
-
function
|
|
73009
|
-
const X = B[0], oe = j.substring(B.index), ne =
|
|
73019
|
+
function ct(B) {
|
|
73020
|
+
const X = B[0], oe = j.substring(B.index), ne = qe(ue, B, oe);
|
|
73010
73021
|
if (!ne)
|
|
73011
73022
|
return ag;
|
|
73012
73023
|
const _e = ue;
|
|
@@ -73040,7 +73051,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, V = j), z ===
|
|
|
73040
73051
|
const ne = new Error('Illegal lexeme "' + oe + '" for mode "' + (ue.scope || "<unnamed>") + '"');
|
|
73041
73052
|
throw ne.mode = ue, ne;
|
|
73042
73053
|
} else if (X.type === "end") {
|
|
73043
|
-
const ne =
|
|
73054
|
+
const ne = ct(X);
|
|
73044
73055
|
if (ne !== ag)
|
|
73045
73056
|
return ne;
|
|
73046
73057
|
}
|
|
@@ -73056,7 +73067,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, V = j), z ===
|
|
|
73056
73067
|
throw Ar(i.replace("{}", H)), new Error('Unknown language: "' + H + '"');
|
|
73057
73068
|
const xe = pLe(we);
|
|
73058
73069
|
let Ye = "", ue = V || xe;
|
|
73059
|
-
const
|
|
73070
|
+
const De = {}, Ue = new s.__emitter(s);
|
|
73060
73071
|
xt();
|
|
73061
73072
|
let Ce = "", ve = 0, pe = 0, be = 0, Re = !1;
|
|
73062
73073
|
try {
|
|
@@ -73986,9 +73997,9 @@ function KLe(e, t) {
|
|
|
73986
73997
|
defaultCodeValue: ye
|
|
73987
73998
|
});
|
|
73988
73999
|
ke.language === null && (ke.value = ye);
|
|
73989
|
-
var Ie = ke.value.length + w,
|
|
74000
|
+
var Ie = ke.value.length + w, qe = jLe(ke, D, q, g, k, w, Ie, x, C);
|
|
73990
74001
|
return /* @__PURE__ */ tr.createElement(W, se, /* @__PURE__ */ tr.createElement(H, p, !k && K, Y({
|
|
73991
|
-
rows:
|
|
74002
|
+
rows: qe,
|
|
73992
74003
|
stylesheet: s,
|
|
73993
74004
|
useInlineStyles: m
|
|
73994
74005
|
})));
|
|
@@ -74187,7 +74198,7 @@ var bDe = ei, kDe = s7, vDe = bDe({
|
|
|
74187
74198
|
function xDe(e, t) {
|
|
74188
74199
|
return t === "role" ? t : "aria-" + t.slice(4).toLowerCase();
|
|
74189
74200
|
}
|
|
74190
|
-
var ca = Dn, EDe = ei, MDe = s7, $e = ca.boolean, SDe = ca.overloadedBoolean, fa = ca.booleanish,
|
|
74201
|
+
var ca = Dn, EDe = ei, MDe = s7, $e = ca.boolean, SDe = ca.overloadedBoolean, fa = ca.booleanish, it = ca.number, Dt = ca.spaceSeparated, Ai = ca.commaSeparated, NDe = EDe({
|
|
74191
74202
|
space: "html",
|
|
74192
74203
|
attributes: {
|
|
74193
74204
|
acceptcharset: "accept-charset",
|
|
@@ -74220,13 +74231,13 @@ var ca = Dn, EDe = ei, MDe = s7, $e = ca.boolean, SDe = ca.overloadedBoolean, fa
|
|
|
74220
74231
|
checked: $e,
|
|
74221
74232
|
cite: null,
|
|
74222
74233
|
className: Dt,
|
|
74223
|
-
cols:
|
|
74234
|
+
cols: it,
|
|
74224
74235
|
colSpan: null,
|
|
74225
74236
|
content: null,
|
|
74226
74237
|
contentEditable: fa,
|
|
74227
74238
|
controls: $e,
|
|
74228
74239
|
controlsList: Dt,
|
|
74229
|
-
coords:
|
|
74240
|
+
coords: it | Ai,
|
|
74230
74241
|
crossOrigin: null,
|
|
74231
74242
|
data: null,
|
|
74232
74243
|
dateTime: null,
|
|
@@ -74247,9 +74258,9 @@ var ca = Dn, EDe = ei, MDe = s7, $e = ca.boolean, SDe = ca.overloadedBoolean, fa
|
|
|
74247
74258
|
formNoValidate: $e,
|
|
74248
74259
|
formTarget: null,
|
|
74249
74260
|
headers: Dt,
|
|
74250
|
-
height:
|
|
74261
|
+
height: it,
|
|
74251
74262
|
hidden: $e,
|
|
74252
|
-
high:
|
|
74263
|
+
high: it,
|
|
74253
74264
|
href: null,
|
|
74254
74265
|
hrefLang: null,
|
|
74255
74266
|
htmlFor: Dt,
|
|
@@ -74273,14 +74284,14 @@ var ca = Dn, EDe = ei, MDe = s7, $e = ca.boolean, SDe = ca.overloadedBoolean, fa
|
|
|
74273
74284
|
list: null,
|
|
74274
74285
|
loading: null,
|
|
74275
74286
|
loop: $e,
|
|
74276
|
-
low:
|
|
74287
|
+
low: it,
|
|
74277
74288
|
manifest: null,
|
|
74278
74289
|
max: null,
|
|
74279
|
-
maxLength:
|
|
74290
|
+
maxLength: it,
|
|
74280
74291
|
media: null,
|
|
74281
74292
|
method: null,
|
|
74282
74293
|
min: null,
|
|
74283
|
-
minLength:
|
|
74294
|
+
minLength: it,
|
|
74284
74295
|
multiple: $e,
|
|
74285
74296
|
muted: $e,
|
|
74286
74297
|
name: null,
|
|
@@ -74371,7 +74382,7 @@ var ca = Dn, EDe = ei, MDe = s7, $e = ca.boolean, SDe = ca.overloadedBoolean, fa
|
|
|
74371
74382
|
onWaiting: null,
|
|
74372
74383
|
onWheel: null,
|
|
74373
74384
|
open: $e,
|
|
74374
|
-
optimum:
|
|
74385
|
+
optimum: it,
|
|
74375
74386
|
pattern: null,
|
|
74376
74387
|
ping: Dt,
|
|
74377
74388
|
placeholder: null,
|
|
@@ -74383,27 +74394,27 @@ var ca = Dn, EDe = ei, MDe = s7, $e = ca.boolean, SDe = ca.overloadedBoolean, fa
|
|
|
74383
74394
|
rel: Dt,
|
|
74384
74395
|
required: $e,
|
|
74385
74396
|
reversed: $e,
|
|
74386
|
-
rows:
|
|
74387
|
-
rowSpan:
|
|
74397
|
+
rows: it,
|
|
74398
|
+
rowSpan: it,
|
|
74388
74399
|
sandbox: Dt,
|
|
74389
74400
|
scope: null,
|
|
74390
74401
|
scoped: $e,
|
|
74391
74402
|
seamless: $e,
|
|
74392
74403
|
selected: $e,
|
|
74393
74404
|
shape: null,
|
|
74394
|
-
size:
|
|
74405
|
+
size: it,
|
|
74395
74406
|
sizes: null,
|
|
74396
74407
|
slot: null,
|
|
74397
|
-
span:
|
|
74408
|
+
span: it,
|
|
74398
74409
|
spellCheck: fa,
|
|
74399
74410
|
src: null,
|
|
74400
74411
|
srcDoc: null,
|
|
74401
74412
|
srcLang: null,
|
|
74402
74413
|
srcSet: Ai,
|
|
74403
|
-
start:
|
|
74414
|
+
start: it,
|
|
74404
74415
|
step: null,
|
|
74405
74416
|
style: null,
|
|
74406
|
-
tabIndex:
|
|
74417
|
+
tabIndex: it,
|
|
74407
74418
|
target: null,
|
|
74408
74419
|
title: null,
|
|
74409
74420
|
translate: null,
|
|
@@ -74411,7 +74422,7 @@ var ca = Dn, EDe = ei, MDe = s7, $e = ca.boolean, SDe = ca.overloadedBoolean, fa
|
|
|
74411
74422
|
typeMustMatch: $e,
|
|
74412
74423
|
useMap: null,
|
|
74413
74424
|
value: fa,
|
|
74414
|
-
width:
|
|
74425
|
+
width: it,
|
|
74415
74426
|
wrap: null,
|
|
74416
74427
|
// Legacy.
|
|
74417
74428
|
// See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis
|
|
@@ -74427,11 +74438,11 @@ var ca = Dn, EDe = ei, MDe = s7, $e = ca.boolean, SDe = ca.overloadedBoolean, fa
|
|
|
74427
74438
|
// `<body>`. Use CSS `background-image` instead
|
|
74428
74439
|
bgColor: null,
|
|
74429
74440
|
// `<body>` and table elements. Use CSS `background-color` instead
|
|
74430
|
-
border:
|
|
74441
|
+
border: it,
|
|
74431
74442
|
// `<table>`. Use CSS `border-width` instead,
|
|
74432
74443
|
borderColor: null,
|
|
74433
74444
|
// `<table>`. Use CSS `border-color` instead,
|
|
74434
|
-
bottomMargin:
|
|
74445
|
+
bottomMargin: it,
|
|
74435
74446
|
// `<body>`
|
|
74436
74447
|
cellPadding: null,
|
|
74437
74448
|
// `<table>`
|
|
@@ -74465,9 +74476,9 @@ var ca = Dn, EDe = ei, MDe = s7, $e = ca.boolean, SDe = ca.overloadedBoolean, fa
|
|
|
74465
74476
|
// `<table>`
|
|
74466
74477
|
frameBorder: null,
|
|
74467
74478
|
// `<iframe>`. Use CSS `border` instead
|
|
74468
|
-
hSpace:
|
|
74479
|
+
hSpace: it,
|
|
74469
74480
|
// `<img>` and `<object>`
|
|
74470
|
-
leftMargin:
|
|
74481
|
+
leftMargin: it,
|
|
74471
74482
|
// `<body>`
|
|
74472
74483
|
link: null,
|
|
74473
74484
|
// `<body>`. Use CSS `a:link {color: *}` instead
|
|
@@ -74475,9 +74486,9 @@ var ca = Dn, EDe = ei, MDe = s7, $e = ca.boolean, SDe = ca.overloadedBoolean, fa
|
|
|
74475
74486
|
// `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`
|
|
74476
74487
|
lowSrc: null,
|
|
74477
74488
|
// `<img>`. Use a `<picture>`
|
|
74478
|
-
marginHeight:
|
|
74489
|
+
marginHeight: it,
|
|
74479
74490
|
// `<body>`
|
|
74480
|
-
marginWidth:
|
|
74491
|
+
marginWidth: it,
|
|
74481
74492
|
// `<body>`
|
|
74482
74493
|
noResize: $e,
|
|
74483
74494
|
// `<frame>`
|
|
@@ -74495,7 +74506,7 @@ var ca = Dn, EDe = ei, MDe = s7, $e = ca.boolean, SDe = ca.overloadedBoolean, fa
|
|
|
74495
74506
|
// `<isindex>`
|
|
74496
74507
|
rev: null,
|
|
74497
74508
|
// `<link>`
|
|
74498
|
-
rightMargin:
|
|
74509
|
+
rightMargin: it,
|
|
74499
74510
|
// `<body>`
|
|
74500
74511
|
rules: null,
|
|
74501
74512
|
// `<table>`
|
|
@@ -74509,7 +74520,7 @@ var ca = Dn, EDe = ei, MDe = s7, $e = ca.boolean, SDe = ca.overloadedBoolean, fa
|
|
|
74509
74520
|
// `<table>`
|
|
74510
74521
|
text: null,
|
|
74511
74522
|
// `<body>`. Use CSS `color` instead
|
|
74512
|
-
topMargin:
|
|
74523
|
+
topMargin: it,
|
|
74513
74524
|
// `<body>`
|
|
74514
74525
|
valueType: null,
|
|
74515
74526
|
// `<param>`
|
|
@@ -74519,7 +74530,7 @@ var ca = Dn, EDe = ei, MDe = s7, $e = ca.boolean, SDe = ca.overloadedBoolean, fa
|
|
|
74519
74530
|
// Several. Use CSS `vertical-align` instead
|
|
74520
74531
|
vLink: null,
|
|
74521
74532
|
// `<body>`. Use CSS `a:visited {color}` instead
|
|
74522
|
-
vSpace:
|
|
74533
|
+
vSpace: it,
|
|
74523
74534
|
// `<img>` and `<object>`
|
|
74524
74535
|
// Non-standard Properties.
|
|
74525
74536
|
allowTransparency: null,
|
|
@@ -74529,7 +74540,7 @@ var ca = Dn, EDe = ei, MDe = s7, $e = ca.boolean, SDe = ca.overloadedBoolean, fa
|
|
|
74529
74540
|
disableRemotePlayback: $e,
|
|
74530
74541
|
prefix: null,
|
|
74531
74542
|
property: null,
|
|
74532
|
-
results:
|
|
74543
|
+
results: it,
|
|
74533
74544
|
security: null,
|
|
74534
74545
|
unselectable: null
|
|
74535
74546
|
}
|
|
@@ -75528,12 +75539,12 @@ var k7 = { exports: {} };
|
|
|
75528
75539
|
K--, N = b.slice(V, se), J.index -= V;
|
|
75529
75540
|
} else if (J = u(j, 0, N, Z), !J)
|
|
75530
75541
|
continue;
|
|
75531
|
-
var ke = J.index, Ie = J[0],
|
|
75542
|
+
var ke = J.index, Ie = J[0], qe = N.slice(0, ke), Je = N.slice(ke + Ie.length), Xe = V + N.length;
|
|
75532
75543
|
D && Xe > D.reach && (D.reach = Xe);
|
|
75533
|
-
var
|
|
75534
|
-
|
|
75544
|
+
var ct = z.prev;
|
|
75545
|
+
qe && (ct = h(w, ct, qe), V += qe.length), m(w, ct, K);
|
|
75535
75546
|
var xt = new l(P, Y ? s.tokenize(Ie, Y) : Ie, R, Ie);
|
|
75536
|
-
if (z = h(w,
|
|
75547
|
+
if (z = h(w, ct, xt), Je && h(w, z, Je), K > 1) {
|
|
75537
75548
|
var et = {
|
|
75538
75549
|
cause: P + "," + I,
|
|
75539
75550
|
reach: Xe
|
|
@@ -96894,7 +96905,7 @@ const oVe = {
|
|
|
96894
96905
|
);
|
|
96895
96906
|
C7.displayName = "CodeContent";
|
|
96896
96907
|
const R7 = ft(({ lang: e = "text", codeChildren: t, allowExecution: n = !1 }) => {
|
|
96897
|
-
const { colorMode: r } = T7e(), a = ap(t).replace(/\n$/, ""), i = r === "light" ? eVe : JHe, { truncated: o, isTruncated: s, totalLines: l } =
|
|
96908
|
+
const { colorMode: r } = T7e(), a = ap(t).replace(/\n$/, ""), i = r === "light" ? eVe : JHe, { truncated: o, isTruncated: s, totalLines: l } = ot(() => iVe(a), [a]), [u, d] = Ze(!1), p = Ge(() => d((f) => !f), []), h = u ? a : o, m = ot(() => aVe(h), [h]);
|
|
96898
96909
|
return /* @__PURE__ */ re("div", { className: "mp-agent-code-block-wrapper", children: [
|
|
96899
96910
|
/* @__PURE__ */ re("div", { className: "mp-agent-code-block-header", children: [
|
|
96900
96911
|
/* @__PURE__ */ T("span", { className: "mp-agent-code-block-language", children: e }),
|
|
@@ -97008,7 +97019,7 @@ const gVe = ({ content: e, role: t }) => {
|
|
|
97008
97019
|
);
|
|
97009
97020
|
}, e2 = ft(({ reasoning: e, isStreaming: t }) => {
|
|
97010
97021
|
const [n, r] = Ze(!0), a = Ve(null);
|
|
97011
|
-
return
|
|
97022
|
+
return Fe(() => {
|
|
97012
97023
|
if (n)
|
|
97013
97024
|
return;
|
|
97014
97025
|
const o = a.current;
|
|
@@ -97096,7 +97107,7 @@ const O7 = () => /* @__PURE__ */ re("span", { className: "mp-agent-message-typin
|
|
|
97096
97107
|
isStreaming: n,
|
|
97097
97108
|
showParticipantChrome: r = !1
|
|
97098
97109
|
}) => {
|
|
97099
|
-
const i =
|
|
97110
|
+
const i = Pe().config.features?.reasoning !== !1, o = r && !!(e.sender || e.agentName), s = e.role === We.User, l = e.role === We.Assistant && (e.parts?.length ?? 0) > 0 ? /* @__PURE__ */ T(
|
|
97100
97111
|
kVe,
|
|
97101
97112
|
{
|
|
97102
97113
|
message: e,
|
|
@@ -97129,8 +97140,8 @@ const O7 = () => /* @__PURE__ */ re("span", { className: "mp-agent-message-typin
|
|
|
97129
97140
|
return t ? e.chatState[t]?.messages ?? A5 : A5;
|
|
97130
97141
|
}, EVe = ({ showParticipantChrome: e = !1 }) => {
|
|
97131
97142
|
const t = fn(), n = fe((S) => S.contextKey), r = fe((S) => S.draftChatKey), a = fe((S) => S.activeChatId), i = fe(xVe), o = a ?? r, s = T3(a), l = fe(
|
|
97132
|
-
(S) =>
|
|
97133
|
-
), u = fe((S) =>
|
|
97143
|
+
(S) => Oe(S, o).pendingAssistant?.content?.length
|
|
97144
|
+
), u = fe((S) => Oe(S, o).pendingAssistant?.id), d = fe((S) => Oe(S, o).status), p = d === yt.Sending || d === yt.Streaming, h = Ve(null), m = Ve(!0), f = Ve(!1), g = Ve(!1), _ = Ve(null), k = kwe({
|
|
97134
97145
|
count: i.length,
|
|
97135
97146
|
getScrollElement: () => h.current,
|
|
97136
97147
|
estimateSize: () => wVe,
|
|
@@ -97141,7 +97152,7 @@ const O7 = () => /* @__PURE__ */ re("span", { className: "mp-agent-message-typin
|
|
|
97141
97152
|
const S = h.current;
|
|
97142
97153
|
S && (S.scrollTop = S.scrollHeight);
|
|
97143
97154
|
}, []);
|
|
97144
|
-
|
|
97155
|
+
Fe(() => {
|
|
97145
97156
|
if (i.length !== 0) {
|
|
97146
97157
|
if (!f.current) {
|
|
97147
97158
|
f.current = !0, g.current = !0, k.scrollToIndex(i.length - 1, { align: "end" }), requestAnimationFrame(() => {
|
|
@@ -97158,9 +97169,9 @@ const O7 = () => /* @__PURE__ */ re("span", { className: "mp-agent-message-typin
|
|
|
97158
97169
|
!S || !x || s.isFetchingNextPage || i.length <= S.count || (g.current = !0, S.wasAtBottom ? x.scrollTop = x.scrollHeight : x.scrollTop = S.scrollTop + (x.scrollHeight - S.scrollHeight), _.current = null, requestAnimationFrame(() => {
|
|
97159
97170
|
g.current = !1;
|
|
97160
97171
|
}));
|
|
97161
|
-
}, [i.length, s.isFetchingNextPage]),
|
|
97172
|
+
}, [i.length, s.isFetchingNextPage]), Fe(() => {
|
|
97162
97173
|
p && m.current && w();
|
|
97163
|
-
}, [l, p, w]),
|
|
97174
|
+
}, [l, p, w]), Fe(() => {
|
|
97164
97175
|
const S = h.current;
|
|
97165
97176
|
if (!S)
|
|
97166
97177
|
return;
|
|
@@ -97173,7 +97184,7 @@ const O7 = () => /* @__PURE__ */ re("span", { className: "mp-agent-message-typin
|
|
|
97173
97184
|
return S.addEventListener("scroll", x, { passive: !0 }), () => S.removeEventListener("scroll", x);
|
|
97174
97185
|
}, []);
|
|
97175
97186
|
const E = b[0]?.index ?? Number.POSITIVE_INFINITY;
|
|
97176
|
-
return
|
|
97187
|
+
return Fe(() => {
|
|
97177
97188
|
if (!s.hasNextPage || s.isFetchingNextPage || E > 1)
|
|
97178
97189
|
return;
|
|
97179
97190
|
const S = h.current;
|
|
@@ -97224,7 +97235,7 @@ const O7 = () => /* @__PURE__ */ re("span", { className: "mp-agent-message-typin
|
|
|
97224
97235
|
contextKey: t,
|
|
97225
97236
|
showParticipantChrome: n
|
|
97226
97237
|
}) => {
|
|
97227
|
-
const r = fe((s) =>
|
|
97238
|
+
const r = fe((s) => Oe(s, e)), a = r.pendingAssistant, i = r.status;
|
|
97228
97239
|
if (!a)
|
|
97229
97240
|
return null;
|
|
97230
97241
|
const o = i === yt.Sending || i === yt.Streaming;
|
|
@@ -97266,11 +97277,11 @@ const NVe = ({ status: e, generating: t }) => {
|
|
|
97266
97277
|
return /* @__PURE__ */ T(D5, { size: 13, className: "mp-agent-plan-task-icon" });
|
|
97267
97278
|
}
|
|
97268
97279
|
}, L7 = ft(() => {
|
|
97269
|
-
const t =
|
|
97270
|
-
(h) => n ?
|
|
97280
|
+
const t = Pe().config.planExtractor, n = fe((h) => h.activeChatId), r = fe((h) => n ? Oe(h, n).messages : void 0), a = fe(
|
|
97281
|
+
(h) => n ? Oe(h, n).pendingAssistant : void 0
|
|
97271
97282
|
), i = fe(
|
|
97272
|
-
(h) => n ?
|
|
97273
|
-
), [o, s] = Ze(!1), l =
|
|
97283
|
+
(h) => n ? Oe(h, n).status === yt.Streaming : !1
|
|
97284
|
+
), [o, s] = Ze(!1), l = ot(
|
|
97274
97285
|
() => t && r ? SVe(r, a, t) : void 0,
|
|
97275
97286
|
[t, r, a]
|
|
97276
97287
|
);
|
|
@@ -97319,7 +97330,7 @@ const NVe = ({ status: e, generating: t }) => {
|
|
|
97319
97330
|
});
|
|
97320
97331
|
L7.displayName = "PlanProgressPanel";
|
|
97321
97332
|
const AVe = ({ onClose: e, agentLogo: t }) => {
|
|
97322
|
-
const n = fn(), a =
|
|
97333
|
+
const n = fn(), a = Pe().config.features?.historySidebar !== !1, i = fe((u) => u.isChatHistoryOpen), o = fe((u) => u.setChatHistoryOpen), s = fe((u) => u.setActiveChat), l = () => {
|
|
97323
97334
|
s(void 0);
|
|
97324
97335
|
};
|
|
97325
97336
|
return /* @__PURE__ */ re("div", { className: "mp-agent-agent-controls", children: [
|
|
@@ -97345,11 +97356,11 @@ const AVe = ({ onClose: e, agentLogo: t }) => {
|
|
|
97345
97356
|
isFetchingNextPage: n,
|
|
97346
97357
|
itemRenderer: r
|
|
97347
97358
|
} = {}) => {
|
|
97348
|
-
const a = fn(), { deleteChat: i, isDeleting: o } = f7e(), s = fe((m) => m.chats), l = fe((m) => m.activeChatId), u = fe((m) => m.setActiveChat), d = Ve(null), p = Ve(null), h =
|
|
97359
|
+
const a = fn(), { deleteChat: i, isDeleting: o } = f7e(), s = fe((m) => m.chats), l = fe((m) => m.activeChatId), u = fe((m) => m.setActiveChat), d = Ve(null), p = Ve(null), h = ot(
|
|
97349
97360
|
() => Object.values(s).filter((m) => m.sessionKind !== gd.SUBAGENT).sort((m, f) => m.updatedAt === f.updatedAt ? 0 : m.updatedAt < f.updatedAt ? 1 : -1),
|
|
97350
97361
|
[s]
|
|
97351
97362
|
);
|
|
97352
|
-
return
|
|
97363
|
+
return Fe(() => {
|
|
97353
97364
|
const m = d.current, f = p.current;
|
|
97354
97365
|
if (!m || !f || !e || !t)
|
|
97355
97366
|
return;
|
|
@@ -97412,7 +97423,7 @@ const AVe = ({ onClose: e, agentLogo: t }) => {
|
|
|
97412
97423
|
] })
|
|
97413
97424
|
] });
|
|
97414
97425
|
}, CVe = ({ loadChats: e = !0, multiUser: t = !1 }) => {
|
|
97415
|
-
const n =
|
|
97426
|
+
const n = Pe(), r = fe((o) => o.isChatHistoryOpen), a = n.config.features?.historySidebar !== !1, i = N3({ enabled: e && a, multiUser: t });
|
|
97416
97427
|
return !a || !r ? null : /* @__PURE__ */ T("div", { className: "mp-agent-chat-history-panel", children: /* @__PURE__ */ T(
|
|
97417
97428
|
TVe,
|
|
97418
97429
|
{
|
|
@@ -97433,7 +97444,7 @@ const AVe = ({ onClose: e, agentLogo: t }) => {
|
|
|
97433
97444
|
loadChats: i = !0,
|
|
97434
97445
|
restoreLastActiveChat: o = !0
|
|
97435
97446
|
}) => {
|
|
97436
|
-
const s = fn(), l =
|
|
97447
|
+
const s = fn(), l = Pe(), u = fe((f) => f.activeChatId), d = fe((f) => f.setActiveChat), { isLoading: p } = h7e(), { isLoading: h, error: m } = N3({ enabled: i, multiUser: r });
|
|
97437
97448
|
return mo(() => {
|
|
97438
97449
|
if (!o)
|
|
97439
97450
|
return;
|
|
@@ -97477,7 +97488,7 @@ export {
|
|
|
97477
97488
|
gd as AgentSessionKind,
|
|
97478
97489
|
Yr as AgentStatus,
|
|
97479
97490
|
A7e as AgentThemeProvider,
|
|
97480
|
-
|
|
97491
|
+
rt as AgentToolCallStatus,
|
|
97481
97492
|
s2 as AgentToolType,
|
|
97482
97493
|
OVe as AttachContextButton,
|
|
97483
97494
|
j7 as BuiltinContextAttachmentKinds,
|
|
@@ -97529,7 +97540,7 @@ export {
|
|
|
97529
97540
|
WVe as useActivitySummary,
|
|
97530
97541
|
l7e as useAgentConfigurations,
|
|
97531
97542
|
p7e as useAgentPreferences,
|
|
97532
|
-
|
|
97543
|
+
Pe as useAgentRuntime,
|
|
97533
97544
|
fe as useAgentStore,
|
|
97534
97545
|
T7e as useAgentTheme,
|
|
97535
97546
|
XVe as useAutoScroll,
|