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