@flamingo-stack/openframe-frontend-core 0.0.584-1973.5461.1 → 0.0.584
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/chat-protocol/events.d.ts +2 -8
- package/dist/chat-protocol/events.d.ts.map +1 -1
- package/dist/chat-protocol/index.cjs +0 -188
- package/dist/chat-protocol/index.cjs.map +1 -1
- package/dist/chat-protocol/index.js +0 -188
- package/dist/chat-protocol/index.js.map +1 -1
- package/dist/chat-protocol/nats-decoder.d.ts.map +1 -1
- package/dist/{chunk-U7MJV2V7.cjs → chunk-33DHEEMP.cjs} +33 -33
- package/dist/{chunk-U7MJV2V7.cjs.map → chunk-33DHEEMP.cjs.map} +1 -1
- package/dist/{chunk-23VBGHBL.js → chunk-3ELW4VML.js} +2 -2
- package/dist/{chunk-7KBKLN2Z.cjs → chunk-3ZA2OYRE.cjs} +3 -3
- package/dist/{chunk-7KBKLN2Z.cjs.map → chunk-3ZA2OYRE.cjs.map} +1 -1
- package/dist/{chunk-73XDYWYG.js → chunk-4T5KOD3G.js} +5 -5
- package/dist/{chunk-MI6PPL3P.js → chunk-5CJKZHWO.js} +5 -5
- package/dist/{chunk-E7Q24T4G.js → chunk-6BJYPG2V.js} +3 -3
- package/dist/{chunk-YXNMLGFI.cjs → chunk-7X5TCK4R.cjs} +10 -10
- package/dist/{chunk-YXNMLGFI.cjs.map → chunk-7X5TCK4R.cjs.map} +1 -1
- package/dist/{chunk-7DEGEI7G.js → chunk-EJKEDCTH.js} +6 -6
- package/dist/{chunk-XIV5VDWL.cjs → chunk-HCKEDTKJ.cjs} +10 -10
- package/dist/{chunk-XIV5VDWL.cjs.map → chunk-HCKEDTKJ.cjs.map} +1 -1
- package/dist/{chunk-EQGAYDTC.cjs → chunk-IIT5HWLY.cjs} +9 -9
- package/dist/{chunk-EQGAYDTC.cjs.map → chunk-IIT5HWLY.cjs.map} +1 -1
- package/dist/{chunk-7SMYBCYH.cjs → chunk-IKUSKKFZ.cjs} +540 -883
- package/dist/chunk-IKUSKKFZ.cjs.map +1 -0
- package/dist/{chunk-JKYALZB7.cjs → chunk-JAJQ5P2Q.cjs} +22 -22
- package/dist/{chunk-JKYALZB7.cjs.map → chunk-JAJQ5P2Q.cjs.map} +1 -1
- package/dist/{chunk-WAXL3E3B.cjs → chunk-JFKK3ZOA.cjs} +43 -43
- package/dist/{chunk-WAXL3E3B.cjs.map → chunk-JFKK3ZOA.cjs.map} +1 -1
- package/dist/{chunk-AWAHYAII.js → chunk-JVWRMLQZ.js} +2 -2
- package/dist/{chunk-PZ27ELFP.cjs → chunk-JWKAJTNA.cjs} +43 -33
- package/dist/chunk-JWKAJTNA.cjs.map +1 -0
- package/dist/{chunk-PISJGXXI.js → chunk-KP6VJP36.js} +3 -3
- package/dist/{chunk-NSDZAUJK.js → chunk-LNKULR4V.js} +2 -2
- package/dist/{chunk-AFQB4YL7.cjs → chunk-MEJFHD5N.cjs} +15 -15
- package/dist/{chunk-AFQB4YL7.cjs.map → chunk-MEJFHD5N.cjs.map} +1 -1
- package/dist/{chunk-5VHCSN44.js → chunk-MYEG5ZDT.js} +2 -2
- package/dist/{chunk-MMA3MTJD.cjs → chunk-P2VRLSAP.cjs} +21 -21
- package/dist/{chunk-MMA3MTJD.cjs.map → chunk-P2VRLSAP.cjs.map} +1 -1
- package/dist/{chunk-7Q34BVL7.cjs → chunk-Q66AMADB.cjs} +4 -4
- package/dist/{chunk-7Q34BVL7.cjs.map → chunk-Q66AMADB.cjs.map} +1 -1
- package/dist/{chunk-4ARYZTGV.cjs → chunk-QJR32JM2.cjs} +159 -159
- package/dist/{chunk-4ARYZTGV.cjs.map → chunk-QJR32JM2.cjs.map} +1 -1
- package/dist/{chunk-M4IIK3B7.js → chunk-RURZ6QLN.js} +3 -3
- package/dist/{chunk-TCEU6DCF.js → chunk-TLKHLGAB.js} +3 -3
- package/dist/{chunk-JCWUJHOD.js → chunk-TOUD3AGK.js} +23 -13
- package/dist/chunk-TOUD3AGK.js.map +1 -0
- package/dist/{chunk-CHI7GJ3K.cjs → chunk-UCNEQKIT.cjs} +5 -5
- package/dist/{chunk-CHI7GJ3K.cjs.map → chunk-UCNEQKIT.cjs.map} +1 -1
- package/dist/{chunk-ZRGBLM6W.cjs → chunk-VOAZU46B.cjs} +69 -69
- package/dist/{chunk-ZRGBLM6W.cjs.map → chunk-VOAZU46B.cjs.map} +1 -1
- package/dist/{chunk-GYJVLFK5.js → chunk-VZSTL5VG.js} +2 -2
- package/dist/{chunk-3CAC3AAE.js → chunk-XPJKQ63S.js} +3 -3
- package/dist/{chunk-KSC5LNSY.js → chunk-XWBND4G5.js} +187 -530
- package/dist/chunk-XWBND4G5.js.map +1 -0
- package/dist/{chunk-22DWXIV3.js → chunk-YFZDIEVC.js} +5 -5
- package/dist/{chunk-7J7XDGY6.cjs → chunk-ZHUBNWEX.cjs} +3 -3
- package/dist/{chunk-7J7XDGY6.cjs.map → chunk-ZHUBNWEX.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +9 -9
- package/dist/components/case-studies/index.js +3 -3
- package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
- package/dist/components/chat/chat-message-list.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts +1 -4
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-slash-commands.d.ts +3 -3
- package/dist/components/chat/hooks/use-slash-commands.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts +28 -2
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -1
- package/dist/components/chat/tool-execution-display.d.ts.map +1 -1
- package/dist/components/chat/types/component.types.d.ts +0 -4
- package/dist/components/chat/types/component.types.d.ts.map +1 -1
- package/dist/components/chat/types/message.types.d.ts +1 -35
- package/dist/components/chat/types/message.types.d.ts.map +1 -1
- package/dist/components/chat/types/unified-chat-state.types.d.ts +3 -3
- package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
- package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/contact/index.js +3 -3
- package/dist/components/docs/index.cjs +7 -7
- package/dist/components/docs/index.js +6 -6
- package/dist/components/embeds/index.cjs +4 -4
- package/dist/components/embeds/index.js +3 -3
- package/dist/components/faq/index.cjs +4 -4
- package/dist/components/faq/index.js +3 -3
- package/dist/components/features/index.cjs +3 -3
- package/dist/components/features/index.js +2 -2
- package/dist/components/help-center-pages/index.cjs +23 -23
- package/dist/components/help-center-pages/index.js +14 -14
- package/dist/components/index.cjs +36 -36
- package/dist/components/index.js +13 -13
- package/dist/components/meeting-scheduler/index.cjs +21 -21
- package/dist/components/meeting-scheduler/index.js +2 -2
- package/dist/components/navigation/index.cjs +6 -6
- package/dist/components/navigation/index.js +5 -5
- package/dist/components/navigation/navigation-sidebar-item.d.ts.map +1 -1
- package/dist/components/onboarding-guides/index.cjs +6 -6
- package/dist/components/onboarding-guides/index.js +5 -5
- package/dist/components/tickets/index.cjs +7 -7
- package/dist/components/tickets/index.js +6 -6
- package/dist/components/ui/hover-dropdown.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +3 -3
- package/dist/components/ui/index.js +2 -2
- package/dist/index.cjs +7 -7
- package/dist/index.js +6 -6
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/chat-protocol/__tests__/nats-decoder-golden.test.ts +0 -130
- package/src/chat-protocol/events.ts +1 -9
- package/src/chat-protocol/nats-decoder.ts +0 -7
- package/src/components/chat/__tests__/chat-message-list.test.tsx +0 -70
- package/src/components/chat/__tests__/chat-message-streaming-memo.test.tsx +0 -86
- package/src/components/chat/chat-message-enhanced.tsx +13 -28
- package/src/components/chat/chat-message-list.tsx +22 -27
- package/src/components/chat/embeddable-chat.tsx +36 -55
- package/src/components/chat/entity-cards/dispatch.tsx +17 -86
- package/src/components/chat/hooks/use-nats-chat-adapter.ts +0 -7
- package/src/components/chat/hooks/use-slash-commands.ts +5 -9
- package/src/components/chat/hooks/use-sse-chat-adapter.ts +29 -2
- package/src/components/chat/stream/__tests__/chat-stream-reducer.test.ts +0 -56
- package/src/components/chat/stream/chat-stream-reducer.ts +0 -31
- package/src/components/chat/tool-execution-display.tsx +2 -5
- package/src/components/chat/types/component.types.ts +0 -4
- package/src/components/chat/types/message.types.ts +0 -39
- package/src/components/chat/types/unified-chat-state.types.ts +3 -4
- package/src/components/chat/utils/__tests__/process-historical-messages-golden.test.ts +0 -57
- package/src/components/chat/utils/process-historical-messages.ts +1 -19
- package/src/components/navigation/navigation-sidebar-item.tsx +19 -9
- package/src/components/ui/hover-dropdown.tsx +3 -8
- package/dist/chat-protocol/source-metadata.d.ts +0 -5
- package/dist/chat-protocol/source-metadata.d.ts.map +0 -1
- package/dist/chunk-7SMYBCYH.cjs.map +0 -1
- package/dist/chunk-JCWUJHOD.js.map +0 -1
- package/dist/chunk-KSC5LNSY.js.map +0 -1
- package/dist/chunk-PZ27ELFP.cjs.map +0 -1
- package/dist/components/chat/utils/chat-source-metadata.d.ts +0 -5
- package/dist/components/chat/utils/chat-source-metadata.d.ts.map +0 -1
- package/src/chat-protocol/__tests__/source-metadata.test.ts +0 -74
- package/src/chat-protocol/source-metadata.ts +0 -202
- package/src/components/chat/__tests__/embeddable-chat-sources.test.tsx +0 -411
- package/src/components/chat/__tests__/tool-execution-display.test.tsx +0 -93
- package/src/components/chat/entity-cards/__tests__/dispatch-video-refs.test.tsx +0 -74
- package/src/components/chat/hooks/__tests__/use-slash-commands.test.ts +0 -64
- package/src/components/chat/utils/chat-source-metadata.ts +0 -19
- /package/dist/{chunk-23VBGHBL.js.map → chunk-3ELW4VML.js.map} +0 -0
- /package/dist/{chunk-73XDYWYG.js.map → chunk-4T5KOD3G.js.map} +0 -0
- /package/dist/{chunk-MI6PPL3P.js.map → chunk-5CJKZHWO.js.map} +0 -0
- /package/dist/{chunk-E7Q24T4G.js.map → chunk-6BJYPG2V.js.map} +0 -0
- /package/dist/{chunk-7DEGEI7G.js.map → chunk-EJKEDCTH.js.map} +0 -0
- /package/dist/{chunk-AWAHYAII.js.map → chunk-JVWRMLQZ.js.map} +0 -0
- /package/dist/{chunk-PISJGXXI.js.map → chunk-KP6VJP36.js.map} +0 -0
- /package/dist/{chunk-NSDZAUJK.js.map → chunk-LNKULR4V.js.map} +0 -0
- /package/dist/{chunk-5VHCSN44.js.map → chunk-MYEG5ZDT.js.map} +0 -0
- /package/dist/{chunk-M4IIK3B7.js.map → chunk-RURZ6QLN.js.map} +0 -0
- /package/dist/{chunk-TCEU6DCF.js.map → chunk-TLKHLGAB.js.map} +0 -0
- /package/dist/{chunk-GYJVLFK5.js.map → chunk-VZSTL5VG.js.map} +0 -0
- /package/dist/{chunk-3CAC3AAE.js.map → chunk-XPJKQ63S.js.map} +0 -0
- /package/dist/{chunk-22DWXIV3.js.map → chunk-YFZDIEVC.js.map} +0 -0
|
@@ -1156,8 +1156,6 @@ TicketEscalatedMessage.displayName = "TicketEscalatedMessage";
|
|
|
1156
1156
|
var MESSAGE_TYPE = {
|
|
1157
1157
|
TEXT: "TEXT",
|
|
1158
1158
|
THINKING: "THINKING",
|
|
1159
|
-
GUIDE: "GUIDE",
|
|
1160
|
-
SOURCES: "SOURCES",
|
|
1161
1159
|
ASK: "ASK",
|
|
1162
1160
|
EXECUTING_TOOL: "EXECUTING_TOOL",
|
|
1163
1161
|
EXECUTED_TOOL: "EXECUTED_TOOL",
|
|
@@ -6856,8 +6854,6 @@ var ToolExecutionDisplay = _react.forwardRef.call(void 0,
|
|
|
6856
6854
|
}, [message.parameters, variant]);
|
|
6857
6855
|
const hasResult = isExecuted && typeof message.result === "string" && message.result.length > 0;
|
|
6858
6856
|
const hasBody = argEntries.length > 0 || hasResult || isExecuting;
|
|
6859
|
-
const isConciseRemoteRead = !message.integratedToolType && !!_optionalChain([message, 'access', _111 => _111.toolTitle, 'optionalAccess', _112 => _112.trim, 'call', _113 => _113()]) && argEntries.length === 0 && !hasResult;
|
|
6860
|
-
const isStaticRow = isClientView || isConciseRemoteRead;
|
|
6861
6857
|
const renderStatusIcon = () => {
|
|
6862
6858
|
if (isExecuting) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.DotsLoaderIcon, { size: 16, className: "text-ods-text-secondary" });
|
|
6863
6859
|
if (isExecuted && message.success === true) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.CheckCircleIcon, { className: "h-4 w-4 text-ods-success" });
|
|
@@ -6877,7 +6873,7 @@ var ToolExecutionDisplay = _react.forwardRef.call(void 0,
|
|
|
6877
6873
|
}
|
|
6878
6874
|
),
|
|
6879
6875
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: renderStatusIcon() }),
|
|
6880
|
-
!
|
|
6876
|
+
!isClientView && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExpandChevron, { expanded }) })
|
|
6881
6877
|
] });
|
|
6882
6878
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6883
6879
|
"div",
|
|
@@ -6890,7 +6886,7 @@ var ToolExecutionDisplay = _react.forwardRef.call(void 0,
|
|
|
6890
6886
|
className
|
|
6891
6887
|
),
|
|
6892
6888
|
...props,
|
|
6893
|
-
children:
|
|
6889
|
+
children: isClientView ? (
|
|
6894
6890
|
// Client (Fae end-user): static, non-expandable row — no chevron, no
|
|
6895
6891
|
// body. Just the explanation + status; command/args/result are hidden.
|
|
6896
6892
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full items-start gap-[var(--spacing-system-xs)] p-[var(--spacing-system-s)] text-left", children: headerContent })
|
|
@@ -6961,7 +6957,7 @@ function groupAskRuns(segments) {
|
|
|
6961
6957
|
runs.set(index, [segment]);
|
|
6962
6958
|
return;
|
|
6963
6959
|
}
|
|
6964
|
-
_optionalChain([runs, 'access',
|
|
6960
|
+
_optionalChain([runs, 'access', _111 => _111.get, 'call', _112 => _112(headIndex), 'optionalAccess', _113 => _113.push, 'call', _114 => _114(segment)]);
|
|
6965
6961
|
});
|
|
6966
6962
|
return runs;
|
|
6967
6963
|
}
|
|
@@ -6984,7 +6980,6 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
|
|
|
6984
6980
|
renderContextItem,
|
|
6985
6981
|
renderMention,
|
|
6986
6982
|
renderEntityCard,
|
|
6987
|
-
refs,
|
|
6988
6983
|
onAskSelect,
|
|
6989
6984
|
NavLinkAnchor,
|
|
6990
6985
|
...props
|
|
@@ -6993,10 +6988,6 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
|
|
|
6993
6988
|
const isError = role === "error";
|
|
6994
6989
|
const authorType = _nullishCoalesce(authorTypeProp, () => ( (isUser ? "user" : assistantType === "mingo" ? "mingo" : "fae")));
|
|
6995
6990
|
const hasMarkerSupport = !!renderEntityCard;
|
|
6996
|
-
const refsByKey = _react.useMemo.call(void 0,
|
|
6997
|
-
() => new Map((_nullishCoalesce(refs, () => ( []))).map((reference) => [`${reference.type}:${reference.id}`, reference])),
|
|
6998
|
-
[refs]
|
|
6999
|
-
);
|
|
7000
6991
|
const segments = _react.useMemo.call(void 0, () => normalizeContent(content), [content]);
|
|
7001
6992
|
const askRuns = _react.useMemo.call(void 0, () => groupAskRuns(segments), [segments]);
|
|
7002
6993
|
const hasMentionSupport = !!renderMention;
|
|
@@ -7045,15 +7036,14 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
|
|
|
7045
7036
|
const key = `${cardType}:${cardId}`;
|
|
7046
7037
|
usedKeys.add(key);
|
|
7047
7038
|
let entry = cache.get(key);
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
entry = { render, reference: refForRender, node: render(refForRender) };
|
|
7039
|
+
if (!entry || entry.render !== render) {
|
|
7040
|
+
const refForRender = {
|
|
7041
|
+
type: cardType,
|
|
7042
|
+
id: cardId,
|
|
7043
|
+
title: cardId,
|
|
7044
|
+
url: null
|
|
7045
|
+
};
|
|
7046
|
+
entry = { render, node: render(refForRender) };
|
|
7057
7047
|
cache.set(key, entry);
|
|
7058
7048
|
}
|
|
7059
7049
|
const rendered = entry.node;
|
|
@@ -7087,10 +7077,10 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
|
|
|
7087
7077
|
}
|
|
7088
7078
|
});
|
|
7089
7079
|
return { inlineByKey, partsBySegment, usedKeys };
|
|
7090
|
-
}, [hasMarkerSupport,
|
|
7080
|
+
}, [hasMarkerSupport, renderEntityCard, segments]);
|
|
7091
7081
|
_react.useEffect.call(void 0, () => {
|
|
7092
7082
|
const cache = renderedCardNodeCache.current;
|
|
7093
|
-
const usedKeys = _optionalChain([renderingPlan, 'optionalAccess',
|
|
7083
|
+
const usedKeys = _optionalChain([renderingPlan, 'optionalAccess', _115 => _115.usedKeys]);
|
|
7094
7084
|
if (!usedKeys) return;
|
|
7095
7085
|
if (cache.size <= usedKeys.size) return;
|
|
7096
7086
|
for (const k of [...cache.keys()]) {
|
|
@@ -7113,7 +7103,7 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
|
|
|
7113
7103
|
const sepIdx = stripped.indexOf(":");
|
|
7114
7104
|
const marker = sepIdx === -1 ? stripped : stripped.slice(0, sepIdx);
|
|
7115
7105
|
const id = sepIdx === -1 ? "" : stripped.slice(sepIdx + 1);
|
|
7116
|
-
const node = _optionalChain([renderMention, 'optionalCall',
|
|
7106
|
+
const node = _optionalChain([renderMention, 'optionalCall', _116 => _116({ marker, id })]);
|
|
7117
7107
|
if (node != null) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: node });
|
|
7118
7108
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-ods-text-secondary opacity-60", children });
|
|
7119
7109
|
}
|
|
@@ -7124,7 +7114,7 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
|
|
|
7124
7114
|
const cardType = stripped.slice(0, sepIdx);
|
|
7125
7115
|
const cardId = stripped.slice(sepIdx + 1);
|
|
7126
7116
|
const key = `${cardType}:${cardId}`;
|
|
7127
|
-
const inline = _optionalChain([renderingPlanRef, 'access',
|
|
7117
|
+
const inline = _optionalChain([renderingPlanRef, 'access', _117 => _117.current, 'optionalAccess', _118 => _118.inlineByKey, 'access', _119 => _119.get, 'call', _120 => _120(key)]);
|
|
7128
7118
|
if (inline != null) return inline;
|
|
7129
7119
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-ods-text-secondary opacity-60", children: cardId });
|
|
7130
7120
|
}
|
|
@@ -7137,7 +7127,7 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
|
|
|
7137
7127
|
};
|
|
7138
7128
|
}, [hasMarkerSupport, hasMentionSupport, renderMention, NavLinkAnchor]);
|
|
7139
7129
|
const renderSegmentBody = (segIndex, text, isStreaming) => {
|
|
7140
|
-
const parts = _optionalChain([renderingPlan, 'optionalAccess',
|
|
7130
|
+
const parts = _optionalChain([renderingPlan, 'optionalAccess', _121 => _121.partsBySegment, 'access', _122 => _122.get, 'call', _123 => _123(segIndex)]);
|
|
7141
7131
|
if (!parts || parts.length === 0) {
|
|
7142
7132
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7143
7133
|
SimpleMarkdownRenderer,
|
|
@@ -7310,11 +7300,11 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
|
|
|
7310
7300
|
);
|
|
7311
7301
|
ChatMessageEnhanced.displayName = "ChatMessageEnhanced";
|
|
7312
7302
|
var MemoizedChatMessageEnhanced = _react.memo.call(void 0, ChatMessageEnhanced, (prevProps, nextProps) => {
|
|
7313
|
-
return prevProps.role === nextProps.role && prevProps.content === nextProps.content && prevProps.name === nextProps.name && prevProps.avatar === nextProps.avatar && prevProps.isTyping === nextProps.isTyping && _optionalChain([prevProps, 'access',
|
|
7303
|
+
return prevProps.role === nextProps.role && prevProps.content === nextProps.content && prevProps.name === nextProps.name && prevProps.avatar === nextProps.avatar && prevProps.isTyping === nextProps.isTyping && _optionalChain([prevProps, 'access', _124 => _124.timestamp, 'optionalAccess', _125 => _125.getTime, 'call', _126 => _126()]) === _optionalChain([nextProps, 'access', _127 => _127.timestamp, 'optionalAccess', _128 => _128.getTime, 'call', _129 => _129()]) && prevProps.showAvatar === nextProps.showAvatar && prevProps.assistantType === nextProps.assistantType && prevProps.approvalVariant === nextProps.approvalVariant && prevProps.authorType === nextProps.authorType && prevProps.assistantIcon === nextProps.assistantIcon && prevProps.className === nextProps.className && // Reference equality — the host re-uses the same array instance per
|
|
7314
7304
|
// message (it's set once on the optimistic send and never mutated).
|
|
7315
7305
|
prevProps.contextItems === nextProps.contextItems && prevProps.resolveContextIcon === nextProps.resolveContextIcon && prevProps.renderContextItem === nextProps.renderContextItem && // Host keeps this stable (module const / useCallback), so reference
|
|
7316
7306
|
// equality holds across streaming chunks.
|
|
7317
|
-
prevProps.renderMention === nextProps.renderMention && prevProps.renderEntityCard === nextProps.renderEntityCard &&
|
|
7307
|
+
prevProps.renderMention === nextProps.renderMention && prevProps.renderEntityCard === nextProps.renderEntityCard && // Same stability contract as the renderers above: hosts pass a `useCallback`
|
|
7318
7308
|
// (EmbeddableChat passes its memoized `handleSend`), so this holds across
|
|
7319
7309
|
// streaming chunks instead of re-rendering every ask card per chunk.
|
|
7320
7310
|
prevProps.onAskSelect === nextProps.onAskSelect && prevProps.NavLinkAnchor === nextProps.NavLinkAnchor;
|
|
@@ -7332,7 +7322,6 @@ MemoizedChatMessageEnhanced.displayName = "MemoizedChatMessageEnhanced";
|
|
|
7332
7322
|
|
|
7333
7323
|
|
|
7334
7324
|
|
|
7335
|
-
|
|
7336
7325
|
var _usesticktobottom = require('use-stick-to-bottom');
|
|
7337
7326
|
|
|
7338
7327
|
// src/components/chat/chat-message-skeleton.tsx
|
|
@@ -7527,7 +7516,6 @@ var ChatMessageList = _react.forwardRef.call(void 0,
|
|
|
7527
7516
|
renderContextItem,
|
|
7528
7517
|
renderMention,
|
|
7529
7518
|
onAskSelect,
|
|
7530
|
-
renderAfterMessage,
|
|
7531
7519
|
NavLinkAnchor,
|
|
7532
7520
|
...props
|
|
7533
7521
|
}, ref) => {
|
|
@@ -7576,7 +7564,7 @@ var ChatMessageList = _react.forwardRef.call(void 0,
|
|
|
7576
7564
|
const prevCount = prevRenderRef.current.messageCount;
|
|
7577
7565
|
const prevLastId = prevRenderRef.current.lastMessageId;
|
|
7578
7566
|
const newCount = messages.length;
|
|
7579
|
-
const currentLastId = _optionalChain([messages, 'access',
|
|
7567
|
+
const currentLastId = _optionalChain([messages, 'access', _130 => _130[messages.length - 1], 'optionalAccess', _131 => _131.id]);
|
|
7580
7568
|
prevRenderRef.current = { dialogId, messageCount: newCount, lastMessageId: currentLastId };
|
|
7581
7569
|
if (dialogChanged) {
|
|
7582
7570
|
followBottomRef.current = true;
|
|
@@ -7643,10 +7631,10 @@ var ChatMessageList = _react.forwardRef.call(void 0,
|
|
|
7643
7631
|
};
|
|
7644
7632
|
let touchY = null;
|
|
7645
7633
|
const onTouchStart = (e) => {
|
|
7646
|
-
touchY = _nullishCoalesce(_optionalChain([e, 'access',
|
|
7634
|
+
touchY = _nullishCoalesce(_optionalChain([e, 'access', _132 => _132.touches, 'access', _133 => _133[0], 'optionalAccess', _134 => _134.clientY]), () => ( null));
|
|
7647
7635
|
};
|
|
7648
7636
|
const onTouchMove = (e) => {
|
|
7649
|
-
const y = _optionalChain([e, 'access',
|
|
7637
|
+
const y = _optionalChain([e, 'access', _135 => _135.touches, 'access', _136 => _136[0], 'optionalAccess', _137 => _137.clientY]);
|
|
7650
7638
|
if (y == null || touchY == null) return;
|
|
7651
7639
|
if (y > touchY) disarm();
|
|
7652
7640
|
touchY = y;
|
|
@@ -7776,7 +7764,7 @@ var ChatMessageList = _react.forwardRef.call(void 0,
|
|
|
7776
7764
|
ro.observe(node);
|
|
7777
7765
|
const timer = setTimeout(() => {
|
|
7778
7766
|
ro.disconnect();
|
|
7779
|
-
if (_optionalChain([anchorWatcherRef, 'access',
|
|
7767
|
+
if (_optionalChain([anchorWatcherRef, 'access', _138 => _138.current, 'optionalAccess', _139 => _139.id]) === last.id) {
|
|
7780
7768
|
anchorWatcherRef.current = null;
|
|
7781
7769
|
}
|
|
7782
7770
|
}, 2e3);
|
|
@@ -7806,7 +7794,7 @@ var ChatMessageList = _react.forwardRef.call(void 0,
|
|
|
7806
7794
|
scrollTop: el.scrollTop
|
|
7807
7795
|
};
|
|
7808
7796
|
}
|
|
7809
|
-
_optionalChain([onLoadMoreRef, 'access',
|
|
7797
|
+
_optionalChain([onLoadMoreRef, 'access', _140 => _140.current, 'optionalCall', _141 => _141()]);
|
|
7810
7798
|
}
|
|
7811
7799
|
},
|
|
7812
7800
|
{ root: scrollContainer, rootMargin: "200px", threshold: 0.1 }
|
|
@@ -7840,8 +7828,8 @@ var ChatMessageList = _react.forwardRef.call(void 0,
|
|
|
7840
7828
|
);
|
|
7841
7829
|
}
|
|
7842
7830
|
const lastMessage = messages[messages.length - 1];
|
|
7843
|
-
const lastSegments = Array.isArray(_optionalChain([lastMessage, 'optionalAccess',
|
|
7844
|
-
const lastSegment = _optionalChain([lastSegments, 'optionalAccess',
|
|
7831
|
+
const lastSegments = Array.isArray(_optionalChain([lastMessage, 'optionalAccess', _142 => _142.content])) ? lastMessage.content : null;
|
|
7832
|
+
const lastSegment = _optionalChain([lastSegments, 'optionalAccess', _143 => _143[lastSegments.length - 1]]);
|
|
7845
7833
|
const isPausedOnApproval = !!lastSegment && (lastSegment.type === "approval_request" || lastSegment.type === "approval_batch" || lastSegment.type === "escalation_offer") && (lastSegment.status === void 0 || lastSegment.status === "pending");
|
|
7846
7834
|
const showStreamingLoader = isTyping && !isPausedOnApproval && !(pendingApprovals && pendingApprovals.length > 0);
|
|
7847
7835
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, OverlayOpenRegistryProvider, { onOpenChange: handleOverlayOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
@@ -7884,34 +7872,31 @@ var ChatMessageList = _react.forwardRef.call(void 0,
|
|
|
7884
7872
|
if (message.hidden) return null;
|
|
7885
7873
|
const isEmptyPendingTurn = index === messages.length - 1 && isTyping && message.role === "assistant" && !hasNonEmptyContent(message.content) && (!Array.isArray(message.content) || message.content.every((s) => s.type === "text"));
|
|
7886
7874
|
if (isEmptyPendingTurn) return null;
|
|
7887
|
-
return /* @__PURE__ */ _jsxruntime.
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
),
|
|
7913
|
-
_optionalChain([renderAfterMessage, 'optionalCall', _147 => _147(message, index)])
|
|
7914
|
-
] }, message.id);
|
|
7875
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7876
|
+
MemoizedChatMessageEnhanced,
|
|
7877
|
+
{
|
|
7878
|
+
ref: getRegisterMessageEl(message.id),
|
|
7879
|
+
role: message.role,
|
|
7880
|
+
name: message.name,
|
|
7881
|
+
content: message.content,
|
|
7882
|
+
timestamp: message.timestamp,
|
|
7883
|
+
isTyping: index === messages.length - 1 && isTyping && message.role === "assistant",
|
|
7884
|
+
avatar: showAvatars ? message.avatar : null,
|
|
7885
|
+
showAvatar: showAvatars,
|
|
7886
|
+
assistantType: message.assistantType || assistantType,
|
|
7887
|
+
approvalVariant,
|
|
7888
|
+
authorType: message.authorType,
|
|
7889
|
+
assistantIcon: message.role !== "user" ? assistantIcon : void 0,
|
|
7890
|
+
contextItems: message.contextItems,
|
|
7891
|
+
resolveContextIcon,
|
|
7892
|
+
renderContextItem,
|
|
7893
|
+
renderMention,
|
|
7894
|
+
renderEntityCard,
|
|
7895
|
+
onAskSelect: index > lastUserMessageIndex ? onAskSelect : void 0,
|
|
7896
|
+
NavLinkAnchor
|
|
7897
|
+
},
|
|
7898
|
+
message.id
|
|
7899
|
+
);
|
|
7915
7900
|
})
|
|
7916
7901
|
]
|
|
7917
7902
|
}
|
|
@@ -8060,7 +8045,7 @@ function EntityIcon({
|
|
|
8060
8045
|
size: size2 = 20,
|
|
8061
8046
|
className
|
|
8062
8047
|
}) {
|
|
8063
|
-
if (_optionalChain([icon, 'optionalAccess',
|
|
8048
|
+
if (_optionalChain([icon, 'optionalAccess', _144 => _144.url])) {
|
|
8064
8049
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8065
8050
|
_chunkWLSFBRT5cjs.next_image_default,
|
|
8066
8051
|
{
|
|
@@ -8074,7 +8059,7 @@ function EntityIcon({
|
|
|
8074
8059
|
}
|
|
8075
8060
|
);
|
|
8076
8061
|
}
|
|
8077
|
-
if (_optionalChain([icon, 'optionalAccess',
|
|
8062
|
+
if (_optionalChain([icon, 'optionalAccess', _145 => _145.name]) && BRAND_MARK_NAMES.has(icon.name)) {
|
|
8078
8063
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8079
8064
|
"span",
|
|
8080
8065
|
{
|
|
@@ -8084,8 +8069,8 @@ function EntityIcon({
|
|
|
8084
8069
|
}
|
|
8085
8070
|
);
|
|
8086
8071
|
}
|
|
8087
|
-
const Glyph = resolveIcon(_nullishCoalesce(_optionalChain([icon, 'optionalAccess',
|
|
8088
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Glyph, { size: size2, className, ..._nullishCoalesce(_optionalChain([icon, 'optionalAccess',
|
|
8072
|
+
const Glyph = resolveIcon(_nullishCoalesce(_optionalChain([icon, 'optionalAccess', _146 => _146.name]), () => ( void 0)));
|
|
8073
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Glyph, { size: size2, className, ..._nullishCoalesce(_optionalChain([icon, 'optionalAccess', _147 => _147.props]), () => ( {})) });
|
|
8089
8074
|
}
|
|
8090
8075
|
|
|
8091
8076
|
// src/components/chat/quick-action-chip.tsx
|
|
@@ -8095,7 +8080,7 @@ function getAgentAccent(slug) {
|
|
|
8095
8080
|
return slug === "fae" || slug === "mingo" ? AGENT_ACCENTS[slug] : void 0;
|
|
8096
8081
|
}
|
|
8097
8082
|
function accentFromIdentityIcon(icon) {
|
|
8098
|
-
const color = _optionalChain([icon, 'optionalAccess',
|
|
8083
|
+
const color = _optionalChain([icon, 'optionalAccess', _148 => _148.props, 'optionalAccess', _149 => _149.color]);
|
|
8099
8084
|
return typeof color === "string" && color.length > 0 ? color : void 0;
|
|
8100
8085
|
}
|
|
8101
8086
|
var ACCENT_CLASS = {
|
|
@@ -8177,7 +8162,7 @@ function QuickActionChipButton({
|
|
|
8177
8162
|
className
|
|
8178
8163
|
}) {
|
|
8179
8164
|
const themedIcon = theme && isQuickActionIconSpec(icon) && !icon.accent ? { ...icon, accent: theme.accent } : icon;
|
|
8180
|
-
const resolvedLozenge = lozenge === true ? _optionalChain([theme, 'optionalAccess',
|
|
8165
|
+
const resolvedLozenge = lozenge === true ? _optionalChain([theme, 'optionalAccess', _150 => _150.lozenge]) : lozenge === false ? void 0 : lozenge;
|
|
8181
8166
|
const resolvedIcon = renderQuickActionIcon(themedIcon);
|
|
8182
8167
|
const resolvedLabel = composeChipLabel(label, resolvedLozenge);
|
|
8183
8168
|
const tagVariant = selected ? selectedAccent === "cyan" ? "selectedCyan" : "selected" : variant;
|
|
@@ -8389,7 +8374,7 @@ function MarqueeWall({
|
|
|
8389
8374
|
if (!container || !copy) return;
|
|
8390
8375
|
const size2 = axis === "y" ? copy.offsetHeight : copy.offsetWidth;
|
|
8391
8376
|
copySizeRef.current = size2;
|
|
8392
|
-
const clone = _optionalChain([trackRef, 'access',
|
|
8377
|
+
const clone = _optionalChain([trackRef, 'access', _151 => _151.current, 'optionalAccess', _152 => _152.querySelector, 'call', _153 => _153('[data-marquee-copy="clone"]')]);
|
|
8393
8378
|
wrapSizeRef.current = clone ? axis === "y" ? clone.offsetTop - copy.offsetTop : clone.offsetLeft - copy.offsetLeft : size2 + (typeof copyGap === "number" ? copyGap : 0);
|
|
8394
8379
|
const avail = axis === "y" ? container.clientHeight : container.clientWidth;
|
|
8395
8380
|
setOverflows(size2 > avail + 1);
|
|
@@ -8410,7 +8395,7 @@ function MarqueeWall({
|
|
|
8410
8395
|
_react.useEffect.call(void 0, () => {
|
|
8411
8396
|
const el = containerRef.current;
|
|
8412
8397
|
if (!el || typeof IntersectionObserver === "undefined") return void 0;
|
|
8413
|
-
const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access',
|
|
8398
|
+
const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access', _154 => _154[0], 'optionalAccess', _155 => _155.isIntersecting]), () => ( true))), {
|
|
8414
8399
|
rootMargin: _chunkZI27ALYXcjs.NEAR_VIEWPORT_ROOT_MARGIN
|
|
8415
8400
|
});
|
|
8416
8401
|
io.observe(el);
|
|
@@ -8521,7 +8506,7 @@ function MarqueeWall({
|
|
|
8521
8506
|
if (Math.abs(delta) > 3 && !dragMovedRef.current) {
|
|
8522
8507
|
dragMovedRef.current = true;
|
|
8523
8508
|
try {
|
|
8524
|
-
_optionalChain([containerRef, 'access',
|
|
8509
|
+
_optionalChain([containerRef, 'access', _156 => _156.current, 'optionalAccess', _157 => _157.setPointerCapture, 'call', _158 => _158(e.pointerId)]);
|
|
8525
8510
|
} catch (e7) {
|
|
8526
8511
|
}
|
|
8527
8512
|
}
|
|
@@ -8538,7 +8523,7 @@ function MarqueeWall({
|
|
|
8538
8523
|
dragSuppressUntilRef.current = performance.now() + DRAG_RESUME_MS;
|
|
8539
8524
|
if (dragMovedRef.current) {
|
|
8540
8525
|
try {
|
|
8541
|
-
_optionalChain([containerRef, 'access',
|
|
8526
|
+
_optionalChain([containerRef, 'access', _159 => _159.current, 'optionalAccess', _160 => _160.releasePointerCapture, 'call', _161 => _161(e.pointerId)]);
|
|
8542
8527
|
} catch (e8) {
|
|
8543
8528
|
}
|
|
8544
8529
|
}
|
|
@@ -8972,7 +8957,7 @@ var ChatTicketItem = _react.forwardRef.call(void 0,
|
|
|
8972
8957
|
{
|
|
8973
8958
|
ref,
|
|
8974
8959
|
type: "button",
|
|
8975
|
-
onClick: () => _optionalChain([onClick, 'optionalCall',
|
|
8960
|
+
onClick: () => _optionalChain([onClick, 'optionalCall', _162 => _162(ticket.id)]),
|
|
8976
8961
|
className: _chunkPRPZBXWZcjs.cn.call(void 0,
|
|
8977
8962
|
"flex h-20 w-full items-center gap-4 px-4",
|
|
8978
8963
|
"border-b border-ods-border bg-ods-card",
|
|
@@ -9181,7 +9166,7 @@ function MingoChatHistoryRow({
|
|
|
9181
9166
|
const unread = _nullishCoalesce(dialog.unreadMessagesCount, () => ( 0));
|
|
9182
9167
|
const hasMenu = !!onRequestRename || !!onRequestArchive || !!onRequestCopyLink;
|
|
9183
9168
|
const owner = dialog.owner;
|
|
9184
|
-
const hasAvatar = !!(_optionalChain([owner, 'optionalAccess',
|
|
9169
|
+
const hasAvatar = !!(_optionalChain([owner, 'optionalAccess', _163 => _163.name]) || _optionalChain([owner, 'optionalAccess', _164 => _164.avatarUrl]));
|
|
9185
9170
|
const [menuOpen, setMenuOpen] = _react.useState.call(void 0, false);
|
|
9186
9171
|
const menuItems = [
|
|
9187
9172
|
onRequestCopyLink && {
|
|
@@ -9217,11 +9202,11 @@ function MingoChatHistoryRow({
|
|
|
9217
9202
|
{
|
|
9218
9203
|
role: "button",
|
|
9219
9204
|
tabIndex: 0,
|
|
9220
|
-
onClick: () => _optionalChain([onSelect, 'optionalCall',
|
|
9205
|
+
onClick: () => _optionalChain([onSelect, 'optionalCall', _165 => _165(dialog.id)]),
|
|
9221
9206
|
onKeyDown: (e) => {
|
|
9222
9207
|
if (e.key === "Enter" || e.key === " ") {
|
|
9223
9208
|
e.preventDefault();
|
|
9224
|
-
_optionalChain([onSelect, 'optionalCall',
|
|
9209
|
+
_optionalChain([onSelect, 'optionalCall', _166 => _166(dialog.id)]);
|
|
9225
9210
|
}
|
|
9226
9211
|
},
|
|
9227
9212
|
className: "flex min-w-0 flex-1 cursor-pointer items-center gap-[var(--spacing-system-xsf)] p-[var(--spacing-system-s)] focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ods-accent",
|
|
@@ -9288,8 +9273,8 @@ function MingoChatHistoryRow({
|
|
|
9288
9273
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9289
9274
|
"span",
|
|
9290
9275
|
{
|
|
9291
|
-
onClick: () => _optionalChain([onSelect, 'optionalCall',
|
|
9292
|
-
title: _optionalChain([owner, 'optionalAccess',
|
|
9276
|
+
onClick: () => _optionalChain([onSelect, 'optionalCall', _167 => _167(dialog.id)]),
|
|
9277
|
+
title: _optionalChain([owner, 'optionalAccess', _168 => _168.name]) || void 0,
|
|
9293
9278
|
className: _chunkPRPZBXWZcjs.cn.call(void 0,
|
|
9294
9279
|
"absolute inset-0 flex cursor-pointer items-center justify-center transition-opacity",
|
|
9295
9280
|
hasMenu && (menuOpen ? "pointer-events-none opacity-0" : "md:group-hover/row:pointer-events-none md:group-hover/row:opacity-0 md:peer-[:focus-within]/menu:pointer-events-none md:peer-[:focus-within]/menu:opacity-0")
|
|
@@ -9299,9 +9284,9 @@ function MingoChatHistoryRow({
|
|
|
9299
9284
|
{
|
|
9300
9285
|
variant: "round",
|
|
9301
9286
|
sizePx: 24,
|
|
9302
|
-
src: _optionalChain([owner, 'optionalAccess',
|
|
9303
|
-
alt: _optionalChain([owner, 'optionalAccess',
|
|
9304
|
-
fallback: _optionalChain([owner, 'optionalAccess',
|
|
9287
|
+
src: _optionalChain([owner, 'optionalAccess', _169 => _169.avatarUrl]) || void 0,
|
|
9288
|
+
alt: _optionalChain([owner, 'optionalAccess', _170 => _170.name]) || void 0,
|
|
9289
|
+
fallback: _optionalChain([owner, 'optionalAccess', _171 => _171.name]) || void 0,
|
|
9305
9290
|
initialsClassName: "text-[10px] text-ods-text-secondary"
|
|
9306
9291
|
}
|
|
9307
9292
|
)
|
|
@@ -9352,7 +9337,7 @@ function MingoChatHistory({
|
|
|
9352
9337
|
className
|
|
9353
9338
|
}) {
|
|
9354
9339
|
const groups = _react.useMemo.call(void 0, () => groupDialogs(dialogs), [dialogs]);
|
|
9355
|
-
const noSearchResults = groups.length === 0 && !!_optionalChain([searchQuery, 'optionalAccess',
|
|
9340
|
+
const noSearchResults = groups.length === 0 && !!_optionalChain([searchQuery, 'optionalAccess', _172 => _172.trim, 'call', _173 => _173()]);
|
|
9356
9341
|
const { scrollRef, fadeTop, fadeBottom, update: updateFade } = useScrollFade();
|
|
9357
9342
|
const sentinelRef = _react.useRef.call(void 0, null);
|
|
9358
9343
|
const onLoadMoreRef = _react.useRef.call(void 0, onLoadMore);
|
|
@@ -9369,7 +9354,7 @@ function MingoChatHistory({
|
|
|
9369
9354
|
const io = new IntersectionObserver(
|
|
9370
9355
|
([entry]) => {
|
|
9371
9356
|
if (entry.isIntersecting && !isLoadingMoreRef.current) {
|
|
9372
|
-
_optionalChain([onLoadMoreRef, 'access',
|
|
9357
|
+
_optionalChain([onLoadMoreRef, 'access', _174 => _174.current, 'optionalCall', _175 => _175()]);
|
|
9373
9358
|
}
|
|
9374
9359
|
},
|
|
9375
9360
|
{ root, rootMargin: "120px", threshold: 0.1 }
|
|
@@ -9553,8 +9538,8 @@ function MingoWelcome({
|
|
|
9553
9538
|
icon: action.icon,
|
|
9554
9539
|
variant: action.variant,
|
|
9555
9540
|
onSelect: action.onClick,
|
|
9556
|
-
onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall',
|
|
9557
|
-
onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall',
|
|
9541
|
+
onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall', _176 => _176(action)]),
|
|
9542
|
+
onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall', _177 => _177()])
|
|
9558
9543
|
})),
|
|
9559
9544
|
agentSlug,
|
|
9560
9545
|
rows: 4,
|
|
@@ -9607,9 +9592,9 @@ function GuideWelcome({
|
|
|
9607
9592
|
props: action.iconProps,
|
|
9608
9593
|
accent: _nullishCoalesce(_nullishCoalesce(action.accent, () => ( accentFromIdentityIcon(icon))), () => ( "cyan"))
|
|
9609
9594
|
},
|
|
9610
|
-
onSelect: () => _optionalChain([onQuickAction, 'optionalCall',
|
|
9611
|
-
onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall',
|
|
9612
|
-
onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall',
|
|
9595
|
+
onSelect: () => _optionalChain([onQuickAction, 'optionalCall', _178 => _178(action)]),
|
|
9596
|
+
onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall', _179 => _179(action)]),
|
|
9597
|
+
onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall', _180 => _180()])
|
|
9613
9598
|
})),
|
|
9614
9599
|
[quickActions, icon, onQuickAction, onQuickActionHover, onQuickActionHoverEnd]
|
|
9615
9600
|
);
|
|
@@ -9785,7 +9770,7 @@ function MingoHistoryRail({
|
|
|
9785
9770
|
onRetry,
|
|
9786
9771
|
className
|
|
9787
9772
|
}) {
|
|
9788
|
-
const hasSearch = !!_optionalChain([searchQuery, 'optionalAccess',
|
|
9773
|
+
const hasSearch = !!_optionalChain([searchQuery, 'optionalAccess', _181 => _181.trim, 'call', _182 => _182()]);
|
|
9789
9774
|
const hasList = dialogs.length > 0 || hasSearch;
|
|
9790
9775
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
9791
9776
|
"div",
|
|
@@ -9911,7 +9896,7 @@ var Modal = _react.forwardRef.call(void 0,
|
|
|
9911
9896
|
document.removeEventListener("focusin", containFocus);
|
|
9912
9897
|
const idx = modalStack.lastIndexOf(stackId);
|
|
9913
9898
|
if (idx !== -1) modalStack.splice(idx, 1);
|
|
9914
|
-
_optionalChain([restoreFocusRef, 'access',
|
|
9899
|
+
_optionalChain([restoreFocusRef, 'access', _183 => _183.current, 'optionalAccess', _184 => _184.focus, 'optionalCall', _185 => _185()]);
|
|
9915
9900
|
};
|
|
9916
9901
|
}, [isOpen]);
|
|
9917
9902
|
_react.useEffect.call(void 0, () => {
|
|
@@ -10161,7 +10146,7 @@ function ChatDialogModals({
|
|
|
10161
10146
|
RenameChatModal,
|
|
10162
10147
|
{
|
|
10163
10148
|
isOpen: renameTarget != null,
|
|
10164
|
-
initialName: _nullishCoalesce(_optionalChain([renameTarget, 'optionalAccess',
|
|
10149
|
+
initialName: _nullishCoalesce(_optionalChain([renameTarget, 'optionalAccess', _186 => _186.title]), () => ( "")),
|
|
10165
10150
|
onClose: () => setRenameTarget(null),
|
|
10166
10151
|
onSave: onConfirmRename
|
|
10167
10152
|
}
|
|
@@ -10233,7 +10218,7 @@ function ChatHeaderSearchField({
|
|
|
10233
10218
|
const finishCollapse = _react.useCallback.call(void 0, () => {
|
|
10234
10219
|
if (collapsedRef.current) return;
|
|
10235
10220
|
collapsedRef.current = true;
|
|
10236
|
-
_optionalChain([onCollapse, 'optionalCall',
|
|
10221
|
+
_optionalChain([onCollapse, 'optionalCall', _187 => _187()]);
|
|
10237
10222
|
}, [onCollapse]);
|
|
10238
10223
|
const beginCollapse = _react.useCallback.call(void 0, () => {
|
|
10239
10224
|
setExiting(true);
|
|
@@ -10555,7 +10540,7 @@ function ChatAttachmentAddButton({
|
|
|
10555
10540
|
const canAddMore = slotsAvailable > 0 && !disabled;
|
|
10556
10541
|
const handlePick = () => {
|
|
10557
10542
|
if (!canAddMore) return;
|
|
10558
|
-
_optionalChain([fileInputRef, 'access',
|
|
10543
|
+
_optionalChain([fileInputRef, 'access', _188 => _188.current, 'optionalAccess', _189 => _189.click, 'call', _190 => _190()]);
|
|
10559
10544
|
};
|
|
10560
10545
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
10561
10546
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -10718,7 +10703,7 @@ function ChatContextMemoryBar({
|
|
|
10718
10703
|
_react.useEffect.call(void 0, () => {
|
|
10719
10704
|
if (!open) return void 0;
|
|
10720
10705
|
const onOutside = (e) => {
|
|
10721
|
-
if (_optionalChain([rootRef, 'access',
|
|
10706
|
+
if (_optionalChain([rootRef, 'access', _191 => _191.current, 'optionalAccess', _192 => _192.contains, 'call', _193 => _193(e.target)])) return;
|
|
10722
10707
|
setOpen(false);
|
|
10723
10708
|
};
|
|
10724
10709
|
document.addEventListener("mousedown", onOutside, true);
|
|
@@ -10990,7 +10975,7 @@ function ChatComposer({
|
|
|
10990
10975
|
const contextEnabled = !!contextPicker && !archived;
|
|
10991
10976
|
const selected = _nullishCoalesce(selectedContextItems, () => ( []));
|
|
10992
10977
|
const memory = _nullishCoalesce(contextMemoryItems, () => ( []));
|
|
10993
|
-
const entityTypes = _optionalChain([contextPicker, 'optionalAccess',
|
|
10978
|
+
const entityTypes = _optionalChain([contextPicker, 'optionalAccess', _194 => _194.entityTypes]);
|
|
10994
10979
|
const iconByType = _react.useMemo.call(void 0, () => {
|
|
10995
10980
|
const map = /* @__PURE__ */ new Map();
|
|
10996
10981
|
for (const t of _nullishCoalesce(entityTypes, () => ( []))) map.set(t.type, t.icon);
|
|
@@ -11017,7 +11002,7 @@ function ChatComposer({
|
|
|
11017
11002
|
startIcon: contextEnabled ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
11018
11003
|
ChatComposerPlusMenu,
|
|
11019
11004
|
{
|
|
11020
|
-
onToggle: () => contextPickerOpen ? _optionalChain([onCloseContextPicker, 'optionalCall',
|
|
11005
|
+
onToggle: () => contextPickerOpen ? _optionalChain([onCloseContextPicker, 'optionalCall', _195 => _195()]) : _optionalChain([onOpenContextPicker, 'optionalCall', _196 => _196()]),
|
|
11021
11006
|
open: contextPickerOpen,
|
|
11022
11007
|
disabled: attachmentsDisabled,
|
|
11023
11008
|
dropdown: contextPicker ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -11026,8 +11011,8 @@ function ChatComposer({
|
|
|
11026
11011
|
open: contextPickerOpen,
|
|
11027
11012
|
config: contextPicker,
|
|
11028
11013
|
selectedItems: selected,
|
|
11029
|
-
onToggleItem: (item) => _optionalChain([onToggleContextItem, 'optionalCall',
|
|
11030
|
-
onClose: () => _optionalChain([onCloseContextPicker, 'optionalCall',
|
|
11014
|
+
onToggleItem: (item) => _optionalChain([onToggleContextItem, 'optionalCall', _197 => _197(item)]),
|
|
11015
|
+
onClose: () => _optionalChain([onCloseContextPicker, 'optionalCall', _198 => _198()]),
|
|
11031
11016
|
mentionQuery
|
|
11032
11017
|
}
|
|
11033
11018
|
) : void 0
|
|
@@ -11218,8 +11203,8 @@ ChatSidebarSkeleton.displayName = "ChatSidebarSkeleton";
|
|
|
11218
11203
|
var DialogListItem = _react.forwardRef.call(void 0,
|
|
11219
11204
|
({ className, dialog, isActive, onDialogSelect, onClick, ...props }, ref) => {
|
|
11220
11205
|
const handleClick = (e) => {
|
|
11221
|
-
_optionalChain([onDialogSelect, 'optionalCall',
|
|
11222
|
-
_optionalChain([onClick, 'optionalCall',
|
|
11206
|
+
_optionalChain([onDialogSelect, 'optionalCall', _199 => _199(dialog.id)]);
|
|
11207
|
+
_optionalChain([onClick, 'optionalCall', _200 => _200(e)]);
|
|
11223
11208
|
};
|
|
11224
11209
|
const formatTimestamp = (timestamp) => {
|
|
11225
11210
|
if (!timestamp) return "";
|
|
@@ -11298,7 +11283,7 @@ var ChatSidebar = _react.forwardRef.call(void 0,
|
|
|
11298
11283
|
(entries) => {
|
|
11299
11284
|
const [entry] = entries;
|
|
11300
11285
|
if (entry.isIntersecting && !isFetchingRef.current) {
|
|
11301
|
-
_optionalChain([onLoadMoreRef, 'access',
|
|
11286
|
+
_optionalChain([onLoadMoreRef, 'access', _201 => _201.current, 'optionalCall', _202 => _202()]);
|
|
11302
11287
|
}
|
|
11303
11288
|
},
|
|
11304
11289
|
{ root: scrollContainer, rootMargin: "100px", threshold: 0.1 }
|
|
@@ -11426,7 +11411,7 @@ function isForeignOriginHref(href) {
|
|
|
11426
11411
|
function runNavigation(runtime, href, path, targetPlatform, fallbackNavigate) {
|
|
11427
11412
|
const isNewTab = runtime ? _chunkNNFQLTJ3cjs.computeIsNewTab.call(void 0, runtime, href, _nullishCoalesce(targetPlatform, () => ( null))) : false;
|
|
11428
11413
|
if (isNewTab) {
|
|
11429
|
-
if (_optionalChain([runtime, 'optionalAccess',
|
|
11414
|
+
if (_optionalChain([runtime, 'optionalAccess', _203 => _203.navigation, 'access', _204 => _204.openExternal])) runtime.navigation.openExternal(href);
|
|
11430
11415
|
else window.open(href, "_blank", NEW_TAB_FEATURES);
|
|
11431
11416
|
return;
|
|
11432
11417
|
}
|
|
@@ -11434,7 +11419,7 @@ function runNavigation(runtime, href, path, targetPlatform, fallbackNavigate) {
|
|
|
11434
11419
|
if (target.includes("#") && _chunkZI27ALYXcjs.navigateSamePageHash.call(void 0, target, { headerOffset: _chunkZI27ALYXcjs.STICKY_HEADER_OFFSET_PX })) {
|
|
11435
11420
|
return;
|
|
11436
11421
|
}
|
|
11437
|
-
const handled = _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
|
11422
|
+
const handled = _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _205 => _205.navigation, 'access', _206 => _206.navigate, 'optionalCall', _207 => _207({ href, path, targetPlatform })]), () => ( false));
|
|
11438
11423
|
if (!handled) {
|
|
11439
11424
|
if (fallbackNavigate) fallbackNavigate(target);
|
|
11440
11425
|
else window.location.assign(target);
|
|
@@ -11493,7 +11478,7 @@ function NavLinkAnchorViaRuntime({
|
|
|
11493
11478
|
targetPlatform,
|
|
11494
11479
|
fallbackNavigate: router.push
|
|
11495
11480
|
});
|
|
11496
|
-
if (handled && !isNewTab && _optionalChain([panel, 'optionalAccess',
|
|
11481
|
+
if (handled && !isNewTab && _optionalChain([panel, 'optionalAccess', _208 => _208.closeChat])) panel.closeChat();
|
|
11497
11482
|
};
|
|
11498
11483
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href: resolvedHref, ..._chunkNNFQLTJ3cjs.newTabAnchorAttrs.call(void 0, isNewTab), onClick, className, children });
|
|
11499
11484
|
}
|
|
@@ -11559,11 +11544,11 @@ var DEFAULT_CAPTIONS_PATH = "/api/captions";
|
|
|
11559
11544
|
function getCaptionsUrl(entityType, entityId, srtContent, options) {
|
|
11560
11545
|
if (!srtContent) return void 0;
|
|
11561
11546
|
const hash = `${srtContent.length}-${srtContent.slice(0, 8).replace(/\s/g, "")}`;
|
|
11562
|
-
const variant = _optionalChain([options, 'optionalAccess',
|
|
11547
|
+
const variant = _optionalChain([options, 'optionalAccess', _209 => _209.variant]) ? `&variant=${options.variant}` : "";
|
|
11563
11548
|
return `${DEFAULT_CAPTIONS_PATH}/${entityType}/${entityId}?v=${hash}${variant}`;
|
|
11564
11549
|
}
|
|
11565
11550
|
function resolveCaptionsBase(endpoints) {
|
|
11566
|
-
return _optionalChain([endpoints, 'optionalAccess',
|
|
11551
|
+
return _optionalChain([endpoints, 'optionalAccess', _210 => _210.captionsUrlPrefix]) || DEFAULT_CAPTIONS_PATH;
|
|
11567
11552
|
}
|
|
11568
11553
|
function rebaseCaptionsUrl(endpoints, url) {
|
|
11569
11554
|
if (!url || !url.startsWith(`${DEFAULT_CAPTIONS_PATH}/`)) return url;
|
|
@@ -11673,7 +11658,7 @@ TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
|
11673
11658
|
// src/components/features/use-captions.ts
|
|
11674
11659
|
|
|
11675
11660
|
function useCaptions() {
|
|
11676
|
-
const endpoints = _nullishCoalesce(_optionalChain([_chunkRDTOMWDNcjs.useChatRuntime.call(void 0, ), 'optionalAccess',
|
|
11661
|
+
const endpoints = _nullishCoalesce(_optionalChain([_chunkRDTOMWDNcjs.useChatRuntime.call(void 0, ), 'optionalAccess', _211 => _211.endpoints]), () => ( null));
|
|
11677
11662
|
return _react.useMemo.call(void 0,
|
|
11678
11663
|
() => ({
|
|
11679
11664
|
forEntity: (entityType, entity) => getEntityCaptionUrls(endpoints, entityType, entity),
|
|
@@ -11702,11 +11687,11 @@ function fetchPriorityProp(priority) {
|
|
|
11702
11687
|
var ENTER_FULLSCREEN_REQUEST = "mediaenterfullscreenrequest";
|
|
11703
11688
|
function isIosAppShell() {
|
|
11704
11689
|
const capacitor = globalThis.Capacitor;
|
|
11705
|
-
return _optionalChain([capacitor, 'optionalAccess',
|
|
11690
|
+
return _optionalChain([capacitor, 'optionalAccess', _212 => _212.isNativePlatform, 'optionalCall', _213 => _213()]) === true && _optionalChain([capacitor, 'access', _214 => _214.getPlatform, 'optionalCall', _215 => _215()]) === "ios";
|
|
11706
11691
|
}
|
|
11707
11692
|
function nativeVideoElement(player) {
|
|
11708
11693
|
const media = player.media;
|
|
11709
|
-
const element = _nullishCoalesce(_optionalChain([media, 'optionalAccess',
|
|
11694
|
+
const element = _nullishCoalesce(_optionalChain([media, 'optionalAccess', _216 => _216.nativeEl]), () => ( media));
|
|
11710
11695
|
return element instanceof HTMLVideoElement ? element : null;
|
|
11711
11696
|
}
|
|
11712
11697
|
function useIosNativeVideoFullscreen(playerRef) {
|
|
@@ -11716,7 +11701,7 @@ function useIosNativeVideoFullscreen(playerRef) {
|
|
|
11716
11701
|
if (!(player instanceof EventTarget)) return void 0;
|
|
11717
11702
|
const takeOver = (event) => {
|
|
11718
11703
|
const video = nativeVideoElement(player);
|
|
11719
|
-
if (!_optionalChain([video, 'optionalAccess',
|
|
11704
|
+
if (!_optionalChain([video, 'optionalAccess', _217 => _217.webkitSupportsFullscreen]) || typeof video.webkitEnterFullscreen !== "function") return;
|
|
11720
11705
|
event.stopImmediatePropagation();
|
|
11721
11706
|
video.webkitEnterFullscreen();
|
|
11722
11707
|
};
|
|
@@ -11750,11 +11735,11 @@ function toMuxPreviewUrl(url, maxResolution = "720p") {
|
|
|
11750
11735
|
function saveDataEnabled() {
|
|
11751
11736
|
if (typeof navigator === "undefined") return false;
|
|
11752
11737
|
const conn = navigator.connection;
|
|
11753
|
-
return _optionalChain([conn, 'optionalAccess',
|
|
11738
|
+
return _optionalChain([conn, 'optionalAccess', _218 => _218.saveData]) === true;
|
|
11754
11739
|
}
|
|
11755
11740
|
function useVideoOriginPreconnect({ supabaseStorageOrigin } = {}) {
|
|
11756
11741
|
const runtime = _chunkRDTOMWDNcjs.useChatRuntime.call(void 0, );
|
|
11757
|
-
const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess',
|
|
11742
|
+
const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess', _219 => _219.endpoints, 'access', _220 => _220.supabaseStorageOrigin])));
|
|
11758
11743
|
try {
|
|
11759
11744
|
_reactdom2.default.preconnect(MUX_STREAM_ORIGIN, { crossOrigin: "anonymous" });
|
|
11760
11745
|
_reactdom2.default.preconnect(MUX_IMAGE_ORIGIN, { crossOrigin: "anonymous" });
|
|
@@ -11773,7 +11758,7 @@ function useVideoWarmup({
|
|
|
11773
11758
|
nearMargin = "1000px"
|
|
11774
11759
|
} = {}) {
|
|
11775
11760
|
const runtime = _chunkRDTOMWDNcjs.useChatRuntime.call(void 0, );
|
|
11776
|
-
const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess',
|
|
11761
|
+
const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess', _221 => _221.endpoints, 'access', _222 => _222.supabaseStorageOrigin])));
|
|
11777
11762
|
useVideoOriginPreconnect({ supabaseStorageOrigin: resolvedOrigin });
|
|
11778
11763
|
const { ref, isNear } = _chunkZI27ALYXcjs.useNearViewport.call(void 0, nearMargin);
|
|
11779
11764
|
_react.useEffect.call(void 0, () => {
|
|
@@ -11875,7 +11860,7 @@ if (typeof document !== "undefined") {
|
|
|
11875
11860
|
}
|
|
11876
11861
|
if (typeof window !== "undefined") {
|
|
11877
11862
|
const w = window;
|
|
11878
|
-
if (!_optionalChain([w, 'access',
|
|
11863
|
+
if (!_optionalChain([w, 'access', _223 => _223.chrome, 'optionalAccess', _224 => _224.cast])) {
|
|
11879
11864
|
w.chrome = { ..._nullishCoalesce(w.chrome, () => ( {})), cast: { isAvailable: false } };
|
|
11880
11865
|
}
|
|
11881
11866
|
}
|
|
@@ -12116,7 +12101,7 @@ function FilePlayer({
|
|
|
12116
12101
|
const clearPerfListener = _react.useCallback.call(void 0, () => {
|
|
12117
12102
|
if (perfListenerRef.current) {
|
|
12118
12103
|
try {
|
|
12119
|
-
_optionalChain([hoverPlayerRef, 'access',
|
|
12104
|
+
_optionalChain([hoverPlayerRef, 'access', _225 => _225.current, 'optionalAccess', _226 => _226.removeEventListener, 'optionalCall', _227 => _227("playing", perfListenerRef.current)]);
|
|
12120
12105
|
} catch (e21) {
|
|
12121
12106
|
}
|
|
12122
12107
|
perfListenerRef.current = null;
|
|
@@ -12151,7 +12136,7 @@ function FilePlayer({
|
|
|
12151
12136
|
};
|
|
12152
12137
|
perfListenerRef.current = onPlaying;
|
|
12153
12138
|
try {
|
|
12154
|
-
_optionalChain([el, 'access',
|
|
12139
|
+
_optionalChain([el, 'access', _228 => _228.addEventListener, 'optionalCall', _229 => _229("playing", onPlaying)]);
|
|
12155
12140
|
} catch (e22) {
|
|
12156
12141
|
}
|
|
12157
12142
|
}
|
|
@@ -12159,12 +12144,12 @@ function FilePlayer({
|
|
|
12159
12144
|
el.volume = 0.5;
|
|
12160
12145
|
if (userHasInteracted) {
|
|
12161
12146
|
el.muted = mutedIntentRef.current;
|
|
12162
|
-
_optionalChain([el, 'access',
|
|
12163
|
-
const name = _optionalChain([err, 'optionalAccess',
|
|
12147
|
+
_optionalChain([el, 'access', _230 => _230.play, 'optionalCall', _231 => _231(), 'optionalAccess', _232 => _232.catch, 'optionalCall', _233 => _233((err) => {
|
|
12148
|
+
const name = _optionalChain([err, 'optionalAccess', _234 => _234.name]);
|
|
12164
12149
|
if (name === "NotAllowedError" && hoverActiveRef.current && generation === hoverGenerationRef.current) {
|
|
12165
12150
|
try {
|
|
12166
12151
|
el.muted = true;
|
|
12167
|
-
_optionalChain([el, 'access',
|
|
12152
|
+
_optionalChain([el, 'access', _235 => _235.play, 'optionalCall', _236 => _236(), 'optionalAccess', _237 => _237.catch, 'optionalCall', _238 => _238(() => {
|
|
12168
12153
|
if (hoverActiveRef.current && generation === hoverGenerationRef.current) {
|
|
12169
12154
|
setMutedFallbackBlocked(true);
|
|
12170
12155
|
}
|
|
@@ -12176,7 +12161,7 @@ function FilePlayer({
|
|
|
12176
12161
|
})]);
|
|
12177
12162
|
} else {
|
|
12178
12163
|
el.muted = true;
|
|
12179
|
-
_optionalChain([el, 'access',
|
|
12164
|
+
_optionalChain([el, 'access', _239 => _239.play, 'optionalCall', _240 => _240(), 'optionalAccess', _241 => _241.catch, 'optionalCall', _242 => _242(() => {
|
|
12180
12165
|
if (hoverActiveRef.current && generation === hoverGenerationRef.current) {
|
|
12181
12166
|
setMutedFallbackBlocked(true);
|
|
12182
12167
|
}
|
|
@@ -12206,7 +12191,7 @@ function FilePlayer({
|
|
|
12206
12191
|
clearActivationWaiter();
|
|
12207
12192
|
clearPerfListener();
|
|
12208
12193
|
try {
|
|
12209
|
-
_optionalChain([hoverPlayerRef, 'access',
|
|
12194
|
+
_optionalChain([hoverPlayerRef, 'access', _243 => _243.current, 'optionalAccess', _244 => _244.pause, 'optionalCall', _245 => _245()]);
|
|
12210
12195
|
} catch (e26) {
|
|
12211
12196
|
}
|
|
12212
12197
|
}, [clearActivationWaiter, clearPerfListener]);
|
|
@@ -12218,7 +12203,7 @@ function FilePlayer({
|
|
|
12218
12203
|
if (el) {
|
|
12219
12204
|
el.muted = false;
|
|
12220
12205
|
el.volume = 0.5;
|
|
12221
|
-
_optionalChain([el, 'access',
|
|
12206
|
+
_optionalChain([el, 'access', _246 => _246.play, 'optionalCall', _247 => _247(), 'optionalAccess', _248 => _248.catch, 'optionalCall', _249 => _249(() => {
|
|
12222
12207
|
})]);
|
|
12223
12208
|
}
|
|
12224
12209
|
} catch (e27) {
|
|
@@ -12238,7 +12223,7 @@ function FilePlayer({
|
|
|
12238
12223
|
onMutedFallbackChangeRef.current = onMutedFallbackChange;
|
|
12239
12224
|
});
|
|
12240
12225
|
_react.useEffect.call(void 0, () => {
|
|
12241
|
-
_optionalChain([onMutedFallbackChangeRef, 'access',
|
|
12226
|
+
_optionalChain([onMutedFallbackChangeRef, 'access', _250 => _250.current, 'optionalCall', _251 => _251({
|
|
12242
12227
|
muted: hoverMutedFallback,
|
|
12243
12228
|
blocked: hoverMutedFallback && mutedFallbackBlocked
|
|
12244
12229
|
})]);
|
|
@@ -12257,7 +12242,7 @@ function FilePlayer({
|
|
|
12257
12242
|
if (autoPlay) {
|
|
12258
12243
|
const reportBlocked = () => setMutedFallbackBlocked(true);
|
|
12259
12244
|
try {
|
|
12260
|
-
_optionalChain([mutedEl, 'access',
|
|
12245
|
+
_optionalChain([mutedEl, 'access', _252 => _252.play, 'optionalCall', _253 => _253(), 'optionalAccess', _254 => _254.catch, 'optionalCall', _255 => _255(reportBlocked)]);
|
|
12261
12246
|
} catch (e29) {
|
|
12262
12247
|
reportBlocked();
|
|
12263
12248
|
}
|
|
@@ -12271,12 +12256,12 @@ function FilePlayer({
|
|
|
12271
12256
|
try {
|
|
12272
12257
|
el.muted = false;
|
|
12273
12258
|
el.volume = typeof el.volume === "number" ? el.volume : 1;
|
|
12274
|
-
_optionalChain([el, 'access',
|
|
12275
|
-
const name = _optionalChain([err, 'optionalAccess',
|
|
12259
|
+
_optionalChain([el, 'access', _256 => _256.play, 'optionalCall', _257 => _257(), 'optionalAccess', _258 => _258.catch, 'optionalCall', _259 => _259((err) => {
|
|
12260
|
+
const name = _optionalChain([err, 'optionalAccess', _260 => _260.name]);
|
|
12276
12261
|
if (name !== "NotAllowedError") return;
|
|
12277
12262
|
try {
|
|
12278
12263
|
el.muted = true;
|
|
12279
|
-
_optionalChain([el, 'access',
|
|
12264
|
+
_optionalChain([el, 'access', _261 => _261.play, 'optionalCall', _262 => _262(), 'optionalAccess', _263 => _263.catch, 'optionalCall', _264 => _264(() => {
|
|
12280
12265
|
setMutedFallbackBlocked(true);
|
|
12281
12266
|
setHoverMutedFallback(true);
|
|
12282
12267
|
})]);
|
|
@@ -12292,7 +12277,7 @@ function FilePlayer({
|
|
|
12292
12277
|
}, [autoPlayUnmuted, startMuted, autoPlay]);
|
|
12293
12278
|
_react.useEffect.call(void 0, () => {
|
|
12294
12279
|
const el = hoverPlayerRef.current;
|
|
12295
|
-
if (!_optionalChain([el, 'optionalAccess',
|
|
12280
|
+
if (!_optionalChain([el, 'optionalAccess', _265 => _265.addEventListener])) return void 0;
|
|
12296
12281
|
const onVolumeChange = () => {
|
|
12297
12282
|
if (el.muted === false) {
|
|
12298
12283
|
setMutedFallbackBlocked(false);
|
|
@@ -12305,14 +12290,14 @@ function FilePlayer({
|
|
|
12305
12290
|
}
|
|
12306
12291
|
return () => {
|
|
12307
12292
|
try {
|
|
12308
|
-
_optionalChain([el, 'access',
|
|
12293
|
+
_optionalChain([el, 'access', _266 => _266.removeEventListener, 'optionalCall', _267 => _267("volumechange", onVolumeChange)]);
|
|
12309
12294
|
} catch (e33) {
|
|
12310
12295
|
}
|
|
12311
12296
|
};
|
|
12312
12297
|
}, []);
|
|
12313
12298
|
_react.useEffect.call(void 0, () => {
|
|
12314
12299
|
const el = hoverPlayerRef.current;
|
|
12315
|
-
if (!_optionalChain([el, 'optionalAccess',
|
|
12300
|
+
if (!_optionalChain([el, 'optionalAccess', _268 => _268.addEventListener])) return void 0;
|
|
12316
12301
|
const onPlaying = () => setMutedFallbackBlocked(false);
|
|
12317
12302
|
try {
|
|
12318
12303
|
el.addEventListener("playing", onPlaying);
|
|
@@ -12320,7 +12305,7 @@ function FilePlayer({
|
|
|
12320
12305
|
}
|
|
12321
12306
|
return () => {
|
|
12322
12307
|
try {
|
|
12323
|
-
_optionalChain([el, 'access',
|
|
12308
|
+
_optionalChain([el, 'access', _269 => _269.removeEventListener, 'optionalCall', _270 => _270("playing", onPlaying)]);
|
|
12324
12309
|
} catch (e35) {
|
|
12325
12310
|
}
|
|
12326
12311
|
};
|
|
@@ -12331,15 +12316,15 @@ function FilePlayer({
|
|
|
12331
12316
|
});
|
|
12332
12317
|
_react.useEffect.call(void 0, () => {
|
|
12333
12318
|
const el = hoverPlayerRef.current;
|
|
12334
|
-
if (!_optionalChain([el, 'optionalAccess',
|
|
12335
|
-
const handler = () => _optionalChain([onEndedRef, 'access',
|
|
12319
|
+
if (!_optionalChain([el, 'optionalAccess', _271 => _271.addEventListener])) return void 0;
|
|
12320
|
+
const handler = () => _optionalChain([onEndedRef, 'access', _272 => _272.current, 'optionalCall', _273 => _273()]);
|
|
12336
12321
|
try {
|
|
12337
12322
|
el.addEventListener("ended", handler);
|
|
12338
12323
|
} catch (e36) {
|
|
12339
12324
|
}
|
|
12340
12325
|
return () => {
|
|
12341
12326
|
try {
|
|
12342
|
-
_optionalChain([el, 'access',
|
|
12327
|
+
_optionalChain([el, 'access', _274 => _274.removeEventListener, 'optionalCall', _275 => _275("ended", handler)]);
|
|
12343
12328
|
} catch (e37) {
|
|
12344
12329
|
}
|
|
12345
12330
|
};
|
|
@@ -12348,19 +12333,19 @@ function FilePlayer({
|
|
|
12348
12333
|
_react.useImperativeHandle.call(void 0,
|
|
12349
12334
|
playerHandleRef,
|
|
12350
12335
|
() => ({
|
|
12351
|
-
getCurrentTime: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access',
|
|
12336
|
+
getCurrentTime: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _276 => _276.current, 'optionalAccess', _277 => _277.currentTime]), () => ( 0)),
|
|
12352
12337
|
getDuration: () => {
|
|
12353
|
-
const d = _optionalChain([hoverPlayerRef, 'access',
|
|
12338
|
+
const d = _optionalChain([hoverPlayerRef, 'access', _278 => _278.current, 'optionalAccess', _279 => _279.duration]);
|
|
12354
12339
|
return typeof d === "number" && isFinite(d) ? d : 0;
|
|
12355
12340
|
},
|
|
12356
|
-
getPaused: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access',
|
|
12357
|
-
getMuted: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access',
|
|
12341
|
+
getPaused: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _280 => _280.current, 'optionalAccess', _281 => _281.paused]), () => ( true)),
|
|
12342
|
+
getMuted: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _282 => _282.current, 'optionalAccess', _283 => _283.muted]), () => ( false)),
|
|
12358
12343
|
play: async () => {
|
|
12359
|
-
await _optionalChain([hoverPlayerRef, 'access',
|
|
12344
|
+
await _optionalChain([hoverPlayerRef, 'access', _284 => _284.current, 'optionalAccess', _285 => _285.play, 'optionalCall', _286 => _286()]);
|
|
12360
12345
|
},
|
|
12361
12346
|
pause: () => {
|
|
12362
12347
|
try {
|
|
12363
|
-
_optionalChain([hoverPlayerRef, 'access',
|
|
12348
|
+
_optionalChain([hoverPlayerRef, 'access', _287 => _287.current, 'optionalAccess', _288 => _288.pause, 'optionalCall', _289 => _289()]);
|
|
12364
12349
|
} catch (e38) {
|
|
12365
12350
|
}
|
|
12366
12351
|
},
|
|
@@ -12427,10 +12412,10 @@ function FilePlayer({
|
|
|
12427
12412
|
if (!el) return;
|
|
12428
12413
|
const resumeAt = typeof el.currentTime === "number" ? el.currentTime : 0;
|
|
12429
12414
|
try {
|
|
12430
|
-
_optionalChain([el, 'access',
|
|
12415
|
+
_optionalChain([el, 'access', _290 => _290.load, 'optionalCall', _291 => _291()]);
|
|
12431
12416
|
if (resumeAt > 0 && el.addEventListener && el.removeEventListener) {
|
|
12432
12417
|
const seekBack = () => {
|
|
12433
|
-
_optionalChain([el, 'access',
|
|
12418
|
+
_optionalChain([el, 'access', _292 => _292.removeEventListener, 'optionalCall', _293 => _293("loadedmetadata", seekBack)]);
|
|
12434
12419
|
try {
|
|
12435
12420
|
el.currentTime = resumeAt;
|
|
12436
12421
|
} catch (e40) {
|
|
@@ -12438,7 +12423,7 @@ function FilePlayer({
|
|
|
12438
12423
|
};
|
|
12439
12424
|
el.addEventListener("loadedmetadata", seekBack);
|
|
12440
12425
|
}
|
|
12441
|
-
_optionalChain([el, 'access',
|
|
12426
|
+
_optionalChain([el, 'access', _294 => _294.play, 'optionalCall', _295 => _295(), 'optionalAccess', _296 => _296.catch, 'optionalCall', _297 => _297(() => {
|
|
12442
12427
|
})]);
|
|
12443
12428
|
} catch (e41) {
|
|
12444
12429
|
}
|
|
@@ -12597,7 +12582,7 @@ function YouTubeFacadeInner({
|
|
|
12597
12582
|
const iframe = iframeRef.current;
|
|
12598
12583
|
if (!iframe) return void 0;
|
|
12599
12584
|
function subscribe2() {
|
|
12600
|
-
_optionalChain([iframe, 'optionalAccess',
|
|
12585
|
+
_optionalChain([iframe, 'optionalAccess', _298 => _298.contentWindow, 'optionalAccess', _299 => _299.postMessage, 'call', _300 => _300('{"event":"listening"}', YT_NOCOOKIE_ORIGIN)]);
|
|
12601
12586
|
}
|
|
12602
12587
|
iframe.addEventListener("load", subscribe2);
|
|
12603
12588
|
subscribe2();
|
|
@@ -12618,13 +12603,13 @@ function YouTubeFacadeInner({
|
|
|
12618
12603
|
return;
|
|
12619
12604
|
}
|
|
12620
12605
|
if (payload.event !== "infoDelivery") return;
|
|
12621
|
-
const state = _optionalChain([payload, 'access',
|
|
12606
|
+
const state = _optionalChain([payload, 'access', _301 => _301.info, 'optionalAccess', _302 => _302.playerState]);
|
|
12622
12607
|
if (typeof state !== "number") return;
|
|
12623
12608
|
if (state === YT_STATE_PLAYING) {
|
|
12624
12609
|
if (blurTimer !== null) return;
|
|
12625
12610
|
blurTimer = setTimeout(() => {
|
|
12626
12611
|
blurTimer = null;
|
|
12627
|
-
_optionalChain([iframeRef, 'access',
|
|
12612
|
+
_optionalChain([iframeRef, 'access', _303 => _303.current, 'optionalAccess', _304 => _304.blur, 'call', _305 => _305()]);
|
|
12628
12613
|
}, YT_PLAYING_BLUR_DELAY_MS);
|
|
12629
12614
|
return;
|
|
12630
12615
|
}
|
|
@@ -12645,7 +12630,7 @@ function YouTubeFacadeInner({
|
|
|
12645
12630
|
prevSuspendedRef.current = Boolean(suspended);
|
|
12646
12631
|
if (!activated) return;
|
|
12647
12632
|
if (suspended && !wasSuspended) {
|
|
12648
|
-
_optionalChain([iframeRef, 'access',
|
|
12633
|
+
_optionalChain([iframeRef, 'access', _306 => _306.current, 'optionalAccess', _307 => _307.contentWindow, 'optionalAccess', _308 => _308.postMessage, 'call', _309 => _309(
|
|
12649
12634
|
'{"event":"command","func":"pauseVideo","args":[]}',
|
|
12650
12635
|
YT_NOCOOKIE_ORIGIN
|
|
12651
12636
|
)]);
|
|
@@ -12899,7 +12884,7 @@ function CardsStrip(props) {
|
|
|
12899
12884
|
_react.useEffect.call(void 0, () => {
|
|
12900
12885
|
const el = wrapperRef.current;
|
|
12901
12886
|
if (!el || typeof IntersectionObserver === "undefined") return void 0;
|
|
12902
|
-
const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access',
|
|
12887
|
+
const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access', _310 => _310[0], 'optionalAccess', _311 => _311.isIntersecting]), () => ( true))), {
|
|
12903
12888
|
rootMargin: "200px"
|
|
12904
12889
|
});
|
|
12905
12890
|
io.observe(el);
|
|
@@ -12921,9 +12906,9 @@ function CardsStrip(props) {
|
|
|
12921
12906
|
const p = hoverPointerRef.current;
|
|
12922
12907
|
if (!p.inside) return;
|
|
12923
12908
|
const el = typeof document !== "undefined" ? document.elementFromPoint(p.x, p.y) : null;
|
|
12924
|
-
const cardEl = _optionalChain([el, 'optionalAccess',
|
|
12925
|
-
const scoped = cardEl && _optionalChain([scrollerRef, 'access',
|
|
12926
|
-
const key = _nullishCoalesce(_optionalChain([scoped, 'optionalAccess',
|
|
12909
|
+
const cardEl = _optionalChain([el, 'optionalAccess', _312 => _312.closest, 'optionalCall', _313 => _313("[data-strip-card-key]")]);
|
|
12910
|
+
const scoped = cardEl && _optionalChain([scrollerRef, 'access', _314 => _314.current, 'optionalAccess', _315 => _315.contains, 'call', _316 => _316(cardEl)]) ? cardEl : null;
|
|
12911
|
+
const key = _nullishCoalesce(_optionalChain([scoped, 'optionalAccess', _317 => _317.getAttribute, 'call', _318 => _318("data-strip-card-key")]), () => ( null));
|
|
12927
12912
|
const current = activeKeyRef.current;
|
|
12928
12913
|
if (key === current) return;
|
|
12929
12914
|
if (current !== null) deactivate(current);
|
|
@@ -12961,7 +12946,7 @@ function CardsStrip(props) {
|
|
|
12961
12946
|
}, [syncHoverToPointer]);
|
|
12962
12947
|
const seamBuffer = _react.useCallback.call(void 0, () => {
|
|
12963
12948
|
const half = singleCopyWidthRef.current;
|
|
12964
|
-
const viewport = _nullishCoalesce(_optionalChain([scrollerRef, 'access',
|
|
12949
|
+
const viewport = _nullishCoalesce(_optionalChain([scrollerRef, 'access', _319 => _319.current, 'optionalAccess', _320 => _320.clientWidth]), () => ( 0));
|
|
12965
12950
|
return Math.max(0, Math.min(200, half / 4, half - viewport - TRACK_GAP_PX - 1));
|
|
12966
12951
|
}, []);
|
|
12967
12952
|
const { posRef: marqueePosRef, glideBy } = _chunkZI27ALYXcjs.useMarqueeEngine.call(void 0, {
|
|
@@ -12977,7 +12962,7 @@ function CardsStrip(props) {
|
|
|
12977
12962
|
const scroller = scrollerRef.current;
|
|
12978
12963
|
if (scroller) scroller.scrollLeft = pos;
|
|
12979
12964
|
},
|
|
12980
|
-
readBack: () => _nullishCoalesce(_optionalChain([scrollerRef, 'access',
|
|
12965
|
+
readBack: () => _nullishCoalesce(_optionalChain([scrollerRef, 'access', _321 => _321.current, 'optionalAccess', _322 => _322.scrollLeft]), () => ( 0)),
|
|
12981
12966
|
onAfterFrame: syncHoverIfScrolled
|
|
12982
12967
|
});
|
|
12983
12968
|
const [mountedIdx, setMountedIdx] = _react.useState.call(void 0, () => /* @__PURE__ */ new Set());
|
|
@@ -13025,11 +13010,11 @@ function CardsStrip(props) {
|
|
|
13025
13010
|
fn = (el) => {
|
|
13026
13011
|
if (!el) return void 0;
|
|
13027
13012
|
cardElIdxRef.current.set(el, idx);
|
|
13028
|
-
_optionalChain([cardObserverRef, 'access',
|
|
13013
|
+
_optionalChain([cardObserverRef, 'access', _323 => _323.current, 'optionalAccess', _324 => _324.observe, 'call', _325 => _325(el)]);
|
|
13029
13014
|
return () => {
|
|
13030
13015
|
cardElIdxRef.current.delete(el);
|
|
13031
13016
|
cardElNearRef.current.delete(el);
|
|
13032
|
-
_optionalChain([cardObserverRef, 'access',
|
|
13017
|
+
_optionalChain([cardObserverRef, 'access', _326 => _326.current, 'optionalAccess', _327 => _327.unobserve, 'call', _328 => _328(el)]);
|
|
13033
13018
|
};
|
|
13034
13019
|
};
|
|
13035
13020
|
cardRefFns.set(idx, fn);
|
|
@@ -13048,7 +13033,7 @@ function CardsStrip(props) {
|
|
|
13048
13033
|
const track = trackRef.current;
|
|
13049
13034
|
if (!scroller || !track) return;
|
|
13050
13035
|
const firstCard = track.firstElementChild;
|
|
13051
|
-
const step = (_nullishCoalesce(_optionalChain([firstCard, 'optionalAccess',
|
|
13036
|
+
const step = (_nullishCoalesce(_optionalChain([firstCard, 'optionalAccess', _329 => _329.offsetWidth]), () => ( 320))) + TRACK_GAP_PX;
|
|
13052
13037
|
chevronSuppressUntilRef.current = performance.now() + CHEVRON_SUPPRESS_MS;
|
|
13053
13038
|
if (marqueeActiveRef.current) {
|
|
13054
13039
|
glideBy(dir * step);
|
|
@@ -13105,7 +13090,7 @@ function CardsStrip(props) {
|
|
|
13105
13090
|
{
|
|
13106
13091
|
ref: (node) => {
|
|
13107
13092
|
wrapperRef.current = node;
|
|
13108
|
-
_optionalChain([rootRef, 'optionalCall',
|
|
13093
|
+
_optionalChain([rootRef, 'optionalCall', _330 => _330(node)]);
|
|
13109
13094
|
},
|
|
13110
13095
|
className: _chunkPRPZBXWZcjs.cn.call(void 0, "flex w-full min-w-0 flex-col gap-6", className),
|
|
13111
13096
|
children: [
|
|
@@ -13217,7 +13202,7 @@ function VideoHoverPreviewSurface({
|
|
|
13217
13202
|
if (gateControlled) return void 0;
|
|
13218
13203
|
const el = rootElRef.current;
|
|
13219
13204
|
if (!el || typeof IntersectionObserver === "undefined") return void 0;
|
|
13220
|
-
const io = new IntersectionObserver((entries) => setIsNear(_nullishCoalesce(_optionalChain([entries, 'access',
|
|
13205
|
+
const io = new IntersectionObserver((entries) => setIsNear(_nullishCoalesce(_optionalChain([entries, 'access', _331 => _331[0], 'optionalAccess', _332 => _332.isIntersecting]), () => ( false))), {
|
|
13221
13206
|
rootMargin: _chunkZI27ALYXcjs.NEAR_VIEWPORT_ROOT_MARGIN
|
|
13222
13207
|
});
|
|
13223
13208
|
io.observe(el);
|
|
@@ -13362,7 +13347,7 @@ function VideoBitesStrip({
|
|
|
13362
13347
|
const filtered = filterPublished ? bites.filter((b) => b.published) : [...bites];
|
|
13363
13348
|
return filtered.sort(sortComparator);
|
|
13364
13349
|
}, [bites, filterPublished, sortComparator]);
|
|
13365
|
-
const warmup = useVideoWarmup({ videoUrl: _optionalChain([items, 'access',
|
|
13350
|
+
const warmup = useVideoWarmup({ videoUrl: _optionalChain([items, 'access', _333 => _333[0], 'optionalAccess', _334 => _334.url]) || null });
|
|
13366
13351
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
13367
13352
|
CardsStrip,
|
|
13368
13353
|
{
|
|
@@ -13429,8 +13414,8 @@ function VideoBiteCard({
|
|
|
13429
13414
|
const controlled = active !== void 0;
|
|
13430
13415
|
const [selfActive, setSelfActive] = _react.useState.call(void 0, false);
|
|
13431
13416
|
const isActive = controlled ? !!active : selfActive;
|
|
13432
|
-
const activate = () => controlled ? _optionalChain([onActivate, 'optionalCall',
|
|
13433
|
-
const deactivate = () => controlled ? _optionalChain([onDeactivate, 'optionalCall',
|
|
13417
|
+
const activate = () => controlled ? _optionalChain([onActivate, 'optionalCall', _335 => _335(key)]) : setSelfActive(true);
|
|
13418
|
+
const deactivate = () => controlled ? _optionalChain([onDeactivate, 'optionalCall', _336 => _336(key)]) : setSelfActive(false);
|
|
13434
13419
|
const titleInputRef = _react.useRef.call(void 0, null);
|
|
13435
13420
|
_chunkZI27ALYXcjs.useIsomorphicLayoutEffect.call(void 0, () => {
|
|
13436
13421
|
const el = titleInputRef.current;
|
|
@@ -13440,7 +13425,7 @@ function VideoBiteCard({
|
|
|
13440
13425
|
});
|
|
13441
13426
|
const navigate = () => {
|
|
13442
13427
|
if (bite.onNavigate) bite.onNavigate();
|
|
13443
|
-
else _optionalChain([onBiteNavigate, 'optionalCall',
|
|
13428
|
+
else _optionalChain([onBiteNavigate, 'optionalCall', _337 => _337(bite, index)]);
|
|
13444
13429
|
};
|
|
13445
13430
|
const handlePointerEnter = () => {
|
|
13446
13431
|
if (!isTouch) activate();
|
|
@@ -13465,9 +13450,9 @@ function VideoBiteCard({
|
|
|
13465
13450
|
placeholder: "Title (optional)",
|
|
13466
13451
|
"aria-label": "Bite title",
|
|
13467
13452
|
rows: 1,
|
|
13468
|
-
onChange: (e) => _optionalChain([onTitleChange, 'optionalCall',
|
|
13453
|
+
onChange: (e) => _optionalChain([onTitleChange, 'optionalCall', _338 => _338(e.target.value)]),
|
|
13469
13454
|
ref: titleInputRef,
|
|
13470
|
-
onBlur: (e) => _optionalChain([onTitleCommit, 'optionalCall',
|
|
13455
|
+
onBlur: (e) => _optionalChain([onTitleCommit, 'optionalCall', _339 => _339(e.target.value)]),
|
|
13471
13456
|
onClick: (e) => e.stopPropagation(),
|
|
13472
13457
|
className: _chunkPRPZBXWZcjs.cn.call(void 0,
|
|
13473
13458
|
titleClass,
|
|
@@ -13544,7 +13529,7 @@ function VideoBiteCard({
|
|
|
13544
13529
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
13545
13530
|
"div",
|
|
13546
13531
|
{
|
|
13547
|
-
ref: (node) => _optionalChain([rootRef, 'optionalCall',
|
|
13532
|
+
ref: (node) => _optionalChain([rootRef, 'optionalCall', _340 => _340(node)]),
|
|
13548
13533
|
"aria-hidden": isClone || void 0,
|
|
13549
13534
|
"data-strip-card-key": key,
|
|
13550
13535
|
className: _chunkPRPZBXWZcjs.cn.call(void 0,
|
|
@@ -13599,8 +13584,8 @@ function EntityVideoSection({
|
|
|
13599
13584
|
const hasHighlight = !!highlightVideoUrl;
|
|
13600
13585
|
const hasVideo = hasFullVideo || hasHighlight;
|
|
13601
13586
|
const derivedCaptions = captionsEntity ? captions.forEntityId(captionsEntity.type, captionsEntity.id) : null;
|
|
13602
|
-
const captionsUrl = _nullishCoalesce(captionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess',
|
|
13603
|
-
const highlightCaptionsUrl = _nullishCoalesce(highlightCaptionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess',
|
|
13587
|
+
const captionsUrl = _nullishCoalesce(captionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess', _341 => _341.captionsUrl])));
|
|
13588
|
+
const highlightCaptionsUrl = _nullishCoalesce(highlightCaptionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess', _342 => _342.highlightCaptionsUrl])));
|
|
13604
13589
|
if (!hasVideo && !videoSummary && (!videoBites || videoBites.length === 0)) {
|
|
13605
13590
|
return null;
|
|
13606
13591
|
}
|
|
@@ -14119,7 +14104,7 @@ function DataRoomDocCard({ item, className, badgeText, anchorProps }) {
|
|
|
14119
14104
|
] }) : null,
|
|
14120
14105
|
item.preview ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex min-w-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-clamp-2 whitespace-pre-wrap break-words text-ods-text-secondary text-h6", children: item.preview }) }) : null
|
|
14121
14106
|
] }),
|
|
14122
|
-
_optionalChain([anchorProps, 'optionalAccess',
|
|
14107
|
+
_optionalChain([anchorProps, 'optionalAccess', _343 => _343.href]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex h-5 shrink-0 items-center self-start text-ods-text-secondary", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "h-3.5 w-3.5" }) }) : null
|
|
14123
14108
|
] });
|
|
14124
14109
|
if (!anchorProps) {
|
|
14125
14110
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `${_chunkNNFQLTJ3cjs.COMPACT_CARD_OUTER_STATIC} ${_nullishCoalesce(className, () => ( ""))}`, "aria-label": "No link available", children: body });
|
|
@@ -14147,7 +14132,7 @@ function DataRoomDocCardSkeleton({ className }) {
|
|
|
14147
14132
|
|
|
14148
14133
|
|
|
14149
14134
|
function CampaignCardAdmin({ campaign, className, anchorProps }) {
|
|
14150
|
-
const goalsCount = _optionalChain([campaign, 'access',
|
|
14135
|
+
const goalsCount = _optionalChain([campaign, 'access', _344 => _344.goals, 'optionalAccess', _345 => _345.length]) || 0;
|
|
14151
14136
|
const innerChildren = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
14152
14137
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: _chunkNNFQLTJ3cjs.COMPACT_CARD_ICON_SLOT, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Megaphone, { className: "h-5 w-5" }) }),
|
|
14153
14138
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: _chunkNNFQLTJ3cjs.COMPACT_CARD_TEXT_COL, children: [
|
|
@@ -14235,190 +14220,6 @@ function GenericEntityCardSkeleton({ className }) {
|
|
|
14235
14220
|
// src/components/chat/entity-cards/dispatch.tsx
|
|
14236
14221
|
|
|
14237
14222
|
|
|
14238
|
-
// src/chat-protocol/source-metadata.ts
|
|
14239
|
-
var CARD_REFERENCE = /^\[card:\/\/([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)\]$/;
|
|
14240
|
-
var SOURCE_METADATA_MATCHED = "sourceMetadataMatched";
|
|
14241
|
-
function isSourceMetadataCardRef(ref) {
|
|
14242
|
-
return _optionalChain([ref, 'access', _350 => _350.metadata, 'optionalAccess', _351 => _351[SOURCE_METADATA_MATCHED]]) === true;
|
|
14243
|
-
}
|
|
14244
|
-
function requiredString(value) {
|
|
14245
|
-
if (typeof value !== "string") return null;
|
|
14246
|
-
const normalized = value.trim();
|
|
14247
|
-
return normalized ? normalized : null;
|
|
14248
|
-
}
|
|
14249
|
-
function optionalString(value) {
|
|
14250
|
-
return _nullishCoalesce(requiredString(value), () => ( void 0));
|
|
14251
|
-
}
|
|
14252
|
-
function httpsUrl(value) {
|
|
14253
|
-
const candidate = optionalString(value);
|
|
14254
|
-
if (!candidate) return void 0;
|
|
14255
|
-
try {
|
|
14256
|
-
return new URL(candidate).protocol === "https:" ? candidate : void 0;
|
|
14257
|
-
} catch (e45) {
|
|
14258
|
-
return void 0;
|
|
14259
|
-
}
|
|
14260
|
-
}
|
|
14261
|
-
function youtubeId(value) {
|
|
14262
|
-
const candidate = optionalString(value);
|
|
14263
|
-
if (!candidate) return void 0;
|
|
14264
|
-
if (/^[A-Za-z0-9_-]{11}$/.test(candidate)) return candidate;
|
|
14265
|
-
const url = httpsUrl(candidate);
|
|
14266
|
-
if (!url) return void 0;
|
|
14267
|
-
const parsed = new URL(url);
|
|
14268
|
-
const hostname = parsed.hostname.toLowerCase();
|
|
14269
|
-
const youtubeHost = hostname === "youtu.be" || hostname === "youtube.com" || hostname.endsWith(".youtube.com");
|
|
14270
|
-
if (!youtubeHost) return void 0;
|
|
14271
|
-
const pathId = hostname === "youtu.be" ? parsed.pathname.split("/").filter(Boolean)[0] : _optionalChain([parsed, 'access', _352 => _352.pathname, 'access', _353 => _353.match, 'call', _354 => _354(/^\/(?:embed|v|shorts)\/([A-Za-z0-9_-]{11})(?:\/|$)/), 'optionalAccess', _355 => _355[1]]);
|
|
14272
|
-
const id = _nullishCoalesce(_nullishCoalesce(pathId, () => ( parsed.searchParams.get("v"))), () => ( void 0));
|
|
14273
|
-
return id && /^[A-Za-z0-9_-]{11}$/.test(id) ? id : void 0;
|
|
14274
|
-
}
|
|
14275
|
-
function nullableString(value) {
|
|
14276
|
-
return value === null ? null : optionalString(value);
|
|
14277
|
-
}
|
|
14278
|
-
function normalizeSourceItems(value) {
|
|
14279
|
-
if (!Array.isArray(value)) return void 0;
|
|
14280
|
-
const items = value.flatMap((candidate) => {
|
|
14281
|
-
if (!candidate || typeof candidate !== "object" || Array.isArray(candidate)) return [];
|
|
14282
|
-
const item = candidate;
|
|
14283
|
-
const id = requiredString(item.id);
|
|
14284
|
-
const documentType = requiredString(item.documentType);
|
|
14285
|
-
const name = requiredString(item.name);
|
|
14286
|
-
if (!id || !documentType || !name) return [];
|
|
14287
|
-
const externalUrl = httpsUrl(item.externalUrl);
|
|
14288
|
-
const targetPlatform = nullableString(item.targetPlatform);
|
|
14289
|
-
const path = nullableString(item.path);
|
|
14290
|
-
return [
|
|
14291
|
-
{
|
|
14292
|
-
id,
|
|
14293
|
-
documentType,
|
|
14294
|
-
name,
|
|
14295
|
-
...externalUrl ? { externalUrl } : {},
|
|
14296
|
-
...targetPlatform !== void 0 ? { targetPlatform } : {},
|
|
14297
|
-
...path !== void 0 ? { path } : {}
|
|
14298
|
-
}
|
|
14299
|
-
];
|
|
14300
|
-
});
|
|
14301
|
-
return items.length > 0 ? items : void 0;
|
|
14302
|
-
}
|
|
14303
|
-
function normalizeSources(value) {
|
|
14304
|
-
if (!Array.isArray(value)) return [];
|
|
14305
|
-
const seen = /* @__PURE__ */ new Set();
|
|
14306
|
-
const sources = [];
|
|
14307
|
-
for (const candidate of value) {
|
|
14308
|
-
if (!candidate || typeof candidate !== "object" || Array.isArray(candidate)) continue;
|
|
14309
|
-
const source = candidate;
|
|
14310
|
-
const index = source.index;
|
|
14311
|
-
const name = requiredString(source.name);
|
|
14312
|
-
const path = requiredString(source.path);
|
|
14313
|
-
const documentType = requiredString(source.documentType);
|
|
14314
|
-
const validIndex = typeof index === "number" && Number.isFinite(index) && Number.isInteger(index) && index > 0 && !seen.has(index);
|
|
14315
|
-
if (!validIndex || !name || !path || !documentType) continue;
|
|
14316
|
-
seen.add(index);
|
|
14317
|
-
const externalUrl = httpsUrl(source.externalUrl);
|
|
14318
|
-
const targetPlatform = nullableString(source.targetPlatform);
|
|
14319
|
-
const id = optionalString(source.id);
|
|
14320
|
-
const sourceRepo = optionalString(source.sourceRepo);
|
|
14321
|
-
const label = optionalString(source.label);
|
|
14322
|
-
const items = normalizeSourceItems(source.items);
|
|
14323
|
-
sources.push({
|
|
14324
|
-
index,
|
|
14325
|
-
name,
|
|
14326
|
-
path,
|
|
14327
|
-
documentType,
|
|
14328
|
-
...externalUrl ? { externalUrl } : {},
|
|
14329
|
-
...targetPlatform !== void 0 ? { targetPlatform } : {},
|
|
14330
|
-
...id ? { id } : {},
|
|
14331
|
-
...sourceRepo ? { sourceRepo } : {},
|
|
14332
|
-
...label ? { label } : {},
|
|
14333
|
-
...items ? { items } : {}
|
|
14334
|
-
});
|
|
14335
|
-
}
|
|
14336
|
-
return sources;
|
|
14337
|
-
}
|
|
14338
|
-
function normalizeVideoMetadata(value) {
|
|
14339
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
14340
|
-
const input = value;
|
|
14341
|
-
const metadata = {};
|
|
14342
|
-
for (const key of ["videoUrl", "highlightVideoUrl", "videoPoster", "highlightVideoPoster"]) {
|
|
14343
|
-
const url = httpsUrl(input[key]);
|
|
14344
|
-
if (url) metadata[key] = url;
|
|
14345
|
-
}
|
|
14346
|
-
const id = youtubeId(input.youtubeUrl);
|
|
14347
|
-
if (id) metadata.youtubeUrl = id;
|
|
14348
|
-
return metadata;
|
|
14349
|
-
}
|
|
14350
|
-
function normalizeVideos(value) {
|
|
14351
|
-
if (!Array.isArray(value)) return [];
|
|
14352
|
-
return value.flatMap((candidate) => {
|
|
14353
|
-
if (!candidate || typeof candidate !== "object" || Array.isArray(candidate)) return [];
|
|
14354
|
-
const video = candidate;
|
|
14355
|
-
const match = typeof video.ref === "string" ? CARD_REFERENCE.exec(video.ref) : null;
|
|
14356
|
-
if (!match || match[1] !== "video") return [];
|
|
14357
|
-
const id = match[2];
|
|
14358
|
-
const title = _nullishCoalesce(optionalString(video.title), () => ( id));
|
|
14359
|
-
const url = _nullishCoalesce(httpsUrl(video.url), () => ( null));
|
|
14360
|
-
const sourceRepo = optionalString(video.sourceRepo);
|
|
14361
|
-
const metadata = normalizeVideoMetadata(video.metadata);
|
|
14362
|
-
if (url) {
|
|
14363
|
-
const idFromUrl = youtubeId(url);
|
|
14364
|
-
if (idFromUrl) {
|
|
14365
|
-
metadata.youtubeUrl = idFromUrl;
|
|
14366
|
-
delete metadata.videoUrl;
|
|
14367
|
-
} else {
|
|
14368
|
-
metadata.videoUrl = url;
|
|
14369
|
-
delete metadata.youtubeUrl;
|
|
14370
|
-
}
|
|
14371
|
-
}
|
|
14372
|
-
return [
|
|
14373
|
-
{
|
|
14374
|
-
type: "video",
|
|
14375
|
-
id,
|
|
14376
|
-
title,
|
|
14377
|
-
url,
|
|
14378
|
-
...sourceRepo ? { sourceRepo } : {},
|
|
14379
|
-
...Object.keys(metadata).length > 0 ? { metadata } : {}
|
|
14380
|
-
}
|
|
14381
|
-
];
|
|
14382
|
-
});
|
|
14383
|
-
}
|
|
14384
|
-
function normalizeCards(value, sources) {
|
|
14385
|
-
if (!Array.isArray(value)) return [];
|
|
14386
|
-
return value.flatMap((candidate) => {
|
|
14387
|
-
if (!candidate || typeof candidate !== "object" || Array.isArray(candidate)) return [];
|
|
14388
|
-
const card = candidate;
|
|
14389
|
-
const match = typeof card.ref === "string" ? CARD_REFERENCE.exec(card.ref) : null;
|
|
14390
|
-
if (!match || match[1] === "video") return [];
|
|
14391
|
-
const type = requiredString(card.entityType);
|
|
14392
|
-
const id = requiredString(card.entityId);
|
|
14393
|
-
if (!type || !id || type !== match[1] || id !== match[2]) return [];
|
|
14394
|
-
const source = sources.find((item) => item.id === id && item.documentType === type);
|
|
14395
|
-
const ref = {
|
|
14396
|
-
type,
|
|
14397
|
-
id,
|
|
14398
|
-
title: _nullishCoalesce(_optionalChain([source, 'optionalAccess', _356 => _356.name]), () => ( id)),
|
|
14399
|
-
url: _nullishCoalesce(_optionalChain([source, 'optionalAccess', _357 => _357.externalUrl]), () => ( null)),
|
|
14400
|
-
..._optionalChain([source, 'optionalAccess', _358 => _358.sourceRepo]) ? { sourceRepo: source.sourceRepo } : {},
|
|
14401
|
-
..._optionalChain([source, 'optionalAccess', _359 => _359.targetPlatform]) !== void 0 ? { targetPlatform: source.targetPlatform } : {},
|
|
14402
|
-
..._optionalChain([source, 'optionalAccess', _360 => _360.path]) ? { metadata: { path: source.path, [SOURCE_METADATA_MATCHED]: true } } : {}
|
|
14403
|
-
};
|
|
14404
|
-
return [ref];
|
|
14405
|
-
});
|
|
14406
|
-
}
|
|
14407
|
-
function sourceMetadataEvent(payload) {
|
|
14408
|
-
if (!payload || typeof payload !== "object" || Array.isArray(payload)) return null;
|
|
14409
|
-
const metadata = payload;
|
|
14410
|
-
const sources = normalizeSources(metadata.sources);
|
|
14411
|
-
const refs = [...normalizeVideos(metadata.videos), ...normalizeCards(metadata.cards, sources)];
|
|
14412
|
-
const refsByIdentity = /* @__PURE__ */ new Map();
|
|
14413
|
-
refs.forEach((ref) => {
|
|
14414
|
-
const identity = `${ref.type}:${ref.id}`;
|
|
14415
|
-
if (!refsByIdentity.has(identity)) refsByIdentity.set(identity, ref);
|
|
14416
|
-
});
|
|
14417
|
-
const uniqueRefs = Array.from(refsByIdentity.values());
|
|
14418
|
-
if (sources.length === 0 && uniqueRefs.length === 0) return null;
|
|
14419
|
-
return { type: "sources", sources, ...uniqueRefs.length > 0 ? { refs: uniqueRefs } : {} };
|
|
14420
|
-
}
|
|
14421
|
-
|
|
14422
14223
|
// src/utils/faq-anchor.ts
|
|
14423
14224
|
function faqSectionSlug(section) {
|
|
14424
14225
|
return "faq-" + section.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
@@ -14625,7 +14426,7 @@ function pickFetchedCardHref({
|
|
|
14625
14426
|
itemHref,
|
|
14626
14427
|
allowComposed
|
|
14627
14428
|
}) {
|
|
14628
|
-
if (_optionalChain([composed, 'optionalAccess',
|
|
14429
|
+
if (_optionalChain([composed, 'optionalAccess', _346 => _346.hostOverride])) {
|
|
14629
14430
|
return { source: "hostOverride", href: composed.href, targetPlatform: composed.targetPlatform };
|
|
14630
14431
|
}
|
|
14631
14432
|
if (itemHref) return { source: "item", href: itemHref };
|
|
@@ -14820,7 +14621,7 @@ function resolveSourceRowCTA(row, ctx = {}) {
|
|
|
14820
14621
|
if (row.path && shouldFallbackToPathNav(row) && !row.externalUrl) {
|
|
14821
14622
|
const safePath = sanitizePath(row.path);
|
|
14822
14623
|
if (safePath) {
|
|
14823
|
-
const docTarget = row.documentType ? _optionalChain([ctx, 'access',
|
|
14624
|
+
const docTarget = row.documentType ? _optionalChain([ctx, 'access', _347 => _347.docPlatformTargets, 'optionalAccess', _348 => _348[row.documentType]]) : void 0;
|
|
14824
14625
|
if (docTarget) {
|
|
14825
14626
|
const seg = docTarget.basePath.split("/").filter(Boolean).join("/");
|
|
14826
14627
|
const base = `${_chunkPRPZBXWZcjs.getBaseUrl.call(void 0, docTarget.platform)}${seg ? `/${seg}` : ""}/`;
|
|
@@ -14963,8 +14764,8 @@ function cardMenuGroups(href, discuss, openDetails, externalLink) {
|
|
|
14963
14764
|
if (href) {
|
|
14964
14765
|
items.push({
|
|
14965
14766
|
id: "open-details",
|
|
14966
|
-
label: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess',
|
|
14967
|
-
icon: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess',
|
|
14767
|
+
label: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess', _349 => _349.label]), () => ( "Open Details")),
|
|
14768
|
+
icon: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess', _350 => _350.icon]), () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.EyeIcon, { size: 20 }))),
|
|
14968
14769
|
// Main row → open the entity (same tab, soft Link nav).
|
|
14969
14770
|
href,
|
|
14970
14771
|
// Trailing 40px ↗ side-button → open in a new tab.
|
|
@@ -14998,14 +14799,6 @@ function hubspotStatusToVariant(status) {
|
|
|
14998
14799
|
if (s === "OPEN") return "warning";
|
|
14999
14800
|
return "grey";
|
|
15000
14801
|
}
|
|
15001
|
-
function validatedHttpsUrl(value) {
|
|
15002
|
-
if (typeof value !== "string") return null;
|
|
15003
|
-
try {
|
|
15004
|
-
return new URL(value).protocol === "https:" ? value : null;
|
|
15005
|
-
} catch (e46) {
|
|
15006
|
-
return null;
|
|
15007
|
-
}
|
|
15008
|
-
}
|
|
15009
14802
|
function decodeVideoMarkerId(id) {
|
|
15010
14803
|
const mux = id.match(/^mux-([A-Za-z0-9_-]+)$/);
|
|
15011
14804
|
if (mux) {
|
|
@@ -15018,52 +14811,32 @@ function decodeVideoMarkerId(id) {
|
|
|
15018
14811
|
try {
|
|
15019
14812
|
const b64 = mp4[1].replace(/-/g, "+").replace(/_/g, "/");
|
|
15020
14813
|
const url = atob(b64);
|
|
15021
|
-
|
|
15022
|
-
return
|
|
15023
|
-
} catch (
|
|
14814
|
+
if (!/^https:\/\//.test(url)) return null;
|
|
14815
|
+
return { videoUrl: url };
|
|
14816
|
+
} catch (e45) {
|
|
15024
14817
|
return null;
|
|
15025
14818
|
}
|
|
15026
14819
|
}
|
|
15027
14820
|
if (/^[A-Za-z0-9_-]{11}$/.test(id)) return { youtubeUrl: id };
|
|
15028
14821
|
return null;
|
|
15029
14822
|
}
|
|
15030
|
-
function validatedVideoMetadata(chatRef) {
|
|
15031
|
-
const input = _nullishCoalesce(chatRef.metadata, () => ( {}));
|
|
15032
|
-
const metadata = {};
|
|
15033
|
-
for (const key of ["videoUrl", "highlightVideoUrl", "videoPoster", "highlightVideoPoster"]) {
|
|
15034
|
-
const url = validatedHttpsUrl(input[key]);
|
|
15035
|
-
if (url) metadata[key] = url;
|
|
15036
|
-
}
|
|
15037
|
-
const youtubeUrl = input.youtubeUrl;
|
|
15038
|
-
if (typeof youtubeUrl === "string" && /^[A-Za-z0-9_-]{11}$/.test(youtubeUrl)) {
|
|
15039
|
-
metadata.youtubeUrl = youtubeUrl;
|
|
15040
|
-
}
|
|
15041
|
-
const safeUrl = validatedHttpsUrl(chatRef.url);
|
|
15042
|
-
if (safeUrl) {
|
|
15043
|
-
const youtubeId2 = extractYouTubeId(safeUrl);
|
|
15044
|
-
delete metadata.videoUrl;
|
|
15045
|
-
delete metadata.youtubeUrl;
|
|
15046
|
-
metadata[youtubeId2 ? "youtubeUrl" : "videoUrl"] = _nullishCoalesce(youtubeId2, () => ( safeUrl));
|
|
15047
|
-
}
|
|
15048
|
-
return Object.keys(metadata).length > 0 ? metadata : null;
|
|
15049
|
-
}
|
|
15050
14823
|
function itemVideoMetadata(item) {
|
|
15051
14824
|
const pick = (...vals) => {
|
|
15052
14825
|
for (const v of vals) if (typeof v === "string" && v.length > 0) return v;
|
|
15053
14826
|
return void 0;
|
|
15054
14827
|
};
|
|
15055
|
-
const m = _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
14828
|
+
const m = _nullishCoalesce(_optionalChain([item, 'optionalAccess', _351 => _351.metadata]), () => ( {}));
|
|
15056
14829
|
const out = {};
|
|
15057
|
-
const videoUrl = pick(m.videoUrl, _optionalChain([item, 'optionalAccess',
|
|
15058
|
-
const youtubeUrl = pick(m.youtubeUrl, _optionalChain([item, 'optionalAccess',
|
|
15059
|
-
const highlightVideoUrl = pick(m.highlightVideoUrl, _optionalChain([item, 'optionalAccess',
|
|
14830
|
+
const videoUrl = pick(m.videoUrl, _optionalChain([item, 'optionalAccess', _352 => _352.custom_video_url]), _optionalChain([item, 'optionalAccess', _353 => _353.main_video_url]));
|
|
14831
|
+
const youtubeUrl = pick(m.youtubeUrl, _optionalChain([item, 'optionalAccess', _354 => _354.youtube_url]), _optionalChain([item, 'optionalAccess', _355 => _355.testimonial_video_url]));
|
|
14832
|
+
const highlightVideoUrl = pick(m.highlightVideoUrl, _optionalChain([item, 'optionalAccess', _356 => _356.highlight_video_url]));
|
|
15060
14833
|
const videoPoster = pick(
|
|
15061
14834
|
m.videoPoster,
|
|
15062
|
-
_optionalChain([item, 'optionalAccess',
|
|
15063
|
-
_optionalChain([item, 'optionalAccess',
|
|
15064
|
-
_optionalChain([item, 'optionalAccess',
|
|
14835
|
+
_optionalChain([item, 'optionalAccess', _357 => _357.main_video_thumbnail]),
|
|
14836
|
+
_optionalChain([item, 'optionalAccess', _358 => _358.highlight_video_thumbnail]),
|
|
14837
|
+
_optionalChain([item, 'optionalAccess', _359 => _359.featured_image])
|
|
15065
14838
|
);
|
|
15066
|
-
const highlightVideoPoster = pick(m.highlightVideoPoster, _optionalChain([item, 'optionalAccess',
|
|
14839
|
+
const highlightVideoPoster = pick(m.highlightVideoPoster, _optionalChain([item, 'optionalAccess', _360 => _360.highlight_video_thumbnail]));
|
|
15067
14840
|
if (videoUrl) out.videoUrl = videoUrl;
|
|
15068
14841
|
if (youtubeUrl) out.youtubeUrl = youtubeUrl;
|
|
15069
14842
|
if (highlightVideoUrl) out.highlightVideoUrl = highlightVideoUrl;
|
|
@@ -15093,15 +14866,15 @@ function fetchedItemDisplayRef(item, chatRef) {
|
|
|
15093
14866
|
}
|
|
15094
14867
|
function fetchedFaqDisplayRef(item, chatRef) {
|
|
15095
14868
|
const it = item;
|
|
15096
|
-
const answer = typeof _optionalChain([it, 'optionalAccess',
|
|
14869
|
+
const answer = typeof _optionalChain([it, 'optionalAccess', _361 => _361.answer]) === "string" && it.answer.trim().length > 0 ? it.answer.trim() : null;
|
|
15097
14870
|
return {
|
|
15098
14871
|
type: "faq",
|
|
15099
14872
|
id: chatRef.id,
|
|
15100
14873
|
sourceRepo: chatRef.sourceRepo,
|
|
15101
|
-
title: typeof _optionalChain([it, 'optionalAccess',
|
|
14874
|
+
title: typeof _optionalChain([it, 'optionalAccess', _362 => _362.question]) === "string" && it.question ? it.question : chatRef.id,
|
|
15102
14875
|
url: _nullishCoalesce(chatRef.url, () => ( null)),
|
|
15103
14876
|
...answer ? { preview: answer.length > 400 ? `${answer.slice(0, 397)}\u2026` : answer } : {},
|
|
15104
|
-
metadata: typeof _optionalChain([it, 'optionalAccess',
|
|
14877
|
+
metadata: typeof _optionalChain([it, 'optionalAccess', _363 => _363.section]) === "string" && it.section ? { section: it.section } : {}
|
|
15105
14878
|
};
|
|
15106
14879
|
}
|
|
15107
14880
|
function HubspotTicketChatCard({
|
|
@@ -15109,8 +14882,8 @@ function HubspotTicketChatCard({
|
|
|
15109
14882
|
isNewTab,
|
|
15110
14883
|
discuss
|
|
15111
14884
|
}) {
|
|
15112
|
-
const status = typeof _optionalChain([chatRef, 'access',
|
|
15113
|
-
const statusLabel = typeof _optionalChain([chatRef, 'access',
|
|
14885
|
+
const status = typeof _optionalChain([chatRef, 'access', _364 => _364.metadata, 'optionalAccess', _365 => _365.status]) === "string" ? chatRef.metadata.status : void 0;
|
|
14886
|
+
const statusLabel = typeof _optionalChain([chatRef, 'access', _366 => _366.metadata, 'optionalAccess', _367 => _367.statusLabel]) === "string" ? chatRef.metadata.statusLabel : void 0;
|
|
15114
14887
|
const statusText = _nullishCoalesce(statusLabel, () => ( formatStatusToken(status)));
|
|
15115
14888
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15116
14889
|
MingoInfoCard,
|
|
@@ -15133,7 +14906,7 @@ function FaqChatCard({
|
|
|
15133
14906
|
isNewTab,
|
|
15134
14907
|
discuss
|
|
15135
14908
|
}) {
|
|
15136
|
-
const section = typeof _optionalChain([chatRef, 'access',
|
|
14909
|
+
const section = typeof _optionalChain([chatRef, 'access', _368 => _368.metadata, 'optionalAccess', _369 => _369.section]) === "string" ? chatRef.metadata.section.trim() : void 0;
|
|
15137
14910
|
const statusLabel = section && section.length > 0 ? section : "FAQ";
|
|
15138
14911
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15139
14912
|
MingoInfoCard,
|
|
@@ -15153,7 +14926,7 @@ function SlackChatCard({
|
|
|
15153
14926
|
isNewTab,
|
|
15154
14927
|
discuss
|
|
15155
14928
|
}) {
|
|
15156
|
-
const channelName = typeof _optionalChain([chatRef, 'access',
|
|
14929
|
+
const channelName = typeof _optionalChain([chatRef, 'access', _370 => _370.metadata, 'optionalAccess', _371 => _371.channelName]) === "string" ? chatRef.metadata.channelName.trim() : void 0;
|
|
15157
14930
|
const channelPretty = channelName ? channelName.startsWith("#") ? channelName : `#${channelName}` : void 0;
|
|
15158
14931
|
const title = channelPretty ? `${chatRef.title} \xB7 ${channelPretty}` : chatRef.title;
|
|
15159
14932
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -15193,7 +14966,7 @@ function GenericFinancialChatCard({
|
|
|
15193
14966
|
isNewTab,
|
|
15194
14967
|
discuss
|
|
15195
14968
|
}) {
|
|
15196
|
-
const subtitle = typeof _optionalChain([chatRef, 'access',
|
|
14969
|
+
const subtitle = typeof _optionalChain([chatRef, 'access', _372 => _372.metadata, 'optionalAccess', _373 => _373.subtitle]) === "string" ? chatRef.metadata.subtitle : void 0;
|
|
15197
14970
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15198
14971
|
MingoInfoCard,
|
|
15199
14972
|
{
|
|
@@ -15262,12 +15035,12 @@ function ProductReleaseChatCard({
|
|
|
15262
15035
|
discuss
|
|
15263
15036
|
}) {
|
|
15264
15037
|
const releaseProps = buildProps(item);
|
|
15265
|
-
const status = _optionalChain([item, 'optionalAccess',
|
|
15038
|
+
const status = _optionalChain([item, 'optionalAccess', _374 => _374.version]) ? { label: String(item.version), variant: "grey" } : { label: "Release", variant: "grey" };
|
|
15266
15039
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15267
15040
|
EntityMingoCard,
|
|
15268
15041
|
{
|
|
15269
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15270
|
-
description: _optionalChain([item, 'optionalAccess',
|
|
15042
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _375 => _375.title]), () => ( "")),
|
|
15043
|
+
description: _optionalChain([item, 'optionalAccess', _376 => _376.summary]) || releaseProps.formattedDate || void 0,
|
|
15271
15044
|
cover: releaseProps.coverImage || void 0,
|
|
15272
15045
|
fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.Rocket02Icon, { size: 24 }),
|
|
15273
15046
|
status,
|
|
@@ -15284,17 +15057,17 @@ function CampaignChatCard({
|
|
|
15284
15057
|
isNewTab,
|
|
15285
15058
|
discuss
|
|
15286
15059
|
}) {
|
|
15287
|
-
const goalsCount = Array.isArray(_optionalChain([item, 'optionalAccess',
|
|
15060
|
+
const goalsCount = Array.isArray(_optionalChain([item, 'optionalAccess', _377 => _377.goals])) ? item.goals.length : 0;
|
|
15288
15061
|
const meta = [
|
|
15289
|
-
_optionalChain([item, 'optionalAccess',
|
|
15062
|
+
_optionalChain([item, 'optionalAccess', _378 => _378.start_date]) ? _chunkNNFQLTJ3cjs.formatDateShort.call(void 0, item.start_date) : null,
|
|
15290
15063
|
goalsCount > 0 ? `${goalsCount} goal${goalsCount !== 1 ? "s" : ""}` : null,
|
|
15291
15064
|
"Marketing campaign"
|
|
15292
15065
|
].filter(Boolean).join(" \xB7 ");
|
|
15293
15066
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15294
15067
|
EntityMingoCard,
|
|
15295
15068
|
{
|
|
15296
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15297
|
-
description: meta || _optionalChain([item, 'optionalAccess',
|
|
15069
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _379 => _379.name]), () => ( "")),
|
|
15070
|
+
description: meta || _optionalChain([item, 'optionalAccess', _380 => _380.description]) || void 0,
|
|
15298
15071
|
fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.Megaphone01Icon, { size: 24 }),
|
|
15299
15072
|
chatRef,
|
|
15300
15073
|
isNewTab,
|
|
@@ -15349,14 +15122,14 @@ function BlogChatCard({
|
|
|
15349
15122
|
hasEmbeddedVideo,
|
|
15350
15123
|
discuss
|
|
15351
15124
|
}) {
|
|
15352
|
-
const category = Array.isArray(_optionalChain([item, 'optionalAccess',
|
|
15125
|
+
const category = Array.isArray(_optionalChain([item, 'optionalAccess', _381 => _381.categories])) ? _nullishCoalesce(_optionalChain([item, 'access', _382 => _382.categories, 'access', _383 => _383.find, 'call', _384 => _384((c) => _optionalChain([c, 'optionalAccess', _385 => _385.name])), 'optionalAccess', _386 => _386.name]), () => ( void 0)) : void 0;
|
|
15353
15126
|
const status = hasEmbeddedVideo ? { label: "Video", variant: "primary" } : category ? { label: category, variant: "grey" } : void 0;
|
|
15354
15127
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15355
15128
|
EntityMingoCard,
|
|
15356
15129
|
{
|
|
15357
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15358
|
-
description: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15359
|
-
cover: entityCover(_optionalChain([item, 'optionalAccess',
|
|
15130
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _387 => _387.title]), () => ( "")),
|
|
15131
|
+
description: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _388 => _388.summary]), () => ( void 0)),
|
|
15132
|
+
cover: entityCover(_optionalChain([item, 'optionalAccess', _389 => _389.featured_image]), ogPlaceholder),
|
|
15360
15133
|
fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.NewspaperIcon, { size: 24 }),
|
|
15361
15134
|
status,
|
|
15362
15135
|
chatRef,
|
|
@@ -15373,13 +15146,13 @@ function CaseStudyChatCard({
|
|
|
15373
15146
|
ogPlaceholder,
|
|
15374
15147
|
discuss
|
|
15375
15148
|
}) {
|
|
15376
|
-
const meta = [_optionalChain([item, 'optionalAccess',
|
|
15149
|
+
const meta = [_optionalChain([item, 'optionalAccess', _390 => _390.msp, 'optionalAccess', _391 => _391.name]), _optionalChain([item, 'optionalAccess', _392 => _392.user, 'optionalAccess', _393 => _393.full_name])].filter(Boolean).join(" \xB7 ");
|
|
15377
15150
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15378
15151
|
EntityMingoCard,
|
|
15379
15152
|
{
|
|
15380
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15381
|
-
description: _optionalChain([item, 'optionalAccess',
|
|
15382
|
-
cover: entityCover(_optionalChain([item, 'optionalAccess',
|
|
15153
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _394 => _394.title]), () => ( "")),
|
|
15154
|
+
description: _optionalChain([item, 'optionalAccess', _395 => _395.summary]) || meta || void 0,
|
|
15155
|
+
cover: entityCover(_optionalChain([item, 'optionalAccess', _396 => _396.featured_image]), ogPlaceholder),
|
|
15383
15156
|
fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.TrophyIcon, { size: 24 }),
|
|
15384
15157
|
status: { label: "Case study", variant: "grey" },
|
|
15385
15158
|
chatRef,
|
|
@@ -15396,13 +15169,13 @@ function CustomerInterviewChatCard({
|
|
|
15396
15169
|
ogPlaceholder,
|
|
15397
15170
|
discuss
|
|
15398
15171
|
}) {
|
|
15399
|
-
const meta = [_optionalChain([item, 'optionalAccess',
|
|
15172
|
+
const meta = [_optionalChain([item, 'optionalAccess', _397 => _397.user, 'optionalAccess', _398 => _398.full_name]), _optionalChain([item, 'optionalAccess', _399 => _399.msp, 'optionalAccess', _400 => _400.name])].filter(Boolean).join(" \xB7 ");
|
|
15400
15173
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15401
15174
|
EntityMingoCard,
|
|
15402
15175
|
{
|
|
15403
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15404
|
-
description: _optionalChain([item, 'optionalAccess',
|
|
15405
|
-
cover: entityCover(_optionalChain([item, 'optionalAccess',
|
|
15176
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _401 => _401.title]), () => ( "")),
|
|
15177
|
+
description: _optionalChain([item, 'optionalAccess', _402 => _402.video_summary]) || meta || void 0,
|
|
15178
|
+
cover: entityCover(_optionalChain([item, 'optionalAccess', _403 => _403.featured_image]), ogPlaceholder),
|
|
15406
15179
|
fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.MicrophoneIcon, { size: 24 }),
|
|
15407
15180
|
status: { label: "Interview", variant: "grey" },
|
|
15408
15181
|
chatRef,
|
|
@@ -15419,13 +15192,13 @@ function InvestorUpdateChatCard({
|
|
|
15419
15192
|
ogPlaceholder,
|
|
15420
15193
|
discuss
|
|
15421
15194
|
}) {
|
|
15422
|
-
const title = _optionalChain([item, 'optionalAccess',
|
|
15195
|
+
const title = _optionalChain([item, 'optionalAccess', _404 => _404.title]) || `Update #${_nullishCoalesce(_optionalChain([item, 'optionalAccess', _405 => _405.update_number]), () => ( "?"))}`;
|
|
15423
15196
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15424
15197
|
EntityMingoCard,
|
|
15425
15198
|
{
|
|
15426
15199
|
title,
|
|
15427
|
-
description: _optionalChain([item, 'optionalAccess',
|
|
15428
|
-
cover: entityCover(_optionalChain([item, 'optionalAccess',
|
|
15200
|
+
description: _optionalChain([item, 'optionalAccess', _406 => _406.strategic_update]) || _optionalChain([item, 'optionalAccess', _407 => _407.content]) || _chunkNNFQLTJ3cjs.formatInvestorUpdatePeriod.call(void 0, _nullishCoalesce(_optionalChain([item, 'optionalAccess', _408 => _408.period_start]), () => ( null)), _nullishCoalesce(_optionalChain([item, 'optionalAccess', _409 => _409.period_end]), () => ( null))) || void 0,
|
|
15201
|
+
cover: entityCover(_optionalChain([item, 'optionalAccess', _410 => _410.featured_image]), ogPlaceholder),
|
|
15429
15202
|
fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.PresentationLineIcon, { size: 24 }),
|
|
15430
15203
|
status: { label: "Investor update", variant: "grey" },
|
|
15431
15204
|
chatRef,
|
|
@@ -15442,12 +15215,12 @@ function OnboardingGuideChatCard({
|
|
|
15442
15215
|
ogPlaceholder,
|
|
15443
15216
|
discuss
|
|
15444
15217
|
}) {
|
|
15445
|
-
const cover = _nullishCoalesce(_nullishCoalesce(entityCover(_optionalChain([item, 'optionalAccess',
|
|
15218
|
+
const cover = _nullishCoalesce(_nullishCoalesce(entityCover(_optionalChain([item, 'optionalAccess', _411 => _411.featured_image])), () => ( entityCover(_optionalChain([item, 'optionalAccess', _412 => _412.main_video_thumbnail])))), () => ( entityCover(_optionalChain([item, 'optionalAccess', _413 => _413.og_image_url]), ogPlaceholder)));
|
|
15446
15219
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15447
15220
|
EntityMingoCard,
|
|
15448
15221
|
{
|
|
15449
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15450
|
-
description: _nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15222
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _414 => _414.title]), () => ( "")),
|
|
15223
|
+
description: _nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _415 => _415.summary]), () => ( _optionalChain([item, 'optionalAccess', _416 => _416.description]))), () => ( void 0)),
|
|
15451
15224
|
cover,
|
|
15452
15225
|
fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.CompassIcon, { size: 24 }),
|
|
15453
15226
|
status: { label: "Guide", variant: "grey" },
|
|
@@ -15468,25 +15241,25 @@ function ProgramChatCard({
|
|
|
15468
15241
|
discuss
|
|
15469
15242
|
}) {
|
|
15470
15243
|
const icon = configKey === "webinar" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.PresentationBarIcon, { size: 24 }) : configKey === "event" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.CalendarIcon, { size: 24 }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.MicrophoneIcon, { size: 24 });
|
|
15471
|
-
const isScheduled = _optionalChain([item, 'optionalAccess',
|
|
15244
|
+
const isScheduled = _optionalChain([item, 'optionalAccess', _417 => _417.status]) === "scheduled";
|
|
15472
15245
|
let typeMeta;
|
|
15473
|
-
if (configKey === "podcast" && typeof _optionalChain([item, 'optionalAccess',
|
|
15246
|
+
if (configKey === "podcast" && typeof _optionalChain([item, 'optionalAccess', _418 => _418.duration_seconds]) === "number" && item.duration_seconds > 0 && !isScheduled) {
|
|
15474
15247
|
typeMeta = _chunkNNFQLTJ3cjs.formatDurationCompact.call(void 0, item.duration_seconds);
|
|
15475
|
-
} else if (configKey === "event" && typeof _optionalChain([item, 'optionalAccess',
|
|
15248
|
+
} else if (configKey === "event" && typeof _optionalChain([item, 'optionalAccess', _419 => _419.location_name]) === "string" && item.location_name.trim().length > 0) {
|
|
15476
15249
|
typeMeta = item.location_name;
|
|
15477
|
-
} else if (configKey === "webinar" && _optionalChain([item, 'optionalAccess',
|
|
15250
|
+
} else if (configKey === "webinar" && _optionalChain([item, 'optionalAccess', _420 => _420.start_at])) {
|
|
15478
15251
|
const time = _chunkNNFQLTJ3cjs.formatTimeWithTimezone.call(void 0, item.start_at, _nullishCoalesce(item.timezone, () => ( null)));
|
|
15479
15252
|
const dur = _chunkNNFQLTJ3cjs.formatDurationFromRange.call(void 0, item.start_at, item.end_at);
|
|
15480
15253
|
typeMeta = dur ? `${time} \xB7 ${dur}` : time;
|
|
15481
15254
|
}
|
|
15482
|
-
const itemDate = _chunkNNFQLTJ3cjs.formatDateUTC.call(void 0, _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15255
|
+
const itemDate = _chunkNNFQLTJ3cjs.formatDateUTC.call(void 0, _nullishCoalesce(_optionalChain([item, 'optionalAccess', _421 => _421.date]), () => ( null)), { fallback: "", timezone: "local" });
|
|
15483
15256
|
const meta = [itemDate, typeMeta].filter(Boolean).join(" \xB7 ");
|
|
15484
15257
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15485
15258
|
EntityMingoCard,
|
|
15486
15259
|
{
|
|
15487
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15488
|
-
description: meta || _optionalChain([item, 'optionalAccess',
|
|
15489
|
-
cover: entityCover(_optionalChain([item, 'optionalAccess',
|
|
15260
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _422 => _422.title]), () => ( "")),
|
|
15261
|
+
description: meta || _optionalChain([item, 'optionalAccess', _423 => _423.description]) || void 0,
|
|
15262
|
+
cover: entityCover(_optionalChain([item, 'optionalAccess', _424 => _424.cover_url]), ogPlaceholder),
|
|
15490
15263
|
fallbackIcon: icon,
|
|
15491
15264
|
status: { label, variant: "grey" },
|
|
15492
15265
|
chatRef,
|
|
@@ -15503,10 +15276,10 @@ function RoadmapChatCard({
|
|
|
15503
15276
|
cardType,
|
|
15504
15277
|
discuss
|
|
15505
15278
|
}) {
|
|
15506
|
-
const logoUrl = typeof _optionalChain([item, 'optionalAccess',
|
|
15507
|
-
const useTypeIcon = cardType === "internal_task" || !logoUrl && _optionalChain([item, 'optionalAccess',
|
|
15279
|
+
const logoUrl = typeof _optionalChain([item, 'optionalAccess', _425 => _425.icon]) === "string" && item.icon.startsWith("http") ? item.icon : void 0;
|
|
15280
|
+
const useTypeIcon = cardType === "internal_task" || !logoUrl && _optionalChain([item, 'optionalAccess', _426 => _426.customItemId]) != null;
|
|
15508
15281
|
const defaultIcon = cardType === "delivery_item" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.TruckFastIcon, { size: 24 }) : cardType === "internal_task" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.CheckSquareIcon, { size: 24 }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.MapIcon, { size: 24 });
|
|
15509
|
-
const icon = useTypeIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNNFQLTJ3cjs.TaskTypeIcon, { customItemId: _optionalChain([item, 'optionalAccess',
|
|
15282
|
+
const icon = useTypeIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNNFQLTJ3cjs.TaskTypeIcon, { customItemId: _optionalChain([item, 'optionalAccess', _427 => _427.customItemId]), className: "size-6" }) : logoUrl ? (
|
|
15510
15283
|
// Contained (not full-bleed) so the integration logo keeps its aspect
|
|
15511
15284
|
// ratio inside the bordered icon box — matches RoadmapCard.
|
|
15512
15285
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWLSFBRT5cjs.next_image_default, { src: logoUrl, alt: "", className: "size-6 object-contain", width: 24, height: 24, unoptimized: true })
|
|
@@ -15517,10 +15290,10 @@ function RoadmapChatCard({
|
|
|
15517
15290
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15518
15291
|
EntityMingoCard,
|
|
15519
15292
|
{
|
|
15520
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15521
|
-
description: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15293
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _428 => _428.title]), () => ( "")),
|
|
15294
|
+
description: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _429 => _429.description]), () => ( void 0)),
|
|
15522
15295
|
fallbackIcon: icon,
|
|
15523
|
-
status: statusPill(_optionalChain([item, 'optionalAccess',
|
|
15296
|
+
status: statusPill(_optionalChain([item, 'optionalAccess', _430 => _430.status])),
|
|
15524
15297
|
chatRef,
|
|
15525
15298
|
isNewTab,
|
|
15526
15299
|
discuss,
|
|
@@ -15530,27 +15303,15 @@ function RoadmapChatCard({
|
|
|
15530
15303
|
}
|
|
15531
15304
|
);
|
|
15532
15305
|
}
|
|
15533
|
-
function refHydratedEntry(docType, label, renderRef
|
|
15306
|
+
function refHydratedEntry(docType, label, renderRef) {
|
|
15534
15307
|
return {
|
|
15535
15308
|
label,
|
|
15536
15309
|
bareInline: true,
|
|
15537
15310
|
contentRefType: docType,
|
|
15538
15311
|
noComposedHref: true,
|
|
15539
|
-
fallbackHref: (item) => _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15312
|
+
fallbackHref: (item) => _nullishCoalesce(_optionalChain([item, 'optionalAccess', _431 => _431.url]), () => ( null)),
|
|
15540
15313
|
skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MingoInfoCardSkeleton, {}),
|
|
15541
|
-
render: (item, chatRef, opts) => renderRef(fetchedItemDisplayRef(item, chatRef), opts)
|
|
15542
|
-
renderFromSourceMetadata
|
|
15543
|
-
};
|
|
15544
|
-
}
|
|
15545
|
-
function sourceMetadataCardItem(chatRef) {
|
|
15546
|
-
return {
|
|
15547
|
-
type: chatRef.type,
|
|
15548
|
-
id: chatRef.id,
|
|
15549
|
-
title: chatRef.title,
|
|
15550
|
-
url: chatRef.url,
|
|
15551
|
-
targetPlatform: chatRef.targetPlatform,
|
|
15552
|
-
sourceRepo: chatRef.sourceRepo,
|
|
15553
|
-
metadata: chatRef.metadata
|
|
15314
|
+
render: (item, chatRef, opts) => renderRef(fetchedItemDisplayRef(item, chatRef), opts)
|
|
15554
15315
|
};
|
|
15555
15316
|
}
|
|
15556
15317
|
var FINANCIAL_CARD_CONFIGS = {
|
|
@@ -15613,7 +15374,7 @@ function programRegistryEntries() {
|
|
|
15613
15374
|
discuss: opts.discuss,
|
|
15614
15375
|
configKey: cfg.configKey,
|
|
15615
15376
|
label: cfg.configKey.charAt(0).toUpperCase() + cfg.configKey.slice(1),
|
|
15616
|
-
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
15377
|
+
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _432 => _432.extras, 'optionalAccess', _433 => _433.buildOgPlaceholderUrl, 'optionalCall', _434 => _434(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _435 => _435.title]), () => ( "")))]), () => ( null))
|
|
15617
15378
|
}
|
|
15618
15379
|
)
|
|
15619
15380
|
}));
|
|
@@ -15634,7 +15395,7 @@ var ROADMAP_CARD_CONFIGS = {
|
|
|
15634
15395
|
// The card's destination IS the ClickUp deep link, derived from the
|
|
15635
15396
|
// task id post-fetch (the refs frame used to carry it).
|
|
15636
15397
|
noComposedHref: true,
|
|
15637
|
-
fallbackHref: (item) => _optionalChain([item, 'optionalAccess',
|
|
15398
|
+
fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _436 => _436.id]) != null ? clickupTaskUrl(String(item.id)) : null
|
|
15638
15399
|
}
|
|
15639
15400
|
};
|
|
15640
15401
|
function roadmapRegistryEntries() {
|
|
@@ -15676,8 +15437,8 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15676
15437
|
DeletedDataCard,
|
|
15677
15438
|
{
|
|
15678
15439
|
title: chatRef.title && chatRef.title !== chatRef.id ? chatRef.title : null,
|
|
15679
|
-
entityLabel: _nullishCoalesce(_optionalChain([chatRef, 'access',
|
|
15680
|
-
recoveryNote: _nullishCoalesce(_optionalChain([chatRef, 'access',
|
|
15440
|
+
entityLabel: _nullishCoalesce(_optionalChain([chatRef, 'access', _437 => _437.metadata, 'optionalAccess', _438 => _438.entity_label]), () => ( null)),
|
|
15441
|
+
recoveryNote: _nullishCoalesce(_optionalChain([chatRef, 'access', _439 => _439.metadata, 'optionalAccess', _440 => _440.recovery_note]), () => ( null))
|
|
15681
15442
|
}
|
|
15682
15443
|
)
|
|
15683
15444
|
},
|
|
@@ -15691,7 +15452,7 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15691
15452
|
bareInline: true,
|
|
15692
15453
|
contentRefType: "faq",
|
|
15693
15454
|
noComposedHref: true,
|
|
15694
|
-
fallbackHref: (item) => _optionalChain([item, 'optionalAccess',
|
|
15455
|
+
fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _441 => _441.id]) != null ? `/faqs#${faqItemAnchor(item.id)}` : null,
|
|
15695
15456
|
skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MingoInfoCardSkeleton, {}),
|
|
15696
15457
|
render: (item, chatRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FaqChatCard, { chatRef: fetchedFaqDisplayRef(item, chatRef), isNewTab: opts.isNewTab, discuss: opts.discuss })
|
|
15697
15458
|
},
|
|
@@ -15702,18 +15463,8 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15702
15463
|
// config's searchFilter is deliberately fail-closed there. Same
|
|
15703
15464
|
// ChatRef item shape (`buildHubspotTicketSelfRef` SSOT), same preset.
|
|
15704
15465
|
hubspot_ticket_self: refHydratedEntry("hubspot_ticket_self", "HubSpot ticket (self)", (displayRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HubspotTicketChatCard, { chatRef: displayRef, isNewTab: opts.isNewTab, discuss: opts.discuss })),
|
|
15705
|
-
data_room_doc: refHydratedEntry(
|
|
15706
|
-
|
|
15707
|
-
"Data-room doc",
|
|
15708
|
-
(displayRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DataRoomDocChatCard, { chatRef: displayRef, isNewTab: opts.isNewTab, discuss: opts.discuss }),
|
|
15709
|
-
true
|
|
15710
|
-
),
|
|
15711
|
-
markdown: refHydratedEntry(
|
|
15712
|
-
"markdown",
|
|
15713
|
-
"Doc page (markdown)",
|
|
15714
|
-
(displayRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DataRoomDocChatCard, { chatRef: displayRef, isNewTab: opts.isNewTab, discuss: opts.discuss }),
|
|
15715
|
-
true
|
|
15716
|
-
),
|
|
15466
|
+
data_room_doc: refHydratedEntry("data_room_doc", "Data-room doc", (displayRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DataRoomDocChatCard, { chatRef: displayRef, isNewTab: opts.isNewTab, discuss: opts.discuss })),
|
|
15467
|
+
markdown: refHydratedEntry("markdown", "Doc page (markdown)", (displayRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DataRoomDocChatCard, { chatRef: displayRef, isNewTab: opts.isNewTab, discuss: opts.discuss })),
|
|
15717
15468
|
// Body-synthesized video ids (`shortVideoId` content hashes / YouTube
|
|
15718
15469
|
// ids) have no backing table row to fetch — ref-only by nature.
|
|
15719
15470
|
video: {
|
|
@@ -15735,8 +15486,8 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15735
15486
|
chatRef,
|
|
15736
15487
|
isNewTab: opts.isNewTab,
|
|
15737
15488
|
discuss: opts.discuss,
|
|
15738
|
-
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
15739
|
-
hasEmbeddedVideo: _optionalChain([chatRef, 'access',
|
|
15489
|
+
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _442 => _442.extras, 'optionalAccess', _443 => _443.buildOgPlaceholderUrl, 'optionalCall', _444 => _444(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _445 => _445.title]), () => ( "")))]), () => ( null)),
|
|
15490
|
+
hasEmbeddedVideo: _optionalChain([chatRef, 'access', _446 => _446.metadata, 'optionalAccess', _447 => _447.hasEmbeddedVideo]) === true
|
|
15740
15491
|
}
|
|
15741
15492
|
)
|
|
15742
15493
|
},
|
|
@@ -15752,7 +15503,7 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15752
15503
|
chatRef,
|
|
15753
15504
|
isNewTab: opts.isNewTab,
|
|
15754
15505
|
discuss: opts.discuss,
|
|
15755
|
-
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
15506
|
+
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _448 => _448.extras, 'optionalAccess', _449 => _449.buildOgPlaceholderUrl, 'optionalCall', _450 => _450(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _451 => _451.title]), () => ( "")))]), () => ( null))
|
|
15756
15507
|
}
|
|
15757
15508
|
)
|
|
15758
15509
|
},
|
|
@@ -15768,7 +15519,7 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15768
15519
|
chatRef,
|
|
15769
15520
|
isNewTab: opts.isNewTab,
|
|
15770
15521
|
discuss: opts.discuss,
|
|
15771
|
-
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
15522
|
+
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _452 => _452.extras, 'optionalAccess', _453 => _453.buildOgPlaceholderUrl, 'optionalCall', _454 => _454(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _455 => _455.title]), () => ( "")))]), () => ( null))
|
|
15772
15523
|
}
|
|
15773
15524
|
)
|
|
15774
15525
|
},
|
|
@@ -15778,7 +15529,7 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15778
15529
|
bareInline: true,
|
|
15779
15530
|
skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNNFQLTJ3cjs.ProductReleaseCardSkeleton, { size: "sm" }),
|
|
15780
15531
|
render: (item, chatRef, opts) => {
|
|
15781
|
-
const builder = _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
15532
|
+
const builder = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _456 => _456.extras, 'optionalAccess', _457 => _457.buildProductReleaseCardProps]), () => ( _chunkNNFQLTJ3cjs.defaultBuildProductReleaseCardProps));
|
|
15782
15533
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15783
15534
|
ProductReleaseChatCard,
|
|
15784
15535
|
{
|
|
@@ -15804,7 +15555,7 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15804
15555
|
chatRef,
|
|
15805
15556
|
isNewTab: opts.isNewTab,
|
|
15806
15557
|
discuss: opts.discuss,
|
|
15807
|
-
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
15558
|
+
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _458 => _458.extras, 'optionalAccess', _459 => _459.buildOgPlaceholderUrl, 'optionalCall', _460 => _460(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _461 => _461.title]), () => ( "")))]), () => ( null))
|
|
15808
15559
|
}
|
|
15809
15560
|
)
|
|
15810
15561
|
},
|
|
@@ -15822,7 +15573,7 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15822
15573
|
chatRef,
|
|
15823
15574
|
isNewTab: opts.isNewTab,
|
|
15824
15575
|
discuss: opts.discuss,
|
|
15825
|
-
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
15576
|
+
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _462 => _462.extras, 'optionalAccess', _463 => _463.buildOgPlaceholderUrl, 'optionalCall', _464 => _464(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _465 => _465.title]), () => ( "")))]), () => ( null))
|
|
15826
15577
|
}
|
|
15827
15578
|
)
|
|
15828
15579
|
},
|
|
@@ -15833,7 +15584,7 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15833
15584
|
skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CampaignCardAdminSkeleton, {}),
|
|
15834
15585
|
// No public viewer — synthesize the hub-internal admin URL post-fetch
|
|
15835
15586
|
// so the wrapper + isNewTab computation see the actual destination.
|
|
15836
|
-
fallbackHref: (item) => _optionalChain([item, 'optionalAccess',
|
|
15587
|
+
fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _466 => _466.id]) ? `/admin/campaigns/${encodeURIComponent(String(item.id))}` : null,
|
|
15837
15588
|
render: (item, chatRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CampaignChatCard, { item, chatRef, isNewTab: opts.isNewTab, discuss: opts.discuss })
|
|
15838
15589
|
},
|
|
15839
15590
|
...roadmapRegistryEntries()
|
|
@@ -15852,13 +15603,13 @@ function ChatCardNavWrap({
|
|
|
15852
15603
|
if (!href) return;
|
|
15853
15604
|
const targetEl = e.target;
|
|
15854
15605
|
const host = e.currentTarget;
|
|
15855
|
-
if (!_optionalChain([host, 'optionalAccess',
|
|
15856
|
-
if (_optionalChain([targetEl, 'optionalAccess',
|
|
15857
|
-
if (!_optionalChain([targetEl, 'optionalAccess',
|
|
15606
|
+
if (!_optionalChain([host, 'optionalAccess', _467 => _467.contains, 'call', _468 => _468(targetEl)])) return;
|
|
15607
|
+
if (_optionalChain([targetEl, 'optionalAccess', _469 => _469.closest, 'optionalCall', _470 => _470("button")])) return;
|
|
15608
|
+
if (!_optionalChain([targetEl, 'optionalAccess', _471 => _471.closest, 'optionalCall', _472 => _472("a")])) return;
|
|
15858
15609
|
const handled = executeNavigation({ event: e, runtime, href, path, targetPlatform, fallbackNavigate: router.push });
|
|
15859
15610
|
if (!handled) return;
|
|
15860
15611
|
e.stopPropagation();
|
|
15861
|
-
if (!isNewTab && _optionalChain([panel, 'optionalAccess',
|
|
15612
|
+
if (!isNewTab && _optionalChain([panel, 'optionalAccess', _473 => _473.closeChat])) panel.closeChat();
|
|
15862
15613
|
};
|
|
15863
15614
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "contents", onClickCapture, children });
|
|
15864
15615
|
}
|
|
@@ -15880,7 +15631,7 @@ function ChatCardLoader({
|
|
|
15880
15631
|
title: chatRef.title,
|
|
15881
15632
|
externalUrl: chatRef.url,
|
|
15882
15633
|
targetPlatform: chatRef.targetPlatform,
|
|
15883
|
-
path: typeof _optionalChain([chatRef, 'access',
|
|
15634
|
+
path: typeof _optionalChain([chatRef, 'access', _474 => _474.metadata, 'optionalAccess', _475 => _475.path]) === "string" ? chatRef.metadata.path : null
|
|
15884
15635
|
},
|
|
15885
15636
|
sourceRowCtxFromRuntime(runtime, { baseRoute, chipBasePlatform })
|
|
15886
15637
|
);
|
|
@@ -15894,11 +15645,11 @@ function ChatCardLoader({
|
|
|
15894
15645
|
const entry = CHAT_CARD_REGISTRY[resolvedChatRef.type];
|
|
15895
15646
|
const fetchEntry = entry && entry.contentRefType ? entry : null;
|
|
15896
15647
|
const { item, isLoading, isError, isFetched } = useChatCardItem(
|
|
15897
|
-
_nullishCoalesce(_optionalChain([fetchEntry, 'optionalAccess',
|
|
15648
|
+
_nullishCoalesce(_optionalChain([fetchEntry, 'optionalAccess', _476 => _476.contentRefType]), () => ( "")),
|
|
15898
15649
|
fetchEntry ? resolvedChatRef.id : ""
|
|
15899
15650
|
);
|
|
15900
15651
|
if (!entry) return null;
|
|
15901
|
-
const composedHref = _optionalChain([fetchEntry, 'optionalAccess',
|
|
15652
|
+
const composedHref = _optionalChain([fetchEntry, 'optionalAccess', _477 => _477.contentRefType]) && !resolvedChatRef.url && item ? resolveFetchedCardHref({
|
|
15902
15653
|
contentRefType: fetchEntry.contentRefType,
|
|
15903
15654
|
id: resolvedChatRef.id,
|
|
15904
15655
|
item,
|
|
@@ -15906,7 +15657,7 @@ function ChatCardLoader({
|
|
|
15906
15657
|
}) : null;
|
|
15907
15658
|
const hrefChoice = fetchEntry && !resolvedChatRef.url && item ? pickFetchedCardHref({
|
|
15908
15659
|
composed: composedHref,
|
|
15909
|
-
itemHref: _nullishCoalesce(_optionalChain([fetchEntry, 'access',
|
|
15660
|
+
itemHref: _nullishCoalesce(_optionalChain([fetchEntry, 'access', _478 => _478.fallbackHref, 'optionalCall', _479 => _479(item)]), () => ( null)),
|
|
15910
15661
|
allowComposed: !fetchEntry.noComposedHref
|
|
15911
15662
|
}) : null;
|
|
15912
15663
|
const hrefResolvedChatRef = hrefChoice ? {
|
|
@@ -15940,7 +15691,7 @@ function ChatCardLoader({
|
|
|
15940
15691
|
isNewTab,
|
|
15941
15692
|
discuss
|
|
15942
15693
|
};
|
|
15943
|
-
const path = typeof _optionalChain([finalChatRef, 'access',
|
|
15694
|
+
const path = typeof _optionalChain([finalChatRef, 'access', _480 => _480.metadata, 'optionalAccess', _481 => _481.path]) === "string" ? finalChatRef.metadata.path : null;
|
|
15944
15695
|
const navWrap = (children) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15945
15696
|
ChatCardNavWrap,
|
|
15946
15697
|
{
|
|
@@ -15964,12 +15715,8 @@ function ChatCardLoader({
|
|
|
15964
15715
|
if (!fetchEntry) {
|
|
15965
15716
|
return finish(entry.render(void 0, finalChatRef, renderOpts));
|
|
15966
15717
|
}
|
|
15967
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: _nullishCoalesce(_optionalChain([fetchEntry, 'access',
|
|
15718
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: _nullishCoalesce(_optionalChain([fetchEntry, 'access', _482 => _482.skeleton, 'optionalCall', _483 => _483()]), () => ( null)) });
|
|
15968
15719
|
if (!item) {
|
|
15969
|
-
const hasSourceMetadata = fetchEntry.renderFromSourceMetadata && isSourceMetadataCardRef(chatRef) && typeof _optionalChain([finalChatRef, 'access', _499 => _499.metadata, 'optionalAccess', _500 => _500.path]) === "string";
|
|
15970
|
-
if (hasSourceMetadata) {
|
|
15971
|
-
return finish(fetchEntry.render(sourceMetadataCardItem(finalChatRef), finalChatRef, renderOpts));
|
|
15972
|
-
}
|
|
15973
15720
|
if (isError) {
|
|
15974
15721
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CardLoadFailure, { label: entry.label, id: finalChatRef.id, detail: "Failed to load" });
|
|
15975
15722
|
}
|
|
@@ -16010,15 +15757,13 @@ function renderChatInlineEntityCard(chatRef, options = {}) {
|
|
|
16010
15757
|
}
|
|
16011
15758
|
);
|
|
16012
15759
|
if (chatRef.type === "video") {
|
|
16013
|
-
const enrichedMetadata = validatedVideoMetadata(chatRef);
|
|
16014
15760
|
const decoded = decodeVideoMarkerId(chatRef.id);
|
|
16015
|
-
|
|
16016
|
-
if (playableMetadata) {
|
|
15761
|
+
if (decoded) {
|
|
16017
15762
|
const displayRef = {
|
|
16018
15763
|
...chatRef,
|
|
16019
15764
|
title: chatRef.title && chatRef.title !== chatRef.id ? chatRef.title : "Video",
|
|
16020
|
-
url: _nullishCoalesce(_nullishCoalesce(chatRef.url, () => (
|
|
16021
|
-
metadata:
|
|
15765
|
+
url: _nullishCoalesce(_nullishCoalesce(chatRef.url, () => ( decoded.videoUrl)), () => ( (decoded.youtubeUrl ? `https://www.youtube.com/watch?v=${decoded.youtubeUrl}` : null))),
|
|
15766
|
+
metadata: { ..._nullishCoalesce(chatRef.metadata, () => ( {})), ...decoded }
|
|
16022
15767
|
};
|
|
16023
15768
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlockCard, { inline: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChatInlineVideoPill, { chatRef: displayRef }), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChatVideoEntityCard, { chatRef: displayRef }) });
|
|
16024
15769
|
}
|
|
@@ -16330,7 +16075,7 @@ function useChunkCatchup({
|
|
|
16330
16075
|
if (catchupRun.current === run) {
|
|
16331
16076
|
if (currentDialogId !== dialogIdRef.current) {
|
|
16332
16077
|
catchupRun.current = null;
|
|
16333
|
-
if (_optionalChain([pendingCatchupRef, 'access',
|
|
16078
|
+
if (_optionalChain([pendingCatchupRef, 'access', _484 => _484.current, 'optionalAccess', _485 => _485.dialogId]) === currentDialogId) {
|
|
16334
16079
|
pendingCatchupRef.current = null;
|
|
16335
16080
|
}
|
|
16336
16081
|
} else {
|
|
@@ -16341,7 +16086,7 @@ function useChunkCatchup({
|
|
|
16341
16086
|
if (pending.dialogId === currentDialogId) {
|
|
16342
16087
|
rearmForQueuedCatchup();
|
|
16343
16088
|
try {
|
|
16344
|
-
await _optionalChain([catchUpChunksRef, 'access',
|
|
16089
|
+
await _optionalChain([catchUpChunksRef, 'access', _486 => _486.current, 'optionalCall', _487 => _487(pending.fromSequenceId)]);
|
|
16345
16090
|
} catch (rerunError) {
|
|
16346
16091
|
console.error("Queued catch-up re-run failed:", rerunError);
|
|
16347
16092
|
}
|
|
@@ -16408,7 +16153,7 @@ function useChunkCatchup({
|
|
|
16408
16153
|
|
|
16409
16154
|
var EMPTY_FRAME = { messages: [], phase: "idle", typing: false, delayMs: 0 };
|
|
16410
16155
|
function prefersReducedMotion() {
|
|
16411
|
-
return typeof window !== "undefined" && _optionalChain([window, 'access',
|
|
16156
|
+
return typeof window !== "undefined" && _optionalChain([window, 'access', _488 => _488.matchMedia, 'optionalCall', _489 => _489("(prefers-reduced-motion: reduce)"), 'access', _490 => _490.matches]) === true;
|
|
16412
16157
|
}
|
|
16413
16158
|
function useScriptedStream(frames, resetKey, enabled = true) {
|
|
16414
16159
|
const [index, setIndex] = _react.useState.call(void 0, 0);
|
|
@@ -16419,7 +16164,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
|
|
|
16419
16164
|
setIndex(0);
|
|
16420
16165
|
}
|
|
16421
16166
|
_react.useEffect.call(void 0, () => {
|
|
16422
|
-
const mq = _optionalChain([window, 'access',
|
|
16167
|
+
const mq = _optionalChain([window, 'access', _491 => _491.matchMedia, 'optionalCall', _492 => _492("(prefers-reduced-motion: reduce)")]);
|
|
16423
16168
|
const sync = () => setReducedMotion(mq ? mq.matches : prefersReducedMotion());
|
|
16424
16169
|
sync();
|
|
16425
16170
|
if (!mq) return void 0;
|
|
@@ -16554,7 +16299,7 @@ function useJetStreamDialogSubscription({
|
|
|
16554
16299
|
if (subscriptionRef.current) {
|
|
16555
16300
|
try {
|
|
16556
16301
|
subscriptionRef.current.unsubscribe();
|
|
16557
|
-
} catch (
|
|
16302
|
+
} catch (e46) {
|
|
16558
16303
|
}
|
|
16559
16304
|
subscriptionRef.current = null;
|
|
16560
16305
|
}
|
|
@@ -16562,7 +16307,7 @@ function useJetStreamDialogSubscription({
|
|
|
16562
16307
|
const lifecycle = _chunkI5JVSFNVcjs.startConnectionLifecycle.call(void 0, {
|
|
16563
16308
|
conn: sharedConn,
|
|
16564
16309
|
wsUrl,
|
|
16565
|
-
onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access',
|
|
16310
|
+
onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access', _493 => _493.current, 'optionalCall', _494 => _494()]),
|
|
16566
16311
|
backoff: reconnectionBackoffRef.current,
|
|
16567
16312
|
getFreshUrl: () => getNatsWsUrlRef.current(),
|
|
16568
16313
|
// JetStream emits 'error' for protocol-level failures (e.g. -ERR Permissions
|
|
@@ -16577,7 +16322,7 @@ function useJetStreamDialogSubscription({
|
|
|
16577
16322
|
setReconnectionCount((c) => c + 1);
|
|
16578
16323
|
}
|
|
16579
16324
|
hadConnectionBeforeRef.current = true;
|
|
16580
|
-
_optionalChain([onConnectRef, 'access',
|
|
16325
|
+
_optionalChain([onConnectRef, 'access', _495 => _495.current, 'optionalCall', _496 => _496()]);
|
|
16581
16326
|
}
|
|
16582
16327
|
if (status === "error") {
|
|
16583
16328
|
console.warn("[JetStream] NATS protocol error:", evt.data);
|
|
@@ -16587,7 +16332,7 @@ function useJetStreamDialogSubscription({
|
|
|
16587
16332
|
setIsConnected(false);
|
|
16588
16333
|
setIsSubscribed(false);
|
|
16589
16334
|
tearDownSubscription();
|
|
16590
|
-
_optionalChain([onDisconnectRef, 'access',
|
|
16335
|
+
_optionalChain([onDisconnectRef, 'access', _497 => _497.current, 'optionalCall', _498 => _498()]);
|
|
16591
16336
|
}
|
|
16592
16337
|
}
|
|
16593
16338
|
});
|
|
@@ -16648,7 +16393,7 @@ function useJetStreamDialogSubscription({
|
|
|
16648
16393
|
if (subscriptionRef.current) {
|
|
16649
16394
|
try {
|
|
16650
16395
|
subscriptionRef.current.unsubscribe();
|
|
16651
|
-
} catch (
|
|
16396
|
+
} catch (e47) {
|
|
16652
16397
|
}
|
|
16653
16398
|
subscriptionRef.current = null;
|
|
16654
16399
|
}
|
|
@@ -16683,7 +16428,7 @@ function useJetStreamDialogSubscription({
|
|
|
16683
16428
|
parsed.streamSeq = streamSeq;
|
|
16684
16429
|
}
|
|
16685
16430
|
cb(parsed, topic);
|
|
16686
|
-
} catch (
|
|
16431
|
+
} catch (e48) {
|
|
16687
16432
|
}
|
|
16688
16433
|
},
|
|
16689
16434
|
{
|
|
@@ -16707,14 +16452,14 @@ function useJetStreamDialogSubscription({
|
|
|
16707
16452
|
if (cancelled) {
|
|
16708
16453
|
try {
|
|
16709
16454
|
handle.unsubscribe();
|
|
16710
|
-
} catch (
|
|
16455
|
+
} catch (e49) {
|
|
16711
16456
|
}
|
|
16712
16457
|
return;
|
|
16713
16458
|
}
|
|
16714
16459
|
subscriptionRef.current = handle;
|
|
16715
16460
|
setIsSubscribed(true);
|
|
16716
|
-
_optionalChain([onSubscribedRef, 'access',
|
|
16717
|
-
} catch (
|
|
16461
|
+
_optionalChain([onSubscribedRef, 'access', _499 => _499.current, 'optionalCall', _500 => _500()]);
|
|
16462
|
+
} catch (e50) {
|
|
16718
16463
|
if (!cancelled) {
|
|
16719
16464
|
setIsSubscribed(false);
|
|
16720
16465
|
}
|
|
@@ -16726,7 +16471,7 @@ function useJetStreamDialogSubscription({
|
|
|
16726
16471
|
if (subscriptionRef.current) {
|
|
16727
16472
|
try {
|
|
16728
16473
|
subscriptionRef.current.unsubscribe();
|
|
16729
|
-
} catch (
|
|
16474
|
+
} catch (e51) {
|
|
16730
16475
|
}
|
|
16731
16476
|
subscriptionRef.current = null;
|
|
16732
16477
|
}
|
|
@@ -16829,20 +16574,20 @@ function useNatsDialogSubscription({
|
|
|
16829
16574
|
const tearDownSubscriptions = () => {
|
|
16830
16575
|
subscriptionRefs.current.forEach((sub) => {
|
|
16831
16576
|
try {
|
|
16832
|
-
_optionalChain([sub, 'optionalAccess',
|
|
16833
|
-
} catch (
|
|
16577
|
+
_optionalChain([sub, 'optionalAccess', _501 => _501.unsubscribe, 'call', _502 => _502()]);
|
|
16578
|
+
} catch (e52) {
|
|
16834
16579
|
}
|
|
16835
16580
|
});
|
|
16836
16581
|
subscriptionRefs.current.clear();
|
|
16837
16582
|
lastSubscribedDialogIdRef.current = null;
|
|
16838
|
-
_optionalChain([abortControllerRef, 'access',
|
|
16583
|
+
_optionalChain([abortControllerRef, 'access', _503 => _503.current, 'optionalAccess', _504 => _504.abort, 'call', _505 => _505()]);
|
|
16839
16584
|
abortControllerRef.current = null;
|
|
16840
16585
|
};
|
|
16841
16586
|
const isDisconnectStatus = (status) => status === "closed" || status === "disconnected";
|
|
16842
16587
|
const lifecycle = _chunkI5JVSFNVcjs.startConnectionLifecycle.call(void 0, {
|
|
16843
16588
|
conn: sharedConn,
|
|
16844
16589
|
wsUrl,
|
|
16845
|
-
onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access',
|
|
16590
|
+
onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access', _506 => _506.current, 'optionalCall', _507 => _507()]),
|
|
16846
16591
|
backoff: reconnectionBackoffRef.current,
|
|
16847
16592
|
getFreshUrl: () => getNatsWsUrlRef.current(),
|
|
16848
16593
|
shouldRetryOn: isDisconnectStatus,
|
|
@@ -16853,7 +16598,7 @@ function useNatsDialogSubscription({
|
|
|
16853
16598
|
setReconnectionCount((c) => c + 1);
|
|
16854
16599
|
}
|
|
16855
16600
|
hadConnectionBeforeRef.current = true;
|
|
16856
|
-
_optionalChain([onConnectRef, 'access',
|
|
16601
|
+
_optionalChain([onConnectRef, 'access', _508 => _508.current, 'optionalCall', _509 => _509()]);
|
|
16857
16602
|
}
|
|
16858
16603
|
if (status === "error") {
|
|
16859
16604
|
console.warn("[NATS] protocol error:", evt.data);
|
|
@@ -16863,7 +16608,7 @@ function useNatsDialogSubscription({
|
|
|
16863
16608
|
setIsConnected(false);
|
|
16864
16609
|
setIsSubscribed(false);
|
|
16865
16610
|
tearDownSubscriptions();
|
|
16866
|
-
_optionalChain([onDisconnectRef, 'access',
|
|
16611
|
+
_optionalChain([onDisconnectRef, 'access', _510 => _510.current, 'optionalCall', _511 => _511()]);
|
|
16867
16612
|
}
|
|
16868
16613
|
}
|
|
16869
16614
|
});
|
|
@@ -16894,13 +16639,13 @@ function useNatsDialogSubscription({
|
|
|
16894
16639
|
setIsSubscribed(false);
|
|
16895
16640
|
subscriptionRefs.current.forEach((sub) => {
|
|
16896
16641
|
try {
|
|
16897
|
-
_optionalChain([sub, 'optionalAccess',
|
|
16898
|
-
} catch (
|
|
16642
|
+
_optionalChain([sub, 'optionalAccess', _512 => _512.unsubscribe, 'call', _513 => _513()]);
|
|
16643
|
+
} catch (e53) {
|
|
16899
16644
|
}
|
|
16900
16645
|
});
|
|
16901
16646
|
subscriptionRefs.current.clear();
|
|
16902
16647
|
lastSubscribedDialogIdRef.current = null;
|
|
16903
|
-
_optionalChain([abortControllerRef, 'access',
|
|
16648
|
+
_optionalChain([abortControllerRef, 'access', _514 => _514.current, 'optionalAccess', _515 => _515.abort, 'call', _516 => _516()]);
|
|
16904
16649
|
abortControllerRef.current = null;
|
|
16905
16650
|
}
|
|
16906
16651
|
return void 0;
|
|
@@ -16912,12 +16657,12 @@ function useNatsDialogSubscription({
|
|
|
16912
16657
|
if (subscriptionRefs.current.size > 0) {
|
|
16913
16658
|
subscriptionRefs.current.forEach((sub) => {
|
|
16914
16659
|
try {
|
|
16915
|
-
_optionalChain([sub, 'optionalAccess',
|
|
16916
|
-
} catch (
|
|
16660
|
+
_optionalChain([sub, 'optionalAccess', _517 => _517.unsubscribe, 'call', _518 => _518()]);
|
|
16661
|
+
} catch (e54) {
|
|
16917
16662
|
}
|
|
16918
16663
|
});
|
|
16919
16664
|
subscriptionRefs.current.clear();
|
|
16920
|
-
_optionalChain([abortControllerRef, 'access',
|
|
16665
|
+
_optionalChain([abortControllerRef, 'access', _519 => _519.current, 'optionalAccess', _520 => _520.abort, 'call', _521 => _521()]);
|
|
16921
16666
|
}
|
|
16922
16667
|
abortControllerRef.current = new AbortController();
|
|
16923
16668
|
const abort = abortControllerRef.current;
|
|
@@ -16936,7 +16681,7 @@ function useNatsDialogSubscription({
|
|
|
16936
16681
|
const dataStr = decoder.decode(msg.data);
|
|
16937
16682
|
const parsed = JSON.parse(dataStr);
|
|
16938
16683
|
onEventRef.current(parsed, messageType);
|
|
16939
|
-
} catch (
|
|
16684
|
+
} catch (e55) {
|
|
16940
16685
|
}
|
|
16941
16686
|
};
|
|
16942
16687
|
topicsRef.current.forEach((topic) => {
|
|
@@ -16947,7 +16692,7 @@ function useNatsDialogSubscription({
|
|
|
16947
16692
|
});
|
|
16948
16693
|
lastSubscribedDialogIdRef.current = dialogId;
|
|
16949
16694
|
setIsSubscribed(true);
|
|
16950
|
-
_optionalChain([onSubscribedRef, 'access',
|
|
16695
|
+
_optionalChain([onSubscribedRef, 'access', _522 => _522.current, 'optionalCall', _523 => _523()]);
|
|
16951
16696
|
};
|
|
16952
16697
|
if (isConnectedRef.current) {
|
|
16953
16698
|
createSubscriptions();
|
|
@@ -16958,8 +16703,8 @@ function useNatsDialogSubscription({
|
|
|
16958
16703
|
abort.abort();
|
|
16959
16704
|
subscriptions.forEach((sub) => {
|
|
16960
16705
|
try {
|
|
16961
|
-
_optionalChain([sub, 'optionalAccess',
|
|
16962
|
-
} catch (
|
|
16706
|
+
_optionalChain([sub, 'optionalAccess', _524 => _524.unsubscribe, 'call', _525 => _525()]);
|
|
16707
|
+
} catch (e56) {
|
|
16963
16708
|
}
|
|
16964
16709
|
});
|
|
16965
16710
|
subscriptions.clear();
|
|
@@ -16986,7 +16731,7 @@ function useNatsDialogSubscription({
|
|
|
16986
16731
|
const dataStr = decoder.decode(msg.data);
|
|
16987
16732
|
const parsed = JSON.parse(dataStr);
|
|
16988
16733
|
onEventRef.current(parsed, messageType);
|
|
16989
|
-
} catch (
|
|
16734
|
+
} catch (e57) {
|
|
16990
16735
|
}
|
|
16991
16736
|
};
|
|
16992
16737
|
topicsRef.current.forEach((topic) => {
|
|
@@ -16997,7 +16742,7 @@ function useNatsDialogSubscription({
|
|
|
16997
16742
|
});
|
|
16998
16743
|
lastSubscribedDialogIdRef.current = currentDialogId;
|
|
16999
16744
|
setIsSubscribed(true);
|
|
17000
|
-
_optionalChain([onSubscribedRef, 'access',
|
|
16745
|
+
_optionalChain([onSubscribedRef, 'access', _526 => _526.current, 'optionalCall', _527 => _527()]);
|
|
17001
16746
|
} else if (subscriptionRefs.current.size > 0) {
|
|
17002
16747
|
setIsSubscribed(true);
|
|
17003
16748
|
}
|
|
@@ -17005,10 +16750,10 @@ function useNatsDialogSubscription({
|
|
|
17005
16750
|
return { isConnected, isSubscribed, reconnectionCount };
|
|
17006
16751
|
}
|
|
17007
16752
|
function buildNatsWsUrl(apiBaseUrl, options) {
|
|
17008
|
-
const path = _optionalChain([options, 'optionalAccess',
|
|
16753
|
+
const path = _optionalChain([options, 'optionalAccess', _528 => _528.source]) === "dashboard" ? "/ws/nats-api" : "/ws/nats";
|
|
17009
16754
|
const u = new URL(path, apiBaseUrl);
|
|
17010
16755
|
u.protocol = u.protocol === "https:" ? "wss:" : "ws:";
|
|
17011
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
16756
|
+
if (_optionalChain([options, 'optionalAccess', _529 => _529.includeAuthParam]) && _optionalChain([options, 'optionalAccess', _530 => _530.token])) {
|
|
17012
16757
|
u.searchParams.set("authorization", options.token);
|
|
17013
16758
|
}
|
|
17014
16759
|
return u.toString();
|
|
@@ -17017,19 +16762,16 @@ function buildNatsWsUrl(apiBaseUrl, options) {
|
|
|
17017
16762
|
// src/components/chat/hooks/use-slash-commands.ts
|
|
17018
16763
|
|
|
17019
16764
|
|
|
17020
|
-
var COMMANDS_MAX_RESULTS = 10;
|
|
17021
16765
|
async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
17022
16766
|
try {
|
|
17023
16767
|
const url = new URL(commandsUrl, window.location.origin);
|
|
16768
|
+
if (prefix) url.searchParams.set("q", prefix);
|
|
17024
16769
|
const res = await _chunkCP6TIRONcjs.embedAuthedFetch.call(void 0, url.toString(), { signal, headers: {} });
|
|
17025
16770
|
if (!res.ok) return [];
|
|
17026
16771
|
const data = await res.json();
|
|
17027
|
-
|
|
17028
|
-
const normalizedPrefix = prefix.trim().toLowerCase();
|
|
17029
|
-
if (!normalizedPrefix) return commands;
|
|
17030
|
-
return commands.filter(({ id }) => id.startsWith(normalizedPrefix)).slice(0, COMMANDS_MAX_RESULTS);
|
|
16772
|
+
return _nullishCoalesce(data.commands, () => ( []));
|
|
17031
16773
|
} catch (err) {
|
|
17032
|
-
if (_optionalChain([err, 'optionalAccess',
|
|
16774
|
+
if (_optionalChain([err, 'optionalAccess', _531 => _531.name]) === "AbortError") throw err;
|
|
17033
16775
|
console.warn("[chat] slash-commands fetch failed, showing none:", err);
|
|
17034
16776
|
return [];
|
|
17035
16777
|
}
|
|
@@ -17037,8 +16779,8 @@ async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
|
17037
16779
|
var NO_COMMANDS = [];
|
|
17038
16780
|
function useSlashCommands(prefix, commandsUrl) {
|
|
17039
16781
|
const [answered, setAnswered] = _react.useState.call(void 0, null);
|
|
17040
|
-
const commands = prefix != null && _optionalChain([answered, 'optionalAccess',
|
|
17041
|
-
const loading = prefix != null && _optionalChain([answered, 'optionalAccess',
|
|
16782
|
+
const commands = prefix != null && _optionalChain([answered, 'optionalAccess', _532 => _532.prefix]) === prefix ? answered.commands : NO_COMMANDS;
|
|
16783
|
+
const loading = prefix != null && _optionalChain([answered, 'optionalAccess', _533 => _533.prefix]) !== prefix;
|
|
17042
16784
|
_react.useEffect.call(void 0, () => {
|
|
17043
16785
|
if (prefix == null) return void 0;
|
|
17044
16786
|
let cancelled = false;
|
|
@@ -17048,7 +16790,7 @@ function useSlashCommands(prefix, commandsUrl) {
|
|
|
17048
16790
|
const next = await fetchSlashCommands(prefix, ctrl.signal, commandsUrl);
|
|
17049
16791
|
if (!cancelled) setAnswered({ prefix, commands: next });
|
|
17050
16792
|
} catch (err) {
|
|
17051
|
-
if (!cancelled && _optionalChain([err, 'optionalAccess',
|
|
16793
|
+
if (!cancelled && _optionalChain([err, 'optionalAccess', _534 => _534.name]) !== "AbortError") {
|
|
17052
16794
|
console.warn("[use-slash-commands] fetch failed:", err);
|
|
17053
16795
|
setAnswered({ prefix, commands: NO_COMMANDS });
|
|
17054
16796
|
}
|
|
@@ -17071,7 +16813,7 @@ function useSlashCommandRegistry(commandsUrl, options) {
|
|
|
17071
16813
|
const query = _reactquery.useQuery.call(void 0, {
|
|
17072
16814
|
queryKey: ["chat-slash-commands", commandsUrl],
|
|
17073
16815
|
queryFn: ({ signal }) => fetchSlashCommands("", signal, commandsUrl),
|
|
17074
|
-
enabled: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
16816
|
+
enabled: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _535 => _535.enabled]), () => ( true)),
|
|
17075
16817
|
staleTime: Infinity,
|
|
17076
16818
|
gcTime: Infinity,
|
|
17077
16819
|
// The commands registry is non-critical chrome — a failure degrades to an
|
|
@@ -17110,21 +16852,21 @@ async function fetchEmptyStateConfig(signal, emptyStateUrl) {
|
|
|
17110
16852
|
}
|
|
17111
16853
|
const data = await res.json();
|
|
17112
16854
|
return {
|
|
17113
|
-
name: _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
17114
|
-
icon: _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
17115
|
-
greeting: _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
17116
|
-
enabledRagTableIds: _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
17117
|
-
quickActions: _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
17118
|
-
suggestedQueries: _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
16855
|
+
name: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _536 => _536.name]), () => ( null)),
|
|
16856
|
+
icon: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _537 => _537.icon]), () => ( null)),
|
|
16857
|
+
greeting: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _538 => _538.greeting]), () => ( null)),
|
|
16858
|
+
enabledRagTableIds: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _539 => _539.enabledRagTableIds]), () => ( [])),
|
|
16859
|
+
quickActions: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _540 => _540.quickActions]), () => ( [])),
|
|
16860
|
+
suggestedQueries: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _541 => _541.suggestedQueries]), () => ( []))
|
|
17119
16861
|
};
|
|
17120
16862
|
} catch (err) {
|
|
17121
|
-
if (_optionalChain([err, 'optionalAccess',
|
|
16863
|
+
if (_optionalChain([err, 'optionalAccess', _542 => _542.name]) === "AbortError") throw err;
|
|
17122
16864
|
console.warn("[chat] empty-state config fetch failed, using neutral defaults:", err);
|
|
17123
16865
|
return EMPTY_STATE_FALLBACK;
|
|
17124
16866
|
}
|
|
17125
16867
|
}
|
|
17126
16868
|
function useEmptyStateConfig(emptyStateUrl, options) {
|
|
17127
|
-
const enabled = (_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
16869
|
+
const enabled = (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _543 => _543.enabled]), () => ( true))) && !!emptyStateUrl;
|
|
17128
16870
|
const query = _reactquery.useQuery.call(void 0, {
|
|
17129
16871
|
queryKey: ["chat-empty-state", emptyStateUrl],
|
|
17130
16872
|
queryFn: ({ signal }) => fetchEmptyStateConfig(signal, emptyStateUrl),
|
|
@@ -17153,7 +16895,7 @@ var CHAT_ATTACHMENT_MAX_SIZE_BYTES = 25 * 1024 * 1024;
|
|
|
17153
16895
|
var STORAGE_CACHE_CONTROL_IMMUTABLE = "public, max-age=31536000, immutable";
|
|
17154
16896
|
function uploadWithProgress(url, file, token, onProgress, signal) {
|
|
17155
16897
|
return new Promise((resolve, reject) => {
|
|
17156
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
16898
|
+
if (_optionalChain([signal, 'optionalAccess', _544 => _544.aborted])) {
|
|
17157
16899
|
reject(new Error("Upload cancelled"));
|
|
17158
16900
|
return;
|
|
17159
16901
|
}
|
|
@@ -17195,7 +16937,7 @@ function uploadWithProgress(url, file, token, onProgress, signal) {
|
|
|
17195
16937
|
const handleSignalAbort = () => {
|
|
17196
16938
|
xhr.abort();
|
|
17197
16939
|
};
|
|
17198
|
-
_optionalChain([signal, 'optionalAccess',
|
|
16940
|
+
_optionalChain([signal, 'optionalAccess', _545 => _545.addEventListener, 'call', _546 => _546("abort", handleSignalAbort, { once: true, signal: listeners.signal })]);
|
|
17199
16941
|
xhr.upload.addEventListener("progress", handleProgress, { signal: listeners.signal });
|
|
17200
16942
|
xhr.addEventListener("load", handleLoad, { signal: listeners.signal });
|
|
17201
16943
|
xhr.addEventListener("error", handleError, { signal: listeners.signal });
|
|
@@ -17239,10 +16981,10 @@ function useChatAttachments() {
|
|
|
17239
16981
|
try {
|
|
17240
16982
|
sniffed = await _filetype.fileTypeFromBlob.call(void 0, att.file);
|
|
17241
16983
|
} catch (err) {
|
|
17242
|
-
if (_optionalChain([ctrl, 'optionalAccess',
|
|
16984
|
+
if (_optionalChain([ctrl, 'optionalAccess', _547 => _547.signal, 'access', _548 => _548.aborted])) return;
|
|
17243
16985
|
throw new Error(`Could not read file content: ${err instanceof Error ? err.message : String(err)}`);
|
|
17244
16986
|
}
|
|
17245
|
-
if (_optionalChain([ctrl, 'optionalAccess',
|
|
16987
|
+
if (_optionalChain([ctrl, 'optionalAccess', _549 => _549.signal, 'access', _550 => _550.aborted])) return;
|
|
17246
16988
|
if (!sniffed) {
|
|
17247
16989
|
throw new Error("Unrecognized file format");
|
|
17248
16990
|
}
|
|
@@ -17256,7 +16998,7 @@ function useChatAttachments() {
|
|
|
17256
16998
|
const urlResp = await _chunkCP6TIRONcjs.embedAuthedFetch.call(void 0, uploadUrlEndpoint, {
|
|
17257
16999
|
method: "POST",
|
|
17258
17000
|
headers: { "Content-Type": "application/json" },
|
|
17259
|
-
signal: _optionalChain([ctrl, 'optionalAccess',
|
|
17001
|
+
signal: _optionalChain([ctrl, 'optionalAccess', _551 => _551.signal]),
|
|
17260
17002
|
body: JSON.stringify({
|
|
17261
17003
|
fileName: att.file.name,
|
|
17262
17004
|
// Pass the SNIFFED MIME (not `file.type`, which can be a
|
|
@@ -17285,9 +17027,9 @@ function useChatAttachments() {
|
|
|
17285
17027
|
(pct) => {
|
|
17286
17028
|
updateOne(att.id, { progress: pct });
|
|
17287
17029
|
},
|
|
17288
|
-
_optionalChain([ctrl, 'optionalAccess',
|
|
17030
|
+
_optionalChain([ctrl, 'optionalAccess', _552 => _552.signal])
|
|
17289
17031
|
);
|
|
17290
|
-
if (_optionalChain([ctrl, 'optionalAccess',
|
|
17032
|
+
if (_optionalChain([ctrl, 'optionalAccess', _553 => _553.signal, 'access', _554 => _554.aborted])) return;
|
|
17291
17033
|
updateOne(att.id, {
|
|
17292
17034
|
status: "ready",
|
|
17293
17035
|
progress: 100,
|
|
@@ -17295,7 +17037,7 @@ function useChatAttachments() {
|
|
|
17295
17037
|
viewToken: mintData.viewToken
|
|
17296
17038
|
});
|
|
17297
17039
|
} catch (err) {
|
|
17298
|
-
if (_optionalChain([ctrl, 'optionalAccess',
|
|
17040
|
+
if (_optionalChain([ctrl, 'optionalAccess', _555 => _555.signal, 'access', _556 => _556.aborted])) return;
|
|
17299
17041
|
const message = err instanceof Error ? err.message : String(err);
|
|
17300
17042
|
updateOne(att.id, { status: "error", progress: 0, errorMessage: message });
|
|
17301
17043
|
} finally {
|
|
@@ -17444,11 +17186,11 @@ var ANON_DEFAULTS = {
|
|
|
17444
17186
|
function useResolveChatIdentity(enabled) {
|
|
17445
17187
|
const runtime = _chunkRDTOMWDNcjs.useRequiredChatRuntime.call(void 0, );
|
|
17446
17188
|
const url = runtime.endpoints.identityUrl;
|
|
17447
|
-
const proxyEmail = _nullishCoalesce(_optionalChain([_chunkCP6TIRONcjs.getEmbedProxyAuth.call(void 0, ), 'optionalAccess',
|
|
17189
|
+
const proxyEmail = _nullishCoalesce(_optionalChain([_chunkCP6TIRONcjs.getEmbedProxyAuth.call(void 0, ), 'optionalAccess', _557 => _557.email]), () => ( null));
|
|
17448
17190
|
const requestKey = enabled ? `${url}\0${_nullishCoalesce(proxyEmail, () => ( ""))}` : null;
|
|
17449
17191
|
const [resolved, setResolved] = _react.useState.call(void 0, null);
|
|
17450
|
-
const data = _optionalChain([resolved, 'optionalAccess',
|
|
17451
|
-
const isLoading = requestKey !== null && _optionalChain([resolved, 'optionalAccess',
|
|
17192
|
+
const data = _optionalChain([resolved, 'optionalAccess', _558 => _558.key]) === requestKey ? resolved.data : ANON_DEFAULTS;
|
|
17193
|
+
const isLoading = requestKey !== null && _optionalChain([resolved, 'optionalAccess', _559 => _559.key]) !== requestKey;
|
|
17452
17194
|
_react.useEffect.call(void 0, () => {
|
|
17453
17195
|
if (requestKey === null) return void 0;
|
|
17454
17196
|
let cancelled = false;
|
|
@@ -17595,7 +17337,7 @@ function useChat({
|
|
|
17595
17337
|
onMessagesChangeRef.current = onMessagesChange;
|
|
17596
17338
|
});
|
|
17597
17339
|
_react.useEffect.call(void 0, () => {
|
|
17598
|
-
_optionalChain([onMessagesChangeRef, 'access',
|
|
17340
|
+
_optionalChain([onMessagesChangeRef, 'access', _560 => _560.current, 'optionalCall', _561 => _561(messages)]);
|
|
17599
17341
|
}, [messages]);
|
|
17600
17342
|
const {
|
|
17601
17343
|
streamMessage,
|
|
@@ -17632,7 +17374,7 @@ function useChat({
|
|
|
17632
17374
|
name: "You",
|
|
17633
17375
|
content: text,
|
|
17634
17376
|
timestamp: /* @__PURE__ */ new Date(),
|
|
17635
|
-
..._optionalChain([options, 'optionalAccess',
|
|
17377
|
+
..._optionalChain([options, 'optionalAccess', _562 => _562.hidden]) ? { hidden: true } : {}
|
|
17636
17378
|
};
|
|
17637
17379
|
addMessage(userMessage);
|
|
17638
17380
|
setIsTyping(true);
|
|
@@ -17846,8 +17588,8 @@ function buildConfirmToolBody(request) {
|
|
|
17846
17588
|
async function readServerErrorMessage(response) {
|
|
17847
17589
|
try {
|
|
17848
17590
|
const body = await response.json();
|
|
17849
|
-
if (typeof _optionalChain([body, 'optionalAccess',
|
|
17850
|
-
} catch (
|
|
17591
|
+
if (typeof _optionalChain([body, 'optionalAccess', _563 => _563.error]) === "string" && body.error.length > 0) return body.error;
|
|
17592
|
+
} catch (e58) {
|
|
17851
17593
|
}
|
|
17852
17594
|
return null;
|
|
17853
17595
|
}
|
|
@@ -18018,7 +17760,7 @@ function createSseFrameDecoder() {
|
|
|
18018
17760
|
let meta;
|
|
18019
17761
|
try {
|
|
18020
17762
|
meta = JSON.parse(metaStr);
|
|
18021
|
-
} catch (
|
|
17763
|
+
} catch (e59) {
|
|
18022
17764
|
inText = true;
|
|
18023
17765
|
out.push({ type: "turn-start", implicit: true });
|
|
18024
17766
|
if (buffer.length > 0) {
|
|
@@ -18072,7 +17814,7 @@ function createSseFrameDecoder() {
|
|
|
18072
17814
|
debug: meta.debug
|
|
18073
17815
|
});
|
|
18074
17816
|
}
|
|
18075
|
-
} catch (
|
|
17817
|
+
} catch (e60) {
|
|
18076
17818
|
}
|
|
18077
17819
|
}
|
|
18078
17820
|
return out;
|
|
@@ -18104,7 +17846,7 @@ function errorDetailsMessage(details) {
|
|
|
18104
17846
|
let parsed;
|
|
18105
17847
|
try {
|
|
18106
17848
|
parsed = JSON.parse(details);
|
|
18107
|
-
} catch (
|
|
17849
|
+
} catch (e61) {
|
|
18108
17850
|
return details;
|
|
18109
17851
|
}
|
|
18110
17852
|
if (typeof parsed !== "object" || parsed === null) return void 0;
|
|
@@ -18120,23 +17862,6 @@ function approvalDisplaysInline(approvalType, displayApprovalTypes) {
|
|
|
18120
17862
|
return !displayApprovalTypes || displayApprovalTypes.includes(approvalType);
|
|
18121
17863
|
}
|
|
18122
17864
|
|
|
18123
|
-
// src/components/chat/utils/chat-source-metadata.ts
|
|
18124
|
-
function mergeChatSources(current, incoming) {
|
|
18125
|
-
const sourcesByIndex = new Map((_nullishCoalesce(current, () => ( []))).map((source) => [source.index, source]));
|
|
18126
|
-
incoming.forEach((source) => {
|
|
18127
|
-
if (!sourcesByIndex.has(source.index)) sourcesByIndex.set(source.index, source);
|
|
18128
|
-
});
|
|
18129
|
-
return Array.from(sourcesByIndex.values());
|
|
18130
|
-
}
|
|
18131
|
-
function mergeChatRefs(current, incoming) {
|
|
18132
|
-
const refsByIdentity = new Map((_nullishCoalesce(current, () => ( []))).map((ref) => [`${ref.type}:${ref.id}`, ref]));
|
|
18133
|
-
incoming.forEach((ref) => {
|
|
18134
|
-
const identity = `${ref.type}:${ref.id}`;
|
|
18135
|
-
if (!refsByIdentity.has(identity)) refsByIdentity.set(identity, ref);
|
|
18136
|
-
});
|
|
18137
|
-
return Array.from(refsByIdentity.values());
|
|
18138
|
-
}
|
|
18139
|
-
|
|
18140
17865
|
// src/components/chat/stream/message-mutations.ts
|
|
18141
17866
|
function nextId(role) {
|
|
18142
17867
|
return `${role}-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`;
|
|
@@ -18191,9 +17916,9 @@ function appendToTrailingAssistant(prev, segments) {
|
|
|
18191
17916
|
for (const seg of segments) {
|
|
18192
17917
|
const tail = merged[merged.length - 1];
|
|
18193
17918
|
const key = upsertKey(seg);
|
|
18194
|
-
if (seg.type === "text" && _optionalChain([tail, 'optionalAccess',
|
|
17919
|
+
if (seg.type === "text" && _optionalChain([tail, 'optionalAccess', _564 => _564.type]) === "text") {
|
|
18195
17920
|
merged[merged.length - 1] = { type: "text", text: tail.text + seg.text };
|
|
18196
|
-
} else if (seg.type === "thinking" && _optionalChain([tail, 'optionalAccess',
|
|
17921
|
+
} else if (seg.type === "thinking" && _optionalChain([tail, 'optionalAccess', _565 => _565.type]) === "thinking") {
|
|
18197
17922
|
merged[merged.length - 1] = { type: "thinking", text: tail.text + seg.text };
|
|
18198
17923
|
} else if (key) {
|
|
18199
17924
|
const idx = merged.findIndex((m) => upsertKey(m) === key);
|
|
@@ -18233,7 +17958,7 @@ function applyApprovalStatusToSegment(s, requestId, status, resolvedByName) {
|
|
|
18233
17958
|
}
|
|
18234
17959
|
if (s.type !== "approval_batch") return s;
|
|
18235
17960
|
const isAnchor = s.data.approvalRequestId === requestId;
|
|
18236
|
-
const hasRow = _optionalChain([s, 'access',
|
|
17961
|
+
const hasRow = _optionalChain([s, 'access', _566 => _566.data, 'access', _567 => _567.toolCalls, 'optionalAccess', _568 => _568.some, 'call', _569 => _569((c) => c.toolExecutionRequestId === requestId)]);
|
|
18237
17962
|
if (!isAnchor && !hasRow) return s;
|
|
18238
17963
|
const nextResolvedBy = _nullishCoalesce(resolvedByName, () => ( s.resolvedByName));
|
|
18239
17964
|
const nextExecutions = hasRow ? {
|
|
@@ -18255,8 +17980,8 @@ function applyApprovalStatusToSegment(s, requestId, status, resolvedByName) {
|
|
|
18255
17980
|
};
|
|
18256
17981
|
}
|
|
18257
17982
|
function nextBatchExecution(prevExec, toolData) {
|
|
18258
|
-
if (toolData.type === "EXECUTING_TOOL" && _optionalChain([prevExec, 'optionalAccess',
|
|
18259
|
-
return toolData.type === "EXECUTED_TOOL" ? { status: "done", result: toolData.result, success: toolData.success } : { status: "executing", result: _optionalChain([prevExec, 'optionalAccess',
|
|
17983
|
+
if (toolData.type === "EXECUTING_TOOL" && _optionalChain([prevExec, 'optionalAccess', _570 => _570.status]) === "done") return null;
|
|
17984
|
+
return toolData.type === "EXECUTED_TOOL" ? { status: "done", result: toolData.result, success: toolData.success } : { status: "executing", result: _optionalChain([prevExec, 'optionalAccess', _571 => _571.result]), success: _optionalChain([prevExec, 'optionalAccess', _572 => _572.success]) };
|
|
18260
17985
|
}
|
|
18261
17986
|
function withBatchExecution(seg, execId, state) {
|
|
18262
17987
|
return {
|
|
@@ -18273,11 +17998,11 @@ function projectBatchStatusToMessages(prev, anchorId, status) {
|
|
|
18273
17998
|
}
|
|
18274
17999
|
function projectBatchRowFailureToMessages(prev, rowRequestId) {
|
|
18275
18000
|
return mapSegments(prev, (s) => {
|
|
18276
|
-
if (s.type !== "approval_batch" || !_optionalChain([s, 'access',
|
|
18001
|
+
if (s.type !== "approval_batch" || !_optionalChain([s, 'access', _573 => _573.data, 'access', _574 => _574.toolCalls, 'optionalAccess', _575 => _575.some, 'call', _576 => _576((c) => c.toolExecutionRequestId === rowRequestId)])) {
|
|
18277
18002
|
return s;
|
|
18278
18003
|
}
|
|
18279
|
-
const existing = _optionalChain([s, 'access',
|
|
18280
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
18004
|
+
const existing = _optionalChain([s, 'access', _577 => _577.data, 'access', _578 => _578.executions, 'optionalAccess', _579 => _579[rowRequestId]]);
|
|
18005
|
+
if (_optionalChain([existing, 'optionalAccess', _580 => _580.status]) === "done") return s;
|
|
18281
18006
|
return withBatchExecution(s, rowRequestId, { status: "done", success: false });
|
|
18282
18007
|
});
|
|
18283
18008
|
}
|
|
@@ -18313,7 +18038,7 @@ function mergeToolExecutionIfPresent(prev, segment) {
|
|
|
18313
18038
|
for (let j = message.segments.length - 1; j >= 0; j--) {
|
|
18314
18039
|
const seg = message.segments[j];
|
|
18315
18040
|
if (execId && seg.type === "approval_batch" && seg.data.toolCalls.some((c) => c.toolExecutionRequestId === execId)) {
|
|
18316
|
-
const prevExec = _optionalChain([seg, 'access',
|
|
18041
|
+
const prevExec = _optionalChain([seg, 'access', _581 => _581.data, 'access', _582 => _582.executions, 'optionalAccess', _583 => _583[execId]]);
|
|
18317
18042
|
const nextExec = nextBatchExecution(prevExec, toolData);
|
|
18318
18043
|
if (nextExec === null) return prev;
|
|
18319
18044
|
if (sameExecutionState(prevExec, nextExec)) return prev;
|
|
@@ -18486,9 +18211,9 @@ var MessageSegmentAccumulator = class {
|
|
|
18486
18211
|
type: "tool_execution",
|
|
18487
18212
|
data: {
|
|
18488
18213
|
...toolData,
|
|
18489
|
-
toolTitle: _nullishCoalesce(_nullishCoalesce(toolData.toolTitle, () => ( _optionalChain([existingExecuting, 'optionalAccess',
|
|
18490
|
-
toolExplanation: _nullishCoalesce(_nullishCoalesce(toolData.toolExplanation, () => ( _optionalChain([existingExecuting, 'optionalAccess',
|
|
18491
|
-
parameters: toolData.parameters || _optionalChain([executingTool, 'optionalAccess',
|
|
18214
|
+
toolTitle: _nullishCoalesce(_nullishCoalesce(toolData.toolTitle, () => ( _optionalChain([existingExecuting, 'optionalAccess', _584 => _584.data, 'access', _585 => _585.toolTitle]))), () => ( _optionalChain([executingTool, 'optionalAccess', _586 => _586.toolTitle]))),
|
|
18215
|
+
toolExplanation: _nullishCoalesce(_nullishCoalesce(toolData.toolExplanation, () => ( _optionalChain([existingExecuting, 'optionalAccess', _587 => _587.data, 'access', _588 => _588.toolExplanation]))), () => ( _optionalChain([executingTool, 'optionalAccess', _589 => _589.toolExplanation]))),
|
|
18216
|
+
parameters: toolData.parameters || _optionalChain([executingTool, 'optionalAccess', _590 => _590.parameters])
|
|
18492
18217
|
}
|
|
18493
18218
|
};
|
|
18494
18219
|
if (existingIndex !== -1) {
|
|
@@ -18512,7 +18237,7 @@ var MessageSegmentAccumulator = class {
|
|
|
18512
18237
|
if (seg.type !== "approval_batch") return seg;
|
|
18513
18238
|
const hasCall = seg.data.toolCalls.some((c) => c.toolExecutionRequestId === execId);
|
|
18514
18239
|
if (!hasCall) return seg;
|
|
18515
|
-
const prev = _optionalChain([seg, 'access',
|
|
18240
|
+
const prev = _optionalChain([seg, 'access', _591 => _591.data, 'access', _592 => _592.executions, 'optionalAccess', _593 => _593[execId]]);
|
|
18516
18241
|
const next = nextBatchExecution(prev, toolData);
|
|
18517
18242
|
matched = true;
|
|
18518
18243
|
if (next === null) return seg;
|
|
@@ -18646,8 +18371,8 @@ var MessageSegmentAccumulator = class {
|
|
|
18646
18371
|
requestId,
|
|
18647
18372
|
{
|
|
18648
18373
|
...pendingApproval,
|
|
18649
|
-
command: _optionalChain([pendingApproval, 'optionalAccess',
|
|
18650
|
-
approvalType: _optionalChain([pendingApproval, 'optionalAccess',
|
|
18374
|
+
command: _optionalChain([pendingApproval, 'optionalAccess', _594 => _594.command]) || "",
|
|
18375
|
+
approvalType: _optionalChain([pendingApproval, 'optionalAccess', _595 => _595.approvalType]) || approvalType
|
|
18651
18376
|
},
|
|
18652
18377
|
status
|
|
18653
18378
|
);
|
|
@@ -18672,9 +18397,9 @@ var MessageSegmentAccumulator = class {
|
|
|
18672
18397
|
type: "escalation_offer",
|
|
18673
18398
|
// The resolved chunk carries no text/origin — a redelivered offer must
|
|
18674
18399
|
// not blank the card the PENDING chunk already painted.
|
|
18675
|
-
data: { offerId, text: text || _optionalChain([existing, 'optionalAccess',
|
|
18400
|
+
data: { offerId, text: text || _optionalChain([existing, 'optionalAccess', _596 => _596.data, 'access', _597 => _597.text]) || "", origin: _nullishCoalesce(origin, () => ( _optionalChain([existing, 'optionalAccess', _598 => _598.data, 'access', _599 => _599.origin]))) },
|
|
18676
18401
|
status,
|
|
18677
|
-
resolvedByName: _nullishCoalesce(resolvedByName, () => ( _optionalChain([existing, 'optionalAccess',
|
|
18402
|
+
resolvedByName: _nullishCoalesce(resolvedByName, () => ( _optionalChain([existing, 'optionalAccess', _600 => _600.resolvedByName]))),
|
|
18678
18403
|
onApprove: this.callbacks.onEscalationApprove,
|
|
18679
18404
|
onReject: this.callbacks.onEscalationReject
|
|
18680
18405
|
};
|
|
@@ -18996,12 +18721,10 @@ function createChatStreamReducer(options = {}) {
|
|
|
18996
18721
|
const sourcesMap = /* @__PURE__ */ new Map();
|
|
18997
18722
|
let sendCount = 0;
|
|
18998
18723
|
let sseCurrentText = "";
|
|
18999
|
-
let pendingSources;
|
|
19000
|
-
let pendingRefs;
|
|
19001
18724
|
let stateCache = null;
|
|
19002
18725
|
function invalidate() {
|
|
19003
18726
|
stateCache = null;
|
|
19004
|
-
_optionalChain([onChange, 'optionalCall',
|
|
18727
|
+
_optionalChain([onChange, 'optionalCall', _601 => _601()]);
|
|
19005
18728
|
}
|
|
19006
18729
|
function getState() {
|
|
19007
18730
|
if (!stateCache) {
|
|
@@ -19017,7 +18740,7 @@ function createChatStreamReducer(options = {}) {
|
|
|
19017
18740
|
return stateCache;
|
|
19018
18741
|
}
|
|
19019
18742
|
function emit(name, ...args) {
|
|
19020
|
-
_optionalChain([onEffect, 'optionalCall',
|
|
18743
|
+
_optionalChain([onEffect, 'optionalCall', _602 => _602({ name, args })]);
|
|
19021
18744
|
}
|
|
19022
18745
|
function setMessagesInternal(next) {
|
|
19023
18746
|
if (next !== messages) {
|
|
@@ -19048,35 +18771,24 @@ function createChatStreamReducer(options = {}) {
|
|
|
19048
18771
|
return [...next.slice(0, -1), { ...last, streamSeq: seq }];
|
|
19049
18772
|
}
|
|
19050
18773
|
function applySegmentsToState(segments, meta) {
|
|
19051
|
-
const seq = _optionalChain([meta, 'optionalAccess',
|
|
19052
|
-
if (_optionalChain([meta, 'optionalAccess',
|
|
18774
|
+
const seq = _optionalChain([meta, 'optionalAccess', _603 => _603.streamSeq]);
|
|
18775
|
+
if (_optionalChain([meta, 'optionalAccess', _604 => _604.append]) && meta.isCompacting) {
|
|
19053
18776
|
setMessagesInternal(stampTrailingAssistantSeq(upsertTrailingCompaction(messages, segments), seq));
|
|
19054
18777
|
return;
|
|
19055
18778
|
}
|
|
19056
|
-
if (_optionalChain([meta, 'optionalAccess',
|
|
18779
|
+
if (_optionalChain([meta, 'optionalAccess', _605 => _605.append])) {
|
|
19057
18780
|
setMessagesInternal(stampTrailingAssistantSeq(appendToTrailingAssistant(messages, segments), seq));
|
|
19058
18781
|
return;
|
|
19059
18782
|
}
|
|
19060
18783
|
setMessagesInternal(stampTrailingAssistantSeq(updateTrailingAssistant(messages, segments), seq));
|
|
19061
18784
|
}
|
|
19062
|
-
function attachPendingSourceMetadata() {
|
|
19063
|
-
if (!pendingSources && !pendingRefs) return;
|
|
19064
|
-
const last = messages[messages.length - 1];
|
|
19065
|
-
if (!last || last.role !== "assistant") return;
|
|
19066
|
-
const next = {
|
|
19067
|
-
...last,
|
|
19068
|
-
...pendingSources ? { sources: pendingSources } : {},
|
|
19069
|
-
...pendingRefs ? { refs: pendingRefs } : {}
|
|
19070
|
-
};
|
|
19071
|
-
setMessagesInternal([...messages.slice(0, -1), next]);
|
|
19072
|
-
}
|
|
19073
18785
|
function applyStreamStartToState() {
|
|
19074
18786
|
setPhaseInternal("streaming");
|
|
19075
18787
|
const adoptTail = adoptTrailingAssistant;
|
|
19076
18788
|
adoptTrailingAssistant = false;
|
|
19077
18789
|
const last = messages[messages.length - 1];
|
|
19078
18790
|
if (!last || last.role !== "assistant" || adoptTail) return;
|
|
19079
|
-
const hasContent = (_nullishCoalesce(_optionalChain([last, 'access',
|
|
18791
|
+
const hasContent = (_nullishCoalesce(_optionalChain([last, 'access', _606 => _606.segments, 'optionalAccess', _607 => _607.length]), () => ( 0))) > 0 || last.content !== "";
|
|
19080
18792
|
if (!hasContent) return;
|
|
19081
18793
|
setMessagesInternal([...messages, { id: nextId("assistant"), role: "assistant", content: "", segments: [] }]);
|
|
19082
18794
|
}
|
|
@@ -19188,8 +18900,6 @@ function createChatStreamReducer(options = {}) {
|
|
|
19188
18900
|
}
|
|
19189
18901
|
switch (event.type) {
|
|
19190
18902
|
case "turn-start": {
|
|
19191
|
-
pendingSources = void 0;
|
|
19192
|
-
pendingRefs = void 0;
|
|
19193
18903
|
isInStream = true;
|
|
19194
18904
|
hasEverStreamed = true;
|
|
19195
18905
|
turnStartedAt = Date.now();
|
|
@@ -19204,14 +18914,6 @@ function createChatStreamReducer(options = {}) {
|
|
|
19204
18914
|
emit("onStreamEnd");
|
|
19205
18915
|
setPhaseInternal("idle");
|
|
19206
18916
|
accumulator.resetSegments();
|
|
19207
|
-
pendingSources = void 0;
|
|
19208
|
-
pendingRefs = void 0;
|
|
19209
|
-
break;
|
|
19210
|
-
}
|
|
19211
|
-
case "sources": {
|
|
19212
|
-
pendingSources = mergeChatSources(pendingSources, event.sources);
|
|
19213
|
-
if (event.refs) pendingRefs = mergeChatRefs(pendingRefs, event.refs);
|
|
19214
|
-
attachPendingSourceMetadata();
|
|
19215
18917
|
break;
|
|
19216
18918
|
}
|
|
19217
18919
|
case "metadata": {
|
|
@@ -19240,12 +18942,10 @@ function createChatStreamReducer(options = {}) {
|
|
|
19240
18942
|
if (isInStream || !hasEverStreamed) {
|
|
19241
18943
|
emitSegments(segments);
|
|
19242
18944
|
applySegmentsToState(segments, withSeqMeta(void 0));
|
|
19243
|
-
attachPendingSourceMetadata();
|
|
19244
18945
|
} else {
|
|
19245
18946
|
const delta = [{ type: kind, text: event.text }];
|
|
19246
18947
|
emitSegments(delta, { append: true });
|
|
19247
18948
|
applySegmentsToState(delta, withSeqMeta({ append: true }));
|
|
19248
|
-
attachPendingSourceMetadata();
|
|
19249
18949
|
}
|
|
19250
18950
|
break;
|
|
19251
18951
|
}
|
|
@@ -19298,13 +18998,13 @@ function createChatStreamReducer(options = {}) {
|
|
|
19298
18998
|
const summary = required ? getCommandText(required) : `Batch of ${toolCalls.length} tool calls`;
|
|
19299
18999
|
pendingEscalated.set(requestId, {
|
|
19300
19000
|
command: summary,
|
|
19301
|
-
explanation: _optionalChain([required, 'optionalAccess',
|
|
19001
|
+
explanation: _optionalChain([required, 'optionalAccess', _608 => _608.toolExplanation]),
|
|
19302
19002
|
approvalType,
|
|
19303
19003
|
toolCalls
|
|
19304
19004
|
});
|
|
19305
19005
|
emit("onEscalatedApproval", requestId, {
|
|
19306
19006
|
command: summary,
|
|
19307
|
-
explanation: _optionalChain([required, 'optionalAccess',
|
|
19007
|
+
explanation: _optionalChain([required, 'optionalAccess', _609 => _609.toolExplanation]),
|
|
19308
19008
|
approvalType
|
|
19309
19009
|
});
|
|
19310
19010
|
break;
|
|
@@ -19688,7 +19388,7 @@ function createChatStreamReducer(options = {}) {
|
|
|
19688
19388
|
const resolveBatch = (status, confirm) => async () => {
|
|
19689
19389
|
setMessagesInternal(projectBatchStatusToMessages(messages, anchorId, status));
|
|
19690
19390
|
for (const id of ids) {
|
|
19691
|
-
const ok = await _optionalChain([confirm, 'optionalCall',
|
|
19391
|
+
const ok = await _optionalChain([confirm, 'optionalCall', _610 => _610(id)]);
|
|
19692
19392
|
if (ok === false) {
|
|
19693
19393
|
setMessagesInternal(projectBatchRowFailureToMessages(messages, id));
|
|
19694
19394
|
}
|
|
@@ -19824,8 +19524,8 @@ function createChatStreamReducer(options = {}) {
|
|
|
19824
19524
|
}
|
|
19825
19525
|
}
|
|
19826
19526
|
}
|
|
19827
|
-
hasEverStreamed = hasEverStreamed || (_nullishCoalesce(_optionalChain([extras, 'optionalAccess',
|
|
19828
|
-
if (_optionalChain([extras, 'optionalAccess',
|
|
19527
|
+
hasEverStreamed = hasEverStreamed || (_nullishCoalesce(_optionalChain([extras, 'optionalAccess', _611 => _611.resumed]), () => ( messages.length > 0)));
|
|
19528
|
+
if (_optionalChain([extras, 'optionalAccess', _612 => _612.agentBusy])) agentBusyState();
|
|
19829
19529
|
invalidate();
|
|
19830
19530
|
}
|
|
19831
19531
|
return {
|
|
@@ -19910,7 +19610,7 @@ function createChatStreamReducer(options = {}) {
|
|
|
19910
19610
|
},
|
|
19911
19611
|
endSseTurn() {
|
|
19912
19612
|
const last = messages[messages.length - 1];
|
|
19913
|
-
if (last && last.role === "assistant" && (_nullishCoalesce(_optionalChain([last, 'access',
|
|
19613
|
+
if (last && last.role === "assistant" && (_nullishCoalesce(_optionalChain([last, 'access', _613 => _613.segments, 'optionalAccess', _614 => _614.length]), () => ( 0))) === 0 && last.content === "") {
|
|
19914
19614
|
messages = messages.slice(0, -1);
|
|
19915
19615
|
}
|
|
19916
19616
|
sseCurrentText = "";
|
|
@@ -20063,10 +19763,10 @@ function createChatDialogStore(options = {}) {
|
|
|
20063
19763
|
if (onEvict) {
|
|
20064
19764
|
const sep = key.indexOf(KEY_SEP);
|
|
20065
19765
|
onEvict(key.slice(0, sep), key.slice(sep + 1), {
|
|
20066
|
-
messages: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess',
|
|
20067
|
-
approvalStatuses: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess',
|
|
20068
|
-
lastAppliedSeq: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess',
|
|
20069
|
-
pendingEchoes: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess',
|
|
19766
|
+
messages: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _615 => _615.state, 'access', _616 => _616.messages]), () => ( EMPTY_STATE.messages)),
|
|
19767
|
+
approvalStatuses: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _617 => _617.state, 'access', _618 => _618.approvalStatuses]), () => ( EMPTY_STATE.approvalStatuses)),
|
|
19768
|
+
lastAppliedSeq: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _619 => _619.getLastAppliedSeq, 'call', _620 => _620()]), () => ( Number.NEGATIVE_INFINITY)),
|
|
19769
|
+
pendingEchoes: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _621 => _621.getPendingEchoes, 'call', _622 => _622()]), () => ( EMPTY_PENDING_ECHOES))
|
|
20070
19770
|
});
|
|
20071
19771
|
}
|
|
20072
19772
|
}
|
|
@@ -20076,12 +19776,12 @@ function createChatDialogStore(options = {}) {
|
|
|
20076
19776
|
const key = keyOf(dialogId, side);
|
|
20077
19777
|
let reducer = reducers.get(key);
|
|
20078
19778
|
if (!reducer) {
|
|
20079
|
-
const base = _nullishCoalesce(_optionalChain([(_nullishCoalesce(createOptions, () => ( defaultCreateOptions))), 'optionalCall',
|
|
19779
|
+
const base = _nullishCoalesce(_optionalChain([(_nullishCoalesce(createOptions, () => ( defaultCreateOptions))), 'optionalCall', _623 => _623(dialogId, side)]), () => ( {}));
|
|
20080
19780
|
const userOnChange = base.onChange;
|
|
20081
19781
|
reducer = createChatStreamReducer({
|
|
20082
19782
|
...base,
|
|
20083
19783
|
onChange: () => {
|
|
20084
|
-
_optionalChain([userOnChange, 'optionalCall',
|
|
19784
|
+
_optionalChain([userOnChange, 'optionalCall', _624 => _624()]);
|
|
20085
19785
|
notify();
|
|
20086
19786
|
}
|
|
20087
19787
|
});
|
|
@@ -20126,7 +19826,7 @@ function createChatDialogStore(options = {}) {
|
|
|
20126
19826
|
};
|
|
20127
19827
|
}
|
|
20128
19828
|
function getSnapshot2(dialogId, side = DEFAULT_DIALOG_SIDE) {
|
|
20129
|
-
return _nullishCoalesce(_optionalChain([reducers, 'access',
|
|
19829
|
+
return _nullishCoalesce(_optionalChain([reducers, 'access', _625 => _625.get, 'call', _626 => _626(keyOf(dialogId, side)), 'optionalAccess', _627 => _627.state]), () => ( EMPTY_STATE));
|
|
20130
19830
|
}
|
|
20131
19831
|
function getServerSnapshot2() {
|
|
20132
19832
|
return EMPTY_STATE;
|
|
@@ -20218,7 +19918,7 @@ function createDeltaBatcher({
|
|
|
20218
19918
|
pending = [];
|
|
20219
19919
|
const key = pendingKey;
|
|
20220
19920
|
for (const delta of batch) applyOne(delta, key);
|
|
20221
|
-
_optionalChain([onFlushed, 'optionalCall',
|
|
19921
|
+
_optionalChain([onFlushed, 'optionalCall', _628 => _628(batch.length)]);
|
|
20222
19922
|
}
|
|
20223
19923
|
function schedule() {
|
|
20224
19924
|
if (raf !== null || timer !== null) return;
|
|
@@ -20242,7 +19942,7 @@ function createDeltaBatcher({
|
|
|
20242
19942
|
}
|
|
20243
19943
|
if (!isDeltaEvent(event)) return false;
|
|
20244
19944
|
const tail = pending[pending.length - 1];
|
|
20245
|
-
const seqAdvances = _optionalChain([tail, 'optionalAccess',
|
|
19945
|
+
const seqAdvances = _optionalChain([tail, 'optionalAccess', _629 => _629.seq]) == null ? event.seq == null : event.seq != null && event.seq > tail.seq;
|
|
20246
19946
|
if (tail && seqAdvances && tail.type === event.type && (tail.type !== "text-delta" || tail.leading === event.leading)) {
|
|
20247
19947
|
pending[pending.length - 1] = {
|
|
20248
19948
|
...tail,
|
|
@@ -20273,7 +19973,7 @@ function useChatStreamReducer({
|
|
|
20273
19973
|
side = DEFAULT_DIALOG_SIDE,
|
|
20274
19974
|
createReducerOptions
|
|
20275
19975
|
}) {
|
|
20276
|
-
const reducer = store.getReducer(dialogId, side, () => _nullishCoalesce(_optionalChain([createReducerOptions, 'optionalCall',
|
|
19976
|
+
const reducer = store.getReducer(dialogId, side, () => _nullishCoalesce(_optionalChain([createReducerOptions, 'optionalCall', _630 => _630()]), () => ( {})));
|
|
20277
19977
|
const getSnapshot2 = _react.useCallback.call(void 0, () => store.getSnapshot(dialogId, side), [store, dialogId, side]);
|
|
20278
19978
|
const getServerSnapshot2 = _react.useCallback.call(void 0, () => store.getServerSnapshot(), [store]);
|
|
20279
19979
|
const subscribe2 = _react.useCallback.call(void 0, (listener) => store.subscribe(listener), [store]);
|
|
@@ -20312,7 +20012,7 @@ var STORAGE_KEY = "conversation";
|
|
|
20312
20012
|
var namespaceFor = (source) => {
|
|
20313
20013
|
const base = `mingo-chat-${source}`;
|
|
20314
20014
|
const auth = _chunkCP6TIRONcjs.getEmbedProxyAuth.call(void 0, );
|
|
20315
|
-
return _optionalChain([auth, 'optionalAccess',
|
|
20015
|
+
return _optionalChain([auth, 'optionalAccess', _631 => _631.email]) ? `${base}-u-${encodeURIComponent(auth.email.toLowerCase())}` : base;
|
|
20316
20016
|
};
|
|
20317
20017
|
function createChatConversationStorage(source) {
|
|
20318
20018
|
return _chunkCP6TIRONcjs.createLocalStorageAdapter.call(void 0, {
|
|
@@ -20340,7 +20040,7 @@ function pruneStaleChatConversationStorage(source) {
|
|
|
20340
20040
|
for (const k of toRemove) {
|
|
20341
20041
|
window.localStorage.removeItem(k);
|
|
20342
20042
|
}
|
|
20343
|
-
} catch (
|
|
20043
|
+
} catch (e62) {
|
|
20344
20044
|
}
|
|
20345
20045
|
}
|
|
20346
20046
|
|
|
@@ -20376,7 +20076,7 @@ function formatSingularLookupInvocation(cmdId, value) {
|
|
|
20376
20076
|
return safe ? `/${cmdId} "${safe}"` : `/${cmdId}`;
|
|
20377
20077
|
}
|
|
20378
20078
|
function extractEntityIdFilter(override, expectedTableId) {
|
|
20379
|
-
const f = _optionalChain([override, 'optionalAccess',
|
|
20079
|
+
const f = _optionalChain([override, 'optionalAccess', _632 => _632.entityIdFilter]);
|
|
20380
20080
|
if (!f) return null;
|
|
20381
20081
|
const tableId = typeof f.tableId === "string" ? f.tableId : "";
|
|
20382
20082
|
const id = typeof f.id === "string" ? f.id : "";
|
|
@@ -20415,7 +20115,7 @@ var AUTO_CONTINUATION_DIRECTIVE_PREFIX = "[internal-auto-continuation]";
|
|
|
20415
20115
|
function buildAutoContinuationDirective(toolName, opts = {}) {
|
|
20416
20116
|
const ticketRef = opts.ticketId ? ` (ticket #${opts.ticketId})` : "";
|
|
20417
20117
|
const ticketHash = opts.ticketId ? ` #${opts.ticketId}` : "";
|
|
20418
|
-
const isClose = toolName === "update_ticket" && _optionalChain([opts, 'access',
|
|
20118
|
+
const isClose = toolName === "update_ticket" && _optionalChain([opts, 'access', _633 => _633.status, 'optionalAccess', _634 => _634.toUpperCase, 'call', _635 => _635()]) === "CLOSED";
|
|
20419
20119
|
if (toolName === "create_ticket") {
|
|
20420
20120
|
return `${AUTO_CONTINUATION_DIRECTIVE_PREFIX} The user just approved create_ticket${ticketRef}. Per ticket-protocol \xA71a, ask 2-4 SHORT, issue-specific diagnostic follow-up questions tailored to the symptom they reported in their original message. When they answer, propose an update_ticket with content_addendum carrying a clean Q&A digest. Do NOT call any tool in this turn \u2014 just write the questions as prose.`;
|
|
20421
20121
|
}
|
|
@@ -20487,7 +20187,7 @@ function useChatHistoryHydration({
|
|
|
20487
20187
|
sendCountRef.current = userTurns;
|
|
20488
20188
|
hydrateMessages(hydrated, Array.from(sourcesSeed.entries()));
|
|
20489
20189
|
bumpMetaTick();
|
|
20490
|
-
} catch (
|
|
20190
|
+
} catch (e63) {
|
|
20491
20191
|
} finally {
|
|
20492
20192
|
if (!cancelled) setIsHydratingHistory(false);
|
|
20493
20193
|
}
|
|
@@ -20538,7 +20238,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
20538
20238
|
const { active = true } = runtimeOptions;
|
|
20539
20239
|
const runtime = _chunkRDTOMWDNcjs.useRequiredChatRuntime.call(void 0, );
|
|
20540
20240
|
const source = runtime.source || DEFAULT_CHAT_SOURCE;
|
|
20541
|
-
const tableIdForDocumentType = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
20241
|
+
const tableIdForDocumentType = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _636 => _636.tableIdForDocumentType]), () => ( defaultTableIdForDocumentType));
|
|
20542
20242
|
const sendMessageRef = _react.useRef.call(void 0,
|
|
20543
20243
|
() => Promise.resolve(true)
|
|
20544
20244
|
);
|
|
@@ -20575,7 +20275,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
20575
20275
|
if (!restoredConversationRef.current) {
|
|
20576
20276
|
restoredConversationRef.current = true;
|
|
20577
20277
|
pruneStaleChatConversationStorage(source);
|
|
20578
|
-
conversationIdRef.current = _nullishCoalesce(_optionalChain([conversationStorage, 'access',
|
|
20278
|
+
conversationIdRef.current = _nullishCoalesce(_optionalChain([conversationStorage, 'access', _637 => _637.load, 'call', _638 => _638(), 'optionalAccess', _639 => _639.conversationId]), () => ( null));
|
|
20579
20279
|
}
|
|
20580
20280
|
const commandsUrl = runtime.endpoints.commandsUrl;
|
|
20581
20281
|
const { commands: slashCommands } = useSlashCommandRegistry(commandsUrl, {
|
|
@@ -20680,7 +20380,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
20680
20380
|
const serverMessage = await readServerErrorMessage(response);
|
|
20681
20381
|
throw new Error(_nullishCoalesce(serverMessage, () => ( `Chat request failed: ${response.status}`)));
|
|
20682
20382
|
}
|
|
20683
|
-
const reader = _optionalChain([response, 'access',
|
|
20383
|
+
const reader = _optionalChain([response, 'access', _640 => _640.body, 'optionalAccess', _641 => _641.getReader, 'call', _642 => _642()]);
|
|
20684
20384
|
if (!reader) throw new Error("No response body");
|
|
20685
20385
|
const frameDecoder = createSseFrameDecoder();
|
|
20686
20386
|
let finished = false;
|
|
@@ -20703,7 +20403,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
20703
20403
|
}
|
|
20704
20404
|
return true;
|
|
20705
20405
|
} catch (err) {
|
|
20706
|
-
if (_optionalChain([err, 'optionalAccess',
|
|
20406
|
+
if (_optionalChain([err, 'optionalAccess', _643 => _643.name]) === "AbortError" || ctrl.signal.aborted) {
|
|
20707
20407
|
return true;
|
|
20708
20408
|
}
|
|
20709
20409
|
flushDeltas();
|
|
@@ -20723,7 +20423,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
20723
20423
|
);
|
|
20724
20424
|
sendMessageRef.current = sendMessage;
|
|
20725
20425
|
const stopMessage = _react.useCallback.call(void 0, () => {
|
|
20726
|
-
_optionalChain([abortControllerRef, 'access',
|
|
20426
|
+
_optionalChain([abortControllerRef, 'access', _644 => _644.current, 'optionalAccess', _645 => _645.abort, 'call', _646 => _646()]);
|
|
20727
20427
|
flushDeltas();
|
|
20728
20428
|
mutate((r) => r.setPhase("idle"));
|
|
20729
20429
|
}, [mutate, flushDeltas]);
|
|
@@ -20739,7 +20439,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
20739
20439
|
let sendIdx = -1;
|
|
20740
20440
|
return state.messages.map((m) => {
|
|
20741
20441
|
const segments = m.segments;
|
|
20742
|
-
const content = typeof m.content === "string" && !segments ? m.content : _nullishCoalesce(_optionalChain([segments, 'optionalAccess',
|
|
20442
|
+
const content = typeof m.content === "string" && !segments ? m.content : _nullishCoalesce(_optionalChain([segments, 'optionalAccess', _647 => _647.filter, 'call', _648 => _648((s) => s.type === "text"), 'access', _649 => _649.map, 'call', _650 => _650((s) => s.text), 'access', _651 => _651.join, 'call', _652 => _652("")]), () => ( ""));
|
|
20743
20443
|
let sources;
|
|
20744
20444
|
let scrollAnchor;
|
|
20745
20445
|
if (m.role === "user" && !m.hidden) {
|
|
@@ -20748,7 +20448,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
20748
20448
|
if (m.role === "assistant") {
|
|
20749
20449
|
const lookupIdx = sendIdx >= 0 ? sendIdx : 0;
|
|
20750
20450
|
sources = sourcesMap.get(lookupIdx);
|
|
20751
|
-
scrollAnchor = _nullishCoalesce(_optionalChain([meta, 'access',
|
|
20451
|
+
scrollAnchor = _nullishCoalesce(_optionalChain([meta, 'access', _653 => _653.get, 'call', _654 => _654(lookupIdx), 'optionalAccess', _655 => _655.scrollAnchor]), () => ( void 0));
|
|
20752
20452
|
}
|
|
20753
20453
|
return {
|
|
20754
20454
|
id: m.id,
|
|
@@ -20775,7 +20475,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
20775
20475
|
);
|
|
20776
20476
|
return;
|
|
20777
20477
|
}
|
|
20778
|
-
const refSlug = typeof _optionalChain([reference, 'access',
|
|
20478
|
+
const refSlug = typeof _optionalChain([reference, 'access', _656 => _656.metadata, 'optionalAccess', _657 => _657.slug]) === "string" && reference.metadata.slug.length > 0 ? reference.metadata.slug : "";
|
|
20779
20479
|
const queryValue = refSlug || sanitizeTitleForChat(reference.title) || reference.id;
|
|
20780
20480
|
const escaped = queryValue.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
20781
20481
|
const text = `/${cmdId} display "${escaped}"`;
|
|
@@ -20821,18 +20521,18 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
20821
20521
|
/** True while the mount-time rebuild from the server transcript runs. */
|
|
20822
20522
|
isHydratingHistory,
|
|
20823
20523
|
/** Provider key for the lib's `<ModelDisplay>` icon. */
|
|
20824
|
-
currentProvider: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess',
|
|
20825
|
-
currentModelLabel: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess',
|
|
20826
|
-
currentContextWindowMaxTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess',
|
|
20524
|
+
currentProvider: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _658 => _658.provider]), () => ( null)),
|
|
20525
|
+
currentModelLabel: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _659 => _659.modelLabel]), () => ( null)),
|
|
20526
|
+
currentContextWindowMaxTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _660 => _660.contextWindowMaxTokens]), () => ( null)),
|
|
20827
20527
|
/** Input tokens (known after server's message_start frame; null until). */
|
|
20828
|
-
currentInputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess',
|
|
20528
|
+
currentInputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _661 => _661.inputTokens]), () => ( null)),
|
|
20829
20529
|
/** Output tokens (known only after server's trailing usage frame). */
|
|
20830
|
-
currentOutputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess',
|
|
20530
|
+
currentOutputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _662 => _662.outputTokens]), () => ( null)),
|
|
20831
20531
|
/** Cache hit % (read / total-input × 100). null during streaming. */
|
|
20832
|
-
currentCacheHitRatePct: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess',
|
|
20532
|
+
currentCacheHitRatePct: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _663 => _663.cacheHitRatePct]), () => ( null)),
|
|
20833
20533
|
/** Cross-call usage breakdown (Haiku rewriter/classifier/summarizer
|
|
20834
20534
|
* token counts). null until the trailing usage frame lands. */
|
|
20835
|
-
currentUsageBreakdown: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess',
|
|
20535
|
+
currentUsageBreakdown: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _664 => _664.breakdown]), () => ( null)),
|
|
20836
20536
|
// ─── Dialog management — stubs for v1 ────────────────────────────────
|
|
20837
20537
|
// Guide mode keeps ONE server-side conversation per stored id
|
|
20838
20538
|
// (`chat_conversations`, hydrated on mount). Surfacing multiple threads
|
|
@@ -20933,11 +20633,6 @@ function decodeNatsChunk(chunk) {
|
|
|
20933
20633
|
return { type: "thinking-delta", text: data.text, ...seq };
|
|
20934
20634
|
}
|
|
20935
20635
|
return null;
|
|
20936
|
-
case MESSAGE_TYPE.GUIDE:
|
|
20937
|
-
case MESSAGE_TYPE.SOURCES: {
|
|
20938
|
-
const event = sourceMetadataEvent(data.payload);
|
|
20939
|
-
return event ? { ...event, ...seq } : null;
|
|
20940
|
-
}
|
|
20941
20636
|
// An ask card is only an ask card with something to pick: a question and at
|
|
20942
20637
|
// least one option. Anything less is dropped rather than rendered as an
|
|
20943
20638
|
// empty card the user can't answer — the backend already falls back to a
|
|
@@ -21082,7 +20777,7 @@ function decodeNatsChunk(chunk) {
|
|
|
21082
20777
|
userId: typeof data.userId === "string" ? data.userId : void 0,
|
|
21083
20778
|
// Wire shape carries no label; fall back to the id (parity with
|
|
21084
20779
|
// the history path in `process-historical-messages.ts`).
|
|
21085
|
-
contextItems: Array.isArray(data.contextItems) ? data.contextItems.filter((it) => typeof _optionalChain([it, 'optionalAccess',
|
|
20780
|
+
contextItems: Array.isArray(data.contextItems) ? data.contextItems.filter((it) => typeof _optionalChain([it, 'optionalAccess', _665 => _665.type]) === "string" && typeof _optionalChain([it, 'optionalAccess', _666 => _666.id]) === "string").map((it) => ({
|
|
21086
20781
|
type: it.type,
|
|
21087
20782
|
id: it.id,
|
|
21088
20783
|
label: it.id
|
|
@@ -21173,7 +20868,7 @@ function extractIncompleteMessageState(lastMessage) {
|
|
|
21173
20868
|
}
|
|
21174
20869
|
break;
|
|
21175
20870
|
case "approval_batch": {
|
|
21176
|
-
const allDone = !!segment.data.executions && segment.data.toolCalls.every((c) => _optionalChain([segment, 'access',
|
|
20871
|
+
const allDone = !!segment.data.executions && segment.data.toolCalls.every((c) => _optionalChain([segment, 'access', _667 => _667.data, 'access', _668 => _668.executions, 'optionalAccess', _669 => _669[c.toolExecutionRequestId], 'optionalAccess', _670 => _670.status]) === "done");
|
|
21177
20872
|
if (segment.status !== "rejected" && !allDone) {
|
|
21178
20873
|
hasIncompleteState = true;
|
|
21179
20874
|
}
|
|
@@ -21235,11 +20930,11 @@ function extractIncompleteMessageState(lastMessage) {
|
|
|
21235
20930
|
function extractIncompleteTailState(messages) {
|
|
21236
20931
|
if (!messages || messages.length === 0) return void 0;
|
|
21237
20932
|
let start = messages.length;
|
|
21238
|
-
while (start > 0 && _optionalChain([messages, 'access',
|
|
20933
|
+
while (start > 0 && _optionalChain([messages, 'access', _671 => _671[start - 1], 'optionalAccess', _672 => _672.role]) === "assistant") start -= 1;
|
|
21239
20934
|
if (start === messages.length) return void 0;
|
|
21240
20935
|
const segments = [];
|
|
21241
20936
|
for (let i = start; i < messages.length; i += 1) {
|
|
21242
|
-
const content = _optionalChain([messages, 'access',
|
|
20937
|
+
const content = _optionalChain([messages, 'access', _673 => _673[i], 'optionalAccess', _674 => _674.content]);
|
|
21243
20938
|
if (Array.isArray(content)) segments.push(...content);
|
|
21244
20939
|
}
|
|
21245
20940
|
if (segments.length === 0) return void 0;
|
|
@@ -21252,15 +20947,15 @@ function extractIncompleteTailState(messages) {
|
|
|
21252
20947
|
|
|
21253
20948
|
// src/components/chat/utils/process-historical-messages.ts
|
|
21254
20949
|
function getOwnerDisplayName(owner) {
|
|
21255
|
-
if (_optionalChain([owner, 'optionalAccess',
|
|
20950
|
+
if (_optionalChain([owner, 'optionalAccess', _675 => _675.type]) === OWNER_TYPE.ADMIN && owner.user) {
|
|
21256
20951
|
const { firstName, lastName } = owner.user;
|
|
21257
20952
|
const name = [firstName, lastName].filter(Boolean).join(" ");
|
|
21258
20953
|
if (name) return name;
|
|
21259
20954
|
}
|
|
21260
|
-
return _optionalChain([owner, 'optionalAccess',
|
|
20955
|
+
return _optionalChain([owner, 'optionalAccess', _676 => _676.type]) === OWNER_TYPE.ADMIN ? "Admin" : "You";
|
|
21261
20956
|
}
|
|
21262
20957
|
function getOwnerAvatar(owner) {
|
|
21263
|
-
return _nullishCoalesce(_optionalChain([owner, 'optionalAccess',
|
|
20958
|
+
return _nullishCoalesce(_optionalChain([owner, 'optionalAccess', _677 => _677.user, 'optionalAccess', _678 => _678.image, 'optionalAccess', _679 => _679.imageUrl]), () => ( void 0));
|
|
21264
20959
|
}
|
|
21265
20960
|
function pushStandaloneMessages(processedMessages, msg, messageDataArray) {
|
|
21266
20961
|
messageDataArray.forEach((data) => {
|
|
@@ -21289,9 +20984,6 @@ function decodeHistoricalMessageData(data) {
|
|
|
21289
20984
|
return { type: "thinking-delta", text: data.text };
|
|
21290
20985
|
}
|
|
21291
20986
|
return null;
|
|
21292
|
-
case MESSAGE_TYPE.GUIDE:
|
|
21293
|
-
case MESSAGE_TYPE.SOURCES:
|
|
21294
|
-
return decodeNatsChunk({ type: data.type, payload: data.payload });
|
|
21295
20987
|
// Same completeness gate as the live decoder (`decodeNatsChunk`): a
|
|
21296
20988
|
// persisted row without a question or without options is not a card the
|
|
21297
20989
|
// user can answer, so it replays as nothing rather than as empty chrome.
|
|
@@ -21447,7 +21139,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
|
|
|
21447
21139
|
event.offerId,
|
|
21448
21140
|
event.text,
|
|
21449
21141
|
event.origin,
|
|
21450
|
-
_nullishCoalesce(_optionalChain([escalationOfferStates, 'optionalAccess',
|
|
21142
|
+
_nullishCoalesce(_optionalChain([escalationOfferStates, 'optionalAccess', _680 => _680[event.offerId]]), () => ( "pending"))
|
|
21451
21143
|
);
|
|
21452
21144
|
break;
|
|
21453
21145
|
case "ticket-escalated":
|
|
@@ -21477,7 +21169,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
|
|
|
21477
21169
|
);
|
|
21478
21170
|
break;
|
|
21479
21171
|
case "escalation-offer-resolved":
|
|
21480
|
-
_optionalChain([offerResolutions, 'optionalAccess',
|
|
21172
|
+
_optionalChain([offerResolutions, 'optionalAccess', _681 => _681.set, 'call', _682 => _682(event.offerId, {
|
|
21481
21173
|
status: event.status,
|
|
21482
21174
|
resolvedByName: event.resolvedByName
|
|
21483
21175
|
})]);
|
|
@@ -21541,7 +21233,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
|
|
|
21541
21233
|
}
|
|
21542
21234
|
}
|
|
21543
21235
|
} else {
|
|
21544
|
-
_optionalChain([escalatedApprovals, 'optionalAccess',
|
|
21236
|
+
_optionalChain([escalatedApprovals, 'optionalAccess', _683 => _683.set, 'call', _684 => _684(event.requestId, {
|
|
21545
21237
|
command: event.command || "",
|
|
21546
21238
|
explanation: event.explanation,
|
|
21547
21239
|
approvalType,
|
|
@@ -21556,8 +21248,8 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
|
|
|
21556
21248
|
const existingStatus = approvalStatuses[requestId];
|
|
21557
21249
|
const status = existingStatus || event.status;
|
|
21558
21250
|
const resolvedByName = event.resolvedByName;
|
|
21559
|
-
const escalatedData = _optionalChain([escalatedApprovals, 'optionalAccess',
|
|
21560
|
-
if (_optionalChain([escalatedData, 'optionalAccess',
|
|
21251
|
+
const escalatedData = _optionalChain([escalatedApprovals, 'optionalAccess', _685 => _685.get, 'call', _686 => _686(requestId)]);
|
|
21252
|
+
if (_optionalChain([escalatedData, 'optionalAccess', _687 => _687.toolCalls]) && escalatedData.toolCalls.length > 0) {
|
|
21561
21253
|
if (batchApprovalsEnabled) {
|
|
21562
21254
|
accumulator.addApprovalBatch(
|
|
21563
21255
|
requestId,
|
|
@@ -21579,7 +21271,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
|
|
|
21579
21271
|
);
|
|
21580
21272
|
}
|
|
21581
21273
|
}
|
|
21582
|
-
_optionalChain([escalatedApprovals, 'optionalAccess',
|
|
21274
|
+
_optionalChain([escalatedApprovals, 'optionalAccess', _688 => _688.delete, 'call', _689 => _689(requestId)]);
|
|
21583
21275
|
break;
|
|
21584
21276
|
}
|
|
21585
21277
|
if (escalatedData) {
|
|
@@ -21588,7 +21280,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
|
|
|
21588
21280
|
explanation: escalatedData.explanation,
|
|
21589
21281
|
approvalType: escalatedData.approvalType
|
|
21590
21282
|
});
|
|
21591
|
-
_optionalChain([escalatedApprovals, 'optionalAccess',
|
|
21283
|
+
_optionalChain([escalatedApprovals, 'optionalAccess', _690 => _690.delete, 'call', _691 => _691(requestId)]);
|
|
21592
21284
|
}
|
|
21593
21285
|
const before = accumulator.getSegments();
|
|
21594
21286
|
const after = accumulator.updateApprovalStatus(requestId, status, resolvedByName);
|
|
@@ -21647,8 +21339,6 @@ function processHistoricalMessages(messages, options = {}) {
|
|
|
21647
21339
|
let currentAssistantTimestamp = null;
|
|
21648
21340
|
let lastAssistantId = null;
|
|
21649
21341
|
let currentAssistantStreamSeq;
|
|
21650
|
-
let currentAssistantSources;
|
|
21651
|
-
let currentAssistantRefs;
|
|
21652
21342
|
const flushAssistantMessage = () => {
|
|
21653
21343
|
const idToUse = lastAssistantId || currentAssistantId;
|
|
21654
21344
|
if (idToUse && accumulator.hasContent()) {
|
|
@@ -21661,8 +21351,6 @@ function processHistoricalMessages(messages, options = {}) {
|
|
|
21661
21351
|
authorType: assistantType,
|
|
21662
21352
|
timestamp: currentAssistantTimestamp || /* @__PURE__ */ new Date(),
|
|
21663
21353
|
avatar: assistantAvatar,
|
|
21664
|
-
...currentAssistantSources ? { sources: currentAssistantSources } : {},
|
|
21665
|
-
...currentAssistantRefs ? { refs: currentAssistantRefs } : {},
|
|
21666
21354
|
...currentAssistantStreamSeq !== void 0 ? { streamSeq: currentAssistantStreamSeq } : {}
|
|
21667
21355
|
});
|
|
21668
21356
|
accumulator.resetSegments();
|
|
@@ -21671,8 +21359,6 @@ function processHistoricalMessages(messages, options = {}) {
|
|
|
21671
21359
|
currentAssistantTimestamp = null;
|
|
21672
21360
|
lastAssistantId = null;
|
|
21673
21361
|
currentAssistantStreamSeq = void 0;
|
|
21674
|
-
currentAssistantSources = void 0;
|
|
21675
|
-
currentAssistantRefs = void 0;
|
|
21676
21362
|
};
|
|
21677
21363
|
messages.forEach((msg, index) => {
|
|
21678
21364
|
if (chatTypeFilter && msg.chatType !== chatTypeFilter) return;
|
|
@@ -21683,14 +21369,14 @@ function processHistoricalMessages(messages, options = {}) {
|
|
|
21683
21369
|
pushStandaloneMessages(processedMessages, msg, messageDataArray);
|
|
21684
21370
|
return;
|
|
21685
21371
|
}
|
|
21686
|
-
const isUserMessage = _optionalChain([msg, 'access',
|
|
21372
|
+
const isUserMessage = _optionalChain([msg, 'access', _692 => _692.owner, 'optionalAccess', _693 => _693.type]) === OWNER_TYPE.CLIENT || _optionalChain([msg, 'access', _694 => _694.owner, 'optionalAccess', _695 => _695.type]) === OWNER_TYPE.ADMIN;
|
|
21687
21373
|
if (isUserMessage) {
|
|
21688
21374
|
flushAssistantMessage();
|
|
21689
|
-
const userAuthorType = _optionalChain([msg, 'access',
|
|
21375
|
+
const userAuthorType = _optionalChain([msg, 'access', _696 => _696.owner, 'optionalAccess', _697 => _697.type]) === OWNER_TYPE.ADMIN ? "admin" : "user";
|
|
21690
21376
|
messageDataArray.forEach((data) => {
|
|
21691
21377
|
if (data.type === MESSAGE_TYPE.TEXT && "text" in data && data.text) {
|
|
21692
21378
|
const rawContext = data.contextItems;
|
|
21693
|
-
const contextItems = Array.isArray(rawContext) ? rawContext.filter((c) => typeof _optionalChain([c, 'optionalAccess',
|
|
21379
|
+
const contextItems = Array.isArray(rawContext) ? rawContext.filter((c) => typeof _optionalChain([c, 'optionalAccess', _698 => _698.type]) === "string" && typeof _optionalChain([c, 'optionalAccess', _699 => _699.id]) === "string").map((c) => ({ type: c.type, id: c.id, label: c.id })) : void 0;
|
|
21694
21380
|
processedMessages.push({
|
|
21695
21381
|
id: msg.id,
|
|
21696
21382
|
role: "user",
|
|
@@ -21716,11 +21402,6 @@ function processHistoricalMessages(messages, options = {}) {
|
|
|
21716
21402
|
messageDataArray.forEach((data) => {
|
|
21717
21403
|
const event = decodeHistoricalMessageData(data);
|
|
21718
21404
|
if (!event) return;
|
|
21719
|
-
if (event.type === "sources") {
|
|
21720
|
-
currentAssistantSources = mergeChatSources(currentAssistantSources, event.sources);
|
|
21721
|
-
if (event.refs) currentAssistantRefs = mergeChatRefs(currentAssistantRefs, event.refs);
|
|
21722
|
-
return;
|
|
21723
|
-
}
|
|
21724
21405
|
applyHistoryEvent(
|
|
21725
21406
|
event,
|
|
21726
21407
|
accumulator,
|
|
@@ -21733,7 +21414,7 @@ function processHistoricalMessages(messages, options = {}) {
|
|
|
21733
21414
|
});
|
|
21734
21415
|
const nextMsg = messages[index + 1];
|
|
21735
21416
|
const isLastMessage = index === messages.length - 1;
|
|
21736
|
-
const nextIsFromUser = nextMsg && (_optionalChain([nextMsg, 'access',
|
|
21417
|
+
const nextIsFromUser = nextMsg && (_optionalChain([nextMsg, 'access', _700 => _700.owner, 'optionalAccess', _701 => _701.type]) === OWNER_TYPE.CLIENT || _optionalChain([nextMsg, 'access', _702 => _702.owner, 'optionalAccess', _703 => _703.type]) === OWNER_TYPE.ADMIN);
|
|
21737
21418
|
if (isLastMessage || nextIsFromUser) {
|
|
21738
21419
|
flushAssistantMessage();
|
|
21739
21420
|
}
|
|
@@ -21813,17 +21494,13 @@ function mapProcessedToUnified(processed) {
|
|
|
21813
21494
|
id: m.id,
|
|
21814
21495
|
role: m.role,
|
|
21815
21496
|
content: "",
|
|
21816
|
-
segments: m.content
|
|
21817
|
-
...m.sources ? { sources: m.sources } : {},
|
|
21818
|
-
...m.refs ? { refs: m.refs } : {}
|
|
21497
|
+
segments: m.content
|
|
21819
21498
|
});
|
|
21820
21499
|
} else {
|
|
21821
21500
|
out.push({
|
|
21822
21501
|
id: m.id,
|
|
21823
21502
|
role: m.role,
|
|
21824
|
-
content: m.content
|
|
21825
|
-
...m.sources ? { sources: m.sources } : {},
|
|
21826
|
-
...m.refs ? { refs: m.refs } : {}
|
|
21503
|
+
content: m.content
|
|
21827
21504
|
});
|
|
21828
21505
|
}
|
|
21829
21506
|
}
|
|
@@ -22135,7 +21812,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
22135
21812
|
}, [active, fetchDialogs, loadDialogsPage]);
|
|
22136
21813
|
const sendMessage = _react.useCallback.call(void 0,
|
|
22137
21814
|
async (text, sendOptions) => {
|
|
22138
|
-
const hidden = _nullishCoalesce(_optionalChain([sendOptions, 'optionalAccess',
|
|
21815
|
+
const hidden = _nullishCoalesce(_optionalChain([sendOptions, 'optionalAccess', _704 => _704.hidden]), () => ( false));
|
|
22139
21816
|
mutate((r) => r.pushOptimisticSend(text, hidden));
|
|
22140
21817
|
await publishUserMessage(text, { hidden, dialogId });
|
|
22141
21818
|
},
|
|
@@ -22281,11 +21958,11 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
22281
21958
|
// Tokens: live `token_usage` frame / dialog snapshot (`dialogTokenUsage`).
|
|
22282
21959
|
// contextWindow uses the dialog's `contextSize` (the "X / Y" denominator,
|
|
22283
21960
|
// matching the /mingo page). cacheHitRate/breakdown are SSE-only → null.
|
|
22284
|
-
currentProvider: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess',
|
|
22285
|
-
currentModelLabel: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess',
|
|
22286
|
-
currentContextWindowMaxTokens: _nullishCoalesce(_nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess',
|
|
22287
|
-
currentInputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess',
|
|
22288
|
-
currentOutputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess',
|
|
21961
|
+
currentProvider: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess', _705 => _705.provider]), () => ( modelProvider)), () => ( null)),
|
|
21962
|
+
currentModelLabel: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess', _706 => _706.modelLabel]), () => ( modelLabel)), () => ( null)),
|
|
21963
|
+
currentContextWindowMaxTokens: _nullishCoalesce(_nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _707 => _707.contextSize]), () => ( _optionalChain([liveModel, 'optionalAccess', _708 => _708.contextWindowMaxTokens]))), () => ( null)),
|
|
21964
|
+
currentInputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _709 => _709.inputTokensSize]), () => ( null)),
|
|
21965
|
+
currentOutputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _710 => _710.outputTokensSize]), () => ( null)),
|
|
22289
21966
|
currentCacheHitRatePct: null,
|
|
22290
21967
|
currentUsageBreakdown: null,
|
|
22291
21968
|
// Dialog management
|
|
@@ -22386,7 +22063,7 @@ function useUnifiedChat(options) {
|
|
|
22386
22063
|
[]
|
|
22387
22064
|
);
|
|
22388
22065
|
const displayRefForward = _react.useCallback.call(void 0,
|
|
22389
|
-
(ref) => _optionalChain([activeStateRef, 'access',
|
|
22066
|
+
(ref) => _optionalChain([activeStateRef, 'access', _711 => _711.current, 'access', _712 => _712.displayRef, 'optionalCall', _713 => _713(ref)]),
|
|
22390
22067
|
[]
|
|
22391
22068
|
);
|
|
22392
22069
|
const displayRef = activeState.displayRef ? displayRefForward : void 0;
|
|
@@ -22396,7 +22073,7 @@ function useUnifiedChat(options) {
|
|
|
22396
22073
|
const renameDialog = _react.useCallback.call(void 0, (id, title) => activeStateRef.current.renameDialog(id, title), []);
|
|
22397
22074
|
const archiveDialog = _react.useCallback.call(void 0, (id) => activeStateRef.current.archiveDialog(id), []);
|
|
22398
22075
|
const loadMoreDialogs = _react.useCallback.call(void 0, () => activeStateRef.current.loadMoreDialogs(), []);
|
|
22399
|
-
const setDialogScope = _react.useCallback.call(void 0, (scope) => _optionalChain([activeStateRef, 'access',
|
|
22076
|
+
const setDialogScope = _react.useCallback.call(void 0, (scope) => _optionalChain([activeStateRef, 'access', _714 => _714.current, 'access', _715 => _715.setDialogScope, 'optionalCall', _716 => _716(scope)]), []);
|
|
22400
22077
|
const reloadDialogs = _react.useCallback.call(void 0, () => activeStateRef.current.reloadDialogs(), []);
|
|
22401
22078
|
const loadMoreMessages = _react.useCallback.call(void 0, () => activeStateRef.current.loadMoreMessages(), []);
|
|
22402
22079
|
const approveRequest = _react.useCallback.call(void 0, (requestId) => activeStateRef.current.approveRequest(requestId), []);
|
|
@@ -22489,19 +22166,19 @@ function turnRequestKeys(content) {
|
|
|
22489
22166
|
if (!Array.isArray(content)) return keys;
|
|
22490
22167
|
for (const seg of content) {
|
|
22491
22168
|
if (seg.type === "tool_execution") {
|
|
22492
|
-
const id = _optionalChain([seg, 'access',
|
|
22169
|
+
const id = _optionalChain([seg, 'access', _717 => _717.data, 'optionalAccess', _718 => _718.toolExecutionRequestId]);
|
|
22493
22170
|
if (id) keys.add(id);
|
|
22494
22171
|
} else if (seg.type === "approval_request") {
|
|
22495
|
-
const id = _optionalChain([seg, 'access',
|
|
22172
|
+
const id = _optionalChain([seg, 'access', _719 => _719.data, 'optionalAccess', _720 => _720.requestId]);
|
|
22496
22173
|
if (id) keys.add(id);
|
|
22497
22174
|
} else if (seg.type === "escalation_offer") {
|
|
22498
|
-
const id = _optionalChain([seg, 'access',
|
|
22175
|
+
const id = _optionalChain([seg, 'access', _721 => _721.data, 'optionalAccess', _722 => _722.offerId]);
|
|
22499
22176
|
if (id) keys.add(id);
|
|
22500
22177
|
} else if (seg.type === "approval_batch") {
|
|
22501
22178
|
const data = seg.data;
|
|
22502
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
22503
|
-
for (const call of _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
22504
|
-
if (_optionalChain([call, 'optionalAccess',
|
|
22179
|
+
if (_optionalChain([data, 'optionalAccess', _723 => _723.approvalRequestId])) keys.add(data.approvalRequestId);
|
|
22180
|
+
for (const call of _nullishCoalesce(_optionalChain([data, 'optionalAccess', _724 => _724.toolCalls]), () => ( []))) {
|
|
22181
|
+
if (_optionalChain([call, 'optionalAccess', _725 => _725.toolExecutionRequestId])) keys.add(call.toolExecutionRequestId);
|
|
22505
22182
|
}
|
|
22506
22183
|
}
|
|
22507
22184
|
}
|
|
@@ -22553,18 +22230,18 @@ function mergeHistoryWithRealtime(input) {
|
|
|
22553
22230
|
}
|
|
22554
22231
|
}
|
|
22555
22232
|
const trailing = processedHistory[processedHistory.length - 1];
|
|
22556
|
-
const historyTrailingAssistant = _optionalChain([trailing, 'optionalAccess',
|
|
22557
|
-
const historyBatchId = historyTrailingAssistant && Array.isArray(historyTrailingAssistant.content) ? _nullishCoalesce(_optionalChain([historyTrailingAssistant, 'access',
|
|
22233
|
+
const historyTrailingAssistant = _optionalChain([trailing, 'optionalAccess', _726 => _726.role]) === "assistant" ? trailing : null;
|
|
22234
|
+
const historyBatchId = historyTrailingAssistant && Array.isArray(historyTrailingAssistant.content) ? _nullishCoalesce(_optionalChain([historyTrailingAssistant, 'access', _727 => _727.content, 'access', _728 => _728.find, 'call', _729 => _729((s) => s.type === "approval_batch"), 'optionalAccess', _730 => _730.data, 'optionalAccess', _731 => _731.approvalRequestId]), () => ( null)) : null;
|
|
22558
22235
|
let processedToUse = processedHistory;
|
|
22559
22236
|
const pinnedSyntheticIds = /* @__PURE__ */ new Set();
|
|
22560
22237
|
const droppedSyntheticIds = /* @__PURE__ */ new Set();
|
|
22561
22238
|
if (historyBatchId) {
|
|
22562
22239
|
const batchTwins = existingMessages.filter(
|
|
22563
|
-
(m) => m.role === "assistant" && Array.isArray(m.content) && m.content.some((s) => s.type === "approval_batch" && _optionalChain([s, 'access',
|
|
22240
|
+
(m) => m.role === "assistant" && Array.isArray(m.content) && m.content.some((s) => s.type === "approval_batch" && _optionalChain([s, 'access', _732 => _732.data, 'optionalAccess', _733 => _733.approvalRequestId]) === historyBatchId)
|
|
22564
22241
|
);
|
|
22565
22242
|
const existingWithSameBatch = _nullishCoalesce(batchTwins.find((m) => m.id === streamingMessageId), () => ( batchTwins[batchTwins.length - 1]));
|
|
22566
22243
|
if (existingWithSameBatch && Array.isArray(existingWithSameBatch.content)) {
|
|
22567
|
-
const histSize = Array.isArray(_optionalChain([historyTrailingAssistant, 'optionalAccess',
|
|
22244
|
+
const histSize = Array.isArray(_optionalChain([historyTrailingAssistant, 'optionalAccess', _734 => _734.content])) ? historyTrailingAssistant.content.length : 0;
|
|
22568
22245
|
const realtimeSize = existingWithSameBatch.content.length;
|
|
22569
22246
|
if (existingWithSameBatch.id === streamingMessageId || realtimeSize > histSize) {
|
|
22570
22247
|
processedToUse = processedHistory.slice(0, -1);
|
|
@@ -22606,9 +22283,9 @@ function mergeHistoryWithRealtime(input) {
|
|
|
22606
22283
|
if (pinnedSyntheticIds.has(m.id)) return true;
|
|
22607
22284
|
if (droppedSyntheticIds.has(m.id)) return false;
|
|
22608
22285
|
if (processedIds.has(m.id)) return false;
|
|
22609
|
-
if (_optionalChain([rawHistoryIds, 'optionalAccess',
|
|
22286
|
+
if (_optionalChain([rawHistoryIds, 'optionalAccess', _735 => _735.has, 'call', _736 => _736(m.id)])) return false;
|
|
22610
22287
|
if (m.role === "user" && m.id.startsWith("optimistic-") && typeof m.content === "string") {
|
|
22611
|
-
const canBeInSnapshot = (_nullishCoalesce(_optionalChain([m, 'access',
|
|
22288
|
+
const canBeInSnapshot = (_nullishCoalesce(_optionalChain([m, 'access', _737 => _737.timestamp, 'optionalAccess', _738 => _738.getTime, 'call', _739 => _739()]), () => ( 0))) <= historyFetchedAt;
|
|
22612
22289
|
return !(canBeInSnapshot && processedToUse.some((pm) => pm.role === "user" && pm.content === m.content));
|
|
22613
22290
|
}
|
|
22614
22291
|
if (isSyntheticRealtimeId(m.id) && m.id !== streamingMessageId) {
|
|
@@ -22632,7 +22309,7 @@ function mergeHistoryWithRealtime(input) {
|
|
|
22632
22309
|
} else if (typeof m.streamSeq === "number") {
|
|
22633
22310
|
covered = historyMaxStreamSeq > 0 && historyMaxStreamSeq >= m.streamSeq;
|
|
22634
22311
|
} else {
|
|
22635
|
-
covered = historyCoversRealtime !== null ? historyCoversRealtime : (_nullishCoalesce(_optionalChain([m, 'access',
|
|
22312
|
+
covered = historyCoversRealtime !== null ? historyCoversRealtime : (_nullishCoalesce(_optionalChain([m, 'access', _740 => _740.timestamp, 'optionalAccess', _741 => _741.getTime, 'call', _742 => _742()]), () => ( 0))) <= historyFetchedAt;
|
|
22636
22313
|
}
|
|
22637
22314
|
if (covered) return false;
|
|
22638
22315
|
}
|
|
@@ -22702,7 +22379,7 @@ function normalizeHistoricalMessageData(md) {
|
|
|
22702
22379
|
function isHistoricalUserTurn(m) {
|
|
22703
22380
|
return !!m.owner;
|
|
22704
22381
|
}
|
|
22705
|
-
var isTextSegment = (d) => _optionalChain([d, 'optionalAccess',
|
|
22382
|
+
var isTextSegment = (d) => _optionalChain([d, 'optionalAccess', _743 => _743.type]) === "TEXT" && typeof d.text === "string";
|
|
22706
22383
|
var THINK_MS = 550;
|
|
22707
22384
|
var TOKEN_MS = 55;
|
|
22708
22385
|
var USER_MS = 480;
|
|
@@ -22887,7 +22564,7 @@ function useResizableSize({ enabled, isHorizontal, minSize, maxSize, defaultSize
|
|
|
22887
22564
|
const parsed = parseFloat(raw);
|
|
22888
22565
|
if (!Number.isFinite(parsed)) return clampToViewport(defaultSize);
|
|
22889
22566
|
return clampToViewport(parsed);
|
|
22890
|
-
} catch (
|
|
22567
|
+
} catch (e64) {
|
|
22891
22568
|
return clampToViewport(defaultSize);
|
|
22892
22569
|
}
|
|
22893
22570
|
}, [enabled, storageKey, defaultSize, clampToViewport]);
|
|
@@ -22897,7 +22574,7 @@ function useResizableSize({ enabled, isHorizontal, minSize, maxSize, defaultSize
|
|
|
22897
22574
|
if (!enabled || !storageKey || typeof window === "undefined") return;
|
|
22898
22575
|
try {
|
|
22899
22576
|
window.localStorage.setItem(storageKey, String(Math.round(size2)));
|
|
22900
|
-
} catch (
|
|
22577
|
+
} catch (e65) {
|
|
22901
22578
|
}
|
|
22902
22579
|
}, [enabled, size2, storageKey]);
|
|
22903
22580
|
_react.useEffect.call(void 0, () => {
|
|
@@ -22931,7 +22608,7 @@ function DrawerResizeHandle({ side, size: size2, minSize, maxSize, onSize, ariaL
|
|
|
22931
22608
|
startRef.current = null;
|
|
22932
22609
|
try {
|
|
22933
22610
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
22934
|
-
} catch (
|
|
22611
|
+
} catch (e66) {
|
|
22935
22612
|
}
|
|
22936
22613
|
document.body.style.cursor = "";
|
|
22937
22614
|
document.body.style.userSelect = "";
|
|
@@ -23121,7 +22798,6 @@ function HoverDropdown({
|
|
|
23121
22798
|
}) {
|
|
23122
22799
|
const [open, setOpen] = _react.useState.call(void 0, false);
|
|
23123
22800
|
const timeoutRef = _react.useRef.call(void 0, void 0);
|
|
23124
|
-
const clickPinnedRef = _react.useRef.call(void 0, false);
|
|
23125
22801
|
const containerRef = _react.useRef.call(void 0, null);
|
|
23126
22802
|
const panelRef = _react.useRef.call(void 0, null);
|
|
23127
22803
|
_chunkZI27ALYXcjs.useIsomorphicLayoutEffect.call(void 0, () => {
|
|
@@ -23156,15 +22832,12 @@ function HoverDropdown({
|
|
|
23156
22832
|
setOpen(true);
|
|
23157
22833
|
}, []);
|
|
23158
22834
|
const hide = _react.useCallback.call(void 0, () => {
|
|
23159
|
-
if (clickPinnedRef.current) return;
|
|
23160
22835
|
timeoutRef.current = setTimeout(() => setOpen(false), hideDelay);
|
|
23161
22836
|
}, [hideDelay]);
|
|
23162
22837
|
const toggle = _react.useCallback.call(void 0, (e) => {
|
|
23163
22838
|
e.stopPropagation();
|
|
23164
22839
|
clearTimeout(timeoutRef.current);
|
|
23165
|
-
|
|
23166
|
-
clickPinnedRef.current = pinned;
|
|
23167
|
-
setOpen(pinned);
|
|
22840
|
+
setOpen((prev) => !prev);
|
|
23168
22841
|
}, []);
|
|
23169
22842
|
if (items.length === 0) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children });
|
|
23170
22843
|
const renderAnchorFn = _nullishCoalesce(renderAnchor, () => ( DefaultAnchor));
|
|
@@ -23330,7 +23003,7 @@ function useChatDialogManager({
|
|
|
23330
23003
|
const handleConfirmRestore = _react.useCallback.call(void 0, async () => {
|
|
23331
23004
|
if (restoreTarget) {
|
|
23332
23005
|
try {
|
|
23333
|
-
await _optionalChain([unarchiveDialog, 'optionalCall',
|
|
23006
|
+
await _optionalChain([unarchiveDialog, 'optionalCall', _744 => _744(restoreTarget.id)]);
|
|
23334
23007
|
} catch (err) {
|
|
23335
23008
|
console.error("[useChatDialogManager] unarchive failed:", err);
|
|
23336
23009
|
return;
|
|
@@ -23641,34 +23314,21 @@ function SourceChips({
|
|
|
23641
23314
|
}) {
|
|
23642
23315
|
const [expanded, setExpanded] = _react.useState.call(void 0, false);
|
|
23643
23316
|
if (cited.length === 0) {
|
|
23644
|
-
const
|
|
23645
|
-
|
|
23646
|
-
if (visible.length === 0) return null;
|
|
23317
|
+
const fallback = uncited.slice(0, FALLBACK_TOP_RETRIEVED);
|
|
23318
|
+
if (fallback.length === 0) return null;
|
|
23647
23319
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mt-2 flex flex-col gap-1.5 border-t border-ods-border pt-2", children: [
|
|
23648
23320
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "uppercase text-ods-text-muted text-h6", children: "Top retrieved sources" }),
|
|
23649
|
-
/* @__PURE__ */ _jsxruntime.
|
|
23650
|
-
|
|
23651
|
-
|
|
23652
|
-
|
|
23653
|
-
|
|
23654
|
-
|
|
23655
|
-
|
|
23656
|
-
|
|
23657
|
-
|
|
23658
|
-
|
|
23659
|
-
|
|
23660
|
-
)),
|
|
23661
|
-
hiddenCount2 > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
23662
|
-
"button",
|
|
23663
|
-
{
|
|
23664
|
-
onClick: () => setExpanded(!expanded),
|
|
23665
|
-
className: "inline-flex cursor-pointer items-center gap-1 rounded border border-ods-accent bg-ods-card px-2 py-0.5 text-ods-accent transition-colors text-h6 hover:bg-ods-accent/10",
|
|
23666
|
-
"aria-expanded": expanded,
|
|
23667
|
-
"aria-label": expanded ? "Show fewer sources" : `Show ${hiddenCount2} additional retrieved sources`,
|
|
23668
|
-
children: expanded ? "Show less" : `+${hiddenCount2} more retrieved ${hiddenCount2 === 1 ? "source" : "sources"}`
|
|
23669
|
-
}
|
|
23670
|
-
)
|
|
23671
|
-
] })
|
|
23321
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-wrap gap-1.5", children: fallback.map((src) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
23322
|
+
SourceChip,
|
|
23323
|
+
{
|
|
23324
|
+
src,
|
|
23325
|
+
baseRoute,
|
|
23326
|
+
chipBasePlatform,
|
|
23327
|
+
onClose,
|
|
23328
|
+
onDiscuss
|
|
23329
|
+
},
|
|
23330
|
+
src.index
|
|
23331
|
+
)) })
|
|
23672
23332
|
] });
|
|
23673
23333
|
}
|
|
23674
23334
|
const hiddenCount = uncited.length;
|
|
@@ -23823,7 +23483,7 @@ function EmbeddableChatInner({
|
|
|
23823
23483
|
}),
|
|
23824
23484
|
[commandsUrl]
|
|
23825
23485
|
);
|
|
23826
|
-
const headerUserName = _optionalChain([identityUser, 'optionalAccess',
|
|
23486
|
+
const headerUserName = _optionalChain([identityUser, 'optionalAccess', _745 => _745.name, 'optionalAccess', _746 => _746.trim, 'call', _747 => _747()]) || [_optionalChain([identityUser, 'optionalAccess', _748 => _748.firstName]), _optionalChain([identityUser, 'optionalAccess', _749 => _749.lastName])].filter(Boolean).join(" ").trim() || _optionalChain([userDisplayName, 'optionalAccess', _750 => _750.trim, 'call', _751 => _751()]) || void 0;
|
|
23827
23487
|
const effectiveModes = _react.useMemo.call(void 0, () => {
|
|
23828
23488
|
if (modes) return modes;
|
|
23829
23489
|
const guideOptions = tableIdForDocumentType ? { tableIdForDocumentType } : {};
|
|
@@ -23832,20 +23492,20 @@ function EmbeddableChatInner({
|
|
|
23832
23492
|
const mingoCaps = _react.useMemo.call(void 0, () => {
|
|
23833
23493
|
if (mingoState) {
|
|
23834
23494
|
return {
|
|
23835
|
-
canRename: _nullishCoalesce(_optionalChain([mingoDialogCapabilities, 'optionalAccess',
|
|
23836
|
-
canArchive: _nullishCoalesce(_optionalChain([mingoDialogCapabilities, 'optionalAccess',
|
|
23837
|
-
fetchArchivedDialogs: _optionalChain([mingoDialogCapabilities, 'optionalAccess',
|
|
23838
|
-
unarchiveDialog: _optionalChain([mingoDialogCapabilities, 'optionalAccess',
|
|
23839
|
-
searchQuery: _optionalChain([mingoDialogCapabilities, 'optionalAccess',
|
|
23840
|
-
onSearchChange: _optionalChain([mingoDialogCapabilities, 'optionalAccess',
|
|
23841
|
-
onCopyLink: _optionalChain([mingoDialogCapabilities, 'optionalAccess',
|
|
23495
|
+
canRename: _nullishCoalesce(_optionalChain([mingoDialogCapabilities, 'optionalAccess', _752 => _752.canRename]), () => ( false)),
|
|
23496
|
+
canArchive: _nullishCoalesce(_optionalChain([mingoDialogCapabilities, 'optionalAccess', _753 => _753.canArchive]), () => ( false)),
|
|
23497
|
+
fetchArchivedDialogs: _optionalChain([mingoDialogCapabilities, 'optionalAccess', _754 => _754.fetchArchivedDialogs]),
|
|
23498
|
+
unarchiveDialog: _optionalChain([mingoDialogCapabilities, 'optionalAccess', _755 => _755.unarchiveDialog]),
|
|
23499
|
+
searchQuery: _optionalChain([mingoDialogCapabilities, 'optionalAccess', _756 => _756.searchQuery]),
|
|
23500
|
+
onSearchChange: _optionalChain([mingoDialogCapabilities, 'optionalAccess', _757 => _757.onSearchChange]),
|
|
23501
|
+
onCopyLink: _optionalChain([mingoDialogCapabilities, 'optionalAccess', _758 => _758.onCopyLink])
|
|
23842
23502
|
};
|
|
23843
23503
|
}
|
|
23844
23504
|
return {
|
|
23845
|
-
canRename: !!_optionalChain([effectiveModes, 'access',
|
|
23846
|
-
canArchive: !!_optionalChain([effectiveModes, 'access',
|
|
23847
|
-
fetchArchivedDialogs: _optionalChain([effectiveModes, 'access',
|
|
23848
|
-
unarchiveDialog: _optionalChain([effectiveModes, 'access',
|
|
23505
|
+
canRename: !!_optionalChain([effectiveModes, 'access', _759 => _759.mingo, 'optionalAccess', _760 => _760.renameDialog]),
|
|
23506
|
+
canArchive: !!_optionalChain([effectiveModes, 'access', _761 => _761.mingo, 'optionalAccess', _762 => _762.archiveDialog]),
|
|
23507
|
+
fetchArchivedDialogs: _optionalChain([effectiveModes, 'access', _763 => _763.mingo, 'optionalAccess', _764 => _764.fetchArchivedDialogs]),
|
|
23508
|
+
unarchiveDialog: _optionalChain([effectiveModes, 'access', _765 => _765.mingo, 'optionalAccess', _766 => _766.unarchiveDialog]),
|
|
23849
23509
|
searchQuery: void 0,
|
|
23850
23510
|
onSearchChange: void 0,
|
|
23851
23511
|
onCopyLink: void 0
|
|
@@ -23860,7 +23520,7 @@ function EmbeddableChatInner({
|
|
|
23860
23520
|
if (controlledActiveMode === void 0) {
|
|
23861
23521
|
setUncontrolledActiveMode(next);
|
|
23862
23522
|
}
|
|
23863
|
-
_optionalChain([onActiveModeChange, 'optionalCall',
|
|
23523
|
+
_optionalChain([onActiveModeChange, 'optionalCall', _767 => _767(next)]);
|
|
23864
23524
|
},
|
|
23865
23525
|
[controlledActiveMode, onActiveModeChange]
|
|
23866
23526
|
);
|
|
@@ -23887,7 +23547,7 @@ function EmbeddableChatInner({
|
|
|
23887
23547
|
);
|
|
23888
23548
|
const effectiveAssistantName = emptyStateConfig.name;
|
|
23889
23549
|
const effectiveAssistantIcon = emptyStateConfig.icon;
|
|
23890
|
-
const headerAssistantName = _nullishCoalesce(effectiveAssistantName, () => ( (typeof _optionalChain([guideWelcome, 'optionalAccess',
|
|
23550
|
+
const headerAssistantName = _nullishCoalesce(effectiveAssistantName, () => ( (typeof _optionalChain([guideWelcome, 'optionalAccess', _768 => _768.title]) === "string" ? guideWelcome.title : null)));
|
|
23891
23551
|
const {
|
|
23892
23552
|
messages: rawMessages,
|
|
23893
23553
|
isLoading: chatLoading,
|
|
@@ -23931,7 +23591,7 @@ function EmbeddableChatInner({
|
|
|
23931
23591
|
void sendMessage(guidePendingPrompt).catch((err) => {
|
|
23932
23592
|
console.error("[EmbeddableChat] guide launcher prompt failed:", err);
|
|
23933
23593
|
});
|
|
23934
|
-
_optionalChain([onGuidePromptConsumed, 'optionalCall',
|
|
23594
|
+
_optionalChain([onGuidePromptConsumed, 'optionalCall', _769 => _769()]);
|
|
23935
23595
|
}, [guidePendingPrompt, activeMode, sendMessage, onGuidePromptConsumed]);
|
|
23936
23596
|
const {
|
|
23937
23597
|
attachments: stagedAttachments,
|
|
@@ -23942,7 +23602,7 @@ function EmbeddableChatInner({
|
|
|
23942
23602
|
clear: clearAttachments
|
|
23943
23603
|
} = useChatAttachments();
|
|
23944
23604
|
const { panelRef: galleryPanelRef, modal: galleryModal } = useChatAttachmentImageGallery();
|
|
23945
|
-
const contextMaxItems = _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess',
|
|
23605
|
+
const contextMaxItems = _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess', _770 => _770.maxItems]), () => ( 10));
|
|
23946
23606
|
const contextPickerForMode = activeMode === "mingo" ? contextPicker : void 0;
|
|
23947
23607
|
const [contextItems, setContextItems] = _react.useState.call(void 0, NO_CONTEXT_ITEMS);
|
|
23948
23608
|
const [contextPickerOpen, setContextPickerOpen] = _react.useState.call(void 0, false);
|
|
@@ -23963,10 +23623,10 @@ function EmbeddableChatInner({
|
|
|
23963
23623
|
}, [activeDialogId, activeMode]);
|
|
23964
23624
|
const mentionMarkerByType = _react.useMemo.call(void 0, () => {
|
|
23965
23625
|
const m = /* @__PURE__ */ new Map();
|
|
23966
|
-
for (const t of _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess',
|
|
23626
|
+
for (const t of _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess', _771 => _771.entityTypes]), () => ( []))) if (t.marker) m.set(t.type, t.marker);
|
|
23967
23627
|
return m;
|
|
23968
|
-
}, [_optionalChain([contextPicker, 'optionalAccess',
|
|
23969
|
-
const contextEntityTypes = _optionalChain([contextPicker, 'optionalAccess',
|
|
23628
|
+
}, [_optionalChain([contextPicker, 'optionalAccess', _772 => _772.entityTypes])]);
|
|
23629
|
+
const contextEntityTypes = _optionalChain([contextPicker, 'optionalAccess', _773 => _773.entityTypes]);
|
|
23970
23630
|
const resolveContextIcon = _react.useMemo.call(void 0, () => {
|
|
23971
23631
|
const byType = /* @__PURE__ */ new Map();
|
|
23972
23632
|
for (const t of _nullishCoalesce(contextEntityTypes, () => ( []))) byType.set(t.type, t.icon);
|
|
@@ -23978,7 +23638,7 @@ function EmbeddableChatInner({
|
|
|
23978
23638
|
if (mentionActiveRef.current) {
|
|
23979
23639
|
if (contextItems.some((p) => `${p.type}:${p.id}` === key)) return;
|
|
23980
23640
|
if (contextItems.length >= contextMaxItems) return;
|
|
23981
|
-
_optionalChain([chatInputRef, 'access',
|
|
23641
|
+
_optionalChain([chatInputRef, 'access', _774 => _774.current, 'optionalAccess', _775 => _775.commitMention, 'call', _776 => _776(mentionTokenOf(key, mentionMarkerByType), {
|
|
23982
23642
|
label: item.label,
|
|
23983
23643
|
icon: resolveContextIcon(item)
|
|
23984
23644
|
})]);
|
|
@@ -24001,9 +23661,9 @@ function EmbeddableChatInner({
|
|
|
24001
23661
|
setContextItems((prev) => prev.filter((p) => `${p.type}:${p.id}` !== key));
|
|
24002
23662
|
if (mentionKeysRef.current.has(key)) {
|
|
24003
23663
|
mentionKeysRef.current.delete(key);
|
|
24004
|
-
const cur = _nullishCoalesce(_optionalChain([chatInputRef, 'access',
|
|
23664
|
+
const cur = _nullishCoalesce(_optionalChain([chatInputRef, 'access', _777 => _777.current, 'optionalAccess', _778 => _778.getValue, 'call', _779 => _779()]), () => ( ""));
|
|
24005
23665
|
const next = cur.replace(`@${mentionTokenOf(key, mentionMarkerByType)}`, "").replace(/\s{2,}/g, " ").trimStart();
|
|
24006
|
-
_optionalChain([chatInputRef, 'access',
|
|
23666
|
+
_optionalChain([chatInputRef, 'access', _780 => _780.current, 'optionalAccess', _781 => _781.setValue, 'call', _782 => _782(next)]);
|
|
24007
23667
|
}
|
|
24008
23668
|
},
|
|
24009
23669
|
[mentionMarkerByType]
|
|
@@ -24025,7 +23685,7 @@ function EmbeddableChatInner({
|
|
|
24025
23685
|
}, []);
|
|
24026
23686
|
const closeContextPicker = _react.useCallback.call(void 0, () => {
|
|
24027
23687
|
if (mentionActiveRef.current) {
|
|
24028
|
-
_optionalChain([chatInputRef, 'access',
|
|
23688
|
+
_optionalChain([chatInputRef, 'access', _783 => _783.current, 'optionalAccess', _784 => _784.removeMentionTrigger, 'call', _785 => _785()]);
|
|
24029
23689
|
}
|
|
24030
23690
|
setContextPickerOpen(false);
|
|
24031
23691
|
setMentionQuery(null);
|
|
@@ -24059,8 +23719,8 @@ function EmbeddableChatInner({
|
|
|
24059
23719
|
[effectiveAssistantIcon]
|
|
24060
23720
|
);
|
|
24061
23721
|
const [timestampCache] = _react.useState.call(void 0, () => /* @__PURE__ */ new Map());
|
|
24062
|
-
const guideUserName = activeMode === "guide" ? [_optionalChain([identityUser, 'optionalAccess',
|
|
24063
|
-
const guideUserAvatar = activeMode === "guide" ? _optionalChain([identityUser, 'optionalAccess',
|
|
23722
|
+
const guideUserName = activeMode === "guide" ? [_optionalChain([identityUser, 'optionalAccess', _786 => _786.firstName]), _optionalChain([identityUser, 'optionalAccess', _787 => _787.lastName])].filter(Boolean).join(" ").trim() || _optionalChain([identityUser, 'optionalAccess', _788 => _788.name, 'optionalAccess', _789 => _789.trim, 'call', _790 => _790()]) || void 0 : void 0;
|
|
23723
|
+
const guideUserAvatar = activeMode === "guide" ? _optionalChain([identityUser, 'optionalAccess', _791 => _791.avatarUrl, 'optionalAccess', _792 => _792.trim, 'call', _793 => _793()]) || void 0 : void 0;
|
|
24064
23724
|
const messages = _react.useMemo.call(void 0, () => {
|
|
24065
23725
|
const cache = timestampCache;
|
|
24066
23726
|
const seenIds = /* @__PURE__ */ new Set();
|
|
@@ -24095,10 +23755,6 @@ function EmbeddableChatInner({
|
|
|
24095
23755
|
// explicitly — see `Message.hidden` and `chat-message-list`'s skip.
|
|
24096
23756
|
...m.hidden ? { hidden: true } : {},
|
|
24097
23757
|
...m.scrollAnchor ? { scrollAnchor: m.scrollAnchor } : {},
|
|
24098
|
-
// Preserve same-turn rich metadata. Source chips and entity-card
|
|
24099
|
-
// renderers consume it after this raw-to-Message projection.
|
|
24100
|
-
...m.sources && m.sources.length > 0 ? { sources: m.sources } : {},
|
|
24101
|
-
...m.refs && m.refs.length > 0 ? { refs: m.refs } : {},
|
|
24102
23758
|
// Forward attached context items so the user bubble renders its chips.
|
|
24103
23759
|
...m.contextItems && m.contextItems.length > 0 ? { contextItems: m.contextItems } : {}
|
|
24104
23760
|
};
|
|
@@ -24250,32 +23906,21 @@ function EmbeddableChatInner({
|
|
|
24250
23906
|
});
|
|
24251
23907
|
return out;
|
|
24252
23908
|
}, [commandsById, enabledSet]);
|
|
24253
|
-
const
|
|
24254
|
-
|
|
24255
|
-
|
|
24256
|
-
|
|
24257
|
-
|
|
24258
|
-
|
|
24259
|
-
|
|
24260
|
-
|
|
24261
|
-
|
|
24262
|
-
|
|
24263
|
-
|
|
24264
|
-
|
|
24265
|
-
|
|
24266
|
-
|
|
24267
|
-
|
|
24268
|
-
cited,
|
|
24269
|
-
uncited,
|
|
24270
|
-
baseRoute: resolvedBaseRoute,
|
|
24271
|
-
chipBasePlatform,
|
|
24272
|
-
onClose: handleNavigationClose,
|
|
24273
|
-
onDiscuss: discussRef
|
|
24274
|
-
}
|
|
24275
|
-
) });
|
|
24276
|
-
},
|
|
24277
|
-
[chatLoading, messages.length, resolvedBaseRoute, chipBasePlatform, handleNavigationClose, discussRef]
|
|
24278
|
-
);
|
|
23909
|
+
const lastAssistantMsg = [...rawMessages].reverse().find((m) => m.role === "assistant");
|
|
23910
|
+
const lastSources = _react.useMemo.call(void 0, () => {
|
|
23911
|
+
if (chatLoading) return void 0;
|
|
23912
|
+
const sources = _optionalChain([lastAssistantMsg, 'optionalAccess', _794 => _794.sources]);
|
|
23913
|
+
if (!sources || sources.length === 0) return void 0;
|
|
23914
|
+
const content = _optionalChain([lastAssistantMsg, 'optionalAccess', _795 => _795.content]) || "";
|
|
23915
|
+
const citationOrder = [...content.matchAll(/\[(\d+)\]/g)].map((m) => parseInt(m[1], 10));
|
|
23916
|
+
const seenOrder = /* @__PURE__ */ new Map();
|
|
23917
|
+
citationOrder.forEach((idx) => {
|
|
23918
|
+
if (!seenOrder.has(idx)) seenOrder.set(idx, seenOrder.size);
|
|
23919
|
+
});
|
|
23920
|
+
const cited = sources.filter((s) => seenOrder.has(s.index)).sort((a, b) => (_nullishCoalesce(seenOrder.get(a.index), () => ( 0))) - (_nullishCoalesce(seenOrder.get(b.index), () => ( 0))));
|
|
23921
|
+
const uncited = sources.filter((s) => !seenOrder.has(s.index));
|
|
23922
|
+
return { cited, uncited };
|
|
23923
|
+
}, [lastAssistantMsg, chatLoading]);
|
|
24279
23924
|
const [portalHost, setPortalHost] = _react.useState.call(void 0, null);
|
|
24280
23925
|
const [panelBoundary, setPanelBoundary] = _react.useState.call(void 0, null);
|
|
24281
23926
|
const [panelWidth, setPanelWidth] = _react.useState.call(void 0, 0);
|
|
@@ -24284,7 +23929,7 @@ function EmbeddableChatInner({
|
|
|
24284
23929
|
const el = panelMeasureRef.current;
|
|
24285
23930
|
if (!el || typeof ResizeObserver === "undefined") return void 0;
|
|
24286
23931
|
const ro = new ResizeObserver((entries) => {
|
|
24287
|
-
const w = _optionalChain([entries, 'access',
|
|
23932
|
+
const w = _optionalChain([entries, 'access', _796 => _796[0], 'optionalAccess', _797 => _797.contentRect, 'optionalAccess', _798 => _798.width]);
|
|
24288
23933
|
if (typeof w === "number") setPanelWidth(w);
|
|
24289
23934
|
});
|
|
24290
23935
|
ro.observe(el);
|
|
@@ -24302,7 +23947,7 @@ function EmbeddableChatInner({
|
|
|
24302
23947
|
setRailStorageRead(true);
|
|
24303
23948
|
try {
|
|
24304
23949
|
if (window.localStorage.getItem(RAIL_COLLAPSED_STORAGE_KEY) === "1") setRailCollapsed(true);
|
|
24305
|
-
} catch (
|
|
23950
|
+
} catch (e67) {
|
|
24306
23951
|
}
|
|
24307
23952
|
}
|
|
24308
23953
|
const toggleRailCollapsed = _react.useCallback.call(void 0, () => {
|
|
@@ -24310,7 +23955,7 @@ function EmbeddableChatInner({
|
|
|
24310
23955
|
const next = !prev;
|
|
24311
23956
|
try {
|
|
24312
23957
|
window.localStorage.setItem(RAIL_COLLAPSED_STORAGE_KEY, next ? "1" : "0");
|
|
24313
|
-
} catch (
|
|
23958
|
+
} catch (e68) {
|
|
24314
23959
|
}
|
|
24315
23960
|
return next;
|
|
24316
23961
|
});
|
|
@@ -24327,17 +23972,17 @@ function EmbeddableChatInner({
|
|
|
24327
23972
|
const isMingoMode = activeMode === "mingo";
|
|
24328
23973
|
const stackedListView = isMingoMode && !hasConversation && !archiveOpen && !wideMingo && !composeOpen;
|
|
24329
23974
|
const headerShowBack = hasConversation || guideCanReturnToMingo;
|
|
24330
|
-
const headerTitle = hasConversation ? _optionalChain([activeDialog, 'optionalAccess',
|
|
23975
|
+
const headerTitle = hasConversation ? _optionalChain([activeDialog, 'optionalAccess', _799 => _799.title]) || "New Chat" : isGuideEmpty ? _nullishCoalesce(headerAssistantName, () => ( "Mingo Guide")) : "Current Chats";
|
|
24331
23976
|
const headerBackAriaLabel = hasConversation ? isViewingArchived ? "Back to archive" : "Back" : "Back to Mingo";
|
|
24332
23977
|
const headerOnBack = hasConversation ? handleBack : () => handleActiveModeChange("mingo");
|
|
24333
23978
|
const headerOnRestore = isViewingArchived && unarchiveDialog && activeDialog ? () => setRestoreTarget(activeDialog) : void 0;
|
|
24334
23979
|
const headerOnRename = activeDialogId && activeDialog && mingoCaps.canRename ? () => setRenameTarget(activeDialog) : void 0;
|
|
24335
23980
|
const headerOnArchive = activeDialogId && activeDialog && mingoCaps.canArchive ? () => setArchiveTarget(activeDialog) : void 0;
|
|
24336
|
-
const headerOnCopyLink = activeDialogId && activeDialog && mingoCaps.onCopyLink ? () => _optionalChain([mingoCaps, 'access',
|
|
23981
|
+
const headerOnCopyLink = activeDialogId && activeDialog && mingoCaps.onCopyLink ? () => _optionalChain([mingoCaps, 'access', _800 => _800.onCopyLink, 'optionalCall', _801 => _801(activeDialog)]) : void 0;
|
|
24337
23982
|
const headerOnOpenArchive = fetchArchivedDialogs ? openArchive : void 0;
|
|
24338
|
-
const headerOwner = hasConversation ? _optionalChain([activeDialog, 'optionalAccess',
|
|
24339
|
-
const headerPersonName = _optionalChain([headerOwner, 'optionalAccess',
|
|
24340
|
-
const headerPersonAvatarUrl = headerOwner ? _optionalChain([headerOwner, 'access',
|
|
23983
|
+
const headerOwner = hasConversation ? _optionalChain([activeDialog, 'optionalAccess', _802 => _802.owner]) : void 0;
|
|
23984
|
+
const headerPersonName = _optionalChain([headerOwner, 'optionalAccess', _803 => _803.name, 'optionalAccess', _804 => _804.trim, 'call', _805 => _805()]) || headerUserName;
|
|
23985
|
+
const headerPersonAvatarUrl = headerOwner ? _optionalChain([headerOwner, 'access', _806 => _806.avatarUrl, 'optionalAccess', _807 => _807.trim, 'call', _808 => _808()]) || void 0 : _optionalChain([identityUser, 'optionalAccess', _809 => _809.avatarUrl, 'optionalAccess', _810 => _810.trim, 'call', _811 => _811()]) || _optionalChain([userAvatarUrl, 'optionalAccess', _812 => _812.trim, 'call', _813 => _813()]) || void 0;
|
|
24341
23986
|
const headerAvatar = headerPersonName || headerPersonAvatarUrl ? { name: headerPersonName, avatarUrl: headerPersonAvatarUrl } : void 0;
|
|
24342
23987
|
const handleNewChat = _react.useCallback.call(void 0, () => {
|
|
24343
23988
|
resetToNewChat();
|
|
@@ -24592,44 +24237,56 @@ function EmbeddableChatInner({
|
|
|
24592
24237
|
"div",
|
|
24593
24238
|
{
|
|
24594
24239
|
className: "flex min-h-0 flex-1 flex-col duration-200 animate-in fade-in-0",
|
|
24595
|
-
children: hasConversation ? /* @__PURE__ */ _jsxruntime.
|
|
24596
|
-
|
|
24597
|
-
|
|
24598
|
-
|
|
24599
|
-
|
|
24600
|
-
|
|
24601
|
-
|
|
24602
|
-
|
|
24603
|
-
|
|
24604
|
-
|
|
24605
|
-
|
|
24606
|
-
|
|
24607
|
-
|
|
24608
|
-
|
|
24609
|
-
|
|
24610
|
-
|
|
24611
|
-
|
|
24612
|
-
|
|
24613
|
-
|
|
24614
|
-
|
|
24615
|
-
|
|
24616
|
-
|
|
24617
|
-
|
|
24618
|
-
|
|
24619
|
-
|
|
24620
|
-
|
|
24621
|
-
|
|
24622
|
-
|
|
24623
|
-
|
|
24624
|
-
|
|
24625
|
-
|
|
24626
|
-
|
|
24627
|
-
|
|
24628
|
-
|
|
24629
|
-
|
|
24630
|
-
|
|
24631
|
-
|
|
24632
|
-
|
|
24240
|
+
children: hasConversation ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
24241
|
+
messagesInitialLoading ? (
|
|
24242
|
+
// Match the real list's `fullWidth` layout so swapping
|
|
24243
|
+
// skeleton → bubbles doesn't shift the column. The panel
|
|
24244
|
+
// wrapper above already pads (`p-[var(--spacing-system-m)]`),
|
|
24245
|
+
// so the skeleton sits flush (no inner px/pb).
|
|
24246
|
+
//
|
|
24247
|
+
// In `previewMode` the chat lives in a fixed-height host box
|
|
24248
|
+
// (e.g. the Mingo hero demo). The default bottom-anchored
|
|
24249
|
+
// skeleton overflows a short panel and grows its OWN
|
|
24250
|
+
// scrollbar — ugly. `fill` top-anchors + clips overflow so
|
|
24251
|
+
// it reads as "the whole panel is loading" and never scrolls.
|
|
24252
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChatMessageListSkeleton, { fullWidth: true, fill: previewMode, className: "flex-1" })
|
|
24253
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
24254
|
+
ChatMessageList,
|
|
24255
|
+
{
|
|
24256
|
+
messages,
|
|
24257
|
+
isTyping: chatLoading,
|
|
24258
|
+
pendingApprovals,
|
|
24259
|
+
autoScroll: !previewMode,
|
|
24260
|
+
pinBottom: previewMode,
|
|
24261
|
+
overscrollContain: !previewMode,
|
|
24262
|
+
assistantType: "mingo",
|
|
24263
|
+
assistantIcon: mingoAssistantIcon,
|
|
24264
|
+
renderEntityCard,
|
|
24265
|
+
resolveContextIcon,
|
|
24266
|
+
renderContextItem,
|
|
24267
|
+
renderMention,
|
|
24268
|
+
onAskSelect: chatLoading || previewMode ? void 0 : handleAskSelect,
|
|
24269
|
+
NavLinkAnchor: NavLinkAnchorViaRuntime,
|
|
24270
|
+
className: previewMode ? "pointer-events-auto flex-1" : "flex-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
24271
|
+
contentClassName: "max-w-none pb-0",
|
|
24272
|
+
fullWidth: true,
|
|
24273
|
+
hasNextPage: hasMoreMessages,
|
|
24274
|
+
isFetchingNextPage: isMessagesLoading,
|
|
24275
|
+
onLoadMore: loadMoreMessages
|
|
24276
|
+
}
|
|
24277
|
+
),
|
|
24278
|
+
lastSources && (lastSources.cited.length > 0 || lastSources.uncited.length > 0) && !chatLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-shrink-0 pb-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
24279
|
+
SourceChips,
|
|
24280
|
+
{
|
|
24281
|
+
cited: lastSources.cited,
|
|
24282
|
+
uncited: lastSources.uncited,
|
|
24283
|
+
baseRoute: resolvedBaseRoute,
|
|
24284
|
+
chipBasePlatform,
|
|
24285
|
+
onClose: handleNavigationClose,
|
|
24286
|
+
onDiscuss: discussRef
|
|
24287
|
+
}
|
|
24288
|
+
) })
|
|
24289
|
+
] }) : activeMode === "mingo" ? (
|
|
24633
24290
|
/* Figma node 7532:222444 — default (Mingo-mode) empty state:
|
|
24634
24291
|
centred greeting + capability grid + Guide-chat promo +
|
|
24635
24292
|
quick-action chips. Guide mode keeps the slash-command
|
|
@@ -24655,9 +24312,9 @@ function EmbeddableChatInner({
|
|
|
24655
24312
|
subtitle: _nullishCoalesce(effectiveGreeting, () => ( void 0)),
|
|
24656
24313
|
subtitleLoading: emptyStateLoading,
|
|
24657
24314
|
...guideWelcome,
|
|
24658
|
-
title: _nullishCoalesce(effectiveAssistantName, () => ( _optionalChain([guideWelcome, 'optionalAccess',
|
|
24659
|
-
icon: _nullishCoalesce(effectiveAssistantIcon, () => ( _optionalChain([guideWelcome, 'optionalAccess',
|
|
24660
|
-
quickActions: agentConfigUrl && guideSuggestedActions.length > 0 ? guideSuggestedActions : _nullishCoalesce(_optionalChain([guideWelcome, 'optionalAccess',
|
|
24315
|
+
title: _nullishCoalesce(effectiveAssistantName, () => ( _optionalChain([guideWelcome, 'optionalAccess', _814 => _814.title]))),
|
|
24316
|
+
icon: _nullishCoalesce(effectiveAssistantIcon, () => ( _optionalChain([guideWelcome, 'optionalAccess', _815 => _815.icon]))),
|
|
24317
|
+
quickActions: agentConfigUrl && guideSuggestedActions.length > 0 ? guideSuggestedActions : _nullishCoalesce(_optionalChain([guideWelcome, 'optionalAccess', _816 => _816.quickActions]), () => ( guideSuggestedActions)),
|
|
24661
24318
|
onQuickAction: (action) => {
|
|
24662
24319
|
setQuickActionPreview(null);
|
|
24663
24320
|
handleSend(_nullishCoalesce(action.prompt, () => ( action.label)));
|
|
@@ -24731,8 +24388,8 @@ function EmbeddableChatInner({
|
|
|
24731
24388
|
selectedContextItems: contextItems,
|
|
24732
24389
|
onToggleContextItem: toggleContextItem,
|
|
24733
24390
|
onRemoveContextItem: removeContextItem,
|
|
24734
|
-
contextMemoryItems: _optionalChain([contextMemory, 'optionalAccess',
|
|
24735
|
-
onRemoveContextMemoryItem: _optionalChain([contextMemory, 'optionalAccess',
|
|
24391
|
+
contextMemoryItems: _optionalChain([contextMemory, 'optionalAccess', _817 => _817.items]),
|
|
24392
|
+
onRemoveContextMemoryItem: _optionalChain([contextMemory, 'optionalAccess', _818 => _818.onRemove]),
|
|
24736
24393
|
contextPickerOpen,
|
|
24737
24394
|
onOpenContextPicker: openContextPicker,
|
|
24738
24395
|
onCloseContextPicker: closeContextPicker,
|
|
@@ -25191,4 +24848,4 @@ function EmbeddableChatInner({
|
|
|
25191
24848
|
|
|
25192
24849
|
|
|
25193
24850
|
exports.FloatingTooltip = FloatingTooltip; exports.tagVariants = tagVariants; exports.Tag = Tag; exports.formatTicketRelativeTime = formatTicketRelativeTime; exports.formatTicketFullTimestamp = formatTicketFullTimestamp; exports.formatRelativeTime = formatRelativeTime; exports.formatAbsoluteDate = formatAbsoluteDate; exports.formatDateTime = formatDateTime; exports.getDetailedTimeDifference = getDetailedTimeDifference; exports.isToday = isToday; exports.isWithinMinutes = isWithinMinutes; exports.createUTCTimestamp = createUTCTimestamp; exports.DESIGN_PALETTE = DESIGN_PALETTE; exports.getContrastRatio = getContrastRatio; exports.pickReadableTextColor = pickReadableTextColor; exports.extractDominantColor = extractDominantColor; exports.getBestContrastColor = getBestContrastColor; exports.analyzeImageColor = analyzeImageColor; exports.extractImageEdgeColorAsync = extractImageEdgeColorAsync; exports.getPlatformAccentColor = getPlatformAccentColor; exports.getCurrentPlatform = getCurrentPlatform; exports.getReadableTextColor = getReadableTextColor; exports.HEX_PATTERN = HEX_PATTERN; exports.hexToRgb = hexToRgb2; exports.rgbToHex = rgbToHex; exports.deriveHoverColor = deriveHoverColor; exports.deriveActiveColor = deriveActiveColor; exports.rgbToHsl = rgbToHsl; exports.hslToRgb = hslToRgb; exports.ActionsMenu = ActionsMenu; exports.ActionsMenuDropdown = ActionsMenuDropdown; exports.ColorSwatch = ColorSwatch; exports.TooltipProvider = TooltipProvider; exports.Tooltip = Tooltip; exports.TooltipTrigger = TooltipTrigger; exports.TooltipContent = TooltipContent; exports.resolveTicketStatus = resolveTicketStatus; exports.getTicketStatusConfig = getTicketStatusConfig; exports.getTicketStatusTag = getTicketStatusTag; exports.kindToCanonicalStatus = kindToCanonicalStatus; exports.usesCanonicalStatusStyle = usesCanonicalStatusStyle; exports.resolveStatusTagProps = resolveStatusTagProps; exports.TicketStatusTag = TicketStatusTag; exports.useScrollFade = useScrollFade; exports.ScrollFadeOverlay = ScrollFadeOverlay; exports.ScrollShadow = ScrollShadow; exports.Modal = Modal; exports.ModalContent = ModalContent; exports.ModalTwoColumn = ModalTwoColumn; exports.ModalHeader = ModalHeader; exports.ModalTitle = ModalTitle; exports.ModalFooter = ModalFooter; exports.OVERLAY_BACKDROP_CLASS = OVERLAY_BACKDROP_CLASS; exports.Drawer = Drawer; exports.DrawerTrigger = DrawerTrigger; exports.DrawerClose = DrawerClose; exports.DrawerPortal = DrawerPortal; exports.DrawerOverlay = DrawerOverlay; exports.DrawerContent = DrawerContent; exports.DrawerHeader = DrawerHeader; exports.DrawerTitle = DrawerTitle; exports.DrawerDescription = DrawerDescription; exports.DrawerBody = DrawerBody; exports.DrawerFooter = DrawerFooter; exports.Tabs = Tabs; exports.TabsList = TabsList; exports.TabsTrigger = TabsTrigger; exports.TabsContent = TabsContent; exports.stripInlineMarkdown = stripInlineMarkdown; exports.markdownToPlainText = markdownToPlainText; exports.buildHeadingIdMap = buildHeadingIdMap; exports.useHeadingIdMap = useHeadingIdMap; exports.extractText = extractText; exports.useIsHydrated = useIsHydrated; exports.MermaidDiagram = MermaidDiagram; exports.hasRenderableSrc = hasRenderableSrc; exports.buildStandardLeafRenderers = buildStandardLeafRenderers; exports.SAFE_HTML_TAGS = SAFE_HTML_TAGS; exports.SVG_TAGS = SVG_TAGS; exports.buildEffectiveTagSet = buildEffectiveTagSet; exports.buildSanitizeSchema = buildSanitizeSchema; exports.rehypeStripUnsafe = rehypeStripUnsafe; exports.escapeUnknownHtmlTags = escapeUnknownHtmlTags; exports.cardAwareUrlTransform = cardAwareUrlTransform; exports.splitStreamingBlocks = splitStreamingBlocks; exports.completeStreamingTail = completeStreamingTail; exports.TEXT_SIZE_PRESETS = TEXT_SIZE_PRESETS; exports.resolveTextSizeConfig = resolveTextSizeConfig; exports.NO_BROKEN_LINKS = NO_BROKEN_LINKS; exports.MarkdownEngine = MarkdownEngine; exports.SimpleMarkdownRenderer = SimpleMarkdownRenderer; exports.fetchPriorityProp = fetchPriorityProp; exports.MUX_STREAM_ORIGIN = MUX_STREAM_ORIGIN; exports.MUX_IMAGE_ORIGIN = MUX_IMAGE_ORIGIN; exports.saveDataEnabled = saveDataEnabled; exports.useVideoOriginPreconnect = useVideoOriginPreconnect; exports.useVideoWarmup = useVideoWarmup; exports.VideoPlayBadge = VideoPlayBadge; exports.VideoUnmuteGlyph = VideoUnmuteGlyph; exports.extractYouTubeId = extractYouTubeId; exports.VIDEO_PLAYBACK_FAILED_EVENT = VIDEO_PLAYBACK_FAILED_EVENT; exports.Video = Video2; exports.HoverDropdown = HoverDropdown; exports.ExpandChevron = ExpandChevron; exports.useCollapsible = useCollapsible; exports.getCommandText = getCommandText; exports.ArgRow = ArgRow; exports.ResultBlock = ResultBlock; exports.CommandBlock = CommandBlock; exports.ApprovalStatusTag = ApprovalStatusTag; exports.ApprovalBatchMessage = ApprovalBatchMessage; exports.ApprovalRequestMessage = ApprovalRequestMessage; exports.EscalationOfferMessage = EscalationOfferMessage; exports.formatTime = formatTime; exports.AiAssistantInfo = AiAssistantInfo; exports.TicketEscalatedMessage = TicketEscalatedMessage; exports.MESSAGE_TYPE = MESSAGE_TYPE; exports.SCROLL_ANCHOR = SCROLL_ANCHOR; exports.TICKET_EVENT_KIND = TICKET_EVENT_KIND; exports.TicketEventMessage = TicketEventMessage; exports.ContextCompactionDisplay = ContextCompactionDisplay; exports.ThinkingDisplay = ThinkingDisplay; exports.AskDisplay = AskDisplay; exports.ErrorMessageDisplay = ErrorMessageDisplay; exports.MspOrganizationCard = MspOrganizationCard; exports.MspOrganizationCardSkeleton = MspOrganizationCardSkeleton; exports.ChatContainer = ChatContainer; exports.ChatHeader = ChatHeader; exports.ChatContent = ChatContent; exports.ChatFooter = ChatFooter; exports.ChatTypingIndicator = ChatTypingIndicator; exports.MingoOnboardingCard = MingoOnboardingCard; exports.ICON_REGISTRY = ICON_REGISTRY; exports.normalizeIconKey = normalizeIconKey; exports.getIconComponent = getIconComponent; exports.getDynamicIcon = getDynamicIcon; exports.ICON_ALIASES = ICON_ALIASES; exports.resolveIcon = resolveIcon; exports.ICON_OPTIONS = ICON_OPTIONS; exports.SlashCommandSuggestions = SlashCommandSuggestions; exports.ChatInput = ChatInput; exports.CONTEXT_ROW_CLASS = CONTEXT_ROW_CLASS; exports.CONTEXT_ICON_CLASS = CONTEXT_ICON_CLASS; exports.CONTEXT_LABEL_CLASS = CONTEXT_LABEL_CLASS; exports.CONTEXT_BACK_CLASS = CONTEXT_BACK_CLASS; exports.CONTEXT_STATE_CLASS = CONTEXT_STATE_CLASS; exports.ContextMenuRow = ContextMenuRow; exports.ContextItemsSkeleton = ContextItemsSkeleton; exports.ContextItemsList = ContextItemsList; exports.ContextErrorBoundary = ContextErrorBoundary; exports.CHAT_CONTEXT_ITEMS_DEFAULT_MAX = CHAT_CONTEXT_ITEMS_DEFAULT_MAX; exports.ChatComposerPlusMenu = ChatComposerPlusMenu; exports.ChatContextPicker = ChatContextPicker; exports.ChatContextChipStrip = ChatContextChipStrip; exports.BlockCard = BlockCard; exports.remarkCardLinks = remarkCardLinks; exports.remarkMentionChips = remarkMentionChips; exports.ToolExecutionDisplay = ToolExecutionDisplay; exports.MemoizedChatMessageEnhanced = MemoizedChatMessageEnhanced; exports.ChatMessageSkeleton = ChatMessageSkeleton; exports.ChatMessageListSkeleton = ChatMessageListSkeleton; exports.ChatMessageList = ChatMessageList; exports.useProxiedImageUrl = useProxiedImageUrl; exports.ChatMessageRow = ChatMessageRow; exports.ChatMessageRowSkeleton = ChatMessageRowSkeleton; exports.FAE_AVATAR_DATA_URI = FAE_AVATAR_DATA_URI; exports.AgentMark = AgentMark; exports.EntityIcon = EntityIcon; exports.getAgentAccent = getAgentAccent; exports.accentFromIdentityIcon = accentFromIdentityIcon; exports.isQuickActionIconSpec = isQuickActionIconSpec; exports.renderQuickActionIcon = renderQuickActionIcon; exports.QuickActionChipSkeleton = QuickActionChipSkeleton; exports.QuickActionChipButton = QuickActionChipButton; exports.QuickActionChipFromData = QuickActionChipFromData; exports.useMarqueeSync = useMarqueeSync; exports.getMarqueeTrackOffset = getMarqueeTrackOffset; exports.getMarqueeAppliedOffset = getMarqueeAppliedOffset; exports.getMarqueeCloneTwin = getMarqueeCloneTwin; exports.MarqueeWallFades = MarqueeWallFades; exports.MarqueeWall = MarqueeWall; exports.WALL_SKELETON_LABEL_CH = WALL_SKELETON_LABEL_CH; exports.interleave = interleave; exports.QuickActionWall = QuickActionWall; exports.QuickActionMarquee = QuickActionMarquee; exports.ChatTicketItem = ChatTicketItem; exports.ChatTicketList = ChatTicketList; exports.MingoOnboardingCardSkeleton = MingoOnboardingCardSkeleton; exports.MingoOnboardingListSkeleton = MingoOnboardingListSkeleton; exports.MingoChatHistorySkeleton = MingoChatHistorySkeleton; exports.MingoChatHistory = MingoChatHistory; exports.MingoWelcome = MingoWelcome; exports.GuideWelcome = GuideWelcome; exports.GuideModeBanner = GuideModeBanner; exports.TabSelector = TabSelector; exports.MingoHistoryRail = MingoHistoryRail; exports.RenameChatModal = RenameChatModal; exports.ArchiveChatModal = ArchiveChatModal; exports.UnarchiveChatModal = UnarchiveChatModal; exports.ChatDialogModals = ChatDialogModals; exports.ChatHeaderIconButton = ChatHeaderIconButton; exports.ChatHeaderSearchField = ChatHeaderSearchField; exports.ChatPanelHeader = ChatPanelHeader; exports.CHAT_ATTACHMENT_VIEW_URL_PREFIX = CHAT_ATTACHMENT_VIEW_URL_PREFIX; exports.CHAT_ATTACHMENT_VIEW_TOKEN_QUERY_PARAM = CHAT_ATTACHMENT_VIEW_TOKEN_QUERY_PARAM; exports.ANTHROPIC_SUPPORTED_IMAGE_MIME = ANTHROPIC_SUPPORTED_IMAGE_MIME; exports.buildChatAttachmentViewUrl = buildChatAttachmentViewUrl; exports.escapeMarkdownInline = escapeMarkdownInline; exports.formatChatAttachmentMarkdownForBubble = formatChatAttachmentMarkdownForBubble; exports.CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED = CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED; exports.CHAT_ATTACHMENT_MARKDOWN_PATTERN = CHAT_ATTACHMENT_MARKDOWN_PATTERN; exports.stripChatAttachmentMarkdown = stripChatAttachmentMarkdown; exports.CHAT_ATTACHMENT_MIME_TYPES = CHAT_ATTACHMENT_MIME_TYPES; exports.CHAT_ATTACHMENT_CONCURRENT_UPLOADS_PER_USER = CHAT_ATTACHMENT_CONCURRENT_UPLOADS_PER_USER; exports.ChatAttachmentAddButton = ChatAttachmentAddButton; exports.ChatAttachmentChipStrip = ChatAttachmentChipStrip; exports.ChatContextMemoryBar = ChatContextMemoryBar; exports.HoverCard = HoverCard; exports.HoverCardTrigger = HoverCardTrigger; exports.HoverCardContent = HoverCardContent; exports.ModelDisplay = ModelDisplay; exports.ModelDisplaySkeleton = ModelDisplaySkeleton; exports.ChatComposer = ChatComposer; exports.ChatArchivePage = ChatArchivePage; exports.DialogListItem = DialogListItem; exports.ChatSidebar = ChatSidebar; exports.NEW_TAB_FEATURES = NEW_TAB_FEATURES; exports.isModifierClick = isModifierClick; exports.stripSameOriginToPath = stripSameOriginToPath; exports.resolveExternalNavigation = resolveExternalNavigation; exports.executeNavigation = executeNavigation; exports.executeNavigationImperative = executeNavigationImperative; exports.handleChatNavClick = handleChatNavClick; exports.NavLinkAnchorViaRuntime = NavLinkAnchorViaRuntime; exports.SourceActionButton = SourceActionButton; exports.getCaptionsUrl = getCaptionsUrl; exports.rebaseCaptionsUrl = rebaseCaptionsUrl; exports.buildCaptionsUrl = buildCaptionsUrl; exports.getEntityCaptionUrls = getEntityCaptionUrls; exports.getEntityCaptionUrlsById = getEntityCaptionUrlsById; exports.captionsEntityTypeForDocType = captionsEntityTypeForDocType; exports.PAGE_HEADING_CLASS = PAGE_HEADING_CLASS; exports.SECTION_HEADING_CLASS = SECTION_HEADING_CLASS; exports.PageHeading = PageHeading; exports.useCaptions = useCaptions; exports.UserDisplay = UserDisplay; exports.CardHitLayer = CardHitLayer; exports.STRIP_CELL_MAX_WIDTH = STRIP_CELL_MAX_WIDTH; exports.CardsStrip = CardsStrip; exports.VideoHoverPreviewSurface = VideoHoverPreviewSurface; exports.RATIO_GRID_CLASS = RATIO_GRID_CLASS; exports.RATIO_TO_CSS_ASPECT = RATIO_TO_CSS_ASPECT; exports.RatioTabs = RatioTabs; exports.detectAspectRatio = detectAspectRatio; exports.ratioToCategory = ratioToCategory; exports.groupByAspectRatio = groupByAspectRatio; exports.VideoBitesStrip = VideoBitesStrip; exports.VideoBiteCard = VideoBiteCard; exports.EntityVideoSection = EntityVideoSection; exports.ChatVideoEntityCard = ChatVideoEntityCard; exports.GitHubActivityCard = GitHubActivityCard; exports.GitHubActivityCardSkeleton = GitHubActivityCardSkeleton; exports.SlackMessageCard = SlackMessageCard; exports.SlackMessageCardSkeleton = SlackMessageCardSkeleton; exports.HubspotTicketCard = HubspotTicketCard; exports.HubspotTicketCardSkeleton = HubspotTicketCardSkeleton; exports.DataRoomDocCard = DataRoomDocCard; exports.DataRoomDocCardSkeleton = DataRoomDocCardSkeleton; exports.CampaignCardAdmin = CampaignCardAdmin; exports.CampaignCardAdminSkeleton = CampaignCardAdminSkeleton; exports.GenericEntityCard = GenericEntityCard; exports.GenericEntityCardSkeleton = GenericEntityCardSkeleton; exports.faqSectionSlug = faqSectionSlug; exports.faqItemAnchor = faqItemAnchor; exports.parseFaqHash = parseFaqHash; exports.useChatCardItem = useChatCardItem; exports.clickupTaskUrl = clickupTaskUrl; exports.readFetchedCardTitle = readFetchedCardTitle; exports.resolveFetchedCardHref = resolveFetchedCardHref; exports.SOURCE_ICON_NAMES = SOURCE_ICON_NAMES; exports.getSourceIconName = getSourceIconName; exports.SOURCE_LABELS_BY_TABLE = SOURCE_LABELS_BY_TABLE; exports.getSourceLabel = getSourceLabel; exports.DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID = DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID; exports.defaultTableIdForDocumentType = defaultTableIdForDocumentType; exports.resolveSourceRowCTA = resolveSourceRowCTA; exports.resolveSourceIcon = resolveSourceIcon; exports.ChatCardLoader = ChatCardLoader; exports.renderChatInlineEntityCard = renderChatInlineEntityCard; exports.CHAT_TYPE = CHAT_TYPE; exports.OWNER_TYPE = OWNER_TYPE; exports.MESSAGE_ROLE = MESSAGE_ROLE; exports.ASSISTANT_TYPE = ASSISTANT_TYPE; exports.AUTHOR_TYPE = AUTHOR_TYPE; exports.APPROVAL_STATUS = APPROVAL_STATUS; exports.APPROVAL_BLOCK_VARIANT = APPROVAL_BLOCK_VARIANT; exports.CONNECTION_STATUS = CONNECTION_STATUS; exports.isStructuredContent = isStructuredContent; exports.normalizeContent = normalizeContent2; exports.NETWORK_CONFIG = NETWORK_CONFIG; exports.useChunkCatchup = useChunkCatchup; exports.useScriptedStream = useScriptedStream; exports.RESYNC_AFTER_HIDDEN_MS = RESYNC_AFTER_HIDDEN_MS; exports.useJetStreamDialogSubscription = useJetStreamDialogSubscription; exports.useNatsDialogSubscription = useNatsDialogSubscription; exports.buildNatsWsUrl = buildNatsWsUrl; exports.fetchSlashCommands = fetchSlashCommands; exports.useSlashCommands = useSlashCommands; exports.useSlashCommandRegistry = useSlashCommandRegistry; exports.fetchEmptyStateConfig = fetchEmptyStateConfig; exports.useEmptyStateConfig = useEmptyStateConfig; exports.useChatAttachments = useChatAttachments; exports.useChatAttachmentImageGallery = useChatAttachmentImageGallery; exports.ChatIdentityProvider = ChatIdentityProvider; exports.useChatIdentity = useChatIdentity; exports.useCloseOnNavigation = useCloseOnNavigation; exports.useSSE = useSSE; exports.useChat = useChat; exports.approvalDisplaysInline = approvalDisplaysInline; exports.appendToTrailingAssistant = appendToTrailingAssistant; exports.upsertTrailingCompaction = upsertTrailingCompaction; exports.applyToolExecutionToMessages = applyToolExecutionToMessages; exports.MessageSegmentAccumulator = MessageSegmentAccumulator; exports.createMessageSegmentAccumulator = createMessageSegmentAccumulator; exports.SCROLL_ANCHOR_WIRE_KEY = SCROLL_ANCHOR_WIRE_KEY; exports.parseScrollAnchor = parseScrollAnchor; exports.createEmptyTurnMeta = createEmptyTurnMeta; exports.createChatStreamReducer = createChatStreamReducer; exports.DEFAULT_DIALOG_SIDE = DEFAULT_DIALOG_SIDE; exports.DEFAULT_MAX_REDUCERS = DEFAULT_MAX_REDUCERS; exports.MAX_PENDING_RETAIN_KEYS = MAX_PENDING_RETAIN_KEYS; exports.createChatDialogStore = createChatDialogStore; exports.createDeltaBatcher = createDeltaBatcher; exports.useChatStreamReducer = useChatStreamReducer; exports.parseWireCommandOverride = parseWireCommandOverride; exports.sanitizeTitleForChat = sanitizeTitleForChat; exports.formatSingularLookupInvocation = formatSingularLookupInvocation; exports.extractEntityIdFilter = extractEntityIdFilter; exports.buildDiscussAddendum = buildDiscussAddendum; exports.buildDiscussPrompt = buildDiscussPrompt; exports.AUTO_CONTINUATION_DIRECTIVE_PREFIX = AUTO_CONTINUATION_DIRECTIVE_PREFIX; exports.buildAutoContinuationDirective = buildAutoContinuationDirective; exports.useSseChatAdapter = useSseChatAdapter; exports.extractIncompleteMessageState = extractIncompleteMessageState; exports.extractIncompleteTailState = extractIncompleteTailState; exports.decodeHistoricalMessageData = decodeHistoricalMessageData; exports.processHistoricalMessages = processHistoricalMessages; exports.extractErrorMessages = extractErrorMessages; exports.processHistoricalMessagesWithErrors = processHistoricalMessagesWithErrors; exports.mapProcessedToUnified = mapProcessedToUnified; exports.historicalToUnified = historicalToUnified; exports.useNatsChatAdapter = useNatsChatAdapter; exports.useUnifiedChat = useUnifiedChat; exports.SYNTHETIC_REALTIME_ID_PREFIXES = SYNTHETIC_REALTIME_ID_PREFIXES; exports.flattenMessagePagesChronological = flattenMessagePagesChronological; exports.maxPersistedStreamSeq = maxPersistedStreamSeq; exports.mergeHistoryWithRealtime = mergeHistoryWithRealtime; exports.computeHistoryPrepend = computeHistoryPrepend; exports.CHIP_ACTION_BUTTON_CLASS = CHIP_ACTION_BUTTON_CLASS; exports.chatChipClass = chatChipClass; exports.flattenAssistantContent = flattenAssistantContent; exports.normalizeHistoricalMessageData = normalizeHistoricalMessageData; exports.isHistoricalUserTurn = isHistoricalUserTurn; exports.buildStreamFrames = buildStreamFrames; exports.EmbeddableChat = EmbeddableChat;
|
|
25194
|
-
//# sourceMappingURL=chunk-
|
|
24851
|
+
//# sourceMappingURL=chunk-IKUSKKFZ.cjs.map
|