@zezosoft/react-player 0.0.4 → 0.0.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.
Files changed (32) hide show
  1. package/dist/VideoPlayer/VideoPlayer.d.ts +4 -39
  2. package/dist/VideoPlayer/_components/ControlsHeader.d.ts +1 -0
  3. package/dist/VideoPlayer/_components/SubtitleOverlay.d.ts +7 -0
  4. package/dist/VideoPlayer/hooks/index.d.ts +7 -0
  5. package/dist/VideoPlayer/hooks/useEpisodes.d.ts +3 -0
  6. package/dist/VideoPlayer/hooks/useIntroSkip.d.ts +5 -0
  7. package/dist/VideoPlayer/hooks/useSubtitleStyling.d.ts +10 -0
  8. package/dist/VideoPlayer/hooks/useSubtitles.d.ts +2 -0
  9. package/dist/VideoPlayer/hooks/useVideoEvents.d.ts +6 -0
  10. package/dist/VideoPlayer/hooks/useVideoSource.d.ts +1 -0
  11. package/dist/VideoPlayer/hooks/useVideoTracking.d.ts +2 -0
  12. package/dist/VideoPlayer/types/VideoPlayerTypes.d.ts +49 -0
  13. package/dist/VideoPlayer/utils/index.d.ts +6 -6
  14. package/dist/components/ui/FullScreenToggle.d.ts +1 -0
  15. package/dist/components/ui/PiPictureInPictureToggle.d.ts +1 -0
  16. package/dist/components/ui/Popover.d.ts +2 -0
  17. package/dist/components/ui/Settings.d.ts +6 -0
  18. package/dist/index.d.ts +3 -0
  19. package/dist/index.js +560 -179
  20. package/dist/store/VideoState.d.ts +1 -73
  21. package/dist/store/index.d.ts +3 -0
  22. package/dist/store/slices/episodesSlice.d.ts +5 -0
  23. package/dist/store/slices/index.d.ts +8 -0
  24. package/dist/store/slices/introSlice.d.ts +5 -0
  25. package/dist/store/slices/subtitlesSlice.d.ts +5 -0
  26. package/dist/store/slices/videoControlsSlice.d.ts +5 -0
  27. package/dist/store/slices/videoPlaybackSlice.d.ts +5 -0
  28. package/dist/store/slices/videoQualitySlice.d.ts +5 -0
  29. package/dist/store/slices/videoRefsSlice.d.ts +5 -0
  30. package/dist/store/slices/videoTimingSlice.d.ts +5 -0
  31. package/dist/store/types/StoreTypes.d.ts +74 -0
  32. package/package.json +7 -6
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { memo, useCallback, useEffect, useRef, useState } from 'react';
3
3
  import { create } from 'zustand';
4
- import { FaCheck, FaGooglePlay } from 'react-icons/fa';
5
4
  import { IoVolumeMuteOutline, IoVolumeHighOutline } from 'react-icons/io5';
6
- import { Settings, Loader } from 'lucide-react';
7
5
  import { IoMdClose } from 'react-icons/io';
6
+ import { Settings as Settings$1, ChevronRight, Check, Loader } from 'lucide-react';
7
+ import { FaGooglePlay } from 'react-icons/fa';
8
8
  import Hls from 'hls.js';
9
9
 
10
10
  function styleInject(css, ref) {
@@ -34,14 +34,17 @@ function styleInject(css, ref) {
34
34
  }
35
35
  }
36
36
 
37
- var css_248z$1 = "/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n :root, :host {\n --font-sans: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\",\n \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\",\n \"Courier New\", monospace;\n --color-green-100: oklch(96.2% 0.044 156.743);\n --color-green-500: oklch(72.3% 0.219 149.579);\n --color-gray-50: oklch(98.5% 0.002 247.839);\n --color-gray-200: oklch(92.8% 0.006 264.531);\n --color-gray-300: oklch(87.2% 0.01 258.338);\n --color-gray-400: oklch(70.7% 0.022 261.325);\n --color-gray-500: oklch(55.1% 0.027 264.364);\n --color-gray-700: oklch(37.3% 0.034 259.733);\n --color-gray-900: oklch(21% 0.034 264.665);\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-base: 1rem;\n --text-base--line-height: calc(1.5 / 1);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --text-xl: 1.25rem;\n --text-xl--line-height: calc(1.75 / 1.25);\n --text-2xl: 1.5rem;\n --text-2xl--line-height: calc(2 / 1.5);\n --text-3xl: 1.875rem;\n --text-3xl--line-height: calc(2.25 / 1.875);\n --font-weight-normal: 400;\n --font-weight-semibold: 600;\n --radius-md: 0.375rem;\n --radius-lg: 0.5rem;\n --radius-xl: 0.75rem;\n --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);\n --animate-spin: spin 1s linear infinite;\n --blur-sm: 8px;\n --blur-md: 12px;\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n --default-font-family: var(--font-sans);\n --default-mono-font-family: var(--font-mono);\n }\n}\n@layer base {\n *, ::after, ::before, ::backdrop, ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html, :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1, h2, h3, h4, h5, h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b, strong {\n font-weight: bolder;\n }\n code, kbd, samp, pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub, sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol, ul, menu {\n list-style: none;\n }\n img, svg, video, canvas, audio, iframe, embed, object {\n display: block;\n vertical-align: middle;\n }\n img, video {\n max-width: 100%;\n height: auto;\n }\n button, input, select, optgroup, textarea, ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n ::-webkit-calendar-picker-indicator {\n line-height: 1;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button, input:where([type=\"button\"], [type=\"reset\"], [type=\"submit\"]), ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=\"until-found\"])) {\n display: none !important;\n }\n}\n@layer utilities {\n .pointer-events-none {\n pointer-events: none;\n }\n .absolute {\n position: absolute;\n }\n .relative {\n position: relative;\n }\n .inset-0 {\n inset: calc(var(--spacing) * 0);\n }\n .-top-2 {\n top: calc(var(--spacing) * -2);\n }\n .top-0 {\n top: calc(var(--spacing) * 0);\n }\n .top-1\\/2 {\n top: calc(1/2 * 100%);\n }\n .top-full {\n top: 100%;\n }\n .right-32 {\n right: calc(var(--spacing) * 32);\n }\n .right-full {\n right: 100%;\n }\n .bottom-36 {\n bottom: calc(var(--spacing) * 36);\n }\n .bottom-full {\n bottom: 100%;\n }\n .left-0 {\n left: calc(var(--spacing) * 0);\n }\n .left-1\\/2 {\n left: calc(1/2 * 100%);\n }\n .left-4 {\n left: calc(var(--spacing) * 4);\n }\n .left-32 {\n left: calc(var(--spacing) * 32);\n }\n .left-full {\n left: 100%;\n }\n .z-50 {\n z-index: 50;\n }\n .z-\\[-1\\] {\n z-index: -1;\n }\n .mx-2 {\n margin-inline: calc(var(--spacing) * 2);\n }\n .mx-auto {\n margin-inline: auto;\n }\n .mt-2 {\n margin-top: calc(var(--spacing) * 2);\n }\n .mr-2 {\n margin-right: calc(var(--spacing) * 2);\n }\n .mb-1 {\n margin-bottom: calc(var(--spacing) * 1);\n }\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2);\n }\n .ml-2 {\n margin-left: calc(var(--spacing) * 2);\n }\n .block {\n display: block;\n }\n .flex {\n display: flex;\n }\n .inline {\n display: inline;\n }\n .inline-block {\n display: inline-block;\n }\n .h-3 {\n height: calc(var(--spacing) * 3);\n }\n .h-5 {\n height: calc(var(--spacing) * 5);\n }\n .h-10 {\n height: calc(var(--spacing) * 10);\n }\n .h-14 {\n height: calc(var(--spacing) * 14);\n }\n .h-24 {\n height: calc(var(--spacing) * 24);\n }\n .h-full {\n height: 100%;\n }\n .w-3 {\n width: calc(var(--spacing) * 3);\n }\n .w-5 {\n width: calc(var(--spacing) * 5);\n }\n .w-14 {\n width: calc(var(--spacing) * 14);\n }\n .w-24 {\n width: calc(var(--spacing) * 24);\n }\n .w-56 {\n width: calc(var(--spacing) * 56);\n }\n .w-\\[2px\\] {\n width: 2px;\n }\n .w-\\[10vw\\] {\n width: 10vw;\n }\n .w-\\[15vw\\] {\n width: 15vw;\n }\n .w-\\[720px\\] {\n width: 720px;\n }\n .w-fit {\n width: fit-content;\n }\n .w-full {\n width: 100%;\n }\n .-translate-x-1\\/2 {\n --tw-translate-x: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .-translate-y-1\\/2 {\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .rotate-45 {\n rotate: 45deg;\n }\n .transform {\n transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);\n }\n .animate-spin {\n animation: var(--animate-spin);\n }\n .cursor-not-allowed {\n cursor: not-allowed;\n }\n .cursor-pointer {\n cursor: pointer;\n }\n .flex-col {\n flex-direction: column;\n }\n .items-center {\n align-items: center;\n }\n .justify-between {\n justify-content: space-between;\n }\n .justify-center {\n justify-content: center;\n }\n .gap-1 {\n gap: calc(var(--spacing) * 1);\n }\n .gap-2 {\n gap: calc(var(--spacing) * 2);\n }\n .gap-4 {\n gap: calc(var(--spacing) * 4);\n }\n .gap-7 {\n gap: calc(var(--spacing) * 7);\n }\n .rounded-lg {\n border-radius: var(--radius-lg);\n }\n .rounded-md {\n border-radius: var(--radius-md);\n }\n .rounded-xl {\n border-radius: var(--radius-xl);\n }\n .border {\n border-style: var(--tw-border-style);\n border-width: 1px;\n }\n .border-t {\n border-top-style: var(--tw-border-style);\n border-top-width: 1px;\n }\n .border-l {\n border-left-style: var(--tw-border-style);\n border-left-width: 1px;\n }\n .border-gray-200 {\n border-color: var(--color-gray-200);\n }\n .bg-\\[rgba\\(0\\,0\\,0\\,0\\.5\\)\\] {\n background-color: rgba(0,0,0,0.5);\n }\n .bg-gray-500 {\n background-color: var(--color-gray-500);\n }\n .bg-gray-900 {\n background-color: var(--color-gray-900);\n }\n .bg-green-100 {\n background-color: var(--color-green-100);\n }\n .bg-white {\n background-color: var(--color-white);\n }\n .bg-white\\/80 {\n background-color: color-mix(in srgb, #fff 80%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-white) 80%, transparent);\n }\n }\n .bg-white\\/90 {\n background-color: color-mix(in srgb, #fff 90%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-white) 90%, transparent);\n }\n }\n .bg-gradient-to-b {\n --tw-gradient-position: to bottom in oklab;\n background-image: linear-gradient(var(--tw-gradient-stops));\n }\n .from-black {\n --tw-gradient-from: var(--color-black);\n --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));\n }\n .p-2 {\n padding: calc(var(--spacing) * 2);\n }\n .p-4 {\n padding: calc(var(--spacing) * 4);\n }\n .p-10 {\n padding: calc(var(--spacing) * 10);\n }\n .px-3 {\n padding-inline: calc(var(--spacing) * 3);\n }\n .px-6 {\n padding-inline: calc(var(--spacing) * 6);\n }\n .px-10 {\n padding-inline: calc(var(--spacing) * 10);\n }\n .py-1 {\n padding-block: calc(var(--spacing) * 1);\n }\n .py-2 {\n padding-block: calc(var(--spacing) * 2);\n }\n .pt-6 {\n padding-top: calc(var(--spacing) * 6);\n }\n .pb-10 {\n padding-bottom: calc(var(--spacing) * 10);\n }\n .pb-16 {\n padding-bottom: calc(var(--spacing) * 16);\n }\n .text-lg {\n font-size: var(--text-lg);\n line-height: var(--tw-leading, var(--text-lg--line-height));\n }\n .text-sm {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n .font-normal {\n --tw-font-weight: var(--font-weight-normal);\n font-weight: var(--font-weight-normal);\n }\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold);\n font-weight: var(--font-weight-semibold);\n }\n .text-black {\n color: var(--color-black);\n }\n .text-gray-200 {\n color: var(--color-gray-200);\n }\n .text-gray-400 {\n color: var(--color-gray-400);\n }\n .text-gray-500 {\n color: var(--color-gray-500);\n }\n .text-gray-700 {\n color: var(--color-gray-700);\n }\n .text-gray-900 {\n color: var(--color-gray-900);\n }\n .text-green-500 {\n color: var(--color-green-500);\n }\n .text-white {\n color: var(--color-white);\n }\n .opacity-50 {\n opacity: 50%;\n }\n .shadow-lg {\n --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .shadow-md {\n --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .shadow-xl {\n --tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 8px 10px -6px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .backdrop-blur-md {\n --tw-backdrop-blur: blur(var(--blur-md));\n -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n }\n .backdrop-blur-sm {\n --tw-backdrop-blur: blur(var(--blur-sm));\n -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n }\n .transition {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, visibility, content-visibility, overlay, pointer-events;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-all {\n transition-property: all;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-colors {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-opacity {\n transition-property: opacity;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .duration-200 {\n --tw-duration: 200ms;\n transition-duration: 200ms;\n }\n .ease-in-out {\n --tw-ease: var(--ease-in-out);\n transition-timing-function: var(--ease-in-out);\n }\n .hover\\:bg-gray-200 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--color-gray-200);\n }\n }\n }\n .hover\\:bg-gray-300 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--color-gray-300);\n }\n }\n }\n .hover\\:bg-white\\/90 {\n &:hover {\n @media (hover: hover) {\n background-color: color-mix(in srgb, #fff 90%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-white) 90%, transparent);\n }\n }\n }\n }\n .hover\\:text-gray-200 {\n &:hover {\n @media (hover: hover) {\n color: var(--color-gray-200);\n }\n }\n }\n .focus\\:ring-2 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n }\n .focus\\:ring-gray-400 {\n &:focus {\n --tw-ring-color: var(--color-gray-400);\n }\n }\n .focus\\:ring-offset-1 {\n &:focus {\n --tw-ring-offset-width: 1px;\n --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n }\n }\n .focus\\:outline-none {\n &:focus {\n --tw-outline-style: none;\n outline-style: none;\n }\n }\n .disabled\\:cursor-not-allowed {\n &:disabled {\n cursor: not-allowed;\n }\n }\n .disabled\\:bg-white\\/50 {\n &:disabled {\n background-color: color-mix(in srgb, #fff 50%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-white) 50%, transparent);\n }\n }\n }\n .disabled\\:opacity-50 {\n &:disabled {\n opacity: 50%;\n }\n }\n .lg\\:h-7 {\n @media (width >= 64rem) {\n height: calc(var(--spacing) * 7);\n }\n }\n .lg\\:h-8 {\n @media (width >= 64rem) {\n height: calc(var(--spacing) * 8);\n }\n }\n .lg\\:h-18 {\n @media (width >= 64rem) {\n height: calc(var(--spacing) * 18);\n }\n }\n .lg\\:h-32 {\n @media (width >= 64rem) {\n height: calc(var(--spacing) * 32);\n }\n }\n .lg\\:w-7 {\n @media (width >= 64rem) {\n width: calc(var(--spacing) * 7);\n }\n }\n .lg\\:w-8 {\n @media (width >= 64rem) {\n width: calc(var(--spacing) * 8);\n }\n }\n .lg\\:w-18 {\n @media (width >= 64rem) {\n width: calc(var(--spacing) * 18);\n }\n }\n .lg\\:w-32 {\n @media (width >= 64rem) {\n width: calc(var(--spacing) * 32);\n }\n }\n .lg\\:pb-12 {\n @media (width >= 64rem) {\n padding-bottom: calc(var(--spacing) * 12);\n }\n }\n .lg\\:text-2xl {\n @media (width >= 64rem) {\n font-size: var(--text-2xl);\n line-height: var(--tw-leading, var(--text-2xl--line-height));\n }\n }\n .lg\\:text-3xl {\n @media (width >= 64rem) {\n font-size: var(--text-3xl);\n line-height: var(--tw-leading, var(--text-3xl--line-height));\n }\n }\n .lg\\:text-base {\n @media (width >= 64rem) {\n font-size: var(--text-base);\n line-height: var(--tw-leading, var(--text-base--line-height));\n }\n }\n .\\[\\&\\:\\:cue\\]\\:absolute {\n &::cue {\n position: absolute;\n }\n }\n .\\[\\&\\:\\:cue\\]\\:top-\\[6\\%\\] {\n &::cue {\n top: 6%;\n }\n }\n .\\[\\&\\:\\:cue\\]\\:rounded-md {\n &::cue {\n border-radius: var(--radius-md);\n }\n }\n .\\[\\&\\:\\:cue\\]\\:bg-gray-50 {\n &::cue {\n background-color: var(--color-gray-50);\n }\n }\n .\\[\\&\\:\\:cue\\]\\:px-2 {\n &::cue {\n padding-inline: calc(var(--spacing) * 2);\n }\n }\n .\\[\\&\\:\\:cue\\]\\:py-1 {\n &::cue {\n padding-block: calc(var(--spacing) * 1);\n }\n }\n .\\[\\&\\:\\:cue\\]\\:text-xl {\n &::cue {\n font-size: var(--text-xl);\n line-height: var(--tw-leading, var(--text-xl--line-height));\n }\n }\n .\\[\\&\\:\\:cue\\]\\:text-\\[\\#1E1E1E\\] {\n &::cue {\n color: #1E1E1E;\n }\n }\n}\n.noCursor {\n cursor: none !important;\n}\n@property --tw-translate-x {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-y {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-z {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-rotate-x {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-rotate-y {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-rotate-z {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-skew-x {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-skew-y {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-border-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-gradient-position {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-gradient-from {\n syntax: \"<color>\";\n inherits: false;\n initial-value: #0000;\n}\n@property --tw-gradient-via {\n syntax: \"<color>\";\n inherits: false;\n initial-value: #0000;\n}\n@property --tw-gradient-to {\n syntax: \"<color>\";\n inherits: false;\n initial-value: #0000;\n}\n@property --tw-gradient-stops {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-gradient-via-stops {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-gradient-from-position {\n syntax: \"<length-percentage>\";\n inherits: false;\n initial-value: 0%;\n}\n@property --tw-gradient-via-position {\n syntax: \"<length-percentage>\";\n inherits: false;\n initial-value: 50%;\n}\n@property --tw-gradient-to-position {\n syntax: \"<length-percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-font-weight {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-inset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-ring-inset {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-offset-width {\n syntax: \"<length>\";\n inherits: false;\n initial-value: 0px;\n}\n@property --tw-ring-offset-color {\n syntax: \"*\";\n inherits: false;\n initial-value: #fff;\n}\n@property --tw-ring-offset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-backdrop-blur {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-brightness {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-contrast {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-grayscale {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-hue-rotate {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-invert {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-opacity {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-saturate {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-sepia {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-duration {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ease {\n syntax: \"*\";\n inherits: false;\n}\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *, ::before, ::after, ::backdrop {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-rotate-x: initial;\n --tw-rotate-y: initial;\n --tw-rotate-z: initial;\n --tw-skew-x: initial;\n --tw-skew-y: initial;\n --tw-border-style: solid;\n --tw-gradient-position: initial;\n --tw-gradient-from: #0000;\n --tw-gradient-via: #0000;\n --tw-gradient-to: #0000;\n --tw-gradient-stops: initial;\n --tw-gradient-via-stops: initial;\n --tw-gradient-from-position: 0%;\n --tw-gradient-via-position: 50%;\n --tw-gradient-to-position: 100%;\n --tw-font-weight: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-backdrop-blur: initial;\n --tw-backdrop-brightness: initial;\n --tw-backdrop-contrast: initial;\n --tw-backdrop-grayscale: initial;\n --tw-backdrop-hue-rotate: initial;\n --tw-backdrop-invert: initial;\n --tw-backdrop-opacity: initial;\n --tw-backdrop-saturate: initial;\n --tw-backdrop-sepia: initial;\n --tw-duration: initial;\n --tw-ease: initial;\n }\n }\n}";
38
- styleInject(css_248z$1,{"insertAt":"top"});
37
+ var css_248z$3 = "/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n :root, :host {\n --font-sans: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\",\n \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\",\n \"Courier New\", monospace;\n --color-green-500: oklch(72.3% 0.219 149.579);\n --color-blue-500: oklch(62.3% 0.214 259.815);\n --color-purple-500: oklch(62.7% 0.265 303.9);\n --color-gray-200: oklch(92.8% 0.006 264.531);\n --color-gray-300: oklch(87.2% 0.01 258.338);\n --color-gray-400: oklch(70.7% 0.022 261.325);\n --color-gray-500: oklch(55.1% 0.027 264.364);\n --color-gray-600: oklch(44.6% 0.03 256.802);\n --color-gray-900: oklch(21% 0.034 264.665);\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-base: 1rem;\n --text-base--line-height: calc(1.5 / 1);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --text-xl: 1.25rem;\n --text-xl--line-height: calc(1.75 / 1.25);\n --text-2xl: 1.5rem;\n --text-2xl--line-height: calc(2 / 1.5);\n --text-3xl: 1.875rem;\n --text-3xl--line-height: calc(2.25 / 1.875);\n --font-weight-normal: 400;\n --font-weight-semibold: 600;\n --font-weight-bold: 700;\n --radius-md: 0.375rem;\n --radius-lg: 0.5rem;\n --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);\n --animate-spin: spin 1s linear infinite;\n --blur-sm: 8px;\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n --default-font-family: var(--font-sans);\n --default-mono-font-family: var(--font-mono);\n }\n}\n@layer base {\n *, ::after, ::before, ::backdrop, ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html, :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1, h2, h3, h4, h5, h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b, strong {\n font-weight: bolder;\n }\n code, kbd, samp, pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub, sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol, ul, menu {\n list-style: none;\n }\n img, svg, video, canvas, audio, iframe, embed, object {\n display: block;\n vertical-align: middle;\n }\n img, video {\n max-width: 100%;\n height: auto;\n }\n button, input, select, optgroup, textarea, ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n ::-webkit-calendar-picker-indicator {\n line-height: 1;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button, input:where([type=\"button\"], [type=\"reset\"], [type=\"submit\"]), ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=\"until-found\"])) {\n display: none !important;\n }\n}\n@layer utilities {\n .pointer-events-none {\n pointer-events: none;\n }\n .visible {\n visibility: visible;\n }\n .absolute {\n position: absolute;\n }\n .relative {\n position: relative;\n }\n .inset-0 {\n inset: calc(var(--spacing) * 0);\n }\n .-top-2 {\n top: calc(var(--spacing) * -2);\n }\n .top-0 {\n top: calc(var(--spacing) * 0);\n }\n .top-1\\/2 {\n top: calc(1/2 * 100%);\n }\n .top-full {\n top: 100%;\n }\n .right-0 {\n right: calc(var(--spacing) * 0);\n }\n .right-32 {\n right: calc(var(--spacing) * 32);\n }\n .right-full {\n right: 100%;\n }\n .bottom-36 {\n bottom: calc(var(--spacing) * 36);\n }\n .bottom-full {\n bottom: 100%;\n }\n .left-0 {\n left: calc(var(--spacing) * 0);\n }\n .left-1\\/2 {\n left: calc(1/2 * 100%);\n }\n .left-32 {\n left: calc(var(--spacing) * 32);\n }\n .left-full {\n left: 100%;\n }\n .z-50 {\n z-index: 50;\n }\n .z-\\[-1\\] {\n z-index: -1;\n }\n .mx-2 {\n margin-inline: calc(var(--spacing) * 2);\n }\n .mx-auto {\n margin-inline: auto;\n }\n .mt-1 {\n margin-top: calc(var(--spacing) * 1);\n }\n .mt-2 {\n margin-top: calc(var(--spacing) * 2);\n }\n .mr-2 {\n margin-right: calc(var(--spacing) * 2);\n }\n .mb-1 {\n margin-bottom: calc(var(--spacing) * 1);\n }\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2);\n }\n .mb-4 {\n margin-bottom: calc(var(--spacing) * 4);\n }\n .ml-2 {\n margin-left: calc(var(--spacing) * 2);\n }\n .block {\n display: block;\n }\n .flex {\n display: flex;\n }\n .hidden {\n display: none;\n }\n .inline {\n display: inline;\n }\n .inline-block {\n display: inline-block;\n }\n .h-3 {\n height: calc(var(--spacing) * 3);\n }\n .h-5 {\n height: calc(var(--spacing) * 5);\n }\n .h-6 {\n height: calc(var(--spacing) * 6);\n }\n .h-10 {\n height: calc(var(--spacing) * 10);\n }\n .h-24 {\n height: calc(var(--spacing) * 24);\n }\n .h-full {\n height: 100%;\n }\n .max-h-80 {\n max-height: calc(var(--spacing) * 80);\n }\n .w-3 {\n width: calc(var(--spacing) * 3);\n }\n .w-5 {\n width: calc(var(--spacing) * 5);\n }\n .w-6 {\n width: calc(var(--spacing) * 6);\n }\n .w-24 {\n width: calc(var(--spacing) * 24);\n }\n .w-80 {\n width: calc(var(--spacing) * 80);\n }\n .w-\\[2px\\] {\n width: 2px;\n }\n .w-\\[10vw\\] {\n width: 10vw;\n }\n .w-\\[15vw\\] {\n width: 15vw;\n }\n .w-\\[720px\\] {\n width: 720px;\n }\n .w-fit {\n width: fit-content;\n }\n .w-full {\n width: 100%;\n }\n .-translate-x-1\\/2 {\n --tw-translate-x: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .-translate-y-1\\/2 {\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .rotate-45 {\n rotate: 45deg;\n }\n .rotate-180 {\n rotate: 180deg;\n }\n .transform {\n transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);\n }\n .animate-spin {\n animation: var(--animate-spin);\n }\n .cursor-not-allowed {\n cursor: not-allowed;\n }\n .cursor-pointer {\n cursor: pointer;\n }\n .flex-col {\n flex-direction: column;\n }\n .items-center {\n align-items: center;\n }\n .items-start {\n align-items: flex-start;\n }\n .justify-between {\n justify-content: space-between;\n }\n .justify-center {\n justify-content: center;\n }\n .gap-3 {\n gap: calc(var(--spacing) * 3);\n }\n .gap-4 {\n gap: calc(var(--spacing) * 4);\n }\n .gap-7 {\n gap: calc(var(--spacing) * 7);\n }\n .space-y-0 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0;\n margin-block-start: calc(calc(var(--spacing) * 0) * var(--tw-space-y-reverse));\n margin-block-end: calc(calc(var(--spacing) * 0) * calc(1 - var(--tw-space-y-reverse)));\n }\n }\n .space-y-3 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0;\n margin-block-start: calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));\n margin-block-end: calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)));\n }\n }\n .overflow-hidden {\n overflow: hidden;\n }\n .overflow-y-auto {\n overflow-y: auto;\n }\n .rounded {\n border-radius: 0.25rem;\n }\n .rounded-\\[5px\\] {\n border-radius: 5px;\n }\n .rounded-\\[7px\\] {\n border-radius: 7px;\n }\n .rounded-lg {\n border-radius: var(--radius-lg);\n }\n .rounded-md {\n border-radius: var(--radius-md);\n }\n .border {\n border-style: var(--tw-border-style);\n border-width: 1px;\n }\n .border-t {\n border-top-style: var(--tw-border-style);\n border-top-width: 1px;\n }\n .border-b {\n border-bottom-style: var(--tw-border-style);\n border-bottom-width: 1px;\n }\n .border-l {\n border-left-style: var(--tw-border-style);\n border-left-width: 1px;\n }\n .border-gray-600 {\n border-color: var(--color-gray-600);\n }\n .border-white\\/10 {\n border-color: color-mix(in srgb, #fff 10%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n border-color: color-mix(in oklab, var(--color-white) 10%, transparent);\n }\n }\n .bg-\\[\\#3a4049\\] {\n background-color: #3a4049;\n }\n .bg-\\[\\#454545\\] {\n background-color: #454545;\n }\n .bg-\\[rgba\\(0\\,0\\,0\\,0\\.5\\)\\] {\n background-color: rgba(0,0,0,0.5);\n }\n .bg-blue-500 {\n background-color: var(--color-blue-500);\n }\n .bg-gray-500 {\n background-color: var(--color-gray-500);\n }\n .bg-gray-900 {\n background-color: var(--color-gray-900);\n }\n .bg-green-500 {\n background-color: var(--color-green-500);\n }\n .bg-purple-500 {\n background-color: var(--color-purple-500);\n }\n .bg-white\\/10 {\n background-color: color-mix(in srgb, #fff 10%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-white) 10%, transparent);\n }\n }\n .bg-white\\/80 {\n background-color: color-mix(in srgb, #fff 80%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-white) 80%, transparent);\n }\n }\n .bg-gradient-to-b {\n --tw-gradient-position: to bottom in oklab;\n background-image: linear-gradient(var(--tw-gradient-stops));\n }\n .from-black {\n --tw-gradient-from: var(--color-black);\n --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));\n }\n .bg-cover {\n background-size: cover;\n }\n .bg-center {\n background-position: center;\n }\n .p-0 {\n padding: calc(var(--spacing) * 0);\n }\n .p-1 {\n padding: calc(var(--spacing) * 1);\n }\n .p-2 {\n padding: calc(var(--spacing) * 2);\n }\n .p-4 {\n padding: calc(var(--spacing) * 4);\n }\n .p-10 {\n padding: calc(var(--spacing) * 10);\n }\n .px-3 {\n padding-inline: calc(var(--spacing) * 3);\n }\n .px-4 {\n padding-inline: calc(var(--spacing) * 4);\n }\n .px-6 {\n padding-inline: calc(var(--spacing) * 6);\n }\n .px-10 {\n padding-inline: calc(var(--spacing) * 10);\n }\n .px-20 {\n padding-inline: calc(var(--spacing) * 20);\n }\n .py-1 {\n padding-block: calc(var(--spacing) * 1);\n }\n .py-2 {\n padding-block: calc(var(--spacing) * 2);\n }\n .py-3 {\n padding-block: calc(var(--spacing) * 3);\n }\n .py-4 {\n padding-block: calc(var(--spacing) * 4);\n }\n .pt-6 {\n padding-top: calc(var(--spacing) * 6);\n }\n .pb-10 {\n padding-bottom: calc(var(--spacing) * 10);\n }\n .pb-16 {\n padding-bottom: calc(var(--spacing) * 16);\n }\n .text-left {\n text-align: left;\n }\n .text-lg {\n font-size: var(--text-lg);\n line-height: var(--tw-leading, var(--text-lg--line-height));\n }\n .text-sm {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n .text-xl {\n font-size: var(--text-xl);\n line-height: var(--tw-leading, var(--text-xl--line-height));\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold);\n font-weight: var(--font-weight-bold);\n }\n .font-normal {\n --tw-font-weight: var(--font-weight-normal);\n font-weight: var(--font-weight-normal);\n }\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold);\n font-weight: var(--font-weight-semibold);\n }\n .text-black {\n color: var(--color-black);\n }\n .text-gray-200 {\n color: var(--color-gray-200);\n }\n .text-gray-300 {\n color: var(--color-gray-300);\n }\n .text-gray-400 {\n color: var(--color-gray-400);\n }\n .text-gray-500 {\n color: var(--color-gray-500);\n }\n .text-gray-900 {\n color: var(--color-gray-900);\n }\n .text-white {\n color: var(--color-white);\n }\n .opacity-50 {\n opacity: 50%;\n }\n .shadow-2xl {\n --tw-shadow: 0 25px 50px -12px var(--tw-shadow-color, rgb(0 0 0 / 0.25));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .shadow-md {\n --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .backdrop-blur-sm {\n --tw-backdrop-blur: blur(var(--blur-sm));\n -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n }\n .transition {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, visibility, content-visibility, overlay, pointer-events;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-all {\n transition-property: all;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-colors {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-opacity {\n transition-property: opacity;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .duration-200 {\n --tw-duration: 200ms;\n transition-duration: 200ms;\n }\n .ease-in-out {\n --tw-ease: var(--ease-in-out);\n transition-timing-function: var(--ease-in-out);\n }\n .hover\\:bg-gray-300 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--color-gray-300);\n }\n }\n }\n .hover\\:bg-white\\/5 {\n &:hover {\n @media (hover: hover) {\n background-color: color-mix(in srgb, #fff 5%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-white) 5%, transparent);\n }\n }\n }\n }\n .hover\\:bg-white\\/10 {\n &:hover {\n @media (hover: hover) {\n background-color: color-mix(in srgb, #fff 10%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-white) 10%, transparent);\n }\n }\n }\n }\n .hover\\:bg-white\\/90 {\n &:hover {\n @media (hover: hover) {\n background-color: color-mix(in srgb, #fff 90%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-white) 90%, transparent);\n }\n }\n }\n }\n .hover\\:text-gray-200 {\n &:hover {\n @media (hover: hover) {\n color: var(--color-gray-200);\n }\n }\n }\n .focus\\:ring-2 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n }\n .focus\\:ring-gray-400 {\n &:focus {\n --tw-ring-color: var(--color-gray-400);\n }\n }\n .focus\\:ring-offset-1 {\n &:focus {\n --tw-ring-offset-width: 1px;\n --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n }\n }\n .focus\\:outline-none {\n &:focus {\n --tw-outline-style: none;\n outline-style: none;\n }\n }\n .disabled\\:cursor-not-allowed {\n &:disabled {\n cursor: not-allowed;\n }\n }\n .disabled\\:bg-white\\/50 {\n &:disabled {\n background-color: color-mix(in srgb, #fff 50%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-white) 50%, transparent);\n }\n }\n }\n .disabled\\:opacity-50 {\n &:disabled {\n opacity: 50%;\n }\n }\n .lg\\:h-32 {\n @media (width >= 64rem) {\n height: calc(var(--spacing) * 32);\n }\n }\n .lg\\:w-32 {\n @media (width >= 64rem) {\n width: calc(var(--spacing) * 32);\n }\n }\n .lg\\:pb-12 {\n @media (width >= 64rem) {\n padding-bottom: calc(var(--spacing) * 12);\n }\n }\n .lg\\:text-2xl {\n @media (width >= 64rem) {\n font-size: var(--text-2xl);\n line-height: var(--tw-leading, var(--text-2xl--line-height));\n }\n }\n .lg\\:text-3xl {\n @media (width >= 64rem) {\n font-size: var(--text-3xl);\n line-height: var(--tw-leading, var(--text-3xl--line-height));\n }\n }\n .lg\\:text-base {\n @media (width >= 64rem) {\n font-size: var(--text-base);\n line-height: var(--tw-leading, var(--text-base--line-height));\n }\n }\n}\n.noCursor {\n cursor: none !important;\n}\n.icon-class {\n height: calc(var(--spacing) * 14);\n width: calc(var(--spacing) * 14);\n cursor: pointer;\n color: var(--color-gray-400);\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n --tw-duration: 200ms;\n transition-duration: 200ms;\n &:hover {\n @media (hover: hover) {\n color: var(--color-gray-200);\n }\n }\n @media (width >= 64rem) {\n height: calc(var(--spacing) * 18);\n }\n @media (width >= 64rem) {\n width: calc(var(--spacing) * 18);\n }\n}\n@property --tw-translate-x {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-y {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-z {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-rotate-x {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-rotate-y {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-rotate-z {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-skew-x {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-skew-y {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-space-y-reverse {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-border-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-gradient-position {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-gradient-from {\n syntax: \"<color>\";\n inherits: false;\n initial-value: #0000;\n}\n@property --tw-gradient-via {\n syntax: \"<color>\";\n inherits: false;\n initial-value: #0000;\n}\n@property --tw-gradient-to {\n syntax: \"<color>\";\n inherits: false;\n initial-value: #0000;\n}\n@property --tw-gradient-stops {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-gradient-via-stops {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-gradient-from-position {\n syntax: \"<length-percentage>\";\n inherits: false;\n initial-value: 0%;\n}\n@property --tw-gradient-via-position {\n syntax: \"<length-percentage>\";\n inherits: false;\n initial-value: 50%;\n}\n@property --tw-gradient-to-position {\n syntax: \"<length-percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-font-weight {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-inset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-ring-inset {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-offset-width {\n syntax: \"<length>\";\n inherits: false;\n initial-value: 0px;\n}\n@property --tw-ring-offset-color {\n syntax: \"*\";\n inherits: false;\n initial-value: #fff;\n}\n@property --tw-ring-offset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-backdrop-blur {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-brightness {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-contrast {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-grayscale {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-hue-rotate {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-invert {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-opacity {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-saturate {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-sepia {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-duration {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ease {\n syntax: \"*\";\n inherits: false;\n}\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *, ::before, ::after, ::backdrop {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-rotate-x: initial;\n --tw-rotate-y: initial;\n --tw-rotate-z: initial;\n --tw-skew-x: initial;\n --tw-skew-y: initial;\n --tw-space-y-reverse: 0;\n --tw-border-style: solid;\n --tw-gradient-position: initial;\n --tw-gradient-from: #0000;\n --tw-gradient-via: #0000;\n --tw-gradient-to: #0000;\n --tw-gradient-stops: initial;\n --tw-gradient-via-stops: initial;\n --tw-gradient-from-position: 0%;\n --tw-gradient-via-position: 50%;\n --tw-gradient-to-position: 100%;\n --tw-font-weight: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-backdrop-blur: initial;\n --tw-backdrop-brightness: initial;\n --tw-backdrop-contrast: initial;\n --tw-backdrop-grayscale: initial;\n --tw-backdrop-hue-rotate: initial;\n --tw-backdrop-invert: initial;\n --tw-backdrop-opacity: initial;\n --tw-backdrop-saturate: initial;\n --tw-backdrop-sepia: initial;\n --tw-duration: initial;\n --tw-ease: initial;\n }\n }\n}\n";
38
+ styleInject(css_248z$3,{"insertAt":"top"});
39
39
 
40
- const useVideoStore = create((set) => ({
40
+ const createVideoRefsSlice = (set) => ({
41
41
  videoRef: null,
42
42
  setVideoRef: (ref) => set({ videoRef: ref }),
43
43
  videoWrapperRef: null,
44
44
  setVideoWrapperRef: (ref) => set({ videoWrapperRef: ref }),
45
+ });
46
+
47
+ const createVideoPlaybackSlice = (set) => ({
45
48
  playing: false,
46
49
  setPlaying: (playing) => set({ playing }),
47
50
  isBuffering: false,
@@ -52,29 +55,39 @@ const useVideoStore = create((set) => ({
52
55
  setMuted: (muted) => set({ muted }),
53
56
  volume: 1,
54
57
  setVolume: (volume) => set({ volume }),
55
- controls: false,
56
- setControls: (controls) => set({ controls }),
58
+ });
59
+
60
+ const createVideoTimingSlice = (set) => ({
57
61
  currentTime: 0,
58
62
  setCurrentTime: (currentTime) => set({ currentTime }),
59
63
  duration: 0,
60
64
  setDuration: (duration) => set({ duration }),
65
+ });
66
+
67
+ const createVideoControlsSlice = (set) => ({
68
+ controls: false,
69
+ setControls: (controls) => set({ controls }),
61
70
  isFullscreen: false,
62
71
  setIsFullscreen: (isFullscreen) => set({ isFullscreen }),
72
+ });
73
+
74
+ const createVideoQualitySlice = (set) => ({
63
75
  hlsInstance: undefined,
64
76
  setHlsInstance: (hlsInstance) => set({ hlsInstance }),
65
77
  qualityLevels: undefined,
66
78
  setQualityLevels: (qualityLevels) => set({ qualityLevels }),
67
79
  activeQuality: "auto",
68
80
  setActiveQuality: (activeQuality) => set({ activeQuality }),
81
+ });
82
+
83
+ const createSubtitlesSlice = (set) => ({
69
84
  activeSubtitle: null,
70
85
  setActiveSubtitle: (subtitle) => set({ activeSubtitle: subtitle }),
71
86
  subtitles: [],
72
87
  setSubtitles: (subtitles) => set({ subtitles }),
73
- showIntroSkip: false,
74
- setShowIntroSkip: (show) => set({ showIntroSkip: show }),
75
- autoPlayNext: false,
76
- setAutoPlayNext: (value) => set({ autoPlayNext: value }),
77
- // Next Episode
88
+ });
89
+
90
+ const createEpisodesSlice = (set) => ({
78
91
  episodeList: [],
79
92
  setEpisodeList: (list) => set({ episodeList: list }),
80
93
  currentEpisodeIndex: 0,
@@ -83,10 +96,34 @@ const useVideoStore = create((set) => ({
83
96
  setShowCountdown: (show) => set({ showCountdown: show }),
84
97
  countdownTime: 10,
85
98
  setCountdownTime: (time) => set({ countdownTime: time }),
99
+ autoPlayNext: false,
100
+ setAutoPlayNext: (value) => set({ autoPlayNext: value }),
101
+ });
102
+
103
+ const createIntroSlice = (set) => ({
104
+ showIntroSkip: false,
105
+ setShowIntroSkip: (show) => set({ showIntroSkip: show }),
106
+ });
107
+
108
+ const useVideoStore = create()((...a) => ({
109
+ ...createVideoRefsSlice(...a),
110
+ ...createVideoPlaybackSlice(...a),
111
+ ...createVideoTimingSlice(...a),
112
+ ...createVideoControlsSlice(...a),
113
+ ...createVideoQualitySlice(...a),
114
+ ...createSubtitlesSlice(...a),
115
+ ...createEpisodesSlice(...a),
116
+ ...createIntroSlice(...a),
86
117
  }));
118
+ // Previous version before recent edits code changes in panding
119
+ // ...createVideoRefsSlice(...a),
120
+ // ...createVideoPlaybackSlice(...a),
121
+ // ...createVideoTimingSlice(...a),
122
+ // ...createEpisodesSlice(...a),
123
+ // ...createIntroSlice(...a),
87
124
 
88
125
  /**
89
- * @description Converts seconds to hh:mm:ss
126
+ * @description
90
127
  * @param seconds
91
128
  * @returns
92
129
  */
@@ -104,7 +141,7 @@ const timeFormat = (seconds) => {
104
141
  return `${mm}:${ss}`;
105
142
  };
106
143
  /**
107
- * @description Converts seconds to milliseconds
144
+ * @description
108
145
  * @param seconds
109
146
  * @returns
110
147
  */
@@ -112,9 +149,9 @@ const secondsToMilliseconds = (seconds) => {
112
149
  return seconds * 1000;
113
150
  };
114
151
  /**
115
- * @description get extension from url
152
+ * @description
116
153
  * @param url
117
- * @returns string | undefined
154
+ * @returns
118
155
  */
119
156
  const getExtensionFromUrl = (url) => {
120
157
  const extension = url?.split(".")?.pop();
@@ -358,8 +395,8 @@ const VideoSeekSlider = ({ max = 1000, currentTime = 0, bufferTime = 0, hideThum
358
395
  React__default.createElement(Thumb, { max: max, currentTime: currentTime, isThumbActive: isThumbActive, trackColor: trackColor })));
359
396
  };
360
397
 
361
- var css_248z = ".ui-video-seek-slider {\n position: relative;\n touch-action: none;\n}\n.ui-video-seek-slider:focus {\n outline: none;\n}\n.ui-video-seek-slider .track {\n padding: 0;\n cursor: pointer;\n outline: none;\n}\n.ui-video-seek-slider .track:focus {\n border: 0;\n outline: none;\n}\n.ui-video-seek-slider .track .main {\n width: 100%;\n outline: none;\n height: 18px;\n top: 0;\n position: absolute;\n display: flex;\n align-items: center;\n box-sizing: border-box;\n}\n.ui-video-seek-slider .track .main:before {\n content: \"\";\n position: absolute;\n width: 100%;\n height: 3px;\n background-color: rgba(255, 255, 255, 0.2);\n overflow: hidden;\n transition: height 0.1s;\n outline: none;\n}\n.ui-video-seek-slider .track .main .inner-seek-block {\n position: absolute;\n width: 100%;\n height: 3px;\n transition: height 0.1s, opacity 0.4s;\n transform-origin: 0 0;\n}\n.ui-video-seek-slider .track .main:focus {\n border: 0;\n outline: none;\n}\n.ui-video-seek-slider .track .main .buffered {\n background-color: rgba(255, 255, 255, 0.3);\n z-index: 2;\n}\n.ui-video-seek-slider .track .main .seek-hover {\n background-color: rgba(255, 255, 255, 0.5);\n z-index: 1;\n}\n.ui-video-seek-slider .track .main .connect {\n background-color: #ff0000;\n z-index: 3;\n transform-origin: 0 0;\n}\n.ui-video-seek-slider .track .main.with-gap .inner-seek-block,\n.ui-video-seek-slider .track .main.with-gap:before {\n width: calc(100% - 2px);\n margin: 0 auto;\n}\n@media (hover) {\n .ui-video-seek-slider .track .main:hover:before {\n height: 8px;\n }\n .ui-video-seek-slider .track .main:hover .inner-seek-block {\n height: 8px;\n }\n}\n.ui-video-seek-slider .thumb {\n pointer-events: none;\n position: absolute;\n width: 12px;\n height: 12px;\n left: -6px;\n z-index: 4;\n top: 3px;\n}\n.ui-video-seek-slider .thumb .handler {\n border-radius: 100%;\n width: 100%;\n height: 100%;\n background-color: #ff0000;\n opacity: 0;\n transform: scale(0.4);\n transition: transform 0.2s, opacity 0.2s;\n}\n.ui-video-seek-slider .thumb.active .handler {\n opacity: 1;\n transform: scale(1);\n}\n.ui-video-seek-slider .hover-time {\n text-shadow: 1px 1px 1px #000;\n position: absolute;\n line-height: 18px;\n font-size: 16px;\n color: #ddd;\n bottom: 5px;\n left: 0;\n padding: 5px 10px;\n opacity: 0;\n pointer-events: none;\n text-align: center;\n}\n.ui-video-seek-slider .hover-time.active {\n opacity: 1;\n}\n.ui-video-seek-slider .hover-time .preview-screen {\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n width: 200px;\n height: 110px;\n border-radius: 5px;\n background-color: #000;\n margin: 0 auto 10px;\n}\n.ui-video-seek-slider:hover .track .main .seek-hover {\n opacity: 1;\n}\n";
362
- styleInject(css_248z,{"insertAt":"top"});
398
+ var css_248z$2 = ".ui-video-seek-slider {\n position: relative;\n touch-action: none;\n}\n.ui-video-seek-slider:focus {\n outline: none;\n}\n.ui-video-seek-slider .track {\n padding: 0;\n cursor: pointer;\n outline: none;\n}\n.ui-video-seek-slider .track:focus {\n border: 0;\n outline: none;\n}\n.ui-video-seek-slider .track .main {\n width: 100%;\n outline: none;\n height: 18px;\n top: 0;\n position: absolute;\n display: flex;\n align-items: center;\n box-sizing: border-box;\n}\n.ui-video-seek-slider .track .main:before {\n content: \"\";\n position: absolute;\n width: 100%;\n height: 3px;\n background-color: rgba(255, 255, 255, 0.2);\n overflow: hidden;\n transition: height 0.1s;\n outline: none;\n}\n.ui-video-seek-slider .track .main .inner-seek-block {\n position: absolute;\n width: 100%;\n height: 3px;\n transition: height 0.1s, opacity 0.4s;\n transform-origin: 0 0;\n}\n.ui-video-seek-slider .track .main:focus {\n border: 0;\n outline: none;\n}\n.ui-video-seek-slider .track .main .buffered {\n background-color: rgba(255, 255, 255, 0.3);\n z-index: 2;\n}\n.ui-video-seek-slider .track .main .seek-hover {\n background-color: rgba(255, 255, 255, 0.5);\n z-index: 1;\n}\n.ui-video-seek-slider .track .main .connect {\n background-color: #ff0000;\n z-index: 3;\n transform-origin: 0 0;\n}\n.ui-video-seek-slider .track .main.with-gap .inner-seek-block,\n.ui-video-seek-slider .track .main.with-gap:before {\n width: calc(100% - 2px);\n margin: 0 auto;\n}\n@media (hover) {\n .ui-video-seek-slider .track .main:hover:before {\n height: 8px;\n }\n .ui-video-seek-slider .track .main:hover .inner-seek-block {\n height: 8px;\n }\n}\n.ui-video-seek-slider .thumb {\n pointer-events: none;\n position: absolute;\n width: 12px;\n height: 12px;\n left: -6px;\n z-index: 4;\n top: 3px;\n}\n.ui-video-seek-slider .thumb .handler {\n border-radius: 100%;\n width: 100%;\n height: 100%;\n background-color: #ff0000;\n opacity: 0;\n transform: scale(0.4);\n transition: transform 0.2s, opacity 0.2s;\n}\n.ui-video-seek-slider .thumb.active .handler {\n opacity: 1;\n transform: scale(1);\n}\n.ui-video-seek-slider .hover-time {\n text-shadow: 1px 1px 1px #000;\n position: absolute;\n line-height: 18px;\n font-size: 16px;\n color: #ddd;\n bottom: 5px;\n left: 0;\n padding: 5px 10px;\n opacity: 0;\n pointer-events: none;\n text-align: center;\n}\n.ui-video-seek-slider .hover-time.active {\n opacity: 1;\n}\n.ui-video-seek-slider .hover-time .preview-screen {\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n width: 200px;\n height: 110px;\n border-radius: 5px;\n background-color: #000;\n margin: 0 auto 10px;\n}\n.ui-video-seek-slider:hover .track .main .seek-hover {\n opacity: 1;\n}\n";
399
+ styleInject(css_248z$2,{"insertAt":"top"});
363
400
 
364
401
  const BottomControls = ({ config }) => {
365
402
  const { videoRef, currentTime, isFullscreen } = useVideoStore();
@@ -389,7 +426,23 @@ const Tooltip = ({ children, title, position = "top", }) => {
389
426
  visible && (React__default.createElement("div", { className: `absolute z-50 px-3 py-1 text-sm text-white bg-gray-900 rounded-md shadow-md transition-opacity duration-200 ease-in-out ${positionStyles[position]}` }, title))));
390
427
  };
391
428
 
392
- const Popover = ({ button, children, closeOnButtonClick = false, }) => {
429
+ var css_248z$1 = ".icon-button {\n width: 20px;\n height: 20px;\n cursor: pointer;\n color: #9ca3af;\n transition: color 0.2s ease-in-out;\n}\n\n.icon-button:hover {\n color: #e5e7eb;\n}\n\n@media (min-width: 1024px) {\n .icon-button {\n width: 32px;\n height: 32px;\n }\n}\n\n/* styles/fullscreen-toggle.css */\n.fullscreen-icon {\n width: 20px;\n height: 20px;\n cursor: pointer;\n color: #9ca3af;\n transition: color 0.2s ease-in-out;\n}\n\n.fullscreen-icon:hover {\n color: #e5e7eb;\n}\n\n@media (min-width: 1024px) {\n .fullscreen-icon {\n width: 32px;\n height: 32px;\n }\n}\n\n/* styles/pi-picture-in-picture-toggle.css */\n.pip-toggle {\n cursor: pointer;\n color: #9ca3af;\n transition: color 0.2s ease-in-out;\n}\n\n.pip-toggle:hover {\n color: #e5e7eb;\n}\n\n.pip-icon {\n width: 15px;\n height: 15px;\n}\n\n@media (min-width: 1024px) {\n .pip-icon {\n width: 28px;\n height: 28px;\n }\n}\n";
430
+ styleInject(css_248z$1,{"insertAt":"top"});
431
+
432
+ const FullScreenToggle = ({ isFullScreen, onClick, className = "fullscreen-icon", }) => {
433
+ return (React__default.createElement("div", { onClick: onClick }, isFullScreen ? (React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 25", className: className },
434
+ React__default.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M2.849 4.71l4.77 4.77H5.857a1.111 1.111 0 1 0 0 2.221H10.3a1.11 1.11 0 0 0 1.111-1.11V6.145a1.111 1.111 0 0 0-2.222 0v1.762l-4.77-4.77A1.111 1.111 0 1 0 2.85 4.709zm19.349 16.206l-4.77-4.77h1.762a1.111 1.111 0 0 0 0-2.223h-4.444c-.614 0-1.111.498-1.111 1.112v4.444a1.111 1.111 0 0 0 2.222 0v-1.762l4.77 4.77a1.111 1.111 0 1 0 1.571-1.571z", clipRule: "evenodd" }))) : (React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 25", className: className },
435
+ React__default.createElement("path", { fill: "currentColor", d: "M4.746 8.056V6.294L18.73 20.278h-1.762a1.111 1.111 0 1 0 0 2.222h4.444a1.11 1.11 0 0 0 1.111-1.111v-4.445a1.111 1.111 0 0 0-2.222 0v1.762L6.317 4.722h1.762a1.111 1.111 0 1 0 0-2.222H3.635c-.614 0-1.112.497-1.112 1.111v4.445a1.111 1.111 0 1 0 2.223 0z" })))));
436
+ };
437
+
438
+ const PiPictureInPictureToggle = ({ onClick, className = "", }) => {
439
+ return (React__default.createElement("div", { onClick: onClick, className: `pip-toggle` },
440
+ React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", className: `pip-icon ${className}` },
441
+ React__default.createElement("rect", { width: "9", height: "6", x: "11", y: "11.99", fill: "#fff", rx: "1" }),
442
+ React__default.createElement("rect", { width: "22", height: "18", x: "1", y: "3", stroke: "#B3B3B3", strokeWidth: "2", rx: "3" }))));
443
+ };
444
+
445
+ const Popover = ({ button, children, closeOnButtonClick = false, className = "", align = "left", }) => {
393
446
  const [isOpen, setIsOpen] = useState(false);
394
447
  const popoverRef = useRef(null);
395
448
  const buttonRef = useRef(null);
@@ -418,31 +471,193 @@ const Popover = ({ button, children, closeOnButtonClick = false, }) => {
418
471
  const togglePopover = () => {
419
472
  setIsOpen((prev) => (closeOnButtonClick ? !prev : true));
420
473
  };
474
+ // Get alignment classes
475
+ const getAlignmentClasses = () => {
476
+ switch (align) {
477
+ case "center":
478
+ return "left-1/2 -translate-x-1/2";
479
+ case "right":
480
+ return "right-0";
481
+ case "left":
482
+ default:
483
+ return "left-0";
484
+ }
485
+ };
486
+ // Arrow is always centered regardless of popover alignment
487
+ const getArrowPositionClasses = () => {
488
+ return "left-1/2 -translate-x-1/2";
489
+ };
421
490
  return (React__default.createElement("div", { className: "relative inline-block" },
422
491
  React__default.createElement("div", { ref: buttonRef, onClick: togglePopover, tabIndex: 0, role: "button" }, button),
423
- isOpen && (React__default.createElement("div", { ref: popoverRef, className: "absolute left-0 mt-2 w-fit bg-white shadow-lg rounded-lg border border-gray-200 z-50 p-4 transition-all duration-200" },
424
- React__default.createElement("div", { className: "absolute -top-2 left-4 w-3 h-3 bg-white transform rotate-45 border-l border-t border-gray-200 z-[-1]" }),
492
+ isOpen && (React__default.createElement("div", { ref: popoverRef, className: `absolute ${getAlignmentClasses()} mt-2 w-fit bg-[#3a4049] text-white shadow-2xl rounded-lg border border-white/10 z-50 p-0 transition-all duration-200 ${className}` },
493
+ React__default.createElement("div", { className: `absolute -top-2 ${getArrowPositionClasses()} w-3 h-3 bg-[#3a4049] transform rotate-45 border-l border-t border-white/10 z-[-1]` }),
425
494
  children))));
426
495
  };
427
496
 
428
- const iconClassName$1 = "w-5 h-5 lg:w-8 lg:h-8 text-gray-400 hover:text-gray-200 cursor-pointer transition-colors duration-200";
429
- const FullScreenToggle = ({ isFullScreen, onClick, }) => {
430
- return (React__default.createElement("div", { onClick: onClick }, isFullScreen ? (React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 25", className: iconClassName$1 },
431
- React__default.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M2.849 4.71l4.77 4.77H5.857a1.111 1.111 0 1 0 0 2.221H10.3a1.11 1.11 0 0 0 1.111-1.11V6.145a1.111 1.111 0 0 0-2.222 0v1.762l-4.77-4.77A1.111 1.111 0 1 0 2.85 4.709zm19.349 16.206l-4.77-4.77h1.762a1.111 1.111 0 0 0 0-2.223h-4.444c-.614 0-1.111.498-1.111 1.112v4.444a1.111 1.111 0 0 0 2.222 0v-1.762l4.77 4.77a1.111 1.111 0 1 0 1.571-1.571z", clipRule: "evenodd" }))) : (React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 25", className: iconClassName$1 },
432
- React__default.createElement("path", { fill: "currentColor", d: "M4.746 8.056V6.294L18.73 20.278h-1.762a1.111 1.111 0 1 0 0 2.222h4.444a1.11 1.11 0 0 0 1.111-1.111v-4.445a1.111 1.111 0 0 0-2.222 0v1.762L6.317 4.722h1.762a1.111 1.111 0 1 0 0-2.222H3.635c-.614 0-1.112.497-1.112 1.111v4.445a1.111 1.111 0 1 0 2.223 0z" })))));
433
- };
434
-
435
- const iconClassName = "w-3.7 h-3.7 lg:w-7 lg:h-7 text-gray-400 hover:text-gray-200 cursor-pointer transition-colors duration-200";
436
- const PiPictureInPictureToggle = ({ onClick, className, }) => {
437
- return (React__default.createElement("div", { onClick: onClick, className: "text-gray-400 hover:text-gray-200 cursor-pointer transition-colors duration-200" },
438
- React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", className: `${iconClassName} ${className ?? ""}` },
439
- React__default.createElement("rect", { width: "9", height: "6", x: "11", y: "11.99", fill: "#fff", rx: "1" }),
440
- React__default.createElement("rect", { width: "22", height: "18", x: "1", y: "3", stroke: "#B3B3B3", strokeWidth: "2", rx: "3" }))));
497
+ const Settings = ({ iconClassName }) => {
498
+ const { qualityLevels, hlsInstance, setActiveQuality, activeQuality, subtitles, activeSubtitle, setActiveSubtitle, videoRef, } = useVideoStore();
499
+ const [speed, setSpeed] = React.useState(1);
500
+ const [activeMenu, setActiveMenu] = React.useState("main");
501
+ const handleSpeedChange = (newSpeed) => {
502
+ setSpeed(newSpeed);
503
+ if (videoRef) {
504
+ videoRef.playbackRate = newSpeed;
505
+ }
506
+ };
507
+ const uniqueQualityLevels = React.useMemo(() => {
508
+ if (!qualityLevels)
509
+ return [];
510
+ const seenHeights = new Set();
511
+ const unique = [];
512
+ qualityLevels.forEach((level, originalIndex) => {
513
+ if (seenHeights.has(level.height))
514
+ return;
515
+ seenHeights.add(level.height);
516
+ unique.push({
517
+ height: level.height,
518
+ bitrate: level.bitrate,
519
+ originalIndex,
520
+ });
521
+ });
522
+ return unique;
523
+ }, [qualityLevels]);
524
+ const speedOptions = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
525
+ const handleBack = () => setActiveMenu("main");
526
+ // Get quality label for display
527
+ const getQualityLabel = () => {
528
+ if (activeQuality === "auto")
529
+ return "Auto";
530
+ const level = uniqueQualityLevels.find((l) => String(l.height) === activeQuality);
531
+ return level ? `${level.height}p` : "Auto";
532
+ };
533
+ // Get quality label: show explicit resolution to avoid duplicates
534
+ const getQualityName = (height) => {
535
+ if (!height || height <= 0)
536
+ return "Auto";
537
+ return `${height}p`;
538
+ };
539
+ // Get estimated data usage using bitrate when available
540
+ const getDataUsage = (height, bitrate) => {
541
+ // bitrate in bits/sec -> GB/hour
542
+ if (bitrate && bitrate > 0) {
543
+ const gbPerHour = (bitrate * 3600) / 8 / 1e9;
544
+ const rounded = gbPerHour.toFixed(2);
545
+ return `Uses about ${rounded} GB per hour`;
546
+ }
547
+ // Fallback by resolution when bitrate missing
548
+ if (height >= 2160)
549
+ return "Uses about 7.00 GB per hour";
550
+ if (height >= 1440)
551
+ return "Uses about 3.50 GB per hour";
552
+ if (height >= 1080)
553
+ return "Uses about 2.50 GB per hour";
554
+ if (height >= 720)
555
+ return "Uses about 1.00 GB per hour";
556
+ if (height >= 480)
557
+ return "Uses about 0.70 GB per hour";
558
+ if (height >= 360)
559
+ return "Uses about 0.50 GB per hour";
560
+ return "Uses about 0.30 GB per hour";
561
+ };
562
+ return (React.createElement(Tooltip, { title: "Settings" },
563
+ React.createElement(Popover, { button: React.createElement(Settings$1, { className: iconClassName }), align: "center" },
564
+ React.createElement("div", { className: "bg-[#3a4049] text-white rounded-[7px] w-80 overflow-hidden" },
565
+ activeMenu === "main" && (React.createElement("div", { className: "p-4" },
566
+ React.createElement("h3", { className: "text-white font-bold text-xl mb-4" }, "Settings"),
567
+ React.createElement("p", { className: "text-gray-300 text-sm mb-4" }, "Customize playback"),
568
+ React.createElement("div", { className: "space-y-0 border-t border-gray-600" },
569
+ React.createElement("button", { onClick: () => setActiveMenu("quality"), className: "w-full flex items-center justify-between py-4 border-b border-gray-600 rounded-[5px] transition-colors" },
570
+ React.createElement("div", { className: "flex items-center gap-3" },
571
+ React.createElement("div", { className: "p-2 bg-blue-500 rounded-md" },
572
+ React.createElement("svg", { className: "w-5 h-5 text-white", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" },
573
+ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z" }))),
574
+ React.createElement("div", { className: "text-left" },
575
+ React.createElement("div", { className: "text-white font-semibold" }, "Quality"),
576
+ React.createElement("div", { className: "text-gray-400 text-sm" }, getQualityLabel()))),
577
+ React.createElement(ChevronRight, { className: "w-5 h-5 text-gray-400" })),
578
+ React.createElement("button", { onClick: () => setActiveMenu("subtitles"), className: "w-full flex items-center justify-between py-4 border-b border-gray-600 rounded-[5px] transition-colors" },
579
+ React.createElement("div", { className: "flex items-center gap-3" },
580
+ React.createElement("div", { className: "p-2 bg-purple-500 rounded-md" },
581
+ React.createElement("svg", { className: "w-5 h-5 text-white", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" },
582
+ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z" }))),
583
+ React.createElement("div", { className: "text-left" },
584
+ React.createElement("div", { className: "text-white font-semibold" }, "Subtitles"),
585
+ React.createElement("div", { className: "text-gray-400 text-sm" }, !activeSubtitle ? "Off" : activeSubtitle.label))),
586
+ React.createElement(ChevronRight, { className: "w-5 h-5 text-gray-400" })),
587
+ React.createElement("button", { onClick: () => setActiveMenu("speed"), className: "w-full flex items-center justify-between py-4 rounded-[5px] transition-colors" },
588
+ React.createElement("div", { className: "flex items-center gap-3" },
589
+ React.createElement("div", { className: "p-2 bg-green-500 rounded-md" },
590
+ React.createElement("svg", { className: "w-5 h-5 text-white", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" },
591
+ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }))),
592
+ React.createElement("div", { className: "text-left" },
593
+ React.createElement("div", { className: "text-white font-semibold" }, "Speed"),
594
+ React.createElement("div", { className: "text-gray-400 text-sm" },
595
+ speed,
596
+ "x"))),
597
+ React.createElement(ChevronRight, { className: "w-5 h-5 text-gray-400" }))))),
598
+ activeMenu === "quality" && (React.createElement("div", { className: "p-4" },
599
+ React.createElement("div", { className: "flex items-center gap-3 mb-4" },
600
+ React.createElement("button", { onClick: handleBack, className: "p-1 rounded-md transition-colors" },
601
+ React.createElement(ChevronRight, { className: "w-6 h-6 text-white rotate-180" })),
602
+ React.createElement("h3", { className: "text-white font-bold text-xl" }, "Video Quality")),
603
+ React.createElement("div", { className: "space-y-3" },
604
+ React.createElement("button", { onClick: () => {
605
+ if (hlsInstance) {
606
+ hlsInstance.currentLevel = -1;
607
+ setActiveQuality("auto");
608
+ }
609
+ }, className: `w-full text-left px-4 py-3 rounded-md transition-all ${activeQuality === "auto"
610
+ ? "bg-white/10"
611
+ : "hover:bg-white/5"}` },
612
+ React.createElement("div", { className: "flex items-start justify-between" },
613
+ React.createElement("div", null,
614
+ React.createElement("div", { className: "text-white font-semibold text-lg mb-1" }, "Auto"),
615
+ React.createElement("div", { className: "text-gray-400 text-sm" }, "Adjust to your connection")),
616
+ activeQuality === "auto" && (React.createElement(Check, { className: "w-6 h-6 text-white mt-1" })))),
617
+ uniqueQualityLevels
618
+ .map((level) => (React.createElement("button", { key: level.originalIndex, onClick: () => {
619
+ if (hlsInstance) {
620
+ hlsInstance.currentLevel = level.originalIndex;
621
+ setActiveQuality(String(level.height));
622
+ }
623
+ }, className: `w-full text-left px-4 py-3 rounded-md transition-all ${activeQuality === String(level.height)
624
+ ? "bg-white/10"
625
+ : "hover:bg-white/5"}` },
626
+ React.createElement("div", { className: "flex items-start justify-between" },
627
+ React.createElement("div", null,
628
+ React.createElement("div", { className: "text-white font-semibold text-lg mb-1" }, getQualityName(level.height)),
629
+ React.createElement("div", { className: "text-gray-400 text-sm" }, getDataUsage(level.height, level.bitrate))),
630
+ activeQuality === String(level.height) && (React.createElement(Check, { className: "w-6 h-6 text-white mt-1" }))))))
631
+ .reverse()))),
632
+ activeMenu === "subtitles" && (React.createElement("div", { className: "p-4" },
633
+ React.createElement("div", { className: "flex items-center gap-3 mb-4" },
634
+ React.createElement("button", { onClick: handleBack, className: "p-1 hover:bg-white/10 rounded-md transition-colors" },
635
+ React.createElement(ChevronRight, { className: "w-6 h-6 text-white rotate-180" })),
636
+ React.createElement("h3", { className: "text-white font-bold text-xl" }, "Subtitles")),
637
+ React.createElement("div", { className: "space-y-3" },
638
+ React.createElement("button", { onClick: () => setActiveSubtitle(null), className: `w-full text-left px-4 py-3 rounded-[5px] transition-all flex items-center justify-between ${!activeSubtitle ? "bg-[#454545]" : ""}` },
639
+ React.createElement("span", { className: "text-white font-semibold text-lg" }, "Off"),
640
+ !activeSubtitle && React.createElement(Check, { className: "w-6 h-6 text-white" })),
641
+ subtitles?.map((subtitle, index) => (React.createElement("button", { key: index, onClick: () => setActiveSubtitle(subtitle), className: `w-full text-left px-4 py-3 rounded-md transition-all flex items-center justify-between ${activeSubtitle?.label === subtitle.label
642
+ ? "bg-white/10"
643
+ : "hover:bg-white/5"}` },
644
+ React.createElement("span", { className: "text-white font-semibold text-lg" }, subtitle.label),
645
+ activeSubtitle?.label === subtitle.label && (React.createElement(Check, { className: "w-6 h-6 text-white" })))))))),
646
+ activeMenu === "speed" && (React.createElement("div", { className: "p-4" },
647
+ React.createElement("div", { className: "flex items-center gap-3 mb-4" },
648
+ React.createElement("button", { onClick: handleBack, className: "p-1 hover:bg-white/10 rounded-md transition-colors" },
649
+ React.createElement(ChevronRight, { className: "w-6 h-6 text-white rotate-180" })),
650
+ React.createElement("h3", { className: "text-white font-bold text-xl" }, "Playback Speed")),
651
+ React.createElement("div", { className: "space-y-3 max-h-80 overflow-y-auto" }, speedOptions.map((s) => (React.createElement("button", { key: s, onClick: () => handleSpeedChange(s), className: `w-full text-left px-4 py-3 rounded-[5px] transition-all flex items-center justify-between ${speed === s ? "bg-[#454545]" : ""}` },
652
+ React.createElement("span", { className: "text-white font-semibold text-lg" }, s === 1 ? "Normal" : `${s}x`),
653
+ speed === s && React.createElement(Check, { className: "w-6 h-6 text-white" })))))))))));
441
654
  };
442
655
 
443
656
  const ControlsHeader = ({ config }) => {
444
- const iconClassName = "w-5 h-5 lg:w-8 lg:h-8 text-gray-400 hover:text-gray-200 cursor-pointer transition-colors duration-200";
445
- const { videoWrapperRef, videoRef, qualityLevels, hlsInstance, setActiveQuality, activeQuality, subtitles, activeSubtitle, setActiveSubtitle, } = useVideoStore();
657
+ const iconClassName = "icon-button";
658
+ const { videoWrapperRef, videoRef, episodeList, currentEpisodeIndex } = useVideoStore();
659
+ const [isPipActive, setIsPipActive] = React.useState(false);
660
+ const isFullscreen = document.fullscreenElement !== null;
446
661
  const handleFullscreen = () => {
447
662
  if (isPipActive)
448
663
  return;
@@ -453,26 +668,11 @@ const ControlsHeader = ({ config }) => {
453
668
  videoWrapperRef?.requestFullscreen();
454
669
  }
455
670
  };
456
- const isFullscreen = document.fullscreenElement !== null;
457
671
  const handleMute = () => {
458
- if (videoRef?.muted) {
459
- if (videoRef)
460
- videoRef.muted = false;
461
- }
462
- else {
463
- if (videoRef)
464
- videoRef.muted = true;
465
- }
466
- };
467
- const [speed, setSpeed] = React.useState(1);
468
- const handleSpeedChange = (newSpeed) => {
469
- setSpeed(newSpeed);
470
672
  if (videoRef) {
471
- videoRef.playbackRate = newSpeed;
673
+ videoRef.muted = !videoRef.muted;
472
674
  }
473
675
  };
474
- // PiP Mode State and Handler
475
- const [isPipActive, setIsPipActive] = React.useState(false);
476
676
  const handlePipToggle = async () => {
477
677
  if (videoRef) {
478
678
  if (!document.pictureInPictureElement && !isPipActive) {
@@ -495,7 +695,6 @@ const ControlsHeader = ({ config }) => {
495
695
  }
496
696
  }
497
697
  };
498
- // Event listener for PiP changes
499
698
  React.useEffect(() => {
500
699
  const handlePipChange = () => {
501
700
  setIsPipActive(!!document.pictureInPictureElement);
@@ -510,56 +709,12 @@ const ControlsHeader = ({ config }) => {
510
709
  return (React.createElement("div", { className: "flex items-center justify-between p-10 bg-gradient-to-b from-black" },
511
710
  React.createElement("div", { className: "flex" },
512
711
  React.createElement("div", null,
513
- config?.title && (React.createElement("h1", { className: "text-gray-200 text-lg lg:text-2xl font-semibold" }, config.title)),
514
- config?.isTrailer && (React.createElement("h1", { className: "text-gray-200 text-sm lg:text-base font-normal" }, "Trailer")))),
712
+ React.createElement("h1", { className: "text-gray-200 text-lg lg:text-2xl font-semibold" }, episodeList.length > 0
713
+ ? episodeList[currentEpisodeIndex]?.title
714
+ : config?.title),
715
+ config?.isTrailer && (React.createElement("p", { className: "text-gray-300 text-sm lg:text-base font-normal" }, "Trailer")))),
515
716
  React.createElement("div", { className: "flex items-center gap-7 text-white" },
516
- React.createElement("div", null,
517
- React.createElement(Tooltip, { title: "Settings" },
518
- React.createElement(Popover, { button: React.createElement(Settings, { className: iconClassName }) },
519
- React.createElement("div", { className: "bg-white/90 backdrop-blur-md text-gray-900 rounded-xl shadow-xl w-56 p-2" },
520
- React.createElement("div", { className: "mb-2" },
521
- React.createElement("p", { className: "font-semibold mb-1 px-3 py-1 text-gray-700" }, "Quality"),
522
- React.createElement("div", { className: "flex flex-col gap-1" },
523
- React.createElement("button", { onClick: () => {
524
- if (hlsInstance) {
525
- hlsInstance.currentLevel = -1;
526
- setActiveQuality("auto");
527
- }
528
- }, className: `flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-gray-200 transition-colors ${activeQuality === "auto"
529
- ? "bg-green-100 font-semibold"
530
- : ""}` },
531
- activeQuality === "auto" && (React.createElement(FaCheck, { className: "text-green-500" })),
532
- "Auto"),
533
- qualityLevels
534
- ?.map((level, index) => (React.createElement("button", { key: index, onClick: () => {
535
- if (hlsInstance) {
536
- hlsInstance.currentLevel = index;
537
- setActiveQuality(String(level.height));
538
- }
539
- }, className: `flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-gray-200 transition-colors ${activeQuality === String(level.height)
540
- ? "bg-green-100 font-semibold"
541
- : ""}` },
542
- activeQuality === String(level.height) && (React.createElement(FaCheck, { className: "text-green-500" })),
543
- level.height,
544
- "p")))
545
- .reverse())),
546
- React.createElement("div", { className: "mb-2" },
547
- React.createElement("p", { className: "font-semibold mb-1 px-3 py-1 text-gray-700" }, "Subtitles"),
548
- React.createElement("div", { className: "flex flex-col gap-1" },
549
- React.createElement("button", { onClick: () => setActiveSubtitle(null), className: `flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-gray-200 transition-colors ${!activeSubtitle ? "bg-green-100 font-semibold" : ""}` },
550
- !activeSubtitle && (React.createElement(FaCheck, { className: "text-green-500" })),
551
- "Off"),
552
- subtitles?.map((subtitle, index) => (React.createElement("button", { key: index, onClick: () => setActiveSubtitle(subtitle), className: `flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-gray-200 transition-colors ${activeSubtitle?.label === subtitle.label
553
- ? "bg-green-100 font-semibold"
554
- : ""}` },
555
- activeSubtitle?.label === subtitle.label && (React.createElement(FaCheck, { className: "text-green-500" })),
556
- subtitle.label))))),
557
- React.createElement("div", null,
558
- React.createElement("p", { className: "font-semibold mb-1 px-3 py-1 text-gray-700" }, "Speed"),
559
- React.createElement("div", { className: "flex flex-col gap-1" }, [0.5, 1, 1.5, 2].map((s) => (React.createElement("button", { key: s, onClick: () => handleSpeedChange(s), className: `flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-gray-200 transition-colors ${speed === s ? "bg-green-100 font-semibold" : ""}` },
560
- speed === s && React.createElement(FaCheck, { className: "text-green-500" }),
561
- s,
562
- "x"))))))))),
717
+ React.createElement(Settings, { iconClassName: iconClassName }),
563
718
  React.createElement("div", { onClick: handleMute }, videoRef?.muted ? (React.createElement(Tooltip, { title: "Unmute" },
564
719
  React.createElement(IoVolumeMuteOutline, { className: iconClassName }))) : (React.createElement(Tooltip, { title: "Mute" },
565
720
  React.createElement(IoVolumeHighOutline, { className: iconClassName })))),
@@ -574,13 +729,12 @@ const ControlsHeader = ({ config }) => {
574
729
  React.createElement("div", { onClick: handlePipToggle },
575
730
  React.createElement(PiPictureInPictureToggle, { className: iconClassName }))),
576
731
  config?.onClose && (React.createElement(React.Fragment, null,
577
- React.createElement("div", { className: "w-[2px] h-10 bg-gray-500 hover:bg-gray-300 transition-colors duration-200 mx-2" }),
732
+ React.createElement("div", { className: "w-[2px] h-10 bg-gray-500 hover:bg-gray-300 mx-2" }),
578
733
  React.createElement("div", { onClick: config.onClose },
579
734
  React.createElement(Tooltip, { title: "Close" },
580
735
  React.createElement(IoMdClose, { className: iconClassName }))))))));
581
736
  };
582
737
 
583
- const iconClasses = "w-14 h-14 lg:w-18 lg:h-18 text-gray-400 hover:text-gray-200 cursor-pointer transition-colors duration-200";
584
738
  const MiddleControls = () => {
585
739
  const { videoRef, isPlaying, setIsPlaying, isBuffering, setIsBuffering } = useVideoStore();
586
740
  const handlePlayPause = () => {
@@ -659,21 +813,22 @@ const MiddleControls = () => {
659
813
  }, [videoRef, isPlaying]);
660
814
  return (React__default.createElement("div", { className: "flex justify-center items-center" },
661
815
  React__default.createElement("div", { onClick: handleBackword, className: "w-[15vw] flex justify-center items-center h-full cursor-pointer" },
662
- React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: iconClasses, fill: "currentColor", viewBox: "0 0 67 67" },
816
+ React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "icon-class", fill: "currentColor", viewBox: "0 0 67 67" },
663
817
  React__default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M33.5 0C52 0 67 15 67 33.5S52 67 33.5 67 0 52 0 33.5c.03-1.4 1.17-2.53 2.58-2.53 1.4 0 2.55 1.13 2.57 2.53 0 15.65 12.7 28.35 28.35 28.35 15.66 0 28.35-12.7 28.35-28.35 0-15.66-12.69-28.35-28.35-28.35h-.04c-7 0-13.76 2.61-18.94 7.3-.46.42-.91.85-1.34 1.29h6.58c1.42 0 2.57 1.16 2.57 2.58 0 1.42-1.15 2.58-2.57 2.58H6.01c-1.42 0-2.57-1.16-2.57-2.58V2.58C3.44 1.15 4.59 0 6.01 0c1.43 0 2.58 1.15 2.58 2.58v8.52c.78-.86 1.61-1.7 2.47-2.47A33.407 33.407 0 0 1 33.46 0h.04zM33.98 41.34c-1.6-2.21-2-5.2-2-7.85 0-2.65.4-5.63 2-7.83 1.44-1.97 3.47-2.84 5.88-2.84 2.41 0 4.42.87 5.86 2.84 1.61 2.21 2.03 5.16 2.03 7.83 0 2.66-.4 5.64-2 7.85-1.43 1.97-3.47 2.84-5.89 2.84-2.41 0-4.45-.86-5.88-2.84zm-9.73-12.77l-5 1.58v-4.21l5.87-2.65h4.28v20.47h-5.15V28.57zm17.61 9.96c.61-1.33.68-3.6.68-5.04s-.07-3.7-.68-5.02c-.4-.86-1.04-1.29-2-1.29-.95 0-1.59.42-1.99 1.29-.61 1.32-.68 3.58-.68 5.02 0 1.44.07 3.71.68 5.04.4.87 1.04 1.29 1.99 1.29.96 0 1.6-.42 2-1.29z" }))),
664
- React__default.createElement("div", { onClick: handlePlayPause, className: "w-[10vw] flex justify-center items-center h-full cursor-pointer" }, isBuffering ? (React__default.createElement(Loader, { className: "w-24 h-24 lg:w-32 lg:h-32 animate-spin text-white" })) : isPlaying ? (React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: iconClasses, fill: "currentColor", viewBox: "0 0 67 67" },
665
- React__default.createElement("path", { fillRule: "evenodd", d: "M46.332 5.773a4.125 4.125 0 0 0-4.125 4.125v46.75a4.127 4.127 0 0 0 4.125 4.125 4.127 4.127 0 0 0 4.125-4.125V9.898a4.125 4.125 0 0 0-4.125-4.125zM25.707 9.898v46.75a4.125 4.125 0 1 1-8.25 0V9.898a4.123 4.123 0 0 1 4.125-4.125 4.123 4.123 0 0 1 4.125 4.125z", clipRule: "evenodd" }))) : (React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: iconClasses, fill: "currentColor", viewBox: "0 0 67 67" },
818
+ React__default.createElement("div", { onClick: handlePlayPause, className: "w-[10vw] flex justify-center items-center h-full cursor-pointer" }, isBuffering ? (React__default.createElement(Loader, { className: "w-24 h-24 lg:w-32 lg:h-32 animate-spin text-white" })) : isPlaying ? (React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "icon-class", fill: "currentColor", viewBox: "0 0 67 67" },
819
+ React__default.createElement("path", { fillRule: "evenodd", d: "M46.332 5.773a4.125 4.125 0 0 0-4.125 4.125v46.75a4.127 4.127 0 0 0 4.125 4.125 4.127 4.127 0 0 0 4.125-4.125V9.898a4.125 4.125 0 0 0-4.125-4.125zM25.707 9.898v46.75a4.125 4.125 0 1 1-8.25 0V9.898a4.123 4.123 0 0 1 4.125-4.125 4.123 4.123 0 0 1 4.125 4.125z", clipRule: "evenodd" }))) : (React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "icon-class", fill: "currentColor", viewBox: "0 0 67 67" },
666
820
  React__default.createElement("path", { d: "M20.28 9.65c-2.205-1.268-4.026-.228-4.026 2.307v43.805c0 2.535 1.82 3.574 4.027 2.307l38.471-21.903a2.556 2.556 0 0 0 1.094-.935 2.514 2.514 0 0 0 0-2.743 2.556 2.556 0 0 0-1.093-.936L20.28 9.65z" })))),
667
821
  React__default.createElement("div", { onClick: handleForword, className: "w-[15vw] flex justify-center items-center h-full cursor-pointer" },
668
- React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: iconClasses, fill: "currentColor", viewBox: "0 0 67 67" },
822
+ React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "icon-class", fill: "currentColor", viewBox: "0 0 67 67" },
669
823
  React__default.createElement("path", { fillRule: "evenodd", d: "M33.5 0C15 0 0 15 0 33.5S15 67 33.5 67 67 52 67 33.5a2.583 2.583 0 0 0-2.58-2.53c-1.4 0-2.55 1.13-2.57 2.53 0 15.66-12.69 28.35-28.35 28.35-15.65 0-28.35-12.7-28.35-28.35 0-15.66 12.7-28.35 28.35-28.35 7.3 0 13.96 2.76 18.99 7.3.46.42.9.85 1.34 1.29h-6.59a2.58 2.58 0 0 0 0 5.16h13.75c1.42 0 2.57-1.16 2.57-2.58V2.58c0-1.43-1.15-2.58-2.57-2.58-1.43 0-2.58 1.15-2.58 2.58v8.52c-.78-.87-1.61-1.7-2.47-2.48A33.446 33.446 0 0 0 33.54 0h-.04zM33.98 41.34c-1.6-2.21-2-5.2-2-7.85 0-2.65.4-5.63 2-7.83 1.44-1.97 3.47-2.84 5.88-2.84 2.41 0 4.42.87 5.86 2.84 1.61 2.21 2.03 5.16 2.03 7.83 0 2.66-.4 5.64-2 7.85-1.43 1.97-3.47 2.84-5.89 2.84-2.41 0-4.45-.87-5.88-2.84zm-9.73-12.77l-5 1.58v-4.21l5.87-2.65h4.28v20.47h-5.15V28.57zm17.61 9.96c.61-1.33.68-3.6.68-5.04s-.07-3.7-.68-5.02c-.4-.87-1.04-1.29-2-1.29-.95 0-1.59.42-1.99 1.29-.61 1.32-.68 3.58-.68 5.02 0 1.44.07 3.71.68 5.04.4.86 1.04 1.28 1.99 1.28.96 0 1.6-.42 2-1.28z" })))));
670
824
  };
671
825
 
672
826
  const VideoPlayerControls = ({ config, height, width, }) => {
673
- return (React.createElement("div", { className: `absolute top-0 left-0 ${height || "h-full"} ${width || "w-full"} bg-[rgba(0,0,0,0.5)] flex flex-col justify-between` },
674
- React.createElement(ControlsHeader, { config: config?.headerConfig?.config }),
675
- React.createElement(MiddleControls, null),
676
- React.createElement(BottomControls, { config: config?.bottomConfig?.config })));
827
+ return (React.createElement("div", { className: "px-20" },
828
+ React.createElement("div", { className: `absolute top-0 left-0 ${height || "h-full"} ${width || "w-full"} bg-[rgba(0,0,0,0.5)] flex flex-col justify-between` },
829
+ React.createElement(ControlsHeader, { config: config?.headerConfig?.config }),
830
+ React.createElement(MiddleControls, null),
831
+ React.createElement(BottomControls, { config: config?.bottomConfig?.config }))));
677
832
  };
678
833
 
679
834
  const VideoActionButton = ({ text, onClick, icon, disabled = false, position = "left", }) => {
@@ -714,7 +869,7 @@ const Overlay = ({ config }) => {
714
869
  if (showCountdown && countdownTime > 0 && episodeList.length > 0) {
715
870
  timer = setInterval(() => {
716
871
  setCountdownTime(countdownTime - 1);
717
- }, 2000);
872
+ }, 1000);
718
873
  }
719
874
  else if (showCountdown && countdownTime === 0 && episodeList.length > 0) {
720
875
  const nextIndex = currentEpisodeIndex + 1;
@@ -770,13 +925,122 @@ const Overlay = ({ config }) => {
770
925
  currentEpisodeIndex + 1 < episodeList.length && (React.createElement(VideoActionButton, { text: "Next Episode", onClick: handleNextEpisodeManually, icon: React.createElement(FaGooglePlay, { className: "text-black" }), disabled: currentEpisodeIndex + 1 >= episodeList.length, position: "right" }))));
771
926
  };
772
927
 
773
- const VideoPlayer = ({ trackSrc, trackTitle, intro, onClose, trackPoster, isTrailer, className, type, height, width, timeCodes, getPreviewScreenUrl, tracking, subtitles, episodeList, currentEpisodeIndex = 0, nextEpisodeConfig, }) => {
774
- const { setVideoRef, setCurrentTime, setVideoWrapperRef, videoRef, setQualityLevels, setHlsInstance, setDuration, setIsPlaying, activeSubtitle, setSubtitles, setEpisodeList, setCurrentEpisodeIndex, setShowCountdown, } = useVideoStore();
775
- const [showSkipIntro, setShowSkipIntro] = useState(false);
776
- const onRightClick = (e) => {
777
- e.preventDefault();
928
+ const SubtitleOverlay = ({ styleConfig }) => {
929
+ const { videoRef, activeSubtitle } = useVideoStore();
930
+ const [currentSubtitle, setCurrentSubtitle] = useState("");
931
+ const [isVisible, setIsVisible] = useState(false);
932
+ useEffect(() => {
933
+ if (!videoRef)
934
+ return;
935
+ const handleTimeUpdate = () => {
936
+ if (!activeSubtitle) {
937
+ setCurrentSubtitle("");
938
+ setIsVisible(false);
939
+ return;
940
+ }
941
+ const currentTime = videoRef.currentTime;
942
+ const textTracks = Array.from(videoRef.textTracks);
943
+ console.log("Available text tracks:", textTracks.map((t) => ({
944
+ label: t.label,
945
+ mode: t.mode,
946
+ cues: t.cues?.length,
947
+ })));
948
+ const activeTrack = textTracks.find((track) => track.mode === "showing" && track.label === activeSubtitle.label);
949
+ console.log("Active track found:", !!activeTrack, "Current time:", currentTime);
950
+ if (activeTrack && activeTrack.cues) {
951
+ const activeCues = Array.from(activeTrack.cues).filter((cue) => currentTime >= cue.startTime && currentTime <= cue.endTime);
952
+ if (activeCues.length > 0) {
953
+ const cue = activeCues[0];
954
+ let cueText = "";
955
+ try {
956
+ if ("text" in cue) {
957
+ cueText = cue.text;
958
+ }
959
+ else if (typeof cue.getCueAsHTML === "function") {
960
+ const htmlElement = cue.getCueAsHTML();
961
+ cueText =
962
+ htmlElement?.textContent || htmlElement?.innerText || "";
963
+ }
964
+ else {
965
+ cueText = cue.toString() || "";
966
+ }
967
+ }
968
+ catch (error) {
969
+ console.warn("Error getting subtitle text:", error);
970
+ cueText = "";
971
+ }
972
+ setCurrentSubtitle(cueText);
973
+ setIsVisible(!!cueText);
974
+ }
975
+ else {
976
+ setCurrentSubtitle("");
977
+ setIsVisible(false);
978
+ }
979
+ }
980
+ };
981
+ videoRef.addEventListener("timeupdate", handleTimeUpdate);
982
+ return () => {
983
+ videoRef.removeEventListener("timeupdate", handleTimeUpdate);
984
+ };
985
+ }, [videoRef, activeSubtitle]);
986
+ useEffect(() => {
987
+ if (!activeSubtitle) {
988
+ setCurrentSubtitle("");
989
+ setIsVisible(false);
990
+ }
991
+ }, [activeSubtitle]);
992
+ if (!isVisible || !currentSubtitle)
993
+ return null;
994
+ const getPositionStyles = () => {
995
+ const position = styleConfig?.position || "bottom";
996
+ switch (position) {
997
+ case "top":
998
+ return {
999
+ top: "10%",
1000
+ left: "50%",
1001
+ transform: "translateX(-50%)",
1002
+ };
1003
+ case "center":
1004
+ return {
1005
+ top: "50%",
1006
+ left: "50%",
1007
+ transform: "translate(-50%, -50%)",
1008
+ };
1009
+ case "bottom":
1010
+ default:
1011
+ return {
1012
+ bottom: "15%",
1013
+ left: "50%",
1014
+ transform: "translateX(-50%)",
1015
+ };
1016
+ }
778
1017
  };
779
- // === VIDEO SOURCE INIT ===
1018
+ const subtitleStyle = {
1019
+ position: "absolute",
1020
+ ...getPositionStyles(),
1021
+ fontSize: styleConfig?.fontSize || "1.2rem",
1022
+ fontWeight: "500",
1023
+ lineHeight: "1.2",
1024
+ textAlign: "center",
1025
+ background: styleConfig?.backgroundColor || "rgba(0, 0, 0, 0.4)",
1026
+ color: styleConfig?.textColor || "#fff",
1027
+ padding: styleConfig?.padding || "8px 16px",
1028
+ borderRadius: styleConfig?.borderRadius || "5px",
1029
+ maxWidth: styleConfig?.maxWidth || "60%",
1030
+ minWidth: "fit-content",
1031
+ boxShadow: "0 6px 20px rgba(0, 0, 0, 0.4)",
1032
+ backdropFilter: "blur(6px)",
1033
+ border: "1px solid rgba(255, 255, 255, 0.2)",
1034
+ transition: "all 0.2s ease-in-out",
1035
+ opacity: isVisible ? 1 : 0,
1036
+ zIndex: 10,
1037
+ pointerEvents: "none",
1038
+ };
1039
+ return React__default.createElement("div", { style: subtitleStyle }, currentSubtitle);
1040
+ };
1041
+
1042
+ const useVideoSource = (trackSrc, type) => {
1043
+ const { videoRef, setQualityLevels, setHlsInstance } = useVideoStore();
780
1044
  useEffect(() => {
781
1045
  if (!videoRef)
782
1046
  return;
@@ -807,8 +1071,11 @@ const VideoPlayer = ({ trackSrc, trackTitle, intro, onClose, trackPoster, isTrai
807
1071
  videoRef.src = trackSrc;
808
1072
  setQualityLevels([]);
809
1073
  }
810
- }, [trackSrc, videoRef]);
811
- // === SUBTITLES ===
1074
+ }, [trackSrc, videoRef, type, setQualityLevels, setHlsInstance]);
1075
+ };
1076
+
1077
+ const useSubtitles = (subtitles) => {
1078
+ const { videoRef, activeSubtitle, setSubtitles } = useVideoStore();
812
1079
  useEffect(() => {
813
1080
  if (videoRef) {
814
1081
  const tracks = videoRef.getElementsByTagName("track");
@@ -828,11 +1095,24 @@ const VideoPlayer = ({ trackSrc, trackTitle, intro, onClose, trackPoster, isTrai
828
1095
  trackElement.src = activeSubtitle.url;
829
1096
  trackElement.default = false;
830
1097
  videoRef.appendChild(trackElement);
831
- const textTrack = Array.from(videoRef.textTracks).find((track) => track.label === activeSubtitle.label);
832
- if (textTrack) {
833
- textTrack.mode = "showing";
834
- console.log("Subtitle track activated:", activeSubtitle.label);
835
- }
1098
+ Array.from(videoRef.textTracks).find((track) => track.label === activeSubtitle.label);
1099
+ const handleTrackLoad = () => {
1100
+ const textTrack = Array.from(videoRef.textTracks).find((track) => track.label === activeSubtitle.label);
1101
+ if (textTrack) {
1102
+ textTrack.mode = "showing";
1103
+ console.log("Subtitle track loaded for custom rendering:", activeSubtitle.label);
1104
+ }
1105
+ };
1106
+ trackElement.addEventListener("load", handleTrackLoad);
1107
+ const attempts = [100, 500, 1000];
1108
+ attempts.forEach((delay) => {
1109
+ setTimeout(() => {
1110
+ const textTrack = Array.from(videoRef.textTracks).find((track) => track.label === activeSubtitle.label);
1111
+ if (textTrack && textTrack.mode !== "showing") {
1112
+ textTrack.mode = "showing";
1113
+ }
1114
+ }, delay);
1115
+ });
836
1116
  }
837
1117
  }
838
1118
  else {
@@ -841,8 +1121,61 @@ const VideoPlayer = ({ trackSrc, trackTitle, intro, onClose, trackPoster, isTrai
841
1121
  });
842
1122
  }
843
1123
  }
844
- }, [activeSubtitle, videoRef, subtitles]);
845
- // === TRACKING (play/pause/watchtime) ===
1124
+ }, [videoRef, activeSubtitle, subtitles]);
1125
+ useEffect(() => {
1126
+ if (subtitles) {
1127
+ setSubtitles(subtitles);
1128
+ }
1129
+ }, [subtitles, setSubtitles]);
1130
+ };
1131
+
1132
+ const useSubtitleStyling = (config) => {
1133
+ const { videoRef } = useVideoStore();
1134
+ useEffect(() => {
1135
+ if (!videoRef)
1136
+ return;
1137
+ const applySubtitleStyles = () => {
1138
+ const style = document.createElement("style");
1139
+ style.id = "custom-subtitle-styles";
1140
+ const existingStyle = document.getElementById("custom-subtitle-styles");
1141
+ if (existingStyle) {
1142
+ existingStyle.remove();
1143
+ }
1144
+ const styles = `
1145
+ .video-player video::cue {
1146
+ font-size: ${config?.fontSize || "1.75rem"} !important;
1147
+ background: ${config?.backgroundColor ||
1148
+ "linear-gradient(135deg, #fbbf24, #f59e0b)"} !important;
1149
+ color: ${config?.textColor || "#000000"} !important;
1150
+ border-radius: ${config?.borderRadius || "12px"} !important;
1151
+ padding: ${config?.padding || "12px 20px"} !important;
1152
+ max-width: ${config?.maxWidth || "80%"} !important;
1153
+ ${config?.position === "top"
1154
+ ? "top: 10% !important; bottom: auto !important;"
1155
+ : ""}
1156
+ ${config?.position === "center"
1157
+ ? "top: 50% !important; bottom: auto !important; transform: translateX(-50%) translateY(-50%) !important;"
1158
+ : ""}
1159
+ ${config?.position === "bottom" || !config?.position
1160
+ ? "bottom: 15% !important; top: auto !important;"
1161
+ : ""}
1162
+ }
1163
+ `;
1164
+ style.textContent = styles;
1165
+ document.head.appendChild(style);
1166
+ };
1167
+ applySubtitleStyles();
1168
+ return () => {
1169
+ const existingStyle = document.getElementById("custom-subtitle-styles");
1170
+ if (existingStyle) {
1171
+ existingStyle.remove();
1172
+ }
1173
+ };
1174
+ }, [videoRef, config]);
1175
+ };
1176
+
1177
+ const useVideoTracking = (tracking, episodeList, currentEpisodeIndex, onClose) => {
1178
+ const { videoRef, setIsPlaying, setShowCountdown } = useVideoStore();
846
1179
  const startTime = useRef(null);
847
1180
  const isViewCounted = useRef(false);
848
1181
  useEffect(() => {
@@ -889,43 +1222,43 @@ const VideoPlayer = ({ trackSrc, trackTitle, intro, onClose, trackPoster, isTrai
889
1222
  videoRef.removeEventListener("pause", onPause);
890
1223
  videoRef.removeEventListener("ended", onEnded);
891
1224
  };
892
- }, [videoRef, episodeList, currentEpisodeIndex, onClose]);
893
- // === BEFORE UNLOAD ===
894
- const handleUnload = (e) => {
895
- e.preventDefault();
896
- if (startTime.current) {
897
- const elapsedTime = (Date.now() - startTime.current) / 1000;
898
- const getCurrentTime = localStorage.getItem("current_time");
899
- localStorage.setItem("current_time", (Number(getCurrentTime || 0) + elapsedTime).toString());
900
- }
901
- const totalTimeWatched = Number(localStorage.getItem("current_time") || 0);
902
- if (totalTimeWatched >= 30) {
903
- tracking?.onWatchTimeUpdated?.({
904
- watchTime: totalTimeWatched,
905
- });
906
- }
907
- localStorage.setItem("current_time", "0");
908
- };
1225
+ }, [
1226
+ videoRef,
1227
+ episodeList,
1228
+ currentEpisodeIndex,
1229
+ onClose,
1230
+ tracking,
1231
+ setIsPlaying,
1232
+ setShowCountdown,
1233
+ ]);
909
1234
  useEffect(() => {
1235
+ const handleUnload = (e) => {
1236
+ e.preventDefault();
1237
+ if (startTime.current) {
1238
+ const elapsedTime = (Date.now() - startTime.current) / 1000;
1239
+ const getCurrentTime = localStorage.getItem("current_time");
1240
+ localStorage.setItem("current_time", (Number(getCurrentTime || 0) + elapsedTime).toString());
1241
+ }
1242
+ const totalTimeWatched = Number(localStorage.getItem("current_time") || 0);
1243
+ if (totalTimeWatched >= 30) {
1244
+ tracking?.onWatchTimeUpdated?.({
1245
+ watchTime: totalTimeWatched,
1246
+ });
1247
+ }
1248
+ localStorage.setItem("current_time", "0");
1249
+ };
910
1250
  window.addEventListener("beforeunload", handleUnload);
911
1251
  window.addEventListener("unload", handleUnload);
912
1252
  return () => {
913
1253
  window.removeEventListener("beforeunload", handleUnload);
914
1254
  window.removeEventListener("unload", handleUnload);
915
1255
  };
916
- }, [startTime]);
917
- useEffect(() => {
918
- if (subtitles) {
919
- setSubtitles(subtitles);
920
- }
921
- if (episodeList) {
922
- setEpisodeList(episodeList);
923
- }
924
- if (currentEpisodeIndex !== undefined) {
925
- setCurrentEpisodeIndex(currentEpisodeIndex);
926
- }
927
- }, [subtitles, episodeList, currentEpisodeIndex]);
928
- // === INTRO LOGIC ===
1256
+ }, [tracking]);
1257
+ };
1258
+
1259
+ const useIntroSkip = (intro) => {
1260
+ const { videoRef } = useVideoStore();
1261
+ const [showSkipIntro, setShowSkipIntro] = useState(false);
929
1262
  useEffect(() => {
930
1263
  if (!videoRef || !intro)
931
1264
  return;
@@ -949,13 +1282,32 @@ const VideoPlayer = ({ trackSrc, trackTitle, intro, onClose, trackPoster, isTrai
949
1282
  setShowSkipIntro(false);
950
1283
  }
951
1284
  };
952
- // === NEXT EPISODE LOGIC (Backend Dependent) ===
1285
+ return {
1286
+ showSkipIntro,
1287
+ handleSkipIntro,
1288
+ };
1289
+ };
1290
+
1291
+ const useEpisodes = (episodeList, currentEpisodeIndex, nextEpisodeConfig) => {
1292
+ const { videoRef, setEpisodeList, setCurrentEpisodeIndex, setShowCountdown } = useVideoStore();
1293
+ useEffect(() => {
1294
+ if (episodeList) {
1295
+ setEpisodeList(episodeList);
1296
+ }
1297
+ if (currentEpisodeIndex !== undefined) {
1298
+ setCurrentEpisodeIndex(currentEpisodeIndex);
1299
+ }
1300
+ }, [
1301
+ episodeList,
1302
+ currentEpisodeIndex,
1303
+ setEpisodeList,
1304
+ setCurrentEpisodeIndex,
1305
+ ]);
953
1306
  useEffect(() => {
954
1307
  if (!videoRef || !nextEpisodeConfig)
955
1308
  return;
956
1309
  const checkNextEpisode = () => {
957
1310
  const currentTime = videoRef.currentTime || 0;
958
- // Show based on backend config
959
1311
  if (nextEpisodeConfig.showAtEnd && videoRef.ended) {
960
1312
  setShowCountdown(true);
961
1313
  }
@@ -970,25 +1322,53 @@ const VideoPlayer = ({ trackSrc, trackTitle, intro, onClose, trackPoster, isTrai
970
1322
  videoRef.removeEventListener("timeupdate", checkNextEpisode);
971
1323
  videoRef.removeEventListener("ended", checkNextEpisode);
972
1324
  };
973
- }, [videoRef, nextEpisodeConfig]);
974
- return (React__default.createElement("div", { ref: setVideoWrapperRef, className: `${height || "h-full"} ${width || "w-full"} mx-auto absolute` },
975
- React__default.createElement("video", { ref: setVideoRef, className: `w-full h-full relative ${className} [&::cue]:absolute
976
- [&::cue]:top-[6%]
977
- [&::cue]:text-xl
978
- [&::cue]:bg-gray-50
979
- [&::cue]:text-[#1E1E1E]
980
- [&::cue]:px-2
981
- [&::cue]:py-1
982
- [&::cue]:rounded-md`, poster: trackPoster, autoPlay: true, crossOrigin: "anonymous", onContextMenu: onRightClick, onTimeUpdate: (e) => {
983
- if (e?.currentTarget?.currentTime) {
984
- setCurrentTime(e?.currentTarget?.currentTime);
985
- }
986
- }, onLoadedMetadata: (e) => {
987
- if (e?.currentTarget?.duration) {
988
- localStorage.setItem("current_time", "0");
989
- setDuration(e?.currentTarget?.duration);
990
- }
991
- } }),
1325
+ }, [videoRef, nextEpisodeConfig, setShowCountdown]);
1326
+ };
1327
+
1328
+ const useVideoEvents = () => {
1329
+ const { setCurrentTime, setDuration } = useVideoStore();
1330
+ const onRightClick = (e) => {
1331
+ e.preventDefault();
1332
+ };
1333
+ const onSeeked = (e) => {
1334
+ if (e?.currentTarget?.currentTime) {
1335
+ setCurrentTime(e?.currentTarget?.currentTime);
1336
+ }
1337
+ };
1338
+ const onTimeUpdate = (e) => {
1339
+ if (e?.currentTarget?.currentTime) {
1340
+ setCurrentTime(e?.currentTarget?.currentTime);
1341
+ }
1342
+ };
1343
+ const onLoadedMetadata = (e) => {
1344
+ if (e?.currentTarget?.duration) {
1345
+ localStorage.setItem("current_time", "0");
1346
+ setDuration(e?.currentTarget?.duration);
1347
+ }
1348
+ };
1349
+ return {
1350
+ onRightClick,
1351
+ onSeeked,
1352
+ onTimeUpdate,
1353
+ onLoadedMetadata,
1354
+ };
1355
+ };
1356
+
1357
+ var css_248z = ".video-player video::cue {\n display: none !important;\n opacity: 0 !important;\n visibility: hidden !important;\n}\n\n.custom-subtitle-overlay {\n position: absolute;\n bottom: 10%;\n left: 50%;\n transform: translateX(-50%);\n\n font-size: 1.5rem;\n font-weight: 600;\n line-height: 1.4;\n text-align: center;\n\n color: #000;\n background: rgba(255, 255, 255, 0.6);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n\n padding: 10px 16px;\n border-radius: 10px;\n border: 1px solid rgba(0, 0, 0, 0.1);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);\n\n max-width: 70%;\n min-width: fit-content;\n\n transition: all 0.2s ease-in-out;\n}\n\n.custom-subtitle-overlay:hover {\n transform: translateX(-50%) scale(1.02);\n box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);\n}\n\n@media (max-width: 768px) {\n .custom-subtitle-overlay {\n font-size: 1.25rem;\n padding: 8px 14px;\n bottom: 8%;\n max-width: 85%;\n }\n}\n\n@media (max-width: 480px) {\n .custom-subtitle-overlay {\n font-size: 1rem;\n padding: 6px 10px;\n bottom: 6%;\n max-width: 90%;\n }\n}\n\n@media (prefers-contrast: high) {\n .custom-subtitle-overlay {\n background: #ffff00;\n color: #000;\n border: 3px solid #000;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .custom-subtitle-overlay {\n transition: none;\n }\n\n .custom-subtitle-overlay:hover {\n transform: translateX(-50%);\n }\n}\n";
1358
+ styleInject(css_248z,{"insertAt":"top"});
1359
+
1360
+ const VideoPlayer = ({ trackSrc, trackTitle, intro, onClose, trackPoster, isTrailer, className, type, height, width, timeCodes, getPreviewScreenUrl, tracking, subtitles, episodeList, currentEpisodeIndex = 0, nextEpisodeConfig, subtitleStyle, }) => {
1361
+ const { setVideoRef, setVideoWrapperRef, videoRef } = useVideoStore();
1362
+ useVideoSource(trackSrc, type);
1363
+ useSubtitles(subtitles);
1364
+ useSubtitleStyling(subtitleStyle);
1365
+ useVideoTracking(tracking, episodeList, currentEpisodeIndex, onClose);
1366
+ const { showSkipIntro, handleSkipIntro } = useIntroSkip(intro);
1367
+ useEpisodes(episodeList, currentEpisodeIndex, nextEpisodeConfig);
1368
+ const { onSeeked, onTimeUpdate, onLoadedMetadata } = useVideoEvents();
1369
+ return (React__default.createElement("div", { ref: setVideoWrapperRef, className: `video-player ${height || "h-full"} ${width || "w-full"} mx-auto absolute` },
1370
+ trackPoster && (React__default.createElement("div", { className: "pip-poster absolute inset-0 bg-center bg-cover hidden", style: { backgroundImage: `url(${trackPoster})` } })),
1371
+ React__default.createElement("video", { autoPlay: true, muted: true, playsInline: true, preload: "metadata", ref: setVideoRef, onSeeked: onSeeked, poster: trackPoster, crossOrigin: "anonymous", controls: false, disableRemotePlayback: true, controlsList: "nodownload", onContextMenu: (e) => e.preventDefault(), onTimeUpdate: onTimeUpdate, onLoadedMetadata: onLoadedMetadata, className: `w-full h-full relative ${className}` }),
992
1372
  React__default.createElement(Overlay, { config: {
993
1373
  headerConfig: {
994
1374
  config: {
@@ -1008,6 +1388,7 @@ const VideoPlayer = ({ trackSrc, trackTitle, intro, onClose, trackPoster, isTrai
1008
1388
  },
1009
1389
  },
1010
1390
  } }),
1391
+ React__default.createElement(SubtitleOverlay, { styleConfig: subtitleStyle }),
1011
1392
  showSkipIntro && (React__default.createElement(VideoActionButton, { text: "Skip Intro", onClick: handleSkipIntro, position: "left" }))));
1012
1393
  };
1013
1394