eb-player 2.0.4 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,73 +1,58 @@
1
- var EBPlayerBundle=function(e){"use strict";function t(e,t){void 0===t&&(t={});var s=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===s&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}t(".eb-player{box-sizing:border-box;color:var(--eb-color-text,#fff);font-family:var(--eb-font-family,Arial,sans-serif);font-size:var(--eb-font-size-base,14px);overflow:hidden;position:relative}.eb-player *,.eb-player :after,.eb-player :before{box-sizing:inherit}.eb-player__container{background-color:var(--eb-color-background,rgba(0,0,0,.8));height:100%;position:relative;width:100%}.eb-player__video{display:block;height:100%;object-fit:contain;width:100%}");t('@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap");.eb-player[data-theme=modern] .eb-icon{fill:currentColor;stroke:none;stroke-width:0}.eb-player[data-theme=modern]{--eb-color-primary:#7c3aed;--eb-color-progress:#7c3aed;--eb-color-background:rgba(10,10,20,.85);--eb-accent:#1a73e8;--eb-font-family:"Inter",sans-serif;border-radius:14px;box-shadow:0 40px 80px rgba(0,0,0,.8),0 0 0 1px hsla(0,0%,100%,.06);font-family:Inter,sans-serif}.eb-player[data-theme=modern] .eb-top-bar{background:linear-gradient(180deg,rgba(0,0,0,.72),transparent);gap:6px;height:110px;padding:14px 16px}.eb-player[data-theme=modern] .eb-bottom-bar__gradient{background:linear-gradient(0deg,rgba(0,0,0,.9),transparent);height:150px}.eb-player[data-theme=modern].eb-controls-visible .eb-top-bar{opacity:1;transform:translateY(0);transition:opacity .3s,transform .3s}.eb-player[data-theme=modern].eb-controls-hidden .eb-top-bar{opacity:0;transform:translateY(-6px);transition:opacity .3s,transform .3s}.eb-player[data-theme=modern] .eb-top-bar__actions{gap:6px}.eb-player[data-theme=modern] .eb-bottom-bar__controls-row{gap:8px;padding:0 14px 12px}.eb-player[data-theme=modern].eb-controls-visible .eb-bottom-bar{opacity:1;transform:translateY(0);transition:opacity .3s,transform .3s}.eb-player[data-theme=modern].eb-controls-hidden .eb-bottom-bar{opacity:0;transform:translateY(8px);transition:opacity .3s,transform .3s}.eb-player[data-theme=modern] .eb-middle-bar{gap:28px}.eb-player[data-theme=modern].eb-controls-visible .eb-middle-bar{opacity:1;transition:opacity .3s}.eb-player[data-theme=modern].eb-controls-hidden .eb-middle-bar{opacity:0;transition:opacity .3s}.eb-player[data-theme=modern] .eb-middle-bar__play-btn{backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);background:hsla(0,0%,100%,.18);border:2px solid hsla(0,0%,100%,.28);height:72px;transition:background .15s;width:72px}.eb-player[data-theme=modern] .eb-middle-bar__play-btn:hover{background:hsla(0,0%,100%,.28)}.eb-player[data-theme=modern] .eb-middle-bar__play-btn .eb-icon{height:30px;width:30px}.eb-player[data-theme=modern] .eb-middle-bar__seek-btn{align-items:center;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);background:hsla(0,0%,100%,.14);border:1.5px solid hsla(0,0%,100%,.22);border-radius:50%;flex-direction:column;gap:1px;height:52px;justify-content:center;padding:0;transition:background .15s;width:52px}.eb-player[data-theme=modern] .eb-middle-bar__seek-btn:hover{background:hsla(0,0%,100%,.24)}.eb-player[data-theme=modern] .eb-seek-circle{fill:#fff;stroke:none;height:18px;width:18px}.eb-player[data-theme=modern] .eb-seek-label{color:hsla(0,0%,100%,.9);font-size:.58em;font-weight:700;line-height:1}.eb-player[data-theme=modern] .eb-button,.eb-player[data-theme=modern] .eb-cast,.eb-player[data-theme=modern] .eb-fullscreen,.eb-player[data-theme=modern] .eb-live-sync,.eb-player[data-theme=modern] .eb-pip,.eb-player[data-theme=modern] .eb-play-pause,.eb-player[data-theme=modern] .eb-volume-mute{border-radius:8px;color:hsla(0,0%,100%,.82);flex-shrink:0;height:38px;transition:background .15s,color .15s,transform .1s;width:38px}.eb-player[data-theme=modern] .eb-button:hover,.eb-player[data-theme=modern] .eb-cast:hover,.eb-player[data-theme=modern] .eb-fullscreen:hover,.eb-player[data-theme=modern] .eb-live-sync:hover,.eb-player[data-theme=modern] .eb-pip:hover,.eb-player[data-theme=modern] .eb-play-pause:hover,.eb-player[data-theme=modern] .eb-volume-mute:hover{background:hsla(0,0%,100%,.12);color:#fff}.eb-player[data-theme=modern] .eb-button:active,.eb-player[data-theme=modern] .eb-cast:active,.eb-player[data-theme=modern] .eb-fullscreen:active,.eb-player[data-theme=modern] .eb-live-sync:active,.eb-player[data-theme=modern] .eb-pip:active,.eb-player[data-theme=modern] .eb-play-pause:active,.eb-player[data-theme=modern] .eb-volume-mute:active{transform:scale(.88)}.eb-player[data-theme=modern] .eb-seekbar-track{background:hsla(0,0%,100%,.22);border-radius:3px;height:3px;transition:height .15s}.eb-player[data-theme=modern] .eb-seekbar:hover .eb-seekbar-track{height:5px}.eb-player[data-theme=modern] .eb-seekbar-buffered{background:hsla(0,0%,100%,.28);border-radius:3px;transition:height .15s}.eb-player[data-theme=modern] .eb-seekbar-progress{background:linear-gradient(90deg,#a78bfa,#7c3aed);border-radius:3px;transition:height .15s}.eb-player[data-theme=modern] .eb-seekbar-thumb{background:#fff;box-shadow:0 0 0 3px rgba(124,58,237,.45);height:14px;right:-7px;width:14px}.eb-player[data-theme=modern] .eb-seekbar-tooltip{background:rgba(0,0,0,.82);border-radius:5px;bottom:24px;font-size:11px;padding:3px 7px}.eb-player[data-theme=modern] .eb-seekbar-preview{background:#111;border:2px solid hsla(0,0%,100%,.16);border-radius:6px;height:72px;width:128px}.eb-player[data-theme=modern] .eb-chapter-marker{background:rgba(0,0,0,.45);border-radius:1px;height:7px;top:50%;transform:translate(-50%,-50%);width:2px}.eb-player[data-theme=modern] .eb-volume-control{flex-direction:row;gap:0;margin-right:0}.eb-player[data-theme=modern] .eb-volume-track{background:hsla(0,0%,100%,.22);border-radius:3px;height:3px;margin:0;overflow:hidden;transition:width .25s ease,margin .25s ease;width:0}.eb-player[data-theme=modern] .eb-volume-control:focus-within .eb-volume-track,.eb-player[data-theme=modern] .eb-volume-control:hover .eb-volume-track{margin:0 6px 0 2px;width:66px}.eb-player[data-theme=modern] .eb-volume-fill{background:#fff}.eb-player[data-theme=modern] .eb-volume-thumb{background:#fff;box-shadow:0 0 0 2px hsla(0,0%,100%,.35);height:11px;transform:translate(-50%,-50%) scale(0);transition:transform .15s;width:11px}.eb-player[data-theme=modern] .eb-volume-control:hover .eb-volume-thumb{transform:translate(-50%,-50%) scale(1)}.eb-player[data-theme=modern] .eb-time-display{color:hsla(0,0%,100%,.6);font-size:12px;letter-spacing:.02em}.eb-player[data-theme=modern] .eb-live-sync{border-radius:6px;font-size:11px;font-weight:700;height:auto;letter-spacing:.08em;padding:4px 10px;text-transform:uppercase;width:auto}.eb-player[data-theme=modern] .eb-live-synced{background:rgba(220,38,38,.9);box-shadow:0 2px 8px rgba(220,38,38,.4);color:#fff}.eb-player[data-theme=modern] .eb-settings-panel{backdrop-filter:blur(18px) saturate(160%);-webkit-backdrop-filter:blur(18px) saturate(160%);background:rgba(10,10,20,.55);border-radius:12px;box-shadow:0 16px 48px rgba(0,0,0,.6),0 0 0 1px hsla(0,0%,100%,.1);min-width:280px}.eb-player[data-theme=modern] .eb-settings-menu{padding:0}.eb-player[data-theme=modern] .eb-settings-back,.eb-player[data-theme=modern] .eb-settings-category,.eb-player[data-theme=modern] .eb-settings-item{border-bottom:1px solid hsla(0,0%,100%,.06);color:hsla(0,0%,100%,.9);font-size:13px;padding:15px 20px;transition:background .12s}.eb-player[data-theme=modern] .eb-settings-category:last-child,.eb-player[data-theme=modern] .eb-settings-item:last-child{border-bottom:none}.eb-player[data-theme=modern] .eb-settings-back:hover,.eb-player[data-theme=modern] .eb-settings-category:hover,.eb-player[data-theme=modern] .eb-settings-item:hover{background:hsla(0,0%,100%,.05)}.eb-player[data-theme=modern] .eb-settings-item--selected{color:#fff;font-weight:500}.eb-player[data-theme=modern] .eb-settings-item--selected:after{background:#1a73e8;border-radius:50%;box-shadow:0 0 0 3px rgba(26,115,232,.25);content:"";flex-shrink:0;height:10px;width:10px}.eb-player[data-theme=modern] .eb-settings-item:not(.eb-settings-item--selected):after{border:2px solid hsla(0,0%,100%,.2);border-radius:50%;content:"";flex-shrink:0;height:10px;width:10px}.eb-player[data-theme=modern] .eb-settings-back{font-weight:600;gap:14px}.eb-player[data-theme=modern] .eb-loading .eb-icon{color:hsla(0,0%,100%,.7)}.eb-player[data-theme=modern] .eb-error{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.85)}.eb-player[data-theme=modern] .eb-error-retry{background:hsla(0,0%,100%,.1);border-color:hsla(0,0%,100%,.15);border-radius:8px;transition:background .2s,color .2s}.eb-player[data-theme=modern] .eb-error-retry:hover{background:hsla(0,0%,100%,.18)}.eb-player[data-theme=modern] .eb-toast{backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);background:rgba(0,0,0,.72);border-radius:10px;font-size:13px}.eb-player[data-theme=modern] .eb-info-overlay,.eb-player[data-theme=modern] .eb-socials-overlay{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.85)}.eb-player[data-theme=modern] .eb-info-close,.eb-player[data-theme=modern] .eb-socials-close{background:hsla(0,0%,100%,.07);border-color:hsla(0,0%,100%,.08);border-radius:8px;transition:background .2s,color .2s}.eb-player[data-theme=modern] .eb-info-close:hover,.eb-player[data-theme=modern] .eb-socials-close:hover{background:hsla(0,0%,100%,.13);color:#fff}.eb-player[data-theme=modern] .eb-socials-link{background:hsla(0,0%,100%,.07);border:1px solid hsla(0,0%,100%,.08);border-radius:8px;transition:background .2s,color .2s}.eb-player[data-theme=modern] .eb-socials-link:hover{background:rgba(167,139,250,.15);border-color:rgba(167,139,250,.35);color:#c4b5fd}.eb-player[data-theme=modern] .eb-bottom-bar__controls-row{flex-wrap:wrap}.eb-player[data-theme=modern] .eb-bottom-bar__seekbar-zone{flex:none;margin-bottom:-6px;order:-1;width:100%}.eb-player[data-theme=modern] .eb-slot-time{margin-left:auto;order:-1}.eb-player[data-theme=modern] .eb-slot-live-sync{order:-2}.eb-player[data-theme=modern] .eb-slot-settings{margin-left:auto}.eb-player[data-theme=modern] .eb-poster{background:linear-gradient(135deg,#0f0c29,#302b63,#24243e)}');t(".eb-player{background:#000;box-sizing:border-box;color:#fff;font-family:sans-serif;height:100%;overflow:hidden;position:relative;user-select:none;width:100%}.eb-player video.eb-video{display:block;height:100%;left:0;object-fit:contain;position:absolute;top:0;width:100%;z-index:1}.eb-overlay-zone{align-items:center;display:flex;justify-content:center;z-index:10}.eb-overlay-zone,.eb-poster{inset:0;pointer-events:none;position:absolute}.eb-poster{background:#000;box-sizing:border-box;height:100%;object-fit:contain;padding:15%;width:100%}.eb-ads-container{inset:0;pointer-events:none;position:absolute;z-index:20}.eb-top-bar{align-items:center;background:linear-gradient(180deg,rgba(0,0,0,.6),transparent);display:flex;flex-direction:row;justify-content:space-between;left:0;padding:8px 12px;pointer-events:auto;position:absolute;right:0;top:0;z-index:30}.eb-top-bar__logo{display:block;height:28px;width:auto}.eb-top-bar__logo-link{display:inline-flex;text-decoration:none}.eb-top-bar__actions{align-items:center;display:flex;gap:4px;margin-left:auto}.eb-bottom-bar{display:flex;flex-direction:column;pointer-events:auto;z-index:30}.eb-bottom-bar,.eb-bottom-bar__gradient{bottom:0;left:0;position:absolute;right:0}.eb-bottom-bar__gradient{background:linear-gradient(0deg,rgba(0,0,0,.7),transparent);height:100px;pointer-events:none;z-index:-1}.eb-bottom-bar__controls-row{align-items:center;display:flex;flex-direction:row;gap:4px;padding:4px 8px 8px}.eb-bottom-bar__seekbar-zone{flex:1;min-width:0}.eb-middle-bar{align-items:center;display:flex;gap:16px;left:50%;pointer-events:auto;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:25}.eb-middle-bar__play-btn{align-items:center;background:rgba(0,0,0,.5);border-radius:50%;display:flex;height:64px;justify-content:center;width:64px}.eb-middle-bar__seek-btn{background:none;flex-direction:column;gap:2px;padding:4px}.eb-middle-bar__seek-btn:hover{background:hsla(0,0%,100%,.1);border-radius:8px}.eb-seek-circle{display:block;height:32px;pointer-events:none;width:32px}.eb-seek-label{font-size:11px;font-weight:600;line-height:1;opacity:.85}.eb-extension-bottom-extra,.eb-extension-controls-extra,.eb-extension-overlay,.eb-extension-top-extra{pointer-events:none;position:absolute;z-index:35}.eb-extension-bottom-extra>*,.eb-extension-controls-extra>*,.eb-extension-overlay>*,.eb-extension-top-extra>*{pointer-events:auto}.eb-extension-top-extra{left:0;right:0;top:0}.eb-extension-bottom-extra{bottom:0;left:0;right:0}.eb-extension-overlay{align-items:center;display:flex;inset:0;justify-content:center}.eb-extension-controls-extra{align-items:center;bottom:0;display:flex;gap:4px;padding:4px 8px 8px;right:0}.eb-time-display{color:#fff;font-size:13px;font-variant-numeric:tabular-nums;line-height:1;padding:0 4px;white-space:nowrap}.eb-volume-control{align-items:center;display:flex;gap:4px;margin-right:8px}.eb-volume-track{background:hsla(0,0%,100%,.2);border-radius:2px;cursor:pointer;height:4px;position:relative;width:60px}.eb-volume-fill{border-radius:2px;height:100%;left:0;top:0}.eb-volume-fill,.eb-volume-thumb{background:var(--eb-color-volume,var(--eb-color-primary,#fff));pointer-events:none;position:absolute}.eb-volume-thumb{border-radius:50%;height:10px;top:50%;transform:translate(-50%,-50%);width:10px}.eb-settings-wrapper{position:relative}.eb-settings-panel{background:rgba(0,0,0,.85);border-radius:6px;bottom:calc(100% + 8px);font-size:13px;min-width:180px;overflow:hidden;position:absolute;right:0;z-index:40}.eb-settings-menu{list-style:none;margin:0;padding:4px 0}.eb-settings-back,.eb-settings-category,.eb-settings-item{align-items:center;background:none;border:none;color:#fff;cursor:pointer;display:flex;font-size:13px;justify-content:space-between;padding:8px 14px;text-align:left;width:100%}.eb-settings-back:hover,.eb-settings-category:hover,.eb-settings-item:hover{background:hsla(0,0%,100%,.1)}.eb-settings-item--selected{color:var(--eb-accent,#e53935)}.eb-seekbar{cursor:pointer;padding:8px 0;position:relative;width:100%}.eb-seekbar-disabled{opacity:.4;pointer-events:none}.eb-seekbar-track{background:hsla(0,0%,100%,.2);border-radius:2px;height:4px;position:relative}.eb-seekbar-buffered{background:hsla(0,0%,100%,.4)}.eb-seekbar-buffered,.eb-seekbar-progress{border-radius:2px;height:100%;left:0;pointer-events:none;position:absolute;top:0}.eb-seekbar-progress,.eb-seekbar-thumb{background:var(--eb-color-progress,var(--eb-color-primary,#e53935))}.eb-seekbar-thumb{border-radius:50%;height:12px;pointer-events:none;position:absolute;right:-6px;top:50%;transform:translateY(-50%) scale(0);transition:transform .15s;width:12px}.eb-seekbar:hover .eb-seekbar-thumb{transform:translateY(-50%) scale(1)}.eb-seekbar:hover .eb-seekbar-track{height:6px}.eb-seekbar-tooltip{background:rgba(0,0,0,.8);border-radius:3px;bottom:calc(100% + 8px);color:#fff;font-size:12px;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;transform:translateX(-50%);white-space:nowrap}.eb-seekbar-preview{display:block;height:auto;margin-bottom:4px;width:120px}.eb-chapter-marker{background:hsla(0,0%,100%,.6);height:100%;pointer-events:none;position:absolute;top:0;transform:translateX(-50%);width:3px}.eb-chapter-marker.eb-chapter-active{background:#fff}.eb-chapter-skip{background:rgba(0,0,0,.7);border:1px solid hsla(0,0%,100%,.4);border-radius:4px;bottom:calc(100% + 4px);color:#fff;cursor:pointer;font-size:13px;padding:6px 16px;position:absolute;right:0}.eb-chapter-skip:hover{background:hsla(0,0%,100%,.2)}.eb-epg-segment{border-right:1px solid hsla(0,0%,100%,.3);height:100%;pointer-events:none;position:absolute;top:0}.eb-epg-segment.eb-epg-current{background:hsla(0,0%,100%,.1)}.eb-icon{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;display:block;flex-shrink:0;height:20px;pointer-events:none;width:20px}.eb-button,.eb-cast,.eb-fullscreen,.eb-live-sync,.eb-pip,.eb-play-pause,.eb-volume-mute{-webkit-tap-highlight-color:transparent;align-items:center;background:none;border:none;border-radius:4px;color:var(--eb-color-icon,inherit);cursor:pointer;display:flex;justify-content:center;padding:6px;transition:background .15s}.eb-button:hover,.eb-cast:hover,.eb-fullscreen:hover,.eb-live-sync:hover,.eb-pip:hover,.eb-play-pause:hover,.eb-volume-mute:hover{background:hsla(0,0%,100%,.15)}.eb-button:active,.eb-cast:active,.eb-fullscreen:active,.eb-live-sync:active,.eb-pip:active,.eb-play-pause:active,.eb-volume-mute:active{background:hsla(0,0%,100%,.25)}.eb-radio-overlay{align-items:center;background:#000;display:flex;inset:0;justify-content:center;position:absolute;z-index:15}.eb-radio-bars{align-items:flex-end;display:flex;gap:4px;height:40px}.eb-radio-bar{animation:eb-radio-bar-bounce .8s ease-in-out infinite;background:#fff;border-radius:3px;display:block;width:6px}.eb-radio-bar:first-child{animation-delay:0s;height:20px}.eb-radio-bar:nth-child(2){animation-delay:.1s;height:32px}.eb-radio-bar:nth-child(3){animation-delay:.2s;height:40px}.eb-radio-bar:nth-child(4){animation-delay:.3s;height:28px}.eb-radio-bar:nth-child(5){animation-delay:.4s;height:16px}@keyframes eb-radio-bar-bounce{0%,to{opacity:.7;transform:scaleY(.4)}50%{opacity:1;transform:scaleY(1)}}.eb-live-sync[hidden]{display:none}.eb-live-synced{color:var(--eb-accent,#e53935)}.eb-error-slot,.eb-info-slot,.eb-socials-slot{inset:0;pointer-events:none;position:absolute;z-index:50}.eb-toast-slot{bottom:60px;left:50%;pointer-events:none;position:absolute;transform:translateX(-50%);z-index:50}.eb-toast{background:rgba(0,0,0,.8);border-radius:4px;color:#fff;font-size:13px;padding:8px 20px;pointer-events:auto;white-space:nowrap}.eb-error,.eb-info-overlay,.eb-socials-overlay{align-items:center;background:rgba(0,0,0,.75);color:#fff;display:flex;flex-direction:column;inset:0;justify-content:center;padding:24px;pointer-events:auto;position:absolute;text-align:center;z-index:50}.eb-error[hidden],.eb-info-overlay[hidden],.eb-socials-overlay[hidden]{display:none}.eb-error-message{font-size:16px;margin:0 0 16px}.eb-error-retry{background:hsla(0,0%,100%,.15);border:1px solid hsla(0,0%,100%,.3);border-radius:4px;color:#fff;cursor:pointer;font-size:14px;padding:8px 24px}.eb-error-retry:hover{background:hsla(0,0%,100%,.25)}.eb-info-content{font-size:14px;line-height:1.5;margin-bottom:16px;max-width:400px}.eb-info-close,.eb-socials-close{background:hsla(0,0%,100%,.15);border:1px solid hsla(0,0%,100%,.3);border-radius:4px;color:#fff;cursor:pointer;font-size:14px;padding:8px 24px}.eb-info-close:hover,.eb-socials-close:hover{background:hsla(0,0%,100%,.25)}.eb-socials-links{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;margin-bottom:16px}.eb-socials-link{background:hsla(0,0%,100%,.1);border-radius:4px;color:#fff;font-size:14px;padding:8px 16px;text-decoration:none;text-transform:capitalize}.eb-socials-link:hover{background:hsla(0,0%,100%,.25)}.eb-loading{align-items:center;color:#fff;display:flex;flex-direction:column;gap:8px;justify-content:center;pointer-events:none}.eb-loading[hidden]{display:none}.eb-loading .eb-icon{animation:eb-spin 1s linear infinite;height:40px;width:40px}.eb-loading-text{font-size:14px}@keyframes eb-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.eb-controls-visible .eb-bottom-bar,.eb-controls-visible .eb-middle-bar,.eb-controls-visible .eb-top-bar{opacity:1;transition:opacity .3s}.eb-controls-hidden .eb-bottom-bar,.eb-controls-hidden .eb-middle-bar,.eb-controls-hidden .eb-top-bar{opacity:0;pointer-events:none;transition:opacity .3s}.eb-ios-native .eb-bottom-bar,.eb-ios-native .eb-error-slot,.eb-ios-native .eb-info-slot,.eb-ios-native .eb-middle-bar,.eb-ios-native .eb-overlay-zone,.eb-ios-native .eb-socials-slot,.eb-ios-native .eb-toast-slot,.eb-ios-native .eb-top-bar{display:none}[dir=rtl] .eb-bottom-bar__controls-row,[dir=rtl] .eb-top-bar{flex-direction:row-reverse}.eb-player,.eb-player video{max-height:100%;max-width:100%}");const s={idle:["loading"],loading:["playing","buffering","paused","error","idle"],playing:["paused","buffering","ended","error","idle"],paused:["playing","loading","idle"],buffering:["playing","paused","idle","error"],error:["loading","idle"],ended:["loading","idle"]};class i{constructor(){this.listeners=new Map}on(e,t,s){this.listeners.has(e)||this.listeners.set(e,new Set);const i=this.listeners.get(e);i.add(t);const r=s?.signal;if(void 0!==r){const e=()=>{i.delete(t)};r.addEventListener("abort",e,{once:!0})}}notify(e,t,s){const i=this.listeners.get(e);if(void 0!==i)for(const e of i)e(t,s)}}const r={playbackState:"idle",volume:1,currentTime:0,duration:0,muted:!1,bufferedEnd:0,isLive:!1,qualityLevels:[],currentQuality:-1,audioTracks:[],currentAudioTrack:-1,subtitleTracks:[],currentSubtitleTrack:-1,playbackRate:1,error:null,src:"",isFullscreen:!1,isPip:!1,isCasting:!1,controlsVisible:!0,settingsOpen:!1,socialsOpen:!1,infoOpen:!1,adPlaying:!1,castAvailable:!1,isRtl:!1,isRadio:!1,isIOS:!1,isSyncWithLive:!1,epgPrograms:[],epgFetchedAt:0,chapters:[],playlist:[],currentEpisode:-1,reconnecting:!1,toast:null};function n(e){const t={...r,...e},n=new i;return new Proxy(t,{get:(e,t)=>"on"===t?n.on.bind(n):e[t],set(e,t,i){const r=t;if(!function(e){if(null==e||"object"!=typeof e)return!0;if(Array.isArray(e))return!0;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(i))throw new TypeError(`PlayerState: cannot assign a non-plain object (class instance) to "${String(t)}". Only primitives, plain objects, arrays, null, and undefined are allowed. Driver instances (hls.js, dash.js) must never enter the state store.`);if("playbackState"===r){const t=e.playbackState,r=i;if(a=r,!s[t].includes(a))return console.warn(`FSM: rejected playbackState transition "${t}" → "${r}"`),!0}var a;const o=e[r];return o===i||(e[String(r)]=i,n.notify(r,i,o)),!0}})}class a{constructor(){this.listeners=new Map}on(e,t,s){const i=s?.signal;if(!0===i?.aborted)return;this.listeners.has(e)||this.listeners.set(e,new Set);const r=this.listeners.get(e),n=t;r.add(n),void 0!==i&&i.addEventListener("abort",()=>{r.delete(n)},{once:!0})}emit(...e){const[t,s]=e,i=this.listeners.get(t);if(void 0!==i&&0!==i.size)for(const e of i)void 0!==s?e(s):e()}dispose(){this.listeners.clear()}}const o={template:"",el:"#eb_player",skin:"default",start:!0,forceAutoplayAudio:!1,style:void 0,css:"",dashjs:"https://reference.dashif.org/dash.js/v4.7.4/dist/dash.all.min.js",hlsjs:"https://cdn.jsdelivr.net/npm/hls.js@1.6.10/dist/hls.min.js",engineSettings:{liveSyncDurationCount:8},chromecast:"https://cdnjs.cloudflare.com/ajax/libs/castjs/5.3.0/cast.min.js",chromecastApp:void 0,chromecastMetadata:void 0,src:void 0,autoplay:!0,muted:!0,image:!1,loop:!1,startAt:void 0,loading:!0,logo:void 0,logoLink:void 0,logoPositions:["top-left"],about:"Powered by EasyBroadcast.",primaryColor:"#1FA9DD",skinColor:"",skinColors:{general:"",progressBar:"",volumeBar:""},socials:!1,customSocialsShare:!1,seekbar:!0,middlebar:!0,pip:!0,retry:!0,lowLatency:!1,ad:void 0,radio:!1,token:void 0,tokenType:void 0,srcInTokenRequest:!1,defaultAudio:void 0,defaultSubtitle:void 0,forceAutoplay:!1,forceQuality:!1,liveButton:!1,syncLiveMargin:300,isLive:void 0,noUi:!1,preroll:!1,prerollSkip:1/0,prerollLink:!1,posterStream:!1,speed:!0,chapters:null,skippableChapters:[],seekOffset:15,supportHotKeys:!1,useGeoblockingErrorHandle:!1,extraParamsCallback:void 0,licenseXhrSetup:void 0,volume:1,lib:void 0,manager:"wss://manager.kube.easybroadcast.fr/easybroadcast/Xc152ogNOWvOZSH",stats:"https://stats.easybroadcast.fr",origin:"easybroadcast",content:void 0,libSettings:{resourceManager:{timeoutV2V:4500,storageSize:300,randomWaitForPeers:[1e3,3e3],partialRequest:!0,setEnableV2V:!0}},hasPlaylistPicker:!1,disableCustomAbr:!1,lang:void 0,epgContentId:void 0,epgPolling:null,epgDefaultLang:"en",showEpgTitlePreview:!1,showProgressThumb:!1};function l(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function d(e,t){if("function"==typeof t)return t;if(Array.isArray(t))return[...t];if(l(t)&&l(e)){const s={};for(const t of Object.keys(e))s[t]=e[t];for(const i of Object.keys(t))s[i]=d(e[i],t[i]);return s}if(l(t)){const e={};for(const s of Object.keys(t))e[s]=d(void 0,t[s]);return e}return void 0!==t?t:e}function c(...e){let t={};for(const s of e)null!=s&&(t=d(t,s));return t}const h=["en","fr","ar","es"],u={"error.start":{en:"An error occurred while trying to start the video.",fr:"Une erreur est survenue lors de la tentative de demarrage de la video.",ar:"An error occurred while trying to start the video.",es:"Ocurrió un error al intentar iniciar el video."},"loading.reconnecting":{en:"Reconnecting...",fr:"Reconnexion...",ar:"Reconnecting...",es:"Reconectando..."},"error.stream_unavailable":{en:"The stream is unavailable. Please try again later.",fr:"Le flux est indisponible. Veuillez réessayer plus tard.",ar:"The stream is unavailable. Please try again later.",es:"La transmisión no está disponible. Por favor, inténtelo más tarde."},"cast.failed":{en:"Casting failed. Resuming local playback.",fr:"La diffusion a échoué. Reprise de la lecture locale.",ar:"Casting failed. Resuming local playback.",es:"Error en la transmisión. Reanudando la reproducción local."}};function b(e){if(void 0===e||""===e)return"en";const t=e.split(/[-_]/)[0].toLowerCase();return h.includes(t)?t:"en"}class p{constructor(e){this.currentLocale=b(e),this.translations={...u}}addTranslations(e){for(const t of Object.keys(e))this.translations[t]={...this.translations[t],...e[t]}}t(e,t){const s=this.translations[e];let i;return i=void 0===s?e:void 0!==s[this.currentLocale]?s[this.currentLocale]:void 0!==s.en?s.en:e,void 0===t||0===Object.keys(t).length?i:this.interpolate(i,t)}interpolate(e,t){return e.replace(/\{(\w+)\}/g,(e,s)=>{const i=t[s];return void 0!==i?String(i):e})}setLocale(e){this.currentLocale=b(e)}getLocale(){return this.currentLocale}}class m{constructor(e,t,s,i,r,n,a,o){this.reloadCount=0,this.successTimer=0,this.toastTimer=0,this.savedQuality=-1,this.savedAudioTrack=0,this.savedSubtitleTrack=-1,this.wireVideoCommands(e,t,s,r,o),this.wireEngineCommands(e,i,o),this.wireReloadOrchestration(e,s,n,a,o),this.wireCastHandoff(e,t,s,r,n,o),this.wireVolumeRouting(s,r,o),this.wireAbortCleanup(o)}getSavedSelections(){return{quality:this.savedQuality,audioTrack:this.savedAudioTrack,subtitleTrack:this.savedSubtitleTrack}}wireVideoCommands(e,t,s,i,r){e.on("play",()=>{s.isCasting&&null!==i?i.getDriver()?.play():t.play()},{signal:r}),e.on("pause",()=>{s.isCasting&&null!==i?i.getDriver()?.pause():t.pause()},{signal:r}),e.on("seek",({time:e})=>{s.isCasting&&null!==i?i.getDriver()?.seek(e):t.currentTime=e},{signal:r}),e.on("mute-toggle",()=>{t.muted=!t.muted},{signal:r})}wireEngineCommands(e,t,s){e.on("settings-select-quality",({index:e})=>{t()?.setQuality(e)},{signal:s}),e.on("settings-select-audio",({index:e})=>{t()?.setAudioTrack(e)},{signal:s}),e.on("settings-select-subtitle",({index:e})=>{t()?.setSubtitle(e)},{signal:s}),e.on("settings-select-speed",({rate:e})=>{t()?.setPlaybackRate(e)},{signal:s}),e.on("sync-live",()=>{t()?.seekToLive()},{signal:s})}wireReloadOrchestration(e,t,s,i,r){e.on("request-reload",()=>{if(this.reloadCount>=3)return t.reconnecting=!1,void(t.error=s.t("error.stream_unavailable"));this.savedQuality=t.currentQuality,this.savedAudioTrack=t.currentAudioTrack,this.savedSubtitleTrack=t.currentSubtitleTrack,t.reconnecting=!0,this.reloadCount++,i()},{signal:r}),t.on("playbackState",e=>{"playing"===e?(clearTimeout(this.successTimer),this.successTimer=setTimeout(()=>{this.reloadCount=0,t.reconnecting=!1},12e4)):(clearTimeout(this.successTimer),this.successTimer=0)},{signal:r})}wireCastHandoff(e,t,s,i,r,n){e.on("cast-start",()=>{null!==i&&(t.pause(),i.toggleCast(s))},{signal:n}),e.on("cast-stop",()=>{t.play()},{signal:n}),e.on("cast-stop-with-position",({time:e})=>{t.currentTime=e,t.play()},{signal:n}),e.on("cast-failed",()=>{s.isCasting=!1,t.play(),this.showToast(s,r.t("cast.failed"))},{signal:n})}wireVolumeRouting(e,t,s){null!==t&&e.on("volume",s=>{e.isCasting&&t.getDriver()?.volume(s)},{signal:s})}showToast(e,t){e.toast=t,clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{e.toast=null},3e3)}wireAbortCleanup(e){e.addEventListener("abort",()=>{clearTimeout(this.successTimer),clearTimeout(this.toastTimer)},{once:!0})}}
1
+ var EBPlayerBundle=function(e){"use strict";var t="2.0.6";function i(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&r.firstChild?r.insertBefore(s,r.firstChild):r.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}i(".eb-player{box-sizing:border-box;color:var(--eb-color-text,#fff);font-family:var(--eb-font-family,Arial,sans-serif);font-size:var(--eb-font-size-base,14px);overflow:hidden;position:relative}.eb-player *,.eb-player :after,.eb-player :before{box-sizing:inherit}.eb-player__container{background-color:var(--eb-color-background,rgba(0,0,0,.8));height:100%;position:relative;width:100%}.eb-player__video{display:block;height:100%;object-fit:contain;width:100%}");i("[data-theme=forja] .eb-player{--eb-color-primary:#fc013b}");i('@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");[data-theme=lequipe] .eb-player{--eb-color-primary:#d61e00;--eb-color-progress:#d61e00;--eb-color-background:rgba(10,10,20,.85);--eb-accent:#d61e00;--eb-color-text:#fff;--eb-font-family:"Inter",-apple-system,sans-serif;--eb-font-size-base:14px;--eb-radius-control:8px;--eb-duration-transition:200ms;border-radius:0;box-shadow:none;color:#fff;font-family:Inter,-apple-system,sans-serif}[data-theme=lequipe] .eb-player .eb-icon{stroke-width:2.5}[data-theme=lequipe] .eb-player:-webkit-full-screen,[data-theme=lequipe] .eb-player:fullscreen{border-radius:0;box-shadow:none}[data-theme=lequipe] .eb-player .eb-top-bar{background:linear-gradient(180deg,rgba(0,0,0,.72),transparent);gap:6px;height:110px;padding:14px 16px}[data-theme=lequipe] .eb-player .eb-bottom-bar__gradient{background:linear-gradient(0deg,rgba(0,0,0,.9),transparent);height:150px}[data-theme=lequipe] .eb-player.eb-controls-visible .eb-top-bar{opacity:1;transform:translateY(0);transition:opacity .3s,transform .3s}[data-theme=lequipe] .eb-player.eb-controls-hidden .eb-top-bar{opacity:0;transform:translateY(-6px);transition:opacity .3s,transform .3s}[data-theme=lequipe] .eb-player .eb-top-bar__actions{gap:6px}[data-theme=lequipe] .eb-player .eb-top-bar__logo{max-height:32px;max-width:120px;opacity:.85}[data-theme=lequipe] .eb-player .eb-bottom-bar__controls-row{gap:8px;padding:0 14px 12px}[data-theme=lequipe] .eb-player.eb-controls-visible .eb-bottom-bar{opacity:1;transform:translateY(0);transition:opacity .3s,transform .3s}[data-theme=lequipe] .eb-player.eb-controls-hidden .eb-bottom-bar{opacity:0;transform:translateY(8px);transition:opacity .3s,transform .3s}[data-theme=lequipe] .eb-player .eb-middle-bar{gap:28px}[data-theme=lequipe] .eb-player.eb-controls-visible .eb-middle-bar{opacity:1;transition:opacity .3s}[data-theme=lequipe] .eb-player.eb-controls-hidden .eb-middle-bar{opacity:0;transition:opacity .3s}[data-theme=lequipe] .eb-player .eb-middle-bar__play-btn{align-items:center;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);background:hsla(0,0%,100%,.15);border:2px solid hsla(0,0%,100%,.25);border-radius:50%;color:#fff;display:flex;height:80px;justify-content:center;padding:0;transition:background .15s,transform .25s,opacity .25s;width:80px}[data-theme=lequipe] .eb-player .eb-middle-bar__play-btn:hover{background:hsla(0,0%,100%,.25)}[data-theme=lequipe] .eb-player .eb-middle-bar__play-btn:active{transform:scale(.92)}[data-theme=lequipe] .eb-player .eb-middle-bar__play-btn .eb-icon{stroke-width:2.5;height:32px;width:32px}[data-theme=lequipe] .eb-player .eb-middle-bar__seek-btn{align-items:center;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);background:hsla(0,0%,100%,.15);border:2px solid hsla(0,0%,100%,.25);border-radius:50%;color:#fff;display:flex;flex-direction:column;gap:1px;height:56px;justify-content:center;padding:0;transition:background .15s;width:56px}[data-theme=lequipe] .eb-player .eb-middle-bar__seek-btn:hover{background:hsla(0,0%,100%,.25)}[data-theme=lequipe] .eb-player .eb-seek-circle{fill:currentColor;stroke:none;color:hsla(0,0%,100%,.85);height:24px;width:24px}[data-theme=lequipe] .eb-player .eb-seek-label{color:hsla(0,0%,100%,.9);font-size:.75em;font-weight:700;line-height:1}[data-theme=lequipe] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn),[data-theme=lequipe] .eb-player .eb-cast,[data-theme=lequipe] .eb-player .eb-fullscreen,[data-theme=lequipe] .eb-player .eb-live-sync,[data-theme=lequipe] .eb-player .eb-pip,[data-theme=lequipe] .eb-player .eb-play-pause,[data-theme=lequipe] .eb-player .eb-volume-mute{border-radius:8px;color:hsla(0,0%,100%,.82);flex-shrink:0;height:38px;transition:background .15s,color .15s,transform .1s;width:38px}[data-theme=lequipe] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn):hover,[data-theme=lequipe] .eb-player .eb-cast:hover,[data-theme=lequipe] .eb-player .eb-fullscreen:hover,[data-theme=lequipe] .eb-player .eb-live-sync:hover,[data-theme=lequipe] .eb-player .eb-pip:hover,[data-theme=lequipe] .eb-player .eb-play-pause:hover,[data-theme=lequipe] .eb-player .eb-volume-mute:hover{background:hsla(0,0%,100%,.12);color:#fff}[data-theme=lequipe] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn):active,[data-theme=lequipe] .eb-player .eb-cast:active,[data-theme=lequipe] .eb-player .eb-fullscreen:active,[data-theme=lequipe] .eb-player .eb-live-sync:active,[data-theme=lequipe] .eb-player .eb-pip:active,[data-theme=lequipe] .eb-player .eb-play-pause:active,[data-theme=lequipe] .eb-player .eb-volume-mute:active{transform:scale(.88)}[data-theme=lequipe] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn) .eb-icon,[data-theme=lequipe] .eb-player .eb-cast .eb-icon,[data-theme=lequipe] .eb-player .eb-fullscreen .eb-icon,[data-theme=lequipe] .eb-player .eb-pip .eb-icon,[data-theme=lequipe] .eb-player .eb-play-pause .eb-icon,[data-theme=lequipe] .eb-player .eb-volume-mute .eb-icon{height:22px;width:22px}[data-theme=lequipe] .eb-player .eb-top-bar .eb-icon{height:24px;width:24px}[data-theme=lequipe] .eb-player .eb-middle-bar__play-btn .eb-icon,[data-theme=lequipe] .eb-player .eb-play-pause .eb-icon{fill:currentColor;stroke:none}[data-theme=lequipe] .eb-player .eb-volume-mute .eb-icon path:first-child{fill:currentColor}[data-theme=lequipe] .eb-player .eb-cast-active{background:rgba(30,182,212,.15)!important;color:#1eb6d4!important}[data-theme=lequipe] .eb-player .eb-cast-active .eb-icon{filter:drop-shadow(0 0 4px rgba(30,182,212,.6))}[data-theme=lequipe] .eb-player .eb-seekbar-track{background:hsla(0,0%,100%,.22);border-radius:3px;height:3px;transition:height .15s}[data-theme=lequipe] .eb-player .eb-seekbar:hover .eb-seekbar-track{height:5px}[data-theme=lequipe] .eb-player .eb-seekbar-buffered{background:hsla(0,0%,100%,.28);border-radius:3px;transition:height .15s}[data-theme=lequipe] .eb-player .eb-seekbar-progress{background:#d61e00;border-radius:3px;transition:height .15s}[data-theme=lequipe] .eb-player .eb-seekbar-thumb{background:#fff;box-shadow:0 0 0 3px rgba(214,30,0,.45);height:14px;right:-7px;width:14px}[data-theme=lequipe] .eb-player .eb-seekbar-tooltip{align-items:center;background:rgba(0,0,0,.88);border:1px solid hsla(0,0%,100%,.12);border-radius:7px;bottom:28px;box-shadow:0 4px 16px rgba(0,0,0,.5);display:flex;flex-direction:column;font-size:11px;font-weight:500;overflow:hidden;padding:0}[data-theme=lequipe] .eb-player .eb-seekbar-preview{background:#111;border:none;border-radius:0;height:90px;margin:0;width:160px}[data-theme=lequipe] .eb-player .eb-chapter-marker{background:rgba(0,0,0,.45);border-radius:1px;height:7px;top:50%;transform:translate(-50%,-50%);width:2px}[data-theme=lequipe] .eb-player .eb-volume-control{flex-direction:row;gap:0;margin-right:0}[data-theme=lequipe] .eb-player .eb-volume-track{background:hsla(0,0%,100%,.22);border-radius:3px;height:3px;margin:0;overflow:hidden;transition:width .25s ease,margin .25s ease;width:0}[data-theme=lequipe] .eb-player .eb-volume-control:focus-within .eb-volume-track,[data-theme=lequipe] .eb-player .eb-volume-control:hover .eb-volume-track{margin:0 6px 0 2px;width:66px}[data-theme=lequipe] .eb-player .eb-volume-fill{background:var(--eb-color-primary,#d61e00)}[data-theme=lequipe] .eb-player .eb-volume-thumb{background:#fff;box-shadow:0 0 0 2px hsla(0,0%,100%,.35);height:11px;transform:translate(-50%,-50%) scale(0);transition:transform .15s;width:11px}[data-theme=lequipe] .eb-player .eb-volume-control:hover .eb-volume-thumb{transform:translate(-50%,-50%) scale(1)}[data-theme=lequipe] .eb-player .eb-time-display{color:hsla(0,0%,100%,.85);font-size:13px;font-weight:500;letter-spacing:.02em}[data-theme=lequipe] .eb-player .eb-live-sync{border-radius:6px;font-size:11px;font-weight:700;gap:5px;height:auto;letter-spacing:.08em;padding:4px 10px;text-transform:uppercase;width:auto}[data-theme=lequipe] .eb-player .eb-live-sync__icon{display:none}[data-theme=lequipe] .eb-player .eb-live-sync__dot{background:#fff;border-radius:50%;display:block;flex-shrink:0;height:6px;width:6px}[data-theme=lequipe] .eb-player .eb-live-sync__label{display:block}[data-theme=lequipe] .eb-player .eb-live-synced{background:rgba(214,30,0,.9);box-shadow:0 2px 8px rgba(214,30,0,.4);color:#fff}[data-theme=lequipe] .eb-player .eb-live-synced .eb-live-sync__dot{animation:eb-lequipe-blink 1.2s ease infinite}[data-theme=lequipe] .eb-player .eb-live-sync:not(.eb-live-synced){background:rgba(60,60,80,.75);box-shadow:none;color:hsla(0,0%,100%,.7)}[data-theme=lequipe] .eb-player .eb-live-sync:not(.eb-live-synced) .eb-live-sync__dot{animation:none;background:hsla(0,0%,100%,.5)}[data-theme=lequipe] .eb-player .eb-live-sync:not(.eb-live-synced):hover{background:rgba(214,30,0,.7);color:#fff}@keyframes eb-lequipe-blink{0%,to{opacity:1}50%{opacity:.15}}[data-theme=lequipe] .eb-player .eb-settings-panel{backdrop-filter:blur(24px) saturate(160%);-webkit-backdrop-filter:blur(24px) saturate(160%);background:rgba(30,30,45,.6);border-radius:14px;box-shadow:0 16px 48px rgba(0,0,0,.6),0 0 0 1px hsla(0,0%,100%,.08);max-height:60vh;overflow-x:hidden;overflow-y:auto;width:min(340px,80vw)}@media (max-height:400px){[data-theme=lequipe] .eb-player .eb-settings-category{font-size:13px;gap:10px;padding:12px 14px}[data-theme=lequipe] .eb-player .eb-settings-item{font-size:13px;padding:11px 14px}[data-theme=lequipe] .eb-player .eb-settings-header{padding:10px 14px}[data-theme=lequipe] .eb-player .eb-settings-panel{border-radius:10px;min-width:220px}[data-theme=lequipe] .eb-player .eb-settings-back{height:30px;width:30px}}[data-theme=lequipe] .eb-player .eb-settings-menu{padding:0}[data-theme=lequipe] .eb-player .eb-settings-category{align-items:center;background:none;border:none;color:hsla(0,0%,100%,.95);cursor:pointer;display:flex;font-size:14px;gap:14px;padding:18px 20px;text-align:left;transition:background .12s;width:100%}[data-theme=lequipe] .eb-player .eb-settings-category:last-child{border-bottom:none}[data-theme=lequipe] .eb-player .eb-settings-category:hover{background:hsla(0,0%,100%,.05)}[data-theme=lequipe] .eb-player .eb-settings-category__icon{align-items:center;color:hsla(0,0%,100%,.6);display:flex;flex-shrink:0;justify-content:center}[data-theme=lequipe] .eb-player .eb-settings-category__icon .eb-icon{height:22px;width:22px}[data-theme=lequipe] .eb-player .eb-settings-category__label{flex:1;font-weight:400}[data-theme=lequipe] .eb-player .eb-settings-category__value{color:hsla(0,0%,100%,.45);font-size:13px;font-weight:400}[data-theme=lequipe] .eb-player .eb-settings-category__chevron{align-items:center;color:hsla(0,0%,100%,.3);display:flex;flex-shrink:0}[data-theme=lequipe] .eb-player .eb-settings-category__chevron .eb-icon{height:16px;width:16px}[data-theme=lequipe] .eb-player .eb-settings-header{align-items:center;border-bottom:1px solid hsla(0,0%,100%,.08);display:flex;gap:12px;padding:14px 18px}[data-theme=lequipe] .eb-player .eb-settings-header__title{color:#fff;font-size:15px;font-weight:600}[data-theme=lequipe] .eb-player .eb-settings-back{align-items:center;background:hsla(0,0%,100%,.12);border:none;border-radius:50%;color:#fff;cursor:pointer;display:flex;flex-shrink:0;height:36px;justify-content:center;padding:0;transition:background .15s;width:36px}[data-theme=lequipe] .eb-player .eb-settings-back:hover{background:hsla(0,0%,100%,.2)}[data-theme=lequipe] .eb-player .eb-settings-back .eb-icon{height:18px;width:18px}[data-theme=lequipe] .eb-player .eb-settings-item{align-items:center;background:none;border:none;border-bottom:1px solid hsla(0,0%,100%,.06);color:hsla(0,0%,100%,.7);cursor:pointer;display:flex;font-size:14px;justify-content:space-between;padding:16px 20px;text-align:left;transition:background .12s;width:100%}[data-theme=lequipe] .eb-player .eb-settings-item:last-child{border-bottom:none}[data-theme=lequipe] .eb-player .eb-settings-item:hover{background:hsla(0,0%,100%,.05)}[data-theme=lequipe] .eb-player .eb-settings-item--selected{color:#fff;font-weight:500}[data-theme=lequipe] .eb-player .eb-settings-item--selected:after{background:var(--eb-accent,#d61e00);border-radius:50%;content:"";flex-shrink:0;height:12px;width:12px}[data-theme=lequipe] .eb-player .eb-settings-item:not(.eb-settings-item--selected):after{border:2px solid hsla(0,0%,100%,.2);border-radius:50%;content:"";flex-shrink:0;height:12px;width:12px}[data-theme=lequipe] .eb-player .eb-loading .eb-icon{animation:eb-spin .75s linear infinite;color:hsla(0,0%,100%,.7);filter:drop-shadow(0 1px 6px rgba(0,0,0,.5));height:52px;width:52px}[data-theme=lequipe] .eb-player .eb-error{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.85)}[data-theme=lequipe] .eb-player .eb-error-message{font-weight:400;letter-spacing:.01em}[data-theme=lequipe] .eb-player .eb-error-retry{background:hsla(0,0%,100%,.1);border-color:hsla(0,0%,100%,.15);border-radius:8px;transition:background .2s,color .2s}[data-theme=lequipe] .eb-player .eb-error-retry:hover{background:hsla(0,0%,100%,.18)}[data-theme=lequipe] .eb-player .eb-toast{backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);background:rgba(0,0,0,.72);border-radius:10px;font-size:13px;padding:8px 16px}[data-theme=lequipe] .eb-player .eb-info-overlay,[data-theme=lequipe] .eb-player .eb-socials-overlay{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.85)}[data-theme=lequipe] .eb-player .eb-info-close,[data-theme=lequipe] .eb-player .eb-socials-close{background:hsla(0,0%,100%,.07);border-color:hsla(0,0%,100%,.08);border-radius:8px;transition:background .2s,color .2s}[data-theme=lequipe] .eb-player .eb-info-close:hover,[data-theme=lequipe] .eb-player .eb-socials-close:hover{background:hsla(0,0%,100%,.13);color:#fff}[data-theme=lequipe] .eb-player .eb-socials-link{background:hsla(0,0%,100%,.07);border:1px solid hsla(0,0%,100%,.08);border-radius:8px;transition:background .2s,color .2s,border-color .2s}[data-theme=lequipe] .eb-player .eb-socials-link:hover{background:rgba(214,30,0,.15);border-color:rgba(214,30,0,.35);color:#ff8a75}[data-theme=lequipe] .eb-player .eb-poster,[data-theme=lequipe] .eb-player .eb-radio-overlay{background:linear-gradient(135deg,#0f0c29,#302b63,#24243e)}[data-theme=lequipe] .eb-player .eb-radio-bar{background:rgba(214,30,0,.8)}[data-theme=lequipe] .eb-player .eb-chapter-skip{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.55);border:1px solid hsla(0,0%,100%,.15);border-radius:8px;font-size:12px;font-weight:500;transition:background .15s}[data-theme=lequipe] .eb-player .eb-chapter-skip:hover{background:hsla(0,0%,100%,.12)}');i('@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap");[data-theme=modern] .eb-player .eb-icon{fill:currentColor;stroke:none;stroke-width:0}[data-theme=modern] .eb-player{--eb-color-primary:#7c3aed;--eb-color-progress:#7c3aed;--eb-color-background:rgba(10,10,20,.85);--eb-accent:#1a73e8;--eb-font-family:"Inter",sans-serif;border-radius:14px;box-shadow:0 40px 80px rgba(0,0,0,.8),0 0 0 1px hsla(0,0%,100%,.06);font-family:Inter,sans-serif}[data-theme=modern] .eb-player .eb-top-bar{background:linear-gradient(180deg,rgba(0,0,0,.72),transparent);gap:6px;height:110px;padding:14px 16px}[data-theme=modern] .eb-player .eb-bottom-bar__gradient{background:linear-gradient(0deg,rgba(0,0,0,.9),transparent);height:150px}[data-theme=modern] .eb-player.eb-controls-visible .eb-top-bar{opacity:1;transform:translateY(0);transition:opacity .3s,transform .3s}[data-theme=modern] .eb-player.eb-controls-hidden .eb-top-bar{opacity:0;transform:translateY(-6px);transition:opacity .3s,transform .3s}[data-theme=modern] .eb-player .eb-top-bar__actions{gap:6px}[data-theme=modern] .eb-player .eb-bottom-bar__controls-row{gap:8px;padding:0 14px 12px}[data-theme=modern] .eb-player.eb-controls-visible .eb-bottom-bar{opacity:1;transform:translateY(0);transition:opacity .3s,transform .3s}[data-theme=modern] .eb-player.eb-controls-hidden .eb-bottom-bar{opacity:0;transform:translateY(8px);transition:opacity .3s,transform .3s}[data-theme=modern] .eb-player .eb-middle-bar{gap:28px}[data-theme=modern] .eb-player.eb-controls-visible .eb-middle-bar{opacity:1;transition:opacity .3s}[data-theme=modern] .eb-player.eb-controls-hidden .eb-middle-bar{opacity:0;transition:opacity .3s}[data-theme=modern] .eb-player .eb-middle-bar__play-btn{backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);background:hsla(0,0%,100%,.18);border:2px solid hsla(0,0%,100%,.28);height:72px;transition:background .15s;width:72px}[data-theme=modern] .eb-player .eb-middle-bar__play-btn:hover{background:hsla(0,0%,100%,.28)}[data-theme=modern] .eb-player .eb-middle-bar__play-btn .eb-icon{height:30px;width:30px}[data-theme=modern] .eb-player .eb-middle-bar__seek-btn{align-items:center;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);background:hsla(0,0%,100%,.14);border:1.5px solid hsla(0,0%,100%,.22);border-radius:50%;flex-direction:column;gap:1px;height:52px;justify-content:center;padding:0;transition:background .15s;width:52px}[data-theme=modern] .eb-player .eb-middle-bar__seek-btn:hover{background:hsla(0,0%,100%,.24)}[data-theme=modern] .eb-player .eb-seek-circle{fill:#fff;stroke:none;height:18px;width:18px}[data-theme=modern] .eb-player .eb-seek-label{color:hsla(0,0%,100%,.9);font-size:.58em;font-weight:700;line-height:1}[data-theme=modern] .eb-player .eb-button,[data-theme=modern] .eb-player .eb-cast,[data-theme=modern] .eb-player .eb-fullscreen,[data-theme=modern] .eb-player .eb-live-sync,[data-theme=modern] .eb-player .eb-pip,[data-theme=modern] .eb-player .eb-play-pause,[data-theme=modern] .eb-player .eb-volume-mute{border-radius:8px;color:hsla(0,0%,100%,.82);flex-shrink:0;height:38px;transition:background .15s,color .15s,transform .1s;width:38px}[data-theme=modern] .eb-player .eb-button:hover,[data-theme=modern] .eb-player .eb-cast:hover,[data-theme=modern] .eb-player .eb-fullscreen:hover,[data-theme=modern] .eb-player .eb-live-sync:hover,[data-theme=modern] .eb-player .eb-pip:hover,[data-theme=modern] .eb-player .eb-play-pause:hover,[data-theme=modern] .eb-player .eb-volume-mute:hover{background:hsla(0,0%,100%,.12);color:#fff}[data-theme=modern] .eb-player .eb-button:active,[data-theme=modern] .eb-player .eb-cast:active,[data-theme=modern] .eb-player .eb-fullscreen:active,[data-theme=modern] .eb-player .eb-live-sync:active,[data-theme=modern] .eb-player .eb-pip:active,[data-theme=modern] .eb-player .eb-play-pause:active,[data-theme=modern] .eb-player .eb-volume-mute:active{transform:scale(.88)}[data-theme=modern] .eb-player .eb-seekbar-track{background:hsla(0,0%,100%,.22);border-radius:3px;height:3px;transition:height .15s}[data-theme=modern] .eb-player .eb-seekbar:hover .eb-seekbar-track{height:5px}[data-theme=modern] .eb-player .eb-seekbar-buffered{background:hsla(0,0%,100%,.28);border-radius:3px;transition:height .15s}[data-theme=modern] .eb-player .eb-seekbar-progress{background:linear-gradient(90deg,#a78bfa,#7c3aed);border-radius:3px;transition:height .15s}[data-theme=modern] .eb-player .eb-seekbar-thumb{background:#fff;box-shadow:0 0 0 3px rgba(124,58,237,.45);height:14px;right:-7px;width:14px}[data-theme=modern] .eb-player .eb-seekbar-tooltip{background:rgba(0,0,0,.82);border-radius:5px;bottom:24px;font-size:11px;padding:3px 7px}[data-theme=modern] .eb-player .eb-seekbar-preview{background:#111;border:2px solid hsla(0,0%,100%,.16);border-radius:6px;height:72px;width:128px}[data-theme=modern] .eb-player .eb-chapter-marker{background:rgba(0,0,0,.45);border-radius:1px;height:7px;top:50%;transform:translate(-50%,-50%);width:2px}[data-theme=modern] .eb-player .eb-volume-control{flex-direction:row;gap:0;margin-right:0}[data-theme=modern] .eb-player .eb-volume-track{background:hsla(0,0%,100%,.22);border-radius:3px;height:3px;margin:0;overflow:hidden;transition:width .25s ease,margin .25s ease;width:0}[data-theme=modern] .eb-player .eb-volume-control:focus-within .eb-volume-track,[data-theme=modern] .eb-player .eb-volume-control:hover .eb-volume-track{margin:0 6px 0 2px;width:66px}[data-theme=modern] .eb-player .eb-volume-fill{background:var(--eb-color-primary,#7c3aed)}[data-theme=modern] .eb-player .eb-volume-thumb{background:#fff;box-shadow:0 0 0 2px hsla(0,0%,100%,.35);height:11px;transform:translate(-50%,-50%) scale(0);transition:transform .15s;width:11px}[data-theme=modern] .eb-player .eb-volume-control:hover .eb-volume-thumb{transform:translate(-50%,-50%) scale(1)}[data-theme=modern] .eb-player .eb-time-display{color:hsla(0,0%,100%,.6);font-size:12px;letter-spacing:.02em}[data-theme=modern] .eb-player .eb-live-sync{border-radius:6px;font-size:11px;font-weight:700;height:auto;letter-spacing:.08em;padding:4px 10px;text-transform:uppercase;width:auto}[data-theme=modern] .eb-player .eb-live-synced{background:rgba(220,38,38,.9);box-shadow:0 2px 8px rgba(220,38,38,.4);color:#fff}[data-theme=modern] .eb-player .eb-settings-panel{backdrop-filter:blur(18px) saturate(160%);-webkit-backdrop-filter:blur(18px) saturate(160%);background:rgba(10,10,20,.55);border-radius:12px;box-shadow:0 16px 48px rgba(0,0,0,.6),0 0 0 1px hsla(0,0%,100%,.1);min-width:280px}[data-theme=modern] .eb-player .eb-settings-menu{padding:0}[data-theme=modern] .eb-player .eb-settings-back,[data-theme=modern] .eb-player .eb-settings-category,[data-theme=modern] .eb-player .eb-settings-item{border-bottom:1px solid hsla(0,0%,100%,.06);color:hsla(0,0%,100%,.9);font-size:13px;padding:15px 20px;transition:background .12s}[data-theme=modern] .eb-player .eb-settings-category:last-child,[data-theme=modern] .eb-player .eb-settings-item:last-child{border-bottom:none}[data-theme=modern] .eb-player .eb-settings-back:hover,[data-theme=modern] .eb-player .eb-settings-category:hover,[data-theme=modern] .eb-player .eb-settings-item:hover{background:hsla(0,0%,100%,.05)}[data-theme=modern] .eb-player .eb-settings-item--selected{color:#fff;font-weight:500}[data-theme=modern] .eb-player .eb-settings-item--selected:after{background:#1a73e8;border-radius:50%;box-shadow:0 0 0 3px rgba(26,115,232,.25);content:"";flex-shrink:0;height:10px;width:10px}[data-theme=modern] .eb-player .eb-settings-item:not(.eb-settings-item--selected):after{border:2px solid hsla(0,0%,100%,.2);border-radius:50%;content:"";flex-shrink:0;height:10px;width:10px}[data-theme=modern] .eb-player .eb-settings-back{font-weight:600;gap:14px}[data-theme=modern] .eb-player .eb-loading .eb-icon{color:hsla(0,0%,100%,.7)}[data-theme=modern] .eb-player .eb-error{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.85)}[data-theme=modern] .eb-player .eb-error-retry{background:hsla(0,0%,100%,.1);border-color:hsla(0,0%,100%,.15);border-radius:8px;transition:background .2s,color .2s}[data-theme=modern] .eb-player .eb-error-retry:hover{background:hsla(0,0%,100%,.18)}[data-theme=modern] .eb-player .eb-toast{backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);background:rgba(0,0,0,.72);border-radius:10px;font-size:13px}[data-theme=modern] .eb-player .eb-info-overlay,[data-theme=modern] .eb-player .eb-socials-overlay{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.85)}[data-theme=modern] .eb-player .eb-info-close,[data-theme=modern] .eb-player .eb-socials-close{background:hsla(0,0%,100%,.07);border-color:hsla(0,0%,100%,.08);border-radius:8px;transition:background .2s,color .2s}[data-theme=modern] .eb-player .eb-info-close:hover,[data-theme=modern] .eb-player .eb-socials-close:hover{background:hsla(0,0%,100%,.13);color:#fff}[data-theme=modern] .eb-player .eb-socials-link{background:hsla(0,0%,100%,.07);border:1px solid hsla(0,0%,100%,.08);border-radius:8px;transition:background .2s,color .2s}[data-theme=modern] .eb-player .eb-socials-link:hover{background:rgba(167,139,250,.15);border-color:rgba(167,139,250,.35);color:#c4b5fd}[data-theme=modern] .eb-player .eb-bottom-bar__controls-row{flex-wrap:wrap}[data-theme=modern] .eb-player .eb-bottom-bar__seekbar-zone{flex:none;margin-bottom:-6px;order:-1;width:100%}[data-theme=modern] .eb-player .eb-slot-time{margin-left:auto;order:-1}[data-theme=modern] .eb-player .eb-slot-live-sync{order:-2}[data-theme=modern] .eb-player .eb-slot-settings{margin-left:auto}[data-theme=modern] .eb-player .eb-poster{background:linear-gradient(135deg,#0f0c29,#302b63,#24243e)}');i("[data-theme=radio] .eb-player{--eb-color-primary:#f4a261;--eb-color-background:rgba(20,20,30,.95)}");i("[data-theme=snrt] .eb-player{--eb-color-primary:#063;--eb-color-background:rgba(0,0,0,.9)}");i('@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");[data-theme=v2] .eb-player{--eb-color-primary:#ff841f;--eb-color-progress:#ff841f;--eb-color-background:rgba(10,10,20,.85);--eb-accent:#ff841f;--eb-color-text:#fff;--eb-font-family:"Inter",-apple-system,sans-serif;--eb-font-size-base:14px;--eb-radius-control:8px;--eb-duration-transition:200ms;border-radius:14px;box-shadow:0 40px 80px rgba(0,0,0,.8),0 0 0 1px hsla(0,0%,100%,.06);color:#fff;font-family:Inter,-apple-system,sans-serif}[data-theme=v2] .eb-player .eb-icon{stroke-width:2.5}[data-theme=v2] .eb-player:-webkit-full-screen,[data-theme=v2] .eb-player:fullscreen{border-radius:0;box-shadow:none}[data-theme=v2] .eb-player .eb-top-bar{background:linear-gradient(180deg,rgba(0,0,0,.72),transparent);gap:6px;height:110px;padding:14px 16px}[data-theme=v2] .eb-player .eb-bottom-bar__gradient{background:linear-gradient(0deg,rgba(0,0,0,.9),transparent);height:150px}[data-theme=v2] .eb-player.eb-controls-visible .eb-top-bar{opacity:1;transform:translateY(0);transition:opacity .3s,transform .3s}[data-theme=v2] .eb-player.eb-controls-hidden .eb-top-bar{opacity:0;transform:translateY(-6px);transition:opacity .3s,transform .3s}[data-theme=v2] .eb-player .eb-top-bar__actions{gap:6px}[data-theme=v2] .eb-player .eb-top-bar__logo{max-height:32px;max-width:120px;opacity:.85}[data-theme=v2] .eb-player .eb-bottom-bar__controls-row{gap:8px;padding:0 14px 12px}[data-theme=v2] .eb-player.eb-controls-visible .eb-bottom-bar{opacity:1;transform:translateY(0);transition:opacity .3s,transform .3s}[data-theme=v2] .eb-player.eb-controls-hidden .eb-bottom-bar{opacity:0;transform:translateY(8px);transition:opacity .3s,transform .3s}[data-theme=v2] .eb-player .eb-middle-bar{gap:28px}[data-theme=v2] .eb-player.eb-controls-visible .eb-middle-bar{opacity:1;transition:opacity .3s}[data-theme=v2] .eb-player.eb-controls-hidden .eb-middle-bar{opacity:0;transition:opacity .3s}[data-theme=v2] .eb-player .eb-middle-bar__play-btn{align-items:center;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);background:hsla(0,0%,100%,.15);border:2px solid hsla(0,0%,100%,.25);border-radius:50%;color:#fff;display:flex;height:80px;justify-content:center;padding:0;transition:background .15s,transform .25s,opacity .25s;width:80px}[data-theme=v2] .eb-player .eb-middle-bar__play-btn:hover{background:hsla(0,0%,100%,.25)}[data-theme=v2] .eb-player .eb-middle-bar__play-btn:active{transform:scale(.92)}[data-theme=v2] .eb-player .eb-middle-bar__play-btn .eb-icon{stroke-width:2.5;height:32px;width:32px}[data-theme=v2] .eb-player .eb-middle-bar__seek-btn{align-items:center;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);background:hsla(0,0%,100%,.15);border:2px solid hsla(0,0%,100%,.25);border-radius:50%;color:#fff;display:flex;flex-direction:column;gap:1px;height:56px;justify-content:center;padding:0;transition:background .15s;width:56px}[data-theme=v2] .eb-player .eb-middle-bar__seek-btn:hover{background:hsla(0,0%,100%,.25)}[data-theme=v2] .eb-player .eb-seek-circle{fill:currentColor;stroke:none;color:hsla(0,0%,100%,.85);height:24px;width:24px}[data-theme=v2] .eb-player .eb-seek-label{color:hsla(0,0%,100%,.9);font-size:.75em;font-weight:700;line-height:1}[data-theme=v2] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn),[data-theme=v2] .eb-player .eb-cast,[data-theme=v2] .eb-player .eb-fullscreen,[data-theme=v2] .eb-player .eb-live-sync,[data-theme=v2] .eb-player .eb-pip,[data-theme=v2] .eb-player .eb-play-pause,[data-theme=v2] .eb-player .eb-volume-mute{border-radius:8px;color:hsla(0,0%,100%,.82);flex-shrink:0;height:38px;transition:background .15s,color .15s,transform .1s;width:38px}[data-theme=v2] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn):hover,[data-theme=v2] .eb-player .eb-cast:hover,[data-theme=v2] .eb-player .eb-fullscreen:hover,[data-theme=v2] .eb-player .eb-live-sync:hover,[data-theme=v2] .eb-player .eb-pip:hover,[data-theme=v2] .eb-player .eb-play-pause:hover,[data-theme=v2] .eb-player .eb-volume-mute:hover{background:hsla(0,0%,100%,.12);color:#fff}[data-theme=v2] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn):active,[data-theme=v2] .eb-player .eb-cast:active,[data-theme=v2] .eb-player .eb-fullscreen:active,[data-theme=v2] .eb-player .eb-live-sync:active,[data-theme=v2] .eb-player .eb-pip:active,[data-theme=v2] .eb-player .eb-play-pause:active,[data-theme=v2] .eb-player .eb-volume-mute:active{transform:scale(.88)}[data-theme=v2] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn) .eb-icon,[data-theme=v2] .eb-player .eb-cast .eb-icon,[data-theme=v2] .eb-player .eb-fullscreen .eb-icon,[data-theme=v2] .eb-player .eb-pip .eb-icon,[data-theme=v2] .eb-player .eb-play-pause .eb-icon,[data-theme=v2] .eb-player .eb-volume-mute .eb-icon{height:22px;width:22px}[data-theme=v2] .eb-player .eb-top-bar .eb-icon{height:24px;width:24px}[data-theme=v2] .eb-player .eb-middle-bar__play-btn .eb-icon,[data-theme=v2] .eb-player .eb-play-pause .eb-icon{fill:currentColor;stroke:none}[data-theme=v2] .eb-player .eb-volume-mute .eb-icon path:first-child{fill:currentColor}[data-theme=v2] .eb-player .eb-cast-active{background:rgba(30,182,212,.15)!important;color:#1eb6d4!important}[data-theme=v2] .eb-player .eb-cast-active .eb-icon{filter:drop-shadow(0 0 4px rgba(30,182,212,.6))}[data-theme=v2] .eb-player .eb-seekbar-track{background:hsla(0,0%,100%,.22);border-radius:3px;height:3px;transition:height .15s}[data-theme=v2] .eb-player .eb-seekbar:hover .eb-seekbar-track{height:5px}[data-theme=v2] .eb-player .eb-seekbar-buffered{background:hsla(0,0%,100%,.28);border-radius:3px;transition:height .15s}[data-theme=v2] .eb-player .eb-seekbar-progress{background:linear-gradient(90deg,#ff841f,color-mix(in srgb,#ff841f 70%,#fff));border-radius:3px;transition:height .15s}[data-theme=v2] .eb-player .eb-seekbar-thumb{background:#fff;box-shadow:0 0 0 3px rgba(255,132,31,.45);height:14px;right:-7px;width:14px}[data-theme=v2] .eb-player .eb-seekbar-tooltip{align-items:center;background:rgba(0,0,0,.88);border:1px solid hsla(0,0%,100%,.12);border-radius:7px;bottom:28px;box-shadow:0 4px 16px rgba(0,0,0,.5);display:flex;flex-direction:column;font-size:11px;font-weight:500;overflow:hidden;padding:0}[data-theme=v2] .eb-player .eb-seekbar-preview{background:#111;border:none;border-radius:0;height:90px;margin:0;width:160px}[data-theme=v2] .eb-player .eb-chapter-marker{background:rgba(0,0,0,.45);border-radius:1px;height:7px;top:50%;transform:translate(-50%,-50%);width:2px}[data-theme=v2] .eb-player .eb-volume-control{flex-direction:row;gap:0;margin-right:0}[data-theme=v2] .eb-player .eb-volume-track{background:hsla(0,0%,100%,.22);border-radius:3px;height:3px;margin:0;overflow:hidden;transition:width .25s ease,margin .25s ease;width:0}[data-theme=v2] .eb-player .eb-volume-control:focus-within .eb-volume-track,[data-theme=v2] .eb-player .eb-volume-control:hover .eb-volume-track{margin:0 6px 0 2px;width:66px}[data-theme=v2] .eb-player .eb-volume-fill{background:var(--eb-color-primary,#ff841f)}[data-theme=v2] .eb-player .eb-volume-thumb{background:#fff;box-shadow:0 0 0 2px hsla(0,0%,100%,.35);height:11px;transform:translate(-50%,-50%) scale(0);transition:transform .15s;width:11px}[data-theme=v2] .eb-player .eb-volume-control:hover .eb-volume-thumb{transform:translate(-50%,-50%) scale(1)}[data-theme=v2] .eb-player .eb-time-display{color:hsla(0,0%,100%,.85);font-size:13px;font-weight:500;letter-spacing:.02em}[data-theme=v2] .eb-player .eb-live-sync{border-radius:6px;font-size:11px;font-weight:700;gap:5px;height:auto;letter-spacing:.08em;padding:4px 10px;text-transform:uppercase;width:auto}[data-theme=v2] .eb-player .eb-live-sync__icon{display:none}[data-theme=v2] .eb-player .eb-live-sync__dot{background:#fff;border-radius:50%;display:block;flex-shrink:0;height:6px;width:6px}[data-theme=v2] .eb-player .eb-live-sync__label{display:block}[data-theme=v2] .eb-player .eb-live-synced{background:rgba(220,38,38,.9);box-shadow:0 2px 8px rgba(220,38,38,.4);color:#fff}[data-theme=v2] .eb-player .eb-live-synced .eb-live-sync__dot{animation:eb-v2-blink 1.2s ease infinite}[data-theme=v2] .eb-player .eb-live-sync:not(.eb-live-synced){background:rgba(60,60,80,.75);box-shadow:none;color:hsla(0,0%,100%,.7)}[data-theme=v2] .eb-player .eb-live-sync:not(.eb-live-synced) .eb-live-sync__dot{animation:none;background:hsla(0,0%,100%,.5)}[data-theme=v2] .eb-player .eb-live-sync:not(.eb-live-synced):hover{background:rgba(220,38,38,.7);color:#fff}@keyframes eb-v2-blink{0%,to{opacity:1}50%{opacity:.15}}[data-theme=v2] .eb-player .eb-settings-panel{backdrop-filter:blur(18px) saturate(160%);-webkit-backdrop-filter:blur(18px) saturate(160%);background:rgba(10,10,20,.55);border-radius:12px;box-shadow:0 16px 48px rgba(0,0,0,.6),0 0 0 1px hsla(0,0%,100%,.1);min-width:300px}[data-theme=v2] .eb-player .eb-settings-menu{padding:0}[data-theme=v2] .eb-player .eb-settings-back,[data-theme=v2] .eb-player .eb-settings-category,[data-theme=v2] .eb-player .eb-settings-item{border-bottom:1px solid hsla(0,0%,100%,.06);color:hsla(0,0%,100%,.9);font-size:13px;padding:15px 20px;transition:background .12s}[data-theme=v2] .eb-player .eb-settings-category:last-child,[data-theme=v2] .eb-player .eb-settings-item:last-child{border-bottom:none}[data-theme=v2] .eb-player .eb-settings-back:hover,[data-theme=v2] .eb-player .eb-settings-category:hover,[data-theme=v2] .eb-player .eb-settings-item:hover{background:hsla(0,0%,100%,.05)}[data-theme=v2] .eb-player .eb-settings-item--selected{color:#fff;font-weight:500}[data-theme=v2] .eb-player .eb-settings-item--selected:after{background:var(--eb-accent,#ff841f);border-radius:50%;box-shadow:0 0 0 3px rgba(255,132,31,.25);content:"";flex-shrink:0;height:10px;width:10px}[data-theme=v2] .eb-player .eb-settings-item:not(.eb-settings-item--selected):after{border:2px solid hsla(0,0%,100%,.2);border-radius:50%;content:"";flex-shrink:0;height:10px;width:10px}[data-theme=v2] .eb-player .eb-settings-back{font-weight:600;gap:14px}[data-theme=v2] .eb-player .eb-loading .eb-icon{animation:eb-spin .75s linear infinite;color:hsla(0,0%,100%,.7);filter:drop-shadow(0 1px 6px rgba(0,0,0,.5));height:52px;width:52px}[data-theme=v2] .eb-player .eb-error{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.85)}[data-theme=v2] .eb-player .eb-error-message{font-weight:400;letter-spacing:.01em}[data-theme=v2] .eb-player .eb-error-retry{background:hsla(0,0%,100%,.1);border-color:hsla(0,0%,100%,.15);border-radius:8px;transition:background .2s,color .2s}[data-theme=v2] .eb-player .eb-error-retry:hover{background:hsla(0,0%,100%,.18)}[data-theme=v2] .eb-player .eb-toast{backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);background:rgba(0,0,0,.72);border-radius:10px;font-size:13px;padding:8px 16px}[data-theme=v2] .eb-player .eb-info-overlay,[data-theme=v2] .eb-player .eb-socials-overlay{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.85)}[data-theme=v2] .eb-player .eb-info-close,[data-theme=v2] .eb-player .eb-socials-close{background:hsla(0,0%,100%,.07);border-color:hsla(0,0%,100%,.08);border-radius:8px;transition:background .2s,color .2s}[data-theme=v2] .eb-player .eb-info-close:hover,[data-theme=v2] .eb-player .eb-socials-close:hover{background:hsla(0,0%,100%,.13);color:#fff}[data-theme=v2] .eb-player .eb-socials-link{background:hsla(0,0%,100%,.07);border:1px solid hsla(0,0%,100%,.08);border-radius:8px;transition:background .2s,color .2s,border-color .2s}[data-theme=v2] .eb-player .eb-socials-link:hover{background:rgba(255,132,31,.15);border-color:rgba(255,132,31,.35);color:#ffb980}[data-theme=v2] .eb-player .eb-poster,[data-theme=v2] .eb-player .eb-radio-overlay{background:linear-gradient(135deg,#0f0c29,#302b63,#24243e)}[data-theme=v2] .eb-player .eb-radio-bar{background:rgba(255,132,31,.8)}[data-theme=v2] .eb-player .eb-chapter-skip{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.55);border:1px solid hsla(0,0%,100%,.15);border-radius:8px;font-size:12px;font-weight:500;transition:background .15s}[data-theme=v2] .eb-player .eb-chapter-skip:hover{background:hsla(0,0%,100%,.12)}');i(".eb-player{background:#000;box-sizing:border-box;color:#fff;font-family:sans-serif;height:100%;overflow:hidden;position:relative;user-select:none;width:100%}.eb-player video.eb-video{display:block;filter:brightness(1);height:100%;left:0;object-fit:contain;position:absolute;top:0;width:100%;z-index:1}.eb-overlay-zone{align-items:center;display:flex;justify-content:center;z-index:10}.eb-overlay-zone,.eb-poster{inset:0;pointer-events:none;position:absolute}.eb-poster{background:#000;box-sizing:border-box;height:100%;object-fit:contain;padding:15%;width:100%}.eb-ads-container{inset:0;pointer-events:none;position:absolute;z-index:20}.eb-top-bar{align-items:center;background:linear-gradient(180deg,rgba(0,0,0,.6),transparent);display:flex;flex-direction:row;justify-content:space-between;left:0;padding:8px 12px;pointer-events:auto;position:absolute;right:0;top:0;z-index:30}.eb-top-bar__logo{display:block;height:28px;width:auto}.eb-top-bar__logo-link{display:inline-flex;text-decoration:none}.eb-top-bar__actions{align-items:center;display:flex;gap:4px;margin-left:auto}.eb-bottom-bar{display:flex;flex-direction:column;pointer-events:auto;z-index:30}.eb-bottom-bar,.eb-bottom-bar__gradient{bottom:0;left:0;position:absolute;right:0}.eb-bottom-bar__gradient{background:linear-gradient(0deg,rgba(0,0,0,.7),transparent);height:100px;pointer-events:none;z-index:-1}.eb-bottom-bar__controls-row{align-items:center;display:flex;flex-direction:row;gap:4px;padding:4px 8px 8px}.eb-bottom-bar__seekbar-zone{flex:1;min-width:0}.eb-middle-bar{align-items:center;display:flex;gap:16px;left:50%;pointer-events:auto;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:25}.eb-middle-bar__play-btn{align-items:center;background:rgba(0,0,0,.5);border-radius:50%;display:flex;height:64px;justify-content:center;width:64px}.eb-middle-bar__seek-btn{background:none;flex-direction:column;gap:2px;padding:4px}.eb-middle-bar__seek-btn:hover{background:hsla(0,0%,100%,.1);border-radius:8px}.eb-seek-circle{fill:currentColor;display:block;height:32px;pointer-events:none;width:32px}.eb-seek-label{font-size:11px;font-weight:600;line-height:1;opacity:.85}.eb-extension-bottom-extra,.eb-extension-controls-extra,.eb-extension-overlay,.eb-extension-top-extra{pointer-events:none;position:absolute;z-index:35}.eb-extension-bottom-extra>*,.eb-extension-controls-extra>*,.eb-extension-overlay>*,.eb-extension-top-extra>*{pointer-events:auto}.eb-extension-top-extra{left:0;right:0;top:0}.eb-extension-bottom-extra{bottom:0;left:0;right:0}.eb-extension-overlay{align-items:center;display:flex;inset:0;justify-content:center}.eb-extension-controls-extra{align-items:center;bottom:0;display:flex;gap:4px;padding:4px 8px 8px;right:0}.eb-time-display{color:#fff;font-size:13px;font-variant-numeric:tabular-nums;line-height:1;padding:0 4px;white-space:nowrap}.eb-volume-control{align-items:center;display:flex;gap:4px;margin-right:8px}.eb-volume-track{background:hsla(0,0%,100%,.2);border-radius:2px;cursor:pointer;height:4px;position:relative;width:60px}.eb-volume-fill{border-radius:2px;height:100%;left:0;top:0}.eb-volume-fill,.eb-volume-thumb{background:var(--eb-color-volume,var(--eb-color-primary,#fff));pointer-events:none;position:absolute}.eb-volume-thumb{border-radius:50%;height:10px;top:50%;transform:translate(-50%,-50%);width:10px}.eb-settings-wrapper{position:relative}.eb-settings-panel{background:rgba(0,0,0,.85);border-radius:6px;font-size:12px;max-width:220px;min-width:160px;overflow:hidden;position:absolute;z-index:40}.eb-settings-panel--up{bottom:calc(100% + 8px)}.eb-settings-panel--down{top:calc(100% + 8px)}.eb-settings-panel--right{right:0}.eb-settings-panel--left{left:0}.eb-settings-menu{list-style:none;margin:0;padding:4px 0}.eb-settings-submenu{max-height:200px;overflow-y:auto}.eb-settings-submenu::-webkit-scrollbar{width:4px}.eb-settings-submenu::-webkit-scrollbar-thumb{background:hsla(0,0%,100%,.3);border-radius:2px}.eb-settings-header{align-items:center;display:flex;gap:4px;padding:5px 12px}.eb-settings-category,.eb-settings-item{font-size:12px;justify-content:space-between;padding:5px 12px;text-align:left;width:100%}.eb-settings-back,.eb-settings-category,.eb-settings-item{align-items:center;background:none;border:none;color:#fff;cursor:pointer;display:flex}.eb-settings-back{padding:0}.eb-settings-category:hover,.eb-settings-item:hover{background:hsla(0,0%,100%,.1)}.eb-settings-item--selected{color:var(--eb-accent,var(--eb-color-primary,#e53935))}.eb-seekbar{cursor:pointer;padding:8px 0;position:relative;width:100%}.eb-seekbar-disabled{opacity:.4;pointer-events:none}.eb-seekbar-track{background:hsla(0,0%,100%,.2);border-radius:2px;height:4px;position:relative}.eb-seekbar-buffered{background:hsla(0,0%,100%,.4)}.eb-seekbar-buffered,.eb-seekbar-progress{border-radius:2px;height:100%;left:0;pointer-events:none;position:absolute;top:0}.eb-seekbar-progress,.eb-seekbar-thumb{background:var(--eb-color-progress,var(--eb-color-primary,#e53935))}.eb-seekbar-thumb{border-radius:50%;height:12px;pointer-events:none;position:absolute;right:-6px;top:50%;transform:translateY(-50%) scale(0);transition:transform .15s;width:12px}.eb-seekbar:hover .eb-seekbar-thumb{transform:translateY(-50%) scale(1)}.eb-seekbar:hover .eb-seekbar-track{height:6px}.eb-seekbar-tooltip{background:rgba(0,0,0,.8);border-radius:3px;bottom:calc(100% + 8px);color:#fff;font-size:12px;overflow:hidden;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;transform:translateX(-50%);white-space:nowrap;z-index:50}.eb-seekbar-preview{background:#000;border:none!important;display:block!important;height:68px;inset:auto!important;margin:0!important;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;object-fit:contain;padding:0!important;position:static!important;transform:none!important;width:120px;z-index:auto!important}.eb-chapter-marker{background:hsla(0,0%,100%,.6);height:100%;pointer-events:none;position:absolute;top:0;transform:translateX(-50%);width:3px}.eb-chapter-marker.eb-chapter-active{background:#fff}.eb-chapter-skip{background:rgba(0,0,0,.7);border:1px solid hsla(0,0%,100%,.4);border-radius:4px;bottom:calc(100% + 4px);color:#fff;cursor:pointer;font-size:13px;padding:6px 16px;position:absolute;right:0}.eb-chapter-skip:hover{background:hsla(0,0%,100%,.2)}.eb-epg-segment{border-right:1px solid hsla(0,0%,100%,.3);height:100%;pointer-events:none;position:absolute;top:0}.eb-epg-segment.eb-epg-current{background:hsla(0,0%,100%,.1)}.eb-icon{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;display:block;flex-shrink:0;height:20px;pointer-events:none;width:20px}.eb-button,.eb-cast,.eb-fullscreen,.eb-live-sync,.eb-pip,.eb-play-pause,.eb-volume-mute{-webkit-tap-highlight-color:transparent;align-items:center;background:none;border:none;border-radius:4px;color:var(--eb-color-icon,inherit);cursor:pointer;display:flex;justify-content:center;padding:6px;transition:background .15s}.eb-button:hover,.eb-cast:hover,.eb-fullscreen:hover,.eb-live-sync:hover,.eb-pip:hover,.eb-play-pause:hover,.eb-volume-mute:hover{background:hsla(0,0%,100%,.15)}.eb-button:active,.eb-cast:active,.eb-fullscreen:active,.eb-live-sync:active,.eb-pip:active,.eb-play-pause:active,.eb-volume-mute:active{background:hsla(0,0%,100%,.25)}.eb-radio-overlay{align-items:center;background:#000;display:flex;inset:0;justify-content:center;position:absolute;z-index:15}.eb-radio-bars{align-items:flex-end;display:flex;gap:4px;height:40px}.eb-radio-bar{animation:eb-radio-bar-bounce .8s ease-in-out infinite;background:#fff;border-radius:3px;display:block;width:6px}.eb-radio-bar:first-child{animation-delay:0s;height:20px}.eb-radio-bar:nth-child(2){animation-delay:.1s;height:32px}.eb-radio-bar:nth-child(3){animation-delay:.2s;height:40px}.eb-radio-bar:nth-child(4){animation-delay:.3s;height:28px}.eb-radio-bar:nth-child(5){animation-delay:.4s;height:16px}@keyframes eb-radio-bar-bounce{0%,to{opacity:.7;transform:scaleY(.4)}50%{opacity:1;transform:scaleY(1)}}.eb-live-sync[hidden]{display:none}.eb-live-synced{color:var(--eb-accent,var(--eb-color-primary,#e53935))}.eb-live-sync__dot,.eb-live-sync__label{display:none}.eb-error-slot,.eb-info-slot,.eb-socials-slot{inset:0;pointer-events:none;position:absolute;z-index:50}.eb-toast-slot{bottom:60px;left:50%;pointer-events:none;position:absolute;transform:translateX(-50%);z-index:50}.eb-toast{background:rgba(0,0,0,.8);border-radius:4px;color:#fff;font-size:13px;padding:8px 20px;pointer-events:auto;white-space:nowrap}.eb-error,.eb-info-overlay,.eb-socials-overlay{align-items:center;background:rgba(0,0,0,.75);color:#fff;display:flex;flex-direction:column;inset:0;justify-content:center;padding:24px;pointer-events:auto;position:absolute;text-align:center;z-index:50}.eb-error[hidden],.eb-info-overlay[hidden],.eb-socials-overlay[hidden]{display:none}.eb-error-message{font-size:16px;margin:0 0 16px}.eb-error-retry{background:hsla(0,0%,100%,.15);border:1px solid hsla(0,0%,100%,.3);border-radius:4px;color:#fff;cursor:pointer;font-size:14px;padding:8px 24px}.eb-error-retry:hover{background:hsla(0,0%,100%,.25)}.eb-info-content{font-size:14px;line-height:1.5;margin-bottom:16px;max-width:400px}.eb-info-close,.eb-socials-close{background:hsla(0,0%,100%,.15);border:1px solid hsla(0,0%,100%,.3);border-radius:4px;color:#fff;cursor:pointer;font-size:14px;padding:8px 24px}.eb-info-close:hover,.eb-socials-close:hover{background:hsla(0,0%,100%,.25)}.eb-socials-links{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;margin-bottom:16px}.eb-socials-link{background:hsla(0,0%,100%,.1);border-radius:4px;color:#fff;font-size:14px;padding:8px 16px;text-decoration:none;text-transform:capitalize}.eb-socials-link:hover{background:hsla(0,0%,100%,.25)}.eb-loading{align-items:center;color:#fff;display:flex;flex-direction:column;gap:8px;justify-content:center;pointer-events:none}.eb-loading[hidden]{display:none}.eb-loading .eb-icon{animation:eb-spin 1s linear infinite;height:40px;width:40px}.eb-loading-text{font-size:14px}@keyframes eb-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.eb-controls-visible .eb-bottom-bar,.eb-controls-visible .eb-middle-bar,.eb-controls-visible .eb-top-bar{opacity:1;transition:opacity .3s}.eb-controls-hidden .eb-bottom-bar,.eb-controls-hidden .eb-middle-bar,.eb-controls-hidden .eb-top-bar{opacity:0;pointer-events:none;transition:opacity .3s}.eb-ios-native .eb-bottom-bar,.eb-ios-native .eb-error-slot,.eb-ios-native .eb-info-slot,.eb-ios-native .eb-middle-bar,.eb-ios-native .eb-overlay-zone,.eb-ios-native .eb-socials-slot,.eb-ios-native .eb-toast-slot,.eb-ios-native .eb-top-bar{display:none}[dir=rtl] .eb-bottom-bar__controls-row,[dir=rtl] .eb-top-bar{flex-direction:row-reverse}.eb-player,.eb-player video.eb-video{max-height:100%;max-width:100%}");const r={idle:["loading"],loading:["playing","buffering","paused","error","idle"],playing:["paused","buffering","ended","error","idle"],paused:["playing","loading","idle"],buffering:["playing","paused","idle","error"],error:["loading","idle"],ended:["loading","idle"]};class s{constructor(){this.listeners=new Map}on(e,t,i){this.listeners.has(e)||this.listeners.set(e,new Set);const r=this.listeners.get(e);r.add(t);const s=i?.signal;if(void 0!==s){const e=()=>{r.delete(t)};s.addEventListener("abort",e,{once:!0})}}notify(e,t,i){const r=this.listeners.get(e);if(void 0!==r)for(const e of r)e(t,i)}}const a={playbackState:"idle",volume:1,currentTime:0,duration:0,muted:!1,bufferedEnd:0,isLive:!1,qualityLevels:[],currentQuality:-1,audioTracks:[],currentAudioTrack:-1,subtitleTracks:[],currentSubtitleTrack:-1,playbackRate:1,error:null,src:"",isFullscreen:!1,isPip:!1,isCasting:!1,controlsVisible:!0,settingsOpen:!1,socialsOpen:!1,infoOpen:!1,adPlaying:!1,castAvailable:!1,isRtl:!1,isRadio:!1,isIOS:!1,isSyncWithLive:!1,epgPrograms:[],epgFetchedAt:0,chapters:[],playlist:[],currentEpisode:-1,reconnecting:!1,toast:null};function n(e){const t={...a,...e},i=new s;return new Proxy(t,{get:(e,t)=>"on"===t?i.on.bind(i):e[t],set(e,t,s){const a=t;if(!function(e){if(null==e||"object"!=typeof e)return!0;if(Array.isArray(e))return!0;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(s))throw new TypeError(`PlayerState: cannot assign a non-plain object (class instance) to "${String(t)}". Only primitives, plain objects, arrays, null, and undefined are allowed. Driver instances (hls.js, dash.js) must never enter the state store.`);if("playbackState"===a){const t=e.playbackState,i=s;if(n=i,!r[t].includes(n))return console.warn(`FSM: rejected playbackState transition "${t}" → "${i}"`),!0}var n;const o=e[a];return o===s||(e[String(a)]=s,i.notify(a,s,o)),!0}})}class o{constructor(){this.listeners=new Map}on(e,t,i){const r=i?.signal;if(!0===r?.aborted)return;this.listeners.has(e)||this.listeners.set(e,new Set);const s=this.listeners.get(e),a=t;s.add(a),void 0!==r&&r.addEventListener("abort",()=>{s.delete(a)},{once:!0})}emit(...e){const[t,i]=e,r=this.listeners.get(t);if(void 0!==r&&0!==r.size)for(const e of r)void 0!==i?e(i):e()}dispose(){this.listeners.clear()}}const l={topBar:{left:[],right:["share","info"]},bottomBar:{left:["play-pause","volume"],center:["seekbar"],right:["time","live-sync","settings","pip","cast","fullscreen"]},middleBar:{left:["rewind"],center:[],right:["forward"]}},d=[{value:"default",label:"Default"},{value:"forja",label:"Forja",primaryColor:"#FC013B"},{value:"radio",label:"Radio",primaryColor:"#F4A261"},{value:"snrt",label:"SNRT",primaryColor:"#006633"},{value:"modern",label:"Modern",primaryColor:"#7c3aed"},{value:"v2",label:"V2",primaryColor:"#ff841f"},{value:"lequipe",label:"L'Equipe",primaryColor:"#d61e00"}],c={topBar:{left:[],right:["settings","pip","cast"]},bottomBar:{left:["play-pause","live-sync","time"],center:["seekbar"],right:["volume","fullscreen"]},middleBar:{left:["rewind"],center:[],right:["forward"]}},h={v2:c,lequipe:{topBar:{left:[],right:["pip","settings"]},bottomBar:{left:["play-pause","live-sync","time"],center:["seekbar"],right:["volume","fullscreen"]},middleBar:{left:["rewind"],center:[],right:["forward"]}},modern:c};function b(e){const t=(e.skin?h[e.skin]:void 0)??l;return e.layout??t}const u={template:"",el:"#eb_player",skin:"default",start:!0,forceAutoplayAudio:!1,style:void 0,css:"",dashjs:"https://reference.dashif.org/dash.js/v4.7.4/dist/dash.all.min.js",hlsjs:"https://cdn.jsdelivr.net/npm/hls.js@1.6.10/dist/hls.min.js",engineSettings:{liveSyncDurationCount:8},chromecast:"https://cdnjs.cloudflare.com/ajax/libs/castjs/5.3.0/cast.min.js",chromecastApp:void 0,chromecastMetadata:void 0,src:void 0,autoplay:!0,muted:!0,image:!1,loop:!1,startAt:void 0,loading:!0,logo:void 0,logoLink:void 0,logoPositions:["top-left"],about:"Powered by EasyBroadcast.",primaryColor:"#1FA9DD",skinColor:"",skinColors:{general:"",progressBar:"",volumeBar:""},socials:!1,customSocialsShare:!1,seekbar:!0,middlebar:!0,pip:!0,retry:!0,lowLatency:!1,ad:void 0,radio:!1,token:void 0,tokenType:void 0,srcInTokenRequest:!1,defaultAudio:void 0,defaultSubtitle:void 0,forceAutoplay:!1,forceQuality:!1,liveButton:!1,syncLiveMargin:300,isLive:void 0,noUi:!1,preroll:!1,prerollSkip:1/0,prerollLink:!1,posterStream:!1,speed:!0,chapters:null,skippableChapters:[],seekOffset:15,supportHotKeys:!1,useGeoblockingErrorHandle:!1,extraParamsCallback:void 0,licenseXhrSetup:void 0,volume:1,lib:void 0,manager:"wss://manager.kube.easybroadcast.fr/easybroadcast/Xc152ogNOWvOZSH",stats:"https://stats.easybroadcast.fr",origin:"easybroadcast",content:void 0,libSettings:{resourceManager:{timeoutV2V:4500,storageSize:300,randomWaitForPeers:[1e3,3e3],partialRequest:!0,setEnableV2V:!0}},hasPlaylistPicker:!1,disableCustomAbr:!1,lang:void 0,epgContentId:void 0,epgPolling:null,epgDefaultLang:"en",showEpgTitlePreview:!1,showProgressThumb:!1,layout:void 0};function p(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function m(e,t){if("function"==typeof t)return t;if(Array.isArray(t))return[...t];if(p(t)&&p(e)){const i={};for(const t of Object.keys(e))i[t]=e[t];for(const r of Object.keys(t))i[r]=m(e[r],t[r]);return i}if(p(t)){const e={};for(const i of Object.keys(t))e[i]=m(void 0,t[i]);return e}return void 0!==t?t:e}function g(...e){let t={};for(const i of e)null!=i&&(t=m(t,i));return t}const f=["en","fr","ar","es"],v={"error.start":{en:"An error occurred while trying to start the video.",fr:"Une erreur est survenue lors de la tentative de demarrage de la video.",ar:"An error occurred while trying to start the video.",es:"Ocurrió un error al intentar iniciar el video."},"loading.reconnecting":{en:"Reconnecting...",fr:"Reconnexion...",ar:"Reconnecting...",es:"Reconectando..."},"error.stream_unavailable":{en:"The stream is unavailable. Please try again later.",fr:"Le flux est indisponible. Veuillez réessayer plus tard.",ar:"The stream is unavailable. Please try again later.",es:"La transmisión no está disponible. Por favor, inténtelo más tarde."},"cast.failed":{en:"Casting failed. Resuming local playback.",fr:"La diffusion a échoué. Reprise de la lecture locale.",ar:"Casting failed. Resuming local playback.",es:"Error en la transmisión. Reanudando la reproducción local."},"settings.audio":{en:"Audio track",fr:"Piste audio",ar:"مسار صوتي",es:"Pista de audio"},"settings.subtitles":{en:"Subtitles",fr:"Sous-titres",ar:"ترجمات",es:"Subtítulos"},"settings.speed":{en:"Playback speed",fr:"Vitesse de lecture",ar:"سرعة التشغيل",es:"Velocidad"},"settings.quality":{en:"Quality",fr:"Qualité",ar:"الجودة",es:"Calidad"},"settings.default":{en:"Default",fr:"Défaut",ar:"افتراضي",es:"Predeterminado"},"settings.off":{en:"Off",fr:"Désactivés",ar:"إيقاف",es:"Desactivado"},"settings.normal":{en:"Normal",fr:"Normale",ar:"عادي",es:"Normal"},"settings.auto":{en:"Auto",fr:"Auto",ar:"تلقائي",es:"Auto"}};function y(e){if(void 0===e||""===e)return"en";const t=e.split(/[-_]/)[0].toLowerCase();return f.includes(t)?t:"en"}class k{constructor(e){this.currentLocale=y(e),this.translations={...v}}addTranslations(e){for(const t of Object.keys(e))this.translations[t]={...this.translations[t],...e[t]}}t(e,t){const i=this.translations[e];let r;return r=void 0===i?e:void 0!==i[this.currentLocale]?i[this.currentLocale]:void 0!==i.en?i.en:e,void 0===t||0===Object.keys(t).length?r:this.interpolate(r,t)}interpolate(e,t){return e.replace(/\{(\w+)\}/g,(e,i)=>{const r=t[i];return void 0!==r?String(r):e})}setLocale(e){this.currentLocale=y(e)}getLocale(){return this.currentLocale}}class x{constructor(e,t,i,r,s,a,n,o){this.reloadCount=0,this.successTimer=0,this.toastTimer=0,this.savedQuality=-1,this.savedAudioTrack=0,this.savedSubtitleTrack=-1,this.wireVideoCommands(e,t,i,r,s,o),this.wireEngineCommands(e,r,o),this.wireReloadOrchestration(e,i,a,n,o),this.wireCastHandoff(e,t,i,s,a,o),this.wireVolumeRouting(i,s,o),this.wireAbortCleanup(o)}getSavedSelections(){return{quality:this.savedQuality,audioTrack:this.savedAudioTrack,subtitleTrack:this.savedSubtitleTrack}}wireVideoCommands(e,t,i,r,s,a){e.on("play",()=>{i.isCasting&&null!==s?s.getDriver()?.play():t.play()},{signal:a}),e.on("pause",()=>{i.isCasting&&null!==s?s.getDriver()?.pause():t.pause()},{signal:a}),e.on("seek",({time:e})=>{if(i.isCasting&&null!==s)return void s.getDriver()?.seek(e);const a=r();null!==a?a.seek(e):t.currentTime=e},{signal:a}),e.on("mute-toggle",()=>{t.muted=!t.muted},{signal:a}),i.on("volume",e=>{i.isCasting||(t.volume=e)},{signal:a})}wireEngineCommands(e,t,i){e.on("settings-select-quality",({index:e})=>{t()?.setQuality(e)},{signal:i}),e.on("settings-select-audio",({index:e})=>{t()?.setAudioTrack(e)},{signal:i}),e.on("settings-select-subtitle",({index:e})=>{t()?.setSubtitle(e)},{signal:i}),e.on("settings-select-speed",({rate:e})=>{t()?.setPlaybackRate(e)},{signal:i}),e.on("sync-live",()=>{t()?.seekToLive()},{signal:i})}wireReloadOrchestration(e,t,i,r,s){e.on("request-reload",()=>{if(this.reloadCount>=3)return t.reconnecting=!1,void(t.error=i.t("error.stream_unavailable"));this.savedQuality=t.currentQuality,this.savedAudioTrack=t.currentAudioTrack,this.savedSubtitleTrack=t.currentSubtitleTrack,t.reconnecting=!0,this.reloadCount++,r()},{signal:s}),t.on("playbackState",e=>{"playing"===e?(clearTimeout(this.successTimer),this.successTimer=setTimeout(()=>{this.reloadCount=0,t.reconnecting=!1},12e4)):(clearTimeout(this.successTimer),this.successTimer=0)},{signal:s})}wireCastHandoff(e,t,i,r,s,a){e.on("cast-start",()=>{null!==r&&(t.pause(),r.toggleCast(i))},{signal:a}),e.on("cast-stop",()=>{t.play()},{signal:a}),e.on("cast-stop-with-position",({time:e})=>{t.currentTime=e,t.play()},{signal:a}),e.on("cast-failed",()=>{i.isCasting=!1,t.play(),this.showToast(i,s.t("cast.failed"))},{signal:a})}wireVolumeRouting(e,t,i){null!==t&&e.on("volume",i=>{e.isCasting&&t.getDriver()?.volume(i)},{signal:i})}showToast(e,t){e.toast=t,clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{e.toast=null},3e3)}wireAbortCleanup(e){e.addEventListener("abort",()=>{clearTimeout(this.successTimer),clearTimeout(this.toastTimer)},{once:!0})}}
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2017 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
- */const g=globalThis,f=e=>e,v=g.trustedTypes,y=v?v.createPolicy("lit-html",{createHTML:e=>e}):void 0,k="$lit$",x=`lit$${Math.random().toFixed(9).slice(2)}$`,w="?"+x,T=`<${w}>`,C=document,E=()=>C.createComment(""),L=e=>null===e||"object"!=typeof e&&"function"!=typeof e,A=Array.isArray,S="[ \t\n\f\r]",_=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,$=/-->/g,M=/>/g,P=RegExp(`>|${S}(?:([^\\s"'>=/]+)(${S}*=${S}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,B=/"/g,D=/^(?:script|style|textarea|title)$/i,F=e=>(t,...s)=>({_$litType$:e,strings:t,values:s}),V=F(1),z=F(2),I=Symbol.for("lit-noChange"),H=Symbol.for("lit-nothing"),N=new WeakMap,O=C.createTreeWalker(C,129);function j(e,t){if(!A(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==y?y.createHTML(t):t}const U=(e,t)=>{const s=e.length-1,i=[];let r,n=2===t?"<svg>":3===t?"<math>":"",a=_;for(let t=0;t<s;t++){const s=e[t];let o,l,d=-1,c=0;for(;c<s.length&&(a.lastIndex=c,l=a.exec(s),null!==l);)c=a.lastIndex,a===_?"!--"===l[1]?a=$:void 0!==l[1]?a=M:void 0!==l[2]?(D.test(l[2])&&(r=RegExp("</"+l[2],"g")),a=P):void 0!==l[3]&&(a=P):a===P?">"===l[0]?(a=r??_,d=-1):void 0===l[1]?d=-2:(d=a.lastIndex-l[2].length,o=l[1],a=void 0===l[3]?P:'"'===l[3]?B:R):a===B||a===R?a=P:a===$||a===M?a=_:(a=P,r=void 0);const h=a===P&&e[t+1].startsWith("/>")?" ":"";n+=a===_?s+T:d>=0?(i.push(o),s.slice(0,d)+k+s.slice(d)+x+h):s+x+(-2===d?t:h)}return[j(e,n+(e[s]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),i]};class q{constructor({strings:e,_$litType$:t},s){let i;this.parts=[];let r=0,n=0;const a=e.length-1,o=this.parts,[l,d]=U(e,t);if(this.el=q.createElement(l,s),O.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=O.nextNode())&&o.length<a;){if(1===i.nodeType){if(i.hasAttributes())for(const e of i.getAttributeNames())if(e.endsWith(k)){const t=d[n++],s=i.getAttribute(e).split(x),a=/([.?@])?(.*)/.exec(t);o.push({type:1,index:r,name:a[2],strings:s,ctor:"."===a[1]?X:"?"===a[1]?K:"@"===a[1]?J:Q}),i.removeAttribute(e)}else e.startsWith(x)&&(o.push({type:6,index:r}),i.removeAttribute(e));if(D.test(i.tagName)){const e=i.textContent.split(x),t=e.length-1;if(t>0){i.textContent=v?v.emptyScript:"";for(let s=0;s<t;s++)i.append(e[s],E()),O.nextNode(),o.push({type:2,index:++r});i.append(e[t],E())}}}else if(8===i.nodeType)if(i.data===w)o.push({type:2,index:r});else{let e=-1;for(;-1!==(e=i.data.indexOf(x,e+1));)o.push({type:7,index:r}),e+=x.length-1}r++}}static createElement(e,t){const s=C.createElement("template");return s.innerHTML=e,s}}function W(e,t,s=e,i){if(t===I)return t;let r=void 0!==i?s._$Co?.[i]:s._$Cl;const n=L(t)?void 0:t._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),void 0===n?r=void 0:(r=new n(e),r._$AT(e,s,i)),void 0!==i?(s._$Co??=[])[i]=r:s._$Cl=r),void 0!==r&&(t=W(e,r._$AS(e,t.values),r,i)),t}class G{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:s}=this._$AD,i=(e?.creationScope??C).importNode(t,!0);O.currentNode=i;let r=O.nextNode(),n=0,a=0,o=s[0];for(;void 0!==o;){if(n===o.index){let t;2===o.type?t=new Y(r,r.nextSibling,this,e):1===o.type?t=new o.ctor(r,o.name,o.strings,this,e):6===o.type&&(t=new Z(r,this,e)),this._$AV.push(t),o=s[++a]}n!==o?.index&&(r=O.nextNode(),n++)}return O.currentNode=C,i}p(e){let t=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}}class Y{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,i){this.type=2,this._$AH=H,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=W(this,e,t),L(e)?e===H||null==e||""===e?(this._$AH!==H&&this._$AR(),this._$AH=H):e!==this._$AH&&e!==I&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>A(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==H&&L(this._$AH)?this._$AA.nextSibling.data=e:this.T(C.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:s}=e,i="number"==typeof s?this._$AC(e):(void 0===s.el&&(s.el=q.createElement(j(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(t);else{const e=new G(i,this),s=e.u(this.options);e.p(t),this.T(s),this._$AH=e}}_$AC(e){let t=N.get(e.strings);return void 0===t&&N.set(e.strings,t=new q(e)),t}k(e){A(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,i=0;for(const r of e)i===t.length?t.push(s=new Y(this.O(E()),this.O(E()),this,this.options)):s=t[i],s._$AI(r),i++;i<t.length&&(this._$AR(s&&s._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=f(e).nextSibling;f(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class Q{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,i,r){this.type=1,this._$AH=H,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=r,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=H}_$AI(e,t=this,s,i){const r=this.strings;let n=!1;if(void 0===r)e=W(this,e,t,0),n=!L(e)||e!==this._$AH&&e!==I,n&&(this._$AH=e);else{const i=e;let a,o;for(e=r[0],a=0;a<r.length-1;a++)o=W(this,i[s+a],t,a),o===I&&(o=this._$AH[a]),n||=!L(o)||o!==this._$AH[a],o===H?e=H:e!==H&&(e+=(o??"")+r[a+1]),this._$AH[a]=o}n&&!i&&this.j(e)}j(e){e===H?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class X extends Q{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===H?void 0:e}}class K extends Q{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==H)}}class J extends Q{constructor(e,t,s,i,r){super(e,t,s,i,r),this.type=5}_$AI(e,t=this){if((e=W(this,e,t,0)??H)===I)return;const s=this._$AH,i=e===H&&s!==H||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==H&&(s===H||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Z{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){W(this,e)}}const ee=g.litHtmlPolyfillSupport;ee?.(q,Y),(g.litHtmlVersions??=[]).push("3.3.2");class te{constructor(){this.el=null,this.state=null,this.bus=null,this.config=null,this.i18n=null,this.abortController=null}get signal(){return this.abortController.signal}connect(e,t,s,i,r){this.el=e,this.state=t,this.bus=s,this.config=i,this.i18n=r??null,this.abortController=new AbortController,this.onConnect()}disconnect(){this.abortController?.abort(),this.abortController=null,this.el=null,this.state=null,this.bus=null,this.config=null,this.i18n=null}render(){null!==this.el&&((e,t)=>{const s=t;let i=s._$litPart$;if(void 0===i){const e=null;s._$litPart$=i=new Y(t.insertBefore(E(),e),e,void 0,{})}i._$AI(e)})(this.template(),this.el)}}const se={play:'<symbol id="eb-play" viewBox="0 0 24 24"><path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"/></symbol>',pause:'<symbol id="eb-pause" viewBox="0 0 24 24"><rect x="14" y="3" width="5" height="18" rx="1"/><rect x="5" y="3" width="5" height="18" rx="1"/></symbol>',"volume-high":'<symbol id="eb-volume-high" viewBox="0 0 24 24"><path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"/><path d="M16 9a5 5 0 0 1 0 6"/><path d="M19.364 18.364a9 9 0 0 0 0-12.728"/></symbol>',"volume-low":'<symbol id="eb-volume-low" viewBox="0 0 24 24"><path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"/><path d="M16 9a5 5 0 0 1 0 6"/></symbol>',"volume-mute":'<symbol id="eb-volume-mute" viewBox="0 0 24 24"><path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"/><line x1="22" x2="16" y1="9" y2="15"/><line x1="16" x2="22" y1="9" y2="15"/></symbol>',fullscreen:'<symbol id="eb-fullscreen" viewBox="0 0 24 24"><path d="M8 3H5a2 2 0 0 0-2 2v3"/><path d="M21 8V5a2 2 0 0 0-2-2h-3"/><path d="M3 16v3a2 2 0 0 0 2 2h3"/><path d="M16 21h3a2 2 0 0 0 2-2v-3"/></symbol>',"fullscreen-exit":'<symbol id="eb-fullscreen-exit" viewBox="0 0 24 24"><path d="M8 3v3a2 2 0 0 1-2 2H3"/><path d="M21 8h-3a2 2 0 0 1-2-2V3"/><path d="M3 16h3a2 2 0 0 1 2 2v3"/><path d="M16 21v-3a2 2 0 0 1 2-2h3"/></symbol>',settings:'<symbol id="eb-settings" viewBox="0 0 24 24"><line x1="4" x2="4" y1="21" y2="14"/><line x1="4" x2="4" y1="10" y2="3"/><line x1="12" x2="12" y1="21" y2="12"/><line x1="12" x2="12" y1="8" y2="3"/><line x1="20" x2="20" y1="21" y2="16"/><line x1="20" x2="20" y1="12" y2="3"/><line x1="2" x2="6" y1="14" y2="14"/><line x1="10" x2="14" y1="8" y2="8"/><line x1="18" x2="22" y1="16" y2="16"/></symbol>',pip:'<symbol id="eb-pip" viewBox="0 0 24 24"><path d="M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4"/><rect width="10" height="7" x="12" y="13" rx="2"/></symbol>',cast:'<symbol id="eb-cast" viewBox="0 0 24 24"><path d="M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6"/><path d="M2 12a9 9 0 0 1 8 8"/><path d="M2 16a5 5 0 0 1 4 4"/><line x1="2" x2="2.01" y1="20" y2="20"/></symbol>',close:'<symbol id="eb-close" viewBox="0 0 24 24"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></symbol>',share:'<symbol id="eb-share" viewBox="0 0 24 24"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" x2="15.42" y1="13.51" y2="17.49"/><line x1="15.41" x2="8.59" y1="6.51" y2="10.49"/></symbol>',info:'<symbol id="eb-info" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></symbol>',speed:'<symbol id="eb-speed" viewBox="0 0 24 24"><path d="m12 14 4-4"/><path d="M3.34 19a10 10 0 1 1 17.32 0"/></symbol>',check:'<symbol id="eb-check" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></symbol>',"chevron-left":'<symbol id="eb-chevron-left" viewBox="0 0 24 24"><path d="m15 18-6-6 6-6"/></symbol>',"chevron-right":'<symbol id="eb-chevron-right" viewBox="0 0 24 24"><path d="m9 18 6-6-6-6"/></symbol>',spinner:'<symbol id="eb-spinner" viewBox="0 0 24 24"><path d="M12 2v4"/><path d="m16.2 7.8 2.9-2.9"/><path d="M18 12h4"/><path d="m16.2 16.2 2.9 2.9"/><path d="M12 18v4"/><path d="m4.9 19.1 2.9-2.9"/><path d="M2 12h4"/><path d="m4.9 4.9 2.9 2.9"/></symbol>',live:'<symbol id="eb-live" viewBox="0 0 24 24"><path d="M16.247 7.761a6 6 0 0 1 0 8.478"/><path d="M19.075 4.933a10 10 0 0 1 0 14.134"/><path d="M4.925 19.067a10 10 0 0 1 0-14.134"/><path d="M7.753 16.239a6 6 0 0 1 0-8.478"/><circle cx="12" cy="12" r="2"/></symbol>',"skip-forward":'<symbol id="eb-skip-forward" viewBox="0 0 24 24"><path d="M21 4v16"/><path d="M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z"/></symbol>',"skip-back":'<symbol id="eb-skip-back" viewBox="0 0 24 24"><path d="M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z"/><path d="M3 20V4"/></symbol>',"radio-bars":'<symbol id="eb-radio-bars" viewBox="0 0 24 24"><path d="M4.9 19.1C1 15.2 1 8.8 4.9 4.9"/><path d="M7.8 16.2a6 6 0 0 1 0-8.4"/><path d="M16.2 7.8a6 6 0 0 1 0 8.4"/><path d="M19.1 4.9C23 8.8 23 15.1 19.1 19"/><circle cx="12" cy="12" r="2"/></symbol>',subtitle:'<symbol id="eb-subtitle" viewBox="0 0 24 24"><rect width="18" height="14" x="3" y="5" rx="2" ry="2"/><path d="M7 15h4M15 15h2M7 11h2M13 11h4"/></symbol>',audio:'<symbol id="eb-audio" viewBox="0 0 24 24"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></symbol>',quality:'<symbol id="eb-quality" viewBox="0 0 24 24"><path d="M2 20h.01"/><path d="M7 20v-4"/><path d="M12 20v-8"/><path d="M17 20V8"/><path d="M22 4v16"/></symbol>'};let ie=!1,re={...se};function ne(e){return`<svg xmlns="http://www.w3.org/2000/svg" style="display:none"><defs>${Object.values(e).join("")}</defs></svg>`}function ae(e){if(ie&&(void 0===e||0===Object.keys(e).length))return;void 0!==e&&(re={...re,...e});const t=ne(re),s=document.getElementById("eb-sprite");if(null!==s)s.innerHTML=t;else{const e=document.createElement("div");e.id="eb-sprite",e.style.display="none",e.innerHTML=t,document.body.prepend(e)}ie=!0}function oe(e,t){return z`<svg class="${void 0!==t?`eb-icon ${t}`:"eb-icon"}" aria-hidden="true"><use href="#eb-${e}"></use></svg>`}class le extends te{onConnect(){this.render()}template(){const e=this.config,t=void 0!==e.logo,s=!1!==e.socials;return V`
6
+ */const w=globalThis,C=e=>e,_=w.trustedTypes,E=_?_.createPolicy("lit-html",{createHTML:e=>e}):void 0,T="$lit$",L=`lit$${Math.random().toFixed(9).slice(2)}$`,A="?"+L,S=`<${A}>`,$=document,M=()=>$.createComment(""),P=e=>null===e||"object"!=typeof e&&"function"!=typeof e,R=Array.isArray,B="[ \t\n\f\r]",q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,F=/>/g,z=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),V=/'/g,H=/"/g,I=/^(?:script|style|textarea|title)$/i,N=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),O=N(1),j=N(2),U=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),Y=new WeakMap,G=$.createTreeWalker($,129);function Q(e,t){if(!R(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==E?E.createHTML(t):t}const X=(e,t)=>{const i=e.length-1,r=[];let s,a=2===t?"<svg>":3===t?"<math>":"",n=q;for(let t=0;t<i;t++){const i=e[t];let o,l,d=-1,c=0;for(;c<i.length&&(n.lastIndex=c,l=n.exec(i),null!==l);)c=n.lastIndex,n===q?"!--"===l[1]?n=D:void 0!==l[1]?n=F:void 0!==l[2]?(I.test(l[2])&&(s=RegExp("</"+l[2],"g")),n=z):void 0!==l[3]&&(n=z):n===z?">"===l[0]?(n=s??q,d=-1):void 0===l[1]?d=-2:(d=n.lastIndex-l[2].length,o=l[1],n=void 0===l[3]?z:'"'===l[3]?H:V):n===H||n===V?n=z:n===D||n===F?n=q:(n=z,s=void 0);const h=n===z&&e[t+1].startsWith("/>")?" ":"";a+=n===q?i+S:d>=0?(r.push(o),i.slice(0,d)+T+i.slice(d)+L+h):i+L+(-2===d?t:h)}return[Q(e,a+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),r]};class K{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let s=0,a=0;const n=e.length-1,o=this.parts,[l,d]=X(e,t);if(this.el=K.createElement(l,i),G.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(r=G.nextNode())&&o.length<n;){if(1===r.nodeType){if(r.hasAttributes())for(const e of r.getAttributeNames())if(e.endsWith(T)){const t=d[a++],i=r.getAttribute(e).split(L),n=/([.?@])?(.*)/.exec(t);o.push({type:1,index:s,name:n[2],strings:i,ctor:"."===n[1]?ie:"?"===n[1]?re:"@"===n[1]?se:te}),r.removeAttribute(e)}else e.startsWith(L)&&(o.push({type:6,index:s}),r.removeAttribute(e));if(I.test(r.tagName)){const e=r.textContent.split(L),t=e.length-1;if(t>0){r.textContent=_?_.emptyScript:"";for(let i=0;i<t;i++)r.append(e[i],M()),G.nextNode(),o.push({type:2,index:++s});r.append(e[t],M())}}}else if(8===r.nodeType)if(r.data===A)o.push({type:2,index:s});else{let e=-1;for(;-1!==(e=r.data.indexOf(L,e+1));)o.push({type:7,index:s}),e+=L.length-1}s++}}static createElement(e,t){const i=$.createElement("template");return i.innerHTML=e,i}}function J(e,t,i=e,r){if(t===U)return t;let s=void 0!==r?i._$Co?.[r]:i._$Cl;const a=P(t)?void 0:t._$litDirective$;return s?.constructor!==a&&(s?._$AO?.(!1),void 0===a?s=void 0:(s=new a(e),s._$AT(e,i,r)),void 0!==r?(i._$Co??=[])[r]=s:i._$Cl=s),void 0!==s&&(t=J(e,s._$AS(e,t.values),s,r)),t}class Z{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,r=(e?.creationScope??$).importNode(t,!0);G.currentNode=r;let s=G.nextNode(),a=0,n=0,o=i[0];for(;void 0!==o;){if(a===o.index){let t;2===o.type?t=new ee(s,s.nextSibling,this,e):1===o.type?t=new o.ctor(s,o.name,o.strings,this,e):6===o.type&&(t=new ae(s,this,e)),this._$AV.push(t),o=i[++n]}a!==o?.index&&(s=G.nextNode(),a++)}return G.currentNode=$,r}p(e){let t=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class ee{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=W,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=J(this,e,t),P(e)?e===W||null==e||""===e?(this._$AH!==W&&this._$AR(),this._$AH=W):e!==this._$AH&&e!==U&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>R(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==W&&P(this._$AH)?this._$AA.nextSibling.data=e:this.T($.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:i}=e,r="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=K.createElement(Q(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(t);else{const e=new Z(r,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=Y.get(e.strings);return void 0===t&&Y.set(e.strings,t=new K(e)),t}k(e){R(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,r=0;for(const s of e)r===t.length?t.push(i=new ee(this.O(M()),this.O(M()),this,this.options)):i=t[r],i._$AI(s),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=C(e).nextSibling;C(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class te{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=W,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=W}_$AI(e,t=this,i,r){const s=this.strings;let a=!1;if(void 0===s)e=J(this,e,t,0),a=!P(e)||e!==this._$AH&&e!==U,a&&(this._$AH=e);else{const r=e;let n,o;for(e=s[0],n=0;n<s.length-1;n++)o=J(this,r[i+n],t,n),o===U&&(o=this._$AH[n]),a||=!P(o)||o!==this._$AH[n],o===W?e=W:e!==W&&(e+=(o??"")+s[n+1]),this._$AH[n]=o}a&&!r&&this.j(e)}j(e){e===W?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ie extends te{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===W?void 0:e}}class re extends te{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==W)}}class se extends te{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=J(this,e,t,0)??W)===U)return;const i=this._$AH,r=e===W&&i!==W||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==W&&(i===W||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class ae{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){J(this,e)}}const ne=w.litHtmlPolyfillSupport;ne?.(K,ee),(w.litHtmlVersions??=[]).push("3.3.2");class oe{constructor(){this.el=null,this.state=null,this.bus=null,this.config=null,this.i18n=null,this.abortController=null}get signal(){return this.abortController.signal}connect(e,t,i,r,s){this.el=e,this.state=t,this.bus=i,this.config=r,this.i18n=s??null,this.abortController=new AbortController,this.onConnect()}disconnect(){this.abortController?.abort(),this.abortController=null,this.el=null,this.state=null,this.bus=null,this.config=null,this.i18n=null}render(){null!==this.el&&((e,t)=>{const i=t;let r=i._$litPart$;if(void 0===r){const e=null;i._$litPart$=r=new ee(t.insertBefore(M(),e),e,void 0,{})}r._$AI(e)})(this.template(),this.el)}}class le extends oe{onConnect(){this.render()}template(){const e=this.config,t=void 0!==e.logo,i=b(e).topBar,r=e=>O`<div class="eb-slot-${e}"></div>`;return O`
7
7
  <div class="eb-top-bar">
8
- ${t?V`
9
- ${void 0!==e.logoLink?V`<a class="eb-top-bar__logo-link" href="${e.logoLink}" target="_blank" rel="noopener">
8
+ ${t?O`
9
+ ${void 0!==e.logoLink?O`<a class="eb-top-bar__logo-link" href="${e.logoLink}" target="_blank" rel="noopener">
10
10
  <img class="eb-top-bar__logo" src="${e.logo}" alt="" />
11
- </a>`:V`<img class="eb-top-bar__logo" src="${e.logo}" alt="" />`}
11
+ </a>`:O`<img class="eb-top-bar__logo" src="${e.logo}" alt="" />`}
12
12
  `:""}
13
13
 
14
14
  <div class="eb-top-bar__actions">
15
- ${s?V`<button
16
- class="eb-button eb-top-bar__btn-share"
17
- @click="${()=>{this.state.socialsOpen=!this.state.socialsOpen}}"
18
- aria-label="Share"
19
- >${oe("share")}</button>`:""}
20
-
21
- <button
22
- class="eb-button eb-top-bar__btn-info"
23
- @click="${()=>{this.state.infoOpen=!this.state.infoOpen}}"
24
- aria-label="Info"
25
- >${oe("info")}</button>
15
+ ${(i.left??[]).map(r)}
16
+ ${(i.right??[]).map(r)}
26
17
  </div>
27
18
  </div>
28
- `}}class de extends te{onConnect(){this.render()}template(){return V`
19
+ `}}class de extends oe{onConnect(){this.render()}template(){const e=b(this.config).bottomBar,t=e=>"seekbar"===e?O`<div class="eb-bottom-bar__seekbar-zone"></div>`:O`<div class="eb-slot-${e}"></div>`;return O`
29
20
  <div class="eb-bottom-bar">
30
21
  <div class="eb-bottom-bar__gradient"></div>
31
22
  <div class="eb-bottom-bar__controls-row">
32
- <div class="eb-slot-play-pause"></div>
33
- <div class="eb-slot-volume"></div>
34
- <div class="eb-bottom-bar__seekbar-zone"></div>
35
- <div class="eb-slot-time"></div>
36
- <div class="eb-slot-live-sync"></div>
37
- <div class="eb-slot-settings"></div>
38
- <div class="eb-slot-pip"></div>
39
- <div class="eb-slot-cast"></div>
40
- <div class="eb-slot-fullscreen"></div>
23
+ ${(e.left??[]).map(t)}
24
+ ${(e.center??[]).map(t)}
25
+ ${(e.right??[]).map(t)}
41
26
  </div>
42
27
  </div>
43
- `}}class ce extends te{onConnect(){this.render();const{signal:e}=this;this.state.on("playbackState",()=>this.render(),{signal:e})}template(){const e="playing"===this.state.playbackState;return V`
28
+ `}}const ce={play:'<symbol id="eb-play" viewBox="0 0 24 24"><path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"/></symbol>',pause:'<symbol id="eb-pause" viewBox="0 0 24 24"><rect x="14" y="3" width="5" height="18" rx="1"/><rect x="5" y="3" width="5" height="18" rx="1"/></symbol>',"volume-high":'<symbol id="eb-volume-high" viewBox="0 0 24 24"><path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"/><path d="M16 9a5 5 0 0 1 0 6"/><path d="M19.364 18.364a9 9 0 0 0 0-12.728"/></symbol>',"volume-low":'<symbol id="eb-volume-low" viewBox="0 0 24 24"><path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"/><path d="M16 9a5 5 0 0 1 0 6"/></symbol>',"volume-mute":'<symbol id="eb-volume-mute" viewBox="0 0 24 24"><path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"/><line x1="22" x2="16" y1="9" y2="15"/><line x1="16" x2="22" y1="9" y2="15"/></symbol>',fullscreen:'<symbol id="eb-fullscreen" viewBox="0 0 24 24"><path d="M8 3H5a2 2 0 0 0-2 2v3"/><path d="M21 8V5a2 2 0 0 0-2-2h-3"/><path d="M3 16v3a2 2 0 0 0 2 2h3"/><path d="M16 21h3a2 2 0 0 0 2-2v-3"/></symbol>',"fullscreen-exit":'<symbol id="eb-fullscreen-exit" viewBox="0 0 24 24"><path d="M8 3v3a2 2 0 0 1-2 2H3"/><path d="M21 8h-3a2 2 0 0 1-2-2V3"/><path d="M3 16h3a2 2 0 0 1 2 2v3"/><path d="M16 21v-3a2 2 0 0 1 2-2h3"/></symbol>',settings:'<symbol id="eb-settings" viewBox="0 0 24 24"><path fill="currentColor" stroke="none" d="M19.14 12.94c.04-.3.06-.61.06-.94s-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"/></symbol>',pip:'<symbol id="eb-pip" viewBox="0 0 24 24"><path d="M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4"/><rect width="10" height="7" x="12" y="13" rx="2"/></symbol>',cast:'<symbol id="eb-cast" viewBox="0 0 24 24"><path d="M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6"/><path d="M2 12a9 9 0 0 1 8 8"/><path d="M2 16a5 5 0 0 1 4 4"/><line x1="2" x2="2.01" y1="20" y2="20"/></symbol>',close:'<symbol id="eb-close" viewBox="0 0 24 24"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></symbol>',share:'<symbol id="eb-share" viewBox="0 0 24 24"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" x2="15.42" y1="13.51" y2="17.49"/><line x1="15.41" x2="8.59" y1="6.51" y2="10.49"/></symbol>',info:'<symbol id="eb-info" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></symbol>',speed:'<symbol id="eb-speed" viewBox="0 0 24 24"><path d="m12 14 4-4"/><path d="M3.34 19a10 10 0 1 1 17.32 0"/></symbol>',check:'<symbol id="eb-check" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></symbol>',"chevron-left":'<symbol id="eb-chevron-left" viewBox="0 0 24 24"><path d="m15 18-6-6 6-6"/></symbol>',"chevron-right":'<symbol id="eb-chevron-right" viewBox="0 0 24 24"><path d="m9 18 6-6-6-6"/></symbol>',spinner:'<symbol id="eb-spinner" viewBox="0 0 24 24"><path d="M12 2v4"/><path d="m16.2 7.8 2.9-2.9"/><path d="M18 12h4"/><path d="m16.2 16.2 2.9 2.9"/><path d="M12 18v4"/><path d="m4.9 19.1 2.9-2.9"/><path d="M2 12h4"/><path d="m4.9 4.9 2.9 2.9"/></symbol>',live:'<symbol id="eb-live" viewBox="0 0 24 24"><path d="M16.247 7.761a6 6 0 0 1 0 8.478"/><path d="M19.075 4.933a10 10 0 0 1 0 14.134"/><path d="M4.925 19.067a10 10 0 0 1 0-14.134"/><path d="M7.753 16.239a6 6 0 0 1 0-8.478"/><circle cx="12" cy="12" r="2"/></symbol>',"skip-forward":'<symbol id="eb-skip-forward" viewBox="0 0 24 24"><path d="M21 4v16"/><path d="M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z"/></symbol>',"skip-back":'<symbol id="eb-skip-back" viewBox="0 0 24 24"><path d="M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z"/><path d="M3 20V4"/></symbol>',"radio-bars":'<symbol id="eb-radio-bars" viewBox="0 0 24 24"><path d="M4.9 19.1C1 15.2 1 8.8 4.9 4.9"/><path d="M7.8 16.2a6 6 0 0 1 0-8.4"/><path d="M16.2 7.8a6 6 0 0 1 0 8.4"/><path d="M19.1 4.9C23 8.8 23 15.1 19.1 19"/><circle cx="12" cy="12" r="2"/></symbol>',subtitle:'<symbol id="eb-subtitle" viewBox="0 0 24 24"><rect width="18" height="14" x="3" y="5" rx="2" ry="2"/><path d="M7 15h4M15 15h2M7 11h2M13 11h4"/></symbol>',audio:'<symbol id="eb-audio" viewBox="0 0 24 24"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></symbol>',quality:'<symbol id="eb-quality" viewBox="0 0 24 24"><path d="M2 20h.01"/><path d="M7 20v-4"/><path d="M12 20v-8"/><path d="M17 20V8"/><path d="M22 4v16"/></symbol>'};let he=!1,be={...ce};function ue(e){return`<svg xmlns="http://www.w3.org/2000/svg" style="display:none"><defs>${Object.values(e).join("")}</defs></svg>`}function pe(e){if(he&&(void 0===e||0===Object.keys(e).length))return;void 0!==e&&(be={...be,...e});const t=ue(be),i=document.getElementById("eb-sprite");if(null!==i)i.innerHTML=t;else{const e=document.createElement("div");e.id="eb-sprite",e.style.display="none",e.innerHTML=t,document.body.prepend(e)}he=!0}function me(e,t){return j`<svg class="${void 0!==t?`eb-icon ${t}`:"eb-icon"}" aria-hidden="true"><use href="#eb-${e}"></use></svg>`}class ge extends oe{onConnect(){this.render();const{signal:e}=this;this.state.on("playbackState",()=>this.render(),{signal:e})}template(){const e="playing"===this.state.playbackState,t=b(this.config).middleBar,i=e=>O`<div class="eb-slot-${e}"></div>`;return O`
44
29
  <div class="eb-middle-bar">
45
- <div class="eb-slot-rewind"></div>
30
+ ${(t.left??[]).map(i)}
46
31
  <button
47
32
  class="eb-button eb-middle-bar__play-btn"
48
33
  @click="${()=>this.handleClick()}"
49
34
  aria-label="${e?"Pause":"Play"}"
50
35
  >
51
- ${oe(e?"pause":"play")}
36
+ ${me(e?"pause":"play")}
52
37
  </button>
53
- <div class="eb-slot-forward"></div>
38
+ ${(t.right??[]).map(i)}
54
39
  </div>
55
- `}handleClick(){const e=this.state,t=this.bus;"playing"===e.playbackState?t.emit("pause"):t.emit("play")}}class he extends te{onConnect(){this.state.on("playbackState",()=>this.render(),{signal:this.signal}),this.render()}template(){const e="playing"===this.state.playbackState;return V`
40
+ `}handleClick(){const e=this.state,t=this.bus;"playing"===e.playbackState?t.emit("pause"):t.emit("play")}}class fe extends oe{onConnect(){this.state.on("playbackState",()=>this.render(),{signal:this.signal}),this.render()}template(){const e="playing"===this.state.playbackState;return O`
56
41
  <button
57
42
  class="eb-play-pause"
58
43
  aria-label="${e?"Pause":"Play"}"
59
44
  @click="${()=>this.bus.emit(e?"pause":"play")}"
60
45
  >
61
- ${oe(e?"pause":"play")}
46
+ ${me(e?"pause":"play")}
62
47
  </button>
63
- `}}class ue extends te{constructor(){super(...arguments),this.trackRect=null,this.onPointerMove=null,this.onPointerUp=null}onConnect(){this.state.on("volume",()=>this.render(),{signal:this.signal}),this.state.on("muted",()=>this.render(),{signal:this.signal}),this.signal.addEventListener("abort",()=>{null!==this.onPointerMove&&document.removeEventListener("pointermove",this.onPointerMove),null!==this.onPointerUp&&document.removeEventListener("pointerup",this.onPointerUp)}),this.render()}eventToVolume(e){const t=(e-this.trackRect.left)/this.trackRect.width;return Math.min(1,Math.max(0,t))}handlePointerDown(e){const t=e.currentTarget;this.trackRect=t.getBoundingClientRect(),this.onPointerMove=e=>{this.state.volume=this.eventToVolume(e.clientX)},this.onPointerUp=e=>{this.state.volume=this.eventToVolume(e.clientX),document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp),this.onPointerMove=null,this.onPointerUp=null,this.trackRect=null},document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp)}getVolumeIcon(){return this.state.muted||0===this.state.volume?"volume-mute":this.state.volume<.5?"volume-low":"volume-high"}template(){const e=this.state.muted?0:this.state.volume,t=`${Math.round(100*e)}%`,s=this.getVolumeIcon();return V`
48
+ `}}class ve extends oe{constructor(){super(...arguments),this.trackRect=null,this.onPointerMove=null,this.onPointerUp=null}onConnect(){this.state.on("volume",()=>this.render(),{signal:this.signal}),this.state.on("muted",()=>this.render(),{signal:this.signal}),this.signal.addEventListener("abort",()=>{null!==this.onPointerMove&&document.removeEventListener("pointermove",this.onPointerMove),null!==this.onPointerUp&&document.removeEventListener("pointerup",this.onPointerUp)}),this.render()}eventToVolume(e){const t=(e-this.trackRect.left)/this.trackRect.width;return Math.min(1,Math.max(0,t))}handlePointerDown(e){const t=e.currentTarget;this.trackRect=t.getBoundingClientRect(),this.onPointerMove=e=>{this.state.volume=this.eventToVolume(e.clientX)},this.onPointerUp=e=>{this.state.volume=this.eventToVolume(e.clientX),document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp),this.onPointerMove=null,this.onPointerUp=null,this.trackRect=null},document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp)}getVolumeIcon(){return this.state.muted||0===this.state.volume?"volume-mute":this.state.volume<.5?"volume-low":"volume-high"}template(){const e=this.state.muted?0:this.state.volume,t=`${Math.round(100*e)}%`,i=this.getVolumeIcon();return O`
64
49
  <div class="eb-volume-control">
65
50
  <button
66
51
  class="eb-volume-mute"
67
52
  aria-label="${this.state.muted?"Unmute":"Mute"}"
68
53
  @click="${()=>this.bus.emit("mute-toggle")}"
69
54
  >
70
- ${oe(s)}
55
+ ${me(i)}
71
56
  </button>
72
57
  <div
73
58
  class="eb-volume-track"
@@ -77,56 +62,92 @@ var EBPlayerBundle=function(e){"use strict";function t(e,t){void 0===t&&(t={});v
77
62
  <div class="eb-volume-thumb" style="left: ${t}"></div>
78
63
  </div>
79
64
  </div>
80
- `}}function be(e){if(!Number.isFinite(e)||e<0)return"0:00";const t=Math.floor(e),s=Math.floor(t/3600),i=Math.floor(t%3600/60),r=String(t%60).padStart(2,"0");if(s>0){return`${s}:${String(i).padStart(2,"0")}:${r}`}return`${i}:${r}`}function pe(e){return new Date(e).toTimeString().split(" ")[0]}class me extends te{constructor(){super(...arguments),this.rafPending=!1}onConnect(){this.state.on("currentTime",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("duration",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("isLive",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("isSyncWithLive",()=>this.scheduleRender(),{signal:this.signal}),this.render()}scheduleRender(){this.rafPending||(this.rafPending=!0,requestAnimationFrame(()=>{this.rafPending=!1,this.render()}))}template(){const{currentTime:e,duration:t,isLive:s,isSyncWithLive:i}=this.state;let r;if(s)if(i||!Number.isFinite(t))r=pe(Date.now());else{r=`- ${be(t-e)}`}else r=`${be(e)} / ${be(t)}`;return V`<div class="eb-time-display">${r}</div>`}}class ge extends te{onConnect(){this.state.on("isLive",()=>this.render(),{signal:this.signal}),this.state.on("isSyncWithLive",()=>this.render(),{signal:this.signal}),this.render()}template(){const{isLive:e,isSyncWithLive:t}=this.state;return e?V`
65
+ `}}function ye(e){if(!Number.isFinite(e)||e<0)return"0:00";const t=Math.floor(e),i=Math.floor(t/3600),r=Math.floor(t%3600/60),s=String(t%60).padStart(2,"0");if(i>0){return`${i}:${String(r).padStart(2,"0")}:${s}`}return`${r}:${s}`}function ke(e){return new Date(e).toTimeString().split(" ")[0]}class xe extends oe{constructor(){super(...arguments),this.isDragging=!1,this.dragValue=0,this.rafPending=!1,this.tooltipVisible=!1,this.tooltipTime=0,this.tooltipX=0,this.previewVideoEl=null,this.snapshotTake=null,this.trackEl=null,this.boundDocPointerMove=null}onConnect(){this.bus.on("snapshot-handler-ready",e=>{this.snapshotTake=e.take,this.previewVideoEl=e.video,this.previewVideoEl.className="eb-seekbar-preview",this.previewVideoEl.muted=!0},{signal:this.signal}),this.state.on("currentTime",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("duration",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("bufferedEnd",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("isRtl",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("adPlaying",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("chapters",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("epgPrograms",()=>this.scheduleRender(),{signal:this.signal}),this.render()}disconnect(){this.stopDocumentTracking(),super.disconnect()}scheduleRender(){this.rafPending||(this.rafPending=!0,requestAnimationFrame(()=>{this.rafPending=!1,this.render()}))}eventToTime(e,t){const i=t.getBoundingClientRect(),r=(e.clientX-i.left)/i.width,s=this.state.isRtl?1-r:r;return Math.min(1,Math.max(0,s))*this.state.duration}startDocumentTracking(){this.boundDocPointerMove||(this.boundDocPointerMove=e=>this.onDocPointerMove(e),document.addEventListener("pointermove",this.boundDocPointerMove),document.addEventListener("mouseleave",this.boundDocPointerMove))}stopDocumentTracking(){this.boundDocPointerMove&&(document.removeEventListener("pointermove",this.boundDocPointerMove),document.removeEventListener("mouseleave",this.boundDocPointerMove),this.boundDocPointerMove=null)}onDocPointerMove(e){if(this.isDragging)return;if(!this.trackEl)return;const t=this.trackEl.getBoundingClientRect();e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom||(this.tooltipVisible=!1,this.stopDocumentTracking(),this.render())}handlePointerDown(e){if(this.state.adPlaying)return;const t=e.currentTarget;this.trackEl=t,"function"==typeof t.setPointerCapture&&t.setPointerCapture(e.pointerId),this.isDragging=!0,this.dragValue=this.eventToTime(e,t),this.render()}handlePointerMove(e){if(this.isDragging){const t=e.currentTarget;this.dragValue=this.eventToTime(e,t),this.scheduleRender();const i=t.getBoundingClientRect();return void(e.clientX>=i.left&&e.clientX<=i.right&&this.updateTooltip(e))}this.updateTooltip(e)}handlePointerUp(e){if(!this.isDragging)return;const t=e.currentTarget,i=this.eventToTime(e,t);this.isDragging=!1,this.bus.emit("seek",{time:i}),this.tooltipVisible=!1,this.stopDocumentTracking(),this.render()}updateTooltip(e){const t=e.currentTarget;this.trackEl=t;const i=t.getBoundingClientRect(),r=(e.clientX-i.left)/i.width,s=Math.min(1,Math.max(0,r));this.tooltipTime=this.state.isRtl?(1-s)*this.state.duration:s*this.state.duration,this.tooltipX=Math.min(i.width,Math.max(0,e.clientX-i.left)),this.tooltipVisible=!0,this.startDocumentTracking(),null!==this.snapshotTake&&this.snapshotTake(this.tooltipTime),this.render()}findActiveChapter(e){const t=this.state.currentTime;for(const i of e)if(t>=i.startTime&&t<=i.endTime)return i;return null}findSkippableChapter(e){const t=this.config.skippableChapters;for(const i of t)if(i.chapter===e.title)return i;return null}renderEpgSegments(e){if(0===e.length)return[];const t=e[0].start,i=e[e.length-1].end-t;if(i<=0)return[];const r=Date.now();return e.map(e=>{const s=(e.start-t)/i*100,a=(e.end-e.start)/i*100,n=r>=e.start&&r<e.end;return O`
66
+ <div
67
+ class="eb-epg-segment${n?" eb-epg-current":""}"
68
+ style="left: ${s.toFixed(2)}%; width: ${a.toFixed(2)}%"
69
+ title="${e.title}"
70
+ ></div>
71
+ `})}template(){const{currentTime:e,duration:t,bufferedEnd:i,adPlaying:r,chapters:s,epgPrograms:a}=this.state,n=!this.config.seekbar,o=r,l=t>0?(this.isDragging?this.dragValue:e)/t*100:0,d=t>0?i/t*100:0,c=this.findActiveChapter(s),h=null!==c?this.findSkippableChapter(c):null,b=s.map(e=>{const i=t>0?e.startTime/t*100:0;return O`
72
+ <div
73
+ class="eb-chapter-marker${e===c?" eb-chapter-active":""}"
74
+ style="left: ${i.toFixed(2)}%"
75
+ title="${e.title}"
76
+ ></div>
77
+ `}),u=null!==c&&null!==h?O`
78
+ <button
79
+ class="eb-chapter-skip"
80
+ @click="${()=>this.bus.emit("seek",{time:c.endTime})}"
81
+ >${h.message}</button>
82
+ `:O``,p=this.renderEpgSegments(a),m=this.state.isLive&&Number.isFinite(t)?ke(Date.now()-1e3*(t-this.tooltipTime)):ye(this.tooltipTime),g=O`
83
+ <div
84
+ class="eb-seekbar-tooltip"
85
+ style="left: ${this.tooltipX}px; visibility: ${this.tooltipVisible?"visible":"hidden"}"
86
+ >
87
+ ${null!==this.previewVideoEl?this.previewVideoEl:O``}
88
+ ${m}
89
+ </div>
90
+ `;return O`
91
+ <div
92
+ class="eb-seekbar${o?" eb-seekbar-disabled":""}"
93
+ ?hidden="${n}"
94
+ >
95
+ <div
96
+ class="eb-seekbar-track"
97
+ @pointerdown="${e=>this.handlePointerDown(e)}"
98
+ @pointermove="${e=>this.handlePointerMove(e)}"
99
+ @pointerup="${e=>this.handlePointerUp(e)}"
100
+ >
101
+ <div class="eb-seekbar-buffered" style="width: ${d.toFixed(2)}%"></div>
102
+ <div class="eb-seekbar-progress" style="width: ${l.toFixed(2)}%">
103
+ <div class="eb-seekbar-thumb"></div>
104
+ </div>
105
+ ${b}
106
+ ${p}
107
+ ${g}
108
+ </div>
109
+ ${u}
110
+ </div>
111
+ `}}class we extends oe{constructor(){super(...arguments),this.rafPending=!1}onConnect(){this.state.on("currentTime",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("duration",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("isLive",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("isSyncWithLive",()=>this.scheduleRender(),{signal:this.signal}),this.render()}scheduleRender(){this.rafPending||(this.rafPending=!0,requestAnimationFrame(()=>{this.rafPending=!1,this.render()}))}template(){const{currentTime:e,duration:t,isLive:i,isSyncWithLive:r}=this.state;let s;if(i)if(r||!Number.isFinite(t))s=ke(Date.now());else{s=`- ${ye(t-e)}`}else s=`${ye(e)} / ${ye(t)}`;return O`<div class="eb-time-display">${s}</div>`}}class Ce extends oe{onConnect(){this.state.on("isLive",()=>this.render(),{signal:this.signal}),this.state.on("isSyncWithLive",()=>this.render(),{signal:this.signal}),this.render()}template(){const{isLive:e,isSyncWithLive:t}=this.state,i=!0===this.config.liveButton||!0===this.config.isLive;return e||i?O`
81
112
  <button
82
113
  class="${t?"eb-live-sync eb-live-synced":"eb-live-sync"}"
83
114
  aria-label="Go to live"
84
115
  @click="${()=>this.bus.emit("sync-live")}"
85
116
  >
86
- ${oe("live")}
117
+ <span class="eb-live-sync__icon">${me("live")}</span>
118
+ <span class="eb-live-sync__dot"></span>
119
+ <span class="eb-live-sync__label">LIVE</span>
87
120
  </button>
88
- `:V`<button class="eb-live-sync" hidden style="display:none">${oe("live")}</button>`}}const fe=[.25,.5,.75,1,1.25,1.5,1.75,2];class ve extends te{constructor(){super(...arguments),this.mode="root"}onConnect(){this.state.on("settingsOpen",()=>{this.state.settingsOpen||(this.mode="root"),this.render()},{signal:this.signal}),this.state.on("qualityLevels",()=>this.render(),{signal:this.signal}),this.state.on("currentQuality",()=>this.render(),{signal:this.signal}),this.state.on("audioTracks",()=>this.render(),{signal:this.signal}),this.state.on("currentAudioTrack",()=>this.render(),{signal:this.signal}),this.state.on("subtitleTracks",()=>this.render(),{signal:this.signal}),this.state.on("currentSubtitleTrack",()=>this.render(),{signal:this.signal}),this.state.on("playbackRate",()=>this.render(),{signal:this.signal}),this.render()}navigateTo(e){this.mode=e,this.render()}navigateBack(){this.mode="root",this.render()}renderRootMenu(){const e=this.state.qualityLevels,t=this.state.audioTracks,s=this.state.subtitleTracks,i=e.length>0,r=!0===this.config.speed,n=t.length>1,a=s.length>0;return V`
121
+ `:O`<button class="eb-live-sync" hidden style="display:none">${me("live")}</button>`}}const _e=[.25,.5,.75,1,1.25,1.5,1.75,2];class Ee extends oe{constructor(){super(...arguments),this.mode="root",this.verticalDir="up",this.horizontalDir="right",this.outsideClickHandler=null,this.outsideClickTimer=null}onConnect(){this.state.on("settingsOpen",()=>{this.state.settingsOpen?(this.computePlacement(),this.addOutsideClickListener()):(this.mode="root",this.removeOutsideClickListener()),this.render()},{signal:this.signal}),this.state.on("qualityLevels",()=>this.render(),{signal:this.signal}),this.state.on("currentQuality",()=>this.render(),{signal:this.signal}),this.state.on("audioTracks",()=>this.render(),{signal:this.signal}),this.state.on("currentAudioTrack",()=>this.render(),{signal:this.signal}),this.state.on("subtitleTracks",()=>this.render(),{signal:this.signal}),this.state.on("currentSubtitleTrack",()=>this.render(),{signal:this.signal}),this.state.on("playbackRate",()=>this.render(),{signal:this.signal}),this.signal.addEventListener("abort",()=>this.removeOutsideClickListener()),this.render()}computePlacement(){const e=this.el?.closest(".eb-player"),t=this.el?.querySelector(".eb-settings-toggle");if(!e||!t)return;const i=e.getBoundingClientRect(),r=t.getBoundingClientRect(),s=r.top+r.height/2-i.top,a=r.left+r.width/2-i.left;this.verticalDir=s<i.height/2?"down":"up",this.horizontalDir=a<i.width/2?"left":"right"}navigateTo(e){this.mode=e,this.render()}navigateBack(){this.mode="root",this.render()}currentValueLabel(e){const t=this.i18n;if("quality"===e){const e=this.state.qualityLevels,i=this.state.currentQuality;if(-1===i)return t.t("settings.auto");const r=e[i];return r?.height?`${r.height}p`:t.t("settings.auto")}if("speed"===e){const e=this.state.playbackRate;return 1===e?t.t("settings.normal"):`${e}x`}if("audio"===e){const e=this.state.audioTracks[this.state.currentAudioTrack];return e?.name||e?.lang||t.t("settings.default")}if("subtitles"===e){const e=this.state.currentSubtitleTrack;if(-1===e)return t.t("settings.off");const i=this.state.subtitleTracks[e];return i?.name||i?.lang||`Track ${e}`}return""}renderRootMenu(){const e=this.state.qualityLevels,t=this.state.audioTracks,i=this.state.subtitleTracks,r=this.i18n,s=e.length>0,a=!0===this.config.speed,n=t.length>1,o=i.length>0,l=(e,t,i,r)=>O`
122
+ <li>
123
+ <button class="eb-settings-category" @click="${()=>this.navigateTo(r)}">
124
+ <span class="eb-settings-category__icon">${me(e)}</span>
125
+ <span class="eb-settings-category__label">${t}</span>
126
+ <span class="eb-settings-category__value">${i}</span>
127
+ <span class="eb-settings-category__chevron">${me("chevron-right")}</span>
128
+ </button>
129
+ </li>
130
+ `;return O`
89
131
  <ul class="eb-settings-menu eb-settings-root">
90
- ${i?V`
91
- <li>
92
- <button class="eb-settings-category" @click="${()=>this.navigateTo("quality")}">
93
- Quality
94
- </button>
95
- </li>
96
- `:""}
97
- ${r?V`
98
- <li>
99
- <button class="eb-settings-category" @click="${()=>this.navigateTo("speed")}">
100
- Speed
101
- </button>
102
- </li>
103
- `:""}
104
- ${n?V`
105
- <li>
106
- <button class="eb-settings-category" @click="${()=>this.navigateTo("audio")}">
107
- Audio
108
- </button>
109
- </li>
110
- `:""}
111
- ${a?V`
112
- <li>
113
- <button class="eb-settings-category" @click="${()=>this.navigateTo("subtitles")}">
114
- Subtitles
115
- </button>
116
- </li>
117
- `:""}
132
+ ${n?l("audio",r.t("settings.audio"),this.currentValueLabel("audio"),"audio"):""}
133
+ ${o?l("subtitle",r.t("settings.subtitles"),this.currentValueLabel("subtitles"),"subtitles"):""}
134
+ ${a?l("speed",r.t("settings.speed"),this.currentValueLabel("speed"),"speed"):""}
135
+ ${s?l("quality",r.t("settings.quality"),this.currentValueLabel("quality"),"quality"):""}
118
136
  </ul>
119
- `}renderSubMenu(e,t,s){return V`
137
+ `}renderSubMenu(e,t,i){return O`
120
138
  <div class="eb-settings-submenu">
121
- <button class="eb-settings-back" @click="${()=>this.navigateBack()}">
122
- ${e}
123
- </button>
139
+ <div class="eb-settings-header">
140
+ <button class="eb-settings-back" @click="${()=>this.navigateBack()}">
141
+ ${me("chevron-left")}
142
+ </button>
143
+ <span class="eb-settings-header__title">${e}</span>
144
+ </div>
124
145
  <ul class="eb-settings-menu">
125
- ${t.map(e=>V`
146
+ ${t.map(e=>O`
126
147
  <li>
127
148
  <button
128
149
  class="eb-settings-item ${e.selected?"eb-settings-item--selected":""}"
129
- @click="${()=>s(e)}"
150
+ @click="${()=>i(e)}"
130
151
  >
131
152
  ${e.label}
132
153
  </button>
@@ -134,11 +155,11 @@ var EBPlayerBundle=function(e){"use strict";function t(e,t){void 0===t&&(t={});v
134
155
  `)}
135
156
  </ul>
136
157
  </div>
137
- `}renderQualityMenu(){const e=function(e,t){const s=e.map((e,s)=>({label:e.height?`${e.height}p`:`${Math.round((e.bitrate??0)/1e3)} kbps`,value:s,selected:s===t}));return s.push({label:"Auto",value:-1,selected:-1===t}),s}(this.state.qualityLevels,this.state.currentQuality);return this.renderSubMenu("Quality",e,e=>{this.bus.emit("settings-select-quality",{index:e.value})})}renderSpeedMenu(){const e=function(e){return fe.map(t=>({label:1===t?"Normal":`${t}x`,value:t,selected:t===e}))}(this.state.playbackRate);return this.renderSubMenu("Speed",e,e=>{this.bus.emit("settings-select-speed",{rate:e.value})})}renderAudioMenu(){const e=function(e,t){return e.map((e,s)=>({label:e.name||e.lang||`Track ${s}`,value:s,selected:s===t}))}(this.state.audioTracks,this.state.currentAudioTrack);return this.renderSubMenu("Audio",e,e=>{this.bus.emit("settings-select-audio",{index:e.value})})}renderSubtitlesMenu(){const e=function(e,t){const s=e.map((e,s)=>({label:e.name||e.lang||`Track ${s}`,value:s,selected:s===t}));return s.push({label:"Off",value:-1,selected:-1===t}),s}(this.state.subtitleTracks,this.state.currentSubtitleTrack);return this.renderSubMenu("Subtitles",e,e=>{this.bus.emit("settings-select-subtitle",{index:e.value})})}toggleSettings(){this.state.settingsOpen=!this.state.settingsOpen}template(){let e;if(this.state.settingsOpen){let t;t="quality"===this.mode?this.renderQualityMenu():"speed"===this.mode?this.renderSpeedMenu():"audio"===this.mode?this.renderAudioMenu():"subtitles"===this.mode?this.renderSubtitlesMenu():this.renderRootMenu(),e=V`
138
- <div class="eb-settings-panel">
158
+ `}renderQualityMenu(){const e=function(e,t){const i=e.map((e,i)=>({label:e.height?`${e.height}p`:`${Math.round((e.bitrate??0)/1e3)} kbps`,value:i,selected:i===t}));return i.push({label:"Auto",value:-1,selected:-1===t}),i}(this.state.qualityLevels,this.state.currentQuality);return this.renderSubMenu(this.i18n.t("settings.quality"),e,e=>{this.bus.emit("settings-select-quality",{index:e.value})})}renderSpeedMenu(){const e=function(e){return _e.map(t=>({label:1===t?"Normal":`${t}x`,value:t,selected:t===e}))}(this.state.playbackRate);return this.renderSubMenu(this.i18n.t("settings.speed"),e,e=>{this.bus.emit("settings-select-speed",{rate:e.value})})}renderAudioMenu(){const e=function(e,t){return e.map((e,i)=>({label:e.name||e.lang||`Track ${i}`,value:i,selected:i===t}))}(this.state.audioTracks,this.state.currentAudioTrack);return this.renderSubMenu(this.i18n.t("settings.audio"),e,e=>{this.bus.emit("settings-select-audio",{index:e.value})})}renderSubtitlesMenu(){const e=function(e,t){const i=e.map((e,i)=>({label:e.name||e.lang||`Track ${i}`,value:i,selected:i===t}));return i.push({label:"Off",value:-1,selected:-1===t}),i}(this.state.subtitleTracks,this.state.currentSubtitleTrack);return this.renderSubMenu(this.i18n.t("settings.subtitles"),e,e=>{this.bus.emit("settings-select-subtitle",{index:e.value})})}addOutsideClickListener(){this.removeOutsideClickListener(),this.outsideClickTimer=setTimeout(()=>{this.outsideClickTimer=null,this.state?.settingsOpen&&(this.outsideClickHandler=e=>{const t=this.el?.querySelector(".eb-settings-wrapper");t&&!t.contains(e.target)&&(this.state.settingsOpen=!1)},document.addEventListener("click",this.outsideClickHandler,{capture:!0}))},0)}removeOutsideClickListener(){null!==this.outsideClickTimer&&(clearTimeout(this.outsideClickTimer),this.outsideClickTimer=null),null!==this.outsideClickHandler&&(document.removeEventListener("click",this.outsideClickHandler,{capture:!0}),this.outsideClickHandler=null)}toggleSettings(){this.state.settingsOpen=!this.state.settingsOpen}template(){let e;if(this.state.settingsOpen){let t;t="quality"===this.mode?this.renderQualityMenu():"speed"===this.mode?this.renderSpeedMenu():"audio"===this.mode?this.renderAudioMenu():"subtitles"===this.mode?this.renderSubtitlesMenu():this.renderRootMenu();const i=`eb-settings-panel eb-settings-panel--${this.verticalDir} eb-settings-panel--${this.horizontalDir}`;e=O`
159
+ <div class="${i}">
139
160
  ${t}
140
161
  </div>
141
- `}else e=V``;return V`
162
+ `}else e=O``;return O`
142
163
  <div class="eb-settings-wrapper">
143
164
  ${e}
144
165
  <button
@@ -146,109 +167,71 @@ var EBPlayerBundle=function(e){"use strict";function t(e,t){void 0===t&&(t={});v
146
167
  aria-label="Settings"
147
168
  @click="${()=>this.toggleSettings()}"
148
169
  >
149
- ${oe("settings")}
170
+ ${me("settings")}
150
171
  </button>
151
172
  </div>
152
- `}}class ye extends te{constructor(){super(...arguments),this.pipEnabled=!1,this.videoEl=null,this.enterHandler=null,this.leaveHandler=null}onConnect(){if(this.pipEnabled=!0===this.config.pip&&!0===document.pictureInPictureEnabled,this.pipEnabled){const e=this.el.closest(".eb-player");this.videoEl=null!==e?e.querySelector("video.eb-video"):this.el.querySelector("video"),null!==this.videoEl&&(this.enterHandler=()=>{this.state.isPip=!0},this.leaveHandler=()=>{this.state.isPip=!1},this.videoEl.addEventListener("enterpictureinpicture",this.enterHandler),this.videoEl.addEventListener("leavepictureinpicture",this.leaveHandler),this.signal.addEventListener("abort",()=>{this.videoEl.removeEventListener("enterpictureinpicture",this.enterHandler),this.videoEl.removeEventListener("leavepictureinpicture",this.leaveHandler),this.enterHandler=null,this.leaveHandler=null,this.videoEl=null}))}this.state.on("isPip",()=>this.render(),{signal:this.signal}),this.render()}handleClick(){this.state.isPip?document.exitPictureInPicture():null!==this.videoEl&&this.videoEl.requestPictureInPicture()}template(){if(!this.pipEnabled)return V`<button class="eb-pip" hidden aria-hidden="true">${oe("pip")}</button>`;const e=this.state.isPip?"Exit picture-in-picture":"Picture-in-picture";return V`
173
+ `}}class Te extends oe{constructor(){super(...arguments),this.pipEnabled=!1,this.videoEl=null,this.enterHandler=null,this.leaveHandler=null}onConnect(){if(this.pipEnabled=!0===this.config.pip&&!0===document.pictureInPictureEnabled,this.pipEnabled){const e=this.el.closest(".eb-player");this.videoEl=null!==e?e.querySelector("video.eb-video"):this.el.querySelector("video"),null!==this.videoEl&&(this.enterHandler=()=>{this.state.isPip=!0},this.leaveHandler=()=>{this.state.isPip=!1},this.videoEl.addEventListener("enterpictureinpicture",this.enterHandler),this.videoEl.addEventListener("leavepictureinpicture",this.leaveHandler),this.signal.addEventListener("abort",()=>{this.videoEl.removeEventListener("enterpictureinpicture",this.enterHandler),this.videoEl.removeEventListener("leavepictureinpicture",this.leaveHandler),this.enterHandler=null,this.leaveHandler=null,this.videoEl=null}))}this.state.on("isPip",()=>this.render(),{signal:this.signal}),this.render()}handleClick(){this.state.isPip?document.exitPictureInPicture():null!==this.videoEl&&this.videoEl.requestPictureInPicture()}template(){if(!this.pipEnabled)return O`<button class="eb-pip" hidden aria-hidden="true">${me("pip")}</button>`;const e=this.state.isPip?"Exit picture-in-picture":"Picture-in-picture";return O`
153
174
  <button
154
175
  class="${this.state.isPip?"eb-pip eb-pip-active":"eb-pip"}"
155
176
  aria-label="${e}"
156
177
  @click="${()=>this.handleClick()}"
157
178
  >
158
- ${oe("pip")}
179
+ ${me("pip")}
159
180
  </button>
160
- `}}class ke extends te{onConnect(){this.state.on("castAvailable",()=>this.render(),{signal:this.signal}),this.state.on("isCasting",()=>this.render(),{signal:this.signal}),this.render()}template(){const{castAvailable:e,isCasting:t,src:s}=this.state;return e?V`
181
+ `}}class Le extends oe{onConnect(){this.state.on("castAvailable",()=>this.render(),{signal:this.signal}),this.state.on("isCasting",()=>this.render(),{signal:this.signal}),this.render()}template(){const{castAvailable:e,isCasting:t,src:i}=this.state;return e?O`
161
182
  <button
162
183
  class="${t?"eb-cast eb-cast-active":"eb-cast"}"
163
184
  aria-label="${t?"Stop casting":"Cast"}"
164
- @click="${()=>this.bus.emit("cast-start",{src:s})}"
185
+ @click="${()=>this.bus.emit("cast-start",{src:i})}"
165
186
  >
166
- ${oe("cast")}
187
+ ${me("cast")}
167
188
  </button>
168
- `:V`<button class="eb-cast" hidden aria-hidden="true">${oe("cast")}</button>`}}const xe=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],we=(()=>{if("undefined"==typeof document)return!1;const e=xe[0],t={};for(const s of xe){const i=s?.[1];if(i in document){for(const[i,r]of s.entries())t[e[i]]=r;return t}}return!1})(),Te={change:we.fullscreenchange,error:we.fullscreenerror};let Ce={request:(e=document.documentElement,t)=>new Promise((s,i)=>{const r=()=>{Ce.off("change",r),s()};Ce.on("change",r);const n=e[we.requestFullscreen](t);n instanceof Promise&&n.then(r).catch(i)}),exit:()=>new Promise((e,t)=>{if(!Ce.isFullscreen)return void e();const s=()=>{Ce.off("change",s),e()};Ce.on("change",s);const i=document[we.exitFullscreen]();i instanceof Promise&&i.then(s).catch(t)}),toggle:(e,t)=>Ce.isFullscreen?Ce.exit():Ce.request(e,t),onchange(e){Ce.on("change",e)},onerror(e){Ce.on("error",e)},on(e,t){const s=Te[e];s&&document.addEventListener(s,t,!1)},off(e,t){const s=Te[e];s&&document.removeEventListener(s,t,!1)},raw:we};Object.defineProperties(Ce,{isFullscreen:{get:()=>Boolean(document[we.fullscreenElement])},element:{enumerable:!0,get:()=>document[we.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>Boolean(document[we.fullscreenEnabled])}}),we||(Ce={isEnabled:!1});var Ee=Ce;class Le extends te{constructor(){super(...arguments),this.changeHandler=null}onConnect(){this.state.on("isFullscreen",()=>this.render(),{signal:this.signal}),Ee.isEnabled&&(this.changeHandler=()=>{this.state.isFullscreen=Ee.isFullscreen,this.render()},Ee.on("change",this.changeHandler),this.signal.addEventListener("abort",()=>{Ee.off("change",this.changeHandler),this.changeHandler=null})),this.render()}handleClick(){if(!Ee.isEnabled)return;const e=this.el.closest(".eb-player")??this.el;Ee.toggle(e)}template(){if(!Ee.isEnabled)return V`<button class="eb-fullscreen" hidden aria-hidden="true">${oe("fullscreen")}</button>`;const e=this.state.isFullscreen;return V`
189
+ `:O`<button class="eb-cast" hidden aria-hidden="true">${me("cast")}</button>`}}const Ae=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],Se=(()=>{if("undefined"==typeof document)return!1;const e=Ae[0],t={};for(const i of Ae){const r=i?.[1];if(r in document){for(const[r,s]of i.entries())t[e[r]]=s;return t}}return!1})(),$e={change:Se.fullscreenchange,error:Se.fullscreenerror};let Me={request:(e=document.documentElement,t)=>new Promise((i,r)=>{const s=()=>{Me.off("change",s),i()};Me.on("change",s);const a=e[Se.requestFullscreen](t);a instanceof Promise&&a.then(s).catch(r)}),exit:()=>new Promise((e,t)=>{if(!Me.isFullscreen)return void e();const i=()=>{Me.off("change",i),e()};Me.on("change",i);const r=document[Se.exitFullscreen]();r instanceof Promise&&r.then(i).catch(t)}),toggle:(e,t)=>Me.isFullscreen?Me.exit():Me.request(e,t),onchange(e){Me.on("change",e)},onerror(e){Me.on("error",e)},on(e,t){const i=$e[e];i&&document.addEventListener(i,t,!1)},off(e,t){const i=$e[e];i&&document.removeEventListener(i,t,!1)},raw:Se};Object.defineProperties(Me,{isFullscreen:{get:()=>Boolean(document[Se.fullscreenElement])},element:{enumerable:!0,get:()=>document[Se.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>Boolean(document[Se.fullscreenEnabled])}}),Se||(Me={isEnabled:!1});var Pe=Me;class Re extends oe{constructor(){super(...arguments),this.changeHandler=null,this.videoEl=null,this.videoFullscreenBeginHandler=null,this.videoFullscreenEndHandler=null,this.useVideoFallback=!1,this.handleDocFullscreenChange=()=>{const e=document.fullscreenElement===this.videoEl;this.state.isFullscreen=e,this.render()}}onConnect(){this.state.on("isFullscreen",()=>this.render(),{signal:this.signal}),Pe.isEnabled?(this.changeHandler=()=>{this.state.isFullscreen=Pe.isFullscreen,this.render()},Pe.on("change",this.changeHandler),this.signal.addEventListener("abort",()=>{Pe.off("change",this.changeHandler),this.changeHandler=null})):this.initVideoFallback(),this.render()}initVideoFallback(){const e=this.el?.closest(".eb-player");if(!e)return;const t=e.querySelector("video.eb-video");if(!t)return;const i="function"==typeof t.webkitEnterFullscreen,r="function"==typeof t.requestFullscreen;(i||r)&&(this.videoEl=t,this.useVideoFallback=!0,this.videoFullscreenBeginHandler=()=>{this.state.isFullscreen=!0,this.render()},this.videoFullscreenEndHandler=()=>{this.state.isFullscreen=!1,this.render()},t.addEventListener("webkitbeginfullscreen",this.videoFullscreenBeginHandler),t.addEventListener("webkitendfullscreen",this.videoFullscreenEndHandler),document.addEventListener("fullscreenchange",this.handleDocFullscreenChange),this.signal.addEventListener("abort",()=>{t.removeEventListener("webkitbeginfullscreen",this.videoFullscreenBeginHandler),t.removeEventListener("webkitendfullscreen",this.videoFullscreenEndHandler),document.removeEventListener("fullscreenchange",this.handleDocFullscreenChange),this.videoFullscreenBeginHandler=null,this.videoFullscreenEndHandler=null,this.videoEl=null}))}handleClick(){if(Pe.isEnabled){const e=this.el.closest(".eb-player")??this.el;return void Pe.toggle(e)}this.useVideoFallback&&this.videoEl&&(this.state.isFullscreen?"function"==typeof this.videoEl.webkitExitFullscreen?this.videoEl.webkitExitFullscreen():document.exitFullscreen&&document.exitFullscreen():"function"==typeof this.videoEl.webkitEnterFullscreen?this.videoEl.webkitEnterFullscreen():"function"==typeof this.videoEl.requestFullscreen&&this.videoEl.requestFullscreen())}template(){if(!(Pe.isEnabled||this.useVideoFallback))return O`<button class="eb-fullscreen" hidden aria-hidden="true">${me("fullscreen")}</button>`;const e=this.state.isFullscreen;return O`
169
190
  <button
170
191
  class="eb-fullscreen"
171
192
  aria-label="${e?"Exit fullscreen":"Fullscreen"}"
172
193
  @click="${()=>this.handleClick()}"
173
194
  >
174
- ${oe(e?"fullscreen-exit":"fullscreen")}
195
+ ${me(e?"fullscreen-exit":"fullscreen")}
175
196
  </button>
176
- `}}class Ae extends te{onConnect(){this.state.on("adPlaying",()=>this.render(),{signal:this.signal}),this.render()}template(){if(this.state.adPlaying)return V``;const e=this.config.seekOffset||15,t="modern"===this.config.skin;return V`
197
+ `}}class Be extends oe{onConnect(){this.state.on("adPlaying",()=>this.render(),{signal:this.signal}),this.render()}template(){if(this.state.adPlaying)return O``;const e=this.config.seekOffset||15,t="modern"===this.config.skin;return O`
177
198
  <button
178
199
  class="eb-button eb-middle-bar__seek-btn"
179
200
  aria-label="Rewind ${e} seconds"
180
201
  @click="${()=>this.handleClick()}"
181
202
  >
182
- ${t?oe("rewind","eb-seek-circle"):V`<svg class="eb-seek-circle" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
183
- <path d="M20 4a16 16 0 1 0 1.25.05" stroke="currentColor" stroke-width="3" stroke-linecap="round"/>
184
- <path d="M20 4l-5 4 5 4" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
203
+ ${t?me("rewind","eb-seek-circle"):O`<svg class="eb-seek-circle" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
204
+ <path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z" fill="currentColor"/>
185
205
  </svg>`}
186
- <span class="eb-seek-label">${e}s</span>
206
+ <span class="eb-seek-label">${e}</span>
187
207
  </button>
188
- `}handleClick(){const e=this.config.seekOffset||15,t=Math.max(this.state.currentTime-e,0);this.bus.emit("seek",{time:t})}}class Se extends te{onConnect(){this.state.on("adPlaying",()=>this.render(),{signal:this.signal}),this.render()}template(){if(this.state.adPlaying)return V``;const e=this.config.seekOffset||15,t="modern"===this.config.skin;return V`
208
+ `}handleClick(){const e=this.config.seekOffset||15,t=Math.max(this.state.currentTime-e,0);this.bus.emit("seek",{time:t})}}class qe extends oe{onConnect(){this.state.on("adPlaying",()=>this.render(),{signal:this.signal}),this.render()}template(){if(this.state.adPlaying)return O``;const e=this.config.seekOffset||15,t="modern"===this.config.skin;return O`
189
209
  <button
190
210
  class="eb-button eb-middle-bar__seek-btn"
191
211
  aria-label="Forward ${e} seconds"
192
212
  @click="${()=>this.handleClick()}"
193
213
  >
194
- ${t?oe("forward","eb-seek-circle"):V`<svg class="eb-seek-circle" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
195
- <path d="M20 4a16 16 0 1 1-1.25.05" stroke="currentColor" stroke-width="3" stroke-linecap="round"/>
196
- <path d="M20 4l5 4-5 4" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
214
+ ${t?me("forward","eb-seek-circle"):O`<svg class="eb-seek-circle" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
215
+ <path d="M12 5V1l5 5-5 5V7c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6h2c0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8z" fill="currentColor"/>
197
216
  </svg>`}
198
- <span class="eb-seek-label">${e}s</span>
217
+ <span class="eb-seek-label">${e}</span>
199
218
  </button>
200
- `}handleClick(){const e=this.config.seekOffset||15,t=Math.min(this.state.currentTime+e,this.state.duration);this.bus.emit("seek",{time:t})}}class _e extends te{constructor(){super(...arguments),this.isDragging=!1,this.dragValue=0,this.rafPending=!1,this.tooltipVisible=!1,this.tooltipTime=0,this.tooltipX=0,this.previewVideoEl=null,this.snapshotTake=null}onConnect(){this.bus.on("snapshot-handler-ready",e=>{this.snapshotTake=e.take,this.previewVideoEl=e.video,this.previewVideoEl.className="eb-seekbar-preview",this.previewVideoEl.muted=!0},{signal:this.signal}),this.state.on("currentTime",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("duration",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("bufferedEnd",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("isRtl",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("adPlaying",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("chapters",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("epgPrograms",()=>this.scheduleRender(),{signal:this.signal}),this.render()}scheduleRender(){this.rafPending||(this.rafPending=!0,requestAnimationFrame(()=>{this.rafPending=!1,this.render()}))}eventToTime(e,t){const s=t.getBoundingClientRect(),i=(e.clientX-s.left)/s.width,r=this.state.isRtl?1-i:i;return Math.min(1,Math.max(0,r))*this.state.duration}handlePointerDown(e){if(this.state.adPlaying)return;const t=e.currentTarget;"function"==typeof t.setPointerCapture&&t.setPointerCapture(e.pointerId),this.isDragging=!0,this.dragValue=this.eventToTime(e,t),this.render()}handlePointerMove(e){if(this.isDragging){const t=e.currentTarget;this.dragValue=this.eventToTime(e,t),this.scheduleRender()}this.updateTooltip(e)}handlePointerUp(e){if(!this.isDragging)return;const t=e.currentTarget,s=this.eventToTime(e,t);this.isDragging=!1,this.bus.emit("seek",{time:s}),this.render()}handlePointerLeave(){this.tooltipVisible=!1,this.render()}updateTooltip(e){const t=e.currentTarget.getBoundingClientRect(),s=(e.clientX-t.left)/t.width,i=Math.min(1,Math.max(0,s));this.tooltipTime=this.state.isRtl?(1-i)*this.state.duration:i*this.state.duration,this.tooltipX=Math.min(t.width,Math.max(0,e.clientX-t.left)),this.tooltipVisible=!0,null!==this.snapshotTake&&this.snapshotTake(this.tooltipTime),this.render()}findActiveChapter(e){const t=this.state.currentTime;for(const s of e)if(t>=s.startTime&&t<=s.endTime)return s;return null}findSkippableChapter(e){const t=this.config.skippableChapters;for(const s of t)if(s.chapter===e.title)return s;return null}renderEpgSegments(e){if(0===e.length)return[];const t=e[0].start,s=e[e.length-1].end-t;if(s<=0)return[];const i=Date.now();return e.map(e=>{const r=(e.start-t)/s*100,n=(e.end-e.start)/s*100,a=i>=e.start&&i<e.end;return V`
201
- <div
202
- class="eb-epg-segment${a?" eb-epg-current":""}"
203
- style="left: ${r.toFixed(2)}%; width: ${n.toFixed(2)}%"
204
- title="${e.title}"
205
- ></div>
206
- `})}template(){const{currentTime:e,duration:t,bufferedEnd:s,adPlaying:i,chapters:r,epgPrograms:n}=this.state,a=!this.config.seekbar,o=i,l=t>0?(this.isDragging?this.dragValue:e)/t*100:0,d=t>0?s/t*100:0,c=this.findActiveChapter(r),h=null!==c?this.findSkippableChapter(c):null,u=r.map(e=>{const s=t>0?e.startTime/t*100:0;return V`
207
- <div
208
- class="eb-chapter-marker${e===c?" eb-chapter-active":""}"
209
- style="left: ${s.toFixed(2)}%"
210
- title="${e.title}"
211
- ></div>
212
- `}),b=null!==c&&null!==h?V`
213
- <button
214
- class="eb-chapter-skip"
215
- @click="${()=>this.bus.emit("seek",{time:c.endTime})}"
216
- >${h.message}</button>
217
- `:V``,p=this.renderEpgSegments(n),m=this.state.isLive&&Number.isFinite(t)?pe(Date.now()-1e3*(t-this.tooltipTime)):be(this.tooltipTime),g=V`
218
- <div
219
- class="eb-seekbar-tooltip"
220
- style="left: ${this.tooltipX}px"
221
- ?hidden="${!this.tooltipVisible}"
222
- >
223
- ${m}
224
- ${null!==this.previewVideoEl?this.previewVideoEl:V``}
225
- </div>
226
- `;return V`
227
- <div
228
- class="eb-seekbar${o?" eb-seekbar-disabled":""}"
229
- ?hidden="${a}"
230
- >
231
- <div
232
- class="eb-seekbar-track"
233
- @pointerdown="${e=>this.handlePointerDown(e)}"
234
- @pointermove="${e=>this.handlePointerMove(e)}"
235
- @pointerup="${e=>this.handlePointerUp(e)}"
236
- @pointerleave="${()=>this.handlePointerLeave()}"
237
- >
238
- <div class="eb-seekbar-buffered" style="width: ${d.toFixed(2)}%"></div>
239
- <div class="eb-seekbar-progress" style="width: ${l.toFixed(2)}%">
240
- <div class="eb-seekbar-thumb"></div>
241
- </div>
242
- ${u}
243
- ${p}
244
- ${g}
245
- </div>
246
- ${b}
247
- </div>
248
- `}}class $e extends te{onConnect(){this.state.on("playbackState",()=>this.render(),{signal:this.signal}),this.state.on("reconnecting",()=>this.render(),{signal:this.signal}),this.render()}template(){const e="buffering"===this.state.playbackState,t=this.state.reconnecting;if(!e&&!t)return V`<div class="eb-loading" hidden aria-hidden="true">${oe("spinner")}</div>`;const s=t?this.i18n?.t("loading.reconnecting")??"Reconnecting...":"Loading";return V`<div class="eb-loading" role="status" aria-label="${s}">
249
- ${oe("spinner")}
250
- ${t?V`<span class="eb-loading-text">${s}</span>`:""}
251
- </div>`}}class Me extends te{onConnect(){this.state.on("error",()=>this.render(),{signal:this.signal}),this.render()}template(){const e=this.state.error;return null===e?V`<div class="eb-error" hidden aria-hidden="true"></div>`:V`
219
+ `}handleClick(){const e=this.config.seekOffset||15,t=Math.min(this.state.currentTime+e,this.state.duration);this.bus.emit("seek",{time:t})}}class De extends oe{onConnect(){this.render()}template(){return!1===this.config.socials?O`<span hidden></span>`:O`
220
+ <button
221
+ class="eb-button eb-top-bar__btn-share"
222
+ @click="${()=>{this.state.socialsOpen=!this.state.socialsOpen}}"
223
+ aria-label="Share"
224
+ >${me("share")}</button>
225
+ `}}class Fe extends oe{onConnect(){this.render()}template(){return O`
226
+ <button
227
+ class="eb-button eb-top-bar__btn-info"
228
+ @click="${()=>{this.state.infoOpen=!this.state.infoOpen}}"
229
+ aria-label="Info"
230
+ >${me("info")}</button>
231
+ `}}const ze={"play-pause":()=>new fe,volume:()=>new ve,seekbar:()=>new xe,time:()=>new we,"live-sync":()=>new Ce,settings:()=>new Ee,pip:()=>new Te,cast:()=>new Le,fullscreen:()=>new Re,rewind:()=>new Be,forward:()=>new qe,share:()=>new De,info:()=>new Fe};function Ve(e){return"seekbar"===e?".eb-bottom-bar__seekbar-zone":`.eb-slot-${e}`}class He extends oe{onConnect(){this.state.on("playbackState",()=>this.render(),{signal:this.signal}),this.state.on("reconnecting",()=>this.render(),{signal:this.signal}),this.render()}template(){const e="buffering"===this.state.playbackState,t=this.state.reconnecting;if(!e&&!t)return O`<div class="eb-loading" hidden aria-hidden="true">${me("spinner")}</div>`;const i=t?this.i18n?.t("loading.reconnecting")??"Reconnecting...":"Loading";return O`<div class="eb-loading" role="status" aria-label="${i}">
232
+ ${me("spinner")}
233
+ ${t?O`<span class="eb-loading-text">${i}</span>`:""}
234
+ </div>`}}class Ie extends oe{onConnect(){this.state.on("error",()=>this.render(),{signal:this.signal}),this.render()}template(){const e=this.state.error;return null===e?O`<div class="eb-error" hidden aria-hidden="true"></div>`:O`
252
235
  <div class="eb-error" role="alert">
253
236
  <p class="eb-error-message">${e}</p>
254
237
  <button
@@ -258,7 +241,7 @@ var EBPlayerBundle=function(e){"use strict";function t(e,t){void 0===t&&(t={});v
258
241
  Retry
259
242
  </button>
260
243
  </div>
261
- `}}class Pe extends te{onConnect(){this.state.on("socialsOpen",()=>this.render(),{signal:this.signal}),this.render()}template(){if(!this.state.socialsOpen)return V`<div class="eb-socials-overlay" hidden aria-hidden="true"></div>`;const e=this.config.socials,t=!1!==e?Object.entries(e).map(([e,t])=>V`
244
+ `}}class Ne extends oe{onConnect(){this.state.on("socialsOpen",()=>this.render(),{signal:this.signal}),this.render()}template(){if(!this.state.socialsOpen)return O`<div class="eb-socials-overlay" hidden aria-hidden="true"></div>`;const e=this.config.socials,t=!1!==e?Object.entries(e).map(([e,t])=>O`
262
245
  <a
263
246
  class="eb-socials-link eb-socials-link--${e}"
264
247
  href="${t}"
@@ -267,7 +250,7 @@ var EBPlayerBundle=function(e){"use strict";function t(e,t){void 0===t&&(t={});v
267
250
  >
268
251
  ${e}
269
252
  </a>
270
- `):[];return V`
253
+ `):[];return O`
271
254
  <div class="eb-socials-overlay" role="dialog" aria-label="Share">
272
255
  <div class="eb-socials-links">
273
256
  ${t}
@@ -280,7 +263,7 @@ var EBPlayerBundle=function(e){"use strict";function t(e,t){void 0===t&&(t={});v
280
263
  Close
281
264
  </button>
282
265
  </div>
283
- `}}class Re extends te{onConnect(){this.state.on("infoOpen",()=>this.render(),{signal:this.signal}),this.render()}template(){if(!this.state.infoOpen)return V`<div class="eb-info-overlay" hidden aria-hidden="true"></div>`;const e=this.config.about;return V`
266
+ `}}class Oe extends oe{onConnect(){this.state.on("infoOpen",()=>this.render(),{signal:this.signal}),this.render()}template(){if(!this.state.infoOpen)return O`<div class="eb-info-overlay" hidden aria-hidden="true"></div>`;const e=this.config.about;return O`
284
267
  <div class="eb-info-overlay" role="dialog" aria-label="About">
285
268
  <div class="eb-info-content">${e}</div>
286
269
  <button
@@ -291,7 +274,7 @@ var EBPlayerBundle=function(e){"use strict";function t(e,t){void 0===t&&(t={});v
291
274
  Close
292
275
  </button>
293
276
  </div>
294
- `}}class Be extends te{onConnect(){this.state.on("toast",()=>this.render(),{signal:this.signal}),this.render()}template(){const e=this.state.toast;return null===e?V`<div class="eb-toast" hidden aria-hidden="true"></div>`:V`<div class="eb-toast" role="status">${e}</div>`}}class De extends te{onConnect(){this.render(),this.state.on("playlist",()=>{this.render()},{signal:this.signal}),this.state.on("currentEpisode",()=>{this.render()},{signal:this.signal})}template(){const e=this.state?.playlist??[],t=this.state?.currentEpisode??0;return V`
277
+ `}}class je extends oe{onConnect(){this.state.on("toast",()=>this.render(),{signal:this.signal}),this.render()}template(){const e=this.state.toast;return null===e?O`<div class="eb-toast" hidden aria-hidden="true"></div>`:O`<div class="eb-toast" role="status">${e}</div>`}}class Ue extends oe{onConnect(){this.render(),this.state.on("playlist",()=>{this.render()},{signal:this.signal}),this.state.on("currentEpisode",()=>{this.render()},{signal:this.signal})}template(){const e=this.state?.playlist??[],t=this.state?.currentEpisode??0;return O`
295
278
  <div class="eb-forja-playlist-bar">
296
279
  <button
297
280
  class="eb-forja-playlist-bar__nav"
@@ -302,11 +285,11 @@ var EBPlayerBundle=function(e){"use strict";function t(e,t){void 0===t&&(t={});v
302
285
  &#8249;
303
286
  </button>
304
287
  <div class="eb-forja-playlist-bar__items">
305
- ${e.map((e,s)=>V`
288
+ ${e.map((e,i)=>O`
306
289
  <div
307
- class="eb-forja-playlist-bar__item${s===t?" eb-forja-playlist-bar__item--active":""}"
290
+ class="eb-forja-playlist-bar__item${i===t?" eb-forja-playlist-bar__item--active":""}"
308
291
  >
309
- ${e.image?V`<img
292
+ ${e.image?O`<img
310
293
  class="eb-forja-playlist-bar__thumb"
311
294
  src="${e.image}"
312
295
  alt=""
@@ -325,9 +308,9 @@ var EBPlayerBundle=function(e){"use strict";function t(e,t){void 0===t&&(t={});v
325
308
  &#8250;
326
309
  </button>
327
310
  </div>
328
- `}formatDuration(e){return`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`}}class Fe extends te{onConnect(){this.render(),this.state.on("epgPrograms",()=>{this.render()},{signal:this.signal})}template(){const e=this.state?.epgPrograms??[];return V`
311
+ `}formatDuration(e){return`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`}}class We extends oe{onConnect(){this.render(),this.state.on("epgPrograms",()=>{this.render()},{signal:this.signal})}template(){const e=this.state?.epgPrograms??[];return O`
329
312
  <div class="eb-snrt-carousel">
330
- ${e.map(e=>V`
313
+ ${e.map(e=>O`
331
314
  <div class="eb-snrt-carousel__item">
332
315
  <span class="eb-snrt-carousel__title">${e.title}</span>
333
316
  <span class="eb-snrt-carousel__time">
@@ -336,33 +319,33 @@ var EBPlayerBundle=function(e){"use strict";function t(e,t){void 0===t&&(t={});v
336
319
  </div>
337
320
  `)}
338
321
  </div>
339
- `}formatTime(e){return new Date(1e3*e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}}const Ve={play:'<symbol id="eb-play" viewBox="0 0 24 24"><path fill="currentColor" d="M8 5v14l11-7z"/></symbol>',pause:'<symbol id="eb-pause" viewBox="0 0 24 24"><path fill="currentColor" d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/></symbol>',"volume-high":'<symbol id="eb-volume-high" viewBox="0 0 24 24"><path fill="currentColor" d="M3 9v6h4l5 4V5L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/></symbol>',"volume-low":'<symbol id="eb-volume-low" viewBox="0 0 24 24"><path fill="currentColor" d="M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 4V5L9 9H5z"/></symbol>',"volume-mute":'<symbol id="eb-volume-mute" viewBox="0 0 24 24"><path fill="currentColor" d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 4v-7.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"/></symbol>',fullscreen:'<symbol id="eb-fullscreen" viewBox="0 0 24 24"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></symbol>',"fullscreen-exit":'<symbol id="eb-fullscreen-exit" viewBox="0 0 24 24"><path fill="currentColor" d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"/></symbol>',settings:'<symbol id="eb-settings" viewBox="0 0 24 24"><path fill="currentColor" d="M19.14 12.94c.04-.3.06-.61.06-.94s-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"/></symbol>',pip:'<symbol id="eb-pip" viewBox="0 0 24 24"><path fill="currentColor" d="M19 7h-8v6h8V7zm2-4H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14z"/></symbol>',cast:'<symbol id="eb-cast" viewBox="0 0 24 24"><path fill="currentColor" d="M21 3H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm0-4v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11z"/></symbol>',close:'<symbol id="eb-close" viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></symbol>',share:'<symbol id="eb-share" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-width="2" d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"/><polyline fill="none" stroke="currentColor" stroke-width="2" points="16 6 12 2 8 6"/><line fill="none" stroke="currentColor" stroke-width="2" x1="12" y1="2" x2="12" y2="15"/></symbol>',info:'<symbol id="eb-info" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></symbol>',speed:'<symbol id="eb-speed" viewBox="0 0 24 24"><path fill="currentColor" d="M20.38 8.57l-1.23 1.85a8 8 0 0 1-.22 7.58H5.07A8 8 0 0 1 15.58 6.85l1.85-1.23A10 10 0 0 0 3.35 19a2 2 0 0 0 1.72 1h13.85a2 2 0 0 0 1.74-1 10 10 0 0 0-.27-10.44zm-9.79 6.84a2 2 0 0 0 2.83 0l5.66-8.49-8.49 5.66a2 2 0 0 0 0 2.83z"/></symbol>',"chevron-left":'<symbol id="eb-chevron-left" viewBox="0 0 24 24"><polyline fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" points="15 18 9 12 15 6"/></symbol>',"chevron-right":'<symbol id="eb-chevron-right" viewBox="0 0 24 24"><polyline fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" points="9 18 15 12 9 6"/></symbol>',spinner:'<symbol id="eb-spinner" viewBox="0 0 24 24"><path fill="currentColor" d="M12 4V2A10 10 0 0 0 2 12h2a8 8 0 0 1 8-8z"/></symbol>',live:'<symbol id="eb-live" viewBox="0 0 24 24"><path fill="currentColor" d="M16.247 7.761a6 6 0 0 1 0 8.478"/><path fill="currentColor" d="M19.075 4.933a10 10 0 0 1 0 14.134"/><path fill="currentColor" d="M4.925 19.067a10 10 0 0 1 0-14.134"/><path fill="currentColor" d="M7.753 16.239a6 6 0 0 1 0-8.478"/><circle fill="currentColor" cx="12" cy="12" r="2"/></symbol>',subtitle:'<symbol id="eb-subtitle" viewBox="0 0 24 24"><path fill="currentColor" d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 7H8v-1.5H6V14h2v-1.5h4V15H6c-1.1 0-2-.9-2-2v-2c0-1.1.9-2 2-2h6v3zm8 0h-4v-1.5h-2V14h2v-1.5h4V15h-6c-1.1 0-2-.9-2-2v-2c0-1.1.9-2 2-2h6v3z"/></symbol>',audio:'<symbol id="eb-audio" viewBox="0 0 24 24"><path fill="currentColor" d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></symbol>',quality:'<symbol id="eb-quality" viewBox="0 0 24 24"><rect fill="currentColor" x="2" y="16" width="4" height="5" rx="1" opacity=".4"/><rect fill="currentColor" x="7" y="12" width="4" height="9" rx="1" opacity=".65"/><rect fill="currentColor" x="12" y="7" width="4" height="14" rx="1" opacity=".85"/><rect fill="currentColor" x="17" y="3" width="4" height="18" rx="1"/></symbol>',rewind:'<symbol id="eb-rewind" viewBox="0 0 24 24"><path fill="currentColor" d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/></symbol>',forward:'<symbol id="eb-forward" viewBox="0 0 24 24"><path fill="currentColor" d="M12 5V1l5 5-5 5V7c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6h2c0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8z"/></symbol>'};class ze extends te{constructor(){super(...arguments),this.videoElement=null,this.adsContainerElement=null,this.posterVideoElement=null,this.extensionCleanups=[],this.childComponents=[]}getVideoElement(){return this.videoElement}getAdsContainer(){return this.adsContainerElement}getPosterVideoElement(){return this.posterVideoElement}onConnect(){!function(){re={...se};const e=ne(re),t=document.getElementById("eb-sprite");null!==t&&(t.innerHTML=e)}(),ae(),"modern"===this.config.skin&&ae(Ve),this.render(),this.bindElementRefs(),this.connectChildComponents(),this.subscribeToState(),this.updateControlsVisibility(),this.invokeExtensions()}template(){const e=this.config,t=this.state;if(e.noUi)return this.renderNoUiTemplate();const s=t.isRtl,i=t.isIOS,r=e.middlebar,n=t.currentTime>0,a=!1!==e.image&&("idle"===t.playbackState||"loading"===t.playbackState||"playing"===t.playbackState&&!n),o=t.isRadio;return V`
322
+ `}formatTime(e){return new Date(1e3*e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}}const Ye={play:'<symbol id="eb-play" viewBox="0 0 24 24"><path fill="currentColor" d="M8 5v14l11-7z"/></symbol>',pause:'<symbol id="eb-pause" viewBox="0 0 24 24"><path fill="currentColor" d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/></symbol>',"volume-high":'<symbol id="eb-volume-high" viewBox="0 0 24 24"><path fill="currentColor" d="M3 9v6h4l5 4V5L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/></symbol>',"volume-low":'<symbol id="eb-volume-low" viewBox="0 0 24 24"><path fill="currentColor" d="M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 4V5L9 9H5z"/></symbol>',"volume-mute":'<symbol id="eb-volume-mute" viewBox="0 0 24 24"><path fill="currentColor" d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 4v-7.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"/></symbol>',fullscreen:'<symbol id="eb-fullscreen" viewBox="0 0 24 24"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></symbol>',"fullscreen-exit":'<symbol id="eb-fullscreen-exit" viewBox="0 0 24 24"><path fill="currentColor" d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"/></symbol>',settings:'<symbol id="eb-settings" viewBox="0 0 24 24"><path fill="currentColor" d="M19.14 12.94c.04-.3.06-.61.06-.94s-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"/></symbol>',pip:'<symbol id="eb-pip" viewBox="0 0 24 24"><path fill="currentColor" d="M19 7h-8v6h8V7zm2-4H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14z"/></symbol>',cast:'<symbol id="eb-cast" viewBox="0 0 24 24"><path fill="currentColor" d="M21 3H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm0-4v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11z"/></symbol>',close:'<symbol id="eb-close" viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></symbol>',share:'<symbol id="eb-share" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-width="2" d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"/><polyline fill="none" stroke="currentColor" stroke-width="2" points="16 6 12 2 8 6"/><line fill="none" stroke="currentColor" stroke-width="2" x1="12" y1="2" x2="12" y2="15"/></symbol>',info:'<symbol id="eb-info" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></symbol>',speed:'<symbol id="eb-speed" viewBox="0 0 24 24"><path fill="currentColor" d="M20.38 8.57l-1.23 1.85a8 8 0 0 1-.22 7.58H5.07A8 8 0 0 1 15.58 6.85l1.85-1.23A10 10 0 0 0 3.35 19a2 2 0 0 0 1.72 1h13.85a2 2 0 0 0 1.74-1 10 10 0 0 0-.27-10.44zm-9.79 6.84a2 2 0 0 0 2.83 0l5.66-8.49-8.49 5.66a2 2 0 0 0 0 2.83z"/></symbol>',"chevron-left":'<symbol id="eb-chevron-left" viewBox="0 0 24 24"><polyline fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" points="15 18 9 12 15 6"/></symbol>',"chevron-right":'<symbol id="eb-chevron-right" viewBox="0 0 24 24"><polyline fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" points="9 18 15 12 9 6"/></symbol>',spinner:'<symbol id="eb-spinner" viewBox="0 0 24 24"><path fill="currentColor" d="M12 4V2A10 10 0 0 0 2 12h2a8 8 0 0 1 8-8z"/></symbol>',live:'<symbol id="eb-live" viewBox="0 0 24 24"><path fill="currentColor" d="M16.247 7.761a6 6 0 0 1 0 8.478"/><path fill="currentColor" d="M19.075 4.933a10 10 0 0 1 0 14.134"/><path fill="currentColor" d="M4.925 19.067a10 10 0 0 1 0-14.134"/><path fill="currentColor" d="M7.753 16.239a6 6 0 0 1 0-8.478"/><circle fill="currentColor" cx="12" cy="12" r="2"/></symbol>',subtitle:'<symbol id="eb-subtitle" viewBox="0 0 24 24"><path fill="currentColor" d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 7H8v-1.5H6V14h2v-1.5h4V15H6c-1.1 0-2-.9-2-2v-2c0-1.1.9-2 2-2h6v3zm8 0h-4v-1.5h-2V14h2v-1.5h4V15h-6c-1.1 0-2-.9-2-2v-2c0-1.1.9-2 2-2h6v3z"/></symbol>',audio:'<symbol id="eb-audio" viewBox="0 0 24 24"><path fill="currentColor" d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></symbol>',quality:'<symbol id="eb-quality" viewBox="0 0 24 24"><rect fill="currentColor" x="2" y="16" width="4" height="5" rx="1" opacity=".4"/><rect fill="currentColor" x="7" y="12" width="4" height="9" rx="1" opacity=".65"/><rect fill="currentColor" x="12" y="7" width="4" height="14" rx="1" opacity=".85"/><rect fill="currentColor" x="17" y="3" width="4" height="18" rx="1"/></symbol>',rewind:'<symbol id="eb-rewind" viewBox="0 0 24 24"><path fill="currentColor" d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/></symbol>',forward:'<symbol id="eb-forward" viewBox="0 0 24 24"><path fill="currentColor" d="M12 5V1l5 5-5 5V7c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6h2c0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8z"/></symbol>'};class Ge extends oe{constructor(){super(...arguments),this.videoElement=null,this.adsContainerElement=null,this.posterVideoElement=null,this.extensionCleanups=[],this.childComponents=[]}getVideoElement(){return this.videoElement}getAdsContainer(){return this.adsContainerElement}getPosterVideoElement(){return this.posterVideoElement}onConnect(){!function(){be={...ce};const e=ue(be),t=document.getElementById("eb-sprite");null!==t&&(t.innerHTML=e)}(),pe(),"modern"===this.config.skin&&pe(Ye),this.render(),this.bindElementRefs(),this.connectChildComponents(),this.subscribeToState(),this.updateControlsVisibility(),this.invokeExtensions()}template(){const e=this.config,t=this.state;if(e.noUi)return this.renderNoUiTemplate();const i=t.isRtl,r=t.isIOS,s=e.middlebar,a=t.currentTime>0,n=!1!==e.image&&("idle"===t.playbackState||"loading"===t.playbackState||"playing"===t.playbackState&&!a),o=t.isRadio;return O`
340
323
  <div
341
- class="eb-player${i?" eb-ios-native":""}"
342
- dir="${s?"rtl":""}"
324
+ class="eb-player${r?" eb-ios-native":""}"
325
+ dir="${i?"rtl":""}"
343
326
  >
344
327
  <video
345
328
  class="eb-video"
346
329
  playsinline
347
330
  ?muted="${e.muted}"
348
331
  ?autoplay="${e.autoplay}"
349
- ?controls="${i}"
332
+ ?controls="${r}"
350
333
  ></video>
351
334
 
352
335
  <div class="eb-overlay-zone">
353
- ${!1!==e.image?V`<img
336
+ ${!1!==e.image?O`<img
354
337
  class="eb-poster"
355
338
  src="${e.image}"
356
- style="${a?"":"display:none"}"
339
+ style="${n?"":"display:none"}"
357
340
  alt=""
358
341
  />`:""}
359
- ${e.posterStream?V`<video
342
+ ${e.posterStream?O`<video
360
343
  class="eb-poster-video"
361
344
  muted
362
345
  playsinline
363
346
  style="position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;display:none"
364
347
  ></video>`:""}
365
- ${o?V`<div class="eb-radio-overlay">
348
+ ${o?O`<div class="eb-radio-overlay">
366
349
  <div class="eb-radio-bars">
367
350
  <span class="eb-radio-bar"></span>
368
351
  <span class="eb-radio-bar"></span>
@@ -376,10 +359,10 @@ var EBPlayerBundle=function(e){"use strict";function t(e,t){void 0===t&&(t={});v
376
359
  <div class="eb-ads-container"></div>
377
360
 
378
361
  <div class="eb-top-bar-zone">
379
- ${void 0!==e.logo?V`<img class="eb-logo" src="${e.logo}" alt="" />`:""}
362
+ ${void 0!==e.logo?O`<img class="eb-logo" src="${e.logo}" alt="" />`:""}
380
363
  </div>
381
364
 
382
- ${r?V`<div class="eb-middle-bar-zone"></div>`:""}
365
+ ${s?O`<div class="eb-middle-bar-zone"></div>`:""}
383
366
 
384
367
  <div class="eb-bottom-bar-zone"></div>
385
368
 
@@ -388,7 +371,7 @@ var EBPlayerBundle=function(e){"use strict";function t(e,t){void 0===t&&(t={});v
388
371
  <div class="eb-extension-overlay"></div>
389
372
  <div class="eb-extension-controls-extra"></div>
390
373
  </div>
391
- `}connectChildComponents(){const e=this.config;if(e.noUi)return;const t=this.el?.firstElementChild;if(null==t)return;const s=this.state,i=this.bus,r=this.i18n??void 0,n=(n,a)=>{const o=t.querySelector(a);return null!==o&&(n.connect(o,s,i,e,r),this.childComponents.push(n),!0)};n(new le,".eb-top-bar-zone");if(n(new de,".eb-bottom-bar-zone")){const n=t.querySelector(".eb-bottom-bar-zone");if(null!==n){const t=(t,a)=>{const o=n.querySelector(a);null!==o&&(t.connect(o,s,i,e,r),this.childComponents.push(t))};t(new _e,".eb-bottom-bar__seekbar-zone"),t(new he,".eb-slot-play-pause"),t(new ue,".eb-slot-volume"),t(new me,".eb-slot-time"),t(new ge,".eb-slot-live-sync"),t(new ve,".eb-slot-settings"),t(new ye,".eb-slot-pip"),t(new ke,".eb-slot-cast"),t(new Le,".eb-slot-fullscreen")}}if(e.middlebar){if(n(new ce,".eb-middle-bar-zone")){const n=t.querySelector(".eb-middle-bar-zone");if(null!==n){const t=(t,a)=>{const o=n.querySelector(a);null!==o&&(t.connect(o,s,i,e,r),this.childComponents.push(t))};t(new Ae,".eb-slot-rewind"),t(new Se,".eb-slot-forward")}}}const a=t.querySelector(".eb-overlay-zone");if(null!==a){const t=document.createElement("div");t.className="eb-loading-slot",a.appendChild(t);const n=new $e;n.connect(t,s,i,e,r),this.childComponents.push(n)}const o=[[new Me,"eb-error-slot"],[new Pe,"eb-socials-slot"],[new Re,"eb-info-slot"],[new Be,"eb-toast-slot"]];for(const[n,a]of o){const o=document.createElement("div");o.className=a,t.appendChild(o),n.connect(o,s,i,e,r),this.childComponents.push(n)}"forja"===e.skin&&n(new De,".eb-extension-bottom-extra"),"snrt"===e.skin&&n(new Fe,".eb-extension-bottom-extra")}renderNoUiTemplate(){const e=this.config;return V`
374
+ `}connectChildComponents(){const e=this.config;if(e.noUi)return;const t=this.el?.firstElementChild;if(null==t)return;const i=this.state,r=this.bus,s=b(e),a=this.i18n??void 0,n=(s,n)=>{const o=t.querySelector(n);return null!==o&&(s.connect(o,i,r,e,a),this.childComponents.push(s),!0)},o=(t,s)=>{const n=[...s.left??[],...s.center??[],...s.right??[]];for(const s of n){const n=ze[s];if(void 0===n)continue;const o=Ve(s),l=t.querySelector(o);if(null===l)continue;const d=n();d.connect(l,i,r,e,a),this.childComponents.push(d)}};n(new le,".eb-top-bar-zone");const l=t.querySelector(".eb-top-bar-zone");null!==l&&void 0!==s.topBar&&o(l,s.topBar);if(n(new de,".eb-bottom-bar-zone")&&void 0!==s.bottomBar){const e=t.querySelector(".eb-bottom-bar-zone");null!==e&&o(e,s.bottomBar)}if(e.middlebar){if(n(new ge,".eb-middle-bar-zone")&&void 0!==s.middleBar){const e=t.querySelector(".eb-middle-bar-zone");null!==e&&o(e,s.middleBar)}}const d=t.querySelector(".eb-overlay-zone");if(null!==d){const t=document.createElement("div");t.className="eb-loading-slot",d.appendChild(t);const s=new He;s.connect(t,i,r,e,a),this.childComponents.push(s)}const c=[[new Ie,"eb-error-slot"],[new Ne,"eb-socials-slot"],[new Oe,"eb-info-slot"],[new je,"eb-toast-slot"]];for(const[s,n]of c){const o=document.createElement("div");o.className=n,t.appendChild(o),s.connect(o,i,r,e,a),this.childComponents.push(s)}"forja"===e.skin&&n(new Ue,".eb-extension-bottom-extra"),"snrt"===e.skin&&n(new We,".eb-extension-bottom-extra")}renderNoUiTemplate(){const e=this.config;return O`
392
375
  <div class="eb-player">
393
376
  <video
394
377
  class="eb-video"
@@ -397,4 +380,4 @@ var EBPlayerBundle=function(e){"use strict";function t(e,t){void 0===t&&(t={});v
397
380
  ?autoplay="${e.autoplay}"
398
381
  ></video>
399
382
  </div>
400
- `}bindElementRefs(){const e=this.el?.firstElementChild;this.videoElement=null!==e?e.querySelector("video.eb-video"):null,this.adsContainerElement=null!==e?e.querySelector(".eb-ads-container"):null;this.config.posterStream&&null!==e&&(this.posterVideoElement=e.querySelector(".eb-poster-video"))}subscribeToState(){const e=this.state,{signal:t}=this;e.on("isRtl",()=>{this.applyRtl()},{signal:t}),e.on("isIOS",()=>{this.updateIOSState()},{signal:t}),e.on("playbackState",()=>{this.updatePosterVisibility()},{signal:t}),e.on("currentTime",()=>{this.state.currentTime>0&&this.updatePosterVisibility()},{signal:t}),e.on("isRadio",()=>{this.updateRadioOverlay()},{signal:t}),e.on("controlsVisible",()=>{this.updateControlsVisibility()},{signal:t})}updatePosterVisibility(){const e=this.el?.firstElementChild;if(null==e)return;const t=e.querySelector(".eb-poster");if(null===t)return;const s=this.state.playbackState,i=this.state.currentTime>0,r=!1!==this.config.image&&("idle"===s||"loading"===s||"playing"===s&&!i);t.style.display=r?"":"none"}updateIOSState(){const e=this.el?.firstElementChild;if(null==e)return;const t=this.state.isIOS;e.classList.toggle("eb-ios-native",t);const s=e.querySelector("video.eb-video");null!==s&&(s.controls=t)}updateRadioOverlay(){const e=this.el?.firstElementChild;if(null==e)return;const t=e.querySelector(".eb-overlay-zone");if(null===t)return;const s=t.querySelector(".eb-radio-overlay"),i=this.state.isRadio;if(i&&null===s){const e=document.createElement("div");e.className="eb-radio-overlay";const s=document.createElement("div");s.className="eb-radio-bars";for(let e=0;e<5;e++){const e=document.createElement("span");e.className="eb-radio-bar",s.appendChild(e)}e.appendChild(s),t.appendChild(e)}else i||null===s||s.remove()}updateControlsVisibility(){const e=this.el?.firstElementChild;if(null==e)return;const t=this.state.controlsVisible;e.classList.toggle("eb-controls-visible",t),e.classList.toggle("eb-controls-hidden",!t)}applyRtl(){const e=this.el?.firstElementChild;if(null==e)return;this.state.isRtl?e.setAttribute("dir","rtl"):e.removeAttribute("dir")}invokeExtensions(){const e=this.config.extensions;if(void 0===e)return;const t=this.el?.firstElementChild;if(null==t)return;const s={"top-extra":".eb-extension-top-extra","bottom-extra":".eb-extension-bottom-extra",overlay:".eb-extension-overlay","controls-extra":".eb-extension-controls-extra"};for(const[i,r]of Object.entries(e)){const e=s[i];if(void 0===e)continue;const n=t.querySelector(e);if(null===n)continue;const a=r(n,this.state,this.bus,this.signal);"function"==typeof a&&this.extensionCleanups.push(a)}}disconnect(){for(const e of this.childComponents)e.disconnect();this.childComponents=[];for(const e of this.extensionCleanups)e();this.extensionCleanups=[],this.videoElement=null,this.adsContainerElement=null,this.posterVideoElement=null,super.disconnect()}}class Ie{constructor(e,t,s){this.timer=0,this.state=t,this.container=e,this.onActivity=()=>this.show(),e.addEventListener("pointermove",this.onActivity),e.addEventListener("touchstart",this.onActivity),e.addEventListener("keyup",this.onActivity),s.addEventListener("abort",()=>{this.container.removeEventListener("pointermove",this.onActivity),this.container.removeEventListener("touchstart",this.onActivity),this.container.removeEventListener("keyup",this.onActivity),clearTimeout(this.timer),this.timer=0},{once:!0}),this.show()}show(){this.state.controlsVisible=!0,clearTimeout(this.timer),this.timer=setTimeout(()=>{this.hide()},3e3)}hide(){this.state.settingsOpen||this.state.socialsOpen||this.state.infoOpen||this.state.adPlaying||(this.state.controlsVisible=!1)}}class He{constructor(e,t,s,i,r){e.tabIndex<0&&(e.tabIndex=0);const n=e=>{const r=e;if(!t.adPlaying){if(" "===r.key)return r.preventDefault(),void("playing"===t.playbackState?s.emit("pause"):s.emit("play"));if("ArrowLeft"===r.key){const e=i.seekOffset||15,r=Math.max(t.currentTime-e,0);return void s.emit("seek",{time:r})}if("ArrowRight"===r.key){const e=i.seekOffset||15,r=Math.min(t.currentTime+e,t.duration);return void s.emit("seek",{time:r})}i.supportHotKeys&&("m"!==r.key||s.emit("mute-toggle"))}};e.addEventListener("keyup",n),r.addEventListener("abort",()=>{e.removeEventListener("keyup",n)},{once:!0})}}function Ne(e){const t=window;if(void 0!==t[e])return t[e];try{return(0,eval)(e)}catch{return}}function Oe(e,t,s={}){const i=Ne(t);if(void 0!==i)return Promise.resolve(i);const r=s.timeout??1e4;return new Promise((s,i)=>{let n;const a=()=>{clearTimeout(n)},o=document.createElement("script");o.src=e,o.onload=()=>{a();const r=Ne(t);void 0===r?i(new Error(`CDN: '${t}' not on window after loading ${e}`)):s(r)},o.onerror=()=>{a(),i(new Error(`CDN: failed to load ${e}`))},n=setTimeout(()=>{i(new Error(`CDN: timeout loading ${e}`))},r),document.head.appendChild(o)})}let je=null;class Ue{constructor(e){this.localDriver=null,this.signal=e.signal}async init(e,t,s){if(!e.chromecast)return;const i=await Oe(e.chromecast,"Castjs");null===je&&(je=new i({receiver:e.chromecastApp??"00197684"})),this.localDriver=je,this.applyMetadata(e.chromecastMetadata),this.bindDriverEvents(t,s),this.registerAbortCleanup()}getDriver(){return this.localDriver}toggleCast(e){const t=this.localDriver;if(null!==t)if(t.connected)t.disconnect();else if(e.castAvailable){const s=this.buildCastOptions(e);t.cast(e.src??"",s)}}applyMetadata(e){if(void 0===e||null===this.localDriver)return;const t=this.localDriver;void 0!==e.title&&(t.title=e.title),void 0!==e.description&&(t.description=e.description),void 0!==e.poster&&(t.poster=e.poster)}bindDriverEvents(e,t){const s=this.localDriver;s.on("available",()=>{e.castAvailable=!0}),s.on("connect",()=>{e.isCasting=!0}),s.on("disconnect",()=>{const i=s.time;e.isCasting=!1,void 0!==i&&i>0?t.emit("cast-stop-with-position",{time:i}):t.emit("cast-stop")}),s.on("error",()=>{e.isCasting=!1,t.emit("cast-failed")})}buildCastOptions(e){const t=this.localDriver;return{title:t?.title,description:t?.description,poster:e.image}}registerAbortCleanup(){this.signal.addEventListener("abort",()=>{const e=this.localDriver;null!==e&&e.connected&&e.disconnect(),this.localDriver=null},{once:!0})}}class qe{constructor(){this.pollTimer=null}async start(e,t,s){if(void 0!==e.epgContentId&&(await this.fetchEpg(e,t),null!==e.epgPolling&&void 0!==e.epgPolling)){const i=1e3*e.epgPolling;this.pollTimer=setInterval(()=>{this.fetchEpg(e,t)},i),s.addEventListener("abort",()=>{clearInterval(this.pollTimer),this.pollTimer=null},{once:!0})}}async fetchEpg(e,t){const s=`https://epg.dev.easybroadcast.io/channels/${e.epgContentId}/last-24-h-programs`;try{const e=await fetch(s,{mode:"cors"});if(!e.ok)throw new Error(`EPG fetch failed with status: ${e.status}`);const i=await e.json();t.epgPrograms=i,t.epgFetchedAt=Date.now()}catch(e){console.error("EBPlayer: Error fetching EPG data:",e)}}}class We{init(e,t,s,i){const r=e.playlist;r&&0!==r.length&&(t.playlist=r,t.currentEpisode=0,s.on("playlist-next",()=>{this.advance(t,1)},{signal:i}),s.on("playlist-prev",()=>{this.advance(t,-1)},{signal:i}))}advance(e,t){const s=e.playlist.length,i=(e.currentEpisode+t+s)%s;e.currentEpisode=i,e.src=e.playlist[i].src}}class Ge{constructor(){this.imaAdsManager=null,this.imaDisplayContainer=null}async init(e,t,s,i,r,n){if(!e.preroll)return;if(!e.autoplay&&(await this.waitForUserGesture(i,n),n.aborted))return;const a=await Oe("https://imasdk.googleapis.com/js/sdkloader/ima3.js","google"),{ima:o}=a,l=new o.AdDisplayContainer(r,i);this.imaDisplayContainer=l,l.initialize();const d=new o.AdsLoader(l);d.addEventListener(o.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,e=>{const r=e.getAdsManager(i);this.imaAdsManager=r;const{width:n,height:a}=i.getBoundingClientRect?i.getBoundingClientRect():{width:640,height:360};r.addEventListener(o.AdEvent.Type.CONTENT_PAUSE_REQUESTED,()=>{t.adPlaying=!0}),r.addEventListener(o.AdEvent.Type.CONTENT_RESUME_REQUESTED,()=>{t.adPlaying=!1,i.play()}),r.addEventListener(o.AdEvent.Type.ALL_ADS_COMPLETED,()=>{t.adPlaying=!1,s.emit("ad-complete")}),r.init(n,a),r.start()});const c=new o.AdsRequest;c.adTagUrl=e.preroll,d.requestAds(c),n.addEventListener("abort",()=>{null!==this.imaAdsManager&&(this.imaAdsManager.destroy(),this.imaAdsManager=null),null!==this.imaDisplayContainer&&(this.imaDisplayContainer.destroy(),this.imaDisplayContainer=null)},{once:!0})}waitForUserGesture(e,t){return new Promise(s=>{const i=()=>{e.removeEventListener("click",i),s()};e.addEventListener("click",i),t.addEventListener("abort",()=>{e.removeEventListener("click",i),s()},{once:!0})})}}class Ye{get signal(){return this.abortController.signal}get container(){return this._container}constructor(e){this.config=c(o,e),this.state=n(),this.bus=new a,this.i18n=new p(this.config.lang),this.abortController=new AbortController,this._container=null,this.engineSync=null,this.skinRoot=null,this.commandHandler=null,this.chromecastManager=null,this.reloadCallback=null}mount(e){this._container=e,this.config.skin&&"default"!==this.config.skin&&e.setAttribute("data-theme",this.config.skin);const t=this.config.skinColors;if(this.config.primaryColor&&e.style.setProperty("--eb-color-primary",this.config.primaryColor),t?.general&&e.style.setProperty("--eb-color-primary",t.general),t?.progressBar&&e.style.setProperty("--eb-color-progress",t.progressBar),t?.volumeBar&&e.style.setProperty("--eb-color-volume",t.volumeBar),this.state.isRtl="ar"===this.config.lang,this.state.isRadio=!0===this.config.radio,!this.config.noUi){const t=new ze;this.skinRoot=t,t.connect(e,this.state,this.bus,this.config,this.i18n);const s=t.getVideoElement();null!==s&&(this.state.muted=s.muted,this.state.volume=s.volume),new Ie(e,this.state,this.signal),new He(e,this.state,this.bus,this.config,this.signal)}this.initIntegrations();const s=this.skinRoot?.getVideoElement()??null;null!==s&&(this.commandHandler=new m(this.bus,s,this.state,()=>this.engineSync,this.chromecastManager,this.i18n,()=>{this.reloadCallback?.()},this.signal))}setReloadCallback(e){this.reloadCallback=e}getSavedSelections(){return null!==this.commandHandler?this.commandHandler.getSavedSelections():{quality:-1,audioTrack:0,subtitleTrack:-1}}setEngineSync(e){null!==this.engineSync&&this.engineSync.detach(),this.engineSync=e,e.attach(this.state,this.signal)}dispose(){null!==this.engineSync&&(this.engineSync.detach(),this.engineSync=null),this.bus.dispose(),this.abortController.abort(),null!==this.skinRoot&&(this.skinRoot.disconnect(),this.skinRoot=null),this._container=null,this.commandHandler=null,this.chromecastManager=null,this.reloadCallback=null,this.abortController=new AbortController}initIntegrations(){const{config:e,state:t,bus:s,signal:i}=this;if(e.chromecast){const i=new Ue(this.abortController);this.chromecastManager=i,i.init(e,t,s).catch(e=>{console.error("EBPlayer: ChromecastManager init failed:",e)})}if(e.epgContentId){(new qe).start(e,t,i).catch(e=>{console.error("EBPlayer: EpgManager start failed:",e)})}const r=e.playlist;if(r&&r.length>0){(new We).init(e,t,s,i)}if(e.preroll&&null!==this.skinRoot){const r=new Ge,n=this.skinRoot.getVideoElement(),a=this.skinRoot.getAdsContainer();null!==n&&null!==a&&r.init(e,t,s,n,a,i).catch(e=>{console.error("EBPlayer: AdsManager init failed:",e)})}if(e.posterStream){const s=function(){let e=null;return{attach({src:t,container:s,Hls:i}){console.log("Poster HLS: attach media",t,s),e=new i,e.loadSource(t),e.attachMedia(s)},close(){if(e){try{e.detachMedia?.(),e.destroy?.()}catch(e){console.error("Poster HLS player close error:",e)}e=null}},play(){e?.media?.play()},pause(){e?.media?.pause()}}}(),r=this.skinRoot?.getPosterVideoElement()??null;t.on("playbackState",t=>{if("playing"===t){if(null!==r){const t=window.Hls;t&&s.attach({src:e.posterStream,container:r,Hls:t})}s.play()}else"paused"!==t&&"buffering"!==t||s.pause()},{signal:i}),i.addEventListener("abort",()=>{s.close()},{once:!0})}}}class Qe{}class Xe{constructor(e){this.intervalId=null,this.lastTime=null,this.stallAttempts=0,this.video=e.video,this.onRecoverAttempt=e.onRecoverAttempt,this.onReloadRequired=e.onReloadRequired,this.isCasting=e.isCasting}start(){this.stop(),this.intervalId=setInterval(()=>{this.tick()},1e4)}stop(){null!==this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.lastTime=null,this.stallAttempts=0}tick(){if(this.video.paused||this.isCasting())return void(this.lastTime=null);const e=this.video.currentTime;null!==this.lastTime&&e===this.lastTime?(this.stallAttempts+=1,this.stallAttempts<=2?this.onRecoverAttempt(this.stallAttempts):(this.onReloadRequired(),this.stop())):(this.stallAttempts=0,this.lastTime=e)}}class Ke extends Qe{constructor(){super(...arguments),this.video=null,this.state=null,this.signal=null,this.bus=null,this.config=null,this.watchdog=null}attach(e,t){this.state=e,this.signal=t,this.onAttach()}detach(){this.watchdog?.stop(),this.watchdog=null,this.onDetach(),this.video=null,this.state=null,this.signal=null,this.bus=null,this.config=null}startWatchdog(){if(!this.video||!this.bus)return;const e=this.bus;this.watchdog=new Xe({video:this.video,onRecoverAttempt:e=>{this.recoverFromStall(e)},onReloadRequired:()=>{e.emit("request-reload")},isCasting:()=>this.state?.isCasting??!1}),this.watchdog.start()}stopWatchdog(){this.watchdog?.stop(),this.watchdog=null}setConfig(e){this.config=e}setBus(e){this.bus=e}setVideo(e){this.video=e}bindVideoEvents(e,t,s){e.addEventListener("timeupdate",()=>{t.currentTime=Math.round(e.currentTime)},{signal:s}),e.addEventListener("durationchange",()=>{t.duration=Math.ceil(e.duration)},{signal:s}),e.addEventListener("volumechange",()=>{t.volume=e.volume,t.muted=e.muted},{signal:s}),e.addEventListener("progress",()=>{e.buffered.length>0&&(t.bufferedEnd=e.buffered.end(e.buffered.length-1))},{signal:s}),e.addEventListener("ratechange",()=>{t.playbackRate=e.playbackRate},{signal:s}),e.addEventListener("playing",()=>{t.playbackState="playing"},{signal:s}),e.addEventListener("pause",()=>{t.playbackState="paused"},{signal:s}),e.addEventListener("waiting",()=>{t.playbackState="buffering"},{signal:s}),e.addEventListener("ended",()=>{t.playbackState="ended"},{signal:s})}}const Je=Object.freeze({EASY_B:"easy_b",BUNNY:"bunny",AKAMAI:"akamai",VENOM:"venom"}),Ze=Object.freeze({UNKNOWN:"unknown",MAX_RETRY:"max_retry",FORBIDDEN:"forbidden"});class et extends Error{constructor({status:e="unknown",errorCode:t="unknown",errorType:s=Ze.UNKNOWN,message:i=null}){super(i??`TokenError: ${e} - ${t}`),this.status=e,this.errorCode=t,this.errorType=s}}class tt{constructor({src:e,responseParameters:t,error:s=null,extras:i={}}){if(this.src=e,this.responseParameters=t,this.extras=i??{},null!==s&&!(s instanceof et))throw new Error("TokenResponse error must be an instance of TokenError");this.error=s}static fromJson({src:e,json:t}){const s=JSON.parse(t),i={token:s.token??null,tokenPath:s.token_path??null,expires:s.expires??null},r=new tt({src:e,responseParameters:i});for(const e of Object.keys(s))["token","expires","token_path"].includes(e)||(r.extras[e]=s[e]);return r}static fromAkamai({src:e,text:t}){const s=st({src:e,text:t});return new tt({src:e,responseParameters:s})}static fromText({src:e,text:t}){if(t.trim().startsWith("{"))return tt.fromJson({src:e,json:t});const s=new URLSearchParams(t.trim().replace(/^\?/,"")),i=s.get("token")??null,r=s.get("expires"),n=r?parseInt(r,10):null,a=s.get("token_path")??null,o=new tt({src:e,responseParameters:{token:i,tokenPath:a,expires:n}});return s.forEach((e,t)=>{["token","expires","token_path"].includes(t)||(o.extras[t]=e)}),o}static fromDefault({src:e,text:t}){const s=new URLSearchParams(t.trim().replace(/^\?/,"")),i=s.get("expires"),r={verify:s.get("verify")??null,expires:i?parseInt(i,10):null},n=new tt({src:e,responseParameters:r});return s.forEach((e,t)=>{["verify","expires"].includes(t)||(n.extras[t]=e)}),n}static fromError({src:e,error:t}){const s=t instanceof et?t:new et(t);return new tt({src:e,error:s})}}function st({src:e,text:t}){const s=new URL(`${e}${t?`?${t}`:""}`);let i=null,r=null,n=null,a=null,o=null;const l=new URLSearchParams(s.search);if(i=l.get("hdntl"),o=l.get("hdnea"),!i&&!o){const e=s.pathname.split("/");for(const t of e){if(t.startsWith("hdntl=")){i=t.substring(6);break}if(t.startsWith("hdnea=")){o=t.substring(6);break}}}const d=i??o;if(d){const e=d.match(/exp=(\d+)/);e&&(r=e[1]);const t=d.match(/hmac=([a-f0-9]+)/);t&&(n=t[1]);const s=d.match(/acl=([^~]+)/);s&&(a=s[1])}return{expires:r,hdntl:d,hmac:n,acl:a,hdnea:o}}function it(e){return new Promise(t=>{setTimeout(t,e)})}class rt{constructor({token:e,tokenType:t,srcInTokenRequest:s=!1,extraParamsCallback:i=null,onCDNTokenError:r,maxRetries:n=3,retryInterval:a=1e4,expirationMarginInSeconds:o=30}){const l=Object.values(Je);void 0!==t&&l.includes(t)?this.tokenType=t:this.tokenType=void 0,this.tokenGeneratorUrl=e,this.srcInTokenRequest=s,this.extraParamsCallback=i&&"function"==typeof i?i:null,this.callbackError=r&&"function"==typeof r?r:null,this.attempt=0,this.maxRetries=n,this.retryInterval=a,this.expirationMarginInSeconds=o,this.lastTokenResponse=null,this.resetAttemptCounterTimeout=null}resetAttemptCounter(){this.resetAttemptCounterTimeout||(this.resetAttemptCounterTimeout=setTimeout(()=>{this.attempt=0},3e4))}async _fetchDefaultToken(e,t=null){const s=new URL(e);if(["verify","expires"].forEach(e=>s.searchParams.delete(e)),this.attempt>=this.maxRetries)return this.resetAttemptCounter(),tt.fromError({src:s.toString(),error:new et({status:t?.status,errorCode:"Unauthorized",errorType:Ze.MAX_RETRY})});try{let t;if(this.attempt+=1,t=!0===this.srcInTokenRequest?await fetch(`${this.tokenGeneratorUrl}?url=${encodeURIComponent(s.toString())}`):await fetch(this.tokenGeneratorUrl),403===t.status)return await it(this.retryInterval),this._fetchDefaultToken(e,t);if(t.status>=400)return tt.fromError({src:s.toString(),error:new et({status:t.status})});this.attempt=0;const i=await t.text();return tt.fromDefault({src:s.toString(),text:i})}catch(e){return console.error("CDNToken: Error fetching default token ",e),tt.fromError({src:s.toString(),error:e})}}async _fetchEasyBToken(e,t=null){if(this.attempt>=this.maxRetries)return this.resetAttemptCounter(),tt.fromError({src:e,error:new et({status:t?.error?.status,errorCode:t?.error?.errorCode??"Unauthorized",errorType:Ze.MAX_RETRY})});try{this.attempt+=1;const s={};if(this.extraParamsCallback){const e=await this.extraParamsCallback(t?.error?.status);e?.accessToken&&(s.Authorization=`Bearer ${String(e.accessToken)}`)}else console.warn("CDNToken: no extraParamsCallback provided");let i;if(i=!0===this.srcInTokenRequest?await fetch(`${this.tokenGeneratorUrl}?url=${encodeURIComponent(e)}`,{method:"GET",headers:s}):await fetch(this.tokenGeneratorUrl,{method:"POST",headers:s,body:JSON.stringify({streamUrl:e})}),i.status>=400){const t=tt.fromError({src:e,error:new et({status:i.status})});return 403===i.status?(await it(this.retryInterval),this._fetchEasyBToken(e,t)):t}this.attempt=0;const r=await i.text();return tt.fromText({src:e,text:r})}catch(t){return console.error("CDNToken: Error fetching token ",t),tt.fromError({src:e,error:t})}}async _fetchAkamaiToken(e,t=null){if(this.attempt>=this.maxRetries)return this.resetAttemptCounter(),tt.fromError({src:e,error:new et({status:t?.status,errorCode:"Unauthorized",errorType:Ze.MAX_RETRY})});try{this.attempt+=1;const t=await fetch(`${this.tokenGeneratorUrl}?url=${encodeURIComponent(e)}`);if(403===t.status)return await it(this.retryInterval),this._fetchAkamaiToken(e,t);if(t.status>=400)return tt.fromError({src:e,error:new et({status:t.status})});this.attempt=0;const s=await t.text();return tt.fromAkamai({src:e,text:s})}catch(t){return console.error("CDNToken: Error fetching token ",t),tt.fromError({src:e,error:t})}}async _fetchBunnyToken(e,t=null){if(this.attempt>=this.maxRetries)return this.resetAttemptCounter(),tt.fromError({src:e,error:new et({status:t?.error?.status,errorCode:t?.error?.errorCode??"Unauthorized",errorType:Ze.MAX_RETRY})});try{this.attempt+=1;const s={"Content-Type":"application/json"};if(this.extraParamsCallback){const e=await this.extraParamsCallback(t?.error?.status);e?.accessToken&&(s.Authorization=`Bearer ${String(e.accessToken)}`)}else console.warn("CDNToken: no extraParamsCallback provided");const i=await fetch(this.tokenGeneratorUrl,{method:"POST",headers:s,body:JSON.stringify({streamUrl:e})});if(i.status>=400){const t=i.headers.get("content-type"),s=t?.includes("application/json")?await i.json():await i.text(),r="object"==typeof s&&null!==s?s.error?.errorCode??"Unauthorized":"Unauthorized",n="object"==typeof s&&null!==s?s.error?.__type??Ze.UNKNOWN:Ze.UNKNOWN,a=new et({status:i.status,errorCode:r,errorType:n}),o=tt.fromError({src:e,error:a});return[403,401,498].includes(i.status)?(this.callbackError?this.callbackError({status:a.status,errorCode:a.errorCode,errorType:a.errorType}):console.warn(`CDNToken: Bunny token fetch attempt ${this.attempt} for ${e} failed with status ${i.status}, retrying in ${this.retryInterval/1e3}s`),await it(this.retryInterval),this._fetchBunnyToken(e,o)):(console.error(`CDNToken: error generating Bunny token on attempt ${this.attempt}`,JSON.stringify(o)),o)}const r=await i.json();return this.attempt=0,Number.isInteger(r.max_retries)&&r.max_retries>0&&(this.maxRetries=r.max_retries),Number.isInteger(r.retry_interval)&&r.retry_interval>0&&(this.retryInterval=1e3*r.retry_interval),tt.fromJson({src:e,json:JSON.stringify(r)})}catch(t){return console.error("CDNToken: Error fetching bunny token:",t),tt.fromError({src:e,error:t})}}async fetchToken({src:e}){if(!e)return console.warn("CDNToken: Missing src to tokenize"),null;switch(this.tokenType){case Je.BUNNY:this.lastTokenResponse=await this._fetchBunnyToken(e);break;case Je.AKAMAI:this.lastTokenResponse=await this._fetchAkamaiToken(e);break;case Je.VENOM:case Je.EASY_B:this.lastTokenResponse=await this._fetchEasyBToken(e);break;default:this.lastTokenResponse=await this._fetchDefaultToken(e)}return this.lastTokenResponse}async updateUrlWithTokenParams({url:e}){const t=new URL(e),s=t.searchParams.get("expires");switch(this.tokenType){case Je.AKAMAI:{const s=st({src:e,text:""});if(!this.isTokenExpired(s.expires))return e;const i=t.pathname.split("/");t.pathname=i.filter(e=>!e.startsWith("hdntl=")&&!e.startsWith("hdnea=")).join("/");break}case Je.EASY_B:case Je.VENOM:case Je.BUNNY:{if(!this.isTokenExpired(s))return e;["token","expires","token_path"].forEach(e=>t.searchParams.delete(e));const i=this.lastTokenResponse;if(i){const t=i.responseParameters;if(t&&!this.isTokenExpired(t.expires)){const{token:s,expires:i,tokenPath:r}=t;return rt.appendTokenParams(e,s,i,r)}}break}default:if(!this.isTokenExpired(s))return e}try{const s=await this.fetchToken({src:t.toString()});if(null===s)return e;if(s.error)return this.callbackError&&this.callbackError({status:s.error.status,errorCode:s.error.errorCode,errorType:s.error.errorType}),e;switch(this.tokenType){case Je.BUNNY:case Je.VENOM:case Je.EASY_B:{const t=s.responseParameters;return rt.appendTokenParams(e,t.token,t.expires,t.tokenPath)}case Je.AKAMAI:{const t=s.responseParameters;return rt.appendAkamaiTokenParams(e,t.hdntl??t.hdnea??"")}default:return rt.appendDefaultTokenParams(e,s)}}catch(t){return console.error("CDNToken: Error while fetching new token:",t),e}}isTokenExpired(e){if(null==e)return!0;const t=Math.floor(Date.now()/1e3)+this.expirationMarginInSeconds;return Number(e)<t}destroy(){this.resetAttemptCounterTimeout&&(clearTimeout(this.resetAttemptCounterTimeout),this.resetAttemptCounterTimeout=null),this.attempt=0,this.lastTokenResponse=null,console.log("CDNTokenManager: destroyed")}static appendTokenParams(e,t,s,i){const r=new URL(e);return t&&(r.searchParams.set("token",t),null!==s&&r.searchParams.set("expires",String(s)),i&&r.searchParams.set("token_path",i)),r.toString()}static appendAkamaiTokenParams(e,t){const s=new URL(e);return s.searchParams.delete("hdnea"),s.searchParams.delete("hdntl"),s.searchParams.set("hdnea",t),s.toString()}static appendDefaultTokenParams(e,t){const s=new URL(e),i=t.responseParameters;return i?.verify&&s.searchParams.set("verify",i.verify),null!=i?.expires&&s.searchParams.set("expires",String(i.expires)),s.toString()}}function nt(e){const t={};for(const s of Object.keys(e)){const i={...e[s]};!i.serverURL&&i.licenseUrl&&(i.serverURL=i.licenseUrl),t[s]=i}return t}class at{constructor(e){this.tokenManager=e}buildHlsConfig(e){if(!e.emeEnabled)return{};const t=this.tokenManager;return{emeEnabled:e.emeEnabled,...void 0!==e.drmSystems&&{drmSystems:nt(e.drmSystems)},licenseXhrSetup:async(e,s)=>{if(t?.extraParamsCallback){const s=await t.extraParamsCallback().catch(e=>(console.error("DrmConfigurator: extraParamsCallback error:",e),null));s?.accessToken&&e.setRequestHeader("Authorization",`Bearer ${s.accessToken}`)}const i=t?.lastTokenResponse?.extras?.drm_custom_data;if(i){const t=new URL(s);t.searchParams.delete("customdata"),t.searchParams.append("customdata",i),e.open("POST",t.toString(),!0)}else e.open("POST",s,!0)}}}}const ot=new Set(["keySystemError"]);function lt(e,t){const s=e.trigger;e.trigger=function(e,i){if(e===t.AUDIO_TRACK_LOADED){const e=i;if(e?.details){const t=this.currentLevel>=0?this.currentLevel:0,s=this.levels?.[t]?.details;if(s&&e.details.endCC>s.endCC){const t=s.endCC,i=e.details.fragments;if(i)for(let e=0;e<i.length;e++)i[e].cc>t&&(i[e].cc=t);void 0!==e.details.fragmentHint?.cc&&e.details.fragmentHint.cc>t&&(e.details.fragmentHint.cc=t),e.details.endCC=t}}}return s.call(this,e,i)}}class dt extends Ke{constructor(){super(...arguments),this.driver=null,this.tokenManager=null,this.eventState=null}getDriver(){return this.driver}async onAttach(){if(this.state){this.state.playbackState="loading";try{await this.init()}catch(e){console.error("HlsEngine: init failed",e),this.state&&(this.state.error=e instanceof Error?e.message:String(e))}}}onDetach(){if(this.stopWatchdog(),null!==this.driver){try{this.driver.detachMedia(),this.driver.destroy()}catch(e){console.error("HlsEngine: error during driver teardown",e)}this.driver=null}this.tokenManager=null,this.eventState=null}recoverFromStall(e){this.driver&&(1===e?(console.warn("HlsEngine stall recovery: recoverMediaError"),this.driver.recoverMediaError()):(console.warn("HlsEngine stall recovery: startLoad"),this.driver.startLoad(this.video?.currentTime??-1)))}setQuality(e){null!==this.driver&&(this.driver.currentLevel=e)}setAudioTrack(e){null!==this.driver&&(this.driver.audioTrack=e)}setSubtitle(e){null!==this.driver&&(this.driver.subtitleTrack=e)}setPlaybackRate(e){null!==this.video&&(this.video.playbackRate=e)}seekToLive(){if(null===this.driver||null===this.video)return;const e=this.driver.liveSyncPosition;void 0!==e&&Number.isFinite(e)&&(this.video.currentTime=e)}get detached(){return null===this.state}async init(){const{config:e,video:t,state:s,signal:i}=this;if(!(e&&t&&s&&i))return;const r=e.hlsjs;if(!r)throw new Error("HlsEngine: config.hlsjs URL is required");if(e.token&&(this.tokenManager=new rt({token:e.token,tokenType:e.tokenType,srcInTokenRequest:e.srcInTokenRequest,extraParamsCallback:e.extraParamsCallback,onCDNTokenError:e.engineSettings.onCDNTokenError}),e.src&&await this.tokenManager.fetchToken({src:e.src}),this.detached))return;console.info("HlsEngine: loading hls.js from",r);const n=await Oe(r,"Hls");if(this.detached)return;const a=new at(this.tokenManager).buildHlsConfig(e.engineSettings),o=this.tokenManager,{emeEnabled:l,drmSystems:d,...c}=e.engineSettings,h={...c};delete h.extraParamsCallback,delete h.onCDNTokenError;const u={autoStartLoad:!e.startAt,enableWorker:!0,backBufferLength:30,...h,...a,startPosition:e.startAt};if(o){const e=o;class t extends n.DefaultConfig.loader{constructor(t){super(t);const s=this.load.bind(this);this.load=function(t,i,r){if(!t.url)return void s(t,i,r);new URL(t.url).pathname.split("/").pop().endsWith(".m3u8")?e.updateUrlWithTokenParams({url:t.url}).then(e=>{t.url=e,s(t,i,r)}).catch(()=>{s(t,i,r)}):s(t,i,r)}}}u.pLoader=t}if(!e.disableCustomAbr)try{const{createHlsAbrController:e}=await Promise.resolve().then(function(){return Lt});if(this.detached)return;u.abrController=e(n)}catch(e){console.warn("HlsEngine: failed to load custom ABR controller, using default",e)}if(this.detached)return;const b=new n(u);this.driver=b,lt(b,n.Events),e.retry&&function(e){const t=new Map,s=new Set,i=new Set;let r;e.on("hlsError",(n,a)=>{const o=a.details??a.type,l=e.media?.currentTime;if(void 0!==l&&void 0!==r&&l>r+1&&(t.clear(),s.clear()),r=l,a.fatal){if(ot.has(a.type)){if(i.has(o))return;return i.add(o),void console.error(`HLS Retry: Unrecoverable error "${o}" — cannot fix by retrying.`,n,a)}return console.warn("HLS Retry: Fatal error, trying to fix now.",n,a),void setTimeout(()=>{"mediaError"===a.type?e.recoverMediaError():e.startLoad()},1e3)}if(s.has(o))return;const d=(t.get(o)??0)+1;if(t.set(o,d),d>3)return console.warn(`HLS Retry: Non-fatal "${o}" exceeded 3 retries, giving up.`,n,a),void s.add(o);console.warn(`HLS Retry: Non-fatal error (${d}/3), monitoring.`,n,a);const c=e.media?.currentTime;setTimeout(()=>{c===e.media?.currentTime?(console.warn("HLS Retry: Stream is stuck, trying to fix",n,a),"mediaError"===a.type?e.recoverMediaError():e.startLoad()):(console.info("HLS Retry: Stream is playing, no action needed",n,a),t.delete(o),s.delete(o))},3e3)})}(b),this.bindVideoEvents(t,s,i),b.attachMedia(t);let p=e.src??"";if(this.tokenManager&&p&&(p=await this.tokenManager.updateUrlWithTokenParams({url:p}),this.detached))return b.destroy(),void(this.driver=null);b.loadSource(p),this.registerDriverEvents(n,s),this.startWatchdog()}registerDriverEvents(e,t){const s=this.driver;if(!s)return;this.eventState=t;const{Events:i}=e;s.on(i.MANIFEST_LOADED,this._onManifestLoaded.bind(this)),s.on(i.LEVEL_LOADED,this._onLevelLoaded.bind(this)),s.on(i.LEVEL_SWITCHED,this._onLevelSwitched.bind(this)),s.on(i.AUDIO_TRACKS_UPDATED,this._onAudioTracksUpdated.bind(this)),s.on(i.AUDIO_TRACK_SWITCHED,this._onAudioTrackSwitched.bind(this)),s.on(i.SUBTITLE_TRACKS_UPDATED,this._onSubtitleTracksUpdated.bind(this)),s.on(i.SUBTITLE_TRACK_SWITCH,this._onSubtitleTrackSwitch.bind(this))}_onManifestLoaded(e,t){const s=this.eventState,i=this.driver;if(!s)return;const r=t.levels??i?.levels??[];s.qualityLevels=r.map((e,t)=>({name:e.name??`${e.height}p`,id:t,bitrate:e.bitrate,height:e.height,width:e.width}))}_onLevelLoaded(e,t){const s=this.eventState;if(!s)return;const i=t;void 0!==i?.details?.live&&(s.isLive=i.details.live)}_onLevelSwitched(e,t){const s=this.eventState;if(!s)return;const i=t;s.currentQuality=i.level}_onAudioTracksUpdated(e,t){const s=this.eventState,i=this.driver;if(!s)return;const r=t.audioTracks??i?.audioTracks??[];s.audioTracks=r.map(e=>({id:e.id,name:e.name,lang:e.lang}))}_onAudioTrackSwitched(e,t){const s=this.eventState;if(!s)return;const i=t;s.currentAudioTrack=i.id}_onSubtitleTracksUpdated(e,t){const s=this.eventState,i=this.driver;if(!s)return;const r=t.subtitleTracks??i?.subtitleTracks??[];s.subtitleTracks=r.map(e=>({id:e.id,name:e.name,lang:e.lang}))}_onSubtitleTrackSwitch(e,t){const s=this.eventState;if(!s)return;const i=t;s.currentSubtitleTrack=i.id}}const ct=(e,t,s,i,r,n)=>{if(n<=0)return;const[{bandwidth:a},{bandwidth:o}]=t.getMediaInfo().bitrateList;return n>2&&.8*s>=a&&s<=o?e<8?n:n-1:1===n?i.getCurrentBufferLevel("video",!0)>1.5*r&&e<8?n:n-1:void 0};function ht(e){const t=e.FactoryMaker.getClassFactoryByName("SwitchRequest"),s=e.FactoryMaker.getSingletonFactoryByName("StreamController"),i=e.FactoryMaker.getSingletonFactoryByName("DashMetrics"),r=new Set;let n=0,a=15,o=15;const l=function(){return{getMaxIndex:e=>{const l=t(this.context).create();l.priority=t.PRIORITY.STRONG;const d=e.getMediaInfo().type,c=i(this.context).getInstance(),h=s(this.context).getInstance(),u=e.getAbrController();if(setInterval(()=>{var e;void 0!==(e=c.getCurrentBufferLevel("video",!0))&&(a<e&&(r.add(o),a=e,o=e),e<o&&(o=e,a=o))},1e3),"video"===d){let s,i;try{const[t,a]=(({requests:e,count:t,rulesContext:s,currentValue:i,dashMetrics:a})=>{if(!e)return[""];let o=null;for(let t=e.length-1;t>=0&&null===o;t--){const[{_tfinish:s,trequest:i,tresponse:r,trace:n}]=e[t];s&&i&&r&&n&&n.length&&(o=e[t])}if(null===o)return["No valid request made for this stream yet, bailing"];const l=(o[0]._tfinish.getTime()-o[0].trequest.getTime())/1e3,d=(o[0]._tfinish.getTime()-o[0].tresponse.getTime())/1e3;if("InitializationSegment"===o[0].type||"MediaSegment"===o[0].type){if(l<=0)return["Last segment not downloaded, probable network problem: Switching to lowest quality",0];if(r.size>=3){const o=Array.from(r),c=o.reduce((e,t)=>e+t,0)/r.size,h=((e,t)=>{const[{type:s,_tfinish:i,trequest:r,tresponse:n,trace:a}]=e[0];return"MediaSegment"!==s&&i&&r&&n&&a&&a.length?8*a.reduce((e,t)=>e+t.b[0],0)/t:0})(e,l),u=Math.sqrt(o.map(e=>(e-c)**2).reduce((e,t)=>e+t,0)/r.size);return r.clear(),c<=1.5?["Avg. Buffer < 10% of max buffer, switching to lowest quality",0]:c<=4.5?["Maintaining the current Bitrate",i]:c<=10.5&&s.getMediaInfo().bitrateList[i].bandwidth<h&&(n<t-1||u<=8)?["Switching to optimised quality level",n?ct(u,s,h,a,d,t):n+1]:["Switching to optimised quality level",ct(u,s,h,a,d,t)]}return["Maintaining the last loaded level"]}return["Last Loaded segment was not a media segment of initialization segment"]})({requests:c.getHttpRequests(d),count:e.getMediaInfo().representationCount,currentValue:u.getQualityFor(d,h.getActiveStreamInfo()),rulesContext:e,dashMetrics:c});i=t,s=a??n,n=s}catch{return r.clear(),{quality:0,reason:"Error in ABR rule",priority:t.PRIORITY.STRONG}}return l.quality=s,l.reason=i,l}return l.quality=0,l.reason="Audio Request",l}}};return l.__dashjs_factory_name="CustomAbrRule",e.FactoryMaker.getClassFactory(l)}class ut extends Ke{constructor(){super(...arguments),this.driver=null,this.dvrErrorHandler=null}getDriver(){return this.driver}setConfig(e){this.config=e}setBus(e){this.bus=e}setVideo(e){this.video=e}async onAttach(){if(this.state){this.state.playbackState="loading";try{await this.init()}catch(e){console.error("DashEngine: init failed",e),this.state&&(this.state.error=e instanceof Error?e.message:String(e))}}}onDetach(){if(this.stopWatchdog(),null!==this.driver){try{this.driver.reset(),this.driver.destroy()}catch(e){console.error("DashEngine: error during driver teardown",e)}this.driver=null}null!==this.dvrErrorHandler&&(window.removeEventListener("unhandledrejection",this.dvrErrorHandler),this.dvrErrorHandler=null)}recoverFromStall(e){null!==this.video&&(1===e?(console.warn("DashEngine stall recovery: seek nudge"),this.video.currentTime+=.1):(console.warn("DashEngine stall recovery: refreshManifest"),this.driver?.refreshManifest()))}setQuality(e){null!==this.driver&&this.driver.setQualityFor("video",e)}setAudioTrack(e){if(null===this.driver)return;const t=this.driver.getTracksFor("audio");void 0!==t[e]&&this.driver.setCurrentTrack(t[e])}setSubtitle(e){if(null===this.driver)return;const t=this.driver.getTracksFor("fragmentedText");void 0!==t[e]&&this.driver.setCurrentTrack(t[e])}setPlaybackRate(e){null!==this.video&&(this.video.playbackRate=e)}seekToLive(){if(null===this.driver||null===this.video)return;const e=this.driver.duration();Number.isFinite(e)&&(this.video.currentTime=e)}async init(){const{config:e,video:t,state:s,signal:i}=this;if(!(e&&t&&s&&i))return;const r=e.dashjs;if(!r)throw new Error("DashEngine: config.dashjs URL is required");this.dvrErrorHandler=e=>{const t=e.reason;(t?.message?.includes("getCurrentDVRInfo")||String(e.reason).includes("getCurrentDVRInfo"))&&(e.preventDefault(),console.warn("DashEngine: suppressed DVR unhandledrejection"))},window.addEventListener("unhandledrejection",this.dvrErrorHandler,{signal:i}),console.info("DashEngine: loading dashjs from",r);const n=await Oe(r,"dashjs"),a=n.MediaPlayer().create();if(!a)throw new Error("DashEngine: dash.js MediaPlayer could not be created");var o;if(this.driver=a,a.initialize(t,e.src??"",e.autoplay??!1),e.retry&&((o=a).updateSettings({streaming:{retryIntervals:{MPD:1e3,XLinkExpansion:1e3,InitializationSegment:1e3,IndexSegment:1e3,MediaSegment:1e3,BitstreamSwitchingSegment:1e3,other:1e3,lowLatencyReductionFactor:1}}}),o.updateSettings({streaming:{retryAttempts:{MPD:1/0,XLinkExpansion:1/0,InitializationSegment:1/0,IndexSegment:1/0,MediaSegment:1/0,BitstreamSwitchingSegment:1/0,other:1/0,lowLatencyMultiplyFactor:1}}})),!e.disableCustomAbr){const e=ht(n);a.addABRCustomRule("qualitySwitchRules","CustomAbrRule",e)}e.lowLatency&&a.updateSettings({streaming:{lowLatencyEnabled:!0,liveDelay:30,liveCatchUpPlaybackRate:.01}}),this.registerDriverEvents(n,s,a),this.bindVideoEvents(t,s,i),this.startWatchdog(),await new Promise(e=>{const t=()=>{a.off(n.MediaPlayer.events.STREAM_INITIALIZED,t),e()};a.on(n.MediaPlayer.events.STREAM_INITIALIZED,t)})}registerDriverEvents(e,t,s){const i=e.MediaPlayer.events;s.on(i.STREAM_INITIALIZED,()=>{const e=s.getBitrateInfoListFor("video");t.qualityLevels=e.map((e,t)=>({name:`${e.height}p`,id:t,bitrate:e.bitrate}));const i=s.getTracksFor("audio");t.audioTracks=i.map(e=>({name:e.lang??"",id:e.id??e.index??0}));const r=s.getTracksFor("fragmentedText");t.subtitleTracks=r.map(e=>({name:e.lang??"",id:e.id??e.index??0}));const n=s.duration();t.duration=Number.isFinite(n)?Math.ceil(n):0;const a=s.getCurrentLiveLatency();"boolean"==typeof this.config?.isLive?t.isLive=this.config.isLive:t.isLive=!Number.isNaN(a),t.playbackState="playing"}),s.on(i.PLAYBACK_TIME_UPDATED,()=>{t.currentTime=Math.round(s.time())}),s.on(i.QUALITY_CHANGE_REQUESTED,()=>{t.currentQuality=s.getQualityFor("video")}),s.on(i.TRACK_CHANGE_RENDERED,()=>{t.currentAudioTrack=s.getQualityFor("audio")}),s.on(i.ERROR,e=>{const t=e;console.warn("DashEngine error:",t?.error?.message??t?.error??t)})}}function bt(e){return e.split("?")[0].replace(/(\/hdn.*\/)/g,"/")}class pt{constructor(){this.lib=null}async integrate(e){const{video:t,driver:s,type:i,config:r,signal:n}=e;if(!r.lib||!r.manager)return;const a=await Oe(r.lib,"Easybroadcast");this.lib=new a.eblib.EBLibrary(r.manager);const o=bt(r.src??""),l={resourceManager:{tokenRemover:bt,...(r.libSettings??{}).resourceManager??{}},swarmManager:{url:o},statsOutput:{enable:!!r.stats,url:r.stats,intervalMs:3e4},playerInput:{content:String(r.content??o),contentUrl:o,proto:i,origin:r.origin}};if("dash"===i){const e=l.resourceManager;e.randomWaitForPeers=[150,400],e.timeoutV2V=500,e.storageSize=20}this.lib.integrate([s,t],i,l),this.lib.start(),n.addEventListener("abort",()=>{this.lib.stop(),this.lib=null},{once:!0})}}class mt{constructor(e,t){this.driver=null,this.offscreenVideo=null,this.throttleTimeout=null,this.pendingSeekTime=0,this.config=e,this.tokenManager=t}init(e){const t=document.createElement("video");t.preload="none",this.offscreenVideo=t;const s=this.tokenManager;let i;if(s){class t extends e.DefaultConfig.loader{constructor(e){super(e);const t=this.load.bind(this);this.load=async function(e,i,r){if(!e.url)return void t(e,i,r);new URL(e.url).pathname.split("/").pop().endsWith(".m3u8")?(e.url=await s.updateUrlWithTokenParams({url:e.url}),t(e,i,r)):t(e,i,r)}}}i=t}const r={startLevel:0,enableWebVTT:!1,maxBufferLength:1,...this.config.engineSettings??{},...i?{pLoader:i}:{}},n=new e(r);this.driver=n,lt(n,e.Events),n.attachMedia(t),this.config.src&&n.loadSource(this.config.src)}take(e){this.offscreenVideo&&(null!==this.throttleTimeout&&clearTimeout(this.throttleTimeout),this.pendingSeekTime=e,this.throttleTimeout=setTimeout(this.applyPendingSeek.bind(this),250))}applyPendingSeek(){this.offscreenVideo&&(this.offscreenVideo.currentTime=this.pendingSeekTime),this.throttleTimeout=null}getVideo(){return this.offscreenVideo}destroy(){if(null!==this.throttleTimeout&&(clearTimeout(this.throttleTimeout),this.throttleTimeout=null),null!==this.driver){try{this.driver.detachMedia(),this.driver.destroy()}catch(e){console.warn("HlsSnapshotHandler: error during destroy",e)}this.driver=null}this.offscreenVideo=null}}class gt{constructor(e){this.player=null,this.offscreenVideo=null,this.ready=!1,this.src=e}init(e){return new Promise(t=>{const s=document.createElement("video");s.style.display="none",document.body.appendChild(s),this.offscreenVideo=s;const i={take:()=>{},destroy:()=>{},video:s};let r;try{r=e.MediaPlayer().create(),this.player=r,r.initialize(s,this.src,!1),r.updateSettings({streaming:{text:{defaultEnabled:!1},buffer:{fastSwitchEnabled:!1},abr:{autoSwitchBitrate:{video:!1,audio:!1},initialBitrate:{video:0,audio:0}}}})}catch(e){const s=e instanceof Error?e.message:String(e);return console.warn("Snapshot handler initialization failed:",s),this.cleanup(),void t(i)}r.on(e.MediaPlayer.events.ERROR,e=>{const t=e;console.warn("Snapshot dash.js error:",t?.error?.message??t?.error??t)});const n=()=>{r.setMute(!0),r.off(e.MediaPlayer.events.STREAM_INITIALIZED,n),this.ready=!0;let i=null;t({take:e=>{if(this.ready&&null===i){i=setTimeout(()=>{i=null},250);try{r.seek(e),r.isPaused()&&r.play()}catch(e){const t=e instanceof Error?e.message:String(e);console.warn("Snapshot seek error:",t)}}},destroy:()=>{this.ready=!1,this.destroy()},video:s})};r.on(e.MediaPlayer.events.STREAM_INITIALIZED,n),r.on(e.MediaPlayer.events.PLAYBACK_PLAYING,()=>{r.isPaused()||r.pause()})})}destroy(){if(this.ready=!1,null!==this.player){try{this.player.reset()}catch{}this.player=null}this.cleanup()}cleanup(){null!==this.offscreenVideo&&(this.offscreenVideo.remove(),this.offscreenVideo=null)}}let ft=null,vt=null,yt=null;function kt(e){null!==ft&&wt();const t=c(o,e),s=new Ye(e),i=function(e){if(null!=e&&"object"==typeof e&&"nodeType"in e)return e;const t="string"==typeof e?e:"#eb_player",s=document.querySelector(t);if(null===s)throw new Error(`EBPlayer: container element not found for selector "${t}". Ensure the element exists in the DOM before calling start().`);return s}(e.el);s.mount(i);const r=i.querySelector("video");ft=s,vt=null;let n="";const a={open(e){n=e,null!==vt&&(vt.detach(),vt=null);const i=function(e,t){return e.includes(".mpd")&&!1!==t.dashjs?new ut:new dt}(e,t);if(null!==r&&i.setVideo(r),i.setBus(s.bus),i.setConfig(t),s.setEngineSync(i),vt=i,t.lib&&t.manager&&null!==r){const n=e.includes(".mpd")&&!1!==t.dashjs;(new pt).integrate({video:r,driver:i.getDriver(),type:n?"dash":"hls",config:t,signal:s.signal}).catch(e=>{console.error("EBPlayer: P2PManager integrate failed:",e)})}if(t.showProgressThumb){null!==yt&&(yt(),yt=null);const i=e.includes(".mpd")&&!1!==t.dashjs;setTimeout(()=>{if(i){const t=window;if(t.dashjs){new gt(e).init(t.dashjs).then(e=>{yt=()=>e.destroy(),s.bus.emit("snapshot-handler-ready",{take:e.take,video:e.video})}).catch(e=>{console.warn("EBPlayer: DashSnapshotHandler init failed:",e)})}}else{const i=window;if(i.Hls){const r=new mt({src:e,engineSettings:t.engineSettings},null);r.init(i.Hls),yt=()=>r.destroy();const n=r.getVideo();null!==n&&s.bus.emit("snapshot-handler-ready",{take:e=>r.take(e),video:n})}}},500)}},close(){null!==yt&&(yt(),yt=null),null!==vt&&(vt.detach(),vt=null)},get state(){return s.state}};return s.setReloadCallback(()=>{if(!n)return;const e=n,t=s.getSavedSelections();a.close(),setTimeout(()=>{a.open(e),setTimeout(()=>{null!==vt&&(vt.setQuality(t.quality),vt.setAudioTrack(t.audioTrack),vt.setSubtitle(t.subtitleTrack))},2e3)},100)}),t.src&&a.open(t.src),a}function xt(){null!==vt&&(vt.detach(),vt=null)}function wt(){null!==vt&&(vt.detach(),vt=null),null!==ft&&(ft.dispose(),ft=null)}"undefined"!=typeof window&&(window.EBPlayer={start:kt,stop:xt,destroy:wt});const Tt=c(o,{autoplay:!0,muted:!0,src:"https://live.easybroadcast.fr/hls/live/playlist.m3u8",liveButton:!0,showProgressThumb:!0});if(Tt.start){const e=Tt.el;("string"==typeof e?null!==document.querySelector(e):e instanceof HTMLElement)&&kt(Tt)}const Ct="main",Et={bufferInfo(e,t,s){if(!e.buffered||0===e.buffered.length)return{end:0,start:0,len:0,nextStart:0};for(let i=0;i<e.buffered.length;i++){const r=e.buffered.start(i),n=e.buffered.end(i);if(t>=r-s&&t<=n+s)return{end:n,start:r,len:n-t,nextStart:0}}return{end:0,start:0,len:0,nextStart:0}}};var Lt=Object.freeze({__proto__:null,createHlsAbrController:function(e){const t=e.DefaultConfig.abrController;if(!t)return class{constructor(e){}get nextAutoLevel(){return-1}set nextAutoLevel(e){}destroy(){}};const{Events:s}=e;return class extends t{constructor(e){super(e,s.FRAG_LOADING,s.FRAG_LOADED,s.FRAG_BUFFERED,s.ERROR),this.hls=e,this.lastLoadedLevel=1,this._nextAutoLevel=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.onBufferCheckTick=this._onBufferCheckTick.bind(this),this.bufferCheckLastPlayPos=0,this.bufferCheckCurrentPlayPos=0,this.bufferCheckBufferingDetected=!1,this.lastDuration=6,this.setBufferValues=new Set,this.setBitrate=new Set,this.loading=!1,this.playingTime=0,this.minBufferValue=30,this.maxBufferValue=0,this.lastBufferValue=30,this.maxBufferLength=30,this.rebuffering=0,this.rebufferingRatio=.15,this.pastBufferFactor=5,this.bitrateTestDelay=0,this.timer=void 0,this.bufferCheckTimer=void 0,this.init=!0,this.fraglastBuffered=0,this.lastLoadedFragLevel=1,this.fragCurrent=null,this.partCurrent=null,this.bufferCheckVideo=null,this.registerCustomListeners()}destroy(){this.unregisterCustomListeners(),this.clearCustomTimer(),void 0!==this.bufferCheckTimer&&(clearInterval(this.bufferCheckTimer),this.bufferCheckTimer=void 0),"function"==typeof super.destroy&&super.destroy()}registerCustomListeners(){this.hls.on(s.FRAG_LOADING,this.onFragLoading,this),this.hls.on(s.FRAG_LOADED,this.onFragLoaded,this),this.hls.on(s.FRAG_BUFFERED,this.onFragBuffered,this),this.hls.on(s.LEVEL_LOADED,this.onLevelLoaded,this),this.hls.on(s.ERROR,this.onError,this)}unregisterCustomListeners(){this.hls.off(s.FRAG_LOADING,this.onFragLoading,this),this.hls.off(s.FRAG_LOADED,this.onFragLoaded,this),this.hls.off(s.FRAG_BUFFERED,this.onFragBuffered,this),this.hls.off(s.LEVEL_LOADED,this.onLevelLoaded,this),this.hls.off(s.ERROR,this.onError,this)}clearCustomTimer(){void 0!==this.timer&&(clearInterval(this.timer),this.timer=void 0)}onFragLoading(e,t){const s=t,{frag:i}=s;this.loading=!0,i.type===Ct&&(this.timer||(this.fragCurrent=i,this.partCurrent=s.part??null,this.timer=setInterval(this.onCheck,100)))}getBuffer(){if(!this.hls.media)return 0;const e=this.hls.media.playbackRate||1,t=this.hls.media.currentTime;return(Et.bufferInfo(this.hls.media,t,this.maxBufferLength).end-t)/e}_abandonRulesCheck(){const{hls:e}=this,t=e.media,s=this.fragCurrent,i=this.partCurrent;if(!s||!t)return;if((i?i.stats:s.stats).aborted)return this.clearCustomTimer(),void(this._nextAutoLevel=-1);e.autoLevelEnabled&&!t.paused&&t.playbackRate&&t.readyState&&s.type===Ct&&"initSegment"!==s.sn&&(this.bufferCheckLastPlayPos=0,this.bufferCheckCurrentPlayPos=0,this.bufferCheckBufferingDetected=!1,this.bufferCheckVideo=t,this.bufferCheckTimer=setInterval(this.onBufferCheckTick,1e3))}_onBufferCheckTick(){if(!this.hls)return;if(!1===this.loading){const e=this.getBuffer();this.getBufferMinMaxValue(e)}const e=this.bufferCheckVideo;e&&(this.playingTime+=1,this.bufferCheckCurrentPlayPos=e.currentTime,this.bufferCheckLastPlayPos>0&&e.paused&&!this.bufferCheckBufferingDetected&&this.bufferCheckCurrentPlayPos<=this.bufferCheckLastPlayPos&&(this.rebuffering+=1,this.bufferCheckBufferingDetected=!0,this.hls.currentLevel>0&&(this.reset(),0!==this.lastLoadedFragLevel&&this.clearCustomTimer())),this.bufferCheckLastPlayPos>0&&this.bufferCheckBufferingDetected&&!e.paused&&this.bufferCheckCurrentPlayPos>this.bufferCheckLastPlayPos&&(this.bufferCheckBufferingDetected=!1),this.bufferCheckLastPlayPos=this.bufferCheckCurrentPlayPos)}onFragLoaded(e,t){const i=t,{frag:r,part:n}=i,a=n?n.stats:r.stats,o=n?n.duration:r.duration;if(this.loading=!1,r.type===Ct&&"number"==typeof r.sn){this.clearCustomTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1;const e=this.hls.levels[r.level];if(e){const t=(e.loaded?e.loaded.bytes:0)+a.loaded,s=(e.loaded?e.loaded.duration:0)+o;e.loaded={bytes:t,duration:s},e.realBitrate=Math.round(8*t/s),this.setBitrate.add(e.realBitrate),this.lastDuration=o,this.maxBufferLength=10*this.lastDuration}this.onFragBuffered(s.FRAG_BUFFERED,{stats:a,frag:r,part:n,id:r.type})}}getBufferMinMaxValue(e){this.lastBufferValue<e&&(this.setBufferValues.add(this.minBufferValue),this.maxBufferValue=e,this.lastBufferValue=e,this.minBufferValue=e),e>this.maxBufferValue&&(this.maxBufferValue=e),e<this.minBufferValue&&(this.minBufferValue=e,this.lastBufferValue=this.minBufferValue)}reset(){this.setBufferValues.clear(),this.setBitrate.clear()}onError(e,t){if("fragLoadTimeOut"===t.details)this.clearCustomTimer()}onLevelLoaded(e,t){}onFragBuffered(e,t){const s=t,{frag:i,part:r}=s,n=r?r.stats:s.stats??i.stats;if(n.aborted)return;if(i.type!==Ct||"initSegment"===i.sn)return;const a=n.loading?.start??0,o=(n.parsing?.end??0)-a;this.bitrateTestDelay=o/1e3,this.fraglastBuffered=Date.now()}findNextBestLevel(e){const t=this.hls.levels;for(let s=0;s<t.length;s++){if(s<t.length-2&&.8*this.avgBitrate>=t[s].bitrate&&this.avgBitrate<=t[s+1].bitrate)return this.reset(),this.lastLoadedFragLevel=e<3?s:s-1,this.lastLoadedFragLevel;if(s===t.length-1){return this.getBuffer()>this.lastDuration+this.lastDuration/2&&e<3?this.lastLoadedFragLevel=s:this.lastLoadedFragLevel=s-1,this.reset(),this.lastLoadedFragLevel}}return this.lastLoadedFragLevel}get avgBitrate(){return 0===this.setBitrate.size?0:Array.from(this.setBitrate).reduce((e,t)=>e+t,0)/this.setBitrate.size}set avgBitrate(e){}findBestLevel(){if(!this.hls)return 0;const e=this.hls.levels.length-1,t=this.getBuffer();if(t<.1*this.hls.config.maxBufferLength)return this.reset(),this.lastLoadedFragLevel=Math.max(this.lastLoadedFragLevel-1,0),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel;if(!0===this.init)return this.init=!1,this.lastLoadedFragLevel=e,this.lastLoadedFragLevel;if(t>.3*this.hls.config.maxBufferLength)return this.lastLoadedFragLevel=this.findNextBestLevel(5),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel;if(this.setBufferValues.size>=this.pastBufferFactor)try{const t=Array.from(this.setBufferValues).reduce((e,t)=>e+t,0)/this.setBufferValues.size,s=function(e){const t=e.reduce((e,t)=>e+t,0)/e.length,s=e.map(e=>(e-t)**2);return Math.sqrt(s.reduce((e,t)=>e+t,0)/(e.length-1))}(Array.from(this.setBufferValues));this.setBufferValues.clear();const i=this.hls.levels[this.hls.currentLevel]?.bitrate??0;return t<=.1*this.hls.config.maxBufferLength&&i>=this.hls.levels[0].bitrate?(this.reset(),this.lastLoadedFragLevel=Math.max(this.lastLoadedFragLevel-1,0),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel):t<=.3*this.hls.config.maxBufferLength?(this.reset(),this.lastLoadedFragLevel):t<=.7*this.hls.config.maxBufferLength&&i<this.avgBitrate?(this.reset(),this.lastLoadedFragLevel=this.findNextBestLevel(s),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel):t>.7*this.hls.config.maxBufferLength&&i<.8*this.avgBitrate?(this.lastLoadedFragLevel=this.findNextBestLevel(s),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel):(this.reset(),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel)}catch(t){return console.warn("HLS ABR: findBestLevel error",t),this.lastLoadedFragLevel=this.findNextBestLevel(3),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel}return this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel}get _nextABRAutoLevel(){try{return this.playingTime>0&&this.rebuffering/this.playingTime>this.rebufferingRatio?(this.lastLoadedFragLevel=0,0):(this.setBitrate.size>0&&(this.lastLoadedFragLevel=this.findBestLevel()),this.lastLoadedFragLevel)}catch(e){return console.warn("HLS ABR: Could not define level, using last loaded level",e),this.lastLoadedFragLevel}}get nextAutoLevel(){return this._nextABRAutoLevel}set nextAutoLevel(e){this._nextAutoLevel=e}}}});return e.destroy=wt,e.start=kt,e.stop=xt,e}({});
383
+ `}bindElementRefs(){const e=this.el?.firstElementChild;this.videoElement=null!==e?e.querySelector("video.eb-video"):null,this.adsContainerElement=null!==e?e.querySelector(".eb-ads-container"):null;this.config.posterStream&&null!==e&&(this.posterVideoElement=e.querySelector(".eb-poster-video"))}subscribeToState(){const e=this.state,{signal:t}=this;e.on("isRtl",()=>{this.applyRtl()},{signal:t}),e.on("isIOS",()=>{this.updateIOSState()},{signal:t}),e.on("playbackState",()=>{this.updatePosterVisibility()},{signal:t}),e.on("currentTime",()=>{this.state.currentTime>0&&this.updatePosterVisibility()},{signal:t}),e.on("isRadio",()=>{this.updateRadioOverlay()},{signal:t}),e.on("controlsVisible",()=>{this.updateControlsVisibility()},{signal:t})}updatePosterVisibility(){const e=this.el?.firstElementChild;if(null==e)return;const t=e.querySelector(".eb-poster");if(null===t)return;const i=this.state.playbackState,r=this.state.currentTime>0,s=!1!==this.config.image&&("idle"===i||"loading"===i||"playing"===i&&!r);t.style.display=s?"":"none"}updateIOSState(){const e=this.el?.firstElementChild;if(null==e)return;const t=this.state.isIOS;e.classList.toggle("eb-ios-native",t);const i=e.querySelector("video.eb-video");null!==i&&(i.controls=t)}updateRadioOverlay(){const e=this.el?.firstElementChild;if(null==e)return;const t=e.querySelector(".eb-overlay-zone");if(null===t)return;const i=t.querySelector(".eb-radio-overlay"),r=this.state.isRadio;if(r&&null===i){const e=document.createElement("div");e.className="eb-radio-overlay";const i=document.createElement("div");i.className="eb-radio-bars";for(let e=0;e<5;e++){const e=document.createElement("span");e.className="eb-radio-bar",i.appendChild(e)}e.appendChild(i),t.appendChild(e)}else r||null===i||i.remove()}updateControlsVisibility(){const e=this.el?.firstElementChild;if(null==e)return;const t=this.state.controlsVisible;e.classList.toggle("eb-controls-visible",t),e.classList.toggle("eb-controls-hidden",!t)}applyRtl(){const e=this.el?.firstElementChild;if(null==e)return;this.state.isRtl?e.setAttribute("dir","rtl"):e.removeAttribute("dir")}invokeExtensions(){const e=this.config.extensions;if(void 0===e)return;const t=this.el?.firstElementChild;if(null==t)return;const i={"top-extra":".eb-extension-top-extra","bottom-extra":".eb-extension-bottom-extra",overlay:".eb-extension-overlay","controls-extra":".eb-extension-controls-extra"};for(const[r,s]of Object.entries(e)){const e=i[r];if(void 0===e)continue;const a=t.querySelector(e);if(null===a)continue;const n=s(a,this.state,this.bus,this.signal);"function"==typeof n&&this.extensionCleanups.push(n)}}disconnect(){for(const e of this.childComponents)e.disconnect();this.childComponents=[];for(const e of this.extensionCleanups)e();this.extensionCleanups=[],this.videoElement=null,this.adsContainerElement=null,this.posterVideoElement=null,super.disconnect()}}class Qe{constructor(e,t,i){this.timer=0,this.state=t,this.container=e,this.onActivity=()=>this.show(),e.addEventListener("pointermove",this.onActivity),e.addEventListener("touchstart",this.onActivity),e.addEventListener("keyup",this.onActivity),i.addEventListener("abort",()=>{this.container.removeEventListener("pointermove",this.onActivity),this.container.removeEventListener("touchstart",this.onActivity),this.container.removeEventListener("keyup",this.onActivity),clearTimeout(this.timer),this.timer=0},{once:!0}),this.show()}show(){this.state.controlsVisible=!0,clearTimeout(this.timer),this.timer=setTimeout(()=>{this.hide()},3e3)}hide(){this.state.settingsOpen||this.state.socialsOpen||this.state.infoOpen||this.state.adPlaying||(this.state.controlsVisible=!1)}}class Xe{constructor(e,t,i,r,s){e.tabIndex<0&&(e.tabIndex=0);const a=e=>{const s=e;if(!t.adPlaying){if(" "===s.key)return s.preventDefault(),void("playing"===t.playbackState?i.emit("pause"):i.emit("play"));if("ArrowLeft"===s.key){const e=r.seekOffset||15,s=Math.max(t.currentTime-e,0);return void i.emit("seek",{time:s})}if("ArrowRight"===s.key){const e=r.seekOffset||15,s=Math.min(t.currentTime+e,t.duration);return void i.emit("seek",{time:s})}r.supportHotKeys&&("m"!==s.key||i.emit("mute-toggle"))}};e.addEventListener("keyup",a),s.addEventListener("abort",()=>{e.removeEventListener("keyup",a)},{once:!0})}}function Ke(e){const t=window;if(void 0!==t[e])return t[e];try{return(0,eval)(e)}catch{return}}function Je(e,t,i={}){const r=Ke(t);if(void 0!==r)return Promise.resolve(r);const s=i.timeout??1e4;return new Promise((i,r)=>{let a;const n=()=>{clearTimeout(a)},o=document.createElement("script");o.src=e,o.onload=()=>{n();const s=Ke(t);void 0===s?r(new Error(`CDN: '${t}' not on window after loading ${e}`)):i(s)},o.onerror=()=>{n(),r(new Error(`CDN: failed to load ${e}`))},a=setTimeout(()=>{r(new Error(`CDN: timeout loading ${e}`))},s),document.head.appendChild(o)})}let Ze=null;class et{constructor(e){this.localDriver=null,this.signal=e.signal}async init(e,t,i){if(!e.chromecast)return;const r=await Je(e.chromecast,"Castjs");null===Ze&&(Ze=new r({receiver:e.chromecastApp??"00197684"})),this.localDriver=Ze,this.applyMetadata(e.chromecastMetadata),this.bindDriverEvents(t,i),this.registerAbortCleanup()}getDriver(){return this.localDriver}toggleCast(e){const t=this.localDriver;if(null!==t)if(t.connected)t.disconnect();else if(e.castAvailable){const i=this.buildCastOptions(e);t.cast(e.src??"",i)}}applyMetadata(e){if(void 0===e||null===this.localDriver)return;const t=this.localDriver;void 0!==e.title&&(t.title=e.title),void 0!==e.description&&(t.description=e.description),void 0!==e.poster&&(t.poster=e.poster)}bindDriverEvents(e,t){const i=this.localDriver;i.on("available",()=>{e.castAvailable=!0}),i.on("connect",()=>{e.isCasting=!0}),i.on("disconnect",()=>{const r=i.time;e.isCasting=!1,void 0!==r&&r>0?t.emit("cast-stop-with-position",{time:r}):t.emit("cast-stop")}),i.on("error",()=>{e.isCasting=!1,t.emit("cast-failed")})}buildCastOptions(e){const t=this.localDriver;return{title:t?.title,description:t?.description,poster:e.image}}registerAbortCleanup(){this.signal.addEventListener("abort",()=>{const e=this.localDriver;null!==e&&e.connected&&e.disconnect(),this.localDriver=null},{once:!0})}}class tt{constructor(){this.pollTimer=null}async start(e,t,i){if(void 0!==e.epgContentId&&(await this.fetchEpg(e,t),null!==e.epgPolling&&void 0!==e.epgPolling)){const r=1e3*e.epgPolling;this.pollTimer=setInterval(()=>{this.fetchEpg(e,t)},r),i.addEventListener("abort",()=>{clearInterval(this.pollTimer),this.pollTimer=null},{once:!0})}}async fetchEpg(e,t){const i=`https://epg.dev.easybroadcast.io/channels/${e.epgContentId}/last-24-h-programs`;try{const e=await fetch(i,{mode:"cors"});if(!e.ok)throw new Error(`EPG fetch failed with status: ${e.status}`);const r=await e.json();t.epgPrograms=r,t.epgFetchedAt=Date.now()}catch(e){console.error("EBPlayer: Error fetching EPG data:",e)}}}class it{init(e,t,i,r){const s=e.playlist;s&&0!==s.length&&(t.playlist=s,t.currentEpisode=0,i.on("playlist-next",()=>{this.advance(t,1)},{signal:r}),i.on("playlist-prev",()=>{this.advance(t,-1)},{signal:r}))}advance(e,t){const i=e.playlist.length,r=(e.currentEpisode+t+i)%i;e.currentEpisode=r,e.src=e.playlist[r].src}}class rt{constructor(){this.imaAdsManager=null,this.imaDisplayContainer=null}async init(e,t,i,r,s,a){if(!e.preroll)return;if(!e.autoplay&&(await this.waitForUserGesture(r,a),a.aborted))return;const n=await Je("https://imasdk.googleapis.com/js/sdkloader/ima3.js","google"),{ima:o}=n,l=new o.AdDisplayContainer(s,r);this.imaDisplayContainer=l,l.initialize();const d=new o.AdsLoader(l);d.addEventListener(o.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,e=>{const s=e.getAdsManager(r);this.imaAdsManager=s;const{width:a,height:n}=r.getBoundingClientRect?r.getBoundingClientRect():{width:640,height:360};s.addEventListener(o.AdEvent.Type.CONTENT_PAUSE_REQUESTED,()=>{t.adPlaying=!0}),s.addEventListener(o.AdEvent.Type.CONTENT_RESUME_REQUESTED,()=>{t.adPlaying=!1,r.play()}),s.addEventListener(o.AdEvent.Type.ALL_ADS_COMPLETED,()=>{t.adPlaying=!1,i.emit("ad-complete")}),s.init(a,n),s.start()});const c=new o.AdsRequest;c.adTagUrl=e.preroll,d.requestAds(c),a.addEventListener("abort",()=>{null!==this.imaAdsManager&&(this.imaAdsManager.destroy(),this.imaAdsManager=null),null!==this.imaDisplayContainer&&(this.imaDisplayContainer.destroy(),this.imaDisplayContainer=null)},{once:!0})}waitForUserGesture(e,t){return new Promise(i=>{const r=()=>{e.removeEventListener("click",r),i()};e.addEventListener("click",r),t.addEventListener("abort",()=>{e.removeEventListener("click",r),i()},{once:!0})})}}class st{get signal(){return this.abortController.signal}get container(){return this._container}constructor(e){this.config=g(u,e),this.state=n(),this.bus=new o,this.i18n=new k(this.config.lang),this.abortController=new AbortController,this._container=null,this.engineSync=null,this.skinRoot=null,this.commandHandler=null,this.chromecastManager=null,this.reloadCallback=null}mount(e){this._container=e,e.textContent="",delete e._$litPart$,e.removeAttribute("data-theme"),e.removeAttribute("style"),this.config.skin&&"default"!==this.config.skin&&e.setAttribute("data-theme",this.config.skin);const t=this.config.skinColors;if(this.config.primaryColor&&e.style.setProperty("--eb-color-primary",this.config.primaryColor),t?.general&&e.style.setProperty("--eb-color-primary",t.general),t?.progressBar&&e.style.setProperty("--eb-color-progress",t.progressBar),t?.volumeBar&&e.style.setProperty("--eb-color-volume",t.volumeBar),this.state.isRtl="ar"===this.config.lang,this.state.isRadio=!0===this.config.radio,!this.config.noUi){const t=new Ge;this.skinRoot=t,t.connect(e,this.state,this.bus,this.config,this.i18n);const i=t.getVideoElement();null!==i&&(this.state.muted=i.muted,this.state.volume=i.volume),new Qe(e,this.state,this.signal),new Xe(e,this.state,this.bus,this.config,this.signal)}this.initIntegrations();const i=this.skinRoot?.getVideoElement()??null;null!==i&&(this.commandHandler=new x(this.bus,i,this.state,()=>this.engineSync,this.chromecastManager,this.i18n,()=>{this.reloadCallback?.()},this.signal))}setReloadCallback(e){this.reloadCallback=e}getSavedSelections(){return null!==this.commandHandler?this.commandHandler.getSavedSelections():{quality:-1,audioTrack:0,subtitleTrack:-1}}setEngineSync(e){null!==this.engineSync&&this.engineSync.detach(),this.engineSync=e,e.attach(this.state,this.signal)}dispose(){null!==this.engineSync&&(this.engineSync.detach(),this.engineSync=null),this.bus.dispose(),this.abortController.abort(),null!==this.skinRoot&&(this.skinRoot.disconnect(),this.skinRoot=null),this._container=null,this.commandHandler=null,this.chromecastManager=null,this.reloadCallback=null,this.abortController=new AbortController}initIntegrations(){const{config:e,state:t,bus:i,signal:r}=this;if(e.chromecast){const r=new et(this.abortController);this.chromecastManager=r,r.init(e,t,i).catch(e=>{console.error("EBPlayer: ChromecastManager init failed:",e)})}if(e.epgContentId){(new tt).start(e,t,r).catch(e=>{console.error("EBPlayer: EpgManager start failed:",e)})}const s=e.playlist;if(s&&s.length>0){(new it).init(e,t,i,r)}if(e.preroll&&null!==this.skinRoot){const s=new rt,a=this.skinRoot.getVideoElement(),n=this.skinRoot.getAdsContainer();null!==a&&null!==n&&s.init(e,t,i,a,n,r).catch(e=>{console.error("EBPlayer: AdsManager init failed:",e)})}if(e.posterStream){const i=function(){let e=null;return{attach({src:t,container:i,Hls:r}){console.log("Poster HLS: attach media",t,i),e=new r,e.loadSource(t),e.attachMedia(i)},close(){if(e){try{e.detachMedia?.(),e.destroy?.()}catch(e){console.error("Poster HLS player close error:",e)}e=null}},play(){e?.media?.play()},pause(){e?.media?.pause()}}}(),s=this.skinRoot?.getPosterVideoElement()??null;t.on("playbackState",t=>{if("playing"===t){if(null!==s){const t=window.Hls;t&&i.attach({src:e.posterStream,container:s,Hls:t})}i.play()}else"paused"!==t&&"buffering"!==t||i.pause()},{signal:r}),r.addEventListener("abort",()=>{i.close()},{once:!0})}}}class at{}class nt{constructor(e){this.intervalId=null,this.lastTime=null,this.stallAttempts=0,this.video=e.video,this.onRecoverAttempt=e.onRecoverAttempt,this.onReloadRequired=e.onReloadRequired,this.isCasting=e.isCasting}start(){this.stop(),this.intervalId=setInterval(()=>{this.tick()},1e4)}stop(){null!==this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.lastTime=null,this.stallAttempts=0}tick(){if(this.video.paused||this.video.seeking||this.video.readyState<3||this.isCasting())return this.lastTime=null,void(this.stallAttempts=0);const e=this.video.currentTime;null!==this.lastTime&&e===this.lastTime?(this.stallAttempts+=1,this.stallAttempts<=2?this.onRecoverAttempt(this.stallAttempts):(this.onReloadRequired(),this.stop())):(this.stallAttempts=0,this.lastTime=e)}}class ot extends at{constructor(){super(),this.video=null,this.state=null,this.signal=null,this.bus=null,this.config=null,this.watchdog=null,this.driverReady=new Promise(e=>{this.resolveDriverReady=e})}attach(e,t){this.state=e,this.signal=t,this.onAttach()}detach(){this.watchdog?.stop(),this.watchdog=null,this.onDetach(),this.video=null,this.state=null,this.signal=null,this.bus=null,this.config=null}startWatchdog(){if(!this.video||!this.bus)return;const e=this.bus;this.watchdog=new nt({video:this.video,onRecoverAttempt:e=>{this.recoverFromStall(e)},onReloadRequired:()=>{e.emit("request-reload")},isCasting:()=>this.state?.isCasting??!1}),this.watchdog.start()}stopWatchdog(){this.watchdog?.stop(),this.watchdog=null}setConfig(e){this.config=e}setBus(e){this.bus=e}setVideo(e){this.video=e}bindVideoEvents(e,t,i){const r=this.config?.syncLiveMargin??300;e.addEventListener("timeupdate",()=>{t.currentTime=Math.round(e.currentTime),t.isLive&&(t.isSyncWithLive=e.currentTime+r>e.duration)},{signal:i}),e.addEventListener("durationchange",()=>{t.duration=Math.ceil(e.duration)},{signal:i}),e.addEventListener("volumechange",()=>{t.volume=e.volume,t.muted=e.muted},{signal:i}),e.addEventListener("progress",()=>{e.buffered.length>0&&(t.bufferedEnd=e.buffered.end(e.buffered.length-1))},{signal:i}),e.addEventListener("ratechange",()=>{t.playbackRate=e.playbackRate},{signal:i}),e.addEventListener("playing",()=>{t.playbackState="playing"},{signal:i}),e.addEventListener("pause",()=>{t.playbackState="paused"},{signal:i}),e.addEventListener("waiting",()=>{t.playbackState="buffering"},{signal:i}),e.addEventListener("ended",()=>{t.playbackState="ended"},{signal:i})}seek(e){null!==this.video&&(this.video.currentTime=e)}}const lt=Object.freeze({EASY_B:"easy_b",BUNNY:"bunny",AKAMAI:"akamai",VENOM:"venom"}),dt=Object.freeze({UNKNOWN:"unknown",MAX_RETRY:"max_retry",FORBIDDEN:"forbidden"});class ct extends Error{constructor({status:e="unknown",errorCode:t="unknown",errorType:i=dt.UNKNOWN,message:r=null}){super(r??`TokenError: ${e} - ${t}`),this.status=e,this.errorCode=t,this.errorType=i}}class ht{constructor({src:e,responseParameters:t,error:i=null,extras:r={}}){if(this.src=e,this.responseParameters=t,this.extras=r??{},null!==i&&!(i instanceof ct))throw new Error("TokenResponse error must be an instance of TokenError");this.error=i}static fromJson({src:e,json:t}){const i=JSON.parse(t),r={token:i.token??null,tokenPath:i.token_path??null,expires:i.expires??null},s=new ht({src:e,responseParameters:r});for(const e of Object.keys(i))["token","expires","token_path"].includes(e)||(s.extras[e]=i[e]);return s}static fromAkamai({src:e,text:t}){const i=bt({src:e,text:t});return new ht({src:e,responseParameters:i})}static fromText({src:e,text:t}){if(t.trim().startsWith("{"))return ht.fromJson({src:e,json:t});const i=new URLSearchParams(t.trim().replace(/^\?/,"")),r=i.get("token")??null,s=i.get("expires"),a=s?parseInt(s,10):null,n=i.get("token_path")??null,o=new ht({src:e,responseParameters:{token:r,tokenPath:n,expires:a}});return i.forEach((e,t)=>{["token","expires","token_path"].includes(t)||(o.extras[t]=e)}),o}static fromDefault({src:e,text:t}){const i=new URLSearchParams(t.trim().replace(/^\?/,"")),r=i.get("expires"),s={verify:i.get("verify")??null,expires:r?parseInt(r,10):null},a=new ht({src:e,responseParameters:s});return i.forEach((e,t)=>{["verify","expires"].includes(t)||(a.extras[t]=e)}),a}static fromError({src:e,error:t}){const i=t instanceof ct?t:new ct(t);return new ht({src:e,error:i})}}function bt({src:e,text:t}){const i=new URL(`${e}${t?`?${t}`:""}`);let r=null,s=null,a=null,n=null,o=null;const l=new URLSearchParams(i.search);if(r=l.get("hdntl"),o=l.get("hdnea"),!r&&!o){const e=i.pathname.split("/");for(const t of e){if(t.startsWith("hdntl=")){r=t.substring(6);break}if(t.startsWith("hdnea=")){o=t.substring(6);break}}}const d=r??o;if(d){const e=d.match(/exp=(\d+)/);e&&(s=e[1]);const t=d.match(/hmac=([a-f0-9]+)/);t&&(a=t[1]);const i=d.match(/acl=([^~]+)/);i&&(n=i[1])}return{expires:s,hdntl:d,hmac:a,acl:n,hdnea:o}}function ut(e){return new Promise(t=>{setTimeout(t,e)})}class pt{constructor({token:e,tokenType:t,srcInTokenRequest:i=!1,extraParamsCallback:r=null,onCDNTokenError:s,maxRetries:a=3,retryInterval:n=1e4,expirationMarginInSeconds:o=30}){const l=Object.values(lt);void 0!==t&&l.includes(t)?this.tokenType=t:this.tokenType=void 0,this.tokenGeneratorUrl=e,this.srcInTokenRequest=i,this.extraParamsCallback=r&&"function"==typeof r?r:null,this.callbackError=s&&"function"==typeof s?s:null,this.attempt=0,this.maxRetries=a,this.retryInterval=n,this.expirationMarginInSeconds=o,this.lastTokenResponse=null,this.resetAttemptCounterTimeout=null}resetAttemptCounter(){this.resetAttemptCounterTimeout||(this.resetAttemptCounterTimeout=setTimeout(()=>{this.attempt=0},3e4))}async _fetchDefaultToken(e,t=null){const i=new URL(e);if(["verify","expires"].forEach(e=>i.searchParams.delete(e)),this.attempt>=this.maxRetries)return this.resetAttemptCounter(),ht.fromError({src:i.toString(),error:new ct({status:t?.status,errorCode:"Unauthorized",errorType:dt.MAX_RETRY})});try{let t;if(this.attempt+=1,t=!0===this.srcInTokenRequest?await fetch(`${this.tokenGeneratorUrl}?url=${encodeURIComponent(i.toString())}`):await fetch(this.tokenGeneratorUrl),403===t.status)return await ut(this.retryInterval),this._fetchDefaultToken(e,t);if(t.status>=400)return ht.fromError({src:i.toString(),error:new ct({status:t.status})});this.attempt=0;const r=await t.text();return ht.fromDefault({src:i.toString(),text:r})}catch(e){return console.error("CDNToken: Error fetching default token ",e),ht.fromError({src:i.toString(),error:e})}}async _fetchEasyBToken(e,t=null){if(this.attempt>=this.maxRetries)return this.resetAttemptCounter(),ht.fromError({src:e,error:new ct({status:t?.error?.status,errorCode:t?.error?.errorCode??"Unauthorized",errorType:dt.MAX_RETRY})});try{this.attempt+=1;const i={};if(this.extraParamsCallback){const e=await this.extraParamsCallback(t?.error?.status);e?.accessToken&&(i.Authorization=`Bearer ${String(e.accessToken)}`)}else console.warn("CDNToken: no extraParamsCallback provided");let r;if(r=!0===this.srcInTokenRequest?await fetch(`${this.tokenGeneratorUrl}?url=${encodeURIComponent(e)}`,{method:"GET",headers:i}):await fetch(this.tokenGeneratorUrl,{method:"POST",headers:i,body:JSON.stringify({streamUrl:e})}),r.status>=400){const t=ht.fromError({src:e,error:new ct({status:r.status})});return 403===r.status?(await ut(this.retryInterval),this._fetchEasyBToken(e,t)):t}this.attempt=0;const s=await r.text();return ht.fromText({src:e,text:s})}catch(t){return console.error("CDNToken: Error fetching token ",t),ht.fromError({src:e,error:t})}}async _fetchAkamaiToken(e,t=null){if(this.attempt>=this.maxRetries)return this.resetAttemptCounter(),ht.fromError({src:e,error:new ct({status:t?.status,errorCode:"Unauthorized",errorType:dt.MAX_RETRY})});try{this.attempt+=1;const t=await fetch(`${this.tokenGeneratorUrl}?url=${encodeURIComponent(e)}`);if(403===t.status)return await ut(this.retryInterval),this._fetchAkamaiToken(e,t);if(t.status>=400)return ht.fromError({src:e,error:new ct({status:t.status})});this.attempt=0;const i=await t.text();return ht.fromAkamai({src:e,text:i})}catch(t){return console.error("CDNToken: Error fetching token ",t),ht.fromError({src:e,error:t})}}async _fetchBunnyToken(e,t=null){if(this.attempt>=this.maxRetries)return this.resetAttemptCounter(),ht.fromError({src:e,error:new ct({status:t?.error?.status,errorCode:t?.error?.errorCode??"Unauthorized",errorType:dt.MAX_RETRY})});try{this.attempt+=1;const i={"Content-Type":"application/json"};if(this.extraParamsCallback){const e=await this.extraParamsCallback(t?.error?.status);e?.accessToken&&(i.Authorization=`Bearer ${String(e.accessToken)}`)}else console.warn("CDNToken: no extraParamsCallback provided");const r=await fetch(this.tokenGeneratorUrl,{method:"POST",headers:i,body:JSON.stringify({streamUrl:e})});if(r.status>=400){const t=r.headers.get("content-type"),i=t?.includes("application/json")?await r.json():await r.text(),s="object"==typeof i&&null!==i?i.error?.errorCode??"Unauthorized":"Unauthorized",a="object"==typeof i&&null!==i?i.error?.__type??dt.UNKNOWN:dt.UNKNOWN,n=new ct({status:r.status,errorCode:s,errorType:a}),o=ht.fromError({src:e,error:n});return[403,401,498].includes(r.status)?(this.callbackError?this.callbackError({status:n.status,errorCode:n.errorCode,errorType:n.errorType}):console.warn(`CDNToken: Bunny token fetch attempt ${this.attempt} for ${e} failed with status ${r.status}, retrying in ${this.retryInterval/1e3}s`),await ut(this.retryInterval),this._fetchBunnyToken(e,o)):(console.error(`CDNToken: error generating Bunny token on attempt ${this.attempt}`,JSON.stringify(o)),o)}const s=await r.json();return this.attempt=0,Number.isInteger(s.max_retries)&&s.max_retries>0&&(this.maxRetries=s.max_retries),Number.isInteger(s.retry_interval)&&s.retry_interval>0&&(this.retryInterval=1e3*s.retry_interval),ht.fromJson({src:e,json:JSON.stringify(s)})}catch(t){return console.error("CDNToken: Error fetching bunny token:",t),ht.fromError({src:e,error:t})}}async fetchToken({src:e}){if(!e)return console.warn("CDNToken: Missing src to tokenize"),null;switch(this.tokenType){case lt.BUNNY:this.lastTokenResponse=await this._fetchBunnyToken(e);break;case lt.AKAMAI:this.lastTokenResponse=await this._fetchAkamaiToken(e);break;case lt.VENOM:case lt.EASY_B:this.lastTokenResponse=await this._fetchEasyBToken(e);break;default:this.lastTokenResponse=await this._fetchDefaultToken(e)}return this.lastTokenResponse}async updateUrlWithTokenParams({url:e}){const t=new URL(e),i=t.searchParams.get("expires");switch(this.tokenType){case lt.AKAMAI:{const i=bt({src:e,text:""});if(!this.isTokenExpired(i.expires))return e;const r=t.pathname.split("/");t.pathname=r.filter(e=>!e.startsWith("hdntl=")&&!e.startsWith("hdnea=")).join("/");break}case lt.EASY_B:case lt.VENOM:case lt.BUNNY:{if(!this.isTokenExpired(i))return e;["token","expires","token_path"].forEach(e=>t.searchParams.delete(e));const r=this.lastTokenResponse;if(r){const t=r.responseParameters;if(t&&!this.isTokenExpired(t.expires)){const{token:i,expires:r,tokenPath:s}=t;return pt.appendTokenParams(e,i,r,s)}}break}default:if(!this.isTokenExpired(i))return e}try{const i=await this.fetchToken({src:t.toString()});if(null===i)return e;if(i.error)return this.callbackError&&this.callbackError({status:i.error.status,errorCode:i.error.errorCode,errorType:i.error.errorType}),e;switch(this.tokenType){case lt.BUNNY:case lt.VENOM:case lt.EASY_B:{const t=i.responseParameters;return pt.appendTokenParams(e,t.token,t.expires,t.tokenPath)}case lt.AKAMAI:{const t=i.responseParameters;return pt.appendAkamaiTokenParams(e,t.hdntl??t.hdnea??"")}default:return pt.appendDefaultTokenParams(e,i)}}catch(t){return console.error("CDNToken: Error while fetching new token:",t),e}}isTokenExpired(e){if(null==e)return!0;const t=Math.floor(Date.now()/1e3)+this.expirationMarginInSeconds;return Number(e)<t}destroy(){this.resetAttemptCounterTimeout&&(clearTimeout(this.resetAttemptCounterTimeout),this.resetAttemptCounterTimeout=null),this.attempt=0,this.lastTokenResponse=null,console.log("CDNTokenManager: destroyed")}static appendTokenParams(e,t,i,r){const s=new URL(e);return t&&(s.searchParams.set("token",t),null!==i&&s.searchParams.set("expires",String(i)),r&&s.searchParams.set("token_path",r)),s.toString()}static appendAkamaiTokenParams(e,t){const i=new URL(e);return i.searchParams.delete("hdnea"),i.searchParams.delete("hdntl"),i.searchParams.set("hdnea",t),i.toString()}static appendDefaultTokenParams(e,t){const i=new URL(e),r=t.responseParameters;return r?.verify&&i.searchParams.set("verify",r.verify),null!=r?.expires&&i.searchParams.set("expires",String(r.expires)),i.toString()}}function mt(e){const t={};for(const i of Object.keys(e)){const r={...e[i]};!r.serverURL&&r.licenseUrl&&(r.serverURL=r.licenseUrl),t[i]=r}return t}class gt{constructor(e){this.tokenManager=e}buildHlsConfig(e){if(!e.emeEnabled)return{};const t=this.tokenManager;return{emeEnabled:e.emeEnabled,...void 0!==e.drmSystems&&{drmSystems:mt(e.drmSystems)},licenseXhrSetup:async(e,i)=>{if(t?.extraParamsCallback){const i=await t.extraParamsCallback().catch(e=>(console.error("DrmConfigurator: extraParamsCallback error:",e),null));i?.accessToken&&e.setRequestHeader("Authorization",`Bearer ${i.accessToken}`)}const r=t?.lastTokenResponse?.extras?.drm_custom_data;if(r){const t=new URL(i);t.searchParams.delete("customdata"),t.searchParams.append("customdata",r),e.open("POST",t.toString(),!0)}else e.open("POST",i,!0)}}}}const ft=new Set(["keySystemError"]);function vt(e,t){const i=e.trigger;e.trigger=function(e,r){if(e===t.AUDIO_TRACK_LOADED){const e=r;if(e?.details){const t=this.currentLevel>=0?this.currentLevel:0,i=this.levels?.[t]?.details;if(i&&e.details.endCC>i.endCC){const t=i.endCC,r=e.details.fragments;if(r)for(let e=0;e<r.length;e++)r[e].cc>t&&(r[e].cc=t);void 0!==e.details.fragmentHint?.cc&&e.details.fragmentHint.cc>t&&(e.details.fragmentHint.cc=t),e.details.endCC=t}}}return i.call(this,e,r)}}class yt extends ot{constructor(){super(...arguments),this.driver=null,this.tokenManager=null,this.autoQuality=!0,this.eventState=null,this.liveSyncDisabled=!1}getDriver(){return this.driver}async onAttach(){if(this.state){this.state.playbackState="loading";try{await this.init()}catch(e){console.error("HlsEngine: init failed",e),this.state&&(this.state.error=e instanceof Error?e.message:String(e))}}}onDetach(){if(this.stopWatchdog(),null!==this.driver){try{this.driver.detachMedia(),this.driver.destroy()}catch(e){console.error("HlsEngine: error during driver teardown",e)}this.driver=null}this.tokenManager=null,this.eventState=null}recoverFromStall(e){this.driver&&(1===e?(console.warn("HlsEngine stall recovery: recoverMediaError"),this.driver.recoverMediaError()):(console.warn("HlsEngine stall recovery: startLoad"),this.driver.startLoad(this.video?.currentTime??-1)))}setQuality(e){null!==this.driver&&(this.driver.currentLevel=e,this.autoQuality=-1===e,null!==this.state&&(this.state.currentQuality=e))}setAudioTrack(e){null!==this.driver&&(this.driver.audioTrack=e)}setSubtitle(e){null!==this.driver&&(this.driver.subtitleTrack=e)}setPlaybackRate(e){null!==this.video&&(this.video.playbackRate=e)}seek(e){if(null!==this.video){if(!this.liveSyncDisabled&&null!==this.driver&&this.state?.isLive){const e=this.driver.config;e.liveSyncDurationCount=0,e.liveMaxLatencyDurationCount=1/0,this.liveSyncDisabled=!0}this.video.currentTime=e}}seekToLive(){if(null===this.video)return;const e=this.video.duration;Number.isFinite(e)&&(this.video.currentTime=e-30)}get detached(){return null===this.state}async init(){const{config:e,video:t,state:i,signal:r}=this;if(!(e&&t&&i&&r))return;const s=e.hlsjs;if(!s)throw new Error("HlsEngine: config.hlsjs URL is required");if(e.token&&(this.tokenManager=new pt({token:e.token,tokenType:e.tokenType,srcInTokenRequest:e.srcInTokenRequest,extraParamsCallback:e.engineSettings.extraParamsCallback??e.extraParamsCallback,onCDNTokenError:e.engineSettings.onCDNTokenError}),e.src&&await this.tokenManager.fetchToken({src:e.src}),this.detached))return;const a=await Je(s,"Hls");if(this.detached)return;const n=new gt(this.tokenManager).buildHlsConfig(e.engineSettings),o=this.tokenManager,{emeEnabled:l,drmSystems:d,...c}=e.engineSettings,h={...c};delete h.extraParamsCallback,delete h.onCDNTokenError;const b={autoStartLoad:!e.startAt,enableWorker:!0,backBufferLength:30,...h,...n,startPosition:e.startAt};if(o){const e=o;class t extends a.DefaultConfig.loader{constructor(t){super(t);const i=this.load.bind(this);this.load=function(t,r,s){if(!t.url)return void i(t,r,s);new URL(t.url).pathname.split("/").pop().endsWith(".m3u8")?e.updateUrlWithTokenParams({url:t.url}).then(e=>{t.url=e,i(t,r,s)}).catch(()=>{i(t,r,s)}):i(t,r,s)}}}b.pLoader=t}if(!e.disableCustomAbr)try{const{createHlsAbrController:e}=await Promise.resolve().then(function(){return Vt});if(this.detached)return;b.abrController=e(a)}catch(e){console.warn("HlsEngine: failed to load custom ABR controller, using default",e)}if(this.detached)return;const u=new a(b);this.driver=u,this.resolveDriverReady(),vt(u,a.Events),e.retry&&function(e){const t=new Map,i=new Set,r=new Set;let s;e.on("hlsError",(a,n)=>{const o=n.details??n.type,l=e.media?.currentTime;if(void 0!==l&&void 0!==s&&l>s+1&&(t.clear(),i.clear()),s=l,n.fatal){if(ft.has(n.type)){if(r.has(o))return;return r.add(o),void console.error(`HLS Retry: Unrecoverable error "${o}" — cannot fix by retrying.`,a,n)}return console.warn("HLS Retry: Fatal error, trying to fix now.",a,n),void setTimeout(()=>{"mediaError"===n.type?e.recoverMediaError():e.startLoad(e.media?.currentTime??-1)},1e3)}if(i.has(o))return;const d=(t.get(o)??0)+1;if(t.set(o,d),d>3)return console.warn(`HLS Retry: Non-fatal "${o}" exceeded 3 retries, giving up.`,a,n),void i.add(o);console.warn(`HLS Retry: Non-fatal error (${d}/3), monitoring.`,a,n);const c=e.media?.currentTime;setTimeout(()=>{c===e.media?.currentTime?(console.warn("HLS Retry: Stream is stuck, trying to fix",a,n),"mediaError"===n.type?e.recoverMediaError():e.startLoad(e.media?.currentTime??-1)):(console.info("HLS Retry: Stream is playing, no action needed",a,n),t.delete(o),i.delete(o))},3e3)})}(u),this.bindVideoEvents(t,i,r),u.attachMedia(t);let p=e.src??"";if(this.tokenManager&&p&&(p=await this.tokenManager.updateUrlWithTokenParams({url:p}),this.detached))return u.destroy(),void(this.driver=null);u.loadSource(p),this.registerDriverEvents(a,i),this.startWatchdog()}registerDriverEvents(e,t){const i=this.driver;if(!i)return;this.eventState=t;const{Events:r}=e;i.on(r.MANIFEST_LOADED,this._onManifestLoaded.bind(this)),i.on(r.LEVEL_LOADED,this._onLevelLoaded.bind(this)),i.on(r.LEVEL_SWITCHED,this._onLevelSwitched.bind(this)),i.on(r.AUDIO_TRACKS_UPDATED,this._onAudioTracksUpdated.bind(this)),i.on(r.AUDIO_TRACK_SWITCHED,this._onAudioTrackSwitched.bind(this)),i.on(r.SUBTITLE_TRACKS_UPDATED,this._onSubtitleTracksUpdated.bind(this)),i.on(r.SUBTITLE_TRACK_SWITCH,this._onSubtitleTrackSwitch.bind(this))}_onManifestLoaded(e,t){const i=this.eventState,r=this.driver;if(!i)return;const s=t.levels??r?.levels??[];i.qualityLevels=s.map((e,t)=>({name:e.name??`${e.height}p`,id:t,bitrate:e.bitrate,height:e.height,width:e.width}))}_onLevelLoaded(e,t){const i=this.eventState;if(!i)return;const r=t;void 0!==r?.details?.live?i.isLive=r.details.live:!0===this.config?.isLive&&(i.isLive=!0)}_onLevelSwitched(e,t){const i=this.eventState;if(i&&!this.autoQuality){const e=t;i.currentQuality=e.level}}_onAudioTracksUpdated(e,t){const i=this.eventState,r=this.driver;if(!i)return;const s=t.audioTracks??r?.audioTracks??[];i.audioTracks=s.map(e=>({id:e.id,name:e.name,lang:e.lang}))}_onAudioTrackSwitched(e,t){const i=this.eventState;if(!i)return;const r=t;i.currentAudioTrack=r.id}_onSubtitleTracksUpdated(e,t){const i=this.eventState,r=this.driver;if(!i)return;const s=t.subtitleTracks??r?.subtitleTracks??[];i.subtitleTracks=s.map(e=>({id:e.id,name:e.name,lang:e.lang}))}_onSubtitleTrackSwitch(e,t){const i=this.eventState;if(!i)return;const r=t;i.currentSubtitleTrack=r.id}}const kt=(e,t,i,r,s,a)=>{if(a<=0)return;const[{bandwidth:n},{bandwidth:o}]=t.getMediaInfo().bitrateList;return a>2&&.8*i>=n&&i<=o?e<8?a:a-1:1===a?r.getCurrentBufferLevel("video",!0)>1.5*s&&e<8?a:a-1:void 0};function xt(e){const t=e.FactoryMaker.getClassFactoryByName("SwitchRequest"),i=e.FactoryMaker.getSingletonFactoryByName("StreamController"),r=e.FactoryMaker.getSingletonFactoryByName("DashMetrics"),s=new Set;let a=0,n=15,o=15;const l=function(){return{getMaxIndex:e=>{const l=t(this.context).create();l.priority=t.PRIORITY.STRONG;const d=e.getMediaInfo().type,c=r(this.context).getInstance(),h=i(this.context).getInstance(),b=e.getAbrController();if(setInterval(()=>{var e;void 0!==(e=c.getCurrentBufferLevel("video",!0))&&(n<e&&(s.add(o),n=e,o=e),e<o&&(o=e,n=o))},1e3),"video"===d){let i,r;try{const[t,n]=(({requests:e,count:t,rulesContext:i,currentValue:r,dashMetrics:n})=>{if(!e)return[""];let o=null;for(let t=e.length-1;t>=0&&null===o;t--){const[{_tfinish:i,trequest:r,tresponse:s,trace:a}]=e[t];i&&r&&s&&a&&a.length&&(o=e[t])}if(null===o)return["No valid request made for this stream yet, bailing"];const l=(o[0]._tfinish.getTime()-o[0].trequest.getTime())/1e3,d=(o[0]._tfinish.getTime()-o[0].tresponse.getTime())/1e3;if("InitializationSegment"===o[0].type||"MediaSegment"===o[0].type){if(l<=0)return["Last segment not downloaded, probable network problem: Switching to lowest quality",0];if(s.size>=3){const o=Array.from(s),c=o.reduce((e,t)=>e+t,0)/s.size,h=((e,t)=>{const[{type:i,_tfinish:r,trequest:s,tresponse:a,trace:n}]=e[0];return"MediaSegment"!==i&&r&&s&&a&&n&&n.length?8*n.reduce((e,t)=>e+t.b[0],0)/t:0})(e,l),b=Math.sqrt(o.map(e=>(e-c)**2).reduce((e,t)=>e+t,0)/s.size);return s.clear(),c<=1.5?["Avg. Buffer < 10% of max buffer, switching to lowest quality",0]:c<=4.5?["Maintaining the current Bitrate",r]:c<=10.5&&i.getMediaInfo().bitrateList[r].bandwidth<h&&(a<t-1||b<=8)?["Switching to optimised quality level",a?kt(b,i,h,n,d,t):a+1]:["Switching to optimised quality level",kt(b,i,h,n,d,t)]}return["Maintaining the last loaded level"]}return["Last Loaded segment was not a media segment of initialization segment"]})({requests:c.getHttpRequests(d),count:e.getMediaInfo().representationCount,currentValue:b.getQualityFor(d,h.getActiveStreamInfo()),rulesContext:e,dashMetrics:c});r=t,i=n??a,a=i}catch{return s.clear(),{quality:0,reason:"Error in ABR rule",priority:t.PRIORITY.STRONG}}return l.quality=i,l.reason=r,l}return l.quality=0,l.reason="Audio Request",l}}};return l.__dashjs_factory_name="CustomAbrRule",e.FactoryMaker.getClassFactory(l)}class wt extends ot{constructor(){super(...arguments),this.driver=null,this.dvrErrorHandler=null}getDriver(){return this.driver}setConfig(e){this.config=e}setBus(e){this.bus=e}setVideo(e){this.video=e}async onAttach(){if(this.state){this.state.playbackState="loading";try{await this.init()}catch(e){console.error("DashEngine: init failed",e),this.state&&(this.state.error=e instanceof Error?e.message:String(e))}}}onDetach(){if(this.stopWatchdog(),null!==this.driver){try{this.driver.reset(),this.driver.destroy()}catch(e){console.error("DashEngine: error during driver teardown",e)}this.driver=null}null!==this.dvrErrorHandler&&(window.removeEventListener("unhandledrejection",this.dvrErrorHandler),this.dvrErrorHandler=null)}recoverFromStall(e){null!==this.video&&(1===e?(console.warn("DashEngine stall recovery: seek nudge"),this.video.currentTime+=.1):(console.warn("DashEngine stall recovery: refreshManifest"),this.driver?.refreshManifest()))}setQuality(e){null!==this.driver&&this.driver.setQualityFor("video",e)}setAudioTrack(e){if(null===this.driver)return;const t=this.driver.getTracksFor("audio");void 0!==t[e]&&this.driver.setCurrentTrack(t[e])}setSubtitle(e){if(null===this.driver)return;const t=this.driver.getTracksFor("fragmentedText");void 0!==t[e]&&this.driver.setCurrentTrack(t[e])}setPlaybackRate(e){null!==this.video&&(this.video.playbackRate=e)}seekToLive(){if(null===this.driver||null===this.video)return;const e=this.driver.duration();Number.isFinite(e)&&(this.video.currentTime=e)}async init(){const{config:e,video:t,state:i,signal:r}=this;if(!(e&&t&&i&&r))return;const s=e.dashjs;if(!s)throw new Error("DashEngine: config.dashjs URL is required");this.dvrErrorHandler=e=>{const t=e.reason;(t?.message?.includes("getCurrentDVRInfo")||String(e.reason).includes("getCurrentDVRInfo"))&&(e.preventDefault(),console.warn("DashEngine: suppressed DVR unhandledrejection"))},window.addEventListener("unhandledrejection",this.dvrErrorHandler,{signal:r});const a=await Je(s,"dashjs"),n=a.MediaPlayer().create();if(!n)throw new Error("DashEngine: dash.js MediaPlayer could not be created");var o;if(this.driver=n,this.resolveDriverReady(),n.initialize(t,e.src??"",e.autoplay??!1),e.retry&&((o=n).updateSettings({streaming:{retryIntervals:{MPD:1e3,XLinkExpansion:1e3,InitializationSegment:1e3,IndexSegment:1e3,MediaSegment:1e3,BitstreamSwitchingSegment:1e3,other:1e3,lowLatencyReductionFactor:1}}}),o.updateSettings({streaming:{retryAttempts:{MPD:1/0,XLinkExpansion:1/0,InitializationSegment:1/0,IndexSegment:1/0,MediaSegment:1/0,BitstreamSwitchingSegment:1/0,other:1/0,lowLatencyMultiplyFactor:1}}})),!e.disableCustomAbr){const e=xt(a);n.addABRCustomRule("qualitySwitchRules","CustomAbrRule",e)}e.lowLatency&&n.updateSettings({streaming:{lowLatencyEnabled:!0,liveDelay:30,liveCatchUpPlaybackRate:.01}}),this.registerDriverEvents(a,i,n),this.bindVideoEvents(t,i,r),this.startWatchdog(),await new Promise(e=>{const t=()=>{n.off(a.MediaPlayer.events.STREAM_INITIALIZED,t),e()};n.on(a.MediaPlayer.events.STREAM_INITIALIZED,t)})}registerDriverEvents(e,t,i){const r=e.MediaPlayer.events;i.on(r.STREAM_INITIALIZED,()=>{const e=i.getBitrateInfoListFor("video");t.qualityLevels=e.map((e,t)=>({name:`${e.height}p`,id:t,bitrate:e.bitrate}));const r=i.getTracksFor("audio");t.audioTracks=r.map(e=>({name:e.lang??"",id:e.id??e.index??0}));const s=i.getTracksFor("fragmentedText");t.subtitleTracks=s.map(e=>({name:e.lang??"",id:e.id??e.index??0}));const a=i.duration();t.duration=Number.isFinite(a)?Math.ceil(a):0;const n=i.getCurrentLiveLatency();"boolean"==typeof this.config?.isLive?t.isLive=this.config.isLive:t.isLive=!Number.isNaN(n),t.playbackState="playing"}),i.on(r.PLAYBACK_TIME_UPDATED,()=>{t.currentTime=Math.round(i.time())}),i.on(r.QUALITY_CHANGE_REQUESTED,()=>{t.currentQuality=i.getQualityFor("video")}),i.on(r.TRACK_CHANGE_RENDERED,()=>{t.currentAudioTrack=i.getQualityFor("audio")}),i.on(r.ERROR,e=>{const t=e;console.warn("DashEngine error:",t?.error?.message??t?.error??t)})}}function Ct(e){return e.split("?")[0].replace(/(\/hdn.*\/)/g,"/")}class _t{constructor(){this.lib=null}async integrate(e){const{video:t,driver:i,type:r,config:s,signal:a}=e;if(!s.lib||!s.manager)return;const n=await Je(s.lib,"Easybroadcast");this.lib=new n.eblib.EBLibrary(s.manager);const o=Ct(s.src??""),l={resourceManager:{tokenRemover:Ct,...(s.libSettings??{}).resourceManager??{}},swarmManager:{url:o},statsOutput:{enable:!!s.stats,url:s.stats,intervalMs:3e4},playerInput:{content:String(s.content??o),contentUrl:o,proto:r,origin:s.origin}};if("dash"===r){const e=l.resourceManager;e.randomWaitForPeers=[150,400],e.timeoutV2V=500,e.storageSize=20}this.lib.integrate([i,t],r,l),this.lib.start(),a.addEventListener("abort",()=>{null!==this.lib&&"function"==typeof this.lib.stop&&this.lib.stop(),this.lib=null},{once:!0})}}class Et{constructor(e,t){this.driver=null,this.offscreenVideo=null,this.throttleTimeout=null,this.pendingSeekTime=0,this.config=e,this.tokenManager=t}init(e){const t=document.createElement("video");t.preload="metadata",this.offscreenVideo=t;const i=this.tokenManager;let r;if(i){class t extends e.DefaultConfig.loader{constructor(e){super(e);const t=this.load.bind(this);this.load=async function(e,r,s){if(!e.url)return void t(e,r,s);new URL(e.url).pathname.split("/").pop().endsWith(".m3u8")?(e.url=await i.updateUrlWithTokenParams({url:e.url}),t(e,r,s)):t(e,r,s)}}}r=t}const s={...this.config.engineSettings??{}};delete s.extraParamsCallback,delete s.onCDNTokenError;const a={startLevel:0,enableWebVTT:!1,enableWorker:!1,maxBufferLength:1,...s,...r?{pLoader:r}:{}},n=new e(a);return this.driver=n,vt(n,e.Events),n.attachMedia(t),this.config.src&&n.loadSource(this.config.src),new Promise(t=>{n.once(e.Events.MANIFEST_LOADED,()=>{n.loadLevel=0,t()})})}take(e){this.offscreenVideo&&(null!==this.throttleTimeout&&clearTimeout(this.throttleTimeout),this.pendingSeekTime=e,this.throttleTimeout=setTimeout(this.applyPendingSeek.bind(this),250))}applyPendingSeek(){this.offscreenVideo&&(this.offscreenVideo.currentTime=this.pendingSeekTime),this.throttleTimeout=null}getVideo(){return this.offscreenVideo}destroy(){if(null!==this.throttleTimeout&&(clearTimeout(this.throttleTimeout),this.throttleTimeout=null),null!==this.driver){try{this.driver.detachMedia(),this.driver.destroy()}catch(e){console.warn("HlsSnapshotHandler: error during destroy",e)}this.driver=null}this.offscreenVideo=null}}class Tt{constructor(e){this.player=null,this.offscreenVideo=null,this.ready=!1,this.src=e}init(e){return new Promise(t=>{const i=document.createElement("video");i.style.display="none",document.body.appendChild(i),this.offscreenVideo=i;const r={take:()=>{},destroy:()=>{},video:i};let s;try{s=e.MediaPlayer().create(),this.player=s,s.initialize(i,this.src,!1),s.updateSettings({streaming:{text:{defaultEnabled:!1},buffer:{fastSwitchEnabled:!1},abr:{autoSwitchBitrate:{video:!1,audio:!1},initialBitrate:{video:0,audio:0}}}})}catch(e){const i=e instanceof Error?e.message:String(e);return console.warn("Snapshot handler initialization failed:",i),this.cleanup(),void t(r)}s.on(e.MediaPlayer.events.ERROR,e=>{const t=e;console.warn("Snapshot dash.js error:",t?.error?.message??t?.error??t)});const a=()=>{s.setMute(!0),s.off(e.MediaPlayer.events.STREAM_INITIALIZED,a),this.ready=!0;let r=null;t({take:e=>{if(this.ready&&null===r){r=setTimeout(()=>{r=null},250);try{s.seek(e),s.isPaused()&&s.play()}catch(e){const t=e instanceof Error?e.message:String(e);console.warn("Snapshot seek error:",t)}}},destroy:()=>{this.ready=!1,this.destroy()},video:i})};s.on(e.MediaPlayer.events.STREAM_INITIALIZED,a),s.on(e.MediaPlayer.events.PLAYBACK_PLAYING,()=>{s.isPaused()||s.pause()})})}destroy(){if(this.ready=!1,null!==this.player){try{this.player.reset()}catch{}this.player=null}this.cleanup()}cleanup(){null!==this.offscreenVideo&&(this.offscreenVideo.remove(),this.offscreenVideo=null)}}let Lt=null,At=null,St=null;function $t(e){null!==Lt&&Pt();const t=g(u,e),i=new st(e),r=function(e){if(null!=e&&"object"==typeof e&&"nodeType"in e)return e;const t="string"==typeof e?e:"#eb_player",i=document.querySelector(t);if(null===i)throw new Error(`EBPlayer: container element not found for selector "${t}". Ensure the element exists in the DOM before calling start().`);return i}(e.el);i.mount(r);const s=r.querySelector("video");Lt=i,At=null;let a="";const n={open(e){a=e,null!==At&&(At.detach(),At=null);const r=function(e,t){return e.includes(".mpd")&&!1!==t.dashjs?new wt:new yt}(e,t);if(null!==s&&r.setVideo(s),r.setBus(i.bus),r.setConfig(t),i.setEngineSync(r),At=r,t.lib&&t.manager&&null!==s){const a=e.includes(".mpd")&&!1!==t.dashjs,n=new _t;r.driverReady.then(()=>n.integrate({video:s,driver:r.getDriver(),type:a?"dash":"hls",config:t,signal:i.signal})).catch(e=>{console.error("EBPlayer: P2PManager integrate failed:",e)})}if(t.showProgressThumb){null!==St&&(St(),St=null);const s=e.includes(".mpd")&&!1!==t.dashjs;r.driverReady.then(()=>{if(s){const t=window;if(t.dashjs){new Tt(e).init(t.dashjs).then(e=>{St=()=>e.destroy(),i.bus.emit("snapshot-handler-ready",{take:e.take,video:e.video})}).catch(e=>{console.warn("EBPlayer: DashSnapshotHandler init failed:",e)})}}else{const r=window;if(r.Hls){let s=null;t.token&&(s=new pt({token:t.token,tokenType:t.tokenType,srcInTokenRequest:t.srcInTokenRequest,extraParamsCallback:t.engineSettings.extraParamsCallback??t.extraParamsCallback,onCDNTokenError:t.engineSettings.onCDNTokenError}));const a=new gt(s).buildHlsConfig(t.engineSettings),n=new Et({src:e,engineSettings:{...t.engineSettings,...a}},s);(s&&e?s.fetchToken({src:e}).catch(e=>{console.warn("EBPlayer: Snapshot token fetch failed:",e)}):Promise.resolve()).then(()=>n.init(r.Hls)).then(()=>{St=()=>n.destroy();const e=n.getVideo();null!==e&&i.bus.emit("snapshot-handler-ready",{take:e=>n.take(e),video:e})}).catch(e=>{console.warn("EBPlayer: HlsSnapshotHandler init failed:",e)})}else console.warn("EBPlayer: window.Hls not available after driverReady — snapshot preview disabled")}}).catch(e=>{console.warn("EBPlayer: Snapshot handler init failed:",e)})}},close(){null!==St&&(St(),St=null),null!==At&&(At.detach(),At=null)},get state(){return i.state}};return i.setReloadCallback(()=>{if(!a)return;const e=a,t=i.getSavedSelections();n.close(),setTimeout(()=>{n.open(e),setTimeout(()=>{null!==At&&(At.setQuality(t.quality),At.setAudioTrack(t.audioTrack),At.setSubtitle(t.subtitleTrack))},2e3)},100)}),t.src&&n.open(t.src),n}function Mt(){null!==At&&(At.detach(),At=null)}function Pt(){null!==At&&(At.detach(),At=null),null!==Lt&&(Lt.dispose(),Lt=null)}const Rt=t;"undefined"!=typeof window&&(console.info(`%cEBPlayer v${Rt}`,"color: #1FA9DD; font-weight: bold"),window.EBPlayer={start:$t,stop:Mt,destroy:Pt,AVAILABLE_THEMES:d,THEME_LAYOUTS:h,version:Rt});const Bt={autoplay:!0,muted:!0,src:"https://live.easybroadcast.fr/hls/live/playlist.m3u8",liveButton:!0,showProgressThumb:!0,start:!0};function qt(e){return $t(g(u,Bt,e??{}))}if("undefined"!=typeof window){const e=window.EBPlayer;e&&(e.start=qt)}const Dt=g(u,Bt);if(Dt.start){const e=Dt.el;("string"==typeof e?null!==document.querySelector(e):e instanceof HTMLElement)&&qt(Dt)}const Ft="main",zt={bufferInfo(e,t,i){if(!e.buffered||0===e.buffered.length)return{end:0,start:0,len:0,nextStart:0};for(let r=0;r<e.buffered.length;r++){const s=e.buffered.start(r),a=e.buffered.end(r);if(t>=s-i&&t<=a+i)return{end:a,start:s,len:a-t,nextStart:0}}return{end:0,start:0,len:0,nextStart:0}}};var Vt=Object.freeze({__proto__:null,createHlsAbrController:function(e){const t=e.DefaultConfig.abrController;if(!t)return class{constructor(e){}get nextAutoLevel(){return-1}set nextAutoLevel(e){}destroy(){}};const{Events:i}=e;return class extends t{constructor(e){super(e,i.FRAG_LOADING,i.FRAG_LOADED,i.FRAG_BUFFERED,i.ERROR),this.hls=e,this.lastLoadedLevel=1,this._nextAutoLevel=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.onBufferCheckTick=this._onBufferCheckTick.bind(this),this.bufferCheckLastPlayPos=0,this.bufferCheckCurrentPlayPos=0,this.bufferCheckBufferingDetected=!1,this.lastDuration=6,this.setBufferValues=new Set,this.setBitrate=new Set,this.loading=!1,this.playingTime=0,this.minBufferValue=30,this.maxBufferValue=0,this.lastBufferValue=30,this.maxBufferLength=30,this.rebuffering=0,this.rebufferingRatio=.15,this.pastBufferFactor=5,this.bitrateTestDelay=0,this.timer=void 0,this.bufferCheckTimer=void 0,this.init=!0,this.fraglastBuffered=0,this.lastLoadedFragLevel=1,this.fragCurrent=null,this.partCurrent=null,this.bufferCheckVideo=null,this.registerCustomListeners()}destroy(){this.unregisterCustomListeners(),this.clearCustomTimer(),void 0!==this.bufferCheckTimer&&(clearInterval(this.bufferCheckTimer),this.bufferCheckTimer=void 0),"function"==typeof super.destroy&&super.destroy()}registerCustomListeners(){this.hls.on(i.FRAG_LOADING,this.onFragLoading,this),this.hls.on(i.FRAG_LOADED,this.onFragLoaded,this),this.hls.on(i.FRAG_BUFFERED,this.onFragBuffered,this),this.hls.on(i.LEVEL_LOADED,this.onLevelLoaded,this),this.hls.on(i.ERROR,this.onError,this)}unregisterCustomListeners(){this.hls.off(i.FRAG_LOADING,this.onFragLoading,this),this.hls.off(i.FRAG_LOADED,this.onFragLoaded,this),this.hls.off(i.FRAG_BUFFERED,this.onFragBuffered,this),this.hls.off(i.LEVEL_LOADED,this.onLevelLoaded,this),this.hls.off(i.ERROR,this.onError,this)}clearCustomTimer(){void 0!==this.timer&&(clearInterval(this.timer),this.timer=void 0)}onFragLoading(e,t){const i=t,{frag:r}=i;this.loading=!0,r.type===Ft&&(this.timer||(this.fragCurrent=r,this.partCurrent=i.part??null,this.timer=setInterval(this.onCheck,100)))}getBuffer(){if(!this.hls.media)return 0;const e=this.hls.media.playbackRate||1,t=this.hls.media.currentTime;return(zt.bufferInfo(this.hls.media,t,this.maxBufferLength).end-t)/e}_abandonRulesCheck(){const{hls:e}=this,t=e.media,i=this.fragCurrent,r=this.partCurrent;if(!i||!t)return;if((r?r.stats:i.stats).aborted)return this.clearCustomTimer(),void(this._nextAutoLevel=-1);e.autoLevelEnabled&&!t.paused&&t.playbackRate&&t.readyState&&i.type===Ft&&"initSegment"!==i.sn&&(this.bufferCheckLastPlayPos=0,this.bufferCheckCurrentPlayPos=0,this.bufferCheckBufferingDetected=!1,this.bufferCheckVideo=t,this.bufferCheckTimer=setInterval(this.onBufferCheckTick,1e3))}_onBufferCheckTick(){if(!this.hls)return;if(!1===this.loading){const e=this.getBuffer();this.getBufferMinMaxValue(e)}const e=this.bufferCheckVideo;e&&(this.playingTime+=1,this.bufferCheckCurrentPlayPos=e.currentTime,this.bufferCheckLastPlayPos>0&&e.paused&&!this.bufferCheckBufferingDetected&&this.bufferCheckCurrentPlayPos<=this.bufferCheckLastPlayPos&&(this.rebuffering+=1,this.bufferCheckBufferingDetected=!0,this.hls.currentLevel>0&&(this.reset(),0!==this.lastLoadedFragLevel&&this.clearCustomTimer())),this.bufferCheckLastPlayPos>0&&this.bufferCheckBufferingDetected&&!e.paused&&this.bufferCheckCurrentPlayPos>this.bufferCheckLastPlayPos&&(this.bufferCheckBufferingDetected=!1),this.bufferCheckLastPlayPos=this.bufferCheckCurrentPlayPos)}onFragLoaded(e,t){const r=t,{frag:s,part:a}=r,n=a?a.stats:s.stats,o=a?a.duration:s.duration;if(this.loading=!1,s.type===Ft&&"number"==typeof s.sn){this.clearCustomTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1;const e=this.hls.levels[s.level];if(e){const t=(e.loaded?e.loaded.bytes:0)+n.loaded,i=(e.loaded?e.loaded.duration:0)+o;e.loaded={bytes:t,duration:i},e.realBitrate=Math.round(8*t/i),this.setBitrate.add(e.realBitrate),this.lastDuration=o,this.maxBufferLength=10*this.lastDuration}this.onFragBuffered(i.FRAG_BUFFERED,{stats:n,frag:s,part:a,id:s.type})}}getBufferMinMaxValue(e){this.lastBufferValue<e&&(this.setBufferValues.add(this.minBufferValue),this.maxBufferValue=e,this.lastBufferValue=e,this.minBufferValue=e),e>this.maxBufferValue&&(this.maxBufferValue=e),e<this.minBufferValue&&(this.minBufferValue=e,this.lastBufferValue=this.minBufferValue)}reset(){this.setBufferValues.clear(),this.setBitrate.clear()}onError(e,t){if("fragLoadTimeOut"===t.details)this.clearCustomTimer()}onLevelLoaded(e,t){}onFragBuffered(e,t){const i=t,{frag:r,part:s}=i,a=s?s.stats:i.stats??r.stats;if(a.aborted)return;if(r.type!==Ft||"initSegment"===r.sn)return;const n=a.loading?.start??0,o=(a.parsing?.end??0)-n;this.bitrateTestDelay=o/1e3,this.fraglastBuffered=Date.now()}findNextBestLevel(e){const t=this.hls.levels;for(let i=0;i<t.length;i++){if(i<t.length-2&&.8*this.avgBitrate>=t[i].bitrate&&this.avgBitrate<=t[i+1].bitrate)return this.reset(),this.lastLoadedFragLevel=e<3?i:i-1,this.lastLoadedFragLevel;if(i===t.length-1){return this.getBuffer()>this.lastDuration+this.lastDuration/2&&e<3?this.lastLoadedFragLevel=i:this.lastLoadedFragLevel=i-1,this.reset(),this.lastLoadedFragLevel}}return this.lastLoadedFragLevel}get avgBitrate(){return 0===this.setBitrate.size?0:Array.from(this.setBitrate).reduce((e,t)=>e+t,0)/this.setBitrate.size}set avgBitrate(e){}findBestLevel(){if(!this.hls)return 0;const e=this.hls.levels.length-1,t=this.getBuffer();if(t<.1*this.hls.config.maxBufferLength)return this.reset(),this.lastLoadedFragLevel=Math.max(this.lastLoadedFragLevel-1,0),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel;if(!0===this.init)return this.init=!1,this.lastLoadedFragLevel=e,this.lastLoadedFragLevel;if(t>.3*this.hls.config.maxBufferLength)return this.lastLoadedFragLevel=this.findNextBestLevel(5),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel;if(this.setBufferValues.size>=this.pastBufferFactor)try{const t=Array.from(this.setBufferValues).reduce((e,t)=>e+t,0)/this.setBufferValues.size,i=function(e){const t=e.reduce((e,t)=>e+t,0)/e.length,i=e.map(e=>(e-t)**2);return Math.sqrt(i.reduce((e,t)=>e+t,0)/(e.length-1))}(Array.from(this.setBufferValues));this.setBufferValues.clear();const r=this.hls.levels[this.hls.currentLevel]?.bitrate??0;return t<=.1*this.hls.config.maxBufferLength&&r>=this.hls.levels[0].bitrate?(this.reset(),this.lastLoadedFragLevel=Math.max(this.lastLoadedFragLevel-1,0),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel):t<=.3*this.hls.config.maxBufferLength?(this.reset(),this.lastLoadedFragLevel):t<=.7*this.hls.config.maxBufferLength&&r<this.avgBitrate?(this.reset(),this.lastLoadedFragLevel=this.findNextBestLevel(i),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel):t>.7*this.hls.config.maxBufferLength&&r<.8*this.avgBitrate?(this.lastLoadedFragLevel=this.findNextBestLevel(i),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel):(this.reset(),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel)}catch(t){return console.warn("HLS ABR: findBestLevel error",t),this.lastLoadedFragLevel=this.findNextBestLevel(3),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel}return this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel}get _nextABRAutoLevel(){try{return this.playingTime>0&&this.rebuffering/this.playingTime>this.rebufferingRatio?(this.lastLoadedFragLevel=0,0):(this.setBitrate.size>0&&(this.lastLoadedFragLevel=this.findBestLevel()),this.lastLoadedFragLevel)}catch(e){return console.warn("HLS ABR: Could not define level, using last loaded level",e),this.lastLoadedFragLevel}}get nextAutoLevel(){return this._nextABRAutoLevel}set nextAutoLevel(e){this._nextAutoLevel=e}}}});return e.destroy=Pt,e.start=qt,e.stop=Mt,e}({});