@rpcbase/agents-sdk 0.12.0 → 0.13.0
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/api/chat/handler.d.ts.map +1 -1
- package/dist/api/chat/models.d.ts +2 -2
- package/dist/api/chat/models.d.ts.map +1 -1
- package/dist/api/chat/runtimeConfig.d.ts +68 -0
- package/dist/api/chat/runtimeConfig.d.ts.map +1 -1
- package/dist/api/chat/toolApproval.d.ts +35 -0
- package/dist/api/chat/toolApproval.d.ts.map +1 -0
- package/dist/api/chatDb.d.ts +1 -1
- package/dist/api/chatDb.d.ts.map +1 -1
- package/dist/chat-models.browser.js +1 -1
- package/dist/chat-models.js +1 -1
- package/dist/client-routes.browser.js +2 -2
- package/dist/client-routes.js +2 -2
- package/dist/components/ai-elements/tool.d.ts +6 -2
- package/dist/components/ai-elements/tool.d.ts.map +1 -1
- package/dist/components/message.d.ts.map +1 -1
- package/dist/{data-stream-handler-83PApswO.js → data-stream-handler-Bc_AaWm-.js} +783 -724
- package/dist/{data-stream-handler-Cm6JVGl8.js → data-stream-handler-CF9RENIU.js} +783 -724
- package/dist/{handler-CVs03Ys2.js → handler-Dmt7P8bu.js} +634 -395
- package/dist/{handler-Z-tCrlQ_.js → handler-M3DwIezB.js} +641 -402
- package/dist/index.browser.js +2 -2
- package/dist/index.js +2 -2
- package/dist/lib/ai/models.d.ts +1 -1
- package/dist/lib/ai/models.d.ts.map +1 -1
- package/dist/lib/ai/openai-reasoning.d.ts +2 -2
- package/dist/lib/ai/openai-reasoning.d.ts.map +1 -1
- package/dist/lib/db/schema.d.ts +1 -1
- package/dist/lib/db/schema.d.ts.map +1 -1
- package/dist/models/RBAgentsUsageEvent.d.ts +2 -1
- package/dist/models/RBAgentsUsageEvent.d.ts.map +1 -1
- package/dist/{models-BTzlEPg8.js → models-Bvdwv_p7.js} +14 -8
- package/dist/models.browser.js +5 -1
- package/dist/models.js +5 -1
- package/dist/openai-reasoning-CmTuRHwM.js +26 -0
- package/dist/routes.browser.js +1 -1
- package/dist/routes.js +1 -1
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +1 -1
- package/dist/tailwind-source.js +1 -1
- package/package.json +1 -1
- package/dist/openai-reasoning-BCA05blq.js +0 -19
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { l as e, o as t, r as n, s as r, u as i } from "./chunk-BO2N2NFS-BXeXbvYU.js";
|
|
2
2
|
import { i as a, n as o, r as s, s as c, t as l } from "./message-visibility-zTseZa3P.js";
|
|
3
|
-
import { a as u, i as d, r as f, s as p } from "./models-
|
|
4
|
-
import { a as m, i as h, n as g, r as _, t as v } from "./openai-reasoning-
|
|
3
|
+
import { a as u, i as d, r as f, s as p } from "./models-Bvdwv_p7.js";
|
|
4
|
+
import { a as m, i as h, n as g, r as _, t as v } from "./openai-reasoning-CmTuRHwM.js";
|
|
5
5
|
import * as y from "react";
|
|
6
6
|
import b, { Children as x, Component as S, Fragment as C, createContext as w, createElement as T, forwardRef as E, isValidElement as D, memo as O, useCallback as k, useContext as A, useEffect as j, useEffectEvent as M, useId as N, useImperativeHandle as P, useInsertionEffect as F, useLayoutEffect as I, useMemo as L, useRef as R, useState as z, useSyncExternalStore as ee, useSyncExternalStore as te } from "react";
|
|
7
7
|
import { Link as ne, Outlet as re, useLocation as ie, useNavigate as B, useRevalidator as ae, useRouteLoaderData as oe, useSearchParams as se } from "@rpcbase/router";
|
|
@@ -54944,7 +54944,7 @@ function NR(e, t = !0) {
|
|
|
54944
54944
|
//#endregion
|
|
54945
54945
|
//#region src/components/artifact-actions.tsx
|
|
54946
54946
|
function PR({ artifact: e, handleVersionChange: t, currentVersionIndex: n, isCurrentVersion: r, mode: i, metadata: a, setMetadata: o }) {
|
|
54947
|
-
let [s, c] = z(!1), l =
|
|
54947
|
+
let [s, c] = z(!1), l = mW.find((t) => t.kind === e.kind);
|
|
54948
54948
|
if (!l) throw Error("Artifact definition not found!");
|
|
54949
54949
|
let u = {
|
|
54950
54950
|
content: e.content,
|
|
@@ -55569,32 +55569,32 @@ var hz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
55569
55569
|
"output-available": /* @__PURE__ */ V(mh, { className: "size-4 text-foreground" }),
|
|
55570
55570
|
"output-denied": /* @__PURE__ */ V(hh, { className: "size-4 text-muted-foreground" }),
|
|
55571
55571
|
"output-error": /* @__PURE__ */ V(hh, { className: "size-4 text-destructive" })
|
|
55572
|
-
}, yz = (e) => /* @__PURE__ */ H(VR, {
|
|
55572
|
+
}, yz = (e, t) => t?.isAutomatic && t.approved === !0 ? "Auto-approved" : e === "approval-responded" && t?.approved === !0 ? "Approved" : _z[e], bz = (e, t) => /* @__PURE__ */ H(VR, {
|
|
55573
55573
|
className: "gap-1.5 rounded-full text-xs",
|
|
55574
55574
|
variant: "secondary",
|
|
55575
|
-
children: [vz[e],
|
|
55576
|
-
}),
|
|
55577
|
-
let
|
|
55575
|
+
children: [vz[e], yz(e, t)]
|
|
55576
|
+
}), xz = ({ className: e, title: t, type: n, state: r, toolName: i, approval: a, ...o }) => {
|
|
55577
|
+
let s = n === "dynamic-tool" ? i : n.split("-").slice(1).join("-");
|
|
55578
55578
|
return /* @__PURE__ */ H(uz, {
|
|
55579
55579
|
className: U("flex w-full items-center justify-between gap-4 p-3", e),
|
|
55580
|
-
...
|
|
55580
|
+
...o,
|
|
55581
55581
|
children: [/* @__PURE__ */ H("div", {
|
|
55582
55582
|
className: "flex items-center gap-2",
|
|
55583
55583
|
children: [
|
|
55584
55584
|
/* @__PURE__ */ V(Th, { className: "size-4 text-muted-foreground" }),
|
|
55585
55585
|
/* @__PURE__ */ V("span", {
|
|
55586
55586
|
className: "font-medium text-sm",
|
|
55587
|
-
children: t ??
|
|
55587
|
+
children: t ?? s
|
|
55588
55588
|
}),
|
|
55589
|
-
|
|
55589
|
+
bz(r, a)
|
|
55590
55590
|
]
|
|
55591
55591
|
}), /* @__PURE__ */ V(dh, { className: "size-4 text-muted-foreground group-data-open:rotate-180" })]
|
|
55592
55592
|
});
|
|
55593
|
-
},
|
|
55593
|
+
}, Sz = ({ className: e, ...t }) => /* @__PURE__ */ V(dz, {
|
|
55594
55594
|
className: U("space-y-4 p-4 text-popover-foreground outline-none", e),
|
|
55595
55595
|
...t
|
|
55596
|
-
}),
|
|
55597
|
-
let [r, i] = z(!1), a = JSON.stringify(t, null, 2) ?? String(t), o = a.split("\n").length >
|
|
55596
|
+
}), Cz = 5, wz = ({ className: e, input: t, ...n }) => {
|
|
55597
|
+
let [r, i] = z(!1), a = JSON.stringify(t, null, 2) ?? String(t), o = a.split("\n").length > Cz && !r;
|
|
55598
55598
|
return /* @__PURE__ */ H("div", {
|
|
55599
55599
|
className: U("space-y-2 overflow-hidden", e),
|
|
55600
55600
|
...n,
|
|
@@ -55618,7 +55618,7 @@ var hz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
55618
55618
|
})] })]
|
|
55619
55619
|
})]
|
|
55620
55620
|
});
|
|
55621
|
-
},
|
|
55621
|
+
}, Tz = ({ className: e, output: t, errorText: n, ...r }) => {
|
|
55622
55622
|
if (!(t || n)) return null;
|
|
55623
55623
|
let i = /* @__PURE__ */ V("div", { children: t });
|
|
55624
55624
|
return typeof t == "object" && !D(t) ? i = /* @__PURE__ */ V(hz, {
|
|
@@ -55638,7 +55638,7 @@ var hz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
55638
55638
|
children: [n && /* @__PURE__ */ V("div", { children: n }), i]
|
|
55639
55639
|
})]
|
|
55640
55640
|
});
|
|
55641
|
-
},
|
|
55641
|
+
}, Ez = (e, t) => {
|
|
55642
55642
|
switch (e) {
|
|
55643
55643
|
case "create": return t === "present" ? "Creating" : "Created";
|
|
55644
55644
|
case "update": return t === "present" ? "Updating" : "Updated";
|
|
@@ -55646,7 +55646,7 @@ var hz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
55646
55646
|
default: return null;
|
|
55647
55647
|
}
|
|
55648
55648
|
};
|
|
55649
|
-
function
|
|
55649
|
+
function Dz({ type: e, result: t, isReadonly: n }) {
|
|
55650
55650
|
let { setArtifact: r } = ES();
|
|
55651
55651
|
return /* @__PURE__ */ H("button", {
|
|
55652
55652
|
className: "flex w-fit cursor-pointer flex-row items-center gap-2 rounded-xl border bg-background px-3 py-2",
|
|
@@ -55677,12 +55677,12 @@ function Ez({ type: e, result: t, isReadonly: n }) {
|
|
|
55677
55677
|
children: e === "create" ? /* @__PURE__ */ V(st, {}) : e === "update" ? /* @__PURE__ */ V(lt, {}) : e === "request-suggestions" ? /* @__PURE__ */ V(mt, {}) : null
|
|
55678
55678
|
}), /* @__PURE__ */ V("div", {
|
|
55679
55679
|
className: "text-left",
|
|
55680
|
-
children: `${
|
|
55680
|
+
children: `${Ez(e, "past")} "${t.title}"`
|
|
55681
55681
|
})]
|
|
55682
55682
|
});
|
|
55683
55683
|
}
|
|
55684
|
-
var
|
|
55685
|
-
function
|
|
55684
|
+
var Oz = O(Dz, () => !0);
|
|
55685
|
+
function kz({ type: e, args: t, isReadonly: n }) {
|
|
55686
55686
|
let { setArtifact: r } = ES();
|
|
55687
55687
|
return /* @__PURE__ */ H("button", {
|
|
55688
55688
|
className: "flex w-fit cursor-pointer flex-row items-start justify-between gap-3 rounded-xl border px-3 py-2",
|
|
@@ -55711,7 +55711,7 @@ function Oz({ type: e, args: t, isReadonly: n }) {
|
|
|
55711
55711
|
children: e === "create" ? /* @__PURE__ */ V(st, {}) : e === "update" ? /* @__PURE__ */ V(lt, {}) : e === "request-suggestions" ? /* @__PURE__ */ V(mt, {}) : null
|
|
55712
55712
|
}), /* @__PURE__ */ V("div", {
|
|
55713
55713
|
className: "text-left",
|
|
55714
|
-
children: `${
|
|
55714
|
+
children: `${Ez(e, "present")} ${e === "create" && "title" in t && t.title ? `"${t.title}"` : e === "update" && "description" in t ? `"${t.description}"` : e === "request-suggestions" ? "for document" : ""}`
|
|
55715
55715
|
})]
|
|
55716
55716
|
}), /* @__PURE__ */ V("div", {
|
|
55717
55717
|
className: "mt-1 animate-spin",
|
|
@@ -55719,10 +55719,10 @@ function Oz({ type: e, args: t, isReadonly: n }) {
|
|
|
55719
55719
|
})]
|
|
55720
55720
|
});
|
|
55721
55721
|
}
|
|
55722
|
-
O(
|
|
55722
|
+
O(kz, () => !0);
|
|
55723
55723
|
//#endregion
|
|
55724
55724
|
//#region src/components/document-preview.tsx
|
|
55725
|
-
function
|
|
55725
|
+
function Az({ isReadonly: e, result: t, args: n }) {
|
|
55726
55726
|
let { artifact: r, setArtifact: i } = ES(), { data: a, isLoading: o } = NR(t?.id ?? "", !!t?.id), s = L(() => a?.[0], [a]), c = R(null);
|
|
55727
55727
|
if (j(() => {
|
|
55728
55728
|
let e = c.current?.getBoundingClientRect();
|
|
@@ -55739,7 +55739,7 @@ function kz({ isReadonly: e, result: t, args: n }) {
|
|
|
55739
55739
|
let e = t?.kind ?? n?.kind ?? r.kind, i = t?.title ?? n?.title ?? r.title;
|
|
55740
55740
|
return /* @__PURE__ */ H("div", {
|
|
55741
55741
|
className: "w-full max-w-[450px]",
|
|
55742
|
-
children: [i ? /* @__PURE__ */ V(
|
|
55742
|
+
children: [i ? /* @__PURE__ */ V(Nz, {
|
|
55743
55743
|
isStreaming: !0,
|
|
55744
55744
|
kind: e,
|
|
55745
55745
|
title: i
|
|
@@ -55766,21 +55766,21 @@ function kz({ isReadonly: e, result: t, args: n }) {
|
|
|
55766
55766
|
return l ? /* @__PURE__ */ H("div", {
|
|
55767
55767
|
className: "relative w-full max-w-[450px] cursor-pointer",
|
|
55768
55768
|
children: [
|
|
55769
|
-
/* @__PURE__ */ V(
|
|
55769
|
+
/* @__PURE__ */ V(Mz, {
|
|
55770
55770
|
hitboxRef: c,
|
|
55771
55771
|
result: t,
|
|
55772
55772
|
setArtifact: i
|
|
55773
55773
|
}),
|
|
55774
|
-
/* @__PURE__ */ V(
|
|
55774
|
+
/* @__PURE__ */ V(Nz, {
|
|
55775
55775
|
isStreaming: r.status === "streaming",
|
|
55776
55776
|
kind: l.kind,
|
|
55777
55777
|
title: l.title
|
|
55778
55778
|
}),
|
|
55779
|
-
/* @__PURE__ */ V(
|
|
55779
|
+
/* @__PURE__ */ V(Pz, { document: l })
|
|
55780
55780
|
]
|
|
55781
|
-
}) : /* @__PURE__ */ V(
|
|
55781
|
+
}) : /* @__PURE__ */ V(jz, { artifactKind: r.kind });
|
|
55782
55782
|
}
|
|
55783
|
-
var
|
|
55783
|
+
var jz = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
|
|
55784
55784
|
className: "w-full max-w-[450px]",
|
|
55785
55785
|
children: [/* @__PURE__ */ H("div", {
|
|
55786
55786
|
className: "flex flex-row items-center justify-between gap-2 rounded-t-2xl border border-b-0 border-border/50 px-4 py-3 dark:bg-muted",
|
|
@@ -55795,7 +55795,7 @@ var Az = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
|
|
|
55795
55795
|
className: "h-[257px] overflow-hidden rounded-b-2xl border border-t-0 border-border/50 bg-muted p-6",
|
|
55796
55796
|
children: /* @__PURE__ */ V(cR, {})
|
|
55797
55797
|
})]
|
|
55798
|
-
}),
|
|
55798
|
+
}), Mz = O(({ hitboxRef: e, result: t, setArtifact: n }) => {
|
|
55799
55799
|
let r = k((e) => {
|
|
55800
55800
|
let r = e.currentTarget.getBoundingClientRect();
|
|
55801
55801
|
n((e) => ({
|
|
@@ -55826,7 +55826,7 @@ var Az = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
|
|
|
55826
55826
|
})
|
|
55827
55827
|
})
|
|
55828
55828
|
});
|
|
55829
|
-
}, (e, t) => !!ve(e.result, t.result)),
|
|
55829
|
+
}, (e, t) => !!ve(e.result, t.result)), Nz = O(({ title: e, kind: t, isStreaming: n }) => /* @__PURE__ */ H("div", {
|
|
55830
55830
|
className: "flex flex-row items-center justify-between gap-2 rounded-t-2xl border border-b-0 border-border/50 px-4 py-3 dark:bg-muted",
|
|
55831
55831
|
children: [/* @__PURE__ */ H("div", {
|
|
55832
55832
|
className: "flex flex-row items-center gap-2.5",
|
|
@@ -55841,7 +55841,7 @@ var Az = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
|
|
|
55841
55841
|
children: e
|
|
55842
55842
|
})]
|
|
55843
55843
|
}), /* @__PURE__ */ V("div", { className: "w-8" })]
|
|
55844
|
-
}), (e, t) => !(e.title !== t.title || e.isStreaming !== t.isStreaming)),
|
|
55844
|
+
}), (e, t) => !(e.title !== t.title || e.isStreaming !== t.isStreaming)), Pz = ({ document: e }) => {
|
|
55845
55845
|
let { artifact: t } = ES(), n = U("h-[257px] overflow-hidden rounded-b-2xl border border-t-0 border-border/50 dark:bg-muted", {
|
|
55846
55846
|
"p-4 sm:px-10 sm:py-10": e.kind === "text",
|
|
55847
55847
|
"p-0": e.kind === "code"
|
|
@@ -55886,16 +55886,16 @@ var Az = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
|
|
|
55886
55886
|
e.kind === "code" && /* @__PURE__ */ V("div", { className: "pointer-events-none absolute inset-y-0 right-0 w-12 bg-gradient-to-l from-muted to-transparent dark:from-muted" })
|
|
55887
55887
|
]
|
|
55888
55888
|
});
|
|
55889
|
-
},
|
|
55890
|
-
process.env.NODE_ENV !== "production" && (
|
|
55891
|
-
function
|
|
55892
|
-
let e = y.useContext(
|
|
55889
|
+
}, Fz = /* @__PURE__ */ y.createContext(void 0);
|
|
55890
|
+
process.env.NODE_ENV !== "production" && (Fz.displayName = "AvatarRootContext");
|
|
55891
|
+
function Iz() {
|
|
55892
|
+
let e = y.useContext(Fz);
|
|
55893
55893
|
if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? fc(13) : "Base UI: AvatarRootContext is missing. Avatar parts must be placed within <Avatar.Root>.");
|
|
55894
55894
|
return e;
|
|
55895
55895
|
}
|
|
55896
55896
|
//#endregion
|
|
55897
55897
|
//#region ../../node_modules/@base-ui/react/avatar/root/stateAttributesMapping.mjs
|
|
55898
|
-
var
|
|
55898
|
+
var Lz = { imageLoadingStatus: () => null }, Rz = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
55899
55899
|
let { className: n, render: r, style: i, ...a } = e, [o, s] = y.useState("idle"), c = { imageLoadingStatus: o }, l = y.useMemo(() => ({
|
|
55900
55900
|
imageLoadingStatus: o,
|
|
55901
55901
|
setImageLoadingStatus: s
|
|
@@ -55903,17 +55903,17 @@ var Iz = { imageLoadingStatus: () => null }, Lz = /* @__PURE__ */ y.forwardRef(f
|
|
|
55903
55903
|
state: c,
|
|
55904
55904
|
ref: t,
|
|
55905
55905
|
props: a,
|
|
55906
|
-
stateAttributesMapping:
|
|
55906
|
+
stateAttributesMapping: Lz
|
|
55907
55907
|
});
|
|
55908
|
-
return /* @__PURE__ */ V(
|
|
55908
|
+
return /* @__PURE__ */ V(Fz.Provider, {
|
|
55909
55909
|
value: l,
|
|
55910
55910
|
children: u
|
|
55911
55911
|
});
|
|
55912
55912
|
});
|
|
55913
|
-
process.env.NODE_ENV !== "production" && (
|
|
55913
|
+
process.env.NODE_ENV !== "production" && (Rz.displayName = "AvatarRoot");
|
|
55914
55914
|
//#endregion
|
|
55915
55915
|
//#region ../../node_modules/@base-ui/react/avatar/image/useImageLoadingStatus.mjs
|
|
55916
|
-
function
|
|
55916
|
+
function zz(e, { referrerPolicy: t, crossOrigin: n, sizes: r, srcSet: i }) {
|
|
55917
55917
|
let [a, o] = y.useState("idle");
|
|
55918
55918
|
return K(() => {
|
|
55919
55919
|
if (!e && !i) return o("error"), ma;
|
|
@@ -55933,11 +55933,11 @@ function Rz(e, { referrerPolicy: t, crossOrigin: n, sizes: r, srcSet: i }) {
|
|
|
55933
55933
|
}
|
|
55934
55934
|
//#endregion
|
|
55935
55935
|
//#region ../../node_modules/@base-ui/react/avatar/image/AvatarImage.mjs
|
|
55936
|
-
var
|
|
55937
|
-
...
|
|
55936
|
+
var Bz = {
|
|
55937
|
+
...Lz,
|
|
55938
55938
|
...Zd
|
|
55939
|
-
},
|
|
55940
|
-
let { className: n, render: r, onLoadingStatusChange: i, style: a, ...o } = e, { setImageLoadingStatus: s } =
|
|
55939
|
+
}, Vz = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
55940
|
+
let { className: n, render: r, onLoadingStatusChange: i, style: a, ...o } = e, { setImageLoadingStatus: s } = Iz(), c = zz(o.src, o), l = c === "loaded", { mounted: u, transitionStatus: d, setMounted: f } = qd(l), p = y.useRef(null), m = J((e) => {
|
|
55941
55941
|
i?.(e), s(e);
|
|
55942
55942
|
});
|
|
55943
55943
|
K(() => {
|
|
@@ -55956,54 +55956,54 @@ var zz = {
|
|
|
55956
55956
|
},
|
|
55957
55957
|
ref: [t, p],
|
|
55958
55958
|
props: o,
|
|
55959
|
-
stateAttributesMapping:
|
|
55959
|
+
stateAttributesMapping: Bz,
|
|
55960
55960
|
enabled: u
|
|
55961
55961
|
});
|
|
55962
55962
|
return u ? h : null;
|
|
55963
55963
|
});
|
|
55964
|
-
process.env.NODE_ENV !== "production" && (
|
|
55964
|
+
process.env.NODE_ENV !== "production" && (Vz.displayName = "AvatarImage");
|
|
55965
55965
|
//#endregion
|
|
55966
55966
|
//#region ../../node_modules/@base-ui/react/avatar/fallback/AvatarFallback.mjs
|
|
55967
|
-
var
|
|
55968
|
-
let { className: n, render: r, delay: i, style: a, ...o } = e, { imageLoadingStatus: s } =
|
|
55967
|
+
var Hz = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
55968
|
+
let { className: n, render: r, delay: i, style: a, ...o } = e, { imageLoadingStatus: s } = Iz(), [c, l] = y.useState(i === void 0), u = ca();
|
|
55969
55969
|
return y.useEffect(() => (i === void 0 ? l(!0) : u.start(i, () => l(!0)), u.clear), [u, i]), Lc("span", e, {
|
|
55970
55970
|
state: { imageLoadingStatus: s },
|
|
55971
55971
|
ref: t,
|
|
55972
55972
|
props: o,
|
|
55973
|
-
stateAttributesMapping:
|
|
55973
|
+
stateAttributesMapping: Lz,
|
|
55974
55974
|
enabled: s !== "loaded" && (i === void 0 || c)
|
|
55975
55975
|
});
|
|
55976
55976
|
});
|
|
55977
|
-
process.env.NODE_ENV !== "production" && (
|
|
55977
|
+
process.env.NODE_ENV !== "production" && (Hz.displayName = "AvatarFallback");
|
|
55978
55978
|
//#endregion
|
|
55979
55979
|
//#region src/components/ui/avatar.tsx
|
|
55980
|
-
var
|
|
55980
|
+
var Uz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Rz, {
|
|
55981
55981
|
ref: n,
|
|
55982
55982
|
className: U("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", e),
|
|
55983
55983
|
...t
|
|
55984
55984
|
}));
|
|
55985
|
-
|
|
55986
|
-
var
|
|
55985
|
+
Uz.displayName = "Avatar";
|
|
55986
|
+
var Wz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Vz, {
|
|
55987
55987
|
ref: n,
|
|
55988
55988
|
className: U("aspect-square h-full w-full", e),
|
|
55989
55989
|
...t
|
|
55990
55990
|
}));
|
|
55991
|
-
|
|
55992
|
-
var
|
|
55991
|
+
Wz.displayName = "AvatarImage";
|
|
55992
|
+
var Gz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Hz, {
|
|
55993
55993
|
ref: n,
|
|
55994
55994
|
className: U("flex h-full w-full items-center justify-center rounded-full bg-muted", e),
|
|
55995
55995
|
...t
|
|
55996
55996
|
}));
|
|
55997
|
-
|
|
55998
|
-
var
|
|
55997
|
+
Gz.displayName = "AvatarFallback";
|
|
55998
|
+
var Kz = ({ children: e, className: t, ...n }) => /* @__PURE__ */ V("div", {
|
|
55999
55999
|
className: U("flex flex-col gap-2 overflow-hidden rounded-lg px-4 py-3 text-foreground text-sm", "group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground", "group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground", "is-user:dark", t),
|
|
56000
56000
|
...n,
|
|
56001
56001
|
children: e
|
|
56002
|
-
}),
|
|
56002
|
+
}), qz = ({ className: e, children: t, ...n }) => /* @__PURE__ */ V("div", {
|
|
56003
56003
|
className: U("flex items-center gap-1", e),
|
|
56004
56004
|
...n,
|
|
56005
56005
|
children: t
|
|
56006
|
-
}),
|
|
56006
|
+
}), Jz = ({ tooltip: e, children: t, label: n, className: r, variant: i = "ghost", size: a = "sm", ...o }) => {
|
|
56007
56007
|
let s = /* @__PURE__ */ H(Fm, {
|
|
56008
56008
|
className: U("relative size-9 p-1.5 text-muted-foreground hover:text-foreground", r),
|
|
56009
56009
|
size: a,
|
|
@@ -56022,7 +56022,7 @@ var Gz = ({ children: e, className: t, ...n }) => /* @__PURE__ */ V("div", {
|
|
|
56022
56022
|
};
|
|
56023
56023
|
//#endregion
|
|
56024
56024
|
//#region src/components/message-actions.tsx
|
|
56025
|
-
function
|
|
56025
|
+
function Yz({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
|
|
56026
56026
|
let [a, o] = GP(), [s, c] = z();
|
|
56027
56027
|
j(() => {
|
|
56028
56028
|
c(void 0);
|
|
@@ -56036,31 +56036,31 @@ function Jz({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
|
|
|
56036
56036
|
}
|
|
56037
56037
|
await o(u), le.success("Copied to clipboard!");
|
|
56038
56038
|
};
|
|
56039
|
-
return t.role === "user" ? /* @__PURE__ */ V(
|
|
56039
|
+
return t.role === "user" ? /* @__PURE__ */ V(qz, {
|
|
56040
56040
|
className: "-mr-0.5 justify-end",
|
|
56041
56041
|
children: /* @__PURE__ */ H("div", {
|
|
56042
56042
|
className: "relative",
|
|
56043
|
-
children: [i && /* @__PURE__ */ V(
|
|
56043
|
+
children: [i && /* @__PURE__ */ V(Jz, {
|
|
56044
56044
|
className: "-left-10 absolute top-0 opacity-0 transition-opacity focus-visible:opacity-100 group-hover/message:opacity-100",
|
|
56045
56045
|
"data-testid": "message-edit-button",
|
|
56046
56046
|
onClick: () => i("edit"),
|
|
56047
56047
|
tooltip: "Edit",
|
|
56048
56048
|
children: /* @__PURE__ */ V(lt, {})
|
|
56049
|
-
}), /* @__PURE__ */ V(
|
|
56049
|
+
}), /* @__PURE__ */ V(Jz, {
|
|
56050
56050
|
onClick: d,
|
|
56051
56051
|
tooltip: "Copy",
|
|
56052
56052
|
children: /* @__PURE__ */ V(xt, {})
|
|
56053
56053
|
})]
|
|
56054
56054
|
})
|
|
56055
|
-
}) : /* @__PURE__ */ H(
|
|
56055
|
+
}) : /* @__PURE__ */ H(qz, {
|
|
56056
56056
|
className: "-ml-0.5",
|
|
56057
56057
|
children: [
|
|
56058
|
-
/* @__PURE__ */ V(
|
|
56058
|
+
/* @__PURE__ */ V(Jz, {
|
|
56059
56059
|
onClick: d,
|
|
56060
56060
|
tooltip: "Copy",
|
|
56061
56061
|
children: /* @__PURE__ */ V(xt, {})
|
|
56062
56062
|
}),
|
|
56063
|
-
/* @__PURE__ */ V(
|
|
56063
|
+
/* @__PURE__ */ V(Jz, {
|
|
56064
56064
|
"data-testid": "message-upvote",
|
|
56065
56065
|
disabled: l?.isUpvoted,
|
|
56066
56066
|
onClick: () => {
|
|
@@ -56088,7 +56088,7 @@ function Jz({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
|
|
|
56088
56088
|
tooltip: "Upvote Response",
|
|
56089
56089
|
children: /* @__PURE__ */ V(St, {})
|
|
56090
56090
|
}),
|
|
56091
|
-
/* @__PURE__ */ V(
|
|
56091
|
+
/* @__PURE__ */ V(Jz, {
|
|
56092
56092
|
"data-testid": "message-downvote",
|
|
56093
56093
|
disabled: l && !l.isUpvoted,
|
|
56094
56094
|
onClick: () => {
|
|
@@ -56119,15 +56119,15 @@ function Jz({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
|
|
|
56119
56119
|
]
|
|
56120
56120
|
});
|
|
56121
56121
|
}
|
|
56122
|
-
var
|
|
56122
|
+
var Xz = O(Yz, (e, t) => !(!ve(e.vote, t.vote) || e.isLoading !== t.isLoading)), Zz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V("textarea", {
|
|
56123
56123
|
className: U("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", e),
|
|
56124
56124
|
ref: n,
|
|
56125
56125
|
...t
|
|
56126
56126
|
}));
|
|
56127
|
-
|
|
56127
|
+
Zz.displayName = "Textarea";
|
|
56128
56128
|
//#endregion
|
|
56129
56129
|
//#region src/components/message-editor.tsx
|
|
56130
|
-
function
|
|
56130
|
+
function Qz({ message: e, setMode: t, setMessages: n, regenerate: r }) {
|
|
56131
56131
|
let [i, a] = z(!1), [o, s] = z(Nm(e)), c = R(null), l = k(() => {
|
|
56132
56132
|
c.current && (c.current.style.height = "auto", c.current.style.height = `${c.current.scrollHeight + 2}px`);
|
|
56133
56133
|
}, []);
|
|
@@ -56139,7 +56139,7 @@ function Zz({ message: e, setMode: t, setMessages: n, regenerate: r }) {
|
|
|
56139
56139
|
};
|
|
56140
56140
|
return /* @__PURE__ */ H("div", {
|
|
56141
56141
|
className: "flex w-full flex-col gap-2",
|
|
56142
|
-
children: [/* @__PURE__ */ V(
|
|
56142
|
+
children: [/* @__PURE__ */ V(Zz, {
|
|
56143
56143
|
className: "w-full resize-none overflow-hidden rounded-xl bg-transparent text-base! outline-hidden",
|
|
56144
56144
|
"data-testid": "message-editor",
|
|
56145
56145
|
onChange: u,
|
|
@@ -56186,7 +56186,7 @@ function Zz({ message: e, setMode: t, setMessages: n, regenerate: r }) {
|
|
|
56186
56186
|
}
|
|
56187
56187
|
//#endregion
|
|
56188
56188
|
//#region src/hooks/use-controllable-state.ts
|
|
56189
|
-
function
|
|
56189
|
+
function $z({ prop: e, defaultProp: t, onChange: n }) {
|
|
56190
56190
|
let [r, i] = y.useState(t), a = e !== void 0, o = a ? e : r;
|
|
56191
56191
|
return [o, y.useCallback((e) => {
|
|
56192
56192
|
let t = typeof e == "function" ? e(o) : e;
|
|
@@ -56199,26 +56199,26 @@ function Qz({ prop: e, defaultProp: t, onChange: n }) {
|
|
|
56199
56199
|
}
|
|
56200
56200
|
//#endregion
|
|
56201
56201
|
//#region src/components/elements/reasoning.tsx
|
|
56202
|
-
var
|
|
56203
|
-
let e = A(
|
|
56202
|
+
var eB = w(null), tB = () => {
|
|
56203
|
+
let e = A(eB);
|
|
56204
56204
|
if (!e) throw Error("Reasoning components must be used within Reasoning");
|
|
56205
56205
|
return e;
|
|
56206
|
-
},
|
|
56207
|
-
let [c, l] =
|
|
56206
|
+
}, nB = 1e3, rB = O(({ className: e, isStreaming: t = !1, open: n, defaultOpen: r = !0, onOpenChange: i, duration: a, children: o, ...s }) => {
|
|
56207
|
+
let [c, l] = $z({
|
|
56208
56208
|
prop: n,
|
|
56209
56209
|
defaultProp: r,
|
|
56210
56210
|
onChange: i
|
|
56211
|
-
}), [u, d] =
|
|
56211
|
+
}), [u, d] = $z({
|
|
56212
56212
|
prop: a,
|
|
56213
56213
|
defaultProp: void 0
|
|
56214
56214
|
}), [f, p] = z(null);
|
|
56215
56215
|
return j(() => {
|
|
56216
|
-
t ? f === null && p(Date.now()) : f !== null && (d(Math.ceil((Date.now() - f) /
|
|
56216
|
+
t ? f === null && p(Date.now()) : f !== null && (d(Math.ceil((Date.now() - f) / nB)), p(null));
|
|
56217
56217
|
}, [
|
|
56218
56218
|
t,
|
|
56219
56219
|
f,
|
|
56220
56220
|
d
|
|
56221
|
-
]), /* @__PURE__ */ V(
|
|
56221
|
+
]), /* @__PURE__ */ V(eB.Provider, {
|
|
56222
56222
|
value: {
|
|
56223
56223
|
isStreaming: t,
|
|
56224
56224
|
isOpen: c,
|
|
@@ -56235,8 +56235,8 @@ var $z = w(null), eB = () => {
|
|
|
56235
56235
|
children: o
|
|
56236
56236
|
})
|
|
56237
56237
|
});
|
|
56238
|
-
}),
|
|
56239
|
-
let { isStreaming: r, isOpen: i, duration: a } =
|
|
56238
|
+
}), iB = O(({ className: e, children: t, ...n }) => {
|
|
56239
|
+
let { isStreaming: r, isOpen: i, duration: a } = tB();
|
|
56240
56240
|
return /* @__PURE__ */ V(uz, {
|
|
56241
56241
|
className: U("flex items-center gap-1 rounded-md px-1.5 py-0.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", e),
|
|
56242
56242
|
...n,
|
|
@@ -56250,7 +56250,7 @@ var $z = w(null), eB = () => {
|
|
|
56250
56250
|
/* @__PURE__ */ V(dh, { className: U("size-2.5", i ? "rotate-180" : "rotate-0") })
|
|
56251
56251
|
] })
|
|
56252
56252
|
});
|
|
56253
|
-
}),
|
|
56253
|
+
}), aB = O(({ className: e, children: t, ...n }) => /* @__PURE__ */ V(dz, {
|
|
56254
56254
|
className: U("mt-1.5 text-sm text-muted-foreground leading-relaxed outline-hidden", e),
|
|
56255
56255
|
...n,
|
|
56256
56256
|
children: /* @__PURE__ */ V("div", {
|
|
@@ -56261,11 +56261,11 @@ var $z = w(null), eB = () => {
|
|
|
56261
56261
|
})
|
|
56262
56262
|
})
|
|
56263
56263
|
}));
|
|
56264
|
-
|
|
56264
|
+
rB.displayName = "Reasoning", iB.displayName = "ReasoningTrigger", aB.displayName = "ReasoningContent";
|
|
56265
56265
|
//#endregion
|
|
56266
56266
|
//#region src/components/message-reasoning.tsx
|
|
56267
|
-
var
|
|
56268
|
-
function
|
|
56267
|
+
var oB = 300;
|
|
56268
|
+
function sB({ isStreaming: e, reasoning: t }) {
|
|
56269
56269
|
let [n, r] = z(!1), i = t.trim().length > 0, a = R(null), o = R(e);
|
|
56270
56270
|
j(() => {
|
|
56271
56271
|
if (a.current !== null && (window.clearTimeout(a.current), a.current = null), e) {
|
|
@@ -56275,7 +56275,7 @@ function oB({ isStreaming: e, reasoning: t }) {
|
|
|
56275
56275
|
let t = o.current;
|
|
56276
56276
|
if (o.current = !1, !(!t || !i || !n)) return a.current = window.setTimeout(() => {
|
|
56277
56277
|
a.current = null, r(!1);
|
|
56278
|
-
},
|
|
56278
|
+
}, oB), () => {
|
|
56279
56279
|
a.current !== null && (window.clearTimeout(a.current), a.current = null);
|
|
56280
56280
|
};
|
|
56281
56281
|
}, [
|
|
@@ -56286,17 +56286,17 @@ function oB({ isStreaming: e, reasoning: t }) {
|
|
|
56286
56286
|
let s = (e) => {
|
|
56287
56287
|
e && a.current !== null && (window.clearTimeout(a.current), a.current = null), r(e);
|
|
56288
56288
|
};
|
|
56289
|
-
return /* @__PURE__ */ H(
|
|
56289
|
+
return /* @__PURE__ */ H(rB, {
|
|
56290
56290
|
"data-testid": "message-reasoning",
|
|
56291
56291
|
isStreaming: e,
|
|
56292
56292
|
onOpenChange: s,
|
|
56293
56293
|
open: n,
|
|
56294
|
-
children: [/* @__PURE__ */ V(
|
|
56294
|
+
children: [/* @__PURE__ */ V(iB, {}), /* @__PURE__ */ V(aB, { children: i || e ? t : "Reasoning summary unavailable." })]
|
|
56295
56295
|
});
|
|
56296
56296
|
}
|
|
56297
56297
|
//#endregion
|
|
56298
56298
|
//#region src/components/preview-attachment.tsx
|
|
56299
|
-
var
|
|
56299
|
+
var cB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
|
|
56300
56300
|
let { name: r, url: i, contentType: a } = e;
|
|
56301
56301
|
return /* @__PURE__ */ H("div", {
|
|
56302
56302
|
className: "group relative size-16 overflow-hidden rounded-lg border bg-muted",
|
|
@@ -56330,7 +56330,7 @@ var sB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
|
|
|
56330
56330
|
})
|
|
56331
56331
|
]
|
|
56332
56332
|
});
|
|
56333
|
-
},
|
|
56333
|
+
}, lB = ({ size: e = 40 }) => /* @__PURE__ */ H("svg", {
|
|
56334
56334
|
fill: "none",
|
|
56335
56335
|
height: e,
|
|
56336
56336
|
viewBox: "0 0 24 24",
|
|
@@ -56407,7 +56407,7 @@ var sB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
|
|
|
56407
56407
|
y2: "4.22"
|
|
56408
56408
|
})
|
|
56409
56409
|
]
|
|
56410
|
-
}),
|
|
56410
|
+
}), uB = ({ size: e = 40 }) => /* @__PURE__ */ V("svg", {
|
|
56411
56411
|
fill: "none",
|
|
56412
56412
|
height: e,
|
|
56413
56413
|
viewBox: "0 0 24 24",
|
|
@@ -56416,7 +56416,7 @@ var sB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
|
|
|
56416
56416
|
d: "M21 12.79A9 9 0 1 1 11.21 3A7 7 0 0 0 21 12.79z",
|
|
56417
56417
|
fill: "currentColor"
|
|
56418
56418
|
})
|
|
56419
|
-
}),
|
|
56419
|
+
}), dB = ({ size: e = 24 }) => /* @__PURE__ */ V("svg", {
|
|
56420
56420
|
fill: "none",
|
|
56421
56421
|
height: e,
|
|
56422
56422
|
viewBox: "0 0 24 24",
|
|
@@ -56427,7 +56427,7 @@ var sB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
|
|
|
56427
56427
|
stroke: "currentColor",
|
|
56428
56428
|
strokeWidth: "2"
|
|
56429
56429
|
})
|
|
56430
|
-
}),
|
|
56430
|
+
}), fB = {
|
|
56431
56431
|
latitude: 37.763283,
|
|
56432
56432
|
longitude: -122.41286,
|
|
56433
56433
|
generationtime_ms: .027894974,
|
|
@@ -56583,10 +56583,10 @@ var sB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
|
|
|
56583
56583
|
]
|
|
56584
56584
|
}
|
|
56585
56585
|
};
|
|
56586
|
-
function
|
|
56586
|
+
function pB(e) {
|
|
56587
56587
|
return Math.ceil(e);
|
|
56588
56588
|
}
|
|
56589
|
-
function
|
|
56589
|
+
function mB({ weatherAtLocation: e = fB }) {
|
|
56590
56590
|
let t = Math.max(...e.hourly.temperature_2m.slice(0, 24)), n = Math.min(...e.hourly.temperature_2m.slice(0, 24)), r = li(new Date(e.current.time), {
|
|
56591
56591
|
start: new Date(e.daily.sunrise[0]),
|
|
56592
56592
|
end: new Date(e.daily.sunset[0])
|
|
@@ -56619,10 +56619,10 @@ function pB({ weatherAtLocation: e = dB }) {
|
|
|
56619
56619
|
className: "flex items-center gap-3",
|
|
56620
56620
|
children: [/* @__PURE__ */ V("div", {
|
|
56621
56621
|
className: "text-primary-foreground/90",
|
|
56622
|
-
children: V(r ?
|
|
56622
|
+
children: V(r ? lB : uB, { size: 32 })
|
|
56623
56623
|
}), /* @__PURE__ */ H("div", {
|
|
56624
56624
|
className: "font-light text-3xl text-primary-foreground",
|
|
56625
|
-
children: [
|
|
56625
|
+
children: [pB(e.current.temperature_2m), /* @__PURE__ */ V("span", {
|
|
56626
56626
|
className: "text-lg text-primary-foreground/80",
|
|
56627
56627
|
children: e.current_units.temperature_2m
|
|
56628
56628
|
})]
|
|
@@ -56633,14 +56633,14 @@ function pB({ weatherAtLocation: e = dB }) {
|
|
|
56633
56633
|
className: "font-medium text-primary-foreground/90 text-xs",
|
|
56634
56634
|
children: [
|
|
56635
56635
|
"H: ",
|
|
56636
|
-
|
|
56636
|
+
pB(t),
|
|
56637
56637
|
"°"
|
|
56638
56638
|
]
|
|
56639
56639
|
}), /* @__PURE__ */ H("div", {
|
|
56640
56640
|
className: "text-primary-foreground/70 text-xs",
|
|
56641
56641
|
children: [
|
|
56642
56642
|
"L: ",
|
|
56643
|
-
|
|
56643
|
+
pB(n),
|
|
56644
56644
|
"°"
|
|
56645
56645
|
]
|
|
56646
56646
|
})]
|
|
@@ -56664,11 +56664,11 @@ function pB({ weatherAtLocation: e = dB }) {
|
|
|
56664
56664
|
}),
|
|
56665
56665
|
/* @__PURE__ */ V("div", {
|
|
56666
56666
|
className: "text-primary-foreground/60",
|
|
56667
|
-
children: /* @__PURE__ */ V(
|
|
56667
|
+
children: /* @__PURE__ */ V(dB, { size: 16 })
|
|
56668
56668
|
}),
|
|
56669
56669
|
/* @__PURE__ */ H("div", {
|
|
56670
56670
|
className: "font-medium text-primary-foreground text-xs",
|
|
56671
|
-
children: [
|
|
56671
|
+
children: [pB(l[t]), "°"]
|
|
56672
56672
|
})
|
|
56673
56673
|
]
|
|
56674
56674
|
}, e);
|
|
@@ -56693,7 +56693,7 @@ function pB({ weatherAtLocation: e = dB }) {
|
|
|
56693
56693
|
}
|
|
56694
56694
|
//#endregion
|
|
56695
56695
|
//#region src/components/message.tsx
|
|
56696
|
-
function
|
|
56696
|
+
function hB(e) {
|
|
56697
56697
|
if (typeof e != "string") return e;
|
|
56698
56698
|
try {
|
|
56699
56699
|
return JSON.parse(e);
|
|
@@ -56701,10 +56701,10 @@ function mB(e) {
|
|
|
56701
56701
|
return e;
|
|
56702
56702
|
}
|
|
56703
56703
|
}
|
|
56704
|
-
var
|
|
56705
|
-
function
|
|
56704
|
+
var gB = (e) => typeof e == "object" && !!e, _B = (e) => !gB(e) || typeof e.error != "string" ? null : e.error.trim() || null;
|
|
56705
|
+
function vB({ addToolApprovalResponse: e, approvalId: t, denyReason: n }) {
|
|
56706
56706
|
return /* @__PURE__ */ H("div", {
|
|
56707
|
-
className: "flex items-center justify-end gap-2
|
|
56707
|
+
className: "flex items-center justify-end gap-2 px-4 py-3",
|
|
56708
56708
|
children: [/* @__PURE__ */ V(Fm, {
|
|
56709
56709
|
className: "h-8 px-3 text-muted-foreground hover:text-foreground",
|
|
56710
56710
|
onClick: () => {
|
|
@@ -56730,13 +56730,18 @@ function _B({ addToolApprovalResponse: e, approvalId: t, denyReason: n }) {
|
|
|
56730
56730
|
})]
|
|
56731
56731
|
});
|
|
56732
56732
|
}
|
|
56733
|
-
var
|
|
56733
|
+
var yB = new Set([
|
|
56734
56734
|
"text",
|
|
56735
56735
|
"code",
|
|
56736
56736
|
"image",
|
|
56737
56737
|
"sheet"
|
|
56738
|
-
]),
|
|
56739
|
-
|
|
56738
|
+
]), bB = new Set([
|
|
56739
|
+
"tool-createDocument",
|
|
56740
|
+
"tool-updateDocument",
|
|
56741
|
+
"tool-editDocument",
|
|
56742
|
+
"tool-requestSuggestions"
|
|
56743
|
+
]), xB = (e) => bB.has(e), SB = (e) => !(!gB(e) || !("id" in e || "title" in e || "kind" in e || "content" in e) || "id" in e && typeof e.id != "string" || "title" in e && typeof e.title != "string" || "kind" in e && (typeof e.kind != "string" || !yB.has(e.kind)) || "content" in e && typeof e.content != "string");
|
|
56744
|
+
function CB(e, t) {
|
|
56740
56745
|
let n = [];
|
|
56741
56746
|
for (let r = 0; r < t.length; r++) {
|
|
56742
56747
|
let i = t[r];
|
|
@@ -56763,8 +56768,8 @@ function bB(e, t) {
|
|
|
56763
56768
|
}
|
|
56764
56769
|
return n;
|
|
56765
56770
|
}
|
|
56766
|
-
var
|
|
56767
|
-
let [f, p] = z("view"), m = n.parts?.some((e) => e.type === "text" && e.text?.trim()), h = n.parts?.some((e) => a(e.type)), g = n.parts.filter((e) => e.type === "file"), _ =
|
|
56771
|
+
var wB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoading: i, renderMessagePart: s, setMessages: c, regenerate: l, isReadonly: u, requiresScrollPadding: d }) => {
|
|
56772
|
+
let [f, p] = z("view"), m = n.parts?.some((e) => e.type === "text" && e.text?.trim()), h = n.parts?.some((e) => a(e.type)), g = n.parts.filter((e) => e.type === "file"), _ = CB(n.id, n.parts);
|
|
56768
56773
|
return ot(), /* @__PURE__ */ V("div", {
|
|
56769
56774
|
className: "group/message fade-in w-full animate-in duration-200",
|
|
56770
56775
|
"data-role": n.role,
|
|
@@ -56787,7 +56792,7 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56787
56792
|
g.length > 0 && /* @__PURE__ */ V("div", {
|
|
56788
56793
|
className: "flex flex-row justify-end gap-2",
|
|
56789
56794
|
"data-testid": "message-attachments",
|
|
56790
|
-
children: g.map((e) => /* @__PURE__ */ V(
|
|
56795
|
+
children: g.map((e) => /* @__PURE__ */ V(cB, { attachment: {
|
|
56791
56796
|
name: e.filename ?? "file",
|
|
56792
56797
|
contentType: e.mediaType,
|
|
56793
56798
|
url: e.url
|
|
@@ -56801,12 +56806,12 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56801
56806
|
part: t
|
|
56802
56807
|
});
|
|
56803
56808
|
if (m !== void 0) return /* @__PURE__ */ V(C, { children: m }, r);
|
|
56804
|
-
if (d === "reasoning" && o(t)) return /* @__PURE__ */ V(
|
|
56809
|
+
if (d === "reasoning" && o(t)) return /* @__PURE__ */ V(sB, {
|
|
56805
56810
|
isStreaming: t.state === "streaming",
|
|
56806
56811
|
reasoning: t.text ?? ""
|
|
56807
56812
|
}, r);
|
|
56808
56813
|
if (d === "text") {
|
|
56809
|
-
if (f === "view") return /* @__PURE__ */ V("div", { children: /* @__PURE__ */ V(
|
|
56814
|
+
if (f === "view") return /* @__PURE__ */ V("div", { children: /* @__PURE__ */ V(Kz, {
|
|
56810
56815
|
className: U({
|
|
56811
56816
|
"wrap-break-word w-fit rounded-2xl bg-primary px-3 py-2 text-left text-primary-foreground": n.role === "user",
|
|
56812
56817
|
"bg-transparent px-0 py-0 text-left": n.role === "assistant"
|
|
@@ -56818,7 +56823,7 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56818
56823
|
className: "flex w-full flex-row items-start gap-3",
|
|
56819
56824
|
children: [/* @__PURE__ */ V("div", { className: "size-8" }), /* @__PURE__ */ V("div", {
|
|
56820
56825
|
className: "min-w-0 flex-1",
|
|
56821
|
-
children: /* @__PURE__ */ V(
|
|
56826
|
+
children: /* @__PURE__ */ V(Qz, {
|
|
56822
56827
|
message: n,
|
|
56823
56828
|
regenerate: l,
|
|
56824
56829
|
setMessages: c,
|
|
@@ -56828,93 +56833,141 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56828
56833
|
}, r);
|
|
56829
56834
|
}
|
|
56830
56835
|
if (d === "tool-getWeather") {
|
|
56831
|
-
let { toolCallId: n, state: r } = t, i = t.approval?.id, a = r === "output-denied" || r === "approval-responded" && t.approval?.approved === !1,
|
|
56832
|
-
return r === "output-available" ?
|
|
56833
|
-
className:
|
|
56836
|
+
let { toolCallId: n, state: r } = t, i = t.approval?.id, a = t.approval, o = r === "output-denied" || r === "approval-responded" && t.approval?.approved === !1, s = "w-[min(100%,450px)]", c = _B(t.output);
|
|
56837
|
+
return r === "output-available" ? c ? /* @__PURE__ */ V("div", {
|
|
56838
|
+
className: s,
|
|
56834
56839
|
children: /* @__PURE__ */ H(gz, {
|
|
56835
56840
|
className: "w-full",
|
|
56836
56841
|
defaultOpen: !0,
|
|
56837
|
-
children: [/* @__PURE__ */ V(
|
|
56842
|
+
children: [/* @__PURE__ */ V(xz, {
|
|
56843
|
+
approval: a,
|
|
56838
56844
|
state: "output-error",
|
|
56839
56845
|
type: "tool-getWeather"
|
|
56840
|
-
}), /* @__PURE__ */ V(
|
|
56841
|
-
errorText:
|
|
56846
|
+
}), /* @__PURE__ */ V(Sz, { children: /* @__PURE__ */ V(Tz, {
|
|
56847
|
+
errorText: c,
|
|
56842
56848
|
output: null
|
|
56843
56849
|
}) })]
|
|
56844
56850
|
})
|
|
56845
56851
|
}, n) : /* @__PURE__ */ V("div", {
|
|
56846
|
-
className:
|
|
56847
|
-
children: /* @__PURE__ */ V(
|
|
56852
|
+
className: s,
|
|
56853
|
+
children: /* @__PURE__ */ V(mB, { weatherAtLocation: t.output })
|
|
56848
56854
|
}, n) : r === "output-error" ? /* @__PURE__ */ V("div", {
|
|
56849
|
-
className:
|
|
56855
|
+
className: s,
|
|
56850
56856
|
children: /* @__PURE__ */ H(gz, {
|
|
56851
56857
|
className: "w-full",
|
|
56852
56858
|
defaultOpen: !0,
|
|
56853
|
-
children: [/* @__PURE__ */ V(
|
|
56859
|
+
children: [/* @__PURE__ */ V(xz, {
|
|
56860
|
+
approval: a,
|
|
56854
56861
|
state: r,
|
|
56855
56862
|
type: "tool-getWeather"
|
|
56856
|
-
}), /* @__PURE__ */ V(
|
|
56863
|
+
}), /* @__PURE__ */ V(Sz, { children: /* @__PURE__ */ V(Tz, {
|
|
56857
56864
|
errorText: t.errorText,
|
|
56858
56865
|
output: null
|
|
56859
56866
|
}) })]
|
|
56860
56867
|
})
|
|
56861
|
-
}, n) :
|
|
56862
|
-
className:
|
|
56868
|
+
}, n) : o ? /* @__PURE__ */ V("div", {
|
|
56869
|
+
className: s,
|
|
56863
56870
|
children: /* @__PURE__ */ H(gz, {
|
|
56864
56871
|
className: "w-full",
|
|
56865
56872
|
defaultOpen: !0,
|
|
56866
|
-
children: [/* @__PURE__ */ V(
|
|
56873
|
+
children: [/* @__PURE__ */ V(xz, {
|
|
56874
|
+
approval: a,
|
|
56867
56875
|
state: "output-denied",
|
|
56868
56876
|
type: "tool-getWeather"
|
|
56869
|
-
}), /* @__PURE__ */ V(
|
|
56877
|
+
}), /* @__PURE__ */ V(Sz, { children: /* @__PURE__ */ V("div", {
|
|
56870
56878
|
className: "px-4 py-3 text-muted-foreground text-sm",
|
|
56871
56879
|
children: "Weather lookup was denied."
|
|
56872
56880
|
}) })]
|
|
56873
56881
|
})
|
|
56874
56882
|
}, n) : r === "approval-responded" ? /* @__PURE__ */ V("div", {
|
|
56875
|
-
className:
|
|
56883
|
+
className: s,
|
|
56876
56884
|
children: /* @__PURE__ */ H(gz, {
|
|
56877
56885
|
className: "w-full",
|
|
56878
56886
|
defaultOpen: !0,
|
|
56879
|
-
children: [/* @__PURE__ */ V(
|
|
56887
|
+
children: [/* @__PURE__ */ V(xz, {
|
|
56888
|
+
approval: a,
|
|
56880
56889
|
state: r,
|
|
56881
56890
|
type: "tool-getWeather"
|
|
56882
|
-
}), /* @__PURE__ */
|
|
56891
|
+
}), /* @__PURE__ */ H(Sz, { children: [/* @__PURE__ */ V(wz, { input: t.input }), a?.reason && /* @__PURE__ */ V("div", {
|
|
56892
|
+
className: "text-muted-foreground text-sm",
|
|
56893
|
+
children: a.reason
|
|
56894
|
+
})] })]
|
|
56883
56895
|
})
|
|
56884
56896
|
}, n) : /* @__PURE__ */ V("div", {
|
|
56885
|
-
className:
|
|
56897
|
+
className: s,
|
|
56886
56898
|
children: /* @__PURE__ */ H(gz, {
|
|
56887
56899
|
className: "w-full",
|
|
56888
56900
|
defaultOpen: !0,
|
|
56889
|
-
children: [/* @__PURE__ */ V(
|
|
56901
|
+
children: [/* @__PURE__ */ V(xz, {
|
|
56902
|
+
approval: a,
|
|
56890
56903
|
state: r,
|
|
56891
56904
|
type: "tool-getWeather"
|
|
56892
|
-
}), /* @__PURE__ */ H(
|
|
56893
|
-
|
|
56894
|
-
|
|
56895
|
-
|
|
56896
|
-
|
|
56905
|
+
}), /* @__PURE__ */ H(Sz, { children: [
|
|
56906
|
+
(r === "input-available" || r === "approval-requested") && /* @__PURE__ */ V(wz, { input: t.input }),
|
|
56907
|
+
r === "approval-requested" && i && !a?.isAutomatic && /* @__PURE__ */ V(vB, {
|
|
56908
|
+
addToolApprovalResponse: e,
|
|
56909
|
+
approvalId: i,
|
|
56910
|
+
denyReason: "User denied weather lookup"
|
|
56911
|
+
}),
|
|
56912
|
+
a?.reason && /* @__PURE__ */ V("div", {
|
|
56913
|
+
className: "border-t pt-3 text-muted-foreground text-sm",
|
|
56914
|
+
children: a.reason
|
|
56915
|
+
})
|
|
56916
|
+
] })]
|
|
56897
56917
|
})
|
|
56898
56918
|
}, n);
|
|
56899
56919
|
}
|
|
56920
|
+
if (xB(d)) {
|
|
56921
|
+
let n = t, { approval: i } = n, a = n.state, o = a === "output-denied" || a === "approval-responded" && i?.approved === !1;
|
|
56922
|
+
if (a === "approval-requested" || a === "approval-responded" || a === "output-denied") {
|
|
56923
|
+
let t = n.toolCallId ?? r;
|
|
56924
|
+
return /* @__PURE__ */ V("div", {
|
|
56925
|
+
className: "w-[min(100%,450px)]",
|
|
56926
|
+
children: /* @__PURE__ */ H(gz, {
|
|
56927
|
+
className: "w-full",
|
|
56928
|
+
defaultOpen: !0,
|
|
56929
|
+
children: [/* @__PURE__ */ V(xz, {
|
|
56930
|
+
approval: i,
|
|
56931
|
+
state: o ? "output-denied" : a,
|
|
56932
|
+
type: d
|
|
56933
|
+
}), /* @__PURE__ */ H(Sz, { children: [
|
|
56934
|
+
n.input !== void 0 && /* @__PURE__ */ V(wz, { input: hB(n.input) }),
|
|
56935
|
+
a === "approval-requested" && i && !i.isAutomatic && /* @__PURE__ */ V(vB, {
|
|
56936
|
+
addToolApprovalResponse: e,
|
|
56937
|
+
approvalId: i.id,
|
|
56938
|
+
denyReason: "User denied tool call"
|
|
56939
|
+
}),
|
|
56940
|
+
i?.reason && /* @__PURE__ */ V("div", {
|
|
56941
|
+
className: "text-muted-foreground text-sm",
|
|
56942
|
+
children: i.reason
|
|
56943
|
+
}),
|
|
56944
|
+
o && /* @__PURE__ */ V("div", {
|
|
56945
|
+
className: "text-muted-foreground text-sm",
|
|
56946
|
+
children: "This tool call was denied."
|
|
56947
|
+
})
|
|
56948
|
+
] })]
|
|
56949
|
+
})
|
|
56950
|
+
}, t);
|
|
56951
|
+
}
|
|
56952
|
+
}
|
|
56900
56953
|
if (d === "tool-createDocument") {
|
|
56901
|
-
let { toolCallId: e } = t, n = t.output, r =
|
|
56902
|
-
return
|
|
56954
|
+
let { toolCallId: e } = t, n = t.output, r = SB(n) ? n : void 0;
|
|
56955
|
+
return gB(n) && "error" in n ? /* @__PURE__ */ H("div", {
|
|
56903
56956
|
className: "rounded-lg border border-destructive/25 bg-destructive/10 p-4 text-destructive",
|
|
56904
56957
|
children: ["Error creating document: ", String(n.error)]
|
|
56905
|
-
}, e) : /* @__PURE__ */ V(
|
|
56958
|
+
}, e) : /* @__PURE__ */ V(Az, {
|
|
56906
56959
|
isReadonly: u,
|
|
56907
56960
|
result: r
|
|
56908
56961
|
}, e);
|
|
56909
56962
|
}
|
|
56910
56963
|
if (d === "tool-updateDocument") {
|
|
56911
|
-
let { toolCallId: e } = t, n = t.output, r =
|
|
56912
|
-
return
|
|
56964
|
+
let { toolCallId: e } = t, n = t.output, r = SB(n) ? n : void 0;
|
|
56965
|
+
return gB(n) && "error" in n ? /* @__PURE__ */ H("div", {
|
|
56913
56966
|
className: "rounded-lg border border-destructive/25 bg-destructive/10 p-4 text-destructive",
|
|
56914
56967
|
children: ["Error updating document: ", String(n.error)]
|
|
56915
56968
|
}, e) : /* @__PURE__ */ V("div", {
|
|
56916
56969
|
className: "relative",
|
|
56917
|
-
children: /* @__PURE__ */ V(
|
|
56970
|
+
children: /* @__PURE__ */ V(Az, {
|
|
56918
56971
|
args: r ? {
|
|
56919
56972
|
...r,
|
|
56920
56973
|
isUpdate: !0
|
|
@@ -56925,13 +56978,13 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56925
56978
|
}, e);
|
|
56926
56979
|
}
|
|
56927
56980
|
if (d === "tool-editDocument") {
|
|
56928
|
-
let { toolCallId: e } = t, n = t.output, r =
|
|
56929
|
-
return
|
|
56981
|
+
let { toolCallId: e } = t, n = t.output, r = SB(n) ? n : void 0;
|
|
56982
|
+
return gB(n) && "error" in n ? /* @__PURE__ */ H("div", {
|
|
56930
56983
|
className: "rounded-lg border border-destructive/25 bg-destructive/10 p-4 text-destructive",
|
|
56931
56984
|
children: ["Error editing document: ", String(n.error)]
|
|
56932
56985
|
}, e) : /* @__PURE__ */ V("div", {
|
|
56933
56986
|
className: "relative",
|
|
56934
|
-
children: /* @__PURE__ */ V(
|
|
56987
|
+
children: /* @__PURE__ */ V(Az, {
|
|
56935
56988
|
args: r ? {
|
|
56936
56989
|
...r,
|
|
56937
56990
|
isUpdate: !0
|
|
@@ -56945,15 +56998,15 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56945
56998
|
let { toolCallId: e, state: n } = t;
|
|
56946
56999
|
return /* @__PURE__ */ H(gz, {
|
|
56947
57000
|
defaultOpen: !0,
|
|
56948
|
-
children: [/* @__PURE__ */ V(
|
|
57001
|
+
children: [/* @__PURE__ */ V(xz, {
|
|
56949
57002
|
state: n,
|
|
56950
57003
|
type: "tool-requestSuggestions"
|
|
56951
|
-
}), /* @__PURE__ */ H(
|
|
57004
|
+
}), /* @__PURE__ */ H(Sz, { children: [n === "input-available" && /* @__PURE__ */ V(wz, { input: t.input }), n === "output-available" && /* @__PURE__ */ V(Tz, {
|
|
56952
57005
|
errorText: void 0,
|
|
56953
|
-
output:
|
|
57006
|
+
output: gB(t.output) && "error" in t.output ? /* @__PURE__ */ H("div", {
|
|
56954
57007
|
className: "rounded border p-2 text-destructive",
|
|
56955
57008
|
children: ["Error: ", String(t.output.error)]
|
|
56956
|
-
}) : /* @__PURE__ */ V(
|
|
57009
|
+
}) : /* @__PURE__ */ V(Oz, {
|
|
56957
57010
|
isReadonly: u,
|
|
56958
57011
|
result: t.output,
|
|
56959
57012
|
type: "request-suggestions"
|
|
@@ -56968,29 +57021,35 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56968
57021
|
children: /* @__PURE__ */ H(gz, {
|
|
56969
57022
|
className: "w-full",
|
|
56970
57023
|
defaultOpen: !0,
|
|
56971
|
-
children: [d === "dynamic-tool" ? /* @__PURE__ */ V(
|
|
57024
|
+
children: [d === "dynamic-tool" ? /* @__PURE__ */ V(xz, {
|
|
57025
|
+
approval: n.approval,
|
|
56972
57026
|
state: l ? "output-denied" : a,
|
|
56973
57027
|
title: s,
|
|
56974
57028
|
toolName: c,
|
|
56975
57029
|
type: "dynamic-tool"
|
|
56976
|
-
}) : /* @__PURE__ */ V(
|
|
57030
|
+
}) : /* @__PURE__ */ V(xz, {
|
|
57031
|
+
approval: n.approval,
|
|
56977
57032
|
state: l ? "output-denied" : a,
|
|
56978
57033
|
title: s,
|
|
56979
57034
|
type: d
|
|
56980
|
-
}), /* @__PURE__ */ H(
|
|
56981
|
-
n.input !== void 0 && (n.state === "input-available" || n.state === "approval-requested" || n.state === "approval-responded" || n.state === "output-available" || n.state === "output-error" || n.state === "output-denied") && /* @__PURE__ */ V(
|
|
56982
|
-
n.state === "approval-requested" && o && /* @__PURE__ */ V(
|
|
57035
|
+
}), /* @__PURE__ */ H(Sz, { children: [
|
|
57036
|
+
n.input !== void 0 && (n.state === "input-available" || n.state === "approval-requested" || n.state === "approval-responded" || n.state === "output-available" || n.state === "output-error" || n.state === "output-denied") && /* @__PURE__ */ V(wz, { input: hB(n.input) }),
|
|
57037
|
+
n.state === "approval-requested" && o && !n.approval?.isAutomatic && /* @__PURE__ */ V(vB, {
|
|
56983
57038
|
addToolApprovalResponse: e,
|
|
56984
57039
|
approvalId: o,
|
|
56985
57040
|
denyReason: "User denied tool call"
|
|
56986
57041
|
}),
|
|
57042
|
+
n.approval?.reason && /* @__PURE__ */ V("div", {
|
|
57043
|
+
className: "border-t pt-3 text-muted-foreground text-sm",
|
|
57044
|
+
children: n.approval.reason
|
|
57045
|
+
}),
|
|
56987
57046
|
l && /* @__PURE__ */ V("div", {
|
|
56988
57047
|
className: "border-t px-4 py-3 text-muted-foreground text-sm",
|
|
56989
57048
|
children: "This tool call was denied."
|
|
56990
57049
|
}),
|
|
56991
|
-
!l && (n.output !== void 0 || n.errorText !== void 0) && /* @__PURE__ */ V(
|
|
57050
|
+
!l && (n.output !== void 0 || n.errorText !== void 0) && /* @__PURE__ */ V(Tz, {
|
|
56992
57051
|
errorText: n.errorText,
|
|
56993
|
-
output: n.output === void 0 ? null :
|
|
57052
|
+
output: n.output === void 0 ? null : hB(n.output)
|
|
56994
57053
|
})
|
|
56995
57054
|
] })]
|
|
56996
57055
|
})
|
|
@@ -56998,7 +57057,7 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56998
57057
|
}
|
|
56999
57058
|
return null;
|
|
57000
57059
|
}),
|
|
57001
|
-
!u && /* @__PURE__ */ V(
|
|
57060
|
+
!u && /* @__PURE__ */ V(Xz, {
|
|
57002
57061
|
chatId: t,
|
|
57003
57062
|
isLoading: i,
|
|
57004
57063
|
message: n,
|
|
@@ -57010,7 +57069,7 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
57010
57069
|
})
|
|
57011
57070
|
});
|
|
57012
57071
|
};
|
|
57013
|
-
function
|
|
57072
|
+
function TB() {
|
|
57014
57073
|
let { waitingStatus: e } = ot();
|
|
57015
57074
|
return /* @__PURE__ */ V("div", {
|
|
57016
57075
|
className: "flex min-w-0 items-center gap-1 p-0 text-muted-foreground text-sm",
|
|
@@ -57020,7 +57079,7 @@ function SB() {
|
|
|
57020
57079
|
})
|
|
57021
57080
|
});
|
|
57022
57081
|
}
|
|
57023
|
-
var
|
|
57082
|
+
var EB = () => /* @__PURE__ */ V("div", {
|
|
57024
57083
|
className: "group/message fade-in w-full animate-in duration-300",
|
|
57025
57084
|
"data-role": "assistant",
|
|
57026
57085
|
"data-testid": "message-assistant-loading",
|
|
@@ -57034,19 +57093,19 @@ var CB = () => /* @__PURE__ */ V("div", {
|
|
|
57034
57093
|
})
|
|
57035
57094
|
}), /* @__PURE__ */ V("div", {
|
|
57036
57095
|
className: "min-w-0 flex-1",
|
|
57037
|
-
children: /* @__PURE__ */ V(
|
|
57096
|
+
children: /* @__PURE__ */ V(TB, {})
|
|
57038
57097
|
})]
|
|
57039
57098
|
})
|
|
57040
57099
|
});
|
|
57041
57100
|
//#endregion
|
|
57042
57101
|
//#region src/components/artifact-messages.tsx
|
|
57043
|
-
function
|
|
57102
|
+
function DB({ addToolApprovalResponse: e, chatId: t, status: n, votes: r, messages: i, renderMessagePart: a, setMessages: o, regenerate: s, isReadonly: c }) {
|
|
57044
57103
|
let { containerRef: l, endRef: u, onViewportEnter: d, onViewportLeave: f, hasSentMessage: p } = zR({ status: n });
|
|
57045
57104
|
return /* @__PURE__ */ H("div", {
|
|
57046
57105
|
className: "flex h-full flex-col items-center gap-4 overflow-y-scroll px-4 pt-20",
|
|
57047
57106
|
ref: l,
|
|
57048
57107
|
children: [
|
|
57049
|
-
i.map((l, u) => /* @__PURE__ */ V(
|
|
57108
|
+
i.map((l, u) => /* @__PURE__ */ V(wB, {
|
|
57050
57109
|
addToolApprovalResponse: e,
|
|
57051
57110
|
chatId: t,
|
|
57052
57111
|
isLoading: n === "streaming" && u === i.length - 1,
|
|
@@ -57060,7 +57119,7 @@ function wB({ addToolApprovalResponse: e, chatId: t, status: n, votes: r, messag
|
|
|
57060
57119
|
}, l.id)),
|
|
57061
57120
|
/* @__PURE__ */ V(hM, {
|
|
57062
57121
|
mode: "wait",
|
|
57063
|
-
children: n === "submitted" && !i.some((e) => e.parts?.some((e) => "state" in e && e.state === "approval-responded")) && /* @__PURE__ */ V(
|
|
57122
|
+
children: n === "submitted" && !i.some((e) => e.parts?.some((e) => "state" in e && e.state === "approval-responded")) && /* @__PURE__ */ V(EB, {}, "thinking")
|
|
57064
57123
|
}),
|
|
57065
57124
|
/* @__PURE__ */ V(cP.div, {
|
|
57066
57125
|
className: "min-h-[24px] min-w-[24px] shrink-0",
|
|
@@ -57071,10 +57130,10 @@ function wB({ addToolApprovalResponse: e, chatId: t, status: n, votes: r, messag
|
|
|
57071
57130
|
]
|
|
57072
57131
|
});
|
|
57073
57132
|
}
|
|
57074
|
-
function
|
|
57133
|
+
function OB(e, t) {
|
|
57075
57134
|
return e.artifactStatus === "streaming" && t.artifactStatus === "streaming" ? !0 : !(e.status !== t.status || e.status && t.status || e.messages.length !== t.messages.length || !ve(e.votes, t.votes) || e.renderMessagePart !== t.renderMessagePart);
|
|
57076
57135
|
}
|
|
57077
|
-
var
|
|
57136
|
+
var kB = O(DB, OB), AB = Ah, jB = Jp, MB = y.forwardRef(({ className: e, ...t }, n) => {
|
|
57078
57137
|
let { resolvedTheme: r, theme: i } = Vm();
|
|
57079
57138
|
return /* @__PURE__ */ V(yp, {
|
|
57080
57139
|
ref: n,
|
|
@@ -57084,24 +57143,24 @@ var EB = O(wB, TB), DB = Ah, OB = Jp, kB = y.forwardRef(({ className: e, ...t },
|
|
|
57084
57143
|
...t
|
|
57085
57144
|
});
|
|
57086
57145
|
});
|
|
57087
|
-
|
|
57088
|
-
var
|
|
57146
|
+
MB.displayName = "DialogOverlay";
|
|
57147
|
+
var NB = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(em, {
|
|
57089
57148
|
ref: r,
|
|
57090
57149
|
render: lm(e, t),
|
|
57091
57150
|
...n,
|
|
57092
57151
|
children: t
|
|
57093
57152
|
}));
|
|
57094
|
-
|
|
57095
|
-
var
|
|
57153
|
+
NB.displayName = "DialogTrigger";
|
|
57154
|
+
var PB = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(Op, {
|
|
57096
57155
|
ref: r,
|
|
57097
57156
|
render: lm(e, t),
|
|
57098
57157
|
...n,
|
|
57099
57158
|
children: t
|
|
57100
57159
|
}));
|
|
57101
|
-
|
|
57102
|
-
var
|
|
57160
|
+
PB.displayName = "DialogClose";
|
|
57161
|
+
var FB = y.forwardRef(({ className: e, children: t, ...n }, r) => {
|
|
57103
57162
|
let { resolvedTheme: i, theme: a } = Vm();
|
|
57104
|
-
return /* @__PURE__ */ H(
|
|
57163
|
+
return /* @__PURE__ */ H(jB, { children: [/* @__PURE__ */ V(MB, {}), /* @__PURE__ */ H(Gp, {
|
|
57105
57164
|
ref: r,
|
|
57106
57165
|
className: U("agents-sdk fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 opacity-0 shadow-lg transition-opacity duration-200 data-open:opacity-100 data-closed:opacity-0 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 sm:rounded-lg", e),
|
|
57107
57166
|
"data-agents-sdk-resolved-theme": i,
|
|
@@ -57116,48 +57175,48 @@ var MB = y.forwardRef(({ className: e, children: t, ...n }, r) => {
|
|
|
57116
57175
|
})]
|
|
57117
57176
|
})] });
|
|
57118
57177
|
});
|
|
57119
|
-
|
|
57120
|
-
var
|
|
57178
|
+
FB.displayName = "DialogContent";
|
|
57179
|
+
var IB = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
|
|
57121
57180
|
className: U("flex flex-col space-y-1.5 text-center sm:text-left", e),
|
|
57122
57181
|
...t
|
|
57123
57182
|
});
|
|
57124
|
-
|
|
57125
|
-
var
|
|
57183
|
+
IB.displayName = "DialogHeader";
|
|
57184
|
+
var LB = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
|
|
57126
57185
|
className: U("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
|
|
57127
57186
|
...t
|
|
57128
57187
|
});
|
|
57129
|
-
|
|
57130
|
-
var
|
|
57188
|
+
LB.displayName = "DialogFooter";
|
|
57189
|
+
var RB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Yp, {
|
|
57131
57190
|
ref: n,
|
|
57132
57191
|
className: U("text-lg font-semibold leading-none tracking-tight", e),
|
|
57133
57192
|
...t
|
|
57134
57193
|
}));
|
|
57135
|
-
|
|
57136
|
-
var
|
|
57194
|
+
RB.displayName = "DialogTitle";
|
|
57195
|
+
var zB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Ap, {
|
|
57137
57196
|
ref: n,
|
|
57138
57197
|
className: U("text-sm text-muted-foreground", e),
|
|
57139
57198
|
...t
|
|
57140
57199
|
}));
|
|
57141
|
-
|
|
57200
|
+
zB.displayName = "DialogDescription";
|
|
57142
57201
|
//#endregion
|
|
57143
57202
|
//#region src/components/ui/command.tsx
|
|
57144
|
-
var
|
|
57203
|
+
var BB = y.createContext(null), VB = (e) => e.trim().toLocaleLowerCase(), HB = (e) => {
|
|
57145
57204
|
if (typeof e == "string" || typeof e == "number") return String(e);
|
|
57146
|
-
if (Array.isArray(e)) return e.map(
|
|
57205
|
+
if (Array.isArray(e)) return e.map(HB).join(" ");
|
|
57147
57206
|
if (y.isValidElement(e)) {
|
|
57148
57207
|
let t = e.props;
|
|
57149
|
-
return `${typeof t.alt == "string" ? t.alt : ""} ${
|
|
57208
|
+
return `${typeof t.alt == "string" ? t.alt : ""} ${HB(t.children)}`.trim();
|
|
57150
57209
|
}
|
|
57151
57210
|
return "";
|
|
57152
|
-
},
|
|
57153
|
-
let n =
|
|
57154
|
-
return n ?
|
|
57155
|
-
},
|
|
57156
|
-
let e = y.useContext(
|
|
57211
|
+
}, UB = (e, t) => {
|
|
57212
|
+
let n = VB(e);
|
|
57213
|
+
return n ? VB(`${t.value} ${t.searchValue}`).includes(n) : !0;
|
|
57214
|
+
}, WB = () => {
|
|
57215
|
+
let e = y.useContext(BB);
|
|
57157
57216
|
if (!e) throw Error("Command components must be rendered inside <Command>.");
|
|
57158
57217
|
return e;
|
|
57159
|
-
},
|
|
57160
|
-
let [c, l] = y.useState(""), [u, d] = y.useState(() => /* @__PURE__ */ new Map()), [f, p] = y.useState(null), m = y.useRef(!1), h = y.useMemo(() => Array.from(u.values()).filter((e) =>
|
|
57218
|
+
}, GB = y.forwardRef(({ className: e, defaultValue: t, loop: n = !0, onKeyDown: r, onValueChange: i, value: a, ...o }, s) => {
|
|
57219
|
+
let [c, l] = y.useState(""), [u, d] = y.useState(() => /* @__PURE__ */ new Map()), [f, p] = y.useState(null), m = y.useRef(!1), h = y.useMemo(() => Array.from(u.values()).filter((e) => UB(c, e)), [u, c]);
|
|
57161
57220
|
y.useEffect(() => {
|
|
57162
57221
|
if (a) {
|
|
57163
57222
|
let e = Array.from(u.values()).find((e) => e.value === a);
|
|
@@ -57168,7 +57227,7 @@ var LB = y.createContext(null), RB = (e) => e.trim().toLocaleLowerCase(), zB = (
|
|
|
57168
57227
|
}
|
|
57169
57228
|
if (!m.current && t) {
|
|
57170
57229
|
let e = Array.from(u.values()).find((e) => e.value === t);
|
|
57171
|
-
if (e &&
|
|
57230
|
+
if (e && UB(c, e)) {
|
|
57172
57231
|
m.current = !0, e.id !== f && p(e.id);
|
|
57173
57232
|
return;
|
|
57174
57233
|
}
|
|
@@ -57201,7 +57260,7 @@ var LB = y.createContext(null), RB = (e) => e.trim().toLocaleLowerCase(), zB = (
|
|
|
57201
57260
|
});
|
|
57202
57261
|
}, []), v = y.useCallback((e) => {
|
|
57203
57262
|
let t = u.get(e);
|
|
57204
|
-
!t || t.disabled || !
|
|
57263
|
+
!t || t.disabled || !UB(c, t) || (i?.(t.value), t.select());
|
|
57205
57264
|
}, [
|
|
57206
57265
|
u,
|
|
57207
57266
|
i,
|
|
@@ -57246,7 +57305,7 @@ var LB = y.createContext(null), RB = (e) => e.trim().toLocaleLowerCase(), zB = (
|
|
|
57246
57305
|
e.key === "Enter" && (e.preventDefault(), x());
|
|
57247
57306
|
}
|
|
57248
57307
|
};
|
|
57249
|
-
return /* @__PURE__ */ V(
|
|
57308
|
+
return /* @__PURE__ */ V(BB.Provider, {
|
|
57250
57309
|
value: {
|
|
57251
57310
|
activeId: f,
|
|
57252
57311
|
registerItem: g,
|
|
@@ -57268,9 +57327,9 @@ var LB = y.createContext(null), RB = (e) => e.trim().toLocaleLowerCase(), zB = (
|
|
|
57268
57327
|
})
|
|
57269
57328
|
});
|
|
57270
57329
|
});
|
|
57271
|
-
|
|
57272
|
-
var
|
|
57273
|
-
let a =
|
|
57330
|
+
GB.displayName = "Command";
|
|
57331
|
+
var KB = y.forwardRef(({ className: e, onChange: t, value: n, ...r }, i) => {
|
|
57332
|
+
let a = WB();
|
|
57274
57333
|
return /* @__PURE__ */ H("div", {
|
|
57275
57334
|
className: "flex items-center border-b px-3",
|
|
57276
57335
|
"data-slot": "command-input-wrapper",
|
|
@@ -57286,17 +57345,17 @@ var UB = y.forwardRef(({ className: e, onChange: t, value: n, ...r }, i) => {
|
|
|
57286
57345
|
})]
|
|
57287
57346
|
});
|
|
57288
57347
|
});
|
|
57289
|
-
|
|
57290
|
-
var
|
|
57348
|
+
KB.displayName = "CommandInput";
|
|
57349
|
+
var qB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V("div", {
|
|
57291
57350
|
ref: n,
|
|
57292
57351
|
className: U("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
|
|
57293
57352
|
"data-command-list": "",
|
|
57294
57353
|
role: "listbox",
|
|
57295
57354
|
...t
|
|
57296
57355
|
}));
|
|
57297
|
-
|
|
57298
|
-
var
|
|
57299
|
-
let r =
|
|
57356
|
+
qB.displayName = "CommandList";
|
|
57357
|
+
var JB = y.forwardRef(({ className: e, ...t }, n) => {
|
|
57358
|
+
let r = WB();
|
|
57300
57359
|
return !r.search.trim() || r.visibleCount > 0 ? null : /* @__PURE__ */ V("div", {
|
|
57301
57360
|
ref: n,
|
|
57302
57361
|
className: U("py-6 text-center text-sm", e),
|
|
@@ -57304,8 +57363,8 @@ var GB = y.forwardRef(({ className: e, ...t }, n) => {
|
|
|
57304
57363
|
...t
|
|
57305
57364
|
});
|
|
57306
57365
|
});
|
|
57307
|
-
|
|
57308
|
-
var
|
|
57366
|
+
JB.displayName = "CommandEmpty";
|
|
57367
|
+
var YB = y.forwardRef(({ className: e, heading: t, children: n, ...r }, i) => /* @__PURE__ */ H("div", {
|
|
57309
57368
|
ref: i,
|
|
57310
57369
|
"aria-label": typeof t == "string" ? t : void 0,
|
|
57311
57370
|
className: U("overflow-hidden p-1 text-foreground [&_[data-command-group-heading]]:px-2 [&_[data-command-group-heading]]:py-1.5 [&_[data-command-group-heading]]:text-xs [&_[data-command-group-heading]]:font-medium [&_[data-command-group-heading]]:text-muted-foreground", e),
|
|
@@ -57317,17 +57376,17 @@ var KB = y.forwardRef(({ className: e, heading: t, children: n, ...r }, i) => /*
|
|
|
57317
57376
|
children: t
|
|
57318
57377
|
}), n]
|
|
57319
57378
|
}));
|
|
57320
|
-
|
|
57321
|
-
var
|
|
57379
|
+
YB.displayName = "CommandGroup";
|
|
57380
|
+
var XB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V("div", {
|
|
57322
57381
|
ref: n,
|
|
57323
57382
|
className: U("-mx-1 h-px bg-border", e),
|
|
57324
57383
|
"data-command-separator": "",
|
|
57325
57384
|
role: "separator",
|
|
57326
57385
|
...t
|
|
57327
57386
|
}));
|
|
57328
|
-
|
|
57329
|
-
var
|
|
57330
|
-
let { activeId: u, registerItem: d, search: f, selectItem: p, setActiveId: m, unregisterItem: h } =
|
|
57387
|
+
XB.displayName = "CommandSeparator";
|
|
57388
|
+
var ZB = y.forwardRef(({ children: e, className: t, disabled: n = !1, keywords: r = [], onClick: i, onMouseMove: a, onSelect: o, value: s, ...c }, l) => {
|
|
57389
|
+
let { activeId: u, registerItem: d, search: f, selectItem: p, setActiveId: m, unregisterItem: h } = WB(), g = y.useId(), _ = HB(e), v = s ?? _, b = `${_} ${r.join(" ")}`.trim(), x = y.useRef(() => {});
|
|
57331
57390
|
x.current = () => o?.(v);
|
|
57332
57391
|
let S = y.useCallback(() => {
|
|
57333
57392
|
x.current();
|
|
@@ -57337,7 +57396,7 @@ var JB = y.forwardRef(({ children: e, className: t, disabled: n = !1, keywords:
|
|
|
57337
57396
|
searchValue: b,
|
|
57338
57397
|
select: S,
|
|
57339
57398
|
value: v
|
|
57340
|
-
}, w =
|
|
57399
|
+
}, w = UB(f, C), T = u === g;
|
|
57341
57400
|
return y.useEffect(() => (d(C), () => h(g)), [
|
|
57342
57401
|
n,
|
|
57343
57402
|
g,
|
|
@@ -57367,109 +57426,109 @@ var JB = y.forwardRef(({ children: e, className: t, disabled: n = !1, keywords:
|
|
|
57367
57426
|
children: e
|
|
57368
57427
|
});
|
|
57369
57428
|
});
|
|
57370
|
-
|
|
57371
|
-
var
|
|
57429
|
+
ZB.displayName = "CommandItem";
|
|
57430
|
+
var QB = ({ className: e, ...t }) => /* @__PURE__ */ V("span", {
|
|
57372
57431
|
className: U("ml-auto text-xs tracking-widest text-muted-foreground", e),
|
|
57373
57432
|
...t
|
|
57374
57433
|
});
|
|
57375
|
-
|
|
57434
|
+
QB.displayName = "CommandShortcut";
|
|
57376
57435
|
//#endregion
|
|
57377
57436
|
//#region src/components/ai-elements/model-selector.tsx
|
|
57378
|
-
var
|
|
57437
|
+
var $B = (e) => /* @__PURE__ */ V(AB, { ...e }), eV = (e) => /* @__PURE__ */ V(NB, { ...e }), tV = ({ className: e, commandDefaultValue: t, children: n, title: r = "Model Selector", ...i }) => /* @__PURE__ */ H(FB, {
|
|
57379
57438
|
className: U("p-0", e),
|
|
57380
57439
|
...i,
|
|
57381
|
-
children: [/* @__PURE__ */ V(
|
|
57440
|
+
children: [/* @__PURE__ */ V(RB, {
|
|
57382
57441
|
className: "sr-only",
|
|
57383
57442
|
children: r
|
|
57384
|
-
}), /* @__PURE__ */ V(
|
|
57443
|
+
}), /* @__PURE__ */ V(GB, {
|
|
57385
57444
|
className: "**:data-[slot=command-input-wrapper]:h-auto",
|
|
57386
57445
|
defaultValue: t,
|
|
57387
57446
|
children: n
|
|
57388
57447
|
})]
|
|
57389
|
-
}),
|
|
57448
|
+
}), nV = ({ className: e, ...t }) => /* @__PURE__ */ V(KB, {
|
|
57390
57449
|
className: U("h-auto py-3.5", e),
|
|
57391
57450
|
...t
|
|
57392
|
-
}),
|
|
57451
|
+
}), rV = (e) => /* @__PURE__ */ V(qB, { ...e }), iV = (e) => /* @__PURE__ */ V(YB, { ...e }), aV = (e) => /* @__PURE__ */ V(ZB, { ...e }), oV = ({ provider: e, className: t }) => /* @__PURE__ */ V("img", {
|
|
57393
57452
|
alt: `${e} logo`,
|
|
57394
57453
|
className: U("size-3 dark:invert", t),
|
|
57395
57454
|
height: 12,
|
|
57396
57455
|
src: `https://models.dev/logos/${e}.svg`,
|
|
57397
57456
|
width: 12
|
|
57398
|
-
}),
|
|
57457
|
+
}), sV = ({ className: e, ...t }) => /* @__PURE__ */ V("span", {
|
|
57399
57458
|
className: U("flex-1 truncate text-left", e),
|
|
57400
57459
|
...t
|
|
57401
|
-
}),
|
|
57402
|
-
process.env.NODE_ENV !== "production" && (
|
|
57403
|
-
function
|
|
57404
|
-
let e = y.useContext(
|
|
57460
|
+
}), cV = /* @__PURE__ */ y.createContext(void 0);
|
|
57461
|
+
process.env.NODE_ENV !== "production" && (cV.displayName = "ScrollAreaRootContext");
|
|
57462
|
+
function lV() {
|
|
57463
|
+
let e = y.useContext(cV);
|
|
57405
57464
|
if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? fc(53) : "Base UI: ScrollAreaRootContext is missing. ScrollArea parts must be placed within <ScrollArea.Root>.");
|
|
57406
57465
|
return e;
|
|
57407
57466
|
}
|
|
57408
57467
|
//#endregion
|
|
57409
57468
|
//#region ../../node_modules/@base-ui/react/scroll-area/root/ScrollAreaRootCssVars.mjs
|
|
57410
|
-
var
|
|
57469
|
+
var uV = /* @__PURE__ */ function(e) {
|
|
57411
57470
|
return e.scrollAreaCornerHeight = "--scroll-area-corner-height", e.scrollAreaCornerWidth = "--scroll-area-corner-width", e;
|
|
57412
57471
|
}({});
|
|
57413
57472
|
//#endregion
|
|
57414
57473
|
//#region ../../node_modules/@base-ui/react/scroll-area/utils/getOffset.mjs
|
|
57415
|
-
function
|
|
57474
|
+
function dV(e, t, n) {
|
|
57416
57475
|
if (!e) return 0;
|
|
57417
57476
|
let r = getComputedStyle(e), i = n === "x" ? "Inline" : "Block";
|
|
57418
57477
|
return n === "x" && t === "margin" ? parseFloat(r[`${t}InlineStart`]) * 2 : parseFloat(r[`${t}${i}Start`]) + parseFloat(r[`${t}${i}End`]);
|
|
57419
57478
|
}
|
|
57420
57479
|
//#endregion
|
|
57421
57480
|
//#region ../../node_modules/@base-ui/react/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.mjs
|
|
57422
|
-
var
|
|
57481
|
+
var fV = /* @__PURE__ */ function(e) {
|
|
57423
57482
|
return e.orientation = "data-orientation", e.hovering = "data-hovering", e.scrolling = "data-scrolling", e.hasOverflowX = "data-has-overflow-x", e.hasOverflowY = "data-has-overflow-y", e.overflowXStart = "data-overflow-x-start", e.overflowXEnd = "data-overflow-x-end", e.overflowYStart = "data-overflow-y-start", e.overflowYEnd = "data-overflow-y-end", e;
|
|
57424
|
-
}({}),
|
|
57425
|
-
className:
|
|
57483
|
+
}({}), pV = "base-ui-disable-scrollbar", mV = {
|
|
57484
|
+
className: pV,
|
|
57426
57485
|
getElement(e) {
|
|
57427
57486
|
return /* @__PURE__ */ V("style", {
|
|
57428
57487
|
nonce: e,
|
|
57429
|
-
href:
|
|
57488
|
+
href: pV,
|
|
57430
57489
|
precedence: "base-ui:low",
|
|
57431
|
-
children: `.${
|
|
57490
|
+
children: `.${pV}{scrollbar-width:none}.${pV}::-webkit-scrollbar{display:none}`
|
|
57432
57491
|
});
|
|
57433
57492
|
}
|
|
57434
57493
|
};
|
|
57435
|
-
process.env.NODE_ENV !== "production" && (
|
|
57494
|
+
process.env.NODE_ENV !== "production" && (mV.getElement.displayName = "styleDisableScrollbar.getElement");
|
|
57436
57495
|
//#endregion
|
|
57437
57496
|
//#region ../../node_modules/@base-ui/react/scroll-area/root/ScrollAreaRootDataAttributes.mjs
|
|
57438
|
-
var
|
|
57497
|
+
var hV = /* @__PURE__ */ function(e) {
|
|
57439
57498
|
return e.scrolling = "data-scrolling", e.hasOverflowX = "data-has-overflow-x", e.hasOverflowY = "data-has-overflow-y", e.overflowXStart = "data-overflow-x-start", e.overflowXEnd = "data-overflow-x-end", e.overflowYStart = "data-overflow-y-start", e.overflowYEnd = "data-overflow-y-end", e;
|
|
57440
|
-
}({}),
|
|
57441
|
-
hasOverflowX: (e) => e ? { [
|
|
57442
|
-
hasOverflowY: (e) => e ? { [
|
|
57443
|
-
overflowXStart: (e) => e ? { [
|
|
57444
|
-
overflowXEnd: (e) => e ? { [
|
|
57445
|
-
overflowYStart: (e) => e ? { [
|
|
57446
|
-
overflowYEnd: (e) => e ? { [
|
|
57499
|
+
}({}), gV = {
|
|
57500
|
+
hasOverflowX: (e) => e ? { [hV.hasOverflowX]: "" } : null,
|
|
57501
|
+
hasOverflowY: (e) => e ? { [hV.hasOverflowY]: "" } : null,
|
|
57502
|
+
overflowXStart: (e) => e ? { [hV.overflowXStart]: "" } : null,
|
|
57503
|
+
overflowXEnd: (e) => e ? { [hV.overflowXEnd]: "" } : null,
|
|
57504
|
+
overflowYStart: (e) => e ? { [hV.overflowYStart]: "" } : null,
|
|
57505
|
+
overflowYEnd: (e) => e ? { [hV.overflowYEnd]: "" } : null,
|
|
57447
57506
|
cornerHidden: () => null
|
|
57448
|
-
},
|
|
57449
|
-
process.env.NODE_ENV !== "production" && (
|
|
57450
|
-
var
|
|
57451
|
-
function
|
|
57452
|
-
return y.useContext(
|
|
57507
|
+
}, _V = /* @__PURE__ */ y.createContext(void 0);
|
|
57508
|
+
process.env.NODE_ENV !== "production" && (_V.displayName = "CSPContext");
|
|
57509
|
+
var vV = { disableStyleElements: !1 };
|
|
57510
|
+
function yV() {
|
|
57511
|
+
return y.useContext(_V) ?? vV;
|
|
57453
57512
|
}
|
|
57454
57513
|
//#endregion
|
|
57455
57514
|
//#region ../../node_modules/@base-ui/react/scroll-area/root/ScrollAreaRoot.mjs
|
|
57456
|
-
var
|
|
57515
|
+
var bV = {
|
|
57457
57516
|
x: 0,
|
|
57458
57517
|
y: 0
|
|
57459
|
-
},
|
|
57518
|
+
}, xV = {
|
|
57460
57519
|
width: 0,
|
|
57461
57520
|
height: 0
|
|
57462
|
-
},
|
|
57521
|
+
}, SV = {
|
|
57463
57522
|
xStart: !1,
|
|
57464
57523
|
xEnd: !1,
|
|
57465
57524
|
yStart: !1,
|
|
57466
57525
|
yEnd: !1
|
|
57467
|
-
},
|
|
57526
|
+
}, CV = {
|
|
57468
57527
|
x: !0,
|
|
57469
57528
|
y: !0,
|
|
57470
57529
|
corner: !0
|
|
57471
|
-
},
|
|
57472
|
-
let { render: n, className: r, overflowEdgeThreshold: i, style: a, ...o } = e, { xStart: s, xEnd: c, yStart: l, yEnd: u } =
|
|
57530
|
+
}, wV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
57531
|
+
let { render: n, className: r, overflowEdgeThreshold: i, style: a, ...o } = e, { xStart: s, xEnd: c, yStart: l, yEnd: u } = TV(i), d = kp(), f = ca(), p = ca(), { nonce: m, disableStyleElements: h } = yV(), [g, _] = y.useState(!1), [v, b] = y.useState(!1), [x, S] = y.useState(!1), [C, w] = y.useState(!1), [T, E] = y.useState(!1), [D, O] = y.useState(xV), [k, A] = y.useState(xV), [j, M] = y.useState(SV), [N, P] = y.useState(CV), F = y.useRef(null), I = y.useRef(null), L = y.useRef(null), R = y.useRef(null), z = y.useRef(null), ee = y.useRef(null), te = y.useRef(null), ne = y.useRef(!1), re = y.useRef(0), ie = y.useRef(0), B = y.useRef(0), ae = y.useRef(0), oe = y.useRef("vertical"), se = y.useRef(bV), ce = J((e) => {
|
|
57473
57532
|
let t = e.x - se.current.x, n = e.y - se.current.y;
|
|
57474
57533
|
se.current = e, n !== 0 && (S(!0), f.start(500, () => {
|
|
57475
57534
|
S(!1);
|
|
@@ -57477,20 +57536,20 @@ var _V = {
|
|
|
57477
57536
|
b(!1);
|
|
57478
57537
|
}));
|
|
57479
57538
|
}), V = J((e) => {
|
|
57480
|
-
e.button === 0 && (ne.current = !0, re.current = e.clientY, ie.current = e.clientX, oe.current = e.currentTarget.getAttribute(
|
|
57539
|
+
e.button === 0 && (ne.current = !0, re.current = e.clientY, ie.current = e.clientX, oe.current = e.currentTarget.getAttribute(fV.orientation), I.current && (B.current = I.current.scrollTop, ae.current = I.current.scrollLeft), z.current && oe.current === "vertical" && z.current.setPointerCapture(e.pointerId), ee.current && oe.current === "horizontal" && ee.current.setPointerCapture(e.pointerId));
|
|
57481
57540
|
}), le = J((e) => {
|
|
57482
57541
|
if (!ne.current) return;
|
|
57483
57542
|
let t = e.clientY - re.current, n = e.clientX - ie.current;
|
|
57484
57543
|
if (I.current) {
|
|
57485
57544
|
let r = I.current.scrollHeight, i = I.current.clientHeight, a = I.current.scrollWidth, o = I.current.clientWidth;
|
|
57486
57545
|
if (z.current && L.current && oe.current === "vertical") {
|
|
57487
|
-
let n =
|
|
57546
|
+
let n = dV(L.current, "padding", "y"), a = dV(z.current, "margin", "y"), o = z.current.offsetHeight, s = t / (L.current.offsetHeight - o - n - a);
|
|
57488
57547
|
I.current.scrollTop = B.current + s * (r - i), e.preventDefault(), S(!0), f.start(500, () => {
|
|
57489
57548
|
S(!1);
|
|
57490
57549
|
});
|
|
57491
57550
|
}
|
|
57492
57551
|
if (ee.current && R.current && oe.current === "horizontal") {
|
|
57493
|
-
let t =
|
|
57552
|
+
let t = dV(R.current, "padding", "x"), r = dV(ee.current, "margin", "x"), i = ee.current.offsetWidth, s = n / (R.current.offsetWidth - i - t - r);
|
|
57494
57553
|
I.current.scrollLeft = ae.current + s * (a - o), e.preventDefault(), b(!0), p.start(500, () => {
|
|
57495
57554
|
b(!1);
|
|
57496
57555
|
});
|
|
@@ -57531,14 +57590,14 @@ var _V = {
|
|
|
57531
57590
|
},
|
|
57532
57591
|
style: {
|
|
57533
57592
|
position: "relative",
|
|
57534
|
-
[
|
|
57535
|
-
[
|
|
57593
|
+
[uV.scrollAreaCornerHeight]: `${D.height}px`,
|
|
57594
|
+
[uV.scrollAreaCornerWidth]: `${D.width}px`
|
|
57536
57595
|
}
|
|
57537
57596
|
}, me = Lc("div", e, {
|
|
57538
57597
|
state: fe,
|
|
57539
57598
|
ref: [t, F],
|
|
57540
57599
|
props: [pe, o],
|
|
57541
|
-
stateAttributesMapping:
|
|
57600
|
+
stateAttributesMapping: gV
|
|
57542
57601
|
}), he = y.useMemo(() => ({
|
|
57543
57602
|
handlePointerDown: V,
|
|
57544
57603
|
handlePointerMove: le,
|
|
@@ -57600,13 +57659,13 @@ var _V = {
|
|
|
57600
57659
|
l,
|
|
57601
57660
|
u
|
|
57602
57661
|
]);
|
|
57603
|
-
return /* @__PURE__ */ H(
|
|
57662
|
+
return /* @__PURE__ */ H(cV.Provider, {
|
|
57604
57663
|
value: he,
|
|
57605
|
-
children: [!h &&
|
|
57664
|
+
children: [!h && mV.getElement(m), me]
|
|
57606
57665
|
});
|
|
57607
57666
|
});
|
|
57608
|
-
process.env.NODE_ENV !== "production" && (
|
|
57609
|
-
function
|
|
57667
|
+
process.env.NODE_ENV !== "production" && (wV.displayName = "ScrollAreaRoot");
|
|
57668
|
+
function TV(e) {
|
|
57610
57669
|
if (typeof e == "number") {
|
|
57611
57670
|
let t = Math.max(0, e);
|
|
57612
57671
|
return {
|
|
@@ -57625,40 +57684,40 @@ function SV(e) {
|
|
|
57625
57684
|
}
|
|
57626
57685
|
//#endregion
|
|
57627
57686
|
//#region ../../node_modules/@base-ui/react/scroll-area/viewport/ScrollAreaViewportContext.mjs
|
|
57628
|
-
var
|
|
57629
|
-
process.env.NODE_ENV !== "production" && (
|
|
57630
|
-
function
|
|
57631
|
-
let e = y.useContext(
|
|
57687
|
+
var EV = /* @__PURE__ */ y.createContext(void 0);
|
|
57688
|
+
process.env.NODE_ENV !== "production" && (EV.displayName = "ScrollAreaViewportContext");
|
|
57689
|
+
function DV() {
|
|
57690
|
+
let e = y.useContext(EV);
|
|
57632
57691
|
if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? fc(55) : "Base UI: ScrollAreaViewportContext missing. ScrollAreaViewport parts must be placed within <ScrollArea.Viewport>.");
|
|
57633
57692
|
return e;
|
|
57634
57693
|
}
|
|
57635
57694
|
//#endregion
|
|
57636
57695
|
//#region ../../node_modules/@base-ui/react/internals/clamp.mjs
|
|
57637
|
-
function
|
|
57696
|
+
function OV(e, t = -(2 ** 53 - 1), n = 2 ** 53 - 1) {
|
|
57638
57697
|
return Math.max(t, Math.min(e, n));
|
|
57639
57698
|
}
|
|
57640
57699
|
//#endregion
|
|
57641
57700
|
//#region ../../node_modules/@base-ui/react/scroll-area/viewport/ScrollAreaViewportCssVars.mjs
|
|
57642
|
-
var
|
|
57701
|
+
var kV = /* @__PURE__ */ function(e) {
|
|
57643
57702
|
return e.scrollAreaOverflowXStart = "--scroll-area-overflow-x-start", e.scrollAreaOverflowXEnd = "--scroll-area-overflow-x-end", e.scrollAreaOverflowYStart = "--scroll-area-overflow-y-start", e.scrollAreaOverflowYEnd = "--scroll-area-overflow-y-end", e;
|
|
57644
57703
|
}({});
|
|
57645
|
-
function
|
|
57704
|
+
function AV(e, t) {
|
|
57646
57705
|
return Math.max(0, e - t);
|
|
57647
57706
|
}
|
|
57648
|
-
function
|
|
57707
|
+
function jV(e, t) {
|
|
57649
57708
|
if (t <= 0) return 0;
|
|
57650
|
-
let n =
|
|
57709
|
+
let n = OV(e, 0, t), r = n, i = t - n, a = r <= 1, o = i <= 1;
|
|
57651
57710
|
return a && o ? r <= i ? 0 : t : a ? 0 : o ? t : n;
|
|
57652
57711
|
}
|
|
57653
57712
|
//#endregion
|
|
57654
57713
|
//#region ../../node_modules/@base-ui/react/scroll-area/viewport/ScrollAreaViewport.mjs
|
|
57655
|
-
var
|
|
57656
|
-
function
|
|
57657
|
-
|
|
57658
|
-
|
|
57659
|
-
|
|
57660
|
-
|
|
57661
|
-
|
|
57714
|
+
var MV = !1;
|
|
57715
|
+
function NV() {
|
|
57716
|
+
MV || Qi || (typeof CSS < "u" && "registerProperty" in CSS && [
|
|
57717
|
+
kV.scrollAreaOverflowXStart,
|
|
57718
|
+
kV.scrollAreaOverflowXEnd,
|
|
57719
|
+
kV.scrollAreaOverflowYStart,
|
|
57720
|
+
kV.scrollAreaOverflowYEnd
|
|
57662
57721
|
].forEach((e) => {
|
|
57663
57722
|
try {
|
|
57664
57723
|
CSS.registerProperty({
|
|
@@ -57668,10 +57727,10 @@ function AV() {
|
|
|
57668
57727
|
initialValue: "0px"
|
|
57669
57728
|
});
|
|
57670
57729
|
} catch {}
|
|
57671
|
-
}),
|
|
57730
|
+
}), MV = !0);
|
|
57672
57731
|
}
|
|
57673
|
-
var
|
|
57674
|
-
let { render: n, className: r, style: i, ...a } = e, { viewportRef: o, scrollbarYRef: s, scrollbarXRef: c, thumbYRef: l, thumbXRef: u, cornerRef: d, cornerSize: f, setCornerSize: p, setThumbSize: m, rootId: h, setHiddenState: g, hiddenState: _, setHasMeasuredScrollbar: v, handleScroll: b, setHovering: x, setOverflowEdges: S, overflowEdges: C, overflowEdgeThreshold: w, scrollingX: T, scrollingY: E } =
|
|
57732
|
+
var PV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
57733
|
+
let { render: n, className: r, style: i, ...a } = e, { viewportRef: o, scrollbarYRef: s, scrollbarXRef: c, thumbYRef: l, thumbXRef: u, cornerRef: d, cornerSize: f, setCornerSize: p, setThumbSize: m, rootId: h, setHiddenState: g, hiddenState: _, setHasMeasuredScrollbar: v, handleScroll: b, setHovering: x, setOverflowEdges: S, overflowEdges: C, overflowEdgeThreshold: w, scrollingX: T, scrollingY: E } = lV(), D = ug(), O = y.useRef(!0), k = y.useRef([
|
|
57675
57734
|
NaN,
|
|
57676
57735
|
NaN,
|
|
57677
57736
|
NaN,
|
|
@@ -57681,14 +57740,14 @@ var jV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57681
57740
|
if (!e) return;
|
|
57682
57741
|
let h = e.scrollHeight, _ = e.scrollWidth, y = e.clientHeight, b = e.clientWidth, x = e.scrollTop, C = e.scrollLeft, T = k.current, E = Number.isNaN(T[0]);
|
|
57683
57742
|
if (T[0] = y, T[1] = h, T[2] = b, T[3] = _, E && v(!0), h === 0 || _ === 0) return;
|
|
57684
|
-
let O =
|
|
57743
|
+
let O = FV(e), A = O.y, j = O.x, M = b / _, N = y / h, P = Math.max(0, _ - b), F = Math.max(0, h - y), I = 0, L = 0;
|
|
57685
57744
|
if (!j) {
|
|
57686
57745
|
let e = 0;
|
|
57687
|
-
e =
|
|
57746
|
+
e = OV(D === "rtl" ? -C : C, 0, P), I = jV(e, P), L = P - I;
|
|
57688
57747
|
}
|
|
57689
|
-
let R = A ? 0 :
|
|
57748
|
+
let R = A ? 0 : OV(x, 0, F), z = A ? 0 : jV(R, F), ee = A ? 0 : F - z, te = j ? 0 : b, ne = A ? 0 : y, re = 0, ie = 0;
|
|
57690
57749
|
!j && !A && (re = t?.offsetWidth || 0, ie = n?.offsetHeight || 0);
|
|
57691
|
-
let B = f.width === 0 && f.height === 0, ae = B ? re : 0, oe = B ? ie : 0, se =
|
|
57750
|
+
let B = f.width === 0 && f.height === 0, ae = B ? re : 0, oe = B ? ie : 0, se = dV(n, "padding", "x"), ce = dV(t, "padding", "y"), V = dV(i, "margin", "x"), H = dV(r, "margin", "y"), le = te - se - V, ue = ne - ce - H, de = n ? Math.min(n.offsetWidth - ae, le) : le, U = t ? Math.min(t.offsetHeight - oe, ue) : ue, fe = Math.max(16, de * M), pe = Math.max(16, U * N);
|
|
57692
57751
|
if (m((e) => e.height === pe && e.width === fe ? e : {
|
|
57693
57752
|
width: fe,
|
|
57694
57753
|
height: pe
|
|
@@ -57697,14 +57756,14 @@ var jV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57697
57756
|
r.style.transform = `translate3d(0,${a}px,0)`;
|
|
57698
57757
|
}
|
|
57699
57758
|
if (n && i) {
|
|
57700
|
-
let e = n.offsetWidth - fe - se - V, t = _ - b, r = t === 0 ? 0 : C / t, a = D === "rtl" ?
|
|
57759
|
+
let e = n.offsetWidth - fe - se - V, t = _ - b, r = t === 0 ? 0 : C / t, a = D === "rtl" ? OV(r * e, -e, 0) : OV(r * e, 0, e);
|
|
57701
57760
|
i.style.transform = `translate3d(${a}px,0,0)`;
|
|
57702
57761
|
}
|
|
57703
57762
|
let me = [
|
|
57704
|
-
[
|
|
57705
|
-
[
|
|
57706
|
-
[
|
|
57707
|
-
[
|
|
57763
|
+
[kV.scrollAreaOverflowXStart, I],
|
|
57764
|
+
[kV.scrollAreaOverflowXEnd, L],
|
|
57765
|
+
[kV.scrollAreaOverflowYStart, z],
|
|
57766
|
+
[kV.scrollAreaOverflowYEnd, ee]
|
|
57708
57767
|
];
|
|
57709
57768
|
for (let [t, n] of me) e.style.setProperty(t, `${n}px`);
|
|
57710
57769
|
a && (j || A ? p({
|
|
@@ -57713,7 +57772,7 @@ var jV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57713
57772
|
}) : !j && !A && p({
|
|
57714
57773
|
width: re,
|
|
57715
57774
|
height: ie
|
|
57716
|
-
})), g((e) =>
|
|
57775
|
+
})), g((e) => IV(e, O));
|
|
57717
57776
|
let he = {
|
|
57718
57777
|
xStart: !j && I > w.xStart,
|
|
57719
57778
|
xEnd: !j && L > w.xEnd,
|
|
@@ -57723,7 +57782,7 @@ var jV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57723
57782
|
S((e) => e.xStart === he.xStart && e.xEnd === he.xEnd && e.yStart === he.yStart && e.yEnd === he.yEnd ? e : he);
|
|
57724
57783
|
});
|
|
57725
57784
|
K(() => {
|
|
57726
|
-
o.current &&
|
|
57785
|
+
o.current && NV();
|
|
57727
57786
|
}, [o]), K(() => {
|
|
57728
57787
|
queueMicrotask(M);
|
|
57729
57788
|
}, [
|
|
@@ -57765,7 +57824,7 @@ var jV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57765
57824
|
role: "presentation",
|
|
57766
57825
|
...h && { "data-id": `${h}-viewport` },
|
|
57767
57826
|
tabIndex: _.x && _.y ? -1 : 0,
|
|
57768
|
-
className:
|
|
57827
|
+
className: mV.className,
|
|
57769
57828
|
style: { overflow: "scroll" },
|
|
57770
57829
|
onScroll() {
|
|
57771
57830
|
o.current && (M(), O.current || b({
|
|
@@ -57800,15 +57859,15 @@ var jV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57800
57859
|
ref: [t, o],
|
|
57801
57860
|
state: F,
|
|
57802
57861
|
props: [P, a],
|
|
57803
|
-
stateAttributesMapping:
|
|
57862
|
+
stateAttributesMapping: gV
|
|
57804
57863
|
}), L = y.useMemo(() => ({ computeThumbPosition: M }), [M]);
|
|
57805
|
-
return /* @__PURE__ */ V(
|
|
57864
|
+
return /* @__PURE__ */ V(EV.Provider, {
|
|
57806
57865
|
value: L,
|
|
57807
57866
|
children: I
|
|
57808
57867
|
});
|
|
57809
57868
|
});
|
|
57810
|
-
process.env.NODE_ENV !== "production" && (
|
|
57811
|
-
function
|
|
57869
|
+
process.env.NODE_ENV !== "production" && (PV.displayName = "ScrollAreaViewport");
|
|
57870
|
+
function FV(e) {
|
|
57812
57871
|
let t = e.clientHeight >= e.scrollHeight, n = e.clientWidth >= e.scrollWidth;
|
|
57813
57872
|
return {
|
|
57814
57873
|
y: t,
|
|
@@ -57816,24 +57875,24 @@ function MV(e) {
|
|
|
57816
57875
|
corner: t || n
|
|
57817
57876
|
};
|
|
57818
57877
|
}
|
|
57819
|
-
function
|
|
57878
|
+
function IV(e, t) {
|
|
57820
57879
|
return e.y === t.y && e.x === t.x && e.corner === t.corner ? e : t;
|
|
57821
57880
|
}
|
|
57822
57881
|
//#endregion
|
|
57823
57882
|
//#region ../../node_modules/@base-ui/react/scroll-area/scrollbar/ScrollAreaScrollbarContext.mjs
|
|
57824
|
-
var
|
|
57825
|
-
process.env.NODE_ENV !== "production" && (
|
|
57826
|
-
function
|
|
57827
|
-
let e = y.useContext(
|
|
57883
|
+
var LV = /* @__PURE__ */ y.createContext(void 0);
|
|
57884
|
+
process.env.NODE_ENV !== "production" && (LV.displayName = "ScrollAreaScrollbarContext");
|
|
57885
|
+
function RV() {
|
|
57886
|
+
let e = y.useContext(LV);
|
|
57828
57887
|
if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? fc(54) : "Base UI: ScrollAreaScrollbarContext is missing. ScrollAreaScrollbar parts must be placed within <ScrollArea.Scrollbar>.");
|
|
57829
57888
|
return e;
|
|
57830
57889
|
}
|
|
57831
57890
|
//#endregion
|
|
57832
57891
|
//#region ../../node_modules/@base-ui/react/scroll-area/scrollbar/ScrollAreaScrollbarCssVars.mjs
|
|
57833
|
-
var
|
|
57892
|
+
var zV = /* @__PURE__ */ function(e) {
|
|
57834
57893
|
return e.scrollAreaThumbHeight = "--scroll-area-thumb-height", e.scrollAreaThumbWidth = "--scroll-area-thumb-width", e;
|
|
57835
|
-
}({}),
|
|
57836
|
-
let { render: n, className: r, orientation: i = "vertical", keepMounted: a = !1, style: o, ...s } = e, { hovering: c, scrollingX: l, scrollingY: u, hiddenState: d, overflowEdges: f, scrollbarYRef: p, scrollbarXRef: m, viewportRef: h, thumbYRef: g, thumbXRef: _, handlePointerDown: v, handlePointerUp: b, handleScroll: x, rootId: S, thumbSize: C, hasMeasuredScrollbar: w } =
|
|
57894
|
+
}({}), BV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
57895
|
+
let { render: n, className: r, orientation: i = "vertical", keepMounted: a = !1, style: o, ...s } = e, { hovering: c, scrollingX: l, scrollingY: u, hiddenState: d, overflowEdges: f, scrollbarYRef: p, scrollbarXRef: m, viewportRef: h, thumbYRef: g, thumbXRef: _, handlePointerDown: v, handlePointerUp: b, handleScroll: x, rootId: S, thumbSize: C, hasMeasuredScrollbar: w } = lV(), T = {
|
|
57837
57896
|
hovering: c,
|
|
57838
57897
|
scrolling: {
|
|
57839
57898
|
horizontal: l,
|
|
@@ -57879,11 +57938,11 @@ var IV = /* @__PURE__ */ function(e) {
|
|
|
57879
57938
|
let t = za(e.nativeEvent), n = i === "vertical" ? g.current : _.current;
|
|
57880
57939
|
if (!(n && q(n, t)) && h.current) {
|
|
57881
57940
|
if (g.current && p.current && i === "vertical") {
|
|
57882
|
-
let t =
|
|
57941
|
+
let t = dV(g.current, "margin", "y"), n = dV(p.current, "padding", "y"), r = g.current.offsetHeight, i = p.current.getBoundingClientRect(), a = e.clientY - i.top - r / 2 - n + t / 2, o = h.current.scrollHeight, s = h.current.clientHeight, c = a / (p.current.offsetHeight - r - n - t) * (o - s);
|
|
57883
57942
|
h.current.scrollTop = c;
|
|
57884
57943
|
}
|
|
57885
57944
|
if (_.current && m.current && i === "horizontal") {
|
|
57886
|
-
let t =
|
|
57945
|
+
let t = dV(_.current, "margin", "x"), n = dV(m.current, "padding", "x"), r = _.current.offsetWidth, i = m.current.getBoundingClientRect(), a = e.clientX - i.left - r / 2 - n + t / 2, o = h.current.scrollWidth, s = h.current.clientWidth, c = a / (m.current.offsetWidth - r - n - t), l;
|
|
57887
57946
|
E === "rtl" ? (l = (1 - c) * (o - s), h.current.scrollLeft <= 0 && (l = -l)) : l = c * (o - s), h.current.scrollLeft = l;
|
|
57888
57947
|
}
|
|
57889
57948
|
x({
|
|
@@ -57902,33 +57961,33 @@ var IV = /* @__PURE__ */ function(e) {
|
|
|
57902
57961
|
visibility: D ? "hidden" : void 0,
|
|
57903
57962
|
...i === "vertical" && {
|
|
57904
57963
|
top: 0,
|
|
57905
|
-
bottom: `var(${
|
|
57964
|
+
bottom: `var(${uV.scrollAreaCornerHeight})`,
|
|
57906
57965
|
insetInlineEnd: 0,
|
|
57907
|
-
[
|
|
57966
|
+
[zV.scrollAreaThumbHeight]: `${C.height}px`
|
|
57908
57967
|
},
|
|
57909
57968
|
...i === "horizontal" && {
|
|
57910
57969
|
insetInlineStart: 0,
|
|
57911
|
-
insetInlineEnd: `var(${
|
|
57970
|
+
insetInlineEnd: `var(${uV.scrollAreaCornerWidth})`,
|
|
57912
57971
|
bottom: 0,
|
|
57913
|
-
[
|
|
57972
|
+
[zV.scrollAreaThumbWidth]: `${C.width}px`
|
|
57914
57973
|
}
|
|
57915
57974
|
}
|
|
57916
57975
|
}, j = Lc("div", e, {
|
|
57917
57976
|
ref: [t, i === "vertical" ? p : m],
|
|
57918
57977
|
state: T,
|
|
57919
57978
|
props: [A, s],
|
|
57920
|
-
stateAttributesMapping:
|
|
57979
|
+
stateAttributesMapping: gV
|
|
57921
57980
|
}), M = y.useMemo(() => ({ orientation: i }), [i]);
|
|
57922
|
-
return k ? /* @__PURE__ */ V(
|
|
57981
|
+
return k ? /* @__PURE__ */ V(LV.Provider, {
|
|
57923
57982
|
value: M,
|
|
57924
57983
|
children: j
|
|
57925
57984
|
}) : null;
|
|
57926
57985
|
});
|
|
57927
|
-
process.env.NODE_ENV !== "production" && (
|
|
57986
|
+
process.env.NODE_ENV !== "production" && (BV.displayName = "ScrollAreaScrollbar");
|
|
57928
57987
|
//#endregion
|
|
57929
57988
|
//#region ../../node_modules/@base-ui/react/scroll-area/content/ScrollAreaContent.mjs
|
|
57930
|
-
var
|
|
57931
|
-
let { render: n, className: r, style: i, ...a } = e, { computeThumbPosition: o } =
|
|
57989
|
+
var VV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
57990
|
+
let { render: n, className: r, style: i, ...a } = e, { computeThumbPosition: o } = DV(), { hasMeasuredScrollbar: s, viewportState: c } = lV(), l = y.useRef(null), u = y.useRef(s);
|
|
57932
57991
|
return K(() => {
|
|
57933
57992
|
if (typeof ResizeObserver > "u") return;
|
|
57934
57993
|
let e = !1, t = new ResizeObserver(() => {
|
|
@@ -57940,18 +57999,18 @@ var RV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57940
57999
|
}, [o]), Lc("div", e, {
|
|
57941
58000
|
ref: [t, l],
|
|
57942
58001
|
state: c,
|
|
57943
|
-
stateAttributesMapping:
|
|
58002
|
+
stateAttributesMapping: gV,
|
|
57944
58003
|
props: [{
|
|
57945
58004
|
role: "presentation",
|
|
57946
58005
|
style: { minWidth: "fit-content" }
|
|
57947
58006
|
}, a]
|
|
57948
58007
|
});
|
|
57949
58008
|
});
|
|
57950
|
-
process.env.NODE_ENV !== "production" && (
|
|
58009
|
+
process.env.NODE_ENV !== "production" && (VV.displayName = "ScrollAreaContent");
|
|
57951
58010
|
//#endregion
|
|
57952
58011
|
//#region ../../node_modules/@base-ui/react/scroll-area/thumb/ScrollAreaThumb.mjs
|
|
57953
|
-
var
|
|
57954
|
-
let { render: n, className: r, style: i, ...a } = e, { thumbYRef: o, thumbXRef: s, handlePointerDown: c, handlePointerMove: l, handlePointerUp: u, setScrollingX: d, setScrollingY: f, scrollingX: p, scrollingY: m, hasMeasuredScrollbar: h } =
|
|
58012
|
+
var HV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58013
|
+
let { render: n, className: r, style: i, ...a } = e, { thumbYRef: o, thumbXRef: s, handlePointerDown: c, handlePointerMove: l, handlePointerUp: u, setScrollingX: d, setScrollingY: f, scrollingX: p, scrollingY: m, hasMeasuredScrollbar: h } = lV(), { orientation: g } = RV(), _ = {
|
|
57955
58014
|
scrolling: g === "horizontal" ? p : m,
|
|
57956
58015
|
orientation: g
|
|
57957
58016
|
};
|
|
@@ -57968,17 +58027,17 @@ var zV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57968
58027
|
onPointerCancel: v,
|
|
57969
58028
|
style: {
|
|
57970
58029
|
visibility: h ? void 0 : "hidden",
|
|
57971
|
-
...g === "vertical" && { height: `var(${
|
|
57972
|
-
...g === "horizontal" && { width: `var(${
|
|
58030
|
+
...g === "vertical" && { height: `var(${zV.scrollAreaThumbHeight})` },
|
|
58031
|
+
...g === "horizontal" && { width: `var(${zV.scrollAreaThumbWidth})` }
|
|
57973
58032
|
}
|
|
57974
58033
|
}, a]
|
|
57975
58034
|
});
|
|
57976
58035
|
});
|
|
57977
|
-
process.env.NODE_ENV !== "production" && (
|
|
58036
|
+
process.env.NODE_ENV !== "production" && (HV.displayName = "ScrollAreaThumb");
|
|
57978
58037
|
//#endregion
|
|
57979
58038
|
//#region ../../node_modules/@base-ui/react/scroll-area/corner/ScrollAreaCorner.mjs
|
|
57980
|
-
var
|
|
57981
|
-
let { render: n, className: r, style: i, ...a } = e, { cornerRef: o, cornerSize: s, hiddenState: c } =
|
|
58039
|
+
var UV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58040
|
+
let { render: n, className: r, style: i, ...a } = e, { cornerRef: o, cornerSize: s, hiddenState: c } = lV(), l = Lc("div", e, {
|
|
57982
58041
|
ref: [t, o],
|
|
57983
58042
|
props: [{ style: {
|
|
57984
58043
|
position: "absolute",
|
|
@@ -57990,52 +58049,52 @@ var BV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57990
58049
|
});
|
|
57991
58050
|
return c.corner ? null : l;
|
|
57992
58051
|
});
|
|
57993
|
-
process.env.NODE_ENV !== "production" && (
|
|
58052
|
+
process.env.NODE_ENV !== "production" && (UV.displayName = "ScrollAreaCorner");
|
|
57994
58053
|
//#endregion
|
|
57995
58054
|
//#region src/components/ui/scroll-area.tsx
|
|
57996
|
-
var
|
|
58055
|
+
var WV = y.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ H(wV, {
|
|
57997
58056
|
ref: r,
|
|
57998
58057
|
className: U("relative overflow-hidden", e),
|
|
57999
58058
|
...n,
|
|
58000
58059
|
children: [
|
|
58001
|
-
/* @__PURE__ */ V(
|
|
58060
|
+
/* @__PURE__ */ V(PV, {
|
|
58002
58061
|
className: "h-full w-full rounded-[inherit]",
|
|
58003
58062
|
children: t
|
|
58004
58063
|
}),
|
|
58005
|
-
/* @__PURE__ */ V(
|
|
58006
|
-
/* @__PURE__ */ V(
|
|
58064
|
+
/* @__PURE__ */ V(GV, {}),
|
|
58065
|
+
/* @__PURE__ */ V(UV, {})
|
|
58007
58066
|
]
|
|
58008
58067
|
}));
|
|
58009
|
-
|
|
58010
|
-
var
|
|
58068
|
+
WV.displayName = "ScrollArea";
|
|
58069
|
+
var GV = y.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r) => /* @__PURE__ */ V(BV, {
|
|
58011
58070
|
ref: r,
|
|
58012
58071
|
orientation: t,
|
|
58013
58072
|
className: U("flex touch-none select-none transition-colors", t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]", t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]", e),
|
|
58014
58073
|
...n,
|
|
58015
|
-
children: /* @__PURE__ */ V(
|
|
58074
|
+
children: /* @__PURE__ */ V(HV, { className: "relative flex-1 rounded-full bg-border" })
|
|
58016
58075
|
}));
|
|
58017
|
-
|
|
58076
|
+
GV.displayName = "ScrollBar";
|
|
58018
58077
|
//#endregion
|
|
58019
58078
|
//#region ../../node_modules/@base-ui/react/select/root/SelectRootContext.mjs
|
|
58020
|
-
var
|
|
58021
|
-
process.env.NODE_ENV !== "production" && (
|
|
58022
|
-
var
|
|
58023
|
-
process.env.NODE_ENV !== "production" && (
|
|
58024
|
-
function
|
|
58025
|
-
let e = y.useContext(
|
|
58079
|
+
var KV = /* @__PURE__ */ y.createContext(null);
|
|
58080
|
+
process.env.NODE_ENV !== "production" && (KV.displayName = "SelectRootContext");
|
|
58081
|
+
var qV = /* @__PURE__ */ y.createContext(null);
|
|
58082
|
+
process.env.NODE_ENV !== "production" && (qV.displayName = "SelectFloatingContext");
|
|
58083
|
+
function JV() {
|
|
58084
|
+
let e = y.useContext(KV);
|
|
58026
58085
|
if (e === null) throw Error(process.env.NODE_ENV === "production" ? fc(60) : "Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.");
|
|
58027
58086
|
return e;
|
|
58028
58087
|
}
|
|
58029
|
-
function
|
|
58030
|
-
let e = y.useContext(
|
|
58088
|
+
function YV() {
|
|
58089
|
+
let e = y.useContext(qV);
|
|
58031
58090
|
if (e === null) throw Error(process.env.NODE_ENV === "production" ? fc(61) : "Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.");
|
|
58032
58091
|
return e;
|
|
58033
58092
|
}
|
|
58034
58093
|
//#endregion
|
|
58035
58094
|
//#region ../../node_modules/@base-ui/react/field/control/FieldControlDataAttributes.mjs
|
|
58036
|
-
var
|
|
58095
|
+
var XV = /* @__PURE__ */ function(e) {
|
|
58037
58096
|
return e.disabled = "data-disabled", e.valid = "data-valid", e.invalid = "data-invalid", e.touched = "data-touched", e.dirty = "data-dirty", e.filled = "data-filled", e.focused = "data-focused", e;
|
|
58038
|
-
}({}),
|
|
58097
|
+
}({}), ZV = {
|
|
58039
58098
|
badInput: !1,
|
|
58040
58099
|
customError: !1,
|
|
58041
58100
|
patternMismatch: !1,
|
|
@@ -58047,22 +58106,22 @@ var qV = /* @__PURE__ */ function(e) {
|
|
|
58047
58106
|
typeMismatch: !1,
|
|
58048
58107
|
valid: null,
|
|
58049
58108
|
valueMissing: !1
|
|
58050
|
-
},
|
|
58109
|
+
}, QV = {
|
|
58051
58110
|
valid: null,
|
|
58052
58111
|
touched: !1,
|
|
58053
58112
|
dirty: !1,
|
|
58054
58113
|
filled: !1,
|
|
58055
58114
|
focused: !1
|
|
58056
|
-
},
|
|
58115
|
+
}, $V = {
|
|
58057
58116
|
disabled: !1,
|
|
58058
|
-
...
|
|
58059
|
-
},
|
|
58060
|
-
return e === null ? null : e ? { [
|
|
58061
|
-
} },
|
|
58117
|
+
...QV
|
|
58118
|
+
}, eH = { valid(e) {
|
|
58119
|
+
return e === null ? null : e ? { [XV.valid]: "" } : { [XV.invalid]: "" };
|
|
58120
|
+
} }, tH = {
|
|
58062
58121
|
invalid: void 0,
|
|
58063
58122
|
name: void 0,
|
|
58064
58123
|
validityData: {
|
|
58065
|
-
state:
|
|
58124
|
+
state: ZV,
|
|
58066
58125
|
errors: [],
|
|
58067
58126
|
error: "",
|
|
58068
58127
|
value: "",
|
|
@@ -58070,19 +58129,19 @@ var qV = /* @__PURE__ */ function(e) {
|
|
|
58070
58129
|
},
|
|
58071
58130
|
setValidityData: ma,
|
|
58072
58131
|
disabled: void 0,
|
|
58073
|
-
touched:
|
|
58132
|
+
touched: QV.touched,
|
|
58074
58133
|
setTouched: ma,
|
|
58075
|
-
dirty:
|
|
58134
|
+
dirty: QV.dirty,
|
|
58076
58135
|
setDirty: ma,
|
|
58077
|
-
filled:
|
|
58136
|
+
filled: QV.filled,
|
|
58078
58137
|
setFilled: ma,
|
|
58079
|
-
focused:
|
|
58138
|
+
focused: QV.focused,
|
|
58080
58139
|
setFocused: ma,
|
|
58081
58140
|
validate: () => null,
|
|
58082
58141
|
validationMode: "onSubmit",
|
|
58083
58142
|
validationDebounceTime: 0,
|
|
58084
58143
|
shouldValidateOnChange: () => !1,
|
|
58085
|
-
state:
|
|
58144
|
+
state: $V,
|
|
58086
58145
|
markedDirtyRef: { current: !1 },
|
|
58087
58146
|
registerFieldControl: ma,
|
|
58088
58147
|
validation: {
|
|
@@ -58092,17 +58151,17 @@ var qV = /* @__PURE__ */ function(e) {
|
|
|
58092
58151
|
commit: async () => {},
|
|
58093
58152
|
change: ma
|
|
58094
58153
|
}
|
|
58095
|
-
},
|
|
58096
|
-
process.env.NODE_ENV !== "production" && (
|
|
58097
|
-
function
|
|
58098
|
-
let t = y.useContext(
|
|
58154
|
+
}, nH = /* @__PURE__ */ y.createContext(tH);
|
|
58155
|
+
process.env.NODE_ENV !== "production" && (nH.displayName = "FieldRootContext");
|
|
58156
|
+
function rH(e = !0) {
|
|
58157
|
+
let t = y.useContext(nH);
|
|
58099
58158
|
if (t.setValidityData === ma && !e) throw Error(process.env.NODE_ENV === "production" ? fc(28) : "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.");
|
|
58100
58159
|
return t;
|
|
58101
58160
|
}
|
|
58102
58161
|
//#endregion
|
|
58103
58162
|
//#region ../../node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs
|
|
58104
|
-
function
|
|
58105
|
-
let { registerFieldControl: o } =
|
|
58163
|
+
function iH(e, t, n, r, i = !0, a) {
|
|
58164
|
+
let { registerFieldControl: o } = rH(), s = y.useRef(null);
|
|
58106
58165
|
s.current ||= Symbol(), K(() => {
|
|
58107
58166
|
let c = s.current;
|
|
58108
58167
|
return !c || !i ? void 0 : (o(c, {
|
|
@@ -58126,7 +58185,7 @@ function tH(e, t, n, r, i = !0, a) {
|
|
|
58126
58185
|
}
|
|
58127
58186
|
//#endregion
|
|
58128
58187
|
//#region ../../node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs
|
|
58129
|
-
var
|
|
58188
|
+
var aH = /* @__PURE__ */ y.createContext({
|
|
58130
58189
|
controlId: void 0,
|
|
58131
58190
|
registerControlId: ma,
|
|
58132
58191
|
labelId: void 0,
|
|
@@ -58135,14 +58194,14 @@ var nH = /* @__PURE__ */ y.createContext({
|
|
|
58135
58194
|
setMessageIds: ma,
|
|
58136
58195
|
getDescriptionProps: (e) => e
|
|
58137
58196
|
});
|
|
58138
|
-
process.env.NODE_ENV !== "production" && (
|
|
58139
|
-
function
|
|
58140
|
-
return y.useContext(
|
|
58197
|
+
process.env.NODE_ENV !== "production" && (aH.displayName = "LabelableContext");
|
|
58198
|
+
function oH() {
|
|
58199
|
+
return y.useContext(aH);
|
|
58141
58200
|
}
|
|
58142
58201
|
//#endregion
|
|
58143
58202
|
//#region ../../node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
|
|
58144
|
-
function
|
|
58145
|
-
let { id: t, implicit: n = !1, controlRef: r } = e, { controlId: i, registerControlId: a } =
|
|
58203
|
+
function sH(e = {}) {
|
|
58204
|
+
let { id: t, implicit: n = !1, controlRef: r } = e, { controlId: i, registerControlId: a } = oH(), o = kp(t), s = n ? i : void 0, c = ra(() => Symbol("labelable-control")), l = y.useRef(!1), u = y.useRef(t != null), d = J(() => {
|
|
58146
58205
|
!l.current || a === ma || (l.current = !1, a(c.current, void 0));
|
|
58147
58206
|
});
|
|
58148
58207
|
return K(() => {
|
|
@@ -58175,22 +58234,22 @@ function iH(e = {}) {
|
|
|
58175
58234
|
}
|
|
58176
58235
|
//#endregion
|
|
58177
58236
|
//#region ../../node_modules/@base-ui/react/internals/itemEquality.mjs
|
|
58178
|
-
var
|
|
58179
|
-
function
|
|
58237
|
+
var cH = (e, t) => Object.is(e, t);
|
|
58238
|
+
function lH(e, t, n) {
|
|
58180
58239
|
return e == null || t == null ? Object.is(e, t) : n(e, t);
|
|
58181
58240
|
}
|
|
58182
|
-
function
|
|
58183
|
-
return !e || e.length === 0 ? !1 : e.some((e) => e === void 0 ? !1 :
|
|
58241
|
+
function uH(e, t, n) {
|
|
58242
|
+
return !e || e.length === 0 ? !1 : e.some((e) => e === void 0 ? !1 : lH(t, e, n));
|
|
58184
58243
|
}
|
|
58185
|
-
function
|
|
58186
|
-
return !e || e.length === 0 ? -1 : e.findIndex((e) => e === void 0 ? !1 :
|
|
58244
|
+
function dH(e, t, n) {
|
|
58245
|
+
return !e || e.length === 0 ? -1 : e.findIndex((e) => e === void 0 ? !1 : lH(e, t, n));
|
|
58187
58246
|
}
|
|
58188
|
-
function
|
|
58189
|
-
return e.filter((e) => !
|
|
58247
|
+
function fH(e, t, n) {
|
|
58248
|
+
return e.filter((e) => !lH(t, e, n));
|
|
58190
58249
|
}
|
|
58191
58250
|
//#endregion
|
|
58192
58251
|
//#region ../../node_modules/@base-ui/react/internals/serializeValue.mjs
|
|
58193
|
-
function
|
|
58252
|
+
function pH(e) {
|
|
58194
58253
|
if (e == null) return "";
|
|
58195
58254
|
if (typeof e == "string") return e;
|
|
58196
58255
|
try {
|
|
@@ -58201,39 +58260,39 @@ function uH(e) {
|
|
|
58201
58260
|
}
|
|
58202
58261
|
//#endregion
|
|
58203
58262
|
//#region ../../node_modules/@base-ui/react/internals/resolveValueLabel.mjs
|
|
58204
|
-
function
|
|
58263
|
+
function mH(e) {
|
|
58205
58264
|
return e != null && e.length > 0 && typeof e[0] == "object" && e[0] != null && "items" in e[0];
|
|
58206
58265
|
}
|
|
58207
|
-
function
|
|
58266
|
+
function hH(e) {
|
|
58208
58267
|
if (!Array.isArray(e)) return e != null && "null" in e;
|
|
58209
58268
|
let t = e;
|
|
58210
|
-
if (
|
|
58269
|
+
if (mH(t)) {
|
|
58211
58270
|
for (let e of t) for (let t of e.items) if (t && t.value == null && t.label != null) return !0;
|
|
58212
58271
|
return !1;
|
|
58213
58272
|
}
|
|
58214
58273
|
for (let e of t) if (e && e.value == null && e.label != null) return !0;
|
|
58215
58274
|
return !1;
|
|
58216
58275
|
}
|
|
58217
|
-
function
|
|
58276
|
+
function gH(e, t) {
|
|
58218
58277
|
if (t && e != null) return t(e) ?? "";
|
|
58219
58278
|
if (e && typeof e == "object") {
|
|
58220
58279
|
if ("label" in e && e.label != null) return String(e.label);
|
|
58221
58280
|
if ("value" in e) return String(e.value);
|
|
58222
58281
|
}
|
|
58223
|
-
return
|
|
58282
|
+
return pH(e);
|
|
58224
58283
|
}
|
|
58225
|
-
function
|
|
58226
|
-
return t && e != null ? t(e) ?? "" : e && typeof e == "object" && "value" in e && "label" in e ?
|
|
58284
|
+
function _H(e, t) {
|
|
58285
|
+
return t && e != null ? t(e) ?? "" : e && typeof e == "object" && "value" in e && "label" in e ? pH(e.value) : pH(e);
|
|
58227
58286
|
}
|
|
58228
|
-
function
|
|
58287
|
+
function vH(e, t, n) {
|
|
58229
58288
|
function r() {
|
|
58230
|
-
return
|
|
58289
|
+
return gH(e, n);
|
|
58231
58290
|
}
|
|
58232
58291
|
if (n && e != null) return n(e);
|
|
58233
58292
|
if (e && typeof e == "object" && "label" in e && e.label != null) return e.label;
|
|
58234
58293
|
if (t && !Array.isArray(t)) return t[e] ?? r();
|
|
58235
58294
|
if (Array.isArray(t)) {
|
|
58236
|
-
let n = t, i =
|
|
58295
|
+
let n = t, i = mH(n) ? n.flatMap((e) => e.items) : n;
|
|
58237
58296
|
if (typeof e != "object" || !e) {
|
|
58238
58297
|
let t = i.find((t) => t.value === e);
|
|
58239
58298
|
return t && t.label != null ? t.label : r();
|
|
@@ -58245,8 +58304,8 @@ function hH(e, t, n) {
|
|
|
58245
58304
|
}
|
|
58246
58305
|
return r();
|
|
58247
58306
|
}
|
|
58248
|
-
function
|
|
58249
|
-
return e.reduce((e, r, i) => (i > 0 && e.push(", "), e.push(/* @__PURE__ */ V(y.Fragment, { children:
|
|
58307
|
+
function yH(e, t, n) {
|
|
58308
|
+
return e.reduce((e, r, i) => (i > 0 && e.push(", "), e.push(/* @__PURE__ */ V(y.Fragment, { children: vH(r, t, n) }, i)), e), []);
|
|
58250
58309
|
}
|
|
58251
58310
|
//#endregion
|
|
58252
58311
|
//#region ../../node_modules/@base-ui/react/select/store.mjs
|
|
@@ -58262,9 +58321,9 @@ var $ = {
|
|
|
58262
58321
|
value: Y((e) => e.value),
|
|
58263
58322
|
hasSelectedValue: Y((e) => {
|
|
58264
58323
|
let { value: t, multiple: n, itemToStringValue: r } = e;
|
|
58265
|
-
return t == null ? !1 : n && Array.isArray(t) ? t.length > 0 :
|
|
58324
|
+
return t == null ? !1 : n && Array.isArray(t) ? t.length > 0 : _H(t, r) !== "";
|
|
58266
58325
|
}),
|
|
58267
|
-
hasNullItemLabel: Y((e, t) => t ?
|
|
58326
|
+
hasNullItemLabel: Y((e, t) => t ? hH(e.items) : !1),
|
|
58268
58327
|
open: Y((e) => e.open),
|
|
58269
58328
|
mounted: Y((e) => e.mounted),
|
|
58270
58329
|
forceMount: Y((e) => e.forceMount),
|
|
@@ -58275,7 +58334,7 @@ var $ = {
|
|
|
58275
58334
|
isActive: Y((e, t) => e.activeIndex === t),
|
|
58276
58335
|
isSelected: Y((e, t) => {
|
|
58277
58336
|
let n = e.isItemEqualToValue, r = e.value;
|
|
58278
|
-
return e.multiple ? Array.isArray(r) && r.some((e) =>
|
|
58337
|
+
return e.multiple ? Array.isArray(r) && r.some((e) => lH(t, e, n)) : lH(t, r, n);
|
|
58279
58338
|
}),
|
|
58280
58339
|
isSelectedByFocus: Y((e, t) => e.selectedIndex === t),
|
|
58281
58340
|
popupProps: Y((e) => e.popupProps),
|
|
@@ -58287,26 +58346,26 @@ var $ = {
|
|
|
58287
58346
|
scrollUpArrowVisible: Y((e) => e.scrollUpArrowVisible),
|
|
58288
58347
|
scrollDownArrowVisible: Y((e) => e.scrollDownArrowVisible),
|
|
58289
58348
|
hasScrollArrows: Y((e) => e.hasScrollArrows)
|
|
58290
|
-
},
|
|
58349
|
+
}, bH = /* @__PURE__ */ y.createContext({
|
|
58291
58350
|
formRef: { current: { fields: /* @__PURE__ */ new Map() } },
|
|
58292
58351
|
errors: {},
|
|
58293
58352
|
clearErrors: ma,
|
|
58294
58353
|
validationMode: "onSubmit",
|
|
58295
58354
|
submitAttemptedRef: { current: !1 }
|
|
58296
58355
|
});
|
|
58297
|
-
process.env.NODE_ENV !== "production" && (
|
|
58298
|
-
function
|
|
58299
|
-
return y.useContext(
|
|
58356
|
+
process.env.NODE_ENV !== "production" && (bH.displayName = "FormContext");
|
|
58357
|
+
function xH() {
|
|
58358
|
+
return y.useContext(bH);
|
|
58300
58359
|
}
|
|
58301
58360
|
//#endregion
|
|
58302
58361
|
//#region ../../node_modules/@base-ui/react/internals/areArraysEqual.mjs
|
|
58303
|
-
function
|
|
58362
|
+
function SH(e, t, n = (e, t) => e === t) {
|
|
58304
58363
|
return e.length === t.length && e.every((e, r) => n(e, t[r]));
|
|
58305
58364
|
}
|
|
58306
58365
|
//#endregion
|
|
58307
58366
|
//#region ../../node_modules/@base-ui/react/select/root/SelectRoot.mjs
|
|
58308
|
-
function
|
|
58309
|
-
let { id: t, value: n, defaultValue: r = null, onValueChange: i, open: a, defaultOpen: o = !1, onOpenChange: s, name: c, form: l, autoComplete: u, disabled: d = !1, readOnly: f = !1, required: p = !1, modal: m = !0, actionsRef: h, inputRef: g, onOpenChangeComplete: _, items: v, multiple: b = !1, itemToStringLabel: x, itemToStringValue: S, isItemEqualToValue: C =
|
|
58367
|
+
function CH(e) {
|
|
58368
|
+
let { id: t, value: n, defaultValue: r = null, onValueChange: i, open: a, defaultOpen: o = !1, onOpenChange: s, name: c, form: l, autoComplete: u, disabled: d = !1, readOnly: f = !1, required: p = !1, modal: m = !0, actionsRef: h, inputRef: g, onOpenChangeComplete: _, items: v, multiple: b = !1, itemToStringLabel: x, itemToStringValue: S, isItemEqualToValue: C = cH, highlightItemOnHover: w = !0, children: T } = e, { clearErrors: E } = xH(), { setDirty: D, setTouched: O, setFocused: k, validityData: A, setFilled: j, name: M, disabled: N, validation: P, validationMode: F } = rH(), I = sH({ id: t }), L = N || d, R = M ?? c, [z, ee] = L_({
|
|
58310
58369
|
controlled: n,
|
|
58311
58370
|
default: b ? r ?? ha : r,
|
|
58312
58371
|
name: "Select",
|
|
@@ -58346,17 +58405,17 @@ function bH(e) {
|
|
|
58346
58405
|
scrollUpArrowVisible: !1,
|
|
58347
58406
|
scrollDownArrowVisible: !1,
|
|
58348
58407
|
hasScrollArrows: !1
|
|
58349
|
-
})).current, ve = X(_e, $.activeIndex), ye = X(_e, $.selectedIndex), be = X(_e, $.triggerElement), xe = X(_e, $.positionerElement), Se = kg(W), Ce = W ?? Se ?? null, we = y.useMemo(() => b ? "" :
|
|
58408
|
+
})).current, ve = X(_e, $.activeIndex), ye = X(_e, $.selectedIndex), be = X(_e, $.triggerElement), xe = X(_e, $.positionerElement), Se = kg(W), Ce = W ?? Se ?? null, we = y.useMemo(() => b ? "" : _H(z, S), [
|
|
58350
58409
|
b,
|
|
58351
58410
|
z,
|
|
58352
58411
|
S
|
|
58353
|
-
]), Te = y.useMemo(() => b && Array.isArray(z) ? z.map((e) =>
|
|
58412
|
+
]), Te = y.useMemo(() => b && Array.isArray(z) ? z.map((e) => _H(e, S)) : _H(z, S), [
|
|
58354
58413
|
b,
|
|
58355
58414
|
z,
|
|
58356
58415
|
S
|
|
58357
58416
|
]);
|
|
58358
|
-
|
|
58359
|
-
let Ee = y.useRef(z), De = b ? Array.isArray(z) && z.length > 0 : z != null &&
|
|
58417
|
+
iH(Do(_e.state.triggerElement), I, z, J(() => Te), !L, c);
|
|
58418
|
+
let Ee = y.useRef(z), De = b ? Array.isArray(z) && z.length > 0 : z != null && _H(z, S) !== "";
|
|
58360
58419
|
K(() => {
|
|
58361
58420
|
z !== Ee.current && _e.set("forceMount", !0);
|
|
58362
58421
|
}, [_e, z]), K(() => {
|
|
@@ -58367,11 +58426,11 @@ function bH(e) {
|
|
|
58367
58426
|
let n = Array.isArray(z) ? z : [];
|
|
58368
58427
|
if (n.length === 0) t = null;
|
|
58369
58428
|
else {
|
|
58370
|
-
let r = n[n.length - 1], i =
|
|
58429
|
+
let r = n[n.length - 1], i = dH(e, r, C);
|
|
58371
58430
|
t = i === -1 ? null : i;
|
|
58372
58431
|
}
|
|
58373
58432
|
} else {
|
|
58374
|
-
let n =
|
|
58433
|
+
let n = dH(e, z, C);
|
|
58375
58434
|
t = n === -1 ? null : n;
|
|
58376
58435
|
}
|
|
58377
58436
|
t === null && (de.current = null), !te && _e.set("selectedIndex", t);
|
|
@@ -58387,7 +58446,7 @@ function bH(e) {
|
|
|
58387
58446
|
]);
|
|
58388
58447
|
function Oe(e) {
|
|
58389
58448
|
let t = A.initialValue;
|
|
58390
|
-
return Array.isArray(e) && Array.isArray(t) ? !
|
|
58449
|
+
return Array.isArray(e) && Array.isArray(t) ? !SH(e, t, (e, t) => lH(e, t, C)) : e !== t;
|
|
58391
58450
|
}
|
|
58392
58451
|
Zp(z, () => {
|
|
58393
58452
|
E(R), D(Oe(z)), P.change(z);
|
|
@@ -58413,7 +58472,7 @@ function bH(e) {
|
|
|
58413
58472
|
}), Me = J(() => {
|
|
58414
58473
|
let e = _e.state.listElement || B.current;
|
|
58415
58474
|
if (!e) return;
|
|
58416
|
-
let t =
|
|
58475
|
+
let t = AV(e.scrollHeight, e.clientHeight), n = jV(e.scrollTop, t), r = n > 0, i = n < t;
|
|
58417
58476
|
_e.state.scrollUpArrowVisible !== r && _e.set("scrollUpArrowVisible", r), _e.state.scrollDownArrowVisible !== i && _e.set("scrollDownArrowVisible", i);
|
|
58418
58477
|
}), Ne = wf({
|
|
58419
58478
|
open: te,
|
|
@@ -58543,7 +58602,7 @@ function bH(e) {
|
|
|
58543
58602
|
_,
|
|
58544
58603
|
Me
|
|
58545
58604
|
]), He = xo(g, P.inputRef), Ue = b && Array.isArray(z) && z.length > 0, We = b ? void 0 : R, Ge = y.useMemo(() => !b || !Array.isArray(z) || !R ? null : z.map((e) => {
|
|
58546
|
-
let t =
|
|
58605
|
+
let t = _H(e, S);
|
|
58547
58606
|
return /* @__PURE__ */ V("input", {
|
|
58548
58607
|
type: "hidden",
|
|
58549
58608
|
form: l,
|
|
@@ -58559,9 +58618,9 @@ function bH(e) {
|
|
|
58559
58618
|
S,
|
|
58560
58619
|
L
|
|
58561
58620
|
]);
|
|
58562
|
-
return /* @__PURE__ */ V(
|
|
58621
|
+
return /* @__PURE__ */ V(KV.Provider, {
|
|
58563
58622
|
value: Ve,
|
|
58564
|
-
children: /* @__PURE__ */ H(
|
|
58623
|
+
children: /* @__PURE__ */ H(qV.Provider, {
|
|
58565
58624
|
value: Ne,
|
|
58566
58625
|
children: [
|
|
58567
58626
|
T,
|
|
@@ -58575,7 +58634,7 @@ function bH(e) {
|
|
|
58575
58634
|
let t = e.currentTarget.value, n = ho($a, e.nativeEvent);
|
|
58576
58635
|
function r() {
|
|
58577
58636
|
if (b) return;
|
|
58578
|
-
let e = t.toLowerCase(), r = ce.current.findIndex((t) =>
|
|
58637
|
+
let e = t.toLowerCase(), r = ce.current.findIndex((t) => _H(t, S).toLowerCase() === e || gH(t, x).toLowerCase() === e);
|
|
58579
58638
|
r === -1 && (r = ce.current.findIndex((t, n) => {
|
|
58580
58639
|
let r = ie.current[n];
|
|
58581
58640
|
return r != null && r.toLowerCase() === e;
|
|
@@ -58607,7 +58666,7 @@ function bH(e) {
|
|
|
58607
58666
|
}
|
|
58608
58667
|
//#endregion
|
|
58609
58668
|
//#region ../../node_modules/@base-ui/react/utils/useRegisteredLabelId.mjs
|
|
58610
|
-
function
|
|
58669
|
+
function wH(e, t) {
|
|
58611
58670
|
let n = kp(e);
|
|
58612
58671
|
return K(() => (t(n), () => {
|
|
58613
58672
|
t(void 0);
|
|
@@ -58615,8 +58674,8 @@ function xH(e, t) {
|
|
|
58615
58674
|
}
|
|
58616
58675
|
//#endregion
|
|
58617
58676
|
//#region ../../node_modules/@base-ui/react/internals/labelable-provider/useLabel.mjs
|
|
58618
|
-
function
|
|
58619
|
-
let { id: t, fallbackControlId: n, native: r = !1, setLabelId: i, focusControl: a } = e, { controlId: o, setLabelId: s } =
|
|
58677
|
+
function TH(e = {}) {
|
|
58678
|
+
let { id: t, fallbackControlId: n, native: r = !1, setLabelId: i, focusControl: a } = e, { controlId: o, setLabelId: s } = oH(), c = wH(t, J((e) => {
|
|
58620
58679
|
s(e), i?.(e);
|
|
58621
58680
|
})), l = o ?? n;
|
|
58622
58681
|
function u(e) {
|
|
@@ -58626,7 +58685,7 @@ function SH(e = {}) {
|
|
|
58626
58685
|
}
|
|
58627
58686
|
if (!l) return;
|
|
58628
58687
|
let t = ta(e.currentTarget).getElementById(l);
|
|
58629
|
-
xi(t) &&
|
|
58688
|
+
xi(t) && EH(t);
|
|
58630
58689
|
}
|
|
58631
58690
|
function d(e) {
|
|
58632
58691
|
za(e.nativeEvent)?.closest("button,input,select,textarea") || (!e.defaultPrevented && e.detail > 1 && e.preventDefault(), !r && u(e));
|
|
@@ -58643,24 +58702,24 @@ function SH(e = {}) {
|
|
|
58643
58702
|
}
|
|
58644
58703
|
};
|
|
58645
58704
|
}
|
|
58646
|
-
function
|
|
58705
|
+
function EH(e) {
|
|
58647
58706
|
e.focus({ focusVisible: !0 });
|
|
58648
58707
|
}
|
|
58649
58708
|
//#endregion
|
|
58650
58709
|
//#region ../../node_modules/@base-ui/react/utils/resolveAriaLabelledBy.mjs
|
|
58651
|
-
function
|
|
58710
|
+
function DH(e) {
|
|
58652
58711
|
return e == null ? void 0 : `${e}-label`;
|
|
58653
58712
|
}
|
|
58654
|
-
function
|
|
58713
|
+
function OH(e, t) {
|
|
58655
58714
|
return e ?? t;
|
|
58656
58715
|
}
|
|
58657
58716
|
//#endregion
|
|
58658
58717
|
//#region ../../node_modules/@base-ui/react/select/label/SelectLabel.mjs
|
|
58659
|
-
var
|
|
58718
|
+
var kH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58660
58719
|
let { render: n, className: r, style: i, ...a } = e, o = a;
|
|
58661
58720
|
delete o.id;
|
|
58662
|
-
let s =
|
|
58663
|
-
id:
|
|
58721
|
+
let s = rH(), { store: c } = JV(), l = X(c, $.triggerElement), u = X(c, $.id), d = TH({
|
|
58722
|
+
id: DH(u),
|
|
58664
58723
|
fallbackControlId: l?.id ?? u,
|
|
58665
58724
|
setLabelId(e) {
|
|
58666
58725
|
c.set("labelId", e);
|
|
@@ -58670,20 +58729,20 @@ var EH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
58670
58729
|
ref: t,
|
|
58671
58730
|
state: s.state,
|
|
58672
58731
|
props: [d, a],
|
|
58673
|
-
stateAttributesMapping:
|
|
58732
|
+
stateAttributesMapping: eH
|
|
58674
58733
|
});
|
|
58675
58734
|
});
|
|
58676
|
-
process.env.NODE_ENV !== "production" && (
|
|
58735
|
+
process.env.NODE_ENV !== "production" && (kH.displayName = "SelectLabel");
|
|
58677
58736
|
//#endregion
|
|
58678
58737
|
//#region ../../node_modules/@base-ui/react/select/trigger/SelectTrigger.mjs
|
|
58679
|
-
var
|
|
58738
|
+
var AH = 2, jH = 400, MH = {
|
|
58680
58739
|
...gp,
|
|
58681
|
-
...
|
|
58740
|
+
...eH,
|
|
58682
58741
|
popupSide: (e) => e ? { "data-popup-side": e } : null,
|
|
58683
58742
|
value: () => null
|
|
58684
|
-
},
|
|
58685
|
-
let { render: n, className: r, id: i, disabled: a = !1, nativeButton: o = !0, style: s, ...c } = e, { setTouched: l, setFocused: u, validationMode: d, state: f, disabled: p } =
|
|
58686
|
-
|
|
58743
|
+
}, NH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58744
|
+
let { render: n, className: r, id: i, disabled: a = !1, nativeButton: o = !0, style: s, ...c } = e, { setTouched: l, setFocused: u, validationMode: d, state: f, disabled: p } = rH(), { labelId: m } = oH(), { store: h, setOpen: g, selectionRef: _, validation: v, readOnly: b, required: x, alignItemWithTriggerActiveRef: S, disabled: C } = JV(), w = p || C || a, T = X(h, $.open), E = X(h, $.mounted), D = X(h, $.value), O = X(h, $.triggerProps), k = X(h, $.positionerElement), A = X(h, $.listElement), j = X(h, $.popupSide), M = X(h, $.id), N = X(h, $.labelId), P = X(h, $.hasSelectedValue), F = E && k ? j : null, I = i ?? M, L = OH(m, N);
|
|
58745
|
+
sH({ id: I });
|
|
58687
58746
|
let R = Do(k), z = y.useRef(null), { getButtonProps: ee, buttonRef: te } = Tp({
|
|
58688
58747
|
disabled: w,
|
|
58689
58748
|
native: o
|
|
@@ -58691,7 +58750,7 @@ var DH = 2, OH = 400, kH = {
|
|
|
58691
58750
|
h.set("triggerElement", e);
|
|
58692
58751
|
}), re = ca(), ie = ca(), B = ca();
|
|
58693
58752
|
y.useEffect(() => {
|
|
58694
|
-
if (T) return B.start(
|
|
58753
|
+
if (T) return B.start(jH, () => {
|
|
58695
58754
|
_.current.allowUnselectedMouseUp = !0, _.current.allowSelectedMouseUp = !0;
|
|
58696
58755
|
}), () => {
|
|
58697
58756
|
B.clear();
|
|
@@ -58733,7 +58792,7 @@ var DH = 2, OH = 400, kH = {
|
|
|
58733
58792
|
let t = e.target;
|
|
58734
58793
|
if (q(z.current, t) || q(R.current, t)) return;
|
|
58735
58794
|
let n = Nv(z.current);
|
|
58736
|
-
e.clientX >= n.left -
|
|
58795
|
+
e.clientX >= n.left - AH && e.clientX <= n.right + AH && e.clientY >= n.top - AH && e.clientY <= n.bottom + AH || g(!1, ho(lo, e));
|
|
58737
58796
|
}
|
|
58738
58797
|
ie.start(0, () => {
|
|
58739
58798
|
t.addEventListener("mouseup", n, { once: !0 });
|
|
@@ -58758,30 +58817,30 @@ var DH = 2, OH = 400, kH = {
|
|
|
58758
58817
|
ne
|
|
58759
58818
|
],
|
|
58760
58819
|
state: se,
|
|
58761
|
-
stateAttributesMapping:
|
|
58820
|
+
stateAttributesMapping: MH,
|
|
58762
58821
|
props: oe
|
|
58763
58822
|
});
|
|
58764
58823
|
});
|
|
58765
|
-
process.env.NODE_ENV !== "production" && (
|
|
58824
|
+
process.env.NODE_ENV !== "production" && (NH.displayName = "SelectTrigger");
|
|
58766
58825
|
//#endregion
|
|
58767
58826
|
//#region ../../node_modules/@base-ui/react/select/value/SelectValue.mjs
|
|
58768
|
-
var
|
|
58769
|
-
let { className: n, render: r, children: i, placeholder: a, style: o, ...s } = e, { store: c, valueRef: l } =
|
|
58827
|
+
var PH = { value: () => null }, FH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58828
|
+
let { className: n, render: r, children: i, placeholder: a, style: o, ...s } = e, { store: c, valueRef: l } = JV(), u = X(c, $.value), d = X(c, $.items), f = X(c, $.itemToStringLabel), p = X(c, $.hasSelectedValue), m = !p && a != null && i == null, h = X(c, $.hasNullItemLabel, m), g = {
|
|
58770
58829
|
value: u,
|
|
58771
58830
|
placeholder: !p
|
|
58772
58831
|
}, _ = null;
|
|
58773
|
-
return _ = typeof i == "function" ? i(u) : i ?? (!p && a != null && !h ? a : Array.isArray(u) ?
|
|
58832
|
+
return _ = typeof i == "function" ? i(u) : i ?? (!p && a != null && !h ? a : Array.isArray(u) ? yH(u, d, f) : vH(u, d, f)), Lc("span", e, {
|
|
58774
58833
|
state: g,
|
|
58775
58834
|
ref: [t, l],
|
|
58776
58835
|
props: [{ children: _ }, s],
|
|
58777
|
-
stateAttributesMapping:
|
|
58836
|
+
stateAttributesMapping: PH
|
|
58778
58837
|
});
|
|
58779
58838
|
});
|
|
58780
|
-
process.env.NODE_ENV !== "production" && (
|
|
58839
|
+
process.env.NODE_ENV !== "production" && (FH.displayName = "SelectValue");
|
|
58781
58840
|
//#endregion
|
|
58782
58841
|
//#region ../../node_modules/@base-ui/react/select/icon/SelectIcon.mjs
|
|
58783
|
-
var
|
|
58784
|
-
let { render: n, className: r, style: i, ...a } = e, { store: o } =
|
|
58842
|
+
var IH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58843
|
+
let { render: n, className: r, style: i, ...a } = e, { store: o } = JV();
|
|
58785
58844
|
return Lc("span", e, {
|
|
58786
58845
|
state: { open: X(o, $.open) },
|
|
58787
58846
|
ref: t,
|
|
@@ -58792,16 +58851,16 @@ var NH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
58792
58851
|
stateAttributesMapping: hp
|
|
58793
58852
|
});
|
|
58794
58853
|
});
|
|
58795
|
-
process.env.NODE_ENV !== "production" && (
|
|
58854
|
+
process.env.NODE_ENV !== "production" && (IH.displayName = "SelectIcon");
|
|
58796
58855
|
//#endregion
|
|
58797
58856
|
//#region ../../node_modules/@base-ui/react/select/portal/SelectPortalContext.mjs
|
|
58798
|
-
var
|
|
58799
|
-
process.env.NODE_ENV !== "production" && (
|
|
58857
|
+
var LH = /* @__PURE__ */ y.createContext(void 0);
|
|
58858
|
+
process.env.NODE_ENV !== "production" && (LH.displayName = "SelectPortalContext");
|
|
58800
58859
|
//#endregion
|
|
58801
58860
|
//#region ../../node_modules/@base-ui/react/select/portal/SelectPortal.mjs
|
|
58802
|
-
var
|
|
58803
|
-
let { store: n } =
|
|
58804
|
-
return r || i ? /* @__PURE__ */ V(
|
|
58861
|
+
var RH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58862
|
+
let { store: n } = JV(), r = X(n, $.mounted), i = X(n, $.forceMount);
|
|
58863
|
+
return r || i ? /* @__PURE__ */ V(LH.Provider, {
|
|
58805
58864
|
value: !0,
|
|
58806
58865
|
children: /* @__PURE__ */ V(tl, {
|
|
58807
58866
|
ref: t,
|
|
@@ -58809,14 +58868,14 @@ var FH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
58809
58868
|
})
|
|
58810
58869
|
}) : null;
|
|
58811
58870
|
});
|
|
58812
|
-
process.env.NODE_ENV !== "production" && (
|
|
58871
|
+
process.env.NODE_ENV !== "production" && (RH.displayName = "SelectPortal");
|
|
58813
58872
|
//#endregion
|
|
58814
58873
|
//#region ../../node_modules/@base-ui/react/select/backdrop/SelectBackdrop.mjs
|
|
58815
|
-
var
|
|
58874
|
+
var zH = {
|
|
58816
58875
|
..._p,
|
|
58817
58876
|
...Zd
|
|
58818
|
-
},
|
|
58819
|
-
let { render: n, className: r, style: i, ...a } = e, { store: o } =
|
|
58877
|
+
}, BH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58878
|
+
let { render: n, className: r, style: i, ...a } = e, { store: o } = JV(), s = X(o, $.open), c = X(o, $.mounted);
|
|
58820
58879
|
return Lc("div", e, {
|
|
58821
58880
|
state: {
|
|
58822
58881
|
open: s,
|
|
@@ -58831,31 +58890,31 @@ var IH = {
|
|
|
58831
58890
|
WebkitUserSelect: "none"
|
|
58832
58891
|
}
|
|
58833
58892
|
}, a],
|
|
58834
|
-
stateAttributesMapping:
|
|
58893
|
+
stateAttributesMapping: zH
|
|
58835
58894
|
});
|
|
58836
58895
|
});
|
|
58837
|
-
process.env.NODE_ENV !== "production" && (
|
|
58896
|
+
process.env.NODE_ENV !== "production" && (BH.displayName = "SelectBackdrop");
|
|
58838
58897
|
//#endregion
|
|
58839
58898
|
//#region ../../node_modules/@base-ui/react/select/positioner/SelectPositionerContext.mjs
|
|
58840
|
-
var
|
|
58841
|
-
process.env.NODE_ENV !== "production" && (
|
|
58842
|
-
function
|
|
58843
|
-
let e = y.useContext(
|
|
58899
|
+
var VH = /* @__PURE__ */ y.createContext(void 0);
|
|
58900
|
+
process.env.NODE_ENV !== "production" && (VH.displayName = "SelectPositionerContext");
|
|
58901
|
+
function HH() {
|
|
58902
|
+
let e = y.useContext(VH);
|
|
58844
58903
|
if (!e) throw Error(process.env.NODE_ENV === "production" ? fc(59) : "Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.");
|
|
58845
58904
|
return e;
|
|
58846
58905
|
}
|
|
58847
58906
|
//#endregion
|
|
58848
58907
|
//#region ../../node_modules/@base-ui/react/select/popup/utils.mjs
|
|
58849
|
-
function
|
|
58908
|
+
function UH(e, t) {
|
|
58850
58909
|
e && Object.assign(e.style, t);
|
|
58851
58910
|
}
|
|
58852
|
-
var
|
|
58911
|
+
var WH = {
|
|
58853
58912
|
position: "relative",
|
|
58854
58913
|
maxHeight: "100%",
|
|
58855
58914
|
overflowX: "hidden",
|
|
58856
58915
|
overflowY: "auto"
|
|
58857
|
-
},
|
|
58858
|
-
let { anchor: n, positionMethod: r = "absolute", className: i, render: a, side: o = "bottom", align: s = "center", sideOffset: c = 0, alignOffset: l = 0, collisionBoundary: u = "clipping-ancestors", collisionPadding: d, arrowPadding: f = 5, sticky: p = !1, disableAnchorTracking: m, alignItemWithTrigger: h = !0, collisionAvoidance: g = Jc, style: _, ...v } = e, { store: b, listRef: x, labelsRef: S, alignItemWithTriggerActiveRef: C, selectedItemTextRef: w, valuesRef: T, initialValueRef: E, popupRef: D, setValue: O } =
|
|
58916
|
+
}, GH = { position: "fixed" }, KH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58917
|
+
let { anchor: n, positionMethod: r = "absolute", className: i, render: a, side: o = "bottom", align: s = "center", sideOffset: c = 0, alignOffset: l = 0, collisionBoundary: u = "clipping-ancestors", collisionPadding: d, arrowPadding: f = 5, sticky: p = !1, disableAnchorTracking: m, alignItemWithTrigger: h = !0, collisionAvoidance: g = Jc, style: _, ...v } = e, { store: b, listRef: x, labelsRef: S, alignItemWithTriggerActiveRef: C, selectedItemTextRef: w, valuesRef: T, initialValueRef: E, popupRef: D, setValue: O } = JV(), k = YV(), A = X(b, $.open), j = X(b, $.mounted), M = X(b, $.modal), N = X(b, $.value), P = X(b, $.openMethod), F = X(b, $.positionerElement), I = X(b, $.triggerElement), L = X(b, $.isItemEqualToValue), R = X(b, $.transitionStatus), z = y.useRef(null), ee = y.useRef(null), [te, ne] = y.useState(h), re = j && te && P !== "touch";
|
|
58859
58918
|
!j && te !== h && ne(h), K(() => {
|
|
58860
58919
|
j || ($.scrollUpArrowVisible(b.state) && b.set("scrollUpArrowVisible", !1), $.scrollDownArrowVisible(b.state) && b.set("scrollDownArrowVisible", !1));
|
|
58861
58920
|
}, [b, j]), y.useImperativeHandle(C, () => re), gv((re || M) && A, P === "touch", F, I);
|
|
@@ -58875,7 +58934,7 @@ var VH = {
|
|
|
58875
58934
|
disableAnchorTracking: m ?? re,
|
|
58876
58935
|
collisionAvoidance: g,
|
|
58877
58936
|
keepMounted: !0
|
|
58878
|
-
}), B = re ? "none" : ie.side, ae = re ?
|
|
58937
|
+
}), B = re ? "none" : ie.side, ae = re ? GH : ie.positionerStyles, oe = {
|
|
58879
58938
|
open: A,
|
|
58880
58939
|
side: B,
|
|
58881
58940
|
align: ie.align,
|
|
@@ -58898,13 +58957,13 @@ var VH = {
|
|
|
58898
58957
|
let t = ce.current;
|
|
58899
58958
|
if (ce.current = e.size, e.size === t) return;
|
|
58900
58959
|
let n = ho($a);
|
|
58901
|
-
if (t !== 0 && !b.state.multiple && N !== null &&
|
|
58902
|
-
let e = E.current, t = e != null &&
|
|
58960
|
+
if (t !== 0 && !b.state.multiple && N !== null && dH(T.current, N, L) === -1) {
|
|
58961
|
+
let e = E.current, t = e != null && dH(T.current, e, L) !== -1 ? e : null;
|
|
58903
58962
|
O(t, n), t === null && (b.set("selectedIndex", null), w.current = null);
|
|
58904
58963
|
}
|
|
58905
58964
|
if (t !== 0 && b.state.multiple && Array.isArray(N)) {
|
|
58906
|
-
let e = (e) =>
|
|
58907
|
-
(t.length !== N.length || t.some((e) => !
|
|
58965
|
+
let e = (e) => dH(T.current, e, L) !== -1, t = N.filter((t) => e(t));
|
|
58966
|
+
(t.length !== N.length || t.some((e) => !uH(N, e, L))) && (O(t, n), t.length === 0 && (b.set("selectedIndex", null), w.current = null));
|
|
58908
58967
|
}
|
|
58909
58968
|
if (A && re) {
|
|
58910
58969
|
b.update({
|
|
@@ -58912,7 +58971,7 @@ var VH = {
|
|
|
58912
58971
|
scrollDownArrowVisible: !1
|
|
58913
58972
|
});
|
|
58914
58973
|
let e = { height: "" };
|
|
58915
|
-
|
|
58974
|
+
UH(F, e), UH(D.current, e);
|
|
58916
58975
|
}
|
|
58917
58976
|
}), ue = y.useMemo(() => ({
|
|
58918
58977
|
...ie,
|
|
@@ -58931,7 +58990,7 @@ var VH = {
|
|
|
58931
58990
|
elementsRef: x,
|
|
58932
58991
|
labelsRef: S,
|
|
58933
58992
|
onMapChange: le,
|
|
58934
|
-
children: /* @__PURE__ */ H(
|
|
58993
|
+
children: /* @__PURE__ */ H(VH.Provider, {
|
|
58935
58994
|
value: ue,
|
|
58936
58995
|
children: [j && M && /* @__PURE__ */ V(qp, {
|
|
58937
58996
|
inert: Kp(!A),
|
|
@@ -58940,14 +58999,14 @@ var VH = {
|
|
|
58940
58999
|
})
|
|
58941
59000
|
});
|
|
58942
59001
|
});
|
|
58943
|
-
process.env.NODE_ENV !== "production" && (
|
|
59002
|
+
process.env.NODE_ENV !== "production" && (KH.displayName = "SelectPositioner");
|
|
58944
59003
|
//#endregion
|
|
58945
59004
|
//#region ../../node_modules/@base-ui/react/select/popup/SelectPopup.mjs
|
|
58946
|
-
var
|
|
59005
|
+
var qH = {
|
|
58947
59006
|
..._p,
|
|
58948
59007
|
...Zd
|
|
58949
|
-
},
|
|
58950
|
-
let { render: n, className: r, style: i, finalFocus: a, ...o } = e, { store: s, popupRef: c, onOpenChangeComplete: l, setOpen: u, valueRef: d, firstItemTextRef: f, selectedItemTextRef: p, multiple: m, handleScrollArrowVisibility: h, scrollHandlerRef: g, listRef: _, highlightItemOnHover: v } =
|
|
59008
|
+
}, JH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59009
|
+
let { render: n, className: r, style: i, finalFocus: a, ...o } = e, { store: s, popupRef: c, onOpenChangeComplete: l, setOpen: u, valueRef: d, firstItemTextRef: f, selectedItemTextRef: p, multiple: m, handleScrollArrowVisibility: h, scrollHandlerRef: g, listRef: _, highlightItemOnHover: v } = JV(), { side: b, align: x, alignItemWithTriggerActive: S, isPositioned: C, setControlledAlignItemWithTrigger: w } = HH(), T = av(!0) != null, E = YV(), D = ug(), { nonce: O, disableStyleElements: k } = yV(), A = X(s, $.id), j = X(s, $.open), M = X(s, $.openMethod), N = X(s, $.mounted), P = X(s, $.popupProps), F = X(s, $.transitionStatus), I = X(s, $.triggerElement), L = X(s, $.positionerElement), R = X(s, $.listElement), z = y.useRef(!1), ee = y.useRef(!1), te = y.useRef({}), ne = pa(), re = J((e) => {
|
|
58951
59010
|
if (!L || !c.current || !ee.current) return;
|
|
58952
59011
|
if (z.current || !S) {
|
|
58953
59012
|
h();
|
|
@@ -58958,10 +59017,10 @@ var WH = {
|
|
|
58958
59017
|
h();
|
|
58959
59018
|
return;
|
|
58960
59019
|
}
|
|
58961
|
-
let r =
|
|
59020
|
+
let r = ZH(L), i = QH(L.getBoundingClientRect().height, "y", r), a = ta(L), o = _i(L), s = o.getComputedStyle(L), l = parseFloat(s.marginTop), u = parseFloat(s.marginBottom), d = YH(o.getComputedStyle(c.current)), f = Math.min(a.documentElement.clientHeight - l - u, d), p = e.scrollTop, m = XH(e), g = 0, _ = null, v = !1, y = !1, b = (e) => {
|
|
58962
59021
|
L.style.height = `${e}px`;
|
|
58963
59022
|
}, x = (t, n) => {
|
|
58964
|
-
let r =
|
|
59023
|
+
let r = OV(t, 0, f - i);
|
|
58965
59024
|
r > 0 && b(i + r), e.scrollTop = n, f - (i + r) <= 1 && (z.current = !0), h();
|
|
58966
59025
|
}, C = t ? m - p : p, w = Math.min(i + C, f);
|
|
58967
59026
|
if (g = w, C <= 1) {
|
|
@@ -58969,7 +59028,7 @@ var WH = {
|
|
|
58969
59028
|
return;
|
|
58970
59029
|
}
|
|
58971
59030
|
if (f - w > 1 ? t ? y = !0 : _ = 0 : (v = !0, n && p < m && (_ = p - (C - (i + C - f)))), g = Math.ceil(g), g !== 0 && b(g), y || _ != null) {
|
|
58972
|
-
let t =
|
|
59031
|
+
let t = XH(e), n = y ? t : OV(_, 0, t);
|
|
58973
59032
|
Math.abs(e.scrollTop - n) > 1 && (e.scrollTop = n);
|
|
58974
59033
|
}
|
|
58975
59034
|
(v || g >= f - 1) && (z.current = !0), h();
|
|
@@ -59000,7 +59059,7 @@ var WH = {
|
|
|
59000
59059
|
marginBottom: L.style.marginBottom
|
|
59001
59060
|
});
|
|
59002
59061
|
}, [c, L]), K(() => {
|
|
59003
|
-
j || S || (ee.current = !1, z.current = !1,
|
|
59062
|
+
j || S || (ee.current = !1, z.current = !1, UH(L, te.current));
|
|
59004
59063
|
}, [
|
|
59005
59064
|
j,
|
|
59006
59065
|
S,
|
|
@@ -59013,34 +59072,34 @@ var WH = {
|
|
|
59013
59072
|
ee.current = !0, ne.request(h), e.style.removeProperty("--transform-origin");
|
|
59014
59073
|
return;
|
|
59015
59074
|
}
|
|
59016
|
-
let t =
|
|
59075
|
+
let t = tU(e);
|
|
59017
59076
|
e.style.removeProperty("--transform-origin");
|
|
59018
59077
|
try {
|
|
59019
59078
|
let t = p.current;
|
|
59020
59079
|
t?.isConnected || (t = !$.hasSelectedValue(s.state) && f.current?.isConnected ? f.current : null);
|
|
59021
|
-
let n = d.current, r = _i(L), i = r.getComputedStyle(L), a = r.getComputedStyle(e), o = ta(I), c =
|
|
59080
|
+
let n = d.current, r = _i(L), i = r.getComputedStyle(L), a = r.getComputedStyle(e), o = ta(I), c = ZH(I), l = $H(I.getBoundingClientRect(), c), u = $H(L.getBoundingClientRect(), c), m = l.height, g = R || e, y = g.scrollHeight, b = parseFloat(a.borderBottomWidth), x = parseFloat(i.marginTop) || 10, S = parseFloat(i.marginBottom) || 10, C = parseFloat(i.minHeight) || 100, T = YH(a), E = o.documentElement.clientHeight - x - S, O = o.documentElement.clientWidth, k = E - l.bottom + m, A, j = D === "rtl" ? l.right - u.width : l.left, M = 0;
|
|
59022
59081
|
if (t && n) {
|
|
59023
|
-
let e =
|
|
59024
|
-
A =
|
|
59082
|
+
let e = $H(n.getBoundingClientRect(), c);
|
|
59083
|
+
A = $H(t.getBoundingClientRect(), c), j = u.left + (D === "rtl" ? e.right - A.right : e.left - A.left);
|
|
59025
59084
|
let r = e.top - l.top + e.height / 2;
|
|
59026
59085
|
M = A.top - u.top + A.height / 2 - r;
|
|
59027
59086
|
}
|
|
59028
59087
|
let N = k + M + S + b, P = Math.min(E, N), F = E - x - S, ne = N - P, re = O - 5;
|
|
59029
|
-
L.style.left = `${
|
|
59030
|
-
let ie =
|
|
59088
|
+
L.style.left = `${OV(j, 5, re - u.width)}px`, L.style.height = `${P}px`, L.style.maxHeight = "none", L.style.marginTop = `${x}px`, L.style.marginBottom = `${S}px`, e.style.height = "100%";
|
|
59089
|
+
let ie = XH(g), B = ne >= ie - 1;
|
|
59031
59090
|
B && (P = Math.min(E, u.height) - (ne - ie));
|
|
59032
59091
|
let ae = l.top < 20 || l.bottom > E - 20 || Math.ceil(P) + 1 < Math.min(y, C), oe = (r.visualViewport?.scale ?? 1) !== 1 && Qi;
|
|
59033
59092
|
if (ae || oe) {
|
|
59034
|
-
ee.current = !0,
|
|
59093
|
+
ee.current = !0, UH(L, te.current), w(!1);
|
|
59035
59094
|
return;
|
|
59036
59095
|
}
|
|
59037
59096
|
let se = Math.max(C, P);
|
|
59038
59097
|
if (B) {
|
|
59039
59098
|
let e = Math.max(0, E - N);
|
|
59040
|
-
L.style.top = u.height >= F ? "0" : `${e}px`, L.style.height = `${P}px`, g.scrollTop =
|
|
59099
|
+
L.style.top = u.height >= F ? "0" : `${e}px`, L.style.height = `${P}px`, g.scrollTop = XH(g);
|
|
59041
59100
|
} else L.style.bottom = "0", g.scrollTop = ne;
|
|
59042
59101
|
if (A) {
|
|
59043
|
-
let t = u.top, n = u.height, r = A.top + A.height / 2, i =
|
|
59102
|
+
let t = u.top, n = u.height, r = A.top + A.height / 2, i = OV(n > 0 ? (r - t) / n * 100 : 50, 0, 100);
|
|
59044
59103
|
e.style.setProperty("--transform-origin", `50% ${i}%`);
|
|
59045
59104
|
}
|
|
59046
59105
|
(se === E || P >= T) && (z.current = !0), h(), v && s.state.selectedIndex === null && s.state.activeIndex === null && _.current[0] != null && s.set("activeIndex", 0), ee.current = !0;
|
|
@@ -59093,20 +59152,20 @@ var WH = {
|
|
|
59093
59152
|
onScroll(e) {
|
|
59094
59153
|
R || re(e.currentTarget);
|
|
59095
59154
|
},
|
|
59096
|
-
...S && { style: R ? { height: "100%" } :
|
|
59155
|
+
...S && { style: R ? { height: "100%" } : WH }
|
|
59097
59156
|
}, ae = Lc("div", e, {
|
|
59098
59157
|
ref: [t, c],
|
|
59099
59158
|
state: ie,
|
|
59100
|
-
stateAttributesMapping:
|
|
59159
|
+
stateAttributesMapping: qH,
|
|
59101
59160
|
props: [
|
|
59102
59161
|
P,
|
|
59103
59162
|
B,
|
|
59104
59163
|
xg(F),
|
|
59105
|
-
{ className: !R && S ?
|
|
59164
|
+
{ className: !R && S ? mV.className : void 0 },
|
|
59106
59165
|
o
|
|
59107
59166
|
]
|
|
59108
59167
|
});
|
|
59109
|
-
return /* @__PURE__ */ H(y.Fragment, { children: [!k &&
|
|
59168
|
+
return /* @__PURE__ */ H(y.Fragment, { children: [!k && mV.getElement(O), /* @__PURE__ */ V(bl, {
|
|
59110
59169
|
context: E,
|
|
59111
59170
|
modal: !1,
|
|
59112
59171
|
disabled: !N,
|
|
@@ -59116,38 +59175,38 @@ var WH = {
|
|
|
59116
59175
|
children: ae
|
|
59117
59176
|
})] });
|
|
59118
59177
|
});
|
|
59119
|
-
process.env.NODE_ENV !== "production" && (
|
|
59120
|
-
function
|
|
59178
|
+
process.env.NODE_ENV !== "production" && (JH.displayName = "SelectPopup");
|
|
59179
|
+
function YH(e) {
|
|
59121
59180
|
let t = e.maxHeight || "";
|
|
59122
59181
|
return t.endsWith("px") && parseFloat(t) || Infinity;
|
|
59123
59182
|
}
|
|
59124
|
-
function
|
|
59125
|
-
return
|
|
59183
|
+
function XH(e) {
|
|
59184
|
+
return AV(e.scrollHeight, e.clientHeight);
|
|
59126
59185
|
}
|
|
59127
|
-
function
|
|
59186
|
+
function ZH(e) {
|
|
59128
59187
|
return mu.getScale(e);
|
|
59129
59188
|
}
|
|
59130
|
-
function
|
|
59189
|
+
function QH(e, t, n) {
|
|
59131
59190
|
return e / n[t];
|
|
59132
59191
|
}
|
|
59133
|
-
function
|
|
59192
|
+
function $H(e, t) {
|
|
59134
59193
|
return ds({
|
|
59135
|
-
x:
|
|
59136
|
-
y:
|
|
59137
|
-
width:
|
|
59138
|
-
height:
|
|
59194
|
+
x: QH(e.x, "x", t),
|
|
59195
|
+
y: QH(e.y, "y", t),
|
|
59196
|
+
width: QH(e.width, "x", t),
|
|
59197
|
+
height: QH(e.height, "y", t)
|
|
59139
59198
|
});
|
|
59140
59199
|
}
|
|
59141
|
-
var
|
|
59200
|
+
var eU = [
|
|
59142
59201
|
["transform", "none"],
|
|
59143
59202
|
["scale", "1"],
|
|
59144
59203
|
["translate", "0 0"]
|
|
59145
59204
|
];
|
|
59146
|
-
function
|
|
59205
|
+
function tU(e) {
|
|
59147
59206
|
let { style: t } = e, n = {};
|
|
59148
|
-
for (let [e, r] of
|
|
59207
|
+
for (let [e, r] of eU) n[e] = t.getPropertyValue(e), t.setProperty(e, r, "important");
|
|
59149
59208
|
return () => {
|
|
59150
|
-
for (let [e] of
|
|
59209
|
+
for (let [e] of eU) {
|
|
59151
59210
|
let r = n[e];
|
|
59152
59211
|
r ? t.setProperty(e, r) : t.removeProperty(e);
|
|
59153
59212
|
}
|
|
@@ -59155,16 +59214,16 @@ function QH(e) {
|
|
|
59155
59214
|
}
|
|
59156
59215
|
//#endregion
|
|
59157
59216
|
//#region ../../node_modules/@base-ui/react/select/list/SelectList.mjs
|
|
59158
|
-
var
|
|
59159
|
-
let { render: n, className: r, style: i, ...a } = e, { store: o, scrollHandlerRef: s } =
|
|
59217
|
+
var nU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59218
|
+
let { render: n, className: r, style: i, ...a } = e, { store: o, scrollHandlerRef: s } = JV(), { alignItemWithTriggerActive: c } = HH(), l = X(o, $.hasScrollArrows), u = X(o, $.openMethod), d = X(o, $.multiple), f = {
|
|
59160
59219
|
id: `${X(o, $.id)}-list`,
|
|
59161
59220
|
role: "listbox",
|
|
59162
59221
|
"aria-multiselectable": d || void 0,
|
|
59163
59222
|
onScroll(e) {
|
|
59164
59223
|
s.current?.(e.currentTarget);
|
|
59165
59224
|
},
|
|
59166
|
-
...c && { style:
|
|
59167
|
-
className: l && u !== "touch" ?
|
|
59225
|
+
...c && { style: WH },
|
|
59226
|
+
className: l && u !== "touch" ? mV.className : void 0
|
|
59168
59227
|
};
|
|
59169
59228
|
return Lc("div", e, {
|
|
59170
59229
|
ref: [t, J((e) => {
|
|
@@ -59173,24 +59232,24 @@ var $H = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59173
59232
|
props: [f, a]
|
|
59174
59233
|
});
|
|
59175
59234
|
});
|
|
59176
|
-
process.env.NODE_ENV !== "production" && (
|
|
59235
|
+
process.env.NODE_ENV !== "production" && (nU.displayName = "SelectList");
|
|
59177
59236
|
//#endregion
|
|
59178
59237
|
//#region ../../node_modules/@base-ui/react/select/item/SelectItemContext.mjs
|
|
59179
|
-
var
|
|
59180
|
-
process.env.NODE_ENV !== "production" && (
|
|
59181
|
-
function
|
|
59182
|
-
let e = y.useContext(
|
|
59238
|
+
var rU = /* @__PURE__ */ y.createContext(void 0);
|
|
59239
|
+
process.env.NODE_ENV !== "production" && (rU.displayName = "SelectItemContext");
|
|
59240
|
+
function iU() {
|
|
59241
|
+
let e = y.useContext(rU);
|
|
59183
59242
|
if (!e) throw Error(process.env.NODE_ENV === "production" ? fc(57) : "Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.");
|
|
59184
59243
|
return e;
|
|
59185
59244
|
}
|
|
59186
59245
|
//#endregion
|
|
59187
59246
|
//#region ../../node_modules/@base-ui/react/select/item/SelectItem.mjs
|
|
59188
|
-
var
|
|
59247
|
+
var aU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59189
59248
|
let { render: n, className: r, style: i, value: a = null, label: o, disabled: s = !1, nativeButton: c = !1, ...l } = e, u = y.useRef(null), d = q_({
|
|
59190
59249
|
label: o,
|
|
59191
59250
|
textRef: u,
|
|
59192
59251
|
indexGuessBehavior: K_.GuessFromOrder
|
|
59193
|
-
}), { store: f, itemProps: p, setOpen: m, setValue: h, selectionRef: g, typingRef: _, valuesRef: v, multiple: b, selectedItemTextRef: x, disabled: S, readOnly: C } =
|
|
59252
|
+
}), { store: f, itemProps: p, setOpen: m, setValue: h, selectionRef: g, typingRef: _, valuesRef: v, multiple: b, selectedItemTextRef: x, disabled: S, readOnly: C } = JV(), w = X(f, $.isActive, d.index), T = X(f, $.open), E = X(f, $.isSelected, a), D = X(f, $.isSelectedByFocus, d.index), O = X(f, $.isItemEqualToValue), k = d.index, A = k !== -1, j = y.useRef(null);
|
|
59194
59253
|
K(() => {
|
|
59195
59254
|
if (!A) return;
|
|
59196
59255
|
let e = v.current;
|
|
@@ -59205,7 +59264,7 @@ var nU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59205
59264
|
]), K(() => {
|
|
59206
59265
|
if (!A) return;
|
|
59207
59266
|
let e = f.state.value, t = e;
|
|
59208
|
-
b && Array.isArray(e) && (t = e.length > 0 ? e[e.length - 1] : void 0), t !== void 0 &&
|
|
59267
|
+
b && Array.isArray(e) && (t = e.length > 0 ? e[e.length - 1] : void 0), t !== void 0 && lH(a, t, O) && (f.set("selectedIndex", k), u.current && (x.current = u.current));
|
|
59209
59268
|
}, [
|
|
59210
59269
|
A,
|
|
59211
59270
|
k,
|
|
@@ -59230,7 +59289,7 @@ var nU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59230
59289
|
let t = f.state.value;
|
|
59231
59290
|
if (b) {
|
|
59232
59291
|
let n = Array.isArray(t) ? t : [];
|
|
59233
|
-
h(E ?
|
|
59292
|
+
h(E ? fH(n, a, O) : [...n, a], ho(io, e));
|
|
59234
59293
|
} else h(a, ho(io, e)), m(!1, ho(io, e));
|
|
59235
59294
|
}
|
|
59236
59295
|
function z() {
|
|
@@ -59291,24 +59350,24 @@ var nU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59291
59350
|
D,
|
|
59292
59351
|
A
|
|
59293
59352
|
]);
|
|
59294
|
-
return /* @__PURE__ */ V(
|
|
59353
|
+
return /* @__PURE__ */ V(rU.Provider, {
|
|
59295
59354
|
value: ne,
|
|
59296
59355
|
children: te
|
|
59297
59356
|
});
|
|
59298
59357
|
}));
|
|
59299
|
-
process.env.NODE_ENV !== "production" && (
|
|
59358
|
+
process.env.NODE_ENV !== "production" && (aU.displayName = "SelectItem");
|
|
59300
59359
|
//#endregion
|
|
59301
59360
|
//#region ../../node_modules/@base-ui/react/select/item-indicator/SelectItemIndicator.mjs
|
|
59302
|
-
var
|
|
59303
|
-
let n = e.keepMounted ?? !1, { selected: r } =
|
|
59304
|
-
return n || r ? /* @__PURE__ */ V(
|
|
59361
|
+
var oU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59362
|
+
let n = e.keepMounted ?? !1, { selected: r } = iU();
|
|
59363
|
+
return n || r ? /* @__PURE__ */ V(sU, {
|
|
59305
59364
|
...e,
|
|
59306
59365
|
ref: t
|
|
59307
59366
|
}) : null;
|
|
59308
59367
|
});
|
|
59309
|
-
process.env.NODE_ENV !== "production" && (
|
|
59310
|
-
var
|
|
59311
|
-
let { render: n, className: r, style: i, keepMounted: a, ...o } = e, { selected: s } =
|
|
59368
|
+
process.env.NODE_ENV !== "production" && (oU.displayName = "SelectItemIndicator");
|
|
59369
|
+
var sU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef((e, t) => {
|
|
59370
|
+
let { render: n, className: r, style: i, keepMounted: a, ...o } = e, { selected: s } = iU(), c = y.useRef(null), { transitionStatus: l, setMounted: u } = qd(s), d = Lc("span", e, {
|
|
59312
59371
|
ref: [t, c],
|
|
59313
59372
|
state: {
|
|
59314
59373
|
selected: s,
|
|
@@ -59328,11 +59387,11 @@ var iU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef((e, t) => {
|
|
|
59328
59387
|
}
|
|
59329
59388
|
}), d;
|
|
59330
59389
|
}));
|
|
59331
|
-
process.env.NODE_ENV !== "production" && (
|
|
59390
|
+
process.env.NODE_ENV !== "production" && (sU.displayName = "Inner");
|
|
59332
59391
|
//#endregion
|
|
59333
59392
|
//#region ../../node_modules/@base-ui/react/select/item-text/SelectItemText.mjs
|
|
59334
|
-
var
|
|
59335
|
-
let { index: n, textRef: r, selectedByFocus: i, hasRegistered: a } =
|
|
59393
|
+
var cU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59394
|
+
let { index: n, textRef: r, selectedByFocus: i, hasRegistered: a } = iU(), { firstItemTextRef: o, selectedItemTextRef: s } = JV(), { render: c, className: l, style: u, ...d } = e;
|
|
59336
59395
|
return Lc("div", e, {
|
|
59337
59396
|
ref: [
|
|
59338
59397
|
y.useCallback((e) => {
|
|
@@ -59350,14 +59409,14 @@ var aU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59350
59409
|
props: d
|
|
59351
59410
|
});
|
|
59352
59411
|
}));
|
|
59353
|
-
process.env.NODE_ENV !== "production" && (
|
|
59412
|
+
process.env.NODE_ENV !== "production" && (cU.displayName = "SelectItemText");
|
|
59354
59413
|
//#endregion
|
|
59355
59414
|
//#region ../../node_modules/@base-ui/react/select/arrow/SelectArrow.mjs
|
|
59356
|
-
var
|
|
59415
|
+
var lU = {
|
|
59357
59416
|
..._p,
|
|
59358
59417
|
...Zd
|
|
59359
|
-
},
|
|
59360
|
-
let { render: n, className: r, style: i, ...a } = e, { store: o } =
|
|
59418
|
+
}, uU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59419
|
+
let { render: n, className: r, style: i, ...a } = e, { store: o } = JV(), { side: s, align: c, arrowRef: l, arrowStyles: u, arrowUncentered: d, alignItemWithTriggerActive: f } = HH(), p = Lc("div", e, {
|
|
59361
59420
|
state: {
|
|
59362
59421
|
open: X(o, $.open),
|
|
59363
59422
|
side: s,
|
|
@@ -59369,15 +59428,15 @@ var oU = {
|
|
|
59369
59428
|
style: u,
|
|
59370
59429
|
"aria-hidden": !0
|
|
59371
59430
|
}, a],
|
|
59372
|
-
stateAttributesMapping:
|
|
59431
|
+
stateAttributesMapping: lU
|
|
59373
59432
|
});
|
|
59374
59433
|
return f ? null : p;
|
|
59375
59434
|
});
|
|
59376
|
-
process.env.NODE_ENV !== "production" && (
|
|
59435
|
+
process.env.NODE_ENV !== "production" && (uU.displayName = "SelectArrow");
|
|
59377
59436
|
//#endregion
|
|
59378
59437
|
//#region ../../node_modules/@base-ui/react/select/scroll-arrow/SelectScrollArrow.mjs
|
|
59379
|
-
var
|
|
59380
|
-
let { render: n, className: r, style: i, direction: a, keepMounted: o = !1, ...s } = e, c = a === "up", { store: l, popupRef: u, listRef: d, handleScrollArrowVisibility: f, scrollArrowsMountedCountRef: p } =
|
|
59438
|
+
var dU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59439
|
+
let { render: n, className: r, style: i, direction: a, keepMounted: o = !1, ...s } = e, c = a === "up", { store: l, popupRef: u, listRef: d, handleScrollArrowVisibility: f, scrollArrowsMountedCountRef: p } = JV(), { side: m, scrollDownArrowRef: h, scrollUpArrowRef: g } = HH(), _ = X(l, c ? $.scrollUpArrowVisible : $.scrollDownArrowVisible), v = X(l, $.openMethod), y = _ && v !== "touch", b = ca(), x = c ? g : h, { mounted: S, transitionStatus: C, setMounted: w } = qd(y);
|
|
59381
59440
|
K(() => (p.current += 1, l.state.hasScrollArrows || l.set("hasScrollArrows", !0), () => {
|
|
59382
59441
|
p.current = Math.max(0, p.current - 1), p.current === 0 && l.state.hasScrollArrows && l.set("hasScrollArrows", !1);
|
|
59383
59442
|
}), [l, p]), $d({
|
|
@@ -59406,14 +59465,14 @@ var cU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59406
59465
|
let e = l.state.listElement ?? u.current;
|
|
59407
59466
|
if (!e) return;
|
|
59408
59467
|
l.set("activeIndex", null), f();
|
|
59409
|
-
let n =
|
|
59468
|
+
let n = AV(e.scrollHeight, e.clientHeight), r = jV(e.scrollTop, n), i = r === (c ? 0 : n), a = d.current;
|
|
59410
59469
|
if (r !== e.scrollTop && (e.scrollTop = r), a.length === 0 && l.set(c ? "scrollUpArrowVisible" : "scrollDownArrowVisible", !i), i) {
|
|
59411
59470
|
b.clear();
|
|
59412
59471
|
return;
|
|
59413
59472
|
}
|
|
59414
59473
|
if (a.length > 0) {
|
|
59415
59474
|
let t = x.current?.offsetHeight || 0;
|
|
59416
|
-
e.scrollTop =
|
|
59475
|
+
e.scrollTop = fU(a, c, r, e.clientHeight, t, n);
|
|
59417
59476
|
}
|
|
59418
59477
|
b.start(40, t);
|
|
59419
59478
|
}
|
|
@@ -59427,8 +59486,8 @@ var cU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59427
59486
|
});
|
|
59428
59487
|
return S || o ? T : null;
|
|
59429
59488
|
});
|
|
59430
|
-
process.env.NODE_ENV !== "production" && (
|
|
59431
|
-
function
|
|
59489
|
+
process.env.NODE_ENV !== "production" && (dU.displayName = "SelectScrollArrow");
|
|
59490
|
+
function fU(e, t, n, r, i, a) {
|
|
59432
59491
|
if (t) {
|
|
59433
59492
|
let t = 0, r = n + i - 1;
|
|
59434
59493
|
for (let n = 0; n < e.length; n += 1) {
|
|
@@ -59439,7 +59498,7 @@ function lU(e, t, n, r, i, a) {
|
|
|
59439
59498
|
}
|
|
59440
59499
|
}
|
|
59441
59500
|
let o = Math.max(0, t - 1), s = e[o];
|
|
59442
|
-
return o < t && s ?
|
|
59501
|
+
return o < t && s ? jV(s.offsetTop - i, a) : 0;
|
|
59443
59502
|
}
|
|
59444
59503
|
let o = e.length - 1, s = n + r - i + 1;
|
|
59445
59504
|
for (let t = 0; t < e.length; t += 1) {
|
|
@@ -59450,40 +59509,40 @@ function lU(e, t, n, r, i, a) {
|
|
|
59450
59509
|
}
|
|
59451
59510
|
}
|
|
59452
59511
|
let c = Math.min(e.length - 1, o + 1), l = e[c];
|
|
59453
|
-
return c > o && l ?
|
|
59512
|
+
return c > o && l ? jV(l.offsetTop + l.offsetHeight - r + i, a) : a;
|
|
59454
59513
|
}
|
|
59455
59514
|
//#endregion
|
|
59456
59515
|
//#region ../../node_modules/@base-ui/react/select/scroll-down-arrow/SelectScrollDownArrow.mjs
|
|
59457
|
-
var
|
|
59458
|
-
return /* @__PURE__ */ V(
|
|
59516
|
+
var pU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59517
|
+
return /* @__PURE__ */ V(dU, {
|
|
59459
59518
|
...e,
|
|
59460
59519
|
ref: t,
|
|
59461
59520
|
direction: "down"
|
|
59462
59521
|
});
|
|
59463
59522
|
});
|
|
59464
|
-
process.env.NODE_ENV !== "production" && (
|
|
59523
|
+
process.env.NODE_ENV !== "production" && (pU.displayName = "SelectScrollDownArrow");
|
|
59465
59524
|
//#endregion
|
|
59466
59525
|
//#region ../../node_modules/@base-ui/react/select/scroll-up-arrow/SelectScrollUpArrow.mjs
|
|
59467
|
-
var
|
|
59468
|
-
return /* @__PURE__ */ V(
|
|
59526
|
+
var mU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59527
|
+
return /* @__PURE__ */ V(dU, {
|
|
59469
59528
|
...e,
|
|
59470
59529
|
ref: t,
|
|
59471
59530
|
direction: "up"
|
|
59472
59531
|
});
|
|
59473
59532
|
});
|
|
59474
|
-
process.env.NODE_ENV !== "production" && (
|
|
59533
|
+
process.env.NODE_ENV !== "production" && (mU.displayName = "SelectScrollUpArrow");
|
|
59475
59534
|
//#endregion
|
|
59476
59535
|
//#region ../../node_modules/@base-ui/react/select/group/SelectGroupContext.mjs
|
|
59477
|
-
var
|
|
59478
|
-
process.env.NODE_ENV !== "production" && (
|
|
59479
|
-
function
|
|
59480
|
-
let e = y.useContext(
|
|
59536
|
+
var hU = /* @__PURE__ */ y.createContext(void 0);
|
|
59537
|
+
process.env.NODE_ENV !== "production" && (hU.displayName = "SelectGroupContext");
|
|
59538
|
+
function gU() {
|
|
59539
|
+
let e = y.useContext(hU);
|
|
59481
59540
|
if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? fc(56) : "Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>.");
|
|
59482
59541
|
return e;
|
|
59483
59542
|
}
|
|
59484
59543
|
//#endregion
|
|
59485
59544
|
//#region ../../node_modules/@base-ui/react/select/group/SelectGroup.mjs
|
|
59486
|
-
var
|
|
59545
|
+
var _U = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59487
59546
|
let { render: n, className: r, style: i, ...a } = e, [o, s] = y.useState(), c = y.useMemo(() => ({
|
|
59488
59547
|
labelId: o,
|
|
59489
59548
|
setLabelId: s
|
|
@@ -59494,16 +59553,16 @@ var mU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59494
59553
|
"aria-labelledby": o
|
|
59495
59554
|
}, a]
|
|
59496
59555
|
});
|
|
59497
|
-
return /* @__PURE__ */ V(
|
|
59556
|
+
return /* @__PURE__ */ V(hU.Provider, {
|
|
59498
59557
|
value: c,
|
|
59499
59558
|
children: l
|
|
59500
59559
|
});
|
|
59501
59560
|
});
|
|
59502
|
-
process.env.NODE_ENV !== "production" && (
|
|
59561
|
+
process.env.NODE_ENV !== "production" && (_U.displayName = "SelectGroup");
|
|
59503
59562
|
//#endregion
|
|
59504
59563
|
//#region ../../node_modules/@base-ui/react/select/group-label/SelectGroupLabel.mjs
|
|
59505
|
-
var
|
|
59506
|
-
let { render: n, className: r, style: i, id: a, ...o } = e, { setLabelId: s } =
|
|
59564
|
+
var vU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59565
|
+
let { render: n, className: r, style: i, id: a, ...o } = e, { setLabelId: s } = gU(), c = kp(a);
|
|
59507
59566
|
return K(() => {
|
|
59508
59567
|
s(c);
|
|
59509
59568
|
}, [c, s]), Lc("div", e, {
|
|
@@ -59511,12 +59570,12 @@ var hU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59511
59570
|
props: [{ id: c }, o]
|
|
59512
59571
|
});
|
|
59513
59572
|
});
|
|
59514
|
-
process.env.NODE_ENV !== "production" && (
|
|
59573
|
+
process.env.NODE_ENV !== "production" && (vU.displayName = "SelectGroupLabel");
|
|
59515
59574
|
//#endregion
|
|
59516
59575
|
//#region src/components/ui/select.tsx
|
|
59517
|
-
function
|
|
59518
|
-
return /* @__PURE__ */ V(
|
|
59519
|
-
items: t ??
|
|
59576
|
+
function yU({ children: e, items: t, onValueChange: n, ...r }) {
|
|
59577
|
+
return /* @__PURE__ */ V(CH, {
|
|
59578
|
+
items: t ?? DU(e),
|
|
59520
59579
|
onValueChange: (e) => {
|
|
59521
59580
|
e !== null && n?.(e);
|
|
59522
59581
|
},
|
|
@@ -59524,86 +59583,86 @@ function gU({ children: e, items: t, onValueChange: n, ...r }) {
|
|
|
59524
59583
|
children: e
|
|
59525
59584
|
});
|
|
59526
59585
|
}
|
|
59527
|
-
var
|
|
59586
|
+
var bU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(FH, {
|
|
59528
59587
|
ref: n,
|
|
59529
59588
|
className: U("flex flex-1 text-left", e),
|
|
59530
59589
|
...t
|
|
59531
59590
|
}));
|
|
59532
|
-
|
|
59533
|
-
var
|
|
59591
|
+
bU.displayName = "SelectValue";
|
|
59592
|
+
var xU = y.forwardRef(({ className: e, children: t, asChild: n = !1, ...r }, i) => /* @__PURE__ */ H(NH, {
|
|
59534
59593
|
ref: i,
|
|
59535
59594
|
render: lm(n, t),
|
|
59536
59595
|
className: U("flex cursor-pointer h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-disabled:cursor-not-allowed data-disabled:opacity-50 [&>span]:line-clamp-1", e),
|
|
59537
59596
|
...r,
|
|
59538
|
-
children: [t, /* @__PURE__ */ V(
|
|
59597
|
+
children: [t, /* @__PURE__ */ V(IH, { render: /* @__PURE__ */ V(dh, { className: "h-4 w-4 text-muted-foreground" }) })]
|
|
59539
59598
|
}));
|
|
59540
|
-
|
|
59541
|
-
var
|
|
59599
|
+
xU.displayName = "SelectTrigger";
|
|
59600
|
+
var SU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(mU, {
|
|
59542
59601
|
ref: n,
|
|
59543
59602
|
className: U("flex cursor-pointer items-center justify-center py-1", e),
|
|
59544
59603
|
...t,
|
|
59545
59604
|
children: /* @__PURE__ */ V(ph, { className: "h-4 w-4" })
|
|
59546
59605
|
}));
|
|
59547
|
-
|
|
59548
|
-
var
|
|
59606
|
+
SU.displayName = "SelectScrollUpButton";
|
|
59607
|
+
var CU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(pU, {
|
|
59549
59608
|
ref: n,
|
|
59550
59609
|
className: U("flex cursor-pointer items-center justify-center py-1", e),
|
|
59551
59610
|
...t,
|
|
59552
59611
|
children: /* @__PURE__ */ V(dh, { className: "h-4 w-4" })
|
|
59553
59612
|
}));
|
|
59554
|
-
|
|
59555
|
-
var
|
|
59613
|
+
CU.displayName = "SelectScrollDownButton";
|
|
59614
|
+
var wU = y.forwardRef(({ className: e, children: t, position: n = "popper", side: r = "bottom", sideOffset: i = 4, align: a = "center", alignOffset: o = 0, alignItemWithTrigger: s = n === "popper", ...c }, l) => {
|
|
59556
59615
|
let { resolvedTheme: u, theme: d } = Vm();
|
|
59557
|
-
return /* @__PURE__ */ V(
|
|
59616
|
+
return /* @__PURE__ */ V(RH, { children: /* @__PURE__ */ V(KH, {
|
|
59558
59617
|
align: a,
|
|
59559
59618
|
alignOffset: o,
|
|
59560
59619
|
alignItemWithTrigger: s,
|
|
59561
59620
|
className: "z-50",
|
|
59562
59621
|
side: r,
|
|
59563
59622
|
sideOffset: i,
|
|
59564
|
-
children: /* @__PURE__ */ H(
|
|
59623
|
+
children: /* @__PURE__ */ H(JH, {
|
|
59565
59624
|
ref: l,
|
|
59566
59625
|
className: U("agents-sdk relative z-50 max-h-[var(--available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[var(--transform-origin)]", n === "popper" && "w-full min-w-[var(--anchor-width)] data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", e),
|
|
59567
59626
|
"data-agents-sdk-resolved-theme": u,
|
|
59568
59627
|
"data-agents-sdk-theme": d,
|
|
59569
59628
|
...c,
|
|
59570
59629
|
children: [
|
|
59571
|
-
/* @__PURE__ */ V(
|
|
59572
|
-
/* @__PURE__ */ V(
|
|
59630
|
+
/* @__PURE__ */ V(SU, {}),
|
|
59631
|
+
/* @__PURE__ */ V(nU, {
|
|
59573
59632
|
className: "p-1",
|
|
59574
59633
|
children: t
|
|
59575
59634
|
}),
|
|
59576
|
-
/* @__PURE__ */ V(
|
|
59635
|
+
/* @__PURE__ */ V(CU, {})
|
|
59577
59636
|
]
|
|
59578
59637
|
})
|
|
59579
59638
|
}) });
|
|
59580
59639
|
});
|
|
59581
|
-
|
|
59582
|
-
var
|
|
59640
|
+
wU.displayName = "SelectContent";
|
|
59641
|
+
var TU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(vU, {
|
|
59583
59642
|
ref: n,
|
|
59584
59643
|
className: U("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
|
|
59585
59644
|
...t
|
|
59586
59645
|
}));
|
|
59587
|
-
|
|
59588
|
-
var
|
|
59646
|
+
TU.displayName = "SelectLabel";
|
|
59647
|
+
var EU = y.forwardRef(({ className: e, children: t, asChild: n = !1, ...r }, i) => /* @__PURE__ */ H(aU, {
|
|
59589
59648
|
ref: i,
|
|
59590
59649
|
render: lm(n, t),
|
|
59591
59650
|
className: U("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", e),
|
|
59592
59651
|
...r,
|
|
59593
59652
|
children: [/* @__PURE__ */ V("span", {
|
|
59594
59653
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
59595
|
-
children: /* @__PURE__ */ V(
|
|
59596
|
-
}), /* @__PURE__ */ V(
|
|
59654
|
+
children: /* @__PURE__ */ V(oU, { children: /* @__PURE__ */ V(uh, { className: "h-4 w-4" }) })
|
|
59655
|
+
}), /* @__PURE__ */ V(cU, { children: t })]
|
|
59597
59656
|
}));
|
|
59598
|
-
|
|
59599
|
-
function
|
|
59657
|
+
EU.displayName = "SelectItem";
|
|
59658
|
+
function DU(e) {
|
|
59600
59659
|
let t = [];
|
|
59601
|
-
return
|
|
59660
|
+
return OU(e, t), t.length > 0 ? t : void 0;
|
|
59602
59661
|
}
|
|
59603
|
-
function
|
|
59662
|
+
function OU(e, t) {
|
|
59604
59663
|
y.Children.forEach(e, (e) => {
|
|
59605
59664
|
if (y.isValidElement(e)) {
|
|
59606
|
-
if (e.type ===
|
|
59665
|
+
if (e.type === EU) {
|
|
59607
59666
|
let n = e.props.value;
|
|
59608
59667
|
typeof n == "string" && t.push({
|
|
59609
59668
|
value: n,
|
|
@@ -59611,34 +59670,34 @@ function TU(e, t) {
|
|
|
59611
59670
|
});
|
|
59612
59671
|
return;
|
|
59613
59672
|
}
|
|
59614
|
-
|
|
59673
|
+
OU(e.props.children, t);
|
|
59615
59674
|
}
|
|
59616
59675
|
});
|
|
59617
59676
|
}
|
|
59618
|
-
var
|
|
59677
|
+
var kU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Oh, {
|
|
59619
59678
|
ref: n,
|
|
59620
59679
|
className: U("-mx-1 my-1 h-px bg-muted", e),
|
|
59621
59680
|
...t
|
|
59622
59681
|
}));
|
|
59623
|
-
|
|
59682
|
+
kU.displayName = "SelectSeparator";
|
|
59624
59683
|
//#endregion
|
|
59625
59684
|
//#region src/components/elements/prompt-input.tsx
|
|
59626
|
-
var
|
|
59627
|
-
function
|
|
59685
|
+
var AU = 9;
|
|
59686
|
+
function jU(e) {
|
|
59628
59687
|
let t = e?.firstElementChild;
|
|
59629
59688
|
return t instanceof HTMLElement ? t : null;
|
|
59630
59689
|
}
|
|
59631
|
-
function
|
|
59690
|
+
function MU(e) {
|
|
59632
59691
|
let t = window.getComputedStyle(e), n = Number.parseFloat(t.lineHeight), r = Number.parseFloat(t.paddingTop), i = Number.parseFloat(t.paddingBottom), a = Number.isFinite(n) ? n : 24, o = Number.isFinite(r) ? r : 0, s = Number.isFinite(i) ? i : 0;
|
|
59633
59692
|
return {
|
|
59634
59693
|
minHeight: a + o + s,
|
|
59635
|
-
maxHeight: a *
|
|
59694
|
+
maxHeight: a * AU + o + s
|
|
59636
59695
|
};
|
|
59637
59696
|
}
|
|
59638
|
-
function
|
|
59697
|
+
function NU(e, t, n) {
|
|
59639
59698
|
if (!e) return;
|
|
59640
59699
|
e.style.height = "auto";
|
|
59641
|
-
let { minHeight: r, maxHeight: i } =
|
|
59700
|
+
let { minHeight: r, maxHeight: i } = MU(e), a = Math.max(e.scrollHeight, r), o = Math.min(a, i), s = jU(t);
|
|
59642
59701
|
if (e.style.height = `${a}px`, e.style.overflowY = "hidden", n((e) => e === o ? e : o), s) {
|
|
59643
59702
|
if (a <= i) {
|
|
59644
59703
|
s.scrollTop = 0;
|
|
@@ -59649,30 +59708,30 @@ function AU(e, t, n) {
|
|
|
59649
59708
|
});
|
|
59650
59709
|
}
|
|
59651
59710
|
}
|
|
59652
|
-
function
|
|
59711
|
+
function PU(e, t) {
|
|
59653
59712
|
if (typeof e == "function") {
|
|
59654
59713
|
e(t);
|
|
59655
59714
|
return;
|
|
59656
59715
|
}
|
|
59657
59716
|
e && (e.current = t);
|
|
59658
59717
|
}
|
|
59659
|
-
var
|
|
59718
|
+
var FU = ({ className: e, ...t }) => /* @__PURE__ */ V("form", {
|
|
59660
59719
|
className: U("w-full overflow-hidden rounded-xl border bg-background shadow-xs", e),
|
|
59661
59720
|
...t
|
|
59662
|
-
}),
|
|
59721
|
+
}), IU = ({ onChange: e, className: t, placeholder: n = "What would you like to know?", ref: r, disableAutoResize: i = !1, resizeOnNewLinesOnly: a = !1, ...o }) => {
|
|
59663
59722
|
let s = R(null), c = R(null), [l, u] = z(), d = !i && !a;
|
|
59664
59723
|
j(() => {
|
|
59665
|
-
d &&
|
|
59724
|
+
d && NU(s.current, c.current, u);
|
|
59666
59725
|
}, [
|
|
59667
59726
|
o.value,
|
|
59668
59727
|
o.defaultValue,
|
|
59669
59728
|
d
|
|
59670
59729
|
]);
|
|
59671
|
-
let f = /* @__PURE__ */ V(
|
|
59730
|
+
let f = /* @__PURE__ */ V(Zz, {
|
|
59672
59731
|
className: U("w-full resize-none rounded-none border-none p-3 shadow-none outline-hidden ring-0", i || a ? "field-sizing-fixed" : "field-sizing-fixed min-h-[calc(1lh+1.5rem)] overflow-y-hidden", "bg-transparent dark:bg-transparent", "focus-visible:ring-0", t),
|
|
59673
59732
|
name: "message",
|
|
59674
59733
|
onChange: (t) => {
|
|
59675
|
-
d &&
|
|
59734
|
+
d && NU(t.currentTarget, c.current, u), e?.(t);
|
|
59676
59735
|
},
|
|
59677
59736
|
onKeyDown: (e) => {
|
|
59678
59737
|
if (e.key === "Enter") {
|
|
@@ -59684,23 +59743,23 @@ var MU = ({ className: e, ...t }) => /* @__PURE__ */ V("form", {
|
|
|
59684
59743
|
},
|
|
59685
59744
|
placeholder: n,
|
|
59686
59745
|
ref: (e) => {
|
|
59687
|
-
s.current = e,
|
|
59746
|
+
s.current = e, PU(r, e);
|
|
59688
59747
|
},
|
|
59689
59748
|
...o
|
|
59690
59749
|
});
|
|
59691
|
-
return d ? /* @__PURE__ */ V(
|
|
59750
|
+
return d ? /* @__PURE__ */ V(WV, {
|
|
59692
59751
|
className: "w-full",
|
|
59693
59752
|
ref: c,
|
|
59694
59753
|
style: { height: l },
|
|
59695
59754
|
children: f
|
|
59696
59755
|
}) : f;
|
|
59697
|
-
},
|
|
59756
|
+
}, LU = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
|
|
59698
59757
|
className: U("flex items-center justify-between p-1", e),
|
|
59699
59758
|
...t
|
|
59700
|
-
}),
|
|
59759
|
+
}), RU = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
|
|
59701
59760
|
className: U("flex items-center gap-1", "[&_button:first-child]:rounded-bl-xl", e),
|
|
59702
59761
|
...t
|
|
59703
|
-
}),
|
|
59762
|
+
}), zU = ({ className: e, variant: t = "default", size: n = "icon", status: r, children: i, ...a }) => {
|
|
59704
59763
|
let o = /* @__PURE__ */ V(Ch, { className: "size-4" });
|
|
59705
59764
|
return r === "submitted" ? o = /* @__PURE__ */ V(yh, { className: "size-4 animate-spin" }) : r === "streaming" ? o = /* @__PURE__ */ V(wh, { className: "size-4" }) : r === "error" && (o = /* @__PURE__ */ V(Eh, { className: "size-4" })), /* @__PURE__ */ V(Fm, {
|
|
59706
59765
|
className: U("gap-1.5 rounded-lg", e),
|
|
@@ -59710,7 +59769,7 @@ var MU = ({ className: e, ...t }) => /* @__PURE__ */ V("form", {
|
|
|
59710
59769
|
...a,
|
|
59711
59770
|
children: i ?? o
|
|
59712
59771
|
});
|
|
59713
|
-
},
|
|
59772
|
+
}, BU = ({ suggestion: e, onClick: t, className: n, variant: r = "outline", size: i = "sm", children: a, ...o }) => /* @__PURE__ */ V(Fm, {
|
|
59714
59773
|
className: U("cursor-pointer rounded-full px-4", n),
|
|
59715
59774
|
onClick: () => {
|
|
59716
59775
|
t?.(e);
|
|
@@ -59723,7 +59782,7 @@ var MU = ({ className: e, ...t }) => /* @__PURE__ */ V("form", {
|
|
|
59723
59782
|
});
|
|
59724
59783
|
//#endregion
|
|
59725
59784
|
//#region src/components/suggested-actions.tsx
|
|
59726
|
-
function
|
|
59785
|
+
function VU({ chatId: e, sendMessage: t, suggestedActions: n }) {
|
|
59727
59786
|
let { getChatPath: r } = Ze(), i = n.map((e) => e.trim()).filter(Boolean);
|
|
59728
59787
|
return i.length === 0 ? null : /* @__PURE__ */ V("div", {
|
|
59729
59788
|
className: "grid w-full gap-2 sm:grid-cols-2",
|
|
@@ -59742,7 +59801,7 @@ function RU({ chatId: e, sendMessage: t, suggestedActions: n }) {
|
|
|
59742
59801
|
y: 20
|
|
59743
59802
|
},
|
|
59744
59803
|
transition: { delay: .05 * i },
|
|
59745
|
-
children: /* @__PURE__ */ V(
|
|
59804
|
+
children: /* @__PURE__ */ V(BU, {
|
|
59746
59805
|
className: "h-auto w-full whitespace-normal p-3 text-left",
|
|
59747
59806
|
onClick: (n) => {
|
|
59748
59807
|
window.history.pushState({}, "", r(e)), t({
|
|
@@ -59759,28 +59818,28 @@ function RU({ chatId: e, sendMessage: t, suggestedActions: n }) {
|
|
|
59759
59818
|
}, `${i}-${n}`))
|
|
59760
59819
|
});
|
|
59761
59820
|
}
|
|
59762
|
-
var
|
|
59821
|
+
var HU = O(VU, (e, t) => !(e.chatId !== t.chatId || !ve(e.suggestedActions, t.suggestedActions)));
|
|
59763
59822
|
//#endregion
|
|
59764
59823
|
//#region src/components/multimodal-input.tsx
|
|
59765
|
-
function
|
|
59824
|
+
function UU(e, t) {
|
|
59766
59825
|
document.cookie = `${e}=${encodeURIComponent(t)}; path=/; max-age=31536000`;
|
|
59767
59826
|
}
|
|
59768
|
-
var
|
|
59769
|
-
function
|
|
59827
|
+
var WU = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_") || "default", GU = 40, KU = 9;
|
|
59828
|
+
function qU(e) {
|
|
59770
59829
|
let t = e?.firstElementChild;
|
|
59771
59830
|
return t instanceof HTMLElement ? t : null;
|
|
59772
59831
|
}
|
|
59773
|
-
function
|
|
59832
|
+
function JU(e) {
|
|
59774
59833
|
let t = window.getComputedStyle(e), n = Number.parseFloat(t.lineHeight), r = Number.parseFloat(t.paddingTop), i = Number.parseFloat(t.paddingBottom), a = Number.isFinite(n) ? n : 24, o = Number.isFinite(r) ? r : 0, s = Number.isFinite(i) ? i : 0;
|
|
59775
59834
|
return {
|
|
59776
|
-
minHeight: Math.max(a + o + s,
|
|
59777
|
-
maxHeight: a *
|
|
59835
|
+
minHeight: Math.max(a + o + s, GU),
|
|
59836
|
+
maxHeight: a * KU + o + s
|
|
59778
59837
|
};
|
|
59779
59838
|
}
|
|
59780
|
-
function
|
|
59839
|
+
function YU(e, t) {
|
|
59781
59840
|
if (!e) return;
|
|
59782
59841
|
e.style.height = "auto";
|
|
59783
|
-
let { minHeight: n, maxHeight: r } =
|
|
59842
|
+
let { minHeight: n, maxHeight: r } = JU(e), i = e.scrollHeight, a = Math.max(i, n), o = Math.min(a, r), s = qU(t.scrollArea);
|
|
59784
59843
|
if (e.style.height = `${a}px`, e.style.overflowY = "hidden", t.setScrollAreaHeight((e) => e === o ? e : o), s) {
|
|
59785
59844
|
if (a <= r) {
|
|
59786
59845
|
s.scrollTop = 0;
|
|
@@ -59791,17 +59850,17 @@ function KU(e, t) {
|
|
|
59791
59850
|
});
|
|
59792
59851
|
}
|
|
59793
59852
|
}
|
|
59794
|
-
function
|
|
59853
|
+
function XU(e, t) {
|
|
59795
59854
|
if (!e) return;
|
|
59796
|
-
let { minHeight: n } =
|
|
59855
|
+
let { minHeight: n } = JU(e);
|
|
59797
59856
|
e.style.height = `${n}px`, e.style.overflowY = "hidden", t.setScrollAreaHeight(n);
|
|
59798
|
-
let r =
|
|
59857
|
+
let r = qU(t.scrollArea);
|
|
59799
59858
|
r && (r.scrollTop = 0);
|
|
59800
59859
|
}
|
|
59801
|
-
function
|
|
59802
|
-
let y = R(null), b = R(null), [x, S] = z(
|
|
59860
|
+
function ZU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments: a, setAttachments: o, messages: s, setMessages: c, sendMessage: l, className: u, chatModels: d, defaultChatModel: f, selectedModelId: p, onModelChange: m, openaiReasoningEffort: h = v, onOpenAIReasoningEffortChange: g, suggestedActions: _ }) {
|
|
59861
|
+
let y = R(null), b = R(null), [x, S] = z(GU), { width: C } = $P(), { getChatPath: w } = Ze(), T = r === "ready" || r === "error";
|
|
59803
59862
|
j(() => {
|
|
59804
|
-
|
|
59863
|
+
YU(y.current, {
|
|
59805
59864
|
scrollArea: b.current,
|
|
59806
59865
|
setScrollAreaHeight: S
|
|
59807
59866
|
});
|
|
@@ -59822,7 +59881,7 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
59822
59881
|
O(t);
|
|
59823
59882
|
}, [t, O]);
|
|
59824
59883
|
let A = (e) => {
|
|
59825
|
-
n(e.target.value),
|
|
59884
|
+
n(e.target.value), YU(e.currentTarget, {
|
|
59826
59885
|
scrollArea: b.current,
|
|
59827
59886
|
setScrollAreaHeight: S
|
|
59828
59887
|
});
|
|
@@ -59839,7 +59898,7 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
59839
59898
|
type: "text",
|
|
59840
59899
|
text: t
|
|
59841
59900
|
}]
|
|
59842
|
-
}), o([]), O(""), n(""),
|
|
59901
|
+
}), o([]), O(""), n(""), XU(y.current, {
|
|
59843
59902
|
scrollArea: b.current,
|
|
59844
59903
|
setScrollAreaHeight: S
|
|
59845
59904
|
}), C && C > 768 && y.current?.focus();
|
|
@@ -59947,7 +60006,7 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
59947
60006
|
}, [ee]), /* @__PURE__ */ H("div", {
|
|
59948
60007
|
className: U("relative flex w-full flex-col gap-4", u),
|
|
59949
60008
|
children: [
|
|
59950
|
-
s.length === 0 && a.length === 0 && N.length === 0 && _ && _.length > 0 && /* @__PURE__ */ V(
|
|
60009
|
+
s.length === 0 && a.length === 0 && N.length === 0 && _ && _.length > 0 && /* @__PURE__ */ V(HU, {
|
|
59951
60010
|
chatId: e,
|
|
59952
60011
|
sendMessage: l,
|
|
59953
60012
|
suggestedActions: _
|
|
@@ -59960,7 +60019,7 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
59960
60019
|
tabIndex: -1,
|
|
59961
60020
|
type: "file"
|
|
59962
60021
|
}),
|
|
59963
|
-
/* @__PURE__ */ H(
|
|
60022
|
+
/* @__PURE__ */ H(FU, {
|
|
59964
60023
|
className: "rounded-xl border border-border bg-background p-3 shadow-xs transition-all duration-200 focus-within:border-border hover:border-muted-foreground/50",
|
|
59965
60024
|
onSubmit: (e) => {
|
|
59966
60025
|
if (e.preventDefault(), !(!t.trim() && a.length === 0)) {
|
|
@@ -59975,12 +60034,12 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
59975
60034
|
(a.length > 0 || N.length > 0) && /* @__PURE__ */ H("div", {
|
|
59976
60035
|
className: "flex flex-row items-end gap-2 overflow-x-scroll",
|
|
59977
60036
|
"data-testid": "attachments-preview",
|
|
59978
|
-
children: [a.map((e) => /* @__PURE__ */ V(
|
|
60037
|
+
children: [a.map((e) => /* @__PURE__ */ V(cB, {
|
|
59979
60038
|
attachment: e,
|
|
59980
60039
|
onRemove: () => {
|
|
59981
60040
|
o((t) => t.filter((t) => t.url !== e.url)), M.current && (M.current.value = "");
|
|
59982
60041
|
}
|
|
59983
|
-
}, e.url)), N.map((e) => /* @__PURE__ */ V(
|
|
60042
|
+
}, e.url)), N.map((e) => /* @__PURE__ */ V(cB, {
|
|
59984
60043
|
attachment: {
|
|
59985
60044
|
url: "",
|
|
59986
60045
|
name: e,
|
|
@@ -59991,11 +60050,11 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
59991
60050
|
}),
|
|
59992
60051
|
/* @__PURE__ */ V("div", {
|
|
59993
60052
|
className: "flex flex-row items-start gap-1 sm:gap-2",
|
|
59994
|
-
children: /* @__PURE__ */ V(
|
|
60053
|
+
children: /* @__PURE__ */ V(WV, {
|
|
59995
60054
|
className: "grow rounded-md",
|
|
59996
60055
|
ref: b,
|
|
59997
60056
|
style: { height: x },
|
|
59998
|
-
children: /* @__PURE__ */ V(
|
|
60057
|
+
children: /* @__PURE__ */ V(IU, {
|
|
59999
60058
|
className: "min-h-10 w-full resize-none overflow-y-hidden border-0! border-none! bg-transparent p-2 text-base outline-none ring-0 placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
60000
60059
|
"data-testid": "multimodal-input",
|
|
60001
60060
|
disableAutoResize: !0,
|
|
@@ -60007,17 +60066,17 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
60007
60066
|
})
|
|
60008
60067
|
})
|
|
60009
60068
|
}),
|
|
60010
|
-
/* @__PURE__ */ H(
|
|
60069
|
+
/* @__PURE__ */ H(LU, {
|
|
60011
60070
|
className: "border-top-0! border-t-0! p-0 shadow-none dark:border-0 dark:border-transparent!",
|
|
60012
|
-
children: [/* @__PURE__ */ H(
|
|
60071
|
+
children: [/* @__PURE__ */ H(RU, {
|
|
60013
60072
|
className: "gap-0 sm:gap-0.5",
|
|
60014
60073
|
children: [
|
|
60015
|
-
/* @__PURE__ */ V(
|
|
60074
|
+
/* @__PURE__ */ V(eW, {
|
|
60016
60075
|
fileInputRef: M,
|
|
60017
60076
|
selectedModelId: p,
|
|
60018
60077
|
status: r
|
|
60019
60078
|
}),
|
|
60020
|
-
/* @__PURE__ */ V(
|
|
60079
|
+
/* @__PURE__ */ V(nW, {
|
|
60021
60080
|
focusTargetRef: y,
|
|
60022
60081
|
chatModels: d,
|
|
60023
60082
|
defaultChatModel: f,
|
|
@@ -60025,7 +60084,7 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
60025
60084
|
onModelChange: m,
|
|
60026
60085
|
selectedModelId: p
|
|
60027
60086
|
}),
|
|
60028
|
-
/* @__PURE__ */ V(
|
|
60087
|
+
/* @__PURE__ */ V(aW, {
|
|
60029
60088
|
disabled: r !== "ready",
|
|
60030
60089
|
idScope: e,
|
|
60031
60090
|
onChange: g,
|
|
@@ -60033,10 +60092,10 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
60033
60092
|
value: h
|
|
60034
60093
|
})
|
|
60035
60094
|
]
|
|
60036
|
-
}), r === "submitted" || r === "streaming" ? /* @__PURE__ */ V(
|
|
60095
|
+
}), r === "submitted" || r === "streaming" ? /* @__PURE__ */ V(sW, {
|
|
60037
60096
|
setMessages: c,
|
|
60038
60097
|
stop: i
|
|
60039
|
-
}) : /* @__PURE__ */ V(
|
|
60098
|
+
}) : /* @__PURE__ */ V(zU, {
|
|
60040
60099
|
className: "size-8 rounded-full bg-primary text-primary-foreground transition-colors duration-200 hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground",
|
|
60041
60100
|
"data-testid": "send-button",
|
|
60042
60101
|
disabled: !t.trim() || N.length > 0,
|
|
@@ -60049,8 +60108,8 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
60049
60108
|
]
|
|
60050
60109
|
});
|
|
60051
60110
|
}
|
|
60052
|
-
var
|
|
60053
|
-
function
|
|
60111
|
+
var QU = O(ZU, (e, t) => !(e.input !== t.input || e.status !== t.status || !ve(e.attachments, t.attachments) || e.selectedModelId !== t.selectedModelId || e.openaiReasoningEffort !== t.openaiReasoningEffort || !ve(e.suggestedActions, t.suggestedActions) || !ve(e.chatModels, t.chatModels) || e.defaultChatModel !== t.defaultChatModel));
|
|
60112
|
+
function $U({ fileInputRef: e, status: t, selectedModelId: n }) {
|
|
60054
60113
|
let r = n.includes("reasoning") || n.includes("think");
|
|
60055
60114
|
return /* @__PURE__ */ V(Fm, {
|
|
60056
60115
|
className: "aspect-square h-8 rounded-lg p-1 transition-colors hover:bg-accent",
|
|
@@ -60069,44 +60128,44 @@ function XU({ fileInputRef: e, status: t, selectedModelId: n }) {
|
|
|
60069
60128
|
})
|
|
60070
60129
|
});
|
|
60071
60130
|
}
|
|
60072
|
-
var
|
|
60073
|
-
function
|
|
60074
|
-
let [o, s] = z(!1), c = R(!1), l =
|
|
60131
|
+
var eW = O($U);
|
|
60132
|
+
function tW({ focusTargetRef: e, chatModels: t, defaultChatModel: n, idScope: r, selectedModelId: i, onModelChange: a }) {
|
|
60133
|
+
let [o, s] = z(!1), c = R(!1), l = WU(r), d = t && t.length > 0 ? t : f, p = u(d), m = d.find((e) => e.id === i) ?? d.find((e) => e.id === n) ?? d[0] ?? f[0], [h] = m.id.split("/"), g = {
|
|
60075
60134
|
anthropic: "Anthropic",
|
|
60076
60135
|
openai: "OpenAI",
|
|
60077
60136
|
google: "Google",
|
|
60078
60137
|
xai: "xAI",
|
|
60079
60138
|
reasoning: "Reasoning"
|
|
60080
60139
|
};
|
|
60081
|
-
return /* @__PURE__ */ H(
|
|
60140
|
+
return /* @__PURE__ */ H($B, {
|
|
60082
60141
|
onOpenChange: s,
|
|
60083
60142
|
open: o,
|
|
60084
|
-
children: [/* @__PURE__ */ V(
|
|
60143
|
+
children: [/* @__PURE__ */ V(eV, {
|
|
60085
60144
|
asChild: !0,
|
|
60086
60145
|
children: /* @__PURE__ */ H(Fm, {
|
|
60087
60146
|
className: "agents-chat-model-selector-trigger h-8 w-auto max-w-[18rem] justify-start gap-2 px-2",
|
|
60088
60147
|
id: `agents-sdk-model-selector-${l}`,
|
|
60089
60148
|
variant: "ghost",
|
|
60090
|
-
children: [h && /* @__PURE__ */ V(
|
|
60149
|
+
children: [h && /* @__PURE__ */ V(oV, { provider: h }), /* @__PURE__ */ V(sV, {
|
|
60091
60150
|
className: "min-w-0 max-w-[14rem] flex-initial",
|
|
60092
60151
|
children: m.name
|
|
60093
60152
|
})]
|
|
60094
60153
|
})
|
|
60095
|
-
}), /* @__PURE__ */ H(
|
|
60154
|
+
}), /* @__PURE__ */ H(tV, {
|
|
60096
60155
|
commandDefaultValue: m.id,
|
|
60097
60156
|
finalFocus: () => c.current ? (c.current = !1, e.current) : !0,
|
|
60098
|
-
children: [/* @__PURE__ */ V(
|
|
60157
|
+
children: [/* @__PURE__ */ V(nV, { placeholder: "Search models..." }), /* @__PURE__ */ V(rV, { children: Object.entries(p).map(([e, t]) => /* @__PURE__ */ V(iV, {
|
|
60099
60158
|
heading: g[e] ?? e,
|
|
60100
60159
|
children: t.map((e) => {
|
|
60101
60160
|
let t = e.id.split("/")[0];
|
|
60102
|
-
return /* @__PURE__ */ H(
|
|
60161
|
+
return /* @__PURE__ */ H(aV, {
|
|
60103
60162
|
onSelect: () => {
|
|
60104
|
-
c.current = !0, a?.(e.id),
|
|
60163
|
+
c.current = !0, a?.(e.id), UU("chat-model", e.id), s(!1);
|
|
60105
60164
|
},
|
|
60106
60165
|
value: e.id,
|
|
60107
60166
|
children: [
|
|
60108
|
-
/* @__PURE__ */ V(
|
|
60109
|
-
/* @__PURE__ */ V(
|
|
60167
|
+
/* @__PURE__ */ V(oV, { provider: t }),
|
|
60168
|
+
/* @__PURE__ */ V(sV, { children: e.name }),
|
|
60110
60169
|
e.id === m.id && /* @__PURE__ */ V(uh, { className: "ml-auto size-4" })
|
|
60111
60170
|
]
|
|
60112
60171
|
}, e.id);
|
|
@@ -60115,40 +60174,40 @@ function QU({ focusTargetRef: e, chatModels: t, defaultChatModel: n, idScope: r,
|
|
|
60115
60174
|
})]
|
|
60116
60175
|
});
|
|
60117
60176
|
}
|
|
60118
|
-
var
|
|
60119
|
-
function
|
|
60120
|
-
let a = m(t), o = h(t), s = _(t), c = s &&
|
|
60177
|
+
var nW = O(tW), rW = (e, t) => t.includes(e), iW = (e) => e.charAt(0).toUpperCase() + e.slice(1);
|
|
60178
|
+
function aW({ idScope: e, selectedModelId: t, value: n, onChange: r, disabled: i }) {
|
|
60179
|
+
let a = m(t), o = h(t), s = _(t), c = s && rW(s, o) ? s : o[0], l = rW(n, o) ? n : c ?? "default";
|
|
60121
60180
|
return j(() => {
|
|
60122
|
-
!a || !r ||
|
|
60181
|
+
!a || !r || rW(n, o) || r(c ?? "default");
|
|
60123
60182
|
}, [
|
|
60124
60183
|
o,
|
|
60125
60184
|
c,
|
|
60126
60185
|
r,
|
|
60127
60186
|
a,
|
|
60128
60187
|
n
|
|
60129
|
-
]), !a || !r || l === "default" ? null : /* @__PURE__ */ H(
|
|
60188
|
+
]), !a || !r || l === "default" ? null : /* @__PURE__ */ H(yU, {
|
|
60130
60189
|
disabled: i,
|
|
60131
60190
|
onValueChange: (e) => {
|
|
60132
|
-
|
|
60191
|
+
UU(g, e), r(e);
|
|
60133
60192
|
},
|
|
60134
60193
|
value: l,
|
|
60135
|
-
children: [/* @__PURE__ */ V(
|
|
60194
|
+
children: [/* @__PURE__ */ V(xU, {
|
|
60136
60195
|
className: "h-8 w-[112px] gap-1 border-0 bg-transparent px-2 text-sm hover:bg-accent focus:ring-0 focus:ring-offset-0",
|
|
60137
|
-
id: `agents-sdk-reasoning-effort-${
|
|
60196
|
+
id: `agents-sdk-reasoning-effort-${WU(e)}`,
|
|
60138
60197
|
children: /* @__PURE__ */ H("div", {
|
|
60139
60198
|
className: "flex min-w-0 items-center gap-1.5",
|
|
60140
60199
|
children: [/* @__PURE__ */ V(lh, { className: "size-3.5 shrink-0 text-muted-foreground" }), /* @__PURE__ */ V("span", {
|
|
60141
60200
|
className: "min-w-0 truncate",
|
|
60142
|
-
children: /* @__PURE__ */ V(
|
|
60201
|
+
children: /* @__PURE__ */ V(bU, {})
|
|
60143
60202
|
})]
|
|
60144
60203
|
})
|
|
60145
|
-
}), /* @__PURE__ */ V(
|
|
60204
|
+
}), /* @__PURE__ */ V(wU, { children: o.map((e) => /* @__PURE__ */ V(EU, {
|
|
60146
60205
|
value: e,
|
|
60147
|
-
children: /* @__PURE__ */ V("span", { children:
|
|
60206
|
+
children: /* @__PURE__ */ V("span", { children: iW(e) })
|
|
60148
60207
|
}, e)) })]
|
|
60149
60208
|
});
|
|
60150
60209
|
}
|
|
60151
|
-
function
|
|
60210
|
+
function oW({ stop: e, setMessages: t }) {
|
|
60152
60211
|
return /* @__PURE__ */ V(Fm, {
|
|
60153
60212
|
className: "size-8 rounded-full bg-primary p-1 text-primary-foreground transition-colors duration-200 hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground",
|
|
60154
60213
|
"data-testid": "stop-button",
|
|
@@ -60158,7 +60217,7 @@ function rW({ stop: e, setMessages: t }) {
|
|
|
60158
60217
|
children: /* @__PURE__ */ V(G, { size: 14 })
|
|
60159
60218
|
});
|
|
60160
60219
|
}
|
|
60161
|
-
var
|
|
60220
|
+
var sW = O(oW), cW = ({ description: e, icon: t, selectedTool: n, setSelectedTool: r, isToolbarVisible: i, setIsToolbarVisible: a, isAnimating: o, sendMessage: s, onClick: c }) => {
|
|
60162
60221
|
let [l, u] = z(!1);
|
|
60163
60222
|
j(() => {
|
|
60164
60223
|
n !== e && u(!1);
|
|
@@ -60216,14 +60275,14 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60216
60275
|
children: e
|
|
60217
60276
|
})]
|
|
60218
60277
|
});
|
|
60219
|
-
},
|
|
60278
|
+
}, lW = [...[
|
|
60220
60279
|
,
|
|
60221
60280
|
,
|
|
60222
60281
|
,
|
|
60223
60282
|
,
|
|
60224
60283
|
,
|
|
60225
60284
|
,
|
|
60226
|
-
]].map((e) => Je(5)),
|
|
60285
|
+
]].map((e) => Je(5)), uW = ({ setSelectedTool: e, sendMessage: t, isAnimating: n }) => {
|
|
60227
60286
|
let r = [
|
|
60228
60287
|
"Elementary",
|
|
60229
60288
|
"Middle School",
|
|
@@ -60239,7 +60298,7 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60239
60298
|
return () => e();
|
|
60240
60299
|
}, [a]), /* @__PURE__ */ H("div", {
|
|
60241
60300
|
className: "relative flex flex-col items-center justify-end",
|
|
60242
|
-
children: [
|
|
60301
|
+
children: [lW.map((e) => /* @__PURE__ */ V(cP.div, {
|
|
60243
60302
|
animate: { opacity: 1 },
|
|
60244
60303
|
className: "flex size-[40px] flex-row items-center justify-center",
|
|
60245
60304
|
exit: { opacity: 0 },
|
|
@@ -60291,7 +60350,7 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60291
60350
|
})]
|
|
60292
60351
|
}) })]
|
|
60293
60352
|
});
|
|
60294
|
-
},
|
|
60353
|
+
}, dW = ({ isToolbarVisible: e, selectedTool: t, setSelectedTool: n, sendMessage: r, isAnimating: i, setIsToolbarVisible: a, tools: o }) => {
|
|
60295
60354
|
let [s, ...c] = o;
|
|
60296
60355
|
return /* @__PURE__ */ H(cP.div, {
|
|
60297
60356
|
animate: {
|
|
@@ -60307,7 +60366,7 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60307
60366
|
opacity: 0,
|
|
60308
60367
|
scale: .95
|
|
60309
60368
|
},
|
|
60310
|
-
children: [/* @__PURE__ */ V(hM, { children: e && c.map((e) => /* @__PURE__ */ V(
|
|
60369
|
+
children: [/* @__PURE__ */ V(hM, { children: e && c.map((e) => /* @__PURE__ */ V(cW, {
|
|
60311
60370
|
description: e.description,
|
|
60312
60371
|
icon: e.icon,
|
|
60313
60372
|
isAnimating: i,
|
|
@@ -60315,7 +60374,7 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60315
60374
|
selectedTool: t,
|
|
60316
60375
|
sendMessage: r,
|
|
60317
60376
|
setSelectedTool: n
|
|
60318
|
-
}, e.description)) }), /* @__PURE__ */ V(
|
|
60377
|
+
}, e.description)) }), /* @__PURE__ */ V(cW, {
|
|
60319
60378
|
description: s.description,
|
|
60320
60379
|
icon: s.icon,
|
|
60321
60380
|
isAnimating: i,
|
|
@@ -60327,7 +60386,7 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60327
60386
|
setSelectedTool: n
|
|
60328
60387
|
})]
|
|
60329
60388
|
});
|
|
60330
|
-
},
|
|
60389
|
+
}, fW = O(({ isToolbarVisible: e, setIsToolbarVisible: t, sendMessage: n, status: r, stop: i, setMessages: a, artifactKind: o }) => {
|
|
60331
60390
|
let s = R(null), c = R(null), [l, u] = z(null), [d, f] = z(!1);
|
|
60332
60391
|
ZP(s, () => {
|
|
60333
60392
|
t(!1), u(null);
|
|
@@ -60344,7 +60403,7 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60344
60403
|
}, []), j(() => {
|
|
60345
60404
|
r === "streaming" && t(!1);
|
|
60346
60405
|
}, [r, t]);
|
|
60347
|
-
let h =
|
|
60406
|
+
let h = mW.find((e) => e.kind === o);
|
|
60348
60407
|
if (!h) throw Error("Artifact definition not found!");
|
|
60349
60408
|
let g = h.toolbar;
|
|
60350
60409
|
return g.length === 0 ? null : /* @__PURE__ */ V(Wg, {
|
|
@@ -60406,11 +60465,11 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60406
60465
|
i(), a((e) => e);
|
|
60407
60466
|
},
|
|
60408
60467
|
children: /* @__PURE__ */ V(G, {})
|
|
60409
|
-
}, "stop-icon") : l === "adjust-reading-level" ? /* @__PURE__ */ V(
|
|
60468
|
+
}, "stop-icon") : l === "adjust-reading-level" ? /* @__PURE__ */ V(uW, {
|
|
60410
60469
|
isAnimating: d,
|
|
60411
60470
|
sendMessage: n,
|
|
60412
60471
|
setSelectedTool: u
|
|
60413
|
-
}, "reading-level-selector") : /* @__PURE__ */ V(
|
|
60472
|
+
}, "reading-level-selector") : /* @__PURE__ */ V(dW, {
|
|
60414
60473
|
isAnimating: d,
|
|
60415
60474
|
isToolbarVisible: e,
|
|
60416
60475
|
selectedTool: l,
|
|
@@ -60421,7 +60480,7 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60421
60480
|
}, "tools")
|
|
60422
60481
|
})
|
|
60423
60482
|
});
|
|
60424
|
-
}, (e, t) => !(e.status !== t.status || e.isToolbarVisible !== t.isToolbarVisible || e.artifactKind !== t.artifactKind)),
|
|
60483
|
+
}, (e, t) => !(e.status !== t.status || e.isToolbarVisible !== t.isToolbarVisible || e.artifactKind !== t.artifactKind)), pW = ({ handleVersionChange: e, documents: t, currentVersionIndex: n }) => {
|
|
60425
60484
|
let { artifact: r } = ES(), { width: i } = $P(), a = i < 768, [o, s] = z(!1);
|
|
60426
60485
|
if (t) return /* @__PURE__ */ H(cP.div, {
|
|
60427
60486
|
animate: { y: 0 },
|
|
@@ -60461,13 +60520,13 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60461
60520
|
})]
|
|
60462
60521
|
})]
|
|
60463
60522
|
});
|
|
60464
|
-
},
|
|
60523
|
+
}, mW = [
|
|
60465
60524
|
ER,
|
|
60466
60525
|
lF,
|
|
60467
60526
|
dF,
|
|
60468
60527
|
jL
|
|
60469
60528
|
];
|
|
60470
|
-
function
|
|
60529
|
+
function hW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, status: i, stop: a, attachments: o, setAttachments: s, chatModels: c, defaultChatModel: l, sendMessage: u, messages: d, setMessages: f, regenerate: p, renderMessagePart: m, votes: h, isReadonly: g, selectedModelId: _, suggestedActions: v }) {
|
|
60471
60530
|
let { artifact: y, setArtifact: b, metadata: x, setMetadata: S } = ES(), { data: C, isLoading: w } = NR(y.documentId, y.documentId !== "init" && y.status !== "streaming"), [T, E] = z([]), D = L(() => T.length > 0 ? MR(C, T) : C, [C, T]), [O, A] = z("edit"), [M, N] = z(null), [P, F] = z(-1);
|
|
60472
60531
|
j(() => {
|
|
60473
60532
|
E([]);
|
|
@@ -60525,7 +60584,7 @@ function fW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
60525
60584
|
}
|
|
60526
60585
|
let ie = (e) => {
|
|
60527
60586
|
D && (e === "latest" && (F(D.length - 1), A("edit")), e === "toggle" && A((e) => e === "edit" ? "diff" : "edit"), e === "prev" ? P > 0 && F((e) => e - 1) : e === "next" && P < D.length - 1 && F((e) => e + 1));
|
|
60528
|
-
}, [B, ae] = z(!1), oe = D && D.length > 0 ? P === D.length - 1 : !0, se = Yg(), ce =
|
|
60587
|
+
}, [B, ae] = z(!1), oe = D && D.length > 0 ? P === D.length - 1 : !0, se = Yg(), ce = mW.find((e) => e.kind === y.kind);
|
|
60529
60588
|
if (!ce) throw Error("Artifact definition not found!");
|
|
60530
60589
|
return j(() => {
|
|
60531
60590
|
y.documentId !== "init" && ce.initialize && ce.initialize({
|
|
@@ -60576,7 +60635,7 @@ function fW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
60576
60635
|
initial: { opacity: 0 }
|
|
60577
60636
|
}) }), /* @__PURE__ */ H("div", {
|
|
60578
60637
|
className: "flex h-full flex-col items-center justify-between",
|
|
60579
|
-
children: [/* @__PURE__ */ V(
|
|
60638
|
+
children: [/* @__PURE__ */ V(kB, {
|
|
60580
60639
|
addToolApprovalResponse: e,
|
|
60581
60640
|
artifactStatus: y.status,
|
|
60582
60641
|
chatId: t,
|
|
@@ -60589,7 +60648,7 @@ function fW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
60589
60648
|
votes: h
|
|
60590
60649
|
}), /* @__PURE__ */ V("div", {
|
|
60591
60650
|
className: "relative flex w-full flex-row items-end gap-2 px-4 pb-4",
|
|
60592
|
-
children: /* @__PURE__ */ V(
|
|
60651
|
+
children: /* @__PURE__ */ V(QU, {
|
|
60593
60652
|
attachments: o,
|
|
60594
60653
|
chatModels: c,
|
|
60595
60654
|
defaultChatModel: l,
|
|
@@ -60688,7 +60747,7 @@ function fW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
60688
60747
|
status: y.status,
|
|
60689
60748
|
suggestions: [],
|
|
60690
60749
|
title: y.title
|
|
60691
|
-
}), /* @__PURE__ */ V(hM, { children: oe && /* @__PURE__ */ V(
|
|
60750
|
+
}), /* @__PURE__ */ V(hM, { children: oe && /* @__PURE__ */ V(fW, {
|
|
60692
60751
|
artifactKind: y.kind,
|
|
60693
60752
|
isToolbarVisible: B,
|
|
60694
60753
|
sendMessage: u,
|
|
@@ -60698,7 +60757,7 @@ function fW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
60698
60757
|
stop: a
|
|
60699
60758
|
}) })]
|
|
60700
60759
|
}),
|
|
60701
|
-
/* @__PURE__ */ V(hM, { children: !oe && /* @__PURE__ */ V(
|
|
60760
|
+
/* @__PURE__ */ V(hM, { children: !oe && /* @__PURE__ */ V(pW, {
|
|
60702
60761
|
currentVersionIndex: P,
|
|
60703
60762
|
documents: D,
|
|
60704
60763
|
handleVersionChange: ie
|
|
@@ -60707,7 +60766,7 @@ function fW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
60707
60766
|
})]
|
|
60708
60767
|
}) });
|
|
60709
60768
|
}
|
|
60710
|
-
var
|
|
60769
|
+
var gW = O(hW, (e, t) => !(e.status !== t.status || !ve(e.votes, t.votes) || e.input !== t.input || !ve(e.messages, t.messages.length) || e.renderMessagePart !== t.renderMessagePart || !ve(e.suggestedActions, t.suggestedActions) || !ve(e.chatModels, t.chatModels) || e.defaultChatModel !== t.defaultChatModel)), _W = ({ title1: e, title2: t }) => {
|
|
60711
60770
|
let n = e?.trim(), r = t?.trim();
|
|
60712
60771
|
return !n && !r ? null : /* @__PURE__ */ H("div", {
|
|
60713
60772
|
className: "mx-auto mt-4 flex size-full max-w-3xl flex-col justify-center px-4 md:mt-16 md:px-8",
|
|
@@ -60745,9 +60804,9 @@ var pW = O(fW, (e, t) => !(e.status !== t.status || !ve(e.votes, t.votes) || e.i
|
|
|
60745
60804
|
children: r
|
|
60746
60805
|
})]
|
|
60747
60806
|
}, "overview");
|
|
60748
|
-
},
|
|
60749
|
-
function
|
|
60750
|
-
let r = t.message.trim(), i = r !== "" && !
|
|
60807
|
+
}, vW = (e) => e.trim().toLowerCase().replace(/\.+$/, "") === "an error occurred";
|
|
60808
|
+
function yW({ disabled: e, error: t, onRetry: n }) {
|
|
60809
|
+
let r = t.message.trim(), i = r !== "" && !vW(r);
|
|
60751
60810
|
return /* @__PURE__ */ V("div", {
|
|
60752
60811
|
className: "group/message fade-in w-full animate-in duration-200",
|
|
60753
60812
|
"data-testid": "message-error",
|
|
@@ -60781,7 +60840,7 @@ function gW({ disabled: e, error: t, onRetry: n }) {
|
|
|
60781
60840
|
})
|
|
60782
60841
|
});
|
|
60783
60842
|
}
|
|
60784
|
-
function
|
|
60843
|
+
function bW({ addToolApprovalResponse: e, chatId: t, conversationError: n, status: r, votes: i, messages: a, renderMessagePart: o, setMessages: c, regenerate: u, onRetryConversationError: d, isReadonly: f, selectedModelId: p, title1: m, title2: h }) {
|
|
60785
60844
|
let g = a.at(-1), _ = g ? l(g) : !1, v = r === "submitted" || r === "streaming" && g?.role === "assistant" && !_, { containerRef: y, endRef: b, isAtBottom: x, scrollToBottom: S, hasSentMessage: C } = zR({ status: r });
|
|
60786
60845
|
return ot(), /* @__PURE__ */ H("div", {
|
|
60787
60846
|
className: "relative flex-1",
|
|
@@ -60791,11 +60850,11 @@ function _W({ addToolApprovalResponse: e, chatId: t, conversationError: n, statu
|
|
|
60791
60850
|
children: /* @__PURE__ */ H("div", {
|
|
60792
60851
|
className: "mx-auto flex min-w-0 max-w-4xl flex-col gap-4 px-2 pt-[60px] pb-4 md:gap-6 md:px-4",
|
|
60793
60852
|
children: [
|
|
60794
|
-
a.length === 0 && /* @__PURE__ */ V(
|
|
60853
|
+
a.length === 0 && /* @__PURE__ */ V(_W, {
|
|
60795
60854
|
title1: m,
|
|
60796
60855
|
title2: h
|
|
60797
60856
|
}),
|
|
60798
|
-
a.map((n, l) => s(n) ? null : /* @__PURE__ */ V(
|
|
60857
|
+
a.map((n, l) => s(n) ? null : /* @__PURE__ */ V(wB, {
|
|
60799
60858
|
addToolApprovalResponse: e,
|
|
60800
60859
|
chatId: t,
|
|
60801
60860
|
isLoading: r === "streaming" && a.length - 1 === l,
|
|
@@ -60807,8 +60866,8 @@ function _W({ addToolApprovalResponse: e, chatId: t, conversationError: n, statu
|
|
|
60807
60866
|
setMessages: c,
|
|
60808
60867
|
vote: i ? i.find((e) => e.messageId === n.id) : void 0
|
|
60809
60868
|
}, n.id)),
|
|
60810
|
-
v && /* @__PURE__ */ V(
|
|
60811
|
-
n && /* @__PURE__ */ V(
|
|
60869
|
+
v && /* @__PURE__ */ V(EB, {}),
|
|
60870
|
+
n && /* @__PURE__ */ V(yW, {
|
|
60812
60871
|
disabled: r !== "ready" && r !== "error",
|
|
60813
60872
|
error: n,
|
|
60814
60873
|
onRetry: d
|
|
@@ -60828,10 +60887,10 @@ function _W({ addToolApprovalResponse: e, chatId: t, conversationError: n, statu
|
|
|
60828
60887
|
})]
|
|
60829
60888
|
});
|
|
60830
60889
|
}
|
|
60831
|
-
var
|
|
60890
|
+
var xW = bW, SW = (e) => e?.parts?.some((e) => {
|
|
60832
60891
|
let t = e.state;
|
|
60833
60892
|
return t === "approval-responded" || t === "output-denied";
|
|
60834
|
-
}) ?? !1,
|
|
60893
|
+
}) ?? !1, CW = (e) => `agents-sdk:chat:${e}:stream`, wW = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), TW = (e) => _(e) ?? "default", EW = (e) => {
|
|
60835
60894
|
if (typeof document > "u") return null;
|
|
60836
60895
|
let t = document.cookie.split(";");
|
|
60837
60896
|
for (let n of t) {
|
|
@@ -60846,10 +60905,10 @@ var vW = _W, yW = (e) => e?.parts?.some((e) => {
|
|
|
60846
60905
|
}
|
|
60847
60906
|
}
|
|
60848
60907
|
return null;
|
|
60849
|
-
},
|
|
60908
|
+
}, DW = (e) => EW("chat-reasoning-effort") ?? e, OW = (e, t) => {
|
|
60850
60909
|
let n = h(e);
|
|
60851
|
-
return t && n.some((e) => e === t) ? t :
|
|
60852
|
-
},
|
|
60910
|
+
return t && n.some((e) => e === t) ? t : TW(e);
|
|
60911
|
+
}, kW = (e, t) => OW(e, DW(t)), AW = (e) => e instanceof pm || e instanceof Error && e.message ? e.message : "Something went wrong. Please try again.", jW = (e) => {
|
|
60853
60912
|
for (let t = e.length - 1; t >= 0; --t) {
|
|
60854
60913
|
let n = e[t];
|
|
60855
60914
|
if (!s(n)) {
|
|
@@ -60858,23 +60917,23 @@ var vW = _W, yW = (e) => e?.parts?.some((e) => {
|
|
|
60858
60917
|
}
|
|
60859
60918
|
}
|
|
60860
60919
|
return null;
|
|
60861
|
-
},
|
|
60920
|
+
}, MW = (e) => {
|
|
60862
60921
|
for (let t = e.length - 1; t >= 0; --t) {
|
|
60863
60922
|
let n = e[t];
|
|
60864
60923
|
if (n.role === "assistant" && l(n)) return n;
|
|
60865
60924
|
}
|
|
60866
60925
|
return null;
|
|
60867
|
-
},
|
|
60926
|
+
}, NW = (e) => {
|
|
60868
60927
|
let t = e.length;
|
|
60869
60928
|
for (; t > 0 && s(e[t - 1]);) --t;
|
|
60870
60929
|
return t === e.length ? e : e.slice(0, t);
|
|
60871
|
-
},
|
|
60930
|
+
}, PW = (e) => {
|
|
60872
60931
|
if (e?.role !== "assistant") return null;
|
|
60873
60932
|
for (let t of e.parts) {
|
|
60874
|
-
if (!
|
|
60933
|
+
if (!wW(t)) continue;
|
|
60875
60934
|
let e = t;
|
|
60876
60935
|
if (e.state !== "approval-responded") continue;
|
|
60877
|
-
let n =
|
|
60936
|
+
let n = wW(e.approval) ? e.approval : null;
|
|
60878
60937
|
if (!(n?.approved !== !0 || typeof n.id != "string")) return {
|
|
60879
60938
|
id: n.id,
|
|
60880
60939
|
reason: typeof n.reason == "string" ? n.reason : void 0
|
|
@@ -60882,15 +60941,15 @@ var vW = _W, yW = (e) => e?.parts?.some((e) => {
|
|
|
60882
60941
|
}
|
|
60883
60942
|
return null;
|
|
60884
60943
|
};
|
|
60885
|
-
function
|
|
60944
|
+
function FW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReasoningEffort: r, isReadonly: i, autoResume: a, chatModels: o, defaultChatModel: s, renderMessagePart: c, suggestedActions: l, title1: u, title2: h }) {
|
|
60886
60945
|
let { setDataStream: g, setWaitingStatus: _ } = ot(), { getChatPath: v } = Ze(), y = o && o.length > 0 ? o : f, b = p({
|
|
60887
60946
|
defaultChatModel: s,
|
|
60888
60947
|
models: y
|
|
60889
|
-
}), x = d(y).has(n) ? n : b, S =
|
|
60948
|
+
}), x = d(y).has(n) ? n : b, S = kW(x, r), [C, w] = z(""), [T, E] = z(x), D = R(T), [O, k] = z(S), A = R(O), [M, N] = z(null);
|
|
60890
60949
|
j(() => {
|
|
60891
60950
|
D.current = T;
|
|
60892
60951
|
}, [T]), j(() => {
|
|
60893
|
-
E(x), k(
|
|
60952
|
+
E(x), k(kW(x, r)), N(null), _(void 0);
|
|
60894
60953
|
}, [
|
|
60895
60954
|
e,
|
|
60896
60955
|
x,
|
|
@@ -60909,7 +60968,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
60909
60968
|
api: "/api/rb/agents/chat",
|
|
60910
60969
|
fetch: Om,
|
|
60911
60970
|
prepareSendMessagesRequest(e) {
|
|
60912
|
-
let t = D.current, n = A.current, r = e.messages.at(-1), i = e.messages.at(-2), a = Cm(e.headers, xm()), o = r?.role !== "user" || r?.role === "user" &&
|
|
60971
|
+
let t = D.current, n = A.current, r = e.messages.at(-1), i = e.messages.at(-2), a = Cm(e.headers, xm()), o = r?.role !== "user" || r?.role === "user" && SW(i);
|
|
60913
60972
|
return {
|
|
60914
60973
|
...a ? { headers: a } : {},
|
|
60915
60974
|
body: {
|
|
@@ -60937,7 +60996,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
60937
60996
|
g((t) => t ? [...t, e] : []);
|
|
60938
60997
|
},
|
|
60939
60998
|
onError: (e) => {
|
|
60940
|
-
let t =
|
|
60999
|
+
let t = AW(e);
|
|
60941
61000
|
N({ message: t }), le.error(t);
|
|
60942
61001
|
}
|
|
60943
61002
|
});
|
|
@@ -60945,7 +61004,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
60945
61004
|
(L === "submitted" || L === "ready" || L === "error") && _(void 0);
|
|
60946
61005
|
}, [L, _]);
|
|
60947
61006
|
let B = (...e) => (N(null), re(), I(...e)), ae = (...e) => (N(null), re(), te(...e)), oe = () => {
|
|
60948
|
-
let e =
|
|
61007
|
+
let e = jW(P);
|
|
60949
61008
|
if (e) {
|
|
60950
61009
|
B({
|
|
60951
61010
|
messageId: e.id,
|
|
@@ -60955,11 +61014,11 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
60955
61014
|
});
|
|
60956
61015
|
return;
|
|
60957
61016
|
}
|
|
60958
|
-
let t =
|
|
61017
|
+
let t = MW(P);
|
|
60959
61018
|
if (t) {
|
|
60960
|
-
let e =
|
|
61019
|
+
let e = PW(t);
|
|
60961
61020
|
if (e) {
|
|
60962
|
-
N(null), re(), F(
|
|
61021
|
+
N(null), re(), F(NW), ie({
|
|
60963
61022
|
id: e.id,
|
|
60964
61023
|
approved: !0,
|
|
60965
61024
|
reason: e.reason
|
|
@@ -60971,17 +61030,17 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
60971
61030
|
}
|
|
60972
61031
|
ae();
|
|
60973
61032
|
}, ce = R(null), de = R("");
|
|
60974
|
-
j(() => ue(
|
|
60975
|
-
if (!
|
|
61033
|
+
j(() => ue(CW(e), (t) => {
|
|
61034
|
+
if (!wW(t) || t.chatId !== e) return;
|
|
60976
61035
|
let n = t.message;
|
|
60977
|
-
if (
|
|
61036
|
+
if (wW(n)) {
|
|
60978
61037
|
let e = typeof n.id == "string" ? n.id : null, t = typeof n.role == "string" ? n.role : null, r = Array.isArray(n.parts) ? n.parts : null;
|
|
60979
61038
|
if (e && t && r) {
|
|
60980
61039
|
let i = {
|
|
60981
61040
|
id: e,
|
|
60982
61041
|
role: t,
|
|
60983
61042
|
parts: r,
|
|
60984
|
-
metadata:
|
|
61043
|
+
metadata: wW(n.metadata) ? n.metadata : { createdAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
60985
61044
|
};
|
|
60986
61045
|
F((t) => {
|
|
60987
61046
|
let n = t.findIndex((t) => t.id === e);
|
|
@@ -60994,7 +61053,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
60994
61053
|
return;
|
|
60995
61054
|
}
|
|
60996
61055
|
let r = t.part;
|
|
60997
|
-
if (!
|
|
61056
|
+
if (!wW(r)) return;
|
|
60998
61057
|
if (r.type === "start" && typeof r.messageId == "string") {
|
|
60999
61058
|
ce.current = r.messageId, de.current = "";
|
|
61000
61059
|
return;
|
|
@@ -61053,7 +61112,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
61053
61112
|
className: "relative flex h-full min-h-0 min-w-0 overflow-hidden bg-background",
|
|
61054
61113
|
children: [/* @__PURE__ */ H("div", {
|
|
61055
61114
|
className: "overscroll-behavior-contain flex h-full min-h-0 min-w-0 flex-1 touch-pan-y flex-col bg-background",
|
|
61056
|
-
children: [/* @__PURE__ */ V(
|
|
61115
|
+
children: [/* @__PURE__ */ V(xW, {
|
|
61057
61116
|
addToolApprovalResponse: ie,
|
|
61058
61117
|
chatId: e,
|
|
61059
61118
|
conversationError: M,
|
|
@@ -61071,7 +61130,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
61071
61130
|
votes: he
|
|
61072
61131
|
}), /* @__PURE__ */ V("div", {
|
|
61073
61132
|
className: "sticky bottom-0 z-1 mx-auto flex w-full max-w-4xl gap-2 border-t-0 bg-background px-2 pb-3 md:px-4 md:pb-4",
|
|
61074
|
-
children: !i && /* @__PURE__ */ V(
|
|
61133
|
+
children: !i && /* @__PURE__ */ V(QU, {
|
|
61075
61134
|
attachments: W,
|
|
61076
61135
|
chatModels: y,
|
|
61077
61136
|
defaultChatModel: b,
|
|
@@ -61079,7 +61138,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
61079
61138
|
input: C,
|
|
61080
61139
|
messages: P,
|
|
61081
61140
|
onModelChange: (e) => {
|
|
61082
|
-
E(e), k(
|
|
61141
|
+
E(e), k(kW(e, r));
|
|
61083
61142
|
},
|
|
61084
61143
|
onOpenAIReasoningEffortChange: k,
|
|
61085
61144
|
openaiReasoningEffort: O,
|
|
@@ -61093,7 +61152,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
61093
61152
|
suggestedActions: l
|
|
61094
61153
|
})
|
|
61095
61154
|
})]
|
|
61096
|
-
}), /* @__PURE__ */ V(
|
|
61155
|
+
}), /* @__PURE__ */ V(gW, {
|
|
61097
61156
|
addToolApprovalResponse: ie,
|
|
61098
61157
|
attachments: W,
|
|
61099
61158
|
chatModels: y,
|
|
@@ -61118,7 +61177,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
61118
61177
|
}
|
|
61119
61178
|
//#endregion
|
|
61120
61179
|
//#region src/components/data-stream-handler.tsx
|
|
61121
|
-
function
|
|
61180
|
+
function IW() {
|
|
61122
61181
|
let { dataStream: e, setDataStream: t } = ot(), { artifact: n, setArtifact: r, setMetadata: i } = ES();
|
|
61123
61182
|
return j(() => {
|
|
61124
61183
|
if (!e?.length) return;
|
|
@@ -61126,7 +61185,7 @@ function NW() {
|
|
|
61126
61185
|
t([]);
|
|
61127
61186
|
for (let e of a) {
|
|
61128
61187
|
if (e.type === "data-chat-title") continue;
|
|
61129
|
-
let t =
|
|
61188
|
+
let t = mW.find((e) => e.kind === n.kind);
|
|
61130
61189
|
t?.onStreamPart && t.onStreamPart({
|
|
61131
61190
|
streamPart: e,
|
|
61132
61191
|
setArtifact: r,
|
|
@@ -61174,4 +61233,4 @@ function NW() {
|
|
|
61174
61233
|
]), null;
|
|
61175
61234
|
}
|
|
61176
61235
|
//#endregion
|
|
61177
|
-
export { gy as a, Sm as c, Xe as d, $e as f, Ze as h, Cy as i, bm as l, et as m,
|
|
61236
|
+
export { gy as a, Sm as c, Xe as d, $e as f, Ze as h, Cy as i, bm as l, et as m, FW as n, Mm as o, Qe as p, by as r, xm as s, IW as t, at as u };
|