feat(analytics): self-hosted openpanel with a typed event catalogue

Replaces Vercel Analytics with OpenPanel, driven entirely by env vars so the
whole layer is inert until NEXT_PUBLIC_OPENPANEL_CLIENT_ID is set.

Zero initial load cost. next/script emits a rel=preload even on lazyOnload,
which pulls the sdk during the first paint, so the component skips it: it
inlines the 416 byte official stub (window.op queues calls immediately) and
appends the real script itself on window load plus requestIdleCallback. The
built html carries no preload and no script src for the analytics host.

Events live in one typed catalogue (lib/analytics/events.ts) and track() is
keyed to it, so a wrong name or payload is a type error rather than a silent
bad row. Emitters sit in the hooks that already own the behaviour instead of
being sprinkled through components:

- useShowState covers every favourite and watchlist toggle
- useInfiniteList covers pagination for all six lists
- useTorrents covers all three providers
- Preview, Person and useSearch use a shared useTrackOnce hook

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
nerandClaude Opus 5 committed 2026-08-14 12:08:16 +03:00
1 parent 0186c793f2
commit d67a0d4df6
26 files changed
+504 -89

No files matched your search

+7 -1
View File
@@ -5,6 +5,7 @@ import { atom, getDefaultStore, useAtom } from 'jotai';
import randomQuery from '@/data/queries/random'; import randomQuery from '@/data/queries/random';
import useInfiniteList from '@/hooks/useInfiniteList'; import useInfiniteList from '@/hooks/useInfiniteList';
import { track } from '@/lib/analytics';
const indexAtom = atom(0); const indexAtom = atom(0);
@@ -17,7 +18,11 @@ interface Props {
const useRandomMovie = ({ page }: Props) => { const useRandomMovie = ({ page }: Props) => {
const [index, setIndex] = useAtom(indexAtom); const [index, setIndex] = useAtom(indexAtom);
const { shows: movies, fetchNextPage } = useInfiniteList({ ...randomQuery({ page }), mode: 'default' }); const { shows: movies, fetchNextPage } = useInfiniteList({
...randomQuery({ page }),
mode: 'default',
list: 'random'
});
if (movies.length && !movies[index]) { if (movies.length && !movies[index]) {
setIndex(0); setIndex(0);
@@ -29,6 +34,7 @@ const useRandomMovie = ({ page }: Props) => {
fetchNextPage, fetchNextPage,
onIndexChange: useCallback( onIndexChange: useCallback(
(index: number) => { (index: number) => {
track('random_shuffled', { index });
startTransition(() => setIndex(index)); startTransition(() => setIndex(index));
}, },
[setIndex] [setIndex]
+1 -1
View File
@@ -3,6 +3,6 @@
import popularQuery from '@/data/queries/popular'; import popularQuery from '@/data/queries/popular';
import useInfiniteList from '@/hooks/useInfiniteList'; import useInfiniteList from '@/hooks/useInfiniteList';
const usePopular = () => useInfiniteList({ ...popularQuery(), mode: 'default' }); const usePopular = () => useInfiniteList({ ...popularQuery(), mode: 'default', list: 'popular' });
export default usePopular; export default usePopular;
+2 -1
View File
@@ -3,6 +3,7 @@
import popularQuery from '@/data/queries/popular'; import popularQuery from '@/data/queries/popular';
import useInfiniteList from '@/hooks/useInfiniteList'; import useInfiniteList from '@/hooks/useInfiniteList';
const useTop = () => useInfiniteList({ ...popularQuery({ sortBy: 'vote_average.desc' }), mode: 'default' }); const useTop = () =>
useInfiniteList({ ...popularQuery({ sortBy: 'vote_average.desc' }), mode: 'default', list: 'top' });
export default useTop; export default useTop;
+1 -1
View File
@@ -1,8 +1,8 @@
import React, { ReactNode } from 'react'; import React, { ReactNode } from 'react';
import { Analytics } from '@vercel/analytics/next';
import type { Metadata, Viewport } from 'next'; import type { Metadata, Viewport } from 'next';
import { Jost } from 'next/font/google'; import { Jost } from 'next/font/google';
import Analytics from '@/components/Analytics';
import Header from '@/components/Header'; import Header from '@/components/Header';
import ThemeColor from '@/components/ThemeColor'; import ThemeColor from '@/components/ThemeColor';
import { SITE_URL, TITLE } from '@/env'; import { SITE_URL, TITLE } from '@/env';
+66
View File
@@ -0,0 +1,66 @@
'use client';
import { useEffect } from 'react';
import { getInitSnippet } from '@openpanel/web';
import { OPENPANEL_API_URL, OPENPANEL_CLIENT_ID, OPENPANEL_SCRIPT_URL } from '@/env';
const SCRIPT_ID = 'openpanel-sdk';
const SRC = OPENPANEL_SCRIPT_URL || 'https://openpanel.dev/op1.js';
const OPTIONS = {
clientId: OPENPANEL_CLIENT_ID,
apiUrl: OPENPANEL_API_URL,
trackScreenViews: true,
trackOutgoingLinks: true
};
/**
* next/script emits a `rel=preload` even on `lazyOnload`, which pulls the sdk during the
* initial load. The inline stub below is a few hundred bytes and makes `window.op` queue
* calls immediately, so the real script can wait until the page is loaded and idle.
*/
const Analytics = () => {
useEffect(() => {
if (!OPENPANEL_CLIENT_ID) return;
let cancelled = false;
const append = () => {
if (cancelled || document.getElementById(SCRIPT_ID)) return;
const script = document.createElement('script');
script.id = SCRIPT_ID;
script.src = SRC;
script.async = true;
document.body.appendChild(script);
};
const schedule = () =>
typeof window.requestIdleCallback === 'function'
? window.requestIdleCallback(append, { timeout: 5000 })
: window.setTimeout(append, 2000);
if (document.readyState === 'complete') schedule();
else window.addEventListener('load', schedule, { once: true });
return () => {
cancelled = true;
};
}, []);
if (!OPENPANEL_CLIENT_ID) return null;
return (
<script
dangerouslySetInnerHTML={{
__html: `${getInitSnippet()}window.op('init', ${JSON.stringify(OPTIONS)});`
}}
/>
);
};
export default Analytics;
@@ -2,11 +2,18 @@ import { useRef } from 'react';
import searchQuery, { SearchQueryProps } from '@/data/queries/search'; import searchQuery, { SearchQueryProps } from '@/data/queries/search';
import useInfiniteList from '@/hooks/useInfiniteList'; import useInfiniteList from '@/hooks/useInfiniteList';
import useTrackOnce from '@/lib/analytics/useTrackOnce';
const useSearch = (props: SearchQueryProps) => { const useSearch = (props: SearchQueryProps) => {
const previousRef = useRef<Show[]>([]); const previousRef = useRef<Show[]>([]);
const infiniteQuery = useInfiniteList({ ...searchQuery(props), mode: 'default' }); const infiniteQuery = useInfiniteList({ ...searchQuery(props), mode: 'default', list: 'search' });
useTrackOnce(
'search_performed',
props.query && infiniteQuery.isFetched ? `${props.type}:${props.query}` : undefined,
() => ({ query: props.query, showType: props.type, results: infiniteQuery.shows.length })
);
if (infiniteQuery.isFetched) { if (infiniteQuery.isFetched) {
previousRef.current = infiniteQuery.shows; previousRef.current = infiniteQuery.shows;
@@ -5,6 +5,7 @@ import sessionMutation from '@/data/mutations/session';
import tokenMutation from '@/data/mutations/token'; import tokenMutation from '@/data/mutations/token';
import { useSetSession } from '@/hooks/useSession'; import { useSetSession } from '@/hooks/useSession';
import { useToast } from '@/hooks/useToast'; import { useToast } from '@/hooks/useToast';
import { track } from '@/lib/analytics';
const AUTH_RETRIES = 10; const AUTH_RETRIES = 10;
@@ -24,6 +25,7 @@ const useAuth = () => {
const session = useMutation({ const session = useMutation({
...sessionMutation(), ...sessionMutation(),
onSuccess({ session_id }) { onSuccess({ session_id }) {
track('auth_completed', {});
setSession(session_id); setSession(session_id);
clearInterval(intervalRef.current); clearInterval(intervalRef.current);
@@ -1,11 +1,16 @@
import { useCallback } from 'react'; import { useCallback } from 'react';
import { useSetSession } from '@/hooks/useSession'; import { useSetSession } from '@/hooks/useSession';
import { clearIdentity, track } from '@/lib/analytics';
const useLogOut = () => { const useLogOut = () => {
const setSession = useSetSession(); const setSession = useSetSession();
return useCallback(() => setSession(undefined), [setSession]); return useCallback(() => {
track('auth_signed_out', {});
clearIdentity();
setSession(undefined);
}, [setSession]);
}; };
export default useLogOut; export default useLogOut;
+3
View File
@@ -4,6 +4,7 @@ import { FC } from 'react';
import List from '@/components/List'; import List from '@/components/List';
import NoResults from '@/components/NoResults'; import NoResults from '@/components/NoResults';
import useTrackOnce from '@/lib/analytics/useTrackOnce';
import { formatDate } from '@/lib/utils'; import { formatDate } from '@/lib/utils';
import Biography from './components/Biography'; import Biography from './components/Biography';
@@ -23,6 +24,8 @@ const lifespan = ({ birthday, deathday }: Profile) => {
const Person: FC<Props> = ({ personId }) => { const Person: FC<Props> = ({ personId }) => {
const { data: profile, isError } = useProfile({ personId }); const { data: profile, isError } = useProfile({ personId });
useTrackOnce('person_viewed', profile ? personId : undefined, () => ({ personId }));
if (isError) return <NoResults />; if (isError) return <NoResults />;
if (!profile) return <PersonSkeleton />; if (!profile) return <PersonSkeleton />;
@@ -2,6 +2,7 @@ import { useMemo, useRef } from 'react';
import { CaptionOption, useCaptionOptions } from '@vidstack/react'; import { CaptionOption, useCaptionOptions } from '@vidstack/react';
import { ClosedCaptionsIcon, ClosedCaptionsOnIcon } from '@vidstack/react/icons'; import { ClosedCaptionsIcon, ClosedCaptionsOnIcon } from '@vidstack/react/icons';
import { track as track_ } from '@/lib/analytics';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';
import PlayerMenu from '../Menu'; import PlayerMenu from '../Menu';
@@ -30,7 +31,11 @@ const CaptionsMenu = () => {
options={captions.map((track) => ({ options={captions.map((track) => ({
label: track.label, label: track.label,
value: track.value, value: track.value,
onSelect: (value) => (live.current.find((option) => option.value === value) ?? track).select() onSelect: (value) => {
track_('subtitles_selected', { language: value });
return (live.current.find((option) => option.value === value) ?? track).select();
}
}))} }))}
> >
{tracks.selectedTrack ? ( {tracks.selectedTrack ? (
@@ -16,6 +16,8 @@ import { NextIcon } from '@vidstack/react/icons';
import { PlyrLayout, plyrLayoutIcons } from '@vidstack/react/player/layouts/plyr'; import { PlyrLayout, plyrLayoutIcons } from '@vidstack/react/player/layouts/plyr';
import { useSetCanPlay } from '@/hooks/useCanPlay'; import { useSetCanPlay } from '@/hooks/useCanPlay';
import { track } from '@/lib/analytics';
import useTrackOnce from '@/lib/analytics/useTrackOnce';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';
import Audio from './components/Audio'; import Audio from './components/Audio';
@@ -76,6 +78,7 @@ const Player: FC<Props> = ({ magnet, playlist, subtitles, show, episodes, onStre
const { tracks: audioTracks, audio, setAudio, resolvedSrc, error } = useGstAudio(source?.src); const { tracks: audioTracks, audio, setAudio, resolvedSrc, error } = useGstAudio(source?.src);
const resumeTime = useRef(0); const resumeTime = useRef(0);
const startedRef = useRef<string>();
const changeAudio = (track: number) => { const changeAudio = (track: number) => {
resumeTime.current = player.current?.currentTime ?? 0; resumeTime.current = player.current?.currentTime ?? 0;
@@ -86,6 +89,12 @@ const Player: FC<Props> = ({ magnet, playlist, subtitles, show, episodes, onStre
onStreamError?.(error); onStreamError?.(error);
}, [error, onStreamError]); }, [error, onStreamError]);
useTrackOnce('playback_failed', error && show ? `${magnet}:${error}` : undefined, () => ({
showId: show!.id,
showType: show!.type,
reason: error!
}));
const playerSrc = useMemo( const playerSrc = useMemo(
() => (source && !error ? ({ ...source, src: resolvedSrc } as VideoSrc) : []), () => (source && !error ? ({ ...source, src: resolvedSrc } as VideoSrc) : []),
[source, resolvedSrc, error] [source, resolvedSrc, error]
@@ -115,6 +124,10 @@ const Player: FC<Props> = ({ magnet, playlist, subtitles, show, episodes, onStre
onProviderChange={onProviderChange} onProviderChange={onProviderChange}
onCanPlay={() => { onCanPlay={() => {
setCanPlay(true); setCanPlay(true);
if (show && startedRef.current !== magnet) {
startedRef.current = magnet;
track('playback_started', { showId: show.id, showType: show.type });
}
if (resumeTime.current) { if (resumeTime.current) {
player.current!.currentTime = resumeTime.current; player.current!.currentTime = resumeTime.current;
resumeTime.current = 0; resumeTime.current = 0;
@@ -8,6 +8,7 @@ import ButtonsGroup from '@/components/ui/buttons-group';
import { Quality } from '@/data/parsers/yts/models'; import { Quality } from '@/data/parsers/yts/models';
import { useM3UUrl } from '@/hooks/useM3UStreamUrl'; import { useM3UUrl } from '@/hooks/useM3UStreamUrl';
import { useStreamUrl } from '@/hooks/useStreamUrl'; import { useStreamUrl } from '@/hooks/useStreamUrl';
import { track } from '@/lib/analytics';
import { cn, detectSafari, getMagnetHash, isStandaloneApp, seasonFromEpisodes, torrentKey } from '@/lib/utils'; import { cn, detectSafari, getMagnetHash, isStandaloneApp, seasonFromEpisodes, torrentKey } from '@/lib/utils';
import usePinnedTorrents from '../../../../usePinnedTorrents'; import usePinnedTorrents from '../../../../usePinnedTorrents';
@@ -63,7 +64,17 @@ const Actions: FC<Props> = ({ torrent, title, provider, show }) => {
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [pinned, magnet, key, torrent.magnet]); }, [pinned, magnet, key, torrent.magnet]);
const pinPlayed = () => pin(key); const pinPlayed = () => {
track('torrent_selected', {
provider,
seeders: torrent.seeders,
quality: torrent.quality,
source: torrent.source,
codec: torrent.codec
});
pin(key);
};
const supportedForCast = prefix && !prefix.includes('{host}'); const supportedForCast = prefix && !prefix.includes('{host}');
@@ -52,26 +52,31 @@ const showTorrentsModal = create(({ onResolve, ...show }: Props) => {
const isSeries = show.type === 'tv'; const isSeries = show.type === 'tv';
const tracked = { id: show.id, type: show.type };
const yts = useTorrents({ const yts = useTorrents({
query: isSeries ? '' : show.title, query: isSeries ? '' : show.title,
queryFn: providers.yts.queryFn, queryFn: providers.yts.queryFn,
sort, sort,
key: providers.yts.key, key: providers.yts.key,
imdbID: show.imdb_id! imdbID: show.imdb_id!,
show: tracked
}); });
const tpb = useTorrents({ const tpb = useTorrents({
query, query,
queryFn: providers.tpb.queryFn, queryFn: providers.tpb.queryFn,
sort, sort,
key: providers.tpb.key, key: providers.tpb.key,
imdbID: show.imdb_id! imdbID: show.imdb_id!,
show: tracked
}); });
const tlk = useTorrents({ const tlk = useTorrents({
query, query,
queryFn: providers.tlk.queryFn, queryFn: providers.tlk.queryFn,
sort, sort,
key: providers.tlk.key, key: providers.tlk.key,
imdbID: show.imdb_id! imdbID: show.imdb_id!,
show: tracked
}); });
const queries = { yts, tpb, tlk }; const queries = { yts, tpb, tlk };
@@ -1,25 +1,37 @@
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { Sort } from '@/data/parsers'; import { Sort } from '@/data/parsers';
import useTrackOnce from '@/lib/analytics/useTrackOnce';
const useTorrents = ({ const useTorrents = ({
query, query,
sort, sort,
imdbID, imdbID,
key, key,
queryFn queryFn,
show
}: { }: {
key: string; key: string;
query: string; query: string;
sort: Sort; sort: Sort;
imdbID: string; imdbID: string;
show: { id: Show['id']; type: Show['type'] };
queryFn: (params: { query: string; sort: Sort; imdbID: string }) => Promise<Torrent[]>; queryFn: (params: { query: string; sort: Sort; imdbID: string }) => Promise<Torrent[]>;
}) => { }) => {
return useQuery({ const result = useQuery({
enabled: Boolean(query), enabled: Boolean(query),
queryKey: [key, query, sort, imdbID], queryKey: [key, query, sort, imdbID],
queryFn: () => queryFn({ query, sort, imdbID }) queryFn: () => queryFn({ query, sort, imdbID })
}); });
useTrackOnce('torrents_searched', result.data ? `${key}:${query}` : undefined, () => ({
showId: show.id,
showType: show.type,
provider: key,
results: result.data?.length ?? 0
}));
return result;
}; };
export default useTorrents; export default useTorrents;
+11 -3
View File
@@ -7,6 +7,7 @@ import Poster from '@/components/Poster';
import Credits from '@/components/Preview/components/Credits'; import Credits from '@/components/Preview/components/Credits';
import useDetails from '@/components/Preview/useDetails'; import useDetails from '@/components/Preview/useDetails';
import { Modal } from '@/components/ui/dialog'; import { Modal } from '@/components/ui/dialog';
import useTrackOnce from '@/lib/analytics/useTrackOnce';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';
import Actions from './components/Actions'; import Actions from './components/Actions';
@@ -38,12 +39,19 @@ const Preview: FC<Props> = ({
}) => { }) => {
const { data: detailedShow } = useDetails({ showId: showId || baseShow?.id, showType: showType || baseShow?.type }); const { data: detailedShow } = useDetails({ showId: showId || baseShow?.id, showType: showType || baseShow?.type });
if (!baseShow && !detailedShow) return null; const show = (detailedShow || baseShow) as (Show & Partial<Details>) | undefined;
const show: Show & Partial<Details> = (detailedShow || baseShow)!;
const isModal = Boolean(onClose); const isModal = Boolean(onClose);
useTrackOnce('show_viewed', show?.id, () => ({
showId: show!.id,
showType: show!.type,
title: show!.title,
surface: isModal ? 'modal' : 'page'
}));
if (!show) return null;
const Title = heading ? 'h1' : 'span'; const Title = heading ? 'h1' : 'span';
return ( return (
+10 -1
View File
@@ -4,6 +4,7 @@ import { FC, useState } from 'react';
import useSimilar from '@/components/Trending/useSimilar'; import useSimilar from '@/components/Trending/useSimilar';
import Nav from '@/components/ui/nav'; import Nav from '@/components/ui/nav';
import { track } from '@/lib/analytics';
import Gallery from './components/Gallery'; import Gallery from './components/Gallery';
import { tabs as initialTabs } from './constants'; import { tabs as initialTabs } from './constants';
@@ -41,7 +42,15 @@ const Trending: FC<Props> = ({ showId, showType, preview }) => {
return ( return (
(streaming.isFetched || similar.isFetched) && ( (streaming.isFetched || similar.isFetched) && (
<div className='hidden md:block'> <div className='hidden md:block'>
<Nav tabs={tabs} active={active} onChange={(active) => setActive(active)} className='mb-3' /> <Nav
tabs={tabs}
active={active}
onChange={(active) => {
track('gallery_tab_changed', { tab: active.type });
setActive(active);
}}
className='mb-3'
/>
{!tab.isPending && <Gallery key={active.type} shows={tab.data || []} />} {!tab.isPending && <Gallery key={active.type} shows={tab.data || []} />}
</div> </div>
) )
+4
View File
@@ -12,6 +12,10 @@ OPENSUBTITLES_USERNAME=your_opensubtitles_username
OPENSUBTITLES_PASSWORD=your_opensubtitles_password OPENSUBTITLES_PASSWORD=your_opensubtitles_password
# Comma-separated preferred subtitle languages (ISO 639-1) # Comma-separated preferred subtitle languages (ISO 639-1)
SUBTITLE_LANGUAGES=en,uk SUBTITLE_LANGUAGES=en,uk
# Optional: self-hosted OpenPanel analytics. Unset means analytics is a no-op and no script loads.
NEXT_PUBLIC_OPENPANEL_CLIENT_ID=your_openpanel_client_id
NEXT_PUBLIC_OPENPANEL_API_URL=https://analytics.example.org/api
NEXT_PUBLIC_OPENPANEL_SCRIPT_URL=https://analytics.example.org/op1.js
# Optional: persists the Toloka session across serverless cold starts (falls back to in-memory) # Optional: persists the Toloka session across serverless cold starts (falls back to in-memory)
UPSTASH_REDIS_REST_URL=https://your-db.upstash.io UPSTASH_REDIS_REST_URL=https://your-db.upstash.io
UPSTASH_REDIS_REST_TOKEN=your_upstash_token UPSTASH_REDIS_REST_TOKEN=your_upstash_token
+4
View File
@@ -25,5 +25,9 @@ export const OPENSUBTITLES_USERNAME = process.env.OPENSUBTITLES_USERNAME;
export const OPENSUBTITLES_PASSWORD = process.env.OPENSUBTITLES_PASSWORD; export const OPENSUBTITLES_PASSWORD = process.env.OPENSUBTITLES_PASSWORD;
export const SUBTITLE_LANGUAGES = process.env.SUBTITLE_LANGUAGES || 'en,uk'; export const SUBTITLE_LANGUAGES = process.env.SUBTITLE_LANGUAGES || 'en,uk';
export const OPENPANEL_CLIENT_ID = process.env.NEXT_PUBLIC_OPENPANEL_CLIENT_ID;
export const OPENPANEL_API_URL = process.env.NEXT_PUBLIC_OPENPANEL_API_URL;
export const OPENPANEL_SCRIPT_URL = process.env.NEXT_PUBLIC_OPENPANEL_SCRIPT_URL;
export const UPSTASH_REDIS_REST_URL = process.env.UPSTASH_REDIS_REST_URL || process.env.KV_REST_API_URL; export const UPSTASH_REDIS_REST_URL = process.env.UPSTASH_REDIS_REST_URL || process.env.KV_REST_API_URL;
export const UPSTASH_REDIS_REST_TOKEN = process.env.UPSTASH_REDIS_REST_TOKEN || process.env.KV_REST_API_TOKEN; export const UPSTASH_REDIS_REST_TOKEN = process.env.UPSTASH_REDIS_REST_TOKEN || process.env.KV_REST_API_TOKEN;
+16 -3
View File
@@ -1,6 +1,9 @@
import { useMemo } from 'react'; import { useCallback, useMemo } from 'react';
import { QueryKey, useInfiniteQuery, useSuspenseInfiniteQuery } from '@tanstack/react-query'; import { QueryKey, useInfiniteQuery, useSuspenseInfiniteQuery } from '@tanstack/react-query';
import { track } from '@/lib/analytics';
import type { ListName } from '@/lib/analytics/events';
interface Props { interface Props {
enabled?: boolean; enabled?: boolean;
queryKey: QueryKey; queryKey: QueryKey;
@@ -8,6 +11,7 @@ interface Props {
initialPageParam?: string; initialPageParam?: string;
getNextPageParam?: () => string | undefined; getNextPageParam?: () => string | undefined;
mode?: 'suspense' | 'default'; mode?: 'suspense' | 'default';
list?: ListName;
} }
const useInfiniteList = ({ const useInfiniteList = ({
@@ -16,7 +20,8 @@ const useInfiniteList = ({
initialPageParam, initialPageParam,
getNextPageParam, getNextPageParam,
mode = 'suspense', mode = 'suspense',
enabled enabled,
list
}: Props) => { }: Props) => {
const { data, hasNextPage, fetchNextPage, isFetched, isLoading } = ( const { data, hasNextPage, fetchNextPage, isFetched, isLoading } = (
mode === 'suspense' ? useSuspenseInfiniteQuery : useInfiniteQuery mode === 'suspense' ? useSuspenseInfiniteQuery : useInfiniteQuery
@@ -43,7 +48,15 @@ const useInfiniteList = ({
); );
}, [data?.pages]); }, [data?.pages]);
return { shows, fetchNextPage: hasNextPage ? fetchNextPage : undefined, isFetched, isLoading }; const pages = data?.pages.length ?? 0;
const loadNextPage = useCallback(() => {
if (list) track('list_loaded_more', { list, page: pages + 1 });
return fetchNextPage();
}, [list, pages, fetchNextPage]);
return { shows, fetchNextPage: hasNextPage ? loadNextPage : undefined, isFetched, isLoading };
}; };
export default useInfiniteList; export default useInfiniteList;
+3
View File
@@ -3,6 +3,7 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import statesMutation from '@/data/mutations/accountStates'; import statesMutation from '@/data/mutations/accountStates';
import statesQuery from '@/data/queries/accountStates'; import statesQuery from '@/data/queries/accountStates';
import { KEY as USERS_SHOWS_KEY } from '@/data/queries/usersShows'; import { KEY as USERS_SHOWS_KEY } from '@/data/queries/usersShows';
import { track } from '@/lib/analytics';
import { useFavorites, useFavoritesStateToggle, useWatchList, useWatchListStateToggle } from './useLocalUsersLists'; import { useFavorites, useFavoritesStateToggle, useWatchList, useWatchListStateToggle } from './useLocalUsersLists';
import { useSession } from './useSession'; import { useSession } from './useSession';
@@ -51,6 +52,8 @@ export const useMutateShowState = (show: Show) => {
list: mutation.variables?.list, list: mutation.variables?.list,
isPending: session ? mutation.isPending : false, isPending: session ? mutation.isPending : false,
mutate: ({ list, value }: { list: 'favorite' | 'watchlist'; value: boolean }) => { mutate: ({ list, value }: { list: 'favorite' | 'watchlist'; value: boolean }) => {
track('library_toggled', { showId: show.id, showType: show.type, list, value });
if (session) return mutation.mutate({ showId: show.id, showType: show.type, list, value }); if (session) return mutation.mutate({ showId: show.id, showType: show.type, list, value });
if (list === 'favorite') return toggleFavorite(); if (list === 'favorite') return toggleFavorite();
+1 -1
View File
@@ -26,7 +26,7 @@ const useUsersShows = ({
const { shows: favorite } = useFavorites(); const { shows: favorite } = useFavorites();
const { shows: watchlist } = useWatchList(); const { shows: watchlist } = useWatchList();
const query = useInfiniteList({ ...usersShowsQuery({ showType, list, session }), mode }); const query = useInfiniteList({ ...usersShowsQuery({ showType, list, session }), mode, list });
return session return session
? query ? query
+31
View File
@@ -0,0 +1,31 @@
type ShowRef = { showId: Show['id']; showType: Show['type'] };
export type ListName = 'popular' | 'top' | 'search' | 'favorite' | 'watchlist' | 'random';
/**
* The whole analytics surface of the app. Adding an event means adding a line here first,
* which keeps names and payloads consistent and makes `track` calls type checked.
*/
export type AnalyticsEvents = {
show_viewed: ShowRef & { title: string; surface: 'page' | 'modal' };
person_viewed: { personId: string };
list_loaded_more: { list: ListName; page: number };
random_shuffled: { index: number };
search_performed: { query: string; showType: Show['type']; results: number };
gallery_tab_changed: { tab: string };
library_toggled: ShowRef & { list: 'favorite' | 'watchlist'; value: boolean };
auth_completed: EmptyPayload;
auth_signed_out: EmptyPayload;
torrents_searched: ShowRef & { provider: string; results: number };
torrent_selected: { provider: string; seeders: number; quality?: string; source?: string; codec?: string };
playback_started: ShowRef & { quality?: string };
playback_failed: ShowRef & { reason: string };
subtitles_selected: { language: string };
};
export type EmptyPayload = Record<string, never>;
export type AnalyticsEvent = keyof AnalyticsEvents;
+30
View File
@@ -0,0 +1,30 @@
import { OPENPANEL_CLIENT_ID } from '@/env';
import type { AnalyticsEvents } from './events';
// The sdk declares `window.op` itself, so this reads it without redeclaring the global.
// It is defined by the inline stub in components/Analytics and queues calls until the real
// script loads, so events fired before then are kept rather than dropped.
const op = () => (window as unknown as { op?: (method: string, ...args: unknown[]) => void }).op;
const ready = () => Boolean(OPENPANEL_CLIENT_ID) && typeof window !== 'undefined';
export const track = <Name extends keyof AnalyticsEvents>(name: Name, properties: AnalyticsEvents[Name]) => {
if (!ready()) return;
op()?.('track', name, properties);
};
export const identify = (profileId: string) => {
if (!ready()) return;
op()?.('identify', { profileId });
};
export const clearIdentity = () => {
if (!ready()) return;
op()?.('clear');
};
export type { AnalyticsEvents, ListName } from './events';
+30
View File
@@ -0,0 +1,30 @@
import { useEffect, useRef } from 'react';
import type { AnalyticsEvents } from './events';
import { track } from '.';
/**
* Fires an event once per distinct `key`, skipping while it is nullish. Keeps view style
* events (a show opened, a search resolved) to a single line at the call site instead of an
* effect plus a ref in every component that needs one.
*/
const useTrackOnce = <Name extends keyof AnalyticsEvents>(
name: Name,
key: string | number | null | undefined,
payload: () => AnalyticsEvents[Name]
) => {
const payloadRef = useRef(payload);
const sentRef = useRef<string | number | null>(null);
payloadRef.current = payload;
useEffect(() => {
if (key == null || sentRef.current === key) return;
sentRef.current = key;
track(name, payloadRef.current());
}, [name, key]);
};
export default useTrackOnce;
+214 -67
View File
@@ -11,6 +11,7 @@
"@dnd-kit/core": "^6.3.1", "@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0", "@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2", "@dnd-kit/utilities": "^3.2.2",
"@openpanel/web": "^1.4.1",
"@radix-ui/react-dialog": "^1.1.1", "@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.2", "@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-tabs": "^1.0.4", "@radix-ui/react-tabs": "^1.0.4",
@@ -19,7 +20,6 @@
"@tanstack/react-query-next-experimental": "^5.59.16", "@tanstack/react-query-next-experimental": "^5.59.16",
"@types/cheerio": "^0.22.35", "@types/cheerio": "^0.22.35",
"@upstash/redis": "^1.38.2", "@upstash/redis": "^1.38.2",
"@vercel/analytics": "^2.0.1",
"@vidstack/react": "^1.12.13", "@vidstack/react": "^1.12.13",
"axios": "^1.7.7", "axios": "^1.7.7",
"axios-cookiejar-support": "^5.0.3", "axios-cookiejar-support": "^5.0.3",
@@ -2205,6 +2205,23 @@
"node": ">= 8" "node": ">= 8"
} }
}, },
"node_modules/@openpanel/sdk": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@openpanel/sdk/-/sdk-1.3.1.tgz",
"integrity": "sha512-mQ5xaBUGXnyRg3qYxwnbVaUYyW7w8u+munrWk/ClnqxEeR2j+FYPiA6noHbHMCFC2aZutYD5OoRzEvw3FBNFxw==",
"license": "MIT"
},
"node_modules/@openpanel/web": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/@openpanel/web/-/web-1.4.1.tgz",
"integrity": "sha512-DgUWeocZw+b57YiJjefZPg+6sceR7TdOF8x7Ut75lu3CwcwqGi5jZNPXjikNemGL37aNWXCB4buhcoNan2j7RA==",
"license": "MIT",
"dependencies": {
"@openpanel/sdk": "1.3.1",
"@rrweb/types": "2.0.0-alpha.20",
"rrweb": "2.0.0-alpha.20"
}
},
"node_modules/@pkgjs/parseargs": { "node_modules/@pkgjs/parseargs": {
"version": "0.11.0", "version": "0.11.0",
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
@@ -4251,6 +4268,18 @@
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@rrweb/types": {
"version": "2.0.0-alpha.20",
"resolved": "https://registry.npmjs.org/@rrweb/types/-/types-2.0.0-alpha.20.tgz",
"integrity": "sha512-RbnDgKxA/odwB1R4gF7eUUj+rdSrq6ROQJsnMw7MIsGzlbSYvJeZN8YY4XqU0G6sKJvXI6bSzk7w/G94jNwzhw==",
"license": "MIT"
},
"node_modules/@rrweb/utils": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@rrweb/utils/-/utils-2.1.1.tgz",
"integrity": "sha512-x2SgJAD3YJ9eVcLZ5l6OqWMtczdA3VfS5XqPeqpZdQgV9oh6Id5GK2cDN4bimnkqryOcIJdz8cTvV0yNvqQ+nA==",
"license": "MIT"
},
"node_modules/@rushstack/eslint-patch": { "node_modules/@rushstack/eslint-patch": {
"version": "1.6.1", "version": "1.6.1",
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.6.1.tgz", "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.6.1.tgz",
@@ -4381,6 +4410,12 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"node_modules/@types/css-font-loading-module": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/@types/css-font-loading-module/-/css-font-loading-module-0.0.7.tgz",
"integrity": "sha512-nl09VhutdjINdWyXxHWN/w9zlNCfr60JUqJbd24YXUuCwgeL0TpFSdElCwb6cxfB6ybE19Gjj4g0jsgkXxKv1Q==",
"license": "MIT"
},
"node_modules/@types/estree": { "node_modules/@types/estree": {
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz",
@@ -4610,48 +4645,6 @@
"uncrypto": "^0.1.3" "uncrypto": "^0.1.3"
} }
}, },
"node_modules/@vercel/analytics": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@vercel/analytics/-/analytics-2.0.1.tgz",
"integrity": "sha512-MTQG6V9qQrt1tsDeF+2Uoo5aPjqbVPys1xvnIftXSJYG2SrwXRHnqEvVoYID7BTruDz4lCd2Z7rM1BdkUehk2g==",
"license": "MIT",
"peerDependencies": {
"@remix-run/react": "^2",
"@sveltejs/kit": "^1 || ^2",
"next": ">= 13",
"nuxt": ">= 3",
"react": "^18 || ^19 || ^19.0.0-rc",
"svelte": ">= 4",
"vue": "^3",
"vue-router": "^4"
},
"peerDependenciesMeta": {
"@remix-run/react": {
"optional": true
},
"@sveltejs/kit": {
"optional": true
},
"next": {
"optional": true
},
"nuxt": {
"optional": true
},
"react": {
"optional": true
},
"svelte": {
"optional": true
},
"vue": {
"optional": true
},
"vue-router": {
"optional": true
}
}
},
"node_modules/@vidstack/react": { "node_modules/@vidstack/react": {
"version": "1.12.13", "version": "1.12.13",
"resolved": "https://registry.npmjs.org/@vidstack/react/-/react-1.12.13.tgz", "resolved": "https://registry.npmjs.org/@vidstack/react/-/react-1.12.13.tgz",
@@ -4830,6 +4823,12 @@
"@xtuc/long": "4.2.2" "@xtuc/long": "4.2.2"
} }
}, },
"node_modules/@xstate/fsm": {
"version": "1.6.5",
"resolved": "https://registry.npmjs.org/@xstate/fsm/-/fsm-1.6.5.tgz",
"integrity": "sha512-b5o1I6aLNeYlU/3CPlj/Z91ybk1gUsKT+5NAJI+2W4UjvS5KLG28K9v5UvNoFVjHV8PajVZ00RH3vnjyQO7ZAw==",
"license": "MIT"
},
"node_modules/@xtuc/ieee754": { "node_modules/@xtuc/ieee754": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",
@@ -9248,6 +9247,12 @@
"node": ">=16 || 14 >=14.17" "node": ">=16 || 14 >=14.17"
} }
}, },
"node_modules/mitt": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz",
"integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==",
"license": "MIT"
},
"node_modules/ms": { "node_modules/ms": {
"version": "2.1.3", "version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@@ -9266,15 +9271,16 @@
} }
}, },
"node_modules/nanoid": { "node_modules/nanoid": {
"version": "3.3.6", "version": "3.3.18",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz",
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==",
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
"url": "https://github.com/sponsors/ai" "url": "https://github.com/sponsors/ai"
} }
], ],
"license": "MIT",
"bin": { "bin": {
"nanoid": "bin/nanoid.cjs" "nanoid": "bin/nanoid.cjs"
}, },
@@ -9903,9 +9909,10 @@
} }
}, },
"node_modules/picocolors": { "node_modules/picocolors": {
"version": "1.1.0", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
"integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==" "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
"license": "ISC"
}, },
"node_modules/picomatch": { "node_modules/picomatch": {
"version": "2.3.1", "version": "2.3.1",
@@ -10663,6 +10670,68 @@
"randombytes": "^2.1.0" "randombytes": "^2.1.0"
} }
}, },
"node_modules/rrdom": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/rrdom/-/rrdom-2.1.1.tgz",
"integrity": "sha512-VBkTF3bGNqcZjqnbo/gKi9GVQPIxiG0dofw7CQdAZQFQ2juJdt2YKIf3oS9QudL8HTpGh9bz5TUN+3amBn1Geg==",
"license": "MIT",
"dependencies": {
"rrweb-snapshot": "^2.1.1"
}
},
"node_modules/rrweb": {
"version": "2.0.0-alpha.20",
"resolved": "https://registry.npmjs.org/rrweb/-/rrweb-2.0.0-alpha.20.tgz",
"integrity": "sha512-CZKDlm+j1VA50Ko3gnMbpvguCAleljsTNXPnVk9aeNP8o6T6kolRbISHyDZpqZ4G+bdDLlQOignPP3jEsXs8Gg==",
"license": "MIT",
"dependencies": {
"@rrweb/types": "^2.0.0-alpha.20",
"@rrweb/utils": "^2.0.0-alpha.20",
"@types/css-font-loading-module": "0.0.7",
"@xstate/fsm": "^1.4.0",
"base64-arraybuffer": "^1.0.1",
"mitt": "^3.0.0",
"rrdom": "^2.0.0-alpha.20",
"rrweb-snapshot": "^2.0.0-alpha.20"
}
},
"node_modules/rrweb-snapshot": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/rrweb-snapshot/-/rrweb-snapshot-2.1.1.tgz",
"integrity": "sha512-al4Kx7Am7YlIn/5Yb2EMr7cdmjGiK+cLhdilJEXqkFXgpnys8t/yMJumXy2Ormgirpg3MBnFha0GTgny+iIL2w==",
"license": "MIT",
"dependencies": {
"postcss": "^8.4.38"
}
},
"node_modules/rrweb-snapshot/node_modules/postcss": {
"version": "8.5.26",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.26.tgz",
"integrity": "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/postcss"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"dependencies": {
"nanoid": "^3.3.17",
"picocolors": "^1.1.1",
"source-map-js": "^1.2.1"
},
"engines": {
"node": "^10 || ^12 || >=14"
}
},
"node_modules/run-applescript": { "node_modules/run-applescript": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz", "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz",
@@ -11010,9 +11079,10 @@
} }
}, },
"node_modules/source-map-js": { "node_modules/source-map-js": {
"version": "1.0.2", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
"license": "BSD-3-Clause",
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
} }
@@ -14014,6 +14084,21 @@
"fastq": "^1.6.0" "fastq": "^1.6.0"
} }
}, },
"@openpanel/sdk": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@openpanel/sdk/-/sdk-1.3.1.tgz",
"integrity": "sha512-mQ5xaBUGXnyRg3qYxwnbVaUYyW7w8u+munrWk/ClnqxEeR2j+FYPiA6noHbHMCFC2aZutYD5OoRzEvw3FBNFxw=="
},
"@openpanel/web": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/@openpanel/web/-/web-1.4.1.tgz",
"integrity": "sha512-DgUWeocZw+b57YiJjefZPg+6sceR7TdOF8x7Ut75lu3CwcwqGi5jZNPXjikNemGL37aNWXCB4buhcoNan2j7RA==",
"requires": {
"@openpanel/sdk": "1.3.1",
"@rrweb/types": "2.0.0-alpha.20",
"rrweb": "2.0.0-alpha.20"
}
},
"@pkgjs/parseargs": { "@pkgjs/parseargs": {
"version": "0.11.0", "version": "0.11.0",
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
@@ -14985,6 +15070,16 @@
} }
} }
}, },
"@rrweb/types": {
"version": "2.0.0-alpha.20",
"resolved": "https://registry.npmjs.org/@rrweb/types/-/types-2.0.0-alpha.20.tgz",
"integrity": "sha512-RbnDgKxA/odwB1R4gF7eUUj+rdSrq6ROQJsnMw7MIsGzlbSYvJeZN8YY4XqU0G6sKJvXI6bSzk7w/G94jNwzhw=="
},
"@rrweb/utils": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@rrweb/utils/-/utils-2.1.1.tgz",
"integrity": "sha512-x2SgJAD3YJ9eVcLZ5l6OqWMtczdA3VfS5XqPeqpZdQgV9oh6Id5GK2cDN4bimnkqryOcIJdz8cTvV0yNvqQ+nA=="
},
"@rushstack/eslint-patch": { "@rushstack/eslint-patch": {
"version": "1.6.1", "version": "1.6.1",
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.6.1.tgz", "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.6.1.tgz",
@@ -15073,6 +15168,11 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"@types/css-font-loading-module": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/@types/css-font-loading-module/-/css-font-loading-module-0.0.7.tgz",
"integrity": "sha512-nl09VhutdjINdWyXxHWN/w9zlNCfr60JUqJbd24YXUuCwgeL0TpFSdElCwb6cxfB6ybE19Gjj4g0jsgkXxKv1Q=="
},
"@types/estree": { "@types/estree": {
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz",
@@ -15247,12 +15347,6 @@
"uncrypto": "^0.1.3" "uncrypto": "^0.1.3"
} }
}, },
"@vercel/analytics": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@vercel/analytics/-/analytics-2.0.1.tgz",
"integrity": "sha512-MTQG6V9qQrt1tsDeF+2Uoo5aPjqbVPys1xvnIftXSJYG2SrwXRHnqEvVoYID7BTruDz4lCd2Z7rM1BdkUehk2g==",
"requires": {}
},
"@vidstack/react": { "@vidstack/react": {
"version": "1.12.13", "version": "1.12.13",
"resolved": "https://registry.npmjs.org/@vidstack/react/-/react-1.12.13.tgz", "resolved": "https://registry.npmjs.org/@vidstack/react/-/react-1.12.13.tgz",
@@ -15408,6 +15502,11 @@
"@xtuc/long": "4.2.2" "@xtuc/long": "4.2.2"
} }
}, },
"@xstate/fsm": {
"version": "1.6.5",
"resolved": "https://registry.npmjs.org/@xstate/fsm/-/fsm-1.6.5.tgz",
"integrity": "sha512-b5o1I6aLNeYlU/3CPlj/Z91ybk1gUsKT+5NAJI+2W4UjvS5KLG28K9v5UvNoFVjHV8PajVZ00RH3vnjyQO7ZAw=="
},
"@xtuc/ieee754": { "@xtuc/ieee754": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",
@@ -18411,6 +18510,11 @@
"integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
"dev": true "dev": true
}, },
"mitt": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz",
"integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw=="
},
"ms": { "ms": {
"version": "2.1.3", "version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@@ -18428,9 +18532,9 @@
} }
}, },
"nanoid": { "nanoid": {
"version": "3.3.6", "version": "3.3.18",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz",
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==" "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w=="
}, },
"natural-compare": { "natural-compare": {
"version": "1.4.0", "version": "1.4.0",
@@ -18832,9 +18936,9 @@
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="
}, },
"picocolors": { "picocolors": {
"version": "1.1.0", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
"integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==" "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="
}, },
"picomatch": { "picomatch": {
"version": "2.3.1", "version": "2.3.1",
@@ -19310,6 +19414,49 @@
} }
} }
}, },
"rrdom": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/rrdom/-/rrdom-2.1.1.tgz",
"integrity": "sha512-VBkTF3bGNqcZjqnbo/gKi9GVQPIxiG0dofw7CQdAZQFQ2juJdt2YKIf3oS9QudL8HTpGh9bz5TUN+3amBn1Geg==",
"requires": {
"rrweb-snapshot": "^2.1.1"
}
},
"rrweb": {
"version": "2.0.0-alpha.20",
"resolved": "https://registry.npmjs.org/rrweb/-/rrweb-2.0.0-alpha.20.tgz",
"integrity": "sha512-CZKDlm+j1VA50Ko3gnMbpvguCAleljsTNXPnVk9aeNP8o6T6kolRbISHyDZpqZ4G+bdDLlQOignPP3jEsXs8Gg==",
"requires": {
"@rrweb/types": "^2.0.0-alpha.20",
"@rrweb/utils": "^2.0.0-alpha.20",
"@types/css-font-loading-module": "0.0.7",
"@xstate/fsm": "^1.4.0",
"base64-arraybuffer": "^1.0.1",
"mitt": "^3.0.0",
"rrdom": "^2.0.0-alpha.20",
"rrweb-snapshot": "^2.0.0-alpha.20"
}
},
"rrweb-snapshot": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/rrweb-snapshot/-/rrweb-snapshot-2.1.1.tgz",
"integrity": "sha512-al4Kx7Am7YlIn/5Yb2EMr7cdmjGiK+cLhdilJEXqkFXgpnys8t/yMJumXy2Ormgirpg3MBnFha0GTgny+iIL2w==",
"requires": {
"postcss": "^8.4.38"
},
"dependencies": {
"postcss": {
"version": "8.5.26",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.26.tgz",
"integrity": "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==",
"requires": {
"nanoid": "^3.3.17",
"picocolors": "^1.1.1",
"source-map-js": "^1.2.1"
}
}
}
},
"run-applescript": { "run-applescript": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz", "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz",
@@ -19532,9 +19679,9 @@
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
}, },
"source-map-js": { "source-map-js": {
"version": "1.0.2", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==" "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="
}, },
"source-map-support": { "source-map-support": {
"version": "0.5.21", "version": "0.5.21",
+1 -1
View File
@@ -25,6 +25,7 @@
"@dnd-kit/core": "^6.3.1", "@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0", "@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2", "@dnd-kit/utilities": "^3.2.2",
"@openpanel/web": "^1.4.1",
"@radix-ui/react-dialog": "^1.1.1", "@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.2", "@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-tabs": "^1.0.4", "@radix-ui/react-tabs": "^1.0.4",
@@ -33,7 +34,6 @@
"@tanstack/react-query-next-experimental": "^5.59.16", "@tanstack/react-query-next-experimental": "^5.59.16",
"@types/cheerio": "^0.22.35", "@types/cheerio": "^0.22.35",
"@upstash/redis": "^1.38.2", "@upstash/redis": "^1.38.2",
"@vercel/analytics": "^2.0.1",
"@vidstack/react": "^1.12.13", "@vidstack/react": "^1.12.13",
"axios": "^1.7.7", "axios": "^1.7.7",
"axios-cookiejar-support": "^5.0.3", "axios-cookiejar-support": "^5.0.3",