@mottosports/motto-video-player 1.0.1-rc.5 → 1.0.1-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -13
- package/dist/index.d.ts +1 -13
- package/dist/index.js +121 -173
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +94 -144
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["#style-inject:#style-inject","../src/index.css","../src/Player.tsx","../src/hooks/useShakePlayer.ts","../src/hooks/useQualityControl.ts","../src/hooks/useSkipControls.ts","../src/hooks/useMuxAnalytics.ts","../src/hooks/useShakaUI.ts","../src/hooks/useEventHandlers.ts","../src/hooks/useLiveBadge.ts","../src/hooks/usePosterFallback.ts","../src/hooks/useLiveIndicator.ts","../src/hooks/useShakaAbsoluteTime.ts","../src/components/Loading.tsx","../src/components/ErrorScreen.tsx","../src/components/Title.tsx","../src/components/LiveBadge.tsx","../src/styles.css","../src/ClientOnlyPlayer.tsx","../src/Video.tsx","../src/api/video.ts","../src/api/event.ts","../src/api/creative-work.ts","../src/helper.ts","../src/messages/useMessages.tsx","../src/messages/en.json","../src/messages/es.json","../src/messages/ar.json","../src/messages/de.json","../src/messages/fr.json","../src/messages/it.json","../src/messages/ja.json","../src/messages/ko.json","../src/messages/pt.json","../src/messages/ru.json","../src/messages/zh.json","../src/messages/nl.json","../src/messages/fa.json","../src/Event.tsx","../src/CreativeWork.tsx","../src/ClientSideEvent.tsx","../src/QueryProvider.tsx","../src/index.ts"],"sourcesContent":["\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\"/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */\\n@layer properties;\\n@layer theme, base, components, utilities;\\n@layer theme {\\n :root,\\n :host {\\n --font-sans:\\n ui-sans-serif,\\n system-ui,\\n sans-serif,\\n \\\"Apple Color Emoji\\\",\\n \\\"Segoe UI Emoji\\\",\\n \\\"Segoe UI Symbol\\\",\\n \\\"Noto Color Emoji\\\";\\n --font-mono:\\n ui-monospace,\\n SFMono-Regular,\\n Menlo,\\n Monaco,\\n Consolas,\\n \\\"Liberation Mono\\\",\\n \\\"Courier New\\\",\\n monospace;\\n --color-red-600: oklch(57.7% 0.245 27.325);\\n --color-black: #000;\\n --color-white: #fff;\\n --spacing: 0.25rem;\\n --container-4xl: 56rem;\\n --text-xs: 0.75rem;\\n --text-xs--line-height: calc(1 / 0.75);\\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-5xl: 3rem;\\n --text-5xl--line-height: 1;\\n --font-weight-medium: 500;\\n --font-weight-semibold: 600;\\n --font-weight-bold: 700;\\n --tracking-wide: 0.025em;\\n --tracking-widest: 0.1em;\\n --radius-md: 0.375rem;\\n --radius-2xl: 1rem;\\n --animate-spin: spin 1s linear infinite;\\n --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\\n --aspect-video: 16 / 9;\\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 *,\\n ::after,\\n ::before,\\n ::backdrop,\\n ::file-selector-button {\\n box-sizing: border-box;\\n margin: 0;\\n padding: 0;\\n border: 0 solid;\\n }\\n html,\\n :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,\\n h2,\\n h3,\\n h4,\\n h5,\\n 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,\\n strong {\\n font-weight: bolder;\\n }\\n code,\\n kbd,\\n samp,\\n 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,\\n 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,\\n ul,\\n menu {\\n list-style: none;\\n }\\n img,\\n svg,\\n video,\\n canvas,\\n audio,\\n iframe,\\n embed,\\n object {\\n display: block;\\n vertical-align: middle;\\n }\\n img,\\n video {\\n max-width: 100%;\\n height: auto;\\n }\\n button,\\n input,\\n select,\\n optgroup,\\n textarea,\\n ::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,\\n ::-webkit-datetime-edit-year-field,\\n ::-webkit-datetime-edit-month-field,\\n ::-webkit-datetime-edit-day-field,\\n ::-webkit-datetime-edit-hour-field,\\n ::-webkit-datetime-edit-minute-field,\\n ::-webkit-datetime-edit-second-field,\\n ::-webkit-datetime-edit-millisecond-field,\\n ::-webkit-datetime-edit-meridiem-field {\\n padding-block: 0;\\n }\\n :-moz-ui-invalid {\\n box-shadow: none;\\n }\\n button,\\n input:where([type=button], [type=reset], [type=submit]),\\n ::file-selector-button {\\n appearance: button;\\n }\\n ::-webkit-inner-spin-button,\\n ::-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-auto {\\n pointer-events: auto;\\n }\\n .pointer-events-none {\\n pointer-events: none;\\n }\\n .visible {\\n visibility: visible;\\n }\\n .sr-only {\\n position: absolute;\\n width: 1px;\\n height: 1px;\\n padding: 0;\\n margin: -1px;\\n overflow: hidden;\\n clip: rect(0, 0, 0, 0);\\n white-space: nowrap;\\n border-width: 0;\\n }\\n .absolute {\\n position: absolute;\\n }\\n .fixed {\\n position: fixed;\\n }\\n .relative {\\n position: relative;\\n }\\n .static {\\n position: static;\\n }\\n .inset-0 {\\n inset: calc(var(--spacing) * 0);\\n }\\n .top-0 {\\n top: calc(var(--spacing) * 0);\\n }\\n .top-4 {\\n top: calc(var(--spacing) * 4);\\n }\\n .right-0 {\\n right: calc(var(--spacing) * 0);\\n }\\n .right-4 {\\n right: calc(var(--spacing) * 4);\\n }\\n .bottom-0 {\\n bottom: calc(var(--spacing) * 0);\\n }\\n .bottom-4 {\\n bottom: calc(var(--spacing) * 4);\\n }\\n .left-0 {\\n left: calc(var(--spacing) * 0);\\n }\\n .left-4 {\\n left: calc(var(--spacing) * 4);\\n }\\n .z-10 {\\n z-index: 10;\\n }\\n .z-50 {\\n z-index: 50;\\n }\\n .container {\\n width: 100%;\\n @media (width >= 40rem) {\\n max-width: 40rem;\\n }\\n @media (width >= 48rem) {\\n max-width: 48rem;\\n }\\n @media (width >= 64rem) {\\n max-width: 64rem;\\n }\\n @media (width >= 80rem) {\\n max-width: 80rem;\\n }\\n @media (width >= 96rem) {\\n max-width: 96rem;\\n }\\n }\\n .m-6 {\\n margin: calc(var(--spacing) * 6);\\n }\\n .mt-1 {\\n margin-top: calc(var(--spacing) * 1);\\n }\\n .mt-3 {\\n margin-top: calc(var(--spacing) * 3);\\n }\\n .mb-2 {\\n margin-bottom: calc(var(--spacing) * 2);\\n }\\n .mb-6 {\\n margin-bottom: calc(var(--spacing) * 6);\\n }\\n .flex {\\n display: flex;\\n }\\n .grid {\\n display: grid;\\n }\\n .hidden {\\n display: none;\\n }\\n .aspect-video {\\n aspect-ratio: var(--aspect-video);\\n }\\n .h-2 {\\n height: calc(var(--spacing) * 2);\\n }\\n .h-8 {\\n height: calc(var(--spacing) * 8);\\n }\\n .h-24 {\\n height: calc(var(--spacing) * 24);\\n }\\n .h-full {\\n height: 100%;\\n }\\n .w-2 {\\n width: calc(var(--spacing) * 2);\\n }\\n .w-8 {\\n width: calc(var(--spacing) * 8);\\n }\\n .w-24 {\\n width: calc(var(--spacing) * 24);\\n }\\n .w-full {\\n width: 100%;\\n }\\n .max-w-4xl {\\n max-width: var(--container-4xl);\\n }\\n .animate-pulse {\\n animation: var(--animate-pulse);\\n }\\n .animate-spin {\\n animation: var(--animate-spin);\\n }\\n .auto-cols-max {\\n grid-auto-columns: max-content;\\n }\\n .grid-flow-col {\\n grid-auto-flow: column;\\n }\\n .flex-col {\\n flex-direction: column;\\n }\\n .items-center {\\n align-items: center;\\n }\\n .justify-center {\\n justify-content: center;\\n }\\n .justify-stretch {\\n justify-content: stretch;\\n }\\n .gap-1 {\\n gap: calc(var(--spacing) * 1);\\n }\\n .gap-5 {\\n gap: calc(var(--spacing) * 5);\\n }\\n .overflow-hidden {\\n overflow: hidden;\\n }\\n .rounded-full {\\n border-radius: calc(infinity * 1px);\\n }\\n .rounded-md {\\n border-radius: var(--radius-md);\\n }\\n .border-b-2 {\\n border-bottom-style: var(--tw-border-style);\\n border-bottom-width: 2px;\\n }\\n .border-white {\\n border-color: var(--color-white);\\n }\\n .bg-\\\\[\\\\#151515\\\\] {\\n background-color: #151515;\\n }\\n .bg-black {\\n background-color: var(--color-black);\\n }\\n .bg-red-600 {\\n background-color: var(--color-red-600);\\n }\\n .bg-white {\\n background-color: var(--color-white);\\n }\\n .bg-gradient-to-t {\\n --tw-gradient-position: to top in oklab;\\n background-image: linear-gradient(var(--tw-gradient-stops));\\n }\\n .from-black\\\\/70 {\\n --tw-gradient-from: color-mix(in srgb, #000 70%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n --tw-gradient-from: color-mix(in oklab, var(--color-black) 70%, transparent);\\n }\\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 .to-transparent {\\n --tw-gradient-to: transparent;\\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 .bg-no-repeat {\\n background-repeat: no-repeat;\\n }\\n .p-2 {\\n padding: calc(var(--spacing) * 2);\\n }\\n .p-4 {\\n padding: calc(var(--spacing) * 4);\\n }\\n .px-2 {\\n padding-inline: calc(var(--spacing) * 2);\\n }\\n .px-4 {\\n padding-inline: calc(var(--spacing) * 4);\\n }\\n .py-1 {\\n padding-block: calc(var(--spacing) * 1);\\n }\\n .text-center {\\n text-align: center;\\n }\\n .text-left {\\n text-align: left;\\n }\\n .font-mono {\\n font-family: var(--font-mono);\\n }\\n .text-2xl {\\n font-size: var(--text-2xl);\\n line-height: var(--tw-leading, var(--text-2xl--line-height));\\n }\\n .text-5xl {\\n font-size: var(--text-5xl);\\n line-height: var(--tw-leading, var(--text-5xl--line-height));\\n }\\n .text-base {\\n font-size: var(--text-base);\\n line-height: var(--tw-leading, var(--text-base--line-height));\\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 .text-xs {\\n font-size: var(--text-xs);\\n line-height: var(--tw-leading, var(--text-xs--line-height));\\n }\\n .text-\\\\[10px\\\\] {\\n font-size: 10px;\\n }\\n .font-bold {\\n --tw-font-weight: var(--font-weight-bold);\\n font-weight: var(--font-weight-bold);\\n }\\n .font-medium {\\n --tw-font-weight: var(--font-weight-medium);\\n font-weight: var(--font-weight-medium);\\n }\\n .font-semibold {\\n --tw-font-weight: var(--font-weight-semibold);\\n font-weight: var(--font-weight-semibold);\\n }\\n .tracking-wide {\\n --tw-tracking: var(--tracking-wide);\\n letter-spacing: var(--tracking-wide);\\n }\\n .tracking-widest {\\n --tw-tracking: var(--tracking-widest);\\n letter-spacing: var(--tracking-widest);\\n }\\n .text-white {\\n color: var(--color-white);\\n }\\n .uppercase {\\n text-transform: uppercase;\\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:\\n var(--tw-inset-shadow),\\n var(--tw-inset-ring-shadow),\\n var(--tw-ring-offset-shadow),\\n var(--tw-ring-shadow),\\n var(--tw-shadow);\\n }\\n .filter {\\n filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);\\n }\\n .md\\\\:rounded-2xl {\\n @media (width >= 48rem) {\\n border-radius: var(--radius-2xl);\\n }\\n }\\n .md\\\\:rounded-2xl\\\\! {\\n @media (width >= 48rem) {\\n border-radius: var(--radius-2xl) !important;\\n }\\n }\\n .md\\\\:text-base {\\n @media (width >= 48rem) {\\n font-size: var(--text-base);\\n line-height: var(--tw-leading, var(--text-base--line-height));\\n }\\n }\\n .md\\\\:text-sm {\\n @media (width >= 48rem) {\\n font-size: var(--text-sm);\\n line-height: var(--tw-leading, var(--text-sm--line-height));\\n }\\n }\\n .md\\\\:text-xl {\\n @media (width >= 48rem) {\\n font-size: var(--text-xl);\\n line-height: var(--tw-leading, var(--text-xl--line-height));\\n }\\n }\\n}\\n@layer components {\\n .motto-video-container {\\n position: relative;\\n width: 100%;\\n min-height: 300px;\\n }\\n @supports (aspect-ratio: 16/9) {\\n .motto-video-container {\\n min-height: auto;\\n }\\n }\\n .motto-video-responsive {\\n position: absolute;\\n top: calc(var(--spacing) * 0);\\n left: calc(var(--spacing) * 0);\\n height: 100%;\\n width: 100%;\\n }\\n .motto-skip-button {\\n position: absolute;\\n top: calc(1/2 * 100%);\\n z-index: 10;\\n display: flex;\\n height: calc(var(--spacing) * 16);\\n width: calc(var(--spacing) * 16);\\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\\n translate: var(--tw-translate-x) var(--tw-translate-y);\\n cursor: pointer;\\n align-items: center;\\n justify-content: center;\\n border-radius: calc(infinity * 1px);\\n border-style: var(--tw-border-style);\\n border-width: 0px;\\n background-color: color-mix(in srgb, #000 70%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n background-color: color-mix(in oklab, var(--color-black) 70%, transparent);\\n }\\n font-size: var(--text-2xl);\\n line-height: var(--tw-leading, var(--text-2xl--line-height));\\n color: var(--color-white);\\n opacity: 80%;\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n &:hover {\\n @media (hover: hover) {\\n --tw-scale-x: 110%;\\n --tw-scale-y: 110%;\\n --tw-scale-z: 110%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n }\\n &:hover {\\n @media (hover: hover) {\\n opacity: 100%;\\n }\\n }\\n &:active {\\n --tw-scale-x: 95%;\\n --tw-scale-y: 95%;\\n --tw-scale-z: 95%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n }\\n .motto-skip-button-back {\\n left: calc(var(--spacing) * 5);\\n }\\n .motto-skip-button-forward {\\n right: calc(var(--spacing) * 5);\\n }\\n .motto-mobile-controls-overlay {\\n position: absolute;\\n inset: calc(var(--spacing) * 0);\\n z-index: 20;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\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 --tw-duration: 300ms;\\n transition-duration: 300ms;\\n pointer-events: none;\\n }\\n .motto-mobile-controls-group {\\n display: flex;\\n align-items: center;\\n gap: calc(var(--spacing) * 8);\\n opacity: 100%;\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n pointer-events: none;\\n }\\n .motto-mobile-play-button {\\n display: flex;\\n height: calc(var(--spacing) * 14);\\n width: calc(var(--spacing) * 14);\\n cursor: pointer;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n border-radius: calc(infinity * 1px);\\n border-style: var(--tw-border-style);\\n border-width: 0px;\\n background-color: color-mix(in srgb, #000 30%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n background-color: color-mix(in oklab, var(--color-black) 30%, transparent);\\n }\\n color: var(--color-white);\\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:\\n var(--tw-inset-shadow),\\n var(--tw-inset-ring-shadow),\\n var(--tw-ring-offset-shadow),\\n var(--tw-ring-shadow),\\n var(--tw-shadow);\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n pointer-events: auto;\\n }\\n .motto-mobile-play-button:active {\\n --tw-scale-x: 95%;\\n --tw-scale-y: 95%;\\n --tw-scale-z: 95%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n .motto-mobile-play-button svg {\\n height: calc(var(--spacing) * 7);\\n width: calc(var(--spacing) * 7);\\n }\\n .motto-mobile-skip-button {\\n display: flex;\\n height: calc(var(--spacing) * 10);\\n width: calc(var(--spacing) * 10);\\n cursor: pointer;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n border-radius: calc(infinity * 1px);\\n border-style: var(--tw-border-style);\\n border-width: 0px;\\n background-color: color-mix(in srgb, #000 30%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n background-color: color-mix(in oklab, var(--color-black) 30%, transparent);\\n }\\n color: var(--color-white);\\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:\\n var(--tw-inset-shadow),\\n var(--tw-inset-ring-shadow),\\n var(--tw-ring-offset-shadow),\\n var(--tw-ring-shadow),\\n var(--tw-shadow);\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n pointer-events: auto;\\n }\\n .motto-mobile-skip-button:active {\\n --tw-scale-x: 95%;\\n --tw-scale-y: 95%;\\n --tw-scale-z: 95%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n .motto-mobile-skip-button svg {\\n height: calc(var(--spacing) * 6);\\n width: calc(var(--spacing) * 6);\\n }\\n}\\n@media (min-width: 768px) {\\n .motto-mobile-controls-overlay {\\n display: none !important;\\n }\\n}\\n@media (max-width: 767px) {\\n .shaka-controls-container .motto-native-skip-button,\\n .shaka-controls-container .motto-skip-back-button,\\n .shaka-controls-container .motto-skip-forward-button,\\n .shaka-controls-container .shaka-button[title*=\\\"Skip back\\\"],\\n .shaka-controls-container .shaka-button[title*=\\\"Skip forward\\\"],\\n .shaka-controls-container .shaka-button[aria-label*=\\\"Skip back\\\"],\\n .shaka-controls-container .shaka-button[aria-label*=\\\"Skip forward\\\"],\\n .shaka-controls-container button[title*=\\\"Skip back\\\"],\\n .shaka-controls-container button[title*=\\\"Skip forward\\\"],\\n .shaka-controls-container button[aria-label*=\\\"Skip back\\\"],\\n .shaka-controls-container button[aria-label*=\\\"Skip forward\\\"],\\n .motto-native-skip-button:not(.motto-mobile-skip-button),\\n .motto-skip-back-button:not(.motto-mobile-skip-button),\\n .motto-skip-forward-button:not(.motto-mobile-skip-button),\\n .shaka-button[title*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n .shaka-button[title*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button),\\n .shaka-button[aria-label*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n .shaka-button[aria-label*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button),\\n button[title*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n button[title*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button),\\n button[aria-label*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n button[aria-label*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button) {\\n display: none !important;\\n visibility: hidden !important;\\n opacity: 0 !important;\\n width: 0 !important;\\n height: 0 !important;\\n padding: 0 !important;\\n margin: 0 !important;\\n }\\n .shaka-controls-container {\\n z-index: 90 !important;\\n height: 100px !important;\\n bottom: 0 !important;\\n top: unset !important;\\n }\\n .motto-mobile-skip-button {\\n display: flex !important;\\n visibility: visible !important;\\n opacity: 1 !important;\\n }\\n}\\n.shaka-seek-bar-container {\\n height: 6px !important;\\n width: 100% !important;\\n margin: 8px 0 !important;\\n border-radius: 4px !important;\\n position: relative !important;\\n border-top: none !important;\\n border-bottom: none !important;\\n box-shadow: none !important;\\n}\\n.shaka-seek-bar {\\n height: 6px !important;\\n width: 100% !important;\\n -webkit-appearance: none !important;\\n appearance: none !important;\\n background: transparent !important;\\n cursor: pointer !important;\\n border: none !important;\\n outline: none !important;\\n position: absolute !important;\\n top: 0 !important;\\n left: 0 !important;\\n border-radius: 4px !important;\\n}\\n.shaka-seek-bar::-webkit-slider-runnable-track {\\n height: 6px !important;\\n background: transparent !important;\\n border-radius: 4px !important;\\n border: none !important;\\n}\\n.shaka-seek-bar::-moz-range-track {\\n height: 6px !important;\\n background: transparent !important;\\n border-radius: 4px !important;\\n border: none !important;\\n}\\n.shaka-seek-bar::-webkit-slider-thumb {\\n -webkit-appearance: none !important;\\n appearance: none !important;\\n width: 16px !important;\\n height: 16px !important;\\n border-radius: 50% !important;\\n background: #ffffff !important;\\n cursor: pointer !important;\\n border: 2px solid #ffffff !important;\\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;\\n margin-top: -4px !important;\\n}\\n.shaka-seek-bar::-moz-range-thumb {\\n width: 16px !important;\\n height: 16px !important;\\n border-radius: 50% !important;\\n background: #ffffff !important;\\n cursor: pointer !important;\\n border: 2px solid #ffffff !important;\\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;\\n margin-top: -4px !important;\\n}\\n.motto-skip-back-button,\\n.motto-skip-forward-button,\\n.motto-native-skip-button {\\n background: transparent !important;\\n border: none !important;\\n padding: 4px !important;\\n margin: 0px !important;\\n cursor: pointer !important;\\n color: #ffffff !important;\\n transition: all 0.2s ease !important;\\n min-width: 32px !important;\\n height: 32px !important;\\n display: flex !important;\\n align-items: center !important;\\n justify-content: center !important;\\n border-radius: 4px !important;\\n width: 25px;\\n}\\n.motto-skip-back-button:hover,\\n.motto-skip-forward-button:hover,\\n.motto-native-skip-button:hover {\\n opacity: 0.8 !important;\\n background: transparent !important;\\n transform: scale(1.05) !important;\\n}\\n.motto-skip-back-button:active,\\n.motto-skip-forward-button:active,\\n.motto-native-skip-button:active {\\n transform: scale(0.95) !important;\\n}\\n.motto-skip-back-button svg,\\n.motto-skip-forward-button svg,\\n.motto-native-skip-button svg {\\n width: 24px !important;\\n height: 24px !important;\\n}\\n@media (max-width: 767px) {\\n .shaka-controls-container .motto-native-skip-button,\\n .shaka-controls-container .motto-skip-back-button,\\n .shaka-controls-container .motto-skip-forward-button,\\n .shaka-controls-container .shaka-play-button,\\n .shaka-controls-container .shaka-pause-button {\\n display: none !important;\\n }\\n}\\n.shaka-spinner-svg {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-spinner-path {\\n stroke: white !important;\\n fill: none !important;\\n}\\n.shaka-spinner-container {\\n color: white !important;\\n}\\n.shaka-buffering-spinner {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-buffering-spinner svg {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-buffering-spinner path {\\n stroke: white !important;\\n fill: none !important;\\n}\\n[data-shaka-player-container] .shaka-spinner,\\n[data-shaka-player-container] .spinner {\\n color: white !important;\\n border-color: white !important;\\n}\\n.material-icons.shaka-spinner {\\n color: white !important;\\n}\\n.shaka-controls-container .shaka-spinner,\\n.shaka-video-container .shaka-spinner {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-controls-container .shaka-spinner svg,\\n.shaka-video-container .shaka-spinner svg {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-controls-container .shaka-spinner path,\\n.shaka-video-container .shaka-spinner path {\\n stroke: white !important;\\n}\\n.motto-video-loading-overlay {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n background:\\n linear-gradient(\\n 135deg,\\n #1a1a1a 0%,\\n #2d2d2d 100%);\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n z-index: 10;\\n transition: opacity 0.3s ease;\\n}\\n.motto-video-loading-overlay.hidden {\\n opacity: 0;\\n pointer-events: none;\\n}\\n.motto-video-loading-content {\\n text-align: center;\\n color: white;\\n}\\n.motto-video-loading-icon {\\n width: 64px;\\n height: 64px;\\n margin-bottom: 16px;\\n opacity: 0.7;\\n}\\n.motto-video-loading-text {\\n font-size: 16px;\\n font-weight: 500;\\n margin-bottom: 8px;\\n}\\n.motto-video-loading-subtext {\\n font-size: 14px;\\n opacity: 0.7;\\n}\\n@keyframes pulse-live {\\n 0% {\\n opacity: 1;\\n transform: scale(1);\\n }\\n 50% {\\n opacity: 0.7;\\n transform: scale(1.1);\\n }\\n 100% {\\n opacity: 1;\\n transform: scale(1);\\n }\\n}\\n.shaka-play-button-container {\\n display: none !important;\\n}\\n@property --tw-border-style { syntax: \\\"*\\\"; inherits: false; initial-value: solid; }\\n@property --tw-gradient-position { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-gradient-from { syntax: \\\"<color>\\\"; inherits: false; initial-value: #0000; }\\n@property --tw-gradient-via { syntax: \\\"<color>\\\"; inherits: false; initial-value: #0000; }\\n@property --tw-gradient-to { syntax: \\\"<color>\\\"; inherits: false; initial-value: #0000; }\\n@property --tw-gradient-stops { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-gradient-via-stops { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-gradient-from-position { syntax: \\\"<length-percentage>\\\"; inherits: false; initial-value: 0%; }\\n@property --tw-gradient-via-position { syntax: \\\"<length-percentage>\\\"; inherits: false; initial-value: 50%; }\\n@property --tw-gradient-to-position { syntax: \\\"<length-percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-font-weight { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-tracking { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-shadow-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-shadow-alpha { syntax: \\\"<percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-inset-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-inset-shadow-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-inset-shadow-alpha { syntax: \\\"<percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-ring-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-ring-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-inset-ring-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-inset-ring-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-ring-inset { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-ring-offset-width { syntax: \\\"<length>\\\"; inherits: false; initial-value: 0px; }\\n@property --tw-ring-offset-color { syntax: \\\"*\\\"; inherits: false; initial-value: #fff; }\\n@property --tw-ring-offset-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-blur { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-brightness { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-contrast { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-grayscale { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-hue-rotate { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-invert { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-opacity { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-saturate { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-sepia { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-drop-shadow { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-drop-shadow-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-drop-shadow-alpha { syntax: \\\"<percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-drop-shadow-size { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-translate-x { syntax: \\\"*\\\"; inherits: false; initial-value: 0; }\\n@property --tw-translate-y { syntax: \\\"*\\\"; inherits: false; initial-value: 0; }\\n@property --tw-translate-z { syntax: \\\"*\\\"; inherits: false; initial-value: 0; }\\n@property --tw-duration { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-scale-x { syntax: \\\"*\\\"; inherits: false; initial-value: 1; }\\n@property --tw-scale-y { syntax: \\\"*\\\"; inherits: false; initial-value: 1; }\\n@property --tw-scale-z { syntax: \\\"*\\\"; inherits: false; initial-value: 1; }\\n@keyframes spin {\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n@keyframes pulse {\\n 50% {\\n opacity: 0.5;\\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 *,\\n ::before,\\n ::after,\\n ::backdrop {\\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-tracking: 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-blur: initial;\\n --tw-brightness: initial;\\n --tw-contrast: initial;\\n --tw-grayscale: initial;\\n --tw-hue-rotate: initial;\\n --tw-invert: initial;\\n --tw-opacity: initial;\\n --tw-saturate: initial;\\n --tw-sepia: initial;\\n --tw-drop-shadow: initial;\\n --tw-drop-shadow-color: initial;\\n --tw-drop-shadow-alpha: 100%;\\n --tw-drop-shadow-size: initial;\\n --tw-translate-x: 0;\\n --tw-translate-y: 0;\\n --tw-translate-z: 0;\\n --tw-duration: initial;\\n --tw-scale-x: 1;\\n --tw-scale-y: 1;\\n --tw-scale-z: 1;\\n }\\n }\\n}\\n\")","import React, { forwardRef, useEffect, useRef, useImperativeHandle } from 'react';\nimport shaka from 'shaka-player/dist/shaka-player.ui';\nimport { PlayerProps } from './types';\nimport { \n useShakePlayer, \n useQualityControl, \n useSkipControls, \n useMuxAnalytics, \n useShakaUI,\n useEventHandlers,\n useLiveBadge,\n useLiveIndicator,\n useShakaAbsoluteTime\n} from './hooks';\nimport { LiveBadge } from './components';\nimport './styles.css';\nimport { twMerge } from 'tailwind-merge';\n\nexport const Player = forwardRef<HTMLVideoElement, PlayerProps>(\n ({ \n src, \n autoPlay = false, \n loop = false, \n muted = false, \n controls = true,\n poster,\n width,\n height,\n aspectRatio = 16/9,\n shakaConfig,\n drmConfig,\n muxConfig,\n imaConfig,\n chromecastConfig,\n qualityConfig,\n seekbarConfig,\n events,\n containerClassName,\n streamStartDate,\n ...props \n }, ref) => {\n const videoRef = useRef<HTMLVideoElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const adContainerRef = useRef<HTMLDivElement>(null);\n\n useImperativeHandle(ref, () => videoRef.current!, []);\n\n // Initialize custom hooks\n const { playerRef, initializePlayer, destroyPlayer } = useShakePlayer({\n src,\n shakaConfig,\n drmConfig,\n onError: events?.onError,\n onPlayerReady: events?.onPlayerReady\n });\n\n const { \n getAvailableQualities, \n setQuality, \n setupQualityTracking, \n configureQuality \n } = useQualityControl(playerRef, qualityConfig, events?.onQualityChange);\n\n const { \n skipBack, \n skipForward, \n skipDuration, \n shouldShowSkipControls \n } = useSkipControls(videoRef, events?.onSkipBack, events?.onSkipForward);\n\n const { \n initializeMux, \n updateMuxData, \n handleMuxError, \n destroyMux \n } = useMuxAnalytics(playerRef, muxConfig, events?.onMuxReady, events?.onMuxDataUpdate);\n\n const { setupEventListeners, cleanupEventListeners } = useEventHandlers(videoRef, {\n onPlay: events?.onPlay,\n onPause: events?.onPause,\n onEnded: events?.onEnded,\n onLoadStart: events?.onLoadStart,\n onCanPlay: events?.onCanPlay\n });\n\n const { uiRef, initializeUI, destroyUI } = useShakaUI(\n playerRef,\n containerRef,\n videoRef,\n controls,\n chromecastConfig,\n seekbarConfig,\n events?.onSkipBack,\n events?.onSkipForward\n );\n\n // Live badge hook\n const { isLive, isVisible: isLiveBadgeVisible } = useLiveBadge(playerRef, {\n enabled: true,\n onLiveStateChange: (isLive) => {\n events?.onLiveStateChange?.(isLive);\n }\n });\n\n // Live indicator hook\n useLiveIndicator(containerRef, {\n enabled: true,\n indicatorColor: '#ff0000',\n indicatorSize: 8,\n showPulseAnimation: true\n });\n\n // Absolute time hook for live streams\n // This will auto-detect stream start time from manifest, or use manual override if provided\n const { detectedStreamStart, effectiveStreamStart } = useShakaAbsoluteTime({\n player: playerRef.current,\n controls: uiRef.current,\n manualStreamStartDate: streamStartDate\n });\n\n // Initialize ads (simplified - would normally be in a separate hook)\n const initializeAds = () => {\n if (!imaConfig || !playerRef.current || !videoRef.current) return;\n\n const adManager = playerRef.current.getAdManager();\n if (!adManager) return;\n\n // Set up ad event listeners\n adManager.addEventListener((shaka as any).ads?.Utils?.AD_STARTED, () => {\n events?.onAdStart?.();\n });\n\n adManager.addEventListener((shaka as any).ads?.Utils?.AD_COMPLETE, () => {\n events?.onAdComplete?.();\n });\n\n adManager.addEventListener((shaka as any).ads?.Utils?.AD_ERROR, (event: any) => {\n events?.onAdError?.(event.detail);\n });\n\n // Initialize client-side ads if ad tag URL is provided\n if (imaConfig.adTagUrl) {\n const adContainer = adContainerRef.current;\n if (adContainer) {\n adManager.initClientSide(adContainer, videoRef.current, imaConfig.adsRenderingSettings);\n \n const adsRequest = {\n adTagUrl: imaConfig.adTagUrl,\n linearAdSlotWidth: imaConfig.linearAdSlotWidth || width as number || 640,\n linearAdSlotHeight: imaConfig.linearAdSlotHeight || height as number || 360,\n nonLinearAdSlotWidth: imaConfig.nonLinearAdSlotWidth || width as number || 640,\n nonLinearAdSlotHeight: imaConfig.nonLinearAdSlotHeight || 150\n };\n \n adManager.requestClientSideAds(adsRequest as any);\n }\n }\n };\n\n // Initialize chromecast (simplified - would normally be in a separate hook)\n const initializeChromecast = () => {\n if (!chromecastConfig?.enabled) {\n return;\n }\n\n try {\n if (events?.onCastStateChange) {\n setTimeout(() => events.onCastStateChange!(false), 100);\n }\n } catch (error) {\n console.warn('Chromecast initialization failed:', error);\n }\n };\n\n // Main initialization\n useEffect(() => {\n const video = videoRef.current;\n if (!video) return;\n\n const initialize = async () => {\n try {\n // Initialize player\n await initializePlayer(video);\n \n // Setup event listeners\n setupEventListeners();\n \n // Setup quality tracking\n const cleanupQuality = setupQualityTracking();\n \n // Configure quality settings\n configureQuality();\n \n // Initialize UI (seekbar colors are now configured directly in initializeUI)\n await initializeUI();\n \n // Initialize other features\n initializeMux();\n initializeAds();\n initializeChromecast();\n\n } catch (error) {\n console.error('Error during player initialization:', error);\n handleMuxError(error);\n }\n };\n\n initialize();\n\n // Cleanup function\n return () => {\n cleanupEventListeners();\n destroyUI();\n destroyMux();\n destroyPlayer();\n };\n }, [\n src, initializePlayer, setupEventListeners, setupQualityTracking, \n configureQuality, initializeUI, initializeMux, cleanupEventListeners,\n destroyUI, destroyMux, destroyPlayer, handleMuxError, playerRef\n ]);\n\n // Update video properties when they change\n useEffect(() => {\n const video = videoRef.current;\n if (!video) return;\n\n video.autoplay = autoPlay;\n video.loop = loop;\n video.muted = muted;\n video.controls = false; // Always disable native controls since we use Shaka UI\n if (poster) video.poster = poster;\n }, [autoPlay, loop, muted, poster]);\n\n // Expose methods via ref\n useImperativeHandle(ref, () => ({\n ...videoRef.current!,\n // Custom methods for quality control\n getAvailableQualities,\n setQuality,\n // Skip methods\n skipBack,\n skipForward,\n // Mux methods\n updateMuxData,\n // Access to underlying instances\n getPlayer: () => playerRef.current,\n getMuxMonitor: () => null\n }), [getAvailableQualities, setQuality, skipBack, skipForward, updateMuxData]);\n\n // Determine if we're using responsive sizing\n const isResponsive = !width && !height;\n \n // Container classes for responsive or fixed sizing\n const containerClasses = twMerge(containerClassName, 'motto-video-container');\n \n // Container styles - handle both responsive and fixed sizing\n const containerStyle: React.CSSProperties = isResponsive \n ? { \n aspectRatio: aspectRatio.toString(),\n }\n : { width, height };\n\n // Video classes for responsive or fixed sizing \n const videoClasses = isResponsive\n ? 'motto-video-responsive'\n : 'w-full h-full ';\n \n // Video styles for fixed sizing\n const videoStyle: React.CSSProperties = isResponsive\n ? {}\n : { width, height };\n\n return (\n <div \n ref={containerRef}\n className={containerClasses}\n style={containerStyle}\n data-shaka-player-container\n data-shaka-player-cast-receiver-id={chromecastConfig?.receiverApplicationId}\n >\n <video\n ref={videoRef}\n className={videoClasses}\n width={isResponsive ? undefined : width}\n height={isResponsive ? undefined : height}\n style={videoStyle}\n poster={poster}\n controls={false}\n {...props}\n />\n \n {/* Live Badge */}\n <LiveBadge isVisible={isLiveBadgeVisible} />\n {/* <LiveBadge isVisible={true} /> */}\n \n {/* Ad container for IMA */}\n {imaConfig && (\n <div\n ref={adContainerRef}\n className=\"absolute top-0 left-0 w-full h-full pointer-events-auto\"\n />\n )}\n </div>\n );\n }\n);\n\nPlayer.displayName = 'Player'; ","import { useRef, useCallback } from 'react';\nimport { Player as ShakaPlayer, polyfill } from 'shaka-player/dist/shaka-player.ui';\n\ninterface DRMConfig {\n clearKeys?: { [keyId: string]: string };\n servers?: { [keySystem: string]: string };\n}\n\ninterface UseShakePlayerProps {\n src: string;\n shakaConfig?: any;\n drmConfig?: DRMConfig;\n onError?: (error: Error) => void;\n onPlayerReady?: (player: any) => void;\n}\n\nexport const useShakePlayer = ({\n src,\n shakaConfig,\n drmConfig,\n onError,\n onPlayerReady\n}: UseShakePlayerProps) => {\n const playerRef = useRef<any>(null);\n\n const initializePlayer = useCallback(async (video: HTMLVideoElement) => {\n try {\n // Install polyfills\n polyfill.installAll();\n\n // Check for browser support\n if (!ShakaPlayer.isBrowserSupported()) {\n throw new Error('Browser not supported by Shaka Player');\n }\n \n // Create player without media element and attach separately (v4.6+ recommended way)\n // Using type assertion since v4.15.3 has attach method but types may not reflect it\n const player = new ShakaPlayer(video);\n playerRef.current = player;\n \n // Attach to video element to avoid deprecation warning\n await (player as any).attach(video);\n\n // Configure player\n if (shakaConfig) {\n player.configure(shakaConfig);\n }\n\n // Configure DRM\n if (drmConfig) {\n if (drmConfig.clearKeys) {\n player.configure({ 'drm.clearKeys': drmConfig.clearKeys } as any);\n }\n \n if (drmConfig.servers) {\n player.configure({ 'drm.servers': drmConfig.servers } as any);\n }\n }\n\n // Set up error handling\n player.addEventListener('error', (event: any) => {\n const error = event.detail;\n console.error('Shaka Player Error:', error);\n onError?.(new Error(`Shaka Player Error: ${error.message || 'Unknown error'}`));\n });\n\n // Load the manifest\n await player.load(src);\n onPlayerReady?.(player);\n\n return player;\n } catch (error) {\n console.error('Error initializing Shaka Player:', error);\n onError?.(error as Error);\n throw error;\n }\n }, [shakaConfig, drmConfig, src, onError, onPlayerReady]);\n\n const destroyPlayer = useCallback(async () => {\n if (playerRef.current) {\n try {\n await playerRef.current.destroy();\n } catch (error) {\n console.warn('Error destroying Shaka Player:', error);\n } finally {\n playerRef.current = null;\n }\n }\n }, []);\n\n return {\n playerRef,\n initializePlayer,\n destroyPlayer\n };\n}; ","import { useCallback, useRef } from 'react';\n\ninterface QualityConfig {\n enableAdaptation?: boolean;\n selectedQuality?: number;\n availableQualities?: Array<{\n height: number;\n bandwidth: number;\n label: string;\n }>;\n}\n\ninterface Quality {\n height: number;\n bandwidth: number;\n label: string;\n}\n\nexport const useQualityControl = (\n playerRef: React.RefObject<any>,\n qualityConfig?: QualityConfig,\n onQualityChange?: (quality: { height: number; bandwidth: number }) => void\n) => {\n const getAvailableQualities = useCallback((): Quality[] => {\n if (!playerRef.current) return [];\n \n const tracks = playerRef.current.getVariantTracks();\n const qualities = tracks\n .filter((track: any, index: any, self: any) => \n index === self.findIndex((t: any) => t.height === track.height)\n )\n .map((track: any) => ({\n height: track.height || 0,\n bandwidth: track.bandwidth || 0,\n label: `${track.height}p`\n }))\n .sort((a: any, b: any) => b.height - a.height);\n \n return qualities;\n }, [playerRef]);\n\n const setQuality = useCallback((height: number) => {\n if (!playerRef.current) return;\n \n if (height === 0) {\n // Enable adaptive streaming\n playerRef.current.configure({\n abr: { enabled: true }\n });\n } else {\n // Disable adaptive streaming and select specific quality\n playerRef.current.configure({\n abr: { enabled: false }\n });\n \n const tracks = playerRef.current.getVariantTracks();\n const targetTrack = tracks.find((track: any) => track.height === height);\n if (targetTrack) {\n playerRef.current.selectVariantTrack(targetTrack, /* clearBuffer= */ true);\n }\n }\n }, [playerRef]);\n\n const setupQualityTracking = useCallback(() => {\n if (!playerRef.current || !onQualityChange) return;\n\n const handleQualityChange = () => {\n const activeTrack = playerRef.current.getVariantTracks().find((track: any) => track.active);\n if (activeTrack) {\n onQualityChange({\n height: activeTrack.height || 0,\n bandwidth: activeTrack.bandwidth || 0\n });\n }\n };\n\n playerRef.current.addEventListener('variantchanged', handleQualityChange);\n \n return () => {\n playerRef.current?.removeEventListener('variantchanged', handleQualityChange);\n };\n }, [playerRef, onQualityChange]);\n\n const configureQuality = useCallback(() => {\n if (!playerRef.current || !qualityConfig) return;\n\n if (qualityConfig.enableAdaptation !== undefined) {\n playerRef.current.configure({\n abr: { enabled: qualityConfig.enableAdaptation }\n });\n }\n\n if (qualityConfig.selectedQuality !== undefined) {\n setQuality(qualityConfig.selectedQuality);\n }\n }, [playerRef, qualityConfig, setQuality]);\n\n return {\n getAvailableQualities,\n setQuality,\n setupQualityTracking,\n configureQuality\n };\n}; ","import { useCallback } from 'react';\n\nexport const useSkipControls = (\n videoRef: React.RefObject<HTMLVideoElement>,\n onSkipBack?: (newTime: number) => void,\n onSkipForward?: (newTime: number) => void\n) => {\n // Hardcoded skip duration of 15 seconds\n const skipDuration = 15;\n\n const skipBack = useCallback(() => {\n const video = videoRef.current;\n if (!video) return;\n \n const newTime = Math.max(0, video.currentTime - skipDuration);\n video.currentTime = newTime;\n onSkipBack?.(newTime);\n }, [videoRef, onSkipBack]);\n\n const skipForward = useCallback(() => {\n const video = videoRef.current;\n if (!video) return;\n \n const newTime = Math.min(video.duration || 0, video.currentTime + skipDuration);\n video.currentTime = newTime;\n onSkipForward?.(newTime);\n }, [videoRef, onSkipForward]);\n\n // Always show skip controls\n const shouldShowSkipControls = useCallback(() => {\n return true;\n }, []);\n\n return {\n skipBack,\n skipForward,\n skipDuration,\n shouldShowSkipControls\n };\n}; ","import { useCallback, useRef } from 'react';\nimport initShakaPlayerMux from '@mux/mux-data-shakaplayer';\nimport shaka from 'shaka-player/dist/shaka-player.ui';\nimport { MuxAnalyticsConfig } from '../types';\n\nexport const useMuxAnalytics = (\n playerRef: React.RefObject<any>,\n muxConfig?: MuxAnalyticsConfig,\n onMuxReady?: () => void,\n onMuxDataUpdate?: (data: any) => void\n) => {\n const shakaPlayerMuxRef = useRef<any>(null);\n\n const initializeMux = useCallback(() => {\n if (!muxConfig || !playerRef.current) return;\n\n try {\n const playerInitTime = initShakaPlayerMux.utils.now();\n \n // Prepare Mux options\n const muxOptions = {\n debug: muxConfig.debug || false,\n disableCookies: muxConfig.disableCookies || false,\n respectDoNotTrack: muxConfig.respectDoNotTrack || false,\n automaticErrorTracking: muxConfig.automaticErrorTracking !== false,\n ...(muxConfig.beaconCollectionDomain && { beaconCollectionDomain: muxConfig.beaconCollectionDomain }),\n ...(muxConfig.errorTranslator && { errorTranslator: muxConfig.errorTranslator }),\n data: {\n env_key: muxConfig.envKey,\n player_name: 'Motto Video Player',\n player_version: '1.0.0',\n player_init_time: playerInitTime,\n ...muxConfig.metadata\n }\n };\n\n // Initialize Mux monitoring\n shakaPlayerMuxRef.current = initShakaPlayerMux(playerRef.current, muxOptions, shaka);\n \n onMuxReady?.();\n } catch (error) {\n console.error('Failed to initialize Mux Analytics:', error);\n }\n }, [muxConfig, onMuxReady, playerRef]);\n\n const updateMuxData = useCallback((data: any) => {\n if ((playerRef.current as any)?.mux?.updateData) {\n try {\n (playerRef.current as any).mux.updateData(data);\n onMuxDataUpdate?.(data);\n } catch (error) {\n console.error('Failed to update Mux data:', error);\n }\n }\n }, [onMuxDataUpdate, playerRef]);\n\n const handleMuxError = useCallback((error: any) => {\n if (shakaPlayerMuxRef.current?.loadErrorHandler) {\n shakaPlayerMuxRef.current.loadErrorHandler(error);\n }\n }, []);\n\n const destroyMux = useCallback(() => {\n // Clean up Mux monitoring\n if ((playerRef.current as any)?.mux?.destroy) {\n try {\n (playerRef.current as any).mux.destroy();\n } catch (error) {\n console.error('Error destroying Mux:', error);\n }\n }\n \n if (shakaPlayerMuxRef.current) {\n shakaPlayerMuxRef.current = null;\n }\n }, [playerRef]);\n\n return {\n initializeMux,\n updateMuxData,\n handleMuxError,\n destroyMux,\n shakaPlayerMuxRef\n };\n}; ","import { useCallback, useRef } from 'react';\n// Remove static import to prevent SSR errors\n// import { ui as ShakaUI } from 'shaka-player/dist/shaka-player.ui';\n\ninterface ChromecastConfig {\n enabled?: boolean;\n receiverApplicationId?: string;\n}\n\n// Custom Skip Back Button Element\nclass SkipBackButton {\n private button_!: HTMLButtonElement;\n private parent: HTMLElement;\n private controls: any;\n private eventManager: any;\n\n constructor(parent: HTMLElement, controls: any, onSkipBack?: (newTime: number) => void) {\n this.parent = parent;\n this.controls = controls;\n this.eventManager = { listen: (element: HTMLElement, event: string, handler: () => void) => {\n element.addEventListener(event, handler);\n }};\n\n // Check if we're in a browser environment\n if (typeof document === 'undefined') {\n console.warn('SkipBackButton: document is not available (SSR environment)');\n return;\n }\n\n this.button_ = document.createElement('button');\n this.button_.className = 'shaka-button motto-native-skip-button';\n this.button_.innerHTML = `\n <svg width=\"24px\" stroke-width=\"2\" height=\"24px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M3 13C3 17.9706 7.02944 22 12 22C16.9706 22 21 17.9706 21 13C21 8.02944 16.9706 4 12 4\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M9 9L9 16\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M15 9L13 9C12.4477 9 12 9.44772 12 10L12 11.5C12 12.0523 12.4477 12.5 13 12.5L14 12.5C14.5523 12.5 15 12.9477 15 13.5L15 15C15 15.5523 14.5523 16 14 16L12 16\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M12 4L4.5 4M4.5 4L6.5 2M4.5 4L6.5 6\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n `;\n this.button_.title = 'Skip back 15 seconds';\n this.button_.setAttribute('aria-label', 'Skip back 15 seconds');\n \n this.parent.appendChild(this.button_);\n\n this.eventManager.listen(this.button_, 'click', () => {\n const video = this.controls.getVideo();\n if (video) {\n const newTime = Math.max(0, video.currentTime - 15);\n video.currentTime = newTime;\n onSkipBack?.(newTime);\n }\n });\n }\n}\n\n// Custom Skip Forward Button Element \nclass SkipForwardButton {\n private button_!: HTMLButtonElement;\n private parent: HTMLElement;\n private controls: any;\n private eventManager: any;\n\n constructor(parent: HTMLElement, controls: any, onSkipForward?: (newTime: number) => void) {\n this.parent = parent;\n this.controls = controls;\n this.eventManager = { listen: (element: HTMLElement, event: string, handler: () => void) => {\n element.addEventListener(event, handler);\n }};\n\n // Check if we're in a browser environment\n if (typeof document === 'undefined') {\n console.warn('SkipForwardButton: document is not available (SSR environment)');\n return;\n }\n\n this.button_ = document.createElement('button');\n this.button_.className = 'shaka-button motto-native-skip-button';\n this.button_.innerHTML = `\n <svg fill=\"none\" height=\"24\" stroke-width=\"2\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M21 13C21 17.9706 16.9706 22 12 22C7.02944 22 3 17.9706 3 13C3 8.02944 7.02944 4 12 4\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M12 4H19.5M19.5 4L17.5 2M19.5 4L17.5 6\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M9 9L9 16\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M15 9L13 9C12.4477 9 12 9.44772 12 10L12 11.5C12 12.0523 12.4477 12.5 13 12.5L14 12.5C14.5523 12.5 15 12.9477 15 13.5L15 15C15 15.5523 14.5523 16 14 16L12 16\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n `;\n this.button_.title = 'Skip forward 15 seconds';\n this.button_.setAttribute('aria-label', 'Skip forward 15 seconds');\n \n this.parent.appendChild(this.button_);\n\n this.eventManager.listen(this.button_, 'click', () => {\n const video = this.controls.getVideo();\n if (video) {\n const newTime = Math.min(video.duration || 0, video.currentTime + 15);\n video.currentTime = newTime;\n onSkipForward?.(newTime);\n }\n });\n }\n}\n\n// Factory classes for the custom elements\nclass SkipBackButtonFactory {\n constructor(private onSkipBack?: (newTime: number) => void) {}\n \n create(rootElement: HTMLElement, controls: any) {\n return new SkipBackButton(rootElement, controls, this.onSkipBack);\n }\n}\n\nclass SkipForwardButtonFactory {\n constructor(private onSkipForward?: (newTime: number) => void) {}\n \n create(rootElement: HTMLElement, controls: any) {\n return new SkipForwardButton(rootElement, controls, this.onSkipForward);\n }\n}\n\ninterface SeekbarColors {\n base?: string;\n buffered?: string;\n played?: string;\n}\n\n// Mobile Play Button Plugin - extends shaka.ui.Element\nclass MobilePlayButton {\n private button_!: HTMLButtonElement;\n private parent: HTMLElement;\n private controls: any;\n private eventManager: any;\n private video!: HTMLVideoElement;\n\n constructor(parent: HTMLElement, controls: any) {\n this.parent = parent;\n this.controls = controls;\n \n // Check if we're in a browser environment\n if (typeof document === 'undefined') {\n console.warn('MobilePlayButton: document is not available (SSR environment)');\n return;\n }\n \n // Get video element safely - try multiple approaches\n this.video = controls?.getVideo?.() || \n parent.querySelector('video') || \n document.querySelector('video');\n if (!this.video) {\n console.error('MobilePlayButton: No video element found');\n return;\n }\n \n this.eventManager = { listen: (element: HTMLElement, event: string, handler: () => void) => {\n element.addEventListener(event, handler);\n }};\n\n this.button_ = document.createElement('button');\n this.button_.className = 'motto-mobile-play-button';\n this.updateIcon();\n this.parent.appendChild(this.button_);\n\n this.eventManager.listen(this.button_, 'click', () => {\n if (this.video.paused) {\n this.video.play();\n } else {\n this.video.pause();\n }\n });\n\n // Update icon based on video state\n this.eventManager.listen(this.video, 'play', () => this.updateIcon());\n this.eventManager.listen(this.video, 'pause', () => this.updateIcon());\n }\n\n private updateIcon() {\n if (this.video.paused) {\n this.button_.innerHTML = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" stroke-width=\"2\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path stroke-width=\"2\" fill-rule=\"evenodd\" d=\"M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z\" clip-rule=\"evenodd\" />\n </svg>\n `;\n this.button_.setAttribute('aria-label', 'Play');\n } else {\n this.button_.innerHTML = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path fill-rule=\"evenodd\" d=\"M6.75 5.25a.75.75 0 0 1 .75-.75H9a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H7.5a.75.75 0 0 1-.75-.75V5.25Zm7.5 0A.75.75 0 0 1 15 4.5h1.5a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H15a.75.75 0 0 1-.75-.75V5.25Z\" clip-rule=\"evenodd\" />\n </svg>\n `;\n this.button_.setAttribute('aria-label', 'Pause');\n }\n }\n}\n\n// Mobile Skip Back Button Plugin\nclass MobileSkipBackButton {\n private button_!: HTMLButtonElement;\n private parent: HTMLElement;\n private controls: any;\n private eventManager: any;\n private video!: HTMLVideoElement;\n\n constructor(parent: HTMLElement, controls: any, onSkipBack?: (newTime: number) => void) {\n this.parent = parent;\n this.controls = controls;\n \n // Check if we're in a browser environment\n if (typeof document === 'undefined') {\n console.warn('MobileSkipBackButton: document is not available (SSR environment)');\n return;\n }\n \n // Get video element safely - try multiple approaches\n this.video = controls?.getVideo?.() || \n parent.querySelector('video') || \n document.querySelector('video');\n if (!this.video) {\n console.error('MobileSkipBackButton: No video element found');\n return;\n }\n this.eventManager = { listen: (element: HTMLElement, event: string, handler: () => void) => {\n element.addEventListener(event, handler);\n }};\n\n this.button_ = document.createElement('button');\n this.button_.className = 'motto-mobile-skip-button';\n this.button_.innerHTML = `\n <svg width=\"20px\" stroke-width=\"2\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M3 13C3 17.9706 7.02944 22 12 22C16.9706 22 21 17.9706 21 13C21 8.02944 16.9706 4 12 4\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M9 9L9 16\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M15 9L13 9C12.4477 9 12 9.44772 12 10L12 11.5C12 12.0523 12.4477 12.5 13 12.5L14 12.5C14.5523 12.5 15 12.9477 15 13.5L15 15C15 15.5523 14.5523 16 14 16L12 16\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M12 4L4.5 4M4.5 4L6.5 2M4.5 4L6.5 6\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n `;\n this.button_.setAttribute('aria-label', 'Skip back 15 seconds');\n this.parent.appendChild(this.button_);\n\n this.eventManager.listen(this.button_, 'click', () => {\n const newTime = Math.max(0, this.video.currentTime - 15);\n this.video.currentTime = newTime;\n onSkipBack?.(newTime);\n });\n }\n}\n\n// Mobile Skip Forward Button Plugin\nclass MobileSkipForwardButton {\n private button_!: HTMLButtonElement;\n private parent: HTMLElement;\n private controls: any;\n private eventManager: any;\n private video!: HTMLVideoElement;\n\n constructor(parent: HTMLElement, controls: any, onSkipForward?: (newTime: number) => void) {\n this.parent = parent;\n this.controls = controls;\n \n // Check if we're in a browser environment\n if (typeof document === 'undefined') {\n console.warn('MobileSkipForwardButton: document is not available (SSR environment)');\n return;\n }\n \n // Get video element safely - try multiple approaches\n this.video = controls?.getVideo?.() || \n parent.querySelector('video') || \n document.querySelector('video');\n if (!this.video) {\n console.error('MobileSkipForwardButton: No video element found');\n return;\n }\n this.eventManager = { listen: (element: HTMLElement, event: string, handler: () => void) => {\n element.addEventListener(event, handler);\n }};\n\n this.button_ = document.createElement('button');\n this.button_.className = 'motto-mobile-skip-button';\n this.button_.innerHTML = `\n <svg fill=\"none\" height=\"20\" stroke-width=\"2\" viewBox=\"0 0 24 24\" width=\"20\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M21 13C21 17.9706 16.9706 22 12 22C7.02944 22 3 17.9706 3 13C3 8.02944 7.02944 4 12 4\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M12 4H19.5M19.5 4L17.5 2M19.5 4L17.5 6\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M9 9L9 16\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M15 9L13 9C12.4477 9 12 9.44772 12 10L12 11.5C12 12.0523 12.4477 12.5 13 12.5L14 12.5C14.5523 12.5 15 12.9477 15 13.5L15 15C15 15.5523 14.5523 16 14 16L12 16\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n `;\n this.button_.setAttribute('aria-label', 'Skip forward 15 seconds');\n this.parent.appendChild(this.button_);\n\n this.eventManager.listen(this.button_, 'click', () => {\n const newTime = Math.min(this.video.duration || 0, this.video.currentTime + 15);\n this.video.currentTime = newTime;\n onSkipForward?.(newTime);\n });\n }\n}\n\n// Mobile Controls Container Plugin\nclass MobileControlsContainer {\n private container_!: HTMLDivElement;\n private parent: HTMLElement;\n private controls: any;\n private observer!: MutationObserver;\n\n constructor(parent: HTMLElement, controls: any, onSkipBack?: (newTime: number) => void, onSkipForward?: (newTime: number) => void) {\n this.parent = parent;\n this.controls = controls;\n \n // Check if we're in a browser environment\n if (typeof document === 'undefined') {\n console.warn('MobileControlsContainer: document is not available (SSR environment)');\n return;\n }\n \n // Check if we have a valid parent container\n if (!parent) {\n console.error('MobileControlsContainer: No parent element provided');\n return;\n }\n\n // Create mobile controls overlay\n this.container_ = document.createElement('div');\n this.container_.className = 'motto-mobile-controls-overlay';\n\n const controlsGroup = document.createElement('div');\n controlsGroup.className = 'motto-mobile-controls-group';\n\n // Create individual mobile control elements\n new MobileSkipBackButton(controlsGroup, controls, onSkipBack);\n new MobilePlayButton(controlsGroup, controls);\n new MobileSkipForwardButton(controlsGroup, controls, onSkipForward);\n\n this.container_.appendChild(controlsGroup);\n this.parent.appendChild(this.container_);\n\n // Set up observer to sync visibility with control bar\n this.setupVisibilitySync();\n }\n\n private setupVisibilitySync() {\n // Wait for Shaka controls to be ready\n setTimeout(() => {\n // Initially sync visibility\n this.syncVisibility();\n\n // Watch for class changes on the main container (especially 'no-cursor' class)\n this.observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.type === 'attributes' && mutation.attributeName === 'class') {\n this.syncVisibility();\n }\n });\n });\n\n // Watch the main container for class changes\n this.observer.observe(this.parent, {\n attributes: true,\n attributeFilter: ['class']\n });\n\n // Listen for video play/pause events to update visibility\n const video = this.controls?.getVideo?.() || this.parent.querySelector('video');\n if (video) {\n video.addEventListener('play', () => {\n setTimeout(() => this.syncVisibility(), 50);\n });\n \n video.addEventListener('pause', () => {\n setTimeout(() => this.syncVisibility(), 50);\n });\n }\n }, 1000);\n }\n\n private syncVisibility() {\n // Check if the main container has the 'no-cursor' class which indicates controls should be hidden\n const mainContainer = this.parent;\n const hasNoCursor = mainContainer.classList.contains('no-cursor');\n \n // Get video element to check if it's paused\n const video = this.controls?.getVideo?.() || this.parent.querySelector('video');\n const isVideoPaused = video ? video.paused : false;\n \n // Keep controls visible if video is paused, regardless of cursor state\n const isControlsVisible = !hasNoCursor || isVideoPaused;\n \n if (this.container_) {\n if (isControlsVisible) {\n this.container_.style.opacity = '1';\n // Keep pointer-events: none on container to allow clicks through\n this.container_.style.pointerEvents = 'none';\n } else {\n this.container_.style.opacity = '0';\n this.container_.style.pointerEvents = 'none';\n }\n }\n }\n\n private isElementVisible(element: HTMLElement): boolean {\n // Check if we're in a browser environment\n if (typeof window === 'undefined') {\n return false;\n }\n \n const style = window.getComputedStyle(element);\n const hasHiddenClass = element.classList.contains('shaka-hidden') || \n element.classList.contains('hidden') ||\n element.classList.contains('shaka-fade-out');\n \n return style.display !== 'none' && \n style.visibility !== 'hidden' && \n style.opacity !== '0' &&\n !element.hidden &&\n !hasHiddenClass;\n }\n}\n\n// Factory classes for the mobile control plugins\nclass MobilePlayButtonFactory {\n create(rootElement: HTMLElement, controls: any) {\n return new MobilePlayButton(rootElement, controls);\n }\n}\n\nclass MobileSkipBackButtonFactory {\n constructor(private onSkipBack?: (newTime: number) => void) {}\n \n create(rootElement: HTMLElement, controls: any) {\n return new MobileSkipBackButton(rootElement, controls, this.onSkipBack);\n }\n}\n\nclass MobileSkipForwardButtonFactory {\n constructor(private onSkipForward?: (newTime: number) => void) {}\n \n create(rootElement: HTMLElement, controls: any) {\n return new MobileSkipForwardButton(rootElement, controls, this.onSkipForward);\n }\n}\n\nclass MobileControlsContainerFactory {\n constructor(\n private onSkipBack?: (newTime: number) => void,\n private onSkipForward?: (newTime: number) => void\n ) {}\n \n create(rootElement: HTMLElement, controls: any) {\n return new MobileControlsContainer(rootElement, controls, this.onSkipBack, this.onSkipForward);\n }\n}\n\nexport const useShakaUI = (\n playerRef: React.RefObject<any>,\n containerRef: React.RefObject<HTMLDivElement>,\n videoRef: React.RefObject<HTMLVideoElement>,\n controls: boolean,\n chromecastConfig?: ChromecastConfig,\n seekbarColors?: SeekbarColors,\n onSkipBack?: (newTime: number) => void,\n onSkipForward?: (newTime: number) => void\n) => {\n const uiRef = useRef<any>(null);\n const registeredElements = useRef<Set<string>>(new Set());\n\n const initializeUI = useCallback(async () => {\n // Check if we're in a browser environment\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n console.warn('useShakaUI: Cannot initialize UI in SSR environment');\n return null;\n }\n \n if (!controls || !containerRef.current || !playerRef.current || !videoRef.current) {\n return null;\n }\n\n try {\n // Dynamically import Shaka UI to avoid SSR issues\n const { ui: ShakaUI } = await import('shaka-player/dist/shaka-player.ui');\n\n // Detect if we're on mobile (more robust detection)\n // Check if we're in a browser environment first\n let isMobile = false;\n try {\n isMobile = typeof window !== 'undefined' && \n typeof navigator !== 'undefined' && \n (window.innerWidth <= 767 || /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));\n } catch (error) {\n // Fallback to desktop layout if detection fails\n isMobile = false;\n }\n\n // Register custom elements if not already registered\n if (!registeredElements.current.has('skip_back_button')) {\n ShakaUI.Controls.registerElement('skip_back_button', new SkipBackButtonFactory(onSkipBack));\n registeredElements.current.add('skip_back_button');\n }\n \n if (!registeredElements.current.has('skip_forward_button')) {\n ShakaUI.Controls.registerElement('skip_forward_button', new SkipForwardButtonFactory(onSkipForward));\n registeredElements.current.add('skip_forward_button');\n }\n\n // Register mobile control plugins for mobile devices\n if (isMobile) {\n if (!registeredElements.current.has('mobile_controls_container')) {\n ShakaUI.Controls.registerElement('mobile_controls_container', new MobileControlsContainerFactory(onSkipBack, onSkipForward));\n registeredElements.current.add('mobile_controls_container');\n }\n }\n\n // Create UI with Shaka Player controls using default configuration\n const ui = new ShakaUI.Overlay(playerRef.current, containerRef.current, videoRef.current);\n uiRef.current = ui;\n\n const controlPanelElements = isMobile ? [\n 'mute',\n 'time_and_duration',\n 'spacer',\n 'fullscreen',\n 'overflow_menu',\n ] :\n [\n 'skip_back_button',\n 'play_pause',\n 'skip_forward_button',\n 'mute',\n 'volume',\n 'time_and_duration',\n 'spacer',\n 'fullscreen',\n 'overflow_menu',\n ]\n ;\n \n // Configure UI settings with custom control panel layout\n const uiConfig: any = {\n seekBarColors: {\n base: seekbarColors?.base || 'rgba(255, 255, 255, 0.3)', // Unbuffered track\n buffered: seekbarColors?.buffered || 'rgba(255, 255, 255, 0.5)', // Buffered but not played\n played: seekbarColors?.played || '#ffffff', // Progress/played portion (white)\n },\n controlPanelElements: controlPanelElements,\n ...(chromecastConfig?.receiverApplicationId && {\n 'castReceiverAppId': chromecastConfig.receiverApplicationId,\n 'castAndroidReceiverCompatible': false\n })\n };\n\n // Add chromecast config if needed\n if (chromecastConfig?.receiverApplicationId) {\n uiConfig.castReceiverAppId = chromecastConfig.receiverApplicationId;\n uiConfig.castAndroidReceiverCompatible = false;\n }\n\n ui.configure(uiConfig);\n\n // Seekbar styling is now handled by CSS with proper background\n\n // Create mobile overlay controls on mobile devices using Shaka plugin system\n if (isMobile) {\n setTimeout(() => {\n const container = containerRef.current;\n const video = videoRef.current;\n if (container && video) {\n // Create mobile overlay controls with video element reference\n new MobileControlsContainer(container, { getVideo: () => video }, onSkipBack, onSkipForward);\n }\n }, 500); // Increased timeout to ensure UI is fully ready\n }\n\n return ui;\n } catch (error) {\n console.error('Error initializing Shaka UI:', error);\n return null;\n }\n }, [controls, containerRef, playerRef, videoRef, chromecastConfig, seekbarColors, onSkipBack, onSkipForward]);\n\n const destroyUI = useCallback(() => {\n if (uiRef.current) {\n try {\n uiRef.current.destroy();\n } catch (error) {\n console.error('Error destroying UI:', error);\n }\n uiRef.current = null;\n }\n }, []);\n\n return {\n uiRef,\n initializeUI,\n destroyUI\n };\n}; ","import { useCallback } from 'react';\n\ninterface EventHandlers {\n onPlay?: () => void;\n onPause?: () => void;\n onEnded?: () => void;\n onLoadStart?: () => void;\n onCanPlay?: () => void;\n}\n\nexport const useEventHandlers = (\n videoRef: React.RefObject<HTMLVideoElement>,\n handlers: EventHandlers\n) => {\n const setupEventListeners = useCallback(() => {\n const video = videoRef.current;\n if (!video) return;\n\n const { onPlay, onPause, onEnded, onLoadStart, onCanPlay } = handlers;\n\n if (onPlay) video.addEventListener('play', onPlay);\n if (onPause) video.addEventListener('pause', onPause);\n if (onEnded) video.addEventListener('ended', onEnded);\n if (onLoadStart) video.addEventListener('loadstart', onLoadStart);\n if (onCanPlay) video.addEventListener('canplay', onCanPlay);\n }, [videoRef, handlers]);\n\n const cleanupEventListeners = useCallback(() => {\n const video = videoRef.current;\n if (!video) return;\n\n const { onPlay, onPause, onEnded, onLoadStart, onCanPlay } = handlers;\n\n if (onPlay) video.removeEventListener('play', onPlay);\n if (onPause) video.removeEventListener('pause', onPause);\n if (onEnded) video.removeEventListener('ended', onEnded);\n if (onLoadStart) video.removeEventListener('loadstart', onLoadStart);\n if (onCanPlay) video.removeEventListener('canplay', onCanPlay);\n }, [videoRef, handlers]);\n\n return {\n setupEventListeners,\n cleanupEventListeners\n };\n}; ","import { useEffect, useState, useRef } from 'react';\n\ninterface UseLiveBadgeOptions {\n enabled?: boolean;\n onLiveStateChange?: (isLive: boolean) => void;\n}\n\nexport const useLiveBadge = (\n playerRef: React.RefObject<any>,\n options: UseLiveBadgeOptions = {}\n) => {\n const [isLive, setIsLive] = useState(false);\n const [isVisible, setIsVisible] = useState(false);\n const intervalRef = useRef<NodeJS.Timeout | null>(null);\n const { enabled = true, onLiveStateChange } = options;\n\n const checkLiveStatus = () => {\n if (!playerRef.current || !enabled) {\n return;\n }\n\n try {\n // Check if player has loaded content and is ready\n const player = playerRef.current;\n \n // Multiple checks to ensure player is ready\n if (!player.getManifest || \n !player.getPresentationTimeline || \n typeof player.getPresentationTimeline !== 'function') {\n return;\n }\n\n const manifest = player.getManifest();\n if (!manifest) {\n return;\n }\n\n // Now safely get the presentation timeline\n const timeline = player.getPresentationTimeline();\n if (!timeline || typeof timeline.isLive !== 'function') {\n return;\n }\n\n const liveStatus = timeline.isLive();\n \n if (liveStatus !== isLive) {\n setIsLive(liveStatus);\n setIsVisible(liveStatus);\n onLiveStateChange?.(liveStatus);\n }\n } catch (error) {\n // Only log errors that aren't related to player not being ready\n if (error instanceof Error && !error.message.includes('not a function')) {\n console.error('Error checking live status:', error);\n }\n }\n };\n\n useEffect(() => {\n if (!enabled) {\n setIsLive(false);\n setIsVisible(false);\n return;\n }\n\n // Check immediately\n checkLiveStatus();\n\n // Set up interval to check periodically\n intervalRef.current = setInterval(checkLiveStatus, 2000);\n\n return () => {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n intervalRef.current = null;\n }\n };\n }, [enabled, playerRef.current]);\n\n // Clean up on unmount\n useEffect(() => {\n return () => {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n }\n };\n }, []);\n\n const hideBadge = () => setIsVisible(false);\n const showBadge = () => setIsVisible(true);\n\n return {\n isLive,\n isVisible,\n hideBadge,\n showBadge,\n checkLiveStatus\n };\n}; ","import { useEffect, useState, useRef } from 'react';\n\ninterface UsePosterFallbackOptions {\n enabled?: boolean;\n fallbackPoster?: string;\n showLoadingOverlay?: boolean;\n}\n\nexport const usePosterFallback = (\n playerRef: React.RefObject<any>,\n options: UsePosterFallbackOptions = {}\n) => {\n const [isLoading, setIsLoading] = useState(true);\n const [showOverlay, setShowOverlay] = useState(true);\n const [hasStartedPlaying, setHasStartedPlaying] = useState(false);\n const { enabled = true, fallbackPoster, showLoadingOverlay = true } = options;\n\n useEffect(() => {\n if (!playerRef.current || !enabled) {\n return;\n }\n\n const handleLoadStart = () => {\n setIsLoading(true);\n setShowOverlay(true);\n };\n\n const handleCanPlay = () => {\n setIsLoading(false);\n // Keep overlay visible until user interaction or autoplay starts\n if (!hasStartedPlaying) {\n setShowOverlay(true);\n }\n };\n\n const handlePlay = () => {\n setHasStartedPlaying(true);\n setShowOverlay(false);\n };\n\n const handleLoadedMetadata = () => {\n setIsLoading(false);\n };\n\n // Add event listeners\n const video = playerRef.current;\n if (video) {\n video.addEventListener('loadstart', handleLoadStart);\n video.addEventListener('canplay', handleCanPlay);\n video.addEventListener('play', handlePlay);\n video.addEventListener('loadedmetadata', handleLoadedMetadata);\n\n return () => {\n video.removeEventListener('loadstart', handleLoadStart);\n video.removeEventListener('canplay', handleCanPlay);\n video.removeEventListener('play', handlePlay);\n video.removeEventListener('loadedmetadata', handleLoadedMetadata);\n };\n }\n }, [playerRef, enabled, hasStartedPlaying]);\n\n const hideOverlay = () => {\n setShowOverlay(false);\n };\n\n return {\n isLoading,\n showOverlay: showLoadingOverlay && showOverlay,\n hideOverlay,\n hasStartedPlaying\n };\n}; ","import { useEffect, useRef } from 'react';\n\ninterface UseLiveIndicatorOptions {\n enabled?: boolean;\n indicatorColor?: string;\n indicatorSize?: number;\n showPulseAnimation?: boolean;\n}\n\nexport const useLiveIndicator = (\n containerRef: React.RefObject<HTMLElement>,\n options: UseLiveIndicatorOptions = {}\n) => {\n const observerRef = useRef<MutationObserver | null>(null);\n const { \n enabled = true, \n indicatorColor = '#ff0000',\n indicatorSize = 8,\n showPulseAnimation = true \n } = options;\n\n useEffect(() => {\n // Check if we're in a browser environment\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n return;\n }\n \n if (!containerRef.current || !enabled) {\n return;\n }\n\n const addLiveIndicator = (currentTimeElement: Element) => {\n // Check if indicator already exists\n if (currentTimeElement.querySelector('.live-indicator-dot')) {\n return;\n }\n\n // Create the red circle indicator\n const indicator = document.createElement('span');\n indicator.className = 'live-indicator-dot';\n indicator.style.cssText = `\n display: inline-block;\n width: ${indicatorSize}px;\n height: ${indicatorSize}px;\n background-color: ${indicatorColor};\n border-radius: 50%;\n margin-right: 6px;\n vertical-align: middle;\n ${showPulseAnimation ? 'animation: pulse-live 2s infinite;' : ''}\n `;\n\n // Insert the indicator at the beginning of the current time element\n currentTimeElement.insertBefore(indicator, currentTimeElement.firstChild);\n };\n\n const removeLiveIndicator = (currentTimeElement: Element) => {\n const indicator = currentTimeElement.querySelector('.live-indicator-dot');\n if (indicator) {\n indicator.remove();\n }\n };\n\n const checkForLiveContent = () => {\n const currentTimeElements = containerRef.current?.querySelectorAll('.shaka-current-time');\n \n currentTimeElements?.forEach((element) => {\n const textContent = element.textContent?.trim() || '';\n \n if (textContent.toLowerCase().includes('live')) {\n addLiveIndicator(element);\n } else {\n removeLiveIndicator(element);\n }\n });\n };\n\n // Initial check\n checkForLiveContent();\n\n // Set up mutation observer to watch for changes in the DOM\n observerRef.current = new MutationObserver((mutations) => {\n let shouldCheck = false;\n \n mutations.forEach((mutation) => {\n // Check if any nodes were added or text content changed\n if (mutation.type === 'childList' || mutation.type === 'characterData') {\n shouldCheck = true;\n }\n \n // Check if any of the added nodes contain current time elements\n mutation.addedNodes.forEach((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const element = node as Element;\n if (element.classList?.contains('shaka-current-time') || \n element.querySelector?.('.shaka-current-time')) {\n shouldCheck = true;\n }\n }\n });\n });\n \n if (shouldCheck) {\n // Debounce the check to avoid excessive calls\n setTimeout(checkForLiveContent, 100);\n }\n });\n\n // Start observing\n observerRef.current.observe(containerRef.current, {\n childList: true,\n subtree: true,\n characterData: true,\n characterDataOldValue: true\n });\n\n // Also set up an interval as a fallback\n const intervalId = setInterval(checkForLiveContent, 1000);\n\n return () => {\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n clearInterval(intervalId);\n };\n }, [containerRef, enabled, indicatorColor, indicatorSize, showPulseAnimation]);\n\n return {\n // Expose method to manually trigger check if needed\n checkForLiveContent: () => {\n const currentTimeElements = containerRef.current?.querySelectorAll('.shaka-current-time');\n currentTimeElements?.forEach((element) => {\n const textContent = element.textContent?.trim() || '';\n if (textContent.toLowerCase().includes('live')) {\n // Add indicator logic here if needed\n }\n });\n }\n };\n}; ","import { useEffect, useState } from 'react';\n\nexport function useShakaAbsoluteTime({\n player,\n controls,\n manualStreamStartDate,\n}: {\n player: shaka.Player | null;\n controls: shaka.ui.Controls | null;\n manualStreamStartDate?: Date; // Optional manual override\n}) {\n const [detectedStreamStart, setDetectedStreamStart] = useState<Date | null>(null);\n\n // Helper function to extract stream start time from manifest\n const detectStreamStartFromManifest = async (): Promise<Date | null> => {\n if (!player) return null;\n\n try {\n const manifest = player.getManifest();\n if (!manifest) return null;\n\n // Check if this is a live stream\n const isLive = player.isLive();\n if (!isLive) return null;\n\n // Try to get seekable range information for live streams\n const video = player.getMediaElement();\n if (video && video.seekable && video.seekable.length > 0) {\n const seekableStart = video.seekable.start(0);\n const seekableEnd = video.seekable.end(0);\n const seekableDuration = seekableEnd - seekableStart;\n \n // Estimate stream start based on seekable window\n const now = Date.now() / 1000;\n const estimatedStreamStart = now - seekableDuration;\n return new Date(estimatedStreamStart * 1000);\n }\n\n // Try to use network information if available\n const stats = player.getStats();\n if (stats && stats.manifestTimeSeconds) {\n // Use manifest load time as a reference\n return new Date((Date.now() / 1000 - stats.manifestTimeSeconds) * 1000);\n }\n\n // Fallback: Try to extract timing info from buffered ranges\n try {\n const bufferedTimeRanges = video?.buffered;\n if (bufferedTimeRanges && bufferedTimeRanges.length > 0) {\n const totalBuffered = bufferedTimeRanges.end(bufferedTimeRanges.length - 1);\n const now = Date.now() / 1000;\n return new Date((now - totalBuffered) * 1000);\n }\n } catch (error) {\n console.warn('Error extracting buffered timing info:', error);\n }\n\n console.warn('Could not detect stream start time from manifest');\n return null;\n } catch (error) {\n console.warn('Error detecting stream start time:', error);\n return null;\n }\n };\n\n // Detect stream start time when player is ready\n useEffect(() => {\n if (!player || manualStreamStartDate) return;\n\n const detectStartTime = async () => {\n // Wait a bit for manifest to be fully loaded\n setTimeout(async () => {\n const detectedStart = await detectStreamStartFromManifest();\n if (detectedStart) {\n setDetectedStreamStart(detectedStart);\n console.log('Detected stream start time:', detectedStart.toISOString());\n }\n }, 1000);\n };\n\n // Listen for manifest loaded event\n const onManifestParsed = () => {\n detectStartTime();\n };\n\n // Try immediate detection and also listen for events\n detectStartTime();\n \n // Listen for various player events that might indicate manifest is ready\n try {\n player.addEventListener('manifestparsed', onManifestParsed);\n player.addEventListener('streaming', onManifestParsed);\n } catch (error) {\n // Fallback if event listeners aren't available\n console.warn('Could not add manifest event listeners:', error);\n }\n\n return () => {\n try {\n player.removeEventListener('manifestparsed', onManifestParsed);\n player.removeEventListener('streaming', onManifestParsed);\n } catch (error) {\n // Ignore cleanup errors\n }\n };\n }, [player, manualStreamStartDate]);\n\n const effectiveStreamStart = manualStreamStartDate || detectedStreamStart;\n\n useEffect(() => {\n if (!player || !controls || !effectiveStreamStart) return;\n\n const video = player.getMediaElement();\n if (!video) return;\n\n // Store original getDisplayTime method\n let originalGetDisplayTime: any;\n let timeDisplayElement: any;\n \n // Helper function to format time as HH:MM:SS or MM:SS\n const formatElapsedTime = (elapsedSeconds: number): string => {\n const hours = Math.floor(elapsedSeconds / 3600);\n const minutes = Math.floor((elapsedSeconds % 3600) / 60);\n const seconds = Math.floor(elapsedSeconds % 60);\n\n if (hours > 0) {\n return [hours, minutes, seconds]\n .map(val => val.toString().padStart(2, '0'))\n .join(':');\n } else {\n return [minutes, seconds]\n .map(val => val.toString().padStart(2, '0'))\n .join(':');\n }\n };\n\n // Calculate elapsed time since stream start\n const getElapsedTime = (): number => {\n const now = new Date();\n const elapsedMs = now.getTime() - effectiveStreamStart.getTime();\n return Math.max(0, elapsedMs / 1000);\n };\n\n // Custom getDisplayTime implementation for elapsed time\n const customGetDisplayTime = function(this: any) {\n const elapsedSeconds = getElapsedTime();\n return formatElapsedTime(elapsedSeconds);\n };\n\n // Find and override the time display element\n const setupTimeDisplayOverride = () => {\n try {\n const controlsContainer = controls.getControlsContainer();\n if (!controlsContainer) return;\n\n // Find the time display element\n const timeDisplay = controlsContainer.querySelector('.shaka-current-time');\n if (timeDisplay) {\n timeDisplayElement = timeDisplay;\n \n // Check if the element has a getDisplayTime method (it's a custom element)\n if (timeDisplayElement.getDisplayTime) {\n // Store the original method\n originalGetDisplayTime = timeDisplayElement.getDisplayTime.bind(timeDisplayElement);\n \n // Override the getDisplayTime method\n timeDisplayElement.getDisplayTime = customGetDisplayTime.bind(timeDisplayElement);\n } else {\n // If no getDisplayTime method, we'll use direct text content updates\n setupDirectTextUpdate();\n }\n }\n } catch (error) {\n console.warn('Error setting up time display override:', error);\n // Fallback to direct text updates\n setupDirectTextUpdate();\n }\n };\n\n // Fallback: Direct text content updates using animation frame\n const setupDirectTextUpdate = () => {\n let animationFrameId: number;\n let isDestroyed = false;\n\n const updateTimeDisplay = () => {\n if (isDestroyed) return;\n\n try {\n const controlsContainer = controls.getControlsContainer();\n if (controlsContainer) {\n const currentTimeLabels = controlsContainer.querySelectorAll('.shaka-current-time');\n const elapsedSeconds = getElapsedTime();\n const timeText = formatElapsedTime(elapsedSeconds);\n\n currentTimeLabels.forEach(label => {\n if (label && label.textContent !== timeText) {\n label.textContent = timeText;\n }\n });\n }\n } catch (error) {\n console.warn('Error updating time display:', error);\n }\n\n animationFrameId = requestAnimationFrame(updateTimeDisplay);\n };\n\n updateTimeDisplay();\n\n // Return cleanup function\n return () => {\n isDestroyed = true;\n if (animationFrameId) {\n cancelAnimationFrame(animationFrameId);\n }\n };\n };\n\n // Setup seekbar tooltip for elapsed time\n const setupSeekbarTooltip = () => {\n try {\n const controlsContainer = controls.getControlsContainer();\n if (!controlsContainer) return;\n\n const seekBar = controlsContainer.querySelector('.shaka-seek-bar') as HTMLInputElement;\n if (!seekBar) return;\n\n const onSeekBarMouseMove = (event: MouseEvent) => {\n const rect = seekBar.getBoundingClientRect();\n const pos = (event.clientX - rect.left) / rect.width;\n \n const totalElapsedSeconds = getElapsedTime();\n \n // For live streams, estimate the time at the hovered position\n const seekableRange = video.seekable;\n if (seekableRange.length > 0) {\n const seekableDuration = seekableRange.end(0) - seekableRange.start(0);\n const positionInStream = totalElapsedSeconds - (seekableDuration * (1 - pos));\n const timeAtPosition = Math.max(0, positionInStream);\n \n seekBar.title = formatElapsedTime(timeAtPosition);\n } else {\n // Fallback: just show the current elapsed time\n seekBar.title = formatElapsedTime(totalElapsedSeconds);\n }\n };\n\n seekBar.addEventListener('mousemove', onSeekBarMouseMove);\n\n return () => {\n seekBar.removeEventListener('mousemove', onSeekBarMouseMove);\n };\n } catch (error) {\n console.warn('Error setting up seekbar tooltip:', error);\n return () => {};\n }\n };\n\n // Wait for UI to be ready, then setup overrides\n const setupWithDelay = () => {\n setTimeout(() => {\n setupTimeDisplayOverride();\n const cleanupSeekbar = setupSeekbarTooltip();\n \n // Store cleanup function\n (setupWithDelay as any).cleanupSeekbar = cleanupSeekbar;\n }, 100);\n };\n\n setupWithDelay();\n\n // Cleanup function\n return () => {\n // Restore original getDisplayTime method if it was overridden\n if (timeDisplayElement && originalGetDisplayTime) {\n try {\n timeDisplayElement.getDisplayTime = originalGetDisplayTime;\n } catch (error) {\n console.warn('Error restoring original getDisplayTime:', error);\n }\n }\n\n // Cleanup seekbar tooltip\n if ((setupWithDelay as any).cleanupSeekbar) {\n (setupWithDelay as any).cleanupSeekbar();\n }\n };\n }, [player, controls, effectiveStreamStart]);\n\n // Return detected stream start for debugging/info purposes\n return {\n detectedStreamStart,\n effectiveStreamStart,\n isUsingManualDate: !!manualStreamStartDate\n };\n}","import React from 'react';\nimport { twMerge } from 'tailwind-merge';\n\ninterface LoadingProps {\n className?: string;\n}\n\nexport const Loading: React.FC<LoadingProps> = ({ className }) => (\n <div\n className={twMerge(\n \"relative bg-[#151515] md:rounded-2xl! overflow-hidden aspect-video text-white w-full h-full flex justify-center items-center text-[10px]\",\n className\n )}\n role=\"status\"\n >\n <div className=\"animate-spin rounded-full h-8 w-8 border-b-2 border-white\"></div>\n <span className=\"sr-only\">Loading...</span>\n </div>\n); ","import React from 'react';\n\ninterface ErrorScreenProps {\n title?: string;\n description?: string;\n}\n\nexport const ErrorScreen: React.FC<ErrorScreenProps> = ({ title, description }) => (\n <div className=\"w-full h-full md:rounded-2xl! aspect-video bg-black\">\n <div className=\"bg-[#151515] text-white w-full h-full flex justify-stretch items-center\">\n <svg\n className=\"w-24 h-24 m-6\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n style={{ width: 96 }}\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n <div>\n <h3 className=\"text-2xl mb-2\">{title || \"Playback Error\"}</h3>\n <div className=\"text-lg\">{description || \"Unable to play the video. Please try again later.\"}</div>\n </div>\n </div>\n </div>\n); ","import React from 'react';\n\ninterface TitleProps {\n title: string;\n}\n\nexport const Title: React.FC<TitleProps> = ({ title }) => (\n <div className=\"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-4\">\n <h2 className=\"text-white text-xl font-semibold\">{title}</h2>\n </div>\n); ","import React from 'react';\n\ninterface LiveBadgeProps {\n isVisible: boolean;\n position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';\n className?: string;\n style?: React.CSSProperties;\n text?: string;\n}\n\nexport const LiveBadge: React.FC<LiveBadgeProps> = ({\n isVisible,\n position = 'top-right',\n className = '',\n style = {},\n text = 'LIVE'\n}) => {\n if (!isVisible) return null;\n\n const positionClasses = {\n 'top-left': 'top-4 left-4',\n 'top-right': 'top-4 right-4',\n 'bottom-left': 'bottom-4 left-4',\n 'bottom-right': 'bottom-4 right-4'\n };\n\n return (\n <div\n className={`\n absolute z-50 \n ${positionClasses[position]}\n bg-red-600 text-white \n px-2 py-1 \n rounded-md \n text-xs font-bold \n uppercase tracking-wide\n shadow-lg\n animate-pulse\n pointer-events-none\n ${className}\n `}\n style={style}\n >\n <span className=\"flex items-center gap-1\">\n <span className=\"w-2 h-2 bg-white rounded-full animate-pulse\"></span>\n {text}\n </span>\n </div>\n );\n}; ","import styleInject from '#style-inject';styleInject(\"/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */\\n@layer properties;\\n@layer theme, base, components, utilities;\\n@layer theme {\\n :root,\\n :host {\\n --font-sans:\\n ui-sans-serif,\\n system-ui,\\n sans-serif,\\n \\\"Apple Color Emoji\\\",\\n \\\"Segoe UI Emoji\\\",\\n \\\"Segoe UI Symbol\\\",\\n \\\"Noto Color Emoji\\\";\\n --font-mono:\\n ui-monospace,\\n SFMono-Regular,\\n Menlo,\\n Monaco,\\n Consolas,\\n \\\"Liberation Mono\\\",\\n \\\"Courier New\\\",\\n monospace;\\n --color-red-600: oklch(57.7% 0.245 27.325);\\n --color-black: #000;\\n --color-white: #fff;\\n --spacing: 0.25rem;\\n --container-4xl: 56rem;\\n --text-xs: 0.75rem;\\n --text-xs--line-height: calc(1 / 0.75);\\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-5xl: 3rem;\\n --text-5xl--line-height: 1;\\n --font-weight-medium: 500;\\n --font-weight-semibold: 600;\\n --font-weight-bold: 700;\\n --tracking-wide: 0.025em;\\n --tracking-widest: 0.1em;\\n --radius-md: 0.375rem;\\n --radius-2xl: 1rem;\\n --animate-spin: spin 1s linear infinite;\\n --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\\n --aspect-video: 16 / 9;\\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 *,\\n ::after,\\n ::before,\\n ::backdrop,\\n ::file-selector-button {\\n box-sizing: border-box;\\n margin: 0;\\n padding: 0;\\n border: 0 solid;\\n }\\n html,\\n :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,\\n h2,\\n h3,\\n h4,\\n h5,\\n 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,\\n strong {\\n font-weight: bolder;\\n }\\n code,\\n kbd,\\n samp,\\n 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,\\n 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,\\n ul,\\n menu {\\n list-style: none;\\n }\\n img,\\n svg,\\n video,\\n canvas,\\n audio,\\n iframe,\\n embed,\\n object {\\n display: block;\\n vertical-align: middle;\\n }\\n img,\\n video {\\n max-width: 100%;\\n height: auto;\\n }\\n button,\\n input,\\n select,\\n optgroup,\\n textarea,\\n ::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,\\n ::-webkit-datetime-edit-year-field,\\n ::-webkit-datetime-edit-month-field,\\n ::-webkit-datetime-edit-day-field,\\n ::-webkit-datetime-edit-hour-field,\\n ::-webkit-datetime-edit-minute-field,\\n ::-webkit-datetime-edit-second-field,\\n ::-webkit-datetime-edit-millisecond-field,\\n ::-webkit-datetime-edit-meridiem-field {\\n padding-block: 0;\\n }\\n :-moz-ui-invalid {\\n box-shadow: none;\\n }\\n button,\\n input:where([type=button], [type=reset], [type=submit]),\\n ::file-selector-button {\\n appearance: button;\\n }\\n ::-webkit-inner-spin-button,\\n ::-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-auto {\\n pointer-events: auto;\\n }\\n .pointer-events-none {\\n pointer-events: none;\\n }\\n .visible {\\n visibility: visible;\\n }\\n .sr-only {\\n position: absolute;\\n width: 1px;\\n height: 1px;\\n padding: 0;\\n margin: -1px;\\n overflow: hidden;\\n clip: rect(0, 0, 0, 0);\\n white-space: nowrap;\\n border-width: 0;\\n }\\n .absolute {\\n position: absolute;\\n }\\n .fixed {\\n position: fixed;\\n }\\n .relative {\\n position: relative;\\n }\\n .static {\\n position: static;\\n }\\n .inset-0 {\\n inset: calc(var(--spacing) * 0);\\n }\\n .top-0 {\\n top: calc(var(--spacing) * 0);\\n }\\n .top-4 {\\n top: calc(var(--spacing) * 4);\\n }\\n .right-0 {\\n right: calc(var(--spacing) * 0);\\n }\\n .right-4 {\\n right: calc(var(--spacing) * 4);\\n }\\n .bottom-0 {\\n bottom: calc(var(--spacing) * 0);\\n }\\n .bottom-4 {\\n bottom: calc(var(--spacing) * 4);\\n }\\n .left-0 {\\n left: calc(var(--spacing) * 0);\\n }\\n .left-4 {\\n left: calc(var(--spacing) * 4);\\n }\\n .z-10 {\\n z-index: 10;\\n }\\n .z-50 {\\n z-index: 50;\\n }\\n .container {\\n width: 100%;\\n @media (width >= 40rem) {\\n max-width: 40rem;\\n }\\n @media (width >= 48rem) {\\n max-width: 48rem;\\n }\\n @media (width >= 64rem) {\\n max-width: 64rem;\\n }\\n @media (width >= 80rem) {\\n max-width: 80rem;\\n }\\n @media (width >= 96rem) {\\n max-width: 96rem;\\n }\\n }\\n .m-6 {\\n margin: calc(var(--spacing) * 6);\\n }\\n .mt-1 {\\n margin-top: calc(var(--spacing) * 1);\\n }\\n .mt-3 {\\n margin-top: calc(var(--spacing) * 3);\\n }\\n .mb-2 {\\n margin-bottom: calc(var(--spacing) * 2);\\n }\\n .mb-6 {\\n margin-bottom: calc(var(--spacing) * 6);\\n }\\n .flex {\\n display: flex;\\n }\\n .grid {\\n display: grid;\\n }\\n .hidden {\\n display: none;\\n }\\n .aspect-video {\\n aspect-ratio: var(--aspect-video);\\n }\\n .h-2 {\\n height: calc(var(--spacing) * 2);\\n }\\n .h-8 {\\n height: calc(var(--spacing) * 8);\\n }\\n .h-24 {\\n height: calc(var(--spacing) * 24);\\n }\\n .h-full {\\n height: 100%;\\n }\\n .w-2 {\\n width: calc(var(--spacing) * 2);\\n }\\n .w-8 {\\n width: calc(var(--spacing) * 8);\\n }\\n .w-24 {\\n width: calc(var(--spacing) * 24);\\n }\\n .w-full {\\n width: 100%;\\n }\\n .max-w-4xl {\\n max-width: var(--container-4xl);\\n }\\n .animate-pulse {\\n animation: var(--animate-pulse);\\n }\\n .animate-spin {\\n animation: var(--animate-spin);\\n }\\n .auto-cols-max {\\n grid-auto-columns: max-content;\\n }\\n .grid-flow-col {\\n grid-auto-flow: column;\\n }\\n .flex-col {\\n flex-direction: column;\\n }\\n .items-center {\\n align-items: center;\\n }\\n .justify-center {\\n justify-content: center;\\n }\\n .justify-stretch {\\n justify-content: stretch;\\n }\\n .gap-1 {\\n gap: calc(var(--spacing) * 1);\\n }\\n .gap-5 {\\n gap: calc(var(--spacing) * 5);\\n }\\n .overflow-hidden {\\n overflow: hidden;\\n }\\n .rounded-full {\\n border-radius: calc(infinity * 1px);\\n }\\n .rounded-md {\\n border-radius: var(--radius-md);\\n }\\n .border-b-2 {\\n border-bottom-style: var(--tw-border-style);\\n border-bottom-width: 2px;\\n }\\n .border-white {\\n border-color: var(--color-white);\\n }\\n .bg-\\\\[\\\\#151515\\\\] {\\n background-color: #151515;\\n }\\n .bg-black {\\n background-color: var(--color-black);\\n }\\n .bg-red-600 {\\n background-color: var(--color-red-600);\\n }\\n .bg-white {\\n background-color: var(--color-white);\\n }\\n .bg-gradient-to-t {\\n --tw-gradient-position: to top in oklab;\\n background-image: linear-gradient(var(--tw-gradient-stops));\\n }\\n .from-black\\\\/70 {\\n --tw-gradient-from: color-mix(in srgb, #000 70%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n --tw-gradient-from: color-mix(in oklab, var(--color-black) 70%, transparent);\\n }\\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 .to-transparent {\\n --tw-gradient-to: transparent;\\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 .bg-no-repeat {\\n background-repeat: no-repeat;\\n }\\n .p-2 {\\n padding: calc(var(--spacing) * 2);\\n }\\n .p-4 {\\n padding: calc(var(--spacing) * 4);\\n }\\n .px-2 {\\n padding-inline: calc(var(--spacing) * 2);\\n }\\n .px-4 {\\n padding-inline: calc(var(--spacing) * 4);\\n }\\n .py-1 {\\n padding-block: calc(var(--spacing) * 1);\\n }\\n .text-center {\\n text-align: center;\\n }\\n .text-left {\\n text-align: left;\\n }\\n .font-mono {\\n font-family: var(--font-mono);\\n }\\n .text-2xl {\\n font-size: var(--text-2xl);\\n line-height: var(--tw-leading, var(--text-2xl--line-height));\\n }\\n .text-5xl {\\n font-size: var(--text-5xl);\\n line-height: var(--tw-leading, var(--text-5xl--line-height));\\n }\\n .text-base {\\n font-size: var(--text-base);\\n line-height: var(--tw-leading, var(--text-base--line-height));\\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 .text-xs {\\n font-size: var(--text-xs);\\n line-height: var(--tw-leading, var(--text-xs--line-height));\\n }\\n .text-\\\\[10px\\\\] {\\n font-size: 10px;\\n }\\n .font-bold {\\n --tw-font-weight: var(--font-weight-bold);\\n font-weight: var(--font-weight-bold);\\n }\\n .font-medium {\\n --tw-font-weight: var(--font-weight-medium);\\n font-weight: var(--font-weight-medium);\\n }\\n .font-semibold {\\n --tw-font-weight: var(--font-weight-semibold);\\n font-weight: var(--font-weight-semibold);\\n }\\n .tracking-wide {\\n --tw-tracking: var(--tracking-wide);\\n letter-spacing: var(--tracking-wide);\\n }\\n .tracking-widest {\\n --tw-tracking: var(--tracking-widest);\\n letter-spacing: var(--tracking-widest);\\n }\\n .text-white {\\n color: var(--color-white);\\n }\\n .uppercase {\\n text-transform: uppercase;\\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:\\n var(--tw-inset-shadow),\\n var(--tw-inset-ring-shadow),\\n var(--tw-ring-offset-shadow),\\n var(--tw-ring-shadow),\\n var(--tw-shadow);\\n }\\n .filter {\\n filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);\\n }\\n .md\\\\:rounded-2xl {\\n @media (width >= 48rem) {\\n border-radius: var(--radius-2xl);\\n }\\n }\\n .md\\\\:rounded-2xl\\\\! {\\n @media (width >= 48rem) {\\n border-radius: var(--radius-2xl) !important;\\n }\\n }\\n .md\\\\:text-base {\\n @media (width >= 48rem) {\\n font-size: var(--text-base);\\n line-height: var(--tw-leading, var(--text-base--line-height));\\n }\\n }\\n .md\\\\:text-sm {\\n @media (width >= 48rem) {\\n font-size: var(--text-sm);\\n line-height: var(--tw-leading, var(--text-sm--line-height));\\n }\\n }\\n .md\\\\:text-xl {\\n @media (width >= 48rem) {\\n font-size: var(--text-xl);\\n line-height: var(--tw-leading, var(--text-xl--line-height));\\n }\\n }\\n}\\n@layer components {\\n .motto-video-container {\\n position: relative;\\n width: 100%;\\n min-height: 300px;\\n }\\n @supports (aspect-ratio: 16/9) {\\n .motto-video-container {\\n min-height: auto;\\n }\\n }\\n .motto-video-responsive {\\n position: absolute;\\n top: calc(var(--spacing) * 0);\\n left: calc(var(--spacing) * 0);\\n height: 100%;\\n width: 100%;\\n }\\n .motto-skip-button {\\n position: absolute;\\n top: calc(1/2 * 100%);\\n z-index: 10;\\n display: flex;\\n height: calc(var(--spacing) * 16);\\n width: calc(var(--spacing) * 16);\\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\\n translate: var(--tw-translate-x) var(--tw-translate-y);\\n cursor: pointer;\\n align-items: center;\\n justify-content: center;\\n border-radius: calc(infinity * 1px);\\n border-style: var(--tw-border-style);\\n border-width: 0px;\\n background-color: color-mix(in srgb, #000 70%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n background-color: color-mix(in oklab, var(--color-black) 70%, transparent);\\n }\\n font-size: var(--text-2xl);\\n line-height: var(--tw-leading, var(--text-2xl--line-height));\\n color: var(--color-white);\\n opacity: 80%;\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n &:hover {\\n @media (hover: hover) {\\n --tw-scale-x: 110%;\\n --tw-scale-y: 110%;\\n --tw-scale-z: 110%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n }\\n &:hover {\\n @media (hover: hover) {\\n opacity: 100%;\\n }\\n }\\n &:active {\\n --tw-scale-x: 95%;\\n --tw-scale-y: 95%;\\n --tw-scale-z: 95%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n }\\n .motto-skip-button-back {\\n left: calc(var(--spacing) * 5);\\n }\\n .motto-skip-button-forward {\\n right: calc(var(--spacing) * 5);\\n }\\n .motto-mobile-controls-overlay {\\n position: absolute;\\n inset: calc(var(--spacing) * 0);\\n z-index: 20;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\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 --tw-duration: 300ms;\\n transition-duration: 300ms;\\n pointer-events: none;\\n }\\n .motto-mobile-controls-group {\\n display: flex;\\n align-items: center;\\n gap: calc(var(--spacing) * 8);\\n opacity: 100%;\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n pointer-events: none;\\n }\\n .motto-mobile-play-button {\\n display: flex;\\n height: calc(var(--spacing) * 14);\\n width: calc(var(--spacing) * 14);\\n cursor: pointer;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n border-radius: calc(infinity * 1px);\\n border-style: var(--tw-border-style);\\n border-width: 0px;\\n background-color: color-mix(in srgb, #000 30%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n background-color: color-mix(in oklab, var(--color-black) 30%, transparent);\\n }\\n color: var(--color-white);\\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:\\n var(--tw-inset-shadow),\\n var(--tw-inset-ring-shadow),\\n var(--tw-ring-offset-shadow),\\n var(--tw-ring-shadow),\\n var(--tw-shadow);\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n pointer-events: auto;\\n }\\n .motto-mobile-play-button:active {\\n --tw-scale-x: 95%;\\n --tw-scale-y: 95%;\\n --tw-scale-z: 95%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n .motto-mobile-play-button svg {\\n height: calc(var(--spacing) * 7);\\n width: calc(var(--spacing) * 7);\\n }\\n .motto-mobile-skip-button {\\n display: flex;\\n height: calc(var(--spacing) * 10);\\n width: calc(var(--spacing) * 10);\\n cursor: pointer;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n border-radius: calc(infinity * 1px);\\n border-style: var(--tw-border-style);\\n border-width: 0px;\\n background-color: color-mix(in srgb, #000 30%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n background-color: color-mix(in oklab, var(--color-black) 30%, transparent);\\n }\\n color: var(--color-white);\\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:\\n var(--tw-inset-shadow),\\n var(--tw-inset-ring-shadow),\\n var(--tw-ring-offset-shadow),\\n var(--tw-ring-shadow),\\n var(--tw-shadow);\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n pointer-events: auto;\\n }\\n .motto-mobile-skip-button:active {\\n --tw-scale-x: 95%;\\n --tw-scale-y: 95%;\\n --tw-scale-z: 95%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n .motto-mobile-skip-button svg {\\n height: calc(var(--spacing) * 6);\\n width: calc(var(--spacing) * 6);\\n }\\n}\\n@media (min-width: 768px) {\\n .motto-mobile-controls-overlay {\\n display: none !important;\\n }\\n}\\n@media (max-width: 767px) {\\n .shaka-controls-container .motto-native-skip-button,\\n .shaka-controls-container .motto-skip-back-button,\\n .shaka-controls-container .motto-skip-forward-button,\\n .shaka-controls-container .shaka-button[title*=\\\"Skip back\\\"],\\n .shaka-controls-container .shaka-button[title*=\\\"Skip forward\\\"],\\n .shaka-controls-container .shaka-button[aria-label*=\\\"Skip back\\\"],\\n .shaka-controls-container .shaka-button[aria-label*=\\\"Skip forward\\\"],\\n .shaka-controls-container button[title*=\\\"Skip back\\\"],\\n .shaka-controls-container button[title*=\\\"Skip forward\\\"],\\n .shaka-controls-container button[aria-label*=\\\"Skip back\\\"],\\n .shaka-controls-container button[aria-label*=\\\"Skip forward\\\"],\\n .motto-native-skip-button:not(.motto-mobile-skip-button),\\n .motto-skip-back-button:not(.motto-mobile-skip-button),\\n .motto-skip-forward-button:not(.motto-mobile-skip-button),\\n .shaka-button[title*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n .shaka-button[title*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button),\\n .shaka-button[aria-label*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n .shaka-button[aria-label*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button),\\n button[title*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n button[title*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button),\\n button[aria-label*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n button[aria-label*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button) {\\n display: none !important;\\n visibility: hidden !important;\\n opacity: 0 !important;\\n width: 0 !important;\\n height: 0 !important;\\n padding: 0 !important;\\n margin: 0 !important;\\n }\\n .shaka-controls-container {\\n z-index: 90 !important;\\n height: 100px !important;\\n bottom: 0 !important;\\n top: unset !important;\\n }\\n .motto-mobile-skip-button {\\n display: flex !important;\\n visibility: visible !important;\\n opacity: 1 !important;\\n }\\n}\\n.shaka-seek-bar-container {\\n height: 6px !important;\\n width: 100% !important;\\n margin: 8px 0 !important;\\n border-radius: 4px !important;\\n position: relative !important;\\n border-top: none !important;\\n border-bottom: none !important;\\n box-shadow: none !important;\\n}\\n.shaka-seek-bar {\\n height: 6px !important;\\n width: 100% !important;\\n -webkit-appearance: none !important;\\n appearance: none !important;\\n background: transparent !important;\\n cursor: pointer !important;\\n border: none !important;\\n outline: none !important;\\n position: absolute !important;\\n top: 0 !important;\\n left: 0 !important;\\n border-radius: 4px !important;\\n}\\n.shaka-seek-bar::-webkit-slider-runnable-track {\\n height: 6px !important;\\n background: transparent !important;\\n border-radius: 4px !important;\\n border: none !important;\\n}\\n.shaka-seek-bar::-moz-range-track {\\n height: 6px !important;\\n background: transparent !important;\\n border-radius: 4px !important;\\n border: none !important;\\n}\\n.shaka-seek-bar::-webkit-slider-thumb {\\n -webkit-appearance: none !important;\\n appearance: none !important;\\n width: 16px !important;\\n height: 16px !important;\\n border-radius: 50% !important;\\n background: #ffffff !important;\\n cursor: pointer !important;\\n border: 2px solid #ffffff !important;\\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;\\n margin-top: -4px !important;\\n}\\n.shaka-seek-bar::-moz-range-thumb {\\n width: 16px !important;\\n height: 16px !important;\\n border-radius: 50% !important;\\n background: #ffffff !important;\\n cursor: pointer !important;\\n border: 2px solid #ffffff !important;\\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;\\n margin-top: -4px !important;\\n}\\n.motto-skip-back-button,\\n.motto-skip-forward-button,\\n.motto-native-skip-button {\\n background: transparent !important;\\n border: none !important;\\n padding: 4px !important;\\n margin: 0px !important;\\n cursor: pointer !important;\\n color: #ffffff !important;\\n transition: all 0.2s ease !important;\\n min-width: 32px !important;\\n height: 32px !important;\\n display: flex !important;\\n align-items: center !important;\\n justify-content: center !important;\\n border-radius: 4px !important;\\n width: 25px;\\n}\\n.motto-skip-back-button:hover,\\n.motto-skip-forward-button:hover,\\n.motto-native-skip-button:hover {\\n opacity: 0.8 !important;\\n background: transparent !important;\\n transform: scale(1.05) !important;\\n}\\n.motto-skip-back-button:active,\\n.motto-skip-forward-button:active,\\n.motto-native-skip-button:active {\\n transform: scale(0.95) !important;\\n}\\n.motto-skip-back-button svg,\\n.motto-skip-forward-button svg,\\n.motto-native-skip-button svg {\\n width: 24px !important;\\n height: 24px !important;\\n}\\n@media (max-width: 767px) {\\n .shaka-controls-container .motto-native-skip-button,\\n .shaka-controls-container .motto-skip-back-button,\\n .shaka-controls-container .motto-skip-forward-button,\\n .shaka-controls-container .shaka-play-button,\\n .shaka-controls-container .shaka-pause-button {\\n display: none !important;\\n }\\n}\\n.shaka-spinner-svg {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-spinner-path {\\n stroke: white !important;\\n fill: none !important;\\n}\\n.shaka-spinner-container {\\n color: white !important;\\n}\\n.shaka-buffering-spinner {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-buffering-spinner svg {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-buffering-spinner path {\\n stroke: white !important;\\n fill: none !important;\\n}\\n[data-shaka-player-container] .shaka-spinner,\\n[data-shaka-player-container] .spinner {\\n color: white !important;\\n border-color: white !important;\\n}\\n.material-icons.shaka-spinner {\\n color: white !important;\\n}\\n.shaka-controls-container .shaka-spinner,\\n.shaka-video-container .shaka-spinner {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-controls-container .shaka-spinner svg,\\n.shaka-video-container .shaka-spinner svg {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-controls-container .shaka-spinner path,\\n.shaka-video-container .shaka-spinner path {\\n stroke: white !important;\\n}\\n.motto-video-loading-overlay {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n background:\\n linear-gradient(\\n 135deg,\\n #1a1a1a 0%,\\n #2d2d2d 100%);\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n z-index: 10;\\n transition: opacity 0.3s ease;\\n}\\n.motto-video-loading-overlay.hidden {\\n opacity: 0;\\n pointer-events: none;\\n}\\n.motto-video-loading-content {\\n text-align: center;\\n color: white;\\n}\\n.motto-video-loading-icon {\\n width: 64px;\\n height: 64px;\\n margin-bottom: 16px;\\n opacity: 0.7;\\n}\\n.motto-video-loading-text {\\n font-size: 16px;\\n font-weight: 500;\\n margin-bottom: 8px;\\n}\\n.motto-video-loading-subtext {\\n font-size: 14px;\\n opacity: 0.7;\\n}\\n@keyframes pulse-live {\\n 0% {\\n opacity: 1;\\n transform: scale(1);\\n }\\n 50% {\\n opacity: 0.7;\\n transform: scale(1.1);\\n }\\n 100% {\\n opacity: 1;\\n transform: scale(1);\\n }\\n}\\n@property --tw-border-style { syntax: \\\"*\\\"; inherits: false; initial-value: solid; }\\n@property --tw-gradient-position { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-gradient-from { syntax: \\\"<color>\\\"; inherits: false; initial-value: #0000; }\\n@property --tw-gradient-via { syntax: \\\"<color>\\\"; inherits: false; initial-value: #0000; }\\n@property --tw-gradient-to { syntax: \\\"<color>\\\"; inherits: false; initial-value: #0000; }\\n@property --tw-gradient-stops { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-gradient-via-stops { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-gradient-from-position { syntax: \\\"<length-percentage>\\\"; inherits: false; initial-value: 0%; }\\n@property --tw-gradient-via-position { syntax: \\\"<length-percentage>\\\"; inherits: false; initial-value: 50%; }\\n@property --tw-gradient-to-position { syntax: \\\"<length-percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-font-weight { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-tracking { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-shadow-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-shadow-alpha { syntax: \\\"<percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-inset-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-inset-shadow-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-inset-shadow-alpha { syntax: \\\"<percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-ring-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-ring-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-inset-ring-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-inset-ring-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-ring-inset { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-ring-offset-width { syntax: \\\"<length>\\\"; inherits: false; initial-value: 0px; }\\n@property --tw-ring-offset-color { syntax: \\\"*\\\"; inherits: false; initial-value: #fff; }\\n@property --tw-ring-offset-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-blur { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-brightness { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-contrast { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-grayscale { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-hue-rotate { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-invert { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-opacity { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-saturate { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-sepia { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-drop-shadow { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-drop-shadow-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-drop-shadow-alpha { syntax: \\\"<percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-drop-shadow-size { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-translate-x { syntax: \\\"*\\\"; inherits: false; initial-value: 0; }\\n@property --tw-translate-y { syntax: \\\"*\\\"; inherits: false; initial-value: 0; }\\n@property --tw-translate-z { syntax: \\\"*\\\"; inherits: false; initial-value: 0; }\\n@property --tw-duration { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-scale-x { syntax: \\\"*\\\"; inherits: false; initial-value: 1; }\\n@property --tw-scale-y { syntax: \\\"*\\\"; inherits: false; initial-value: 1; }\\n@property --tw-scale-z { syntax: \\\"*\\\"; inherits: false; initial-value: 1; }\\n@keyframes spin {\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n@keyframes pulse {\\n 50% {\\n opacity: 0.5;\\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 *,\\n ::before,\\n ::after,\\n ::backdrop {\\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-tracking: 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-blur: initial;\\n --tw-brightness: initial;\\n --tw-contrast: initial;\\n --tw-grayscale: initial;\\n --tw-hue-rotate: initial;\\n --tw-invert: initial;\\n --tw-opacity: initial;\\n --tw-saturate: initial;\\n --tw-sepia: initial;\\n --tw-drop-shadow: initial;\\n --tw-drop-shadow-color: initial;\\n --tw-drop-shadow-alpha: 100%;\\n --tw-drop-shadow-size: initial;\\n --tw-translate-x: 0;\\n --tw-translate-y: 0;\\n --tw-translate-z: 0;\\n --tw-duration: initial;\\n --tw-scale-x: 1;\\n --tw-scale-y: 1;\\n --tw-scale-z: 1;\\n }\\n }\\n}\\n\")","import React, { forwardRef, useEffect, useState } from 'react';\nimport { Player } from './Player';\nimport { PlayerProps } from './types';\n\n/**\n * Client-only wrapper for the Player component to prevent SSR issues.\n * This component only renders the Player on the client side after hydration.\n */\nexport const ClientOnlyPlayer = forwardRef<HTMLVideoElement, PlayerProps>(\n (props, ref) => {\n const [isClient, setIsClient] = useState(false);\n\n useEffect(() => {\n setIsClient(true);\n }, []);\n\n // Don't render anything on the server or before hydration\n if (!isClient) {\n return (\n <div \n className={props.containerClassName}\n style={{\n width: props.width,\n height: props.height,\n aspectRatio: props.aspectRatio ? props.aspectRatio.toString() : '16/9',\n backgroundColor: '#000',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center'\n }}\n >\n {/* Optional loading placeholder */}\n <div style={{ color: 'white' }}>Loading player...</div>\n </div>\n );\n }\n\n return <Player {...props} ref={ref} />;\n }\n);\n\nClientOnlyPlayer.displayName = 'ClientOnlyPlayer'; ","import React, { useEffect } from 'react';\nimport { twMerge } from 'tailwind-merge';\nimport { useQuery } from '@tanstack/react-query';\nimport { Player } from './Player';\nimport type { PlayerProps } from './types';\nimport { fetchVideoData, type VideoData } from './api';\nimport { Loading, ErrorScreen, Title } from './components';\n\n// Import helper functions\nimport { errorTypes, findHLSPlaylist, getErrorType } from './helper';\nimport useMessages, { type Translations } from './messages/useMessages';\n\nexport interface VideoProps extends Omit<PlayerProps, 'src'> {\n videoId?: string;\n publicKey?: string;\n mottoToken?: string;\n videoData?: VideoData;\n refetchInterval?: number;\n playerName?: string;\n locale?: string;\n events?: {\n onVideoData?: (video: VideoData) => void;\n onEmptyPlaylists?: () => void;\n onError?: (error: Error) => void;\n onPlay?: () => void;\n onPause?: () => void;\n onEnded?: () => void;\n onLoadStart?: () => void;\n onCanPlay?: () => void;\n onPlayerReady?: () => void;\n };\n children?: React.ReactNode;\n className?: string;\n // TanStack Query options\n queryOptions?: {\n enabled?: boolean;\n staleTime?: number;\n cacheTime?: number;\n retry?: number;\n retryDelay?: number;\n };\n}\n\nexport const Video: React.FC<VideoProps> = ({\n videoId,\n publicKey,\n mottoToken,\n videoData: providedVideoData,\n refetchInterval = 0,\n playerName,\n locale = 'en',\n events,\n children,\n className,\n queryOptions = {},\n ...props\n}) => {\n // Use TanStack Query for data fetching\n const {\n data,\n isLoading,\n error,\n refetch\n } = useQuery<VideoData>({\n queryKey: ['video', videoId, publicKey, mottoToken],\n queryFn: () => fetchVideoData(videoId!, publicKey!, mottoToken),\n enabled: !!videoId && !!publicKey && !providedVideoData,\n refetchInterval: refetchInterval > 0 ? refetchInterval : false,\n staleTime: queryOptions.staleTime ?? 5 * 60 * 1000, // 5 minutes\n gcTime: queryOptions.cacheTime ?? 10 * 60 * 1000, // 10 minutes (was cacheTime in v4)\n retry: queryOptions.retry ?? 3,\n retryDelay: queryOptions.retryDelay ?? ((attemptIndex: number) => Math.min(1000 * 2 ** attemptIndex, 30000))\n });\n\n const video = providedVideoData || data;\n const { t } = useMessages(locale);\n \n // Find HLS playlist using helper function\n const activePlaylist = findHLSPlaylist(video);\n const hlsUrl = activePlaylist?.url;\n\n // Notify parent of video data\n useEffect(() => {\n if (events?.onVideoData && video) {\n events.onVideoData(video);\n }\n }, [video, events]);\n\n // Loading state\n if (isLoading || (!providedVideoData && !video)) {\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full bg-[#151515]\">\n <Loading />\n </div>\n </div>\n );\n }\n\n // Handle empty playlists\n if (!isLoading && video && !hlsUrl && events?.onEmptyPlaylists) {\n events.onEmptyPlaylists();\n }\n\n // Error state\n if (error || video?.error) {\n const errorKey = video?.error ? getErrorType(undefined, video) : 'API_ERROR';\n const errorObj = error || new Error(video?.error || 'Unknown error');\n \n if (events?.onError) {\n events.onError(errorObj);\n }\n\n // Use localized error messages\n const title = t(errorKey as keyof Translations) || t('DEFAULT_ERROR');\n const description = t(`${errorKey}_DESCRIPTION` as keyof Translations) || t('DEFAULT_ERROR_DESCRIPTION');\n\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <ErrorScreen\n title={title}\n description={description}\n />\n {children}\n </div>\n </div>\n );\n }\n\n // No playable source\n if (!hlsUrl) {\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full bg-[#151515]\">\n <Title title={video?.name || \"\"} />\n {children}\n </div>\n </div>\n );\n }\n\n console.log(\"hlsUrl\", hlsUrl);\n\n // Render video player with source\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <Player\n {...props}\n src={hlsUrl}\n className={twMerge(\"video-player-container\", className)}\n events={events}\n containerClassName=\"w-full h-full\"\n >\n {children}\n </Player>\n </div>\n </div>\n );\n}; ","export interface VideoData {\n id: string;\n name?: string;\n description?: string;\n playlists?: Array<{\n url: string;\n format: string;\n }>;\n error?: string;\n}\n\nexport interface VideoListItem {\n id: string;\n name?: string;\n description?: string;\n playlists?: Array<{\n url: string;\n format: string;\n }>;\n error?: string;\n}\n\n/**\n * Fetches video data from the Motto Streaming API\n * @param videoId - The ID of the video to fetch\n * @param publicKey - The public key for authentication\n * @param mottoToken - Optional motto token for authenticated requests\n * @returns Promise<VideoData> - The video data\n */\nexport const fetchVideoData = async (\n videoId: string, \n publicKey: string, \n mottoToken?: string\n): Promise<VideoData> => {\n const endpoint = \"https://cda.mottostreaming.com/motto.cda.streaming.video.v1.VideoService/GetVideo\";\n const url = new URL(endpoint);\n url.searchParams.set(\"encoding\", \"json\");\n url.searchParams.set(\"message\", JSON.stringify({ videoId }));\n\n const response = await fetch(url, {\n method: \"GET\",\n headers: {\n Authorization: `Bearer ${publicKey}`,\n ...(Boolean(mottoToken) && { 'x-motto-token': mottoToken })\n },\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch video: ${response.statusText}`);\n }\n\n const data = await response.json() as { video: VideoData };\n return data.video;\n};\n\n/**\n * Fetches multiple videos data from the Motto Streaming API\n * @param publicKey - The public key for authentication\n * @param videoIds - Array of video IDs to fetch\n * @param mottoToken - Optional motto token for authenticated requests\n * @returns Promise<VideoListItem[]> - Array of video data\n */\nexport async function fetchVideosList(\n publicKey: string,\n videoIds: string[],\n mottoToken?: string,\n skip: number = 0,\n limit: number = 0\n): Promise<VideoListItem[]> {\n if (!videoIds || videoIds.length === 0) {\n return [];\n }\n\n const endpoint = \"https://cda.mottostreaming.com/motto.cda.streaming.video.v1.VideoService/BatchGetVideos\";\n const url = new URL(endpoint);\n url.searchParams.set(\"encoding\", \"json\");\n url.searchParams.set(\"message\", JSON.stringify({ videoIds }));\n\n const response = await fetch(url.toString(), {\n method: \"GET\",\n headers: {\n Authorization: `Bearer ${publicKey}`,\n ...(Boolean(mottoToken) && { 'x-motto-token': mottoToken })\n },\n }).catch((err) => {\n throw new Error(`Failed to fetch videos: ${err}`);\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch videos list: ${response.status}`);\n }\n\n const data = (await response.json()) as { videos: VideoListItem[] };\n return data.videos;\n} ","export interface EventData {\n id: string;\n title: string;\n description?: string;\n startTime: string;\n endTime?: string;\n posterUrl?: string;\n videoIds?: string[];\n error?: string;\n}\n\n\n\nexport enum EventsSortDirection {\n ASC = 'asc',\n DESC = 'desc'\n}\n\nexport async function fetchEventData(\n publicKey: string,\n eventId: string,\n unused?: any,\n filter?: string,\n order?: EventsSortDirection,\n locale?: string\n): Promise<EventData> {\n const endpoint = \"https://cda.mottostreaming.com/motto.cda.cms.event.v1.EventService/GetEvent\";\n const url = new URL(endpoint);\n \n // Build the message object\n const message: any = { eventId };\n if (locale?.length) message.locale = locale;\n if (filter) message.filter = filter;\n if (order) message.order = order;\n \n url.searchParams.set(\"encoding\", \"json\");\n url.searchParams.set(\"message\", JSON.stringify(message));\n\n const response = await fetch(url.toString(), {\n method: \"GET\",\n headers: {\n Authorization: `Bearer ${publicKey}`,\n },\n }).catch((err) => {\n throw new Error(`Failed to fetch event: ${err}`);\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch event data: ${response.status}`);\n }\n\n const data = (await response.json()) as { event: EventData };\n return data.event;\n}\n\n ","export interface CreativeWorkData {\n id: string;\n title: string;\n description?: string;\n releaseTime: string;\n endTime?: string;\n posterUrl?: string;\n videoIds?: string[];\n error?: string;\n}\n\nexport enum CreativeWorksSortDirection {\n ASC = 'asc',\n DESC = 'desc'\n}\n\nexport async function fetchCreativeWorkData(\n publicKey: string,\n creativeWorkId: string,\n unused?: any,\n filter?: string,\n order?: CreativeWorksSortDirection,\n locale?: string\n): Promise<CreativeWorkData> {\n const endpoint = \"https://cda.mottostreaming.com/motto.cda.cms.creative_work.v1.CreativeWorkService/GetCreativeWork\";\n const url = new URL(endpoint);\n \n // Build the message object\n const message: any = { creativeWorkId };\n if (locale?.length) message.locale = locale;\n if (filter) message.filter = filter;\n if (order) message.order = order;\n \n url.searchParams.set(\"encoding\", \"json\");\n url.searchParams.set(\"message\", JSON.stringify(message));\n\n const response = await fetch(url.toString(), {\n method: \"GET\",\n headers: {\n Authorization: `Bearer ${publicKey}`,\n },\n }).catch((err) => {\n throw new Error(`Failed to fetch creative work: ${err}`);\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch creative work data: ${response.status}`);\n }\n\n const data = (await response.json()) as { creativeWork: CreativeWorkData };\n return data.creativeWork;\n} ","import type { VideoData } from './api';\n\nconst defaultError = {\n title: \"Playback Error\",\n description: \"Unable to play the video. Please try again later.\",\n};\n\nexport const errorTypes: Record<\n \"api\" | \"default\" | string,\n {\n title: string;\n description: string;\n }\n> = {\n api: {\n title: \"Failed to Retrieve Video Info\",\n description:\n \"Error fetching video details. Check your videoId and internet connection and try again.\",\n },\n ERROR_CODE_NOT_AUTHENTICATED: {\n title: \"Authorisation\",\n description: \"You don't have permission to play this video. \",\n },\n ERROR_CODE_GEO_BLOCKED: {\n title: \"Geoblocking Restriction\",\n description:\n \"Sorry, this video is not available in your region due to geoblocking restrictions.\",\n },\n ERROR_CODE_NOT_ENTITLED: {\n title: \"Not entitled\",\n description: \"Sorry, you are not entitled to play this video.\",\n },\n ERROR_CODE_VPN_BLOCKED: {\n title: \"VPN BLOCKED\",\n description: \"This video is not available due to the use of a VPN.\",\n },\n ERROR_CODE_UNSPECIFIED: defaultError,\n ERROR_CODE_SIGNATURE_MISMATCH: defaultError,\n ERROR_CODE_INVALID_DOMAIN: defaultError,\n default: defaultError,\n};\n\nexport const getMediaTypeFromSource = (\n source: string\n): \"video/mp4\" | \"application/vnd.apple.mpegurl\" | \"video/x-flv\" => {\n if (source.includes(\".mp4\")) {\n return \"video/mp4\";\n }\n if (source.includes(\".m3u8\")) {\n return \"application/vnd.apple.mpegurl\";\n }\n return \"video/x-flv\"; // Default return\n};\n\nexport const getSourceObject = ({\n source,\n}: {\n source: string;\n}): {\n src: string;\n type: string;\n withCredentials: boolean;\n} => {\n const mediaType = getMediaTypeFromSource(source);\n\n return {\n src: source,\n type: mediaType,\n withCredentials: false, // Set to false as per the original comment about CORS issues\n };\n};\n\nexport const formatTime = (seconds = 0): string => {\n const ss = seconds < 0 ? 0 : seconds;\n let s: number | string = Math.floor(ss % 60);\n let m: number | string = Math.floor((ss / 60) % 60);\n let h: number | string = Math.floor(ss / 3600);\n\n if (isNaN(ss) || ss === Infinity) {\n s = \"-\";\n m = \"-\";\n h = \"-\";\n }\n\n h = Number(h) > 0 ? `${h}:` : \"\";\n m = `${Number(m) < 10 ? `0${m}` : m}:`;\n s = Number(s) < 10 ? `0${s}` : s;\n\n return h + m + s;\n};\n\nexport const findHLSPlaylist = (video?: VideoData) => {\n return video?.playlists?.find((playlist) => {\n return playlist.format === 'HLS' || \n playlist.format === 'hls' || \n playlist.format === 'PLAYLIST_FORMAT_HLS';\n });\n};\n\nexport const getErrorType = (error?: string | Error, video?: VideoData) => {\n if (video?.error && errorTypes[video.error]) {\n return video.error;\n }\n return 'DEFAULT_ERROR';\n};\n\n/**\n * Checks if we're running in a browser environment (not SSR)\n * @returns true if browser APIs are available, false if in SSR environment\n */\nexport const isBrowser = (): boolean => {\n return typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';\n};\n\n/**\n * Safely get user agent string (returns empty string in SSR)\n */\nexport const getUserAgent = (): string => {\n if (!isBrowser()) return '';\n \n try {\n return navigator.userAgent;\n } catch (error) {\n return '';\n }\n};\n\n/**\n * Safely check if device is mobile (returns false in SSR)\n */\nexport const isMobileDevice = (): boolean => {\n if (!isBrowser()) return false;\n \n try {\n return window.innerWidth <= 767 || /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\n } catch (error) {\n return false;\n }\n};\n","import { useState, useEffect } from 'react';\n\n// Import JSON files as modules\nimport en from './en.json';\nimport es from './es.json';\nimport ar from './ar.json';\nimport de from './de.json';\nimport fr from './fr.json';\nimport it from './it.json';\nimport ja from './ja.json';\nimport ko from './ko.json';\nimport pt from './pt.json';\nimport ru from './ru.json';\nimport zh from './zh.json';\nimport nl from './nl.json';\nimport fa from './fa.json';\n\n// Define the available languages\nconst availableLanguages = {\n en,\n es,\n ar,\n de,\n fr,\n it,\n ja,\n ko,\n pt,\n ru,\n zh,\n nl,\n fa\n};\n\ntype Language = keyof typeof availableLanguages;\n\n// Base translations type - this represents all possible keys that can exist\nexport type Translations = {\n \"DAYS\": string\n \"HOURS\": string\n \"MINUTES\": string\n \"SECONDS\": string\n \"STARTING_SOON\": string\n \"EVENT_NOT_STARTED\": string\n \"DEFAULT_ERROR\": string\n \"DEFAULT_ERROR_DESCRIPTION\": string\n \"API_ERROR\": string\n \"API_ERROR_DESCRIPTION\": string\n \"ERROR_CODE_NOT_AUTHENTICATED\": string\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": string\n \"ERROR_CODE_GEO_BLOCKED\": string\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": string\n \"ERROR_CODE_NOT_ENTITLED\": string\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": string\n \"ERROR_CODE_VPN_BLOCKED\": string\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": string\n}\n\n// Partial translations type for individual language files (allows missing keys)\ntype PartialTranslations = Partial<Translations>;\n\n// Function to get the browser's language setting\nconst getBrowserLanguage = (): Language => {\n // Check if we're in a browser environment\n if (typeof window === 'undefined' || typeof navigator === 'undefined') {\n return 'en'; // Default to English on server-side\n }\n \n try {\n const language = navigator.language.split('-')[0] as Language;\n return availableLanguages[language] ? language : 'en';\n } catch (error) {\n // Fallback to English if navigator access fails\n return 'en';\n }\n};\n\nconst useMessages = (locale: string) => {\n const [language, setLanguage] = useState<Language>('en');\n const [translations, setTranslations] = useState<PartialTranslations>(availableLanguages.en);\n\n useEffect(() => {\n const lang = !!availableLanguages?.[locale as Language] ? locale as Language : getBrowserLanguage();\n setLanguage(lang);\n setTranslations(availableLanguages[lang] as PartialTranslations);\n }, [locale]);\n\n // Translation function with English fallback\n const t = (key: keyof Translations): string => {\n // Try current language first\n if (translations[key]) {\n return translations[key];\n }\n \n // Fallback to English if key not found in current language\n if (language !== 'en' && availableLanguages.en[key]) {\n return availableLanguages.en[key];\n }\n \n // Return empty string if not found in either current language or English\n return '';\n };\n\n // Function to change the language manually\n const changeLanguage = (lng: Language) => {\n if (availableLanguages[lng]) {\n setLanguage(lng);\n setTranslations(availableLanguages[lng] as PartialTranslations);\n }\n };\n\n return { t, language, changeLanguage };\n};\n\nexport default useMessages;\n","{\n \"DAYS\": \"days\",\n \"HOURS\": \"hours\",\n \"MINUTES\": \"min\",\n \"SECONDS\": \"sec\",\n \"STARTING_SOON\": \"Starting soon...\",\n \"EVENT_NOT_STARTED\": \"This event has not started...\",\n \"DEFAULT_ERROR\": \"Playback Error\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"Unable to play the video. Please try again later.\",\n \"API_ERROR\": \"Failed to Retrieve Video Info\",\n \"API_ERROR_DESCRIPTION\": \"Error fetching video details. Check your videoId and internet connection and try again.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Authorisation\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"You don't have permission to play this video.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Geoblocking Restriction\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Sorry, this video is not available in your region due to geoblocking restrictions.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"Not entitled\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Sorry, you are not entitled to play this video.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN BLOCKED\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"This video is not available due to the use of a VPN.\"\n}\n","{\n \"DAYS\": \"días\",\n \"HOURS\": \"horas\",\n \"MINUTES\": \"min\",\n \"SECONDS\": \"seg\",\n \"STARTING_SOON\": \"En instantes...\",\n \"EVENT_NOT_STARTED\": \"Este evento aún no ha comenzado...\",\n \"DEFAULT_ERROR\": \"Error de reproducción\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"No se puede reproducir el video. Por favor, inténtelo de nuevo más tarde.\",\n \"API_ERROR\": \"Error al recuperar información del video\",\n \"API_ERROR_DESCRIPTION\": \"Error al obtener detalles del video. Verifique su videoId y conexión a internet e inténtelo de nuevo.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Autorización\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"No tienes permiso para reproducir este video.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Restricción geográfica\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Lo siento, este video no está disponible en tu región debido a restricciones geográficas.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"No autorizado\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Lo siento, no estás autorizado para reproducir este video.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN BLOQUEADO\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"Este video no está disponible debido al uso de una VPN.\"\n}\n ","{\n \"DAYS\": \"أيام\",\n \"HOURS\": \"ساعات\",\n \"MINUTES\": \"دقائق\",\n \"SECONDS\": \"ثواني\",\n \"STARTING_SOON\": \"يبدأ قريبا...\",\n \"EVENT_NOT_STARTED\": \"هذا الحدث لم يبدأ بعد...\",\n \"DEFAULT_ERROR\": \"خطأ في التشغيل\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"غير قادر على تشغيل الفيديو. يرجى المحاولة مرة أخرى لاحقًا.\",\n \"API_ERROR\": \"فشل في استرجاع معلومات الفيديو\",\n \"API_ERROR_DESCRIPTION\": \"خطأ في جلب تفاصيل الفيديو. تحقق من معرف الفيديو واتصال الإنترنت وحاول مرة أخرى.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"تفويض\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"ليس لديك إذن لتشغيل هذا الفيديو.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"قيود الجغرافيا\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"عذرًا، هذا الفيديو غير متاح في منطقتك بسبب قيود الجغرافيا.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"غير مخول\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"عذرًا، ليس لديك الحق في تشغيل هذا الفيديو.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"تم حظر VPN\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"هذا الفيديو غير متاح بسبب استخدام VPN.\"\n}","{\n \"DAYS\": \"Tage\",\n \"HOURS\": \"Stunden\",\n \"MINUTES\": \"Min\",\n \"SECONDS\": \"Sek\",\n \"STARTING_SOON\": \"Beginnt bald...\",\n \"DEFAULT_ERROR\": \"Wiedergabefehler\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"Das Video kann nicht abgespielt werden. Bitte versuchen Sie es später erneut.\",\n \"API_ERROR\": \"Fehler beim Abrufen der Videoinformationen\",\n \"API_ERROR_DESCRIPTION\": \"Fehler beim Abrufen der Videodetails. Überprüfen Sie Ihre videoId und Internetverbindung und versuchen Sie es erneut.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Autorisierung\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"Sie haben keine Berechtigung, dieses Video abzuspielen.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Geoblocking-Beschränkung\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Entschuldigung, dieses Video ist in Ihrer Region aufgrund von Geoblocking-Beschränkungen nicht verfügbar.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"Nicht berechtigt\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Entschuldigung, Sie sind nicht berechtigt, dieses Video abzuspielen.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN BLOCKIERT\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"Dieses Video ist aufgrund der Verwendung eines VPN nicht verfügbar.\"\n}\n ","{\n \"DAYS\": \"jours\",\n \"HOURS\": \"heures\",\n \"MINUTES\": \"minutes\",\n \"SECONDS\": \"secondes\",\n \"STARTING_SOON\": \"Commence bientôt...\",\n \"EVENT_NOT_STARTED\": \"Cet événement n'a pas commencé...\",\n \"DEFAULT_ERROR\": \"Erreur de lecture\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"Impossible de lire la vidéo. Veuillez réessayer plus tard.\",\n \"API_ERROR\": \"Échec de la récupération des informations vidéo\",\n \"API_ERROR_DESCRIPTION\": \"Erreur lors de la récupération des détails de la vidéo. Vérifiez votre videoId et votre connexion Internet, puis réessayez.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Autorisation\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"Vous n'avez pas la permission de lire cette vidéo.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Restriction de géoblocage\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Désolé, cette vidéo n'est pas disponible dans votre région en raison de restrictions de géoblocage.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"Non autorisé\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Désolé, vous n'êtes pas autorisé à lire cette vidéo.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN BLOQUÉ\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"Cette vidéo n'est pas disponible en raison de l'utilisation d'un VPN.\"\n}","{\n \"DAYS\": \"giorni\",\n \"HOURS\": \"ore\",\n \"MINUTES\": \"minuti\",\n \"SECONDS\": \"secondi\",\n \"STARTING_SOON\": \"Inizia presto...\",\n \"DEFAULT_ERROR\": \"Errore di riproduzione\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"Impossibile riprodurre il video. Per favore riprova più tardi.\",\n \"API_ERROR\": \"Errore nel recupero delle informazioni video\",\n \"API_ERROR_DESCRIPTION\": \"Errore nel recupero dei dettagli del video. Controlla il tuo videoId e la connessione internet e riprova.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Autorizzazione\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"Non hai il permesso di riprodurre questo video.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Restrizione geoblocking\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Spiacenti, questo video non è disponibile nella tua regione a causa di restrizioni geografiche.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"Non autorizzato\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Spiacenti, non sei autorizzato a riprodurre questo video.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN BLOCCATA\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"Questo video non è disponibile a causa dell'uso di una VPN.\"\n}\n","{\n \"DAYS\": \"日\",\n \"HOURS\": \"時間\",\n \"MINUTES\": \"分\",\n \"SECONDS\": \"秒\",\n \"STARTING_SOON\": \"まもなく開始...\",\n \"DEFAULT_ERROR\": \"再生エラー\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"ビデオを再生できません。後でもう一度お試しください。\",\n \"API_ERROR\": \"ビデオ情報の取得に失敗しました\",\n \"API_ERROR_DESCRIPTION\": \"ビデオの詳細を取得中にエラーが発生しました。videoIdとインターネット接続を確認して、もう一度お試しください。\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"認証\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"このビデオを再生する権限がありません。\",\n \"ERROR_CODE_GEO_BLOCKED\": \"地域制限\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"申し訳ありませんが、地域制限のためこのビデオはご利用いただけません。\",\n \"ERROR_CODE_NOT_ENTITLED\": \"権利なし\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"申し訳ありませんが、このビデオを再生する権利がありません。\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPNブロック\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"VPNの使用により、このビデオはご利用いただけません。\"\n}","{\n \"DAYS\": \"일\",\n \"HOURS\": \"시간\",\n \"MINUTES\": \"분\",\n \"SECONDS\": \"초\",\n \"STARTING_SOON\": \"곧 시작...\",\n \"DEFAULT_ERROR\": \"재생 오류\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"비디오를 재생할 수 없습니다. 나중에 다시 시도해 주세요.\",\n \"API_ERROR\": \"비디오 정보 가져오기 실패\",\n \"API_ERROR_DESCRIPTION\": \"비디오 세부 정보를 가져오는 중 오류가 발생했습니다. videoId와 인터넷 연결을 확인하고 다시 시도해 주세요.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"인증\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"이 비디오를 재생할 권한이 없습니다.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"지역 제한\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"죄송합니다. 이 비디오는 지역 제한으로 인해 귀하의 지역에서 사용할 수 없습니다.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"권한 없음\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"죄송합니다. 이 비디오를 재생할 권한이 없습니다.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN 차단됨\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"VPN 사용으로 인해 이 비디오를 사용할 수 없습니다.\"\n}","{\n \"DAYS\": \"dias\",\n \"HOURS\": \"horas\",\n \"MINUTES\": \"minutos\",\n \"SECONDS\": \"segundos\",\n \"STARTING_SOON\": \"Começando em breve...\",\n \"DEFAULT_ERROR\": \"Playback Error\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"Não foi possível reproduzir o vídeo. Por favor, tente novamente mais tarde.\",\n \"API_ERROR\": \"Falha ao Recuperar Informações do Vídeo\",\n \"API_ERROR_DESCRIPTION\": \"Erro ao buscar detalhes do vídeo. Verifique seu videoId e conexão com a internet e tente novamente.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Autorização\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"Você não tem permissão para reproduzir este vídeo.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Restrição de Geoblocking\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Desculpe, este vídeo não está disponível em sua região devido a restrições de geoblocking.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"Não autorizado\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Desculpe, você não está autorizado a reproduzir este vídeo.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN BLOQUEADO\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"Este vídeo não está disponível devido ao uso de uma VPN.\"\n}","{\n \"DAYS\": \"дней\",\n \"HOURS\": \"часов\",\n \"MINUTES\": \"мин\",\n \"SECONDS\": \"сек\",\n \"STARTING_SOON\": \"Скоро начнется...\",\n \"DEFAULT_ERROR\": \"Ошибка воспроизведения\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"Не удалось воспроизвести видео. Пожалуйста, попробуйте позже.\",\n \"API_ERROR\": \"Не удалось получить информацию о видео\",\n \"API_ERROR_DESCRIPTION\": \"Ошибка при получении деталей видео. Проверьте ваш videoId и подключение к интернету, затем попробуйте снова.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Авторизация\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"У вас нет разрешения на воспроизведение этого видео.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Географическое ограничение\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Извините, это видео недоступно в вашем регионе из-за географических ограничений.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"Нет прав\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Извините, у вас нет прав на воспроизведение этого видео.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN заблокирован\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"Это видео недоступно из-за использования VPN.\"\n}","{\n \"DAYS\": \"天\",\n \"HOURS\": \"小时\",\n \"MINUTES\": \"分钟\",\n \"SECONDS\": \"秒\",\n \"STARTING_SOON\": \"即将开始...\",\n \"DEFAULT_ERROR\": \"播放错误\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"无法播放视频。请稍后再试。\",\n \"API_ERROR\": \"获取视频信息失败\",\n \"API_ERROR_DESCRIPTION\": \"获取视频详情时出错。请检查您的视频ID和互联网连接,然后重试。\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"授权\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"您没有权限播放此视频。\",\n \"ERROR_CODE_GEO_BLOCKED\": \"地理封锁限制\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"抱歉,由于地理封锁限制,此视频在您的地区不可用。\",\n \"ERROR_CODE_NOT_ENTITLED\": \"无权播放\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"抱歉,您无权播放此视频。\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN被封锁\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"由于使用VPN,此视频不可用。\"\n}\n ","{\n \"DAYS\": \"dagen\",\n \"HOURS\": \"uren\",\n \"MINUTES\": \"min\",\n \"SECONDS\": \"sec\",\n \"STARTING_SOON\": \"Begint binnenkort...\",\n \"EVENT_NOT_STARTED\": \"Dit evenement is nog niet begonnen...\",\n \"DEFAULT_ERROR\": \"Afspelfout\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"Kan de video niet afspelen. Probeer het later opnieuw.\",\n \"API_ERROR\": \"Kan videogegevens niet ophalen\",\n \"API_ERROR_DESCRIPTION\": \"Fout bij het ophalen van videogegevens. Controleer uw video-ID en internetverbinding en probeer het opnieuw.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Autorisatie\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"U heeft geen toestemming om deze video af te spelen.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Geoblocking Beperking\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Sorry, deze video is niet beschikbaar in uw regio vanwege geoblocking beperkingen.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"Geen recht\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Sorry, u heeft geen recht om deze video af te spelen.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN GEBLOKKEERD\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"Deze video is niet beschikbaar vanwege het gebruik van een VPN.\"\n}\n","{\n \"DAYS\": \"روزها\",\n \"HOURS\": \"ساعتها\",\n \"MINUTES\": \"دقیقهها\",\n \"SECONDS\": \"ثانیهها\",\n \"STARTING_SOON\": \"به زودی شروع میشود...\",\n \"EVENT_NOT_STARTED\": \"این رویداد هنوز شروع نشده است...\",\n \"DEFAULT_ERROR\": \"خطای پخش\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"امکان پخش ویدیو وجود ندارد. لطفاً بعداً دوباره تلاش کنید.\",\n \"API_ERROR\": \"خطا در بازیابی اطلاعات ویدیو\",\n \"API_ERROR_DESCRIPTION\": \"خطا در دریافت جزئیات ویدیو. ویدیوId و اتصال اینترنت خود را بررسی کرده و دوباره تلاش کنید.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"مجوز\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"شما اجازه پخش این ویدیو را ندارید.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"محدودیت جغرافیایی\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"متاسفیم، این ویدیو به دلیل محدودیتهای جغرافیایی در منطقه شما در دسترس نیست.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"عدم دسترسی\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"متاسفیم، شما اجازه پخش این ویدیو را ندارید.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"مسدود شدن VPN\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"این ویدیو به دلیل استفاده از VPN در دسترس نیست.\"\n}","import React, { CSSProperties, useCallback, useEffect, useState } from 'react';\nimport { twMerge } from 'tailwind-merge';\nimport { useQuery } from '@tanstack/react-query';\nimport { Player } from './Player';\nimport type { PlayerProps } from './types';\nimport { fetchEventData, type EventData, EventsSortDirection } from './api/event';\nimport { fetchVideosList, type VideoListItem } from './api/video';\nimport { Loading, ErrorScreen, Title } from './components';\nimport { errorTypes, findHLSPlaylist } from './helper';\nimport useMessages, { type Translations } from './messages/useMessages';\n\nexport interface EventProps extends Omit<PlayerProps, 'src'> {\n publicKey: string;\n eventId: string;\n hideTitle?: boolean;\n locale?: string;\n filter?: string;\n order?: EventsSortDirection;\n events?: {\n onEventData?: (event: EventData) => void;\n onVideoData?: (video: VideoListItem) => void;\n onEmptyPlaylists?: () => void;\n onError?: (error: Error) => void;\n onPlay?: () => void;\n onPause?: () => void;\n onEnded?: () => void;\n onLoadStart?: () => void;\n onCanPlay?: () => void;\n onPlayerReady?: () => void;\n };\n className?: string;\n settings?: {\n backgroundImageUrl?: string;\n showCountdownAnimation?: boolean;\n };\n auth?: {\n mottoToken?: string;\n userId?: string;\n };\n // TanStack Query options\n queryOptions?: {\n enabled?: boolean;\n staleTime?: number;\n cacheTime?: number;\n retry?: number;\n retryDelay?: number;\n };\n}\n\nexport const Event: React.FC<EventProps> = ({\n publicKey,\n eventId,\n events,\n hideTitle,\n locale = 'en',\n order,\n filter,\n className,\n settings,\n auth,\n queryOptions = {},\n ...props\n}) => {\n // Event data fetching\n const {\n data: eventData,\n isLoading: isEventLoading,\n error: eventError\n } = useQuery<EventData>({\n queryKey: ['event', publicKey, eventId, filter, order, locale],\n queryFn: () => fetchEventData(publicKey, eventId, undefined, filter, order, locale),\n enabled: !!publicKey && !!eventId,\n staleTime: queryOptions.staleTime ?? 5 * 60 * 1000, // 5 minutes\n gcTime: queryOptions.cacheTime ?? 10 * 60 * 1000, // 10 minutes\n retry: queryOptions.retry ?? 3,\n retryDelay: queryOptions.retryDelay ?? ((attemptIndex: number) => Math.min(1000 * 2 ** attemptIndex, 30000))\n });\n\n const [activePlaylist, setActivePlaylist] = useState<string | null>();\n const [activeVideoId, setActiveVideoId] = useState<string | null>();\n const videoIds = eventData?.videoIds ?? [];\n\n // Videos list fetching\n const {\n data: videosData,\n isLoading: videosIsLoading,\n error: videosError, \n } = useQuery<VideoListItem[]>({\n queryKey: ['videos-list', publicKey, videoIds, auth?.mottoToken],\n queryFn: () => fetchVideosList(publicKey, videoIds, auth?.mottoToken, 0, 0),\n enabled: !!publicKey && videoIds.length > 0,\n refetchInterval: activePlaylist === null ? 30000 : false,\n staleTime: queryOptions.staleTime ?? 5 * 60 * 1000,\n gcTime: queryOptions.cacheTime ?? 10 * 60 * 1000,\n retry: queryOptions.retry ?? 3,\n retryDelay: queryOptions.retryDelay ?? ((attemptIndex: number) => Math.min(1000 * 2 ** attemptIndex, 30000))\n });\n\n const [loadingApisState, setLoadingApisState] = useState(true);\n\n // Process videos data to find active playlist\n useEffect(() => {\n if (videosData !== undefined) {\n setLoadingApisState(false);\n\n const videosWithPlaylists = videosData.filter(\n (video) => video.playlists && video.playlists.length > 0\n );\n\n if (videosWithPlaylists.length > 0) {\n let hlsPlaylistFound = false;\n // Iterate to find the first HLS playlist\n for (const video of videosWithPlaylists) {\n const hlsPlaylist = findHLSPlaylist(video);\n if (hlsPlaylist?.url) {\n setActivePlaylist(hlsPlaylist.url);\n setActiveVideoId(video.id);\n hlsPlaylistFound = true;\n break;\n }\n }\n if (!hlsPlaylistFound) {\n setActivePlaylist(null);\n setActiveVideoId(null);\n }\n } else {\n setActivePlaylist(null);\n setActiveVideoId(null);\n }\n } else if (eventData && (!eventData.videoIds || eventData.videoIds.length === 0)) {\n setLoadingApisState(false);\n setActivePlaylist(null);\n setActiveVideoId(null);\n }\n }, [videosData, eventData]);\n \n const { t } = useMessages(locale);\n\n // Notify parent of event data\n useEffect(() => {\n if (events?.onEventData && eventData) {\n events.onEventData(eventData);\n }\n }, [eventData, events]);\n\n // Notify parent of video data\n useEffect(() => {\n if (events?.onVideoData && activeVideoId && videosData) {\n const activeVideo = videosData.find((video) => video.id === activeVideoId);\n if (activeVideo) {\n events.onVideoData(activeVideo);\n }\n }\n }, [activeVideoId, videosData, events]);\n\n // All state and hooks must be defined before any conditional returns\n const [error, setError] = useState<Error | null>(null);\n const [loadingPlaylist, setLoadingPlaylist] = useState(true);\n const videosDataError = videosData?.some((video) => !!video.error);\n\n // Error handling\n useEffect(() => {\n if (eventError || videosError || videosDataError) {\n const errorObj = eventError || videosError || \n (videosData?.find((video) => !!video.error)?.error && \n new Error(videosData?.find((video) => !!video.error)?.error)) || \n new Error('default');\n \n setError(errorObj);\n if (events?.onError) {\n events.onError(errorObj);\n }\n } else {\n setError(null);\n }\n }, [eventError, videosError, videosDataError, videosData, events]);\n \n // Loading state management\n useEffect(() => {\n const eventLoadedWithNoVideos =\n !isEventLoading &&\n eventData &&\n eventData.videoIds &&\n (!eventData.videoIds || eventData?.videoIds?.length === 0) &&\n !loadingApisState;\n\n const allApisLoadedWithPotentialVideos =\n !isEventLoading &&\n !videosIsLoading &&\n eventData &&\n !loadingApisState;\n\n if (eventLoadedWithNoVideos || allApisLoadedWithPotentialVideos) {\n setLoadingPlaylist(false);\n }\n }, [isEventLoading, videosIsLoading, eventData, loadingApisState]);\n\n // Error state\n if (error) {\n const title = t(error.message as keyof Translations)?.length ? \n t(error.message as keyof Translations) : t(\"DEFAULT_ERROR\"); \n const description = t(`${error.message}_DESCRIPTION` as keyof Translations)?.length ? \n t(`${error.message}_DESCRIPTION` as keyof Translations) : t(\"DEFAULT_ERROR_DESCRIPTION\");\n \n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <ErrorScreen\n title={title}\n description={description}\n />\n </div>\n </div>\n );\n }\n \n // Handle empty playlists\n if (!loadingPlaylist && eventData && !activePlaylist && events?.onEmptyPlaylists) {\n events.onEmptyPlaylists();\n }\n\n // Loading state\n if (loadingPlaylist) {\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full bg-[#151515]\">\n <Loading />\n </div>\n </div>\n );\n }\n\n // Active video player\n if (activePlaylist && activeVideoId && videosData) {\n const activeVideo = videosData.find((video) => video.id === activeVideoId);\n \n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <Player\n {...props}\n src={activePlaylist}\n className={twMerge(className, \"peer\")}\n events={events}\n containerClassName=\"w-full h-full\"\n />\n {!hideTitle && eventData && (\n <TitleAndDescription \n title={eventData.title} \n description={eventData.description || ''} \n startTime={eventData.startTime} \n locale={locale} \n />\n )}\n </div>\n </div>\n );\n }\n\n // Pre-event countdown\n if (eventData) {\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <PreEvent \n event={eventData} \n hideTitle={hideTitle} \n locale={locale} \n backgroundImageUrl={settings?.backgroundImageUrl} \n showAnimation={settings?.showCountdownAnimation} \n />\n </div>\n </div>\n );\n }\n\n return null;\n};\n\n// Pre-event countdown component\nfunction PreEvent({ \n event, \n locale = 'en', \n hideTitle, \n backgroundImageUrl, \n showAnimation = true \n}: { \n event: EventData; \n locale?: string; \n hideTitle?: boolean; \n backgroundImageUrl?: string; \n showAnimation?: boolean;\n}): JSX.Element {\n const date = new Date(event.startTime);\n const now = new Date();\n const [remainingTime, setRemainingTime] = useState(\n date.getTime() - now.getTime()\n );\n const shouldBeStarted = remainingTime < 0;\n const { t } = useMessages(locale);\n useEffect(() => {\n const interval = setInterval(() => {\n if (remainingTime < 0) {\n clearInterval(interval);\n } else {\n setRemainingTime(date.getTime() - new Date().getTime());\n }\n }, 1000);\n\n return () => clearInterval(interval);\n }, [date, remainingTime]);\n\n const renderCountdown = useCallback(() => {\n if (shouldBeStarted) {\n return <span className=\"text-base-content text-xl\">{t(\"EVENT_NOT_STARTED\")}</span>;\n }\n\n const seconds = Math.floor(remainingTime / 1000) % 60;\n const minutes = Math.floor(remainingTime / 1000 / 60) % 60;\n const hours = Math.floor(remainingTime / 1000 / 60 / 60) % 24;\n const days = Math.floor(remainingTime / 1000 / 60 / 60 / 24);\n\n return (\n <div className=\"grid grid-flow-col gap-5 text-center auto-cols-max\">\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": days } as CSSProperties} \n aria-live=\"polite\" \n aria-label={days.toString()}\n >\n {days?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"DAYS\")}</span>\n </div>\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": hours } as CSSProperties} \n aria-live=\"polite\" \n aria-label={hours.toString()}\n >\n {hours?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"HOURS\")}</span>\n </div>\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": minutes } as CSSProperties} \n aria-live=\"polite\" \n aria-label={minutes.toString()}\n >\n {minutes?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"MINUTES\")}</span>\n </div>\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": seconds } as CSSProperties} \n aria-live=\"polite\" \n aria-label={seconds.toString()}\n >\n {seconds?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"SECONDS\")}</span>\n </div>\n </div>\n );\n }, [remainingTime, shouldBeStarted, t]);\n\n return (\n <>\n {event?.posterUrl ? (\n <>\n <div \n className=\"relative overflow-hidden bg-base-200 aspect-video text-base-content w-full h-full flex justify-center items-center flex-col bg-no-repeat bg-cover md:rounded-2xl\" \n style={{ \n backgroundImage: `url(${event.posterUrl})`, \n backgroundRepeat: 'no-repeat', \n backgroundSize: 'cover' \n }}\n >\n <div className=\"absolute inset-0 bg-base-200\"></div>\n <div className=\"relative z-10\">\n {renderCountdown()}\n </div>\n </div>\n {!hideTitle && (\n <TitleAndDescription \n title={event.title} \n description={event.description || ''} \n startTime={event.startTime} \n locale={locale} \n />\n )}\n </>\n ) : (\n <>\n <div \n className=\"relative overflow-hidden md:rounded-2xl bg-base-200 aspect-video text-base-content flex flex-col justify-center items-center w-full h-full bg-cover bg-center bg-no-repeat\" \n style={{\n backgroundImage: backgroundImageUrl ? `url(${backgroundImageUrl})` : '',\n }}\n >\n {backgroundImageUrl && <div className=\"absolute inset-0 bg-black bg-opacity-40\"></div>}\n <div className=\"relative z-10\">\n {renderCountdown()}\n </div>\n </div>\n {!hideTitle && (\n <TitleAndDescription \n title={event.title} \n description={event.description || ''} \n startTime={event.startTime} \n locale={locale} \n />\n )}\n </>\n )}\n </>\n );\n}\n\n// Title and description component\nconst TitleAndDescription = ({ \n title, \n description, \n startTime, \n locale = 'en', \n className \n}: { \n title: string; \n description: string; \n startTime: string; \n locale?: string; \n className?: string;\n}) => {\n return (\n <div className={twMerge(\"mt-3 mb-6 m-event-details-ctn px-4 text-left w-full\", className)}>\n <div className=\"text-base md:text-xl m-event-title text-base-content font-medium\">{title}</div>\n {startTime ? (\n <div className=\"text-sm md:text-base text-base-content/70 m-event-start-time\">\n {new Date(startTime || \"\").toLocaleDateString(locale || \"default\", {\n month: \"long\",\n year: \"numeric\",\n day: \"numeric\",\n })}{\" \"}\n - {new Date(startTime || \"\").toLocaleTimeString(locale || \"default\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n })}\n </div>\n ) : null}\n {description && (\n <div className=\"text-xs md:text-sm text-base-content/60 uppercase\">{description}</div>\n )}\n </div>\n );\n}; ","import React, { CSSProperties, useEffect, useState } from 'react';\nimport { twMerge } from 'tailwind-merge';\nimport { useQuery } from '@tanstack/react-query';\nimport { Player } from './Player';\nimport type { PlayerProps } from './types';\nimport { fetchCreativeWorkData, type CreativeWorkData, CreativeWorksSortDirection } from './api/creative-work';\nimport { fetchVideosList, type VideoListItem } from './api/video';\nimport { Loading, ErrorScreen, Title } from './components';\nimport { errorTypes, findHLSPlaylist } from './helper';\nimport useMessages, { type Translations } from './messages/useMessages';\n\nexport interface CreativeWorkProps extends Omit<PlayerProps, 'src'> {\n publicKey: string;\n creativeWorkId: string;\n hideTitle?: boolean;\n locale?: string;\n filter?: string;\n order?: CreativeWorksSortDirection;\n events?: {\n onCreativeWorkData?: (creativeWork: CreativeWorkData) => void;\n onVideoData?: (video: VideoListItem) => void;\n onEmptyPlaylists?: () => void;\n onError?: (error: Error) => void;\n onPlay?: () => void;\n onPause?: () => void;\n onEnded?: () => void;\n onLoadStart?: () => void;\n onCanPlay?: () => void;\n onPlayerReady?: () => void;\n };\n className?: string;\n settings?: {\n backgroundImageUrl?: string;\n showCountdownAnimation?: boolean;\n };\n auth?: {\n mottoToken?: string;\n userId?: string;\n };\n // TanStack Query options\n queryOptions?: {\n enabled?: boolean;\n staleTime?: number;\n cacheTime?: number;\n retry?: number;\n retryDelay?: number;\n };\n}\n\nexport const CreativeWork: React.FC<CreativeWorkProps> = ({\n publicKey,\n creativeWorkId,\n events,\n hideTitle,\n locale = 'en',\n order,\n filter,\n className,\n settings,\n auth,\n queryOptions = {},\n ...props\n}) => {\n // CreativeWork data fetching\n const {\n data: creativeWorkData,\n isLoading: isCreativeWorkLoading,\n error: creativeWorkError\n } = useQuery<CreativeWorkData>({\n queryKey: ['creative-work', publicKey, creativeWorkId, filter, order, locale],\n queryFn: () => fetchCreativeWorkData(publicKey, creativeWorkId, undefined, filter, order, locale),\n enabled: !!publicKey && !!creativeWorkId,\n staleTime: queryOptions.staleTime ?? 5 * 60 * 1000, // 5 minutes\n gcTime: queryOptions.cacheTime ?? 10 * 60 * 1000, // 10 minutes\n retry: queryOptions.retry ?? 3,\n retryDelay: queryOptions.retryDelay ?? ((attemptIndex: number) => Math.min(1000 * 2 ** attemptIndex, 30000))\n });\n\n const [activePlaylist, setActivePlaylist] = useState<string | null>();\n const [activeVideoId, setActiveVideoId] = useState<string | null>();\n const [showCountDown, setShowCountDown] = useState(false);\n const videoIds = creativeWorkData?.videoIds ?? [];\n\n // Videos list fetching\n const {\n data: videosData,\n isLoading: videosIsLoading,\n error: videosError, \n } = useQuery<VideoListItem[]>({\n queryKey: ['videos-list', publicKey, videoIds, auth?.mottoToken],\n queryFn: () => fetchVideosList(publicKey, videoIds, auth?.mottoToken, 0, 0),\n enabled: !!publicKey && videoIds.length > 0,\n refetchInterval: activePlaylist === null ? 30000 : false,\n staleTime: queryOptions.staleTime ?? 5 * 60 * 1000,\n gcTime: queryOptions.cacheTime ?? 10 * 60 * 1000,\n retry: queryOptions.retry ?? 3,\n retryDelay: queryOptions.retryDelay ?? ((attemptIndex: number) => Math.min(1000 * 2 ** attemptIndex, 30000))\n });\n\n const [loadingApisState, setLoadingApisState] = useState(true);\n\n // Process videos data to find active playlist\n useEffect(() => {\n if (videosData !== undefined) {\n setLoadingApisState(false);\n\n const videosWithPlaylists = videosData.filter(\n (video) => video.playlists && video.playlists.length > 0\n );\n\n if (videosWithPlaylists.length > 0) {\n let hlsPlaylistFound = false;\n // Iterate to find the first HLS playlist\n for (const video of videosWithPlaylists) {\n const hlsPlaylist = findHLSPlaylist(video);\n if (hlsPlaylist?.url) {\n setActivePlaylist(hlsPlaylist.url);\n setActiveVideoId(video.id);\n hlsPlaylistFound = true;\n break;\n }\n }\n if (!hlsPlaylistFound) {\n setActivePlaylist(null);\n setActiveVideoId(null);\n }\n } else {\n setActivePlaylist(null);\n setActiveVideoId(null);\n }\n } else if (creativeWorkData && (!creativeWorkData.videoIds || creativeWorkData.videoIds.length === 0)) {\n setLoadingApisState(false);\n setActivePlaylist(null);\n setActiveVideoId(null);\n }\n }, [videosData, creativeWorkData]);\n \n const { t } = useMessages(locale);\n\n // Notify parent of creative work data\n useEffect(() => {\n if (events?.onCreativeWorkData && creativeWorkData) {\n events.onCreativeWorkData(creativeWorkData);\n }\n if (creativeWorkData && !creativeWorkData?.videoIds?.length) {\n setShowCountDown(true);\n }\n }, [creativeWorkData, events]);\n\n // Notify parent of video data\n useEffect(() => {\n if (events?.onVideoData && activeVideoId && videosData) {\n const activeVideo = videosData.find((video) => video.id === activeVideoId);\n if (activeVideo) {\n events.onVideoData(activeVideo);\n }\n }\n }, [activeVideoId, videosData, events]);\n\n const [error, setError] = useState<Error | null>(null);\n const videosDataError = videosData?.some((video) => !!video.error);\n\n // Error handling\n useEffect(() => {\n if (creativeWorkError || videosError || videosDataError) {\n const errorObj = creativeWorkError || videosError || \n (videosData?.find((video) => !!video.error)?.error && \n new Error(videosData?.find((video) => !!video.error)?.error)) || \n new Error('default');\n \n setError(errorObj);\n if (events?.onError) {\n events.onError(errorObj);\n }\n } else {\n setError(null);\n }\n }, [creativeWorkError, videosError, videosDataError, videosData, events]);\n\n // Error state\n if (error) {\n const title = t(error.message as keyof Translations)?.length ? \n t(error.message as keyof Translations) : t(\"DEFAULT_ERROR\"); \n const description = t(`${error.message}_DESCRIPTION` as keyof Translations)?.length ? \n t(`${error.message}_DESCRIPTION` as keyof Translations) : t(\"DEFAULT_ERROR_DESCRIPTION\");\n \n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <ErrorScreen\n title={title}\n description={description}\n />\n </div>\n </div>\n );\n }\n\n const [loadingPlaylist, setLoadingPlaylist] = useState(true);\n \n // Loading state management\n useEffect(() => {\n const creativeWorkLoadedWithNoVideos =\n !isCreativeWorkLoading &&\n creativeWorkData &&\n creativeWorkData.videoIds &&\n creativeWorkData.videoIds.length === 0;\n\n const creativeWorkLoadedWithNoData =\n !isCreativeWorkLoading && creativeWorkData && !creativeWorkData.videoIds;\n\n const isEventsFinished =\n !videosIsLoading &&\n videosData &&\n videosData.length > 0 &&\n videosData.every((video) => video.playlists && video.playlists.length === 0);\n\n if (\n creativeWorkLoadedWithNoVideos ||\n creativeWorkLoadedWithNoData ||\n isEventsFinished\n ) {\n setLoadingPlaylist(false);\n if (events?.onEmptyPlaylists) {\n events.onEmptyPlaylists();\n }\n } else if (activePlaylist) {\n setLoadingPlaylist(false);\n }\n }, [\n isCreativeWorkLoading,\n creativeWorkData,\n videosIsLoading,\n videosData,\n activePlaylist,\n events,\n ]);\n\n // Loading state\n if (isCreativeWorkLoading || videosIsLoading || loadingApisState) {\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <Loading />\n </div>\n </div>\n );\n }\n\n // Show countdown if creative work hasn't started yet\n if (showCountDown && creativeWorkData) {\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full bg-base-200 text-base-content flex justify-center items-center flex-col\">\n <PreCreativeWork \n creativeWork={creativeWorkData} \n locale={locale} \n hideTitle={hideTitle}\n backgroundImageUrl={settings?.backgroundImageUrl} \n showAnimation={settings?.showCountdownAnimation} \n />\n </div>\n </div>\n );\n }\n\n // Show player if we have an active playlist\n if (activeVideoId && activePlaylist && !loadingPlaylist) {\n const activeVideo = videosData?.find((video) => video.id === activeVideoId);\n \n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <Player\n {...props}\n className={twMerge(className, \"peer\")}\n events={{\n ...events,\n }}\n src={activePlaylist}\n containerClassName=\"w-full h-full\"\n />\n {!hideTitle && (\n <TitleAndDescription\n title={creativeWorkData?.title || ''}\n description={creativeWorkData?.description || ''}\n releaseTime={creativeWorkData?.releaseTime || ''}\n locale={locale}\n className=\"mt-3 mb-6 m-event-details-ctn px-4\"\n />\n )}\n </div>\n </div>\n );\n }\n\n // Loading state for playlist\n if (loadingPlaylist) {\n return <Loading />;\n }\n\n // Empty state\n return null;\n};\n\nfunction PreCreativeWork({ \n creativeWork, \n locale = 'en', \n hideTitle, \n backgroundImageUrl, \n showAnimation = true \n}: { \n creativeWork: CreativeWorkData; \n locale?: string; \n hideTitle?: boolean; \n backgroundImageUrl?: string; \n showAnimation?: boolean;\n}): JSX.Element {\n const date = new Date(creativeWork.releaseTime);\n const now = new Date();\n const [remainingTime, setRemainingTime] = useState(\n date.getTime() - now.getTime()\n );\n const shouldBeStarted = remainingTime < 0;\n const { t } = useMessages(locale);\n\n useEffect(() => {\n const interval = setInterval(() => {\n if (remainingTime < 0) {\n clearInterval(interval);\n } else {\n setRemainingTime(date.getTime() - new Date().getTime());\n }\n }, 1000);\n\n return () => { clearInterval(interval); };\n }, [date, remainingTime]);\n\n const renderCountdown = () => {\n if (shouldBeStarted) {\n return <span className=\"text-base-content text-xl\">{t(\"EVENT_NOT_STARTED\")}</span>;\n }\n\n const seconds = Math.floor(remainingTime / 1000) % 60;\n const minutes = Math.floor(remainingTime / 1000 / 60) % 60;\n const hours = Math.floor(remainingTime / 1000 / 60 / 60) % 24;\n const days = Math.floor(remainingTime / 1000 / 60 / 60 / 24);\n\n return (\n <div className=\"grid grid-flow-col gap-5 text-center auto-cols-max\">\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": days } as CSSProperties} \n aria-live=\"polite\" \n aria-label={days.toString()}\n >\n {days?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"DAYS\")}</span>\n </div>\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": hours } as CSSProperties} \n aria-live=\"polite\" \n aria-label={hours.toString()}\n >\n {hours?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"HOURS\")}</span>\n </div>\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": minutes } as CSSProperties} \n aria-live=\"polite\" \n aria-label={minutes.toString()}\n >\n {minutes?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"MINUTES\")}</span>\n </div>\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": seconds } as CSSProperties} \n aria-live=\"polite\" \n aria-label={seconds.toString()}\n >\n {seconds?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"SECONDS\")}</span>\n </div>\n </div>\n );\n };\n\n return (\n <>\n <div \n className=\"relative overflow-hidden md:rounded-2xl bg-base-200 aspect-video text-base-content flex flex-col justify-center items-center w-full h-full bg-cover bg-center bg-no-repeat\" \n style={{\n backgroundImage: backgroundImageUrl ? `url(${backgroundImageUrl})` : '',\n }}\n >\n {backgroundImageUrl && <div className=\"absolute inset-0 bg-black bg-opacity-40\"></div>}\n <div className=\"relative z-10\">\n {renderCountdown()}\n </div>\n </div>\n {!hideTitle && (\n <TitleAndDescription\n title={creativeWork.title}\n description={creativeWork.description || ''}\n releaseTime={creativeWork.releaseTime}\n locale={locale}\n />\n )}\n </>\n );\n}\n\nconst TitleAndDescription = ({ \n title, \n description, \n releaseTime, \n locale = 'en', \n className \n}: { \n title: string; \n description: string; \n releaseTime: string; \n locale?: string; \n className?: string;\n}) => {\n return (\n <div className={twMerge(\"mt-3 mb-6 m-event-details-ctn px-4 text-left w-full\", className)}>\n <div className=\"text-base md:text-xl m-event-title text-base-content font-medium\">{title}</div>\n {releaseTime ? (\n <div className=\"text-sm md:text-base text-base-content/70 m-event-start-time\">\n {new Date(releaseTime || \"\").toLocaleDateString(locale || \"default\", {\n month: \"long\",\n year: \"numeric\",\n day: \"numeric\",\n })}{\" \"}\n - {new Date(releaseTime || \"\").toLocaleTimeString(locale || \"default\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n })}\n </div>\n ) : null}\n {description && (\n <div className=\"text-xs md:text-sm text-base-content/60 uppercase\">{description}</div>\n )}\n </div>\n );\n}; ","'use client';\n\nimport React from 'react';\nimport { Event, type EventProps } from './Event';\n\n/**\n * Client-side wrapper for the Event component to prevent SSR issues\n * This component ensures that Event is only rendered on the client-side\n */\nexport const ClientSideEvent: React.FC<EventProps> = (props) => {\n const [isClient, setIsClient] = React.useState(false);\n\n React.useEffect(() => {\n setIsClient(true);\n }, []);\n\n // Only render on client-side\n if (!isClient) {\n return (\n <div className=\"md:rounded-2xl overflow-hidden aspect-video\">\n <div className=\"relative w-full h-full bg-[#151515] flex items-center justify-center\">\n <div className=\"text-white\">Loading...</div>\n </div>\n </div>\n );\n }\n\n return <Event {...props} />;\n};\n\nexport default ClientSideEvent; ","import React from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\n\n// Create a client\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 5 * 60 * 1000, // 5 minutes\n gcTime: 10 * 60 * 1000, // 10 minutes\n retry: 3,\n refetchOnWindowFocus: false,\n },\n },\n});\n\ninterface QueryProviderProps {\n children: React.ReactNode;\n}\n\nexport const QueryProvider: React.FC<QueryProviderProps> = ({ children }) => {\n return (\n <QueryClientProvider client={queryClient}>\n {children}\n </QueryClientProvider>\n );\n};\n\nexport { queryClient }; ","import './index.css';\nimport { Player } from './Player';\n\nexport { Player } from './Player';\nexport { ClientOnlyPlayer } from './ClientOnlyPlayer';\nexport { Video } from './Video';\nexport { Event } from './Event';\nexport { CreativeWork } from './CreativeWork';\nexport { ClientSideEvent } from './ClientSideEvent';\nexport { QueryProvider } from './QueryProvider';\n\n// For Next.js users who want to use dynamic imports\n// Usage: const MottoPlayer = dynamic(() => import('@motto/video-player'), { ssr: false });\nexport default { Player };\n\nexport * from './types';\nexport * from './api';\nexport type { VideoProps } from './Video';\nexport type { EventProps } from './Event';\nexport type { CreativeWorkProps } from './CreativeWork';\nexport type { VideoData, VideoListItem } from './api/video';\nexport type { EventData, EventsSortDirection } from './api/event';\nexport type { CreativeWorkData } from './api/creative-work'; "],"mappings":";;;AACyB,SAAR,YAA6B,KAAK,EAAE,SAAS,IAAI,CAAC,GAAG;AAC1D,MAAI,CAAC,OAAO,OAAO,aAAa,YAAa;AAE7C,QAAM,OAAO,SAAS,QAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC;AACrE,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,OAAO;AAEb,MAAI,aAAa,OAAO;AACtB,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C,GACF;AAAA,EAEJ;AAEA,SAAO,gBAAAA,MAAC,SAAO,GAAG,OAAO;AAC3B;;;AC3BA,SAAS,aAAa,2BAA2B;AAoB7C,gBAAAE,aAAA;AAjBJ,IAAM,cAAc,IAAI,YAAY;AAAA,EAClC,gBAAgB;AAAA,IACd,SAAS;AAAA,MACP,WAAW,IAAI,KAAK;AAAA;AAAA,MACpB,QAAQ,KAAK,KAAK;AAAA;AAAA,MAClB,OAAO;AAAA,MACP,sBAAsB;AAAA,IACxB;AAAA,EACF;AACF,CAAC;AAMM,IAAM,gBAA8C,CAAC,EAAE,SAAS,MAAM;AAC3E,SACE,gBAAAA,MAAC,uBAAoB,QAAQ,aAC1B,UACH;AAEJ;;;ACZA,IAAO,gBAAQ,EAAE,OAAO;","names":["useEffect","useRef","shaka","useCallback","useCallback","useCallback","useRef","useCallback","useRef","useRef","useCallback","useCallback","useRef","useEffect","useState","useEffect","useRef","useEffect","useState","jsx","jsxs","jsx","jsx","jsxs","twMerge","jsx","jsxs","useRef","isLive","shaka","useEffect","forwardRef","useEffect","useState","jsx","forwardRef","useState","useEffect","useEffect","twMerge","EventsSortDirection","CreativeWorksSortDirection","useState","useEffect","useState","useEffect","jsx","jsxs","useEffect","twMerge","useCallback","useEffect","useState","twMerge","useQuery","jsx","jsxs","useQuery","useState","useEffect","twMerge","useCallback","useEffect","useState","twMerge","useQuery","Fragment","jsx","jsxs","useQuery","useState","useEffect","twMerge","TitleAndDescription","React","jsx","React","jsx"]}
|
|
1
|
+
{"version":3,"sources":["#style-inject:#style-inject","../src/index.css","../src/Player.tsx","../src/hooks/useShakePlayer.ts","../src/hooks/useQualityControl.ts","../src/hooks/useSkipControls.ts","../src/hooks/useMuxAnalytics.ts","../src/hooks/useShakaUI.ts","../src/hooks/useEventHandlers.ts","../src/hooks/useLiveBadge.ts","../src/hooks/usePosterFallback.ts","../src/hooks/useLiveIndicator.ts","../src/hooks/useShakaAbsoluteTime.ts","../src/components/Loading.tsx","../src/components/ErrorScreen.tsx","../src/components/Title.tsx","../src/components/LiveBadge.tsx","../src/styles.css","../src/Video.tsx","../src/api/video.ts","../src/api/event.ts","../src/api/creative-work.ts","../src/helper.ts","../src/messages/useMessages.tsx","../src/messages/en.json","../src/messages/es.json","../src/messages/ar.json","../src/messages/de.json","../src/messages/fr.json","../src/messages/it.json","../src/messages/ja.json","../src/messages/ko.json","../src/messages/pt.json","../src/messages/ru.json","../src/messages/zh.json","../src/messages/nl.json","../src/messages/fa.json","../src/Event.tsx","../src/CreativeWork.tsx","../src/QueryProvider.tsx","../src/index.ts"],"sourcesContent":["\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\"/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */\\n@layer properties;\\n@layer theme, base, components, utilities;\\n@layer theme {\\n :root,\\n :host {\\n --font-sans:\\n ui-sans-serif,\\n system-ui,\\n sans-serif,\\n \\\"Apple Color Emoji\\\",\\n \\\"Segoe UI Emoji\\\",\\n \\\"Segoe UI Symbol\\\",\\n \\\"Noto Color Emoji\\\";\\n --font-mono:\\n ui-monospace,\\n SFMono-Regular,\\n Menlo,\\n Monaco,\\n Consolas,\\n \\\"Liberation Mono\\\",\\n \\\"Courier New\\\",\\n monospace;\\n --color-red-600: oklch(57.7% 0.245 27.325);\\n --color-black: #000;\\n --color-white: #fff;\\n --spacing: 0.25rem;\\n --container-4xl: 56rem;\\n --text-xs: 0.75rem;\\n --text-xs--line-height: calc(1 / 0.75);\\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-5xl: 3rem;\\n --text-5xl--line-height: 1;\\n --font-weight-medium: 500;\\n --font-weight-semibold: 600;\\n --font-weight-bold: 700;\\n --tracking-wide: 0.025em;\\n --tracking-widest: 0.1em;\\n --radius-md: 0.375rem;\\n --radius-2xl: 1rem;\\n --animate-spin: spin 1s linear infinite;\\n --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\\n --aspect-video: 16 / 9;\\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 *,\\n ::after,\\n ::before,\\n ::backdrop,\\n ::file-selector-button {\\n box-sizing: border-box;\\n margin: 0;\\n padding: 0;\\n border: 0 solid;\\n }\\n html,\\n :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,\\n h2,\\n h3,\\n h4,\\n h5,\\n 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,\\n strong {\\n font-weight: bolder;\\n }\\n code,\\n kbd,\\n samp,\\n 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,\\n 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,\\n ul,\\n menu {\\n list-style: none;\\n }\\n img,\\n svg,\\n video,\\n canvas,\\n audio,\\n iframe,\\n embed,\\n object {\\n display: block;\\n vertical-align: middle;\\n }\\n img,\\n video {\\n max-width: 100%;\\n height: auto;\\n }\\n button,\\n input,\\n select,\\n optgroup,\\n textarea,\\n ::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,\\n ::-webkit-datetime-edit-year-field,\\n ::-webkit-datetime-edit-month-field,\\n ::-webkit-datetime-edit-day-field,\\n ::-webkit-datetime-edit-hour-field,\\n ::-webkit-datetime-edit-minute-field,\\n ::-webkit-datetime-edit-second-field,\\n ::-webkit-datetime-edit-millisecond-field,\\n ::-webkit-datetime-edit-meridiem-field {\\n padding-block: 0;\\n }\\n :-moz-ui-invalid {\\n box-shadow: none;\\n }\\n button,\\n input:where([type=button], [type=reset], [type=submit]),\\n ::file-selector-button {\\n appearance: button;\\n }\\n ::-webkit-inner-spin-button,\\n ::-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-auto {\\n pointer-events: auto;\\n }\\n .pointer-events-none {\\n pointer-events: none;\\n }\\n .visible {\\n visibility: visible;\\n }\\n .sr-only {\\n position: absolute;\\n width: 1px;\\n height: 1px;\\n padding: 0;\\n margin: -1px;\\n overflow: hidden;\\n clip: rect(0, 0, 0, 0);\\n white-space: nowrap;\\n border-width: 0;\\n }\\n .absolute {\\n position: absolute;\\n }\\n .fixed {\\n position: fixed;\\n }\\n .relative {\\n position: relative;\\n }\\n .static {\\n position: static;\\n }\\n .inset-0 {\\n inset: calc(var(--spacing) * 0);\\n }\\n .top-0 {\\n top: calc(var(--spacing) * 0);\\n }\\n .top-4 {\\n top: calc(var(--spacing) * 4);\\n }\\n .right-0 {\\n right: calc(var(--spacing) * 0);\\n }\\n .right-4 {\\n right: calc(var(--spacing) * 4);\\n }\\n .bottom-0 {\\n bottom: calc(var(--spacing) * 0);\\n }\\n .bottom-4 {\\n bottom: calc(var(--spacing) * 4);\\n }\\n .left-0 {\\n left: calc(var(--spacing) * 0);\\n }\\n .left-4 {\\n left: calc(var(--spacing) * 4);\\n }\\n .z-10 {\\n z-index: 10;\\n }\\n .z-50 {\\n z-index: 50;\\n }\\n .container {\\n width: 100%;\\n @media (width >= 40rem) {\\n max-width: 40rem;\\n }\\n @media (width >= 48rem) {\\n max-width: 48rem;\\n }\\n @media (width >= 64rem) {\\n max-width: 64rem;\\n }\\n @media (width >= 80rem) {\\n max-width: 80rem;\\n }\\n @media (width >= 96rem) {\\n max-width: 96rem;\\n }\\n }\\n .m-6 {\\n margin: calc(var(--spacing) * 6);\\n }\\n .mt-1 {\\n margin-top: calc(var(--spacing) * 1);\\n }\\n .mt-3 {\\n margin-top: calc(var(--spacing) * 3);\\n }\\n .mb-2 {\\n margin-bottom: calc(var(--spacing) * 2);\\n }\\n .mb-6 {\\n margin-bottom: calc(var(--spacing) * 6);\\n }\\n .flex {\\n display: flex;\\n }\\n .grid {\\n display: grid;\\n }\\n .hidden {\\n display: none;\\n }\\n .aspect-video {\\n aspect-ratio: var(--aspect-video);\\n }\\n .h-2 {\\n height: calc(var(--spacing) * 2);\\n }\\n .h-8 {\\n height: calc(var(--spacing) * 8);\\n }\\n .h-24 {\\n height: calc(var(--spacing) * 24);\\n }\\n .h-full {\\n height: 100%;\\n }\\n .w-2 {\\n width: calc(var(--spacing) * 2);\\n }\\n .w-8 {\\n width: calc(var(--spacing) * 8);\\n }\\n .w-24 {\\n width: calc(var(--spacing) * 24);\\n }\\n .w-full {\\n width: 100%;\\n }\\n .max-w-4xl {\\n max-width: var(--container-4xl);\\n }\\n .animate-pulse {\\n animation: var(--animate-pulse);\\n }\\n .animate-spin {\\n animation: var(--animate-spin);\\n }\\n .auto-cols-max {\\n grid-auto-columns: max-content;\\n }\\n .grid-flow-col {\\n grid-auto-flow: column;\\n }\\n .flex-col {\\n flex-direction: column;\\n }\\n .items-center {\\n align-items: center;\\n }\\n .justify-center {\\n justify-content: center;\\n }\\n .justify-stretch {\\n justify-content: stretch;\\n }\\n .gap-1 {\\n gap: calc(var(--spacing) * 1);\\n }\\n .gap-5 {\\n gap: calc(var(--spacing) * 5);\\n }\\n .overflow-hidden {\\n overflow: hidden;\\n }\\n .rounded-full {\\n border-radius: calc(infinity * 1px);\\n }\\n .rounded-md {\\n border-radius: var(--radius-md);\\n }\\n .border-b-2 {\\n border-bottom-style: var(--tw-border-style);\\n border-bottom-width: 2px;\\n }\\n .border-white {\\n border-color: var(--color-white);\\n }\\n .bg-\\\\[\\\\#151515\\\\] {\\n background-color: #151515;\\n }\\n .bg-black {\\n background-color: var(--color-black);\\n }\\n .bg-red-600 {\\n background-color: var(--color-red-600);\\n }\\n .bg-white {\\n background-color: var(--color-white);\\n }\\n .bg-gradient-to-t {\\n --tw-gradient-position: to top in oklab;\\n background-image: linear-gradient(var(--tw-gradient-stops));\\n }\\n .from-black\\\\/70 {\\n --tw-gradient-from: color-mix(in srgb, #000 70%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n --tw-gradient-from: color-mix(in oklab, var(--color-black) 70%, transparent);\\n }\\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 .to-transparent {\\n --tw-gradient-to: transparent;\\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 .bg-no-repeat {\\n background-repeat: no-repeat;\\n }\\n .p-2 {\\n padding: calc(var(--spacing) * 2);\\n }\\n .p-4 {\\n padding: calc(var(--spacing) * 4);\\n }\\n .px-2 {\\n padding-inline: calc(var(--spacing) * 2);\\n }\\n .px-4 {\\n padding-inline: calc(var(--spacing) * 4);\\n }\\n .py-1 {\\n padding-block: calc(var(--spacing) * 1);\\n }\\n .text-center {\\n text-align: center;\\n }\\n .text-left {\\n text-align: left;\\n }\\n .font-mono {\\n font-family: var(--font-mono);\\n }\\n .text-2xl {\\n font-size: var(--text-2xl);\\n line-height: var(--tw-leading, var(--text-2xl--line-height));\\n }\\n .text-5xl {\\n font-size: var(--text-5xl);\\n line-height: var(--tw-leading, var(--text-5xl--line-height));\\n }\\n .text-base {\\n font-size: var(--text-base);\\n line-height: var(--tw-leading, var(--text-base--line-height));\\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 .text-xs {\\n font-size: var(--text-xs);\\n line-height: var(--tw-leading, var(--text-xs--line-height));\\n }\\n .text-\\\\[10px\\\\] {\\n font-size: 10px;\\n }\\n .font-bold {\\n --tw-font-weight: var(--font-weight-bold);\\n font-weight: var(--font-weight-bold);\\n }\\n .font-medium {\\n --tw-font-weight: var(--font-weight-medium);\\n font-weight: var(--font-weight-medium);\\n }\\n .font-semibold {\\n --tw-font-weight: var(--font-weight-semibold);\\n font-weight: var(--font-weight-semibold);\\n }\\n .tracking-wide {\\n --tw-tracking: var(--tracking-wide);\\n letter-spacing: var(--tracking-wide);\\n }\\n .tracking-widest {\\n --tw-tracking: var(--tracking-widest);\\n letter-spacing: var(--tracking-widest);\\n }\\n .text-white {\\n color: var(--color-white);\\n }\\n .uppercase {\\n text-transform: uppercase;\\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:\\n var(--tw-inset-shadow),\\n var(--tw-inset-ring-shadow),\\n var(--tw-ring-offset-shadow),\\n var(--tw-ring-shadow),\\n var(--tw-shadow);\\n }\\n .filter {\\n filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);\\n }\\n .md\\\\:rounded-2xl {\\n @media (width >= 48rem) {\\n border-radius: var(--radius-2xl);\\n }\\n }\\n .md\\\\:rounded-2xl\\\\! {\\n @media (width >= 48rem) {\\n border-radius: var(--radius-2xl) !important;\\n }\\n }\\n .md\\\\:text-base {\\n @media (width >= 48rem) {\\n font-size: var(--text-base);\\n line-height: var(--tw-leading, var(--text-base--line-height));\\n }\\n }\\n .md\\\\:text-sm {\\n @media (width >= 48rem) {\\n font-size: var(--text-sm);\\n line-height: var(--tw-leading, var(--text-sm--line-height));\\n }\\n }\\n .md\\\\:text-xl {\\n @media (width >= 48rem) {\\n font-size: var(--text-xl);\\n line-height: var(--tw-leading, var(--text-xl--line-height));\\n }\\n }\\n}\\n@layer components {\\n .motto-video-container {\\n position: relative;\\n width: 100%;\\n min-height: 300px;\\n }\\n @supports (aspect-ratio: 16/9) {\\n .motto-video-container {\\n min-height: auto;\\n }\\n }\\n .motto-video-responsive {\\n position: absolute;\\n top: calc(var(--spacing) * 0);\\n left: calc(var(--spacing) * 0);\\n height: 100%;\\n width: 100%;\\n }\\n .motto-skip-button {\\n position: absolute;\\n top: calc(1/2 * 100%);\\n z-index: 10;\\n display: flex;\\n height: calc(var(--spacing) * 16);\\n width: calc(var(--spacing) * 16);\\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\\n translate: var(--tw-translate-x) var(--tw-translate-y);\\n cursor: pointer;\\n align-items: center;\\n justify-content: center;\\n border-radius: calc(infinity * 1px);\\n border-style: var(--tw-border-style);\\n border-width: 0px;\\n background-color: color-mix(in srgb, #000 70%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n background-color: color-mix(in oklab, var(--color-black) 70%, transparent);\\n }\\n font-size: var(--text-2xl);\\n line-height: var(--tw-leading, var(--text-2xl--line-height));\\n color: var(--color-white);\\n opacity: 80%;\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n &:hover {\\n @media (hover: hover) {\\n --tw-scale-x: 110%;\\n --tw-scale-y: 110%;\\n --tw-scale-z: 110%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n }\\n &:hover {\\n @media (hover: hover) {\\n opacity: 100%;\\n }\\n }\\n &:active {\\n --tw-scale-x: 95%;\\n --tw-scale-y: 95%;\\n --tw-scale-z: 95%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n }\\n .motto-skip-button-back {\\n left: calc(var(--spacing) * 5);\\n }\\n .motto-skip-button-forward {\\n right: calc(var(--spacing) * 5);\\n }\\n .motto-mobile-controls-overlay {\\n position: absolute;\\n inset: calc(var(--spacing) * 0);\\n z-index: 20;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\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 --tw-duration: 300ms;\\n transition-duration: 300ms;\\n pointer-events: none;\\n }\\n .motto-mobile-controls-group {\\n display: flex;\\n align-items: center;\\n gap: calc(var(--spacing) * 8);\\n opacity: 100%;\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n pointer-events: none;\\n }\\n .motto-mobile-play-button {\\n display: flex;\\n height: calc(var(--spacing) * 14);\\n width: calc(var(--spacing) * 14);\\n cursor: pointer;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n border-radius: calc(infinity * 1px);\\n border-style: var(--tw-border-style);\\n border-width: 0px;\\n background-color: color-mix(in srgb, #000 30%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n background-color: color-mix(in oklab, var(--color-black) 30%, transparent);\\n }\\n color: var(--color-white);\\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:\\n var(--tw-inset-shadow),\\n var(--tw-inset-ring-shadow),\\n var(--tw-ring-offset-shadow),\\n var(--tw-ring-shadow),\\n var(--tw-shadow);\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n pointer-events: auto;\\n }\\n .motto-mobile-play-button:active {\\n --tw-scale-x: 95%;\\n --tw-scale-y: 95%;\\n --tw-scale-z: 95%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n .motto-mobile-play-button svg {\\n height: calc(var(--spacing) * 7);\\n width: calc(var(--spacing) * 7);\\n }\\n .motto-mobile-skip-button {\\n display: flex;\\n height: calc(var(--spacing) * 10);\\n width: calc(var(--spacing) * 10);\\n cursor: pointer;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n border-radius: calc(infinity * 1px);\\n border-style: var(--tw-border-style);\\n border-width: 0px;\\n background-color: color-mix(in srgb, #000 30%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n background-color: color-mix(in oklab, var(--color-black) 30%, transparent);\\n }\\n color: var(--color-white);\\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:\\n var(--tw-inset-shadow),\\n var(--tw-inset-ring-shadow),\\n var(--tw-ring-offset-shadow),\\n var(--tw-ring-shadow),\\n var(--tw-shadow);\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n pointer-events: auto;\\n }\\n .motto-mobile-skip-button:active {\\n --tw-scale-x: 95%;\\n --tw-scale-y: 95%;\\n --tw-scale-z: 95%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n .motto-mobile-skip-button svg {\\n height: calc(var(--spacing) * 6);\\n width: calc(var(--spacing) * 6);\\n }\\n}\\n@media (min-width: 768px) {\\n .motto-mobile-controls-overlay {\\n display: none !important;\\n }\\n}\\n@media (max-width: 767px) {\\n .shaka-controls-container .motto-native-skip-button,\\n .shaka-controls-container .motto-skip-back-button,\\n .shaka-controls-container .motto-skip-forward-button,\\n .shaka-controls-container .shaka-button[title*=\\\"Skip back\\\"],\\n .shaka-controls-container .shaka-button[title*=\\\"Skip forward\\\"],\\n .shaka-controls-container .shaka-button[aria-label*=\\\"Skip back\\\"],\\n .shaka-controls-container .shaka-button[aria-label*=\\\"Skip forward\\\"],\\n .shaka-controls-container button[title*=\\\"Skip back\\\"],\\n .shaka-controls-container button[title*=\\\"Skip forward\\\"],\\n .shaka-controls-container button[aria-label*=\\\"Skip back\\\"],\\n .shaka-controls-container button[aria-label*=\\\"Skip forward\\\"],\\n .motto-native-skip-button:not(.motto-mobile-skip-button),\\n .motto-skip-back-button:not(.motto-mobile-skip-button),\\n .motto-skip-forward-button:not(.motto-mobile-skip-button),\\n .shaka-button[title*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n .shaka-button[title*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button),\\n .shaka-button[aria-label*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n .shaka-button[aria-label*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button),\\n button[title*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n button[title*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button),\\n button[aria-label*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n button[aria-label*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button) {\\n display: none !important;\\n visibility: hidden !important;\\n opacity: 0 !important;\\n width: 0 !important;\\n height: 0 !important;\\n padding: 0 !important;\\n margin: 0 !important;\\n }\\n .shaka-controls-container {\\n z-index: 90 !important;\\n height: 100px !important;\\n bottom: 0 !important;\\n top: unset !important;\\n }\\n .motto-mobile-skip-button {\\n display: flex !important;\\n visibility: visible !important;\\n opacity: 1 !important;\\n }\\n}\\n.shaka-seek-bar-container {\\n height: 6px !important;\\n width: 100% !important;\\n margin: 8px 0 !important;\\n border-radius: 4px !important;\\n position: relative !important;\\n border-top: none !important;\\n border-bottom: none !important;\\n box-shadow: none !important;\\n}\\n.shaka-seek-bar {\\n height: 6px !important;\\n width: 100% !important;\\n -webkit-appearance: none !important;\\n appearance: none !important;\\n background: transparent !important;\\n cursor: pointer !important;\\n border: none !important;\\n outline: none !important;\\n position: absolute !important;\\n top: 0 !important;\\n left: 0 !important;\\n border-radius: 4px !important;\\n}\\n.shaka-seek-bar::-webkit-slider-runnable-track {\\n height: 6px !important;\\n background: transparent !important;\\n border-radius: 4px !important;\\n border: none !important;\\n}\\n.shaka-seek-bar::-moz-range-track {\\n height: 6px !important;\\n background: transparent !important;\\n border-radius: 4px !important;\\n border: none !important;\\n}\\n.shaka-seek-bar::-webkit-slider-thumb {\\n -webkit-appearance: none !important;\\n appearance: none !important;\\n width: 16px !important;\\n height: 16px !important;\\n border-radius: 50% !important;\\n background: #ffffff !important;\\n cursor: pointer !important;\\n border: 2px solid #ffffff !important;\\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;\\n margin-top: -4px !important;\\n}\\n.shaka-seek-bar::-moz-range-thumb {\\n width: 16px !important;\\n height: 16px !important;\\n border-radius: 50% !important;\\n background: #ffffff !important;\\n cursor: pointer !important;\\n border: 2px solid #ffffff !important;\\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;\\n margin-top: -4px !important;\\n}\\n.motto-skip-back-button,\\n.motto-skip-forward-button,\\n.motto-native-skip-button {\\n background: transparent !important;\\n border: none !important;\\n padding: 4px !important;\\n margin: 0px !important;\\n cursor: pointer !important;\\n color: #ffffff !important;\\n transition: all 0.2s ease !important;\\n min-width: 32px !important;\\n height: 32px !important;\\n display: flex !important;\\n align-items: center !important;\\n justify-content: center !important;\\n border-radius: 4px !important;\\n width: 25px;\\n}\\n.motto-skip-back-button:hover,\\n.motto-skip-forward-button:hover,\\n.motto-native-skip-button:hover {\\n opacity: 0.8 !important;\\n background: transparent !important;\\n transform: scale(1.05) !important;\\n}\\n.motto-skip-back-button:active,\\n.motto-skip-forward-button:active,\\n.motto-native-skip-button:active {\\n transform: scale(0.95) !important;\\n}\\n.motto-skip-back-button svg,\\n.motto-skip-forward-button svg,\\n.motto-native-skip-button svg {\\n width: 24px !important;\\n height: 24px !important;\\n}\\n@media (max-width: 767px) {\\n .shaka-controls-container .motto-native-skip-button,\\n .shaka-controls-container .motto-skip-back-button,\\n .shaka-controls-container .motto-skip-forward-button,\\n .shaka-controls-container .shaka-play-button,\\n .shaka-controls-container .shaka-pause-button {\\n display: none !important;\\n }\\n}\\n.shaka-spinner-svg {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-spinner-path {\\n stroke: white !important;\\n fill: none !important;\\n}\\n.shaka-spinner-container {\\n color: white !important;\\n}\\n.shaka-buffering-spinner {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-buffering-spinner svg {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-buffering-spinner path {\\n stroke: white !important;\\n fill: none !important;\\n}\\n[data-shaka-player-container] .shaka-spinner,\\n[data-shaka-player-container] .spinner {\\n color: white !important;\\n border-color: white !important;\\n}\\n.material-icons.shaka-spinner {\\n color: white !important;\\n}\\n.shaka-controls-container .shaka-spinner,\\n.shaka-video-container .shaka-spinner {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-controls-container .shaka-spinner svg,\\n.shaka-video-container .shaka-spinner svg {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-controls-container .shaka-spinner path,\\n.shaka-video-container .shaka-spinner path {\\n stroke: white !important;\\n}\\n.motto-video-loading-overlay {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n background:\\n linear-gradient(\\n 135deg,\\n #1a1a1a 0%,\\n #2d2d2d 100%);\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n z-index: 10;\\n transition: opacity 0.3s ease;\\n}\\n.motto-video-loading-overlay.hidden {\\n opacity: 0;\\n pointer-events: none;\\n}\\n.motto-video-loading-content {\\n text-align: center;\\n color: white;\\n}\\n.motto-video-loading-icon {\\n width: 64px;\\n height: 64px;\\n margin-bottom: 16px;\\n opacity: 0.7;\\n}\\n.motto-video-loading-text {\\n font-size: 16px;\\n font-weight: 500;\\n margin-bottom: 8px;\\n}\\n.motto-video-loading-subtext {\\n font-size: 14px;\\n opacity: 0.7;\\n}\\n@keyframes pulse-live {\\n 0% {\\n opacity: 1;\\n transform: scale(1);\\n }\\n 50% {\\n opacity: 0.7;\\n transform: scale(1.1);\\n }\\n 100% {\\n opacity: 1;\\n transform: scale(1);\\n }\\n}\\n.shaka-play-button-container {\\n display: none !important;\\n}\\n@property --tw-border-style { syntax: \\\"*\\\"; inherits: false; initial-value: solid; }\\n@property --tw-gradient-position { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-gradient-from { syntax: \\\"<color>\\\"; inherits: false; initial-value: #0000; }\\n@property --tw-gradient-via { syntax: \\\"<color>\\\"; inherits: false; initial-value: #0000; }\\n@property --tw-gradient-to { syntax: \\\"<color>\\\"; inherits: false; initial-value: #0000; }\\n@property --tw-gradient-stops { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-gradient-via-stops { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-gradient-from-position { syntax: \\\"<length-percentage>\\\"; inherits: false; initial-value: 0%; }\\n@property --tw-gradient-via-position { syntax: \\\"<length-percentage>\\\"; inherits: false; initial-value: 50%; }\\n@property --tw-gradient-to-position { syntax: \\\"<length-percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-font-weight { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-tracking { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-shadow-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-shadow-alpha { syntax: \\\"<percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-inset-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-inset-shadow-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-inset-shadow-alpha { syntax: \\\"<percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-ring-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-ring-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-inset-ring-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-inset-ring-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-ring-inset { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-ring-offset-width { syntax: \\\"<length>\\\"; inherits: false; initial-value: 0px; }\\n@property --tw-ring-offset-color { syntax: \\\"*\\\"; inherits: false; initial-value: #fff; }\\n@property --tw-ring-offset-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-blur { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-brightness { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-contrast { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-grayscale { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-hue-rotate { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-invert { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-opacity { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-saturate { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-sepia { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-drop-shadow { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-drop-shadow-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-drop-shadow-alpha { syntax: \\\"<percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-drop-shadow-size { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-translate-x { syntax: \\\"*\\\"; inherits: false; initial-value: 0; }\\n@property --tw-translate-y { syntax: \\\"*\\\"; inherits: false; initial-value: 0; }\\n@property --tw-translate-z { syntax: \\\"*\\\"; inherits: false; initial-value: 0; }\\n@property --tw-duration { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-scale-x { syntax: \\\"*\\\"; inherits: false; initial-value: 1; }\\n@property --tw-scale-y { syntax: \\\"*\\\"; inherits: false; initial-value: 1; }\\n@property --tw-scale-z { syntax: \\\"*\\\"; inherits: false; initial-value: 1; }\\n@keyframes spin {\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n@keyframes pulse {\\n 50% {\\n opacity: 0.5;\\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 *,\\n ::before,\\n ::after,\\n ::backdrop {\\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-tracking: 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-blur: initial;\\n --tw-brightness: initial;\\n --tw-contrast: initial;\\n --tw-grayscale: initial;\\n --tw-hue-rotate: initial;\\n --tw-invert: initial;\\n --tw-opacity: initial;\\n --tw-saturate: initial;\\n --tw-sepia: initial;\\n --tw-drop-shadow: initial;\\n --tw-drop-shadow-color: initial;\\n --tw-drop-shadow-alpha: 100%;\\n --tw-drop-shadow-size: initial;\\n --tw-translate-x: 0;\\n --tw-translate-y: 0;\\n --tw-translate-z: 0;\\n --tw-duration: initial;\\n --tw-scale-x: 1;\\n --tw-scale-y: 1;\\n --tw-scale-z: 1;\\n }\\n }\\n}\\n\")","import React, { forwardRef, useEffect, useRef, useImperativeHandle } from 'react';\nimport { PlayerProps } from './types';\nimport { \n useShakePlayer, \n useQualityControl, \n useSkipControls, \n useMuxAnalytics, \n useShakaUI,\n useEventHandlers,\n useLiveBadge,\n useLiveIndicator,\n useShakaAbsoluteTime\n} from './hooks';\nimport { LiveBadge } from './components';\nimport './styles.css';\nimport { twMerge } from 'tailwind-merge';\n\nexport const Player = forwardRef<HTMLVideoElement, PlayerProps>(\n ({ \n src, \n autoPlay = false, \n loop = false, \n muted = false, \n controls = true,\n poster,\n width,\n height,\n aspectRatio = 16/9,\n shakaConfig,\n drmConfig,\n muxConfig,\n imaConfig,\n chromecastConfig,\n qualityConfig,\n seekbarConfig,\n events,\n containerClassName,\n streamStartDate,\n ...props \n }, ref) => {\n const videoRef = useRef<HTMLVideoElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const adContainerRef = useRef<HTMLDivElement>(null);\n\n useImperativeHandle(ref, () => videoRef.current!, []);\n\n // Initialize custom hooks\n const { playerRef, initializePlayer, destroyPlayer } = useShakePlayer({\n src,\n shakaConfig,\n drmConfig,\n onError: events?.onError,\n onPlayerReady: events?.onPlayerReady\n });\n\n const { \n getAvailableQualities, \n setQuality, \n setupQualityTracking, \n configureQuality \n } = useQualityControl(playerRef, qualityConfig, events?.onQualityChange);\n\n const { \n skipBack, \n skipForward, \n skipDuration, \n shouldShowSkipControls \n } = useSkipControls(videoRef, events?.onSkipBack, events?.onSkipForward);\n\n const { \n initializeMux, \n updateMuxData, \n handleMuxError, \n destroyMux \n } = useMuxAnalytics(playerRef, muxConfig, events?.onMuxReady, events?.onMuxDataUpdate);\n\n const { setupEventListeners, cleanupEventListeners } = useEventHandlers(videoRef, {\n onPlay: events?.onPlay,\n onPause: events?.onPause,\n onEnded: events?.onEnded,\n onLoadStart: events?.onLoadStart,\n onCanPlay: events?.onCanPlay\n });\n\n const { uiRef, initializeUI, destroyUI } = useShakaUI(\n playerRef,\n containerRef,\n videoRef,\n controls,\n chromecastConfig,\n seekbarConfig,\n events?.onSkipBack,\n events?.onSkipForward\n );\n\n // Live badge hook\n const { isLive, isVisible: isLiveBadgeVisible } = useLiveBadge(playerRef, {\n enabled: true,\n onLiveStateChange: (isLive) => {\n events?.onLiveStateChange?.(isLive);\n }\n });\n\n // Live indicator hook\n useLiveIndicator(containerRef, {\n enabled: true,\n indicatorColor: '#ff0000',\n indicatorSize: 8,\n showPulseAnimation: true\n });\n\n // Absolute time hook for live streams\n // This will auto-detect stream start time from manifest, or use manual override if provided\n const { detectedStreamStart, effectiveStreamStart } = useShakaAbsoluteTime({\n player: playerRef.current,\n controls: uiRef.current,\n manualStreamStartDate: streamStartDate\n });\n\n // Initialize ads (simplified - would normally be in a separate hook)\n const initializeAds = async () => {\n if (!imaConfig || !playerRef.current || !videoRef.current) return;\n\n const adManager = playerRef.current.getAdManager();\n if (!adManager) return;\n\n // Dynamic import to prevent SSR issues\n const shaka = await import('shaka-player/dist/shaka-player.ui');\n\n // Set up ad event listeners\n adManager.addEventListener((shaka as any).ads?.Utils?.AD_STARTED, () => {\n events?.onAdStart?.();\n });\n\n adManager.addEventListener((shaka as any).ads?.Utils?.AD_COMPLETE, () => {\n events?.onAdComplete?.();\n });\n\n adManager.addEventListener((shaka as any).ads?.Utils?.AD_ERROR, (event: any) => {\n events?.onAdError?.(event.detail);\n });\n\n // Initialize client-side ads if ad tag URL is provided\n if (imaConfig.adTagUrl) {\n const adContainer = adContainerRef.current;\n if (adContainer) {\n adManager.initClientSide(adContainer, videoRef.current, imaConfig.adsRenderingSettings);\n \n const adsRequest = {\n adTagUrl: imaConfig.adTagUrl,\n linearAdSlotWidth: imaConfig.linearAdSlotWidth || width as number || 640,\n linearAdSlotHeight: imaConfig.linearAdSlotHeight || height as number || 360,\n nonLinearAdSlotWidth: imaConfig.nonLinearAdSlotWidth || width as number || 640,\n nonLinearAdSlotHeight: imaConfig.nonLinearAdSlotHeight || 150\n };\n \n adManager.requestClientSideAds(adsRequest as any);\n }\n }\n };\n\n // Initialize chromecast (simplified - would normally be in a separate hook)\n const initializeChromecast = () => {\n if (!chromecastConfig?.enabled) {\n return;\n }\n\n try {\n if (events?.onCastStateChange) {\n setTimeout(() => events.onCastStateChange!(false), 100);\n }\n } catch (error) {\n console.warn('Chromecast initialization failed:', error);\n }\n };\n\n // Main initialization\n useEffect(() => {\n const video = videoRef.current;\n if (!video) return;\n\n const initialize = async () => {\n try {\n // Initialize player\n await initializePlayer(video);\n \n // Setup event listeners\n setupEventListeners();\n \n // Setup quality tracking\n const cleanupQuality = setupQualityTracking();\n \n // Configure quality settings\n configureQuality();\n \n // Initialize UI (seekbar colors are now configured directly in initializeUI)\n await initializeUI();\n \n // Initialize other features\n initializeMux();\n await initializeAds();\n initializeChromecast();\n\n } catch (error) {\n console.error('Error during player initialization:', error);\n handleMuxError(error);\n }\n };\n\n initialize();\n\n // Cleanup function\n return () => {\n cleanupEventListeners();\n destroyUI();\n destroyMux();\n destroyPlayer();\n };\n }, [\n src, initializePlayer, setupEventListeners, setupQualityTracking, \n configureQuality, initializeUI, initializeMux, cleanupEventListeners,\n destroyUI, destroyMux, destroyPlayer, handleMuxError, playerRef\n ]);\n\n // Update video properties when they change\n useEffect(() => {\n const video = videoRef.current;\n if (!video) return;\n\n video.autoplay = autoPlay;\n video.loop = loop;\n video.muted = muted;\n video.controls = false; // Always disable native controls since we use Shaka UI\n if (poster) video.poster = poster;\n }, [autoPlay, loop, muted, poster]);\n\n // Expose methods via ref\n useImperativeHandle(ref, () => ({\n ...videoRef.current!,\n // Custom methods for quality control\n getAvailableQualities,\n setQuality,\n // Skip methods\n skipBack,\n skipForward,\n // Mux methods\n updateMuxData,\n // Access to underlying instances\n getPlayer: () => playerRef.current,\n getMuxMonitor: () => null\n }), [getAvailableQualities, setQuality, skipBack, skipForward, updateMuxData]);\n\n // Determine if we're using responsive sizing\n const isResponsive = !width && !height;\n \n // Container classes for responsive or fixed sizing\n const containerClasses = twMerge(containerClassName, 'motto-video-container');\n \n // Container styles - handle both responsive and fixed sizing\n const containerStyle: React.CSSProperties = isResponsive \n ? { \n aspectRatio: aspectRatio.toString(),\n }\n : { width, height };\n\n // Video classes for responsive or fixed sizing \n const videoClasses = isResponsive\n ? 'motto-video-responsive'\n : 'w-full h-full ';\n \n // Video styles for fixed sizing\n const videoStyle: React.CSSProperties = isResponsive\n ? {}\n : { width, height };\n\n return (\n <div \n ref={containerRef}\n className={containerClasses}\n style={containerStyle}\n data-shaka-player-container\n data-shaka-player-cast-receiver-id={chromecastConfig?.receiverApplicationId}\n >\n <video\n ref={videoRef}\n className={videoClasses}\n width={isResponsive ? undefined : width}\n height={isResponsive ? undefined : height}\n style={videoStyle}\n poster={poster}\n controls={false}\n {...props}\n />\n \n {/* Live Badge */}\n <LiveBadge isVisible={isLiveBadgeVisible} />\n {/* <LiveBadge isVisible={true} /> */}\n \n {/* Ad container for IMA */}\n {imaConfig && (\n <div\n ref={adContainerRef}\n className=\"absolute top-0 left-0 w-full h-full pointer-events-auto\"\n />\n )}\n </div>\n );\n }\n);\n\nPlayer.displayName = 'Player'; ","import { useRef, useCallback } from 'react';\n\ninterface DRMConfig {\n clearKeys?: { [keyId: string]: string };\n servers?: { [keySystem: string]: string };\n}\n\ninterface UseShakePlayerProps {\n src: string;\n shakaConfig?: any;\n drmConfig?: DRMConfig;\n onError?: (error: Error) => void;\n onPlayerReady?: (player: any) => void;\n}\n\nexport const useShakePlayer = ({\n src,\n shakaConfig,\n drmConfig,\n onError,\n onPlayerReady\n}: UseShakePlayerProps) => {\n const playerRef = useRef<any>(null);\n\n const initializePlayer = useCallback(async (video: HTMLVideoElement) => {\n try {\n // Dynamic import to prevent SSR issues\n const { Player: ShakaPlayer, polyfill } = await import('shaka-player/dist/shaka-player.ui');\n \n // Install polyfills\n polyfill.installAll();\n\n // Check for browser support\n if (!ShakaPlayer.isBrowserSupported()) {\n throw new Error('Browser not supported by Shaka Player');\n }\n \n // Create player without media element and attach separately (v4.6+ recommended way)\n // Using type assertion since v4.15.3 has attach method but types may not reflect it\n const player = new ShakaPlayer(video);\n playerRef.current = player;\n \n // Attach to video element to avoid deprecation warning\n await (player as any).attach(video);\n\n // Configure player\n if (shakaConfig) {\n player.configure(shakaConfig);\n }\n\n // Configure DRM\n if (drmConfig) {\n if (drmConfig.clearKeys) {\n player.configure({ 'drm.clearKeys': drmConfig.clearKeys } as any);\n }\n \n if (drmConfig.servers) {\n player.configure({ 'drm.servers': drmConfig.servers } as any);\n }\n }\n\n // Set up error handling\n player.addEventListener('error', (event: any) => {\n const error = event.detail;\n console.error('Shaka Player Error:', error);\n onError?.(new Error(`Shaka Player Error: ${error.message || 'Unknown error'}`));\n });\n\n // Load the manifest\n await player.load(src);\n onPlayerReady?.(player);\n\n return player;\n } catch (error) {\n console.error('Error initializing Shaka Player:', error);\n onError?.(error as Error);\n throw error;\n }\n }, [shakaConfig, drmConfig, src, onError, onPlayerReady]);\n\n const destroyPlayer = useCallback(async () => {\n if (playerRef.current) {\n try {\n await playerRef.current.destroy();\n } catch (error) {\n console.warn('Error destroying Shaka Player:', error);\n } finally {\n playerRef.current = null;\n }\n }\n }, []);\n\n return {\n playerRef,\n initializePlayer,\n destroyPlayer\n };\n}; ","import { useCallback, useRef } from 'react';\n\ninterface QualityConfig {\n enableAdaptation?: boolean;\n selectedQuality?: number;\n availableQualities?: Array<{\n height: number;\n bandwidth: number;\n label: string;\n }>;\n}\n\ninterface Quality {\n height: number;\n bandwidth: number;\n label: string;\n}\n\nexport const useQualityControl = (\n playerRef: React.RefObject<any>,\n qualityConfig?: QualityConfig,\n onQualityChange?: (quality: { height: number; bandwidth: number }) => void\n) => {\n const getAvailableQualities = useCallback((): Quality[] => {\n if (!playerRef.current) return [];\n \n const tracks = playerRef.current.getVariantTracks();\n const qualities = tracks\n .filter((track: any, index: any, self: any) => \n index === self.findIndex((t: any) => t.height === track.height)\n )\n .map((track: any) => ({\n height: track.height || 0,\n bandwidth: track.bandwidth || 0,\n label: `${track.height}p`\n }))\n .sort((a: any, b: any) => b.height - a.height);\n \n return qualities;\n }, [playerRef]);\n\n const setQuality = useCallback((height: number) => {\n if (!playerRef.current) return;\n \n if (height === 0) {\n // Enable adaptive streaming\n playerRef.current.configure({\n abr: { enabled: true }\n });\n } else {\n // Disable adaptive streaming and select specific quality\n playerRef.current.configure({\n abr: { enabled: false }\n });\n \n const tracks = playerRef.current.getVariantTracks();\n const targetTrack = tracks.find((track: any) => track.height === height);\n if (targetTrack) {\n playerRef.current.selectVariantTrack(targetTrack, /* clearBuffer= */ true);\n }\n }\n }, [playerRef]);\n\n const setupQualityTracking = useCallback(() => {\n if (!playerRef.current || !onQualityChange) return;\n\n const handleQualityChange = () => {\n const activeTrack = playerRef.current.getVariantTracks().find((track: any) => track.active);\n if (activeTrack) {\n onQualityChange({\n height: activeTrack.height || 0,\n bandwidth: activeTrack.bandwidth || 0\n });\n }\n };\n\n playerRef.current.addEventListener('variantchanged', handleQualityChange);\n \n return () => {\n playerRef.current?.removeEventListener('variantchanged', handleQualityChange);\n };\n }, [playerRef, onQualityChange]);\n\n const configureQuality = useCallback(() => {\n if (!playerRef.current || !qualityConfig) return;\n\n if (qualityConfig.enableAdaptation !== undefined) {\n playerRef.current.configure({\n abr: { enabled: qualityConfig.enableAdaptation }\n });\n }\n\n if (qualityConfig.selectedQuality !== undefined) {\n setQuality(qualityConfig.selectedQuality);\n }\n }, [playerRef, qualityConfig, setQuality]);\n\n return {\n getAvailableQualities,\n setQuality,\n setupQualityTracking,\n configureQuality\n };\n}; ","import { useCallback } from 'react';\n\nexport const useSkipControls = (\n videoRef: React.RefObject<HTMLVideoElement>,\n onSkipBack?: (newTime: number) => void,\n onSkipForward?: (newTime: number) => void\n) => {\n // Hardcoded skip duration of 15 seconds\n const skipDuration = 15;\n\n const skipBack = useCallback(() => {\n const video = videoRef.current;\n if (!video) return;\n \n const newTime = Math.max(0, video.currentTime - skipDuration);\n video.currentTime = newTime;\n onSkipBack?.(newTime);\n }, [videoRef, onSkipBack]);\n\n const skipForward = useCallback(() => {\n const video = videoRef.current;\n if (!video) return;\n \n const newTime = Math.min(video.duration || 0, video.currentTime + skipDuration);\n video.currentTime = newTime;\n onSkipForward?.(newTime);\n }, [videoRef, onSkipForward]);\n\n // Always show skip controls\n const shouldShowSkipControls = useCallback(() => {\n return true;\n }, []);\n\n return {\n skipBack,\n skipForward,\n skipDuration,\n shouldShowSkipControls\n };\n}; ","import { useCallback, useRef } from 'react';\nimport initShakaPlayerMux from '@mux/mux-data-shakaplayer';\nimport shaka from 'shaka-player/dist/shaka-player.ui';\nimport { MuxAnalyticsConfig } from '../types';\n\nexport const useMuxAnalytics = (\n playerRef: React.RefObject<any>,\n muxConfig?: MuxAnalyticsConfig,\n onMuxReady?: () => void,\n onMuxDataUpdate?: (data: any) => void\n) => {\n const shakaPlayerMuxRef = useRef<any>(null);\n\n const initializeMux = useCallback(() => {\n if (!muxConfig || !playerRef.current) return;\n\n try {\n const playerInitTime = initShakaPlayerMux.utils.now();\n \n // Prepare Mux options\n const muxOptions = {\n debug: muxConfig.debug || false,\n disableCookies: muxConfig.disableCookies || false,\n respectDoNotTrack: muxConfig.respectDoNotTrack || false,\n automaticErrorTracking: muxConfig.automaticErrorTracking !== false,\n ...(muxConfig.beaconCollectionDomain && { beaconCollectionDomain: muxConfig.beaconCollectionDomain }),\n ...(muxConfig.errorTranslator && { errorTranslator: muxConfig.errorTranslator }),\n data: {\n env_key: muxConfig.envKey,\n player_name: 'Motto Video Player',\n player_version: '1.0.0',\n player_init_time: playerInitTime,\n ...muxConfig.metadata\n }\n };\n\n // Initialize Mux monitoring\n shakaPlayerMuxRef.current = initShakaPlayerMux(playerRef.current, muxOptions, shaka);\n \n onMuxReady?.();\n } catch (error) {\n console.error('Failed to initialize Mux Analytics:', error);\n }\n }, [muxConfig, onMuxReady, playerRef]);\n\n const updateMuxData = useCallback((data: any) => {\n if ((playerRef.current as any)?.mux?.updateData) {\n try {\n (playerRef.current as any).mux.updateData(data);\n onMuxDataUpdate?.(data);\n } catch (error) {\n console.error('Failed to update Mux data:', error);\n }\n }\n }, [onMuxDataUpdate, playerRef]);\n\n const handleMuxError = useCallback((error: any) => {\n if (shakaPlayerMuxRef.current?.loadErrorHandler) {\n shakaPlayerMuxRef.current.loadErrorHandler(error);\n }\n }, []);\n\n const destroyMux = useCallback(() => {\n // Clean up Mux monitoring\n if ((playerRef.current as any)?.mux?.destroy) {\n try {\n (playerRef.current as any).mux.destroy();\n } catch (error) {\n console.error('Error destroying Mux:', error);\n }\n }\n \n if (shakaPlayerMuxRef.current) {\n shakaPlayerMuxRef.current = null;\n }\n }, [playerRef]);\n\n return {\n initializeMux,\n updateMuxData,\n handleMuxError,\n destroyMux,\n shakaPlayerMuxRef\n };\n}; ","import { useCallback, useRef } from 'react';\n// Remove static import to prevent SSR errors\n// import { ui as ShakaUI } from 'shaka-player/dist/shaka-player.ui';\n\ninterface ChromecastConfig {\n enabled?: boolean;\n receiverApplicationId?: string;\n}\n\n// Custom Skip Back Button Element\nclass SkipBackButton {\n private button_!: HTMLButtonElement;\n private parent: HTMLElement;\n private controls: any;\n private eventManager: any;\n\n constructor(parent: HTMLElement, controls: any, onSkipBack?: (newTime: number) => void) {\n this.parent = parent;\n this.controls = controls;\n this.eventManager = { listen: (element: HTMLElement, event: string, handler: () => void) => {\n element.addEventListener(event, handler);\n }};\n\n // Check if we're in a browser environment\n if (typeof document === 'undefined') {\n console.warn('SkipBackButton: document is not available (SSR environment)');\n return;\n }\n\n this.button_ = document.createElement('button');\n this.button_.className = 'shaka-button motto-native-skip-button';\n this.button_.innerHTML = `\n <svg width=\"24px\" stroke-width=\"2\" height=\"24px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M3 13C3 17.9706 7.02944 22 12 22C16.9706 22 21 17.9706 21 13C21 8.02944 16.9706 4 12 4\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M9 9L9 16\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M15 9L13 9C12.4477 9 12 9.44772 12 10L12 11.5C12 12.0523 12.4477 12.5 13 12.5L14 12.5C14.5523 12.5 15 12.9477 15 13.5L15 15C15 15.5523 14.5523 16 14 16L12 16\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M12 4L4.5 4M4.5 4L6.5 2M4.5 4L6.5 6\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n `;\n this.button_.title = 'Skip back 15 seconds';\n this.button_.setAttribute('aria-label', 'Skip back 15 seconds');\n \n this.parent.appendChild(this.button_);\n\n this.eventManager.listen(this.button_, 'click', () => {\n const video = this.controls.getVideo();\n if (video) {\n const newTime = Math.max(0, video.currentTime - 15);\n video.currentTime = newTime;\n onSkipBack?.(newTime);\n }\n });\n }\n}\n\n// Custom Skip Forward Button Element \nclass SkipForwardButton {\n private button_!: HTMLButtonElement;\n private parent: HTMLElement;\n private controls: any;\n private eventManager: any;\n\n constructor(parent: HTMLElement, controls: any, onSkipForward?: (newTime: number) => void) {\n this.parent = parent;\n this.controls = controls;\n this.eventManager = { listen: (element: HTMLElement, event: string, handler: () => void) => {\n element.addEventListener(event, handler);\n }};\n\n // Check if we're in a browser environment\n if (typeof document === 'undefined') {\n console.warn('SkipForwardButton: document is not available (SSR environment)');\n return;\n }\n\n this.button_ = document.createElement('button');\n this.button_.className = 'shaka-button motto-native-skip-button';\n this.button_.innerHTML = `\n <svg fill=\"none\" height=\"24\" stroke-width=\"2\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M21 13C21 17.9706 16.9706 22 12 22C7.02944 22 3 17.9706 3 13C3 8.02944 7.02944 4 12 4\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M12 4H19.5M19.5 4L17.5 2M19.5 4L17.5 6\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M9 9L9 16\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M15 9L13 9C12.4477 9 12 9.44772 12 10L12 11.5C12 12.0523 12.4477 12.5 13 12.5L14 12.5C14.5523 12.5 15 12.9477 15 13.5L15 15C15 15.5523 14.5523 16 14 16L12 16\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n `;\n this.button_.title = 'Skip forward 15 seconds';\n this.button_.setAttribute('aria-label', 'Skip forward 15 seconds');\n \n this.parent.appendChild(this.button_);\n\n this.eventManager.listen(this.button_, 'click', () => {\n const video = this.controls.getVideo();\n if (video) {\n const newTime = Math.min(video.duration || 0, video.currentTime + 15);\n video.currentTime = newTime;\n onSkipForward?.(newTime);\n }\n });\n }\n}\n\n// Factory classes for the custom elements\nclass SkipBackButtonFactory {\n constructor(private onSkipBack?: (newTime: number) => void) {}\n \n create(rootElement: HTMLElement, controls: any) {\n return new SkipBackButton(rootElement, controls, this.onSkipBack);\n }\n}\n\nclass SkipForwardButtonFactory {\n constructor(private onSkipForward?: (newTime: number) => void) {}\n \n create(rootElement: HTMLElement, controls: any) {\n return new SkipForwardButton(rootElement, controls, this.onSkipForward);\n }\n}\n\ninterface SeekbarColors {\n base?: string;\n buffered?: string;\n played?: string;\n}\n\n// Mobile Play Button Plugin - extends shaka.ui.Element\nclass MobilePlayButton {\n private button_!: HTMLButtonElement;\n private parent: HTMLElement;\n private controls: any;\n private eventManager: any;\n private video!: HTMLVideoElement;\n\n constructor(parent: HTMLElement, controls: any) {\n this.parent = parent;\n this.controls = controls;\n \n // Check if we're in a browser environment\n if (typeof document === 'undefined') {\n console.warn('MobilePlayButton: document is not available (SSR environment)');\n return;\n }\n \n // Get video element safely - try multiple approaches\n this.video = controls?.getVideo?.() || \n parent.querySelector('video') || \n document.querySelector('video');\n if (!this.video) {\n console.error('MobilePlayButton: No video element found');\n return;\n }\n \n this.eventManager = { listen: (element: HTMLElement, event: string, handler: () => void) => {\n element.addEventListener(event, handler);\n }};\n\n this.button_ = document.createElement('button');\n this.button_.className = 'motto-mobile-play-button';\n this.updateIcon();\n this.parent.appendChild(this.button_);\n\n this.eventManager.listen(this.button_, 'click', () => {\n if (this.video.paused) {\n this.video.play();\n } else {\n this.video.pause();\n }\n });\n\n // Update icon based on video state\n this.eventManager.listen(this.video, 'play', () => this.updateIcon());\n this.eventManager.listen(this.video, 'pause', () => this.updateIcon());\n }\n\n private updateIcon() {\n if (this.video.paused) {\n this.button_.innerHTML = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" stroke-width=\"2\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path stroke-width=\"2\" fill-rule=\"evenodd\" d=\"M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z\" clip-rule=\"evenodd\" />\n </svg>\n `;\n this.button_.setAttribute('aria-label', 'Play');\n } else {\n this.button_.innerHTML = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path fill-rule=\"evenodd\" d=\"M6.75 5.25a.75.75 0 0 1 .75-.75H9a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H7.5a.75.75 0 0 1-.75-.75V5.25Zm7.5 0A.75.75 0 0 1 15 4.5h1.5a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H15a.75.75 0 0 1-.75-.75V5.25Z\" clip-rule=\"evenodd\" />\n </svg>\n `;\n this.button_.setAttribute('aria-label', 'Pause');\n }\n }\n}\n\n// Mobile Skip Back Button Plugin\nclass MobileSkipBackButton {\n private button_!: HTMLButtonElement;\n private parent: HTMLElement;\n private controls: any;\n private eventManager: any;\n private video!: HTMLVideoElement;\n\n constructor(parent: HTMLElement, controls: any, onSkipBack?: (newTime: number) => void) {\n this.parent = parent;\n this.controls = controls;\n \n // Check if we're in a browser environment\n if (typeof document === 'undefined') {\n console.warn('MobileSkipBackButton: document is not available (SSR environment)');\n return;\n }\n \n // Get video element safely - try multiple approaches\n this.video = controls?.getVideo?.() || \n parent.querySelector('video') || \n document.querySelector('video');\n if (!this.video) {\n console.error('MobileSkipBackButton: No video element found');\n return;\n }\n this.eventManager = { listen: (element: HTMLElement, event: string, handler: () => void) => {\n element.addEventListener(event, handler);\n }};\n\n this.button_ = document.createElement('button');\n this.button_.className = 'motto-mobile-skip-button';\n this.button_.innerHTML = `\n <svg width=\"20px\" stroke-width=\"2\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M3 13C3 17.9706 7.02944 22 12 22C16.9706 22 21 17.9706 21 13C21 8.02944 16.9706 4 12 4\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M9 9L9 16\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M15 9L13 9C12.4477 9 12 9.44772 12 10L12 11.5C12 12.0523 12.4477 12.5 13 12.5L14 12.5C14.5523 12.5 15 12.9477 15 13.5L15 15C15 15.5523 14.5523 16 14 16L12 16\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M12 4L4.5 4M4.5 4L6.5 2M4.5 4L6.5 6\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n `;\n this.button_.setAttribute('aria-label', 'Skip back 15 seconds');\n this.parent.appendChild(this.button_);\n\n this.eventManager.listen(this.button_, 'click', () => {\n const newTime = Math.max(0, this.video.currentTime - 15);\n this.video.currentTime = newTime;\n onSkipBack?.(newTime);\n });\n }\n}\n\n// Mobile Skip Forward Button Plugin\nclass MobileSkipForwardButton {\n private button_!: HTMLButtonElement;\n private parent: HTMLElement;\n private controls: any;\n private eventManager: any;\n private video!: HTMLVideoElement;\n\n constructor(parent: HTMLElement, controls: any, onSkipForward?: (newTime: number) => void) {\n this.parent = parent;\n this.controls = controls;\n \n // Check if we're in a browser environment\n if (typeof document === 'undefined') {\n console.warn('MobileSkipForwardButton: document is not available (SSR environment)');\n return;\n }\n \n // Get video element safely - try multiple approaches\n this.video = controls?.getVideo?.() || \n parent.querySelector('video') || \n document.querySelector('video');\n if (!this.video) {\n console.error('MobileSkipForwardButton: No video element found');\n return;\n }\n this.eventManager = { listen: (element: HTMLElement, event: string, handler: () => void) => {\n element.addEventListener(event, handler);\n }};\n\n this.button_ = document.createElement('button');\n this.button_.className = 'motto-mobile-skip-button';\n this.button_.innerHTML = `\n <svg fill=\"none\" height=\"20\" stroke-width=\"2\" viewBox=\"0 0 24 24\" width=\"20\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M21 13C21 17.9706 16.9706 22 12 22C7.02944 22 3 17.9706 3 13C3 8.02944 7.02944 4 12 4\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M12 4H19.5M19.5 4L17.5 2M19.5 4L17.5 6\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M9 9L9 16\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M15 9L13 9C12.4477 9 12 9.44772 12 10L12 11.5C12 12.0523 12.4477 12.5 13 12.5L14 12.5C14.5523 12.5 15 12.9477 15 13.5L15 15C15 15.5523 14.5523 16 14 16L12 16\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n `;\n this.button_.setAttribute('aria-label', 'Skip forward 15 seconds');\n this.parent.appendChild(this.button_);\n\n this.eventManager.listen(this.button_, 'click', () => {\n const newTime = Math.min(this.video.duration || 0, this.video.currentTime + 15);\n this.video.currentTime = newTime;\n onSkipForward?.(newTime);\n });\n }\n}\n\n// Mobile Controls Container Plugin\nclass MobileControlsContainer {\n private container_!: HTMLDivElement;\n private parent: HTMLElement;\n private controls: any;\n private observer!: MutationObserver;\n\n constructor(parent: HTMLElement, controls: any, onSkipBack?: (newTime: number) => void, onSkipForward?: (newTime: number) => void) {\n this.parent = parent;\n this.controls = controls;\n \n // Check if we're in a browser environment\n if (typeof document === 'undefined') {\n console.warn('MobileControlsContainer: document is not available (SSR environment)');\n return;\n }\n \n // Check if we have a valid parent container\n if (!parent) {\n console.error('MobileControlsContainer: No parent element provided');\n return;\n }\n\n // Create mobile controls overlay\n this.container_ = document.createElement('div');\n this.container_.className = 'motto-mobile-controls-overlay';\n\n const controlsGroup = document.createElement('div');\n controlsGroup.className = 'motto-mobile-controls-group';\n\n // Create individual mobile control elements\n new MobileSkipBackButton(controlsGroup, controls, onSkipBack);\n new MobilePlayButton(controlsGroup, controls);\n new MobileSkipForwardButton(controlsGroup, controls, onSkipForward);\n\n this.container_.appendChild(controlsGroup);\n this.parent.appendChild(this.container_);\n\n // Set up observer to sync visibility with control bar\n this.setupVisibilitySync();\n }\n\n private setupVisibilitySync() {\n // Wait for Shaka controls to be ready\n setTimeout(() => {\n // Initially sync visibility\n this.syncVisibility();\n\n // Watch for class changes on the main container (especially 'no-cursor' class)\n this.observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.type === 'attributes' && mutation.attributeName === 'class') {\n this.syncVisibility();\n }\n });\n });\n\n // Watch the main container for class changes\n this.observer.observe(this.parent, {\n attributes: true,\n attributeFilter: ['class']\n });\n\n // Listen for video play/pause events to update visibility\n const video = this.controls?.getVideo?.() || this.parent.querySelector('video');\n if (video) {\n video.addEventListener('play', () => {\n setTimeout(() => this.syncVisibility(), 50);\n });\n \n video.addEventListener('pause', () => {\n setTimeout(() => this.syncVisibility(), 50);\n });\n }\n }, 1000);\n }\n\n private syncVisibility() {\n // Check if the main container has the 'no-cursor' class which indicates controls should be hidden\n const mainContainer = this.parent;\n const hasNoCursor = mainContainer.classList.contains('no-cursor');\n \n // Get video element to check if it's paused\n const video = this.controls?.getVideo?.() || this.parent.querySelector('video');\n const isVideoPaused = video ? video.paused : false;\n \n // Keep controls visible if video is paused, regardless of cursor state\n const isControlsVisible = !hasNoCursor || isVideoPaused;\n \n if (this.container_) {\n if (isControlsVisible) {\n this.container_.style.opacity = '1';\n // Keep pointer-events: none on container to allow clicks through\n this.container_.style.pointerEvents = 'none';\n } else {\n this.container_.style.opacity = '0';\n this.container_.style.pointerEvents = 'none';\n }\n }\n }\n\n private isElementVisible(element: HTMLElement): boolean {\n // Check if we're in a browser environment\n if (typeof window === 'undefined') {\n return false;\n }\n \n const style = window.getComputedStyle(element);\n const hasHiddenClass = element.classList.contains('shaka-hidden') || \n element.classList.contains('hidden') ||\n element.classList.contains('shaka-fade-out');\n \n return style.display !== 'none' && \n style.visibility !== 'hidden' && \n style.opacity !== '0' &&\n !element.hidden &&\n !hasHiddenClass;\n }\n}\n\n// Factory classes for the mobile control plugins\nclass MobilePlayButtonFactory {\n create(rootElement: HTMLElement, controls: any) {\n return new MobilePlayButton(rootElement, controls);\n }\n}\n\nclass MobileSkipBackButtonFactory {\n constructor(private onSkipBack?: (newTime: number) => void) {}\n \n create(rootElement: HTMLElement, controls: any) {\n return new MobileSkipBackButton(rootElement, controls, this.onSkipBack);\n }\n}\n\nclass MobileSkipForwardButtonFactory {\n constructor(private onSkipForward?: (newTime: number) => void) {}\n \n create(rootElement: HTMLElement, controls: any) {\n return new MobileSkipForwardButton(rootElement, controls, this.onSkipForward);\n }\n}\n\nclass MobileControlsContainerFactory {\n constructor(\n private onSkipBack?: (newTime: number) => void,\n private onSkipForward?: (newTime: number) => void\n ) {}\n \n create(rootElement: HTMLElement, controls: any) {\n return new MobileControlsContainer(rootElement, controls, this.onSkipBack, this.onSkipForward);\n }\n}\n\nexport const useShakaUI = (\n playerRef: React.RefObject<any>,\n containerRef: React.RefObject<HTMLDivElement>,\n videoRef: React.RefObject<HTMLVideoElement>,\n controls: boolean,\n chromecastConfig?: ChromecastConfig,\n seekbarColors?: SeekbarColors,\n onSkipBack?: (newTime: number) => void,\n onSkipForward?: (newTime: number) => void\n) => {\n const uiRef = useRef<any>(null);\n const registeredElements = useRef<Set<string>>(new Set());\n\n const initializeUI = useCallback(async () => {\n // Check if we're in a browser environment\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n console.warn('useShakaUI: Cannot initialize UI in SSR environment');\n return null;\n }\n \n if (!controls || !containerRef.current || !playerRef.current || !videoRef.current) {\n return null;\n }\n\n try {\n // Dynamically import Shaka UI to avoid SSR issues\n const { ui: ShakaUI } = await import('shaka-player/dist/shaka-player.ui');\n\n // Detect if we're on mobile (more robust detection)\n // Check if we're in a browser environment first\n let isMobile = false;\n try {\n isMobile = typeof window !== 'undefined' && \n typeof navigator !== 'undefined' && \n (window.innerWidth <= 767 || /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));\n } catch (error) {\n // Fallback to desktop layout if detection fails\n isMobile = false;\n }\n\n // Register custom elements if not already registered\n if (!registeredElements.current.has('skip_back_button')) {\n ShakaUI.Controls.registerElement('skip_back_button', new SkipBackButtonFactory(onSkipBack));\n registeredElements.current.add('skip_back_button');\n }\n \n if (!registeredElements.current.has('skip_forward_button')) {\n ShakaUI.Controls.registerElement('skip_forward_button', new SkipForwardButtonFactory(onSkipForward));\n registeredElements.current.add('skip_forward_button');\n }\n\n // Register mobile control plugins for mobile devices\n if (isMobile) {\n if (!registeredElements.current.has('mobile_controls_container')) {\n ShakaUI.Controls.registerElement('mobile_controls_container', new MobileControlsContainerFactory(onSkipBack, onSkipForward));\n registeredElements.current.add('mobile_controls_container');\n }\n }\n\n // Create UI with Shaka Player controls using default configuration\n const ui = new ShakaUI.Overlay(playerRef.current, containerRef.current, videoRef.current);\n uiRef.current = ui;\n\n const controlPanelElements = isMobile ? [\n 'mute',\n 'time_and_duration',\n 'spacer',\n 'fullscreen',\n 'overflow_menu',\n ] :\n [\n 'skip_back_button',\n 'play_pause',\n 'skip_forward_button',\n 'mute',\n 'volume',\n 'time_and_duration',\n 'spacer',\n 'fullscreen',\n 'overflow_menu',\n ]\n ;\n \n // Configure UI settings with custom control panel layout\n const uiConfig: any = {\n seekBarColors: {\n base: seekbarColors?.base || 'rgba(255, 255, 255, 0.3)', // Unbuffered track\n buffered: seekbarColors?.buffered || 'rgba(255, 255, 255, 0.5)', // Buffered but not played\n played: seekbarColors?.played || '#ffffff', // Progress/played portion (white)\n },\n controlPanelElements: controlPanelElements,\n ...(chromecastConfig?.receiverApplicationId && {\n 'castReceiverAppId': chromecastConfig.receiverApplicationId,\n 'castAndroidReceiverCompatible': false\n })\n };\n\n // Add chromecast config if needed\n if (chromecastConfig?.receiverApplicationId) {\n uiConfig.castReceiverAppId = chromecastConfig.receiverApplicationId;\n uiConfig.castAndroidReceiverCompatible = false;\n }\n\n ui.configure(uiConfig);\n\n // Seekbar styling is now handled by CSS with proper background\n\n // Create mobile overlay controls on mobile devices using Shaka plugin system\n if (isMobile) {\n setTimeout(() => {\n const container = containerRef.current;\n const video = videoRef.current;\n if (container && video) {\n // Create mobile overlay controls with video element reference\n new MobileControlsContainer(container, { getVideo: () => video }, onSkipBack, onSkipForward);\n }\n }, 500); // Increased timeout to ensure UI is fully ready\n }\n\n return ui;\n } catch (error) {\n console.error('Error initializing Shaka UI:', error);\n return null;\n }\n }, [controls, containerRef, playerRef, videoRef, chromecastConfig, seekbarColors, onSkipBack, onSkipForward]);\n\n const destroyUI = useCallback(() => {\n if (uiRef.current) {\n try {\n uiRef.current.destroy();\n } catch (error) {\n console.error('Error destroying UI:', error);\n }\n uiRef.current = null;\n }\n }, []);\n\n return {\n uiRef,\n initializeUI,\n destroyUI\n };\n}; ","import { useCallback } from 'react';\n\ninterface EventHandlers {\n onPlay?: () => void;\n onPause?: () => void;\n onEnded?: () => void;\n onLoadStart?: () => void;\n onCanPlay?: () => void;\n}\n\nexport const useEventHandlers = (\n videoRef: React.RefObject<HTMLVideoElement>,\n handlers: EventHandlers\n) => {\n const setupEventListeners = useCallback(() => {\n const video = videoRef.current;\n if (!video) return;\n\n const { onPlay, onPause, onEnded, onLoadStart, onCanPlay } = handlers;\n\n if (onPlay) video.addEventListener('play', onPlay);\n if (onPause) video.addEventListener('pause', onPause);\n if (onEnded) video.addEventListener('ended', onEnded);\n if (onLoadStart) video.addEventListener('loadstart', onLoadStart);\n if (onCanPlay) video.addEventListener('canplay', onCanPlay);\n }, [videoRef, handlers]);\n\n const cleanupEventListeners = useCallback(() => {\n const video = videoRef.current;\n if (!video) return;\n\n const { onPlay, onPause, onEnded, onLoadStart, onCanPlay } = handlers;\n\n if (onPlay) video.removeEventListener('play', onPlay);\n if (onPause) video.removeEventListener('pause', onPause);\n if (onEnded) video.removeEventListener('ended', onEnded);\n if (onLoadStart) video.removeEventListener('loadstart', onLoadStart);\n if (onCanPlay) video.removeEventListener('canplay', onCanPlay);\n }, [videoRef, handlers]);\n\n return {\n setupEventListeners,\n cleanupEventListeners\n };\n}; ","import { useEffect, useState, useRef } from 'react';\n\ninterface UseLiveBadgeOptions {\n enabled?: boolean;\n onLiveStateChange?: (isLive: boolean) => void;\n}\n\nexport const useLiveBadge = (\n playerRef: React.RefObject<any>,\n options: UseLiveBadgeOptions = {}\n) => {\n const [isLive, setIsLive] = useState(false);\n const [isVisible, setIsVisible] = useState(false);\n const intervalRef = useRef<NodeJS.Timeout | null>(null);\n const { enabled = true, onLiveStateChange } = options;\n\n const checkLiveStatus = () => {\n if (!playerRef.current || !enabled) {\n return;\n }\n\n try {\n // Check if player has loaded content and is ready\n const player = playerRef.current;\n \n // Multiple checks to ensure player is ready\n if (!player.getManifest || \n !player.getPresentationTimeline || \n typeof player.getPresentationTimeline !== 'function') {\n return;\n }\n\n const manifest = player.getManifest();\n if (!manifest) {\n return;\n }\n\n // Now safely get the presentation timeline\n const timeline = player.getPresentationTimeline();\n if (!timeline || typeof timeline.isLive !== 'function') {\n return;\n }\n\n const liveStatus = timeline.isLive();\n \n if (liveStatus !== isLive) {\n setIsLive(liveStatus);\n setIsVisible(liveStatus);\n onLiveStateChange?.(liveStatus);\n }\n } catch (error) {\n // Only log errors that aren't related to player not being ready\n if (error instanceof Error && !error.message.includes('not a function')) {\n console.error('Error checking live status:', error);\n }\n }\n };\n\n useEffect(() => {\n if (!enabled) {\n setIsLive(false);\n setIsVisible(false);\n return;\n }\n\n // Check immediately\n checkLiveStatus();\n\n // Set up interval to check periodically\n intervalRef.current = setInterval(checkLiveStatus, 2000);\n\n return () => {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n intervalRef.current = null;\n }\n };\n }, [enabled, playerRef.current]);\n\n // Clean up on unmount\n useEffect(() => {\n return () => {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n }\n };\n }, []);\n\n const hideBadge = () => setIsVisible(false);\n const showBadge = () => setIsVisible(true);\n\n return {\n isLive,\n isVisible,\n hideBadge,\n showBadge,\n checkLiveStatus\n };\n}; ","import { useEffect, useState, useRef } from 'react';\n\ninterface UsePosterFallbackOptions {\n enabled?: boolean;\n fallbackPoster?: string;\n showLoadingOverlay?: boolean;\n}\n\nexport const usePosterFallback = (\n playerRef: React.RefObject<any>,\n options: UsePosterFallbackOptions = {}\n) => {\n const [isLoading, setIsLoading] = useState(true);\n const [showOverlay, setShowOverlay] = useState(true);\n const [hasStartedPlaying, setHasStartedPlaying] = useState(false);\n const { enabled = true, fallbackPoster, showLoadingOverlay = true } = options;\n\n useEffect(() => {\n if (!playerRef.current || !enabled) {\n return;\n }\n\n const handleLoadStart = () => {\n setIsLoading(true);\n setShowOverlay(true);\n };\n\n const handleCanPlay = () => {\n setIsLoading(false);\n // Keep overlay visible until user interaction or autoplay starts\n if (!hasStartedPlaying) {\n setShowOverlay(true);\n }\n };\n\n const handlePlay = () => {\n setHasStartedPlaying(true);\n setShowOverlay(false);\n };\n\n const handleLoadedMetadata = () => {\n setIsLoading(false);\n };\n\n // Add event listeners\n const video = playerRef.current;\n if (video) {\n video.addEventListener('loadstart', handleLoadStart);\n video.addEventListener('canplay', handleCanPlay);\n video.addEventListener('play', handlePlay);\n video.addEventListener('loadedmetadata', handleLoadedMetadata);\n\n return () => {\n video.removeEventListener('loadstart', handleLoadStart);\n video.removeEventListener('canplay', handleCanPlay);\n video.removeEventListener('play', handlePlay);\n video.removeEventListener('loadedmetadata', handleLoadedMetadata);\n };\n }\n }, [playerRef, enabled, hasStartedPlaying]);\n\n const hideOverlay = () => {\n setShowOverlay(false);\n };\n\n return {\n isLoading,\n showOverlay: showLoadingOverlay && showOverlay,\n hideOverlay,\n hasStartedPlaying\n };\n}; ","import { useEffect, useRef } from 'react';\n\ninterface UseLiveIndicatorOptions {\n enabled?: boolean;\n indicatorColor?: string;\n indicatorSize?: number;\n showPulseAnimation?: boolean;\n}\n\nexport const useLiveIndicator = (\n containerRef: React.RefObject<HTMLElement>,\n options: UseLiveIndicatorOptions = {}\n) => {\n const observerRef = useRef<MutationObserver | null>(null);\n const { \n enabled = true, \n indicatorColor = '#ff0000',\n indicatorSize = 8,\n showPulseAnimation = true \n } = options;\n\n useEffect(() => {\n // Check if we're in a browser environment\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n return;\n }\n \n if (!containerRef.current || !enabled) {\n return;\n }\n\n const addLiveIndicator = (currentTimeElement: Element) => {\n // Check if indicator already exists\n if (currentTimeElement.querySelector('.live-indicator-dot')) {\n return;\n }\n\n // Create the red circle indicator\n const indicator = document.createElement('span');\n indicator.className = 'live-indicator-dot';\n indicator.style.cssText = `\n display: inline-block;\n width: ${indicatorSize}px;\n height: ${indicatorSize}px;\n background-color: ${indicatorColor};\n border-radius: 50%;\n margin-right: 6px;\n vertical-align: middle;\n ${showPulseAnimation ? 'animation: pulse-live 2s infinite;' : ''}\n `;\n\n // Insert the indicator at the beginning of the current time element\n currentTimeElement.insertBefore(indicator, currentTimeElement.firstChild);\n };\n\n const removeLiveIndicator = (currentTimeElement: Element) => {\n const indicator = currentTimeElement.querySelector('.live-indicator-dot');\n if (indicator) {\n indicator.remove();\n }\n };\n\n const checkForLiveContent = () => {\n const currentTimeElements = containerRef.current?.querySelectorAll('.shaka-current-time');\n \n currentTimeElements?.forEach((element) => {\n const textContent = element.textContent?.trim() || '';\n \n if (textContent.toLowerCase().includes('live')) {\n addLiveIndicator(element);\n } else {\n removeLiveIndicator(element);\n }\n });\n };\n\n // Initial check\n checkForLiveContent();\n\n // Set up mutation observer to watch for changes in the DOM\n observerRef.current = new MutationObserver((mutations) => {\n let shouldCheck = false;\n \n mutations.forEach((mutation) => {\n // Check if any nodes were added or text content changed\n if (mutation.type === 'childList' || mutation.type === 'characterData') {\n shouldCheck = true;\n }\n \n // Check if any of the added nodes contain current time elements\n mutation.addedNodes.forEach((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const element = node as Element;\n if (element.classList?.contains('shaka-current-time') || \n element.querySelector?.('.shaka-current-time')) {\n shouldCheck = true;\n }\n }\n });\n });\n \n if (shouldCheck) {\n // Debounce the check to avoid excessive calls\n setTimeout(checkForLiveContent, 100);\n }\n });\n\n // Start observing\n observerRef.current.observe(containerRef.current, {\n childList: true,\n subtree: true,\n characterData: true,\n characterDataOldValue: true\n });\n\n // Also set up an interval as a fallback\n const intervalId = setInterval(checkForLiveContent, 1000);\n\n return () => {\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n clearInterval(intervalId);\n };\n }, [containerRef, enabled, indicatorColor, indicatorSize, showPulseAnimation]);\n\n return {\n // Expose method to manually trigger check if needed\n checkForLiveContent: () => {\n const currentTimeElements = containerRef.current?.querySelectorAll('.shaka-current-time');\n currentTimeElements?.forEach((element) => {\n const textContent = element.textContent?.trim() || '';\n if (textContent.toLowerCase().includes('live')) {\n // Add indicator logic here if needed\n }\n });\n }\n };\n}; ","import { useEffect, useState } from 'react';\n\nexport function useShakaAbsoluteTime({\n player,\n controls,\n manualStreamStartDate,\n}: {\n player: shaka.Player | null;\n controls: shaka.ui.Controls | null;\n manualStreamStartDate?: Date; // Optional manual override\n}) {\n const [detectedStreamStart, setDetectedStreamStart] = useState<Date | null>(null);\n\n // Helper function to extract stream start time from manifest\n const detectStreamStartFromManifest = async (): Promise<Date | null> => {\n if (!player) return null;\n\n try {\n const manifest = player.getManifest();\n if (!manifest) return null;\n\n // Check if this is a live stream\n const isLive = player.isLive();\n if (!isLive) return null;\n\n // Try to get seekable range information for live streams\n const video = player.getMediaElement();\n if (video && video.seekable && video.seekable.length > 0) {\n const seekableStart = video.seekable.start(0);\n const seekableEnd = video.seekable.end(0);\n const seekableDuration = seekableEnd - seekableStart;\n \n // Estimate stream start based on seekable window\n const now = Date.now() / 1000;\n const estimatedStreamStart = now - seekableDuration;\n return new Date(estimatedStreamStart * 1000);\n }\n\n // Try to use network information if available\n const stats = player.getStats();\n if (stats && stats.manifestTimeSeconds) {\n // Use manifest load time as a reference\n return new Date((Date.now() / 1000 - stats.manifestTimeSeconds) * 1000);\n }\n\n // Fallback: Try to extract timing info from buffered ranges\n try {\n const bufferedTimeRanges = video?.buffered;\n if (bufferedTimeRanges && bufferedTimeRanges.length > 0) {\n const totalBuffered = bufferedTimeRanges.end(bufferedTimeRanges.length - 1);\n const now = Date.now() / 1000;\n return new Date((now - totalBuffered) * 1000);\n }\n } catch (error) {\n console.warn('Error extracting buffered timing info:', error);\n }\n\n console.warn('Could not detect stream start time from manifest');\n return null;\n } catch (error) {\n console.warn('Error detecting stream start time:', error);\n return null;\n }\n };\n\n // Detect stream start time when player is ready\n useEffect(() => {\n if (!player || manualStreamStartDate) return;\n\n const detectStartTime = async () => {\n // Wait a bit for manifest to be fully loaded\n setTimeout(async () => {\n const detectedStart = await detectStreamStartFromManifest();\n if (detectedStart) {\n setDetectedStreamStart(detectedStart);\n console.log('Detected stream start time:', detectedStart.toISOString());\n }\n }, 1000);\n };\n\n // Listen for manifest loaded event\n const onManifestParsed = () => {\n detectStartTime();\n };\n\n // Try immediate detection and also listen for events\n detectStartTime();\n \n // Listen for various player events that might indicate manifest is ready\n try {\n player.addEventListener('manifestparsed', onManifestParsed);\n player.addEventListener('streaming', onManifestParsed);\n } catch (error) {\n // Fallback if event listeners aren't available\n console.warn('Could not add manifest event listeners:', error);\n }\n\n return () => {\n try {\n player.removeEventListener('manifestparsed', onManifestParsed);\n player.removeEventListener('streaming', onManifestParsed);\n } catch (error) {\n // Ignore cleanup errors\n }\n };\n }, [player, manualStreamStartDate]);\n\n const effectiveStreamStart = manualStreamStartDate || detectedStreamStart;\n\n useEffect(() => {\n if (!player || !controls || !effectiveStreamStart) return;\n\n const video = player.getMediaElement();\n if (!video) return;\n\n // Store original getDisplayTime method\n let originalGetDisplayTime: any;\n let timeDisplayElement: any;\n \n // Helper function to format time as HH:MM:SS or MM:SS\n const formatElapsedTime = (elapsedSeconds: number): string => {\n const hours = Math.floor(elapsedSeconds / 3600);\n const minutes = Math.floor((elapsedSeconds % 3600) / 60);\n const seconds = Math.floor(elapsedSeconds % 60);\n\n if (hours > 0) {\n return [hours, minutes, seconds]\n .map(val => val.toString().padStart(2, '0'))\n .join(':');\n } else {\n return [minutes, seconds]\n .map(val => val.toString().padStart(2, '0'))\n .join(':');\n }\n };\n\n // Calculate elapsed time since stream start\n const getElapsedTime = (): number => {\n const now = new Date();\n const elapsedMs = now.getTime() - effectiveStreamStart.getTime();\n return Math.max(0, elapsedMs / 1000);\n };\n\n // Custom getDisplayTime implementation for elapsed time\n const customGetDisplayTime = function(this: any) {\n const elapsedSeconds = getElapsedTime();\n return formatElapsedTime(elapsedSeconds);\n };\n\n // Find and override the time display element\n const setupTimeDisplayOverride = () => {\n try {\n const controlsContainer = controls.getControlsContainer();\n if (!controlsContainer) return;\n\n // Find the time display element\n const timeDisplay = controlsContainer.querySelector('.shaka-current-time');\n if (timeDisplay) {\n timeDisplayElement = timeDisplay;\n \n // Check if the element has a getDisplayTime method (it's a custom element)\n if (timeDisplayElement.getDisplayTime) {\n // Store the original method\n originalGetDisplayTime = timeDisplayElement.getDisplayTime.bind(timeDisplayElement);\n \n // Override the getDisplayTime method\n timeDisplayElement.getDisplayTime = customGetDisplayTime.bind(timeDisplayElement);\n } else {\n // If no getDisplayTime method, we'll use direct text content updates\n setupDirectTextUpdate();\n }\n }\n } catch (error) {\n console.warn('Error setting up time display override:', error);\n // Fallback to direct text updates\n setupDirectTextUpdate();\n }\n };\n\n // Fallback: Direct text content updates using animation frame\n const setupDirectTextUpdate = () => {\n let animationFrameId: number;\n let isDestroyed = false;\n\n const updateTimeDisplay = () => {\n if (isDestroyed) return;\n\n try {\n const controlsContainer = controls.getControlsContainer();\n if (controlsContainer) {\n const currentTimeLabels = controlsContainer.querySelectorAll('.shaka-current-time');\n const elapsedSeconds = getElapsedTime();\n const timeText = formatElapsedTime(elapsedSeconds);\n\n currentTimeLabels.forEach(label => {\n if (label && label.textContent !== timeText) {\n label.textContent = timeText;\n }\n });\n }\n } catch (error) {\n console.warn('Error updating time display:', error);\n }\n\n animationFrameId = requestAnimationFrame(updateTimeDisplay);\n };\n\n updateTimeDisplay();\n\n // Return cleanup function\n return () => {\n isDestroyed = true;\n if (animationFrameId) {\n cancelAnimationFrame(animationFrameId);\n }\n };\n };\n\n // Setup seekbar tooltip for elapsed time\n const setupSeekbarTooltip = () => {\n try {\n const controlsContainer = controls.getControlsContainer();\n if (!controlsContainer) return;\n\n const seekBar = controlsContainer.querySelector('.shaka-seek-bar') as HTMLInputElement;\n if (!seekBar) return;\n\n const onSeekBarMouseMove = (event: MouseEvent) => {\n const rect = seekBar.getBoundingClientRect();\n const pos = (event.clientX - rect.left) / rect.width;\n \n const totalElapsedSeconds = getElapsedTime();\n \n // For live streams, estimate the time at the hovered position\n const seekableRange = video.seekable;\n if (seekableRange.length > 0) {\n const seekableDuration = seekableRange.end(0) - seekableRange.start(0);\n const positionInStream = totalElapsedSeconds - (seekableDuration * (1 - pos));\n const timeAtPosition = Math.max(0, positionInStream);\n \n seekBar.title = formatElapsedTime(timeAtPosition);\n } else {\n // Fallback: just show the current elapsed time\n seekBar.title = formatElapsedTime(totalElapsedSeconds);\n }\n };\n\n seekBar.addEventListener('mousemove', onSeekBarMouseMove);\n\n return () => {\n seekBar.removeEventListener('mousemove', onSeekBarMouseMove);\n };\n } catch (error) {\n console.warn('Error setting up seekbar tooltip:', error);\n return () => {};\n }\n };\n\n // Wait for UI to be ready, then setup overrides\n const setupWithDelay = () => {\n setTimeout(() => {\n setupTimeDisplayOverride();\n const cleanupSeekbar = setupSeekbarTooltip();\n \n // Store cleanup function\n (setupWithDelay as any).cleanupSeekbar = cleanupSeekbar;\n }, 100);\n };\n\n setupWithDelay();\n\n // Cleanup function\n return () => {\n // Restore original getDisplayTime method if it was overridden\n if (timeDisplayElement && originalGetDisplayTime) {\n try {\n timeDisplayElement.getDisplayTime = originalGetDisplayTime;\n } catch (error) {\n console.warn('Error restoring original getDisplayTime:', error);\n }\n }\n\n // Cleanup seekbar tooltip\n if ((setupWithDelay as any).cleanupSeekbar) {\n (setupWithDelay as any).cleanupSeekbar();\n }\n };\n }, [player, controls, effectiveStreamStart]);\n\n // Return detected stream start for debugging/info purposes\n return {\n detectedStreamStart,\n effectiveStreamStart,\n isUsingManualDate: !!manualStreamStartDate\n };\n}","import React from 'react';\nimport { twMerge } from 'tailwind-merge';\n\ninterface LoadingProps {\n className?: string;\n}\n\nexport const Loading: React.FC<LoadingProps> = ({ className }) => (\n <div\n className={twMerge(\n \"relative bg-[#151515] md:rounded-2xl! overflow-hidden aspect-video text-white w-full h-full flex justify-center items-center text-[10px]\",\n className\n )}\n role=\"status\"\n >\n <div className=\"animate-spin rounded-full h-8 w-8 border-b-2 border-white\"></div>\n <span className=\"sr-only\">Loading...</span>\n </div>\n); ","import React from 'react';\n\ninterface ErrorScreenProps {\n title?: string;\n description?: string;\n}\n\nexport const ErrorScreen: React.FC<ErrorScreenProps> = ({ title, description }) => (\n <div className=\"w-full h-full md:rounded-2xl! aspect-video bg-black\">\n <div className=\"bg-[#151515] text-white w-full h-full flex justify-stretch items-center\">\n <svg\n className=\"w-24 h-24 m-6\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n style={{ width: 96 }}\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n <div>\n <h3 className=\"text-2xl mb-2\">{title || \"Playback Error\"}</h3>\n <div className=\"text-lg\">{description || \"Unable to play the video. Please try again later.\"}</div>\n </div>\n </div>\n </div>\n); ","import React from 'react';\n\ninterface TitleProps {\n title: string;\n}\n\nexport const Title: React.FC<TitleProps> = ({ title }) => (\n <div className=\"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-4\">\n <h2 className=\"text-white text-xl font-semibold\">{title}</h2>\n </div>\n); ","import React from 'react';\n\ninterface LiveBadgeProps {\n isVisible: boolean;\n position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';\n className?: string;\n style?: React.CSSProperties;\n text?: string;\n}\n\nexport const LiveBadge: React.FC<LiveBadgeProps> = ({\n isVisible,\n position = 'top-right',\n className = '',\n style = {},\n text = 'LIVE'\n}) => {\n if (!isVisible) return null;\n\n const positionClasses = {\n 'top-left': 'top-4 left-4',\n 'top-right': 'top-4 right-4',\n 'bottom-left': 'bottom-4 left-4',\n 'bottom-right': 'bottom-4 right-4'\n };\n\n return (\n <div\n className={`\n absolute z-50 \n ${positionClasses[position]}\n bg-red-600 text-white \n px-2 py-1 \n rounded-md \n text-xs font-bold \n uppercase tracking-wide\n shadow-lg\n animate-pulse\n pointer-events-none\n ${className}\n `}\n style={style}\n >\n <span className=\"flex items-center gap-1\">\n <span className=\"w-2 h-2 bg-white rounded-full animate-pulse\"></span>\n {text}\n </span>\n </div>\n );\n}; ","import styleInject from '#style-inject';styleInject(\"/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */\\n@layer properties;\\n@layer theme, base, components, utilities;\\n@layer theme {\\n :root,\\n :host {\\n --font-sans:\\n ui-sans-serif,\\n system-ui,\\n sans-serif,\\n \\\"Apple Color Emoji\\\",\\n \\\"Segoe UI Emoji\\\",\\n \\\"Segoe UI Symbol\\\",\\n \\\"Noto Color Emoji\\\";\\n --font-mono:\\n ui-monospace,\\n SFMono-Regular,\\n Menlo,\\n Monaco,\\n Consolas,\\n \\\"Liberation Mono\\\",\\n \\\"Courier New\\\",\\n monospace;\\n --color-red-600: oklch(57.7% 0.245 27.325);\\n --color-black: #000;\\n --color-white: #fff;\\n --spacing: 0.25rem;\\n --container-4xl: 56rem;\\n --text-xs: 0.75rem;\\n --text-xs--line-height: calc(1 / 0.75);\\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-5xl: 3rem;\\n --text-5xl--line-height: 1;\\n --font-weight-medium: 500;\\n --font-weight-semibold: 600;\\n --font-weight-bold: 700;\\n --tracking-wide: 0.025em;\\n --tracking-widest: 0.1em;\\n --radius-md: 0.375rem;\\n --radius-2xl: 1rem;\\n --animate-spin: spin 1s linear infinite;\\n --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\\n --aspect-video: 16 / 9;\\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 *,\\n ::after,\\n ::before,\\n ::backdrop,\\n ::file-selector-button {\\n box-sizing: border-box;\\n margin: 0;\\n padding: 0;\\n border: 0 solid;\\n }\\n html,\\n :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,\\n h2,\\n h3,\\n h4,\\n h5,\\n 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,\\n strong {\\n font-weight: bolder;\\n }\\n code,\\n kbd,\\n samp,\\n 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,\\n 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,\\n ul,\\n menu {\\n list-style: none;\\n }\\n img,\\n svg,\\n video,\\n canvas,\\n audio,\\n iframe,\\n embed,\\n object {\\n display: block;\\n vertical-align: middle;\\n }\\n img,\\n video {\\n max-width: 100%;\\n height: auto;\\n }\\n button,\\n input,\\n select,\\n optgroup,\\n textarea,\\n ::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,\\n ::-webkit-datetime-edit-year-field,\\n ::-webkit-datetime-edit-month-field,\\n ::-webkit-datetime-edit-day-field,\\n ::-webkit-datetime-edit-hour-field,\\n ::-webkit-datetime-edit-minute-field,\\n ::-webkit-datetime-edit-second-field,\\n ::-webkit-datetime-edit-millisecond-field,\\n ::-webkit-datetime-edit-meridiem-field {\\n padding-block: 0;\\n }\\n :-moz-ui-invalid {\\n box-shadow: none;\\n }\\n button,\\n input:where([type=button], [type=reset], [type=submit]),\\n ::file-selector-button {\\n appearance: button;\\n }\\n ::-webkit-inner-spin-button,\\n ::-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-auto {\\n pointer-events: auto;\\n }\\n .pointer-events-none {\\n pointer-events: none;\\n }\\n .visible {\\n visibility: visible;\\n }\\n .sr-only {\\n position: absolute;\\n width: 1px;\\n height: 1px;\\n padding: 0;\\n margin: -1px;\\n overflow: hidden;\\n clip: rect(0, 0, 0, 0);\\n white-space: nowrap;\\n border-width: 0;\\n }\\n .absolute {\\n position: absolute;\\n }\\n .fixed {\\n position: fixed;\\n }\\n .relative {\\n position: relative;\\n }\\n .static {\\n position: static;\\n }\\n .inset-0 {\\n inset: calc(var(--spacing) * 0);\\n }\\n .top-0 {\\n top: calc(var(--spacing) * 0);\\n }\\n .top-4 {\\n top: calc(var(--spacing) * 4);\\n }\\n .right-0 {\\n right: calc(var(--spacing) * 0);\\n }\\n .right-4 {\\n right: calc(var(--spacing) * 4);\\n }\\n .bottom-0 {\\n bottom: calc(var(--spacing) * 0);\\n }\\n .bottom-4 {\\n bottom: calc(var(--spacing) * 4);\\n }\\n .left-0 {\\n left: calc(var(--spacing) * 0);\\n }\\n .left-4 {\\n left: calc(var(--spacing) * 4);\\n }\\n .z-10 {\\n z-index: 10;\\n }\\n .z-50 {\\n z-index: 50;\\n }\\n .container {\\n width: 100%;\\n @media (width >= 40rem) {\\n max-width: 40rem;\\n }\\n @media (width >= 48rem) {\\n max-width: 48rem;\\n }\\n @media (width >= 64rem) {\\n max-width: 64rem;\\n }\\n @media (width >= 80rem) {\\n max-width: 80rem;\\n }\\n @media (width >= 96rem) {\\n max-width: 96rem;\\n }\\n }\\n .m-6 {\\n margin: calc(var(--spacing) * 6);\\n }\\n .mt-1 {\\n margin-top: calc(var(--spacing) * 1);\\n }\\n .mt-3 {\\n margin-top: calc(var(--spacing) * 3);\\n }\\n .mb-2 {\\n margin-bottom: calc(var(--spacing) * 2);\\n }\\n .mb-6 {\\n margin-bottom: calc(var(--spacing) * 6);\\n }\\n .flex {\\n display: flex;\\n }\\n .grid {\\n display: grid;\\n }\\n .hidden {\\n display: none;\\n }\\n .aspect-video {\\n aspect-ratio: var(--aspect-video);\\n }\\n .h-2 {\\n height: calc(var(--spacing) * 2);\\n }\\n .h-8 {\\n height: calc(var(--spacing) * 8);\\n }\\n .h-24 {\\n height: calc(var(--spacing) * 24);\\n }\\n .h-full {\\n height: 100%;\\n }\\n .w-2 {\\n width: calc(var(--spacing) * 2);\\n }\\n .w-8 {\\n width: calc(var(--spacing) * 8);\\n }\\n .w-24 {\\n width: calc(var(--spacing) * 24);\\n }\\n .w-full {\\n width: 100%;\\n }\\n .max-w-4xl {\\n max-width: var(--container-4xl);\\n }\\n .animate-pulse {\\n animation: var(--animate-pulse);\\n }\\n .animate-spin {\\n animation: var(--animate-spin);\\n }\\n .auto-cols-max {\\n grid-auto-columns: max-content;\\n }\\n .grid-flow-col {\\n grid-auto-flow: column;\\n }\\n .flex-col {\\n flex-direction: column;\\n }\\n .items-center {\\n align-items: center;\\n }\\n .justify-center {\\n justify-content: center;\\n }\\n .justify-stretch {\\n justify-content: stretch;\\n }\\n .gap-1 {\\n gap: calc(var(--spacing) * 1);\\n }\\n .gap-5 {\\n gap: calc(var(--spacing) * 5);\\n }\\n .overflow-hidden {\\n overflow: hidden;\\n }\\n .rounded-full {\\n border-radius: calc(infinity * 1px);\\n }\\n .rounded-md {\\n border-radius: var(--radius-md);\\n }\\n .border-b-2 {\\n border-bottom-style: var(--tw-border-style);\\n border-bottom-width: 2px;\\n }\\n .border-white {\\n border-color: var(--color-white);\\n }\\n .bg-\\\\[\\\\#151515\\\\] {\\n background-color: #151515;\\n }\\n .bg-black {\\n background-color: var(--color-black);\\n }\\n .bg-red-600 {\\n background-color: var(--color-red-600);\\n }\\n .bg-white {\\n background-color: var(--color-white);\\n }\\n .bg-gradient-to-t {\\n --tw-gradient-position: to top in oklab;\\n background-image: linear-gradient(var(--tw-gradient-stops));\\n }\\n .from-black\\\\/70 {\\n --tw-gradient-from: color-mix(in srgb, #000 70%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n --tw-gradient-from: color-mix(in oklab, var(--color-black) 70%, transparent);\\n }\\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 .to-transparent {\\n --tw-gradient-to: transparent;\\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 .bg-no-repeat {\\n background-repeat: no-repeat;\\n }\\n .p-2 {\\n padding: calc(var(--spacing) * 2);\\n }\\n .p-4 {\\n padding: calc(var(--spacing) * 4);\\n }\\n .px-2 {\\n padding-inline: calc(var(--spacing) * 2);\\n }\\n .px-4 {\\n padding-inline: calc(var(--spacing) * 4);\\n }\\n .py-1 {\\n padding-block: calc(var(--spacing) * 1);\\n }\\n .text-center {\\n text-align: center;\\n }\\n .text-left {\\n text-align: left;\\n }\\n .font-mono {\\n font-family: var(--font-mono);\\n }\\n .text-2xl {\\n font-size: var(--text-2xl);\\n line-height: var(--tw-leading, var(--text-2xl--line-height));\\n }\\n .text-5xl {\\n font-size: var(--text-5xl);\\n line-height: var(--tw-leading, var(--text-5xl--line-height));\\n }\\n .text-base {\\n font-size: var(--text-base);\\n line-height: var(--tw-leading, var(--text-base--line-height));\\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 .text-xs {\\n font-size: var(--text-xs);\\n line-height: var(--tw-leading, var(--text-xs--line-height));\\n }\\n .text-\\\\[10px\\\\] {\\n font-size: 10px;\\n }\\n .font-bold {\\n --tw-font-weight: var(--font-weight-bold);\\n font-weight: var(--font-weight-bold);\\n }\\n .font-medium {\\n --tw-font-weight: var(--font-weight-medium);\\n font-weight: var(--font-weight-medium);\\n }\\n .font-semibold {\\n --tw-font-weight: var(--font-weight-semibold);\\n font-weight: var(--font-weight-semibold);\\n }\\n .tracking-wide {\\n --tw-tracking: var(--tracking-wide);\\n letter-spacing: var(--tracking-wide);\\n }\\n .tracking-widest {\\n --tw-tracking: var(--tracking-widest);\\n letter-spacing: var(--tracking-widest);\\n }\\n .text-white {\\n color: var(--color-white);\\n }\\n .uppercase {\\n text-transform: uppercase;\\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:\\n var(--tw-inset-shadow),\\n var(--tw-inset-ring-shadow),\\n var(--tw-ring-offset-shadow),\\n var(--tw-ring-shadow),\\n var(--tw-shadow);\\n }\\n .filter {\\n filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);\\n }\\n .md\\\\:rounded-2xl {\\n @media (width >= 48rem) {\\n border-radius: var(--radius-2xl);\\n }\\n }\\n .md\\\\:rounded-2xl\\\\! {\\n @media (width >= 48rem) {\\n border-radius: var(--radius-2xl) !important;\\n }\\n }\\n .md\\\\:text-base {\\n @media (width >= 48rem) {\\n font-size: var(--text-base);\\n line-height: var(--tw-leading, var(--text-base--line-height));\\n }\\n }\\n .md\\\\:text-sm {\\n @media (width >= 48rem) {\\n font-size: var(--text-sm);\\n line-height: var(--tw-leading, var(--text-sm--line-height));\\n }\\n }\\n .md\\\\:text-xl {\\n @media (width >= 48rem) {\\n font-size: var(--text-xl);\\n line-height: var(--tw-leading, var(--text-xl--line-height));\\n }\\n }\\n}\\n@layer components {\\n .motto-video-container {\\n position: relative;\\n width: 100%;\\n min-height: 300px;\\n }\\n @supports (aspect-ratio: 16/9) {\\n .motto-video-container {\\n min-height: auto;\\n }\\n }\\n .motto-video-responsive {\\n position: absolute;\\n top: calc(var(--spacing) * 0);\\n left: calc(var(--spacing) * 0);\\n height: 100%;\\n width: 100%;\\n }\\n .motto-skip-button {\\n position: absolute;\\n top: calc(1/2 * 100%);\\n z-index: 10;\\n display: flex;\\n height: calc(var(--spacing) * 16);\\n width: calc(var(--spacing) * 16);\\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\\n translate: var(--tw-translate-x) var(--tw-translate-y);\\n cursor: pointer;\\n align-items: center;\\n justify-content: center;\\n border-radius: calc(infinity * 1px);\\n border-style: var(--tw-border-style);\\n border-width: 0px;\\n background-color: color-mix(in srgb, #000 70%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n background-color: color-mix(in oklab, var(--color-black) 70%, transparent);\\n }\\n font-size: var(--text-2xl);\\n line-height: var(--tw-leading, var(--text-2xl--line-height));\\n color: var(--color-white);\\n opacity: 80%;\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n &:hover {\\n @media (hover: hover) {\\n --tw-scale-x: 110%;\\n --tw-scale-y: 110%;\\n --tw-scale-z: 110%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n }\\n &:hover {\\n @media (hover: hover) {\\n opacity: 100%;\\n }\\n }\\n &:active {\\n --tw-scale-x: 95%;\\n --tw-scale-y: 95%;\\n --tw-scale-z: 95%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n }\\n .motto-skip-button-back {\\n left: calc(var(--spacing) * 5);\\n }\\n .motto-skip-button-forward {\\n right: calc(var(--spacing) * 5);\\n }\\n .motto-mobile-controls-overlay {\\n position: absolute;\\n inset: calc(var(--spacing) * 0);\\n z-index: 20;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\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 --tw-duration: 300ms;\\n transition-duration: 300ms;\\n pointer-events: none;\\n }\\n .motto-mobile-controls-group {\\n display: flex;\\n align-items: center;\\n gap: calc(var(--spacing) * 8);\\n opacity: 100%;\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n pointer-events: none;\\n }\\n .motto-mobile-play-button {\\n display: flex;\\n height: calc(var(--spacing) * 14);\\n width: calc(var(--spacing) * 14);\\n cursor: pointer;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n border-radius: calc(infinity * 1px);\\n border-style: var(--tw-border-style);\\n border-width: 0px;\\n background-color: color-mix(in srgb, #000 30%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n background-color: color-mix(in oklab, var(--color-black) 30%, transparent);\\n }\\n color: var(--color-white);\\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:\\n var(--tw-inset-shadow),\\n var(--tw-inset-ring-shadow),\\n var(--tw-ring-offset-shadow),\\n var(--tw-ring-shadow),\\n var(--tw-shadow);\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n pointer-events: auto;\\n }\\n .motto-mobile-play-button:active {\\n --tw-scale-x: 95%;\\n --tw-scale-y: 95%;\\n --tw-scale-z: 95%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n .motto-mobile-play-button svg {\\n height: calc(var(--spacing) * 7);\\n width: calc(var(--spacing) * 7);\\n }\\n .motto-mobile-skip-button {\\n display: flex;\\n height: calc(var(--spacing) * 10);\\n width: calc(var(--spacing) * 10);\\n cursor: pointer;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n border-radius: calc(infinity * 1px);\\n border-style: var(--tw-border-style);\\n border-width: 0px;\\n background-color: color-mix(in srgb, #000 30%, transparent);\\n @supports (color: color-mix(in lab, red, red)) {\\n background-color: color-mix(in oklab, var(--color-black) 30%, transparent);\\n }\\n color: var(--color-white);\\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:\\n var(--tw-inset-shadow),\\n var(--tw-inset-ring-shadow),\\n var(--tw-ring-offset-shadow),\\n var(--tw-ring-shadow),\\n var(--tw-shadow);\\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 --tw-duration: 200ms;\\n transition-duration: 200ms;\\n pointer-events: auto;\\n }\\n .motto-mobile-skip-button:active {\\n --tw-scale-x: 95%;\\n --tw-scale-y: 95%;\\n --tw-scale-z: 95%;\\n scale: var(--tw-scale-x) var(--tw-scale-y);\\n }\\n .motto-mobile-skip-button svg {\\n height: calc(var(--spacing) * 6);\\n width: calc(var(--spacing) * 6);\\n }\\n}\\n@media (min-width: 768px) {\\n .motto-mobile-controls-overlay {\\n display: none !important;\\n }\\n}\\n@media (max-width: 767px) {\\n .shaka-controls-container .motto-native-skip-button,\\n .shaka-controls-container .motto-skip-back-button,\\n .shaka-controls-container .motto-skip-forward-button,\\n .shaka-controls-container .shaka-button[title*=\\\"Skip back\\\"],\\n .shaka-controls-container .shaka-button[title*=\\\"Skip forward\\\"],\\n .shaka-controls-container .shaka-button[aria-label*=\\\"Skip back\\\"],\\n .shaka-controls-container .shaka-button[aria-label*=\\\"Skip forward\\\"],\\n .shaka-controls-container button[title*=\\\"Skip back\\\"],\\n .shaka-controls-container button[title*=\\\"Skip forward\\\"],\\n .shaka-controls-container button[aria-label*=\\\"Skip back\\\"],\\n .shaka-controls-container button[aria-label*=\\\"Skip forward\\\"],\\n .motto-native-skip-button:not(.motto-mobile-skip-button),\\n .motto-skip-back-button:not(.motto-mobile-skip-button),\\n .motto-skip-forward-button:not(.motto-mobile-skip-button),\\n .shaka-button[title*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n .shaka-button[title*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button),\\n .shaka-button[aria-label*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n .shaka-button[aria-label*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button),\\n button[title*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n button[title*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button),\\n button[aria-label*=\\\"Skip back\\\"]:not(.motto-mobile-skip-button),\\n button[aria-label*=\\\"Skip forward\\\"]:not(.motto-mobile-skip-button) {\\n display: none !important;\\n visibility: hidden !important;\\n opacity: 0 !important;\\n width: 0 !important;\\n height: 0 !important;\\n padding: 0 !important;\\n margin: 0 !important;\\n }\\n .shaka-controls-container {\\n z-index: 90 !important;\\n height: 100px !important;\\n bottom: 0 !important;\\n top: unset !important;\\n }\\n .motto-mobile-skip-button {\\n display: flex !important;\\n visibility: visible !important;\\n opacity: 1 !important;\\n }\\n}\\n.shaka-seek-bar-container {\\n height: 6px !important;\\n width: 100% !important;\\n margin: 8px 0 !important;\\n border-radius: 4px !important;\\n position: relative !important;\\n border-top: none !important;\\n border-bottom: none !important;\\n box-shadow: none !important;\\n}\\n.shaka-seek-bar {\\n height: 6px !important;\\n width: 100% !important;\\n -webkit-appearance: none !important;\\n appearance: none !important;\\n background: transparent !important;\\n cursor: pointer !important;\\n border: none !important;\\n outline: none !important;\\n position: absolute !important;\\n top: 0 !important;\\n left: 0 !important;\\n border-radius: 4px !important;\\n}\\n.shaka-seek-bar::-webkit-slider-runnable-track {\\n height: 6px !important;\\n background: transparent !important;\\n border-radius: 4px !important;\\n border: none !important;\\n}\\n.shaka-seek-bar::-moz-range-track {\\n height: 6px !important;\\n background: transparent !important;\\n border-radius: 4px !important;\\n border: none !important;\\n}\\n.shaka-seek-bar::-webkit-slider-thumb {\\n -webkit-appearance: none !important;\\n appearance: none !important;\\n width: 16px !important;\\n height: 16px !important;\\n border-radius: 50% !important;\\n background: #ffffff !important;\\n cursor: pointer !important;\\n border: 2px solid #ffffff !important;\\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;\\n margin-top: -4px !important;\\n}\\n.shaka-seek-bar::-moz-range-thumb {\\n width: 16px !important;\\n height: 16px !important;\\n border-radius: 50% !important;\\n background: #ffffff !important;\\n cursor: pointer !important;\\n border: 2px solid #ffffff !important;\\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;\\n margin-top: -4px !important;\\n}\\n.motto-skip-back-button,\\n.motto-skip-forward-button,\\n.motto-native-skip-button {\\n background: transparent !important;\\n border: none !important;\\n padding: 4px !important;\\n margin: 0px !important;\\n cursor: pointer !important;\\n color: #ffffff !important;\\n transition: all 0.2s ease !important;\\n min-width: 32px !important;\\n height: 32px !important;\\n display: flex !important;\\n align-items: center !important;\\n justify-content: center !important;\\n border-radius: 4px !important;\\n width: 25px;\\n}\\n.motto-skip-back-button:hover,\\n.motto-skip-forward-button:hover,\\n.motto-native-skip-button:hover {\\n opacity: 0.8 !important;\\n background: transparent !important;\\n transform: scale(1.05) !important;\\n}\\n.motto-skip-back-button:active,\\n.motto-skip-forward-button:active,\\n.motto-native-skip-button:active {\\n transform: scale(0.95) !important;\\n}\\n.motto-skip-back-button svg,\\n.motto-skip-forward-button svg,\\n.motto-native-skip-button svg {\\n width: 24px !important;\\n height: 24px !important;\\n}\\n@media (max-width: 767px) {\\n .shaka-controls-container .motto-native-skip-button,\\n .shaka-controls-container .motto-skip-back-button,\\n .shaka-controls-container .motto-skip-forward-button,\\n .shaka-controls-container .shaka-play-button,\\n .shaka-controls-container .shaka-pause-button {\\n display: none !important;\\n }\\n}\\n.shaka-spinner-svg {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-spinner-path {\\n stroke: white !important;\\n fill: none !important;\\n}\\n.shaka-spinner-container {\\n color: white !important;\\n}\\n.shaka-buffering-spinner {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-buffering-spinner svg {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-buffering-spinner path {\\n stroke: white !important;\\n fill: none !important;\\n}\\n[data-shaka-player-container] .shaka-spinner,\\n[data-shaka-player-container] .spinner {\\n color: white !important;\\n border-color: white !important;\\n}\\n.material-icons.shaka-spinner {\\n color: white !important;\\n}\\n.shaka-controls-container .shaka-spinner,\\n.shaka-video-container .shaka-spinner {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-controls-container .shaka-spinner svg,\\n.shaka-video-container .shaka-spinner svg {\\n color: white !important;\\n fill: white !important;\\n}\\n.shaka-controls-container .shaka-spinner path,\\n.shaka-video-container .shaka-spinner path {\\n stroke: white !important;\\n}\\n.motto-video-loading-overlay {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n background:\\n linear-gradient(\\n 135deg,\\n #1a1a1a 0%,\\n #2d2d2d 100%);\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n z-index: 10;\\n transition: opacity 0.3s ease;\\n}\\n.motto-video-loading-overlay.hidden {\\n opacity: 0;\\n pointer-events: none;\\n}\\n.motto-video-loading-content {\\n text-align: center;\\n color: white;\\n}\\n.motto-video-loading-icon {\\n width: 64px;\\n height: 64px;\\n margin-bottom: 16px;\\n opacity: 0.7;\\n}\\n.motto-video-loading-text {\\n font-size: 16px;\\n font-weight: 500;\\n margin-bottom: 8px;\\n}\\n.motto-video-loading-subtext {\\n font-size: 14px;\\n opacity: 0.7;\\n}\\n@keyframes pulse-live {\\n 0% {\\n opacity: 1;\\n transform: scale(1);\\n }\\n 50% {\\n opacity: 0.7;\\n transform: scale(1.1);\\n }\\n 100% {\\n opacity: 1;\\n transform: scale(1);\\n }\\n}\\n@property --tw-border-style { syntax: \\\"*\\\"; inherits: false; initial-value: solid; }\\n@property --tw-gradient-position { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-gradient-from { syntax: \\\"<color>\\\"; inherits: false; initial-value: #0000; }\\n@property --tw-gradient-via { syntax: \\\"<color>\\\"; inherits: false; initial-value: #0000; }\\n@property --tw-gradient-to { syntax: \\\"<color>\\\"; inherits: false; initial-value: #0000; }\\n@property --tw-gradient-stops { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-gradient-via-stops { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-gradient-from-position { syntax: \\\"<length-percentage>\\\"; inherits: false; initial-value: 0%; }\\n@property --tw-gradient-via-position { syntax: \\\"<length-percentage>\\\"; inherits: false; initial-value: 50%; }\\n@property --tw-gradient-to-position { syntax: \\\"<length-percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-font-weight { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-tracking { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-shadow-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-shadow-alpha { syntax: \\\"<percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-inset-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-inset-shadow-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-inset-shadow-alpha { syntax: \\\"<percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-ring-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-ring-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-inset-ring-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-inset-ring-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-ring-inset { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-ring-offset-width { syntax: \\\"<length>\\\"; inherits: false; initial-value: 0px; }\\n@property --tw-ring-offset-color { syntax: \\\"*\\\"; inherits: false; initial-value: #fff; }\\n@property --tw-ring-offset-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-blur { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-brightness { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-contrast { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-grayscale { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-hue-rotate { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-invert { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-opacity { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-saturate { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-sepia { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-drop-shadow { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-drop-shadow-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-drop-shadow-alpha { syntax: \\\"<percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-drop-shadow-size { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-translate-x { syntax: \\\"*\\\"; inherits: false; initial-value: 0; }\\n@property --tw-translate-y { syntax: \\\"*\\\"; inherits: false; initial-value: 0; }\\n@property --tw-translate-z { syntax: \\\"*\\\"; inherits: false; initial-value: 0; }\\n@property --tw-duration { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-scale-x { syntax: \\\"*\\\"; inherits: false; initial-value: 1; }\\n@property --tw-scale-y { syntax: \\\"*\\\"; inherits: false; initial-value: 1; }\\n@property --tw-scale-z { syntax: \\\"*\\\"; inherits: false; initial-value: 1; }\\n@keyframes spin {\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n@keyframes pulse {\\n 50% {\\n opacity: 0.5;\\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 *,\\n ::before,\\n ::after,\\n ::backdrop {\\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-tracking: 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-blur: initial;\\n --tw-brightness: initial;\\n --tw-contrast: initial;\\n --tw-grayscale: initial;\\n --tw-hue-rotate: initial;\\n --tw-invert: initial;\\n --tw-opacity: initial;\\n --tw-saturate: initial;\\n --tw-sepia: initial;\\n --tw-drop-shadow: initial;\\n --tw-drop-shadow-color: initial;\\n --tw-drop-shadow-alpha: 100%;\\n --tw-drop-shadow-size: initial;\\n --tw-translate-x: 0;\\n --tw-translate-y: 0;\\n --tw-translate-z: 0;\\n --tw-duration: initial;\\n --tw-scale-x: 1;\\n --tw-scale-y: 1;\\n --tw-scale-z: 1;\\n }\\n }\\n}\\n\")","import React, { useEffect } from 'react';\nimport { twMerge } from 'tailwind-merge';\nimport { useQuery } from '@tanstack/react-query';\nimport { Player } from './Player';\nimport type { PlayerProps } from './types';\nimport { fetchVideoData, type VideoData } from './api';\nimport { Loading, ErrorScreen, Title } from './components';\n\n// Import helper functions\nimport { errorTypes, findHLSPlaylist, getErrorType } from './helper';\nimport useMessages, { type Translations } from './messages/useMessages';\n\nexport interface VideoProps extends Omit<PlayerProps, 'src'> {\n videoId?: string;\n publicKey?: string;\n mottoToken?: string;\n videoData?: VideoData;\n refetchInterval?: number;\n playerName?: string;\n locale?: string;\n events?: {\n onVideoData?: (video: VideoData) => void;\n onEmptyPlaylists?: () => void;\n onError?: (error: Error) => void;\n onPlay?: () => void;\n onPause?: () => void;\n onEnded?: () => void;\n onLoadStart?: () => void;\n onCanPlay?: () => void;\n onPlayerReady?: () => void;\n };\n children?: React.ReactNode;\n className?: string;\n // TanStack Query options\n queryOptions?: {\n enabled?: boolean;\n staleTime?: number;\n cacheTime?: number;\n retry?: number;\n retryDelay?: number;\n };\n}\n\nexport const Video: React.FC<VideoProps> = ({\n videoId,\n publicKey,\n mottoToken,\n videoData: providedVideoData,\n refetchInterval = 0,\n playerName,\n locale = 'en',\n events,\n children,\n className,\n queryOptions = {},\n ...props\n}) => {\n // Use TanStack Query for data fetching\n const {\n data,\n isLoading,\n error,\n refetch\n } = useQuery<VideoData>({\n queryKey: ['video', videoId, publicKey, mottoToken],\n queryFn: () => fetchVideoData(videoId!, publicKey!, mottoToken),\n enabled: !!videoId && !!publicKey && !providedVideoData,\n refetchInterval: refetchInterval > 0 ? refetchInterval : false,\n staleTime: queryOptions.staleTime ?? 5 * 60 * 1000, // 5 minutes\n gcTime: queryOptions.cacheTime ?? 10 * 60 * 1000, // 10 minutes (was cacheTime in v4)\n retry: queryOptions.retry ?? 3,\n retryDelay: queryOptions.retryDelay ?? ((attemptIndex: number) => Math.min(1000 * 2 ** attemptIndex, 30000))\n });\n\n const video = providedVideoData || data;\n const { t } = useMessages(locale);\n \n // Find HLS playlist using helper function\n const activePlaylist = findHLSPlaylist(video);\n const hlsUrl = activePlaylist?.url;\n\n // Notify parent of video data\n useEffect(() => {\n if (events?.onVideoData && video) {\n events.onVideoData(video);\n }\n }, [video, events]);\n\n // Loading state\n if (isLoading || (!providedVideoData && !video)) {\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full bg-[#151515]\">\n <Loading />\n </div>\n </div>\n );\n }\n\n // Handle empty playlists\n if (!isLoading && video && !hlsUrl && events?.onEmptyPlaylists) {\n events.onEmptyPlaylists();\n }\n\n // Error state\n if (error || video?.error) {\n const errorKey = video?.error ? getErrorType(undefined, video) : 'API_ERROR';\n const errorObj = error || new Error(video?.error || 'Unknown error');\n \n if (events?.onError) {\n events.onError(errorObj);\n }\n\n // Use localized error messages\n const title = t(errorKey as keyof Translations) || t('DEFAULT_ERROR');\n const description = t(`${errorKey}_DESCRIPTION` as keyof Translations) || t('DEFAULT_ERROR_DESCRIPTION');\n\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <ErrorScreen\n title={title}\n description={description}\n />\n {children}\n </div>\n </div>\n );\n }\n\n // No playable source\n if (!hlsUrl) {\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full bg-[#151515]\">\n <Title title={video?.name || \"\"} />\n {children}\n </div>\n </div>\n );\n }\n\n console.log(\"hlsUrl\", hlsUrl);\n\n // Render video player with source\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <Player\n {...props}\n src={hlsUrl}\n className={twMerge(\"video-player-container\", className)}\n events={events}\n containerClassName=\"w-full h-full\"\n >\n {children}\n </Player>\n </div>\n </div>\n );\n}; ","export interface VideoData {\n id: string;\n name?: string;\n description?: string;\n playlists?: Array<{\n url: string;\n format: string;\n }>;\n error?: string;\n}\n\nexport interface VideoListItem {\n id: string;\n name?: string;\n description?: string;\n playlists?: Array<{\n url: string;\n format: string;\n }>;\n error?: string;\n}\n\n/**\n * Fetches video data from the Motto Streaming API\n * @param videoId - The ID of the video to fetch\n * @param publicKey - The public key for authentication\n * @param mottoToken - Optional motto token for authenticated requests\n * @returns Promise<VideoData> - The video data\n */\nexport const fetchVideoData = async (\n videoId: string, \n publicKey: string, \n mottoToken?: string\n): Promise<VideoData> => {\n const endpoint = \"https://cda.mottostreaming.com/motto.cda.streaming.video.v1.VideoService/GetVideo\";\n const url = new URL(endpoint);\n url.searchParams.set(\"encoding\", \"json\");\n url.searchParams.set(\"message\", JSON.stringify({ videoId }));\n\n const response = await fetch(url, {\n method: \"GET\",\n headers: {\n Authorization: `Bearer ${publicKey}`,\n ...(Boolean(mottoToken) && { 'x-motto-token': mottoToken })\n },\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch video: ${response.statusText}`);\n }\n\n const data = await response.json() as { video: VideoData };\n return data.video;\n};\n\n/**\n * Fetches multiple videos data from the Motto Streaming API\n * @param publicKey - The public key for authentication\n * @param videoIds - Array of video IDs to fetch\n * @param mottoToken - Optional motto token for authenticated requests\n * @returns Promise<VideoListItem[]> - Array of video data\n */\nexport async function fetchVideosList(\n publicKey: string,\n videoIds: string[],\n mottoToken?: string,\n skip: number = 0,\n limit: number = 0\n): Promise<VideoListItem[]> {\n if (!videoIds || videoIds.length === 0) {\n return [];\n }\n\n const endpoint = \"https://cda.mottostreaming.com/motto.cda.streaming.video.v1.VideoService/BatchGetVideos\";\n const url = new URL(endpoint);\n url.searchParams.set(\"encoding\", \"json\");\n url.searchParams.set(\"message\", JSON.stringify({ videoIds }));\n\n const response = await fetch(url.toString(), {\n method: \"GET\",\n headers: {\n Authorization: `Bearer ${publicKey}`,\n ...(Boolean(mottoToken) && { 'x-motto-token': mottoToken })\n },\n }).catch((err) => {\n throw new Error(`Failed to fetch videos: ${err}`);\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch videos list: ${response.status}`);\n }\n\n const data = (await response.json()) as { videos: VideoListItem[] };\n return data.videos;\n} ","export interface EventData {\n id: string;\n title: string;\n description?: string;\n startTime: string;\n endTime?: string;\n posterUrl?: string;\n videoIds?: string[];\n error?: string;\n}\n\n\n\nexport enum EventsSortDirection {\n ASC = 'asc',\n DESC = 'desc'\n}\n\nexport async function fetchEventData(\n publicKey: string,\n eventId: string,\n unused?: any,\n filter?: string,\n order?: EventsSortDirection,\n locale?: string\n): Promise<EventData> {\n const endpoint = \"https://cda.mottostreaming.com/motto.cda.cms.event.v1.EventService/GetEvent\";\n const url = new URL(endpoint);\n \n // Build the message object\n const message: any = { eventId };\n if (locale?.length) message.locale = locale;\n if (filter) message.filter = filter;\n if (order) message.order = order;\n \n url.searchParams.set(\"encoding\", \"json\");\n url.searchParams.set(\"message\", JSON.stringify(message));\n\n const response = await fetch(url.toString(), {\n method: \"GET\",\n headers: {\n Authorization: `Bearer ${publicKey}`,\n },\n }).catch((err) => {\n throw new Error(`Failed to fetch event: ${err}`);\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch event data: ${response.status}`);\n }\n\n const data = (await response.json()) as { event: EventData };\n return data.event;\n}\n\n ","export interface CreativeWorkData {\n id: string;\n title: string;\n description?: string;\n releaseTime: string;\n endTime?: string;\n posterUrl?: string;\n videoIds?: string[];\n error?: string;\n}\n\nexport enum CreativeWorksSortDirection {\n ASC = 'asc',\n DESC = 'desc'\n}\n\nexport async function fetchCreativeWorkData(\n publicKey: string,\n creativeWorkId: string,\n unused?: any,\n filter?: string,\n order?: CreativeWorksSortDirection,\n locale?: string\n): Promise<CreativeWorkData> {\n const endpoint = \"https://cda.mottostreaming.com/motto.cda.cms.creative_work.v1.CreativeWorkService/GetCreativeWork\";\n const url = new URL(endpoint);\n \n // Build the message object\n const message: any = { creativeWorkId };\n if (locale?.length) message.locale = locale;\n if (filter) message.filter = filter;\n if (order) message.order = order;\n \n url.searchParams.set(\"encoding\", \"json\");\n url.searchParams.set(\"message\", JSON.stringify(message));\n\n const response = await fetch(url.toString(), {\n method: \"GET\",\n headers: {\n Authorization: `Bearer ${publicKey}`,\n },\n }).catch((err) => {\n throw new Error(`Failed to fetch creative work: ${err}`);\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch creative work data: ${response.status}`);\n }\n\n const data = (await response.json()) as { creativeWork: CreativeWorkData };\n return data.creativeWork;\n} ","import type { VideoData } from './api';\n\nconst defaultError = {\n title: \"Playback Error\",\n description: \"Unable to play the video. Please try again later.\",\n};\n\nexport const errorTypes: Record<\n \"api\" | \"default\" | string,\n {\n title: string;\n description: string;\n }\n> = {\n api: {\n title: \"Failed to Retrieve Video Info\",\n description:\n \"Error fetching video details. Check your videoId and internet connection and try again.\",\n },\n ERROR_CODE_NOT_AUTHENTICATED: {\n title: \"Authorisation\",\n description: \"You don't have permission to play this video. \",\n },\n ERROR_CODE_GEO_BLOCKED: {\n title: \"Geoblocking Restriction\",\n description:\n \"Sorry, this video is not available in your region due to geoblocking restrictions.\",\n },\n ERROR_CODE_NOT_ENTITLED: {\n title: \"Not entitled\",\n description: \"Sorry, you are not entitled to play this video.\",\n },\n ERROR_CODE_VPN_BLOCKED: {\n title: \"VPN BLOCKED\",\n description: \"This video is not available due to the use of a VPN.\",\n },\n ERROR_CODE_UNSPECIFIED: defaultError,\n ERROR_CODE_SIGNATURE_MISMATCH: defaultError,\n ERROR_CODE_INVALID_DOMAIN: defaultError,\n default: defaultError,\n};\n\nexport const getMediaTypeFromSource = (\n source: string\n): \"video/mp4\" | \"application/vnd.apple.mpegurl\" | \"video/x-flv\" => {\n if (source.includes(\".mp4\")) {\n return \"video/mp4\";\n }\n if (source.includes(\".m3u8\")) {\n return \"application/vnd.apple.mpegurl\";\n }\n return \"video/x-flv\"; // Default return\n};\n\nexport const getSourceObject = ({\n source,\n}: {\n source: string;\n}): {\n src: string;\n type: string;\n withCredentials: boolean;\n} => {\n const mediaType = getMediaTypeFromSource(source);\n\n return {\n src: source,\n type: mediaType,\n withCredentials: false, // Set to false as per the original comment about CORS issues\n };\n};\n\nexport const formatTime = (seconds = 0): string => {\n const ss = seconds < 0 ? 0 : seconds;\n let s: number | string = Math.floor(ss % 60);\n let m: number | string = Math.floor((ss / 60) % 60);\n let h: number | string = Math.floor(ss / 3600);\n\n if (isNaN(ss) || ss === Infinity) {\n s = \"-\";\n m = \"-\";\n h = \"-\";\n }\n\n h = Number(h) > 0 ? `${h}:` : \"\";\n m = `${Number(m) < 10 ? `0${m}` : m}:`;\n s = Number(s) < 10 ? `0${s}` : s;\n\n return h + m + s;\n};\n\nexport const findHLSPlaylist = (video?: VideoData) => {\n return video?.playlists?.find((playlist) => {\n return playlist.format === 'HLS' || \n playlist.format === 'hls' || \n playlist.format === 'PLAYLIST_FORMAT_HLS';\n });\n};\n\nexport const getErrorType = (error?: string | Error, video?: VideoData) => {\n if (video?.error && errorTypes[video.error]) {\n return video.error;\n }\n return 'DEFAULT_ERROR';\n};\n\n/**\n * Checks if we're running in a browser environment (not SSR)\n * @returns true if browser APIs are available, false if in SSR environment\n */\nexport const isBrowser = (): boolean => {\n return typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';\n};\n\n/**\n * Safely get user agent string (returns empty string in SSR)\n */\nexport const getUserAgent = (): string => {\n if (!isBrowser()) return '';\n \n try {\n return navigator.userAgent;\n } catch (error) {\n return '';\n }\n};\n\n/**\n * Safely check if device is mobile (returns false in SSR)\n */\nexport const isMobileDevice = (): boolean => {\n if (!isBrowser()) return false;\n \n try {\n return window.innerWidth <= 767 || /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\n } catch (error) {\n return false;\n }\n};\n","import { useState, useEffect } from 'react';\n\n// Import JSON files as modules\nimport en from './en.json';\nimport es from './es.json';\nimport ar from './ar.json';\nimport de from './de.json';\nimport fr from './fr.json';\nimport it from './it.json';\nimport ja from './ja.json';\nimport ko from './ko.json';\nimport pt from './pt.json';\nimport ru from './ru.json';\nimport zh from './zh.json';\nimport nl from './nl.json';\nimport fa from './fa.json';\n\n// Define the available languages\nconst availableLanguages = {\n en,\n es,\n ar,\n de,\n fr,\n it,\n ja,\n ko,\n pt,\n ru,\n zh,\n nl,\n fa\n};\n\ntype Language = keyof typeof availableLanguages;\n\n// Base translations type - this represents all possible keys that can exist\nexport type Translations = {\n \"DAYS\": string\n \"HOURS\": string\n \"MINUTES\": string\n \"SECONDS\": string\n \"STARTING_SOON\": string\n \"EVENT_NOT_STARTED\": string\n \"DEFAULT_ERROR\": string\n \"DEFAULT_ERROR_DESCRIPTION\": string\n \"API_ERROR\": string\n \"API_ERROR_DESCRIPTION\": string\n \"ERROR_CODE_NOT_AUTHENTICATED\": string\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": string\n \"ERROR_CODE_GEO_BLOCKED\": string\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": string\n \"ERROR_CODE_NOT_ENTITLED\": string\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": string\n \"ERROR_CODE_VPN_BLOCKED\": string\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": string\n}\n\n// Partial translations type for individual language files (allows missing keys)\ntype PartialTranslations = Partial<Translations>;\n\n// Function to get the browser's language setting\nconst getBrowserLanguage = (): Language => {\n // Check if we're in a browser environment\n if (typeof window === 'undefined' || typeof navigator === 'undefined') {\n return 'en'; // Default to English on server-side\n }\n \n try {\n const language = navigator.language.split('-')[0] as Language;\n return availableLanguages[language] ? language : 'en';\n } catch (error) {\n // Fallback to English if navigator access fails\n return 'en';\n }\n};\n\nconst useMessages = (locale: string) => {\n const [language, setLanguage] = useState<Language>('en');\n const [translations, setTranslations] = useState<PartialTranslations>(availableLanguages.en);\n\n useEffect(() => {\n const lang = !!availableLanguages?.[locale as Language] ? locale as Language : getBrowserLanguage();\n setLanguage(lang);\n setTranslations(availableLanguages[lang] as PartialTranslations);\n }, [locale]);\n\n // Translation function with English fallback\n const t = (key: keyof Translations): string => {\n // Try current language first\n if (translations[key]) {\n return translations[key];\n }\n \n // Fallback to English if key not found in current language\n if (language !== 'en' && availableLanguages.en[key]) {\n return availableLanguages.en[key];\n }\n \n // Return empty string if not found in either current language or English\n return '';\n };\n\n // Function to change the language manually\n const changeLanguage = (lng: Language) => {\n if (availableLanguages[lng]) {\n setLanguage(lng);\n setTranslations(availableLanguages[lng] as PartialTranslations);\n }\n };\n\n return { t, language, changeLanguage };\n};\n\nexport default useMessages;\n","{\n \"DAYS\": \"days\",\n \"HOURS\": \"hours\",\n \"MINUTES\": \"min\",\n \"SECONDS\": \"sec\",\n \"STARTING_SOON\": \"Starting soon...\",\n \"EVENT_NOT_STARTED\": \"This event has not started...\",\n \"DEFAULT_ERROR\": \"Playback Error\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"Unable to play the video. Please try again later.\",\n \"API_ERROR\": \"Failed to Retrieve Video Info\",\n \"API_ERROR_DESCRIPTION\": \"Error fetching video details. Check your videoId and internet connection and try again.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Authorisation\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"You don't have permission to play this video.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Geoblocking Restriction\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Sorry, this video is not available in your region due to geoblocking restrictions.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"Not entitled\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Sorry, you are not entitled to play this video.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN BLOCKED\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"This video is not available due to the use of a VPN.\"\n}\n","{\n \"DAYS\": \"días\",\n \"HOURS\": \"horas\",\n \"MINUTES\": \"min\",\n \"SECONDS\": \"seg\",\n \"STARTING_SOON\": \"En instantes...\",\n \"EVENT_NOT_STARTED\": \"Este evento aún no ha comenzado...\",\n \"DEFAULT_ERROR\": \"Error de reproducción\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"No se puede reproducir el video. Por favor, inténtelo de nuevo más tarde.\",\n \"API_ERROR\": \"Error al recuperar información del video\",\n \"API_ERROR_DESCRIPTION\": \"Error al obtener detalles del video. Verifique su videoId y conexión a internet e inténtelo de nuevo.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Autorización\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"No tienes permiso para reproducir este video.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Restricción geográfica\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Lo siento, este video no está disponible en tu región debido a restricciones geográficas.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"No autorizado\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Lo siento, no estás autorizado para reproducir este video.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN BLOQUEADO\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"Este video no está disponible debido al uso de una VPN.\"\n}\n ","{\n \"DAYS\": \"أيام\",\n \"HOURS\": \"ساعات\",\n \"MINUTES\": \"دقائق\",\n \"SECONDS\": \"ثواني\",\n \"STARTING_SOON\": \"يبدأ قريبا...\",\n \"EVENT_NOT_STARTED\": \"هذا الحدث لم يبدأ بعد...\",\n \"DEFAULT_ERROR\": \"خطأ في التشغيل\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"غير قادر على تشغيل الفيديو. يرجى المحاولة مرة أخرى لاحقًا.\",\n \"API_ERROR\": \"فشل في استرجاع معلومات الفيديو\",\n \"API_ERROR_DESCRIPTION\": \"خطأ في جلب تفاصيل الفيديو. تحقق من معرف الفيديو واتصال الإنترنت وحاول مرة أخرى.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"تفويض\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"ليس لديك إذن لتشغيل هذا الفيديو.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"قيود الجغرافيا\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"عذرًا، هذا الفيديو غير متاح في منطقتك بسبب قيود الجغرافيا.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"غير مخول\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"عذرًا، ليس لديك الحق في تشغيل هذا الفيديو.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"تم حظر VPN\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"هذا الفيديو غير متاح بسبب استخدام VPN.\"\n}","{\n \"DAYS\": \"Tage\",\n \"HOURS\": \"Stunden\",\n \"MINUTES\": \"Min\",\n \"SECONDS\": \"Sek\",\n \"STARTING_SOON\": \"Beginnt bald...\",\n \"DEFAULT_ERROR\": \"Wiedergabefehler\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"Das Video kann nicht abgespielt werden. Bitte versuchen Sie es später erneut.\",\n \"API_ERROR\": \"Fehler beim Abrufen der Videoinformationen\",\n \"API_ERROR_DESCRIPTION\": \"Fehler beim Abrufen der Videodetails. Überprüfen Sie Ihre videoId und Internetverbindung und versuchen Sie es erneut.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Autorisierung\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"Sie haben keine Berechtigung, dieses Video abzuspielen.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Geoblocking-Beschränkung\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Entschuldigung, dieses Video ist in Ihrer Region aufgrund von Geoblocking-Beschränkungen nicht verfügbar.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"Nicht berechtigt\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Entschuldigung, Sie sind nicht berechtigt, dieses Video abzuspielen.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN BLOCKIERT\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"Dieses Video ist aufgrund der Verwendung eines VPN nicht verfügbar.\"\n}\n ","{\n \"DAYS\": \"jours\",\n \"HOURS\": \"heures\",\n \"MINUTES\": \"minutes\",\n \"SECONDS\": \"secondes\",\n \"STARTING_SOON\": \"Commence bientôt...\",\n \"EVENT_NOT_STARTED\": \"Cet événement n'a pas commencé...\",\n \"DEFAULT_ERROR\": \"Erreur de lecture\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"Impossible de lire la vidéo. Veuillez réessayer plus tard.\",\n \"API_ERROR\": \"Échec de la récupération des informations vidéo\",\n \"API_ERROR_DESCRIPTION\": \"Erreur lors de la récupération des détails de la vidéo. Vérifiez votre videoId et votre connexion Internet, puis réessayez.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Autorisation\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"Vous n'avez pas la permission de lire cette vidéo.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Restriction de géoblocage\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Désolé, cette vidéo n'est pas disponible dans votre région en raison de restrictions de géoblocage.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"Non autorisé\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Désolé, vous n'êtes pas autorisé à lire cette vidéo.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN BLOQUÉ\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"Cette vidéo n'est pas disponible en raison de l'utilisation d'un VPN.\"\n}","{\n \"DAYS\": \"giorni\",\n \"HOURS\": \"ore\",\n \"MINUTES\": \"minuti\",\n \"SECONDS\": \"secondi\",\n \"STARTING_SOON\": \"Inizia presto...\",\n \"DEFAULT_ERROR\": \"Errore di riproduzione\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"Impossibile riprodurre il video. Per favore riprova più tardi.\",\n \"API_ERROR\": \"Errore nel recupero delle informazioni video\",\n \"API_ERROR_DESCRIPTION\": \"Errore nel recupero dei dettagli del video. Controlla il tuo videoId e la connessione internet e riprova.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Autorizzazione\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"Non hai il permesso di riprodurre questo video.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Restrizione geoblocking\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Spiacenti, questo video non è disponibile nella tua regione a causa di restrizioni geografiche.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"Non autorizzato\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Spiacenti, non sei autorizzato a riprodurre questo video.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN BLOCCATA\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"Questo video non è disponibile a causa dell'uso di una VPN.\"\n}\n","{\n \"DAYS\": \"日\",\n \"HOURS\": \"時間\",\n \"MINUTES\": \"分\",\n \"SECONDS\": \"秒\",\n \"STARTING_SOON\": \"まもなく開始...\",\n \"DEFAULT_ERROR\": \"再生エラー\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"ビデオを再生できません。後でもう一度お試しください。\",\n \"API_ERROR\": \"ビデオ情報の取得に失敗しました\",\n \"API_ERROR_DESCRIPTION\": \"ビデオの詳細を取得中にエラーが発生しました。videoIdとインターネット接続を確認して、もう一度お試しください。\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"認証\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"このビデオを再生する権限がありません。\",\n \"ERROR_CODE_GEO_BLOCKED\": \"地域制限\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"申し訳ありませんが、地域制限のためこのビデオはご利用いただけません。\",\n \"ERROR_CODE_NOT_ENTITLED\": \"権利なし\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"申し訳ありませんが、このビデオを再生する権利がありません。\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPNブロック\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"VPNの使用により、このビデオはご利用いただけません。\"\n}","{\n \"DAYS\": \"일\",\n \"HOURS\": \"시간\",\n \"MINUTES\": \"분\",\n \"SECONDS\": \"초\",\n \"STARTING_SOON\": \"곧 시작...\",\n \"DEFAULT_ERROR\": \"재생 오류\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"비디오를 재생할 수 없습니다. 나중에 다시 시도해 주세요.\",\n \"API_ERROR\": \"비디오 정보 가져오기 실패\",\n \"API_ERROR_DESCRIPTION\": \"비디오 세부 정보를 가져오는 중 오류가 발생했습니다. videoId와 인터넷 연결을 확인하고 다시 시도해 주세요.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"인증\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"이 비디오를 재생할 권한이 없습니다.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"지역 제한\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"죄송합니다. 이 비디오는 지역 제한으로 인해 귀하의 지역에서 사용할 수 없습니다.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"권한 없음\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"죄송합니다. 이 비디오를 재생할 권한이 없습니다.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN 차단됨\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"VPN 사용으로 인해 이 비디오를 사용할 수 없습니다.\"\n}","{\n \"DAYS\": \"dias\",\n \"HOURS\": \"horas\",\n \"MINUTES\": \"minutos\",\n \"SECONDS\": \"segundos\",\n \"STARTING_SOON\": \"Começando em breve...\",\n \"DEFAULT_ERROR\": \"Playback Error\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"Não foi possível reproduzir o vídeo. Por favor, tente novamente mais tarde.\",\n \"API_ERROR\": \"Falha ao Recuperar Informações do Vídeo\",\n \"API_ERROR_DESCRIPTION\": \"Erro ao buscar detalhes do vídeo. Verifique seu videoId e conexão com a internet e tente novamente.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Autorização\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"Você não tem permissão para reproduzir este vídeo.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Restrição de Geoblocking\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Desculpe, este vídeo não está disponível em sua região devido a restrições de geoblocking.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"Não autorizado\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Desculpe, você não está autorizado a reproduzir este vídeo.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN BLOQUEADO\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"Este vídeo não está disponível devido ao uso de uma VPN.\"\n}","{\n \"DAYS\": \"дней\",\n \"HOURS\": \"часов\",\n \"MINUTES\": \"мин\",\n \"SECONDS\": \"сек\",\n \"STARTING_SOON\": \"Скоро начнется...\",\n \"DEFAULT_ERROR\": \"Ошибка воспроизведения\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"Не удалось воспроизвести видео. Пожалуйста, попробуйте позже.\",\n \"API_ERROR\": \"Не удалось получить информацию о видео\",\n \"API_ERROR_DESCRIPTION\": \"Ошибка при получении деталей видео. Проверьте ваш videoId и подключение к интернету, затем попробуйте снова.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Авторизация\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"У вас нет разрешения на воспроизведение этого видео.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Географическое ограничение\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Извините, это видео недоступно в вашем регионе из-за географических ограничений.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"Нет прав\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Извините, у вас нет прав на воспроизведение этого видео.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN заблокирован\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"Это видео недоступно из-за использования VPN.\"\n}","{\n \"DAYS\": \"天\",\n \"HOURS\": \"小时\",\n \"MINUTES\": \"分钟\",\n \"SECONDS\": \"秒\",\n \"STARTING_SOON\": \"即将开始...\",\n \"DEFAULT_ERROR\": \"播放错误\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"无法播放视频。请稍后再试。\",\n \"API_ERROR\": \"获取视频信息失败\",\n \"API_ERROR_DESCRIPTION\": \"获取视频详情时出错。请检查您的视频ID和互联网连接,然后重试。\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"授权\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"您没有权限播放此视频。\",\n \"ERROR_CODE_GEO_BLOCKED\": \"地理封锁限制\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"抱歉,由于地理封锁限制,此视频在您的地区不可用。\",\n \"ERROR_CODE_NOT_ENTITLED\": \"无权播放\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"抱歉,您无权播放此视频。\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN被封锁\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"由于使用VPN,此视频不可用。\"\n}\n ","{\n \"DAYS\": \"dagen\",\n \"HOURS\": \"uren\",\n \"MINUTES\": \"min\",\n \"SECONDS\": \"sec\",\n \"STARTING_SOON\": \"Begint binnenkort...\",\n \"EVENT_NOT_STARTED\": \"Dit evenement is nog niet begonnen...\",\n \"DEFAULT_ERROR\": \"Afspelfout\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"Kan de video niet afspelen. Probeer het later opnieuw.\",\n \"API_ERROR\": \"Kan videogegevens niet ophalen\",\n \"API_ERROR_DESCRIPTION\": \"Fout bij het ophalen van videogegevens. Controleer uw video-ID en internetverbinding en probeer het opnieuw.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"Autorisatie\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"U heeft geen toestemming om deze video af te spelen.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"Geoblocking Beperking\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"Sorry, deze video is niet beschikbaar in uw regio vanwege geoblocking beperkingen.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"Geen recht\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"Sorry, u heeft geen recht om deze video af te spelen.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"VPN GEBLOKKEERD\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"Deze video is niet beschikbaar vanwege het gebruik van een VPN.\"\n}\n","{\n \"DAYS\": \"روزها\",\n \"HOURS\": \"ساعتها\",\n \"MINUTES\": \"دقیقهها\",\n \"SECONDS\": \"ثانیهها\",\n \"STARTING_SOON\": \"به زودی شروع میشود...\",\n \"EVENT_NOT_STARTED\": \"این رویداد هنوز شروع نشده است...\",\n \"DEFAULT_ERROR\": \"خطای پخش\",\n \"DEFAULT_ERROR_DESCRIPTION\": \"امکان پخش ویدیو وجود ندارد. لطفاً بعداً دوباره تلاش کنید.\",\n \"API_ERROR\": \"خطا در بازیابی اطلاعات ویدیو\",\n \"API_ERROR_DESCRIPTION\": \"خطا در دریافت جزئیات ویدیو. ویدیوId و اتصال اینترنت خود را بررسی کرده و دوباره تلاش کنید.\",\n \"ERROR_CODE_NOT_AUTHENTICATED\": \"مجوز\",\n \"ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION\": \"شما اجازه پخش این ویدیو را ندارید.\",\n \"ERROR_CODE_GEO_BLOCKED\": \"محدودیت جغرافیایی\",\n \"ERROR_CODE_GEO_BLOCKED_DESCRIPTION\": \"متاسفیم، این ویدیو به دلیل محدودیتهای جغرافیایی در منطقه شما در دسترس نیست.\",\n \"ERROR_CODE_NOT_ENTITLED\": \"عدم دسترسی\",\n \"ERROR_CODE_NOT_ENTITLED_DESCRIPTION\": \"متاسفیم، شما اجازه پخش این ویدیو را ندارید.\",\n \"ERROR_CODE_VPN_BLOCKED\": \"مسدود شدن VPN\",\n \"ERROR_CODE_VPN_BLOCKED_DESCRIPTION\": \"این ویدیو به دلیل استفاده از VPN در دسترس نیست.\"\n}","import React, { CSSProperties, useCallback, useEffect, useState } from 'react';\nimport { twMerge } from 'tailwind-merge';\nimport { useQuery } from '@tanstack/react-query';\nimport { Player } from './Player';\nimport type { PlayerProps } from './types';\nimport { fetchEventData, type EventData, EventsSortDirection } from './api/event';\nimport { fetchVideosList, type VideoListItem } from './api/video';\nimport { Loading, ErrorScreen, Title } from './components';\nimport { errorTypes, findHLSPlaylist } from './helper';\nimport useMessages, { type Translations } from './messages/useMessages';\n\nexport interface EventProps extends Omit<PlayerProps, 'src'> {\n publicKey: string;\n eventId: string;\n hideTitle?: boolean;\n locale?: string;\n filter?: string;\n order?: EventsSortDirection;\n events?: {\n onEventData?: (event: EventData) => void;\n onVideoData?: (video: VideoListItem) => void;\n onEmptyPlaylists?: () => void;\n onError?: (error: Error) => void;\n onPlay?: () => void;\n onPause?: () => void;\n onEnded?: () => void;\n onLoadStart?: () => void;\n onCanPlay?: () => void;\n onPlayerReady?: () => void;\n };\n className?: string;\n settings?: {\n backgroundImageUrl?: string;\n showCountdownAnimation?: boolean;\n };\n auth?: {\n mottoToken?: string;\n userId?: string;\n };\n // TanStack Query options\n queryOptions?: {\n enabled?: boolean;\n staleTime?: number;\n cacheTime?: number;\n retry?: number;\n retryDelay?: number;\n };\n}\n\nexport const Event: React.FC<EventProps> = ({\n publicKey,\n eventId,\n events,\n hideTitle,\n locale = 'en',\n order,\n filter,\n className,\n settings,\n auth,\n queryOptions = {},\n ...props\n}) => {\n // Event data fetching\n const {\n data: eventData,\n isLoading: isEventLoading,\n error: eventError\n } = useQuery<EventData>({\n queryKey: ['event', publicKey, eventId, filter, order, locale],\n queryFn: () => fetchEventData(publicKey, eventId, undefined, filter, order, locale),\n enabled: !!publicKey && !!eventId,\n staleTime: queryOptions.staleTime ?? 5 * 60 * 1000, // 5 minutes\n gcTime: queryOptions.cacheTime ?? 10 * 60 * 1000, // 10 minutes\n retry: queryOptions.retry ?? 3,\n retryDelay: queryOptions.retryDelay ?? ((attemptIndex: number) => Math.min(1000 * 2 ** attemptIndex, 30000))\n });\n\n const [activePlaylist, setActivePlaylist] = useState<string | null>();\n const [activeVideoId, setActiveVideoId] = useState<string | null>();\n const videoIds = eventData?.videoIds ?? [];\n\n // Videos list fetching\n const {\n data: videosData,\n isLoading: videosIsLoading,\n error: videosError, \n } = useQuery<VideoListItem[]>({\n queryKey: ['videos-list', publicKey, videoIds, auth?.mottoToken],\n queryFn: () => fetchVideosList(publicKey, videoIds, auth?.mottoToken, 0, 0),\n enabled: !!publicKey && videoIds.length > 0,\n refetchInterval: activePlaylist === null ? 30000 : false,\n staleTime: queryOptions.staleTime ?? 5 * 60 * 1000,\n gcTime: queryOptions.cacheTime ?? 10 * 60 * 1000,\n retry: queryOptions.retry ?? 3,\n retryDelay: queryOptions.retryDelay ?? ((attemptIndex: number) => Math.min(1000 * 2 ** attemptIndex, 30000))\n });\n\n const [loadingApisState, setLoadingApisState] = useState(true);\n\n // Process videos data to find active playlist\n useEffect(() => {\n if (videosData !== undefined) {\n setLoadingApisState(false);\n\n const videosWithPlaylists = videosData.filter(\n (video) => video.playlists && video.playlists.length > 0\n );\n\n if (videosWithPlaylists.length > 0) {\n let hlsPlaylistFound = false;\n // Iterate to find the first HLS playlist\n for (const video of videosWithPlaylists) {\n const hlsPlaylist = findHLSPlaylist(video);\n if (hlsPlaylist?.url) {\n setActivePlaylist(hlsPlaylist.url);\n setActiveVideoId(video.id);\n hlsPlaylistFound = true;\n break;\n }\n }\n if (!hlsPlaylistFound) {\n setActivePlaylist(null);\n setActiveVideoId(null);\n }\n } else {\n setActivePlaylist(null);\n setActiveVideoId(null);\n }\n } else if (eventData && (!eventData.videoIds || eventData.videoIds.length === 0)) {\n setLoadingApisState(false);\n setActivePlaylist(null);\n setActiveVideoId(null);\n }\n }, [videosData, eventData]);\n \n const { t } = useMessages(locale);\n\n // Notify parent of event data\n useEffect(() => {\n if (events?.onEventData && eventData) {\n events.onEventData(eventData);\n }\n }, [eventData, events]);\n\n // Notify parent of video data\n useEffect(() => {\n if (events?.onVideoData && activeVideoId && videosData) {\n const activeVideo = videosData.find((video) => video.id === activeVideoId);\n if (activeVideo) {\n events.onVideoData(activeVideo);\n }\n }\n }, [activeVideoId, videosData, events]);\n\n // All state and hooks must be defined before any conditional returns\n const [error, setError] = useState<Error | null>(null);\n const [loadingPlaylist, setLoadingPlaylist] = useState(true);\n const videosDataError = videosData?.some((video) => !!video.error);\n\n // Error handling\n useEffect(() => {\n if (eventError || videosError || videosDataError) {\n const errorObj = eventError || videosError || \n (videosData?.find((video) => !!video.error)?.error && \n new Error(videosData?.find((video) => !!video.error)?.error)) || \n new Error('default');\n \n setError(errorObj);\n if (events?.onError) {\n events.onError(errorObj);\n }\n } else {\n setError(null);\n }\n }, [eventError, videosError, videosDataError, videosData, events]);\n \n // Loading state management\n useEffect(() => {\n const eventLoadedWithNoVideos =\n !isEventLoading &&\n eventData &&\n eventData.videoIds &&\n (!eventData.videoIds || eventData?.videoIds?.length === 0) &&\n !loadingApisState;\n\n const allApisLoadedWithPotentialVideos =\n !isEventLoading &&\n !videosIsLoading &&\n eventData &&\n !loadingApisState;\n\n if (eventLoadedWithNoVideos || allApisLoadedWithPotentialVideos) {\n setLoadingPlaylist(false);\n }\n }, [isEventLoading, videosIsLoading, eventData, loadingApisState]);\n\n // Error state\n if (error) {\n const title = t(error.message as keyof Translations)?.length ? \n t(error.message as keyof Translations) : t(\"DEFAULT_ERROR\"); \n const description = t(`${error.message}_DESCRIPTION` as keyof Translations)?.length ? \n t(`${error.message}_DESCRIPTION` as keyof Translations) : t(\"DEFAULT_ERROR_DESCRIPTION\");\n \n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <ErrorScreen\n title={title}\n description={description}\n />\n </div>\n </div>\n );\n }\n \n // Handle empty playlists\n if (!loadingPlaylist && eventData && !activePlaylist && events?.onEmptyPlaylists) {\n events.onEmptyPlaylists();\n }\n\n // Loading state\n if (loadingPlaylist) {\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full bg-[#151515]\">\n <Loading />\n </div>\n </div>\n );\n }\n\n // Active video player\n if (activePlaylist && activeVideoId && videosData) {\n const activeVideo = videosData.find((video) => video.id === activeVideoId);\n \n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <Player\n {...props}\n src={activePlaylist}\n className={twMerge(className, \"peer\")}\n events={events}\n containerClassName=\"w-full h-full\"\n />\n {!hideTitle && eventData && (\n <TitleAndDescription \n title={eventData.title} \n description={eventData.description || ''} \n startTime={eventData.startTime} \n locale={locale} \n />\n )}\n </div>\n </div>\n );\n }\n\n // Pre-event countdown\n if (eventData) {\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <PreEvent \n event={eventData} \n hideTitle={hideTitle} \n locale={locale} \n backgroundImageUrl={settings?.backgroundImageUrl} \n showAnimation={settings?.showCountdownAnimation} \n />\n </div>\n </div>\n );\n }\n\n return null;\n};\n\n// Pre-event countdown component\nfunction PreEvent({ \n event, \n locale = 'en', \n hideTitle, \n backgroundImageUrl, \n showAnimation = true \n}: { \n event: EventData; \n locale?: string; \n hideTitle?: boolean; \n backgroundImageUrl?: string; \n showAnimation?: boolean;\n}): JSX.Element {\n const date = new Date(event.startTime);\n const now = new Date();\n const [remainingTime, setRemainingTime] = useState(\n date.getTime() - now.getTime()\n );\n const shouldBeStarted = remainingTime < 0;\n const { t } = useMessages(locale);\n useEffect(() => {\n const interval = setInterval(() => {\n if (remainingTime < 0) {\n clearInterval(interval);\n } else {\n setRemainingTime(date.getTime() - new Date().getTime());\n }\n }, 1000);\n\n return () => clearInterval(interval);\n }, [date, remainingTime]);\n\n const renderCountdown = useCallback(() => {\n if (shouldBeStarted) {\n return <span className=\"text-base-content text-xl\">{t(\"EVENT_NOT_STARTED\")}</span>;\n }\n\n const seconds = Math.floor(remainingTime / 1000) % 60;\n const minutes = Math.floor(remainingTime / 1000 / 60) % 60;\n const hours = Math.floor(remainingTime / 1000 / 60 / 60) % 24;\n const days = Math.floor(remainingTime / 1000 / 60 / 60 / 24);\n\n return (\n <div className=\"grid grid-flow-col gap-5 text-center auto-cols-max\">\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": days } as CSSProperties} \n aria-live=\"polite\" \n aria-label={days.toString()}\n >\n {days?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"DAYS\")}</span>\n </div>\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": hours } as CSSProperties} \n aria-live=\"polite\" \n aria-label={hours.toString()}\n >\n {hours?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"HOURS\")}</span>\n </div>\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": minutes } as CSSProperties} \n aria-live=\"polite\" \n aria-label={minutes.toString()}\n >\n {minutes?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"MINUTES\")}</span>\n </div>\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": seconds } as CSSProperties} \n aria-live=\"polite\" \n aria-label={seconds.toString()}\n >\n {seconds?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"SECONDS\")}</span>\n </div>\n </div>\n );\n }, [remainingTime, shouldBeStarted, t]);\n\n console.log(\"event\", event);\n return (\n <>\n {event?.posterUrl ? (\n <>\n <div \n className=\"relative overflow-hidden bg-base-200 aspect-video text-base-content w-full h-full flex justify-center items-center flex-col bg-no-repeat bg-cover md:rounded-2xl\" \n style={{ \n backgroundImage: `url(${event.posterUrl})`, \n backgroundRepeat: 'no-repeat', \n backgroundSize: 'cover' \n }}\n >\n <div className=\"absolute inset-0 bg-base-200\"></div>\n <div className=\"relative z-10\">\n {renderCountdown()}\n </div>\n </div>\n {!hideTitle && (\n <TitleAndDescription \n title={event.title} \n description={event.description || ''} \n startTime={event.startTime} \n locale={locale} \n />\n )}\n </>\n ) : (\n <>\n <div \n className=\"relative overflow-hidden md:rounded-2xl bg-base-200 aspect-video text-base-content flex flex-col justify-center items-center w-full h-full bg-cover bg-center bg-no-repeat\" \n style={{\n backgroundImage: backgroundImageUrl ? `url(${backgroundImageUrl})` : '',\n }}\n >\n {/* {backgroundImageUrl && <div className=\"\"></div>} */}\n <div className=\"relative z-10\">\n {renderCountdown()}\n </div>\n </div>\n {!hideTitle && (\n <TitleAndDescription \n title={event.title} \n description={event.description || ''} \n startTime={event.startTime} \n locale={locale} \n />\n )}\n </>\n )}\n </>\n );\n}\n\n// Title and description component\nconst TitleAndDescription = ({ \n title, \n description, \n startTime, \n locale = 'en', \n className \n}: { \n title: string; \n description: string; \n startTime: string; \n locale?: string; \n className?: string;\n}) => {\n return (\n <div className={twMerge(\"mt-3 mb-6 m-event-details-ctn px-4 text-left w-full\", className)}>\n <div className=\"text-base md:text-xl m-event-title text-base-content font-medium\">{title}</div>\n {startTime ? (\n <div className=\"text-sm md:text-base text-base-content/70 m-event-start-time\">\n {new Date(startTime || \"\").toLocaleDateString(locale || \"default\", {\n month: \"long\",\n year: \"numeric\",\n day: \"numeric\",\n })}{\" \"}\n - {new Date(startTime || \"\").toLocaleTimeString(locale || \"default\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n })}\n </div>\n ) : null}\n {description && (\n <div className=\"text-xs md:text-sm text-base-content/60 uppercase\">{description}</div>\n )}\n </div>\n );\n}; ","import React, { CSSProperties, useEffect, useState } from 'react';\nimport { twMerge } from 'tailwind-merge';\nimport { useQuery } from '@tanstack/react-query';\nimport { Player } from './Player';\nimport type { PlayerProps } from './types';\nimport { fetchCreativeWorkData, type CreativeWorkData, CreativeWorksSortDirection } from './api/creative-work';\nimport { fetchVideosList, type VideoListItem } from './api/video';\nimport { Loading, ErrorScreen, Title } from './components';\nimport { errorTypes, findHLSPlaylist } from './helper';\nimport useMessages, { type Translations } from './messages/useMessages';\n\nexport interface CreativeWorkProps extends Omit<PlayerProps, 'src'> {\n publicKey: string;\n creativeWorkId: string;\n hideTitle?: boolean;\n locale?: string;\n filter?: string;\n order?: CreativeWorksSortDirection;\n events?: {\n onCreativeWorkData?: (creativeWork: CreativeWorkData) => void;\n onVideoData?: (video: VideoListItem) => void;\n onEmptyPlaylists?: () => void;\n onError?: (error: Error) => void;\n onPlay?: () => void;\n onPause?: () => void;\n onEnded?: () => void;\n onLoadStart?: () => void;\n onCanPlay?: () => void;\n onPlayerReady?: () => void;\n };\n className?: string;\n settings?: {\n backgroundImageUrl?: string;\n showCountdownAnimation?: boolean;\n };\n auth?: {\n mottoToken?: string;\n userId?: string;\n };\n // TanStack Query options\n queryOptions?: {\n enabled?: boolean;\n staleTime?: number;\n cacheTime?: number;\n retry?: number;\n retryDelay?: number;\n };\n}\n\nexport const CreativeWork: React.FC<CreativeWorkProps> = ({\n publicKey,\n creativeWorkId,\n events,\n hideTitle,\n locale = 'en',\n order,\n filter,\n className,\n settings,\n auth,\n queryOptions = {},\n ...props\n}) => {\n // CreativeWork data fetching\n const {\n data: creativeWorkData,\n isLoading: isCreativeWorkLoading,\n error: creativeWorkError\n } = useQuery<CreativeWorkData>({\n queryKey: ['creative-work', publicKey, creativeWorkId, filter, order, locale],\n queryFn: () => fetchCreativeWorkData(publicKey, creativeWorkId, undefined, filter, order, locale),\n enabled: !!publicKey && !!creativeWorkId,\n staleTime: queryOptions.staleTime ?? 5 * 60 * 1000, // 5 minutes\n gcTime: queryOptions.cacheTime ?? 10 * 60 * 1000, // 10 minutes\n retry: queryOptions.retry ?? 3,\n retryDelay: queryOptions.retryDelay ?? ((attemptIndex: number) => Math.min(1000 * 2 ** attemptIndex, 30000))\n });\n\n const [activePlaylist, setActivePlaylist] = useState<string | null>();\n const [activeVideoId, setActiveVideoId] = useState<string | null>();\n const [showCountDown, setShowCountDown] = useState(false);\n const videoIds = creativeWorkData?.videoIds ?? [];\n\n // Videos list fetching\n const {\n data: videosData,\n isLoading: videosIsLoading,\n error: videosError, \n } = useQuery<VideoListItem[]>({\n queryKey: ['videos-list', publicKey, videoIds, auth?.mottoToken],\n queryFn: () => fetchVideosList(publicKey, videoIds, auth?.mottoToken, 0, 0),\n enabled: !!publicKey && videoIds.length > 0,\n refetchInterval: activePlaylist === null ? 30000 : false,\n staleTime: queryOptions.staleTime ?? 5 * 60 * 1000,\n gcTime: queryOptions.cacheTime ?? 10 * 60 * 1000,\n retry: queryOptions.retry ?? 3,\n retryDelay: queryOptions.retryDelay ?? ((attemptIndex: number) => Math.min(1000 * 2 ** attemptIndex, 30000))\n });\n\n const [loadingApisState, setLoadingApisState] = useState(true);\n\n // Process videos data to find active playlist\n useEffect(() => {\n if (videosData !== undefined) {\n setLoadingApisState(false);\n\n const videosWithPlaylists = videosData.filter(\n (video) => video.playlists && video.playlists.length > 0\n );\n\n if (videosWithPlaylists.length > 0) {\n let hlsPlaylistFound = false;\n // Iterate to find the first HLS playlist\n for (const video of videosWithPlaylists) {\n const hlsPlaylist = findHLSPlaylist(video);\n if (hlsPlaylist?.url) {\n setActivePlaylist(hlsPlaylist.url);\n setActiveVideoId(video.id);\n hlsPlaylistFound = true;\n break;\n }\n }\n if (!hlsPlaylistFound) {\n setActivePlaylist(null);\n setActiveVideoId(null);\n }\n } else {\n setActivePlaylist(null);\n setActiveVideoId(null);\n }\n } else if (creativeWorkData && (!creativeWorkData.videoIds || creativeWorkData.videoIds.length === 0)) {\n setLoadingApisState(false);\n setActivePlaylist(null);\n setActiveVideoId(null);\n }\n }, [videosData, creativeWorkData]);\n \n const { t } = useMessages(locale);\n\n // Notify parent of creative work data\n useEffect(() => {\n if (events?.onCreativeWorkData && creativeWorkData) {\n events.onCreativeWorkData(creativeWorkData);\n }\n if (creativeWorkData && !creativeWorkData?.videoIds?.length) {\n setShowCountDown(true);\n }\n }, [creativeWorkData, events]);\n\n // Notify parent of video data\n useEffect(() => {\n if (events?.onVideoData && activeVideoId && videosData) {\n const activeVideo = videosData.find((video) => video.id === activeVideoId);\n if (activeVideo) {\n events.onVideoData(activeVideo);\n }\n }\n }, [activeVideoId, videosData, events]);\n\n const [error, setError] = useState<Error | null>(null);\n const videosDataError = videosData?.some((video) => !!video.error);\n\n // Error handling\n useEffect(() => {\n if (creativeWorkError || videosError || videosDataError) {\n const errorObj = creativeWorkError || videosError || \n (videosData?.find((video) => !!video.error)?.error && \n new Error(videosData?.find((video) => !!video.error)?.error)) || \n new Error('default');\n \n setError(errorObj);\n if (events?.onError) {\n events.onError(errorObj);\n }\n } else {\n setError(null);\n }\n }, [creativeWorkError, videosError, videosDataError, videosData, events]);\n\n // Error state\n if (error) {\n const title = t(error.message as keyof Translations)?.length ? \n t(error.message as keyof Translations) : t(\"DEFAULT_ERROR\"); \n const description = t(`${error.message}_DESCRIPTION` as keyof Translations)?.length ? \n t(`${error.message}_DESCRIPTION` as keyof Translations) : t(\"DEFAULT_ERROR_DESCRIPTION\");\n \n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <ErrorScreen\n title={title}\n description={description}\n />\n </div>\n </div>\n );\n }\n\n const [loadingPlaylist, setLoadingPlaylist] = useState(true);\n \n // Loading state management\n useEffect(() => {\n const creativeWorkLoadedWithNoVideos =\n !isCreativeWorkLoading &&\n creativeWorkData &&\n creativeWorkData.videoIds &&\n creativeWorkData.videoIds.length === 0;\n\n const creativeWorkLoadedWithNoData =\n !isCreativeWorkLoading && creativeWorkData && !creativeWorkData.videoIds;\n\n const isEventsFinished =\n !videosIsLoading &&\n videosData &&\n videosData.length > 0 &&\n videosData.every((video) => video.playlists && video.playlists.length === 0);\n\n if (\n creativeWorkLoadedWithNoVideos ||\n creativeWorkLoadedWithNoData ||\n isEventsFinished\n ) {\n setLoadingPlaylist(false);\n if (events?.onEmptyPlaylists) {\n events.onEmptyPlaylists();\n }\n } else if (activePlaylist) {\n setLoadingPlaylist(false);\n }\n }, [\n isCreativeWorkLoading,\n creativeWorkData,\n videosIsLoading,\n videosData,\n activePlaylist,\n events,\n ]);\n\n // Loading state\n if (isCreativeWorkLoading || videosIsLoading || loadingApisState) {\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <Loading />\n </div>\n </div>\n );\n }\n\n // Show countdown if creative work hasn't started yet\n if (showCountDown && creativeWorkData) {\n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full bg-base-200 text-base-content flex justify-center items-center flex-col\">\n <PreCreativeWork \n creativeWork={creativeWorkData} \n locale={locale} \n hideTitle={hideTitle}\n backgroundImageUrl={settings?.backgroundImageUrl} \n showAnimation={settings?.showCountdownAnimation} \n />\n </div>\n </div>\n );\n }\n\n // Show player if we have an active playlist\n if (activeVideoId && activePlaylist && !loadingPlaylist) {\n const activeVideo = videosData?.find((video) => video.id === activeVideoId);\n \n return (\n <div className={twMerge(\"md:rounded-2xl overflow-hidden aspect-video\", className)}>\n <div className=\"relative w-full h-full\">\n <Player\n {...props}\n className={twMerge(className, \"peer\")}\n events={{\n ...events,\n }}\n src={activePlaylist}\n containerClassName=\"w-full h-full\"\n />\n {!hideTitle && (\n <TitleAndDescription\n title={creativeWorkData?.title || ''}\n description={creativeWorkData?.description || ''}\n releaseTime={creativeWorkData?.releaseTime || ''}\n locale={locale}\n className=\"mt-3 mb-6 m-event-details-ctn px-4\"\n />\n )}\n </div>\n </div>\n );\n }\n\n // Loading state for playlist\n if (loadingPlaylist) {\n return <Loading />;\n }\n\n // Empty state\n return null;\n};\n\nfunction PreCreativeWork({ \n creativeWork, \n locale = 'en', \n hideTitle, \n backgroundImageUrl, \n showAnimation = true \n}: { \n creativeWork: CreativeWorkData; \n locale?: string; \n hideTitle?: boolean; \n backgroundImageUrl?: string; \n showAnimation?: boolean;\n}): JSX.Element {\n const date = new Date(creativeWork.releaseTime);\n const now = new Date();\n const [remainingTime, setRemainingTime] = useState(\n date.getTime() - now.getTime()\n );\n const shouldBeStarted = remainingTime < 0;\n const { t } = useMessages(locale);\n\n useEffect(() => {\n const interval = setInterval(() => {\n if (remainingTime < 0) {\n clearInterval(interval);\n } else {\n setRemainingTime(date.getTime() - new Date().getTime());\n }\n }, 1000);\n\n return () => { clearInterval(interval); };\n }, [date, remainingTime]);\n\n const renderCountdown = () => {\n if (shouldBeStarted) {\n return <span className=\"text-base-content text-xl\">{t(\"EVENT_NOT_STARTED\")}</span>;\n }\n\n const seconds = Math.floor(remainingTime / 1000) % 60;\n const minutes = Math.floor(remainingTime / 1000 / 60) % 60;\n const hours = Math.floor(remainingTime / 1000 / 60 / 60) % 24;\n const days = Math.floor(remainingTime / 1000 / 60 / 60 / 24);\n\n return (\n <div className=\"grid grid-flow-col gap-5 text-center auto-cols-max\">\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": days } as CSSProperties} \n aria-live=\"polite\" \n aria-label={days.toString()}\n >\n {days?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"DAYS\")}</span>\n </div>\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": hours } as CSSProperties} \n aria-live=\"polite\" \n aria-label={hours.toString()}\n >\n {hours?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"HOURS\")}</span>\n </div>\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": minutes } as CSSProperties} \n aria-live=\"polite\" \n aria-label={minutes.toString()}\n >\n {minutes?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"MINUTES\")}</span>\n </div>\n <div className=\"flex flex-col p-2 bg-neutral rounded-box text-neutral-content\">\n <span className=\"countdown font-mono text-5xl\">\n <span \n style={{ \"--value\": seconds } as CSSProperties} \n aria-live=\"polite\" \n aria-label={seconds.toString()}\n >\n {seconds?.toString()?.padStart(2, '0')}\n </span>\n </span>\n <span className=\"text-sm uppercase tracking-widest mt-1\">{t(\"SECONDS\")}</span>\n </div>\n </div>\n );\n };\n\n return (\n <>\n <div \n className=\"relative overflow-hidden md:rounded-2xl bg-base-200 aspect-video text-base-content flex flex-col justify-center items-center w-full h-full bg-cover bg-center bg-no-repeat\" \n style={{\n backgroundImage: backgroundImageUrl ? `url(${backgroundImageUrl})` : '',\n }}\n >\n {backgroundImageUrl && <div className=\"absolute inset-0 bg-black bg-opacity-40\"></div>}\n <div className=\"relative z-10\">\n {renderCountdown()}\n </div>\n </div>\n {!hideTitle && (\n <TitleAndDescription\n title={creativeWork.title}\n description={creativeWork.description || ''}\n releaseTime={creativeWork.releaseTime}\n locale={locale}\n />\n )}\n </>\n );\n}\n\nconst TitleAndDescription = ({ \n title, \n description, \n releaseTime, \n locale = 'en', \n className \n}: { \n title: string; \n description: string; \n releaseTime: string; \n locale?: string; \n className?: string;\n}) => {\n return (\n <div className={twMerge(\"mt-3 mb-6 m-event-details-ctn px-4 text-left w-full\", className)}>\n <div className=\"text-base md:text-xl m-event-title text-base-content font-medium\">{title}</div>\n {releaseTime ? (\n <div className=\"text-sm md:text-base text-base-content/70 m-event-start-time\">\n {new Date(releaseTime || \"\").toLocaleDateString(locale || \"default\", {\n month: \"long\",\n year: \"numeric\",\n day: \"numeric\",\n })}{\" \"}\n - {new Date(releaseTime || \"\").toLocaleTimeString(locale || \"default\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n })}\n </div>\n ) : null}\n {description && (\n <div className=\"text-xs md:text-sm text-base-content/60 uppercase\">{description}</div>\n )}\n </div>\n );\n}; ","import React from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\n\n// Create a client\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 5 * 60 * 1000, // 5 minutes\n gcTime: 10 * 60 * 1000, // 10 minutes\n retry: 3,\n refetchOnWindowFocus: false,\n },\n },\n});\n\ninterface QueryProviderProps {\n children: React.ReactNode;\n}\n\nexport const QueryProvider: React.FC<QueryProviderProps> = ({ children }) => {\n return (\n <QueryClientProvider client={queryClient}>\n {children}\n </QueryClientProvider>\n );\n};\n\nexport { queryClient }; ","import './index.css';\nimport { Player } from './Player';\n\nexport { Player } from './Player';\nexport { Video } from './Video';\nexport { Event } from './Event';\nexport { CreativeWork } from './CreativeWork';\nexport { QueryProvider } from './QueryProvider';\n\n// For Next.js users who want to use dynamic imports\n// Usage: const MottoPlayer = dynamic(() => import('@motto/video-player'), { ssr: false });\nexport default { Player };\n\nexport * from './types';\nexport * from './api';\nexport type { VideoProps } from './Video';\nexport type { EventProps } from './Event';\nexport type { CreativeWorkProps } from './CreativeWork';\nexport type { VideoData, VideoListItem } from './api/video';\nexport type { EventData, EventsSortDirection } from './api/event';\nexport type { CreativeWorkData } from './api/creative-work'; "],"mappings":";;;AACyB,SAAR,YAA6B,KAAK,EAAE,SAAS,IAAI,CAAC,GAAG;AAC1D,MAAI,CAAC,OAAO,OAAO,aAAa,YAAa;AAE7C,QAAM,OAAO,SAAS,QAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC;AACrE,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,OAAO;AAEb,MAAI,aAAa,OAAO;AACtB,QAAI,KAAK,YAAY;AACnB,WAAK,aAAa,OAAO,KAAK,UAAU;AAAA,IAC1C,OAAO;AACL,WAAK,YAAY,KAAK;AAAA,IACxB;AAAA,EACF,OAAO;AACL,SAAK,YAAY,KAAK;AAAA,EACxB;AAEA,MAAI,MAAM,YAAY;AACpB,UAAM,WAAW,UAAU;AAAA,EAC7B,OAAO;AACL,UAAM,YAAY,SAAS,eAAe,GAAG,CAAC;AAAA,EAChD;AACF;;;ACvB8B,YAAY,gu/BAAo3/B;;;ACAx6/B,SAAgB,YAAY,aAAAA,YAAW,UAAAC,SAAQ,2BAA2B;;;ACA1E,SAAS,QAAQ,mBAAmB;AAe7B,IAAM,iBAAi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M,IAAM,gBAA8C,CAAC,EAAE,SAAS,MAAM;AAC3E,SACE,gBAAAA,KAAC,uBAAoB,QAAQ,aAC1B,UACH;AAEJ;;;ACdA,IAAO,gBAAQ,EAAE,OAAO;","names":["useEffect","useRef","useCallback","useCallback","useCallback","useRef","useCallback","useRef","useRef","useCallback","useCallback","useRef","useEffect","useState","useEffect","useRef","useEffect","useState","jsx","jsxs","jsx","jsx","jsxs","twMerge","jsx","jsxs","useRef","isLive","shaka","useEffect","useEffect","twMerge","EventsSortDirection","CreativeWorksSortDirection","useState","useEffect","useState","useEffect","jsx","jsxs","useEffect","twMerge","useCallback","useEffect","useState","twMerge","useQuery","jsx","jsxs","useQuery","useState","useEffect","twMerge","useCallback","useEffect","useState","twMerge","useQuery","Fragment","jsx","jsxs","useQuery","useState","useEffect","twMerge","TitleAndDescription","jsx"]}
|