{"version":3,"file":"static/chunks/app/events/layout-a1e5ef030fad6044.js","mappings":"0JAMO,IAAMA,EAAa,CACxB,CACEC,KAAM,OACR,EACA,CACEA,KAAM,KACR,EACA,CACEA,KAAM,QACR,EACA,CACEA,KAAM,QACR,EACD,CACc,SAASC,IACtB,GAAM,CAACC,EAAaC,EAAe,CAAGC,CAAAA,EAAAA,EAAAA,QAAAA,CAAQA,CAAC,IACzC,CAACC,EAAQC,EAAU,CAAGF,CAAAA,EAAAA,EAAAA,QAAAA,CAAQA,CAAC,IAE/BG,EAAWC,CAAAA,EAAAA,EAAAA,WAAAA,CAAWA,GAoB5B,MAlBAC,CAAAA,EAAAA,EAAAA,OAAAA,CAAOA,CAAC,KACN,IAAMC,EAAc,IAClB,IAAMC,EAAQC,EAAUD,KAAK,CAAC,KAC9B,OAAOA,CAAK,CAACA,EAAME,MAAM,CAAG,EAAE,EAE1BC,EAAoB,WACPP,EAAAA,KAAAA,EAAAA,EAAUQ,QAAQ,CAACC,CAAnBT,CAAyBP,KAAI,IAE5CG,EAAea,EAAMhB,IAAI,EACzBM,EAAUI,EAAYO,CAAAA,EAAAA,EAAAA,EAAAA,CAAYA,CAACD,EAAMhB,IAAI,IAEjD,EAEAD,EAAWmB,OAAO,CAAC,IACjBJ,EAAkBE,EACpB,EACF,EAAG,CAACT,EAAS,EAEN,aAAEL,EAAaG,QAAO,CAC/B,kBC7CA,uCAAkJ,6FCOlJ,gBAA0C,GAAa,CACvD,iBACA,UACA,CACA,cACA,oBACA,iDACA,wDACA,CACA,cACA,kBACA,KACA,SAAgB,QAAqB,EACrC,CAAK,CACL,CACA,uBAEA,OADA,WAAuB,QAAqB,GAC5C,4BACA,CACA,iBACA,mBACA,KACA,MACA,WAAqB,oBACrB,CACA,CAAK,CACL,CACA,qBACA,mBACA,KACA,MACA,WAAqB,qBACrB,CACA,CAAK,CACL,CACA,kBACA,UAAY,GAAQ,EACpB,0BACA,YAAY,6CAAoD,EAChE,oCACA,mBACA,mBACA,oBAC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C,UAACvB,EAAAA,CAAUA,CAAAA,CAAChH,YAAaA,KAPrB,kBAYd,+HCzDe,SAASwI,IACtB,GAAM,YAAE1D,CAAU,UAAElD,CAAQ,IAAEJ,CAAE,QAAE0D,CAAM,CAAE,CAAGP,CAAAA,EAAAA,EAAAA,EAAAA,CAAeA,GACtD,eAAE8D,CAAa,CAAE,CAAGC,CAAAA,EAAAA,EAAAA,EAAAA,CAASA,GAE7BC,EAASpI,CAAAA,EAAAA,EAAAA,OAAAA,CAAOA,CAAU,KAC9B,IAAMqI,EAAa,CACjB,CACEC,KAAM,UACN/I,KAAM,SACR,EACA,CACE+I,KAAM,UACN/I,KAAM,SACR,EACD,QAED,EACS,IACF8I,EACH,CACEC,KAAM,CAJO,cAKb/I,KAAM,OACR,EACA,CACE+I,KAAM,gBACN/I,KAAM,QACR,EACD,CAGI,IAAI8I,EAAW,EACrB,CAACH,EAAc,EAElB,MACE,UAACzC,MAAAA,CAAIC,UAAU,mCACZ0C,EAAOzB,GAAG,CAAC,CAAC4B,EAAK3B,KAChB,IAAM4B,EAAaD,EAAIhJ,IAAI,GAAKgF,EAChC,MACE,WAACkB,MAAAA,CAAgBC,UAAU,uCACzB,UAACqB,IAAIA,CAEHC,KAAM,CACJlH,SAAU,IAAcuB,MAAAA,CAAVsD,EAAO,KAAe1D,MAAAA,CAAZI,EAAS,EAHhC0F,GAGyCwB,MAAAA,CAANtH,EAAG,KAAY,OAATsH,EAAIhJ,IAAI,CACpD,EACAmG,UAAW,2BAAgF,OAArD8C,EAAa,kBAAoB,8BAEtEhI,CAAAA,EAAAA,EAAAA,EAAAA,CAAYA,CAAC+H,EAAID,IAAI,GANjBC,EAAID,IAAI,EAQf,UAAC7C,MAAAA,CACCC,UAAW,6DAA6G,OAAhD8C,EAAa,gBAAkB,sBAXjG5B,EAed,IAGN","sources":["webpack://_N_E/./app/utils/hooks/useActiveRouteBanner.tsx","webpack://_N_E/?aa82","webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js","webpack://_N_E/../useInfiniteQuery.ts","webpack://_N_E/./app/hooks/queries/useEventQueries.ts","webpack://_N_E/./app/components/icons/SearchBar.tsx","webpack://_N_E/./app/events/_components/categoriesNav.tsx","webpack://_N_E/./app/events/_components/EventsSubnav.tsx","webpack://_N_E/./app/events/_components/EventTabList.tsx"],"sourcesContent":["import { usePathname } from 'next/navigation'\nimport { useMemo, useState } from 'react'\nimport { toPascalCase } from '../typeConverters'\ntype CategoriesRoute = {\n path: string\n}\nexport const categories = [\n {\n path: 'music',\n },\n {\n path: 'art',\n },\n {\n path: 'online',\n },\n {\n path: 'sports',\n },\n]\nexport default function useActiveRouteBanner() {\n const [activeRoute, setActiveRoute] = useState('')\n const [banner, setBanner] = useState('')\n // verifies if routeName is the one active (in browser input)\n const pathname = usePathname()\n\n useMemo(() => {\n const bannerSplit = (routeName: string) => {\n const split = routeName.split('/')\n return split[split.length - 1]\n }\n const handleActiveRoute = (route: CategoriesRoute) => {\n const isActive = pathname?.includes(route.path)\n if (isActive) {\n setActiveRoute(route.path)\n setBanner(bannerSplit(toPascalCase(route.path)))\n }\n }\n\n categories.forEach((route: CategoriesRoute) => {\n handleActiveRoute(route)\n })\n }, [pathname])\n\n return { activeRoute, banner }\n}\n","import(/* webpackMode: \"eager\", webpackExports: [\"default\"] */ \"/codebuild/output/src1784519652/src/soti/app/events/_components/EventsSubnav.tsx\");\n","// src/infiniteQueryObserver.ts\nimport { QueryObserver } from \"./queryObserver.js\";\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior\n} from \"./infiniteQueryBehavior.js\";\nvar InfiniteQueryObserver = class extends QueryObserver {\n constructor(client, options) {\n super(client, options);\n }\n bindMethods() {\n super.bindMethods();\n this.fetchNextPage = this.fetchNextPage.bind(this);\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this);\n }\n setOptions(options) {\n super.setOptions({\n ...options,\n behavior: infiniteQueryBehavior()\n });\n }\n getOptimisticResult(options) {\n options.behavior = infiniteQueryBehavior();\n return super.getOptimisticResult(options);\n }\n fetchNextPage(options) {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: \"forward\" }\n }\n });\n }\n fetchPreviousPage(options) {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: \"backward\" }\n }\n });\n }\n createResult(query, options) {\n const { state } = query;\n const parentResult = super.createResult(query, options);\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult;\n const fetchDirection = state.fetchMeta?.fetchMore?.direction;\n const isFetchNextPageError = isError && fetchDirection === \"forward\";\n const isFetchingNextPage = isFetching && fetchDirection === \"forward\";\n const isFetchPreviousPageError = isError && fetchDirection === \"backward\";\n const isFetchingPreviousPage = isFetching && fetchDirection === \"backward\";\n const result = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage\n };\n return result;\n }\n};\nexport {\n InfiniteQueryObserver\n};\n//# sourceMappingURL=infiniteQueryObserver.js.map","'use client'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n InfiniteData,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): DefinedUseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery(\n options: UseInfiniteQueryOptions,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n )\n}\n","import { useInfiniteQuery, useQuery, useQueryClient } from '@tanstack/react-query'\nimport { usePathname } from 'next/navigation'\nimport { useCallback, useEffect, useState } from 'react'\nimport { EVENTSMODEL, GENRESEENUM } from '../../types/graphql/API'\nexport interface EventFilters {\n category?: GENRESEENUM\n page?: number\n search?: string\n}\n\nexport interface EventsResponse {\n _embedded: {\n events: EVENTSMODEL[]\n }\n _links: {\n self: { href: string }\n first: { href: string }\n last: { href: string }\n next: { href: string }\n prev: { href: string }\n }\n page: {\n totalElements: number\n number: number\n size: number\n totalPages: number\n }\n}\n\nexport const eventKeys = {\n all: ['events'] as const,\n lists: () => [...eventKeys.all, 'list'] as const,\n list: (filters: EventFilters) => [...eventKeys.lists(), filters] as const,\n active: () => [...eventKeys.all, 'active'] as const,\n detail: (id: string) => [...eventKeys.all, 'detail', id] as const,\n}\n\nasync function fetchEvents(filters: EventFilters): Promise {\n const params = new URLSearchParams()\n if (filters.category) params.set('category', filters.category)\n if (filters.page) params.set('page', filters.page.toString())\n const url = new URL(`/api/getevents?${params.toString()}`, process.env.NEXT_PUBLIC_BASE_URL)\n const response = await fetch(url)\n if (!response.ok) {\n throw new Error('Failed to fetch events')\n }\n return response.json()\n}\n\nasync function fetchEvent(id: string): Promise {\n if (!id) return null\n console.log('Fetching event with ID:', id)\n const url = new URL(`/api/getEvent?id=${id}`, process.env.NEXT_PUBLIC_BASE_URL)\n\n try {\n const response = await fetch(url)\n if (!response.ok) return null\n\n const data = await response.json()\n return data.item || null\n } catch (error) {\n console.error('Error fetching event:', error)\n return null\n }\n}\n\nexport function useEventsInfiniteQuery(filters: Omit) {\n return useInfiniteQuery({\n queryKey: eventKeys.list(filters),\n queryFn: ({ pageParam = 0 }) => fetchEvents({ ...filters, page: pageParam }),\n initialPageParam: 0,\n getNextPageParam: (lastPage) => {\n if (lastPage.page.number < lastPage.page.totalPages - 1) {\n return lastPage.page.number + 1\n }\n return undefined\n },\n select: (data) => ({\n pages: data.pages,\n pageParams: data.pageParams,\n events: data.pages.flatMap((page) => page._embedded.events),\n total: data.pages[0]?.page.totalElements || 0,\n }),\n })\n}\n\nexport function useEventQuery(id: string) {\n const queryClient = useQueryClient()\n console.log('useEventQuery called with ID:', id)\n\n return useQuery({\n queryKey: eventKeys.detail(id),\n queryFn: async () => {\n console.log('Query function executing for ID:', id)\n if (!id) return null\n return fetchEvent(id)\n },\n initialData: () => {\n // Try to find the event in the infinite query cache first\n const infiniteData = queryClient.getQueryData<{\n pages: EventsResponse[]\n }>(eventKeys.lists())\n\n if (infiniteData) {\n const event = infiniteData.pages.flatMap((page) => page._embedded.events).find((event) => event.id === id)\n\n if (event) {\n console.log('Found event in cache:', event)\n return event\n }\n }\n return undefined // Let it fetch if not in cache\n },\n enabled: !!id,\n refetchOnMount: true, // Always refetch on mount to ensure fresh data\n staleTime: 0, // Consider data immediately stale to trigger refetch\n })\n}\n\n// Hook to manage active event state\nexport function useActiveEvent(id?: string) {\n const queryClient = useQueryClient()\n const { data: event } = useEventQuery(id)\n\n // Pre-fetch related data when an event becomes active\n const preFetchEventData = async (eventId: string) => {\n const event = await fetchEvent(eventId)\n queryClient.setQueryData(eventKeys.detail(eventId), event)\n\n // Pre-fetch related data like tickets, contract info, etc.\n // This will be implemented when we add those queries\n }\n\n return {\n event,\n preFetchEventData,\n }\n}\n\nexport function useEventDetails() {\n const pathname = usePathname()\n const [correctPath, setCorrectPath] = useState(false)\n const [currentTab, setCurrentTab] = useState()\n const [category, setCategory] = useState()\n const [id, setId] = useState('')\n const [parent, setParent] = useState()\n\n const calculateDetails = useCallback(() => {\n console.log('eventTabList ', pathname)\n const splitPathName = pathname.split('/')\n setCorrectPath(splitPathName.length == 5)\n setCurrentTab(splitPathName[splitPathName.length - 1])\n setCategory(splitPathName[2])\n setId(splitPathName[3] || '')\n setParent(splitPathName[1])\n }, [pathname])\n\n useEffect(() => {\n calculateDetails()\n }, [pathname])\n\n return { correctPath, currentTab, category, id, parent }\n}\n","export function SearchBar(props: {\n variant?: string\n background?: string\n children?: JSX.Element\n placeholder?: string\n borderRadius?: string | number\n [x: string]: any\n}) {\n const { variant, background, children, placeholder, borderRadius, ...rest } = props\n\n return (\n
\n
\n \n \n \n \n \n \n
\n
\n )\n}\n","'use client'\nimport Link from 'next/link'\nimport { SearchBar } from '../../components/icons/SearchBar'\nimport useActiveRouteBanner, { categories } from '../../utils/hooks/useActiveRouteBanner'\nimport { toPascalCase } from '../../utils/typeConverters'\n\nexport default function CategoriesNav() {\n const { activeRoute, banner } = useActiveRouteBanner()\n return (\n
\n
\n \n
\n
\n

Trending {banner}

\n
\n
\n
\n \n
\n
\n )\n}\n\nexport function MainRoutes({ activeRoute }: { activeRoute: string }) {\n return (\n
\n {categories.map((route, index: number) => {\n const isActive = route.path === activeRoute.toLowerCase()\n return (\n
\n \n {toPascalCase(route.path)}\n \n
\n
\n )\n })}\n
\n )\n}\n\nexport function EventNav() {\n const { activeRoute, banner } = useActiveRouteBanner()\n return (\n
\n
\n \n
\n
\n

Trending {banner}

\n
\n
\n
\n \n
\n
\n )\n}\n","'use client'\nimport { AnimatePresence, motion } from 'framer-motion'\nimport { SearchBar } from '../../components/icons/SearchBar'\nimport { useEventDetails } from '../../hooks/queries/useEventQueries'\nimport useActiveRouteBanner from '../../utils/hooks/useActiveRouteBanner'\nimport { MainRoutes } from './categoriesNav'\nimport EventTabList from './EventTabList'\n\nconst variants = {\n enter: {\n opacity: 0,\n y: 20,\n },\n center: {\n opacity: 1,\n y: 0,\n },\n exit: {\n opacity: 0,\n y: -20,\n },\n}\n\nexport default function EventsSubNav() {\n const { correctPath } = useEventDetails()\n const { activeRoute, banner } = useActiveRouteBanner()\n\n return (\n
\n
\n \n
\n \n )\n}\nfunction EventRoutes({ activeRoute, correctPath }: { activeRoute: string; correctPath: boolean }) {\n return (\n \n {correctPath ? (\n \n \n \n ) : (\n \n \n \n )}\n \n )\n}\n","'use client'\n\nimport { useWallet } from '@txnlab/use-wallet'\nimport Link from 'next/link'\nimport { useMemo } from 'react'\nimport { useEventDetails } from '../../hooks/queries/useEventQueries'\nimport { toPascalCase } from '../../utils/typeConverters'\n\ninterface Route {\n name: string\n path: string\n}\n\nexport default function EventTabList() {\n const { currentTab, category, id, parent } = useEventDetails()\n const { activeAddress } = useWallet()\n\n const routes = useMemo(() => {\n const baseRoutes = [\n {\n name: 'Details',\n path: 'Details',\n },\n {\n name: 'Tickets',\n path: 'Tickets',\n },\n ]\n\n if (activeAddress) {\n return [\n ...baseRoutes,\n {\n name: 'Claim Ticket',\n path: 'Claim',\n },\n {\n name: 'Redeem Ticket',\n path: 'Redeem',\n },\n ]\n }\n\n return [...baseRoutes]\n }, [activeAddress])\n\n return (\n
\n {routes.map((cat, index) => {\n const isSelected = cat.path === currentTab\n return (\n
\n \n {toPascalCase(cat.name)}\n \n \n
\n )\n })}\n
\n )\n}\n"],"names":["categories","path","useActiveRouteBanner","activeRoute","setActiveRoute","useState","banner","setBanner","pathname","usePathname","useMemo","bannerSplit","split","routeName","length","handleActiveRoute","includes","route","toPascalCase","forEach","eventKeys","all","lists","list","filters","active","detail","id","fetchEvents","params","URLSearchParams","category","set","page","toString","url","URL","process","response","fetch","ok","json","fetchEvent","console","log","data","item","error","useEventsInfiniteQuery","useInfiniteQuery","queryKey","queryFn","pageParam","initialPageParam","getNextPageParam","lastPage","number","totalPages","select","pages","pageParams","events","flatMap","_embedded","total","totalElements","useEventQuery","queryClient","useQueryClient","useQuery","initialData","infiniteData","getQueryData","event","find","enabled","refetchOnMount","staleTime","useEventDetails","correctPath","setCorrectPath","currentTab","setCurrentTab","setCategory","setId","parent","setParent","calculateDetails","useCallback","splitPathName","useEffect","SearchBar","props","variant","background","children","placeholder","borderRadius","rest","div","className","input","type","button","aria-label","svg","fill","stroke","viewBox","xmlns","strokeLinecap","strokeLinejoin","strokeWidth","d","CategoriesNav","MainRoutes","h1","map","index","isActive","toLowerCase","Link","href","variants","enter","opacity","y","center","exit","EventsSubNav","EventRoutes","AnimatePresence","mode","motion","initial","animate","transition","duration","ease","EventTabList","activeAddress","useWallet","routes","baseRoutes","name","cat","isSelected"],"sourceRoot":"","ignoreList":[2]}