@flamingo-stack/openframe-frontend-core 0.0.586 → 0.0.587-1973.5528.1

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.
Files changed (161) hide show
  1. package/dist/chat-protocol/events.d.ts +8 -2
  2. package/dist/chat-protocol/events.d.ts.map +1 -1
  3. package/dist/chat-protocol/index.cjs +188 -0
  4. package/dist/chat-protocol/index.cjs.map +1 -1
  5. package/dist/chat-protocol/index.js +188 -0
  6. package/dist/chat-protocol/index.js.map +1 -1
  7. package/dist/chat-protocol/nats-decoder.d.ts.map +1 -1
  8. package/dist/chat-protocol/source-metadata.d.ts +5 -0
  9. package/dist/chat-protocol/source-metadata.d.ts.map +1 -0
  10. package/dist/{chunk-BMORFCT2.cjs → chunk-3UJMZADA.cjs} +43 -43
  11. package/dist/{chunk-BMORFCT2.cjs.map → chunk-3UJMZADA.cjs.map} +1 -1
  12. package/dist/{chunk-D7YISHXC.js → chunk-4MVGFYRE.js} +534 -190
  13. package/dist/chunk-4MVGFYRE.js.map +1 -0
  14. package/dist/{chunk-3WR5R6H6.cjs → chunk-4S7GMJYA.cjs} +21 -21
  15. package/dist/{chunk-3WR5R6H6.cjs.map → chunk-4S7GMJYA.cjs.map} +1 -1
  16. package/dist/{chunk-EAYMX22G.cjs → chunk-5VCDP6UA.cjs} +10 -10
  17. package/dist/{chunk-EAYMX22G.cjs.map → chunk-5VCDP6UA.cjs.map} +1 -1
  18. package/dist/{chunk-XMTGLQSD.js → chunk-5X7AJ67N.js} +3 -3
  19. package/dist/{chunk-OZNFPQT5.js → chunk-7A6J4JTW.js} +3 -3
  20. package/dist/{chunk-QZYYNBMI.cjs → chunk-7COFWOCJ.cjs} +22 -22
  21. package/dist/{chunk-QZYYNBMI.cjs.map → chunk-7COFWOCJ.cjs.map} +1 -1
  22. package/dist/{chunk-6ZNWY6WW.cjs → chunk-AIUIIGO3.cjs} +24 -24
  23. package/dist/{chunk-6ZNWY6WW.cjs.map → chunk-AIUIIGO3.cjs.map} +1 -1
  24. package/dist/{chunk-M36XSGZV.cjs → chunk-BLC4JOFC.cjs} +15 -15
  25. package/dist/{chunk-M36XSGZV.cjs.map → chunk-BLC4JOFC.cjs.map} +1 -1
  26. package/dist/{chunk-NISAGFEM.cjs → chunk-DSXD77KX.cjs} +3 -3
  27. package/dist/{chunk-NISAGFEM.cjs.map → chunk-DSXD77KX.cjs.map} +1 -1
  28. package/dist/{chunk-P2CKLIOM.cjs → chunk-DVMQV3M4.cjs} +69 -69
  29. package/dist/{chunk-P2CKLIOM.cjs.map → chunk-DVMQV3M4.cjs.map} +1 -1
  30. package/dist/{chunk-S7YXLZNG.js → chunk-E2QFZDCP.js} +5 -5
  31. package/dist/{chunk-G45RGWHF.cjs → chunk-EKKR5ZFB.cjs} +887 -543
  32. package/dist/chunk-EKKR5ZFB.cjs.map +1 -0
  33. package/dist/{chunk-L4WLYGB4.js → chunk-FDWGO244.js} +2 -2
  34. package/dist/{chunk-3JVYM4ZN.js → chunk-JQO47UHC.js} +5 -5
  35. package/dist/{chunk-C3MRLZUI.cjs → chunk-JR37UTA2.cjs} +33 -33
  36. package/dist/{chunk-C3MRLZUI.cjs.map → chunk-JR37UTA2.cjs.map} +1 -1
  37. package/dist/{chunk-LV6CORVJ.js → chunk-KQWI25NP.js} +2 -2
  38. package/dist/{chunk-V7ZJTUV2.cjs → chunk-NEI7XMCM.cjs} +9 -9
  39. package/dist/{chunk-V7ZJTUV2.cjs.map → chunk-NEI7XMCM.cjs.map} +1 -1
  40. package/dist/{chunk-YEQAA6I4.js → chunk-OW3FUJ2I.js} +3 -3
  41. package/dist/{chunk-PLMJVA2H.js → chunk-OZRT3ZI3.js} +3 -3
  42. package/dist/{chunk-XMK24INA.cjs → chunk-QKAUBYU5.cjs} +3 -3
  43. package/dist/{chunk-XMK24INA.cjs.map → chunk-QKAUBYU5.cjs.map} +1 -1
  44. package/dist/{chunk-6EZGJZVH.js → chunk-QSO24MEK.js} +2 -2
  45. package/dist/{chunk-DQUEVRDU.js → chunk-QYDIVL4X.js} +6 -6
  46. package/dist/{chunk-3HYHYKNL.js → chunk-RE3KVI2Q.js} +5 -5
  47. package/dist/{chunk-KLWJRGNN.js → chunk-RQ5PYSRJ.js} +4 -4
  48. package/dist/{chunk-NYLWMAHP.cjs → chunk-S2UY2C4A.cjs} +10 -10
  49. package/dist/{chunk-NYLWMAHP.cjs.map → chunk-S2UY2C4A.cjs.map} +1 -1
  50. package/dist/{chunk-SSGM2NKA.cjs → chunk-SCVIBVFS.cjs} +4 -4
  51. package/dist/{chunk-SSGM2NKA.cjs.map → chunk-SCVIBVFS.cjs.map} +1 -1
  52. package/dist/{chunk-4VZFJKPT.cjs → chunk-ULOMJH7C.cjs} +5 -5
  53. package/dist/{chunk-4VZFJKPT.cjs.map → chunk-ULOMJH7C.cjs.map} +1 -1
  54. package/dist/{chunk-5OIXAV4P.js → chunk-UODM3HJC.js} +3 -3
  55. package/dist/{chunk-A6ETQEWK.cjs → chunk-UYHETUX3.cjs} +159 -159
  56. package/dist/{chunk-A6ETQEWK.cjs.map → chunk-UYHETUX3.cjs.map} +1 -1
  57. package/dist/{chunk-2Y5UT5VF.js → chunk-WFWWQO2I.js} +2 -2
  58. package/dist/{chunk-YYC7V7YC.js → chunk-ZRFSUCAH.js} +2 -2
  59. package/dist/components/case-studies/index.cjs +9 -9
  60. package/dist/components/case-studies/index.js +3 -3
  61. package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
  62. package/dist/components/chat/chat-message-list.d.ts.map +1 -1
  63. package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
  64. package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
  65. package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts +4 -1
  66. package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts.map +1 -1
  67. package/dist/components/chat/hooks/use-slash-commands.d.ts +3 -3
  68. package/dist/components/chat/hooks/use-slash-commands.d.ts.map +1 -1
  69. package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts +2 -28
  70. package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
  71. package/dist/components/chat/index.cjs +2 -2
  72. package/dist/components/chat/index.js +1 -1
  73. package/dist/components/chat/remark-strip-citations.d.ts.map +1 -1
  74. package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -1
  75. package/dist/components/chat/tool-execution-display.d.ts.map +1 -1
  76. package/dist/components/chat/types/component.types.d.ts +4 -0
  77. package/dist/components/chat/types/component.types.d.ts.map +1 -1
  78. package/dist/components/chat/types/message.types.d.ts +35 -1
  79. package/dist/components/chat/types/message.types.d.ts.map +1 -1
  80. package/dist/components/chat/types/unified-chat-state.types.d.ts +3 -3
  81. package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
  82. package/dist/components/chat/utils/chat-source-metadata.d.ts +5 -0
  83. package/dist/components/chat/utils/chat-source-metadata.d.ts.map +1 -0
  84. package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
  85. package/dist/components/contact/index.cjs +4 -4
  86. package/dist/components/contact/index.js +3 -3
  87. package/dist/components/docs/index.cjs +7 -7
  88. package/dist/components/docs/index.js +6 -6
  89. package/dist/components/embeds/index.cjs +4 -4
  90. package/dist/components/embeds/index.js +3 -3
  91. package/dist/components/faq/index.cjs +4 -4
  92. package/dist/components/faq/index.js +3 -3
  93. package/dist/components/features/index.cjs +3 -3
  94. package/dist/components/features/index.js +2 -2
  95. package/dist/components/help-center-pages/index.cjs +23 -23
  96. package/dist/components/help-center-pages/index.js +14 -14
  97. package/dist/components/index.cjs +36 -36
  98. package/dist/components/index.js +13 -13
  99. package/dist/components/meeting-scheduler/index.cjs +21 -21
  100. package/dist/components/meeting-scheduler/index.js +2 -2
  101. package/dist/components/navigation/index.cjs +6 -6
  102. package/dist/components/navigation/index.js +5 -5
  103. package/dist/components/onboarding-guides/index.cjs +6 -6
  104. package/dist/components/onboarding-guides/index.js +5 -5
  105. package/dist/components/tickets/index.cjs +7 -7
  106. package/dist/components/tickets/index.js +6 -6
  107. package/dist/components/ui/hover-dropdown.d.ts.map +1 -1
  108. package/dist/components/ui/index.cjs +3 -3
  109. package/dist/components/ui/index.js +2 -2
  110. package/dist/index.cjs +7 -7
  111. package/dist/index.js +6 -6
  112. package/dist/utils/index.cjs.map +1 -1
  113. package/dist/utils/index.js.map +1 -1
  114. package/package.json +2 -1
  115. package/src/chat-protocol/__tests__/nats-decoder-golden.test.ts +130 -0
  116. package/src/chat-protocol/__tests__/source-metadata.test.ts +74 -0
  117. package/src/chat-protocol/events.ts +9 -1
  118. package/src/chat-protocol/nats-decoder.ts +7 -0
  119. package/src/chat-protocol/source-metadata.ts +202 -0
  120. package/src/components/chat/__tests__/chat-message-list.test.tsx +70 -0
  121. package/src/components/chat/__tests__/chat-message-streaming-memo.test.tsx +86 -0
  122. package/src/components/chat/__tests__/embeddable-chat-sources.test.tsx +411 -0
  123. package/src/components/chat/__tests__/remark-strip-citations.test.ts +52 -0
  124. package/src/components/chat/__tests__/tool-execution-display.test.tsx +93 -0
  125. package/src/components/chat/chat-message-enhanced.tsx +28 -13
  126. package/src/components/chat/chat-message-list.tsx +27 -22
  127. package/src/components/chat/embeddable-chat.tsx +55 -36
  128. package/src/components/chat/entity-cards/__tests__/dispatch-video-refs.test.tsx +74 -0
  129. package/src/components/chat/entity-cards/dispatch.tsx +86 -17
  130. package/src/components/chat/hooks/__tests__/use-slash-commands.test.ts +64 -0
  131. package/src/components/chat/hooks/use-nats-chat-adapter.ts +7 -0
  132. package/src/components/chat/hooks/use-slash-commands.ts +9 -5
  133. package/src/components/chat/hooks/use-sse-chat-adapter.ts +2 -29
  134. package/src/components/chat/remark-strip-citations.ts +5 -3
  135. package/src/components/chat/stream/__tests__/chat-stream-reducer.test.ts +56 -0
  136. package/src/components/chat/stream/chat-stream-reducer.ts +31 -0
  137. package/src/components/chat/tool-execution-display.tsx +5 -2
  138. package/src/components/chat/types/component.types.ts +4 -0
  139. package/src/components/chat/types/message.types.ts +39 -0
  140. package/src/components/chat/types/unified-chat-state.types.ts +4 -3
  141. package/src/components/chat/utils/__tests__/process-historical-messages-golden.test.ts +57 -0
  142. package/src/components/chat/utils/chat-source-metadata.ts +19 -0
  143. package/src/components/chat/utils/process-historical-messages.ts +19 -1
  144. package/src/components/ui/hover-dropdown.tsx +8 -3
  145. package/dist/chunk-D7YISHXC.js.map +0 -1
  146. package/dist/chunk-G45RGWHF.cjs.map +0 -1
  147. /package/dist/{chunk-XMTGLQSD.js.map → chunk-5X7AJ67N.js.map} +0 -0
  148. /package/dist/{chunk-OZNFPQT5.js.map → chunk-7A6J4JTW.js.map} +0 -0
  149. /package/dist/{chunk-S7YXLZNG.js.map → chunk-E2QFZDCP.js.map} +0 -0
  150. /package/dist/{chunk-L4WLYGB4.js.map → chunk-FDWGO244.js.map} +0 -0
  151. /package/dist/{chunk-3JVYM4ZN.js.map → chunk-JQO47UHC.js.map} +0 -0
  152. /package/dist/{chunk-LV6CORVJ.js.map → chunk-KQWI25NP.js.map} +0 -0
  153. /package/dist/{chunk-YEQAA6I4.js.map → chunk-OW3FUJ2I.js.map} +0 -0
  154. /package/dist/{chunk-PLMJVA2H.js.map → chunk-OZRT3ZI3.js.map} +0 -0
  155. /package/dist/{chunk-6EZGJZVH.js.map → chunk-QSO24MEK.js.map} +0 -0
  156. /package/dist/{chunk-DQUEVRDU.js.map → chunk-QYDIVL4X.js.map} +0 -0
  157. /package/dist/{chunk-3HYHYKNL.js.map → chunk-RE3KVI2Q.js.map} +0 -0
  158. /package/dist/{chunk-KLWJRGNN.js.map → chunk-RQ5PYSRJ.js.map} +0 -0
  159. /package/dist/{chunk-5OIXAV4P.js.map → chunk-UODM3HJC.js.map} +0 -0
  160. /package/dist/{chunk-2Y5UT5VF.js.map → chunk-WFWWQO2I.js.map} +0 -0
  161. /package/dist/{chunk-YYC7V7YC.js.map → chunk-ZRFSUCAH.js.map} +0 -0
@@ -1156,6 +1156,8 @@ TicketEscalatedMessage.displayName = "TicketEscalatedMessage";
1156
1156
  var MESSAGE_TYPE = {
1157
1157
  TEXT: "TEXT",
1158
1158
  THINKING: "THINKING",
1159
+ GUIDE: "GUIDE",
1160
+ SOURCES: "SOURCES",
1159
1161
  ASK: "ASK",
1160
1162
  EXECUTING_TOOL: "EXECUTING_TOOL",
1161
1163
  EXECUTED_TOOL: "EXECUTED_TOOL",
@@ -6812,17 +6814,18 @@ var remarkMentionChips = () => {
6812
6814
  // src/components/chat/remark-strip-citations.ts
6813
6815
 
6814
6816
  var CITATION_REGEX = /(^|\s)\[\d{1,2}(?:\s*,\s*\d{1,2})*\](?=[\s.,;:!?)\]]|$)/g;
6817
+ var CITATION_LIST_REGEX = /(^|\s)(?:\[\d{1,2}(?:\s*,\s*\d{1,2})*\]\s*,\s*)+(?:(?:and|or)\s+)?\[\d{1,2}(?:\s*,\s*\d{1,2})*\](?=[\s.,;:!?)\]]|$)/g;
6815
6818
  var remarkStripCitations = () => {
6816
6819
  return (tree) => {
6817
6820
  _unistutilvisit.visit.call(void 0, tree, "text", (node, index, parent) => {
6818
6821
  if (!parent || typeof index !== "number") return;
6819
6822
  if (!node.value || !node.value.includes("[")) return;
6820
- const withoutCitations = node.value.replace(CITATION_REGEX, "$1");
6823
+ const withoutCitationLists = node.value.replace(CITATION_LIST_REGEX, "$1");
6824
+ const withoutCitations = withoutCitationLists.replace(CITATION_REGEX, "$1");
6821
6825
  if (withoutCitations === node.value) return;
6822
6826
  parent.children.splice(index, 1, {
6823
6827
  ...node,
6824
- // Collapse doubled spaces the removal can leave mid-sentence.
6825
- value: withoutCitations.replace(/ {2,}/g, " ")
6828
+ value: withoutCitations.replace(/\s+([.,;:!?])/g, "$1").replace(/ {2,}/g, " ")
6826
6829
  });
6827
6830
  });
6828
6831
  };
@@ -6854,6 +6857,8 @@ var ToolExecutionDisplay = _react.forwardRef.call(void 0,
6854
6857
  }, [message.parameters, variant]);
6855
6858
  const hasResult = isExecuted && typeof message.result === "string" && message.result.length > 0;
6856
6859
  const hasBody = argEntries.length > 0 || hasResult || isExecuting;
6860
+ const isConciseRemoteRead = !message.integratedToolType && !!_optionalChain([message, 'access', _111 => _111.toolTitle, 'optionalAccess', _112 => _112.trim, 'call', _113 => _113()]) && argEntries.length === 0 && !hasResult;
6861
+ const isStaticRow = isClientView || isConciseRemoteRead;
6857
6862
  const renderStatusIcon = () => {
6858
6863
  if (isExecuting) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.DotsLoaderIcon, { size: 16, className: "text-ods-text-secondary" });
6859
6864
  if (isExecuted && message.success === true) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.CheckCircleIcon, { className: "h-4 w-4 text-ods-success" });
@@ -6873,7 +6878,7 @@ var ToolExecutionDisplay = _react.forwardRef.call(void 0,
6873
6878
  }
6874
6879
  ),
6875
6880
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: renderStatusIcon() }),
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
+ !isStaticRow && /* @__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 }) })
6877
6882
  ] });
6878
6883
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6879
6884
  "div",
@@ -6886,7 +6891,7 @@ var ToolExecutionDisplay = _react.forwardRef.call(void 0,
6886
6891
  className
6887
6892
  ),
6888
6893
  ...props,
6889
- children: isClientView ? (
6894
+ children: isStaticRow ? (
6890
6895
  // Client (Fae end-user): static, non-expandable row — no chevron, no
6891
6896
  // body. Just the explanation + status; command/args/result are hidden.
6892
6897
  /* @__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 })
@@ -6957,7 +6962,7 @@ function groupAskRuns(segments) {
6957
6962
  runs.set(index, [segment]);
6958
6963
  return;
6959
6964
  }
6960
- _optionalChain([runs, 'access', _111 => _111.get, 'call', _112 => _112(headIndex), 'optionalAccess', _113 => _113.push, 'call', _114 => _114(segment)]);
6965
+ _optionalChain([runs, 'access', _114 => _114.get, 'call', _115 => _115(headIndex), 'optionalAccess', _116 => _116.push, 'call', _117 => _117(segment)]);
6961
6966
  });
6962
6967
  return runs;
6963
6968
  }
@@ -6980,6 +6985,7 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
6980
6985
  renderContextItem,
6981
6986
  renderMention,
6982
6987
  renderEntityCard,
6988
+ refs,
6983
6989
  onAskSelect,
6984
6990
  NavLinkAnchor,
6985
6991
  ...props
@@ -6988,6 +6994,10 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
6988
6994
  const isError = role === "error";
6989
6995
  const authorType = _nullishCoalesce(authorTypeProp, () => ( (isUser ? "user" : assistantType === "mingo" ? "mingo" : "fae")));
6990
6996
  const hasMarkerSupport = !!renderEntityCard;
6997
+ const refsByKey = _react.useMemo.call(void 0,
6998
+ () => new Map((_nullishCoalesce(refs, () => ( []))).map((reference) => [`${reference.type}:${reference.id}`, reference])),
6999
+ [refs]
7000
+ );
6991
7001
  const segments = _react.useMemo.call(void 0, () => normalizeContent(content), [content]);
6992
7002
  const askRuns = _react.useMemo.call(void 0, () => groupAskRuns(segments), [segments]);
6993
7003
  const hasMentionSupport = !!renderMention;
@@ -7036,14 +7046,15 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
7036
7046
  const key = `${cardType}:${cardId}`;
7037
7047
  usedKeys.add(key);
7038
7048
  let entry = cache.get(key);
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) };
7049
+ const enrichedRef = refsByKey.get(key);
7050
+ const refForRender = _nullishCoalesce(enrichedRef, () => ( {
7051
+ type: cardType,
7052
+ id: cardId,
7053
+ title: cardId,
7054
+ url: null
7055
+ }));
7056
+ if (!entry || entry.render !== render || entry.reference !== refForRender) {
7057
+ entry = { render, reference: refForRender, node: render(refForRender) };
7047
7058
  cache.set(key, entry);
7048
7059
  }
7049
7060
  const rendered = entry.node;
@@ -7077,10 +7088,10 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
7077
7088
  }
7078
7089
  });
7079
7090
  return { inlineByKey, partsBySegment, usedKeys };
7080
- }, [hasMarkerSupport, renderEntityCard, segments]);
7091
+ }, [hasMarkerSupport, refsByKey, renderEntityCard, segments]);
7081
7092
  _react.useEffect.call(void 0, () => {
7082
7093
  const cache = renderedCardNodeCache.current;
7083
- const usedKeys = _optionalChain([renderingPlan, 'optionalAccess', _115 => _115.usedKeys]);
7094
+ const usedKeys = _optionalChain([renderingPlan, 'optionalAccess', _118 => _118.usedKeys]);
7084
7095
  if (!usedKeys) return;
7085
7096
  if (cache.size <= usedKeys.size) return;
7086
7097
  for (const k of [...cache.keys()]) {
@@ -7103,7 +7114,7 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
7103
7114
  const sepIdx = stripped.indexOf(":");
7104
7115
  const marker = sepIdx === -1 ? stripped : stripped.slice(0, sepIdx);
7105
7116
  const id = sepIdx === -1 ? "" : stripped.slice(sepIdx + 1);
7106
- const node = _optionalChain([renderMention, 'optionalCall', _116 => _116({ marker, id })]);
7117
+ const node = _optionalChain([renderMention, 'optionalCall', _119 => _119({ marker, id })]);
7107
7118
  if (node != null) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: node });
7108
7119
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-ods-text-secondary opacity-60", children });
7109
7120
  }
@@ -7114,7 +7125,7 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
7114
7125
  const cardType = stripped.slice(0, sepIdx);
7115
7126
  const cardId = stripped.slice(sepIdx + 1);
7116
7127
  const key = `${cardType}:${cardId}`;
7117
- const inline = _optionalChain([renderingPlanRef, 'access', _117 => _117.current, 'optionalAccess', _118 => _118.inlineByKey, 'access', _119 => _119.get, 'call', _120 => _120(key)]);
7128
+ const inline = _optionalChain([renderingPlanRef, 'access', _120 => _120.current, 'optionalAccess', _121 => _121.inlineByKey, 'access', _122 => _122.get, 'call', _123 => _123(key)]);
7118
7129
  if (inline != null) return inline;
7119
7130
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-ods-text-secondary opacity-60", children: cardId });
7120
7131
  }
@@ -7127,7 +7138,7 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
7127
7138
  };
7128
7139
  }, [hasMarkerSupport, hasMentionSupport, renderMention, NavLinkAnchor]);
7129
7140
  const renderSegmentBody = (segIndex, text, isStreaming) => {
7130
- const parts = _optionalChain([renderingPlan, 'optionalAccess', _121 => _121.partsBySegment, 'access', _122 => _122.get, 'call', _123 => _123(segIndex)]);
7141
+ const parts = _optionalChain([renderingPlan, 'optionalAccess', _124 => _124.partsBySegment, 'access', _125 => _125.get, 'call', _126 => _126(segIndex)]);
7131
7142
  if (!parts || parts.length === 0) {
7132
7143
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7133
7144
  SimpleMarkdownRenderer,
@@ -7300,11 +7311,11 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
7300
7311
  );
7301
7312
  ChatMessageEnhanced.displayName = "ChatMessageEnhanced";
7302
7313
  var MemoizedChatMessageEnhanced = _react.memo.call(void 0, ChatMessageEnhanced, (prevProps, nextProps) => {
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
+ return prevProps.role === nextProps.role && prevProps.content === nextProps.content && prevProps.name === nextProps.name && prevProps.avatar === nextProps.avatar && prevProps.isTyping === nextProps.isTyping && _optionalChain([prevProps, 'access', _127 => _127.timestamp, 'optionalAccess', _128 => _128.getTime, 'call', _129 => _129()]) === _optionalChain([nextProps, 'access', _130 => _130.timestamp, 'optionalAccess', _131 => _131.getTime, 'call', _132 => _132()]) && 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
7304
7315
  // message (it's set once on the optimistic send and never mutated).
7305
7316
  prevProps.contextItems === nextProps.contextItems && prevProps.resolveContextIcon === nextProps.resolveContextIcon && prevProps.renderContextItem === nextProps.renderContextItem && // Host keeps this stable (module const / useCallback), so reference
7306
7317
  // equality holds across streaming chunks.
7307
- prevProps.renderMention === nextProps.renderMention && prevProps.renderEntityCard === nextProps.renderEntityCard && // Same stability contract as the renderers above: hosts pass a `useCallback`
7318
+ prevProps.renderMention === nextProps.renderMention && prevProps.renderEntityCard === nextProps.renderEntityCard && prevProps.refs === nextProps.refs && // Same stability contract as the renderers above: hosts pass a `useCallback`
7308
7319
  // (EmbeddableChat passes its memoized `handleSend`), so this holds across
7309
7320
  // streaming chunks instead of re-rendering every ask card per chunk.
7310
7321
  prevProps.onAskSelect === nextProps.onAskSelect && prevProps.NavLinkAnchor === nextProps.NavLinkAnchor;
@@ -7322,6 +7333,7 @@ MemoizedChatMessageEnhanced.displayName = "MemoizedChatMessageEnhanced";
7322
7333
 
7323
7334
 
7324
7335
 
7336
+
7325
7337
  var _usesticktobottom = require('use-stick-to-bottom');
7326
7338
 
7327
7339
  // src/components/chat/chat-message-skeleton.tsx
@@ -7516,6 +7528,7 @@ var ChatMessageList = _react.forwardRef.call(void 0,
7516
7528
  renderContextItem,
7517
7529
  renderMention,
7518
7530
  onAskSelect,
7531
+ renderAfterMessage,
7519
7532
  NavLinkAnchor,
7520
7533
  ...props
7521
7534
  }, ref) => {
@@ -7564,7 +7577,7 @@ var ChatMessageList = _react.forwardRef.call(void 0,
7564
7577
  const prevCount = prevRenderRef.current.messageCount;
7565
7578
  const prevLastId = prevRenderRef.current.lastMessageId;
7566
7579
  const newCount = messages.length;
7567
- const currentLastId = _optionalChain([messages, 'access', _130 => _130[messages.length - 1], 'optionalAccess', _131 => _131.id]);
7580
+ const currentLastId = _optionalChain([messages, 'access', _133 => _133[messages.length - 1], 'optionalAccess', _134 => _134.id]);
7568
7581
  prevRenderRef.current = { dialogId, messageCount: newCount, lastMessageId: currentLastId };
7569
7582
  if (dialogChanged) {
7570
7583
  followBottomRef.current = true;
@@ -7631,10 +7644,10 @@ var ChatMessageList = _react.forwardRef.call(void 0,
7631
7644
  };
7632
7645
  let touchY = null;
7633
7646
  const onTouchStart = (e) => {
7634
- touchY = _nullishCoalesce(_optionalChain([e, 'access', _132 => _132.touches, 'access', _133 => _133[0], 'optionalAccess', _134 => _134.clientY]), () => ( null));
7647
+ touchY = _nullishCoalesce(_optionalChain([e, 'access', _135 => _135.touches, 'access', _136 => _136[0], 'optionalAccess', _137 => _137.clientY]), () => ( null));
7635
7648
  };
7636
7649
  const onTouchMove = (e) => {
7637
- const y = _optionalChain([e, 'access', _135 => _135.touches, 'access', _136 => _136[0], 'optionalAccess', _137 => _137.clientY]);
7650
+ const y = _optionalChain([e, 'access', _138 => _138.touches, 'access', _139 => _139[0], 'optionalAccess', _140 => _140.clientY]);
7638
7651
  if (y == null || touchY == null) return;
7639
7652
  if (y > touchY) disarm();
7640
7653
  touchY = y;
@@ -7764,7 +7777,7 @@ var ChatMessageList = _react.forwardRef.call(void 0,
7764
7777
  ro.observe(node);
7765
7778
  const timer = setTimeout(() => {
7766
7779
  ro.disconnect();
7767
- if (_optionalChain([anchorWatcherRef, 'access', _138 => _138.current, 'optionalAccess', _139 => _139.id]) === last.id) {
7780
+ if (_optionalChain([anchorWatcherRef, 'access', _141 => _141.current, 'optionalAccess', _142 => _142.id]) === last.id) {
7768
7781
  anchorWatcherRef.current = null;
7769
7782
  }
7770
7783
  }, 2e3);
@@ -7794,7 +7807,7 @@ var ChatMessageList = _react.forwardRef.call(void 0,
7794
7807
  scrollTop: el.scrollTop
7795
7808
  };
7796
7809
  }
7797
- _optionalChain([onLoadMoreRef, 'access', _140 => _140.current, 'optionalCall', _141 => _141()]);
7810
+ _optionalChain([onLoadMoreRef, 'access', _143 => _143.current, 'optionalCall', _144 => _144()]);
7798
7811
  }
7799
7812
  },
7800
7813
  { root: scrollContainer, rootMargin: "200px", threshold: 0.1 }
@@ -7828,8 +7841,8 @@ var ChatMessageList = _react.forwardRef.call(void 0,
7828
7841
  );
7829
7842
  }
7830
7843
  const lastMessage = messages[messages.length - 1];
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]]);
7844
+ const lastSegments = Array.isArray(_optionalChain([lastMessage, 'optionalAccess', _145 => _145.content])) ? lastMessage.content : null;
7845
+ const lastSegment = _optionalChain([lastSegments, 'optionalAccess', _146 => _146[lastSegments.length - 1]]);
7833
7846
  const isPausedOnApproval = !!lastSegment && (lastSegment.type === "approval_request" || lastSegment.type === "approval_batch" || lastSegment.type === "escalation_offer") && (lastSegment.status === void 0 || lastSegment.status === "pending");
7834
7847
  const showStreamingLoader = isTyping && !isPausedOnApproval && !(pendingApprovals && pendingApprovals.length > 0);
7835
7848
  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: [
@@ -7872,31 +7885,34 @@ var ChatMessageList = _react.forwardRef.call(void 0,
7872
7885
  if (message.hidden) return null;
7873
7886
  const isEmptyPendingTurn = index === messages.length - 1 && isTyping && message.role === "assistant" && !hasNonEmptyContent(message.content) && (!Array.isArray(message.content) || message.content.every((s) => s.type === "text"));
7874
7887
  if (isEmptyPendingTurn) return null;
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
- );
7888
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _react.Fragment, { children: [
7889
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7890
+ MemoizedChatMessageEnhanced,
7891
+ {
7892
+ ref: getRegisterMessageEl(message.id),
7893
+ role: message.role,
7894
+ name: message.name,
7895
+ content: message.content,
7896
+ timestamp: message.timestamp,
7897
+ isTyping: index === messages.length - 1 && isTyping && message.role === "assistant",
7898
+ avatar: showAvatars ? message.avatar : null,
7899
+ showAvatar: showAvatars,
7900
+ assistantType: message.assistantType || assistantType,
7901
+ approvalVariant,
7902
+ authorType: message.authorType,
7903
+ assistantIcon: message.role !== "user" ? assistantIcon : void 0,
7904
+ contextItems: message.contextItems,
7905
+ resolveContextIcon,
7906
+ renderContextItem,
7907
+ renderMention,
7908
+ renderEntityCard,
7909
+ refs: message.refs,
7910
+ onAskSelect: index > lastUserMessageIndex ? onAskSelect : void 0,
7911
+ NavLinkAnchor
7912
+ }
7913
+ ),
7914
+ _optionalChain([renderAfterMessage, 'optionalCall', _147 => _147(message, index)])
7915
+ ] }, message.id);
7900
7916
  })
7901
7917
  ]
7902
7918
  }
@@ -8045,7 +8061,7 @@ function EntityIcon({
8045
8061
  size: size2 = 20,
8046
8062
  className
8047
8063
  }) {
8048
- if (_optionalChain([icon, 'optionalAccess', _144 => _144.url])) {
8064
+ if (_optionalChain([icon, 'optionalAccess', _148 => _148.url])) {
8049
8065
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8050
8066
  _chunkWLSFBRT5cjs.next_image_default,
8051
8067
  {
@@ -8059,7 +8075,7 @@ function EntityIcon({
8059
8075
  }
8060
8076
  );
8061
8077
  }
8062
- if (_optionalChain([icon, 'optionalAccess', _145 => _145.name]) && BRAND_MARK_NAMES.has(icon.name)) {
8078
+ if (_optionalChain([icon, 'optionalAccess', _149 => _149.name]) && BRAND_MARK_NAMES.has(icon.name)) {
8063
8079
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8064
8080
  "span",
8065
8081
  {
@@ -8069,8 +8085,8 @@ function EntityIcon({
8069
8085
  }
8070
8086
  );
8071
8087
  }
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]), () => ( {})) });
8088
+ const Glyph = resolveIcon(_nullishCoalesce(_optionalChain([icon, 'optionalAccess', _150 => _150.name]), () => ( void 0)));
8089
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Glyph, { size: size2, className, ..._nullishCoalesce(_optionalChain([icon, 'optionalAccess', _151 => _151.props]), () => ( {})) });
8074
8090
  }
8075
8091
 
8076
8092
  // src/components/chat/quick-action-chip.tsx
@@ -8080,7 +8096,7 @@ function getAgentAccent(slug) {
8080
8096
  return slug === "fae" || slug === "mingo" ? AGENT_ACCENTS[slug] : void 0;
8081
8097
  }
8082
8098
  function accentFromIdentityIcon(icon) {
8083
- const color = _optionalChain([icon, 'optionalAccess', _148 => _148.props, 'optionalAccess', _149 => _149.color]);
8099
+ const color = _optionalChain([icon, 'optionalAccess', _152 => _152.props, 'optionalAccess', _153 => _153.color]);
8084
8100
  return typeof color === "string" && color.length > 0 ? color : void 0;
8085
8101
  }
8086
8102
  var ACCENT_CLASS = {
@@ -8162,7 +8178,7 @@ function QuickActionChipButton({
8162
8178
  className
8163
8179
  }) {
8164
8180
  const themedIcon = theme && isQuickActionIconSpec(icon) && !icon.accent ? { ...icon, accent: theme.accent } : icon;
8165
- const resolvedLozenge = lozenge === true ? _optionalChain([theme, 'optionalAccess', _150 => _150.lozenge]) : lozenge === false ? void 0 : lozenge;
8181
+ const resolvedLozenge = lozenge === true ? _optionalChain([theme, 'optionalAccess', _154 => _154.lozenge]) : lozenge === false ? void 0 : lozenge;
8166
8182
  const resolvedIcon = renderQuickActionIcon(themedIcon);
8167
8183
  const resolvedLabel = composeChipLabel(label, resolvedLozenge);
8168
8184
  const tagVariant = selected ? selectedAccent === "cyan" ? "selectedCyan" : "selected" : variant;
@@ -8374,7 +8390,7 @@ function MarqueeWall({
8374
8390
  if (!container || !copy) return;
8375
8391
  const size2 = axis === "y" ? copy.offsetHeight : copy.offsetWidth;
8376
8392
  copySizeRef.current = size2;
8377
- const clone = _optionalChain([trackRef, 'access', _151 => _151.current, 'optionalAccess', _152 => _152.querySelector, 'call', _153 => _153('[data-marquee-copy="clone"]')]);
8393
+ const clone = _optionalChain([trackRef, 'access', _155 => _155.current, 'optionalAccess', _156 => _156.querySelector, 'call', _157 => _157('[data-marquee-copy="clone"]')]);
8378
8394
  wrapSizeRef.current = clone ? axis === "y" ? clone.offsetTop - copy.offsetTop : clone.offsetLeft - copy.offsetLeft : size2 + (typeof copyGap === "number" ? copyGap : 0);
8379
8395
  const avail = axis === "y" ? container.clientHeight : container.clientWidth;
8380
8396
  setOverflows(size2 > avail + 1);
@@ -8395,7 +8411,7 @@ function MarqueeWall({
8395
8411
  _react.useEffect.call(void 0, () => {
8396
8412
  const el = containerRef.current;
8397
8413
  if (!el || typeof IntersectionObserver === "undefined") return void 0;
8398
- const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access', _154 => _154[0], 'optionalAccess', _155 => _155.isIntersecting]), () => ( true))), {
8414
+ const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access', _158 => _158[0], 'optionalAccess', _159 => _159.isIntersecting]), () => ( true))), {
8399
8415
  rootMargin: _chunkZI27ALYXcjs.NEAR_VIEWPORT_ROOT_MARGIN
8400
8416
  });
8401
8417
  io.observe(el);
@@ -8506,7 +8522,7 @@ function MarqueeWall({
8506
8522
  if (Math.abs(delta) > 3 && !dragMovedRef.current) {
8507
8523
  dragMovedRef.current = true;
8508
8524
  try {
8509
- _optionalChain([containerRef, 'access', _156 => _156.current, 'optionalAccess', _157 => _157.setPointerCapture, 'call', _158 => _158(e.pointerId)]);
8525
+ _optionalChain([containerRef, 'access', _160 => _160.current, 'optionalAccess', _161 => _161.setPointerCapture, 'call', _162 => _162(e.pointerId)]);
8510
8526
  } catch (e7) {
8511
8527
  }
8512
8528
  }
@@ -8523,7 +8539,7 @@ function MarqueeWall({
8523
8539
  dragSuppressUntilRef.current = performance.now() + DRAG_RESUME_MS;
8524
8540
  if (dragMovedRef.current) {
8525
8541
  try {
8526
- _optionalChain([containerRef, 'access', _159 => _159.current, 'optionalAccess', _160 => _160.releasePointerCapture, 'call', _161 => _161(e.pointerId)]);
8542
+ _optionalChain([containerRef, 'access', _163 => _163.current, 'optionalAccess', _164 => _164.releasePointerCapture, 'call', _165 => _165(e.pointerId)]);
8527
8543
  } catch (e8) {
8528
8544
  }
8529
8545
  }
@@ -8957,7 +8973,7 @@ var ChatTicketItem = _react.forwardRef.call(void 0,
8957
8973
  {
8958
8974
  ref,
8959
8975
  type: "button",
8960
- onClick: () => _optionalChain([onClick, 'optionalCall', _162 => _162(ticket.id)]),
8976
+ onClick: () => _optionalChain([onClick, 'optionalCall', _166 => _166(ticket.id)]),
8961
8977
  className: _chunkPRPZBXWZcjs.cn.call(void 0,
8962
8978
  "flex h-20 w-full items-center gap-4 px-4",
8963
8979
  "border-b border-ods-border bg-ods-card",
@@ -9166,7 +9182,7 @@ function MingoChatHistoryRow({
9166
9182
  const unread = _nullishCoalesce(dialog.unreadMessagesCount, () => ( 0));
9167
9183
  const hasMenu = !!onRequestRename || !!onRequestArchive || !!onRequestCopyLink;
9168
9184
  const owner = dialog.owner;
9169
- const hasAvatar = !!(_optionalChain([owner, 'optionalAccess', _163 => _163.name]) || _optionalChain([owner, 'optionalAccess', _164 => _164.avatarUrl]));
9185
+ const hasAvatar = !!(_optionalChain([owner, 'optionalAccess', _167 => _167.name]) || _optionalChain([owner, 'optionalAccess', _168 => _168.avatarUrl]));
9170
9186
  const [menuOpen, setMenuOpen] = _react.useState.call(void 0, false);
9171
9187
  const menuItems = [
9172
9188
  onRequestCopyLink && {
@@ -9202,11 +9218,11 @@ function MingoChatHistoryRow({
9202
9218
  {
9203
9219
  role: "button",
9204
9220
  tabIndex: 0,
9205
- onClick: () => _optionalChain([onSelect, 'optionalCall', _165 => _165(dialog.id)]),
9221
+ onClick: () => _optionalChain([onSelect, 'optionalCall', _169 => _169(dialog.id)]),
9206
9222
  onKeyDown: (e) => {
9207
9223
  if (e.key === "Enter" || e.key === " ") {
9208
9224
  e.preventDefault();
9209
- _optionalChain([onSelect, 'optionalCall', _166 => _166(dialog.id)]);
9225
+ _optionalChain([onSelect, 'optionalCall', _170 => _170(dialog.id)]);
9210
9226
  }
9211
9227
  },
9212
9228
  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",
@@ -9273,8 +9289,8 @@ function MingoChatHistoryRow({
9273
9289
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
9274
9290
  "span",
9275
9291
  {
9276
- onClick: () => _optionalChain([onSelect, 'optionalCall', _167 => _167(dialog.id)]),
9277
- title: _optionalChain([owner, 'optionalAccess', _168 => _168.name]) || void 0,
9292
+ onClick: () => _optionalChain([onSelect, 'optionalCall', _171 => _171(dialog.id)]),
9293
+ title: _optionalChain([owner, 'optionalAccess', _172 => _172.name]) || void 0,
9278
9294
  className: _chunkPRPZBXWZcjs.cn.call(void 0,
9279
9295
  "absolute inset-0 flex cursor-pointer items-center justify-center transition-opacity",
9280
9296
  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")
@@ -9284,9 +9300,9 @@ function MingoChatHistoryRow({
9284
9300
  {
9285
9301
  variant: "round",
9286
9302
  sizePx: 24,
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,
9303
+ src: _optionalChain([owner, 'optionalAccess', _173 => _173.avatarUrl]) || void 0,
9304
+ alt: _optionalChain([owner, 'optionalAccess', _174 => _174.name]) || void 0,
9305
+ fallback: _optionalChain([owner, 'optionalAccess', _175 => _175.name]) || void 0,
9290
9306
  initialsClassName: "text-[10px] text-ods-text-secondary"
9291
9307
  }
9292
9308
  )
@@ -9337,7 +9353,7 @@ function MingoChatHistory({
9337
9353
  className
9338
9354
  }) {
9339
9355
  const groups = _react.useMemo.call(void 0, () => groupDialogs(dialogs), [dialogs]);
9340
- const noSearchResults = groups.length === 0 && !!_optionalChain([searchQuery, 'optionalAccess', _172 => _172.trim, 'call', _173 => _173()]);
9356
+ const noSearchResults = groups.length === 0 && !!_optionalChain([searchQuery, 'optionalAccess', _176 => _176.trim, 'call', _177 => _177()]);
9341
9357
  const { scrollRef, fadeTop, fadeBottom, update: updateFade } = useScrollFade();
9342
9358
  const sentinelRef = _react.useRef.call(void 0, null);
9343
9359
  const onLoadMoreRef = _react.useRef.call(void 0, onLoadMore);
@@ -9354,7 +9370,7 @@ function MingoChatHistory({
9354
9370
  const io = new IntersectionObserver(
9355
9371
  ([entry]) => {
9356
9372
  if (entry.isIntersecting && !isLoadingMoreRef.current) {
9357
- _optionalChain([onLoadMoreRef, 'access', _174 => _174.current, 'optionalCall', _175 => _175()]);
9373
+ _optionalChain([onLoadMoreRef, 'access', _178 => _178.current, 'optionalCall', _179 => _179()]);
9358
9374
  }
9359
9375
  },
9360
9376
  { root, rootMargin: "120px", threshold: 0.1 }
@@ -9538,8 +9554,8 @@ function MingoWelcome({
9538
9554
  icon: action.icon,
9539
9555
  variant: action.variant,
9540
9556
  onSelect: action.onClick,
9541
- onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall', _176 => _176(action)]),
9542
- onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall', _177 => _177()])
9557
+ onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall', _180 => _180(action)]),
9558
+ onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall', _181 => _181()])
9543
9559
  })),
9544
9560
  agentSlug,
9545
9561
  rows: 4,
@@ -9592,9 +9608,9 @@ function GuideWelcome({
9592
9608
  props: action.iconProps,
9593
9609
  accent: _nullishCoalesce(_nullishCoalesce(action.accent, () => ( accentFromIdentityIcon(icon))), () => ( "cyan"))
9594
9610
  },
9595
- onSelect: () => _optionalChain([onQuickAction, 'optionalCall', _178 => _178(action)]),
9596
- onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall', _179 => _179(action)]),
9597
- onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall', _180 => _180()])
9611
+ onSelect: () => _optionalChain([onQuickAction, 'optionalCall', _182 => _182(action)]),
9612
+ onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall', _183 => _183(action)]),
9613
+ onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall', _184 => _184()])
9598
9614
  })),
9599
9615
  [quickActions, icon, onQuickAction, onQuickActionHover, onQuickActionHoverEnd]
9600
9616
  );
@@ -9770,7 +9786,7 @@ function MingoHistoryRail({
9770
9786
  onRetry,
9771
9787
  className
9772
9788
  }) {
9773
- const hasSearch = !!_optionalChain([searchQuery, 'optionalAccess', _181 => _181.trim, 'call', _182 => _182()]);
9789
+ const hasSearch = !!_optionalChain([searchQuery, 'optionalAccess', _185 => _185.trim, 'call', _186 => _186()]);
9774
9790
  const hasList = dialogs.length > 0 || hasSearch;
9775
9791
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
9776
9792
  "div",
@@ -9896,7 +9912,7 @@ var Modal = _react.forwardRef.call(void 0,
9896
9912
  document.removeEventListener("focusin", containFocus);
9897
9913
  const idx = modalStack.lastIndexOf(stackId);
9898
9914
  if (idx !== -1) modalStack.splice(idx, 1);
9899
- _optionalChain([restoreFocusRef, 'access', _183 => _183.current, 'optionalAccess', _184 => _184.focus, 'optionalCall', _185 => _185()]);
9915
+ _optionalChain([restoreFocusRef, 'access', _187 => _187.current, 'optionalAccess', _188 => _188.focus, 'optionalCall', _189 => _189()]);
9900
9916
  };
9901
9917
  }, [isOpen]);
9902
9918
  _react.useEffect.call(void 0, () => {
@@ -10146,7 +10162,7 @@ function ChatDialogModals({
10146
10162
  RenameChatModal,
10147
10163
  {
10148
10164
  isOpen: renameTarget != null,
10149
- initialName: _nullishCoalesce(_optionalChain([renameTarget, 'optionalAccess', _186 => _186.title]), () => ( "")),
10165
+ initialName: _nullishCoalesce(_optionalChain([renameTarget, 'optionalAccess', _190 => _190.title]), () => ( "")),
10150
10166
  onClose: () => setRenameTarget(null),
10151
10167
  onSave: onConfirmRename
10152
10168
  }
@@ -10218,7 +10234,7 @@ function ChatHeaderSearchField({
10218
10234
  const finishCollapse = _react.useCallback.call(void 0, () => {
10219
10235
  if (collapsedRef.current) return;
10220
10236
  collapsedRef.current = true;
10221
- _optionalChain([onCollapse, 'optionalCall', _187 => _187()]);
10237
+ _optionalChain([onCollapse, 'optionalCall', _191 => _191()]);
10222
10238
  }, [onCollapse]);
10223
10239
  const beginCollapse = _react.useCallback.call(void 0, () => {
10224
10240
  setExiting(true);
@@ -10540,7 +10556,7 @@ function ChatAttachmentAddButton({
10540
10556
  const canAddMore = slotsAvailable > 0 && !disabled;
10541
10557
  const handlePick = () => {
10542
10558
  if (!canAddMore) return;
10543
- _optionalChain([fileInputRef, 'access', _188 => _188.current, 'optionalAccess', _189 => _189.click, 'call', _190 => _190()]);
10559
+ _optionalChain([fileInputRef, 'access', _192 => _192.current, 'optionalAccess', _193 => _193.click, 'call', _194 => _194()]);
10544
10560
  };
10545
10561
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
10546
10562
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -10703,7 +10719,7 @@ function ChatContextMemoryBar({
10703
10719
  _react.useEffect.call(void 0, () => {
10704
10720
  if (!open) return void 0;
10705
10721
  const onOutside = (e) => {
10706
- if (_optionalChain([rootRef, 'access', _191 => _191.current, 'optionalAccess', _192 => _192.contains, 'call', _193 => _193(e.target)])) return;
10722
+ if (_optionalChain([rootRef, 'access', _195 => _195.current, 'optionalAccess', _196 => _196.contains, 'call', _197 => _197(e.target)])) return;
10707
10723
  setOpen(false);
10708
10724
  };
10709
10725
  document.addEventListener("mousedown", onOutside, true);
@@ -10975,7 +10991,7 @@ function ChatComposer({
10975
10991
  const contextEnabled = !!contextPicker && !archived;
10976
10992
  const selected = _nullishCoalesce(selectedContextItems, () => ( []));
10977
10993
  const memory = _nullishCoalesce(contextMemoryItems, () => ( []));
10978
- const entityTypes = _optionalChain([contextPicker, 'optionalAccess', _194 => _194.entityTypes]);
10994
+ const entityTypes = _optionalChain([contextPicker, 'optionalAccess', _198 => _198.entityTypes]);
10979
10995
  const iconByType = _react.useMemo.call(void 0, () => {
10980
10996
  const map = /* @__PURE__ */ new Map();
10981
10997
  for (const t of _nullishCoalesce(entityTypes, () => ( []))) map.set(t.type, t.icon);
@@ -11002,7 +11018,7 @@ function ChatComposer({
11002
11018
  startIcon: contextEnabled ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
11003
11019
  ChatComposerPlusMenu,
11004
11020
  {
11005
- onToggle: () => contextPickerOpen ? _optionalChain([onCloseContextPicker, 'optionalCall', _195 => _195()]) : _optionalChain([onOpenContextPicker, 'optionalCall', _196 => _196()]),
11021
+ onToggle: () => contextPickerOpen ? _optionalChain([onCloseContextPicker, 'optionalCall', _199 => _199()]) : _optionalChain([onOpenContextPicker, 'optionalCall', _200 => _200()]),
11006
11022
  open: contextPickerOpen,
11007
11023
  disabled: attachmentsDisabled,
11008
11024
  dropdown: contextPicker ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -11011,8 +11027,8 @@ function ChatComposer({
11011
11027
  open: contextPickerOpen,
11012
11028
  config: contextPicker,
11013
11029
  selectedItems: selected,
11014
- onToggleItem: (item) => _optionalChain([onToggleContextItem, 'optionalCall', _197 => _197(item)]),
11015
- onClose: () => _optionalChain([onCloseContextPicker, 'optionalCall', _198 => _198()]),
11030
+ onToggleItem: (item) => _optionalChain([onToggleContextItem, 'optionalCall', _201 => _201(item)]),
11031
+ onClose: () => _optionalChain([onCloseContextPicker, 'optionalCall', _202 => _202()]),
11016
11032
  mentionQuery
11017
11033
  }
11018
11034
  ) : void 0
@@ -11203,8 +11219,8 @@ ChatSidebarSkeleton.displayName = "ChatSidebarSkeleton";
11203
11219
  var DialogListItem = _react.forwardRef.call(void 0,
11204
11220
  ({ className, dialog, isActive, onDialogSelect, onClick, ...props }, ref) => {
11205
11221
  const handleClick = (e) => {
11206
- _optionalChain([onDialogSelect, 'optionalCall', _199 => _199(dialog.id)]);
11207
- _optionalChain([onClick, 'optionalCall', _200 => _200(e)]);
11222
+ _optionalChain([onDialogSelect, 'optionalCall', _203 => _203(dialog.id)]);
11223
+ _optionalChain([onClick, 'optionalCall', _204 => _204(e)]);
11208
11224
  };
11209
11225
  const formatTimestamp = (timestamp) => {
11210
11226
  if (!timestamp) return "";
@@ -11283,7 +11299,7 @@ var ChatSidebar = _react.forwardRef.call(void 0,
11283
11299
  (entries) => {
11284
11300
  const [entry] = entries;
11285
11301
  if (entry.isIntersecting && !isFetchingRef.current) {
11286
- _optionalChain([onLoadMoreRef, 'access', _201 => _201.current, 'optionalCall', _202 => _202()]);
11302
+ _optionalChain([onLoadMoreRef, 'access', _205 => _205.current, 'optionalCall', _206 => _206()]);
11287
11303
  }
11288
11304
  },
11289
11305
  { root: scrollContainer, rootMargin: "100px", threshold: 0.1 }
@@ -11411,7 +11427,7 @@ function isForeignOriginHref(href) {
11411
11427
  function runNavigation(runtime, href, path, targetPlatform, fallbackNavigate) {
11412
11428
  const isNewTab = runtime ? _chunkEMF64FWAcjs.computeIsNewTab.call(void 0, runtime, href, _nullishCoalesce(targetPlatform, () => ( null))) : false;
11413
11429
  if (isNewTab) {
11414
- if (_optionalChain([runtime, 'optionalAccess', _203 => _203.navigation, 'access', _204 => _204.openExternal])) runtime.navigation.openExternal(href);
11430
+ if (_optionalChain([runtime, 'optionalAccess', _207 => _207.navigation, 'access', _208 => _208.openExternal])) runtime.navigation.openExternal(href);
11415
11431
  else window.open(href, "_blank", NEW_TAB_FEATURES);
11416
11432
  return;
11417
11433
  }
@@ -11419,7 +11435,7 @@ function runNavigation(runtime, href, path, targetPlatform, fallbackNavigate) {
11419
11435
  if (target.includes("#") && _chunkZI27ALYXcjs.navigateSamePageHash.call(void 0, target, { headerOffset: _chunkZI27ALYXcjs.STICKY_HEADER_OFFSET_PX })) {
11420
11436
  return;
11421
11437
  }
11422
- const handled = _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _205 => _205.navigation, 'access', _206 => _206.navigate, 'optionalCall', _207 => _207({ href, path, targetPlatform })]), () => ( false));
11438
+ const handled = _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _209 => _209.navigation, 'access', _210 => _210.navigate, 'optionalCall', _211 => _211({ href, path, targetPlatform })]), () => ( false));
11423
11439
  if (!handled) {
11424
11440
  if (fallbackNavigate) fallbackNavigate(target);
11425
11441
  else window.location.assign(target);
@@ -11478,7 +11494,7 @@ function NavLinkAnchorViaRuntime({
11478
11494
  targetPlatform,
11479
11495
  fallbackNavigate: router.push
11480
11496
  });
11481
- if (handled && !isNewTab && _optionalChain([panel, 'optionalAccess', _208 => _208.closeChat])) panel.closeChat();
11497
+ if (handled && !isNewTab && _optionalChain([panel, 'optionalAccess', _212 => _212.closeChat])) panel.closeChat();
11482
11498
  };
11483
11499
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href: resolvedHref, ..._chunkEMF64FWAcjs.newTabAnchorAttrs.call(void 0, isNewTab), onClick, className, children });
11484
11500
  }
@@ -11544,11 +11560,11 @@ var DEFAULT_CAPTIONS_PATH = "/api/captions";
11544
11560
  function getCaptionsUrl(entityType, entityId, srtContent, options) {
11545
11561
  if (!srtContent) return void 0;
11546
11562
  const hash = `${srtContent.length}-${srtContent.slice(0, 8).replace(/\s/g, "")}`;
11547
- const variant = _optionalChain([options, 'optionalAccess', _209 => _209.variant]) ? `&variant=${options.variant}` : "";
11563
+ const variant = _optionalChain([options, 'optionalAccess', _213 => _213.variant]) ? `&variant=${options.variant}` : "";
11548
11564
  return `${DEFAULT_CAPTIONS_PATH}/${entityType}/${entityId}?v=${hash}${variant}`;
11549
11565
  }
11550
11566
  function resolveCaptionsBase(endpoints) {
11551
- return _optionalChain([endpoints, 'optionalAccess', _210 => _210.captionsUrlPrefix]) || DEFAULT_CAPTIONS_PATH;
11567
+ return _optionalChain([endpoints, 'optionalAccess', _214 => _214.captionsUrlPrefix]) || DEFAULT_CAPTIONS_PATH;
11552
11568
  }
11553
11569
  function rebaseCaptionsUrl(endpoints, url) {
11554
11570
  if (!url || !url.startsWith(`${DEFAULT_CAPTIONS_PATH}/`)) return url;
@@ -11658,7 +11674,7 @@ TabsContent.displayName = TabsPrimitive.Content.displayName;
11658
11674
  // src/components/features/use-captions.ts
11659
11675
 
11660
11676
  function useCaptions() {
11661
- const endpoints = _nullishCoalesce(_optionalChain([_chunkRDTOMWDNcjs.useChatRuntime.call(void 0, ), 'optionalAccess', _211 => _211.endpoints]), () => ( null));
11677
+ const endpoints = _nullishCoalesce(_optionalChain([_chunkRDTOMWDNcjs.useChatRuntime.call(void 0, ), 'optionalAccess', _215 => _215.endpoints]), () => ( null));
11662
11678
  return _react.useMemo.call(void 0,
11663
11679
  () => ({
11664
11680
  forEntity: (entityType, entity) => getEntityCaptionUrls(endpoints, entityType, entity),
@@ -11687,11 +11703,11 @@ function fetchPriorityProp(priority) {
11687
11703
  var ENTER_FULLSCREEN_REQUEST = "mediaenterfullscreenrequest";
11688
11704
  function isIosAppShell() {
11689
11705
  const capacitor = globalThis.Capacitor;
11690
- return _optionalChain([capacitor, 'optionalAccess', _212 => _212.isNativePlatform, 'optionalCall', _213 => _213()]) === true && _optionalChain([capacitor, 'access', _214 => _214.getPlatform, 'optionalCall', _215 => _215()]) === "ios";
11706
+ return _optionalChain([capacitor, 'optionalAccess', _216 => _216.isNativePlatform, 'optionalCall', _217 => _217()]) === true && _optionalChain([capacitor, 'access', _218 => _218.getPlatform, 'optionalCall', _219 => _219()]) === "ios";
11691
11707
  }
11692
11708
  function nativeVideoElement(player) {
11693
11709
  const media = player.media;
11694
- const element = _nullishCoalesce(_optionalChain([media, 'optionalAccess', _216 => _216.nativeEl]), () => ( media));
11710
+ const element = _nullishCoalesce(_optionalChain([media, 'optionalAccess', _220 => _220.nativeEl]), () => ( media));
11695
11711
  return element instanceof HTMLVideoElement ? element : null;
11696
11712
  }
11697
11713
  function useIosNativeVideoFullscreen(playerRef) {
@@ -11701,7 +11717,7 @@ function useIosNativeVideoFullscreen(playerRef) {
11701
11717
  if (!(player instanceof EventTarget)) return void 0;
11702
11718
  const takeOver = (event) => {
11703
11719
  const video = nativeVideoElement(player);
11704
- if (!_optionalChain([video, 'optionalAccess', _217 => _217.webkitSupportsFullscreen]) || typeof video.webkitEnterFullscreen !== "function") return;
11720
+ if (!_optionalChain([video, 'optionalAccess', _221 => _221.webkitSupportsFullscreen]) || typeof video.webkitEnterFullscreen !== "function") return;
11705
11721
  event.stopImmediatePropagation();
11706
11722
  video.webkitEnterFullscreen();
11707
11723
  };
@@ -11735,11 +11751,11 @@ function toMuxPreviewUrl(url, maxResolution = "720p") {
11735
11751
  function saveDataEnabled() {
11736
11752
  if (typeof navigator === "undefined") return false;
11737
11753
  const conn = navigator.connection;
11738
- return _optionalChain([conn, 'optionalAccess', _218 => _218.saveData]) === true;
11754
+ return _optionalChain([conn, 'optionalAccess', _222 => _222.saveData]) === true;
11739
11755
  }
11740
11756
  function useVideoOriginPreconnect({ supabaseStorageOrigin } = {}) {
11741
11757
  const runtime = _chunkRDTOMWDNcjs.useChatRuntime.call(void 0, );
11742
- const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess', _219 => _219.endpoints, 'access', _220 => _220.supabaseStorageOrigin])));
11758
+ const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess', _223 => _223.endpoints, 'access', _224 => _224.supabaseStorageOrigin])));
11743
11759
  try {
11744
11760
  _reactdom2.default.preconnect(MUX_STREAM_ORIGIN, { crossOrigin: "anonymous" });
11745
11761
  _reactdom2.default.preconnect(MUX_IMAGE_ORIGIN, { crossOrigin: "anonymous" });
@@ -11758,7 +11774,7 @@ function useVideoWarmup({
11758
11774
  nearMargin = "1000px"
11759
11775
  } = {}) {
11760
11776
  const runtime = _chunkRDTOMWDNcjs.useChatRuntime.call(void 0, );
11761
- const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess', _221 => _221.endpoints, 'access', _222 => _222.supabaseStorageOrigin])));
11777
+ const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess', _225 => _225.endpoints, 'access', _226 => _226.supabaseStorageOrigin])));
11762
11778
  useVideoOriginPreconnect({ supabaseStorageOrigin: resolvedOrigin });
11763
11779
  const { ref, isNear } = _chunkZI27ALYXcjs.useNearViewport.call(void 0, nearMargin);
11764
11780
  _react.useEffect.call(void 0, () => {
@@ -11860,7 +11876,7 @@ if (typeof document !== "undefined") {
11860
11876
  }
11861
11877
  if (typeof window !== "undefined") {
11862
11878
  const w = window;
11863
- if (!_optionalChain([w, 'access', _223 => _223.chrome, 'optionalAccess', _224 => _224.cast])) {
11879
+ if (!_optionalChain([w, 'access', _227 => _227.chrome, 'optionalAccess', _228 => _228.cast])) {
11864
11880
  w.chrome = { ..._nullishCoalesce(w.chrome, () => ( {})), cast: { isAvailable: false } };
11865
11881
  }
11866
11882
  }
@@ -12116,7 +12132,7 @@ function FilePlayer({
12116
12132
  const clearPerfListener = _react.useCallback.call(void 0, () => {
12117
12133
  if (perfListenerRef.current) {
12118
12134
  try {
12119
- _optionalChain([hoverPlayerRef, 'access', _225 => _225.current, 'optionalAccess', _226 => _226.removeEventListener, 'optionalCall', _227 => _227("playing", perfListenerRef.current)]);
12135
+ _optionalChain([hoverPlayerRef, 'access', _229 => _229.current, 'optionalAccess', _230 => _230.removeEventListener, 'optionalCall', _231 => _231("playing", perfListenerRef.current)]);
12120
12136
  } catch (e21) {
12121
12137
  }
12122
12138
  perfListenerRef.current = null;
@@ -12151,7 +12167,7 @@ function FilePlayer({
12151
12167
  };
12152
12168
  perfListenerRef.current = onPlaying;
12153
12169
  try {
12154
- _optionalChain([el, 'access', _228 => _228.addEventListener, 'optionalCall', _229 => _229("playing", onPlaying)]);
12170
+ _optionalChain([el, 'access', _232 => _232.addEventListener, 'optionalCall', _233 => _233("playing", onPlaying)]);
12155
12171
  } catch (e22) {
12156
12172
  }
12157
12173
  }
@@ -12159,12 +12175,12 @@ function FilePlayer({
12159
12175
  el.volume = 0.5;
12160
12176
  if (userHasInteracted) {
12161
12177
  el.muted = mutedIntentRef.current;
12162
- _optionalChain([el, 'access', _230 => _230.play, 'optionalCall', _231 => _231(), 'optionalAccess', _232 => _232.catch, 'optionalCall', _233 => _233((err) => {
12163
- const name = _optionalChain([err, 'optionalAccess', _234 => _234.name]);
12178
+ _optionalChain([el, 'access', _234 => _234.play, 'optionalCall', _235 => _235(), 'optionalAccess', _236 => _236.catch, 'optionalCall', _237 => _237((err) => {
12179
+ const name = _optionalChain([err, 'optionalAccess', _238 => _238.name]);
12164
12180
  if (name === "NotAllowedError" && hoverActiveRef.current && generation === hoverGenerationRef.current) {
12165
12181
  try {
12166
12182
  el.muted = true;
12167
- _optionalChain([el, 'access', _235 => _235.play, 'optionalCall', _236 => _236(), 'optionalAccess', _237 => _237.catch, 'optionalCall', _238 => _238(() => {
12183
+ _optionalChain([el, 'access', _239 => _239.play, 'optionalCall', _240 => _240(), 'optionalAccess', _241 => _241.catch, 'optionalCall', _242 => _242(() => {
12168
12184
  if (hoverActiveRef.current && generation === hoverGenerationRef.current) {
12169
12185
  setMutedFallbackBlocked(true);
12170
12186
  }
@@ -12176,7 +12192,7 @@ function FilePlayer({
12176
12192
  })]);
12177
12193
  } else {
12178
12194
  el.muted = true;
12179
- _optionalChain([el, 'access', _239 => _239.play, 'optionalCall', _240 => _240(), 'optionalAccess', _241 => _241.catch, 'optionalCall', _242 => _242(() => {
12195
+ _optionalChain([el, 'access', _243 => _243.play, 'optionalCall', _244 => _244(), 'optionalAccess', _245 => _245.catch, 'optionalCall', _246 => _246(() => {
12180
12196
  if (hoverActiveRef.current && generation === hoverGenerationRef.current) {
12181
12197
  setMutedFallbackBlocked(true);
12182
12198
  }
@@ -12206,7 +12222,7 @@ function FilePlayer({
12206
12222
  clearActivationWaiter();
12207
12223
  clearPerfListener();
12208
12224
  try {
12209
- _optionalChain([hoverPlayerRef, 'access', _243 => _243.current, 'optionalAccess', _244 => _244.pause, 'optionalCall', _245 => _245()]);
12225
+ _optionalChain([hoverPlayerRef, 'access', _247 => _247.current, 'optionalAccess', _248 => _248.pause, 'optionalCall', _249 => _249()]);
12210
12226
  } catch (e26) {
12211
12227
  }
12212
12228
  }, [clearActivationWaiter, clearPerfListener]);
@@ -12218,7 +12234,7 @@ function FilePlayer({
12218
12234
  if (el) {
12219
12235
  el.muted = false;
12220
12236
  el.volume = 0.5;
12221
- _optionalChain([el, 'access', _246 => _246.play, 'optionalCall', _247 => _247(), 'optionalAccess', _248 => _248.catch, 'optionalCall', _249 => _249(() => {
12237
+ _optionalChain([el, 'access', _250 => _250.play, 'optionalCall', _251 => _251(), 'optionalAccess', _252 => _252.catch, 'optionalCall', _253 => _253(() => {
12222
12238
  })]);
12223
12239
  }
12224
12240
  } catch (e27) {
@@ -12238,7 +12254,7 @@ function FilePlayer({
12238
12254
  onMutedFallbackChangeRef.current = onMutedFallbackChange;
12239
12255
  });
12240
12256
  _react.useEffect.call(void 0, () => {
12241
- _optionalChain([onMutedFallbackChangeRef, 'access', _250 => _250.current, 'optionalCall', _251 => _251({
12257
+ _optionalChain([onMutedFallbackChangeRef, 'access', _254 => _254.current, 'optionalCall', _255 => _255({
12242
12258
  muted: hoverMutedFallback,
12243
12259
  blocked: hoverMutedFallback && mutedFallbackBlocked
12244
12260
  })]);
@@ -12257,7 +12273,7 @@ function FilePlayer({
12257
12273
  if (autoPlay) {
12258
12274
  const reportBlocked = () => setMutedFallbackBlocked(true);
12259
12275
  try {
12260
- _optionalChain([mutedEl, 'access', _252 => _252.play, 'optionalCall', _253 => _253(), 'optionalAccess', _254 => _254.catch, 'optionalCall', _255 => _255(reportBlocked)]);
12276
+ _optionalChain([mutedEl, 'access', _256 => _256.play, 'optionalCall', _257 => _257(), 'optionalAccess', _258 => _258.catch, 'optionalCall', _259 => _259(reportBlocked)]);
12261
12277
  } catch (e29) {
12262
12278
  reportBlocked();
12263
12279
  }
@@ -12271,12 +12287,12 @@ function FilePlayer({
12271
12287
  try {
12272
12288
  el.muted = false;
12273
12289
  el.volume = typeof el.volume === "number" ? el.volume : 1;
12274
- _optionalChain([el, 'access', _256 => _256.play, 'optionalCall', _257 => _257(), 'optionalAccess', _258 => _258.catch, 'optionalCall', _259 => _259((err) => {
12275
- const name = _optionalChain([err, 'optionalAccess', _260 => _260.name]);
12290
+ _optionalChain([el, 'access', _260 => _260.play, 'optionalCall', _261 => _261(), 'optionalAccess', _262 => _262.catch, 'optionalCall', _263 => _263((err) => {
12291
+ const name = _optionalChain([err, 'optionalAccess', _264 => _264.name]);
12276
12292
  if (name !== "NotAllowedError") return;
12277
12293
  try {
12278
12294
  el.muted = true;
12279
- _optionalChain([el, 'access', _261 => _261.play, 'optionalCall', _262 => _262(), 'optionalAccess', _263 => _263.catch, 'optionalCall', _264 => _264(() => {
12295
+ _optionalChain([el, 'access', _265 => _265.play, 'optionalCall', _266 => _266(), 'optionalAccess', _267 => _267.catch, 'optionalCall', _268 => _268(() => {
12280
12296
  setMutedFallbackBlocked(true);
12281
12297
  setHoverMutedFallback(true);
12282
12298
  })]);
@@ -12292,7 +12308,7 @@ function FilePlayer({
12292
12308
  }, [autoPlayUnmuted, startMuted, autoPlay]);
12293
12309
  _react.useEffect.call(void 0, () => {
12294
12310
  const el = hoverPlayerRef.current;
12295
- if (!_optionalChain([el, 'optionalAccess', _265 => _265.addEventListener])) return void 0;
12311
+ if (!_optionalChain([el, 'optionalAccess', _269 => _269.addEventListener])) return void 0;
12296
12312
  const onVolumeChange = () => {
12297
12313
  if (el.muted === false) {
12298
12314
  setMutedFallbackBlocked(false);
@@ -12305,14 +12321,14 @@ function FilePlayer({
12305
12321
  }
12306
12322
  return () => {
12307
12323
  try {
12308
- _optionalChain([el, 'access', _266 => _266.removeEventListener, 'optionalCall', _267 => _267("volumechange", onVolumeChange)]);
12324
+ _optionalChain([el, 'access', _270 => _270.removeEventListener, 'optionalCall', _271 => _271("volumechange", onVolumeChange)]);
12309
12325
  } catch (e33) {
12310
12326
  }
12311
12327
  };
12312
12328
  }, []);
12313
12329
  _react.useEffect.call(void 0, () => {
12314
12330
  const el = hoverPlayerRef.current;
12315
- if (!_optionalChain([el, 'optionalAccess', _268 => _268.addEventListener])) return void 0;
12331
+ if (!_optionalChain([el, 'optionalAccess', _272 => _272.addEventListener])) return void 0;
12316
12332
  const onPlaying = () => setMutedFallbackBlocked(false);
12317
12333
  try {
12318
12334
  el.addEventListener("playing", onPlaying);
@@ -12320,7 +12336,7 @@ function FilePlayer({
12320
12336
  }
12321
12337
  return () => {
12322
12338
  try {
12323
- _optionalChain([el, 'access', _269 => _269.removeEventListener, 'optionalCall', _270 => _270("playing", onPlaying)]);
12339
+ _optionalChain([el, 'access', _273 => _273.removeEventListener, 'optionalCall', _274 => _274("playing", onPlaying)]);
12324
12340
  } catch (e35) {
12325
12341
  }
12326
12342
  };
@@ -12331,15 +12347,15 @@ function FilePlayer({
12331
12347
  });
12332
12348
  _react.useEffect.call(void 0, () => {
12333
12349
  const el = hoverPlayerRef.current;
12334
- if (!_optionalChain([el, 'optionalAccess', _271 => _271.addEventListener])) return void 0;
12335
- const handler = () => _optionalChain([onEndedRef, 'access', _272 => _272.current, 'optionalCall', _273 => _273()]);
12350
+ if (!_optionalChain([el, 'optionalAccess', _275 => _275.addEventListener])) return void 0;
12351
+ const handler = () => _optionalChain([onEndedRef, 'access', _276 => _276.current, 'optionalCall', _277 => _277()]);
12336
12352
  try {
12337
12353
  el.addEventListener("ended", handler);
12338
12354
  } catch (e36) {
12339
12355
  }
12340
12356
  return () => {
12341
12357
  try {
12342
- _optionalChain([el, 'access', _274 => _274.removeEventListener, 'optionalCall', _275 => _275("ended", handler)]);
12358
+ _optionalChain([el, 'access', _278 => _278.removeEventListener, 'optionalCall', _279 => _279("ended", handler)]);
12343
12359
  } catch (e37) {
12344
12360
  }
12345
12361
  };
@@ -12348,19 +12364,19 @@ function FilePlayer({
12348
12364
  _react.useImperativeHandle.call(void 0,
12349
12365
  playerHandleRef,
12350
12366
  () => ({
12351
- getCurrentTime: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _276 => _276.current, 'optionalAccess', _277 => _277.currentTime]), () => ( 0)),
12367
+ getCurrentTime: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _280 => _280.current, 'optionalAccess', _281 => _281.currentTime]), () => ( 0)),
12352
12368
  getDuration: () => {
12353
- const d = _optionalChain([hoverPlayerRef, 'access', _278 => _278.current, 'optionalAccess', _279 => _279.duration]);
12369
+ const d = _optionalChain([hoverPlayerRef, 'access', _282 => _282.current, 'optionalAccess', _283 => _283.duration]);
12354
12370
  return typeof d === "number" && isFinite(d) ? d : 0;
12355
12371
  },
12356
- getPaused: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _280 => _280.current, 'optionalAccess', _281 => _281.paused]), () => ( true)),
12357
- getMuted: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _282 => _282.current, 'optionalAccess', _283 => _283.muted]), () => ( false)),
12372
+ getPaused: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _284 => _284.current, 'optionalAccess', _285 => _285.paused]), () => ( true)),
12373
+ getMuted: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _286 => _286.current, 'optionalAccess', _287 => _287.muted]), () => ( false)),
12358
12374
  play: async () => {
12359
- await _optionalChain([hoverPlayerRef, 'access', _284 => _284.current, 'optionalAccess', _285 => _285.play, 'optionalCall', _286 => _286()]);
12375
+ await _optionalChain([hoverPlayerRef, 'access', _288 => _288.current, 'optionalAccess', _289 => _289.play, 'optionalCall', _290 => _290()]);
12360
12376
  },
12361
12377
  pause: () => {
12362
12378
  try {
12363
- _optionalChain([hoverPlayerRef, 'access', _287 => _287.current, 'optionalAccess', _288 => _288.pause, 'optionalCall', _289 => _289()]);
12379
+ _optionalChain([hoverPlayerRef, 'access', _291 => _291.current, 'optionalAccess', _292 => _292.pause, 'optionalCall', _293 => _293()]);
12364
12380
  } catch (e38) {
12365
12381
  }
12366
12382
  },
@@ -12427,10 +12443,10 @@ function FilePlayer({
12427
12443
  if (!el) return;
12428
12444
  const resumeAt = typeof el.currentTime === "number" ? el.currentTime : 0;
12429
12445
  try {
12430
- _optionalChain([el, 'access', _290 => _290.load, 'optionalCall', _291 => _291()]);
12446
+ _optionalChain([el, 'access', _294 => _294.load, 'optionalCall', _295 => _295()]);
12431
12447
  if (resumeAt > 0 && el.addEventListener && el.removeEventListener) {
12432
12448
  const seekBack = () => {
12433
- _optionalChain([el, 'access', _292 => _292.removeEventListener, 'optionalCall', _293 => _293("loadedmetadata", seekBack)]);
12449
+ _optionalChain([el, 'access', _296 => _296.removeEventListener, 'optionalCall', _297 => _297("loadedmetadata", seekBack)]);
12434
12450
  try {
12435
12451
  el.currentTime = resumeAt;
12436
12452
  } catch (e40) {
@@ -12438,7 +12454,7 @@ function FilePlayer({
12438
12454
  };
12439
12455
  el.addEventListener("loadedmetadata", seekBack);
12440
12456
  }
12441
- _optionalChain([el, 'access', _294 => _294.play, 'optionalCall', _295 => _295(), 'optionalAccess', _296 => _296.catch, 'optionalCall', _297 => _297(() => {
12457
+ _optionalChain([el, 'access', _298 => _298.play, 'optionalCall', _299 => _299(), 'optionalAccess', _300 => _300.catch, 'optionalCall', _301 => _301(() => {
12442
12458
  })]);
12443
12459
  } catch (e41) {
12444
12460
  }
@@ -12597,7 +12613,7 @@ function YouTubeFacadeInner({
12597
12613
  const iframe = iframeRef.current;
12598
12614
  if (!iframe) return void 0;
12599
12615
  function subscribe2() {
12600
- _optionalChain([iframe, 'optionalAccess', _298 => _298.contentWindow, 'optionalAccess', _299 => _299.postMessage, 'call', _300 => _300('{"event":"listening"}', YT_NOCOOKIE_ORIGIN)]);
12616
+ _optionalChain([iframe, 'optionalAccess', _302 => _302.contentWindow, 'optionalAccess', _303 => _303.postMessage, 'call', _304 => _304('{"event":"listening"}', YT_NOCOOKIE_ORIGIN)]);
12601
12617
  }
12602
12618
  iframe.addEventListener("load", subscribe2);
12603
12619
  subscribe2();
@@ -12618,13 +12634,13 @@ function YouTubeFacadeInner({
12618
12634
  return;
12619
12635
  }
12620
12636
  if (payload.event !== "infoDelivery") return;
12621
- const state = _optionalChain([payload, 'access', _301 => _301.info, 'optionalAccess', _302 => _302.playerState]);
12637
+ const state = _optionalChain([payload, 'access', _305 => _305.info, 'optionalAccess', _306 => _306.playerState]);
12622
12638
  if (typeof state !== "number") return;
12623
12639
  if (state === YT_STATE_PLAYING) {
12624
12640
  if (blurTimer !== null) return;
12625
12641
  blurTimer = setTimeout(() => {
12626
12642
  blurTimer = null;
12627
- _optionalChain([iframeRef, 'access', _303 => _303.current, 'optionalAccess', _304 => _304.blur, 'call', _305 => _305()]);
12643
+ _optionalChain([iframeRef, 'access', _307 => _307.current, 'optionalAccess', _308 => _308.blur, 'call', _309 => _309()]);
12628
12644
  }, YT_PLAYING_BLUR_DELAY_MS);
12629
12645
  return;
12630
12646
  }
@@ -12645,7 +12661,7 @@ function YouTubeFacadeInner({
12645
12661
  prevSuspendedRef.current = Boolean(suspended);
12646
12662
  if (!activated) return;
12647
12663
  if (suspended && !wasSuspended) {
12648
- _optionalChain([iframeRef, 'access', _306 => _306.current, 'optionalAccess', _307 => _307.contentWindow, 'optionalAccess', _308 => _308.postMessage, 'call', _309 => _309(
12664
+ _optionalChain([iframeRef, 'access', _310 => _310.current, 'optionalAccess', _311 => _311.contentWindow, 'optionalAccess', _312 => _312.postMessage, 'call', _313 => _313(
12649
12665
  '{"event":"command","func":"pauseVideo","args":[]}',
12650
12666
  YT_NOCOOKIE_ORIGIN
12651
12667
  )]);
@@ -12899,7 +12915,7 @@ function CardsStrip(props) {
12899
12915
  _react.useEffect.call(void 0, () => {
12900
12916
  const el = wrapperRef.current;
12901
12917
  if (!el || typeof IntersectionObserver === "undefined") return void 0;
12902
- const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access', _310 => _310[0], 'optionalAccess', _311 => _311.isIntersecting]), () => ( true))), {
12918
+ const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access', _314 => _314[0], 'optionalAccess', _315 => _315.isIntersecting]), () => ( true))), {
12903
12919
  rootMargin: "200px"
12904
12920
  });
12905
12921
  io.observe(el);
@@ -12921,9 +12937,9 @@ function CardsStrip(props) {
12921
12937
  const p = hoverPointerRef.current;
12922
12938
  if (!p.inside) return;
12923
12939
  const el = typeof document !== "undefined" ? document.elementFromPoint(p.x, p.y) : null;
12924
- const cardEl = _optionalChain([el, 'optionalAccess', _312 => _312.closest, 'optionalCall', _313 => _313("[data-strip-card-key]")]);
12925
- const scoped = cardEl && _optionalChain([scrollerRef, 'access', _314 => _314.current, 'optionalAccess', _315 => _315.contains, 'call', _316 => _316(cardEl)]) ? cardEl : null;
12926
- const key = _nullishCoalesce(_optionalChain([scoped, 'optionalAccess', _317 => _317.getAttribute, 'call', _318 => _318("data-strip-card-key")]), () => ( null));
12940
+ const cardEl = _optionalChain([el, 'optionalAccess', _316 => _316.closest, 'optionalCall', _317 => _317("[data-strip-card-key]")]);
12941
+ const scoped = cardEl && _optionalChain([scrollerRef, 'access', _318 => _318.current, 'optionalAccess', _319 => _319.contains, 'call', _320 => _320(cardEl)]) ? cardEl : null;
12942
+ const key = _nullishCoalesce(_optionalChain([scoped, 'optionalAccess', _321 => _321.getAttribute, 'call', _322 => _322("data-strip-card-key")]), () => ( null));
12927
12943
  const current = activeKeyRef.current;
12928
12944
  if (key === current) return;
12929
12945
  if (current !== null) deactivate(current);
@@ -12961,7 +12977,7 @@ function CardsStrip(props) {
12961
12977
  }, [syncHoverToPointer]);
12962
12978
  const seamBuffer = _react.useCallback.call(void 0, () => {
12963
12979
  const half = singleCopyWidthRef.current;
12964
- const viewport = _nullishCoalesce(_optionalChain([scrollerRef, 'access', _319 => _319.current, 'optionalAccess', _320 => _320.clientWidth]), () => ( 0));
12980
+ const viewport = _nullishCoalesce(_optionalChain([scrollerRef, 'access', _323 => _323.current, 'optionalAccess', _324 => _324.clientWidth]), () => ( 0));
12965
12981
  return Math.max(0, Math.min(200, half / 4, half - viewport - TRACK_GAP_PX - 1));
12966
12982
  }, []);
12967
12983
  const { posRef: marqueePosRef, glideBy } = _chunkZI27ALYXcjs.useMarqueeEngine.call(void 0, {
@@ -12977,7 +12993,7 @@ function CardsStrip(props) {
12977
12993
  const scroller = scrollerRef.current;
12978
12994
  if (scroller) scroller.scrollLeft = pos;
12979
12995
  },
12980
- readBack: () => _nullishCoalesce(_optionalChain([scrollerRef, 'access', _321 => _321.current, 'optionalAccess', _322 => _322.scrollLeft]), () => ( 0)),
12996
+ readBack: () => _nullishCoalesce(_optionalChain([scrollerRef, 'access', _325 => _325.current, 'optionalAccess', _326 => _326.scrollLeft]), () => ( 0)),
12981
12997
  onAfterFrame: syncHoverIfScrolled
12982
12998
  });
12983
12999
  const [mountedIdx, setMountedIdx] = _react.useState.call(void 0, () => /* @__PURE__ */ new Set());
@@ -13025,11 +13041,11 @@ function CardsStrip(props) {
13025
13041
  fn = (el) => {
13026
13042
  if (!el) return void 0;
13027
13043
  cardElIdxRef.current.set(el, idx);
13028
- _optionalChain([cardObserverRef, 'access', _323 => _323.current, 'optionalAccess', _324 => _324.observe, 'call', _325 => _325(el)]);
13044
+ _optionalChain([cardObserverRef, 'access', _327 => _327.current, 'optionalAccess', _328 => _328.observe, 'call', _329 => _329(el)]);
13029
13045
  return () => {
13030
13046
  cardElIdxRef.current.delete(el);
13031
13047
  cardElNearRef.current.delete(el);
13032
- _optionalChain([cardObserverRef, 'access', _326 => _326.current, 'optionalAccess', _327 => _327.unobserve, 'call', _328 => _328(el)]);
13048
+ _optionalChain([cardObserverRef, 'access', _330 => _330.current, 'optionalAccess', _331 => _331.unobserve, 'call', _332 => _332(el)]);
13033
13049
  };
13034
13050
  };
13035
13051
  cardRefFns.set(idx, fn);
@@ -13048,7 +13064,7 @@ function CardsStrip(props) {
13048
13064
  const track = trackRef.current;
13049
13065
  if (!scroller || !track) return;
13050
13066
  const firstCard = track.firstElementChild;
13051
- const step = (_nullishCoalesce(_optionalChain([firstCard, 'optionalAccess', _329 => _329.offsetWidth]), () => ( 320))) + TRACK_GAP_PX;
13067
+ const step = (_nullishCoalesce(_optionalChain([firstCard, 'optionalAccess', _333 => _333.offsetWidth]), () => ( 320))) + TRACK_GAP_PX;
13052
13068
  chevronSuppressUntilRef.current = performance.now() + CHEVRON_SUPPRESS_MS;
13053
13069
  if (marqueeActiveRef.current) {
13054
13070
  glideBy(dir * step);
@@ -13105,7 +13121,7 @@ function CardsStrip(props) {
13105
13121
  {
13106
13122
  ref: (node) => {
13107
13123
  wrapperRef.current = node;
13108
- _optionalChain([rootRef, 'optionalCall', _330 => _330(node)]);
13124
+ _optionalChain([rootRef, 'optionalCall', _334 => _334(node)]);
13109
13125
  },
13110
13126
  className: _chunkPRPZBXWZcjs.cn.call(void 0, "flex w-full min-w-0 flex-col gap-6", className),
13111
13127
  children: [
@@ -13217,7 +13233,7 @@ function VideoHoverPreviewSurface({
13217
13233
  if (gateControlled) return void 0;
13218
13234
  const el = rootElRef.current;
13219
13235
  if (!el || typeof IntersectionObserver === "undefined") return void 0;
13220
- const io = new IntersectionObserver((entries) => setIsNear(_nullishCoalesce(_optionalChain([entries, 'access', _331 => _331[0], 'optionalAccess', _332 => _332.isIntersecting]), () => ( false))), {
13236
+ const io = new IntersectionObserver((entries) => setIsNear(_nullishCoalesce(_optionalChain([entries, 'access', _335 => _335[0], 'optionalAccess', _336 => _336.isIntersecting]), () => ( false))), {
13221
13237
  rootMargin: _chunkZI27ALYXcjs.NEAR_VIEWPORT_ROOT_MARGIN
13222
13238
  });
13223
13239
  io.observe(el);
@@ -13362,7 +13378,7 @@ function VideoBitesStrip({
13362
13378
  const filtered = filterPublished ? bites.filter((b) => b.published) : [...bites];
13363
13379
  return filtered.sort(sortComparator);
13364
13380
  }, [bites, filterPublished, sortComparator]);
13365
- const warmup = useVideoWarmup({ videoUrl: _optionalChain([items, 'access', _333 => _333[0], 'optionalAccess', _334 => _334.url]) || null });
13381
+ const warmup = useVideoWarmup({ videoUrl: _optionalChain([items, 'access', _337 => _337[0], 'optionalAccess', _338 => _338.url]) || null });
13366
13382
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
13367
13383
  CardsStrip,
13368
13384
  {
@@ -13429,8 +13445,8 @@ function VideoBiteCard({
13429
13445
  const controlled = active !== void 0;
13430
13446
  const [selfActive, setSelfActive] = _react.useState.call(void 0, false);
13431
13447
  const isActive = controlled ? !!active : selfActive;
13432
- const activate = () => controlled ? _optionalChain([onActivate, 'optionalCall', _335 => _335(key)]) : setSelfActive(true);
13433
- const deactivate = () => controlled ? _optionalChain([onDeactivate, 'optionalCall', _336 => _336(key)]) : setSelfActive(false);
13448
+ const activate = () => controlled ? _optionalChain([onActivate, 'optionalCall', _339 => _339(key)]) : setSelfActive(true);
13449
+ const deactivate = () => controlled ? _optionalChain([onDeactivate, 'optionalCall', _340 => _340(key)]) : setSelfActive(false);
13434
13450
  const titleInputRef = _react.useRef.call(void 0, null);
13435
13451
  _chunkZI27ALYXcjs.useIsomorphicLayoutEffect.call(void 0, () => {
13436
13452
  const el = titleInputRef.current;
@@ -13440,7 +13456,7 @@ function VideoBiteCard({
13440
13456
  });
13441
13457
  const navigate = () => {
13442
13458
  if (bite.onNavigate) bite.onNavigate();
13443
- else _optionalChain([onBiteNavigate, 'optionalCall', _337 => _337(bite, index)]);
13459
+ else _optionalChain([onBiteNavigate, 'optionalCall', _341 => _341(bite, index)]);
13444
13460
  };
13445
13461
  const handlePointerEnter = () => {
13446
13462
  if (!isTouch) activate();
@@ -13465,9 +13481,9 @@ function VideoBiteCard({
13465
13481
  placeholder: "Title (optional)",
13466
13482
  "aria-label": "Bite title",
13467
13483
  rows: 1,
13468
- onChange: (e) => _optionalChain([onTitleChange, 'optionalCall', _338 => _338(e.target.value)]),
13484
+ onChange: (e) => _optionalChain([onTitleChange, 'optionalCall', _342 => _342(e.target.value)]),
13469
13485
  ref: titleInputRef,
13470
- onBlur: (e) => _optionalChain([onTitleCommit, 'optionalCall', _339 => _339(e.target.value)]),
13486
+ onBlur: (e) => _optionalChain([onTitleCommit, 'optionalCall', _343 => _343(e.target.value)]),
13471
13487
  onClick: (e) => e.stopPropagation(),
13472
13488
  className: _chunkPRPZBXWZcjs.cn.call(void 0,
13473
13489
  titleClass,
@@ -13544,7 +13560,7 @@ function VideoBiteCard({
13544
13560
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
13545
13561
  "div",
13546
13562
  {
13547
- ref: (node) => _optionalChain([rootRef, 'optionalCall', _340 => _340(node)]),
13563
+ ref: (node) => _optionalChain([rootRef, 'optionalCall', _344 => _344(node)]),
13548
13564
  "aria-hidden": isClone || void 0,
13549
13565
  "data-strip-card-key": key,
13550
13566
  className: _chunkPRPZBXWZcjs.cn.call(void 0,
@@ -13599,8 +13615,8 @@ function EntityVideoSection({
13599
13615
  const hasHighlight = !!highlightVideoUrl;
13600
13616
  const hasVideo = hasFullVideo || hasHighlight;
13601
13617
  const derivedCaptions = captionsEntity ? captions.forEntityId(captionsEntity.type, captionsEntity.id) : null;
13602
- const captionsUrl = _nullishCoalesce(captionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess', _341 => _341.captionsUrl])));
13603
- const highlightCaptionsUrl = _nullishCoalesce(highlightCaptionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess', _342 => _342.highlightCaptionsUrl])));
13618
+ const captionsUrl = _nullishCoalesce(captionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess', _345 => _345.captionsUrl])));
13619
+ const highlightCaptionsUrl = _nullishCoalesce(highlightCaptionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess', _346 => _346.highlightCaptionsUrl])));
13604
13620
  if (!hasVideo && !videoSummary && (!videoBites || videoBites.length === 0)) {
13605
13621
  return null;
13606
13622
  }
@@ -14119,7 +14135,7 @@ function DataRoomDocCard({ item, className, badgeText, anchorProps }) {
14119
14135
  ] }) : null,
14120
14136
  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
14137
  ] }),
14122
- _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
14138
+ _optionalChain([anchorProps, 'optionalAccess', _347 => _347.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
14139
  ] });
14124
14140
  if (!anchorProps) {
14125
14141
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `${_chunkEMF64FWAcjs.COMPACT_CARD_OUTER_STATIC} ${_nullishCoalesce(className, () => ( ""))}`, "aria-label": "No link available", children: body });
@@ -14147,7 +14163,7 @@ function DataRoomDocCardSkeleton({ className }) {
14147
14163
 
14148
14164
 
14149
14165
  function CampaignCardAdmin({ campaign, className, anchorProps }) {
14150
- const goalsCount = _optionalChain([campaign, 'access', _344 => _344.goals, 'optionalAccess', _345 => _345.length]) || 0;
14166
+ const goalsCount = _optionalChain([campaign, 'access', _348 => _348.goals, 'optionalAccess', _349 => _349.length]) || 0;
14151
14167
  const innerChildren = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
14152
14168
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: _chunkEMF64FWAcjs.COMPACT_CARD_ICON_SLOT, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Megaphone, { className: "h-5 w-5" }) }),
14153
14169
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: _chunkEMF64FWAcjs.COMPACT_CARD_TEXT_COL, children: [
@@ -14235,6 +14251,190 @@ function GenericEntityCardSkeleton({ className }) {
14235
14251
  // src/components/chat/entity-cards/dispatch.tsx
14236
14252
 
14237
14253
 
14254
+ // src/chat-protocol/source-metadata.ts
14255
+ var CARD_REFERENCE = /^\[card:\/\/([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)\]$/;
14256
+ var SOURCE_METADATA_MATCHED = "sourceMetadataMatched";
14257
+ function isSourceMetadataCardRef(ref) {
14258
+ return _optionalChain([ref, 'access', _350 => _350.metadata, 'optionalAccess', _351 => _351[SOURCE_METADATA_MATCHED]]) === true;
14259
+ }
14260
+ function requiredString(value) {
14261
+ if (typeof value !== "string") return null;
14262
+ const normalized = value.trim();
14263
+ return normalized ? normalized : null;
14264
+ }
14265
+ function optionalString(value) {
14266
+ return _nullishCoalesce(requiredString(value), () => ( void 0));
14267
+ }
14268
+ function httpsUrl(value) {
14269
+ const candidate = optionalString(value);
14270
+ if (!candidate) return void 0;
14271
+ try {
14272
+ return new URL(candidate).protocol === "https:" ? candidate : void 0;
14273
+ } catch (e45) {
14274
+ return void 0;
14275
+ }
14276
+ }
14277
+ function youtubeId(value) {
14278
+ const candidate = optionalString(value);
14279
+ if (!candidate) return void 0;
14280
+ if (/^[A-Za-z0-9_-]{11}$/.test(candidate)) return candidate;
14281
+ const url = httpsUrl(candidate);
14282
+ if (!url) return void 0;
14283
+ const parsed = new URL(url);
14284
+ const hostname = parsed.hostname.toLowerCase();
14285
+ const youtubeHost = hostname === "youtu.be" || hostname === "youtube.com" || hostname.endsWith(".youtube.com");
14286
+ if (!youtubeHost) return void 0;
14287
+ 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]]);
14288
+ const id = _nullishCoalesce(_nullishCoalesce(pathId, () => ( parsed.searchParams.get("v"))), () => ( void 0));
14289
+ return id && /^[A-Za-z0-9_-]{11}$/.test(id) ? id : void 0;
14290
+ }
14291
+ function nullableString(value) {
14292
+ return value === null ? null : optionalString(value);
14293
+ }
14294
+ function normalizeSourceItems(value) {
14295
+ if (!Array.isArray(value)) return void 0;
14296
+ const items = value.flatMap((candidate) => {
14297
+ if (!candidate || typeof candidate !== "object" || Array.isArray(candidate)) return [];
14298
+ const item = candidate;
14299
+ const id = requiredString(item.id);
14300
+ const documentType = requiredString(item.documentType);
14301
+ const name = requiredString(item.name);
14302
+ if (!id || !documentType || !name) return [];
14303
+ const externalUrl = httpsUrl(item.externalUrl);
14304
+ const targetPlatform = nullableString(item.targetPlatform);
14305
+ const path = nullableString(item.path);
14306
+ return [
14307
+ {
14308
+ id,
14309
+ documentType,
14310
+ name,
14311
+ ...externalUrl ? { externalUrl } : {},
14312
+ ...targetPlatform !== void 0 ? { targetPlatform } : {},
14313
+ ...path !== void 0 ? { path } : {}
14314
+ }
14315
+ ];
14316
+ });
14317
+ return items.length > 0 ? items : void 0;
14318
+ }
14319
+ function normalizeSources(value) {
14320
+ if (!Array.isArray(value)) return [];
14321
+ const seen = /* @__PURE__ */ new Set();
14322
+ const sources = [];
14323
+ for (const candidate of value) {
14324
+ if (!candidate || typeof candidate !== "object" || Array.isArray(candidate)) continue;
14325
+ const source = candidate;
14326
+ const index = source.index;
14327
+ const name = requiredString(source.name);
14328
+ const path = requiredString(source.path);
14329
+ const documentType = requiredString(source.documentType);
14330
+ const validIndex = typeof index === "number" && Number.isFinite(index) && Number.isInteger(index) && index > 0 && !seen.has(index);
14331
+ if (!validIndex || !name || !path || !documentType) continue;
14332
+ seen.add(index);
14333
+ const externalUrl = httpsUrl(source.externalUrl);
14334
+ const targetPlatform = nullableString(source.targetPlatform);
14335
+ const id = optionalString(source.id);
14336
+ const sourceRepo = optionalString(source.sourceRepo);
14337
+ const label = optionalString(source.label);
14338
+ const items = normalizeSourceItems(source.items);
14339
+ sources.push({
14340
+ index,
14341
+ name,
14342
+ path,
14343
+ documentType,
14344
+ ...externalUrl ? { externalUrl } : {},
14345
+ ...targetPlatform !== void 0 ? { targetPlatform } : {},
14346
+ ...id ? { id } : {},
14347
+ ...sourceRepo ? { sourceRepo } : {},
14348
+ ...label ? { label } : {},
14349
+ ...items ? { items } : {}
14350
+ });
14351
+ }
14352
+ return sources;
14353
+ }
14354
+ function normalizeVideoMetadata(value) {
14355
+ if (!value || typeof value !== "object" || Array.isArray(value)) return {};
14356
+ const input = value;
14357
+ const metadata = {};
14358
+ for (const key of ["videoUrl", "highlightVideoUrl", "videoPoster", "highlightVideoPoster"]) {
14359
+ const url = httpsUrl(input[key]);
14360
+ if (url) metadata[key] = url;
14361
+ }
14362
+ const id = youtubeId(input.youtubeUrl);
14363
+ if (id) metadata.youtubeUrl = id;
14364
+ return metadata;
14365
+ }
14366
+ function normalizeVideos(value) {
14367
+ if (!Array.isArray(value)) return [];
14368
+ return value.flatMap((candidate) => {
14369
+ if (!candidate || typeof candidate !== "object" || Array.isArray(candidate)) return [];
14370
+ const video = candidate;
14371
+ const match = typeof video.ref === "string" ? CARD_REFERENCE.exec(video.ref) : null;
14372
+ if (!match || match[1] !== "video") return [];
14373
+ const id = match[2];
14374
+ const title = _nullishCoalesce(optionalString(video.title), () => ( id));
14375
+ const url = _nullishCoalesce(httpsUrl(video.url), () => ( null));
14376
+ const sourceRepo = optionalString(video.sourceRepo);
14377
+ const metadata = normalizeVideoMetadata(video.metadata);
14378
+ if (url) {
14379
+ const idFromUrl = youtubeId(url);
14380
+ if (idFromUrl) {
14381
+ metadata.youtubeUrl = idFromUrl;
14382
+ delete metadata.videoUrl;
14383
+ } else {
14384
+ metadata.videoUrl = url;
14385
+ delete metadata.youtubeUrl;
14386
+ }
14387
+ }
14388
+ return [
14389
+ {
14390
+ type: "video",
14391
+ id,
14392
+ title,
14393
+ url,
14394
+ ...sourceRepo ? { sourceRepo } : {},
14395
+ ...Object.keys(metadata).length > 0 ? { metadata } : {}
14396
+ }
14397
+ ];
14398
+ });
14399
+ }
14400
+ function normalizeCards(value, sources) {
14401
+ if (!Array.isArray(value)) return [];
14402
+ return value.flatMap((candidate) => {
14403
+ if (!candidate || typeof candidate !== "object" || Array.isArray(candidate)) return [];
14404
+ const card = candidate;
14405
+ const match = typeof card.ref === "string" ? CARD_REFERENCE.exec(card.ref) : null;
14406
+ if (!match || match[1] === "video") return [];
14407
+ const type = requiredString(card.entityType);
14408
+ const id = requiredString(card.entityId);
14409
+ if (!type || !id || type !== match[1] || id !== match[2]) return [];
14410
+ const source = sources.find((item) => item.id === id && item.documentType === type);
14411
+ const ref = {
14412
+ type,
14413
+ id,
14414
+ title: _nullishCoalesce(_optionalChain([source, 'optionalAccess', _356 => _356.name]), () => ( id)),
14415
+ url: _nullishCoalesce(_optionalChain([source, 'optionalAccess', _357 => _357.externalUrl]), () => ( null)),
14416
+ ..._optionalChain([source, 'optionalAccess', _358 => _358.sourceRepo]) ? { sourceRepo: source.sourceRepo } : {},
14417
+ ..._optionalChain([source, 'optionalAccess', _359 => _359.targetPlatform]) !== void 0 ? { targetPlatform: source.targetPlatform } : {},
14418
+ ..._optionalChain([source, 'optionalAccess', _360 => _360.path]) ? { metadata: { path: source.path, [SOURCE_METADATA_MATCHED]: true } } : {}
14419
+ };
14420
+ return [ref];
14421
+ });
14422
+ }
14423
+ function sourceMetadataEvent(payload) {
14424
+ if (!payload || typeof payload !== "object" || Array.isArray(payload)) return null;
14425
+ const metadata = payload;
14426
+ const sources = normalizeSources(metadata.sources);
14427
+ const refs = [...normalizeVideos(metadata.videos), ...normalizeCards(metadata.cards, sources)];
14428
+ const refsByIdentity = /* @__PURE__ */ new Map();
14429
+ refs.forEach((ref) => {
14430
+ const identity = `${ref.type}:${ref.id}`;
14431
+ if (!refsByIdentity.has(identity)) refsByIdentity.set(identity, ref);
14432
+ });
14433
+ const uniqueRefs = Array.from(refsByIdentity.values());
14434
+ if (sources.length === 0 && uniqueRefs.length === 0) return null;
14435
+ return { type: "sources", sources, ...uniqueRefs.length > 0 ? { refs: uniqueRefs } : {} };
14436
+ }
14437
+
14238
14438
  // src/utils/faq-anchor.ts
14239
14439
  function faqSectionSlug(section) {
14240
14440
  return "faq-" + section.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
@@ -14441,7 +14641,7 @@ function pickFetchedCardHref({
14441
14641
  itemHref,
14442
14642
  allowComposed
14443
14643
  }) {
14444
- if (_optionalChain([composed, 'optionalAccess', _346 => _346.hostOverride])) {
14644
+ if (_optionalChain([composed, 'optionalAccess', _361 => _361.hostOverride])) {
14445
14645
  return { source: "hostOverride", href: composed.href, targetPlatform: composed.targetPlatform };
14446
14646
  }
14447
14647
  if (itemHref) return { source: "item", href: itemHref };
@@ -14636,7 +14836,7 @@ function resolveSourceRowCTA(row, ctx = {}) {
14636
14836
  if (row.path && shouldFallbackToPathNav(row) && !row.externalUrl) {
14637
14837
  const safePath = sanitizePath(row.path);
14638
14838
  if (safePath) {
14639
- const docTarget = row.documentType ? _optionalChain([ctx, 'access', _347 => _347.docPlatformTargets, 'optionalAccess', _348 => _348[row.documentType]]) : void 0;
14839
+ const docTarget = row.documentType ? _optionalChain([ctx, 'access', _362 => _362.docPlatformTargets, 'optionalAccess', _363 => _363[row.documentType]]) : void 0;
14640
14840
  if (docTarget) {
14641
14841
  const seg = docTarget.basePath.split("/").filter(Boolean).join("/");
14642
14842
  const base = `${_chunkPRPZBXWZcjs.getBaseUrl.call(void 0, docTarget.platform)}${seg ? `/${seg}` : ""}/`;
@@ -14779,8 +14979,8 @@ function cardMenuGroups(href, discuss, openDetails, externalLink) {
14779
14979
  if (href) {
14780
14980
  items.push({
14781
14981
  id: "open-details",
14782
- label: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess', _349 => _349.label]), () => ( "Open Details")),
14783
- icon: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess', _350 => _350.icon]), () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.EyeIcon, { size: 20 }))),
14982
+ label: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess', _364 => _364.label]), () => ( "Open Details")),
14983
+ icon: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess', _365 => _365.icon]), () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.EyeIcon, { size: 20 }))),
14784
14984
  // Main row → open the entity (same tab, soft Link nav).
14785
14985
  href,
14786
14986
  // Trailing 40px ↗ side-button → open in a new tab.
@@ -14814,6 +15014,14 @@ function hubspotStatusToVariant(status) {
14814
15014
  if (s === "OPEN") return "warning";
14815
15015
  return "grey";
14816
15016
  }
15017
+ function validatedHttpsUrl(value) {
15018
+ if (typeof value !== "string") return null;
15019
+ try {
15020
+ return new URL(value).protocol === "https:" ? value : null;
15021
+ } catch (e46) {
15022
+ return null;
15023
+ }
15024
+ }
14817
15025
  function decodeVideoMarkerId(id) {
14818
15026
  const mux = id.match(/^mux-([A-Za-z0-9_-]+)$/);
14819
15027
  if (mux) {
@@ -14826,32 +15034,52 @@ function decodeVideoMarkerId(id) {
14826
15034
  try {
14827
15035
  const b64 = mp4[1].replace(/-/g, "+").replace(/_/g, "/");
14828
15036
  const url = atob(b64);
14829
- if (!/^https:\/\//.test(url)) return null;
14830
- return { videoUrl: url };
14831
- } catch (e45) {
15037
+ const safeUrl = validatedHttpsUrl(url);
15038
+ return safeUrl ? { videoUrl: safeUrl } : null;
15039
+ } catch (e47) {
14832
15040
  return null;
14833
15041
  }
14834
15042
  }
14835
15043
  if (/^[A-Za-z0-9_-]{11}$/.test(id)) return { youtubeUrl: id };
14836
15044
  return null;
14837
15045
  }
15046
+ function validatedVideoMetadata(chatRef) {
15047
+ const input = _nullishCoalesce(chatRef.metadata, () => ( {}));
15048
+ const metadata = {};
15049
+ for (const key of ["videoUrl", "highlightVideoUrl", "videoPoster", "highlightVideoPoster"]) {
15050
+ const url = validatedHttpsUrl(input[key]);
15051
+ if (url) metadata[key] = url;
15052
+ }
15053
+ const youtubeUrl = input.youtubeUrl;
15054
+ if (typeof youtubeUrl === "string" && /^[A-Za-z0-9_-]{11}$/.test(youtubeUrl)) {
15055
+ metadata.youtubeUrl = youtubeUrl;
15056
+ }
15057
+ const safeUrl = validatedHttpsUrl(chatRef.url);
15058
+ if (safeUrl) {
15059
+ const youtubeId2 = extractYouTubeId(safeUrl);
15060
+ delete metadata.videoUrl;
15061
+ delete metadata.youtubeUrl;
15062
+ metadata[youtubeId2 ? "youtubeUrl" : "videoUrl"] = _nullishCoalesce(youtubeId2, () => ( safeUrl));
15063
+ }
15064
+ return Object.keys(metadata).length > 0 ? metadata : null;
15065
+ }
14838
15066
  function itemVideoMetadata(item) {
14839
15067
  const pick = (...vals) => {
14840
15068
  for (const v of vals) if (typeof v === "string" && v.length > 0) return v;
14841
15069
  return void 0;
14842
15070
  };
14843
- const m = _nullishCoalesce(_optionalChain([item, 'optionalAccess', _351 => _351.metadata]), () => ( {}));
15071
+ const m = _nullishCoalesce(_optionalChain([item, 'optionalAccess', _366 => _366.metadata]), () => ( {}));
14844
15072
  const out = {};
14845
- const videoUrl = pick(m.videoUrl, _optionalChain([item, 'optionalAccess', _352 => _352.custom_video_url]), _optionalChain([item, 'optionalAccess', _353 => _353.main_video_url]));
14846
- const youtubeUrl = pick(m.youtubeUrl, _optionalChain([item, 'optionalAccess', _354 => _354.youtube_url]), _optionalChain([item, 'optionalAccess', _355 => _355.testimonial_video_url]));
14847
- const highlightVideoUrl = pick(m.highlightVideoUrl, _optionalChain([item, 'optionalAccess', _356 => _356.highlight_video_url]));
15073
+ const videoUrl = pick(m.videoUrl, _optionalChain([item, 'optionalAccess', _367 => _367.custom_video_url]), _optionalChain([item, 'optionalAccess', _368 => _368.main_video_url]));
15074
+ const youtubeUrl = pick(m.youtubeUrl, _optionalChain([item, 'optionalAccess', _369 => _369.youtube_url]), _optionalChain([item, 'optionalAccess', _370 => _370.testimonial_video_url]));
15075
+ const highlightVideoUrl = pick(m.highlightVideoUrl, _optionalChain([item, 'optionalAccess', _371 => _371.highlight_video_url]));
14848
15076
  const videoPoster = pick(
14849
15077
  m.videoPoster,
14850
- _optionalChain([item, 'optionalAccess', _357 => _357.main_video_thumbnail]),
14851
- _optionalChain([item, 'optionalAccess', _358 => _358.highlight_video_thumbnail]),
14852
- _optionalChain([item, 'optionalAccess', _359 => _359.featured_image])
15078
+ _optionalChain([item, 'optionalAccess', _372 => _372.main_video_thumbnail]),
15079
+ _optionalChain([item, 'optionalAccess', _373 => _373.highlight_video_thumbnail]),
15080
+ _optionalChain([item, 'optionalAccess', _374 => _374.featured_image])
14853
15081
  );
14854
- const highlightVideoPoster = pick(m.highlightVideoPoster, _optionalChain([item, 'optionalAccess', _360 => _360.highlight_video_thumbnail]));
15082
+ const highlightVideoPoster = pick(m.highlightVideoPoster, _optionalChain([item, 'optionalAccess', _375 => _375.highlight_video_thumbnail]));
14855
15083
  if (videoUrl) out.videoUrl = videoUrl;
14856
15084
  if (youtubeUrl) out.youtubeUrl = youtubeUrl;
14857
15085
  if (highlightVideoUrl) out.highlightVideoUrl = highlightVideoUrl;
@@ -14881,15 +15109,15 @@ function fetchedItemDisplayRef(item, chatRef) {
14881
15109
  }
14882
15110
  function fetchedFaqDisplayRef(item, chatRef) {
14883
15111
  const it = item;
14884
- const answer = typeof _optionalChain([it, 'optionalAccess', _361 => _361.answer]) === "string" && it.answer.trim().length > 0 ? it.answer.trim() : null;
15112
+ const answer = typeof _optionalChain([it, 'optionalAccess', _376 => _376.answer]) === "string" && it.answer.trim().length > 0 ? it.answer.trim() : null;
14885
15113
  return {
14886
15114
  type: "faq",
14887
15115
  id: chatRef.id,
14888
15116
  sourceRepo: chatRef.sourceRepo,
14889
- title: typeof _optionalChain([it, 'optionalAccess', _362 => _362.question]) === "string" && it.question ? it.question : chatRef.id,
15117
+ title: typeof _optionalChain([it, 'optionalAccess', _377 => _377.question]) === "string" && it.question ? it.question : chatRef.id,
14890
15118
  url: _nullishCoalesce(chatRef.url, () => ( null)),
14891
15119
  ...answer ? { preview: answer.length > 400 ? `${answer.slice(0, 397)}\u2026` : answer } : {},
14892
- metadata: typeof _optionalChain([it, 'optionalAccess', _363 => _363.section]) === "string" && it.section ? { section: it.section } : {}
15120
+ metadata: typeof _optionalChain([it, 'optionalAccess', _378 => _378.section]) === "string" && it.section ? { section: it.section } : {}
14893
15121
  };
14894
15122
  }
14895
15123
  function HubspotTicketChatCard({
@@ -14897,8 +15125,8 @@ function HubspotTicketChatCard({
14897
15125
  isNewTab,
14898
15126
  discuss
14899
15127
  }) {
14900
- const status = typeof _optionalChain([chatRef, 'access', _364 => _364.metadata, 'optionalAccess', _365 => _365.status]) === "string" ? chatRef.metadata.status : void 0;
14901
- const statusLabel = typeof _optionalChain([chatRef, 'access', _366 => _366.metadata, 'optionalAccess', _367 => _367.statusLabel]) === "string" ? chatRef.metadata.statusLabel : void 0;
15128
+ const status = typeof _optionalChain([chatRef, 'access', _379 => _379.metadata, 'optionalAccess', _380 => _380.status]) === "string" ? chatRef.metadata.status : void 0;
15129
+ const statusLabel = typeof _optionalChain([chatRef, 'access', _381 => _381.metadata, 'optionalAccess', _382 => _382.statusLabel]) === "string" ? chatRef.metadata.statusLabel : void 0;
14902
15130
  const statusText = _nullishCoalesce(statusLabel, () => ( formatStatusToken(status)));
14903
15131
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
14904
15132
  MingoInfoCard,
@@ -14921,7 +15149,7 @@ function FaqChatCard({
14921
15149
  isNewTab,
14922
15150
  discuss
14923
15151
  }) {
14924
- const section = typeof _optionalChain([chatRef, 'access', _368 => _368.metadata, 'optionalAccess', _369 => _369.section]) === "string" ? chatRef.metadata.section.trim() : void 0;
15152
+ const section = typeof _optionalChain([chatRef, 'access', _383 => _383.metadata, 'optionalAccess', _384 => _384.section]) === "string" ? chatRef.metadata.section.trim() : void 0;
14925
15153
  const statusLabel = section && section.length > 0 ? section : "FAQ";
14926
15154
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
14927
15155
  MingoInfoCard,
@@ -14941,7 +15169,7 @@ function SlackChatCard({
14941
15169
  isNewTab,
14942
15170
  discuss
14943
15171
  }) {
14944
- const channelName = typeof _optionalChain([chatRef, 'access', _370 => _370.metadata, 'optionalAccess', _371 => _371.channelName]) === "string" ? chatRef.metadata.channelName.trim() : void 0;
15172
+ const channelName = typeof _optionalChain([chatRef, 'access', _385 => _385.metadata, 'optionalAccess', _386 => _386.channelName]) === "string" ? chatRef.metadata.channelName.trim() : void 0;
14945
15173
  const channelPretty = channelName ? channelName.startsWith("#") ? channelName : `#${channelName}` : void 0;
14946
15174
  const title = channelPretty ? `${chatRef.title} \xB7 ${channelPretty}` : chatRef.title;
14947
15175
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -14981,7 +15209,7 @@ function GenericFinancialChatCard({
14981
15209
  isNewTab,
14982
15210
  discuss
14983
15211
  }) {
14984
- const subtitle = typeof _optionalChain([chatRef, 'access', _372 => _372.metadata, 'optionalAccess', _373 => _373.subtitle]) === "string" ? chatRef.metadata.subtitle : void 0;
15212
+ const subtitle = typeof _optionalChain([chatRef, 'access', _387 => _387.metadata, 'optionalAccess', _388 => _388.subtitle]) === "string" ? chatRef.metadata.subtitle : void 0;
14985
15213
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
14986
15214
  MingoInfoCard,
14987
15215
  {
@@ -15050,12 +15278,12 @@ function ProductReleaseChatCard({
15050
15278
  discuss
15051
15279
  }) {
15052
15280
  const releaseProps = buildProps(item);
15053
- const status = _optionalChain([item, 'optionalAccess', _374 => _374.version]) ? { label: String(item.version), variant: "grey" } : { label: "Release", variant: "grey" };
15281
+ const status = _optionalChain([item, 'optionalAccess', _389 => _389.version]) ? { label: String(item.version), variant: "grey" } : { label: "Release", variant: "grey" };
15054
15282
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15055
15283
  EntityMingoCard,
15056
15284
  {
15057
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _375 => _375.title]), () => ( "")),
15058
- description: _optionalChain([item, 'optionalAccess', _376 => _376.summary]) || releaseProps.formattedDate || void 0,
15285
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _390 => _390.title]), () => ( "")),
15286
+ description: _optionalChain([item, 'optionalAccess', _391 => _391.summary]) || releaseProps.formattedDate || void 0,
15059
15287
  cover: releaseProps.coverImage || void 0,
15060
15288
  fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.Rocket02Icon, { size: 24 }),
15061
15289
  status,
@@ -15072,17 +15300,17 @@ function CampaignChatCard({
15072
15300
  isNewTab,
15073
15301
  discuss
15074
15302
  }) {
15075
- const goalsCount = Array.isArray(_optionalChain([item, 'optionalAccess', _377 => _377.goals])) ? item.goals.length : 0;
15303
+ const goalsCount = Array.isArray(_optionalChain([item, 'optionalAccess', _392 => _392.goals])) ? item.goals.length : 0;
15076
15304
  const meta = [
15077
- _optionalChain([item, 'optionalAccess', _378 => _378.start_date]) ? _chunkEMF64FWAcjs.formatDateShort.call(void 0, item.start_date) : null,
15305
+ _optionalChain([item, 'optionalAccess', _393 => _393.start_date]) ? _chunkEMF64FWAcjs.formatDateShort.call(void 0, item.start_date) : null,
15078
15306
  goalsCount > 0 ? `${goalsCount} goal${goalsCount !== 1 ? "s" : ""}` : null,
15079
15307
  "Marketing campaign"
15080
15308
  ].filter(Boolean).join(" \xB7 ");
15081
15309
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15082
15310
  EntityMingoCard,
15083
15311
  {
15084
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _379 => _379.name]), () => ( "")),
15085
- description: meta || _optionalChain([item, 'optionalAccess', _380 => _380.description]) || void 0,
15312
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _394 => _394.name]), () => ( "")),
15313
+ description: meta || _optionalChain([item, 'optionalAccess', _395 => _395.description]) || void 0,
15086
15314
  fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.Megaphone01Icon, { size: 24 }),
15087
15315
  chatRef,
15088
15316
  isNewTab,
@@ -15137,14 +15365,14 @@ function BlogChatCard({
15137
15365
  hasEmbeddedVideo,
15138
15366
  discuss
15139
15367
  }) {
15140
- 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;
15368
+ const category = Array.isArray(_optionalChain([item, 'optionalAccess', _396 => _396.categories])) ? _nullishCoalesce(_optionalChain([item, 'access', _397 => _397.categories, 'access', _398 => _398.find, 'call', _399 => _399((c) => _optionalChain([c, 'optionalAccess', _400 => _400.name])), 'optionalAccess', _401 => _401.name]), () => ( void 0)) : void 0;
15141
15369
  const status = hasEmbeddedVideo ? { label: "Video", variant: "primary" } : category ? { label: category, variant: "grey" } : void 0;
15142
15370
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15143
15371
  EntityMingoCard,
15144
15372
  {
15145
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _387 => _387.title]), () => ( "")),
15146
- description: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _388 => _388.summary]), () => ( void 0)),
15147
- cover: entityCover(_optionalChain([item, 'optionalAccess', _389 => _389.featured_image]), ogPlaceholder),
15373
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _402 => _402.title]), () => ( "")),
15374
+ description: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _403 => _403.summary]), () => ( void 0)),
15375
+ cover: entityCover(_optionalChain([item, 'optionalAccess', _404 => _404.featured_image]), ogPlaceholder),
15148
15376
  fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.NewspaperIcon, { size: 24 }),
15149
15377
  status,
15150
15378
  chatRef,
@@ -15161,13 +15389,13 @@ function CaseStudyChatCard({
15161
15389
  ogPlaceholder,
15162
15390
  discuss
15163
15391
  }) {
15164
- 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 ");
15392
+ const meta = [_optionalChain([item, 'optionalAccess', _405 => _405.msp, 'optionalAccess', _406 => _406.name]), _optionalChain([item, 'optionalAccess', _407 => _407.user, 'optionalAccess', _408 => _408.full_name])].filter(Boolean).join(" \xB7 ");
15165
15393
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15166
15394
  EntityMingoCard,
15167
15395
  {
15168
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _394 => _394.title]), () => ( "")),
15169
- description: _optionalChain([item, 'optionalAccess', _395 => _395.summary]) || meta || void 0,
15170
- cover: entityCover(_optionalChain([item, 'optionalAccess', _396 => _396.featured_image]), ogPlaceholder),
15396
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _409 => _409.title]), () => ( "")),
15397
+ description: _optionalChain([item, 'optionalAccess', _410 => _410.summary]) || meta || void 0,
15398
+ cover: entityCover(_optionalChain([item, 'optionalAccess', _411 => _411.featured_image]), ogPlaceholder),
15171
15399
  fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.TrophyIcon, { size: 24 }),
15172
15400
  status: { label: "Case study", variant: "grey" },
15173
15401
  chatRef,
@@ -15184,13 +15412,13 @@ function CustomerInterviewChatCard({
15184
15412
  ogPlaceholder,
15185
15413
  discuss
15186
15414
  }) {
15187
- 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 ");
15415
+ const meta = [_optionalChain([item, 'optionalAccess', _412 => _412.user, 'optionalAccess', _413 => _413.full_name]), _optionalChain([item, 'optionalAccess', _414 => _414.msp, 'optionalAccess', _415 => _415.name])].filter(Boolean).join(" \xB7 ");
15188
15416
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15189
15417
  EntityMingoCard,
15190
15418
  {
15191
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _401 => _401.title]), () => ( "")),
15192
- description: _optionalChain([item, 'optionalAccess', _402 => _402.video_summary]) || meta || void 0,
15193
- cover: entityCover(_optionalChain([item, 'optionalAccess', _403 => _403.featured_image]), ogPlaceholder),
15419
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _416 => _416.title]), () => ( "")),
15420
+ description: _optionalChain([item, 'optionalAccess', _417 => _417.video_summary]) || meta || void 0,
15421
+ cover: entityCover(_optionalChain([item, 'optionalAccess', _418 => _418.featured_image]), ogPlaceholder),
15194
15422
  fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.MicrophoneIcon, { size: 24 }),
15195
15423
  status: { label: "Interview", variant: "grey" },
15196
15424
  chatRef,
@@ -15207,13 +15435,13 @@ function InvestorUpdateChatCard({
15207
15435
  ogPlaceholder,
15208
15436
  discuss
15209
15437
  }) {
15210
- const title = _optionalChain([item, 'optionalAccess', _404 => _404.title]) || `Update #${_nullishCoalesce(_optionalChain([item, 'optionalAccess', _405 => _405.update_number]), () => ( "?"))}`;
15438
+ const title = _optionalChain([item, 'optionalAccess', _419 => _419.title]) || `Update #${_nullishCoalesce(_optionalChain([item, 'optionalAccess', _420 => _420.update_number]), () => ( "?"))}`;
15211
15439
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15212
15440
  EntityMingoCard,
15213
15441
  {
15214
15442
  title,
15215
- description: _optionalChain([item, 'optionalAccess', _406 => _406.strategic_update]) || _optionalChain([item, 'optionalAccess', _407 => _407.content]) || _chunkEMF64FWAcjs.formatInvestorUpdatePeriod.call(void 0, _nullishCoalesce(_optionalChain([item, 'optionalAccess', _408 => _408.period_start]), () => ( null)), _nullishCoalesce(_optionalChain([item, 'optionalAccess', _409 => _409.period_end]), () => ( null))) || void 0,
15216
- cover: entityCover(_optionalChain([item, 'optionalAccess', _410 => _410.featured_image]), ogPlaceholder),
15443
+ description: _optionalChain([item, 'optionalAccess', _421 => _421.strategic_update]) || _optionalChain([item, 'optionalAccess', _422 => _422.content]) || _chunkEMF64FWAcjs.formatInvestorUpdatePeriod.call(void 0, _nullishCoalesce(_optionalChain([item, 'optionalAccess', _423 => _423.period_start]), () => ( null)), _nullishCoalesce(_optionalChain([item, 'optionalAccess', _424 => _424.period_end]), () => ( null))) || void 0,
15444
+ cover: entityCover(_optionalChain([item, 'optionalAccess', _425 => _425.featured_image]), ogPlaceholder),
15217
15445
  fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.PresentationLineIcon, { size: 24 }),
15218
15446
  status: { label: "Investor update", variant: "grey" },
15219
15447
  chatRef,
@@ -15230,12 +15458,12 @@ function OnboardingGuideChatCard({
15230
15458
  ogPlaceholder,
15231
15459
  discuss
15232
15460
  }) {
15233
- 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)));
15461
+ const cover = _nullishCoalesce(_nullishCoalesce(entityCover(_optionalChain([item, 'optionalAccess', _426 => _426.featured_image])), () => ( entityCover(_optionalChain([item, 'optionalAccess', _427 => _427.main_video_thumbnail])))), () => ( entityCover(_optionalChain([item, 'optionalAccess', _428 => _428.og_image_url]), ogPlaceholder)));
15234
15462
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15235
15463
  EntityMingoCard,
15236
15464
  {
15237
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _414 => _414.title]), () => ( "")),
15238
- description: _nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _415 => _415.summary]), () => ( _optionalChain([item, 'optionalAccess', _416 => _416.description]))), () => ( void 0)),
15465
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _429 => _429.title]), () => ( "")),
15466
+ description: _nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _430 => _430.summary]), () => ( _optionalChain([item, 'optionalAccess', _431 => _431.description]))), () => ( void 0)),
15239
15467
  cover,
15240
15468
  fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.CompassIcon, { size: 24 }),
15241
15469
  status: { label: "Guide", variant: "grey" },
@@ -15256,25 +15484,25 @@ function ProgramChatCard({
15256
15484
  discuss
15257
15485
  }) {
15258
15486
  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 });
15259
- const isScheduled = _optionalChain([item, 'optionalAccess', _417 => _417.status]) === "scheduled";
15487
+ const isScheduled = _optionalChain([item, 'optionalAccess', _432 => _432.status]) === "scheduled";
15260
15488
  let typeMeta;
15261
- if (configKey === "podcast" && typeof _optionalChain([item, 'optionalAccess', _418 => _418.duration_seconds]) === "number" && item.duration_seconds > 0 && !isScheduled) {
15489
+ if (configKey === "podcast" && typeof _optionalChain([item, 'optionalAccess', _433 => _433.duration_seconds]) === "number" && item.duration_seconds > 0 && !isScheduled) {
15262
15490
  typeMeta = _chunkEMF64FWAcjs.formatDurationCompact.call(void 0, item.duration_seconds);
15263
- } else if (configKey === "event" && typeof _optionalChain([item, 'optionalAccess', _419 => _419.location_name]) === "string" && item.location_name.trim().length > 0) {
15491
+ } else if (configKey === "event" && typeof _optionalChain([item, 'optionalAccess', _434 => _434.location_name]) === "string" && item.location_name.trim().length > 0) {
15264
15492
  typeMeta = item.location_name;
15265
- } else if (configKey === "webinar" && _optionalChain([item, 'optionalAccess', _420 => _420.start_at])) {
15493
+ } else if (configKey === "webinar" && _optionalChain([item, 'optionalAccess', _435 => _435.start_at])) {
15266
15494
  const time = _chunkEMF64FWAcjs.formatTimeWithTimezone.call(void 0, item.start_at, _nullishCoalesce(item.timezone, () => ( null)));
15267
15495
  const dur = _chunkEMF64FWAcjs.formatDurationFromRange.call(void 0, item.start_at, item.end_at);
15268
15496
  typeMeta = dur ? `${time} \xB7 ${dur}` : time;
15269
15497
  }
15270
- const itemDate = _chunkEMF64FWAcjs.formatDateUTC.call(void 0, _nullishCoalesce(_optionalChain([item, 'optionalAccess', _421 => _421.date]), () => ( null)), { fallback: "", timezone: "local" });
15498
+ const itemDate = _chunkEMF64FWAcjs.formatDateUTC.call(void 0, _nullishCoalesce(_optionalChain([item, 'optionalAccess', _436 => _436.date]), () => ( null)), { fallback: "", timezone: "local" });
15271
15499
  const meta = [itemDate, typeMeta].filter(Boolean).join(" \xB7 ");
15272
15500
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15273
15501
  EntityMingoCard,
15274
15502
  {
15275
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _422 => _422.title]), () => ( "")),
15276
- description: meta || _optionalChain([item, 'optionalAccess', _423 => _423.description]) || void 0,
15277
- cover: entityCover(_optionalChain([item, 'optionalAccess', _424 => _424.cover_url]), ogPlaceholder),
15503
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _437 => _437.title]), () => ( "")),
15504
+ description: meta || _optionalChain([item, 'optionalAccess', _438 => _438.description]) || void 0,
15505
+ cover: entityCover(_optionalChain([item, 'optionalAccess', _439 => _439.cover_url]), ogPlaceholder),
15278
15506
  fallbackIcon: icon,
15279
15507
  status: { label, variant: "grey" },
15280
15508
  chatRef,
@@ -15291,10 +15519,10 @@ function RoadmapChatCard({
15291
15519
  cardType,
15292
15520
  discuss
15293
15521
  }) {
15294
- const logoUrl = typeof _optionalChain([item, 'optionalAccess', _425 => _425.icon]) === "string" && item.icon.startsWith("http") ? item.icon : void 0;
15295
- const useTypeIcon = cardType === "internal_task" || !logoUrl && _optionalChain([item, 'optionalAccess', _426 => _426.customItemId]) != null;
15522
+ const logoUrl = typeof _optionalChain([item, 'optionalAccess', _440 => _440.icon]) === "string" && item.icon.startsWith("http") ? item.icon : void 0;
15523
+ const useTypeIcon = cardType === "internal_task" || !logoUrl && _optionalChain([item, 'optionalAccess', _441 => _441.customItemId]) != null;
15296
15524
  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 });
15297
- const icon = useTypeIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEMF64FWAcjs.TaskTypeIcon, { customItemId: _optionalChain([item, 'optionalAccess', _427 => _427.customItemId]), className: "size-6" }) : logoUrl ? (
15525
+ const icon = useTypeIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEMF64FWAcjs.TaskTypeIcon, { customItemId: _optionalChain([item, 'optionalAccess', _442 => _442.customItemId]), className: "size-6" }) : logoUrl ? (
15298
15526
  // Contained (not full-bleed) so the integration logo keeps its aspect
15299
15527
  // ratio inside the bordered icon box — matches RoadmapCard.
15300
15528
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWLSFBRT5cjs.next_image_default, { src: logoUrl, alt: "", className: "size-6 object-contain", width: 24, height: 24, unoptimized: true })
@@ -15305,10 +15533,10 @@ function RoadmapChatCard({
15305
15533
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15306
15534
  EntityMingoCard,
15307
15535
  {
15308
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _428 => _428.title]), () => ( "")),
15309
- description: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _429 => _429.description]), () => ( void 0)),
15536
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _443 => _443.title]), () => ( "")),
15537
+ description: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _444 => _444.description]), () => ( void 0)),
15310
15538
  fallbackIcon: icon,
15311
- status: statusPill(_optionalChain([item, 'optionalAccess', _430 => _430.status])),
15539
+ status: statusPill(_optionalChain([item, 'optionalAccess', _445 => _445.status])),
15312
15540
  chatRef,
15313
15541
  isNewTab,
15314
15542
  discuss,
@@ -15318,15 +15546,27 @@ function RoadmapChatCard({
15318
15546
  }
15319
15547
  );
15320
15548
  }
15321
- function refHydratedEntry(docType, label, renderRef) {
15549
+ function refHydratedEntry(docType, label, renderRef, renderFromSourceMetadata = false) {
15322
15550
  return {
15323
15551
  label,
15324
15552
  bareInline: true,
15325
15553
  contentRefType: docType,
15326
15554
  noComposedHref: true,
15327
- fallbackHref: (item) => _nullishCoalesce(_optionalChain([item, 'optionalAccess', _431 => _431.url]), () => ( null)),
15555
+ fallbackHref: (item) => _nullishCoalesce(_optionalChain([item, 'optionalAccess', _446 => _446.url]), () => ( null)),
15328
15556
  skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MingoInfoCardSkeleton, {}),
15329
- render: (item, chatRef, opts) => renderRef(fetchedItemDisplayRef(item, chatRef), opts)
15557
+ render: (item, chatRef, opts) => renderRef(fetchedItemDisplayRef(item, chatRef), opts),
15558
+ renderFromSourceMetadata
15559
+ };
15560
+ }
15561
+ function sourceMetadataCardItem(chatRef) {
15562
+ return {
15563
+ type: chatRef.type,
15564
+ id: chatRef.id,
15565
+ title: chatRef.title,
15566
+ url: chatRef.url,
15567
+ targetPlatform: chatRef.targetPlatform,
15568
+ sourceRepo: chatRef.sourceRepo,
15569
+ metadata: chatRef.metadata
15330
15570
  };
15331
15571
  }
15332
15572
  var FINANCIAL_CARD_CONFIGS = {
@@ -15389,7 +15629,7 @@ function programRegistryEntries() {
15389
15629
  discuss: opts.discuss,
15390
15630
  configKey: cfg.configKey,
15391
15631
  label: cfg.configKey.charAt(0).toUpperCase() + cfg.configKey.slice(1),
15392
- ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _432 => _432.extras, 'optionalAccess', _433 => _433.buildOgPlaceholderUrl, 'optionalCall', _434 => _434(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _435 => _435.title]), () => ( "")))]), () => ( null))
15632
+ ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _447 => _447.extras, 'optionalAccess', _448 => _448.buildOgPlaceholderUrl, 'optionalCall', _449 => _449(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _450 => _450.title]), () => ( "")))]), () => ( null))
15393
15633
  }
15394
15634
  )
15395
15635
  }));
@@ -15410,7 +15650,7 @@ var ROADMAP_CARD_CONFIGS = {
15410
15650
  // The card's destination IS the ClickUp deep link, derived from the
15411
15651
  // task id post-fetch (the refs frame used to carry it).
15412
15652
  noComposedHref: true,
15413
- fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _436 => _436.id]) != null ? clickupTaskUrl(String(item.id)) : null
15653
+ fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _451 => _451.id]) != null ? clickupTaskUrl(String(item.id)) : null
15414
15654
  }
15415
15655
  };
15416
15656
  function roadmapRegistryEntries() {
@@ -15452,8 +15692,8 @@ var CHAT_CARD_REGISTRY = {
15452
15692
  DeletedDataCard,
15453
15693
  {
15454
15694
  title: chatRef.title && chatRef.title !== chatRef.id ? chatRef.title : null,
15455
- entityLabel: _nullishCoalesce(_optionalChain([chatRef, 'access', _437 => _437.metadata, 'optionalAccess', _438 => _438.entity_label]), () => ( null)),
15456
- recoveryNote: _nullishCoalesce(_optionalChain([chatRef, 'access', _439 => _439.metadata, 'optionalAccess', _440 => _440.recovery_note]), () => ( null))
15695
+ entityLabel: _nullishCoalesce(_optionalChain([chatRef, 'access', _452 => _452.metadata, 'optionalAccess', _453 => _453.entity_label]), () => ( null)),
15696
+ recoveryNote: _nullishCoalesce(_optionalChain([chatRef, 'access', _454 => _454.metadata, 'optionalAccess', _455 => _455.recovery_note]), () => ( null))
15457
15697
  }
15458
15698
  )
15459
15699
  },
@@ -15467,7 +15707,7 @@ var CHAT_CARD_REGISTRY = {
15467
15707
  bareInline: true,
15468
15708
  contentRefType: "faq",
15469
15709
  noComposedHref: true,
15470
- fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _441 => _441.id]) != null ? `/faqs#${faqItemAnchor(item.id)}` : null,
15710
+ fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _456 => _456.id]) != null ? `/faqs#${faqItemAnchor(item.id)}` : null,
15471
15711
  skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MingoInfoCardSkeleton, {}),
15472
15712
  render: (item, chatRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FaqChatCard, { chatRef: fetchedFaqDisplayRef(item, chatRef), isNewTab: opts.isNewTab, discuss: opts.discuss })
15473
15713
  },
@@ -15478,8 +15718,18 @@ var CHAT_CARD_REGISTRY = {
15478
15718
  // config's searchFilter is deliberately fail-closed there. Same
15479
15719
  // ChatRef item shape (`buildHubspotTicketSelfRef` SSOT), same preset.
15480
15720
  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 })),
15481
- 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 })),
15482
- markdown: refHydratedEntry("markdown", "Doc page (markdown)", (displayRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DataRoomDocChatCard, { chatRef: displayRef, isNewTab: opts.isNewTab, discuss: opts.discuss })),
15721
+ data_room_doc: refHydratedEntry(
15722
+ "data_room_doc",
15723
+ "Data-room doc",
15724
+ (displayRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DataRoomDocChatCard, { chatRef: displayRef, isNewTab: opts.isNewTab, discuss: opts.discuss }),
15725
+ true
15726
+ ),
15727
+ markdown: refHydratedEntry(
15728
+ "markdown",
15729
+ "Doc page (markdown)",
15730
+ (displayRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DataRoomDocChatCard, { chatRef: displayRef, isNewTab: opts.isNewTab, discuss: opts.discuss }),
15731
+ true
15732
+ ),
15483
15733
  // Body-synthesized video ids (`shortVideoId` content hashes / YouTube
15484
15734
  // ids) have no backing table row to fetch — ref-only by nature.
15485
15735
  video: {
@@ -15501,8 +15751,8 @@ var CHAT_CARD_REGISTRY = {
15501
15751
  chatRef,
15502
15752
  isNewTab: opts.isNewTab,
15503
15753
  discuss: opts.discuss,
15504
- ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _442 => _442.extras, 'optionalAccess', _443 => _443.buildOgPlaceholderUrl, 'optionalCall', _444 => _444(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _445 => _445.title]), () => ( "")))]), () => ( null)),
15505
- hasEmbeddedVideo: _optionalChain([chatRef, 'access', _446 => _446.metadata, 'optionalAccess', _447 => _447.hasEmbeddedVideo]) === true
15754
+ ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _457 => _457.extras, 'optionalAccess', _458 => _458.buildOgPlaceholderUrl, 'optionalCall', _459 => _459(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _460 => _460.title]), () => ( "")))]), () => ( null)),
15755
+ hasEmbeddedVideo: _optionalChain([chatRef, 'access', _461 => _461.metadata, 'optionalAccess', _462 => _462.hasEmbeddedVideo]) === true
15506
15756
  }
15507
15757
  )
15508
15758
  },
@@ -15518,7 +15768,7 @@ var CHAT_CARD_REGISTRY = {
15518
15768
  chatRef,
15519
15769
  isNewTab: opts.isNewTab,
15520
15770
  discuss: opts.discuss,
15521
- ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _448 => _448.extras, 'optionalAccess', _449 => _449.buildOgPlaceholderUrl, 'optionalCall', _450 => _450(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _451 => _451.title]), () => ( "")))]), () => ( null))
15771
+ ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _463 => _463.extras, 'optionalAccess', _464 => _464.buildOgPlaceholderUrl, 'optionalCall', _465 => _465(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _466 => _466.title]), () => ( "")))]), () => ( null))
15522
15772
  }
15523
15773
  )
15524
15774
  },
@@ -15534,7 +15784,7 @@ var CHAT_CARD_REGISTRY = {
15534
15784
  chatRef,
15535
15785
  isNewTab: opts.isNewTab,
15536
15786
  discuss: opts.discuss,
15537
- ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _452 => _452.extras, 'optionalAccess', _453 => _453.buildOgPlaceholderUrl, 'optionalCall', _454 => _454(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _455 => _455.title]), () => ( "")))]), () => ( null))
15787
+ ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _467 => _467.extras, 'optionalAccess', _468 => _468.buildOgPlaceholderUrl, 'optionalCall', _469 => _469(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _470 => _470.title]), () => ( "")))]), () => ( null))
15538
15788
  }
15539
15789
  )
15540
15790
  },
@@ -15544,7 +15794,7 @@ var CHAT_CARD_REGISTRY = {
15544
15794
  bareInline: true,
15545
15795
  skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEMF64FWAcjs.ProductReleaseCardSkeleton, { size: "sm" }),
15546
15796
  render: (item, chatRef, opts) => {
15547
- const builder = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _456 => _456.extras, 'optionalAccess', _457 => _457.buildProductReleaseCardProps]), () => ( _chunkEMF64FWAcjs.defaultBuildProductReleaseCardProps));
15797
+ const builder = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _471 => _471.extras, 'optionalAccess', _472 => _472.buildProductReleaseCardProps]), () => ( _chunkEMF64FWAcjs.defaultBuildProductReleaseCardProps));
15548
15798
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15549
15799
  ProductReleaseChatCard,
15550
15800
  {
@@ -15570,7 +15820,7 @@ var CHAT_CARD_REGISTRY = {
15570
15820
  chatRef,
15571
15821
  isNewTab: opts.isNewTab,
15572
15822
  discuss: opts.discuss,
15573
- ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _458 => _458.extras, 'optionalAccess', _459 => _459.buildOgPlaceholderUrl, 'optionalCall', _460 => _460(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _461 => _461.title]), () => ( "")))]), () => ( null))
15823
+ ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _473 => _473.extras, 'optionalAccess', _474 => _474.buildOgPlaceholderUrl, 'optionalCall', _475 => _475(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _476 => _476.title]), () => ( "")))]), () => ( null))
15574
15824
  }
15575
15825
  )
15576
15826
  },
@@ -15588,7 +15838,7 @@ var CHAT_CARD_REGISTRY = {
15588
15838
  chatRef,
15589
15839
  isNewTab: opts.isNewTab,
15590
15840
  discuss: opts.discuss,
15591
- ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _462 => _462.extras, 'optionalAccess', _463 => _463.buildOgPlaceholderUrl, 'optionalCall', _464 => _464(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _465 => _465.title]), () => ( "")))]), () => ( null))
15841
+ ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _477 => _477.extras, 'optionalAccess', _478 => _478.buildOgPlaceholderUrl, 'optionalCall', _479 => _479(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _480 => _480.title]), () => ( "")))]), () => ( null))
15592
15842
  }
15593
15843
  )
15594
15844
  },
@@ -15599,7 +15849,7 @@ var CHAT_CARD_REGISTRY = {
15599
15849
  skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CampaignCardAdminSkeleton, {}),
15600
15850
  // No public viewer — synthesize the hub-internal admin URL post-fetch
15601
15851
  // so the wrapper + isNewTab computation see the actual destination.
15602
- fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _466 => _466.id]) ? `/admin/campaigns/${encodeURIComponent(String(item.id))}` : null,
15852
+ fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _481 => _481.id]) ? `/admin/campaigns/${encodeURIComponent(String(item.id))}` : null,
15603
15853
  render: (item, chatRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CampaignChatCard, { item, chatRef, isNewTab: opts.isNewTab, discuss: opts.discuss })
15604
15854
  },
15605
15855
  ...roadmapRegistryEntries()
@@ -15618,13 +15868,13 @@ function ChatCardNavWrap({
15618
15868
  if (!href) return;
15619
15869
  const targetEl = e.target;
15620
15870
  const host = e.currentTarget;
15621
- if (!_optionalChain([host, 'optionalAccess', _467 => _467.contains, 'call', _468 => _468(targetEl)])) return;
15622
- if (_optionalChain([targetEl, 'optionalAccess', _469 => _469.closest, 'optionalCall', _470 => _470("button")])) return;
15623
- if (!_optionalChain([targetEl, 'optionalAccess', _471 => _471.closest, 'optionalCall', _472 => _472("a")])) return;
15871
+ if (!_optionalChain([host, 'optionalAccess', _482 => _482.contains, 'call', _483 => _483(targetEl)])) return;
15872
+ if (_optionalChain([targetEl, 'optionalAccess', _484 => _484.closest, 'optionalCall', _485 => _485("button")])) return;
15873
+ if (!_optionalChain([targetEl, 'optionalAccess', _486 => _486.closest, 'optionalCall', _487 => _487("a")])) return;
15624
15874
  const handled = executeNavigation({ event: e, runtime, href, path, targetPlatform, fallbackNavigate: router.push });
15625
15875
  if (!handled) return;
15626
15876
  e.stopPropagation();
15627
- if (!isNewTab && _optionalChain([panel, 'optionalAccess', _473 => _473.closeChat])) panel.closeChat();
15877
+ if (!isNewTab && _optionalChain([panel, 'optionalAccess', _488 => _488.closeChat])) panel.closeChat();
15628
15878
  };
15629
15879
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "contents", onClickCapture, children });
15630
15880
  }
@@ -15646,7 +15896,7 @@ function ChatCardLoader({
15646
15896
  title: chatRef.title,
15647
15897
  externalUrl: chatRef.url,
15648
15898
  targetPlatform: chatRef.targetPlatform,
15649
- path: typeof _optionalChain([chatRef, 'access', _474 => _474.metadata, 'optionalAccess', _475 => _475.path]) === "string" ? chatRef.metadata.path : null
15899
+ path: typeof _optionalChain([chatRef, 'access', _489 => _489.metadata, 'optionalAccess', _490 => _490.path]) === "string" ? chatRef.metadata.path : null
15650
15900
  },
15651
15901
  sourceRowCtxFromRuntime(runtime, { baseRoute, chipBasePlatform })
15652
15902
  );
@@ -15660,11 +15910,11 @@ function ChatCardLoader({
15660
15910
  const entry = CHAT_CARD_REGISTRY[resolvedChatRef.type];
15661
15911
  const fetchEntry = entry && entry.contentRefType ? entry : null;
15662
15912
  const { item, isLoading, isError, isFetched } = useChatCardItem(
15663
- _nullishCoalesce(_optionalChain([fetchEntry, 'optionalAccess', _476 => _476.contentRefType]), () => ( "")),
15913
+ _nullishCoalesce(_optionalChain([fetchEntry, 'optionalAccess', _491 => _491.contentRefType]), () => ( "")),
15664
15914
  fetchEntry ? resolvedChatRef.id : ""
15665
15915
  );
15666
15916
  if (!entry) return null;
15667
- const composedHref = _optionalChain([fetchEntry, 'optionalAccess', _477 => _477.contentRefType]) && !resolvedChatRef.url && item ? resolveFetchedCardHref({
15917
+ const composedHref = _optionalChain([fetchEntry, 'optionalAccess', _492 => _492.contentRefType]) && !resolvedChatRef.url && item ? resolveFetchedCardHref({
15668
15918
  contentRefType: fetchEntry.contentRefType,
15669
15919
  id: resolvedChatRef.id,
15670
15920
  item,
@@ -15672,7 +15922,7 @@ function ChatCardLoader({
15672
15922
  }) : null;
15673
15923
  const hrefChoice = fetchEntry && !resolvedChatRef.url && item ? pickFetchedCardHref({
15674
15924
  composed: composedHref,
15675
- itemHref: _nullishCoalesce(_optionalChain([fetchEntry, 'access', _478 => _478.fallbackHref, 'optionalCall', _479 => _479(item)]), () => ( null)),
15925
+ itemHref: _nullishCoalesce(_optionalChain([fetchEntry, 'access', _493 => _493.fallbackHref, 'optionalCall', _494 => _494(item)]), () => ( null)),
15676
15926
  allowComposed: !fetchEntry.noComposedHref
15677
15927
  }) : null;
15678
15928
  const hrefResolvedChatRef = hrefChoice ? {
@@ -15706,7 +15956,7 @@ function ChatCardLoader({
15706
15956
  isNewTab,
15707
15957
  discuss
15708
15958
  };
15709
- const path = typeof _optionalChain([finalChatRef, 'access', _480 => _480.metadata, 'optionalAccess', _481 => _481.path]) === "string" ? finalChatRef.metadata.path : null;
15959
+ const path = typeof _optionalChain([finalChatRef, 'access', _495 => _495.metadata, 'optionalAccess', _496 => _496.path]) === "string" ? finalChatRef.metadata.path : null;
15710
15960
  const navWrap = (children) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15711
15961
  ChatCardNavWrap,
15712
15962
  {
@@ -15730,8 +15980,12 @@ function ChatCardLoader({
15730
15980
  if (!fetchEntry) {
15731
15981
  return finish(entry.render(void 0, finalChatRef, renderOpts));
15732
15982
  }
15733
- if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: _nullishCoalesce(_optionalChain([fetchEntry, 'access', _482 => _482.skeleton, 'optionalCall', _483 => _483()]), () => ( null)) });
15983
+ if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: _nullishCoalesce(_optionalChain([fetchEntry, 'access', _497 => _497.skeleton, 'optionalCall', _498 => _498()]), () => ( null)) });
15734
15984
  if (!item) {
15985
+ const hasSourceMetadata = fetchEntry.renderFromSourceMetadata && isSourceMetadataCardRef(chatRef) && typeof _optionalChain([finalChatRef, 'access', _499 => _499.metadata, 'optionalAccess', _500 => _500.path]) === "string";
15986
+ if (hasSourceMetadata) {
15987
+ return finish(fetchEntry.render(sourceMetadataCardItem(finalChatRef), finalChatRef, renderOpts));
15988
+ }
15735
15989
  if (isError) {
15736
15990
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CardLoadFailure, { label: entry.label, id: finalChatRef.id, detail: "Failed to load" });
15737
15991
  }
@@ -15772,13 +16026,15 @@ function renderChatInlineEntityCard(chatRef, options = {}) {
15772
16026
  }
15773
16027
  );
15774
16028
  if (chatRef.type === "video") {
16029
+ const enrichedMetadata = validatedVideoMetadata(chatRef);
15775
16030
  const decoded = decodeVideoMarkerId(chatRef.id);
15776
- if (decoded) {
16031
+ const playableMetadata = _nullishCoalesce(enrichedMetadata, () => ( decoded));
16032
+ if (playableMetadata) {
15777
16033
  const displayRef = {
15778
16034
  ...chatRef,
15779
16035
  title: chatRef.title && chatRef.title !== chatRef.id ? chatRef.title : "Video",
15780
- url: _nullishCoalesce(_nullishCoalesce(chatRef.url, () => ( decoded.videoUrl)), () => ( (decoded.youtubeUrl ? `https://www.youtube.com/watch?v=${decoded.youtubeUrl}` : null))),
15781
- metadata: { ..._nullishCoalesce(chatRef.metadata, () => ( {})), ...decoded }
16036
+ url: _nullishCoalesce(_nullishCoalesce(chatRef.url, () => ( (typeof playableMetadata.videoUrl === "string" ? playableMetadata.videoUrl : null))), () => ( (typeof playableMetadata.youtubeUrl === "string" ? `https://www.youtube.com/watch?v=${playableMetadata.youtubeUrl}` : null))),
16037
+ metadata: playableMetadata
15782
16038
  };
15783
16039
  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 }) });
15784
16040
  }
@@ -16090,7 +16346,7 @@ function useChunkCatchup({
16090
16346
  if (catchupRun.current === run) {
16091
16347
  if (currentDialogId !== dialogIdRef.current) {
16092
16348
  catchupRun.current = null;
16093
- if (_optionalChain([pendingCatchupRef, 'access', _484 => _484.current, 'optionalAccess', _485 => _485.dialogId]) === currentDialogId) {
16349
+ if (_optionalChain([pendingCatchupRef, 'access', _501 => _501.current, 'optionalAccess', _502 => _502.dialogId]) === currentDialogId) {
16094
16350
  pendingCatchupRef.current = null;
16095
16351
  }
16096
16352
  } else {
@@ -16101,7 +16357,7 @@ function useChunkCatchup({
16101
16357
  if (pending.dialogId === currentDialogId) {
16102
16358
  rearmForQueuedCatchup();
16103
16359
  try {
16104
- await _optionalChain([catchUpChunksRef, 'access', _486 => _486.current, 'optionalCall', _487 => _487(pending.fromSequenceId)]);
16360
+ await _optionalChain([catchUpChunksRef, 'access', _503 => _503.current, 'optionalCall', _504 => _504(pending.fromSequenceId)]);
16105
16361
  } catch (rerunError) {
16106
16362
  console.error("Queued catch-up re-run failed:", rerunError);
16107
16363
  }
@@ -16168,7 +16424,7 @@ function useChunkCatchup({
16168
16424
 
16169
16425
  var EMPTY_FRAME = { messages: [], phase: "idle", typing: false, delayMs: 0 };
16170
16426
  function prefersReducedMotion() {
16171
- return typeof window !== "undefined" && _optionalChain([window, 'access', _488 => _488.matchMedia, 'optionalCall', _489 => _489("(prefers-reduced-motion: reduce)"), 'access', _490 => _490.matches]) === true;
16427
+ return typeof window !== "undefined" && _optionalChain([window, 'access', _505 => _505.matchMedia, 'optionalCall', _506 => _506("(prefers-reduced-motion: reduce)"), 'access', _507 => _507.matches]) === true;
16172
16428
  }
16173
16429
  function useScriptedStream(frames, resetKey, enabled = true) {
16174
16430
  const [index, setIndex] = _react.useState.call(void 0, 0);
@@ -16179,7 +16435,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
16179
16435
  setIndex(0);
16180
16436
  }
16181
16437
  _react.useEffect.call(void 0, () => {
16182
- const mq = _optionalChain([window, 'access', _491 => _491.matchMedia, 'optionalCall', _492 => _492("(prefers-reduced-motion: reduce)")]);
16438
+ const mq = _optionalChain([window, 'access', _508 => _508.matchMedia, 'optionalCall', _509 => _509("(prefers-reduced-motion: reduce)")]);
16183
16439
  const sync = () => setReducedMotion(mq ? mq.matches : prefersReducedMotion());
16184
16440
  sync();
16185
16441
  if (!mq) return void 0;
@@ -16314,7 +16570,7 @@ function useJetStreamDialogSubscription({
16314
16570
  if (subscriptionRef.current) {
16315
16571
  try {
16316
16572
  subscriptionRef.current.unsubscribe();
16317
- } catch (e46) {
16573
+ } catch (e48) {
16318
16574
  }
16319
16575
  subscriptionRef.current = null;
16320
16576
  }
@@ -16322,7 +16578,7 @@ function useJetStreamDialogSubscription({
16322
16578
  const lifecycle = _chunkI5JVSFNVcjs.startConnectionLifecycle.call(void 0, {
16323
16579
  conn: sharedConn,
16324
16580
  wsUrl,
16325
- onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access', _493 => _493.current, 'optionalCall', _494 => _494()]),
16581
+ onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access', _510 => _510.current, 'optionalCall', _511 => _511()]),
16326
16582
  backoff: reconnectionBackoffRef.current,
16327
16583
  getFreshUrl: () => getNatsWsUrlRef.current(),
16328
16584
  // JetStream emits 'error' for protocol-level failures (e.g. -ERR Permissions
@@ -16337,7 +16593,7 @@ function useJetStreamDialogSubscription({
16337
16593
  setReconnectionCount((c) => c + 1);
16338
16594
  }
16339
16595
  hadConnectionBeforeRef.current = true;
16340
- _optionalChain([onConnectRef, 'access', _495 => _495.current, 'optionalCall', _496 => _496()]);
16596
+ _optionalChain([onConnectRef, 'access', _512 => _512.current, 'optionalCall', _513 => _513()]);
16341
16597
  }
16342
16598
  if (status === "error") {
16343
16599
  console.warn("[JetStream] NATS protocol error:", evt.data);
@@ -16347,7 +16603,7 @@ function useJetStreamDialogSubscription({
16347
16603
  setIsConnected(false);
16348
16604
  setIsSubscribed(false);
16349
16605
  tearDownSubscription();
16350
- _optionalChain([onDisconnectRef, 'access', _497 => _497.current, 'optionalCall', _498 => _498()]);
16606
+ _optionalChain([onDisconnectRef, 'access', _514 => _514.current, 'optionalCall', _515 => _515()]);
16351
16607
  }
16352
16608
  }
16353
16609
  });
@@ -16408,7 +16664,7 @@ function useJetStreamDialogSubscription({
16408
16664
  if (subscriptionRef.current) {
16409
16665
  try {
16410
16666
  subscriptionRef.current.unsubscribe();
16411
- } catch (e47) {
16667
+ } catch (e49) {
16412
16668
  }
16413
16669
  subscriptionRef.current = null;
16414
16670
  }
@@ -16443,7 +16699,7 @@ function useJetStreamDialogSubscription({
16443
16699
  parsed.streamSeq = streamSeq;
16444
16700
  }
16445
16701
  cb(parsed, topic);
16446
- } catch (e48) {
16702
+ } catch (e50) {
16447
16703
  }
16448
16704
  },
16449
16705
  {
@@ -16467,14 +16723,14 @@ function useJetStreamDialogSubscription({
16467
16723
  if (cancelled) {
16468
16724
  try {
16469
16725
  handle.unsubscribe();
16470
- } catch (e49) {
16726
+ } catch (e51) {
16471
16727
  }
16472
16728
  return;
16473
16729
  }
16474
16730
  subscriptionRef.current = handle;
16475
16731
  setIsSubscribed(true);
16476
- _optionalChain([onSubscribedRef, 'access', _499 => _499.current, 'optionalCall', _500 => _500()]);
16477
- } catch (e50) {
16732
+ _optionalChain([onSubscribedRef, 'access', _516 => _516.current, 'optionalCall', _517 => _517()]);
16733
+ } catch (e52) {
16478
16734
  if (!cancelled) {
16479
16735
  setIsSubscribed(false);
16480
16736
  }
@@ -16486,7 +16742,7 @@ function useJetStreamDialogSubscription({
16486
16742
  if (subscriptionRef.current) {
16487
16743
  try {
16488
16744
  subscriptionRef.current.unsubscribe();
16489
- } catch (e51) {
16745
+ } catch (e53) {
16490
16746
  }
16491
16747
  subscriptionRef.current = null;
16492
16748
  }
@@ -16589,20 +16845,20 @@ function useNatsDialogSubscription({
16589
16845
  const tearDownSubscriptions = () => {
16590
16846
  subscriptionRefs.current.forEach((sub) => {
16591
16847
  try {
16592
- _optionalChain([sub, 'optionalAccess', _501 => _501.unsubscribe, 'call', _502 => _502()]);
16593
- } catch (e52) {
16848
+ _optionalChain([sub, 'optionalAccess', _518 => _518.unsubscribe, 'call', _519 => _519()]);
16849
+ } catch (e54) {
16594
16850
  }
16595
16851
  });
16596
16852
  subscriptionRefs.current.clear();
16597
16853
  lastSubscribedDialogIdRef.current = null;
16598
- _optionalChain([abortControllerRef, 'access', _503 => _503.current, 'optionalAccess', _504 => _504.abort, 'call', _505 => _505()]);
16854
+ _optionalChain([abortControllerRef, 'access', _520 => _520.current, 'optionalAccess', _521 => _521.abort, 'call', _522 => _522()]);
16599
16855
  abortControllerRef.current = null;
16600
16856
  };
16601
16857
  const isDisconnectStatus = (status) => status === "closed" || status === "disconnected";
16602
16858
  const lifecycle = _chunkI5JVSFNVcjs.startConnectionLifecycle.call(void 0, {
16603
16859
  conn: sharedConn,
16604
16860
  wsUrl,
16605
- onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access', _506 => _506.current, 'optionalCall', _507 => _507()]),
16861
+ onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access', _523 => _523.current, 'optionalCall', _524 => _524()]),
16606
16862
  backoff: reconnectionBackoffRef.current,
16607
16863
  getFreshUrl: () => getNatsWsUrlRef.current(),
16608
16864
  shouldRetryOn: isDisconnectStatus,
@@ -16613,7 +16869,7 @@ function useNatsDialogSubscription({
16613
16869
  setReconnectionCount((c) => c + 1);
16614
16870
  }
16615
16871
  hadConnectionBeforeRef.current = true;
16616
- _optionalChain([onConnectRef, 'access', _508 => _508.current, 'optionalCall', _509 => _509()]);
16872
+ _optionalChain([onConnectRef, 'access', _525 => _525.current, 'optionalCall', _526 => _526()]);
16617
16873
  }
16618
16874
  if (status === "error") {
16619
16875
  console.warn("[NATS] protocol error:", evt.data);
@@ -16623,7 +16879,7 @@ function useNatsDialogSubscription({
16623
16879
  setIsConnected(false);
16624
16880
  setIsSubscribed(false);
16625
16881
  tearDownSubscriptions();
16626
- _optionalChain([onDisconnectRef, 'access', _510 => _510.current, 'optionalCall', _511 => _511()]);
16882
+ _optionalChain([onDisconnectRef, 'access', _527 => _527.current, 'optionalCall', _528 => _528()]);
16627
16883
  }
16628
16884
  }
16629
16885
  });
@@ -16654,13 +16910,13 @@ function useNatsDialogSubscription({
16654
16910
  setIsSubscribed(false);
16655
16911
  subscriptionRefs.current.forEach((sub) => {
16656
16912
  try {
16657
- _optionalChain([sub, 'optionalAccess', _512 => _512.unsubscribe, 'call', _513 => _513()]);
16658
- } catch (e53) {
16913
+ _optionalChain([sub, 'optionalAccess', _529 => _529.unsubscribe, 'call', _530 => _530()]);
16914
+ } catch (e55) {
16659
16915
  }
16660
16916
  });
16661
16917
  subscriptionRefs.current.clear();
16662
16918
  lastSubscribedDialogIdRef.current = null;
16663
- _optionalChain([abortControllerRef, 'access', _514 => _514.current, 'optionalAccess', _515 => _515.abort, 'call', _516 => _516()]);
16919
+ _optionalChain([abortControllerRef, 'access', _531 => _531.current, 'optionalAccess', _532 => _532.abort, 'call', _533 => _533()]);
16664
16920
  abortControllerRef.current = null;
16665
16921
  }
16666
16922
  return void 0;
@@ -16672,12 +16928,12 @@ function useNatsDialogSubscription({
16672
16928
  if (subscriptionRefs.current.size > 0) {
16673
16929
  subscriptionRefs.current.forEach((sub) => {
16674
16930
  try {
16675
- _optionalChain([sub, 'optionalAccess', _517 => _517.unsubscribe, 'call', _518 => _518()]);
16676
- } catch (e54) {
16931
+ _optionalChain([sub, 'optionalAccess', _534 => _534.unsubscribe, 'call', _535 => _535()]);
16932
+ } catch (e56) {
16677
16933
  }
16678
16934
  });
16679
16935
  subscriptionRefs.current.clear();
16680
- _optionalChain([abortControllerRef, 'access', _519 => _519.current, 'optionalAccess', _520 => _520.abort, 'call', _521 => _521()]);
16936
+ _optionalChain([abortControllerRef, 'access', _536 => _536.current, 'optionalAccess', _537 => _537.abort, 'call', _538 => _538()]);
16681
16937
  }
16682
16938
  abortControllerRef.current = new AbortController();
16683
16939
  const abort = abortControllerRef.current;
@@ -16696,7 +16952,7 @@ function useNatsDialogSubscription({
16696
16952
  const dataStr = decoder.decode(msg.data);
16697
16953
  const parsed = JSON.parse(dataStr);
16698
16954
  onEventRef.current(parsed, messageType);
16699
- } catch (e55) {
16955
+ } catch (e57) {
16700
16956
  }
16701
16957
  };
16702
16958
  topicsRef.current.forEach((topic) => {
@@ -16707,7 +16963,7 @@ function useNatsDialogSubscription({
16707
16963
  });
16708
16964
  lastSubscribedDialogIdRef.current = dialogId;
16709
16965
  setIsSubscribed(true);
16710
- _optionalChain([onSubscribedRef, 'access', _522 => _522.current, 'optionalCall', _523 => _523()]);
16966
+ _optionalChain([onSubscribedRef, 'access', _539 => _539.current, 'optionalCall', _540 => _540()]);
16711
16967
  };
16712
16968
  if (isConnectedRef.current) {
16713
16969
  createSubscriptions();
@@ -16718,8 +16974,8 @@ function useNatsDialogSubscription({
16718
16974
  abort.abort();
16719
16975
  subscriptions.forEach((sub) => {
16720
16976
  try {
16721
- _optionalChain([sub, 'optionalAccess', _524 => _524.unsubscribe, 'call', _525 => _525()]);
16722
- } catch (e56) {
16977
+ _optionalChain([sub, 'optionalAccess', _541 => _541.unsubscribe, 'call', _542 => _542()]);
16978
+ } catch (e58) {
16723
16979
  }
16724
16980
  });
16725
16981
  subscriptions.clear();
@@ -16746,7 +17002,7 @@ function useNatsDialogSubscription({
16746
17002
  const dataStr = decoder.decode(msg.data);
16747
17003
  const parsed = JSON.parse(dataStr);
16748
17004
  onEventRef.current(parsed, messageType);
16749
- } catch (e57) {
17005
+ } catch (e59) {
16750
17006
  }
16751
17007
  };
16752
17008
  topicsRef.current.forEach((topic) => {
@@ -16757,7 +17013,7 @@ function useNatsDialogSubscription({
16757
17013
  });
16758
17014
  lastSubscribedDialogIdRef.current = currentDialogId;
16759
17015
  setIsSubscribed(true);
16760
- _optionalChain([onSubscribedRef, 'access', _526 => _526.current, 'optionalCall', _527 => _527()]);
17016
+ _optionalChain([onSubscribedRef, 'access', _543 => _543.current, 'optionalCall', _544 => _544()]);
16761
17017
  } else if (subscriptionRefs.current.size > 0) {
16762
17018
  setIsSubscribed(true);
16763
17019
  }
@@ -16765,10 +17021,10 @@ function useNatsDialogSubscription({
16765
17021
  return { isConnected, isSubscribed, reconnectionCount };
16766
17022
  }
16767
17023
  function buildNatsWsUrl(apiBaseUrl, options) {
16768
- const path = _optionalChain([options, 'optionalAccess', _528 => _528.source]) === "dashboard" ? "/ws/nats-api" : "/ws/nats";
17024
+ const path = _optionalChain([options, 'optionalAccess', _545 => _545.source]) === "dashboard" ? "/ws/nats-api" : "/ws/nats";
16769
17025
  const u = new URL(path, apiBaseUrl);
16770
17026
  u.protocol = u.protocol === "https:" ? "wss:" : "ws:";
16771
- if (_optionalChain([options, 'optionalAccess', _529 => _529.includeAuthParam]) && _optionalChain([options, 'optionalAccess', _530 => _530.token])) {
17027
+ if (_optionalChain([options, 'optionalAccess', _546 => _546.includeAuthParam]) && _optionalChain([options, 'optionalAccess', _547 => _547.token])) {
16772
17028
  u.searchParams.set("authorization", options.token);
16773
17029
  }
16774
17030
  return u.toString();
@@ -16777,16 +17033,19 @@ function buildNatsWsUrl(apiBaseUrl, options) {
16777
17033
  // src/components/chat/hooks/use-slash-commands.ts
16778
17034
 
16779
17035
 
17036
+ var COMMANDS_MAX_RESULTS = 10;
16780
17037
  async function fetchSlashCommands(prefix, signal, commandsUrl) {
16781
17038
  try {
16782
17039
  const url = new URL(commandsUrl, window.location.origin);
16783
- if (prefix) url.searchParams.set("q", prefix);
16784
17040
  const res = await _chunkCP6TIRONcjs.embedAuthedFetch.call(void 0, url.toString(), { signal, headers: {} });
16785
17041
  if (!res.ok) return [];
16786
17042
  const data = await res.json();
16787
- return _nullishCoalesce(data.commands, () => ( []));
17043
+ const commands = _nullishCoalesce(data.commands, () => ( []));
17044
+ const normalizedPrefix = prefix.trim().toLowerCase();
17045
+ if (!normalizedPrefix) return commands;
17046
+ return commands.filter(({ id }) => id.startsWith(normalizedPrefix)).slice(0, COMMANDS_MAX_RESULTS);
16788
17047
  } catch (err) {
16789
- if (_optionalChain([err, 'optionalAccess', _531 => _531.name]) === "AbortError") throw err;
17048
+ if (_optionalChain([err, 'optionalAccess', _548 => _548.name]) === "AbortError") throw err;
16790
17049
  console.warn("[chat] slash-commands fetch failed, showing none:", err);
16791
17050
  return [];
16792
17051
  }
@@ -16794,8 +17053,8 @@ async function fetchSlashCommands(prefix, signal, commandsUrl) {
16794
17053
  var NO_COMMANDS = [];
16795
17054
  function useSlashCommands(prefix, commandsUrl) {
16796
17055
  const [answered, setAnswered] = _react.useState.call(void 0, null);
16797
- const commands = prefix != null && _optionalChain([answered, 'optionalAccess', _532 => _532.prefix]) === prefix ? answered.commands : NO_COMMANDS;
16798
- const loading = prefix != null && _optionalChain([answered, 'optionalAccess', _533 => _533.prefix]) !== prefix;
17056
+ const commands = prefix != null && _optionalChain([answered, 'optionalAccess', _549 => _549.prefix]) === prefix ? answered.commands : NO_COMMANDS;
17057
+ const loading = prefix != null && _optionalChain([answered, 'optionalAccess', _550 => _550.prefix]) !== prefix;
16799
17058
  _react.useEffect.call(void 0, () => {
16800
17059
  if (prefix == null) return void 0;
16801
17060
  let cancelled = false;
@@ -16805,7 +17064,7 @@ function useSlashCommands(prefix, commandsUrl) {
16805
17064
  const next = await fetchSlashCommands(prefix, ctrl.signal, commandsUrl);
16806
17065
  if (!cancelled) setAnswered({ prefix, commands: next });
16807
17066
  } catch (err) {
16808
- if (!cancelled && _optionalChain([err, 'optionalAccess', _534 => _534.name]) !== "AbortError") {
17067
+ if (!cancelled && _optionalChain([err, 'optionalAccess', _551 => _551.name]) !== "AbortError") {
16809
17068
  console.warn("[use-slash-commands] fetch failed:", err);
16810
17069
  setAnswered({ prefix, commands: NO_COMMANDS });
16811
17070
  }
@@ -16828,7 +17087,7 @@ function useSlashCommandRegistry(commandsUrl, options) {
16828
17087
  const query = _reactquery.useQuery.call(void 0, {
16829
17088
  queryKey: ["chat-slash-commands", commandsUrl],
16830
17089
  queryFn: ({ signal }) => fetchSlashCommands("", signal, commandsUrl),
16831
- enabled: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _535 => _535.enabled]), () => ( true)),
17090
+ enabled: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _552 => _552.enabled]), () => ( true)),
16832
17091
  staleTime: Infinity,
16833
17092
  gcTime: Infinity,
16834
17093
  // The commands registry is non-critical chrome — a failure degrades to an
@@ -16867,21 +17126,21 @@ async function fetchEmptyStateConfig(signal, emptyStateUrl) {
16867
17126
  }
16868
17127
  const data = await res.json();
16869
17128
  return {
16870
- name: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _536 => _536.name]), () => ( null)),
16871
- icon: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _537 => _537.icon]), () => ( null)),
16872
- greeting: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _538 => _538.greeting]), () => ( null)),
16873
- enabledRagTableIds: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _539 => _539.enabledRagTableIds]), () => ( [])),
16874
- quickActions: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _540 => _540.quickActions]), () => ( [])),
16875
- suggestedQueries: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _541 => _541.suggestedQueries]), () => ( []))
17129
+ name: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _553 => _553.name]), () => ( null)),
17130
+ icon: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _554 => _554.icon]), () => ( null)),
17131
+ greeting: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _555 => _555.greeting]), () => ( null)),
17132
+ enabledRagTableIds: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _556 => _556.enabledRagTableIds]), () => ( [])),
17133
+ quickActions: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _557 => _557.quickActions]), () => ( [])),
17134
+ suggestedQueries: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _558 => _558.suggestedQueries]), () => ( []))
16876
17135
  };
16877
17136
  } catch (err) {
16878
- if (_optionalChain([err, 'optionalAccess', _542 => _542.name]) === "AbortError") throw err;
17137
+ if (_optionalChain([err, 'optionalAccess', _559 => _559.name]) === "AbortError") throw err;
16879
17138
  console.warn("[chat] empty-state config fetch failed, using neutral defaults:", err);
16880
17139
  return EMPTY_STATE_FALLBACK;
16881
17140
  }
16882
17141
  }
16883
17142
  function useEmptyStateConfig(emptyStateUrl, options) {
16884
- const enabled = (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _543 => _543.enabled]), () => ( true))) && !!emptyStateUrl;
17143
+ const enabled = (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _560 => _560.enabled]), () => ( true))) && !!emptyStateUrl;
16885
17144
  const query = _reactquery.useQuery.call(void 0, {
16886
17145
  queryKey: ["chat-empty-state", emptyStateUrl],
16887
17146
  queryFn: ({ signal }) => fetchEmptyStateConfig(signal, emptyStateUrl),
@@ -16910,7 +17169,7 @@ var CHAT_ATTACHMENT_MAX_SIZE_BYTES = 25 * 1024 * 1024;
16910
17169
  var STORAGE_CACHE_CONTROL_IMMUTABLE = "public, max-age=31536000, immutable";
16911
17170
  function uploadWithProgress(url, file, token, onProgress, signal) {
16912
17171
  return new Promise((resolve, reject) => {
16913
- if (_optionalChain([signal, 'optionalAccess', _544 => _544.aborted])) {
17172
+ if (_optionalChain([signal, 'optionalAccess', _561 => _561.aborted])) {
16914
17173
  reject(new Error("Upload cancelled"));
16915
17174
  return;
16916
17175
  }
@@ -16952,7 +17211,7 @@ function uploadWithProgress(url, file, token, onProgress, signal) {
16952
17211
  const handleSignalAbort = () => {
16953
17212
  xhr.abort();
16954
17213
  };
16955
- _optionalChain([signal, 'optionalAccess', _545 => _545.addEventListener, 'call', _546 => _546("abort", handleSignalAbort, { once: true, signal: listeners.signal })]);
17214
+ _optionalChain([signal, 'optionalAccess', _562 => _562.addEventListener, 'call', _563 => _563("abort", handleSignalAbort, { once: true, signal: listeners.signal })]);
16956
17215
  xhr.upload.addEventListener("progress", handleProgress, { signal: listeners.signal });
16957
17216
  xhr.addEventListener("load", handleLoad, { signal: listeners.signal });
16958
17217
  xhr.addEventListener("error", handleError, { signal: listeners.signal });
@@ -16996,10 +17255,10 @@ function useChatAttachments() {
16996
17255
  try {
16997
17256
  sniffed = await _filetype.fileTypeFromBlob.call(void 0, att.file);
16998
17257
  } catch (err) {
16999
- if (_optionalChain([ctrl, 'optionalAccess', _547 => _547.signal, 'access', _548 => _548.aborted])) return;
17258
+ if (_optionalChain([ctrl, 'optionalAccess', _564 => _564.signal, 'access', _565 => _565.aborted])) return;
17000
17259
  throw new Error(`Could not read file content: ${err instanceof Error ? err.message : String(err)}`);
17001
17260
  }
17002
- if (_optionalChain([ctrl, 'optionalAccess', _549 => _549.signal, 'access', _550 => _550.aborted])) return;
17261
+ if (_optionalChain([ctrl, 'optionalAccess', _566 => _566.signal, 'access', _567 => _567.aborted])) return;
17003
17262
  if (!sniffed) {
17004
17263
  throw new Error("Unrecognized file format");
17005
17264
  }
@@ -17013,7 +17272,7 @@ function useChatAttachments() {
17013
17272
  const urlResp = await _chunkCP6TIRONcjs.embedAuthedFetch.call(void 0, uploadUrlEndpoint, {
17014
17273
  method: "POST",
17015
17274
  headers: { "Content-Type": "application/json" },
17016
- signal: _optionalChain([ctrl, 'optionalAccess', _551 => _551.signal]),
17275
+ signal: _optionalChain([ctrl, 'optionalAccess', _568 => _568.signal]),
17017
17276
  body: JSON.stringify({
17018
17277
  fileName: att.file.name,
17019
17278
  // Pass the SNIFFED MIME (not `file.type`, which can be a
@@ -17042,9 +17301,9 @@ function useChatAttachments() {
17042
17301
  (pct) => {
17043
17302
  updateOne(att.id, { progress: pct });
17044
17303
  },
17045
- _optionalChain([ctrl, 'optionalAccess', _552 => _552.signal])
17304
+ _optionalChain([ctrl, 'optionalAccess', _569 => _569.signal])
17046
17305
  );
17047
- if (_optionalChain([ctrl, 'optionalAccess', _553 => _553.signal, 'access', _554 => _554.aborted])) return;
17306
+ if (_optionalChain([ctrl, 'optionalAccess', _570 => _570.signal, 'access', _571 => _571.aborted])) return;
17048
17307
  updateOne(att.id, {
17049
17308
  status: "ready",
17050
17309
  progress: 100,
@@ -17052,7 +17311,7 @@ function useChatAttachments() {
17052
17311
  viewToken: mintData.viewToken
17053
17312
  });
17054
17313
  } catch (err) {
17055
- if (_optionalChain([ctrl, 'optionalAccess', _555 => _555.signal, 'access', _556 => _556.aborted])) return;
17314
+ if (_optionalChain([ctrl, 'optionalAccess', _572 => _572.signal, 'access', _573 => _573.aborted])) return;
17056
17315
  const message = err instanceof Error ? err.message : String(err);
17057
17316
  updateOne(att.id, { status: "error", progress: 0, errorMessage: message });
17058
17317
  } finally {
@@ -17201,11 +17460,11 @@ var ANON_DEFAULTS = {
17201
17460
  function useResolveChatIdentity(enabled) {
17202
17461
  const runtime = _chunkRDTOMWDNcjs.useRequiredChatRuntime.call(void 0, );
17203
17462
  const url = runtime.endpoints.identityUrl;
17204
- const proxyEmail = _nullishCoalesce(_optionalChain([_chunkCP6TIRONcjs.getEmbedProxyAuth.call(void 0, ), 'optionalAccess', _557 => _557.email]), () => ( null));
17463
+ const proxyEmail = _nullishCoalesce(_optionalChain([_chunkCP6TIRONcjs.getEmbedProxyAuth.call(void 0, ), 'optionalAccess', _574 => _574.email]), () => ( null));
17205
17464
  const requestKey = enabled ? `${url}\0${_nullishCoalesce(proxyEmail, () => ( ""))}` : null;
17206
17465
  const [resolved, setResolved] = _react.useState.call(void 0, null);
17207
- const data = _optionalChain([resolved, 'optionalAccess', _558 => _558.key]) === requestKey ? resolved.data : ANON_DEFAULTS;
17208
- const isLoading = requestKey !== null && _optionalChain([resolved, 'optionalAccess', _559 => _559.key]) !== requestKey;
17466
+ const data = _optionalChain([resolved, 'optionalAccess', _575 => _575.key]) === requestKey ? resolved.data : ANON_DEFAULTS;
17467
+ const isLoading = requestKey !== null && _optionalChain([resolved, 'optionalAccess', _576 => _576.key]) !== requestKey;
17209
17468
  _react.useEffect.call(void 0, () => {
17210
17469
  if (requestKey === null) return void 0;
17211
17470
  let cancelled = false;
@@ -17352,7 +17611,7 @@ function useChat({
17352
17611
  onMessagesChangeRef.current = onMessagesChange;
17353
17612
  });
17354
17613
  _react.useEffect.call(void 0, () => {
17355
- _optionalChain([onMessagesChangeRef, 'access', _560 => _560.current, 'optionalCall', _561 => _561(messages)]);
17614
+ _optionalChain([onMessagesChangeRef, 'access', _577 => _577.current, 'optionalCall', _578 => _578(messages)]);
17356
17615
  }, [messages]);
17357
17616
  const {
17358
17617
  streamMessage,
@@ -17389,7 +17648,7 @@ function useChat({
17389
17648
  name: "You",
17390
17649
  content: text,
17391
17650
  timestamp: /* @__PURE__ */ new Date(),
17392
- ..._optionalChain([options, 'optionalAccess', _562 => _562.hidden]) ? { hidden: true } : {}
17651
+ ..._optionalChain([options, 'optionalAccess', _579 => _579.hidden]) ? { hidden: true } : {}
17393
17652
  };
17394
17653
  addMessage(userMessage);
17395
17654
  setIsTyping(true);
@@ -17603,8 +17862,8 @@ function buildConfirmToolBody(request) {
17603
17862
  async function readServerErrorMessage(response) {
17604
17863
  try {
17605
17864
  const body = await response.json();
17606
- if (typeof _optionalChain([body, 'optionalAccess', _563 => _563.error]) === "string" && body.error.length > 0) return body.error;
17607
- } catch (e58) {
17865
+ if (typeof _optionalChain([body, 'optionalAccess', _580 => _580.error]) === "string" && body.error.length > 0) return body.error;
17866
+ } catch (e60) {
17608
17867
  }
17609
17868
  return null;
17610
17869
  }
@@ -17775,7 +18034,7 @@ function createSseFrameDecoder() {
17775
18034
  let meta;
17776
18035
  try {
17777
18036
  meta = JSON.parse(metaStr);
17778
- } catch (e59) {
18037
+ } catch (e61) {
17779
18038
  inText = true;
17780
18039
  out.push({ type: "turn-start", implicit: true });
17781
18040
  if (buffer.length > 0) {
@@ -17829,7 +18088,7 @@ function createSseFrameDecoder() {
17829
18088
  debug: meta.debug
17830
18089
  });
17831
18090
  }
17832
- } catch (e60) {
18091
+ } catch (e62) {
17833
18092
  }
17834
18093
  }
17835
18094
  return out;
@@ -17861,7 +18120,7 @@ function errorDetailsMessage(details) {
17861
18120
  let parsed;
17862
18121
  try {
17863
18122
  parsed = JSON.parse(details);
17864
- } catch (e61) {
18123
+ } catch (e63) {
17865
18124
  return details;
17866
18125
  }
17867
18126
  if (typeof parsed !== "object" || parsed === null) return void 0;
@@ -17877,6 +18136,23 @@ function approvalDisplaysInline(approvalType, displayApprovalTypes) {
17877
18136
  return !displayApprovalTypes || displayApprovalTypes.includes(approvalType);
17878
18137
  }
17879
18138
 
18139
+ // src/components/chat/utils/chat-source-metadata.ts
18140
+ function mergeChatSources(current, incoming) {
18141
+ const sourcesByIndex = new Map((_nullishCoalesce(current, () => ( []))).map((source) => [source.index, source]));
18142
+ incoming.forEach((source) => {
18143
+ if (!sourcesByIndex.has(source.index)) sourcesByIndex.set(source.index, source);
18144
+ });
18145
+ return Array.from(sourcesByIndex.values());
18146
+ }
18147
+ function mergeChatRefs(current, incoming) {
18148
+ const refsByIdentity = new Map((_nullishCoalesce(current, () => ( []))).map((ref) => [`${ref.type}:${ref.id}`, ref]));
18149
+ incoming.forEach((ref) => {
18150
+ const identity = `${ref.type}:${ref.id}`;
18151
+ if (!refsByIdentity.has(identity)) refsByIdentity.set(identity, ref);
18152
+ });
18153
+ return Array.from(refsByIdentity.values());
18154
+ }
18155
+
17880
18156
  // src/components/chat/stream/message-mutations.ts
17881
18157
  function nextId(role) {
17882
18158
  return `${role}-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`;
@@ -17931,9 +18207,9 @@ function appendToTrailingAssistant(prev, segments) {
17931
18207
  for (const seg of segments) {
17932
18208
  const tail = merged[merged.length - 1];
17933
18209
  const key = upsertKey(seg);
17934
- if (seg.type === "text" && _optionalChain([tail, 'optionalAccess', _564 => _564.type]) === "text") {
18210
+ if (seg.type === "text" && _optionalChain([tail, 'optionalAccess', _581 => _581.type]) === "text") {
17935
18211
  merged[merged.length - 1] = { type: "text", text: tail.text + seg.text };
17936
- } else if (seg.type === "thinking" && _optionalChain([tail, 'optionalAccess', _565 => _565.type]) === "thinking") {
18212
+ } else if (seg.type === "thinking" && _optionalChain([tail, 'optionalAccess', _582 => _582.type]) === "thinking") {
17937
18213
  merged[merged.length - 1] = { type: "thinking", text: tail.text + seg.text };
17938
18214
  } else if (key) {
17939
18215
  const idx = merged.findIndex((m) => upsertKey(m) === key);
@@ -17973,7 +18249,7 @@ function applyApprovalStatusToSegment(s, requestId, status, resolvedByName) {
17973
18249
  }
17974
18250
  if (s.type !== "approval_batch") return s;
17975
18251
  const isAnchor = s.data.approvalRequestId === requestId;
17976
- const hasRow = _optionalChain([s, 'access', _566 => _566.data, 'access', _567 => _567.toolCalls, 'optionalAccess', _568 => _568.some, 'call', _569 => _569((c) => c.toolExecutionRequestId === requestId)]);
18252
+ const hasRow = _optionalChain([s, 'access', _583 => _583.data, 'access', _584 => _584.toolCalls, 'optionalAccess', _585 => _585.some, 'call', _586 => _586((c) => c.toolExecutionRequestId === requestId)]);
17977
18253
  if (!isAnchor && !hasRow) return s;
17978
18254
  const nextResolvedBy = _nullishCoalesce(resolvedByName, () => ( s.resolvedByName));
17979
18255
  const nextExecutions = hasRow ? {
@@ -17995,8 +18271,8 @@ function applyApprovalStatusToSegment(s, requestId, status, resolvedByName) {
17995
18271
  };
17996
18272
  }
17997
18273
  function nextBatchExecution(prevExec, toolData) {
17998
- if (toolData.type === "EXECUTING_TOOL" && _optionalChain([prevExec, 'optionalAccess', _570 => _570.status]) === "done") return null;
17999
- 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]) };
18274
+ if (toolData.type === "EXECUTING_TOOL" && _optionalChain([prevExec, 'optionalAccess', _587 => _587.status]) === "done") return null;
18275
+ return toolData.type === "EXECUTED_TOOL" ? { status: "done", result: toolData.result, success: toolData.success } : { status: "executing", result: _optionalChain([prevExec, 'optionalAccess', _588 => _588.result]), success: _optionalChain([prevExec, 'optionalAccess', _589 => _589.success]) };
18000
18276
  }
18001
18277
  function withBatchExecution(seg, execId, state) {
18002
18278
  return {
@@ -18013,11 +18289,11 @@ function projectBatchStatusToMessages(prev, anchorId, status) {
18013
18289
  }
18014
18290
  function projectBatchRowFailureToMessages(prev, rowRequestId) {
18015
18291
  return mapSegments(prev, (s) => {
18016
- 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)])) {
18292
+ if (s.type !== "approval_batch" || !_optionalChain([s, 'access', _590 => _590.data, 'access', _591 => _591.toolCalls, 'optionalAccess', _592 => _592.some, 'call', _593 => _593((c) => c.toolExecutionRequestId === rowRequestId)])) {
18017
18293
  return s;
18018
18294
  }
18019
- const existing = _optionalChain([s, 'access', _577 => _577.data, 'access', _578 => _578.executions, 'optionalAccess', _579 => _579[rowRequestId]]);
18020
- if (_optionalChain([existing, 'optionalAccess', _580 => _580.status]) === "done") return s;
18295
+ const existing = _optionalChain([s, 'access', _594 => _594.data, 'access', _595 => _595.executions, 'optionalAccess', _596 => _596[rowRequestId]]);
18296
+ if (_optionalChain([existing, 'optionalAccess', _597 => _597.status]) === "done") return s;
18021
18297
  return withBatchExecution(s, rowRequestId, { status: "done", success: false });
18022
18298
  });
18023
18299
  }
@@ -18053,7 +18329,7 @@ function mergeToolExecutionIfPresent(prev, segment) {
18053
18329
  for (let j = message.segments.length - 1; j >= 0; j--) {
18054
18330
  const seg = message.segments[j];
18055
18331
  if (execId && seg.type === "approval_batch" && seg.data.toolCalls.some((c) => c.toolExecutionRequestId === execId)) {
18056
- const prevExec = _optionalChain([seg, 'access', _581 => _581.data, 'access', _582 => _582.executions, 'optionalAccess', _583 => _583[execId]]);
18332
+ const prevExec = _optionalChain([seg, 'access', _598 => _598.data, 'access', _599 => _599.executions, 'optionalAccess', _600 => _600[execId]]);
18057
18333
  const nextExec = nextBatchExecution(prevExec, toolData);
18058
18334
  if (nextExec === null) return prev;
18059
18335
  if (sameExecutionState(prevExec, nextExec)) return prev;
@@ -18226,9 +18502,9 @@ var MessageSegmentAccumulator = class {
18226
18502
  type: "tool_execution",
18227
18503
  data: {
18228
18504
  ...toolData,
18229
- toolTitle: _nullishCoalesce(_nullishCoalesce(toolData.toolTitle, () => ( _optionalChain([existingExecuting, 'optionalAccess', _584 => _584.data, 'access', _585 => _585.toolTitle]))), () => ( _optionalChain([executingTool, 'optionalAccess', _586 => _586.toolTitle]))),
18230
- toolExplanation: _nullishCoalesce(_nullishCoalesce(toolData.toolExplanation, () => ( _optionalChain([existingExecuting, 'optionalAccess', _587 => _587.data, 'access', _588 => _588.toolExplanation]))), () => ( _optionalChain([executingTool, 'optionalAccess', _589 => _589.toolExplanation]))),
18231
- parameters: toolData.parameters || _optionalChain([executingTool, 'optionalAccess', _590 => _590.parameters])
18505
+ toolTitle: _nullishCoalesce(_nullishCoalesce(toolData.toolTitle, () => ( _optionalChain([existingExecuting, 'optionalAccess', _601 => _601.data, 'access', _602 => _602.toolTitle]))), () => ( _optionalChain([executingTool, 'optionalAccess', _603 => _603.toolTitle]))),
18506
+ toolExplanation: _nullishCoalesce(_nullishCoalesce(toolData.toolExplanation, () => ( _optionalChain([existingExecuting, 'optionalAccess', _604 => _604.data, 'access', _605 => _605.toolExplanation]))), () => ( _optionalChain([executingTool, 'optionalAccess', _606 => _606.toolExplanation]))),
18507
+ parameters: toolData.parameters || _optionalChain([executingTool, 'optionalAccess', _607 => _607.parameters])
18232
18508
  }
18233
18509
  };
18234
18510
  if (existingIndex !== -1) {
@@ -18252,7 +18528,7 @@ var MessageSegmentAccumulator = class {
18252
18528
  if (seg.type !== "approval_batch") return seg;
18253
18529
  const hasCall = seg.data.toolCalls.some((c) => c.toolExecutionRequestId === execId);
18254
18530
  if (!hasCall) return seg;
18255
- const prev = _optionalChain([seg, 'access', _591 => _591.data, 'access', _592 => _592.executions, 'optionalAccess', _593 => _593[execId]]);
18531
+ const prev = _optionalChain([seg, 'access', _608 => _608.data, 'access', _609 => _609.executions, 'optionalAccess', _610 => _610[execId]]);
18256
18532
  const next = nextBatchExecution(prev, toolData);
18257
18533
  matched = true;
18258
18534
  if (next === null) return seg;
@@ -18386,8 +18662,8 @@ var MessageSegmentAccumulator = class {
18386
18662
  requestId,
18387
18663
  {
18388
18664
  ...pendingApproval,
18389
- command: _optionalChain([pendingApproval, 'optionalAccess', _594 => _594.command]) || "",
18390
- approvalType: _optionalChain([pendingApproval, 'optionalAccess', _595 => _595.approvalType]) || approvalType
18665
+ command: _optionalChain([pendingApproval, 'optionalAccess', _611 => _611.command]) || "",
18666
+ approvalType: _optionalChain([pendingApproval, 'optionalAccess', _612 => _612.approvalType]) || approvalType
18391
18667
  },
18392
18668
  status
18393
18669
  );
@@ -18412,9 +18688,9 @@ var MessageSegmentAccumulator = class {
18412
18688
  type: "escalation_offer",
18413
18689
  // The resolved chunk carries no text/origin — a redelivered offer must
18414
18690
  // not blank the card the PENDING chunk already painted.
18415
- 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]))) },
18691
+ data: { offerId, text: text || _optionalChain([existing, 'optionalAccess', _613 => _613.data, 'access', _614 => _614.text]) || "", origin: _nullishCoalesce(origin, () => ( _optionalChain([existing, 'optionalAccess', _615 => _615.data, 'access', _616 => _616.origin]))) },
18416
18692
  status,
18417
- resolvedByName: _nullishCoalesce(resolvedByName, () => ( _optionalChain([existing, 'optionalAccess', _600 => _600.resolvedByName]))),
18693
+ resolvedByName: _nullishCoalesce(resolvedByName, () => ( _optionalChain([existing, 'optionalAccess', _617 => _617.resolvedByName]))),
18418
18694
  onApprove: this.callbacks.onEscalationApprove,
18419
18695
  onReject: this.callbacks.onEscalationReject
18420
18696
  };
@@ -18736,10 +19012,12 @@ function createChatStreamReducer(options = {}) {
18736
19012
  const sourcesMap = /* @__PURE__ */ new Map();
18737
19013
  let sendCount = 0;
18738
19014
  let sseCurrentText = "";
19015
+ let pendingSources;
19016
+ let pendingRefs;
18739
19017
  let stateCache = null;
18740
19018
  function invalidate() {
18741
19019
  stateCache = null;
18742
- _optionalChain([onChange, 'optionalCall', _601 => _601()]);
19020
+ _optionalChain([onChange, 'optionalCall', _618 => _618()]);
18743
19021
  }
18744
19022
  function getState() {
18745
19023
  if (!stateCache) {
@@ -18755,7 +19033,7 @@ function createChatStreamReducer(options = {}) {
18755
19033
  return stateCache;
18756
19034
  }
18757
19035
  function emit(name, ...args) {
18758
- _optionalChain([onEffect, 'optionalCall', _602 => _602({ name, args })]);
19036
+ _optionalChain([onEffect, 'optionalCall', _619 => _619({ name, args })]);
18759
19037
  }
18760
19038
  function setMessagesInternal(next) {
18761
19039
  if (next !== messages) {
@@ -18786,24 +19064,35 @@ function createChatStreamReducer(options = {}) {
18786
19064
  return [...next.slice(0, -1), { ...last, streamSeq: seq }];
18787
19065
  }
18788
19066
  function applySegmentsToState(segments, meta) {
18789
- const seq = _optionalChain([meta, 'optionalAccess', _603 => _603.streamSeq]);
18790
- if (_optionalChain([meta, 'optionalAccess', _604 => _604.append]) && meta.isCompacting) {
19067
+ const seq = _optionalChain([meta, 'optionalAccess', _620 => _620.streamSeq]);
19068
+ if (_optionalChain([meta, 'optionalAccess', _621 => _621.append]) && meta.isCompacting) {
18791
19069
  setMessagesInternal(stampTrailingAssistantSeq(upsertTrailingCompaction(messages, segments), seq));
18792
19070
  return;
18793
19071
  }
18794
- if (_optionalChain([meta, 'optionalAccess', _605 => _605.append])) {
19072
+ if (_optionalChain([meta, 'optionalAccess', _622 => _622.append])) {
18795
19073
  setMessagesInternal(stampTrailingAssistantSeq(appendToTrailingAssistant(messages, segments), seq));
18796
19074
  return;
18797
19075
  }
18798
19076
  setMessagesInternal(stampTrailingAssistantSeq(updateTrailingAssistant(messages, segments), seq));
18799
19077
  }
19078
+ function attachPendingSourceMetadata() {
19079
+ if (!pendingSources && !pendingRefs) return;
19080
+ const last = messages[messages.length - 1];
19081
+ if (!last || last.role !== "assistant") return;
19082
+ const next = {
19083
+ ...last,
19084
+ ...pendingSources ? { sources: pendingSources } : {},
19085
+ ...pendingRefs ? { refs: pendingRefs } : {}
19086
+ };
19087
+ setMessagesInternal([...messages.slice(0, -1), next]);
19088
+ }
18800
19089
  function applyStreamStartToState() {
18801
19090
  setPhaseInternal("streaming");
18802
19091
  const adoptTail = adoptTrailingAssistant;
18803
19092
  adoptTrailingAssistant = false;
18804
19093
  const last = messages[messages.length - 1];
18805
19094
  if (!last || last.role !== "assistant" || adoptTail) return;
18806
- const hasContent = (_nullishCoalesce(_optionalChain([last, 'access', _606 => _606.segments, 'optionalAccess', _607 => _607.length]), () => ( 0))) > 0 || last.content !== "";
19095
+ const hasContent = (_nullishCoalesce(_optionalChain([last, 'access', _623 => _623.segments, 'optionalAccess', _624 => _624.length]), () => ( 0))) > 0 || last.content !== "";
18807
19096
  if (!hasContent) return;
18808
19097
  setMessagesInternal([...messages, { id: nextId("assistant"), role: "assistant", content: "", segments: [] }]);
18809
19098
  }
@@ -18915,6 +19204,8 @@ function createChatStreamReducer(options = {}) {
18915
19204
  }
18916
19205
  switch (event.type) {
18917
19206
  case "turn-start": {
19207
+ pendingSources = void 0;
19208
+ pendingRefs = void 0;
18918
19209
  isInStream = true;
18919
19210
  hasEverStreamed = true;
18920
19211
  turnStartedAt = Date.now();
@@ -18929,6 +19220,14 @@ function createChatStreamReducer(options = {}) {
18929
19220
  emit("onStreamEnd");
18930
19221
  setPhaseInternal("idle");
18931
19222
  accumulator.resetSegments();
19223
+ pendingSources = void 0;
19224
+ pendingRefs = void 0;
19225
+ break;
19226
+ }
19227
+ case "sources": {
19228
+ pendingSources = mergeChatSources(pendingSources, event.sources);
19229
+ if (event.refs) pendingRefs = mergeChatRefs(pendingRefs, event.refs);
19230
+ attachPendingSourceMetadata();
18932
19231
  break;
18933
19232
  }
18934
19233
  case "metadata": {
@@ -18957,10 +19256,12 @@ function createChatStreamReducer(options = {}) {
18957
19256
  if (isInStream || !hasEverStreamed) {
18958
19257
  emitSegments(segments);
18959
19258
  applySegmentsToState(segments, withSeqMeta(void 0));
19259
+ attachPendingSourceMetadata();
18960
19260
  } else {
18961
19261
  const delta = [{ type: kind, text: event.text }];
18962
19262
  emitSegments(delta, { append: true });
18963
19263
  applySegmentsToState(delta, withSeqMeta({ append: true }));
19264
+ attachPendingSourceMetadata();
18964
19265
  }
18965
19266
  break;
18966
19267
  }
@@ -19013,13 +19314,13 @@ function createChatStreamReducer(options = {}) {
19013
19314
  const summary = required ? getCommandText(required) : `Batch of ${toolCalls.length} tool calls`;
19014
19315
  pendingEscalated.set(requestId, {
19015
19316
  command: summary,
19016
- explanation: _optionalChain([required, 'optionalAccess', _608 => _608.toolExplanation]),
19317
+ explanation: _optionalChain([required, 'optionalAccess', _625 => _625.toolExplanation]),
19017
19318
  approvalType,
19018
19319
  toolCalls
19019
19320
  });
19020
19321
  emit("onEscalatedApproval", requestId, {
19021
19322
  command: summary,
19022
- explanation: _optionalChain([required, 'optionalAccess', _609 => _609.toolExplanation]),
19323
+ explanation: _optionalChain([required, 'optionalAccess', _626 => _626.toolExplanation]),
19023
19324
  approvalType
19024
19325
  });
19025
19326
  break;
@@ -19403,7 +19704,7 @@ function createChatStreamReducer(options = {}) {
19403
19704
  const resolveBatch = (status, confirm) => async () => {
19404
19705
  setMessagesInternal(projectBatchStatusToMessages(messages, anchorId, status));
19405
19706
  for (const id of ids) {
19406
- const ok = await _optionalChain([confirm, 'optionalCall', _610 => _610(id)]);
19707
+ const ok = await _optionalChain([confirm, 'optionalCall', _627 => _627(id)]);
19407
19708
  if (ok === false) {
19408
19709
  setMessagesInternal(projectBatchRowFailureToMessages(messages, id));
19409
19710
  }
@@ -19539,8 +19840,8 @@ function createChatStreamReducer(options = {}) {
19539
19840
  }
19540
19841
  }
19541
19842
  }
19542
- hasEverStreamed = hasEverStreamed || (_nullishCoalesce(_optionalChain([extras, 'optionalAccess', _611 => _611.resumed]), () => ( messages.length > 0)));
19543
- if (_optionalChain([extras, 'optionalAccess', _612 => _612.agentBusy])) agentBusyState();
19843
+ hasEverStreamed = hasEverStreamed || (_nullishCoalesce(_optionalChain([extras, 'optionalAccess', _628 => _628.resumed]), () => ( messages.length > 0)));
19844
+ if (_optionalChain([extras, 'optionalAccess', _629 => _629.agentBusy])) agentBusyState();
19544
19845
  invalidate();
19545
19846
  }
19546
19847
  return {
@@ -19625,7 +19926,7 @@ function createChatStreamReducer(options = {}) {
19625
19926
  },
19626
19927
  endSseTurn() {
19627
19928
  const last = messages[messages.length - 1];
19628
- if (last && last.role === "assistant" && (_nullishCoalesce(_optionalChain([last, 'access', _613 => _613.segments, 'optionalAccess', _614 => _614.length]), () => ( 0))) === 0 && last.content === "") {
19929
+ if (last && last.role === "assistant" && (_nullishCoalesce(_optionalChain([last, 'access', _630 => _630.segments, 'optionalAccess', _631 => _631.length]), () => ( 0))) === 0 && last.content === "") {
19629
19930
  messages = messages.slice(0, -1);
19630
19931
  }
19631
19932
  sseCurrentText = "";
@@ -19778,10 +20079,10 @@ function createChatDialogStore(options = {}) {
19778
20079
  if (onEvict) {
19779
20080
  const sep = key.indexOf(KEY_SEP);
19780
20081
  onEvict(key.slice(0, sep), key.slice(sep + 1), {
19781
- messages: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _615 => _615.state, 'access', _616 => _616.messages]), () => ( EMPTY_STATE.messages)),
19782
- approvalStatuses: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _617 => _617.state, 'access', _618 => _618.approvalStatuses]), () => ( EMPTY_STATE.approvalStatuses)),
19783
- lastAppliedSeq: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _619 => _619.getLastAppliedSeq, 'call', _620 => _620()]), () => ( Number.NEGATIVE_INFINITY)),
19784
- pendingEchoes: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _621 => _621.getPendingEchoes, 'call', _622 => _622()]), () => ( EMPTY_PENDING_ECHOES))
20082
+ messages: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _632 => _632.state, 'access', _633 => _633.messages]), () => ( EMPTY_STATE.messages)),
20083
+ approvalStatuses: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _634 => _634.state, 'access', _635 => _635.approvalStatuses]), () => ( EMPTY_STATE.approvalStatuses)),
20084
+ lastAppliedSeq: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _636 => _636.getLastAppliedSeq, 'call', _637 => _637()]), () => ( Number.NEGATIVE_INFINITY)),
20085
+ pendingEchoes: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _638 => _638.getPendingEchoes, 'call', _639 => _639()]), () => ( EMPTY_PENDING_ECHOES))
19785
20086
  });
19786
20087
  }
19787
20088
  }
@@ -19791,12 +20092,12 @@ function createChatDialogStore(options = {}) {
19791
20092
  const key = keyOf(dialogId, side);
19792
20093
  let reducer = reducers.get(key);
19793
20094
  if (!reducer) {
19794
- const base = _nullishCoalesce(_optionalChain([(_nullishCoalesce(createOptions, () => ( defaultCreateOptions))), 'optionalCall', _623 => _623(dialogId, side)]), () => ( {}));
20095
+ const base = _nullishCoalesce(_optionalChain([(_nullishCoalesce(createOptions, () => ( defaultCreateOptions))), 'optionalCall', _640 => _640(dialogId, side)]), () => ( {}));
19795
20096
  const userOnChange = base.onChange;
19796
20097
  reducer = createChatStreamReducer({
19797
20098
  ...base,
19798
20099
  onChange: () => {
19799
- _optionalChain([userOnChange, 'optionalCall', _624 => _624()]);
20100
+ _optionalChain([userOnChange, 'optionalCall', _641 => _641()]);
19800
20101
  notify();
19801
20102
  }
19802
20103
  });
@@ -19841,7 +20142,7 @@ function createChatDialogStore(options = {}) {
19841
20142
  };
19842
20143
  }
19843
20144
  function getSnapshot2(dialogId, side = DEFAULT_DIALOG_SIDE) {
19844
- return _nullishCoalesce(_optionalChain([reducers, 'access', _625 => _625.get, 'call', _626 => _626(keyOf(dialogId, side)), 'optionalAccess', _627 => _627.state]), () => ( EMPTY_STATE));
20145
+ return _nullishCoalesce(_optionalChain([reducers, 'access', _642 => _642.get, 'call', _643 => _643(keyOf(dialogId, side)), 'optionalAccess', _644 => _644.state]), () => ( EMPTY_STATE));
19845
20146
  }
19846
20147
  function getServerSnapshot2() {
19847
20148
  return EMPTY_STATE;
@@ -19933,7 +20234,7 @@ function createDeltaBatcher({
19933
20234
  pending = [];
19934
20235
  const key = pendingKey;
19935
20236
  for (const delta of batch) applyOne(delta, key);
19936
- _optionalChain([onFlushed, 'optionalCall', _628 => _628(batch.length)]);
20237
+ _optionalChain([onFlushed, 'optionalCall', _645 => _645(batch.length)]);
19937
20238
  }
19938
20239
  function schedule() {
19939
20240
  if (raf !== null || timer !== null) return;
@@ -19957,7 +20258,7 @@ function createDeltaBatcher({
19957
20258
  }
19958
20259
  if (!isDeltaEvent(event)) return false;
19959
20260
  const tail = pending[pending.length - 1];
19960
- const seqAdvances = _optionalChain([tail, 'optionalAccess', _629 => _629.seq]) == null ? event.seq == null : event.seq != null && event.seq > tail.seq;
20261
+ const seqAdvances = _optionalChain([tail, 'optionalAccess', _646 => _646.seq]) == null ? event.seq == null : event.seq != null && event.seq > tail.seq;
19961
20262
  if (tail && seqAdvances && tail.type === event.type && (tail.type !== "text-delta" || tail.leading === event.leading)) {
19962
20263
  pending[pending.length - 1] = {
19963
20264
  ...tail,
@@ -19988,7 +20289,7 @@ function useChatStreamReducer({
19988
20289
  side = DEFAULT_DIALOG_SIDE,
19989
20290
  createReducerOptions
19990
20291
  }) {
19991
- const reducer = store.getReducer(dialogId, side, () => _nullishCoalesce(_optionalChain([createReducerOptions, 'optionalCall', _630 => _630()]), () => ( {})));
20292
+ const reducer = store.getReducer(dialogId, side, () => _nullishCoalesce(_optionalChain([createReducerOptions, 'optionalCall', _647 => _647()]), () => ( {})));
19992
20293
  const getSnapshot2 = _react.useCallback.call(void 0, () => store.getSnapshot(dialogId, side), [store, dialogId, side]);
19993
20294
  const getServerSnapshot2 = _react.useCallback.call(void 0, () => store.getServerSnapshot(), [store]);
19994
20295
  const subscribe2 = _react.useCallback.call(void 0, (listener) => store.subscribe(listener), [store]);
@@ -20027,7 +20328,7 @@ var STORAGE_KEY = "conversation";
20027
20328
  var namespaceFor = (source) => {
20028
20329
  const base = `mingo-chat-${source}`;
20029
20330
  const auth = _chunkCP6TIRONcjs.getEmbedProxyAuth.call(void 0, );
20030
- return _optionalChain([auth, 'optionalAccess', _631 => _631.email]) ? `${base}-u-${encodeURIComponent(auth.email.toLowerCase())}` : base;
20331
+ return _optionalChain([auth, 'optionalAccess', _648 => _648.email]) ? `${base}-u-${encodeURIComponent(auth.email.toLowerCase())}` : base;
20031
20332
  };
20032
20333
  function createChatConversationStorage(source) {
20033
20334
  return _chunkCP6TIRONcjs.createLocalStorageAdapter.call(void 0, {
@@ -20055,7 +20356,7 @@ function pruneStaleChatConversationStorage(source) {
20055
20356
  for (const k of toRemove) {
20056
20357
  window.localStorage.removeItem(k);
20057
20358
  }
20058
- } catch (e62) {
20359
+ } catch (e64) {
20059
20360
  }
20060
20361
  }
20061
20362
 
@@ -20091,7 +20392,7 @@ function formatSingularLookupInvocation(cmdId, value) {
20091
20392
  return safe ? `/${cmdId} "${safe}"` : `/${cmdId}`;
20092
20393
  }
20093
20394
  function extractEntityIdFilter(override, expectedTableId) {
20094
- const f = _optionalChain([override, 'optionalAccess', _632 => _632.entityIdFilter]);
20395
+ const f = _optionalChain([override, 'optionalAccess', _649 => _649.entityIdFilter]);
20095
20396
  if (!f) return null;
20096
20397
  const tableId = typeof f.tableId === "string" ? f.tableId : "";
20097
20398
  const id = typeof f.id === "string" ? f.id : "";
@@ -20130,7 +20431,7 @@ var AUTO_CONTINUATION_DIRECTIVE_PREFIX = "[internal-auto-continuation]";
20130
20431
  function buildAutoContinuationDirective(toolName, opts = {}) {
20131
20432
  const ticketRef = opts.ticketId ? ` (ticket #${opts.ticketId})` : "";
20132
20433
  const ticketHash = opts.ticketId ? ` #${opts.ticketId}` : "";
20133
- const isClose = toolName === "update_ticket" && _optionalChain([opts, 'access', _633 => _633.status, 'optionalAccess', _634 => _634.toUpperCase, 'call', _635 => _635()]) === "CLOSED";
20434
+ const isClose = toolName === "update_ticket" && _optionalChain([opts, 'access', _650 => _650.status, 'optionalAccess', _651 => _651.toUpperCase, 'call', _652 => _652()]) === "CLOSED";
20134
20435
  if (toolName === "create_ticket") {
20135
20436
  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.`;
20136
20437
  }
@@ -20202,7 +20503,7 @@ function useChatHistoryHydration({
20202
20503
  sendCountRef.current = userTurns;
20203
20504
  hydrateMessages(hydrated, Array.from(sourcesSeed.entries()));
20204
20505
  bumpMetaTick();
20205
- } catch (e63) {
20506
+ } catch (e65) {
20206
20507
  } finally {
20207
20508
  if (!cancelled) setIsHydratingHistory(false);
20208
20509
  }
@@ -20253,7 +20554,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20253
20554
  const { active = true } = runtimeOptions;
20254
20555
  const runtime = _chunkRDTOMWDNcjs.useRequiredChatRuntime.call(void 0, );
20255
20556
  const source = runtime.source || DEFAULT_CHAT_SOURCE;
20256
- const tableIdForDocumentType = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _636 => _636.tableIdForDocumentType]), () => ( defaultTableIdForDocumentType));
20557
+ const tableIdForDocumentType = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _653 => _653.tableIdForDocumentType]), () => ( defaultTableIdForDocumentType));
20257
20558
  const sendMessageRef = _react.useRef.call(void 0,
20258
20559
  () => Promise.resolve(true)
20259
20560
  );
@@ -20290,7 +20591,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20290
20591
  if (!restoredConversationRef.current) {
20291
20592
  restoredConversationRef.current = true;
20292
20593
  pruneStaleChatConversationStorage(source);
20293
- conversationIdRef.current = _nullishCoalesce(_optionalChain([conversationStorage, 'access', _637 => _637.load, 'call', _638 => _638(), 'optionalAccess', _639 => _639.conversationId]), () => ( null));
20594
+ conversationIdRef.current = _nullishCoalesce(_optionalChain([conversationStorage, 'access', _654 => _654.load, 'call', _655 => _655(), 'optionalAccess', _656 => _656.conversationId]), () => ( null));
20294
20595
  }
20295
20596
  const commandsUrl = runtime.endpoints.commandsUrl;
20296
20597
  const { commands: slashCommands } = useSlashCommandRegistry(commandsUrl, {
@@ -20395,7 +20696,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20395
20696
  const serverMessage = await readServerErrorMessage(response);
20396
20697
  throw new Error(_nullishCoalesce(serverMessage, () => ( `Chat request failed: ${response.status}`)));
20397
20698
  }
20398
- const reader = _optionalChain([response, 'access', _640 => _640.body, 'optionalAccess', _641 => _641.getReader, 'call', _642 => _642()]);
20699
+ const reader = _optionalChain([response, 'access', _657 => _657.body, 'optionalAccess', _658 => _658.getReader, 'call', _659 => _659()]);
20399
20700
  if (!reader) throw new Error("No response body");
20400
20701
  const frameDecoder = createSseFrameDecoder();
20401
20702
  let finished = false;
@@ -20418,7 +20719,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20418
20719
  }
20419
20720
  return true;
20420
20721
  } catch (err) {
20421
- if (_optionalChain([err, 'optionalAccess', _643 => _643.name]) === "AbortError" || ctrl.signal.aborted) {
20722
+ if (_optionalChain([err, 'optionalAccess', _660 => _660.name]) === "AbortError" || ctrl.signal.aborted) {
20422
20723
  return true;
20423
20724
  }
20424
20725
  flushDeltas();
@@ -20438,7 +20739,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20438
20739
  );
20439
20740
  sendMessageRef.current = sendMessage;
20440
20741
  const stopMessage = _react.useCallback.call(void 0, () => {
20441
- _optionalChain([abortControllerRef, 'access', _644 => _644.current, 'optionalAccess', _645 => _645.abort, 'call', _646 => _646()]);
20742
+ _optionalChain([abortControllerRef, 'access', _661 => _661.current, 'optionalAccess', _662 => _662.abort, 'call', _663 => _663()]);
20442
20743
  flushDeltas();
20443
20744
  mutate((r) => r.setPhase("idle"));
20444
20745
  }, [mutate, flushDeltas]);
@@ -20454,7 +20755,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20454
20755
  let sendIdx = -1;
20455
20756
  return state.messages.map((m) => {
20456
20757
  const segments = m.segments;
20457
- 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("")]), () => ( ""));
20758
+ const content = typeof m.content === "string" && !segments ? m.content : _nullishCoalesce(_optionalChain([segments, 'optionalAccess', _664 => _664.filter, 'call', _665 => _665((s) => s.type === "text"), 'access', _666 => _666.map, 'call', _667 => _667((s) => s.text), 'access', _668 => _668.join, 'call', _669 => _669("")]), () => ( ""));
20458
20759
  let sources;
20459
20760
  let scrollAnchor;
20460
20761
  if (m.role === "user" && !m.hidden) {
@@ -20463,7 +20764,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20463
20764
  if (m.role === "assistant") {
20464
20765
  const lookupIdx = sendIdx >= 0 ? sendIdx : 0;
20465
20766
  sources = sourcesMap.get(lookupIdx);
20466
- scrollAnchor = _nullishCoalesce(_optionalChain([meta, 'access', _653 => _653.get, 'call', _654 => _654(lookupIdx), 'optionalAccess', _655 => _655.scrollAnchor]), () => ( void 0));
20767
+ scrollAnchor = _nullishCoalesce(_optionalChain([meta, 'access', _670 => _670.get, 'call', _671 => _671(lookupIdx), 'optionalAccess', _672 => _672.scrollAnchor]), () => ( void 0));
20467
20768
  }
20468
20769
  return {
20469
20770
  id: m.id,
@@ -20490,7 +20791,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20490
20791
  );
20491
20792
  return;
20492
20793
  }
20493
- const refSlug = typeof _optionalChain([reference, 'access', _656 => _656.metadata, 'optionalAccess', _657 => _657.slug]) === "string" && reference.metadata.slug.length > 0 ? reference.metadata.slug : "";
20794
+ const refSlug = typeof _optionalChain([reference, 'access', _673 => _673.metadata, 'optionalAccess', _674 => _674.slug]) === "string" && reference.metadata.slug.length > 0 ? reference.metadata.slug : "";
20494
20795
  const queryValue = refSlug || sanitizeTitleForChat(reference.title) || reference.id;
20495
20796
  const escaped = queryValue.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
20496
20797
  const text = `/${cmdId} display "${escaped}"`;
@@ -20536,18 +20837,18 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20536
20837
  /** True while the mount-time rebuild from the server transcript runs. */
20537
20838
  isHydratingHistory,
20538
20839
  /** Provider key for the lib's `<ModelDisplay>` icon. */
20539
- currentProvider: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _658 => _658.provider]), () => ( null)),
20540
- currentModelLabel: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _659 => _659.modelLabel]), () => ( null)),
20541
- currentContextWindowMaxTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _660 => _660.contextWindowMaxTokens]), () => ( null)),
20840
+ currentProvider: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _675 => _675.provider]), () => ( null)),
20841
+ currentModelLabel: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _676 => _676.modelLabel]), () => ( null)),
20842
+ currentContextWindowMaxTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _677 => _677.contextWindowMaxTokens]), () => ( null)),
20542
20843
  /** Input tokens (known after server's message_start frame; null until). */
20543
- currentInputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _661 => _661.inputTokens]), () => ( null)),
20844
+ currentInputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _678 => _678.inputTokens]), () => ( null)),
20544
20845
  /** Output tokens (known only after server's trailing usage frame). */
20545
- currentOutputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _662 => _662.outputTokens]), () => ( null)),
20846
+ currentOutputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _679 => _679.outputTokens]), () => ( null)),
20546
20847
  /** Cache hit % (read / total-input × 100). null during streaming. */
20547
- currentCacheHitRatePct: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _663 => _663.cacheHitRatePct]), () => ( null)),
20848
+ currentCacheHitRatePct: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _680 => _680.cacheHitRatePct]), () => ( null)),
20548
20849
  /** Cross-call usage breakdown (Haiku rewriter/classifier/summarizer
20549
20850
  * token counts). null until the trailing usage frame lands. */
20550
- currentUsageBreakdown: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _664 => _664.breakdown]), () => ( null)),
20851
+ currentUsageBreakdown: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _681 => _681.breakdown]), () => ( null)),
20551
20852
  // ─── Dialog management — stubs for v1 ────────────────────────────────
20552
20853
  // Guide mode keeps ONE server-side conversation per stored id
20553
20854
  // (`chat_conversations`, hydrated on mount). Surfacing multiple threads
@@ -20648,6 +20949,11 @@ function decodeNatsChunk(chunk) {
20648
20949
  return { type: "thinking-delta", text: data.text, ...seq };
20649
20950
  }
20650
20951
  return null;
20952
+ case MESSAGE_TYPE.GUIDE:
20953
+ case MESSAGE_TYPE.SOURCES: {
20954
+ const event = sourceMetadataEvent(data.payload);
20955
+ return event ? { ...event, ...seq } : null;
20956
+ }
20651
20957
  // An ask card is only an ask card with something to pick: a question and at
20652
20958
  // least one option. Anything less is dropped rather than rendered as an
20653
20959
  // empty card the user can't answer — the backend already falls back to a
@@ -20792,7 +21098,7 @@ function decodeNatsChunk(chunk) {
20792
21098
  userId: typeof data.userId === "string" ? data.userId : void 0,
20793
21099
  // Wire shape carries no label; fall back to the id (parity with
20794
21100
  // the history path in `process-historical-messages.ts`).
20795
- 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) => ({
21101
+ contextItems: Array.isArray(data.contextItems) ? data.contextItems.filter((it) => typeof _optionalChain([it, 'optionalAccess', _682 => _682.type]) === "string" && typeof _optionalChain([it, 'optionalAccess', _683 => _683.id]) === "string").map((it) => ({
20796
21102
  type: it.type,
20797
21103
  id: it.id,
20798
21104
  label: it.id
@@ -20883,7 +21189,7 @@ function extractIncompleteMessageState(lastMessage) {
20883
21189
  }
20884
21190
  break;
20885
21191
  case "approval_batch": {
20886
- 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");
21192
+ const allDone = !!segment.data.executions && segment.data.toolCalls.every((c) => _optionalChain([segment, 'access', _684 => _684.data, 'access', _685 => _685.executions, 'optionalAccess', _686 => _686[c.toolExecutionRequestId], 'optionalAccess', _687 => _687.status]) === "done");
20887
21193
  if (segment.status !== "rejected" && !allDone) {
20888
21194
  hasIncompleteState = true;
20889
21195
  }
@@ -20945,11 +21251,11 @@ function extractIncompleteMessageState(lastMessage) {
20945
21251
  function extractIncompleteTailState(messages) {
20946
21252
  if (!messages || messages.length === 0) return void 0;
20947
21253
  let start = messages.length;
20948
- while (start > 0 && _optionalChain([messages, 'access', _671 => _671[start - 1], 'optionalAccess', _672 => _672.role]) === "assistant") start -= 1;
21254
+ while (start > 0 && _optionalChain([messages, 'access', _688 => _688[start - 1], 'optionalAccess', _689 => _689.role]) === "assistant") start -= 1;
20949
21255
  if (start === messages.length) return void 0;
20950
21256
  const segments = [];
20951
21257
  for (let i = start; i < messages.length; i += 1) {
20952
- const content = _optionalChain([messages, 'access', _673 => _673[i], 'optionalAccess', _674 => _674.content]);
21258
+ const content = _optionalChain([messages, 'access', _690 => _690[i], 'optionalAccess', _691 => _691.content]);
20953
21259
  if (Array.isArray(content)) segments.push(...content);
20954
21260
  }
20955
21261
  if (segments.length === 0) return void 0;
@@ -20962,15 +21268,15 @@ function extractIncompleteTailState(messages) {
20962
21268
 
20963
21269
  // src/components/chat/utils/process-historical-messages.ts
20964
21270
  function getOwnerDisplayName(owner) {
20965
- if (_optionalChain([owner, 'optionalAccess', _675 => _675.type]) === OWNER_TYPE.ADMIN && owner.user) {
21271
+ if (_optionalChain([owner, 'optionalAccess', _692 => _692.type]) === OWNER_TYPE.ADMIN && owner.user) {
20966
21272
  const { firstName, lastName } = owner.user;
20967
21273
  const name = [firstName, lastName].filter(Boolean).join(" ");
20968
21274
  if (name) return name;
20969
21275
  }
20970
- return _optionalChain([owner, 'optionalAccess', _676 => _676.type]) === OWNER_TYPE.ADMIN ? "Admin" : "You";
21276
+ return _optionalChain([owner, 'optionalAccess', _693 => _693.type]) === OWNER_TYPE.ADMIN ? "Admin" : "You";
20971
21277
  }
20972
21278
  function getOwnerAvatar(owner) {
20973
- return _nullishCoalesce(_optionalChain([owner, 'optionalAccess', _677 => _677.user, 'optionalAccess', _678 => _678.image, 'optionalAccess', _679 => _679.imageUrl]), () => ( void 0));
21279
+ return _nullishCoalesce(_optionalChain([owner, 'optionalAccess', _694 => _694.user, 'optionalAccess', _695 => _695.image, 'optionalAccess', _696 => _696.imageUrl]), () => ( void 0));
20974
21280
  }
20975
21281
  function pushStandaloneMessages(processedMessages, msg, messageDataArray) {
20976
21282
  messageDataArray.forEach((data) => {
@@ -20999,6 +21305,9 @@ function decodeHistoricalMessageData(data) {
20999
21305
  return { type: "thinking-delta", text: data.text };
21000
21306
  }
21001
21307
  return null;
21308
+ case MESSAGE_TYPE.GUIDE:
21309
+ case MESSAGE_TYPE.SOURCES:
21310
+ return decodeNatsChunk({ type: data.type, payload: data.payload });
21002
21311
  // Same completeness gate as the live decoder (`decodeNatsChunk`): a
21003
21312
  // persisted row without a question or without options is not a card the
21004
21313
  // user can answer, so it replays as nothing rather than as empty chrome.
@@ -21154,7 +21463,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
21154
21463
  event.offerId,
21155
21464
  event.text,
21156
21465
  event.origin,
21157
- _nullishCoalesce(_optionalChain([escalationOfferStates, 'optionalAccess', _680 => _680[event.offerId]]), () => ( "pending"))
21466
+ _nullishCoalesce(_optionalChain([escalationOfferStates, 'optionalAccess', _697 => _697[event.offerId]]), () => ( "pending"))
21158
21467
  );
21159
21468
  break;
21160
21469
  case "ticket-escalated":
@@ -21184,7 +21493,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
21184
21493
  );
21185
21494
  break;
21186
21495
  case "escalation-offer-resolved":
21187
- _optionalChain([offerResolutions, 'optionalAccess', _681 => _681.set, 'call', _682 => _682(event.offerId, {
21496
+ _optionalChain([offerResolutions, 'optionalAccess', _698 => _698.set, 'call', _699 => _699(event.offerId, {
21188
21497
  status: event.status,
21189
21498
  resolvedByName: event.resolvedByName
21190
21499
  })]);
@@ -21248,7 +21557,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
21248
21557
  }
21249
21558
  }
21250
21559
  } else {
21251
- _optionalChain([escalatedApprovals, 'optionalAccess', _683 => _683.set, 'call', _684 => _684(event.requestId, {
21560
+ _optionalChain([escalatedApprovals, 'optionalAccess', _700 => _700.set, 'call', _701 => _701(event.requestId, {
21252
21561
  command: event.command || "",
21253
21562
  explanation: event.explanation,
21254
21563
  approvalType,
@@ -21263,8 +21572,8 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
21263
21572
  const existingStatus = approvalStatuses[requestId];
21264
21573
  const status = existingStatus || event.status;
21265
21574
  const resolvedByName = event.resolvedByName;
21266
- const escalatedData = _optionalChain([escalatedApprovals, 'optionalAccess', _685 => _685.get, 'call', _686 => _686(requestId)]);
21267
- if (_optionalChain([escalatedData, 'optionalAccess', _687 => _687.toolCalls]) && escalatedData.toolCalls.length > 0) {
21575
+ const escalatedData = _optionalChain([escalatedApprovals, 'optionalAccess', _702 => _702.get, 'call', _703 => _703(requestId)]);
21576
+ if (_optionalChain([escalatedData, 'optionalAccess', _704 => _704.toolCalls]) && escalatedData.toolCalls.length > 0) {
21268
21577
  if (batchApprovalsEnabled) {
21269
21578
  accumulator.addApprovalBatch(
21270
21579
  requestId,
@@ -21286,7 +21595,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
21286
21595
  );
21287
21596
  }
21288
21597
  }
21289
- _optionalChain([escalatedApprovals, 'optionalAccess', _688 => _688.delete, 'call', _689 => _689(requestId)]);
21598
+ _optionalChain([escalatedApprovals, 'optionalAccess', _705 => _705.delete, 'call', _706 => _706(requestId)]);
21290
21599
  break;
21291
21600
  }
21292
21601
  if (escalatedData) {
@@ -21295,7 +21604,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
21295
21604
  explanation: escalatedData.explanation,
21296
21605
  approvalType: escalatedData.approvalType
21297
21606
  });
21298
- _optionalChain([escalatedApprovals, 'optionalAccess', _690 => _690.delete, 'call', _691 => _691(requestId)]);
21607
+ _optionalChain([escalatedApprovals, 'optionalAccess', _707 => _707.delete, 'call', _708 => _708(requestId)]);
21299
21608
  }
21300
21609
  const before = accumulator.getSegments();
21301
21610
  const after = accumulator.updateApprovalStatus(requestId, status, resolvedByName);
@@ -21354,6 +21663,8 @@ function processHistoricalMessages(messages, options = {}) {
21354
21663
  let currentAssistantTimestamp = null;
21355
21664
  let lastAssistantId = null;
21356
21665
  let currentAssistantStreamSeq;
21666
+ let currentAssistantSources;
21667
+ let currentAssistantRefs;
21357
21668
  const flushAssistantMessage = () => {
21358
21669
  const idToUse = lastAssistantId || currentAssistantId;
21359
21670
  if (idToUse && accumulator.hasContent()) {
@@ -21366,6 +21677,8 @@ function processHistoricalMessages(messages, options = {}) {
21366
21677
  authorType: assistantType,
21367
21678
  timestamp: currentAssistantTimestamp || /* @__PURE__ */ new Date(),
21368
21679
  avatar: assistantAvatar,
21680
+ ...currentAssistantSources ? { sources: currentAssistantSources } : {},
21681
+ ...currentAssistantRefs ? { refs: currentAssistantRefs } : {},
21369
21682
  ...currentAssistantStreamSeq !== void 0 ? { streamSeq: currentAssistantStreamSeq } : {}
21370
21683
  });
21371
21684
  accumulator.resetSegments();
@@ -21374,6 +21687,8 @@ function processHistoricalMessages(messages, options = {}) {
21374
21687
  currentAssistantTimestamp = null;
21375
21688
  lastAssistantId = null;
21376
21689
  currentAssistantStreamSeq = void 0;
21690
+ currentAssistantSources = void 0;
21691
+ currentAssistantRefs = void 0;
21377
21692
  };
21378
21693
  messages.forEach((msg, index) => {
21379
21694
  if (chatTypeFilter && msg.chatType !== chatTypeFilter) return;
@@ -21384,14 +21699,14 @@ function processHistoricalMessages(messages, options = {}) {
21384
21699
  pushStandaloneMessages(processedMessages, msg, messageDataArray);
21385
21700
  return;
21386
21701
  }
21387
- 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;
21702
+ const isUserMessage = _optionalChain([msg, 'access', _709 => _709.owner, 'optionalAccess', _710 => _710.type]) === OWNER_TYPE.CLIENT || _optionalChain([msg, 'access', _711 => _711.owner, 'optionalAccess', _712 => _712.type]) === OWNER_TYPE.ADMIN;
21388
21703
  if (isUserMessage) {
21389
21704
  flushAssistantMessage();
21390
- const userAuthorType = _optionalChain([msg, 'access', _696 => _696.owner, 'optionalAccess', _697 => _697.type]) === OWNER_TYPE.ADMIN ? "admin" : "user";
21705
+ const userAuthorType = _optionalChain([msg, 'access', _713 => _713.owner, 'optionalAccess', _714 => _714.type]) === OWNER_TYPE.ADMIN ? "admin" : "user";
21391
21706
  messageDataArray.forEach((data) => {
21392
21707
  if (data.type === MESSAGE_TYPE.TEXT && "text" in data && data.text) {
21393
21708
  const rawContext = data.contextItems;
21394
- 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;
21709
+ const contextItems = Array.isArray(rawContext) ? rawContext.filter((c) => typeof _optionalChain([c, 'optionalAccess', _715 => _715.type]) === "string" && typeof _optionalChain([c, 'optionalAccess', _716 => _716.id]) === "string").map((c) => ({ type: c.type, id: c.id, label: c.id })) : void 0;
21395
21710
  processedMessages.push({
21396
21711
  id: msg.id,
21397
21712
  role: "user",
@@ -21417,6 +21732,11 @@ function processHistoricalMessages(messages, options = {}) {
21417
21732
  messageDataArray.forEach((data) => {
21418
21733
  const event = decodeHistoricalMessageData(data);
21419
21734
  if (!event) return;
21735
+ if (event.type === "sources") {
21736
+ currentAssistantSources = mergeChatSources(currentAssistantSources, event.sources);
21737
+ if (event.refs) currentAssistantRefs = mergeChatRefs(currentAssistantRefs, event.refs);
21738
+ return;
21739
+ }
21420
21740
  applyHistoryEvent(
21421
21741
  event,
21422
21742
  accumulator,
@@ -21429,7 +21749,7 @@ function processHistoricalMessages(messages, options = {}) {
21429
21749
  });
21430
21750
  const nextMsg = messages[index + 1];
21431
21751
  const isLastMessage = index === messages.length - 1;
21432
- 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);
21752
+ const nextIsFromUser = nextMsg && (_optionalChain([nextMsg, 'access', _717 => _717.owner, 'optionalAccess', _718 => _718.type]) === OWNER_TYPE.CLIENT || _optionalChain([nextMsg, 'access', _719 => _719.owner, 'optionalAccess', _720 => _720.type]) === OWNER_TYPE.ADMIN);
21433
21753
  if (isLastMessage || nextIsFromUser) {
21434
21754
  flushAssistantMessage();
21435
21755
  }
@@ -21509,13 +21829,17 @@ function mapProcessedToUnified(processed) {
21509
21829
  id: m.id,
21510
21830
  role: m.role,
21511
21831
  content: "",
21512
- segments: m.content
21832
+ segments: m.content,
21833
+ ...m.sources ? { sources: m.sources } : {},
21834
+ ...m.refs ? { refs: m.refs } : {}
21513
21835
  });
21514
21836
  } else {
21515
21837
  out.push({
21516
21838
  id: m.id,
21517
21839
  role: m.role,
21518
- content: m.content
21840
+ content: m.content,
21841
+ ...m.sources ? { sources: m.sources } : {},
21842
+ ...m.refs ? { refs: m.refs } : {}
21519
21843
  });
21520
21844
  }
21521
21845
  }
@@ -21827,7 +22151,7 @@ function useNatsChatAdapter(config, options = {}) {
21827
22151
  }, [active, fetchDialogs, loadDialogsPage]);
21828
22152
  const sendMessage = _react.useCallback.call(void 0,
21829
22153
  async (text, sendOptions) => {
21830
- const hidden = _nullishCoalesce(_optionalChain([sendOptions, 'optionalAccess', _704 => _704.hidden]), () => ( false));
22154
+ const hidden = _nullishCoalesce(_optionalChain([sendOptions, 'optionalAccess', _721 => _721.hidden]), () => ( false));
21831
22155
  mutate((r) => r.pushOptimisticSend(text, hidden));
21832
22156
  await publishUserMessage(text, { hidden, dialogId });
21833
22157
  },
@@ -21973,11 +22297,11 @@ function useNatsChatAdapter(config, options = {}) {
21973
22297
  // Tokens: live `token_usage` frame / dialog snapshot (`dialogTokenUsage`).
21974
22298
  // contextWindow uses the dialog's `contextSize` (the "X / Y" denominator,
21975
22299
  // matching the /mingo page). cacheHitRate/breakdown are SSE-only → null.
21976
- currentProvider: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess', _705 => _705.provider]), () => ( modelProvider)), () => ( null)),
21977
- currentModelLabel: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess', _706 => _706.modelLabel]), () => ( modelLabel)), () => ( null)),
21978
- currentContextWindowMaxTokens: _nullishCoalesce(_nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _707 => _707.contextSize]), () => ( _optionalChain([liveModel, 'optionalAccess', _708 => _708.contextWindowMaxTokens]))), () => ( null)),
21979
- currentInputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _709 => _709.inputTokensSize]), () => ( null)),
21980
- currentOutputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _710 => _710.outputTokensSize]), () => ( null)),
22300
+ currentProvider: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess', _722 => _722.provider]), () => ( modelProvider)), () => ( null)),
22301
+ currentModelLabel: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess', _723 => _723.modelLabel]), () => ( modelLabel)), () => ( null)),
22302
+ currentContextWindowMaxTokens: _nullishCoalesce(_nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _724 => _724.contextSize]), () => ( _optionalChain([liveModel, 'optionalAccess', _725 => _725.contextWindowMaxTokens]))), () => ( null)),
22303
+ currentInputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _726 => _726.inputTokensSize]), () => ( null)),
22304
+ currentOutputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _727 => _727.outputTokensSize]), () => ( null)),
21981
22305
  currentCacheHitRatePct: null,
21982
22306
  currentUsageBreakdown: null,
21983
22307
  // Dialog management
@@ -22078,7 +22402,7 @@ function useUnifiedChat(options) {
22078
22402
  []
22079
22403
  );
22080
22404
  const displayRefForward = _react.useCallback.call(void 0,
22081
- (ref) => _optionalChain([activeStateRef, 'access', _711 => _711.current, 'access', _712 => _712.displayRef, 'optionalCall', _713 => _713(ref)]),
22405
+ (ref) => _optionalChain([activeStateRef, 'access', _728 => _728.current, 'access', _729 => _729.displayRef, 'optionalCall', _730 => _730(ref)]),
22082
22406
  []
22083
22407
  );
22084
22408
  const displayRef = activeState.displayRef ? displayRefForward : void 0;
@@ -22088,7 +22412,7 @@ function useUnifiedChat(options) {
22088
22412
  const renameDialog = _react.useCallback.call(void 0, (id, title) => activeStateRef.current.renameDialog(id, title), []);
22089
22413
  const archiveDialog = _react.useCallback.call(void 0, (id) => activeStateRef.current.archiveDialog(id), []);
22090
22414
  const loadMoreDialogs = _react.useCallback.call(void 0, () => activeStateRef.current.loadMoreDialogs(), []);
22091
- const setDialogScope = _react.useCallback.call(void 0, (scope) => _optionalChain([activeStateRef, 'access', _714 => _714.current, 'access', _715 => _715.setDialogScope, 'optionalCall', _716 => _716(scope)]), []);
22415
+ const setDialogScope = _react.useCallback.call(void 0, (scope) => _optionalChain([activeStateRef, 'access', _731 => _731.current, 'access', _732 => _732.setDialogScope, 'optionalCall', _733 => _733(scope)]), []);
22092
22416
  const reloadDialogs = _react.useCallback.call(void 0, () => activeStateRef.current.reloadDialogs(), []);
22093
22417
  const loadMoreMessages = _react.useCallback.call(void 0, () => activeStateRef.current.loadMoreMessages(), []);
22094
22418
  const approveRequest = _react.useCallback.call(void 0, (requestId) => activeStateRef.current.approveRequest(requestId), []);
@@ -22181,19 +22505,19 @@ function turnRequestKeys(content) {
22181
22505
  if (!Array.isArray(content)) return keys;
22182
22506
  for (const seg of content) {
22183
22507
  if (seg.type === "tool_execution") {
22184
- const id = _optionalChain([seg, 'access', _717 => _717.data, 'optionalAccess', _718 => _718.toolExecutionRequestId]);
22508
+ const id = _optionalChain([seg, 'access', _734 => _734.data, 'optionalAccess', _735 => _735.toolExecutionRequestId]);
22185
22509
  if (id) keys.add(id);
22186
22510
  } else if (seg.type === "approval_request") {
22187
- const id = _optionalChain([seg, 'access', _719 => _719.data, 'optionalAccess', _720 => _720.requestId]);
22511
+ const id = _optionalChain([seg, 'access', _736 => _736.data, 'optionalAccess', _737 => _737.requestId]);
22188
22512
  if (id) keys.add(id);
22189
22513
  } else if (seg.type === "escalation_offer") {
22190
- const id = _optionalChain([seg, 'access', _721 => _721.data, 'optionalAccess', _722 => _722.offerId]);
22514
+ const id = _optionalChain([seg, 'access', _738 => _738.data, 'optionalAccess', _739 => _739.offerId]);
22191
22515
  if (id) keys.add(id);
22192
22516
  } else if (seg.type === "approval_batch") {
22193
22517
  const data = seg.data;
22194
- if (_optionalChain([data, 'optionalAccess', _723 => _723.approvalRequestId])) keys.add(data.approvalRequestId);
22195
- for (const call of _nullishCoalesce(_optionalChain([data, 'optionalAccess', _724 => _724.toolCalls]), () => ( []))) {
22196
- if (_optionalChain([call, 'optionalAccess', _725 => _725.toolExecutionRequestId])) keys.add(call.toolExecutionRequestId);
22518
+ if (_optionalChain([data, 'optionalAccess', _740 => _740.approvalRequestId])) keys.add(data.approvalRequestId);
22519
+ for (const call of _nullishCoalesce(_optionalChain([data, 'optionalAccess', _741 => _741.toolCalls]), () => ( []))) {
22520
+ if (_optionalChain([call, 'optionalAccess', _742 => _742.toolExecutionRequestId])) keys.add(call.toolExecutionRequestId);
22197
22521
  }
22198
22522
  }
22199
22523
  }
@@ -22245,18 +22569,18 @@ function mergeHistoryWithRealtime(input) {
22245
22569
  }
22246
22570
  }
22247
22571
  const trailing = processedHistory[processedHistory.length - 1];
22248
- const historyTrailingAssistant = _optionalChain([trailing, 'optionalAccess', _726 => _726.role]) === "assistant" ? trailing : null;
22249
- 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;
22572
+ const historyTrailingAssistant = _optionalChain([trailing, 'optionalAccess', _743 => _743.role]) === "assistant" ? trailing : null;
22573
+ const historyBatchId = historyTrailingAssistant && Array.isArray(historyTrailingAssistant.content) ? _nullishCoalesce(_optionalChain([historyTrailingAssistant, 'access', _744 => _744.content, 'access', _745 => _745.find, 'call', _746 => _746((s) => s.type === "approval_batch"), 'optionalAccess', _747 => _747.data, 'optionalAccess', _748 => _748.approvalRequestId]), () => ( null)) : null;
22250
22574
  let processedToUse = processedHistory;
22251
22575
  const pinnedSyntheticIds = /* @__PURE__ */ new Set();
22252
22576
  const droppedSyntheticIds = /* @__PURE__ */ new Set();
22253
22577
  if (historyBatchId) {
22254
22578
  const batchTwins = existingMessages.filter(
22255
- (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)
22579
+ (m) => m.role === "assistant" && Array.isArray(m.content) && m.content.some((s) => s.type === "approval_batch" && _optionalChain([s, 'access', _749 => _749.data, 'optionalAccess', _750 => _750.approvalRequestId]) === historyBatchId)
22256
22580
  );
22257
22581
  const existingWithSameBatch = _nullishCoalesce(batchTwins.find((m) => m.id === streamingMessageId), () => ( batchTwins[batchTwins.length - 1]));
22258
22582
  if (existingWithSameBatch && Array.isArray(existingWithSameBatch.content)) {
22259
- const histSize = Array.isArray(_optionalChain([historyTrailingAssistant, 'optionalAccess', _734 => _734.content])) ? historyTrailingAssistant.content.length : 0;
22583
+ const histSize = Array.isArray(_optionalChain([historyTrailingAssistant, 'optionalAccess', _751 => _751.content])) ? historyTrailingAssistant.content.length : 0;
22260
22584
  const realtimeSize = existingWithSameBatch.content.length;
22261
22585
  if (existingWithSameBatch.id === streamingMessageId || realtimeSize > histSize) {
22262
22586
  processedToUse = processedHistory.slice(0, -1);
@@ -22298,9 +22622,9 @@ function mergeHistoryWithRealtime(input) {
22298
22622
  if (pinnedSyntheticIds.has(m.id)) return true;
22299
22623
  if (droppedSyntheticIds.has(m.id)) return false;
22300
22624
  if (processedIds.has(m.id)) return false;
22301
- if (_optionalChain([rawHistoryIds, 'optionalAccess', _735 => _735.has, 'call', _736 => _736(m.id)])) return false;
22625
+ if (_optionalChain([rawHistoryIds, 'optionalAccess', _752 => _752.has, 'call', _753 => _753(m.id)])) return false;
22302
22626
  if (m.role === "user" && m.id.startsWith("optimistic-") && typeof m.content === "string") {
22303
- const canBeInSnapshot = (_nullishCoalesce(_optionalChain([m, 'access', _737 => _737.timestamp, 'optionalAccess', _738 => _738.getTime, 'call', _739 => _739()]), () => ( 0))) <= historyFetchedAt;
22627
+ const canBeInSnapshot = (_nullishCoalesce(_optionalChain([m, 'access', _754 => _754.timestamp, 'optionalAccess', _755 => _755.getTime, 'call', _756 => _756()]), () => ( 0))) <= historyFetchedAt;
22304
22628
  return !(canBeInSnapshot && processedToUse.some((pm) => pm.role === "user" && pm.content === m.content));
22305
22629
  }
22306
22630
  if (isSyntheticRealtimeId(m.id) && m.id !== streamingMessageId) {
@@ -22324,7 +22648,7 @@ function mergeHistoryWithRealtime(input) {
22324
22648
  } else if (typeof m.streamSeq === "number") {
22325
22649
  covered = historyMaxStreamSeq > 0 && historyMaxStreamSeq >= m.streamSeq;
22326
22650
  } else {
22327
- covered = historyCoversRealtime !== null ? historyCoversRealtime : (_nullishCoalesce(_optionalChain([m, 'access', _740 => _740.timestamp, 'optionalAccess', _741 => _741.getTime, 'call', _742 => _742()]), () => ( 0))) <= historyFetchedAt;
22651
+ covered = historyCoversRealtime !== null ? historyCoversRealtime : (_nullishCoalesce(_optionalChain([m, 'access', _757 => _757.timestamp, 'optionalAccess', _758 => _758.getTime, 'call', _759 => _759()]), () => ( 0))) <= historyFetchedAt;
22328
22652
  }
22329
22653
  if (covered) return false;
22330
22654
  }
@@ -22394,7 +22718,7 @@ function normalizeHistoricalMessageData(md) {
22394
22718
  function isHistoricalUserTurn(m) {
22395
22719
  return !!m.owner;
22396
22720
  }
22397
- var isTextSegment = (d) => _optionalChain([d, 'optionalAccess', _743 => _743.type]) === "TEXT" && typeof d.text === "string";
22721
+ var isTextSegment = (d) => _optionalChain([d, 'optionalAccess', _760 => _760.type]) === "TEXT" && typeof d.text === "string";
22398
22722
  var THINK_MS = 550;
22399
22723
  var TOKEN_MS = 55;
22400
22724
  var USER_MS = 480;
@@ -22579,7 +22903,7 @@ function useResizableSize({ enabled, isHorizontal, minSize, maxSize, defaultSize
22579
22903
  const parsed = parseFloat(raw);
22580
22904
  if (!Number.isFinite(parsed)) return clampToViewport(defaultSize);
22581
22905
  return clampToViewport(parsed);
22582
- } catch (e64) {
22906
+ } catch (e66) {
22583
22907
  return clampToViewport(defaultSize);
22584
22908
  }
22585
22909
  }, [enabled, storageKey, defaultSize, clampToViewport]);
@@ -22589,7 +22913,7 @@ function useResizableSize({ enabled, isHorizontal, minSize, maxSize, defaultSize
22589
22913
  if (!enabled || !storageKey || typeof window === "undefined") return;
22590
22914
  try {
22591
22915
  window.localStorage.setItem(storageKey, String(Math.round(size2)));
22592
- } catch (e65) {
22916
+ } catch (e67) {
22593
22917
  }
22594
22918
  }, [enabled, size2, storageKey]);
22595
22919
  _react.useEffect.call(void 0, () => {
@@ -22623,7 +22947,7 @@ function DrawerResizeHandle({ side, size: size2, minSize, maxSize, onSize, ariaL
22623
22947
  startRef.current = null;
22624
22948
  try {
22625
22949
  e.currentTarget.releasePointerCapture(e.pointerId);
22626
- } catch (e66) {
22950
+ } catch (e68) {
22627
22951
  }
22628
22952
  document.body.style.cursor = "";
22629
22953
  document.body.style.userSelect = "";
@@ -22813,6 +23137,7 @@ function HoverDropdown({
22813
23137
  }) {
22814
23138
  const [open, setOpen] = _react.useState.call(void 0, false);
22815
23139
  const timeoutRef = _react.useRef.call(void 0, void 0);
23140
+ const clickPinnedRef = _react.useRef.call(void 0, false);
22816
23141
  const containerRef = _react.useRef.call(void 0, null);
22817
23142
  const panelRef = _react.useRef.call(void 0, null);
22818
23143
  _chunkZI27ALYXcjs.useIsomorphicLayoutEffect.call(void 0, () => {
@@ -22847,12 +23172,15 @@ function HoverDropdown({
22847
23172
  setOpen(true);
22848
23173
  }, []);
22849
23174
  const hide = _react.useCallback.call(void 0, () => {
23175
+ if (clickPinnedRef.current) return;
22850
23176
  timeoutRef.current = setTimeout(() => setOpen(false), hideDelay);
22851
23177
  }, [hideDelay]);
22852
23178
  const toggle = _react.useCallback.call(void 0, (e) => {
22853
23179
  e.stopPropagation();
22854
23180
  clearTimeout(timeoutRef.current);
22855
- setOpen((prev) => !prev);
23181
+ const pinned = !clickPinnedRef.current;
23182
+ clickPinnedRef.current = pinned;
23183
+ setOpen(pinned);
22856
23184
  }, []);
22857
23185
  if (items.length === 0) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children });
22858
23186
  const renderAnchorFn = _nullishCoalesce(renderAnchor, () => ( DefaultAnchor));
@@ -23018,7 +23346,7 @@ function useChatDialogManager({
23018
23346
  const handleConfirmRestore = _react.useCallback.call(void 0, async () => {
23019
23347
  if (restoreTarget) {
23020
23348
  try {
23021
- await _optionalChain([unarchiveDialog, 'optionalCall', _744 => _744(restoreTarget.id)]);
23349
+ await _optionalChain([unarchiveDialog, 'optionalCall', _761 => _761(restoreTarget.id)]);
23022
23350
  } catch (err) {
23023
23351
  console.error("[useChatDialogManager] unarchive failed:", err);
23024
23352
  return;
@@ -23329,21 +23657,34 @@ function SourceChips({
23329
23657
  }) {
23330
23658
  const [expanded, setExpanded] = _react.useState.call(void 0, false);
23331
23659
  if (cited.length === 0) {
23332
- const fallback = uncited.slice(0, FALLBACK_TOP_RETRIEVED);
23333
- if (fallback.length === 0) return null;
23660
+ const visible = expanded ? uncited : uncited.slice(0, FALLBACK_TOP_RETRIEVED);
23661
+ const hiddenCount2 = Math.max(0, uncited.length - FALLBACK_TOP_RETRIEVED);
23662
+ if (visible.length === 0) return null;
23334
23663
  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: [
23335
23664
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "uppercase text-ods-text-muted text-h6", children: "Top retrieved sources" }),
23336
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-wrap gap-1.5", children: fallback.map((src) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
23337
- SourceChip,
23338
- {
23339
- src,
23340
- baseRoute,
23341
- chipBasePlatform,
23342
- onClose,
23343
- onDiscuss
23344
- },
23345
- src.index
23346
- )) })
23665
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `flex flex-wrap gap-1.5 ${expanded ? "max-h-[200px] overflow-y-auto overscroll-contain" : ""}`, children: [
23666
+ visible.map((src) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
23667
+ SourceChip,
23668
+ {
23669
+ src,
23670
+ baseRoute,
23671
+ chipBasePlatform,
23672
+ onClose,
23673
+ onDiscuss
23674
+ },
23675
+ src.index
23676
+ )),
23677
+ hiddenCount2 > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
23678
+ "button",
23679
+ {
23680
+ onClick: () => setExpanded(!expanded),
23681
+ 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",
23682
+ "aria-expanded": expanded,
23683
+ "aria-label": expanded ? "Show fewer sources" : `Show ${hiddenCount2} additional retrieved sources`,
23684
+ children: expanded ? "Show less" : `+${hiddenCount2} more retrieved ${hiddenCount2 === 1 ? "source" : "sources"}`
23685
+ }
23686
+ )
23687
+ ] })
23347
23688
  ] });
23348
23689
  }
23349
23690
  const hiddenCount = uncited.length;
@@ -23498,7 +23839,7 @@ function EmbeddableChatInner({
23498
23839
  }),
23499
23840
  [commandsUrl]
23500
23841
  );
23501
- 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;
23842
+ const headerUserName = _optionalChain([identityUser, 'optionalAccess', _762 => _762.name, 'optionalAccess', _763 => _763.trim, 'call', _764 => _764()]) || [_optionalChain([identityUser, 'optionalAccess', _765 => _765.firstName]), _optionalChain([identityUser, 'optionalAccess', _766 => _766.lastName])].filter(Boolean).join(" ").trim() || _optionalChain([userDisplayName, 'optionalAccess', _767 => _767.trim, 'call', _768 => _768()]) || void 0;
23502
23843
  const effectiveModes = _react.useMemo.call(void 0, () => {
23503
23844
  if (modes) return modes;
23504
23845
  const guideOptions = tableIdForDocumentType ? { tableIdForDocumentType } : {};
@@ -23507,20 +23848,20 @@ function EmbeddableChatInner({
23507
23848
  const mingoCaps = _react.useMemo.call(void 0, () => {
23508
23849
  if (mingoState) {
23509
23850
  return {
23510
- canRename: _nullishCoalesce(_optionalChain([mingoDialogCapabilities, 'optionalAccess', _752 => _752.canRename]), () => ( false)),
23511
- canArchive: _nullishCoalesce(_optionalChain([mingoDialogCapabilities, 'optionalAccess', _753 => _753.canArchive]), () => ( false)),
23512
- fetchArchivedDialogs: _optionalChain([mingoDialogCapabilities, 'optionalAccess', _754 => _754.fetchArchivedDialogs]),
23513
- unarchiveDialog: _optionalChain([mingoDialogCapabilities, 'optionalAccess', _755 => _755.unarchiveDialog]),
23514
- searchQuery: _optionalChain([mingoDialogCapabilities, 'optionalAccess', _756 => _756.searchQuery]),
23515
- onSearchChange: _optionalChain([mingoDialogCapabilities, 'optionalAccess', _757 => _757.onSearchChange]),
23516
- onCopyLink: _optionalChain([mingoDialogCapabilities, 'optionalAccess', _758 => _758.onCopyLink])
23851
+ canRename: _nullishCoalesce(_optionalChain([mingoDialogCapabilities, 'optionalAccess', _769 => _769.canRename]), () => ( false)),
23852
+ canArchive: _nullishCoalesce(_optionalChain([mingoDialogCapabilities, 'optionalAccess', _770 => _770.canArchive]), () => ( false)),
23853
+ fetchArchivedDialogs: _optionalChain([mingoDialogCapabilities, 'optionalAccess', _771 => _771.fetchArchivedDialogs]),
23854
+ unarchiveDialog: _optionalChain([mingoDialogCapabilities, 'optionalAccess', _772 => _772.unarchiveDialog]),
23855
+ searchQuery: _optionalChain([mingoDialogCapabilities, 'optionalAccess', _773 => _773.searchQuery]),
23856
+ onSearchChange: _optionalChain([mingoDialogCapabilities, 'optionalAccess', _774 => _774.onSearchChange]),
23857
+ onCopyLink: _optionalChain([mingoDialogCapabilities, 'optionalAccess', _775 => _775.onCopyLink])
23517
23858
  };
23518
23859
  }
23519
23860
  return {
23520
- canRename: !!_optionalChain([effectiveModes, 'access', _759 => _759.mingo, 'optionalAccess', _760 => _760.renameDialog]),
23521
- canArchive: !!_optionalChain([effectiveModes, 'access', _761 => _761.mingo, 'optionalAccess', _762 => _762.archiveDialog]),
23522
- fetchArchivedDialogs: _optionalChain([effectiveModes, 'access', _763 => _763.mingo, 'optionalAccess', _764 => _764.fetchArchivedDialogs]),
23523
- unarchiveDialog: _optionalChain([effectiveModes, 'access', _765 => _765.mingo, 'optionalAccess', _766 => _766.unarchiveDialog]),
23861
+ canRename: !!_optionalChain([effectiveModes, 'access', _776 => _776.mingo, 'optionalAccess', _777 => _777.renameDialog]),
23862
+ canArchive: !!_optionalChain([effectiveModes, 'access', _778 => _778.mingo, 'optionalAccess', _779 => _779.archiveDialog]),
23863
+ fetchArchivedDialogs: _optionalChain([effectiveModes, 'access', _780 => _780.mingo, 'optionalAccess', _781 => _781.fetchArchivedDialogs]),
23864
+ unarchiveDialog: _optionalChain([effectiveModes, 'access', _782 => _782.mingo, 'optionalAccess', _783 => _783.unarchiveDialog]),
23524
23865
  searchQuery: void 0,
23525
23866
  onSearchChange: void 0,
23526
23867
  onCopyLink: void 0
@@ -23535,7 +23876,7 @@ function EmbeddableChatInner({
23535
23876
  if (controlledActiveMode === void 0) {
23536
23877
  setUncontrolledActiveMode(next);
23537
23878
  }
23538
- _optionalChain([onActiveModeChange, 'optionalCall', _767 => _767(next)]);
23879
+ _optionalChain([onActiveModeChange, 'optionalCall', _784 => _784(next)]);
23539
23880
  },
23540
23881
  [controlledActiveMode, onActiveModeChange]
23541
23882
  );
@@ -23562,7 +23903,7 @@ function EmbeddableChatInner({
23562
23903
  );
23563
23904
  const effectiveAssistantName = emptyStateConfig.name;
23564
23905
  const effectiveAssistantIcon = emptyStateConfig.icon;
23565
- const headerAssistantName = _nullishCoalesce(effectiveAssistantName, () => ( (typeof _optionalChain([guideWelcome, 'optionalAccess', _768 => _768.title]) === "string" ? guideWelcome.title : null)));
23906
+ const headerAssistantName = _nullishCoalesce(effectiveAssistantName, () => ( (typeof _optionalChain([guideWelcome, 'optionalAccess', _785 => _785.title]) === "string" ? guideWelcome.title : null)));
23566
23907
  const {
23567
23908
  messages: rawMessages,
23568
23909
  isLoading: chatLoading,
@@ -23606,7 +23947,7 @@ function EmbeddableChatInner({
23606
23947
  void sendMessage(guidePendingPrompt).catch((err) => {
23607
23948
  console.error("[EmbeddableChat] guide launcher prompt failed:", err);
23608
23949
  });
23609
- _optionalChain([onGuidePromptConsumed, 'optionalCall', _769 => _769()]);
23950
+ _optionalChain([onGuidePromptConsumed, 'optionalCall', _786 => _786()]);
23610
23951
  }, [guidePendingPrompt, activeMode, sendMessage, onGuidePromptConsumed]);
23611
23952
  const {
23612
23953
  attachments: stagedAttachments,
@@ -23617,7 +23958,7 @@ function EmbeddableChatInner({
23617
23958
  clear: clearAttachments
23618
23959
  } = useChatAttachments();
23619
23960
  const { panelRef: galleryPanelRef, modal: galleryModal } = useChatAttachmentImageGallery();
23620
- const contextMaxItems = _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess', _770 => _770.maxItems]), () => ( 10));
23961
+ const contextMaxItems = _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess', _787 => _787.maxItems]), () => ( 10));
23621
23962
  const contextPickerForMode = activeMode === "mingo" ? contextPicker : void 0;
23622
23963
  const [contextItems, setContextItems] = _react.useState.call(void 0, NO_CONTEXT_ITEMS);
23623
23964
  const [contextPickerOpen, setContextPickerOpen] = _react.useState.call(void 0, false);
@@ -23638,10 +23979,10 @@ function EmbeddableChatInner({
23638
23979
  }, [activeDialogId, activeMode]);
23639
23980
  const mentionMarkerByType = _react.useMemo.call(void 0, () => {
23640
23981
  const m = /* @__PURE__ */ new Map();
23641
- for (const t of _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess', _771 => _771.entityTypes]), () => ( []))) if (t.marker) m.set(t.type, t.marker);
23982
+ for (const t of _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess', _788 => _788.entityTypes]), () => ( []))) if (t.marker) m.set(t.type, t.marker);
23642
23983
  return m;
23643
- }, [_optionalChain([contextPicker, 'optionalAccess', _772 => _772.entityTypes])]);
23644
- const contextEntityTypes = _optionalChain([contextPicker, 'optionalAccess', _773 => _773.entityTypes]);
23984
+ }, [_optionalChain([contextPicker, 'optionalAccess', _789 => _789.entityTypes])]);
23985
+ const contextEntityTypes = _optionalChain([contextPicker, 'optionalAccess', _790 => _790.entityTypes]);
23645
23986
  const resolveContextIcon = _react.useMemo.call(void 0, () => {
23646
23987
  const byType = /* @__PURE__ */ new Map();
23647
23988
  for (const t of _nullishCoalesce(contextEntityTypes, () => ( []))) byType.set(t.type, t.icon);
@@ -23653,7 +23994,7 @@ function EmbeddableChatInner({
23653
23994
  if (mentionActiveRef.current) {
23654
23995
  if (contextItems.some((p) => `${p.type}:${p.id}` === key)) return;
23655
23996
  if (contextItems.length >= contextMaxItems) return;
23656
- _optionalChain([chatInputRef, 'access', _774 => _774.current, 'optionalAccess', _775 => _775.commitMention, 'call', _776 => _776(mentionTokenOf(key, mentionMarkerByType), {
23997
+ _optionalChain([chatInputRef, 'access', _791 => _791.current, 'optionalAccess', _792 => _792.commitMention, 'call', _793 => _793(mentionTokenOf(key, mentionMarkerByType), {
23657
23998
  label: item.label,
23658
23999
  icon: resolveContextIcon(item)
23659
24000
  })]);
@@ -23676,9 +24017,9 @@ function EmbeddableChatInner({
23676
24017
  setContextItems((prev) => prev.filter((p) => `${p.type}:${p.id}` !== key));
23677
24018
  if (mentionKeysRef.current.has(key)) {
23678
24019
  mentionKeysRef.current.delete(key);
23679
- const cur = _nullishCoalesce(_optionalChain([chatInputRef, 'access', _777 => _777.current, 'optionalAccess', _778 => _778.getValue, 'call', _779 => _779()]), () => ( ""));
24020
+ const cur = _nullishCoalesce(_optionalChain([chatInputRef, 'access', _794 => _794.current, 'optionalAccess', _795 => _795.getValue, 'call', _796 => _796()]), () => ( ""));
23680
24021
  const next = cur.replace(`@${mentionTokenOf(key, mentionMarkerByType)}`, "").replace(/\s{2,}/g, " ").trimStart();
23681
- _optionalChain([chatInputRef, 'access', _780 => _780.current, 'optionalAccess', _781 => _781.setValue, 'call', _782 => _782(next)]);
24022
+ _optionalChain([chatInputRef, 'access', _797 => _797.current, 'optionalAccess', _798 => _798.setValue, 'call', _799 => _799(next)]);
23682
24023
  }
23683
24024
  },
23684
24025
  [mentionMarkerByType]
@@ -23700,7 +24041,7 @@ function EmbeddableChatInner({
23700
24041
  }, []);
23701
24042
  const closeContextPicker = _react.useCallback.call(void 0, () => {
23702
24043
  if (mentionActiveRef.current) {
23703
- _optionalChain([chatInputRef, 'access', _783 => _783.current, 'optionalAccess', _784 => _784.removeMentionTrigger, 'call', _785 => _785()]);
24044
+ _optionalChain([chatInputRef, 'access', _800 => _800.current, 'optionalAccess', _801 => _801.removeMentionTrigger, 'call', _802 => _802()]);
23704
24045
  }
23705
24046
  setContextPickerOpen(false);
23706
24047
  setMentionQuery(null);
@@ -23734,8 +24075,8 @@ function EmbeddableChatInner({
23734
24075
  [effectiveAssistantIcon]
23735
24076
  );
23736
24077
  const [timestampCache] = _react.useState.call(void 0, () => /* @__PURE__ */ new Map());
23737
- 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;
23738
- const guideUserAvatar = activeMode === "guide" ? _optionalChain([identityUser, 'optionalAccess', _791 => _791.avatarUrl, 'optionalAccess', _792 => _792.trim, 'call', _793 => _793()]) || void 0 : void 0;
24078
+ const guideUserName = activeMode === "guide" ? [_optionalChain([identityUser, 'optionalAccess', _803 => _803.firstName]), _optionalChain([identityUser, 'optionalAccess', _804 => _804.lastName])].filter(Boolean).join(" ").trim() || _optionalChain([identityUser, 'optionalAccess', _805 => _805.name, 'optionalAccess', _806 => _806.trim, 'call', _807 => _807()]) || void 0 : void 0;
24079
+ const guideUserAvatar = activeMode === "guide" ? _optionalChain([identityUser, 'optionalAccess', _808 => _808.avatarUrl, 'optionalAccess', _809 => _809.trim, 'call', _810 => _810()]) || void 0 : void 0;
23739
24080
  const messages = _react.useMemo.call(void 0, () => {
23740
24081
  const cache = timestampCache;
23741
24082
  const seenIds = /* @__PURE__ */ new Set();
@@ -23770,6 +24111,10 @@ function EmbeddableChatInner({
23770
24111
  // explicitly — see `Message.hidden` and `chat-message-list`'s skip.
23771
24112
  ...m.hidden ? { hidden: true } : {},
23772
24113
  ...m.scrollAnchor ? { scrollAnchor: m.scrollAnchor } : {},
24114
+ // Preserve same-turn rich metadata. Source chips and entity-card
24115
+ // renderers consume it after this raw-to-Message projection.
24116
+ ...m.sources && m.sources.length > 0 ? { sources: m.sources } : {},
24117
+ ...m.refs && m.refs.length > 0 ? { refs: m.refs } : {},
23773
24118
  // Forward attached context items so the user bubble renders its chips.
23774
24119
  ...m.contextItems && m.contextItems.length > 0 ? { contextItems: m.contextItems } : {}
23775
24120
  };
@@ -23921,21 +24266,32 @@ function EmbeddableChatInner({
23921
24266
  });
23922
24267
  return out;
23923
24268
  }, [commandsById, enabledSet]);
23924
- const lastAssistantMsg = [...rawMessages].reverse().find((m) => m.role === "assistant");
23925
- const lastSources = _react.useMemo.call(void 0, () => {
23926
- if (chatLoading) return void 0;
23927
- const sources = _optionalChain([lastAssistantMsg, 'optionalAccess', _794 => _794.sources]);
23928
- if (!sources || sources.length === 0) return void 0;
23929
- const content = _optionalChain([lastAssistantMsg, 'optionalAccess', _795 => _795.content]) || "";
23930
- const citationOrder = [...content.matchAll(/\[(\d+)\]/g)].map((m) => parseInt(m[1], 10));
23931
- const seenOrder = /* @__PURE__ */ new Map();
23932
- citationOrder.forEach((idx) => {
23933
- if (!seenOrder.has(idx)) seenOrder.set(idx, seenOrder.size);
23934
- });
23935
- const cited = sources.filter((s) => seenOrder.has(s.index)).sort((a, b) => (_nullishCoalesce(seenOrder.get(a.index), () => ( 0))) - (_nullishCoalesce(seenOrder.get(b.index), () => ( 0))));
23936
- const uncited = sources.filter((s) => !seenOrder.has(s.index));
23937
- return { cited, uncited };
23938
- }, [lastAssistantMsg, chatLoading]);
24269
+ const renderSourcesAfterMessage = _react.useCallback.call(void 0,
24270
+ (message, index) => {
24271
+ if (message.role !== "assistant" || !_optionalChain([message, 'access', _811 => _811.sources, 'optionalAccess', _812 => _812.length])) return null;
24272
+ if (chatLoading && index === messages.length - 1) return null;
24273
+ const content = typeof message.content === "string" ? message.content : message.content.filter((segment) => segment.type === "text").map((segment) => segment.text).join("\n");
24274
+ const citationOrder = [...content.matchAll(/\[(\d+)\]/g)].map((m) => parseInt(m[1], 10));
24275
+ const seenOrder = /* @__PURE__ */ new Map();
24276
+ citationOrder.forEach((idx) => {
24277
+ if (!seenOrder.has(idx)) seenOrder.set(idx, seenOrder.size);
24278
+ });
24279
+ const cited = message.sources.filter((s) => seenOrder.has(s.index)).sort((a, b) => (_nullishCoalesce(seenOrder.get(a.index), () => ( 0))) - (_nullishCoalesce(seenOrder.get(b.index), () => ( 0))));
24280
+ const uncited = message.sources.filter((s) => !seenOrder.has(s.index));
24281
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-shrink-0 pb-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
24282
+ SourceChips,
24283
+ {
24284
+ cited,
24285
+ uncited,
24286
+ baseRoute: resolvedBaseRoute,
24287
+ chipBasePlatform,
24288
+ onClose: handleNavigationClose,
24289
+ onDiscuss: discussRef
24290
+ }
24291
+ ) });
24292
+ },
24293
+ [chatLoading, messages.length, resolvedBaseRoute, chipBasePlatform, handleNavigationClose, discussRef]
24294
+ );
23939
24295
  const [portalHost, setPortalHost] = _react.useState.call(void 0, null);
23940
24296
  const [panelBoundary, setPanelBoundary] = _react.useState.call(void 0, null);
23941
24297
  const [panelWidth, setPanelWidth] = _react.useState.call(void 0, 0);
@@ -23944,7 +24300,7 @@ function EmbeddableChatInner({
23944
24300
  const el = panelMeasureRef.current;
23945
24301
  if (!el || typeof ResizeObserver === "undefined") return void 0;
23946
24302
  const ro = new ResizeObserver((entries) => {
23947
- const w = _optionalChain([entries, 'access', _796 => _796[0], 'optionalAccess', _797 => _797.contentRect, 'optionalAccess', _798 => _798.width]);
24303
+ const w = _optionalChain([entries, 'access', _813 => _813[0], 'optionalAccess', _814 => _814.contentRect, 'optionalAccess', _815 => _815.width]);
23948
24304
  if (typeof w === "number") setPanelWidth(w);
23949
24305
  });
23950
24306
  ro.observe(el);
@@ -23962,7 +24318,7 @@ function EmbeddableChatInner({
23962
24318
  setRailStorageRead(true);
23963
24319
  try {
23964
24320
  if (window.localStorage.getItem(RAIL_COLLAPSED_STORAGE_KEY) === "1") setRailCollapsed(true);
23965
- } catch (e67) {
24321
+ } catch (e69) {
23966
24322
  }
23967
24323
  }
23968
24324
  const toggleRailCollapsed = _react.useCallback.call(void 0, () => {
@@ -23970,7 +24326,7 @@ function EmbeddableChatInner({
23970
24326
  const next = !prev;
23971
24327
  try {
23972
24328
  window.localStorage.setItem(RAIL_COLLAPSED_STORAGE_KEY, next ? "1" : "0");
23973
- } catch (e68) {
24329
+ } catch (e70) {
23974
24330
  }
23975
24331
  return next;
23976
24332
  });
@@ -23987,17 +24343,17 @@ function EmbeddableChatInner({
23987
24343
  const isMingoMode = activeMode === "mingo";
23988
24344
  const stackedListView = isMingoMode && !hasConversation && !archiveOpen && !wideMingo && !composeOpen;
23989
24345
  const headerShowBack = hasConversation || guideCanReturnToMingo;
23990
- const headerTitle = hasConversation ? _optionalChain([activeDialog, 'optionalAccess', _799 => _799.title]) || "New Chat" : isGuideEmpty ? _nullishCoalesce(headerAssistantName, () => ( "Mingo Guide")) : "Current Chats";
24346
+ const headerTitle = hasConversation ? _optionalChain([activeDialog, 'optionalAccess', _816 => _816.title]) || "New Chat" : isGuideEmpty ? _nullishCoalesce(headerAssistantName, () => ( "Mingo Guide")) : "Current Chats";
23991
24347
  const headerBackAriaLabel = hasConversation ? isViewingArchived ? "Back to archive" : "Back" : "Back to Mingo";
23992
24348
  const headerOnBack = hasConversation ? handleBack : () => handleActiveModeChange("mingo");
23993
24349
  const headerOnRestore = isViewingArchived && unarchiveDialog && activeDialog ? () => setRestoreTarget(activeDialog) : void 0;
23994
24350
  const headerOnRename = activeDialogId && activeDialog && mingoCaps.canRename ? () => setRenameTarget(activeDialog) : void 0;
23995
24351
  const headerOnArchive = activeDialogId && activeDialog && mingoCaps.canArchive ? () => setArchiveTarget(activeDialog) : void 0;
23996
- const headerOnCopyLink = activeDialogId && activeDialog && mingoCaps.onCopyLink ? () => _optionalChain([mingoCaps, 'access', _800 => _800.onCopyLink, 'optionalCall', _801 => _801(activeDialog)]) : void 0;
24352
+ const headerOnCopyLink = activeDialogId && activeDialog && mingoCaps.onCopyLink ? () => _optionalChain([mingoCaps, 'access', _817 => _817.onCopyLink, 'optionalCall', _818 => _818(activeDialog)]) : void 0;
23997
24353
  const headerOnOpenArchive = fetchArchivedDialogs ? openArchive : void 0;
23998
- const headerOwner = hasConversation ? _optionalChain([activeDialog, 'optionalAccess', _802 => _802.owner]) : void 0;
23999
- const headerPersonName = _optionalChain([headerOwner, 'optionalAccess', _803 => _803.name, 'optionalAccess', _804 => _804.trim, 'call', _805 => _805()]) || headerUserName;
24000
- 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;
24354
+ const headerOwner = hasConversation ? _optionalChain([activeDialog, 'optionalAccess', _819 => _819.owner]) : void 0;
24355
+ const headerPersonName = _optionalChain([headerOwner, 'optionalAccess', _820 => _820.name, 'optionalAccess', _821 => _821.trim, 'call', _822 => _822()]) || headerUserName;
24356
+ const headerPersonAvatarUrl = headerOwner ? _optionalChain([headerOwner, 'access', _823 => _823.avatarUrl, 'optionalAccess', _824 => _824.trim, 'call', _825 => _825()]) || void 0 : _optionalChain([identityUser, 'optionalAccess', _826 => _826.avatarUrl, 'optionalAccess', _827 => _827.trim, 'call', _828 => _828()]) || _optionalChain([userAvatarUrl, 'optionalAccess', _829 => _829.trim, 'call', _830 => _830()]) || void 0;
24001
24357
  const headerAvatar = headerPersonName || headerPersonAvatarUrl ? { name: headerPersonName, avatarUrl: headerPersonAvatarUrl } : void 0;
24002
24358
  const handleNewChat = _react.useCallback.call(void 0, () => {
24003
24359
  resetToNewChat();
@@ -24252,56 +24608,44 @@ function EmbeddableChatInner({
24252
24608
  "div",
24253
24609
  {
24254
24610
  className: "flex min-h-0 flex-1 flex-col duration-200 animate-in fade-in-0",
24255
- children: hasConversation ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-h-0 flex-1 flex-col", children: [
24256
- messagesInitialLoading ? (
24257
- // Match the real list's `fullWidth` layout so swapping
24258
- // skeleton → bubbles doesn't shift the column. The panel
24259
- // wrapper above already pads (`p-[var(--spacing-system-m)]`),
24260
- // so the skeleton sits flush (no inner px/pb).
24261
- //
24262
- // In `previewMode` the chat lives in a fixed-height host box
24263
- // (e.g. the Mingo hero demo). The default bottom-anchored
24264
- // skeleton overflows a short panel and grows its OWN
24265
- // scrollbar — ugly. `fill` top-anchors + clips overflow so
24266
- // it reads as "the whole panel is loading" and never scrolls.
24267
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChatMessageListSkeleton, { fullWidth: true, fill: previewMode, className: "flex-1" })
24268
- ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
24269
- ChatMessageList,
24270
- {
24271
- messages,
24272
- isTyping: chatLoading,
24273
- pendingApprovals,
24274
- autoScroll: !previewMode,
24275
- pinBottom: previewMode,
24276
- overscrollContain: !previewMode,
24277
- assistantType: "mingo",
24278
- assistantIcon: mingoAssistantIcon,
24279
- renderEntityCard,
24280
- resolveContextIcon,
24281
- renderContextItem,
24282
- renderMention,
24283
- onAskSelect: chatLoading || previewMode ? void 0 : handleAskSelect,
24284
- NavLinkAnchor: NavLinkAnchorViaRuntime,
24285
- className: previewMode ? "pointer-events-auto flex-1" : "flex-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
24286
- contentClassName: "max-w-none pb-0",
24287
- fullWidth: true,
24288
- hasNextPage: hasMoreMessages,
24289
- isFetchingNextPage: isMessagesLoading,
24290
- onLoadMore: loadMoreMessages
24291
- }
24292
- ),
24293
- 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,
24294
- SourceChips,
24295
- {
24296
- cited: lastSources.cited,
24297
- uncited: lastSources.uncited,
24298
- baseRoute: resolvedBaseRoute,
24299
- chipBasePlatform,
24300
- onClose: handleNavigationClose,
24301
- onDiscuss: discussRef
24302
- }
24303
- ) })
24304
- ] }) : activeMode === "mingo" ? (
24611
+ children: hasConversation ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex min-h-0 flex-1 flex-col", children: messagesInitialLoading ? (
24612
+ // Match the real list's `fullWidth` layout so swapping
24613
+ // skeleton → bubbles doesn't shift the column. The panel
24614
+ // wrapper above already pads (`p-[var(--spacing-system-m)]`),
24615
+ // so the skeleton sits flush (no inner px/pb).
24616
+ //
24617
+ // In `previewMode` the chat lives in a fixed-height host box
24618
+ // (e.g. the Mingo hero demo). The default bottom-anchored
24619
+ // skeleton overflows a short panel and grows its OWN
24620
+ // scrollbar — ugly. `fill` top-anchors + clips overflow so
24621
+ // it reads as "the whole panel is loading" and never scrolls.
24622
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChatMessageListSkeleton, { fullWidth: true, fill: previewMode, className: "flex-1" })
24623
+ ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
24624
+ ChatMessageList,
24625
+ {
24626
+ messages,
24627
+ isTyping: chatLoading,
24628
+ pendingApprovals,
24629
+ autoScroll: !previewMode,
24630
+ pinBottom: previewMode,
24631
+ overscrollContain: !previewMode,
24632
+ assistantType: "mingo",
24633
+ assistantIcon: mingoAssistantIcon,
24634
+ renderEntityCard,
24635
+ resolveContextIcon,
24636
+ renderContextItem,
24637
+ renderMention,
24638
+ renderAfterMessage: renderSourcesAfterMessage,
24639
+ onAskSelect: chatLoading || previewMode ? void 0 : handleAskSelect,
24640
+ NavLinkAnchor: NavLinkAnchorViaRuntime,
24641
+ className: previewMode ? "pointer-events-auto flex-1" : "flex-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
24642
+ contentClassName: "max-w-none pb-0",
24643
+ fullWidth: true,
24644
+ hasNextPage: hasMoreMessages,
24645
+ isFetchingNextPage: isMessagesLoading,
24646
+ onLoadMore: loadMoreMessages
24647
+ }
24648
+ ) }) : activeMode === "mingo" ? (
24305
24649
  /* Figma node 7532:222444 — default (Mingo-mode) empty state:
24306
24650
  centred greeting + capability grid + Guide-chat promo +
24307
24651
  quick-action chips. Guide mode keeps the slash-command
@@ -24327,9 +24671,9 @@ function EmbeddableChatInner({
24327
24671
  subtitle: _nullishCoalesce(effectiveGreeting, () => ( void 0)),
24328
24672
  subtitleLoading: emptyStateLoading,
24329
24673
  ...guideWelcome,
24330
- title: _nullishCoalesce(effectiveAssistantName, () => ( _optionalChain([guideWelcome, 'optionalAccess', _814 => _814.title]))),
24331
- icon: _nullishCoalesce(effectiveAssistantIcon, () => ( _optionalChain([guideWelcome, 'optionalAccess', _815 => _815.icon]))),
24332
- quickActions: agentConfigUrl && guideSuggestedActions.length > 0 ? guideSuggestedActions : _nullishCoalesce(_optionalChain([guideWelcome, 'optionalAccess', _816 => _816.quickActions]), () => ( guideSuggestedActions)),
24674
+ title: _nullishCoalesce(effectiveAssistantName, () => ( _optionalChain([guideWelcome, 'optionalAccess', _831 => _831.title]))),
24675
+ icon: _nullishCoalesce(effectiveAssistantIcon, () => ( _optionalChain([guideWelcome, 'optionalAccess', _832 => _832.icon]))),
24676
+ quickActions: agentConfigUrl && guideSuggestedActions.length > 0 ? guideSuggestedActions : _nullishCoalesce(_optionalChain([guideWelcome, 'optionalAccess', _833 => _833.quickActions]), () => ( guideSuggestedActions)),
24333
24677
  onQuickAction: (action) => {
24334
24678
  setQuickActionPreview(null);
24335
24679
  handleSend(_nullishCoalesce(action.prompt, () => ( action.label)));
@@ -24403,8 +24747,8 @@ function EmbeddableChatInner({
24403
24747
  selectedContextItems: contextItems,
24404
24748
  onToggleContextItem: toggleContextItem,
24405
24749
  onRemoveContextItem: removeContextItem,
24406
- contextMemoryItems: _optionalChain([contextMemory, 'optionalAccess', _817 => _817.items]),
24407
- onRemoveContextMemoryItem: _optionalChain([contextMemory, 'optionalAccess', _818 => _818.onRemove]),
24750
+ contextMemoryItems: _optionalChain([contextMemory, 'optionalAccess', _834 => _834.items]),
24751
+ onRemoveContextMemoryItem: _optionalChain([contextMemory, 'optionalAccess', _835 => _835.onRemove]),
24408
24752
  contextPickerOpen,
24409
24753
  onOpenContextPicker: openContextPicker,
24410
24754
  onCloseContextPicker: closeContextPicker,
@@ -24863,4 +25207,4 @@ function EmbeddableChatInner({
24863
25207
 
24864
25208
 
24865
25209
  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;
24866
- //# sourceMappingURL=chunk-G45RGWHF.cjs.map
25210
+ //# sourceMappingURL=chunk-EKKR5ZFB.cjs.map