@flamingo-stack/openframe-frontend-core 0.0.446-snapshot.20260717214810 → 0.0.446
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-X4XHW3OV.cjs → chunk-3AFV2YIC.cjs} +40 -40
- package/dist/{chunk-X4XHW3OV.cjs.map → chunk-3AFV2YIC.cjs.map} +1 -1
- package/dist/{chunk-TKGCTDQY.js → chunk-5NYXGWBN.js} +2 -4
- package/dist/{chunk-TKGCTDQY.js.map → chunk-5NYXGWBN.js.map} +1 -1
- package/dist/{chunk-S7VMUDUB.cjs → chunk-5WX2V6CY.cjs} +12 -12
- package/dist/{chunk-S7VMUDUB.cjs.map → chunk-5WX2V6CY.cjs.map} +1 -1
- package/dist/{chunk-3GBLPPSW.js → chunk-5YQSRQHP.js} +6 -6
- package/dist/{chunk-FR6NVZVM.cjs → chunk-6XZNIPXP.cjs} +18 -18
- package/dist/{chunk-FR6NVZVM.cjs.map → chunk-6XZNIPXP.cjs.map} +1 -1
- package/dist/{chunk-2PNWAAU4.cjs → chunk-7IC2QCOL.cjs} +73 -73
- package/dist/{chunk-2PNWAAU4.cjs.map → chunk-7IC2QCOL.cjs.map} +1 -1
- package/dist/{chunk-RNXMP7GB.cjs → chunk-BAUWT7PV.cjs} +941 -986
- package/dist/chunk-BAUWT7PV.cjs.map +1 -0
- package/dist/{chunk-ZYB3BYBA.js → chunk-BNYI2FVM.js} +4 -4
- package/dist/{chunk-EZMM2OMP.cjs → chunk-DH3DUY6Q.cjs} +32 -32
- package/dist/{chunk-EZMM2OMP.cjs.map → chunk-DH3DUY6Q.cjs.map} +1 -1
- package/dist/{chunk-YHNBJ3F3.js → chunk-G2KXNMFQ.js} +2 -2
- package/dist/{chunk-TMZYFYSS.js → chunk-GTHA2SYB.js} +5 -5
- package/dist/{chunk-D2NLNBLH.js → chunk-I7IOEXRJ.js} +2 -2
- package/dist/{chunk-6TAIXSF5.js → chunk-K6JIBV3X.js} +2 -2
- package/dist/{chunk-ITJMUH4Q.cjs → chunk-L276GOMD.cjs} +40 -40
- package/dist/{chunk-ITJMUH4Q.cjs.map → chunk-L276GOMD.cjs.map} +1 -1
- package/dist/{chunk-YCSNDUDE.js → chunk-MAB4TQCO.js} +297 -342
- package/dist/chunk-MAB4TQCO.js.map +1 -0
- package/dist/{chunk-ZQVEB6KT.js → chunk-MR7BMJHI.js} +6 -6
- package/dist/{chunk-PF6CKZIH.cjs → chunk-MS5CEBBQ.cjs} +5 -5
- package/dist/{chunk-PF6CKZIH.cjs.map → chunk-MS5CEBBQ.cjs.map} +1 -1
- package/dist/{chunk-XUS75SQW.cjs → chunk-N3Y6JYH5.cjs} +15 -15
- package/dist/{chunk-XUS75SQW.cjs.map → chunk-N3Y6JYH5.cjs.map} +1 -1
- package/dist/{chunk-5BJJRPDH.js → chunk-N4CCB33C.js} +3 -3
- package/dist/{chunk-WLU37UZO.cjs → chunk-NQLY27GH.cjs} +73 -73
- package/dist/{chunk-WLU37UZO.cjs.map → chunk-NQLY27GH.cjs.map} +1 -1
- package/dist/{chunk-ROCJMSJI.cjs → chunk-PTT4J5GF.cjs} +3 -3
- package/dist/{chunk-ROCJMSJI.cjs.map → chunk-PTT4J5GF.cjs.map} +1 -1
- package/dist/{chunk-E6HKLQ3Q.cjs → chunk-SA7AHDS6.cjs} +7 -7
- package/dist/{chunk-E6HKLQ3Q.cjs.map → chunk-SA7AHDS6.cjs.map} +1 -1
- package/dist/{chunk-4ONE3HQP.js → chunk-SAV4U37G.js} +2 -2
- package/dist/{chunk-WMOF3WQT.js → chunk-SCKAD2MY.js} +5 -5
- package/dist/{chunk-AN7MCJTV.cjs → chunk-VIJARDBM.cjs} +3 -5
- package/dist/chunk-VIJARDBM.cjs.map +1 -0
- package/dist/{chunk-G7QSLGMI.js → chunk-XB6D7B3I.js} +3 -3
- package/dist/{chunk-SHC5NFOH.js → chunk-YLMD4UFA.js} +3 -3
- package/dist/{chunk-KYLOPUIH.cjs → chunk-ZKYEMGMD.cjs} +29 -29
- package/dist/{chunk-KYLOPUIH.cjs.map → chunk-ZKYEMGMD.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +9 -9
- package/dist/components/case-studies/index.js +3 -3
- package/dist/components/chat/index.cjs +3 -3
- package/dist/components/chat/index.js +2 -2
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/contact/index.js +3 -3
- package/dist/components/docs/index.cjs +6 -6
- package/dist/components/docs/index.js +5 -5
- package/dist/components/embeds/index.cjs +4 -4
- package/dist/components/embeds/index.js +3 -3
- package/dist/components/faq/index.cjs +5 -5
- package/dist/components/faq/index.js +4 -4
- package/dist/components/features/cards-strip.d.ts.map +1 -1
- package/dist/components/features/highlight-video-section.d.ts.map +1 -1
- package/dist/components/features/index.cjs +3 -5
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.js +2 -4
- package/dist/components/features/media-gallery-manager.d.ts.map +1 -1
- package/dist/components/features/mux-origins.cjs +0 -14
- package/dist/components/features/mux-origins.cjs.map +1 -1
- package/dist/components/features/mux-origins.d.ts +2 -26
- package/dist/components/features/mux-origins.d.ts.map +1 -1
- package/dist/components/features/mux-origins.js +1 -14
- package/dist/components/features/mux-origins.js.map +1 -1
- package/dist/components/features/release-media-manager.d.ts.map +1 -1
- package/dist/components/features/use-video-warmup.d.ts +0 -12
- package/dist/components/features/use-video-warmup.d.ts.map +1 -1
- package/dist/components/features/video-bites-strip.d.ts.map +1 -1
- package/dist/components/features/video-source-selector.d.ts +11 -1
- package/dist/components/features/video-source-selector.d.ts.map +1 -1
- package/dist/components/features/video.d.ts +1 -14
- package/dist/components/features/video.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +22 -22
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +135 -137
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +11 -13
- package/dist/components/index.js.map +1 -1
- package/dist/components/navigation/index.cjs +3 -3
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/onboarding-guides/index.cjs +7 -7
- package/dist/components/onboarding-guides/index.js +6 -6
- package/dist/components/related-content/index.cjs +5 -5
- package/dist/components/related-content/index.js +4 -4
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/index.cjs +3 -3
- package/dist/components/ui/index.js +2 -2
- package/dist/components/ui/simple-markdown-renderer.d.ts.map +1 -1
- package/dist/hooks/index.cjs +2 -4
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +1 -3
- package/dist/hooks/use-near-viewport.d.ts +0 -7
- package/dist/hooks/use-near-viewport.d.ts.map +1 -1
- package/dist/index.cjs +3 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -6
- package/package.json +1 -1
- package/src/components/features/cards-strip.tsx +1 -2
- package/src/components/features/highlight-video-section.tsx +7 -10
- package/src/components/features/media-gallery-manager.tsx +8 -6
- package/src/components/features/mux-origins.ts +2 -40
- package/src/components/features/release-media-manager.tsx +8 -6
- package/src/components/features/use-video-warmup.ts +3 -19
- package/src/components/features/video-bites-strip.tsx +4 -24
- package/src/components/features/video-source-selector.tsx +56 -16
- package/src/components/features/video.tsx +8 -103
- package/src/components/ui/rich-markdown-renderer.tsx +0 -20
- package/src/components/ui/simple-markdown-renderer.tsx +5 -9
- package/src/hooks/use-near-viewport.ts +1 -9
- package/dist/chunk-AN7MCJTV.cjs.map +0 -1
- package/dist/chunk-RNXMP7GB.cjs.map +0 -1
- package/dist/chunk-YCSNDUDE.js.map +0 -1
- /package/dist/{chunk-3GBLPPSW.js.map → chunk-5YQSRQHP.js.map} +0 -0
- /package/dist/{chunk-ZYB3BYBA.js.map → chunk-BNYI2FVM.js.map} +0 -0
- /package/dist/{chunk-YHNBJ3F3.js.map → chunk-G2KXNMFQ.js.map} +0 -0
- /package/dist/{chunk-TMZYFYSS.js.map → chunk-GTHA2SYB.js.map} +0 -0
- /package/dist/{chunk-D2NLNBLH.js.map → chunk-I7IOEXRJ.js.map} +0 -0
- /package/dist/{chunk-6TAIXSF5.js.map → chunk-K6JIBV3X.js.map} +0 -0
- /package/dist/{chunk-ZQVEB6KT.js.map → chunk-MR7BMJHI.js.map} +0 -0
- /package/dist/{chunk-5BJJRPDH.js.map → chunk-N4CCB33C.js.map} +0 -0
- /package/dist/{chunk-4ONE3HQP.js.map → chunk-SAV4U37G.js.map} +0 -0
- /package/dist/{chunk-WMOF3WQT.js.map → chunk-SCKAD2MY.js.map} +0 -0
- /package/dist/{chunk-G7QSLGMI.js.map → chunk-XB6D7B3I.js.map} +0 -0
- /package/dist/{chunk-SHC5NFOH.js.map → chunk-YLMD4UFA.js.map} +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
NEAR_VIEWPORT_ROOT_MARGIN,
|
|
4
3
|
STICKY_HEADER_OFFSET_PX,
|
|
5
4
|
ToolIcon,
|
|
6
5
|
dotColorByVariant,
|
|
@@ -28,7 +27,7 @@ import {
|
|
|
28
27
|
useOgPlaceholderUrl,
|
|
29
28
|
useOnboardingState,
|
|
30
29
|
useToast
|
|
31
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-5NYXGWBN.js";
|
|
32
31
|
import {
|
|
33
32
|
AlertCircleIcon,
|
|
34
33
|
AnthropicLogoGreyIcon,
|
|
@@ -1285,11 +1284,12 @@ var SAFE_HTML_TAGS = /* @__PURE__ */ new Set([
|
|
|
1285
1284
|
"ul",
|
|
1286
1285
|
"var",
|
|
1287
1286
|
"wbr",
|
|
1288
|
-
// Media
|
|
1287
|
+
// Media
|
|
1289
1288
|
"img",
|
|
1290
1289
|
"picture",
|
|
1291
1290
|
"source",
|
|
1292
1291
|
"audio",
|
|
1292
|
+
"video",
|
|
1293
1293
|
"iframe",
|
|
1294
1294
|
"track",
|
|
1295
1295
|
// Forms (rehype-raw allows them; mostly harmless for chat output)
|
|
@@ -10170,7 +10170,7 @@ var TabsContent = React32.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
10170
10170
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
10171
10171
|
|
|
10172
10172
|
// src/components/features/video.tsx
|
|
10173
|
-
import { useCallback as useCallback13, useEffect as
|
|
10173
|
+
import { useCallback as useCallback13, useEffect as useEffect17, useMemo as useMemo12, useRef as useRef13, useState as useState23 } from "react";
|
|
10174
10174
|
import MuxPlayer from "@mux/mux-player-react";
|
|
10175
10175
|
|
|
10176
10176
|
// src/components/features/video-center-badge.tsx
|
|
@@ -10216,96 +10216,8 @@ function fetchPriorityProp(priority) {
|
|
|
10216
10216
|
return USE_CAMEL_CASE_FETCH_PRIORITY ? { fetchPriority: value } : { fetchpriority: value };
|
|
10217
10217
|
}
|
|
10218
10218
|
|
|
10219
|
-
// src/components/features/use-video-warmup.ts
|
|
10220
|
-
import { useEffect as useEffect17 } from "react";
|
|
10221
|
-
import ReactDOM from "react-dom";
|
|
10222
|
-
|
|
10223
|
-
// src/components/features/mux-origins.ts
|
|
10224
|
-
var MUX_STREAM_ORIGIN = "https://stream.mux.com";
|
|
10225
|
-
var MUX_IMAGE_ORIGIN = "https://image.mux.com";
|
|
10226
|
-
function toMuxPreviewUrl(url, maxResolution = "720p") {
|
|
10227
|
-
let parsed;
|
|
10228
|
-
try {
|
|
10229
|
-
parsed = new URL(url);
|
|
10230
|
-
} catch {
|
|
10231
|
-
return url;
|
|
10232
|
-
}
|
|
10233
|
-
if (parsed.origin !== MUX_STREAM_ORIGIN) return url;
|
|
10234
|
-
if (!parsed.pathname.endsWith(".m3u8")) return url;
|
|
10235
|
-
if (parsed.searchParams.has("token")) return url;
|
|
10236
|
-
parsed.searchParams.set("max_resolution", maxResolution);
|
|
10237
|
-
return parsed.toString();
|
|
10238
|
-
}
|
|
10239
|
-
|
|
10240
|
-
// src/components/features/use-video-warmup.ts
|
|
10241
|
-
function saveDataEnabled() {
|
|
10242
|
-
if (typeof navigator === "undefined") return false;
|
|
10243
|
-
const conn = navigator.connection;
|
|
10244
|
-
return conn?.saveData === true;
|
|
10245
|
-
}
|
|
10246
|
-
function useVideoOriginPreconnect({
|
|
10247
|
-
supabaseStorageOrigin
|
|
10248
|
-
} = {}) {
|
|
10249
|
-
const runtime = useChatRuntime();
|
|
10250
|
-
const resolvedOrigin = supabaseStorageOrigin ?? runtime?.endpoints.supabaseStorageOrigin;
|
|
10251
|
-
try {
|
|
10252
|
-
ReactDOM.preconnect(MUX_STREAM_ORIGIN, { crossOrigin: "anonymous" });
|
|
10253
|
-
ReactDOM.preconnect(MUX_IMAGE_ORIGIN, { crossOrigin: "anonymous" });
|
|
10254
|
-
if (resolvedOrigin) {
|
|
10255
|
-
ReactDOM.preconnect(resolvedOrigin, { crossOrigin: "anonymous" });
|
|
10256
|
-
}
|
|
10257
|
-
} catch (err) {
|
|
10258
|
-
if (process.env.NODE_ENV !== "production") {
|
|
10259
|
-
console.warn("[useVideoOriginPreconnect] preconnect failed:", err);
|
|
10260
|
-
}
|
|
10261
|
-
}
|
|
10262
|
-
}
|
|
10263
|
-
function useVideoWarmup({
|
|
10264
|
-
videoUrl,
|
|
10265
|
-
supabaseStorageOrigin,
|
|
10266
|
-
nearMargin = "1000px"
|
|
10267
|
-
} = {}) {
|
|
10268
|
-
const runtime = useChatRuntime();
|
|
10269
|
-
const resolvedOrigin = supabaseStorageOrigin ?? runtime?.endpoints.supabaseStorageOrigin;
|
|
10270
|
-
useVideoOriginPreconnect({ supabaseStorageOrigin: resolvedOrigin });
|
|
10271
|
-
const { ref, isNear } = useNearViewport(nearMargin);
|
|
10272
|
-
useEffect17(() => {
|
|
10273
|
-
if (!isNear || !videoUrl || !resolvedOrigin) return;
|
|
10274
|
-
if (saveDataEnabled()) return;
|
|
10275
|
-
let videoOrigin;
|
|
10276
|
-
try {
|
|
10277
|
-
videoOrigin = new URL(videoUrl, "http://placeholder.local").origin;
|
|
10278
|
-
} catch {
|
|
10279
|
-
return;
|
|
10280
|
-
}
|
|
10281
|
-
if (videoOrigin !== resolvedOrigin) return;
|
|
10282
|
-
const link = document.createElement("link");
|
|
10283
|
-
link.rel = "preload";
|
|
10284
|
-
link.as = "video";
|
|
10285
|
-
link.href = videoUrl;
|
|
10286
|
-
link.crossOrigin = "anonymous";
|
|
10287
|
-
if ("fetchPriority" in link) {
|
|
10288
|
-
;
|
|
10289
|
-
link.fetchPriority = "low";
|
|
10290
|
-
}
|
|
10291
|
-
document.head.appendChild(link);
|
|
10292
|
-
return () => {
|
|
10293
|
-
link.remove();
|
|
10294
|
-
};
|
|
10295
|
-
}, [isNear, videoUrl, resolvedOrigin]);
|
|
10296
|
-
return { ref, isNear };
|
|
10297
|
-
}
|
|
10298
|
-
|
|
10299
10219
|
// src/components/features/video.tsx
|
|
10300
10220
|
import { jsx as jsx75, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
10301
|
-
function videoPerfDebugEnabled() {
|
|
10302
|
-
if (process.env.NODE_ENV !== "production") return true;
|
|
10303
|
-
try {
|
|
10304
|
-
return typeof localStorage !== "undefined" && localStorage.getItem("VIDEO_PERF_DEBUG") !== null;
|
|
10305
|
-
} catch {
|
|
10306
|
-
return false;
|
|
10307
|
-
}
|
|
10308
|
-
}
|
|
10309
10221
|
if (typeof window !== "undefined") {
|
|
10310
10222
|
const w = window;
|
|
10311
10223
|
if (!w.chrome?.cast) {
|
|
@@ -10397,15 +10309,7 @@ function Video2(props) {
|
|
|
10397
10309
|
className: props.className,
|
|
10398
10310
|
minimalControls: props.minimalControls
|
|
10399
10311
|
}
|
|
10400
|
-
) : "firstFrameOnly" in props && props.firstFrameOnly ? /* @__PURE__ */ jsx75(
|
|
10401
|
-
FirstFramePreview,
|
|
10402
|
-
{
|
|
10403
|
-
url,
|
|
10404
|
-
poster: props.poster,
|
|
10405
|
-
fit: "fit" in props ? props.fit : void 0,
|
|
10406
|
-
className: props.className
|
|
10407
|
-
}
|
|
10408
|
-
) : /* @__PURE__ */ jsx75(
|
|
10312
|
+
) : "firstFrameOnly" in props && props.firstFrameOnly ? /* @__PURE__ */ jsx75(FirstFramePreview, { url, className: props.className }) : /* @__PURE__ */ jsx75(
|
|
10409
10313
|
FilePlayer,
|
|
10410
10314
|
{
|
|
10411
10315
|
url,
|
|
@@ -10418,8 +10322,6 @@ function Video2(props) {
|
|
|
10418
10322
|
chromeless: "chromeless" in props ? props.chromeless : void 0,
|
|
10419
10323
|
playOnHover: "playOnHover" in props ? props.playOnHover : void 0,
|
|
10420
10324
|
playWhenHovered: "playWhenHovered" in props ? props.playWhenHovered : void 0,
|
|
10421
|
-
preload: "preload" in props ? props.preload : void 0,
|
|
10422
|
-
fit: "fit" in props ? props.fit : void 0,
|
|
10423
10325
|
className: props.className
|
|
10424
10326
|
}
|
|
10425
10327
|
);
|
|
@@ -10444,12 +10346,7 @@ function wrapWithLayout(inner, layout) {
|
|
|
10444
10346
|
return inner;
|
|
10445
10347
|
}
|
|
10446
10348
|
}
|
|
10447
|
-
function FirstFramePreview({
|
|
10448
|
-
url,
|
|
10449
|
-
poster,
|
|
10450
|
-
fit,
|
|
10451
|
-
className
|
|
10452
|
-
}) {
|
|
10349
|
+
function FirstFramePreview({ url, className }) {
|
|
10453
10350
|
return /* @__PURE__ */ jsx75(
|
|
10454
10351
|
"div",
|
|
10455
10352
|
{
|
|
@@ -10460,8 +10357,7 @@ function FirstFramePreview({
|
|
|
10460
10357
|
FilePlayer,
|
|
10461
10358
|
{
|
|
10462
10359
|
url: `${url}#t=0.1`,
|
|
10463
|
-
|
|
10464
|
-
fit,
|
|
10360
|
+
preload: "metadata",
|
|
10465
10361
|
muted: true,
|
|
10466
10362
|
chromeless: true,
|
|
10467
10363
|
className
|
|
@@ -10482,23 +10378,10 @@ function FilePlayer({
|
|
|
10482
10378
|
playOnHover,
|
|
10483
10379
|
playWhenHovered,
|
|
10484
10380
|
preload,
|
|
10485
|
-
fit,
|
|
10486
10381
|
className
|
|
10487
10382
|
}) {
|
|
10488
|
-
const effectivePreload = preload ?? (saveDataEnabled() ? "none" : "metadata");
|
|
10489
10383
|
const [hoverMutedFallback, setHoverMutedFallback] = useState23(false);
|
|
10490
10384
|
const hoverPlayerRef = useRef13(null);
|
|
10491
|
-
const perfListenerRef = useRef13(null);
|
|
10492
|
-
const clearPerfListener = useCallback13(() => {
|
|
10493
|
-
if (perfListenerRef.current) {
|
|
10494
|
-
try {
|
|
10495
|
-
hoverPlayerRef.current?.removeEventListener?.("playing", perfListenerRef.current);
|
|
10496
|
-
} catch {
|
|
10497
|
-
}
|
|
10498
|
-
perfListenerRef.current = null;
|
|
10499
|
-
}
|
|
10500
|
-
}, []);
|
|
10501
|
-
useEffect18(() => clearPerfListener, [clearPerfListener]);
|
|
10502
10385
|
const hoverActiveRef = useRef13(false);
|
|
10503
10386
|
const hoverGenerationRef = useRef13(0);
|
|
10504
10387
|
const activationWaiterRef = useRef13(null);
|
|
@@ -10508,25 +10391,12 @@ function FilePlayer({
|
|
|
10508
10391
|
activationWaiterRef.current = null;
|
|
10509
10392
|
}
|
|
10510
10393
|
}, []);
|
|
10511
|
-
|
|
10394
|
+
useEffect17(() => clearActivationWaiter, [clearActivationWaiter]);
|
|
10512
10395
|
const startHoverPlayback = useCallback13(() => {
|
|
10513
10396
|
hoverActiveRef.current = true;
|
|
10514
10397
|
const generation = ++hoverGenerationRef.current;
|
|
10515
10398
|
const el = hoverPlayerRef.current;
|
|
10516
10399
|
if (!el) return;
|
|
10517
|
-
if (videoPerfDebugEnabled()) {
|
|
10518
|
-
clearPerfListener();
|
|
10519
|
-
const startedAt = performance.now();
|
|
10520
|
-
const onPlaying = () => {
|
|
10521
|
-
clearPerfListener();
|
|
10522
|
-
console.debug("[Video] hover\u2192playing %dms", Math.round(performance.now() - startedAt));
|
|
10523
|
-
};
|
|
10524
|
-
perfListenerRef.current = onPlaying;
|
|
10525
|
-
try {
|
|
10526
|
-
el.addEventListener?.("playing", onPlaying);
|
|
10527
|
-
} catch {
|
|
10528
|
-
}
|
|
10529
|
-
}
|
|
10530
10400
|
try {
|
|
10531
10401
|
el.volume = 0.5;
|
|
10532
10402
|
if (userHasInteracted) {
|
|
@@ -10565,17 +10435,16 @@ function FilePlayer({
|
|
|
10565
10435
|
}
|
|
10566
10436
|
} catch {
|
|
10567
10437
|
}
|
|
10568
|
-
}, [
|
|
10438
|
+
}, []);
|
|
10569
10439
|
const stopHoverPlayback = useCallback13(() => {
|
|
10570
10440
|
hoverActiveRef.current = false;
|
|
10571
10441
|
setHoverMutedFallback(false);
|
|
10572
10442
|
clearActivationWaiter();
|
|
10573
|
-
clearPerfListener();
|
|
10574
10443
|
try {
|
|
10575
10444
|
hoverPlayerRef.current?.pause?.();
|
|
10576
10445
|
} catch {
|
|
10577
10446
|
}
|
|
10578
|
-
}, [clearActivationWaiter
|
|
10447
|
+
}, [clearActivationWaiter]);
|
|
10579
10448
|
const unmuteNow = useCallback13((e) => {
|
|
10580
10449
|
e.stopPropagation();
|
|
10581
10450
|
e.preventDefault();
|
|
@@ -10592,7 +10461,7 @@ function FilePlayer({
|
|
|
10592
10461
|
setHoverMutedFallback(false);
|
|
10593
10462
|
}, []);
|
|
10594
10463
|
const hoverControlled = typeof playWhenHovered === "boolean";
|
|
10595
|
-
|
|
10464
|
+
useEffect17(() => {
|
|
10596
10465
|
if (!hoverControlled) return;
|
|
10597
10466
|
if (playWhenHovered) startHoverPlayback();
|
|
10598
10467
|
else stopHoverPlayback();
|
|
@@ -10611,7 +10480,7 @@ function FilePlayer({
|
|
|
10611
10480
|
src: url,
|
|
10612
10481
|
poster: poster || void 0,
|
|
10613
10482
|
streamType: "on-demand",
|
|
10614
|
-
preload
|
|
10483
|
+
preload,
|
|
10615
10484
|
playsInline: true,
|
|
10616
10485
|
muted,
|
|
10617
10486
|
preferCmcd: "header",
|
|
@@ -10622,8 +10491,7 @@ function FilePlayer({
|
|
|
10622
10491
|
style: {
|
|
10623
10492
|
width: "100%",
|
|
10624
10493
|
height: "100%",
|
|
10625
|
-
...chromeless ? { "--controls": "none" } : {}
|
|
10626
|
-
...fit === "cover" ? { "--media-object-fit": "cover" } : {}
|
|
10494
|
+
...chromeless ? { "--controls": "none" } : {}
|
|
10627
10495
|
},
|
|
10628
10496
|
children: captionsUrl ? /* @__PURE__ */ jsx75(
|
|
10629
10497
|
"track",
|
|
@@ -10716,14 +10584,14 @@ function YouTubeFacadeInner({
|
|
|
10716
10584
|
return `${YT_NOCOOKIE_ORIGIN}/embed/${videoId}?${params.toString()}`;
|
|
10717
10585
|
}, [videoId, minimalControls]);
|
|
10718
10586
|
const [posterTier, setPosterTier] = useState23(0);
|
|
10719
|
-
|
|
10587
|
+
useEffect17(() => {
|
|
10720
10588
|
setPosterTier(0);
|
|
10721
10589
|
}, [videoId]);
|
|
10722
10590
|
const posterQuality = YT_POSTER_TIERS[posterTier];
|
|
10723
10591
|
const posterJpg = `https://i.ytimg.com/vi/${videoId}/${posterQuality}.jpg`;
|
|
10724
10592
|
const posterWebp = `https://i.ytimg.com/vi_webp/${videoId}/${posterQuality}.webp`;
|
|
10725
10593
|
const handlePosterError = () => setPosterTier((tier) => Math.min(tier + 1, YT_POSTER_TIERS.length - 1));
|
|
10726
|
-
|
|
10594
|
+
useEffect17(() => {
|
|
10727
10595
|
if (!activated) return;
|
|
10728
10596
|
const iframe = iframeRef.current;
|
|
10729
10597
|
if (!iframe) return;
|
|
@@ -10816,6 +10684,69 @@ function YouTubeFacadeInner({
|
|
|
10816
10684
|
init_cn();
|
|
10817
10685
|
import { useMemo as useMemo14, useRef as useRef15, useState as useState25, useEffect as useEffect20 } from "react";
|
|
10818
10686
|
|
|
10687
|
+
// src/components/features/use-video-warmup.ts
|
|
10688
|
+
import { useEffect as useEffect18 } from "react";
|
|
10689
|
+
import ReactDOM from "react-dom";
|
|
10690
|
+
|
|
10691
|
+
// src/components/features/mux-origins.ts
|
|
10692
|
+
var MUX_STREAM_ORIGIN = "https://stream.mux.com";
|
|
10693
|
+
var MUX_IMAGE_ORIGIN = "https://image.mux.com";
|
|
10694
|
+
|
|
10695
|
+
// src/components/features/use-video-warmup.ts
|
|
10696
|
+
function useVideoOriginPreconnect({
|
|
10697
|
+
supabaseStorageOrigin
|
|
10698
|
+
} = {}) {
|
|
10699
|
+
const runtime = useChatRuntime();
|
|
10700
|
+
const resolvedOrigin = supabaseStorageOrigin ?? runtime?.endpoints.supabaseStorageOrigin;
|
|
10701
|
+
try {
|
|
10702
|
+
ReactDOM.preconnect(MUX_STREAM_ORIGIN, { crossOrigin: "anonymous" });
|
|
10703
|
+
ReactDOM.preconnect(MUX_IMAGE_ORIGIN, { crossOrigin: "anonymous" });
|
|
10704
|
+
if (resolvedOrigin) {
|
|
10705
|
+
ReactDOM.preconnect(resolvedOrigin, { crossOrigin: "anonymous" });
|
|
10706
|
+
}
|
|
10707
|
+
} catch (err) {
|
|
10708
|
+
if (process.env.NODE_ENV !== "production") {
|
|
10709
|
+
console.warn("[useVideoOriginPreconnect] preconnect failed:", err);
|
|
10710
|
+
}
|
|
10711
|
+
}
|
|
10712
|
+
}
|
|
10713
|
+
function useVideoWarmup({
|
|
10714
|
+
videoUrl,
|
|
10715
|
+
supabaseStorageOrigin,
|
|
10716
|
+
nearMargin = "1000px"
|
|
10717
|
+
} = {}) {
|
|
10718
|
+
const runtime = useChatRuntime();
|
|
10719
|
+
const resolvedOrigin = supabaseStorageOrigin ?? runtime?.endpoints.supabaseStorageOrigin;
|
|
10720
|
+
useVideoOriginPreconnect({ supabaseStorageOrigin: resolvedOrigin });
|
|
10721
|
+
const { ref, isNear } = useNearViewport(nearMargin);
|
|
10722
|
+
useEffect18(() => {
|
|
10723
|
+
if (!isNear || !videoUrl || !resolvedOrigin) return;
|
|
10724
|
+
const conn = navigator.connection;
|
|
10725
|
+
if (conn?.saveData === true) return;
|
|
10726
|
+
let videoOrigin;
|
|
10727
|
+
try {
|
|
10728
|
+
videoOrigin = new URL(videoUrl, "http://placeholder.local").origin;
|
|
10729
|
+
} catch {
|
|
10730
|
+
return;
|
|
10731
|
+
}
|
|
10732
|
+
if (videoOrigin !== resolvedOrigin) return;
|
|
10733
|
+
const link = document.createElement("link");
|
|
10734
|
+
link.rel = "preload";
|
|
10735
|
+
link.as = "video";
|
|
10736
|
+
link.href = videoUrl;
|
|
10737
|
+
link.crossOrigin = "anonymous";
|
|
10738
|
+
if ("fetchPriority" in link) {
|
|
10739
|
+
;
|
|
10740
|
+
link.fetchPriority = "low";
|
|
10741
|
+
}
|
|
10742
|
+
document.head.appendChild(link);
|
|
10743
|
+
return () => {
|
|
10744
|
+
link.remove();
|
|
10745
|
+
};
|
|
10746
|
+
}, [isNear, videoUrl, resolvedOrigin]);
|
|
10747
|
+
return { ref, isNear };
|
|
10748
|
+
}
|
|
10749
|
+
|
|
10819
10750
|
// src/components/features/video-ratio-tabs.tsx
|
|
10820
10751
|
import { Fragment as Fragment17, jsx as jsx76, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
10821
10752
|
var TAB_TRIGGER_CLASS = "rounded-none border-b-2 border-transparent data-[state=active]:border-ods-accent data-[state=active]:bg-transparent data-[state=active]:shadow-none px-4 py-2 text-h6 text-ods-text-secondary data-[state=active]:text-ods-text-primary";
|
|
@@ -10912,8 +10843,8 @@ function sortBitesByCreatedAtDesc(a, b) {
|
|
|
10912
10843
|
|
|
10913
10844
|
// src/components/features/cards-strip.tsx
|
|
10914
10845
|
init_cn();
|
|
10915
|
-
import React35, { useCallback as useCallback14, useEffect as useEffect19, useMemo as useMemo13, useRef as useRef14, useState as useState24 } from "react";
|
|
10916
10846
|
init_button2();
|
|
10847
|
+
import React35, { useCallback as useCallback14, useEffect as useEffect19, useMemo as useMemo13, useRef as useRef14, useState as useState24 } from "react";
|
|
10917
10848
|
|
|
10918
10849
|
// src/components/layout/page-heading.tsx
|
|
10919
10850
|
import { Fragment as Fragment18, jsx as jsx77, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
@@ -11155,7 +11086,7 @@ function CardsStrip(props) {
|
|
|
11155
11086
|
}
|
|
11156
11087
|
return next;
|
|
11157
11088
|
});
|
|
11158
|
-
}, { rootMargin:
|
|
11089
|
+
}, { rootMargin: "500px" });
|
|
11159
11090
|
cardObserverRef.current = io;
|
|
11160
11091
|
cardElIdxRef.current.forEach((_idx, el) => io.observe(el));
|
|
11161
11092
|
return () => {
|
|
@@ -11461,7 +11392,6 @@ function VideoBiteCard({
|
|
|
11461
11392
|
const targetHref = bite.href ?? sectionHref;
|
|
11462
11393
|
const hasTarget = !!(targetHref || bite.onNavigate || onBiteNavigate);
|
|
11463
11394
|
const key = cardKey ?? `${bite.url}__${index}`;
|
|
11464
|
-
const previewUrl = toMuxPreviewUrl(bite.url);
|
|
11465
11395
|
const controlled = active !== void 0;
|
|
11466
11396
|
const [selfActive, setSelfActive] = useState25(false);
|
|
11467
11397
|
const isActive = controlled ? !!active : selfActive;
|
|
@@ -11476,7 +11406,7 @@ function VideoBiteCard({
|
|
|
11476
11406
|
if (!el || typeof IntersectionObserver === "undefined") return;
|
|
11477
11407
|
const io = new IntersectionObserver(
|
|
11478
11408
|
(entries) => setIsNear(entries[0]?.isIntersecting ?? false),
|
|
11479
|
-
{ rootMargin:
|
|
11409
|
+
{ rootMargin: "500px" }
|
|
11480
11410
|
);
|
|
11481
11411
|
io.observe(el);
|
|
11482
11412
|
return () => io.disconnect();
|
|
@@ -11580,7 +11510,7 @@ function VideoBiteCard({
|
|
|
11580
11510
|
onError: onPosterError,
|
|
11581
11511
|
className: "object-cover"
|
|
11582
11512
|
}
|
|
11583
|
-
) : /* @__PURE__ */ jsx80(Video2, { kind: "file", url:
|
|
11513
|
+
) : /* @__PURE__ */ jsx80(Video2, { kind: "file", url: bite.url, firstFrameOnly: true, layout: "fill" }),
|
|
11584
11514
|
!isActive && /* @__PURE__ */ jsx80(VideoPlayBadge, { className: "absolute inset-0 z-10 m-auto" }),
|
|
11585
11515
|
showPlayer && // `--media-background-color: transparent` (inherited into
|
|
11586
11516
|
// media-chrome) — the freshly-mounted player must not blank the
|
|
@@ -11594,7 +11524,7 @@ function VideoBiteCard({
|
|
|
11594
11524
|
Video2,
|
|
11595
11525
|
{
|
|
11596
11526
|
kind: "file",
|
|
11597
|
-
url:
|
|
11527
|
+
url: bite.url,
|
|
11598
11528
|
poster: bite.thumbnail_url,
|
|
11599
11529
|
playWhenHovered: isActive,
|
|
11600
11530
|
chromeless: true,
|
|
@@ -13347,7 +13277,7 @@ function RoadmapVoteButton({
|
|
|
13347
13277
|
init_button();
|
|
13348
13278
|
|
|
13349
13279
|
// src/components/ui/image-gallery-modal.tsx
|
|
13350
|
-
import { useState as useState103, useEffect as
|
|
13280
|
+
import { useState as useState103, useEffect as useEffect77 } from "react";
|
|
13351
13281
|
|
|
13352
13282
|
// src/components/ui/allowed-domains-input.tsx
|
|
13353
13283
|
init_cn();
|
|
@@ -21294,19 +21224,6 @@ var RichMarkdownInner = ({
|
|
|
21294
21224
|
}
|
|
21295
21225
|
return /* @__PURE__ */ jsx147(MarkdownImage, { src: src.trim(), alt });
|
|
21296
21226
|
},
|
|
21297
|
-
// Raw <video> tags in stored content (e.g. the hub's blog publisher
|
|
21298
|
-
// injects `<video src class="w-full my-8 rounded-lg" controls>` via
|
|
21299
|
-
// injectVideoInBlogContent) pass through rehypeRaw — route them to the
|
|
21300
|
-
// <Video> SSOT (MuxPlayer) instead of a native element so Mux HLS
|
|
21301
|
-
// manifests play on every browser and playback UX is unified. The
|
|
21302
|
-
// incoming className is forwarded so existing embeds keep their
|
|
21303
|
-
// width/margin/rounding.
|
|
21304
|
-
video: ({ src, poster, className: className2 }) => {
|
|
21305
|
-
if (!src || typeof src !== "string" || src.trim() === "") {
|
|
21306
|
-
return null;
|
|
21307
|
-
}
|
|
21308
|
-
return /* @__PURE__ */ jsx147("div", { className: `overflow-hidden ${className2 || "w-full my-8 rounded-lg"}`, children: /* @__PURE__ */ jsx147("div", { className: "w-full aspect-video", children: /* @__PURE__ */ jsx147(Video2, { kind: "file", url: src.trim(), poster: typeof poster === "string" ? poster : void 0 }) }) });
|
|
21309
|
-
},
|
|
21310
21227
|
// Style lists
|
|
21311
21228
|
ul: ({ children }) => /* @__PURE__ */ jsx147("ul", { className: `list-disc list-outside my-4 ml-8 space-y-2 ${isDarkMode ? "text-ods-text-primary" : "text-[#374151]"}`, children }),
|
|
21312
21229
|
ol: ({ children }) => /* @__PURE__ */ jsx147("ol", { className: `list-decimal list-outside my-4 ml-8 space-y-2 ${isDarkMode ? "text-ods-text-primary" : "text-[#374151]"}`, children }),
|
|
@@ -28682,7 +28599,7 @@ import { useState as useState64, useRef as useRef34, useCallback as useCallback2
|
|
|
28682
28599
|
import {
|
|
28683
28600
|
Upload,
|
|
28684
28601
|
Image as ImageIcon2,
|
|
28685
|
-
Video as
|
|
28602
|
+
Video as Video5,
|
|
28686
28603
|
Trash2 as Trash23,
|
|
28687
28604
|
Loader2 as Loader23,
|
|
28688
28605
|
GripVertical,
|
|
@@ -28774,10 +28691,14 @@ function MediaGalleryManager({
|
|
|
28774
28691
|
children: isDeleting ? /* @__PURE__ */ jsx219(Loader23, { className: "h-4 w-4 animate-spin text-ods-text-on-dark" }) : /* @__PURE__ */ jsx219(Trash23, { className: "h-4 w-4 text-ods-text-on-dark" })
|
|
28775
28692
|
}
|
|
28776
28693
|
) }),
|
|
28777
|
-
/* @__PURE__ */ jsx219("div", { className: "aspect-video relative bg-ods-bg rounded-lg overflow-hidden", children: mediaItem.media_type === "video" || mediaItem.media_type === "demo" ? (
|
|
28778
|
-
|
|
28779
|
-
|
|
28780
|
-
|
|
28694
|
+
/* @__PURE__ */ jsx219("div", { className: "aspect-video relative bg-ods-bg rounded-lg overflow-hidden", children: mediaItem.media_type === "video" || mediaItem.media_type === "demo" ? /* @__PURE__ */ jsx219(
|
|
28695
|
+
"video",
|
|
28696
|
+
{
|
|
28697
|
+
src: mediaItem.media_url,
|
|
28698
|
+
className: "w-full h-full object-cover",
|
|
28699
|
+
controls: true,
|
|
28700
|
+
preload: "metadata"
|
|
28701
|
+
}
|
|
28781
28702
|
) : /* @__PURE__ */ jsx219(
|
|
28782
28703
|
next_image_default,
|
|
28783
28704
|
{
|
|
@@ -28790,7 +28711,7 @@ function MediaGalleryManager({
|
|
|
28790
28711
|
) }),
|
|
28791
28712
|
/* @__PURE__ */ jsxs170("div", { className: "p-3", children: [
|
|
28792
28713
|
/* @__PURE__ */ jsxs170("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
28793
|
-
mediaItem.media_type === "video" || mediaItem.media_type === "demo" ? /* @__PURE__ */ jsx219(
|
|
28714
|
+
mediaItem.media_type === "video" || mediaItem.media_type === "demo" ? /* @__PURE__ */ jsx219(Video5, { className: "h-4 w-4 text-ods-text-secondary" }) : /* @__PURE__ */ jsx219(ImageIcon2, { className: "h-4 w-4 text-ods-text-secondary" }),
|
|
28794
28715
|
/* @__PURE__ */ jsx219("span", { className: "text-h6 text-ods-text-primary capitalize", children: mediaItem.media_type })
|
|
28795
28716
|
] }),
|
|
28796
28717
|
mediaItem.title && /* @__PURE__ */ jsx219("p", { className: "text-h6 text-ods-text-secondary truncate", children: mediaItem.title })
|
|
@@ -29466,7 +29387,7 @@ function PushButtonSelector({
|
|
|
29466
29387
|
|
|
29467
29388
|
// src/components/features/release-media-manager.tsx
|
|
29468
29389
|
import { useState as useState66, useRef as useRef36 } from "react";
|
|
29469
|
-
import { Trash2 as Trash24, Plus as Plus5, Image as ImageIcon3, Video as
|
|
29390
|
+
import { Trash2 as Trash24, Plus as Plus5, Image as ImageIcon3, Video as Video6, Upload as Upload2, Loader2 as Loader24, GripVertical as GripVertical2 } from "lucide-react";
|
|
29470
29391
|
import { jsx as jsx226, jsxs as jsxs176 } from "react/jsx-runtime";
|
|
29471
29392
|
function ReleaseMediaManager({
|
|
29472
29393
|
media,
|
|
@@ -29539,7 +29460,7 @@ function ReleaseMediaManager({
|
|
|
29539
29460
|
switch (type) {
|
|
29540
29461
|
case "video":
|
|
29541
29462
|
case "demo":
|
|
29542
|
-
return /* @__PURE__ */ jsx226(
|
|
29463
|
+
return /* @__PURE__ */ jsx226(Video6, { className: "w-5 h-5 text-ods-text-secondary" });
|
|
29543
29464
|
default:
|
|
29544
29465
|
return /* @__PURE__ */ jsx226(ImageIcon3, { className: "w-5 h-5 text-ods-text-secondary" });
|
|
29545
29466
|
}
|
|
@@ -29607,10 +29528,14 @@ function ReleaseMediaManager({
|
|
|
29607
29528
|
children: /* @__PURE__ */ jsx226(Trash24, { className: "h-4 w-4 text-ods-text-on-dark" })
|
|
29608
29529
|
}
|
|
29609
29530
|
) }),
|
|
29610
|
-
item.media_url && /* @__PURE__ */ jsx226("div", { className: "aspect-video relative bg-ods-bg", children: item.media_type === "video" || item.media_type === "demo" ? (
|
|
29611
|
-
|
|
29612
|
-
|
|
29613
|
-
|
|
29531
|
+
item.media_url && /* @__PURE__ */ jsx226("div", { className: "aspect-video relative bg-ods-bg", children: item.media_type === "video" || item.media_type === "demo" ? /* @__PURE__ */ jsx226(
|
|
29532
|
+
"video",
|
|
29533
|
+
{
|
|
29534
|
+
src: item.media_url,
|
|
29535
|
+
className: "w-full h-full object-cover",
|
|
29536
|
+
controls: true,
|
|
29537
|
+
preload: "metadata"
|
|
29538
|
+
}
|
|
29614
29539
|
) : /* @__PURE__ */ jsx226(
|
|
29615
29540
|
next_image_default,
|
|
29616
29541
|
{
|
|
@@ -30484,8 +30409,8 @@ function getCaptionsUrl(entityType, entityId, srtContent) {
|
|
|
30484
30409
|
}
|
|
30485
30410
|
|
|
30486
30411
|
// src/components/features/video-source-selector.tsx
|
|
30487
|
-
import { useState as useState69, useCallback as useCallback27 } from "react";
|
|
30488
|
-
import { Upload as Upload4, X as X8, Video as
|
|
30412
|
+
import { useState as useState69, useCallback as useCallback27, useEffect as useEffect51 } from "react";
|
|
30413
|
+
import { Upload as Upload4, X as X8, Video as Video7, Loader2 as Loader27 } from "lucide-react";
|
|
30489
30414
|
init_button2();
|
|
30490
30415
|
import { jsx as jsx235, jsxs as jsxs183 } from "react/jsx-runtime";
|
|
30491
30416
|
function VideoSourceSelector({
|
|
@@ -30505,6 +30430,7 @@ function VideoSourceSelector({
|
|
|
30505
30430
|
uploadEmptyText = 'No video uploaded yet. Click "Upload Video" to add one.',
|
|
30506
30431
|
disabled = false,
|
|
30507
30432
|
VideoPreviewComponent,
|
|
30433
|
+
resolveVideoUrl,
|
|
30508
30434
|
UploadProgressComponent,
|
|
30509
30435
|
title = "Video",
|
|
30510
30436
|
showTitle = true,
|
|
@@ -30550,7 +30476,7 @@ function VideoSourceSelector({
|
|
|
30550
30476
|
}, [onMainVideoUrlChange]);
|
|
30551
30477
|
return /* @__PURE__ */ jsxs183("div", { className: `space-y-4 p-6 bg-ods-card border border-ods-border rounded-lg ${className}`, children: [
|
|
30552
30478
|
showTitle && /* @__PURE__ */ jsxs183("h3", { className: "text-h5 text-ods-text-primary flex items-center gap-2", children: [
|
|
30553
|
-
/* @__PURE__ */ jsx235(
|
|
30479
|
+
/* @__PURE__ */ jsx235(Video7, { className: "h-5 w-5" }),
|
|
30554
30480
|
title
|
|
30555
30481
|
] }),
|
|
30556
30482
|
/* @__PURE__ */ jsxs183("div", { className: "flex gap-2", children: [
|
|
@@ -30642,20 +30568,50 @@ function VideoSourceSelector({
|
|
|
30642
30568
|
onDelete: handleDeleteVideo,
|
|
30643
30569
|
isAIGenerated
|
|
30644
30570
|
}
|
|
30645
|
-
) :
|
|
30646
|
-
DefaultVideoPreview
|
|
30647
|
-
|
|
30648
|
-
|
|
30649
|
-
|
|
30650
|
-
|
|
30651
|
-
|
|
30571
|
+
) : (
|
|
30572
|
+
// Default simple preview (resolver-aware — see DefaultVideoPreview)
|
|
30573
|
+
/* @__PURE__ */ jsx235(
|
|
30574
|
+
DefaultVideoPreview,
|
|
30575
|
+
{
|
|
30576
|
+
videoUrl: mainVideoUrl,
|
|
30577
|
+
resolveVideoUrl,
|
|
30578
|
+
onDelete: handleDeleteVideo,
|
|
30579
|
+
disabled
|
|
30580
|
+
}
|
|
30581
|
+
)
|
|
30652
30582
|
) : /* @__PURE__ */ jsx235("p", { className: "text-h6 text-ods-text-secondary italic", children: uploadEmptyText })
|
|
30653
30583
|
] })
|
|
30654
30584
|
] });
|
|
30655
30585
|
}
|
|
30656
|
-
function DefaultVideoPreview({ videoUrl, onDelete, disabled }) {
|
|
30586
|
+
function DefaultVideoPreview({ videoUrl, resolveVideoUrl, onDelete, disabled }) {
|
|
30587
|
+
const [resolvedUrl, setResolvedUrl] = useState69(
|
|
30588
|
+
resolveVideoUrl ? void 0 : videoUrl
|
|
30589
|
+
);
|
|
30590
|
+
useEffect51(() => {
|
|
30591
|
+
if (!resolveVideoUrl) {
|
|
30592
|
+
setResolvedUrl(videoUrl);
|
|
30593
|
+
return;
|
|
30594
|
+
}
|
|
30595
|
+
let active = true;
|
|
30596
|
+
setResolvedUrl(void 0);
|
|
30597
|
+
resolveVideoUrl(videoUrl).then((url) => {
|
|
30598
|
+
if (active) setResolvedUrl(url);
|
|
30599
|
+
}).catch(() => {
|
|
30600
|
+
if (active) setResolvedUrl(videoUrl);
|
|
30601
|
+
});
|
|
30602
|
+
return () => {
|
|
30603
|
+
active = false;
|
|
30604
|
+
};
|
|
30605
|
+
}, [videoUrl, resolveVideoUrl]);
|
|
30657
30606
|
return /* @__PURE__ */ jsxs183("div", { className: "relative rounded-lg border border-ods-border overflow-hidden", children: [
|
|
30658
|
-
/* @__PURE__ */ jsx235("div", { className: "w-full
|
|
30607
|
+
resolvedUrl === void 0 ? /* @__PURE__ */ jsx235("div", { className: "w-full h-[200px] flex items-center justify-center bg-black", children: /* @__PURE__ */ jsx235(Loader27, { className: "h-6 w-6 animate-spin text-ods-accent" }) }) : /* @__PURE__ */ jsx235(
|
|
30608
|
+
"video",
|
|
30609
|
+
{
|
|
30610
|
+
src: resolvedUrl,
|
|
30611
|
+
className: "w-full h-auto max-h-[300px] object-contain bg-black",
|
|
30612
|
+
controls: true
|
|
30613
|
+
}
|
|
30614
|
+
),
|
|
30659
30615
|
/* @__PURE__ */ jsx235(
|
|
30660
30616
|
"button",
|
|
30661
30617
|
{
|
|
@@ -30854,7 +30810,7 @@ function TranscriptSummaryEditor({
|
|
|
30854
30810
|
|
|
30855
30811
|
// src/components/features/highlight-video-section.tsx
|
|
30856
30812
|
import { useState as useState70 } from "react";
|
|
30857
|
-
import { Sparkles as
|
|
30813
|
+
import { Sparkles as Sparkles5, Upload as Upload5 } from "lucide-react";
|
|
30858
30814
|
init_button2();
|
|
30859
30815
|
|
|
30860
30816
|
// src/components/features/ai-enrich/AIEnrichSection.tsx
|
|
@@ -30955,7 +30911,7 @@ var AIWarningsSection = ({
|
|
|
30955
30911
|
|
|
30956
30912
|
// src/components/features/ai-enrich/AIEnrichSection.tsx
|
|
30957
30913
|
init_button2();
|
|
30958
|
-
import { CheckCircle as CheckCircle2, AlertCircle, Loader2 as
|
|
30914
|
+
import { CheckCircle as CheckCircle2, AlertCircle, Loader2 as Loader28, X as X9 } from "lucide-react";
|
|
30959
30915
|
import { jsx as jsx240, jsxs as jsxs187 } from "react/jsx-runtime";
|
|
30960
30916
|
var AIEnrichSection = ({
|
|
30961
30917
|
onEnrich,
|
|
@@ -31067,7 +31023,7 @@ var AIEnrichSection = ({
|
|
|
31067
31023
|
size: "small-legacy",
|
|
31068
31024
|
onClick: onCancel,
|
|
31069
31025
|
disabled: isCancelling,
|
|
31070
|
-
leftIcon: isCancelling ? /* @__PURE__ */ jsx240(
|
|
31026
|
+
leftIcon: isCancelling ? /* @__PURE__ */ jsx240(Loader28, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx240(X9, { className: "h-4 w-4" }),
|
|
31071
31027
|
className: "!w-full",
|
|
31072
31028
|
children: isCancelling ? "Cancelling..." : "Cancel Processing"
|
|
31073
31029
|
}
|
|
@@ -31088,7 +31044,7 @@ var AIEnrichSection = ({
|
|
|
31088
31044
|
)) })
|
|
31089
31045
|
] }),
|
|
31090
31046
|
loading && statusMessage && /* @__PURE__ */ jsxs187("div", { className: "flex items-center gap-3 p-3 rounded-lg bg-ods-bg-surface", children: [
|
|
31091
|
-
/* @__PURE__ */ jsx240(
|
|
31047
|
+
/* @__PURE__ */ jsx240(Loader28, { className: "h-5 w-5 text-ods-accent animate-spin" }),
|
|
31092
31048
|
/* @__PURE__ */ jsx240("span", { className: "text-h6 text-ods-text-primary", children: statusMessage })
|
|
31093
31049
|
] }),
|
|
31094
31050
|
hasResults && /* @__PURE__ */ jsxs187("div", { className: "space-y-4", children: [
|
|
@@ -31218,7 +31174,7 @@ function HighlightVideoSection({
|
|
|
31218
31174
|
{
|
|
31219
31175
|
title: "Highlight Video",
|
|
31220
31176
|
description: `Generate a ${Math.floor(targetDurationSeconds / 60)}-minute summary video using Claude AI + Shotstack`,
|
|
31221
|
-
icon: /* @__PURE__ */ jsx241(
|
|
31177
|
+
icon: /* @__PURE__ */ jsx241(Sparkles5, { className: "h-5 w-5" }),
|
|
31222
31178
|
buttonLabel: hasExistingHighlight ? "Regenerate Highlight" : "Generate Highlight",
|
|
31223
31179
|
loadingLabel: "Generating highlight...",
|
|
31224
31180
|
onEnrich: onGenerateHighlight,
|
|
@@ -31262,17 +31218,17 @@ function HighlightVideoSection({
|
|
|
31262
31218
|
onDelete: onDeleteHighlight
|
|
31263
31219
|
}
|
|
31264
31220
|
) : (
|
|
31265
|
-
// Default simple preview
|
|
31266
|
-
// MP4 and Mux HLS alike; aspect-video box reserves the height.
|
|
31221
|
+
// Default simple preview
|
|
31267
31222
|
/* @__PURE__ */ jsxs188("div", { className: "relative rounded-lg border border-ods-border overflow-hidden bg-black", children: [
|
|
31268
|
-
/* @__PURE__ */ jsx241(
|
|
31269
|
-
|
|
31223
|
+
/* @__PURE__ */ jsx241(
|
|
31224
|
+
"video",
|
|
31270
31225
|
{
|
|
31271
|
-
|
|
31272
|
-
|
|
31273
|
-
|
|
31226
|
+
src: highlightVideoUrl,
|
|
31227
|
+
poster: highlightVideoThumbnail || void 0,
|
|
31228
|
+
className: "w-full h-auto max-h-[300px] object-contain",
|
|
31229
|
+
controls: true
|
|
31274
31230
|
}
|
|
31275
|
-
)
|
|
31231
|
+
),
|
|
31276
31232
|
onDeleteHighlight && /* @__PURE__ */ jsxs188(
|
|
31277
31233
|
"button",
|
|
31278
31234
|
{
|
|
@@ -31394,7 +31350,7 @@ function EntitySummaryEditor({
|
|
|
31394
31350
|
}
|
|
31395
31351
|
|
|
31396
31352
|
// src/components/features/transcribe-summarize-section.tsx
|
|
31397
|
-
import { Sparkles as
|
|
31353
|
+
import { Sparkles as Sparkles6 } from "lucide-react";
|
|
31398
31354
|
|
|
31399
31355
|
// src/components/features/ai-enrich/AIStatusIndicator.tsx
|
|
31400
31356
|
init_cn();
|
|
@@ -31526,7 +31482,7 @@ function TranscribeSummarizeSection({
|
|
|
31526
31482
|
{
|
|
31527
31483
|
title,
|
|
31528
31484
|
description,
|
|
31529
|
-
icon: /* @__PURE__ */ jsx246(
|
|
31485
|
+
icon: /* @__PURE__ */ jsx246(Sparkles6, { className: "h-5 w-5" }),
|
|
31530
31486
|
buttonLabel: buttonLabel || defaultButtonLabel,
|
|
31531
31487
|
loadingLabel,
|
|
31532
31488
|
onEnrich: onTranscribe,
|
|
@@ -31544,7 +31500,7 @@ function TranscribeSummarizeSection({
|
|
|
31544
31500
|
}
|
|
31545
31501
|
|
|
31546
31502
|
// src/components/features/video-clips-section.tsx
|
|
31547
|
-
import { Sparkles as
|
|
31503
|
+
import { Sparkles as Sparkles7 } from "lucide-react";
|
|
31548
31504
|
import { jsx as jsx247 } from "react/jsx-runtime";
|
|
31549
31505
|
function VideoClipsSection({
|
|
31550
31506
|
onExtractClips,
|
|
@@ -31569,7 +31525,7 @@ function VideoClipsSection({
|
|
|
31569
31525
|
{
|
|
31570
31526
|
title,
|
|
31571
31527
|
description,
|
|
31572
|
-
icon: /* @__PURE__ */ jsx247(
|
|
31528
|
+
icon: /* @__PURE__ */ jsx247(Sparkles7, { className: "h-5 w-5" }),
|
|
31573
31529
|
buttonLabel: buttonLabel || defaultButtonLabel,
|
|
31574
31530
|
loadingLabel,
|
|
31575
31531
|
onEnrich: onExtractClips,
|
|
@@ -31587,7 +31543,7 @@ function VideoClipsSection({
|
|
|
31587
31543
|
}
|
|
31588
31544
|
|
|
31589
31545
|
// src/components/features/highlight-generation-section.tsx
|
|
31590
|
-
import { Sparkles as
|
|
31546
|
+
import { Sparkles as Sparkles8 } from "lucide-react";
|
|
31591
31547
|
import { jsx as jsx248 } from "react/jsx-runtime";
|
|
31592
31548
|
function HighlightGenerationSection({
|
|
31593
31549
|
onGenerateHighlight,
|
|
@@ -31614,7 +31570,7 @@ function HighlightGenerationSection({
|
|
|
31614
31570
|
{
|
|
31615
31571
|
title,
|
|
31616
31572
|
description: description || defaultDescription,
|
|
31617
|
-
icon: /* @__PURE__ */ jsx248(
|
|
31573
|
+
icon: /* @__PURE__ */ jsx248(Sparkles8, { className: "h-5 w-5" }),
|
|
31618
31574
|
buttonLabel: buttonLabel || defaultButtonLabel,
|
|
31619
31575
|
loadingLabel,
|
|
31620
31576
|
onEnrich: onGenerateHighlight,
|
|
@@ -31696,7 +31652,7 @@ function HighlightVideoPreview({
|
|
|
31696
31652
|
}
|
|
31697
31653
|
|
|
31698
31654
|
// src/components/features/transcribe-and-summarize-combined-section.tsx
|
|
31699
|
-
import { Sparkles as
|
|
31655
|
+
import { Sparkles as Sparkles10 } from "lucide-react";
|
|
31700
31656
|
import { jsx as jsx250, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
31701
31657
|
function TranscribeAndSummarizeCombinedSection({
|
|
31702
31658
|
// AIEnrichSection props
|
|
@@ -31743,7 +31699,7 @@ function TranscribeAndSummarizeCombinedSection({
|
|
|
31743
31699
|
{
|
|
31744
31700
|
title,
|
|
31745
31701
|
description,
|
|
31746
|
-
icon: /* @__PURE__ */ jsx250(
|
|
31702
|
+
icon: /* @__PURE__ */ jsx250(Sparkles10, { className: "h-5 w-5" }),
|
|
31747
31703
|
buttonLabel: buttonLabel || defaultButtonLabel,
|
|
31748
31704
|
loadingLabel,
|
|
31749
31705
|
onEnrich: onTranscribe,
|
|
@@ -31784,7 +31740,7 @@ function TranscribeAndSummarizeCombinedSection({
|
|
|
31784
31740
|
}
|
|
31785
31741
|
|
|
31786
31742
|
// src/components/features/highlight-video-combined-section.tsx
|
|
31787
|
-
import { Sparkles as
|
|
31743
|
+
import { Sparkles as Sparkles11, Upload as Upload7 } from "lucide-react";
|
|
31788
31744
|
init_button2();
|
|
31789
31745
|
import { jsx as jsx251, jsxs as jsxs195 } from "react/jsx-runtime";
|
|
31790
31746
|
function HighlightVideoCombinedSection({
|
|
@@ -31860,7 +31816,7 @@ function HighlightVideoCombinedSection({
|
|
|
31860
31816
|
{
|
|
31861
31817
|
title,
|
|
31862
31818
|
description: description || defaultDescription,
|
|
31863
|
-
icon: /* @__PURE__ */ jsx251(
|
|
31819
|
+
icon: /* @__PURE__ */ jsx251(Sparkles11, { className: "h-5 w-5" }),
|
|
31864
31820
|
buttonLabel: buttonLabel || defaultButtonLabel,
|
|
31865
31821
|
loadingLabel,
|
|
31866
31822
|
onEnrich: onGenerateHighlight,
|
|
@@ -31983,7 +31939,7 @@ function ViewToggle({
|
|
|
31983
31939
|
|
|
31984
31940
|
// src/components/features/policy-configuration-panel.tsx
|
|
31985
31941
|
init_cn();
|
|
31986
|
-
import { useEffect as
|
|
31942
|
+
import { useEffect as useEffect52, useState as useState71 } from "react";
|
|
31987
31943
|
import { ChevronDown as ChevronDown8, Shield as Shield2 } from "lucide-react";
|
|
31988
31944
|
init_button2();
|
|
31989
31945
|
import { Fragment as Fragment43, jsx as jsx253, jsxs as jsxs197 } from "react/jsx-runtime";
|
|
@@ -32161,7 +32117,7 @@ var PolicyConfigurationPanel = ({
|
|
|
32161
32117
|
}) => {
|
|
32162
32118
|
const [expandedIds, setExpandedIds] = useState71(/* @__PURE__ */ new Set());
|
|
32163
32119
|
const [bulkLevels, setBulkLevels] = useState71({});
|
|
32164
|
-
|
|
32120
|
+
useEffect52(() => {
|
|
32165
32121
|
setBulkLevels({});
|
|
32166
32122
|
}, [editMode]);
|
|
32167
32123
|
const handleToggle = (categoryId) => {
|
|
@@ -32201,7 +32157,7 @@ PolicyConfigurationPanel.displayName = "PolicyConfigurationPanel";
|
|
|
32201
32157
|
init_button2();
|
|
32202
32158
|
|
|
32203
32159
|
// src/components/ui/phone-input.tsx
|
|
32204
|
-
import { useCallback as useCallback28, useEffect as
|
|
32160
|
+
import { useCallback as useCallback28, useEffect as useEffect53, useMemo as useMemo27, useRef as useRef37, useState as useState72 } from "react";
|
|
32205
32161
|
import { jsx as jsx254, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
32206
32162
|
function PhoneInput({
|
|
32207
32163
|
value,
|
|
@@ -32235,7 +32191,7 @@ function PhoneInput({
|
|
|
32235
32191
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
32236
32192
|
debounceRef.current = setTimeout(() => runValidation(phone), 300);
|
|
32237
32193
|
}, [runValidation]);
|
|
32238
|
-
|
|
32194
|
+
useEffect53(() => {
|
|
32239
32195
|
return () => {
|
|
32240
32196
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
32241
32197
|
};
|
|
@@ -32302,7 +32258,7 @@ function CountryOption({ country }) {
|
|
|
32302
32258
|
// src/components/features/waitlist-form.tsx
|
|
32303
32259
|
init_cn();
|
|
32304
32260
|
import { getCountries as getCountries2 } from "libphonenumber-js";
|
|
32305
|
-
import { useEffect as
|
|
32261
|
+
import { useEffect as useEffect54, useState as useState73 } from "react";
|
|
32306
32262
|
import { Fragment as Fragment44, jsx as jsx255, jsxs as jsxs199 } from "react/jsx-runtime";
|
|
32307
32263
|
function WaitlistForm({
|
|
32308
32264
|
id = "waitlist-form",
|
|
@@ -32332,12 +32288,12 @@ function WaitlistForm({
|
|
|
32332
32288
|
const [isPhoneInvalid, setIsPhoneInvalid] = useState73(false);
|
|
32333
32289
|
const [showConsentError, setShowConsentError] = useState73(false);
|
|
32334
32290
|
const isMailDomainGeneric = hasGenericEmailDomain(email);
|
|
32335
|
-
|
|
32291
|
+
useEffect54(() => {
|
|
32336
32292
|
if (defaultEmail) {
|
|
32337
32293
|
setEmail(defaultEmail);
|
|
32338
32294
|
}
|
|
32339
32295
|
}, [defaultEmail]);
|
|
32340
|
-
|
|
32296
|
+
useEffect54(() => {
|
|
32341
32297
|
setIsClient(true);
|
|
32342
32298
|
if (!geoApiUrl) return;
|
|
32343
32299
|
const supportedCountries = new Set(getCountries2());
|
|
@@ -32725,7 +32681,7 @@ function useOptionalNotifications() {
|
|
|
32725
32681
|
}
|
|
32726
32682
|
|
|
32727
32683
|
// src/components/features/notifications/notification-drawer.tsx
|
|
32728
|
-
import { useEffect as
|
|
32684
|
+
import { useEffect as useEffect58, useRef as useRef40 } from "react";
|
|
32729
32685
|
|
|
32730
32686
|
// src/components/navigation/app-layout-context.ts
|
|
32731
32687
|
import { createContext as createContext8, useContext as useContext8 } from "react";
|
|
@@ -33220,7 +33176,7 @@ init_button2();
|
|
|
33220
33176
|
init_cn();
|
|
33221
33177
|
|
|
33222
33178
|
// src/components/features/notifications/notification-tile.tsx
|
|
33223
|
-
import { useMemo as useMemo29, useEffect as
|
|
33179
|
+
import { useMemo as useMemo29, useEffect as useEffect57, useState as useState76 } from "react";
|
|
33224
33180
|
init_cn();
|
|
33225
33181
|
import { jsx as jsx258, jsxs as jsxs201 } from "react/jsx-runtime";
|
|
33226
33182
|
var variantBySeverity = {
|
|
@@ -33268,7 +33224,7 @@ function NotificationTile({
|
|
|
33268
33224
|
const initialElapsed = useMemo29(() => Date.now() - createdAt, [createdAt]);
|
|
33269
33225
|
const isLive = !read && !settled && initialElapsed < liveDurationMs;
|
|
33270
33226
|
const counting = isLive && !paused;
|
|
33271
|
-
|
|
33227
|
+
useEffect57(() => {
|
|
33272
33228
|
if (!counting) return;
|
|
33273
33229
|
const remaining = Math.max(0, liveDurationMs - initialElapsed);
|
|
33274
33230
|
const timer = window.setTimeout(() => {
|
|
@@ -33497,7 +33453,7 @@ function DrawerScrollList({
|
|
|
33497
33453
|
const sentinelRef = useRef40(null);
|
|
33498
33454
|
const loadMoreRef = useRef40(loadMore);
|
|
33499
33455
|
loadMoreRef.current = loadMore;
|
|
33500
|
-
|
|
33456
|
+
useEffect58(() => {
|
|
33501
33457
|
if (!loadMore || !hasMore || isLoadingMore) return;
|
|
33502
33458
|
const sentinel = sentinelRef.current;
|
|
33503
33459
|
const root = scrollRef.current;
|
|
@@ -34037,12 +33993,12 @@ function useOptionalTimeTracker() {
|
|
|
34037
33993
|
|
|
34038
33994
|
// src/components/features/time-tracker/time-tracker-panel.tsx
|
|
34039
33995
|
init_cn();
|
|
34040
|
-
import { useEffect as
|
|
33996
|
+
import { useEffect as useEffect60, useState as useState80 } from "react";
|
|
34041
33997
|
init_button();
|
|
34042
33998
|
init_split_button();
|
|
34043
33999
|
|
|
34044
34000
|
// src/components/features/time-tracker/use-tracker-clock.ts
|
|
34045
|
-
import { useEffect as
|
|
34001
|
+
import { useEffect as useEffect59, useState as useState79 } from "react";
|
|
34046
34002
|
function formatElapsed(totalMs) {
|
|
34047
34003
|
const totalSeconds = Math.max(0, Math.floor(totalMs / 1e3));
|
|
34048
34004
|
const hours = Math.floor(totalSeconds / 3600);
|
|
@@ -34053,7 +34009,7 @@ function formatElapsed(totalMs) {
|
|
|
34053
34009
|
}
|
|
34054
34010
|
function useTrackerClock({ status, runningSince, accumulatedMs = 0 }) {
|
|
34055
34011
|
const [now, setNow] = useState79(() => Date.now());
|
|
34056
|
-
|
|
34012
|
+
useEffect59(() => {
|
|
34057
34013
|
if (status !== "tracking") return;
|
|
34058
34014
|
setNow(Date.now());
|
|
34059
34015
|
const id = setInterval(() => setNow(Date.now()), 1e3);
|
|
@@ -34113,7 +34069,7 @@ function TimeTrackerPanel({
|
|
|
34113
34069
|
const isActive = status !== "ready";
|
|
34114
34070
|
const hasContent = selectedTicketId != null || notes.trim() !== "";
|
|
34115
34071
|
const showFieldError = isActive && showValidationError && !hasContent;
|
|
34116
|
-
|
|
34072
|
+
useEffect60(() => {
|
|
34117
34073
|
if (status === "ready") setShowValidationError(false);
|
|
34118
34074
|
}, [status]);
|
|
34119
34075
|
const handleSubmit = () => {
|
|
@@ -34364,7 +34320,7 @@ function LastEntryRow({ entry, onClick }) {
|
|
|
34364
34320
|
// src/components/features/time-tracker/time-tracker-header-button.tsx
|
|
34365
34321
|
init_cn();
|
|
34366
34322
|
import * as PopoverPrimitive5 from "@radix-ui/react-popover";
|
|
34367
|
-
import { useEffect as
|
|
34323
|
+
import { useEffect as useEffect61, useRef as useRef41 } from "react";
|
|
34368
34324
|
|
|
34369
34325
|
// src/components/navigation/header-button.tsx
|
|
34370
34326
|
init_cn();
|
|
@@ -34415,10 +34371,10 @@ function TimeTrackerHeaderButton({ className, disabled }) {
|
|
|
34415
34371
|
}
|
|
34416
34372
|
};
|
|
34417
34373
|
}
|
|
34418
|
-
|
|
34374
|
+
useEffect61(() => {
|
|
34419
34375
|
if (isOpen) coordination?.notifyDrawerDidOpen(selfHandleRef.current ?? void 0);
|
|
34420
34376
|
}, [isOpen, coordination]);
|
|
34421
|
-
|
|
34377
|
+
useEffect61(() => {
|
|
34422
34378
|
if (!selfHandleRef.current) return;
|
|
34423
34379
|
return coordination?.registerDrawer(selfHandleRef.current);
|
|
34424
34380
|
}, [coordination]);
|
|
@@ -35432,7 +35388,7 @@ function SortableRow({
|
|
|
35432
35388
|
|
|
35433
35389
|
// src/components/navigation/header.tsx
|
|
35434
35390
|
init_next_link();
|
|
35435
|
-
import React108, { useEffect as
|
|
35391
|
+
import React108, { useEffect as useEffect64, useRef as useRef45, useState as useState84 } from "react";
|
|
35436
35392
|
init_button2();
|
|
35437
35393
|
|
|
35438
35394
|
// src/components/navigation/mobile-nav-panel.tsx
|
|
@@ -35606,7 +35562,7 @@ function Header2({ config, platform }) {
|
|
|
35606
35562
|
const [openDropdowns, setOpenDropdowns] = useState84({});
|
|
35607
35563
|
const dropdownRefs = useRef45({});
|
|
35608
35564
|
const triggerRefs = useRef45({});
|
|
35609
|
-
|
|
35565
|
+
useEffect64(() => {
|
|
35610
35566
|
const handleClickOutside = (event) => {
|
|
35611
35567
|
const target = event.target;
|
|
35612
35568
|
if (!target) return;
|
|
@@ -35635,14 +35591,14 @@ function Header2({ config, platform }) {
|
|
|
35635
35591
|
document.removeEventListener("keydown", handleEscapeKey);
|
|
35636
35592
|
};
|
|
35637
35593
|
}, [openDropdowns]);
|
|
35638
|
-
|
|
35594
|
+
useEffect64(() => {
|
|
35639
35595
|
return () => {
|
|
35640
35596
|
setOpenDropdowns({});
|
|
35641
35597
|
dropdownRefs.current = {};
|
|
35642
35598
|
triggerRefs.current = {};
|
|
35643
35599
|
};
|
|
35644
35600
|
}, []);
|
|
35645
|
-
|
|
35601
|
+
useEffect64(() => {
|
|
35646
35602
|
if (!config.autoHide) {
|
|
35647
35603
|
setShow(true);
|
|
35648
35604
|
return;
|
|
@@ -35872,7 +35828,7 @@ function Header2({ config, platform }) {
|
|
|
35872
35828
|
}
|
|
35873
35829
|
|
|
35874
35830
|
// src/components/navigation/client-only-header.tsx
|
|
35875
|
-
import { useState as useState85, useEffect as
|
|
35831
|
+
import { useState as useState85, useEffect as useEffect65 } from "react";
|
|
35876
35832
|
|
|
35877
35833
|
// src/components/navigation/header-skeleton.tsx
|
|
35878
35834
|
import { jsx as jsx276, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
@@ -35921,7 +35877,7 @@ function HeaderSkeleton({ config }) {
|
|
|
35921
35877
|
import { jsx as jsx277 } from "react/jsx-runtime";
|
|
35922
35878
|
function ClientOnlyHeader({ config, skeleton }) {
|
|
35923
35879
|
const [isClient, setIsClient] = useState85(false);
|
|
35924
|
-
|
|
35880
|
+
useEffect65(() => {
|
|
35925
35881
|
setIsClient(true);
|
|
35926
35882
|
}, []);
|
|
35927
35883
|
if (!isClient) {
|
|
@@ -35931,7 +35887,7 @@ function ClientOnlyHeader({ config, skeleton }) {
|
|
|
35931
35887
|
}
|
|
35932
35888
|
|
|
35933
35889
|
// src/components/navigation/sliding-sidebar.tsx
|
|
35934
|
-
import { useState as useState86, useEffect as
|
|
35890
|
+
import { useState as useState86, useEffect as useEffect66, useRef as useRef46 } from "react";
|
|
35935
35891
|
import { motion as motion2, AnimatePresence, useReducedMotion } from "framer-motion";
|
|
35936
35892
|
import { usePreventScroll as usePreventScroll4 } from "@react-aria/overlays";
|
|
35937
35893
|
init_button2();
|
|
@@ -35944,7 +35900,7 @@ function SlidingSidebar({ config }) {
|
|
|
35944
35900
|
const prefersReducedMotion2 = useReducedMotion();
|
|
35945
35901
|
usePreventScroll4({ isDisabled: !config.isOpen });
|
|
35946
35902
|
useFocusTrap(asideRef, config.isOpen, { onEscape: config.onClose, contain: false });
|
|
35947
|
-
|
|
35903
|
+
useEffect66(() => {
|
|
35948
35904
|
setMounted(true);
|
|
35949
35905
|
}, []);
|
|
35950
35906
|
const toggleExpanded = (itemId) => {
|
|
@@ -36112,7 +36068,7 @@ function SlidingSidebar({ config }) {
|
|
|
36112
36068
|
}
|
|
36113
36069
|
|
|
36114
36070
|
// src/components/navigation/sticky-section-nav.tsx
|
|
36115
|
-
import { useEffect as
|
|
36071
|
+
import { useEffect as useEffect67, useState as useState87, useCallback as useCallback35, useRef as useRef47 } from "react";
|
|
36116
36072
|
import { jsx as jsx279, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
36117
36073
|
function StickySectionNav({
|
|
36118
36074
|
sections,
|
|
@@ -36186,14 +36142,14 @@ function useSectionNavigation(sections, options) {
|
|
|
36186
36142
|
isScrollingFromClick.current = false;
|
|
36187
36143
|
}, 500);
|
|
36188
36144
|
}, [offset2]);
|
|
36189
|
-
|
|
36145
|
+
useEffect67(() => {
|
|
36190
36146
|
sections.forEach((section) => {
|
|
36191
36147
|
if (section.ref.current && !section.ref.current.id) {
|
|
36192
36148
|
section.ref.current.id = section.id;
|
|
36193
36149
|
}
|
|
36194
36150
|
});
|
|
36195
36151
|
}, [sections]);
|
|
36196
|
-
|
|
36152
|
+
useEffect67(() => {
|
|
36197
36153
|
const handleScroll = () => {
|
|
36198
36154
|
if (isScrollingFromClick.current) return;
|
|
36199
36155
|
const scrollPosition = window.scrollY + offset2 + 50;
|
|
@@ -36226,7 +36182,7 @@ function useSectionNavigation(sections, options) {
|
|
|
36226
36182
|
}
|
|
36227
36183
|
|
|
36228
36184
|
// src/components/navigation/navigation-sidebar.tsx
|
|
36229
|
-
import { useCallback as useCallback36, useEffect as
|
|
36185
|
+
import { useCallback as useCallback36, useEffect as useEffect68, useLayoutEffect as useLayoutEffect6, useMemo as useMemo34, useState as useState88 } from "react";
|
|
36230
36186
|
|
|
36231
36187
|
// src/components/navigation/navigation-sidebar-header.tsx
|
|
36232
36188
|
import { jsx as jsx280, jsxs as jsxs218 } from "react/jsx-runtime";
|
|
@@ -36375,7 +36331,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
36375
36331
|
config.minimized ?? false
|
|
36376
36332
|
);
|
|
36377
36333
|
const [tabletMinimized, setTabletMinimized] = useState88(true);
|
|
36378
|
-
|
|
36334
|
+
useEffect68(() => {
|
|
36379
36335
|
if (isTablet) setTabletMinimized(true);
|
|
36380
36336
|
}, [isTablet]);
|
|
36381
36337
|
const minimized = isTablet ? tabletMinimized : desktopMinimized;
|
|
@@ -36393,7 +36349,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
36393
36349
|
const closeOverlay = useCallback36(() => {
|
|
36394
36350
|
setTabletMinimized(true);
|
|
36395
36351
|
}, []);
|
|
36396
|
-
|
|
36352
|
+
useEffect68(() => {
|
|
36397
36353
|
if (!isOverlayOpen) return;
|
|
36398
36354
|
const handleKeyDown = (e) => {
|
|
36399
36355
|
if (e.key === "Escape") closeOverlay();
|
|
@@ -38520,7 +38476,7 @@ var ListLoader = (props) => /* @__PURE__ */ jsx307(ContentLoader, { ...props, va
|
|
|
38520
38476
|
|
|
38521
38477
|
// src/components/ui/table/table.tsx
|
|
38522
38478
|
init_cn();
|
|
38523
|
-
import { useEffect as
|
|
38479
|
+
import { useEffect as useEffect70, useRef as useRef52 } from "react";
|
|
38524
38480
|
init_pagination();
|
|
38525
38481
|
init_button2();
|
|
38526
38482
|
|
|
@@ -39131,10 +39087,10 @@ function TableRow({
|
|
|
39131
39087
|
}
|
|
39132
39088
|
|
|
39133
39089
|
// src/components/ui/table/use-table-motion.ts
|
|
39134
|
-
import { useEffect as
|
|
39090
|
+
import { useEffect as useEffect69, useState as useState91 } from "react";
|
|
39135
39091
|
function useTableMotion(enabled) {
|
|
39136
39092
|
const [runtime, setRuntime] = useState91(null);
|
|
39137
|
-
|
|
39093
|
+
useEffect69(() => {
|
|
39138
39094
|
if (!enabled || runtime) return;
|
|
39139
39095
|
let active = true;
|
|
39140
39096
|
import("framer-motion").then((m) => {
|
|
@@ -39283,7 +39239,7 @@ function Table({
|
|
|
39283
39239
|
const sentinelRef = useRef52(null);
|
|
39284
39240
|
const onLoadMoreRef = useRef52(infiniteScroll?.onLoadMore);
|
|
39285
39241
|
onLoadMoreRef.current = infiniteScroll?.onLoadMore;
|
|
39286
|
-
|
|
39242
|
+
useEffect70(() => {
|
|
39287
39243
|
if (!infiniteScroll?.hasNextPage || infiniteScroll.isFetchingNextPage) return;
|
|
39288
39244
|
const sentinel = sentinelRef.current;
|
|
39289
39245
|
if (!sentinel) return;
|
|
@@ -40361,7 +40317,7 @@ function DataTableBody({
|
|
|
40361
40317
|
}
|
|
40362
40318
|
|
|
40363
40319
|
// src/components/ui/data-table/data-table-infinite-footer.tsx
|
|
40364
|
-
import { useEffect as
|
|
40320
|
+
import { useEffect as useEffect71, useRef as useRef56 } from "react";
|
|
40365
40321
|
import { Fragment as Fragment63, jsx as jsx330, jsxs as jsxs261 } from "react/jsx-runtime";
|
|
40366
40322
|
function DataTableInfiniteFooter({
|
|
40367
40323
|
hasNextPage,
|
|
@@ -40373,7 +40329,7 @@ function DataTableInfiniteFooter({
|
|
|
40373
40329
|
const sentinelRef = useRef56(null);
|
|
40374
40330
|
const onLoadMoreRef = useRef56(onLoadMore);
|
|
40375
40331
|
onLoadMoreRef.current = onLoadMore;
|
|
40376
|
-
|
|
40332
|
+
useEffect71(() => {
|
|
40377
40333
|
if (!hasNextPage || isFetchingNextPage) return;
|
|
40378
40334
|
const sentinel = sentinelRef.current;
|
|
40379
40335
|
if (!sentinel) return;
|
|
@@ -41007,7 +40963,7 @@ function FilterList({
|
|
|
41007
40963
|
|
|
41008
40964
|
// src/components/ui/tag-search-input.tsx
|
|
41009
40965
|
import {
|
|
41010
|
-
useEffect as
|
|
40966
|
+
useEffect as useEffect73,
|
|
41011
40967
|
useRef as useRef58,
|
|
41012
40968
|
useState as useState95
|
|
41013
40969
|
} from "react";
|
|
@@ -41047,7 +41003,7 @@ function TagSearchInput({
|
|
|
41047
41003
|
const hiddenTagsRef = useRef58(null);
|
|
41048
41004
|
const hiddenTagsPopupRef = useRef58(null);
|
|
41049
41005
|
const [showHiddenTags, setShowHiddenTags] = useState95(false);
|
|
41050
|
-
|
|
41006
|
+
useEffect73(() => {
|
|
41051
41007
|
if (!showHiddenTags) return;
|
|
41052
41008
|
const handleClick = (e) => {
|
|
41053
41009
|
const target = e.target;
|
|
@@ -41202,9 +41158,9 @@ function TagSearchInput({
|
|
|
41202
41158
|
}
|
|
41203
41159
|
|
|
41204
41160
|
// src/components/ui/markdown-editor.tsx
|
|
41205
|
-
import { useRef as useRef59, useCallback as useCallback44, useState as useState96, useEffect as
|
|
41161
|
+
import { useRef as useRef59, useCallback as useCallback44, useState as useState96, useEffect as useEffect74 } from "react";
|
|
41206
41162
|
init_cn();
|
|
41207
|
-
import { Loader2 as
|
|
41163
|
+
import { Loader2 as Loader29, Upload as Upload8 } from "lucide-react";
|
|
41208
41164
|
import { jsx as jsx335, jsxs as jsxs266 } from "react/jsx-runtime";
|
|
41209
41165
|
var MDEditor = dynamic(() => import("@uiw/react-md-editor"), { ssr: false });
|
|
41210
41166
|
var MARKDOWN_EDITOR_STYLE_ID = "ods-markdown-editor-styles";
|
|
@@ -41233,7 +41189,7 @@ body .w-md-editor .w-md-editor-bar::after { content: '' !important; display: blo
|
|
|
41233
41189
|
body .w-md-editor .w-md-editor-bar:hover::after { border-color: var(--color-text-secondary) !important; }
|
|
41234
41190
|
`;
|
|
41235
41191
|
function MarkdownEditorStyles() {
|
|
41236
|
-
|
|
41192
|
+
useEffect74(() => {
|
|
41237
41193
|
if (document.getElementById(MARKDOWN_EDITOR_STYLE_ID)) return;
|
|
41238
41194
|
const style = document.createElement("style");
|
|
41239
41195
|
style.id = MARKDOWN_EDITOR_STYLE_ID;
|
|
@@ -41261,7 +41217,7 @@ function MarkdownEditor({
|
|
|
41261
41217
|
const [isUploading, setIsUploading] = useState96(false);
|
|
41262
41218
|
const [uploadProgress, setUploadProgress] = useState96("");
|
|
41263
41219
|
const [defaultExtraCommands, setDefaultExtraCommands] = useState96([]);
|
|
41264
|
-
|
|
41220
|
+
useEffect74(() => {
|
|
41265
41221
|
import("@uiw/react-md-editor").then((mod) => {
|
|
41266
41222
|
if (mod.commands?.getExtraCommands) {
|
|
41267
41223
|
setDefaultExtraCommands(mod.commands.getExtraCommands());
|
|
@@ -41344,7 +41300,7 @@ function MarkdownEditor({
|
|
|
41344
41300
|
name: "upload",
|
|
41345
41301
|
keyCommand: "upload",
|
|
41346
41302
|
buttonProps: { "aria-label": "Upload file", title: "Upload file" },
|
|
41347
|
-
icon: isUploading ? /* @__PURE__ */ jsx335(
|
|
41303
|
+
icon: isUploading ? /* @__PURE__ */ jsx335(Loader29, { className: "w-3 h-3 animate-spin" }) : /* @__PURE__ */ jsx335(Upload8, { className: "w-3 h-3" }),
|
|
41348
41304
|
execute: () => {
|
|
41349
41305
|
fileInputRef.current?.click();
|
|
41350
41306
|
}
|
|
@@ -41384,7 +41340,7 @@ function MarkdownEditor({
|
|
|
41384
41340
|
}
|
|
41385
41341
|
rafRef.current = requestAnimationFrame(scrollLoop);
|
|
41386
41342
|
}, []);
|
|
41387
|
-
|
|
41343
|
+
useEffect74(() => {
|
|
41388
41344
|
const wrapper = wrapperRef.current;
|
|
41389
41345
|
if (!wrapper) return;
|
|
41390
41346
|
const onMouseMove = (e) => {
|
|
@@ -41432,7 +41388,7 @@ function MarkdownEditor({
|
|
|
41432
41388
|
accept: "image/*,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.zip,.txt"
|
|
41433
41389
|
}
|
|
41434
41390
|
),
|
|
41435
|
-
!MDEditor && /* @__PURE__ */ jsx335("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ jsx335(
|
|
41391
|
+
!MDEditor && /* @__PURE__ */ jsx335("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ jsx335(Loader29, { className: "h-8 w-8 animate-spin" }) }),
|
|
41436
41392
|
MDEditor && /* @__PURE__ */ jsx335(
|
|
41437
41393
|
MDEditor,
|
|
41438
41394
|
{
|
|
@@ -41478,7 +41434,7 @@ function MarkdownEditor({
|
|
|
41478
41434
|
|
|
41479
41435
|
// src/components/ui/file-upload.tsx
|
|
41480
41436
|
import * as React125 from "react";
|
|
41481
|
-
import { Loader2 as
|
|
41437
|
+
import { Loader2 as Loader210 } from "lucide-react";
|
|
41482
41438
|
init_cn();
|
|
41483
41439
|
import { jsx as jsx336, jsxs as jsxs267 } from "react/jsx-runtime";
|
|
41484
41440
|
function formatFileSize2(bytes) {
|
|
@@ -41706,7 +41662,7 @@ function FileUpload({
|
|
|
41706
41662
|
/* @__PURE__ */ jsxs267("div", { className: "flex items-center gap-[var(--spacing-system-xsf)]", children: [
|
|
41707
41663
|
/* @__PURE__ */ jsx336("span", { className: "text-h6 text-ods-text-secondary", children: formatFileSize2(entry.fileSize) }),
|
|
41708
41664
|
entry.status === "uploading" && /* @__PURE__ */ jsxs267("span", { className: "flex items-center gap-[var(--spacing-system-xxs)] text-h6 text-ods-text-secondary", children: [
|
|
41709
|
-
/* @__PURE__ */ jsx336(
|
|
41665
|
+
/* @__PURE__ */ jsx336(Loader210, { className: "size-3 animate-spin" }),
|
|
41710
41666
|
"Uploading..."
|
|
41711
41667
|
] }),
|
|
41712
41668
|
entry.status === "error" && /* @__PURE__ */ jsx336("span", { className: "text-h6 text-ods-error", children: entry.error || "Upload failed" })
|
|
@@ -41794,7 +41750,7 @@ function FileUpload({
|
|
|
41794
41750
|
|
|
41795
41751
|
// src/components/ui/image-uploader.tsx
|
|
41796
41752
|
import * as React126 from "react";
|
|
41797
|
-
import { Loader2 as
|
|
41753
|
+
import { Loader2 as Loader211 } from "lucide-react";
|
|
41798
41754
|
init_cn();
|
|
41799
41755
|
import { Fragment as Fragment65, jsx as jsx337, jsxs as jsxs268 } from "react/jsx-runtime";
|
|
41800
41756
|
var DEFAULT_MAX_SIZE = 25 * 1024 * 1024;
|
|
@@ -41960,8 +41916,8 @@ function ImageUploader({
|
|
|
41960
41916
|
}
|
|
41961
41917
|
)
|
|
41962
41918
|
] }),
|
|
41963
|
-
loading && /* @__PURE__ */ jsx337("div", { className: "absolute inset-0 flex items-center justify-center rounded-md bg-ods-overlay", children: /* @__PURE__ */ jsx337(
|
|
41964
|
-
] }) : loading ? /* @__PURE__ */ jsx337(
|
|
41919
|
+
loading && /* @__PURE__ */ jsx337("div", { className: "absolute inset-0 flex items-center justify-center rounded-md bg-ods-overlay", children: /* @__PURE__ */ jsx337(Loader211, { className: "size-8 animate-spin text-ods-text-on-dark" }) })
|
|
41920
|
+
] }) : loading ? /* @__PURE__ */ jsx337(Loader211, { className: "size-8 animate-spin text-ods-accent" }) : /* @__PURE__ */ jsxs268(Fragment65, { children: [
|
|
41965
41921
|
/* @__PURE__ */ jsx337("div", { className: "flex shrink-0 items-center justify-center rounded-full border border-ods-border bg-ods-card p-[var(--spacing-system-s)]", children: /* @__PURE__ */ jsx337(ImagePlusIcon, { className: "size-6 text-ods-text-primary" }) }),
|
|
41966
41922
|
/* @__PURE__ */ jsxs268("div", { className: "flex w-full flex-col items-center text-center", children: [
|
|
41967
41923
|
/* @__PURE__ */ jsx337("p", { className: "text-h4 text-ods-text-primary", children: label }),
|
|
@@ -42867,7 +42823,7 @@ function ImageGalleryModal({
|
|
|
42867
42823
|
initialIndex = 0
|
|
42868
42824
|
}) {
|
|
42869
42825
|
const [selectedImageIndex, setSelectedImageIndex] = useState103(initialIndex);
|
|
42870
|
-
|
|
42826
|
+
useEffect77(() => {
|
|
42871
42827
|
if (isOpen) {
|
|
42872
42828
|
setSelectedImageIndex(initialIndex);
|
|
42873
42829
|
}
|
|
@@ -42882,7 +42838,7 @@ function ImageGalleryModal({
|
|
|
42882
42838
|
setSelectedImageIndex(selectedImageIndex + 1);
|
|
42883
42839
|
}
|
|
42884
42840
|
};
|
|
42885
|
-
|
|
42841
|
+
useEffect77(() => {
|
|
42886
42842
|
const handleKeyPress = (event) => {
|
|
42887
42843
|
if (!isOpen) return;
|
|
42888
42844
|
switch (event.key) {
|
|
@@ -42981,7 +42937,7 @@ function ImageGalleryModal({
|
|
|
42981
42937
|
import {
|
|
42982
42938
|
Bug,
|
|
42983
42939
|
Inbox,
|
|
42984
|
-
Sparkles as
|
|
42940
|
+
Sparkles as Sparkles12,
|
|
42985
42941
|
BookOpen as BookOpen3,
|
|
42986
42942
|
Trophy,
|
|
42987
42943
|
Component as Component4,
|
|
@@ -43001,7 +42957,7 @@ function iconFor(customItemId) {
|
|
|
43001
42957
|
case CUSTOM_ITEM_ID.REQUEST:
|
|
43002
42958
|
return Inbox;
|
|
43003
42959
|
case CUSTOM_ITEM_ID.FEATURE:
|
|
43004
|
-
return
|
|
42960
|
+
return Sparkles12;
|
|
43005
42961
|
case CUSTOM_ITEM_ID.STORY:
|
|
43006
42962
|
return BookOpen3;
|
|
43007
42963
|
case CUSTOM_ITEM_ID.EPIC:
|
|
@@ -45292,7 +45248,7 @@ function cleanEscapedString(input) {
|
|
|
45292
45248
|
|
|
45293
45249
|
// src/components/chat/entity-cards/program-card.tsx
|
|
45294
45250
|
init_button();
|
|
45295
|
-
import { ExternalLink as ExternalLink12, Clock as Clock2, Play as Play4, Video as
|
|
45251
|
+
import { ExternalLink as ExternalLink12, Clock as Clock2, Play as Play4, Video as Video8 } from "lucide-react";
|
|
45296
45252
|
init_cn();
|
|
45297
45253
|
import { Fragment as Fragment75, jsx as jsx354, jsxs as jsxs283 } from "react/jsx-runtime";
|
|
45298
45254
|
function formatUtc(date, fmt) {
|
|
@@ -45496,7 +45452,7 @@ function ProgramCard({
|
|
|
45496
45452
|
className: "object-contain",
|
|
45497
45453
|
unoptimized: true
|
|
45498
45454
|
}
|
|
45499
|
-
) : /* @__PURE__ */ jsx354("span", { className: "flex h-full w-full items-center justify-center text-ods-accent", children: config.type === "podcast" ? /* @__PURE__ */ jsx354(Play4, { className: "w-4 h-4" }) : config.type === "webinar" ? /* @__PURE__ */ jsx354(
|
|
45455
|
+
) : /* @__PURE__ */ jsx354("span", { className: "flex h-full w-full items-center justify-center text-ods-accent", children: config.type === "podcast" ? /* @__PURE__ */ jsx354(Play4, { className: "w-4 h-4" }) : config.type === "webinar" ? /* @__PURE__ */ jsx354(Video8, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx354(Clock2, { className: "w-4 h-4" }) }),
|
|
45500
45456
|
config.type === "podcast" && !isScheduled && compactCover && /* @__PURE__ */ jsx354("span", { className: "absolute inset-0 flex items-center justify-center bg-black/30", children: /* @__PURE__ */ jsx354(Play4, { className: "w-4 h-4 text-ods-text-on-dark", fill: "white" }) })
|
|
45501
45457
|
] }),
|
|
45502
45458
|
/* @__PURE__ */ jsxs283("span", { className: COMPACT_CARD_TEXT_COL, children: [
|
|
@@ -45523,7 +45479,7 @@ function ProgramCard({
|
|
|
45523
45479
|
const webinarItem = item;
|
|
45524
45480
|
const duration = formatDurationFromRange(webinarItem.start_at, webinarItem.end_at);
|
|
45525
45481
|
return /* @__PURE__ */ jsxs283(Fragment75, { children: [
|
|
45526
|
-
/* @__PURE__ */ jsx354(
|
|
45482
|
+
/* @__PURE__ */ jsx354(Video8, { className: "w-4 h-4 text-ods-text-secondary" }),
|
|
45527
45483
|
/* @__PURE__ */ jsxs283("span", { className: "font-body text-ods-text-secondary", children: [
|
|
45528
45484
|
formatTimeWithTimezone(webinarItem.start_at, webinarItem.timezone ?? null),
|
|
45529
45485
|
duration && ` \xB7 ${duration}`
|
|
@@ -47235,7 +47191,7 @@ function useChunkCatchup({
|
|
|
47235
47191
|
}
|
|
47236
47192
|
|
|
47237
47193
|
// src/components/chat/hooks/use-scripted-stream.ts
|
|
47238
|
-
import { useEffect as
|
|
47194
|
+
import { useEffect as useEffect78, useState as useState106 } from "react";
|
|
47239
47195
|
var EMPTY_FRAME = { messages: [], phase: "idle", typing: false, delayMs: 0 };
|
|
47240
47196
|
function prefersReducedMotion() {
|
|
47241
47197
|
return typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches === true;
|
|
@@ -47248,7 +47204,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
|
|
|
47248
47204
|
setPrevKey(resetKey);
|
|
47249
47205
|
setIndex(0);
|
|
47250
47206
|
}
|
|
47251
|
-
|
|
47207
|
+
useEffect78(() => {
|
|
47252
47208
|
setReducedMotion(prefersReducedMotion());
|
|
47253
47209
|
const mq = window.matchMedia?.("(prefers-reduced-motion: reduce)");
|
|
47254
47210
|
if (!mq) return;
|
|
@@ -47258,7 +47214,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
|
|
|
47258
47214
|
}, []);
|
|
47259
47215
|
const playing = enabled && !reducedMotion && frames.length > 0;
|
|
47260
47216
|
const lastIndex = Math.max(0, frames.length - 1);
|
|
47261
|
-
|
|
47217
|
+
useEffect78(() => {
|
|
47262
47218
|
if (!playing || index >= lastIndex) return;
|
|
47263
47219
|
const current = frames[Math.min(index, lastIndex)] ?? EMPTY_FRAME;
|
|
47264
47220
|
const t = setTimeout(() => setIndex((i) => Math.min(i + 1, lastIndex)), current.delayMs);
|
|
@@ -47270,7 +47226,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
|
|
|
47270
47226
|
}
|
|
47271
47227
|
|
|
47272
47228
|
// src/components/chat/hooks/use-jetstream-dialog-subscription.ts
|
|
47273
|
-
import { useEffect as
|
|
47229
|
+
import { useEffect as useEffect79, useRef as useRef64, useState as useState107 } from "react";
|
|
47274
47230
|
var DEFAULT_INACTIVE_THRESHOLD_MS = 5 * 6e4;
|
|
47275
47231
|
var DEFAULT_STREAM_NAME = "CHAT_CHUNKS";
|
|
47276
47232
|
function useJetStreamDialogSubscription({
|
|
@@ -47297,49 +47253,49 @@ function useJetStreamDialogSubscription({
|
|
|
47297
47253
|
const subscriptionRef = useRef64(null);
|
|
47298
47254
|
const highestStreamSeqRef = useRef64(null);
|
|
47299
47255
|
const onEventRef = useRef64(onEvent);
|
|
47300
|
-
|
|
47256
|
+
useEffect79(() => {
|
|
47301
47257
|
onEventRef.current = onEvent;
|
|
47302
47258
|
}, [onEvent]);
|
|
47303
47259
|
const onConnectRef = useRef64(onConnect);
|
|
47304
|
-
|
|
47260
|
+
useEffect79(() => {
|
|
47305
47261
|
onConnectRef.current = onConnect;
|
|
47306
47262
|
}, [onConnect]);
|
|
47307
47263
|
const onDisconnectRef = useRef64(onDisconnect);
|
|
47308
|
-
|
|
47264
|
+
useEffect79(() => {
|
|
47309
47265
|
onDisconnectRef.current = onDisconnect;
|
|
47310
47266
|
}, [onDisconnect]);
|
|
47311
47267
|
const onSubscribedRef = useRef64(onSubscribed);
|
|
47312
|
-
|
|
47268
|
+
useEffect79(() => {
|
|
47313
47269
|
onSubscribedRef.current = onSubscribed;
|
|
47314
47270
|
}, [onSubscribed]);
|
|
47315
47271
|
const onBeforeReconnectRef = useRef64(onBeforeReconnect);
|
|
47316
|
-
|
|
47272
|
+
useEffect79(() => {
|
|
47317
47273
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
47318
47274
|
}, [onBeforeReconnect]);
|
|
47319
47275
|
const getNatsWsUrlRef = useRef64(getNatsWsUrl);
|
|
47320
|
-
|
|
47276
|
+
useEffect79(() => {
|
|
47321
47277
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
47322
47278
|
}, [getNatsWsUrl]);
|
|
47323
47279
|
const reconnectionBackoffRef = useRef64(reconnectionBackoff);
|
|
47324
|
-
|
|
47280
|
+
useEffect79(() => {
|
|
47325
47281
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
47326
47282
|
}, [reconnectionBackoff]);
|
|
47327
47283
|
const optStartSeqRef = useRef64(optStartSeq);
|
|
47328
|
-
|
|
47284
|
+
useEffect79(() => {
|
|
47329
47285
|
optStartSeqRef.current = optStartSeq;
|
|
47330
47286
|
}, [optStartSeq]);
|
|
47331
47287
|
const inactiveThresholdRef = useRef64(inactiveThresholdMs);
|
|
47332
|
-
|
|
47288
|
+
useEffect79(() => {
|
|
47333
47289
|
inactiveThresholdRef.current = inactiveThresholdMs;
|
|
47334
47290
|
}, [inactiveThresholdMs]);
|
|
47335
47291
|
const hadConnectionBeforeRef = useRef64(false);
|
|
47336
47292
|
const clientConfigRef = useRef64(clientConfig);
|
|
47337
|
-
|
|
47293
|
+
useEffect79(() => {
|
|
47338
47294
|
clientConfigRef.current = clientConfig;
|
|
47339
47295
|
}, [clientConfig]);
|
|
47340
47296
|
const currentWsUrlRef = useRef64("");
|
|
47341
47297
|
const wsUrl = getNatsWsUrl();
|
|
47342
|
-
|
|
47298
|
+
useEffect79(() => {
|
|
47343
47299
|
if (!enabled || !wsUrl) {
|
|
47344
47300
|
if (currentWsUrlRef.current && clientRef.current) {
|
|
47345
47301
|
releaseClient(currentWsUrlRef.current);
|
|
@@ -47420,11 +47376,11 @@ function useJetStreamDialogSubscription({
|
|
|
47420
47376
|
}
|
|
47421
47377
|
};
|
|
47422
47378
|
}, [enabled, wsUrl]);
|
|
47423
|
-
|
|
47379
|
+
useEffect79(() => {
|
|
47424
47380
|
highestStreamSeqRef.current = null;
|
|
47425
47381
|
setCurrentStreamSeq(null);
|
|
47426
47382
|
}, [dialogId]);
|
|
47427
|
-
|
|
47383
|
+
useEffect79(() => {
|
|
47428
47384
|
if (!enabled || !dialogId || !isConnected) {
|
|
47429
47385
|
if (subscriptionRef.current) {
|
|
47430
47386
|
try {
|
|
@@ -47511,7 +47467,7 @@ function useJetStreamDialogSubscription({
|
|
|
47511
47467
|
}
|
|
47512
47468
|
|
|
47513
47469
|
// src/components/chat/hooks/use-nats-dialog-subscription.ts
|
|
47514
|
-
import { useEffect as
|
|
47470
|
+
import { useEffect as useEffect80, useRef as useRef65, useState as useState108 } from "react";
|
|
47515
47471
|
function useNatsDialogSubscription({
|
|
47516
47472
|
enabled,
|
|
47517
47473
|
dialogId,
|
|
@@ -47531,41 +47487,41 @@ function useNatsDialogSubscription({
|
|
|
47531
47487
|
const clientRef = useRef65(null);
|
|
47532
47488
|
const subscriptionRefs = useRef65(/* @__PURE__ */ new Map());
|
|
47533
47489
|
const onEventRef = useRef65(onEvent);
|
|
47534
|
-
|
|
47490
|
+
useEffect80(() => {
|
|
47535
47491
|
onEventRef.current = onEvent;
|
|
47536
47492
|
}, [onEvent]);
|
|
47537
47493
|
const onConnectRef = useRef65(onConnect);
|
|
47538
|
-
|
|
47494
|
+
useEffect80(() => {
|
|
47539
47495
|
onConnectRef.current = onConnect;
|
|
47540
47496
|
}, [onConnect]);
|
|
47541
47497
|
const onDisconnectRef = useRef65(onDisconnect);
|
|
47542
|
-
|
|
47498
|
+
useEffect80(() => {
|
|
47543
47499
|
onDisconnectRef.current = onDisconnect;
|
|
47544
47500
|
}, [onDisconnect]);
|
|
47545
47501
|
const onSubscribedRef = useRef65(onSubscribed);
|
|
47546
|
-
|
|
47502
|
+
useEffect80(() => {
|
|
47547
47503
|
onSubscribedRef.current = onSubscribed;
|
|
47548
47504
|
}, [onSubscribed]);
|
|
47549
47505
|
const onBeforeReconnectRef = useRef65(onBeforeReconnect);
|
|
47550
|
-
|
|
47506
|
+
useEffect80(() => {
|
|
47551
47507
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
47552
47508
|
}, [onBeforeReconnect]);
|
|
47553
47509
|
const hadConnectionBeforeRef = useRef65(false);
|
|
47554
47510
|
const getNatsWsUrlRef = useRef65(getNatsWsUrl);
|
|
47555
|
-
|
|
47511
|
+
useEffect80(() => {
|
|
47556
47512
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
47557
47513
|
}, [getNatsWsUrl]);
|
|
47558
47514
|
const reconnectionBackoffRef = useRef65(reconnectionBackoff);
|
|
47559
|
-
|
|
47515
|
+
useEffect80(() => {
|
|
47560
47516
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
47561
47517
|
}, [reconnectionBackoff]);
|
|
47562
47518
|
const clientConfigRef = useRef65(clientConfig);
|
|
47563
|
-
|
|
47519
|
+
useEffect80(() => {
|
|
47564
47520
|
clientConfigRef.current = clientConfig;
|
|
47565
47521
|
}, [clientConfig]);
|
|
47566
47522
|
const currentWsUrlRef = useRef65("");
|
|
47567
47523
|
const wsUrl = getNatsWsUrl();
|
|
47568
|
-
|
|
47524
|
+
useEffect80(() => {
|
|
47569
47525
|
if (!enabled || !wsUrl) {
|
|
47570
47526
|
if (currentWsUrlRef.current && clientRef.current) {
|
|
47571
47527
|
releaseClient(currentWsUrlRef.current);
|
|
@@ -47651,12 +47607,12 @@ function useNatsDialogSubscription({
|
|
|
47651
47607
|
topicsRef.current = topics;
|
|
47652
47608
|
const lastSubscribedDialogIdRef = useRef65(null);
|
|
47653
47609
|
const isConnectedRef = useRef65(isConnected);
|
|
47654
|
-
|
|
47610
|
+
useEffect80(() => {
|
|
47655
47611
|
isConnectedRef.current = isConnected;
|
|
47656
47612
|
}, [isConnected]);
|
|
47657
47613
|
const currentDialogIdRef = useRef65(null);
|
|
47658
47614
|
const abortControllerRef = useRef65(null);
|
|
47659
|
-
|
|
47615
|
+
useEffect80(() => {
|
|
47660
47616
|
currentDialogIdRef.current = dialogId;
|
|
47661
47617
|
if (!enabled || !dialogId) {
|
|
47662
47618
|
if (subscriptionRefs.current.size > 0) {
|
|
@@ -47737,7 +47693,7 @@ function useNatsDialogSubscription({
|
|
|
47737
47693
|
abortControllerRef.current = null;
|
|
47738
47694
|
};
|
|
47739
47695
|
}, [enabled, dialogId, topicsKey]);
|
|
47740
|
-
|
|
47696
|
+
useEffect80(() => {
|
|
47741
47697
|
if (!enabled || !currentDialogIdRef.current || !isConnected) {
|
|
47742
47698
|
return;
|
|
47743
47699
|
}
|
|
@@ -47787,7 +47743,7 @@ function buildNatsWsUrl(apiBaseUrl, options) {
|
|
|
47787
47743
|
}
|
|
47788
47744
|
|
|
47789
47745
|
// src/components/chat/hooks/use-realtime-chunk-processor.ts
|
|
47790
|
-
import { useCallback as useCallback47, useRef as useRef66, useEffect as
|
|
47746
|
+
import { useCallback as useCallback47, useRef as useRef66, useEffect as useEffect81 } from "react";
|
|
47791
47747
|
|
|
47792
47748
|
// src/components/chat/utils/chunk-parser.ts
|
|
47793
47749
|
function normalizeToolCalls(raw) {
|
|
@@ -48449,7 +48405,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
48449
48405
|
})
|
|
48450
48406
|
);
|
|
48451
48407
|
const hasInitializedWithData = useRef66(false);
|
|
48452
|
-
|
|
48408
|
+
useEffect81(() => {
|
|
48453
48409
|
if (initialState && !hasInitializedWithData.current) {
|
|
48454
48410
|
accumulatorRef.current.initializeWithState(initialState);
|
|
48455
48411
|
if (initialState.escalatedApprovals) {
|
|
@@ -48467,7 +48423,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
48467
48423
|
const directModeFlagRef = useRef66(isDirectMode);
|
|
48468
48424
|
const sawDirectMessageRef = useRef66(false);
|
|
48469
48425
|
const directTeardownFiredRef = useRef66(false);
|
|
48470
|
-
|
|
48426
|
+
useEffect81(() => {
|
|
48471
48427
|
directModeFlagRef.current = isDirectMode;
|
|
48472
48428
|
}, [isDirectMode]);
|
|
48473
48429
|
const pendingEscalatedRef = useRef66(/* @__PURE__ */ new Map());
|
|
@@ -48746,7 +48702,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
48746
48702
|
}
|
|
48747
48703
|
|
|
48748
48704
|
// src/components/chat/hooks/use-slash-commands.ts
|
|
48749
|
-
import { useEffect as
|
|
48705
|
+
import { useEffect as useEffect82, useState as useState109 } from "react";
|
|
48750
48706
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
48751
48707
|
async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
48752
48708
|
try {
|
|
@@ -48765,7 +48721,7 @@ async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
|
48765
48721
|
function useSlashCommands(prefix, commandsUrl) {
|
|
48766
48722
|
const [commands, setCommands] = useState109([]);
|
|
48767
48723
|
const [loading, setLoading] = useState109(false);
|
|
48768
|
-
|
|
48724
|
+
useEffect82(() => {
|
|
48769
48725
|
if (prefix == null) {
|
|
48770
48726
|
setCommands([]);
|
|
48771
48727
|
return;
|
|
@@ -49114,7 +49070,7 @@ function useChatAttachments() {
|
|
|
49114
49070
|
}
|
|
49115
49071
|
|
|
49116
49072
|
// src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
|
|
49117
|
-
import { useCallback as useCallback49, useEffect as
|
|
49073
|
+
import { useCallback as useCallback49, useEffect as useEffect83, useRef as useRef68, useState as useState111 } from "react";
|
|
49118
49074
|
import { jsx as jsx359 } from "react/jsx-runtime";
|
|
49119
49075
|
var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
|
|
49120
49076
|
function useChatAttachmentImageGallery() {
|
|
@@ -49123,7 +49079,7 @@ function useChatAttachmentImageGallery() {
|
|
|
49123
49079
|
const panelRef = useRef68(null);
|
|
49124
49080
|
const [state, setState] = useState111(CLOSED);
|
|
49125
49081
|
const handleClose = useCallback49(() => setState(CLOSED), []);
|
|
49126
|
-
|
|
49082
|
+
useEffect83(() => {
|
|
49127
49083
|
const root = panelRef.current;
|
|
49128
49084
|
if (!root) return;
|
|
49129
49085
|
const onClick = (ev) => {
|
|
@@ -49169,7 +49125,7 @@ function absolutize(prefix) {
|
|
|
49169
49125
|
}
|
|
49170
49126
|
|
|
49171
49127
|
// src/components/chat/hooks/use-chat-identity.ts
|
|
49172
|
-
import { createContext as createContext12, createElement as createElement2, useContext as useContext12, useEffect as
|
|
49128
|
+
import { createContext as createContext12, createElement as createElement2, useContext as useContext12, useEffect as useEffect84, useState as useState112 } from "react";
|
|
49173
49129
|
var ANON_DEFAULTS = {
|
|
49174
49130
|
authTier: "anon",
|
|
49175
49131
|
source: null,
|
|
@@ -49182,7 +49138,7 @@ function useResolveChatIdentity(enabled) {
|
|
|
49182
49138
|
const proxyEmail = getEmbedProxyAuth()?.email ?? null;
|
|
49183
49139
|
const [data, setData] = useState112(ANON_DEFAULTS);
|
|
49184
49140
|
const [isLoading, setIsLoading] = useState112(enabled);
|
|
49185
|
-
|
|
49141
|
+
useEffect84(() => {
|
|
49186
49142
|
if (!enabled) return;
|
|
49187
49143
|
let cancelled = false;
|
|
49188
49144
|
const ctrl = new AbortController();
|
|
@@ -49224,11 +49180,11 @@ function useChatIdentity() {
|
|
|
49224
49180
|
}
|
|
49225
49181
|
|
|
49226
49182
|
// src/components/chat/hooks/use-close-on-navigation.ts
|
|
49227
|
-
import { useEffect as
|
|
49183
|
+
import { useEffect as useEffect85, useRef as useRef69 } from "react";
|
|
49228
49184
|
function useCloseOnNavigation(close, pathname) {
|
|
49229
49185
|
const prevPathnameRef = useRef69(null);
|
|
49230
49186
|
const initializedRef = useRef69(false);
|
|
49231
|
-
|
|
49187
|
+
useEffect85(() => {
|
|
49232
49188
|
if (!initializedRef.current) {
|
|
49233
49189
|
initializedRef.current = true;
|
|
49234
49190
|
prevPathnameRef.current = pathname;
|
|
@@ -49242,7 +49198,7 @@ function useCloseOnNavigation(close, pathname) {
|
|
|
49242
49198
|
}
|
|
49243
49199
|
|
|
49244
49200
|
// src/components/chat/hooks/use-chat.ts
|
|
49245
|
-
import { useState as useState114, useCallback as useCallback51, useEffect as
|
|
49201
|
+
import { useState as useState114, useCallback as useCallback51, useEffect as useEffect86, useRef as useRef71 } from "react";
|
|
49246
49202
|
|
|
49247
49203
|
// src/components/chat/hooks/use-sse.ts
|
|
49248
49204
|
import { useState as useState113, useCallback as useCallback50, useRef as useRef70 } from "react";
|
|
@@ -49320,7 +49276,7 @@ function useChat({
|
|
|
49320
49276
|
const currentAssistantSegmentsRef = useRef71([]);
|
|
49321
49277
|
const onMessagesChangeRef = useRef71(onMessagesChange);
|
|
49322
49278
|
onMessagesChangeRef.current = onMessagesChange;
|
|
49323
|
-
|
|
49279
|
+
useEffect86(() => {
|
|
49324
49280
|
onMessagesChangeRef.current?.(messages);
|
|
49325
49281
|
}, [messages]);
|
|
49326
49282
|
const {
|
|
@@ -49609,7 +49565,7 @@ function useChat({
|
|
|
49609
49565
|
}
|
|
49610
49566
|
|
|
49611
49567
|
// src/components/chat/hooks/use-sse-chat-adapter.ts
|
|
49612
|
-
import { useState as useState115, useEffect as
|
|
49568
|
+
import { useState as useState115, useEffect as useEffect87, useCallback as useCallback52, useMemo as useMemo42, useRef as useRef72 } from "react";
|
|
49613
49569
|
function createEmptyTurnMeta() {
|
|
49614
49570
|
return {
|
|
49615
49571
|
provider: null,
|
|
@@ -50133,7 +50089,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
50133
50089
|
}
|
|
50134
50090
|
}
|
|
50135
50091
|
}, [chatClearMessages, source, bumpMetaTick]);
|
|
50136
|
-
|
|
50092
|
+
useEffect87(() => {
|
|
50137
50093
|
if (!isTyping && !isStreaming && streamingPhase !== "idle") {
|
|
50138
50094
|
setStreamingPhase("idle");
|
|
50139
50095
|
}
|
|
@@ -50215,7 +50171,7 @@ var noopRejectRequest = async (_id, _reason) => {
|
|
|
50215
50171
|
// src/components/chat/hooks/use-nats-chat-adapter.ts
|
|
50216
50172
|
import {
|
|
50217
50173
|
useCallback as useCallback53,
|
|
50218
|
-
useEffect as
|
|
50174
|
+
useEffect as useEffect88,
|
|
50219
50175
|
useMemo as useMemo43,
|
|
50220
50176
|
useRef as useRef73,
|
|
50221
50177
|
useState as useState116
|
|
@@ -51255,7 +51211,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51255
51211
|
]
|
|
51256
51212
|
);
|
|
51257
51213
|
const prevDialogIdRef = useRef73(void 0);
|
|
51258
|
-
|
|
51214
|
+
useEffect88(() => {
|
|
51259
51215
|
if (prevDialogIdRef.current === dialogId) return;
|
|
51260
51216
|
prevDialogIdRef.current = dialogId;
|
|
51261
51217
|
historyLoadSeqRef.current += 1;
|
|
@@ -51272,7 +51228,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51272
51228
|
if (!active || !dialogId) return;
|
|
51273
51229
|
void loadDialogHistory(dialogId);
|
|
51274
51230
|
}, [active, dialogId, loadDialogHistory, resetAccumulator]);
|
|
51275
|
-
|
|
51231
|
+
useEffect88(() => {
|
|
51276
51232
|
if (!active || !dialogId) return;
|
|
51277
51233
|
suppressAgentBusyRef.current += 1;
|
|
51278
51234
|
resetChunkTracking();
|
|
@@ -51324,7 +51280,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51324
51280
|
})();
|
|
51325
51281
|
}
|
|
51326
51282
|
});
|
|
51327
|
-
|
|
51283
|
+
useEffect88(() => {
|
|
51328
51284
|
if (!active || !dialogId) {
|
|
51329
51285
|
setConnectionState("connected");
|
|
51330
51286
|
return;
|
|
@@ -51363,7 +51319,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51363
51319
|
const reloadDialogs = useCallback53(() => {
|
|
51364
51320
|
void loadDialogsPage();
|
|
51365
51321
|
}, [loadDialogsPage]);
|
|
51366
|
-
|
|
51322
|
+
useEffect88(() => {
|
|
51367
51323
|
if (!fetchDialogs) return;
|
|
51368
51324
|
if (!active) return;
|
|
51369
51325
|
if (initialDialogsLoadedRef.current) return;
|
|
@@ -51945,7 +51901,7 @@ function buildStreamFrames(messages) {
|
|
|
51945
51901
|
|
|
51946
51902
|
// src/components/chat/embeddable-chat.tsx
|
|
51947
51903
|
init_cn();
|
|
51948
|
-
import { useCallback as useCallback56, useEffect as
|
|
51904
|
+
import { useCallback as useCallback56, useEffect as useEffect89, useMemo as useMemo46, useRef as useRef76, useState as useState118 } from "react";
|
|
51949
51905
|
import * as DialogPrimitive4 from "@radix-ui/react-dialog";
|
|
51950
51906
|
import { usePreventScroll as usePreventScroll6 } from "@react-aria/overlays";
|
|
51951
51907
|
import { isIOS } from "@react-aria/utils";
|
|
@@ -52217,7 +52173,7 @@ var RAIL_ANIM_MS = 320;
|
|
|
52217
52173
|
function useRailPresence(open) {
|
|
52218
52174
|
const [mounted, setMounted] = useState118(open);
|
|
52219
52175
|
const [active, setActive] = useState118(false);
|
|
52220
|
-
|
|
52176
|
+
useEffect89(() => {
|
|
52221
52177
|
if (open) {
|
|
52222
52178
|
setMounted(true);
|
|
52223
52179
|
let raf2 = 0;
|
|
@@ -52542,7 +52498,7 @@ function EmbeddableChatInner({
|
|
|
52542
52498
|
const commandsUrl = runtime.endpoints.commandsUrl;
|
|
52543
52499
|
const { attachmentsEnabled, user: identityUser } = useChatIdentity();
|
|
52544
52500
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
52545
|
-
|
|
52501
|
+
useEffect89(() => {
|
|
52546
52502
|
if (process.env.NODE_ENV !== "production") {
|
|
52547
52503
|
const hasOpen = open !== void 0;
|
|
52548
52504
|
const hasHandler = onOpenChange !== void 0;
|
|
@@ -52564,7 +52520,7 @@ function EmbeddableChatInner({
|
|
|
52564
52520
|
});
|
|
52565
52521
|
usePreventScroll6({ isDisabled: !isOpen || shellLess });
|
|
52566
52522
|
const navigatingAwayRef = useRef76(false);
|
|
52567
|
-
|
|
52523
|
+
useEffect89(() => {
|
|
52568
52524
|
if (!isOpen) return;
|
|
52569
52525
|
if (shellLess) return;
|
|
52570
52526
|
if (typeof window === "undefined") return;
|
|
@@ -52695,7 +52651,7 @@ function EmbeddableChatInner({
|
|
|
52695
52651
|
loadMoreMessages
|
|
52696
52652
|
} = useUnifiedChat({ modes: effectiveModes, activeMode, mingoStateOverride: mingoState });
|
|
52697
52653
|
const guidePromptSentRef = useRef76(false);
|
|
52698
|
-
|
|
52654
|
+
useEffect89(() => {
|
|
52699
52655
|
if (!guidePendingPrompt) {
|
|
52700
52656
|
guidePromptSentRef.current = false;
|
|
52701
52657
|
return;
|
|
@@ -52720,11 +52676,11 @@ function EmbeddableChatInner({
|
|
|
52720
52676
|
const [contextPickerOpen, setContextPickerOpen] = useState118(false);
|
|
52721
52677
|
const [mentionQuery, setMentionQuery] = useState118(null);
|
|
52722
52678
|
const mentionActiveRef = useRef76(false);
|
|
52723
|
-
|
|
52679
|
+
useEffect89(() => {
|
|
52724
52680
|
mentionActiveRef.current = mentionQuery !== null;
|
|
52725
52681
|
}, [mentionQuery]);
|
|
52726
52682
|
const mentionKeysRef = useRef76(/* @__PURE__ */ new Set());
|
|
52727
|
-
|
|
52683
|
+
useEffect89(() => {
|
|
52728
52684
|
setContextItems([]);
|
|
52729
52685
|
setMentionQuery(null);
|
|
52730
52686
|
mentionKeysRef.current.clear();
|
|
@@ -52947,7 +52903,7 @@ function EmbeddableChatInner({
|
|
|
52947
52903
|
});
|
|
52948
52904
|
const handleOpen = useCallback56(() => setIsOpen(true), [setIsOpen]);
|
|
52949
52905
|
useCloseOnNavigation(handleNavigationClose, null);
|
|
52950
|
-
|
|
52906
|
+
useEffect89(() => {
|
|
52951
52907
|
const handler = (e) => {
|
|
52952
52908
|
const detail = e.detail;
|
|
52953
52909
|
if (!detail || detail.source !== source) return;
|
|
@@ -52957,7 +52913,7 @@ function EmbeddableChatInner({
|
|
|
52957
52913
|
window.addEventListener("ask-ai:open-with-ref", handler);
|
|
52958
52914
|
return () => window.removeEventListener("ask-ai:open-with-ref", handler);
|
|
52959
52915
|
}, [source, discussRef, setIsOpen]);
|
|
52960
|
-
|
|
52916
|
+
useEffect89(() => {
|
|
52961
52917
|
const handler = (e) => {
|
|
52962
52918
|
const detail = e.detail;
|
|
52963
52919
|
if (!detail || detail.source !== source) return;
|
|
@@ -52974,7 +52930,7 @@ function EmbeddableChatInner({
|
|
|
52974
52930
|
const contentViewKey = hasConversation ? "conversation" : activeMode;
|
|
52975
52931
|
const isGuideEmpty = !hasConversation && activeMode === "guide";
|
|
52976
52932
|
const isQuickActionEmpty = !hasConversation && (activeMode === "guide" || activeMode === "mingo");
|
|
52977
|
-
|
|
52933
|
+
useEffect89(() => {
|
|
52978
52934
|
if (!isQuickActionEmpty) setQuickActionPreview(null);
|
|
52979
52935
|
}, [isQuickActionEmpty]);
|
|
52980
52936
|
const guideCanReturnToMingo = isGuideEmpty && hasMingoMode;
|
|
@@ -53019,7 +52975,7 @@ function EmbeddableChatInner({
|
|
|
53019
52975
|
const [portalHost, setPortalHost] = useState118(null);
|
|
53020
52976
|
const [panelWidth, setPanelWidth] = useState118(0);
|
|
53021
52977
|
const panelMeasureRef = useRef76(null);
|
|
53022
|
-
|
|
52978
|
+
useEffect89(() => {
|
|
53023
52979
|
const el = panelMeasureRef.current;
|
|
53024
52980
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
53025
52981
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -53031,7 +52987,7 @@ function EmbeddableChatInner({
|
|
|
53031
52987
|
return () => ro.disconnect();
|
|
53032
52988
|
}, []);
|
|
53033
52989
|
const [railCollapsed, setRailCollapsed] = useState118(false);
|
|
53034
|
-
|
|
52990
|
+
useEffect89(() => {
|
|
53035
52991
|
try {
|
|
53036
52992
|
if (window.localStorage.getItem(RAIL_COLLAPSED_STORAGE_KEY) === "1")
|
|
53037
52993
|
setRailCollapsed(true);
|
|
@@ -53056,7 +53012,7 @@ function EmbeddableChatInner({
|
|
|
53056
53012
|
const railPresence = useRailPresence(splitActive);
|
|
53057
53013
|
const showWideHeader = wideMingo || railPresence.mounted;
|
|
53058
53014
|
const [composeOpen, setComposeOpen] = useState118(false);
|
|
53059
|
-
|
|
53015
|
+
useEffect89(() => {
|
|
53060
53016
|
if (hasConversation) setComposeOpen(false);
|
|
53061
53017
|
}, [hasConversation]);
|
|
53062
53018
|
const isMingoMode = activeMode === "mingo";
|
|
@@ -53804,11 +53760,6 @@ export {
|
|
|
53804
53760
|
VideoPlayBadge,
|
|
53805
53761
|
VideoUnmuteGlyph,
|
|
53806
53762
|
fetchPriorityProp,
|
|
53807
|
-
MUX_STREAM_ORIGIN,
|
|
53808
|
-
MUX_IMAGE_ORIGIN,
|
|
53809
|
-
saveDataEnabled,
|
|
53810
|
-
useVideoOriginPreconnect,
|
|
53811
|
-
useVideoWarmup,
|
|
53812
53763
|
extractYouTubeId,
|
|
53813
53764
|
Video2 as Video,
|
|
53814
53765
|
MediaCarousel,
|
|
@@ -53996,6 +53947,10 @@ export {
|
|
|
53996
53947
|
getProxiedImageUrl2,
|
|
53997
53948
|
WhatIShippedCard,
|
|
53998
53949
|
WhatIShippedCardSkeleton,
|
|
53950
|
+
MUX_STREAM_ORIGIN,
|
|
53951
|
+
MUX_IMAGE_ORIGIN,
|
|
53952
|
+
useVideoOriginPreconnect,
|
|
53953
|
+
useVideoWarmup,
|
|
53999
53954
|
RATIO_GRID_CLASS,
|
|
54000
53955
|
RATIO_TO_CSS_ASPECT,
|
|
54001
53956
|
RatioTabs,
|
|
@@ -54564,4 +54519,4 @@ export {
|
|
|
54564
54519
|
LogsList,
|
|
54565
54520
|
assets
|
|
54566
54521
|
};
|
|
54567
|
-
//# sourceMappingURL=chunk-
|
|
54522
|
+
//# sourceMappingURL=chunk-MAB4TQCO.js.map
|