@mottosports/motto-video-player 1.0.1-rc.5 → 1.0.1-rc.6

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/index.js CHANGED
@@ -31,8 +31,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  // src/index.ts
32
32
  var index_exports = {};
33
33
  __export(index_exports, {
34
- ClientOnlyPlayer: () => ClientOnlyPlayer,
35
- ClientSideEvent: () => ClientSideEvent,
36
34
  CreativeWork: () => CreativeWork,
37
35
  CreativeWorksSortDirection: () => CreativeWorksSortDirection,
38
36
  Event: () => Event,
@@ -75,11 +73,9 @@ styleInject('/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */\n
75
73
 
76
74
  // src/Player.tsx
77
75
  var import_react11 = require("react");
78
- var import_shaka_player3 = __toESM(require("shaka-player/dist/shaka-player.ui"));
79
76
 
80
77
  // src/hooks/useShakePlayer.ts
81
78
  var import_react = require("react");
82
- var import_shaka_player = require("shaka-player/dist/shaka-player.ui");
83
79
  var useShakePlayer = ({
84
80
  src,
85
81
  shakaConfig,
@@ -90,11 +86,12 @@ var useShakePlayer = ({
90
86
  const playerRef = (0, import_react.useRef)(null);
91
87
  const initializePlayer = (0, import_react.useCallback)(async (video) => {
92
88
  try {
93
- import_shaka_player.polyfill.installAll();
94
- if (!import_shaka_player.Player.isBrowserSupported()) {
89
+ const { Player: ShakaPlayer, polyfill } = await import("shaka-player/dist/shaka-player.ui");
90
+ polyfill.installAll();
91
+ if (!ShakaPlayer.isBrowserSupported()) {
95
92
  throw new Error("Browser not supported by Shaka Player");
96
93
  }
97
- const player = new import_shaka_player.Player(video);
94
+ const player = new ShakaPlayer(video);
98
95
  playerRef.current = player;
99
96
  await player.attach(video);
100
97
  if (shakaConfig) {
@@ -243,7 +240,7 @@ var useSkipControls = (videoRef, onSkipBack, onSkipForward) => {
243
240
  // src/hooks/useMuxAnalytics.ts
244
241
  var import_react4 = require("react");
245
242
  var import_mux_data_shakaplayer = __toESM(require("@mux/mux-data-shakaplayer"));
246
- var import_shaka_player2 = __toESM(require("shaka-player/dist/shaka-player.ui"));
243
+ var import_shaka_player = __toESM(require("shaka-player/dist/shaka-player.ui"));
247
244
  var useMuxAnalytics = (playerRef, muxConfig, onMuxReady, onMuxDataUpdate) => {
248
245
  const shakaPlayerMuxRef = (0, import_react4.useRef)(null);
249
246
  const initializeMux = (0, import_react4.useCallback)(() => {
@@ -265,7 +262,7 @@ var useMuxAnalytics = (playerRef, muxConfig, onMuxReady, onMuxDataUpdate) => {
265
262
  ...muxConfig.metadata
266
263
  }
267
264
  };
268
- shakaPlayerMuxRef.current = (0, import_mux_data_shakaplayer.default)(playerRef.current, muxOptions, import_shaka_player2.default);
265
+ shakaPlayerMuxRef.current = (0, import_mux_data_shakaplayer.default)(playerRef.current, muxOptions, import_shaka_player.default);
269
266
  onMuxReady?.();
270
267
  } catch (error) {
271
268
  console.error("Failed to initialize Mux Analytics:", error);
@@ -1288,17 +1285,18 @@ var Player = (0, import_react11.forwardRef)(
1288
1285
  controls: uiRef.current,
1289
1286
  manualStreamStartDate: streamStartDate
1290
1287
  });
1291
- const initializeAds = () => {
1288
+ const initializeAds = async () => {
1292
1289
  if (!imaConfig || !playerRef.current || !videoRef.current) return;
1293
1290
  const adManager = playerRef.current.getAdManager();
1294
1291
  if (!adManager) return;
1295
- adManager.addEventListener(import_shaka_player3.default.ads?.Utils?.AD_STARTED, () => {
1292
+ const shaka2 = await import("shaka-player/dist/shaka-player.ui");
1293
+ adManager.addEventListener(shaka2.ads?.Utils?.AD_STARTED, () => {
1296
1294
  events?.onAdStart?.();
1297
1295
  });
1298
- adManager.addEventListener(import_shaka_player3.default.ads?.Utils?.AD_COMPLETE, () => {
1296
+ adManager.addEventListener(shaka2.ads?.Utils?.AD_COMPLETE, () => {
1299
1297
  events?.onAdComplete?.();
1300
1298
  });
1301
- adManager.addEventListener(import_shaka_player3.default.ads?.Utils?.AD_ERROR, (event) => {
1299
+ adManager.addEventListener(shaka2.ads?.Utils?.AD_ERROR, (event) => {
1302
1300
  events?.onAdError?.(event.detail);
1303
1301
  });
1304
1302
  if (imaConfig.adTagUrl) {
@@ -1339,7 +1337,7 @@ var Player = (0, import_react11.forwardRef)(
1339
1337
  configureQuality();
1340
1338
  await initializeUI();
1341
1339
  initializeMux();
1342
- initializeAds();
1340
+ await initializeAds();
1343
1341
  initializeChromecast();
1344
1342
  } catch (error) {
1345
1343
  console.error("Error during player initialization:", error);
@@ -1435,40 +1433,8 @@ var Player = (0, import_react11.forwardRef)(
1435
1433
  );
1436
1434
  Player.displayName = "Player";
1437
1435
 
1438
- // src/ClientOnlyPlayer.tsx
1439
- var import_react12 = require("react");
1440
- var import_jsx_runtime6 = require("react/jsx-runtime");
1441
- var ClientOnlyPlayer = (0, import_react12.forwardRef)(
1442
- (props, ref) => {
1443
- const [isClient, setIsClient] = (0, import_react12.useState)(false);
1444
- (0, import_react12.useEffect)(() => {
1445
- setIsClient(true);
1446
- }, []);
1447
- if (!isClient) {
1448
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1449
- "div",
1450
- {
1451
- className: props.containerClassName,
1452
- style: {
1453
- width: props.width,
1454
- height: props.height,
1455
- aspectRatio: props.aspectRatio ? props.aspectRatio.toString() : "16/9",
1456
- backgroundColor: "#000",
1457
- display: "flex",
1458
- alignItems: "center",
1459
- justifyContent: "center"
1460
- },
1461
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { color: "white" }, children: "Loading player..." })
1462
- }
1463
- );
1464
- }
1465
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Player, { ...props, ref });
1466
- }
1467
- );
1468
- ClientOnlyPlayer.displayName = "ClientOnlyPlayer";
1469
-
1470
1436
  // src/Video.tsx
1471
- var import_react14 = require("react");
1437
+ var import_react13 = require("react");
1472
1438
  var import_tailwind_merge3 = require("tailwind-merge");
1473
1439
  var import_react_query = require("@tanstack/react-query");
1474
1440
 
@@ -1619,7 +1585,7 @@ var getErrorType = (error, video) => {
1619
1585
  };
1620
1586
 
1621
1587
  // src/messages/useMessages.tsx
1622
- var import_react13 = require("react");
1588
+ var import_react12 = require("react");
1623
1589
 
1624
1590
  // src/messages/en.json
1625
1591
  var en_default = {
@@ -1928,9 +1894,9 @@ var getBrowserLanguage = () => {
1928
1894
  }
1929
1895
  };
1930
1896
  var useMessages = (locale) => {
1931
- const [language, setLanguage] = (0, import_react13.useState)("en");
1932
- const [translations, setTranslations] = (0, import_react13.useState)(availableLanguages.en);
1933
- (0, import_react13.useEffect)(() => {
1897
+ const [language, setLanguage] = (0, import_react12.useState)("en");
1898
+ const [translations, setTranslations] = (0, import_react12.useState)(availableLanguages.en);
1899
+ (0, import_react12.useEffect)(() => {
1934
1900
  const lang = !!availableLanguages?.[locale] ? locale : getBrowserLanguage();
1935
1901
  setLanguage(lang);
1936
1902
  setTranslations(availableLanguages[lang]);
@@ -1955,7 +1921,7 @@ var useMessages = (locale) => {
1955
1921
  var useMessages_default = useMessages;
1956
1922
 
1957
1923
  // src/Video.tsx
1958
- var import_jsx_runtime7 = require("react/jsx-runtime");
1924
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1959
1925
  var Video = ({
1960
1926
  videoId,
1961
1927
  publicKey,
@@ -1991,13 +1957,13 @@ var Video = ({
1991
1957
  const { t } = useMessages_default(locale);
1992
1958
  const activePlaylist = findHLSPlaylist(video);
1993
1959
  const hlsUrl = activePlaylist?.url;
1994
- (0, import_react14.useEffect)(() => {
1960
+ (0, import_react13.useEffect)(() => {
1995
1961
  if (events?.onVideoData && video) {
1996
1962
  events.onVideoData(video);
1997
1963
  }
1998
1964
  }, [video, events]);
1999
1965
  if (isLoading || !providedVideoData && !video) {
2000
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_tailwind_merge3.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "relative w-full h-full bg-[#151515]", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Loading, {}) }) });
1966
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_tailwind_merge3.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "relative w-full h-full bg-[#151515]", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Loading, {}) }) });
2001
1967
  }
2002
1968
  if (!isLoading && video && !hlsUrl && events?.onEmptyPlaylists) {
2003
1969
  events.onEmptyPlaylists();
@@ -2010,8 +1976,8 @@ var Video = ({
2010
1976
  }
2011
1977
  const title = t(errorKey) || t("DEFAULT_ERROR");
2012
1978
  const description = t(`${errorKey}_DESCRIPTION`) || t("DEFAULT_ERROR_DESCRIPTION");
2013
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_tailwind_merge3.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative w-full h-full", children: [
2014
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1979
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_tailwind_merge3.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "relative w-full h-full", children: [
1980
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2015
1981
  ErrorScreen,
2016
1982
  {
2017
1983
  title,
@@ -2022,13 +1988,13 @@ var Video = ({
2022
1988
  ] }) });
2023
1989
  }
2024
1990
  if (!hlsUrl) {
2025
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_tailwind_merge3.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative w-full h-full bg-[#151515]", children: [
2026
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Title, { title: video?.name || "" }),
1991
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_tailwind_merge3.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "relative w-full h-full bg-[#151515]", children: [
1992
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Title, { title: video?.name || "" }),
2027
1993
  children
2028
1994
  ] }) });
2029
1995
  }
2030
1996
  console.log("hlsUrl", hlsUrl);
2031
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_tailwind_merge3.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "relative w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1997
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_tailwind_merge3.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "relative w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2032
1998
  Player,
2033
1999
  {
2034
2000
  ...props,
@@ -2042,10 +2008,10 @@ var Video = ({
2042
2008
  };
2043
2009
 
2044
2010
  // src/Event.tsx
2045
- var import_react15 = require("react");
2011
+ var import_react14 = require("react");
2046
2012
  var import_tailwind_merge4 = require("tailwind-merge");
2047
2013
  var import_react_query2 = require("@tanstack/react-query");
2048
- var import_jsx_runtime8 = require("react/jsx-runtime");
2014
+ var import_jsx_runtime7 = require("react/jsx-runtime");
2049
2015
  var Event = ({
2050
2016
  publicKey,
2051
2017
  eventId,
@@ -2075,8 +2041,8 @@ var Event = ({
2075
2041
  retry: queryOptions.retry ?? 3,
2076
2042
  retryDelay: queryOptions.retryDelay ?? ((attemptIndex) => Math.min(1e3 * 2 ** attemptIndex, 3e4))
2077
2043
  });
2078
- const [activePlaylist, setActivePlaylist] = (0, import_react15.useState)();
2079
- const [activeVideoId, setActiveVideoId] = (0, import_react15.useState)();
2044
+ const [activePlaylist, setActivePlaylist] = (0, import_react14.useState)();
2045
+ const [activeVideoId, setActiveVideoId] = (0, import_react14.useState)();
2080
2046
  const videoIds = eventData?.videoIds ?? [];
2081
2047
  const {
2082
2048
  data: videosData,
@@ -2092,8 +2058,8 @@ var Event = ({
2092
2058
  retry: queryOptions.retry ?? 3,
2093
2059
  retryDelay: queryOptions.retryDelay ?? ((attemptIndex) => Math.min(1e3 * 2 ** attemptIndex, 3e4))
2094
2060
  });
2095
- const [loadingApisState, setLoadingApisState] = (0, import_react15.useState)(true);
2096
- (0, import_react15.useEffect)(() => {
2061
+ const [loadingApisState, setLoadingApisState] = (0, import_react14.useState)(true);
2062
+ (0, import_react14.useEffect)(() => {
2097
2063
  if (videosData !== void 0) {
2098
2064
  setLoadingApisState(false);
2099
2065
  const videosWithPlaylists = videosData.filter(
@@ -2125,12 +2091,12 @@ var Event = ({
2125
2091
  }
2126
2092
  }, [videosData, eventData]);
2127
2093
  const { t } = useMessages_default(locale);
2128
- (0, import_react15.useEffect)(() => {
2094
+ (0, import_react14.useEffect)(() => {
2129
2095
  if (events?.onEventData && eventData) {
2130
2096
  events.onEventData(eventData);
2131
2097
  }
2132
2098
  }, [eventData, events]);
2133
- (0, import_react15.useEffect)(() => {
2099
+ (0, import_react14.useEffect)(() => {
2134
2100
  if (events?.onVideoData && activeVideoId && videosData) {
2135
2101
  const activeVideo = videosData.find((video) => video.id === activeVideoId);
2136
2102
  if (activeVideo) {
@@ -2138,10 +2104,10 @@ var Event = ({
2138
2104
  }
2139
2105
  }
2140
2106
  }, [activeVideoId, videosData, events]);
2141
- const [error, setError] = (0, import_react15.useState)(null);
2142
- const [loadingPlaylist, setLoadingPlaylist] = (0, import_react15.useState)(true);
2107
+ const [error, setError] = (0, import_react14.useState)(null);
2108
+ const [loadingPlaylist, setLoadingPlaylist] = (0, import_react14.useState)(true);
2143
2109
  const videosDataError = videosData?.some((video) => !!video.error);
2144
- (0, import_react15.useEffect)(() => {
2110
+ (0, import_react14.useEffect)(() => {
2145
2111
  if (eventError || videosError || videosDataError) {
2146
2112
  const errorObj = eventError || videosError || videosData?.find((video) => !!video.error)?.error && new Error(videosData?.find((video) => !!video.error)?.error) || new Error("default");
2147
2113
  setError(errorObj);
@@ -2152,7 +2118,7 @@ var Event = ({
2152
2118
  setError(null);
2153
2119
  }
2154
2120
  }, [eventError, videosError, videosDataError, videosData, events]);
2155
- (0, import_react15.useEffect)(() => {
2121
+ (0, import_react14.useEffect)(() => {
2156
2122
  const eventLoadedWithNoVideos = !isEventLoading && eventData && eventData.videoIds && (!eventData.videoIds || eventData?.videoIds?.length === 0) && !loadingApisState;
2157
2123
  const allApisLoadedWithPotentialVideos = !isEventLoading && !videosIsLoading && eventData && !loadingApisState;
2158
2124
  if (eventLoadedWithNoVideos || allApisLoadedWithPotentialVideos) {
@@ -2162,7 +2128,7 @@ var Event = ({
2162
2128
  if (error) {
2163
2129
  const title = t(error.message)?.length ? t(error.message) : t("DEFAULT_ERROR");
2164
2130
  const description = t(`${error.message}_DESCRIPTION`)?.length ? t(`${error.message}_DESCRIPTION`) : t("DEFAULT_ERROR_DESCRIPTION");
2165
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: (0, import_tailwind_merge4.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2131
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_tailwind_merge4.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "relative w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2166
2132
  ErrorScreen,
2167
2133
  {
2168
2134
  title,
@@ -2174,12 +2140,12 @@ var Event = ({
2174
2140
  events.onEmptyPlaylists();
2175
2141
  }
2176
2142
  if (loadingPlaylist) {
2177
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: (0, import_tailwind_merge4.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative w-full h-full bg-[#151515]", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Loading, {}) }) });
2143
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_tailwind_merge4.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "relative w-full h-full bg-[#151515]", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Loading, {}) }) });
2178
2144
  }
2179
2145
  if (activePlaylist && activeVideoId && videosData) {
2180
2146
  const activeVideo = videosData.find((video) => video.id === activeVideoId);
2181
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: (0, import_tailwind_merge4.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative w-full h-full", children: [
2182
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2147
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_tailwind_merge4.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative w-full h-full", children: [
2148
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2183
2149
  Player,
2184
2150
  {
2185
2151
  ...props,
@@ -2189,7 +2155,7 @@ var Event = ({
2189
2155
  containerClassName: "w-full h-full"
2190
2156
  }
2191
2157
  ),
2192
- !hideTitle && eventData && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2158
+ !hideTitle && eventData && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2193
2159
  TitleAndDescription,
2194
2160
  {
2195
2161
  title: eventData.title,
@@ -2201,7 +2167,7 @@ var Event = ({
2201
2167
  ] }) });
2202
2168
  }
2203
2169
  if (eventData) {
2204
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: (0, import_tailwind_merge4.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2170
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_tailwind_merge4.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "relative w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2205
2171
  PreEvent,
2206
2172
  {
2207
2173
  event: eventData,
@@ -2223,12 +2189,12 @@ function PreEvent({
2223
2189
  }) {
2224
2190
  const date = new Date(event.startTime);
2225
2191
  const now = /* @__PURE__ */ new Date();
2226
- const [remainingTime, setRemainingTime] = (0, import_react15.useState)(
2192
+ const [remainingTime, setRemainingTime] = (0, import_react14.useState)(
2227
2193
  date.getTime() - now.getTime()
2228
2194
  );
2229
2195
  const shouldBeStarted = remainingTime < 0;
2230
2196
  const { t } = useMessages_default(locale);
2231
- (0, import_react15.useEffect)(() => {
2197
+ (0, import_react14.useEffect)(() => {
2232
2198
  const interval = setInterval(() => {
2233
2199
  if (remainingTime < 0) {
2234
2200
  clearInterval(interval);
@@ -2238,17 +2204,17 @@ function PreEvent({
2238
2204
  }, 1e3);
2239
2205
  return () => clearInterval(interval);
2240
2206
  }, [date, remainingTime]);
2241
- const renderCountdown = (0, import_react15.useCallback)(() => {
2207
+ const renderCountdown = (0, import_react14.useCallback)(() => {
2242
2208
  if (shouldBeStarted) {
2243
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-base-content text-xl", children: t("EVENT_NOT_STARTED") });
2209
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-base-content text-xl", children: t("EVENT_NOT_STARTED") });
2244
2210
  }
2245
2211
  const seconds = Math.floor(remainingTime / 1e3) % 60;
2246
2212
  const minutes = Math.floor(remainingTime / 1e3 / 60) % 60;
2247
2213
  const hours = Math.floor(remainingTime / 1e3 / 60 / 60) % 24;
2248
2214
  const days = Math.floor(remainingTime / 1e3 / 60 / 60 / 24);
2249
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "grid grid-flow-col gap-5 text-center auto-cols-max", children: [
2250
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2251
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2215
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "grid grid-flow-col gap-5 text-center auto-cols-max", children: [
2216
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2217
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2252
2218
  "span",
2253
2219
  {
2254
2220
  style: { "--value": days },
@@ -2257,10 +2223,10 @@ function PreEvent({
2257
2223
  children: days?.toString()?.padStart(2, "0")
2258
2224
  }
2259
2225
  ) }),
2260
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("DAYS") })
2226
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("DAYS") })
2261
2227
  ] }),
2262
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2263
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2228
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2229
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2264
2230
  "span",
2265
2231
  {
2266
2232
  style: { "--value": hours },
@@ -2269,10 +2235,10 @@ function PreEvent({
2269
2235
  children: hours?.toString()?.padStart(2, "0")
2270
2236
  }
2271
2237
  ) }),
2272
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("HOURS") })
2238
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("HOURS") })
2273
2239
  ] }),
2274
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2275
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2240
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2241
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2276
2242
  "span",
2277
2243
  {
2278
2244
  style: { "--value": minutes },
@@ -2281,10 +2247,10 @@ function PreEvent({
2281
2247
  children: minutes?.toString()?.padStart(2, "0")
2282
2248
  }
2283
2249
  ) }),
2284
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("MINUTES") })
2250
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("MINUTES") })
2285
2251
  ] }),
2286
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2287
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2252
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2253
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2288
2254
  "span",
2289
2255
  {
2290
2256
  style: { "--value": seconds },
@@ -2293,12 +2259,13 @@ function PreEvent({
2293
2259
  children: seconds?.toString()?.padStart(2, "0")
2294
2260
  }
2295
2261
  ) }),
2296
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("SECONDS") })
2262
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("SECONDS") })
2297
2263
  ] })
2298
2264
  ] });
2299
2265
  }, [remainingTime, shouldBeStarted, t]);
2300
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: event?.posterUrl ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
2301
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2266
+ console.log("event", event);
2267
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: event?.posterUrl ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2268
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2302
2269
  "div",
2303
2270
  {
2304
2271
  className: "relative overflow-hidden bg-base-200 aspect-video text-base-content w-full h-full flex justify-center items-center flex-col bg-no-repeat bg-cover md:rounded-2xl",
@@ -2308,12 +2275,12 @@ function PreEvent({
2308
2275
  backgroundSize: "cover"
2309
2276
  },
2310
2277
  children: [
2311
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "absolute inset-0 bg-base-200" }),
2312
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative z-10", children: renderCountdown() })
2278
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "absolute inset-0 bg-base-200" }),
2279
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "relative z-10", children: renderCountdown() })
2313
2280
  ]
2314
2281
  }
2315
2282
  ),
2316
- !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2283
+ !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2317
2284
  TitleAndDescription,
2318
2285
  {
2319
2286
  title: event.title,
@@ -2322,21 +2289,18 @@ function PreEvent({
2322
2289
  locale
2323
2290
  }
2324
2291
  )
2325
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
2326
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2292
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2293
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2327
2294
  "div",
2328
2295
  {
2329
2296
  className: "relative overflow-hidden md:rounded-2xl bg-base-200 aspect-video text-base-content flex flex-col justify-center items-center w-full h-full bg-cover bg-center bg-no-repeat",
2330
2297
  style: {
2331
2298
  backgroundImage: backgroundImageUrl ? `url(${backgroundImageUrl})` : ""
2332
2299
  },
2333
- children: [
2334
- backgroundImageUrl && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "absolute inset-0 bg-black bg-opacity-40" }),
2335
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative z-10", children: renderCountdown() })
2336
- ]
2300
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "relative z-10", children: renderCountdown() })
2337
2301
  }
2338
2302
  ),
2339
- !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2303
+ !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2340
2304
  TitleAndDescription,
2341
2305
  {
2342
2306
  title: event.title,
@@ -2354,9 +2318,9 @@ var TitleAndDescription = ({
2354
2318
  locale = "en",
2355
2319
  className
2356
2320
  }) => {
2357
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_tailwind_merge4.twMerge)("mt-3 mb-6 m-event-details-ctn px-4 text-left w-full", className), children: [
2358
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "text-base md:text-xl m-event-title text-base-content font-medium", children: title }),
2359
- startTime ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "text-sm md:text-base text-base-content/70 m-event-start-time", children: [
2321
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: (0, import_tailwind_merge4.twMerge)("mt-3 mb-6 m-event-details-ctn px-4 text-left w-full", className), children: [
2322
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "text-base md:text-xl m-event-title text-base-content font-medium", children: title }),
2323
+ startTime ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "text-sm md:text-base text-base-content/70 m-event-start-time", children: [
2360
2324
  new Date(startTime || "").toLocaleDateString(locale || "default", {
2361
2325
  month: "long",
2362
2326
  year: "numeric",
@@ -2369,15 +2333,15 @@ var TitleAndDescription = ({
2369
2333
  minute: "2-digit"
2370
2334
  })
2371
2335
  ] }) : null,
2372
- description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "text-xs md:text-sm text-base-content/60 uppercase", children: description })
2336
+ description && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "text-xs md:text-sm text-base-content/60 uppercase", children: description })
2373
2337
  ] });
2374
2338
  };
2375
2339
 
2376
2340
  // src/CreativeWork.tsx
2377
- var import_react16 = require("react");
2341
+ var import_react15 = require("react");
2378
2342
  var import_tailwind_merge5 = require("tailwind-merge");
2379
2343
  var import_react_query3 = require("@tanstack/react-query");
2380
- var import_jsx_runtime9 = require("react/jsx-runtime");
2344
+ var import_jsx_runtime8 = require("react/jsx-runtime");
2381
2345
  var CreativeWork = ({
2382
2346
  publicKey,
2383
2347
  creativeWorkId,
@@ -2407,9 +2371,9 @@ var CreativeWork = ({
2407
2371
  retry: queryOptions.retry ?? 3,
2408
2372
  retryDelay: queryOptions.retryDelay ?? ((attemptIndex) => Math.min(1e3 * 2 ** attemptIndex, 3e4))
2409
2373
  });
2410
- const [activePlaylist, setActivePlaylist] = (0, import_react16.useState)();
2411
- const [activeVideoId, setActiveVideoId] = (0, import_react16.useState)();
2412
- const [showCountDown, setShowCountDown] = (0, import_react16.useState)(false);
2374
+ const [activePlaylist, setActivePlaylist] = (0, import_react15.useState)();
2375
+ const [activeVideoId, setActiveVideoId] = (0, import_react15.useState)();
2376
+ const [showCountDown, setShowCountDown] = (0, import_react15.useState)(false);
2413
2377
  const videoIds = creativeWorkData?.videoIds ?? [];
2414
2378
  const {
2415
2379
  data: videosData,
@@ -2425,8 +2389,8 @@ var CreativeWork = ({
2425
2389
  retry: queryOptions.retry ?? 3,
2426
2390
  retryDelay: queryOptions.retryDelay ?? ((attemptIndex) => Math.min(1e3 * 2 ** attemptIndex, 3e4))
2427
2391
  });
2428
- const [loadingApisState, setLoadingApisState] = (0, import_react16.useState)(true);
2429
- (0, import_react16.useEffect)(() => {
2392
+ const [loadingApisState, setLoadingApisState] = (0, import_react15.useState)(true);
2393
+ (0, import_react15.useEffect)(() => {
2430
2394
  if (videosData !== void 0) {
2431
2395
  setLoadingApisState(false);
2432
2396
  const videosWithPlaylists = videosData.filter(
@@ -2458,7 +2422,7 @@ var CreativeWork = ({
2458
2422
  }
2459
2423
  }, [videosData, creativeWorkData]);
2460
2424
  const { t } = useMessages_default(locale);
2461
- (0, import_react16.useEffect)(() => {
2425
+ (0, import_react15.useEffect)(() => {
2462
2426
  if (events?.onCreativeWorkData && creativeWorkData) {
2463
2427
  events.onCreativeWorkData(creativeWorkData);
2464
2428
  }
@@ -2466,7 +2430,7 @@ var CreativeWork = ({
2466
2430
  setShowCountDown(true);
2467
2431
  }
2468
2432
  }, [creativeWorkData, events]);
2469
- (0, import_react16.useEffect)(() => {
2433
+ (0, import_react15.useEffect)(() => {
2470
2434
  if (events?.onVideoData && activeVideoId && videosData) {
2471
2435
  const activeVideo = videosData.find((video) => video.id === activeVideoId);
2472
2436
  if (activeVideo) {
@@ -2474,9 +2438,9 @@ var CreativeWork = ({
2474
2438
  }
2475
2439
  }
2476
2440
  }, [activeVideoId, videosData, events]);
2477
- const [error, setError] = (0, import_react16.useState)(null);
2441
+ const [error, setError] = (0, import_react15.useState)(null);
2478
2442
  const videosDataError = videosData?.some((video) => !!video.error);
2479
- (0, import_react16.useEffect)(() => {
2443
+ (0, import_react15.useEffect)(() => {
2480
2444
  if (creativeWorkError || videosError || videosDataError) {
2481
2445
  const errorObj = creativeWorkError || videosError || videosData?.find((video) => !!video.error)?.error && new Error(videosData?.find((video) => !!video.error)?.error) || new Error("default");
2482
2446
  setError(errorObj);
@@ -2490,7 +2454,7 @@ var CreativeWork = ({
2490
2454
  if (error) {
2491
2455
  const title = t(error.message)?.length ? t(error.message) : t("DEFAULT_ERROR");
2492
2456
  const description = t(`${error.message}_DESCRIPTION`)?.length ? t(`${error.message}_DESCRIPTION`) : t("DEFAULT_ERROR_DESCRIPTION");
2493
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: (0, import_tailwind_merge5.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "relative w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2457
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: (0, import_tailwind_merge5.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2494
2458
  ErrorScreen,
2495
2459
  {
2496
2460
  title,
@@ -2498,8 +2462,8 @@ var CreativeWork = ({
2498
2462
  }
2499
2463
  ) }) });
2500
2464
  }
2501
- const [loadingPlaylist, setLoadingPlaylist] = (0, import_react16.useState)(true);
2502
- (0, import_react16.useEffect)(() => {
2465
+ const [loadingPlaylist, setLoadingPlaylist] = (0, import_react15.useState)(true);
2466
+ (0, import_react15.useEffect)(() => {
2503
2467
  const creativeWorkLoadedWithNoVideos = !isCreativeWorkLoading && creativeWorkData && creativeWorkData.videoIds && creativeWorkData.videoIds.length === 0;
2504
2468
  const creativeWorkLoadedWithNoData = !isCreativeWorkLoading && creativeWorkData && !creativeWorkData.videoIds;
2505
2469
  const isEventsFinished = !videosIsLoading && videosData && videosData.length > 0 && videosData.every((video) => video.playlists && video.playlists.length === 0);
@@ -2520,10 +2484,10 @@ var CreativeWork = ({
2520
2484
  events
2521
2485
  ]);
2522
2486
  if (isCreativeWorkLoading || videosIsLoading || loadingApisState) {
2523
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: (0, import_tailwind_merge5.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "relative w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Loading, {}) }) });
2487
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: (0, import_tailwind_merge5.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Loading, {}) }) });
2524
2488
  }
2525
2489
  if (showCountDown && creativeWorkData) {
2526
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: (0, import_tailwind_merge5.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "relative w-full h-full bg-base-200 text-base-content flex justify-center items-center flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2490
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: (0, import_tailwind_merge5.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative w-full h-full bg-base-200 text-base-content flex justify-center items-center flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2527
2491
  PreCreativeWork,
2528
2492
  {
2529
2493
  creativeWork: creativeWorkData,
@@ -2536,8 +2500,8 @@ var CreativeWork = ({
2536
2500
  }
2537
2501
  if (activeVideoId && activePlaylist && !loadingPlaylist) {
2538
2502
  const activeVideo = videosData?.find((video) => video.id === activeVideoId);
2539
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: (0, import_tailwind_merge5.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative w-full h-full", children: [
2540
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2503
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: (0, import_tailwind_merge5.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative w-full h-full", children: [
2504
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2541
2505
  Player,
2542
2506
  {
2543
2507
  ...props,
@@ -2549,7 +2513,7 @@ var CreativeWork = ({
2549
2513
  containerClassName: "w-full h-full"
2550
2514
  }
2551
2515
  ),
2552
- !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2516
+ !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2553
2517
  TitleAndDescription2,
2554
2518
  {
2555
2519
  title: creativeWorkData?.title || "",
@@ -2562,7 +2526,7 @@ var CreativeWork = ({
2562
2526
  ] }) });
2563
2527
  }
2564
2528
  if (loadingPlaylist) {
2565
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Loading, {});
2529
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Loading, {});
2566
2530
  }
2567
2531
  return null;
2568
2532
  };
@@ -2575,12 +2539,12 @@ function PreCreativeWork({
2575
2539
  }) {
2576
2540
  const date = new Date(creativeWork.releaseTime);
2577
2541
  const now = /* @__PURE__ */ new Date();
2578
- const [remainingTime, setRemainingTime] = (0, import_react16.useState)(
2542
+ const [remainingTime, setRemainingTime] = (0, import_react15.useState)(
2579
2543
  date.getTime() - now.getTime()
2580
2544
  );
2581
2545
  const shouldBeStarted = remainingTime < 0;
2582
2546
  const { t } = useMessages_default(locale);
2583
- (0, import_react16.useEffect)(() => {
2547
+ (0, import_react15.useEffect)(() => {
2584
2548
  const interval = setInterval(() => {
2585
2549
  if (remainingTime < 0) {
2586
2550
  clearInterval(interval);
@@ -2594,15 +2558,15 @@ function PreCreativeWork({
2594
2558
  }, [date, remainingTime]);
2595
2559
  const renderCountdown = () => {
2596
2560
  if (shouldBeStarted) {
2597
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-base-content text-xl", children: t("EVENT_NOT_STARTED") });
2561
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-base-content text-xl", children: t("EVENT_NOT_STARTED") });
2598
2562
  }
2599
2563
  const seconds = Math.floor(remainingTime / 1e3) % 60;
2600
2564
  const minutes = Math.floor(remainingTime / 1e3 / 60) % 60;
2601
2565
  const hours = Math.floor(remainingTime / 1e3 / 60 / 60) % 24;
2602
2566
  const days = Math.floor(remainingTime / 1e3 / 60 / 60 / 24);
2603
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-flow-col gap-5 text-center auto-cols-max", children: [
2604
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2605
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2567
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "grid grid-flow-col gap-5 text-center auto-cols-max", children: [
2568
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2569
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2606
2570
  "span",
2607
2571
  {
2608
2572
  style: { "--value": days },
@@ -2611,10 +2575,10 @@ function PreCreativeWork({
2611
2575
  children: days?.toString()?.padStart(2, "0")
2612
2576
  }
2613
2577
  ) }),
2614
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("DAYS") })
2578
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("DAYS") })
2615
2579
  ] }),
2616
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2617
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2580
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2581
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2618
2582
  "span",
2619
2583
  {
2620
2584
  style: { "--value": hours },
@@ -2623,10 +2587,10 @@ function PreCreativeWork({
2623
2587
  children: hours?.toString()?.padStart(2, "0")
2624
2588
  }
2625
2589
  ) }),
2626
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("HOURS") })
2590
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("HOURS") })
2627
2591
  ] }),
2628
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2629
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2592
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2593
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2630
2594
  "span",
2631
2595
  {
2632
2596
  style: { "--value": minutes },
@@ -2635,10 +2599,10 @@ function PreCreativeWork({
2635
2599
  children: minutes?.toString()?.padStart(2, "0")
2636
2600
  }
2637
2601
  ) }),
2638
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("MINUTES") })
2602
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("MINUTES") })
2639
2603
  ] }),
2640
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2641
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2604
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
2605
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2642
2606
  "span",
2643
2607
  {
2644
2608
  style: { "--value": seconds },
@@ -2647,12 +2611,12 @@ function PreCreativeWork({
2647
2611
  children: seconds?.toString()?.padStart(2, "0")
2648
2612
  }
2649
2613
  ) }),
2650
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("SECONDS") })
2614
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("SECONDS") })
2651
2615
  ] })
2652
2616
  ] });
2653
2617
  };
2654
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
2655
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2618
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
2619
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2656
2620
  "div",
2657
2621
  {
2658
2622
  className: "relative overflow-hidden md:rounded-2xl bg-base-200 aspect-video text-base-content flex flex-col justify-center items-center w-full h-full bg-cover bg-center bg-no-repeat",
@@ -2660,12 +2624,12 @@ function PreCreativeWork({
2660
2624
  backgroundImage: backgroundImageUrl ? `url(${backgroundImageUrl})` : ""
2661
2625
  },
2662
2626
  children: [
2663
- backgroundImageUrl && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute inset-0 bg-black bg-opacity-40" }),
2664
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "relative z-10", children: renderCountdown() })
2627
+ backgroundImageUrl && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "absolute inset-0 bg-black bg-opacity-40" }),
2628
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative z-10", children: renderCountdown() })
2665
2629
  ]
2666
2630
  }
2667
2631
  ),
2668
- !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2632
+ !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2669
2633
  TitleAndDescription2,
2670
2634
  {
2671
2635
  title: creativeWork.title,
@@ -2683,9 +2647,9 @@ var TitleAndDescription2 = ({
2683
2647
  locale = "en",
2684
2648
  className
2685
2649
  }) => {
2686
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_tailwind_merge5.twMerge)("mt-3 mb-6 m-event-details-ctn px-4 text-left w-full", className), children: [
2687
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-base md:text-xl m-event-title text-base-content font-medium", children: title }),
2688
- releaseTime ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "text-sm md:text-base text-base-content/70 m-event-start-time", children: [
2650
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_tailwind_merge5.twMerge)("mt-3 mb-6 m-event-details-ctn px-4 text-left w-full", className), children: [
2651
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "text-base md:text-xl m-event-title text-base-content font-medium", children: title }),
2652
+ releaseTime ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "text-sm md:text-base text-base-content/70 m-event-start-time", children: [
2689
2653
  new Date(releaseTime || "").toLocaleDateString(locale || "default", {
2690
2654
  month: "long",
2691
2655
  year: "numeric",
@@ -2698,27 +2662,13 @@ var TitleAndDescription2 = ({
2698
2662
  minute: "2-digit"
2699
2663
  })
2700
2664
  ] }) : null,
2701
- description && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-xs md:text-sm text-base-content/60 uppercase", children: description })
2665
+ description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "text-xs md:text-sm text-base-content/60 uppercase", children: description })
2702
2666
  ] });
2703
2667
  };
2704
2668
 
2705
- // src/ClientSideEvent.tsx
2706
- var import_react17 = __toESM(require("react"));
2707
- var import_jsx_runtime10 = require("react/jsx-runtime");
2708
- var ClientSideEvent = (props) => {
2709
- const [isClient, setIsClient] = import_react17.default.useState(false);
2710
- import_react17.default.useEffect(() => {
2711
- setIsClient(true);
2712
- }, []);
2713
- if (!isClient) {
2714
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "md:rounded-2xl overflow-hidden aspect-video", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "relative w-full h-full bg-[#151515] flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-white", children: "Loading..." }) }) });
2715
- }
2716
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Event, { ...props });
2717
- };
2718
-
2719
2669
  // src/QueryProvider.tsx
2720
2670
  var import_react_query4 = require("@tanstack/react-query");
2721
- var import_jsx_runtime11 = require("react/jsx-runtime");
2671
+ var import_jsx_runtime9 = require("react/jsx-runtime");
2722
2672
  var queryClient = new import_react_query4.QueryClient({
2723
2673
  defaultOptions: {
2724
2674
  queries: {
@@ -2732,15 +2682,13 @@ var queryClient = new import_react_query4.QueryClient({
2732
2682
  }
2733
2683
  });
2734
2684
  var QueryProvider = ({ children }) => {
2735
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_query4.QueryClientProvider, { client: queryClient, children });
2685
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_query4.QueryClientProvider, { client: queryClient, children });
2736
2686
  };
2737
2687
 
2738
2688
  // src/index.ts
2739
2689
  var index_default = { Player };
2740
2690
  // Annotate the CommonJS export names for ESM import in node:
2741
2691
  0 && (module.exports = {
2742
- ClientOnlyPlayer,
2743
- ClientSideEvent,
2744
2692
  CreativeWork,
2745
2693
  CreativeWorksSortDirection,
2746
2694
  Event,