@flamingo-stack/openframe-frontend-core 0.0.373 → 0.0.374
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/{chunk-X274IBXR.cjs → chunk-2GRR6GSO.cjs} +26 -26
- package/dist/{chunk-X274IBXR.cjs.map → chunk-2GRR6GSO.cjs.map} +1 -1
- package/dist/{chunk-6OJHTN7B.cjs → chunk-4DXWRLC4.cjs} +57 -57
- package/dist/{chunk-6OJHTN7B.cjs.map → chunk-4DXWRLC4.cjs.map} +1 -1
- package/dist/{chunk-FCPUM5S2.cjs → chunk-5SCIL5IK.cjs} +62 -62
- package/dist/{chunk-FCPUM5S2.cjs.map → chunk-5SCIL5IK.cjs.map} +1 -1
- package/dist/{chunk-AFF6QBKL.cjs → chunk-64TM6YLI.cjs} +37 -37
- package/dist/{chunk-AFF6QBKL.cjs.map → chunk-64TM6YLI.cjs.map} +1 -1
- package/dist/{chunk-CCBQGC44.js → chunk-6LKITKDS.js} +4 -4
- package/dist/{chunk-LD7WDZQC.js → chunk-7ZAFRNT4.js} +2 -2
- package/dist/{chunk-OTSWZF3C.js → chunk-BCIETCTQ.js} +4 -4
- package/dist/{chunk-DUFK7RSU.js → chunk-BJX5HYBU.js} +2 -2
- package/dist/{chunk-TH2LDBFE.js → chunk-CTHA7BMH.js} +2 -2
- package/dist/{chunk-4YQY3YBQ.js → chunk-EPR4XXRC.js} +2 -2
- package/dist/{chunk-7YKIXCV3.cjs → chunk-HA3KJN4J.cjs} +7 -7
- package/dist/{chunk-7YKIXCV3.cjs.map → chunk-HA3KJN4J.cjs.map} +1 -1
- package/dist/{chunk-MTT4SFN6.cjs → chunk-L7VRUDAP.cjs} +5 -5
- package/dist/{chunk-MTT4SFN6.cjs.map → chunk-L7VRUDAP.cjs.map} +1 -1
- package/dist/{chunk-IH4IPKF2.js → chunk-LDLRTG7B.js} +4 -4
- package/dist/{chunk-4JIVPFPK.cjs → chunk-NMESBNMS.cjs} +25 -25
- package/dist/{chunk-4JIVPFPK.cjs.map → chunk-NMESBNMS.cjs.map} +1 -1
- package/dist/{chunk-RHKIYRJJ.js → chunk-NP3VAQE5.js} +2 -2
- package/dist/{chunk-M4O75TCN.js → chunk-NVFKRKYO.js} +4 -4
- package/dist/{chunk-IDYD2EIV.js → chunk-PUUB3ETT.js} +2 -2
- package/dist/{chunk-ANKXC5RY.cjs → chunk-QOPI56UU.cjs} +31 -31
- package/dist/{chunk-ANKXC5RY.cjs.map → chunk-QOPI56UU.cjs.map} +1 -1
- package/dist/{chunk-DDI7FFA5.js → chunk-UHO2TI5O.js} +185 -152
- package/dist/{chunk-DDI7FFA5.js.map → chunk-UHO2TI5O.js.map} +1 -1
- package/dist/{chunk-JDYNGJSD.js → chunk-USUHSONY.js} +2 -2
- package/dist/{chunk-4RUTFRJ6.cjs → chunk-V653GV4M.cjs} +365 -332
- package/dist/chunk-V653GV4M.cjs.map +1 -0
- package/dist/{chunk-3N34BFBP.cjs → chunk-VS4RCAXP.cjs} +15 -15
- package/dist/{chunk-3N34BFBP.cjs.map → chunk-VS4RCAXP.cjs.map} +1 -1
- package/dist/{chunk-XNP2LIYD.cjs → chunk-YZLZ35DX.cjs} +9 -9
- package/dist/{chunk-XNP2LIYD.cjs.map → chunk-YZLZ35DX.cjs.map} +1 -1
- package/dist/{chunk-3QTBIUB7.cjs → chunk-ZEYGYL76.cjs} +12 -12
- package/dist/{chunk-3QTBIUB7.cjs.map → chunk-ZEYGYL76.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +5 -5
- package/dist/components/docs/index.js +4 -4
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/help-center-pages/index.cjs +20 -20
- package/dist/components/help-center-pages/index.js +11 -11
- package/dist/components/index.cjs +120 -120
- package/dist/components/index.js +9 -9
- package/dist/components/navigation/app-layout-drawer.d.ts.map +1 -1
- package/dist/components/navigation/app-layout.d.ts +20 -0
- package/dist/components/navigation/app-layout.d.ts.map +1 -1
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/tickets/index.cjs +5 -5
- package/dist/components/tickets/index.js +4 -4
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/navigation/app-layout-drawer.tsx +23 -1
- package/src/components/navigation/app-layout.tsx +50 -2
- package/dist/chunk-4RUTFRJ6.cjs.map +0 -1
- /package/dist/{chunk-CCBQGC44.js.map → chunk-6LKITKDS.js.map} +0 -0
- /package/dist/{chunk-LD7WDZQC.js.map → chunk-7ZAFRNT4.js.map} +0 -0
- /package/dist/{chunk-OTSWZF3C.js.map → chunk-BCIETCTQ.js.map} +0 -0
- /package/dist/{chunk-DUFK7RSU.js.map → chunk-BJX5HYBU.js.map} +0 -0
- /package/dist/{chunk-TH2LDBFE.js.map → chunk-CTHA7BMH.js.map} +0 -0
- /package/dist/{chunk-4YQY3YBQ.js.map → chunk-EPR4XXRC.js.map} +0 -0
- /package/dist/{chunk-IH4IPKF2.js.map → chunk-LDLRTG7B.js.map} +0 -0
- /package/dist/{chunk-RHKIYRJJ.js.map → chunk-NP3VAQE5.js.map} +0 -0
- /package/dist/{chunk-M4O75TCN.js.map → chunk-NVFKRKYO.js.map} +0 -0
- /package/dist/{chunk-IDYD2EIV.js.map → chunk-PUUB3ETT.js.map} +0 -0
- /package/dist/{chunk-JDYNGJSD.js.map → chunk-USUHSONY.js.map} +0 -0
|
@@ -24089,7 +24089,7 @@ function OrganizationCard({
|
|
|
24089
24089
|
|
|
24090
24090
|
// src/components/ui/service-card.tsx
|
|
24091
24091
|
init_cn();
|
|
24092
|
-
import { useMemo as
|
|
24092
|
+
import { useMemo as useMemo35, useState as useState85 } from "react";
|
|
24093
24093
|
import { ExternalLink as ExternalLink7 } from "lucide-react";
|
|
24094
24094
|
|
|
24095
24095
|
// src/components/providers/dynamic-theme-provider.tsx
|
|
@@ -33623,7 +33623,7 @@ function NotificationsHeaderButton({
|
|
|
33623
33623
|
}
|
|
33624
33624
|
|
|
33625
33625
|
// src/components/navigation/app-layout.tsx
|
|
33626
|
-
import { createContext as createContext9, Suspense as Suspense2, useCallback as useCallback35, useContext as useContext9, useState as useState83 } from "react";
|
|
33626
|
+
import { createContext as createContext9, Suspense as Suspense2, useCallback as useCallback35, useContext as useContext9, useMemo as useMemo34, useRef as useRef45, useState as useState83 } from "react";
|
|
33627
33627
|
|
|
33628
33628
|
// src/components/navigation/mobile-burger-menu.tsx
|
|
33629
33629
|
import React109, { useCallback as useCallback34, useEffect as useEffect64 } from "react";
|
|
@@ -33829,6 +33829,10 @@ var AppLayoutDrawerContainerContext = createContext9(null);
|
|
|
33829
33829
|
function useAppLayoutDrawerContainer() {
|
|
33830
33830
|
return useContext9(AppLayoutDrawerContainerContext);
|
|
33831
33831
|
}
|
|
33832
|
+
var AppLayoutDrawerCoordinationContext = createContext9(null);
|
|
33833
|
+
function useAppLayoutDrawerCoordination() {
|
|
33834
|
+
return useContext9(AppLayoutDrawerCoordinationContext);
|
|
33835
|
+
}
|
|
33832
33836
|
function AppLayout({
|
|
33833
33837
|
children,
|
|
33834
33838
|
sidebarConfig,
|
|
@@ -33842,13 +33846,27 @@ function AppLayout({
|
|
|
33842
33846
|
}) {
|
|
33843
33847
|
const [mobileMenuOpen, setMobileMenuOpen] = useState83(false);
|
|
33844
33848
|
const [drawerContainer, setDrawerContainer] = useState83(null);
|
|
33849
|
+
const mobileMenuOpenRef = useRef45(mobileMenuOpen);
|
|
33850
|
+
mobileMenuOpenRef.current = mobileMenuOpen;
|
|
33851
|
+
const drawerHandlesRef = useRef45(/* @__PURE__ */ new Set());
|
|
33845
33852
|
const handleToggleMobileMenu = useCallback35(() => {
|
|
33846
|
-
|
|
33853
|
+
const opening = !mobileMenuOpenRef.current;
|
|
33854
|
+
if (opening) {
|
|
33855
|
+
for (const handle of drawerHandlesRef.current) handle.close();
|
|
33856
|
+
}
|
|
33857
|
+
setMobileMenuOpen(opening);
|
|
33847
33858
|
}, []);
|
|
33848
33859
|
const handleCloseMobileMenu = useCallback35(() => {
|
|
33849
33860
|
setMobileMenuOpen(false);
|
|
33850
33861
|
}, []);
|
|
33851
|
-
|
|
33862
|
+
const drawerCoordination = useMemo34(() => ({
|
|
33863
|
+
notifyDrawerDidOpen: () => setMobileMenuOpen(false),
|
|
33864
|
+
registerDrawer: (handle) => {
|
|
33865
|
+
drawerHandlesRef.current.add(handle);
|
|
33866
|
+
return () => drawerHandlesRef.current.delete(handle);
|
|
33867
|
+
}
|
|
33868
|
+
}), []);
|
|
33869
|
+
return /* @__PURE__ */ jsx262(AppLayoutDrawerContainerContext.Provider, { value: drawerContainer, children: /* @__PURE__ */ jsx262(AppLayoutDrawerCoordinationContext.Provider, { value: drawerCoordination, children: /* @__PURE__ */ jsxs207("div", { className: cn("flex h-screen bg-ods-bg", className), children: [
|
|
33852
33870
|
/* @__PURE__ */ jsx262(NavigationSidebar, { config: sidebarConfig, disabled }),
|
|
33853
33871
|
/* @__PURE__ */ jsx262(
|
|
33854
33872
|
MobileBurgerMenu,
|
|
@@ -33883,7 +33901,7 @@ function AppLayout({
|
|
|
33883
33901
|
}
|
|
33884
33902
|
)
|
|
33885
33903
|
] })
|
|
33886
|
-
] }) });
|
|
33904
|
+
] }) }) });
|
|
33887
33905
|
}
|
|
33888
33906
|
|
|
33889
33907
|
// src/components/navigation/app-layout-drawer.tsx
|
|
@@ -33911,6 +33929,21 @@ var AppLayoutDrawerRoot = ({
|
|
|
33911
33929
|
},
|
|
33912
33930
|
[isControlled, onOpenChange]
|
|
33913
33931
|
);
|
|
33932
|
+
const coordination = useAppLayoutDrawerCoordination();
|
|
33933
|
+
const openRef = React110.useRef(open);
|
|
33934
|
+
openRef.current = open;
|
|
33935
|
+
const handleOpenChangeRef = React110.useRef(handleOpenChange);
|
|
33936
|
+
handleOpenChangeRef.current = handleOpenChange;
|
|
33937
|
+
React110.useEffect(() => {
|
|
33938
|
+
if (open) coordination?.notifyDrawerDidOpen();
|
|
33939
|
+
}, [open, coordination]);
|
|
33940
|
+
React110.useEffect(() => {
|
|
33941
|
+
return coordination?.registerDrawer({
|
|
33942
|
+
close: () => {
|
|
33943
|
+
if (openRef.current) handleOpenChangeRef.current(false);
|
|
33944
|
+
}
|
|
33945
|
+
});
|
|
33946
|
+
}, [coordination]);
|
|
33914
33947
|
return /* @__PURE__ */ jsx263(DrawerOpenContext.Provider, { value: open, children: /* @__PURE__ */ jsx263(
|
|
33915
33948
|
DialogPrimitive3.Root,
|
|
33916
33949
|
{
|
|
@@ -34906,7 +34939,7 @@ ScriptArguments.displayName = "ScriptArguments";
|
|
|
34906
34939
|
|
|
34907
34940
|
// src/components/shared/onboarding/onboarding-walkthrough.tsx
|
|
34908
34941
|
init_button2();
|
|
34909
|
-
import React112, { useRef as
|
|
34942
|
+
import React112, { useRef as useRef47, useCallback as useCallback37 } from "react";
|
|
34910
34943
|
|
|
34911
34944
|
// src/components/shared/onboarding/onboarding-step-card.tsx
|
|
34912
34945
|
import React111 from "react";
|
|
@@ -35030,10 +35063,10 @@ function OnboardingWalkthrough({
|
|
|
35030
35063
|
allStepsComplete,
|
|
35031
35064
|
markMultipleComplete
|
|
35032
35065
|
} = useOnboardingState(storageKey);
|
|
35033
|
-
const hasAutoMarkedRef =
|
|
35034
|
-
const autoMarkingInProgressRef =
|
|
35035
|
-
const lastCompletionStatusRef =
|
|
35036
|
-
const actionInProgressRef =
|
|
35066
|
+
const hasAutoMarkedRef = useRef47(false);
|
|
35067
|
+
const autoMarkingInProgressRef = useRef47(false);
|
|
35068
|
+
const lastCompletionStatusRef = useRef47(null);
|
|
35069
|
+
const actionInProgressRef = useRef47(/* @__PURE__ */ new Set());
|
|
35037
35070
|
React112.useEffect(() => {
|
|
35038
35071
|
if (isLoadingCompletion) {
|
|
35039
35072
|
hasAutoMarkedRef.current = false;
|
|
@@ -35374,7 +35407,7 @@ function ServiceCard({ title, subtitle, icon, tag, rows, className }) {
|
|
|
35374
35407
|
function ServiceCardRowItem({ row }) {
|
|
35375
35408
|
const [revealed, setRevealed] = useState85(false);
|
|
35376
35409
|
const { copy, copied } = useCopyToClipboard();
|
|
35377
|
-
const actions =
|
|
35410
|
+
const actions = useMemo35(() => ({ copy: true, open: !!row.href, reveal: !!row.isSecret, ...row.actions }), [row]);
|
|
35378
35411
|
const displayValue = row.isSecret ? /* @__PURE__ */ jsx276(MaskedValue, { value: row.value, isRevealed: revealed }) : /* @__PURE__ */ jsx276("span", { children: row.value });
|
|
35379
35412
|
const handleCopy = () => copy(row.copyValue ?? row.value);
|
|
35380
35413
|
const openInNewTab = () => {
|
|
@@ -35718,7 +35751,7 @@ var ListLoader = (props) => /* @__PURE__ */ jsx281(ContentLoader, { ...props, va
|
|
|
35718
35751
|
|
|
35719
35752
|
// src/components/ui/table/table.tsx
|
|
35720
35753
|
init_cn();
|
|
35721
|
-
import { useEffect as useEffect67, useRef as
|
|
35754
|
+
import { useEffect as useEffect67, useRef as useRef49 } from "react";
|
|
35722
35755
|
init_pagination();
|
|
35723
35756
|
init_button2();
|
|
35724
35757
|
|
|
@@ -36478,8 +36511,8 @@ function Table({
|
|
|
36478
36511
|
};
|
|
36479
36512
|
const allSelected = selectedRows.length > 0 && selectedRows.length === data.length;
|
|
36480
36513
|
const someSelected = selectedRows.length > 0 && selectedRows.length < data.length;
|
|
36481
|
-
const sentinelRef =
|
|
36482
|
-
const onLoadMoreRef =
|
|
36514
|
+
const sentinelRef = useRef49(null);
|
|
36515
|
+
const onLoadMoreRef = useRef49(infiniteScroll?.onLoadMore);
|
|
36483
36516
|
onLoadMoreRef.current = infiniteScroll?.onLoadMore;
|
|
36484
36517
|
useEffect67(() => {
|
|
36485
36518
|
if (!infiniteScroll?.hasNextPage || infiniteScroll.isFetchingNextPage) return;
|
|
@@ -36695,11 +36728,11 @@ function TableTimestampCell({
|
|
|
36695
36728
|
// src/components/ui/query-report-table/query-report-table.tsx
|
|
36696
36729
|
init_cn();
|
|
36697
36730
|
init_button2();
|
|
36698
|
-
import { useMemo as
|
|
36731
|
+
import { useMemo as useMemo36 } from "react";
|
|
36699
36732
|
|
|
36700
36733
|
// src/components/ui/query-report-table/query-report-table-header.tsx
|
|
36701
36734
|
init_cn();
|
|
36702
|
-
import { useRef as
|
|
36735
|
+
import { useRef as useRef50, useState as useState87, useCallback as useCallback38 } from "react";
|
|
36703
36736
|
import { jsx as jsx293, jsxs as jsxs233 } from "react/jsx-runtime";
|
|
36704
36737
|
function QueryReportTableHeader({
|
|
36705
36738
|
columns,
|
|
@@ -36728,7 +36761,7 @@ function QueryReportTableHeader({
|
|
|
36728
36761
|
);
|
|
36729
36762
|
}
|
|
36730
36763
|
function TruncatedHeaderCell({ value, width }) {
|
|
36731
|
-
const textRef =
|
|
36764
|
+
const textRef = useRef50(null);
|
|
36732
36765
|
const [isTruncated, setIsTruncated] = useState87(false);
|
|
36733
36766
|
const checkTruncation = useCallback38(() => {
|
|
36734
36767
|
const el = textRef.current;
|
|
@@ -36758,7 +36791,7 @@ function TruncatedHeaderCell({ value, width }) {
|
|
|
36758
36791
|
|
|
36759
36792
|
// src/components/ui/query-report-table/query-report-table-row.tsx
|
|
36760
36793
|
init_cn();
|
|
36761
|
-
import { useRef as
|
|
36794
|
+
import { useRef as useRef51, useState as useState88, useCallback as useCallback39 } from "react";
|
|
36762
36795
|
import { jsx as jsx294, jsxs as jsxs234 } from "react/jsx-runtime";
|
|
36763
36796
|
function QueryReportTableRow({
|
|
36764
36797
|
row,
|
|
@@ -36804,7 +36837,7 @@ function QueryReportTableRow({
|
|
|
36804
36837
|
);
|
|
36805
36838
|
}
|
|
36806
36839
|
function TruncatedCell({ value, className }) {
|
|
36807
|
-
const textRef =
|
|
36840
|
+
const textRef = useRef51(null);
|
|
36808
36841
|
const [isTruncated, setIsTruncated] = useState88(false);
|
|
36809
36842
|
const checkTruncation = useCallback39(() => {
|
|
36810
36843
|
const el = textRef.current;
|
|
@@ -36933,7 +36966,7 @@ function QueryReportTable({
|
|
|
36933
36966
|
tableClassName
|
|
36934
36967
|
}) {
|
|
36935
36968
|
const isCompact = variant === "compact";
|
|
36936
|
-
const columns =
|
|
36969
|
+
const columns = useMemo36(
|
|
36937
36970
|
() => deriveColumns(data, columnOrder),
|
|
36938
36971
|
[data, columnOrder]
|
|
36939
36972
|
);
|
|
@@ -37069,7 +37102,7 @@ init_cn();
|
|
|
37069
37102
|
|
|
37070
37103
|
// src/components/ui/data-table/data-table-column-filter.tsx
|
|
37071
37104
|
init_cn();
|
|
37072
|
-
import { useCallback as useCallback40, useMemo as
|
|
37105
|
+
import { useCallback as useCallback40, useMemo as useMemo37 } from "react";
|
|
37073
37106
|
|
|
37074
37107
|
// src/components/ui/data-table/utils.ts
|
|
37075
37108
|
function getHideClasses2(hideAt) {
|
|
@@ -37113,7 +37146,7 @@ function DataTableColumnFilter({
|
|
|
37113
37146
|
}) {
|
|
37114
37147
|
const currentValue = column.getFilterValue();
|
|
37115
37148
|
const activeCount = currentValue?.length ?? 0;
|
|
37116
|
-
const sections =
|
|
37149
|
+
const sections = useMemo37(
|
|
37117
37150
|
() => [
|
|
37118
37151
|
{
|
|
37119
37152
|
id: column.id,
|
|
@@ -37125,7 +37158,7 @@ function DataTableColumnFilter({
|
|
|
37125
37158
|
],
|
|
37126
37159
|
[column.id, label, options]
|
|
37127
37160
|
);
|
|
37128
|
-
const currentFilters =
|
|
37161
|
+
const currentFilters = useMemo37(
|
|
37129
37162
|
() => ({ [column.id]: currentValue ?? EMPTY_ARRAY }),
|
|
37130
37163
|
[column.id, currentValue]
|
|
37131
37164
|
);
|
|
@@ -37304,7 +37337,7 @@ function DataTableEmpty({ className, ...props }) {
|
|
|
37304
37337
|
// src/components/ui/data-table/data-table-row.tsx
|
|
37305
37338
|
init_next_link();
|
|
37306
37339
|
init_cn();
|
|
37307
|
-
import { memo as memo5, useCallback as useCallback41, useRef as
|
|
37340
|
+
import { memo as memo5, useCallback as useCallback41, useRef as useRef52 } from "react";
|
|
37308
37341
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
37309
37342
|
|
|
37310
37343
|
// src/components/ui/data-table/data-table-skeleton.tsx
|
|
@@ -37388,7 +37421,7 @@ function DataTableRowImpl({
|
|
|
37388
37421
|
const hasSubRow = subRow != null && subRow !== false;
|
|
37389
37422
|
const isLinkMode = Boolean(href) && !onClick;
|
|
37390
37423
|
const isWholeCardLink = isLinkMode && !hasSubRow;
|
|
37391
|
-
const containerRef =
|
|
37424
|
+
const containerRef = useRef52(null);
|
|
37392
37425
|
const handleClick = useCallback41(
|
|
37393
37426
|
(e) => {
|
|
37394
37427
|
const target = e.target;
|
|
@@ -37554,7 +37587,7 @@ function DataTableBody({
|
|
|
37554
37587
|
}
|
|
37555
37588
|
|
|
37556
37589
|
// src/components/ui/data-table/data-table-infinite-footer.tsx
|
|
37557
|
-
import { useEffect as useEffect68, useRef as
|
|
37590
|
+
import { useEffect as useEffect68, useRef as useRef53 } from "react";
|
|
37558
37591
|
import { Fragment as Fragment57, jsx as jsx304, jsxs as jsxs242 } from "react/jsx-runtime";
|
|
37559
37592
|
function DataTableInfiniteFooter({
|
|
37560
37593
|
hasNextPage,
|
|
@@ -37563,8 +37596,8 @@ function DataTableInfiniteFooter({
|
|
|
37563
37596
|
skeletonRows = 3,
|
|
37564
37597
|
rootMargin = "200px"
|
|
37565
37598
|
}) {
|
|
37566
|
-
const sentinelRef =
|
|
37567
|
-
const onLoadMoreRef =
|
|
37599
|
+
const sentinelRef = useRef53(null);
|
|
37600
|
+
const onLoadMoreRef = useRef53(onLoadMore);
|
|
37568
37601
|
onLoadMoreRef.current = onLoadMore;
|
|
37569
37602
|
useEffect68(() => {
|
|
37570
37603
|
if (!hasNextPage || isFetchingNextPage) return;
|
|
@@ -38201,7 +38234,7 @@ function FilterList({
|
|
|
38201
38234
|
// src/components/ui/tag-search-input.tsx
|
|
38202
38235
|
import {
|
|
38203
38236
|
useEffect as useEffect70,
|
|
38204
|
-
useRef as
|
|
38237
|
+
useRef as useRef55,
|
|
38205
38238
|
useState as useState90
|
|
38206
38239
|
} from "react";
|
|
38207
38240
|
init_cn();
|
|
@@ -38236,9 +38269,9 @@ function TagSearchInput({
|
|
|
38236
38269
|
limitTags,
|
|
38237
38270
|
placeholder: currentPlaceholder
|
|
38238
38271
|
});
|
|
38239
|
-
const wrapperRef =
|
|
38240
|
-
const hiddenTagsRef =
|
|
38241
|
-
const hiddenTagsPopupRef =
|
|
38272
|
+
const wrapperRef = useRef55(null);
|
|
38273
|
+
const hiddenTagsRef = useRef55(null);
|
|
38274
|
+
const hiddenTagsPopupRef = useRef55(null);
|
|
38242
38275
|
const [showHiddenTags, setShowHiddenTags] = useState90(false);
|
|
38243
38276
|
useEffect70(() => {
|
|
38244
38277
|
if (!showHiddenTags) return;
|
|
@@ -38395,7 +38428,7 @@ function TagSearchInput({
|
|
|
38395
38428
|
}
|
|
38396
38429
|
|
|
38397
38430
|
// src/components/ui/markdown-editor.tsx
|
|
38398
|
-
import { useRef as
|
|
38431
|
+
import { useRef as useRef56, useCallback as useCallback42, useState as useState91, useEffect as useEffect71 } from "react";
|
|
38399
38432
|
init_cn();
|
|
38400
38433
|
import { Loader2 as Loader29, Upload as Upload8 } from "lucide-react";
|
|
38401
38434
|
import { jsx as jsx309, jsxs as jsxs247 } from "react/jsx-runtime";
|
|
@@ -38450,7 +38483,7 @@ function MarkdownEditor({
|
|
|
38450
38483
|
onFileUploaded,
|
|
38451
38484
|
renderPreview
|
|
38452
38485
|
}) {
|
|
38453
|
-
const fileInputRef =
|
|
38486
|
+
const fileInputRef = useRef56(null);
|
|
38454
38487
|
const [isUploading, setIsUploading] = useState91(false);
|
|
38455
38488
|
const [uploadProgress, setUploadProgress] = useState91("");
|
|
38456
38489
|
const [defaultExtraCommands, setDefaultExtraCommands] = useState91([]);
|
|
@@ -38543,11 +38576,11 @@ function MarkdownEditor({
|
|
|
38543
38576
|
}
|
|
38544
38577
|
} : null;
|
|
38545
38578
|
const extraCommands = uploadCommand ? [...defaultExtraCommands, uploadCommand] : defaultExtraCommands;
|
|
38546
|
-
const wrapperRef =
|
|
38547
|
-
const isDraggingRef =
|
|
38548
|
-
const mouseYRef =
|
|
38549
|
-
const rafRef =
|
|
38550
|
-
const scrollParentRef =
|
|
38579
|
+
const wrapperRef = useRef56(null);
|
|
38580
|
+
const isDraggingRef = useRef56(false);
|
|
38581
|
+
const mouseYRef = useRef56(0);
|
|
38582
|
+
const rafRef = useRef56(0);
|
|
38583
|
+
const scrollParentRef = useRef56(window);
|
|
38551
38584
|
const EDGE_ZONE = 60;
|
|
38552
38585
|
const MAX_SCROLL_SPEED = 15;
|
|
38553
38586
|
const findScrollParent = useCallback42((el) => {
|
|
@@ -44125,7 +44158,7 @@ function renderChatInlineEntityCard(chatRef, options = {}) {
|
|
|
44125
44158
|
}
|
|
44126
44159
|
|
|
44127
44160
|
// src/components/chat/hooks/use-chunk-catchup.ts
|
|
44128
|
-
import { useCallback as useCallback44, useRef as
|
|
44161
|
+
import { useCallback as useCallback44, useRef as useRef60 } from "react";
|
|
44129
44162
|
function makeSeqKey(messageType, chunkType, sequenceId) {
|
|
44130
44163
|
return `${messageType}:${chunkType}:${sequenceId}`;
|
|
44131
44164
|
}
|
|
@@ -44147,20 +44180,20 @@ function useChunkCatchup({
|
|
|
44147
44180
|
chatTypes = [CHAT_TYPE.CLIENT],
|
|
44148
44181
|
fetchChunks
|
|
44149
44182
|
}) {
|
|
44150
|
-
const processedSequenceKeys =
|
|
44151
|
-
const lastSequenceId =
|
|
44152
|
-
const fetchingInProgress =
|
|
44153
|
-
const lastFetchParams =
|
|
44154
|
-
const chunkBuffer =
|
|
44155
|
-
const bufferUntilInitialCatchupComplete =
|
|
44156
|
-
const hasCompletedInitialCatchup =
|
|
44157
|
-
const dialogIdRef =
|
|
44183
|
+
const processedSequenceKeys = useRef60(/* @__PURE__ */ new Set());
|
|
44184
|
+
const lastSequenceId = useRef60(null);
|
|
44185
|
+
const fetchingInProgress = useRef60(false);
|
|
44186
|
+
const lastFetchParams = useRef60(null);
|
|
44187
|
+
const chunkBuffer = useRef60([]);
|
|
44188
|
+
const bufferUntilInitialCatchupComplete = useRef60(false);
|
|
44189
|
+
const hasCompletedInitialCatchup = useRef60(false);
|
|
44190
|
+
const dialogIdRef = useRef60(dialogId);
|
|
44158
44191
|
dialogIdRef.current = dialogId;
|
|
44159
|
-
const chatTypesRef =
|
|
44192
|
+
const chatTypesRef = useRef60(chatTypes);
|
|
44160
44193
|
chatTypesRef.current = chatTypes;
|
|
44161
|
-
const fetchChunksRef =
|
|
44194
|
+
const fetchChunksRef = useRef60(fetchChunks);
|
|
44162
44195
|
fetchChunksRef.current = fetchChunks;
|
|
44163
|
-
const onChunkReceivedRef =
|
|
44196
|
+
const onChunkReceivedRef = useRef60(onChunkReceived);
|
|
44164
44197
|
onChunkReceivedRef.current = onChunkReceived;
|
|
44165
44198
|
const processChunk = useCallback44((chunk, messageType, forceProcess = false) => {
|
|
44166
44199
|
if (bufferUntilInitialCatchupComplete.current && !forceProcess) {
|
|
@@ -44337,7 +44370,7 @@ function useChunkCatchup({
|
|
|
44337
44370
|
}
|
|
44338
44371
|
|
|
44339
44372
|
// src/components/chat/hooks/use-jetstream-dialog-subscription.ts
|
|
44340
|
-
import { useEffect as useEffect75, useRef as
|
|
44373
|
+
import { useEffect as useEffect75, useRef as useRef61, useState as useState101 } from "react";
|
|
44341
44374
|
var DEFAULT_INACTIVE_THRESHOLD_MS = 5 * 6e4;
|
|
44342
44375
|
var DEFAULT_STREAM_NAME = "CHAT_CHUNKS";
|
|
44343
44376
|
function useJetStreamDialogSubscription({
|
|
@@ -44360,51 +44393,51 @@ function useJetStreamDialogSubscription({
|
|
|
44360
44393
|
const [isSubscribed, setIsSubscribed] = useState101(false);
|
|
44361
44394
|
const [reconnectionCount, setReconnectionCount] = useState101(0);
|
|
44362
44395
|
const [currentStreamSeq, setCurrentStreamSeq] = useState101(null);
|
|
44363
|
-
const clientRef =
|
|
44364
|
-
const subscriptionRef =
|
|
44365
|
-
const highestStreamSeqRef =
|
|
44366
|
-
const onEventRef =
|
|
44396
|
+
const clientRef = useRef61(null);
|
|
44397
|
+
const subscriptionRef = useRef61(null);
|
|
44398
|
+
const highestStreamSeqRef = useRef61(null);
|
|
44399
|
+
const onEventRef = useRef61(onEvent);
|
|
44367
44400
|
useEffect75(() => {
|
|
44368
44401
|
onEventRef.current = onEvent;
|
|
44369
44402
|
}, [onEvent]);
|
|
44370
|
-
const onConnectRef =
|
|
44403
|
+
const onConnectRef = useRef61(onConnect);
|
|
44371
44404
|
useEffect75(() => {
|
|
44372
44405
|
onConnectRef.current = onConnect;
|
|
44373
44406
|
}, [onConnect]);
|
|
44374
|
-
const onDisconnectRef =
|
|
44407
|
+
const onDisconnectRef = useRef61(onDisconnect);
|
|
44375
44408
|
useEffect75(() => {
|
|
44376
44409
|
onDisconnectRef.current = onDisconnect;
|
|
44377
44410
|
}, [onDisconnect]);
|
|
44378
|
-
const onSubscribedRef =
|
|
44411
|
+
const onSubscribedRef = useRef61(onSubscribed);
|
|
44379
44412
|
useEffect75(() => {
|
|
44380
44413
|
onSubscribedRef.current = onSubscribed;
|
|
44381
44414
|
}, [onSubscribed]);
|
|
44382
|
-
const onBeforeReconnectRef =
|
|
44415
|
+
const onBeforeReconnectRef = useRef61(onBeforeReconnect);
|
|
44383
44416
|
useEffect75(() => {
|
|
44384
44417
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
44385
44418
|
}, [onBeforeReconnect]);
|
|
44386
|
-
const getNatsWsUrlRef =
|
|
44419
|
+
const getNatsWsUrlRef = useRef61(getNatsWsUrl);
|
|
44387
44420
|
useEffect75(() => {
|
|
44388
44421
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
44389
44422
|
}, [getNatsWsUrl]);
|
|
44390
|
-
const reconnectionBackoffRef =
|
|
44423
|
+
const reconnectionBackoffRef = useRef61(reconnectionBackoff);
|
|
44391
44424
|
useEffect75(() => {
|
|
44392
44425
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
44393
44426
|
}, [reconnectionBackoff]);
|
|
44394
|
-
const optStartSeqRef =
|
|
44427
|
+
const optStartSeqRef = useRef61(optStartSeq);
|
|
44395
44428
|
useEffect75(() => {
|
|
44396
44429
|
optStartSeqRef.current = optStartSeq;
|
|
44397
44430
|
}, [optStartSeq]);
|
|
44398
|
-
const inactiveThresholdRef =
|
|
44431
|
+
const inactiveThresholdRef = useRef61(inactiveThresholdMs);
|
|
44399
44432
|
useEffect75(() => {
|
|
44400
44433
|
inactiveThresholdRef.current = inactiveThresholdMs;
|
|
44401
44434
|
}, [inactiveThresholdMs]);
|
|
44402
|
-
const hadConnectionBeforeRef =
|
|
44403
|
-
const clientConfigRef =
|
|
44435
|
+
const hadConnectionBeforeRef = useRef61(false);
|
|
44436
|
+
const clientConfigRef = useRef61(clientConfig);
|
|
44404
44437
|
useEffect75(() => {
|
|
44405
44438
|
clientConfigRef.current = clientConfig;
|
|
44406
44439
|
}, [clientConfig]);
|
|
44407
|
-
const currentWsUrlRef =
|
|
44440
|
+
const currentWsUrlRef = useRef61("");
|
|
44408
44441
|
const wsUrl = getNatsWsUrl();
|
|
44409
44442
|
useEffect75(() => {
|
|
44410
44443
|
if (!enabled || !wsUrl) {
|
|
@@ -44578,7 +44611,7 @@ function useJetStreamDialogSubscription({
|
|
|
44578
44611
|
}
|
|
44579
44612
|
|
|
44580
44613
|
// src/components/chat/hooks/use-nats-dialog-subscription.ts
|
|
44581
|
-
import { useEffect as useEffect76, useRef as
|
|
44614
|
+
import { useEffect as useEffect76, useRef as useRef62, useState as useState102 } from "react";
|
|
44582
44615
|
function useNatsDialogSubscription({
|
|
44583
44616
|
enabled,
|
|
44584
44617
|
dialogId,
|
|
@@ -44595,42 +44628,42 @@ function useNatsDialogSubscription({
|
|
|
44595
44628
|
const [isConnected, setIsConnected] = useState102(false);
|
|
44596
44629
|
const [isSubscribed, setIsSubscribed] = useState102(false);
|
|
44597
44630
|
const [reconnectionCount, setReconnectionCount] = useState102(0);
|
|
44598
|
-
const clientRef =
|
|
44599
|
-
const subscriptionRefs =
|
|
44600
|
-
const onEventRef =
|
|
44631
|
+
const clientRef = useRef62(null);
|
|
44632
|
+
const subscriptionRefs = useRef62(/* @__PURE__ */ new Map());
|
|
44633
|
+
const onEventRef = useRef62(onEvent);
|
|
44601
44634
|
useEffect76(() => {
|
|
44602
44635
|
onEventRef.current = onEvent;
|
|
44603
44636
|
}, [onEvent]);
|
|
44604
|
-
const onConnectRef =
|
|
44637
|
+
const onConnectRef = useRef62(onConnect);
|
|
44605
44638
|
useEffect76(() => {
|
|
44606
44639
|
onConnectRef.current = onConnect;
|
|
44607
44640
|
}, [onConnect]);
|
|
44608
|
-
const onDisconnectRef =
|
|
44641
|
+
const onDisconnectRef = useRef62(onDisconnect);
|
|
44609
44642
|
useEffect76(() => {
|
|
44610
44643
|
onDisconnectRef.current = onDisconnect;
|
|
44611
44644
|
}, [onDisconnect]);
|
|
44612
|
-
const onSubscribedRef =
|
|
44645
|
+
const onSubscribedRef = useRef62(onSubscribed);
|
|
44613
44646
|
useEffect76(() => {
|
|
44614
44647
|
onSubscribedRef.current = onSubscribed;
|
|
44615
44648
|
}, [onSubscribed]);
|
|
44616
|
-
const onBeforeReconnectRef =
|
|
44649
|
+
const onBeforeReconnectRef = useRef62(onBeforeReconnect);
|
|
44617
44650
|
useEffect76(() => {
|
|
44618
44651
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
44619
44652
|
}, [onBeforeReconnect]);
|
|
44620
|
-
const hadConnectionBeforeRef =
|
|
44621
|
-
const getNatsWsUrlRef =
|
|
44653
|
+
const hadConnectionBeforeRef = useRef62(false);
|
|
44654
|
+
const getNatsWsUrlRef = useRef62(getNatsWsUrl);
|
|
44622
44655
|
useEffect76(() => {
|
|
44623
44656
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
44624
44657
|
}, [getNatsWsUrl]);
|
|
44625
|
-
const reconnectionBackoffRef =
|
|
44658
|
+
const reconnectionBackoffRef = useRef62(reconnectionBackoff);
|
|
44626
44659
|
useEffect76(() => {
|
|
44627
44660
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
44628
44661
|
}, [reconnectionBackoff]);
|
|
44629
|
-
const clientConfigRef =
|
|
44662
|
+
const clientConfigRef = useRef62(clientConfig);
|
|
44630
44663
|
useEffect76(() => {
|
|
44631
44664
|
clientConfigRef.current = clientConfig;
|
|
44632
44665
|
}, [clientConfig]);
|
|
44633
|
-
const currentWsUrlRef =
|
|
44666
|
+
const currentWsUrlRef = useRef62("");
|
|
44634
44667
|
const wsUrl = getNatsWsUrl();
|
|
44635
44668
|
useEffect76(() => {
|
|
44636
44669
|
if (!enabled || !wsUrl) {
|
|
@@ -44714,13 +44747,13 @@ function useNatsDialogSubscription({
|
|
|
44714
44747
|
};
|
|
44715
44748
|
}, [enabled, wsUrl]);
|
|
44716
44749
|
const topicsKey = topics.join(",");
|
|
44717
|
-
const lastSubscribedDialogIdRef =
|
|
44718
|
-
const isConnectedRef =
|
|
44750
|
+
const lastSubscribedDialogIdRef = useRef62(null);
|
|
44751
|
+
const isConnectedRef = useRef62(isConnected);
|
|
44719
44752
|
useEffect76(() => {
|
|
44720
44753
|
isConnectedRef.current = isConnected;
|
|
44721
44754
|
}, [isConnected]);
|
|
44722
|
-
const currentDialogIdRef =
|
|
44723
|
-
const abortControllerRef =
|
|
44755
|
+
const currentDialogIdRef = useRef62(null);
|
|
44756
|
+
const abortControllerRef = useRef62(null);
|
|
44724
44757
|
useEffect76(() => {
|
|
44725
44758
|
currentDialogIdRef.current = dialogId;
|
|
44726
44759
|
if (!enabled || !dialogId) {
|
|
@@ -44852,7 +44885,7 @@ function buildNatsWsUrl(apiBaseUrl, options) {
|
|
|
44852
44885
|
}
|
|
44853
44886
|
|
|
44854
44887
|
// src/components/chat/hooks/use-realtime-chunk-processor.ts
|
|
44855
|
-
import { useCallback as useCallback45, useRef as
|
|
44888
|
+
import { useCallback as useCallback45, useRef as useRef63, useEffect as useEffect77 } from "react";
|
|
44856
44889
|
|
|
44857
44890
|
// src/components/chat/utils/chunk-parser.ts
|
|
44858
44891
|
function normalizeToolCalls(raw) {
|
|
@@ -45503,13 +45536,13 @@ function useRealtimeChunkProcessor(options) {
|
|
|
45503
45536
|
batchApprovalsEnabled = true,
|
|
45504
45537
|
isDirectMode = false
|
|
45505
45538
|
} = options;
|
|
45506
|
-
const accumulatorRef =
|
|
45539
|
+
const accumulatorRef = useRef63(
|
|
45507
45540
|
createMessageSegmentAccumulator({
|
|
45508
45541
|
onApprove: callbacks.onApprove,
|
|
45509
45542
|
onReject: callbacks.onReject
|
|
45510
45543
|
})
|
|
45511
45544
|
);
|
|
45512
|
-
const hasInitializedWithData =
|
|
45545
|
+
const hasInitializedWithData = useRef63(false);
|
|
45513
45546
|
useEffect77(() => {
|
|
45514
45547
|
if (initialState && !hasInitializedWithData.current) {
|
|
45515
45548
|
accumulatorRef.current.initializeWithState(initialState);
|
|
@@ -45523,14 +45556,14 @@ function useRealtimeChunkProcessor(options) {
|
|
|
45523
45556
|
hasInitializedWithData.current = true;
|
|
45524
45557
|
}
|
|
45525
45558
|
}, [initialState, callbacks]);
|
|
45526
|
-
const isInStreamRef =
|
|
45527
|
-
const hasEverStreamedRef =
|
|
45528
|
-
const directModeFlagRef =
|
|
45529
|
-
const sawDirectMessageRef =
|
|
45559
|
+
const isInStreamRef = useRef63(false);
|
|
45560
|
+
const hasEverStreamedRef = useRef63(false);
|
|
45561
|
+
const directModeFlagRef = useRef63(isDirectMode);
|
|
45562
|
+
const sawDirectMessageRef = useRef63(false);
|
|
45530
45563
|
useEffect77(() => {
|
|
45531
45564
|
directModeFlagRef.current = isDirectMode;
|
|
45532
45565
|
}, [isDirectMode]);
|
|
45533
|
-
const pendingEscalatedRef =
|
|
45566
|
+
const pendingEscalatedRef = useRef63(/* @__PURE__ */ new Map());
|
|
45534
45567
|
const processChunk = useCallback45(
|
|
45535
45568
|
(chunk) => {
|
|
45536
45569
|
const action = parseChunkToAction(chunk);
|
|
@@ -45913,7 +45946,7 @@ function useEmptyStateConfig(emptyStateUrl, options) {
|
|
|
45913
45946
|
}
|
|
45914
45947
|
|
|
45915
45948
|
// src/components/chat/hooks/use-chat-attachments.ts
|
|
45916
|
-
import { useCallback as useCallback46, useMemo as
|
|
45949
|
+
import { useCallback as useCallback46, useMemo as useMemo40, useRef as useRef64, useState as useState104 } from "react";
|
|
45917
45950
|
import { fileTypeFromBlob } from "file-type";
|
|
45918
45951
|
var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
|
|
45919
45952
|
var CHAT_ATTACHMENTS_FOLDER = "chat";
|
|
@@ -45990,7 +46023,7 @@ function useChatAttachments() {
|
|
|
45990
46023
|
const runtime = useRequiredChatRuntime();
|
|
45991
46024
|
const uploadUrlEndpoint = runtime.endpoints.attachmentUploadUrl;
|
|
45992
46025
|
const [attachments, setAttachments] = useState104([]);
|
|
45993
|
-
const controllersRef =
|
|
46026
|
+
const controllersRef = useRef64(/* @__PURE__ */ new Map());
|
|
45994
46027
|
const updateOne = useCallback46((id, patch) => {
|
|
45995
46028
|
setAttachments((prev) => prev.map((a) => a.id === id ? { ...a, ...patch } : a));
|
|
45996
46029
|
}, []);
|
|
@@ -46079,7 +46112,7 @@ function useChatAttachments() {
|
|
|
46079
46112
|
},
|
|
46080
46113
|
[uploadUrlEndpoint, updateOne]
|
|
46081
46114
|
);
|
|
46082
|
-
const attachmentsRef =
|
|
46115
|
+
const attachmentsRef = useRef64([]);
|
|
46083
46116
|
attachmentsRef.current = attachments;
|
|
46084
46117
|
const addFiles = useCallback46(
|
|
46085
46118
|
(files) => {
|
|
@@ -46130,7 +46163,7 @@ function useChatAttachments() {
|
|
|
46130
46163
|
},
|
|
46131
46164
|
[uploadOne]
|
|
46132
46165
|
);
|
|
46133
|
-
const readyAttachments =
|
|
46166
|
+
const readyAttachments = useMemo40(
|
|
46134
46167
|
() => attachments.filter(
|
|
46135
46168
|
(a) => a.status === "ready" && !!a.storagePath && !!a.viewToken
|
|
46136
46169
|
).map((a) => ({
|
|
@@ -46156,13 +46189,13 @@ function useChatAttachments() {
|
|
|
46156
46189
|
}
|
|
46157
46190
|
|
|
46158
46191
|
// src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
|
|
46159
|
-
import { useCallback as useCallback47, useEffect as useEffect79, useRef as
|
|
46192
|
+
import { useCallback as useCallback47, useEffect as useEffect79, useRef as useRef65, useState as useState105 } from "react";
|
|
46160
46193
|
import { jsx as jsx333 } from "react/jsx-runtime";
|
|
46161
46194
|
var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
|
|
46162
46195
|
function useChatAttachmentImageGallery() {
|
|
46163
46196
|
const runtime = useRequiredChatRuntime();
|
|
46164
46197
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
46165
|
-
const panelRef =
|
|
46198
|
+
const panelRef = useRef65(null);
|
|
46166
46199
|
const [state, setState] = useState105(CLOSED);
|
|
46167
46200
|
const handleClose = useCallback47(() => setState(CLOSED), []);
|
|
46168
46201
|
useEffect79(() => {
|
|
@@ -46266,10 +46299,10 @@ function useChatIdentity() {
|
|
|
46266
46299
|
}
|
|
46267
46300
|
|
|
46268
46301
|
// src/components/chat/hooks/use-close-on-navigation.ts
|
|
46269
|
-
import { useEffect as useEffect81, useRef as
|
|
46302
|
+
import { useEffect as useEffect81, useRef as useRef66 } from "react";
|
|
46270
46303
|
function useCloseOnNavigation(close, pathname) {
|
|
46271
|
-
const prevPathnameRef =
|
|
46272
|
-
const initializedRef =
|
|
46304
|
+
const prevPathnameRef = useRef66(null);
|
|
46305
|
+
const initializedRef = useRef66(false);
|
|
46273
46306
|
useEffect81(() => {
|
|
46274
46307
|
if (!initializedRef.current) {
|
|
46275
46308
|
initializedRef.current = true;
|
|
@@ -46284,14 +46317,14 @@ function useCloseOnNavigation(close, pathname) {
|
|
|
46284
46317
|
}
|
|
46285
46318
|
|
|
46286
46319
|
// src/components/chat/hooks/use-chat.ts
|
|
46287
|
-
import { useState as useState108, useCallback as useCallback49, useEffect as useEffect82, useRef as
|
|
46320
|
+
import { useState as useState108, useCallback as useCallback49, useEffect as useEffect82, useRef as useRef68 } from "react";
|
|
46288
46321
|
|
|
46289
46322
|
// src/components/chat/hooks/use-sse.ts
|
|
46290
|
-
import { useState as useState107, useCallback as useCallback48, useRef as
|
|
46323
|
+
import { useState as useState107, useCallback as useCallback48, useRef as useRef67 } from "react";
|
|
46291
46324
|
function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
46292
46325
|
const [isStreaming, setIsStreaming] = useState107(false);
|
|
46293
46326
|
const [error, setError] = useState107(null);
|
|
46294
|
-
const abortControllerRef =
|
|
46327
|
+
const abortControllerRef = useRef67(null);
|
|
46295
46328
|
const fallbackStream = useCallback48(async function* () {
|
|
46296
46329
|
throw new Error(
|
|
46297
46330
|
"[useSSE] No streamFn provided and `useMock: true` is no longer wired into the lib. Supply a `streamFn` (see `createDocStreamFn` in use-embedded-chat) or migrate the mock to your host code."
|
|
@@ -46359,8 +46392,8 @@ function useChat({
|
|
|
46359
46392
|
} = {}) {
|
|
46360
46393
|
const [messages, setMessages] = useState108(() => initialMessages ?? []);
|
|
46361
46394
|
const [isTyping, setIsTyping] = useState108(false);
|
|
46362
|
-
const currentAssistantSegmentsRef =
|
|
46363
|
-
const onMessagesChangeRef =
|
|
46395
|
+
const currentAssistantSegmentsRef = useRef68([]);
|
|
46396
|
+
const onMessagesChangeRef = useRef68(onMessagesChange);
|
|
46364
46397
|
onMessagesChangeRef.current = onMessagesChange;
|
|
46365
46398
|
useEffect82(() => {
|
|
46366
46399
|
onMessagesChangeRef.current?.(messages);
|
|
@@ -46651,7 +46684,7 @@ function useChat({
|
|
|
46651
46684
|
}
|
|
46652
46685
|
|
|
46653
46686
|
// src/components/chat/hooks/use-sse-chat-adapter.ts
|
|
46654
|
-
import { useState as useState109, useEffect as useEffect83, useCallback as useCallback50, useMemo as
|
|
46687
|
+
import { useState as useState109, useEffect as useEffect83, useCallback as useCallback50, useMemo as useMemo41, useRef as useRef69 } from "react";
|
|
46655
46688
|
function createEmptyTurnMeta() {
|
|
46656
46689
|
return {
|
|
46657
46690
|
provider: null,
|
|
@@ -46972,24 +47005,24 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
46972
47005
|
const runtime = useRequiredChatRuntime();
|
|
46973
47006
|
const source = runtime.source || DEFAULT_CHAT_SOURCE;
|
|
46974
47007
|
const tableIdForDocumentType = options?.tableIdForDocumentType ?? defaultTableIdForDocumentType;
|
|
46975
|
-
const persistedRef =
|
|
47008
|
+
const persistedRef = useRef69(null);
|
|
46976
47009
|
if (persistedRef.current === null) {
|
|
46977
47010
|
pruneStaleChatStorage(source);
|
|
46978
47011
|
persistedRef.current = loadPersistedChat(source) || { messages: [], sources: [], sendCount: 0 };
|
|
46979
47012
|
}
|
|
46980
|
-
const sourcesMapRef =
|
|
47013
|
+
const sourcesMapRef = useRef69(
|
|
46981
47014
|
new Map(persistedRef.current.sources)
|
|
46982
47015
|
);
|
|
46983
|
-
const refsMapRef =
|
|
47016
|
+
const refsMapRef = useRef69(
|
|
46984
47017
|
new Map(persistedRef.current.refs ?? [])
|
|
46985
47018
|
);
|
|
46986
|
-
const metaMapRef =
|
|
46987
|
-
const messagesRef =
|
|
46988
|
-
const sendCountRef =
|
|
47019
|
+
const metaMapRef = useRef69(/* @__PURE__ */ new Map());
|
|
47020
|
+
const messagesRef = useRef69(persistedRef.current.messages);
|
|
47021
|
+
const sendCountRef = useRef69(persistedRef.current.sendCount);
|
|
46989
47022
|
const [streamingPhase, setStreamingPhase] = useState109("idle");
|
|
46990
47023
|
const [metaTick, setMetaTick] = useState109(0);
|
|
46991
47024
|
const bumpMetaTick = useCallback50(() => setMetaTick((t) => t + 1), []);
|
|
46992
|
-
const streamFn =
|
|
47025
|
+
const streamFn = useMemo41(
|
|
46993
47026
|
() => createDocStreamFn(
|
|
46994
47027
|
source,
|
|
46995
47028
|
{
|
|
@@ -47015,7 +47048,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
47015
47048
|
const { commands: slashCommands } = useSlashCommandRegistry(commandsUrl, {
|
|
47016
47049
|
enabled: active
|
|
47017
47050
|
});
|
|
47018
|
-
const cmdIdByTableId =
|
|
47051
|
+
const cmdIdByTableId = useMemo41(() => {
|
|
47019
47052
|
const buckets = /* @__PURE__ */ new Map();
|
|
47020
47053
|
for (const cmd of slashCommands) {
|
|
47021
47054
|
if (!cmd.primarySourceId) continue;
|
|
@@ -47180,7 +47213,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
47180
47213
|
setStreamingPhase("idle");
|
|
47181
47214
|
}
|
|
47182
47215
|
}, [isTyping, isStreaming, streamingPhase]);
|
|
47183
|
-
const latestMeta =
|
|
47216
|
+
const latestMeta = useMemo41(
|
|
47184
47217
|
() => metaMapRef.current.get(sendCountRef.current - 1) ?? metaMapRef.current.get(sendCountRef.current - 2) ?? null,
|
|
47185
47218
|
[metaTick, streamingPhase]
|
|
47186
47219
|
);
|
|
@@ -47258,8 +47291,8 @@ var noopRejectRequest = async (_id, _reason) => {
|
|
|
47258
47291
|
import {
|
|
47259
47292
|
useCallback as useCallback51,
|
|
47260
47293
|
useEffect as useEffect84,
|
|
47261
|
-
useMemo as
|
|
47262
|
-
useRef as
|
|
47294
|
+
useMemo as useMemo42,
|
|
47295
|
+
useRef as useRef70,
|
|
47263
47296
|
useState as useState110
|
|
47264
47297
|
} from "react";
|
|
47265
47298
|
|
|
@@ -47801,9 +47834,9 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47801
47834
|
},
|
|
47802
47835
|
[rejectRequestCallback]
|
|
47803
47836
|
);
|
|
47804
|
-
const handleApproveRef =
|
|
47837
|
+
const handleApproveRef = useRef70(handleApprove);
|
|
47805
47838
|
handleApproveRef.current = handleApprove;
|
|
47806
|
-
const handleRejectRef =
|
|
47839
|
+
const handleRejectRef = useRef70(handleReject);
|
|
47807
47840
|
handleRejectRef.current = handleReject;
|
|
47808
47841
|
const accumApprove = useCallback51((requestId) => {
|
|
47809
47842
|
if (!requestId) return;
|
|
@@ -47813,7 +47846,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47813
47846
|
if (!requestId) return;
|
|
47814
47847
|
return handleRejectRef.current(requestId);
|
|
47815
47848
|
}, []);
|
|
47816
|
-
const callbacksRef =
|
|
47849
|
+
const callbacksRef = useRef70({
|
|
47817
47850
|
onSegmentsUpdate: (segments) => {
|
|
47818
47851
|
setMessages((prev) => updateTrailingAssistant(prev, segments));
|
|
47819
47852
|
},
|
|
@@ -47851,7 +47884,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47851
47884
|
onChunkReceived: (chunk) => processChunk(chunk),
|
|
47852
47885
|
fetchChunks
|
|
47853
47886
|
});
|
|
47854
|
-
const historyLoadSeqRef =
|
|
47887
|
+
const historyLoadSeqRef = useRef70(0);
|
|
47855
47888
|
const loadDialogHistory = useCallback51(
|
|
47856
47889
|
async (id, cursor) => {
|
|
47857
47890
|
if (!fetchDialogMessages) return;
|
|
@@ -47906,7 +47939,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47906
47939
|
accumReject
|
|
47907
47940
|
]
|
|
47908
47941
|
);
|
|
47909
|
-
const prevDialogIdRef =
|
|
47942
|
+
const prevDialogIdRef = useRef70(void 0);
|
|
47910
47943
|
useEffect84(() => {
|
|
47911
47944
|
if (prevDialogIdRef.current === dialogId) return;
|
|
47912
47945
|
prevDialogIdRef.current = dialogId;
|
|
@@ -47950,7 +47983,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47950
47983
|
}
|
|
47951
47984
|
setConnectionState("connecting");
|
|
47952
47985
|
}, [active, dialogId]);
|
|
47953
|
-
const initialDialogsLoadedRef =
|
|
47986
|
+
const initialDialogsLoadedRef = useRef70(false);
|
|
47954
47987
|
const loadDialogsPage = useCallback51(
|
|
47955
47988
|
async (cursor) => {
|
|
47956
47989
|
if (!fetchDialogs) return;
|
|
@@ -48140,7 +48173,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
48140
48173
|
const isLoading = streamingPhase !== "idle";
|
|
48141
48174
|
const hasMoreDialogs = dialogsNextCursor != null;
|
|
48142
48175
|
const hasMoreMessages = messagesNextCursor != null;
|
|
48143
|
-
return
|
|
48176
|
+
return useMemo42(
|
|
48144
48177
|
() => ({
|
|
48145
48178
|
messages,
|
|
48146
48179
|
isLoading,
|
|
@@ -48223,7 +48256,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
48223
48256
|
}
|
|
48224
48257
|
|
|
48225
48258
|
// src/components/chat/hooks/use-unified-chat.ts
|
|
48226
|
-
import { useCallback as useCallback52, useMemo as
|
|
48259
|
+
import { useCallback as useCallback52, useMemo as useMemo43, useRef as useRef71 } from "react";
|
|
48227
48260
|
var EMPTY_SSE_OPTIONS = {};
|
|
48228
48261
|
function createDisabledNatsConfig() {
|
|
48229
48262
|
return {
|
|
@@ -48238,7 +48271,7 @@ function createDisabledNatsConfig() {
|
|
|
48238
48271
|
}
|
|
48239
48272
|
function useUnifiedChat(options) {
|
|
48240
48273
|
const { modes, activeMode, mingoStateOverride } = options;
|
|
48241
|
-
const disabledNatsRef =
|
|
48274
|
+
const disabledNatsRef = useRef71(null);
|
|
48242
48275
|
if (disabledNatsRef.current === null) {
|
|
48243
48276
|
disabledNatsRef.current = createDisabledNatsConfig();
|
|
48244
48277
|
}
|
|
@@ -48252,7 +48285,7 @@ function useUnifiedChat(options) {
|
|
|
48252
48285
|
{ active: natsActive }
|
|
48253
48286
|
);
|
|
48254
48287
|
const activeState = activeMode === "guide" ? sseState : mingoStateOverride ?? natsState;
|
|
48255
|
-
const activeStateRef =
|
|
48288
|
+
const activeStateRef = useRef71(activeState);
|
|
48256
48289
|
activeStateRef.current = activeState;
|
|
48257
48290
|
const stopMessage = useCallback52(() => activeStateRef.current.stopMessage(), []);
|
|
48258
48291
|
const clearMessages = useCallback52(
|
|
@@ -48311,7 +48344,7 @@ function useUnifiedChat(options) {
|
|
|
48311
48344
|
(requestId, reason) => activeStateRef.current.rejectRequest(requestId, reason),
|
|
48312
48345
|
[]
|
|
48313
48346
|
);
|
|
48314
|
-
return
|
|
48347
|
+
return useMemo43(
|
|
48315
48348
|
() => ({
|
|
48316
48349
|
messages: activeState.messages,
|
|
48317
48350
|
isLoading: activeState.isLoading,
|
|
@@ -48562,7 +48595,7 @@ function chatChipClass({ tone, density = "chip", extra }) {
|
|
|
48562
48595
|
}
|
|
48563
48596
|
|
|
48564
48597
|
// src/components/chat/embeddable-chat.tsx
|
|
48565
|
-
import { useCallback as useCallback54, useEffect as useEffect85, useMemo as
|
|
48598
|
+
import { useCallback as useCallback54, useEffect as useEffect85, useMemo as useMemo45, useRef as useRef72, useState as useState112 } from "react";
|
|
48566
48599
|
import * as DialogPrimitive4 from "@radix-ui/react-dialog";
|
|
48567
48600
|
import { usePreventScroll } from "@react-aria/overlays";
|
|
48568
48601
|
import { isIOS } from "@react-aria/utils";
|
|
@@ -48643,7 +48676,7 @@ init_button2();
|
|
|
48643
48676
|
import { FileText as FileText8, MessageSquare as MessageSquare3 } from "lucide-react";
|
|
48644
48677
|
|
|
48645
48678
|
// src/components/chat/hooks/use-chat-dialog-manager.ts
|
|
48646
|
-
import { useCallback as useCallback53, useMemo as
|
|
48679
|
+
import { useCallback as useCallback53, useMemo as useMemo44, useState as useState111 } from "react";
|
|
48647
48680
|
function useChatDialogManager({
|
|
48648
48681
|
dialogs,
|
|
48649
48682
|
activeDialogId,
|
|
@@ -48752,7 +48785,7 @@ function useChatDialogManager({
|
|
|
48752
48785
|
clearMessages();
|
|
48753
48786
|
if (wasArchived) setArchiveOpen(true);
|
|
48754
48787
|
}, [isViewingArchived, selectDialog, clearMessages]);
|
|
48755
|
-
const activeDialog =
|
|
48788
|
+
const activeDialog = useMemo44(
|
|
48756
48789
|
() => dialogs.find((d) => d.id === activeDialogId) ?? archivedDialogs.find((d) => d.id === activeDialogId),
|
|
48757
48790
|
[dialogs, archivedDialogs, activeDialogId]
|
|
48758
48791
|
);
|
|
@@ -49107,7 +49140,7 @@ function EmbeddableChatInner({
|
|
|
49107
49140
|
return !window.matchMedia("(pointer: coarse)").matches;
|
|
49108
49141
|
});
|
|
49109
49142
|
usePreventScroll({ isDisabled: !isOpen || shellLess });
|
|
49110
|
-
const navigatingAwayRef =
|
|
49143
|
+
const navigatingAwayRef = useRef72(false);
|
|
49111
49144
|
useEffect85(() => {
|
|
49112
49145
|
if (!isOpen) return;
|
|
49113
49146
|
if (shellLess) return;
|
|
@@ -49134,9 +49167,9 @@ function EmbeddableChatInner({
|
|
|
49134
49167
|
window.scrollTo(0, scrollY);
|
|
49135
49168
|
};
|
|
49136
49169
|
}, [isOpen, shellLess]);
|
|
49137
|
-
const chatInputRef =
|
|
49170
|
+
const chatInputRef = useRef72(null);
|
|
49138
49171
|
const [quickActionPreview, setQuickActionPreview] = useState112(null);
|
|
49139
|
-
const slashCommandsProp =
|
|
49172
|
+
const slashCommandsProp = useMemo45(
|
|
49140
49173
|
() => ({
|
|
49141
49174
|
fetchCommands: (prefix, signal) => fetchSlashCommands(prefix, signal, commandsUrl),
|
|
49142
49175
|
resolveSourceIcon: (sourceId) => {
|
|
@@ -49151,12 +49184,12 @@ function EmbeddableChatInner({
|
|
|
49151
49184
|
[commandsUrl]
|
|
49152
49185
|
);
|
|
49153
49186
|
const userName = identityUser?.firstName?.trim() || identityUser?.name?.split(" ")[0]?.trim() || void 0;
|
|
49154
|
-
const effectiveModes =
|
|
49187
|
+
const effectiveModes = useMemo45(() => {
|
|
49155
49188
|
if (modes) return modes;
|
|
49156
49189
|
const guideOptions = tableIdForDocumentType ? { tableIdForDocumentType } : {};
|
|
49157
49190
|
return { guide: guideOptions };
|
|
49158
49191
|
}, [modes, tableIdForDocumentType]);
|
|
49159
|
-
const mingoCaps =
|
|
49192
|
+
const mingoCaps = useMemo45(() => {
|
|
49160
49193
|
if (mingoState) {
|
|
49161
49194
|
return {
|
|
49162
49195
|
canRename: mingoDialogCapabilities?.canRename ?? false,
|
|
@@ -49190,7 +49223,7 @@ function EmbeddableChatInner({
|
|
|
49190
49223
|
[controlledActiveMode, onActiveModeChange]
|
|
49191
49224
|
);
|
|
49192
49225
|
const { commands: commandsList, loaded: commandsLoaded } = useSlashCommandRegistry(commandsUrl, { enabled: activeMode === "guide" });
|
|
49193
|
-
const commandsById =
|
|
49226
|
+
const commandsById = useMemo45(() => {
|
|
49194
49227
|
const map = /* @__PURE__ */ new Map();
|
|
49195
49228
|
for (const cmd of commandsList) map.set(cmd.id, cmd);
|
|
49196
49229
|
return map;
|
|
@@ -49238,7 +49271,7 @@ function EmbeddableChatInner({
|
|
|
49238
49271
|
hasMoreMessages,
|
|
49239
49272
|
loadMoreMessages
|
|
49240
49273
|
} = useUnifiedChat({ modes: effectiveModes, activeMode, mingoStateOverride: mingoState });
|
|
49241
|
-
const guidePromptSentRef =
|
|
49274
|
+
const guidePromptSentRef = useRef72(false);
|
|
49242
49275
|
useEffect85(() => {
|
|
49243
49276
|
if (!guidePendingPrompt) {
|
|
49244
49277
|
guidePromptSentRef.current = false;
|
|
@@ -49263,23 +49296,23 @@ function EmbeddableChatInner({
|
|
|
49263
49296
|
const [contextItems, setContextItems] = useState112([]);
|
|
49264
49297
|
const [contextPickerOpen, setContextPickerOpen] = useState112(false);
|
|
49265
49298
|
const [mentionQuery, setMentionQuery] = useState112(null);
|
|
49266
|
-
const mentionActiveRef =
|
|
49299
|
+
const mentionActiveRef = useRef72(false);
|
|
49267
49300
|
useEffect85(() => {
|
|
49268
49301
|
mentionActiveRef.current = mentionQuery !== null;
|
|
49269
49302
|
}, [mentionQuery]);
|
|
49270
|
-
const mentionKeysRef =
|
|
49303
|
+
const mentionKeysRef = useRef72(/* @__PURE__ */ new Set());
|
|
49271
49304
|
useEffect85(() => {
|
|
49272
49305
|
setContextItems([]);
|
|
49273
49306
|
setMentionQuery(null);
|
|
49274
49307
|
mentionKeysRef.current.clear();
|
|
49275
49308
|
}, [activeDialogId, activeMode]);
|
|
49276
|
-
const mentionMarkerByType =
|
|
49309
|
+
const mentionMarkerByType = useMemo45(() => {
|
|
49277
49310
|
const m = /* @__PURE__ */ new Map();
|
|
49278
49311
|
for (const t of contextPicker?.entityTypes ?? []) if (t.marker) m.set(t.type, t.marker);
|
|
49279
49312
|
return m;
|
|
49280
49313
|
}, [contextPicker?.entityTypes]);
|
|
49281
49314
|
const contextEntityTypes = contextPicker?.entityTypes;
|
|
49282
|
-
const resolveContextIcon =
|
|
49315
|
+
const resolveContextIcon = useMemo45(() => {
|
|
49283
49316
|
const byType = /* @__PURE__ */ new Map();
|
|
49284
49317
|
for (const t of contextEntityTypes ?? []) byType.set(t.type, t.icon);
|
|
49285
49318
|
return (item) => byType.get(item.type);
|
|
@@ -49346,7 +49379,7 @@ function EmbeddableChatInner({
|
|
|
49346
49379
|
navigatingAwayRef.current = true;
|
|
49347
49380
|
setIsOpen(false);
|
|
49348
49381
|
}, [setIsOpen]);
|
|
49349
|
-
const chatPanelHandle =
|
|
49382
|
+
const chatPanelHandle = useMemo45(
|
|
49350
49383
|
() => ({ closeChat: handleNavigationClose }),
|
|
49351
49384
|
[handleNavigationClose]
|
|
49352
49385
|
);
|
|
@@ -49360,14 +49393,14 @@ function EmbeddableChatInner({
|
|
|
49360
49393
|
}),
|
|
49361
49394
|
[discussRef, displayRef, resolvedBaseRoute, chipBasePlatform, extras]
|
|
49362
49395
|
);
|
|
49363
|
-
const mingoAssistantIcon =
|
|
49396
|
+
const mingoAssistantIcon = useMemo45(
|
|
49364
49397
|
() => /* @__PURE__ */ jsx336(MingoIcon, { className: "h-6 w-6", cornerColor: "var(--ods-flamingo-cyan-base)" }),
|
|
49365
49398
|
[]
|
|
49366
49399
|
);
|
|
49367
|
-
const timestampCacheRef =
|
|
49400
|
+
const timestampCacheRef = useRef72(/* @__PURE__ */ new Map());
|
|
49368
49401
|
const guideUserName = activeMode === "guide" ? [identityUser?.firstName, identityUser?.lastName].filter(Boolean).join(" ").trim() || identityUser?.name?.trim() || void 0 : void 0;
|
|
49369
49402
|
const guideUserAvatar = activeMode === "guide" ? identityUser?.avatarUrl?.trim() || void 0 : void 0;
|
|
49370
|
-
const messages =
|
|
49403
|
+
const messages = useMemo45(() => {
|
|
49371
49404
|
const cache = timestampCacheRef.current;
|
|
49372
49405
|
const seenIds = /* @__PURE__ */ new Set();
|
|
49373
49406
|
const mapped = rawMessages.map((m) => {
|
|
@@ -49427,7 +49460,7 @@ function EmbeddableChatInner({
|
|
|
49427
49460
|
},
|
|
49428
49461
|
[sendMessage, readyAttachments, viewUrlPrefix, clearAttachments, contextItems]
|
|
49429
49462
|
);
|
|
49430
|
-
const guideSuggestedActions =
|
|
49463
|
+
const guideSuggestedActions = useMemo45(
|
|
49431
49464
|
() => {
|
|
49432
49465
|
if (effectiveQuickActions.length > 0) {
|
|
49433
49466
|
return effectiveQuickActions.map((qa) => ({
|
|
@@ -49512,11 +49545,11 @@ function EmbeddableChatInner({
|
|
|
49512
49545
|
}, [isQuickActionEmpty]);
|
|
49513
49546
|
const guideCanReturnToMingo = isGuideEmpty && hasMingoMode;
|
|
49514
49547
|
const sourceLabel = source === "flamingo" ? "Knowledge Base" : "Data Room";
|
|
49515
|
-
const enabledSet =
|
|
49548
|
+
const enabledSet = useMemo45(
|
|
49516
49549
|
() => effectiveEnabledRagTableIds ? new Set(effectiveEnabledRagTableIds) : null,
|
|
49517
49550
|
[effectiveEnabledRagTableIds]
|
|
49518
49551
|
);
|
|
49519
|
-
const chipCommands =
|
|
49552
|
+
const chipCommands = useMemo45(() => {
|
|
49520
49553
|
const out = [];
|
|
49521
49554
|
for (const cmd of commandsById.values()) {
|
|
49522
49555
|
if (cmd.displayOrder === void 0) continue;
|
|
@@ -49533,7 +49566,7 @@ function EmbeddableChatInner({
|
|
|
49533
49566
|
return out;
|
|
49534
49567
|
}, [commandsById, enabledSet]);
|
|
49535
49568
|
const lastAssistantMsg = [...rawMessages].reverse().find((m) => m.role === "assistant");
|
|
49536
|
-
const lastSources =
|
|
49569
|
+
const lastSources = useMemo45(() => {
|
|
49537
49570
|
if (chatLoading) return void 0;
|
|
49538
49571
|
const sources = lastAssistantMsg?.sources;
|
|
49539
49572
|
if (!sources || sources.length === 0) return void 0;
|
|
@@ -50800,4 +50833,4 @@ export {
|
|
|
50800
50833
|
LogsList,
|
|
50801
50834
|
assets
|
|
50802
50835
|
};
|
|
50803
|
-
//# sourceMappingURL=chunk-
|
|
50836
|
+
//# sourceMappingURL=chunk-UHO2TI5O.js.map
|