@flamingo-stack/openframe-frontend-core 0.0.551 → 0.0.552-snapshot.20260817220121

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 (150) hide show
  1. package/dist/{chunk-2YLMNXLB.js → chunk-25BXB4SH.js} +4 -4
  2. package/dist/{chunk-TXFJFO4A.js → chunk-3OBWO6N6.js} +2 -2
  3. package/dist/{chunk-NRTKEPUX.cjs → chunk-6WA3RI55.cjs} +18 -18
  4. package/dist/{chunk-NRTKEPUX.cjs.map → chunk-6WA3RI55.cjs.map} +1 -1
  5. package/dist/{chunk-MEY3PYOL.cjs → chunk-B5N2IG4Z.cjs} +7 -7
  6. package/dist/{chunk-MEY3PYOL.cjs.map → chunk-B5N2IG4Z.cjs.map} +1 -1
  7. package/dist/{chunk-EZIKNMYV.js → chunk-B7TI3RYG.js} +2 -2
  8. package/dist/{chunk-SWDTM5O6.js → chunk-BUNDMGAD.js} +7 -7
  9. package/dist/{chunk-7OPWSWEJ.cjs → chunk-CEAAOVCV.cjs} +1 -1
  10. package/dist/{chunk-7OPWSWEJ.cjs.map → chunk-CEAAOVCV.cjs.map} +1 -1
  11. package/dist/{chunk-H4RHXJHF.js → chunk-CGIZ4UGO.js} +2 -2
  12. package/dist/{chunk-YA5JDHWE.cjs → chunk-EGPI3SFI.cjs} +101 -101
  13. package/dist/{chunk-YA5JDHWE.cjs.map → chunk-EGPI3SFI.cjs.map} +1 -1
  14. package/dist/{chunk-O24VSDVN.cjs → chunk-LL6EPMAD.cjs} +42 -42
  15. package/dist/{chunk-O24VSDVN.cjs.map → chunk-LL6EPMAD.cjs.map} +1 -1
  16. package/dist/{chunk-YEXTFNVE.js → chunk-LZGHXN2E.js} +10 -10
  17. package/dist/chunk-LZGHXN2E.js.map +1 -0
  18. package/dist/{chunk-EFNDA2CG.js → chunk-MSNTPZJ3.js} +3 -3
  19. package/dist/{chunk-NVK7YZHN.js → chunk-N22NG622.js} +2 -2
  20. package/dist/{chunk-V3HNIPTE.cjs → chunk-NFQEDT43.cjs} +23 -23
  21. package/dist/{chunk-V3HNIPTE.cjs.map → chunk-NFQEDT43.cjs.map} +1 -1
  22. package/dist/{chunk-AK4LW6PF.cjs → chunk-OI56TF4Y.cjs} +42 -42
  23. package/dist/{chunk-AK4LW6PF.cjs.map → chunk-OI56TF4Y.cjs.map} +1 -1
  24. package/dist/{chunk-LQPHB2YF.js → chunk-OR67WC32.js} +2 -2
  25. package/dist/{chunk-H4OIDXP4.cjs → chunk-PWWMA3EJ.cjs} +36 -36
  26. package/dist/{chunk-H4OIDXP4.cjs.map → chunk-PWWMA3EJ.cjs.map} +1 -1
  27. package/dist/{chunk-4QYUNDS3.cjs → chunk-Q6RC3YGW.cjs} +3 -3
  28. package/dist/{chunk-4QYUNDS3.cjs.map → chunk-Q6RC3YGW.cjs.map} +1 -1
  29. package/dist/{chunk-IFH47QXW.js → chunk-QOS27D5S.js} +3 -3
  30. package/dist/{chunk-5RJUHUCI.cjs → chunk-QTO3WYB2.cjs} +5 -5
  31. package/dist/{chunk-5RJUHUCI.cjs.map → chunk-QTO3WYB2.cjs.map} +1 -1
  32. package/dist/{chunk-ZDWWXME5.cjs → chunk-S7ATADRE.cjs} +14 -14
  33. package/dist/{chunk-ZDWWXME5.cjs.map → chunk-S7ATADRE.cjs.map} +1 -1
  34. package/dist/{chunk-MKDL3S4U.cjs → chunk-T7UUDSDW.cjs} +3 -3
  35. package/dist/{chunk-MKDL3S4U.cjs.map → chunk-T7UUDSDW.cjs.map} +1 -1
  36. package/dist/{chunk-MVK7SNVO.js → chunk-UVAB3XAB.js} +6 -6
  37. package/dist/{chunk-Y2HKHGEW.js → chunk-UWY722RH.js} +1 -1
  38. package/dist/{chunk-Y2HKHGEW.js.map → chunk-UWY722RH.js.map} +1 -1
  39. package/dist/{chunk-ZYQAFJLF.cjs → chunk-V643QZFI.cjs} +4 -4
  40. package/dist/{chunk-ZYQAFJLF.cjs.map → chunk-V643QZFI.cjs.map} +1 -1
  41. package/dist/{chunk-4A736Z6S.js → chunk-VGLDA77S.js} +2 -2
  42. package/dist/{chunk-RJFD55SK.js → chunk-VYVOER73.js} +4 -4
  43. package/dist/{chunk-V5PDJFZS.js → chunk-WLQER7GC.js} +18 -13
  44. package/dist/chunk-WLQER7GC.js.map +1 -0
  45. package/dist/{chunk-T2JKOG6K.cjs → chunk-XBKBBKPR.cjs} +7 -7
  46. package/dist/{chunk-T2JKOG6K.cjs.map → chunk-XBKBBKPR.cjs.map} +1 -1
  47. package/dist/{chunk-PPPIBTCO.cjs → chunk-XPRFVYES.cjs} +14 -14
  48. package/dist/{chunk-PPPIBTCO.cjs.map → chunk-XPRFVYES.cjs.map} +1 -1
  49. package/dist/{chunk-72ZPQTPN.cjs → chunk-Y2WE2GOL.cjs} +96 -91
  50. package/dist/chunk-Y2WE2GOL.cjs.map +1 -0
  51. package/dist/{chunk-OMSEQDCU.js → chunk-YI2735PG.js} +3 -3
  52. package/dist/{chunk-CPADTPX4.cjs → chunk-ZGQZLUO6.cjs} +1035 -940
  53. package/dist/chunk-ZGQZLUO6.cjs.map +1 -0
  54. package/dist/{chunk-JI4JR3KC.js → chunk-ZS7VC5SX.js} +387 -292
  55. package/dist/chunk-ZS7VC5SX.js.map +1 -0
  56. package/dist/components/case-studies/index.cjs +10 -10
  57. package/dist/components/case-studies/index.js +4 -4
  58. package/dist/components/chat/entity-cards/chat-video-entity-card.d.ts.map +1 -1
  59. package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
  60. package/dist/components/chat/index.cjs +4 -4
  61. package/dist/components/chat/index.js +3 -3
  62. package/dist/components/contact/index.cjs +5 -5
  63. package/dist/components/contact/index.js +4 -4
  64. package/dist/components/docs/index.cjs +7 -7
  65. package/dist/components/docs/index.js +6 -6
  66. package/dist/components/embeds/index.cjs +5 -5
  67. package/dist/components/embeds/index.js +4 -4
  68. package/dist/components/faq/index.cjs +6 -6
  69. package/dist/components/faq/index.js +5 -5
  70. package/dist/components/features/captions-url.cjs +39 -1
  71. package/dist/components/features/captions-url.cjs.map +1 -1
  72. package/dist/components/features/captions-url.d.ts +59 -0
  73. package/dist/components/features/captions-url.d.ts.map +1 -1
  74. package/dist/components/features/captions-url.js +35 -2
  75. package/dist/components/features/captions-url.js.map +1 -1
  76. package/dist/components/features/entity-video-section.d.ts +12 -1
  77. package/dist/components/features/entity-video-section.d.ts.map +1 -1
  78. package/dist/components/features/index.cjs +16 -4
  79. package/dist/components/features/index.cjs.map +1 -1
  80. package/dist/components/features/index.d.ts +1 -0
  81. package/dist/components/features/index.d.ts.map +1 -1
  82. package/dist/components/features/index.js +15 -3
  83. package/dist/components/features/use-captions.d.ts +11 -0
  84. package/dist/components/features/use-captions.d.ts.map +1 -0
  85. package/dist/components/features/use-ios-native-video-fullscreen.d.ts +4 -0
  86. package/dist/components/features/use-ios-native-video-fullscreen.d.ts.map +1 -0
  87. package/dist/components/features/use-walkthrough-video.d.ts +4 -1
  88. package/dist/components/features/use-walkthrough-video.d.ts.map +1 -1
  89. package/dist/components/features/video.d.ts.map +1 -1
  90. package/dist/components/help-center-pages/index.cjs +25 -25
  91. package/dist/components/help-center-pages/index.js +16 -16
  92. package/dist/components/index.cjs +153 -141
  93. package/dist/components/index.cjs.map +1 -1
  94. package/dist/components/index.js +26 -14
  95. package/dist/components/index.js.map +1 -1
  96. package/dist/components/meeting-scheduler/index.cjs +35 -35
  97. package/dist/components/meeting-scheduler/index.js +5 -5
  98. package/dist/components/navigation/index.cjs +4 -4
  99. package/dist/components/navigation/index.js +3 -3
  100. package/dist/components/onboarding-guides/index.cjs +8 -8
  101. package/dist/components/onboarding-guides/index.js +7 -7
  102. package/dist/components/onboarding-guides/onboarding-guide-detail-view.d.ts.map +1 -1
  103. package/dist/components/related-content/index.cjs +6 -6
  104. package/dist/components/related-content/index.js +5 -5
  105. package/dist/components/shared/product-release/release-detail-page.d.ts.map +1 -1
  106. package/dist/components/tickets/index.cjs +8 -8
  107. package/dist/components/tickets/index.js +7 -7
  108. package/dist/components/ui/index.cjs +4 -4
  109. package/dist/components/ui/index.js +3 -3
  110. package/dist/contexts/chat-runtime-context.d.ts +8 -0
  111. package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
  112. package/dist/contexts/index.cjs +2 -2
  113. package/dist/contexts/index.js +1 -1
  114. package/dist/hooks/index.cjs +3 -3
  115. package/dist/hooks/index.js +2 -2
  116. package/dist/index.cjs +16 -4
  117. package/dist/index.cjs.map +1 -1
  118. package/dist/index.js +15 -3
  119. package/package.json +1 -1
  120. package/src/components/chat/entity-cards/chat-video-entity-card.tsx +4 -0
  121. package/src/components/chat/entity-cards/dispatch.tsx +2 -0
  122. package/src/components/features/__tests__/use-ios-native-video-fullscreen.test.tsx +116 -0
  123. package/src/components/features/captions-url.ts +115 -1
  124. package/src/components/features/entity-video-section.tsx +22 -2
  125. package/src/components/features/index.ts +1 -0
  126. package/src/components/features/use-captions.ts +46 -0
  127. package/src/components/features/use-ios-native-video-fullscreen.ts +89 -0
  128. package/src/components/features/use-walkthrough-video.ts +17 -5
  129. package/src/components/features/video.tsx +5 -0
  130. package/src/components/onboarding-guides/onboarding-guide-detail-view.tsx +5 -3
  131. package/src/components/shared/product-release/release-detail-page.tsx +14 -4
  132. package/src/contexts/chat-runtime-context.tsx +8 -0
  133. package/dist/chunk-72ZPQTPN.cjs.map +0 -1
  134. package/dist/chunk-CPADTPX4.cjs.map +0 -1
  135. package/dist/chunk-JI4JR3KC.js.map +0 -1
  136. package/dist/chunk-V5PDJFZS.js.map +0 -1
  137. package/dist/chunk-YEXTFNVE.js.map +0 -1
  138. /package/dist/{chunk-2YLMNXLB.js.map → chunk-25BXB4SH.js.map} +0 -0
  139. /package/dist/{chunk-TXFJFO4A.js.map → chunk-3OBWO6N6.js.map} +0 -0
  140. /package/dist/{chunk-EZIKNMYV.js.map → chunk-B7TI3RYG.js.map} +0 -0
  141. /package/dist/{chunk-SWDTM5O6.js.map → chunk-BUNDMGAD.js.map} +0 -0
  142. /package/dist/{chunk-H4RHXJHF.js.map → chunk-CGIZ4UGO.js.map} +0 -0
  143. /package/dist/{chunk-EFNDA2CG.js.map → chunk-MSNTPZJ3.js.map} +0 -0
  144. /package/dist/{chunk-NVK7YZHN.js.map → chunk-N22NG622.js.map} +0 -0
  145. /package/dist/{chunk-LQPHB2YF.js.map → chunk-OR67WC32.js.map} +0 -0
  146. /package/dist/{chunk-IFH47QXW.js.map → chunk-QOS27D5S.js.map} +0 -0
  147. /package/dist/{chunk-MVK7SNVO.js.map → chunk-UVAB3XAB.js.map} +0 -0
  148. /package/dist/{chunk-4A736Z6S.js.map → chunk-VGLDA77S.js.map} +0 -0
  149. /package/dist/{chunk-RJFD55SK.js.map → chunk-VYVOER73.js.map} +0 -0
  150. /package/dist/{chunk-OMSEQDCU.js.map → chunk-YI2735PG.js.map} +0 -0
@@ -52,7 +52,7 @@ import {
52
52
  useResetOnPageHidden,
53
53
  useSuppressCloneFocus,
54
54
  useToast
55
- } from "./chunk-4A736Z6S.js";
55
+ } from "./chunk-VGLDA77S.js";
56
56
  import {
57
57
  init_next_navigation,
58
58
  usePathname,
@@ -240,7 +240,7 @@ import {
240
240
  import {
241
241
  useChatRuntime,
242
242
  useRequiredChatRuntime
243
- } from "./chunk-Y2HKHGEW.js";
243
+ } from "./chunk-UWY722RH.js";
244
244
  import {
245
245
  COLLISION_PADDING_PX,
246
246
  Checkbox,
@@ -13615,7 +13615,7 @@ var TabsContent = React37.forwardRef(({ className, ...props }, ref) => /* @__PUR
13615
13615
  TabsContent.displayName = TabsPrimitive.Content.displayName;
13616
13616
 
13617
13617
  // src/components/features/video.tsx
13618
- import { useCallback as useCallback13, useEffect as useEffect24, useImperativeHandle as useImperativeHandle3, useMemo as useMemo19, useRef as useRef20, useState as useState29 } from "react";
13618
+ import { useCallback as useCallback13, useEffect as useEffect25, useImperativeHandle as useImperativeHandle3, useMemo as useMemo19, useRef as useRef20, useState as useState29 } from "react";
13619
13619
  import MuxPlayer from "@mux/mux-player-react";
13620
13620
 
13621
13621
  // src/components/features/video-center-badge.tsx
@@ -13670,8 +13670,36 @@ function fetchPriorityProp(priority) {
13670
13670
  return USE_CAMEL_CASE_FETCH_PRIORITY ? { fetchPriority: value } : { fetchpriority: value };
13671
13671
  }
13672
13672
 
13673
- // src/components/features/use-video-warmup.ts
13673
+ // src/components/features/use-ios-native-video-fullscreen.ts
13674
13674
  import { useEffect as useEffect23 } from "react";
13675
+ var ENTER_FULLSCREEN_REQUEST = "mediaenterfullscreenrequest";
13676
+ function isIosAppShell() {
13677
+ const capacitor = globalThis.Capacitor;
13678
+ return capacitor?.isNativePlatform?.() === true && capacitor.getPlatform?.() === "ios";
13679
+ }
13680
+ function nativeVideoElement(player) {
13681
+ const media = player.media;
13682
+ const element = media?.nativeEl ?? media;
13683
+ return element instanceof HTMLVideoElement ? element : null;
13684
+ }
13685
+ function useIosNativeVideoFullscreen(playerRef) {
13686
+ useEffect23(() => {
13687
+ if (!isIosAppShell()) return;
13688
+ const player = playerRef.current;
13689
+ if (!(player instanceof EventTarget)) return;
13690
+ const takeOver = (event) => {
13691
+ const video = nativeVideoElement(player);
13692
+ if (!video?.webkitSupportsFullscreen || typeof video.webkitEnterFullscreen !== "function") return;
13693
+ event.stopImmediatePropagation();
13694
+ video.webkitEnterFullscreen();
13695
+ };
13696
+ player.addEventListener(ENTER_FULLSCREEN_REQUEST, takeOver, true);
13697
+ return () => player.removeEventListener(ENTER_FULLSCREEN_REQUEST, takeOver, true);
13698
+ }, [playerRef]);
13699
+ }
13700
+
13701
+ // src/components/features/use-video-warmup.ts
13702
+ import { useEffect as useEffect24 } from "react";
13675
13703
  import ReactDOM from "react-dom";
13676
13704
 
13677
13705
  // src/components/features/mux-origins.ts
@@ -13723,7 +13751,7 @@ function useVideoWarmup({
13723
13751
  const resolvedOrigin = supabaseStorageOrigin ?? runtime?.endpoints.supabaseStorageOrigin;
13724
13752
  useVideoOriginPreconnect({ supabaseStorageOrigin: resolvedOrigin });
13725
13753
  const { ref, isNear } = useNearViewport(nearMargin);
13726
- useEffect23(() => {
13754
+ useEffect24(() => {
13727
13755
  if (!isNear || !videoUrl || !resolvedOrigin) return;
13728
13756
  if (saveDataEnabled()) return;
13729
13757
  let videoOrigin;
@@ -14007,7 +14035,7 @@ function FilePlayer({
14007
14035
  perfListenerRef.current = null;
14008
14036
  }
14009
14037
  }, []);
14010
- useEffect24(() => clearPerfListener, [clearPerfListener]);
14038
+ useEffect25(() => clearPerfListener, [clearPerfListener]);
14011
14039
  const hoverActiveRef = useRef20(false);
14012
14040
  const hoverGenerationRef = useRef20(0);
14013
14041
  const activationWaiterRef = useRef20(null);
@@ -14017,7 +14045,7 @@ function FilePlayer({
14017
14045
  activationWaiterRef.current = null;
14018
14046
  }
14019
14047
  }, []);
14020
- useEffect24(() => clearActivationWaiter, [clearActivationWaiter]);
14048
+ useEffect25(() => clearActivationWaiter, [clearActivationWaiter]);
14021
14049
  const startHoverPlayback = useCallback13(() => {
14022
14050
  hoverActiveRef.current = true;
14023
14051
  const generation = ++hoverGenerationRef.current;
@@ -14107,7 +14135,7 @@ function FilePlayer({
14107
14135
  setHoverMutedFallback(false);
14108
14136
  }, []);
14109
14137
  const hoverControlled = typeof playWhenHovered === "boolean";
14110
- useEffect24(() => {
14138
+ useEffect25(() => {
14111
14139
  if (!hoverControlled) return;
14112
14140
  if (playWhenHovered) startHoverPlayback();
14113
14141
  else stopHoverPlayback();
@@ -14118,14 +14146,14 @@ function FilePlayer({
14118
14146
  mutedIntentRef.current = mutedIntent;
14119
14147
  const onMutedFallbackChangeRef = useRef20(onMutedFallbackChange);
14120
14148
  onMutedFallbackChangeRef.current = onMutedFallbackChange;
14121
- useEffect24(() => {
14149
+ useEffect25(() => {
14122
14150
  onMutedFallbackChangeRef.current?.({
14123
14151
  muted: hoverMutedFallback,
14124
14152
  blocked: hoverMutedFallback && mutedFallbackBlocked
14125
14153
  });
14126
14154
  }, [hoverMutedFallback, mutedFallbackBlocked]);
14127
14155
  const autoPlayKickedRef = useRef20(false);
14128
- useEffect24(() => {
14156
+ useEffect25(() => {
14129
14157
  if (autoPlayKickedRef.current) return;
14130
14158
  if (startMuted) {
14131
14159
  const mutedEl = hoverPlayerRef.current;
@@ -14172,7 +14200,7 @@ function FilePlayer({
14172
14200
  } catch {
14173
14201
  }
14174
14202
  }, [autoPlayUnmuted, startMuted, autoPlay]);
14175
- useEffect24(() => {
14203
+ useEffect25(() => {
14176
14204
  const el = hoverPlayerRef.current;
14177
14205
  if (!el?.addEventListener) return;
14178
14206
  const onVolumeChange = () => {
@@ -14192,7 +14220,7 @@ function FilePlayer({
14192
14220
  }
14193
14221
  };
14194
14222
  }, []);
14195
- useEffect24(() => {
14223
+ useEffect25(() => {
14196
14224
  const el = hoverPlayerRef.current;
14197
14225
  if (!el?.addEventListener) return;
14198
14226
  const onPlaying = () => setMutedFallbackBlocked(false);
@@ -14209,7 +14237,7 @@ function FilePlayer({
14209
14237
  }, []);
14210
14238
  const onEndedRef = useRef20(onEnded);
14211
14239
  onEndedRef.current = onEnded;
14212
- useEffect24(() => {
14240
+ useEffect25(() => {
14213
14241
  const el = hoverPlayerRef.current;
14214
14242
  if (!el?.addEventListener) return;
14215
14243
  const handler = () => onEndedRef.current?.();
@@ -14224,6 +14252,7 @@ function FilePlayer({
14224
14252
  }
14225
14253
  };
14226
14254
  }, []);
14255
+ useIosNativeVideoFullscreen(hoverPlayerRef);
14227
14256
  useImperativeHandle3(playerHandleRef, () => ({
14228
14257
  getCurrentTime: () => hoverPlayerRef.current?.currentTime ?? 0,
14229
14258
  getDuration: () => {
@@ -14386,14 +14415,14 @@ function YouTubeFacadeInner({
14386
14415
  return `${YT_NOCOOKIE_ORIGIN}/embed/${videoId}?${params.toString()}`;
14387
14416
  }, [videoId, minimalControls]);
14388
14417
  const [posterTier, setPosterTier] = useState29(0);
14389
- useEffect24(() => {
14418
+ useEffect25(() => {
14390
14419
  setPosterTier(0);
14391
14420
  }, [videoId]);
14392
14421
  const posterQuality = YT_POSTER_TIERS[posterTier];
14393
14422
  const posterJpg = `https://i.ytimg.com/vi/${videoId}/${posterQuality}.jpg`;
14394
14423
  const posterWebp = `https://i.ytimg.com/vi_webp/${videoId}/${posterQuality}.webp`;
14395
14424
  const handlePosterError = () => setPosterTier((tier) => Math.min(tier + 1, YT_POSTER_TIERS.length - 1));
14396
- useEffect24(() => {
14425
+ useEffect25(() => {
14397
14426
  if (!activated) return;
14398
14427
  const iframe = iframeRef.current;
14399
14428
  if (!iframe) return;
@@ -14438,7 +14467,7 @@ function YouTubeFacadeInner({
14438
14467
  };
14439
14468
  }, [activated]);
14440
14469
  const prevSuspendedRef = useRef20(false);
14441
- useEffect24(() => {
14470
+ useEffect25(() => {
14442
14471
  const wasSuspended = prevSuspendedRef.current;
14443
14472
  prevSuspendedRef.current = Boolean(suspended);
14444
14473
  if (!activated) return;
@@ -14494,13 +14523,70 @@ function YouTubeFacadeInner({
14494
14523
  ) });
14495
14524
  }
14496
14525
 
14526
+ // src/components/features/use-captions.ts
14527
+ import { useMemo as useMemo20 } from "react";
14528
+
14529
+ // src/components/features/captions-url.ts
14530
+ function getCaptionsUrl(entityType, entityId, srtContent, options) {
14531
+ if (!srtContent) return void 0;
14532
+ const hash = `${srtContent.length}-${srtContent.slice(0, 8).replace(/\s/g, "")}`;
14533
+ const variant = options?.variant ? `&variant=${options.variant}` : "";
14534
+ return `${DEFAULT_CAPTIONS_PATH}/${entityType}/${entityId}?v=${hash}${variant}`;
14535
+ }
14536
+ var DEFAULT_CAPTIONS_PATH = "/api/captions";
14537
+ function resolveCaptionsBase(endpoints) {
14538
+ return endpoints?.captionsUrlPrefix || DEFAULT_CAPTIONS_PATH;
14539
+ }
14540
+ function rebaseCaptionsUrl(endpoints, url) {
14541
+ if (!url || !url.startsWith(`${DEFAULT_CAPTIONS_PATH}/`)) return url;
14542
+ const base = resolveCaptionsBase(endpoints);
14543
+ if (base === DEFAULT_CAPTIONS_PATH) return url;
14544
+ return `${base}${url.slice(DEFAULT_CAPTIONS_PATH.length)}`;
14545
+ }
14546
+ function buildCaptionsUrl(endpoints, entityType, entityId, srtContent, options) {
14547
+ const rel = getCaptionsUrl(entityType, entityId, srtContent, options);
14548
+ return rel ? rebaseCaptionsUrl(endpoints, rel) : void 0;
14549
+ }
14550
+ function getEntityCaptionUrls(endpoints, entityType, entity) {
14551
+ if (!entity) return {};
14552
+ return {
14553
+ captionsUrl: buildCaptionsUrl(endpoints, entityType, entity.id, entity.srt_content),
14554
+ highlightCaptionsUrl: buildCaptionsUrl(endpoints, entityType, entity.id, entity.highlight_srt_content, {
14555
+ variant: "highlight"
14556
+ })
14557
+ };
14558
+ }
14559
+ function getEntityCaptionUrlsById(endpoints, entityType, entityId) {
14560
+ const base = resolveCaptionsBase(endpoints);
14561
+ return {
14562
+ captionsUrl: `${base}/${entityType}/${entityId}`,
14563
+ highlightCaptionsUrl: `${base}/${entityType}/${entityId}?variant=highlight`
14564
+ };
14565
+ }
14566
+ function captionsEntityTypeForDocType(docType) {
14567
+ return docType === "podcast" ? "podcast_episode" : docType;
14568
+ }
14569
+
14570
+ // src/components/features/use-captions.ts
14571
+ function useCaptions() {
14572
+ const endpoints = useChatRuntime()?.endpoints ?? null;
14573
+ return useMemo20(
14574
+ () => ({
14575
+ forEntity: (entityType, entity) => getEntityCaptionUrls(endpoints, entityType, entity),
14576
+ forEntityId: (entityType, entityId) => getEntityCaptionUrlsById(endpoints, entityType, entityId),
14577
+ rebase: (url) => rebaseCaptionsUrl(endpoints, url)
14578
+ }),
14579
+ [endpoints]
14580
+ );
14581
+ }
14582
+
14497
14583
  // src/components/features/video-bites-strip.tsx
14498
14584
  init_cn();
14499
- import { useMemo as useMemo21, useState as useState32 } from "react";
14585
+ import { useMemo as useMemo22, useState as useState32 } from "react";
14500
14586
 
14501
14587
  // src/components/features/video-hover-preview.tsx
14502
14588
  init_cn();
14503
- import { useEffect as useEffect25, useRef as useRef21, useState as useState30 } from "react";
14589
+ import { useEffect as useEffect26, useRef as useRef21, useState as useState30 } from "react";
14504
14590
  import { Fragment as Fragment21, jsx as jsx90, jsxs as jsxs66 } from "react/jsx-runtime";
14505
14591
  function VideoHoverPreviewSurface({
14506
14592
  url,
@@ -14527,7 +14613,7 @@ function VideoHoverPreviewSurface({
14527
14613
  const gateControlled = playerMounted !== void 0;
14528
14614
  const rootElRef = useRef21(null);
14529
14615
  const [isNear, setIsNear] = useState30(false);
14530
- useEffect25(() => {
14616
+ useEffect26(() => {
14531
14617
  if (gateControlled) return;
14532
14618
  const el = rootElRef.current;
14533
14619
  if (!el || typeof IntersectionObserver === "undefined") return;
@@ -14722,7 +14808,7 @@ function sortBitesByCreatedAtDesc(a, b) {
14722
14808
 
14723
14809
  // src/components/features/cards-strip.tsx
14724
14810
  init_cn();
14725
- import React41, { useCallback as useCallback14, useEffect as useEffect26, useMemo as useMemo20, useRef as useRef22, useState as useState31 } from "react";
14811
+ import React41, { useCallback as useCallback14, useEffect as useEffect27, useMemo as useMemo21, useRef as useRef22, useState as useState31 } from "react";
14726
14812
  init_button2();
14727
14813
 
14728
14814
  // src/components/layout/page-heading.tsx
@@ -14802,14 +14888,14 @@ function CardsStrip(props) {
14802
14888
  className
14803
14889
  } = props;
14804
14890
  const childrenMode = props.renderCard === void 0;
14805
- const childItems = useMemo20(
14891
+ const childItems = useMemo21(
14806
14892
  () => childrenMode ? React41.Children.toArray(props.children) : EMPTY_CHILDREN,
14807
14893
  [childrenMode, props.children]
14808
14894
  );
14809
14895
  const items = childrenMode ? childItems : props.items;
14810
14896
  const cardWidthDesktop = childrenMode ? props.cardWidthDesktop ?? 400 : 0;
14811
14897
  const cardWidthMobile = childrenMode ? props.cardWidthMobile ?? 320 : 0;
14812
- useEffect26(() => {
14898
+ useEffect27(() => {
14813
14899
  if (process.env.NODE_ENV === "production" || !childrenMode) return;
14814
14900
  const only = childItems.length === 1 ? childItems[0] : null;
14815
14901
  if (React41.isValidElement(only) && only.type === React41.Fragment) {
@@ -14830,7 +14916,7 @@ function CardsStrip(props) {
14830
14916
  const [reducedMotion, setReducedMotion] = useState31(false);
14831
14917
  const [isTouch, setIsTouch] = useState31(false);
14832
14918
  const [isMobile, setIsMobile] = useState31(false);
14833
- useEffect26(() => {
14919
+ useEffect27(() => {
14834
14920
  const subs = [];
14835
14921
  const watch = (query, set) => {
14836
14922
  const mq = window.matchMedia(query);
@@ -14858,7 +14944,7 @@ function CardsStrip(props) {
14858
14944
  setOverflows(singleCopy > scroller.clientWidth + 1);
14859
14945
  setMarqueeEligible(singleCopy > scroller.clientWidth + TRACK_GAP_PX);
14860
14946
  }, []);
14861
- useEffect26(() => {
14947
+ useEffect27(() => {
14862
14948
  measure();
14863
14949
  const scroller = scrollerRef.current;
14864
14950
  const track = trackRef.current;
@@ -14871,7 +14957,7 @@ function CardsStrip(props) {
14871
14957
  const chevronSuppressUntilRef = useRef22(0);
14872
14958
  const userScrollSuppressUntilRef = useRef22(0);
14873
14959
  const [nearViewport, setNearViewport] = useState31(true);
14874
- useEffect26(() => {
14960
+ useEffect27(() => {
14875
14961
  const el = wrapperRef.current;
14876
14962
  if (!el || typeof IntersectionObserver === "undefined") return;
14877
14963
  const io = new IntersectionObserver(
@@ -14957,7 +15043,7 @@ function CardsStrip(props) {
14957
15043
  const cardObserverRef = useRef22(null);
14958
15044
  const cardElIdxRef = useRef22(/* @__PURE__ */ new Map());
14959
15045
  const cardElNearRef = useRef22(/* @__PURE__ */ new Map());
14960
- useEffect26(() => {
15046
+ useEffect27(() => {
14961
15047
  if (typeof IntersectionObserver === "undefined") return;
14962
15048
  const io = new IntersectionObserver((entries) => {
14963
15049
  for (const e of entries) cardElNearRef.current.set(e.target, e.isIntersecting);
@@ -15193,7 +15279,7 @@ function VideoBitesStrip({
15193
15279
  onBiteNavigate,
15194
15280
  className
15195
15281
  }) {
15196
- const items = useMemo21(() => {
15282
+ const items = useMemo22(() => {
15197
15283
  const filtered = filterPublished ? bites.filter((b) => b.published) : [...bites];
15198
15284
  return filtered.sort(sortBitesByCreatedAtDesc);
15199
15285
  }, [bites, filterPublished]);
@@ -15426,13 +15512,18 @@ function EntityVideoSection({
15426
15512
  bitesAutoScroll = true,
15427
15513
  MarkdownRenderer,
15428
15514
  srtContent,
15429
- captionsUrl,
15430
- highlightCaptionsUrl,
15515
+ captionsUrl: captionsUrlProp,
15516
+ highlightCaptionsUrl: highlightCaptionsUrlProp,
15517
+ captionsEntity,
15431
15518
  priority = false
15432
15519
  }) {
15520
+ const captions = useCaptions();
15433
15521
  const hasFullVideo = !!(youtubeUrl || mainVideoUrl);
15434
15522
  const hasHighlight = !!highlightVideoUrl;
15435
15523
  const hasVideo = hasFullVideo || hasHighlight;
15524
+ const derivedCaptions = captionsEntity ? captions.forEntityId(captionsEntity.type, captionsEntity.id) : null;
15525
+ const captionsUrl = captionsUrlProp ?? derivedCaptions?.captionsUrl;
15526
+ const highlightCaptionsUrl = highlightCaptionsUrlProp ?? derivedCaptions?.highlightCaptionsUrl;
15436
15527
  if (!hasVideo && !videoSummary && (!videoBites || videoBites.length === 0)) {
15437
15528
  return null;
15438
15529
  }
@@ -15544,6 +15635,7 @@ function ChatVideoEntityCard({
15544
15635
  highlightVideoUrl: highlightUrl,
15545
15636
  highlightVideoThumbnail: highlightPoster,
15546
15637
  mainVideoPoster: poster,
15638
+ captionsEntity: { type: captionsEntityTypeForDocType(chatRef.type), id: chatRef.id },
15547
15639
  title: chatRef.title
15548
15640
  }
15549
15641
  );
@@ -16103,7 +16195,7 @@ import { Eye as Eye2 } from "lucide-react";
16103
16195
  init_cn();
16104
16196
 
16105
16197
  // src/components/chat/entity-cards/use-entity-card-link.ts
16106
- import { useMemo as useMemo22 } from "react";
16198
+ import { useMemo as useMemo23 } from "react";
16107
16199
  function useEntityCardLink({
16108
16200
  href,
16109
16201
  targetPlatform,
@@ -16111,7 +16203,7 @@ function useEntityCardLink({
16111
16203
  rel
16112
16204
  }) {
16113
16205
  const runtime = useChatRuntime();
16114
- return useMemo22(() => {
16206
+ return useMemo23(() => {
16115
16207
  if (target !== void 0 || rel !== void 0) {
16116
16208
  const safeRel = rel ?? (target === "_blank" ? "noopener noreferrer" : void 0);
16117
16209
  return { target, rel: safeRel };
@@ -17174,7 +17266,7 @@ function AvatarStack({
17174
17266
  init_button();
17175
17267
 
17176
17268
  // src/components/ui/image-gallery-modal.tsx
17177
- import { useState as useState115, useEffect as useEffect87 } from "react";
17269
+ import { useState as useState115, useEffect as useEffect88 } from "react";
17178
17270
 
17179
17271
  // src/components/ui/allowed-domains-input.tsx
17180
17272
  init_cn();
@@ -17343,9 +17435,9 @@ function AnnouncementBarView({
17343
17435
  // src/components/ui/autocomplete.tsx
17344
17436
  import {
17345
17437
  forwardRef as forwardRef31,
17346
- useEffect as useEffect27,
17438
+ useEffect as useEffect28,
17347
17439
  useImperativeHandle as useImperativeHandle4,
17348
- useMemo as useMemo23,
17440
+ useMemo as useMemo24,
17349
17441
  useRef as useRef24,
17350
17442
  useState as useState34
17351
17443
  } from "react";
@@ -17526,7 +17618,7 @@ function AutocompleteInner(props, ref) {
17526
17618
  const hiddenTagsPopupRef = useRef24(null);
17527
17619
  const isInvalid = invalid || !!error;
17528
17620
  useImperativeHandle4(ref, () => containerRef.current);
17529
- const selectedOptions = useMemo23(() => {
17621
+ const selectedOptions = useMemo24(() => {
17530
17622
  return valueArray.map((v) => options.find((opt) => opt.value === v) ?? { label: String(v), value: v });
17531
17623
  }, [valueArray, options]);
17532
17624
  const selectedOption = !multiple && selectedOptions.length > 0 ? selectedOptions[0] : null;
@@ -17542,7 +17634,7 @@ function AutocompleteInner(props, ref) {
17542
17634
  const hiddenTagsCount = multiple ? selectedOptions.length - visibleCount : 0;
17543
17635
  const [showHiddenTags, setShowHiddenTags] = useState34(false);
17544
17636
  const hiddenTagsRef = useRef24(null);
17545
- useEffect27(() => {
17637
+ useEffect28(() => {
17546
17638
  if (!showHiddenTags) return;
17547
17639
  const handleClick = (e) => {
17548
17640
  const target = e.target;
@@ -17563,7 +17655,7 @@ function AutocompleteInner(props, ref) {
17563
17655
  setIsOpen(true);
17564
17656
  };
17565
17657
  const inputDisplayValue = !multiple && !isOpen && selectedOption ? selectedOption.label : inputValue;
17566
- const filteredOptions = useMemo23(() => {
17658
+ const filteredOptions = useMemo24(() => {
17567
17659
  if (disableClientFilter) {
17568
17660
  return options;
17569
17661
  }
@@ -17594,7 +17686,7 @@ function AutocompleteInner(props, ref) {
17594
17686
  setIsOpen(false);
17595
17687
  onCreateOption?.(trimmed);
17596
17688
  };
17597
- useEffect27(() => {
17689
+ useEffect28(() => {
17598
17690
  setHighlightedIndex(-1);
17599
17691
  }, [filteredOptions.length]);
17600
17692
  const handleInputChange = (e) => {
@@ -19230,7 +19322,7 @@ function DateFilterMenu({
19230
19322
 
19231
19323
  // src/components/ui/duration-input.tsx
19232
19324
  init_cn();
19233
- import { Fragment as Fragment31, useEffect as useEffect29, useRef as useRef25, useState as useState36 } from "react";
19325
+ import { Fragment as Fragment31, useEffect as useEffect30, useRef as useRef25, useState as useState36 } from "react";
19234
19326
  import { jsx as jsx118, jsxs as jsxs89 } from "react/jsx-runtime";
19235
19327
  var SEGMENT_META = [
19236
19328
  { label: "Hours", placeholder: "HH", max: 99 },
@@ -19246,7 +19338,7 @@ var split = (value) => {
19246
19338
  function DurationInput({ value, onChange, invalid, className }) {
19247
19339
  const [segments, setSegments] = useState36(() => split(value));
19248
19340
  const refs = [useRef25(null), useRef25(null), useRef25(null)];
19249
- useEffect29(() => {
19341
+ useEffect30(() => {
19250
19342
  setSegments((prev) => compose(prev) === value ? prev : split(value));
19251
19343
  }, [value]);
19252
19344
  const focusSegment = (i) => {
@@ -19491,7 +19583,7 @@ init_cn();
19491
19583
  import React52 from "react";
19492
19584
 
19493
19585
  // src/components/ui/progress-bar.tsx
19494
- import { useEffect as useEffect30, useRef as useRef26, useState as useState37 } from "react";
19586
+ import { useEffect as useEffect31, useRef as useRef26, useState as useState37 } from "react";
19495
19587
  import { jsx as jsx123 } from "react/jsx-runtime";
19496
19588
  var ProgressBar = ({
19497
19589
  progress,
@@ -19509,7 +19601,7 @@ var ProgressBar = ({
19509
19601
  const effectiveHeight = isMdUp ? height : mobileHeight;
19510
19602
  const containerRef = useRef26(null);
19511
19603
  const [segmentCount, setSegmentCount] = useState37(0);
19512
- useEffect30(() => {
19604
+ useEffect31(() => {
19513
19605
  if (!containerRef.current) return;
19514
19606
  const resizeObserver = new ResizeObserver(() => {
19515
19607
  if (containerRef.current) {
@@ -21652,13 +21744,13 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName;
21652
21744
  // src/components/ui/modal.tsx
21653
21745
  init_cn();
21654
21746
  import * as React68 from "react";
21655
- import { useEffect as useEffect35 } from "react";
21747
+ import { useEffect as useEffect36 } from "react";
21656
21748
  import { usePreventScroll } from "@react-aria/overlays";
21657
21749
  import { jsx as jsx145, jsxs as jsxs111 } from "react/jsx-runtime";
21658
21750
  var Modal2 = React68.forwardRef(
21659
21751
  ({ isOpen, onClose, children, className }, ref) => {
21660
21752
  usePreventScroll({ isDisabled: !isOpen });
21661
- useEffect35(() => {
21753
+ useEffect36(() => {
21662
21754
  const handleKeyDown = (event) => {
21663
21755
  if (event.key === "Escape") {
21664
21756
  onClose();
@@ -22888,7 +22980,7 @@ function TabContent({
22888
22980
  // src/components/ui/tab-navigation.tsx
22889
22981
  init_next_navigation();
22890
22982
  init_cn();
22891
- import { useState as useState47, useEffect as useEffect38, useLayoutEffect as useLayoutEffect7, useDeferredValue, useMemo as useMemo28, useRef as useRef30, useCallback as useCallback20, memo as memo4, startTransition } from "react";
22983
+ import { useState as useState47, useEffect as useEffect39, useLayoutEffect as useLayoutEffect7, useDeferredValue, useMemo as useMemo29, useRef as useRef30, useCallback as useCallback20, memo as memo4, startTransition } from "react";
22892
22984
  import { Fragment as Fragment34, jsx as jsx157, jsxs as jsxs121 } from "react/jsx-runtime";
22893
22985
  var HIDDEN_INDICATOR = { left: 0, width: 0 };
22894
22986
  var StatusDot = ({ indicator, className }) => /* @__PURE__ */ jsx157("div", { className: cn(
@@ -22932,7 +23024,7 @@ var TabBar = memo4(function TabBar2({
22932
23024
  useLayoutEffect7(() => {
22933
23025
  if (indicator.width > 0) hasPlacedIndicatorRef.current = true;
22934
23026
  }, [indicator]);
22935
- useEffect38(() => {
23027
+ useEffect39(() => {
22936
23028
  const el = scrollRef.current;
22937
23029
  if (!el) return;
22938
23030
  updateScrollShadows();
@@ -22965,7 +23057,7 @@ var TabBar = memo4(function TabBar2({
22965
23057
  ro.disconnect();
22966
23058
  };
22967
23059
  }, [updateScrollShadows, measureIndicator]);
22968
- useEffect38(() => {
23060
+ useEffect39(() => {
22969
23061
  const el = scrollRef.current;
22970
23062
  const active = activeTabRef.current;
22971
23063
  if (!el || !active) return;
@@ -22981,7 +23073,7 @@ var TabBar = memo4(function TabBar2({
22981
23073
  }, [activeTab]);
22982
23074
  const leftFade = canScrollLeft || showLeftGradient;
22983
23075
  const rightFade = canScrollRight || showRightGradient;
22984
- const borderStyle = useMemo28(() => {
23076
+ const borderStyle = useMemo29(() => {
22985
23077
  const c = "var(--color-border-default)";
22986
23078
  if (leftFade && rightFade) {
22987
23079
  return { background: `linear-gradient(to right, transparent 0, ${c} 40px, ${c} calc(100% - 40px), transparent 100%)` };
@@ -23090,7 +23182,7 @@ function TabNavigation({
23090
23182
  const isUrlSyncEnabled = !!urlSync;
23091
23183
  const paramName = typeof urlSync === "object" ? urlSync.paramName || "tab" : "tab";
23092
23184
  const replaceState = typeof urlSync === "object" ? urlSync.replaceState !== false : true;
23093
- const validTabIds = useMemo28(() => new Set(tabs.map((t) => t.id)), [tabs]);
23185
+ const validTabIds = useMemo29(() => new Set(tabs.map((t) => t.id)), [tabs]);
23094
23186
  const fallbackTab = defaultTab || tabs[0]?.id || "";
23095
23187
  const urlTab = isUrlSyncEnabled ? searchParams?.get(paramName) || "" : "";
23096
23188
  const getInitialTab = () => {
@@ -23101,7 +23193,7 @@ function TabNavigation({
23101
23193
  const activeTab = isUrlSyncEnabled ? internalActiveTab : controlledActiveTab || "";
23102
23194
  const lastSyncedUrlTabRef = useRef30(urlTab);
23103
23195
  const inFlightUrlTabsRef = useRef30([]);
23104
- useEffect38(() => {
23196
+ useEffect39(() => {
23105
23197
  if (!isUrlSyncEnabled) return;
23106
23198
  const landed = inFlightUrlTabsRef.current.indexOf(urlTab);
23107
23199
  if (landed !== -1) {
@@ -23120,7 +23212,7 @@ function TabNavigation({
23120
23212
  setInternalActiveTab(validTabIds.has(urlTab) ? urlTab : fallbackTab);
23121
23213
  }, [isUrlSyncEnabled, urlTab, validTabIds, fallbackTab]);
23122
23214
  const navRef = useRef30({ isUrlSyncEnabled, controlledOnTabChange, searchParams, pathname, paramName, replaceState });
23123
- useEffect38(() => {
23215
+ useEffect39(() => {
23124
23216
  navRef.current = { isUrlSyncEnabled, controlledOnTabChange, searchParams, pathname, paramName, replaceState };
23125
23217
  });
23126
23218
  const handleTabChange = useCallback20((tabId) => {
@@ -23225,7 +23317,7 @@ function AIGeneratedBadge({ className }) {
23225
23317
  }
23226
23318
 
23227
23319
  // src/components/ui/fade-preview.tsx
23228
- import { useState as useState48, useRef as useRef31, useEffect as useEffect39 } from "react";
23320
+ import { useState as useState48, useRef as useRef31, useEffect as useEffect40 } from "react";
23229
23321
  import { ChevronDown as ChevronDown4 } from "lucide-react";
23230
23322
  import { Fragment as Fragment35, jsx as jsx160, jsxs as jsxs123 } from "react/jsx-runtime";
23231
23323
  function FadePreview({
@@ -23236,7 +23328,7 @@ function FadePreview({
23236
23328
  }) {
23237
23329
  const [expanded, setExpanded] = useState48(false);
23238
23330
  const contentRef = useRef31(null);
23239
- useEffect39(() => {
23331
+ useEffect40(() => {
23240
23332
  setExpanded(false);
23241
23333
  }, [resetKey]);
23242
23334
  const needsFade = hiddenCount > 0;
@@ -23305,10 +23397,10 @@ import { useState as useState57 } from "react";
23305
23397
  import { ChevronDown as ChevronDown5 } from "lucide-react";
23306
23398
 
23307
23399
  // src/components/ui/markdown/rich/rich-markdown-renderer.tsx
23308
- import { memo as memo6, useCallback as useCallback23, useMemo as useMemo31 } from "react";
23400
+ import { memo as memo6, useCallback as useCallback23, useMemo as useMemo32 } from "react";
23309
23401
 
23310
23402
  // src/components/embeds/rich-markdown-runtime.tsx
23311
- import { createContext as createContext5, useContext as useContext5, useMemo as useMemo29 } from "react";
23403
+ import { createContext as createContext5, useContext as useContext5, useMemo as useMemo30 } from "react";
23312
23404
  import { jsx as jsx162 } from "react/jsx-runtime";
23313
23405
  var DEFAULT_RUNTIME = {
23314
23406
  redditProxyUrl: "/api/blog/reddit-proxy",
@@ -23324,7 +23416,7 @@ function RichMarkdownRuntimeProvider({
23324
23416
  transformImageSrc,
23325
23417
  children
23326
23418
  }) {
23327
- const value = useMemo29(
23419
+ const value = useMemo30(
23328
23420
  () => ({
23329
23421
  redditProxyUrl: redditProxyUrl ?? DEFAULT_RUNTIME.redditProxyUrl,
23330
23422
  twitterProxyUrl: twitterProxyUrl ?? DEFAULT_RUNTIME.twitterProxyUrl,
@@ -23340,7 +23432,7 @@ function useRichMarkdownRuntime() {
23340
23432
  }
23341
23433
 
23342
23434
  // src/components/embeds/reddit-embed-client.tsx
23343
- import { useState as useState50, useEffect as useEffect41, useRef as useRef33 } from "react";
23435
+ import { useState as useState50, useEffect as useEffect42, useRef as useRef33 } from "react";
23344
23436
 
23345
23437
  // src/utils/social-embed-cache.ts
23346
23438
  var dataCache = /* @__PURE__ */ new Map();
@@ -23416,7 +23508,7 @@ var socialCache = SocialEmbedCache.getInstance();
23416
23508
 
23417
23509
  // src/components/media-carousel.tsx
23418
23510
  init_cn();
23419
- import { useState as useState49, useRef as useRef32, useEffect as useEffect40, memo as memo5, useCallback as useCallback21 } from "react";
23511
+ import { useState as useState49, useRef as useRef32, useEffect as useEffect41, memo as memo5, useCallback as useCallback21 } from "react";
23420
23512
  init_button2();
23421
23513
  import { Fragment as Fragment36, jsx as jsx163, jsxs as jsxs124 } from "react/jsx-runtime";
23422
23514
  var ChevronLeftIcon = () => /* @__PURE__ */ jsx163("svg", { width: "24", height: "24", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx163("polyline", { points: "15,18 9,12 15,6" }) });
@@ -23441,7 +23533,7 @@ var MediaCarousel = memo5(function MediaCarousel2({
23441
23533
  const key = originalUrl.trim() || "__missing_src__";
23442
23534
  setBrokenResourceUrls((b) => b[key] ? b : { ...b, [key]: true });
23443
23535
  }, []);
23444
- useEffect40(() => {
23536
+ useEffect41(() => {
23445
23537
  if (currentIndex >= media.length && media.length > 0) {
23446
23538
  setCurrentIndex(media.length - 1);
23447
23539
  }
@@ -23730,7 +23822,7 @@ function RedditEmbedClient({ url, maxWidth = 700 }) {
23730
23822
  const [loading, setLoading] = useState50(true);
23731
23823
  const [error, setError] = useState50(null);
23732
23824
  const initializationDone = useRef33(false);
23733
- useEffect41(() => {
23825
+ useEffect42(() => {
23734
23826
  if (initializationDone.current) return;
23735
23827
  initializationDone.current = true;
23736
23828
  const jsonUrl = url.endsWith(".json") ? url : `${url.replace(/\/$/, "")}.json`;
@@ -24036,7 +24128,7 @@ function RedditEmbedClient({ url, maxWidth = 700 }) {
24036
24128
  }
24037
24129
 
24038
24130
  // src/components/embeds/twitter-embed-client.tsx
24039
- import { useState as useState51, useEffect as useEffect42, useRef as useRef34 } from "react";
24131
+ import { useState as useState51, useEffect as useEffect43, useRef as useRef34 } from "react";
24040
24132
  import { jsx as jsx166, jsxs as jsxs126 } from "react/jsx-runtime";
24041
24133
  var MessageCircleIcon2 = () => /* @__PURE__ */ jsx166("svg", { width: "16", height: "16", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx166("path", { d: "M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z" }) });
24042
24134
  var ExternalLinkIcon3 = () => /* @__PURE__ */ jsxs126("svg", { width: "16", height: "16", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
@@ -24068,7 +24160,7 @@ function TwitterEmbedClient({ url, tweetId, maxWidth = 700 }) {
24068
24160
  const initializationDone = useRef34(false);
24069
24161
  const extractedTweetId = tweetId || url.match(/status\/(\d+)/)?.[1];
24070
24162
  const tweetUrl = url.includes("twitter.com") || url.includes("x.com") ? url : `https://twitter.com/twitter/status/${extractedTweetId}`;
24071
- useEffect42(() => {
24163
+ useEffect43(() => {
24072
24164
  if (initializationDone.current) return;
24073
24165
  initializationDone.current = true;
24074
24166
  if (!extractedTweetId) {
@@ -24233,7 +24325,7 @@ function TwitterEmbedClient({ url, tweetId, maxWidth = 700 }) {
24233
24325
  }
24234
24326
 
24235
24327
  // src/components/embeds/linkedin-embed-client.tsx
24236
- import { useMemo as useMemo30, useState as useState52 } from "react";
24328
+ import { useMemo as useMemo31, useState as useState52 } from "react";
24237
24329
  import { ExternalLink as ExternalLink2 } from "lucide-react";
24238
24330
  import { jsx as jsx167, jsxs as jsxs127 } from "react/jsx-runtime";
24239
24331
  function toLinkedInEmbedUrl(url) {
@@ -24248,7 +24340,7 @@ function toLinkedInEmbedUrl(url) {
24248
24340
  return "";
24249
24341
  }
24250
24342
  function LinkedInEmbedClient({ url, height = 600 }) {
24251
- const embedUrl = useMemo30(() => toLinkedInEmbedUrl(url), [url]);
24343
+ const embedUrl = useMemo31(() => toLinkedInEmbedUrl(url), [url]);
24252
24344
  const [loaded, setLoaded] = useState52(false);
24253
24345
  if (!embedUrl) {
24254
24346
  return /* @__PURE__ */ jsx167(LinkedInContainer, { children: /* @__PURE__ */ jsxs127("div", { className: "p-6", children: [
@@ -24316,7 +24408,7 @@ function LinkedInEmbedClient({ url, height = 600 }) {
24316
24408
  }
24317
24409
 
24318
24410
  // src/components/embeds/og-link-preview.tsx
24319
- import { useState as useState53, useEffect as useEffect43, Component as Component2 } from "react";
24411
+ import { useState as useState53, useEffect as useEffect44, Component as Component2 } from "react";
24320
24412
  import { jsx as jsx168, jsxs as jsxs128 } from "react/jsx-runtime";
24321
24413
  var OGLinkErrorBoundary = class extends Component2 {
24322
24414
  constructor(props) {
@@ -24381,7 +24473,7 @@ var OGLinkPreview = ({
24381
24473
  } catch {
24382
24474
  isValidUrl = false;
24383
24475
  }
24384
- useEffect43(() => {
24476
+ useEffect44(() => {
24385
24477
  if (!isValidUrl || isLocalhost) return;
24386
24478
  const fetchOGData = async () => {
24387
24479
  try {
@@ -24694,7 +24786,7 @@ function toFigmaOriginalUrl(url) {
24694
24786
  init_cn();
24695
24787
 
24696
24788
  // src/components/embeds/embed-iframe.tsx
24697
- import { useState as useState54, useCallback as useCallback22, useRef as useRef35, useEffect as useEffect44 } from "react";
24789
+ import { useState as useState54, useCallback as useCallback22, useRef as useRef35, useEffect as useEffect45 } from "react";
24698
24790
  import { Fragment as Fragment37, jsx as jsx169, jsxs as jsxs129 } from "react/jsx-runtime";
24699
24791
  function EmbedLoadingSkeleton({ height }) {
24700
24792
  return /* @__PURE__ */ jsx169(
@@ -24718,10 +24810,10 @@ function EmbedIframe({
24718
24810
  const [isLoaded, setIsLoaded] = useState54(false);
24719
24811
  const iframeRef = useRef35(null);
24720
24812
  const handleLoad = useCallback22(() => setIsLoaded(true), []);
24721
- useEffect44(() => {
24813
+ useEffect45(() => {
24722
24814
  setIsLoaded(false);
24723
24815
  }, [src]);
24724
- useEffect44(() => {
24816
+ useEffect45(() => {
24725
24817
  const iframe = iframeRef.current;
24726
24818
  return () => {
24727
24819
  if (iframe) {
@@ -24892,14 +24984,14 @@ function FigmaEmbed({ url, title, height, loading = "lazy" }) {
24892
24984
  }
24893
24985
 
24894
24986
  // src/components/embeds/markdown-image.tsx
24895
- import { useEffect as useEffect45, useState as useState56 } from "react";
24987
+ import { useEffect as useEffect46, useState as useState56 } from "react";
24896
24988
  import { jsx as jsx172 } from "react/jsx-runtime";
24897
24989
  var MAX_H_REM = 32;
24898
24990
  var DISPLAY_W = 768;
24899
24991
  function MarkdownImage({ src, alt }) {
24900
24992
  const { transformImageSrc } = useRichMarkdownRuntime();
24901
24993
  const [ratio, setRatio] = useState56(null);
24902
- useEffect45(() => {
24994
+ useEffect46(() => {
24903
24995
  let cancelled = false;
24904
24996
  setRatio(null);
24905
24997
  const probeSrc = transformImageSrc(src, { width: 48, resize: "contain", quality: 20 }) ?? src;
@@ -25304,7 +25396,7 @@ var RichMarkdownInner = ({
25304
25396
  demoteMarkdownH1ToH2
25305
25397
  }) => {
25306
25398
  const { ogScraperUrl } = useRichMarkdownRuntime();
25307
- const { ogApiBaseUrl, ogEndpointPath } = useMemo31(() => {
25399
+ const { ogApiBaseUrl, ogEndpointPath } = useMemo32(() => {
25308
25400
  try {
25309
25401
  const u = new URL(ogScraperUrl);
25310
25402
  return {
@@ -25326,8 +25418,8 @@ var RichMarkdownInner = ({
25326
25418
  },
25327
25419
  [resolveLinkEndpointUrl, resolveSource]
25328
25420
  );
25329
- const textSizes = useMemo31(() => resolveTextSizeConfig("article"), []);
25330
- const componentOverrides = useMemo31(
25421
+ const textSizes = useMemo32(() => resolveTextSizeConfig("article"), []);
25422
+ const componentOverrides = useMemo32(
25331
25423
  () => buildRichEmbedOverrides({ ogApiBaseUrl, ogEndpointPath, textSizes }),
25332
25424
  [ogApiBaseUrl, ogEndpointPath, textSizes]
25333
25425
  );
@@ -25713,11 +25805,11 @@ function BackButton({ label = "Back", className, type = "button", ...props }) {
25713
25805
 
25714
25806
  // src/components/layout/list-page-layout.tsx
25715
25807
  init_cn();
25716
- import { useEffect as useEffect47, useState as useState60 } from "react";
25808
+ import { useEffect as useEffect48, useState as useState60 } from "react";
25717
25809
 
25718
25810
  // src/components/ui/filter-modal.tsx
25719
25811
  init_cn();
25720
- import { useEffect as useEffect46, useState as useState59 } from "react";
25812
+ import { useEffect as useEffect47, useState as useState59 } from "react";
25721
25813
  init_button2();
25722
25814
 
25723
25815
  // src/components/ui/filter-checkbox-item.tsx
@@ -25811,7 +25903,7 @@ function SortColumnItem({ column, currentDirection, onSort, onClear }) {
25811
25903
 
25812
25904
  // src/components/ui/tag-key-value-filter.tsx
25813
25905
  init_cn();
25814
- import { useMemo as useMemo32 } from "react";
25906
+ import { useMemo as useMemo33 } from "react";
25815
25907
  import { jsx as jsx183, jsxs as jsxs141 } from "react/jsx-runtime";
25816
25908
  function TagKeyValueFilter({
25817
25909
  keys,
@@ -25820,7 +25912,7 @@ function TagKeyValueFilter({
25820
25912
  keysTitle = "Tag Keys",
25821
25913
  className
25822
25914
  }) {
25823
- const selectedMap = useMemo32(() => {
25915
+ const selectedMap = useMemo33(() => {
25824
25916
  const map = /* @__PURE__ */ new Map();
25825
25917
  for (const tag of selectedTags) {
25826
25918
  const colonIdx = tag.indexOf(":");
@@ -25832,7 +25924,7 @@ function TagKeyValueFilter({
25832
25924
  }
25833
25925
  return map;
25834
25926
  }, [selectedTags]);
25835
- const activeKeys = useMemo32(() => {
25927
+ const activeKeys = useMemo33(() => {
25836
25928
  return new Set(selectedMap.keys());
25837
25929
  }, [selectedMap]);
25838
25930
  const handleKeyToggle = (key, checked) => {
@@ -25922,7 +26014,7 @@ function FilterModal({
25922
26014
  const [draftDateSort, setDraftDateSort] = useState59(dateFilter?.sort ?? dateDefaultSort);
25923
26015
  const [draftDateRange, setDraftDateRange] = useState59(dateFilter?.range);
25924
26016
  const { scrollRef, fadeTop, fadeBottom, update: updateFade } = useScrollFade();
25925
- useEffect46(() => {
26017
+ useEffect47(() => {
25926
26018
  if (isOpen) {
25927
26019
  setSelectedFilters({ ...currentFilters });
25928
26020
  setPendingTags(selectedTags ?? []);
@@ -26547,10 +26639,10 @@ function ListPageLayout({
26547
26639
  const [mobileFilterOpen, setMobileFilterOpen] = useState60(false);
26548
26640
  const [localSearchValue, setLocalSearchValue] = useState60(searchValue);
26549
26641
  const debouncedSearchValue = useDebounce(localSearchValue, 500);
26550
- useEffect47(() => {
26642
+ useEffect48(() => {
26551
26643
  setLocalSearchValue(searchValue);
26552
26644
  }, [searchValue]);
26553
- useEffect47(() => {
26645
+ useEffect48(() => {
26554
26646
  if (debouncedSearchValue !== searchValue) {
26555
26647
  onSearch(debouncedSearchValue);
26556
26648
  }
@@ -30217,14 +30309,14 @@ function OrganizationCard({
30217
30309
 
30218
30310
  // src/components/ui/service-card.tsx
30219
30311
  init_cn();
30220
- import { useMemo as useMemo44, useState as useState98 } from "react";
30312
+ import { useMemo as useMemo45, useState as useState98 } from "react";
30221
30313
  import { ExternalLink as ExternalLink8 } from "lucide-react";
30222
30314
 
30223
30315
  // src/components/providers/dynamic-theme-provider.tsx
30224
30316
  import { createContext as createContext7, useContext as useContext7 } from "react";
30225
30317
 
30226
30318
  // src/hooks/use-dynamic-theming.ts
30227
- import { useState as useState61, useEffect as useEffect48 } from "react";
30319
+ import { useState as useState61, useEffect as useEffect49 } from "react";
30228
30320
  var defaultTheme = {
30229
30321
  primaryColor: "#FFC008",
30230
30322
  secondaryColor: "#161616",
@@ -30235,7 +30327,7 @@ var defaultTheme = {
30235
30327
  function useDynamicTheming() {
30236
30328
  const [theme, setTheme] = useState61(defaultTheme);
30237
30329
  const [isDark, setIsDark] = useState61(false);
30238
- useEffect48(() => {
30330
+ useEffect49(() => {
30239
30331
  const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
30240
30332
  setIsDark(mediaQuery.matches);
30241
30333
  const handleChange = (e) => {
@@ -30323,7 +30415,7 @@ function useThemeToggle() {
30323
30415
  }
30324
30416
 
30325
30417
  // src/components/features/array-entry-manager.tsx
30326
- import { useState as useState63, useEffect as useEffect50 } from "react";
30418
+ import { useState as useState63, useEffect as useEffect51 } from "react";
30327
30419
  import { Trash2, Plus as Plus2, Save, Loader2 as Loader22 } from "lucide-react";
30328
30420
  import { jsx as jsx216, jsxs as jsxs165 } from "react/jsx-runtime";
30329
30421
  function ArrayEntryManager({
@@ -30344,12 +30436,12 @@ function ArrayEntryManager({
30344
30436
  }) {
30345
30437
  const [draftItems, setDraftItems] = useState63(items);
30346
30438
  const [isDirty, setIsDirty] = useState63(false);
30347
- useEffect50(() => {
30439
+ useEffect51(() => {
30348
30440
  if (!isDirty && !isSaving) {
30349
30441
  setDraftItems(items);
30350
30442
  }
30351
30443
  }, [items, isDirty, isSaving]);
30352
- useEffect50(() => {
30444
+ useEffect51(() => {
30353
30445
  if (onDirtyChange) {
30354
30446
  onDirtyChange(isDirty);
30355
30447
  }
@@ -31584,7 +31676,7 @@ function AuthProvidersList({
31584
31676
 
31585
31677
  // src/components/features/changelog-manager.tsx
31586
31678
  import { Trash2 as Trash22, Plus as Plus3, ChevronDown as ChevronDown7, ChevronUp as ChevronUp3, Eye as Eye3, EyeOff } from "lucide-react";
31587
- import { useState as useState66, useEffect as useEffect51 } from "react";
31679
+ import { useState as useState66, useEffect as useEffect52 } from "react";
31588
31680
  import { jsx as jsx234, jsxs as jsxs179 } from "react/jsx-runtime";
31589
31681
  function ChangelogManager({
31590
31682
  title,
@@ -31595,7 +31687,7 @@ function ChangelogManager({
31595
31687
  showVisibilityToggle = false
31596
31688
  }) {
31597
31689
  const [expandedIndices, setExpandedIndices] = useState66(/* @__PURE__ */ new Set());
31598
- useEffect51(() => {
31690
+ useEffect52(() => {
31599
31691
  if (expandAll && entries.length > 0) {
31600
31692
  setExpandedIndices(new Set(entries.map((_, i) => i)));
31601
31693
  }
@@ -31938,7 +32030,7 @@ var ErrorBoundary = class extends Component3 {
31938
32030
 
31939
32031
  // src/components/features/figma-prototype-viewer.tsx
31940
32032
  init_cn();
31941
- import { useState as useState67, useRef as useRef37, useEffect as useEffect52, useCallback as useCallback26, useMemo as useMemo33 } from "react";
32033
+ import { useState as useState67, useRef as useRef37, useEffect as useEffect53, useCallback as useCallback26, useMemo as useMemo34 } from "react";
31942
32034
 
31943
32035
  // src/components/features/section-selector.tsx
31944
32036
  init_cn();
@@ -32328,15 +32420,15 @@ var FigmaPrototypeViewer = ({
32328
32420
  const activeSection = externalActiveSection || internalActiveSection;
32329
32421
  const [isNavigating, setIsNavigating] = useState67(false);
32330
32422
  const [containerDimensions, setContainerDimensions] = useState67({ width: 1200, height: 800 });
32331
- const viewMode = useMemo33(
32423
+ const viewMode = useMemo34(
32332
32424
  () => getViewMode(screenWidth, isTouchDevice),
32333
32425
  [screenWidth, isTouchDevice]
32334
32426
  );
32335
- const scaling = useMemo33(
32427
+ const scaling = useMemo34(
32336
32428
  () => calculateScaling(viewMode, containerDimensions, config),
32337
32429
  [viewMode, containerDimensions, config]
32338
32430
  );
32339
- const embedUrl = useMemo33(() => {
32431
+ const embedUrl = useMemo34(() => {
32340
32432
  try {
32341
32433
  const startingNodeId = resolveStartingPoint(config, viewMode);
32342
32434
  return generateEmbedUrl(config, viewMode, startingNodeId, clientId);
@@ -32345,7 +32437,7 @@ var FigmaPrototypeViewer = ({
32345
32437
  return "";
32346
32438
  }
32347
32439
  }, [config, viewMode, clientId]);
32348
- const unifiedState = useMemo33(() => ({
32440
+ const unifiedState = useMemo34(() => ({
32349
32441
  viewMode,
32350
32442
  iframeState,
32351
32443
  screenWidth,
@@ -32376,7 +32468,7 @@ var FigmaPrototypeViewer = ({
32376
32468
  embedUrl,
32377
32469
  iframeKey
32378
32470
  ]);
32379
- useEffect52(() => {
32471
+ useEffect53(() => {
32380
32472
  const handleResize = () => {
32381
32473
  const newWidth = window.innerWidth;
32382
32474
  setScreenWidth(newWidth);
@@ -32390,7 +32482,7 @@ var FigmaPrototypeViewer = ({
32390
32482
  return () => window.removeEventListener("resize", handleResize);
32391
32483
  }, []);
32392
32484
  const [lastViewMode, setLastViewMode] = useState67(viewMode);
32393
- useEffect52(() => {
32485
+ useEffect53(() => {
32394
32486
  if (lastViewMode !== viewMode && iframeState === "READY") {
32395
32487
  console.log("[ViewMode Change]", lastViewMode, "\u2192", viewMode);
32396
32488
  setIframeState("RELOADING");
@@ -32398,7 +32490,7 @@ var FigmaPrototypeViewer = ({
32398
32490
  }
32399
32491
  setLastViewMode(viewMode);
32400
32492
  }, [viewMode, lastViewMode, iframeState]);
32401
- useEffect52(() => {
32493
+ useEffect53(() => {
32402
32494
  const handleVisibilityChange = () => {
32403
32495
  if (document.visibilityState === "visible" && iframeState === "READY") {
32404
32496
  console.log("[Sleep Recovery] Reloading iframe after sleep");
@@ -32409,7 +32501,7 @@ var FigmaPrototypeViewer = ({
32409
32501
  document.addEventListener("visibilitychange", handleVisibilityChange);
32410
32502
  return () => document.removeEventListener("visibilitychange", handleVisibilityChange);
32411
32503
  }, [iframeState]);
32412
- useEffect52(() => {
32504
+ useEffect53(() => {
32413
32505
  const handleMessage = (event) => {
32414
32506
  if (event.origin !== "https://www.figma.com") return;
32415
32507
  const validEvents = ["INITIAL_LOAD", "NEW_STATE", "PRESENTED_NODE_CHANGED"];
@@ -32493,12 +32585,12 @@ var FigmaPrototypeViewer = ({
32493
32585
  }
32494
32586
  }, 500);
32495
32587
  }, []);
32496
- useEffect52(() => {
32588
+ useEffect53(() => {
32497
32589
  if (externalActiveSection && externalActiveSection !== activeSection && isInitialized) {
32498
32590
  navigateToSection(externalActiveSection);
32499
32591
  }
32500
32592
  }, [externalActiveSection, activeSection, isInitialized, navigateToSection]);
32501
- useEffect52(() => {
32593
+ useEffect53(() => {
32502
32594
  return () => {
32503
32595
  if (navTimerRef.current) clearTimeout(navTimerRef.current);
32504
32596
  if (touchTimerRef.current) clearTimeout(touchTimerRef.current);
@@ -32601,7 +32693,7 @@ var FigmaPrototypeViewer = ({
32601
32693
 
32602
32694
  // src/components/features/filters-dropdown.tsx
32603
32695
  init_cn();
32604
- import { useEffect as useEffect53, useRef as useRef38, useState as useState68 } from "react";
32696
+ import { useEffect as useEffect54, useRef as useRef38, useState as useState68 } from "react";
32605
32697
  import { jsx as jsx241, jsxs as jsxs185 } from "react/jsx-runtime";
32606
32698
  var FilterCheckbox = ({ checked, disabled = false, className }) => {
32607
32699
  return /* @__PURE__ */ jsx241(
@@ -32641,7 +32733,7 @@ var FiltersDropdown = ({
32641
32733
  const dropdownRef = useRef38(null);
32642
32734
  const triggerRef = useRef38(null);
32643
32735
  const containerRef = useRef38(null);
32644
- useEffect53(() => {
32736
+ useEffect54(() => {
32645
32737
  if (isOpen) {
32646
32738
  setShouldRender(true);
32647
32739
  let id2 = 0;
@@ -32657,7 +32749,7 @@ var FiltersDropdown = ({
32657
32749
  const t = setTimeout(() => setShouldRender(false), ANIMATION_MS);
32658
32750
  return () => clearTimeout(t);
32659
32751
  }, [isOpen]);
32660
- useEffect53(() => {
32752
+ useEffect54(() => {
32661
32753
  if (!responsive) {
32662
32754
  setIsMobile(false);
32663
32755
  return;
@@ -32669,7 +32761,7 @@ var FiltersDropdown = ({
32669
32761
  window.addEventListener("resize", checkMobile);
32670
32762
  return () => window.removeEventListener("resize", checkMobile);
32671
32763
  }, [responsive]);
32672
- useEffect53(() => {
32764
+ useEffect54(() => {
32673
32765
  if (!isOpen || isMobile || !triggerRef.current) return;
32674
32766
  const calculateOptimalPlacement = () => {
32675
32767
  const trigger = triggerRef.current;
@@ -32706,12 +32798,12 @@ var FiltersDropdown = ({
32706
32798
  return initial;
32707
32799
  });
32708
32800
  const currentFiltersStr = currentFilters ? JSON.stringify(currentFilters) : "";
32709
- useEffect53(() => {
32801
+ useEffect54(() => {
32710
32802
  if (currentFilters) {
32711
32803
  setSelectedFilters({ ...currentFilters });
32712
32804
  }
32713
32805
  }, [currentFiltersStr]);
32714
- useEffect53(() => {
32806
+ useEffect54(() => {
32715
32807
  const handleClickOutside = (event) => {
32716
32808
  if (containerRef.current && !containerRef.current.contains(event.target)) {
32717
32809
  setIsOpen(false);
@@ -32727,7 +32819,7 @@ var FiltersDropdown = ({
32727
32819
  };
32728
32820
  }
32729
32821
  }, [isOpen]);
32730
- useEffect53(() => {
32822
+ useEffect54(() => {
32731
32823
  const handleEscape = (e) => {
32732
32824
  if (e.key === "Escape" && isOpen) {
32733
32825
  setIsOpen(false);
@@ -32991,13 +33083,13 @@ function KnowledgeBaseLinksManager({
32991
33083
  }
32992
33084
 
32993
33085
  // src/components/features/loading-provider.tsx
32994
- import { createContext as createContext8, useContext as useContext8, useState as useState69, useEffect as useEffect54 } from "react";
33086
+ import { createContext as createContext8, useContext as useContext8, useState as useState69, useEffect as useEffect55 } from "react";
32995
33087
  import { jsx as jsx244, jsxs as jsxs186 } from "react/jsx-runtime";
32996
33088
  var LoadingContext = createContext8(void 0);
32997
33089
  function LoadingProvider({ children }) {
32998
33090
  const [isLoading, setIsLoading] = useState69(false);
32999
33091
  const [progress, setProgress] = useState69(0);
33000
- useEffect54(() => {
33092
+ useEffect55(() => {
33001
33093
  let interval;
33002
33094
  if (isLoading) {
33003
33095
  setProgress(10);
@@ -33270,7 +33362,7 @@ function OSTypeBadgeGroup({
33270
33362
  }
33271
33363
 
33272
33364
  // src/components/features/parallax-image-showcase.tsx
33273
- import { useEffect as useEffect55, useState as useState71, useRef as useRef40 } from "react";
33365
+ import { useEffect as useEffect56, useState as useState71, useRef as useRef40 } from "react";
33274
33366
  import { motion, useScroll, useTransform, useMotionValue, useSpring } from "framer-motion";
33275
33367
  import { jsx as jsx248, jsxs as jsxs189 } from "react/jsx-runtime";
33276
33368
  var ParallaxImageShowcase = ({
@@ -33290,7 +33382,7 @@ var ParallaxImageShowcase = ({
33290
33382
  const mouseYSpring = useSpring(mouseY, springConfig);
33291
33383
  const [componentRect, setComponentRect] = useState71(null);
33292
33384
  const componentRef = useRef40(null);
33293
- useEffect55(() => {
33385
+ useEffect56(() => {
33294
33386
  const updateRect = () => {
33295
33387
  if (componentRef.current) {
33296
33388
  setComponentRect(componentRef.current.getBoundingClientRect());
@@ -33304,7 +33396,7 @@ var ParallaxImageShowcase = ({
33304
33396
  window.removeEventListener("scroll", updateRect);
33305
33397
  };
33306
33398
  }, []);
33307
- useEffect55(() => {
33399
+ useEffect56(() => {
33308
33400
  const handleGlobalMouseMove = (e) => {
33309
33401
  if (!componentRect) return;
33310
33402
  const centerX = componentRect.left + componentRect.width / 2;
@@ -34812,7 +34904,7 @@ function VideoBitesDisplay({
34812
34904
  // src/components/features/floating-walkthrough-video.tsx
34813
34905
  init_cn();
34814
34906
  init_button2();
34815
- import { useCallback as useCallback28, useEffect as useEffect56, useMemo as useMemo34, useRef as useRef42, useState as useState75 } from "react";
34907
+ import { useCallback as useCallback28, useEffect as useEffect57, useMemo as useMemo35, useRef as useRef42, useState as useState75 } from "react";
34816
34908
  import * as DialogPrimitive3 from "@radix-ui/react-dialog";
34817
34909
  import { Fragment as Fragment48, jsx as jsx261, jsxs as jsxs200 } from "react/jsx-runtime";
34818
34910
  var isAtEnd = (duration, time) => duration > 0 && duration - time < 1;
@@ -34836,7 +34928,7 @@ function FloatingWalkthroughVideo({
34836
34928
  const dismissalId = video?.id != null ? String(video.id) : "dismissed";
34837
34929
  const [mounted, setMounted] = useState75(false);
34838
34930
  const [dismissed, setDismissed] = useState75(false);
34839
- useEffect56(() => {
34931
+ useEffect57(() => {
34840
34932
  let idleHandle = null;
34841
34933
  if (!video) return;
34842
34934
  const timer = setTimeout(() => {
@@ -34859,7 +34951,7 @@ function FloatingWalkthroughVideo({
34859
34951
  };
34860
34952
  }, [appearDelayMs, dismissEnabled, storageKey, dismissalId, video?.id]);
34861
34953
  const [previewSuppressed, setPreviewSuppressed] = useState75(false);
34862
- useEffect56(() => {
34954
+ useEffect57(() => {
34863
34955
  try {
34864
34956
  const reducedMotion = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false;
34865
34957
  const conn = navigator.connection;
@@ -34900,7 +34992,7 @@ function FloatingWalkthroughVideo({
34900
34992
  const isYouTube = Boolean(video?.youtubeUrl);
34901
34993
  const resumeMode = !open && handoff !== null && !isYouTube;
34902
34994
  const previewAllowed = !previewSuppressed && !isYouTube;
34903
- useEffect56(() => {
34995
+ useEffect57(() => {
34904
34996
  if (!mounted) return;
34905
34997
  const el = typeof document !== "undefined" ? document.querySelector(hideNearSelector) : null;
34906
34998
  if (!el || typeof IntersectionObserver === "undefined") {
@@ -34914,7 +35006,7 @@ function FloatingWalkthroughVideo({
34914
35006
  io.observe(el);
34915
35007
  return () => io.disconnect();
34916
35008
  }, [mounted, hideNearSelector, pathname]);
34917
- useEffect56(() => {
35009
+ useEffect57(() => {
34918
35010
  if (!resumeMode) return;
34919
35011
  const onVis = () => {
34920
35012
  if (document.visibilityState === "hidden") {
@@ -34928,7 +35020,7 @@ function FloatingWalkthroughVideo({
34928
35020
  document.addEventListener("visibilitychange", onVis);
34929
35021
  return () => document.removeEventListener("visibilitychange", onVis);
34930
35022
  }, [resumeMode]);
34931
- useEffect56(() => {
35023
+ useEffect57(() => {
34932
35024
  if (!footerHidden) return;
34933
35025
  const h = resumeHandleRef.current ?? previewHandleRef.current;
34934
35026
  try {
@@ -35076,13 +35168,13 @@ function FloatingWalkthroughVideo({
35076
35168
  setCardFallback(s);
35077
35169
  setCardMuted(s.muted);
35078
35170
  }, []);
35079
- useEffect56(() => {
35171
+ useEffect57(() => {
35080
35172
  if (resumeMode) {
35081
35173
  setCardMuted(handoff?.muted ?? false);
35082
35174
  setCardPaused(handoff?.playing === false);
35083
35175
  }
35084
35176
  }, [resumeMode]);
35085
- useEffect56(() => {
35177
+ useEffect57(() => {
35086
35178
  if (hovered) {
35087
35179
  setCardPaused(false);
35088
35180
  setCardMuted(userMutedRef.current);
@@ -35146,7 +35238,7 @@ function FloatingWalkthroughVideo({
35146
35238
  }, [resumeMode, cardFallback.blocked, cardPaused]);
35147
35239
  const summaryTitle = video?.title || void 0;
35148
35240
  const presenterAvatarSrc = video?.presenterAvatarUrl ?? null;
35149
- const embedUrlKey = useMemo34(() => `${video?.mainVideoUrl ?? ""}|${video?.youtubeUrl ?? ""}`, [video?.mainVideoUrl, video?.youtubeUrl]);
35241
+ const embedUrlKey = useMemo35(() => `${video?.mainVideoUrl ?? ""}|${video?.youtubeUrl ?? ""}`, [video?.mainVideoUrl, video?.youtubeUrl]);
35150
35242
  if (!video || !video.mainVideoUrl && !video.youtubeUrl) return null;
35151
35243
  const showCard = mounted && !dismissed;
35152
35244
  const cardActive = !open && previewAllowed && hovered && !resumeMode;
@@ -35394,6 +35486,7 @@ function FloatingWalkthroughVideo({
35394
35486
  import { useQuery } from "@tanstack/react-query";
35395
35487
  function useWalkthroughVideo(opts) {
35396
35488
  const { endpoint, initialData, enabled = true, transformCaptionsUrl } = opts;
35489
+ const captions = useCaptions();
35397
35490
  const query = useQuery({
35398
35491
  queryKey: ["walkthrough-video", endpoint],
35399
35492
  enabled,
@@ -35419,23 +35512,17 @@ function useWalkthroughVideo(opts) {
35419
35512
  // rewrite here (not in queryFn) means a second consumer of the same
35420
35513
  // endpoint can't inherit this observer's proxied captionsUrl from the cache.
35421
35514
  select: (video) => {
35422
- if (video?.captionsUrl && transformCaptionsUrl && video.captionsUrl.startsWith("/")) {
35515
+ if (!video?.captionsUrl) return video;
35516
+ if (transformCaptionsUrl && video.captionsUrl.startsWith("/")) {
35423
35517
  return { ...video, captionsUrl: transformCaptionsUrl(video.captionsUrl) };
35424
35518
  }
35425
- return video;
35519
+ const rebased = captions.rebase(video.captionsUrl);
35520
+ return rebased === video.captionsUrl ? video : { ...video, captionsUrl: rebased };
35426
35521
  }
35427
35522
  });
35428
35523
  return { video: query.data ?? null, isLoading: query.isLoading };
35429
35524
  }
35430
35525
 
35431
- // src/components/features/captions-url.ts
35432
- function getCaptionsUrl(entityType, entityId, srtContent, options) {
35433
- if (!srtContent) return void 0;
35434
- const hash = `${srtContent.length}-${srtContent.slice(0, 8).replace(/\s/g, "")}`;
35435
- const variant = options?.variant ? `&variant=${options.variant}` : "";
35436
- return `/api/captions/${entityType}/${entityId}?v=${hash}${variant}`;
35437
- }
35438
-
35439
35526
  // src/components/features/video-source-selector.tsx
35440
35527
  import { useState as useState76, useCallback as useCallback29 } from "react";
35441
35528
  import { Upload as Upload4, X as X8, Video as VideoIcon3 } from "lucide-react";
@@ -36943,7 +37030,7 @@ function ViewToggle({
36943
37030
 
36944
37031
  // src/components/features/policy-configuration-panel.tsx
36945
37032
  init_cn();
36946
- import { useEffect as useEffect57, useState as useState78 } from "react";
37033
+ import { useEffect as useEffect58, useState as useState78 } from "react";
36947
37034
  import { ChevronDown as ChevronDown8, Shield as Shield2 } from "lucide-react";
36948
37035
  init_button2();
36949
37036
  import { Fragment as Fragment49, jsx as jsx281, jsxs as jsxs216 } from "react/jsx-runtime";
@@ -37121,7 +37208,7 @@ var PolicyConfigurationPanel = ({
37121
37208
  }) => {
37122
37209
  const [expandedIds, setExpandedIds] = useState78(/* @__PURE__ */ new Set());
37123
37210
  const [bulkLevels, setBulkLevels] = useState78({});
37124
- useEffect57(() => {
37211
+ useEffect58(() => {
37125
37212
  setBulkLevels({});
37126
37213
  }, [editMode]);
37127
37214
  const handleToggle = (categoryId) => {
@@ -37161,7 +37248,7 @@ PolicyConfigurationPanel.displayName = "PolicyConfigurationPanel";
37161
37248
  init_button2();
37162
37249
 
37163
37250
  // src/components/ui/phone-input.tsx
37164
- import { useCallback as useCallback30, useEffect as useEffect58, useMemo as useMemo35, useRef as useRef43, useState as useState79 } from "react";
37251
+ import { useCallback as useCallback30, useEffect as useEffect59, useMemo as useMemo36, useRef as useRef43, useState as useState79 } from "react";
37165
37252
  import { jsx as jsx282, jsxs as jsxs217 } from "react/jsx-runtime";
37166
37253
  function PhoneInput({
37167
37254
  value,
@@ -37173,8 +37260,8 @@ function PhoneInput({
37173
37260
  placeholder = "Phone Number (optional)",
37174
37261
  onKeyDown
37175
37262
  }) {
37176
- const { priority, others } = useMemo35(() => getCountryPhoneData(), []);
37177
- const selectedCountry = useMemo35(
37263
+ const { priority, others } = useMemo36(() => getCountryPhoneData(), []);
37264
+ const selectedCountry = useMemo36(
37178
37265
  () => [...priority, ...others].find((c) => c.code === countryCode),
37179
37266
  [countryCode, priority, others]
37180
37267
  );
@@ -37195,7 +37282,7 @@ function PhoneInput({
37195
37282
  if (debounceRef.current) clearTimeout(debounceRef.current);
37196
37283
  debounceRef.current = setTimeout(() => runValidation(phone), 300);
37197
37284
  }, [runValidation]);
37198
- useEffect58(() => {
37285
+ useEffect59(() => {
37199
37286
  return () => {
37200
37287
  if (debounceRef.current) clearTimeout(debounceRef.current);
37201
37288
  };
@@ -37262,7 +37349,7 @@ function CountryOption({ country }) {
37262
37349
  // src/components/features/waitlist-form.tsx
37263
37350
  init_cn();
37264
37351
  import { getCountries as getCountries2 } from "libphonenumber-js";
37265
- import { useEffect as useEffect59, useState as useState80 } from "react";
37352
+ import { useEffect as useEffect60, useState as useState80 } from "react";
37266
37353
  import { Fragment as Fragment50, jsx as jsx283, jsxs as jsxs218 } from "react/jsx-runtime";
37267
37354
  function WaitlistForm({
37268
37355
  id = "waitlist-form",
@@ -37292,12 +37379,12 @@ function WaitlistForm({
37292
37379
  const [isPhoneInvalid, setIsPhoneInvalid] = useState80(false);
37293
37380
  const [showConsentError, setShowConsentError] = useState80(false);
37294
37381
  const isMailDomainGeneric = hasGenericEmailDomain(email);
37295
- useEffect59(() => {
37382
+ useEffect60(() => {
37296
37383
  if (defaultEmail) {
37297
37384
  setEmail(defaultEmail);
37298
37385
  }
37299
37386
  }, [defaultEmail]);
37300
- useEffect59(() => {
37387
+ useEffect60(() => {
37301
37388
  setIsClient(true);
37302
37389
  if (!geoApiUrl) return;
37303
37390
  const supportedCountries = new Set(getCountries2());
@@ -37685,7 +37772,7 @@ function useOptionalNotifications() {
37685
37772
  }
37686
37773
 
37687
37774
  // src/components/features/notifications/notification-drawer.tsx
37688
- import { useEffect as useEffect63, useRef as useRef46 } from "react";
37775
+ import { useEffect as useEffect64, useRef as useRef46 } from "react";
37689
37776
 
37690
37777
  // src/components/navigation/app-layout-context.ts
37691
37778
  import { createContext as createContext10, useContext as useContext10 } from "react";
@@ -38180,7 +38267,7 @@ init_button2();
38180
38267
  init_cn();
38181
38268
 
38182
38269
  // src/components/features/notifications/notification-tile.tsx
38183
- import { useMemo as useMemo37, useEffect as useEffect62, useState as useState83 } from "react";
38270
+ import { useMemo as useMemo38, useEffect as useEffect63, useState as useState83 } from "react";
38184
38271
  init_cn();
38185
38272
  import { jsx as jsx286, jsxs as jsxs220 } from "react/jsx-runtime";
38186
38273
  var variantBySeverity = {
@@ -38225,10 +38312,10 @@ function NotificationTile({
38225
38312
  const image = imageUrl && imageUrl !== failedImageUrl ? imageUrl : void 0;
38226
38313
  const createdAtDate = new Date(createdAt);
38227
38314
  const createdAtIso = Number.isNaN(createdAtDate.getTime()) ? null : createdAtDate.toISOString();
38228
- const initialElapsed = useMemo37(() => Date.now() - createdAt, [createdAt]);
38315
+ const initialElapsed = useMemo38(() => Date.now() - createdAt, [createdAt]);
38229
38316
  const isLive = !read && !settled && initialElapsed < liveDurationMs;
38230
38317
  const counting = isLive && !paused;
38231
- useEffect62(() => {
38318
+ useEffect63(() => {
38232
38319
  if (!counting) return;
38233
38320
  const remaining = Math.max(0, liveDurationMs - initialElapsed);
38234
38321
  const timer = window.setTimeout(() => {
@@ -38457,7 +38544,7 @@ function DrawerScrollList({
38457
38544
  const sentinelRef = useRef46(null);
38458
38545
  const loadMoreRef = useRef46(loadMore);
38459
38546
  loadMoreRef.current = loadMore;
38460
- useEffect63(() => {
38547
+ useEffect64(() => {
38461
38548
  if (!loadMore || !hasMore || isLoadingMore) return;
38462
38549
  const sentinel = sentinelRef.current;
38463
38550
  const root = scrollRef.current;
@@ -38677,7 +38764,7 @@ function NotificationPopups({
38677
38764
 
38678
38765
  // src/components/features/notifications/approval-request-notification-tile.tsx
38679
38766
  init_button2();
38680
- import { useMemo as useMemo38, useState as useState84 } from "react";
38767
+ import { useMemo as useMemo39, useState as useState84 } from "react";
38681
38768
 
38682
38769
  // src/components/chat/types/chat.types.ts
38683
38770
  var CHAT_TYPE = {
@@ -38897,7 +38984,7 @@ function ApprovalRequestNotificationTile({
38897
38984
  const approval = getApprovalMeta(notification);
38898
38985
  const resolvedStatus = resolutionToStatus(approval?.resolution);
38899
38986
  const status = resolvedStatus !== "pending" ? resolvedStatus : localStatus ?? "pending";
38900
- const batchData = useMemo38(() => approval ? approvalMetaToBatchData(approval) : null, [approval]);
38987
+ const batchData = useMemo39(() => approval ? approvalMetaToBatchData(approval) : null, [approval]);
38901
38988
  const { innerRef, containerStyle } = useCollapsible({ expanded });
38902
38989
  if (!approval || !batchData) return null;
38903
38990
  const tileNotification = {
@@ -38994,12 +39081,12 @@ function useOptionalTimeTracker() {
38994
39081
 
38995
39082
  // src/components/features/time-tracker/time-tracker-panel.tsx
38996
39083
  init_cn();
38997
- import { useEffect as useEffect65, useState as useState87 } from "react";
39084
+ import { useEffect as useEffect66, useState as useState87 } from "react";
38998
39085
  init_button();
38999
39086
  init_split_button();
39000
39087
 
39001
39088
  // src/components/features/time-tracker/use-tracker-clock.ts
39002
- import { useEffect as useEffect64, useState as useState86 } from "react";
39089
+ import { useEffect as useEffect65, useState as useState86 } from "react";
39003
39090
  function formatElapsed(totalMs) {
39004
39091
  const totalSeconds = Math.max(0, Math.floor(totalMs / 1e3));
39005
39092
  const hours = Math.floor(totalSeconds / 3600);
@@ -39010,7 +39097,7 @@ function formatElapsed(totalMs) {
39010
39097
  }
39011
39098
  function useTrackerClock({ status, runningSince, accumulatedMs = 0 }) {
39012
39099
  const [now, setNow] = useState86(() => Date.now());
39013
- useEffect64(() => {
39100
+ useEffect65(() => {
39014
39101
  if (status !== "tracking") return;
39015
39102
  setNow(Date.now());
39016
39103
  const id = setInterval(() => setNow(Date.now()), 1e3);
@@ -39070,7 +39157,7 @@ function TimeTrackerPanel({
39070
39157
  const isActive = status !== "ready";
39071
39158
  const hasContent2 = selectedTicketId != null || notes.trim() !== "";
39072
39159
  const showFieldError = isActive && showValidationError && !hasContent2;
39073
- useEffect65(() => {
39160
+ useEffect66(() => {
39074
39161
  if (status === "ready") setShowValidationError(false);
39075
39162
  }, [status]);
39076
39163
  const handleSubmit = () => {
@@ -39321,7 +39408,7 @@ function LastEntryRow({ entry, onClick }) {
39321
39408
  // src/components/features/time-tracker/time-tracker-header-button.tsx
39322
39409
  init_cn();
39323
39410
  import * as PopoverPrimitive5 from "@radix-ui/react-popover";
39324
- import { useEffect as useEffect66, useRef as useRef47 } from "react";
39411
+ import { useEffect as useEffect67, useRef as useRef47 } from "react";
39325
39412
 
39326
39413
  // src/components/navigation/header-button.tsx
39327
39414
  init_cn();
@@ -39416,10 +39503,10 @@ function TimeTrackerHeaderButton({ className, disabled }) {
39416
39503
  }
39417
39504
  };
39418
39505
  }
39419
- useEffect66(() => {
39506
+ useEffect67(() => {
39420
39507
  if (isOpen) coordination?.notifyDrawerDidOpen(selfHandleRef.current ?? void 0);
39421
39508
  }, [isOpen, coordination]);
39422
- useEffect66(() => {
39509
+ useEffect67(() => {
39423
39510
  if (!selfHandleRef.current) return;
39424
39511
  return coordination?.registerDrawer(selfHandleRef.current);
39425
39512
  }, [coordination]);
@@ -40465,7 +40552,7 @@ function SortableRow({
40465
40552
 
40466
40553
  // src/components/navigation/header.tsx
40467
40554
  init_next_link();
40468
- import React117, { useEffect as useEffect70, useRef as useRef51, useState as useState92 } from "react";
40555
+ import React117, { useEffect as useEffect71, useRef as useRef51, useState as useState92 } from "react";
40469
40556
  init_button2();
40470
40557
 
40471
40558
  // src/components/navigation/mingo-ai-button.tsx
@@ -40646,7 +40733,7 @@ import React116 from "react";
40646
40733
  import { useQueryClient } from "@tanstack/react-query";
40647
40734
 
40648
40735
  // src/components/chat/hooks/use-chat-identity.ts
40649
- import { createContext as createContext13, createElement as createElement2, useContext as useContext13, useEffect as useEffect69, useState as useState91 } from "react";
40736
+ import { createContext as createContext13, createElement as createElement2, useContext as useContext13, useEffect as useEffect70, useState as useState91 } from "react";
40650
40737
  var ANON_DEFAULTS = {
40651
40738
  authTier: "anon",
40652
40739
  source: null,
@@ -40659,7 +40746,7 @@ function useResolveChatIdentity(enabled) {
40659
40746
  const proxyEmail = getEmbedProxyAuth()?.email ?? null;
40660
40747
  const [data, setData] = useState91(ANON_DEFAULTS);
40661
40748
  const [isLoading, setIsLoading] = useState91(enabled);
40662
- useEffect69(() => {
40749
+ useEffect70(() => {
40663
40750
  if (!enabled) return;
40664
40751
  let cancelled = false;
40665
40752
  const ctrl = new AbortController();
@@ -41074,7 +41161,7 @@ function Header2({ config, platform }) {
41074
41161
  const [openDropdowns, setOpenDropdowns] = useState92({});
41075
41162
  const dropdownRefs = useRef51({});
41076
41163
  const triggerRefs = useRef51({});
41077
- useEffect70(() => {
41164
+ useEffect71(() => {
41078
41165
  const handleClickOutside = (event) => {
41079
41166
  const target = event.target;
41080
41167
  if (!target) return;
@@ -41103,14 +41190,14 @@ function Header2({ config, platform }) {
41103
41190
  document.removeEventListener("keydown", handleEscapeKey);
41104
41191
  };
41105
41192
  }, [openDropdowns]);
41106
- useEffect70(() => {
41193
+ useEffect71(() => {
41107
41194
  return () => {
41108
41195
  setOpenDropdowns({});
41109
41196
  dropdownRefs.current = {};
41110
41197
  triggerRefs.current = {};
41111
41198
  };
41112
41199
  }, []);
41113
- useEffect70(() => {
41200
+ useEffect71(() => {
41114
41201
  if (!config.autoHide) {
41115
41202
  setShow(true);
41116
41203
  return;
@@ -41364,7 +41451,7 @@ function Header2({ config, platform }) {
41364
41451
  }
41365
41452
 
41366
41453
  // src/components/navigation/client-only-header.tsx
41367
- import { useState as useState93, useEffect as useEffect71 } from "react";
41454
+ import { useState as useState93, useEffect as useEffect72 } from "react";
41368
41455
 
41369
41456
  // src/components/navigation/header-skeleton.tsx
41370
41457
  import { Fragment as Fragment59, jsx as jsx308, jsxs as jsxs237 } from "react/jsx-runtime";
@@ -41404,7 +41491,7 @@ function HeaderSkeleton({ config }) {
41404
41491
  import { jsx as jsx309 } from "react/jsx-runtime";
41405
41492
  function ClientOnlyHeader({ config, skeleton }) {
41406
41493
  const [isClient, setIsClient] = useState93(false);
41407
- useEffect71(() => {
41494
+ useEffect72(() => {
41408
41495
  setIsClient(true);
41409
41496
  }, []);
41410
41497
  if (!isClient) {
@@ -41414,7 +41501,7 @@ function ClientOnlyHeader({ config, skeleton }) {
41414
41501
  }
41415
41502
 
41416
41503
  // src/components/navigation/sliding-sidebar.tsx
41417
- import { useState as useState94, useEffect as useEffect72, useRef as useRef52 } from "react";
41504
+ import { useState as useState94, useEffect as useEffect73, useRef as useRef52 } from "react";
41418
41505
  import { motion as motion2, AnimatePresence, useReducedMotion } from "framer-motion";
41419
41506
  import { usePreventScroll as usePreventScroll3 } from "@react-aria/overlays";
41420
41507
  init_button2();
@@ -41427,7 +41514,7 @@ function SlidingSidebar({ config }) {
41427
41514
  const prefersReducedMotion2 = useReducedMotion();
41428
41515
  usePreventScroll3({ isDisabled: !config.isOpen });
41429
41516
  useFocusTrap(asideRef, config.isOpen, { onEscape: config.onClose, contain: false });
41430
- useEffect72(() => {
41517
+ useEffect73(() => {
41431
41518
  setMounted(true);
41432
41519
  }, []);
41433
41520
  const toggleExpanded = (itemId) => {
@@ -41595,7 +41682,7 @@ function SlidingSidebar({ config }) {
41595
41682
  }
41596
41683
 
41597
41684
  // src/components/navigation/sticky-section-nav.tsx
41598
- import { useEffect as useEffect73, useState as useState95, useCallback as useCallback37, useRef as useRef53 } from "react";
41685
+ import { useEffect as useEffect74, useState as useState95, useCallback as useCallback37, useRef as useRef53 } from "react";
41599
41686
  import { jsx as jsx311, jsxs as jsxs239 } from "react/jsx-runtime";
41600
41687
  function StickySectionNav({
41601
41688
  sections,
@@ -41669,14 +41756,14 @@ function useSectionNavigation(sections, options) {
41669
41756
  isScrollingFromClick.current = false;
41670
41757
  }, 500);
41671
41758
  }, [offset2]);
41672
- useEffect73(() => {
41759
+ useEffect74(() => {
41673
41760
  sections.forEach((section) => {
41674
41761
  if (section.ref.current && !section.ref.current.id) {
41675
41762
  section.ref.current.id = section.id;
41676
41763
  }
41677
41764
  });
41678
41765
  }, [sections]);
41679
- useEffect73(() => {
41766
+ useEffect74(() => {
41680
41767
  const handleScroll = () => {
41681
41768
  if (isScrollingFromClick.current) return;
41682
41769
  const scrollPosition = window.scrollY + offset2 + 50;
@@ -41709,7 +41796,7 @@ function useSectionNavigation(sections, options) {
41709
41796
  }
41710
41797
 
41711
41798
  // src/components/navigation/navigation-sidebar.tsx
41712
- import { useCallback as useCallback38, useEffect as useEffect74, useMemo as useMemo42, useState as useState96 } from "react";
41799
+ import { useCallback as useCallback38, useEffect as useEffect75, useMemo as useMemo43, useState as useState96 } from "react";
41713
41800
 
41714
41801
  // src/components/navigation/navigation-sidebar-header.tsx
41715
41802
  import { jsx as jsx312, jsxs as jsxs240 } from "react/jsx-runtime";
@@ -41881,11 +41968,11 @@ function NavigationSidebar({ config, disabled = false }) {
41881
41968
  config.minimized ?? false
41882
41969
  );
41883
41970
  const [tabletMinimized, setTabletMinimized] = useState96(true);
41884
- useEffect74(() => {
41971
+ useEffect75(() => {
41885
41972
  if (isTablet) setTabletMinimized(true);
41886
41973
  }, [isTablet]);
41887
41974
  const [hydrated, setHydrated] = useState96(false);
41888
- useEffect74(() => setHydrated(true), []);
41975
+ useEffect75(() => setHydrated(true), []);
41889
41976
  const minimized = hydrated ? isTablet ? tabletMinimized : desktopMinimized : config.minimized ?? false;
41890
41977
  const [transitionsEnabled, setTransitionsEnabled] = useState96(false);
41891
41978
  const isOverlayOpen = isTablet && !minimized;
@@ -41901,7 +41988,7 @@ function NavigationSidebar({ config, disabled = false }) {
41901
41988
  const closeOverlay = useCallback38(() => {
41902
41989
  setTabletMinimized(true);
41903
41990
  }, []);
41904
- useEffect74(() => {
41991
+ useEffect75(() => {
41905
41992
  if (!isOverlayOpen) return;
41906
41993
  const handleKeyDown = (e) => {
41907
41994
  if (e.key === "Escape") closeOverlay();
@@ -41910,11 +41997,11 @@ function NavigationSidebar({ config, disabled = false }) {
41910
41997
  return () => document.removeEventListener("keydown", handleKeyDown);
41911
41998
  }, [isOverlayOpen, closeOverlay]);
41912
41999
  const [pendingItemId, setPendingItemId] = useState96(null);
41913
- const committedActiveId = useMemo42(
42000
+ const committedActiveId = useMemo43(
41914
42001
  () => config.items.find((item) => item.isActive)?.id ?? null,
41915
42002
  [config.items]
41916
42003
  );
41917
- useEffect74(() => {
42004
+ useEffect75(() => {
41918
42005
  setPendingItemId(null);
41919
42006
  }, [committedActiveId]);
41920
42007
  const handleItemClick = useCallback38((item, event) => {
@@ -41933,11 +42020,11 @@ function NavigationSidebar({ config, disabled = false }) {
41933
42020
  }
41934
42021
  if (isTablet) setTabletMinimized(true);
41935
42022
  }, [config, isTablet, committedActiveId]);
41936
- const { primaryItems, secondaryItems } = useMemo42(() => ({
42023
+ const { primaryItems, secondaryItems } = useMemo43(() => ({
41937
42024
  primaryItems: config.items.filter((item) => item.section !== "secondary"),
41938
42025
  secondaryItems: config.items.filter((item) => item.section === "secondary")
41939
42026
  }), [config.items]);
41940
- const loadingRows = useMemo42(() => {
42027
+ const loadingRows = useMemo43(() => {
41941
42028
  if (!config.loading) return null;
41942
42029
  const primary = config.loadingRows?.primary ?? 7;
41943
42030
  const secondary = config.loadingRows?.secondary ?? 2;
@@ -41946,7 +42033,7 @@ function NavigationSidebar({ config, disabled = false }) {
41946
42033
  secondary: Array.from({ length: Math.max(0, secondary) }, (_, i) => `secondary-${i}`)
41947
42034
  };
41948
42035
  }, [config.loading, config.loadingRows?.primary, config.loadingRows?.secondary]);
41949
- const sidebarWidth = useMemo42(
42036
+ const sidebarWidth = useMemo43(
41950
42037
  () => minimized ? `${MINIMIZED_WIDTH}px` : `${EXPANDED_WIDTH}px`,
41951
42038
  [minimized]
41952
42039
  );
@@ -42495,7 +42582,7 @@ function AppHeaderSkeleton({
42495
42582
  }
42496
42583
 
42497
42584
  // src/components/navigation/app-layout.tsx
42498
- import { useCallback as useCallback40, useMemo as useMemo43, useRef as useRef55, useState as useState97 } from "react";
42585
+ import { useCallback as useCallback40, useMemo as useMemo44, useRef as useRef55, useState as useState97 } from "react";
42499
42586
 
42500
42587
  // src/components/navigation/mobile-burger-menu.tsx
42501
42588
  import React122, { useCallback as useCallback39, useRef as useRef54 } from "react";
@@ -42702,7 +42789,7 @@ function AppLayout({
42702
42789
  const handleCloseMobileMenu = useCallback40(() => {
42703
42790
  setMobileMenuOpen(false);
42704
42791
  }, []);
42705
- const drawerCoordination = useMemo43(() => ({
42792
+ const drawerCoordination = useMemo44(() => ({
42706
42793
  notifyDrawerDidOpen: (self) => {
42707
42794
  setMobileMenuOpen(false);
42708
42795
  for (const handle of drawerHandlesRef.current) {
@@ -43787,7 +43874,7 @@ function ServiceCardRowItem({ row }) {
43787
43874
  const [revealed, setRevealed] = useState98(false);
43788
43875
  const { copy, copied } = useCopyToClipboard();
43789
43876
  const { ref: valueRef, isTruncated: valueTruncated } = useIsTruncated(row.value);
43790
- const actions = useMemo44(() => ({ copy: true, open: !!row.href, reveal: !!row.isSecret, ...row.actions }), [row]);
43877
+ const actions = useMemo45(() => ({ copy: true, open: !!row.href, reveal: !!row.isSecret, ...row.actions }), [row]);
43791
43878
  const displayValue = row.isSecret ? /* @__PURE__ */ jsx334(MaskedValue, { value: row.value, isRevealed: revealed }) : /* @__PURE__ */ jsx334("span", { children: row.value });
43792
43879
  const handleCopy = () => copy(row.copyValue ?? row.value);
43793
43880
  const openInNewTab = () => {
@@ -44097,7 +44184,7 @@ var ListLoader = (props) => /* @__PURE__ */ jsx338(ContentLoader, { ...props, va
44097
44184
 
44098
44185
  // src/components/ui/table/table.tsx
44099
44186
  init_cn();
44100
- import { useEffect as useEffect76, useRef as useRef58 } from "react";
44187
+ import { useEffect as useEffect77, useRef as useRef58 } from "react";
44101
44188
  init_pagination();
44102
44189
  init_button2();
44103
44190
 
@@ -44708,10 +44795,10 @@ function TableRow({
44708
44795
  }
44709
44796
 
44710
44797
  // src/components/ui/table/use-table-motion.ts
44711
- import { useEffect as useEffect75, useState as useState99 } from "react";
44798
+ import { useEffect as useEffect76, useState as useState99 } from "react";
44712
44799
  function useTableMotion(enabled) {
44713
44800
  const [runtime, setRuntime] = useState99(null);
44714
- useEffect75(() => {
44801
+ useEffect76(() => {
44715
44802
  if (!enabled || runtime) return;
44716
44803
  let active = true;
44717
44804
  import("framer-motion").then((m) => {
@@ -44860,7 +44947,7 @@ function Table({
44860
44947
  const sentinelRef = useRef58(null);
44861
44948
  const onLoadMoreRef = useRef58(infiniteScroll?.onLoadMore);
44862
44949
  onLoadMoreRef.current = infiniteScroll?.onLoadMore;
44863
- useEffect76(() => {
44950
+ useEffect77(() => {
44864
44951
  if (!infiniteScroll?.hasNextPage || infiniteScroll.isFetchingNextPage) return;
44865
44952
  const sentinel = sentinelRef.current;
44866
44953
  if (!sentinel) return;
@@ -45074,7 +45161,7 @@ function TableTimestampCell({
45074
45161
  // src/components/ui/query-report-table/query-report-table.tsx
45075
45162
  init_cn();
45076
45163
  init_button2();
45077
- import { useMemo as useMemo45 } from "react";
45164
+ import { useMemo as useMemo46 } from "react";
45078
45165
 
45079
45166
  // src/components/ui/query-report-table/query-report-table-header.tsx
45080
45167
  init_cn();
@@ -45312,7 +45399,7 @@ function QueryReportTable({
45312
45399
  tableClassName
45313
45400
  }) {
45314
45401
  const isCompact = variant === "compact";
45315
- const columns = useMemo45(
45402
+ const columns = useMemo46(
45316
45403
  () => deriveColumns(data, columnOrder),
45317
45404
  [data, columnOrder]
45318
45405
  );
@@ -45447,7 +45534,7 @@ import { flexRender } from "@tanstack/react-table";
45447
45534
 
45448
45535
  // src/components/ui/data-table/data-table-column-filter.tsx
45449
45536
  init_cn();
45450
- import { useCallback as useCallback44, useMemo as useMemo46 } from "react";
45537
+ import { useCallback as useCallback44, useMemo as useMemo47 } from "react";
45451
45538
 
45452
45539
  // src/components/ui/data-table/utils.ts
45453
45540
  var BREAKPOINT_ORDER = ["md", "lg", "xl", "2xl"];
@@ -45511,7 +45598,7 @@ function DataTableColumnFilter({
45511
45598
  }) {
45512
45599
  const currentValue = column.getFilterValue();
45513
45600
  const activeCount = currentValue?.length ?? 0;
45514
- const sections = useMemo46(
45601
+ const sections = useMemo47(
45515
45602
  () => [
45516
45603
  {
45517
45604
  id: column.id,
@@ -45523,7 +45610,7 @@ function DataTableColumnFilter({
45523
45610
  ],
45524
45611
  [column.id, label, options]
45525
45612
  );
45526
- const currentFilters = useMemo46(
45613
+ const currentFilters = useMemo47(
45527
45614
  () => ({ [column.id]: currentValue ?? EMPTY_ARRAY }),
45528
45615
  [column.id, currentValue]
45529
45616
  );
@@ -46054,7 +46141,7 @@ function DataTableBody({
46054
46141
  }
46055
46142
 
46056
46143
  // src/components/ui/data-table/data-table-infinite-footer.tsx
46057
- import { useEffect as useEffect77, useRef as useRef62 } from "react";
46144
+ import { useEffect as useEffect78, useRef as useRef62 } from "react";
46058
46145
  import { Fragment as Fragment72, jsx as jsx361, jsxs as jsxs282 } from "react/jsx-runtime";
46059
46146
  function DataTableInfiniteFooter({
46060
46147
  hasNextPage,
@@ -46066,7 +46153,7 @@ function DataTableInfiniteFooter({
46066
46153
  const sentinelRef = useRef62(null);
46067
46154
  const onLoadMoreRef = useRef62(onLoadMore);
46068
46155
  onLoadMoreRef.current = onLoadMore;
46069
- useEffect77(() => {
46156
+ useEffect78(() => {
46070
46157
  if (!hasNextPage || isFetchingNextPage) return;
46071
46158
  const sentinel = sentinelRef.current;
46072
46159
  if (!sentinel) return;
@@ -46704,7 +46791,7 @@ function FilterList({
46704
46791
 
46705
46792
  // src/components/ui/tag-search-input.tsx
46706
46793
  import {
46707
- useEffect as useEffect79,
46794
+ useEffect as useEffect80,
46708
46795
  useRef as useRef64,
46709
46796
  useState as useState103
46710
46797
  } from "react";
@@ -46744,7 +46831,7 @@ function TagSearchInput({
46744
46831
  const hiddenTagsRef = useRef64(null);
46745
46832
  const hiddenTagsPopupRef = useRef64(null);
46746
46833
  const [showHiddenTags, setShowHiddenTags] = useState103(false);
46747
- useEffect79(() => {
46834
+ useEffect80(() => {
46748
46835
  if (!showHiddenTags) return;
46749
46836
  const handleClick = (e) => {
46750
46837
  const target = e.target;
@@ -46906,7 +46993,7 @@ function TagSearchInput({
46906
46993
  }
46907
46994
 
46908
46995
  // src/components/ui/markdown-editor.tsx
46909
- import { useRef as useRef65, useCallback as useCallback46, useState as useState104, useEffect as useEffect80 } from "react";
46996
+ import { useRef as useRef65, useCallback as useCallback46, useState as useState104, useEffect as useEffect81 } from "react";
46910
46997
  init_cn();
46911
46998
  import { Loader2 as Loader28, Upload as Upload8 } from "lucide-react";
46912
46999
  import { jsx as jsx366, jsxs as jsxs287 } from "react/jsx-runtime";
@@ -46937,7 +47024,7 @@ body .w-md-editor .w-md-editor-bar::after { content: '' !important; display: blo
46937
47024
  body .w-md-editor .w-md-editor-bar:hover::after { border-color: var(--color-text-secondary) !important; }
46938
47025
  `;
46939
47026
  function MarkdownEditorStyles() {
46940
- useEffect80(() => {
47027
+ useEffect81(() => {
46941
47028
  if (document.getElementById(MARKDOWN_EDITOR_STYLE_ID)) return;
46942
47029
  const style = document.createElement("style");
46943
47030
  style.id = MARKDOWN_EDITOR_STYLE_ID;
@@ -46965,7 +47052,7 @@ function MarkdownEditor({
46965
47052
  const [isUploading, setIsUploading] = useState104(false);
46966
47053
  const [uploadProgress, setUploadProgress] = useState104("");
46967
47054
  const [defaultExtraCommands, setDefaultExtraCommands] = useState104([]);
46968
- useEffect80(() => {
47055
+ useEffect81(() => {
46969
47056
  import("@uiw/react-md-editor").then((mod) => {
46970
47057
  if (mod.commands?.getExtraCommands) {
46971
47058
  setDefaultExtraCommands(mod.commands.getExtraCommands());
@@ -47088,7 +47175,7 @@ function MarkdownEditor({
47088
47175
  }
47089
47176
  rafRef.current = requestAnimationFrame(scrollLoop);
47090
47177
  }, []);
47091
- useEffect80(() => {
47178
+ useEffect81(() => {
47092
47179
  const wrapper = wrapperRef.current;
47093
47180
  if (!wrapper) return;
47094
47181
  const onMouseMove = (e) => {
@@ -49051,7 +49138,7 @@ function ImageGalleryModal({
49051
49138
  initialIndex = 0
49052
49139
  }) {
49053
49140
  const [selectedImageIndex, setSelectedImageIndex] = useState115(initialIndex);
49054
- useEffect87(() => {
49141
+ useEffect88(() => {
49055
49142
  if (isOpen) {
49056
49143
  setSelectedImageIndex(initialIndex);
49057
49144
  }
@@ -49066,7 +49153,7 @@ function ImageGalleryModal({
49066
49153
  setSelectedImageIndex(selectedImageIndex + 1);
49067
49154
  }
49068
49155
  };
49069
- useEffect87(() => {
49156
+ useEffect88(() => {
49070
49157
  const handleKeyPress = (event) => {
49071
49158
  if (!isOpen) return;
49072
49159
  switch (event.key) {
@@ -52374,10 +52461,12 @@ function itemVideoMetadata(item) {
52374
52461
  item?.highlight_video_thumbnail,
52375
52462
  item?.featured_image
52376
52463
  );
52464
+ const highlightVideoPoster = pick(m.highlightVideoPoster, item?.highlight_video_thumbnail);
52377
52465
  if (videoUrl) out.videoUrl = videoUrl;
52378
52466
  if (youtubeUrl) out.youtubeUrl = youtubeUrl;
52379
52467
  if (highlightVideoUrl) out.highlightVideoUrl = highlightVideoUrl;
52380
52468
  if (videoPoster) out.videoPoster = videoPoster;
52469
+ if (highlightVideoPoster) out.highlightVideoPoster = highlightVideoPoster;
52381
52470
  return out.videoUrl || out.youtubeUrl || out.highlightVideoUrl ? out : null;
52382
52471
  }
52383
52472
  function CardLoadFailure({
@@ -53655,7 +53744,7 @@ function useChunkCatchup({
53655
53744
  }
53656
53745
 
53657
53746
  // src/components/chat/hooks/use-scripted-stream.ts
53658
- import { useEffect as useEffect88, useState as useState118 } from "react";
53747
+ import { useEffect as useEffect89, useState as useState118 } from "react";
53659
53748
  var EMPTY_FRAME = { messages: [], phase: "idle", typing: false, delayMs: 0 };
53660
53749
  function prefersReducedMotion() {
53661
53750
  return typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches === true;
@@ -53668,7 +53757,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
53668
53757
  setPrevKey(resetKey);
53669
53758
  setIndex(0);
53670
53759
  }
53671
- useEffect88(() => {
53760
+ useEffect89(() => {
53672
53761
  setReducedMotion(prefersReducedMotion());
53673
53762
  const mq = window.matchMedia?.("(prefers-reduced-motion: reduce)");
53674
53763
  if (!mq) return;
@@ -53678,7 +53767,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
53678
53767
  }, []);
53679
53768
  const playing = enabled && !reducedMotion && frames.length > 0;
53680
53769
  const lastIndex = Math.max(0, frames.length - 1);
53681
- useEffect88(() => {
53770
+ useEffect89(() => {
53682
53771
  if (!playing || index >= lastIndex) return;
53683
53772
  const current = frames[Math.min(index, lastIndex)] ?? EMPTY_FRAME;
53684
53773
  const t = setTimeout(() => setIndex((i) => Math.min(i + 1, lastIndex)), current.delayMs);
@@ -53690,7 +53779,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
53690
53779
  }
53691
53780
 
53692
53781
  // src/components/chat/hooks/use-jetstream-dialog-subscription.ts
53693
- import { useCallback as useCallback50, useEffect as useEffect89, useRef as useRef70, useState as useState119 } from "react";
53782
+ import { useCallback as useCallback50, useEffect as useEffect90, useRef as useRef70, useState as useState119 } from "react";
53694
53783
  var DEFAULT_STREAM_NAME = "CHAT_CHUNKS";
53695
53784
  var RESYNC_AFTER_HIDDEN_MS = 1e4;
53696
53785
  var RESYNC_COALESCE_MS = 1e3;
@@ -53724,49 +53813,49 @@ function useJetStreamDialogSubscription({
53724
53813
  const subscriptionRef = useRef70(null);
53725
53814
  const highestStreamSeqRef = useRef70(null);
53726
53815
  const onEventRef = useRef70(onEvent);
53727
- useEffect89(() => {
53816
+ useEffect90(() => {
53728
53817
  onEventRef.current = onEvent;
53729
53818
  }, [onEvent]);
53730
53819
  const onConnectRef = useRef70(onConnect);
53731
- useEffect89(() => {
53820
+ useEffect90(() => {
53732
53821
  onConnectRef.current = onConnect;
53733
53822
  }, [onConnect]);
53734
53823
  const onDisconnectRef = useRef70(onDisconnect);
53735
- useEffect89(() => {
53824
+ useEffect90(() => {
53736
53825
  onDisconnectRef.current = onDisconnect;
53737
53826
  }, [onDisconnect]);
53738
53827
  const onSubscribedRef = useRef70(onSubscribed);
53739
- useEffect89(() => {
53828
+ useEffect90(() => {
53740
53829
  onSubscribedRef.current = onSubscribed;
53741
53830
  }, [onSubscribed]);
53742
53831
  const onBeforeReconnectRef = useRef70(onBeforeReconnect);
53743
- useEffect89(() => {
53832
+ useEffect90(() => {
53744
53833
  onBeforeReconnectRef.current = onBeforeReconnect;
53745
53834
  }, [onBeforeReconnect]);
53746
53835
  const getNatsWsUrlRef = useRef70(getNatsWsUrl);
53747
- useEffect89(() => {
53836
+ useEffect90(() => {
53748
53837
  getNatsWsUrlRef.current = getNatsWsUrl;
53749
53838
  }, [getNatsWsUrl]);
53750
53839
  const reconnectionBackoffRef = useRef70(reconnectionBackoff);
53751
- useEffect89(() => {
53840
+ useEffect90(() => {
53752
53841
  reconnectionBackoffRef.current = reconnectionBackoff;
53753
53842
  }, [reconnectionBackoff]);
53754
53843
  const optStartSeqRef = useRef70(optStartSeq);
53755
- useEffect89(() => {
53844
+ useEffect90(() => {
53756
53845
  optStartSeqRef.current = optStartSeq;
53757
53846
  }, [optStartSeq]);
53758
53847
  const inactiveThresholdRef = useRef70(inactiveThresholdMs);
53759
- useEffect89(() => {
53848
+ useEffect90(() => {
53760
53849
  inactiveThresholdRef.current = inactiveThresholdMs;
53761
53850
  }, [inactiveThresholdMs]);
53762
53851
  const hadConnectionBeforeRef = useRef70(false);
53763
53852
  const clientConfigRef = useRef70(clientConfig);
53764
- useEffect89(() => {
53853
+ useEffect90(() => {
53765
53854
  clientConfigRef.current = clientConfig;
53766
53855
  }, [clientConfig]);
53767
53856
  const currentWsUrlRef = useRef70("");
53768
53857
  const wsUrl = getNatsWsUrl();
53769
- useEffect89(() => {
53858
+ useEffect90(() => {
53770
53859
  if (!enabled || !wsUrl) {
53771
53860
  if (currentWsUrlRef.current && clientRef.current) {
53772
53861
  releaseClient(currentWsUrlRef.current);
@@ -53847,7 +53936,7 @@ function useJetStreamDialogSubscription({
53847
53936
  }
53848
53937
  };
53849
53938
  }, [enabled, wsUrl]);
53850
- useEffect89(() => {
53939
+ useEffect90(() => {
53851
53940
  highestStreamSeqRef.current = null;
53852
53941
  lastResyncSignalRef.current = resyncSignal;
53853
53942
  setCurrentStreamSeq(null);
@@ -53865,7 +53954,7 @@ function useJetStreamDialogSubscription({
53865
53954
  setReconnectionCount((c) => c + 1);
53866
53955
  }, RESYNC_COALESCE_MS);
53867
53956
  }, []);
53868
- useEffect89(() => {
53957
+ useEffect90(() => {
53869
53958
  if (!enabled) return;
53870
53959
  let hiddenSince = document.visibilityState === "hidden" ? Date.now() : 0;
53871
53960
  const onVisibilityChange = () => {
@@ -53882,13 +53971,13 @@ function useJetStreamDialogSubscription({
53882
53971
  document.addEventListener("visibilitychange", onVisibilityChange);
53883
53972
  return () => document.removeEventListener("visibilitychange", onVisibilityChange);
53884
53973
  }, [enabled, requestResync]);
53885
- useEffect89(() => {
53974
+ useEffect90(() => {
53886
53975
  if (!enabled) return;
53887
53976
  if (resyncSignal <= lastResyncSignalRef.current) return;
53888
53977
  lastResyncSignalRef.current = resyncSignal;
53889
53978
  requestResync();
53890
53979
  }, [enabled, resyncSignal, requestResync]);
53891
- useEffect89(() => {
53980
+ useEffect90(() => {
53892
53981
  if (!enabled || !dialogId || !isConnected) {
53893
53982
  if (subscriptionRef.current) {
53894
53983
  try {
@@ -53989,7 +54078,7 @@ function useJetStreamDialogSubscription({
53989
54078
  }
53990
54079
 
53991
54080
  // src/components/chat/hooks/use-nats-dialog-subscription.ts
53992
- import { useEffect as useEffect90, useRef as useRef71, useState as useState120 } from "react";
54081
+ import { useEffect as useEffect91, useRef as useRef71, useState as useState120 } from "react";
53993
54082
  function useNatsDialogSubscription({
53994
54083
  enabled,
53995
54084
  dialogId,
@@ -54009,41 +54098,41 @@ function useNatsDialogSubscription({
54009
54098
  const clientRef = useRef71(null);
54010
54099
  const subscriptionRefs = useRef71(/* @__PURE__ */ new Map());
54011
54100
  const onEventRef = useRef71(onEvent);
54012
- useEffect90(() => {
54101
+ useEffect91(() => {
54013
54102
  onEventRef.current = onEvent;
54014
54103
  }, [onEvent]);
54015
54104
  const onConnectRef = useRef71(onConnect);
54016
- useEffect90(() => {
54105
+ useEffect91(() => {
54017
54106
  onConnectRef.current = onConnect;
54018
54107
  }, [onConnect]);
54019
54108
  const onDisconnectRef = useRef71(onDisconnect);
54020
- useEffect90(() => {
54109
+ useEffect91(() => {
54021
54110
  onDisconnectRef.current = onDisconnect;
54022
54111
  }, [onDisconnect]);
54023
54112
  const onSubscribedRef = useRef71(onSubscribed);
54024
- useEffect90(() => {
54113
+ useEffect91(() => {
54025
54114
  onSubscribedRef.current = onSubscribed;
54026
54115
  }, [onSubscribed]);
54027
54116
  const onBeforeReconnectRef = useRef71(onBeforeReconnect);
54028
- useEffect90(() => {
54117
+ useEffect91(() => {
54029
54118
  onBeforeReconnectRef.current = onBeforeReconnect;
54030
54119
  }, [onBeforeReconnect]);
54031
54120
  const hadConnectionBeforeRef = useRef71(false);
54032
54121
  const getNatsWsUrlRef = useRef71(getNatsWsUrl);
54033
- useEffect90(() => {
54122
+ useEffect91(() => {
54034
54123
  getNatsWsUrlRef.current = getNatsWsUrl;
54035
54124
  }, [getNatsWsUrl]);
54036
54125
  const reconnectionBackoffRef = useRef71(reconnectionBackoff);
54037
- useEffect90(() => {
54126
+ useEffect91(() => {
54038
54127
  reconnectionBackoffRef.current = reconnectionBackoff;
54039
54128
  }, [reconnectionBackoff]);
54040
54129
  const clientConfigRef = useRef71(clientConfig);
54041
- useEffect90(() => {
54130
+ useEffect91(() => {
54042
54131
  clientConfigRef.current = clientConfig;
54043
54132
  }, [clientConfig]);
54044
54133
  const currentWsUrlRef = useRef71("");
54045
54134
  const wsUrl = getNatsWsUrl();
54046
- useEffect90(() => {
54135
+ useEffect91(() => {
54047
54136
  if (!enabled || !wsUrl) {
54048
54137
  if (currentWsUrlRef.current && clientRef.current) {
54049
54138
  releaseClient(currentWsUrlRef.current);
@@ -54129,12 +54218,12 @@ function useNatsDialogSubscription({
54129
54218
  topicsRef.current = topics;
54130
54219
  const lastSubscribedDialogIdRef = useRef71(null);
54131
54220
  const isConnectedRef = useRef71(isConnected);
54132
- useEffect90(() => {
54221
+ useEffect91(() => {
54133
54222
  isConnectedRef.current = isConnected;
54134
54223
  }, [isConnected]);
54135
54224
  const currentDialogIdRef = useRef71(null);
54136
54225
  const abortControllerRef = useRef71(null);
54137
- useEffect90(() => {
54226
+ useEffect91(() => {
54138
54227
  currentDialogIdRef.current = dialogId;
54139
54228
  if (!enabled || !dialogId) {
54140
54229
  if (subscriptionRefs.current.size > 0) {
@@ -54215,7 +54304,7 @@ function useNatsDialogSubscription({
54215
54304
  abortControllerRef.current = null;
54216
54305
  };
54217
54306
  }, [enabled, dialogId, topicsKey]);
54218
- useEffect90(() => {
54307
+ useEffect91(() => {
54219
54308
  if (!enabled || !currentDialogIdRef.current || !isConnected) {
54220
54309
  return;
54221
54310
  }
@@ -54265,7 +54354,7 @@ function buildNatsWsUrl(apiBaseUrl, options) {
54265
54354
  }
54266
54355
 
54267
54356
  // src/components/chat/hooks/use-slash-commands.ts
54268
- import { useEffect as useEffect91, useState as useState121 } from "react";
54357
+ import { useEffect as useEffect92, useState as useState121 } from "react";
54269
54358
  import { useQuery as useQuery3 } from "@tanstack/react-query";
54270
54359
  async function fetchSlashCommands(prefix, signal, commandsUrl) {
54271
54360
  try {
@@ -54284,7 +54373,7 @@ async function fetchSlashCommands(prefix, signal, commandsUrl) {
54284
54373
  function useSlashCommands(prefix, commandsUrl) {
54285
54374
  const [commands, setCommands] = useState121([]);
54286
54375
  const [loading, setLoading] = useState121(false);
54287
- useEffect91(() => {
54376
+ useEffect92(() => {
54288
54377
  if (prefix == null) {
54289
54378
  setCommands([]);
54290
54379
  return;
@@ -54390,7 +54479,7 @@ function useEmptyStateConfig(emptyStateUrl, options) {
54390
54479
  }
54391
54480
 
54392
54481
  // src/components/chat/hooks/use-chat-attachments.ts
54393
- import { useCallback as useCallback51, useMemo as useMemo50, useRef as useRef72, useState as useState122 } from "react";
54482
+ import { useCallback as useCallback51, useMemo as useMemo51, useRef as useRef72, useState as useState122 } from "react";
54394
54483
  import { fileTypeFromBlob } from "file-type";
54395
54484
  var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
54396
54485
  var CHAT_ATTACHMENTS_FOLDER = "chat";
@@ -54607,7 +54696,7 @@ function useChatAttachments() {
54607
54696
  },
54608
54697
  [uploadOne]
54609
54698
  );
54610
- const readyAttachments = useMemo50(
54699
+ const readyAttachments = useMemo51(
54611
54700
  () => attachments.filter(
54612
54701
  (a) => a.status === "ready" && !!a.storagePath && !!a.viewToken
54613
54702
  ).map((a) => ({
@@ -54633,7 +54722,7 @@ function useChatAttachments() {
54633
54722
  }
54634
54723
 
54635
54724
  // src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
54636
- import { useCallback as useCallback52, useEffect as useEffect92, useRef as useRef73, useState as useState123 } from "react";
54725
+ import { useCallback as useCallback52, useEffect as useEffect93, useRef as useRef73, useState as useState123 } from "react";
54637
54726
  import { jsx as jsx395 } from "react/jsx-runtime";
54638
54727
  var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
54639
54728
  function useChatAttachmentImageGallery() {
@@ -54642,7 +54731,7 @@ function useChatAttachmentImageGallery() {
54642
54731
  const panelRef = useRef73(null);
54643
54732
  const [state, setState] = useState123(CLOSED);
54644
54733
  const handleClose = useCallback52(() => setState(CLOSED), []);
54645
- useEffect92(() => {
54734
+ useEffect93(() => {
54646
54735
  const root = panelRef.current;
54647
54736
  if (!root) return;
54648
54737
  const onClick = (ev) => {
@@ -54688,11 +54777,11 @@ function absolutize(prefix) {
54688
54777
  }
54689
54778
 
54690
54779
  // src/components/chat/hooks/use-close-on-navigation.ts
54691
- import { useEffect as useEffect93, useRef as useRef74 } from "react";
54780
+ import { useEffect as useEffect94, useRef as useRef74 } from "react";
54692
54781
  function useCloseOnNavigation(close, pathname) {
54693
54782
  const prevPathnameRef = useRef74(null);
54694
54783
  const initializedRef = useRef74(false);
54695
- useEffect93(() => {
54784
+ useEffect94(() => {
54696
54785
  if (!initializedRef.current) {
54697
54786
  initializedRef.current = true;
54698
54787
  prevPathnameRef.current = pathname;
@@ -54706,7 +54795,7 @@ function useCloseOnNavigation(close, pathname) {
54706
54795
  }
54707
54796
 
54708
54797
  // src/components/chat/hooks/use-chat.ts
54709
- import { useState as useState125, useCallback as useCallback54, useEffect as useEffect94, useRef as useRef76 } from "react";
54798
+ import { useState as useState125, useCallback as useCallback54, useEffect as useEffect95, useRef as useRef76 } from "react";
54710
54799
 
54711
54800
  // src/components/chat/hooks/use-sse.ts
54712
54801
  import { useState as useState124, useCallback as useCallback53, useRef as useRef75 } from "react";
@@ -54784,7 +54873,7 @@ function useChat({
54784
54873
  const currentAssistantSegmentsRef = useRef76([]);
54785
54874
  const onMessagesChangeRef = useRef76(onMessagesChange);
54786
54875
  onMessagesChangeRef.current = onMessagesChange;
54787
- useEffect94(() => {
54876
+ useEffect95(() => {
54788
54877
  onMessagesChangeRef.current?.(messages);
54789
54878
  }, [messages]);
54790
54879
  const {
@@ -55054,7 +55143,7 @@ function useChat({
55054
55143
  }
55055
55144
 
55056
55145
  // src/components/chat/hooks/use-sse-chat-adapter.ts
55057
- import { useCallback as useCallback56, useMemo as useMemo52, useRef as useRef79 } from "react";
55146
+ import { useCallback as useCallback56, useMemo as useMemo53, useRef as useRef79 } from "react";
55058
55147
 
55059
55148
  // src/chat-protocol/confirm-tool.ts
55060
55149
  function buildConfirmToolBody(request) {
@@ -55321,7 +55410,7 @@ function pruneStaleChatConversationStorage(source) {
55321
55410
  }
55322
55411
 
55323
55412
  // src/components/chat/hooks/use-chat-history-hydration.ts
55324
- import { useEffect as useEffect95, useRef as useRef77, useState as useState126 } from "react";
55413
+ import { useEffect as useEffect96, useRef as useRef77, useState as useState126 } from "react";
55325
55414
  function useChatHistoryHydration({
55326
55415
  active,
55327
55416
  source,
@@ -55333,7 +55422,7 @@ function useChatHistoryHydration({
55333
55422
  }) {
55334
55423
  const [isHydratingHistory, setIsHydratingHistory] = useState126(false);
55335
55424
  const hydratedKeyRef = useRef77(null);
55336
- useEffect95(() => {
55425
+ useEffect96(() => {
55337
55426
  if (!active) return;
55338
55427
  const conversationId = conversationIdRef.current;
55339
55428
  if (!conversationId) return;
@@ -57519,7 +57608,7 @@ function createChatDialogStore(options = {}) {
57519
57608
  }
57520
57609
 
57521
57610
  // src/components/chat/stream/use-chat-stream-reducer.ts
57522
- import { useCallback as useCallback55, useEffect as useEffect96, useMemo as useMemo51, useRef as useRef78, useSyncExternalStore } from "react";
57611
+ import { useCallback as useCallback55, useEffect as useEffect97, useMemo as useMemo52, useRef as useRef78, useSyncExternalStore } from "react";
57523
57612
 
57524
57613
  // src/components/chat/stream/delta-batcher.ts
57525
57614
  var DELTA_FLUSH_FALLBACK_MS = 50;
@@ -57615,7 +57704,7 @@ function useChatStreamReducer({
57615
57704
  const getServerSnapshot = useCallback55(() => store.getServerSnapshot(), [store]);
57616
57705
  const subscribe = useCallback55((listener) => store.subscribe(listener), [store]);
57617
57706
  const state = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
57618
- useEffect96(() => store.retain(dialogId, side), [store, dialogId, side]);
57707
+ useEffect97(() => store.retain(dialogId, side), [store, dialogId, side]);
57619
57708
  const keyRef = useRef78({ dialogId, side });
57620
57709
  if (keyRef.current.dialogId !== dialogId || keyRef.current.side !== side) {
57621
57710
  keyRef.current = { dialogId, side };
@@ -57640,12 +57729,12 @@ function useChatStreamReducer({
57640
57729
  },
57641
57730
  [batcher, store, dialogId, side]
57642
57731
  );
57643
- useEffect96(() => () => batcher.dispose(), [batcher]);
57732
+ useEffect97(() => () => batcher.dispose(), [batcher]);
57644
57733
  const mutate = useCallback55(
57645
57734
  (fn) => store.mutate(dialogId, side, fn),
57646
57735
  [store, dialogId, side]
57647
57736
  );
57648
- return useMemo51(
57737
+ return useMemo52(
57649
57738
  () => ({ state, applyEvent, flushDeltas, mutate, reducer: reducer2 }),
57650
57739
  [state, applyEvent, flushDeltas, mutate, reducer2]
57651
57740
  );
@@ -57682,8 +57771,8 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
57682
57771
  },
57683
57772
  []
57684
57773
  );
57685
- const cardApprove = useMemo52(() => cardResolve("approve"), [cardResolve]);
57686
- const cardReject = useMemo52(() => cardResolve("reject"), [cardResolve]);
57774
+ const cardApprove = useMemo53(() => cardResolve("approve"), [cardResolve]);
57775
+ const cardReject = useMemo53(() => cardResolve("reject"), [cardResolve]);
57687
57776
  const createReducerOptions = useCallback56(
57688
57777
  () => ({
57689
57778
  transport: "sse",
@@ -57699,7 +57788,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
57699
57788
  createReducerOptions
57700
57789
  });
57701
57790
  const abortControllerRef = useRef79(null);
57702
- const conversationStorage = useMemo52(() => createChatConversationStorage(source), [source]);
57791
+ const conversationStorage = useMemo53(() => createChatConversationStorage(source), [source]);
57703
57792
  const conversationIdRef = useRef79(null);
57704
57793
  const restoredConversationRef = useRef79(false);
57705
57794
  if (!restoredConversationRef.current) {
@@ -57711,7 +57800,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
57711
57800
  const { commands: slashCommands } = useSlashCommandRegistry(commandsUrl, {
57712
57801
  enabled: active
57713
57802
  });
57714
- const cmdIdByTableId = useMemo52(() => {
57803
+ const cmdIdByTableId = useMemo53(() => {
57715
57804
  const buckets = /* @__PURE__ */ new Map();
57716
57805
  for (const cmd of slashCommands) {
57717
57806
  if (!cmd.primarySourceId) continue;
@@ -57868,7 +57957,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
57868
57957
  hydrationSendCountRef.current = 0;
57869
57958
  hydratedKeyRef.current = null;
57870
57959
  }, [mutate, conversationStorage, hydratedKeyRef]);
57871
- const docMessages = useMemo52(() => {
57960
+ const docMessages = useMemo53(() => {
57872
57961
  const { meta, sources: sourcesMap } = state.turnMeta;
57873
57962
  let sendIdx = -1;
57874
57963
  return state.messages.map((m) => {
@@ -57942,7 +58031,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
57942
58031
  },
57943
58032
  [sendMessage, tableIdForDocumentType]
57944
58033
  );
57945
- const latestMeta = useMemo52(() => {
58034
+ const latestMeta = useMemo53(() => {
57946
58035
  const { meta, sendCount } = state.turnMeta;
57947
58036
  return meta.get(sendCount - 1) ?? meta.get(sendCount - 2) ?? null;
57948
58037
  }, [state]);
@@ -58021,7 +58110,7 @@ var noopBumpMetaTick = () => {
58021
58110
  };
58022
58111
 
58023
58112
  // src/components/chat/hooks/use-nats-chat-adapter.ts
58024
- import { useCallback as useCallback57, useEffect as useEffect97, useMemo as useMemo53, useRef as useRef80, useState as useState127 } from "react";
58113
+ import { useCallback as useCallback57, useEffect as useEffect98, useMemo as useMemo54, useRef as useRef80, useState as useState127 } from "react";
58025
58114
 
58026
58115
  // src/chat-protocol/nats-decoder.ts
58027
58116
  function normalizeToolCalls(raw) {
@@ -59206,7 +59295,7 @@ function useNatsChatAdapter(config, options = {}) {
59206
59295
  ]
59207
59296
  );
59208
59297
  const prevDialogIdRef = useRef80(void 0);
59209
- useEffect97(() => {
59298
+ useEffect98(() => {
59210
59299
  if (prevDialogIdRef.current === dialogId) return;
59211
59300
  prevDialogIdRef.current = dialogId;
59212
59301
  historyLoadSeqRef.current += 1;
@@ -59219,7 +59308,7 @@ function useNatsChatAdapter(config, options = {}) {
59219
59308
  if (!active || !dialogId) return;
59220
59309
  void loadDialogHistory(dialogId);
59221
59310
  }, [active, dialogId, dialogKey, loadDialogHistory]);
59222
- useEffect97(() => {
59311
+ useEffect98(() => {
59223
59312
  if (!active || !dialogId) return;
59224
59313
  const store = storeRef.current;
59225
59314
  store.mutate(dialogId, DEFAULT_DIALOG_SIDE, (r) => r.adjustAgentBusySuppression(1));
@@ -59282,7 +59371,7 @@ function useNatsChatAdapter(config, options = {}) {
59282
59371
  })();
59283
59372
  }
59284
59373
  });
59285
- useEffect97(() => {
59374
+ useEffect98(() => {
59286
59375
  if (!active || !dialogId) {
59287
59376
  setConnectionState("connected");
59288
59377
  return;
@@ -59321,7 +59410,7 @@ function useNatsChatAdapter(config, options = {}) {
59321
59410
  const reloadDialogs = useCallback57(() => {
59322
59411
  void loadDialogsPage();
59323
59412
  }, [loadDialogsPage]);
59324
- useEffect97(() => {
59413
+ useEffect98(() => {
59325
59414
  if (!fetchDialogs) return;
59326
59415
  if (!active) return;
59327
59416
  if (initialDialogsLoadedRef.current) return;
@@ -59471,7 +59560,7 @@ function useNatsChatAdapter(config, options = {}) {
59471
59560
  const isLoading = streamingPhase !== "idle";
59472
59561
  const hasMoreDialogs = dialogsNextCursor != null;
59473
59562
  const hasMoreMessages = messagesNextCursor != null;
59474
- return useMemo53(
59563
+ return useMemo54(
59475
59564
  () => ({
59476
59565
  messages,
59477
59566
  isLoading,
@@ -59554,7 +59643,7 @@ function useNatsChatAdapter(config, options = {}) {
59554
59643
  }
59555
59644
 
59556
59645
  // src/components/chat/hooks/use-unified-chat.ts
59557
- import { useCallback as useCallback58, useMemo as useMemo54, useRef as useRef81 } from "react";
59646
+ import { useCallback as useCallback58, useMemo as useMemo55, useRef as useRef81 } from "react";
59558
59647
  var EMPTY_SSE_OPTIONS = {};
59559
59648
  function createDisabledNatsConfig() {
59560
59649
  return {
@@ -59646,7 +59735,7 @@ function useUnifiedChat(options) {
59646
59735
  (requestId, reason) => activeStateRef.current.rejectRequest(requestId, reason),
59647
59736
  []
59648
59737
  );
59649
- return useMemo54(
59738
+ return useMemo55(
59650
59739
  () => ({
59651
59740
  messages: activeState.messages,
59652
59741
  isLoading: activeState.isLoading,
@@ -59985,7 +60074,7 @@ function buildStreamFrames(messages) {
59985
60074
 
59986
60075
  // src/components/chat/embeddable-chat.tsx
59987
60076
  init_cn();
59988
- import { useCallback as useCallback60, useEffect as useEffect98, useMemo as useMemo56, useRef as useRef83, useState as useState129 } from "react";
60077
+ import { useCallback as useCallback60, useEffect as useEffect99, useMemo as useMemo57, useRef as useRef83, useState as useState129 } from "react";
59989
60078
  import * as DialogPrimitive5 from "@radix-ui/react-dialog";
59990
60079
  import { usePreventScroll as usePreventScroll5 } from "@react-aria/overlays";
59991
60080
  import { isIOS } from "@react-aria/utils";
@@ -60072,7 +60161,7 @@ init_button2();
60072
60161
  import { FileText as FileText8, MessageSquare as MessageSquare3 } from "lucide-react";
60073
60162
 
60074
60163
  // src/components/chat/hooks/use-chat-dialog-manager.ts
60075
- import { useCallback as useCallback59, useMemo as useMemo55, useRef as useRef82, useState as useState128 } from "react";
60164
+ import { useCallback as useCallback59, useMemo as useMemo56, useRef as useRef82, useState as useState128 } from "react";
60076
60165
  function useChatDialogManager({
60077
60166
  dialogs,
60078
60167
  activeDialogId,
@@ -60205,7 +60294,7 @@ function useChatDialogManager({
60205
60294
  clearMessages();
60206
60295
  setArchiveOpen(false);
60207
60296
  }, [selectDialog, clearMessages]);
60208
- const activeDialog = useMemo55(
60297
+ const activeDialog = useMemo56(
60209
60298
  () => dialogs.find((d) => d.id === activeDialogId) ?? archivedDialogs.find((d) => d.id === activeDialogId),
60210
60299
  [dialogs, archivedDialogs, activeDialogId]
60211
60300
  );
@@ -60270,7 +60359,7 @@ var RAIL_ANIM_MS = 320;
60270
60359
  function useRailPresence(open) {
60271
60360
  const [mounted, setMounted] = useState129(open);
60272
60361
  const [active, setActive] = useState129(false);
60273
- useEffect98(() => {
60362
+ useEffect99(() => {
60274
60363
  if (open) {
60275
60364
  setMounted(true);
60276
60365
  let raf2 = 0;
@@ -60597,7 +60686,7 @@ function EmbeddableChatInner({
60597
60686
  const commandsUrl = runtime.endpoints.commandsUrl;
60598
60687
  const { attachmentsEnabled, user: identityUser } = useChatIdentity();
60599
60688
  const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
60600
- useEffect98(() => {
60689
+ useEffect99(() => {
60601
60690
  if (process.env.NODE_ENV !== "production") {
60602
60691
  const hasOpen = open !== void 0;
60603
60692
  const hasHandler = onOpenChange !== void 0;
@@ -60619,7 +60708,7 @@ function EmbeddableChatInner({
60619
60708
  });
60620
60709
  usePreventScroll5({ isDisabled: !isOpen || shellLess });
60621
60710
  const navigatingAwayRef = useRef83(false);
60622
- useEffect98(() => {
60711
+ useEffect99(() => {
60623
60712
  if (!isOpen) return;
60624
60713
  if (shellLess) return;
60625
60714
  if (typeof window === "undefined") return;
@@ -60647,7 +60736,7 @@ function EmbeddableChatInner({
60647
60736
  }, [isOpen, shellLess]);
60648
60737
  const chatInputRef = useRef83(null);
60649
60738
  const [quickActionPreview, setQuickActionPreview] = useState129(null);
60650
- const slashCommandsProp = useMemo56(
60739
+ const slashCommandsProp = useMemo57(
60651
60740
  () => ({
60652
60741
  fetchCommands: (prefix, signal) => fetchSlashCommands(prefix, signal, commandsUrl),
60653
60742
  resolveSourceIcon: (sourceId) => {
@@ -60662,12 +60751,12 @@ function EmbeddableChatInner({
60662
60751
  [commandsUrl]
60663
60752
  );
60664
60753
  const headerUserName = identityUser?.name?.trim() || [identityUser?.firstName, identityUser?.lastName].filter(Boolean).join(" ").trim() || userDisplayName?.trim() || void 0;
60665
- const effectiveModes = useMemo56(() => {
60754
+ const effectiveModes = useMemo57(() => {
60666
60755
  if (modes) return modes;
60667
60756
  const guideOptions = tableIdForDocumentType ? { tableIdForDocumentType } : {};
60668
60757
  return { guide: guideOptions };
60669
60758
  }, [modes, tableIdForDocumentType]);
60670
- const mingoCaps = useMemo56(() => {
60759
+ const mingoCaps = useMemo57(() => {
60671
60760
  if (mingoState) {
60672
60761
  return {
60673
60762
  canRename: mingoDialogCapabilities?.canRename ?? false,
@@ -60701,7 +60790,7 @@ function EmbeddableChatInner({
60701
60790
  [controlledActiveMode, onActiveModeChange]
60702
60791
  );
60703
60792
  const { commands: commandsList, loaded: commandsLoaded } = useSlashCommandRegistry(commandsUrl, { enabled: activeMode === "guide" });
60704
- const commandsById = useMemo56(() => {
60793
+ const commandsById = useMemo57(() => {
60705
60794
  const map = /* @__PURE__ */ new Map();
60706
60795
  for (const cmd of commandsList) map.set(cmd.id, cmd);
60707
60796
  return map;
@@ -60752,7 +60841,7 @@ function EmbeddableChatInner({
60752
60841
  loadMoreMessages
60753
60842
  } = useUnifiedChat({ modes: effectiveModes, activeMode, mingoStateOverride: mingoState });
60754
60843
  const guidePromptSentRef = useRef83(false);
60755
- useEffect98(() => {
60844
+ useEffect99(() => {
60756
60845
  if (!guidePendingPrompt) {
60757
60846
  guidePromptSentRef.current = false;
60758
60847
  return;
@@ -60777,22 +60866,22 @@ function EmbeddableChatInner({
60777
60866
  const [contextPickerOpen, setContextPickerOpen] = useState129(false);
60778
60867
  const [mentionQuery, setMentionQuery] = useState129(null);
60779
60868
  const mentionActiveRef = useRef83(false);
60780
- useEffect98(() => {
60869
+ useEffect99(() => {
60781
60870
  mentionActiveRef.current = mentionQuery !== null;
60782
60871
  }, [mentionQuery]);
60783
60872
  const mentionKeysRef = useRef83(/* @__PURE__ */ new Set());
60784
- useEffect98(() => {
60873
+ useEffect99(() => {
60785
60874
  setContextItems([]);
60786
60875
  setMentionQuery(null);
60787
60876
  mentionKeysRef.current.clear();
60788
60877
  }, [activeDialogId, activeMode]);
60789
- const mentionMarkerByType = useMemo56(() => {
60878
+ const mentionMarkerByType = useMemo57(() => {
60790
60879
  const m = /* @__PURE__ */ new Map();
60791
60880
  for (const t of contextPicker?.entityTypes ?? []) if (t.marker) m.set(t.type, t.marker);
60792
60881
  return m;
60793
60882
  }, [contextPicker?.entityTypes]);
60794
60883
  const contextEntityTypes = contextPicker?.entityTypes;
60795
- const resolveContextIcon = useMemo56(() => {
60884
+ const resolveContextIcon = useMemo57(() => {
60796
60885
  const byType = /* @__PURE__ */ new Map();
60797
60886
  for (const t of contextEntityTypes ?? []) byType.set(t.type, t.icon);
60798
60887
  return (item) => byType.get(item.type);
@@ -60859,7 +60948,7 @@ function EmbeddableChatInner({
60859
60948
  navigatingAwayRef.current = true;
60860
60949
  setIsOpen(false);
60861
60950
  }, [setIsOpen]);
60862
- const chatPanelHandle = useMemo56(
60951
+ const chatPanelHandle = useMemo57(
60863
60952
  () => ({ closeChat: handleNavigationClose }),
60864
60953
  [handleNavigationClose]
60865
60954
  );
@@ -60873,14 +60962,14 @@ function EmbeddableChatInner({
60873
60962
  }),
60874
60963
  [discussRef, displayRef, resolvedBaseRoute, chipBasePlatform, extras]
60875
60964
  );
60876
- const mingoAssistantIcon = useMemo56(
60965
+ const mingoAssistantIcon = useMemo57(
60877
60966
  () => effectiveAssistantIcon ? /* @__PURE__ */ jsx398(EntityIcon, { icon: effectiveAssistantIcon, size: 24 }) : /* @__PURE__ */ jsx398(MingoIcon, { className: "h-6 w-6", cornerColor: "var(--ods-flamingo-cyan-base)" }),
60878
60967
  [effectiveAssistantIcon]
60879
60968
  );
60880
60969
  const timestampCacheRef = useRef83(/* @__PURE__ */ new Map());
60881
60970
  const guideUserName = activeMode === "guide" ? [identityUser?.firstName, identityUser?.lastName].filter(Boolean).join(" ").trim() || identityUser?.name?.trim() || void 0 : void 0;
60882
60971
  const guideUserAvatar = activeMode === "guide" ? identityUser?.avatarUrl?.trim() || void 0 : void 0;
60883
- const messages = useMemo56(() => {
60972
+ const messages = useMemo57(() => {
60884
60973
  const cache = timestampCacheRef.current;
60885
60974
  const seenIds = /* @__PURE__ */ new Set();
60886
60975
  const mapped = rawMessages.map((m) => {
@@ -60951,7 +61040,7 @@ function EmbeddableChatInner({
60951
61040
  },
60952
61041
  [sendMessage]
60953
61042
  );
60954
- const guideSuggestedActions = useMemo56(
61043
+ const guideSuggestedActions = useMemo57(
60955
61044
  () => {
60956
61045
  if (effectiveQuickActions.length > 0) {
60957
61046
  return effectiveQuickActions.map((qa) => ({
@@ -61015,7 +61104,7 @@ function EmbeddableChatInner({
61015
61104
  });
61016
61105
  const handleOpen = useCallback60(() => setIsOpen(true), [setIsOpen]);
61017
61106
  useCloseOnNavigation(handleNavigationClose, null);
61018
- useEffect98(() => {
61107
+ useEffect99(() => {
61019
61108
  const handler = (e) => {
61020
61109
  const detail = e.detail;
61021
61110
  if (!detail || detail.source !== source) return;
@@ -61025,7 +61114,7 @@ function EmbeddableChatInner({
61025
61114
  window.addEventListener("ask-ai:open-with-ref", handler);
61026
61115
  return () => window.removeEventListener("ask-ai:open-with-ref", handler);
61027
61116
  }, [source, discussRef, setIsOpen]);
61028
- useEffect98(() => {
61117
+ useEffect99(() => {
61029
61118
  const handler = (e) => {
61030
61119
  const detail = e.detail;
61031
61120
  if (!detail || detail.source !== source) return;
@@ -61042,16 +61131,16 @@ function EmbeddableChatInner({
61042
61131
  const contentViewKey = hasConversation ? "conversation" : activeMode;
61043
61132
  const isGuideEmpty = !hasConversation && activeMode === "guide";
61044
61133
  const isQuickActionEmpty = !hasConversation && (activeMode === "guide" || activeMode === "mingo");
61045
- useEffect98(() => {
61134
+ useEffect99(() => {
61046
61135
  if (!isQuickActionEmpty) setQuickActionPreview(null);
61047
61136
  }, [isQuickActionEmpty]);
61048
61137
  const guideCanReturnToMingo = isGuideEmpty && hasMingoMode;
61049
61138
  const sourceLabel = source === "flamingo" ? "Knowledge Base" : "Data Room";
61050
- const enabledSet = useMemo56(
61139
+ const enabledSet = useMemo57(
61051
61140
  () => effectiveEnabledRagTableIds ? new Set(effectiveEnabledRagTableIds) : null,
61052
61141
  [effectiveEnabledRagTableIds]
61053
61142
  );
61054
- const chipCommands = useMemo56(() => {
61143
+ const chipCommands = useMemo57(() => {
61055
61144
  const out = [];
61056
61145
  for (const cmd of commandsById.values()) {
61057
61146
  if (cmd.displayOrder === void 0) continue;
@@ -61068,7 +61157,7 @@ function EmbeddableChatInner({
61068
61157
  return out;
61069
61158
  }, [commandsById, enabledSet]);
61070
61159
  const lastAssistantMsg = [...rawMessages].reverse().find((m) => m.role === "assistant");
61071
- const lastSources = useMemo56(() => {
61160
+ const lastSources = useMemo57(() => {
61072
61161
  if (chatLoading) return void 0;
61073
61162
  const sources = lastAssistantMsg?.sources;
61074
61163
  if (!sources || sources.length === 0) return void 0;
@@ -61088,7 +61177,7 @@ function EmbeddableChatInner({
61088
61177
  const [panelBoundary, setPanelBoundary] = useState129(null);
61089
61178
  const [panelWidth, setPanelWidth] = useState129(0);
61090
61179
  const panelMeasureRef = useRef83(null);
61091
- useEffect98(() => {
61180
+ useEffect99(() => {
61092
61181
  const el = panelMeasureRef.current;
61093
61182
  if (!el || typeof ResizeObserver === "undefined") return;
61094
61183
  const ro = new ResizeObserver((entries) => {
@@ -61104,7 +61193,7 @@ function EmbeddableChatInner({
61104
61193
  setPanelBoundary(node);
61105
61194
  }, []);
61106
61195
  const [railCollapsed, setRailCollapsed] = useState129(false);
61107
- useEffect98(() => {
61196
+ useEffect99(() => {
61108
61197
  try {
61109
61198
  if (window.localStorage.getItem(RAIL_COLLAPSED_STORAGE_KEY) === "1")
61110
61199
  setRailCollapsed(true);
@@ -61129,7 +61218,7 @@ function EmbeddableChatInner({
61129
61218
  const railPresence = useRailPresence(splitActive);
61130
61219
  const showWideHeader = wideMingo || railPresence.mounted;
61131
61220
  const [composeOpen, setComposeOpen] = useState129(false);
61132
- useEffect98(() => {
61221
+ useEffect99(() => {
61133
61222
  if (hasConversation) setComposeOpen(false);
61134
61223
  }, [hasConversation]);
61135
61224
  const isMingoMode = activeMode === "mingo";
@@ -62159,6 +62248,13 @@ export {
62159
62248
  WhatIShippedCardSkeleton,
62160
62249
  HowIWorkCard,
62161
62250
  HowIWorkCardSkeleton,
62251
+ getCaptionsUrl,
62252
+ rebaseCaptionsUrl,
62253
+ buildCaptionsUrl,
62254
+ getEntityCaptionUrls,
62255
+ getEntityCaptionUrlsById,
62256
+ captionsEntityTypeForDocType,
62257
+ useCaptions,
62162
62258
  VideoHoverPreviewSurface,
62163
62259
  CardHitLayer,
62164
62260
  RATIO_GRID_CLASS,
@@ -62610,7 +62706,6 @@ export {
62610
62706
  VideoBitesDisplay,
62611
62707
  FloatingWalkthroughVideo,
62612
62708
  useWalkthroughVideo,
62613
- getCaptionsUrl,
62614
62709
  VideoSourceSelector,
62615
62710
  ConfidenceBadge,
62616
62711
  SubtitlesEditor,
@@ -62793,4 +62888,4 @@ export {
62793
62888
  LogsList,
62794
62889
  assets
62795
62890
  };
62796
- //# sourceMappingURL=chunk-JI4JR3KC.js.map
62891
+ //# sourceMappingURL=chunk-ZS7VC5SX.js.map